// ==== Expressions régulieres ==== var modele = /^[a-zA-Z0-9\.\-_]+@[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,5}$/i; var detect = navigator.userAgent.toLowerCase(); var ie=0; if (checkIt('msie')) ie=1; var galerieGlobal=""; // ==== Création de l'objet XmlHttp ==== function getNewXMLHTTP() { try { return window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { //window.location='../index.php'; } } function loadpage(url,lancer_fonction) { xmlload = getNewXMLHTTP(); xmlload.onreadystatechange = lancer_fonction; xmlload.open("GET", url, true); xmlload.send(null); return false; } // ==== Affichage de l'écran ==== function loadpanel() { try { if ((xmlload.readyState == 4)&&(xmlload.status == 200)) { ic = xmlload.responseText; removeJS = document.getElementById('dynJS'); if (removeJS) removeJS.parentNode.removeChild(removeJS); var BaliseScript=document.createElement('script'); BaliseScript.setAttribute('type','text/javascript'); BaliseScript.setAttribute('id','dynJS'); BaliseScript.text = trimScript(xmlload.responseText); document.body.appendChild(BaliseScript); } } catch (e) { } } // ==== Requête asynchrone simple ==== function valid(url,lancer_fonction) { xmlload = getNewXMLHTTP(); xmlload.onreadystatechange = lancer_fonction; xmlload.open("GET", url, true); xmlload.send(null); return false; } // ==== Identification après validation du formulaire ==== function senddatas(url,idform,lancer_fonction) { xmlhttp = getNewXMLHTTP(); xmlhttp.onreadystatechange = lancer_fonction; datas=formData2QueryString(idform); xmlhttp.open("POST", url, true); xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); xmlhttp.setRequestHeader("Content-length", datas.length); xmlhttp.setRequestHeader("Cache-Control", "no-cache"); xmlhttp.setRequestHeader("Connection", "close"); xmlhttp.send(datas); return false; } // ==== Concaténation des données de formulaire en chaîne URL ==== function formData2QueryString(docForm) { var formElem; var strSubmit = ''; var strLastElemName = ''; for (i = 0; i < docForm.elements.length; i++) { formElem = docForm.elements[i]; switch (formElem.type) { case 'text': case 'textarea': case 'select-one': case 'hidden': case 'password': strSubmit += formElem.name + '=' + encodeURIComponent(trim(formElem.value)) + '&' break; case 'select-multiple': var selectBox = formElem; for (var j=0; j1) { startDiapo(); } }); var altMenu = new Array(0,0,0,0,0,0,0); function viewChoice(num) { if ((num!=4)&&(num!=5)) { if (altMenu[num]==0) $('#boitechoix'+num).show('slow', function() { altMenu[num]=1; }); else $('#boitechoix'+num).hide('slow', function() { altMenu[num]=0; }); } else $('#boitechoix'+num).fadeIn('slow'); } function hideChoice(num) { if ((num!=4)&&(num!=5)) { $('#boitechoix'+num).hide('slow'); altMenu[num]=0; } else $('#boitechoix'+num).fadeOut('slow'); } function selectChoice(elm,num) { $('#boiteselect3').html('Taille : '+$(elm).html()); $('#boitechoix3').hide('slow'); viewCouleur(num); } function viewCouleur(num) { $('.bloc_couleur').hide(0); $('#boitecouleur'+num).show(0); } function viewdiapoleft() { $('#listediapo').animate({left:"-=311"}); } function viewdiaporight() { $('#listediapo').animate({left:"+=311"}); } function siv(elm) { $(".vc").css({'display':'none'}); $(elm).find("div").css({'display':'block'}); } var viewpop=0; function togPop() { if (viewpop==0) { $('.bloc_pop').show("slow"); viewpop=1; } else { $('.bloc_pop').hide("slow"); viewpop=0; } } function pop() { if (viewpop==0) { $('.bloc_pop').show("slow"); viewpop=1; } } var listeTabImg= new Array(); var idPhoto=0; var maxPhoto= photosGalerie.length; function startDiapo() { for (i=0;i1) galerieGlobal= setInterval("changePhoto()",5000); } function changePhoto() { $('#bloc_photo').fadeOut('slow', function() { $('#bloc_photo').html(""); $('#bloc_photo').css({'backgroundImage':"url('"+photosGalerie[idPhoto]+"')"}); $('.stitre').html(photosTitre[idPhoto]); setTimeout("$('#bloc_photo').fadeIn('slow', function() { });",500); }); idPhoto++; if (idPhoto>=maxPhoto) idPhoto=0; } function changePhotoRev() { $('#bloc_photo').fadeOut('slow', function() { $('#bloc_photo').css({'backgroundImage':"url('"+photosGalerie[idPhoto]+"')"}); $('.stitre').html(photosTitre[idPhoto]); setTimeout("$('#bloc_photo').fadeIn('slow', function() { });",500); }); idPhoto--; if (idPhoto<0) idPhoto=maxPhoto-1; } function gonext() { clearInterval(galerieGlobal); galerieGlobal=""; changePhoto(); $('.btpause').attr('src','img/flp.png'); } function gostop() { if((typeof galerieGlobal)!="string") { clearInterval(galerieGlobal); galerieGlobal=""; $('.btpause').attr('src','img/flp.png'); } else { galerieGlobal= setInterval("changePhoto()",3000); $('.btpause').attr('src','img/flm.png'); } } function goprev() { clearInterval(galerieGlobal); galerieGlobal=""; changePhotoRev(); $('.btpause').attr('src','img/flp.png'); } function readapt() { largeur= $(window).width(); largeurd=largeur-(300+largeur*.08); hauteur= $(window).height(); $("#bloc_diaporama").css({'width':largeurd}); if ($(window).width()>1200) $("#detail_produit").css({'width':largeurd-380}); else $("#detail_produit").css({'width':largeurd-310}); $("#bloc_gamme").css({'width':largeurd-30}); if (ie==1) { if (hauteur<850) { $("#container").css({"margin-top":97,"top":0 }); $("#footer").css({"height":38,"line-height":38,"bottom":20, "margin-top":0,"top":"auto"}); } else { $("#container").css({"margin-top":-330,"top":"50%" }); $("#footer").css({"height":38,"line-height":38,"bottom":"auto", "margin-top":362,"top":"50%"}); } if (largeur<1200) { $("#header").css({"margin-left":"-8%","width":"96%" }); $("#container").css({"margin-left":"-8%","width":"100%" }); $("#fondpage").css({"left":-150,"width":"140%" }); $("#bloc_textecollection").css({"left":0, "margin-left":304}); $("#bloc_actu").css({"margin-left":710 }); } else { $("#header").css({"margin-left":0,"width":"88%" }); $("#container").css({"margin-left":0,"width":"100%" }); $("#fondpage").css({"left":0,"width":"100%" }); $("#bloc_textecollection").css({"left":"-8%", "margin-left":452}); $("#bloc_actu").css({"margin-left":780 }); } if ((largeur<1200)||(hauteur<850)) $("#bloc_gamme").css({"display":"none"}); else $("#bloc_gamme").css({"display":"block"}); } } var menuchange=0; function deploie(elm) { if ((menuvisible!=elm)&&(menuchange==0)){ menuchange=1; $("#bloc_menu ul ul").slideUp('slow'); $('#smenu'+elm).slideDown('slow',function() { menuchange=0; }); menuvisible=elm; } } function zoomprod() { $('#fondproduit').css({"background":"#efeeec url('/media/media/produits/chemise-fullscreen.jpg') no-repeat center center","backgroundSize":"auto 100%"}); $('#fondproduit').fadeIn(0); tofs(); } function hidezoomprod() { $('#fondproduit').fadeOut(0); fromfs(); } function tofs() { var docElm = document.documentElement; if (docElm.requestFullscreen) { docElm.requestFullscreen(); } else if (docElm.mozRequestFullScreen) { docElm.mozRequestFullScreen(); } else if (docElm.webkitRequestFullScreen) { docElm.webkitRequestFullScreen(); } } function fromfs() { if (document.exitFullscreen) { document.exitFullscreen(); } else if (document.mozCancelFullScreen) { document.mozCancelFullScreen(); } else if (document.webkitCancelFullScreen) { document.webkitCancelFullScreen(); } } // ==== Retire les espaces en début et fin de chaine ==== function trim(chaine) { return chaine.replace(/(^\s*)|(\s*$)/g,''); } function gotoPanier() { if ((xmlload.readyState == 4)&&(xmlload.status == 200)) { window.location.href="page-mon-panier.html"; } } function gotoCommande() { if ((xmlload.readyState == 4)&&(xmlload.status == 200)) { window.location.href="page-mes-commandes.html"; } } function gotoCompte() { var rg=/succ/g; var rg2=/Déconnexion/g; if ((xmlhttp.readyState == 4)&&(xmlhttp.status == 200)) { document.getElementById('msg').style.display="none"; rep=xmlhttp.responseText.toString(); if (rg.test(rep)||rg2.test(rep)) window.location.reload(); else { document.getElementById('msg').style.display="block"; document.getElementById('msg').innerHTML=xmlhttp.responseText; } } } function recup_pass() { if ((xmlhttp.readyState == 4)&&(xmlhttp.status == 200)) { document.getElementById('msg').style.display="block"; document.getElementById('msg').innerHTML=xmlhttp.responseText; } } function supprim(num) { valid("supprimer.php?id_produit="+num,gotoPanier); } function supprim2(num) { valid("supprimer.php?id_produit="+num,gotoCommande); } function rien() { } function re(elm) { idElm= document.getElementById(elm); idElm.style.display="none"; while(idElm.hasChildNodes()==true){ var enfant=idElm.firstChild; idElm.removeChild(enfant); } var parent= idElm.parentNode; parent.removeChild(idElm); } function sdphoto() { document.sendphoto.submit(); document.getElementById('btload').style.display="none"; document.getElementById('btloader').style.display="block"; } function retry_photo() { document.getElementById('btloader').style.display="none"; document.getElementById('btload').style.display="block"; document.getElementById('_loadimage').src="blank.html"; } function majPhoto(num,chemin) { document.annonce.id_photo.value=num; document.getElementById('prev_photo').src= chemin; document.getElementById('consignPhoto').innerHTML="Cliquez ici pour modifier la photo."; } function setModeCreate() { $('#liste_boutons1').slideUp('slow'); $('#part_confirm').show('slow'); $('#bloc_create').html($('#bloc_ident')); $('#part_simple').hide(0).html(); $('#liste_boutons3').hide('slow'); $('#part_detail').show('slow'); $('#msg').css({'display':'none'}).html(''); document.compte.mode.value='creation'; } function aboverif() { if (document.abonews.abonom.value.length<=2) { alert('Veuillez indiquez votre nom.'); return false; } if (document.abonews.abomail.value.length<=2) { alert('Veuillez indiquez votre email.'); return false; } if (modeleMail.test(document.abonews.abomail.value)===false) { alert('Veuillez indiquez un email valide.'); return false; } if (document.abonews.aboprenom.value.length<=2) { alert('Veuillez indiquez votre prénom.'); return false; } return true; } function desaboverif() { if (document.abonews.abomail.value.length<=2) { alert('Veuillez indiquez votre email.'); return false; } if (modeleMail.test(document.abonews.abomail.value)===false) { alert('Veuillez indiquez un email valide.'); return false; } return true; } function contactverif() { if (document.abonews.abomail.value.length<=2) { alert('Veuillez indiquez votre email.'); return false; } if (modeleMail.test(document.abonews.abomail.value)===false) { alert('Veuillez indiquez un email valide.'); return false; } return true; }