$(document).ready(function() {
						   
	var hash = window.location.hash.substr(1);
	var href = $('#nav li a').each(function(){
		var href = $(this).attr('href');
		if(hash==href.substr(0,href.length-5)){
			var toLoad = hash+'.html #content';
			$('#content').load(toLoad)
		}											
	});

	$('#nav li a').click(function(){
								  
		var toLoad = $(this).attr('href')+' #content';
		$('#content').slideUp(900,loadContent); 
		$('#load').remove();
		$('#wrapper').append('<span id="load">LOADING...</span>');
		$('#load').fadeIn('normal');
		window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);
		function loadContent() {
			$('#content').load(toLoad,'',showNewContent())
		}
		function showNewContent() {
			$('#content').slideDown(2000,hideLoader());
		}
		function hideLoader() {
			$('#load').fadeOut('normal');
		}
		return false;
		
	});

});


function checkForm(){

var error=0;
var errorMessage="";

if(document.getElementById("txt_name").value==""){
error=1;
errorMessage+="Please enter your name\n";
}
if(document.getElementById("txt_email").value==""){
error=1;
errorMessage+="Please enter your email address\n";
}
if(document.getElementById("txt_phone").value==""){
error=1;
errorMessage+="Please enter your telephone number\n";
}

if(error==1){
alert(errorMessage);

return false;

}
return true;



}

