﻿function replaceText(string,objectName) {
	newString = string.replace(/\'/g, "");
	newString = newString.replace(/\"/g, "");
	newString = newString.replace(/\;/g, "");
	newString = newString.replace(/\,/g, "");
	//newString = newString.replace(/:/g, "<br />");
	newString = newString.replace(/\n/g, "<br />");  // line break
	
	if ( window.navigator.platform == "MacPPC") {
		if (window.navigator.appName == "Microsoft Internet Explorer") {
			newString = newString.replace(/\r/g, "<br />");  // line break
		}
	}
	document.registration[objectName].value = newString;
}



function checkForm() {

	// make sure they entered their name
	if (document.registration.first_name.value == "") {
		alert ("Please enter your first name.");
		document.registration.first_name.focus();
		return false;
	}
	
	if (document.registration.last_name.value == "") {
		alert ("Please enter your last name.");
		document.registration.last_name.focus();
		return false;
	}
	
	
	// make sure they entered their phone
	//ADDED BACK IN  5/10/2009
	//if (document.registration.phone_home.value == "") {
//		alert ("Please enter your home phone number.");
//		document.registration.phone_home.focus();
		
//		return false;
//	}
	
	
	// make sure they entered their email
	//ADDED BACK IN  5/10/2009
	if (document.registration.email.value == "") {
		alert ("Please enter your e-mail address.\n\nIf you do not have an email, please enter NONE.");
		document.registration.email.focus();
		return false;
	}
	
	// make sure they entered their state
	if (document.registration.address_state.selectedIndex == 0) {
		alert ("Please choose your state.");
		document.registration.address_state.focus();
		return false;
	}
	
	
	
	
	// else everything is in order
	return true;

}