$(document).ready(function(){

	var queryhash = window.location.hash
	switch (queryhash) {
		case "#about":
			about();
			break;
		case "#portfolio":
			portfolio();
			break;
		case "#services":
			services();
			break;
		case "#cms":
			cms();
			break;
		case "#enquire":
			enquire();
			break;
		default:
			index();
			break;
	}		
	
	$("#contact").hover(function(){
		$(this).animate({right: '540px'}, 200, function(){
			$("#contactform").animate({bottom: '0'}, 200);
		});
	});
	
	$("#hideform").click(function(){
		$("#contactform").animate({bottom: '-200px'}, 200, function(){
			$("#contact").animate({right: '20px'}, 200);
		});
	});
});

function index() {	
	document.title = "Home | Jumpify Web Design, Weston-super-Mare";
	window.location.hash = "";
	$("#page").slideUp(800, function(){
		$.get("index.php", { header: "no"}, function(data){
			$("#page").empty().append(data).slideDown(800);
		});
	});
};

function about() {
	document.title = "About | Jumpify Web Design, Weston-super-Mare";
	window.location.hash = "about";	
	$("#page").slideUp(800, function(){
		$.get("about.php", { header: "no"}, function(data){
			$("#page").empty().append(data).slideDown(800);
		});
	});
};

function portfolio() {
	document.title = "Portfolio | Jumpify Web Design, Weston-super-Mare";
	window.location.hash = "portfolio";	
	$("#page").slideUp(800, function(){
		$.get("portfolio.php", { header: "no"}, function(data){
			$("#page").empty().append(data).slideDown(800);
		});
	});
};

function services() {
	document.title = "Services | Jumpify Web Design, Weston-super-Mare";
	window.location.hash = "services";	
	$("#page").slideUp(800, function(){
		$.get("services.php", { header: "no"}, function(data){
			$("#page").empty().append(data).slideDown(800);
		});
	});
};

function cms() {
	document.title = "CMS | Jumpify Web Design, Weston-super-Mare";
	window.location.hash = "cms";	
	$("#page").slideUp(800, function(){
		$.get("cms.php", { header: "no"}, function(data){
			$("#page").empty().append(data).slideDown(800);
		});
	});
};

function enquire() {
	document.title = "Enquire | Jumpify Web Design, Weston-super-Mare";
	window.location.hash = "enquire";	
	$("#page").slideUp(800, function(){
		$.get("enquire.php", { header: "no"}, function(data){
			$("#page").empty().append(data).slideDown(800);
		});
	});
};

