$(document).ready(function(){
	
	// IE6:
	$('#content:last-child .post').css('margin-bottom', '0');
	
	$('#sidebar .widgetized li:last-child ul li:last-child, #sidebar .widgetized li:last-child div').css({
		'background': 'url(http://depi.local/ywyc/CMD_Shift_Design/thealchemyofloss/wordpress/wp-content/themes/thealchemyofloss/images/sheets/sidebar_bottom_bg.jpg) no-repeat 0 100%',
		'padding-bottom': '25px'
	})
	
	$('a.icon').click(function(){
		$li_index = $(this).parent().index()+1; // get the clicked li's index
		
		// if hidden
		if ( $(this).next('.details').css('display') == 'none' ) {
			$('.details').css('display', 'none'); // hide all sidebar boxes
			$('.icons li:nth-child('+$li_index+') .details').css('display', 'block'); // show the clicked box
		}
		else {
			$('.details').css('display', 'none'); // hide all sidebar boxes
		}
		
		return false;
	});
	
	$('.icons li .details').bind('clickoutside', function(event){
		$(this).hide();
	})
	
	$('.searchform input').focus(function(){
		$('.searchform').css('background-position', '0 -51px');
	});
	$('.searchform input').blur(function(){
		$('.searchform').css('background-position', '0 0');
	});
	
	$('.sociable img').hover(function(){
		$src = $(this).attr('src');
		$src = $src.substring(0, $src.length-4);
		$src = $src+'_hover.png';
		$(this).attr('src', $src);
	},
	function(){
		$src = $(this).attr('src');
		$src = $src.substring(0, $src.length-10);
		$src = $src+'.png';
		$(this).attr('src', $src);
	});
	
});

