function cycleFwd(section, timeout, i) {
	if (i === undefined) i = 0;
	$("#slideshow ul." + section).css('left', i + 'px').animate({opacity:1}, timeout, function() {
		j = i - 2;
		if (section == 'first') {
			if (i > -880) cycleFwd(section, timeout, j); else cycleFwd('second', timeout, 0);
		} else {
			if (i > -880) cycleFwd(section, timeout, j); else cycleRwd('first', timeout, j);
		}
	});
}

function cycleRwd(section, timeout, i) {
	if (i === undefined) i = 0;
	$("#slideshow ul." + section).css('left', i + 'px').animate({opacity:1}, timeout, function() {
		j = i + 2;
		if (section == 'first') {
			if (i < 0) cycleRwd(section, timeout, j); else cycleRwd('second', timeout, -880);
		} else {
			if (i < 0) cycleRwd(section, timeout, j); else cycleFwd('first', timeout, j);
		}
	});
}

$(document).ready(function() {
	clock_refresh();
	cycleFwd('first', 20);
	$('#newsticker').cycle({
		fx:			'turnDown',
		speed:		1000,
		timeout:	4000
	});
	$("dl.accordionActive dd");
	$("dl.accordion dd").hide();
	$("dl.accordion dd.start").show();
	$("dl.accordion dt span").click(function() {
		$("dl.accordion dd:visible").slideUp("slow").prev().removeClass("open");
		$(this).parent().next().slideDown("slow").prev().addClass("open");
		return false;
	});
});

address = 'Ordine APPC di Venezia<br />Isola del Tronchetto, 14<br />30135 Venezia';

function clock_refresh() {
	Data = new Date();
	Giorno = Data.getDate();
	Mese = Data.getMonth() + 1;
	if (window.ActiveXObject) { // IE
		Anno = Data.getYear();
	} else {
		Anno = Data.getYear() + 1900;
	}
	Datario = Data.toGMTString();
	Ore = Data.getHours();
	Minuti = Data.getMinutes();
	Secondi = Data.getSeconds();
	if (Ore < 10) Ore = "0" + Ore;
	if (Minuti < 10) Minuti = "0" + Minuti;
	if (Secondi < 10) Secondi = "0" + Secondi;
	if (Giorno < 10) Giorno = "0" + Giorno;
	if (Mese < 10) Mese = "0" + Mese;
	cal = Giorno + "/" + Mese + "/" + Anno + " - " + Ore + ":" + Minuti + ":" + Secondi;
	document.getElementById('clock').innerHTML = cal;
}

clock = setInterval("clock_refresh();",1000);