var reloadTimer;
var webMapAppLeftPanelWidth=0;
var webMapAppToggleWidth=10;
var webMapAppTopBannerHeight=200;
var newLoad=false;
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 webMapAppSpacerDiv=null;
var webMapAppPanelBottomSlider=null;
var webMapAppScaleBar=null;
var webMapAppCopyrightText=null;
var webMapAppWindowWidth=500;
var webMapAppLeftOffsetX=0;
var webMapAppRightOffsetX=0;
var webMapAppDefaultMinDockWidth=125;
var webMapAppMinDockWidth=webMapAppDefaultMinDockWidth;
var webMapAppMapLeft=0;
var webMapAppHasScroll=false;
var webMapAppLastHasScroll=false;
var webMapAppFirstScalebarPosition=true;
var webMapAppDockMoving=false;
var m_measureToolbarId="";
var resultsHeight=142;
var resultsMode="small";
var webBackground=null;
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");
webMapAppPanelSlider=document.getElementById("PanelSlider");
webMapAppPanelDisplayTableCell=document.getElementById("LeftPanelTableCell");
webMapAppPanelBottomSlider=document.getElementById("PanelSliderBottom");
webMapAppScaleBar=document.getElementById("ScaleBar1");
webMapAppCopyrightText=document.getElementById("CopyrightTextHolder");
webBackground=document.getElementById("BackDiv");
var _1=document.getElementById("PageHeader");
var _2=document.getElementById("LinkBar");
webMapAppPanelScrollDiv.style.overflowY="auto";
if(isIE){
webMapAppPanelDisplay.style.overflow="hidden";
}
webMapAppLeftPanelWidth=webMapAppPanelDisplay.clientWidth;
webMapAppToggleWidth=parseInt(webMapAppToggleDisplay.style.width);
webMapAppTopBannerHeight=_1.clientHeight+_2.clientHeight;
var _3=getWinWidth();
var _4=getWinHeight();
var _5=_3-webMapAppLeftPanelWidth-webMapAppToggleWidth;
var _6=_4-webMapAppTopBannerHeight;
webMapAppMapLeft=webMapAppLeftPanelWidth+webMapAppToggleWidth;
webMapAppMapDisplay.style.width=_5+"px";
webMapAppMapDisplay.style.height=_6+"px";
var _7=_3-250;
if(document.getElementById("MapAerialVisible").style.display=="none"){
_7=_3-200;
}
webBackground.style.left=_7+"px";
if(webMapAppScaleBar!=null){
positionScalebar();
}
if(webMapAppCopyrightText!=null){
webMapAppCopyrightText.onmousedown=webMapAppGetCopyrightText;
var _8=webMapAppCopyrightText.clientHeight;
webMapAppCopyrightText.style.left=(webMapAppMapLeft+10)+"px";
webMapAppCopyrightText.style.top=(_4-_8-10)+"px";
}
webMapAppToggleDisplay.style.height=_6+"px";
webMapAppPanelScrollDiv.style.height=_6+"px";
esriMaxFloatingPanelDragRight=_3-15;
esriMaxFloatingPanelDragBottom=_4-15;
document.getElementById("ExportFloatingPanel").style.left="-500px";
document.getElementById("ExportFloatingPanel").style.top="-500px";
document.getElementById("FloatGeneralSearch").style.left="-500px";
document.getElementById("FloatGeneralSearch").style.top="-500px";
document.getElementById("FloatingPanelSelectableLayers").style.left="-500px";
document.getElementById("FloatingPanelSelectableLayers").style.top="-500px";
document.getElementById("FloatingPanel1").style.top="-500px";
document.getElementById("FloatingPanel1").style.left="-500px";
document.getElementById("FloatSearch").style.top="-500px";
document.getElementById("FloatSearch").style.left="-500px";
document.getElementById("FloatingPanelBuffer").style.left="-500px";
document.getElementById("FloatingPanelBuffer").style.top="-500px";
document.getElementById("FloatingPanelGeocode").style.left="-500px";
document.getElementById("FloatingPanelGeocode").style.top="-500px";
document.getElementById("FloatingPanelPlotLatLong").style.left="-500px";
document.getElementById("FloatingPanelPlotLatLong").style.top="-500px";
document.getElementById("FloatingPanelDisplayLatLong").style.top="-500px";
document.getElementById("FloatingPanelDisplayLatLong").style.left="-500px";
document.getElementById("FloatingPanelAddText").style.top="-500px";
document.getElementById("FloatingPanelAddText").style.left="-500px";
document.getElementById("FloatingPanelLocationSearch").style.top="-500px";
document.getElementById("FloatingPanelLocationSearch").style.left="-500px";
document.getElementById("resultsFrame").src="results.aspx";
};
function togglePanelDock(){
};
function expandPanelDock(){
};
function collapsePanelDock(){
};
function AdjustMapSize(){
webMapAppPanelDisplay.style.width=webMapAppLeftPanelWidth+"px";
webMapAppToggleDisplay.style.width=webMapAppToggleWidth+"px";
var _9=getWinWidth();
var _a=getWinHeight();
var _b=_9-webMapAppPanelDisplayCell.clientWidth;
var _c=_a-webMapAppTopBannerHeight;
if(_b<5){
_b=5;
}
if(_c<5){
_c=5;
}
webMapAppMapDisplay.style.width=_b+"px";
webMapAppMapDisplay.style.left=webMapAppPanelDisplayCell.clientWidth+"px";
webMapAppMapDisplay.style.height=_c+"px";
webMapAppToggleDisplay.style.height=_c+"px";
webMapAppPanelScrollDiv.style.height=_c+"px";
if(document.getElementById("MapAerialVisible").style.display=="none"){
webBackground.style.left=(_9-200)+"px";
}else{
webBackground.style.left=(_9-250)+"px";
}
document.getElementById("FloatingPanel1").style.left=(_9-300)+"px";
if(webMapAppScaleBar!=null){
var _d=webMapAppScaleBar.clientWidth;
var _e=webMapAppScaleBar.clientHeight;
if(webMapAppFirstScalebarPosition){
window.setTimeout("positionScalebar();",1000);
webMapAppFirstScalebarPosition=false;
}else{
positionScalebar();
}
}
window.setTimeout("resizeTheMap("+_b+", "+_c+", false);",500);
var _f=calcElementPosition("Map_Panel");
map.containerLeft=_f.left;
map.containerTop=_f.top;
if(webMapAppCopyrightText!=null){
var _10=webMapAppCopyrightText.clientHeight;
webMapAppCopyrightText.style.left=(_f.left+10)+"px";
webMapAppCopyrightText.style.top=(_a-_10-10)+"px";
}
return false;
};
function resizeTheMap(_11,_12,_13){
if(_13==null){
_13=true;
}
map.checkMapsize();
return false;
};
function AdjustMapSizeHandler(e){
window.clearTimeout(reloadTimer);
reloadTimer=window.setTimeout("AdjustMapSize();",1000);
};
function startUp(){
Sys.Application.add_init(initializeApp);
};
function initializeApp(){
map=$find("Map1");
map.ctrlMode="MapIdentify";
map.ctrlAction="Point";
map.ctrlCursor="pointer";
map.ctrlFunction="MapIdClick(e)";
map.add_onProgress(customLoading);
if(newLoad){
var box=calcElementPosition("Map_Panel");
var mag=document.getElementById("Magnifier0");
if(mag!=null&&typeof (esriMagnifiers)!="undefined"&&esriMagnifiers!=null){
mag.style.left="100px";
mag.style.top="150px";
}
var tb=document.getElementById(m_measureToolbarId);
if(tb!=null){
tb.style.left=box.left+"px";
tb.style.top=box.top+"px";
}
}
window.onresize=AdjustMapSizeHandler;
var _14=$find("Results_TaskResults1");
_14.add_taskResultNodeInserted(function(){
expandFloatingPanel("Results");
});
};
function startWebMapAppDockDrag(e){
return false;
};
function moveWebMapAppDockDrag(e){
return false;
};
function stopWebMapAppDocDrag(e){
return false;
};
function CloseOut(){
var _15="ControlID=Map1&ControlType=Map&EventArg=CloseOutApplication";
var _16=map.controlName;
eval(webMapAppCloseCallback);
};
function CloseOutResponse(_17,_18){
window.close();
document.location=_17;
};
function OpenWindow(url){
window.open(url);
};
function webMapAppCheckPanelScroll(){
};
function webMapAppCheckPanelWidths(){
var _19=0;
var _1a;
for(var i=0;i<webMapAppPanelDisplay.childNodes.length;i++){
if(webMapAppPanelDisplay.childNodes[i].tagName=="TABLE"){
_1a=webMapAppPanelDisplay.childNodes[i];
if(_1a.clientWidth>_19){
_19=_1a.clientWidth;
}
}
}
webMapAppPanelDisplay.style.width=_19+"px";
return false;
};
function webMapAppGetCopyrightText(){
var _1b="ControlID=Map1&ControlType=Map&EventArg=GetCopyrightText";
var _1c=map.controlName;
eval(webMapAppCopyrightCallback);
showFloatingPanel("CopyrightText_Panel");
};
function scrollDockToPanel(_1d){
if(_1d==null){
return;
}
var _1e=_1d.offsetTop;
webMapAppPanelScrollDiv.scrollTop=_1e;
};
function toggleMagnifier(){
var _1f=0;
var _20=document.getElementById("magMapChooserddlMapServiceDropDownBox").value;
while(_1f<MapServiceCount){
if(_1f==_20){
var mag=document.getElementById("Magnifier"+_20);
if(mag!=null){
toggleFloatingPanelVisibility("Magnifier"+_20);
if(mag.style.display!="none"){
document.getElementById("magMapChooser").style.left=(52+parseInt(mag.style.left.substring(0,mag.style.left.length-2)))+"px";
document.getElementById("magMapChooser").style.top=(212+parseInt(mag.style.top.substring(0,mag.style.top.length-2)))+"px";
}else{
document.getElementById("magMapChooser").style.left="-1000px";
document.getElementById("magMapChooser").style.top="-1000px";
setPanTool();
}
}else{
alert("Magnifier is not available");
}
}
_1f=_1f+1;
}
};
function positionScalebar(){
var _21=getWinWidth();
var _22=getWinHeight();
var _23=webMapAppScaleBar.clientWidth;
var _24=webMapAppScaleBar.clientHeight;
webMapAppScaleBar.style.left=(_21-_23-10)+"px";
webMapAppScaleBar.style.top=(_22-_24-25)+"px";
};
function GetElementRectangle(_25){
var _26=null;
if(isIE){
_26=_25.getBoundingClientRect();
}else{
var _27=Sys.UI.DomElement.getBounds(_25);
_26={"left":_27.x,"top":_27.y,"right":_27.x+_27.width,"bottom":_27.y+_27.height};
}
return _26;
};


