<% 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 StyleSql,RsStyleObj
StyleSql = "Select * from DownListStyle"
Set RsStyleObj = Conn.Execute(StyleSql)
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>下载列表样式列表</title>
</head>
<link href="../../CSS/css.css" rel="stylesheet">
<script src="../JS/PublicJS.js" language="JavaScript"></script>
<body topmargin="0" leftmargin="0" ondragstart="return false;" onselectstart="return false;" oncontextmenu="ClickStyle(document.all('MainTable'));showMenu(MouseRightMenu);return false;">
<table onClick="ClickStyle(this);" width="100%" border="0" cellspacing="0" cellpadding="0" id="MainTable">
  <tr> 
    <td height="20" class="ButtonList"> <div align="center">编号</div></td>
    <td height="20" class="ButtonList"> <div align="center">名称</div></td>
  </tr>
  <%
do while Not RsStyleObj.Eof
%>
  <tr class="TempletItem" StyleID="<% = RsStyleObj("ID") %>"> 
    <td height="20"> <div align="center"> 
        <% = RsStyleObj("ID") %>
      </div></td>
    <td height="20"> <div align="center"> 
        <% = RsStyleObj("Name") %>
      </div></td>
  </tr>
  <%
	RsStyleObj.MoveNext
loop
%>
</table>
</body>
</html>
<!-- 鼠标右键菜单 -->
<div id=MouseRightMenu onclick="ClickMenu(this);" onmouseover="MouseOverRightMenu();" onmouseout="MouseOverRightMenu();" class="menu"> 
  <div class="MouseRightItem" id="Add" ExeFunction="OpenWindow('Templet_DownStyleFrame.asp?FileName=Templet_DownStyleAdd.asp&Titles=添加下载列表样式',420,320,window);">新建</div>
  <div class="MouseRightItem" id="Edit" ExeFunction="EditStyle();">修改</div>
  <div class="MouseRightItem" id="Del" ExeFunction="DelStyle();">删除</div>
  <hr id="HR1">
  <div class="MouseRightItem" id="Browser" ExeFunction="BrowStyle();">查看</div>
  <div class="MouseRightItem" id="Refresh" ExeFunction="window.location.reload();">刷新</div>
</div>
<%
Set RsStyleObj = Nothing
Set Conn = Nothing
%>
<script language="JavaScript">
var StyleID='';
Browser.className='MenuItemDisable';
Edit.className='MenuItemDisable';
Del.className='MenuItemDisable';
function ClickStyle(Obj)
{
	var el=event.srcElement;
	var TRObj=null;
	switch (el.tagName.toLowerCase())
	{
		case 'div':
			TRObj=el.parentElement.parentElement;
			break;
		case 'td':
			TRObj=el.parentElement;
			break;
		case 'tr':
			TRObj=el;
			break;
		default :
			return;
	}
	if (TRObj.StyleID!=null)
	{
		for (j=0;j<Obj.all.length;j++)
		{
			if (Obj.all(j).style.backgroundColor=='highlight')
			{
				Obj.all(j).style.backgroundColor='';
				for (i=0;i<Obj.all(j).children.length;i++) Obj.all(j).children(i).style.color='black';
			}
		}
		TRObj.style.backgroundColor='highlight';
		for (i=0;i<TRObj.children.length;i++) TRObj.children(i).style.color='white';
		StyleID=TRObj.StyleID;
		Browser.className='MouseRightItem';
		Edit.className='MouseRightItem';
		Del.className='MouseRightItem';
	}
	else
	{
		StyleID='';
		Browser.className='MenuItemDisable';
		Edit.className='MenuItemDisable';
		Del.className='MenuItemDisable';
	}
}
function EditStyle()
{
	if (StyleID!='')
	{
		OpenWindow('Templet_DownStyleFrame.asp?FileName=Templet_DownStyleAdd.asp&Titles=修改下载列表样式&ID='+StyleID,420,320,window);
	}
}
function DelStyle()
{
	if (StyleID!='')
	{
		OpenWindow('Templet_DownStyleFrame.asp?FileName=Templet_DownStyleDel.asp&Titles=删除下载列表样式&ID='+StyleID,200,120,window);
	}
}
function BrowStyle()
{
	if (StyleID!='')
	{
		OpenWindow('Templet_DownStyleBrowFrame.asp?FileName=Templet_DownStyleBrow.asp&ID='+StyleID,360,190,window);
	}
}
</script>