<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Categorys.aspx.cs" Inherits="TotCms.Web.Admin.Categorys" %>

<%@ Register src="UI/main_top.ascx" tagname="main_top" tagprefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>栏目管理</title>
<link href="style/global.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/xmlhttp.js"></script>
<script type="text/javascript" src="js/tree_view.js"></script>
<script type="text/javascript">
function SearchCatalog(){
    var s=document.form1.Key.value;
    if(s!=""){
        rootCell.parentNode.parentNode.parentNode.parentNode.removeChild(rootCell.parentNode.parentNode.parentNode);
        iconMap.length=0;
        iconList.length=0;    
        s=encodeURI(s);
        var xmlhttp;	 
	    xmlhttp=getXMLRequester();		
	    Initialise();
        d=CreateTreeItem( rootCell, "images/tree/project.gif", "images/tree/project.gif",0,"ROOT", null, null,2);    	
	    if(xmlhttp){	
		    xmlhttp.onreadystatechange = function doAction() {		
        	    if (xmlhttp.readyState == 4)
			    {			
				    /*alert(xmlhttp.responseText);*/				
				    var response = xmlhttp.responseXML.documentElement;
				    var classidList = response.getElementsByTagName('category');				
				    for(var i=0;i<classidList.length;i++){
					    xx=classidList[i].getElementsByTagName('id');
					    yy=classidList[i].getElementsByTagName('title');
					    classid=xx[0].firstChild.data
					    classtitle=yy[0].firstChild.data				
					    CreateTreeItem(d,"images/tree/folder_closed.gif", "images/tree/folder_open.gif",classid, classtitle, "Category_Edit.aspx?id="+classid,"_self",1);
				    }
        	    }
		    };
		    var ReturnValue=xmlhttp.open("get", "Category_GetSearch.aspx?key="+s,true);
		    xmlhttp.send("");
	    }
	}
}
function addChild(pdiv,classid,classtitle){
CreateTreeItem( pdiv,"images/tree/folder_closed.gif","images/tree/folder_open.gif",classid,classtitle,"Category_Edit.aspx?id="+classid,"_self",1);
}
function ConfirmDel()
{
if(confirm('确定删除吗？'))
 return true;
else
 return false;	 
}
</script>
</head>
<body onLoad="CreateProjectExplorer()">
    <form id="form1" runat="server">
    <div>
    
      <uc1:main_top ID="main_top1" runat="server" />
    
    </div>
    <table cellpadding="0" cellspacing="1" border="0" width="100%">
      <tr>
        <td class="topic">栏目分类管理</td>
      </tr> 
      <tr>
        <td height="25" style="padding:0px 8px;">
          <div class="notice">
            提示：<img alt="显示子栏目" src="images/tree/plus.gif" 
                  style="width: 16px; height: 16px" /> 显示子栏目&nbsp;
            <img alt="添加栏目" src="images/icon/add.gif" style="width: 14px; height: 14px" /> 
            添加栏目 
            <img alt="删除栏目" src="images/icon/del.gif" style="width: 15px; height: 15px" /> 
            删除栏目 
            <img alt="查看栏目" src="images/icon/file.gif" style="width: 16px; height: 16px" /> 
            查看栏目
           
              <input id="Key" name="Key" type="text" onkeyup="SearchCatalog()" /><input id="Button1" type="button" 
                  value="搜索" onclick="SearchCatalog()" /></div>
          </td>
      </tr>  
      <tr>
        <td>
          <div id="DivJs" runat="server"></div>
        </td>
      </tr>
    </table>
    </form>
</body>
</html>
