function CheckForm(){
	alertmessage = "";
	if(document.enquiry.title1.value == "Select..."){
		alertmessage += '   -  Title\n';
	}
	if(document.enquiry.firstName1.value == ""){
		alertmessage += '   -  First Name\n';
	}
	if(document.enquiry.lastName1.value == ""){
		alertmessage += '   -  Last Name\n';
	}
	if(document.enquiry.email1.value == ""){
		alertmessage += '   -  Email\n';
	}	
	if(document.enquiry.email1.value != ""){
		var email = document.enquiry.email1.value;
		invalidChars = " /:,;?()"
		incorrect ='';
		for (i=0; i<invalidChars.length; i++){
			badChar = invalidChars.charAt(i)
			if(email.indexOf(badChar,0) > -1){
				incorrect += '   -  Invalid Email Address\n';
				break;
			}
		}
		atPos = email.indexOf("@",1)
		if(atPos == -1){
			incorrect += '   -  Invalid Email Address\n';
		}
		if(email.indexOf("@",atPos+1) > -1){
			incorrect += '   -  Invalid Email Address\n';
		}
		periodPos = email.indexOf(".",atPos)
		if(periodPos == -1){
			incorrect += '   -  Invalid Email Address\n';
		}
		if(periodPos+3 > email.length){
			incorrect += '   -  Invalid Email Address\n';
		}	
		if(incorrect != ''){
			alertmessage += ' -  Invalid Email Address\n';
		}
	}
	if(document.enquiry.message.value == ""){
		alertmessage += '   -  Message\n';
	}
	if(alertmessage == ""){
		return true;
	}
	else{
		TopMessage = "You have not entered the following form elements correctly: \n\n";
        BottomMessage = "\nPlease correct these fields to continue";
        alertmessage = TopMessage + alertmessage + BottomMessage;
        alert(alertmessage);
		return false;
	}
}

function CheckCatalogueForm(){
	alertmessage = "";
	if(document.catalogue.name.value == ""){
		alertmessage += '   -  Name\n';
	}
	if(document.catalogue.address1.value == ""){
		alertmessage += '   -  Address 1\n';
	}
	if(document.catalogue.town.value == ""){
		alertmessage += '   -  Town\n';
	}
	if(document.catalogue.county.value == ""){
		alertmessage += '   -  County\n';
	}
	if(document.catalogue.postcode.value == ""){
		alertmessage += '   -  Postcode\n';
	}
	if(document.catalogue.email.value == ""){
		alertmessage += '   -  Email\n';
	}	
	if(document.catalogue.email.value != ""){
		var email = document.catalogue.email.value;
		invalidChars = " /:,;?()"
		incorrect ='';
		for (i=0; i<invalidChars.length; i++){
			badChar = invalidChars.charAt(i)
			if(email.indexOf(badChar,0) > -1){
				incorrect += '   -  Invalid Email Address\n';
				break;
			}
		}
		atPos = email.indexOf("@",1)
		if(atPos == -1){
			incorrect += '   -  Invalid Email Address\n';
		}
		if(email.indexOf("@",atPos+1) > -1){
			incorrect += '   -  Invalid Email Address\n';
		}
		periodPos = email.indexOf(".",atPos)
		if(periodPos == -1){
			incorrect += '   -  Invalid Email Address\n';
		}
		if(periodPos+3 > email.length){
			incorrect += '   -  Invalid Email Address\n';
		}	
		if(incorrect != ''){
			alertmessage += ' -  Invalid Email Address\n';
		}
	}
	if(alertmessage == ""){
		return true;
	}
	else{
		TopMessage = "You have not entered the following form elements correctly: \n\n";
        BottomMessage = "\nPlease correct these fields to continue";
        alertmessage = TopMessage + alertmessage + BottomMessage;
        alert(alertmessage);
		return false;
	}
}
function CheckSendtofriendForm(){
	alertmessage = "";
	if(document.sendtoafriend.name1.value == ""){
		alertmessage += '   -  Your Name\n';
	}
	if(document.sendtoafriend.email1.value == ""){
		alertmessage += '   -  Your Email\n';
	}
	if(document.sendtoafriend.name2.value == ""){
		alertmessage += '   -  Captain\'s/Secretary\'s Name\n';
	}
	if(document.sendtoafriend.email2.value == ""){
		alertmessage += '   -  Captain\'s/Secretary\'s Email\n';
	}	
	if(document.sendtoafriend.email1.value != ""){
		var email1 = document.sendtoafriend.email1.value;
		invalidChars = " /:,;?()"
		incorrect ='';
		for (i=0; i<invalidChars.length; i++){
			badChar = invalidChars.charAt(i)
			if(email1.indexOf(badChar,0) > -1){
				incorrect += '   -  Invalid Email Address\n';
				break;
			}
		}
		atPos = email1.indexOf("@",1)
		if(atPos == -1){
			incorrect += '   -  Invalid Email Address\n';
		}
		if(email1.indexOf("@",atPos+1) > -1){
			incorrect += '   -  Invalid Email Address\n';
		}
		periodPos = email1.indexOf(".",atPos)
		if(periodPos == -1){
			incorrect += '   -  Invalid Email Address\n';
		}
		if(periodPos+3 > email1.length){
			incorrect += '   -  Invalid Email Address\n';
		}	
		if(incorrect != ''){
			alertmessage += ' -  Invalid Email Address\n';
		}
	}
	if(document.sendtoafriend.email2.value != ""){
		var email2 = document.sendtoafriend.email2.value;
		invalidChars = " /:,;?()"
		incorrect ='';
		for (i=0; i<invalidChars.length; i++){
			badChar = invalidChars.charAt(i)
			if(email2.indexOf(badChar,0) > -1){
				incorrect += '   -  Invalid Email Address\n';
				break;
			}
		}
		atPos = email2.indexOf("@",1)
		if(atPos == -1){
			incorrect += '   -  Invalid Email Address\n';
		}
		if(email2.indexOf("@",atPos+1) > -1){
			incorrect += '   -  Invalid Email Address\n';
		}
		periodPos = email2.indexOf(".",atPos)
		if(periodPos == -1){
			incorrect += '   -  Invalid Email Address\n';
		}
		if(periodPos+3 > email2.length){
			incorrect += '   -  Invalid Email Address\n';
		}	
		if(incorrect != ''){
			alertmessage += ' -  Invalid Email Address\n';
		}
	}
	if(document.sendtoafriend.message.value == ""){
		alertmessage += '   -  Message\n';
	}
	if(alertmessage == ""){
		return true;
	}
	else{
		TopMessage = "You have not entered the following form elements correctly: \n\n";
        BottomMessage = "\nPlease correct these fields to continue";
        alertmessage = TopMessage + alertmessage + BottomMessage;
        alert(alertmessage);
		return false;
	}
}
