//Version jarditec.ch du 20 mars 2023 //----------------------------------------------------------------------------------------------------------- function imprimer() { parent.frames['page'].focus(),window.print(); } // Déclaration des variables 'domaine' et 'date d'expiration' var pathname=location.pathname; var myDomain=pathname.substring(0,pathname.lastIndexOf('/')) +'/'; var date_exp = new Date(); date_exp.setTime(date_exp.getTime()+(365*24*3600*1000)); // Gestions des cookies function getCookieVal(offset) { var endstr=document.cookie.indexOf (";", offset); if (endstr==-1) endstr=document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } function GetCookie (name) { var arg=name+"="; var alen=arg.length; var clen=document.cookie.length; var i=0; while (i 2) ? argv[2] : null; var path=(argc > 3) ? argv[3] : null; var domain=(argc > 4) ? argv[4] : null; var secure=(argc > 5) ? argv[5] : false; document.cookie=name+"="+escape(value)+ ((path==null) ? "" : ("; path="+path))+ ((domain==null) ? "" : ("; domain="+domain))+ ((secure==true) ? "; secure" : ""); } function disp(txt) { document.write(txt); } function sto() { var nom="Nom"; var valeur=document.forms[0].Nom.value; if (document.forms[0].Prenom.value!="") { valeur=document.forms[0].Prenom.value+" "+valeur; } if (nom!="") { if (valeur!="") { SetCookie("_"+nom,valeur); } else alert("Pas de nom saisi !"); } else alert("Champ nom pas memorise !"); } function getc() { var compteur=13104; document.forms[0].commande_no.value=compteur; var nom="numero"; var valeur=compteur; if (valeur!="") { SetCookie("_"+nom,valeur); } //else alert("Il n'y a pas de valeur pour "+nom+" !"); var nom="Nom"; if (nom!="") { var valeur=GetCookie("_"+nom); if (valeur!=null) {document.forms[0].name.value=valeur} else document.forms[0].name.value=""; } else document.forms[0].name.value=""; } //----------------------------------------------------------------------------------------------------------- function alterError(value) { if (value<=0.99) { newPounds = '0'; } else { newPounds = parseInt(value); } newPence = parseInt((value+.0008 - newPounds)* 100); if (eval(newPence) <= 9) newPence='0'+newPence; newString = newPounds + '.' + newPence; return (newString); } //----------------------------------------------------------------------------------------------------------- function buyItem(newRef, newItem, newPrice, newQuantity) { if (newQuantity < 0 || newPrice < 0) { rc = alert('Entrez une quantité positive !'); } else { if (confirm('Ajouter : '+newQuantity+' x '+newItem+' dans le panier ?')) { index = document.cookie.indexOf("GSBasket"); countbegin = (document.cookie.indexOf("=", index) + 1); countend = document.cookie.indexOf(";", index); if (countend == -1) { countend = document.cookie.length; } document.cookie="GSBasket="+document.cookie.substring(countbegin, countend)+"["+newRef+"|"+newItem+"|"+newPrice+"|"+newQuantity+"];path=/;"; } } } //----------------------------------------------------------------------------------------------------------- function resetShoppingBasket() { index = document.cookie.indexOf("GSBasket"); document.cookie="GSBasket=."; if (document.cookie) { } else { alert('Vous avez desactive les cookies.\nCe panier necessite des cookies pour stocker votre commande.\nVous devez donc activer les cookies dans votre configuration de nnavigateur et recommencer votre commande.'); } } //----------------------------------------------------------------------------------------------------------- function showItems() { var tablerowcolor = '#F0F0F0'; index = document.cookie.indexOf("GSBasket"); countbegin = (document.cookie.indexOf("=", index) + 1); countend = document.cookie.indexOf(";", index); if (countend == -1) { countend = document.cookie.length; } fulllist = document.cookie.substring(countbegin, countend); totprice = 0; document.writeln('
'); document.writeln('
'); document.writeln(''); document.writeln(''); // Données: document.writeln(''); itemlist = 0; for (var i = 0; i <= fulllist.length; i++) { if (fulllist.substring(i,i+1) == '[') { itemstart = i+1; thisitem = 1; } else if (fulllist.substring(i,i+1) == ']') { itemend = i; thequantity = fulllist.substring(itemstart, itemend); itemtotal = 0; itemtotal = (eval(theprice*thequantity)); temptotal = itemtotal * 100; totprice = totprice + itemtotal; itemlist=itemlist+1; document.write(''); document.write(''); if (tablerowcolor == '#F0F0F0') { tablerowcolor = "#F8F8F8"; } else { tablerowcolor = "#F0F0F0"; } } else if (fulllist.substring(i,i+1) == '|') { if (thisitem==1) theref = fulllist.substring(itemstart, i); if (thisitem==2) theitem = fulllist.substring(itemstart, i); if (thisitem==3) theprice = fulllist.substring(itemstart, i); thisitem++; itemstart=i+1; } } document.writeln(''); document.writeln(''); document.writeln('
RéfDésignationQuantitéPrix ua TTCTotal TTC 

