var request = [];
function createRequest(i)
{
	request[i]=FactoryXMLHttpRequest();

	if (request[i] == null)
  		alert("Error creating request object!");
	else
		return request[i];
}

function FactoryXMLHttpRequest()
{
	if(window.XMLHttpRequest)
	{
		return new XMLHttpRequest();		
	}
	else if(window.ActiveXObject)
	{
		var msxmls= new Array('Msxml2.XMLHTTP.6.0',
							  'Msxml2.XMLHTTP.5.0',
							  'Msxml2.XMLHTTP.4.0',
							  'Msxml2.XMLHTTP.3.0',
							  'Msxml2.XMLHTTP',
							  'Microsoft.XMLHTTP');
		for(var i=0;i<msxmls.length;i++)
		{
			try {
				return new ActiveXObject(msxmls[i]);
			} catch (e) {
			}
		}
	}
	throw new Error("Could not instantiate XMLHttpRequest");
}

function Response(i)
{	
	if( request[i].readyState == 4 )
	{	
		if( request[i].status == 200 )					
			return true;			
		else
		{
			return false;
			alert( "Error! Request status is " + request[i].status );	
		}
	}
}

