function CreateAjax()
{
 	 /* Create a new XMLHttpRequest object to talk to the Web server */
　　var xmlHttp = false;
　　try {
　　xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
　　} catch (e) {
　　try {
　　xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
　　} catch (e2) {
　　xmlHttp = false;
　　}
　　}
　　if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
　　xmlHttp = new XMLHttpRequest();
　　}
　　return xmlHttp;
 }
 
function Dig(id)
{
	_xmlhttp = CreateAjax();
	var url = 'http://www.chinazhuyi.com/a/dig.htm?id='+id;
	if(_xmlhttp)    
    {
        var content = document.getElementById("dig"+id);
		var dig = document.getElementById(id);
        _xmlhttp.open('GET',url,true);
        _xmlhttp.onreadystatechange=function()
        {
            if(_xmlhttp.readyState == 4)
            {
                if(_xmlhttp.status == 200)
                {
                    var ResponseText = unescape(_xmlhttp.responseText);
					var r=ResponseText.split(",");
                    if(r[0] == "Dig")
                    {
                        alert("您已经参与过了！");
                        dig.innerHTML=r[1];
                    }
					
                    else if(ResponseText == "NoData")
					{
						alert("参数错误!");	
					}
					else
                    {
						dig.innerHTML=ResponseText;
						content.innerHTML='筑意度';
                    }
                }
                else    
                {
                    alert("服务器返回错误！");
                    top.location.href='http://www.chinazhuyi.com';
                }
            }
            else    
            {
                dig.innerHTML='<img src="http://img2.chinazhuyi.com/images/Loading.gif">';
            }
        }
        _xmlhttp.send(null);  
    }
    else    
    {
        alert("您的浏览器不支持或未启用 XMLHttp!");
    }
}



function TopDig(id)
{
	_xmlhttp = CreateAjax();
	var url = 'http://www.chinazhuyi.com/a/dig.htm?id='+id;
	if(_xmlhttp)    
    {
        //var content = document.getElementById("dig"+id);
		var dig = document.getElementById(id);
        _xmlhttp.open('GET',url,true);
        _xmlhttp.onreadystatechange=function()
        {
            if(_xmlhttp.readyState == 4)
            {
                if(_xmlhttp.status == 200)
                {
                    var ResponseText = unescape(_xmlhttp.responseText);
					var r=ResponseText.split(",");
                    if(r[0] == "Dig")
                    {
                        alert("您已经参与过了！");
                        dig.innerHTML=r[1];
                    }
					
                    else if(ResponseText == "NoData")
					{
						alert("参数错误!");	
					}
					else
                    {
						dig.innerHTML=ResponseText;
						//content.innerHTML='筑意度';
                    }
                }
                else    
                {
                    alert("服务器返回错误！");
                    top.location.href='http://www.chinazhuyi.com';
                }
            }
            else    
            {
                //dig.innerHTML='<img src="http://img2.chinazhuyi.com/images/Loading.gif">';
            }
        }
        _xmlhttp.send(null);  
    }
    else    
    {
        alert("您的浏览器不支持或未启用 XMLHttp!");
    }
}