if(typeof f=="undefined"||!salem)var salem={};salem.registerNamespace=function(){for(var u=arguments,n=null,t,i,r=0;r<u.length;r++)for(i=u[r].split("."),n=salem,t=i[0]=="salem"?1:0;t<i.length;t++)n[i[t]]=n[i[t]]||{},n=n[i[t]];return n};salem.registerNamespace("getRelativeBaseUrl");salem.getRelativeBaseUrl=function(){return location.href.toLowerCase().indexOf("crossbridge")>=0?"/crossbridge/":"/"};salem.registerNamespace("social");salem.social={shareEmail:function(n,t){var i="Check out this article at "+n+"!",r="I thought you might be interested in seeing this "+t,u="mailto:?subject="+i+"&body="+r;win=window.open(u,"emailWindow");win&&win.open&&!win.closed&&win.close()}};salem.registerNamespace("browserCompatability");salem.browserCompatability={testAttribute:function(n,t){var i=document.createElement(n);return t in i}};salem.registerNamespace("form");salem.form={smartTextBox:function(n,t){$.each(n,function(n,i){var r=$(i),u=r.attr("placeholder")||r.val();r.val(u);r.addClass(t).focus(function(){$(this).val("").removeClass(t)}).blur(function(){($(this).val()==u||$(this).val()=="")&&$(this).val(u).addClass(t)})})}};salem.registerNamespace("siteActions");salem.siteActions={html5ize:function(){salem.browserCompatability.testAttribute("input","placeholder")||salem.form.smartTextBox($("input[placeholder]"),"placeholder")},wireUniform:function(){if($(".uniform").length){if(navigator.userAgent.toLowerCase().indexOf("msie 7")>=0)return;$(".uniform").uniform()}},wireShowOnElementVisibles:function(){var n=$("[data-show-when-in-viewport]");n.length&&n.each(function(n,t){t=$(t);t.before("<span><\/span>");var i=t.prev(),r=t.css("right"),u=r.replace("px","");$(window).scroll(function(){var n=$(window).scrollTop(),e=n+$(window).height(),f=i.offset().top,o=f+i.height(),s=n<f&&e>o;s?t.css("right")===r&&t.animate({right:"0"}):t.css("right")==="0px"&&t.animate({right:u})})})},wireSearchForms:function(){$(".searchForm").each(function(){var n=$(this),t=n.find("input[name='q']");n.submit(function(){return $.trim(t.val())?!0:(t.addClass("invalidInput"),!1)})})},validateForms:function(){$("form.validate").length&&$("form.validate").each(function(){$(this).validate()})},copyToClipboard:function(n){$(".buttonCopy").html("Copy");var t=$("<input>");$("body").append(t);t.val($("#textUrl-"+n).val()).select();document.execCommand("copy");t.remove();$("#textUrl-"+n).select();$("#buttonCopy-"+n).html("Copied")},validateDoubleTrailingSlashUrl:function(){var n=String(window.location.href);String.prototype.endsWith=function(n){return this.indexOf(n,this.length-n.length)!==-1};n.endsWith("//")&&(n=n.substring(0,n.length-1),window.location.href=n)},checkFacebookiFrameEmbedHeight:function(){var n=!1;n=window.matchMedia("only screen and (max-width:767px)");n.matches&&(height=$(".iframe-facebook").prop("scrollHeight"),$(".iframe-facebook").css("overflow","hidden"),height=height<270?360:height<365?330:height<728?520:height<810?855:690,$(".iframe-facebook iframe").height(height))}};$(document).ready(function(){salem.siteActions.html5ize();salem.siteActions.wireSearchForms();salem.siteActions.wireUniform();salem.siteActions.validateForms();salem.siteActions.wireShowOnElementVisibles();salem.siteActions.checkFacebookiFrameEmbedHeight()});salem.registerNamespace("pelcro");salem.pelcro={userData:{},Init:function(){document.addEventListener("PelcroUserLoggedIn",()=>{window.location.href.includes("login")&&window.location.href.includes("register")&&setTimeout(()=>{window.location.reload()},2e3)});document.addEventListener("PelcroUserLoggedOut",()=>{window.location.reload()});document.addEventListener("PelcroUserRegister",()=>{window.location.href.includes("register")&&setTimeout(()=>{window.location.reload()},2e3)});$(".btn-logout").click(function(n){n.preventDefault();window.Pelcro.user.logout(()=>{document.cookie="hasAllAccess=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT; domain="+window.location.hostname,document.cookie="swntac=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT; domain="+window.location.hostname,document.cookie="swnimitate=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT; domain="+window.location.hostname,window.location.reload(),console.log("PELCRO: Logged user out")})})},UserHasAccess:function(n){window.Pelcro.user.isEntitledTo(n)}};$(document).ready(function(){salem.pelcro.Init();salem.pelcro.UserHasAccess()});salem.registerNamespace("crosswalk");salem.crosswalk={isMobile:!1,controls:{prevLink:function(){return $(".spPrevLink")},nextLink:function(){return $(".spNextLink")},slideLink:function(){return $(".slideLink")}},init:function(){salem.crosswalk.isMobile=window.matchMedia&&window.matchMedia("(max-width: 767px)").matches;salem.crosswalk.initSocial();salem.crosswalk.initNav();salem.crosswalk.setPageSummary();salem.crosswalk.menuAction();salem.crosswalk.initTopArticleBar()},menuAction:function(){var n=!1;$("#headerShowMenu").click(function(t){t.preventDefault();n?($(".articleMenu").addClass("hide"),$(".articleInfo").removeClass("hide"),$(".articleBars").show(),$(".articleTimes").hide(),$("#BackToTop").removeClass("hide"),n=!1):($(".articleMenu").removeClass("hide"),$(".articleInfo").addClass("hide"),$(".articleBars").hide(),$(".articleTimes").show(),n=!0)})},initSocial:function(){$(".searchLink").click(function(){$(".popover").toggle();$("a.search").toggleClass("hovered");$(".searchPopoverForm input#q").val("");$(".searchPopoverForm input#q").focus()})},initTopArticleBar:function(){var t=$("h1.normal-case"),n=$(".top-bar-container"),i;t.length!==0&&n.length!==0&&(i=function(n){var r=$(window),i={top:r.scrollTop(),left:r.scrollLeft()},t;return i.right=i.left+r.width(),i.bottom=i.top+r.height(),t=n.offset(),t.right=t.left+n.outerWidth(),t.bottom=t.top+n.outerHeight(),!(i.right<t.left||i.left>t.right||i.bottom<t.top||i.top>t.bottom)},$(window).scroll(function(){i(t)?n.hide():n.show()}),$(".top-bar-container #BackToTop a").click(function(){$("html, body").animate({scrollTop:0},"slow")}))},initNav:function(){var n=function(){$("ul li.dropdown").on("touchstart",function(n){"use strict";var t=$(this);return t.hasClass("hover")?!0:(t.addClass("hover"),$("#browseTopics").parent().addClass("hidden-xs"),$("#plusOption").parent().addClass("hidden-xs"),$("ul > li").not(this).removeClass("hover"),$("ul li.dropdown").not(this).hide(),n.preventDefault(),!1)});$(document).on("click","#mainMenu",function(n){n.preventDefault();$("#browseTopics").parent().removeClass("hidden-xs");$("#plusOption").parent().removeClass("hidden-xs");$("ul.navbar-nav > li").removeClass("hover");$("ul.navbar-nav > li.dropdown").show()})};$("span.navRelLink").each(function(){var n=$(this).html(),t=$(this).attr("rel"),i=$(this).hasClass("more")?"more":"";$(this).replaceWith('<a class="'+i+'" href="'+t+'">'+n+"<\/a>")});salem.crosswalk.isMobile&&n()},initSlideLinks:function(n){$(".jcarousel").on("jcarousel:create jcarousel:reload",function(){var n=$(this);width=$("#slideHome").width();width2=$(".jcarousel").width();width2>0&&width2<width&&(width=width2);width==0&&(width=$("#slideRefreshContainer").width());n.jcarousel("items").css("width",width+20+"px")}).jcarousel({animation:"fast",vertical:!1});salem.crosswalk.controls.slideLink().click(function(t){if(t.preventDefault(),$("#slideHome").addClass("visible-xs"),$(".controlsHome").addClass("hidden").removeClass("hidden-xs"),$("#slideRefreshContainer").removeClass("visible-xs"),gtag("event","page_view"),$("html, body").animate({scrollTop:$("#slideshowTopAd").offset().top},"fast"),n!=="true"){$("#RevContentScript").addClass("visible-xs");$("#slideInnerAd-0 #desktop_right_300x250-1").children().remove();$("#slideInnerAd-0 #tablet_middle_300x250-1").children().remove();var i=$("#slideInnerAd-0").html();$("#slideInnerAd-0").html("");$("#slideInnerAd-1").html(i);$.when(salem.crosswalk.refreshAds()).done(function(){setTimeout(function(){$(".jcarousel").css("height",$("#li-1").height())},2e3)})}else setTimeout(function(){$(".jcarousel").css("height",$("#li-1").height())},2e3)});$(".jcarousel-prev").click(function(){var t=parseInt($(".currentPage").html()),i;t>1&&(gtag("event","page_view"),$(".jcarousel").jcarousel("scroll","-=1"),$(".currentPage").html(t-1),$("#Progress").css("display","block"),$("html, body").animate({scrollTop:$("#slideshowTopAd").offset().top},"fast"),n!=="true"?(salem.crosswalk.reloadiFrames("carrouselText-"+t),$("#slideInnerAd-"+t+" #desktop_right_300x250-1").children().remove(),$("#slideInnerAd-"+t+" #tablet_middle_300x250-1").children().remove(),i=$("#slideInnerAd-"+t).html(),$("#slideInnerAd-"+t).html(""),$("#slideInnerAd-"+(t-1)).html(i),$.when(salem.crosswalk.refreshAds()).done(function(){setTimeout(function(){$(".jcarousel").css("height",$("#li-"+(t-1)).height())},2e3)})):setTimeout(function(){$(".jcarousel").css("height",$("#li-"+(t-1)).height())},2e3))});$(".jcarousel-next").click(function(){var t=parseInt($(".currentPage").html()),i=parseInt($(".totalPages").html()),r;t<i&&(gtag("event","page_view"),$(".jcarousel").jcarousel("scroll","+=1"),$(".currentPage").html(t+1),t+1==i&&$("#Progress").css("display","none"),$("html, body").animate({scrollTop:$("#slideshowTopAd").offset().top},"fast"),n!=="true"?(salem.crosswalk.reloadiFrames("carrouselText-"+t),$("#slideInnerAd-"+t+" #desktop_right_300x250-1").children().remove(),$("#slideInnerAd-"+t+" #tablet_middle_300x250-1").children().remove(),r=$("#slideInnerAd-"+t).html(),$("#slideInnerAd-"+t).html(""),$("#slideInnerAd-"+(t+1)).html(r),$.when(salem.crosswalk.refreshAds()).done(function(){setTimeout(function(){$(".jcarousel").css("height",$("#li-"+(t+1)).height())},2e3)})):setTimeout(function(){$(".jcarousel").css("height",$("#li-"+(t+1)).height())},2e3))})},refreshAds:function(){SalemAds.cmd.push(function(){SalemAds.Public.Rescan()})},reloadiFrames:function(n){var u=document.getElementById(n),i=u.getElementsByTagName("iframe"),t,r;if(i!=null)for(t=0;t<i.length;t++)r=i[t].getAttribute("data-src"),r!=null&&(i[t].src=i[t].getAttribute("data-src"))},setPageSummary:function(){var n,r;try{var i=$("div.contentWrapper").find("div.rightContent"),t=$("#MasterPageSummary"),u=$("#MasterPageHeader");i.length>0&&t.length>0&&showAbout&&(n=$('<div id="aboutCW" class="aboutSection"/>'),r=$("<h2/>").html("About Crosswalk.com"),n.append(r),n.append(u.html()),n.append(t.html()),i.append(n));t.remove()}catch(f){}}};$(document).ready(function(){salem.crosswalk.init()})