jQuery.fn.liScroll = function(settings) {
settings = jQuery.extend({
travelocity: 0.07
}, settings);		
return this.each(function(){
var $strip = jQuery(this);
$strip.addClass("newsticker")
var stripWidth = 1;
$strip.find("li").each(function(i){
stripWidth += jQuery(this, i).outerWidth(true);
});
var $mask = $strip.wrap("<div class='mask'></div>");
var $tickercontainer = $strip.parent().wrap("<div class='tickercontainer'></div>");								
var containerWidth = $strip.parent().parent().width();	
$strip.width(stripWidth);			
var totalTravel = stripWidth+containerWidth;
var defTiming = totalTravel/settings.travelocity;	
function scrollnews(spazio, tempo){
$strip.animate({left: '-='+ spazio}, tempo, "linear", function(){$strip.css("left", containerWidth); scrollnews(totalTravel, defTiming);});
}
scrollnews(totalTravel, defTiming);				
$strip.hover(function(){
jQuery(this).stop();
},
function(){
var offset = jQuery(this).offset();
var residualSpace = offset.left + stripWidth;
var residualTime = residualSpace/settings.travelocity;
scrollnews(residualSpace, residualTime);
});			
});	
};

jQuery.fyt_plantilla = function( ancho , paramsc , sites , proxy )
{
 var fec= new Date();
 var fecha = fec.getDate()+'/'+( fec.getMonth() + 1 )+'/'+fec.getFullYear();
 var ancho_cintillo = ancho - 269;
 var loader = "<div style=\"color:#cccccc; height:14px; margin-top:15px; margin-bottom:15px; font-size:14px; font-family:'Century Gothic'\">Cargando <img src=\"http://finanzasytributos.com/indicadores/loader.gif\" /></div>";
 var r = '';
 r += "<link href=\"http://finanzasytributos.com/indicadores/fyt_st.css\" rel=\"stylesheet\" type=\"text/css\" />";
 r += "<div id=\"fyt_cintillo\" style=\"width:"+ancho+"px; height:48px;\">";
 r += "<div onclick=\"javascript:top.location.href='http://www.finanzasytributos.com'\" style=\"width:212px; height:48px; cursor:pointer; float:left; background:url(http://finanzasytributos.com/indicadores/left.png);\">"; 
 r += "<div  align=\"right\" style=\"width:198px; margin-right:14px; height:24px; font-family:'Century Gothic'; font-size:14px; color:#5B758E; margin-top:24px;\">Ind&iacute;cadores al "+fecha+"</div>";
 r += "</div>";
 r += "<div id=\"fyt_marquesina\" style=\"width:"+ancho_cintillo+"px; height:48px; float:left; background-color:#f2f2f2;\"> "+loader+" </div>";
 r += "<div style=\"width:57px; height:48px; float:left; background:url(http://finanzasytributos.com/indicadores/right.png)\"></div>";
 r += "</div>";
 document.write(r);
var ss = '';
for( var i = 1; i <= (paramsc.length - 1 ); i++)
{
if( paramsc[i] == true ){ ss += i+"="+i; if( i < (paramsc.length - 1 ) ){ ss +="&"; } }
}

 $.ajax({
		url: proxy,
		dataType: 'html',
		cache: false,
		type: 'GET',
		data: 's='+sites+'&'+ss,
		success: function(data)
		         {
				 $('#fyt_marquesina').html(data);
				 $("ul#ticker01").liScroll();
				 }
		}); 
}
