﻿
function CreateXMLHttps()
{
    var ajaxObj = null;
    try
    {
        ajaxObj = new ActiveXObject("MSXML2.XMLHTTP");
    }
    catch(e)
    {
        try
        {
            ajaxObj  = new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch(e)
        {
            ajaxObj = null;
        }
    }
    if(ajaxObj == null && typeof("XMLHttpRequest") != "undefined")
    {
        ajaxObj = new XMLHttpRequest();
    }
    return ajaxObj;
}


function PostXMLHttpReq(serverUrl,postData)
{
    var xmlhttp = CreateXMLHttps();
    xmlhttp.open("POST",serverUrl,false);
    xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlhttp.send(postData);
    return xmlhttp.responseText;
}



function GetXMLHttpReq(serverUrl,postData)
{
    var xmlhttp = CreateXMLHttps();
    xmlhttp.open("GET",serverUrl,false);
    xmlhttp.setRequestHeader("Content-type","text/html");
    xmlhttp.send(postData);
    return xmlhttp.responseText;
}
