var i = 1;
var bannerDelay = null;

var BlankImage = new Image();
BlankImage.src = "images/spacer.gif";

function getRandom(maxPic) {
     randNum = 0;
     while (randNum == i || randNum < 1) {
        randNum = (Math.round((Math.random() * maxPic)));
     } 
     return randNum;
}

function Timer(){
		i = getRandom(TotalBan);
		var Wdth = 550;
		if (screen.width <= 800) { Wdth = 324; }
		else { Wdth = 550; }
  
		var tmpW = imgWidth[i];  //eval("banner" + i).width;
		var tmpH = imgHeight[i];  //eval("banner" + i).height;
		if (tmpH > 70) {
			tmpW = ((70 / tmpH) * tmpW);
			tmpH = 70;
			
		}
		if (tmpW > Wdth) {
			tmpH = ((Wdth / tmpW) * tmpH);
			tmpW = Wdth;
		}
		document.SlideShow.src = eval("banner" + i + ".src");
		document.SlideShow.width = tmpW;
		document.SlideShow.height = tmpH;
		bannerDelay = setTimeout('Timer()',3000);
}

function clickLink(){
	top.location = links[i];
}