$(document).ready(function(){
	$(window).konami(function() {
		$('body').css({ 'overflow' : 'hidden' });
		$('html').css({ 'overflow-y' : 'hidden' });
		$('.panicmac').slideDown(function(){
			$('.panicmac div').css({ 'display' : 'block' });
		});
		$('.panicwindows').css({ 'display' : 'block' });
	}, "38,38,40,40,37,39,37,39,66,65"); // up, up, down, down, left, right, left, right, b, a
	
	$(window).konami(function() {
		$('.htmltag').css({ 'display' : 'block', 'padding-bottom' : '10px' });
	}, "67,79,68,69,13"); // c, o, d, e, enter
	
	$(window).konami(function() {
		$('.htmltag').css({ 'display' : 'none', 'padding-bottom' : '10px' });
	}, "78,79,67,79,68,69,13"); // n, o, c, o, d, e, enter
	
	$(window).konami(function() {
		$('body,.commentsHolder,.footer,.twitter,.mixtape').css({
			'background-image' : 'url(http://www.goreki.com/wp-content/themes/empty/img/grid.png)',
			'background-position':'top',
			'background-repeat':'repeat-y'
		});
		$('#nav,.commentsHolder,.footer,.twitter').css({
			'border-color':'black',
			'border-style':'solid',
			'border-width':'1px'
		});
	}, "71,82,73,68,13"); // g, r, i, d, enter
	
	$(window).konami(function() {
		$('body,#nav,.commentsHolder,.footer,.twitter,.mixtape').css({
			'background-image' : '',
			'background-repeat':'repeat',
			'border-width':'0'
		});
	}, "78,79,71,82,73,68,13"); // n, o, g, r, i, d, enter
	
	$('.menu,.logo,.navHolder,.sideContent').css({'opacity' : '0'});
	$('.entryTitle,.mixtapeTitle,.entryDate').css({'opacity' : '0.5'});
	$('.bottom,.footer,.twitter').css({'background-color' : '#fff','color': '#000'});
		
	$('body').one("mouseover",function() {
			$('.menu,.logo,.entryTitle,.pageTitle,.pageSide,.mixtapeTitle,.navHolder,.entryDate,.sideContent').animate({opacity: 1.0});
			$('.bottom').animate({backgroundColor: '#dddee1',color: '#000'});
			$('.footer').animate({backgroundColor: '#000',color: '#fff'});
			$('.twitter').animate({backgroundColor: '#b2e0ff'});
	});
	
	// $('body').toggle(function() {
	// 	$('.menu,.logo,.entryTitle,.pageTitle,.pageSide,.mixtapeTitle,.navHolder,.entryDate,.sideContent').animate({opacity: 0.25});
	//},function() {
	//	$('.menu,.logo,.entryTitle,.pageTitle,.pageSide,.mixtapeTitle,.navHolder,.entryDate,.sideContent').animate({opacity: 1.0});
	//});
	
	$('.openPanel').click(function() {
		$('.menu').css({'background-color' : '', 'color' : ''});
		$(this).parent().css({'background-color' : '#000', 'color' : '#fff'});		
	});
	$('.closePanel').click(function() {
		$('.menu').css({'background-color' : '', 'color' : ''});
		$('.panel').slideUp();			
	});
	$('.panel').click(function() {
		$('.menu').css({'background-color' : '', 'color' : ''});
		$('.panel').slideUp();			
	});
	
	$('.openPanel').click(function() {
		var url=$(this).attr("href");
		$('.panel').slideUp();
		$(this).css({'background-image' : 'url(../img/load1.gif)'});
		$('#loadPanelContent').load(''+url+'', function() {
			$('.panel').slideDown();
			$(this).css({'background-image' : 'url()'});
		});
		return false;
	});
	$('.open').toggle(function() {
		$(this).parent().children('.tohide').slideDown(function() {
			$(this).parent().children('.sideTitle').css({'background-image' : 'url(/wp-content/themes/empty/img/cat-arrow-down.png)'});
		});
	},
	function() {
		$(this).parent().children('.tohide').slideUp(function() {
			$(this).parent().children('.sideTitle').css({'background-image' : 'url(/wp-content/themes/empty/img/cat-arrow-right.png)'});
		});
	});
	
	
	$("div.navHolder div a img").mouseover(function() {
		$(this).animate({opacity: 1.0});
	});
	
	$("#ViewMixCover").click(function() {
    	$("#ViewMixCover").fadeOut("fast");
    		$("#coverList").fadeIn("fast");
    	$(".mixtape").children('.coverup').children('.details').fadeOut("fast", function() {
    		$("#ViewMixDetails").fadeIn("fast");
    	});
    });
    $("#ViewMixDetails").click(function() {
    	$("#ViewMixDetails").fadeOut("fast", function() {
    		$("#coverList").fadeOut("fast");
    		$("#ViewMixCover").fadeIn("fast");
    		$(".mixtape").children('.coverup').children('.details').fadeIn("fast");
    	});
    });
	
});
