require(["esri/widgets/Compass","esri/Map","esri/views/MapView","esri/symbols/SimpleMarkerSymbol","esri/symbols/SimpleLineSymbol","esri/symbols/SimpleFillSymbol","esri/layers/GraphicsLayer","esri/Graphic","dojo/_base/Color","esri/layers/TileLayer","esri/layers/MapImageLayer","esri/geometry/Extent","esri/geometry/SpatialReference","esri/widgets/Search","esri/layers/FeatureLayer","esri/layers/VectorTileLayer","esri/layers/BingMapsLayer","esri/tasks/Locator","esri/tasks/IdentifyTask","esri/tasks/support/IdentifyParameters","esri/tasks/support/IdentifyResult","esri/tasks/support/Query","esri/tasks/QueryTask","dojo/on","dojo/dom-attr","dojo/domReady!"],function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k,d,g,nt,tt,it){function ut(){function i(){var n='<div id="map_basemapHolder" role="region" aria-label="Basemap controller" tabindex="0"><button id="map_basemapHeaderHolder" title="choose basemap" type="button" tabindex="-1"><div id="map_basemapIcon" style="background-image: url('+APP.gisResourceUrl+'/MapResources/Images/Basemap/sw_bm_topo.png)"  alt="" role="presentation"><\/div><div id="map_basemapHeader">Topo<\/div><div id="map_basemapToggle" role="presentation"><\/div><\/Button><div id="map_basemapDiv"><button class="basemapButton" id="mapLayers_topoButton" data-basemap-id="esriTopo" data-swatch-url="bm_topo.png" type="button" tabindex="0"><div id="mapLayers_topoButtonImage" class="basemapButtonImage activeBasemap"  alt="" role="presentation"><\/div><div class="basemapButtonText  basemapButtonSelectedText" aria-labelfor="mapLayers_topoButtonImage">Topo<\/div><\/button><button class="basemapButton" id="mapLayers_imageryButton" data-basemap-id="bmHybrid" data-swatch-url="bm_imagery.png" type="button" tabindex="0"><div id="mapLayers_imageryButtonImage" class="basemapButtonImage"  alt="" role="presentation"><\/div><div class="basemapButtonText" aria-labelfor="mapLayers_imageryButtonImage">Imagery<\/div><\/button><\/div><\/div>';$(".esri-view-root").append(n),$("#map_basemapHeaderHolder").click(function(){$("#map_basemapHolder").focus()}),$("#map_basemapHolder").click(function(){$("#map_basemapToggle").hasClass("map_basemapToggleOpen")?($("#map_basemapHolder").css("z-index",1),$("#map_basemapHeaderHolder").css("background-color","white")):($("#map_basemapHolder").css("z-index",2),$("#map_basemapHeaderHolder").css("background-color","#eaeaea")),$("#map_basemapToggle").toggleClass("map_basemapToggle map_basemapToggleOpen"),$("#map_basemapDiv").css("max-height",$("#mapViewDiv").height()-40).slideToggle(300)});$(document).on("click",".basemapButton",function(){var r,u,n,t,f,i;for($("#map_basemapHeaderHolder").css("background-color","white"),$("#map_basemapHeader").text($(this).find(".basemapButtonText").text()),r="url("+APP.gisResourceUrl+"/MapResources/Images/Basemap/sw_"+$(this).attr("data-swatch-url")+")",$("#map_basemapIcon").css("background-image",r),u=$(this).attr("data-basemap-id"),$(".basemapButtonImage").removeClass("activeBasemap"),$(this).children(".basemapButtonImage").addClass("activeBasemap"),$(".basemapButtonText").removeClass("basemapButtonSelectedText"),$(this).children(".basemapButtonText").addClass("basemapButtonSelectedText"),$("#map_basemapToggle").removeClass("map_basemapToggleOpen"),$("#map_basemapDiv").slideUp(300),$("#map_basemapHolder").focus(),n=null,t=0;t<APP.basemaps.length;t++)n=APP.map.findLayerById(APP.basemaps[t]),APP.basemaps[t]!=u?n!=null&&(n.visible=!1):(n.visible=!0,APP.activeBasemap=n.id);f=$(this).attr("data-basemap-id"),i=19,APP.map.zoom>i&&(APP.map.zoom=i)})}function r(){var n="<buton id='zoomFullButton' class='esri-component' title='Zoom Full State' tabindex='0'><img id='zoomFullButtonImage'  src='https://fortress.wa.gov/ecy/gisresources/mapresources/images/icons/wa_state2.gif' alt='' role='presentation' height='17' width='25'><\/img><\/button>";$(".esri-view-root").append(n);$(document).on("click","#zoomFullButton",function(){APP.mapView.goTo(APP.startExtentAndSR)})}$(document).on("keydown",".mapPopup",function(n){var t=[];t.push($(this).attr("id")),$.each($(this).find(":focusable"),function(n,i){t.push(i.attributes.id.value)});switch(n.which){case 9:n.shiftKey?$(":focus")[0].id===t[0]&&($("#"+t[t.length-1]).focus(),n.preventDefault()):$(":focus")[0].id===t[t.length-1]&&($("#"+t[0]).focus(),n.preventDefault());break;case 27:$(this).fadeOut(350),$("#"+$(this).attr("data-invoked-by")).focus(),n.preventDefault();break;case 37:$(this).hasClass("draggable")&&($(this).css("left",$(this).offset().left-10),$(this).position().left<$("#mapView").position().left&&$(this).css("left",$("#mapView").position().left+2)),n.preventDefault();break;case 38:$(this).hasClass("draggable")&&($(this).css("top",$(this).offset().top-10),$(this).position().top<$("#mapView").position().top&&$(this).css("top",$("#mapView").position().top)),n.preventDefault();break;case 39:$(this).hasClass("draggable")&&($(this).css("left",$(this).offset().left+10),$(this).position().left+$(this).width()>$("#mapView").position().left+$("#mapView").width()&&$(this).css("left",$("#mapView").position().left+$("#mapView").width()-$(this).width()+2)),n.preventDefault();break;case 40:$(this).hasClass("draggable")&&($(this).css("top",$(this).offset().top+10),$(this).position().top+$(this).height()>$("#mapView").position().top+$("#mapView").height()&&$(this).css("top",$("#mapView").position().top+$("#mapView").height()-$(this).height()+2)),n.preventDefault()}});$(document).on("keydown",function(n){var t=n.which;t==9&&(APP.keyboardNavigation=!0)});$(document).on("keydown","#mapViewDiv",function(n){var t=n.which;if(t==13)return APP.keyboardNavigation&&APP.customFunctions.doIdentify(APP.mapView.center),!1});$(document).on("keydown","#photoNavButtonRight1970",function(n){var t=n.which;if(t==9)return $("#buttonClosePhotoCompare").click(),!1});$(document).on("keydown","#buttonClosePhotoCompare",function(n){var t=n.which;return t==9?n.shiftKey?($("#buttonClosePhotoCompare").click(),!1):!0:t==13?($("#buttonClosePhotoCompare").click(),!1):void 0});$(document).on("focusin",function(n){n.target.tagName=="CANVAS"||n.target.tagName=="svg"?($("#mapViewDiv").addClass("activeMap"),APP.keyboardNavigation&&$("#identify-crosshair").show().position({my:"center center",at:"center center",of:$("#mapViewDiv")})):($("#mapViewDiv").removeClass("activeMap"),APP.keyboardNavigation&&$("#identify-crosshair").hide())});$(document).on("keydown","#linkMapFocus",function(n){var t=n.which;if(t==13||t==32)return $(this).click(),!1});$(document).on("keydown","#linkPhotoViewerFocus",function(n){var t=n.which;if(t==13||t==32)return $(this).click(),!1});$(document).on("keydown","#map_basemapHolder",function(n){var t=n.which;if(t==13||t==32)return $(this).click(),!1});$(document).on("keydown",".basemapButton",function(n){var t=n.which;if(t==13||t==32)return $(this).click(),!1});$(document).on("keydown",".displayModeRadioButton",function(n){var t=n.which;if(t==13||t==32)return $(this).click(),!1});$(document).on("keydown","#zoomFullButton",function(n){var t=n.which;if(t==13||t==32)return $(this).click(),!1});$(document).on("keydown",".chevron",function(n){var t=n.which;if(t==13||t==32)return $(this).find(".link").click(),!1});$(document).on("keydown",".chevron-left",function(n){var t=n.which;if(t==13||t==32)return $(this).find(".link").click(),!1});$(document).on("keydown",".w3-button",function(n){var t=n.which;if(t==13||t==32)return $(this).click(),!1});$(document).on("keydown",".vintageToggle",function(n){var t=n.which;if(t==13||t==32)return $(this).find("[type=checkbox]").click(),!1});$(document).on("keydown",".photoA",function(n){var t=n.which;if(t==13||t==32)return $(this).click(),!1});$(document).on("keydown",".photoB",function(n){var t=n.which;if(t==13||t==32)return $(this).click(),!1});$(document).on("keydown",".photoC",function(n){var t=n.which;if(t==13||t==32)return $(this).click(),!1});$(document).on("keydown","#leftPhoto",function(n){var t=n.which;if(t==13||t==32)return $(this).click(),!1});$(document).on("keydown","#centerPhoto",function(n){var t=n.which;if(t==13||t==32)return $(this).click(),!1});$(document).on("keydown","#rightPhoto",function(n){var t=n.which;if(t==13||t==32)return $(this).click(),!1});$(document).on("keydown","#leftPanelCloseButton",function(n){var t=n.which;if(t==13||t==32)return $(this).click(),!1});$(document).on("keydown","#optionPanel",function(n){var t=n.which;if(t==13||t==32)return $(this).click(),!1});$(document).on("keydown","#buttonOpenOptionsPanel",function(n){var t=n.which;if(t==13||t==32)return $(this).click(),!1});$(window).on("scroll",function(){var n=$(document).scrollTop();n<=100?$("#buttonClosePhotoCompare").css("top",$("#shorephotosHeader").height()-n+10+"px"):$("#buttonClosePhotoCompare").css("top","10px")});$(document).on("click","#leftPanelCloseButton",function(){APP.customFunctions.w3_close()});$(document).on("click","#optionPanel",function(){APP.customFunctions.w3_close()});$(document).on("click","#buttonOpenOptionsPanel",function(){APP.customFunctions.w3_open()});$(document).on("click","#btnSubmit",function(){var t={addressLine1:"300 Desmond Dr",addressLine2:"",city:"Lacey",state:"WA",zip:"",zip4:""};$.ajax({url:APP.MapUrls.ParseMapInfo,type:"POST",async:!0,data:JSON.stringify(t),contentType:"application/json; charset=utf-8",dataType:"json",error:function(n,t,i){alert(n.status),alert(i)}})});$(document).on("click",".displayModeRadioButton",function(){var i,t;$("#photoTitle").removeClass("photoTitle1970"),$(".displayModeRadioButton").removeClass("displayModeRadioButton_selected"),$(".displayModeRadioButtonIcon").removeClass("displayModeRadioButtonIcon_selected"),$(this).addClass("displayModeRadioButton_selected"),$(this).find(".displayModeRadioButtonIcon").addClass("displayModeRadioButtonIcon_selected"),i=APP.dynamicMapServiceLayer.allSublayers,$.each(i._items,function(n,t){t.visible=!1});switch($(this).attr("id")){case"displayModeRadioButton_2016Photo":t=APP.dynamicMapServiceLayer.findSublayerById(23),t.visible=!0,APP.activeLayerIndex=379,APP.customFunctions.setObliquePhoto(APP.nearestPhoto2016);break;case"displayModeRadioButton_2006Photo":t=APP.dynamicMapServiceLayer.findSublayerById(24),t.visible=!0,APP.customFunctions.setObliquePhoto(APP.nearestPhoto2006),APP.activeLayerIndex=19;break;case"displayModeRadioButton_2000Photo":t=APP.dynamicMapServiceLayer.findSublayerById(27),t.visible=!0,APP.activeLayerIndex=27,APP.customFunctions.setObliquePhoto(APP.nearestPhoto2000);break;case"displayModeRadioButton_1992Photo":t=APP.dynamicMapServiceLayer.findSublayerById(30),t.visible=!0,APP.activeLayerIndex=33,APP.customFunctions.setObliquePhoto(APP.nearestPhoto1990);break;case"displayModeRadioButton_1976Photo":t=APP.dynamicMapServiceLayer.findSublayerById(33),t.visible=!0,APP.customFunctions.setObliquePhoto(APP.nearestPhoto1970),$("#photoTitle").addClass("photoTitle1970")}});$("input:text").focus(function(){$(this).select()});$(document).on("click","#linkShare",function(){var i=$(".displayModeRadioButton_selected").attr("data-photo-vintage"),r=APP.photoNumber,u=window.location.toString(),e=window.location.protocol,f=u.split("?"),t=f[0]+"?CustomMap=y&BBox="+Math.round(APP.mapView.extent.xmin)+","+Math.round(APP.mapView.extent.ymin)+","+Math.round(APP.mapView.extent.xmax)+","+Math.round(APP.mapView.extent.ymax)+"&vintage="+i+"&photo="+r+"&Basemap="+APP.activeBasemap;t=encodeURI(t),t=t.replace(/%20/g,"+"),$("#textboxShareLinkExternal").val(encodeURI(t)),$("#mapSharePopup").fadeIn(500).position({my:"center center",at:"center center",of:$("#mapViewDiv")}).draggable({containment:".w3-content",cancel:".notDraggable"}),$("#mapSharePopup").focus()});$(document).on("click","#mapShareCloseButton",function(){$("#linkShare").focus(),$("#mapSharePopup").fadeOut(500)});$(document).on("click","#sendLinkExternal",function(){var u="",t=$("#textboxShareLinkExternal").val(),i,r;t=t.replace(/&/g,"%26"),i="Hi, I'd like to share a Washington State shoreline photo link with you. %0A%0ALink: "+t,r="mailto:"+u+"?subject=Map Link&body="+i,window.location.href=r});$(document).on("click","#linkCompareYears",function(){var u,f,t,i,e,r;$("#main-content").hide(),$("#mySidebar").hide(),document.body.style.overflowY="auto",APP.isPhotoCompareMode=!0,$(document).scrollTop(0),$("#photoCompare").show().position({my:"left top",at:"left bottom",of:$("#shorephotosHeader")}),$("#buttonClosePhotoCompare").css("top",$("#shorephotosHeader").height()-$(document).scrollTop()+"px"),u=$("#photoCompare").position(),f=u.left,$("#buttonClosePhotoCompare").css("left",f+$("#photoCompare").width()-110+"px"),t=document.getElementById("shorephotosHeader").clientWidth,i=window.innerHeight-document.getElementById("shorephotosHeader").clientHeight,$("#photoSeries1").width(t).height(i*.28),$("#photoSeries2").width(t).height(i*.28),$("#photoSeries3").width(t).height(i*.28),$("#photoSeries4").width(t).height(i*.28),$("#photoSeries5").width(t).height(i*.28),$(".photoA").height($("#photoSeries1").height()*.8),$(".photoA").width($(".photoA").height()/.66625),$(".photoA").width()>$("#photoSeries1").width()/3.8&&($(".photoA").width($("#photoSeries1").width()/3.8*.8),$(".photoA").height($(".photoA").width()*.66625)),$(".photoB").height($("#photoSeries1").height()*.95),$(".photoB").width($(".photoB").height()/.66625),t>=710?($("#photoNavButtonLeft2016").css("margin-left","6%"),$("#photoNavButtonLeft2006").css("margin-left","6%"),$("#photoNavButtonLeft2000").css("margin-left","6%"),$("#photoNavButtonLeft1990").css("margin-left","6%"),$("#photoNavButtonLeft1970").css("margin-left","6%"),$(".photoB").width()>$("#photoSeries1").width()/3.8&&($(".photoB").width($("#photoSeries1").width()/3.8),$(".photoB").height($(".photoB").width()*.66625))):($("#photoNavButtonLeft2016").css("margin-left","15%"),$("#photoNavButtonLeft2006").css("margin-left","15%"),$("#photoNavButtonLeft2000").css("margin-left","15%"),$("#photoNavButtonLeft1990").css("margin-left","15%"),$("#photoNavButtonLeft1970").css("margin-left","15%")),$(".photoC").height($("#photoSeries1").height()*.8),$(".photoC").width($(".photoC").height()/.66625),$(".photoC").width()>$("#photoSeries1").width()/3.8&&($(".photoC").width($("#photoSeries1").width()/3.8*.8),$(".photoC").height($(".photoC").width()*.66625)),e=new tt(APP.dynamicMapServiceURL+"/38"),r=new nt,r.returnGeometry=!1,r.outFields=["*"],r.where="PHOTO_NR = '"+APP.photoNumber+"'",e.execute(r).then(function(n){if(n.features.length>0){var t=n.features[0];t.attributes.PHOTO_2016_LEFT_URL==null||t.attributes.PHOTO_2016_LEFT_URL==""?($("#photoSeries5").find(".photoA").addClass("noPhoto").attr("aria-label","No photo available"),$("#photoNavButtonLeft2016").css("visibility","hidden")):($("#photoSeries5").find(".photoA").css("background-image","url("+t.attributes.PHOTO_2016_LEFT_URL+")").attr("data-photo-number",t.attributes.PHOTO_2016_LEFT).removeClass("noPhoto").attr("aria-label","2016 shoreline left of current location"),$("#photoNavButtonLeft2016").css("visibility","visible")),t.attributes.PHOTO_2016_URL==null||t.attributes.PHOTO_2016_URL==""?$("#photoSeries5").find(".photoB").addClass("noPhoto").attr("aria-label","No photo available"):t.attributes.LANDMARK_2016_DS!=null&&t.attributes.LANDMARK_2016_DS!="Null"&&t.attributes.LANDMARK_2016_DS!=""?$("#photoSeries5").find(".photoB").css("background-image","url("+t.attributes.PHOTO_2016_URL+")").attr("data-photo-number",t.attributes.PHOTO_2016).attr("data-large-photo-url",t.attributes.PHOTO_2016_FULLSIZE_URL).removeClass("noPhoto").attr("aria-label",t.attributes.LANDMARK_2016_DS+" (2016)"):$("#photoSeries5").find(".photoB").css("background-image","url("+t.attributes.PHOTO_2016_URL+")").attr("data-photo-number",t.attributes.PHOTO_2016).attr("data-large-photo-url",t.attributes.PHOTO_2016_FULLSIZE_URL).removeClass("noPhoto").attr("aria-label","Shoreline without landmark (2016)"),t.attributes.PHOTO_2016_RIGHT_URL==null||t.attributes.PHOTO_2016_RIGHT_URL==""?($("#photoSeries5").find(".photoC").addClass("noPhoto").attr("aria-label","No photo available"),$("#photoNavButtonRight2016").css("visibility","hidden")):($("#photoSeries5").find(".photoC").css("background-image","url("+t.attributes.PHOTO_2016_RIGHT_URL+")").attr("data-photo-number",t.attributes.PHOTO_2016_RIGHT).removeClass("noPhoto").attr("aria-label","2016 shoreline left of current location"),$("#photoNavButtonRight2016").css("visibility","visible")),t.attributes.PHOTO_2006_LEFT_URL==null||t.attributes.PHOTO_2006_LEFT_URL==""?($("#photoSeries4").find(".photoA").addClass("noPhoto").attr("aria-label","No photo available").attr("aria-label","2006 shoreline left of current location"),$("#photoNavButtonLeft2006").css("visibility","hidden")):($("#photoSeries4").find(".photoA").css("background-image","url("+t.attributes.PHOTO_2006_LEFT_URL+")").attr("data-photo-number",t.attributes.PHOTO_2006_LEFT).removeClass("noPhoto"),$("#photoNavButtonLeft2006").css("visibility","visible")),t.attributes.Photo_2006_URL==null||t.attributes.Photo_2006_URL==""?$("#photoSeries4").find(".photoB").addClass("noPhoto").attr("aria-label","No photo available"):t.attributes.Landmark_2006_DS!=null&&t.attributes.Landmark_2006_DS!="Null"&&t.attributes.Landmark_2006_DS!=""?$("#photoSeries4").find(".photoB").css("background-image","url("+t.attributes.Photo_2006_URL+")").attr("data-photo-number",t.attributes.PHOTO_2006).attr("data-large-photo-url",t.attributes.PHOTO_2006_FULLSIZE_URL).removeClass("noPhoto").attr("aria-label",t.attributes.Landmark_2006_DS+" (2006)"):$("#photoSeries4").find(".photoB").css("background-image","url("+t.attributes.Photo_2006_URL+")").attr("data-photo-number",t.attributes.PHOTO_2006).attr("data-large-photo-url",t.attributes.PHOTO_2006_FULLSIZE_URL).removeClass("noPhoto").attr("aria-label","Shoreline without landmark (2006)"),t.attributes.PHOTO_2006_RIGHT_URL==null||t.attributes.PHOTO_2006_RIGHT_URL==""?($("#photoSeries4").find(".photoC").addClass("noPhoto").attr("aria-label","No photo available"),$("#photoNavButtonRight2006").css("visibility","hidden")):($("#photoSeries4").find(".photoC").css("background-image","url("+t.attributes.PHOTO_2006_RIGHT_URL+")").attr("data-photo-number",t.attributes.PHOTO_2006_RIGHT).removeClass("noPhoto").attr("aria-label","2006 shoreline right of current location"),$("#photoNavButtonRight2006").css("visibility","visible")),t.attributes.PHOTO_2000_LEFT_URL==null||t.attributes.PHOTO_2000_LEFT_URL==""?($("#photoSeries3").find(".photoA").addClass("noPhoto").attr("aria-label","No photo available"),$("#photoNavButtonLeft2000").css("visibility","hidden")):($("#photoSeries3").find(".photoA").css("background-image","url("+t.attributes.PHOTO_2000_LEFT_URL+")").attr("data-photo-number",t.attributes.PHOTO_2000_LEFT).removeClass("noPhoto").attr("aria-label","2000 shoreline left of current location"),$("#photoNavButtonLeft2000").css("visibility","visible")),t.attributes.Photo_2000_URL==null||t.attributes.Photo_2000_URL==""?$("#photoSeries3").find(".photoB").addClass("noPhoto").attr("aria-label","No photo available"):t.attributes.Landmark_2000_DS!=null&&t.attributes.Landmark_2000_DS!="Null"&&t.attributes.Landmark_2000_DS!=""?$("#photoSeries3").find(".photoB").css("background-image","url("+t.attributes.Photo_2000_URL+")").attr("data-photo-number",t.attributes.PHOTO_2000).attr("data-large-photo-url",t.attributes.PHOTO_2000_FULLSIZE_URL).removeClass("noPhoto").attr("aria-label",t.attributes.Landmark_2000_DS+" (2000)"):$("#photoSeries3").find(".photoB").css("background-image","url("+t.attributes.Photo_2000_URL+")").attr("data-photo-number",t.attributes.PHOTO_2000).attr("data-large-photo-url",t.attributes.PHOTO_2000_FULLSIZE_URL).removeClass("noPhoto").attr("aria-label","Shoreline without landmark (2000)"),t.attributes.PHOTO_2000_RIGHT_URL==null||t.attributes.PHOTO_2000_RIGHT_URL==""?($("#photoSeries3").find(".photoC").addClass("noPhoto").attr("aria-label","No photo available"),$("#photoNavButtonRight2000").css("visibility","hidden")):($("#photoSeries3").find(".photoC").css("background-image","url("+t.attributes.PHOTO_2000_RIGHT_URL+")").attr("data-photo-number",t.attributes.PHOTO_2000_RIGHT).removeClass("noPhoto").attr("aria-label","2000 shoreline left of current location"),$("#photoNavButtonRight2000").css("visibility","visible")),t.attributes.PHOTO_1990_LEFT_URL==null||t.attributes.PHOTO_1990_LEFT_URL==""?($("#photoSeries2").find(".photoA").addClass("noPhoto").attr("aria-label","No photo available"),$("#photoNavButtonLeft1990").css("visibility","hidden")):($("#photoSeries2").find(".photoA").css("background-image","url("+t.attributes.PHOTO_1990_LEFT_URL+")").attr("data-photo-number",t.attributes.PHOTO_1990_LEFT).removeClass("noPhoto").attr("aria-label","1990s shoreline left of current location"),$("#photoNavButtonLeft1990").css("visibility","visible")),t.attributes.Photo_1990_URL==null||t.attributes.Photo_1990_URL==""?$("#photoSeries2").find(".photoB").addClass("noPhoto").attr("aria-label","No photo available"):t.attributes.Landmark_1990_DS!=null&&t.attributes.Landmark_1990_DS!="Null"&&t.attributes.Landmark_1990_DS!=""?$("#photoSeries2").find(".photoB").css("background-image","url("+t.attributes.Photo_1990_URL+")").attr("data-photo-number",t.attributes.PHOTO_1990).attr("data-large-photo-url",t.attributes.PHOTO_1990_FULLSIZE_URL).removeClass("noPhoto").attr("aria-label",t.attributes.Landmark_1990_DS+" (1990s)"):$("#photoSeries2").find(".photoB").css("background-image","url("+t.attributes.Photo_1990_URL+")").attr("data-photo-number",t.attributes.PHOTO_1990).attr("data-large-photo-url",t.attributes.PHOTO_1990_FULLSIZE_URL).removeClass("noPhoto").attr("aria-label","Shoreline without landmark (1990s)"),t.attributes.PHOTO_1990_RIGHT_URL==null||t.attributes.PHOTO_1990_RIGHT_URL==""?($("#photoSeries2").find(".photoC").addClass("noPhoto").attr("aria-label","No photo available"),$("#photoNavButtonRight1990").css("visibility","hidden")):($("#photoSeries2").find(".photoC").css("background-image","url("+t.attributes.PHOTO_1990_RIGHT_URL+")").attr("data-photo-number",t.attributes.PHOTO_1990_RIGHT).removeClass("noPhoto").attr("aria-label","1990s shoreline left of current location"),$("#photoNavButtonRight1990").css("visibility","visible")),t.attributes.PHOTO_1970_LEFT_URL==null||t.attributes.PHOTO_1970_LEFT_URL==""?($("#photoSeries1").find(".photoA").addClass("noPhoto").attr("aria-label","No photo available"),$("#photoNavButtonLeft1970").css("visibility","hidden")):($("#photoSeries1").find(".photoA").css("background-image","url("+t.attributes.PHOTO_1970_LEFT_URL+")").attr("data-photo-number",t.attributes.PHOTO_1970_LEFT).removeClass("noPhoto").attr("aria-label","1970s shoreline left of current location"),$("#photoNavButtonLeft1970").css("visibility","visible")),t.attributes.Photo_1970_URL==null||t.attributes.Photo_1970_URL==""?$("#photoSeries1").find(".photoB").addClass("noPhoto").attr("aria-label","No photo available"):t.attributes.Landmark_1970_DS!=null&&t.attributes.Landmark_1970_DS!="Null"&&t.attributes.Landmark_1970_DS!=""?$("#photoSeries1").find(".photoB").css("background-image","url("+t.attributes.Photo_1970_URL+")").attr("data-photo-number",t.attributes.PHOTO_1970).attr("data-large-photo-url",t.attributes.PHOTO_1970_FULLSIZE_URL).removeClass("noPhoto").attr("aria-label",t.attributes.Landmark_1970_DS+" (1970s)"):$("#photoSeries1").find(".photoB").css("background-image","url("+t.attributes.Photo_1970_URL+")").attr("data-photo-number",t.attributes.PHOTO_1970).attr("data-large-photo-url",t.attributes.PHOTO_1970_FULLSIZE_URL).removeClass("noPhoto").attr("aria-label","Shoreline without landmark (1970s)"),t.attributes.PHOTO_1970_RIGHT_URL==null||t.attributes.PHOTO_1970_RIGHT_URL==""?($("#photoSeries1").find(".photoC").addClass("noPhoto").attr("aria-label","No photo available"),$("#photoNavButtonRight1970").css("visibility","hidden")):($("#photoSeries1").find(".photoC").css("background-image","url("+t.attributes.PHOTO_1970_RIGHT_URL+")").attr("data-photo-number",t.attributes.PHOTO_1970_RIGHT).removeClass("noPhoto").attr("aria-label","1970s shoreline left of current location"),$("#photoNavButtonRight1970").css("visibility","visible"))}$("#buttonClosePhotoCompare").focus()})});$(document).on("click","#buttonClosePhotoCompare",function(){$("#main-content").show(),$("#mySidebar").show(),document.body.style.overflowY="hidden",APP.isPhotoCompareMode=!1,$("#photoCompare").fadeOut(500),$("#leftPanelCloseButton").is(":visible")?$("#leftPanelCloseButton").focus():$("#linkCompareYears").focus()});$(document).on("click","#linkCoastalAtlas",function(){var r=$(".displayModeRadioButton_selected").attr("data-photo-vintage"),t="",i;switch(r){case"1970":t="33,34,35";break;case"1990":t="30,31,32";break;case"2000":t="27,28,29";break;case"2006":t="24,25,26";break;case"2016":t="23";break;default:t="23"}i="https://apps.ecology.wa.gov/coastalatlasmap/?CustomMap=y&BBox="+Math.round(APP.mapView.extent.xmin)+","+Math.round(APP.mapView.extent.ymin)+","+Math.round(APP.mapView.extent.xmax)+","+Math.round(APP.mapView.extent.ymax)+"&Layers="+t+"&Opacity=0.9&Basemap="+APP.activeBasemap,i=encodeURI(i),i=i.replace(/%20/g,"+"),window.open(i,"_blank")});$(document).on("click","#linkDataDownload",function(){window.open("https://fortress.wa.gov/ecy/gispublic/DataDownload/SEA_IBM_ShorelinePhotos.zip","_blank")});$(document).on("click",".photoNavButton",function(){switch($(this).attr("id")){case"photoNavButtonLeft":APP.customFunctions.movePhoto("left");break;case"photoNavButtonRight":APP.customFunctions.movePhoto("right");break;case"photoNavButtonLeft2016":APP.customFunctions.moveComparePhoto("#photoSeries5","left","2016");break;case"photoNavButtonRight2016":APP.customFunctions.moveComparePhoto("#photoSeries5","right","2016");break;case"photoNavButtonLeft2006":APP.customFunctions.moveComparePhoto("#photoSeries4","left","2006");break;case"photoNavButtonRight2006":APP.customFunctions.moveComparePhoto("#photoSeries4","right","2006");break;case"photoNavButtonLeft2000":APP.customFunctions.moveComparePhoto("#photoSeries3","left","2000");break;case"photoNavButtonRight2000":APP.customFunctions.moveComparePhoto("#photoSeries3","right","2000");break;case"photoNavButtonLeft1990":APP.customFunctions.moveComparePhoto("#photoSeries2","left","1990");break;case"photoNavButtonRight1990":APP.customFunctions.moveComparePhoto("#photoSeries2","right","1990");break;case"photoNavButtonLeft1970":APP.customFunctions.moveComparePhoto("#photoSeries1","left","1970");break;case"photoNavButtonRight1970":APP.customFunctions.moveComparePhoto("#photoSeries1","right","1970")}});$(document).on("click",".photoA",function(){$(this).hasClass("noPhoto")==!1&&$(this).parent().find(".photoNavButtonLeft").click()});$(document).on("click",".photoC",function(){$(this).hasClass("noPhoto")==!1&&$(this).parent().find(".photoNavButtonRight").click()});$(document).on("click"," .photoB",function(){$(this).hasClass("noPhoto")==!1&&window.open($(this).attr("data-large-photo-url"))});$(document).on("click","#leftPhoto",function(){$(this).hasClass("noPhoto")==!1&&$(this).parent().find("#photoNavButtonLeft").click()});$(document).on("click","#rightPhoto",function(){$(this).hasClass("noPhoto")==!1&&$(this).parent().find("#photoNavButtonRight").click()});$(document).on("click"," #centerPhoto",function(){$(this).hasClass("noPhoto")==!1&&window.open($(this).attr("data-large-photo-url"))});$(document).on("click",".slider",function(){$(this).parent().find("[type=checkbox]").click()});$(document).on("click","#cbPhotoSeries1",function(){$("#photoSeries1").slideToggle(500)});$(document).on("click","#cbPhotoSeries2",function(){$("#photoSeries2").slideToggle(500)});$(document).on("click","#cbPhotoSeries3",function(){$("#photoSeries3").slideToggle(500)});$(document).on("click","#cbPhotoSeries4",function(){$("#photoSeries4").slideToggle(500)});$(document).on("click","#cbPhotoSeries5",function(){$("#photoSeries5").slideToggle(500)});$(document).on("click","#linkMapFocus",function(){$(".esri-display-object").eq(0).first().focus()});$(document).on("click","#linkPhotoViewerFocus",function(){$("#photoNavButtonLeft").focus()});$(".accessible").focus(function(){$(this).position({my:"left bottom",at:"left top",of:$("#LinkFooterCoastalAtlasHome")})});$(document).on("focus",".accessible",function(){$(this).position({my:"left bottom",at:"left top-20",of:$("#app-footer")})});$(document).on("blur",".accessible",function(){$(this).position({my:"left top",at:"left-300 top",of:$("#app-footer")})});$(document).on("focus","svg:last",function(){$("#mapViewDiv").addClass("activeMap")});$(document).on("click",function(n){switch(n.target.className){case"esri-attribution__link":case"esri-attribution__powered-by":case"esri-attribution__sources esri-interactive esri-attribution__sources--open":case"esri-attribution__sources esri-interactive":$(".esri-display-object").eq(0).first().focus()}});$(document).on("blur","svg:last",function(){$("#mapViewDiv").removeClass("activeMap")});i(),r();var t=new v({view:APP.mapView,locationEnabled:!1,popupEnabled:!0,popupOpenOnSelect:!1,includeDefaultSources:!1,searchAllEnabled:!0}),n=[];n.push({featureLayer:new y(APP.dynamicMapServiceURL+"/359"),searchFields:["CITY_NM"],displayField:"CITY_NM",exactMatch:!1,outFields:["CITY_NM"],name:"Cities",placeholder:"find city"}),n.push({featureLayer:new y(APP.dynamicMapServiceURL+"/361"),searchFields:["COUNTY_NM"],displayField:"COUNTY_NM",exactMatch:!1,outFields:["COUNTY_NM"],name:"Counties",placeholder:"find county"}),n.push({featureLayer:new y(APP.dynamicMapServiceURL+"/102"),searchFields:["WRIA_NR_NM"],displayField:"WRIA_NR_NM",exactMatch:!1,outFields:["WRIA_NR_NM"],name:"Water Resource Inventory Areas",placeholder:"find WRIA"}),n.push({locator:new b("https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer"),singleLineFieldName:"SingleLine",outFields:["Addr_type"],name:"Address",categories:["Address","Postal","LatLong","Populated Place"],searchExtent:APP.startExtentAndSR,placeholder:"find address"}),t.sources=n,APP.mapView.ui.add(t,{position:"top-left",index:100});APP.mapView.on("click",function(n){APP.customFunctions.doIdentify(n.mapPoint)})}APP.map=null,APP.mapView=null,APP.GISServerBaseUrl="https://gis.ecology.wa.gov/serverext/rest/services",APP.dynamicMapServiceURL="https://gis.ecology.wa.gov/serverext/rest/services/GIS/CoastalAtlas/MapServer",APP.identifyServiceURL="https://gis.ecology.wa.gov/serverext/rest/services/GIS/ECY_Identify/MapServer",APP.bingKey="Aj9eK_pOHnO3rGAxM1Ujkcf7SbewgXkWcbuwi2x-qA_PEHeOgEHN__68U4sDpJ7l",APP.gisResourceUrl="https://fortress.wa.gov/ecy/gisresources",APP.bogusZoomDecider="False",APP.customFunctions=dojo.getObject("customFunctions",!0),APP.customFunctions.setFocus=function(n){$(n).focus()},APP.customFunctions.getParameterByName=function(n){n=n.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i="[\\?&]"+n+"=([^&#]*)",r=new RegExp(i),t=r.exec(decodeURI(window.location.search));return t==null?"":decodeURIComponent(t[1].replace(/\+/g," "))},APP.customFunctions.w3_close=function(){document.getElementById("mySidebar").style.display="none",document.getElementById("optionPanel").style.display="none"},APP.customFunctions.w3_open=function(){document.getElementById("mySidebar").style.display="block",document.getElementById("optionPanel").style.display="block"},APP.customFunctions.setPhotoHeight=function(){var t=document.getElementById("leftPhoto").clientWidth,i=document.getElementById("centerPhoto").clientWidth,n=1,r=$(".displayModeRadioButton_selected").attr("data-photo-vintage");switch(r){case"2016":n=.66946267;break;case"2006":n=.66402439;break;case"2000":n=.74896836;break;case"1990":n=.76100629;break;case"1970":n=1.01585821;break;default:n=.66946267}document.getElementById("leftPhoto").setAttribute("style","height:"+Math.floor(t*n)+"px"),document.getElementById("centerPhoto").setAttribute("style","height:"+Math.floor(i*n)+"px"),document.getElementById("rightPhoto").setAttribute("style","height:"+Math.floor(t*n)+"px"),document.getElementById("centerPhoto").clientHeight>document.getElementById("photoHolder").clientHeight-20&&document.getElementById("centerPhoto").setAttribute("style","height:"+(document.getElementById("photoHolder").clientHeight-20)+"px"),document.getElementById("photoInfo").setAttribute("style","width:"+document.getElementById("centerPhoto").clientWidth+"px"),document.getElementById("photoNavButtonLeft").setAttribute("style","visibility: visible"),document.getElementById("photoNavButtonRight").setAttribute("style","visibility: visible"),APP.customFunctions.setObliquePhoto(APP.photoNumber)},APP.customFunctions.setMapHeight=function(){var n,i,t,r;document.body.style.overflowY="hidden",n=window.innerHeight*.4-1,document.getElementById("photoHolder").setAttribute("style","height:"+n+"px"),i=document.getElementById("shorephotosHeader").clientHeight,document.getElementById("app-footer").setAttribute("style","padding-top:"+(window.innerHeight-685)+"px; visibility:visible"),APP.isPhotoCompareMode&&($("#photoCompare").hide(),$("#linkCompareYears").click()),t=window.innerHeight-i,document.getElementById("main-content").setAttribute("style","height:"+t+"px"),r=t-n,document.getElementById("mapViewDiv").setAttribute("style","height:"+r+"px;"),setTimeout('$("#identify-crosshair").position({ my: "center center", at: "center center", of: $("#mapViewDiv") })',500),setTimeout("APP.customFunctions.setPhotoHeight()",500)},APP.customFunctions.doIdentify=function(n){var i=$(".displayModeRadioButton_selected").attr("data-photo-vintage"),f=[],e,t;f[125]="Vintage = "+i,e=new k(APP.identifyServiceURL),t=new d,t.returnGeometry=!0,t.width=APP.mapView.width,t.height=APP.mapView.height,t.geometry=n,t.mapExtent=APP.mapView.extent,t.tolerance=10,t.layerIds=[125],t.layerOption=d.LAYER_OPTION_ALL,t.layerDefinitions=f,e.execute(t).then(function(n){if(n.results.length>0){APP.photoGraphicsLayer.removeAll(),APP.photoNumber=n.results[0].feature.attributes.PHOTO_NR,APP.photoLeftURL2=n.results[0].feature.attributes.PHOTO_LEFT_URL,APP.photoRightURL2=n.results[0].feature.attributes.PHOTO_RIGHT_URL,APP.photoNumberURL=n.results[0].feature.attributes.Photo_NR_URL,APP.largePhotoURL=n.results[0].feature.attributes.FULLSIZE_URL,APP.photoLeft=n.results[0].feature.attributes.PHOTO_LEFT,APP.photoRight=n.results[0].feature.attributes.PHOTO_RIGHT,APP.photoDate=n.results[0].feature.attributes.PHOTO_DATE,APP.photoLandmark=n.results[0].feature.attributes.LANDMARK_DS;switch(i){case"2016":APP.nearestPhoto1970=n.results[0].feature.attributes.PHOTO_1970,APP.nearestPhoto1990=n.results[0].feature.attributes.PHOTO_1990,APP.nearestPhoto2000=n.results[0].feature.attributes.PHOTO_2000,APP.nearestPhoto2006=n.results[0].feature.attributes.PHOTO_2006,APP.nearestPhoto2016=APP.photoNumber;break;case"2006":APP.nearestPhoto1970=n.results[0].feature.attributes.PHOTO_1970,APP.nearestPhoto1990=n.results[0].feature.attributes.PHOTO_1990,APP.nearestPhoto2000=n.results[0].feature.attributes.PHOTO_2000,APP.nearestPhoto2006=APP.photoNumber,APP.nearestPhoto2016=n.results[0].feature.attributes.PHOTO_2016;break;case"2000":APP.nearestPhoto1970=n.results[0].feature.attributes.PHOTO_1970,APP.nearestPhoto1990=n.results[0].feature.attributes.PHOTO_1990,APP.nearestPhoto2000=APP.photoNumber,APP.nearestPhoto2006=n.results[0].feature.attributes.PHOTO_2006,APP.nearestPhoto2016=n.results[0].feature.attributes.PHOTO_2016;break;case"1990":APP.nearestPhoto1970=n.results[0].feature.attributes.PHOTO_1970,APP.nearestPhoto1990=APP.photoNumber,APP.nearestPhoto2000=n.results[0].feature.attributes.PHOTO_2000,APP.nearestPhoto2006=n.results[0].feature.attributes.PHOTO_2006,APP.nearestPhoto2016=n.results[0].feature.attributes.PHOTO_2016;break;case"1970":APP.nearestPhoto1970=APP.photoNumber,APP.nearestPhoto1990=n.results[0].feature.attributes.PHOTO_1990,APP.nearestPhoto2000=n.results[0].feature.attributes.PHOTO_2000,APP.nearestPhoto2006=n.results[0].feature.attributes.PHOTO_2006,APP.nearestPhoto2016=n.results[0].feature.attributes.PHOTO_2016}var t=new r(r.STYLE_SQUARE,17,new u(u.STYLE_SOLID,new s([255,255,255]),2),new s([0,0,255,1])),f=n.results[0].feature,e=new o({geometry:f.geometry,symbol:t});APP.photoGraphicsLayer.add(e),APP.photoLeftURL2==""||APP.photoLeftURL2=="Null"?$("#leftPhoto").addClass("noPhoto"):$("#leftPhoto").css("background-image","url("+APP.photoLeftURL2+")").css("background-color","whitesmoke").attr("data-photo-number",APP.photoLeft).removeClass("noPhoto"),APP.photoNumberURL==""||APP.photoNumberURL=="Null"?$("#centerPhoto").addClass("noPhoto"):$("#centerPhoto").css("background-image","url("+APP.photoNumberURL+")").css("background-color","whitesmoke").attr("data-photo-number",APP.photoNumber).attr("data-large-photo-url",APP.largePhotoURL).removeClass("noPhoto"),APP.photoRightURL2==""||APP.photoRightURL2=="Null"?$("#rightPhoto").addClass("noPhoto"):$("#rightPhoto").css("background-image","url("+APP.photoRightURL2+")").css("background-color","whitesmoke").attr("data-photo-number",APP.photoRight).removeClass("noPhoto"),APP.photoDate!=""?APP.photoLandmark!=""&&APP.photoLandmark!="Null"?$("#photoInfo").text(APP.photoLandmark+"   ("+APP.photoDate+")"):$("#photoInfo").text(APP.photoDate):$("#photoInfo").text(APP.photoLandmark),APP.photoLeft==""||APP.photoLeft=="Null"?$("#photoNavButtonLeft").hide():$("#photoNavButtonLeft").show(),APP.photoRight==""||APP.photoRight=="Null"?$("#photoNavButtonRight").hide():$("#photoNavButtonRight").show()}})},APP.customFunctions.movePhoto=function(n){var i=$(".displayModeRadioButton_selected").attr("data-photo-vintage"),t="";switch(n){case"right":t=$("#rightPhoto").attr("data-photo-number");break;case"left":t=$("#leftPhoto").attr("data-photo-number")}APP.bogusZoomDecider="True",APP.customFunctions.setObliquePhoto(t)},APP.customFunctions.moveComparePhoto=function(n,t,i){var u="",f,r;switch(t){case"left":u=$(n).find(".photoA").attr("data-photo-number");break;case"right":u=$(n).find(".photoC").attr("data-photo-number")}f=new tt(APP.dynamicMapServiceURL+"/38"),r=new nt,r.returnGeometry=!1,r.outFields=["*"],r.where="PHOTO_NR = '"+u+"'",f.execute(r).then(function(n){if(n.features.length>0){var t=n.features[0];switch(i){case"2016":t.attributes.PHOTO_2016_LEFT_URL==null||t.attributes.PHOTO_2016_LEFT_URL==""?($("#photoSeries5").find(".photoA").addClass("noPhoto"),$("#photoNavButtonLeft2016").css("visibility","hidden")):($("#photoSeries5").find(".photoA").css("background-image","url("+t.attributes.PHOTO_2016_LEFT_URL+")").attr("data-photo-number",t.attributes.PHOTO_2016_LEFT).removeClass("noPhoto"),$("#photoNavButtonLeft2016").css("visibility","visible")),t.attributes.PHOTO_2016_URL==null||t.attributes.PHOTO_2016_URL==""?$("#photoSeries5").find(".photoB").addClass("noPhoto"):$("#photoSeries5").find(".photoB").css("background-image","url("+t.attributes.PHOTO_2016_URL+")").attr("data-photo-number",t.attributes.PHOTO_2016).attr("data-large-photo-url",t.attributes.PHOTO_2016_FULLSIZE_URL).removeClass("noPhoto"),t.attributes.PHOTO_2016_RIGHT_URL==null||t.attributes.PHOTO_2016_RIGHT_URL==""?($("#photoSeries5").find(".photoC").addClass("noPhoto"),$("#photoNavButtonRight2016").css("visibility","hidden")):($("#photoSeries5").find(".photoC").css("background-image","url("+t.attributes.PHOTO_2016_RIGHT_URL+")").attr("data-photo-number",t.attributes.PHOTO_2016_RIGHT).removeClass("noPhoto"),$("#photoNavButtonRight2016").css("visibility","visible"));break;case"2006":t.attributes.PHOTO_2006_LEFT_URL==null||t.attributes.PHOTO_2006_LEFT_URL==""?($("#photoSeries4").find(".photoA").addClass("noPhoto"),$("#photoNavButtonLeft2006").css("visibility","hidden")):($("#photoSeries4").find(".photoA").css("background-image","url("+t.attributes.PHOTO_2006_LEFT_URL+")").attr("data-photo-number",t.attributes.PHOTO_2006_LEFT).removeClass("noPhoto"),$("#photoNavButtonLeft2006").css("visibility","visible")),t.attributes.Photo_2006_URL==null||t.attributes.Photo_2006_URL==""?$("#photoSeries4").find(".photoB").addClass("noPhoto"):$("#photoSeries4").find(".photoB").css("background-image","url("+t.attributes.Photo_2006_URL+")").attr("data-photo-number",t.attributes.PHOTO_2006).attr("data-large-photo-url",t.attributes.PHOTO_2006_FULLSIZE_URL).removeClass("noPhoto"),t.attributes.PHOTO_2006_RIGHT_URL==null||t.attributes.PHOTO_2006_RIGHT_URL==""?($("#photoSeries4").find(".photoC").addClass("noPhoto"),$("#photoNavButtonRight2006").css("visibility","hidden")):($("#photoSeries4").find(".photoC").css("background-image","url("+t.attributes.PHOTO_2006_RIGHT_URL+")").attr("data-photo-number",t.attributes.PHOTO_2006_RIGHT).removeClass("noPhoto"),$("#photoNavButtonRight2006").css("visibility","visible"));break;case"2000":t.attributes.PHOTO_2000_LEFT_URL==null||t.attributes.PHOTO_2000_LEFT_URL==""?($("#photoSeries3").find(".photoA").addClass("noPhoto"),$("#photoNavButtonLeft2000").css("visibility","hidden")):($("#photoSeries3").find(".photoA").css("background-image","url("+t.attributes.PHOTO_2000_LEFT_URL+")").attr("data-photo-number",t.attributes.PHOTO_2000_LEFT).removeClass("noPhoto"),$("#photoNavButtonLeft2000").show()),t.attributes.Photo_2000_URL==null||t.attributes.Photo_2000_URL==""?$("#photoSeries3").find(".photoB").addClass("noPhoto"):$("#photoSeries3").find(".photoB").css("background-image","url("+t.attributes.Photo_2000_URL+")").attr("data-photo-number",t.attributes.PHOTO_2000).attr("data-large-photo-url",t.attributes.PHOTO_2000_FULLSIZE_URL).removeClass("noPhoto"),t.attributes.PHOTO_2000_RIGHT_URL==null||t.attributes.PHOTO_2000_RIGHT_URL==""?($("#photoSeries3").find(".photoC").addClass("noPhoto"),$("#photoNavButtonRight2000").css("visibility","hidden")):($("#photoSeries3").find(".photoC").css("background-image","url("+t.attributes.PHOTO_2000_RIGHT_URL+")").attr("data-photo-number",t.attributes.PHOTO_2000_RIGHT).removeClass("noPhoto"),$("#photoNavButtonRight2000").css("visibility","visible"));break;case"1990":t.attributes.PHOTO_1990_LEFT_URL==null||t.attributes.PHOTO_1990_LEFT_URL==""?($("#photoSeries2").find(".photoA").addClass("noPhoto"),$("#photoNavButtonLeft1990").css("visibility","hidden")):($("#photoSeries2").find(".photoA").css("background-image","url("+t.attributes.PHOTO_1990_LEFT_URL+")").attr("data-photo-number",t.attributes.PHOTO_1990_LEFT).removeClass("noPhoto"),$("#photoNavButtonLeft1990").css("visibility","visible")),t.attributes.Photo_1990_URL==null||t.attributes.Photo_1990_URL==""?$("#photoSeries2").find(".photoB").addClass("noPhoto"):$("#photoSeries2").find(".photoB").css("background-image","url("+t.attributes.Photo_1990_URL+")").attr("data-photo-number",t.attributes.PHOTO_1990).attr("data-large-photo-url",t.attributes.PHOTO_1990_FULLSIZE_URL).removeClass("noPhoto"),t.attributes.PHOTO_1990_RIGHT_URL==null||t.attributes.PHOTO_1990_RIGHT_URL==""?($("#photoSeries2").find(".photoC").addClass("noPhoto"),$("#photoNavButtonRight1990").css("visibility","hidden")):($("#photoSeries2").find(".photoC").css("background-image","url("+t.attributes.PHOTO_1990_RIGHT_URL+")").attr("data-photo-number",t.attributes.PHOTO_1990_RIGHT).removeClass("noPhoto"),$("#photoNavButtonRight1990").css("visibility","visible"));break;case"1970":t.attributes.PHOTO_1970_LEFT_URL==null||t.attributes.PHOTO_1970_LEFT_URL==""?($("#photoSeries1").find(".photoA").addClass("noPhoto"),$("#photoNavButtonLeft1970").css("visibility","hidden")):($("#photoSeries1").find(".photoA").css("background-image","url("+t.attributes.PHOTO_1970_LEFT_URL+")").attr("data-photo-number",t.attributes.PHOTO_1970_LEFT).removeClass("noPhoto"),$("#photoNavButtonLeft1970").css("visibility","visible")),t.attributes.Photo_1970_URL==null||t.attributes.Photo_1970_URL==""?$("#photoSeries1").find(".photoB").addClass("noPhoto"):$("#photoSeries1").find(".photoB").css("background-image","url("+t.attributes.Photo_1970_URL+")").attr("data-photo-number",t.attributes.PHOTO_1970).attr("data-large-photo-url",t.attributes.PHOTO_1970_FULLSIZE_URL).removeClass("noPhoto"),t.attributes.PHOTO_1970_RIGHT_URL==null||t.attributes.PHOTO_1970_RIGHT_URL==""?($("#photoSeries1").find(".photoC").addClass("noPhoto"),$("#photoNavButtonRight1970").css("visibility","hidden")):($("#photoSeries1").find(".photoC").css("background-image","url("+t.attributes.PHOTO_1970_RIGHT_URL+")").attr("data-photo-number",t.attributes.PHOTO_1970_RIGHT).removeClass("noPhoto"),$("#photoNavButtonRight1970").css("visibility","visible"))}}})},APP.customFunctions.setObliquePhoto=function(n){var i=new tt(APP.identifyServiceURL+"/125"),t=new nt;t.returnGeometry=!0,t.outFields=["PHOTO_NR, PHOTO_LEFT, PHOTO_RIGHT, COUNTY_NM, PHOTO_DATE, LANDMARK_DS, PHOTO_1970, PHOTO_1990, PHOTO_2000, PHOTO_2006, PHOTO_2016, Photo_NR_URL, PHOTO_LEFT_URL, PHOTO_RIGHT_URL, FULLSIZE_URL, Vintage"],t.where="PHOTO_NR = '"+n+"'",i.execute(t).then(function(n){var t,f;if(APP.photoGraphicsLayer.removeAll(),n.features.length>0){APP.photoNumber=n.features[0].attributes.PHOTO_NR,APP.photoLeftURL2=n.features[0].attributes.PHOTO_LEFT_URL,APP.photoRightURL2=n.features[0].attributes.PHOTO_RIGHT_URL,APP.photoNumberURL=n.features[0].attributes.Photo_NR_URL,APP.largePhotoURL=n.features[0].attributes.FULLSIZE_URL,APP.photoLeft=n.features[0].attributes.PHOTO_LEFT,APP.photoRight=n.features[0].attributes.PHOTO_RIGHT,APP.photoDate=n.features[0].attributes.PHOTO_DATE,APP.photoLandmark=n.features[0].attributes.LANDMARK_DS,t=$(".displayModeRadioButton_selected").attr("data-photo-vintage");switch(t){case"2016":APP.nearestPhoto1970=n.features[0].attributes.PHOTO_1970,APP.nearestPhoto1990=n.features[0].attributes.PHOTO_1990,APP.nearestPhoto2000=n.features[0].attributes.PHOTO_2000,APP.nearestPhoto2006=n.features[0].attributes.PHOTO_2006,APP.nearestPhoto2016=APP.photoNumber;break;case"2006":APP.nearestPhoto1970=n.features[0].attributes.PHOTO_1970,APP.nearestPhoto1990=n.features[0].attributes.PHOTO_1990,APP.nearestPhoto2000=n.features[0].attributes.PHOTO_2000,APP.nearestPhoto2006=APP.photoNumber,APP.nearestPhoto2016=n.features[0].attributes.PHOTO_2016;break;case"2000":APP.nearestPhoto1970=n.features[0].attributes.PHOTO_1970,APP.nearestPhoto1990=n.features[0].attributes.PHOTO_1990,APP.nearestPhoto2000=APP.photoNumber,APP.nearestPhoto2006=n.features[0].attributes.PHOTO_2006,APP.nearestPhoto2016=n.features[0].attributes.PHOTO_2016;break;case"1990":APP.nearestPhoto1970=n.features[0].attributes.PHOTO_1970,APP.nearestPhoto1990=APP.photoNumber,APP.nearestPhoto2000=n.features[0].attributes.PHOTO_2000,APP.nearestPhoto2006=n.features[0].attributes.PHOTO_2006,APP.nearestPhoto2016=n.features[0].attributes.PHOTO_2016;break;case"1970":APP.nearestPhoto1970=APP.photoNumber,APP.nearestPhoto1990=n.features[0].attributes.PHOTO_1990,APP.nearestPhoto2000=n.features[0].attributes.PHOTO_2000,APP.nearestPhoto2006=n.features[0].attributes.PHOTO_2006,APP.nearestPhoto2016=n.features[0].attributes.PHOTO_2016}var e=new r(r.STYLE_SQUARE,17,new u(u.STYLE_SOLID,new s([255,255,255]),2),new s([0,0,255,1])),i=n.features[0],h=new o({geometry:i.geometry,symbol:e});APP.photoGraphicsLayer.add(h),APP.bogusZoomDecider=="True"&&(f=APP.mapView.zoom,f<12?(APP.mapView.center=i.geometry,APP.mapView.zoom=12):(APP.mapView.center=i.geometry,APP.mapView.zoom=f)),APP.photoLeftURL2==""||APP.photoLeftURL2==null?$("#leftPhoto").addClass("noPhoto").attr("aria-label","No photo available"):$("#leftPhoto").css("background-image","url("+APP.photoLeftURL2+")").css("background-color","whitesmoke").attr("data-photo-number",APP.photoLeft).removeClass("noPhoto").attr("aria-label",t+" shoreline left of current location"),APP.photoNumberURL==""||APP.photoNumberURL==null?$("#centerPhoto").addClass("noPhoto").attr("aria-label","No photo available"):APP.photoLandmark!=null&&APP.photoLandmark!="Null"&&APP.photoLandmark!=""?$("#centerPhoto").css("background-image","url("+APP.photoNumberURL+")").css("background-color","whitesmoke").attr("data-photo-number",APP.photoNumber).attr("data-large-photo-url",APP.largePhotoURL).removeClass("noPhoto").attr("aria-label",APP.photoLandmark+" ("+t+")"):$("#centerPhoto").css("background-image","url("+APP.photoNumberURL+")").css("background-color","whitesmoke").attr("data-photo-number",APP.photoNumber).attr("data-large-photo-url",APP.largePhotoURL).removeClass("noPhoto").attr("aria-label","Shoreline without landmark ("+t+")"),APP.photoRightURL2==""||APP.photoRightURL2==null?$("#rightPhoto").addClass("noPhoto").attr("aria-label","No photo available"):$("#rightPhoto").css("background-image","url("+APP.photoRightURL2+")").css("background-color","whitesmoke").attr("data-photo-number",APP.photoRight).removeClass("noPhoto").attr("aria-label",t+" shoreline right of current location"),APP.photoDate!=""?APP.photoLandmark!=""?$("#photoInfo").text(APP.photoLandmark+"   ("+APP.photoDate+")"):$("#photoInfo").text(APP.photoDate):$("#photoInfo").text(APP.photoLandmark),APP.photoLeft==""||APP.photoLeft=="Null"?$("#photoNavButtonLeft").hide():$("#photoNavButtonLeft").show(),APP.photoRight==""||APP.photoRight=="Null"?$("#photoNavButtonRight").hide():$("#photoNavButtonRight").show()}else $("#leftPhoto").addClass("noPhoto"),$("#centerPhoto").addClass("noPhoto"),$("#rightPhoto").addClass("noPhoto"),$("#photoInfo").text("")})},APP.customFunctions.getRandomPhoto=function(){var n=Math.floor(Math.random()*96);switch(n){case 0:photoNumber="160729_04461";break;case 1:photoNumber="160729_04228";break;case 2:photoNumber="160714_00613";break;case 3:photoNumber="170510-05499";break;case 4:photoNumber="170510-05951";break;case 5:photoNumber="170521-07263";break;case 6:photoNumber="170521-07023";break;case 7:photoNumber="170521-07464";break;case 8:photoNumber="170522-08574";break;case 9:photoNumber="170521-07904";break;case 10:photoNumber="170522-08936";break;case 11:photoNumber="170508-01515";break;case 12:photoNumber="170510-05499";break;case 13:photoNumber="160811_07538";break;case 14:photoNumber="160811_07656";break;case 15:photoNumber="160811_07690";break;case 16:photoNumber="160818_11710";break;case 17:photoNumber="160812_08781";break;case 18:photoNumber="170606-09470";break;case 19:photoNumber="170606-09514";break;case 20:photoNumber="170606-09603";break;case 21:photoNumber="160714_00857";break;case 22:photoNumber="160811_05579";break;case 23:photoNumber="160811_05872";break;case 24:photoNumber="160811_05869";break;case 25:photoNumber="160811_07313";break;case 26:photoNumber="160812_08846";break;case 27:photoNumber="160724_01007";break;case 28:photoNumber="160724_01375";break;case 29:photoNumber="160818_11553";break;case 30:photoNumber="160725_02582";break;case 31:photoNumber="160725_02642";break;case 32:photoNumber="160724_01320";break;case 33:photoNumber="160823_14391";break;case 34:photoNumber="160729_04178";break;case 35:photoNumber="160729_04150";break;case 36:photoNumber="160724_02318";break;case 37:photoNumber="160729_04102";break;case 38:photoNumber="160729_04128";break;case 39:photoNumber="160823_13808";break;case 40:photoNumber="160729_04132";break;case 41:photoNumber="160729_04042";break;case 42:photoNumber="160729_03950";break;case 43:photoNumber="160627_00496";break;case 44:photoNumber="160823_14734";break;case 45:photoNumber="160823_14620";break;case 46:photoNumber="160729_04394";break;case 47:photoNumber="160729_04423";break;case 48:photoNumber="160729_04454";break;case 49:photoNumber="160729_04457";break;case 50:photoNumber="160729_04470";break;case 51:photoNumber="160729_04472";break;case 52:photoNumber="160729_04883";break;case 53:photoNumber="160729_04900";break;case 54:photoNumber="160729_04941";break;case 55:photoNumber="160729_05101";break;case 56:photoNumber="160729_05313";break;case 57:photoNumber="160729_05332";break;case 58:photoNumber="160729_04467";break;case 59:photoNumber="160725_03099";break;case 60:photoNumber="160818_11337";break;case 61:photoNumber="160818_11345";break;case 62:photoNumber="160805_04898";break;case 63:photoNumber="160805_05062";break;case 64:photoNumber="160805_05180";break;case 65:photoNumber="160819_12789";break;case 66:photoNumber="170508-02644";break;case 67:photoNumber="160804_04084";break;case 68:photoNumber="160729_04186";break;case 69:photoNumber="160729_04182";break;case 70:photoNumber="160823_13847";break;case 71:photoNumber="160823_14226";break;case 72:photoNumber="160729_03950";break;case 73:photoNumber="160811_07920";break;case 74:photoNumber="160823_14861";break;case 75:photoNumber="160811_07632";break;case 76:photoNumber="160812_08801";break;case 77:photoNumber="160811_07460";break;case 78:photoNumber="160811_07512";break;case 79:photoNumber="160818_11641";break;case 80:photoNumber="160818_11603";break;case 81:photoNumber="160818_10276";break;case 82:photoNumber="160819_12904";break;case 83:photoNumber="160819_13436";break;case 84:photoNumber="160819_13461";break;case 85:photoNumber="160729_04625";break;case 86:photoNumber="170521-07263";break;case 87:photoNumber="170521-07023";break;case 88:photoNumber="170521-07464";break;case 89:photoNumber="170522-08574";break;case 90:photoNumber="170521-07904";break;case 91:photoNumber="170522-08936";break;case 192:photoNumber="170508-01515";break;case 93:photoNumber="170510-05499";break;case 94:photoNumber="160729_04048";break;case 95:photoNumber="170522-09254"}return photoNumber},APP.customFunctions.setMapHeight(),APP.customFunctions.setTabIndexes=function(){$("canvas").attr("tabindex",-1).attr("focusable",!0),$("svg").attr("tabindex",-1).attr("focusable",!1),$("svg").last().attr("tabindex",0).attr("focusable",!0),$(".esri-view-surface").attr("tabindex",-1),$(".esri-attribution").removeAttr("role").removeAttr("tabindex").attr("disabled",!0),$(".esri-attribution__sources").removeAttr("role").removeAttr("tabindex").attr("disabled",!0),$(".esri-attribution__link").removeAttr("href").attr("disabled",!0)},APP.customFunctions.reorderMapElements=function(){$(".esri-component.esri-search.esri-widget").before($("#zoomFullButton")),$("#zoomFullButton").show(),$(".esri-ui").after($("#map_basemapHolder")),$("#map_basemapHolder").show()},APP.customFunctions.init=function(){var o,n,s,r,u,f;APP.startExtentAndSR=new l(-13870515,5657378,-13106757,6308621,new a({wkid:102100})),o=APP.customFunctions.getParameterByName("BBox"),o!=""?(n=o.split(","),s=new l(parseInt(n[0]),parseInt(n[1]),parseInt(n[2]),parseInt(n[3]),new a({wkid:102100})),APP.map=new t({}),APP.mapView=new i({map:APP.map,container:"mapViewDiv",extent:s})):(APP.map=new t({}),APP.mapView=new i({map:APP.map,container:"mapViewDiv",extent:APP.startExtentAndSR})),APP.basemaps=["esriTopo","bmHybrid"],r=APP.customFunctions.getParameterByName("Basemap"),APP.activeBasemap="esriTopo",(r=="esriTopo"||r=="bmHybrid")&&(APP.activeBasemap=r),APP.activeBasemap=="esriTopo"?(u=new p("https://www.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json",{id:"esriTopo",visible:!0,opacity:1}),APP.map.layers.add(u)):(u=new p("https://www.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json",{id:"esriTopo",visible:!1,opacity:1}),APP.map.layers.add(u)),APP.activeBasemap=="bmHybrid"?(f=new w({key:APP.bingKey,style:"hybrid",id:"bmHybrid",visible:!0,opacity:1}),APP.map.layers.add(f)):(f=new w({key:APP.bingKey,style:"hybrid",id:"bmHybrid",visible:!1,opacity:1}),APP.map.layers.add(f)),APP.mapView.when(function(){var n=APP.customFunctions.getParameterByName("vintage"),t;switch(n){case"1970":APP.activeLayerIndex=33;break;case"1990":APP.activeLayerIndex=30;break;case"2000":APP.activeLayerIndex=27;break;case"2006":APP.activeLayerIndex=24;break;case"2016":APP.activeLayerIndex=23;break;default:APP.activeLayerIndex=23}if(APP.dynamicMapServiceLayer=new c({url:APP.dynamicMapServiceURL,id:"dynamic",opacity:1,sublayers:[{id:23,visible:!1},{id:24,visible:!1},{id:27,visible:!1},{id:30,visible:!1},{id:33,visible:!1}]}),APP.map.layers.add(APP.dynamicMapServiceLayer),t=APP.dynamicMapServiceLayer.findSublayerById(APP.activeLayerIndex),t.visible=!0,APP.photoGraphicsLayer=new e,APP.map.layers.add(APP.photoGraphicsLayer),n=APP.customFunctions.getParameterByName("vintage"),n!="")switch(n){case"1970":$("#displayModeRadioButton_1976Photo").click();break;case"1990":$("#displayModeRadioButton_1992Photo").click().focus();break;case"2000":$("#displayModeRadioButton_2000Photo").click().focus();break;case"2006":$("#displayModeRadioButton_2006Photo").click().focus();break;case"2016":$("#displayModeRadioButton_2016Photo").click().focus();break;default:$("#displayModeRadioButton_2016Photo").click().focus()}APP.customFunctions.getParameterByName("photo")!=""?(APP.photoNumber=APP.customFunctions.getParameterByName("photo"),setTimeout("APP.customFunctions.setObliquePhoto(APP.photoNumber)",1e3)):(APP.photoNumber=APP.customFunctions.getRandomPhoto(),setTimeout("APP.customFunctions.setObliquePhoto(APP.photoNumber)",1e3)),setTimeout("APP.customFunctions.reorderMapElements()",500),setTimeout("APP.customFunctions.setTabIndexes()",500)}),it(window,"resize",function(){APP.customFunctions.setMapHeight()})},APP.customFunctions.init(),APP.mapView!=null?ut():APP.mapView.then(function(){$(document).ready(ut)})})