// JavaScript Document
function assegnaXMLHttpRequest() {
    var 
 	XHR = null,
 	browserUtente = navigator.userAgent.toUpperCase();
    if (typeof (XMLHttpRequest) === "function" || typeof (XMLHttpRequest) === "object")
        XHR = new XMLHttpRequest();
    else if (window.ActiveXObject && browserUtente.indexOf("MSIE 4") < 0) {
        if (browserUtente.indexOf("MSIE 5") < 0)
            XHR = new ActiveXObject("Msxml2.XMLHTTP");
        else
            XHR = new ActiveXObject("Microsoft.XMLHTTP");
    }
    return XHR;
}
var ajax = assegnaXMLHttpRequest();
function in_sessione(id,stato) {
    //alert('sono in memorizza');//DEBUG
    if (ajax) {
        //alert('mando richiesta');//DEBUG
        ajax.open("post", "MenuMemory.aspx", true);
        ajax.setRequestHeader("content-type", "application/x-www-form-urlencoded");
        ajax.setRequestHeader("connection", "close");
        ajax.send("menu="+id+"&stato="+stato); 
        //ajax.send();
    }
}
ajax.onreadystatechange = function() {
    //alert(ajax.readyState);//DEBUG
    if (ajax.readyState === 4) {
        //mostra_risposta(ajax, 'overlay_testo');
        //mostra_risposta_foto(ajax);
    }
}
