var orderTotalCost = null; var global_msg_type = 0; /** *
Shows a hidden element
* * @param eltID the element id * @param inline isInline? * @return */ function showEl(eltID, inline) { if(typeof document.getElementById(eltID) == "undefined" || document.getElementById(eltID) == null) throw "invalid ElementId passed. id:"+eltID; if (!inline) { inline = 0; } if(inline) { document.getElementById(eltID).style.display = 'inline'; } else { document.getElementById(eltID).style.display = 'block'; } return false; } /** *Hides an element
* * @param eltID the element id * @return */ function hideEl(eltID){ if(typeof document.getElementById(eltID) == "undefined" || document.getElementById(eltID) == null) throw "invalid ElementId passed. id:"+eltID; document.getElementById(eltID).style.display = 'none'; return false; } /** *Fires an ajax call to load the countries
* * @param cartId the order identifier * @param cartConfNo the order confirmation number * @param successHandler the success handler * @param failureHandler the failure handler * @return */ function loadCountries(sfUrl, cartId, cartConfNo, successHandler, failureHandler) { ajaxReq( "/gatewayService?req_type=JSON", successHandler, failureHandler, { 'role':'buyer', 'verb':'getCountries', 'resp_type':'JSON', 'serv_id':'buyerCheckoutService', 'data': { 'cartId':cartId, 'cartConfirmationNo':cartConfNo, 'sfUrl':sfUrl } } ); } /** *Fires an ajax call to load the states for the given countryId
* * @param cartId the order identifier * @param cartConfNo the order confirmation number * @param countryId the country identifier * @param successHandler the success handler * @param failureHandler the failure handler * @return */ function loadStates(cartId, cartConfNo, countryId, successHandler, failureHandler) { ajaxReq( "/gatewayService?req_type=JSON", successHandler, failureHandler, { 'role':'buyer', 'verb':'getStates', 'resp_type':'JSON', 'serv_id':'buyerCheckoutService', 'data': { 'cartId':cartId, 'cartConfirmationNo':cartConfNo, 'countryId':countryId } } ); } /** *Fires an ajax call to load the address
* * @param mode the address mode --> "shipping"/"billing" * @param cartId the order identifier * @param cartConfNo the order confirmation number * @param successHandler handler to invoke on success * @param failureHandler handler to invoke on failure * @return */ function loadAddress(mode, cartId, cartConfNo, successHandler, failureHandler) { ajaxReq( "/gatewayService?req_type=JSON", successHandler, failureHandler, { 'role':'buyer', 'verb':'getAddress', 'resp_type':'JSON', 'serv_id':'buyerCheckoutService', 'data': { 'cartId':cartId, 'cartConfirmationNo':cartConfNo, 'mode':mode } } ); } /** *Fires an ajax call to load Order Total for the given cartId
* * @param cartId the order identifier * @param cartConfNo the order confirmation number * @param successHandler the success handler * @param failureHandler the failure handler * @return */ function loadPaymentOptions(cartId, cartConfNo, successHandler, failureHandler) { ajaxReq( "/gatewayService?req_type=JSON", successHandler, failureHandler, { 'role':'buyer', 'verb':'getPaymentOptions', 'resp_type':'JSON', 'serv_id':'buyerCheckoutService', 'data': { 'cartId':cartId, 'cartConfirmationNo':cartConfNo } } ); } /** *Fires an ajax call to load the order summary
* * @param cartId the order identifier * @param cartConfNo the order confirmation number * @param successHandler handler to invoke on success * @param failureHandler handler to invoke on failure * @return */ function loadOrderSummary(cartId, cartConfNo, successHandler, failureHandler) { ajaxReq( "/gatewayService?req_type=JSON", successHandler, failureHandler, { 'role':'buyer', 'verb':'getOrderSummary', 'resp_type':'JSON', 'serv_id':'buyerCheckoutService', 'data': { 'cartId':cartId, 'cartConfirmationNo':cartConfNo } } ); } /** *Takes care of firing an ajax call
* * @param url the url to send the request to * @param handleSuccess the success handler * @param handleFailure the failure handler * @param params the params to construct the request * @return */ function ajaxReq(url, handleSuccess, handleFailure, params) { loadMask = new Ext.LoadMask(Ext.getBody(), {msg:'Loading...'}); loadMask.show(); params = params || {}; Ext.Ajax.request({ method: 'POST', url: url, success: handleLocalResponse, failure: handleFailure, params: params, argument: { handlerSuccess: handleSuccess, handlerFailure: handleFailure } }); } /** *Takes care of handling the response locally before invoking the success/failure handlers
* * @param response the response data * @param request the request * @return */ function handleLocalResponse(response, request) { var argument = response.argument; //check response status var json = response.responseText; var objResponse = json.length ? eval("("+json+")") : {status : "error", errmsg : "Empty response"}; request.params = Ext.util.JSON.decode(request.params.request); //if ok call success handler for specific action else call handleFailure if(objResponse.status == 'ok') { argument.handlerSuccess.createDelegate(this, [objResponse, request.params])(); } else { argument.handlerFailure.createDelegate(this, [objResponse, request.params])(); } loadMask.hide(); } /** *Fires an AJAX call to load the payment details section
* * @param cartId the order identifier * @param cartConfNo the order confirmation number * @param successHandler the success handler * @param failureHandler the failure handler * @return */ function loadPaymentDetails(cartId, cartConfNo, successHandler, failureHandler) { ajaxReq( "/gatewayService?req_type=JSON", successHandler, failureHandler, { 'role':'buyer', 'verb':'getPaymentDetails', 'resp_type':'JSON', 'serv_id':'buyerCheckoutService', 'data': { 'cartId':cartId, 'cartConfirmationNo':cartConfNo } } ); } /** *Fires an ajax call to load the order costs section
* * @param cartId the order identifier * @param cartConfNo the order confirmation number * @param reCalculate the variable to force * @return */ function loadOrderCosts(cartId, cartConfNo, reCalculate, successHandler, failureHandler) { // make ajax call to service ajaxReq( "/gatewayService?req_type=JSON", successHandler, failureHandler, { 'role':'buyer', 'resp_type':'JSON', 'serv_id':'buyerCheckoutService', 'verb':'getOrderCosts', 'data': { 'cartId':cartId, 'cartConfirmationNo':cartConfNo, 'reCalculate':reCalculate } } ); } /** *Success handler for load order costs call
* * @param response the response data * @return */ function loadOrderCostsSuccessHandler(response, request) { Lotus.ChkoutErrorPod.dispRespMessage(response); if (global_msg_type == 0) { update_msg_box(0); //warning } else { update_msg_box(2); } // get the response object var tmpStr; response = response.response; // update Sale Price var actualSalePrice = document.getElementById('orderSummaryActualSalePrice'); if (response['actualSalePrice'] ) { response['actualSalePrice'] = parseFloat(response['actualSalePrice']); tmpStr = response['actualSalePrice'].toFixed(2); } else { tmpStr = parseFloat("0.00").toFixed(2); } if(isMarketplaceCart) { actualSalePrice.innerHTML = "$" + tmpStr; } else { actualSalePrice.innerHTML = " US $" + tmpStr + ""; } // update Shipping and handling var shippingHandlingCost = document.getElementById('orderSummaryShippingHandlingCost'); if (response['shippingCost'] ) { response['shippingCost'] = parseFloat(response['shippingCost']); tmpStr = response['actualSalePrice'].toFixed(2); } else { response['shippingCost'] = 0; } if (response['handlingCost'] ) { response['handlingCost'] = parseFloat(response['handlingCost']); } else { response['handlingCost'] = 0; } tmpStr = (response['shippingCost'] + response['handlingCost']).toFixed(2); if(isMarketplaceCart) { shippingHandlingCost.innerHTML = "$" + tmpStr; } else { shippingHandlingCost.innerHTML = " US $" + tmpStr + ""; } //hide shipping & handling for 11main if value = 0 var shippingHandlingLine = document.getElementById('p_orderSummaryShippingHandlingCost'); if (isMarketplaceCart) { if ("0.00" == tmpStr) { shippingHandlingLine.style.display = "none"; } else { shippingHandlingLine.style.display="block"; } } // shippingDiscount // update shipping Discount var shippingDiscount = document.getElementById('orderSummaryShippingDiscount'); if (response['shippingDiscount'] ) { response['shippingDiscount'] = parseFloat(response['shippingDiscount']); tmpStr = response['shippingDiscount'].toFixed(2); } else { tmpStr = parseFloat("0.00").toFixed(2); } if(isMarketplaceCart) { shippingDiscount.innerHTML = "$" + tmpStr; } else { shippingDiscount.innerHTML = " US -$" + tmpStr + ""; } //hide shipping discount for 11main if value = 0 var shippingDiscountLine = document.getElementById('p_orderSummaryShippingDiscount'); if (isMarketplaceCart) { if("0.00" == tmpStr) { shippingDiscountLine.style.display = "none"; } else { shippingDiscountLine.style.display="block"; } } // update insurance cost var insuranceCost = document.getElementById('orderSummaryInsuranceCost'); if (response['insuranceCost'] ) { response['insuranceCost'] = parseFloat(response['insuranceCost']); tmpStr = response['insuranceCost'].toFixed(2); if(isMarketplaceCart) { if("0.00" == tmpStr){ var elemToHide = document.getElementById('p_orderSummaryInsuranceCost'); if(elemToHide && elemToHide != null) { elemToHide.style.display = 'none'; } } else { insuranceCost.innerHTML = "$" + tmpStr; } } else { if("0.00" == tmpStr){ var elemToHide = document.getElementById('title_orderSummaryInsuranceCost'); if(elemToHide && elemToHide != null) { elemToHide.style.display = 'none'; } insuranceCost.style.display = 'none'; } else { insuranceCost.innerHTML = " US $" + tmpStr + ""; } } } else { var elemToHide = document.getElementById('p_orderSummaryInsuranceCost'); if(isMarketplaceCart) { if(elemToHide && elemToHide != null) { elemToHide.style.display = 'none'; } } else { var elemToHide = document.getElementById('title_orderSummaryInsuranceCost'); if(elemToHide && elemToHide != null) { elemToHide.style.display = 'none'; } insuranceCost.style.display = 'none'; } } // update Tax var tax = document.getElementById('orderSummaryTax'); if (response['tax'] ) { response['tax'] = parseFloat(response['tax']); tmpStr = response['tax'].toFixed(2); } else { tmpStr = parseFloat("0.00").toFixed(2); } if(isMarketplaceCart) { tax.innerHTML = "$" + tmpStr; } else { tax.innerHTML = " US $" + tmpStr + ""; } //hide tax for marketplace if value = 0 var taxLine = document.getElementById('p_orderSummaryTax'); if (isMarketplaceCart) { if("0.00" == tmpStr) { taxLine.style.display = "none"; } else { taxLine.style.display="block"; } } // update tax percentage var taxPercentage = document.getElementById('orderSummaryTaxPercentage'); if (response['taxPercentage'] ) { response['taxPercentage'] = parseFloat(response['taxPercentage']); tmpStr = response['taxPercentage']; } else { tmpStr = "0"; } taxPercentage.innerHTML = "" + tmpStr + ""; // update coupon discount var couponDiscount = document.getElementById('orderSummaryCouponDiscount'); var couponApplied = false; if (response['couponDiscount'] ) { response['couponDiscount'] = parseFloat(response['couponDiscount']); tmpStr = response['couponDiscount'].toFixed(2); couponApplied = true; } else { tmpStr = parseFloat("0.00").toFixed(2); } //hide shipping discount for 11main if value = 0 var sellerCouponLine = document.getElementById('p_orderSummaryCouponDiscount'); if (isMarketplaceCart) { if("0.00" == tmpStr) { sellerCouponLine.style.display = "none"; } else { sellerCouponLine.style.display="block"; } } if (isMarketplaceCart) { couponDiscount.innerHTML = "-$" + tmpStr; couponLink = document.getElementById('removeCouponButton'); if (couponLink != null && typeof couponLink != 'undefined') { if (couponApplied == true) { couponLink.style.display = 'block'; } else { couponLink.style.display = 'none'; } } } else { couponDiscount.innerHTML = " US -$" + tmpStr + ""; } var otherDesc = document.getElementById('orderSummaryOtherDesc'); var otherCost = document.getElementById('orderSummaryOtherCost'); if(response['otherDesc'] && response['otherDesc'] != null && response['otherDesc'] != '') { otherDesc.innerHTML = "(" + response['otherDesc'] + ")"; } if(response['otherCost'] && response['otherCost'] != null && response['otherCost'] != '') { response['otherCost'] = parseFloat(response['otherCost']); tmpStr = response['otherCost'].toFixed(2); }else{ tmpStr = parseFloat("0.00").toFixed(2); } if(isMarketplaceCart) { var elemToHide = document.getElementById('p_orderSummaryOtherCost'); if("0.00" == tmpStr){ if(elemToHide && elemToHide != null) { elemToHide.style.display = 'none'; } } else { if(elemToHide && elemToHide != null) { elemToHide.style.display = 'block'; } otherCost.innerHTML = "$" + tmpStr; } } else { otherCost.innerHTML = " US $" + tmpStr + ""; } // update Total cost var totalCost = document.getElementById('orderSummaryTotalCost'); var totalCostNote = document.getElementById('orderTotalCostNote'); if (response['totalCost'] && response['totalCost'] != null && response['totalCost'] != '') { response['totalCost'] = parseFloat(response['totalCost']); tmpStr = response['totalCost'].toFixed(2); if(isMarketplaceCart) { totalCost.innerHTML = "$" + tmpStr; } else { totalCost.innerHTML = " US $" + tmpStr + ""; } orderTotalCost = tmpStr; totalCostNote.innerHTML = ''; } else { tmpStr = 'N/A'; totalCost.innerHTML = "" + tmpStr + ""; orderTotalCost = null; totalCostNote.innerHTML = "Total cannot be calculated, contact the Seller for the total."; } // make the order summary div visible var orderSummary = document.getElementById('orderSummary'); orderSummary.style.display = "block"; } /** *Failure handler for load order costs call
* * @param response the response data * @return */ function loadOrderCostsFailureHandler(response) { // TODO : add proper error handling Lotus.ChkoutErrorPod.dispRespMessage(response); update_msg_box(2); //error } /** *Fires an ajax call to load the packages
* * @param cartId the order identifier * @param cartConfNo the order confirmation number * @param successHandler handler to invoke on success * @param failureHandler handler to invoke on failure * @return */ function getPackages(cartId, cartConfNo, successHandler, failureHandler) { ajaxReq( "/gatewayService?req_type=JSON", successHandler, failureHandler, { 'role':'buyer', 'verb':'getPackages', 'resp_type':'JSON', 'serv_id':'buyerCheckoutService', 'data': { 'cartId':cartId, 'cartConfirmationNo':cartConfNo } } ); } /** *Success handler for getPackages call
* * @param response the response data * @return */ function getPackagesSuccessHandler(response) { writePackageSection(response); loadOrderCosts(cartId, cartConfNo, (typeof(reCalculate) == 'undefined') ? true : reCalculate, loadOrderCostsSuccessHandler, loadOrderCostsFailureHandler); } /** *Failure handler for getPackages call
* * @param response the response data * @return */ function getPackagesFailureHandler(response) { Lotus.ChkoutErrorPod.dispRespMessage(response); update_msg_box(2); //error } /** *Success handler for updatePackages call
* * @param response the response data * @return */ function updatePackageSuccessHandler(response) { getPackages(cartId, cartConfNo, getPackagesSuccessHandler, getPackagesFailureHandler); } /** *Failure handler for updatePackages call
* * @param response the response data * @return */ function updatePackageFailureHandler(response) { Lotus.ChkoutErrorPod.dispRespMessage(response); update_msg_box(2); //error } /** *Success handler for updatePackages call
* * @param response the response data * @return */ function deleteItemSuccessHandler(response) { response = response.response; if(response != null && typeof response != 'undefined' && response.redirectUrl != null && typeof response.redirectUrl != 'undefined') { window.open(response.redirectUrl, '_self'); return; } getPackages(cartId, cartConfNo, getPackagesSuccessHandler, getPackagesFailureHandler); } /** *Failure handler for updatePackages call
* * @param response the response data * @return */ function deleteItemFailureHandler(response) { Lotus.ChkoutErrorPod.dispRespMessage(response); update_msg_box(2); //error } function carrierChange(obj){ // clear all previous Pod Messages ChkoutClearAllPodMessages(); var packageId = obj.name.split("_")[1]; var insuraneChoice = document.getElementById("insurance_" + packageId).checked; var carrierChoice = document.getElementById("carrier_" + packageId).value; updatePackages(packageId,carrierChoice,insuraneChoice,updatePackageSuccessHandler,updatePackageFailureHandler); } function insuranceChange(obj){ // clear all previous Pod Messages ChkoutClearAllPodMessages(); var packageId = obj.name.split("_")[1]; var insuraneChoice = document.getElementById("insurance_" + packageId).checked; var carrierChoice = document.getElementById("carrier_" + packageId).value; updatePackages(packageId,carrierChoice,insuraneChoice,updatePackageSuccessHandler,updatePackageFailureHandler); } function deleteItem(itemId){ ajaxReq( "/gatewayService?req_type=JSON", deleteItemSuccessHandler, deleteItemFailureHandler, { 'role':'buyer', 'verb':'deleteItems', 'resp_type':'JSON', 'serv_id':'buyerCheckoutService', 'data': { 'cartId':cartId, 'cartConfirmationNo':cartConfNo, 'orderItemIds': [itemId] } } ); } function writePackageSection(response) { var resp = response.response; var packages = resp.packages; var sellerMarketLogin = packages[0].items[0].marketLogin; var marketId = packages[0].items[0].marketId; if(88 == marketId) { var str = ''; str += 'Fires an ajax call to update the packages
* * * @param cartId the order identifier * @param cartConfNo the order confirmation number * @param successHandler handler to invoke on success * @param failureHandler handler to invoke on failure * @return */ function updatePackages(packageId, carrierChoice, insuranceChoice, successHandler, failureHandler) { ajaxReq( "/gatewayService?req_type=JSON", successHandler, failureHandler, { 'role':'buyer', 'verb':'updatePackages', 'resp_type':'JSON', 'serv_id':'buyerCheckoutService', 'data': { 'cartId':cartId, 'cartConfirmationNo':cartConfNo, 'packages': [{"id":packageId,"carrierChoice":carrierChoice,"insuranceChoice":insuranceChoice}] } } ); } /** * Sets the Stores Cookie URL */ function getStoresCookieURL(storesCookieURL) { if(storesCookieURL != null && storesCookieURL != '') { var cartImg = document.createElement("img"); cartImg.src=storesCookieURL; document.body.appendChild(cartImg); } } /* * updates message box border * */ function update_msg_box(msg_type) { switch (msg_type) { case 0 : // success var tlImageUrl = "transparent url(/lotus/images/bg/pod_caps.gif) no-repeat scroll -9px -17px"; var tlHeight = "6px"; var msgIcon = "transparent"; var trImageUrl = "transparent url(/lotus/images/bg/pod_caps.gif) no-repeat scroll 0 -17px"; var trWidth = "9px"; var contentBorder = "1px solid #7FC396"; var blImageUrl = "#FFFFFF url(/lotus/images/bg/pod_caps.gif) no-repeat scroll -9px 0"; var blHeight = "15px"; var brImageUrl = "transparent url(/lotus/images/bg/pod_caps.gif) no-repeat scroll 0 0"; break; case 1 : // warning // TODO break; case 2 : // error var tlImageUrl = "transparent url(/lotus/images/errctl.gif) no-repeat scroll left top"; var tlHeight = "10px"; var trImageUrl = "transparent url(/lotus/images/errctr.gif) no-repeat scroll right top"; var trWidth = "9px"; var msgIcon = "transparent url(/lotus/images/iconError_16x16.gif) no-repeat scroll left 2px"; var contentBorder = "1px solid #FF0000"; var blImageUrl = "transparent url(/lotus/images/errcbl.gif) no-repeat scroll left top"; var blHeight = "10px"; var brImageUrl = "transparent url(/lotus/images/errcbr.gif) no-repeat scroll right top"; default : break; } // tl var podErrors = document.getElementById("podErrors"); if (podErrors) { var pHeader = getElementsByClassName("podHeader", "DIV", podErrors); pHeader = pHeader[0]; pHeader.style.background = tlImageUrl; pHeader.style.height = tlHeight // 10px for error // tr tag = "SPAN"; elm = pHeader; var elements = (tag == "*" && elm.all)? elm.all : elm.getElementsByTagName(tag); if (elements) { trSpan = elements[0]; trSpan.style.background = trImageUrl trSpan.style.width = trWidth; // 9px for error } var msgIconDiv = document.getElementById("podErrorMessages"); if (msgIconDiv) { msgIconDiv.style.background = msgIcon; } var podErrorsContent = document.getElementById("podErrorsContent"); if (podErrorsContent) { podErrorsContent.style.borderLeft = contentBorder; podErrorsContent.style.borderRight = contentBorder; } // podFooter var podFooter = getElementsByClassName("podFooter", "DIV", podErrors); if (podFooter) { podFooter = podFooter[0]; podFooter.style.background = blImageUrl podFooter.style.height = blHeight; // tr tag = "DIV"; elm = podFooter; var elements = (tag == "*" && elm.all)? elm.all : elm.getElementsByTagName(tag); if (elements) { brSpan = elements[0]; brSpan.style.background = brImageUrl brSpan.style.width = trWidth; } } } } /* * * get elements by class name * */ function getElementsByClassName(className, tag, elm){ var testClass = new RegExp("(^|\\s)" + className + "(\\s|$)"); var tag = tag || "*"; var elm = elm || document; var elements = (tag == "*" && elm.all)? elm.all : elm.getElementsByTagName(tag); var returnElements = []; var current; var length = elements.length; for(var i=0; i" + message + "
"; Lotus.ChkoutErrorPod.podE$.innerHTML = msgs;//document.getElementById('podErrorMessages').innerHTML = msgs; } function ChkoutsetErrorPodSuccessModeClass() { if (Lotus.ChkoutErrorPod.pod$.className.indexOf("successMode") < 0) { Lotus.ChkoutErrorPod.pod$.className = Lotus.ChkoutErrorPod.pod$.className + ' successMode'; } } function ChkoutresetErrorPodClass() { var podClass = Lotus.ChkoutErrorPod.pod$.className; if(podClass.indexOf("successMode") > -1){ Lotus.ChkoutErrorPod.pod$.className = podClass.replace(" successMode", ""); } } if(typeof Lotus == 'undefined') Lotus = {}; Lotus.ChkoutreplaceNewLineTxt = function(message) { message = message.replace(Lotus.ChkoutErrorPod.regExp, "" + msg + "
"; this.podE$.innerHTML = msgs; }, dispRespMessage : function(response){ if(!response || response == undefined) return false; this.dispMessages(response.errmsg); return this.dispMessages(response.messages); } ,dispMessages : function(msgs){ if(!msgs || msgs == undefined || (msgs instanceof Array && msgs.length <= 0)) return false; this.showPod(); this.pod$.scrollIntoView(); if(msgs instanceof Array){ for (var i = 0; i < msgs.length; ++i) { msgs[i] = this.displayMsg(msgs[i]); } }else{ this.displayMsg(msgs); } return true; } ,formatter : { format: function(msgO){ return this.handleContext(msgO); } ,setAttr : function(msgO){ if (!msgO || msgO == null) return undefined; msgO = (typeof msgO == 'string')? {message:msgO} : msgO; msgO.message = Lotus.ChkoutreplaceNewLineTxt(msgO.message); msgO.status = msgO.status || ''; switch (msgO.status) { case Lotus.ChkoutErrorPod.STATUS.WARN: case Lotus.ChkoutErrorPod.STATUS.INFO: msgO.pId = Lotus.ChkoutErrorPod.podIId; msgO.css = "info"; msgO.dom = Lotus.ChkoutErrorPod.podI$; ChkoutresetErrorPodClass(); document.getElementById("podInfoMessages").style.display="inherit"; document.getElementById("podSuccessMessages").style.display="none"; document.getElementById("podErrorMessages").style.display="none"; break; case Lotus.ChkoutErrorPod.STATUS.SUCCESS: msgO.pId = Lotus.ChkoutErrorPod.podSId; msgO.css = "success"; msgO.dom = Lotus.ChkoutErrorPod.podS$; ChkoutsetErrorPodSuccessModeClass(); document.getElementById("podSuccessMessages").style.display="inherit"; document.getElementById("podErrorMessages").style.display="none"; document.getElementById("podInfoMessages").style.display="none"; break; case Lotus.ChkoutErrorPod.STATUS.ERROR: default: msgO.pId = Lotus.ChkoutErrorPod.podEId; msgO.css = "error"; msgO.dom = Lotus.ChkoutErrorPod.podE$; msgO.status = Lotus.ChkoutErrorPod.STATUS.ERROR; ChkoutresetErrorPodClass(); document.getElementById("podErrorMessages").style.display="inherit"; document.getElementById("podSuccessMessages").style.display="none"; document.getElementById("podInfoMessages").style.display="none"; } return msgO; } ,handleRefId : function(msgO){ return this.setAttr(msgO); } ,handleContext : function(msgO){ msgO = this.handleRefId(msgO); if(!msgO || typeof msgO != 'object' || typeof msgO.context == 'undefined' || msgO.context == null || msgO.context == "") return msgO; return msgO; } } ,displayMsg: function(msgO){ if (!msgO || msgO == null) return ""; msgO = this.formatter.format(msgO); var pEl = document.createElement("p"); pEl.className = msgO.css; pEl.innerHTML = msgO.message; msgO.dom.appendChild(pEl); return msgO; } ,showPod : function(){ this.init(); if(this.pod$.style.display == 'none') this.pod$.style.display='block'; } ,hidePod : function() { this.init(); this.pod$.style.display = 'none'; } ,clearPod : function(){ this.podS$.innerHTML = ''; this.podE$.innerHTML = ''; this.podI$.innerHTML = ''; } } Lotus.onDocReady(function(evnt){Lotus.ChkoutErrorPod.init();}); /** *Fires an ajax call to add the buyer to sellers mailing list
* * @param cartId the order identifier * @param cartConfNo the order confirmation number * @param okToMail is ok to mail? * @param successHandler handler to invoke on success * @param failureHandler handler to invoke on failure * @return */ function addToMailingList(cartId, cartConfNo, okToMail, successHandler, failureHandler) { ajaxReq( "/gatewayService?req_type=JSON", successHandler, failureHandler, { 'role':'buyer', 'verb':'addToMailingList', 'resp_type':'JSON', 'serv_id':'buyerCheckoutService', 'data': { 'cartId':cartId, 'cartConfirmationNo':cartConfNo, 'okToMail': okToMail } } ); } function isNumberKey(evt) { var charCode = (evt.which) ? evt.which : event.keyCode; if (charCode > 31 && (charCode < 48 || charCode > 57 || charCode == 46)) { return false; } return true; }