//centering functions
function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}

function centerElt(aId) 
{
	var windowHeight = getWindowHeight();
	if (windowHeight > 0) {
		var contentElement = document.getElementById(aId);
		var contentHeight = contentElement.offsetHeight;
		if (windowHeight - contentHeight > 0) {
			contentElement.style.position = 'relative';
			var myTop = ((windowHeight / 2) - (contentHeight / 2))-30;
			myTop = (myTop>2)?myTop:2;
			contentElement.style.top = myTop + 'px';
		}
		else {
			contentElement.style.position = 'static';
		}
	}
}
	


function loadme()
{
	var welcomeImg = new Image();
	if (screen.width < 1280)
	{
		if (screen.height < 768)
		{
			document.getElementById("mainTable").style.display='none';
			document.body.style.backgroundPosition = "bottom left";
			document.body.style.backgroundRepeat = "no-repeat";
			document.body.style.backgroundAttachment = "fixed";
			document.body.style.backgroundImage = "url(img/price800x600.gif)";
			document.getElementById("mainTable2").height = getWindowHeight()-10;
			switch (jsCurrentPage.value)
			{
				case "bio" :
					document.getElementById("divBio2").style.left = "85px";
					document.getElementById("bioTable").style.backgroundPosition = "top right";
					document.getElementById("bioTable").style.backgroundRepeat = "no-repeat";
					document.getElementById("bioTable").style.backgroundAttachment = "fixed";
					document.getElementById("bioTable").style.backgroundImage = "url(img/welcomeB"+Math.round(Math.random()*2)+".jpg)";				
				break;
				case "chant" :
					document.getElementById("divChant1").style.left = "-10px";
					document.getElementById("divChant1").style.top = "-30px";
					document.getElementById("divChant2").style.left = "60px";
					document.getElementById("divChant2").style.top = "-15px";	
					document.getElementById("divListen").style.left = "170px";									
				break;
				case "compo" :
					document.getElementById("divCompo1").style.top = "0px";
					document.getElementById("divCompo2").style.top = "-20px";
					document.getElementById("divCompo3").style.top = "-50px";
					document.getElementById("divCompo4").style.top = "-117px";
					document.getElementById("divCompo5").style.top = "-125px";
					document.getElementById("divListen").style.top = "-47px";
				break;
				case "coach" :
					document.getElementById("divCoach1").style.left = "10px";
					document.getElementById("divCoach2").style.left = "0px";
					document.getElementById("divCoach2").style.top = "-15px";				
				break;
				case "extraits" :
					document.getElementById("divExtraits1").style.left = "-95px";
					document.getElementById("divExtraits2").style.left = "115px";
					document.getElementById("divExtraits3").style.left = "-145px";				
				break;
			}
		}
		else
		{
			document.getElementById("mainTable").width="100%";
			document.getElementById("mainTable").height=60;
			document.getElementById("td1").style.height="40px";
			document.getElementById("td1").style.width="135px";			
			document.getElementById("td2").style.fontSize="35px";
			document.getElementById("td3").style.width="70px";			
			document.getElementById("welcome_portrait").width="41";
			document.getElementById("welcome_portrait").height="60";			
			document.getElementById("td4").style.fontSize = "14px";
			document.getElementById("mainTable2").height = getWindowHeight()-75;
			welcomeImg.src = "img/welcomeB"+Math.round(Math.random()*2)+".jpg";
			document.getElementById("welcome_portrait").src = welcomeImg.src;
		}
		document.getElementById("mainTable2").width = "100%";
	}
	else
	{
		welcomeImg.src = "img/welcome"+Math.round(Math.random()*2)+".jpg";
		document.getElementById("welcome_portrait").src = welcomeImg.src;
	}
	
	//handleMenus();

	document.getElementById("loading").style.display = "none";
	document.getElementById("myDiv").style.visibility = "visible";
}