function applicationFormValidate(){

	var theForm = document.applicationForm;
	var blnSubmit = false;
	
	if(theForm.name.value == ""){
		alert("Please enter your name in the box to help us process your application.");
		theForm.name.focus();
		return false;
	}
	
	if(theForm.address.value == "" && theForm.telephone.value == ""){
		alert("We need at minimum your address OR telephone number in order to process your application.");
		theForm.address.focus();
		return false;
	}
	
	blnSubmit = true;
	
	//if(blnSubmit){
		//theForm.action = "submit/sendApplication.asp";
		//theForm.submit();
	//}
}


function generalFormValidate(){

	var theForm = document.generalForm;
	var blnSubmit = false;

	if(theForm.name.value == ""){
		alert("Please enter your name in the box to help us with your enquiry.");
		theForm.name.focus();
		return false;
	}

	if(theForm.address.value == "" && theForm.email.value == "" && theForm.telephone.value == ""){
		alert("Please enter at least one of your email address, telephone number or postal address in case we need to contact you..");
		theForm.address.focus();
		return false;
	}
	
	//email validation
	if (theForm.email.value !=""){
		var field = theForm.email; // email field
  		var str = field.value; // email string
  		var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
  		var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
  		if (!reg1.test(str) && reg2.test(str)){ // if syntax is valid
   			blnSubmit = true;
  		}
		else{
  			alert("Can you please insert a valid email address!"); // this is also optional
  			field.focus();
  			field.select();
			blnSubmit = false;
  			return false;
		}
	}
	else{
		alert("Please insert your email address!");
		theForm.email.focus();
		blnSubmit = false;
		return false;
	}
	
	blnSubmit = true;
	
	//if(blnSubmit){
	//	theForm.action = "submit/sendGeneral.asp";
	//	theForm.submit();
	//}
	
}