﻿// AJAX

var xhr = null;

function GetAjax()
{
    if (xhr) return xhr;
    return createXMLHttpRequest();
}

// create and return a XmlHttpRequest object
function createXMLHttpRequest() {
    try { xhr = new ActiveXObject("Msxml2.XMLHTTP"); return xhr; } catch (e) {}
    try { xhr = new ActiveXObject("Microsoft.XMLHTTP"); return xhr; } catch (e) {}
    try { xhr = new XMLHttpRequest(); return xhr; } catch(e) {}
    alert("XMLHttpRequest not supported");
    return null;
}



// invoke an ajax method
function callAjaxMethod()
{
    var ajax = createXMLHttpRequest();
    if (!ajax) return;
}
