//js caricato in ogni pagina

function show_user(testata_id, show){
	http.open('get', '/ajax/show_user.php?testata_id='+testata_id+'&show='+show);
	http.onreadystatechange = handleResponse;
	http.send(null);
}

function mod_tag(tag_id, articolo_id, action){
	http.open('get', '/ajax/mod_tag.php?tag_id='+tag_id+'&articolo_id='+articolo_id+'&action='+action);
	http.onreadystatechange = handleResponse;
	http.send(null);
}

function mod_opz_sond(sondaggio_id, opz_id, action, view){
	http.open('get', '/ajax/mod_opz_sond.php?opz_id='+opz_id+'&sondaggio_id='+sondaggio_id+'&action='+action+'&view='+view);
	http.onreadystatechange = handleResponse;
	http.send(null);
}

function show_date(giorno,mese,anno){
	giorno = (giorno < 10) ? '0'+giorno : giorno;
	mese = (mese < 10) ? '0'+mese : mese;
	var data = anno+''+mese+''+giorno;
	http.open('get', '/ajax/show_date_agenda.php?data='+data);
	http.onreadystatechange = handleResponse;
	http.send(null);
}


function change_month(mese,anno){ // usata nel blocco
	http.open('get', '/ajax/change_month_agenda.php?mese='+mese+'&anno='+anno);
	http.onreadystatechange = handleResponse;
	http.send(null);
}
function change_month_calendario(mese,anno){ // usata nella pagina eventi
	http.open('get', '/ajax/change_month_calendario.php?mese='+mese+'&anno='+anno);
	http.onreadystatechange = handleResponse;
	http.send(null);
}

function display(item){
	var div = document.getElementById(item);
	var visible = div.style.display;
	
	if(visible == 'block')
		div.style.display = 'none';
	else
		div.style.display = 'block';
}

/* ajax */
/*
trasformato in jquery ajax
function show_offerte_ad(id, order){
	http.open('get', 'ajax/show_ad.php?id=' + id + '&order=' + order);
	http.onreadystatechange = handleResponse;
	http.send(null);
}
*/
