/* LISTE PRODUITS : VERIFICATION DE LA QUANTITE PUIS SOUMISSION DU FORMULAIRE AJOUT AU PANIER
 */
function VerificationListe(objet, prod)
		{
			var transfert = true;
			var quantite = document.getElementById(objet.previousSibling.previousSibling.attributes["id"].value);
			if(quantite.value!="" && quantite.value!=0)
			{
				for(var i=0; i<quantite.value.length; i++)
				{
					if(quantite.value.charCodeAt(i)<48 || quantite.value.charCodeAt(i)>57  || quantite.value[i]=='.')
					{
						alert("ce champ n'accepte que les chiffres");
						transfert = false;
						break;
					}				
				}
				if(transfert)
				{
					//location.href = "../panier/ajout.aspx?produit="+prod+"&quantite="+quantite.value;
					var haut = (screen.height-300)/2;
					var gauche =(screen.width-320)/2;				
					var fen = window.open("../panier/ajout.aspx?produit="+prod+"&quantite="+quantite.value,'popup','menubar = no,toolbar = no,location = no,width=420, height=220, top='+haut+', left='+gauche+',resizable=yes');									
					fen.focus();	
				}
			}
			else		
				alert("Vous devez prendre au moins un objet");				
			
		}
		
		
/* FICHE PRODUIT : VERIFICATION DE LA QUANTITE ET DE L'EVENTUEL SOUS PRODUIT PUIS SOUMISSION DU FORMULAIRE AJOUT AU PANIER
<!--<td class="cellule3" id="tdprix" runat="server"><a href="produit.aspx?produit=<%# DataBinder.Eval(Container.DataIte m,"ref") %>" class="focuslien"><span runat="server" id="prix"><%# DataBinder.Eval(Container.DataItem,"prix","{0:f2}") %> &euro;  H.T</span><span runat="server" id="prixht1"><%# DataBinder.Eval(Container.DataItem,"prix1","{0:f2}") %> &euro;  H.T</span></a><br/>Quantité: <asp:Textbox id="quantite" runat="server" size="2"> </asp:Textbox><br /><a name="<%# DataBinder.Eval(Container.DataItem,"ref") %>" href="#<%# DataBinder.Eval(Container.DataItem,"ref") %>" onclick="VerificationListe(this,'<%# DataBinder.Eval(Container.DataItem,"ref") %>');"><img src="../../images/client/bouton-panier.gif" border="0"/></a></td>-->
 */
function Verification(f)
		{
			if(document.getElementById('quantite').value!="" && document.getElementById('quantite').value>0)
			{
		 		var i=0;
				while(document.getElementById('chx'+i))
				{
					var control = document.getElementById('chx'+i);
					if(control.selectedIndex==0)
					{
						alert('Merci de choisir un élément');
						return false;
					}
					i++;
				}
			
				//f.submit();							
				var haut = (screen.height-300)/2;
				var gauche =(screen.width-320)/2;
				var fen = window.open('about:blank','popup','menubar = no,toolbar = no,location = no,width=320, height=170, top='+haut+', left='+gauche+',resizable=no');
				f.target = 'popup';
				f.submit();
				fen.focus();
				
				
			}
			else
			{
				alert('Vous devez choisir au moins un produit');
				return false;
			}
		}


 
 /* SOUMISSION DU FORMULAIRE BRODIT
*/
		function soumettre()
		{
			var frm = document.getElementById('fordonsok');
			frm.target='resultat';		
			window.open('','resultat','width=410,height=250,scrollbars=yes');			
			frm.submit();		
		}


/* CHANGEMENYT DE SOUS PRODUIT
*/			
		function changement()
		{
			var i=0;

			var spancontrol = document.getElementById("choixdesc");					
			spancontrol.innerHTML = "";
							

			while(document.getElementById('chx'+i))
			{
				var control = document.getElementById('chx'+i);
				

				if (control.selectedIndex!=0)
				{
					var tableau = eval('dispochoix'+i);
					var f =eval('fournisseur'+i);
					var g = eval('gencode'+i);
					spancontrol.innerHTML += "<center><font size=\"1\"> R&eacute;f. : " + f[control.selectedIndex-1] + "</font></center>";
					if(g[i] != "null" && g[i] != "undefined")
					spancontrol.innerHTML += "<center><font size=\"1\"> Gencod.:" + g[control.selectedIndex-1] + "</font></center><br>";
				
					if (tableau[control.selectedIndex-1] == "0")
					{
						spancontrol.innerHTML += "Attention, pour le "+nomchoix[i]+" "+ control.options[control.selectedIndex].innerHTML +", ce produit sera disponible sous 15 jours environ<br />";
					}
				}
				i++;
			}
		}


 
 
 /* OUVERTURE DE POPUP (250x40)
 */
	function POPUP (url)
	{
		window.open(url,'PopUp','width=250,height=500,top=100,left=320');

	}

 /* OUVERTURE DE POPUP (250*450)
 */	
	function POPUP2 (url)
	{
		window.open(url,'PopUp','width=250,height=450,top=320,left=320');

	}
	
	function fenetreg(url)
	{
		window.open(url,'Avesta','width=600,height=450,top=100,left=100, toolbar=no, menubar=yes, location=no, resizable=yes, scrollbars=yes, status=no');

	}

