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);
}

//semplice show/hide del primo div sotto la classe btSh
function setSH() {

	var myElements = '.btSh';

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

		$(this).click(function() {

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

	});

}

function setTbRicSh(pId, pBt) {

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

	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() {

	// SHOWHIDE
	setSH();

	// AZIONI SPECIFICHE PER IE6
	if($.browser.msie) {
		if(jQuery.browser.version == '6.0') {
			$('#riqTopEmotionDx').css('display', 'inline');
			$('#footer').css('border-top', '0');

		}
	}

	// FADE DELLE IMMAGINI EMOZIONALI
	$('#riqSlide').cycle({
		fx: 'fade',
		delay: -3000,
		sync: 1,
		timeout: 4000,
		width: 436,
		height: 325
	});

	// CLICK SULLE IMMAGINI EMOZIONALI
	$('#riqSlide img').click(function() {
		document.location.href='fondi_fotografici.php';
	});

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

});
