jQuery(function($){
	if ($('#the-content').hasClass('on-home')) {
		$('#logo a').click(function() {
			$('#category-source').quicksand($('#category-all .entry'), {
				attribute: 'rel'
			});	
			return false;
		});
		
		$('#navigation ul li a').click(function(){
			$('.entry').show();
			$('#navigation ul li a').removeClass('active');
			
			$('.featured').stop().animate({
				'opacity': 0,
				'height': 0,
				'padding-top': 0,
				'padding-bottom': 0,
				'margin-top': 0,
				'margin-bottom': 0
			}, 200, function() {
				$(this).remove();
			});
			
			var th = $(this);
			$('#category-source').quicksand($('#category-' + th.attr("id") + ' .entry'), {
				attribute: 'rel'
			});	
			$(this).addClass('active');
			return false;
		});	
		
		hash = window.location.hash;
		
		if ($(hash).length) {
			$(hash).click();
		}
		
	}
	
	if($.browser.msie && $.browser.version==6) {
		$('.main .entry').each(function(){
			var entry_height = $(this).height();
			$(this).find('.entry-info').css('height', entry_height);
		});
		
		$('.main .entry').live('mouseenter', function(){
			$(this).find('.entry-info').show();
		});
		$('.main .entry').live('mouseleave', function(){
			$(this).find('.entry-info').hide();
		});
	} else {
		$('.main .entry').live('mouseenter', function(){
			$(this).find('.entry-info').stop().fadeTo(200, 1);
		});
		$('.main .entry').live('mouseleave', function(){
			$(this).find('.entry-info').stop().fadeTo(200, 0);
		});
	}
	
	$('.main .entry').live('click', function() {
		var href = $(this).find('a:eq(0)').attr('href');
		window.location.href = href;
	});
})
