function getCookie(Name) {
	var search = Name + "="

	if (document.cookie.length > 0) {
		var offset = document.cookie.indexOf(search)
		if (offset != -1) {
			offset += search.length
			var end = document.cookie.indexOf(";", offset)
			if (end == -1)
				end = document.cookie.length
			return unescape(document.cookie.substring(offset, end))
		}
	}
	return ""
}
function setCookie( name, value, expiredays )
{
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

function cook_proc()
{
	if (document.login.user_cook.checked ){
		user_id = document.login.ID.value;
		setCookie("mns_user_id", user_id , 30);
	} else {
		setCookie("mns_user_id", "" , 30);
	}
}
function submitOK() {
	if(ChkID()&&ChkPassword())
		document.login.submit();
}
function EnterShift() {
	var keyValue = event.keyCode;
	if (keyValue =='13') {
		if(ChkID())
		document.login.PWD.focus();
	}
}
function EnterDown() {
	var keyValue = event.keyCode;
	if (keyValue =='13')
		if(ChkID()&&ChkPassword())
			document.login.submit();
}
function load_cook(){
	user_id = getCookie("mns_user_id");

	if (user_id != ""){
		document.login.ID.value = user_id;
		document.login.user_cook.checked = true;
		document.login.PWD.focus();
	} else {
		document.login.ID.focus();
	}
}
function ChkPassword(){
        var id =document.login.ID.value;
        var pwd = document.login.PWD.value;
        if( pwd.length < 1) {
                alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
                document.login.PWD.focus();
                return false;
        } 
        return true;
}
function ChkID() {
        var id =document.login.ID.value;
        var len = id.length;
        if ( len < 1 ) {
                alert('ID¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.');
                document.login.ID.focus();
                return false;
        }
        return true;
}