var LogoWidth = 0;
var BGCount = 0;
var LimgCount = 0;
var	cdimgs = [
	"graphics/400/P1010191.jpg",
	"graphics/400/P1010387.jpg",
	"graphics/400/IMG00010-20100616-1645.jpg",
	"graphics/400/IMG00014-20100616-1647.jpg"
	];

function LoadNextImg () {
	setTimeout(NextImg, 100);
}

function NextImg () {
	if (LimgCount <= cdimgs.length - 1) {
		writetostatus('Preloading Image[' + LimgCount + ']: ' + cdimgs[LimgCount]);
		document.getElementById("onscreenpl").src = cdimgs[LimgCount];
		LimgCount = LimgCount + 1;
	} else {
		writetostatus('Page Loaded');
	}
}

function StartPage () {
	LogoWidth = 600;
	document.getElementById("loadbar").style.display = "none";
	document.getElementById("loadtext").style.display = "none";
	document.getElementById("loaddiv").style.display = "none";
	document.getElementById("main").style.display = "block";
	setTimeout(HideLoad, 100);
}

function HideLoad () {
	if (LogoWidth < 3) {
		document.getElementById("loadlogo").style.display = "none";
		//document.getElementById("background").style.zIndex = "2";	
		//document.getElementById("main").style.zIndex = "5";
		LoadNextImg();
	} else {
		LogoWidth = LogoWidth - 50;
		document.getElementById("logoimg").style.width = LogoWidth + "px";
		setTimeout(HideLoad, 50);
	}
}
function BGLoad () {
	BGCount = BGCount + 1;
	if (BGCount == 2) {
		document.getElementById("bg_img_1").style.width = screen.availWidth + "px";
		document.getElementById("bg_img_2").style.width = screen.availWidth + "px";
		SetSky(1);
		//document.getElementById("sky").style.width = screen.availWidth + "px";
		document.getElementById("loadlogo").style.backgroundColor = "transparent";
	}
}
function SetSky (sSky) {
	if (sSky == 0) {
		document.getElementById("bg_td_top").style.backgroundColor = "#FFF";
	} else if (sSky == 1) {
		document.getElementById("bg_td_top").style.backgroundColor = "#3CF";
	} else if (sSky == 2) {
		document.getElementById("bg_td_top").style.backgroundColor = "#0CF";
	} else if (sSky == 3) {
		document.getElementById("bg_td_top").style.backgroundColor = "#76D5FF";
	} else if (sSky == 9) {
		document.getElementById("bg_td_top").style.backgroundColor = "#141E4C";
	}
}
function openPage(sPage) {
	makePOSTRequest('index.exe','content=' + sPage,'contentbody');
}
