/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Lee Underwood :: http://javascript.internet.com/ */

var newBanner = 0;
var totalBan = 0;

function start(imgArr){
	totalBan = imgArr.length;
	newBanner=Math.floor(Math.random()*20)
	cycleBan();
}

function cycleBan() {
  var i=0;
  while(i<6){
	  if (newBanner == totalBan) {
		newBanner = 0;
	  }
	  document.getElementById('link'+i).href=("detailedProduct.php?ITEM="+imgArr[newBanner]);
	  document.getElementById('banner'+i).src=("Images/products/thumbs/" + imgArr[newBanner] + ".png");
	  i++;
	  newBanner++;
  }
  
  setTimeout("cycleBan()", 4000);
}

