function emailvalidation(entered, alertbox){// E-mail Validation by Henrik Petersen / NetKontoret// Explained at www.echoecho.com/jsforms.htm// Please do not remove this line and the two lines above.with (entered){apos=value.indexOf("@");dotpos=value.lastIndexOf(".");lastpos=value.length-1;if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2){if (alertbox) {alert(alertbox);} return false;}else {return true;}}}function valuevalidation(entered, min, max, alertbox, datatype){// Value Validation by Henrik Petersen / NetKontoret// Explained at www.echoecho.com/jsforms.htm// Please do not remove this line and the two lines above.with (entered){checkvalue=parseFloat(value);if (datatype){smalldatatype=datatype.toLowerCase();if (smalldatatype.charAt(0)=="i") {checkvalue=parseInt(value)};}if ((parseFloat(min)==min && checkvalue<min) || (parseFloat(max)==max && checkvalue>max) || value!=checkvalue){if (alertbox!="") {alert(alertbox);} return false;}else {return true;}}}function digitvalidation(entered, min, max, alertbox, datatype){// Digit Validation by Henrik Petersen / NetKontoret// Explained at www.echoecho.com/jsforms.htm// Please do not remove this line and the two lines above.with (entered){checkvalue=parseFloat(value);if (datatype){smalldatatype=datatype.toLowerCase();if (smalldatatype.charAt(0)=="i"){checkvalue=parseInt(value); if (value.indexOf(".")!=-1) {checkvalue=checkvalue+1}};}if ((parseFloat(min)==min && value.length<min) || (parseFloat(max)==max && value.length>max) || value!=checkvalue){if (alertbox!="") {alert(alertbox);} return false;}else {return true;}}}function emptyvalidation(entered, alertbox){// Emptyfield Validation by Henrik Petersen / NetKontoret// Explained at www.echoecho.com/jsforms.htm// Please do not remove this line and the two lines above.with (entered){if (value==null || value==""){if (alertbox!="") {alert(alertbox);} return false;}else {return true;}}}function formvalidation(form){// This function checks the entire form before it is submitted// Note: This function needs to be customized to fit your form	var radio_selected = false;	var to_join = false;	if (document.form.join[0].checked) {		to_join = true		radio_selected = true	}	else if ( document.form.join[1].checked)	{		radio_selected = true	}	else {alert("Please indicate if you would like to join our mailing list."); return false; }		if(radio_selected){	with (form)	{			if (emptyvalidation(name,"Please enter your name.")==false) {name.focus(); return false;};		if (emptyvalidation(comment,"Please enter your comment.")==false) {comment.focus(); return false;};		if (to_join) {			if (emailvalidation(email,"Please enter a valid email address.")==false) {email.focus(); return false;};			if (emptyvalidation(phone,"Please enter your telephone no.")==false) {phone.focus(); return false;};			if (emptyvalidation(address,"Please enter your address.")==false) {address.focus(); return false;};			if (emptyvalidation(city,"Please enter your city.")==false) {city.focus(); return false;};			if (emptyvalidation(state,"Please enter your provience/state.")==false) {state.focus(); return false;};			if (emptyvalidation(country,"Please enter your country.")==false) {country.focus(); return false;};			if (emptyvalidation(zip,"Please enter your postal code.")==false) {zip.focus(); return false;};	//if (emptyvalidation(join,"Would you like to join our mailing list or not?")==false) {join.focus(); return false;};		}	}	}	else {alert("Errors"); return false; }}