var _MAP_WRAPPER=new Map_Wrapper();var _LIST_OF_EXTRA_GRAPHICS=new Array(new Extra_Graphics());var _OP_USER=new Idle();var _IMAGES_TO_LOAD=0;var _MAP_IMAGES_TO_LOAD=0;var _jg=null;var _jg2=null;var _EVENT_LISTENER=null;var _KEY_EVENT_LISTENER=null;var _INTERACTIVE_ELEMENT_LISTENER=null;var _MAP_LOADED_LIST_OF_LISTENERS=new Array();var _ESC_KEY_LISTENER=null;var _CTRL_KEY_DOWN=false;var _ENTER_KEY_LISTENER=null;var _SHIFT_KEY_LISTENER=null;var _DELETE_KEY_LISTENER=null;var _EVENTS_DRAWING_ENGINE=0;var _SELECTION_DRAWING_ENGINE=1;var _ALL_DRAWING_ENGINES=2;var _SHOW_COORDINATES=true;var _WIN=null;var _WINDOW_ID="window";var _LAYERS_ID="layers_panel";var _MAP_ID="mappa";var _SCALE_ID="bbar_scale";var _COORDS_ID="bbar_coords";var _COMMUNITY_ID="tbar_community";var _EXT_LAYOUT=null;var _LAYOUT_NORTH=null;var _LAYOUT_CENTER=null;var _LAYOUT_SOUTH=null;var _EXT_LAYERS_PANEL=null;var _EXT_ZOOMSLIDER=null;var _EXT_REFERENCE_MAP=null;var _TIMEOUT_FUNCTION=null;var _TIMEOUT_SCROLL_FUNCTION=null;var _TEMP_ZOOMSCROLL_FACTOR=1;var _NO_SNAP=0;var _SNAP_NEW_POINT=1;var _SNAP_EXISTING_POINT=2;function init_ext_layout(b){try{_EXT_LAYOUT=new Ext.Viewport({layout:"border",items:[{id:"north_container",region:"north",margins:"0 0 0 0",autoHeight:true},{id:"center_container",region:"center",margins:"0 0 0 0",contentEl:_WINDOW_ID},{id:"south_container",region:"south",margins:"0 0 0 0",autoHeight:true,tbar:[{xtype:"tbtext",autoHeight:true,contentEl:_SCALE_ID},"-",{xtype:"tbtext",autoHeight:true,contentEl:_COORDS_ID},"->",{xtype:"tbbutton",text:"Minimap",enableToggle:true,handler:evt_but_reference_map}]}]});_EXT_LAYOUT.show();register_map_loaded_event_handler(set_resize_browser_listener);_EXT_LAYERS_PANEL=new Ext.Window({title:_MSG_LAYERS,cls:"white",closable:false,collapsible:true,autoScroll:true,constrain:true,contentEl:_LAYERS_ID});if(b){_EXT_LAYERS_PANEL.show()}else{_EXT_LAYERS_PANEL.hide()}_EXT_ZOOMSLIDER=new Ext.slider.SingleSlider({renderTo:"zoomslider_panel",height:150,minValue:-10,maxValue:10,vertical:true,clickToChange:false,plugins:new Ext.slider.Tip({getText:function(c){return String.format("<b>Zoom {0}x</b>",c.value)}}),listeners:{drag:function(c){evt_zoomslider_change(c,false)},dragend:function(c){evt_zoomslider_change(c,true)}}});_EXT_REFERENCE_MAP=new Ext.Window({width:113,height:111,border:false,closable:false,draggable:false,resizable:false,renderTo:"reference_map_panel",contentEl:"reference_map"})}catch(a){alert("Eventsmanager.init_ext_layout(): "+a)}}function init_soft_gis(){try{loading_message(true);_EXT_LAYOUT.syncSize();_EXT_LAYOUT.get("north_container").doLayout();_EXT_LAYOUT.get("center_container").doLayout();_EXT_LAYOUT.get("south_container").doLayout();_EXT_LAYOUT.doLayout();_EXT_LAYERS_PANEL.setSize(220,Ext.get(_MAP_ID).getHeight()*0.9);_EXT_LAYERS_PANEL.setPosition(Ext.get(_MAP_ID).getLeft()+5,Ext.get(_MAP_ID).getTop()+5);_MAP_WRAPPER.load_layers(true);document.onclick=evt_onclick_document;if(document.addEventListener){document.getElementById(_MAP_ID).addEventListener("mousedown",evt_event_move,false);document.getElementById(_MAP_ID).addEventListener("mousemove",process_mouse_over,false);document.getElementById(_MAP_ID).addEventListener("mouseout",process_mouse_out,false);document.getElementById(_MAP_ID).addEventListener("DOMMouseScroll",process_mouse_scroll,false);document.getElementById(_MAP_ID).addEventListener("mousewheel",process_mouse_scroll,false)}else{document.getElementById(_MAP_ID).onmousedown=evt_event_move;document.getElementById(_MAP_ID).onmousemove=process_mouse_over;document.getElementById(_MAP_ID).onmouseout=process_mouse_out;document.getElementById(_MAP_ID).onmousewheel=process_mouse_scroll}_EVENT_LISTENER=evt_event_move;if(document.removeEventListener){document.removeEventListener("keyup",process_key_pressed,false);document.removeEventListener("keydown",process_key_down,false)}else{document.onkeyup=null;if(document.attachEvent){document.releaseCapture()}}if(document.addEventListener){document.addEventListener("keyup",process_key_pressed,false);document.addEventListener("keydown",process_key_down,false)}else{if(document.attachEvent){document.attachEvent("onkeyup",process_key_pressed);document.attachEvent("onkeydown",process_key_down)}else{document.onkeyup=process_key_pressed;document.onkeydown=process_key_down}}document.getElementById(_MAP_ID).style.cursor="move"}catch(a){alert("Eventsmanager.init_soft_gis(): "+a)}}function init_map_visio(){try{init_ext_layout(true);Ext.QuickTips.init();Ext.apply(Ext.QuickTips.getQuickTip(),{showDelay:0,dismissDelay:0,hideDelay:0});var a=new Ext.Toolbar({id:"toolbar",items:[{id:"toolbar_query",iconCls:"query",scale:"medium",tooltip:"Interroga",enableToggle:true,toggleGroup:"action",allowDepress:false,handler:map_visio_toolbar_handler},"-",{id:"toolbar_pan",iconCls:"pan",scale:"medium",tooltip:"Sposta",enableToggle:true,toggleGroup:"action",pressed:true,allowDepress:false,handler:map_visio_toolbar_handler},{id:"toolbar_zoomin",iconCls:"zoomin",scale:"medium",tooltip:"Ingrandire",enableToggle:true,toggleGroup:"action",allowDepress:false,handler:map_visio_toolbar_handler},{id:"toolbar_zoomout",iconCls:"zoomout",scale:"medium",tooltip:"Diminuire",enableToggle:true,toggleGroup:"action",allowDepress:false,handler:map_visio_toolbar_handler},{id:"toolbar_zoomback",iconCls:"zoomback",scale:"medium",tooltip:"Zoom precedente",handler:map_visio_toolbar_handler},{id:"toolbar_fullextent",iconCls:"fullextent",scale:"medium",tooltip:"Centrare",handler:map_visio_toolbar_handler},"-",{id:"toolbar_planimetry",iconCls:"planimetry",scale:"medium",tooltip:"Planimetria",handler:map_visio_toolbar_handler},{id:"toolbar_measure",iconCls:"measure",scale:"medium",tooltip:"Misurare",enableToggle:true,toggleGroup:"action",allowDepress:false,handler:map_visio_toolbar_handler},{id:"toolbar_scale",iconCls:"scale",scale:"medium",tooltip:"Scala",enableToggle:true,toggleGroup:"action",allowDepress:false,handler:map_visio_toolbar_handler},{id:"toolbar_rotate",iconCls:"rotate",scale:"medium",tooltip:"Ruotare",handler:map_visio_toolbar_handler},{id:"toolbar_position",iconCls:"position",scale:"medium",tooltip:"Trova fondo",handler:map_visio_toolbar_handler},"->",{xtype:"tbtext",autoHeight:true,contentEl:_COMMUNITY_ID}]});_EXT_LAYOUT.get("north_container").add(a);init_soft_gis()}catch(b){alert("Events_Manager.init_map_visio(): "+b)}}function map_visio_toolbar_handler(a){try{switch(a.id){case"toolbar_query":document.getElementById(_MAP_ID).style.cursor="crosshair";register_mouse_down_handler(evt_event_query_parcel);break;case"toolbar_pan":document.getElementById(_MAP_ID).style.cursor="move";register_mouse_down_handler(evt_event_move);break;case"toolbar_zoomin":document.getElementById(_MAP_ID).style.cursor="crosshair";register_mouse_down_handler(evt_event_zoomin);break;case"toolbar_zoomout":document.getElementById(_MAP_ID).style.cursor="crosshair";register_mouse_down_handler(evt_event_zoomout);break;case"toolbar_zoomback":evt_but_zoomback();break;case"toolbar_fullextent":reload_map("type=map&action=recenter");break;case"toolbar_planimetry":var c=_GENERIC_GIS_UTILS.open_new_window(_URL_PLANIMETRY_URL,get_width(0.2),get_height(0.3),false,false);c._window_object.setPosition(Ext.get(_MAP_ID).getRight()-c._window_object.getWidth()-50,Ext.get(_MAP_ID).getTop()+5);c._window_object.on("close",function(){reset_extra_graphics(_ALL_DRAWING_ENGINES);generic_gis_toolbar_select_button("toolbar_pan");document.getElementById(_MAP_ID).style.cursor="move";register_mouse_down_handler(evt_event_move)});break;case"toolbar_measure":document.getElementById(_MAP_ID).style.cursor="crosshair";register_mouse_down_handler(evt_event_measure);change_system_status(new Evt_Draw_Circle(true));break;case"toolbar_scale":document.getElementById(_MAP_ID).style.cursor="pointer";register_mouse_down_handler(evt_event_zoom_to_scale);break;case"toolbar_rotate":evt_but_rotate();break;case"toolbar_position":var c=_GENERIC_GIS_UTILS.open_new_window(_UI_POSITIONER_URL+"?action=parcel_number",300,200,false,false);c._window_object.setPosition(Ext.get(_MAP_ID).getRight()-c._window_object.getWidth()-50,Ext.get(_MAP_ID).getTop()+5);break}}catch(b){alert("Eventsmanager.map_visio_toolbar_handler(button): "+b)}}function set_resize_browser_listener(){try{_EXT_LAYOUT.get("center_container").on("resize",evt_browser_resize);remove_map_loaded_event_handler(set_resize_browser_listener)}catch(a){alert("Eventsmanager.set_resize_browser_listener(): "+a)}}function evt_but_rotate(){var d=document.getElementById("input_popup");if(d!=null){clear_node(d);document.getElementById(_WINDOW_ID).removeChild(d)}var e=document.getElementById(_WINDOW_ID);var b=document.createElement("div");e.appendChild(b);b.id="input_popup";b.style.left=Ext.get(_MAP_ID).getWidth()/2+"px";b.style.top=Ext.get(_MAP_ID).getHeight()/2+"px";b.appendChild(document.createTextNode(_MSG_ANGLE+":"));var a=document.createElement("input");a.id="angle";a.className="testo_normale";b.appendChild(a);var c=document.createElement("button");c.className="button";c.appendChild(document.createTextNode("OK"));b.appendChild(c);c.onclick=function(){reload_map("type=map&action=rotate&angle="+document.getElementById("angle").value);var f=document.getElementById("input_popup");if(f!=null){clear_node(f);document.getElementById(_WINDOW_ID).removeChild(f)}}}function evt_but_reference_map(a){try{if(a.pressed){_EXT_REFERENCE_MAP.show()}else{_EXT_REFERENCE_MAP.hide()}}catch(b){alert("Eventsmanager.evt_but_reference_map(button): "+b)}}function evt_but_print(){try{change_system_status(new Idle());var c=_MAP_WRAPPER.get_current_extent();var b=_MAP_WRAPPER.convert_to_pixel(c._min_x,c._min_y,false);var a=_MAP_WRAPPER.convert_to_pixel(c._max_x,c._max_y,false);var f="&type=map&action=planimetry&paper=A4&scale=auto&min_x="+b[0]+"&min_y="+b[1]+"&max_x="+a[0]+"&max_y="+a[1];modal_loading_message(true);process_ajax_call(f,_CNTR_EVENTS_URL,function(h){try{if(!h){var g=this.responseXML;top._GENERIC_GIS_UTILS.open_new_window(g.getElementsByTagName("url")[0].firstChild.nodeValue,get_width(0.8),get_height(0.8),false,false);modal_loading_message(false)}else{modal_loading_message(false)}}catch(i){alert("process_ajax_call: "+i);modal_loading_message(false)}})}catch(d){alert("Eventsmanager.evt_but_print(): "+d);modal_loading_message(false)}}function evt_onclick_document(a){}function process_key_pressed(a){try{if(!a){a=window.event}if(a.keyCode==27){if(_ESC_KEY_LISTENER){_ESC_KEY_LISTENER.call()}}else{if(a.keyCode==13){if(_ENTER_KEY_LISTENER){_ENTER_KEY_LISTENER.call()}}else{if(a.keyCode==17){_CTRL_KEY_DOWN=false}else{if(a.keyCode==16){if(_SHIFT_KEY_LISTENER){_SHIFT_KEY_LISTENER.call()}}else{if(a.keyCode==46){if(_DELETE_KEY_LISTENER){_DELETE_KEY_LISTENER.call()}}}}}}}catch(b){alert("Eventsmanager.process_key_pressed(): "+b);return false}}function process_key_down(a){try{if(!a){a=window.event}if(a.keyCode==17){_CTRL_KEY_DOWN=true}}catch(b){alert("Eventsmanager.process_key_down(): "+b);return false}}function process_mouse_over(a){try{if(!a){a=window.event}_OP_USER.mouse_over(a)}catch(b){alert("Eventsmanager.process_mouse_over(): "+b);return false}}function process_mouse_out(a){try{if(!a){a=window.event}_OP_USER.mouse_out(a)}catch(b){alert("Eventsmanager.process_mouse_out(): "+b);return false}}function process_mouse_move(a){try{if(!a){a=window.event}_OP_USER.mouse_move(a)}catch(b){alert("Eventsmanager.process_mouse_move(): "+b);return false}}function process_mouse_up(a){try{if(!a){a=window.event}if(_OP_USER){if(document.removeEventListener){document.getElementById(_MAP_ID).removeEventListener("mousemove",process_mouse_move,false);document.getElementById(_MAP_ID).addEventListener("mousemove",process_mouse_over,false)}else{document.getElementById(_MAP_ID).onmousemove=process_mouse_over;document.getElementById(_MAP_ID).onmouseup=null;if(document.attachEvent){document.getElementById(_MAP_ID).releaseCapture()}}var b=_EXT_LAYOUT.get("north_container").get("menubar");if(b){b.cascade(function(){if(this.getXType()=="button"){this.hideMenu()}})}_OP_USER.mouse_up(a)}}catch(c){alert("Eventsmanager.process_mouse_up(): "+c);return false}}function process_mouse_down(a,c){try{if(!a){a=window.event}register_mouse_move_handler(a);_OP_USER=c;_OP_USER.mouse_down(a)}catch(b){alert("process_mouse_down(): "+b);return false}}function process_mouse_scroll(a){try{var c=0;if(!a){a=window.event}if(a.wheelDelta){c=a.wheelDelta/120}else{if(a.detail){c=-a.detail/3}}if(c>0){_TEMP_ZOOMSCROLL_FACTOR*=1.2}else{if(c<0){_TEMP_ZOOMSCROLL_FACTOR*=0.8}}_MAP_WRAPPER.resize_map_image(_TEMP_ZOOMSCROLL_FACTOR);clearTimeout(_TIMEOUT_FUNCTION);clearTimeout(_TIMEOUT_SCROLL_FUNCTION);_TIMEOUT_SCROLL_FUNCTION=window.setTimeout(function(){var d=_MAP_WRAPPER._width/2;var f=_MAP_WRAPPER._height/2;var e=_MAP_WRAPPER._scale/_TEMP_ZOOMSCROLL_FACTOR;reload_map("type=map&action=zoom_to_scale&x="+d+"&y="+f+"&scale="+e);_TEMP_ZOOMSCROLL_FACTOR=1;_TIMEOUT_SCROLL_FUNCTION=null},500);if(a.preventDefault){a.preventDefault()}a.returnValue=false}catch(b){alert("Eventsmanager.process_mouse_scroll(): "+b);return false}}function process_map_response(g,c,a,b,n,j,m,i,l,d,k){try{_MAP_WRAPPER.update_map(g,c,a,b,n,j,m,i,l,d,k)}catch(f){alert("Eventsmanager.process_map_response(): "+f)}}function evt_event_zoom_to_scale(a){process_mouse_down(a,new Zoom_To_Scale())}function evt_event_move(a){process_mouse_down(a,new Move())}function evt_event_zoomin(a){process_mouse_down(a,new Zoomin())}function evt_event_query_parcel(a){process_mouse_down(a,new Query_Parcel())}function evt_event_zoomout(a){process_mouse_down(a,new Zoomout())}function evt_event_measure(a){process_mouse_down(a,_OP_USER)}function evt_event_planimetry(a){process_mouse_down(a,new Planimetry())}function evt_create_plot(a){process_mouse_down(a,new Evt_Create_Plot())}function evt_zoomslider_change(d,h){try{_TIMEOUT_SCROLL_FUNCTION=function(){};var b=1-Math.abs(d.getValue())*0.09;if(d.getValue()>0){b=1/b}if(h){var a=_MAP_WRAPPER._width/2;var g=_MAP_WRAPPER._height/2;var c=_MAP_WRAPPER._scale/b;reload_map("type=map&action=zoom_to_scale&x="+a+"&y="+g+"&scale="+c)}else{_MAP_WRAPPER.resize_map_image(b)}}catch(f){alert("Eventsmanager.evt_zoomslider_change(): "+f)}}function evt_browser_resize(){try{var a=Ext.get(_WINDOW_ID);var c="type=map&action=resize&client_width="+a.getWidth()+"&client_height="+a.getHeight();loading_message(true);process_ajax_call(c,_CNTR_EVENTS_URL,function(d){try{if(!d){reload_map("type=map&action=load")}else{loading_message(false)}}catch(f){alert("process_ajax_call: "+f);loading_message(false)}})}catch(b){alert("Eventsmanager.evt_browser_resize(): "+b);loading_message(false)}}function evt_notify_planimetry_frame_paper_scale(g,f){var b=_MAP_WRAPPER.convert_to_geo(_MAP_WRAPPER._width/2,_MAP_WRAPPER._height/2);var d=(g=="A4"?f*7*2.54/100:f*10*2.54/100);var a=(g=="A4"?f*8*2.54/100:f*14*2.54/100);var e=false;for(var c=0;c<_LIST_OF_EXTRA_GRAPHICS.length;c++){if(_LIST_OF_EXTRA_GRAPHICS[c] instanceof Planimetry_Frame_Symbol){_LIST_OF_EXTRA_GRAPHICS[c]._width=d;_LIST_OF_EXTRA_GRAPHICS[c]._height=a;e=true;break}}if(!e){_LIST_OF_EXTRA_GRAPHICS.push(new Planimetry_Frame_Symbol(new Point(b[0],b[1]),d,a))}clear_extra_graphics(_SELECTION_DRAWING_ENGINE);draw_extra_graphics(false,_SELECTION_DRAWING_ENGINE);generic_gis_toolbar_select_button(null);document.getElementById(_MAP_ID).style.cursor="move";register_mouse_down_handler(evt_move_planimetry_frame)}function evt_move_planimetry_frame(a){process_mouse_down(a,new Evt_Move_Planimetry_Frame())}function register_mouse_down_handler(a){try{change_system_status(new Idle());if(document.removeEventListener){document.getElementById(_MAP_ID).removeEventListener("mousedown",_EVENT_LISTENER,false)}else{document.getElementById(_MAP_ID).onmousedown=null;if(document.attachEvent){document.getElementById(_MAP_ID).releaseCapture()}}_EVENT_LISTENER=a;if(document.addEventListener){document.getElementById(_MAP_ID).addEventListener("mousedown",a,false)}else{document.getElementById(_MAP_ID).onmousedown=a}}catch(b){alert("Eventsmanager.register_mouse_down_handler(): "+b)}}function register_mouse_move_handler(a){try{if(document.addEventListener){document.getElementById(_MAP_ID).addEventListener("mousemove",process_mouse_move,false);document.getElementById(_MAP_ID).addEventListener("mouseup",process_mouse_up,false)}else{document.getElementById(_MAP_ID).onmousemove=process_mouse_move;document.getElementById(_MAP_ID).onmouseup=process_mouse_up;if(document.attachEvent){document.getElementById(_MAP_ID).setCapture()}}}catch(b){alert("Eventsmanager.register_mouse_move_handler(): "+b)}}function register_mouse_up_handler(a){try{if(document.addEventListener){document.getElementById(_MAP_ID).addEventListener("mouseup",process_mouse_up,false)}else{document.getElementById(_MAP_ID).onmouseup=process_mouse_up;if(document.attachEvent){document.getElementById(_MAP_ID).setCapture()}}}catch(b){alert("Eventsmanager.register_mouse_up_handler(): "+b)}}function register_interactive_element_event_handler(a){try{clearTimeout(_TIMEOUT_FUNCTION);_INTERACTIVE_ELEMENT_LISTENER=a}catch(b){alert("Eventsmanager.register_interactive_element_event_handler(): "+b)}}function register_map_loaded_event_handler(a){try{_MAP_LOADED_LIST_OF_LISTENERS.push(a)}catch(b){alert("Eventsmanager.register_map_loaded_event_handler(): "+b)}}function remove_map_loaded_event_handler(b){try{for(var a=0;a<_MAP_LOADED_LIST_OF_LISTENERS.length;a++){if(_MAP_LOADED_LIST_OF_LISTENERS[a]===b){_MAP_LOADED_LIST_OF_LISTENERS.splice(a,1);break}}}catch(c){alert("Eventsmanager.remove_map_loaded_event_handler(): "+c)}}function remove_all_events(){try{if(document.removeEventListener){document.getElementById(_MAP_ID).removeEventListener("mousedown",_EVENT_LISTENER,false);document.getElementById(_MAP_ID).removeEventListener("mousemove",process_mouse_move,false);document.getElementById(_MAP_ID).removeEventListener("mousemove",process_mouse_over,false);document.getElementById(_MAP_ID).removeEventListener("mouseup",process_mouse_up,false)}else{document.getElementById(_MAP_ID).onmousedown=null;document.getElementById(_MAP_ID).onmousemove=null;document.getElementById(_MAP_ID).onmouseup=null;if(document.attachEvent){document.getElementById(_MAP_ID).releaseCapture()}}}catch(a){alert("Eventsmanager.remove_all_events(): "+a);return false}}function stop_propagating_event(a){try{if(a.stopPropagation){a.stopPropagation()}else{a.cancelBubble=true}if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}}catch(b){alert("Eventsmanager.stop_propagating_event() "+b);return false}}function draw_extra_graphics(d,a){init_graphics_engines(d,a);var c=null;if(a==_SELECTION_DRAWING_ENGINE){c=_jg}else{if(a==_EVENTS_DRAWING_ENGINE){c=_jg2}else{if(a==_ALL_DRAWING_ENGINES){_jg.setPrintable(false);for(var b=0;b<_LIST_OF_EXTRA_GRAPHICS.length;b++){_LIST_OF_EXTRA_GRAPHICS[b].draw(_jg)}_jg.paint();return}}}for(var b=0;b<_LIST_OF_EXTRA_GRAPHICS.length;b++){_LIST_OF_EXTRA_GRAPHICS[b].draw(c)}c.paint()}function draw_extra_graphics_object(c,b,a){init_graphics_engines(c,a);if(a==_SELECTION_DRAWING_ENGINE){_jg.setPrintable(false);b.draw(_jg);_jg.paint()}else{if(a==_EVENTS_DRAWING_ENGINE){_jg2.setPrintable(false);b.draw(_jg2);_jg2.paint()}else{if(a==_ALL_DRAWING_ENGINES){_jg2.setPrintable(false);b.draw(_jg2);_jg2.paint();_jg.setPrintable(false);b.draw(_jg);_jg.paint()}}}}function init_graphics_engines(b,a){if(b){if(a==_SELECTION_DRAWING_ENGINE){_jg=new jsGraphics(_MAP_ID)}else{if(a==_EVENTS_DRAWING_ENGINE){_jg2=new jsGraphics(_MAP_ID)}else{if(a==_ALL_DRAWING_ENGINES){_jg=new jsGraphics(_MAP_ID);_jg2=new jsGraphics(_MAP_ID)}}}}else{if(a==_SELECTION_DRAWING_ENGINE){_jg=_jg==null?new jsGraphics(_MAP_ID):_jg}else{if(a==_EVENTS_DRAWING_ENGINE){_jg2=_jg2==null?new jsGraphics(_MAP_ID):_jg2}else{if(a==_ALL_DRAWING_ENGINES){_jg=_jg==null?new jsGraphics(_MAP_ID):_jg;_jg2=_jg2==null?new jsGraphics(_MAP_ID):_jg2}}}}}function reset_extra_graphics(a){clear_points(a);clear_linepath(a);clear_lines(a);_LIST_OF_SELECTED_OBJECTS.splice(0,_LIST_OF_SELECTED_OBJECTS.length);_LIST_OF_OPERATIONS.splice(0,_LIST_OF_OPERATIONS.length);if(Ext.getCmp("toolbar_undo_draw")){Ext.getCmp("toolbar_undo_draw").setDisabled(true)}_ID_GEOMETRY=-1;if(a==_SELECTION_DRAWING_ENGINE){_jg=_jg==null?new jsGraphics(_MAP_ID):_jg;for(var b=0;b<_LIST_OF_EXTRA_GRAPHICS.length;b++){_LIST_OF_EXTRA_GRAPHICS[b].clear(_jg)}_jg.clear();_jg=null}else{if(a==_EVENTS_DRAWING_ENGINE){_jg2=_jg2==null?new jsGraphics(_MAP_ID):_jg2;for(var b=0;b<_LIST_OF_EXTRA_GRAPHICS.length;b++){_LIST_OF_EXTRA_GRAPHICS[b].clear(_jg2)}_jg2.clear();_jg2=null}else{if(a==_ALL_DRAWING_ENGINES){_jg=_jg==null?new jsGraphics(_MAP_ID):_jg;_jg2=_jg2==null?new jsGraphics(_MAP_ID):_jg2;for(var b=0;b<_LIST_OF_EXTRA_GRAPHICS.length;b++){_LIST_OF_EXTRA_GRAPHICS[b].clear(_jg);_LIST_OF_EXTRA_GRAPHICS[b].clear(_jg2)}_jg.clear();_jg=null;_jg2.clear();_jg2=null}}}_LIST_OF_EXTRA_GRAPHICS.splice(0,_LIST_OF_EXTRA_GRAPHICS.length);_LIST_OF_EXTRA_GRAPHICS.push(new Extra_Graphics())}function clear_extra_graphics(a){init_graphics_engines(false,a);if(a==_SELECTION_DRAWING_ENGINE){_jg.clear()}else{if(a==_EVENTS_DRAWING_ENGINE){_jg2.clear()}else{if(a==_ALL_DRAWING_ENGINES){_jg.clear();_jg2.clear()}}}}function remove_from_extra_graphics(b,a){for(var c=0;c<_LIST_OF_EXTRA_GRAPHICS.length;c++){if(_LIST_OF_EXTRA_GRAPHICS[c]===b){_LIST_OF_EXTRA_GRAPHICS.splice(c,1);break}}clear_extra_graphics(a)}function layer_change(a){try{if(a!=null){_MAP_WRAPPER.change_layer_status(a.value)}else{_MAP_WRAPPER.change_layer_status("")}_MAP_WRAPPER.load_layers(false)}catch(b){alert("Eventsmanager.layer_change(layer_selected): "+b)}}function reload_map(b){try{_OP_USER._map_loading=true;loading_message(true);document.getElementById("map_frame").src=_UI_MAP+"?"+b}catch(a){alert("Eventsmanager.reload_map(params): "+a);return false}}function layer_image_loaded(){try{_IMAGES_TO_LOAD--;if(_IMAGES_TO_LOAD==0){reload_map("type=map&action=load")}}catch(a){alert("Events_Manager.layer_image_loaded(): "+a)}}function change_language(a){window.location.href=window.location.href.replace(/(\?.*)/,"")+"?lang="+a}function change_system_status(a){if(_OP_USER!=null&&!_OP_USER._map_loading){clear_extra_graphics(_EVENTS_DRAWING_ENGINE)}_OP_USER=a};
