var is_ie = (navigator.userAgent.indexOf('MSIE') >= 0) ? 1 : 0; 
var is_opera = ((navigator.userAgent.indexOf("Opera 6")!=-1)||(navigator.userAgent.indexOf("Opera/6")!=-1)) ? 1 : 0; 

function GetXmlHttpObject(handler)
{ 
	var objXmlHttp = null;
	if (is_ie)
	{
		// Microsoft
		objXmlHttp = GetMSXmlHttp();
		if (objXmlHttp != null)
		{
			objXmlHttp.onreadystatechange = handler;
		}
	}
	else if (is_opera)
	{ 
		//Opera has some issues with xmlHttp object functionality 
		alert('Opera detected. The page may not behave as expected.'); 
		return; 
	}
	else
	{
		// Mozilla | Netscape | Safari
		objXmlHttp = new XMLHttpRequest();
		if (objXmlHttp != null)
		{
			objXmlHttp.onload = handler;
			objXmlHttp.onerror = handler;
		 }
	} 
	return objXmlHttp; 
} 

function GetMSXmlHttp()
{
	var xmlHttp = null;
	var clsids = ["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0",
				  "Msxml2.XMLHTTP.4.0","Msxml2.XMLHTTP.3.0", 
                  "Msxml2.XMLHTTP.2.6","Microsoft.XMLHTTP.1.0", 
                  "Microsoft.XMLHTTP.1","Microsoft.XMLHTTP"];
    for(var i=0; i<clsids.length && xmlHttp == null; i++)
    {
        xmlHttp = CreateXmlHttp(clsids[i]);
    }
            
    return xmlHttp;
}

function CreateXmlHttp(clsid) 
{
	var xmlHttp = null;
	try
	{
		xmlHttp = new ActiveXObject(clsid);
		lastclsid = clsid;
		return xmlHttp;
	}
	catch(e) {}
 }
        
function SendXmlHttpRequest(xmlhttp, url)
{ 
	xmlhttp.open('GET', url, true); 
	xmlhttp.send(null); 
}



