var id
var bDown = false

function openImg(img, width, height) {
	strURL = "imgPop.php?img=" + img;
	strDimensions = "width="+width+",height="+height
	window.open(strURL,"final",strDimensions);
}

function doIt() {
	bDown = false
	window.clearTimeout(id)
	if (parseInt(lyr1.style.top) > 114){
		lyr1.style.top = parseInt(lyr1.style.top) - 10 + "px";
	}
	if (parseInt(lyr2.style.top) > 114){
		lyr2.style.top = parseInt(lyr2.style.top) - 10 + "px";
	}
	if (parseInt(lyr3.style.top) > 114){
		lyr3.style.top = parseInt(lyr3.style.top) - 10 + "px";
	}
	if (parseInt(lyr4.style.top) > 114){
		lyr4.style.top = parseInt(lyr4.style.top) - 10 + "px";
	}
	if (parseInt(lyr5.style.top) > 114){
		lyr5.style.top = parseInt(lyr5.style.top) - 10 + "px";
	}
	if (parseInt(lyr6.style.top) > 114){
		lyr6.style.top = parseInt(lyr6.style.top) - 10 + "px";
	}
	if (parseInt(lyr7.style.top) > 114){
		lyr7.style.top = parseInt(lyr7.style.top) - 10 + "px";
	}

	if (parseInt(lyr8.style.top) > 114){
		lyr8.style.top = parseInt(lyr8.style.top) - 10 + "px";
	}
	if (parseInt(lyr9.style.top) > 114){
		lyr9.style.top = parseInt(lyr9.style.top) - 10 + "px";
		id = setTimeout("doIt()",50);
	}
	if (parseInt(lyr10.style.top) > 114){
		lyr10.style.top = parseInt(lyr10.style.top) - 10 + "px";
		id = setTimeout("doIt()",50);
	}
	if (parseInt(lyr11.style.top) > 114){
		lyr11.style.top = parseInt(lyr11.style.top) - 10 + "px";
		id = setTimeout("doIt()",50);
	}
}

function slideDown(){
	window.clearTimeout(id)
	if (parseInt(lyr1.style.top) < 134){
		lyr1.style.top = parseInt(lyr1.style.top) + 10 + "px";
	}
	if (parseInt(lyr2.style.top) < 154){
		lyr2.style.top = parseInt(lyr2.style.top) + 10 + "px";
	}
	if (parseInt(lyr3.style.top) < 174){
		lyr3.style.top = parseInt(lyr3.style.top) + 10 + "px";
	}
	if (parseInt(lyr4.style.top) < 194){
		lyr4.style.top = parseInt(lyr4.style.top) + 10 + "px";
	}
	if (parseInt(lyr5.style.top) < 214){
		lyr5.style.top = parseInt(lyr5.style.top) + 10 + "px";
	}
	if (parseInt(lyr6.style.top) < 234){
		lyr6.style.top = parseInt(lyr6.style.top) + 10 + "px";
	}
	if (parseInt(lyr7.style.top) < 254){
		lyr7.style.top = parseInt(lyr7.style.top) + 10 + "px";
	}
	if (parseInt(lyr8.style.top) < 274){
		lyr8.style.top = parseInt(lyr8.style.top) + 10 + "px";
		id = setTimeout("slideDown()",25);
	}
	if (parseInt(lyr9.style.top) < 294){
		lyr9.style.top = parseInt(lyr9.style.top) + 10 + "px";
		id = setTimeout("slideDown()",25);
	}
	if (parseInt(lyr10.style.top) < 314){
		lyr10.style.top = parseInt(lyr10.style.top) + 10 + "px";
		id = setTimeout("slideDown()",25);
	}
	if (parseInt(lyr11.style.top) < 334){
		lyr11.style.top = parseInt(lyr11.style.top) + 10 + "px";
		id = setTimeout("slideDown()",25);
	}
	if (parseInt(lyr11.style.top) == 334) {
		bDown = true
	}
}

