//---------------------------------------------------------------
//
//	Ad Cycler - Main 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";
Images[1] = "Pictures/BannerAds/GoodFaith.jpg";
URL[1] = "http://goodfaithfinancial.com";
Images[2] = "Pictures/AdPromo.jpg";
URL[2] = "Pictures/AdPromo.jpg";


//Right Links
Images[3] = "Pictures/AdPromo3.gif";
URL[3] = "Advertising.html#OnlineAds";
Images[4] = "Pictures/BannerAds/TechnoGuySmall.jpg";
URL[4] = "http://www.technoguycomputers.com";

//Link Links
Images[6] = "Pictures/AdPromo2.jpg";
URL[6] = "Advertising.html#OnlineAds";

//Bottom Links
Images[9] = "Pictures/AdPromo3.gif";
URL[9] = "Advertising.html#OnlineAds";
//Images[10] = "Pictures/BannerAds/GGCareCenter.jpg";
//URL[10] = "http://ggcarecenter.com/index.htm";

//Far Right Links
Images[12] = "Pictures/AdPromo.jpg";
URL[12] = "Advertising.html#OnlineAds";
//Images[12] = "Pictures/BannerAds/PPRTA2009.jpg";
//URL[12] = "http://www.pprta.com/";
Images[13] = "Pictures/BannerAds/Planescape.jpg";
URL[13] = "http://planescapecomic.com";
//Images[14] = "Pictures/BannerAds/PPRTA2009.jpg";
//URL[14] = "http://www.pprta.com/";

//----------------------------------------------------
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()*2));		//*2 when full
document.getElementById('leftcycle').src = Images[PickLeft];
document.getElementById('leftlink').href = URL[PickLeft];

PickRight = (Math.round((Math.random()*1))+3);	//*2 +3 when full
document.getElementById('rightcycle').src = Images[PickRight];
document.getElementById('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
document.getElementById('bottomcycle').src = Images[PickBottom];
document.getElementById('bottomlink').href = URL[PickBottom];

PickFarRight = (Math.round((Math.random()*0))+12);	//*2+12 when full
document.getElementById('farrightcycle').src = Images[PickFarRight];
document.getElementById('farrightlink').href = URL[PickFarRight];
}
