$(function() {
	// Fancy box stuff
	$("section.content a.zoom").fancybox({ 
		'overlayOpacity':  0.8 
	});
	
	// Nudge links in side bar
	$("aside.sidebar ul li a").hover(function() {
		$(this).stop().animate({paddingLeft : "10px"},200);
	},function() {
		$(this).stop().animate({paddingLeft : "0px"},200);
	});
	
	// hide the "slide" link when is not needed
	var wh = $(window).height();
	var dh = $(document).height();
	
	if (dh > wh) {
		$("footer span.slide").show();
	} else {
		$("footer span.powered_by").css({float : "left"});
	}
	
	// fix some things with my tagline
	$("div.tagline h1 br")
		.before("<span class='spacer'>")
		.after("<span class='spacer'>");
	
	// cool slidy thing
	$('.slide a').click(function() {
	   var elementClicked = $(this).attr("href");
	   var destination = $(elementClicked).offset().top;
	   $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination-20}, 400 );
	   return false;
	});


});
