<!--
function affiche_nav(manav)
{
	
	document.getElementById('sousnav1').style.display='none';
	document.getElementById('sousnav2').style.display='none';
	document.getElementById('sousnav3').style.display='none';
	document.getElementById('sousnav4').style.display='none';
	document.getElementById(manav).style.display='block';
}

function encart_home_saveur() {
	document.getElementById('encart_ambiance_flash').style.display='none';
	document.getElementById('encart_ambiance').style.display='block';
}

function affiche_onglet(mononglet) { 

	document.getElementById('produits').style.display='none';
	document.getElementById('ingredients').style.display='none';
	document.getElementById('nutrition').style.display='none';
	document.getElementById(mononglet).style.display='block';
  
}

function fermer_div(mondiv)
{
	document.getElementById(mondiv).style.display='none';
	document.getElementById('site_noir').style.display='none';
	if (mondiv=="div_ami")
	{
		document.getElementById('erreur_ami').innerHTML ="";
	}
}

function IE_CorrectAlpha_PNG(){
	for(i=0; i<document.images.length; i++){
		img    = document.images[i];
		imgExt  = img.src.substring(img.src.length-3, img.src.length);
		imgExt  = imgExt.toUpperCase();
		if (imgExt == "PNG"){
			
			imgID    = (img.id) ? "id='" + img.id + "' " : "";
			imgClass= (img.className) ? "class='" + img.className + "' " : "";
			imgTitle= (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
			imgStyle= "display:inline-block;" + img.style.cssText;
			
			//if (img.align == "left") { imgStyle = "float:left;"  + imgStyle; } else if (img.align == "right"){ imgStyle = "float:right;" + imgStyle; }
			if (img.parentElement.href)   { imgStyle = "cursor:hand;" + imgStyle; }       
			strNewHTML    = '<span '+imgID+imgClass+imgTitle+' style="backgroud-color:#ff0000;width:'+img.width+'px; height:'+img.height+'px;'+imgStyle+';'+'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+img.src+'\', sizingMethod=\'scale\');"></span>';
			img.outerHTML = strNewHTML;
			i = i-1;
		}
	}
}
//début des fonctions utilisées pour la div panier et le panier
function ajouter_panier(indice)
{ //alert("la fonction ajouter_panier");
	ajout_panier(get_champ("PRODUIT_ID"+indice), get_champ("ARTICLE_ID"+indice), get_champ("PRODUIT_Libelle"+indice), get_champ("ARTICLE_Libelle"+indice), get_champ("ARTICLE_Prix"+indice), get_champ("ARTICLE_Quantite"+indice), get_champ("ARTICLE_Ref"+indice), get_champ("target"+indice), get_champ("GAMME_ID"+indice), get_champ("GAMME_Libelle"+indice));

}
// JavaScript Document
function maj_quantite(indice, quantite)
{

    document.getElementById('ligneModif').value = indice;
    document.getElementById('quantiteModif').value = quantite;
    document.getElementById('form_quantite').submit();

}
function get_champ(id)
{
    try {
 	   return document.getElementById(id).value; }
	catch (ex) {
		if (id != "from") {/*alert("id  :" + id);*/} }
}

function ajout_panier(PRODUIT_ID, ARTICLE_ID, PRODUIT_Libelle,ARTICLE_Libelle, ARTICLE_Prix, ARTICLE_Quantite, ARTICLE_Ref, page, GAMME_ID, GAMME_Libelle)
{
	
	//alert("PRODUIT_ID:"+PRODUIT_ID+" REFARTICLE_ID:"+REFARTICLE_ID+" PRODUIT_Libelle:"+PRODUIT_Libelle+" PRODUIT_Couleur:"+PRODUIT_Couleur+" PRODUIT_Reference:"+PRODUIT_Reference+" PRODUIT_Prix:"+PRODUIT_Prix+" PRODUIT_PrixReduit:"+PRODUIT_PrixReduit+" REFARTICLE_Quantite:"+REFARTICLE_Quantite+" REFARTICLE_Ref:"+REFARTICLE_Ref+" stock:"+stock+" taille_produit:"+taille_produit+" libelle_couleur:"+libelle_couleur+" libelle_taille:"+libelle_taille+" type_produit:"+type_produit+" page:"+page+" GAMME_ID:"+GAMME_ID+" SOUSGAMME_ID:"+SOUSGAMME_ID+" PRODUIT_Collection:"+PRODUIT_Collection);
	var http_request ;
	var Url ;
	var   ARTICLE_Libelle2;
	ARTICLE_Libelle2 ="";
	
	if (window.XMLHttpRequest) 
	{ // Mozilla, Safari, ...
	http_request = new XMLHttpRequest();
	} 
   else if (window.ActiveXObject) 
	{ // IE²
	http_request = new ActiveXObject("Microsoft.XMLHTTP");
	}

    if (!http_request) 
    {
        alert("Votre navigateur ne permet pas la consultation de ce site");
        return false;
    }
    else
    {
			  
        if (page == "fiche") {
            http_request.onreadystatechange = function() { maj_panier(http_request,PRODUIT_ID,PRODUIT_ID, ARTICLE_ID, PRODUIT_Libelle, ARTICLE_Libelle, ARTICLE_Prix, ARTICLE_Quantite, ARTICLE_Ref, GAMME_ID, GAMME_Libelle ); };
			/*alert("456");*/
				}
		//else if (page == "div_boite_cadeau"){
//			//window.location="/panier.asp";
//		    http_request.onreadystatechange = function() { window.location.href="/panier.asp"; };
//			//http_request.open('GET', "/panier.asp", true);
//		}
//		else if (page == "hautbas")
//		{
//				
//				http_request.onreadystatechange = function() { maj_panier_hautbas(http_request); };
//		}
//        else
//         {
//			 	http_request.onreadystatechange = function() { maj_panier_popup(http_request); };
//		 }
     
    ARTICLE_Libelle2 = PRODUIT_Libelle +" - "+  ARTICLE_Libelle;
   
   
		var newdate = new Date();
        Url = "/ajax/ajout_panier.asp?ARTICLE_ID="+ARTICLE_ID+"&ARTICLE_Libelle="+ARTICLE_Libelle2+"&ARTICLE_Prix="+ARTICLE_Prix+"&ARTICLE_Quantite="+ARTICLE_Quantite+"&ARTICLE_Ref="+ARTICLE_Ref;
		//alert("URL:" + Url);
		//alert(Url);
		//window.open(Url);
		//return void(0);
        http_request.open('GET', Url, true);
		if (window.XMLHttpRequest) 
			{ // Mozilla, Safari, ...
			http_request.send(null);
			} 
		else if (window.ActiveXObject) 
			{ // IE
			http_request.send(null);
			}
            
        
       
    }

}

function maj_panier(http_request,PRODUIT_ID,PRODUIT_ID, ARTICLE_ID, PRODUIT_Libelle, ARTICLE_Libelle, ARTICLE_Prix, ARTICLE_Quantite, ARTICLE_Ref, GAMME_ID, GAMME_Libelle )
{
  
  if (http_request.readyState == 4) {
    //alert("Statut: " + http_request.status);
		//alert("Reponse : " + http_request.responseText);
	 if (http_request.status == 200) 
        {
			//alert("Reponse : " + http_request.responseText);
			//alert("response : "+http_request.responseText);
			
			var nb_articles = 0;
			
			if (document.getElementById('nb_articles').innerHTML==""){
			}else{
				nb_articles=document.getElementById('nb_articles').innerHTML;
			}
			
			var total       = document.getElementById('montant_panier').innerHTML;
			//alert(nb_articles);
			//alert(http_request.status)
		
			document.getElementById('nb_articles').innerHTML = parseInt(nb_articles) + 1;
			//document.getElementById('lien_panier').href = "/panier.asp?id="+PRODUIT_ID+"&parent="+GAMME_ID+"&ssgamme="+SOUSGAMME_ID;
		
		
			//alert("total : "+total);
			//alert("prix : "+parseFloat(PRODUIT_Prix.replace(",",".")));
			//
			total_float = parseFloat(total.replace(",","."))
			//alert("total_float : "+total_float);
			prix_float  = parseFloat(ARTICLE_Prix.replace(",","."))
			//alert("prix_float : "+prix_float);
			var_resultat = Math.round( (total_float + prix_float) *100 ) / 100;
			
		//alert("var_resultat : "+var_resultat);
				document.getElementById('montant_panier').innerHTML = var_resultat;
					document.getElementById('message_panier_1').innerHTML = "<a href=\"/panier.asp\"><b>"+document.getElementById('nb_articles').innerHTML+" article(s)<br/>soit&nbsp;"+document.getElementById('montant_panier').innerHTML+"&nbsp;&euro;&nbsp;TTC</a>";
			document.getElementById('prix_divpanier').innerHTML = "<p>"+ARTICLE_Prix +"&euro;<p>";
			
			
			document.getElementById('intitule_divpanier').innerHTML = PRODUIT_Libelle +"<br/> <span>"+ ARTICLE_Libelle+"<br />R&eacute;f "+ARTICLE_Ref+"<br /></span>";			
			
			if(navigator.appVersion.indexOf("MSIE")!=-1)
			{
				t= navigator.appVersion.split("MSIE");
				ieversion = parseFloat(t[1]);
			
				if (ieversion <= 7 )
				{
					document.getElementById('site_noir').style.display='block';
					document.getElementById('div_panier').style.display='block';
					IE_CorrectAlpha_PNG ();
					
				}
			} else {
				
			document.getElementById('site_noir').style.display='block';
			document.getElementById('div_panier').style.display='block';
			}
		}
	}
	
}
function maj_quantite(indice, quantite)
{
		//alert (quantite);
    document.getElementById('ligneModif').value = indice;
    document.getElementById('quantiteModif').value = quantite;
    document.getElementById('form_quantite').submit();
}
//fin des fonctions utilisées pour la div panier et le panier

function valider_mail(email){
	/*var x = email;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(x)) return true;
	else return false;*/
				
	var modele = /^[a-zA-Z0-9\.\-_]+@[a-zA-Z0-9\-_]+\.[a-zA-Z]{2,5}$/i;
	if (modele.test(email))
	  return true;
	else
	  return false;
	return false;
}

function verif_ami()
{
	if (document.getElementById('prenom').value=="" || document.getElementById('email').value=="" || document.getElementById('prenom_ami').value=="" || document.getElementById('email_ami').value=="")
	{
		document.getElementById('erreur_ami').innerHTML = "Merci de saisir les champs obligatoires";
	} else
	{
		if (document.getElementById('email').value!="" && valider_mail(document.getElementById('email').value) == false)
		{
			document.getElementById('erreur_ami').innerHTML = "V&eacute;rifiez le format de votre email";
		} else
		{	
			if (document.getElementById('email_ami').value!="" && valider_mail(document.getElementById('email_ami').value) == false)
			{
				document.getElementById('erreur_ami').innerHTML = "V&eacute;rifiez le format de l'email de votre ami";
			}
			else
			{
				//alert("ok");
				document.getElementById("envoi_ami").submit();
				
				
			}
		}
	}
}


function envoyer_ami()
{
	if(navigator.appVersion.indexOf("MSIE")!=-1)
	{
		t= navigator.appVersion.split("MSIE");
		ieversion = parseFloat(t[1]);
	
		if (ieversion <= 7 )
		{
			document.getElementById('site_noir').style.display='block';
			document.getElementById('div_ami').style.display='block';
			IE_CorrectAlpha_PNG ();
			
		}
	} else {
		
	document.getElementById('site_noir').style.display='block';
	document.getElementById('div_ami').style.display='block';
	}
}

function verif_oubli()
{
	if (document.getElementById('email_oubli').value=="")
	{
		document.getElementById('erreur_pass').innerHTML = "Merci de saisir votre email";
	} else
	{
		if (document.getElementById('email_oubli').value!="" && valider_mail(document.getElementById('email_oubli').value) == false)
		{
			document.getElementById('erreur_pass').innerHTML = "V&eacute;rifiez le format de votre email";
		} else
		{	
			document.getElementById("form_pass").submit();
		}
	}
}


function oubli_pass()
{
	if(navigator.appVersion.indexOf("MSIE")!=-1)
	{
		t= navigator.appVersion.split("MSIE");
		ieversion = parseFloat(t[1]);
	
		if (ieversion <= 7 )
		{
			document.getElementById('site_noir').style.display='block';
			document.getElementById('div_oubli').style.display='block';
			IE_CorrectAlpha_PNG ();
			
		}
	} else {
		
	document.getElementById('site_noir').style.display='block';
	document.getElementById('div_oubli').style.display='block';
	}
}

// fonction de scroll

var Timer;
var Pas = 3;
function moveLayer(Sens) {
	Objet=document.getElementById("nutrition_contenu");
    if(parseInt(Objet.style.top) + (Pas*Sens)>0)  {
		clearTimeout(Timer);
	}
	else if(parseInt(Objet.style.top) + (Pas*Sens)<-(Objet.offsetHeight-document.getElementById("div_nutrition").offsetHeight)) {
		clearTimeout(Timer);
	}
    else {
        Objet.style.top = (parseInt(Objet.style.top) + (Pas*Sens)) + "px";
	}
	Timer = setTimeout("moveLayer(" + Sens + ");", 30);
}


function affiche_code_avantage(mondiv)
{
		
    document.getElementById('code_avantage_actif').style.display='none';
    document.getElementById('code_avantage').style.display='none';
    document.getElementById(mondiv).style.display='block';
    return true;
}


function valid_choixpaiement()
	{
	if (document.valid_paiement.modePaiement[0].checked) 
			{
			document.valid_paiement.submit() ;
			}
	else
			if (document.valid_paiement.modePaiement[1].checked )
			{
			document.valid_paiement.submit() ;
			}
			else
			{
			alert('Merci de sélectionner le mode de paiement de votre choix');
			}						    
	}
function afficher_zoom()
{
	if(navigator.appVersion.indexOf("MSIE")!=-1)
	{
		t= navigator.appVersion.split("MSIE");
		ieversion = parseFloat(t[1]);
	
		if (ieversion <= 7 )
		{
			document.getElementById('site_noir').style.display='block';
			document.getElementById('div_zoom').style.display='block';
			IE_CorrectAlpha_PNG ();
			
		}
	} else {
		
	document.getElementById('site_noir').style.display='block';
	document.getElementById('div_zoom').style.display='block';
	}
}
function ChangeWordingPrixreduit(nb_div,nOffrePrixReduit){
		document.getElementById('wordingPrixReduitSelect'+nOffrePrixReduit+'_default').style.display="none";
	  
      var selectIDavantagePrixReduitselect = document.getElementById("IDavantagePrixReduitselect"+nOffrePrixReduit);
      var valeur = selectIDavantagePrixReduitselect.selectedIndex;
			//alert(valeur);
	for (i_div=0;i_div<nb_div;i_div++){
		if(i_div!=valeur){
			document.getElementById('wordingPrixReduitSelect'+nOffrePrixReduit+'_'+i_div).style.display="none";
		}else{
		document.getElementById('wordingPrixReduitSelect'+nOffrePrixReduit+'_'+i_div).style.display="inline";
		}
	}
}
-->