var extraPendingReview="";var tabLoadListeners=new Array;var fbLogonWindowListener=false;function setParam(){var oldURL=window.location.protocol+"//"+window.location.host+window.location.pathname;var newUrl=oldURL+"#share-a-memory";if(window.history!="undefined"&&window.history.pushState!="undefined"){window.history.pushState({path:newUrl},"",newUrl)}}function initV31Obit(){$("#v31obhdr a").click(function(){dataLayerPush(dataLayer,"gaEvent","Obituary Banner","Click","Funeral Home")});$("#tribbookbtn").click(function(){dataLayerPush(dataLayer,"gaEvent","Obituary","Obituary Summary Click","View Tribute Book - Banner")});$(".zn-srvcs .btn-tributebook").click(function(){dataLayerPush(dataLayer,"gaEvent","Obituary","Event Info","View Tribute Book")});$("#tribute-keepsake").on("click",".kb-button",function(){dataLayerPush(dataLayer,"gaEvent","Obituary","Obit Bar Click","View Tribute Book")});$("#obcoreV3 .navcell31").click(function(){$("#obcoreV3 .navcell31").removeClass("nav-selected");$(this).addClass("nav-selected");onNavSection($(this).attr("data-tag"))});$("#v31obpg .btn-rsvp-svc").click(function(){rsvpToService($(this))});$("#v31obpg .btn-streaming-svc").click(function(){if($("#spmusic").length)stopBGMusic()});$("#v31obpg").on("click",".btn-snfl",function(){var cell=$(this).attr("data-tag");$(".obitnavtabs ."+cell).click()});$("#otadl").on("click",function(){if(confirm("Are you sure that you want to delete this record from Tribute Archive?")){var id=$(this).attr("data-id");axpost("/apax/delta","cid="+id,function(data){alert("Obituary Successfully Deleted from TA");window.location.reload()})}});$("#obcoreV3 .zn-srvcs .btn-services.emaildetails").on("click",{category:"Obituary",action:"Event Info",label:"Email Directions",unbindElement:true},pushServicesSharingData);$("#obcoreV3 .zn-srvcs .btn-services.smsdetails").on("click",{category:"Obituary",action:"Event Info",label:"Text Directions",unbindElement:true},pushServicesSharingData);$("#obcoreV3 .zn-srvcs .btn-services").not(".emaildetails, .smsdetails").on("click",{category:"Obituary",action:"Event Info",label:"View Map",unbindElement:false},pushServicesSharingData);$(".btn-email").on("click",function(){$(document).on("customEventEmail",{category:"Obituary",action:"Obit Bar Click",label:"Email Share",unbindElement:false},function(event,category,action,label,unbindElement){pushServicesSharingData(event)});$(document).trigger("customEventEmail")});$("#obtext .twtreelnk").on("click",{category:"Obituary",action:"Tribute Wall Click",label:"Plant a Tree Funeral Home Comment",unbindElement:false},pushServicesSharingData);if($("#famlgn").length>0){$("#famlgn").click(function(){$(document).on("customEventFamLog",{category:"Obituary",action:"Click",label:"Sign In",unbindElement:false},function(event,category,action,label,unbindElement){pushServicesSharingData(event)});$(document).trigger("customEventFamLog");axpost("/ajax/axsecurity.php","act=fammlgn",function(data){$("#pubdyncnt").html(data)})})}var menuCount=0;$(".cfshznav").each(function(){if(false==$(this).is(":hidden"))menuCount++});if(0==menuCount)$("#obsidebar .rethome").css("display","inline").addClass("hidden-xs");if(-1!=window.location.href.indexOf("#lightacandle"))$("li.candles").click();window.addEventListener("message",function(ev){if(-1!=ev.origin.indexOf("tributeslides")){onTukiosEvent(ev)}},false);$(document).on("click",".share-a-memory",function(e){e.preventDefault();setParam();if(typeof showShareMemoryModal==="number"&&showShareMemoryModal===1){const container=$("#pubdyncnt");const dt={oid:$(this).attr("obit-idx"),templateVersion:$("body").attr("data-template-version"),testName:$("body").attr("data-test-name")};axpost("/pax/share-a-memory-step-one",dt,function(data){container.html(data).find(".modal").modal("show");if($(e.target).parent("#socialproof-empty-state").length){$(".share-textarea").attr("placeholder",$("#socialproof-empty-state").text())}shareMemoryEcommerceStep=1})}});$("#v31obpg .sbgblink").click(function(){if(typeof showShareMemoryModal==="number"&&showShareMemoryModal===1){return}$("#obcontent").addClass("show-trib-entry");var cell=$(this).attr("data-tag");$(".obitnavtabs ."+cell).click()});$(document).on("click",".card .learn-more-block",function(e){if($(".learn-more-btn").data("clicked",true)){let card=$(this).parent().parent();if(!card.hasClass("showMore")){$(".card").removeClass("showMore");$(".card").find(".learn-more-btn").removeClass("hide-btn");$(".card").find(".show-less").addClass("hide-btn");$(".card").find(".ilearn").removeClass("hide-btn");$(".card").find(".iless").addClass("hide-btn")}card.toggleClass("showMore");card.find(".learn-more-btn").toggleClass("hide-btn");card.find(".learn-more-block img").toggleClass("hide-btn")}});initGTMEvents()}$(document).ready(function(){$(".obit-sharing .fbshare").click(function(){var ourl=$(this).attr("data-url");window.open("http://www.facebook.com/sharer.php?u="+ourl,"Facebook","toolbar=0,status=0,width=640,height=440")});$(".obit-sharing .fbshare").on("click",{category:"Obituary",action:"Obit Bar Click",label:"Facebook Share",unbindElement:false},pushServicesSharingData);$(".obit-sharing .btn-twitter").click(function(){var ourl=encodeURIComponent(window.location);window.open("https://twitter.com/intent/tweet?text="+$(this).attr("data-twt"),"Twitter","toolbar=0,status=0,width=640,height=440")});$(".obit-sharing .btn-twitter").on("click",{category:"Obituary",action:"Obit Bar Click",label:"Twitter Share",unbindElement:false},pushServicesSharingData);$("#obcoreV3").on("click",".smsdetails",function(){var tag=encodeURIComponent($(this).attr("data-id"));axpost("/pax/txtsrdnr","tag="+tag,function(data){$("#pubdyncnt").html(data)})});$("#obit-sharing a.btn-print").click(function(){$(document).on("customEventPrint",{category:"Obituary",action:"Obit Bar Click",label:"Print Share",unbindElement:false},function(event,category,action,label,unbindElement){pushServicesSharingData(event)});$(document).trigger("customEventPrint");if($("#dlgprint").length>0)$("#dlgprint").remove();var ok=$(this).attr("data-ok");var bg=$(this).attr("data-bg");var fcf=$(this).attr("data-fcf");axpost("/pax/prnobit","ok="+ok+"&fcf="+fcf+"&bg="+bg,function(data){$("#pubdyncnt").html(data)})});$("#obcoreV3").on("click",".emaildetails",function(){var tag=encodeURIComponent($(this).attr("data-id"));axpost("/pax/emsrdnr","tag="+tag,function(data){$("#pubdyncnt").html(data)})})});function initGTMEvents(){$('*[data-trigger="share-memory"]').click(function(){dataLayer.push({event:"gaEvent",category:"Obituary",action:"Obit Bar Click",label:"Share a Memory"})})}function rsvpToService(btn){var en=btn.attr("data-en");axpost("/pax/svcrsvp","en="+en,function(data){$("#pubdyncnt").html(data)})}function initRSVPToSvcDlg(){$("#fmrsvp").submit(function(ev){ev.preventDefault();return false});$("#dlgrsvptosvc input[name=rsvpoption]").click(function(){$("#rsvpopts").show();var rsvp=$(this).val();if(1==rsvp)$("#dlgrsvptosvc .att-flds").show();else $("#dlgrsvptosvc .att-flds").hide()});var rsvp=$("#dlgrsvptosvc input[name=rsvpoption]:checked").val();if(1==rsvp)$("#dlgrsvptosvc .att-flds").show();else $("#dlgrsvptosvc .att-flds").hide();$("#dorsvp").click(function(){validateRSVPFieldsAndSave()});$("#dlgrsvptosvc").modal("show")}function validateRSVPFieldsAndSave(){$("#dlgrsvptosvc div.form-group").removeClass("has-error");$("#rsvpstatus").hide();$("#rsvpstatus").text("Please correct the field highlighted in red and try again");if(0==$("#dlgrsvptosvc input[name=rsvpoption]:checked").length){$("#rsvpfl1").addClass("has-error");$("#rsvpstatus").show();return}if(""==$("#dlgrsvptosvc input[name=name]").val().trim()){$("#rsvpfl2").addClass("has-error");$("#dlgrsvptosvc input[name=name]").focus();$("#rsvpstatus").show();return}if(""==$("#dlgrsvptosvc input[name=email]").val().trim()){$("#rsvpfl3").addClass("has-error");$("#dlgrsvptosvc input[name=email]").focus();$("#rsvpstatus").show();return}if(""==$("#dlgrsvptosvc input[name=phone]").val().trim()){$("#rsvpfl4").addClass("has-error");$("#dlgrsvptosvc input[name=phone]").focus();$("#rsvpstatus").show();return}var dt=$("#dlgrsvptosvc").attr("data-en");var group=$("#attendees").val();var slot=$("#noslots").length?-1:$("#timeslot").val();var email=$("#rsvpemail").val();axpost("/pax/svcrsvpck","dt="+dt+"&g="+group+"&s="+slot+"&em="+email,function(data){if("OK"!=data){axpost("/pax/svcrsvpsl","dt="+dt+"&ix="+slot,function(opts){$("#timeslot").html(opts)});alert("Your party cannot be accommodated. Please review the current availability");$("#rsvpfl5").addClass("has-error")}else{postRSVPForm()}})}function postRSVPForm(){var fm=$("#fmrsvp");var dt=$("#dlgrsvptosvc").attr("data-en");var uid=$("#dlgrsvptosvc").attr("data-id");var ts=$("#noslots").length?-1:$("#timeslot option:selected").attr("data-tm");var attending=$("#dlgrsvptosvc input[name=rsvpoption]:checked").val();var data=fm.serialize();axpost("/pax/svcrsvpds","dt="+dt+"&ts="+ts+"&uid="+uid+"&"+data,function(resp){if("AOK"==resp){$("#dlgrsvptosvc").modal("hide");location.reload(true)}else if("BADEMAIL"==resp){$("#rsvpstatus").text("Please check your email address before continuing");$("#rsvpstatus").show()}else if("ERROR"!=resp){$("#dlgrsvptosvc").modal("hide");$("#pubdyncnt2").html(resp)}})}function initRSVPUpdateConf(){$("#cmdrsvpconf").click(function(){var hash=$("#rsvpupconf").attr("data-hs");var ipval=$("#rsvpcodefld").val();var userVal=rsvpStringHash(ipval);if(userVal==hash){var en=$("#rsvpupconf").attr("data-en");var cen=$("#rsvpupconf").attr("data-cen");axpost("/pax/dorsvpconf","cen="+cen+"&en="+en+"&uv="+ipval,function(resp){$("#rsvpupconf").modal("hide");$("#pubdyncnt").html(resp)})}else alert("Incorrect code. Please check your email")});$("#rsvpupconf").modal("show")}function initSMSDialog31(){$("#dlgtext31").modal("show");$("#fmodtxt").submit(function(e){e.preventDefault();$("#smsfmgrp").removeClass("has-error");if(""==$("#txtnum").val()){$("#smsfmgrp").addClass("has-error");return}var data=$("#fmodtxt").serialize();axpost("/pax/dotxtsrdnr",data,function(data){if("OK"==data){$("#dlgtext31").modal("hide");showServiceDlgSent()}else{$("#smsfmgrp").addClass("has-error");$("#ocstatus").text("Text not sent. Please check the number.")}});return false});$("#cnsntLglCK").on("change",function(){let subTxtBtn=$('#dlgtext31 button[data-tag="obituary-text-direction"]');if(this.checked){subTxtBtn.prop("disabled",false)}else{subTxtBtn.prop("disabled",true)}})}function initEmailDialog(){$("#dlgemail").modal("show");$("#fmodemail").submit(function(e){e.preventDefault();$("#emfmgrp").removeClass("has-error");if(""==$("#emails").val()){$("#emfmgrp").addClass("has-error");return}var data=$("#fmodemail").serialize();axpost("/pax/doemsrdnr",data,function(data){if("OK"==data){$("#dlgemail").modal("hide");showServiceDlgSent()}else{$("#emfmgrp").addClass("has-error");$("#ocstatus").text("Email not sent. Please check the addresses.")}});return false})}function showServiceDlgSent(){if($("#obsidebar button.btn-tree").length){$("#dlgsent31 div.generic").hide();$("#dlgsent31 div.tree-generic").show()}$("#dlgsent31").modal("show");$('[data-tag="obituary-send-a-flower-text-direction"]').on("click",{category:"Obituary",action:"Event Info",label:"Send Flowers - Text Directions",unbindElement:false},pushServicesSharingData);$('[data-tag="obituary-plant-a-tree-text-direction"]').on("click",{category:"Obituary",action:"Event Info",label:"Plant a Tree - Text Directions",unbindElement:false},pushServicesSharingData);$('[data-tag="obituary-plant-a-tree-direction"]').on("click",{category:"Obituary",action:"Event Info",label:"Plant a Tree - Email Directions",unbindElement:false},pushServicesSharingData);$('[data-tag="obituary-send-a-flower-direction"]').on("click",{category:"Obituary",action:"Event Info",label:"Send Flowers - Email Directions",unbindElement:false},pushServicesSharingData);$("#dlgsent31 div.generic-sympathygifts button").on("click",{category:"Obituary",action:"Event Info - Directions sent modal",label:"Tribute Store",unbindElement:false},pushServicesSharingData)}function obFlowerPanel(){var url=window.location.href+"/sympathy";window.location=url;return;var oid=$("#obitsbarV31").attr("data-oid");axpost("/pax/obpgsnvn","sn=store&oid="+oid,function(data){$("#ob31ca").html(data)})}function onTukiosEvent(ev){var evType=ev.data.type;if("play"==evType)stopBGMusic();else if("pause"==evType)startBGMusic()}function onNavSection(sectionName){var section=$("#sn-"+sectionName);var loaded=section.attr("data-ld");$("#obcontent .obsn").hide();section.show();$("#obsidebar").attr("class","");$("#obsidebar").addClass(sectionName);if(1==loaded)return;section.html('

Loading, please wait...

');var oid=$("#obitsbarV31").attr("data-oid");axpost("/pax/obpgsnvn","sn="+sectionName+"&oid="+oid,function(data){section.html(data);section.attr("data-ld",1);$.each(tabLoadListeners,function(key,fn){fn(sectionName)});addPrefixToURLs()})}function initTributeWall(){var win=$(window);var doc=$(document);$("#enter-tribute").click(function(){$("#obcontent").addClass("show-trib-entry");var trigger=$(this).data("trigger");if(trigger=="tribute-share-memory"){dataLayer.push({event:"gaEvent",category:"Obituary",action:"Tribute Wall Click",label:"Mobile - Share a Memory"})}});$(window).scroll(function(){checkPaging()});$("#wallopts li").click(function(){var op=$(this).attr("data-op");switch(op){case"multimedia":addMedia();break;case"embedvid":embedVideo();break;case"candle":showGestures($(this),"candles");break;case"sentiment":showGestures($(this),"sentiments");break;case"flowers":sendFlowers();break}});$("#twrmgest").click(function(){$("#gsid").val(0);$("#twcgest").hide();$("#twctext").removeClass("col-xs-9 col-sm-10").addClass("col-xs-12");$("#twctext .tribute-field").attr("placeholder","Please share your remembrances and condolences")});$("#emytclose").click(function(e){e.preventDefault();$("#embedyoutube").hide();$("#wallopts .emvd").removeClass("selected");return false});$("#ytlink").bind("paste",function(e){var videoURL=e.originalEvent.clipboardData.getData("text");doEmbedVideo(videoURL)});$("#embedyt").click(function(){var videoURL=$("#ytlink").val();doEmbedVideo(videoURL)});$("#twrmvid").click(function(){$("#ytvid").val("");$("#emvidpreview .videopreview").html();$("#emvidpreview").hide()});$("#tribtext").focus(function(){showTribSubFields()});$("#tribtext").on("keyup",function(){const element=$(this);if(element.val()!==""&&element.hasClass("has-error")){element.removeClass("has-error")}});$("#twctext div.tribute-field").focus(function(){showTribSubFields()});$("#tw-tree .btn-plant-tree").on("click",{category:"Obituary",action:"Tribute Wall Click",label:"Plant a Tree Banner",unbindElement:false},pushServicesSharingData);$("#addtrib").click(function(e){e.preventDefault();const form=$("#fmtribpost");var postLabel=$("#twcgest .twprev").attr("data-label");var gsid=$("#gsid").val();var ytvid=$("#ytvid").val();var gtmstatus=true;postLabel=gsid==0?"Post - Share Comment":"Post - "+postLabel;if(!ytvid){$(document).on("add-tribute-share-comment",{event:"gaEvent",category:"Obituary",action:"Tribute Wall Click",label:postLabel,unbindElement:false},function(event,category,action,label,unbindElement){if(gtmstatus==true){pushServicesSharingData(event);gtmstatus=false}});$(document).trigger("add-tribute-share-comment")}else{$(document).on("add-tribute-share-video",{event:"gaEvent",category:"Obituary",action:"Tribute Wall Click",label:"Post - Share Video",unbindElement:false},function(event,category,action,label,unbindElement){if(gtmstatus==true){pushServicesSharingData(event);gtmstatus=false}});$(document).trigger("add-tribute-share-video")}var dt=form.serialize();if(typeof showShareMemoryModal==="number"&&showShareMemoryModal===1){if(form.find('[name="ocmsg"]').val()===""&&form.find('[name="gsid"]').val()<=0){form.find('[name="ocmsg"]').addClass("has-error");return true}const container=$("#pubdyncnt");dt+=`&re_open=true&bottomTributeWall=1&templateVersion=${$("body").attr("data-template-version")}&testName=${$("body").attr("data-test-name")}`;axpost("/pax/share-a-memory-step-one",dt,function(data){container.html(data).find(".modal").modal("show");shareMemoryEcommerceStep=1});setParam();return true}$("#addtrib").hide();axpost("/pax/twusrinf",dt,function(data){$("#pubdyncnt").html(data)});return false});$("#cncrep").click(function(ev){ev.preventDefault();cancelComment();return false});$("#sn-tributewall").on("click",".btn-comment",function(){commentOnPost($(this))});$("#sn-tributewall").on("click",".btn-viewgallery",function(){showGallery()});$("#sn-tributewall").on("click","div.vwallgu",function(){showAllPostUploads($(this))});$("#twgallery .notice-banner").click(function(){showTributeWall()});if($(location).attr("href").split("/").pop()=="photo-album"){showGallery()}}function showGallery(){$("#twlzone").hide();$("#twgallery").show();if(0==$("#twgallery").attr("data-ld")){var oid=$("#obitsbarV31").attr("data-oid");$("#twgallery").attr("data-ld",1);axpost("/pax/twshgal","oid="+oid,function(data){$("#twgalarea").html(data)})}}function showAllPostUploads(obj){var dt=obj.attr("data-id");var tgt=obj.closest("div.row");axpost("/pax/vwallgu","dt="+dt,function(data){tgt.html(data)})}function showTributeWall(){$("#twlzone").show();$("#twgallery").hide()}function commentOnPost(btn){var zone=btn.closest(".untwpost");var hldr=zone.find(".reparea");$("#fmtribpost").appendTo(hldr);$("#replid").val(btn.attr("data-id"));$("#addtrib").text("Post Comment");$("#cncrep").show();showTribSubFields()}function cancelComment(){if($("#fmtribpost").parent().is(".tphldr"))return;var hldr=$("#twfmarea");$("#fmtribpost").appendTo(hldr);$("#replid").val("");$("#addtrib").text("Save Post");$("#cncrep").hide()}var tribPagePending=false;var nextPostID=0;var buttonPosY=0;function checkPaging(){var win=$(window);var doc=$(document);if(true==tribPagePending||0==nextPostID)return;if(win.scrollTop()+win.height()>buttonPosY){tribPagePending=true;renderNextPostsPage()}}function renderNextPostsPage(){var oid=$("#obitsbarV31").attr("data-oid");var pgba=$("#twlzone").attr("data-pgba");axpost("/pax/twposts","oid="+oid+"&stid="+nextPostID+"&pvgbkey="+pgba,function(html){$("#p"+nextPostID).html(html);tribPagePending=false})}function initTWUserInfo(){if(false==fbLogonWindowListener){fbLogonWindowListener=true;window.addEventListener("message",function(ev){if(-1!=ev.origin.indexOf("facebook.runcfs.com")){var token=ev.data;$("#twusrfb").val(token);submitTWPost()}},false)}$("#addtrib").show();$("#dlgtwusr").modal("show");$("#fmocmsg").submit(function(e){e.preventDefault();return false});$("#twsvpost").click(function(e){e.preventDefault();$("#ocemail").val($("#ocemail").val().trim());$("#twsvpost").hide();var fm=$("#fmocmsg");var validate=$("#caer").val();var proceed=true;if(1==validate){fm.bootstrapValidator({submitHandler:function(validator,form,submitButton){return false},fields:{ocemail:{validators:{regexp:{regexp:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/}}}}});fm.data("bootstrapValidator").resetForm();fm.data("bootstrapValidator").validate();proceed=fm.data("bootstrapValidator").isValid()}if(proceed){submitTWPost()}else $("#twsvpost").show();return false})}function submitTWPost(){var cardMsgWithoutEmoji=$("#tribtext").val().replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,"");$("#tribtext").val(cardMsgWithoutEmoji);var pm=$("#fmocmsg").serialize();var dt=$("#fmtribpost").serialize();axpost("/pax/twdoaddpost",pm+"&"+dt,function(data){dataLayer.push({event:"gaEvent",category:"Obituary",action:"Attach Gift Share A Memory Modal",label:"Post memory without a sympathy gift"+($(document).find("#zipcfsgbcf").lenght>0?" - CAPTCHA Successful":"")});if(-1==data.indexOf("cfsjsrtdt")){$("#ocstatus").html(data);$("#caer").val(0);$("#twsvpost").show();return}var resp=JSON.parse(data);if("OK"==resp.result){twResetForm();var defaultConfMsg="Thank you. Your submission will be published, once reviewed. ";var overrideMsg=$("#sn-tributewall").attr("data-conftxt");var confMsg=overrideMsg===undefined?defaultConfMsg:overrideMsg;$("#dlgtwusr").modal("hide");$("#twstatus").html(''+confMsg+extraPendingReview+"")}else if("Refresh"==resp.result){twResetForm();$("#dlgtwusr").modal("hide");$("#twstatus").html('Thank you. Your submission has been published.');refreshWall()}else{$("#ocstatus").html(data);$("#caer").val(0);$("#twsvpost").show()}})}function twResetForm(){$("#twrmvid").click();$("#emytclose").click();$("#twrmvid").click();$("#twrmgest").click();$("#tribtext").val("");$("#twctext div.tribute-field").text("");$("#twctext div.tribute-field").css("height","25px");$("#tribsubrow").hide();cancelComment()}function doEmbedVideo(videoURL){var videoID=isYouTube(videoURL);if(false===videoID){return}$("#ytlink").val("");$("#ytvid").val(videoID);embedVideo();showTribSubFields();var src="https://www.youtube.com/embed/"+videoID;var code='
';$("#emvidpreview .videopreview").html(code);$("#emvidpreview").show()}function isYouTube(url){var regExp=/^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/;var match=url.match(regExp);if(match&&match[2].length==11)return match[2];else if(match&&'"'==match[2][11])return match[2].substring(0,11);else return false}function showTribSubFields(){if(1==$("#tribtext").attr("rows"))$("#tribtext").attr("rows",4);$("#twctext div.tribute-field").css("height","100px");$("#tribsubrow").show()}function addMedia(obj){$(document).on("add-tribute-share-photos",{event:"gaEvent",category:"Obituary",action:"Tribute Wall Click",label:"Share Photos",unbindElement:false},function(event,category,action,label,unbindElement){pushServicesSharingData(event)});$(document).trigger("add-tribute-share-photos")}function embedVideo(){var obj=$("#wallopts .emvd");if(obj.is(".selected")){obj.removeClass("selected");$("#embedyoutube").hide();return}closeGestures();$("#embedyoutube").show();$("#wallopts li").removeClass("selected");obj.addClass("selected");$(document).on("add-tribute-share-video",{event:"gaEvent",category:"Obituary",action:"Tribute Wall Click",label:"Share Video",unbindElement:false},function(event,category,action,label,unbindElement){pushServicesSharingData(event)});$(document).trigger("add-tribute-share-video")}function showGestures(obj,type){var seltype=$("#gesturelist").attr("data-tp");var gtmstatus=true;$("#embedyoutube").hide();if(type==seltype){$("#gesturelistpt").toggle();obj.toggleClass("selected");$("#wallopts .emvd").removeClass("selected");return}$("#gesturelistpt").show();$("#wallopts li").removeClass("selected");obj.addClass("selected");if(type!=seltype){const eventlabel=type=="candles"?"Share Candle":"Share Sentiment";$("#gesturelist").html("Loading, please wait...");$(document).on("add-tribute-share-sentiment",{event:"gaEvent",category:"Obituary",action:"Tribute Wall Click",label:eventlabel,unbindElement:false},function(event,category,action,label,unbindElement){if(gtmstatus==true){pushServicesSharingData(event);gtmstatus=false}});$(document).trigger("add-tribute-share-sentiment");axpost("/pax/twgest","tp="+type,function(data){$("#gesturelist").html(data);$("#gesturelist").attr("data-tp",type)})}}function initTWGestures(){$("#twgestures .item").click(function(){var id=$(this).attr("data-id");var img=$(this).find("img").clone();img.addClass("img-responsive").css("max-height","120px");var type=$(this).attr("data-type");var label=type=="candles"?"Share Candle":"Share Sentiment";var gestDiv=$("#twcgest .twprev");gestDiv.attr("data-label",label);$("#gsid").val(id);$("#twcgest .twprev").html("");$("#twcgest .twprev").append(img);$("#twcgest").show();$("#twctext").removeClass("col-xs-12").addClass("col-xs-9 col-sm-10");closeGestures();showTribSubFields();$("#twctext .tribute-field").attr("placeholder","Optionally add a message to accompany your gesture or click 'Save Post' to add your name and make your posting")});$("#twgestures").owlCarousel({loop:true,margin:10,responsive:{0:{items:4},600:{items:8},1e3:{items:10}}});$("#twhdgest").click(function(e){e.preventDefault();closeGestures();return false})}function editCardMessageCheckout(){$(".edit-checkout-message").click(function(){$(".share-memory-checkout-mesage").attr("readonly",false);$(".share-memory-checkout-mesage").focus();$(this).remove()})}function closeGestures(){$("#wallopts .gestures").removeClass("selected");$("#gesturelistpt").hide()}function refreshWall(){var oid=$("#obitsbarV31").attr("data-oid");axpost("/pax/twposts","oid="+oid+"&stid=0",function(html){$("#twlzone").html(html)})}function sendFlowers(){}function dataLayerPush(dataLayer,event,category,action,label){dataLayer.push({event:event,category:category,action:action,label:label})}function pushServicesSharingData(e){if(window["google_tag_manager"]){e.preventDefault();var clickedButton=$(this);window.dataLayer=window.dataLayer||[];window.dataLayer.push({event:"gaEvent",category:e.data.category,action:e.data.action,label:e.data.label,eventCallback:function(containerId){if(containerId.startsWith("GTM")){clickedButton.off("click",pushServicesSharingData);if(e.data.unbindElement===true){e.unbind()}if(clickedButton.attr("href")){clickedButton[0].click()}else{clickedButton.trigger("click")}}},eventTimeout:2e3})}}let initShareMemoryEcommerceCalls=1;let shareMemoryEcommerceStep=1;let isEditDesktop=0;function initShareMemoryEcommerce(){if(!initShareMemoryEcommerceCalls)return;initShareMemoryEcommerceCalls--;function initSlider(){if(window.matchMedia("(max-width: 850px)").matches){const swiper=new Swiper(".swiper",{direction:"horizontal",loop:false,slidesPerView:1,spaceBetween:20,centeredSlides:false,pagination:{el:".swiper-pagination",clickable:true},navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},breakpoints:{300:{slidesPerView:1,spaceBetween:10},336:{slidesPerView:1.2,spaceBetween:10},375:{slidesPerView:1.3,spaceBetween:20},490:{slidesPerView:1.8,spaceBetween:20},675:{slidesPerView:2.5,spaceBetween:20}}})}}function validateShareMemoryForm(form){const validationObject={rules:{ocname:"required",ocemail:{required:true,email:true}},messages:{ocname:"Please enter your name",ocemail:"Please enter a valid email address"}};if(form.find('[name="gsid"]').val()<=0){validationObject.rules.ocmsg="required";validationObject.messages.ocmsg="Please enter a message"}$.validator.methods.email=function(value,element){return this.optional(element)||/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(value)};form.validate(validationObject);if(!form.valid()){return false}return true}function addClass(className=""){const modal=$("#pubdyncnt .modal");const modalClasses=["modalpone","modalptwo","modalptwoclose","modalpthree"];for(const modalClass of modalClasses){modal.hasClass(modalClass)&&modal.removeClass(modalClass)}modal.addClass(className)}function addModalContent(container,data){container.find(".share-memory-modal-content").empty().css("opacity",0).html(data).animate({opacity:1},600)}function showStepOne(e){$(".share-memory-modal .modal-dialog").removeClass("one-slider");e.preventDefault();const bottomTributeWallInput=$('[name="bottomTributeWall"]');if(bottomTributeWallInput.length&&bottomTributeWallInput.val()&&shareMemoryEcommerceStep===2){shareMemoryEcommerceStep=isEditDesktop=1;$(".modal").modal("hide");remHash();return}const container=$("#pubdyncnt");var dt=$(this).closest("form").serialize()+`&re_open=true`;axpost("/pax/share-a-memory-step-one-reopen",dt,function(data){addModalContent(container,data);addClass("modalpone");shareMemoryEcommerceStep=1})}function showStepTwo(e){e.preventDefault();const container=$("#pubdyncnt");const form=$(this).closest("form");var dt=form.serialize();if(!validateShareMemoryForm(form)){return false}axpost("/pax/share-a-memory-step-two",dt,function(data){addModalContent(container,data);if(container.find(".share-memory-modal-content").find(".swiper").length){addClass("modalptwo");if($(".swiper-slide").length==1){$(".modalptwo .modal-dialog").addClass("one-slider")}else{$(".share-memory-modal .modal-dialog").removeClass("one-slider")}}else if(container.find(".share-memory-modal-content").find(".products-flex").length){addClass("modalpthree");remHash();stwResetForm()}else if(!$('input[name="useGoogleRecaptcha"]').length){addClass("modalpthreeThanks");remHash();stwResetForm()}else{addClass("modalpone")}initSlider();shareMemoryEcommerceStep=2})}function showStepThree(e,$this){$(".share-memory-modal .modal-dialog").removeClass("one-slider");e.preventDefault();remHash();const container=$("#pubdyncnt");const form=$this.closest("form");isModalSave=1;var dt=form.serialize();if(!validateShareMemoryForm(form)){return false}axpost("/pax/share-a-memory-step-three",dt,function(data){if(data.indexOf("thankyou-popup")>-1&&$(document).find("#zipcfsgbcf").length>0){dataLayer.push({event:"gaEvent",category:"Obituary",action:"Attach Gift Share A Memory Modal",label:"Post memory without a sympathy gift - CAPTCHA Successful"})}addModalContent(container,data);if(container.find(".share-memory-modal-content").find(".products-flex").length&&!$('input[name="useGoogleRecaptcha"]').length){addClass("modalpthree")}else if(!$('input[name="useGoogleRecaptcha"]').length){addClass("modalpthreeThanks")}else{addClass("modalptwo");validateShareMemoryForm(form)}stwResetForm()})}function showStepClose(e){e.preventDefault();const container=$("#pubdyncnt");if(isEditDesktop){isEditDesktop=0;$("html, body").animate({scrollTop:$("#tribtext").offset().top-100},700);$(".modal").remove();$("#tribtext").focus();return}var dt=$(this).find("form").serialize();container.find(".modal").modal("hide");axpost("/pax/share-a-memory-step-two-close",dt,function(data){container.find(".share-memory-modal-content").empty().html(data);container.find(".modal").modal("show");addClass("modalptwoclose");$("#share-memory-step-2-reopen").click(shareMemoryEcommerceStep===1?showStepOne:showStepTwo)})}function stwResetForm(){$("#twrmvid").click();$("#emytclose").click();$("#twrmvid").click();$("#twrmgest").click();$("#tribtext").val("");$("#twctext div.tribute-field").text("");$("#twctext div.tribute-field").css("height","25px");$("#tribsubrow").hide();cancelComment()}function storeCondolence(e,$this){e.preventDefault();const closestForm=$this.closest("form");const form=$("#fmocmsg");const dt=form.serialize();form.validate({rules:{"[required]":"required"}});if(!form.valid()){return false}if(form.find(".has-error").length)return false;axpost("/pax/share-a-memory-store-condolence",dt,function(data){data=JSON.parse(data);if(data.status==="error"){$("#share-memory-step-2").data("click",0);$("#share-memory-step-2").trigger("click");return false}else{closestForm.append(``);if($(document).find("#zipcfsgbcf").length>0){dataLayer.push({event:"gaEvent",category:"Obituary",action:"Attach Gift Share A Memory Modal",label:closestForm.find("button").data("name")+" - CAPTCHA Successful"})}const btn=closestForm.find("button");const product={};const prefix="data-enhanced-ecommerce";const mappedEnhancedEcommerceData=getMappedEnhancedEcommerceData();const parentElement=btn.closest(`[${prefix}]`);for(const mappedEnhancedEcommerceRow of mappedEnhancedEcommerceData){pushEnhancedEcommerceValue(mappedEnhancedEcommerceRow,parentElement,prefix,product)}const dataLayer2={event:"addToCart",ecommerce:{currencyCode:"USD",add:{products:[product]}}};registerDataLayerPushEvent(btn,dataLayer2,"data-enhanced-ecommerce-view");closestForm.submit();return true}});return true}$(document).on("click",".buy-share-memory-products",function(e){e.preventDefault();let $this=$(this);if(useGoogleReCaptcha==="1"){grecaptcha.enterprise.ready(function(){grecaptcha.enterprise.execute(siteKey,{action:"submit"}).then(function(token){$(".thc-g-recaptcha-response").val(token);storeCondolence(e,$this)})})}else{storeCondolence(e,$this)}});$(document).on("hidden.bs.modal",".modalpone, .modalptwo",showStepClose);$(document).on("click","#share-memory-step-1",showStepTwo);$(document).on("click","#share-memory-step-edit-step-1",showStepOne);$(document).on("click","#share-memory-step-div-edit-step-1",showStepOne);$(document).on("click","#share-memory-step-2",function(e){e.preventDefault();let $this=$(this);if(useGoogleReCaptcha==="1"){grecaptcha.enterprise.ready(function(){grecaptcha.enterprise.execute(siteKey,{action:"submit"}).then(function(token){$(".thc-g-recaptcha-response").val(token);showStepThree(e,$this)})})}else{showStepThree(e,$this)}});$(document).on("click",".edit-desktop span, .edit-mobile span, .share-textarea-text-block",function(){isEditDesktop=1;$(".modal").modal("hide");remHash()});if(window.location.hash==="#share-a-memory"){if(typeof showShareMemoryModal==="number"&&showShareMemoryModal===1){const container=$("#pubdyncnt");const dt={oid:$("body").find("button.share-a-memory").attr("obit-idx"),templateVersion:$("body").attr("data-template-version"),testName:$("body").attr("data-test-name")};$(".share-memory-modal .modal-dialog").removeClass("one-slider");axpost("/pax/share-a-memory-hash-reopen",dt,function(data){container.html(data).find(".modal").modal("show");shareMemoryEcommerceStep=1;if(container.find(".share-memory-modal-content").find(".swiper").length){addClass("modalptwo");if($(".swiper-slide").length==1){$(".modalptwo .modal-dialog").addClass("one-slider")}else{$(".share-memory-modal .modal-dialog").removeClass("one-slider")}shareMemoryEcommerceStep=2}else{addClass("modalpone")}})}}}$(document).on("click",".modalptwoclose button#close-btn-data",function(e){e.preventDefault();remHash()});$(document).on("click",".modalptwoclose button.exit-link",function(e){e.preventDefault();remHash()});$(document).on("click",".modalpthree button#close-btn-data",function(e){e.preventDefault();remHash()});$(document).on("click",".modalpone .edit-msg-down-modal",function(e){e.preventDefault();remHash()});$(document).on("click",".share-memory-modal",function(e){if(e.target.className.includes("modalptwoclose")){remHash()}});function remHash(){var uri=window.location.toString();if(uri.indexOf("#")>0){var clean_uri=uri.substring(0,uri.indexOf("#"));window.history.replaceState({},document.title,clean_uri)}}$(document).ready(function(){initShareMemoryEcommerce();readMoreObitText()});function readMoreObitText(){var el=$(".obit-text-container");var readMoreBtnContainer=$(".read-more-container");var readMoreBtn=$(".read-more-container .btn-readmore");var divHeight=el.height();if($(window).width()<=767){var lineHeight=parseInt(el.css("line-height"));var lines=divHeight/lineHeight;if(Math.floor(lines)>6){var maxHeight=lineHeight*6;el.height(lineHeight*6+"px");el.css("overflow","hidden");el.addClass("fade-bg");readMoreBtnContainer.show();readMoreBtn.show();readMoreBtn.click(function(){removeObitReadMore(el,readMoreBtnContainer,true)})}}else{removeObitReadMore(el,readMoreBtnContainer,false)}}function removeObitReadMore(el,readMoreBtnContainer,animate){if(animate){el.css({overflow:"visible"}).animate({height:el.prop("scrollHeight")})}else{el.css({overflow:"visible",height:"100%"})}readMoreBtnContainer.hide();el.removeClass("fade-bg")}$(document).on("click","#socialProofContainerMobile",function(){$([document.documentElement,document.body]).animate({scrollTop:$("#tributewall").offset().top},1e3)});var isMobile=false;function updateElements(){if($(".hidePriceSizes").length){if(isMobile&&window.innerWidth>992){isMobile=false;$("#prodpg31 label strong span").each(function(){var currentNumber=parseInt($(this).text());$(this).text(currentNumber+1)})}else if(!isMobile&&window.innerWidth<=992){isMobile=true;$("#prodpg31 label strong span").each(function(){var currentNumber=parseInt($(this).text());$(this).text(currentNumber-1)})}}}updateElements();window.onresize=updateElements;$(document).on("click",".sticky-mobile .btn",function(){dataLayer.push({event:"ga4Event",category:"Store",action:"PDP - Sticky PDP Checkout Mobile",label:"Proceed to Checkout"})});$(document).ready(function(){let selectedValue="";$(document).on("click",".at630-selector-controls input",function(){selectedValue=$(this)[0].value;$(".at630-selector-container .at630-results").addClass("at630-show");$(".at630-selector-controls-selected").removeClass("at630-selector-controls-selected");$(`.at630-selector-container input[value="${selectedValue}"] + label`).addClass("at630-selector-controls-selected");dataLayer.push({event:"ga4Event",category:"Obituary",action:"Obit - Relationship with Decedent Click",label:selectedValue})});var timeoutId;$(document).on("change",".at630-selector-controls input",function(){clearTimeout(timeoutId);timeoutId=setTimeout(function(){if(selectedValue!==""){dataLayer.push({event:"ga4Event",category:"Obituary",action:"Obit - Relationship with Decedent Last Selection Click",label:selectedValue})}},1e4)});$(document).on("click","#emailObit",function(){const decName=encodeURIComponent($("#obcoreV3 > div.obittitleV31 > h1").text());const obitUrl=encodeURIComponent(window.location.href+"?utm_source=obit-share&utm_medium=referral&utm_campaign=relationship-bar&utm_content=email");const mailTo=`mailto:?subject=Obituary%20Listing&body=Obituary%20posted%20for%20${decName}.%20%20See%20${obitUrl}`;dataLayer.push({event:"ga4Event",category:"Obituary",action:"Obit - Relationship with Decedent Click",label:"Email Share - "+selectedValue});window.location.href=mailTo});$(document).on("click","#copyUrl",function(){var copyText=window.location.href+"?utm_source=obit-share&utm_medium=referral&utm_campaign=relationship-bar&utm_content=copy-link";if(navigator.clipboard){navigator.clipboard.writeText(copyText).then(function(){$(".at630-result-tools > div:nth-child(3) .at630-result-tools-label").text("Copied!").css("color","#008927");dataLayer.push({event:"ga4Event",category:"Obituary",action:"Obit - Relationship with Decedent Click",label:"Copy Share - "+selectedValue})}).catch(function(error){console.error("Failed to copy:",error)})}else{var textArea=document.createElement("textarea");textArea.value=copyText;document.body.appendChild(textArea);textArea.select();document.execCommand("copy");document.body.removeChild(textArea);$(".at630-result-tools > div:nth-child(3) .at630-result-tools-label").text("Copied!").css("color","#008927");dataLayer.push({event:"ga4Event",category:"Obituary",action:"Obit - Relationship with Decedent Click",label:"Copy Share - "+selectedValue})}});$(document).on("click","#printObit a.btn-print",function(){dataLayer.push({event:"ga4Event",category:"Obituary",action:"Obit - Relationship with Decedent Click",label:"Print Share - "+selectedValue});if($("#dlgprint").length>0)$("#dlgprint").remove();var ok=$(this).attr("data-ok");var bg=$(this).attr("data-bg");var fcf=$(this).attr("data-fcf");axpost("/pax/prnobit","ok="+ok+"&fcf="+fcf+"&bg="+bg,function(data){$("#pubdyncnt").html(data)})})});$(document).ready(function(){let actionTriggered=false;let targetDiv;if(window.matchMedia("(max-width: 767px)").matches){targetDiv=$(".mobile-relation-container")}else{targetDiv=$(".at630-selector-container")}function isElementInViewport(el){const rect=el[0].getBoundingClientRect();return rect.top>=0&&rect.left>=0&&rect.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&rect.right<=(window.innerWidth||document.documentElement.clientWidth)}function handleScroll(){if(!actionTriggered&&isElementInViewport(targetDiv)){console.log("Target div is visible in the viewport on mobile.");actionTriggered=true}}function throttledScrollHandler(){let ticking=false;return function(){if(!ticking){window.requestAnimationFrame(()=>{handleScroll();ticking=false});ticking=true}}}$(window).on("scroll",throttledScrollHandler())});