'+theref+''+theitem+''+theprice+''+alterError(itemtotal)+'Effacer Calculer

Total de la commande TTCCHF '+alterError(totprice)+' 
'); document.writeln('
'); document.writeln('
'); } //----------------------------------------------------------------------------------------------------------- function amendItem(itemno, newquant) { newItemList = null; itemlist = 0; for (var i = 0; i <= fulllist.length; i++) { if (fulllist.substring(i,i+1) == '[') { thisitem = 1; itemstart = i+1; fullstart = i+1; } else if (fulllist.substring(i,i+1) == ']') { itemend = i; itemlist=itemlist+1; if (itemlist != itemno) { newItemList = newItemList+'['+fulllist.substring(fullstart, itemend)+']'; } else { newItemList = newItemList + '['+theref+'|'+theitem+'|'+theprice+'|'+newquant+']'; } } else if (fulllist.substring(i,i+1) == '|') { if (thisitem==1) theref = fulllist.substring(itemstart, i); if (thisitem==2) theitem = fulllist.substring(itemstart, i); if (thisitem==3) theprice = fulllist.substring(itemstart, i); thisitem++; itemstart=i+1; } } index = document.cookie.indexOf("GSBasket"); document.cookie="GSBasket="+newItemList; self.location = "panier.html"; } //----------------------------------------------------------------------------------------------------------- function removeItem(itemno) { newItemList = null; itemlist = 0; for (var i = 0; i <= fulllist.length; i++) { if (fulllist.substring(i,i+1) == '[') { itemstart = i+1; } else if (fulllist.substring(i,i+1) == ']') { itemend = i; theitem = fulllist.substring(itemstart, itemend); itemlist=itemlist+1; if (itemlist != itemno) { newItemList = newItemList+'['+fulllist.substring(itemstart, itemend)+']'; } } } index = document.cookie.indexOf("GSBasket"); document.cookie="GSBasket="+newItemList; self.location = "panier.html"; } //----------------------------------------------------------------------------------------------------------- // clearBasket() - efface tout le contenu du panier function clearBasket() { if (confirm('Voulez vous vider votre panier ?')) { index = document.cookie.indexOf("GSBasket"); document.cookie="GSBasket=."; self.location = "panier.html"; } } //----------------------------------------------------------------------------------------------------------- // openWin() function openWin( windowURL, windowName, windowFeatures ) { return window.open( windowURL, windowName, windowFeatures ) ; } //----------------------------------------------------------------------------------------------------------- function fshowItems() { var tablerowcolor = '#F0F0F0'; index = document.cookie.indexOf("GSBasket"); countbegin = (document.cookie.indexOf("=", index) + 1); countend = document.cookie.indexOf(";", index); if (countend == -1) { countend = document.cookie.length; } fulllist = document.cookie.substring(countbegin, countend); totprice = 12; document.writeln(''); document.writeln(''); document.writeln(''); itemlist = 0; for (var i = 0; i <= fulllist.length; i++) { if (fulllist.substring(i,i+1) == '[') { thisitem = 1; itemstart = i+1; } else if (fulllist.substring(i,i+1) == ']') { itemend = i; thequantity = fulllist.substring(itemstart, itemend); itemtotal = 0; itemtotal = (eval(theprice*thequantity)); temptotal = itemtotal * 100; totprice = totprice + itemtotal; itemlist=itemlist+1; document.write(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); if (tablerowcolor == '#F0F0F0') { tablerowcolor = "#F8F8F8"; } else { tablerowcolor = "#F0F0F0"; } } else if (fulllist.substring(i,i+1) == '|') { if (thisitem==1) theref = fulllist.substring(itemstart, i); if (thisitem==2) theitem = fulllist.substring(itemstart, i); if (thisitem==3) theprice = fulllist.substring(itemstart, i); thisitem++; itemstart=i+1; } } document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln('
RéfArticleQuantitéPrix ua TTCTotal TTC

