﻿//_
///////////////////////////////////////////////////////////////////////////
//特约专题
///////////////////////////////////////////////////////////////////////////
function ajaxPluginSpecialList(oDiv, save2file)
{
	if(oDiv==null) oDiv="ajaxPluginSpecialList";
	if(save2file=="js")
		ExecuteJsonData("/cmsfile/jsondata/special.js", "/cmsfile/templates/v2009/_speciallist.htm", oDiv, "/cmsfile/jsdata/p_special.js", "", "js");
	else if(save2file=="html")
		ExecuteJsonData("/cmsfile/jsondata/special.js", "/cmsfile/templates/v2009/_speciallist.htm", oDiv, "/cmsfile/htmldata/p_special.htm", "", "html");
	else
		ExecuteJsonData("/cmsfile/jsondata/special.js", "/cmsfile/templates/v2009/_speciallist.htm", oDiv);
}
function ajaxGo2View(ccId,id)
{
	$.ajax({
		type:       "post",
		dataType:   "json",
		data:       "contentid="+id+"&channelid="+ccId+"&time="+(new Date().getTime()),
		url:        "/cmsfile/ajaj/content.aspx?oper=ajaxGo2View",
		error: function(){
			//alert('Error loading JSON document');
		},
		success:    function(d){
			window.open(d.returnval);
		}
	});
}
function ajaxViewCount(cType,id,randomid)
{
	$.ajax({
		type:       "get",
		dataType:   "json",
		data:       "oper=ajaxViewCount&id="+id+"&cType="+cType+"&time="+(new Date().getTime()),
		url:        "/cmsfile/ajaj/content.aspx",
		error: function(){
			//alert('Error loading JSON document');
		},
		success:    function(d){
			$("#ajaxViewCount_"+id+"_"+randomid).text(d.count);
		}
	});
}
function replaceContentTags(ccid,cType,taglist,bodyid)
{
	try{
		var elms1 = $("#"+bodyid+" a");
		for (i = 0; i < elms1.length; i++){elms1[i].title="";}
		var elms2 = $("#"+bodyid+" img");
		for (i = 0; i < elms2.length; i++){elms2[i].alt="";}
		var returnhtml=$("#"+bodyid).html();
		var tags=taglist.split(',');
		for (i = 0; i < tags.length; i++) {
			if(tags[i].length>1)//只取2个字符以上的
			{
				returnhtml=returnhtml.replace(tags[i],"<a href='/cmsfile/extends/search/index.aspx?type="+cType+"&k="+escape(tags[i])+"&t=tag' target='_blank'><font color='blue'>"+tags[i]+"</font></a>");
			}
		}
		$("#"+bodyid).html(returnhtml);
	}
	catch(e){}
}
function addFavorite(ccid,cType,id)
{
	$.ajax({
		type:       "get",
		dataType:   "html",
		data:       "oper=addFavorite&id="+id+"&ccid="+ccid+"&cType="+cType+"&time="+(new Date().getTime()),
		url:        "/cmsfile/ajaj/content.aspx",
		error: function(){
			//alert('Error loading JSON document');
		},
		success:    function(d){
			JumbotCms.Alert(d,"0");
		}
	});
}
