<!-- 
var errorUrl = new Array();
var errorId = ['firstname','surname','company','address','country','email','reemail','levelofservice','message'];
var message = "";
var displayErrorTxt;
var Unfortunately = "Unfortunately, we could not send your message because you have not completed the following mandatory fields correctly<br/>";
function validate(form) {	
	message += checkNotEmpty(form.firstname.value, 'first name');
	message += checkNotEmpty(form.secondname.value, 'surname');
	//form.company.value
	message += checkNotEmpty(form.address.value+form.address2.value+form.address3.value, 'address');
	//form.address2.value
	//form.address3.value
	message += checkNotEmpty(form.country.value, 'country');
	//form.Telephone.value
	//form.Fax.value
	message += checkEmail(form.email.value);
	message += check2ndEmail(form.reemail.value, form.email.value);
	message += checkNotEmpty(form.levelofservice.value, 'level of service');
	message += checkNotEmpty(form.message.value, 'message');
	//form.findus.value
	//form.annualspend.value
	//form.pallets.value
	if (message != "") {
		var newUrl = "";
		var currentUrl = String(document.location);
		currentUrl = currentUrl.substr(0 , (currentUrl.lastIndexOf(".htm")+6))+"?";
		for (var i = 0; i < errorUrl.length; i++) {
			var and = "&";
			if (i == errorUrl.length-1) {
				and = "&messagetxt=" + message;
			}
			newUrl += errorUrl[i]+and;
		}
		document.location = currentUrl+newUrl;
		return false;
	} else {
		return true;
	}
}
function highlightinvalid(passx) {
	if (arurlarg[errorId[passx]] == "nv") {
		return errorId[passx];
	}
}
function getMessage() {
	var statement;
	if (displayErrorTxt == true) {
			var displaytxt = arurlarg['messagetxt'];
			displaytxt = searchAndReplace(displaytxt, '%20', ' ');
			displaytxt = searchAndReplace(displaytxt, 'newline', '<br/>');
			
			statement = '<span id="error">'+Unfortunately+"<br/>"+displaytxt+'<br/>If your having trouble you can always call us on <b>0161 3679355</b></span>';
		} else {
			statement = 'Call us old fashioned we enjoy talking to people not machines!<br />Please ring us on <b>0161 3679355</b>.<br/><br/>But if not fill in the form below.';
	}
	return statement;
}
function checkNotEmpty(strng, msg) {
	 var error = "";
	 var holder;
	 if (strng == "") {
		error = "You did not enter a " + msg + "newline";
	 }
	 if (strng == "none") {
	   error = "Please select a " + msg + ".newline";
	 }
	 if (error != "") {
		holder = searchAndReplace(msg, " ", "");
		errorUrl.push(holder + '=nv');
	}
	 return error
} 

function checkEmail (strng) {
	var error="";
	if (strng == "") {
	   error = "You did not enter an email address.newline";
	}
		var emailFilter=/^.+@.+\..{2,3}$/;
		if (!(emailFilter.test(strng))) { 
		   error = "Please enter a valid email address.newline";
		}
		else {
		   var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
			 if (strng.match(illegalChars)) {
			  error = "The email address contains illegal characters.newline";
		   }
		}		
	if (error != "") {
		errorUrl.push('email=nv');
	}
	return error;    
}
 
function check2ndEmail (email_1st , email_2nd) {
	var error="";
	if (email_1st != email_2nd) {
		error = "Please make both your email addresses are correct.newline";
	}
	if (email_1st == "") {
		error = "Please reconfirm your email address.newline";
	}
	if (error != "") {
		errorUrl.push('reemail=nv');
	}
	return error;
 }
 
 function geturlarguments() 
{ 		var idx = location.href.indexOf('?');
		var idslash = location.href.lastIndexOf('/');
		var params = new Array(); 
		if (idx != -1)
		{ 
			displayErrorTxt = true;
			var pairs = location.href.substring(idx+1, location.href.length).split('&'); 
			for (var i=0; i<pairs.length; i++)
			{ 
				nameVal = pairs[i].split('='); 
				params[i] = nameVal[1]; 
				params[nameVal[0]] = nameVal[1]; 
			} 
		}
		return params;
} 

function searchAndReplace(holder, searchfor, replacement) {
		temparray = holder.split(searchfor);
		holder = temparray.join(replacement);
		return (holder);
} 
-->