function mailVal(theForm)
{		
	if (theForm.CompanyName.value == "")
	{
	alert("Please enter your Company Name.");
	theForm.CompanyName.focus();
	return (false);
	}
	
	var myRegExpr = new RegExp("^([A-Z]+[']?|[ ]?|[-]?|[&]?)+$","gi");
	if (!myRegExpr.test(theForm.CompanyName.value))
	{
	    alert("Please enter only letters, spaces, apostrophe, ampersand or hyphen in the Company Name field.");
	    theForm.CompanyName.focus();
	    return (false);
	}
	
	if (theForm.ContactName.value == "")
	{
	alert("Please enter your Contact Name.");
	theForm.ContactName.focus();
	return (false);
	}
	
	myRegExpr.compile("^([A-Z]+[']?|[ ]?|[-]?)+$","gi");
	if (!myRegExpr.test(theForm.ContactName.value))
	{
		alert("Please enter only letters, spaces, apostrophe or hyphen in the Contact Name field.");
	    theForm.ContactName.focus();
	    return (false);
	}
  
	if (theForm.EmailAddr.value == "")
	{
		alert("Please enter a value in the Email field.");
		theForm.EmailAddr.focus();
		return (false);
	}
  
	myRegExpr.compile("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$","gi");
	if (!myRegExpr.test(theForm.EmailAddr.value))
	{
		alert("This does not appear to be a valid email address.")
	    theForm.EmailAddr.focus();
	    return (false);
	}
	
	if (theForm.Subject.value == "")
	{
		alert("Please enter subject.");
		theForm.Subject.focus();
		return (false);
	}
	
	if (theForm.Comment.value == "")
	{
		alert("Please enter your message.");
		theForm.Comment.focus();
		return (false);
	}
	
	adr = "htp_info"
	dom = "btinternet.com"
	theForm.SendMailTo.value = adr+"@"+dom	
	return (true);
}

function textCounter(field, countfield, maxlimit) 
{
	if (field.value.length > maxlimit)
	field.value = field.value.substring(0, maxlimit);
	else 
	countfield.value = maxlimit - field.value.length;
}