$.ajaxSetup ({cache: false}); 

$(document).ready(function(){	
	
	$("#header").load("menu.html", function(response, status, xhr) {
		if (status == "error") {
			$("#header").html(xhr.status + ": " + xhr.statusText);
		}
	}); 
	
	// $("#header").load("menu.html", function(response, status, xhr) {
		// if (status == "error") {
			// $("#menu").html(xhr.status + ": " + xhr.statusText);
		// }
	// }); 
	
	$("#banner").load("banner.html", function(response, status, xhr) {
		if (status == "error") {
			$("#banner").html(xhr.status + ": " + xhr.statusText);
		}
	}); 
	
	$("#footer").load("footer.html", function(response, status, xhr) {
		if (status == "error") {
			$("#footer").html(xhr.status + ": " + xhr.statusText);
		}
	}); 
});

function urlencode(str) {
	return escape(str).replace(/\+/g,'%2B').replace(/%20/g, '+').replace(/\*/g, '%2A').replace(/\//g, '%2F').replace(/@/g, '%40');
}

function sendEnquiry() {
	$.post("contact.php", { 
		name: $("#name").val(), 
		company: $("#company").val(),
		tel: $("#tel").val(),
		email: $("#email").val(),
		comments: $("#comments").val() 
	});
		
	$("#name").val('');
	$("#company").val('');
	$("#tel").val('');
	$("#email").val('');
	$("#comments").val('');
	
	$("#messagebox").html("<span style='color:#f59823;'><b>Your feedback has been sent.</b></span>");
	$("#messagebox").fadeIn('slow');
	
	setTimeout("$('#messagebox').fadeOut('slow')", 3000);
}

function reset() {
	$("#name").val('');
	$("#company").val('');
	$("#tel").val('');
	$("#email").val('');
	$("#comments").val('');
}
