﻿    var is_ie = (navigator.userAgent.indexOf('MSIE') >= 0) ? 1 : 0; 
    var is_ie5 = (navigator.appVersion.indexOf("MSIE 5.5")!=-1) ? 1 : 0; 
    var is_opera = ((navigator.userAgent.indexOf("Opera6")!=-1)||
                    (navigator.userAgent.indexOf("Opera/6")!=-1)) ? 1 : 0; 
    var is_netscape = (navigator.userAgent.indexOf('Netscape') >= 0) ? 1 : 0; 
   

    function xmlHttp_Get(xmlhttp, url) 
    { 
        xmlhttp.open('GET', url, false); 
        xmlhttp.send(null); 
    } 

    function GetXmlHttpObject(handler) 
    { 
        var objXmlHttp = null;
        //Create the local xmlHTTP object instance 
        //Create the xmlHttp object depending on the browser 
        if (is_ie)
        { 
            //if not IE default to Msxml2 
            var strObjName = (is_ie5) ? 'Microsoft.XMLHTTP' : 
                                        'Msxml2.XMLHTTP'; 
            //Create the object 
            try
            { 
                objXmlHttp = new ActiveXObject(strObjName); 
                objXmlHttp.onreadystatechange = handler; 
            } 
            catch(e)
            { 
                //Object creation errore 
                alert(e.description); 
                return; 
            } 
        } 
        else if (is_opera)
        { 
            alert('Opera browser'); 
            return; 
        } 
        else
        { 
            // other browsers eg mozilla , netscape and safari 
            objXmlHttp = new XMLHttpRequest(); 
            objXmlHttp.onload = handler; 
            objXmlHttp.onerror = handler; 
        } 
        //Return the instantiated object 
        return objXmlHttp; 
    } 
