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;
	var m_OnSucceed=function(){};
	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.OnSucceed=function(succeed)
	{
		m_OnSucceed=succeed;
	}
	
	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);
		//alert("|"+m_xmlReq.responseText+"|")
	    return eval(m_xmlReq.responseText);
	}
}