// JavaScript Document
 
// main nav
 $(document).ready(function() {   
    	function addMega(){
        	$(this).addClass("hovering");
        }
	    function removeMega(){
        	$(this).removeClass("hovering");
        }
	    var megaConfig = {
         interval:300,
         over: addMega,
         timeout: 300,
         out: removeMega
		};
    $jq144("li.adimega").hoverIntent(megaConfig)
});
	 

// Product tab

$(document).ready(function(){
	//Modified to handle the case when first item in the ul is super category
	if ($('ul#topnav .productitems li:first').hasClass('notabcontent')) {
		$('ul#topnav .tabcontent').addClass('tabcontent_hide'); 
		$('.product_mega_drop_width').addClass('mega_drop_width_notabcotnent'); 
		$('#Productab .mega_drop_container').addClass('nobackground');
	} else {
	$('ul#topnav .tabcontent ul:first').show();
	}
	$('ul#topnav .tabcontent ul').hide();
	$('ul#topnav .productitems li:first').addClass('selected');	
	  
	$(function() {
    	ProConfig = {
			sensitivity:1, // number = sensitivity threshold (must be 1 or higher)
			interval:25, // number = milliseconds for onMouseOver polling interval
			timeout:25, // number = milliseconds delay before onMouseOut
			over: function() {
			$('ul#topnav .productitems li').removeClass('selected');
			$('ul#topnav  .tabcontent').removeClass('tabcontent_hide'); 
			$(this).parent().addClass('selected'); 
			$('#Productab .mega_drop_container').removeClass('nobackground'); /*R1131: Added*/
			$('.product_mega_drop_width').removeClass('mega_drop_width_notabcotnent'); 
			var currentTab = $(this).attr('rel'); 
			$('ul#topnav  .tabcontent ul').hide();
			$(currentTab).show();
			return false;
        }, // function = onMouseOver callback (REQUIRED)
        out: function () { } // function = onMouseOut callback (REQUIRED)
    }
    $jq144('ul#topnav .productitems li a').hoverIntent(ProConfig);
});	

 // notabcontent tab  
 
 $(function() {
    	ProConfig = {
			sensitivity:1, // number = sensitivity threshold (must be 1 or higher)
			interval:25, // number = milliseconds for onMouseOver polling interval
			timeout:25, // number = milliseconds delay before onMouseOut
			over: function() {
			$('ul#topnav .tabcontent ul').hide();
			$('ul#topnav .productitems li').removeClass('selected'); 
			$('ul#topnav .tabcontent').addClass('tabcontent_hide'); 
			$(this).parent().addClass('selected'); 
			$('#Productab .mega_drop_container').addClass('nobackground'); 
			$('.product_mega_drop_width').addClass('mega_drop_width_notabcotnent'); 
			$('ul#topnav  .tabcontent ul').hide();
			return false;
        }, // function = onMouseOver callback (REQUIRED)
        out: function () {
			$('ul#topnav .tabcontent').addClass('tabcontent_hide'); 
			$('.product_mega_drop_width').addClass('mega_drop_width_notabcotnent'); 
			$('#Productab .mega_drop_container').addClass('nobackground'); 
		} // function = onMouseOut callback (REQUIRED)
    }
    $jq144('ul#topnav .productitems li.notabcontent a').hoverIntent(ProConfig)
});	

		
});
	
	
// application tab
$(document).ready(function(){
	$('ul#topnav .applicationcontent ul').hide();
	$('ul#topnav .applicationcontent ul:first').show();
	$('ul#topnav .applicationitems li:first').addClass('selected');	 
	
	$(function() {
   	appConfig = {
        sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)
       	interval:25, // number = milliseconds for onMouseOver polling interval
        timeout:25, // number = milliseconds delay before onMouseOut
        over: function() {
        	$('ul#topnav .applicationitems li').removeClass('selected');
		$('ul#topnav  .applicationcontent').removeClass('tabcontent_hide');
		$(this).parent().addClass('selected'); 
    		$('#applicationtab .mega_drop_container').removeClass('nobackground');  
		$('.application_mega_drop_width').removeClass('mega_drop_width_notabcotnent'); 
		var currentTab = $(this).attr('rel'); 
		$('ul#topnav  .applicationcontent ul').hide();
		$(currentTab).show();
    			$('ul#topnav .applicationcontent li ul').show();
		return false;

        }, // function = onMouseOver callback (REQUIRED)
        out: function () {
        	$('ul#topnav .applicationcontent li ul').show(); 
        } // function = onMouseOut callback (REQUIRED)
    }
    $jq144('ul#topnav .applicationitems li a').hoverIntent(appConfig)
});

 // notabcontent tab  
 
 $(function() {
    	appConfig1 = {
			sensitivity:1, // number = sensitivity threshold (must be 1 or higher)
			interval:25, // number = milliseconds for onMouseOver polling interval
			timeout:25, // number = milliseconds delay before onMouseOut
			over: function() {
			$('ul#topnav .applicationcontent ul').hide();
				$('ul#topnav .applicationitems li').removeClass('selected'); 
			$('ul#topnav .applicationcontent').addClass('tabcontent_hide'); 
			$(this).parent().addClass('selected'); 
				$('#applicationtab .mega_drop_container').addClass('nobackground'); 
			$('.application_mega_drop_width').addClass('mega_drop_width_notabcotnent'); 
				
			$('ul#topnav  .applicationcontent ul').hide();
			
			return false;
        }, // function = onMouseOver callback (REQUIRED)
        out: function () {
			$('ul#topnav .applicationcontent').addClass('tabcontent_hide'); 
			$('.application_mega_drop_width').addClass('mega_drop_width_notabcotnent'); 			
			$('#applicationtab .mega_drop_container').addClass('nobackground');  			
		} // function = onMouseOut callback (REQUIRED)
    }
    $jq144('ul#topnav .applicationitems  li.notabcontent a').hoverIntent(appConfig1)
});	

 
});
 
