// remap jQuery to $
(function($){

 





 



})(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);

(function ($) {
// VERTICALLY ALIGN FUNCTION
$.fn.vAlign = function() {
  return this.each(function(i){
  var ah = $(this).height();
  var ph = $(this).parent().height();
  var mh = Math.ceil((ph-ah) / 2);
  $(this).css('margin-top', mh);
  });
};
})(jQuery);

(function ($) {
$.fn.hAlign = function() {
  return this.each(function(i){
  var w = $(this).width();
  var ow = $(this).outerWidth();  
  var ml = (w + (ow - w)) / 2;  
  $(this).css("margin-left", "-" + ml + "px");
  $(this).css("left", "50%");
  $(this).css("position", "absolute");
  });
};
})(jQuery);



