
 jQuery(document).ready(function() {
  var div_start = $('#player_uno');
  if(div_start.next().length){
   jQuery('div.btn-dx').css('display', 'none');
   jQuery('div.btn-dx-a').css('display', '');
  }
  //jQuery('a.freccia_dx img').css('display', '');
  //if($(this).index() == -1){
	//jQuery('a.freccia_sx img').css('display', 'none');
	//jQuery('a.btn-sx').replaceWith('<div class="btn-sx floatLeft" style="width:15px"><img src="./imgs/freccia-alpha-sx.png" /></div>');
  //}
  
  jQuery("div#content_video_frecce a.freccia_sx").click(function(){
   //jQuery('a.freccia_dx img').css('display', '');
   jQuery('div.btn-dx').css('display', 'none');
   jQuery('div.btn-dx-a').css('display', '');
   div_start = div_start.prev();
   div_next = div_start.next();
   
   if(!div_start.prev().length){
    jQuery('div.btn-sx').css('display', '');
    jQuery('div.btn-sx-a').css('display', 'none');
    div_next.animate({
     opacity: 0.00,
     marginLeft: '0'
    }, 1000, function() {
     // fine animazione
    });
   }   
   
   jQuery('#content_value_linguetta').animate({
    opacity: 0.45,
    bottom: '-=45'
   }, 100, function() {
    // Animation complete.
   });
	
   div_start.animate({
     opacity: 1.00,
     marginLeft: '0'
    }, 1000, function() {
     // fine animazione
     jQuery('#content_value_linguetta').animate({
      opacity: 1.00,
      bottom: '+=45'
     }, 100, function() {
      // Animation complete.
     });
   });
  });
  
  jQuery("div#content_video_frecce a.freccia_dx").click(function(){
   //jQuery('a.freccia_sx img').css('display', '');
   jQuery('div.btn-sx').css('display', 'none');
   jQuery('div.btn-sx-a').css('display', '');
   div_start = div_start.next();
   div_prev = div_start.prev();
   if(!div_start.next().length){
    //jQuery('a.freccia_dx img').css('display', 'none');
    jQuery('div.btn-dx').css('display', '');
    jQuery('div.btn-dx-a').css('display', 'none');
   }
   
   jQuery('#content_value_linguetta').animate({
    opacity: 0.45,
    bottom: '-=45'
   }, 100, function() {
    // Animation complete.
   });
   
   div_prev.animate({
     opacity: 0.00,
     marginLeft: '-600'
    }, 1000, function() {
     // fine animazione
     jQuery('#content_value_linguetta').animate({
      opacity: 1.00,
      bottom: '+=45'
     }, 100, function() {
      // Animation complete.
     });
    });
	
   div_start.animate({
     opacity: 1.00,
     marginLeft: '0'
    }, 1000, function() {
     // fine animazione
    });
	
  });
 });
