/* Author: Justin van Wees*/
$(document).ready(function(){
	/* 
			MAIN MENU (HEADER)
	*/
	// Main menu slidedown
	$('body header#main_header').hoverIntent(function(){
		$('body header#main_header nav').slideDown();
	}, function(){
		$('body header#main_header nav').slideUp();
	});
	
	// Link hovers
	$('body header#main_header nav a:not(.selected)').hover(function(){
		$(this).css({backgroundPosition:'0 0'});
		$(this).stop().animate(
			{backgroundPosition: '0 -200px'}, 
			{duration: 200}
		).animate(
			{color: '#000'},
			{duration: 500}
		);
	}, function(){
		$(this).css({backgroundPosition:'0 -200px'});
		$(this).stop().animate(
			{backgroundPosition: '0 0', color: '#fff'},
			{duration: 300}
		);
	});
	
	/* 
			TWEET-THIS POPUP
	*/
	$('a.tweet-this').click(function(){
		var screen_width = screen.width;
		var screen_height = screen.height;
		var window_width = 550;
		var window_height = 450;
		var top = Math.round((screen_height/2)-(window_height/2));
		var left = Math.round((screen_width/2)-(window_width/2));
		window.open(this.href, "twitter_tweet", "left="+left+",top="+top+",width="+window_width+",height="+window_height+",personalbar=0,toolbar=0,scrollbars=1,resizable=1");
		return false;
	});
	
	/* 
			FACEBOOK SHARE POPUP
	*/
	$('a.facebook-share').click(function(){
		var screen_width = screen.width;
		var screen_height = screen.height;
		var window_width = 550;
		var window_height = 350;
		var top = Math.round((screen_height/2)-(window_height/2));
		var left = Math.round((screen_width/2)-(window_width/2));
		window.open(this.href, "facebook_share", "left="+left+",top="+top+",width="+window_width+",height="+window_height+",personalbar=0,toolbar=0,scrollbars=1,resizable=1");
		return false;
	});
});
























