var Map; function OnMapCreated(map) { Map = map; if (map.popups.length > 0) { var i = 0; for (i = 0; i < map.popups.length; i++) { OpenLayers.Event.stopObservingElement(map.popups[i].closeDiv, "click", OpenLayers.Function.bindAsEventListener(function () { this.hide(); }, map.popups[i])); OpenLayers.Event.observe(map.popups[i].closeDiv, "click", OpenLayers.Function.bindAsEventListener(closeCallBack, map.popups[i])); OpenLayers.Event.observe(map.popups[i].closeDiv, "touchend", OpenLayers.Function.bindAsEventListener(closeCallBack, map.popups[i])); } } var hidden = document.getElementById("MainContent_HiddenOverlaySwitcherMinimizedState"); var value = parseInt(hidden.value) - 2; if (value % 2 == 0) { var layerSwither = map.getControl("LayerSwitcher"); if (layerSwither) { layerSwither.minimizeControl(); } hidden.value = 1; } else { hidden.value = 0; } } function closeCallBack() { var item_index; for (item_index = 0; item_index < Map.popups.length; item_index++) { Map.popups[item_index].hide(); } __doPostBack('', "PopupClosed"); this.hide(); }