// JavaScript Document

function check1() {


if (document.form3.firstname.value == "") 
{
  alert("First Name cannot be left blank!");
  return false ;
}
else if (document.form3.lastname.value == "")
{
  alert("Last Name cannot be left blank!");
  return false ;
}
else if (document.form3.address.value == "")
{
  alert("Address cannot be left blank!");
  return false ;
}
else if (document.form3.city.value == "")
{
  alert("City cannot be left blank!");
  return false ;
}
else if (document.form3.country.value == "")
{
  alert("Country cannot be left blank!");
  return false ;
}
else if (document.form3.pincode.value == "")
{
  alert("Pin-Code cannot be left blank!");
  return false ;
}
else if (!IsNumeric(form3.pincode.value)) 
   { 
      alert('Please enter only numbers in the PINCODE field') 
      return false;
      }
else if (!IsNumeric(form3.phonenumber.value)) 
   { 
      alert('Please enter only numbers in the PHONE NUMBER field') 
      return false;
      }
else if (!IsNumeric(form3.mobile.value)) 
   { 
      alert('Please enter only numbers in the MOBILE NUMBER field') 
      return false;
      }
else if (document.form3.occupation.value == "")
{
  alert("Occupation cannot be left blank!");
  return false ;
}
else if (document.form3.joining.value == "")
{
  alert("The year you joined school cannot be left blank!");
  return false ;
}
else if (!IsNumeric(form3.joining.value)) 
   { 
      alert('Please enter only numbers in the YEAR OF JOINING field') 
      return false;
      }
else if (document.form3.leaving.value == "")
{
  alert("The year you left the school cannot be left blank!");
  return false ;
}
else if (!IsNumeric(form3.leaving.value)) 
   { 
      alert('Please enter only numbers in the YEAR OF LEAVING field') 
      return false;
      }
else if (document.form3.batch.value == "")
{
  alert("The batch you belonged to cannot be left blank!");
  return false ;
}
else if (!IsNumeric(form3.batch.value)) 
   { 
      alert('Please enter only numbers in the BATCH field') 
      return false;
      }
else if (document.form3.city1.value == "")
{
  alert("The city in which you attended school cannot be left blank!");
  return false ;
}
else if (document.form3.country1.value == "")
{
  alert("The country in which you attended school cannot be left blank!");
  return false ;
}

else if (document.form3.loginname.value == "")
{
  alert("Login name cannot be left blank!");
  return false ;
}
else if (document.form3.password.value == "")
{
  alert("Password cannot be left blank!");
  return false ;
}
else if (document.form3.password2.value == "")
{
  alert("Reconfirm password cannot be left blank!");
  return false ;
}
else if (form3.password.value != form3.password2.value) {
alert("Password and Password Confirmation do not match.");
form3.password2.focus()
return false;
}
else {
        document.form3.submit(); 
		return false ;
    }
     } 
	
function valid(form3) {
  var field = form3.email; // email field
  var str = document.email.value; // email string
  var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
  var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
  if (!reg1.test(str) && reg2.test(str)) { // if syntax is valid
    return true;
  }
  alert("\"" + str + "\" is an invalid e-mail!"); // this is also optional
  field.focus();
  field.select();
  return false;
}


	function maskKeyPress(objEvent) 
	{
	  var iKeyCode;  	
	  iKeyCode = objEvent.keyCode;			
	  if(iKeyCode>=48 && iKeyCode<=57) return true;
	  return false;
	}
	
	function IsNumeric(sText)
{
   var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }

