<!--
whilvydy 新闻发布系统
-->

<%@ page contentType="text/html; charset=GB2312" language="java" import="java.sql.*" errorPage="" %>
<%@ include file = "func/parameter.jsp" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %> 
<%@ page import="java.util.*" %>

<jsp:useBean id="left_man" scope="page" class="net.jspcn.db.DbConnect" />


<%
int user_power = Integer.parseInt((String) session.getValue("user_power"));
if (user_power<1)
response.sendRedirect("login.jsp");
%>

<html>
<head>
<title><%=webtitle%></title>

 <script LANGUAGE="JavaScript" type="text/javascript">
   <!--
  // These scripts were originally found on cooltype.com.
  // Modified 01/01/1999 by Tobias Ratschiller for linuxapps.com

  // Modified 7th June 2000 by Brian Birtles for Mozilla 5.0
  // compatibility for phpMyAdmin

  document.onmouseover = doDocumentOnMouseOver ;
  document.onmouseout = doDocumentOnMouseOut ;

  function doDocumentOnMouseOver() {
    var eSrc = window.event.srcElement ;
    if (eSrc.className == "item") {
      window.event.srcElement.className = "highlight";
    }
  }

  function doDocumentOnMouseOut() {
    var eSrc = window.event.srcElement ;
    if (eSrc.className == "highlight") {
      window.event.srcElement.className = "item";
    }
  }


var bV=parseInt(navigator.appVersion);
NS4=(document.layers) ? true : false;
IE4=((document.all)&&(bV>=4)) ? true : false;
DOM=(!document.layers && !document.all && bV>=4) ? true : false; // A hack to guess if the browser supports the DOM
capable = (NS4 || IE4 || DOM) ? true : false;

function expandIt(){return}
function expandAll(){return}
//-->
</script>

<script language="JavaScript1.2" type="text/javascript">
<!--
isExpanded = false;

function getIndex(el) {
  ind = null;
  for (i=0; i<document.layers.length; i++) {
    whichEl = document.layers[i];
    if (whichEl.id == el) {
      ind = i;
      break;
    }
  }
  return ind;
}

function arrange() {
  nextY = document.layers[firstInd].pageY + document.layers[firstInd].document.height;
  for (i=firstInd+1; i<document.layers.length; i++) {
    whichEl = document.layers[i];
    if (whichEl.visibility != "hide") {
      whichEl.pageY = nextY;
      nextY += whichEl.document.height;
    }
  }
}

function initIt(){
  if (NS4) {
    for (i=0; i<document.layers.length; i++) {
      whichEl = document.layers[i];
      if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide";
    }
    arrange();
  } else if(IE4) {
    tempColl = document.all.tags("DIV");
    for (i=0; i<tempColl.length; i++) {
      if (tempColl(i).className == "child") tempColl(i).style.display = "none";
    }
  } else if(DOM) {
    tempColl = document.getElementsByTagName("DIV");
    for (i=0; i<tempColl.length; i++) {
      if (tempColl(i).className == "child") tempColl(i).style.visibility = "hidden";
    }
  }
}

function expandIt(el) {
  if (!capable) return;
  if (IE4) {
    expandIE(el);
  } else if(NS4) {
    expandNS(el);
  } else if(DOM) {
    expandDOM(el);
  }
}

function expandIE(el) {
  whichEl = eval(el + "Child");

        // Modified Tobias Ratschiller 01-01-99:
        // event.srcElement obviously only works when clicking directly
        // on the image. Changed that to use the images's ID instead (so
        // you've to provide a valid ID!).

  //whichIm = event.srcElement;
        whichIm = eval(el+"Img");

  if (whichEl.style.display == "none") {
    whichEl.style.display = "block";
    whichIm.src = "images/minus.gif";
  }
  else {
    whichEl.style.display = "none";
    whichIm.src = "images/plus.gif";
  }
    window.event.cancelBubble = true ;
}

