function comment_hide(sDivId)
{
	
var oDiv = document.getElementById(sDivId);
	oDiv.style.display = "none";
	}
	
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit)
field.value = field.value.substring(0,maxlimit);
else
countfield.value = maxlimit - field.value.length;
}


var xmlHttp = createXmlHttpRequestObject();

function createXmlHttpRequestObject()
{
	var xmlHttp;
	
	try
	{
		xmlHttp = new XMLHttpRequest();
	}
	catch (e)
		
		{
			var XmlHttpVersions = new Array("MSXML2.XMlHTTP.6.0",
											"MSXML2.XMlHTTP.5.0",
											"MSXML2.XMlHTTP.4.0",
											"MSXML2.XMlHTTP.3.0",
											"MSXML2.XMlHTTP",
											"Microsoft.XMlHTTP");
	for(var i=0;i<XmlHttpVersions.length && !xmlHttp;i++)
	{
		try
		{
			xmlHttp = new ActiveXObject(XmlHttpVersions[i]);
		}
		catch (e) {}
	}
		}
		
		
		if(!xmlHttp)
			alert("Error crearing XMLHttpRequest");
		else
			return xmlHttp;

}




function revert(url,id)
{
//alert(url);
   document.getElementById(id).innerHTML="loading...";
 //  	alert("Error crearing XMLHttpRequest");
//var url ="test.php?page="+3; //UTF-8下要用encodeURI

xmlHttp.open("GET",url,true);
uid=id;
xmlHttp.onreadystatechange=handleRequestStateChange_name;
xmlHttp.send(null);



}



function handleRequestStateChange_name()
{
//	alert(uid);
	nameDiv = document.getElementById(uid);
	if(xmlHttp.readyState < 4)
	{
	//	nameDiv.innerHTML = "loading...<br/>";

	}
		else 	if(xmlHttp.readyState == 4)
		{
			if(xmlHttp.status == 200)
			{
				
				try
				{
				nameDiv.innerHTML=xmlHttp.responseText;
				}
				catch (e)
				{
					alert("error" + e.toString());
				}
			}
			else
			{
				alert("problrm" + e.toString());
			}
		}
}




//alert("Error crearing XMLHttpRequest");



