function ajoutFavoris(action,id) {

	$('#favoris'+id).load("/favoris.php?id="+id+"&action="+action);

}

function partageFacebook(id){
	window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent('http://www.pretatou.com/?'+id),'sharer','toolbar=0,status=0,width=626,height=436');
}

function voter(id,note) {

	$('#vote'+id).css('display','none');
	$('#vote'+id).load("/voter.php?id="+id+"&note="+note).fadeIn();

}

function voteVideo(id,note) {

	$('#vvote_libelle_'+id).html('');
	$('#vvote_'+id).load("/vvoter.php?id="+id+"&note="+note);

}

function afficheVideoOn(id,note) {
	
	if(note == 1) {
		$('#vvote_libelle_'+id).html('1/5 : Pourri...');
		$('#vvote_img1_'+id).attr('src','/images/video_on.png');
		$('#vvote_img2_'+id).attr('src','/images/video_off.png');
		$('#vvote_img3_'+id).attr('src','/images/video_off.png');
		$('#vvote_img4_'+id).attr('src','/images/video_off.png');
		$('#vvote_img5_'+id).attr('src','/images/video_off.png');
	}
	else if(note == 2) {
		$('#vvote_libelle_'+id).html('2/5 : Bof bof');
		$('#vvote_img1_'+id).attr('src','/images/video_on.png');
		$('#vvote_img2_'+id).attr('src','/images/video_on.png');
		$('#vvote_img3_'+id).attr('src','/images/video_off.png');
		$('#vvote_img4_'+id).attr('src','/images/video_off.png');
		$('#vvote_img5_'+id).attr('src','/images/video_off.png');
	}
	else if(note == 3) {
		$('#vvote_libelle_'+id).html('3/5 : A voir');
		$('#vvote_img1_'+id).attr('src','/images/video_on.png');
		$('#vvote_img2_'+id).attr('src','/images/video_on.png');
		$('#vvote_img3_'+id).attr('src','/images/video_on.png');
		$('#vvote_img4_'+id).attr('src','/images/video_off.png');
		$('#vvote_img5_'+id).attr('src','/images/video_off.png');
	}
	else if(note == 4) {
		$('#vvote_libelle_'+id).html('4/5 : Pas mal du tout !');
		$('#vvote_img1_'+id).attr('src','/images/video_on.png');
		$('#vvote_img2_'+id).attr('src','/images/video_on.png');
		$('#vvote_img3_'+id).attr('src','/images/video_on.png');
		$('#vvote_img4_'+id).attr('src','/images/video_on.png');
		$('#vvote_img5_'+id).attr('src','/images/video_off.png');
	}
	else if(note == 5) {
		$('#vvote_libelle_'+id).html('5/5 : Géniale !');
		$('#vvote_img1_'+id).attr('src','/images/video_on.png');
		$('#vvote_img2_'+id).attr('src','/images/video_on.png');
		$('#vvote_img3_'+id).attr('src','/images/video_on.png');
		$('#vvote_img4_'+id).attr('src','/images/video_on.png');
		$('#vvote_img5_'+id).attr('src','/images/video_on.png');
	}

}

var addthis_pub="linkuff";

// conteneur = id du bloc (<div>, <p> ...) contenant les checkbox
// a_faire = '0' pour tout décocher
// a_faire = '1' pour tout cocher
// a_faire = '2' pour inverser la sélection

function GereChkbox(conteneur, a_faire) {
	var blnEtat=null;
	var Chckbox = document.getElementById(conteneur).firstChild;
	while (Chckbox!=null) {
		if (Chckbox.nodeName=="INPUT")
			if (Chckbox.getAttribute("type")=="checkbox") {
				blnEtat = (a_faire=='0') ? false : (a_faire=='1') ? true : (document.getElementById(Chckbox.getAttribute("id")).checked) ? false : true;
				document.getElementById(Chckbox.getAttribute("id")).checked=blnEtat;
			}
		Chckbox = Chckbox.nextSibling;
	}
}