function getHeight(element)
{
	var height = 0;
	if (element.offsetHeight)
	{
		height = element.offsetHeight;
	}
	else if (element.style.pixelHeight)
	{
		height = element.style.pixelHeight;
	}
	return height;
}

$(document).ready(function(){

    // Make the minimum height of the content div the same as the navigation div.
    var contentMinHeight = getHeight($("#navigation").get(0)) - 138;
	$("#content").css("display", "none");
	$("#content").css("min-height", contentMinHeight);

	// Fade the navigation and content in.
	$('#navigation').css("display", "none");
	$('#content').css("display", "none");
	$('#footer').css("display", "none");
	$('img.logo').css("display", "none");
	$('#navigation').fadeIn(3000);
	$('#content').fadeIn(3000);
	$('#footer').fadeIn(3000);
	$('img.logo').fadeIn(3000);

	 // When an entry is hovered over, show the link as hovered.
	 $(".sf-menu").children("li").hover(
	 	function() {
	 		$(this).addClass("prettyHover");
	 	},
	 	function() {
	 		$(this).removeClass("prettyHover");
	 	}
	 );
	 
	 // When an entry is clicked on, activate the link.
	 $(".sf-menu").children("li").click(
	 	function() {
	 		window.location = $(this).children("a").attr("href");
	 	}
	 );
	 
	 // Add map.
	 var map = $("#map");
	 if (map)
	 {
	 	$.create("iframe", {"src" : "http://www.salonguineapig.co.uk/location/Glam%20Gals%20Tanning/-2.0886548/57.1382821/7/350/300/", "width" : "355", "height" : "350"}).appendTo(map);
	 }

	 // Open external links in a new window.
	 $("a").filter(".link").click(function(){
	   return !window.open(this.href);
	 });
});

