
function ValidateRegistration(theForm)
{
  // first name
	if(theForm.first.value=="")
	{
			alert("Please enter your first name. ");
			theForm.first.focus();
			theForm.first.select();
			return false;
	}


  // last name
	if(theForm.last.value=="")
	{
			alert("Please enter your last name.");
			theForm.last.focus();
			theForm.last.select();
			return false;
	}

  // phone
/*  
	if(theForm.phone.value=="")
	{
			alert("You must enter a phone number.");
			theForm.phone.focus();
			theForm.phone.select();
			return false;
	}



  // address

	if(theForm.address.value=="")
	{
			alert("You must enter an address.");
			theForm.address.focus();
			theForm.address.select();
			return false;
	}

  // city
	if(theForm.city.value=="")
	{
			alert("You must enter a city.");
			theForm.city.focus();
			theForm.city.select();
			return false;
	}

  // postal
	if(theForm.postal.value=="")
	{
			alert("You must enter a postal/zip code.");
			theForm.city.focus();
			theForm.city.select();
			return false;
	}
*/

  // email
  var theStr = new String(theForm.email.value);
  var index = theStr.indexOf("@");
 	var pindex = theStr.indexOf(".",index);

	if (theStr == "")
  {
		alert("Please enter a valid email address.");
    theForm.email.focus();
    theForm.email.select();
    return false;
  }
  else if(theStr.indexOf("@") <= 0)
  {
		alert("Please enter a valid Email Address.\n\n"
        + "( yourname@yourdomain.com )" );
    theForm.email.focus();
    theForm.email.select();
    return false;
  }
  else if ( !((pindex > index+1) && (theStr.length > pindex+1)) )
  {
		alert("Please enter a valid Email Address.\n\n"
        + "( yourname@yourdomain.com )" );
    theForm.email.focus();
    theForm.email.select();
    return false;
  }

  // password
	if(theForm.password.value=="")
	{
			alert("You must enter a New Password.    ");
			theForm.password.focus();
			return false;
	}

	if(theForm.password.value.length < 4)
	{
			alert("You must enter at least 4 characters for the New Password.    ");
			theForm.password.focus();
			return false;
	}

	if(theForm.confirm.value=="")
	{
			alert("You must confirm the New Password.    ");
			theForm.confirm.focus();
			return false;
	}

	if(theForm.confirm.value != theForm.password.value)
	{
		alert("Your Confirm Password doesn't match.    ");
		theForm.confirm.focus();
		return false;
	}

  // secret_answer
	if(theForm.secret_answer.value=="")
	{
			alert("Please enter an answer for the account security question you selected above.");
			theForm.phone.focus();
			theForm.phone.select();
			return false;
	}

	return true;
}



