
    var target1 = '#Foto1';
    var target2 = '#Sezione1';
    
    var switchFoto = function(_opts){
        var foto = jQuery('div.Sfondo');
        var fotoTarget = jQuery(_opts.target1);
        
        var li = jQuery('li.Sezione');
        var liTarget = jQuery(_opts.target2);
        
        foto.fadeOut('slow');
        fotoTarget.fadeIn('slow');
        
        li.removeClass('Attivo');
        liTarget.addClass('Attivo');
        
    }

    var sliderFoto = function(){
        var count = target1.slice(-1);
        count = (count % 3)+1;
        target1 = '#Foto'+count;
        target2 = '#Sezione'+count;
        switchFoto({target1: target1, target2: target2});
    }

    


jQuery(document).ready(
  function(){
      switchFoto({target1: target1, target2: target2});
      setInterval(sliderFoto, 6000);
  }
);
