var suGiu=0;

$(document).ready(
function ()
{
$('#linkA').click(
function() {
if(suGiu==0){
$('#linkB').slideDown(900);
suGiu=1;
}
else {
$('#linkB').slideUp(900);
suGiu=0;
}
}
);
}
);


function getHTTPObject() {
var xmlhttp;
/*@cc_on
@if (@_jscript_version >= 5)
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
@else
xmlhttp = false;
@end @*/
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
try {
xmlhttp = new XMLHttpRequest();
} catch (e) {
xmlhttp = false;
}
}
return xmlhttp;
}
var http = getHTTPObject(); // We create the HTTP Object

var isWorking = false;

// visualizzazione archivi
function mostraArchivio2(){
if (http.readyState == 4) {
if (http.responseText.indexOf('invalid') == -1) {
results = http.responseText;
} 
document.getElementById('centrale').innerHTML = results;
isWorking = false;
}
}

var isWorking = false;
function mostraArchivio1(tipoArchivio) {
if (!isWorking && http) {
var url = "archivi.php?tipo="+tipoArchivio;
window.alert(url);
http.open("GET", url, true);
http.onreadystatechange = mostraArchivio2;
isWorking = true;
http.send(null);
}
}

// creazione news home page
function homeNews2(){
if (http.readyState == 4) {
if (http.responseText.indexOf('invalid') == -1) {
results = http.responseText;
} 
document.getElementById('centrale').innerHTML = results;
/* window.alert(results); */
isWorking = false;
}
}


function homeNews1() {
if (!isWorking && http) {
var url = "testi_homeNews.php";
/* window.alert(url); */
http.open("GET", url, true);
http.onreadystatechange = homeNews2;
isWorking = true;
http.send(null);
}
}

// visualizzazione calendari
function mostraCalendario2(){
if (http.readyState == 4) {
if (http.responseText.indexOf('invalid') == -1) {
results = http.responseText;
} 
document.getElementById('centrale').innerHTML = results;
isWorking = false;
}
}

var isWorking = false;
function mostraCalendario1(tipoEvento) {
if (!isWorking && http) {
var url = "eventi.php?tipo="+tipoEvento;
/* window.alert(url); */
http.open("GET", url, true);
http.onreadystatechange = mostraCalendario2;
isWorking = true;
http.send(null);
}
}
