/***** Set background for Home page *****/
var currentImage = 1;
var noOfImages = 10; 
	
function setBackground()
{
	var iSetNo = Math.round((Math.random() * 11) + 0.5)
	
	document.getElementById("top").style.backgroundImage = "url(../images/background/home/" + iSetNo + "/bg_top.jpg)";
	document.getElementById("middle").style.backgroundImage = "url(../images/background/home/" + iSetNo + "/bg_middle.jpg)";
	document.getElementById("bottom").style.backgroundImage = "url(../images/background/home/" + iSetNo + "/bg_bottom.jpg)";
}

/***** Rollover text *****/
function homeRollover(sID)
{
	document.getElementById(sID).style.visibility = "visible";
}

function homeRolloff(sID)
{
	document.getElementById(sID).style.visibility = "hidden";
}

function showBgImage(inIndex)
{	
    if(inIndex != null) currentImage = inIndex;
    else currentImage++;	
    
	if(currentImage == (noOfImages+1) ) currentImage = 1; // go back to number 1...
	
	document.getElementById("top").style.backgroundImage = "url(../images/background/home/" + currentImage + "/bg_top.jpg)";
	document.getElementById("middle").style.backgroundImage = "url(../images/background/home/" + currentImage + "/bg_middle.jpg)";
	document.getElementById("bottom").style.backgroundImage = "url(../images/background/home/" + currentImage + "/bg_bottom.jpg)";				
	setTimeout("showBgImage(null)",7000);
}

function randomizeImg() 
{
	return Math.floor(Math.random() * (noOfImages)) + 1;
}
