// JavaScript Document

$(document).ready(function () {
	$("tr.moreinfo").each(function(){
	   var newclass;
		$(this).hide();
		
		if($(this).hasClass("bg")){
			newclass=" bg";
		}else{
			newclass="";
		}
		
		if(langue=="en"){
			//$(this).after('<a href="#" class="more">More info</a>');
			txtmore="More info";
			txtless="Close";
		}else{
			//$(this).after('<a href="#" class="more">Plus d\'info</a>');
			txtmore="Plus d'info";
			txtless="Fermer";
		}
		
		
		$(this).after('<tr class="btinfo'+newclass+'"><td>&nbsp;</td><td colspan="4"><a href="#" class="more">'+txtmore+'</a></td></tr>');
		
		$(this).next("tr.btinfo").children("td").children("a").toggle(function(){
			$(this).text(txtless);
			$(this).parent("td").parent("tr.btinfo").prev("tr.moreinfo").show();
			$(this).addClass("lessinfo")
		 }, function(){
			 $(this).text(txtmore);
			 $(this).parent("td").parent("tr.btinfo").prev("tr.moreinfo").hide();
			 $(this).removeClass("lessinfo")
		 });
		
		$(this).prev("tr").children("th,td").css({'border-bottom':'0'})
		
	});
	

	$("#prix-dist>tbody>tr:not(.header):odd").addClass("bg");
	
	$("#prix-dist>tbody>tr:not(.header)").each(function(){
		if($(this).children("td").length<4){
			if($(this).prev("tr").hasClass("bg")){
				$(this).addClass("bg");
				
			}else{
				$(this).removeClass("bg");
			}
		}
	})
	
	
	
	
$("tr.noline").children("td:nth-child(4)").css({'border-bottom-width':'1px'})
$("tr.noline").children("td:nth-child(5)").css({'border-bottom-width':'1px'})
});
