/*

  OpenLayers.js -- OpenLayers Map Viewer Library

  Copyright 2005-2008 MetaCarta, Inc., released under the Clear BSD license.
  Please see http://svn.openlayers.org/trunk/openlayers/license.txt
  for the full text of the license.

  Includes compressed code under the following licenses:

  (For uncompressed versions of the code used please see the
  OpenLayers SVN repository: <http://openlayers.org/>)

*/

/* Contains portions of Prototype.js:
 *
 * Prototype JavaScript framework, version 1.4.0
 *  (c) 2005 Sam Stephenson <sam@conio.net>
 *
 *  Prototype is freely distributable under the terms of an MIT-style license.
 *  For details, see the Prototype web site: http://prototype.conio.net/
 *
 *--------------------------------------------------------------------------*/

/**  
*  
*  Contains portions of Rico <http://openrico.org/>
* 
*  Copyright 2005 Sabre Airline Solutions  
*  
*  Licensed under the Apache License, Version 2.0 (the "License"); you
*  may not use this file except in compliance with the License. You
*  may obtain a copy of the License at
*  
*         http://www.apache.org/licenses/LICENSE-2.0  
*  
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
*  implied. See the License for the specific language governing
*  permissions and limitations under the License. 
*
**/

/**
 * Contains XMLHttpRequest.js <http://code.google.com/p/xmlhttprequest/>
 * Copyright 2007 Sergey Ilinsky (http://www.ilinsky.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 */

/**
 * Contains portions of Gears <http://code.google.com/apis/gears/>
 *
 * Copyright 2007, Google Inc.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *  1. Redistributions of source code must retain the above copyright notice,
 *     this list of conditions and the following disclaimer.
 *  2. Redistributions in binary form must reproduce the above copyright notice,
 *     this list of conditions and the following disclaimer in the documentation
 *     and/or other materials provided with the distribution.
 *  3. Neither the name of Google Inc. nor the names of its contributors may be
 *     used to endorse or promote products derived from this software without
 *     specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * Sets up google.gears.*, which is *the only* supported way to access Gears.
 *
 * Circumvent this file at your own risk!
 *
 * In the future, Gears may automatically define google.gears.* without this
 * file. Gears may use these objects to transparently fix bugs and compatibility
 * issues. Applications that use the code below will continue to work seamlessly
 * when that happens.
 */
