function CheckPhone(tel) {
	allowed = "1234567890.-/+";
	for (i = 0; i < tel.length; i++) {
		var c = tel.charAt(i);
		if (c != " ") {
			if (allowed.indexOf(c) == -1)
			return false;
		}
	}
	return true;
}

function validateContact(vform) {
	if (vform.firstName.value.replace(/ /g,'')=='') {
		alert("Please enter your name.");vform.firstName.focus();return false;
	}
	if (vform.lastName.value.replace(/ /g,'')=='') {
		alert("Please enter your surname.");vform.lastName.focus();return false;
	}
	if (vform.firm.value.replace(/ /g,'')=='') {
		alert("Please enter your company's name.");vform.firm.focus();return false;
	}
	if (vform.country.value.replace(/ /g,'')=='') {
		alert("Please enter your country.");vform.country.focus();return false;
	}
	if(vform.phone.value.length==0 || !CheckPhone(vform.phone.value)) {
		alert("Please enter your telephone number correctly.");vform.phone.focus();vform.phone.select();return false;
	}
	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(vform.email.value))) {
		alert("Please enter your e-mail address correctly.");vform.email.focus();vform.email.select();return false;
	} 
	if (vform.comment.value.replace(/ /g,'')=='') {
		alert("Please enter your message.");vform.comment.focus();return false;
	}
	{return true}
}

function validateRequest(vform) {
	if (vform.fName.value.replace(/ /g,'')=='') {
		alert("Please enter your name and surname.");vform.fName.focus();return false;
	}
	if (vform.firm.value.replace(/ /g,'')=='') {
		alert("Please enter your company's name.");vform.firm.focus();return false;
	}
	if (vform.country.value.replace(/ /g,'')=='') {
		alert("Please enter your country.");vform.country.focus();return false;
	}
	if(vform.phone.value.length==0 || !CheckPhone(vform.phone.value)) {
		alert("Please enter your telephone number correctly.");vform.phone.focus();return false;
	}
	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(vform.email.value))) {
		alert("Please enter your e-mail address correctly.");vform.email.focus();vform.email.select();return false;
	} 
	if (vform.subject.value.replace(/ /g,'')=='') {
		alert("Please select a subject.");vform.subject.focus();return false;
	}	
	if (vform.critique.value.replace(/ /g,'')=='') {
		alert("Please enter your Request / Review.");vform.critique.focus();return false;
	}
	{return true}
}
