function confirm_form(thisform) { 

// 	name not empty
// 	email is valid

// if (1 == 1) {
// 	alert('DEBUGGING NOTE: Just checking to see if the form is being validated before sending confirmation. -- Paul.');
// 	return false;
// 	}
//}

// place any other field validations that you require here

// validate myradiobuttons
//myOption = -1;
//for (i=0; i<thisform.eventID.length; i++) {
//if (thisform.eventID[i].checked) {
//myOption = i;
//}
//}
//if (myOption == -1) {
//alert("You must select an event to attend.");
//return false;
//}

// place any other field validations that you require here


if (!emptyvalidation(thisform.name, "Please enter your name.")) {
	thisform.name.focus();
	return false;
	}
 else if (!emailvalidation(thisform.email, "Please enter your e-mail address.")) {
 	thisform.email.focus();
 	return false;
 	}
 else if (!emptyvalidation(thisform.message, "Please include a message.")) {
 	thisform.message.focus();
 	return false;
 	}

// thisform.submit(); // this line submits the form after validation

return true;
}


function emailvalidation(entered, alertbox)
	{
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 digitvalidation(entered, min, max, alertbox, datatype)
{
// Digit-Validation (c) Henrik Petersen / NetKontoret
// Explained at www.echoecho.com/jsforms.htm
// Please do not remove the 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 (c) Henrik Petersen / NetKontoret
// Explained at www.echoecho.com/jsforms.htm
// Please do not remove the this line and the two lines above.
with (entered)
{
if (value==null || value=="")
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
}
		




