function validateLogin()
{
	var LoginId=document.Login.LoginId.value;
	var Password=document.Login.Password.value;
	
	if ( LoginId == "" || LoginId == null ) 
		{
			alert('Please enter Login Id');
			document.Login.LoginId.focus();
			return false;
		}
		
	if (LoginId.length < 6)
	{
		alert('Member ID is less than 6 characters');
		document.Login.LoginId.focus();
		return false;
	}	
	
	if (Password == "" || Password == null)
		{
			alert('Please enter Password');
			document.Login.Password.focus();
			return false;
	}
	
	
	if (Password.length < 6)
	{
		alert('Password is less than 6 characters');
		document.Login.Password.focus();
		return false;
	}	
	
		
	return true;
}

function check_space(spaceval)
{

	while (spaceval.charAt(0) == " "){
	// remove leading spaces
	spaceval = spaceval.substring(1);
	}
	while (spaceval.charAt(spaceval.length - 1) == " "){
	// remove trailing spaces
	spaceval = spaceval.substring(0,spaceval.length - 1);
	}	
	if(spaceval == "")
	{
		return false;
	}
	return true;
}

function chkUserId() {
   var theForm = document.login_frm;
   var theValue = login_frm.UserId.value;
   var digArray = "1234567890";
   if ((theValue.length == 0) || (check_space(theValue) == "")) {
      //alert(theValue+" Inside if ");
      theForm.UserId.value = "";
      alert("Please enter valid User ID ");
      theForm.UserId.focus();
      theForm.UserId.select();
      return false;
   } 
   if (theForm.Password.value == "")
   { 
       alert("Please enter the Password");
       theForm.Password.focus();
       return false;
   }
	document.login_frm.action = "LoginSubmit.jsp";
	//alert("Hello");
	//document.location.href = "LoginSubmit.jsp?UserId="+theValue+"&Password="+theForm.Password.value;
        document.login_frm.submit();
        //eval("document.location='LoginSubmit.jsp'");
  }