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

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

<%
//网站群节点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=" + StrUtil.encodeHTML(request.getParameter("cluster_node_id").toString());
}
%>

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

//过滤属性
String FILTER = 		ParamUtil.getStrParam(request,"FILTER",""); 

//过滤属性2
String FILTER2 = 		ParamUtil.getStrParam(request,"FILTER2","");

//排序属性
String ORDER =			ParamUtil.getStrParam(request,"ORDER",""); 

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

//栏目的状态(默认显示状态为USE的)
String CLASS_STATE = 	ParamUtil.getStrParam(request,"CLASS_STATE","use");

//栏目的显示方式（all 为显示所有； show 为显示“在导航中显示的” hidden为显示“在导航中不显示的”
String CLASS_SHOW = 	ParamUtil.getStrParam(request,"CLASS_SHOW","all");

//排除
String EXCLUDE = 		ParamUtil.getStrParam(request,"EXCLUDE","");

//排除2
String EXCLUDE2 = 		ParamUtil.getStrParam(request,"EXCLUDE2","");

//指定显示第几页的数据
int PN = 				ParamUtil.getIntParam(request,"PN",0);

//行数
String PAGE_SIZE = 		ParamUtil.getStrParam(request,"PAGE_SIZE","4"); 

//文章日期范围（all 为显示所有；now 为显示文章所设置的日期范围内； expire 为显示过期的；notbegin 为显示未开始的
String DATE = 			ParamUtil.getStrParam(request,"DATE","now");

/***********************************
* 显示特性参数初始化
***********************************/
//新闻标题长度
int TITLE_LENGTH = 		ParamUtil.getIntParam(request,"TITLE_LENGTH",10);

//标题长度超出时显示的字符
String TITLE_OUT_STR = 	ParamUtil.getStrParam(request,"TITLE_OUT_STR","..");

//显示添加日期的格式
String ADD_DATE_FORMAT = ParamUtil.getStrParam(request,"ADD_DATE_FORMAT","MM-dd");

//图像宽度
int IMG_WIDTH = 		ParamUtil.getIntParam(request,"IMG_WIDTH",130);

//图像高度
int IMG_HEIGHT = 		ParamUtil.getIntParam(request,"IMG_HEIGHT",100);

//是否显示文章标题
String IS_SHOW_TITLE = 	ParamUtil.getStrParam(request,"IS_SHOW_TITLE","true");

//是否需要链接
String IS_LINK = 		ParamUtil.getStrParam(request,"IS_LINK","true");

/***********************************
* 元素隐显参数初始化
***********************************/
//图片的样式
String CSS = 			ParamUtil.getStrParam(request,"CSS","page_class_content");

/***********************************
* 其它处理
***********************************/
//最终显示图片的URL
String imgURL = "";

//是否显示文章标题的处理
if(IS_SHOW_TITLE.equals("true")){
	IS_SHOW_TITLE = "";
}else{
	IS_SHOW_TITLE = "none";
}

//其它内容变量
int i = 0;
%>
<!--图片幻灯效果JS-->
<script language=JavaScript>

var imgUrl1_<%=CLASS_ID%>=new Array();
var imgLink1_<%=CLASS_ID%>=new Array();
var imgText1_<%=CLASS_ID%>=new Array();
var imgOutLink1_<%=CLASS_ID%> = new Array();
var adNum1_<%=CLASS_ID%>=0;
var jumpUrl1_<%=CLASS_ID%>="ShowArticle.jsp";

<!--显示图片文章-->
<cms4j:article page_size="<%=PAGE_SIZE%>" class_id="<%=CLASS_ID%>" filter="<%=FILTER%>" filter2="<%=FILTER2%>" order="<%=ORDER%>" special_id="<%=SPECIAL_ID%>" node_id="<%=NODE_ID%>"  class_state="<%=CLASS_STATE%>" class_show="<%=CLASS_SHOW%>" date="<%=DATE%>" exclude="<%=EXCLUDE%>" exclude2="<%=EXCLUDE2%>" pn="<%=PN%>">
<cms4j:article_list>
<%
	//首页摘要图片,summary_image
	//文章摘要图片,article_image
	//栏目摘要图片1,class_image_1
	//栏目摘要图片2,class_image_2
	//栏目摘要图片3,class_image_3
	if(FILTER.equalsIgnoreCase("summary_image")){
		imgURL = article_info.getHOMEPAGE_IMAGE();
	}else if(FILTER.equalsIgnoreCase("article_image")){
		imgURL = article_info.getARTICLE_IMAGE();
	}else if(FILTER.equalsIgnoreCase("class_image_1")){
		imgURL = article_info.getCLASS_IMAGE_1();
	}else if(FILTER.equalsIgnoreCase("class_image_2")){
		imgURL = article_info.getCLASS_IMAGE_2();
	}else if(FILTER.equalsIgnoreCase("class_image_3")){
		imgURL = article_info.getCLASS_IMAGE_3();
	}else{
		imgURL = article_info.getHOMEPAGE_IMAGE();
	}
