function openSection(n){$(n).find(".toggle-icon").removeClass("fa-chevron-down").addClass("fa-chevron-up");$(n).next(".hidden-textarea").show()}function setCountdownTimer(n){var t=$("#timeLeft");t.removeClass();var i=new Date($.now()),r=new Date(i),u=Number($("#hidDeadlineDeadlineRedMinutes").val());r.setMinutes(i.getMinutes()+u);Date.parse(n)<=Date.parse(i)?(t[0].innerHTML=$("#hidDeadlinePastMessage").val(),t.addClass("time-left-expired")):Date.parse(n)<=Date.parse(r)?($("#RunDateViewModel_Deadline-error").hide(),t.addClass("time-left-red"),t.countdown(n,function(n){$(this).html(n.strftime($("#hidTimerFormat").val()))})):($("#RunDateViewModel_Deadline-error").hide(),t.addClass("time-left"),t.countdown(n,function(n){$(this).html(n.strftime($("#hidTimerFormat").val()))}))}function transitionIn(){$("#modalLoading").modal({backdrop:"static",keyboard:!1})}function transitionOut(){$("#modalLoading").modal("hide")}function setOOPreviewPrice(){typeof showPreviewSpinner=="function"&&showPreviewSpinner();var n=$("#NoticeId").val(),t=$("#hidIsRevision").val();$.ajax({type:"POST",url:ViewDataPlaceNotice.SetOOPreviewPriceUrl,data:"{'noticeID':'"+n+"','isRevision':'"+t+"'}",contentType:"application/json; charset=utf-8",dataType:"json",async:!0,cache:!1,success:function(n){typeof refreshOOPreviewPrice=="function"&&refreshOOPreviewPrice(n);typeof refreshOOPreviewLarge=="function"&&refreshOOPreviewLarge(n);typeof closePreviewSpinner=="function"&&closePreviewSpinner();$("#hidOOPreviewHTML").length&&$("#hidOOPreviewHTML").val(n.previewLarge)},error:function(n){n.statusText!=="abort";typeof closePreviewSpinner=="function"&&closePreviewSpinner()}})}function refreshOOPreviewPrice(n){$("#spnOOPreview").html(n.preview);refreshPrice(n)}function refreshOOPreviewLarge(n){$("#spnOOPreviewLarge").html(n.previewLarge);$("#spnOOPreviewReview").length&&$("#spnOOPreviewReview").html(n.previewLarge)}function refreshPreviewPrice(n){$("#imgHJReviewLarge").attr("src",n.preview);$("#imgHJReview").attr("src",n.preview);refreshPrice(n)}function refreshPrice(n){var i=$("#hidPreviousPrice").val(),t,f,r,u;i>0?$("#spnHJPrice").html(formatMoney(n.price-i)):$("#spnHJPrice").html(formatMoney(n.price));t="";i>0?(r=n.price-i,u=parseFloat(i)+parseFloat(r),t+="<table class='' style='margin-left: auto;margin-right: auto;'><thead><span class='order-details-popup'>Price Details<\/span><\/thead>",t+="<tr><td class='td1'>&nbsp;Previous Price:<\/td><td class='td2'>",t+=formatMoney(i),t+="&nbsp;<\/td><\/tr>",t+="<tr><td class='td1' style='font-weight: bold;'>&nbsp;Adjustment:<\/td><td class='td2' style='font-weight: bold;'>",t+=formatMoney(r),t+="&nbsp;<\/td><\/tr>",t+="<tr><td class='td1'>&nbsp;New Price*:<\/td><td class='td2'>",t+=formatMoney(u),t+="&nbsp;<\/td><\/tr>",t+="&nbsp;<\/td><\/tr>",t+="<\/table >",t+="<table >",t+="<tr><td style='font-style: italic;'>New Price includes starting newspaper price and administrative fees.<\/td><\/tr>",t+="<\/table >"):(t+="<table class='' style='margin-left: auto;margin-right: auto;'><thead><span class='order-details-popup'>Price Details<\/span><\/thead>",t+="<tr><td class='td1'>&nbsp;Base Price:<\/td><td class='td2'>",t+=formatMoney(n.listingfee),t+="&nbsp;<\/td><\/tr>",n.textfeeandadditionalfees>0&&(t+="<tr><td class='td1'>&nbsp;Additional Content:<\/td><td class='td2'>",t+=formatMoney(n.textfeeandadditionalfees),t+="&nbsp;<\/td><\/tr>"),n.photofee>0&&(t+="<tr><td class='td1'>&nbsp;Photo Fee:<\/td><td class='td2'>",t+=formatMoney(n.photofee),t+="&nbsp;<\/td><\/tr>"),n.iconfee>0&&(t+="<tr><td class='td1'>&nbsp;Icon Fee:<\/td><td class='td2'>",t+=formatMoney(n.iconfee),t+="&nbsp;<\/td><\/tr>"),n.additionalrundayfee>0&&(t+="<tr><td class='td1'>&nbsp;Additional Run Day Fee:<\/td><td class='td2'>",t+=formatMoney(n.additionalrundayfee),t+="&nbsp;<\/td><\/tr>"),n.digitalupsellfeepopup>0&&(t+="<tr><td class='td1'>&nbsp;Legacy Digital Offering:<\/td><td class='td2'>",t+=formatMoney(n.digitalupsellfeepopup),t+="&nbsp;<\/td><\/tr>"),n.treeupsellfeepopup>0&&(t+="<tr><td class='td1'>&nbsp;Tree Offering:<\/td><td class='td2'>",t+=formatMoney(n.treeupsellfeepopup),t+="&nbsp;<\/td><\/tr>"),n.lcomqrfeepopup>0&&(t+="<tr><td class='td1'>&nbsp;Legacy Memory Link:<\/td><td class='td2'>",t+=formatMoney(n.lcomqrfeepopup),t+="&nbsp;<\/td><\/tr>"),n.lcomvideofeepopup>0&&(t+="<tr><td class='td1'>&nbsp;Legacy Video:<\/td><td class='td2'>",t+=formatMoney(n.lcomvideofeepopup),t+="&nbsp;<\/td><\/tr>"),n.lcomcouponpopup>0&&(t+="<tr><td class='td1'>&nbsp;Sympathy Store Coupon:<\/td><td class='td2'>",t+=formatMoney(n.lcomcouponpopup),t+="&nbsp;<\/td><\/tr>"),n.upsellfeepopup>0&&(t+="<tr><td class='td1'>&nbsp;Other Upsells Fee:<\/td><td class='td2'>",t+=formatMoney(n.upsellfeepopup),t+="&nbsp;<\/td><\/tr>"),t+="<tr><td class='td1' style='font-weight: bold;'>&nbsp;Subtotal*:<\/td><td class='td2' style='font-weight: bold;'>",t+=formatMoney(n.price),t+="&nbsp;<\/td><\/tr>",t+="<\/table >",n.fromOW=="True"&&(t+="<table class='' style='margin-left: auto;margin-right: auto;'><thead><span style='width: 100%; text-align: center; display: block; font-weight: 800;'>Your 10% discount will be applied in the Cart.<\/span><\/thead>",t+="<\/table >"),t+="<table class='' style='margin-left: auto;margin-right: auto;'><thead><span style='width: 100%; text-align: center; display: block; font-style: italic;'>*Price includes an administrative fee covering order handling.<\/span><\/thead>",t+="<\/table >");$("#spanHJErrorMessage").html("");$("#hidHJErrorMessage").val("");$("#imgHJReview").show();n.error==="True"&&($("#hidHJErrorMessage").val(n.errormessage),n.errormessage.toLowerCase().includes("cannot save to file")||n.errormessage.toLowerCase().includes("undefined")?n.envirnment=="production"?$("#spanHJErrorMessage").html(""):$("#spanHJErrorMessage").html(n.errormessage):$("#spanHJErrorMessage").html(n.errormessage),$("#imgHJReview").hide());$("a[name=popupPrice]").attr("data-content",t);i=$("#hidPreviousPrice").val();i>0?$("#spnHJPrice").html(formatMoney(n.price-i)):$("#spnHJPrice").html(formatMoney(n.price));t="";f=n.hasAdminCredit;i>0?(r=n.price-i,u=parseFloat(i)+parseFloat(r),t+="<table class='' style='margin-left: auto;margin-right: auto;'><thead><span class='order-details-popup'>Price Details<\/span><\/thead>",f=="false"&&(t+="<tr><td class='td1'>&nbsp;Previous Price:<\/td><td class='td2'>",t+=formatMoney(i),t+="&nbsp;<\/td><\/tr>"),t+="<tr><td class='td1' style='font-weight: bold;'>&nbsp;Adjustment:<\/td><td class='td2' style='font-weight: bold;'>",t+=formatMoney(r),t+="&nbsp;<\/td><\/tr>",f=="false"&&(t+="<tr><td class='td1'>&nbsp;New Price*:<\/td><td class='td2'>",t+=formatMoney(u),t+="&nbsp;<\/td><\/tr>"),t+="<\/table >",n.fromOW=="True"&&(t+="<table class='' style='margin-left: auto;margin-right: auto;'><thead><span style='width: 100%; text-align: center; display: block; font-weight: 800;'>Your 10% discount will be applied in the Cart.<\/span><\/thead>",t+="<\/table >"),f=="false"&&(t+="<table >",t+="<tr><td style='font-style: italic;'>New Price includes starting newspaper price and administrative fees.<\/td><\/tr>",t+="<\/table >")):(t+="<table class='' style='margin-left: auto;margin-right: auto;'><thead><span class='order-details-popup'>Price Details<\/span><\/thead>",t+="<tr><td class='td1'>&nbsp;Base Price:<\/td><td class='td2'>",t+=formatMoney(n.listingfee),t+="&nbsp;<\/td><\/tr>",n.textfeeandadditionalfees>0&&(t+="<tr><td class='td1'>&nbsp;Additional Content:<\/td><td class='td2'>",t+=formatMoney(n.textfeeandadditionalfees),t+="&nbsp;<\/td><\/tr>"),n.photofee>0&&(t+="<tr><td class='td1'>&nbsp;Photo Fee:<\/td><td class='td2'>",t+=formatMoney(n.photofee),t+="&nbsp;<\/td><\/tr>"),n.iconfee>0&&(t+="<tr><td class='td1'>&nbsp;Icon Fee:<\/td><td class='td2'>",t+=formatMoney(n.iconfee),t+="&nbsp;<\/td><\/tr>"),n.additionalrundayfee>0&&(t+="<tr><td class='td1'>&nbsp;Additional Run Day Fee:<\/td><td class='td2'>",t+=formatMoney(n.additionalrundayfee),t+="&nbsp;<\/td><\/tr>"),n.digitalupsellfeepopup>0&&(t+="<tr><td class='td1'>&nbsp;Legacy Digital Offering:<\/td><td class='td2'>",t+=formatMoney(n.digitalupsellfeepopup),t+="&nbsp;<\/td><\/tr>"),n.treeupsellfeepopup>0&&(t+="<tr><td class='td1'>&nbsp;Tree Offering:<\/td><td class='td2'>",t+=formatMoney(n.treeupsellfeepopup),t+="&nbsp;<\/td><\/tr>"),n.lcomqrfeepopup>0&&(t+="<tr><td class='td1'>&nbsp;Legacy Memory Link:<\/td><td class='td2'>",t+=formatMoney(n.lcomqrfeepopup),t+="&nbsp;<\/td><\/tr>"),n.lcomvideofeepopup>0&&(t+="<tr><td class='td1'>&nbsp;Legacy Video:<\/td><td class='td2'>",t+=formatMoney(n.lcomvideofeepopup),t+="&nbsp;<\/td><\/tr>"),n.lcomcouponpopup>0&&(t+="<tr><td class='td1'>&nbsp;Sympathy Store Coupon:<\/td><td class='td2'>",t+=formatMoney(n.lcomcouponpopup),t+="&nbsp;<\/td><\/tr>"),n.upsellfeepopup>0&&(t+="<tr><td class='td1'>&nbsp;Other Upsells Fee:<\/td><td class='td2'>",t+=formatMoney(n.upsellfeepopup),t+="&nbsp;<\/td><\/tr>"),t+="<tr><td class='td1' style='font-weight: bold;'>&nbsp;Subtotal*:<\/td><td class='td2' style='font-weight: bold;'>",t+=formatMoney(n.price),t+="&nbsp;<\/td><\/tr>",t+="<\/table >",n.fromOW=="True"&&(t+="<table class='' style='margin-left: auto;margin-right: auto;'><thead><span style='width: 100%; text-align: center; display: block; font-weight: 800;'>Your 10% discount will be applied in the Cart.<\/span><\/thead>",t+="<\/table >"),t+="<table class='' style='margin-left: auto;margin-right: auto;'><thead><span style='width: 100%; text-align: center; display: block; font-style: italic;'>*Price includes an administrative fee covering order handling.<\/span><\/thead>",t+="<\/table >");$("#spanHJErrorMessage").html("");$("#hidHJErrorMessage").val("");$("#imgHJReview").show();n.error==="True"&&($("#hidHJErrorMessage").val(n.errormessage),n.errormessage.toLowerCase().includes("cannot save to file")||n.errormessage.toLowerCase().includes("undefined")?n.envirnment=="production"?$("#spanHJErrorMessage").html(""):$("#spanHJErrorMessage").html(n.errormessage):$("#spanHJErrorMessage").html(n.errormessage),$("#imgHJReview").hide());$("a[name=popupPrice]").attr("data-content",t)}function showPreviewSpinner(){$("#imgHJReview").addClass("fade-out");$("#spnOOPreview").addClass("fade-out");$("#previewSpinner").show();disableContinueButton()}function closePreviewSpinner(){$("#spnOOPreview").removeClass("fade-out");$("#imgHJReview").removeClass("fade-out");$("#spnOOPreview").addClass("fade-in");$("#spnOOPreview").addClass("fade-in");$("#imgHJReview").addClass("fade-in");$("#previewSpinner").hide();enableContinueButton()}function disableContinueButton(){$("#btnContinue").hide();$("#btnContinueDisabled").show()}function setDirection(n){console.log("setDirection: "+n);$("#divEmailSent").hide();$("#direction").val(n)}function enableContinueButton(){$("#btnContinueDisabled").hide();$("#btnContinue").show()}function disableContinueButtonTemp(){disableContinueButton();setTimeout(function(){enableContinueButton()},1e4)}function formatMoney(n){if(n=n*1,n<0){var t="$"+n.toFixed(2).replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,");return"("+t.replace("-","")+")"}return"$"+n.toFixed(2).replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,")}function printThePreview(n){var t="",r="",f=$("#hidOnlineOnly").val(),u,i;f==="True"?(u=$("#spnOOPreviewLarge").html(),t="<html><head><\/head><body onload=\"javascript:window.print();window.close();\"><div id='divPreviewPrint' style='text-align: center;'>"+u+"<\/div><\/body>"):(r=n===undefined||n===""?$("#hidPreviewUrl").val():n,t="<html><head><\/head><body><div id='divPreviewPrint' style='text-align: center;'><img src=\""+r+'" onload="javascript:window.print();"/><\/div><\/body>');i=window.open();i.document.write(t);i.focus()}function discardNotice(n,t,i,r){var u=ViewDataPlaceNotice.DiscardNoticeUrl,f,e;$("#hidIsNetwork").val()=="True"&&(u=ViewDataPlaceNotice.NetworkDiscardNoticeUrl);f="{'noticeId':'"+n+"','paperId':'"+t+"', 'removeNotice':'"+i+"', 'isNetwork':'"+r+"', 'returnURL':'"+window.location.href+"'}";console.log(f);e=$("#hidIsRevision").val();$.ajax({type:"POST",url:u,data:"{'noticeId':'"+n+"','paperId':'"+t+"', 'removeNotice':'"+i+"', 'isNetwork':'"+r+"','isRevision':'"+e+"', 'returnURL':'"+window.location.href+"'}",contentType:"application/json; charset=utf-8",dataType:"json",async:!1,cache:!1,success:function(n){n.msg==""?window.location.href=n.returnUrl:alert(n.msg)},error:function(){}})}$(document).ready(function(){var t,n;setTimeout(function(){$(".alert-saved-notice").fadeOut(5500)},5500);$("#hidIsObitFirst").val()=="True"&&($("#obit_writer_modal").modal("show"),openSection("#divBasicInfo"),$("#hidIsObitFirst").val("False"));$(".grow1").hover(function(){$(this).stop();$(this).animate({width:"102%",height:"102%"},100)},function(){$(this).stop();$(this).animate({width:"98%",height:"98%"},100)});setInterval(function(){var n=$("#hidDeadline").val();n!==null&&n!=="undefined"&&n!==""?(setCountdownTimer(n),$("#spanTimer").show()):$("#spanTimer").hide()},1e3);t=document.getElementById("frmPlaceNotice");$("#previewEmail").on("click",function(){$("#ObitPreviewModal").modal();$("#spnEmailValError").hide();$("#txtEmailPreview").val("");$("#txtEmailName").val("");$("#txtEmailReplyTo").val("");$("#hidUserEmail").text().length>0&&$("#txtEmailReplyTo").val($("#hidUserEmail").text());$("#txtEmailPreviewMessage").val("");$("#divEmailSent").hide();$("#divEmail").toggle()});$(function(){$('[data-toggle="popover"]').popover()});n=$("#hidOnlineOnly").val();n==="True"&&typeof setOOPreviewPrice=="function"&&setOOPreviewPrice()});$("#ObitPreviewModal").on("shown.bs.modal",function(){$("#myInput").trigger("focus")});$(document).on("scroll",function(){$(document).scrollTop()>50?$("customer-header-navbar").addClass("disappear"):$("header").removeClass("shrink")});$(function(){$('[data-toggle="tooltip"]').tooltip()});var buttonText="";(function(n){"use strict";typeof define=="function"&&define.amd?define(["jquery"],n):n(jQuery)})(function(n){"use strict";function e(n){if(n instanceof Date)return n;if(String(n).match(t))return String(n).match(/^[0-9]*$/)&&(n=Number(n)),String(n).match(/\-/)&&(n=String(n).replace(/\-/g,"/")),new Date(n);throw new Error("Couldn't cast `"+n+"` to a date object.");}function o(n){var t=n.toString().replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");return new RegExp(t)}function s(n){return function(t){var e=t.match(/%(-|!)?[A-Z]{1}(:[^;]+;)?/gi),f,s;if(e)for(f=0,s=e.length;f<s;++f){var r=e[f].match(/%(-|!)?([a-zA-Z]{1})(:[^;]+;)?/),l=o(r[0]),c=r[1]||"",a=r[3]||"",i=null;r=r[2];u.hasOwnProperty(r)&&(i=u[r],i=Number(n[i]));i!==null&&(c==="!"&&(i=h(a,i)),c===""&&i<10&&(i="0"+i.toString()),t=t.replace(l,i.toString()))}return t.replace(/%%/,"%")}}function h(n,t){var i="s",r="";return n&&(n=n.replace(/(:|;|\s)/gi,"").split(/\,/),n.length===1?i=n[0]:(r=n[0],i=n[1])),Math.abs(t)>1?i:r}var i=[],t=[],f={precision:100,elapse:!1,defer:!1},u,r;t.push(/^[0-9]*$/.source);t.push(/([0-9]{1,2}\/){2}[0-9]{4}( [0-9]{1,2}(:[0-9]{2}){2})?/.source);t.push(/[0-9]{4}([\/\-][0-9]{1,2}){2}( [0-9]{1,2}(:[0-9]{2}){2})?/.source);t=new RegExp(t.join("|"));u={Y:"years",m:"months",n:"daysToMonth",d:"daysToWeek",w:"weeks",W:"weeksToMonth",H:"hours",M:"minutes",S:"seconds",D:"totalDays",I:"totalHours",N:"totalMinutes",T:"totalSeconds"};r=function(t,r,u){if(this.el=t,this.$el=n(t),this.interval=null,this.offset={},this.options=n.extend({},f),this.instanceNumber=i.length,i.push(this),this.$el.data("countdown-instance",this.instanceNumber),u)if(typeof u=="function"){this.$el.on("update.countdown",u);this.$el.on("stoped.countdown",u);this.$el.on("finish.countdown",u)}else this.options=n.extend({},f,u);this.setFinalDate(r);this.options.defer===!1&&this.start()};n.extend(r.prototype,{start:function(){this.interval!==null&&clearInterval(this.interval);var n=this;this.update();this.interval=setInterval(function(){n.update.call(n)},this.options.precision)},stop:function(){clearInterval(this.interval);this.interval=null;this.dispatchEvent("stoped")},toggle:function(){this.interval?this.stop():this.start()},pause:function(){this.stop()},resume:function(){this.start()},remove:function(){this.stop.call(this);i[this.instanceNumber]=null;delete this.$el.data().countdownInstance},setFinalDate:function(n){this.finalDate=e(n)},update:function(){if(this.$el.closest("html").length===0){this.remove();return}var r=n._data(this.el,"events")!==undefined,i=new Date,t;if(t=this.finalDate.getTime()-i.getTime(),t=Math.ceil(t/1e3),t=!this.options.elapse&&t<0?0:Math.abs(t),this.totalSecsLeft!==t&&r)this.totalSecsLeft=t;else return;this.elapsed=i>=this.finalDate;this.offset={seconds:this.totalSecsLeft%60,minutes:Math.floor(this.totalSecsLeft/60)%60,hours:Math.floor(this.totalSecsLeft/3600)%24,days:Math.floor(this.totalSecsLeft/86400)%7,daysToWeek:Math.floor(this.totalSecsLeft/86400)%7,daysToMonth:Math.floor(this.totalSecsLeft/86400%30.4368),weeks:Math.floor(this.totalSecsLeft/604800),weeksToMonth:Math.floor(this.totalSecsLeft/604800)%4,months:Math.floor(this.totalSecsLeft/86400/30.4368),years:Math.abs(this.finalDate.getFullYear()-i.getFullYear()),totalDays:Math.floor(this.totalSecsLeft/86400),totalHours:Math.floor(this.totalSecsLeft/3600),totalMinutes:Math.floor(this.totalSecsLeft/60),totalSeconds:this.totalSecsLeft};this.options.elapse||this.totalSecsLeft!==0?this.dispatchEvent("update"):(this.stop(),this.dispatchEvent("finish"))},dispatchEvent:function(t){var i=n.Event(t+".countdown");i.finalDate=this.finalDate;i.elapsed=this.elapsed;i.offset=n.extend({},this.offset);i.strftime=s(this.offset);this.$el.trigger(i)}});n.fn.countdown=function(){var t=Array.prototype.slice.call(arguments,0);return this.each(function(){var e=n(this).data("countdown-instance"),u,f;e!==undefined?(u=i[e],f=t[0],r.prototype.hasOwnProperty(f)?u[f].apply(u,t.slice(1)):String(f).match(/^[$A-Z_][0-9A-Z_$]*$/i)===null?(u.setFinalDate.call(u,f),u.start()):n.error("Method %s does not exist on jQuery.countdown".replace(/\%s/gi,f))):new r(this,t[0],t[1])})}})