/*
 * Copyright (C) 2009  OSGIS, GisArts
 *
 * This file is part of GisArts webmapping
 *
 * GisArts webmapping is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * GisArts webmapping is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GisArts webmapping.  If not, see <http://www.gnu.org/licenses/>.
 */
OpenLayers.Util.extend(OpenLayers.Lang.nl,{'mf.information':'Info','mf.error':'Fout','mf.print.mapTitle':'Titel','mf.print.comment':'Opmerkingen','mf.print.loadingConfig':'Ophalen van de configuratie ...','mf.print.serverDown':'De print service is niet beschikbaar','mf.print.unableToPrint':"Het printen is niet mogelijk",'mf.print.generatingPDF':"Aanmaken PDF ...",'mf.print.dpi':'Resolutie (dpi)','mf.print.scale':'Schaalgetal','mf.print.rotation':'Rotatie','mf.print.print':'Print','mf.print.pdfReady':'Het PDF document is gereed.','mf.print.layout':"Layout",'gisarts.westpanel.title':"Kaartlagenbeheer en zoeken",'gisarts.toc.title':"Legenda",'gisarts.toolbar.DRAWPOINT.title':"Redlining: teken punt",'gisarts.toolbar.DRAWPOINT.text':"Teken een of meerdere punten op de kaart.",'gisarts.toolbar.DRAWLINE.title':"Redlining: teken lijn",'gisarts.toolbar.DRAWLINE.text':"Teken een of meerdere lijnen op de kaart. Sluit een lijn af middels dubbelklik.",'gisarts.toolbar.DRAWPOLYGON.title':"Redlining: teken vlak",'gisarts.toolbar.DRAWPOLYGON.text':"Teken een of meerdere vlakken op de kaart. Sluit een vlak af middels dubbelklik.",'gisarts.toolbar.CLEARREDLINING.title':"Redlining: wissen",'gisarts.toolbar.CLEARREDLINING.text':"Wis alle getekende objecten in de redlining kaartlaag.",'gisarts.toolbar.ZOOMMAX.title':"Volledig kaartbeeld",'gisarts.toolbar.ZOOMMAX.text':"Klik op deze button om naar het volledig kaartbeeld te zoomen.",'gisarts.toolbar.ZOOMIN.title':'Zoom in','gisarts.toolbar.ZOOMIN.text':'Trek een kader in kaart om in te zoomen. Ook kan er geklikt worden in de kaart waarna er met een factor 2 ingezoomd wordt.','gisarts.toolbar.ZOOMOUT.title':'Zoom uit','gisarts.toolbar.ZOOMOUT.text':'Klik in de kaart om gecentreerd op dit punt met een factor 2 uit te zoomen. Ook kan er een kader in de kaart getrokken worden, hoe kleiner dit kader hoe verder er uitgezoomd zal worden','gisarts.toolbar.PAN.title':'Verschuif kaart','gisarts.toolbar.PAN.text':'Houd de linker muisknop ingedrukt en versleep de kaart.','gisarts.toolbar.QUERY.title':'Informatie over een beschermde boom','gisarts.toolbar.QUERY.text':'Klik in de kaart op een beschermde boom voor meer informatie. Klik op de marker om de volledige foto te tonen.','gisarts.toolbar.QUERYCIRCLE.title':'Informatie','gisarts.toolbar.QUERYCIRCLE.text':'Trek een cirkel in de kaart om informatie op te vragen over objecten','gisarts.toolbar.QUERYPOLYGON.title':'Informatie','gisarts.toolbar.QUERYPOLYGON.text':'Teken een polygoon in de kaart om informatie op te vragen over objecten. Eindig met dubbel klik.','gisarts.warning.title':'Waarschuwing','gisarts.popupwarning.text':'Het popup window kon niet geopend worden, heeft u een popup blocker geinstalleerd?','gisarts.toolbar.CYCLORAMA.title':'Cyclorama','gisarts.toolbar.CYCLORAMA.text':'Toon de cyclorama foto behorende bij de foto locatie in de kaart','gisarts.toolbar.OBLIQUE.title':"Oblique luchtfoto's",'gisarts.toolbar.OBLIQUE.text':"Toon de oblique luchtfoto's van Slagboom en Peeters behorende bij de locatie in de kaart",'gisarts.toolbar.ADDGML.title':"Voeg GML bestand toe",'gisarts.toolbar.ADDGML.text':"Kopieer en plak een GML bestand in de dialoog en voeg deze toe aan de kaart",'gisarts.toolbar.MEASURELENGTH.title':'Meet afstand','gisarts.toolbar.MEASURELENGTH.text':'Meet afstand in de kaart.','gisarts.toolbar.MEASUREAREA.title':'Meet oppervlakte','gisarts.toolbar.MEASUREAREA.text':'Meet oppervlakte in de kaart.','gisarts.toolbar.PREVIOUS.title':'Vorige kaart extent','gisarts.toolbar.PREVIOUS.text':'Klik op deze button om terug te gaan naar de vorige kaart extent','gisarts.toolbar.NEXT.title':'Volgende kaart extent','gisarts.toolbar.NEXT.text':'Klik op deze button om verder te gaan naar de volgende kaart extent','gisarts.toolbar.CLIPBOARD.title':'Co&ouml;rdinaat prikker','gisarts.toolbar.CLIPBOARD.text':'Klik in de kaart en het co&oumlrdinaat paar wordt naar het klembord gekopieerd. In Internet Explorer moet u hiervoor toestemming verlenen. In andere browsers verschijnt een dialoog waarin u zelf kunt selecteren en kopi&euml;ren.','gisarts.print.tab.title':'Opties','gisarts.print.maptitle.title':"Kaart titel",'gisarts.print.maptitle.value':"Mijn kaart",'gisarts.print.comments.title':"Commentaar",'gisarts.print.comments.value':"Geen",'gisarts.toolbar.CLEARSELECTION.title':"Selectie opheffen",'gisarts.toolbar.CLEARSELECTION.text':"Hef de selectie gemaakt via de Informatie functie op",'gisarts.toolbar.PRINT.title':"Print kaart",'gisarts.toolbar.PRINT.text':"Download een PDF van de huidige kaart",'gisarts.toolbar.EXCEL.title':"Download als Excel",'gisarts.toolbar.EXCEL.text':"Download de resultaten uit het actieve tabblad naar Microsoft Excel",'gisarts.toolbar.PRINTTABLE.title':"Print tabel",'gisarts.toolbar.PRINTTABLE.text':"Print de inhoud van de tabel",'gisarts.bpfinder.title':'Toon in kaart','gisarts.bpfinder.text':'Het bijbehorende vlak wordt in de kaart getoond wanneer u zich met de muis op deze button begeeft'});if(!window.GisArts){window.GisArts={};};if(!GisArts.Control){GisArts.Control={};};GisArts.Control.FeatureInfo=OpenLayers.Class(OpenLayers.Control,{hover:false,showMarker:true,markerIcon:OpenLayers.Marker.defaultIcon(),EVENT_TYPES:['featureinfostart','featureinfoend'],callbacks:null,markerLayer:null,location:null,feature:null,numVisibleLayers:null,counter:null,handlerOptions:null,initialize:function(options){this.EVENT_TYPES=GisArts.Control.FeatureInfo.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);options=options||{};options.handlerOptions=options.handlerOptions||{};OpenLayers.Control.prototype.initialize.apply(this,[options]);if(this.hover){this.handler=new OpenLayers.Handler.Hover(this,{'move':this.cancelHover,'pause':this.getInfoForHover},OpenLayers.Util.extend(this.handlerOptions.hover||{pixelTolerance:5,delay:1000},{'delay':250}));}else{this.handler=new OpenLayers.Handler.Click(this,OpenLayers.Util.extend({click:this.click},this.callbacks),{pixelTolerance:5});}
this.markerIcon.calculateOffset=function(size){return new OpenLayers.Pixel(-(size.w/2),-(size.h)/2);};},destroy:function(){if(this.showMarker){this.markerLayer.destroy();this.markerLayer=null;if(this.feature){this.feature.destroy();}}
OpenLayers.Control.prototype.destroy.apply(this,arguments);},getInfoForHover:function(evt){this.start();this.xy=[evt.clientX,evt.clientY];this.location=this.map.getLonLatFromPixel(evt.xy);this.counter=0;this.events.triggerEvent('featureinfostart');this.numVisibleLayers=1;this.performRequest(this.layer,evt,{hover:true});},cancelHover:function(){if(this.hoverRequest){this.hoverRequest.abort();this.hoverRequest=null;}},performRequest:function(layer,evt,options){options=options||{};var url=layer.getFullRequestString({REQUEST:"GetFeatureInfo",EXCEPTIONS:"application/vnd.ogc.se_xml",BBOX:this.map.getExtent().toBBOX(),VERSION:"1.0.7",X:evt.xy.x,Y:evt.xy.y,INFO_FORMAT:'application/vnd.ogc.gml',QUERY_LAYERS:(this.queryLayersParam)?this.queryLayersParam:layer.params.LAYERS,WIDTH:this.map.size.w,HEIGHT:this.map.size.h});var response=OpenLayers.Request.GET({url:url,success:this.returnResponse,scope:{control:this,layer:layer}});if(options.hover===true){this.hoverRequest=response.priv;}},click:function(evt){var triggered=false;this.numVisibleLayers=0;var layer;if(!this.map.activeLayer){for(var i=0,len=this.map.layers.length;i<len;i++){layer=this.map.layers[i];if((layer instanceof OpenLayers.Layer.WMS)&&(layer.visibility)&&(layer.queryable)){this.numVisibleLayers++;}}}else{if(!this.map.activeLayer.queryable){this.events.triggerEvent('featureinfoend',{featurelist:null});return false;}else{this.numVisibleLayers=1;}}
this.counter=0;this.start();this.xy=evt.xy;this.location=this.map.getLonLatFromPixel(evt.xy);if(this.map.activeLayer){if(!triggered){this.events.triggerEvent('featureinfostart');triggered=true;}
this.performRequest(this.map.activeLayer,evt);}else{for(i=0,len=this.map.layers.length;i<len;i++){layer=this.map.layers[i];if(layer instanceof OpenLayers.Layer.WMS){if(layer.visibility&&layer.queryable){if(!triggered){this.events.triggerEvent('featureinfostart');triggered=true;}
this.performRequest(layer,evt);}}}}},returnResponse:function(response){this.control.counter++;this.control.info(response,this.layer);if(this.control.counter==this.control.numVisibleLayers){this.control.end();}},start:function(){this.featurelist=[];},end:function(){if(this.showMarker){var idx=-1;for(var i=0,len=this.map.layers.length;i<len;i++){var layer=this.map.layers[i];if(layer!=this.markerLayer){idx=Math.max(this.map.getLayerIndex(this.map.layers[i]),idx);}}
if(this.map.getLayerIndex(this.markerLayer)<idx){this.map.setLayerIndex(this.markerLayer,idx+1);}
this.feature=new OpenLayers.Feature(this.markerLayer,this.location,{icon:this.markerIcon});if(this.marker){this.marker.events.remove("click");this.markerLayer.removeMarker(this.marker);}
this.marker=this.feature.createMarker();this.markerLayer.clearMarkers();this.markerLayer.addMarker(this.marker);}
this.events.triggerEvent('featureinfoend',{featurelist:this.featurelist,xy:this.xy});},info:function(response,layer){var format=new OpenLayers.Format.WMSGetFeatureInfo();var features=format.read(response.responseXML||response.responseText);var obj={title:layer.name,features:features};this.featurelist.push(obj);},setMap:function(map){OpenLayers.Control.prototype.setMap.apply(this,arguments);if(this.showMarker){this.markerLayer=new OpenLayers.Layer.Markers('featureinfo',{displayInLayerSwitcher:false});this.map.addLayer(this.markerLayer);}},deactivate:function(){if(this.markerLayer){this.markerLayer.clearMarkers();}
return OpenLayers.Control.prototype.deactivate.apply(this,arguments);},CLASS_NAME:"GisArts.Control.FeatureInfo"});if(!window.GisArts){window.GisArts={};}
if(!GisArts.Control){GisArts.Control={};}
GisArts.Control.Oblique=OpenLayers.Class(GisArts.Control.FeatureInfo,{baseURL:null,popup:null,appCode:null,width:700,height:400,initialize:function(options){this.EVENT_TYPES=GisArts.Control.FeatureInfo.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,arguments);this.handler=new OpenLayers.Handler.Click(this,OpenLayers.Util.extend({click:this.click},this.callbacks));},activate:function(){return OpenLayers.Control.prototype.activate.apply(this,arguments);},removeMarker:function(){if(this.markerLayer){this.markerLayer.clearMarkers();}},deactivate:function(){this.removeMarker();return OpenLayers.Control.prototype.deactivate.apply(this,arguments);},click:function(evt){if(this.popup){this.popup.close();}
this.location=this.map.getLonLatFromPixel(evt.xy);this.end();var location=this.location.clone();location.transform(this.map.getProjectionObject(),new OpenLayers.Projection("EPSG:900913"));var url=this.baseURL+"appcode="+this.appCode+"&x="+location.lon+"&y="+location.lat+"&srid=EPSG:900913&mwidth="+this.width+"&mheight="+this.height+"&richting=NOORD&zl=9";this.popup=new Ext.Window({title:"Oblique luchtfoto's",constrain:true,width:this.width+50,height:Math.min(this.height+300,Ext.get(document.body).getHeight()-150),layout:"fit",items:[{xtype:'iframepanel',closable:false,loadmask:true,defaultSrc:url}]});this.popup.addListener('close',function(){if(this.marker){this.marker.events.remove("click");this.markerLayer.removeMarker(this.marker);}},this);this.popup.show();},CLASS_NAME:"GisArts.Control.Oblique"});OpenLayers.Format.GML.v3.prototype.readers["gml"]["curveProperty"]=function(node,obj){this.readChildNodes(node,obj);};OpenLayers.Format.GML.v3.prototype.readers["gml"]["pointArrayProperty"]=function(node,obj){this.readChildNodes(node,obj);};OpenLayers.Format.GML.v3.prototype.readers["gml"]["curveArrayProperty"]=function(node,obj){this.readChildNodes(node,obj);};OpenLayers.Format.GML.v3.prototype.readers["gml"]["surfaceProperty"]=function(node,obj){this.readChildNodes(node,obj);};OpenLayers.Format.GML.v3.prototype.readers["gml"]["surfaceArrayProperty"]=function(node,obj){this.readChildNodes(node,obj);};OpenLayers.Format.GML.v3.prototype.readers["gml"]["multiCurveProperty"]=function(node,obj){this.readChildNodes(node,obj);};OpenLayers.Format.GML.v3.prototype.readers["gml"]["multiSurfaceProperty"]=function(node,obj){this.readChildNodes(node,obj);};OpenLayers.Format.GML.v3.prototype.readers["gml"]["multiSolidProperty"]=function(node,obj){this.readChildNodes(node,obj);};OpenLayers.Format.GML.Base.prototype.readers["gml"]["pointProperty"]=function(node,obj){this.readChildNodes(node,obj);};OpenLayers.Format.GML.Base.prototype.readers["gml"]["lineStringProperty"]=function(node,obj){this.readChildNodes(node,obj);};OpenLayers.Format.GML.Base.prototype.readers["gml"]["polygonProperty"]=function(node,obj){this.readChildNodes(node,obj);};OpenLayers.Format.GML.Base.prototype.readers["gml"]["multiGeometryProperty"]=function(node,obj){this.readChildNodes(node,obj);};OpenLayers.Format.GML.Base.prototype.readers["gml"]["multiPointProperty"]=function(node,obj){this.readChildNodes(node,obj);};OpenLayers.Format.GML.Base.prototype.regExes={trimSpace:(/^\s*|\s*$/g),removeSpace:(/\s*/g),splitSpace:(/\s+/),trimComma:(/\s*,\s*/g),featureMember:(/^(.*:)?featureMembers?$/)};OpenLayers.Format.GML.Base.prototype.readNode=function(node,obj,first){if(first===true&&this.autoConfig===true){this.featureType=null;delete this.namespaceAlias[this.featureNS];delete this.namespaces["feature"];this.featureNS=null;}
if(!this.featureNS&&(!(node.prefix in this.namespaces)&&node.parentNode.namespaceURI==this.namespaces["gml"]&&this.regExes.featureMember.test(node.parentNode.nodeName))){this.featureType=node.nodeName.split(":").pop();this.setNamespace("feature",node.namespaceURI);this.featureNS=node.namespaceURI;this.autoConfig=true;}
return OpenLayers.Format.XML.prototype.readNode.apply(this,[node,obj]);};mapfish.PrintProtocol.SUPPORTED_TYPES['OpenLayers.Layer.Vector']=function(olLayer){if(!(olLayer.name&&olLayer.name.indexOf('OpenLayers.Handler')===0)){return mapfish.PrintProtocol.prototype.convertVectorLayer.apply(this,arguments);}};mapfish.widgets.LayerTree.prototype._updateCheckboxAncestors=function(){var unvisitedNodeIds={};var tree=this;function updateNodeCheckbox(node){if(!tree.hasCheckbox(node)){throw new Error(arguments.callee.name+" should only be called on checkbox nodes");}
var checkboxChildren=[];node.eachChild(function(child){if(tree.hasCheckbox(child))
checkboxChildren.push(child);},this);if(checkboxChildren.length==0){return node.attributes.checked;}
var atleastOneChecked=false;Ext.each(checkboxChildren,function(child){if(updateNodeCheckbox(child)){atleastOneChecked=true;}},this);tree.setNodeChecked(node,atleastOneChecked,false);delete unvisitedNodeIds[node.id];return atleastOneChecked;}
var checkboxNodes=[];this.getRootNode().cascade(function(node){if(this.hasCheckbox(node)){checkboxNodes.push(node);unvisitedNodeIds[node.id]=true;}},this);var node;while(node=checkboxNodes.shift()){if(unvisitedNodeIds[node.id])
updateNodeCheckbox(node);}};mapfish.widgets.print.BaseWidget.prototype.addLegends=function(spec){var legends=spec.legends=[];function addLayer(layerNode){var layerInfo={name:layerNode.attributes.printText||layerNode.attributes.text,icon:mapfish.Util.relativeToAbsoluteURL(layerNode.attributes.icon)};var classesInfo=layerInfo.classes=[];layerNode.eachChild(function(classNode){if(classNode.attributes.checked!==false){classesInfo.push({name:classNode.attributes.printText||classNode.attributes.text,icon:mapfish.Util.relativeToAbsoluteURL(classNode.attributes.icon)});}},this);if(layerInfo.classes.length>=1&&layerInfo.classes[0].icon==null){for(var i=0,ii=classesInfo.length;i<ii;++i){var c=classesInfo[i];var node=layerNode.findChild('text',c.name);var newLayerInfo={name:node.attributes.printText||node.attributes.text,icon:mapfish.Util.relativeToAbsoluteURL(node.attributes.icon),classes:[]};node.eachChild(function(n){if(n.attributes.checked!==false){newLayerInfo.classes.push({name:n.attributes.printText||n.attributes.text,icon:mapfish.Util.relativeToAbsoluteURL(n.attributes.icon)});}});legends.push(newLayerInfo);}}else{legends.push(layerInfo);}}
function hasVisibleChildren(node){var result=false;node.eachChild(function(child){if(child.attributes.checked===true||(child.attributes.checked===undefined&&node.attributes.checked===true)){result=true;}},this);return result;}
function goDeep(root){root.eachChild(function(node){var attr=node.attributes;if(hasVisibleChildren(node)&&!attr.hidden&&attr.printText!==''){addLayer(node);}else{goDeep(node);}},this);}
goDeep(this.layerTree.getRootNode());if(legends.length==0){delete spec.legends;}};Ext.namespace('GisArts','GisArts.Util');GisArts.Util.zoomToMaxExtent=function(map){var args=OpenLayers.Util.getParameters(window.location.href);var hash=window.location.hash;if(args.bbox){map.zoomToExtent(OpenLayers.Bounds.fromArray(args.bbox));}else if(hash&&hash.indexOf('zoom=')!=-1){}else{map.zoomToMaxExtent();}};GisArts.Util.clearSelection=function(keepCosmeticLayer){if(keepCosmeticLayer!==true){var controls=GisArts.app.map.getControlsByClass('GisArts.Control.GetFeature');Ext.each(controls,function(control){control.clearCosmeticLayer();});}
var hover=GisArts.app.hover;if(hover){hover.removeFeatures(hover.features);}
Ext.each(GisArts.tabPanelItems,function(grid){var cmp=Ext.getCmp(grid.id);if(cmp&&cmp.store){cmp.store.removeAll();}});};GisArts.Util.beforeFeatureSelected=function(e){GisArts.Util.clearSelection();};GisArts.Util.featureSelected=function(e){if(!e.features||e.features.length===0){var featuretype=e.typeName;var store=new GeoExt.data.FeatureStore({features:[],fields:GisArts.storeFields[featuretype]});var id='grid_'+featuretype;var cmp=Ext.getCmp(id);if(cmp&&cmp.store){cmp.store.each(function(rec){if(rec.get('feature')){rec.get('feature').destroy();}});cmp.reconfigure(store,GisArts.colModel[featuretype]);}
return;}
if(GisArts.app.hover===null){GisArts.app.hover=new OpenLayers.Layer.Vector("Hover");GisArts.app.map.addLayer(GisArts.app.hover);}
var hover=GisArts.app.hover;hover.addFeatures(e.features);var features={};for(var i=0,len=e.features.length;i<len;i++){var feature=e.features[i];if(!features[feature.type]){features[feature.type]=[];}
features[feature.type].push(feature);}
for(var featuretype in features){var store=new GeoExt.data.FeatureStore({features:features[featuretype],fields:GisArts.storeFields[featuretype]});var id='grid_'+featuretype;var cmp=Ext.getCmp(id);if(cmp&&cmp.store){cmp.store.each(function(rec){if(rec.get('feature')){rec.get('feature').destroy();}});cmp.reconfigure(store,GisArts.colModel[featuretype]);}}};GisArts.Util.saveAsExcel=function(){var grid=Ext.getCmp('gridtab').getActiveTab();if(grid&&grid.store&&grid.store.getCount()>0){var store=grid.store;var downloadform=document.getElementById("download");var jsonData="[";store.each(function(rec){jsonData+=Ext.util.JSON.encode(rec.data.feature.data)+",";});jsonData=jsonData.substring(0,jsonData.length-1)+"]";downloadform.stream.value=jsonData;downloadform.submit();}};GisArts.Util.printTable=function(){var grid=Ext.getCmp('gridtab').getActiveTab();if(grid&&grid instanceof Ext.ux.ManagedIframePanel){var win=window.open(grid.iframe.src,'print');win.print();win.close();}
if(grid&&grid.store&&grid.store.getCount()>0){Ext.ux.GridPrinter.stylesheetPath=GisArts.printCSSPath;Ext.ux.GridPrinter.print(grid);}};GisArts.Util.setToolbarContent=function(toolbar,map,options,featureinfo,featureinfo_circle,featureinfo_polygon){if(options.ZOOMMAX){toolbar.addControl(new OpenLayers.Control.ZoomToMaxExtent({map:map}),{tooltip:{title:OpenLayers.i18n('gisarts.toolbar.ZOOMMAX.title'),text:OpenLayers.i18n('gisarts.toolbar.ZOOMMAX.text')},iconCls:'zoomfull',toggleGroup:'map'});}
if(options.ZOOMIN){toolbar.addControl(new OpenLayers.Control.ZoomBox(),{tooltip:{title:OpenLayers.i18n('gisarts.toolbar.ZOOMIN.title'),text:OpenLayers.i18n('gisarts.toolbar.ZOOMIN.text')},iconCls:'zoomin',toggleGroup:'map'});}
if(options.ZOOMOUT){toolbar.addControl(new OpenLayers.Control.ZoomBox({out:true}),{tooltip:{title:OpenLayers.i18n('gisarts.toolbar.ZOOMOUT.title'),text:OpenLayers.i18n('gisarts.toolbar.ZOOMOUT.text')},iconCls:'zoomout',toggleGroup:'map'});}
if(options.PAN){toolbar.addControl(new OpenLayers.Control.DragPan({isDefault:true}),{tooltip:{title:OpenLayers.i18n('gisarts.toolbar.PAN.title'),text:OpenLayers.i18n('gisarts.toolbar.PAN.text')},iconCls:'pan',toggleGroup:'map'});}
GisArts.Util.addSeparator(toolbar);var enableQuery=function(){this.setDisabled(GisArts.app.map.getScale()>GisArts.queryScale);};if(options.QUERY){var btn=toolbar.addControl(featureinfo,{toggleGroup:'map',iconCls:'query',tooltip:{title:OpenLayers.i18n('gisarts.toolbar.QUERY.title'),text:OpenLayers.i18n('gisarts.toolbar.QUERY.text')}});enableQuery.createDelegate(btn)();map.events.register("zoomend",btn,enableQuery);}
if(options.QUERYCIRCLE){var btn=toolbar.addControl(featureinfo_circle,{toggleGroup:'map',iconCls:'querycircle',tooltip:{title:OpenLayers.i18n('gisarts.toolbar.QUERYCIRCLE.title'),text:OpenLayers.i18n('gisarts.toolbar.QUERYCIRCLE.text')}});enableQuery.createDelegate(btn)();map.events.register("zoomend",btn,enableQuery);}
if(options.QUERYPOLYGON){var btn=toolbar.addControl(featureinfo_polygon,{toggleGroup:'map',iconCls:'querypolygon',tooltip:{title:OpenLayers.i18n('gisarts.toolbar.QUERYPOLYGON.title'),text:OpenLayers.i18n('gisarts.toolbar.QUERYPOLYGON.text')}});enableQuery.createDelegate(btn)();map.events.register("zoomend",btn,enableQuery);}
if((options.QUERY||options.QUERYCIRCLE||options.QUERYPOLYGON)&&options.NOCLEARSELECTION!==true){var clear=new Ext.Toolbar.Button({iconCls:'clearselection',tooltip:{title:OpenLayers.i18n('gisarts.toolbar.CLEARSELECTION.title'),text:OpenLayers.i18n('gisarts.toolbar.CLEARSELECTION.text')},handler:GisArts.Util.clearSelection});toolbar.add(clear);}
GisArts.Util.addSeparator(toolbar);if(options.CYCLORAMA||options.CYCLOSCOPE){var cyclorama=null;if(options.CYCLORAMA){cyclorama=new GisArts.Control.Cyclorama({layer:GisArts.CycloramaLayer,imageField:GisArts.CycloramaImageField,baseURL:GisArts.CycloScopeLiteURL});}
if(options.CYCLOSCOPE){cyclorama=new GisArts.Control.CycloScope({layer:GisArts.CycloramaLayer,imageField:GisArts.CycloramaImageField});}
cyclorama.events.on({'featureinfostart':GisArts.featureInfoStart});cyclorama.events.on({'featureinfoend':function(evt){OpenLayers.Element.removeClass(GisArts.app.map.viewPortDiv,"olCursorWait");}});toolbar.addControl(cyclorama,{toggleGroup:'map',iconCls:'cyclo',tooltip:{title:OpenLayers.i18n('gisarts.toolbar.CYCLORAMA.title'),text:OpenLayers.i18n('gisarts.toolbar.CYCLORAMA.text')}});}
if(options.OBLIQUE){var oblique=new GisArts.Control.Oblique({baseURL:GisArts.SlagboomEnPetersURL,appCode:GisArts.AppCode});toolbar.addControl(oblique,{toggleGroup:'map',iconCls:'oblique',tooltip:{title:OpenLayers.i18n('gisarts.toolbar.OBLIQUE.title'),text:OpenLayers.i18n('gisarts.toolbar.OBLIQUE.text')}});}
GisArts.Util.addSeparator(toolbar);var measureOptions;if(options.MEASURELENGTH||options.MEASUREAREA){measureOptions={immediate:true,eventListeners:{'measure':GisArts.Util.handleMeasurement,'measurepartial':GisArts.Util.handleMeasurement,'deactivate':GisArts.Util.clearMeasurement},handlerOptions:{style:"default",layerOptions:{styleMap:GisArts.MeasureStyleMap},persist:true}};}
if(options.MEASURELENGTH){toolbar.addControl(new OpenLayers.Control.Measure(OpenLayers.Handler.Path,OpenLayers.Util.extend(measureOptions,{displayClass:'olControlMeasureLength'})),{tooltip:{title:OpenLayers.i18n('gisarts.toolbar.MEASURELENGTH.title'),text:OpenLayers.i18n('gisarts.toolbar.MEASURELENGTH.text')},iconCls:'measure',toggleGroup:'map'});}
if(options.MEASUREAREA){toolbar.addControl(new OpenLayers.Control.Measure(OpenLayers.Handler.Polygon,OpenLayers.Util.extend(measureOptions,{displayClass:'olControlMeasureArea'})),{tooltip:{title:OpenLayers.i18n('gisarts.toolbar.MEASUREAREA.title'),text:OpenLayers.i18n('gisarts.toolbar.MEASUREAREA.text')},iconCls:'measurearea',toggleGroup:'map'});}
GisArts.Util.addSeparator(toolbar);if(options.NAVHISTORY){var nav=new OpenLayers.Control.NavigationHistory();map.addControl(nav);nav.activate();var buttonPrevious=new Ext.Toolbar.Button({iconCls:'back',tooltip:{title:OpenLayers.i18n('gisarts.toolbar.PREVIOUS.title'),text:OpenLayers.i18n('gisarts.toolbar.PREVIOUS.text')},disabled:true,handler:nav.previous.trigger});var buttonNext=new Ext.Toolbar.Button({iconCls:'next',tooltip:{title:OpenLayers.i18n('gisarts.toolbar.NEXT.title'),text:OpenLayers.i18n('gisarts.toolbar.NEXT.text')},disabled:true,handler:nav.next.trigger});toolbar.add(buttonPrevious);toolbar.add(buttonNext);nav.previous.events.register("activate",buttonPrevious,function(){this.setDisabled(false);});nav.previous.events.register("deactivate",buttonPrevious,function(){this.setDisabled(true);});nav.next.events.register("activate",buttonNext,function(){this.setDisabled(false);});}
GisArts.Util.addSeparator(toolbar);if(options.PRINT){toolbar.add({iconCls:'print',tooltip:{title:OpenLayers.i18n('gisarts.toolbar.PRINT.title'),text:OpenLayers.i18n('gisarts.toolbar.PRINT.text')},handler:function(){var overrides={};if(GisArts.PrintMapFileParameter!==undefined){for(var i=0,len=map.layers.length;i<len;i++){var layer=map.layers[i];if(layer instanceof OpenLayers.Layer.WMS){overrides[layer.name]={customParams:{'MAP':GisArts.PrintMapFileParameter}};}}}
var wh=new Ext.Window({title:OpenLayers.i18n('mf.print.print'),width:400,height:200,items:[{xtype:'print-simple',map:map,layerTree:Ext.getCmp('tree'),wantResetButton:false,configUrl:GisArts.PrintServer,overrides:overrides,title:OpenLayers.i18n('gisarts.print.tab.title'),formConfig:{height:150,bodyStyle:'padding: 10px 10px 10px 10px;',items:[{xtype:'textfield',fieldLabel:OpenLayers.i18n('gisarts.print.maptitle.title'),name:'mapTitle',value:OpenLayers.i18n('gisarts.print.maptitle.value')},{xtype:'hidden',name:'gemnaam',value:GisArts.app.gemeente},{xtype:'hidden',name:'logoURL',value:GisArts.app.logoURL}]}}]});wh.show();}});}
if(options.REDLINING){GisArts.Util.addSeparator(toolbar);var redlining=new OpenLayers.Layer.Vector(null,{displayInLayerSwitcher:false,styleMap:new OpenLayers.StyleMap({'default':{strokeColor:"#00008B",strokeOpacity:1,strokeWidth:3,fillColor:"#FF5500",fillOpacity:0.5,pointRadius:6}})});map.addLayer(redlining);toolbar.addControl(new OpenLayers.Control.DrawFeature(redlining,OpenLayers.Handler.Point),{tooltip:{title:OpenLayers.i18n('gisarts.toolbar.DRAWPOINT.title'),text:OpenLayers.i18n('gisarts.toolbar.DRAWPOINT.text')},toggleGroup:'map',iconCls:'drawpoint'});toolbar.addControl(new OpenLayers.Control.DrawFeature(redlining,OpenLayers.Handler.Path),{tooltip:{title:OpenLayers.i18n('gisarts.toolbar.DRAWLINE.title'),text:OpenLayers.i18n('gisarts.toolbar.DRAWLINE.text')},toggleGroup:'map',iconCls:'drawline'});toolbar.addControl(new OpenLayers.Control.DrawFeature(redlining,OpenLayers.Handler.Polygon),{toggleGroup:'map',tooltip:{title:OpenLayers.i18n('gisarts.toolbar.DRAWPOLYGON.title'),text:OpenLayers.i18n('gisarts.toolbar.DRAWPOLYGON.text')},iconCls:'drawpolygon'});toolbar.add({iconCls:'clearredlining',tooltip:{title:OpenLayers.i18n('gisarts.toolbar.CLEARREDLINING.title'),text:OpenLayers.i18n('gisarts.toolbar.CLEARREDLINING.text')},handler:function(){redlining.removeFeatures(redlining.features);}});}
GisArts.Util.addSeparator(toolbar);if(options.CLIPBOARD!==false){var click=OpenLayers.Class(OpenLayers.Control,{initialize:function(options){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.handler=new OpenLayers.Handler.Click(this,{'click':this.trigger});},trigger:function(e){var lonlat=map.getLonLatFromViewPortPx(e.xy);var text=lonlat.lon+", "+lonlat.lat;var success=window.clipboardData&&window.clipboardData.setData('Text',text);if(!success){Ext.Msg.show({title:"Co&ouml;rdinaat prikker",msg:text});}}});toolbar.addControl(new click(),{toggleGroup:'map',tooltip:{title:OpenLayers.i18n('gisarts.toolbar.CLIPBOARD.title'),text:OpenLayers.i18n('gisarts.toolbar.CLIPBOARD.text')},iconCls:'clipboard'});}
if(options.ADDGML===true){toolbar.add({iconCls:'addgml',tooltip:{title:OpenLayers.i18n('gisarts.toolbar.ADDGML.title'),text:OpenLayers.i18n('gisarts.toolbar.ADDGML.text')},handler:function(){new Ext.Window({title:"Voeg GML bestand toe",width:400,height:400,layout:"fit",items:[{xtype:'form',hideLabels:true,items:[{xtype:'textarea',height:300,autoScroll:true,id:'gisarts-gml',width:350}]}],bbar:[{text:'Voeg toe',handler:function(){var gml=Ext.getCmp('gisarts-gml').getValue();var format=new OpenLayers.Format.GML.v3({autoConfig:true});var features=format.read(gml);if(GisArts.app.gmlLayer===undefined){GisArts.app.gmlLayer=new OpenLayers.Layer.Vector("ADDGML");GisArts.app.map.addLayer(GisArts.app.gmlLayer);}
GisArts.app.gmlLayer.addFeatures(features);}},{text:'Zoom',handler:function(){GisArts.app.gmlLayer&&GisArts.app.map.zoomToExtent(GisArts.app.gmlLayer.getDataExtent());}},{text:'Wissen',handler:function(){GisArts.app.gmlLayer&&GisArts.app.gmlLayer.destroyFeatures();}}]}).show();}});}};GisArts.Util.createViewport=function(options){return new Ext.Viewport({layout:'border',items:[new Ext.BoxComponent({region:'north',el:'north',height:60}),{region:'center',layout:'border',items:[{region:'west',title:OpenLayers.i18n("gisarts.westpanel.title"),width:(options.westPanelWidth)?options.westPanelWidth:250,border:true,margins:'5 0 0 5',frame:false,split:true,layout:'fit',collapsible:true,items:[{xtype:'tabpanel',activeTab:0,items:[{xtype:'gisartslayertree',id:'tree',map:options.map,model:options.model,border:false,title:OpenLayers.i18n('gisarts.toc.title'),bodyStyle:'padding:10px;'}].concat(GisArts.createSearchOptions(options.map))}]},{region:'center',layout:'border',frame:false,border:true,margins:'5 5 0 0',items:[{region:'center',xtype:'gx_mappanel',items:[{xtype:"gx_zoomslider",vertical:true,height:100,x:10,y:20}],map:options.map,tbar:options.toolbar,border:false},{xtype:'tabpanel',tbar:new Ext.Toolbar({items:[{iconCls:"excel",tooltip:{title:OpenLayers.i18n('gisarts.toolbar.EXCEL.title'),text:OpenLayers.i18n('gisarts.toolbar.EXCEL.text')},handler:GisArts.Util.saveAsExcel},{iconCls:'print',tooltip:{title:OpenLayers.i18n('gisarts.toolbar.PRINTTABLE.title'),text:OpenLayers.i18n('gisarts.toolbar.PRINTTABLE.text')},handler:GisArts.Util.printTable}]}),defaults:{height:80},hidden:GisArts.hideTabPanel||false,deferredRender:false,split:true,collapsible:true,activeTab:0,region:'south',id:'gridtab',autoScroll:true,items:GisArts.tabPanelItems}]}]},{region:'south',id:'statusBar',border:false,height:25,margins:'5 0 0 0',xtype:'panel',layout:'column',items:[{border:false,columnWidth:0.2,xtype:'panel',html:'&nbsp;'},{border:false,layout:'form',labelWidth:25,columnWidth:0.19,items:[{xtype:'field',fieldLabel:'X',name:'mousex-field',id:'mousex-field'}]},{border:false,layout:'form',labelWidth:25,columnWidth:0.19,items:[{xtype:'field',fieldLabel:'Y',name:'mousey-field',id:'mousey-field'}]},{border:false,layout:'form',labelWidth:75,columnWidth:0.19,items:[{xtype:'field',fieldLabel:'Meetwaarde',name:'distance',id:'distance'}]},{border:false,layout:'form',labelWidth:50,columnWidth:0.19,items:[{xtype:'gisartsscalefield',map:options.map,fieldLabel:'Schaal',name:'scale',id:'scale'}]}]}]});};GisArts.Util.createWmsLayer=function(map,name,url,params,options){var layer=new OpenLayers.Layer.WMS(name,url,params,options);map.addLayer(layer);return layer;};GisArts.Util.createDummyBaseLayer=function(map,bounds){var graphic=new OpenLayers.Layer.Image('Dummy','../../shared/lib/openlayers/img/blank.gif',bounds,map.getSize(),{isBaseLayer:true,displayInLayerSwitcher:false});map.addLayer(graphic);};GisArts.Util.addDefaultMapControls=function(map){map.addControl(new GisArts.Control.Permalink({anchor:true}));map.addControl(new GisArts.Control.ZoomWheel());map.addControl(new OpenLayers.Control.LoadingPanel());map.addControl(new OpenLayers.Control.ScaleBar());map.addControl(new GisArts.Control.CursorPos({xelement:Ext.get('mousex-field').dom,yelement:Ext.get('mousey-field').dom}));};GisArts.Util.createToolbar=function(map){var toolbar=new mapfish.widgets.toolbar.Toolbar({map:map,configurable:false});toolbar.autoHeight=false;toolbar.height=25;return toolbar;};GisArts.Util.addSeparator=function(toolbar){toolbar.add(new Ext.Toolbar.Spacer());toolbar.add(new Ext.Toolbar.Separator());toolbar.add(new Ext.Toolbar.Spacer());};GisArts.Util.createMap=function(divId,maxExtent){var options={projection:"EPSG:28992",fractionalZoom:true,units:'m',maxExtent:maxExtent,scales:[10000001,5000001,2000001,1500001,1000001,750001,500001,375001,250001,100001,50001,25001,10001,5001,2501,1001,501,101,1],controls:[]};var map=new OpenLayers.Map(divId,options);GisArts.app.map=map;return map;};GisArts.Util.handleMeasurement=function(event){var geometry=event.geometry;var units=event.units;var order=event.order;var measure=event.measure;var out="";if(order===1){var dec=(event.measure>100)?0:2;out+=measure.toFixed(dec)+" "+units;}else{out+=measure.toFixed(2)+" "+units+"2";}
Ext.getCmp('distance').setValue(out);};GisArts.Util.clearMeasurement=function(){Ext.getCmp('distance').setValue('');};GisArts.MeasureSketchSymbolizers={"Point":{pointRadius:0,graphicName:"square",fillColor:"white",fillOpacity:1,strokeWidth:1,strokeOpacity:1,strokeColor:"#333333"},"Line":{strokeWidth:3,strokeOpacity:1,strokeColor:"#CD0074",strokeDashstyle:"solid"},"Polygon":{strokeWidth:2,strokeOpacity:1,strokeColor:"#666666",fillColor:"white",fillOpacity:0.3}};GisArts.MeasureStyle=new OpenLayers.Style();GisArts.MeasureStyle.addRules([new OpenLayers.Rule({symbolizer:GisArts.MeasureSketchSymbolizers})]);GisArts.MeasureStyleMap=new OpenLayers.StyleMap({"default":GisArts.MeasureStyle});Ext.override(Ext.data.Store,{sortByFields:function(fields){var st=[];for(var i=0;i<fields.length;i++){if(typeof fields[i]=='string'){fields[i]={field:fields[i],direction:'ASC'};}
st.push(this.fields.get(fields[i].field).sortType);}
var isInteger=function(value){return!isNaN(parseInt(value));};var fn=function(r1,r2){var result;for(var i=0;!result&&i<fields.length;i++){var v1=st[i](r1.data[fields[i].field]);var v2=st[i](r2.data[fields[i].field]);if(isInteger(v1)===true){result=(parseInt(v1)>parseInt(v2))?1:((parseInt(v1)<parseInt(v2))?-1:0);if(result===0){result=(v1>v2)?1:((v1<v2)?-1:0);}}else{result=(v1>v2)?1:((v1<v2)?-1:0);}
if(fields[i].direction=='DESC')result=-result;}
return result;};this.data.sort('ASC',fn);if(this.snapshot&&this.snapshot!=this.data){this.snapshot.sort('ASC',fn);}
this.fireEvent("datachanged",this);}});Ext.namespace('GisArts','GisArts.form');GisArts.form.SearchOption=function(config){config.maxFeatures=1000;Ext.apply(this,config);GisArts.form.SearchOption.superclass.constructor.call(this);};Ext.extend(GisArts.form.SearchOption,Ext.FormPanel,{autoScroll:true,outputFormat:{type:'GeoJSON',mimetype:'json'},requestMethod:"GET",projection:'EPSG:28992',url:'',typename:'',title:'',buttonAlign:'right',searchfields:[],maxFeatures:250,initComponent:function(){GisArts.form.SearchOption.superclass.initComponent.call(this);Ext.each(this.searchfields,function(searchfield){if(searchfield.type=='PROPERTYISLIKE'){var field=new Ext.form.TextField({fieldLabel:searchfield.label,name:searchfield.propertyname,autoHeight:true,autoWidth:true});field.on('specialkey',function(f,e){if(e.getKey()==e.ENTER){this.submitWFSForm();}},this);this.add(field);}},this);this.addButton({text:'Zoeken',scope:this,handler:this.submitForm});},submitForm:function(btn){if(this.outputFormat.type=='GeoJSON'||this.outputFormat.type=='GML2'){this.submitWFSForm();}},onDestroy:function(){if(this.resultStore){this.resultStore.each(function(record){if(record&&record.get('feature')){record.get('feature').destroy();}},this);}},submitWFSForm:function(){var form=document.getElementById(this.form.id);var filter='<ogc:Filter>';if(form.elements.length>1){filter+='<ogc:And>';}
var wildcard='*';for(var i=0;i<form.elements.length;i++){el=form.elements[i];filter+='<ogc:PropertyIsLike matchCase="false" wildcard="'+wildcard+'" singleChar="#" '+'escape="!"><ogc:PropertyName>'+el.name+'</ogc:PropertyName>'+'<ogc:Literal>'+wildcard+el.value+wildcard+'</ogc:Literal>'+'</ogc:PropertyIsLike>';}
if(form.elements.length>1){filter+='</ogc:And>';}
filter+='</ogc:Filter>';var reqBody=undefined;var url=this.url;if(this.requestMethod!='POST'){url=this.url+Ext.urlEncode({filter:filter,typename:this.typename,service:'WFS',request:'GetFeature',version:'1.0.0',outputformat:this.outputFormat.mimetype,maxfeatures:this.maxFeatures});}
else
{reqBody='<GetFeature version="1.0.0" service="WFS" outputFormat="'+
this.outputFormat.mimetype+'" maxFeatures="'+this.maxFeatures+'">'+'<Query typeName="'+this.typename+'">';reqBody+=filter;reqBody+="</Query></GetFeature>";}
if(this.externalProxyUrl){url=this.externalProxyUrl+escape(url);}
var propNames=[];for(var j=0;j<this.form.items.items.length;j++){propNames.push(this.form.items.items[j].name);}
if(this.resultStore){this.resultStore.each(function(record){if(record&&record.get('feature')){record.get('feature').destroy();}},this);}
this.resultStore=new GisArts.data.WFSStore({url:(OpenLayers.ProxyHost?OpenLayers.ProxyHost+escape(url):url),autoLoad:true,xmlData:reqBody,propertyName:propNames,outputFormat:this.outputFormat.type,id:'value',fields:GisArts.storeFields[this.typename]});this.resultStore.on("beforeload",function(){var item=this.resultsGrid.getBottomToolbar().items.get(0);if(Ext.versionDetail&&Ext.versionDetail.major>=3){item.setText('');}else{item.el.innerHTML='';}},this);this.resultStore.on("beforeload",this.onWaitStart,this);this.resultStore.on("load",this.onWaitStop,this);this.resultStore.on("load",function(store){var txt=store.getCount()+' resultaten';var item=this.resultsGrid.getBottomToolbar().items.get(0);if(Ext.versionDetail&&Ext.versionDetail.major>=3){item.setText(txt);}else{item.el.innerHTML=txt;}
store.sortByFields(propNames);},this);this.resultStore.on("loadexception",this.onWaitStop,this);this.showResult(this.resultStore);},onWaitStart:function()
{},onWaitStop:function()
{},loadException:function(proxy,o,response,excp){this.onWaitStop();var responseText=response.responseText;if(responseText&&(responseText.indexOf('FAILED')!=-1||responseText.indexOf('Exception')!=-1||responseText.indexOf('No more credits')!=-1)){Ext.MessageBox.show({icon:Ext.MessageBox.WARNING,title:OpenLayers.i18n("errorTitle"),msg:OpenLayers.i18n("SearchOptionLoadFailureMsg"),buttons:Ext.MessageBox.OK});}},showResult:function(resultStore){if(!this.resultsGrid){this.resultsGrid=new Ext.grid.GridPanel({store:new GeoExt.data.FeatureStore({features:[],fields:GisArts.storeFields[this.typename]}),loadMask:true,stripeRows:true,autoScroll:true,monitorResize:true,viewConfig:{forceFit:true},bbar:new Ext.Toolbar({height:25,items:[{xtype:'tbtext',text:''}]}),colModel:GisArts.colModel[this.typename+'_search']||GisArts.colModel[this.typename],height:Math.max(150,this.body.getHeight()-(this.searchfields.length*25+25)),width:275});this.add(this.resultsGrid);this.doLayout();}
this.resultsGrid.getSelectionModel().clearSelections();this.resultsGrid.getSelectionModel().on('selectionchange',function(selModel){this.zoomToResults();},this);var oldStore=this.resultsGrid.store;this.resultsGrid.reconfigure(resultStore,this.resultsGrid.getColumnModel());oldStore.destroy();},zoomToResults:function(){var selRecords=this.resultsGrid.getSelectionModel().getSelections();if(selRecords.length>0){if(!this.vectorLayer){this.vectorLayer=new OpenLayers.Layer.Vector("Hover");GisArts.app.hover=this.vectorLayer;this.map.addLayer(this.vectorLayer);}
if(this.vectorFeatures){this.vectorLayer.removeFeatures(this.vectorFeatures);}
this.vectorFeatures=selRecords[0].get('feature');this.vectorLayer.addFeatures(this.vectorFeatures);var feature=selRecords[0].get('feature');var buffer;if(feature.geometry instanceof OpenLayers.Geometry.Point){buffer=50;}else{buffer=5;}
var bbox=feature.geometry.getBounds().clone();bbox.left=bbox.left-buffer;bbox.bottom=bbox.bottom-buffer;bbox.right=bbox.right+buffer;bbox.top=bbox.top+buffer;this.map.zoomToExtent(bbox);var controls=this.map.controls;for(var i=0,len=controls.length;i<len;i++){var control=controls[i];if((control instanceof GisArts.Control.GetFeature)&&control.circle===false&&control.polygon===false){var size=this.map.getSize();control.selectSingle({xy:new OpenLayers.Pixel(size.w/2,size.h/2)});}}}},addPointForGazResult:function(){var selRecords=this.resultsGrid.getSelectionModel().getSelections();if(selRecords.length>0){for(i=0;i<selRecords.length;i++){var resultsLayer=new OpenLayers.Layer.Vector(selRecords[i].get('text'),{isBaseLayer:false,displayInLayerSwitcher:true});var point=new OpenLayers.Geometry.Point(selRecords[i].get('bbox').getCenterLonLat().lon,selRecords[i].get('bbox').getCenterLonLat().lat);var feature=new OpenLayers.Feature.Vector(point,null);this.map.addLayer(resultsLayer);resultsLayer.addFeatures([feature]);}}else{Ext.MessageBox.show({icon:Ext.MessageBox.WARNING,title:OpenLayers.i18n("searchOptionNoResultsTitle"),msg:OpenLayers.i18n("searchOptionNoResultsMsg"),buttons:Ext.MessageBox.OK});}},recenter:function(obj,record){var bounds=record.get('bbox');if(this.map.getProjection()!=this.projection){bounds=bounds.transform(new OpenLayers.Projection(this.projection),this.map.getProjectionObject());}
this.map.zoomToExtent(bounds);}});Ext.reg('searchoption',GisArts.form.SearchOption);Ext.namespace('GisArts','GisArts.data');GisArts.data.WFSReader=function(meta,recordType){meta=meta||{};GisArts.data.WFSReader.superclass.constructor.call(this,meta,recordType||meta.fields);};Ext.extend(GisArts.data.WFSReader,GeoExt.data.FeatureReader,{read:function(response){var features;if(this.meta.outputFormat=='GeoJSON'){var geojson=new OpenLayers.Format.GeoJSON();features=geojson.read(response.responseText);}else if(this.meta.outputFormat=='GML2'){var gml=new OpenLayers.Format.GML();features=gml.read(response.responseXML||response.responseText);}
return this.readRecords(features);}});OpenLayers.Control.LoadingPanel=OpenLayers.Class(OpenLayers.Control,{counter:0,maximized:false,visible:true,initialize:function(options){OpenLayers.Control.prototype.initialize.apply(this,[options]);},setVisible:function(visible){this.visible=visible;if(visible){OpenLayers.Element.show(this.div);}else{OpenLayers.Element.hide(this.div);}},getVisible:function(){return this.visible;},hide:function(){this.setVisible(false);},show:function(){this.setVisible(true);},toggle:function(){this.setVisible(!this.getVisible());},addLayer:function(evt){if(evt.layer){evt.layer.events.register('loadstart',this,this.increaseCounter);evt.layer.events.register('loadend',this,this.decreaseCounter);}},setMap:function(map){OpenLayers.Control.prototype.setMap.apply(this,arguments);this.map.events.register('preaddlayer',this,this.addLayer);for(var i=0;i<this.map.layers.length;i++){var layer=this.map.layers[i];layer.events.register('loadstart',this,this.increaseCounter);layer.events.register('loadend',this,this.decreaseCounter);}},increaseCounter:function(){this.counter++;if(this.counter>0){if(!this.maximized&&this.visible){this.maximizeControl();}}},decreaseCounter:function(){if(this.counter>0){this.counter--;}
if(this.counter==0){if(this.maximized&&this.visible){this.minimizeControl();}}},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);return this.div;},minimizeControl:function(evt){this.div.style.display="none";this.div.style.width="0px";this.div.style.height="0px";this.maximized=false;if(evt!=null){OpenLayers.Event.stop(evt);}},maximizeControl:function(evt){var viewSize=this.map.getSize();var msgW=viewSize.w;var msgH=viewSize.h;this.div.style.width=msgW+"px";this.div.style.height=msgH+"px";this.div.style.display="block";this.maximized=true;if(evt!=null){OpenLayers.Event.stop(evt);}},destroy:function(){if(this.map){this.map.events.unregister('preaddlayer',this,this.addLayer);if(this.map.layers){for(var i=0;i<this.map.layers.length;i++){var layer=this.map.layers[i];layer.events.unregister('loadstart',this,this.increaseCounter);layer.events.unregister('loadend',this,this.decreaseCounter);}}}
OpenLayers.Control.prototype.destroy.apply(this,arguments);},CLASS_NAME:"OpenLayers.Control.LoadingPanel"});if(!window.GisArts){window.GisArts={};};if(!GisArts.Control){GisArts.Control={};};OpenLayers.Handler.Box.prototype.startBox=function(xy){this.callback("start",[]);this.zoomBox=OpenLayers.Util.createDiv('zoomBox',new OpenLayers.Pixel(-9999,-9999));this.zoomBox.className=this.boxDivClassName;this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;this.map.eventsDiv.appendChild(this.zoomBox);OpenLayers.Element.addClass(this.map.eventsDiv,"olDrawBox");};GisArts.Control.GetFeature=OpenLayers.Class(OpenLayers.Control.GetFeature,{multiLayer:false,circle:false,polygon:false,showLocation:true,cosmeticStyle:{fillColor:"blue",graphicName:"star",pointRadius:6},count:null,mappings:{'adres_zoeken':'Adres','kadastrale_kaart':'percelen'},initialize:function(options){this.EVENT_TYPES=OpenLayers.Control.GetFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);options.handlerOptions=options.handlerOptions||{};OpenLayers.Control.prototype.initialize.apply(this,[options]);this.features={};this.handlers={};if(this.click){this.handlers.click=new OpenLayers.Handler.Click(this,{click:this.selectSingle},this.handlerOptions.click||{})};if(this.box){this.handlers.box=new OpenLayers.Handler.Box(this,{start:this.startBox,done:this.selectBox},OpenLayers.Util.extend(this.handlerOptions.box,{boxDivClassName:"olHandlerBoxSelectFeature"}));}
if(this.hover){this.handlers.hover=new OpenLayers.Handler.Hover(this,{'move':this.cancelHover,'pause':this.selectHover},OpenLayers.Util.extend(this.handlerOptions.hover,{'delay':250}));}
if(this.circle){this.handlers.circle=new OpenLayers.Handler.RegularPolygon(this,{'done':this.selectCircle,'move':this.handleRadius},{'sides':40});}
if(this.polygon){this.handlers.polygon=new OpenLayers.Handler.Polygon(this,{'done':this.selectCircle});}},handleRadius:function(){if(Ext.getCmp('distance')){var radius=this.handlers.circle.radius;Ext.getCmp('distance').setValue(radius.toFixed(1)+' m');}},startBox:function(){if(this.handlers.hover){this.handlers.hover.deactivate();}},selectCircle:function(geom){OpenLayers.Element.addClass(this.map.viewPortDiv,"olCursorWait");this.request(geom);},selectBox:function(position){this.clearCosmeticLayer();OpenLayers.Element.addClass(this.map.viewPortDiv,"olCursorWait");if(position instanceof OpenLayers.Bounds){var minXY=this.map.getLonLatFromPixel(new OpenLayers.Pixel(position.left,position.bottom));var maxXY=this.map.getLonLatFromPixel(new OpenLayers.Pixel(position.right,position.top));var bounds=new OpenLayers.Bounds(minXY.lon,minXY.lat,maxXY.lon,maxXY.lat);this.setModifiers(this.handlers.box.dragHandler.evt);this.request(bounds);}else{this.selectSingle({xy:position});}
if(this.handlers.hover){this.handlers.hover.activate();}},selectSingle:function(evt){OpenLayers.Element.addClass(this.map.viewPortDiv,"olCursorWait");var bounds=this.pixelToBounds(evt.xy);if(!this.cosmeticLayer&&this.showLocation===true){this.cosmeticLayer=new OpenLayers.Layer.Vector();this.map.addLayer(this.cosmeticLayer);}
if(this.showLocation===true){var lonlat=this.map.getLonLatFromPixel(evt.xy);var point=new OpenLayers.Geometry.Point(lonlat.lon,lonlat.lat);var pointFeature=new OpenLayers.Feature.Vector(point,null,this.cosmeticStyle);this.clearCosmeticLayer();this.cosmeticLayer.addFeatures([pointFeature]);}
this.setModifiers(evt);this.request(bounds,{point:true,single:!this.multiLayer});},clearCosmeticLayer:function(){if(this.cosmeticLayer&&this.cosmeticLayer.features){this.cosmeticLayer.removeFeatures(this.cosmeticLayer.features);}},deactivate:function(){this.clearCosmeticLayer();if(this.active){for(var i in this.handlers){this.handlers[i].deactivate();}}
return OpenLayers.Control.prototype.deactivate.apply(this,arguments);},request:function(bounds,options){if(bounds.equals(this.bounds)){return;}
this.bounds=bounds;options=options||{};var filter=null;if(this.circle||this.polygon){filter=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.INTERSECTS,value:bounds});}else if(options&&options.point===true){var factor=0.02;var width=this.map.getExtent().getWidth()*factor;var height=this.map.getExtent().getHeight()*factor;var center=bounds.getCenterLonLat();bounds=new OpenLayers.Bounds(center.lon-width/2,center.lat-height/2,center.lon+width/2,center.lat+height/2);filter=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,value:bounds});}else{filter=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,value:bounds});}
this.count=0;this.events.triggerEvent("beforefeatureselected",{});if(this.protocol!=null){this.protocols=[this.protocol];}
for(var i=0,len=this.protocols.length;i<len;i++){this.count++;var protocol=this.protocols[i];var originalFeatureTypes=protocol.featureType.slice();protocol.featureType=this.filterFeatureTypes(protocol);protocol.format.featureType=protocol.featureType;protocol.read({maxFeatures:options.single==true?this.maxFeatures:undefined,filter:filter,callback:this.protocolCallback,scope:{control:this,typeName:(protocol.featureType instanceof Array)?protocol.featureType[0]:protocol.featureType}});protocol.featureType=originalFeatureTypes;protocol.format.featureType=protocol.featureType;}},isLayerVisible:function(featureType){var layerName=featureType;for(var key in this.mappings){if(layerName===key){layerName=this.mappings[key];}}
var visible=false;for(var i=0,len=this.map.layers.length;i<len;i++){var layer=this.map.layers[i];if(layer instanceof OpenLayers.Layer.WMS){if((layer.getVisibility()===true)&&(OpenLayers.Util.indexOf(layer.params.LAYERS,layerName)!==-1)){visible=true;break;}}}
var node=Ext.getCmp('tree').getNodeById(featureType);if(node){visible=node.attributes.checked;}
return visible;},filterFeatureTypes:function(protocol){var result=[];for(var i=0,len=protocol.featureType.length;i<len;i++){var featureType=protocol.featureType[i];if(this.isLayerVisible(featureType)===true){result.push(featureType);}}
return result;},protocolCallback:function(result){this.control.count--;if(this.control.count===0){OpenLayers.Element.removeClass(this.control.map.viewPortDiv,"olCursorWait");}
if(result.code==1){if(result.features.length){this.control.events.triggerEvent("featureselected",{features:result.features,typeName:this.typeName});}else{this.control.events.triggerEvent("featureselected",{features:null,typeName:this.typeName});}}},CLASS_NAME:"GisArts.Control.GetFeature"});(function(){var addListener=function(){if(window.addEventListener){return function(el,eventName,fn,capture){el.addEventListener(eventName,fn,!!capture);};}else if(window.attachEvent){return function(el,eventName,fn,capture){el.attachEvent("on"+eventName,fn);};}else{return function(){};}}(),removeListener=function(){if(window.removeEventListener){return function(el,eventName,fn,capture){el.removeEventListener(eventName,fn,(capture));};}else if(window.detachEvent){return function(el,eventName,fn){el.detachEvent("on"+eventName,fn);};}else{return function(){};}}();var EV=Ext.lib.Event;var MIM;var MASK_TARGET='x-frame-mask-target';Ext.ux.ManagedIFrame=function(){var args=Array.prototype.slice.call(arguments,0),el=Ext.get(args[0]),config=args[0];if(el&&el.dom&&el.dom.tagName=='IFRAME'){config=args[1]||{};}else{config=args[0]||args[1]||{};el=config.autoCreate?Ext.get(Ext.DomHelper.append(config.autoCreate.parent||Ext.getBody(),Ext.apply({tag:'iframe',frameborder:0,src:(Ext.isIE&&Ext.isSecure)?Ext.SSL_SECURE_URL:'about:blank'},config.autoCreate))):null;if(el&&this.unsupportedText){Ext.DomHelper.append(el.dom.parentNode,{tag:'noframes',html:this.unsupportedText});}}
if(!el||el.dom.tagName!='IFRAME'){return el;}
el.dom.name||(el.dom.name=el.dom.id);el.dom.ownerEl=el;this.addEvents({"focus":true,"blur":true,"unload":true,"domready":true,"documentloaded":true,"exception":true,"message":true});if(config.listeners){this.listeners=config.listeners;Ext.ux.ManagedIFrame.superclass.constructor.call(this);}
Ext.apply(el,this);el.addClass('x-managed-iframe');if(config.style){el.applyStyles(config.style);}
Ext.apply(el,{disableMessaging:config.disableMessaging===true,loadMask:!!config.loadMask?Ext.apply({msg:'Loading..',maskEl:null,hideOnReady:false,disabled:false},config.loadMask):false,_windowContext:null,eventsFollowFrameLinks:typeof config.eventsFollowFrameLinks=='undefined'?true:config.eventsFollowFrameLinks});if(el.loadMask){el.loadMask.maskEl||(el.loadMask.maskEl=el.parent('.'+MASK_TARGET)||el.parent());el.loadMask.maskEl.addClass(MASK_TARGET);}
var um=el.updateManager=new Ext.UpdateManager(el,true);um.showLoadIndicator=config.showLoadIndicator||false;Ext.ux.ManagedIFrame.Manager.register(el);if(config.src){el.setSrc(config.src);}else{var content=config.html||config.content||false;if(content){el.reset(null,function(frame){frame.update.apply(el,[].concat(content));});}}
return el;};Ext.extend(Ext.ux.ManagedIFrame,Ext.util.Observable,{src:null,CSS:null,manager:null,disableMessaging:true,domReadyRetries:7500,focusOnLoad:false,resetUrl:(function(){if(Ext.isIE&&Ext.isSecure){return Ext.SSL_SECURE_URL;}else{return'about:blank';}})(),unsupportedText:'Inline frames are NOT enabled\/supported by your browser.',setSrc:function(url,discardUrl,callback,scope){if(url&&typeof url=='object'){callback=url.callback||false;discardUrl=url.discardUrl||false;url=url.url||false;scope=url.scope||null;}
var src=url||this.src||this.resetUrl;this._windowContext=null;this._unHook();this._frameAction=this.frameInit=this._domReady=false;this.showMask();var s=this._targetURI=typeof src=='function'?src()||'':src;try{this._frameAction=true;this._callBack=typeof callback=='function'?callback.createDelegate(scope):null;this.dom.src=s;this.frameInit=true;this.checkDOM();}catch(ex){this.fireEvent('exception',this,ex);}
if(discardUrl!==true){this.src=src;}
return this;},setLocation:function(url,discardUrl,callback,scope){if(url&&typeof url=='object'){callback=url.callback||false;discardUrl=url.discardUrl||false;url=url.url||false;scope=url.scope||null;}
var src=url||this.src||this.resetUrl;this._windowContext=null;this._unHook();this._frameAction=this.frameInit=this._domReady=false;this.showMask();var s=this._targetURI=typeof src=='function'?src()||'':src;try{this._frameAction=true;this._callBack=typeof callback=='function'?callback.createDelegate(scope):null;this.getWindow().location.replace(s);this.frameInit=true;this.checkDOM();}catch(ex){this.fireEvent('exception',this,ex);}
if(discardUrl!==true){this.src=src;}
return this;},reset:function(src,callback,scope){this._unHook();var loadMaskOff=false;if(this.loadMask){loadMaskOff=this.loadMask.disabled;this.loadMask.disabled=false;}
this._callBack=function(frame){if(frame.loadMask){frame.loadMask.disabled=loadMaskOff;};frame._frameAction=false;frame.frameInit=true;this._isReset=false;if(callback){callback.call(scope||window,frame);}};this.hideMask(true);this._frameAction=false;this.frameInit=true
this._isReset=true;var s=src;if(typeof src=='function'){s=src();}
s=this._targetURI=Ext.isEmpty(s,true)?this.resetUrl:s;this.getWindow().location.href=s;return this;},scriptRE:/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/gi,update:function(content,loadScripts,callback,scope){loadScripts=loadScripts||this.getUpdateManager().loadScripts||false;content=Ext.DomHelper.markup(content||'');content=loadScripts===true?content:content.replace(this.scriptRE,"");var doc;if((doc=this.getDocument())&&!!content.length){this._unHook();this._windowContext=this.src=null;this._targetURI=location.href;this.src=null;this.frameInit=true;this.showMask();this._callBack=typeof callback=='function'?callback.createDelegate(scope):null;doc.open();this._frameAction=true;doc.write(content);doc.close();this.checkDOM();}else{this.hideMask(true);if(callback){callback.call(scope,this);}}
return this;},disableMessaging:true,_XFrameMessaging:function(){var tagStack={'$':[]};var isEmpty=function(v,allowBlank){return v===null||v===undefined||(!allowBlank?v==='':false);};var apply=function(o,c,defaults){if(defaults){apply(o,defaults);}
if(o&&c&&typeof c=='object'){for(var p in c){o[p]=c[p];}}
return o;};window.sendMessage=function(message,tag,origin){var MIF;if(MIF=arguments.callee.manager){if(message._fromHost){var fn,result;var compTag=message.tag||tag||null;var mstack=!isEmpty(compTag)?tagStack[compTag.toLowerCase()]||[]:tagStack["$"];for(var i=0,l=mstack.length;i<l;i++){if(fn=mstack[i]){result=fn.apply(fn.__scope,arguments)===false?false:result;if(fn.__single){mstack[i]=null;}
if(result===false){break;}}}
return result;}else{message={type:isEmpty(tag)?'message':'message:'
+tag.toLowerCase().replace(/^\s+|\s+$/g,''),data:message,domain:origin||document.domain,uri:document.documentURI,source:window,tag:isEmpty(tag)?null:tag.toLowerCase()};try{return MIF.disableMessaging!==true?MIF.fireEvent.call(MIF,message.type,MIF,message):null;}catch(ex){}
return null;}}};window.onhostmessage=function(fn,scope,single,tag){if(typeof fn=='function'){if(!isEmpty(fn.__index)){throw"onhostmessage: duplicate handler definition"
+(tag?" for tag:"+tag:'');}
var k=isEmpty(tag)?"$":tag.toLowerCase();tagStack[k]||(tagStack[k]=[]);apply(fn,{__tag:k,__single:single||false,__scope:scope||window,__index:tagStack[k].length});tagStack[k].push(fn);}else{throw"onhostmessage: function required";}};window.unhostmessage=function(fn){if(typeof fn=='function'&&typeof fn.__index!='undefined'){var k=fn.__tag||"$";tagStack[k][fn.__index]=null;}};},getHistory:function(){var h=null;try{h=this.getWindow().history;}catch(eh){}
return h;},get:function(el){return MIM.El.get(this,el);},fly:function(el,named){named=named||'_global';el=this.getDom(el);if(!el){return null;}
if(!MIM._flyweights[named]){MIM._flyweights[named]=new Ext.Element.Flyweight();}
MIM._flyweights[named].dom=el;return MIM._flyweights[named];},getDom:function(el){var d;if(!el||!(d=this.getDocument())){return null;}
return el.dom?el.dom:(typeof el=='string'?d.getElementById(el):el);},select:function(selector,unique){var d;return(d=this.getDocument())?Ext.Element.select(selector,unique,d):null;},query:function(selector){var d;return(d=this.getDocument())?Ext.DomQuery.select(selector,d):null;},getDoc:function(){return this.get(this.getDocument());},removeNode:function(node){MIM.removeNode(this,this.getDom(node));},_unHook:function(){var elcache,h=MIM.getFrameHash(this)||{};if(this._hooked){if(h&&(elcache=h.elCache)){for(var id in elcache){var el=elcache[id];if(el.removeAllListeners){el.removeAllListeners();}
delete elcache[id];}
if(h.docEl){h.docEl.removeAllListeners();h.docEl=null;delete h.docEl;}}
var w;if(this._frameProxy&&(w=this.getWindow())){removeListener(w,'focus',this._frameProxy);removeListener(w,'blur',this._frameProxy);removeListener(w,'resize',this._frameProxy);removeListener(w,'unload',this._frameProxy);}}
this._hooked=this._domReady=this._domFired=this._frameAction=false;MIM._flyweights={};this.CSS=this.CSS?this.CSS.destroy():null;},_renderHook:function(){this._windowContext=null;this.CSS=this.CSS?this.CSS.destroy():null;this._hooked=false;try{if(this.writeScript('(function(){(window.hostMIF = parent.Ext.get("'
+this.dom.id
+'"))._windowContext='
+(Ext.isIE?'window':'{eval:function(s){return eval(s);}}')
+';})();')){this._frameProxy||(this._frameProxy=MIM.eventProxy.createDelegate(this));var w;if(w=this.getWindow()){addListener(w,'focus',this._frameProxy);addListener(w,'blur',this._frameProxy);addListener(w,'resize',this._frameProxy);addListener(w,'unload',this._frameProxy);}
if(this.disableMessaging!==true){this.loadFunction({name:'XMessage',fn:this._XFrameMessaging},false,true);var sm;if(sm=w.sendMessage){sm.manager=this;}}
this.CSS=new CSSInterface(this.getDocument());}}catch(ex){}
return(this._hooked=this.domWritable());},sendMessage:function(message,tag,origin){var win;if(this.disableMessaging!==true&&(win=this.getWindow())){tag||(tag=message.tag||'');tag=tag.toLowerCase();message=Ext.applyIf(message.data?message:{data:message},{type:Ext.isEmpty(tag)?'message':'message:'
+tag,domain:origin||document.domain,uri:document.documentURI,source:window,tag:tag||null,_fromHost:this});return win.sendMessage?win.sendMessage.call(null,message,tag,origin):null;}
return null;},_windowContext:null,getDocument:function(){var win=this.getWindow(),doc=null;try{doc=(Ext.isIE&&win?win.document:null)||this.dom.contentDocument||window.frames[this.id].document||null;}catch(gdEx){return false;}
return doc;},getBody:function(){var d;return(d=this.getDocument())?d.body:null;},getDocumentURI:function(){var URI,d;try{URI=this.src&&(d=this.getDocument())?d.location.href:null;}catch(ex){}
return URI||(typeof this.src=='function'?this.src():this.src);},getWindowURI:function(){var URI,w;try{URI=(w=this.getWindow())?w.location.href:null;}catch(ex){}
return URI||(typeof this.src=='function'?this.src():this.src);},getWindow:function(){var dom=this.dom,win=null;try{win=dom.contentWindow||window.frames[dom.name]||null;}catch(gwEx){}
return win;},print:function(){var win;try{if(win=this.getWindow()){if(Ext.isIE){win.focus();}
win.print();}}catch(ex){throw'print exception: '+(ex.description||ex.message||ex);}},destroy:function(){this.removeAllListeners();if(this.loadMask){this.hideMask(true);Ext.apply(this.loadMask,{masker:null,maskEl:null});}
if(this.dom){Ext.ux.ManagedIFrame.Manager.deRegister(this);this.dom.ownerEl=this._windowContext=null;if(Ext.isIE&&this.dom.src){this.dom.src='javascript:false';}
this._maskEl=null;this.remove();}},domWritable:function(){return!!this._windowContext;},execScript:function(block,useDOM){try{if(this.domWritable()){if(useDOM){this.writeScript(block);}else{return this._windowContext.eval(block);}}else{throw'execScript:non-secure context'}}catch(ex){this.fireEvent('exception',this,ex);return false;}
return true;},writeScript:function(block,attributes){attributes=Ext.apply({},attributes||{},{type:"text/javascript",text:block});try{var head,script,doc=this.getDocument();if(doc&&typeof doc.getElementsByTagName!='undefined'){if(!(head=doc.getElementsByTagName("head")[0])){head=doc.createElement("head");doc.getElementsByTagName("html")[0].appendChild(head);}
if(head&&(script=doc.createElement("script"))){for(var attrib in attributes){if(attributes.hasOwnProperty(attrib)&&attrib in script){script[attrib]=attributes[attrib];}}
return!!head.appendChild(script);}}}catch(ex){this.fireEvent('exception',this,ex);}
return false;},loadFunction:function(fn,useDOM,invokeIt){var name=fn.name||fn;var fn=fn.fn||window[fn];this.execScript(name+'='+fn,useDOM);if(invokeIt){this.execScript(name+'()');}},mask:function(msg,msgCls,maskCls){this._mask&&this.unmask();var p=this.parent('.'+MASK_TARGET)||this.parent();if(p.getStyle("position")=="static"&&!p.select('iframe,frame,object,embed').elements.length){p.addClass("x-masked-relative");}
p.addClass("x-masked");this._mask=Ext.DomHelper.append(p,{cls:maskCls||"ext-el-mask"},true);this._mask.setDisplayed(true);this._mask._agent=p;var delay=(this.loadMask?this.loadMask.delay:0)||10;if(typeof msg=='string'){this._maskMsg=Ext.DomHelper.append(p,{cls:msgCls||'ext-el-mask-msg x-mask-loading',style:{visibility:'hidden'},cn:{tag:'div',html:msg}},true);this._maskMsg.setVisibilityMode(Ext.Element.VISIBILITY);(function(){this._mask&&this._maskMsg&&this._maskMsg.center(p).setVisible(true);}).defer(delay,this);}
if(Ext.isIE&&!(Ext.isIE7&&Ext.isStrict)&&this.getStyle('height')=='auto'){this._mask.setSize(undefined,this._mask.getHeight());}
return this._mask;},unmask:function(){var a;if(this._mask){(a=this._mask._agent)&&a.removeClass(["x-masked-relative","x-masked"]);if(this._maskMsg){this._maskMsg.remove();delete this._maskMsg;}
this._mask.remove();delete this._mask;}},showMask:function(msg,msgCls,maskCls){var lmask=this.loadMask;if(lmask&&!lmask.disabled&&!this._mask){this.mask(msg||lmask.msg,msgCls||lmask.msgCls,maskCls||lmask.maskCls);}},hideMask:function(forced){var tlm=this.loadMask;if(tlm&&!!this._mask){if(forced||(tlm.hideOnReady&&this._domReady)){this.unmask();}}},submitAsTarget:function(submitCfg){var opt=submitCfg||{},D=document,form=Ext.getDom(opt.form?opt.form.form||opt.form:null)||Ext.DomHelper.append(D.body,{tag:'form',cls:'x-hidden x-mif-form',encoding:'multipart/form-data'}),formState={target:form.target||'',method:form.method||'',encoding:form.encoding||'',enctype:form.enctype||'',action:form.action||''},encoding=opt.encoding||form.encoding,method=opt.method||form.method||'POST';Ext.fly(form).set({target:this.dom.name,method:method,encoding:encoding,action:opt.url||opt.action||form.action});if(method=='POST'||!!opt.enctype){Ext.fly(form).set({enctype:opt.enctype||form.enctype||encoding});}
var hiddens,hd,ps;if(opt.params&&(ps=Ext.isFunction(opt.params)?opt.params():opt.params)){hiddens=[];var ps=typeof opt.params=='string'?Ext.urlDecode(params,false):opt.params;for(var k in ps){if(ps.hasOwnProperty(k)){Ext.fly(hd=D.createElement('input')).set({type:'hidden',name:k,value:ps[k]});form.appendChild(hd);hiddens.push(hd);}}}
this._callBack=typeof opt.callback=='function'?opt.callback.createDelegate(opt.scope):null;this._frameAction=this.frameInit=true;this._targetURI=location.href;this.showMask();(function(){form.submit();hiddens&&Ext.each(hiddens,Ext.removeNode,Ext);var ff=Ext.fly(form,'_dynaForm');if(ff.hasClass('x-mif-form')){ff.remove();}else{ff.set(formState);}
this.hideMask(true);}).defer(100,this);return this;},loadHandler:function(e,target){target||(target={});var rstatus=(e&&typeof e.type!=='undefined'?e.type:this.dom.readyState);if(this._isReset||this._frameAction||this.eventsFollowFrameLinks){switch(rstatus){case'domready':var M;try{M=(this.getWindow()?this.getWindow().hostMIF:null);}catch(access){}
M||((this._domFired=this._renderHook())&&this.fireEvent.defer(1,this,["domready",this]));case'domfail':this._domReady=true;this.hideMask();if(this._callBack){this._callBack.defer(1,null,[this]);delete this._callBack;}
break;case'load':case'complete':this._domReady||this.loadHandler({type:'domready',id:this.id},this.dom);(this.focusOnLoad||Ext.isIE)&&this.getWindow()&&this.getWindow().focus();this.fireEvent.defer(1,this,["documentloaded",this]);if(this._callBack){this._callBack.defer(1,null,[this]);delete this._callBack;}
this._frameAction=this.frameInit=false;if(this.eventsFollowFrameLinks){this._domFired=this._domReady=false;}
this.hideMask(true);break;default:}}
this.frameState=rstatus;},checkDOM:function(win){if(Ext.isOpera||Ext.isGecko){return;}
var n=0,manager=this,domReady=false,b,l,d,max=this.domReadyRetries,polling=false,startLocation=(this.getDocument()||{location:{}}).location.href;(function(){d=manager.getDocument()||{location:{}};polling=(d.location.href!==startLocation||d.location.href===manager._targetURI);if(manager._domReady){return;}
domReady=polling&&((b=manager.getBody())&&!!(b.innerHTML||'').length)||false;if(d.location.href&&!domReady&&(++n<max)){setTimeout(arguments.callee,2);return;}
manager.loadHandler({type:domReady?'domready':'domfail'});})();}});var styleCamelRe=/(-[a-z])/gi;var styleCamelFn=function(m,a){return a.charAt(1).toUpperCase();};var CSSInterface=function(hostDocument){var doc;if(hostDocument){doc=hostDocument;return{rules:null,destroy:function(){return doc=null;},createStyleSheet:function(cssText,id){var ss;if(!doc)
return;var head=doc.getElementsByTagName("head")[0];var rules=doc.createElement("style");rules.setAttribute("type","text/css");if(id){rules.setAttribute("id",id);}
if(Ext.isIE){head.appendChild(rules);ss=rules.styleSheet;ss.cssText=cssText;}else{try{rules.appendChild(doc.createTextNode(cssText));}catch(e){rules.cssText=cssText;}
head.appendChild(rules);ss=rules.styleSheet?rules.styleSheet:(rules.sheet||doc.styleSheets[doc.styleSheets.length
-1]);}
this.cacheStyleSheet(ss);return ss;},removeStyleSheet:function(id){if(!doc)
return;var existing=doc.getElementById(id);if(existing){existing.parentNode.removeChild(existing);}},swapStyleSheet:function(id,url){this.removeStyleSheet(id);if(!doc)
return;var ss=doc.createElement("link");ss.setAttribute("rel","stylesheet");ss.setAttribute("type","text/css");ss.setAttribute("id",id);ss.setAttribute("href",url);doc.getElementsByTagName("head")[0].appendChild(ss);},refreshCache:function(){return this.getRules(true);},cacheStyleSheet:function(ss){if(this.rules){this.rules={};}
try{var ssRules=ss.cssRules||ss.rules;for(var j=ssRules.length-1;j>=0;--j){this.rules[ssRules[j].selectorText]=ssRules[j];}}catch(e){}},getRules:function(refreshCache){if(this.rules==null||refreshCache){this.rules={};if(doc){var ds=doc.styleSheets;for(var i=0,len=ds.length;i<len;i++){try{this.cacheStyleSheet(ds[i]);}catch(e){}}}}
return this.rules;},getRule:function(selector,refreshCache){var rs=this.getRules(refreshCache);if(!Ext.isArray(selector)){return rs[selector];}
for(var i=0;i<selector.length;i++){if(rs[selector[i]]){return rs[selector[i]];}}
return null;},updateRule:function(selector,property,value){if(!Ext.isArray(selector)){var rule=this.getRule(selector);if(rule){rule.style[property.replace(styleCamelRe,styleCamelFn)]=value;return true;}}else{for(var i=0;i<selector.length;i++){if(this.updateRule(selector[i],property,value)){return true;}}}
return false;}};}};Ext.ux.ManagedIframePanel=Ext.extend(Ext.Panel,{defaultSrc:null,bodyStyle:{position:'relative'},frameStyle:{overflow:'auto'},frameConfig:null,hideMode:!Ext.isIE?'nosize':'display',shimCls:'x-frame-shim',shimUrl:null,loadMask:false,stateful:false,animCollapse:Ext.isIE&&Ext.enableFx,autoScroll:false,closable:true,ctype:"Ext.ux.ManagedIframePanel",showLoadIndicator:false,unsupportedText:'Inline frames are NOT enabled\/supported by your browser.',initComponent:function(){var f=this.frameConfig?this.frameConfig.autoCreate||this.frameConfig:{};var frCfg=Ext.apply(f,{id:f.id||Ext.id()});frCfg.name=f.name||frCfg.id;if(Ext.isIE&&Ext.isSecure){frCfg.src=Ext.SSL_SECURE_URL;}
var frameTag=Ext.apply({tag:'iframe',frameborder:0,cls:'x-managed-iframe',style:this.frameStyle||f.style||{}},frCfg);var unsup=this.unsupportedText?{tag:'noframes',html:this.unsupportedText}:[];this.bodyCfg||(this.bodyCfg={cls:this.baseCls+'-body',children:this.contentEl?[]:[frameTag].concat(unsup)});this.autoScroll=false;this.items=null;if(this.stateful!==false){this.stateEvents||(this.stateEvents=['documentloaded']);}
Ext.ux.ManagedIframePanel.superclass.initComponent.call(this);this.monitorResize||(this.monitorResize=!!this.fitToParent);this.addEvents({documentloaded:true,domready:true,message:true,exception:true,blur:true,focus:true});this.addListener=this.on;},doLayout:function(){if(this.fitToParent&&!this.ownerCt){var pos=this.getPosition(),size=(Ext.get(this.fitToParent)||this.getEl().parent()).getViewSize();this.setSize(size.width-pos[0],size.height-pos[1]);}
Ext.ux.ManagedIframePanel.superclass.doLayout.apply(this,arguments);},beforeDestroy:function(){if(this.rendered){if(this.tools){for(var k in this.tools){Ext.destroy(this.tools[k]);}}
if(this.header&&this.headerAsText){var s;if(s=this.header.child('span'))s.remove(true,true);this.header.update('');}
Ext.each(['iframe','shim','header','topToolbar','bottomToolbar','footer','loadMask','body','bwrap'],function(elName){if(this[elName]){if(typeof this[elName].destroy=='function'){this[elName].destroy();}else{Ext.destroy(this[elName]);}
this[elName]=null;delete this[elName];}},this);}
Ext.ux.ManagedIframePanel.superclass.beforeDestroy.call(this);},onDestroy:function(){Ext.Panel.superclass.onDestroy.call(this);},afterRender:function(container){var html=this.html;delete this.html;Ext.ux.ManagedIframePanel.superclass.afterRender.apply(this,arguments);if(this.iframe=this.body.child('iframe')){this.iframe.ownerCt=this;if(this.loadMask){var mEl;if(mEl=this.loadMask.maskEl){(this[mEl]||mEl||this.body).addClass(MASK_TARGET);}
this.loadMask=Ext.apply({disabled:false,hideOnReady:false},this.loadMask);}
this.getUpdater().showLoadIndicator=this.showLoadIndicator||false;var ownerCt=this.ownerCt;while(ownerCt){ownerCt.on('afterlayout',function(container,layout){var MIM=Ext.ux.ManagedIFrame.Manager,st=false;Ext.each(['north','south','east','west'],function(region){var reg;if((reg=layout[region])&&reg.splitEl){st=true;if(!reg.split._splitTrapped){reg.split.on('beforeresize',MIM.showShims,MIM);reg.split._splitTrapped=true;}}},this);if(st&&!this._splitTrapped){this.on('resize',MIM.hideShims,MIM);this._splitTrapped=true;}},this,{single:true});ownerCt=ownerCt.ownerCt;}
this.shim=Ext.get(this.body.child('.'+this.shimCls))||Ext.DomHelper.append(this.body,{tag:'img',src:this.shimUrl||Ext.BLANK_IMAGE_URL,cls:this.shimCls,galleryimg:"no"},true);var El=Ext.Element;var mode=El[this.hideMode.toUpperCase()]||'x-hide-nosize';Ext.each([this[this.collapseEl],this.floating?null:this.getActionEl(),this.iframe],function(el){if(el)
el.setVisibilityMode(mode);},this);if(this.iframe=new Ext.ux.ManagedIFrame(this.iframe,{loadMask:this.loadMask,showLoadIndicator:this.showLoadIndicator,disableMessaging:this.disableMessaging,style:this.frameStyle,src:this.defaultSrc,html:html}))
{this.loadMask=this.iframe.loadMask;this.iframe.ownerCt=this;this.relayEvents(this.iframe,["blur","focus","unload","documentloaded","domready","exception","message"].concat(this._msgTagHandlers||[]));delete this._msgTagHandlers;}}},sendMessage:function(){if(this.iframe){this.iframe.sendMessage.apply(this.iframe,arguments);}},filterOptRe:/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/,on:function(name){var tagRE=/^message\:/i,n=null;if(typeof name=='object'){for(var na in name){if(!this.filterOptRe.test(na)&&tagRE.test(na)){n||(n=[]);n.push(na.toLowerCase());}}}else if(tagRE.test(name)){n=[name.toLowerCase()];}
if(this.getFrame()&&n){this.relayEvents(this.iframe,n);}else{this._msgTagHandlers||(this._msgTagHandlers=[]);if(n)
this._msgTagHandlers=this._msgTagHandlers.concat(n);}
Ext.ux.ManagedIframePanel.superclass.on.apply(this,arguments);},setSrc:function(url,discardUrl,callback,scope){url=url||this.defaultSrc||false;if(url&&this.rendered&&this.iframe){this.iframe.setSrc.call(this.iframe,url,discardUrl,callback,scope);}
return this;},setLocation:function(url,discardUrl,callback,scope){url=url||this.defaultSrc||false;if(url&&this.rendered&&this.iframe){this.iframe.setLocation.call(this.iframe,url,discardUrl,callback,scope);}
return this;},getState:function(){var URI=this.iframe?this.iframe.getDocumentURI()||null:null;return Ext.apply(Ext.ux.ManagedIframePanel.superclass.getState.call(this)||{},URI?{defaultSrc:typeof URI=='function'?URI():URI}:null);},getUpdater:function(){return this.rendered?(this.iframe||this.body).getUpdater():null;},getFrame:function(){return this.rendered?this.iframe:null},getFrameWindow:function(){return this.rendered&&this.iframe?this.iframe.getWindow():null;},getFrameDocument:function(){return this.rendered&&this.iframe?this.iframe.getDocument():null;},getFrameDoc:function(){return this.rendered&&this.iframe?this.iframe.getDoc():null;},getFrameBody:function(){return this.rendered&&this.iframe?this.iframe.getBody():null;},load:function(loadCfg){var um;if(um=this.getUpdater()){if(loadCfg&&loadCfg.renderer){um.setRenderer(loadCfg.renderer);delete loadCfg.renderer;}
um.update.apply(um,arguments);}
return this;},doAutoLoad:function(){this.load(typeof this.autoLoad=='object'?this.autoLoad:{url:this.autoLoad});}});Ext.ux.ManagedIFrame.Manager=MIM=function(){var frames={};var implementation={readyHandler:function(e){try{var $frame=e.target.ownerEl;if($frame&&$frame._frameAction){$frame.loadHandler.call($frame,{type:'domready'});}}catch(rhEx){return}},shimCls:'x-frame-shim',register:function(frame){frame.manager=this;frames[frame.id]=frames[frame.dom.name]={ref:frame,elCache:{}};frame.dom[Ext.isIE?'onreadystatechange':'onload']=frame.loadHandler.createDelegate(frame);return frame;},deRegister:function(frame){frame._unHook();frame.dom.onload=frame.dom.onreadystatechange=null;delete frames[frame.id];delete frames[frame.dom.name];},hideShims:function(){if(!this.shimApplied)
return;Ext.select('.'+this.shimCls,true).removeClass(this.shimCls
+'-on');this.shimApplied=false;},showShims:function(){if(!this.shimApplied){this.shimApplied=true;Ext.select('.'+this.shimCls,true).addClass(this.shimCls
+'-on');}},getFrameById:function(id){return typeof id=='string'?(frames[id]?frames[id].ref||null:null):null;},getFrameByName:function(name){return this.getFrameById(name);},getFrameHash:function(frame){return frame.id?frames[frame.id]:null;},eventProxy:function(e){if(!e)return;e=Ext.EventObject.setEvent(e);var be=e.browserEvent||e;(e.type=='unload')&&this._unHook();if(!be['eventPhase']||(be['eventPhase']==(be['AT_TARGET']||2))){return this.fireEvent(e.type,e);}},_flyweights:{},destroy:function(){if(document.addEventListener){window.removeEventListener("DOMFrameContentLoaded",this.readyHandler,true);}
delete this._flyweights;},removeNode:Ext.isIE?function(frame,n){frame=MIM.getFrameHash(frame);if(frame&&n&&n.tagName!='BODY'){d=frame.scratchDiv||(frame.scratchDiv=frame.getDocument().createElement('div'));d.appendChild(n);d.innerHTML='';}}:function(frame,n){if(n&&n.parentNode&&n.tagName!='BODY'){n.parentNode.removeChild(n);}}};if(document.addEventListener){window.addEventListener("DOMFrameContentLoaded",implementation.readyHandler,true);}
Ext.EventManager.on(window,'beforeunload',implementation.destroy,implementation);return implementation;}();MIM.showDragMask=MIM.showShims;MIM.hideDragMask=MIM.hideShims;MIM.El=function(frame,el,forceNew){var frameObj;frame=(frameObj=MIM.getFrameHash(frame))?frameObj.ref:null;if(!frame){return null;}
var elCache=frameObj.elCache||(frameObj.elCache={});var dom=frame.getDom(el);if(!dom){return null;}
var id=dom.id;if(forceNew!==true&&id&&elCache[id]){return elCache[id];}
this.dom=dom;this.id=id||Ext.id(dom);};MIM.El.get=function(frame,el){var ex,elm,id,doc;if(!frame||!el){return null;}
var frameObj;frame=(frameObj=MIM.getFrameHash(frame))?frameObj.ref:null;if(!frame){return null;}
var elCache=frameObj.elCache||(frameObj.elCache={});if(!(doc=frame.getDocument())){return null;}
if(typeof el=="string"){if(!(elm=frame.getDom(el))){return null;}
if(ex=elCache[el]){ex.dom=elm;}else{ex=elCache[el]=new MIM.El(frame,elm);}
return ex;}else if(el.tagName){if(!(id=el.id)){id=Ext.id(el);}
if(ex=elCache[id]){ex.dom=el;}else{ex=elCache[id]=new MIM.El(frame,el);}
return ex;}else if(el instanceof MIM.El){if(el!=frameObj.docEl){el.dom=frame.getDom(el.id)||el.dom;elCache[el.id]=el;}
return el;}else if(el.isComposite){return el;}else if(Ext.isArray(el)){return frame.select(el);}else if(el==doc){if(!frameObj.docEl){var f=function(){};f.prototype=MIM.El.prototype;frameObj.docEl=new f();frameObj.docEl.dom=doc;}
return frameObj.docEl;}
return null;};Ext.apply(MIM.El.prototype,Ext.Element.prototype);Ext.ns('Ext.ux.panel','Ext.ux.portlet');Ext.reg('iframepanel',Ext.ux.panel.ManagedIframe=Ext.ux.ManagedIframePanel);Ext.ux.ManagedIframePortlet=Ext.extend(Ext.ux.ManagedIframePanel,{anchor:'100%',frame:true,collapseEl:'bwrap',collapsible:true,draggable:true,cls:'x-portlet'});Ext.reg('iframeportlet',Ext.ux.portlet.ManagedIframe=Ext.ux.ManagedIframePortlet);Ext.apply(Ext.Element.prototype,{setVisible:function(visible,animate){if(!animate||!Ext.lib.Anim){if(this.visibilityMode==Ext.Element.DISPLAY){this.setDisplayed(visible);}else if(this.visibilityMode==Ext.Element.VISIBILITY){this.fixDisplay();this.dom.style.visibility=visible?"visible":"hidden";}else{this[visible?'removeClass':'addClass'](String(this.visibilityMode));}}else{var dom=this.dom;var visMode=this.visibilityMode;if(visible){this.setOpacity(.01);this.setVisible(true);}
this.anim({opacity:{to:(visible?1:0)}},this.preanim(arguments,1),null,.35,'easeIn',function(){if(!visible){if(visMode==Ext.Element.DISPLAY){dom.style.display="none";}else if(visMode==Ext.Element.VISIBILITY){dom.style.visibility="hidden";}else{Ext.get(dom).addClass(String(visMode));}
Ext.get(dom).setOpacity(1);}});}
return this;},isVisible:function(deep){var vis=!(this.hasClass(this.visibilityMode)||this.getStyle("visibility")=="hidden"||this.getStyle("display")=="none");if(deep!==true||!vis){return vis;}
var p=this.dom.parentNode;while(p&&p.tagName.toLowerCase()!="body"){if(!Ext.fly(p,'_isVisible').isVisible()){return false;}
p=p.parentNode;}
return true;}});Ext.onReady(function(){var CSS=Ext.util.CSS,rules=[];CSS.getRule('.x-managed-iframe')||(rules.push('.x-managed-iframe {height:100%;width:100%;overflow:auto;position:relative;}'));CSS.getRule('.'+MASK_TARGET)||(rules.push('.'+MASK_TARGET+'{position:relative;zoom:1;}','.'+MASK_TARGET+' .ext-el-mask-msg{z-index:101!important;} '));if(!CSS.getRule('.x-frame-shim')){rules.push('.x-frame-shim {z-index:8500;position:absolute;top:0px;left:0px;background:transparent!important;overflow:hidden;display:none;}');rules.push('.x-frame-shim-on{width:100%;height:100%;display:block;zoom:1;}');rules.push('.ext-ie6 .x-frame-shim{margin-left:5px;margin-top:3px;}');}
CSS.getRule('.x-hide-nosize')||(rules.push('.x-hide-nosize,.x-hide-nosize *{height:0px!important;width:0px!important;border:none;}'));if(!!rules.length){CSS.createStyleSheet(rules.join(' '));}});})();if(Ext.provide){Ext.provide('miframe');}
if(!window.GisArts){window.GisArts={};};if(!GisArts.Control){GisArts.Control={};};GisArts.Control.Cyclorama=OpenLayers.Class(GisArts.Control.FeatureInfo,{layer:null,imageField:null,baseURL:'',initialize:function(options){this.EVENT_TYPES=GisArts.Control.FeatureInfo.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,arguments);this.handler=new OpenLayers.Handler.Click(this,OpenLayers.Util.extend({click:this.click},this.callbacks));},activate:function(){return OpenLayers.Control.prototype.activate.apply(this,arguments);},deactivate:function(){this.removeMarker();return OpenLayers.Control.prototype.deactivate.apply(this,arguments);},click:function(evt){var triggered=false;this.numVisibleLayers=1;this.counter=0;this.start();this.location=this.map.getLonLatFromPixel(evt.xy);if(!triggered){this.events.triggerEvent('featureinfostart');triggered=true;}
this.performRequest(this.layer,evt);},end:function(){var feature;if(this.featurelist&&this.featurelist[0]){feature=this.featurelist[0].features[0];}
if(feature&&feature.attributes[this.imageField]){if(this.markerLayer){this.feature=new OpenLayers.Feature(this.markerLayer,this.location,{icon:this.icon});this.marker=this.feature.createMarker();this.markerLayer.clearMarkers();this.markerLayer.addMarker(this.marker);}
var options={url:'generatetoken.php',params:{imageid:feature.attributes[this.imageField]},callback:function(request){var tid=escape(request.responseText);var url=this.baseURL+'ImageID='+feature.attributes[this.imageField]+'&TID='+tid;var wh=window.open(url,'cyclo','width=740,height=380,resizable=yes,scrollbars=no,toolbar=yes,location=no');if(wh){wh.focus();}else{Ext.MessageBox.show({icon:Ext.MessageBox.WARNING,title:"Waarschuwing",msg:"Het popup window kon niet geopend worden, heeft u een popup blocker geinstalleerd?",buttons:Ext.MessageBox.OK});}},scope:this};var response=OpenLayers.Request.GET(options);}
this.events.triggerEvent('featureinfoend',{featurelist:null});},removeMarker:function(){if(this.markerLayer){this.markerLayer.clearMarkers();}},CLASS_NAME:"GisArts.Control.Cyclorama"});OpenLayers.Control.ScaleBar=OpenLayers.Class(OpenLayers.Control,{element:null,scale:1,displaySystem:'metric',minWidth:100,maxWidth:200,divisions:2,subdivisions:2,showMinorMeasures:false,abbreviateLabel:false,singleLine:false,align:'left',div:null,scaleText:"scale 1:",thousandsSeparator:"",measurementProperties:{english:{units:['miles','feet','inches'],abbr:['mi','ft','in'],inches:[63360,12,1]},metric:{units:['kilometers','meters','centimeters'],abbr:['km','m','cm'],inches:[39370.07874,39.370079,0.393701]}},limitedStyle:false,customStyles:null,defaultStyles:{Bar:{height:11,top:12,borderLeftWidth:0,borderRightWidth:0},BarAlt:{height:11,top:12,borderLeftWidth:0,borderRightWidth:0},MarkerMajor:{height:13,width:13,top:12,borderLeftWidth:0,borderRightWidth:0},MarkerMinor:{height:13,width:13,top:12,borderLeftWidth:0,borderRightWidth:0},NumbersBox:{height:13,width:40,top:24},LabelBox:{height:15,top:-2},LabelBoxSingleLine:{height:15,width:35,top:5,left:10}},appliedStyles:null,initialize:function(options){OpenLayers.Control.prototype.initialize.apply(this,[options]);if(!document.styleSheets){this.limitedStyle=true;}
if(this.limitedStyle){this.appliedStyles=OpenLayers.Util.extend({},this.defaultStyles);OpenLayers.Util.extend(this.appliedStyles,this.customStyles);}
this.element=document.createElement('div');this.element.style.position='relative';this.element.className=this.displayClass+'Wrapper';this.labelContainer=document.createElement('div');this.labelContainer.className=this.displayClass+'Units';this.labelContainer.style.position='absolute';this.graphicsContainer=document.createElement('div');this.graphicsContainer.style.position='absolute';this.graphicsContainer.className=this.displayClass+'Graphics';this.numbersContainer=document.createElement('div');this.numbersContainer.style.position='absolute';this.numbersContainer.className=this.displayClass+'Numbers';this.element.appendChild(this.graphicsContainer);this.element.appendChild(this.labelContainer);this.element.appendChild(this.numbersContainer);},destroy:function(){this.map.events.unregister('moveend',this,this.onMoveend);this.div.innerHTML="";OpenLayers.Control.prototype.destroy.apply(this);},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.dxMarkerMajor=(this.styleValue('MarkerMajor','borderLeftWidth')+
this.styleValue('MarkerMajor','width')+
this.styleValue('MarkerMajor','borderRightWidth'))/2;this.dxMarkerMinor=(this.styleValue('MarkerMinor','borderLeftWidth')+
this.styleValue('MarkerMinor','width')+
this.styleValue('MarkerMinor','borderRightWidth'))/2;this.dxBar=(this.styleValue('Bar','borderLeftWidth')+
this.styleValue('Bar','borderRightWidth'))/2;this.dxBarAlt=(this.styleValue('BarAlt','borderLeftWidth')+
this.styleValue('BarAlt','borderRightWidth'))/2;this.dxNumbersBox=this.styleValue('NumbersBox','width')/2;var classNames=['Bar','BarAlt','MarkerMajor','MarkerMinor'];if(this.singleLine){classNames.push('LabelBoxSingleLine');}else{classNames.push('NumbersBox','LabelBox');}
var vertDisp=0;for(var classIndex=0;classIndex<classNames.length;++classIndex){var cls=classNames[classIndex];vertDisp=Math.max(vertDisp,this.styleValue(cls,'top')+this.styleValue(cls,'height'));}
this.element.style.height=vertDisp+'px';this.xOffsetSingleLine=this.styleValue('LabelBoxSingleLine','width')+
this.styleValue('LabelBoxSingleLine','left');this.div.appendChild(this.element);this.map.events.register('moveend',this,this.onMoveend);this.update();return this.div;},onMoveend:function(){this.update();},update:function(scale){if(this.map.baseLayer==null||!this.map.getScale()){return;}
this.scale=(scale!=undefined)?scale:this.map.getScale();this.element.title=this.scaleText+OpenLayers.Number.format(this.scale);this.element.style.width=this.maxWidth+'px';var comp=this.getComp();this.setSubProps(comp);this.labelContainer.innerHTML="";this.graphicsContainer.innerHTML="";this.numbersContainer.innerHTML="";var numDiv=this.divisions*this.subdivisions;var alignmentOffset={left:0+(this.singleLine?0:this.dxNumbersBox),center:(this.maxWidth/2)-
(numDiv*this.subProps.pixels/2)-
(this.singleLine?this.xOffsetSingleLine/2:0),right:this.maxWidth-
(numDiv*this.subProps.pixels)-
(this.singleLine?this.xOffsetSingleLine:this.dxNumbersBox)}
var xPos,measure,divNum,cls,left;for(var di=0;di<this.divisions;++di){xPos=di*this.subdivisions*this.subProps.pixels+
alignmentOffset[this.align];this.graphicsContainer.appendChild(this.createElement("MarkerMajor"," ",xPos-this.dxMarkerMajor));if(!this.singleLine){measure=(di==0)?0:OpenLayers.Number.format((di*this.subdivisions)*this.subProps.length,this.subProps.dec,this.thousandsSeparator);this.numbersContainer.appendChild(this.createElement("NumbersBox",measure,xPos-this.dxNumbersBox));}
for(var si=0;si<this.subdivisions;++si){if((si%2)==0){cls="Bar";left=xPos-this.dxBar;}else{cls="BarAlt";left=xPos-this.dxBarAlt;}
this.graphicsContainer.appendChild(this.createElement(cls," ",left,this.subProps.pixels));if(si<this.subdivisions-1){divNum=(di*this.subdivisions)+si+1;xPos=divNum*this.subProps.pixels+
alignmentOffset[this.align];this.graphicsContainer.appendChild(this.createElement("MarkerMinor"," ",xPos-this.dxMarkerMinor));if(this.showMinorMeasures&&!this.singleLine){measure=divNum*this.subProps.length;this.numbersContainer.appendChild(this.createElement("NumbersBox",measure,xPos-this.dxNumbersBox));}}}}
xPos=numDiv*this.subProps.pixels;xPos+=alignmentOffset[this.align];this.graphicsContainer.appendChild(this.createElement("MarkerMajor"," ",xPos-this.dxMarkerMajor));measure=OpenLayers.Number.format(numDiv*this.subProps.length,this.subProps.dec,this.thousandsSeparator);if(!this.singleLine){this.numbersContainer.appendChild(this.createElement("NumbersBox",measure,xPos-this.dxNumbersBox));}
var labelBox=document.createElement('div');labelBox.style.position='absolute';var labelText;if(this.singleLine){labelText=measure;labelBox.className=this.displayClass+'LabelBoxSingleLine';labelBox.style.left=Math.round(xPos+this.styleValue('LabelBoxSingleLine','left'))+'px';}else{labelText='';labelBox.className=this.displayClass+'LabelBox';labelBox.style.textAlign='center';labelBox.style.width=Math.round(numDiv*this.subProps.pixels)+'px'
labelBox.style.left=Math.round(alignmentOffset[this.align])+'px';labelBox.style.overflow='hidden';}
if(this.abbreviateLabel){labelText+=' '+this.subProps.abbr;}else{labelText+=' '+this.subProps.units;}
labelBox.appendChild(document.createTextNode(labelText));this.labelContainer.appendChild(labelBox);},createElement:function(cls,text,left,width){var element=document.createElement("div");element.className=this.displayClass+cls;OpenLayers.Util.extend(element.style,{position:"absolute",textAlign:"center",overflow:"hidden",left:Math.round(left)+"px"});element.appendChild(document.createTextNode(text));if(width){element.style.width=Math.round(width)+"px";}
return element;},getComp:function(){var system=this.measurementProperties[this.displaySystem];var numUnits=system.units.length;var comp=new Array(numUnits);var numDiv=this.divisions*this.subdivisions;for(var unitIndex=0;unitIndex<numUnits;++unitIndex){comp[unitIndex]={};var ppdu=OpenLayers.DOTS_PER_INCH*system.inches[unitIndex]/this.scale;var minSDDisplayLength=((this.minWidth-this.dxNumbersBox)/ppdu)/numDiv;var maxSDDisplayLength=((this.maxWidth-this.dxNumbersBox)/ppdu)/numDiv;for(var vi=0;vi<numDiv;++vi){var minNumber=minSDDisplayLength*(vi+1);var maxNumber=maxSDDisplayLength*(vi+1);var num=this.getHandsomeNumber(minNumber,maxNumber);var compNum={value:(num.value/(vi+1)),score:0,tie:0,dec:0,displayed:0};for(var vi2=0;vi2<numDiv;++vi2){var position=num.value*(vi2+1)/(vi+1);var num2=this.getHandsomeNumber(position,position);var major=((vi2+1)%this.subdivisions==0);var last=((vi2+1)==numDiv);if((this.singleLine&&last)||(!this.singleLine&&(major||this.showMinorMeasures))){compNum.score+=num2.score;compNum.tie+=num2.tie;compNum.dec=Math.max(compNum.dec,num2.dec);compNum.displayed+=1;}else{compNum.score+=num2.score/this.subdivisions;compNum.tie+=num2.tie/this.subdivisions;}}
compNum.score*=(unitIndex+1)*compNum.tie/compNum.displayed;comp[unitIndex][vi]=compNum;}}
return comp;},setSubProps:function(comp){var system=this.measurementProperties[this.displaySystem];var score=Number.POSITIVE_INFINITY;var tie=Number.POSITIVE_INFINITY;for(var unitIndex=0;unitIndex<comp.length;++unitIndex){var ppdu=OpenLayers.DOTS_PER_INCH*system.inches[unitIndex]/this.scale;for(var vi in comp[unitIndex]){var compNum=comp[unitIndex][vi];if((compNum.score<score)||((compNum.score==score)&&(compNum.tie<tie))){this.subProps={length:compNum.value,pixels:ppdu*compNum.value,units:system.units[unitIndex],abbr:system.abbr[unitIndex],dec:compNum.dec};score=compNum.score;tie=compNum.tie;}}}},styleValue:function(selector,key){var value=0;if(this.limitedStyle){value=this.appliedStyles[selector][key];}else{selector="."+this.displayClass+selector;rules:for(var i=document.styleSheets.length-1;i>=0;--i){var sheet=document.styleSheets[i];if(!sheet.disabled){var allRules;try{if(typeof(sheet.cssRules)=='undefined'){if(typeof(sheet.rules)=='undefined'){continue;}else{allRules=sheet.rules;}}else{allRules=sheet.cssRules;}}catch(err){continue;}
if(allRules){for(var ruleIndex=0;ruleIndex<allRules.length;++ruleIndex){var rule=allRules[ruleIndex];if(rule.selectorText&&(rule.selectorText.toLowerCase()==selector.toLowerCase())){if(rule.style[key]!=''){value=parseInt(rule.style[key]);break rules;}}}}}}}
return value?value:0;},getHandsomeNumber:function(small,big,sigFigs){sigFigs=(sigFigs==null)?10:sigFigs;var num={value:small,score:Number.POSITIVE_INFINITY,tie:Number.POSITIVE_INFINITY,dec:3};var cmult,max,dec,tmult,multiplier,score,tie;for(var hexp=0;hexp<3;++hexp){cmult=Math.pow(2,(-1*hexp));max=Math.floor(Math.log(big/cmult)/Math.LN10);for(var texp=max;texp>(max-sigFigs+1);--texp){dec=Math.max(hexp-texp,0);tmult=cmult*Math.pow(10,texp);if((tmult*Math.floor(big/tmult))>=small){if(small%tmult==0){multiplier=small/tmult;}else{multiplier=Math.floor(small/tmult)+1;}
score=multiplier+(2*hexp);tie=(texp<0)?(Math.abs(texp)+1):texp;if((score<num.score)||((score==num.score)&&(tie<num.tie))){num.value=parseFloat((tmult*multiplier).toFixed(dec));num.score=score;num.tie=tie;num.dec=dec;}}}}
return num;},CLASS_NAME:"OpenLayers.Control.ScaleBar"});Ext.namespace('GisArts');GisArts.BestemmingsplanPanel=function(config){Ext.apply(this,config);GisArts.BestemmingsplanPanel.superclass.constructor.call(this);};Ext.extend(GisArts.BestemmingsplanPanel,Ext.Panel,{layer:null,feature:null,button:null,showFeatureButton:true,initComponent:function(){this.headerWritten=false;GisArts.BestemmingsplanPanel.superclass.initComponent.call(this);this.border=false;this.layout='hbox';this.layoutConfig={align:'stretch'};if(this.showFeatureButton===true){this.buttonPanel=new Ext.Panel({width:25,border:false});}
this.contentPanel=new Ext.Panel({flex:1,autoScroll:true,border:false});this.add(this.contentPanel);if(this.buttonPanel){this.add(this.buttonPanel);}},initLayer:function(){if(this.layer==null){this.layer=new OpenLayers.Layer.Vector('',{style:{fillColor:"red",fillOpacity:0.5,outlineColor:"red"}});GisArts.app.map.addLayer(this.layer);}},setFeature:function(feature){this.initLayer();this.feature=feature;if(this.template){this.template.append(this.contentPanel.body,feature.attributes);}else{if(this.headerTemplate&&this.headerWritten===false){this.headerTemplate.append(this.contentPanel.body,feature.attributes);this.headerWritten=true;}
if(this.featureTemplate){this.featureTemplate.append(this.contentPanel.body,feature.attributes);}}
if(this.buttonPanel){if(this.button===null){this.button=new Ext.Toolbar.Button({tooltip:{title:OpenLayers.i18n('gisarts.bpfinder.title'),text:OpenLayers.i18n('gisarts.bpfinder.text')},iconCls:'searcher',listeners:{'mouseout':{fn:this.hideFeature,scope:this},'mouseover':{fn:this.showFeature,scope:this}}});this.button.render(this.buttonPanel.body);}
this.button.setVisible(true);}},clear:function(){this.contentPanel.body.update('');if(this.button){this.button.setVisible(false);}
this.headerWritten=false;},showFeature:function(){this.layer.addFeatures([this.feature]);},hideFeature:function(){this.layer.removeFeatures([this.feature]);}});Ext.reg('bppanel',GisArts.BestemmingsplanPanel);OpenLayers.Control.ArgParser.prototype.setMap=function(map){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var i=0,len=this.map.controls.length;i<len;i++){var control=this.map.controls[i];if((control!=this)&&(control.CLASS_NAME=="OpenLayers.Control.ArgParser")){if(control.displayProjection!=this.displayProjection){this.displayProjection=control.displayProjection;}
break;}}
if(i==this.map.controls.length){var args=this.getParameters();if(args.layers){this.layers=args.layers;this.map.events.register('addlayer',this,this.configureLayers);this.configureLayers();}
if(args.lat&&args.lon){this.center=new OpenLayers.LonLat(parseFloat(args.lon),parseFloat(args.lat));if(args.zoom){this.zoom=parseFloat(args.zoom);}
this.map.events.register('changebaselayer',this,this.setCenter);this.setCenter();}}};GisArts.Control.Permalink=OpenLayers.Class(OpenLayers.Control.Permalink,{createParams:function(center,zoom,layers){var params=OpenLayers.Control.Permalink.prototype.createParams.apply(this,arguments);delete params.layers;return params;},CLASS_NAME:"GisArts.Control.Permalink"});Ext.namespace('GisArts');GisArts.LayerTree=function(config){Ext.apply(this,config);GisArts.LayerTree.superclass.constructor.call(this);};Ext.extend(GisArts.LayerTree,mapfish.widgets.LayerTree,{initComponent:function(){GisArts.LayerTree.superclass.initComponent.call(this);this.animate=false;this.map.events.register("zoomend",this,this.setOutOfScale);},setOutOfScale:function(){var scale=this.map.getScale();this.getRootNode().cascade(function(node){if(node.attributes.minScale||node.attributes.maxScale){if(node.attributes.maxScale>scale){if(node.ui&&node.ui.anchor){Ext.get(node.ui.anchor).removeClass('layeroutofscale');}}else{if(node.ui&&node.ui.anchor){Ext.get(node.ui.anchor).addClass('layeroutofscale');}}}});},onDestroy:function(){this.map.events.unregister("zoomend",this,this.setOutOfScale);GisArts.LayerTree.superclass.onDestroy.call(this);}});Ext.reg('gisartslayertree',GisArts.LayerTree);Ext.namespace('GisArts','GisArts.data');GisArts.data.WFSStore=function(c){GisArts.data.WFSStore.superclass.constructor.call(this,Ext.apply(c,{proxy:!c.data?(!c.xmlData?new Ext.data.HttpProxy({method:'GET',url:c.url}):new Ext.data.HttpProxy({method:'POST',url:c.url,xmlData:c.xmlData})):undefined,reader:new GisArts.data.WFSReader(c,c.fields)}));};Ext.extend(GisArts.data.WFSStore,Ext.data.Store);if(!window.GisArts){window.GisArts={};};if(!GisArts.Control){GisArts.Control={};};GisArts.Control.CursorPos=OpenLayers.Class(OpenLayers.Control.MousePosition,{xelement:null,yelement:null,initialize:function(options){OpenLayers.Control.MousePosition.prototype.initialize.apply(this,arguments);},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.redraw();},redraw:function(evt){var lonLat;if(evt==null){lonLat=new OpenLayers.LonLat(0,0);}else{if(this.lastXy==null||Math.abs(evt.xy.x-this.lastXy.x)>this.granularity||Math.abs(evt.xy.y-this.lastXy.y)>this.granularity)
{this.lastXy=evt.xy;return;}
lonLat=this.map.getLonLatFromPixel(evt.xy);if(!lonLat){return;}
this.lastXy=evt.xy;}
if(this.xelement){this.xelement.value=lonLat.lon.toFixed(this.numdigits);}
if(this.yelement){this.yelement.value=lonLat.lat.toFixed(this.numdigits);}},CLASS_NAME:"GisArts.Control.CursorPos"});if(!window.GisArts){window.GisArts={};}
if(!GisArts.Control){GisArts.Control={};}
GisArts.Control.CycloScope=OpenLayers.Class(GisArts.Control.FeatureInfo,{layer:null,imageField:null,initialize:function(options){this.EVENT_TYPES=GisArts.Control.FeatureInfo.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,arguments);this.handler=new OpenLayers.Handler.Click(this,OpenLayers.Util.extend({click:this.click},this.callbacks));},activate:function(){return OpenLayers.Control.prototype.activate.apply(this,arguments);},deactivate:function(){this.removeMarker();return OpenLayers.Control.prototype.deactivate.apply(this,arguments);},click:function(evt){var triggered=false;this.numVisibleLayers=1;this.counter=0;this.start();this.location=this.map.getLonLatFromPixel(evt.xy);if(!triggered){this.events.triggerEvent('featureinfostart');triggered=true;}
this.performRequest(this.layer,evt);},showRecordings:function(){var gs=this.getGlobeSpotter();if(gs!==null&&gs.showRecordingLocations){gs.showRecordingLocations("Recording locations");}},getGlobeSpotter:function(){if(Ext.get("cycloscope")&&Ext.get("cycloscope").get("globespotterswf")){return Ext.get("cycloscope").get("globespotterswf").dom;}else{return null;}},end:function(){var feature;if(this.featurelist&&this.featurelist[0]){feature=this.featurelist[0].features[0];}
if(feature&&feature.attributes[this.imageField]){if(this.markerLayer){this.feature=new OpenLayers.Feature(this.markerLayer,this.location,{icon:this.icon});this.marker=this.feature.createMarker();this.markerLayer.clearMarkers();this.markerLayer.addMarker(this.marker);}
var url="../shared/cycloscope.php?imageid="+feature.attributes[this.imageField];if(this.popup){this.popup.close();}
this.popup=new Ext.Window({title:"Cycloscope",constrain:true,width:1000,height:Math.min(750,Ext.get(document.body).getHeight()-150),layout:"fit",items:[{xtype:'iframepanel',frameConfig:{id:"cycloscope"},closable:false,loadmask:true,defaultSrc:url}]});this.popup.show();}
this.events.triggerEvent('featureinfoend',{featurelist:null});},removeMarker:function(){if(this.markerLayer){this.markerLayer.clearMarkers();}},CLASS_NAME:"GisArts.Control.CycloScope"});Ext.ux.GridPrinter={print:function(grid){var columns=grid.getColumnModel().config;var data=[];grid.store.data.each(function(item){var convertedData=[];for(var key in item.data){var value=item.data[key];Ext.each(columns,function(column){if(column.dataIndex==key){convertedData[key]=column.renderer?column.renderer(value):value;}},this);}
data.push(convertedData);});var headings=Ext.ux.GridPrinter.headerTpl.apply(columns);var body=Ext.ux.GridPrinter.bodyTpl.apply(columns);var html=new Ext.XTemplate('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">','<html>','<head>','<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />','<link href="'+Ext.ux.GridPrinter.stylesheetPath+'" rel="stylesheet" type="text/css" media="screen,print" />','<title>Administratieve print</title>','</head>','<body>','<table>',headings,'<tpl for=".">',body,'</tpl>','</table>','</body>','</html>').apply(data);var win=window.open('','printgrid');win.document.write(html);win.print();win.close();},stylesheetPath:'/stylesheets/print.css',headerTpl:new Ext.XTemplate('<tr>','<tpl for=".">','<th>{header}</th>','</tpl>','</tr>'),bodyTpl:new Ext.XTemplate('<tr>','<tpl for=".">','<td>\{{dataIndex}\}</td>','</tpl>','</tr>')};Ext.namespace('GisArts','GisArts.grid');GisArts.grid.FeatureGrid=function(config){delete config.autoWidth;delete config.autoHeight;config.autoScroll=true;Ext.apply(this,config);GisArts.grid.FeatureGrid.superclass.constructor.call(this);};Ext.extend(GisArts.grid.FeatureGrid,Ext.grid.GridPanel,{noZoom:true,initComponent:function(){this.sm=new Ext.grid.RowSelectionModel({singleSelect:true,listeners:{'selectionchange':{fn:this.zoomToResult,scope:this}}});GisArts.grid.FeatureGrid.superclass.initComponent.call(this);},zoomToResult:function(sm){var selRecord=sm.getSelected();if(selRecord){var feature=selRecord.get('feature');var buffer;if(feature.geometry instanceof OpenLayers.Geometry.Point){buffer=50;}else{buffer=5;}
var bbox=feature.geometry.getBounds();bbox.left=bbox.left-buffer;bbox.bottom=bbox.bottom-buffer;bbox.right=bbox.right+buffer;bbox.top=bbox.top+buffer;var layer=GisArts.app.hover;if(this.feature){layer.drawFeature(this.feature,"default");}
layer.drawFeature(feature,"select");this.feature=feature;if(!this.noZoom&&GisArts.app&&GisArts.app.map){GisArts.app.map.zoomToExtent(bbox);}}}});Ext.reg('featuregrid',GisArts.grid.FeatureGrid);Ext.namespace('GisArts');GisArts.ScaleField=function(config){Ext.apply(this,config);GisArts.ScaleField.superclass.constructor.call(this);};Ext.extend(GisArts.ScaleField,Ext.form.Field,{map:null,initComponent:function(){GisArts.ScaleField.superclass.initComponent.call(this);this.setValue(this.map.getScale().toFixed(0));this.map.events.register('moveend',this,this.updateScale);var handlers={specialkey:function(f,e){if(e.getKey()==e.ENTER){this.map.zoomToScale(this.getValue(),true);}}};this.on(handlers);},updateScale:function(){var scale=this.map.getScale();this.setValue(scale.toFixed(0));},onDestroy:function(){this.map.events.unregister("moveend",this,this.updateScale);GisArts.ScaleField.superclass.onDestroy.call(this);}});Ext.reg('gisartsscalefield',GisArts.ScaleField);if(!window.GisArts){window.GisArts={};};if(!GisArts.Control){GisArts.Control={};};GisArts.Control.ZoomWheel=OpenLayers.Class(OpenLayers.Control,{wheelChange:OpenLayers.Control.Navigation.prototype.wheelChange,draw:function(){this.handler=new OpenLayers.Handler.MouseWheel(this,{'up':OpenLayers.Control.Navigation.prototype.wheelUp,'down':OpenLayers.Control.Navigation.prototype.wheelDown});this.activate();},CLASS_NAME:"GisArts.Control.ZoomWheel"});

