// JavaScript Document
var xmlHttp;
var sIODisplay = "";
var sObjName = "";

function sGetResult(sInputURL, sInputQueryString, sInputDisplay, sDisplayTo){
	var sQueryString = (sInputQueryString != "") ? "?"+sInputQueryString:"";
	var sURL = sInputURL + sQueryString;
	
	sIODisplay = sInputDisplay;
	sObjName = sDisplayTo;
	xmlHttp = oGetXmlHttp(AssignResult);
	xmlHttp.open("GET", sURL, true);
	xmlHttp.send(null);
}

function AssignResult(){
	
	document.getElementById(sIODisplay).innerHTML = "";
	
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete"){
		//document.getElementById(sIODisplay).innerHTML = xmlHttp.responseText;
		var sResponse = xmlHttp.responseText;
	
		DisplayStatus(sResponse);
	}
}

function oGetXmlHttp(oHandler){
	var oXmlHttp = null;
	
	if (navigator.userAgent.indexOf("Opera") >= 0){
		alert("This application doesn't work in Opera!");
		return;
	}
	
	if (navigator.userAgent.indexOf("MSIE") >= 0){ 
		var sXMLName = "Msxml2.XMLHTTP";
		
		if (navigator.appVersion.indexOf("MSIE 5.5") >= 0){
			sXMLName = "Microsoft.XMLHTTP";
		}
		
		try{ 
			oXmlHttp = new ActiveXObject(sXMLName);
			oXmlHttp.onreadystatechange = oHandler;
			
			return oXmlHttp;
		}catch(e){ 
			alert("Error! Scripting for ActiveX might be disabled.");
			return;
		} 
	}
	
	if (navigator.userAgent.indexOf("Mozilla") >= 0){
		oXmlHttp = new XMLHttpRequest();
		oXmlHttp.onload = oHandler;
		oXmlHttp.onerror = oHandler;
		return oXmlHttp;
	}
}

