﻿function InitializeAjax()
    {
    var ajaxRequest;  // The variable that makes Ajax possible!

    try
    {
        // Opera 8.0+, Firefox, Safari
		
        ajaxRequest = new XMLHttpRequest();
		//alert('0');
    } 
    catch (e)
    {
		
        // Internet Explorer Browsers
        try
        {
			//alert('1');
            ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
			
        } 
//        try
//        {
//            ajaxRequest = new ActiveXObject("XMLHTTP");
//        }
        catch (e) 
        {
    		
            try
            {
            //alert('2');
	            ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
				
            } 
            catch (e)
            {
				try
				{
				//alert('3');
					ajaxRequest = new ActiveXObject("MSXML2.XMLHTTP.3.0");
					
				}
				catch (e)
				{
				ajaxRequest = new ActiveXObject("MSXML2.XMLHTTP.3.0");
					//alert("Your browser broke!");	      
					return false;
				}
	            // Something went wrong
	            //alert("Your browser broke!");	            	            
            }
        }
    }
    return ajaxRequest;
}