/*
function afficherselection
Ajoute à la sélection la vidéo dont le numéro est passé en paramètre
*/
function ajouterselection(novideo){
	var xhr = getXhr();
	xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
			lareponse = xhr.responseText;
			bs=document.getElementById('boutonselection');
			if(bs!=null){
				bs.style.visibility='visible';
			}
		}
	};

	xhr.open("POST","../fonctions/ajouterselection.php",true);
	xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	//var noparticulier = document.getElementById('noparticulier').value;
	var nomselection = '';
	xhr.send("novideo="+novideo);
}


/*
function supprimerlaselection
Retire de la sélection la vidéo dont le numéro est passé en paramètre
*/
function supprimerselection(novideo){
	var xhr = getXhr();
	xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
			lareponse = xhr.responseText;
			if (lareponse != 1){
				afficherselection2();  // affichageannonces.js
				cClick();
			}else{
				affichernouvellesannonces();
				document.getElementById('boutonselection').style.visibility = 'hidden';
			}
		}
	}

	xhr.open("POST","../fonctions/supprimerselection.php",true);
	xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	xhr.send("novideo="+novideo);
}


/*
function supprimerlaselection
Supprime la selection
*/
function supprimerlaselection(){
		var xhr = getXhr();
	xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
			lareponse = xhr.responseText;
			afficherselection();
			selectionactuelle();
			
		}
	}

	xhr.open("POST","../fonctions/supprimerlaselection.php",true);
	xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	var noparticulier = document.getElementById('noparticulier').value;
	var select = document.getElementById("lesselections" );
	var choixselection = select.options[select.selectedIndex].value;
	xhr.send("no="+noparticulier+"&&choixselection="+choixselection);
}
