function radioChoiceMade(formu,nomGroupe){var compteur;compteur=0;while(compteur<formu.elements[nomGroupe].length){if(formu.elements[nomGroupe][compteur].checked){return true;}compteur++;}return false;};var highlightedZone=null;function setHighlightedZone(newZone){if((highlightedZone)&&(highlightedZone.style)){highlightedZone.style.backgroundColor="white";}highlightedZone=newZone;if(highlightedZone){highlightZone(12);}};function highlightZone(countdown){if(countdown<0){setHighlightedZone(null);return;}if((highlightedZone)&&(highlightedZone.style)){if(highlightedZone.style.backgroundColor=="orange"){highlightedZone.style.backgroundColor="white";}else{highlightedZone.style.backgroundColor="orange";}window.setTimeout("highlightZone("+(countdown-1)+")",100);}};function checkMandatoryFields(formu,fieldsNamesArray){var err="no";var i=0;var j=0;for(i=0;i<formu.elements.length;i++){var el=formu.elements[i];for(j=0;j<fieldsNamesArray.length;j++){if(el.name==fieldsNamesArray[j]){if((el.type=="text")&&(el.value=="")){err=i;i=formu.elements.length;}if((el.type.indexOf("select")!=-1)&&(el.selectedIndex==0)){err=i;i=formu.elements.length;}if((el.type=="radio")&&!radioChoiceMade(formu,formu.elements[i].name)){err=i;i=formu.elements.length;}if((el.type=="password")&&(el.value=="")){err=i;i=formu.elements.length;}}}}if(err!="no"){alert("The field indicated must be filled in to process your request.");setHighlightedZone(formu.elements[err]);formu.elements[err].focus();return false;}return true;};function initDateField(formu,dayFieldName,monthFieldName,yearFieldName,yearMinValue,dayDefaultValue,monthDefaultValue,yearDefaultValue){var selD=formu.elements[dayFieldName];var selM=formu.elements[monthFieldName];var selY=formu.elements[yearFieldName];if(!yearMinValue)yearMinValue=1900;var i=1;var j=1;for(i=1;i<=31;i++){selD.options[j]=new Option(i,i);j++;}if(dayDefaultValue)selD.selectedIndex=dayDefaultValue;j=1;for(i=1;i<=12;i++){selM.options[j]=new Option(i,i);j++;}if(monthDefaultValue)selM.selectedIndex=monthDefaultValue;j=1;var oDate=new Date();var preselY=0;for(i=oDate.getFullYear();i>=yearMinValue;i--){selY.options[j]=new Option(i,i);if(yearDefaultValue&&i==yearDefaultValue)preselY=j;j++;}selY.selectedIndex=preselY;};function checkDateField(formu,dayFieldName,monthFieldName,yearFieldName,when){var selD=formu.elements[dayFieldName];var selM=formu.elements[monthFieldName];var selY=formu.elements[yearFieldName];if((selD.selectedIndex>0)||(selM.selectedIndex>0)||(selY.selectedIndex>0)){if((selD.selectedIndex<=0)||(selM.selectedIndex<=0)||(selY.selectedIndex<=0)){alert("Please enter the exact date");setHighlightedZone(selD);selD.focus();return false;}if(when){var oDate=new Date(selY.value,selM.value-1,selD.value);var oNow=new Date();if(when=="past"){if(oDate.getTime()>=oNow.getTime()+24*60*60*1000+30*60*1000){alert("Please enter the exact date");setHighlightedZone(selD);selD.focus();return false;}}else if(when=="future"){if(oDate.getTime()<=oNow.getTime()-30*60*1000){alert("Please enter the exact date");setHighlightedZone(selD);selD.focus();return false;}}}}return true;};function checkEmailField(formu,emailFieldName){var EMAIL_REG=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;if(!EMAIL_REG.test(formu.elements[emailFieldName].value)){alert("The format of the e-mail address is incorrect. Please use the following model: yourname@provider.com");setHighlightedZone(formu.elements[emailFieldName]);formu.elements[emailFieldName].focus();return false;}return true;};function checkPasswordField(formu,pwdFieldName,pwdConfirmFieldName){if(pwdConfirmFieldName){if(formu.elements[pwdFieldName].value!=formu.elements[pwdConfirmFieldName].value){alert("The password in the confirmation field is different than the one in the entry field. Please reconfirm your password or start again.");setHighlightedZone(formu.elements[pwdFieldName]);formu.elements[pwdFieldName].focus();return false;}}if(formu.elements[pwdFieldName].value.length<6&&formu.elements[pwdFieldName].value.length>0){alert("Your password should contain 6 characters. Please enter a new password.");setHighlightedZone(formu.elements[pwdFieldName]);formu.elements[pwdFieldName].focus();return false;}return true;} 