// Initialize jQuery

$(document).ready(function(){

	Cufon.replace('h1, h2, h2.widgettitle, #pop_middle h2, #pop_theme_middle h2, h4, .date, h3#comments, ol.commentlist .comment-author a, ol.commentlist .comment-author cite, .split_middle p, h6, span.cufon_span', { fontFamily: 'Quicksand' });

	$("#searchform label").overlabel();

	$('ul.sidebar_theme li a').click(function(){
	     $('#themes').fadeIn("slow");
	   });
	   $('li#theme_close').click(function(){
	     $('#themes').fadeOut("slow");
	   });
	   $('ul.sidebar_pages li#link_about a').click(function(){
	     $('#about').fadeIn("slow");
	   });
	   $('li#about_close').click(function(){
	     $('#about').fadeOut("slow");
	   });
	   $('ul.sidebar_pages li#link_gallery a').click(function(){
	     $('#gallery').fadeIn("slow");
	   });
	   $('li#gallery_close').click(function(){
	     $('#gallery').fadeOut("slow");
	   });
	   $('ul.sidebar_pages li#link_links a').click(function(){
	     $('#links').fadeIn("slow");
	   });
	   $('li#links_close').click(function(){
	     $('#links').fadeOut("slow");
	   });
});


//for scrollTo
	//<![CDATA[
		jQuery(function( $ ){
				//borrowed from jQuery easing plugin
				//http://gsgd.co.uk/sandbox/jquery.easing.php
				//see jquery.easing.1.3.js for available tweens
				$.easing.easeOutQuint = function (x, t, b, c, d) {
      		return c*((t=t/d-1)*t*t*t*t + 1) + b;
				};
			
			//by default, the scroll is only done vertically ('y'), change it to both is needed.
			$.scrollTo.defaults.axis = 'y'; 			

			$.scrollTo( 0 );//reset the screen to (0,0)
			
			//tell buttons what to do 
			$('ul.sidebar_theme li a').click(function(){//$.scrollTo works EXACTLY the same way, but scrolls the whole screen
				//$.scrollTo( 1000, 800 ); //will scroll diagnol
				$.scrollTo( {top:'220px'}, 900, { easing:'easeOutQuint' } );// first number: where (x and y), second number: duration
				return false;
			});
			$('ul.sidebar_pages li.slide a').click(function(){//$.scrollTo works EXACTLY the same way, but scrolls the whole screen
				//$.scrollTo( 1000, 800 ); //will scroll diagnol
				$.scrollTo( {top:'220px'}, 900, { easing:'easeOutQuint' } );// first number: where (x and y), second number: duration
				return false;
			});
		});
	//]]>


