$(document).ready(function(){
	
	(function(){
		$("#navProjContent").css('opacity','0');
		$("#blog").css('z-index','10');
	})();
	
	$("#projectsLink").click(function(){
		
		
		$("#navProjects").animate({
			width: '170px',
			height: '410px',
			top: '30px',
			left: '6px'
			
		}, 350, "easeInSine", function(){
			
			$("#navProjContent").animate({
				opacity: '1'
			}, function(){
				$(this).parent().draggable({ 
					handle: "#dragger"					
				});
				$('#dragger').css({
					cursor: 'move',
					opacity: '.7'
				});
			});
		
		});
	
	});
	
	$('a[href*=#]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
			var $target = $(this.hash);
			$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
			if ($target.length) {
				var targetOffset = $target.offset().top - 140;
				if(!$('html,body').is(':animated')) {
					$('html,body').animate({scrollTop: targetOffset}, 1500, "easeInOutCirc");
				}
				
				return false;
			}
		}
	});
	
	$("#navProjects").css({
		opacity: '0.8'
	});
	
	$("#navProjects").mouseover(function(){
		$(this).css({
			opacity: '1'
		});
	});
	
	$("#navProjects").mouseout(function(){
		$(this).css('opacity','0.8');
	});
	
	$("#closeBtn").click(function(){
		
		$(this).parent().parent().animate({
			opacity: '0'
		}, 350, "easeOutSine", function(){
			$("#navProjects").animate({
				width: '0px',
				height: '0px',
				top: '0px',
				left: '0px'
			}, 350, "easeOutSine", function(){
				$("#navProjects").css('display','none');
			});
			
		});
		
								  
	});
						   
});