function otherHearBox(t) {

		if (document.getElementById) {
		// IE 5 and above and NN 6 and above
		   var el = document.getElementById("otherhear");
		   if (t.value == "other") { el.style.visibility = "visible"; }
		   else { el.style.visibility = "hidden"; } 
		}
 		else if (document.layers) {
		// Netscape Navigator 4 and below
			if (t.value == "other") { document.layers[otherhear].visibility = "visible"; }
			else { document.layers[otherhear].visibility = "hidden"; }
		}

 		else {
		//IE 4 and below
			if (t.value == "other") { document.all[otherhear].visibility = "visible"; }
			else { document.all[otherhear].visibility = "hidden"; }
		}
}

function otherWorkBox(t) {

		if (document.getElementById) {
		// IE 5 and above and NN 6 and above
		   var el = document.getElementById("otherwork");
		   if (t.value == "100") { el.style.visibility = "visible"; }
		   else { el.style.visibility = "hidden"; } 
		}
 		else if (document.layers) {
		// Netscape Navigator 4 and below
			if (t.value == "100") { document.layers[otherwork].visibility = "visible"; }
			else { document.layers[otherwork].visibility = "hidden"; }
		}

 		else {
		//IE 4 and below
			if (t.value == "100") { document.all[otherwork].visibility = "visible"; }
			else { document.all[otherwork].visibility = "hidden"; }
		}
}

	//===============================================
	//==== Variables used in form check routines ====
	//===============================================
	var whitespace = " \t\n\r";
	//================================================================================
	//=== Remove whitespace characters and check whether remaining string is empty ===
	//=== If string null or empty return false; else if non-whitespace character   ===
	//=== return true; else no non-whitespace characters found - return false      ===
	//================================================================================
	function isStringFilled (s) {
	var i;
		if ((s == null) || (s.length == 0)) return false;
		for (i = 0; i < s.length; i++) {
			var c = s.charAt(i);
			if (whitespace.indexOf(c) == -1) return true;			
		}
		return false;
	
	}
	
	//================================================
	//======== Simple email address validator ========
	//================================================
	// Email address must be of form a@b.c -- in other words:
	// * there must be at least one character before the @
	// * there must be at least one character before and after the .
	// * the characters @ and . are both required

	function isEmail (s) {   
		if (!isStringFilled(s)) return false;
    
    var i;
		var j;
		var c;
    var sLength = s.length;
		
		// Email address cannot contain spaces or commas
		for (i = 0; i < sLength; i++) {
			c = s.charAt(i);
			if ((c == " ") || (c == ",")) return false;
		}
				
    // there must be >= 1 character before @, so we
    // start looking at character position 1 
    // (i.e. second character)
		i = 1;
    while ((i < sLength) && (s.charAt(i) != "@"))
    { i++
    }
    if ((i >= sLength - 2) || (s.charAt(i) != "@")) return false;
    else i += 2;

    // look for .  There must be at least one character after the .
    while ((i < sLength) && (s.charAt(i) != "."))
    { i++
    }
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
		
		// May not be two @.
		i = s.indexOf("@") + 1;
		if (s.indexOf("@", i) >= 0) return false;

		// May not be any commas
		if (s.indexOf(",") >=0) return false;

		else return true;
	}

	//======================================================================
	//=== MAIN FORM CHECK FUNCTION - CALLS PREVIOUSLY DEFINED FUNCTIONS ====
	//======================================================================
	function CheckFormEntries() {

		// Must have firstname field filled in
			if (!isStringFilled(document.regform.firstname.value)) {
				alert("Please enter your first name");
				document.regform.firstname.focus();
				return false;
			}
				
		// Must have firstname field filled in
			if (!isStringFilled(document.regform.lastname.value)) {
				alert("Please enter your last name");
				document.regform.lastname.focus();
				return false;
			}
				
		// Must have valid email address
			if (!isEmail(document.regform.email.value)) {
				alert ("Please enter a valid email address.\nExample: johndoe@aol.com");
				document.regform.email.focus();
				return false;
			}
			
		// Confirm email must match email
		   if (document.regform.email2.value != document.regform.email.value) {
		   	  alert("Confirm Email address must match primary email address.  Please re-enter.");
			  document.regform.email2.focus();
			  return false;
		   }
		
		// Must have first address field filled in
			if (!isStringFilled(document.regform.address1.value)) {
				alert("Please enter your street address");
				document.regform.address1.focus();
				return false;
			}
				
		// Must have city field filled in
			if (!isStringFilled(document.regform.city.value)) {
				alert("Please enter your city");
				document.regform.city.focus();
				return false;
			}
				
		// Must have state field filled in
		   if (document.regform.state.selectedIndex == 0) {
				alert("Please select your state");
				document.regform.state.focus();
				return false;
			}
				
		// Must have zip code field filled in
			if (!isStringFilled(document.regform.zip.value)) {
				alert("Please enter your zip code");
				document.regform.zip.focus();
				return false;
			}
			
		// Must enter birth date
		   if (document.regform.birthmonth.selectedIndex == 0) {
		   	  alert("Please enter your birth month.")
			  document.regform.birthmonth.focus();
			  return false;
		   }
		   if (document.regform.birthday.selectedIndex == 0) {
		   	  alert("Please enter your birth day.")
			  document.regform.birthday.focus();
			  return false;
		   }
		   if (document.regform.birthyear.value == 0) {
		   	  alert("Please enter your birth year.");
			  document.regform.birthyear.focus();
			  return false;
		   }
	   
		// Gender must be selected
		   var radioNotChecked = true;
		   for (var i = 0; i < document.regform.gender.length; i++) {
		   	   if (document.regform.gender[i].checked) radioNotChecked = false;
		   }
		   if (radioNotChecked) {
		   	  alert("Please choose a gender.");
			  document.regform.gender[0].focus();
			  return false;
		   }
		
		// Shoe size must be selected
		   if (document.regform.shoesize.selectedIndex == 0) {
		   	  alert("Please select your shoe size.");
			  document.regform.shoesize.focus();
			  return false;
		   }
		   if (document.regform.shoewidth.selectedIndex == 0) {
		   	  alert("Please select your shoe width.");
			  document.regform.shoewidth.focus();
			  return false;
		   }

//		return true;
		document.regform.submit();
		
	}
