$(document).ready(function() {
	// animtate main menu buttons inner shadow attribute on mouseover
	$(".noJS").removeClass("noJS");
	$("#page_header li:not('.current-menu-item') a").hover(function(e){
		$(this).css({backgroundPosition: '0 0'}).stop().animate({boxShadow: '0 0 10px rgba(0,0,0,0.1)'}, 'fast');
	},function(e) {
		$(this).css({backgroundPosition: '0 -1000px'}).stop().animate({boxShadow: '0 0 0 rgba(0,0,0,0.1)'}, 'fast');
	});

	$("#blog_comments article").css({opacity: '0.6'}).hover(
		function(e){
			$(this).stop().animate({opacity: '1'}, 'fast');
		}, function(e) {
			$(this).stop().animate({opacity: '0.6'});
		}
	);

	$("#footer_menu li:not('.current-menu-item') a").hover(function(e) {
		$(this).stop().animate({backgroundColor:'#21222a', color: '#0a0b0e'});
	}, function(e) {
		$(this).stop().animate({backgroundColor: '#262831', color: '#1b1e25'});
	});

	function smoothScroll(id){
	     	$('html,body').animate({scrollTop: $("#"+id).offset().top},'slow');
	}

	$(".scroll_to_anchor").click(function(e){
		smoothScroll($(this).attr("href").substr(1));
		e.preventDefault();
	});
	
	$(".toggle_contact_form").click(function(e) {
		var cf = $("#contact_form");
		if(cf.is(':visible')) {
			cf.animate({top: '-=300'}, 800, function() {cf.hide();});
		} else {
			$("#contact_name").focus();
			cf.show().animate({top: '+=300'}, 800, 'swing');
		}
		e.preventDefault();
	});
	
	$('a.screenshot').lightBox();
});
