function show_web_cat(cat_id)
{
        close_all_web_cat();
        $("div#web_cat"+cat_id+"_content").show("slow");
}

function close_all_web_cat(){
        for (var i=1; i < 8; i++) {
                close_web_cat(i);
        }
}

function close_web_cat(cat_id)
{
//      if ($("div#web_cat"+cat_id+"_content").css("display") == 'block') 
//      {
                $("div#web_cat"+cat_id+"_content").hide("slow");
//      }

}



function fa_next(){
	
	var first_line = $("table#tb_fil_actu>tbody>tr.fa_visu").get(0);
	var dernier    = $("table#tb_fil_actu>tbody>tr.fa_visu").get(2);
	var last_id    = 'fil'+(parseInt((dernier.id).replace('fil','')) + 1);
	if (document.getElementById(last_id)) {
		fa_hide_ln(first_line.id);
		fa_show_ln(last_id);
	}
return false;
}

function fa_prev(){
	var first_line  = $("table#tb_fil_actu>tbody>tr.fa_visu").get(0);
	var dernier 	= $("table#tb_fil_actu>tbody>tr.fa_visu").get(2);
	var first_id 	= 'fil'+(parseInt((first_line.id).replace('fil','')) - 1);
	if (document.getElementById(first_id)) {
		fa_hide_ln(dernier.id);
		fa_show_ln(first_id);
	}
return false;
}


function fa_hide_ln(id){
	$("tr#"+id).removeClass('fa_visu');
	$("tr#"+id).hide();
}

function fa_show_ln(id){
	$("tr#"+id).addClass('fa_visu');
	$("tr#"+id).show();
}

function fa_show(){
	$("table#tb_fil_actu>tbody>tr").hide();
	$("table#tb_fil_actu>tbody>tr.fa_visu").show();
}


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 = 0;
				var $mask = $strip.wrap("<div class='mask'></div>");
				var $tickercontainer = $strip.parent().wrap("<div class='tickercontainer'></div>");								
				var containerWidth = $strip.parent().parent().width();	//a.k.a. 'mask' width 	
				$strip.find("li").each(function(i){
				stripWidth += jQuery(this, i).width();
				});
				$strip.width(stripWidth);			
				var defTiming = stripWidth/settings.travelocity;
				var totalTravel = stripWidth+containerWidth;								
				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);
				});			
		});	
};
