function submitForm()
{
	//alert("Thanks!");
	var form;
	form = document.forms["contact"];

	var first = form.first.value;
	var last = form.last.value;
	var title = form.title.value;
	var company = form.company.value;
	var email = form.email.value;
	var comments = form.comments.value;
	var emailRegex = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/;


	if(first == "" || first == "FIRST NAME") {
  		//inlineMsg('first_name','<strong>Error</strong><br />Please enter your name.',2);
  		alert("What's your first name?");
  		return false;
	} 
	if(last == "" || last == "LAST NAME") {
	  	//inlineMsg('last_name','<strong>Error</strong><br />Please enter your last name.',2);
	  	alert("What's your last name?");
 	 	return false;
	}
	if(title == "" || title == "TITLE") {
	  	//inlineMsg('last_name','<strong>Error</strong><br />Please enter your last name.',2);
	  	alert("What is your title?");
 	 	return false;
	}	
	if(company == "" || company == "COMPANY") {
  		//inlineMsg('company','<strong>Error</strong><br />Please enter your company name.');
  		alert("Where do you work?");
  		return false;
	} 
	if(email == "" || email == "EMAIL") {
  		//inlineMsg('email','<strong>Error</strong><br />Please enter your email.',2);
  		alert("What's your email address?");
  		return false;
	}
	
	if(!email.match(emailRegex)) {
  		//inlineMsg('email','<strong>Error</strong><br />You have entered an invalid email.',2);
  		alert("That doesn't look like a real email address. Try again!");
  		return false;
	}
	
	if(comments == "COMMENTS") {
  		//inlineMsg('email','<strong>Error</strong><br />Please enter your email.',2);
  		alert("How can we help you?");
  		form.comments.value = "";
	}	

	document.forms["contact"].submit(); 
	return true;
}

function createCookie(name,value) {
	var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}


function checkCookie(page) {
	var mhoCookie = readCookie('mhoCookie')
	if (mhoCookie) {
		//alert("mmm....cookie!");
		if (page == "quote") {
			window.parent.location="../quote/index.php";
		} else if (page == "factory_pricing") {
			window.location.href="factory_pricing.html";
		} else if (page == "ontime_delivery") {
			window.location.href="ontime_delivery.html";
		} else {
			window.location.href="appliance_professionals.html";
		}
	} else {
		//alert("no cookies here!");
		//display the page
	}
}