function SaveCustomContent(n,t){var i=$(n).attr("id"),r=tinymce.get(i),u=r.getContent(),f={Content:u,LanguageCode:t,SectionId:$(n).data("id")};$.ajax({url:"/api/CustomContent?action=Update",type:"POST",processData:!1,dataType:"json",contentType:"application/json; charset=utf-8",data:JSON.stringify(f)})}function LoadTinyMCEScripts(){return new Promise((n,t)=>{$("#section-tinymcescripts").children().length==0?$.get("/layout/LoadTinyMCEScripts").done(function(t){$("#section-tinymcescripts").html(t);n()}).fail(function(){t()}):n()})}function ToggleCustomContentEditing(n,t){LoadTinyMCEScripts().then(()=>{let i=$(".editableCustomContent");$.each(i,function(){var i=$(this).attr("id");n?($(this).css("min-height","20px"),tinymce.init({selector:"div#"+i,menubar:!0,plugins:"advlist autolink lists link image charmap preview anchor searchreplace visualblocks code fullscreen insertdatetime media table code help wordcount",inline:!0,promotion:!1,verify_html:!1})):($(this).css("min-height","0px"),SaveCustomContent(this,t),tinymce.remove("div#"+i));HighlightEditableAreas(n,"div#"+i)});ToggleCustomContentNavLinks(n)})}function HighlightEditableAreas(n,t){n===!0?$(t).addClass("editableContentContainer"):$(t).removeClass("editableContentContainer")}function ShowJavascriptError(n,t,i){t?$("#JavascriptErrorDescription").html(t):n==="1"?$("#JavascriptErrorDescription").html(jsErrorMessages_Refresh):$("#JavascriptErrorDescription").html(jsErrorMessages_JSError);i?$("#JavascriptErrorTitle").html(i):$("#JavascriptErrorTitle").html(jsErrorMessages_Error);$("#mJavascriptError").modal("show")}function ShowToastMessage(n,t){$("#toastNote").html(t);switch(n){case 0:$("#toastNote").addClass("toastError");break;case 1:$("#toastNote").addClass("toastInformational");break;case 2:$("#toastNote").addClass("toastSuccess");break;default:$("#toastNote").addClass("toastInformational")}$("#toastNote").addClass("show");setTimeout(function(){$("#toastNote").removeClass("toastError");$("#toastNote").removeClass("toastInformational");$("#toastNote").removeClass("toastSuccess");$("#toastNote").removeClass("show")},3e3)}function SwitchTheme(){var n=$("#ddThemes").val(),t={theme:n};$.ajax({url:"/Theme/SwitchTheme",type:"POST",processData:!1,contentType:"application/json; charset=utf-8",data:JSON.stringify(n),success:function(){location.reload()},error:function(){}})}function SearchKey(){SubmitSearchForm()}function SearchKeyXS(){SubmitSearchFormXS()}function SubmitSearchForm(){$("#term").val()!==""&&$("#SearchForm").submit()}function SubmitSearchFormXS(){$("#txtSearchCl").val()!==""&&$("#SearchFormXS").submit()}function ReloadNotifications(){var n=$("#delayedNotifications").data("url");n!==undefined&&n!==null&&$.get(n,function(n){document.getElementById("delayedNotifications").innerHTML=n}).done(function(){$("#btnShowAllNotifications").click(function(){ShowAllNotifications()});$(".segNotification, .userActionsDropdown .dropdown").on("shown.bs.dropdown",function(){this.getElementsByClassName("dropdown-item").item(0).focus()})});$(".delayedLoad").each(function(n,t){var i=$(t).data("url");i!==null&&$(t).load(i,function(){$(t).toggleClass("delayedLoad")})})}function ShowAllNotifications(){$("#panelNotifications").insertBefore($("#mainContent").parent());$("#panelNotifications").modal("show");$(".modal-backdrop").hide()}function loadSpinner(n=""){n!==""&&$("#loadingspinner").text(n);$("#loading").fadeIn();let t=document.getElementById("loading"),i=new Spinner({lines:12,length:7,width:4,radius:10,color:"#fff",speed:1,trail:60,shadow:!1,hwaccel:!1}).spin(t)}function ShowNewAccountToast(){let n=getIsNewAccountSessionStorage();n==="True"&&$("#logoutForm").length>0?($("#accountCreationToastId").toast("show"),$("#profileUserThumbId").addClass("userProfileImgBlink")):removeIsNewAccountSessionStorage()}function ShowRecoveredOrderToast(){let n=getIsOrderRecoveredSessionStorage();n==="True"&&$("#recoveredOrderToastId").toast("show")}function redirectToProfile(){$("#profileUserThumbId").removeClass("userProfileImgBlink");removeIsNewAccountSessionStorage();window.location="/profile"}function dismissRecoveredOrder(){removeIsOrderRecoveredSessionStorage()}$(document).ready(function(){$("#ddThemes").change(function(){SwitchTheme()})});$("#cookieArea").ihavecookies({title:"Cookies & Privacy",message:"This website uses cookies to ensure you get the best experience on our website.",link:"/Home/Privacy",delay:0,expires:360,cookieTypes:[],acceptBtnLabel:"Acknowledge Cookies"});$(document).ready(function(){var t=300,i=1200,r=700,n=$(".cd-top");$(window).scroll(function(){$(this).scrollTop()>t?n.addClass("cd-is-visible"):n.removeClass("cd-is-visible cd-fade-out");$(this).scrollTop()>i&&n.addClass("cd-fade-out")});n.on("click",function(n){n.preventDefault();$("body,html").animate({scrollTop:0},r,function(){window.location="#"})})});$('[data-toggle="offcanvas"]').click(function(){$(".row-offcanvas").toggleClass("active");$("#sidebar").hasClass("active")?($(".nav-stacked").find("a:first").focus(),$(".sidebarLink").attr("tabindex",0)):$(".sidebarLink").attr("tabindex",-1)});$("#txtSearchCl").blur(function(){$("#SearchCl").collapse("hide")});$("#SearchCl").on("shown.bs.collapse",function(){$("#txtSearchCl").focus()});$("#SearchCl").submit(function(){SubmitSearchForm()});$(document).ready(function(){ReloadNotifications();ShowNewAccountToast();ShowRecoveredOrderToast()});$("#accountCreationToastId").on("hidden.bs.toast",function(){$("#profileUserThumbId").removeClass("userProfileImgBlink");removeIsNewAccountSessionStorage()})