$(document).ready(function() {
	var queryhash = window.location.hash
	switch (queryhash) {
		case "#about":
			document.title = "About Tommy Bay";
			initialShowAbout();
			break;
		case "#skills":
			document.title = "Skills of Tommy Bay";
			initialshowSkills();
			break;
		case "#contact":
			document.title = "Contact Tommy Bay";
			initialshowContact();
			break;
		default:
			initialshowContact();
			break;
	}
	$("h2").hide();
	$(".tooltip a").hover(showtooltipLabel, hidetooltipLabel);
	$("#nav-about a").click(showAbout);
	$("#nav-contact a").click(showContact);
	$("#nav-skills a").click(showSkills);
});

function showtooltipLabel() {
	$(".tooltip a span").show();
	$(".tooltip a span").animate({
		top: "-110px",
		opacity: 1
	}, 250 );
}

function hidetooltipLabel() {
	$(".tooltip a span").animate({ 
		top: "-40px",
		opacity: 0
	}, 250 );
	setTimeout("$('.tooltip a span').hide();", 250);
	$(".tooltip a span").animate({ 
		top: "-40px",
	}, 250 );
}

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

function initialShowAbout() {
	$("#content").hide();
	$("#container").removeClass();
	$("#container").addClass("about");
	$(".node").hide();
	$("#about").show();
	setTimeout("$('#content').slideDown('slow');", 1000);
}

function initialshowSkills() {
	$("#content").hide();
	$("#container").removeClass();
	$("#container").addClass("skills");
	$(".node").hide();
	$("#skills").show();
	setTimeout("$('#content').slideDown('slow');", 1000);
}

function showAbout() {
	if ($("#container").hasClass("about")){ }
	else {
		document.title = "About Tommy Bay";
		$("#content").slideUp(500);
		$(".node").fadeOut(500);
		setTimeout("$('.node').hide();", 500);
		setTimeout("$('#about').show();", 500);
		$("#content").slideDown(500);
		$("#container").removeClass();
		$("#container").addClass("about");
	}
}

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

function showSkills() {
	if ($("#container").hasClass("skills")){ }
	else {
		document.title = "Skills of Tommy Bay";
		$("#content").slideUp(500);
		$(".node").fadeOut(500);
		setTimeout("$('.node').hide();", 500);
		setTimeout("$('#skills').show();", 500);
		$("#content").slideDown(500);
		$("#container").removeClass();
		$("#container").addClass("skills");
	}
}