function checkLogin(theForm,user,pass) {

   
    var why = "";

    foc=0;

    why += checkUsername(theForm.username.value,user);
        if( why != ''&& foc==0 ) {
    			document.login.username.focus();
    			foc=1;
    			}

    why += checkPassword(theForm.password.value,pass);
        if(why != '' && foc==0 ){
    			document.login.password.focus();
    			foc=1;
    			} 

       if (why != "")  

    { 

	      alert(why); 
	      return false; 
    } 
   else 
   {

		document.login.submit();
	 }
}



