//---------------------------------------------------------------
//
//	Ad Cycler - Advertising Page
//
//---------------------------------------------------------------

var CycleTime = "10";	// ad cycle is every 20 seconds
CycleTime = CycleTime * 1000;

var Index = 0;
var Images = new Array();
var URL = new Array();
var Objects;

//each ad section contains a max of 3 cycling ads
//when maximum is reached, promo ad should be removed
//the two arrays are used for all ad positions. 0-2=Left Top Ads, 3-5=Right Top Ads, 6-8=Left Link Ads, 9-11=Page Bottom Ads, and
//12-14=Right Bar Ads

//Left Links
Images[0] = "Pictures/BannerAds/springshostinglogo.gif";
URL[0] = "http://www.springshosting.com/";
Images[1] = "Pictures/AdPromo3.gif";
URL[1] = "Advertising.html#OnlineAds";

//Right Links
Images[3] = "Pictures/AdPromo3.gif";
URL[3] = "Advertising.html#OnlineAds";

//Link Links
Images[6] = "Pictures/AdPromo2.jpg";
URL[6] = "Advertising.html#OnlineAds";

//Bottom Links
Images[9] = "Pictures/AdPromo3.gif";
URL[9] = "Advertising.html#OnlineAds";

//Far Right Links
Images[12] = "Pictures/AdPromo.jpg";
URL[12] = "Advertising.html#OnlineAds";

//----------------------------------------------------
function Cycler() {
Switch();
setInterval("Switch()", CycleTime);
}

function Switch() {	//multiplier indicates number of ads in that ad cycler (0 is one ad)

PickLeft = Math.round((Math.random()*1));		//*2 when full
leftcycle.src = Images[PickLeft];
leftlink.href = URL[PickLeft];

PickRight = (Math.round((Math.random()*0))+3);	//*2 +3 when full
rightcycle.src = Images[PickRight];
rightlink.href = URL[PickRight];

PickLink = (Math.round((Math.random()*0))+6);	//*2 +6 when full
linkcycle.src = Images[PickLink];
linklink.href = URL[PickLink];

PickBottom = (Math.round((Math.random()*0))+9);	//*2 +9 when full
bottomcycle.src = Images[PickBottom];
bottomlink.href = URL[PickBottom];

PickFarRight = (Math.round((Math.random()*0))+12);	//*2+12 when full
farrightcycle.src = Images[PickFarRight];
farrightlink.href = URL[PickFarRight];
}
