if (typeof(XMLHttpRequest) == "undefined") {
  XMLHttpRequest = function() {
    try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); }
      catch(e) {}
    try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); }
      catch(e) {}
    try { return new ActiveXObject("Msxml2.XMLHTTP"); }
      catch(e) {}
    try { return new ActiveXObject("Microsoft.XMLHTTP"); }
      catch(e) {}
    throw new Error("This browser does not support XMLHttpRequest.");
  };
}

function pushXML(page, xml, okdiv, formdiv)
{

		var xmlhttp =  new XMLHttpRequest();
		
		xmlhttp.open('POST', page, true);
		
		
		xmlhttp.onreadystatechange = function() 
		{
    	if (xmlhttp.readyState == 4) 
    	{
        // Your callback code goes here
        if (xmlhttp.status == 200)
				{
					//debugger;
					//if (xmlhttp.responseXML.length > 0)
					{
					
						//var junk = xmlhttp.responseXML;
						//var errormsg = junk.getElementsByTagName('err').item[0].text;
						//alert(errormsg);
					}
        	$(okdiv).style.display = 'block';
        	$(formdiv).style.display = 'none';
        }
        else
        {
        		//show error div
						$('errDiv').innerHTML = xmlhttp.responseText;
						$('errDiv').style.display = 'block';
						
						$(okdiv).style.display = 'none';
        		$(formdiv).style.display = 'none';
        		//alert("oops got a " +xmlhttp.status);
        }
    	}
		}
		
		//xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(xml);




}
