// JavaScript Document

function checkSignup(theForm)
{

	/*if (theForm.plan_id.selectedIndex < 0)
	{
		alert("You must select a plan to continue!");
		theForm.plan_id.focus();
		return false;
	}*/
	
	if (theForm.first_name.value == "")
	{
		alert("The \"First Name\" field is required.");
		theForm.first_name.focus();
		return false;
	}
	
	if (!isAlphabetic(theForm.first_name.value))
	{
		alert("The \"First Name\" field must be alphabetic.");
		theForm.first_name.focus();
		return false;
	}
	
	var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?";
        	
        for (var i = 0; i < theForm.first_name.value.length; i++) 
      		if (iChars.indexOf(theForm.first_name.value.charAt(i)) != -1) 
               	{
               		alert ("Your First Name entry contains special characters. \nPlease remove any of the following characters from your First Name. \n @ ! # $ % ^ & * ( ) + = - [ ] \ \\ ' ; , .  /  { } |  \" : < > ?.\n");
                	theForm.first_name.focus();
					return (false);
        	}
			
	if (theForm.last_name.value == "")
	{
		alert("The \"Last Name\" field is required.");
		theForm.last_name.focus();
		return false;
	}
	
	if (!isAlphabetic(theForm.last_name.value))
	{
		alert("The \"Last Name\" field must be alphabetic.");
		theForm.last_name.focus();
		return false;
	}
	
	for (var i = 0; i < theForm.last_name.value.length; i++) 
      		if (iChars.indexOf(theForm.last_name.value.charAt(i)) != -1) 
               	{
               		alert ("Your Last Name entry contains special characters. \nPlease remove any of the following characters from your Last Name. \n @ ! # $ % ^ & * ( ) + = - [ ] \ \\ ' ; , .  /  { } |  \" : < > ?.\n");
                	theForm.last_name.focus();
					return (false);
        	}
			
		if (theForm.work_phone.value == "")
	{
		alert("The \"Daytime Phone\" field is required.");
		theForm.work_phone.focus();
		return false;
	}

	if (!isNumeric(theForm.work_phone.value))
	{
		alert("The \"Daytime Phone\" field must be all numbers.\n\nIncorrect : 333-555-1212 or (333) 555-1212\n\nCorrect: 3335551212");
		theForm.work_phone.focus();
		return false;
	}
	
	if (theForm.work_phone.value.length != 10)
		{
			alert("The \"Daytime Phone Number\" field requires 10 digits.");
			theForm.work_phone.focus();
			return(false);
		}
		
	if (theForm.home_phone.value == "")
	{
		alert("The \"Evening Phone\" field is required.");
		theForm.home_phone.focus();
		return false;
	}
	
	if (!isNumeric(theForm.home_phone.value))
	{
		alert("The \"Evening Phone\" field must be all numbers.\n\nIncorrect : 333-555-1212 or (333) 555-1212\n\nCorrect: 3335551212");
		theForm.home_phone.focus();
		return false;
	}
	
	
	if (theForm.home_phone.value.length != 10)
		{
			alert("The \"Evening Phone Number\" field requires 10 digits.");
			theForm.home_phone.focus();
			return(false);
		}
		

	if (!theForm.cell_phone.value != "")
	  {
		if (!isNumeric(theForm.cell_phone.value))
		{
			alert("The \"Cell Phone\" field must be numeric.");
			theForm.cell_phone.focus();
			return false;
		}
	
	}

	
	if (theForm.email_address.value == "")
	{
		alert("The \"Email Address\" field is required!");
		theForm.email_address.focus();
		return false;
	}
	if (!isValidEmailStrict(theForm.email_address.value))
	{
		alert("The \"Email Address\" field nust be a valid email address!");
		theForm.email_address.focus();
		return false;
	}
	
	if (theForm.confirm_email.value == "")
	{
		alert("The \"Confirm Email\" field is required!");
		theForm.confirm_email.focus();
		return false;
	}
	
	if (theForm.confirm_email.value != theForm.email_address.value)
	{
		alert("The \"Email Confirm\" field must exactly match the \"Email Address\" field.");
		theForm.confirm_email.focus();
		return false;
	}

	if (theForm.password.value == "")
	{
		alert("The \"Password\" field is required!");
		theForm.password.focus();
		return false;
	}
	
	if (theForm.confirm_password.value == "")
	{
		alert("The \"Confirm Password\" field is required!");
		theForm.confirm_password.focus();
		return false;
	}
	
	if (theForm.confirm_password.value != theForm.password.value)
	{
		alert("The \"Password Confirm\" field must exactly match the \"Password\" field.");
		theForm.confirm_password.focus();
		return false;
	}
	
	return true;
}



