﻿
String.prototype.trim=function(){return this.replace(/(\s*$)|(^\s*)/g, '');};
function $$(id){return document.getElementById(id);};
function $$F(id){var o=$$(id);if(o==null) return null;return o.value.trim();};

///调用方法，返回指定的内容
function Ajax(url)
{
	var m_xmlReq=null;
	if(window.ActiveXObject)
	{
	    try 
	    {
	        m_xmlReq = new ActiveXObject('Msxml2.XMLHTTP'); 
	    }
	    catch(e)
	    {
	        try{m_xmlReq = new ActiveXObject('Microsoft.XMLHTTP');}catch(e){}
	    }
	}
	else if(window.XMLHttpRequest)
	{
	    m_xmlReq = new XMLHttpRequest();
	}
	
	this.post=function(d)
	{
	    if(!m_xmlReq)  return;
	    m_xmlReq.open('POST',url,false);
	    m_xmlReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=utf-8');
	    m_xmlReq.send(d);
	    //return eval("("+m_xmlReq.responseText+")");  //成功
	    return m_xmlReq.responseText;
	}
}

