// JavaScript Document
// Image Pre-Loader & Rotate Script - written by www.Ragnaru.com

var delay = 5000; // time delay between rotates, 1000 = 1 second
var anoOfImgs = 3; // Put the number of images

// First line width, height
// Second line path to image
lpic0 = new Image(850,367);
lpic0.src = "http://www.hrssportinggoods.com/homepage/091109/whatever-it-takes.jpg";
lpic1 = new Image(850,367);
lpic1.src = "http://www.hrssportinggoods.com/homepage/091109/2010-baseball-arriving-daily.jpg";
lpic2 = new Image(850,367);
lpic2.src = "http://www.hrssportinggoods.com/homepage/091109/basketball.jpg";

// Use same path here as above
var aimgArry = new Array()
   aimgArry[0] = "http://www.hrssportinggoods.com/homepage/091109/whatever-it-takes.jpg";
   aimgArry[1] = "http://www.hrssportinggoods.com/homepage/091109/2010-baseball-arriving-daily.jpg";
   aimgArry[2] = "http://www.hrssportinggoods.com/homepage/091109/basketball.jpg";
var aimgLink = new Array()
   aimgLink[0] = "football-equipment.html";
   aimgLink[1] = "baseball-equipment.html";
   aimgLink[2] = "basketball-equipment.html";
function rotateImage(aimgNo)
{
   clearTimeout(timerId);

   if(aimgNo == anoOfImgs)
   {
      aimgNo = 0;
   }
     else if(navigator.appName == "Microsoft Internet Explorer"){	
      document.getElementById("Aimage").style.filter="blendTrans(duration=1)";
	  document.getElementById("Aimage").filters.blendTrans.apply();
	  document.getElementById("Aimage").filters.blendTrans.play();
	  document.getElementById('Aimage').src = aimgArry[aimgNo];
	  document.getElementById('headerLinkMe').href= aimgLink[aimgNo];
	  aimgNo++;}
   else{
	  document.getElementById('Aimage').src = aimgArry[aimgNo];
	  document.getElementById('headerLinkMe').href= aimgLink[aimgNo];
      aimgNo++;
	}

   var recur_call = "rotateImage('" + aimgNo + "')";

   setTimeout(recur_call, delay);
}

// Wait a bit before starting the rotation
var timerId = setTimeout('rotateImage(0,0)', 5000);