function slideUp(){
	if (bDown) {
		window.clearTimeout(id)
		id = setTimeout("doIt()",1000)
	}
}

function init(){
		var top = 114
		lyr1 = document.getElementById("lyrProd1");
		lyr2 = document.getElementById("lyrProd2");
		lyr3 = document.getElementById("lyrProd3");
		lyr4 = document.getElementById("lyrProd4");
		lyr5 = document.getElementById("lyrProd5");
		lyr6 = document.getElementById("lyrProd6");
		lyr7 = document.getElementById("lyrProd7");
		lyr8 = document.getElementById("lyrProd8");
		lyr9 = document.getElementById("lyrProd9");
		lyr10 = document.getElementById("lyrProd10");
		lyr11 = document.getElementById("lyrProd11");
		lyr1.style.top = top;
		lyr2.style.top = top;
		lyr3.style.top = top;
		lyr4.style.top = top;
		lyr5.style.top = top;
		lyr6.style.top = top;
		lyr7.style.top = top;
		lyr8.style.top = top;
		lyr9.style.top = top;
		lyr10.style.top = top;
		lyr11.style.top = top;
}

function stay() {
	if (bDown) {
		window.clearTimeout(id)
	} else {
		slideDown()
	}
}

function changeLink(lyr) {
	document.getElementById(lyr).style.color = "#FF0033"
}

function changeLinkBack(lyr) {
	document.getElementById(lyr).style.color = "#006699"
}

function findit() {

	x = (document.body.offsetWidth / 2) - 106
	y = document.body.offsetHeight

	document.getElementById("lyrProducts").style.left = x + "px"
	document.getElementById("lyrProducts").style.visibility = "visible"
	document.getElementById("lyrProd1").style.left = x + "px"
	document.getElementById("lyrProd1").style.visibility = "visible"
	
	document.getElementById("lyrProd2").style.left = x + "px"
	document.getElementById("lyrProd2").style.visibility = "visible"
	
	document.getElementById("lyrProd3").style.left = x + "px"
	document.getElementById("lyrProd3").style.visibility = "visible"
	document.getElementById("lyrProd4").style.left = x + "px"
	document.getElementById("lyrProd4").style.visibility = "visible"
	document.getElementById("lyrProd5").style.left = x + "px"
	document.getElementById("lyrProd5").style.visibility = "visible"
	document.getElementById("lyrProd6").style.left = x + "px"
	document.getElementById("lyrProd6").style.visibility = "visible"
	document.getElementById("lyrProd7").style.left = x + "px"
	document.getElementById("lyrProd7").style.visibility = "visible"
	document.getElementById("lyrProd8").style.left = x + "px"
	document.getElementById("lyrProd8").style.visibility = "visible"

	document.getElementById("lyrProd9").style.left = x + "px"
	document.getElementById("lyrProd9").style.visibility = "visible"
	
	document.getElementById("lyrProd10").style.left = x + "px"
	document.getElementById("lyrProd10").style.visibility = "visible"
	
	document.getElementById("lyrProd11").style.left = x + "px"
	document.getElementById("lyrProd11").style.visibility = "visible"

	x = (document.body.offsetWidth / 2) - 325
	document.getElementById("lyrItsLogo").style.left = x + "px"
	document.getElementById("lyrItsLogo").style.visibility = "visible"

	x = (document.body.offsetWidth / 2) + 215
	document.getElementById("lyrItLogo").style.left = x + "px"
	document.getElementById("lyrItLogo").style.visibility = "visible"


/*
	if (document.body.offsetWidth < 750) {
		if (screen.width >= 1024) {
			window.resizeTo(770,700)
		x = (screen.width - 770) / 2
			y = (screen.height - 700) / 2
			window.moveTo(x,y)

		} else {
			window.resizeTo(770,550)
			x = (screen.width - 770) / 2
			y = (screen.height - 550) / 2
			window.moveTo(x,y)
		}
	}
*/
}