'+theref+''+theitem+''+thequantity+''+theprice+''+alterError(itemtotal)+'
Frais de livraison12.00

Total de la commande TTCCHF '+alterError(totprice)+'
'); } //----------------------------------------------------------------------------------------------------------- function cshowItems() { var tablerowcolor = '#F0F0F0'; index = document.cookie.indexOf("GSBasket"); countbegin = (document.cookie.indexOf("=", index) + 1); countend = document.cookie.indexOf(";", index); if (countend == -1) { countend = document.cookie.length; } fulllist = document.cookie.substring(countbegin, countend); totprice = 0; itemlist = 0; for (var i = 0; i <= fulllist.length; i++) { if (fulllist.substring(i,i+1) == '[') { thisitem = 1; itemstart = i+1; } else if (fulllist.substring(i,i+1) == ']') { itemend = i; thequantity = fulllist.substring(itemstart, itemend); itemtotal = 0; itemtotal = (eval(theprice*thequantity)); temptotal = itemtotal * 100; totprice = totprice + itemtotal; itemlist=itemlist+1; } else if (fulllist.substring(i,i+1) == '|') { if (thisitem==1) theref = fulllist.substring(itemstart, i); if (thisitem==2) theitem = fulllist.substring(itemstart, i); if (thisitem==3) theprice = fulllist.substring(itemstart, i); thisitem++; itemstart=i+1; } } document.writeln(''+alterError(totprice)+''); } //----------------------------------------------------------------------------------------------------------- function zshowItems() { index = document.cookie.indexOf("GSBasket"); countbegin = (document.cookie.indexOf("=", index) + 1); countend = document.cookie.indexOf(";", index); if (countend == -1) { countend = document.cookie.length; } fulllist = document.cookie.substring(countbegin, countend); totprice = 12; itemlist = 0; for (var i = 0; i <= fulllist.length; i++) { if (fulllist.substring(i,i+1) == '[') { thisitem = 1; itemstart = i+1; } else if (fulllist.substring(i,i+1) == ']') { itemend = i; thequantity = fulllist.substring(itemstart, itemend); itemtotal = 0; itemtotal = (eval(theprice*thequantity)); temptotal = itemtotal * 100; totprice = totprice + itemtotal; itemlist=itemlist+1; } else if (fulllist.substring(i,i+1) == '|') { if (thisitem==1) theref = fulllist.substring(itemstart, i); if (thisitem==2) theitem = fulllist.substring(itemstart, i); if (thisitem==3) theprice = fulllist.substring(itemstart, i); thisitem++; itemstart=i+1; } } document.writeln('Total CHF'); } //----------------------------------------------------------------------------------------------------------- function veriformule() { if(document.formulaire.Nom.value == "") { alert("Vous avez oublié d'indiquer votre nom!"); document.formulaire.Nom.focus(); return false; } if(document.formulaire.Courriel.value == "") { alert("Merci de saisir votre adresse électronique!"); document.formulaire.Courriel.focus(); return false; } if(document.formulaire.Courriel.value.indexOf('@') == -1) { alert("Ce n'est pas une adresse électronique!"); document.formulaire.Courriel.focus(); return false; } if(!(confirm('Pour nous envoyer maintenant ce formulaire, cliquez sur OK,\nsinon, cliquez sur annuler'))) { return false; } }