function CreateXmlHttpObject()
{
    //Mozilla-based browsers// code for all new browsers,all modern browsers (including IE7
    if(window.XMLHttpRequest)
    {
        request = new XMLHttpRequest();
        return request;
    } 

    else if (window.ActiveXObject)
    {	//In Internet Explorer 5 and 6:
        request=new ActiveXObject("Msxml2.XMLHTTP");
        if (request)
        {
            return request;            
        }
        else if(!request)
        {
            request=new ActiveXObject("Microsoft.XMLHTTP");
            return request;            
            /* Unlikely to branch here, as IE uses will be able to use either one of the constructors*/
        } 
        else 
        {
            alert("Your browser does not permit the use of all of this application's features!");
        }
    } 
    else 
    {
        alert("Your browser does not permit the use of all of this application's features!");
    }
}
