
function createXHR(){
    var xhr = null;
    try{
        //W3C
        xhr = new XMLHttpRequest();
    }catch(e){
        try{
            //IE6+.
            xhr = new ActiveXObject("Msxml2.XMLHTTP");
        }catch (exIE6){
            //IE5.
            try{
                xhr = new ActiveXObject("Microsoft.XMLHTTP");
            }catch (exIE5){}
        }
    }
    return xhr;
}


function AjaxRequest(action,p,v){
    var xhr = new createXHR();
    xhr.open('GET', './AjaxServer.aspx?action='+action + '&' + p + '=' + v, true);
    xhr.onreadystatechange = function (){
            if (xhr.readyState == 4 && xhr.status == 200){
                if (xhr.responseText=="") return;
                eval(xhr.responseText);
            }
        };
    xhr.setRequestHeader('If-Modified-Since', 'Thu, 1 Jan 1970 00:00:00 GMT');
    xhr.setRequestHeader('Cache-Control', 'no-cache');
    xhr.send(null);
}

