// remap jQuery to $ - Basically, resolves the issue of people writing crappy plugins
(function($){

  $(window).konami(function(){
    $('body').attr('id','pink');
    setTimeout(function() {
      $('body').attr('id', 'dark');
      }, 20000);

  });

  $('#lastfm').lastFM({
    onComplete: function(){
    }
  });

	// HANDLES EXTERNAL LINKS OPENING IN NEW WINDOWS
	$('a[rel~=external]').click(function(){ this.target = "_blank"; });


})(this.jQuery);



// usage: log('inside coolFunc',this,arguments);
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
// used instead of console.log, which will break browsers that don't have a console open
window.log = function(){
  log.history = log.history || [];
  log.history.push(arguments);
  if(this.console){
    console.log( Array.prototype.slice.call(arguments) );
  }
};

// catch all document.write() calls and output them to the log
(function(doc){
  var write = doc.write;
  doc.write = function(q){ 
    log('document.write(): ',arguments); 
    if (/docwriteregexwhitelist/.test(q)) write.apply(doc,arguments);  
  };
})(document);
