/**********************************************************************************************

  CSS on Sails Framework
  Title: Site Name
  Author: kidBombay (http://www.kidbombay.com/)
  Date: March 2010

***********************************************************************************************/

var Site = {
  Common: {
    init: function(e) {
      $('body').addClass('js');
    },
    /* Label propagator */
    accessibleInputValues: function(e) {
      labeltxt = $(e).prev().html();
      if ($(e).val() == '') $(e).val(labeltxt);
      $(e)
        .focusin(function() {
          labeltxt = $(this).prev().html();
          if ($(this).val() == labeltxt) $(this).val('');
        }).focusout(function() {
          if ($(this).val() == '') $(this).val(labeltxt);
        });
    },
    lastChildClass: function(e) {
      $(e + ':last-child').addClass('last-child');
    },
    setupCufon: function(e) {
      if (typeof Cufon != 'undefined') {
        Cufon.replace(
          'h1,' +
          'h2,' +
          'h3,' +
          'h4,' +
          '.jobs-benefits blockquote p,' +
          '.testimonials blockquote p,' +
          '.testimonial blockquote p',
          '.label-image .label'
        );
        Cufon.replace('.branding .label',{textShadow: '#0f1112 0 -1px'});
        Cufon.replace('#news-sub-navigation .label',{textShadow: '#fff 0 1px'});
        Cufon.replace('#company-sub-navigation .label',{textShadow: '#fff 0 1px'});
        Cufon.replace('#advertising-sub-navigation .label',{textShadow: '#fff 0 1px'});
        Cufon.replace('#join-us a.join-group',{hover: true});
        Cufon.replace('.fun-facts li span',{textShadow: '#fff 0 1px'});
      };
    }  
  }
};

$(document).ready(function() {
  Site.Common.init();
  Site.Common.accessibleInputValues('#footer #search_form input.text');
  Site.Common.setupCufon();
  Site.Common.lastChildClass('.directors .director')
});
