$(document).ready(function(){
	
	// Init Cufón
	Cufon.replace('h1, h2, h3');
	
	// This div needs to be inside another div with a fixed height. 
	// Otherwise the page will flinch on fade.
	$("#quotes").append('<div id="testimonials"></div>');
	$("#testimonials").quotator({
    	speed : 7000,
    	json : "js/quotator_quotes.js"
	});
	
	// Toggles the book page thumbs. 
	// When the page first load we don't wanna see em.
	$("div.toggleThumbs").css("display","none");
	$("img.wannaSee").click(function () {
	
		if($(this).attr("src") == "images/wanna_close.png") { $(this).attr("src", "images/wanna_see.png"); } else { $(this).attr("src", "images/wanna_close.png"); }
		$(this).nextAll("div.toggleThumbs").slideToggle("slow");
    });
	
	// Sticker button fading
	$("a.myPortfolio").hover(function() {
		$(this).css('background', 'url(images/sticker.png) no-repeat 0px -179px');
	});
	$("a.myPortfolio").append('<a class="myPortfolioh" href="/portfolio">My portfolio!</a>');
	
	$("a.myPortfolio").hover(function() {
		$("a.myPortfolioh").fadeIn("fast");
	});
	$("a.myPortfolioh").mouseleave(function() {
		$("a.myPortfolioh").fadeOut("fast");
	});	
});
