dojo.addOnLoad(function(){
	if(typeof(CC_Url)=="undefined" || CC_Url==null || CC_Url=='')	 CC_Url=window.location.toString();
	if(typeof(CC_Item)=="undefined" || CC_Item==null || CC_Item=='')	 CC_Item='CommentCount_Item';
	getCommentCount(CC_Url,CC_Item);
}
);

function getCommentCount(url,CCItem){		
		var postURL="http://club.dayoo.com/comment/comment_json_count.dy";
		if(url==null || url==''){
			url=window.location.toString();
		}
		
		var handleFun=function(data){
			var items=document.getElementsByName(CCItem);
			for(var k=0;k<items.length;k++){
				try{items[k].innerHTML=data.commentCount;}catch(e){}
				try{items[k].innerText=data.commentCount;}catch(e){}
				try{items[k].textContent=data.commentCount;}catch(e){}
			}
		}
		
		var transport = dojo.io.ScriptSrcTransport;
		var kw = {
		url: postURL,
		constantParams: "url="+encodeURIComponent(dojo.string.trim(url)),
		transport: "ScriptSrcTransport",
		jsonParamName: "callback",
		preventCache: true,
		load: function (type, data, evt) {handleFun(data);transport.removeScripts();},
		timeout: function (){timeout();},
		timeoutSeconds: 30,
		error:function(type, error){/*alert('读取数据失败，请联系管理员！'+type+' ERROR:'+error.message);*/},
		mimetype: "text/javascript",
		preventCache:true,
		apiId: "vote"
		//sync: true
		};
		dojo.io.queueBind(kw);
}