$(document).ready(function() {
	$('#searchtoggle, #nav_home, #nav_solutions, #nav_company, #nav_support, #nav_news, #nav_contact, #nav_local').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(500, 1);
	  }, function () {
	    $span.stop().fadeTo(500, 0);
	  });
	});
});

$(document).ready(
		function()
		{
			$("ul.topnav li div").hover(
				function() 
				{ //When trigger is clicked...
		
					//Following events are applied to the subnav itself (moving subnav up and down)
					$(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click

					$(this).parent().hover(
						function(){}, //on hover over do nothing
						function()
						{	
							$(this).parent().find("ul.subnav").slideUp('fast'); //When the mouse hovers out of the subnav, move it back up
							$(this).parent().find("ul.subnav2").slideUp('fast');
							$(this).parent().find("ul.subnav3").slideUp('fast');
						}
					);
					//Following events are applied to the trigger (Hover events for the trigger)
				},
				function(){}
			).hover(
				function() 
				{ 
					$(this).addClass("subhover"); //On hover over, add class "subhover"
				}, 
				function()
				{	//On Hover Out
					$(this).removeClass("subhover"); //On hover out, remove class "subhover"
				}
			);
			$("ul.subnav li div").hover(
				function() 
				{ //When trigger is clicked...
		
					//Following events are applied to the subnav itself (moving subnav up and down)
					$(this).parent().find("ul.subnav2").slideDown('fast').show(); //Drop down the subnav on click
				},
				function(){}
			);
			$("ul.subnav2 li div").hover(
				function() 
				{ //When trigger is clicked...
		
					//Following events are applied to the subnav itself (moving subnav up and down)
					$(this).parent().find("ul.subnav3").slideDown('fast').show(); //Drop down the subnav on click
				},
				function(){}
			);
		}
);
