function checkForm() {
    name = document.getElementById("name").value;
	email = document.getElementById("email").value;
	topic = document.getElementById("topic").value;
	question = document.getElementById("question").value;
	
	
	//var emailRegExp = /^([\w]+)(.[\w]+)*@([\w]+)(.[\w]{2,3}){1,2}$/;
	var emailRegExp = /^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$/;

	// if (email == "") {
	if (name == ""){
	    document.getElementById("nameError").style.display = "inline";	    
		document.getElementById("name").select();
		document.getElementById("name").focus();
		
		return false;
		
	} else if (emailRegExp.test(email) != true) {
		hideAllErrors();
		document.getElementById("emailError").style.display = "inline";
		document.getElementById("email").select();
		document.getElementById("email").focus();
	
		return false;
	
	} else if (topic == "") {
	
		hideAllErrors();
		document.getElementById("topicError").style.display = "inline";
		document.getElementById("topic").focus();
	
		return false;
	
	} else if (question == "") {
	
		hideAllErrors();
		document.getElementById("questionError").style.display = "inline";
		document.getElementById("question").select();
		document.getElementById("question").focus();
	
		return false;
	
	}
	//Set values of hidden fields
	document.getElementById("FromAddress").value = email;
	document.getElementById("Subject").value = topic;
	document.getElementById("Body").value = question;
	document.getElementById("CustomerName").value = name;

	//Clear the form	
  	document.getElementById("name").value = "";
  	document.getElementById("email").value = "";
	document.getElementById("topic").value = "";
	document.getElementById("question").value = "";
	hideAllErrors();
	
	window.open("/Stellent/Fragments/TL_EmailUs/Processing.htm","EmailConformation" ,"status=0, toolbar=0 resizable=0, location=0, menubar=0, directories=0, scrollbars=0, width=500, height=300")
	document.EmailUs.submit();
}
 
function hideAllErrors() {
	document.getElementById("nameError").style.display = "none";
	document.getElementById("emailError").style.display = "none";
	document.getElementById("topicError").style.display = "none";
	document.getElementById("questionError").style.display = "none";
}