state='out'; table=new Array; pos=new Array; pastille_in=0; attribute='base'; var xhr='false'; var panier; var tempdiv=document.createElement('div'); var nmb_lignes; window.onload=function() { init(); } function init(){ if (top.location != self.location) { top.location.replace(self.location); } if(document.getElementById('newsletter')) document.getElementById('newsletter').onsubmit=function(){ var wrong=''; wrong=validMail(document.getElementById('newsletter').email.value); if(wrong=='') {return true;} else {return false;} } if(document.getElementById('form_commander'))document.getElementById('form_commander').onsubmit=validCommande; if(document.getElementById('panier')) { nmb_lignes=0; while (document.getElementById('panier_ligne'+nmb_lignes)){ document.getElementById('panier_ligne'+nmb_lignes).getElementsByTagName('form')[0].index=nmb_lignes; document.getElementById('panier_ligne'+nmb_lignes).getElementsByTagName('form')[1].index=nmb_lignes; document.getElementById('panier_ligne'+nmb_lignes).getElementsByTagName('form')[0].onsubmit=request_supPanier; document.getElementById('panier_ligne'+nmb_lignes).getElementsByTagName('form')[1].onsubmit=request_changePanier; nmb_lignes++; } } if(document.getElementById('listing')){ nmb_lignes=0; while (document.getElementById('form'+nmb_lignes)){ document.getElementById('form'+nmb_lignes).index=nmb_lignes; document.getElementById('form'+nmb_lignes).onsubmit=request_ajoutPanier; ref=document.getElementById('form'+nmb_lignes).getElementsByTagName('input')[1]; if (attribute=='explorer') {offset_left=ref.offsetLeft;offset_top=ref.offsetTop;} else {offset_left=ref.offsetLeft;offset_top=ref.offsetTop;} document.getElementById('reponse'+nmb_lignes).style.left=offset_left+55+'px'; document.getElementById('reponse'+nmb_lignes).style.top=offset_top+'px'; nmb_lignes++; } } if(document.getElementById('produit')){ nmb_lignes=0; document.getElementById('form'+nmb_lignes).index=nmb_lignes; document.getElementById('form'+nmb_lignes).onsubmit=request_ajoutPanier; ref=document.getElementById('form'+nmb_lignes).getElementsByTagName('input')[1]; if (attribute=='explorer') {offset_left=ref.offsetLeft;offset_top=ref.offsetTop;} else {offset_left=ref.offsetLeft;offset_top=ref.offsetTop;} document.getElementById('reponse'+nmb_lignes).style.left=offset_left+55+'px'; document.getElementById('reponse'+nmb_lignes).style.top=offset_top+'px'; } if(document.getElementById('form_inscription')){document.getElementById('form_inscription').onsubmit=validInscription;} if(document.getElementById('form_confirmation')){document.getElementById('form_confirmation').onload=setTimeout("document.getElementById('form_confirmation').submit()", 1000);} if(document.getElementById('article')){ nmb_lignes=0; links=document.getElementById('contenu').getElementsByTagName('a'); for(i=0;i31)||(mois>12)||(check!=sum))){incorrects=incorrects+virgule+'date de naissance';virgule=", ";} if (incorrects=='') { document.getElementById('inscription_message').innerHTML=''; if(window.XMLHttpRequest){ xhr= new XMLHttpRequest(); } else { if (window.ActiveXObject) { try { xhr= new ActiveXObject("Microsoft.XMLHttp"); } catch(e) {} } } if (xhr) { url='ajax_verif_email.php?email='+email.value; xhr.onreadystatechange=ajaxvalidInscription; xhr.open("GET",url,true); xhr.send(null); } else { response='error'; } return false; } else { var msg="Les champs suivant ont été mal renseignés: "+incorrects+'.
'; document.getElementById('inscription_message').innerHTML=msg; return false; } return false; } function ajaxvalidInscription(){ if(xhr.readyState==4) { if(xhr.status==200){ if(xhr.responseText.indexOf('OK')!=-1) document.getElementById('form_inscription').submit(); else document.getElementById('inscription_message').innerHTML=document.getElementById('inscription_message').innerHTML+"Adresse email déjà utilisée."; } } } function validCommande(){ if(document.getElementById('commander_cgv').checked==true)return true; else document.getElementById('msg_cgv').innerHTML=" Vous devez confirmer que vous acceptez les Conditions générales de vente de Biorespect.com."; return false; } function request(){ if(window.XMLHttpRequest){ xhr= new XMLHttpRequest(); } else { if (window.ActiveXObject) { try { xhr= new ActiveXObject("Microsoft.XMLHttp"); } catch(e) {} } } if (xhr) { var url='ajax_form.php'; xhr.onreadystatechange=showContents; xhr.open("GET",url,true); xhr.send(null); } else { response='error'; } } function showContents() { if(xhr.readyState==4) { if(xhr.status==200){ alert (xhr.responseText); } } } function preg_replace (array_pattern, array_pattern_replace, my_string) { var new_string = String (my_string); for (i=0; i=0)alert('Formatage du disque. Veuillez patienter'); //if (navigator.platform.indexOf('Linux',0)>=0) attribute='linux'; attribute='base'; if (navigator.userAgent.indexOf('Firefox',0)!=-1) attribute='firefox'; if (navigator.userAgent.indexOf('Iceweasel',0)!=-1) attribute='Iceweasel'; if (navigator.userAgent.indexOf('Safari',0)!=-1) attribute='safari'; if (navigator.appName.indexOf('Microsoft Internet Explorer',0)>=0) attribute='explorer'; feuilles=document.getElementsByTagName('link'); for (var i=0; iemail.length) {v_wrong='Adresse email invalide';} return v_wrong; }