
jQuery(document).ready(function() {

	// index page
	if ('/' === window.location.pathname && '' === window.location.search) {
		jQuery('#content, .home #content .post').hide();
		jQuery('.aside, #blog-title, #blog-description, #menu-icon')
			.hide()
			.fadeIn(200, function() {
				jQuery('#content').fadeIn(400);
				});
		    jQuery('#content .post').each(function(i) {
		       jQuery(this).delay((i + 1) * 50).fadeIn();
		    });
		jQuery('body').show();
	} else {
	// archive pages
	// content pages
		jQuery('.aside, #blog-title, #blog-description').hide();
		jQuery('body').fadeIn(200);
		jQuery('#branding, #menu-icon, #primary, #secondary').mouseover(function (e) {
			jQuery('#blog-title, .aside').stop(true,true).delay(100).fadeIn(400);
		}).mouseleave(function() {
			jQuery('#blog-title, .aside').delay(100).fadeOut(400);
		});
	}
	jQuery('.home #content .post').mouseover(function() {
		jQuery(this).css('border-color','#004B91');
	}).click(function(e) {
		jQuery(this).unbind().
		css('border-color', '#d4643b');
		if (!e.metaKey) window.location = jQuery(this).find('a:first-child').attr('href');
		else window.open(jQuery(this).find('a:first-child').attr('href'));
	}).mouseleave(function() {
		jQuery(this).css('border-color', '');
	});

});


