// note: the 2nd image ("img02") will be the first to appear in the animation
// all images must be the same dimensions
// works in NS 3, IE/NS 4+
// other browsers or javascript disabled will see only the original image and link and no animation

var has_loaded = 0;

if (document.images) {
  img01 = new Image(335,154);
  img01.src = "http://www.naturalpoint.com/trackir/images/home/rotate/game-arma-2-operation-arrowhead.gif";
  
  img02 = new Image(335,154);
  img02.src = "http://www.naturalpoint.com/trackir/images/home/rotate/game-f1-2010.gif";
    
  img03 = new Image(335,154);
  img03.src = "http://www.naturalpoint.com/trackir/images/home/rotate/game-colin-mcrae-dirt-3.gif";

  img04 = new Image(335,154);
  img04.src = "http://www.naturalpoint.com/trackir/images/home/rotate/game-dcs-a-10c-warthog.gif";

  img05 = new Image(335,154);
  img05.src = "http://www.naturalpoint.com/trackir/images/home/rotate/game-apache-air-assault.gif";

  img06 = new Image(335,154);
  img06.src = "http://www.naturalpoint.com/trackir/images/home/rotate/game-flight-simulator-x.gif";

  has_loaded = 1;
}

go_URL = new Array();
go_URL[0] = "http://www.naturalpoint.com/trackir/03-enhanced-games/game-arma-2-operation-arrowhead.html";
go_URL[1] = "http://www.naturalpoint.com/trackir/03-enhanced-games/game-f1-2010.html";
go_URL[2] = "http://www.naturalpoint.com/trackir/03-enhanced-games/game-colin-mcrae-dirt-3.html";
go_URL[3] = "http://www.naturalpoint.com/trackir/03-enhanced-games/game-dcs-a-10c-warthog.html";
go_URL[4] = "http://www.naturalpoint.com/trackir/03-enhanced-games/game-apache-air-assault.html";
go_URL[5] = "http://www.naturalpoint.com/trackir/03-enhanced-games/game-flight-simulator-x.html";

imgID = new Array();
imgID[0] = img01.src;
imgID[1] = img02.src;
imgID[2] = img03.src;
imgID[3] = img04.src;
imgID[4] = img05.src;
imgID[5] = img06.src;

var pause = 6500; // pause how long in milliseconds (1000 = 1 sec)

//var a = 0;
var a = Math.floor(Math.random() * imgID.length);
var b = (go_URL.length - 1);

function rotate(imgN) {
  if (has_loaded == 1) {
    if (a == b) {
      a = 0;
      }
    else {
    a++;
  }
  document.images[imgN].src = imgID[a];
  setTimeout('rotate("rotate_img")',pause);
  } // end of if has_loaded

  if (window.status != '') { window.status = go_URL[a]; return true; }
} // end of function rotate
 
function goto_url() {
  if (document.images) {
    document.location=(go_URL[a]);
  }
  else {
    return false;
  }
}

var oldOnload = window.onload;
if (typeof oldOnload == 'function') { window.onload = function() { oldOnload(); rotate("rotate_img"); } }
else { window.onload = function() { rotate("rotate_img"); } }



