// aprire pop-up
function apriPop(url, name, w, h) {
	var l = Math.floor((screen.width-w)/3);
	var t = Math.floor((screen.height-h)/3);
	window.open(url,name,"width=" + w + ",height=" + h + ",top=" + t + ",left=" + l);
}

// automazione per show/hide
function setSH() {

	var myElements = ".btSh";

	$(myElements).each(function(i) {

		$(this).click(function() {

			if($(this).next('div').css('display') == 'none')
				$(this).next('div').show('slow');
			else
				$(this).next('div').hide('slow');
		});

	});

}

// funzione per i click sui numeri di pagina : visualizza / nasconde le schede
function settbPagSh(pId, pBt) {

	// per visualizzare le schede
	var myElements = ".tbPagSh";

	var myId = '#'+pId;

	$(myElements).each(function(i) {
		$(this).hide('fast');
	});

	$(myId).show('slow');

	// per colorare il numero di pagine sel
	var myElements = ".pageNum";

	var myId = '#'+pBt;

	$(myElements).each(function(i) {
		$(this).removeClass('rosso');
	});

	$(myId).addClass('rosso');

}


$(document).ready(function() {

	setSH();

	//setupZoom();

	// SPECIFICHE PER IE6
	if($.browser.msie) {
		if(jQuery.browser.version == '6.0') {

		}
	}

	// FancyBox
	$("a.gallery").fancybox();

	// FADE DELLE IMMAGINI IN SLIDE
	$('#imgSlide').cycle({
		fx: 'fade',
		delay: -1000,
		sync: 1,
		timeout: 6000,
		speedIn: 3000,
		speedOut: 3000,
		width: 887,
		height: 398
	});


});
