

$(document).ready(function() {
  //create the vars for the swf
  
  var params = {
      menu: "false",
      wmode: "transparent"
  };
  
  konami.load();
  konami.code = function(){
    
    //append the full screen div to the page so we can embed flash in it
    $("body").append('<div id="konami-overlay" style="position:fixed;top:0;left:0;background:#000;width:100%;height:100%;z-index:600;opacity: 0;"></div>');
  	$("body").append('<div id="konami-code" style="position:fixed;top:0;left:0;width:100%;height:100%;z-index:610;"><div id="konami-flash-embed"></div></div>');
  	
  	$("#konami-overlay").animate({ opacity: 0.7 }, 1000, "swing", function(){
    	//embed the easter egg
    	swfobject.embedSWF("/swf/easter-egg.swf", "konami-flash-embed", "1100", "100%","9.0.0", "", {}, params, {});
  	});
  	
  	//hide the flash objects on the page
  	$("object").hide();
  }
  
  //bind the escape key
  $(document).keyup(function(event){
      if (event.keyCode == 27) {
          removeEasterEgg();
      }
  });
  
  function removeEasterEgg(){
    //remove konami code html
    $("#konami-overlay").remove();
    $("#konami-code").remove();
    
    //show the flash objects on the page
  	$("object").show();
  }
  
});

function removeEasterEgg() {
	$(function(){
    //remove konami code html
    $("#konami-overlay").remove();
    $("#konami-code").remove();
    
    //show the flash objects on the page
  	$("object").show();
	});
}