function pim_nl_verify(form) { var passed = false; var blnRetval, intAtSign, intDot, intComma, intSpace, intLastDot, intDomain, intStrLen; if (form.Email){ intAtSign=form.Email.value.indexOf("@"); intDot=form.Email.value.indexOf(".",intAtSign); intComma=form.Email.value.indexOf(","); intSpace=form.Email.value.indexOf(" "); intLastDot=form.Email.value.lastIndexOf("."); intDomain=intDot-intAtSign; intStrLen=form.Email.value.length; // *** CHECK FOR BLANK EMAIL VALUE if (form.Email.value == "" ) { alert("Vous n'avez pas entré d'adresse e-mail."); form.Email.focus(); passed = false; } // **** CHECK FOR THE @ SIGN? else if (intAtSign == -1) { alert("Une adresse e-mail contient nécessairement un @."); form.Email.focus(); passed = false; } // **** Check for commas **** else if (intComma != -1) { alert("Une adresse e-mail ne peut pas contenir de virgule."); form.Email.focus(); passed = false; } // **** Check for a space **** else if (intSpace != -1) { alert("Une adresse e-mail ne peut pas contenir d'espace."); form.Email.focus(); passed = false; } // **** Check for char between the @ and dot, chars between dots, and at least 1 char after the last dot **** else if ((intDot <= 2) || (intDomain <= 1) || (intStrLen-(intLastDot+1) < 2)) { alert("Entrez une adresse valide SVP.\nCette adresse est invalide : " + form.Email.value); form.Email.focus(); passed = false; } else { passed = true; } } else { passed = true; } return passed; } /** * @desc fait apparaitre un petit aperçu des produits dans la liste des gammes, en survol (changement de background) * @param catID : id de la cat, pour construire les id des elements a retoucher, imgURL : url de l'iamge a afficher dedans * fondURL : image de fond du conteneur (bordure du cadre de stockage) * @return rien */ function PIMsmallPreview(catID,imgURL,fondURL) { if ( (catID == '') || (imgURL == '') ) return false; // document.getElementById('prev_'+catID).style.backgroundImage='url('+imgURL+')'; document.getElementById('prev_'+catID).innerHTML = ''; document.getElementById('global_'+catID).style.backgroundImage='url('+fondURL+')'; } /** * @desc fait disparaitre le petit aperçu créé par la fonction precedente * @param catID : id de la cat, pour construire les id des elements a faire disparaitre * @return rien */ function PIMdelPreview(catID) { if ( catID == '' ) return false; // document.getElementById('prev_'+catID).style.backgroundImage=''; document.getElementById('prev_'+catID).innerHTML = ''; document.getElementById('global_'+catID).style.backgroundImage=''; } /** * @desc fonction servant a faire apparaitre ou disparaitre une div en utilisant les classes CSS visible et cachee * @param id de la div a cacher * @return rien */ function divDisplayHide(divId) { if (!document.getElementById(divId)) return false; current = document.getElementById(divId).className; if (current == 'visible') { document.getElementById(divId).className = document.getElementById(divId).className.replace('visible','cachee'); } else if (current == 'cachee') { document.getElementById(divId).className = document.getElementById(divId).className.replace('cachee','visible'); } else { return false; } } /** * @desc fonction de mise a jour dynamiquement coté client le tableau des sous produits * @param * @return rien */ function updateSubProd(aTabSource,iCurrentSize,iCurrentLine) { // alert(iCurrentSize); // Mise a jour de la colonne nom document.getElementById('subname_'+iCurrentLine).innerHTML = aTabSource[iCurrentSize][0]; // Mise a jour de la colonne disponibilité document.getElementById('dispo_'+iCurrentLine).innerHTML = aTabSource[iCurrentSize][1]; // Mise a jour de la colonne prix document.getElementById('prix_'+iCurrentLine).innerHTML = aTabSource[iCurrentSize][2]; // Mise a jour de la colonne permettant l'ajout au panier document.getElementById('ajout_'+iCurrentLine).innerHTML = aTabSource[iCurrentSize][3]; } /** * @desc fonction servant a assigner une valeur a la propriété souhaitée p un champ donné * @param sIdChamp : id du champ concerné, sPpt : propriété (value, caption...), sVal : nouveau contenu * @return rien */ function emptyField(sIdChamp,sPpt,sVal,sValDef) { if ( (sIdChamp == '') || (sPpt == '') || (typeof (sIdChamp)=='undefined') || (typeof(sPpt)=='undefined') ) return false; // Si la valeur par defaut est remplie on ne continue que si on a bien cette valeur dans la propriété if (sValDef != '') { if ( eval('document.getElementById("' + '' + sIdChamp + '").' + sPpt + ' != ' + '"' + sValDef + '";') ) return false; } // document.getElementById(''+sIdChamp).value = sVal; // L'objectif document.getElementById("sIdChamp").sPpt = "sVal"; eval('document.getElementById("' + '' + sIdChamp + '").' + sPpt + ' = ' + '"' + sVal + '";'); }