// JavaScript Document



function changeColor(hex) {

		$('ul.idTabs li a').hover(function(){

			$(this).css('backgroundColor', '#' + hex);

		},function(){

			return false;

		});

	$('.bg-color, ul.idTabs li a.selected').css('backgroundColor', '#' + hex);

	$('.color, .box-texts a').css('color', '#' + hex);

	$.cookie("bg-color", hex);

}



$(document).ready(function() {

	$('div.contattaci').click(function(){

		$('#contattaci').toggle();

	});

	$('div.richiama').click(function(){

		$('#richiama').toggle();

	});

	

	$(function() {

		// Use this example, or...

		$('a[@rel*=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel

		// This, or...

	});

	

	$('#colorpicker').ColorPicker({

 		color: $.cookie("bg-color"),

		onShow: function (colpkr) {

			$(colpkr).fadeIn(500);

			return false;

		},

		onHide: function (colpkr) {

			$(colpkr).fadeOut(500);

			return false;

		},

		onChange: function (hsb, hex, rgb) {

			changeColor(hex);

		}

	});

	

	$('#colorpicker-reset').click(function(){

		changeColor('ff6600');

	});
	
	$('.titolopassaggio').click(function(){
		$(this).siblings().toggle("slow");
	});

});



