$(document).ready(function () {  

	// START SUBMENUS
	// $('#nav-print').hover(  
	// 	function () {  
	// 		$('#sub-print').show();  
	// 	},  
	// 	function () {  
	// 		$('#sub-print').hide();  
	// 	}  
	// );  

	$('#nav-motion').hover(  
		function () {  
			$('#sub-motion').show();  
		},  
		function () {  
			$('#sub-motion').hide();  
		}  
	);  

	// $('#nav-online').hover(  
	// 	function () {  
	// 		//display the submenu  
	// 		$('#sub-online').show();  
	// 	},  
	// 	function () {  
	// 		$('#sub-online').hide();  
	// 	}  
	// );  

	$('#nav-forFun').hover(  
		function () {  
			//display the submenu  
			$('#sub-fun').show();  
		},  
		function () {  
			$('#sub-fun').hide();  
		}  
	);
	// END SUBMENUS

	// Hide the info panel for the projects
	$(".info-panel").hide('slide', {direction: 'up'}, 10);	
	// Load the images at alpha 0
	$(".project").css({opacity: 0});
	// alpha for info panel bg.
	$(".info-panel-bg").css({opacity: 0.85});
	// Onload fade images to 80% alpha
	$(".project").fadeTo("slow", .8);

	// On hover show the info panel
	$(".project").hover(function(){
		$(this).fadeTo("slow", 1);
		$(this).find(".info-panel").show('slide', {direction: 'up'});
	},function(){
		$(this).fadeTo("slow", .8);
		$(this).find(".info-panel").hide('slide', {direction: 'up'});
	});
	$('#tumblr_controls').css('top', '42px');
	$('#tumblr_controls').css('left', '643px');

});

if ( document.all && !window.XMLHttpRequest ) {
	$('#header').css('position', 'absolute');
	$('#header').css('top', '0px');
}

window.onscroll = function()
{
	if( window.XMLHttpRequest ) { // IE 6 doesn't implement position fixed nicely...

		if (document.documentElement.scrollTop > 153 || self.pageYOffset > 153) {
			$('#header').css('position', 'fixed');
			$('#header').css('top', '-153px');
		} else if (document.documentElement.scrollTop < 150 || self.pageYOffset < 150) {
			$('#header').css('position', 'absolute');
			$('#header').css('top', '0px');
		}

	}
}
