<% Option Explicit %>
<!--#include file="../../Inc/Const.asp" -->
<!--#include file="../../Inc/Cls_DB.asp" -->
<%
Dim DBC,Conn
Set DBC = New DataBaseClass
Set Conn = DBC.OpenConnection()
Set DBC = Nothing
%>
<!--#include file="../../Inc/Session.asp" -->
<!--#include file="../../Inc/CheckPopedom.asp" -->
<%
if Not JudgePopedomTF(Session("Name"),"P0302") then Call ReturnError()
Dim TempClassListStr
	TempClassListStr = ClassList
Function ClassList()
	Dim Rs
	Set Rs = Conn.Execute("select ClassID,ClassCName,ClassEName from newsclass where ParentID = '0' and DelFlag=0 order by AddTime desc")
	do while Not Rs.Eof
		ClassList = ClassList & "<option value="&Rs("ClassEName")&"" & ">" & Rs("ClassCName") & chr(10) & chr(13)
		ClassList = ClassList & ChildClassList(Rs("ClassID"),"")
		Rs.MoveNext	
	loop
	Rs.Close
	Set Rs = Nothing
End Function
Function ChildClassList(ClassID,Temp)
	Dim TempRs,TempStr
	Set TempRs = Conn.Execute("Select ClassID,ClassCName,ChildNum,ClassEName from NewsClass where ParentID = '" & ClassID & "' and DelFlag=0 order by AddTime desc ")
	TempStr = Temp & " - "
	do while Not TempRs.Eof
		if TempRs("ChildNum") = 0 then
			ChildClassList = ChildClassList & "<option  value="&TempRs("ClassEName")&"" & ">" & TempStr & TempRs("ClassCName") & "</option>"& chr(10) & chr(13)
		else
			ChildClassList = ChildClassList & "<option value="&TempRs("ClassEName")&"" & ">" & TempStr & TempRs("ClassCName") & "</option>"& chr(10) & chr(13)
		end if
		ChildClassList = ChildClassList & ChildClassList(TempRs("ClassID"),TempStr)
		TempRs.MoveNext
	loop
	TempRs.Close
	Set TempRs = Nothing
End Function

%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>站点统计标签属性</title>
</head>
<link rel="stylesheet" href="../Inc/ModeWindow.css">
<script language="JavaScript" src="../JS/PublicJS.js"></script>
<body topmargin="0" leftmargin="0">
<div align="center">
  <table width="90%" border="0" cellspacing="0" cellpadding="0">
    <tr> 
      <td width="42%" height="30"> <div align="left">栏目名称 
          <select name="ClassList" id="ClassList" style="width:70%;">
            <option value="" selected>栏目选择</option>
            <% =TempClassListStr %>
          </select>
        </div></td>
      <td width="50%" height="30"><div align="left">排列方式 
          <select name="ShowMode" id="ShowMode" style="width:70%;">
            <option value="1" selected>横向</option>
            <option value="0">纵向</option>
          </select>
        </div></td>
    </tr>
    <tr> 
      <td height="30"><div align="left">新开窗口 
          <select name="OpenMode" id="OpenMode" style="width:70%;">
            <option value="1">是</option>
            <option value="0" selected>否</option>
          </select>
        </div></td>
      <td height="30"><div align="left">标题样式 
          <input type="text" style="width:70%;" name="CssFile" id="CssFile">
        </div></td>
    </tr>
    <tr> 
      <td height="30" colspan="2"><div align="center"> 
          <input type="button" onClick="InsertScript();" name="Submit" value=" 确 定 ">
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
          <input type="button" onClick="window.close();" name="Submit2" value=" 取 消 ">
        </div></td>
    </tr>
  </table>
</div>
</body>
</html>
<script language="JavaScript">
function InsertScript()
{
	var ClassListStr='';
	var ShowModeStr='';
	var OpenModeStr='';
	var CssFileStr='';
	ClassListStr=document.all.ClassList.value;
	ShowModeStr=document.all.ShowMode.value;
	OpenModeStr=document.all.OpenMode.value;
	CssFileStr=document.all.CssFile.value;
	window.returnValue='{%=SiteMap("'+ClassListStr+'","'+ShowModeStr+'","'+OpenModeStr+'","'+CssFileStr+'")%}';
	window.close();
}
window.onunload=SetReturnValue;
function SetReturnValue()
{
	if (typeof(window.returnValue)!='string') window.returnValue='';
}
</script>