﻿(function ($) {
    $.fn.ismenu = function (options) {

        options = $.extend({
            openOn: 'mouseenter',
            closeOn: 'mouseleave',
            transIn: 'slide',
            transOut: 'slide',
            speed: 150
        }, options);

        $(this).each(function () {
            $(this).children('li').each(function () {
                var li = $(this);
                var ul = li.children('ul').first();
                if (ul != undefined) {
                    li.bind(options.openOn, function () {
                        ul.slideDown(options.speed);
                    });
                    li.bind(options.closeOn, function () {
                        ul.slideUp(options.speed);
                    });
                }
            });
        });

        return this;
    };
})(jQuery)
