(function(a){
    a.fn.webwidget_vertical_menu=function(p){
        var p=p||{};
        var l=p&&p.menu_width?p.menu_width:"178px";
        var m=p&&p.directory?p.directory:"/shell";
        var w=a(this);
        if(w.children("ul").length==0||w.find("li").length==0){
            dom.append("Require menu content");
            return null
        }
        init();
        function init(){
            w.find("li").css("width",l);
            w.find("li:has(ul)").addClass("webwidget_vertical_menu_down_drop");
            w.find("li:has(ul)").css("background-image","url("+m+"/down_drop_icon.png)");
            w.children("ul").children("li").find("ul").css("left",l).css("top","0px");
        }
        w.find("li").hover(function(){
            var my_l = $(this).position().left + $(this).outerWidth() - 1 + 'px';
            $(this).children("ul").css("left", my_l);
            $(this).children("ul").show()
            },function(){
            $(this).children("ul").hide()
            });
        function s_u_t(a){
            l_t_b_s=a.outerHeight(true)-a.css("border-top-width").replace("px","")*2+"px";
            a.children("ul").css("top",l_t_b_s);
            a.children("ul").css("left","-"+a.css("border-top-width"));
            li_hieght = w.children("ul").children("li").outerHeight(true);
            a.children("ul").find("a").css("line-height",li_hieght+"px");
            }
        function s_sub_l(a,b){
            boder_width=b.replace("px","");
            a.css("left",a.parent("li").parent("ul").outerWidth(true)-boder_width*2);
            a.css("top","-"+b)
            }
        }
})(jQuery);
