/* chiamate javascript attivazione processi ajax */

$(window).load(function() {
   $('#slider').nivoSlider({
        effect:'sliceUpDown', //Specify sets like: 'fold,fade,sliceDown, sliceDownLeft, sliceUp, sliceUpLeft, sliceUpDown, sliceUpDownLeft' 
        slices:17,
        animSpeed:700,
        pauseTime:9000,
        startSlide:0, //Set starting Slide (0 index)
        directionNav:false, //Next & Prev
        directionNavHide:false, //Only show on hover
        controlNav:false, //1,2,3...
        controlNavThumbs:true, //Use thumbnails for Control Nav
        controlNavThumbsFromRel:true, //Use image rel for thumbs
        controlNavThumbsSearch: '.jpg', //Replace this with...
        controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
        keyboardNav:true, //Use left & right arrows
        pauseOnHover:true, //Stop animation while hovering
        manualAdvance:false, //Force manual transitions
        captionOpacity:8, //Universal caption opacity
        beforeChange: function(){},
        afterChange: function(){},
        slideshowEnd: function(){} //Triggers after all slides have been shown
    });
});

$(document).ready(function () {

	$('.menu a').hover(function(){$(this).stop().animate({paddingTop:'51px'}, 200,'easeInBack').animate({paddingTop:'32px', paddingBottom:'36px'}, 200, 'easeOutExpo')}, function(){$(this).stop().animate({paddingTop:'51px'}, 200,'easeInBack').animate({paddingTop:'32px', paddingBottom:'27px'}, 200, 'easeOutExpo')});

    $('.slideshow').cycle({

		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...

	});

    $.backstretch("winter.jpg");
    // array img 
    var images = [
            "winter1.jpg",
            "winter2.jpg",
            "winter3.jpg"
        ];

    var index = 0;
    $.backstretch(images[index], { speed: 5000 });

    setInterval(function () {
      index = (index >= images.length - 1) ? 0 : index + 1;
     $.backstretch(images[index]);
    }, 8000);	    
	    

});