// Resources tab
$(document).ready(function(){
	$('ul#topnav .resourcesitems li:first').addClass('selected');	 
	
	$(function() {
    resourcesConfig = {
        sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)
        interval: 25, // number = milliseconds for onMouseOver polling interval
        timeout: 25, // number = milliseconds delay before onMouseOut
        over: function() {
         $('ul#topnav .resourcesitems li').removeClass('selected');
		$(this).parent().addClass('selected');  
		var currentTab = $(this).attr('rel');  
		$(currentTab).show();
		return false;
        }, // function = onMouseOver callback (REQUIRED)
        out: function () { } // function = onMouseOut callback (REQUIRED)
    }
    $jq144('ul#topnav .resourcesitems li a').hoverIntent(resourcesConfig)
  	});
		
 

// Sample tab 
	$('ul#topnav .sampleitems li:first').addClass('selected');	 
	
	$(function() {
    sampleConfig = {
        sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)
        interval: 25, // number = milliseconds for onMouseOver polling interval
        timeout: 25, // number = milliseconds delay before onMouseOut
        over: function() {
         $('ul#topnav .sampleitems li').removeClass('selected');
		$(this).parent().addClass('selected');  
		var currentTab = $(this).attr('rel');  
		$(currentTab).show();
		return false;
        }, // function = onMouseOver callback (REQUIRED)
        out: function () { } // function = onMouseOut callback (REQUIRED)
    }
    $jq144('ul#topnav .sampleitems li a').hoverIntent(sampleConfig)
});


	 

// supportitems tab 

$('ul#topnav .supportitems li:first').addClass('selected');	 

$(function() {
    supportConfig = {
        sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)
        interval: 25, // number = milliseconds for onMouseOver polling interval
        timeout: 25, // number = milliseconds delay before onMouseOut
        over: function() {
         $('ul#topnav .supportitems li').removeClass('selected');
		$(this).parent().addClass('selected');  
		var currentTab = $(this).attr('rel');  
		$(currentTab).show();
		return false;
        }, // function = onMouseOver callback (REQUIRED)
        out: function () { } // function = onMouseOut callback (REQUIRED)
    }
    $jq144('ul#topnav .supportitems li a').hoverIntent(supportConfig)
});
});
