	$(document).ready(function() {

			var queryhash = window.location.hash
			switch (queryhash) {
				case "#about": 	
						seamlessNavigation("about", true);
				break;
				case "#work":
						seamlessNavigation("work", true);
				break;
				case "#contacts":
						seamlessNavigation("contacts", true);
				break;
				case "#personal":
						seamlessNavigation("personal", true);
				break;
				default:
						seamlessNavigation("about", true);
				break;
			} 


				$("#nav-about").click(function() {
					document.title = "Meelk! → About";					
					return seamlessNavigation("about");
				})

				$("#nav-work").click(function() {
					document.title = "Meelk! → Work";
					return seamlessNavigation("work");
				})				
				
				$("#nav-personal").click(function() {
					document.title = "Meelk! → Personal";
					return seamlessNavigation("personal");
				})

				$("#nav-contacts").click(function() {
					document.title = "Meelk! → Contacts";
					return seamlessNavigation("contacts");
				})
				if (navigator.appVersion.indexOf("MSIE 7.0") == -1 && navigator.appVersion.indexOf("MSIE 8.0") == -1) {			
		        	$(document).pngFix(); 		
		        	
		        }
	});


	function seamlessNavigation(id, initial){
						
					if (id == undefined) {
						id = "about";
					}
					
					if (initial == true) {
						$("div#about").hide();
					}
					
					if (!$("div#flyingWindow").hasClass(id)) {
					
						$("div#flyingWindow").removeClass();
						$("div#flyingWindow").addClass(id);
						
						
						$("div#content").slideUp(500);
						$(".active").fadeOut(500);
						setTimeout("$('.active').hide();", 500);							
						
						$('.active').removeClass('active');
						$('div#'+id).addClass('active');
						
						setTimeout("$('div#"+id+"').show();", 500); 				
						$('#content').slideDown('500');
						
					} else {return false;};
					
					return true;
					
	};