function FrontPage_Form1_Validator(theForm)
{ if (theForm.txtfirst_name.value == "")
  {
    alert("Please enter  the first name");
    theForm.txtfirst_name.focus();
    return (false);
  }
  if (theForm.txtlast_name.value == "")
  {
    alert("Please enter  the last name");
    theForm.txtlast_name.focus();
    return (false);
  }
  if (theForm.txtaddress.value == "")
  {
    alert("Please enter  the address");
    theForm.txtaddress.focus();
    return (false);
  }
  if (theForm.txtaddress.value.length > 250)
  {
    alert("Please restrict the address information to 250 characters");
    theForm.txtaddress.focus();
    return (false);
  }
  if (theForm.txtcity.value == "")
  {
    alert("Please enter  the city");
    theForm.txtcity.focus();
    return (false);
  }
  if (theForm.txtstate.value == "")
  {
    alert("Please enter  the state");
    theForm.txtstate.focus();
    return (false);
  }
  if (theForm.txtcountry.value == "Click to Select")
  {
    alert("Please select India or International")
    theForm.txtcountry.focus();
    return (false);
  }
  if (theForm.txtzipcode.value == "")
  {
    alert("Please enter  the zip code");
    theForm.txtzipcode.focus();
    return (false);
  }
  var checkOK = "0123456789-";
  var checkStr = theForm.txtzipcode.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only numbers  in the zipcode");
    theForm.txtzipcode.focus();
    return (false);
  }

  if (theForm.txtphone.value == "")
  {
    alert("Please enter  the phone");
    theForm.txtphone.focus();
    return (false);
  }
  /*var checkOK = "0123456789-";
  var checkStr = theForm.txtphone.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only numbers in the phone");
    theForm.txtphone.focus();
    return (false);
  }

 
}*/

if(theForm.txtusername.value =="")
  {
    alert("Please enter  your username");
    theForm.txtusername.focus();
    return (false);
  }
  
  if(theForm.txtemail.value =="")
  {
    alert("Please enter  your email address");
    theForm.txtemail.focus();
    return (false);
  }
  
  if (theForm.txtemail.value.indexOf('@') < 1 )
		{
		alert("Enter Correct E-mail Address as 'name@yourserver.com' ");
		theForm.txtemail.focus();
	    return false;
	  }


	if (theForm.txtemail.value.indexOf('.') < 1)
		{
			alert("Enter correct Email address");
			theForm.txtemail.focus();
			return false;
		}

		var pos1= theForm.email.value.indexOf('@');
		var pos2= theForm.txtemail.value.indexOf('.');

		if (pos2==pos1+1 || pos2==pos1-1)
		{
			alert("Enter correct Email address");
			theForm.txtemail.focus();
			return false;
		}
		var len = theForm.txtemail.value.length;
		var pos3=theForm.txtemail.value.lastIndexOf('.');
		pos3=pos3+1;
		if(len==pos3 || len < pos3)
		{
			alert("Enter correct Email address");
			theForm.txtemail.focus();
			return false;
		}
  if (theForm.txtpassword.value == "")
  {
    alert("Please enter  the password");
    theForm.txtpassword.focus();
    return (false);
  }
  if (theForm.txtrepassword.value == "")
  {
    alert("Please re-enter  the password");
    theForm.txtrepassword.focus();
    return (false);
  }
  if (theForm.txtrepassword.value != theForm.txtpassword.value)
  {
    alert("Please Re-enter the password Correctly");
    theForm.txtrepassword.focus();
    return (false);
  }
 if (theForm.txtcaptcha.value == "")
  {
    alert("Please enter  the Security Code");
    theForm.txtcaptcha.focus();
    return (false);
  }
 
 return (true);
}
