jQuery(document).ready(function() {
	
	// Meta: Header category link drop down
	$('.catLink a').click(function () {
		$('#topCont').slideToggle(300).end();
		$(this).toggleClass('close');
    });
	
	// Meta: Search Drop down
	$('#sDrop').click(function () {
		$('#searchCont').slideToggle(300).end();
		$(this).toggleClass('closeS');
    });
	
	// Freebie page: sub-category drop-down menu
	$('.freeDrop').hover(function () {
		$('#dropMain').slideToggle(200).end();
		$(this).toggleClass('close');
    });
	
	// Freebie page: non-hovered freebie opacity trick
	$("#freebieCont").delegate("div.freebie", "mouseover mouseout", function(e) {
		if (e.type == 'mouseover') {
		$(".freebie").not(this).dequeue().animate({opacity: "0.5"}, 300);
		} else {
		$(".freebie").not(this).dequeue().animate({opacity: "1"}, 300);
		}
	});
	
	// Contact page: submit button hover effect
	$(".wpcf7-submit").hover(function() {
		$(this).animate({ backgroundColor: "#666" }, 500);
		},function() {
		$(this).animate({ backgroundColor: "#222" }, 300);
	});
	
	// Blog category/archive: main image zoom effect
	$("a.thumbBlog").hover(function() {
		$(this).find('img').effect("scale", { percent: 110 });
		},function() {
		$(this).find('img').effect("scale", { percent: 91 });
	});
	
	// lol konami
	if ( window.addEventListener ) {
			var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65";
			window.addEventListener("keydown", function(e){
					kkeys.push( e.keyCode );
					if ( kkeys.toString().indexOf( konami ) >= 0 )
							$('#konCont').show(400);
			}, true);
	}
	$('#konCont').click(function () {
		$(this).remove();
    });

	
});