%>
//第<%=++i%>幅图
imgUrl1_<%=CLASS_ID%>[<%=i%>]="<%=imgURL%>";
imgLink1_<%=CLASS_ID%>[<%=i%>]="<%=article_info.getURL("",CLUSTER_URL_PARAM)%>";
imgText1_<%=CLASS_ID%>[<%=i%>]="<%=article_info.getTITLE(TITLE_LENGTH,TITLE_OUT_STR,"","","",false)%>";
imgOutLink1_<%=CLASS_ID%>[<%=i%>]="<%=article_info.getLINK_TO_EXTERIOR()%>";
</cms4j:article_list>
</cms4j:article>

var imgPre1_<%=CLASS_ID%>=new Array();
var j=0;
for (i=1;i<=<%=PAGE_SIZE%>;i++) {
	if( (imgUrl1_<%=CLASS_ID%>[i]!="") && (imgLink1_<%=CLASS_ID%>[i]!="") ) {
		j++;
	} else {
		break;
	}
}

function playTran1_<%=CLASS_ID%>(){
	if (document.all)
		imgInit_<%=CLASS_ID%>.filters.revealTrans.play();
}

var key=0;
function nextAd1_<%=CLASS_ID%>(){
	if(adNum1_<%=CLASS_ID%><j)adNum1_<%=CLASS_ID%>++ ;
	else adNum1_<%=CLASS_ID%>=1;
	
	if( key==0 ){
		key=1;
	} else if (document.all){
		imgInit_<%=CLASS_ID%>.filters.revealTrans.Transition=23;
		imgInit_<%=CLASS_ID%>.filters.revealTrans.apply();
             playTran1_<%=CLASS_ID%>();

	}
	document.images.imgInit_<%=CLASS_ID%>.src=imgUrl1_<%=CLASS_ID%>[adNum1_<%=CLASS_ID%>];
	document.all.titlediv_<%=CLASS_ID%>.innerHTML=imgText1_<%=CLASS_ID%>[adNum1_<%=CLASS_ID%>];
	theTimer=setTimeout("nextAd1_<%=CLASS_ID%>()", 5000);
}


function goUrl1_<%=CLASS_ID%>(){

	if(imgOutLink1_<%=CLASS_ID%>[adNum1_<%=CLASS_ID%>] == ''){
		//如果没有外部链接，则显示普通链接
		jumpUrl1_<%=CLASS_ID%>=imgLink1_<%=CLASS_ID%>[adNum1_<%=CLASS_ID%>];
	}else{
		jumpUrl1_<%=CLASS_ID%>=imgOutLink1_<%=CLASS_ID%>[adNum1_<%=CLASS_ID%>];
	}
	
	jumpTarget='_blank';
	if (jumpUrl1_<%=CLASS_ID%> != ''){
		if (jumpTarget != '') 
			window.open(jumpUrl1_<%=CLASS_ID%>,jumpTarget);
		else
			location.href=jumpUrl1_<%=CLASS_ID%>;
	}
}
</script>			 
<%
if(IS_LINK.equals("true")){
%> 
<a href="javascript:goUrl1_<%=CLASS_ID%>()">
<%
}
%>
<img style="FILTER: revealTrans(duration=2,transition=6)" src="javascript:nextAd1_<%=CLASS_ID%>()" width=<%=IMG_WIDTH%> border=0 name=imgInit_<%=CLASS_ID%> height=<%=IMG_HEIGHT%>>
<div id="titlediv_<%=CLASS_ID%>" class="<%=CSS%>" align="center" style="display:<%=IS_SHOW_TITLE%>">titlediv_<%=CLASS_ID%></div>
<%
if(IS_LINK.equals("true")){
%>
</a>
<%
}
%>
