// JavaScript Document

// Automatically make the first paragraph a H2. This makes it nice and chunky (and orange)
	// If there is already such a heading, do nothing
	
	jQuery(document).ready(function($){ 
		
		if($('#expertise-page h2').not('.sidebar-heading').length == 0) {
			$('#expertise-page .main p:first').wrap('<h2><\/h2>');
		}
		
		if($('#product-page .main h2').length == 0) {
			$('#product-page .main p:first').wrap('<h2><\/h2>');
		}
		
		if($('#main-content h2').length == 0) {
			$('#main-content p:first').contents().wrap('<h2><\/h2>')
		}
	});
	
    Cufon.replace('h1, h2, .meta-box h3, .subRightColBox h2, .headSearch, #headerNav li a , .subSectionTitle, #main-content h2, #main-content h3, #main-content h4, #main-content h5, #main-content h6, .content h2, .press-release h3, h3', { fontFamily: 'DIN', hover: true });
    jQuery(document).ready(function($){ 
      $("ul#headerNav").superfish({ 
        pathClass:  'current',
        delay: 900,
        pathClass: 'current',
        autoArrows: false,
        onBeforeShow: function() {
          $(this).prev().prev().addClass('current');
        },
        onShow: function() {
          Cufon.refresh();
        },
        onHide: function() {
          $(this).parent().find('a').removeClass('current');
          Cufon.refresh();
        }
      }); 
      $('a.fancybox').fancybox();
    });

