﻿//$(document).ready(function() {
//    var hzga_menu_cookie = $.cookie('hzga_web_menu');
//    if (hzga_menu_cookie == 'true') {
//        $('#btn_Lock').attr('style', '');
//        $('#btn_Lock').css('background', 'url(/pic/master/unlock.gif)');
//        $('#parent_menu').stop().css('height', '100px');
//        $('#parent_menu').unbind();
//    }
//    else {
//        $('#parent_menu').stop().css('height', '30px');
//    }
//});

//$(function() {
//    $('#btn_Lock').bind('click', function() {
//        var hzga_web_menu = $.cookie('hzga_web_menu');
//        if (hzga_web_menu == 'true') {
//            $.cookie('hzga_web_menu', null);
//            $('#btn_Lock').attr('style', '');
//            $('#btn_Lock').css('background', 'url(/pic/master/lockup.gif)');
//            $('#parent_menu').stop().animate({ height: '30px' }, "slow");
//        }
//        else {
//            $.cookie('hzga_web_menu', 'true');
//            $('#btn_Lock').attr('style', '');
//            $('#btn_Lock').css('background', 'url(/pic/master/unlock.gif)');
//            $('#parent_menu').stop().animate({ height: '100px' }, "slow");
//        }
//    });

//    $('#parent_menu').bind('mouseover', function() {
//        var hzga_web_menu = $.cookie('hzga_web_menu');
//        if (hzga_web_menu != 'true') {
//            $(this).stop().animate({ height: '100px' }, "slow");

//        }
//    });

//    $('#parent_menu').bind('mouseout', function() {
//        var hzga_web_menu = $.cookie('hzga_web_menu');
//        if (hzga_web_menu != 'true') {
//            $(this).stop().animate({ height: '30px' }, "slow");
//        }
//    });
//    $('#parent_menu ul li').hover(function() {
//        $(this).find('span').css('background', '#F1F1F1');
//    }, function() {
//        $(this).find('span').attr('style', '');
//    });
//});
var mouseover_tid = []; 
var mouseout_tid = [];

$(function() {
    $('#parent_menu li').each(function(index) {
        $(this).hover(
        function() {
            var _self = this;
            clearTimeout(mouseout_tid[index]);
            mouseover_tid[index] = setTimeout(function() {
                $(_self).find('span').slideDown(200);
            }, 200);
        },
        function() {
            var _self = this;
            clearTimeout(mouseover_tid[index]);
            mouseout_tid[index] = setTimeout(function() {
                $(_self).find('span').slideUp(200);
            }, 200);
        });
    });
});
