$(document).ready(function() {
	var queryhash = window.location.hash
	switch (queryhash) {
		case "#who":
			document.title = "George Katsanos - Who Am I";
			initialShowWho();
			break;
		case "#what":
			document.title = "George Katsanos - What Do I Do";
			initialShowWhat();
			break;
		case "#works":
			document.title = "George Katsanos - Projects";
			initialShowWorks();
			break;
		case "#contact":
			document.title = "George Katsanos - Contact";
			initialShowContact();
			break;
		default:
			initialShowWho();
			break;
	}
	$(".nav-who a").click(showWho);
	$(".nav-what a").click(showWhat);
	$(".nav-works a").click(showWorks);
	$(".nav-contact a").click(showContact);
});

function initialShowWho() {
	$("#content").hide();
	$("#katsanos").removeClass();
	$("#katsanos").addClass("who");
	$(".node").hide();
	$("#who").show();
	setTimeout("$('#content').slideDown('slow');", 1000);
}

function initialShowWhat() {
	$("#content").hide();
	$("#katsanos").removeClass();
	$("#katsanos").addClass("what");
	$(".node").hide();
	$("#what").show();
	setTimeout("$('#content').slideDown('slow');", 1000);
}

function initialShowWorks() {
	$("#content").hide();
	$("#katsanos").removeClass();
	$("#katsanos").addClass("works");
	$(".node").hide();
	$("#works").show();
	setTimeout("$('#content').slideDown('slow');", 1000);
}

function initialShowContact() {
	$("#content").hide();
	$("#katsanos").removeClass();
	$("#katsanos").addClass("contact");
	$(".node").hide();
	$("#contact").show();
	setTimeout("$('#content').slideDown('slow');", 1000);
}

function showWho() {
	if ($("#katsanos").hasClass("who")){ }
	else {
		document.title = "George Katsanos - Who Am I";
		$("#content").slideUp(500);
		$(".node").fadeOut(500);
		setTimeout("$('.node').hide();", 500);
		setTimeout("$('#who').show();", 500);
		$("#content").slideDown(500);
		$("#katsanos").removeClass();
		$("#katsanos").addClass("who");
	}
}

function showWhat() {
	document.title = "George Katsanos - What Do I Do";
	if ($("#katsanos").hasClass("what")){ }
	else {
		$("#content").slideUp(500);
		$(".node").fadeOut(500);
		setTimeout("$('.node').hide();", 500);
		setTimeout("$('#what').show();", 500);
		$("#content").slideDown(500);
		$("#katsanos").removeClass();
		$("#katsanos").addClass("what");
	}
}

function showWorks() {
	document.title = "George Katsanos - Projects";
	if ($("#katsanos").hasClass("works")){ }
	else {
		$("#content").slideUp(500);
		$(".node").fadeOut(500);
		setTimeout("$('.node').hide();", 500);
		setTimeout("$('#works').show();", 500);
		$("#content").slideDown(500);
		$("#katsanos").removeClass();
		$("#katsanos").addClass("works");
	}
}

function showContact() {
	if ($("#katsanos").hasClass("contact")){ }
	else {
		document.title = "George Katsanos - Contact";
		$("#content").slideUp(500);
		$(".node").fadeOut(500);
		setTimeout("$('.node').hide();", 500);
		setTimeout("$('#contact').show();", 500);
		$("#content").slideDown(500);
		$("#katsanos").removeClass();
		$("#katsanos").addClass("contact");
	}
}
