window.log = function(){
  log.history = log.history || [];
  log.history.push(arguments);
  if(this.console){
    console.log( Array.prototype.slice.call(arguments) );
  }
};

(function($) {

  /* ----------------------------------------------------------------
    Browsers
  ---------------------------------------------------------------- */
  var isOpera = ($.browser.opera),
      isWebkit = ($.browser.webkit),
      isIE = ($.browser.msie),
      bodyClass;
  if (isOpera) {
    bodyClass = 'opera';
  }
  if (isWebkit) {
    bodyClass = 'webkit';
  }

  // add classes to body tag
  $('body').addClass(bodyClass);


  /* ----------------------------------------------------------------
    external links
  ---------------------------------------------------------------- */
  $("a[href^=http]").each(function() {
    if(this.href.indexOf(location.hostname) == -1) {
      $(this)
        .addClass('external')
        .click(function() {
          window.open(this.href);
          return false;
        });
    }
  });
  $("a[href$=pdf]").click(function() {
    window.open(this.href);
    return false;
  });


  /* ----------------------------------------------------------------
    lightbox
  ---------------------------------------------------------------- */
  $('a[rel=lightbox]').not('#press-list a').fancybox({
    //overlayColor: '#fff',
    //overlayOpacity: '0.8',
    titlePosition: 'over',
    transitionIn: 'elastic',
    transitionOut: 'elastic'
  });


  /* ----------------------------------------------------------------
  	placeholder - if placeholder isn't supported
  ---------------------------------------------------------------- */
  $('input, textarea').placeholder();
  

})(window.jQuery);

