function voteup(lid,hit,type) {
	$.post("voteup.php",{"lid":lid,"hit":hit,"type":type},function(html) {
		$('span#voteup'+lid).css('display','none');
		if (html == 'NA') {
			$('#voteup'+lid).html('deja vote').fadeIn();
		} else {
			$('#voteup'+lid).html('A vote pour ! ('+hit+')').fadeIn();
		}
	});
}

function votedown(lid,hit,type) {
	$.post("votedown.php",{"lid":lid,"hit":hit,"type":type},function(html) {
		$('span#votedown'+lid).css('display','none');
		if (html == 'NA') {
			$('#votedown'+lid).html('deja vote').fadeIn();
		} else {
			$('#votedown'+lid).html('A vote contre ! ('+hit+')').fadeIn();
		}
	});
}

function toggleenvoyer() {
	if ($('#envoyer').css('display') == 'none') {
		$('#envoyer').slideDown();
	} else {
		$('#envoyer').slideUp();
	}
}
 
$().ready(function() {
	// validate the comment form when it is submitted
	$("#formenvoyer").validate();
	$("#formenvoyerdetails").validate();
	$("#forminscription").validate();
  });
