function setDefaultState(){

	usercd = getCookie("im_user_id");
	if(document.form.account.value.length == 0 && usercd != null){
		document.form.account.value = usercd;
	}

	if(document.form.account.value.length == 0){
		document.form.account.focus();
	}else{
		document.form.password.focus();
	}
}

function fieldCheck(){
	var msg1 = "Please input your ID.";
	var msg2 = "Please input your password.";
	var usercd = document.form.account.value;
	var passwd = document.form.password.value;
	var period = new Date()

	if(usercd.length == 0){
		window.alert(msg1);		/* user ID nothing. */
		return;
	}
//	if(passwd.length == 0){
//		window.alert(msg2);		/* password nothing */
//		return;
//	}

	document.form.id.value = document.form.account.value;
	document.form.pwd.value = document.form.password.value;
	document.form.account.value = "";
	document.form.password.value = "";

	period.setTime(period.getTime() + 604800000);

	// HTTP protocol judgment!!
	var bSecure = false;
	if (window.location.protocol.indexOf( "https") != -1){
		bSecure = true;
	}

	setCookie("im_user_id", document.form.id.value, period,null,null,bSecure);
	
	document.loginform.id.value = usercd;
	document.loginform.pwd.value = passwd;
	
	document.loginform.submit();
	
}

