﻿//文章浏览量
function ArticleHit(RootPath,PublishSiteID,ID,PageNo,HitID)
{
	var xmlHttp;
	var url = RootPath + "Server/AjaxPage/AjaxPost.aspx?action=ArticleHit&PublishSiteID="+PublishSiteID+"&ID=" + ID + "&PageNo=" + PageNo;
	xmlHttp = GetXmlHttp();
	xmlHttp.onreadystatechange = function(){
		if(xmlHttp.readyState == 4)
		{
			if(xmlHttp.status==200)
			{
			    var r = parseInt(xmlHttp.responseText);
			    if(r >= 0)
				    $(HitID).innerHTML = r;
				else
				    $(HitID).innerHTML = AyWebLang.ParameterError;
			}
			else
			{
				//alert("服务器连接失败。错误代码为：[" + xmlHttp.status + "]," + xmlHttp.statusText);
				$(HitID).innerHTML = AyWebLang.ServerError;
			}
		}
		else
		{
			$(HitID).innerHTML = AyWebLang.DataLoading;
		}
	}
	xmlHttp.open("GET", url, true);
	xmlHttp.send("");
}


//产品浏览量
function ProductHit(RootPath,PublishSiteID,ID,PageNo,HitID)
{
	var xmlHttp;
	var url = RootPath + "Server/AjaxPage/AjaxPost.aspx?action=ProductHit&PublishSiteID="+PublishSiteID+"&ID=" + ID + "&PageNo=" + PageNo;
	xmlHttp = GetXmlHttp();
	xmlHttp.onreadystatechange = function(){
		if(xmlHttp.readyState == 4)
		{
			if(xmlHttp.status==200)
			{
				var r = parseInt(xmlHttp.responseText);
			    if(r >= 0)
				    $(HitID).innerHTML = r;
				else
				    $(HitID).innerHTML = AyWebLang.ParameterError;
			}
			else
			{
				//alert("服务器连接失败。错误代码为：[" + xmlHttp.status + "]," + xmlHttp.statusText);
				$(HitID).innerHTML = AyWebLang.ServerError;
			}
		}
		else
		{
			$(HitID).innerHTML = AyWebLang.DataLoading;
		}
	}
	xmlHttp.open("GET", url, true);
	xmlHttp.send("");
}


//下载浏览量
function DownLoadHit(RootPath,PublishSiteID,ID,PageNo,HitID)
{
	var xmlHttp;
	var url = RootPath + "Server/AjaxPage/AjaxPost.aspx?action=DownLoadHit&PublishSiteID="+PublishSiteID+"&ID=" + ID + "&PageNo=" + PageNo;
	xmlHttp = GetXmlHttp();
	xmlHttp.onreadystatechange = function(){
		if(xmlHttp.readyState == 4)
		{
			if(xmlHttp.status==200)
			{
				var r = parseInt(xmlHttp.responseText);
			    if(r >= 0)
				    $(HitID).innerHTML = r;
				else
				    $(HitID).innerHTML = AyWebLang.ParameterError;
			}
			else
			{
				//alert("服务器连接失败。错误代码为：[" + xmlHttp.status + "]," + xmlHttp.statusText);
				$(HitID).innerHTML = AyWebLang.ServerError;
			}
		}
		else
		{
			$(HitID).innerHTML = AyWebLang.DataLoading;
		}
	}
	xmlHttp.open("GET", url, true);
	xmlHttp.send("");
}


//附件点击量
function ArticleFileDownNum(RootPath,PublishSiteID,FID,HitID)
{
	var xmlHttp;
	var url = RootPath + "Server/AjaxPage/AjaxPost.aspx?action=ArticleFileDownNum&PublishSiteID="+PublishSiteID+"&ID=" + FID;
	xmlHttp = GetXmlHttp();
	xmlHttp.onreadystatechange = function(){
		if(xmlHttp.readyState == 4)
		{
			if(xmlHttp.status==200)
			{
				$(HitID).innerHTML = xmlHttp.responseText;
			}
			else
			{
				//alert("服务器连接失败。错误代码为：[" + xmlHttp.status + "]," + xmlHttp.statusText);
				$(HitID).innerHTML = AyWebLang.ServerError;
			}
		}
		else
		{
			$(HitID).innerHTML = AyWebLang.DataLoading ;
		}
	}
	xmlHttp.open("GET", url, true);
	xmlHttp.send("");
}


//公告点击量 
function AnnounceHit(RootPath,PublishSiteID,ID,HitID)
{
	var xmlHttp;
	var url = RootPath + "Server/AjaxPage/AjaxPost.aspx?action=AnnounceHit&PublishSiteID="+PublishSiteID+"&ID=" + ID;
	xmlHttp = GetXmlHttp();
	xmlHttp.onreadystatechange = function(){
		if(xmlHttp.readyState == 4)
		{
			if(xmlHttp.status==200)
			{
				$(HitID).innerHTML = xmlHttp.responseText;
			}
			else
			{
				//alert("服务器连接失败。错误代码为：[" + xmlHttp.status + "]," + xmlHttp.statusText);
				$(HitID).innerHTML = AyWebLang.ServerError;
			}
		}
		else
		{
			$(HitID).innerHTML = AyWebLang.DataLoading ;
		}
	}
	xmlHttp.open("GET", url, true);
	xmlHttp.send("");
}

//---------------JsRefleshCode----------------
//---------------JsRefleshCode----------------
function JsRefleshCode(Install,DivID)
{
    var CodeFile = Install + "Server/AjaxPage/Gif.aspx";
	if(document.getElementById(DivID));
	$(DivID).innerHTML = '<img src="'+CodeFile+'?t='+Math.random()+'"  style="cursor:pointer;border:0;vertical-align:middle;height:20px;" onclick="this.src=\''+CodeFile+'?t=\'+Math.random()" />';
}

//---------------JsOrderWin----------------
//---------------JsOrderWin----------------
function JsOrderWin(Install,sUrl,PublishSiteID,ProductID,ItemNo)
{
	var url = sUrl+'?Install='+Install+'&PublishSiteID='+PublishSiteID+'&ProductID='+ProductID+'&ItemNo='+escape(ItemNo);
	openwin(430,500,url,ItemNo);
}