// JavaScript Document
 
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function checkout(sIDValue) {
	 
	
if (document.getElementById(sIDValue).disabled == false)
{ 
document.getElementById(sIDValue).disabled = true ;
return;
} else {
	
document.getElementById(sIDValue).disabled = false;
}
	
}

function deldate_off() {
	
	
document.getElementById('deldate').disabled = true;

}

function deldate_on() {
	
	
document.getElementById('deldate').disabled = false;

}

function checkemail(email){ 
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(email))
testresults=true
else{ 
testresults=false
}
return (testresults)
}



function validate(form) {
var mes = "";
 
	if (document.form1.name.value == "") {
	mes = mes+"A name is required\n";	
	}  
	if (document.form1.tel.value == "") {
	mes = mes+"A contact telephone number is required\n";	
	}  
 	if (checkemail(document.form1.email.value) == "") {
	mes = mes+"A valid email address is required\n";	
	}  
	
	 if ((document.form1.linear.value) == "") {
	mes = mes+"A Linear meterage of fencing is required\n";	
	}  
	
	 if ((document.form1.height.value) == "") {
	mes = mes+"A Height of the fencing  is required\n";	
	}   
	
	 if ((document.form1.finish.value) == "") {
	mes = mes+"A Detail the type of finish/colour is required\n";	
	}  
	
 	
	
 
	 
	if (mes) {
	 
		alert(mes+"\n\nPlease complete before continuing.");
		return false;
		
	}  else {
		return true;
	}
}

