<!-- hide script from old browsers

function checkBox(){
var result = true;
var element = document.form.agreement;

 if(element.type == "checkbox"){
	    var checked = false;
	    if(element.checked){
		     checked = true;
		  }
 }
 if(!checked) { 
  alert("Please select the checkbox for "+element.name.toUpperCase()+".");
  if(element.focus)
     element.focus();
	   result = false;
  }
return result;
}

function checkRadio(){
var result = true;
var el = document.form.elements;

 for(var i = 0 ; i < el.length ; ++i) {
  if(el[i].type == "radio") {
   var radiogroup = el[el[i].name];
   var itemchecked = false;
   for(var j = 0 ; j < radiogroup.length ; ++j) {
    if(radiogroup[j].checked) {
	 		itemchecked = true;
	    break;
	  }
   }
   if(!itemchecked) { 
    alert("Please select an option for "+el[i].name.toUpperCase()+".");
    if(el[i].focus)
     el[i].focus();
	   result = false;
		 break;
   }
  }
 }
 return result;
}

function checkText(){
var result = true;
var el = document.form.elements;
for (var x = 0; x < el.length; x++) {		
   if (el[x].type == "text"){
  	 if (el[x].name.substring(0,8)=="required" && el[x].value=='') {
				var shortFieldName=el[x].name.substring(8,30).toUpperCase();
  			alert("Please make sure the "+shortFieldName+" field is properly completed.");
				el[x].focus();
				el[x].select();
  	 		result = false;
  	 }
   }
  } 
return result;
}

function checkSSN(){

	var tomatch=/^\d{9}$/;
	var ssn = document.form.ssn.value;
		if (tomatch.test(ssn)){
			return true;
		}
		else{
			window.alert("The SSN must be filled in and can only contain 9 numbers with no other characters or spaces.");
			document.form.ssn.focus();
			document.form.ssn.select();
			return false;
		}
}

function checkZip(){

	var tomatch=/^\d{5}$/;
	var zip = document.form.zip.value;
		if(tomatch.test(zip)){
			return true;
		}
		
		else{
			window.alert("The zip code must be filled in and must be 5 numbers.");
			document.form.zip.focus();
			document.form.zip.select();
			return false;
		}
}

function checkEmail(){

	var tomatch=/^.+@.+\..{2,4}$/;
	var email = document.form.email.value;
		if(tomatch.test(email)){
			return true;
		}
		
		else{
			window.alert("The e-mail box must contain a valid address.");
			document.form.email.focus();
			document.form.email.select();
			return false;
		}
}

function checkAmount(){
	var tomatch=/^\d+$/;
	var amount = document.form.amount.value;
		if(tomatch.test(amount)){
			return true;
		}
		else{
			window.alert("Enter only numbers.");
			document.form.amount.focus();
			document.form.amount.select();
			return false;
		}
}

function checkState(){
	var state = document.form.state.value;
	if(document.form.state.selectedIndex=='0'){
			window.alert("Select a state");
			document.form.state.focus();
			return false;
			}
			return true;
}

function checkTelephone(){
	var tomatch=/^\d{3}-\d{3}-\d{4}$/;
	var tele = document.form.tele.value;
		if(tomatch.test(tele)){
			return true;
		}
		else{
			window.alert("Enter the telephone number in the correct format.");
			document.form.tele.focus();
			document.form.tele.select();
			return false;
		}
}

function checkFein(){

	var tomatch=/^\d{9}$/;
	var fein = document.form.fein.value;
		if (tomatch.test(fein)){
			return true;
		}
		else{
			window.alert("The FEIN must be filled in and can only contain 9 numbers with no other characters or spaces.");
			document.form.fein.focus();
			document.form.fein.select();
			return false;
		}
}

function checkTextArea(){
var result = true;
var el = document.form.elements;
for (var x = 0; x < el.length; x++) {		
   if (el[x].type == "textarea"){
  	 if (el[x].name.substring(0,8)=="required" && el[x].value=='') {
				var shortFieldName=el[x].name.substring(8,30).toUpperCase();
  			alert("Please make sure the "+shortFieldName+" field is properly completed.");
				el[x].focus();
				el[x].select();
  	 		result = false;
  	 }
   }
  } 
return result;
}

// end hiding script from old browsers -->