jQuery['fn']['mikeMenu'] = function (_0xcbd7x1) {
    $('.dropcontent')['css']('left', 'auto')['hide']();
    $('.fullwidth')['css']('left', '-1px')['hide']();
    
		switch (_0xcbd7x1) {
   
	 
    case 'click_slide':
        $('li')['click'](function () {
            var _0xcbd7x2 = $(this);
            _0xcbd7x2['children']()['slideDown']('fast')['show']();
            _0xcbd7x2['hover'](function () {}, function () {
                _0xcbd7x2['children']('div')['slideUp']('slow');
            });
        });
        break;;
        
    case 'click_toggle':
        $('li')['click'](function () {
            var _0xcbd7x2 = $(this);
            _0xcbd7x2['children']('div')['toggle']('fast')['show']();
            _0xcbd7x2['hover'](function () {}, function () {
                _0xcbd7x2['children']('div')['hide']('slow');
            });
        });
        break;;
        
    case 'click_open_close':
        $('li')['click'](function () {
            var _0xcbd7x2 = $(this);
            _0xcbd7x2['toggleClass']('active');
            _0xcbd7x2['siblings']()['removeClass']('active');
            $('.dropcontent, .fullwidth')['fadeOut'](200, 0);
            $(this)['children']()['fadeTo'](200, 1);
        });
        break;;
  
        
        
    };
};






/*  now keep the position */

(function ($) {

    $.fn.superMike = function (options) {

        var options = $.extend({}, $.fn.superMike.defaults, options);

        return this.each(function () {
            $(window).bind("scroll.superMike", { selected: $(this), options: options }, Scroll);
        });

    };

    function Scroll(event) {
        var node = event.data.selected;
        var o = event.data.options;

        if ($(document).scrollTop() > node.offset().top) {

            var top = 0;
            if (o.topPadding != "undefined") {
                top = top + o.topPadding;
            }

            node.data("PanelsTop", node.offset().top - top);

            if (o.afterDetachCSSClass != "") {
                node.addClass(o.afterDetachCSSClass);
            }

            if (o.savePanelSpace == true) {
                var width = node.outerWidth(true);
                var height = node.outerHeight(true);
                var float = node.css("float");
                var randomNum = Math.ceil(Math.random() * 9999); /* Pick random number between 1 and 9999 */
                node.data("PanelSpaceID", "superMikeSpace" + randomNum);
                node.before("<div id='" + node.data("PanelSpaceID") + "' style='width:" + width + "px;height:" + height + "px;float:" + float + ";'></div>");
            }

            // detach panel
            node.css({
                "top": top,
                "position": "fixed"
            });

        }

        if ($(document).scrollTop() <= node.data("PanelsTop")) {

			if (o.savePanelSpace == true) {
				$("#" + node.data("PanelSpaceID")).remove();
			}
			
            // attach panel
            node.css({
                "top": "auto",
                "position": "static"
            });

            if (o.afterDetachCSSClass != "") {
                node.removeClass(o.afterDetachCSSClass);
            }
        }

    };

    $.fn.superMike.defaults = {
        topPadding: 0,
        // Use this to set the top margin of the detached panel.

        afterDetachCSSClass: "",
        // This class is applied when the panel detaches.

        savePanelSpace: false
        // When set to true the space where the panel was is kept open.
    };

})(jQuery);


