/*
'*********************************************************************************************
'**	Creates and XMLHttpRequest object to do Server Side Calls								**
'*********************************************************************************************
*/

function GetXMLHTTP()
{
	var doc = null;
	try
	{
		doc = new ActiveXObject("Msxml2.XMLHTTP");
		//doc = new ActiveXObject("Microsoft.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			doc = new ActiveXObject("Microsoft.XMLHTTP");
		} catch(oc){
			doc = null;
		}
	}
	if(!doc && typeof XMLHttpRequest != "undefined") {
		doc = new XMLHttpRequest();
	}
	return doc;
}

function GetSource(RequestURL, strProcess)
{
	var arr, str, obj;
	
	if (RequestURL != "")
	{
		obj = GetXMLHTTP();
		if(obj != null)
		{
			obj.open("POST", RequestURL, false);
			obj.send("");
				
			if (obj.readyState == 4)
			{
			
				if (obj.status == 200)
				{
					//alert(obj.responseText);
					return obj.responseText;
					
				}
				else
				{
					//alert("There was a problem retrieving the data:\n");
					
				}
			}
		}
		obj = null;
	}		
return false;
}

var objReq;
function GetSource2(RequestURL, strProcess)
{
	var arr, str;
	
	if (RequestURL != "")
	{
		objReq = GetXMLHTTP();
		if(objReq != null)
		{
		    objReq.onreadystatechange = processReqChange;
			objReq.open("GET", RequestURL, true);
			objReq.send("");
				
			
		}
		//obj = null;
	}		
return false;
}

function processReqChange() {
    if (objReq.readyState == 4)
	{
	    alert(objReq.responseText);
		if (objReq.status == 200)
		{
			//alert(obj.responseText);
			return objReq.responseText;
			
		}
		else
		{
			//alert("There was a problem retrieving the data:\n");
			
		}
	}
}
