function validate_email(field,alerttxt) {
	with (field) {
		apos=value.indexOf("@");
		dotpos=value.lastIndexOf(".");
		if (apos<1||dotpos-apos<2) { alert(alerttxt); return false; }
		else { return true; }
		}
	}

function validate_required(field,alerttxt) {
	with (field) {
		if (value==null||value=="") { alert(alerttxt); return false; }
		else { return true; }
		}
	}

function validate_form(thisform) {
	with(thisform) {
		if (!validate_required(name,"Please enter your name.")) { name.focus(); return false; }
		else if (!validate_email(email,"Please enter a valid email address.")) { email.focus(); return false; }
		else if (!validate_required(email,"Please enter a valid email address.")) { email.focus(); return false; }
		else { return true; }
		}
	}

function uncheckAll(theElement) {
     var theForm = theElement.form, z = 0;
	 for(z=0; z<theForm.length;z++){
      if(theForm[z].type == 'checkbox'){
	  theForm[z].checked = !theElement.checked;
	  }
     }
    }

function uncheckRadio(theElement) {
	if (!document.getElementById("none")) { return; }
	if (theElement.checked) {
		var radio = document.getElementById("none");
		radio.checked = false;
		}
	}