﻿
var xBump=10;var yBump=10;var MSIE=document.all;var NS6=document.getElementById&&!document.all;var ToolTipObj=null;var ttipClassName="ToolTipsCls";var tipLayerId="ttip";var tipLayer="<div id=\""+tipLayerId+"\" style=\"display:none;position:absolute;max-width:200px;z-index:1000;border: 1px solid #cccccc;\" class=\""+ttipClassName+"\"><\/div>";var parentLayer=null;NgToolTips=function(cssClassName){this.tipLayerId=tipLayerId;if(cssClassName!=null&&cssClassName.length>0){this.TipLayer=tipLayer.split("ToolTipsCls").join(cssClassName);ttipClassName=cssClassName;}
else{this.TipLayer=tipLayer;}
this.TipLayer=tipLayer.split(tipLayerId).join(this.tipLayerId);document.write(this.TipLayer);if(MSIE||NS6){ToolTipObj=document.all?document.all[tipLayerId]:document.getElementById?document.getElementById(tipLayerId):"";}
NgToolTips.prototype.ShowTip=function(ttipText){var ddl=null;if(ttipText!=null){ddl=document.all?document.all[ttipText]:document.getElementById?document.getElementById(ttipText):"";}
if(ToolTipObj==null){ToolTipObj=document.all?document.all[tipLayerId]:document.getElementById?document.getElementById(tipLayerId):"";}
if(ddl!=null&&ddl.tagName=='SELECT'){if(ddl.options.length>0){if(ddl.options[ddl.selectedIndex].text.length>0){ToolTipObj.className=ttipClassName;ToolTipObj.innerHTML=ddl.options[ddl.selectedIndex].text;if(MSIE){ToolTipObj.style.display="block";}
else{ddl.title=ddl.options[ddl.selectedIndex].text;}}}}
return false;}
NgToolTips.prototype.ShowToolTip=function(ttipText,cssClass,elemId){var _elemId=null;if(elemId!=null){_elemId=document.all?document.all[elemId]:document.getElementById?document.getElementById(elemId):"";}
if(_elemId!=null&&_elemId!='undefined'){if(ToolTipObj==null){ToolTipObj=document.all?document.all[tipLayerId]:document.getElementById?document.getElementById(tipLayerId):"";}
ToolTipObj.className=cssClass;ToolTipObj.innerHTML=ttipText;ToolTipObj.style.display="block";return false;}}
NgToolTips.prototype.HideTip=function(){if(ToolTipObj==null){ToolTipObj=document.all?document.all[tipLayerId]:document.getElementById?document.getElementById(tipLayerId):"";}
if(MSIE||NS6){ToolTipObj.style.display="none";ToolTipObj.innerText="";}}
function MSIEBodyReturn(){return(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;}
NgToolTips.prototype.MoveToolTip=function(e){MoveTip(e);}
function MoveTip(e){if(!e)
e=window.event;var RTL=null;if(window.htmlDir){if(window.htmlDir=="RTL")
RTL=true;}
try{if(RTL)
xPos=(NS6)?e.pageX:event.x;else
xPos=(NS6)?e.pageX:event.x+MSIEBodyReturn().scrollLeft;yPos=(NS6)?e.pageY:event.y+MSIEBodyReturn().scrollTop;lEdge=(xBump<0)?xBump*(-1):-1000;rEdge=MSIE&&!window.opera?MSIEBodyReturn().clientWidth-event.clientX-xBump:window.innerWidth-e.clientX-xBump-20;bEdge=MSIE&&!window.opera?MSIEBodyReturn().clientHeight-event.clientY-yBump:window.innerHeight-e.clientY-yBump-20;if(rEdge<ToolTipObj.offsetWidth){if(RTL)
ToolTipObj.style.left=MSIE?event.clientX-ToolTipObj.offsetWidth+"px":e.clientX-ToolTipObj.offsetWidth+"px";else
ToolTipObj.style.left=MSIE?MSIEBodyReturn().scrollLeft+event.clientX-ToolTipObj.offsetWidth+"px":window.pageXOffset+e.clientX-ToolTipObj.offsetWidth+"px";}
else if(xPos<lEdge){ToolTipObj.style.left=xBump+"px";}
else{var ToolTipObjLeft=xPos+xBump;if(window.htmlDir&&htmlDir=="RTL"&&m_ie5){var offsetL=document.body.offsetWidth-document.body.scrollWidth;if(offsetL<0){ToolTipObjLeft+=offsetL*2;}}
ToolTipObj.style.left=ToolTipObjLeft+"px";}
if(bEdge<ToolTipObj.offsetHeight){ToolTipObj.style.top=MSIE?MSIEBodyReturn().scrollTop+event.clientY-ToolTipObj.offsetHeight-yBump+"px":window.pageYOffset+e.clientY-ToolTipObj.offsetHeight-yBump+"px";}
else{ToolTipObj.style.top=yPos+yBump+"px";}}catch(e){}}}
﻿var g_map2D;var g_GSIgnoreBoundsChange=true;var g_hostInCustomGSMapTab=false;var markersArray=[];function ShowGSPluginMap(hostInCustomMapTab,showSelections){var onPointSetting=GetOnPointSettings(null);if(onPointSetting!=null){var mapCtrlId=onPointSetting.id;var mapDiv=onPointSetting.divId;ShowHideControlsForPluginMaps(JsMapView.STREET);if(window.g_map2D!=null){try{window.g_map2D.Dispose();}catch(e){Console.error(String.format('{0}:{1}| window.g_map2D.Dispose() error - {2}','GSPlugin.js','ShowGSPluginMap',e.message));}}
var currentCenter=new google.maps.LatLng(onPointSetting.curCenterLat,onPointSetting.curCenterLon);var mapOptions={center:currentCenter,zoom:0,mapTypeId:google.maps.MapTypeId.ROADMAP,disableDefaultUI:true,streetViewControl:true,navigationControl:true,navigationControlOptions:{position:google.maps.ControlPosition.TOP_LEFT,style:google.maps.NavigationControlStyle.ZOOM_PAN}};g_hostInCustomGSMapTab=hostInCustomMapTab;if(hostInCustomMapTab){var holderDiv=document.getElementById('ctmMapTabUseDiv');if(holderDiv!=null){holderDiv.setAttribute('class','btnViewBarBg');holderDiv.setAttribute('className','btnViewBarBg');var btnRoads=CreateButton('btnRoads','btnRoads',JsMapViewLanguageConstants.ROADS,'btnViewBar');btnRoads.onclick=function(){ToggleGESubMapTab(true,JsMapView.ROADS);}
holderDiv.appendChild(btnRoads);var btnSatellite=CreateButton('btnSatellite','btnSatellite',JsMapViewLanguageConstants.SATELLITE,'btnViewBar');btnSatellite.onclick=function(){ToggleGESubMapTab(true,JsMapView.SATELLITE);}
holderDiv.appendChild(btnSatellite);var btnHybrid=CreateButton('btnHybrid','btnHybrid',JsMapViewLanguageConstants.HYBRID,'btnViewBar');btnHybrid.onclick=function(){ToggleGESubMapTab(true,JsMapView.HYBRID);}
holderDiv.appendChild(btnHybrid);var btnTerrain=CreateButton('btnTerrain','btnTerrain',JsMapViewLanguageConstants.TERRAIN,'btnViewBar');btnTerrain.onclick=function(){ToggleGESubMapTab(true,JsMapView.TERRAIN);}
holderDiv.appendChild(btnTerrain);if((typeof google!='undefined'&&google.loader.KeyVerified)&&(!(window.g_allowGMAPViewBar&&window.g_allowGMAPEarthBtn==false)))
{var btnGoogleEarth=CreateButton('btnGoogleEarth','btnGoogleEarth',JsMapViewLanguageConstants.EARTH,'btnViewBar');btnGoogleEarth.onclick=function(){ToggleGESubMapTab(true,JsMapView.EARTH);}
holderDiv.appendChild(btnGoogleEarth);}
if(!(window.g_allowGMAPViewBar&&window.g_allowGMAPStreetViewBtn==false)){var btnStreet=CreateButton('btnStreet','btnStreet',JsMapViewLanguageConstants.STREET,'btnViewBar');btnStreet.setAttribute('class','btnViewBarSelected');btnStreet.setAttribute('className','btnViewBarSelected');holderDiv.appendChild(btnStreet);}}}
var div=document.getElementById(mapDiv);g_map2D=new google.maps.Map(div,mapOptions);var southWest=new google.maps.LatLng(onPointSetting.currentExtentSouthLat,onPointSetting.currentExtentWestLon);var northEast=new google.maps.LatLng(onPointSetting.currentExtentNorthLat,onPointSetting.currentExtentEastLon);var bounds=new google.maps.LatLngBounds(southWest,northEast);g_map2D.fitBounds(bounds);var currentZoom=g_map2D.getZoom();g_map2D.setZoom(currentZoom+1);google.maps.event.addListener(g_map2D,'center_changed',function(){handleBoundsChanged();});google.maps.event.addListener(g_map2D,'zoom_changed',function(){handleBoundsChanged();});google.maps.event.addListener(g_map2D,'click',function(){if(infoBox!=null){infoBox.close();}});g_GSIgnoreBoundsChange=true;if(showSelections){setMarkers(g_map2D);}
if(NgGetElementById(_BoxStreetView)!=null){ShowLayer(_BoxStreetView,null,null);ShowStreeView(onPointSetting.curCenterLat,onPointSetting.curCenterLon);}
InitializeLyrMgr('lmTree',onPointSetting.mapSrcId,mapCtrlId,'');if(onPointSetting.dynamicMapResizingEnabled){doResize();}}}
var infoBox=null;function setMarkers(map){var selectionSetId=window.__activeSelectionSetId;if(selectionSetId!=null){if(!sessionExpired){PageMethods.GetActiveSelectionFeatures(HandleSetMarkers);}
else{HandleSessionExpired();}}}
function HandleSetMarkers(response){if(response!=null&&response.length>0){if(infoBox==null){infoBox=new InfoBox({maxWidth:0,boxStyle:{opacity:1,width:"100px"}});}
for(var i=0;i<response.length;i++){var feature=response[i];if(feature!=null&&feature.length>0){var featureDetails=feature.split(",");var point=new google.maps.LatLng(featureDetails[1],featureDetails[0]);var contentStringHtml='<div style="border: 1px solid gray; background: white; padding: 5px;"> '+'<a href="#" onclick="ShowStreeView('+featureDetails[1]+','+featureDetails[0]+');infoBox.close();"><font color=blue>'+window._StreetView+'</font></a><\/div>';var marker=createMarker(point,contentStringHtml,featureDetails[2]);}}}}
function createMarker(latlng,html,index){var contentString=html;var image="http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld="+index.toString()+"|FF0000|000000";var marker=new google.maps.Marker({position:latlng,map:g_map2D,icon:image});markersArray.push(marker);google.maps.event.addListener(marker,'click',function(){infoBox.setContent(contentString);infoBox.open(g_map2D,marker);});}
function ShowStreeView(lat,lon){var showStreetView=new google.maps.LatLng(lat,lon);var divStreetView=document.getElementById('divStreetView');divStreetView.innerHTML="";var panoramaOptions={position:showStreetView,visible:true,pov:{heading:34,pitch:10,zoom:1}};var panorama=new google.maps.StreetViewPanorama(divStreetView,panoramaOptions);g_map2D.setStreetView(panorama);sv=new google.maps.StreetViewService();sv.getPanoramaByLocation(showStreetView,50,processSVData);}
function processSVData(data,status){if(status!=google.maps.StreetViewStatus.OK){jQuery:jAlert(window._StreetViewNotFound,window._AlertWindowTitle,window._OKText,'warning',function(r){});}}
function SetGSPluginMapWindowSize(mapSize){try{if(window.g_map2D){var onPointSetting=GetOnPointSettings(null);if(onPointSetting!=null){if(onPointSetting.useEmbeddedMapContainer){EmbeddedMapContainerResize(mapSize.width,onPointSetting.embeddedMapContainerHeight);}
var mapWidth=mapSize.width;var mapHeight=mapSize.height;if(g_hostInCustomGSMapTab){mapHeight=mapHeight-25;}
else{mapHeight=mapHeight-5;}
var outerMapDivReference=getObject("outer_map_"+onPointSetting.id);if(outerMapDivReference!=null){if((parseInt(outerMapDivReference.style.width)!=mapWidth)||(parseInt(outerMapDivReference.style.height)!=mapHeight)){outerMapDivReference.style.width=mapWidth+"px";outerMapDivReference.style.height=mapHeight+"px";var mapDivReference=getObject("map_"+onPointSetting.id);if((parseInt(mapDivReference.style.width)!=mapWidth)||(parseInt(mapDivReference.style.height)!=mapHeight)){mapDivReference.style.width=mapWidth+"px";mapDivReference.style.height=mapHeight+"px";}}
if(onPointSetting.clientOnResizeEndJS!=null){eval(onPointSetting.clientOnResizeEndJS);}
if(document.getElementById(_BoxStreetView).style.posLeft>(mapWidth-document.getElementById(_BoxStreetView).offsetWidth))
{document.getElementById(_BoxStreetView).style.left=(mapWidth-document.getElementById(_BoxStreetView).offsetWidth)+"px";}
try{}catch(e){Console.error(String.format('{0}::{1}| window.g_GEPlugin.Resize error - {2}','GEPlugin.js','SetGEPluginMapWindowSize',e.message));}}}}}catch(e){}}
function RefreshMarkers(){if(window.__activeSelectionSetId){deleteOverlays();setMarkers(g_map2D);}}
function deleteOverlays(){if(markersArray){for(var i=0;i<markersArray.length;i++){markersArray[i].setMap(null);}
markersArray.length=0;}}
function handleBoundsChanged(){if(g_GSIgnoreBoundsChange){g_GSIgnoreBoundsChange=false;}
else{UpdateMapTabExtentsFromStreet();}}
function UpdateMapTabExtentsFromStreet(){if(g_map2D){var currentLatLngBounds=g_map2D.getBounds();if(!currentLatLngBounds.isEmpty()){var northEast=currentLatLngBounds.getNorthEast();var southWest=currentLatLngBounds.getSouthWest();var northLatitude=northEast.lat();var southLatitude=southWest.lat();var eastLongitude=northEast.lng();var westLongitude=southWest.lng();try{if(_Onpoint.MapHistory){var onPointSetting=GetOnPointSettings(null);_Onpoint.MapHistory.UpdateMapTabExtentsFromLatLong(onPointSetting.mapSrcId,westLongitude,southLatitude,eastLongitude,northLatitude);}}catch(e){}}}}
var m_ie5=(window.navigator.appName.toLowerCase().indexOf("microsoft")>=0);var m_lastActiveToolBar;var m_helpDiv;if(!window.m_allToolBars)
{var m_allToolBars=new Array();}
function ToolBar(toolBarId,toolStyle,selectedStyle,disabledStyle,mouseOverStyle,toolItems,toolsSep,toolDefSep,lastToolHolder)
{var allTools=new Array();this.ToolBarId=toolBarId;this.ToolStyle=toolStyle;this.SelectedStyle=selectedStyle;this.DisabledStyle=disabledStyle;this.MouseOverStyle=mouseOverStyle;this.AllTools=allTools;this.LastToolHolder=lastToolHolder;var toolInfo=toolItems.split(toolsSep);for(i=0;i<toolInfo.length;i++)
{if(toolInfo[i]!="")
{allTools.push(_ParseTool(toolInfo[i],toolDefSep,toolBarId));}}
this.SelectToolByName=function(toolName)
{var tool=this.GetTool(toolName);this.SelectTool(tool);}
this.SelectTool=function(tool)
{if(tool!=null&&tool.IsEnabled)
{if(m_lastActiveToolBar!=null)
{m_lastActiveToolBar.UnSelectAll();m_lastActiveToolBar.RefreshStyles();}
this.UnSelectAll();this.RefreshStyles();m_lastActiveToolBar=this;if(tool.IsTool)
{tool.IsSelected=true;var toolContainer=document.getElementById("td_"+this.ToolBarId+tool.ToolName);if(toolContainer)
toolContainer.className=this.SelectedStyle;_SetToolImage(tool.SelectedImageUrl,tool.ToolName);}
var hTool=document.getElementById(this.LastToolHolder);if(hTool!=null)
{hTool.value=tool.ToolName;}}}
this.GetSelectedTool=function()
{var selTool=null;if(this.AllTools!=null)
{for(i=0;i<this.AllTools.length;i++)
{var tool=this.AllTools[i];if(tool.IsTool&&tool.IsSelected)
{selTool=tool;break;}}}
return selTool;}
this.GetTool=function(toolName)
{var tool=null;if(this.AllTools!=null)
{for(i=0;i<this.AllTools.length;i++)
{if(this.AllTools[i].ToolName.match(toolName))
{tool=this.AllTools[i];break;}}}
return tool;}
this.MouseOver=function(toolName)
{var tool=this.GetTool(toolName);if(tool!=null&&tool.IsEnabled)
{var toolContainer=document.getElementById("td_"+this.ToolBarId+toolName);if(toolContainer!=null)
{toolContainer.className=this.MouseOverStyle;_SetToolImage(tool.SelectedImageUrl,toolName);}}}
this.MouseOut=function(toolName){var tool=this.GetTool(toolName);if(tool!=null&&tool.IsEnabled){var toolContainer=document.getElementById("td_"+this.ToolBarId+toolName);if(toolContainer!=null){if(tool.IsTool&&tool.IsSelected){toolContainer.className=this.SelectedStyle;_SetToolImage(tool.SelectedImageUrl,toolName);}
else{toolContainer.className=this.ToolStyle;_SetToolImage(tool.ImageUrl,toolName);}}}
_HideToolHelp();_supressToolHelp=false;}
var _supressToolHelp=false;this.MouseMove=function(e,toolName){if(m_helpDiv==null)
m_helpDiv=_GetHelpDiv();if(m_helpDiv==null)
return;if(_supressToolHelp||m_helpDiv.style.visibility!='hidden')
return;e=window.event||e;if(e.pageX){srcObj=e.target;}
else{var winWidth=document.body.offsetWidth;srcObj=e.srcElement;}
var cx=0;var cy=0;if(e){if(e.pageX){cx=e.pageX;cy=e.pageY;ox=5;oy=15;}
else if(e.x){cx=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;cy=e.clientY+document.body.scrollTop+document.documentElement.scrollTop;ox=e.offsetX;oy=e.offsetY;}}
if(srcObj.id){var tool=this.GetTool(toolName);if(tool&&tool.ToolTip)
{var helpHeader=document.getElementById('toolHelpHeader');var helpBody=document.getElementById('toolHelpBody');if(helpHeader&&helpBody){var toolHelp=tool.ToolTip;helpHeader.innerHTML=tool.ToolLabel;helpBody.innerHTML=tool.ToolTip;var divWidth=parseInt(m_helpDiv.style.width);if(m_helpDiv.style!=null&&m_helpDiv.style.width=="")
divWidth=parseInt(m_helpDiv.clientWidth);if(cx+ox+divWidth>document.body.clientWidth){var helpDivleft=cx-ox-parseInt(divWidth);if(window.htmlDir&&htmlDir=="RTL"&&m_ie5){var offsetL=document.body.offsetWidth-document.body.scrollWidth;if(offsetL<0){helpDivleft+=offsetL*2;}}
m_helpDiv.style.left=helpDivleft+'px';}
else{var helpDivStyleLeft=cx-ox-5;if(window.htmlDir&&htmlDir=="RTL"&&m_ie5){var offsetL=document.body.offsetWidth-document.body.scrollWidth;if(offsetL<0){helpDivStyleLeft+=offsetL*2;}}
m_helpDiv.style.left=helpDivStyleLeft+'px';}
m_helpDiv.style.top=(cy+5)+'px';m_helpDiv.style.visibility='visible';}}}}
this.Click=function(toolName){var tool=this.GetTool(toolName);if(tool!=null)
this._Click(tool);}
this._Click=function(tool){if(tool!=null&&tool.IsEnabled){var fncRet=true;if(tool.IsTool){this.SelectTool(tool);_SetToolImage(tool.SelectedImageUrl,tool.ToolName);}
else{_SetToolImage(tool.ImageUrl,tool.ToolName);}
if(tool.ClientScript!=null&&tool.ClientScript!=""){try{if(tool.ClientScript!=""){fncRet=eval(tool.ClientScript);}}
catch(e){try{window.status='Toolbar::_Click: '+e.message;}
catch(eex)
{}}}
_HideToolHelp();_supressToolHelp=true;if(tool.AutoPostBack&&(fncRet!=false)){__doPostBack('tb_'+this.ToolBarId,tool.ToolName);}}}
this.UnSelectAll=function()
{for(i=0;i<this.AllTools.length;i++)
{var tool=this.AllTools[i];_SetToolImage(tool.ImageUrl,tool.ToolName);if(tool.IsTool)
{tool.IsSelected=false;}}
var hTool=document.getElementById(this.LastToolHolder);if(hTool!=null)
{hTool.value="";}}
this.RefreshStyles=function()
{for(i=0;i<this.AllTools.length;i++)
{var tool=this.AllTools[i];var toolContainer=document.getElementById("td_"+this.ToolBarId+tool.ToolName);if(toolContainer!=null)
{if(!tool.IsEnabled)
{toolContainer.className=this.DisabledStyle;}
else if(tool.IsTool&&tool.IsSelected)
{toolContainer.className=this.SelectedStyle;}
else
{toolContainer.className=this.ToolStyle;}}}}
this.ClickFirstTool=function()
{for(i=0;i<this.AllTools.length;i++)
{var tool=this.AllTools[i];if(tool.IsTool&&tool.IsEnabled)
{this._Click(tool);break;}}}
this.SetVisible=function(show)
{var div=document.getElementById("tb_"+this.ToolBarId);if(div!=null)
{if(show)
div.style.display="inline";else
div.style.display="none";}};this.GetVisible=function()
{var div=document.getElementById("tbl_"+this.ToolBarId);if(div!=null)
{if(div.style.display=="none")
return false;else
return true;}};this.ToString=function()
{return"Id:"+this.ToolBarId+",Tool count:"+allTools.length;};for(var i=0;i<m_allToolBars.length;i++)
{if(m_allToolBars[i].ToolBarId==this.ToolBarId)
{m_allToolBars.splice(i,1);break;}}
m_allToolBars.push(this);}
function _ParseTool(toolInfo,toolDefSep,toolBarId)
{var info=toolInfo.split(toolDefSep);var tool=new Tool(info[0],info[1],info[2],info[3],info[4],info[5],info[6],info[7],info[8],toolBarId);return tool;}
function Tool(name,isEnabled,isTool,clientScript,autoPostBack,toolImageUrl,toolSelectedImageUrl,toolTip,toolLabel,toolBarId)
{this.ToolName=name;this.IsEnabled=(isEnabled.toLowerCase()=='true');this.IsTool=(isTool.toLowerCase()=='true');this.IsSelected=false;this.ClientScript=clientScript;this.AutoPostBack=(autoPostBack.toLowerCase()=='true');this.ImageUrl=toolImageUrl;this.SelectedImageUrl=toolSelectedImageUrl;this.ToolTip=toolTip;this.ToolLabel=toolLabel;this.ToolBarId=toolBarId;this.Enable=function(){this._Enable(true);}
this.Disable=function(){this._Enable(false);}
this._Enable=function(enable)
{this.IsEnabled=enable;var toolBar=GetToolBar(toolBarId);if(toolBar)
{var tdObject=getObject('td_'+this.ToolBarId+this.ToolName);if(tdObject)
{if(enable)
tdObject.className=toolBar.ToolStyle;else
tdObject.className=toolBar.DisabledStyle;}}}
this.ToString=function()
{return"ToolName:"+this.ToolName+",IsTool:"+this.IsTool+",IsSelected:"+this.IsSelected+",IsEnabled:"+this.IsEnabled+",ClientScript:"+this.ClientScript+",AutoPostBack:"+this.AutoPostBack+",ImageUrl:"+this.ImageUrl+",SelectedImageUrl:"+this.SelectedImageUrl;}}
function GetToolBar(toolBarId)
{var toolBar=null;for(i=0;i<m_allToolBars.length;i++)
{if(m_allToolBars[i].ToolBarId==toolBarId)
{toolBar=m_allToolBars[i];break;}}
return toolBar;}
function HideToolBar(toolBarId)
{var toolBar=GetToolBar(toolBarId);if(toolBar!=null)
{toolBar.SetVisible(false);}}
function ShowToolBar(toolBarId)
{var toolBar=GetToolBar(toolBarId);if(toolBar!=null)
{toolBar.SetVisible(true);}}
function SetToolVisibility(toolBarId,toolName,show)
{var toolBar=GetToolBar(toolBarId);if(toolBar)
{var tool=toolBar.GetTool(toolName);var tdObject=getObject('td_'+toolBarId+toolName);if(tdObject!=null)
{if(show)
tdObject.style.display="inline";else
tdObject.style.display="none";}}}
function ClickTool(toolName)
{var tool=null;for(i=0;i<m_allToolBars.length;i++)
{tool=m_allToolBars[i].GetTool(toolName);if(tool!=null)
{m_allToolBars[i]._Click(tool);break;}}
return tool;}
function FindTool(toolName)
{var tool=null;for(i=0;i<m_allToolBars.length;i++)
{tool=m_allToolBars[i].GetTool(toolName);if(tool!=null)
break;}
return tool;}
function UnSelectAllTools()
{if(m_lastActiveToolBar!=null)
m_lastActiveToolBar.UnSelectAll();}
function _SetToolImage(imgUrl,toolName)
{try
{if(toolName!=null&&imgUrl!=null)
{var imgBtn=document.getElementById('img_'+toolName);if(imgBtn)
imgBtn.src=imgUrl;}}
catch(e){alert('ExceptionHandler::Toolbar::_SetToolImage: '+e.message);}}
function _GetHelpDiv()
{var toolHelp=document.getElementById('toolHelp');if(!toolHelp)
{toolHelp=document.createElement("DIV");toolHelp.id='toolHelp';toolHelp.style.visibility='visible';toolHelp.style.overflow='hidden';toolHelp.style.position='absolute';toolHelp.style.zIndex=2000;toolHelp.innerHTML="<div id='toolHelpHeader'></div><div id='toolHelpBody'></div>";document.body.appendChild(toolHelp);}
return toolHelp}
function GetScrollXY()
{var scrOfX=0,scrOfY=0;if(typeof(window.pageYOffset)=='number')
{scrOfY=window.pageYOffset;scrOfX=window.pageXOffset;}
else if(document.body&&(document.body.scrollLeft||document.body.scrollTop))
{scrOfY=document.body.scrollTop;scrOfX=document.body.scrollLeft;}
else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop))
{scrOfY=document.documentElement.scrollTop;scrOfX=document.documentElement.scrollLeft;}
if(window.htmlDir)
{if(htmlDir=="RTL")
scrOfX=0;}
return[scrOfX,scrOfY];}
function _HideToolHelp()
{if(m_helpDiv){m_helpDiv.style.visibility='hidden';m_helpDiv.style.left=0+"px";m_helpDiv.style.top=0+"px";}}
if(m_ie5)
{document.attachEvent('onclick',_HideToolHelp);}
else
{document.addEventListener('click',_HideToolHelp,false);}
function SetPrint(path)
{try
{SetPrintMapUrl();}
catch(e)
{}
if(path!=null)
{if(window.HandlePrintFrame)
{HandlePrintFrame(path);}
else
{var Print=window.open(path,"Print","titlebar=no,toolbar=no,width=300,height=400,left=50,top=50,status=no,resizable=yes");Print.focus();}}}
function DisplayToolTip(e,headerText,contentText)
{if(headerText!=null&&contentText!=null)
{if(m_helpDiv==null)
m_helpDiv=_GetHelpDiv();e=window.event||e;var cx=0;var cy=0;if(e)
{if(e.pageX)
{cx=e.pageX;cy=e.pageY;ox=5;oy=15;}
else if(e.x)
{cx=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;cy=e.clientY+document.body.scrollTop+document.documentElement.scrollTop;ox=e.offsetX;oy=e.offsetY;}}
var helpHeader=document.getElementById('toolHelpHeader');var helpBody=document.getElementById('toolHelpBody');if(helpHeader&&helpBody){helpHeader.innerHTML=headerText;helpBody.innerHTML=contentText;var divWidth=parseInt(m_helpDiv.style.width);if(m_helpDiv.style!=null&&m_helpDiv.style.width=="")
divWidth=parseInt(m_helpDiv.clientWidth);if(window.htmlDir&&htmlDir=="RTL"&&m_ie5){var offsetL=document.body.offsetWidth-document.body.scrollWidth;if(offsetL<0){cx+=offsetL*2;}}
if(cx+divWidth>document.body.clientWidth){m_helpDiv.style.left=(cx-ox-parseInt(divWidth))+'px';}
else{m_helpDiv.style.left=(cx-ox-5)+'px';}
m_helpDiv.style.top=(cy+5)+'px';m_helpDiv.style.visibility='visible';}}}
function DisplayToogleButtonToolTip(elem,e,expandHeader,expandContent,collapseHeader,collapseContent)
{var tipHeader,tipContent;var src=elem.src.toUpperCase();var collapseimg=elem.getAttribute('collapseimage').toUpperCase();if(src.indexOf(collapseimg)>0)
{tipHeader=collapseHeader;tipContent=collapseContent;}
else
{tipHeader=expandHeader;tipContent=expandContent;}
DisplayToolTip(e,tipHeader,tipContent);}
g_RSS_LastScale="";var isIE=(window.navigator.appName.toLowerCase().indexOf("microsoft")>=0);if(isIE!=true)
{Document.prototype.loadXML=function(strXML)
{var objDOMParser=new DOMParser();var objDoc=objDOMParser.parseFromString(strXML,"text/xml");while(this.hasChildNodes())
this.removeChild(this.lastChild);for(var i=0;i<objDoc.childNodes.length;i++)
{var objImportedNode=this.importNode(objDoc.childNodes[i],true);this.appendChild(objImportedNode);}}
Node.prototype.__defineGetter__("xml",_Node_getXML);}
var autoPostBack=false;function _Node_getXML(){var objXMLSerializer=new XMLSerializer;var strXML=objXMLSerializer.serializeToString(this);return strXML;}
function exists(theVar)
{alert('MapFunctions::exists');var varExists=true;try
{var newVar=theVar;}
catch(e)
{varExists=false;}
return varExists;}
var xmlHttp=null;function XMLHttpHandler(url,queryString,formDataString,callBack)
{alert('MapFunctions::XMLHttpHandler');if(xmlHttp==null||xmlHttp.readyState==4)
{if(window.ActiveXObject)
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");else if(window.XMLHttpRequest)
xmlHttp=new XMLHttpRequest();if(xmlHttp!=null)
{xmlHttp.open("POST",url,true);xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");xmlHttp.onreadystatechange=callBack;xmlHttp.send(formDataString);}}
else if(xmlHttp.readyState!=4)
alert("Please wait. Processing the previous request");}
function setAutoPostback(value)
{if(value==true||value=='true')
autoPostBack=true;else
autoPostBack=false;}
function SetGeneralCallBackSetting(features)
{setSubmitValues(features);}
function setSubmitValues(features){var mapCtrlId=null;var mapCtrl=GetMapCtrl(mapCtrlId);var temp=ConvertFeaturesToOnPointXML(mapCtrl.drawLayer.features);document.getElementsByName(g_mapControlId+"_geometry")[0].value=temp;}
function ConvertFeaturesToOnPointXML(features)
{var temp='<XML><GEOMETRY>';if(features!=undefined)
{var feature=null;for(var i=0;i<features.length;i++)
{feature=features[i].geometry;switch(feature.CLASS_NAME)
{case'OpenLayers.Geometry.Point':temp+='<POINT>'+GetPartXml(feature)+'</POINT>';break;case'OpenLayers.Geometry.LineString':temp+='<LINE>'+GetPartXml(feature)+'</LINE>';break;case'OpenLayers.Geometry.Polygon':for(var j=0;j<feature.components.length;j++)
{temp+='<POLYGON>'+GetPartXml(feature.components[j])+'</POLYGON>';}
break;}}}
temp+='</GEOMETRY></XML>';temp=escape(temp);return temp;}
function GetPartXml(feature)
{var temp='<PART coords="';var tempPixel=null;if(feature.CLASS_NAME=='OpenLayers.Geometry.Point')
{tempPixel=ConvertPointToPixel(feature);temp+=tempPixel.x+','+tempPixel.y;}
else
{var numPoints=0;switch(feature.CLASS_NAME)
{case'OpenLayers.Geometry.LineString':numPoints=feature.components.length;break;case'OpenLayers.Geometry.LinearRing':numPoints=feature.components.length-1;break;}
for(var i=0;i<numPoints;i++)
{if(i>0)temp+=' ';tempPixel=ConvertPointToPixel(feature.components[i]);temp+=tempPixel.x+','+tempPixel.y;}}
temp+='"/>';return temp;}
function WMSTool_Clicked(features,mapCtrlId){if(!sessionExpired){var mapCtrl=GetMapCtrl(mapCtrlId);var shape=ConvertPointToPixel(features[0].geometry);if(shape!=null&&shape.xmin!=null&&shape.ymin!=null){ShowWMSInfoWindow(shape.xmin,shape.ymin,mapCtrl.size.h,mapCtrl.size.w);}
else{if(shape!=null&&shape.x!=null&&shape.y!=null){ShowWMSInfoWindow(shape.x,shape.y,mapCtrl.size.h,mapCtrl.size.w);}}
return false;}
else{HandleSessionExpired();}}
function ShowWMSInfoWindow(xLocationValue,yLocationValue,mapCtrlHeight,mapCtrlWidth){var path="/Webpages/Info/WMSInfo.aspx";if(window.NGServerUrl){path=NGServerUrl()+path;}
else{var protocol=window.location.protocol;var theHost=window.location.hostname;var port=window.location.port;if(port){port=":"+port;}
var ThePath=window.location.pathname;ThePath=ThePath.substring(0,ThePath.indexOf("/",1));path=protocol+"//"+theHost+port+ThePath+path;}
var infoUrl=path+"?XMIN="+xLocationValue+"&YMIN="+yLocationValue+"&Height="+mapCtrlHeight+"&Width="+mapCtrlWidth;if(window.HandleWMSInfoToolFrame){HandleWMSInfoToolFrame(infoUrl);}
else{window.open(infoUrl,"InfoWindow","toolbar=no, directories=no, location=no,status=yes, menubar=no, resizable=yes, scrollbars=auto, width=550, height=500");}}
function IdentifyTool_Clicked(features,mapCtrlId)
{if(!sessionExpired)
{var mapCtrl=GetMapCtrl(mapCtrlId);var shape=ConvertPointToPixel(features[0].geometry);if(shape!=null&&shape.xmin!=null&&shape.ymin!=null)
{ShowInfoWindow(shape.xmin,shape.ymin,null,null,mapCtrl.size.h,mapCtrl.size.w);}
else
{if(shape!=null&&shape.x!=null&&shape.y!=null)
{ShowInfoWindow(shape.x,shape.y,null,null,mapCtrl.size.h,mapCtrl.size.w);}}
return false;}
else
{HandleSessionExpired();}}
function HandleIdentifyTool_Clicked(features,mapCtrlId)
{if(!sessionExpired)
{var infoWindow=document.getElementById(_InfoLayer);var boxEle=GetBoxItem(_InfoLayer);if(infoWindow!=null&&boxEle!=null)
{infoWindow.style.top=boxEle.originalTop+'px';if(boxEle.anchorStyle=="LEFT")
{infoWindow.style.left=boxEle.originalLeft+'px';}
else
{infoWindow.style.right=boxEle.originalRight+'px';}}
IdentifyTool_Clicked(features,mapCtrlId)}}
function PluginIdentifyTool_Clicked(point)
{if(!sessionExpired)
{if(point!=null&&point.latitude!=null&&point.longitude!=null)
{ShowInfoWindow(point.longitude,point.latitude,null,false);}
return false;}
else
{HandleSessionExpired();}}
function ShowInfoWindow(locationX,locationY,layerId,convertXY,mapCtrlHeight,mapCtrlWidth)
{var path="/Webpages/Info/Info.aspx";if(window.NGServerUrl)
{path=NGServerUrl()+path;}
else
{var protocol=window.location.protocol;var theHost=window.location.hostname;var port=window.location.port;if(port)
{port=":"+port;}
var ThePath=window.location.pathname;ThePath=ThePath.substring(0,ThePath.indexOf("/",1));path=protocol+"//"+theHost+port+ThePath+path;}
var infoUrl=path+"?XMIN="+locationX+"&YMIN="+locationY+"&CONVERTLOCATION="+convertXY+"&Height="+mapCtrlHeight+"&Width="+mapCtrlWidth;if(layerId!=null)
{infoUrl+="&INFOLAYERID="+layerId;}
if(window.HandleInfoToolFrame)
{HandleInfoToolFrame(infoUrl);}
else
{window.open(infoUrl,"InfoWindow","toolbar=no, directories=no, location=no,status=yes, menubar=no, resizable=yes, scrollbars=auto, width=550, height=500");}}
function PostSelections(features,mapCtrlId)
{var mapCtrl=GetMapCtrl(mapCtrlId);SetGeneralCallBackSetting(features);if(window.autoPostBack)
{ShowLoading(mapCtrlId);document.forms[0].__EVENTTARGET.value="tb_SELECTION_TOOLS_APPLY";document.forms[0].__EVENTARGUMENT.value="ApplySelection";__doPostBack(document.forms[0].__EVENTTARGET.value,document.forms[0].__EVENTARGUMENT.value);}}
function PostNotificationSelections(features,mapCtrlId)
{SetGeneralCallBackSetting(features);if(window.autoPostBack)
{document.forms[0].__EVENTTARGET.value="tb_NOTIFICATION_SELECTION_TOOLS";document.forms[0].__EVENTARGUMENT.value="SELECTION_APPLY";__doPostBack(document.forms[0].__EVENTTARGET.value,document.forms[0].__EVENTARGUMENT.value);}}
function PostExclusions(features,mapCtrlId)
{SetGeneralCallBackSetting(features);document.forms[0].__EVENTTARGET.value='ctl01$cpBoxes$ctlNotification$ctlNotificationWizard$ctlENF';__doPostBack(document.forms[0].__EVENTTARGET.value,document.forms[0].__EVENTARGUMENT.value);}
function openRetrieveSelectionPopup(onPointVirtualDir)
{if(!sessionExpired)
{HandleRetriveSelectionFrame(onPointVirtualDir+'?CMD=RetrieveSelections');}
else
{HandleSessionExpired();}}
function GenerateUrlHandler(shape)
{var frame=window.frames[_GenerateUrlIframe];if(frame&&frame.window&&frame.window.ReceiveShape)
{frame.window.HandleReceiveShapeOL(shape[shape.length-1].geometry);}
return false;}
function VERouteFromSelection(setid,itemid,mapCtrlId)
{var mapCtrl=GetMapCtrl(mapCtrlId);mapCtrl.SetStartLocation(setid,itemid);}
function VERouteToSelection(setid,itemid,mapCtrlId)
{var mapCtrl=GetMapCtrl(mapCtrlId);mapCtrl.SetEndLocation(setid,itemid);}
function ToLocalFormat(value,noOfDecimals,mapCtrlId)
{var result='';var negativeSign='';var finalIntegerString='';var finalDecimalString='';if(noOfDecimals<0){noOfDecimals=0;}
var onPointSetting=GetOnPointSettings(mapCtrlId);if((onPointSetting!=null)&&(onPointSetting.decimalSeparator!=null)&&(onPointSetting.numberPattern!=null)){if(value<0){negativeSign='-';value=Math.abs(value);}
value=value.toFixed(noOfDecimals);var integerValue=Math.floor(value);var decimalValue=(value-integerValue).toFixed(noOfDecimals);if(noOfDecimals>0){finalDecimalString=onPointSetting.decimalSeparator;if(decimalValue==0){for(var i=0;i<noOfDecimals;i++){finalDecimalString+='0';}}
else{var decimalString=decimalValue.toString();var missingZero=noOfDecimals-(decimalString.length-2);if(missingZero>0){for(var i=0;i<missingZero;i++){decimalString+='0';}}
finalDecimalString+=decimalString.substring(2);}}
var integerString=integerValue.toString();if(integerValue==0){finalIntegerString=integerString;}
else{var pattern=onPointSetting.numberPattern;pattern=pattern.substring(0,pattern.indexOf('.'));var valueIndex=integerString.length-1;var patternIndex=pattern.length-1;var curDigitChar='';var curPatternChar='';var digitInserted=false;for(valueIndex;valueIndex>=0;valueIndex--){curDigitChar=integerString.charAt(valueIndex);digitInserted=false;while(!digitInserted){if(patternIndex>=0){curPatternChar=pattern.charAt(patternIndex);patternIndex--;}
else{curPatternChar="#";}
if(curPatternChar=="#"){finalIntegerString=curDigitChar+finalIntegerString;digitInserted=true;}
else{finalIntegerString=curPatternChar+finalIntegerString;}}}}
result=negativeSign+finalIntegerString+finalDecimalString;}
else{result=value.toFixed(noOfDecimals);}
return result;}
function UndoLocalFormat(value,mapCtrlId){value=value.toString();var result="";var onPointSetting=GetOnPointSettings(mapCtrlId);if((onPointSetting.decimalSeparator!=null)&&(onPointSetting.numberGroupSeparator!=null)){var digit='';for(var valIndex=0;valIndex<value.length;valIndex++){digit=value.charAt(valIndex);if(digit!=onPointSetting.numberGroupSeparator){if(digit==onPointSetting.decimalSeparator){digit=".";}
result+=digit;}}
return result;}
else{return 0;}}
function ShowLoading1(mapCtrlId)
{var progressdiv=null;var progressdiv=OpenLayers.Util.getElement("Progressdiv");SyncProgressPanel(mapCtrlId);if(progressdiv==null)
{loadingDivId=OpenLayers.Util.createDiv('maploading',null,null,null,"relative",null,"hidden");var cellText=document.createTextNode("Loading... Please wait");var font=document.createElement("font");font.style.color="#FF0000";font.appendChild(cellText);loadingDivId.appendChild(font);}
else
{progressdiv.style.display="";}}
function HideLoading1()
{var progressdiv=OpenLayers.Util.getElement("Progressdiv");if(progressdiv==null)
{var maploadingdiv=OpenLayers.Util.getElement("maploading");if(maploadingdiv!=null)
maploadingdiv.style.display='none'}
else
progressdiv.style.display="none";}
function GetDynamicMapSize(mapCtrlId)
{var onPointSetting=null;onPointSetting=GetOnPointSettings(mapCtrlId);var mapWidth=0;var mapHeight=0;var broswerWidth=0;var broswerHeight=0;if(typeof(window.innerWidth)=='number'){broswerWidth=window.innerWidth;broswerHeight=window.innerHeight;broswerWidth=broswerWidth-28;broswerHeight=broswerHeight-0;Console.debug(String.format('GetDynamicMapSize| Non-IE - 28. Width={0}. Height={1}',mapWidth,mapHeight));}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){broswerWidth=document.documentElement.clientWidth;broswerHeight=document.documentElement.clientHeight;broswerWidth=broswerWidth-13;broswerHeight=broswerHeight-0;Console.debug(String.format('GetDynamicMapSize| IE 6+ - 13. Width={0}. Height={1}',mapWidth,mapHeight));}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){broswerWidth=document.body.clientWidth;broswerHeight=document.body.clientHeight;broswerWidth=broswerWidth-13;broswerHeight=broswerHeight-0;Console.debug(String.format('GetDynamicMapSize| IE 4 comp - 13. Width={0}. Height={1}',mapWidth,mapHeight));}
if(onPointSetting!=null)
{var mapDiv=document.getElementById(onPointSetting.divId);var divTop=getElementTopPostion(mapDiv);mapWidth=broswerWidth-onPointSetting.dynMapWidthMarginPixel;mapHeight=broswerHeight-divTop-onPointSetting.dynMapHeightMarginPixel;var mapMinWidth=onPointSetting.dynMapMinWidthPixel;var mapMinHeight=onPointSetting.dynMapMinHeightPixel;if(mapWidth<mapMinWidth){mapWidth=mapMinWidth;}
if(mapHeight<mapMinHeight){mapHeight=mapMinHeight;}}
return{width:mapWidth,height:mapHeight};}
function DocumentViewer_Clicked(features,mapCtrlId)
{if(!sessionExpired)
{var mapCtrl=GetMapCtrl(mapCtrlId);var shape=ConvertPointToPixel(features[0].geometry);if(shape!=null&&shape.xmin!=null&&shape.ymin!=null)
{ShowDocumentViewer(shape.xmin,shape.ymin,null);}
else
{if(shape!=null&&shape.x!=null&&shape.y!=null)
{ShowDocumentViewer(shape.x,shape.y,null);}}
mapCtrl.EraseAllDrawing();return false;}
else
{HandleSessionExpired();}}
function ShowDocumentViewer(locationX,locationY,layerId,convertXY)
{var path="/WebPages/DocumentViewer/DocumentViewerPage.aspx";if(window.NGServerUrl)
{path=NGServerUrl()+path;}
else
{var protocol=window.location.protocol;var theHost=window.location.hostname;var port=window.location.port;if(port)
{port=":"+port;}
var ThePath=window.location.pathname;ThePath=ThePath.substring(0,ThePath.indexOf("/",1));path=protocol+"//"+theHost+port+ThePath+path;}
var documentViewerUrl=path+"?X="+locationX+"&Y="+locationY;if(convertXY!=null)
{documentViewerUrl+="&CONVERTLOCATION="+convertXY;}
if(layerId!=null)
{documentViewerUrl+="&INFOLAYERID="+layerId;}
if(window.DocumentViewerIframe)
{HandleDocumentViewerFrame(documentViewerUrl);}
else
{window.open(documentViewerUrl,"DocumentViewerWindow","toolbar=no, directories=no, location=no,status=yes, menubar=no, resizable=yes, scrollbars=auto, width=550, height=500");}}
function OLCMEndFeature()
{if(window._olScratchArea)
{try
{var feature=window._olScratchArea;if(feature.persist)
{feature.destroyPoint();}
feature.finalize();}
catch(e)
{}
window._olScratchArea=null;var cm=document.getElementById('mcContextMenu');if(cm)
{cm.style.display="none";}}}
function OLCMDeleteFeature()
{if(window._olScratchArea)
{try
{var feature=window._olScratchArea;var index=0;if(feature.CLASS_NAME=="OpenLayers.Handler.Polygon")
{index=feature.line.geometry.components.length-2;}
if(feature.CLASS_NAME=="OpenLayers.Handler.Path")
{index=feature.line.geometry.components.length-1;}
feature.line.geometry.removeComponent(feature.line.geometry.components[index]);feature.drawFeature();}
catch(e)
{}
window._olScratchArea=null;var cm=document.getElementById('mcContextMenu');if(cm)
{cm.style.display="none";}}}
function SyncProgressPanel(mapCtrlId)
{if(window.g_globalProgressPanelId!=null&&g_OLMapCtrls!=null&&g_OLMapCtrls.length>0)
{var map=g_OLMapCtrls[0];if(map)
{mapCtrlId=map.id;}}
if(mapCtrlId&&window.g_globalProgressPanelId!=null)
{var loadDiv=document.getElementById('LoadDiv_'+mapCtrlId);var panel=document.getElementById(g_globalProgressPanelId);if(panel&&loadDiv)
{var left=findPosX(loadDiv);var top=findPosY(loadDiv);var winSize=GetWindowCenterXY();if(winSize!=null)
{left=winSize.windowCenterX;top=winSize.windowCenterY;}
SetLoadDivPosition('LoadDiv_'+mapCtrlId);loadDiv.style.zIndex=99999;panel.style.left=left+"px";panel.style.top=top+"px";var imgNodeIndex=0;if(m_ie5==false)
{imgNodeIndex=1;}
if(panel.childNodes.length>imgNodeIndex&&panel.childNodes[imgNodeIndex]!=null&&panel.childNodes[imgNodeIndex].style!=null)
{panel.childNodes[imgNodeIndex].style.left="0px";panel.childNodes[imgNodeIndex].style.top="0px";}}}}
function findPosX(obj)
{var curleft=0;if(obj.offsetParent)
while(1)
{curleft+=obj.offsetLeft;if(!obj.offsetParent)
break;obj=obj.offsetParent;}
else if(obj.x)
curleft+=obj.x;return curleft;}
function findPosY(obj)
{var curtop=0;if(obj.offsetParent)
while(1)
{curtop+=obj.offsetTop;if(!obj.offsetParent)
break;obj=obj.offsetParent;}
else if(obj.y)
curtop+=obj.y;return curtop;}
function _UpdateSmartNavigator()
{try
{UpdatePanel('SmartNavigator');}
catch(e)
{}}
function applyGeoRSS(){var map=GetMapCtrl();if(map){map.events.register(map.MAPEVENT_TYPES.ZOOMEND,null,UpdateGeoRSSList);}
if(popupDialog!=null)
popupDialog.Hide();var mapCtrl=(g_mapControlId!=null)?GetMapCtrl(g_mapControlId):g_OLMapCtrls[0];var drawFeatureStyle=new Array();var colorBg='Blue';var opSettings=GetOnPointSettings();var mapId=opSettings.mapSrcId
var style=new OpenLayers.Style();style.top="auto";style.left="auto";style.height="100%";style.width="100%";var vectors=new OpenLayers.Layer.Vector("Vector Layer");vectors.Style=style;if(mapCtrl.layers!=null){for(var lCounter=0;lCounter<mapCtrl.layers.length;lCounter++){if(mapCtrl.layers[lCounter].name=="Vector Layer")
mapCtrl.removeLayer(mapCtrl.layers[lCounter]);}
mapCtrl.addLayers([vectors]);}
var drawFeature=new Array();var rssOuterLoop=0;var drawFeatureIndexCounter=0;var maptabGeoRSS;MapTabId[mapId]=new Object()
MapTabId[mapId]=GeoRSSCollection;while(GeoRSSCollection[rssOuterLoop]!=null){var rssInnerLoop=0;while(GeoRSSCollection[rssOuterLoop][rssInnerLoop]!=null){if(GeoRSSCollection[rssOuterLoop][rssInnerLoop].LanLots==null||GeoRSSCollection[rssOuterLoop][rssInnerLoop].LanLots[0]==null||GeoRSSCollection[rssOuterLoop][rssInnerLoop].LanLots[0]==undefined){rssInnerLoop++;continue;}
if((GeoRSSCollection[rssOuterLoop][rssInnerLoop].MaxScaleFactor!=''&&GeoRSSCollection[rssOuterLoop][rssInnerLoop].MaxScaleFactor.length>0)&&(GeoRSSCollection[rssOuterLoop][rssInnerLoop].MinScaleFactor!=''&&GeoRSSCollection[rssOuterLoop][rssInnerLoop].MinScaleFactor.length>0))
if(parseFloat(GeoRSSCollection[rssOuterLoop][rssInnerLoop].MaxScaleFactor)>=Math.floor(parseFloat(mapCtrl.getScale()))&&parseFloat(GeoRSSCollection[rssOuterLoop][rssInnerLoop].MinScaleFactor)<parseFloat(mapCtrl.getScale())){GeoRSSCollection[rssOuterLoop][rssInnerLoop].MaxScaleFactor='1000000000000000';drawFeatureStyle[0]={strokeColor:"Black",fillColor:GeoRSSCollection[rssOuterLoop][rssInnerLoop].color,strokeWidth:GeoRSSCollection[rssOuterLoop][rssInnerLoop].StrokeWidth,fillOpacity:GeoRSSCollection[rssOuterLoop][rssInnerLoop].Opacity,pointRadius:GeoRSSCollection[rssOuterLoop][rssInnerLoop].Radius};var clickedPointLanLot=new OpenLayers.LonLat(GeoRSSCollection[rssOuterLoop][rssInnerLoop].LanLots[0].x,GeoRSSCollection[rssOuterLoop][rssInnerLoop].LanLots[0].y);var pt=new OpenLayers.Geometry.Point(clickedPointLanLot.lon,clickedPointLanLot.lat)
if(GeoRSSCollection[rssOuterLoop][rssInnerLoop].Converted!=true){if(GeoRSSCollection[rssOuterLoop][rssInnerLoop].CoordinateSystem!=null)
pt=pt.transform(new OpenLayers.Projection(GeoRSSCollection[rssOuterLoop][rssInnerLoop].CoordinateSystem),new OpenLayers.Projection(mapCtrl.projection.projCode));GeoRSSCollection[rssOuterLoop][rssInnerLoop].LanLots[0].x=pt.x;GeoRSSCollection[rssOuterLoop][rssInnerLoop].LanLots[0].y=pt.y;GeoRSSCollection[rssOuterLoop][rssInnerLoop].Converted=true;}
drawFeature[drawFeatureIndexCounter]=new OpenLayers.Feature.Vector(pt,null,drawFeatureStyle[0]);rssInnerLoop++;drawFeatureIndexCounter++;}
else{rssInnerLoop++;break;}}
rssOuterLoop++;}
for(var intDrawFeatureIndx=0;intDrawFeatureIndx<drawFeature.length;intDrawFeatureIndx++){vectors.addFeatures([drawFeature[intDrawFeatureIndx]]);}
HideLoading();}
function ShowGeoRSSFeatures(point){var ScrollTop=document.body.scrollTop;if(ScrollTop==0){if(window.pageYOffset)
ScrollTop=window.pageYOffset;else
ScrollTop=(document.body.parentElement)?document.body.parentElement.scrollTop:0;}
if(popupDialog!=null)
popupDialog.Hide();var PopupData;PopupData="";var mapCtrl=(g_mapControlId!=null)?GetMapCtrl(g_mapControlId):g_OLMapCtrls[0];point[0]=point[point.length-1];var k=0;while(GeoRSSCollection[k]!=null){var i=0;while(GeoRSSCollection[k][i]!=null){try{var ojbLanLot=new OpenLayers.LonLat(GeoRSSCollection[k][i].LanLots[0].x,GeoRSSCollection[k][i].LanLots[0].y);var objPoint=mapCtrl.getViewPortPxFromLonLat(ojbLanLot);deltaX=Math.abs(mapCtrl.div.style.height.replace("px",'')*GeoRSSCollection[k][i].TolPer);deltaY=Math.abs(mapCtrl.div.style.width.replace("px",'')*GeoRSSCollection[k][i].TolPer);var currBounds=new OpenLayers.Bounds(objPoint.x-deltaX/100,objPoint.y-deltaY/100,objPoint.x+deltaX/100,objPoint.y+deltaY/100)
var clickedPointLanLot=new OpenLayers.LonLat(point[0].geometry.x,point[0].geometry.y);var clickedPoint=mapCtrl.getViewPortPxFromLonLat(clickedPointLanLot);if(currBounds.containsPixel(clickedPoint)){if(PopupData=="")
PopupData=GeoRSSCollection[k][i].title+"<br>"+GeoRSSCollection[k][i].description+"<br>";else
PopupData=PopupData+"<br>"+GeoRSSCollection[k][i].title+"<br>"+GeoRSSCollection[k][i].description+"<br>";if(PopupData!=""){var OnPointMapOuterDivTopPos=OpenLayers.Util.getElement("outer_map_ctl01_cpMapBody_ctrlMap");var eventData=new Object()
eventData.x=objPoint.x+OnPointMapOuterDivTopPos.offsetLeft;eventData.y=objPoint.y+OnPointMapOuterDivTopPos.offsetTop-ScrollTop;PopupData=PopupData+"<hr>";}}}
catch(ex){}
i++;}
k++;}
if(PopupData!=""){try{if(event)
ShowGeoRSSTipDialog(event,"<div style=\"overflow-y:scroll;height:225px;\">"+PopupData+"</div>");}
catch(ex){ShowGeoRSSTipDialog(eventData,"<div style=\"overflow-y:scroll;height:225px;\">"+PopupData+"</div>");}}
mapCtrl.EraseAllDrawing();}
function UpdateGeoRSSList(ctx){if(ctx&&GetMapCtrl()){var newScale=GetMapCtrl().getScale();if(g_RSS_LastScale&&g_RSS_LastScale==newScale){}
else{g_RSS_LastScale=GetMapCtrl().getScale();applyGeoRSS();}}}
function HandleMouseOut(e){if(isIE)
return;if(e.target.id!=null&&e.target.id=='BufferOptions'){var node=e.relatedTarget.parentNode;while(node!=null){if(node==e.target){return;}
node=node.parentNode;}
e.target.style.visibility='hidden';}}
function RegisterWithMap(mapCtrlId){var mapCtrl=(mapCtrlId!=null)?GetMapCtrl(mapCtrlId):(g_OLMapCtrls?g_OLMapCtrls[0]:null);if(mapCtrl){mapCtrl.AddEventCallback(mapCtrl.MAPEVENT_TYPES.MOVEEND,RefreshControl,null);}}
function RefreshControl(){UpdatePanel('updAdvancedBufferSelections');}
function DisplayOptions(tool,panel){var optionsPanel=document.getElementById(panel);if(optionsPanel){if(optionsPanel.style.display!='none'){optionsPanel.style.display='none';}
else{optionsPanel.style.display='';var elm=document.getElementById("img_"+tool.ToolName);if(elm){var p=YAHOO.util.Dom.getXY(elm);p[1]+=15;var panelRect=optionsPanel.getBoundingClientRect();var panelWidth=panelRect.right-panelRect.left;var panelHeight=panelRect.bottom-panelRect.top;var pageWidth=YAHOO.util.Dom.getViewportWidth();var pageHeight=YAHOO.util.Dom.getViewportHeight();if(window.htmlDir&&htmlDir=="RTL")
{var imageRect=elm.getBoundingClientRect();var imageWidth=imageRect.right-imageRect.left;if(p[0]>(panelWidth-imageWidth))
p[0]=p[0]-panelWidth+imageWidth;}
else
{if(p[1]+panelHeight>pageHeight)
p[1]=Math.max((pageHeight-panelHeight-20),0);if(p[0]+panelWidth>pageWidth)
p[0]=Math.max((pageWidth-panelWidth-5),0);}
YAHOO.util.Dom.setXY(optionsPanel,p);}}}}
function HideOptionsPanel(panelId)
{var panel=document.getElementById(panelId);if(panel!=null)
{panel.style.display='none';}}
function SetLoadDivPosition(loadDivId,mapDivId)
{var loadDiv=document.getElementById(loadDivId);var screenSize=GetWindowCenterXY();if(loadDiv!=null&&screenSize!=null)
{loadDiv.style.left=screenSize.windowCenterX+"px";loadDiv.style.top=screenSize.windowCenterY+"px";}}
function GetWindowCenterXY()
{var broswerWidth=0,broswerHeight=0;var onpointSettings=GetOnPointSettings();var dynamicMapResizingEnabled=false;var mapCtrlId;if(onpointSettings!=null)
{dynamicMapResizingEnabled=onpointSettings.dynamicMapResizingEnabled;mapCtrlId="outer_"+onpointSettings.divId;}
var cWidth=0;var cHeight=0;if(dynamicMapResizingEnabled)
{if(typeof(window.innerWidth)=='number'){broswerWidth=window.innerWidth;broswerHeight=window.innerHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){broswerWidth=document.documentElement.clientWidth;broswerHeight=document.documentElement.clientHeight;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){broswerWidth=document.body.clientWidth;broswerHeight=document.body.clientHeight;}
cWidth=(broswerWidth/2)-20;cHeight=(broswerHeight/2)-20;}
else
{var dim=getElementDimensions(mapCtrlId);if(dim!=null)
{cWidth=dim.Left+dim.Width/2-20;cHeight=dim.Top+dim.Height/2-20;}}
if(window.g_globalProgressPanelId)
{var pElem=document.getElementById("ProgressDiv");if(pElem!=null){if(dynamicMapResizingEnabled)
{pElem.style.position="fixed";}
else{pElem.style.position="absolute";}
pElem.style.left=cWidth+"px";pElem.style.top=cHeight+"px";}}
return{windowCenterX:cWidth,windowCenterY:cHeight};}
function SetMapLookUpCaption(text){var header=NgGetElementById(_MapLookUpDivId+"_Text");if(header!=null){header.innerHTML=text;}}
var _lkpCounter=0;var _mlkpLaunchFrame;function ShowMapLookUp(url,x,y,frameName){_mlkpLaunchFrame=frameName;if(url.indexOf('?')>0)
url+='&random='+_lkpCounter++;else
url+='?random='+_lkpCounter++;url=NGServerUrl()+url;var container=NgGetElementById(_MapLookUpDivId);var iframe=NgGetElementById("MapLookUpIFrame");if(container!=null&&iframe!=null){iframe.contentWindow.document.body.innerHTML='';ShowLayer(_MapLookUpDivId,null,null);PopulateiFrame("MapLookUpIFrame",url,null,null);if(!isIE){var searchContainer=document.getElementById(_SearchLayer);x+=searchContainer.offsetLeft;y+=searchContainer.offsetTop+20;}
container.style.left=x+'px';container.style.top=y+'px';iframe.style.height="380px";iframe.style.width="430px";container.style.height="380px";container.style.width="430px";}}
function AdjustMapLookUpSize(width,height){var iframe=NgGetElementById("MapLookUpIFrame");if(iframe!=null){var oBody=iframe.contentWindow.document.body;if(isChrome())
height+=20;width=Math.max(width,oBody.scrollWidth+(oBody.offsetWidth-oBody.clientWidth));iframe.style.height=height+"px";iframe.style.width=width+"px";var container=NgGetElementById(_MapLookUpDivId);container.style.height=height+"px";container.style.width=width+"px";var containerLeft=parseInt(container.style.left);var containerTop=parseInt(container.style.top);var pageWidth=YAHOO.util.Dom.getViewportWidth();var pageHeight=YAHOO.util.Dom.getViewportHeight();if(containerTop+height>pageHeight)
container.style.top=Math.max((pageHeight-height-20),0)+"px";if(containerLeft+width>pageWidth)
container.style.left=Math.max((pageWidth-width-5),0)+"px";}}
function isChrome(){return navigator.userAgent.toLowerCase().indexOf('chrome')>-1;}
function RefreshSearchWindow(itemsAdded){HideLayer(_MapLookUpDivId,null,null);if(itemsAdded){var searchFrame=window.frames[_mlkpLaunchFrame];if(searchFrame&&searchFrame.PostBackSearch){searchFrame.PostBackSearch();}}}
function HideMapLookUp(){if(window._MapLookUpDivId){HideLayer(_MapLookUpDivId,null,null);}}
AdvBufferSelectionFunctions={DisplaySelectionLayers:function(){var container=document.getElementById('divBufSelectionLayers');if(container!=null){if(container.style.visibility=='visible'){container.style.visibility="hidden";}
else{if(PageMethods.GetSubjectLayers)
PageMethods.GetSubjectLayers(this.HandleSelectionLayers);}}
return false;},HandleSelectionLayers:function(response){if(response!=null){layers=eval(response);if(layers!=null&&layers.length>0){var elmSelect=document.getElementById('bufSelectionLayers');var selectedValue=document.getElementById(elmHiddenSubjectLayer);var container=document.getElementById('divBufSelectionLayers');if(elmSelect!=null&&selectedValue!=null&&container!=null){for(var i=0;i<elmSelect.options.length;i++)
elmSelect.options[i]=null;for(var i=0;i<layers.length;i++){var selected=(selectedValue.value!=null&&selectedValue.value==layers[i].id);elmSelect.options[i]=new Option(layers[i].text,layers[i].id,false,selected);}
container.style.visibility="visible";var table=document.getElementById('tblSelCombo');var location=YAHOO.util.Dom.getXY(table);if(location!=null&&location.length==2){YAHOO.util.Dom.setX(container,location[0]);YAHOO.util.Dom.setY(container,location[1]+20);}
var img=document.getElementById('imgShowLayers');var rects=img.getClientRects();if(rects&&rects.length>0){var width=rects[0].right-location[0];if(width>elmSelect.clientWidth){elmSelect.style.width=width;}}
elmSelect.focus();}}}},SelectedLayerChanged:function(){var elmLabel=document.getElementById('bufSelectedLayerCaption');if(elmLabel!=null){var elmSelect=document.getElementById('bufSelectionLayers');var text=elmSelect.options[elmSelect.selectedIndex].text;var value=elmSelect.options[elmSelect.selectedIndex].value;elmLabel.innerHTML=text;var selectedValue=document.getElementById(elmHiddenSubjectLayer);if(selectedValue!=null){selectedValue.value=value;}
var container=document.getElementById('divBufSelectionLayers');container.style.visibility="hidden";}}};function RefreshSearchFrame()
{var searchWin=document.getElementById(_SearchLayer);if(searchWin!=null)
{if(searchWin.style.display!="none")
{var searchFrame=window.frames[_SearchIframe];if(searchFrame&&searchFrame.UpdateSearchPanel){searchFrame.UpdateSearchPanel();}}}}
function InvokeMethods(funcName)
{var searchWin=document.getElementById(_SearchLayer);if(searchWin!=null)
{if(searchWin.style.display!="none")
{var searchFrame=window.frames[_SearchIframe];if(searchFrame&&searchFrame.InvokeMethod){searchFrame.InvokeMethod(funcName);}}}}
function ClearBufferRings(){if(window.top&&window.top.ShowLoading)
window.top.ShowLoading();if(window._BoxSelectionTools){HideLayer(_BoxSelectionTools,null,null);}}
function HandleSelOptionsMouseOut(e){var sourceElement=null;var targetElement=null;if(isIE){sourceElement=e.srcElement;targetElement=e.toElement;}
else{sourceElement=e.target;targetElement=e.relatedTarget;}
if(sourceElement.id!=null&&sourceElement.id=='SelectionOptions'){var node=targetElement.parentNode;while(node!=null){if(node==sourceElement){return;}
node=node.parentNode;}
sourceElement.style.display='none';}}
function ToggleSearchOptions(visible){if(window.searchOptionsToolBar){if(visible){ShowToolBar(searchOptionsToolBar);}
else{HideToolBar(searchOptionsToolBar);}}}
﻿var g_GEPlugin;var g_GEIgnoreViewChangeEnd=true;var g_hostInCustomGEMapTab=false;var TILT_DEGREE=30.0;function ShowGEPluginMap(hostInCustomMapTab,showSelections){var onPointSetting=GetOnPointSettings(null);if(onPointSetting!=null){var mapCtrlId=onPointSetting.id;var mapDiv=onPointSetting.divId;ShowHideControlsForPluginMaps(JsMapView.EARTH);if(window.g_GEPlugin!=null){try{window.g_GEPlugin.Dispose();}catch(e){Console.error(String.format('{0}:{1}| window.g_GEPlugin.Dispose() error - {2}','GEPlugin.js','ShowGEPluginMap',e.message));}}
function mapsLoaded(){var curLang="en";if(onPointSetting.curLanguage!=null&&onPointSetting.curLanguage.length>=2)
{curLang=onPointSetting.curLanguage.substr(0,2);}
google.earth.setLanguage(curLang);google.earth.createInstance(mapDiv,initCB,failureCB);}
function flyToPlace(lati,longi,range){var lookAt=g_GEPlugin.createLookAt('');lookAt.setLatitude(lati);lookAt.setLongitude(longi);lookAt.setRange(range);lookAt.setTilt(lookAt.getTilt()+TILT_DEGREE);g_GEPlugin.getView().setAbstractView(lookAt);}
function initCB(GEPluginInstance){g_GEPlugin=GEPluginInstance;g_GEPlugin.getWindow().setVisibility(true);g_GEPlugin.getNavigationControl().setVisibility(g_GEPlugin.VISIBILITY_AUTO);if(window.htmlDir&&htmlDir!="RTL"){g_GEPlugin.getNavigationControl().getScreenXY().setXUnits(g_GEPlugin.UNITS_PIXELS);g_GEPlugin.getNavigationControl().getScreenXY().setYUnits(g_GEPlugin.UNITS_INSET_PIXELS);}
g_GEPlugin.getOptions().setStatusBarVisibility(true);g_GEPlugin.getOptions().setScaleLegendVisibility(true);g_GEPlugin.getOptions().setFlyToSpeed(g_GEPlugin.SPEED_TELEPORT);g_GEIgnoreViewChangeEnd=true;g_GEPlugin.getLayerRoot().enableLayerById(g_GEPlugin.LAYER_BORDERS,true);g_GEPlugin.getLayerRoot().enableLayerById(g_GEPlugin.LAYER_ROADS,true);g_GEPlugin.getLayerRoot().enableLayerById(g_GEPlugin.LAYER_BUILDINGS,true);flyToPlace(onPointSetting.curCenterLat,onPointSetting.curCenterLon,onPointSetting.currentExtentWidth);if(showSelections){setPlacemarks();}
InitializeLyrMgr('lmTree',onPointSetting.mapSrcId,mapCtrlId,'');}
function failureCB(errorCode){}
try{google.load("earth","1",{"callback":mapsLoaded});}catch(e){}
g_hostInCustomGEMapTab=hostInCustomMapTab;if(hostInCustomMapTab){var holderDiv=document.getElementById('ctmMapTabUseDiv');if(holderDiv!=null){holderDiv.setAttribute('class','btnViewBarBg');holderDiv.setAttribute('className','btnViewBarBg');var btnRoads=CreateButton('btnRoads','btnRoads',JsMapViewLanguageConstants.ROADS,'btnViewBar');btnRoads.onclick=function(){ToggleGESubMapTab(true,JsMapView.ROADS);}
holderDiv.appendChild(btnRoads);var btnSatellite=CreateButton('btnSatellite','btnSatellite',JsMapViewLanguageConstants.SATELLITE,'btnViewBar');btnSatellite.onclick=function(){ToggleGESubMapTab(true,JsMapView.SATELLITE);}
holderDiv.appendChild(btnSatellite);var btnHybrid=CreateButton('btnHybrid','btnHybrid',JsMapViewLanguageConstants.HYBRID,'btnViewBar');btnHybrid.onclick=function(){ToggleGESubMapTab(true,JsMapView.HYBRID);}
holderDiv.appendChild(btnHybrid);var btnTerrain=CreateButton('btnTerrain','btnTerrain',JsMapViewLanguageConstants.TERRAIN,'btnViewBar');btnTerrain.onclick=function(){ToggleGESubMapTab(true,JsMapView.TERRAIN);}
holderDiv.appendChild(btnTerrain);if((typeof google!='undefined'&&google.loader.KeyVerified)&&(!(window.g_allowGMAPViewBar&&window.g_allowGMAPEarthBtn==false))){var btnGoogleEarth=CreateButton('btnGoogleEarth','btnGoogleEarth',JsMapViewLanguageConstants.EARTH,'btnViewBar');btnGoogleEarth.setAttribute('class','btnViewBarSelected');btnGoogleEarth.setAttribute('className','btnViewBarSelected');holderDiv.appendChild(btnGoogleEarth);}
if(!(window.g_allowGMAPViewBar&&window.g_allowGMAPStreetViewBtn==false))
{var btnStreet=CreateButton('btnStreet','btnStreet',JsMapViewLanguageConstants.STREET,'btnViewBar');btnStreet.onclick=function(){ToggleGESubMapTab(true,JsMapView.STREET);}
holderDiv.appendChild(btnStreet);}}}
if(onPointSetting.dynamicMapResizingEnabled){var newMapSize=GetDynamicMapSize(mapCtrlId);SetGEPluginMapWindowSize(newMapSize,true);}}}
function setPlacemarks(){var selectionSetId=window.__activeSelectionSetId;if(selectionSetId!=null){if(!sessionExpired){PageMethods.GetActiveSelectionFeatures(HandleSetPlacemarks);}
else{HandleSessionExpired();}}}
function HandleSetPlacemarks(response){if(response!=null&&response.length>0){for(var i=0;i<response.length;i++){var feature=response[i];if(feature!=null&&feature.length>0){var featureDetails=feature.split(",");var contentStringHtml='<div style="border: 1px solid black; background: yellow; padding: 5px;"> '+'<a href="#" onclick="ShowStreeView('+featureDetails[1]+','+featureDetails[0]+');infoBox.close();">Street View</a><\/div>';var placemark=createPlacemark(featureDetails[1],featureDetails[0],contentStringHtml,featureDetails[2]);}}}}
function createPlacemark(pointLatitude,pointLongitude,html,index){var contentString=html;var icon=g_GEPlugin.createIcon('');var image="http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld="+index.toString()+"|FF0000|000000";icon.setHref(image);var style=g_GEPlugin.createStyle('');style.getIconStyle().setIcon(icon);var point=g_GEPlugin.createPoint('');point.setLatitude(pointLatitude);point.setLongitude(pointLongitude);var pointPlacemark=g_GEPlugin.createPlacemark('');pointPlacemark.setGeometry(point);pointPlacemark.setStyleSelector(style);g_GEPlugin.getFeatures().appendChild(pointPlacemark);}
function RefreshPlacemarks(){if(window.__activeSelectionSetId){deletePlacemarks();setPlacemarks();}}
function deletePlacemarks(){var placemarks=g_GEPlugin.getFeatures().getChildNodes();for(var i=0;i<placemarks.getLength();i++){g_GEPlugin.getFeatures().removeChild(placemarks.item(i));}}
function SetGEPluginMapWindowSize(mapSize,forceResize){try{if(window.g_GEPlugin||forceResize){var onPointSetting=GetOnPointSettings(null);if(onPointSetting!=null){if(onPointSetting.useEmbeddedMapContainer){EmbeddedMapContainerResize(mapSize.width,onPointSetting.embeddedMapContainerHeight);}
var mapWidth=mapSize.width;var mapHeight=mapSize.height;if(g_hostInCustomGEMapTab){mapHeight=mapHeight-25;}
else{mapHeight=mapHeight-5;}
var outerMapDivReference=getObject("outer_map_"+onPointSetting.id);if(outerMapDivReference!=null){if((parseInt(outerMapDivReference.style.width)!=mapWidth)||(parseInt(outerMapDivReference.style.height)!=mapHeight)){outerMapDivReference.style.width=mapWidth+"px";outerMapDivReference.style.height=mapHeight+"px";var mapDivReference=getObject("map_"+onPointSetting.id);if((parseInt(mapDivReference.style.width)!=mapWidth)||(parseInt(mapDivReference.style.height)!=mapHeight)){mapDivReference.style.width=mapWidth+"px";mapDivReference.style.height=mapHeight+"px";}}
if(onPointSetting.clientOnResizeEndJS!=null){eval(onPointSetting.clientOnResizeEndJS);}
try{}catch(e){Console.error(String.format('{0}::{1}| window.g_GEPlugin.Resize error - {2}','GEPlugin.js','SetGEPluginMapWindowSize',e.message));}}}}}catch(e){}}
function UpdateMapTabExtentsFromEarth(){try{if(window.g_GEPlugin!=null){var lookatTilt=g_GEPlugin.getView().copyAsLookAt(g_GEPlugin.ALTITUDE_RELATIVE_TO_GROUND);lookatTilt.setTilt(0.0);lookatTilt.setHeading(0.0);g_GEPlugin.getView().setAbstractView(lookatTilt);var m_KmlLatLonBox=g_GEPlugin.getView().getViewportGlobeBounds();var northLatitude=m_KmlLatLonBox.getNorth();var southLatitude=m_KmlLatLonBox.getSouth();var eastLongitude=m_KmlLatLonBox.getEast();var westLongitude=m_KmlLatLonBox.getWest();if(westLongitude==-180){westLongitude++;}
if(eastLongitude==180){eastLongitude--;}
if(southLatitude==-90){southLatitude++;}
if(northLatitude==90){northLatitude--;}
if(_Onpoint.MapHistory){var onPointSetting=GetOnPointSettings(null);_Onpoint.MapHistory.UpdateMapTabExtentsFromLatLong(onPointSetting.mapSrcId,westLongitude,southLatitude,eastLongitude,northLatitude);}}}
catch(e){}}
function CreateInfoBalloon(url)
{if(window.g_GEPlugin)
{var iframeHeight=530;var iframeWidth=550;var infoFrame=document.getElementById(_InfoiFrame);var balloon=g_GEPlugin.createHtmlDivBalloon('');if(infoFrame)
{iframeWidth=infoFrame.width;iframeHeight=infoFrame.height;}
balloon.setMinWidth(iframeWidth);balloon.setMaxWidth(iframeWidth);balloon.setMinHeight(iframeHeight);balloon.setMaxHeight(iframeHeight);var balloonDiv=document.createElement('DIV');balloonDiv.innerHTML='<iframe frameborder="0" style="height: 100%; width: 100%;" src="'+url+'"/>;'
balloon.setContentDiv(balloonDiv);g_GEPlugin.setBalloon(balloon);}}
if(window.g_OLMapCtrls==null)
{var g_OLMapCtrls=new Array();}
var g_mapControlId=null;var g_mapSourceSessionKey=null;var g_overviewMapMode=false;var g_subjectAreaMapMode=false;if(!window.g_crosshairsOn)
{var g_crosshairsOn=null;}
if(!window.g_mapCoordsOn)
{var g_mapCoordsOn=null;}
var isIE=(window.navigator.appName.toLowerCase().indexOf("microsoft")>=0);CursorType={DEFAULT:'default',CROSSHAIR:'crosshair',HAND:(isIE?'hand':'pointer'),HELP:'help',MOVE:'move',POINTER:(isIE?'hand':'pointer'),PROGRESS:'progress',TEXT:'text',WAIT:'wait'}
DrawMode={POINT:0,LINE:1,POLY_LINE:2,POLYGON:3,RECTANGLE:4,CIRCLE:5,DRAG:7,ZOOMBOX:8,MAPTIP:10,EDIT:25,NONE:100}
PanDirection={North:'NORTH',South:'SOUTH',East:'EAST',West:'WEST',NorthEast:'NORTHEAST',NorthWest:'NORTHWEST',SouthEast:'SOUTHEAST',SouthWest:'SOUTHWEST'}
JsMapView={DEFAULT:'DEFAULT',ROADS:'ROADS',SATELLITE:'SATELLITE',HYBRID:'HYBRID',TERRAIN:'TERRAIN',SHADED:'SHADED',EARTH:'EARTH',STREET:'STREET',BIRDSEYE:'BIRDSEYE'}
function InitializeOPMapControl(OLMap)
{if(g_OLMapCtrls==null)
{g_OLMapCtrls=new Array();}
if(g_crosshairsOn!=null)
{if(g_crosshairsOn)
OLMap.SetCrosshairsCtrlOn();else
OLMap.SetCrosshairsCtrlOff();}
if(g_mapCoordsOn!=null)
{if(g_mapCoordsOn)
OLMap.SetDisplayCoordCtrlOn();else
OLMap.SetDisplayCoordCtrlOff();}
var values=document.getElementsByName('customParams')[0].value.split("|");g_mapControlId=values[0];g_mapSourceSessionKey=values[21];setAutoPostback(values[22]);g_subjectAreaMapMode=values[23];if(g_subjectAreaMapMode!=null)
{g_subjectAreaMapMode=(g_subjectAreaMapMode.toLowerCase()=="true");}
else
{g_subjectAreaMapMode=false;}
g_OLMapCtrls.push(OLMap);if(g_overviewMapMode==true)
{getOverviewMap(g_mapControlId);}
try
{if(GeoRSSCollection)
{var opSettings=GetOnPointSettings();var mapId=opSettings.mapSrcId
if(MapTabId[mapId]!=null)
{GeoRSSCollection=MapTabId[mapId];applyGeoRSS();}}}
catch(e)
{}
if(!OLMap.inHTMLEmbedMode)
{if(!g_subjectAreaMapMode)
{if(OLMap.hasMapTips)
{OLMap.AddEventCallback(OLMap.MAPEVENT_TYPES.ZOOMEND,UpdateMapTips);OLMap.showMapTipCallback=ShowMapTipDialog;OLMap.hideMapTipHandler=HidePopupDialog;}
OLMap.showSelectionTipCallBack=ShowSelectionTip;OLMap.hideSelectionTipCallBack=HideSelectionTip;}}
try
{MAPTOOLS.ClickFirstTool();}
catch(ex){}
try
{OLMap.AddEventCallback(OLMap.MAPEVENT_TYPES.MOVEEND,UpdateMapHistory);UpdateMapHistory();}
catch(ex){}
if(OLMap.isPicPixelCoordMap){try{OLMap.AddEventCallback(OLMap.MAPEVENT_TYPES.MOVEEND,_UpdateSmartNavigator);}
catch(e){}}}
function SetDrawMode(mode)
{var callBackMethod='DefaultDrawModeCallback';try
{if(arguments.length>1)
{callBackMethod=arguments[1];if(callBackMethod!=null&&callBackMethod.indexOf('(')>0)
{callBackMethod=callBackMethod.substr(0,callBackMethod.indexOf('('));}}}catch(ex){}
SetMapCtrlDrawMode(null,mode,callBackMethod);}
function SetMapCtrlDrawMode(mapCtrlId,mode,callBackMethod)
{try
{var mapCtrl=GetMapCtrl(mapCtrlId);var tempMode;for(var i in DrawMode)
{if(mode==DrawMode[i])
{tempMode=mode;break;}}
if(tempMode==mode)
{switch(mode)
{case DrawMode.POINT:mapCtrl.SetMapMode(mapCtrl.MAPCTRL_MODES.DRAWPOINT,callBackMethod);break;case DrawMode.LINE:mapCtrl.SetMapMode(mapCtrl.MAPCTRL_MODES.DRAWLINE,callBackMethod);break;case DrawMode.POLY_LINE:mapCtrl.SetMapMode(mapCtrl.MAPCTRL_MODES.DRAWPOLYLINE,callBackMethod);break;case DrawMode.POLYGON:mapCtrl.SetMapMode(mapCtrl.MAPCTRL_MODES.DRAWPOLYGON,callBackMethod);break;case DrawMode.CIRCLE:mapCtrl.SetMapMode(mapCtrl.MAPCTRL_MODES.DRAWCIRCLE,callBackMethod);break;case DrawMode.RECTANGLE:mapCtrl.SetMapMode(mapCtrl.MAPCTRL_MODES.DRAWRECTANGLE,callBackMethod);break;case DrawMode.DRAG:mapCtrl.SetMapMode(mapCtrl.MAPCTRL_MODES.DRAG);break;case DrawMode.ZOOMBOX:if(!window.m_lastActiveToolBar||!m_lastActiveToolBar)
{alert("No tool selected. Please select a tool");return;}
var selectedTool=m_lastActiveToolBar.GetSelectedTool().ToolName;switch(selectedTool)
{case"ZoomIn":mapCtrl.SetMapMode(mapCtrl.MAPCTRL_MODES.ZOOMIN);break;case"ZoomOut":mapCtrl.SetMapMode(mapCtrl.MAPCTRL_MODES.ZOOMOUT);break;}
break;case DrawMode.NONE:mapCtrl.SetMapMode(mapCtrl.MAPCTRL_MODES.NONE);break;case DrawMode.MAPTIP:mapCtrl.SetMapMode(mapCtrl.MAPCTRL_MODES.MAPTIP);break;}}}
catch(e)
{}}
function ConvertPointToPixel(point,mapCtrlId)
{var mapCtrl=GetMapCtrl(mapCtrlId);var lonlat=new OpenLayers.LonLat(point.x,point.y);var pixel=mapCtrl.getViewPortPxFromLonLat(lonlat);return pixel;}
function CovertPixelToPoint(pixel,mapCtrlId)
{var mapCtrl=GetMapCtrl(mapCtrlId);var lonlat=mapCtrl.getLonLatFromViewPortPx(pixel);var point=new OpenLayers.Geometry.Point(lonlat.lon,lonlat.lat);return point;}
function RefreshMap(mapCtrlId)
{var mapCtrl=GetMapCtrl(mapCtrlId);if(mapCtrl){mapCtrl.RefreshMap();}
else{if(window.g_map2D){RefreshMarkers();}
else if(window.g_GEPlugin){RefreshPlacemarks();}}}
function ReloadMap()
{var onPointSetting=GetOnPointSettings();var mapDiv=document.getElementById(onPointSetting.divId);if((onPointSetting.mapWidth!=null)&&(onPointSetting.mapHeight!=null))
{mapDiv.style.width=onPointSetting.mapWidth;mapDiv.style.height=onPointSetting.mapHeight;}
var mapCtrlId=onPointSetting.id;var initFuncName=onPointSetting.mapCtrlInitFuncName;RemoveMapCtrl(onPointSetting.id,true);eval(initFuncName);}
function ToggleCoordinateDisplayState(mapCtrlId)
{var mapCtrl=GetMapCtrl(mapCtrlId);if(mapCtrl.displayCoordinatesEnabled)
{mapCtrl.SetDisplayCoordCtrlOff();g_mapCoordsOn=false;}
else
{mapCtrl.SetDisplayCoordCtrlOn();g_mapCoordsOn=true}}
function ToggleCrosshairsState(mapCtrlId)
{var mapCtrl=GetMapCtrl(mapCtrlId);if(mapCtrl.crosshairsEnabled)
{mapCtrl.SetCrosshairsCtrlOff();g_crosshairsOn=false;}
else
{mapCtrl.SetCrosshairsCtrlOn();g_crosshairsOn=true;}}
function doFullView(mapCtrlId)
{var mapCtrl=GetMapCtrl(mapCtrlId);mapCtrl.zoomToMaxExtent();}
function PanClicked(dir,mapCtrlId)
{var mapCtrl=GetMapCtrl(mapCtrlId);mapCtrl.PanInitialize();switch(dir)
{case PanDirection.North:mapCtrl.PanMap(mapCtrl.PAN_DIRECTIONS.NORTH);break;case PanDirection.South:mapCtrl.PanMap(mapCtrl.PAN_DIRECTIONS.SOUTH);break;case PanDirection.East:mapCtrl.PanMap(mapCtrl.PAN_DIRECTIONS.EAST);break;case PanDirection.West:mapCtrl.PanMap(mapCtrl.PAN_DIRECTIONS.WEST);break;case PanDirection.NorthEast:mapCtrl.PanMap(mapCtrl.PAN_DIRECTIONS.NORTHEAST);break;case PanDirection.NorthWest:mapCtrl.PanMap(mapCtrl.PAN_DIRECTIONS.NORTHWEST);break;case PanDirection.SouthEast:mapCtrl.PanMap(mapCtrl.PAN_DIRECTIONS.SOUTHEAST);break;case PanDirection.SouthWest:mapCtrl.PanMap(mapCtrl.PAN_DIRECTIONS.SOUTHWEST);break;default:break;}
mapCtrl.PanFinalize();}
function doOverviewMap(path,mapCtrlId)
{if(!sessionExpired)
{var onPointSetting=GetOnPointSettings();if(onPointSetting!=null&&onPointSetting.displayEmbeddedOverviewMap.toLowerCase()=="true")
{ToggleEmbeddedOverviewMap(mapCtrlId);}
else
{var ovMapStateElemId=NgGetElementById(_MapOverViewLayer+'_SaveBorderStyle');if(ovMapStateElemId!=null)
{if(ovMapStateElemId==null||ovMapStateElemId.value=="block")
{HideLayer(_MapOverViewLayer,null,null);}
else
{if(window.HandleOverviewMapFrame)
{HandleOverviewMapFrame(path);}
if(window.overviewMapWidth==null)
overviewMapWidth=180;if(window.overviewMapHeight==null)
overviewMapHeight=160;getOverviewMap(mapCtrlId);}}}}}
function doLegend(path)
{if(!sessionExpired)
{if(path==null)
{if(window.NGServerUrl)
{path=NGServerUrl()+"/WebPages/Map/Legend.aspx";}
else
{path=appBasePath+"/WebPages/Map/Legend.aspx";}}
if(window.HandleLegendFrame)
{HandleLegendFrame(path);}
else
{var legend=window.open(path,"Legend","titlebar=no,toolbar=no,width=400,height=500,left=20,top=20,status=no,resizable=yes");legend.focus();}}
else
{HandleSessionExpired();}}
function doZoomToScale(scale)
{var mapCtrlId=null;var mapCtrl=GetMapCtrl(mapCtrlId);if(scale)
{scale=UndoLocalFormat(scale,mapCtrlId);if(Number(scale))
{if(parseInt(scale)!=0)
{var currentScale=Math.round(mapCtrl.getScale());if(scale<mapCtrl.maxScale&&currentScale<=mapCtrl.maxScale)
{mapCtrl.UpdateMapScale();}
else
{mapCtrl.zoomToScale(parseFloat(scale));}}
else
{mapCtrl.zoomToScale(1);}}
else
{alert("Please enter numeric values.");mapCtrl.UpdateMapScale();}}
else
{mapCtrl.UpdateMapScale();}}
function doZoomToLevel(scaleLevel)
{if(scaleLevel!=null)
{var mapCtrlId=null;var mapCtrl=GetMapCtrl(mapCtrlId);mapCtrl.zoomTo(scaleLevel);}}
function HandleServerResponse(obj)
{if(obj){if(obj.error==null)
{var xmlStr=null;if(obj.value)
xmlStr=obj.value;else
xmlStr=obj;try
{if(isIE)
{objXmlDoc=new ActiveXObject("Msxml2.DOMDocument");objXmlDoc.loadXML(xmlStr);}
else
{objXmlDoc=new DOMParser().parseFromString(xmlStr,"text/xml");}
if(objXmlDoc){var errorNodes=objXmlDoc.getElementsByTagName("ERROR");if(errorNodes!=null&&errorNodes.length>0)
{var message=getAttributeValue(errorNodes[0],"message");if(message!=null&&message.length>0)
{alert(message);}}
else
{try{RefreshMapContents(objXmlDoc);}catch(ex){}}}}
catch(ex)
{alert('HandleServerResponse - exception:'+ex.message);}}
else
{alert(obj.error.Message);}}}
function RefreshMapContents(xmlDocument,mapCtrlId)
{var mapCtrl=GetMapCtrl(mapCtrlId);if(xmlDocument!=null)
{var mapNode=xmlDocument.getElementsByTagName("MAP")[0];var valid=getAttributeValue(mapNode,"valid");if(valid=='True')
{document.getElementById('spanInvalidMapMessage').style.visibility='hidden';var urlNodeList=xmlDocument.getElementsByTagName("MAPURL");if(urlNodeList&&urlNodeList.length>0)
{var imageURLs="";for(i=0;i<urlNodeList.length;i++)
{var url=getAttributeValue(urlNodeList.item(i),"url");if(url!=null&&url.length>0)
{if(imageURLs.length>0)
{imageURLs+="|";}
imageURLs+=url;mapCtrl.useOPCachedImages=true;}}
mapCtrl.mapImageURLs=imageURLs;}
var extentNode=xmlDocument.getElementsByTagName("EXTENTS");var fzlNode=xmlDocument.getElementsByTagName("FIXEDZOOMLEVEL");var scaleNode=xmlDocument.getElementsByTagName("SCALE");if(extentNode&&extentNode.length>0)
{var xmin=parseFloat(getAttributeValue(extentNode.item(0),"minx"));var ymin=parseFloat(getAttributeValue(extentNode.item(0),"miny"));var xmax=parseFloat(getAttributeValue(extentNode.item(0),"maxx"));var ymax=parseFloat(getAttributeValue(extentNode.item(0),"maxy"));var bounds=new OpenLayers.Bounds(xmin,ymin,xmax,ymax);mapCtrl.zoomToExtent(bounds,true);}
else if(fzlNode!=null&&fzlNode.length>0)
{var zoomLevel=parseFloat(getAttributeValue(fzlNode.item(0),"value"));mapCtrl.zoomTo(zoomLevel);}
else if(scaleNode!=null&&scaleNode.length>0)
{var scale=parseFloat(getAttributeValue(scaleNode.item(0),"value"));mapCtrl.zoomToScale(scale);}
var tool=FindTool(/PreviousMap$/);if(tool!=null)
{var previousMapNodes=xmlDocument.getElementsByTagName("PREVIOUSMAP");if(previousMapNodes!=null&&previousMapNodes.length>0)
{var available=getAttributeValue(previousMapNodes.item(0),"available");(available=='True')?tool.Enable():tool.Disable();}}
tool=FindTool(/NextMap$/);if(tool!=null)
{var nextMapNodes=xmlDocument.getElementsByTagName("NEXTMAP");if(nextMapNodes!=null&&nextMapNodes.length>0)
{var available=getAttributeValue(nextMapNodes.item(0),"available");(available=='True')?tool.Enable():tool.Disable();}}}
else
{document.getElementById('spanInvalidMapMessage').style.visibility='visible';}}}
function getAttributeValue(node,attributeName)
{if(node&&node.attributes)
{attrNode=node.attributes.getNamedItem(attributeName);if(attrNode)
return attrNode.nodeValue;}}
function getObject(id)
{return document.getElementById(id);}
function showObject(theObj)
{if(theObj)
theObj.style.visibility="visible";}
function hideObject(theObj)
{if(theObj)
theObj.style.visibility="hidden";}
function GetMapCtrl(mapCtrlId)
{var mapCtrl=null;if(mapCtrlId==null)
{mapCtrl=g_OLMapCtrls[0];}
else
{for(var i=0;i<g_OLMapCtrls.length;i++)
{if(g_OLMapCtrls[i].id==mapCtrlId)
{mapCtrl=g_OLMapCtrls[i];break;}}}
return mapCtrl;}
function ShowLoading(mapCtrlId)
{try
{var mapCtrlId=(mapCtrlId!=null)?mapCtrlId:g_OLMapCtrls[0].id;var objName="LoadDiv_"+mapCtrlId;var loadObj=getObject(objName);ShowLoading1(mapCtrlId);showObject(loadObj);}
catch(e)
{}}
function HideLoading(mapCtrlId)
{try
{var mapCtrlId=(mapCtrlId!=null)?mapCtrlId:g_OLMapCtrls[0].id;var objName="LoadDiv_"+mapCtrlId;var loadObj=getObject(objName);HideLoading1();hideObject(loadObj);}
catch(e)
{}}
function getOverviewMap(mapCtrlId)
{try
{var mapCtrl=GetMapCtrl(mapCtrlId);var overviewDiv="Overview_"+mapCtrl.id;mapCtrl.SetOverviewMap(overviewDiv);g_overviewMapMode=true;}
catch(e){}}
function OnCloseOverviewMap(mapCtrlId)
{try
{var mapCtrl=GetMapCtrl(mapCtrlId);var overviewDiv="Overview_"+mapCtrl.id;mapCtrl.ClearOverviewMap(overviewDiv);g_overviewMapMode=false;}
catch(e){}}
function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){if(oldonload){oldonload();}
func();}}}
if(window.g_resizeScript==null)
{var g_resizeScript='';}
function OnWindowResize(scriptToRun){g_resizeScript+=scriptToRun;}
var resizeTimer=setTimeout(resizeHandler,1);var g_resizeEventEnabled=true;function resizeHandler(){window.onresize=function()
{if(g_resizeEventEnabled)
{try
{eval(g_resizeScript);}
catch(e)
{}
doResize();window.onresize=function(){;};clearTimeout(resizeTimer);resizeTimer=setTimeout(resizeHandler,1);}}}
window.onresize=resizeHandler;function doResize()
{try
{var mapCtrlId=null;var mapCtrl=GetMapCtrl(mapCtrlId);var onPointSetting=GetOnPointSettings(mapCtrlId);var mapheight=0;if(mapCtrl!=null)
{if(onPointSetting.dynamicMapReposition)
{mapCtrl.useOPCurrentImages=true;mapCtrl.RefreshMap();}
else
{if(IsBrowserResized(mapCtrl))
{mapCtrl.OnBrowserResize();}}
mapheight=mapCtrl.size.h;}
else
{if(onPointSetting!=null){if(onPointSetting.dynamicMapResizingEnabled){var newMapSize=GetDynamicMapSize(mapCtrlId);if(window.g_veBEMap){try{SetVEPluginMapWindowSize(newMapSize);}
catch(e){}}
if(window.g_GEPlugin){try{SetGEPluginMapWindowSize(newMapSize,false);}catch(e){}}
if(window.g_map2D){try{SetGSPluginMapWindowSize(newMapSize);}catch(e){}}
if(ImgNav){try{SetPictoMapWindowSize(newMapSize);}
catch(e){}}
if(window.g_veBEMap||window.g_GEPlugin||window.g_map2D||ImgNav){if(g_hostInCustomMapTab){mapheight=newMapSize.height-25;}
else{mapheight=newMapSize.height-5;}}}}}
var tblContainer=NgGetElementById('tblMapContainer');if(tblContainer!=null&&mapheight>0){tblContainer.height=mapheight-15+"px";tblContainer.style.height=mapheight-15+"px";}}
catch(Ex)
{}}
function IsBrowserResized(mapCtrl)
{var isResized=true;if(document.documentMode&&mapCtrl!=null){isResized=false;var oldSize=mapCtrl.getCurrentSize();var newSize=GetDynamicMapSize(mapCtrl.id);if(oldSize.h!=(newSize.height-26))
{isResized=true;}}
return isResized;}
function ClearMeasure()
{try
{var mapCtrlId=null;var mapCtrl=GetMapCtrl(mapCtrlId);mapCtrl.EraseAllDrawing();if(measureDiv)
OpenLayers.Util.getElement(measureDiv).innerHTML='';}
catch(Ex)
{}}
function GetExtents(mapCtrlId)
{try
{var mapCtrl=GetMapCtrl(mapCtrlId);var mapExtents=mapCtrl.getExtent();return mapExtents.left+","+mapExtents.bottom+","+mapExtents.right+","+mapExtents.top;}
catch(e)
{}}
var g_LastDrawFeature;function DefaultDrawModeCallback(feature)
{g_LastDrawFeature=feature;}
function GetLastShape()
{try
{var point=g_LastDrawFeature[0].geometry;var result=point.x+"|"+point.y;return result;}
catch(e)
{}}
function ToggleEmbeddedOverviewMap(mapCtrlId){var mapCtrl=GetMapCtrl(mapCtrlId);if(mapCtrl.embeddedOverviewMapOn){mapCtrl.SetEmbeddedOverviewMapOff();}
else{mapCtrl.SetEmbeddedOverviewMapOn();}}
function EmbeddedMapContainerResize(width,height){var onPointSetting=GetOnPointSettings(null);if(onPointSetting!=null){var containerDivId="embeddedMapTools_"+onPointSetting.id;var containerDiv=document.getElementById(containerDivId);if(containerDiv!=null){containerDiv.style.width=width;containerDiv.style.height=height;}}}
function TriggerMapMove(mapCtrl)
{try
{mapCtrl.delayMoveTo(mapCtrl.delayLonLat,mapCtrl.delayZoom,mapCtrl.delayOptions);}
catch(e)
{}}
function ToggleVESubMapTab(selectedView){_Onpoint.VESubMapTab.ToggleVESubMapTab(selectedView);UpdatePanel('Global|PluginMapTabSelected');}
function ToggleGESubMapTab(jsMapVisible,selectedView){var mapCtrlId;var onPointSetting=GetOnPointSettings(null);if(onPointSetting!=null){mapCtrlId=onPointSetting.id;}
ShowLoading(mapCtrlId);disposeGoogleMapObject();if(NgGetElementById(_BoxStreetView)!=null){HideLayer(_BoxStreetView,null,null);}
_Onpoint.GESubMapTab.ToggleGESubMapTab(jsMapVisible,selectedView);UpdatePanel('Global|PluginMapTabSelected');OnRequestEndHandler("HideLoading('"+mapCtrlId+"');");}
function ShowHideControlsForPluginMaps(selectedView)
{window.g_GMAPCurrentView=selectedView;if(selectedView==JsMapView.EARTH||selectedView==JsMapView.STREET||selectedView==JsMapView.BIRDSEYE)
{if(selectedView==JsMapView.EARTH||selectedView==JsMapView.STREET)
{if(document.getElementById("tblAboutThisSite")!=null)document.getElementById("tblAboutThisSite").style.display='none';}
if(document.getElementById("tblRightSideTools")!=null)document.getElementById("tblRightSideTools").style.display='none';if(document.getElementById("tblAdvancedTools")!=null)document.getElementById("tblAdvancedTools").style.display='none';if(document.getElementById("tblMapViews")!=null)document.getElementById("tblMapViews").style.display='none';if(document.getElementById("tblDashboard")!=null)document.getElementById("tblDashboard").style.display='none';if(document.getElementById("tblSearches")!=null)document.getElementById("tblSearches").style.display='none';if(document.getElementById("tblShoppingCartClassic")!=null)document.getElementById("tblShoppingCartClassic").style.display='none';HideSelectionTip();HideAllBoxes();if(selectedView==JsMapView.STREET)
ShowLayer(_BoxStreetView,null,null);}
else
{if(document.getElementById("tblRightSideTools")!=null)document.getElementById("tblRightSideTools").style.display='block';if(document.getElementById("tblAdvancedTools")!=null)document.getElementById("tblAdvancedTools").style.display='block';if(document.getElementById("tblMapViews")!=null)document.getElementById("tblMapViews").style.display='block';if(document.getElementById("tblDashboard")!=null)document.getElementById("tblDashboard").style.display='block';if(document.getElementById("tblSearches")!=null)document.getElementById("tblSearches").style.display='block';if(document.getElementById("tblShoppingCartClassic")!=null)document.getElementById("tblShoppingCartClassic").style.display='block';if(document.getElementById("tblAboutThisSite")!=null)document.getElementById("tblAboutThisSite").style.display='block';HideLayer(_BoxStreetView,null,null);}}
function txtScale_OnKeyPress(e,btnGoId)
{var keynum;if(window.event)
{keynum=e.keyCode;}
else if(e.which)
{keynum=e.which;}
Console.debug("txtScale_OnKeyPress : keynum :"+keynum);if(keynum==13)
{var btnGoElem=document.getElementById(btnGoId);if(btnGoElem!=null)
{btnGoElem.click();btnGoElem.focus();}}
return true;}
function HideMenuDiv(evt){Console.debug("HideMenuDiv start");if(!evt)var evt=window.event;var tg=(window.event)?evt.srcElement:evt.target;if(tg.nodeName!='DIV')return;var reltg=(evt.relatedTarget)?evt.relatedTarget:evt.toElement;while(reltg!=tg&&reltg.nodeName!='BODY')
reltg=reltg.parentNode
if(reltg==tg)return;Console.debug("HideMenuDiv layer exit");var cm=document.getElementById('mcContextMenu');cm.style.display="none";}
var _imgDispCS=null;function SelectDisplayCoordSys(event,img,mapCtrlId,mapSrcId)
{_imgDispCS=img;var container=document.getElementById('divDisplayCS');var selElement=document.getElementById('selDisplayCoordSys');if(container!=null&&selElement!=null)
{if(container.style.visibility=='visible')
{container.style.visibility='hidden';}
else
{if(selElement.options.length==0)
{if(window.PageMethods&&PageMethods.GetDisplayCoordinates)
{PageMethods.GetDisplayCoordinates(mapCtrlId,mapSrcId,HandleDisplayCS);}}
else
{PositionDisplayCS();event.cancelBubble=true;}}}}
function HandleDisplayCS(resp)
{if(resp!=null&&resp.length>0)
{try
{eval(resp);}
catch(ex)
{return;}
var selElement=document.getElementById('selDisplayCoordSys');var mapop=GetMapCtrl(resp.mapctrid);if(selElement!=null&&mapop!=null)
{var proj=mapop.GetDisplayProjection();var projCode=proj?proj.getCode():null;for(var i=0;i<selElement.options.length;i++)
selElement.options[i]=null;for(var i=0;i<resp.css.length;i++)
{var option=new Option(resp.css[i].name,resp.css[i].code+"|"+resp.css[i].id);selElement.options[i]=option;if(projCode=='EPSG:'+resp.css[i].code)
option.selected=true;}
var container=document.getElementById('divDisplayCS');if(container!=null)
{container.style.visibility='visible';container.style.zIndex=10000;if(window.navigator.appVersion.indexOf("MSIE 6.")>0){window.setTimeout(PositionDisplayCS,10);}
else{PositionDisplayCS();}}}}}
function PositionDisplayCS()
{var container=document.getElementById('divDisplayCS');var location=YAHOO.util.Dom.getXY(_imgDispCS);var imageBoundary=_imgDispCS.getBoundingClientRect();var imageWidth=imageBoundary.right-imageBoundary.left;var imageHeight=imageBoundary.bottom-imageBoundary.top
container.style.visibility='visible';container.style.zIndex=10000;var containerBoundary=container.getBoundingClientRect();var containerWidth=containerBoundary.right-containerBoundary.left;var containerHeight=containerBoundary.bottom-containerBoundary.top;location[0]=location[0]-containerWidth+imageWidth;var viewHeight=YAHOO.util.Dom.getViewportHeight();var scrolHeight=location[1]+containerHeight-document.documentElement.scrollTop;if(viewHeight<scrolHeight)
{location[1]=location[1]-containerHeight;}
else
{location[1]=location[1]+imageHeight;}
YAHOO.util.Dom.setXY(container,location);OPAddEventListener(document,"click",HideDisplayCSDropDown);}
function HideDisplayCSDropDown()
{var container=document.getElementById('divDisplayCS');if(container!=null)
container.style.visibility='hidden';OPRemoveEventListener(document,"click",HideDisplayCSDropDown);}
function OnChangeDisplayCoordSys(selElement,mapCtrlId)
{if(selElement!=null)
{var selectedValue=selElement.options[selElement.selectedIndex].value;_imgDispCS.title=selElement.options[selElement.selectedIndex].text;if(window.Proj4js.defs)
{var values=selectedValue.split('|');if(Proj4js.defs['EPSG:'+values[0]]!=null)
{var mapop=GetMapCtrl(mapCtrlId);var proj=new OpenLayers.Projection('EPSG:'+values[0]);mapop.ChangeDisplayProjection(proj);}
else
{PageMethods.GetProj4Def(parseInt(values[1]),values[0],mapCtrlId,ChangeDisplayCoordSys);}}}
var container=document.getElementById('divDisplayCS');if(container!=null)
container.style.visibility='hidden';}
function ChangeDisplayCoordSys(resp)
{if(resp!=null&&resp.length>0)
{try
{eval(resp);}
catch(ex)
{return;}
Proj4js.defs['EPSG:'+resp.code]=resp.proj4;var mapop=GetMapCtrl(resp.mapctrid);if(mapop!=null)
{var proj=new OpenLayers.Projection('EPSG:'+resp.code);mapop.ChangeDisplayProjection(proj);}}}
function LaunchCoordSysHelp(url)
{var hndl=window.open(url,"CoordSysHelp");hndl.focus();}
﻿function _CustomJSErrorHandler(desc,page,line,chr){Console.error(String.format('CUSTOM JS ERROR HANDLER |Error description: {0}, Page: {1}, Line: {2}, Chr: {3}',desc,page,line,chr));return true;}
function _DefaultJSErrorHandler(){return false;}
window.onerror=_CustomJSErrorHandler;if(window.g_initScript==null)
{var g_initScript='';}
function OnDOMLoaded(scriptToRun){g_initScript+=scriptToRun;}
function OnLoadHandler()
{if(_timer)clearInterval(_timer);try
{eval(g_initScript);}
catch(e)
{}
g_initScript='';try
{document.getElementById('dSuperimpose').style.display='none';}
catch(e)
{}};if(window._onloadHandled==null)
{if(document.addEventListener)
{document.addEventListener("DOMContentLoaded",OnLoadHandler,false);}
if(/WebKit/i.test(navigator.userAgent)){var _timer=setInterval(function()
{if(/loaded|complete/.test(document.readyState))
{OnLoadHandler();}},10);}
window.onload=OnLoadHandler;window._onloadHandled=true;OnDOMLoaded('ReadCookies();');}
function NGPostBack(target,arg)
{var finalargument='';if(arguments.length>0&&target!=null)
finalargument=target;if(arguments.length>1&&arg!=null)
finalargument=finalargument+'|'+arg;}
function OPAddEventListener(object,eventName,listener){if(object!=null&&eventName!=null&&listener!=null){if(eventName.substr(0,2)=='on'){eventName=eventName.substr(2);}
if(window.addEventListener){object.addEventListener(eventName,listener,false);}else{object.attachEvent("on"+eventName,listener);}}}
function OPRemoveEventListener(object,eventName,listener){if(object!=null&&eventName!=null&&listener!=null){if(eventName.substr(0,2)=='on'){eventName=eventName.substr(2);}
if(window.removeEventListener){object.removeEventListener(eventName,listener,false);}else{object.detachEvent("on"+eventName,listener);}}}
function UpdatePanel(panel)
{__doPostBack(_Target,panel);}
function CloseTool(toolBarName,toolName)
{__doPostBack(toolBarName,toolName);}
function CloseToolWithoutPostBack(toolname,resetDefaultTool)
{var ele=NgGetElementById(toolname);if(ele)
{ele.style.display="none";}
var hiddenEle=NgGetElementById(toolname+'_SaveBorderStyle');if(hiddenEle)
{hiddenEle.value='none';}
var boxEle=GetBoxItem(toolname);if(boxEle)
{boxEle.visible="none";}
if(resetDefaultTool)
{var defTool=ClickTool('ZoomIn');}}
function DisplayBox(toolname)
{var ele=NgGetElementById(toolname);if(ele)
{ele.style.display='block';SetZindex(ele);}
var hiddenEle=NgGetElementById(toolname+'_SaveBorderStyle');if(hiddenEle)
{hiddenEle.value='block';SetZindex(hiddenEle);}
var boxEle=GetBoxItem(toolname);if(boxEle)
{boxEle.visible="block";SetZindex(boxEle);}}
function IsPopupBlocker()
{var oWin=window.open("","testpopupblocker","width=10,height=10,top=5000,left=5000");if(oWin==null||typeof(oWin)=="undefined"){alert("Please allow popups on this site or you may not be able to access some of the functionalities. ");}else
{oWin.close();}
return;}
function ValidateBuffer(src,args)
{if(args!=null)
{args.IsValid=!isNaN(args.Value);}}
function NGServerUrl()
{var protocol=window.location.protocol;var theHost=window.location.hostname;var port=window.location.port;if(port)
{port=":"+port;}
var path=window.location.pathname;path=path.substring(0,path.indexOf("/",1));var newUrl=protocol+"//"+theHost+port+path;return newUrl;}
function NGNavigate(url,resolveUrl)
{var prefixServerUrl=new Boolean(resolveUrl);var newUrl=url;if(prefixServerUrl)
{newUrl=NGServerUrl()+url;}
window.location.href=newUrl;}
function SetDirection(elementID)
{try{var elm=NgGetElementById(elementID);var eLeft=parseInt(xreplace(elm.style.left,"px",""));var mapWidth=parseInt(xreplace(NgGetElementById("MapControlDiv").style.width,"px",""));if(elm.getAttribute("SetSmartNavValues")==null&&eLeft<50)
{if(eLeft==1)
mapWidth=mapWidth/4;if(htmlDir=="LTR")
{if(elm.style.left!="")
elm.style.left=eLeft+mapWidth+"px";}
else
{if(eLeft!=1&&eLeft<50)
eLeft=20;var cWidth=elm.clientWidth;if(cWidth==0)
cWidth=220;elm.style.left=document.body.clientWidth-mapWidth-cWidth-eLeft+"px";}}}catch(e){}}
function SetDirectionFlip(elementID)
{try{var elm=NgGetElementById(elementID);var eLeft=parseInt(xreplace(elm.style.left,"px",""));if(elm.getAttribute("SetSmartNavValues")==null)
{if(htmlDir=="RTL")
{if(elm.style.left!="")
elm.style.left=document.body.clientWidth-eLeft-elm.clientWidth+"px";}}}catch(e){}}
function NgOpenPopup(url,iWidth,iHeight,PopupTitle)
{NgOpenPopup(url,iWidth,iHeight,PopupTitle,false);}
function NgOpenPopup(url,iWidth,iHeight,PopupTitle,scrolling)
{var commoniFrame="commoniFrame";var commoniFrameWraper=_CommonPopupLayer;var popupTitleId="commoniFrameTitle";var _iFrame;try
{_iFrame=NgGetElementById(commoniFrame);}
catch(e){}
if(commoniFrameWraper!=null)
{var _iFrameLayer;try
{_iFrameLayer=NgGetElementById(commoniFrameWraper);}
catch(e){}
if(_iFrameLayer!=null)
{ShowLayer(commoniFrameWraper,null,null);_iFrameLayer.style.visibility='visible';}}
if(_iFrame!=null)
{ShowLayer(commoniFrame,null,null);_iFrame.style.visibility='visible';_iFrame.scrolling=(scrolling?"yes":"no");frames[commoniFrame].location.href=url;if(iHeight!=null)
_iFrame.height=iHeight;if(iWidth!=null)
_iFrame.width=iWidth;}
var _PopupTitleElement=NgGetElementById(popupTitleId);if(_PopupTitleElement!=null)
_PopupTitleElement.innerHTML=PopupTitle;}
function NgClosePopup()
{var commoniFrame="commoniFrame";var commoniFrameWraper=_CommonPopupLayer;var _iFrame;try
{_iFrame=window.top.NgGetElementById(commoniFrame);}
catch(e){}
if(commoniFrameWraper!=null)
{var _iFrameLayer;try
{_iFrameLayer=window.top.NgGetElementById(commoniFrameWraper);}
catch(e){}
if(_iFrameLayer!=null)
{HideLayer(commoniFrameWraper,null,null);_iFrameLayer.style.visibility='hidden';}}
if(_iFrame!=null)
{_iFrame.style.display='none';HideLayer(commoniFrame,null,null);window.top.frames[commoniFrame].location.href='about:blank';}}
function NgOpenWindow(url,windowTitle,attributes)
{if(attributes==null)
attributes="";if(url!=null)
window.open(url,windowTitle,attributes);}
function NgCloseWindow()
{window.close();}
function NgRefreshParentWindow()
{if(window.top)
{window.top.RefreshPage();}}
function NgRefreshWindow()
{try{window.RefreshPage();}catch(e){if(window.top)
{window.top.RefreshPage();}}}
function xreplace(s,r,w){return s.split(r).join(w);}
function getUniqueValue()
{var date=new Date();var value0=date.toGMTString();var value1=replaceAll(value0," ","_");var value2=replaceAll(value1,":","_");return replaceAll(value2,",","_");}
function replaceAll(strValue,sourceChar,destChar)
{if(strValue!=null&&sourceChar!=null&&destChar!=null)
{while(strValue.indexOf(sourceChar)>=0)
{strValue=strValue.replace(sourceChar,destChar);}}
return strValue;}
function NgAdjustPopupSize()
{var commoniFrame="commoniFrame";var _iFrame;try{_iFrame=window.top.NgGetElementById(commoniFrame);}catch(e){}
try{window.top.calcHeight(commoniFrame);window.top.calcWidth(commoniFrame);}catch(e){}}
function _hideDefaultContextmenu(e)
{var firingEle=(m_ie5)?event.srcElement:e.target;if(firingEle.href!=null&&firingEle.href.substring(0,11)=='javascript:')
{if(!m_ie5)
e.stopPropagation();return false;}}
var m_ie5=(window.navigator.appName.toLowerCase().indexOf("microsoft")>=0);if(m_ie5)
{document.attachEvent('oncontextmenu',_hideDefaultContextmenu);}
else
{document.addEventListener('contextmenu',_hideDefaultContextmenu,false);}
function IncludeJavaScript(jsFile)
{document.write('<script type="text/javascript" src="'
+jsFile+'"></script>');}
function CreateElementRadio(radioGrpName,elementId,elementValue,selecteded)
{var rdo=null;try
{rdo=document.createElement("<input name="+radioGrpName+"/>");}
catch(e)
{rdo=document.createElement("input");}
rdo.setAttribute("type","radio");rdo.setAttribute("name",radioGrpName);rdo.id=elementId;rdo.defaultChecked=selecteded;rdo.value=elementValue;return rdo;}
function CreateElementTextBox(elementId,elementValue)
{var txtBox=null;try
{txtBox=document.createElement("<input name="+elementId+"/>");}
catch(e)
{txtBox=document.createElement("input");}
txtBox.setAttribute("type","text");txtBox.name=elementId;txtBox.id=elementId;txtBox.value=elementValue;return txtBox;}
function CreateElementDropDown(elementId)
{var select=document.createElement("select");select.name=elementId;select.id=elementId;return select;}
function RemoveMapCtrl(mapCtrlId,preserveOnPointSetting)
{if(preserveOnPointSetting==undefined||!preserveOnPointSetting)
{RemoveOnPointSettings(mapCtrlId);}
if(mapCtrlId==null)
{g_OLMapCtrls[0].CloseToolsPanel();g_OLMapCtrls[0].destroy();g_OLMapCtrls=null;}
else
{for(var i=0;i<g_OLMapCtrls.length;i++)
{if((g_OLMapCtrls[i].id!=null)&&(g_OLMapCtrls[i].id==mapCtrlId))
{g_OLMapCtrls[i].CloseToolsPanel();g_OLMapCtrls[i].destroy();g_OLMapCtrls.splice(i,1);break;}}}}
if(window.g_onPointSettings==null)
{var g_onPointSettings=new Array();}
function AddOnPointSettings(jsonSetting)
{eval(jsonSetting);g_onPointSettings.push(onPointSettings);}
function GetOnPointSettings(mapCtrlId)
{var onPointSetting=null;if(mapCtrlId==null)
{onPointSetting=g_onPointSettings[0];}
else
{for(var i=0;i<g_onPointSettings.length;i++)
{if(g_onPointSettings[i].id==mapCtrlId)
{onPointSetting=g_onPointSettings[i];break;}}}
return onPointSetting;}
function RemoveOnPointSettings(mapCtrlId)
{if(mapCtrlId==null)
{g_onPointSettings=null;}
else
{for(var i=0;i<g_onPointSettings.length;i++)
{if(g_onPointSettings[i].id==mapCtrlId)
{g_onPointSettings.splice(i,1);break;}}}}
function changeiframeHeight(iFrameId){try{var the_height=parent.document.getElementById(iFrameId).contentWindow.document.body.scrollHeight+'px';parent.document.getElementById(iFrameId).height=the_height;parent.document.getElementById(iFrameId).style.height=the_height;}catch(e){}}
function changeiframeWidth(iFrameId){try{var the_width=parent.document.getElementById(iFrameId).contentWindow.document.body.scrollWidth+'px';parent.document.getElementById(iFrameId).width=the_width;parent.document.getElementById(iFrameId).style.width=the_width;}catch(e){}}
function StopEvent(e)
{if(!e)var e=window.event;if(e){e.cancelBubble=true;e.returnValue=false;if(e.stopPropagation){e.stopPropagation();e.preventDefault();}}
return false;}
function getElementTopPostion(element){var elementTop=0;if(element!=null){var elementLeft=element.offsetLeft;elementTop=element.offsetTop;var TmpElem=element.offsetParent;while(TmpElem!=null){elementLeft=elementLeft+TmpElem.offsetLeft;elementTop=elementTop+TmpElem.offsetTop;TmpElem=TmpElem.offsetParent;}}
return elementTop;}
function _StringFormatInline()
{var txt=this;for(var i=0;i<arguments.length;i++)
{var exp=new RegExp('\\{'+(i)+'\\}','gm');txt=txt.replace(exp,arguments[i]);}
return txt;}
function _StringFormatStatic()
{for(var i=1;i<arguments.length;i++)
{var exp=new RegExp('\\{'+(i-1)+'\\}','gm');arguments[0]=arguments[0].replace(exp,arguments[i]);}
return arguments[0];}
if(!String.prototype.format)
{String.prototype.format=_StringFormatInline;}
if(!String.format)
{String.format=_StringFormatStatic;}
function PreThemeSwitch(){disposeGoogleMapObject();}
function PreMapTabSwitch()
{if(window.top){window.top.ShowLoading();}
if(window.g_veBEMap!=null)
{try
{window.g_veBEMap.Dispose();window.g_veBEMap=null;}
catch(e)
{}}
if(ImgNav!=null)
{try
{ImgNav=null;}
catch(e)
{}}
disposeGoogleMapObject();}
function disposeGoogleMapObject(){if(window.g_GEPlugin!=null){try{if(window.g_GMAPCurrentView==JsMapView.EARTH){UpdateMapTabExtentsFromEarth();}
window.g_GEPlugin=null;}
catch(e){}}
if(window.g_map2D!=null){try{window.g_map2D=null;}
catch(e){}}}
function getElementDimensions(eleId)
{var element=document.getElementById(eleId);var elementTop=0;var elementLeft=0;var elementWidth=0;var elementHeight=0;if(element!=null)
{elementWidth=element.clientWidth;elementHeight=element.clientHeight;if(element!=null){var elementLeft=element.offsetLeft;elementTop=element.offsetTop;var TmpElem=element.offsetParent;while(TmpElem!=null){elementLeft=elementLeft+TmpElem.offsetLeft;elementTop=elementTop+TmpElem.offsetTop;TmpElem=TmpElem.offsetParent;}}}
return{Top:elementTop,Left:elementLeft,Height:elementHeight,Width:elementWidth};}
function CenterPage(elementId){var ele=document.getElementById(elementId);if(ele){try{var pageWidth=YAHOO.util.Dom.getViewportWidth();var pageCen=Math.round(pageWidth/2);var pageHeight=YAHOO.util.Dom.getViewportHeight();var pageLeft=YAHOO.util.Dom.getDocumentScrollLeft();var pageTop=YAHOO.util.Dom.getDocumentScrollTop();var pageMid=pageTop+Math.round(pageHeight/2);var region=YAHOO.util.Dom.getRegion(ele);if(region){ele.style.left=(pageCen-(parseInt(region.right)-parseInt(region.left))/2)+"px";ele.style.top=(pageMid-(parseInt(region.bottom)-parseInt(region.top))/2)+"px";}}catch(ex){}}}
function VerifyPopupBlocker(warningImagesrc,popupBlockerOKBtnText,chkNoPopupMsgText,popupBlockerMsg)
{var oWin=window.open("","testpopupblocker","width=10,height=10,top=5000,left=5000");if(oWin==null||typeof(oWin)=="undefined"||isChrome())
{if(__showPopupBlockerMsg!=null&&__showPopupBlockerMsg=="true")
{try{var popupDiv=_GetPopupBlockerDiv(warningImagesrc,popupBlockerOKBtnText,chkNoPopupMsgText,popupBlockerMsg);if(popupDiv!=null)
{popupDiv.style.display="block";var dimensions=GetBrowserDimensions();popupDiv.style.left=(dimensions.width/2)-100+'px';popupDiv.style.top=(dimensions.height/2)+'px';}}
catch(e)
{}}}
else
{oWin.close();}
return;}
function _GetPopupBlockerDiv(imgsrc,okBtnText,chkNoPopupMsgText,popupBlockerMsg)
{var divPopup=document.getElementById('popupBlockerDiv');if(!divPopup)
{divPopup=document.createElement("DIV");divPopup.id='popupBlockerDiv';divPopup.style.visibility='visible';divPopup.style.overflow='hidden';divPopup.style.position='absolute';divPopup.style.zIndex=2000;var htmlContent="<table><tr><td><img id='popupImg' src='"+imgsrc+"' /></td><td><div id='popupContent'>"+popupBlockerMsg+"</div></td></tr>";htmlContent+="<tr><td colspan='2'  align='center'>";htmlContent+="<input type='button' value='"+okBtnText+"' class='btn' onclick=\"popupBlockerOkBtnClick('popupBlockerDiv', 'chkNoPopupMessage');\" />";htmlContent+="</td></tr>";htmlContent+="<tr><td colspan='2'>";htmlContent+="<input id=\"chkNoPopupMessage\" type=\"checkbox\" checked />"+chkNoPopupMsgText;htmlContent+="</td></tr>";htmlContent+="</table>";divPopup.innerHTML=htmlContent;document.body.appendChild(divPopup);}
return divPopup;}
function popupBlockerOkBtnClick(popupDivId,chkElemId)
{if(popupDivId!=null&&chkElemId!=null)
{var popupDivElem=document.getElementById(popupDivId);if(popupDivElem!=null)
{popupDivElem.style.display="none";}
var chkElem=document.getElementById(chkElemId);if(chkElem!=null&&chkElem.checked)
{__showPopupBlockerMsg=false;try{PageMethods.SavePopupBlockerSettings();}
catch(e)
{alert(e.message);}}}}
function CreateButton(id,name,text,classAttribute){var btn=document.createElement('input');btn.id=id;btn.setAttribute('type','button');btn.setAttribute('name',name);btn.setAttribute('class',classAttribute);btn.setAttribute('className',classAttribute);btn.value=text;return btn;}
﻿
var ImgNav=null;var ovMapMode=false;var infoToolClicked=false;var initialScale=null;var rootImagePath="../..";var mapCurrentTheme="";var generateURLClicked=false;var ie=(window.navigator.appName.toLowerCase().indexOf("microsoft")>=0);var g_isInitilizing=false;PICTO_MODES={ZOOMIN:'ZOOMIN',ZOOMOUT:'ZOOMOUT',DRAG:'DRAG',PREVIOUS:'PREVIOUS',NEXT:'NEXT',NONE:'NONE'};DIRECTION={North:'NORTH',South:'SOUTH',East:'EAST',West:'WEST',NONE:'NONE'};function InitPictometry(){if(!g_isInitilizing){g_isInitilizing=true;setTimeout("PInitPictometry();",200);}}
function PInitPictometry(){var onPointSetting=GetOnPointSettings(null);if(onPointSetting!=null){var mapCtrlId=onPointSetting.id;var mapDivId=onPointSetting.divId;rootImagePath=onPointSetting.rootImagePath;mapCurrentTheme=onPointSetting.CurrentTheme;InitializePictoTools(mapCtrlId);var params={UserId:g_pictoUserId,ServerProxy:"../PictometryProxyHandler.ashx"};ImgNav=new Pol.VI.ImageNavigator(mapDivId,params);ImgNav.Init();LoadUnits();ImgNav.Search(onPointSetting.curCenterLat,onPointSetting.curCenterLon,SearchCallback);ImgNav.AttachEvent('onclick',SetOverviewMapBounds);ImgNav.AttachEvent('onviewchange',OnViewChange);ImgNav.AttachEvent('onviewchange',SetOverviewMapBounds);ImgNav.AttachEvent('onedgedetect',OnEdgeDetect);ImgNav.AttachEvent('onmouseup',SetOverviewMapBounds);ImgNav.SetAutoNavigate(true);ImgNav.AttachEvent("onendmeasurement",OnEndMeasure);ImgNav.AttachEvent("onscalechange",SetOverviewMapBounds);ImgNav.SetMouseWheelZoom(true);LoadUnits();InitializeLyrMgr('lmTree',onPointSetting.mapSrcId,mapCtrlId,'');AttachDetachMouseWheelEvent();}}
function AttachDetachMouseWheelEvent(){try{if(ie){document.detachEvent("onmousewheel",HandleMouseScroll);}
else{document.removeEventListener("onmousewheel",HandleMouseScroll,false);}}
catch(e){Console.error(String.format('{0}::{1}| Unknown error - {2}','pictometry.js','AttachDetachMouseWheelEvent',e.message));}
if(ie){document.attachEvent("onmousewheel",HandleMouseScroll);}
else{document.addEventListener("onmousewheel",HandleMouseScroll,false);}}
function HandleMouseScroll(e){if(window.PictoScaleChange){window.PictoScaleChange=false;if(ie){return false;}
else{e.stopPropagation();}}
else{return true;}}
function SetOrientation(orientation){SetOrientationImage(orientation);switch(orientation){case DIRECTION.North:orientation=Pol.VI.Orientation.North;break;case DIRECTION.South:orientation=Pol.VI.Orientation.South;break;case DIRECTION.East:orientation=Pol.VI.Orientation.East;break;case DIRECTION.West:orientation=Pol.VI.Orientation.West;break;default:break;}
ImgNav.SetView(ImgNav.CurrentView.level,ImgNav.CurrentView.type,orientation);SetOverviewMapBounds();}
function SetOrientationImage(orientation){try{document.images["southOrientation"].src=rootImagePath+"/App_Themes/"+mapCurrentTheme+"/Images/Tools/Navigations/southEye_Off.png";document.images["westOrientation"].src=rootImagePath+"/App_Themes/"+mapCurrentTheme+"/Images/Tools/Navigations/westEye_Off.png";document.images["eastOrientation"].src=rootImagePath+"/App_Themes/"+mapCurrentTheme+"/Images/Tools/Navigations/eastEye_Off.png";document.images["northOrientation"].src=rootImagePath+"/App_Themes/"+mapCurrentTheme+"/Images/Tools/Navigations/northEye_Off.png";switch(orientation){case DIRECTION.North:document.images["northOrientation"].src=rootImagePath+"/App_Themes/"+mapCurrentTheme+"/images/Tools/Navigations/northEye_On.png";break;case DIRECTION.South:document.images["southOrientation"].src=rootImagePath+"/App_Themes/"+mapCurrentTheme+"/images/Tools/Navigations/southEye_On.png";break;case DIRECTION.East:document.images["eastOrientation"].src=rootImagePath+"/App_Themes/"+mapCurrentTheme+"/images/Tools/Navigations/eastEye_On.png";break;case DIRECTION.West:document.images["westOrientation"].src=rootImagePath+"/App_Themes/"+mapCurrentTheme+"/images/Tools/Navigations/westEye_On.png";break;default:break;}}
catch(e){Console.error(String.format('{0}::{1}| Unknown error - {2}','pictometry.js','SetOrientationImage',e.message));}}
function LoadUnits(){distanceUnitsDropDown=getObject('ddlDistanceUnit');if(distanceUnitsDropDown){distanceUnitsDropDown.options[0]=new Option("Inches");distanceUnitsDropDown.options[0].value=Pol.VI.DistanceUnits.Inches;distanceUnitsDropDown.options[1]=new Option("Feet");distanceUnitsDropDown.options[1].value=Pol.VI.DistanceUnits.Feet;distanceUnitsDropDown.options[2]=new Option("Yards");distanceUnitsDropDown.options[2].value=Pol.VI.DistanceUnits.Yards;distanceUnitsDropDown.options[3]=new Option("Miles");distanceUnitsDropDown.options[3].value=Pol.VI.DistanceUnits.Miles;distanceUnitsDropDown.options[4]=new Option("Millimeters");distanceUnitsDropDown.options[4].value=Pol.VI.DistanceUnits.Millemeters;distanceUnitsDropDown.options[5]=new Option("Centimeters");distanceUnitsDropDown.options[5].value=Pol.VI.DistanceUnits.Centimeters;distanceUnitsDropDown.options[6]=new Option("Meters");distanceUnitsDropDown.options[6].value=Pol.VI.DistanceUnits.Meters;distanceUnitsDropDown.options[7]=new Option("Kilometers");distanceUnitsDropDown.options[7].value=Pol.VI.DistanceUnits.Kilometers;distanceUnitsDropDown.options[8]=new Option("Nautical Miles");distanceUnitsDropDown.options[8].value=Pol.VI.DistanceUnits.NauticalMiles;}
distanceUnitsDropDown.selectedIndex=1;ImgNav.SetDistanceUnit(distanceUnitsDropDown.options[distanceUnitsDropDown.selectedIndex].value);areaUnitsDropDown=getObject('ddlAreaUnit');if(areaUnitsDropDown){areaUnitsDropDown.options[0]=new Option("Square Inches");areaUnitsDropDown.options[0].value=Pol.VI.AreaUnits.SquareInches;areaUnitsDropDown.options[1]=new Option("Square Feet");areaUnitsDropDown.options[1].value=Pol.VI.AreaUnits.SquareFeet;areaUnitsDropDown.options[2]=new Option("Square Yards");areaUnitsDropDown.options[2].value=Pol.VI.AreaUnits.SquareYards;areaUnitsDropDown.options[3]=new Option("Square Miles");areaUnitsDropDown.options[3].value=Pol.VI.AreaUnits.SquareMiles;areaUnitsDropDown.options[4]=new Option("Square Millimeters");areaUnitsDropDown.options[4].value=Pol.VI.AreaUnits.SquareMillimeters;areaUnitsDropDown.options[5]=new Option("Square Centimeters");areaUnitsDropDown.options[5].value=Pol.VI.AreaUnits.SquareCentimeters;areaUnitsDropDown.options[6]=new Option("Square Meters");areaUnitsDropDown.options[6].value=Pol.VI.AreaUnits.SquareMeters;areaUnitsDropDown.options[7]=new Option("Square Kilometers");areaUnitsDropDown.options[7].value=Pol.VI.AreaUnits.SquareKilometers;areaUnitsDropDown.options[8]=new Option("Acres");areaUnitsDropDown.options[8].value=Pol.VI.AreaUnits.Acres;areaUnitsDropDown.options[9]=new Option("Hectares");areaUnitsDropDown.options[9].value=Pol.VI.AreaUnits.Hectares;}
areaUnitsDropDown.selectedIndex=1;ImgNav.SetAreaUnit(areaUnitsDropDown.options[areaUnitsDropDown.selectedIndex].value);}
function ChangePictoDistanceUnits(){distanceUnitsDropDown=getObject('ddlDistanceUnit');if(distanceUnitsDropDown){ind=distanceUnitsDropDown.selectedIndex;ImgNav.SetDistanceUnit(distanceUnitsDropDown.options[ind].value);}
var md=getObject('pluginMeasureDivResult');if(md){md.innerHTML='';}}
function ChangePictoAreaUnits(){areaUnitsDropDown=getObject('ddlAreaUnit');if(areaUnitsDropDown){ind=areaUnitsDropDown.selectedIndex;ImgNav.SetAreaUnit(areaUnitsDropDown.options[ind].value);}
var md=getObject('pluginMeasureDivResult');if(md){md.innerHTML='';}}
function ExecuteErrorMessageWrongCoordinate(){alert('Please enter numeric value for X and Y coordinate.');}
function InitializePictoTools(mapCtrlId){var pluginDiv=getObject('PluginMapToolsDiv');var onPointSetting=GetOnPointSettings(mapCtrlId);if(window.sessionExpired==null){window.sessionExpired=false;}
if(!sessionExpired){if(window.HandlePluginToolsFrame){HandlePluginToolsFrame(null);}}
if(pluginDiv){{var pluginDivHTML='<html xmlns="http:\/\/www.w3.org\/1999\/xhtml">';}
{pluginDivHTML+='<head> <title>Untitled Page<\/title> <style type="text\/css">  .style1  {  height: 29px; } .style3  { width: 175px; }  .pluginNavigatorBorder{border: 1px solid #000000;} .pluginOrientationBorder{border: 1px solid #000000;} <\/style> <\/head>';}
{pluginDivHTML+='<body><table width="220px"><tr><td>';}
{pluginDivHTML+='<table class="pluginTable" align="center"><tr><td><\/td>';}
{pluginDivHTML+='<td><table dir="ltr"> <tr><td colspan="3" class="pluginNavigatorHeader"> Navigator<\/td> <\/tr> ';}
{pluginDivHTML+='<tr> <td> <\/td><td><img alt="Pan Up" src="'+rootImagePath+'/App_Themes\/'+mapCurrentTheme+'\/Images\/Tools\/Navigations\/n_off.gif" onmouseover=\'this.src="'+rootImagePath+'/App_Themes\/'+mapCurrentTheme+'\/Images\/Tools\/Navigations\/n_on.gif";\'onmouseout=\'this.src="'+rootImagePath+'/App_Themes\/'+mapCurrentTheme+'\/Images\/Tools\/Navigations\/n_off.gif";\' onclick="javascript:GetPanImage(DIRECTION.North);" id="imgFloatNorth" ';}
{pluginDivHTML+='style="visibility: visible" \/><\/td> <td><\/td> <\/tr> <tr><td> <img alt="Pan Left" src="'+rootImagePath+'/App_Themes\/'+mapCurrentTheme+'\/Images\/Tools\/Navigations\/w_off.gif" onmouseover=\'this.src="'+rootImagePath+'/App_Themes\/'+mapCurrentTheme+'\/Images\/Tools\/Navigations\/w_on.gif";\'onmouseout=\'this.src="'+rootImagePath+'/App_Themes\/'+mapCurrentTheme+'\/Images\/Tools\/Navigations\/w_off.gif";\' onclick="javascript:GetPanImage(DIRECTION.West);" id="imgFloatWest" style="visibility: visible" \/><\/td><td><img alt="Full View" src="'+rootImagePath+'/App_Themes\/'+mapCurrentTheme+'\/Images\/Tools\/Navigations\/fullview_off.gif" onmouseover=\'this.src="'+rootImagePath+'/App_Themes\/'+mapCurrentTheme+'\/Images\/Tools\/Navigations\/fullview_on.gif";\'onmouseout=\'this.src="'+rootImagePath+'/App_Themes\/'+mapCurrentTheme+'\/Images\/Tools\/Navigations\/fullview_off.gif";\' onclick="javascript:doPictoFullView();" id="imgFullView" style="visibility: visible" \/><\/td> <td class="style10"> <img alt="Pan Right" src="'+rootImagePath+'/App_Themes\/'+mapCurrentTheme+'\/Images\/Tools\/Navigations\/e_off.gif" onmouseover=\'this.src="'+rootImagePath+'/App_Themes\/'+mapCurrentTheme+'\/Images\/Tools\/Navigations\/e_on.gif";\'onmouseout=\'this.src="'+rootImagePath+'/App_Themes\/'+mapCurrentTheme+'\/Images\/Tools\/Navigations\/e_off.gif";\' onclick="javascript:GetPanImage(DIRECTION.East);" id="imgFloatEast" style="visibility: visible" \/><\/td>';}
{pluginDivHTML+='<\/tr><tr><td class="style1"> <\/td><td class="style1"> <img alt="Pan Down" src="'+rootImagePath+'/App_Themes\/'+mapCurrentTheme+'\/Images\/Tools\/Navigations\/s_off.gif" onmouseover=\'this.src="'+rootImagePath+'/App_Themes\/'+mapCurrentTheme+'\/Images\/Tools';}
{pluginDivHTML+='\/Navigations\/s_on.gif";\'onmouseout=\'this.src="'+rootImagePath+'/App_Themes\/'+mapCurrentTheme+'\/Images\/Tools\/Navigations\/s_off.gif";\'onclick="javascript:GetPanImage(DIRECTION.South);" id="imgFloatSouth" style="visibility: visible" \/><\/td><td class="style1"> <\/td> <\/tr>';}
{pluginDivHTML+='<\/table><\/td>';}
{pluginDivHTML+='<td><\/td> <td><\/td>';}
{pluginDivHTML+='<td><table dir="ltr"> <tr><td colspan="3" class="pluginOrientationHeader"> Orientation<\/td> <\/tr> <tr><td><\/td><td align="center"> <img alt="North" src="'+rootImagePath+'/App_Themes\/'+mapCurrentTheme+'\/Images\/Tools\/Navigations\/northEye_On.png"   onclick="javascript:SetOrientation(\'NORTH\');" id="northOrientation" style="visibility: visible; text-align: center;" \/><\/td><td> <\/td><\/tr><tr ><td style="vertical-align:middle"><img alt="West" src="'+rootImagePath+'/App_Themes\/'+mapCurrentTheme+'\/Images\/Tools\/Navigations\/westEye_Off.png" onclick="javascript:SetOrientation(\'WEST\');" id="westOrientation" style="visibility: visible" \/><\/td><td><img alt="View" src="'+rootImagePath+'/App_Themes\/'+mapCurrentTheme+'\/Images\/Tools\/Navigations\/neighbourhood.png"  onclick="javascript:SetLevel();" id="imgView" style="visibility: visible" \/><\/td> <td style="vertical-align:middle"> <img alt="East" src="'+rootImagePath+'/App_Themes\/'+mapCurrentTheme+'\/Images\/Tools';}
{pluginDivHTML+='\/Navigations\/eastEye_Off.png"  onclick="javascript:SetOrientation(\'EAST\');" id="eastOrientation" style="visibility: visible" \/><\/td> <\/tr><tr > <td> <\/td><td align="center" ><img alt="South" src="'+rootImagePath+'/App_Themes\/'+mapCurrentTheme+'\/Images\/Tools\/Navigations\/southEye_Off.png"   onclick="javascript:SetOrientation(\'SOUTH\');" id="southOrientation" style="visibility: visible" \/><\/td><td><\/td><\/tr>';}
{pluginDivHTML+='<\/table><\/td>';}
{pluginDivHTML+='<td><\/td><\/tr><\/table>';}
{pluginDivHTML+='<\/td><\/tr>';}
{pluginDivHTML+='<tr><td>';}
{pluginDivHTML+='<table cellspacing="0" class="pluginTable" width=100%>';}
{pluginDivHTML+='<tr class="measureHeader"><td class="pluginTable" width=95%>Measure</td><td><img alt="Measure" src="'+rootImagePath+'/App_Themes\/'+mapCurrentTheme+'\/images\/expand_On.gif" onclick="javascript:ShowMeasureTools(\'tblMeasure\');" id="imgCollapse"  style="visibility: visible; float: right; margin-left: 4px;" \/><\/td><\/tr>';}
{pluginDivHTML+='<\/table>';}
{pluginDivHTML+='<\/td><\/tr>';}
{pluginDivHTML+='<tr><td>';}
{pluginDivHTML+='<table id="tblMeasure" class="pluginTable" style="display:none; width: 205px;">';}
{pluginDivHTML+='<tr><td><table class="pluginTable"><tr><td> Distance Unit:<\/td><td><select id="ddlDistanceUnit" name="D1" onchange="ChangePictoDistanceUnits();" style="width: 130px"><option><\/option> <\/select><\/td> <\/tr> <tr> <td>Area Unit:<\/td> <td><select id="ddlAreaUnit" name="D2" onchange="ChangePictoAreaUnits();" style="width: 130px"><option><\/option><\/select><\/td> <\/tr>';}
{pluginDivHTML+='<\/table><\/td><\/tr> ';}
{pluginDivHTML+='<tr><td><table><tr><td> <div id="pluginMeasureDivResult" class="pluginMeasureDivResult" style="width:195px;"><\/div><\/td><\/tr>';}
{pluginDivHTML+='<\/table><\/td><\/tr>';}
{pluginDivHTML+='<tr><td><table cellspacing="1">';}
{pluginDivHTML+='<tr>';}
{pluginDivHTML+='<td><img alt="Location" src="'+rootImagePath+'/App_Themes\/'+mapCurrentTheme+'/Images/Tools/AdvanceTools/addMyPoint_Off.png"  onclick="javascript:SetPictoImageTool(\'PictoLocationMeasure\');" id="imgLocationTool" style="visibility: visible" \/><\/td>';}
{pluginDivHTML+='<td><img alt="Distance" src="'+rootImagePath+'/App_Themes\/'+mapCurrentTheme+'/Images/Tools/AdvanceTools/addLine_Off.png" onclick="javascript:SetPictoImageTool(\'pictoDistanceMeasure\');" id="imgDistanceTool" style="visibility: visible; overflow: auto" \/><\/td>';}
{pluginDivHTML+='<td><img alt="Area" src="'+rootImagePath+'/App_Themes\/'+mapCurrentTheme+'/Images/Tools/AdvanceTools/addRectangle_Off.png" onclick="javascript:SetPictoImageTool(\'pictoAreaMeasure\');" id="imgAreaTool" style="visibility: visible; overflow: auto" \/><\/td>';}
{pluginDivHTML+='<td><img alt="Height" src="'+rootImagePath+'/App_Themes\/'+mapCurrentTheme+'/Images/Tools/FunctionalTools/measureHeight_Off.png" id="imgHeightTool" onclick="javascript:SetPictoImageTool(\'pictoHeightMeasure\');"  style="visibility: visible; overflow: auto" \/><\/td>';}
{pluginDivHTML+='<td><img alt="Bearing" src="'+rootImagePath+'/App_Themes\/'+mapCurrentTheme+'/Images/Tools/FunctionalTools/measureAngle_Off.png" id="imgBearingTool" onclick="javascript:SetPictoImageTool(\'pictoBearingMeasure\');"  style="visibility: visible; overflow: auto" \/><\/td>';}
{pluginDivHTML+='<td><img alt="Elevation" src="'+rootImagePath+'/App_Themes\/'+mapCurrentTheme+'/Images/Tools/AdvanceTools/elevation_Off.png" onclick="javascript:SetPictoImageTool(\'pictoElevationMeasure\');" id="imgElevationTool" style="visibility: visible; overflow: auto" \/><\/td>';}
{pluginDivHTML+='<\/tr>';}
{pluginDivHTML+='<\/table><\/td><\/tr>';}
{pluginDivHTML+='<\/table>';}
{pluginDivHTML+='<\/td><\/tr>';}
{pluginDivHTML+='<\/table><\/body><\/html>';}
pluginDiv.innerHTML=pluginDivHTML;}}
function SetLevel(){var curLevel=ImgNav.GetLevel();var tempImgNav=ImgNav;var view=null;try{if(curLevel==Pol.VI.ImageLevel.Neighborhood){ImgNav.SetView(Pol.VI.ImageLevel.Community,ImgNav.CurrentView.type,ImgNav.CurrentView.orientation);curLevel=ImgNav.GetLevel();if(curLevel==Pol.VI.ImageLevel.Neighborhood||curLevel==-1){alert("Community view not available");ImgNav=tempImgNav;view=ImgNav.FindFirstOblique();ImgNav.SetView(view.level,view.type,view.orientation);}}
else if(curLevel==Pol.VI.ImageLevel.Community){ImgNav.SetView(Pol.VI.ImageLevel.Neighborhood,ImgNav.CurrentView.type,ImgNav.CurrentView.orientation);curLevel=ImgNav.GetLevel();if(curLevel==Pol.VI.ImageLevel.Community||curLevel==-1){alert("Neighborhood view not available");ImgNav=tempImgNav;view=ImgNav.FindFirstOblique();ImgNav.SetView(view.level,view.type,view.orientation);}}}
catch(e){Console.error(String.format('{0}::{1}| Unknown error - {2}','pictometry.js','SetLevel',e.message));}}
function ShowMeasureTools(id){try{var itm=false;if(document.getElementById)
itm=document.getElementById(id);else if(document.all)
itm=document.all[id];else if(document.layers)
itm=document.layers[id];if(!itm)
return false;if(itm.style.display=='none'){itm.style.display='';document.images["imgCollapse"].src=rootImagePath+"/App_Themes\/"+mapCurrentTheme+"\/images\/collapse_On.gif";}
else{itm.style.display='none';document.images["imgCollapse"].src=rootImagePath+"/App_Themes\/"+mapCurrentTheme+"\/images\/expand_On.gif";}}
catch(e){Console.error(String.format('{0}::{1}| Unknown error - {2}','pictometry.js','ShowMeasureTools',e.message));}
return false;}
function GetPanImage(panDirection){switch(panDirection){case DIRECTION.North:ImgNav.PanImage(0,-100);break;case DIRECTION.South:ImgNav.PanImage(0,100);break;case DIRECTION.East:ImgNav.PanImage(100,0);break;case DIRECTION.West:ImgNav.PanImage(-100,0);break;default:break;}
SetOverviewMapBounds();}
function doPictoFullView(){var mapCtrlId=null;var onPointSetting=GetOnPointSettings(mapCtrlId);initialScale=1;ImgNav.Search(onPointSetting.initCenterLat,onPointSetting.initCenterLon,SearchCallback);ImgNav.SetScale(initialScale);}
function PictoGenerateURLGetFromMap(){try{generateURLClicked=true;var setTool=Pol.VI.ImageTools.Location;ImgNav.SetImageTool(setTool);}
catch(e){Console.error(String.format('{0}::{1}| Unknown error - {2}','pictometry.js','PictoGenerateURLGetFromMap',e.message));}}
function MapCompassImageChange(image,objName){var obj=document.getElementById(objName);var imgTag="<img src='"+image+"' border='0' />";obj.innerHTML=imgTag;return;}
function doPictoOverviewMap(){ovMapMode=true;SetOverviewMapBounds();}
function SetOverviewMapBounds(){window.PictoScaleChange=true;try{SetPanMode();var bounds=ImgNav.GetViewPort();ImgNav.GetLatLngBounds(SetPictoCurrentExtents);if(ovMapMode){var height=(bounds.ul.y-bounds.ll.y)
var width=(bounds.lr.x-bounds.ll.x)
bounds.ll.x=bounds.ll.x-width;bounds.ll.y=bounds.ll.y-height;bounds.ul.x=bounds.ll.x;bounds.ul.y=bounds.ul.y+height;bounds.ur.x=bounds.ur.x+width;bounds.ur.y=bounds.ul.y;bounds.lr.x=bounds.ur.x;bounds.lr.y=bounds.ll.y;ImgNav.GetLink(bounds,GetLinkOverview,Pol.VI.ImageFormats.JPEG);}
curScale=ImgNav.GetScale();curLevel=ImgNav.GetLevel();curDay=ImgNav.GetDay();curMonth=ImgNav.GetMonth();curYear=ImgNav.GetYear();var date=curDay+"/"+curMonth+"/"+curYear;if(curLevel=="N"){curLevel="Neighbourhood";document.images["imgView"].src=rootImagePath+"/App_Themes\/"+mapCurrentTheme+"\/Images\/Tools\/Navigations\/neighbourhood.png";}
else if(curLevel=="C"){curLevel="Community";document.images["imgView"].src=rootImagePath+"/App_Themes\/"+mapCurrentTheme+"\/Images\/Tools\/Navigations\/community.png";}
curOrientation=ImgNav.GetOrientation();if(curOrientation=="N"){curOrientation="North";}
else if(curOrientation=="E"){curOrientation="East";}
else if(curOrientation=="W"){curOrientation="West";}
else if(curOrientation=="S"){curOrientation="South";}
document.getElementById("status").innerHTML="Date: "+date+" | Scale: "+Math.round(curScale*100)+"% | "+"Level: "+curLevel+" | Orientation: "+curOrientation;}
catch(e){Console.error(String.format('{0}::{1}| Unknown error - {2}','pictometry.js','SetOverviewMapBounds',e.message));}}
function SetPictoCurrentExtents(response){try{if(_Onpoint.MapHistory){var onPointSetting=GetOnPointSettings(null);_Onpoint.MapHistory.UpdateMapTabExtentsFromLatLong(onPointSetting.mapSrcId,response.ll.longitude,response.ll.latitude,response.ur.longitude,response.ur.latitude);}}
catch(e){Console.error(String.format('{0}::{1}| Unknown error - {2}','pictometry.js','SetPictoCurrentExtents',e.message));}}
function GetLinkOverview(response){var mapCtrlId=null;var onPointSetting=GetOnPointSettings(mapCtrlId);var overviewMapHeight=onPointSetting.overviewMapHeight;var overviewMapWidth=onPointSetting.overviewMapWidth;if(response.status==0){var ovImageDiv="<IMG SRC="+response.url+" ALT="+"'Overview map'"+" WIDTH="+overviewMapWidth+" Height="+overviewMapHeight+">";}
var onPointSetting=GetOnPointSettings(mapCtrlId);if(window.sessionExpired==null){window.sessionExpired=false;}
if(!sessionExpired){if(window.HandleOverviewMapFrame){path=null;HandleOverviewMapFrame(path);}
if(window.overviewMapWidth==null)
overviewMapWidth=180;if(window.overviewMapHeight==null)
overviewMapHeight=160;document.getElementById('Overview_ctl01_cpMapBody_ctrlMap').innerHTML=ovImageDiv;}}
function SetPrintMapUrl(){try{ImgNav.GetLink(ImgNav.GetViewPort(),GetPrintMapUrl,Pol.VI.ImageFormats.JPEG);}
catch(e){Console.error(String.format('{0}::{1}| Unknown error - {2}','pictometry.js','SetPrintMapUrl',e.message));}}
function GetPrintMapUrl(response){try{if(response!=null){var printURL=response.url;PageMethods.SetPlugInPrintMapUrl(printURL);}}
catch(e){Console.error(String.format('{0}::{1}| Unknown error - {2}','pictometry.js','GetPrintMapUrl',e.message));}}
function ChangeScale(mode){var mapCtrlId=null;var onPointSetting=GetOnPointSettings(mapCtrlId);var zoomInScaleFactor=25;var zoomOutScaleFactor=25;var curScale=ImgNav.GetScale();if(mode==PICTO_MODES.ZOOMIN){var targetScale=curScale+(zoomInScaleFactor/100);}
else{var targetScale=curScale-(zoomOutScaleFactor/100);}
if(targetScale<.25){targetScale=.25;}
else if(targetScale>4){targetScale=4;}
ImgNav.SetScale(targetScale);SetOverviewMapBounds();}
function SearchCallback(resp){if(resp.status==0){var view=ImgNav.FindFirstOblique();ImgNav.SetView(view.level,view.type,view.orientation);var onPointSetting=GetOnPointSettings(null);if(!onPointSetting.dynamicMapResizingEnabled){ImgNav.SetViewerSize(onPointSetting.mapWidth,onPointSetting.mapHeight);}}
else{alert(" Bad Request. Data not available.");}
if(initialScale==null){initialScale=ImgNav.GetScale();}
SetOverviewMapBounds();if(g_isInitilizing&&onPointSetting.dynamicMapResizingEnabled){doResize();}
g_isInitilizing=false;}
function GetMapHistory(mode){if(mode==PICTO_MODES.NEXT){ImgNav.GetNextImage();}
else if(mode==PICTO_MODES.PREVIOUS){ImgNav.GetPrevImage();}
SetOverviewMapBounds();}
function OnViewChange(evt){var onViewChange="Level: "+evt.view.level+" Type: "+evt.view.type+" Orientation: "+evt.view.orientation+" Scale: "+evt.scale;}
function OnEdgeDetect(evt){var onEdgeDetect="Status: "+evt.status+" Reason: "+evt.reason;ImgNav.Navigate();}
function OnEndMeasure(evt){ImgNav.Measure(HandlerMeasureResult);}
function HandlerMeasureResult(evt){if(CheckStatus(evt)){var result=null;var tool=ImgNav.GetImageTool()
if(!infoToolClicked&&!generateURLClicked){if(tool==1)
result="Distance:</br>"+evt.value+evt.unit;else if(tool==2)
result="Height:</br>"+evt.value+evt.unit;else if(tool==3)
result="Location:</br> LAT:"+evt.latitude+evt.unit+",</br> LON:"+evt.longitude+evt.unit;else if(tool==4)
result="Area:</br>"+evt.value+evt.unit;else if(tool==5)
result="Elevation:</br>"+evt.value+evt.unit;else if(tool==6)
result="Bearing:</br>"+evt.value+evt.unit;else if(tool==7)
result="Pitch:</br>"+evt.value+evt.unit;var md=getObject('pluginMeasureDivResult');if(md){md.innerHTML=result.toString();}}
else if(infoToolClicked){PluginIdentifyTool_Clicked(evt);}
else if(generateURLClicked){SetGenerateURLXY(evt);}}}
function doPictoInfo(){infoToolClicked=true;var setTool=Pol.VI.ImageTools.Location;ImgNav.SetImageTool(setTool);ChangeImageTool("pictoInfo");}
function SetGenerateURLXY(point){var frame=window.frames[_GenerateUrlIframe];if(frame&&frame.window&&frame.window.ReceiveShape){frame.window.HandleReceiveShapeOL(point);}
return false;}
function CheckStatus(evt){if(evt.status==0){return true;}
else{return false;}}
function SetPanMode(){ImgNav.SetImageTool(setTool=Pol.VI.ImageTools.NoTool);}
function SetPictoImageTool(imageTool){try{var setTool;infoToolClicked=false;generateURLClicked=false;if(imageTool=='pictoDistanceMeasure')
setTool=Pol.VI.ImageTools.Distance;else if(imageTool=='pictoHeightMeasure')
setTool=Pol.VI.ImageTools.Height;else if(imageTool=='PictoLocationMeasure')
setTool=Pol.VI.ImageTools.Location;else if(imageTool=='pictoAreaMeasure')
setTool=Pol.VI.ImageTools.Area;else if(imageTool=='pictoElevationMeasure')
setTool=Pol.VI.ImageTools.Elevation;else if(imageTool=='pictoBearingMeasure')
setTool=Pol.VI.ImageTools.Bearing;else if(imageTool=='Pitch')
setTool=Pol.VI.ImageTools.Pitch;else
setTool=Pol.VI.ImageTools.NoTool
ChangeImageTool(imageTool);ImgNav.SetImageTool(setTool);}
catch(e){Console.error(String.format('{0}::{1}| Unknown error - {2}','pictometry.js','SetPictoImageTool',e.message));}}
function ChangeImageTool(imageTool){try{document.images["imgDistanceTool"].src=rootImagePath+"/App_Themes/"+mapCurrentTheme+"/images/Tools/AdvanceTools/addLine_Off.png";document.images["imgHeightTool"].src=rootImagePath+"/App_Themes/"+mapCurrentTheme+"/images/Tools/FunctionalTools/measureHeight_Off.png";document.images["imgLocationTool"].src=rootImagePath+"/App_Themes/"+mapCurrentTheme+"/images/Tools/AdvanceTools/addMyPoint_Off.png";document.images["imgAreaTool"].src=rootImagePath+"/App_Themes/"+mapCurrentTheme+"/images/Tools/AdvanceTools/addRectangle_Off.png";document.images["imgElevationTool"].src=rootImagePath+"/App_Themes/"+mapCurrentTheme+"/images/Tools/AdvanceTools/elevation_Off.png";document.images["imgBearingTool"].src=rootImagePath+"/App_Themes/"+mapCurrentTheme+"/images/Tools/FunctionalTools/measureAngle_Off.png";if(imageTool=='pictoDistanceMeasure')
document.images["imgDistanceTool"].src=rootImagePath+"/App_Themes/"+mapCurrentTheme+"/images/Tools/AdvanceTools/addLine_On.png";else if(imageTool=='pictoHeightMeasure')
document.images["imgHeightTool"].src=rootImagePath+"/App_Themes/"+mapCurrentTheme+"/images/Tools/FunctionalTools/measureHeight_On.png";else if(imageTool=='PictoLocationMeasure')
document.images["imgLocationTool"].src=rootImagePath+"/App_Themes/"+mapCurrentTheme+"/images/Tools/AdvanceTools/addMyPoint_On.png";else if(imageTool=='pictoAreaMeasure')
document.images["imgAreaTool"].src=rootImagePath+"/App_Themes/"+mapCurrentTheme+"/images/Tools/AdvanceTools/addRectangle_On.png";else if(imageTool=='pictoElevationMeasure')
document.images["imgElevationTool"].src=rootImagePath+"/App_Themes/"+mapCurrentTheme+"/images/Tools/AdvanceTools/elevation_On.png";else if(imageTool=='pictoBearingMeasure')
document.images["imgBearingTool"].src=rootImagePath+"/App_Themes/"+mapCurrentTheme+"/images/Tools/FunctionalTools/measureAngle_On.png";else if(imageTool=='Pitch')
document.images["imgPitchTool"].src=rootImagePath+"/App_Themes/"+mapCurrentTheme+"/images/Tools/AdvanceTools/elevation_On.png";}
catch(e){Console.error(String.format('{0}::{1}| Unknown error - {2}','pictometry.js','ChangeImageTool',e.message));}
return true;}
function OnClosePictoOverviewMap(){try{if(ovMapMode){ovMapMode=false;}}
catch(e){Console.error(String.format('{0}::{1}| Unknown error - {2}','pictometry.js','OnClosePictoOverviewMap',e.message));}}
function ShowPictoHelp(sender){var PictoHelpPath=(window.GetPictoHelpPath!=undefined)?window.GetPictoHelpPath(sender):"";window.open(PictoHelpPath+"PictoTools.htm","Help","menubar=no,toolbar=no,location=no,status=yes,scrollbars=yes");}
function SetPictoMapWindowSize(mapSize){try{if(ImgNav){var onPointSetting=null;onPointSetting=GetOnPointSettings(null);if(onPointSetting!=null){if(onPointSetting.useEmbeddedMapContainer){EmbeddedMapContainerResize(mapSize.width,onPointSetting.embeddedMapContainerHeight);}
var mapWidth=mapSize.width;var mapHeight=mapSize.height-25;var outerMapDivReference=getObject("outer_map_"+onPointSetting.id);if(outerMapDivReference!=null){if((parseInt(outerMapDivReference.style.width)!=mapWidth)||(parseInt(outerMapDivReference.style.height)!=mapHeight)){outerMapDivReference.style.width=mapWidth+"px";outerMapDivReference.style.height=mapHeight+"px";var mapDivReference=getObject("map_"+onPointSetting.id);if(mapDivReference!=null){if((parseInt(mapDivReference.style.width)!=mapWidth)||(parseInt(mapDivReference.style.height)!=mapHeight)){mapDivReference.style.width=mapWidth+"px";mapDivReference.style.height=mapHeight+"px";}}
try{ImgNav.SetViewerSize(mapWidth,mapHeight);}
catch(e){Console.error(String.format('{0}::{1}| ImgNav.SetViewerSize error - {2}','pictometry.js','SetPictoMapWindowSize',e.message));}}}}}}catch(e){Console.error(String.format('{0}::{1}| Unknown error - {2}','pictometry.js','SetPictoMapWindowSize',e.message));}}
﻿var g_veBEMap;var g_veBEIgnoreZoomEnd=true;var g_hostInCustomMapTab=false;var g_activeMapView="Roads";function ShowVEPluginMap(hostInCustomMapTab){var onPointSetting=GetOnPointSettings(null);if(onPointSetting!=null)
{var mapCtrlId=onPointSetting.id;var mapDiv=onPointSetting.divId;ShowHideControlsForPluginMaps(JsMapView.BIRDSEYE);if(window.g_veBEMap!=null)
{try{window.g_veBEMap.Dispose();}
catch(e){Console.error(String.format('{0}::{1}| window.g_veBEMap.Dispose error - {2}','VEBirdseye.js','ShowVEPluginMap',e.message));}}
window.g_veBEMap=new VEMap(mapDiv);window.g_veBEMap.HideScalebar();var center=new VELatLong(onPointSetting.curCenterLat,onPointSetting.curCenterLon);window.g_veBEMap.AttachEvent("onendpan",VEOnEndPan);window.g_veBEMap.AttachEvent("onendzoom",VEOnEndZoom);var options=new VEMapOptions();options.EnableDashboardLabels=false;window.g_veBEMap.LoadMap(center,1,VEMapStyle.BirdseyeHybrid,false,VEMapMode.Mode2D,false,0,options);InitializeLyrMgr('lmTree',onPointSetting.mapSrcId,mapCtrlId,'');if(onPointSetting.dynamicMapResizingEnabled){doResize();}
g_hostInCustomMapTab=hostInCustomMapTab;if(hostInCustomMapTab)
{var holderDiv=document.getElementById('ctmMapTabUseDiv');if(holderDiv!=null)
{holderDiv.setAttribute('class','btnViewBarBg');holderDiv.setAttribute('className','btnViewBarBg');var btnRoads=CreateButton('btnRoads','btnRoads',JsMapViewLanguageConstants.ROADS,'btnViewBar');btnRoads.onclick=function(){ToggleVESubMapTab(JsMapView.ROADS);}
holderDiv.appendChild(btnRoads);var btnSatellite=CreateButton('btnAerial','btnAerial',JsMapViewLanguageConstants.SATELLITE,'btnViewBar');btnSatellite.onclick=function(){ToggleVESubMapTab(JsMapView.SATELLITE);}
holderDiv.appendChild(btnSatellite);var btnHybrid=CreateButton('btnHybrid','btnHybrid',JsMapViewLanguageConstants.HYBRID,'btnViewBar');btnHybrid.onclick=function(){ToggleVESubMapTab(JsMapView.HYBRID);}
holderDiv.appendChild(btnHybrid);var btnShaded=CreateButton('btnShaded','btnShaded',JsMapViewLanguageConstants.SHADED,'btnViewBar');btnShaded.onclick=function(){ToggleVESubMapTab(JsMapView.SHADED);}
holderDiv.appendChild(btnShaded);var btnBirdseye=CreateButton('btnBirdseye','btnBirdseye',JsMapViewLanguageConstants.BIRDSEYE,'btnViewBarSelected');holderDiv.appendChild(btnBirdseye);}
else
{Console.error(String.format('{0}::{1}| holderDiv not found','VEBirdsEye.js','ShowVEPluginMap'));}
try
{var navCtrl=document.getElementById('MSVE_navAction_topBar');navCtrl.style.display="none";var navContainer=document.getElementById('MSVE_navAction_container');navContainer.style.width='100px';}
catch(e)
{Console.error(String.format('{0}::ShowVEPluginMap| VE Nav Ctrl hack failed','VEBirdseye.js'));}}}}
function VEOnEndPan(me)
{UpdateBEExtents(me);}
function VEOnEndZoom(me)
{if(g_veBEIgnoreZoomEnd)
{g_veBEIgnoreZoomEnd=false;}
else
{UpdateBEExtents(me);}}
function SetVEPluginMapWindowSize(mapSize){try{if(window.g_veBEMap){var onPointSetting=GetOnPointSettings(null);if(onPointSetting!=null){if(onPointSetting.useEmbeddedMapContainer){EmbeddedMapContainerResize(mapSize.width,onPointSetting.embeddedMapContainerHeight);}
var mapWidth=mapSize.width;var mapHeight=mapSize.height;if(g_hostInCustomMapTab){mapHeight=mapHeight-25;}
else{mapHeight=mapHeight-5;}
var outerMapDivReference=getObject("outer_map_"+onPointSetting.id);if(outerMapDivReference!=null){if((parseInt(outerMapDivReference.style.width)!=mapWidth)||(parseInt(outerMapDivReference.style.height)!=mapHeight)){outerMapDivReference.style.width=mapWidth+"px";outerMapDivReference.style.height=mapHeight+"px";var mapDivReference=getObject("map_"+onPointSetting.id);if(mapDivReference!=null){if((parseInt(mapDivReference.style.width)!=mapWidth)||(parseInt(mapDivReference.style.height)!=mapHeight)){mapDivReference.style.width=mapWidth+"px";mapDivReference.style.height=mapHeight+"px";}}
try{window.g_veBEMap.Resize(mapWidth,mapHeight);}
catch(e){Console.error(String.format('{0}::{1}| window.g_veBEMap.Resize error - {2}','VEBirdseye.js','SetVEBirdseyeMapWindowSize',e.message));}}}}}}catch(e){Console.error(String.format('{0}::{1}| Unknown error - {2}','VEBirdseye.js','SetVEBirdseyeMapWindowSize',e.message));}}
function UpdateBEExtents(me)
{if(window.g_veBEMap)
{var env=null;var mapStyle=g_veBEMap.GetMapStyle();if(mapStyle==VEMapStyle.Birdseye||mapStyle==VEMapStyle.BirdseyeHybrid||mapStyle==VEMapStyle.Oblique)
{env=window.g_veBEMap.GetBirdseyeScene().GetBoundingRectangle();}
else
{env=window.g_veBEMap.GetMapView();}
var ul=env.TopLeftLatLong;var lr=env.BottomRightLatLong;var ur=env.TopRightLatLong;var ll=env.BottomLeftLatLong;var xMin;var yMin;var xMax;var yMax;if(ul!=null&&lr!=null&&ur!=null&&ll!=null)
{var minX1=Math.min(ll.Longitude,lr.Longitude);var minX2=Math.min(ul.Longitude,ur.Longitude);xMin=Math.min(minX1,minX2);var maxX1=Math.max(ll.Longitude,lr.Longitude);var maxX2=Math.max(ul.Longitude,ur.Longitude);xMax=Math.max(maxX1,maxX2);var minY1=Math.min(ll.Latitude,lr.Latitude);var minY2=Math.min(ul.Latitude,ur.Latitude);yMin=Math.min(minY1,minY2);var maxY1=Math.max(ll.Latitude,lr.Latitude);var maxY2=Math.max(ul.Latitude,ur.Latitude);yMax=Math.max(maxY1,maxY2);}else{xMin=Math.min(ul.Longitude,lr.Longitude);xMax=Math.max(ul.Longitude,lr.Longitude);yMin=Math.min(lr.Latitude,ul.Latitude);yMax=Math.max(lr.Latitude,ul.Latitude);}
try
{if(_Onpoint.MapHistory)
{var onPointSetting=GetOnPointSettings(null);_Onpoint.MapHistory.UpdateMapTabExtentsFromLatLong(onPointSetting.mapSrcId,xMin,yMin,xMax,yMax);}}
catch(e){Console.error(String.format('{0}::{1}| Unknown error - {2}','VEPlugin.js','UpdateBEExtents',e.message));}}}
var g_pgX;var g_pgY;var tooltip=null;var tooltipEvt=null;var _maptip_current_x=-1;var _maptip_current_y=-1;var popupDialog=null;function HidePopupDialog()
{}
function getServerProtocol()
{var protocol=window.location.protocol;var theHost=window.location.hostname;var port=window.location.port;if(port)
{port=":"+port;}
var newUrl=protocol+"//"+theHost+port;return newUrl;}
function ExtractXY(evt){if(evt.clientX)
g_pgX=evt.clientX;else if(evt.screenX)
g_pgX=evt.screenX;else
g_pgX=evt.x;if(evt.clientY)
g_pgY=evt.clientY;else if(evt.pageY)
g_pgY=evt.pageY;else
g_pgY=evt.y;}
function ShowMapTipDialog(evt)
{var mapTipObj=eval("maptipObject");if(mapTipObj!=null&&evt!=null&&evt.xy!=null){ExtractXY(evt);CreateToolTip(evt,mapTipObj,true);mapTipObj.GetInfo(evt.xy.x,evt.xy.y);}}
function HideGeoRSS()
{}
function ShowGeoRSSTipDialog(evt,a_message){var mapTipObj=eval("maptipObject");if(mapTipObj!=null){ExtractXY(evt);CreateToolTip(evt,mapTipObj);LaunchToolTip(a_message);}}
function DisplayMapTips(pnlElemId)
{if(!((typeof window.g_GMAPCurrentView!='undefined')&&(window.g_GMAPCurrentView==JsMapView.EARTH||window.g_GMAPCurrentView==JsMapView.STREET)))
{if(window.ShowLayer)
{ShowLayer(pnlElemId,null,null);}
else
{if(pnlElemId!=null)
{var pnlElem=document.getElementById(pnlElemId);if(pnlElem!=null)
{pnlElem.style.display="block";xZIndex(pnlElem,highZ++);}}}
SetDrawMode(DrawMode.MAPTIP);}}
function ClearMapTipDropdownItems()
{var mapTipObj=eval("maptipObject");if(mapTipObj!=null)
{var drpElem=document.getElementById(mapTipObj.LayerElemId);if(drpElem!=null)
{var count=drpElem.options.length;for(i=count-1;i>=0;i--)
{drpElem.options[i]=null;}
var option=createOption(mapTipObj.NoMapTipLayersMsg,"-1");drpElem.options.add(option);RefreshDropdownControl(mapTipObj.LayerElemId);}}}
function getXMLAttributeValue(node,attributeName)
{if(node&&node.attributes)
{attrNode=node.attributes.getNamedItem(attributeName);if(attrNode)
return attrNode.nodeValue;}}
function createOption(itemText,itemValue)
{var option=document.createElement("OPTION");if(option!=null)
{option.text=itemText;option.value=itemValue;}
return option;}
function AddMapTipDropDownItems(items)
{var mapTipObj=eval("maptipObject");if(mapTipObj!=null)
{var drpElem=document.getElementById(mapTipObj.LayerElemId);if(drpElem!=null)
{var count=drpElem.options.length;for(i=count-1;i>=0;i--)
{drpElem.options[i]=null;}
for(i=0;i<items.length;i++)
{if(items[i]!=null)
{drpElem.options.add(items[i]);}}
RefreshDropdownControl(mapTipObj.LayerElemId);}}}
function HideMapTips(divElemId){var drpElem=document.getElementById(divElemId);if(drpElem!=null){drpElem.style.display="none";}
SetDrawMode(DrawMode.NONE);clearTimeout(timeoutId);}
function MaptipLayer_OnChange(drpElem)
{var mapTipObj=eval("maptipObject");if(mapTipObj!=null)
{if(!sessionExpired)
{if(drpElem!=null&&mapTipObj.SetCurrentMapTipLayer!=null)
{alert(drpElem.value);mapTipObj.SetCurrentMapTipLayer(drpElem.value,HandleSetMapTipDon);}}
else
{HandleSessionExpired();}}}
function DisplayInfo(locationX,locationY,layerId)
{if(window.ShowInfoWindow)
{ShowInfoWindow(locationX,locationY,layerId);}}
function MapTip(layerDropDownId,maptipTriggerTime,maptipDisplayDuration,imagePath,msgNoMapTipLayer)
{this.LayerElemId=layerDropDownId;this.TriggerTime=maptipTriggerTime;this.DisplayDuration=maptipDisplayDuration*1000;this.NoMapTipLayersMsg=msgNoMapTipLayer;this.ImagePath=imagePath;this.GetResultTip=GetResultTip;this.GetResultMapTip=GetResultMapTip;this.Heading;this.Message;this.HeaderFontStyle;this.MessageFontStyle;this.FooterFontStyle;this.GetInfo=function(x,y){var status=false;this.Heading=null;this.Message=null;var layerId;var drpElem=document.getElementById(this.LayerElemId);if(!sessionExpired){if(drpElem!=null){layerId=drpElem.value;if(layerId!=null&&layerId.length>0){this.Heading=getOptionText(drpElem,drpElem.selectedIndex);PageMethods.GetMapTipHtml(layerId,parseInt(x),parseInt(y),HandleGetInfo);}}}
else{}
return status;}
this.GetSelectionTip=function(x,y){var status=false;this.Heading=null;this.Message=null;if(!sessionExpired){PageMethods.GetSelectionTipHtml(x,y,HandleGetInfo);}
else{}
return status;}
function HandleGetInfo(postData)
{if(postData!=null&&postData.Status){if(postData.LocationX==tooltipEvt.xy.x&&postData.LocationY==tooltipEvt.xy.y){LaunchToolTip(postData.ContentText);}}}
function getOptionText(drpElem,selectedIndex)
{var optionText=null;if(drpElem!=null&&selectedIndex!=null)
{var option=drpElem.options[selectedIndex];if(option!=null)
{optionText=option.text;}}
return optionText;}}
function HandleSetMapTipDon(resp)
{}
function UpdateMapTips()
{PageMethods.RefreshMapTips(HandleMapTipRefresh);}
function HandleMapTipRefresh(obj)
{if(obj!=null)
{if(obj.error==null)
{var xmlStr=null;if(obj.value)
xmlStr=obj.value;else
xmlStr=obj;try
{if(isIE)
{objXmlDoc=new ActiveXObject("Msxml2.DOMDocument");objXmlDoc.loadXML(xmlStr);}
else
{objXmlDoc=new DOMParser().parseFromString(xmlStr,"text/xml");}
var errorNodes=objXmlDoc.getElementsByTagName("ERROR");if(errorNodes!=null&&errorNodes.length>0)
{var message=getAttributeValue(errorNodes[0],"message");if(message!=null&&message.length>0)
{alert(message);}}
else
{RefreshMapTipLayers(objXmlDoc);}}
catch(ex)
{alert('HandleMapTipRefresh - exception:'+ex.message);}}
else
{alert(obj.error);}}}
function RefreshMapTipLayers(xmlDoc)
{var mapTipNode=xmlDoc.getElementsByTagName("MAPTIPLAYERS");var currentMapTipLayer=null;if(mapTipNode&&mapTipNode.length>0)
{currentMapTipLayer=getXMLAttributeValue(mapTipNode.item(0),"currentlayer");}
var mapTipNodeList=xmlDoc.getElementsByTagName("LAYER");if(mapTipNodeList!=null&&mapTipNodeList.length>0)
{var optionsList=new Array();for(i=0;i<mapTipNodeList.length;i++)
{var layerId=getXMLAttributeValue(mapTipNodeList.item(i),"id");var name=getXMLAttributeValue(mapTipNodeList.item(i),"name");var option=createOption(name,layerId);if(currentMapTipLayer!=null&&layerId!=null&&layerId==currentMapTipLayer)
{option.selected=true;}
if(option!=null)
{optionsList.push(option);}}
AddMapTipDropDownItems(optionsList);}
else
{ClearMapTipDropdownItems();}}
function GetResultTip(searchId,featureId){var status=false;this.Heading=null;this.Message=null;if(!sessionExpired){PageMethods.GetResultTipHtml(searchId,featureId,__showSelections,HandleGetResultTip);}
else{HandleSessionExpired();}
return status;}
function HandleGetResultTip(postData){if(postData!=null&&postData.Status&&postData.ContentText)
{LaunchToolTip(postData.ContentText);}}
function GetResultMapTip(searchId,featureId){var status=false;this.Heading=null;this.Message=null;if(!sessionExpired){PageMethods.GetResultTipHtml(searchId,featureId,__showSelections,HandleResultMapTip);}
else{HandleSessionExpired();}
return status;}
function HandleResultMapTip(postData){if(postData!=null&&postData.Status&&postData.ContentText){LaunchToolTip(postData.ContentText);}}
function ShowResultTipDialogOnMap(src,searchId,featureId,event,mapX,mapY){try{var mapTipObj=eval("maptipObject");if(mapTipObj!=null){var origPoint=new OpenLayers.Geometry.Point(mapX,mapY);var eventCloned=OpenLayers.Util.extend({},event);var center=g_OLMapCtrls[0].center;var point=new OpenLayers.Geometry.Point(center.lon,center.lat);var settings=GetOnPointSettings(g_OLMapCtrls[0].id);var element=NgGetElementById(settings.divId).offsetParent;var mapControlOffSetTop=element.offsetTop;var mapControlOffSetLeft=element.offsetLeft;var scrollY=MSIEBodyReturn().scrollTop;var scrollX=MSIEBodyReturn().scrollLeft;var lonlat=new OpenLayers.LonLat(mapX,mapY);var screenBounds=g_OLMapCtrls[0].getExtent();var onScreen=screenBounds.containsLonLat(lonlat);var pixel;if(onScreen==false){g_OLMapCtrls[0].panTo(lonlat,{'dragging':false});pixel=ConvertPointToPixel(point,g_OLMapCtrls[0].id);}
else{pixel=ConvertPointToPixel(origPoint,g_OLMapCtrls[0].id);}
var isIE=(window.navigator.appName.toLowerCase().indexOf("microsoft")>=0)
if(isIE==true){eventCloned.clientX=parseFloat(pixel.x)+mapControlOffSetLeft-scrollX;eventCloned.clientY=parseFloat(pixel.y)+mapControlOffSetTop-scrollY;}
else{eventCloned.pageX=parseFloat(pixel.x)+mapControlOffSetLeft;eventCloned.pageY=parseFloat(pixel.y)+mapControlOffSetTop;}
CreateToolTip(eventCloned,mapTipObj,true);if(window.event){g_pgX=window.event.clientX;g_pgY=window.event.clientY;}
else if(src){g_pgX=8;g_pgY=8;if(src.offsetParent){do{g_pgX+=src.offsetLeft;g_pgY+=src.offsetTop;}
while(src=src.offsetParent);}}
mapTipObj.GetResultMapTip(searchId,featureId);}}
catch(ex)
{}}
function MSIEBodyReturn()
{return(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;}
function ShowResultTipDialog(src,searchId,featureId,event)
{var mapTipObj=eval("maptipObject");if(mapTipObj!=null){var eventCloned=window.top.OpenLayers.Util.extend({},event);CreateToolTip(eventCloned,mapTipObj,true);if(window.event){g_pgX=window.event.clientX;g_pgY=window.event.clientY;}
else if(src){g_pgX=8;g_pgY=8;if(src.offsetParent){do{g_pgX+=src.offsetLeft;g_pgY+=src.offsetTop;}
while(src=src.offsetParent);}}
mapTipObj.GetResultTip(searchId,featureId);}}
function ShowSelectionTip(evt){if(evt!=null&&evt.xy!=null){if(balloonIsVisible){if(_maptip_tolerance!=null&&_maptip_tolerance>0){if(_maptip_current_x>0&&_maptip_current_y>0){if(Math.abs(evt.xy.x-_maptip_current_x)<_maptip_tolerance&&Math.abs(evt.xy.y-_maptip_current_y)<_maptip_tolerance){return;}}}}
_maptip_current_x=evt.xy.x;_maptip_current_y=evt.xy.y;var mapTipObj=eval("maptipObject");if(mapTipObj!=null){ExtractXY(evt);CreateToolTip(evt,mapTipObj);mapTipObj.GetSelectionTip(evt.xy.x,evt.xy.y);}}}
function ToolTipConfig(options){if(options!=null){for(var property in options){var value=options[property];if(value!==undefined){this[property]=value;}}}}
var closeHtml=null;function LaunchToolTip(content){if(tooltip!=null&&tooltipEvt!=null){content=closeHtml+content;tooltip.showTooltip(tooltipEvt,content,1);}}
function CreateToolTip(evt,mapTipObj,showLoading){tooltipEvt=evt;if(mapTipObj!=null){if(!tooltip){tooltip=new Balloon;BalloonConfig(tooltip,'GBubble');tooltip.padding=5;tooltip.shadow=0;tooltip.stemHeight=20;tooltip.stemOverlap=1;tooltip.images=getServerProtocol()+mapTipObj.ImagePath;tooltip.vOffset=-3;tooltip.hOffset=-8;tooltip.balloonImage='balloon.png';tooltip.upLeftStem='up_left.png';tooltip.upRightStem='up_right.png';tooltip.downLeftStem='down_left.png';tooltip.downRightStem='down_right.png';tooltip.ieImage=null;tooltip.delayTime=1;tooltip.allowEventHandlers=true;tooltip.opacity=1;if(toolTipConfig!=null){for(var property in toolTipConfig){var value=toolTipConfig[property];if(value!==undefined){tooltip[property]=value;}}}
tooltip.displayTime=mapTipObj.DisplayDuration;var dir="style = 'text-align:right;'";if((document.all&&!window.opera)&&htmlDir&&htmlDir=='RTL')
dir="style = 'text-align:left;'";closeHtml="<div id='TipCloseDiv' "+dir+">";closeHtml+="<img style='cursor:pointer;' onclick='tooltip.hideTooltip(1);' src='"+tooltip.images+"/close.gif'>";closeHtml+="</div>";}
if(tooltip){tooltip.hideTooltip(true);if(showLoading&&mapTipObj&&mapTipObj.loadingImage){var content="<img src='"+mapTipObj.loadingImage+"' border='0'/>";tooltip.showTooltip(tooltipEvt,content,1);}}}}
function CreateSimpleBallon(evt,mapTipObj,showLoading)
{tooltipEvt=evt;if(mapTipObj!=null)
{if(!tooltip)
{tooltip=new Balloon;BalloonConfig(tooltip,'GBox');tooltip.padding=5;tooltip.shadow=0;tooltip.stemHeight=20;tooltip.stemOverlap=1;tooltip.images=getServerProtocol()+mapTipObj.ImagePath;tooltip.vOffset=-3;tooltip.hOffset=-8;tooltip.balloonImage='balloon.png';tooltip.upLeftStem='up_left.png';tooltip.upRightStem='up_right.png';tooltip.downLeftStem='down_left.png';tooltip.downRightStem='down_right.png';tooltip.ieImage=null;tooltip.delayTime=1;tooltip.allowEventHandlers=true;tooltip.opacity=1;if(toolTipConfig!=null)
{for(var property in toolTipConfig)
{var value=toolTipConfig[property];if(value!==undefined)
{tooltip[property]=value;}}}
tooltip.displayTime=mapTipObj.DisplayDuration;var dir="style = 'text-align:right;'";if((document.all&&!window.opera)&&htmlDir&&htmlDir=='RTL')
dir="style = 'text-align:left;'";closeHtml="<div id='TipCloseDiv' "+dir+">";closeHtml+="<img style='cursor:pointer;' onclick='tooltip.hideTooltip(1);' src='"+tooltip.images+"/close.gif'>";closeHtml+="</div>";}
if(tooltip)
{tooltip.hideTooltip(true);if(showLoading&&mapTipObj&&mapTipObj.loadingImage)
{var content="<img src='"+mapTipObj.loadingImage+"' border='0'/>";tooltip.showTooltip(tooltipEvt,content,1);}}}}
function HideSelectionTip(){if(tooltip!=null){tooltip.hideTooltip(true);}}
function ToggleSelectionTip(enable){var mapop=g_OLMapCtrls[0];if(mapop){if(enable)
mapop.SetSelectionTipControlOn();else
mapop.SetSelectionTipControlOff();}}
function HandleMissingImage(img){if(img&&img.src){img.onerror=null;if(img.removeEventListener){img.removeEventListener("error",HandleMissingImage,false)}
img.src=NGServerUrl()+"/images/NoImageAvailable.png";}}
function ShowSearchCriteria(src,message,event)
{var mapTipObj=eval("maptipObject");if(mapTipObj!=null)
{ExtractXY(event);CreateSimpleBallon(event,mapTipObj);LaunchToolTip(message);}}
function GetSearchCriteria(){var status=false;this.Heading=null;this.Message=null;if(!sessionExpired){PageMethods.GetSearchCriteriaHtml(HandleSearchCriteria);}
else{HandleSessionExpired();}
return status;}
function HandleSearchCriteria(postData)
{if(postData!=null&&postData.Status&&postData.ContentText)
{LaunchToolTip(postData.ContentText);}}
var JSBalloonPath=null;var js_isNav=(window.navigator.appName.toLowerCase().indexOf("netscape")>=0);var js_isIE=(window.navigator.appName.toLowerCase().indexOf("microsoft")>=0);function JSBalloon()
{var tmrBalloonPopup;var imagePath;var blbWidth=250;;var titleFontStyle='font-family: MS Sans Serif;font-weight: bold; font-size:10pt;';var messageFontStyle='font-family: MS Sans Serif\; font-size:10pt\;';var footerFontStyle='font-family: MS Sans Serif\; font-size:10pt\;';var headerFontStyle='font-family: MS Sans Serif\; font-size:10pt\;';var transShow=true;var transHide=true;var transShowFilter='progid:DXImageTransform.Microsoft.Stretch(stretchstyle=SPIN)';var transHideFilter='progid:DXImageTransform.Microsoft.Slide(slidestyle=HIDE,Bands=1)';var autoHide=true;var autoHideInterval=4000;var autoAway=true;var showCloseBox=false;this.left;this.top;this.title;this.message;this.header;this.CloseButtonFunction;this.titleFontStyle=titleFontStyle;this.messageFontStyle=messageFontStyle;this.footerFontStyle=footerFontStyle;this.headerFontStyle=headerFontStyle;this.transShowFilter=transShowFilter;this.transHideFilter=transHideFilter;this.transShow=transShow;this.transHide=transHide;this.autoHide=autoHide;this.autoHideInterval=autoHideInterval;this.autoAway=autoAway;this.width=blbWidth;this.showCloseBox=showCloseBox;var childID;var balloonDIV=document.createElement("DIV");balloonDIV.style.width=String(blbWidth)+"px";balloonDIV.style.position="absolute";balloonDIV.style.visibility="hidden";balloonDIV.style.left=0;balloonDIV.style.top=0;balloonDIV.style.filter=transShowFilter+' '+transHideFilter;balloonDIV.style.zIndex=2001;this.balloon=balloonDIV;this.Show=Show;this.Hide=Hide;this.GetTop=getTop;this.GetLeft=getLeft;function Show()
{var title=this.title;var message=this.message;var icon='';var footer=this.footer;var header=this.header;var btop=0,bleft=0;var atop=0,aleft=0;var anchor;var direction='SE';blbWidth=String(this.width);titleFontStyle=this.titleFontStyle;messageFontStyle=this.messageFontStyle;footerFontStyle=this.footerFontStyle;headerFontStyle=this.headerFontStyle;transShowFilter=this.transShowFilter;transHideFilter=this.transHideFilter;transShow=this.transShow;transHide=this.transHide;autoHide=this.autoHide;autoHideInterval=this.autoHideInterval;autoAway=this.autoAway;if(js_isIE&&document.readyState!='complete')
{alert('Document needs to fully load before you may show JSBalloons.');return;}
var messageHTML=balloonBody(title,icon,message,footer,this.titleFontStyle,this.messageFontStyle,this.footerFontStyle,this.showCloseBox,header,this.headerFontStyle,this.CloseButtonFunction);var ret=balloonInfrastructure(messageHTML,direction);balloonDIV.innerHTML=ret;bleft=this.left;btop=this.top;if(typeof(childID)!='object')
{childID=document.body.appendChild(balloonDIV);}
var balloonDIVTop;var balloonDIVLeft;balloonDIVLeft=bleft;balloonDIVTop=(btop-balloonDIV.offsetHeight);var bAdjustedLeft=parseInt(balloonDIVLeft,10);var showSE;if(document.body.offsetWidth<(bAdjustedLeft+balloonDIV.offsetWidth+20))
{direction='SW';ret=balloonInfrastructure(messageHTML,direction);balloonDIV.innerHTML=ret;balloonDIVLeft=bAdjustedLeft-balloonDIV.offsetWidth+20;showSE=false;}
else
{direction='SE';showSE=true;}
if(parseInt(balloonDIVTop,10)<0)
{if(showSE)
{direction='NE';ret=balloonInfrastructure(messageHTML,direction);balloonDIV.innerHTML=ret;}
else
{direction='NW';ret=balloonInfrastructure(messageHTML,direction);balloonDIV.innerHTML=ret;}
balloonDIVTop=parseInt(balloonDIVTop,10)+balloonDIV.offsetHeight;}
var scrollOffsets=ScrollOffsets();balloonDIVTop=parseInt(balloonDIVTop,10)+scrollOffsets[0];balloonDIVLeft=parseInt(balloonDIVLeft,10)+scrollOffsets[1];balloonDIV.style.top=balloonDIVTop+"px";if(window.htmlDir)
{if(htmlDir=="RTL"&&js_isIE)
balloonDIVLeft=balloonDIVLeft-20;}
balloonDIV.style.left=balloonDIVLeft+"px";balloonDIV.style.visibility='visible';if(this.autoHide)
{clearTimeout(this.tmrBalloonPopup);transHide=this.transHide;this.tmrBalloonPopup=setTimeout(this.Hide,this.autoHideInterval);}
if(this.autoAway)
{balloonDIV.onmouseover=Hide;}
else
{balloonDIV.onmouseover='';}}
function Hide()
{if(balloonDIV.style.visibility=='hidden')
{return;}
{balloonDIV.style.visibility='hidden';}}
function ObjectOverlap(obj1,obj2)
{var obj1TopX=getLeft(obj1);var obj1TopY=getTop(obj1);var obj1BottomX=getLeft(obj1)+obj1.offsetWidth;var obj1BottomY=getTop(obj1)+obj1.offsetHeight;var obj2TopX=getLeft(obj2);var obj2TopY=getTop(obj2);var obj2BottomX=getLeft(obj2)+obj2.offsetWidth;var obj2BottomY=getTop(obj2)+obj2.offsetHeight;var overlapOnX=(obj1TopX<obj2BottomX&&obj2TopX<obj1BottomX);var overlapOnY=(obj1TopY<obj2BottomY&&obj2TopY<obj1BottomY);return(overlapOnX&&overlapOnY);}
function getObjLeft(anObject)
{return(anObject.offsetParent?(getObjLeft(anObject.offsetParent)+anObject.offsetLeft):anObject.offsetLeft);}
function getObjTop(anObject)
{return(anObject.offsetParent?(getObjTop(anObject.offsetParent)+anObject.offsetTop):anObject.offsetTop);}
function getLeft(anObject)
{return(getObjLeft(anObject));}
function getTop(anObject)
{return(getObjTop(anObject));}
function ScrollOffsets(){var scrOfX=0,scrOfY=0;if(typeof(window.pageYOffset)=='number'){scrOfY=window.pageYOffset;scrOfX=window.pageXOffset;}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrOfY=document.body.scrollTop;scrOfX=document.body.scrollLeft;}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrOfY=document.documentElement.scrollTop;scrOfX=document.documentElement.scrollLeft;}
if(window.htmlDir)
{if(htmlDir=="RTL")
scrOfX=0;}
return[scrOfY,scrOfX];}
function balloonInfrastructure(body,direction)
{var ret;switch(direction)
{case'SE':ret='<table class="JSBalloon" border="0" bordercolor="black" cellpadding="0" cellspacing="0" style="border-collapse: collapse; width:100%;direction:ltr;" >'+'  <tr>'+'    <td height="1" width="3">'+'<img border="0" src="'+JSBalloonPath+'/cLeftTop.gif" width="67" height="10" /></td>'+'    <td height="10" width="100%" style="border-top:1px solid #999999; border-left-width:1; border-right-width:1; border-bottom-width:1; background-color:#FFFFEA" colspan="4"></td>'+'    <td height="10"  width="10">'+'<img border="0" src="'+JSBalloonPath+'/cRightTop.gif" width="10" height="10" /></td>'+'  </tr>'+'  <tr>'+'    <td valign=top colspan="6" style="border-left: 1px solid #999999; border-right: 1px solid #999999; background-color: #FFFFEA">'+
body+'    </td>'+'  </tr>'+'  <tr>'+'    <td width="10" height="7" style="background-color:Transparent;direction:ltr;float:left">'+'    <img border="0" src="'+JSBalloonPath+'/cLeftBottomBig.gif" width="67" height="10" /></td>'+'    <td height="10" style="background-color: #FFFFEA" colspan="4" width="280"></td>'+'    <td width="10" height="10" >'+'    <img border="0" src="'+JSBalloonPath+'/cRightBottom.gif" width="10" height="10" /></td>'+'  </tr>'+'  <tr>'+'    <td height="10">'+'<img border="0" src="'+JSBalloonPath+'/aSouthEast.gif" /></td>'+'<td width=100% height="10" style="border-top: 1px solid #999999; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px"></td>'+'    <td width="70" height="10" style="border-top: 1px solid #999999; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1"></td>'+'    <td width="10" height="10"></td>'+'    <td width="1" style="border-top: 1px solid #999999; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" height="10"></td>'+'    <td width="10" height="10"></td>'+'  </tr>'+'</table>'
break;case'SW':ret='<div style="width:250px"><table class="JSBalloon" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; width:100%;direction:ltr;" bordercolor="#111111" id="AutoNumber1" >'+'  <tr>'+'    <td height="1" width="3">'+'<img border="0" src="'+JSBalloonPath+'/cLeftTop1.gif" width="10" height="10" /></td>'+'    <td height="7" width="100%" style="border-top:1px solid #999999; border-left-width:1; border-right-width:1; border-bottom-width:1; background-color:#FFFFEA" colspan="4"></td>'+'    <td height="7"  width="10">'+'<img border="0" src="'+JSBalloonPath+'/cRightTop.gif" width="10" height="10" /></td>'+'  </tr>'+'  <tr>'+'    <td valign=top colspan="6" style="border-left: 1px solid #999999; border-right: 1px solid #999999;  background-color: #FFFFEA"">'+
body+'    </td>'+'  </tr>'+'  <tr>'+'    <td width="10" height="7">'+'    <img border="0" src="'+JSBalloonPath+'/cLeftBottom.gif" width="10" height="10" /></td>'+'    <td height="7" style="background-color: #FFFFEA" colspan="4" width="179"></td>'+'    <td width="11" height="7">'+'    <img border="0" src="'+JSBalloonPath+'/cRightBottom.gif" width="10" height="10" /></td>'+'  </tr>'+'  <tr>'+'    <td width="10" height="10"></td>'+'    <td width="70" style="border-top: 1px solid #999999; border-left-width:1; border-right-width:1; border-bottom-width:1" height="10"></td>'+'    <td  height="10" style="border-left-width: 1; border-right-width: 1; border-top: 1px solid #999999; border-bottom-width: 1" width="100%">'+'    </td>'+'    <td  align="right">'+'    <img border="0" src="'+JSBalloonPath+'/aSouthWest.gif" width="67" height="18" /></td>'+'    <td width="1" height="10" style="border-top: 1px solid #999999;"></td>'+'    <td width="10" height="10"></td>'+'  </tr>'+'</table></div>'
break;case'NE':ret='<div style="width:250px"><table class="JSBalloon" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse;width:100%;direction:ltr;" bordercolor="#111111" id="AutoNumber1" >'+'   <tr>'+'    <td width="10" height="9"></td>'+'    <td width="1" style="border-bottom:1px solid #999999; " height="9"></td>'+'    <td  height="9" valign="bottom">'+'    <img border="0" src="'+JSBalloonPath+'/aNorthEast.gif" width="67" height="18" /></td>'+'    <td width=100% height="9" style="border-bottom:1px solid #999999; "></td>'+'    <td width="70" height="9" style="border-bottom:1px solid #999999;"></td>'+'    <td width="10" height="9"></td>'+'  </tr>'+'  <tr>'+'    <td height="1" width="10">'+'    <img border="0" src="'+JSBalloonPath+'/cLeftTop1.gif" width="10" height="10" /></td>'+'    <td height="7" width=100% colspan="4" bgcolor="#FFFFEA"></td>'+'    <td height="7"  width="10">'+'    <img border="0" src="'+JSBalloonPath+'/cRightTop.gif" width="10" height="10" /></td>'+'  </tr>'+'  <tr>'+'    <td valign=top colspan="6" style="border-left: 1px solid #999999; border-right: 1px solid #999999; background-color: #FFFFEA">'+
body+'    </td>'+'  </tr>'+'  <tr>'+'    <td width="10" height="7">'+'    <img border="0" src="'+JSBalloonPath+'/cLeftBottom.gif" width="10" height="10" /></td>'+'    <td height="7" style="border-bottom:1px solid #999999; border-left-width:1; border-right-width:1; border-top-width:1" colspan="4" width="280" bgcolor="#FFFFEA"></td>'+'    <td width="10" height="7">'+'    <img border="0" src="'+JSBalloonPath+'/cRightBottom.gif" width="10" height="10" /></td>'+'  </tr>'+'</table></div>'
break;case'NW':ret='<div style="width:250px"><table class="JSBalloon" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse;width:100%;direction:ltr;" bordercolor="#111111" id="AutoNumber1" >'+'  <tr>'+'    <td width="10" height="10"></td>'+'    <td width="70" style="border-bottom:1px solid #999999;  border-left-width:1; border-right-width:1; " height="10"></td>'+'    <td  height="10" style="border-bottom:1px solid #999999; border-left-width: 1; border-right-width: 1; " width="100%">'+'    </td>'+'    <td  align="right" valign="bottom">'+'    <img border="0" src="'+JSBalloonPath+'/aNorthWest.gif" width="67" height="18" /></td>'+'    <td width="1" height="10" style="border-bottom:1px solid #999999;"></td>'+'    <td width="10" height="10"></td>'+'  </tr>'+'  <tr>'+'    <td height="1" width="10">'+'    <img border="0" src="'+JSBalloonPath+'/cLeftTop1.gif" width="10" height="10" /></td>'+'    <td height="7" width=179 colspan="4" bgcolor="#FFFFEA"></td>'+'    <td height="7"  width="11">'+'    <img border="0" src="'+JSBalloonPath+'/cRightTop.gif" width="10" height="10" /></td>'+'  </tr>'+'  <tr>'+'    <td valign=top colspan="6" style="border-left: 1px solid #999999; border-right: 1px solid #999999;  background-color: #FFFFEA">'+
body+'    </td>'+'  </tr>'+'  <tr>'+'    <td width="10" height="7">'+'    <img border="0" src="'+JSBalloonPath+'/cLeftBottom.gif" width="10" height="10" /></td>'+'    <td height="7" style="border-bottom:1px solid #999999; border-left-width:1; border-right-width:1; border-top-width:1" colspan="4" width="179" bgcolor="#FFFFEA"></td>'+'    <td width="11" height="7">'+'    <img border="0" src="'+JSBalloonPath+'/cRightBottom.gif" width="10" height="10" /></td>'+'  </tr>'+'</table></div>'
break;}
return ret;}
function hidePopUp()
{imgClose='none';}
function balloonBody(title,icon,body,footer,titleFontStyle,messageFontStyle,footerFontStyle,showCloseBox,header,headerFontStyle,closeButtonFunction)
{var imgShow='none';var iconTitle='';var ballonBody=body;var imgClose='none';var headerVisible='block';var offsetParent="-7";if(title!=undefined)
{iconTitle=title;}
if(showCloseBox)
{imgClose='block';imgClose.onclick=hidePopUp;}
else
{imgClose='none';}
if(icon!='')
{imgShow='block';}
else
{imgShow='none';}
if(imgShow=='none'&&imgClose=='none'&&iconTitle=='')
{headerVisible='none';offsetParent="0";}
else
{headerVisible='block';offsetParent="-7";}
var retObj=' <table border="0" cellpadding="3" cellspacing="0" style="cursor:default;border-collapse: collapse; position:relative; top: '+offsetParent+';left:3;direction:ltr;" width="100%">'+' <tr style="display:'+headerVisible+'">'+' <td id="BIcon" width="3%" align=left><img id=BIcon src="'+icon+'" style="display:'+imgShow+'" /></td>';if(window.htmlDir=="RTL")
{retObj+=' <td id="BClose" width="3%" valign=top dir=ltr><img src="'+JSBalloonPath+'/close.jpg" style="position:relative; top: 4;left:-5;display:'+imgClose+'" onmouseover="this.src=\''+JSBalloonPath+'/closeActive.jpg\'" onmouseout="this.src=\''+JSBalloonPath+'/close.jpg\'" onmouseup="this.src=\''+JSBalloonPath+'/closeActive.jpg\'" onmousedown="this.src=\''+JSBalloonPath+'/closeDown.jpg\'" title="Close" onclick="eval('+closeButtonFunction+');" />&nbsp;</td>'+' <td id="BTitle" UNSELECTABLE="on" width="90%" style="'+titleFontStyle+'" dir=rtl>'+iconTitle+'</td>';}
else
{retObj+=' <td id="BTitle" UNSELECTABLE="on" width="90%" style="'+titleFontStyle+'" dir=ltr>'+iconTitle+'</td>'+' <td id="BClose" width="3%" valign=top dir=rtl><img src="'+JSBalloonPath+'/close.jpg" style="position:relative; top: 4;left:-5;display:'+imgClose+'" onmouseover="this.src=\''+JSBalloonPath+'/closeActive.jpg\'" onmouseout="this.src=\''+JSBalloonPath+'/close.jpg\'" onmouseup="this.src=\''+JSBalloonPath+'/closeActive.jpg\'" onmousedown="this.src=\''+JSBalloonPath+'/closeDown.jpg\'" title="Close" onclick="eval('+closeButtonFunction+');" />&nbsp;</td>';}
retObj+=' </tr>'+' <tr>'+' <td id="BFooter" UNSELECTABLE="on" style="'+headerFontStyle+'" width="100%" colspan="3">'+header+'</td>'+' </tr>'+' <tr>'+' <td id="BBody" UNSELECTABLE="on" style="'+messageFontStyle+'" width="100%" colspan="3">'+ballonBody+'</td>'+' </tr>'+' <tr>'+' <td id="BFooter" UNSELECTABLE="on" style="'+footerFontStyle+'" width="100%" colspan="3">'+footer+'</td>'+' </tr>'+' </table>'
return retObj;}}
