// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

// 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(){
//   var docwrite = document.write;
//   document.write = function(q){
//     log('document.write(): ',q);
//     if (/docwriteregexwhitelist/.test(q)) docwrite(q); 
//   }
// })();