<script language="javascript" type="text/javascript">
    $(function () {
        $.ajax({
            type: "GET",
            url: "/Manage/User/GetUserTree",
            success: function (data) {
                $(".accordion").hide();
                var TagHeadTemplate = '<div class="accordionHeader"><h2><span>Folder</span>$F_Name</h2></div><div class="accordionContent"><ul class="tree treeFolder">';
                var TagDownTemplate = '</ul></div>';

                var ModuleHeadTemplate = '<li><a href="tabsPage.html" target="navTab">$F_Name</a><ul>';
                var ModuleDownTemplate = '</ul></li>';

                var FunctionTemplate = '<li><a href="$F_Url" target="navTab" rel="main" fresh="false">$F_Name</a></li>';

                var Info = '';

                for (var i = 0; i < data.length; i++) {
                    Info += TagHeadTemplate.replace('$F_Name', data[i].Name);
                    for (var j = 0; j < data[i].Modules.length; j++) {
                        Info += ModuleHeadTemplate.replace('$F_Name', data[i].Modules[j].Name);
                        for (var k = 0; k < data[i].Modules[j].Functions.length; k++) {
                            Info += FunctionTemplate.replace('$F_Name', data[i].Modules[j].Functions[k].Name).replace('$F_Url', data[i].Modules[j].Functions[k].Url);
                        }
                        Info += ModuleDownTemplate;
                    }
                    Info += TagDownTemplate;
                }
                $(".accordion").html($(".accordion").html() + Info);
                $(".accordion").show();
                //setTimeout($(".accordion").show(), 1000);
            }
        });
    });
</script>
<div id="leftside">
    <div id="sidebar_s">
        <div class="collapse">
            <div class="toggleCollapse">
                <div>
                </div>
            </div>
        </div>
    </div>
    <div id="sidebar">
        <div class="toggleCollapse">
            <h2>
                主菜单
            </h2>
            <div>
                收缩
            </div>
        </div>
        <div class="accordion" fillspace="sidebar">
            <div class="accordionHeader">
                <h2>
                    <span>Folder</span>界面组件
                </h2>
            </div>
            <div class="accordionContent">
                <ul class="tree treeFolder">
                    <li>
                        <a href="tabsPage.html" target="navTab">主框架面板</a>
                        <ul>
                            <li><a href="main.html" target="navTab" rel="main">我的主页</a></li>
                            <li><a href="http://www.baidu.com" target="navTab" rel="page1">页面一(外部页面)</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>
