// Javascript functions for JF VIP Lounge
function ValidateForm(theform)
{
	var an = document.getElementById("accountnumber").value;
	var pw = document.getElementById("pas").value;

/*	var anc = <?php echo $_COOKIE['accountnumber']?>;
	var pwc = <?php echo $_COOKIE['pas']?>;
	
	
	if (anc||pwc){
		document.getElementById("accountnumber").value = anc;
		document.getElementById("pas").value = pwc;
		vipform.submit();
	}*/

	if(document.getElementById("pas").value=="")
	{
		alert("Invalid password, please try again");
		theform.pas.focus();
		return false;
	}
  //vipform.action='<? echo $_SERVER['PHP_SELF']?>';
  vipform.submit();
}

// Opacity start
function opacity(id, opacStart, opacEnd, millisec) {
	//speed for each frame
	var speed = Math.round(millisec / 100);
	var timer = 0;

	//determine the direction for the blending, if start and end are the same nothing happens
	if(opacStart > opacEnd) {
		for(i = opacStart; i >= opacEnd; i--) {
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	} else if(opacStart < opacEnd) {
		for(i = opacStart; i <= opacEnd; i++)
			{
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	}
}
function opacity1(id, opacStart, opacEnd, millisec) {
	//speed for each frame
	var speed = Math.round(millisec / 100);
	var timer = 0;

	//determine the direction for the blending, if start and end are the same nothing happens
	if(opacStart > opacEnd) {
		for(i = opacStart; i >= opacEnd; i--) {
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	} else if(opacStart < opacEnd) {
		for(i = opacStart; i <= opacEnd; i++)
			{
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	}
	setTimeout("document.getElementById(z01).display='none'", (timer * speed));
}
//change the opacity for different browsers
function changeOpac(opacity, id) {
	var object;
	object = document.getElementById(id).style;
	object.opacity = (opacity / 100);
	object.MozOpacity = (opacity / 100);
	object.KhtmlOpacity = (opacity / 100);
	object.filter = "alpha(opacity=" + opacity + ")";
}
function hideDiv(id)
{
	id.style.display="none";
}
window.onresize=refDiv;
function refDiv()
{
	var ref=document.getElementById("z01").style.display;
	document.getElementById("z01").style.display=ref;

}

function moveLeft(obj)
{

	var timer=1;
	var speed = 1000;
	for (i=0;i>=(-16);i--)
	{
		setTimeout("document.getElementById('zaglushka').style.left=i+'px'", (timer*speed));
		timer++;
		//alert((timer++)*speed + "  " + i+'px');
	}
}