// JavaScript Document
function loginValidation()
{
	flag=0; 	
	strpattern=/^[@a-zA-Z0-9-&().,\s]*$/;
	if(nullCheck(document.frmlogin.txtusername.value)==false)
	{
		msg("frmlogin","Please enter user name.","txtusername",1);
		flag=1;		
		return false;
	}
	else if(nullCheck(document.frmlogin.txtpassword.value)==false)
	{
		msg("frmlogin","Please enter password.","txtpassword",1);
		flag=1;
		return false;
	}
	else if(strpattern.test(document.frmlogin.txtusername.value)==false)
	{
		msg("frmlogin","Please enter valid characters.","txtusername",1);
		flag=1;
		return false;	
	}
	else if(strpattern.test(document.frmlogin.txtpassword.value)==false)
	{
		msg("frmlogin","Please enter valid characters.","txtpassword",1);
		flag=1;
		return false;	
	}
	else if(flag==0)
	{
		document.frmlogin.action="index_action.php";
		document.frmlogin.submit();		
	}
}
function ValidateLogin()
{
	flag=0;
	if(nullCheck(document.frmlogin.txtusername.value)==false)
	{
		msg("frmlogin","Please enter user name.","txtusername",1);
		flag=1;		
		return false;
	}
	else if(nullCheck(document.frmlogin.txtpassword.value)==false)
	{
		msg("frmlogin","Please enter password.","txtpassword",1);
		flag=1;
		return false;
	}	
	else if(flag==0)
	{
		document.frmlogin.action="login_action.php";
		document.frmlogin.submit();	
	}
}
function setFcous()
{
	document.frmlogin.txtusername.focus();
}
