<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib uri="/cms4j" prefix="cms4j" %>

<%@ page import = "cn.com.dekn.cms.util.*,cn.com.dekn.common.util.*" %>

<script src="../../js/validatorAlert.js"></script>


<% 
/***********************************
* TAG参数初始化
***********************************/

//指定显示哪一个专题
String VOTE_ID = ParamUtil.getStrParam(request,"VOTE_ID",""); 

//是否是默认调查
String FILTER = ParamUtil.getStrParam(request,"FILTER","selected"); 

//网站群节点ID
String NODE_ID = ParamUtil.getStrParam(request,"NODE_ID","root"); 

//网站群节点参数
String CLUSTER_URL_PARAM = "";
if(null != request.getParameter("cluster_node_id")){
	CLUSTER_URL_PARAM = "cluster_node_id=" + cn.com.dekn.common.util.StrUtil.encodeHTML(request.getParameter("cluster_node_id").toString());
}


//系统模板路径
String CONTEXT_PATH = cn.com.dekn.cms.syscfg.vo.SiteConfig.getInstance(NODE_ID).getCONTEXT_PATH();
String TEMPLET_PATH = cn.com.dekn.cms.syscfg.vo.SiteConfig.getInstance(NODE_ID).getSITE_TEMPLET_PATH();

/***********************************
* 显示特性参数初始化
***********************************/
//标题长度
//int TITLE_LENGTH = StrUtil.getNotNullIntValue(request.getParameter("TITLE_LENGTH"),24);

//每行的高度
String ROW_HEIGHT = ParamUtil.getStrParam(request,"ROW_HEIGHT","22");

//打开方式　与html中<a>的target属性相同
String TARGET = ParamUtil.getStrParam(request,"TARGET","_blank"); 

//结果显示页
String RESULT_PAGE = CONTEXT_PATH + TEMPLET_PATH + "/" + ParamUtil.getStrParam(request,"RESULT_PAGE",""); 

//替换所有//
while(RESULT_PAGE.indexOf("//") >= 0){
	RESULT_PAGE = StrUtil.replaceAll(RESULT_PAGE,"//","/");
}

/***********************************
* CSS样式 参数初始化
***********************************/
//CSS样式：外面框架
String CSS = ParamUtil.getStrParam(request,"CSS","page_class_content"); 
String CSS_ITEM = ParamUtil.getStrParam(request,"CSS_ITEM","page_class_content"); 

%>

<cms4j:vote_list filter="<%=FILTER%>" id="<%=VOTE_ID%>"  node_id="<%=NODE_ID%>"> 

<form action="../../do?action=vote&id=<%=vote_info.getID()%>&<%=CLUSTER_URL_PARAM%>" method="post" name="cms4jForm" id="cms4jForm" onSubmit="return Validator.Validate(this,1)" target="<%=TARGET%>">
<!--投票结果显示页-->
<input name="REDIRECT" type="hidden" value="<%=RESULT_PAGE%>?id=<%=vote_info.getID()%>">

<table width="100%"  border="0" cellpadding="0" cellspacing="0">
  <!--投票标题-->
  <tr class="<%=CSS%>">
    <td height="22" align="left" valign="top"><%=vote_info.getTITLE()%></td>
  </tr>
  <!--BEGIN: 显示投票项-->
  <cms4j:vote_select>	
  <tr class="<%=CSS_ITEM%>">
    <td height="22" align="left" valign="top"><%=voteselect_info.getVoteOption()%><%=voteselect_info.getSELECT()%></td>
    </tr>
  </cms4j:vote_select>	
  <!--END: 显示投票项-->
  
  <tr class="<%=CSS%>">
    <td height="22" align="center" valign="top"><input type="submit" name="Submit" value="投上一票">
	
       <input type="button" name="Submit2" value="查看结果" onclick="location.href='<%=RESULT_PAGE%>?id=<%=vote_info.getID()%>&<%=CLUSTER_URL_PARAM%>'"/></td></tr>
</table>
</form>
</cms4j:vote_list> 