function http_request(xszCSSID, szURL, szURLParams, xoForm)
{
    var xmlhttp=null;
    // code for Mozilla, etc.
    if (window.XMLHttpRequest)
    {
        xmlhttp=new XMLHttpRequest();
    }
    // code for IE
    else if (window.ActiveXObject)
    {
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }

    if (xmlhttp!=null)
    {

        //xmlhttp.open("POST","httpproxy.php" , true);
		xmlhttp.open("POST",szURL, true);

        xmlhttp.onreadystatechange = function()
                                        {
                                            if (xmlhttp.readyState == 4)
                                            {
                                                if (xmlhttp.status == 200)
                                                {	
                                                    //something has been returned
													//alert(xmlhttp.responseText) // xmlhttp.responseXML
													response_handler(xmlhttp.responseText, xszCSSID)
                                                }
                                                else
                                                {
                                                    //error has occurred
                                                    status_error(xmlhttp.status, xmlhttp.statusText);
                                                }
                                            }
                                        }

         if(xoForm != null)
         {
             for(var i=0; i < xoForm.elements.length; i++)
             {
                  if(xoForm.elements[i].value.length != 0)
                  {
                        if(szURLParams.length > 0)
                        {
                            szURLParams += "&";
                        }

                        szURLParams += xoForm.elements[i].name + "=" + xoForm.elements[i].value;
                  }
             }
             szURLParams += "&";
         }

        // var szFullURL = szURL+'?'+szURLParams;
         /* Send the POST request */
         xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		 //window.navigate(szFullURL);
		xmlhttp.send(szURLParams);
		 //xmlhttp.send("url=" + escape(szFullURL));

    }
    return;
}

function response_handler(xohttp, xszCSSID)
{
	 clear_emement(xszCSSID);
	 var oElement = document.getElementById(xszCSSID);
	 oElement.innerHTML = xohttp;
}

function clear_emement(xszCSSID)
{
    var oElement = document.getElementById(xszCSSID);
    if(oElement) { oElement.innerHTML = ""; }
}
function status_error(status, statusText)
{
	alert(status, statusText);// only for debug.
}