﻿// JScript 文件
HTTPRequest = function () 
{
　var xmlhttp=null;
　try 
　{
　　xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
　}
　 catch (_e) 
　 {
　　try 
　　{
　　　xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
　　} 
　　catch (_E) 
　　{ }
　}
　if (!xmlhttp && typeof XMLHttpRequest != 'undefined') 
　{
　　try 
　　{
　　　xmlhttp = new XMLHttpRequest();
　　} 
　　catch (e) 
　　{
　　　xmlhttp = false;
　　}
　}
　return xmlhttp;
}
//获取数据
function submitData(url, cID)
{
    var xhttp = new HTTPRequest();
    xhttp.onreadystatechange = function()
	{
		if(xhttp.readyState!=4)
		{
			document.getElementById(cID).innerHTML="读取中...";
		}
		else if(xhttp.readyState==4)
		{
			if(xhttp.status==200)
			{
	            document.getElementById(cID).innerHTML=xhttp.responseText;
			}
			else
			{//alert(xhttp.responseText);
				document.getElementById(cID).innerHTML="读取失败";
			}
		}
		else
		{
			document.getElementById(cID).innerHTML="读取中...";
		}
	}
	xhttp.open("GET", url ,true);
	xhttp.send(null);
}
//GetData
function GetData(location, clientID, KeywordColor, StrLen, SiteUrl)
{
    submitData("../AjaxTools/ReadData.aspx?url="+location+"&color="+KeywordColor+"&len="+StrLen+"&siteurl="+SiteUrl, clientID);
}