var detect = navigator.userAgent.toLowerCase();

function checkIt(string){
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}

function sUp(){
	if (checkIt('msie')){ //browser check
		//if(document.frmEL.hdNonPostback.value == "1"){document.frmEL.UserID.focus();}
		document.frmEL.clientX.value = screen.width;
	}
	else{
		if(document.frmEL.hdNonPostback.value == "1"){document.forms[0].UserID.focus();}
		document.forms[0].clientX.value = screen.availWidth;
	}
	detectPopupBlocker();
}
function login(){
	window.event.returnValue = false;
	if(validatePage()){
		if(screen.width < 650){
			alert("Sorry Horizon Will Not Run At A Screen Resolution Of Less Than 800*600");
		}else{
			document.getElementById("ELBody").style.cursor = 'wait';	
			document.getElementById("DivSavingAlert").style.zIndex = 100;
			document.getElementById("DivSavingAlert").style.visibility = 'inherit';
			document.frmEL.submit();
		}
	}
}
function ScreenEnter(){
	if (window.event.keyCode == 13){ //user has selected enter key
		document.frmEL.btnLogin.focus();
		login();
	}
}

var VWidth = 98;
var LWidth = 30;
var VHeight = 60;
var LHeight = 50;

function OpenAnimateBox(){
	//animate across
	if(LWidth<VWidth){
		LWidth +=1.5
		eval("document.getElementById('dvNFC').style.width = '" + LWidth + "%'");
		if(LHeight<VHeight){
			LHeight += 1.5;
			eval("document.getElementById('dvNFC').style.top = '" + LHeight + "%'");
		}
		setTimeout("OpenAnimateBox()",50);
	}
}



function ReverseAnimate(){
	//animate across
	if(LWidth>VWidth){
		LWidth -=1
		eval("document.getElementById('dvNFC').style.width = '" + LWidth + "%'");
		setTimeout("ReverseAnimate()",50);
	}else{
		VWidth = 100;
		OpenAnimateBox();
	}
}


function detectPopupBlocker() {
  var myTest = window.open("about:blank","","directories=no,height=100,width=100,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no,top=0,location=no");
  if (!myTest) {
    //show pop up blocker message
    document.getElementById("DivPopUpBlocker").style.display = "Block";
  } else {
    myTest.close();
  }
}

