﻿ $(document).ready(function() {
            // Top Menu
          
            $("ul.topmenu li a").mouseover(function() { //When trigger is clicked...
                //Following events are applied to the submenu itself (moving submenu up and down)
                $(this).parent().find("ul.submenu").slideDown({duration: 300}).show(); //Drop down the submenu on click
                $(this).parent().hover(function() {
                }, function() {
                    $(this).parent().find("ul.submenu").slideUp({duration: 100}); //When the mouse hovers out of the submenu, move it back up
			
					
                });
                //Following events are applied to the trigger (Hover events for the trigger)
            })
			
			//.hover(function() {
              //  $(this).addClass("hover"); //On hover over, add class "hover"
            //}, function() {	//On Hover Out
              //  $(this).removeClass("hover"); //On hover out, remove class "hover"
            //});

            $("ul.submenu li").hover(function() {
                $(this).find("ul.menu:first").show({duration: 300});
				$(this).addClass("sel"); //On hover over, add class "hover"
				$(this).parent('li').addClass("sel"); //On hover over, add class "hover"
				//$(this).parent().parent().addClass("sel"); //On hover over, add class "hover"
            }, function() {
                $(this).find("ul.menu:first").hide({duration: 100});
				$(this).removeClass("sel"); //On hover over, add class "hover"
				$(this).parent('li').removeClass("sel"); //On hover over, add class "hover"
				//$(this).parent().parent().removeClass("sel"); //On hover over, add class "hover"
	
            });
			
		
			
			 $("ul.submenu").hover(function() {
             
			
				$(this).parent('li').addClass("sel"); //On hover over, add class "hover"
				//$(this).parent().parent().addClass("sel"); //On hover over, add class "hover"
            }, function() {
              $(this).parent('li').removeClass("sel");
	
            });
			
			
        });
