/* 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 bannerImg = new Array();
  // Enter the names of the images below
  bannerImg[0]="../../assets/images/home/protection_ad.jpg";
  bannerImg[1]="../../assets/images/home/detect_ad.jpg";
  bannerImg[2]="../../assets/images/home/smooth_ad.jpg";
  bannerImg[3]="../../assets/images/home/ondemand_ad.jpg";
  bannerImg[4]="../../assets/images/home/retail_ad.jpg";

var bannerLink = new Array();
  // Enter the names of the images below
  bannerLink[0]="/Data-Protection.php";
  bannerLink[1]="/23.php";
  bannerLink[2]="/81.php";
  bannerLink[3]="/OnDemand-Services.php";
  bannerLink[4]="/Store.php";
var newBanner = 0;
var totalBan = bannerImg.length;

function cycleBan() {
  var temper = document.getElementById("banner_img");
  if(temper != null){
	   newBanner++;
	   if (newBanner == totalBan) {
		 newBanner = 0;
	   }
	   temper.src=bannerImg[newBanner];
	   temper.onclick=function(){
			document.location.href = bannerLink[newBanner];   
	   }
	   //alert(temper.src);
	   // set the time below for length of image display
	   // i.e., "4*1000" is 4 seconds
	   setTimeout("cycleBan()", 4*1000);
  }
}
window.onload=cycleBan;
