// JavaScript Document

<!--

///////////////////////////////////////////////////////////////////////////
//NEW ROTATOR CODE 1/25/2007

/*
This script randomly starts the banner rotation. 
What happens is the first banner is loaded and is imediately changed once the page loads. 
To not have the first banner load all the time, you can create a transparent image the same 
size as the other banners and put it in the IMG tag. 
*/

//MAIN AD

iMain = 2 // Number of banners that you have
bannerMain1 = new Image();
bannerMain1.src = "http://www.mbaonline.org/banners/bannerMain1.gif";
bannerMain2 = new Image();
bannerMain2.src = "http://www.mbaonline.org/banners/bannerMain2.gif";

linksMain = new Array
linksMain[1] = "http://www.davidgoliath.com"
linksMain[2] = "http://www.lshofwi.com"

descriptionMain = new Array
descriptionMain[1] = "David and Goliath Builders"
descriptionMain[2] = "Lifstyle Homes of Wisconsin LLC"

function randombannerMain()
{
	var randomnumberMain = Math.random();
	iMain = Math.round( (iMain - 1) * randomnumberMain) + 1;
	//FOR JS ERRORS ON PAGES WITH NO ADS//
	if (document.bannerMain != null) {
		document.bannerMain.src = eval("bannerMain" + iMain + ".src");
	}
	//alert(document.banner);
}

function startTimeMain()
{
	var time= new Date();
	hours= time.getHours();
	mins= time.getMinutes();
	secs= time.getSeconds();
	closeTimeMain = hours * 3600 + mins * 60 + secs;
	closeTimeMain += 5;
	//alert(closeTime);
	if (document.bannerMain != null) { //ADD TO TEST NULL
		TimerMain(); //THIS WAS WITHOUT THE IF STATEMENT AROUND IT
	} //ADD TO TEST NULL
}

function TimerMain()
{
	var time = new Date();
	hours = time.getHours();
	mins = time.getMinutes();
	secs = time.getSeconds();
	curTimeMain = hours * 3600 + mins * 60 + secs		
	//alert(curTime + ">=" + closeTime);		
	if (curTimeMain >= closeTimeMain)
	{
		if (iMain < 2) //number of banners? was 3
		{
			iMain++;
			document.bannerMain.src = eval("bannerMain" + iMain + ".src");
		}
		else
		{
			iMain = 1;
			document.bannerMain.src = eval("bannerMain" + iMain + ".src");
		}
		startTimeMain();
	}
	else
	{
		window.setTimeout("TimerMain()",10000) //TEN SECONDS
	}
}

function clickLinkMain()
{
	top.location = linksMain[iMain]
}

function descriptMain()
{
	window.status = descriptionMain[iMain]
}

//MAIN AD END

//ABODE AD

iAbode = 2 // Number of banners that you have
bannerAbode1 = new Image();
bannerAbode1.src = "http://www.mbaonline.org/banners/bannerAbode1.gif";
bannerAbode2 = new Image();
bannerAbode2.src = "http://www.mbaonline.org/banners/bannerAbode2.gif";

linksAbode = new Array
linksAbode[1] = "http://www.larosalandscape.com/"
linksAbode[2] = "http://homesbytowne.com/home/search/wisconsin/index.htm"

descriptionAbode = new Array
descriptionAbode[1] = "La Rosa Landscape"
descriptionAbode[2] = "Homes By Towne"

function randombannerAbode()
{
	var randomnumberAbode = Math.random();
	iAbode = Math.round( (iAbode - 1) * randomnumberAbode) + 1;
	//FOR JS ERRORS ON PAGES WITH NO ADS//
	if (document.bannerAbode != null) {
		document.bannerAbode.src = eval("bannerAbode" + iAbode + ".src");
	}
	//alert(document.banner);
}

function startTimeAbode()
{
	var time= new Date();
	hours= time.getHours();
	mins= time.getMinutes();
	secs= time.getSeconds();
	closeTimeAbode = hours * 3600 + mins * 60 + secs;
	closeTimeAbode += 5;
	//alert(closeTime);
	if (document.bannerAbode != null) { //ADD TO TEST NULL
		TimerAbode(); //THIS WAS WITHOUT THE IF STATEMENT AROUND IT
	} //ADD TO TEST NULL
}

function TimerAbode()
{
	var time = new Date();
	hours = time.getHours();
	mins = time.getMinutes();
	secs = time.getSeconds();
	curTimeAbode = hours * 3600 + mins * 60 + secs		
	//alert(curTime + ">=" + closeTime);		
	if (curTimeAbode >= closeTimeAbode)
	{
		if (iAbode < 2) //number of banners? was 3
		{
			iAbode++;
			document.bannerAbode.src = eval("bannerAbode" + iAbode + ".src");
		}
		else
		{
			iAbode = 1;
			document.bannerAbode.src = eval("bannerAbode" + iAbode + ".src");
		}
		startTimeAbode();
	}
	else
	{
		window.setTimeout("TimerAbode()",10000) //TEN SECONDS
	}
}

function clickLinkAbode()
{
	top.location = linksAbode[iAbode]
}

function descriptAbode()
{
	window.status = descriptionAbode[iAbode]
}

//ABODE AD END

//EXPO BUTTON AD

iExpoButton = 2 // Number of banners that you have
bannerExpoButton1 = new Image();
bannerExpoButton1.src = "http://www.mbaonline.org/banners/bannerExpoButton1.gif";
bannerExpoButton2 = new Image();
bannerExpoButton2.src = "http://www.mbaonline.org/banners/bannerExpoButton2.gif";

