var color_scuola = "#FFFFCC";
var color_sociale = "#FFE3E3";
var color_festival = "#E9F8FF";
var color_archivio = "#E9F8FF";
var color_home = "#E0E0E0";
var color_dicono = "#E0E0E0";
var color_diretta = "#E0E0E0";
var color_photogallery = "#E0E0E0";


var array_data = new Array();
var counter_diapo = 0;
	
function slideOn()
{
	document.getElementById("banner1").innerHTML = array_data[counter_diapo].titolo;
	document.getElementById("banner2").innerHTML = array_data[counter_diapo].testo;
	counter_diapo = (counter_diapo+1) % array_data.length;
	
}

function slideOff()
{
	document.getElementById("banner1").innerHTML = "";
	document.getElementById("banner2").innerHTML = "";	
}

function seleziona_evento(i, clr)
{
	 document.getElementById("evento-"+i).style.backgroundColor = clr;
	 document.getElementById("eventotesto-"+i).style.backgroundColor = clr;
	 document.getElementById("img-"+i).style.visibility = "visible";
}
function deseleziona_evento(i)
{
	 document.getElementById("evento-"+i).style.backgroundColor="#ffffff";
	 document.getElementById("eventotesto-"+i).style.backgroundColor="#ffffff";
	 document.getElementById("img-"+i).style.visibility="hidden";
}
function seleziona_menu(el, col)
{
	el.style.backgroundColor = col;
	el.style.color = "#ffffff";
}
function deseleziona_menu(el, col)
{
	el.style.backgroundColor = col;
	el.style.color = "#000000";		
}

function send_email(url)
{
	http = new cAjax();
	email = document.getElementById('user_email').value;
	if(email != "" && email != "email"){
		params = "action=newsletter&user_email="+email
		http.post(url, params, sent_email);	
	}
}

function sent_email(response)
{
	alert(response);
	document.getElementById("user_email").value="";
}

$(document).ready(function()
{
	$("#footer").hide();
	$("span.bottom").click(function() {
		$("#footer").animate({height: "toggle"}, 500);
	});
	$("#close_footer_button").click(function() {
		$("#footer").animate({height: "toggle"}, 500);
	});
	$('.slideshow').cycle({
		fx: 'fade',
		next: '#next',
		timeout: 5000,
		speed:  1200,
		after: slideOn,
		before: slideOff
	});

});

