//AutoRefinish DeVilbiss Javascript Functions
 jQuery.fn.customFadeIn = function(speed, callback) {
		jQuery(this).fadeIn(speed, function() {
			if(jQuery.browser.msie)
				jQuery(this).get(0).style.removeAttribute('filter');
			if(callback != undefined)
				callback();
		});
	};
	jQuery.fn.customFadeOut = function(speed, callback) {
		jQuery(this).fadeOut(speed, function() {
			if(jQuery.browser.msie)
				jQuery(this).get(0).style.removeAttribute('filter');
			if(callback != undefined)
				callback();
		});
	};

 
 jQuery(document).ready(function()
 {
 		//Create Span Needed for Live Tabs Module Theme//
 		//Fix the Orange Tabs Display on the Product Pages
        jQuery('ul[id^=LiveTabs] li a').each(function() { jQuery(this).html('<span class="slideMe">' + jQuery(this).text() + '</span>') });
		
        //Menu Scripts
		jQuery('#mainNav li').hoverIntent(
	        function() { $('ul', this).stop(true, true).customFadeIn(); },
	        function() { $('ul', this).stop(true, true).customFadeOut('medium'); });
        
		//Identify the first and last items in the main Navigation bar.
        jQuery('#mainNav li:first').addClass('mainNavFirst');
        jQuery('#mainNav li:last-child:not(#mainNav li ul li:last-child)').addClass('mainNavLast')
		
		//Home Large Icon Bar
        jQuery('#homeNav li').hoverIntent(
	        function() { $('ul.divisionSubs', this).stop(true, true).customFadeIn(); },
	        function() { $('ul.divisionSubs', this).stop(true, true).customFadeOut(); });
        
		
        jQuery('#innerMainNav li').hoverIntent(
	        function() { $('ul', this).stop(true, true).customFadeIn(); },
	        function() { $('ul', this).stop(true, true).customFadeOut(); });
        jQuery('#secondaryNav li').hoverIntent(
	        function() { $('.divisionSub', this).stop(true, true).customFadeIn(); },
	        function() { $('.divisionSub', this).stop(true, true).customFadeOut(); });
        
		//Identify the first and last items in the secondary Navigation bar.
        jQuery('#secondaryNav li:first').addClass('secondaryNavFirst');
        jQuery('#secondaryNav li:last-child:not(#secondaryNav li ul li:last-child)').addClass('secondaryNavLast');
		
		//Stripe the Tech Specs Tables
		jQuery('.techSpecTable tr:even td').addClass('grayStripe');
		
		//Provide Row Highlighting on Parts Tables
        jQuery(".tableBlack3Col, .tableBlack4Col, .partsTable").delegate('td', 'mouseover mouseleave', function(e) {
            if (e.type == 'mouseover') {
                jQuery(this).parent().addClass("hover");
            }
            else {
                jQuery(this).parent().removeClass("hover");
            }
        });
		
		//Activate Fancybox
		jQuery('a.zoom').fancybox({titleShow:false});
		
		//Handle Literature Links
        jQuery('a[href^=/ServiceSupport/Literature.aspx?Command=Core_Download&EntryId=]').attr('target', '_blank');
		
		//Add Blank Select Option to State Dropdown on Contact Form
		jQuery('#dnn_ctr794_ViewContactUs_drpText8').prepend('<option value="" selected="selected">--Select--</option>');
		//Pre-select United States in Country List on Contact Form
		jQuery('#dnn_ctr794_ViewContactUs_drpText9 option[value=US]').attr('selected', 'selected');
	});
