$(document).ready(function() {

/*<!-- $(".barra_testo").click(function(){
								
	 if($("#aperto_testo").css("height") == '350px' ){
      //$(".aperto_testo").animate( { width:"350px"}, 2000 );
	  $("#aperto_testo").animate({height: '15px'}, {duration: 2000,complete: function() { $('.barra_testo').removeClass('barra_testo_aperta').addClass('barra_testo_chiusa'); } });
	 }
	 else if($("#aperto_testo").css("height") != '0px' ){
	  //$(".aperto_testo").animate( { width:"0px"}, 2000 );	
	  $("#aperto_testo").animate({height: '350px'}, {duration: 2000,complete: function() {
	    $('.barra_testo').removeClass('barra_testo_chiusa').addClass('barra_testo_aperta');
	   }
	  });
	 }
      
	});
});-->*/


 $(".barra_testi").click(function(){apriDIv()});

 setTimeout (function(){apriDIv();}, 5000); 
       
 
});


function apriDIv(){						
	 if($("#aperto_testi").css("width") == '0px' ){
      //$(".aperto_testo").animate( { width:"350px"}, 2000 );
	  $("#aperto_testi").animate({width: '505px'}, {duration: 2000,complete: function() { $('.barra_testi').removeClass('barra_testi_chiusa').addClass('barra_testi_aperta'); } });
}else if($("#aperto_testi").css("width") != '0px' ){
	  //$(".aperto_testo").animate( { width:"0px"}, 2000 );	
	  $("#aperto_testi").animate({width: '0px'}, {duration: 2000,complete: function() {
	    $('.barra_testi').removeClass('barra_testi_aperta').addClass('barra_testi_chiusa');
	   }
});
	 }
      
	}
