function checkForm() {
	if (document.forms.welcome51.elements['fname'].value.length == 0) {
		alert('Please make sure that "First Name" is not empty');
		return false;
	}
	if (document.forms.welcome51.elements['lname'].value.length == 0) {
		alert('Please make sure that "Last Name" is not empty');
		return false;
	}
	if (document.forms.welcome51.elements['email'].value.length == 0) {
		alert('Please make sure that "Email" is not empty');
		return false;
	}
	if (document.forms.welcome51.elements['emaila'].value.length == 0) {
		alert('Please make sure that "Confirm Email" is not empty');
		return false;
	}
	
	if (document.forms.welcome51.elements['email'].value == document.forms.welcome51.elements['emaila'].value) {
		// Do nothing, it will catch true at the bottom of the function
	}
	else
	{
		alert('Please make sure your emails match');
		return false;
	}
	
	if (!isValidEmail(document.forms.welcome51.elements['email'].value)) {
		alert('Please make sure that "Email" is valid');
		return false;
	}
	if (!isValidEmail(document.forms.welcome51.elements['emaila'].value)) {
		alert('Please make sure that "Confirm Email" is valid');
		return false;
	}
	
	if (document.forms.welcome51.elements['address1'].value.length == 0) {
		alert('Please make sure that "Parent Address" is not empty');
		return false;
	}
	if (document.forms.welcome51.elements['city'].value.length == 0) {
		alert('Please make sure that "City" is not empty');
		return false;
	}
	if (document.forms.welcome51.elements['postalCode'].value.length == 0) {
		alert('Please make sure that "Zip" is not empty');
		return false;
	}
	
	if(!IsNumeric(document.forms.welcome51.elements['postalCode'].value))
	{
		alert('Please make sure that "Zip" is numeric');
		return false;
	}
	
	if (document.forms.welcome51.elements['state'].value.length == 0) {
		alert('Please make sure that "State" is selected');
		return false;
	}
	if (document.forms.welcome51.elements['motherMonth'].value.length == 0) {
		alert('Please make sure that "Mother\'s birthday month" is selected');
		return false;
	}
	if (document.forms.welcome51.elements['motherDay'].value.length == 0) {
		alert('Please make sure that "Mother\'s birth day" is selected');
		return false;
	}
	if (document.forms.welcome51.elements['motherYear'].value.length == 0) {
		alert('Please make sure that "Mother\'s birthday year" is selected');
		return false;
	}
	if (document.forms.welcome51.elements['babyMonth'].value.length == 0) {
		alert('Please make sure that "Baby\'s birthday month" is selected');
		return false;
	}
	if (document.forms.welcome51.elements['babyDay'].value.length == 0) {
		alert('Please make sure that "Baby\'s birth day" is selected');
		return false;
	}
	if (document.forms.welcome51.elements['babyYear'].value.length == 0) {
		alert('Please make sure that "Baby\'s birthday year" is selected');
		return false;
	}
	if (document.forms.welcome51.elements['phone1'].value.length == 0) {
		alert('Please make sure that "Phone" is not empty');
		return false;
	}
	if (document.forms.welcome51.elements['phone2'].value.length == 0) {
		alert('Please make sure that "Phone" is not empty');
		return false;
	}
	if (document.forms.welcome51.elements['phone3'].value.length == 0) {
		alert('Please make sure that "Phone" is not empty');
		return false;
	}
	if (document.forms.welcome51.elements['phone1a'].value.length == 0) {
		alert('Please make sure that "Phone" is not empty');
		return false;
	}
	if (document.forms.welcome51.elements['phone2a'].value.length == 0) {
		alert('Please make sure that "Phone" is not empty');
		return false;
	}
	if (document.forms.welcome51.elements['phone3a'].value.length == 0) {
		alert('Please make sure that "Phone" is not empty');
		return false;
	}
	
	if (!IsNumeric(document.forms.welcome51.elements['phone1'].value)) {
		alert('Please fill in "Phone" with numbers only');
		return false;
	}
	if (!IsNumeric(document.forms.welcome51.elements['phone2'].value)) {
		alert('Please fill in "Phone" with numbers only');
		return false;
	}
	if (!IsNumeric(document.forms.welcome51.elements['phone3'].value)) {
		alert('Please fill in "Phone" with numbers only');
		return false;
	}
	if (!IsNumeric(document.forms.welcome51.elements['phone1a'].value)) {
		alert('Please fill in "Phone" with numbers only');
		return false;
	}
	if (!IsNumeric(document.forms.welcome51.elements['phone2a'].value)) {
		alert('Please fill in "Phone" with numbers only');
		return false;
	}
	if (!IsNumeric(document.forms.welcome51.elements['phone3a'].value)) {
		alert('Please fill in "Phone" with numbers only');
		return false;
	}	

	// Everything checks out, all the required fields have been filled in!
	return true;
}

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;
}


function isValidEmail(str) 
{
   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
}

function opt(theCheckbox) {
	//document.getElementById('huggies').checked = theCheckbox.checked;
	document.getElementById('ambaby').checked = theCheckbox.checked;
	document.getElementById('babytobee').checked = theCheckbox.checked;
	document.getElementById('babycenter').checked = theCheckbox.checked;
	document.getElementById('cruises').checked = theCheckbox.checked;
	//document.getElementById('swest').checked = theCheckbox.checked;
	document.getElementById('aboutbaby').checked = theCheckbox.checked;
	//document.getElementById('disney').checked = theCheckbox.checked;
	document.getElementById('branson_getaways').checked = theCheckbox.checked;
	document.getElementById('best_home_savings').checked = theCheckbox.checked;
	document.getElementById('shadow_shopper').checked = theCheckbox.checked;
}
