function frmValidation(form_name) {var _name = document[form_name].name.value;var _company = document[form_name].company.value;var _email = document[form_name].email.value;var _telephone = document[form_name].telephone.value;var _postcode = document[form_name].postcode.value;var _pass = 0;if(_name.toString() == "") {alert("Please enter your name"); _pass = 1; document[form_name].name.focus();}if(_pass == 0) { if(_company.toString() == "") {alert("Please enter your company name"); _pass = 1; document[form_name].company.focus();}}if(_pass == 0) { if(_email.toString() == "") {alert("Please enter your e-mail address"); _pass = 1; document[form_name].email.focus();}}if(_pass == 0) { if(_telephone.toString() == "") {alert("Please enter your telephone number"); _pass = 1; document[form_name].telephone.focus();}}if(_pass == 0) { if(_postcode.toString() == "") {alert("Please enter your postcode"); _pass = 1; document[form_name].postcode.focus();}}if(_pass == 0) { if(!checkEmail(_email)) {alert("Please check your e-mail address, it appears invalid"); _pass = 1; document[form_name].email.focus();}}if(_pass == 0) { if(checkComma(_email)) {alert("We do not support multiple e-mail addresses, please check for commas in the e-mail address"); _pass = 1; document[form_name].email.focus();}}// lets check we have valid telephoneif(_pass == 0) { if(!checkNumber(_telephone)) {alert("Please check the telephone number and include the dialing code using the format:\n 0123 456 7890 \n If your number does not fit this format please remove any spaces and include the country code\neg 44071234567"); _pass = 1; document[form_name].telephone.focus();}}if (_pass == 0) {document[form_name].submit()}}//*******************//function checkEmail(_email) {	var RegExp = /^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$/g;	//var RegExp = /(^\S[\w-.]+\@[\w-.]+\.[\w-.]+)/g;//	return RegExp.test(_email);}//*******************//function checkComma(_email) {		var RegExp = /,/g;	return RegExp.test(_email);}//*******************//function checkNumber(_telephone) {		var RegExp = /^(\d{4,}\s*\d{3,}\s*\d{4,})$/;	return RegExp.test(_telephone);}