function onSubmit1() 
		{	
     var user = document.frmlogin.txtUsername.value;
	 var pass = document.frmlogin.txtPassword.value;
	document.frmlogin.action="validate.asp?user=" + user + "&pass=" + pass;
		}
	
function login1()
	{
	 var user = document.frmlogin.txtUsername.value;
	 var pass = document.frmlogin.txtPassword.value;
	
		
		if 	(validateNotEmpty(user) == false)
		{
			alert("User Name cannot be blank.");
			document.frmlogin.txtUsername.focus();
			return false;
		}

		if 	(validateNotEmpty(pass) == false)
		{
			alert("Password cannot be blank.");
			document.frmlogin.txtPassword.focus();
			return false;
		}

		
		}


function validateNotEmpty( strValue ) {

   var strTemp = strValue;
   strTemp = trimAll(strTemp);
   if(strTemp.length > 0){
     return true;
   }  
   return false;
}


function trimAll( strValue ) {

 var objRegExp = /^(\s*)$/;

    //check for all spaces
    if(objRegExp.test(strValue)) {
       strValue = strValue.replace(objRegExp, '');
       if( strValue.length == 0)
          return strValue;
    }
    
   //check for leading & trailing spaces
   objRegExp = /^(\s*)([\W\w]*)(\b\s*$)/;
   if(objRegExp.test(strValue)) {
       //remove leading and trailing whitespace characters
       strValue = strValue.replace(objRegExp, '$2');
    }
  return strValue;
}

function isProper(string) {
    if (string.search(/^\w+( \w+)?$/) != -1)
        return true;
    else
        return false;
}


