var targetURLS 	= new Array();
targetURLS[0]  = "#";
targetURLS[1]  = "#";
targetURLS[2]  = "#";
targetURLS[3]  = "#";
targetURLS[4]  = "#";
targetURLS[5]  = "#";
targetURLS[6]  = "#";
targetURLS[7]  = "#";
targetURLS[8]  = "#";
targetURLS[9]  = "#";
targetURLS[10]  = "#";
targetURLS[11]  = "#";
targetURLS[12]  = "#";
targetURLS[13]  = "#";
targetURLS[14]  = "#";
targetURLS[15]  = "#";

var bannerIMGS 	= new Array();
bannerIMGS[0] 	= "http://www.plumbingrepairedright.com/slideshow/1.jpg";
bannerIMGS[1] 	= "http://www.plumbingrepairedright.com/slideshow/9.jpg";
bannerIMGS[2] 	= "http://www.plumbingrepairedright.com/slideshow/10.jpg";
bannerIMGS[3] 	= "http://www.plumbingrepairedright.com/slideshow/11.jpg";
bannerIMGS[4] 	= "http://www.plumbingrepairedright.com/slideshow/12.jpg";
bannerIMGS[5] 	= "http://www.plumbingrepairedright.com/slideshow/13.jpg";
bannerIMGS[6] 	= "http://www.plumbingrepairedright.com/slideshow/14.jpg";
bannerIMGS[7] 	= "http://www.plumbingrepairedright.com/slideshow/15.jpg";
bannerIMGS[8] 	= "http://www.plumbingrepairedright.com/slideshow/16.jpg";
bannerIMGS[9] 	= "http://www.plumbingrepairedright.com/slideshow/2.jpg";
bannerIMGS[10] 	= "http://www.plumbingrepairedright.com/slideshow/3.jpg";
bannerIMGS[11] 	= "http://www.plumbingrepairedright.com/slideshow/4.jpg";
bannerIMGS[12] 	= "http://www.plumbingrepairedright.com/slideshow/5.jpg";
bannerIMGS[13] 	= "http://www.plumbingrepairedright.com/slideshow/6.jpg";
bannerIMGS[14] 	= "http://www.plumbingrepairedright.com/slideshow/7.jpg";
bannerIMGS[15] 	= "http://www.plumbingrepairedright.com/slideshow/8.jpg";


var newBanner = 0;
var currentBanner = 0;
function displayBanner(){			
	document.write("<a name='TestLinkPT' id='TestLinkPT' href='" + targetURLS[newBanner] +  "' target='_self'>");
	document.write("<img name='TestImagePT' id='TestImagePT' src='" + bannerIMGS[newBanner] + "' border='0' style='border: 0px solid #222222;' alt=\"Bruno Plumbing and Heating Technicians\"></a>");
	currentBanner = newBanner;
	window.setTimeout("getNewBanner()", 7000);
}

function getNewBanner(){
	//Get a new banner
	if (newBanner < bannerIMGS.length - 1)
	{
		newBanner = newBanner + 1;
	} else {
		newBanner = 0;
	}
	
	//newBanner = Math.floor(Math.random() * bannerIMGS.length);
	//If is not the current banner change the SRC and URL, then assign the new banner
	if(currentBanner != newBanner){				
		document.getElementById('TestLinkPT').href = targetURLS[newBanner];
		document.getElementById('TestImagePT').src = bannerIMGS[newBanner];
		currentBanner = newBanner;
		
		}
	window.setTimeout("getNewBanner()",7000);
}
displayBanner();

