<% 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"),"P099") then Call ReturnError1()
		Dim RsPlusObj,SpecialPicStr,TempObj,FileNum,TempShowNavi
		Set RsPlusObj = Conn.Execute("Select * from Plus order by ID desc")
		%>
		<html>
		<head>
		<link href="../../CSS/css.css" rel="stylesheet" type="text/css">
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
		<title>第三方插件列表</title>
		</head>
		<script src="../JS/PublicJS.js" language="JavaScript"></script>
		<body topmargin="0" leftmargin="0" oncontextmenu="SelectPlus();showMenu(MouseRightMenu);return false;"  ondragstart="return false;" onselectstart="return false;">
		<table id="MainTable" width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
		  <tr>
			<td valign="top"></td>
			<td valign="top">
		<table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#DFDFDF" onclick="SelectPlus();" id="MainTable">
        <tr> 
			<td width="28%" class="ButtonList"><div align="center">插件名称</div></td>
			<td width="34%" class="ButtonList"><div align="center">链接地址</div></td>
			<td width="9%" class="ButtonList"><div align="center">打开方式</div></td>
			<td width="10%" class="ButtonList"><div align="center">显示状态</div></td>
			<td width="19%" class="ButtonList"><div align="center">添加时间</div></td> 
		  </tr>
		  <%if RsPlusObj.eof then %>
		  <tr bgcolor="#FFFFFF"> 
			<td colspan="5" > <div align="center"><font color="#FF0000">暂时没有记录</font></div></td>
		  </tr>
		  <% end if
			do while Not RsPlusObj.Eof 
			Dim  OpenTypes,StateTypes 
			If RsPlusObj("OpenType")="1" then
				OpenTypes = "新窗口"
		    Else
				OpenTypes = "原窗口"
			End If
			If RsPlusObj("ShowTF")="1" then
			   StateTypes = "显示"
			Else
			   StateTypes = "隐藏"
			End If
		%>
		  <tr PlusID="<%=RsPlusObj("ID")%>" States="<%=RsPlusObj("ShowTF")%>" style="background:white;cursor:default;"> 
          <td height="25"><div align="left">&nbsp;&nbsp;&nbsp;<%=RsPlusObj("Name")%></div></td>
          <td height="20"><div align="center"><a href="PlusRedirect.asp?id=<%=RsPlusObj("id")%>" target="<%if RsPlusObj("OpenType")="1" then Response.Write("_New") else Response.Write("_self") end if%>">转入地址</a></div></td>
		  <td height="20"><div align="center"><%=OpenTypes%></div></td>
          <td height="20"><div align="center"><%=StateTypes%></div></td>
          <td height="20"><div align="center"><%=RsPlusObj("AddTime")%></div></td>
		  </tr>
		  <%
				RsPlusObj.MoveNext
			loop
			RsPlusObj.close
			set RsPlusObj=nothing
		%>
		</table></td></tr></table>
		<!-- 鼠标右键菜单 -->
		<div id=MouseRightMenu onclick="ClickMenu(this);" onmouseover="MouseOverRightMenu();" onmouseout="MouseOverRightMenu();" class="menu"> 
		  <div class="MouseRightItem" id="Add" ExeFunction="OpenWindow('PlusTip.asp?FileName=PlusAdd.asp&Titles=新建插件',300,170,window);">新建</div>
		  <div class="MouseRightItem" id="Edit" ExeFunction="OpenWindow('PlusTip.asp?FileName=PlusModify.asp&Titles=修改插件&PlusID='+PlusID,300,170,window);">修改</div>
		  <div class="MouseRightItem" id="Del" ExeFunction="OpenWindow('PlusTip.asp?FileName=PlusDell.asp&Titles=删除插件&PlusID='+PlusID,220,105,window);">删除</div>
		  <hr id="HR1">
		  <div class="MouseRightItem" id="Shows" ExeFunction="OpenWindow('PlusTip.asp?FileName=PlusDell.asp&Titles=插件管理&Types=Shows&PlusID='+PlusID,220,105,window);">显示</div>
		  <div class="MouseRightItem" id="Hide" ExeFunction="OpenWindow('PlusTip.asp?FileName=PlusDell.asp&Titles=插件管理&Types=Hide&PlusID='+PlusID,220,105,window);">隐藏</div>
		  <hr id="HR3">
		  <div class="MouseRightItem" id="Refresh" ExeFunction="window.location.reload();">刷新</div>
		   <hr id="HR4">
		  <div class="MouseRightItem" id="Pros" ExeFunction="javascript:window.prompt('本页面路径属性' , '<%=Request.ServerVariables("SCRIPT_NAME")%>');">路径属性</div>
		</div>
		</body>
		</html>
		<%
		Set Conn = Nothing
		%>
		<script>
		var DisableOrActiveMenuArrayNo=new Array();
		DisableOrActiveMenuArrayNo[0]=Edit;
		DisableOrActiveMenuArrayNo[1]=Del;
		DisableOrActiveMenuArrayNo[2]=Shows;
		DisableOrActiveMenuArrayNo[3]=Hide;
		DisableMenu(DisableOrActiveMenuArrayNo);
		
		function SelectPlus()
		{
			var i=0,j=0;
			var EventObj=event.srcElement;
			var TRObj;
			switch (EventObj.tagName.toLowerCase())
			{
				case 'div':
					TRObj=EventObj.parentElement.parentElement;
					break;
				case 'td':
					TRObj=EventObj.parentElement;
					break;
				case 'tr':
					TRObj=EventObj;
					break;
				default:
					return;
			}
			for (j=0;j<document.all.length;j++)
			{
				if (document.all(j).style.backgroundColor=='highlight')
				{
					document.all(j).style.backgroundColor='';
					for (i=0;i<document.all(j).children.length;i++) document.all(j).children(i).style.color='black';
				}
			}
			if (TRObj.PlusID!=null) PlusID=TRObj.PlusID;
			else PlusID='';
			if (PlusID!='')
			{
				TRObj.style.backgroundColor='highlight';
				if (TRObj.States=='0')
				{
					 Shows.className='MouseRightItem';
					 Hide.className='MenuItemDisable';
				 }
				 else if (TRObj.States=='1')
				 {
					 Shows.className='MenuItemDisable';
					 Hide.className='MouseRightItem';
				 }
				 else
				 {
					 Shows.className='MenuItemDisable';
					 Hide.className='MenuItemDisable';
				  }
				Edit.className='MouseRightItem';
				Del.className='MouseRightItem';
				for (i=0;i<TRObj.children.length;i++) TRObj.children(i).style.color='white';
			}
			else
			{
				PlusID='';
				Edit.className='MenuItemDisable';
				Del.className='MenuItemDisable';
				 Shows.className='MenuItemDisable';
				 Hide.className='MenuItemDisable';
			}
		}
		</script>