function expandNS(el) {
  whichEl = eval("document." + el + "Child");
  whichIm = eval("document." + el + "Parent.document.images['imEx']");
  if (whichEl.visibility == "hide") {
    whichEl.visibility = "show";
    whichIm.src = "images/minus.gif";
  }
  else {
    whichEl.visibility = "hide";
    whichIm.src = "images/plus.gif";
  }
  arrange();
}

function expandDOM(el) {

  whichEl = document.getElementById(el + "Child");
    whichIm = document.getElementById(el + "Img");

  if (whichEl.style.visibility != "visible") {
    whichEl.style.visibility = "visible";
    whichIm.src = "images/minus.gif";
  } else {
    whichEl.style.visibility = "hidden";
    whichIm.src = "images/plus.gif";
  }

}

function showAll() {
  for (i=firstInd; i<document.layers.length; i++) {
    whichEl = document.layers[i];
    whichEl.visibility = "show";
  }
}

function expandAll(isBot) {
  // Brian Birtles 7-Jun-00 : This fn might be unnecessary (for phpMyAdmin).
  // My changes are certainly untested.
  newSrc = (isExpanded) ? "images/plus.gif" : "images/minus.gif";

  if (NS4) {
        // TR-02-01-99: Don't need that
        // document.images["imEx"].src = newSrc;
    for (i=firstInd; i<document.layers.length; i++) {
      whichEl = document.layers[i];
      if (whichEl.id.indexOf("Parent") != -1) {
        whichEl.document.images["imEx"].src = newSrc;
      }
      if (whichEl.id.indexOf("Child") != -1) {
        whichEl.visibility = (isExpanded) ? "hide" : "show";
      }
    }

    arrange();
   if (isBot && isExpanded) scrollTo(0,document.layers[firstInd].pageY);
  } else if(IE4) {
    divColl = document.all.tags("DIV");
    for (i=0; i<divColl.length; i++) {
      if (divColl(i).className == "child") {
        divColl(i).style.display = (isExpanded) ? "none" : "block";
      }
    }
    imColl = document.images.item("imEx");
    for (i=0; i<imColl.length; i++) {
      imColl(i).src = newSrc;
    }
  } else if(DOM) {
    divColl = document.getElementsByTagName("DIV");
    for (i=0; i<divColl.length; i++) {
      if (divColl(i).className == "child") {
        divColl(i).style.visibility = (isExpanded) ? "hidden" : "visible";
      }
    }
    imColl = document.getElementsByName("imEx");
    for (i=0; i<imColl.length; i++) {
      imColl(i).src = newSrc;
    }
  }

  isExpanded = !isExpanded;
}

with (document) {
  if(DOM) {
    // Brian Birtles : This is not the ideal method of doing this
    // but under the 7th June '00 Mozilla build (and many before
    // it) Mozilla did not treat text between <style> tags as
    // style information unless it was written with the one call
    // to write().
    var lstyle = "<style type='text/css'>";
    lstyle += ".child {font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000; text-decoration:none; visibility:hidden}";
    lstyle += ".parent {font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000; text-decoration:none;}";
    lstyle += ".item { color: darkblue; text-decoration:none; font-size: 8pt;}";
    lstyle += ".highlight { color: red; font-size: 8pt;}";
    lstyle += ".heada { font: 12px/13px; Times}";
    lstyle += "DIV { color:black; }";
    lstyle += "</style>";
    write(lstyle);
  } else {
    write("<style type='text/css'>");
    if (NS4) {
            write(".parent {font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000; text-decoration:none; position:absolute; visibility:hidden; color: black;}");
            write(".child {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt;color: #000000; position:absolute; visibility:hidden}");
            write(".item { color: darkblue; text-decoration:none;}");
            write(".regular {font-family: Arial,Helvetica,sans-serif; position:absolute; visibility:hidden}");
            write("DIV { color:black; }");
    } else if(IE4) {
            write(".child {font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000; text-decoration:none; display:none}");
            write(".parent {font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000; text-decoration:none;}");
            write(".item { color: darkblue; text-decoration:none; font-size: 8pt;}");
            write(".highlight { color: red; font-size: 8pt;}");
            write(".heada { font: 12px/13px; Times}");
            write("DIV { color:black; }");
    }
    write("</style>");
  }
}

