$(document).ready(function () {

	$(".scrollable").scrollable({
		clickable: false,
		loop: true,
		size: 1,
		speed: 1200
	}).navigator().autoscroll();
	
	if ($.browser.mozilla) {
		$('h2.title').css('padding', '13px 0 13px 25px');
	}

	$('#mainNav ul li:last-child').addClass('last-child');

   	$("#searchValue").focus(function() { 
        if ($(this).val() == 'cerca nel sito...') $(this).val(''); 
    });

    $("#searchValue").blur(function() { 
        if ($(this).val() == '') $(this).val('cerca nel sito...'); 
    });	

	$.facebox.settings.opacity  = 0.8; 
	$('a[rel="facebox"]').facebox(); 

});

// function slideShow(speed) {  
// 
//     $('#photos ul').append('<li id="slideshow-caption" class="caption"><div class="slideshow-caption-container"><h3></h3><p></p></div></li>');  
//     $('#photos ul li').css({opacity: 0.0});  
//     $('#photos ul li:first').css({opacity: 1.0});  
//     $('#slideshow-caption p').html($('#photos ul a:first').find('img').attr('alt'));  
//     $('#slideshow-caption').css({opacity:1});  
// 
//     var timer = setInterval('gallery()',speed);  
// 
//     $('#photos ul').hover(  
//         function () {  
//             clearInterval(timer);     
//         },    
//         function () {  
//             timer = setInterval('gallery()',speed);           
//         }  
//     );  
// 
// }  
// 
// function gallery() {  
// 
//     var current = ($('#photos ul li.show')?  $('#photos ul li.show') : $('#photos ul li:first'));  
//     var next = ((current.next().length) ? ((current.next().attr('id') == 'slideshow-caption')? $('#photos ul li:first') :current.next()) : $('#photos ul li:first'));  
//     var title = next.find('img').attr('title');   
//     var desc = next.find('img').attr('alt');      
// 
//     //Set the fade in effect for the next image, show class has higher z-index  
//     next.css({opacity: 0.0}).addClass('show').animate({opacity: 1.0}, 1000);  
// 
//     //Hide the caption first, and then set and display the caption  
//     // $('#slideshow-caption').animate({bottom:-70}, 300, function () {  
//     //       //Display the content  
//           $('#slideshow-caption h3').html(title);  
//           $('#slideshow-caption p').html(desc);                 
//           $('#slideshow-caption').animate({bottom:0}, 500);     
//     // });       
// 
//     //Hide the current image  
//     current.animate({opacity: 0.0}, 1000).removeClass('show');  
// 
// }