function login_chkblank(){
	if(frm_login.username.value=="" || frm_login.username.value=="Username"){alert("กรุณากรอก Username ด้วย");frm_login.username.focus();return false;}
	if(frm_login.password.value==""){alert("กรุณากรอก Password ด้วย");frm_login.password.focus();return false;}
	
	var j = new ajax();
	j.jaxinit();
	j.addvar("username", encodeURI(document.frm_login.username.value));
	j.addvar("password", encodeURI(document.frm_login.password.value));
	j.addvar("mode","chklogin");
	j.processOnly=true;
	j.processajax("ajax_operation.php");	
	if(j.responseText==1){
		j.jaxinit();
		j.show_pleasewait=false;
		j.addvar("mode","login_yes");
		j.processajax("ajax_operation.php","divloginform");
	}else{
		alert("Username กับ Password ไม่ถูกต้อง");	
	}
}

function  frm_login_show_password(){
	frm_login.password_temp.style.display="none";
	frm_login.password.style.display="block";
	frm_login.password.focus();
}

function login_ckhuser(){
	if(frm_login.username.value=="" || frm_login.username.value=="Username"){alert("กรุณากรอก Username ด้วย");frm_login.username.focus();return false;}
	if(frm_login.password.value==""){alert("กรุณากรอก Password ด้วย");frm_login.password.focus();return false;}
	
	var j = new ajax();
	j.jaxinit();
	j.addvar("username", encodeURI(document.frm_login.username.value));
	j.addvar("password", encodeURI(document.frm_login.password.value));
	j.addvar("mode","chklogin");
	j.processOnly=true;
	j.processajax("ajax_operation.php");
	
	if(j.responseText==1){
		alert("ยินดีต้อนรับ ท่านสามารถร่วมสนุกกับ www.CityVariety.com");
		document.getElementById("div_alert_login").style.display="none"; 
		document.getElementById("div_frm_login").style.display="none";
	}else{
		alert("Username กับ Password ไม่ถูกต้อง");	
	}
	
}

function show_div_login(){ 
	document.getElementById("div_frm_login").style.display="block";	
}