<!-- hide from old browsers...
function resetSelect(set) {
	if (set==1) {
		document.myForm.country1.selectedIndex=0;
	} else if (set==2) {
		document.myForm.country2.selectedIndex=0;
	}
}

function checkForm(theForm) {
	
/*	var theZip = new String(theForm.elements.zipcode.value)
	var theChar;
	for	(var i=0; i<theZip.length; i++) {
		theChar = theZip.charAt(i);
		if (!isNumeric(theChar)) return false;
	}*/
	//check: username
	if ((theForm.elements.name.value=="")||(theForm.elements.name.value==" ")) {
		alert("Please enter a username for yourself");
		theForm.elements.name.focus();
		theForm.elements.name.select();
		return false;
	}
	//check: state
	if (theForm.elements.state.selectedIndex==0) {
		alert("Please select the state you live in.");
		theForm.elements.state.focus();
		return false;
	}
	//check: year born
	if (!(theForm.elements.yearborn.value=="")) {
		yearborn = parseInt(theForm.elements.yearborn.value);
		if (!((yearborn >= 1900) && (yearborn < 2002))) {
			alert("For your year of birth, please enter a four-digit number between 1900 and 2000.");
			theForm.elements.yearborn.focus();
			theForm.elements.yearborn.select();
			return false;
		}
	}
	//check: where ancestors came from
	if (theForm.elements.countrychina1.selectedIndex==0) {
		if ((theForm.elements.country1.selectedIndex==0)) {
			alert("Please tell us where you or your ancestors came to America from.");
			theForm.elements.countrychina1.focus();
			return false;
		}
	}
	//check: ancestors' year to America
	if (!(theForm.elements.yeartoamerica1.value=="")) {
		yeartoamerica1 = parseInt(theForm.elements.yeartoamerica1.value);
		if (!((yeartoamerica1 >= 1100) && (yeartoamerica1 < 2002))) {
			alert("Please enter a 4-digit year between 1100 and 2002.");
			theForm.elements.yeartoamerica1.focus();
			theForm.elements.yeartoamerica1.select();
			return false;
		}
	}
	if (!(theForm.elements.yeartoamerica2.value=="")) {
		yeartoamerica2 = parseInt(theForm.elements.yeartoamerica2.value);
		if (!((yeartoamerica2 >= 1100) && (yeartoamerica2 < 2002))) {
			alert("Please enter a 4-digit year between 1100 and 2002.");
			theForm.elements.yeartoamerica2.focus();
			theForm.elements.yeartoamerica2.select();
			return false;
		}
	}
	//check: at least 1 optional question is answered
	if ((theForm.elements.optionalq1.value=="") && (theForm.elements.optionalq2.value=="") && (theForm.elements.optionalq3.value=="")) {
		alert("Please answer at least 1 question.");
		theForm.elements.optionalq1.focus();
		return false;
	}
	return true;
}

function isNumeric(data) {
	for (var i=0; i < data.length; i++) {
 		var digit = data.charAt(i);
 		if (digit < '0' || digit > '9') {
 			return false;
 		}
 	}
 	return true;
 }


function checkForm1(theForm) {
	//check: at least 1 optional question is answered
	if ((theForm.elements.optionalq1.value=="") && (theForm.elements.optionalq2.value=="") && (theForm.elements.optionalq3.value=="")) {
		alert("Please answer at least 1 question.");
		theForm.elements.optionalq1.focus();
		return false;
	}
	return true;
}


function checkForm2(theForm) {
	
/*	var theZip = new String(theForm.elements.zipcode.value)
	var theChar;
	for	(var i=0; i<theZip.length; i++) {
		theChar = theZip.charAt(i);
		if (!isNumeric(theChar)) return false;
	}*/
	//check: username
	if ((theForm.elements.name.value=="")||(theForm.elements.name.value==" ")) {
		alert("Please enter a username for yourself");
		theForm.elements.name.focus();
		theForm.elements.name.select();
		return false;
	}
	//check: state
	if (theForm.elements.state.selectedIndex==0) {
		alert("Please select the state you live in.");
		theForm.elements.state.focus();
		return false;
	}
	//check: year born
	if (!(theForm.elements.yearborn.value=="")) {
		yearborn = parseInt(theForm.elements.yearborn.value);
		if (!((yearborn >= 1900) && (yearborn < 2002))) {
			alert("For your year of birth, please enter a four-digit number between 1900 and 2000.");
			theForm.elements.yearborn.focus();
			theForm.elements.yearborn.select();
			return false;
		}
	}
	//check: where ancestors came from
	if (theForm.elements.countrychina1.selectedIndex==0) {
		if ((theForm.elements.country1.selectedIndex==0)) {
			alert("Please tell us where you or your ancestors came to America from.");
			theForm.elements.countrychina1.focus();
			return false;
		}
	}
	//check: ancestors' year to America
	if (!(theForm.elements.yeartoamerica1.value=="")) {
		yeartoamerica1 = parseInt(theForm.elements.yeartoamerica1.value);
		if (!((yeartoamerica1 >= 1100) && (yeartoamerica1 < 2002))) {
			alert("Please enter a 4-digit year between 1100 and 2002.");
			theForm.elements.yeartoamerica1.focus();
			theForm.elements.yeartoamerica1.select();
			return false;
		}
	}
	if (!(theForm.elements.yeartoamerica2.value=="")) {
		yeartoamerica2 = parseInt(theForm.elements.yeartoamerica2.value);
		if (!((yeartoamerica2 >= 1100) && (yeartoamerica2 < 2002))) {
			alert("Please enter a 4-digit year between 1100 and 2002.");
			theForm.elements.yeartoamerica2.focus();
			theForm.elements.yeartoamerica2.select();
			return false;
		}
	}
	return true;
}

function isNumeric(data) {
	for (var i=0; i < data.length; i++) {
 		var digit = data.charAt(i);
 		if (digit < '0' || digit > '9') {
 			return false;
 		}
 	}
 	return true;
 }














// end of hiding -->