function trim(s){	
	while(''+s.charAt(0)==' '){
		s=s.substring(1,s.length)
	}
	return s;
}
function postform(){
	d=document.contact;
	var allfields=true;	
	var msg = 'Please complete all required fields.';
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;
	if (!filter.test(d.imEmailField.value)) {
			msg = 'The E-MAIL address was not valid, please reenter the E-MAIL address.';
			allfields=false;
	}		 
	if(trim(d.Name.value).length<1||trim(d.Company.value).length<1||trim(d.Phone.value).length<1||trim(d.Comments.value).length<1){
			allfields=false;
	}
	if(allfields){
		d.imReferrerField.value=document.location;
		d.submit();
	}
	else {
		alert(msg);
	}
	
}