$.blog = {	
	init:function()
	{
		var speed = 1000;
		$('.short:first').hide();
		$('.entry:first').show();
		
		$('.short a').bind("click", function(e){
			var postId = $(this).parent().parent().attr("id");
			pageTracker._trackPageview("/more/" + postId);
			var id = $(this);
			id.parent().fadeOut(speed, function(){
				id.parent().next().fadeIn(speed);
			});
			return false;
		});
		
		$('.entry a').bind("click", function(e){
			var href = $(this).attr("href");
			if(href.length > 2) {
				pageTracker._trackPageview("/extern/" + href.replace(/\//g,'-'));
			}
		});
		
		$('a.less').bind("click", function(e){
			var id = $(this);
			id.parent().fadeOut(speed, function(){
				id.parent().prev().fadeIn(speed);
			});
			return false;
		});
		
		$('.post h2 a').bind("click", function(e){
			var postId = $(this).parent().parent().attr("id");
			pageTracker._trackPageview("/head/" + postId);
		});
		
		$('.blogroll li a').bind("click", function(e){
			var href = $(this).attr("href");
			pageTracker._trackPageview("/links/" + href.replace(/\//g,'-'));
		});
		
		$('#headerimg').bind("click", function(e){
			top.location="/";
		});
	}
}

$(document).ready(function(){
	$.blog.init();	
});