// JavaScript Document

$(document).ready(function () {
	$("div.infobox > p.txt").each(function(){
		var orightml,newhtml;
		orightml=$(this).html();
		
		if($(this).html().indexOf("<!-- more -->")>0){
			if(langue=="en"){
				$(this).after('<p class="more"><a href="#">More info</a></p>');
				txtmore="More info";
				txtless="Close";
			}else{
				$(this).after('<p class="more"><a href="#">Plus d\'info</a></p>');
				txtmore="Plus d'info";
				txtless="Fermer";
			}
			
			
			newhtml=$(this).html().substring(0,$(this).html().indexOf("<!-- more -->"));
			
			$(this).html(newhtml).append("...")
			
			$(this).siblings(".more").children("a").toggle(function(){
				$(this).text(txtless);
				$(this).parent().siblings("p.txt").html(orightml);
				$(this).addClass("lessinfo")
			 }, function(){
				 $(this).text(txtmore);
				$(this).parent().siblings("p.txt").html(newhtml).append("...");
				$(this).removeClass("lessinfo")
			 });
		}
		
		//$("p.txt").each(function(){
			//$("p.txt").html($("p.txt").html().substring(0,$("p.txt").html().indexOf("<!-- more -->")));
		//});
		//$("p.txt").append("a b c");
	});
	

});
