function IncludeJavaScript(a){document.write('<script type="text/javascript" src="'+a+'"><\/script>')}IncludeJavaScript("Shared_Javascript/MapInteractionCommon.js");IncludeJavaScript("Shared_Javascript/LJA_Map.js");IncludeJavaScript("Shared_Javascript/LJA_MapIdentify.js");IncludeJavaScript("Shared_Javascript/LJA_Search.js");IncludeJavaScript("Shared_Javascript/LJA_TaskResult.js");IncludeJavaScript("Shared_Javascript/LJA_Toolbar.js");IncludeJavaScript("Shared_Javascript/LJA_ZoomLevel.js");var reloadTimer;var newLoad=false;var webMapAppLeftPanelWidth=272;var webMapAppToggleWidth=10;var webMapAppTopBannerHeight=100;var webMapAppCloseCallback="";var webMapAppCopyrightCallback="";var webMapAppMoveFunction=null;var webMapAppMapDisplay=null;var webMapAppPanelDisplay=null;var webMapAppPanelDisplayCell=null;var webMapAppPanelDisplayTableCell=null;var webMapAppPanelScrollDiv=null;var webMapAppToggleDisplay=null;var webMapAppToggleHoverDisplay=null;var webMapAppSpacerDiv=null;var webMapAppPanelBottomSlider=null;var webMapAppCopyrightText=null;var webMapAppWindowWidth=500;var webMapAppLeftOffsetX=0;var webMapAppRightOffsetX=0;var webMapAppDefaultMinDockWidth=260;var webMapAppMinDockWidth=webMapAppDefaultMinDockWidth;var webMapAppMaxDockWidth=null;var webMapAppMapLeft=272;var webMapAppHasScroll=false;var webMapAppLastHasScroll=false;var webMapAppFirstScalebarPosition=true;var webMapAppDockMoving=false;var webMapAppWindowHeight=0;var m_measureToolbarId="";var m_resTrans;var m_navTimeout;var showPanel=0;var lastPanelId=null;var firstTilePending=false;var firstLoadInterval=null;var mapPageSideMarginLeft=8;var mapPageSideMarginRight=8;var mapPageBottomMargin=8;var bottomTextArea=17;var pageMinWidth=800;var leftPanelContentBuffer=5;var firstLeftHeaderHeight=42;var PageTaskResultsId=null;var PageTaskResultsContainer=null;var map=$find("Map1");function fixZoomLevelControl(){if(zoomlevelfixed){window.clearInterval(zoomlevelfixEventId)}else{zoomlevelfixEventId=window.setInterval("fixZoomLevel",30)}}function fixZoomLevel(){var a=$find("ZoomLevel1");if(a!=null){if(a._map==null){map=$find("Map1");a._map=map;zoomlevelfixed=true}}}function setPageElementSizes(){if(document.documentElement){document.documentElement.style.overflow="hidden";document.documentElement.style.height="100%"}else{document.body.style.overflow="hidden";document.body.style.height="100%"}webMapAppMapDisplay=document.getElementById("Map_Panel");webMapAppPanelDisplay=document.getElementById("LeftPanelCellDiv");webMapAppPanelDisplayCell=document.getElementById("LeftPanelCell");webMapAppPanelScrollDiv=document.getElementById("LeftPanelScrollDiv");webMapAppToggleDisplay=document.getElementById("ToggleCell");webMapAppToggleHoverDisplay=document.getElementById("ToggleCellHover");webMapAppPanelSlider=document.getElementById("PanelSlider");webMapAppPanelDisplayTableCell=document.getElementById("LeftPanelTableCell");webMapAppPanelBottomSlider=document.getElementById("PanelSliderBottom");var h=document.getElementById("PageHeader");var f=document.getElementById("LinkBar");sliderElement=document.getElementById("slider");webMapAppLeftPanelWidth=webMapAppPanelDisplay.clientWidth;webMapAppToggleWidth=parseInt(webMapAppToggleDisplay.style.width);webMapAppTopBannerHeight=h.clientHeight;var b=getWinWidth();var e=getWinHeight();var i=parseInt(document.body.style.marginLeft)+parseInt(document.body.style.marginRight);webMapAppPanelDisplayCell.style.left=mapPageSideMarginLeft+"px";var d=b-webMapAppLeftPanelWidth-webMapAppToggleWidth-2-i-mapPageSideMarginLeft-mapPageSideMarginRight-2;var c=e-webMapAppTopBannerHeight-mapPageBottomMargin-2-bottomTextArea;webMapAppMapLeft=webMapAppLeftPanelWidth+webMapAppToggleWidth;webMapAppMapDisplay.style.width=d+"px";webMapAppMapDisplay.style.height=c+"px";var g=c+2;var a=g-10;webMapAppToggleDisplay.style.height=g+"px";webMapAppToggleHoverDisplay.style.height=a+"px";webMapAppPanelScrollDiv.style.height=g+"px";esriMaxFloatingPanelDragRight=b-15;esriMaxFloatingPanelDragBottom=e-15;webMapAppWindowWidth=getWinWidth();webMapAppWindowHeight=getWinHeight()}function AdjustMapSizeHandler(a){window.clearTimeout(reloadTimer);if(webMapAppWindowWidth!=getWinWidth()||webMapAppWindowHeight!=getWinHeight()){reloadTimer=window.setTimeout("AdjustMapSize();",1000)}}function AdjustMapSize(){webMapAppPanelDisplay.style.width=webMapAppLeftPanelWidth+"px";webMapAppToggleDisplay.style.width=webMapAppToggleWidth+"px";var d=getWinWidth();var c=getWinHeight();if(d<pageMinWidth){if(document.documentElement){document.documentElement.style.overflowX="auto";document.documentElement.style.width=pageMinWidth+"px";document.body.style.width=pageMinWidth+"px";document.body.style.position="relative";d=pageMinWidth}}else{if(document.documentElement){document.documentElement.style.overflowX="hidden";document.documentElement.style.width="";document.body.style.width="";document.body.style.position=""}}var b=d-webMapAppPanelDisplayCell.clientWidth-mapPageSideMarginLeft-mapPageSideMarginRight-2;var g=c-webMapAppTopBannerHeight-mapPageBottomMargin-2-bottomTextArea;if(b<5){b=5}if(g<5){g=5}webMapAppMapDisplay.style.width=b+"px";var f=webMapAppPanelDisplayCell.clientWidth+mapPageSideMarginLeft;webMapAppMapDisplay.style.left=f+"px";webMapAppMapDisplay.style.height=g+"px";var e=g+2;var a=e-10;setLeftContentSize(e,"WelcomeHeader",null,"WelcomeContentScroll",null,null);setLeftContentSize(e,"LayersHeader",null,"LayersContentScroll",null,null);setLeftContentSize(e,"PropSearchHeader","PropSearchXtra","PropSearchContentScroll",67,30);setLeftContentSize(e,"SearchHeader",null,"SearchResultsContentScroll",null,null);setLeftContentSize(e,"MeasureHeader",null,"MeasureContentScroll",null,null);setLeftContentSize(e,"DemographicHeader",null,"DemographicContentScroll",null,null);setLeftContentSize(e,"EmailSimpleHeader",null,"EmailSimpleContentScroll",null,null);webMapAppToggleDisplay.style.height=e+"px";webMapAppToggleHoverDisplay.style.height=a+"px";webMapAppPanelScrollDiv.style.height=e+"px";window.setTimeout("resizeTheMap("+b+", "+g+", false);",500);webMapAppWindowWidth=getWinWidth();webMapAppWindowHeight=getWinHeight();return false}function setLeftContentSize(c,k,e,a,d,h){var j=document.getElementById(k);var l=document.getElementById(a);var f=null;if(e!=null){f=document.getElementById(e)}if(j==null||l==null){return}var b=0;var g=0;var i;if(j.style.display!="none"){b=j.offsetHeight;if(b==0){if(d!=null){b=d}else{b=firstLeftHeaderHeight}}i=c-b-leftPanelContentBuffer}else{i=c-b}if(f!=null){g=f.offsetHeight;if(g==0){if(h!=null){g=h}}i-=g}if(i<0){i=0}l.style.height=i+"px"}function resizeTheMap(c,a,b){map=$find("Map1");if(b==null){b=true}map.resize(c,a,b);map.refresh();return false}function SetTocFullHeight(d){var a=d-40;var b=document.getElementById("Toc_Panel_BodyCell");var c=document.getElementById("Toc_Panel_SideResizeCell");b.style.height=a+"px";c.height=a+"px"}function setFirstCenter(){var a=document.getElementById("TextArea1");if(typeof ljaFirstCenter!="undefined"){if(a){a.innerText=ljaFirstCenter}}}function ClearLeftPanels(){var a=document.getElementById("LeftPanelCellDiv");var c=a.childNodes;for(var b=0;b<c.length;b++){if(c[b].tagName=="DIV"){c[b].style.display="none"}}}function ShowPanel(a){map=$find("Map1");if(map!=null&&!IsPanelVisible(a)){map._clearVectorGraphics()}var b=document.getElementById(a);if(b!=null){ShowPanelWithAction(a,false)}}function IsPanelVisible(a){var b="SearchResults,Welcome,Demographic,EmailSimple,Layers,PropSearch,Measure";var d=b.split(",");for(var e=0;e<d.length;e++){var c=d[e];if(c!=a){continue}var f=document.getElementById(a);var g=f.style.display;if(g=="none"){return false}else{return true}break}}function ShowPanelWithAction(a,d){var c=document.getElementById(a);if(c!=null){ClearLeftPanels();c.style.display="";if(webMapAppPanelDisplay.style.display=="none"){expandPanelDock()}var e="ControlID=Map1&ControlType=Map&EventArg=PanelLayers&Value="+a+"&LastID="+lastPanelId+"&WithAction="+d;var b=this;ReturnInvocation(e,b);lastPanelId=a}}function ShowPropSearchPanel(g,b,d){var h=document.getElementById(g);if(h!=null){var f=document.getElementById("LeftPanelPropertySearch");var c=f.childNodes;for(var e=0;e<c.length;e++){if(c[e].tagName=="DIV"){c[e].style.display="none"}}h.style.display=""}var j="ControlID=Map1&ControlType=Map&EventArg=PanelPropSearch&Value="+d;var a=this;ReturnInvocation(j,a)}function togglePanelDock(){if(webMapAppPanelDisplay.style.display=="none"){expandPanelDock()}else{collapsePanelDock()}}function expandPanelDock(){var a=document.images.CollapseImage;webMapAppPanelDisplay.style.display="block";a.src="Shared_Images/arrow_left.gif";a.alt="Collapse";webMapAppMapLeft=webMapAppLeftPanelWidth+webMapAppToggleWidth;webMapAppMapDisplay.style.left=webMapAppMapLeft+"px";AdjustMapSize()}function collapsePanelDock(){var a=document.images.CollapseImage;dockWidthString=webMapAppPanelDisplayCell.clientWidth+"px";webMapAppPanelDisplay.style.display="none";a.src="Shared_Images/arrow_right.gif";a.alt="Expand";webMapAppMapLeft=webMapAppToggleWidth;webMapAppMapDisplay.style.left=webMapAppMapLeft+"px";AdjustMapSize()}function startWebMapAppDockDrag(b){if(!webMapAppDockMoving){webMapAppMoveFunction=document.onmousemove;webMapAppDockMoving=true}document.onmouseup=stopWebMapAppDocDrag;map.divObject.style.cursor="e-resize";map._containerDiv.style.cursor="e-resize";webMapAppPanelDisplayTableCell.style.cursor="e-resize";webMapAppWindowWidth=getWinWidth();webMapAppMaxDockWidth=webMapAppWindowWidth/2;getXY(b);if(webMapAppPanelDisplay.style.display=="none"){webMapAppLeftOffsetX=mouseX}else{webMapAppLeftOffsetX=mouseX-webMapAppPanelDisplay.clientWidth}var a=calcElementPosition("Map_Panel");webMapAppRightOffsetX=a.left-mouseX;document.onmousemove=moveWebMapAppDockDrag;webMapAppMinDockWidth=webMapAppDefaultMinDockWidth;webMapAppToggleHoverDisplay.style.display="";return false}function moveWebMapAppDockDrag(d){getXY(d);var a=(isIE)?event.button:d.which;if(a==0){stopWebMapAppDocDrag(d)}if(mouseX>webMapAppMinDockWidth&&mouseX<webMapAppMaxDockWidth){webMapAppLeftPanelWidth=mouseX-webMapAppLeftOffsetX;var c=getWinWidth();if(webMapAppLeftPanelWidth>c-webMapAppToggleDisplay.clientWidth-2){webMapAppLeftPanelWidth=c-webMapAppToggleDisplay.clientWidth-2}var b=webMapAppLeftPanelWidth;if(webMapAppLeftPanelWidth<webMapAppMinDockWidth){webMapAppLeftPanelWidth=webMapAppMinDockWidth-1;b=0}if(webMapAppLeftPanelWidth>webMapAppMaxDockWidth){webMapAppLeftPanelWidth=webMapAppMinDockWidth+1;b=webMapAppMaxDockWidth}webMapAppToggleHoverDisplay.style.left=b+"px"}return false}function stopWebMapAppDocDrag(a){document.onmousemove=webMapAppMoveFunction;document.onmouseup=null;webMapAppDockMoving=false;if(webMapAppPanelDisplay.style.display=="none"){expandPanelDock()}if(webMapAppLeftPanelWidth<webMapAppMinDockWidth){collapsePanelDock();webMapAppLeftPanelWidth=webMapAppMinDockWidth}if(webMapAppLeftPanelWidth>webMapAppMaxDockWidth){webMapAppLeftPanelWidth=webMapAppMaxDockWidth}webMapAppToggleHoverDisplay.style.display="none";webMapAppPanelDisplayTableCell.style.cursor="";map.divObject.style.cursor=map.get_cursor();map._containerDiv.style.cursor=map.get_cursor();webMapAppCheckPanelWidths();webMapAppToggleHoverDisplay.style.left="";AdjustMapSize();return false}function webMapAppCheckPanelWidths(){var c=0;var b;for(var a=0;a<webMapAppPanelDisplay.childNodes.length;a++){if(webMapAppPanelDisplay.childNodes[a].tagName=="TABLE"){b=webMapAppPanelDisplay.childNodes[a];if(b.clientWidth>c){c=b.clientWidth}}}if(c>0){webMapAppPanelDisplay.style.width=c+"px"}return false}function scrollDockToPanel(b){if(b==null){return}var a=b.offsetTop;webMapAppPanelScrollDiv.scrollTop=a}function ToggleCenter(){var a=document.getElementById("CenterPoint");if(a.style.display=="none"){a.style.display=""}else{a.style.display="none"}}function FullExtent(){var b="ControlID=Map1&ControlType=Map&EventArg=FullExtent";var a=this;ReturnInvocation(b,a)}function ZoomIn(){var b="ControlID=Map1&ControlType=Map&EventArg=ZoomIn";var a=this;ReturnInvocation(b,a)}function ZoomOut(){var b="ControlID=Map1&ControlType=Map&EventArg=ZoomOut";var a=this;ReturnInvocation(b,a)}function CenterAt(c){getXY(c);var b="ControlID=Map1&ControlType=Map&EventArg=CenterAt&X="+mouseX+"&Y="+mouseY;var a=this;ReturnInvocation(b,a)}function CenterMap(a,d){var c="ControlID=Map1&ControlType=Map&EventArg=CenterMapServer&X="+a+"&Y="+d;var b=this;ReturnInvocation(c,b)}function ZoomToPoint(a,f,e,c){var d="ControlID=Map1&ControlType=Map&EventArg=ZoomTo&X="+a+"&Y="+f+"&Scale="+e+"&Type="+c;var b=this;ReturnInvocation(d,b)};
