// JavaScript Document
function validateFormsCv(thisform){
	var pass = "ok"
	
	if( thisform.firstName.value == ""){
		alert("Please enter your first name")
		pass = "fail"		
		thisform.firstName.focus();
		return false;
	}
	
	if( thisform.lastName.value == ""){
		alert("Please enter your last name")
		pass = "fail"		
		thisform.lastName.focus();
		return false;
	}
	
	if( thisform.telephone.value == ""){
		alert("Please enter your telephone")
		pass = "fail"		
		thisform.telephone.focus();
		return false;
	}
	
	if(thisform.email.value != ""){
		var emailCheck = thisform.email.value;
		var emailOK = "yes"
		
		
		if (emailCheck.indexOf ('@', 0) == -1) {// CHECK THERE IS @ SYMBOLE		
       		emailOK = "no"
    	} else {
       		emailOK = "yes"
   		}
		
    	if (emailCheck.indexOf ( '@', 0 ) < 1 ) {// CHECK THERE IS AT LEAST ONE CHARACTER BEFORE THE '@' CHARACTER
        	emailOK = "no"
   		} else {
       		emailOK = "yes"
    	}
		
		if (emailOK == "no"){
			pass = "fail"	
			alert("Invalid email address")
			thisform.email.focus();
			return false;
		}
	}

	if(thisform.email.value == ""){
		alert("Please enter your email address")
		pass = "fail"		
		thisform.email.focus();
		return false;
	}	
	
	if( thisform.addressHouse.value  == ""){
		alert("Please enter Address Details")
		pass = "fail"		
		thisform.addressHouse.focus();
		return false;
	}	
	
	if( thisform.addressStreet.value  == ""){
		alert("Please enter Address Details")
		pass = "fail"		
		thisform.addressStreet.focus();
		return false;
	}	
	
	if( thisform.addressCity.value  == ""){
		alert("Please enter Address Details")
		pass = "fail"		
		thisform.addressCity.focus();
		return false;
	}	
	
	if( thisform.addressCounty.value  == ""){
		alert("Please enter Address Details")
		pass = "fail"		
		thisform.addressCounty.focus();
		return false;
	}	
	
	if( thisform.addressPostcode.value  == ""){
		alert("Please enter Address Details")
		pass = "fail"		
		thisform.addressPostcode.focus();
		return false;
	}	
	
	
	
	
	
	if( thisform.caravanMake.value  == ""){
		alert("Please enter your caravan make")
		pass = "fail"		
		thisform.caravanMake.focus();
		return false;
	}	
	
	if( thisform.caravanRange.value  == ""){
		alert("Please enter your caravan range")
		pass = "fail"		
		thisform.caravanRange.focus();
		return false;
	}		
	
	if( thisform.caravanModel.value  == ""){
		alert("Please enter your caravan model")
		pass = "fail"		
		thisform.caravanModel.focus();
		return false;
	}	
	
	if( thisform.caravanYear.value  == ""){
		alert("Please enter your caravan year")
		pass = "fail"		
		thisform.caravanYear.focus();
		return false;
	}	

	if( thisform.caravanWork.value  == ""){
		alert("Please enter the work you require done for your caravan")
		pass = "fail"		
		thisform.caravanWork.focus();
		return false;
	}
	
	if (pass == "ok"){
		return true;
	}
}



function validateFormsMh(thisform){
	var pass = "ok"
	
	if( thisform.firstName.value == ""){
		alert("Please enter your first name")
		pass = "fail"		
		thisform.firstName.focus();
		return false;
	}
	
	if( thisform.lastName.value == ""){
		alert("Please enter your last name")
		pass = "fail"		
		thisform.lastName.focus();
		return false;
	}
	
	if( thisform.telephone.value == ""){
		alert("Please enter your telephone")
		pass = "fail"		
		thisform.telephone.focus();
		return false;
	}
	
	if(thisform.email.value != ""){
		var emailCheck = thisform.email.value;
		var emailOK = "yes"
		
		
		if (emailCheck.indexOf ('@', 0) == -1) {// CHECK THERE IS @ SYMBOLE		
       		emailOK = "no"
    	} else {
       		emailOK = "yes"
   		}
		
    	if (emailCheck.indexOf ( '@', 0 ) < 1 ) {// CHECK THERE IS AT LEAST ONE CHARACTER BEFORE THE '@' CHARACTER
        	emailOK = "no"
   		} else {
       		emailOK = "yes"
    	}
		
		if (emailOK == "no"){
			pass = "fail"	
			alert("Invalid email address")
			thisform.email.focus();
			return false;
		}
	}

	if(thisform.email.value == ""){
		alert("Please enter your email address")
		pass = "fail"		
		thisform.email.focus();
		return false;
	}	
	
	if( thisform.addressHouse.value  == ""){
		alert("Please enter Address Details")
		pass = "fail"		
		thisform.addressHouse.focus();
		return false;
	}	
	
	if( thisform.addressStreet.value  == ""){
		alert("Please enter Address Details")
		pass = "fail"		
		thisform.addressStreet.focus();
		return false;
	}	
	
	if( thisform.addressCity.value  == ""){
		alert("Please enter Address Details")
		pass = "fail"		
		thisform.addressCity.focus();
		return false;
	}	
	
	if( thisform.addressCounty.value  == ""){
		alert("Please enter Address Details")
		pass = "fail"		
		thisform.addressCounty.focus();
		return false;
	}	
	
	if( thisform.addressPostcode.value  == ""){
		alert("Please enter Address Details")
		pass = "fail"		
		thisform.addressPostcode.focus();
		return false;
	}		



	if( thisform.motorhomeMake.value  == ""){
		alert("Please enter your motorhome make")
		pass = "fail"		
		thisform.motorhomeMake.focus();
		return false;
	}	

	if( thisform.motorhomeRange.value  == ""){
		alert("Please enter your motorhome range")
		pass = "fail"		
		thisform.motorhomeRange.focus();
		return false;
	}
	
	if( thisform.motorhomeModel.value  == ""){
		alert("Please enter your motorhome model")
		pass = "fail"		
		thisform.motorhomeModel.focus();
		return false;
	}	
	
	if( thisform.motorhomeYear.value  == ""){
		alert("Please enter your motorhome year")
		pass = "fail"		
		thisform.motorhomeYear.focus();
		return false;
	}	

	if( thisform.motorhomeWork.value  == ""){
		alert("Please enter the work you require done for your motorhome")
		pass = "fail"		
		thisform.motorhomeWork.focus();
		return false;
	}
	
	if (pass == "ok"){
		return true;
	}
}

