function axome_flash2(swf,l,h,remplace) {
	var html = '<object type="application/x-shockwave-flash" data="'+ swf +'" width="'+ l +'" height="'+ h +'">'+
	'<param name="movie" value="'+ swf +'" />'+
	'<param name="wmode" value="transparent" />'+
	remplace +
	'</object>';
	document.write(html);
}

$(function() { 
	
	$("a.spip_out").attr("target", "_blank");
	
	$("#documents_portfolio a").fancybox();

	$(".texte_article a").each(function() {
		var url = $(this).attr('href');
		var extension = url.substr(url.length-3, url.length);
		if(extension == "pdf") { $(this).attr("target", "_blank"); } 
	});
	
	if($("#documents_portfolio_diapo").length > 0) {
		$('#documents_portfolio_diapo').innerfade({ timeout: 3000, speed: "slow", type: 'random', containerheight: $('#documents_portfolio_diapo').css("height") });
	}




	//home
	if ($('div#partenaire').length) {
		//home: "au programme"
		var mrg = 0;
		var wli = 120;
		$("#partenaires ul").css("width", ($('#partenaires ul li').length)*wli);
		var wprog = $("#partenaires ul").css("width");
		wprog = parseInt(wprog.replace(/px/, ''));
		var eslid = 3;
		var butee = -1;
		var mlmin = -(wprog-wli*eslid);
		var d = 900;

		$("#prog_prev").click(function() {
			mrg += wli*eslid;
			if( butee>0 ) butee=0;
			
			if( mrg>=0 ){ butee--; mrg = 0; }
			
			if( butee<-1 ){ butee=1; mrg = mlmin; }

			$("#partenaires ul").animate({marginLeft: mrg+"px"}, d);
			return false;
		});

		$("#prog_next").click(function() {
			mrg -= wli*eslid;
			if( butee<0 ) butee=0;
			if( mrg <= mlmin ){ butee++; mrg = mlmin; }
			if( butee>1 ){ butee=-1; mrg = 0; }

			$("#partenaires ul").animate({marginLeft: mrg+"px"}, d);
			return false;
		});


	}


});

