$(document).ready(function(){
    
	/*$(function() {
            $('.galleryNews ul li  a').lightBox(); 
    });*/

	$(".contenutoGallery a span.immagine img").click(function(){
         location.href = $(this).parent().parent().attr("href"); return false;
      });
	

	$(".contenitoreGallery div.scrollable").scrollable({
		size: 4,
		clickable: false
	}).mousewheel();

	
	$(".galleria div.scrollable").scrollable({
		size: 1
	}).mousewheel();


	$(".galleria .prev").click(function() {
		return false;
	});

	$(".galleria .next").click(function() {
		return false;
	});
	
	
	$('.listaThumbLavoro li a').hover(function() {
		$(this).find("span").css('display','none');
		$("#thumbsTitle").html($(this).find('img').attr('alt'));
	}, function() {
        $(this).find("span").css('display','block');
    });


	$('#gallery').hover(function() {
		$(this).find("div").addClass('png_bg');
	});

	
	$('.foto-home').innerfade({
		speed: 'slow',
		timeout: 3000,
		type: 'sequence',
		containerheight: '450px'
	});		
	
	$('a.cambia-colore').click(function () {
		var COOKIE_NAME = 'colore_bonorandi';
		var options = { path: '/', expires: 365 };
                
		$.cookie(COOKIE_NAME, $(this).attr('rel'), options);

		$('body').animate({backgroundColor: $(this).attr('rel')}, "slow");
		
		return false;
	});
	
});

function conferma(MESSAGGIO, URL){
	if(confirm(MESSAGGIO)) location.href = URL;
}