$(document).ready(function(){

	// Open external links in new tab
		$("a[rel=external], #header h2 a, ul.twitter-feed li a").attr({ target: "_blank" });
	
	// Remove outlines from clicked links
		$("a").click(function() {
			$(this).blur();
		});
	
	// IE6 PNG fix
		if($.browser.msie && $.browser.version < 7){
			DD_belatedPNG.fix('#navigation ul li a span');
		}		
	
	// Sliding boxes
		
		// remove fallback css
		$("div.image-slide img.front").css('display', 'block');
	
		// slide boxes
		$('.top-left').hover(function(){
			 $(this).children('.front').stop().animate({'top' : '186px', 'left' : '268px'}, 500);
		}, function(){$(this).children('.front').stop().animate({'top' : '0px', 'left' : '0px'}, 500);});
		$('.top-center').hover(function(){
			 $(this).children('.front').stop().animate({'top' : '186px'}, 500);
		}, function(){$(this).children('.front').stop().animate({'top' : '0px', 'left' : '0px'}, 500);});
		$('.bottom-center').hover(function(){
			 $(this).children('.front').stop().animate({'top' : '-186px'}, 500);
		}, function(){$(this).children('.front').stop().animate({'top' : '0px', 'left' : '0px'}, 500);});
		$('.left').hover(function(){
			 $(this).children('.front').stop().animate({'left' : '268px'}, 500);
		}, function(){$(this).children('.front').stop().animate({'top' : '0px', 'left' : '0px'}, 500);});
		$('.right').hover(function(){
			 $(this).children('.front').stop().animate({'left' : '-268px'}, 500);
		}, function(){$(this).children('.front').stop().animate({'top' : '0px', 'left' : '0px'}, 500);});
		$('.top-right').hover(function(){
			 $(this).children('.front').stop().animate({'top' : '186px','left' : '-268px'}, 500);
		}, function(){$(this).children('.front').stop().animate({'top' : '0px', 'left' : '0px'}, 500);});
	
	// Sliding navigation
	
		// remove fallback css
		$("div#navigation ul li a").not('.active').css('background-position', '135px 0px');
		
		// hover
		$("#navigation ul li a").not('.active').hover(
			function () {
				$(this).stop().animate({
					backgroundPosition: '0px 0px'
				}, 250, function() {
					// animation complete
				});
			},
			function () {
				//hover off
				$(this).animate({
					backgroundPosition: '135px 0px'
				}, 250, function() {
					// animation complete
				});
			}
		);
	

	
});
