var xmlhttp1 = false;
try {
	xmlhttp1 = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
	try {
		xmlhttp1 = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (E) {
	xmlhttp1 = false;
	}
}
	if (!xmlhttp1 && typeof XMLHttpRequest != 'undefined') {
		xmlhttp1 = new XMLHttpRequest();
}
var xmlhttp2 = false;
try {
	xmlhttp2 = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
	try {
		xmlhttp2 = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (E) {
	xmlhttp2 = false;
	}
}
	if (!xmlhttp2 && typeof XMLHttpRequest != 'undefined') {
		xmlhttp2 = new XMLHttpRequest();
}
function makerequest(serverPage, objID, abut, ibut1, ibut2, ibut3, ibut4, ibut5, ibut6, ibut7, ibut8, ibut9, ibut10) {
	var obj = document.getElementById(objID);	
	document.getElementById(abut).className = "active_item";
	document.getElementById(ibut1).className = "inactive_item";
	document.getElementById(ibut2).className = "inactive_item";
	document.getElementById(ibut3).className = "inactive_item";
	document.getElementById(ibut4).className = "inactive_item";
	document.getElementById(ibut5).className = "inactive_item";
	document.getElementById(ibut6).className = "inactive_item";
	document.getElementById(ibut7).className = "inactive_item";
	document.getElementById(ibut8).className = "inactive_item";
	document.getElementById(ibut9).className = "inactive_item";
	document.getElementById(ibut10).className = "inactive_item";

	xmlhttp1.open("GET", serverPage);
	xmlhttp1.onreadystatechange = function() {
		if (xmlhttp1.readyState == 1) {
			obj.innerHTML = "<div align = 'center' class='table_text'>Loading<br><img src='images/loading.gif' width='24' height='24'></img></br></div>";
		} else
		if (xmlhttp1.readyState == 4 && xmlhttp1.status == 200) {
			obj.innerHTML = xmlhttp1.responseText;			
		}
	}
	xmlhttp1.send(null);	
}
function makerequest2(serverPage, objID) {
	var obj = document.getElementById(objID);	
	xmlhttp1.open("GET", serverPage);
	xmlhttp1.onreadystatechange = function() {
		if (xmlhttp1.readyState == 1) {
			obj.innerHTML = "<div align = 'center' class='table_text'>Loading<br><img src='images/loading.gif' width='24' height='24'></img></br></div>";
		} else
		if (xmlhttp1.readyState == 4 && xmlhttp1.status == 200) {
			obj.innerHTML = xmlhttp1.responseText;			
		}
	}
	xmlhttp1.send(null);	
}
function OnSubmitForm(serverPage, response) {
  var obj = document.getElementById(response);
  xmlhttp1.open("GET", serverPage);
	xmlhttp1.onreadystatechange = function() {
		if (xmlhttp1.readyState == 1) {
			obj.innerHTML = "Sending Data...";
		} else
		if (xmlhttp1.readyState == 4 && xmlhttp1.status == 200) {
			obj.innerHTML = xmlhttp1.responseText;			
		}
	}
	xmlhttp1.send(null);	
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0  
  var target_anim = selObj.options[selObj.selectedIndex].value;  
  var obj = document.getElementById('main_body');
  xmlhttp1.open("GET", target_anim);
	xmlhttp1.onreadystatechange = function() {
		if (xmlhttp1.readyState == 1) {
			obj.innerHTML = "<div align = 'center' class='table_text'>Loading<br><img src='images/loading.gif' width='24' height='24'></img></br></div>";
		} else
		if (xmlhttp1.readyState == 4 && xmlhttp1.status == 200) {
			obj.innerHTML = xmlhttp1.responseText;			
		}
	}
	xmlhttp1.send(null);  
}
function sendMail() {
	
}
function deleteReport(id) {
	var obj = document.getElementById('response' + id);	
	xmlhttp1.open("GET", "deleteReport.php?id=" + id);
	xmlhttp1.onreadystatechange = function() {
		if (xmlhttp1.readyState == 1) {
			obj.innerHTML = "WAIT...";
		} else
		if (xmlhttp1.readyState == 4 && xmlhttp1.status == 200) {
			obj.innerHTML = xmlhttp1.responseText;			
		}
	}
	xmlhttp1.send(null);	

}