onload = initIt;

//-->
</script>
<base target="mainFrame">
<style type="text/css">
//<!--
body {  font-family: Arial, Helvetica, sans-serif; font-size: 10pt}
//-->
</style>
<link rel="stylesheet" href="func/style.css" type="text/css">
</head>



<!-- ################################################################################### -->
<!-- ################################################################################### -->
<!-- ################################################################################### -->
<!-- ################################################################################### -->

<body>
 <DIV ID="el1Parent" CLASS="parent">
      <A class="item" target="mainFrame" HREF="main.jsp">
      主 目 录</A>
      </DIV>






<div ID="el0Parent" CLASS="parent">
      <a class="item" HREF="main.jsp" onClick="expandIt('el0'); return false;"><img NAME="imEx" SRC="images/plus.gif" BORDER="0" ALT="+" width="9" height="9" ID="el0Img"></a>
      <a class="item" HREF="main.jsp" onClick="expandIt('el0');">系统管理</a>
</div>      
	<div ID="el0Child" CLASS="child">
		<nobr>&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/browse.gif" border="0">&nbsp<a class="item" target="mainFrame" HREF="password_man.jsp">修改密码</a></nobr><br>
		
		<% if (user_power>=10000) { %>
      		<nobr>&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/browse.gif" border="0">&nbsp<a class="item" target="mainFrame" HREF="user_man.jsp">管理用户</a></nobr><br>
      		<nobr>&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/browse.gif" border="0">&nbsp<a class="item" target="mainFrame" HREF="type_man.jsp">版面管理</a></nobr><br>
      		<nobr>&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/browse.gif" border="0">&nbsp<a class="item" target="mainFrame" HREF="board_man.jsp">专栏管理</a></nobr><br>
      	 	<nobr>&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/browse.gif" border="0">&nbsp<a class="item" target="mainFrame" HREF="parameter.jsp">系统参数</a></nobr><br>
      	 	<nobr>&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/browse.gif" border="0">&nbsp<a class="item" target="mainFrame" HREF="log_man.jsp">日志管理</a></nobr><br>
      	 	<nobr>&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/browse.gif" border="0">&nbsp<a class="item" target="mainFrame" HREF="statistics.jsp">数据统计</a></nobr><br>
      		<nobr>&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/browse.gif" border="0">&nbsp<a class="item" target="mainFrame" HREF="sendmail.jsp">系统EMAIL</a></nobr><br>
      		<nobr>&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/browse.gif" border="0">&nbsp<a class="item" target="mainFrame" HREF="system_instruction.jsp">系统说明</a></nobr><br>
      	 	<% } else {
      	 	if (user_power>=9999) { %>
      		<nobr>&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/browse.gif" border="0">&nbsp<a class="item" target="mainFrame" HREF="type_man.jsp">版面管理</a></nobr><br>
      		<nobr>&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/browse.gif" border="0">&nbsp<a class="item" target="mainFrame" HREF="board_man.jsp">专栏管理</a></nobr><br>
      	 	<nobr>&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/browse.gif" border="0">&nbsp<a class="item" target="mainFrame" HREF="parameter.jsp">系统参数</a></nobr><br>
      	 	<nobr>&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/browse.gif" border="0">&nbsp<a class="item" target="mainFrame" HREF="statistics.jsp">数据统计</a></nobr><br>
      		<nobr>&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/browse.gif" border="0">&nbsp<a class="item" target="mainFrame" HREF="sendmail.jsp">系统EMAIL</a></nobr><br>
      		<nobr>&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/browse.gif" border="0">&nbsp<a class="item" target="mainFrame" HREF="system_instruction.jsp">系统说明</a></nobr><br>
		<% } else{ %>
      		<nobr>&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/browse.gif" border="0">&nbsp<a class="item" target="mainFrame" HREF="system_instruction.jsp">系统说明</a></nobr><br>
		<% } }  %>
		

        </div>

