var ENErrorHeader = "The following error(s) have occurred on this form!<br />Please ensure you are entering the correct format."; var CFErrorHeader = "La ou les erreurs suivantes se sont produites sur ce formulaire!<br />Assurez-vous d’utiliser le bon format."; var horizontal_offset = "9px"; var vertical_offset = "0"; var ie = document.all; var ns6 = document.getElementById && !document.all; // Security patch to prevent pages for being framed! if (self != top) { if ((document.URL.indexOf("/csr-bin/") < 0) && (document.URL.indexOf("/loading.htm?") < 0)) { top.location = self.location; } } /* * Function to get the base portion of the url. */ function GetBaseURL() { var tmpUrl = document.URL; tmpUrl = tmpUrl.split("/cgi-bin")[0]; tmpUrl = tmpUrl.split("/csr-bin")[0]; return tmpUrl; } /* Secure Login functionality */ var idpActive = false; var svpActive = false; var tmpLanguage = "EN"; if (document.URL.indexOf("/CF/") > -1) { tmpLanguage = "CF"; } var tmpCgiDir = "/" + tmpLanguage + "/"; if (document.URL.indexOf("/idp") > -1) { idpActive = true; tmpCgiDir = "/" + tmpLanguage + "/idp/"; } if (document.URL.indexOf("/svp") > -1) { svpActive = true; tmpCgiDir = "/" + tmpLanguage + "/svp/"; } function CancelIDPLogin(tmpEventType) { var tmpInput = document.OAMForm.DE_LS_ATTM_USER_NM; if (typeof(tmpInput) != "undefined") { tmpInput.value = ""; } tmpInput = document.OAMForm.DE_LS_IP_ATTM_USER_NM; if (typeof(tmpInput) != "undefined") { tmpInput.value = ""; } tmpInput = document.OAMForm.DE_USER_DT_OF_BRTH; if (typeof(tmpInput) != "undefined") { tmpInput.value = ""; } tmpInput = document.OAMForm.DE_LS_ATTM_USER_PSSW; if (typeof(tmpInput) != "undefined") { tmpInput.value = ""; } tmpInput = document.OAMForm.DE_USER_MTHR_MADN_NM; if (typeof(tmpInput) != "undefined") { tmpInput.value = ""; } tmpInput = document.OAMForm.DE_OOW_FRST_ANS1; if (typeof(tmpInput) != "undefined") { tmpInput.value = ""; } document.OAMForm.DE_EVENT_LOG_TYPE.value = tmpEventType; document.OAMForm.DE_WEB_PAGE_ID.value = "master_home"; document.OAMForm.DE_WEB_COMMAND.value = "SAMLStop"; document.OAMForm.submit(); } function SubmitFormSSO(tmpUrl) { document.OAMForm.DE_WEB_PAGE_ID.value = "master_home"; document.OAMForm.DE_WEB_COMMAND.value = "SAMLStart"; document.OAMForm.submit(); } /* ************************************************************* */ String.prototype.trim = function () { return this.replace(/^\s*|\s*$/g, '') }; String.prototype.ltrim = function () { return this.replace(/^\s*/g, '') }; String.prototype.rtrim = function () { return this.replace(/\s*$/g, '') }; function goback() { history.back(1) } if (window.screen) { var clientW = Math.floor(screen.availWidth); var clientH = Math.floor(screen.availHeight) } function openWindow(url) { Window1 = window.open(url, 'Window1', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=560,height=500,top=' + ((clientH - 500) / 2) + ',left=' + ((clientW - 560) / 2)); Window1.focus() } function openWindow2(url, w, h) { Window2 = window.open(url, 'Window2', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=' + w + ',height=' + h + ',top=' + ((clientH - h) / 2) + ',left=' + ((clientW - w) / 2)); Window2.focus() } /** * Function to display an error message text. * @param divId div to place the message in. * @param message the message text to display. */ function DisplayError(divId, header, message) { var msg = ""; var div = document.getElementById(divId); if (div) { msg = msg + "<table class=\"error-table\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">"; msg = msg + "<thead><tr><th>" + header + "</th></tr></thead>"; msg = msg + "<tr><td>" + message + "</td></tr>"; msg = msg + "</table>"; div.innerHTML = msg; } } /** * Function to display javascript error UI message. * @param tmpError error message to display to user. */ function DisplayErrorText(tmpError) { var returnError = ""; var error_div = document.getElementById("error_div"); var sTrim = DE_CGI_DIR.trim(); var FRENCH = /CF/i if (sTrim.search(FRENCH) != -1) { var ErrorHeader = CFErrorHeader; } else { var ErrorHeader = ENErrorHeader; } returnError = "<br /><div><table class=\"error-table\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><thead><tr><th>" + ErrorHeader + "<\/th><\/tr><\/thead>"; returnError += "<tr><td><ul>"; returnError += "<li>" + tmpError + "<\/li>" returnError += "<\/ul><\/td><\/tr><\/tbody><\/table></div>"; if (error_div) { error_div.innerHTML = returnError; error_div.style.display = "block"; } } function DisplayLoginWarning() { if (typeof DE_CON_FLG != 'undefined') { if (DE_CON_FLG == "Y") { var msg = "<div class=\"overlayContent\" style=\"width: 400px; font-size: 11px; left: 50%; margin-left: -200px; padding: 2px; text-align: left; top: 40%; \">"; msg += "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">"; msg += " <tr>"; msg += " <td style=\"padding-left: 10px; padding-right: 10px;\"><img class=\"warn\" src=\"" + cgiDir + "/images/tri-warning.gif\" width=\"30\" height=\"26\" /></td>"; msg += " <td style=\"padding-top: 10px;\"><p>" + DE_CON_FLG_MSG + "</p></td>"; msg += " </tr>"; msg += " <tr>"; msg += " <td colspan=\"2\" align=\"center\" style=\"padding: 10px; padding-bottom: 5px;\">"; msg += " <a href=\"#\" tabindex=\"1\" onclick=\"RemoveOverlayWarning(); return false;\"><img src=\"" + cgiDir + "/btn-images/ok.gif\" alt=\"[Ok]\" class=\"buttonImage\" /></a>"; msg += " </td>"; msg += " </tr>"; msg += "</table>"; msg += "</div>"; DisplayOverlayWarningPause(msg, "", "", "", true); } } } /** * Function to remove an overlay warning that was presented to the user. **/ function RemoveOverlayWarning() { var tmpOverlay = document.getElementById("overlay"); var tmpOverlayContent = document.getElementById("overlayContent"); if (tmpOverlay) { document.body.removeChild(tmpOverlay); } if (tmpOverlayContent) { document.body.removeChild(tmpOverlayContent); } if (document.URL.indexOf("/csr-bin/") > 0) { parent.logo.HideOverlay(); parent.sidemenu.HideOverlay(); parent.topmenu.HideOverlay(); } } /** * Function to display an overlay with a display message presented to user and pause functionality. * @param message the message to be displayed to the user. * @param containerStyle style information for container * @param containerStyle style information for content * @param msgOverride flag to override default display **/ function DisplayOverlayWarningPause(message, continueFunction, containerStyle, contentStyle, msgOverride) { var tmpStyle1 = ""; if (containerStyle != "") { tmpStyle1 = " style='" + containerStyle + "'"; } var tmpStyle2 = ""; if (contentStyle != "") { tmpStyle2 = " style='" + contentStyle + "'"; } var removeOverlay = document.getElementById("overlay"); var removeOverlayContent = document.getElementById("overlayContent"); if (removeOverlay) { document.body.removeChild(removeOverlay); } if (removeOverlayContent) { document.body.removeChild(removeOverlayContent); } var overlay = document.createElement("div"); overlay.setAttribute("id", "overlay"); if (navigator.appVersion.indexOf("MSIE") > 0) { overlay.className = "overlay"; } else { overlay.setAttribute("class", "overlay"); } document.body.appendChild(overlay); var overlayContent = document.createElement("div"); overlayContent.setAttribute("id", "overlayContent"); if (msgOverride) { overlayContent.innerHTML = message; } else { var tmpMsg = "<div class=\"overlayContent\"" + tmpStyle1 + ">"; tmpMsg += " <div" + tmpStyle2 + ">" + message + "</div>"; tmpMsg += " <div style=\"padding-top: 10px; text-align: center;\"><a href=\"#\" onclick=\"RemoveOverlayWarning(); " + continueFunction + " return false;\"><img id=\"btnClose\" src=\"" + cgiDir + "/btn-images/ok.gif\" title=\"ok\" alt=\"[ok]\" class=\"buttonImage\"></a></div>"; tmpMsg += "</div>"; overlayContent.innerHTML = tmpMsg; } document.body.appendChild(overlayContent); } function ShowOverlay() { var removeOverlay = document.getElementById("overlay"); var removeOverlayContent = document.getElementById("overlayContent"); if (removeOverlay) { document.body.removeChild(removeOverlay); } if (removeOverlayContent) { document.body.removeChild(removeOverlayContent); } var overlay = document.createElement("div"); overlay.setAttribute("id", "overlay"); if (navigator.appVersion.indexOf("MSIE") > 0) { overlay.className = "overlay"; } else { overlay.setAttribute("class", "overlay"); } document.body.appendChild(overlay); } function HideOverlay() { var tmpOverlay = document.getElementById("overlay"); var tmpOverlayContent = document.getElementById("overlayContent"); if (tmpOverlay) { document.body.removeChild(tmpOverlay); } if (tmpOverlayContent) { document.body.removeChild(tmpOverlayContent); } } /** * Function to build a select list from an array that could contain * the selected value as the first item in the list with the key * value ste to a blank string. * @param selectList the list to be processed. * @param checkValue the value to compare if available. * @return the newly created list. */ function BuildList(selectList, checkValue) { var tmpList = "" //'<option value=""></option>'; var tmpCheckItem = false; var tmpCheckValue = checkValue; var tmpSelected = ""; tmpCheckItem = CheckSelection(selectList); for (var x = 0; x < selectList.length - 1; x++) { if (tmpCheckItem) { if (selectList[x][1] != "") { tmpCheckValue = selectList[x][1]; } else { tmpCheckValue = selectList[x][0]; } } else { if ((tmpCheckValue == selectList[x][0]) || (tmpCheckValue == selectList[x][1])) { tmpSelected = " selected"; } tmpList = tmpList + '<option value="' + selectList[x][0] + '"' + tmpSelected + '>' + selectList[x][1] + '</option>'; tmpSelected = ""; } tmpCheckItem = false; } return tmpList; } /** * Function to determine if the first item in the array * is the selected item or just a list item. * @param selectList the list to be processed. * @return true or false based on selectList. */ function CheckSelection(selectList) { var tmpItem = ""; if (selectList.length > 2) { tmpItem = selectList[0][1]; for (var x = 1; x < selectList.length - 1; x++) { if (selectList[x][1] == tmpItem) { return true; } } } return false; } function openWindow3(url, w, h) { Window3 = window.open(url, 'Window3', 'toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=' + w + ',height=' + h + ',top=' + ((clientH - h) / 2) + ',left=' + ((clientW - w) / 2)); Window3.focus() } function openWindow4(url, w, h) { Window4 = window.open(url, 'Window4', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=no,width=' + w + ',height=' + h + ',top=' + ((clientH - h) / 2) + ',left=' + ((clientW - w) / 2)); Window4.focus() } function getFieldHelp(url) { Window5 = window.open(url, 'Window5', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=560,height=300,top=' + ((clientH - 300) / 2) + ',left=' + ((clientW - 560) / 2)); Window5.focus() } function baseWindow(url) { Window6 = window.open(url, 'Window6', 'toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=560,height=600,top=' + ((clientH - 300) / 2) + ',left=' + ((clientW - 560) / 2)); Window6.focus() } function InfoWindow(url) { Window5 = window.open(url, 'Window5', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=560,height=' + clientH + ',top=' + ((clientH - clientH)) + ',left=' + ((clientW - 570))); Window5.focus() } function redir_and_close(url) { if (opener && !opener.closed) { opener.location = url; self.close() } } function clickclear(thisfield) { thisfield.value = "" } function fixImage(str) { if (str.length) { if (str.search(/uparrow/) > 0) { document.write("<img src=\"" + DE_CGI_DIR + "/images/upred.gif\">") } else if (str.search(/downarrow/) > 0) { document.write("<img src=\"" + DE_CGI_DIR + "/images/downred.gif\">") } else if (str.search(/x.gif/) > 0) { document.write("<img class=\"error\" src=\"" + DE_CGI_DIR + "/images/errormark.gif\">") } } } function showCellBlock(blockId) { var tmpObject = document.getElementById(blockId); if (tmpObject) { if (is_gecko) { tmpObject.style.display = "table-row" } else { tmpObject.style.display = "block" } } } function hideCellBlock(blockId) { var tmpObject = document.getElementById(blockId); if (tmpObject) { tmpObject.style.display = "none"; } } function checkTypeCell(DE_CC_CARD_TYPE) { if ((DE_CC_CARD_TYPE == "R") || (DE_CC_CARD_TYPE == "P")) { showCellBlock('regular-platinum'); hideCellBlock('business'); document.enroll.DE_LONG_JOB_PHONE.tabindex = 6; document.enroll.DE_LONG_HOME_PHONE.tabindex = -1 } else { showCellBlock('business'); hideCellBlock('regular-platnium'); document.enroll.DE_LONG_JOB_PHONE.tabindex = -1; document.enroll.DE_LONG_HOME_PHONE.tabindex = 6 } } function showBlock(blockId) { var tmpBlock = document.getElementById(blockId); if (tmpBlock) { tmpBlock.style.display = "block"; } } function hideBlock(blockId) { var tmpBlock = document.getElementById(blockId); if (tmpBlock) { tmpBlock.style.display = "none"; } } function checkType(DE_CC_CARD_TYPE) { if ((DE_CC_CARD_TYPE == "R") || (DE_CC_CARD_TYPE == "P")) { showBlock('regular-platinum'); hideBlock('business') } else { showBlock('business'); hideBlock('regular-platnium') } } function checkType1(DE_CC_CARD_TYPE) { if (DE_CC_CARD_TYPE == "B") { showBlock('business') } } function changeText(id, txt) { var obj = document.getElementById(id); if (obj == null) { return; } obj.innerHTML = txt; } function maxLengthById(fldId, maxChars, lblId) { var field = document.getElementById(fldId); if (field == null) { return true; } if (field.value == null) { return true; } if (field.value.length > maxChars) { field.value = field.value.substring(0, maxChars); var msg = '0 characters left'; changeText(lblId, msg); if (DE_CGI_DIR == "/EN") { msg = '' + left + ' characters left'; } else { msg = '' + left + ' caractères restants'; } return true; } var left = maxChars - field.value.length; var msg; if (DE_CGI_DIR == "/EN") { msg = '' + left + ' characters left'; } else { msg = '' + left + ' caractères restants'; } changeText(lblId, msg); } function CheckLength(field, maxChars, lblId) { if (field == null) { return true; } if (field.value == null) { return true; } if (field.value.length > maxChars) { field.value = field.value.substring(0, maxChars); var msg = '0 characters left'; changeText(lblId, msg); if (DE_CGI_DIR == "/EN") { msg = '' + left + ' characters left'; } else { msg = '' + left + ' caractères restants'; } return true; } var left = maxChars - field.value.length; var msg; if (DE_CGI_DIR == "/EN") { msg = '' + left + ' characters left'; } else { msg = '' + left + ' caractères restants'; } changeText(lblId, msg); } function checkCategory(category) { if (category == "N") { hideBlock('category-info'); hideBlock('category') } else { showBlock('category-info'); showBlock('category') } } function checkActivity(DE_STMT_DNLD_TX) { if (DE_STMT_DNLD_TX == "F") { showBlock('activity-false'); hideBlock('activity-true') } else { showBlock('activity-true'); hideBlock('activity-false') } } function GetNameByType(DE_CC_CARD_TYPE) { if ((DE_CC_CARD_TYPE == "R") || (DE_CC_CARD_TYPE == "P")) { document.writeln("Home Phone Number:") } else { document.writeln("Business Phone Number:") } } function GetInputType(DE_CC_CARD_TYPE) { if ((DE_CC_CARD_TYPE == "R") || (DE_CC_CARD_TYPE == "P")) { document.writeln(HOME_PHONE) } else { document.writeln(JOB_PHONE) } } function checkRewards(RewardsBonus) { if (RewardsBonus == "REWARDS INFORMATION") { showBlock('rewards-seperator'); showBlock('rewards') } } function RedeemPoints(DE_REWARD_enroled, DE_CC_CARD_TYPE) { if (DE_CC_CARD_TYPE == "R" && DE_REWARD_enroled == "Yes") { showBlock('regular'); hideBlock('plantinum'); hideBlock('regular-norewards'); } else if (DE_CC_CARD_TYPE == "R" && DE_REWARD_enroled == "No") { showBlock('regular-norewards'); hideBlock('regular'); hideBlock('platinum'); } else { showBlock('platinum'); hideBlock('regular'); hideBlock('regular-norewards') } } function imgClick(tag, value) { document.getElementById(tag).value = value } function checkTextOrig(data) { var sTrim = data.trim(); var PPB = /PREVIOUS POINTS BALANCE/i; var MCP = /MASTERCARD POINTS/i; var NPB = /NEW POINTS BALANCE/i; if (sTrim.search(PPB) != -1) { data = sTrim.replace(/PREVIOUS POINTS BALANCE/, "Previous Points Balance"); data = data.replace(/ /, " ") } else if (data.search(MCP) != -1) { data = "MasterCard Points" } else if (data.search(NPB) != -1) { data = "New Points Balance" } document.write(data) } function checkStatus(data) { unsuccessful1 = /^UNSUCCESSFUL<br>Invalid Email$/; unsuccessful2 = /^UNSUCCESSFUL<br>Account Status$/; unsuccessful3 = /^UNSUCCESSFUL$/; success = /^SUCCESSFUL$/; if (data.match(unsuccessful1)) { document.write("Échec<br>Courriel invalide") } else if (data.match(unsuccessful2)) { document.write("Échec<br>État du compte") } else if (data.match(unsuccessful3)) { document.write("Échec") } else if (data.match(success)) { document.write("Réussi") } else { document.write(" ") } } function checkText(data) { var sTrim = data.trim(); var PPB = /PREVIOUS POINTS BALANCE/i; var MCP = /MASTERCARD POINTS/i; var NPB = /NEW POINTS BALANCE/i; var MEMCP = /MEMBER CARD POINTS/i; var MP = /MERCHANT POINTS/i; var CUP = /CREDIT UNION POINTS/i; var BPA = /BONUS POINTS\/ADJUSTMENTS/i; var RED = /REDEMPTIONS/i; if ((sTrim.search(PPB) != -1 && DE_CSC_FORM_CD == "3ND") || (sTrim.search(PPB) != -1 && DE_CSC_FORM_CD == "46D")) { data = sTrim.replace(/PREVIOUS POINTS BALANCE/, "Solde précédent de points"); data = data.replace(/ /, " ") } else if ((sTrim.search(PPB) != -1 && DE_CSC_FORM_CD != "3ND") || (sTrim.search(PPB) != -1 && DE_CSC_FORM_CD != "46D")) { data = sTrim.replace(/PREVIOUS POINTS BALANCE/, "Previous Points Balance"); data = data.replace(/ /, " ") } else if ((sTrim.search(MCP) != -1 && DE_CSC_FORM_CD == "3ND") || (sTrim.search(MCP) != -1 && DE_CSC_FORM_CD == "46D")) { data = "Points MasterCard" } else if ((sTrim.search(MCP) != -1 && DE_CSC_FORM_CD != "3ND") || (sTrim.search(MCP) != -1 && DE_CSC_FORM_CD != "46D")) { data = "MasterCard Points" } else if ((sTrim.search(NPB) != -1 && DE_CSC_FORM_CD == "3ND") || (sTrim.search(NPB) != -1 && DE_CSC_FORM_CD == "46D")) { data = "Nouveau solde de points" } else if ((sTrim.search(NPB) != -1 && DE_CSC_FORM_CD != "3ND") || (sTrim.search(NPB) != -1 && DE_CSC_FORM_CD != "46D")) { data = "New Points Balance" } else if ((sTrim.search(MEMCP) != -1 && DE_CSC_FORM_CD == "3ND") || (sTrim.search(MEMCP) != -1 && DE_CSC_FORM_CD == "46D")) { data = "Points Member Card" } else if ((sTrim.search(MEMCP) != -1 && DE_CSC_FORM_CD != "3ND") || (sTrim.search(MEMCP) != -1 && DE_CSC_FORM_CD != "46D")) { data = "Member Card Points" } else if ((sTrim.search(MP) != -1 && DE_CSC_FORM_CD == "3ND") || (sTrim.search(MP) != -1 && DE_CSC_FORM_CD == "46D")) { data = "Points Consentis Par les commercants" } else if ((sTrim.search(MP) != -1 && DE_CSC_FORM_CD != "3ND") || (sTrim.search(MP) != -1 && DE_CSC_FORM_CD != "46D")) { data = "Merchant Points" } else if ((sTrim.search(CUP) != -1 && DE_CSC_FORM_CD == "3ND") || (sTrim.search(CUP) != -1 && DE_CSC_FORM_CD == "46D")) { data = "Points Credit Union" } else if ((sTrim.search(CUP) != -1 && DE_CSC_FORM_CD != "3ND") || (sTrim.search(CUP) != -1 && DE_CSC_FORM_CD != "46D")) { data = "Credit Union Points" } else if ((sTrim.search(BPA) != -1 && DE_CSC_FORM_CD == "3ND") || (sTrim.search(BPA) != -1 && DE_CSC_FORM_CD == "46D")) { data = "Points supplêmentaires/redressements" } else if ((sTrim.search(BPA) != -1 && DE_CSC_FORM_CD != "3ND") || (sTrim.search(BPA) != -1 && DE_CSC_FORM_CD != "46D")) { data = "Bonus Points/Adjustments" } else if ((sTrim.search(RED) != -1 && DE_CSC_FORM_CD == "3ND") || (sTrim.search(RED) != -1 && DE_CSC_FORM_CD == "46D")) { data = "Déboursements" } else if ((sTrim.search(RED) != -1 && DE_CSC_FORM_CD != "3ND") || (sTrim.search(RED) != -1 && DE_CSC_FORM_CD != "46D")) { data = "Redemptions" } document.write(data) } function ErrorText() { if (errors.length > 1) { var tmpDiv = document.getElementById("error_div"); if (tmpDiv) { tmpDiv.style.display = "block"; } var count = errors.length - 1; var sTrim = DE_CGI_DIR.trim(); var FRENCH = /CF/i if (sTrim.search(FRENCH) != -1) { var ErrorHeader = CFErrorHeader; } else { var ErrorHeader = ENErrorHeader; } document.write("<br /><table class=\"error-table\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><thead><tr><th>" + ErrorHeader + "<\/th><\/tr><\/thead>"); document.write("<tr><td><ul>"); for (i = 0; i < count; ++i) { document.write("<li>" + errors[i] + "<\/li>") } document.write("<\/ul><\/td><\/tr><\/tbody><\/table>") } } function ConvertSteps() { for (i = 0; i < steps.length - 1; ++i) { steps[i].replace("cat", "wall"); document.write("<p>" + steps[i] + "<\/p>") } } function stringFilter3(str1) { var str2; str2 = str1.replace(/'/g, ''); var current_array = str2.split(" "); var Month; alert(current_array[0]); alert(current_array[1]); alert(current_array[2]); document.write(str2) } function SignIn(str1) { var sArray = str1.split("/"); var month = sArray[0]; var date = sArray[1]; var yearPlus = sArray[2]; var converted = date + "/" + month + "/" + yearPlus; document.write(converted) } function CurrentAsOf(str1) { var str2; str2 = str1.replace(/'/g, ''); var sArray = str2.split(" "); var month = sArray[0]; var date = sArray[1]; var date2 = date.replace(/,/g, ''); var year = sArray[2]; var time = sArray[3]; var TimeZone = sArray[4]; if (month == "Jan") { month = "01" } else if (month == "Feb") { month = "02" } else if (month == "Mar") { month = "03" } else if (month == "Apr") { month = "04" } else if (month == "May") { month = "05" } else if (month == "Jun") { month = "06" } else if (month == "Jul") { month = "07" } else if (month == "Aug") { month = "08 " } else if (month == "Sep") { month = "09" } else if (month == "Oct") { month = "10" } else if (month == "Nov") { month = "11" } else { month = "12" } var converted = date2 + "/" + month + "/" + year + " " + time + " " + TimeZone; document.write(converted) } function closeWindow() { window.open('', '_parent', ''); top.close() } function ChngWords(str1) { var str2 = str1.replace("*FRAIS FINANCIERS*", "FRAIS D'INTÉRÊT"); document.write(str2) } function ChngWordsStr(str1) { var str2 = str1.replace("*FRAIS FINANCIERS*", "FRAIS D'INTÉRÊT"); return str2 } function SplitName(str1) { var str2 = str1.replace(",", ", "); document.write(str2) } function getposOffset(what, offsettype) { var totaloffset = (offsettype == "left") ? what.offsetLeft : what.offsetTop; var parentEl = what.offsetParent; while (parentEl != null) { totaloffset = (offsettype == "left") ? totaloffset + parentEl.offsetLeft : totaloffset + parentEl.offsetTop; parentEl = parentEl.offsetParent } return totaloffset } function iecompattest() { return (document.compatMode && document.compatMode != "BackCompat") ? document.documentElement : document.body } function clearbrowseredge(obj, whichedge) { var edgeoffset = (whichedge == "rightedge") ? parseInt(horizontal_offset) * -1 : parseInt(vertical_offset) * -1; if (whichedge == "rightedge") { var windowedge = ie && !window.opera ? iecompattest().scrollLeft + iecompattest().clientWidth - 30 : window.pageXOffset + window.innerWidth - 40; dropmenuobj.contentmeasure = dropmenuobj.offsetWidth; if (windowedge - dropmenuobj.x < dropmenuobj.contentmeasure) { edgeoffset = dropmenuobj.contentmeasure + obj.offsetWidth + parseInt(horizontal_offset) } } else { var windowedge = ie && !window.opera ? iecompattest().scrollTop + iecompattest().clientHeight - 15 : window.pageYOffset + window.innerHeight - 18; dropmenuobj.contentmeasure = dropmenuobj.offsetHeight; if (windowedge - dropmenuobj.y < dropmenuobj.contentmeasure) { edgeoffset = dropmenuobj.contentmeasure - obj.offsetHeight } } return edgeoffset } function showhint(menucontents, obj, e, tipwidth) { if ((ie || ns6) && document.getElementById("hintbox")) { dropmenuobj = document.getElementById("hintbox"); dropmenuobj.innerHTML = menucontents; dropmenuobj.style.left = dropmenuobj.style.top = -500; if (tipwidth != "") { dropmenuobj.widthobj = dropmenuobj.style; dropmenuobj.widthobj.width = tipwidth } dropmenuobj.x = getposOffset(obj, "left"); dropmenuobj.y = getposOffset(obj, "top"); dropmenuobj.style.left = dropmenuobj.x - clearbrowseredge(obj, "rightedge") + obj.offsetWidth + "px"; dropmenuobj.style.top = dropmenuobj.y - clearbrowseredge(obj, "bottomedge") + "px"; dropmenuobj.style.visibility = "visible"; obj.onmouseout = hidetip } } function hidetip(e) { dropmenuobj.style.visibility = "hidden"; dropmenuobj.style.left = "-500px" } function createhintbox() { var divblock = document.createElement("div"); divblock.setAttribute("id", "hintbox"); document.body.appendChild(divblock) } function removeCommas(aNum) { aNum = aNum.replace(/,/g, ""); aNum = aNum.replace(/\s/g, ""); return aNum } function addCommas(nStr) { nStr += ''; x = nStr.split('.'); x1 = x[0]; x2 = x.length > 1 ? '.' + x[1] : ''; var rgx = /(\d+)(\d{3})/; while (rgx.test(x1)) { x1 = x1.replace(rgx, '$1' + ',' + '$2') } return x1 + x2 } function backButtonOverride() { setTimeout("backButtonOverrideBody()", 1) } function backButtonOverrideBody() { try { history.forward() } catch (e) {} setTimeout("backButtonOverrideBody()", 250) } function submitHREFform(webpage, command, acct_stts, acct_type, initialize_list, strt_dt) { if (arguments.length == 6) { document.navigation.DE_WEB_PAGE_ID.value = webpage; document.navigation.DE_WEB_COMMAND.value = command; document.navigation.DE_ACCT_STTS.value = acct_stts; document.navigation.DE_ACCT_TYPE.value = acct_type; document.navigation.DE_INITIALIZE_LIST.value = initialize_list; document.navigation.DE_STRT_DT.value = strt_dt } else if (arguments.length == 5) { document.navigation.DE_WEB_PAGE_ID.value = webpage; document.navigation.DE_WEB_COMMAND.value = command; document.navigation.DE_ACCT_STTS.value = acct_stts; document.navigation.DE_ACCT_TYPE.value = acct_type; document.navigation.DE_INITIALIZE_LIST.value = initialize_list; document.navigation.DE_STRT_DT.value = "" } else if (arguments.length == 2) { document.navigation.DE_WEB_PAGE_ID.value = webpage; document.navigation.DE_WEB_COMMAND.value = command; document.navigation.DE_ACCT_STTS.value = ""; document.navigation.DE_ACCT_TYPE.value = ""; document.navigation.DE_INITIALIZE_LIST.value = ""; document.navigation.DE_STRT_DT.value = "" } document.navigation.submit() } function submitCSRHREFform(webpage, command, obj_type) { if (arguments.length == 3) { parent.sidemenu.document.csrnavigation.DE_WEB_PAGE_ID.value = webpage; parent.sidemenu.document.csrnavigation.DE_WEB_COMMAND.value = command; parent.sidemenu.document.csrnavigation.DE_OBJ_TYPE.value = obj_type } else if (arguments.length == 2) { parent.sidemenu.document.csrnavigation.DE_WEB_PAGE_ID.value = webpage; parent.sidemenu.document.csrnavigation.DE_WEB_COMMAND.value = command; parent.sidemenu.document.csrnavigation.DE_OBJ_TYPE.value = "" } parent.sidemenu.document.csrnavigation.submit() } function submitAlertLink(value1, value2, value3, value4) { document.alertlink.DE_WEB_PAGE_ID.value = value1; document.alertlink.DE_WEB_COMMAND.value = value2; document.alertlink.DE_PP_USER_KEY.value = value3; document.alertlink.DE_USER_KEY.value = value4; document.alertlink.submit() } function combineExpireDate() { var month = document.clapp.DE_ACCT_EXPR_DT_MM.value; var year = document.clapp.DE_ACCT_EXPR_DT_YY.value; document.clapp.DE_ACCT_EXPR_DT.value = month + year; return true } function loadDates(n) { var num; if (arguments.length == 0) { num = 1 } else { num = n } var aceDate = new Date(); var day = 1000 * 60 * 60 * 24; var aceDateY = new Date(aceDate.valueOf() - num * day); var aceYear = aceDate.getYear(); if (aceYear < 1000) { aceYear += 1900 } var aceYearY = aceDateY.getYear(); if (aceYearY < 1000) { aceYearY += 1900 } var aceDay = aceDate.getDay(); var aceDayY = aceDateY.getDay(); var aceMonth = aceDate.getMonth() + 1; if (aceMonth < 10) { aceMonth = "0" + aceMonth } var aceMonthY = aceDateY.getMonth() + 1; if (aceMonthY < 10) { aceMonthY = "0" + aceMonthY } var aceDayMonth = aceDate.getDate(); if (aceDayMonth < 10) { aceDayMonth = "0" + aceDayMonth } var aceDayMonthY = aceDateY.getDate(); if (aceDayMonthY < 10) { aceDayMonthY = "0" + aceDayMonthY } var YesterdayDate = aceMonthY + "/" + aceDayMonthY + "/" + aceYearY; var TodayDate = aceMonth + "/" + aceDayMonth + "/" + aceYear; document.Form1.DE_SIC_PRBL_STRT_DT.value = YesterdayDate; document.Form1.DE_SIC_PRBL_END_DT.value = TodayDate } function ParseUSNumber(PhoneNumberInitialString) { var FmtStr = ""; var index = 0; var LimitCheck; LimitCheck = PhoneNumberInitialString.length; while (index != LimitCheck) { if (isNaN(parseInt(PhoneNumberInitialString.charAt(index)))) {} else { FmtStr = FmtStr + PhoneNumberInitialString.charAt(index) } index = index + 1 } if (FmtStr.length == 10) { FmtStr = "(" + FmtStr.substring(0, 3) + ") " + FmtStr.substring(3, 6) + "-" + FmtStr.substring(6, 10) } else if (FmtStr.length > 10) { FmtStr = "(" + FmtStr.substring(0, 3) + ") " + FmtStr.substring(3, 6) + "-" + FmtStr.substring(6, 10) + " Ext. " + FmtStr.substring(10, FmtStr.length) } else { document.write("") } document.write(FmtStr) } function Sort_Special(a, b, order) { /* Remove any commas (assumes that if present all strings will have a fixed number of d.p) */ var x = a == "-" ? 0 : a.replace(/,/g, ""); var y = b == "-" ? 0 : b.replace(/,/g, ""); x = x.replace(/-\s{1,}/g, "-"); y = y.replace(/-\s{1,}/g, "-"); if (order == "asc") { /* Parse and return */ x = parseFloat(x); y = parseFloat(y); return x > y ? 1: -1; } else { /* Parse and return */ x = parseFloat(x); y = parseFloat(y); return y > x ? 1: -1; } } function PreProcessData(data) { if (DE_STMT_CYCL_CD == "C") { return } for (var i = 0; i < data.length; i++) { data[i][0] = "1"; if (data[i][1] == "H") { for (var j = 2; j < data[i].length; j++) { data[i][j] = "" } } } } function buildExpireDropdown(DE_ACCT_EXPR_DT_YY, yrs, idx) { document.write('<select name="DE_ACCT_EXPR_DT_YY" tabindex="' + idx + '">'); document.write('<option value="" selected>' + DE_ACCT_EXPR_DT_YY + '</option>'); var dt = new Date; var i; for (i = 0; i < yrs; i++) { var yr = dt.getFullYear(); var s = ''; yr = yr + i; s = s + yr; s = s.substring(2); document.write('<option value="' + s + '">' + s + '</option>'); } document.write('</select>'); } /** * Function to remove DOM elements from a form. * @param parentDiv the div containing the element to be removed. * @param childDiv the div to be removed. */ function removeElement(parentDiv, childDiv) { var parent = document.getElementById(parentDiv); var child = document.getElementById(childDiv); if (child) { parent.removeChild(child); } } /** * Function to add a DOM elements to a form. * @param parentDiv the div where the element is to be added. * @param childDiv the div to be added. */ function addElement(parentDiv, childDiv, value) { var parent = document.getElementById(parentDiv); var newdiv = document.createElement('input'); newdiv.setAttribute('name', childDiv); newdiv.setAttribute('id', childDiv); newdiv.setAttribute('type', "hidden"); newdiv.setAttribute('value', value); parent.appendChild(newdiv); } /** * Function to display an overlay with a display message presented to user. * @param message the message to be displayed to the user. **/ function DisplayOverlay(message) { var removeOverlay = document.getElementById("overlay"); var removeOverlayContent = document.getElementById("overlayContent"); if (removeOverlay) { document.body.removeChild(removeOverlay); } if (removeOverlayContent) { document.body.removeChild(removeOverlayContent); } var overlay = document.createElement("div"); overlay.setAttribute("id", "overlay"); if (navigator.appVersion.indexOf("MSIE") > 0) { overlay.className = "overlay"; } else { overlay.setAttribute("class", "overlay"); } document.body.appendChild(overlay); var overlayContent = document.createElement("div"); overlayContent.setAttribute("id", "overlayContent"); overlayContent.innerHTML = message; document.body.appendChild(overlayContent); } /** * Function to remove an overlay that was presented to user. **/ function RemoveOverlay() { var tmpOverlay = document.getElementById("overlay"); var tmpOverlayContent = document.getElementById("overlayContent"); if (tmpOverlay) { document.body.removeChild(tmpOverlay); } if (tmpOverlayContent) { document.body.removeChild(tmpOverlayContent); } } /** * Function to display a standard looking overlay message. * @param url URL to page to be displayed. **/ function DisplayMessage(url) { if (url != "") { var tmpWidth = (winWidth - 600) / 2; var tmpHeight = (winHeight - 360) / 2; var message = "<div class=\"overlayContent\" style=\"left: " + tmpWidth + ";\">"; message += "<div style=\"width: 600px; height: 360px; text-align: left;\">"; message += " <div style=\"height: 360px;\">"; message += " <iframe src=\"/EN/mrktmsg/" + url + "\" width=\"600\" height=\"360\" scrolling=\"no\" frameBorder=\"0\">"; message += " <p>Your browser does not support iframes.</p>"; message += " </iframe>"; message += " <div>"; message += "</div>"; DisplayOverlay(message); } } function SignUpNow() { RemoveOverlay(); DynamicForm("DE_WEB_PAGE_ID=master_home&DE_WEB_COMMAND=EStatement&DE_ACCT_STTS=&DE_ACCT_TYPE=&DE_INITIALIZE_LIST=&DE_STRT_DT="); } /** * Function to display an overlay with a display message presented to user. * @param message the message to be displayed to the user. **/ function DisplayOverlayError(message, containerStyle, contentStyle, msgOverride) { var tmpStyle1 = ""; if (containerStyle != "") { tmpStyle1 = " style='" + containerStyle + "'"; } var tmpStyle2 = ""; if (contentStyle != "") { tmpStyle2 = " style='" + contentStyle + "'"; } var removeOverlay = document.getElementById("overlay"); var removeOverlayContent = document.getElementById("overlayContent"); if (removeOverlay) { document.body.removeChild(removeOverlay); } if (removeOverlayContent) { document.body.removeChild(removeOverlayContent); } var overlay = document.createElement("div"); overlay.setAttribute("id", "overlay"); if (navigator.appVersion.indexOf("MSIE") > 0) { overlay.className = "overlayError"; } else { overlay.setAttribute("class", "overlayError"); } document.body.appendChild(overlay); var overlayContent = document.createElement("div"); overlayContent.setAttribute("id", "overlayContent"); if (msgOverride) { overlayContent.innerHTML = message; } else { var tmpMsg = "<div class=\"overlayContentError\"" + tmpStyle1 + ">"; tmpMsg += " <div" + tmpStyle2 + ">" + message + "</div>"; tmpMsg += " <div style=\"padding-top: 10px; text-align: center;\"><a href=\"#\" onclick=\"RemoveOverlay(); return false;\"><img id=\"btnClose\" src=\"" + cgiDir + "/btn-images/ok.gif\" title=\"ok\" alt=\"[ok]\" class=\"buttonImage\"></a></div>"; tmpMsg += "</div>"; overlayContent.innerHTML = tmpMsg; } document.body.appendChild(overlayContent); } /** * Function to check the imput field for invalid characters and * also check to see if the enter key has been pressed to cause * the form to submit. * @param filter the type of imput that is valid. [num, char, alpha] * @param divID the div id to check and update. * @param formName the name of the form to submit or use "function:SubmitForm" * to call a function specified on the current page. */ function cleanInput(filter, divID, formName, e) { var tmpEvent = window.event ? event : e; var keyCode = tmpEvent.charCode ? tmpEvent.charCode : tmpEvent.keyCode; var tmpInput = document.getElementById(divID); var tmpValue = ""; if (tmpInput) { tmpValue = tmpInput.value; switch (filter) { case "num": if (tmpValue != "") { if ((isNaN(tmpValue)) || (tmpValue.indexOf(".") > -1)) { tmpInput.value = tmpValue.substr(0, tmpValue.length - 1); } } break; case "decimal": if (tmpValue != "") { if (isNaN(tmpValue)) { tmpInput.value = tmpValue.substr(0, tmpValue.length - 1); } } break; case "char": break; default: } } if ((formName != null) && (keyCode == 13)) { var tmpCmd = ""; if (formName.indexOf("function:") > -1) { tmpCmd = formName.replace("function:", "") + "()"; } else { tmpCmd = "document." + formName + ".submit()"; } eval(tmpCmd); } } /* * Function to get a specified parameter from the url. * @paramName the named parameter to get the value for. */ function GetParameter(paramName) { paramName = paramName.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); var regexS = "[\\?&]" + paramName + "=([^&#]*)"; var regex = new RegExp(regexS); var results = regex.exec(window.location.href); if (results == null) { return ""; } else { return results[1]; } } /** * Function to display a standard looking overlay message. * @param url URL to page to be displayed. **/ function DisplayAlertMessage(url, altMessage, displayTop, displayWidth, displayHeight, cookieName) { if ((url != "") || (altMessage != "")) { var tmpWidth = Math.floor(displayWidth/2); var message = "<div class=\"overlayContent\" style=\"top: " + displayTop + "px; left: 50%; margin-left: -" + tmpWidth + "px; width: " + displayWidth + "px; \">"; message += "<div style=\"width: " + displayWidth + "px; height: " + displayHeight + "px; text-align: left;\">"; message += " <div style=\"height: " + displayHeight + "px;\">"; if (altMessage != "") { message += " " + altMessage; } else { message += " <iframe src=\"" + url + "\" width=\"" + displayWidth + "\" height=\"" + displayHeight + "\" scrolling=\"no\" frameBorder=\"0\">"; message += " <p>Your browser does not support iframes.</p>"; message += " </iframe>"; } message += " <div>"; message += "</div>"; DisplayOverlay(message); } } /** * Function to calculate the actual window width for center purposes. * @return return the window width */ function GetWindowWidth() { var winW = 0; if (document.body && document.body.offsetWidth) { winW = document.body.offsetWidth; } if (document.compatMode == 'CSS1Compat' && document.documentElement && document.documentElement.offsetWidth) { winW = document.documentElement.offsetWidth; } if (window.innerWidth) { winW = window.innerWidth; } return winW; } /** * Function to calculate the actual window height for center purposes. * @return return the window height */ function GetWindowHeight() { var winH = 0; if (document.body && document.body.offsetHeight) { winH = document.body.offsetHeight; } if (document.compatMode == 'CSS1Compat' && document.documentElement && document.documentElement.offsetHeight) { winH = document.documentElement.offsetHeight; } if (window.innerHeight) { winH = window.innerHeight; } } /** * Function to check text for restricted special characters. * @param tmpStr the string to check for special characters. * @param tmpList the type of restrictions to be used. * @return boolean true if string contains special character, false otherwise. */ function SpecialChars(tmpStr, tmpList) { var validChar; var strlen = tmpStr.length; var entry = tmpStr.toUpperCase(); switch (tmpList.toLowerCase()) { case "a": validChar = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; break; case "n": validChar = "0123456789"; break; case "an": validChar = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; break; default: validChar = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ.,-_$/"; } for (i = 0; i < strlen; i++) { if (validChar.indexOf(entry.charAt(i)) < 0) { return true; i = strlen; } } return false; } /** * Function to get the saved cookie name if present. * @cookieName the name of the cookie to get. */ function getCookie(cookieName) { if (document.cookie.length > 0) { var c_start = document.cookie.indexOf(cookieName + "="); if (c_start != -1) { var c_start = c_start + cookieName.length + 1; c_end = document.cookie.indexOf(";", c_start); if (c_end == -1) { var c_end = document.cookie.length; } return unescape(document.cookie.substring(c_start, c_end)); } } return ""; } /** * function to save a cookie that contains the newly selected font size. * @param cookieName the name of the cookie to save. * @param cookieValue the value to be saved in the cookie. * @param expireDays the number of days until the cookie expires. */ function saveCookie(cookieName, cookieValue, expireDays) { var expireDate = new Date(); expireDate.setDate(expireDate.getDate() + expireDays); document.cookie = cookieName + "=" + escape(cookieValue) + ((expireDays == null) ? "" : ";expires=" + expireDate.toUTCString()); } /** * Function to pause execution for the specified milliseconds. * @param miliseconds is the number of milliseconds to pause for. **/ function Pause(milliseconds) { var currentTime = new Date().getTime(); while (currentTime + milliseconds >= new Date().getTime()) {} } /** * Function to create a popup window and then post page data to it for display. * @param tmpWindow the window title for the new popup. * @param tmpWidth the width of the new window. * @param tmpHeight the height of the new window. * @param tmpLeft the left window location. * @param tmptop the top window location. * @param tmpSizeable is the window sizeable. * @param tmpScroll is the window scrollable. * @param tmpParams the form parameters to be submitted to target popup. * @param tmpCSR is this for the CSR side. * @param tmpBookmark is the bookmark used. * @param tmpUrl is an alternate posting url. * * Example: <a href="#" onclick="PopupWindow('FAQ', '800', '700', 100, 100, true, true, 'DE_WEB_PAGE_ID=xxx&DE_WEB_COMMAND=yyy', false, false, ''); return false;">test link</a> **/ function PopupWindow(tmpWindow, tmpWidth, tmpHeight, tmpLeft, tmpTop, tmpSizeable, tmpScroll, tmpParams, tmpCSR, tmpBookmark, tmpUrl) { var tmpLeftStr = ""; if (tmpLeft != "") { tmpLeftStr = ",left=" + tmpLeft; } var tmpTopStr = ""; if (tmpTop != "") { tmpTopStr = ",top=" + tmpTop; } if (tmpWidth == "") { tmpWidth = "800"; } if (tmpHeight == "") { tmpHeight = "600"; } var resizeable = "no"; if (tmpSizeable) { resizeable = "yes"; } var scrollBars = "no"; if (tmpScroll) { scrollBars = "yes"; } if (tmpWindow != "_blank") { var tmpPopup = window.open(cgiDir + '/loading.htm', tmpWindow, 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=' + scrollBars + ',resizable=' + resizeable + ',width=' + tmpWidth + ',height=' + tmpHeight + tmpLeftStr + tmpTopStr); Pause(500); if (tmpUrl == "") { tmpPopup.focus(); } } /* Remove form if present on page. */ var removePopForm = document.getElementById("OAMFormPop"); if (removePopForm) { document.body.removeChild(removePopForm); } var bookMark = ""; if (tmpBookmark) { bookMark = "#" + DE_CASE_ID; } if (navigator.appVersion.indexOf("MSIE 7.") > -1) { var popForm = document.createElement("div"); popForm.setAttribute("id","OAMFormPop"); /* Add blank div to page. */ document.body.appendChild(popForm); var newPopForm = document.getElementById("OAMFormPop"); var tmpPath = "cgi-bin"; if (tmpCSR) { tmpPath = "csr-bin"; } var tmpForm = ""; if (tmpUrl != "") { tmpForm = "<form name=\"OAMFormPop7\" action=\"" + tmpUrl + bookMark + "\" method=\"post\" target=\"" + tmpWindow + "\">"; } else { tmpForm = "<form name=\"OAMFormPop7\" action=\"" + cgiDir + "/" + tmpPath + "/cgi_chip" + bookMark + "\" method=\"post\" target=\"" + tmpWindow + "\">"; var tmpVars = tmpParams.split("&"); for (tmpInput in tmpVars) { tmpValue = tmpVars[tmpInput].split("="); tmpForm = tmpForm + "<input name=\"" + tmpValue[0] + "\" id=\"" + tmpValue[0] + "\" type=\"hidden\" value=\"" + tmpValue[1] + "\">"; } } if (typeof DE_RANDOM_TOKEN != 'undefined') { tmpForm = tmpForm + "<input name=\"DE_RANDOM_TOKEN\" id=\"DE_RANDOM_TOKEN\" type=\"hidden\" value=\"" + DE_RANDOM_TOKEN + "\">"; } tmpForm = tmpForm + "</form>"; /* Add html to div. */ newPopForm.innerHTML = tmpForm; document.OAMFormPop7.submit(); } else { /* Create form to be added to page. */ var popForm = document.createElement("form"); popForm.setAttribute("id","OAMFormPop"); popForm.setAttribute("name","OAMFormPop"); popForm.setAttribute("method","post"); popForm.setAttribute("target",tmpWindow); if (tmpUrl != "") { popForm.setAttribute("action",tmpUrl + bookMark); } else { if (tmpCSR) { popForm.setAttribute("action",cgiDir + "/csr-bin/cgi_chip" + bookMark); } else { popForm.setAttribute("action",cgiDir + "/cgi-bin/cgi_chip" + bookMark); } /* Add form variables. */ if (tmpVars == "") { alert("Please provide form varaibles to pass to Popup Window!"); } else { var popFormInput = ""; var tmpVars = tmpParams.split("&"); for (tmpInput in tmpVars) { tmpValue = tmpVars[tmpInput].split("="); popFormInput = document.createElement("input"); popFormInput.setAttribute("id",tmpValue[0]); popFormInput.setAttribute("name",tmpValue[0]); popFormInput.setAttribute("type","hidden"); popFormInput.setAttribute("value",tmpValue[1]); popForm.appendChild(popFormInput); } } } if (typeof DE_RANDOM_TOKEN != 'undefined') { popFormInput = document.createElement("input"); popFormInput.setAttribute("id","DE_RANDOM_TOKEN"); popFormInput.setAttribute("name","DE_RANDOM_TOKEN"); popFormInput.setAttribute("type","hidden"); popFormInput.setAttribute("value",DE_RANDOM_TOKEN); popForm.appendChild(popFormInput); } /* Add form to page. */ document.body.appendChild(popForm); /* Submit form just added to page. */ window.setTimeout(OAMFormPopSubmit, 500); } } /** * Function to allow new popup window to load before posting data to it. **/ function OAMFormPopSubmit() { document.OAMFormPop.submit(); } function DynamicForm(tmpParams) { var tmpCSR = window.location.toString(); var removeForm = document.getElementById("OAMFormCustom"); if (removeForm) { document.body.removeChild(removeForm); } if (navigator.appVersion.indexOf("MSIE 7.") > -1) { var customForm = document.createElement("div"); customForm.setAttribute("id","OAMFormCustom"); document.body.appendChild(customForm); var newCustomForm = document.getElementById("OAMFormCustom"); var tmpForm = ""; if (tmpCSR.indexOf("csr-bin") > -1) { tmpForm = "<form name=\"OAMFormCustom7\" action=\"" + cgiDir + "/csr-bin/cgi_chip\" method=\"post\">"; } else { tmpForm = "<form name=\"OAMFormCustom7\" action=\"" + cgiDir + "/cgi-bin/cgi_chip\" method=\"post\">"; } var tmpVars = tmpParams.split("&"); for (tmpInput in tmpVars) { tmpValue = tmpVars[tmpInput].split("="); tmpForm = tmpForm + "<input name=\"" + tmpValue[0] + "\" id=\"" + tmpValue[0] + "\" type=\"hidden\" value=\"" + tmpValue[1] + "\">"; } if (typeof DE_RANDOM_TOKEN != 'undefined') { tmpForm = tmpForm + "<input name=\"DE_RANDOM_TOKEN\" id=\"DE_RANDOM_TOKEN\" type=\"hidden\" value=\"" + DE_RANDOM_TOKEN + "\">"; } tmpForm = tmpForm + "</form>"; newCustomForm.innerHTML = tmpForm; document.OAMFormCustom7.submit(); } else { var customForm = document.createElement("form"); customForm.setAttribute("id","OAMFormCustom"); customForm.setAttribute("name","OAMFormCustom"); customForm.setAttribute("method","post"); if (tmpCSR.indexOf("csr-bin") > -1) { customForm.setAttribute("action",cgiDir + "/csr-bin/cgi_chip"); } else { customForm.setAttribute("action",cgiDir + "/cgi-bin/cgi_chip"); } if (tmpVars == "") { alert("Please provide form varaibles to pass to Popup Window!"); } else { var customFormInput = ""; var tmpVars = tmpParams.split("&"); for (tmpInput in tmpVars) { tmpValue = tmpVars[tmpInput].split("="); customFormInput = document.createElement("input"); customFormInput.setAttribute("id",tmpValue[0]); customFormInput.setAttribute("name",tmpValue[0]); customFormInput.setAttribute("type","hidden"); customFormInput.setAttribute("value",tmpValue[1]); customForm.appendChild(customFormInput); } } if (typeof DE_RANDOM_TOKEN != 'undefined') { customFormInput = document.createElement("input"); customFormInput.setAttribute("id","DE_RANDOM_TOKEN"); customFormInput.setAttribute("name","DE_RANDOM_TOKEN"); customFormInput.setAttribute("type","hidden"); customFormInput.setAttribute("value",DE_RANDOM_TOKEN); customForm.appendChild(customFormInput); } document.body.appendChild(customForm); document.OAMFormCustom.submit(); } } function DynamicFormAction(tmpLocation,tmpMethod,tmpParams,tmpToken) { var tmpCSR = window.location.toString(); var removeForm = document.getElementById("OAMFormCustom"); if (removeForm) { document.body.removeChild(removeForm); } if (navigator.appVersion.indexOf("MSIE 7.") > -1) { var customForm = document.createElement("div"); customForm.setAttribute("id","OAMFormCustom"); document.body.appendChild(customForm); var newCustomForm = document.getElementById("OAMFormCustom"); var tmpForm = ""; tmpForm = "<form name=\"OAMFormCustom7\" action=\"" + tmpLocation + "\" method=\"" + tmpMethod + "\">"; if ((tmpParams != "") && (tmpParams != null)) { var tmpVars = tmpParams.split("&"); for (tmpInput in tmpVars) { tmpValue = tmpVars[tmpInput].split("="); tmpForm = tmpForm + "<input name=\"" + tmpValue[0] + "\" id=\"" + tmpValue[0] + "\" type=\"hidden\" value=\"" + tmpValue[1] + "\">"; } } if (tmpToken) { if (typeof DE_RANDOM_TOKEN != 'undefined') { tmpForm = tmpForm + "<input name=\"DE_RANDOM_TOKEN\" id=\"DE_RANDOM_TOKEN\" type=\"hidden\" value=\"" + DE_RANDOM_TOKEN + "\">"; } } tmpForm = tmpForm + "</form>"; newCustomForm.innerHTML = tmpForm; document.OAMFormCustom7.submit(); } else { var customForm = document.createElement("form"); customForm.setAttribute("id","OAMFormCustom"); customForm.setAttribute("name","OAMFormCustom"); customForm.setAttribute("method",tmpMethod); customForm.setAttribute("action",tmpLocation); if ((tmpParams != "") && (tmpParams != null)) { var customFormInput = ""; var tmpVars = tmpParams.split("&"); for (tmpInput in tmpVars) { tmpValue = tmpVars[tmpInput].split("="); customFormInput = document.createElement("input"); customFormInput.setAttribute("id",tmpValue[0]); customFormInput.setAttribute("name",tmpValue[0]); customFormInput.setAttribute("type","hidden"); customFormInput.setAttribute("value",tmpValue[1]); customForm.appendChild(customFormInput); } } if (tmpToken) { if (typeof DE_RANDOM_TOKEN != 'undefined') { customFormInput = document.createElement("input"); customFormInput.setAttribute("id","DE_RANDOM_TOKEN"); customFormInput.setAttribute("name","DE_RANDOM_TOKEN"); customFormInput.setAttribute("type","hidden"); customFormInput.setAttribute("value",DE_RANDOM_TOKEN); customForm.appendChild(customFormInput); } } document.body.appendChild(customForm); document.OAMFormCustom.submit(); } } function DynamicStartForm(tmpQuery,tmpParams) { var tmpCSR = window.location.toString(); var removeForm = document.getElementById("OAMFormCustom"); if (removeForm) { document.body.removeChild(removeForm); } if (navigator.appVersion.indexOf("MSIE 7.") > -1) { var customForm = document.createElement("div"); customForm.setAttribute("id","OAMFormCustom"); document.body.appendChild(customForm); var newCustomForm = document.getElementById("OAMFormCustom"); var tmpForm = "<form name=\"OAMFormCustom7\" action=\"" + cgiDir + "/csr-bin/cgi_chip" + tmpQuery + "\" method=\"post\">"; var tmpVars = tmpParams.split("&"); for (tmpInput in tmpVars) { tmpValue = tmpVars[tmpInput].split("="); tmpForm = tmpForm + "<input name=\"" + tmpValue[0] + "\" id=\"" + tmpValue[0] + "\" type=\"hidden\" value=\"" + tmpValue[1] + "\">"; } tmpForm = tmpForm + "</form>"; newCustomForm.innerHTML = tmpForm; document.OAMFormCustom7.submit(); } else { var customForm = document.createElement("form"); customForm.setAttribute("id","OAMFormCustom"); customForm.setAttribute("name","OAMFormCustom"); customForm.setAttribute("method","post"); customForm.setAttribute("action",cgiDir + "/csr-bin/cgi_chip" + tmpQuery); if (tmpVars == "") { alert("Please provide form varaibles to pass to Popup Window!"); } else { var customFormInput = ""; var tmpVars = tmpParams.split("&"); for (tmpInput in tmpVars) { tmpValue = tmpVars[tmpInput].split("="); customFormInput = document.createElement("input"); customFormInput.setAttribute("id",tmpValue[0]); customFormInput.setAttribute("name",tmpValue[0]); customFormInput.setAttribute("type","hidden"); customFormInput.setAttribute("value",tmpValue[1]); customForm.appendChild(customFormInput); } } document.body.appendChild(customForm); document.OAMFormCustom.submit(); } } function AddNavigationForm(tmpParams) { var tmpCSR = window.location.toString(); var removeForm = document.getElementById("OAMFormCustom"); if (removeForm) { document.body.removeChild(removeForm); } if (navigator.appVersion.indexOf("MSIE 7.") > -1) { var customForm = document.createElement("div"); customForm.setAttribute("id","OAMFormCustom"); document.body.appendChild(customForm); var newCustomForm = document.getElementById("OAMFormCustom"); var tmpForm = "<form name=\"navigation\" action=\"" + cgiDir + "/cgi-bin/cgi_chip\" method=\"post\">"; var tmpVars = tmpParams.split(","); for (tmpInput in tmpVars) { tmpValue = tmpVars[tmpInput].split("="); tmpForm = tmpForm + "<input name=\"" + tmpValue[0] + "\" id=\"" + tmpValue[0] + "\" type=\"hidden\" value=\"\">"; } tmpForm = tmpForm + "</form>"; newCustomForm.innerHTML = tmpForm; document.OAMFormCustom7.submit(); } else { var customForm = document.createElement("form"); customForm.setAttribute("id","navigation"); customForm.setAttribute("name","navigation"); customForm.setAttribute("method","post"); customForm.setAttribute("action",cgiDir + "/cgi-bin/cgi_chip"); if (tmpVars == "") { alert("Please provide form varaibles to pass to Popup Window!"); } else { var customFormInput = ""; var tmpVars = tmpParams.split(","); for (tmpInput in tmpVars) { tmpValue = tmpVars[tmpInput].split("="); customFormInput = document.createElement("input"); customFormInput.setAttribute("id",tmpValue[0]); customFormInput.setAttribute("name",tmpValue[0]); customFormInput.setAttribute("type","hidden"); customFormInput.setAttribute("value",""); customForm.appendChild(customFormInput); } } document.body.appendChild(customForm); } } /** * Function to build a select list from an array that could contain * the selected value as the first item in the list with the key * value ste to a blank string. * @param selectList the list to be processed. * @param checkValue the value to compare if available. * @return the newly created list. */ function BuildSelectList(selectList, checkValue) { var tmpList = '<option value=""></option>'; var tmpSelected = ""; for (var x = 0; x < selectList.length - 1; x++) { if ((checkValue == selectList[x][0]) || (checkValue == selectList[x][1])) { tmpSelected = " selected"; } tmpList = tmpList + '<option value="' + selectList[x][0] + '"' + tmpSelected + '>' + selectList[x][1] + '</option>'; tmpSelected = ""; } return tmpList; } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Functions below control the addition of the Token to forms and links on a page // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function AddToken(tokenName, tokenValue) { updateForms(tokenName, tokenValue); updateTags(tokenName, tokenValue); } function updateTags(tokenName, tokenValue) { var hrefs = document.getElementsByTagName('a'); for (var i = 0; i < hrefs.length; i++) { updateTag(hrefs[i], "href", tokenName, tokenValue); } } function updateForms(tokenName, tokenValue) { var forms = document.getElementsByTagName("form"); for (i = 0; i < forms.length; i++) { var html = forms[i].innerHTML; if (html.indexOf(tokenName) == -1) { html += "<input type=\"hidden\" name=\"" + tokenName + "\" value=\"" + tokenValue + "\" />"; forms[i].innerHTML = html; } } } function updateTag(element, attr, tokenName, tokenValue) { var location = element.getAttribute(attr) if ((location != null) && (location != "") && (isHttpLink(location))) { if ((location.indexOf("mailto:") < 0) && (location.toLowerCase().indexOf("javascript:") < 0)) { var index = location.indexOf("?"); if (index != -1) { location = location + "&" + tokenName + "=" + tokenValue; } else { location = location + "?" + tokenName + "=" + tokenValue; } element.setAttribute(attr, location); } } } function isHttpLink(src) { var hostname = window.location.hostname; var result = 0; if (((src.indexOf(hostname) > 0) && (src.substring(src.length - 1, src.length) != "/")) || (src.substring(0, 1) == "/")) { result = 1; } return result; } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * Function to adjust the image name and return the * image html tag populated for placement on the page. * @param str the image string to modify. * @return the modified image in an html image tag. */ function GetImage(str) { var tmpImage = ""; if (str.length >= 1) { tmpImage = "<img class=\"error\" src=\"" + DE_CGI_DIR + "/images/errormark.gif\" />"; } return tmpImage; } function buildExpireDropdownNew(DE_ACCT_EXPR_DT_YY, yrs, idx) { var tmpStr = '<select name="DE_ACCT_EXPR_DT_YY" tabindex="' + idx + '">'; tmpStr += '<option value="" selected>' + DE_ACCT_EXPR_DT_YY + '</option>'; var dt = new Date; var i; for (i = 0; i < yrs; i++) { var yr = dt.getFullYear(); var s = ''; yr = yr + i; s = s + yr; s = s.substring(2); tmpStr += '<option value="' + s + '">' + s + '</option>'; } tmpStr += '</select>'; return tmpStr; } function ErrorTextReturn() { var tmpStr = ""; if (errors.length > 1) { var count = errors.length - 1; var sTrim = DE_CGI_DIR.trim(); var FRENCH = /CF/i if (sTrim.search(FRENCH) != -1) { var ErrorHeader = CFErrorHeader; } else { var ErrorHeader = ENErrorHeader; } tmpStr += "<br /><table class=\"error-table\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><thead><tr><th>" + ErrorHeader + "<\/th><\/tr><\/thead>"; tmpStr += "<tr><td><ul>"; for (i = 0; i < count; ++i) { tmpStr += "<li>" + errors[i] + "<\/li>"; } tmpStr += "<\/ul><\/td><\/tr><\/tbody><\/table>"; } return tmpStr; } function DisplayMessage(tmpLanguage) { if (tmpLanguage == "CF") { document.write("<p><a href=\"#\" onclick=\"PopupWindow('Notice', '700', '180', 100, 100, true, true, '', false, false, '/CF/login/notice.htm'); return false;\" target=\"_blank\">Avis Important</a></p>"); } else { document.write("<p><a href=\"#\" onclick=\"PopupWindow('Notice', '700', '180', 100, 100, true, true, '', false, false, '/EN/login/notice.htm'); return false;\" target=\"_blank\">Important Notice</a></p>"); } }