	/*____________________CAROSELLO HOME PAGE VERTICALE_________________*/
		//Spazio tra ogni slide
		var slideshowgap_lv=0;
		
		if ($.browser.msie) {
		  slideshowgap_lv=10;
		}
		
		var actualheight_lv=0;
		var content_slide_lv, ns_slide_lv, content_slide2_lv,bottomtime_lv,toptime_lv;
		//Velocita' dello slider (slow 1-10 fast) 
		var slidespeed=1;
		var copyspeed=slidespeed;
		//Larghezza contenitore slider
		var sliderwidth_lv="290px";
		//Altezza slider
		var imgheight="77px";
		var sliderheight_lv= 286;
		var bottom_pos_lv = 0;
		var bottom_pos_2_lv = 30;
		var top_pos_lv = 0;
		var top_pos_2_lv = 0;
        var direction_car_lv = 0;
		//Margin
		var margin="45px";
		
		function avvia_slidetop_lv(){
			clearInterval(bottomtime_lv);
			var calcolo_pos = (actualheight_lv+top_pos_lv)*(-1);
			var calcolo_pos_2 = (actualheight_lv+top_pos_2_lv)*(-1);
			$('#test4').attr("style", "top:"+calcolo_pos+"px");
			$('#test6').attr("style", "top:"+calcolo_pos_2+"px");
			toptime_lv=setInterval("slideleft_lv()",30);
			direction_car_lv = 0;
		}

		function slideleft_lv(){
				if (parseInt(content_slide_lv.style.top)>(actualheight_lv*(-1)+8)){
					bottom_pos_lv=parseInt(content_slide_lv.style.top)-copyspeed;
					content_slide_lv.style.top=bottom_pos_lv+"px";
				}
				else{
					bottom_pos_lv=parseInt(content_slide2_lv.style.top)+actualheight_lv+slideshowgap_lv;
					content_slide_lv.style.top=bottom_pos_lv+"px";
				}
				
				if (parseInt(content_slide2_lv.style.top)>(actualheight_lv*(-1)+8)){
					bottom_pos_2_lv=parseInt(content_slide2_lv.style.top)-copyspeed;
					content_slide2_lv.style.top=bottom_pos_2_lv+"px";
				}
				else{
					bottom_pos_2_lv=parseInt(content_slide_lv.style.top)+actualheight_lv+slideshowgap_lv;
					content_slide2_lv.style.top=bottom_pos_2_lv+"px";
					
				}
		}
		
		
		function startCarouselHp_lv(url_js) {	
			var i = 0;
			var data = "";
			var lista_lv = "<ul id='listaNews'>";
			$.get(url_js, function(xml){
				$('articolo', xml).each(function(){
				i++;
				var data = $('data', $(this)).text();
				var titolo = $('titolo', $(this)).text();
				var titolo2 = titolo.replace("?","");
				var testo = $('sommario', $(this)).text();
				//alert(data);
				while(testo.match("") != null || testo.match("") != null){
					//console.log("entra");
					testo = testo.replace("","\"");
					testo = testo.replace("","\"");
					testo = testo.replace("","'");
					testo = testo.replace("","'");
					//testo = testo.replace("","'");
				}
				if($('path_img', $(this)).text() != ""){
					lista_lv=lista_lv+'<li class="clear"><div class="line_red"></div><a href="'+ $('url', $(this)).text() +'"><img src="'+ $('path_img', $(this)).text() +'" /></a><h4><a href="'+ $('url', $(this)).text() +'">'+ titolo2 + '</a></h4><h6>'+ $('data', $(this)).text() +'</h6><p class="textTruncate'+i+'">'+ testo +'</p><span class="data">'+ data +'</span></li>';
				}else{
					lista_lv=lista_lv+'<li class="clear"><div class="line_red"></div><h4><a href="'+ $('url', $(this)).text() +'">'+ titolo2 + '</a></h4><h6>'+ $('data', $(this)).text() +'</h6><p class="textTruncate'+i+'">'+ testo +'</p><span class="data">'+ data +'</span></li>';
				}
				});
				
				
			lista_lv = lista_lv + "</ul>";
			lista_lv=''+lista_lv+'';
			
			$('#img_vaschetta_vert').append('<div id="temp_hp_sez_lv"  class="clearfix" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+lista_lv+'</div>');
			      		
				var text_insert="";
				text_insert = text_insert+'<div style="background:#fff;float:left;margin-top:53px;position:relative;height:'+sliderheight_lv+'px;width:'+sliderwidth_lv+';overflow:hidden">';
				text_insert = text_insert+'<div style="position:absolute;height:'+sliderheight_lv+'px;width:'+sliderwidth_lv+';" onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed">';
				text_insert = text_insert+'<div id="test4" style="top:-1000px;"></div>';
				text_insert = text_insert+'<div id="test6" style="top:0px;"></div>';
				text_insert = text_insert+'</div></div>';
				$('#img_vaschetta_vert').append(text_insert);
				content_slide_lv = document.getElementById("test4");
				content_slide2_lv = document.getElementById("test6");
				content_slide_lv.innerHTML=content_slide2_lv.innerHTML=lista_lv;
			
			var num = 0;
			$('articolo', xml).each(function(){
				num++;
				//imgArt = $('.textTruncate'+num+' img').html();
				$('.textTruncate'+num).truncate( 120,{
			        chars: /\s/,
			        trail: [ "...", "..." ]
			    });
			    //alert("'.textTruncate"+num+" a'");
				$('.textTruncate'+num+' a').remove();
				//$('.textTruncate'+num+' img').remove(); 
      		});
      		
				nLi=$("#listaNews li").length;
      			//actualheight_lv=$("#temp_hp_sez_lv").height();
				actualheight_lv=(nLi*90)+90;
				top_pos_2_lv=content_slide2_lv.style.top=actualheight_lv+slideshowgap_lv;
				avvia_slidetop_lv();
    		
		});
		
		
}



/***********************************************************************
**************              DOCUMENT.READY                **************
***********************************************************************/  

$(document).ready(function() {
	
	if ($('#img_vaschetta_vert').length > 0) {
  		startCarouselHp_lv("/ssi/includes/shared/lista_news.xml");
  		$('#blog #max-news-right2').css("display","none");
	}
	setTimeout(function() {
	    var date = $("#listaNews li span.data:first").text();
		str = new String ($("#listaNews li span.data:first").text());
		strSplit = str.split(" ");
		var data1 = $.trim(strSplit[0]);
		var data2 = $.trim(strSplit[1]);
		//$("#max-news-right2 .data").html("<span class='txt_white'>" + data1 + "</span> <span class='txt_red'> " + data2 + "</span>");
	}, 2000);

}); // CHIUSURA document.ready
/*$(window).load(function(){ 
	var date = $("#listaNews li span.data:first").text();
	str = new String ($("#listaNews li span.data:first").text());
	strSplit = str.split(" ");
	var data1 = $.trim(strSplit[0]);
	var data2 = $.trim(strSplit[1]);
	$("#max-news-right2 .data").html("<span class='txt_white'>" + data1 + "</span> " + data2);
});*/
