$(document).ready(function() {	
        
    // jlightbox      
    $('#prodotto .lightbox').lightBox();
	$('#prodotto .lightbox2').lightBox();						            

    // close the offDiv content sections
	//(doing this with js instead of css means if no js, content is all visible)
    $('.paragrafoSupporto > .testoSupporto').hide();
	// show the correct buttons for each div
    // they are hidden with css for no-js users
    $('.paragrafoSupporto > titoloVerde .showLink').show();
    $('.paragrafoSupporto > titoloVerde .hideLink').hide();
    $('a.showAll').show();
    $('a.hideAll').show();
	
    // show all link
    $('a.showAll').click(function(){
        $('.testoSupporto').slideDown('slow');
        $('.paragrafoSupporto').removeClass().addClass('paragrafoSupporto2');
        $('a.hideAll').show();
        $('a.hideLink').show();
        $('a.showLink').hide();    								
        return false;
    });
    // hide all link
    $('a.hideAll').click(function(){
        $('.testoSupporto').slideUp('slow');
        $('.paragrafoSupporto2').removeClass().addClass('paragrafoSupporto');
        $('a.showLink').show();
        $('a.hideLink').hide();
        $('a.showAll').show();
        return false;
    });
	
     // title is clickable, and toggles the content
    $(".paragrafoSupporto2 >.titoloVerde").click( function() { 
      	$(this).next("div").slideToggle('slow');
    	$(this).parent("div").toggleClass('paragrafoSupporto2');
			$(this).parent("div").toggleClass('paragrafoSupporto');
    	$(this).siblings("a").toggle();
			// $('.paragrafoSupporto2').removeClass().addClass('paragrafoSupporto');
     } );
		 
    $(".paragrafoSupporto >.titoloVerde").click( function() { 
      	$(this).next("div").slideToggle('slow');
    	$(this).parent("div").toggleClass('paragrafoSupporto');
			$(this).parent("div").toggleClass('paragrafoSupporto2');
    	$(this).siblings("a").toggle();

     } );		 
		 
    
	$(".titoloRosso").click( function() { 
      	$(this).next("div").slideToggle('slow');
    	// $(this).parent("div").toggleClass('paragrafoSupporto');
		// $(this).parent("div").toggleClass('paragrafoSupporto');
    	$(this).siblings("a").toggle();
     } );
		
    $('.paragrafoSupporto2 >.titoloVerde').click(function(){
        $('a.hideAll').show();				   
    });
	
    $('.paragrafoSupporto >.titoloVerde').click(function(){
    	$('a.showAll').show();
    }); 
	
	// schiarisce le freccine disattive del paginato
	$('.paginato2 li > img').fadeTo('fast',0.5);
	
});