var spkahah_pre = "<img src=\"/calendario_eventi/load.gif\" style=\"vertical-align:middle\" alt=\"Caricamento in corso\" />" + "<strong style=\"font-family:tahoma;font-size:9px;\"> Caricamento in corso...</strong>";
var spkahah_error404 = "<img src=\"/calendario_eventi/error.gif\" style=\"vertical-align:middle\" alt=\"ERRORE\" />" + "<strong style=\"font-family:tahoma;font-size:9px;\"> Errore 404: la pagina non esiste</strong>";
var spkahah_error500 = "<img src=\"/calendario_eventi/error.gif\" style=\"vertical-align:middle\" alt=\"ERRORE\" />" + "<strong style=\"font-family:tahoma;font-size:9px;\"> Errore 500: la pagina ha generato un errore interno</strong>";
var spkahah_errorXXX = "<img src=\"/calendario_eventi/error.gif\" style=\"vertical-align:middle\" alt=\"ERRORE\" />" + "<strong style=\"font-family:tahoma;font-size:9px;\"> Errore Indefinito: la pagina ha generato un errore indefinito</strong>";

function spkahah_load(url,idLayer,postdata)
{
d = document;
if (d.getElementById) {var x=(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();}
if (x) {
d.getElementById(idLayer).innerHTML = spkahah_pre;
x.onreadystatechange = function() {
if (x.readyState == 4)
{
if (x.status == 200) { d.getElementById(idLayer).innerHTML = x.responseText; }
else if (x.status == 404) { d.getElementById(idLayer).innerHTML = spkahah_error404;}
else if (x.status == 500) { d.getElementById(idLayer).innerHTML = spkahah_error500;}
else { d.getElementById(idLayer).innerHTML = spkahah_errorXXX;}
}
}
if (postdata != "" && postdata != null) {
x.open("POST", url, true);
x.setRequestHeader("Content-type","application/x-www-form-urlencoded");
x.setRequestHeader("Connection","close");
x.send(postdata);
} else {
x.open("GET", url, true);
x.send(null);
}
}
}
