$(function () 
		{

	$(".ajax_form").click(function() 
	{
		postli_hide();
		
		$strType = $(this).prev().attr("value");
		
		//Handle multiple title in collaborateur
		$(".show_liste2").addClass("hide_liste2");
		$(".show_liste1").addClass("hide_liste1");
		$(".show_liste2").removeClass("show_liste2");
		$(".show_liste1").removeClass("show_liste1");
		
		$(".hide_" + $strType).addClass("show_" + $strType);
		$title = $(".hide_" + $strType).removeClass("hide_" + $strType);
		
		
        // Si le lien est contenu dans un formulaire, on transmet toutes les info en parametre.
        $.ajax({
            url: $(this).parents('form').attr('action'),
            method: 'post',
            data: $(this).parents('form').serialize() + "&isAjax=1",
            success: function(resp)
            {
        		postlithanks_show("postli_thanks", parseInt(resp));
            }
        });
        
		return false;
	});
});

function trim(str, chars) {
	return ltrim(rtrim(str, chars), chars);
}
 
function ltrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
 
function rtrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}


