$(document).ready(function(){
	
	var webpage;
	if (!webpage) {
		webpage = $('<div style="position:absolute" id="webpageLink">sdfg</div>').appendTo(document.body).hide();
	}
	
	
	$(".content").hide();
	
	$(".content:first").show();
	
	$("#Work").height($("#Work").height()+25)
	$("#Social").height($("#Social").height()+25)
	
	$("#Navigation a").click(function(){
		$("#Navigation a").removeClass("selected");
		$(this).addClass("selected");
		var current = $(this).attr("href");
		
		$(".content:visible").hide();
		
		$(current).fadeIn("slow");
		
		$("#main").animate({"height":$(current).height()});
		
		webpage.hide();
		
		return false;
	});
	
	
	
	
	$("#Ref li").hover(
		function(){
			link = "<a href='http://"+$(this).attr("link")+"' target='_blank'>"+$(this).attr("link")+"</a>"
			webpage.hide();
			webpage.html(link).fadeIn("fast");
			
			webpage.css({
				top: ($(this).position().top-webpage.height()+5) + "px",
				left: ($(this).position().left-$(this).width()/2+160/2-5) + "px",
				width: ($(this).width()+20) + "px"
			});
	});
	$("input, textarea").hover(
		function(){
			$(this).addClass("formHover");
		},
		function(){
			$(this).removeClass("formHover");
	});
		
		
	$("input, textarea").focus(
		function(){
			$(this).valuethingy = true;
			$(this).addClass("formFocus");
			$(this).removeClass("formunFocus");
	});
	
	$("input, textarea").blur(
		function(){
			$(this).addClass("formunFocus");
			$(this).removeClass("formFocus");
	});
});