

$(document).ready(function(){

if($('#last_news').length)           $.getScript('/2011/last.php');
else if($('#last_news_fr').length)   $.getScript('/2011/last.php');

if($('#all_news_fr').length) {
	$.getScript('/2011/all_fr.php',function(data, textStatus){

		$("#all_news_fr ul").each(function(index) {
			 $(this).find("li").hide();
			 $(this).find("li:lt(5)").show();
			 });

		$("#all_news_fr > ul > a").click( function(){ $(this).slideUp('slow'); return TRUE; } );
		});
	}

if($('#all_news_en').length) {
	$.getScript('/2011/all_en.php',function(data, textStatus){
		$('#all_news_en ul li').each( function(i){
			if($(this).find('a.en').length==1)
				$(this).addClass('ok');
			else
				$(this).addClass('ko').hide();
		});
		$("#all_news_en ul").each(function(index) {
			 $(this).find("li.ok").hide();
			 $(this).find("li.ok:lt(5)").show();
			 });
		$("#all_news_en > ul > a").click( function(){ $(this).slideUp('slow'); return TRUE; } );
		});
	}

$("#cat li a").click( function(){

	$("#all_news_fr ul").hide();
	$($(this).attr('href').replace('#category','#all_news_fr ul.cat')).show();

	$("#all_news_en ul").hide();
	$($(this).attr('href').replace('#category','#all_news_en ul.cat')).show();

	return false;
	} );
});



