function montre(id) 
{
	var d = document.getElementById(id);
	var dp = document.getElementById(id).style.display;
	for (var i = 1; i<=20; i++) 
	{
		if (document.getElementById('smenu'+i) && id!='smenu4' && id!='smenu5' && id!='smenu6') 
		{
			document.getElementById('smenu'+i).style.display='none';
		}
	}
	if (d && dp=="none") 
	{
		d.style.display='block';
	}
}



function OuvrirFenetre(url,nom,details) 
{
	window.open(url,nom,details);
}

 
var photos = new Array("photos/c_primo.jpg", "photos/c_havane.jpg", "photos/c_teck.jpg","photos/c_hetre.jpg", "photos/c_nogal.jpg", "photos/c_ebene.jpg", "photos/c_neige.jpg","photos/c_mandarine.jpg","photos/c_pistache.jpg", "photos/c_storm.jpg", "photos/c_erable.jpg", "photos/c_merisier.jpg", "photos/c_natura.jpg", "photos/c_freeze.jpg","photos/c_ombrine.jpg", "photos/c_creme.jpg", "photos/c_cerise.jpg", "photos/c_prune.jpg", "photos/c_chocolat.jpg", "photos/c_carbonne.jpg", "photos/c_trendy.jpg", "photos/c_terra.jpg", "photos/c_miel.jpg", "photos/c_cottage_blanche.jpg", "photos/c_cottage_bleue.jpg", "photos/c_cottage_jaune.jpg", "photos/c_cottage_verte.jpg", "photos/c_aluminio.jpg", "photos/c_chene_droit.jpg", "photos/c_chene_chapeau.jpg", "photos/c_chene_cintre.jpg");

var modele = new Array("Primo", "Havane", "Teck", "Hêtre", "Nogal", "Ébène", "Neige", "Mandarine", "Pistache", "Storm", "Érable", "Merisier", "Natura", "Freeze", "Ombrine", "Crème", "Cerise", "Prune", "Chocolat", "Carbonne", "Trendy", "Terra", "Miel", "Cottage blanche", "Cottage bleue", "Cottage jaune", "Cottage verte", "Aluminio", "Chêne sur cadre droit", "Chêne sur cadre chapeau", "Chêne sur cadre cintré");

var price = new Array("299", "517", "517", "517", "517", "517", "517", "545", "545", "545", "606", "606", "768", "845", "845", "845", "845", "847", "847", "847", "901", "901", "901", "901", "901", "901", "901", "993", "1044", "1044", "1248");

var lien = new Array("cuisine-pack-primo.html", "cuisine-tendance-havane.html", "cuisine-tendance-teck.html", "cuisine-tendance-hetre.html", "cuisine-tendance-nogal.html", "cuisine-tendance-ebene.html", "cuisine-tendance-neige.html", "cuisine-tendance-mandarine.html", "cuisine-tendance-pistache.html", "cuisine-tendance-storm.html", "cuisine-tendance-erable.html", "cuisine-tendance-merisier.html", "cuisine-chene-natura.html", "cuisine-design-freeze.html", "cuisine-design-ombrine.html", "cuisine-design-creme.html", "cuisine-design-cerise.html", "cuisine-design-prune.html", "cuisine-design-chocolat.html", "cuisine-design-carbonne.html", "cuisine-chene-trendy.html", "cuisine-chene-terra.html", "cuisine-chene-miel.html", "cuisine-chene-cottage-blanche.html", "cuisine-chene-cottage-bleue.html", "cuisine-chene-cottage-jaune.html", "cuisine-chene-cottage-verte.html", "cuisine-design-aluminio.html", "cuisine-chene-cadre-droit.html", "cuisine-chene-cadre-chapeau.html", "cuisine-chene-cadre-cintre.html");

var thisPic = 0;

var total = photos.length - 1;
 
function processPrevious()
{
     var px, md, lienImg, image,liena;
     lienImg = document.getElementById("lien");
     md = document.getElementById("modele");
	 liena = document.getElementById("liena");
	 px = document.getElementById("price");
     image = document.getElementById("myPicture");
 
     if (thisPic > 0)
     {
	    thisPic--;
		image.src=photos[thisPic];
		lienImg.href=lien[thisPic];
		px.innerHTML = price[thisPic];
		md.innerHTML = modele[thisPic];
		liena.href=lien[thisPic];
     }
}
 
function processNext()
{
     var px, md, lienImg, image,liena;
     lienImg = document.getElementById("lien");
     md = document.getElementById("modele");
	 liena = document.getElementById("liena");
     px = document.getElementById("price");
     image = document.getElementById("myPicture");
 
     if (thisPic < total)
     {
        thisPic++;
		image.src=photos[thisPic];
		lienImg.href=lien[thisPic];
		px.innerHTML = price[thisPic];
		md.innerHTML = modele[thisPic];
		liena.href=lien[thisPic];
     }
}



function fraislivraison(somme)
{
	if (somme < 1500)
	{
		if (somme.indexOf('.') == -1) 
		{
			for (i = 0; i < 2; i++) 
			{
				if (i==0) 
					somme+=",";
				somme+="0";
			}
		}
		if (document.f.magasin.options[document.f.magasin.selectedIndex].value=="Cuisines-Stock")
		{
			document.f.frais.value="Gratuits";
			document.f.total.value=somme+" €";
		}
		else if (document.f.magasin.options[document.f.magasin.selectedIndex].value.substring(0,2)=="20")
		{
			document.f.frais.value="100,00 €";
			prix=parseFloat(somme)+100;

			prix=prix.toString();
			if (somme.indexOf('.') == -1)
			{
				for (i=0; i<2; i++) 
				{
					if (i==0) 
						prix+=",";
					prix+="0";
				}
			}

			document.f.total.value=prix+" €";
		}
		else
		{
			document.f.frais.value="85,00 €";
			prix=parseFloat(somme)+85;
			
			prix=prix.toString();
			if (somme.indexOf('.') == -1)
			{
				for (i=0; i<2; i++) 
				{
					if (i==0) 
						prix+=",";
					prix+="0";
				}
			}

			document.f.total.value=prix+" €";
		}
	}
	else
	{
		document.f.frais.value="Gratuits";
		document.f.total.value=somme+" €";
	}
}