linksExpoButton = new Array
linksExpoButton[1] = "http://www.builtbymeridian.com"
linksExpoButton[2] = "http://www.builtbymeridian.com"

descriptionExpoButton = new Array
descriptionExpoButton[1] = "Meridian Homes, Inc"
descriptionExpoButton[2] = "Meridian Homes, Inc"

function randombannerExpoButton()
{
	var randomnumberExpoButton = Math.random();
	iExpoButton = Math.round( (iExpoButton - 1) * randomnumberExpoButton) + 1;
	//FOR JS ERRORS ON PAGES WITH NO ADS//
	if (document.bannerExpoButton != null) {
		document.bannerExpoButton.src = eval("bannerExpoButton" + iExpoButton + ".src");
	}
	//alert(document.banner);
}

function startTimeExpoButton()
{
	var time= new Date();
	hours= time.getHours();
	mins= time.getMinutes();
	secs= time.getSeconds();
	closeTimeExpoButton = hours * 3600 + mins * 60 + secs;
	closeTimeExpoButton += 5;
	//alert(closeTime);
	if (document.bannerExpoButton != null) { //ADD THIS LINE TO TEST NULL
		TimerExpoButton(); //THIS WAS WITHOUT THE IF STATEMENT AROUND IT
	} //ADD THIS LINE TO TEST NULL
}

function TimerExpoButton()
{
	var time = new Date();
	hours = time.getHours();
	mins = time.getMinutes();
	secs = time.getSeconds();
	curTimeExpoButton = hours * 3600 + mins * 60 + secs		
	//alert(curTime + ">=" + closeTime);		
	if (curTimeExpoButton >= closeTimeExpoButton)
	{
		if (iExpoButton < 2) //number of banners? was 3
		{
			iExpoButton++;
			document.bannerExpoButton.src = eval("bannerExpoButton" + iExpoButton + ".src");
		}
		else
		{
			iExpoButton = 1;
			document.bannerExpoButton.src = eval("bannerExpoButton" + iExpoButton + ".src");
		}
		startTimeExpoButton();
	}
	else
	{
		window.setTimeout("TimerExpoButton()",10000) //TEN SECONDS
	}
}

function clickLinkExpoButton()
{
	top.location = linksExpoButton[iExpoButton]
}

function descriptExpoButton()
{
	window.status = descriptionExpoButton[iExpoButton]
}

//EXPO BUTTON AD END

//EXPO VERTICLE AD

iExpoVerticle = 2 // Number of banners that you have
bannerExpoVerticle1 = new Image();
bannerExpoVerticle1.src = "http://www.mbaonline.org/banners/bannerExpoVerticle1.gif";
bannerExpoVerticle2 = new Image();
bannerExpoVerticle2.src = "http://www.mbaonline.org/banners/bannerExpoVerticle2.gif";

linksExpoVerticle = new Array
linksExpoVerticle[1] = "http://www.sjjanis.com/"
linksExpoVerticle[2] = "http://www.timobrienhomes.com/"

descriptionExpoVerticle = new Array
descriptionExpoVerticle[1] = "SJ Janis Company, Inc"
descriptionExpoVerticle[2] = "Tim OBrien Homes"

function randombannerExpoVerticle()
{
	var randomnumberExpoVerticle = Math.random();
	iExpoVerticle = Math.round( (iExpoVerticle - 1) * randomnumberExpoVerticle) + 1;
	//FOR JS ERRORS ON PAGES WITH NO ADS//
	if (document.bannerExpoVerticle != null) {
		document.bannerExpoVerticle.src = eval("bannerExpoVerticle" + iExpoVerticle + ".src");
	}
	//alert(document.banner);
}

function startTimeExpoVerticle()
{
	var time= new Date();
	hours= time.getHours();
	mins= time.getMinutes();
	secs= time.getSeconds();
	closeTimeExpoVerticle = hours * 3600 + mins * 60 + secs;
	closeTimeExpoVerticle += 5;
	//alert(closeTime);
	if (document.bannerExpoVerticle != null) { //ADD THIS LINE TO TEST NULL
		TimerExpoVerticle(); //THIS WAS WITHOUT THE IF STATEMENT AROUND IT
	} //ADD THIS LINE TO TEST NULL
}

function TimerExpoVerticle()
{
	var time = new Date();
	hours = time.getHours();
	mins = time.getMinutes();
	secs = time.getSeconds();
	curTimeExpoVerticle = hours * 3600 + mins * 60 + secs		
	//alert(curTime + ">=" + closeTime);		
	if (curTimeExpoVerticle >= closeTimeExpoVerticle)
	{
		if (iExpoVerticle < 2) //number of banners? was 3
		{
			iExpoVerticle++;
			document.bannerExpoVerticle.src = eval("bannerExpoVerticle" + iExpoVerticle + ".src");
		}
		else
		{
			iExpoVerticle = 1;
			document.bannerExpoVerticle.src = eval("bannerExpoVerticle" + iExpoVerticle + ".src");
		}
		startTimeExpoVerticle();
	}
	else
	{
		window.setTimeout("TimerExpoVerticle()",10000) //TEN SECONDS
	}
}

function clickLinkExpoVerticle()
{
	top.location = linksExpoVerticle[iExpoVerticle]
}

function descriptExpoVerticle()
{
	window.status = descriptionExpoVerticle[iExpoVerticle]
}

//EXPO VERTICLE AD END

//NEW ROTATOR CODE 1/25/2007
///////////////////////////////////////////////////////////////////////////

