//-----------------------INIZIO BOTTONI gallery home listino---------------------------//
function boxMenuGallery3(){	
	$(".qrttv-Menu .cont-img:not(:first)").hide();
	$(".qrt-Acc .panel-body:not(:first)").hide();
	$(".qrt-Acc .panel-head a:first").addClass("btn_gallery_active");
	$(".qrt-Acc .panel-head a:first").removeClass("btn_gallery_normal");
	$('.btn_gallery a').click(function() {
	  var id = jQuery(this).attr('id');
	  $('.btn_gallery a.btn_gallery_active').addClass("btn_gallery_normal").removeClass("btn_gallery_active");
      $(this).addClass("btn_gallery_active").removeClass("btn_gallery_normal");
	  $(".panel-body").slideUp("slow");
	  $(".qrttv-Menu").find(".cont-img").hide();
	  $('#box-'+id).slideDown("slow");
	  $(".qrttv-Menu").find('#cont-'+id).show();
	  //alert ('#cont-'+id)
		}, function () {
			var id = jQuery(this).attr('id');
	  $(".panel-body").slideUp("slow");
	  $(".qrttv-Menu").find('#cont-'+id).hide();
	   $('#box-'+id).slideDown("slow");
	   $(".qrttv-Menu").find('#cont-'+id).show();
	   //alert ('secondo #cont-'+id);
	   $(this).addClass("btn_gallery_normal").removeClass("btn_gallery_active"); 
	});
};

//-----------------------inizio function crea immagine big Gallery scroll verticale --------// 
function galleryImg() {

$("#box-panel01 .items a").click(function(event) {
	event.preventDefault();
	// calclulate large image's URL based on the thumbnail URL (flickr specific)
	var url = $(this).attr("href");
	var urlA = $(this).attr("rel");
	var title = $(this).attr("title");

	// get handle to element that wraps the image and make it semitransparent
	var wrap = $("#cont-panel01").fadeTo("medium", 0.8);

	// the large image from flickr
	var img = new Image();

	// call this function after it's loaded
	img.onload = function() {

		// make wrapper fully visible
		wrap.fadeTo("fast", 1);

		// change the image
		wrap.find("img").attr("src", url).attr("alt", title);
		// change the a
		wrap.find("a#gall01").attr("href", urlA).attr("title", title);
	};

	// begin loading the image from flickr
	img.src = url;

// when page loads simulate a "click" on the first image
}).filter(":first").click();

// panel video

$("#box-panel02 .items a").click(function(event) {
	event.preventDefault();
	// calclulate large image's URL based on the thumbnail URL (flickr specific)
	var url = $(this).attr("href");
	var urlA = $(this).attr("rel");
	var title = $(this).attr("title");

	// get handle to element that wraps the image and make it semitransparent
	var wrap = $("#cont-panel02").fadeTo("medium", 0.8);

	// the large image from flickr
	var img = new Image();

	// call this function after it's loaded
	img.onload = function() {

		// make wrapper fully visible
		wrap.fadeTo("fast", 1);

		// change the image
		wrap.find("img").attr("src", url);
		// change the a
		wrap.find("a#video02").attr("href", urlA).attr("title", title);
	};

	// begin loading the image from flickr
	img.src = url;

// when page loads simulate a "click" on the first image
}).filter(":first").click();
};

//-----------------------inizio function lightbox --------// 
function lightboxImg() {
$("#cont-panel01 a").overlay({

	// each trigger uses the same overlay with id "gallery"
	target: '#gallery',

	// optional exposing effect with custom color
	expose: '#333',

	// clicking outside the overlay does not close it
	closeOnClick: true

// gallery plugin
}).gallery({ 
 
    // the plugin accepts its own set of configuration options 
    speed: 800
});

$("#cont-panel02 a").overlay({

	// each trigger uses the same overlay with id "gallery"
	target: '#gallery2',

	// optional exposing effect with custom color
	expose: '#333',

	// clicking outside the overlay does not close it
	closeOnClick: true

// gallery plugin
}).gallery({ 
 
    // the plugin accepts its own set of configuration options 
    speed: 800
});
};
