$(document).ready(function() {
	$("div#projects").delay(1500).slideUp("slow");
	
    $("div#header a").mouseenter(function(){
     	$("div#projects").slideDown("fast");
    });
	$("div#projects").mouseleave(function(){
      	$("div#projects").delay(200).slideUp("fast");
    });

	$(".thumb-bg").mouseenter(function(){
		$(this).css('opacity',0);
	}).mouseleave(function(){
	      $(this).css('opacity',1)
	});
	
	$("#next").mouseenter(function(){
		$(this).css('right',15);
	}).mouseleave(function(){
	     $(this).css('right',0)
	});
	
	$("#previous").mouseenter(function(){
		$(this).css('left',15);
	}).mouseleave(function(){
	     $(this).css('left',0)
	});
	
});

$(document).keydown(function(e){
	if (e.keyCode == 38) { 
		    $("div#projects").slideDown("fast");
    }
	if (e.keyCode == 40) { 
		    $("div#projects").slideUp("fast");
    }
    if (e.keyCode == 37) { 
		if ($("#previous").length > 0){
		    document.location = $("#previous a").attr('href');
			return false;
		}
    }
	if (e.keyCode == 39) { 
		if ($("#next").length > 0){
		    document.location = $("#next a").attr('href');
			return false;
		}
    }       
});
