 $(document).ready(function() {
 
    var $sidebars = $('aside#sidebar')
 
     	//Fades out the sidebar on load, delaying for 15 seconds
    $sidebars.delay(10000).animate(
        {opacity: 0.4}, 15000);
    
    //Fades in and out the sidebar
    $sidebars.hover(function() {
        $(this).stop(true,true).animate({opacity: 1}, 200).delay(15000);
        },
        function() {
        $(this).animate({opacity: 0.4}, 6000);
        }    
    );        
    
     	//Fades in and out the searchbar
    $('div#searchbar').hover(function() {
        $(this).stop(true,true).animate({opacity: 1}, 400);
        },
        function() {
        $(this).delay(4000).animate({opacity: .4}, 8000);
        }
    );
    
    //fades in and out the post footer
    $('div.post-footer').hover(function() {
        $(this).animate({opacity: 1}, 400);
        },
        function() {
        $(this).animate({opacity:0.5},400);
        }
    );
    
    $("#content p, #content blockquote, a.nktagcloud-12").removeAttr("style").removeAttr("align");
    	
	$(".tab:not(:first)").hide();

	//to fix u know who
	$(".tab:first").show();
	
    $("aside#about-manan").hide();
    
    $("#colophon").click(function() {
    $("aside#about-manan").slideToggle();
    });
    
    $("#close-btn").click(function() {
    $("aside#about-manan").slideUp();
    });
	
	$(".htabs a").click(function(){
		stringref = $(this).attr("href").split('#')[1];

		$('.tab:not(#'+stringref+')').hide();
		$('a.:not(#'+stringref+')').removeClass("selected");

		if ($.browser.msie && $.browser.version.substr(0,3) == "6.0") {
			$('.tab#' + stringref).show();
		}
		else 
			$('.tab#' + stringref).fadeIn();
			$('a.#' + stringref).addClass("selected");
		
		return false;
	});	
	
});

if ( window.addEventListener ) {  
  var state = 0, konami = [38,38,40,40,37,39,37,39,66,65];  
  window.addEventListener("keydown", function(e) {  
    if ( e.keyCode == konami[state] ) state++;  
    else state = 0;  
    if ( state == 10 )  
      window.location = "http://beingmanan.com/saved.html";  
    }, true);  
}  
