
function jpstart(){
    J('#news_meta').html('<img alt="News Loading" src="/img/loading.gif" />');
}
function jpfinish(){
    J('#news_meta').remove();
}

J(function(){
	// affichage caroussel
	J("#local_machines_content_id").jCarouselLite({
		vertical: true,
		visible: 2,
		auto:3000,
		speed:5000
	});

	// affichage caroussel entreprises
	J("#referent_content").jCarouselLite({
		visible: 3,
		auto:3000,
		speed:5000
	});

	// news France BTP
    J('#news_cont_list').jParse({
        ajaxOpts: {url: '/uploads/news/xml_actus_matexchange.xml'},
        elementTag: ['link','title',{elem: 'enclosure', attr: 'url'},'description'],
        output: '<li><div class="news-entry"> <a href="jpet00" class="nodeco 0px" target="_blank"><h3>jpet01</h3> <br/> <img src="jpet02" alt="jpet02" class="news-img"/>jpet03</a></div></li>',
		limit: 10,
        precallback: jpstart,
        callback: function(){
		jpfinish();
		
		// cacher les images sans sources
		J('#news_cont_list').find('img').each(function(){
			if( J(this).attr('src').length == 0 ){
				J(this).remove();	
			}
		});

		// affichage news en caroussel
		J("#news_cont").jCarouselLite({
			vertical: true,
			visible: 1,
			auto:5000,
			speed:5000
		});
		}
    });

	
});

