$(document).ready(function(){
	
	// Remove the class "displayNo" from the error message [p] and the error message [div]
	$("p.displayNo").removeClass("displayNo");
	$("div.displayNo").removeClass("displayNo");
	
	
	// Hide the error message [p] and the error message [div]
	$("p.jQueryError").hide();
	$("div.jQueryError").hide();
	
	// If the Submit [input] is pressed...
	$("input#submitPCF").click(function() {
	
		// ...Hide the error message [p] w/ a class of "jQueryError"
		$("div.jQueryError").hide();
		$("p.jQueryError").hide();
		$("div.error").hide();
		$("div.no-error").hide();
		
		
		// ...Init variable for Name [field]
		var name = $("input#visitorName").val();
		
		// ...Init variable for Email [field]
		var email = $("input#visitorEmail").val();
		
		// ...Init variable for comment [field]
		var comment = $("textarea#visitorMsg").val();
		
		// If the Name or Date variable is blank...
		if (name == "" || email == "" || comment == "") {
			
			// ...Show the error message [p]
			$("div.jQueryError").show();
			$("p.jQueryError").show();
			
			// ...Scroll window to the top of the screen so user can see error message.
			$(window).scrollTo("div#header", 500);
			
			// ...Place the form focus back on the input [field] with id of "name"
			//$("input#name").focus();
			
			// ...Return false so the page doesn't load
			return false;
      }
  		
    });
  });