function submitPage(url,handler,code){

if(isBlank(document.forms[0].userName.value)){
            alert("Please enter a valid email address");
            document.forms[0].userName.focus();
            return false;
        }
if(isBlank(document.forms[0].password.value)){
            alert("Please enter a  password");
            document.forms[0].password.focus();
            return false;
        }
    document.forms[0].action=url+'?handler='+handler+'&code='+code;
    document.forms[0].submit();
}

function checkLoginEnter(event,url,handler,code){
    if(ifEnterKey(event))
        return submitPage(url,handler,code);
  
    return true;
}
function isBlank(str){
                                                                                                                           

       for (var i=0; i<str.length; i++){
               if (str.charAt(i) != " ") return false;  
       }
       return true;
 } 
function ifEnterKey(event){
     if (document.all) {
        kcode=window.event.keyCode;
     }
     else
        kcode=event.which;

     if (kcode==13) {
        return true;
     }
     else {
        return false;
     }
}