$(document).ready(function() {
    $("#navigation li ul").hide();

    $("#navigation li").hover(
        function () {
        $(this).children("ul").show();
        },function(){
        $(this).children("ul").hide();
    });//hover

});// document ready 

// add this under the show
$(this).addClass('hoverstate');
   
// add this under the hide 
$(this).removeClass('hoverstate');

