var hoverRegister = new Array();
 
        $(document).ready(function () {
            $('#frontMenuTd1').hover(
                function () 
                { 
                    showSubMenu(1);  
                },
                function () 
                { 
                    hoverRegister[1] = 0;
                    setTimeout ( "checkHideSubMenu(1)", 800 );
                }
            );
        });
        
        $(document).ready(function () {
            $('#frontMenuTd2').hover(
                function () 
                { 
                    showSubMenu(2);  
                },
                function () 
                { 
                    hoverRegister[2] = 0;
                    setTimeout ( "checkHideSubMenu(2)", 800 );
                }
            );
        });
        
        $(document).ready(function () {
            $('#frontMenuTd3').hover(
                function () 
                { 
                    showSubMenu(3);  
                },
                function () 
                { 
                    hoverRegister[3] = 0;
                    setTimeout ( "checkHideSubMenu(3)", 800 );
                }
            );
        });
        
        $(document).ready(function () {
            $('#frontMenuTd4').hover(
                function () 
                { 
                    showSubMenu(4);  
                },
                function () 
                { 
                    hoverRegister[4] = 0;
                    setTimeout ( "checkHideSubMenu(4)", 800 );
                }
            );
        });
        
        function checkHideSubMenu(id)
        {
            if (hoverRegister[id] == 0)
               hideSubMenu(id); 
        }
        
        function showSubMenu(id)
        {
            $("#subMenu"+id).hide();
            
            hoverRegister[id] = 1;
            
            $("#subMenuActive"+id).slideDown(400, function(){});

        } 
        
        function hideSubMenu(id)
        {
            hoverRegister[id] = 0;
            $("#subMenuActive"+id).slideUp(400, function(){ 
                if (hoverRegister[id] != 1)
                    $("#subMenu"+id).show();    
            });

        }
