﻿function GetXmlHttpWtA() {
    var xmlhttp = false;
    if (window.XMLHttpRequest) {
        xmlhttp = new XMLHttpRequest();
    }
    else if (window.ActiveXObject)// code for IE
    {
        try {
            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            try {
                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (E) {
                xmlhttp = false;
            }
        }
    }
    return xmlhttp;
}

function ajaxGetResponseWtA(url) {
    var xmlhttp = new GetXmlHttpWtA();
    //now we got the XmlHttpRequest object, send the request.
    if (xmlhttp) {
        xmlhttp.open("GET", url, false);
        xmlhttp.send(null);
        return xmlhttp.responseText;
    }
}

function getDataWtA(objName, sURL) {
    $("body").append('<div id="tmpCal" style="visibility:hidden; display:none; height:1px; width:1px;"></div>');
    var response = ajaxGetResponseWtA(sURL);
    $("#tmpCal").html(response);
    var h = $("#tmpCal #" + objName).html();
    $("#tmpCal").remove();
    $("#" + objName).html(h);
}

function openCalEventsWinWtA(sURL, iW, iH) {
    var prop = "width=" + iW + ", height=" + iH + ", copyhistory=0, directories=0, location=0, menubar=0, toolbar=0, resizable=1, scrollbars=1";
    window.open(sURL, "WtAnewsflash", prop);
}
