jQuery(document).ready(function(){
        jQuery("#menu ul.topnav li a").hover(function() { //When trigger is hovered...

                //Following events are applied to the subnav itself (moving subnav up and down)
                jQuery(this).parent().find("ul.children").stop(true).show(); //Drop down the subnav on click

                jQuery(this).parent().hover(function() {
                }, function(){
                        jQuery(this).parent().find("ul.children").stop(true).hide(); //When the mouse hovers out of the subnav, move it back up
                });

		jQuery(this).addClass("subhover");

        //Following events are applied to the trigger (Hover events for the trigger)
        }, function(){  //On Hover Out
                jQuery(this).removeClass("subhover"); //On hover out, remove class "subhover"
        });
});

