﻿//     $('li.menuSupplier:has(ul)')

$(function () {
    $('li.menuSupplier')
        .click(function (event) {
            if (this == event.target) {
                $(this).children().slideToggle('fast');
                $.get('/Menu/ToggleMenuItem/' + $(this).attr('id'));
                return false;
            }
            return true;
        })
        .css('cursor', 'pointer')
        .children().hide()
    //.click()
    ;
    var menuState = $.cookie('openMenuItems');
    if (menuState != null && menuState.length > 0) {
        var openMenus = menuState.split("|");
        for (var i = openMenus.length - 1; i >= 0; --i) {
            $('li.menuSupplier#' + openMenus[i])
                .children()
                .show();
        }
    }
});

