

<%  
	//复制于viewnews.jsp 去掉头，及无关的东西，保留页面内容，去掉了
    request.setCharacterEncoding("UTF-8");
    FF.setResponseContentType(response)  ;
    
    int noRedirect = FF.GetIntFromRequest(request,"noredirect",0);
	//如果没有禁止重定向，那么才做重定向操作
	if (	noRedirect==0)	    if ( NewsUtil.viewNewsSendRedirect(  request, response) )  return ;
     
	 	  
	 
	 
	String  $newsid = FF.GetStringFromRequest(request, "newsid", "-1"); 
    NewsView ni标识=new NewsView( request,response,false, $newsid,true); 
    
 
    FF.pageContextSetAttribute(pageContext,"isrss" , new Boolean( ni标识.isRSS));
    
    FF.pageContextSetAttribute(pageContext,"info" ,  ni标识.Info);
    
    FF.pageContextSetAttribute(pageContext,"comments", ni标识.Comments);
    FF.pageContextSetAttribute(pageContext,"keywords", ni标识.keywords);
    FF.pageContextSetAttribute(pageContext,"isQAMode", ni标识.isQAMode);
    
    
    FF.pageContextSetAttribute(pageContext,"commentCount", ni标识.Comments.size());
    
    
    FF.pageContextSetAttribute(pageContext,"isadmin",new Boolean( ni标识.isAdmin));        //最后发布人，可以修改
    FF.pageContextSetAttribute(pageContext,"isSubjectAdmin",new Boolean( ni标识.isSubjectAdmin));        //栏目的管理员
    
    
    
    FF.pageContextSetAttribute(pageContext,"ismine",new Boolean( ni标识.isMine));         
    
    FF.pageContextSetAttribute(pageContext,"research",  ni标识.researchHTML);        
    
    FF.pageContextSetAttribute(pageContext,"SubjectIsAutoAssess",new Boolean( ni标识.SubjectIsAutoAssess));
	 
    FF.pageContextSetAttribute(pageContext,"config",ni标识.subjectConfig);	
    FF.pageContextSetAttribute(pageContext,"voteList",ni标识.voteList);
    FF.pageContextSetAttribute(pageContext,"voteGroupHTML",ni标识.voteGroupHTML);	
    
     
 %>

  
 
   
    <LINK rel="stylesheet" type="text/css" href="<c:out value="${wiseoaappsubpath}"/>/css/normal.css">
    <LINK rel="stylesheet" type="text/css" href="<c:out value="${wiseoaappsubpath}"/>/css/news.css">
   
  
	  
	  
  <LINK rel="stylesheet" type="text/css" href="<c:out value="${wiseoaappsubpath}"/>/zbutton/zbutton.css">
    <SCRIPT type="text/javascript" src="<c:out value="${wiseoaappsubpath}"/>/zbutton/zbutton.js"></SCRIPT>
   
    <LINK rel="stylesheet" type="text/css" href="<c:out value="${wiseoaappsubpath}"/>/vmlchart/pie/pie.css">
    <SCRIPT type="text/javascript" src="<c:out value="${wiseoaappsubpath}"/>/vmlchart/pie/pie.js"></SCRIPT>
   
   <LINK rel="StyleSheet" href="tree/dtree.css" type="text/css" />
	<SCRIPT type="text/javascript" src="tree/dtree.js"></SCRIPT>
	
	
	
	
 <style type="text/css">
<!--
 
  
.contentContainer { width:100%; }  
#cb_research { bordr:0; width:60px;height:25px; background-color:green;color:white; font-size:14px;}

