window.onload=function(){
	if(!document.getElementById("txtUsername")) return;
	if(!document.getElementById("txtPassword")) return;
	
	document.getElementById("txtUsername").onfocus=onfocusUsername;
	document.getElementById("txtUsername").onblur=onblurUsername;
	
	document.getElementById("txtPassword").onfocus=onfocusPassword;
	document.getElementById("txtPassword").onblur=onblurPassword;
	document.getElementById("txtPassword").onkeypress=pressEnter;
	
	//document.getElementById("txtUsername").onblur();
	//document.getElementById("txtPassword").onblur();
	//	openInfo();
}

function openMenu(option1){
	switch(option1){
		case "banking":
			document.getElementById("bank").onclick();
		break;
		case "tournament":
			document.getElementById("tour").onclick();
		break;
		case "about-us":
			document.getElementById("about").onclick();
		break;
		case "promotions":
			document.getElementById("promo").onclick();
		break;
		case "games":
			document.getElementById("bj-games").onclick();
		break;
		case "other":
			document.getElementById("other-games").onclick();
		break;
		
	}
}

	
function onfocusUsername(){
	var ie=navigator.appName;	
	
	this.style.backgroundImage ="url(/images/header-form-input-empty.jpg)";
	this.style.border="#53B744 solid 1px";
	this.style.width="68px";
	
	if(String(ie).toUpperCase().indexOf('MICROSOFT')>=0){
		document.getElementById("txtPassword").style.marginLeft="9px";
        document.getElementById("txtPassword").style.marginTop="-19px";
		

	}
	
}

function onblurUsername(){
	var ie=navigator.appName;	
	if(this.value!=""){
		this.style.backgroundImage ="url(/images/header-form-input-empty.jpg)";
		this.style.border="none";
	}
	else{
		this.style.backgroundImage ="url(/images/header-form-input-login.jpg)";
		this.style.border="none";
		this.style.marginTop="5px";
		if(String(ie).toUpperCase().indexOf('MICROSOFT')>=0){
		this.style.marginTop="3px";
		}
		
	}
}
function onfocusPassword(){
	this.style.backgroundImage ="url(/images/header-form-input-empty.jpg)";
	this.style.border="#53B744 solid 1px";
	this.style.width="68px";
}
function onblurPassword(){
	var ie=navigator.appName;
	if(this.value!="") {
			this.style.backgroundImage ="url(/images/header-form-input-empty.jpg)";
			this.style.border="none";
		}else{
			this.style.backgroundImage ="url(/images/header-form-input-password.jpg)";
			this.style.border="none";
			if(String(ie).toUpperCase().indexOf('MICROSOFT')>=0){
			this.style.marginTop="3px";
			}
		}
}


function pressEnter(events){
	var evento=events|| window.event;
	if(evento.keyCode==13){
		document.frm.eventSource.value='btnPlay';
		document.frm.eventType.value='onClick';
		document.frm.submit();
	}
} 

function openPageNewWindow(page) {
	var width  = 830;
	var height = 500;
	var top    = (screen.height-height)/2-40;
	var left   = (screen.width-width)/2;
	winRefAdm  = window.open(page, 'winRefAdm', 'scrollbars=yes,resizable=yes,top=' + top + ',left=' + left + ',width=' + width + ',height=' + height);
}