﻿
function GetPageCont(url)
{
    var rtn = "err";
    var XmlHttp = new ActiveXObject("Msxml2.XMLHTTP")
    XmlHttp.Open("POST", url, false );
    XmlHttp.Send();
    if (XmlHttp.status == 200) rtn = XmlHttp.responseText;
    return rtn;
}
function GetPageContAjax(url,callback)
{    
    var XHR;	    
    try
    {
	    try{
		    XHR = new ActiveXObject("Microsoft.XMLHTTP");
	    }catch(e){
			try{
				  XHR = new XMLHttpRequest();
			  }catch (e){ }
	    }
	    XHR.open("POST",url);
	    XHR.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	    XHR.onreadystatechange = function(){
		    if(XHR.readyState==4)
		    {
			    if(XHR.status==200)
			    {
				    if(callback) callback(XHR.responseText);
			    }
		    }
	    }
	    XHR.send();
    }
    catch (e)
    {
	    alert(e.toString());
    }
}
function GetPageContAjaxGuid(url, guid, callback) {
    var XHR;
    try {
        try {
            XHR = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (e) {
            try {
                XHR = new XMLHttpRequest();
            } catch (e) { }
        }
        XHR.open("POST", url);
        XHR.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
        XHR.onreadystatechange = function() {
            if (XHR.readyState == 4) {
                if (XHR.status == 200) {
                    if (callback) callback(guid, XHR.responseText);
                }
            }
        }
        XHR.send();
    }
    catch (e) {
        alert(e.toString());
    }
}
