/* for Mozilla */
var isLoaded = false;

if (document.addEventListener) {
	document.addEventListener("DOMContentLoaded", loginPageInit, null);
	isLoaded = true;
}

/* for Internet Explorer */
if(isLoaded == false) {
	/*@cc_on @*/
	/*@if (@_win32)
		document.write("<script defer src=js/loginPageOnload.js><"+"/script>");
	/*@end @*/
	isLoaded = true;
}

/* for other browsers */
if(isLoaded == false) {
	window.onload = loginPageInit;
}
window.onresize = loginPageResize;

function loginPageInit() {
	loginPageResize();
	var uidElement = DOM.gI("uid");
	if(uidElement) {
		uidElement.focus();
	}
}

function loginPageResize() {
	var getWindowSize = new Array();
	var myWidth = 785, myHeight = 550;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth - 1;
		myHeight = window.innerHeight - 1;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	
	//alert(myWidth + " " + myHeight);
	var element = DOM.gI("loginPageBox");
	var newMarginTop = parseInt((myHeight / 2) - 123)
	if(newMarginTop < 0) {
		newMarginTop = 0;
	}
	if(element) {
		element.style.marginTop = newMarginTop + "px";
		element.style.display = "block";
	}
}
