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

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


<%
//当前站点的发布上下文(虚拟目录）
String CONTEXT_PATH = cn.com.dekn.cms.syscfg.vo.SiteConfig.getInstance().getCONTEXT_PATH();

//默认的文章显示页,下面会从配置信息中取
String DEF_ARTICLE_SHOW_PATH = "";

//网站群节点ID
String NODE_ID = StrUtil.getNotNullStringValue(request.getParameter("NODE_ID"),"root");

//网站群节点参数
String CLUSTER_URL_PARAM = "";
if(null != request.getParameter("cluster_node_id")){
	CLUSTER_URL_PARAM = "cluster_node_id=" + request.getParameter("cluster_node_id");
}
%>

<cms4j:site_config node_id="<%=NODE_ID%>">
<% DEF_ARTICLE_SHOW_PATH = siteconfig_info.getARTICLE_VIEW_TEMPLET_PATH(); %>
</cms4j:site_config>


<% 
/***********************************
* TAG参数初始化
***********************************/
//要显示栏目的ID
String CLASS_ID = StrUtil.getNotNullStringValue(request.getParameter("CLASS_ID"),"all"); 

//新闻标题长度
int TITLE_LENGTH = StrUtil.getNotNullIntValue(request.getParameter("TITLE_LENGTH"),18);

//行数
String PAGE_SIZE = StrUtil.getNotNullStringValue(request.getParameter("PAGE_SIZE"),"5");

//显示文章的默认页面
String SHOW_ARTICLE_PAGE = StrUtil.getNotNullStringValue(request.getParameter("SHOW_ARTICLE_PAGE"),DEF_ARTICLE_SHOW_PATH);

//图像宽度
int IMG_WIDTH = StrUtil.getNotNullIntValue(request.getParameter("IMG_WIDTH"),251);

//图像高度
int IMG_HEIGHT = StrUtil.getNotNullIntValue(request.getParameter("IMG_HEIGHT"),180);

//图片展播控件
String PPT_OBJECT = StrUtil.getNotNullStringValue(request.getParameter("PPT_OBJECT"),CONTEXT_PATH + "/images/focus.swf");
%>

<!--图片幻灯效果JS-->
<a target=_self href="javascript:goUrl()"> 

<% int i = 0;%>
	<span class="titlediv">
		<script type="text/javascript">
							
		<cms4j:article page_size="<%=PAGE_SIZE%>" class_id="<%=CLASS_ID%>" filter="summary_image" node_id="<%=NODE_ID%>">
		<cms4j:article_list>
		
			//第<%=++i%>幅图				
			imgUrl<%=i%>="<%=article_info.getHOMEPAGE_IMAGE()%>";
			imgtext<%=i%>="<%=article_info.getTITLE(TITLE_LENGTH,"..","","","",false)%>"
			imgLink<%=i%>=escape("<%=article_info.getURL(SHOW_ARTICLE_PAGE,CLUSTER_URL_PARAM)%>");
		
		</cms4j:article_list>
		</cms4j:article>
		
		 var focus_width=<%=IMG_WIDTH%>
		 var focus_height=<%=IMG_HEIGHT%>
		 var text_height=<%=TITLE_LENGTH%>
		 var swf_height = focus_height+text_height
		 
		 
		 <%
			String imgUrl = "";
			String imgLink = "";
			String imgText = "";
			for(int j = 0;j<i;j++){
				if(j==i-1){
					imgUrl = imgUrl + "imgUrl" + (j+1);
					imgLink = imgLink + "imgLink" + (j+1);
					imgText = imgText + "imgtext" + (j+1);
				}else{
					imgUrl = imgUrl + "imgUrl" + (j+1) + " + \"|\" + ";
					imgLink = imgLink + "imgLink" + (j+1) + " + \"|\" + ";
					imgText = imgText + "imgtext" + (j+1) + " + \"|\" + ";
				}
			}
			
		 %>
		 
		 
		 //var pics=imgUrl1+"|"+imgUrl2+"|"+imgUrl3+"|"+imgUrl4+"|"+imgUrl5
		 var pics=<%=imgUrl%>;
		 var links=<%=imgLink%>;
		 var texts=<%=imgText%>;
		 
		 document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
		 document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="<%=PPT_OBJECT%>"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
		 document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
		 document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
		 document.write('<embed src="<%=PPT_OBJECT%>" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#F0F0F0" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
		 document.write('</object>');
		 
		
		</script>
	</span>
</a>

<span id=focustext class=titlediv>
</span>	