//=============================================================
// 文件名称: Inc/Sys_Ajax.js
// 文件作用: Ajax调用函数
// 更新日期: 2007.04
//=============================================================

//定义程序所在路径,请参考Conn.Asp中"Root"的设置
var Path = "/";

function PublicAjax(File,Data,TheObj,OpenMethod) {
	var PubXML = false;
	try {
	PubXML = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
	try {
		PubXML = new ActiveXObject("Microsoft.XMLHTTP");
	} catch (e2) {
		PubXML = false;
	}
	}
	if (!PubXML && typeof XMLHttpRequest != 'undefined') {
	PubXML = new XMLHttpRequest();
	}
	if(PubXML) {
		PubXML.onreadystatechange=function() {
			if(PubXML.readyState==4) {
				if(PubXML.status==200) {
					if (TheObj!="None") {
						document.getElementById(TheObj).innerHTML=PubXML.responseText
					} else {
						eval(PubXML.responseText)
					}
				}
			}
		};
		PubXML.open(OpenMethod,File,true);
		PubXML.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		PubXML.send(Data);
	}
}


//浏览部分,点击数加1
function ShowCountShowLog(LogID) {
	var ShowCountShowLogFile	=	Path+'ShowAjax.Asp';
	var SendData				=	'Action=ShowCount&LogID='+LogID;
	var OpenMethod				=	"POST";
	PublicAjax(ShowCountShowLogFile,SendData,"None",OpenMethod);
}

//显示日志的评论
function ShowLogComment(Flag,LogID,ThePage,DisComment) {
	var ShowLogCommentFile	=	Path+'Comment.Asp';
	var SendData			=	'action=ShowComment&Flag='+Flag+'&LogID='+LogID+'&Page='+ThePage+'&DisComment='+DisComment;
	var OpenMethod			=	"POST";
	PublicAjax(ShowLogCommentFile,SendData,"ShowCommentBlock",OpenMethod);
}

//Ajax显示最新评论
function ShowNewCommentList() {
	var ShowNewCommentFile	=	Path+'Comment.Asp';
	var SendData			=	'Action=ShowNewComment';
	var OpenMethod			=	"POST";
	PublicAjax(ShowNewCommentFile,SendData,"ShowNewCommentItem",OpenMethod);
}
