function verif_obligatoire(name)			{				var formNodeList = document.donnees1.elements;				var formOK = true;								for(var i = 0; i < formNodeList.length; i++)				{					if(((formNodeList[i].type == "text")||(formNodeList[i].type == "select-one"))  && (formNodeList[i].name.substring(0,3) == name))					{						if (((formNodeList[i].type.toLowerCase() == "text") && (formNodeList[i].value.toLowerCase() == "")) || ((formNodeList[i].type == "select-one") && (formNodeList[i].selectedIndex == 0)))						{							formNodeList[i].focus();							formOK = false;						}					}				}				if (formOK == false) {alert('Attention, certaines informations obligatoire ne sont pas renseignées.');}				return formOK;			}            window.addEvent('domready', function() {//----------------------------  Gestion Historique ------------------------------HistoryManager.initialize();try{this.history = HistoryManager.register(this.historyKey,[1],	function(values) {;}.bind(this),	function(values) {return [this.historyKey, '(', values[0], ')'].join('');}.bind(this),	this.historyKey + '\\((\\d+)\\)');	//function(values) {return [this.historyKey, ''].join('');}.bind(this),}catch(e){;};//----------------------------  Gestion Web2 ------------------------------		var list = $$('a.moo_request');    	list.each(function(element)    	{			element.addEvent('click', function(e)			{       		 	e = new Event(e).stop();       	 		$$(element.get('target')).load(element.get('href'));
                setTimeout("window.scrollTo(0,0);", 100);       	 		//this.history.setValue(0, this.page);						HistoryManager.setValue(this.historyKey, 0, this.page);						HistoryManager.setValues(this.historyKey, [0]);        	});		});				//---------------------  Menu deroulant gauche ---------------------------	var myAccordion = new Accordion($('sommaire'), $$('.famille'), $$('.sousfamilles'), {		opacity: false,		display:0,		onActive: function(toggler, element){			toggler.setStyle('color', '#41464D');		},		onBackground: function(toggler, element){			toggler.setStyle('color', '#528CE0');		}	});	//---------------------  Lancement Historique ---------------------------		HistoryManager.start();	});function reloadHrefMootools(){	var list = $$('a.moo_request');   	list.each(function(element)   		{		element.addEvent('click', function(e)			{      		e = new Event(e).stop();      		$$(element.get('target')).load(element.get('href'));
                setTimeout("window.scrollTo(0,0);", 100);
       		});		});		for(b = 1; b <= 6; b++)	{		var list = $$('div.col'+b);    	list.each(function(element)    	{			element.addEvent('click', function(e)			{      			 	e = new Event(e).stop();      		 		$$(element.get('target')).load(element.get('alt'));
                    setTimeout("window.scrollTo(0,0);", 100);       		});		});				var list = $$('div.col'+b+'b');    	list.each(function(element)    	{			element.addEvent('click', function(e)			{      			 	e = new Event(e).stop();      		 		$$(element.get('target')).load(element.get('alt'));
                    setTimeout("window.scrollTo(0,0);", 100);       		});		});	}	//---------------------  Formulaire de commande -----------------------			$$('.Bouton1').addEvent('click', function() 		{			pblock2 = new Fx.Tween('Question1', 'opacity');			pblock2.start('opacity','1','0').chain				(   				function(){ pblock2 = new Fx.Tween('Question2', 'opacity');			pblock2.start('opacity','0','1'); }   				);		});			$$('.Bouton2').addEvent('click', function() 		{			pblock2 = new Fx.Tween('Question2', 'opacity');			pblock2.start('opacity','1','0').chain				(   				function(){ pblock2 = new Fx.Tween('Question3', 'opacity');				pblock2.start('opacity','0','1'); }   					);		});			$$('.Bouton3').addEvent('click', function() 		{			pblock2 = new Fx.Tween('Question3', 'opacity');			pblock2.start('opacity','1','0').chain				(   				function(){ pblock2 = new Fx.Tween('Question4', 'opacity');				pblock2.start('opacity','0','1'); }   					);		});			$$('.form_tampon').addEvent('click', function(e) {		e.stop();		$$($('moo_form').get('target')).load('bloc.html?menu=lsv&'+constructURL($('moo_form')));
                    setTimeout("window.scrollTo(0,0);", 100);	});}function constructURL(elem){	var list = elem.getChildren();	var url = '';	list.each(function(e)	{		if(e.hasChild)			url = url+constructURL(e);				if((e.get('tag') == 'input')||(e.get('tag') == 'select')||(e.get('tag') == 'textaera'))		{			if(e.get('type') == 'checkbox')				url = url + e.get('name')+'='+e.get('checked')+'&'			else if(e.get('type') == 'radio')				url = url + e.get('value')+'='+e.get('checked')+'&'			else				url = url + e.get('name')+'='+e.get('value')+'&'		}	});	return url;}function totalControl(){var pFields = document.frm.elements;var pSelect, poption;var nbmax = parseInt(pFields.qtemax.value);var stepevol;var iSelect, nbcmd, nbreste;		// compte le consomme		stepevol = (nbmax / 10);	if (stepevol<5) stepevol = 5;		nbcmd = 0;	for (iSelect=1; pSelect = pFields['taille'+iSelect]; iSelect++)	{		iline = pSelect.selectedIndex;		if (iline>0) 		{			value = parseInt(pSelect.options[iline].value);			nbcmd += value;		}	}		// plafonne les SELECT		nbreste = nbmax-nbcmd;		for (iSelect=1; pSelect = pFields['taille'+iSelect]; iSelect++)	{		iline = pSelect.selectedIndex;		if (iline<=0) iline=0;				value = parseInt(pSelect.options[iline].value);		nmaxset = value + nbreste;		pSelect.options.length=1;		stepvalue=stepevol;		while (stepvalue<=nmaxset)		{			poption = new Option(stepvalue,stepvalue)			pSelect.options[pSelect.options.length]=poption;			if (stepvalue==value) pSelect.selectedIndex = pSelect.options.length-1;			stepvalue+= stepevol;		}	}		document.getElementById('encadre_commande').style.visibility = ( nbreste==0 ? 'visible':'hidden' );}function recalcPreview(){	var t;	var taux = parseFloat(document.frm.tauxtva.value);	var baseprix  = document.frm.baseprix.value.replace(",",".").replace(" ","");	var qte  = document.frm.qte.value.replace(",",".").replace(" ","");	t = baseprix.split("euro")	baseprix = t[0];//	var baseprix  = document.frm.baseprix.value.replace(",",".").replace(" ","");	baseprix  = parseFloat(baseprix);	var prix = baseprix;	var s;	var list = $$('.optionclass');    	list.each(function(poption)    	{			if (poption.selected)			{				t = poption.text.split ("(") 				if (t.length>1)				{					s = t[1].replace(/ /g, "");					if (s.charAt(0)=="+" || s.charAt(0)=="-")						{						t = s.split("euro")						prix = prix + parseFloat(t[0]); 						}				}							}		});  if (parseFloat(qte)>0) prix = prix * parseFloat(qte);		// formattage et prise en compte tva 	vht = "" + Math.round(prix * 100);	vht = vht.substr(0,vht.length-2)+","+vht.substr(vht.length-2);		vttc = "" + Math.round(prix * (100 + taux)) ;	vttc = vttc.substr(0,vttc.length-2)+","+vttc.substr(vttc.length-2);var p;	p = document.getElementById("montantht"); if (p) p.innerHTML = vht;	p = document.getElementById("montantttc"); if (p) p.innerHTML = vttc;	p = document.getElementById("montant"); if (p) p.value = vht;	}function amountFormat(v){var s;var entier, decimal;	entier = Math.floor(v);	decimal = "" + (100.0 + (v - entier ) * 100.0);	return entier + "," + decimal.substr(1,2);}function qte2Price(){var pFields = document.frm.elements;var qte = parseInt(pFields.qte.value);var nbTarifs = parseInt(pFields.nb_tarifs.value);var fraisColor = pFields.frais_tech.value;var vHT = 0;var vTTC = 0;var i, ptarif, pqte, starif, vTarif, qteTarif;	// identifie le nb de couleurs	imarque = 1;	ncolors = 0;	nmarquesCaps = 0;    seuil=0;	while ( pMarque = pFields["Marquage "+imarque] )	{		// si SANS est present alors il peut y avoir un NEUTRE		if (pMarque.options[0].value=="Sans")		{			if ( (iselected = pMarque.selectedIndex) >= 1)			{				sMarque = pMarque.options[iselected].value;				if (sMarque=="Sans");				else if (sMarque.indexOf("2 couleurs") >=0)		ncolors += 2;				else if (sMarque.indexOf("3 couleurs") >=0)		ncolors += 3;				else if (sMarque.indexOf("4 couleurs") >=0)		ncolors += 4;				else	ncolors += 1;			}		}		else		// si SANS est absent alors 1 ou 2		{			ncolors += 1;			if ( (iselected = pMarque.selectedIndex) >= 1)			{				sMarque = pMarque.options[iselected].value;				if (sMarque.indexOf("2 couleurs") >=0)			ncolors += 1;				else if (sMarque.indexOf("3 couleurs") >=0)		ncolors += 2;				else if (sMarque.indexOf("4 couleurs") >=0)		ncolors += 3;			}		}		nmarquesCaps ++;		imarque++;	}	vTarif = 0;	qteTarif = 0;	tauxTVA = parseFloat(document.frm.tauxtva.value);	// recherche du tarif adapte a la quantite et neutre		if (isNaN(qte) || qte==0) { qte = 0;}	bhaveNeutral =false;    	for(i=1; i<=(nbTarifs+1);i++)	{		pqte = document.getElementById("quantite"+i);		if (pqte)		{			lqte = parseInt(pqte.innerHTML);			starif = document.getElementById("tarif"+i).innerHTML;			ttarif = starif.split(" ");			tempTarif = parseFloat ( ttarif[0].replace(",","."));			tempTarif = Math.round ( tempTarif * 100.0) / 100.0;	            if (seuil==0) seuil = lqte;					if (lqte==0 || isNaN(lqte))			{				bhaveNeutral =true;				if (ncolors==0)				{					vTarif = tempTarif;					break;				}			}			else			if (qte>=lqte)			{				vTarif = tempTarif;				qteTarif = lqte;			}		}	}        if (qte<seuil)vTarif=0;	vHT = vTarif;		// variation sur le tarif	// 0.16/0.12 5000/0.10 10000;;		coeff= 0;	iFrais = 0;	vFraisFixeHT = 0;	vFrais = pFields['frais'].value;	tFrais = new Array();	if (ncolors> 0  && vHT>0 && vFrais!="")	{		tFrais = vFrais.split (";");		if (ncolors>1)		{			if ( tFrais.length==1 ) 					{ coeff = ncolors -1; iFrais = 0 ; }			else	{ coeff = 1; iFrais = ncolors-2 ; }		}	}	if (ncolors>1 && vHT>0)	{		srate = fraisColor;		if (fraisColor.substr(0,1)=="*")  srate = fraisColor.substr(1);				temp = parseFloat ( srate.replace(",","."));		temp  = Math.round ( temp  * 100.0) / 100.0;				if (fraisColor.substr(0,1)=="*") vFraisFixeHT = temp* (ncolors-1);		else  vFraisFixeHT = temp;	}		vdeltaTarif = 0;	if (iFrais>=0 && vFrais!="" && tFrais.length>0)	{		sLigneFrais = tFrais[iFrais];		tPrixQteList = sLigneFrais.split ("/");				for(iFraisSeuil=0; iFraisSeuil<tPrixQteList.length; iFraisSeuil++)		{			tPrixQte = tPrixQteList[iFraisSeuil].split(" ");			if (tPrixQte.length==1) tPrixQte[1]=0;						tempTarif = parseFloat ( tPrixQte[0].replace(",","."));			vPrix = Math.round ( tempTarif * 100.0) / 100.0;			lqte = parseInt(tPrixQte[1]);						if (qte>=lqte)			{				vdeltaTarif = coeff * vPrix;			}		}	}//stemp = "	coeff:" + coeff +"	ncolors:" +  ncolors  +"	iFrais:" + iFrais +"	vdeltaTarif:" +  vdeltaTarif;	// on n'applique le delta que si la commande est acceptable		if (vHT>0)	vHT += vdeltaTarif;		// mise en place tarifs	montantHT = Math.round( (vHT * qte + vFraisFixeHT) * 100 ) / 100;	montantTTC = Math.round (montantHT * ( 100.0 + tauxTVA )) / 100.0;		document.getElementById('montantht').innerHTML = amountFormat(montantHT);	document.getElementById('montantttc').innerHTML = amountFormat(montantTTC);	p = document.getElementById("montant"); if (p) p.value = amountFormat(montantHT);	document.getElementById('commander').style.visibility = (montantHT ? "visible":"hidden");	document.getElementById('montants').style.visibility = document.getElementById('commander').style.visibility;		//document.getElementById('trace').innerHTML = stemp;}