<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Menu.ascx.cs" Inherits="Web.admin.Menu" %>
    <link rel="stylesheet" href="/kzcms/css/zTreeStyle/zTreeStyle.css" type="text/css" />
    <script type="text/javascript" src="/kzcms/js/jquery.ztree.all-3.5.min.js"></script>
    <div id="mleft">
        <div id="menu">
        

        </div>
        <div id="config">
            <ul class="b1t"><li><a href="javascript:;"><strong><span class="ico_9">内容管理</span></strong></a></li></ul>
            <ul class="b2t menu" style="<%=ShowContent%>"><li style="display:inline;"><div id="tree" class="ztree"></div></li></ul>
            <%=ModelList %>
        </div>
    </div>
  <SCRIPT type="text/javascript" >
  <!--
      var zTree;
      var demoIframe;

      var setting = {
          view: {
              dblClickExpand: false,
              showLine: true,
              selectedMulti: false
          },
          data: {
              simpleData: {
                  enable: true,
                  idKey: "id",
                  pIdKey: "pId",
                  rootPId: ""
              }
          },
          callback: {
              beforeClick: function (treeId, treeNode) {
                  var zTree = $.fn.zTree.getZTreeObj("tree");
                  if (treeNode.isParent) {
                      zTree.expandNode(treeNode);
                      return false;
                  } else {
                      demoIframe.attr("src", treeNode.file + ".html");
                      return true;
                  }
              }
          }
      };

      var zNodes = <%=ChannelList %>;

      $(document).ready(function () {
          var t = $("#tree");
          t = $.fn.zTree.init(t, setting, zNodes);
          demoIframe = $("#testIframe");
          demoIframe.bind("load", loadReady);
          var zTree = $.fn.zTree.getZTreeObj("tree");
          zTree.selectNode(zTree.getNodeByParam("id", <%=ChannelID %>));

      });

      function loadReady() {
          var bodyH = demoIframe.contents().find("body").get(0).scrollHeight,
		htmlH = demoIframe.contents().find("html").get(0).scrollHeight,
		maxH = Math.max(bodyH, htmlH), minH = Math.min(bodyH, htmlH),
		h = demoIframe.height() >= maxH ? minH : maxH;
          if (h < 530) h = 530;
          demoIframe.height(h);
      }

  //-->
  </SCRIPT>