function checkForm(form) {

// var error used to store the error message
var error = "";

//var i used to count the number of messages
var i = 0;

//file_name can't be empty
if (document.getElementById('mi0moecs').value == ""){
	error += 'You must enter a Name.\n';
	i++;
 }


 if (document.getElementById('sk5tyelo').value == ""){
	error += 'You must enter an email.\n';
	i++;
 	}	
if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById('sk5tyelo').value) && document.getElementById('sk5tyelo').value != "") {
	error += "You must enter a valid email.\n";
	i++;
    }    
    
    
if (i > 0) { //if there more then '0' errors..  
	//set top of error message
	var errorMessage = 'The form was not submitted due to the following problem' + ((i > 1) ? 's' : '') + ':\n\n';	   
	//add in the error message 
	errorMessage += error;
	//add in the bottom of the message
	errorMessage += '\nPlease fix ' + ((i > 1) ? 'these' : 'this') + ' problem' + ((i > 1) ? 's' : '') + ' and resubmit the form.';
	//alert the user
	alert(errorMessage);
	//return false, stop the form
	return false;    
}
//else return ture
openNewWindow('/thank-you.php','thewin','height=150,width=350,toolbar=no,scrollbars=no')
return true;
 
}

function checkContactForm(form) {
	
document.getElementById('name').value = "";
document.getElementById('email').value = "";
document.getElementById('phone').value = "";
//alert (document.getElementById('email').value);
// var error used to store the error message
var error = "";

//var i used to count the number of messages
var i = 0;

//file_name can't be empty
if (document.getElementById('cname').value == ""){
	error += 'You must enter a Name.\n';
	i++;
 }


 if (document.getElementById('cemail').value == ""){
	error += 'You must enter an email.\n';
	i++;
 	}	
if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById('cemail').value) && document.getElementById('cemail').value != "") {
	error += "You must enter a valid email.\n";
	i++;
    }    
    
    
if (i > 0) { //if there more then '0' errors..  
	//set top of error message
	var errorMessage = 'The form was not submitted due to the following problem' + ((i > 1) ? 's' : '') + ':\n\n';	   
	//add in the error message 
	errorMessage += error;
	//add in the bottom of the message
	errorMessage += '\nPlease fix ' + ((i > 1) ? 'these' : 'this') + ' problem' + ((i > 1) ? 's' : '') + ' and resubmit the form.';
	//alert the user
	alert(errorMessage);
	//return false, stop the form
	return false;    
}




//else return ture
return true;
 
}

function openNewWindow(URLtoOpen, windowName, windowFeatures) { newWindow=window.open(URLtoOpen, windowName, windowFeatures); } 