﻿var t, id;
$(document).ready(function() {
    var i = 0;
    $("#menu > li").each(function() {
        if ($(this).children("ul").length) {
            $(this).attr("id", "m" + i);
            $(this).addClass("script");
            $(this).hover(
                function() {
                    id = this.id;
                    t = setTimeout("showSubMenu()", 250);
                },
                function() {
                    clearTimeout(t);
                    $("#" + this.id + " ul").slideUp(250);
                }
            );
        }
        i++;
    });
    /*$('ul.hover-enabled li').hover(
	    function() { $(this).addClass('hover'); },
	    function() { $(this).removeClass('hover'); }
	);*/

});
function showSubMenu() {
    $("#" + id + " ul").slideDown(250);
}
