	// Ajouter la release a notre collection
	function ajoutCollection(id, release, url) {
		
		if(confirm('Voulez-vous ajouter la release '+release+' à votre collection ?')) {
			
			new Ajax.Request('include/ajax/ajouterRelease.php', {
			   method: 'get',
			   parameters: '?id='+id,
			   asynchronous: false,
			   evalScripts: true,
			   onComplete: function() {
				   location.href = url;
			   }
			});
			
		} else {
			
			location.href = url;
			
		}
		
	}

	function voter(action, id) {
		
		if(action == 'contre') {
			
			var reproche = prompt('Que reprochez-vous à ce sous-titre ?');
			if(reproche!=null){ 
				if(!reproche.blank() && (reproche.length > 0) && !reproche.empty() && (reproche != 'undefined')) {
					updateVote(action, id);
					$('commentaire').value = reproche;
					$('negatif').value = 1;
					addCommentaire();
				}
			}
			
		} else {
			updateVote(action, id);
		}
		
	return false;
		
	}
	
	function updateVote(action, id) {
		
		new Ajax.Updater(action, 'include/ajax/voter.php', {
			   method: 'get',
			   parameters: '?action='+action+'&id='+id,
			   asynchronous: false,
			   evalScripts: true,
			   onComplete: function() {
				   $$('.voter').each(function(element) {
					element.setStyle({ backgroundPosition: 'bottom left' });
					element.stopObserving('click');
				   });
			   }
		});
		
	}
	
	function recevoirMail(id) {
		
		new Ajax.Updater('recevoir', 'include/ajax/recevoirMail.php', {
			   method: 'get',
			   parameters: '?id='+id,
			   asynchronous: false,
			   evalScripts: true
		});
		
	}
