// JavaScript Document
// creating http object to handle ajax
function getHTTPObject() {
  var xmlhttp;
 
  if(window.XMLHttpRequest){
    xmlhttp = new XMLHttpRequest();
  }
  else if (window.ActiveXObject){
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    if (!xmlhttp){
        xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
    
}
  return xmlhttp;

  
}


var http = getHTTPObject(); // We create the HTTP Object

function report_closed(business_id,city,state,zip)
{
		url="/close_report.php?business_id="+business_id+"&city="+city+"&state="+state+"&zip="+zip;
		var temp=new Array();
			http.open("GET", url, true);
			http.onreadystatechange = function() {
				if (http.readyState == 4) {
				  if(http.status==200) {
			  		var results=http.responseText;
					if(results==1){
						alert("Closed report has been sent. Please allow 24-72 hours for completion of this request.");
						document.getElementById(business_id).style.display="none";
						return false;
					}
					//document.getElementById("divChildCat").innerHTML = results;
					
				  } 
  				}
			};
			http.send(null);
}