function doContact() {	
	
	var err = false;
	var errtext = '<h1>Sorry, your registration could not be completed because of the following errors:</h1>';

	if ( $('#fname').val() == '') {
	 $('#fname').addClass('error');
		errtext += '<li>Please enter both your first and lnames.</li>'; 
	  err = true;
	}
	
	if ( $('#email').val() == '') {
	 $('#email').addClass('error');
		errtext += '<li>Please provide your company name.</li>'; 
	  err = true;
	}

	if ( $('#comments').val() == '') {
	  $('#comments').addClass('error');
		errtext += '<li>Please provide a message.</li>'; 
	  err = true;
	} 

	if (err == false) {
		var data = $("#contactfrm").serialize();
		$('#contactformcw').html("Sending your information...");
		$.post('actions/contact.action.php', data, function() {
			$('#contactformcw').html('<div style="padding: 20px;"><h3>Thank you for your submission</h3><p>We will be contacting you shortly.</div>');							
		});	
	} else {
		$('#cerrortext').html('<ul>'+errtext+'</ul>').show();
			
	}
	
	return false;

	
	
}	


function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1) {
		   return false
		}
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){

		    return false
		 }
		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return false
		 }
		 if (str.indexOf(dot,(lat+2))==-1){
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    return false
		 }
 		 return true;	
}