.paddingLeft55 {padding-left:55px;}
 .leftPart {width:55px;}
 
 .imgbutton { width:55px; border:1px solid gray; height:25px;background-color:#f0f0f0; color:black; cursor:hand;}
 
-->
</style>


<!--  在新闻查看时也能进行新闻维护-->
<SCRIPT type="text/javascript" src="js/news_getselect_view.js"></SCRIPT> 
<SCRIPT type="text/javascript" src="js/news.js"></SCRIPT> 

<!-- ---------------------------------------------------------------------- -->
<!-- START : EDITOR HEADER - INCLUDE THIS IN ANY FILES USING EDITOR -->


<script language="Javascript1.2" src="htmledit2/editor.js"></script>
<script>
// set this to the URL of editor direcory (with trailing forward slash)
// NOTE: _editor_url MUST be on the same domain as this page or the popups
// won't work (due to IE cross frame/cross window security restrictions).
// example: http://www.hostname.com/editor/

_editor_url = "htmledit2/";
</script>
 <style type="text/css"><!--
  .btn   { BORDER-WIDTH: 1; width: 20px; height: 20px; }
  .btnDN { BORDER-WIDTH: 1; width: 20px; height: 20px;  BACKGROUND-COLOR:#feffff ; }
  .btnNA { BORDER-WIDTH: 0; width: 20px; height: 20px; filter: alpha(opacity=25); }
--></style>
<!-- END : EDITOR HEADER -->
<!-- ---------------------------------------------------------------------- -->

 
 
 <script language="javascript">
 
 currentViewNewsID=<c:out value="${param.newsid}"/>;
 
 function NewComment()
 {
	 document.getElementById('cb_new').style.display="none";
 	document.getElementById('editframe').innerHTML="<iframe id='commentframe' frameborder=0 width='100%' height='230' src='<c:out value="${wiseoaappsubpath}"/>/news_comment_edit.jsp?newsid=<c:out value="${info.id}"/>&height=180'></iframe>";
 }

//兼容批量删除，所以需要拼上一个逗号
function DeleteNews(id)
	{  
		if (!confirm('确信要删除本新闻吗?')) return;
         jsrsExecute("<c:out value="${wiseoaappsubpath}"/>/servlet/wiseoa.news.rpc.EditNews",callback_delete , "Delete", ','+id,false);
	}
	
    function  callback_delete(msg)
	{
	    if (extractValue(msg ,"ok")=="true") 
		{
			alert('删除成功。');
			navigate( '<c:out value="${wiseoaappsubpath}"/>/index.jsp' );
		}else
		{
		   alert ( extractValue(msg, "error"));
		} 
	 }
 
    function Delete(id)
	{  
		if (!confirm('确信要删除评论吗?')) return;
         jsrsExecute("<c:out value="${wiseoaappsubpath}"/>/servlet/wiseoa.news.rpc.NewsComment",callback , "Delete", ''+id,false);
	}
	
	function  callback(msg)
	{
	    if (extractValue(msg ,"ok")=="true") 
		{
			navigate( ''+document.location);
		}else
		{
		   alert ( extractValue(msg, "error"));
		} 
	 }
	
	function agree( type, newsID , critiqueID, agreeOrNot)
	{
		jsrsExecute("<c:out value="${wiseoaappsubpath}"/>/servlet/wiseoa.news.rpc.NewsComment",   agree_callback , "agree", [ type, newsID, critiqueID,agreeOrNot] ,false);
	}
	
	function  agree_callback(msg)
	{
	    if (extractValue(msg ,"ok")=="true") 
		{
			var newsID=extractValue(msg ,"newsid");
			var critiqueID=extractValue(msg ,"critiqueid");
			var type=extractValue(msg ,"type");
			
			$E('comment_'+type+"_"+newsID+"_"+critiqueID).innerText=extractValue(msg ,"count");
			
			
		}else
		{
		   alert ( extractValue(msg, "error"));
		} 
	 }
	 //在  index_logintemplate.jsp 中已经包含了NewsResearch脚本
 //投票
  
 
	//对评论的回复  id 是 news_critique.id
 var 	box2_init=false;
 function  Writeback(id)
 {
			 $E('critique_id').value=id;
		 if(!box2_init)
			 {
			// editor_generate('box2', "100%","100" );
			  box2_init=true;
			 }
		 $E('box2').value="";
		
		 $("#newcomment").insertAfter($("#writebackcontainer_"+id));
		 $E("newcomment").style.display="";
		  $E('box2').focus();
 }
	 
function NewCommentOnOK()
 {
 	    var id= $E('critique_id').value;
 	    var s=$E('box2').value;
        jsrsExecute("<c:out value="${wiseoaappsubpath}"/>/servlet/wiseoa.news.rpc.NewsComment",   callback , "Writeback", [id, s] ,false);
	
 }
  
	
 function	DeleteWriteback(id)
 {
 
     if (!confirm('确信要删除对评论的回复吗?')) return;
     jsrsExecute("<c:out value="${wiseoaappsubpath}"/>/servlet/wiseoa.news.rpc.NewsComment",callback , "DeleteWriteback",  id,false);
 }
	
 
 </script>
   
 
  

  <!--------------------------------------------------------------------------------------------------------->
<table class="contentContainer"  height='100%' align='center' border=0 cellspacing="0" cellpadding="0">
 <tr>
 
 
 <td   align="center" valign="top" bgcolor="#FFFFFF" style="padding-top:20px;"> 
 
   <TABLE class="contentContainer"    cellspacing="0" cellpadding="0"  >
<TR>
<TD align="center"  height='100%' >
<table class="contentContainer"  height='100%'  cellspacing="0" cellpadding="0"   style="<c:out value='${config.newsviewcss}'/>" >
   
  <tr>
    <td  height='530'  style="padding-left:20px; padding-right: 20px;" colspan="6" valign="top"   align='left'  class=newsbody>
    <c:if  test="${info.autotitle==1 || info.isrss==1}">
        <div style="padding:20px;padding-left:55px;">
        <table border=0 cellspacing="0" cellpadding="0" style="height:25px;" ><tr>
       <c:forEach var="key" items="${keywords}">
       <td><img src='image/lr.jpg'></td><td   style="background-image:url(image/lm.jpg) ;background-repeat: repeat-x;"><c:out value="${key}"/></td><td><img src='image/rr.jpg'></td>
       </c:forEach>
       </tr></table>
       </div>
       
<div   style="padding-left:55px;">
      
       <c:if test="${info.totop==1 ||info.issoul==1||info.locked==1 }">
        <div>
        <c:if test="${info.totop==1 }"><img src='image/move_top12.gif' border=0 align='absmiddle' title='被置顶'></c:if>
        <c:if test="${info.issoul==1 }"><img src='image/soul12.gif' border=0 align='absmiddle' title='精华'></c:if>
        <c:if test="${info.locked==1 }"><img src='image/lock12.gif' border=0 align='absmiddle' title='被锁定，不允许再投票或回复'></c:if>
        
        </div>
        </c:if> 
        
      <div class="px26"  ><c:out value='${info.title}'/></div>
      
      <c:if test="${param.newsid!='votegroup'}">
       
     
          <div style='color:gray;padding-top:5px;padding-bottom:10px;'>
              <img src="image/file.png" align="absmiddle" border=0>发布于：<c:out value="${info.publish_date}"/>&nbsp;&nbsp;&nbsp;&nbsp;
              <img src="image/tip16.gif" align="absmiddle" border=0>阅读次数：<c:out value="${info.readcount}"/>&nbsp;&nbsp;&nbsp;&nbsp;
              <img src="image/offline.gif" align="absmiddle" border=0>发布人：<%=ni标识.authorName%>&nbsp;&nbsp;&nbsp;&nbsp;
              <a target="_blank" style=" TEXT-DECORATION: none;" href="viewnews_print.jsp?newsid=<c:out value="${param.newsid}"/>&subjectid=<c:out value="${param.subjectid}"/>"><img src="image/printer16_bw.gif" align="absmiddle" border=0></img> 打印</a>
          <br><img src="image/sendfile16.gif" align="absmiddle" border=0> 来源：<c:out value="${info.origin}"/>
          </div>  
      </c:if>
       <hr size=1 color='lightgray'>
      </c:if> 
        <span id=maincontent>
        <c:out value="${newsPropertyEditHTML}"   escapeXml="false"/>
        <c:out value="${info.content}"   escapeXml="false" /></span>
        <%=ni标识.chartHTML %>
        <span><c:out value="${research}"   escapeXml="false" /></span>
        <c:if  test="${isrss}">
        <div align=center><br><br><a href='<c:out value="${info.rsslink}"/>'>查看详细内容</a></div>
        </c:if>
         
        <div><c:out value="${info.content_navigate}"   escapeXml="false" /></div>
</div>

		<c:if test="${isQAMode}">
<div >		
		<hr size=1 color='lightgray'>
	 <div   style="padding-left:55px;">
        <table border=0 cellspacing=0 cellpadding=0><tr><td><img src='image/lr.jpg'></td>
        <td   style="height:25px;background-color:#eff6fa;size:14px;"><b>回复：</b></td><td><img src='image/rr.jpg'></td>
       </tr></table>
		</div>
		
		<table border=0 width=100% cellspacing=0 cellpading=0>
		<tr> <td class=leftPart  valign="top">
      <table border=0 cellspacing=0 cellpadding=0  style="width:42px">
      <tr><td  id=comment_answer_<c:out value="${info.id}"/>_<c:out value="${info.id}"/>  class=asbutton2 style="height:39px; background-image:url(image/agree.jpg);padding-top:9px;" align="center"
             onmouseover="this.style.backgroundImage='url(image/agree2.jpg)';  this.style.color='white'; " 
             onmouseout="this.style.backgroundImage='url(image/agree.jpg)'; this.style.color='black'; " 
             onmousedown=" this.style.paddingTop='10px'; "
             onmouseup=" this.style.paddingTop='9px'; "
             onclick=" agree( 'answer',<c:out value="${info.id}"/> ,<c:out value="${info.id}"/>,1)"         
                     
      ><c:out value="${info.agreecount}"/></td></tr>
      <tr><td  class=asbutton2 style="height:29px; background-image:url(image/unagree.jpg)"
          onmouseover="this.style.backgroundImage='url(image/unagree2.jpg)';  this.style.color='white'; " 
             onmouseout="this.style.backgroundImage='url(image/unagree.jpg)'; this.style.color='black'; " 
            	 onclick=" agree( 'answer',<c:out value="${info.id}"/> ,<c:out value="${info.id}"/>,-1)"     
      ></td></tr>
      
      </table>
     </td>
		<td>
		<c:out value="${info.answer}"   escapeXml="false" /></span>
		<hr size=1 color='lightgray'>
		<c:out value="${config.disclaimer}"   escapeXml="false" />
		</td></tr></table>
		</c:if>
</div>
<div   style="padding-left:55px;">
        <!-- 投票组的支持 -->
        <c:forEach var="vote"  items="${voteList}"  varStatus="status">
        <div>
        <c:if  test="${vote.autotitle==1 || vote.isrss==1}">
        <div  style="font-size:22px; border:1px solid lightgray; background-color:#f7f7f7;padding:5px;" >
        <a  target='_blank'  href='viewnews.jsp?newsid=<c:out value="${vote.id}"/>&subjectid=<c:out value="${vote.subject_id}"/> '><c:out value='${vote.title}'/></a></div>
        <br>
        </c:if>
       
        <c:out value="${vote.content}"   escapeXml="false" /></span>
       
        <br>
        <span><c:out value="${vote.research_html}"   escapeXml="false" /></span><br>
        </c:forEach>
         
        <c:out value="${voteGroupHTML}"   escapeXml="false" /></span>
 		</div>
        
        </div>
        
        </td>
  </tr>
  <tr>
  <td style="padding-left:20px; padding-right: 20px;" >
   
  
  <!-- 如果允许评论-->
  <c:if  test="${info.revert_==1  }">
   
    <!-- 如果不是问答模式，那么显示发表评论，如果是评论模式，那么仅当栏目管理员查看 时，或发表人查看且已经回别人评论后才能再评论 -->
    
    <c:if test="${ info.locked==0}">
       <table width="100%"  cellspacing=0 cellpadding=0 ><tr><td width="90%">&nbsp;</td>
    <td nowrap align=right  id='cb_new' class='asbutton' style='padding-top:20px;padding-bottom:20px;' onClick="NewComment();"><c:out value='${config.revertbutton}' escapeXml="false"/></td></tr></table>
   </c:if>
   
    <div style='padding-left:55px;'><div id='editframe' style="width:100%;position:relative;"></div></div>  
  
  	<c:forEach var="comment"  items="${comments}"  varStatus="status">
  
     <table width="100%"   border="0" cellpadding="0" cellspacing="0" style="font-size:12px;">
     <tr>
     <td class=leftPart  valign="top">
      <table border=0 cellspacing=0 cellpadding=0  style="width:42px">
      <tr><td  id=comment_critique_<c:out value="${info.id}"/>_<c:out value="${comment.id}"/>  class=asbutton2 style="height:39px; background-image:url(image/agree.jpg);padding-top:9px;" align="center"
             onmouseover="this.style.backgroundImage='url(image/agree2.jpg)';  this.style.color='white'; " 
             onmouseout="this.style.backgroundImage='url(image/agree.jpg)'; this.style.color='black'; " 
             onmousedown=" this.style.paddingTop='10px'; "
             onmouseup=" this.style.paddingTop='9px'; "
             onclick=" agree( 'critique',<c:out value="${info.id}"/> ,<c:out value="${comment.id}"/>,1)"         
                     
      ><c:out value="${comment.agreecount}"/></td></tr>
      <tr><td  class=asbutton2 style="height:29px; background-image:url(image/unagree.jpg)"
       onmouseover="this.style.backgroundImage='url(image/unagree2.jpg)';  this.style.color='white'; " 
             onmouseout="this.style.backgroundImage='url(image/unagree.jpg)'; this.style.color='black'; " 
            	 onclick=" agree( 'critique',<c:out value="${info.id}"/> ,<c:out value="${comment.id}"/>,-1)"        
      ></td></tr>
      
      </table>
     </td>
     <td  align="left" ><div style="color:black;padding-top:5px;padding-bottom:5px;">
     <table border=0 width="100%" ><tr><td nowrap style=" text-align:left; ">
     <b><c:out value="${comment.username}"/></b></td><td align="right">
     <img class="useridentify"  style="height:32px;" src='<c:out value="${comment.s_identify}"/>'>
     </td></table>
        </div>
     	 
      				<div style="line-height:25x;">
			 			<c:out value="${comment.content}"  escapeXml="false"/> 
                   </div>
                   <div   id=writebackcontainer_<c:out value="${comment.id}"/>   style="border:1px dotted #f0f0f0; color:gray;padding:5px;padding-bottom:5px;">
                   <img src="image/file.png" align="absmiddle" border=0>发表于：<c:out value="${comment.showrq}"/>&nbsp;&nbsp;&nbsp;&nbsp;
					   
					       
					      <c:if test="${comment.canwriteback==1 &&  info.locked==0}">&nbsp;&nbsp;
					      <img src="image/tip16.gif" align="absmiddle" border=0><span class='asbutton2' 
					      onmouseover="this.style.color='blue';"  
					      onmouseout="this.style.color='gray';"  
					      onClick='Writeback(<c:out value="${comment.id}"/>);'>[添加评论]</span>
					      &nbsp;
					      </c:if>
					      
					      <c:if test="${comment.canedit==1 &&  info.locked==0}">
					      <!--   <span class='asbutton' > <img   class="noresizeimg"  src='image/edit2.gif'  align='absmiddle'>修改</span>&nbsp;&nbsp;   -->
					      </c:if> <c:if test="${comment.candel==1 && comment.detailcount<1 &&  info.locked==0}">
					      &nbsp;&nbsp;<img src="image/del16.gif" align="absmiddle" border=0><span class='asbutton2'  
					      onClick='Delete(<c:out value="${comment.id}"/>);'
					       onmouseover="this.style.color='blue';"  
					      onmouseout="this.style.color='gray';"  
					      >[ 删除回复]</span>
					       </c:if>
					       
				</div>
				    
                      <c:if  test="${comment.critiquewritebackhtml !=''  }">
	                       <div class=paddingLeft55>
	                       <c:out value="${comment.critiquewritebackhtml}"  escapeXml="false"/>
	                       </div>
                       </c:if>
                       
     					
				
					      
			<hr size=1 color='lightgray'>
	 </td>
	 </tr>
	 </table>
   
    </c:forEach>
    </td>
    </tr>
    
  
  <tr>
    <td  colspan="6" height='20'  class=newsbody ><%=ni标识.NavigateHTML%></td>
  </tr>
  
  </c:if>
   
</table></TD>
  </TR>
  
 
  </TABLE>
  
  </td>
  
 

  </tr>

 
</table>

 


<script>

 // 将上传的图片显示宽度控制一下，不然撑得太大不好看
  
   
 
<%=ni标识.resizeImageScript%>
 
 
   
   document.onclick=click ;
   
   function click()
   {
   	    var  obj= event.srcElement;
   	    if ( obj==undefined) return;
   	    if ( obj.tagName=="IMG" && obj.className!='noresizeimg')
   	    {
   	      //大于一定尺寸的图片在被点击后，在新窗口中打开
   	    	if ( obj.width>200)     	open  ( obj.src);
   	     }
   }
   
   document.onmouseover= mouseover;
   
   function mouseover()
   {
   	    var  obj= event.srcElement;
   	    if ( obj==undefined) return;
   	    if ( obj.tagName=="IMG"  && obj.className!='noresizeimg')
   	    {
   	      
   	    	if ( obj.width>100)  
   	    	{
   	    	 obj.style.cursor="hand";
   	    	 obj.title="点击将在新窗口中显示本图片";
   	    	 }
   	     }
   }
   
  
</script>
 
  <!-------------------------------------------------------------------->
	<div id="newcomment" style="display:none; cursor: default ; padding-right:20px; " > 
	<div style=' ;height:20px; line-height:20px;padding-left:10px;width:100% font-size:14px; background-color:efefef;'>输入您的评论：</div>
        <div  style="padding:10px; background-color: #f0f0f0 ;  ">
        
        <input type="hidden" id=critique_id >
     	<textarea name="box2" id="box2" rows="1"  style="width: 100%; height: 100px"  >
		</textarea>
	 

      
        <div align="right" style="padding-top:5px;">
        <input type="button" style="border:0px solid gray; width:80px;height:28px; color:white; background-color:green;font-size:14px;" value="提 交" onclick="NewCommentOnOK();">
        <input type="button" style="border:0px solid gray; width:80px;height:28px; color:white; background-color:#e88e09;font-size:14px;" value="放 弃" onclick="$E('newcomment').style.display='none';">
        
       
        </div>
        </div>
    </div>
  