function hideShowcase(callback) {
	$("#showcase").hide("fast", callback);
}

function showShowcase() {
	$("#showcase").show("slow");
}

function initPage() {

	$("#showcase").hide("fast", function() {
		$("#showcase").load("content/frontpage",
						showShowcase());
	});
	
	// This uses nestled callbacks, so we have to wait for
	// each animation to complete before we load data.

	$("#logotype").click(function(e) {
		e.preventDefault();
		hideShowcase(function() {
			$("#showcase").load("content/frontpage", "", showShowcase());
		});
	});

	$("#about").click(function(e) {
		e.preventDefault();
		hideShowcase(function() {
			$("#showcase").load("content/about", "", showShowcase());
		});
	});

	$("#portfolio").click(function(e) {
		e.preventDefault();
		hideShowcase(function() {
			$("#showcase").load("content/portfolio", "", showShowcase());
		});
	});

	$("#prices").click(function(e) {
		e.preventDefault();
		hideShowcase(function() {
			$("#showcase").load("content/prices", "", showShowcase());
		});
	});

	$("#contact").click(function(e) {
		e.preventDefault();
		hideShowcase(function() {
			$("#showcase").load("content/contact", "", showShowcase());
		});
	});
};

$(document).ready(initPage);
