
var nWidth, nHeight, nTop, nLeft,IEv6;
function get_window_size(){
	var ua = navigator.userAgent;
	var nHit = ua.indexOf("MSIE");
	var bIE = (nHit >=  0);
	var bVer6 = (bIE && ua.substr(nHit+5, 1) == "6");
	var bStd = (document.compatMode && document.compatMode=="CSS1Compat");
	IEv6 = false;
	if (bIE) {
		if (bVer6 && bStd) {
			nWidth = document.documentElement.clientWidth;
			nHeight = document.documentElement.clientHeight;
			nTop = document.documentElement.scrollTop;
			nLeft = document.documentElement.scrollLeft;
		}
		else {
			if(typeof document.body.style.maxHeight != "undefined") {
				//IE7
				nWidth = document.documentElement.clientWidth;
				nHeight = document.documentElement.clientHeight;
				nTop = document.documentElement.scrollTop;
				nLeft = document.documentElement.scrollLeft;
			}
			else {
				IEv6 = true;
				nWidth = document.body.clientWidth;
				nHeight = document.body.clientHeight;
				nTop = document.body.scrollTop;
				nLeft = document.body.scrollLeft;
			}
		}
	}
	else {
		nWidth = window.innerWidth;
		nHeight = window.innerHeight;
		nTop = document.body.scrollTop  || document.documentElement.scrollTop;
		nLeft = document.body.scrollLeft || document.documentElement.scrollLeft;
	}
	ui_resize();
}
function login(){
	var d = window.document;
	if(d.getElementById('webpad_login_password').value != ""){
		return true;
	}
	else {
		d.getElementById('error_msg').innerHTML = 'LOGIN ERROR : login password uninputs it.';
		d.getElementById('error_msg').style.display = 'block';
		return false;
	}
}
function ui_resize(){
	var d = window.document;
	var lTop = (nHeight - 320) / 2;
	var lLeft = (nWidth - 540) / 2;
	d.getElementById('login_window').style.top = lTop + "px";
	d.getElementById('login_window').style.left = lLeft + "px";
	d.getElementById('login_wrapper').style.top = lTop + "px";
	d.getElementById('login_wrapper').style.left = lLeft + "px";
}
window.onresize = get_window_size;
window.onload = function(){
	get_window_size();
	if(document.getElementById('error_msg').innerHTML != ""){
		document.getElementById('error_msg').style.display = 'block';
	}
	document.getElementById('webpad_login_password').focus();
}
