String.prototype.trim = function() { temp = this; while (escape(temp).indexOf('%u2018') > -1) { temp = escape(temp).replace('%u2018', '%27'); temp = unescape(temp); } return temp.replace(/^\s*/,"").replace(/\s*$/,"").replace("’","'").replace("–","-") } function Reverse(source) { result = ''; for (indexReverse = 0; indexReverse <= source.length; indexReverse++) result = source.charAt(indexReverse) + result; return result; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i=1 && jour>=1); return t_tempo; } function bisx(quoi) { if ((quoi % 100 == 0) && (quoi % 400 == 0)) return true; else if ((quoi % 4) == 0) return true; return false; } function DateAdd(startDate, numDays, numMonths, numYears) { var returnDate = new Date(startDate.getTime()); var yearsToAdd = numYears; var month = returnDate.getMonth() + numMonths; if (month > 11) { yearsToAdd = Math.floor((month+1)/12); month -= 12*yearsToAdd; yearsToAdd += numYears; } returnDate.setMonth(month); returnDate.setFullYear(returnDate.getFullYear() + yearsToAdd); returnDate.setTime(returnDate.getTime()+60000*60*24*numDays); return returnDate; } function YearAdd(startDate, numYears) { return DateAdd(startDate,0,0,numYears); } function MonthAdd(startDate, numMonths) { return DateAdd(startDate,0,numMonths,0); } function DayAdd(startDate, numDays) { return DateAdd(startDate,numDays,0,0); } function DateDiff(date1, date2) { diff = new Date(); diff.setTime(Math.abs(date1.getTime() - date2.getTime())); timediff = diff.getTime(); days = Math.floor(timediff / (1000 * 60 * 60 * 24)); timediff -= days * (1000 * 60 * 60 * 24); return days; } function PopulerJours(mois, jour, annee) { var vieuxJourSelectionne = jour.selectedIndex; nbOptions = jour.length; for (i=0; i < nbOptions; i++) jour[0] = null; var nbJours = 0; switch (mois) { case '1' : nbJours = 31; break; case '2' : if ((annee % 4) == 0) if (((annee % 100) == 0) && ((annee % 400) == 0)) nbJours = 29; else if ((annee % 100) == 0) nbJours = 28; else nbJours = 29; else nbJours = 28; break; case '3' : nbJours = 31; break; case '4' : nbJours = 30; break; case '5' : nbJours = 31; break; case '6' : nbJours = 30; break; case '7' : nbJours = 31; break; case '8' : nbJours = 31; break; case '9' : nbJours = 30; break; case '10' : nbJours = 31; break; case '11' : nbJours = 30; break; case '12' : nbJours = 31; break; default : break; } var i = 1; while (i <= nbJours) { nouvelleOption = new Option(i, i); jour.options[(i - 1)] = nouvelleOption; i++; } if (vieuxJourSelectionne >= jour.length) jour[(jour.length - 1)].selected = true; else jour[vieuxJourSelectionne].selected = true; } function PopulerJoursAvecZero(mois, jour, annee) { var vieuxJourSelectionne = jour.selectedIndex; nbOptions = jour.length; for (i=0; i < nbOptions; i++) jour[0] = null; var nbJours = 0; switch (mois) { case '01' : nbJours = 31; break; case '02' : if ((annee % 4) == 0) if (((annee % 100) == 0) && ((annee % 400) == 0)) nbJours = 29; else if ((annee % 100) == 0) nbJours = 28; else nbJours = 29; else nbJours = 28; break; case '03' : nbJours = 31; break; case '04' : nbJours = 30; break; case '05' : nbJours = 31; break; case '06' : nbJours = 30; break; case '07' : nbJours = 31; break; case '08' : nbJours = 31; break; case '09' : nbJours = 30; break; case '10' : nbJours = 31; break; case '11' : nbJours = 30; break; case '12' : nbJours = 31; break; default : nbJours = 31; break; } var i = 1; while (i <= nbJours) { if (i < 10) nouvelleOption = new Option('0' + i, '0' + i); else nouvelleOption = new Option(i, i); jour.options[(i - 1)] = nouvelleOption; i++; } if (vieuxJourSelectionne >= jour.length) jour[(jour.length - 1)].selected = true; else jour[vieuxJourSelectionne].selected = true; } function PopulerJoursNonObligatoires(mois, jour, annee, itemQuiAChange) { if (itemQuiAChange.selectedIndex == 0) { jour.selectedIndex = 0; mois.selectedIndex = 0; annee.selectedIndex = 0; } else { var vieuxJourSelectionne = jour.selectedIndex; nbOptions = jour.length; for (i=0; i < nbOptions; i++) jour[0] = null; var nbJours = 0; switch (mois[mois.selectedIndex].value) { case '01' : nbJours = 31; break; case '02' : if ((annee[annee.selectedIndex].value % 4) == 0) if (((annee[annee.selectedIndex].value % 100) == 0) && ((annee[annee.selectedIndex].value % 400) == 0)) nbJours = 29; else if ((annee[annee.selectedIndex].value % 100) == 0) nbJours = 28; else nbJours = 29; else nbJours = 28; break; case '03' : nbJours = 31; break; case '04' : nbJours = 30; break; case '05' : nbJours = 31; break; case '06' : nbJours = 30; break; case '07' : nbJours = 31; break; case '08' : nbJours = 31; break; case '09' : nbJours = 30; break; case '10' : nbJours = 31; break; case '11' : nbJours = 30; break; case '12' : nbJours = 31; break; default : nbJours = 31; break; } jour.options[0] = Option('', ''); var i = 1; while (i <= nbJours) { if (i < 10) nouvelleOption = new Option('0' + i, '0' + i); else nouvelleOption = new Option(i, i); jour.options[i] = nouvelleOption; i++; } if (vieuxJourSelectionne >= jour.length) jour[(jour.length - 1)].selected = true; else jour[vieuxJourSelectionne].selected = true; } } function ouvrirTelechargement() { WindowTelechargement = open('fenetreTelechargement.cfm', 'Telechargement', 'scrollbars=no,statusbar=no,menubar=no,' + StringGrandeur(423,230)); WindowTelechargement.focus(); } function OuvrirInfosEnregistrement(datasourceMAJEnregistrement, tableMAJEnregistrement, noItemTableMAJEnregistrement, texteMAJEnregistrement) { WindowEnregistrement = open('Application_infosEnregistrement.cfm?datasourceMAJEnregistrement=' + datasourceMAJEnregistrement + '&tableMAJEnregistrement=' + tableMAJEnregistrement + '&noItemTableMAJEnregistrement=' + noItemTableMAJEnregistrement + '&texteMAJEnregistrement=' + texteMAJEnregistrement, 'Enregistrement', 'scrollbars=no,statusbar=no,menubar=no,' + StringGrandeur(390,165)); WindowEnregistrement.focus(); } function OuvrirPolitiqueConfidentialite(langue) { WindowPolitique = open('http://www.lacdelage.com/hotel-quebec/politiqueDeConfidentialite' + langue + '.cfm?politiqueDeConfidentialite=1', 'Politique', 'resizable=no,scrollbars=yes,status=yes,menubar=no,' + StringGrandeur(668,500)); } function OuvrirFenetre(adresseAOuvrir, largeur, hauteur) { if (typeof(scrollBars) == 'undefined') scrollBars = true; if (scrollBars) WindowFenetre = open(adresseAOuvrir, 'WindowFenetre', 'resizable=no,scrollbars=yes,status=yes,menubar=no,' + StringGrandeur(largeur,hauteur)); else WindowFenetre = open(adresseAOuvrir, 'WindowFenetre', 'resizable=no,scrollbars=no,status=yes,menubar=no,' + StringGrandeur(largeur,hauteur)); WindowFenetre.focus(); } function OuvrirBanqueImage(noBanqueDImage, langue, noBanqueDImageCategorie) { if (typeof(noBanqueDImageCategorie)!='undefined'){ noBanqueDImageCategorie = '&noBanqueDImageCategorie=' + noBanqueDImageCategorie; }; WindowBanqueImage = open('http://www.lacdelage.com/hotel-quebec/banqueDImagesPop' + langue + '.cfm?noBanqueDImage=' + noBanqueDImage + noBanqueDImageCategorie, 'FenetreBanqueImage', 'scrollbars=no,status=yes,menubar=no,locationbar=no,directories=no,resizable=no,statusbar=no,toolbar=no,' + StringGrandeur(730,403)); WindowBanqueImage.focus(); } function ImprimerPage() { WindowImprimer = open('', 'Imprimer', 'resizable=yes,scrollbars=yes,status=yes,menubar=yes,' + StringGrandeur(710,400)); document.DonneesImprimer.action = document.DonneesImprimer.nomPagePourImprimer.value; document.DonneesImprimer.target = 'Imprimer'; document.DonneesImprimer.submit(); WindowImprimer.focus(); } function RechercherListeDeroulante(nomTexteObj){ WindowRechercherListeDeroulante = open('rechercherListeDeroulante.cfm?nomTexteObj=' + nomTexteObj, 'RechercherListeDeroulante', 'resizable=no,scrollbars=no,status=yes,menubar=no,' + StringGrandeur(400,145)); }; function StringGrandeur (width, height) { var string = 'width=' + width + ',height=' + height + ',left=' + ((screen.width - width) / 2) + ',top=' + ((screen.height - height) / 2) + ',screenX=' + ((screen.width - width) / 2) + ',screenY=' + ((screen.height - height) / 2); return string; } function NomFichierValide(valeurDuChamp,extention) { var stringErreur = ''; var nAccepte = 'abcdefghijklmnopqrstuvwxyz0123456789.'; if (valeurDuChamp.length > 0) { nomFichier = valeurDuChamp.substring(valeurDuChamp.lastIndexOf('\\'),valeurDuChamp.length); nomFichier = nomFichier.substring(1,nomFichier.length); var indexOfPoint = nomFichier.indexOf('.'); var lastIndexOfPoint = nomFichier.lastIndexOf('.'); var indexOfEspace = nomFichier.indexOf(' '); if (indexOfEspace != -1) stringErreur = 'Votre fichier doit pas contenir d\'espace.'; if (indexOfPoint == -1) stringErreur = 'Votre fichier doit avoir une extention.'; if (indexOfPoint != lastIndexOfPoint) stringErreur = 'Votre fichier doit avoir seulement une extention (un seul point dans le nom du fichier est permis).'; if (stringErreur == '') { for (var i=0; i max) { champ.value = champ.value.substring(0,max); alert("Votre message dépasse le nombre de caractères permis et a été réduit à "+max+" caractères."); } } function NumberFormat(num) { this.COMMA = ','; this.PERIOD = '.'; this.DASH = '-'; this.LEFT_PAREN = '('; this.RIGHT_PAREN = ')'; this.LEFT_OUTSIDE = 0; this.LEFT_INSIDE = 1; this.RIGHT_INSIDE = 2; this.RIGHT_OUTSIDE = 3; this.LEFT_DASH = 0; this.RIGHT_DASH = 1; this.PARENTHESIS = 2; this.num; this.numOriginal; this.hasSeparators = false; this.separatorValue; this.inputDecimalValue; this.decimalValue; this.negativeFormat; this.negativeRed; this.hasCurrency; this.currencyPosition; this.currencyValue; this.places; this.setNumber = setNumberNF; this.toUnformatted = toUnformattedNF; this.setInputDecimal = setInputDecimalNF; this.setSeparators = setSeparatorsNF; this.setCommas = setCommasNF; this.setNegativeFormat = setNegativeFormatNF; this.setNegativeRed = setNegativeRedNF; this.setCurrency = setCurrencyNF; this.setCurrencyPrefix = setCurrencyPrefixNF; this.setCurrencyValue = setCurrencyValueNF; this.setCurrencyPosition = setCurrencyPositionNF; this.setPlaces = setPlacesNF; this.toFormatted = toFormattedNF; this.toPercentage = toPercentageNF; this.getOriginal = getOriginalNF; this.getRounded = getRoundedNF; this.preserveZeros = preserveZerosNF; this.justNumber = justNumberNF; this.setInputDecimal(this.PERIOD); this.setNumber(num); this.setCommas(true); this.setNegativeFormat(this.LEFT_DASH); this.setNegativeRed(false); this.setCurrency(true); this.setCurrencyPrefix('$'); this.setPlaces(2); } function setInputDecimalNF(val) { this.inputDecimalValue = val; } function setNumberNF(num) { this.numOriginal = num; this.num = this.justNumber(num); } function toUnformattedNF() { return (this.num); } function getOriginalNF() { return (this.numOriginal); } function setNegativeFormatNF(format) { this.negativeFormat = format; } function setNegativeRedNF(isRed) { this.negativeRed = isRed; } function setSeparatorsNF(isC, separator, decimal) { this.hasSeparators = isC; if (separator == null) separator = this.COMMA; if (decimal == null) decimal = this.PERIOD; if (separator == decimal) { this.decimalValue = (decimal == this.PERIOD) ? this.COMMA : this.PERIOD; } else { this.decimalValue = decimal; } this.separatorValue = separator; } function setCommasNF(isC) { this.setSeparators(isC, this.COMMA, this.PERIOD); } function setCurrencyNF(isC) { this.hasCurrency = isC; } function setCurrencyValueNF(val) { this.currencyValue = val; } function setCurrencyPrefixNF(cp) { this.setCurrencyValue(cp); this.setCurrencyPosition(this.LEFT_OUTSIDE); } function setCurrencyPositionNF(cp) { this.currencyPosition = cp } function setPlacesNF(p) { this.places = p; } function toFormattedNF() { var pos; var nNum = this.num; var nStr; var splitString = new Array(2); nNum = this.getRounded(nNum); nStr = this.preserveZeros(Math.abs(nNum)); if (nStr.indexOf(this.PERIOD) == -1) { splitString[0] = nStr; splitString[1] = ''; } else { splitString = nStr.split(this.PERIOD, 2); } if (this.hasSeparators) { pos = splitString[0].length; while (pos > 0) { pos -= 3; if (pos <= 0) break; splitString[0] = splitString[0].substring(0,pos) + this.separatorValue + splitString[0].substring(pos, splitString[0].length); } } if (splitString[1].length > 0) { nStr = splitString[0] + this.decimalValue + splitString[1]; } else { nStr = splitString[0]; } var c0 = ''; var n0 = ''; var c1 = ''; var n1 = ''; var n2 = ''; var c2 = ''; var n3 = ''; var c3 = ''; var negSignL = (this.negativeFormat == this.PARENTHESIS) ? this.LEFT_PAREN : this.DASH; var negSignR = (this.negativeFormat == this.PARENTHESIS) ? this.RIGHT_PAREN : this.DASH; if (this.currencyPosition == this.LEFT_OUTSIDE) { if (nNum < 0) { if (this.negativeFormat == this.LEFT_DASH || this.negativeFormat == this.PARENTHESIS) n1 = negSignL; if (this.negativeFormat == this.RIGHT_DASH || this.negativeFormat == this.PARENTHESIS) n2 = negSignR; } if (this.hasCurrency) c0 = this.currencyValue; } else if (this.currencyPosition == this.LEFT_INSIDE) { if (nNum < 0) { if (this.negativeFormat == this.LEFT_DASH || this.negativeFormat == this.PARENTHESIS) n0 = negSignL; if (this.negativeFormat == this.RIGHT_DASH || this.negativeFormat == this.PARENTHESIS) n3 = negSignR; } if (this.hasCurrency) c1 = this.currencyValue; } else if (this.currencyPosition == this.RIGHT_INSIDE) { if (nNum < 0) { if (this.negativeFormat == this.LEFT_DASH || this.negativeFormat == this.PARENTHESIS) n0 = negSignL; if (this.negativeFormat == this.RIGHT_DASH || this.negativeFormat == this.PARENTHESIS) n3 = negSignR; } if (this.hasCurrency) c2 = this.currencyValue; } else if (this.currencyPosition == this.RIGHT_OUTSIDE) { if (nNum < 0) { if (this.negativeFormat == this.LEFT_DASH || this.negativeFormat == this.PARENTHESIS) n1 = negSignL; if (this.negativeFormat == this.RIGHT_DASH || this.negativeFormat == this.PARENTHESIS) n2 = negSignR; } if (this.hasCurrency) c3 = this.currencyValue; } nStr = c0 + n0 + c1 + n1 + nStr + n2 + c2 + n3 + c3; if (this.negativeRed && nNum < 0) { nStr = '' + nStr + ''; } return (nStr); } function toPercentageNF() { nNum = this.num * 100; nNum = this.getRounded(nNum); return nNum + '%'; } function getRoundedNF(val) { var factor; var i; factor = 1; for (i=0; i= 0) && (typeof document.Donnees.elements[indexActiveX].action != 'string')) { alert('ATTENTION NOUVELLE VERSION DE NUMTRANSFERT!!!\n\nVous devez installer NumTransfert, une application développée par Numérique Technologies spécifiquement pour Soft-System et signée par Comodo, fournisseur de certificats de sécurité. Il faut accepter l\'installation de ce "plug-in".\n\nCe "plug-in" est un ActiveX hautement sécuritaire qui permet le transfer de donnée sur nos serveurs via Soft-System.'); window.location = 'Application_numTransfert.cfm'; break; } indexActiveX = indexActiveX + 1; } } } function TraiterErreur() { //send du form pour l'erreur... WindowAvertissement = open('http://www.numerique.ca/scripts/Publique/templateErrorJavascript.cfm?nomPage=' + url + '&msg=' + msg + '&linenumber=' + linenumber, 'ErreurJS', 'scrollbars=no,status=no,width=400,height=150,left=160,top=250,screenX=160,screenY=250'); return true; } //window.onerror = TraiterErreur; // Utilisé pour empêcher les double-clicks... var estEnvoye; estEnvoye=false; function executerNumTransfert(activeForm, champHidden){ activeForm.Executer(); if (activeForm.erreur == 'true'){ alert('Vous ne pouvez pas poster ce formulaire, car il y a une erreur avec le téléchargement d\'un fichier.'); return false; } else{ champHidden.value = activeForm.nomDuFichier; return true; } };