//reset the two text box.
function Reset(){
	var oTxt1=document.getElementById("txt_username");
	oTxt1.value="";
	var oTxt2=document.getElementById("txt_password");
	oTxt2.value="";
}

//check the input of the user name and password.
function CheckInput(){
	var oTxt1=document.getElementById("txt_username");
	var oTxt2=document.getElementById("txt_password");
	if((oTxt1.value=="")||(oTxt2.value==""))
	{
		alert ("Please enter valid user name and password.");
		return false;
	}
	else
	{
		return true;
	}
}

function Login()
{
	var oTxt1=document.getElementById("txt_username");
	var oTxt2=document.getElementById("txt_password");
	var strQuery;
	strQuery="function=login&username="+oTxt1.value+"&passwd="+oTxt2.value;
	if (AjaxCalling(strQuery,"ZZ_PCL_ajaxcontrol.php")=="true")
	{
		location.href="index.php";
	}
	else
	{
		alert("User name or password error. If you are very sure that your input is correct, please contact admins for help.");
	}
}

