function apri(pagina) {
	var x = 650;
	var y = 450;
	window.open(pagina,'','width=' + x + ',height=' + y + ',left=' + (window.screen.availWidth-x)/2 + ',top=' + (window.screen.availHeight-y)/2 + ',toolbar=no,menubar=no,resizable=no,scrollbars=yes');
	
}

var XMLHTTP;
function Richiesta(Pagina)
{
    XMLHTTP = RicavaBrowser(CambioStato);
    XMLHTTP.open("GET", "requestDB.asp?pag=" + Pagina, true);
    XMLHTTP.send(null);
}



function CambioStato()
{
    if (XMLHTTP.readyState == 4)
    {
        var R = document.getElementById("content");
        R.innerHTML = XMLHTTP.responseText;
        initLightbox();
    }
}

function RicavaBrowser(QualeBrowser)
{
    if (navigator.userAgent.indexOf("MSIE") != (-1))
    {
        var Classe = "Msxml2.XMLHTTP";
        if (navigator.appVersion.indexOf("MSIE 5.5") != (-1));
        {
            Classe = "Microsoft.XMLHTTP";
        } 
        try
        {
            OggettoXMLHTTP = new ActiveXObject(Classe);
            OggettoXMLHTTP.onreadystatechange = QualeBrowser;
            return OggettoXMLHTTP;
        }
        catch(e)
        {
            alert("Errore: l'ActiveX non verrą eseguito!");
        }
    }
    else if (navigator.userAgent.indexOf("Mozilla") != (-1))
    {
        OggettoXMLHTTP = new XMLHttpRequest();
        OggettoXMLHTTP.onload = QualeBrowser;
        OggettoXMLHTTP.onerror = QualeBrowser;
        return OggettoXMLHTTP;
    }
    else
    {
        alert("L'esempio non funziona con altri browser!");
    }
}
function visualizzaDiv(oggetto){
	if(document.getElementById(oggetto).style.display=="inline"){
		document.getElementById(oggetto).style.display = "none";
	}else{
		document.getElementById(oggetto).style.display = "inline";
	}
}

