// JavaScript Document

function isNum(str) 
{
        // Return false if characters are not '0-9' or '.' .
        for (var i = 0; i < str.length; i++)
        {
                var ch = str.substring(i, i + 1);
                if ((ch < "0" || "9" < ch) && ch != '.' && ch != '-')
                {
                        return 1;
                }
        }
        return 0;
}


function isEmail(val)
{
      // Return false if e-mail field does not contain a '@' and '.' .
        if (val.indexOf ('@',0) == -1 || val.indexOf ('.',0) == -1)
        {
                return 1;
        }
        else
        {
                return 0;
        }
		
}

function isSTR(val){
        var str = val;
        // Return false if characters are not a-z, A-Z, or a space.
        for (var i = 0; i < str.length; i++){
                var ch = str.substring(i, i + 1);
                if (((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && ch != ' '){
                return 1;
                }
        }
        return 0;
}


function validate_login()
{
	
		var jl_email=document.login_frm.login_emailid.value; 
		var jl_pasword=document.login_frm.login_pass.value;
		var error_message="There are following errors while Processing :\n";
		var error=0;
	 


 if (jl_email == "" ||  isEmail(jl_email)) {
                error_message = error_message + "Enter the correct email address\n";
                error = 1;
 }	
 
 if((jl_pasword=="") || (jl_pasword.length<3) )
{
	error_message=error_message+"Please enter Password. \n";
	  error = 1;
}
			  
if (error == 1)
	    {
				alert(error_message);
                return false;
        } 
		else {
                return true;
        }
		
}