
// remap jQuery to $
(function($){
 	$(document).ready(function() {
   
		//scroller
		$('a[href=#container]').click(function(){
			$('html, body').animate({scrollTop:0}, 'slow');
			return false;
		});
		
		//attach window.open to external links
        $('a.external').bind('click', function () {
            //open a window
            var oWin = window.open($(this).attr('href'), '', '');
            oWin.focus();
            //dont follow the link
            return false;
        });

	});

})(this.jQuery);

// usage: log('inside coolFunc',this,arguments);
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){
  log.history = log.history || [];   // store logs to an array for reference
  log.history.push(arguments);
  if(this.console){
    console.log( Array.prototype.slice.call(arguments) );
  }
};

// catch all document.write() calls
(function(doc){
  var write = doc.write;
  doc.write = function(q){ 
    log('document.write(): ',arguments); 
    if (/docwriteregexwhitelist/.test(q)) write.apply(doc,arguments);  
  };
})(document);



