<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib uri="/cms4j" prefix="cms4j" %>
<%@ page import = "cn.com.dekn.cms.util.*,cn.com.dekn.common.util.*" %>
<style type="text/css">
.form-buttun {
	BORDER-RIGHT: #002D96 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #002D96 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 12px; FILTER: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#FFFFFF, EndColorStr=#9DBCEA); BORDER-LEFT: #002D96 1px solid; CURSOR: hand; COLOR: black; PADDING-TOP: 2px; BORDER-BOTTOM: #002D96 1px solid
}
</style>
<%
/***********************************
* TAG参数初始化
***********************************/
//要显示文章的ID
String ARTICLE_ID = ParamUtil.getStrParam(request,"ARTICLE_ID","");
//要显示文章的所属站点
String NODE_ID = ParamUtil.getStrParam(request,"NODE_ID","");
//要显示文章的已有顶的次数
String DIGG_COUNT = ParamUtil.getStrParam(request,"DIGG_COUNT","");
//已经顶过一次的提示信息
String NOTE_INFO = ParamUtil.getStrParam(request,"NOTE_INFO","您今天已经顶过了此文章！");
%>
<span id="diggSpan" style="font-size:14px; color:#0000FF"><%=DIGG_COUNT%></span>
<input name="diggBnt" type="button" id="diggBnt" class="form-buttun" value="顶" onclick="diggArticle()">
<script>
	//顶文章
	function diggArticle(){
		var articleID = "<%=ARTICLE_ID%>";
		var nodeID = "<%=NODE_ID%>";
		var noteInfo = "<%=NOTE_INFO%>";
		if(articleID==""||nodeID==""){
			return;
		}
		
		var ajax=new AJAXRequest();
		ajax.get("../../do?action=diggArticle&id="+articleID+"&node_id="+nodeID+"&note_info="+noteInfo,function(obj){processReturnFromAjax(obj.responseText);});
	}
	//顶文章的回调函数
	function processReturnFromAjax(responseText){
		if(responseText=="true"){
			var diggCuontStr = document.getElementById("diggSpan").innerHTML;
			var diggCount = parseInt(diggCuontStr);
			document.getElementById("diggSpan").innerHTML = diggCount + 1;
		}else{
			alert(responseText);
		}
	}
</script>