$(document).ready(function() {



/*
    $('#slider').s3Slider({
        timeOut: 5000
    });
*/
        
	
	
/*
$(function() {		
		
	$("#twitter").scrollable({ 
		vertical: true, 
		mousewheel: false,
		items: '.twitter_item',
		circular: true,
		speed: 1000
		}).autoscroll({ 
			autoplay: true,
			interval: 10000 
		});

});	
*/



$(function() {

	// initialize scrollable
	$(".scrollable").scrollable({
		circular: true		
		}).autoscroll({ 
			autoplay: true,
			interval: 5000 
			});

});

$("a.lightbox").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	false
	});
	
$("a.youtube").click(function() {
	$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'width'		: 680,
			'height'		: 495,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			   	 'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});

	return false;
});	

$('#weblog_search').hide();
	
$(function() {

	var form = $("#cerca").bind("click keydown", function() {

		$(this).expose({

			onLoad: function() {
				form.css({
					speed: '100'				
					});
				$('#cerca').css({
					'height': 140
				})	
				$('#weblog_search').show('fast');
			},

			onClose: function() {
				form.css({
				});
				$('#weblog_search').hide('fast');
				$('#cerca').css({
					'height': 100
				})
			}

		});
	});
});

$.tools.validator.localize("it", {
	'*'			: 'Valore non valido',
	':email'  	: 'Email non valida',
	'[required]'	: 'Questo campo è obbligatorio'
});

$('#contact_form').validator({ 
	lang: 'it'
});

});

