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

  CSS on Sails Framework
  Title: Sales Pros
  Author: XHTMLized (http://www.xhtmlized.com/)
  Date: July 2010

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

var Site = {
  Common: {
    init: function(e) {
      $('body').addClass('js');
    },
    hoverClass: function(e) {
      // add a "hover" class while hovered. Used for navigation
      $(e).hover(function() {
        $(this).addClass('hover');
      },
      function() {
        $(this).removeClass('hover');
        Cufon.refresh();
      });
    },    
    /* Label propagator */
    accessibleInputValues: function(e) {
      labeltxt = $(e).parent().find('label').html();
      if ($(e).val() == '') $(e).val(labeltxt);
      $(e)
        .focusin(function() {
          labeltxt = $(this).parent().find('label').html();
          if ($(this).val() == labeltxt) $(this).val('');
        }).focusout(function() {
          labeltxt = $(this).parent().find('label').html();
          if ($(this).val() == '') $(this).val(labeltxt);
        });
    },
    ie6pngFix: function(e) {
      if (typeof DD_belatedPNG != 'undefined') {
        DD_belatedPNG.fix('img, #content .carousel-widget .wrapper .pagination .prev, #content .carousel-widget .wrapper .pagination .next');
      }
    }
  }
  
    
 
};

$(document).ready(function() {
  Site.Common.init();  
  Site.Common.hoverClass('#navigation li');
	Site.Common.ie6pngFix();
	//cufonized
	if (typeof Cufon != 'undefined') {

		Cufon.replace('#navigation > ul > li > a', { hover: true});
		Cufon.replace('#head h1');
	}

   
});
