/****************************/
/*  Voir  &aacute; la selection  */
/**************************/

function Voir_Selection(Id_Catalogue){
	
	//document.getElementById("ifr_selection").src="../Votre_Selection/ifr_selection.php?Id_Catalogue="+Id_Catalogue+"&Add=1";
	
	var url = '/page/selection/result_req_selection.php';
	//prompt(url);
	var myAjax_Remise = new Ajax.Updater('panier', url, { method: 'get'});
	//var myAjax_Remise = new Ajax.Request( url, { method: 'get', onComplete: Affiche_div_Panier});
	

}
/*
function Affiche_div_Panier(oXML){
	alert(oXML.responseText);
	$('panier').innerHTML = oXML.responseText;
}
*/
/****************************/
/*  Ajout  &aacute; la selection  */
/**************************/

function Add_Selection(Id_Catalogue){
	
	//document.getElementById("ifr_selection").src="../Votre_Selection/ifr_selection.php?Id_Catalogue="+Id_Catalogue+"&Add=1";
	
	var url = '/page/selection/result_req_selection.php';
	var pars = "Id_Catalogue="+Id_Catalogue+"&Add=1";
	//prompt(pars,url+"?"+pars);
	var myAjax_Remise = new Ajax.Updater('panier', url, { method: 'get', parameters: pars });
	//Effect.Appear('panier',{duration:1});
	//Effect.Pulsate('panier');
	//Effect.Puff('panier', {duration:0});
	Element.setStyle($('panier'), {display: 'none'});
	setTimeout("Effect.Appear('panier')",200);
	//$("panier").style.display = "inline";


}



/**********************************/
/*  Suppression de la selection  */
/*********************************/

function Supp_Selection(Id_Catalogue,Poids_PDF){
	
	//document.getElementById("ifr_selection").src="../Votre_Selection/ifr_selection.php?Id_Catalogue="+Id_Catalogue+"&Poids_PDF="+Poids_PDF+"&Supp=1";
	
	var url = '/page/selection/result_req_selection.php';
	var pars = "Id_Catalogue="+Id_Catalogue+"&Supp=1&Poids_PDF="+Poids_PDF;
	//prompt(pars,url+"?"+pars);
	var myAjax_Remise = new Ajax.Updater('panier', url, { method: 'get', parameters: pars });
	Effect.Pulsate('panier');
	
	
	document.getElementById("deroul_form_"+Id_Catalogue).style.display = "none";
	NumRowTabCatalogue = NumRowTabCatalogue-1;
	
	if(NumRowTabCatalogue==1)$("SpanCatalogue").innerHTML="<h3>Aucune Formation selectionn&eacute;e !</h3>";

}

function Valid_Form(){
	
	if(document.getElementById("Devis").checked || document.getElementById("Deroule").checked){
		$Test_Form = true;
		$Test_Form_Devis = true;
		
		$Test_Form = Check_Input(new Array('Prenom','Nom','Email','Telephone'),new Array('Prenom','Nom','Email','Telephone'));
		
		if(document.getElementById("Devis").checked){
			
			$Test_Form_Devis = Check_Input(new Array('Societe','Code_Postal','Ville','Telephone'),new Array('Societe','Code postal','Ville','Telephone'))
		
		}
		
		if($Test_Form && $Test_Form_Devis)return true;
		else return false;
	}
	else{
		alert("Vous devez au moins cocher une des deux options suivante: \n\n - Recevoir ma s&eacute;lection en PDF\n - Demande de Devis");
		return false;
	}
}