<%	
	left_man.openConnection();
	
	String sql,sql1;
	sql = "select * from "+type_table;
	//out.println(Integer.parseInt((String) session.getValue("user_power")));

	if (user_power<1000) 
	sql = "select * from "+type_table+" where type_id = " + Integer.toString(user_power);
	else if (Integer.parseInt((String) session.getValue("user_power"))<2000)
	sql = "select * from "+type_table+" where type_id = " + Integer.toString(user_power-1000);
	
	//out.println(sql);
	ResultSet rs,rs1;
	rs = left_man.executeQuery(sql);
	
	String type_name,board_name;
	int type_id,board_id;
	
	for(int i=3; rs.next(); i++)
	{
		type_name = rs.getString("type_name");
		type_id = rs.getInt("type_id");
%>


<!-- ################################################################################### -->
<!-- ################################################################################### -->


<div ID="el<%=i%>Parent" CLASS="parent">
      <a class="item" HREF="main.jsp" onClick="expandIt('el<%=i%>'); return false;"><img NAME="imEx" SRC="images/plus.gif" BORDER="0" ALT="+" width="9" height="9" ID="el<%=i%>Img"></a>
      <a class="item" HREF="main.jsp" onClick="expandIt('el<%=i%>');"><%=type_name%></a>
</div>

<!-- ################################################################################### -->
      <div ID="el<%=i%>Child" CLASS="child">
<%
	sql1 = "select * from "+board_table+" where type_id='"+type_id+"'";
	rs1 = left_man.executeQuery(sql1);
	
	for(int j=3; rs1.next(); j++)
	{
		board_name = rs1.getString("board_name");
		board_id = rs1.getInt("board_id");
%>
            <nobr>&nbsp;&nbsp;&nbsp;&nbsp;
        <img src="images/browse.gif" border="0" alt="<%=j%>">&nbsp
<a class="item" target="mainFrame" HREF="news_man.jsp?type_id=<%=type_id%>&board_id=<%=board_id%>"><%=board_name%></a>
</nobr><br>
<%
    }
%>
</div>
<%
}
%>


<!-- ################################################################################### -->
<!-- ################################################################################### -->
<!-- ################################################################################### -->



 <div ID="el10000Parent" CLASS="parent">

      <a class="item" HREF="main.jsp" target="mainFrame" onClick="expandIt('el10000'); return false;">
      <img NAME="imEx" SRC="images/plus.gif" BORDER="0" ALT="+" width="9" height="9" ID="el10000Img"></a>

      <a class="item" HREF="index.jsp" target="_parent"  onClick="expandIt('el10000');">
      
   刷新
      </a>
      </div>
      <div ID="el10000Child" CLASS="child">
        </div>



 <div ID="el20000Parent" CLASS="parent">

      <a class="item" HREF="logout.jsp" target="mainFrame"  onClick="expandIt('el20000'); return false;">
      <img NAME="imEx" SRC="images/plus.gif" BORDER="0" ALT="+" width="9" height="9" ID="el20000Img"></a>

      <a class="item" HREF="logout.jsp" target="_parent"  onClick="expandIt('el20000');">

   退出
	</a>
      </div>
      <div ID="el2Child" CLASS="child">
        </div>


<!-- ################################################################################### -->
<!-- ################################################################################### -->
<!-- ################################################################################### -->


<%
left_man.close();

%>




    <script LANGUAGE="JavaScript1.2">
    <!--
    if (NS4) {
      firstEl = "el1Parent";
      firstInd = getIndex(firstEl);
      showAll();
      arrange();
    }
    //-->
    </script>

</body>
</html>