function validateForm(form) {

	var sFirstname;
	var sCompany;
	var sPhone;
	var sEmail;
	var sRequest;

	sFirstname = document.contact.firstname.value;
	sCompany = document.contact.company.value;
	sPhone = document.contact.phone.value;
	sEmail = document.contact.email.value;
	sRequest = document.contact.request.value;
	
	//************* Validating firstname *************//
	if (sFirstname==""){
		alert ("Please enter your name.\n");
		document.contact.firstname.focus();
		document.contact.firstname.select();
		return false;
	}
		
	//Check that numbers and other characters have not been entered
	if (isOnlyLetters(sFirstname)==false) {
		alert ("Please enter a valid name.\n");
		document.contact.firstname.focus();
		document.contact.firstname.select();
		return false;
	}
	
	//************* Validating Company *************//
	if (sCompany==""){
		alert ("Please enter your company name.\n");
		document.contact.company.focus();
		document.contact.company.select();
		return false;
	}

	//Check that numbers and other characters have not been entered
	if (isOnlyLetters(sCompany)==false) {
		alert ("Please enter a valid company name.\n");
		document.contact.company.focus();
		document.contact.company.select();
		return false;
	}
	
	//************* Validating Phone *************//
	
	if (sPhone=="") {
		alert( "Please enter a phone number.\n");
		document.contact.phone.focus();
		document.contact.phone.select();
		return false;
	}

	//strip out acceptable non-numeric characters
	if (parseInt(document.contact.phone.value) != document.contact.phone.value) {
	   alert( "Please enter a valid phone number.\n");
	   document.contact.phone.focus();
	   document.contact.phone.select();
	   return false;
	}
	
	//************* Validating Email *************//
	if (sEmail=="") {
		alert("Please enter your email address.\n");
		document.contact.email.focus();
		document.contact.email.select();
		return false;
	}

	var emailFilter=/^.+@.+\..{2,3}$/;
	if (!(emailFilter.test(sEmail))) { 
	   alert("Please enter a valid email address.\n");
	   document.contact.email.focus();
	   document.contact.email.select();
	   return false;
	}
	
	var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]]/
	if (sEmail.match(illegalChars)) {
	   alert ("The email address contains illegal characters.\n");
	   document.contact.email.focus();
	   document.contact.email.select();
	   return false;
	}
	
	//************* Validating Request *************//
	if (sRequest==""){
		alert("Please fill in request details.\n");
		document.contact.request.focus();
		return false;
	}
	
	return true;
}

function isOnlyLetters(sString){
	var i;
	var curr_char;
	var tmpString;
	var tmpLength;


	//Check for blank string
	if (sString==""){
		return false;
	}

	vowelChars=/[aeiouyAEIOUY]+/;
	
	tmpLength = sString.length;
	tmpString = sString
	tmpString = tmpString.replace(vowelChars,'');
	
	if (tmpLength==tmpString.length || tmpString.length==0){
		//Either no vowels or only vowels have been entered
		return false;
	}
	
	//Check for all numeric string
	numericChar=/\d*/;
	//Remove all characters other than numeric
	tmpStr = sString.replace(numericChar,'');
	
	//if length = 0 then only numerics passed
	if (tmpStr.length==0) {
		return false;
	}

	//Only valid alpha numerics allowed
	validChars=/\w+\s*/;
	
	//Strip out all valid characters
	sString=sString.replace(validChars,'');
	
	//If there are still character in the sting then invalid characters
	//have been entered
	if (sString.length > 0) {
		return false;
	}
	
	return true;
}