function aedPlugin(clientCore)
{this.autoRefresh=true;this.clientCore=clientCore;this.editEnabled=false;this.addFeatureId=0;this.zoomToRange=0.01;this.addNewProject=false;this.lastMarkerData=0;this.showEditForm=1;this.language='nl';this.zoomLevel=0;this.refreshInterval=500;this.minZoomLevelObjects=0;var myself=this;this.clientCore.addEventListener("featureAdded",function(d){myself._featureAdded(d);});this.clientCore.addEventListener("featureSelected",function(d){myself._featureSelected(d);});this.clientCore.addEventListener("loaded",function(d){myself._loaded();});this.clientCore.addEventListener("featureUpdated",function(d){myself._featureUpdated(d);});this.clientCore.addEventListener("placemarkClicked",function(d){myself._placemarkClicked(d);});this.clientCore.addEventListener("setResultActive",function(d){myself._setResultActive(d);});this.clientCore.addEventListener("moveViewExtent",function(d){myself._moveViewExtent(d);});this._loaded=function()
{this.clientCore.callPlugin("aed:enableRefresh");this.clientCore.callPlugin(this.pluginName+':reShowList');var myself=this;var gmap=this.clientCore.googlemapsPlugin.getMapObject();GEvent.addListener(gmap,"dragend",function(){myself._dragEnd();})
GEvent.addListener(gmap,"zoomend",function(o,n){myself._zoomEnd(o,n);})
var gmap=myself.clientCore.googlemapsPlugin.getMapObject();this.clientCore.callPlugin('aed:setZoom',gmap.getZoom());}
this.setLanguage=function(language){this.language=language;}
this._moveViewExtent=function(eventData)
{if(eventData.pluginName=='googlegeocoder'||eventData.pluginName=='aed'){this._refresh();}}
this.moveExtent=function(north,west,south,east)
{this.clientCore.closeInfoWindow();this.clientCore.moveViewExtent(this.pluginName,north,west,south,east,10,100,10);}
this._dragEnd=function()
{if(this.clientCore.isProcessingResponse()){return;}
this._refresh();}
this._zoomEnd=function(oldLevel,newLevel)
{this.zoomLevel=newLevel;if(newLevel>this.minZoomLevelObjects){this._refresh();}}
this._refresh=function()
{if(this.autoRefresh==false){return;}
if(this.zoomLevel>=this.minZoomLevelObjects){if(this.updateTimeout){clearTimeout(this.updateTimeout);this.updateTimeout=null;}
var myself=this;this.updateTimeout=setTimeout(function(){var gmap=myself.clientCore.googlemapsPlugin.getMapObject();mapExtent=myself.clientCore.getExtent();this.extent=new Array();this.extent[0]=new Array(mapExtent.west,mapExtent.north);this.extent[1]=new Array(mapExtent.east,mapExtent.north);this.extent[2]=new Array(mapExtent.east,mapExtent.south);this.extent[3]=new Array(mapExtent.west,mapExtent.south);this.extent[4]=new Array(mapExtent.west,mapExtent.north);myself.clientCore.callPlugin('aed:refresh',gmap.getZoom(),this.extent);this.updateTimeout=null;},750);}}
this.searchMeldAddress=function(form)
{var arTexts={nl:{emptyValue:'Straatnaam, plaats of postcode',message:'Er is geen adres ingevuld, vul alstublieft een adres in.'},en:{emptyValue:'Street, place or postal code',message:'No address given. Please enter an address'}}
var arText=arTexts[this.language];if(form.meldaddress.value==arText['emptyValue']||form.meldaddress.value==''){alert(arText['message']);return false;}
var address=form.meldaddress.value;this.clientCore.callPlugin('aed:prepareShowEdit',address);}
this.setPageOrSort=function(searchString,searchBy,search_time_from,search_time_to,page,sortBy)
{this.clientCore.callPlugin(this.pluginName+':searchAEDsList',searchString,searchBy,search_time_from,search_time_to,page,sortBy);}
this.setPageOrSortReShow=function(tabs,param1,param2,page,sortBy,type,tab3)
{this.clientCore.callPlugin(this.pluginName+':reShowList',tabs,param1,param2,page,sortBy,type,tab3);}
this.searchAEDs=function(form)
{var address=form.address.isLabel?'':form.address.value;var searchString=form.address.isLabel?'':form.address.value;var searchBy=form.searchBy.isLabel?'':form.searchBy.value;var search_time_from=form.search_time_from.isLabel?'':form.search_time_from.value;var search_time_to=form.search_time_to.isLabel?'':form.search_time_to.value;var orderby='name';if(form.orderby){var orderby=form.orderby.isLabel?'':form.orderby.value;}
this.clientCore.callPlugin(this.pluginName+':searchAEDsList',searchString,searchBy,search_time_from,search_time_to,0,orderby);}
this.login=function()
{var graphicsUrl='moduleplugins/login/graphics';this.clientCore.callPlugin('login:showLoginDiv',null);}
this.showDelete=function(id)
{var arTexts={nl:{confirm:'Weet u zeker dat u deze AED wilt verwijderen?'},en:{confirm:'Are you sure you want to delete this AED?'}}
var arText=arTexts[this.language];this.clientCore.closeInfoWindow();if(!confirm(arText['confirm'])){return;}
this.clientCore.callPlugin(this.pluginName+':doDelete',id);}
this.cancelEdit=function()
{this.clientCore.closeInfoWindow();if(this.addFeatureId!=0){this.clientCore.removePlacemark(this.pluginName,this.addFeatureId);}}
this.doAddFeature=function(id,form)
{if(id==0){id=this.addFeatureId;}
var formId=maxDom.getElementId(form);var formValues=maxDomForm.getFormValues(form);this.addFeatureId=0;}
this.doEditApproved=function(id,approved)
{this.clientCore.callPlugin(this.pluginName+':doEditApproved',id,approved);this.autoRefresh=true;this.clientCore.callPlugin("aed:enableRefresh");}
this.showDisclaimer=function()
{this.clientCore.callPlugin(this.pluginName+':showDisclaimer',null);}
this.showContactForm=function()
{this.clientCore.callPlugin(this.pluginName+':showContactForm',null);}
this.showInfo=function()
{this.clientCore.callPlugin(this.pluginName+':showInfo',null);}
this.showCredits=function()
{this.clientCore.callPlugin(this.pluginName+':showCredits',null);}
this.doContactForm=function(form)
{form=maxDomForm.getFormValues(form);this.clientCore.callPlugin(this.pluginName+':doContactForm',form);}
this.doEditApprovedMany=function(form)
{var formValues=new Array();formValues=maxDomForm.getFormValues(form);this.clientCore.callPlugin(this.pluginName+':doEditApprovedMany',formValues);this.autoRefresh=true;this.clientCore.callPlugin("aed:enableRefresh");}
this.doEditSuccess=function(html)
{this.addFeatureId=0;}
this.forwardSetMode=function(type)
{this.addNewProject=false;switch(type){case'aedAdd':return this.clientCore.callPlotterSetModeAddPoint(this.pluginName,"default_newAED");case'pointAdd':return this.clientCore.callPlotterSetModeAddPoint(this.pluginName,"default");case'lineAdd':return this.clientCore.callPlotterSetModeAddMultiline(this.pluginName,"default");case'polygonAdd':return this.clientCore.callPlotterSetModeAddPolygon(this.pluginName,"default");case'select':return this.clientCore.callPlotterSetModeSelect();case'disabled':return this.clientCore.callPlotterSetModeDisabled();case'lineAddPoint':return this.clientCore.callPlotterSetModeAddPointToMultiline();case'lineDelete':return this.clientCore.callPlotterDeleteSelection();default:alert("De actie kon niet uitgevoerd worden.\nOnbekende bewerking: '"+type+"'");}}
this.hidePlotterControls=function()
{this.forwardSetMode('select');this.clientCore.removeMapControl(this.pluginName,"control");}
this.showDetail=function(id,html,latitude,longitude)
{this.clientCore.openInfoWindow(this.pluginName,html,latitude,longitude);}
this.showEdit=function(id,latitude,longitude,addType,addOrdinates)
{var arTexts={nl:{noGeometry:'Het is niet mogelijk een AED op de kaart te bewerken dat geen punt heeft.',internalError:"interne fout: ongeldige locatie doorgegeven"},en:{noGeometry:'It is not possible to edit an AED on the map without a point',internalError:"internal error: invalid location"}}
var arText=arTexts[this.language];this.clientCore.debug("aedPlugin.showEdit: "+id+", "+latitude+", "+longitude);if(id==0){this.clientCore.callPlugin(this.pluginName+":showAdd");}
else{if(latitude==0||longitude==0){alert(arText['noGeometry']);return;}
if(isNaN(latitude)||isNaN(longitude)){alert(arText['internalError']);return;}
addOrdinatesString=""
if(id<=0){addOrdinatesString=this._ordinatesArrayToString(addOrdinates);}
this.clientCore.callPlugin(this.pluginName+":showEdit",id,latitude,longitude,addType,addOrdinatesString);}}
this._ordinatesArrayToString=function(points)
{var coordinates='';for(var i=0;i<points.length;i++){coordinates+=(i>0?",":"")+points[i].join(" ");}
return coordinates;}
this.routeToPlacemark=function(toAddress,lat,lon,iconType)
{var fromAddress=$('search_address')?$F('search_address'):'';var icon=this.clientCore.googlemapsPlugin.getGIconByType(this.pluginName,iconType);this.clientCore.routePlugin.showForm(toAddress,lon,lat,{toIcon:icon,travelMode:G_TRAVEL_MODE_WALKING,fromAddress:fromAddress});}
this.setEditEnabled=function(editEnabled)
{this.editEnabled=editEnabled;if(editEnabled){this.forwardSetMode('select');}
else{this.forwardSetMode('disabled');}}
this._featureSelected=function(eventData)
{if(eventData.pluginName!=this.pluginName||!this.editEnabled){return;}
if(eventData.featureId<0){return;}
var latlon=eventData.ordinates[0];this.clientCore.callPlugin(this.pluginName+":showDetail",eventData.featureId,latlon);}
this._featureUpdated=function(eventData)
{if(eventData.pluginName!=this.pluginName||!this.editEnabled){return;}
var arTexts={nl:{confirm:"Weet u het zeker dat u de lokatie van deze AED wilt wijzigen?"},en:{confirm:'Are you sure you want to modify the location of this AED?'}}
var arText=arTexts[this.language];if(eventData.featureType=='point'){if(!window.confirm(arText['confirm'])){return;}}
if(eventData.featureId<0){this.clientCore.callPlugin(this.pluginName+":showEdit",eventData.featureId,eventData.ordinates[0][0],eventData.ordinates[0][1]);return;}
var formValues=null;switch(eventData.featureType){case'point':formValues={point:eventData.ordinates[0]};break;case'line':formValues={line:eventData.ordinates};break;case'polygon':formValues={polygon:eventData.ordinates};break;default:break;}
this.clientCore.callPlugin(this.pluginName+":doEdit",eventData.featureId,formValues);}
this._featureAdded=function(eventData)
{if(this.lastMarkerId!=null){this.clientCore.removePlacemark(this.pluginName,this.lastMarkerId);}
if(eventData.pluginName!=this.pluginName||eventData.featureId>=0){return;}
this.forwardSetMode('select');this.hidePlotterControls()
this.addFeatureId=eventData.featureId;this.lastMarkerId=eventData.featureId;var latlon=eventData.ordinates[0];if(eventData.properties.iconType=='default_newAED'&&this.showEditForm==1){this.showEdit(eventData.featureId,latlon[0],latlon[1],eventData.featureType,eventData.ordinates);}
this.showEditForm==1;}
this._setResultActive=function(eventData)
{this._setResultObjectActive(eventData,false);}
this._setResultObjectActive=function(eventData,scroll_to)
{var id=eventData.index;this._clearActivePlacemark();this.selectedPlacemark=id;var listRow=document.getElementById(this.pluginName+'_ItemRow'+id);if(listRow!=null){listRow.oldClassName=listRow.className;listRow.className='active';if(scroll_to==true){listRow.scrollIntoView(true);}}
return true;}
this._placemarkClicked=function(eventData)
{if(eventData.pluginName!=this.pluginName){return;}
if(eventData.index<0){this.clientCore.callPlugin(this.pluginName+":showEdit",eventData.index,eventData.latitude,eventData.longitude);return;}
this._setResultObjectActive(eventData,false);}
this.zoomToPlacemark=function(lat,lon)
{this.clientCore.moveViewExtent(this.pluginName,lat+this.zoomToRange,lon-this.zoomToRange,lat-this.zoomToRange,lon+this.zoomToRange);}
this.showPrintPreview=function(objectId,latitude,longitude)
{var arTexts={nl:{error:"Het afdrukvoorbeeld kan niet geopend worden, dit wordt mogelijk veroorzaakt door een popup blocker"},en:{error:'The print preview page cannot be opened, possibly caused by a popup blocker'}}
var arText=arTexts[this.language];var features=this.clientCore.getDefaultPopupFeatures(null,null,true);var theurl=this.clientCore.getRestUrl(this.pluginName+':showPrintPreview',[this.clientCore.getObjectName(),objectId,latitude,longitude]);var win=window.open(theurl,'Projectenkaart',features);if(win==null){alert(arText['error']);return;}}
this._clearActivePlacemark=function()
{if(this.selectedPlacemark>0){var listRow=document.getElementById(this.pluginName+'_ItemRow'+this.selectedPlacemark);if(listRow){listRow.className=listRow.oldClassName;}}}
this._createLocationMarker=function(iconType,latitude,longitude,showEditForm)
{this.showEditForm=showEditForm;if(iconType==null){var incidentType=this.values[0].incidentType;iconType=this.incidentIconTypes[incidentType];}
this.clientCore.debug("aedplugin._createLocationmarker: creating new marker with plotter import");if(this.lastMarkerId!=null){this.clientCore.removePlacemark(this.pluginName,this.lastMarkerId);}
var id=this.clientCore.generateFeatureId();var feature={featureType:'point',id:id,iconType:iconType,title:"Nieuwe AED",description:"",latitude:latitude,longitude:longitude};this.searchByPoint=false;this.clientCore.callPlotterImport(this.pluginName,[feature]);this.searchByPoint=true;this.lastMarkerId=id;this.lastMarkerData.iconType=iconType;this.lastMarkerData.latitude=latitude;this.lastMarkerData.longitude=longitude;}
this.doUndoApprove=function(ids)
{this.clientCore.callPlugin(this.pluginName+":doUndoApprove",ids);}
this.showOverlayDiv=function(html)
{var overlayDiv=document.getElementById("registerLoginOverlay");maxDom.showElement(overlayDiv);var select_elements=document.getElementsByTagName('select');for(var i=0;i<select_elements.length;i++){var sel=select_elements[i];if(!sel.disabled){sel.style.visibility='hidden';sel.setAttribute('ie6hide','1');}}
overlayDiv.innerHTML=html;overlayDiv.scrollTop=0;}
this.hideOverlayDiv=function()
{var overlayDiv=document.getElementById("registerLoginOverlay");maxDom.hideElement(overlayDiv);var select_elements=document.getElementsByTagName('select');for(var i=0;i<select_elements.length;i++){var sel=select_elements[i];if(sel.getAttribute('ie6hide')=='1'){sel.style.visibility='visible';sel.setAttribute('ie6hide','0');}}
overlayDiv.innerHTML="";}
this.ReShowList=function(tab)
{this.clientCore.callPlugin(this.pluginName+':reShowList',tab);}
this.showProvincesDiv=function(cityID,provinceID)
{this._display("tabProvinces");this.autoRefresh=true;this.clientCore.callPlugin("aed:enableRefresh");this.clientCore.callPlugin(this.pluginName+':reShowList',2,cityID,provinceID);}
this.showGeneralDiv1=function()
{this.autoRefresh=true;this.clientCore.callPlugin("aed:enableRefresh");this._display("tabGeneral");this.clientCore.callPlugin(this.pluginName+":reShowList",1);}
this.resize=function(){}
this.disableRefresh=function()
{this.autoRefresh=false;}
this.enableRefresh=function()
{this.autoRefresh=true;}
this.showGeneralDiv2=function(searchText,searchBy,search_time_from,search_time_to)
{this.autoRefresh=true;this.clientCore.callPlugin("aed:enableRefresh");this._display("tabGeneral");this.clientCore.callPlugin(this.pluginName+':searchAEDsList',searchText,'',searchBy,search_time_from,search_time_to);}
this._display=function(div)
{var tabs=new Array("tabGeneral","tabProvinces","tabNonApproved","tabAllAEDs","tabBeheerders","tabImport");for(i=0;i<tabs.length;i++){var e=document.getElementById(tabs[i]);if(e!=null){e.setAttribute((document.all?"className":"class"),'tab');}}
var e2show=document.getElementById(div);if(e2show!=null){e2show.setAttribute((document.all?"className":"class"),'tab tabActive');}else{alert('Error: div does not exist');}}};function aedaanmeldenPlugin(clientCore)
{this.clientCore=clientCore;this.addFeatureId=0;var myself=this;this.clientCore.addEventListener('loaded',function(d){myself._loaded(d)});}
aedaanmeldenPlugin.prototype._loaded=function(eventData)
{var graphicsUrl='moduleplugins/'+this.pluginName+'/graphics';}
aedaanmeldenPlugin.prototype.aanmelden=function()
{var graphicsUrl='moduleplugins/'+this.pluginName+'/graphics';this.clientCore.callPlugin(this.pluginName+':showAanmeldenDiv',null);}
aedaanmeldenPlugin.prototype.doAanmelden=function(form)
{var loginname=form.loginname.isLabel?'':form.loginname.value;var password=form.password.isLabel?'':form.password.value;var rememberMe=form.loginFormRememberMe.checked;this.clientCore.callPlugin(this.pluginName+':doLogin',loginname,password,rememberMe);}
aedaanmeldenPlugin.prototype.aanmeldenSuccess=function()
{location.href="/index.php";}
aedaanmeldenPlugin.prototype.days_show=function(one_day)
{var element1day=document.getElementById("hours_one_day");var element7days=document.getElementById("hours_7_days");var hours_day=document.getElementById("hours_day");if(one_day==false){maxDom.hideElement(element1day);maxDom.showElement(element7days);hours_day.value='f';}else{maxDom.showElement(element1day);maxDom.hideElement(element7days);hours_day.value='t';}}
aedaanmeldenPlugin.prototype.removeTimeRange=function(id)
{var timeRangeTr=document.getElementById("tr"+id);var timeRangesTable=document.getElementById("timeRangesTable");maxDom.hideElement(timeRangeTr);timeRangesTable.removeChild(timeRangeTr);var number=$("timeRangesTable").childElements();var rowNumbers=number.length-3;if(rowNumbers<=1){$$('.removelink').each(Element.hide);}}
aedaanmeldenPlugin.prototype.newTimeRange=function(id,form)
{var trHolders=document.getElementsByName("timeRangesHolder");if(trHolders.length>=1){$$('.removelink').each(Element.show);}
var temp=$("timeRangesTable").childElements();formValues=maxDomForm.getFormValues('aanmeldContentForm');this.clientCore.callPlugin(this.pluginName+":newTimeRange",id,formValues);}
aedaanmeldenPlugin.prototype.addNewTimeRange=function(html,id)
{$('addNewTimeRange').replace(html);}
aedaanmeldenPlugin.prototype.showOverlayDiv=function(html)
{this.clientCore.createModalDialog(this.pluginName,'meld',html,'100%','50%')
this.clientCore.openModalDialog(this.pluginName,'meld');this.initMap();}
aedaanmeldenPlugin.prototype.hideOverlayDiv=function()
{this.clientCore.closeModalDialog(this.pluginName,'meld');}
aedaanmeldenPlugin.prototype.showOverlayDivAfterMeld=function(html)
{this.hideOverlayDiv(this.pluginName,'meld');var overlayDiv=document.getElementById("registerLoginOverlay");maxDom.showElement(overlayDiv);var select_elements=document.getElementsByTagName('select');for(var i=0;i<select_elements.length;i++){var sel=select_elements[i];if(!sel.disabled){sel.style.visibility='hidden';sel.setAttribute('ie6hide','1');}}
overlayDiv.innerHTML=html;overlayDiv.scrollTop=0;}
aedaanmeldenPlugin.prototype.hideOverlayDivAfterMeld=function()
{var overlayDiv=document.getElementById("registerLoginOverlay");maxDom.hideElement(overlayDiv);var select_elements=document.getElementsByTagName('select');for(var i=0;i<select_elements.length;i++){var sel=select_elements[i];if(sel.getAttribute('ie6hide')=='1'){sel.style.visibility='visible';sel.setAttribute('ie6hide','0');}}
overlayDiv.innerHTML="";}
aedaanmeldenPlugin.prototype.initMap=function(){if(GBrowserIsCompatible()){this.gmap=new GMap2($(this.pluginName+"mapArea"),{size:new GSize(350,300)});this.gmap.enableDoubleClickZoom();this.gmap.enableScrollWheelZoom();this.gmap.addControl(new GSmallMapControl());this.gmap.setCenter(new GLatLng(52.08818,5.30908),6);this.geocoder=new GClientGeocoder();this.icon=this.clientCore.googlemapsPlugin.getGIconByType('aed','default');this.detailMarker=null;this.address=$(this.pluginName+'address');this.postal_code=$(this.pluginName+'postal_code');this.place=$(this.pluginName+'place');this.point=$(this.pluginName+'point');[this.address,this.postal_code,this.place].each(function(element){Event.observe(element,'change',this.geoCode.bindAsEventListener(this));}.bind(this));return true;}else{return false;}}
aedaanmeldenPlugin.prototype.geoCode=function(event){var address=this.address.value+","+this.postal_code.value+" "+
this.place.value+",Nederland";this.geocoder.getLocations(address,GEvent.callback(this,this.foundLocation));}
aedaanmeldenPlugin.prototype.foundLocation=function(result)
{switch(result.Status.code)
{case G_GEO_SUCCESS:var placemarks=result.Placemark;var placemark=placemarks[0];var latlon=placemark.Point.coordinates;var point=new GLatLng(latlon[1],latlon[0]);var zoomLevel=Math.min(8+(placemark.AddressDetails.Accuracy),15);if(this.detailMarker){this.updateMarker(point,zoomLevel);}else{this.createMarker(point,zoomLevel);}
break;default:alert("adres niet gevonden");return}}
aedaanmeldenPlugin.prototype.createMarker=function(latlng,zoomLevel){this.point.value=latlng.lat()+" "+latlng.lng();if(!this.detailMarker){this.detailMarker=new GMarker(latlng,{title:$F(this.address)?$F(this.address):'AED',draggable:true,bouncy:true,clickable:false,icon:this.icon});GEvent.addListener(this.detailMarker,'dragend',GEvent.callback(this,this.updateMarker));this.gmap.setCenter(this.detailMarker.getLatLng(),zoomLevel);this.gmap.addOverlay(this.detailMarker);}else{this.gmap.setCenter(this.detailMarker.getLatLng(),zoomLevel);}}
aedaanmeldenPlugin.prototype.updateMarker=function(latlng,zoomLevel){this.point.value=latlng.lat()+" "+latlng.lng();this.detailMarker.setLatLng(latlng);this.gmap.setCenter(latlng,zoomLevel);}
aedaanmeldenPlugin.prototype.showRetrieve=function()
{this.clientCore.callPlugin(this.pluginName+':showRetrieve');}
aedaanmeldenPlugin.prototype.doRetrieve=function(form)
{var loginname=form.loginname.isLabel?'':form.loginname.value;this.clientCore.callPlugin(this.pluginName+':doRetrieve',loginname);}
aedaanmeldenPlugin.prototype.doEdit=function(id,form)
{if(id==0){id=this.addFeatureId;}
var formValues=new Array();formValues=maxDomForm.getFormValues(form);var formId=maxDom.getElementId(form);this.clientCore.callPluginUpload(this.pluginName+':doEdit',form,id,formValues,formId);}
aedaanmeldenPlugin.prototype.doEditSuccess=function(html)
{var overlayDiv=document.getElementById("registerLoginOverlay");maxDom.showElement(overlayDiv);var select_elements=document.getElementsByTagName('select');for(var i=0;i<select_elements.length;i++){var sel=select_elements[i];if(!sel.disabled){sel.style.visibility='hidden';sel.setAttribute('ie6hide','1');}}
overlayDiv.innerHTML=html;overlayDiv.scrollTop=0;};function csvimportPlugin(clientCore)
{this.clientCore=clientCore;}
csvimportPlugin.prototype.upload=function(form)
{var formValues=maxDomForm.getFormValues(form);this.clientCore.callPluginUpload(this.pluginName+':upload',form,formValues);};function googlegeocoderPlugin(clientCore)
{this.clientCore=clientCore;maxDomForm.initializeLabelFields(this.pluginName+'_geocoderForm');}
googlegeocoderPlugin.prototype.searchAddress=function(form)
{var address=(form.address.isLabel?"":form.address.value);if(address==''){alert("Er is geen adres ingevuld, vul alstublieft een adres in.");return;}
if(form.country.value.length>0){address+=", "+form.country.value;}
this.clientCore.callPlugin('googlegeocoder:searchAddress',address);}
googlegeocoderPlugin.prototype.clear=function(form)
{this.clientCore.removeResult(this.pluginName);maxDomForm.revertLabelField(form.address);};function googlemapsPlugin(clientCore)
{this.clientCore=clientCore;this.gmap=null;this.pluginGraphicsUrl=this.clientCore.getRootUrl()+"/moduleplugins/"+this.pluginName+"/graphics/";this.mapProxyBaseUrl=this.clientCore.getRootUrl()+"/modulecomponents/mapproxy/?"
this.fallbackLineStyle={lineColor:'#ff0000',lineOpacity:1,width:1,fillColor:0,fillOpacity:0};this.language=language?language:'nl';this.features=new Object();this.tileOverlays=new Object();this.visibility=new Object();this.icons=new Object();this.activeIcons=new Object();this.mapControls=new Object();this.activeFeature={pluginName:null,index:null};this.debugLines=new Array();this.mouseDownCallback=null;if(!this._initializeGMap()){return;}
this.dragDropInitialized=false;this._initializeDragDrop();var myself=this;this.clientCore.addEventListener("checkResize",function(d){myself._checkResize();});this.clientCore.addEventListener("closeInfoWindow",function(d){myself._closeInfoWindow(d);});this.clientCore.addEventListener("createPlacemark",function(d){myself._createPlacemark(d);});this.clientCore.addEventListener("createLineString",function(d){myself._createLineString(d);});this.clientCore.addEventListener("createPolygon",function(d){myself._createPolygon(d);});this.clientCore.addEventListener("createMapControl",function(d){myself._createMapControl(d);});this.clientCore.addEventListener("getExtent",function(d){myself._setExtent(d);});this.clientCore.addEventListener("mapLayerAdded",function(d){myself._mapLayerAdded(d);});this.clientCore.addEventListener("mapLayerRemoved",function(d){myself._mapLayerRemoved(d);});this.clientCore.addEventListener("moveView",function(d){myself._moveView(d);});this.clientCore.addEventListener("moveViewExtent",function(d){myself._moveViewExtent(d);});this.clientCore.addEventListener("openMapControl",function(d){myself._openMapControl(d);});this.clientCore.addEventListener("openInfoWindow",function(d){myself._openInfoWindow(d);});this.clientCore.addEventListener("openNotificationWindow",function(d){myself._openNotificationWindow(d);});this.clientCore.addEventListener("updatePlacemark",function(d){myself._updatePlacemark(d);});this.clientCore.addEventListener("updateResultVisibility",function(d){myself._updateResultVisibility(d);});this.clientCore.addEventListener("updateMapLayerVisibility",function(d){myself._updateMapLayerVisibility(d);});this.clientCore.addEventListener("removeMapControl",function(d){myself._removeMapControl(d);});this.clientCore.addEventListener("removeResult",function(d){myself._removeResult(d);});this.clientCore.addEventListener("removeResultType",function(d){myself._removeResultType(d);});this.clientCore.addEventListener("removePlacemark",function(d){myself._removePlacemark(d);});this.clientCore.addEventListener("setResultActive",function(d){myself._setResultActive(d);});this.clientCore.addEventListener("unload",GUnload);this.setLanguage=function(language){this.language=language;}}
googlemapsPlugin.prototype._getIEVersionNumber=function()
{var ua=navigator.userAgent;var MSIEOffset=ua.indexOf("MSIE ");if(MSIEOffset==-1){return 0;}else{return parseFloat(ua.substring(MSIEOffset+5,ua.indexOf(";",MSIEOffset)));}}
googlemapsPlugin.prototype._initializeGMap=function()
{var mapArea=document.getElementById("mapArea");if(mapArea==null){alert("interne fout in googlemapsPlugin: Element 'mapArea' kan niet gevonden worden.");return false;}
if(typeof(GMap2)=="undefined"){var message;switch(this.language){case'en':message="Error retrieving map from Google Maps.";break;default:message="Het kaartmateriaal van Google Maps kan niet opgevraagd worden.";break;}
if(location.protocol=="https:"){if(this._getIEVersionNumber()==8){message+="<br/><br/>Het is mogelijk dat dit onderdeel aangemerkt werd als <em>onveilig item</em>. "
+"Het kaartmateriaal vormt echter geen beveiligingsrisico voor de website. "
+'U kunt de <a href="javascript:location.reload()">pagina herladen</a> en op <em><strong>Nee</strong></em> klikken om dit onbeveiligde onderdeel toe te laten.';}
else{message+="<br/><br/>Het is mogelijk dat dit onderdeel aangemerkt werd als <em>onveilig item</em>. "
+"Het kaartmateriaal vormt echter geen beveiligingsrisico voor de website. "
+'U kunt de <a href="javascript:location.reload()">pagina herladen</a> en op <em><strong>Ja</strong></em> klikken om dit onbeveiligde onderdeel toe te laten.';}}
else{message+="<br/><br/>Dit probleem wordt mogelijk veroorzaakt door een interne fout.";}
this._showInitializeError(message);return false;}
if(!GBrowserIsCompatible()){var message='Het is niet mogelijk om het kaartonderdeel met uw huidige webbrowser te bekijken.<br/><br/>'
+'Om dit onderdeel te bekijken kunt u het beste een moderne webbrowser installeren, zoals <a href="http://www.microsoft.com/windows/products/winfamily/ie/default.mspx" target="_blank">Internet Explorer 7</a> of <a href="http://www.getfirefox.com/">Mozilla Firefox 2</a>. '
+'Open daarna met de ge&iuml;nstalleerde webbrowser de website opnieuw.';this._showInitializeError(message);return false;}
var startExtent=this.clientCore.getStartExtent();if(startExtent==null){alert("interne fout in googlemapsPlugin: het beginpunt van de kaart is niet ingesteld met GeoMaxClientCore.setStartExtent");return false}
this.gmap=new GMap2(mapArea);this.gmap.enableDoubleClickZoom();this.gmap.enableContinuousZoom();this.gmap.enableScrollWheelZoom();var myself=this;var geomaxTileLayer=new GTileLayer(new GCopyrightCollection(""),0,19);geomaxTileLayer.getTileUrl=function(t,z){return myself._getGroundMapLayerTileUrl(this,t,z);};var streetTileLayer=G_HYBRID_MAP.getTileLayers()[1];var normalTileLayer=G_NORMAL_MAP.getTileLayers()[0];this.mapTypes=[];var buttonsTexts={nl:{hybrid:"Combinatie",satellite:"Luchtfoto's",street:"Straten",terrain:"Terrein",labels:"Labels weergeven"},en:{hybrid:"Hybrid",satellite:"Satellite",street:"Streets",terrain:"Terrain",labels:"Display labels"}}
var buttons=buttonsTexts[this.language];this.mapTypes['G_HYBRID_MAP']=new GMapType([geomaxTileLayer,streetTileLayer],G_HYBRID_MAP.getProjection(),buttons['hybrid']);this.mapTypes['G_SATELLITE_MAP']=new GMapType([geomaxTileLayer],G_SATELLITE_MAP.getProjection(),buttons['satellite']);this.mapTypes['G_STREET_MAP']=new GMapType(G_NORMAL_MAP.getTileLayers(),G_NORMAL_MAP.getProjection(),buttons['street']);this.mapTypes['G_TERRAIN_MAP']=new GMapType(G_PHYSICAL_MAP.getTileLayers(),G_PHYSICAL_MAP.getProjection(),buttons['terrain']);this.gmap.getMapTypes().length=0;this.gmap.addMapType(this.mapTypes['G_STREET_MAP']);this.gmap.addMapType(this.mapTypes['G_SATELLITE_MAP']);this.gmap.addMapType(this.mapTypes['G_HYBRID_MAP']);this.gmap.addMapType(this.mapTypes['G_TERRAIN_MAP']);var buttons=new GHierarchicalMapTypeControl();buttons.addRelationship(this.mapTypes['G_SATELLITE_MAP'],this.mapTypes['G_HYBRID_MAP'],buttons['labels'],true);this.gmap.addControl(new GLargeMapControl3D());this.gmap.addControl(buttons);this.gmap.addControl(new GScaleControl());var myself=this;GEvent.addListener(this.gmap,"click",function(o,p){myself._mapClicked(o,p)});var _onMouseWheel=function(e){myself._onMouseWheel(e)};GEvent.addDomListener(mapArea,"DOMMouseScroll",_onMouseWheel);mapArea.onmousewheel=_onMouseWheel;var mapLayers=this.clientCore.getMapLayers();for(var i=0;i<mapLayers.length;i++){this._addGTileLayerOverlay(mapLayers[i]);}
this._applyStartExtent();return true;}
googlemapsPlugin.prototype._initializeDragDrop=function()
{if(this.dragDropInitialized){return true;}
if(!this.clientCore.isDragDropLoaded()){this.clientCore.debug("googlemaps: drag-and-drop support code is not loaded");return false;}
var myself=this;this.clientCore.registerDropTarget('mapArea','dragElement',function(dragElement,dropElement,event){myself._elementDropped(dragElement,dropElement,event);});this.dragDropInitialized=true;return true;}
googlemapsPlugin.prototype._showInitializeError=function(message)
{var xhtml='<div class="googlemaps_ErrorDialog" style="width: 350px; margin: 50px auto 0 auto; padding: 1em; line-height: 120%; border: 1px solid #555; background-color: #eee;">'
+'  <h3>De kaart kan niet weergegeven worden</h3>'
+'  <p>'+message+'</p>'
+'</div>';var mapArea=document.getElementById("mapArea");mapArea.innerHTML=xhtml;}
googlemapsPlugin.prototype.getMapObject=function()
{return this.gmap;}
googlemapsPlugin.prototype.setMapType=function(mapType){if(this.mapTypes[mapType]){this.gmap.setMapType(this.mapTypes[mapType]);}else{this.gmap.setMapType(this.mapTypes['G_HYBRID_MAP']);}}
googlemapsPlugin.prototype.getGIconByType=function(pluginName,iconType,customIconUrl,isActive)
{var iconStyle=this.clientCore.getIconStyle(pluginName,iconType);if(iconStyle==null){return G_DEFAULT_ICON;}
var iconSet=(isActive?this.activeIcons:this.icons);var icon=null;if(iconSet[pluginName]==null){iconSet[pluginName]=new Object();}
if(customIconUrl==null||customIconUrl==""){if(iconSet[pluginName][iconType]!=null){icon=iconSet[pluginName][iconType];}
else{icon=this._createGIcon(iconStyle,null,isActive);iconSet[pluginName][iconType]=icon;}}
else{icon=this._createGIcon(iconStyle,customIconUrl,isActive);}
return icon;}
googlemapsPlugin.prototype._getFeaturePoint=function(features)
{var point=null;var points=[];var verteces=[];for(var i=0;i<features.length;i++){var feature=features[i];if(feature.getPoint){points.push(feature.getPoint());}else{verteces.push(feature.getVertex(0));}}
if(points.length){point=points[0];}else{point=feature.getBounds().getCenter();}
return point;}
googlemapsPlugin.prototype._getFeaturePlacemark=function(features)
{for(var i=0;i<features.length;i++){if(features[i].getPoint){return features[i];}}
return features[0];}
googlemapsPlugin.prototype.getPlacemarkPoint=function(pluginName,index)
{if(this.features[pluginName]==null||this.features[pluginName][index]==null){return null;}
var features=this.features[pluginName][index];var point=this._getFeaturePoint(features);return{latitude:point.lat(),longitude:point.lng()};}
googlemapsPlugin.prototype.checkResize=function()
{if(this.gmap!=null){this.gmap.checkResize();}}
googlemapsPlugin.prototype.drawExtent=function(north,west,south,east,color,width,opacity)
{if(typeof(color)=='undefined'){color='#ffffff';}
if(typeof(width)=='undefined'){width=1;}
if(typeof(opacity)=='undefined'){opacity=1;}
var points=[new GLatLng(north,west),new GLatLng(south,west),new GLatLng(south,east),new GLatLng(north,east),new GLatLng(north,west)];var line=new GPolyline(points,color,width,opacity);this.gmap.addOverlay(line);var id=this.debugLines.length;this.debugLines[id]=line;}
googlemapsPlugin.prototype.removeExtents=function()
{for(var i=0;i<this.debugLines.length;i++){this.gmap.removeOverlay(this.debugLines[i]);}
this.debugLines=new Array();}
googlemapsPlugin.prototype._checkResize=function()
{if(this.gmap==null){return;}
this.gmap.checkResize();if(this.gmap.isLoaded()&&!this.clientCore.isLoaded()){this._applyStartExtent();}}
googlemapsPlugin.prototype._mapClicked=function(feature,point)
{if(point==null){if(typeof(feature._pluginName)=='undefined'){this.clientCore.debug("googlemapsPlugin._mapClicked: clicked on an object without _pluginName property, ignoring event.");return;}
point=(feature.getPoint)?feature.getPoint():feature.getVertex(0);this._setResultActive({pluginName:feature._pluginName,index:feature._index});this.clientCore.placemarkClicked(feature._pluginName,feature._index,point.lat(),point.lng());}
else{var pixel=this.gmap.fromLatLngToDivPixel(point);this.clientCore.mapClicked(point.lat(),point.lng(),pixel.x,pixel.y);}}
googlemapsPlugin.prototype._markerMouseOver=function(pluginName,index)
{if(this.features[pluginName]==null||this.features[pluginName][index]==null){return null;}
this.clientCore.debug("googlemapsPlugin._markerMouseOver: a marker was mouse Overed, fireing event. ");var marker=this._getFeaturePlacemark(this.features[pluginName][index]);var point=marker.getPoint();this.clientCore.placemarkMouseOver(pluginName,marker,index,point.lat(),point.lng());}
googlemapsPlugin.prototype._markerMouseOut=function(pluginName,index)
{if(this.features[pluginName]==null||this.features[pluginName][index]==null){return null;}
this.clientCore.debug("googlemapsPlugin._markerMouseOut: a marker was mouse outted, fireing event. ");var marker=this._getFeaturePlacemark(this.features[pluginName][index]);var point=marker.getPoint();this.clientCore.placemarkMouseOut(pluginName,marker,index,point.lat(),point.lng());}
googlemapsPlugin.prototype._markerDragged=function(pluginName,index)
{if(this.features[pluginName]==null||this.features[pluginName][index]==null){return null;}
this.clientCore.debug("googlemapsPlugin._markerDragged: a marker was dragged, fireing identical event as the plotter does.");var marker=this._getFeaturePlacemark(this.features[pluginName][index]);var point=marker.getPoint();var ordinates=[[point.lat(),point.lng()]];var properties={iconType:marker._iconType,lineType:null};this.clientCore.featureUpdated('point',pluginName,index,ordinates,properties,"userDragEvent");}
googlemapsPlugin.prototype._onMouseWheel=function(event)
{if(!this.gmap.scrollWheelZoomEnabled()){return;}
if(event!=null&&event.preventDefault){event.preventDefault();event.stopPropagation();}
else if(window.event){window.event.returnValue=false;window.event.cancelBubble=true;}}
googlemapsPlugin.prototype._closeInfoWindow=function(eventData)
{this.closeInfoWindowExt();}
googlemapsPlugin.prototype.closeInfoWindowExt=function()
{if(this.clientCore.getCustomInfoWindow()){this.gmap.closeExtInfoWindow();}else{this.gmap.closeInfoWindow();}}
googlemapsPlugin.prototype._createPlacemark=function(eventData)
{var icon=this.getGIconByType(eventData.pluginName,eventData.iconType,eventData.customIconUrl,false);var activeIcon=this.getGIconByType(eventData.pluginName,eventData.iconType,eventData.customActiveIconUrl,true);var zIndex=(eventData.index<0?2:0);var options={title:eventData.title,icon:icon,zIndex:zIndex,draggable:eventData.draggable};var point=new GLatLng(eventData.latitude,eventData.longitude);var marker=new maxGMarker(point,options);marker._title=eventData.title;marker._normalIcon=icon;marker._activeIcon=activeIcon;marker._description=eventData.description;marker._pluginName=eventData.pluginName;marker._index=eventData.index;marker._iconType=eventData.iconType;var pluginName=eventData.pluginName;var index=eventData.index;var myself=this;GEvent.addListener(marker,"mouseover",function(){myself._markerMouseOver(pluginName,index);});GEvent.addListener(marker,"mouseout",function(){myself._markerMouseOut(pluginName,index);});if(eventData.draggable){GEvent.addListener(marker,"dragend",function(){myself._markerDragged(pluginName,index);});marker.enableDragging();}
this.gmap.addOverlay(marker);this._registerFeature(eventData.pluginName,eventData.index,marker);}
googlemapsPlugin.prototype._createLineString=function(eventData)
{var lineStyle=this.clientCore.getLineStyle(eventData.pluginName,eventData.lineType);if(lineStyle==null){lineStyle=this.clientCore.getDefaultLineStyle(eventData.pluginName);if(lineStyle==null){lineStyle=this.fallbackLineStyle;}}
var points=this._ordinatesToGLatLng(eventData.ordinates);var polyline=new GPolyline(points,lineStyle.lineColor,lineStyle.width,lineStyle.lineOpacity);polyline._pluginName=eventData.pluginName;polyline._index=eventData.index;polyline._title=eventData.title;polyline._description=eventData.description
this.gmap.addOverlay(polyline);this._registerFeature(eventData.pluginName,eventData.index,polyline);}
googlemapsPlugin.prototype._createPolygon=function(eventData)
{var lineStyle=this.clientCore.getLineStyle(eventData.pluginName,eventData.lineType);if(lineStyle==null){lineStyle=this.clientCore.getDefaultLineStyle(eventData.pluginName);if(lineStyle==null){lineStyle=this.fallbackLineStyle;}}
var points=this._ordinatesToGLatLng(eventData.ordinates);var polyline=new GPolygon(points,lineStyle.lineColor,lineStyle.width,lineStyle.lineOpacity,lineStyle.fillColor,lineStyle.fillOpacity);polyline._pluginName=eventData.pluginName;polyline._index=eventData.index;polyline._title=eventData.title;polyline._description=eventData.description
this.gmap.addOverlay(polyline);this._registerFeature(eventData.pluginName,eventData.index,polyline);}
googlemapsPlugin.prototype._createMapControl=function(eventData)
{var domElementId="googlemaps__"+eventData.pluginName+"__"+eventData.panelType;var anchorPos=null;var offsetX=eventData.offsetLeft;var offsetY=eventData.offsetTop;if(this.mapControls[eventData.pluginName]==null){this.mapControls[eventData.pluginName]=new Object();}
var htmlControl=this.mapControls[eventData.pluginName][eventData.panelType];if(htmlControl!=null){domElementId=htmlControl.domElementId;var domElement=document.getElementById(domElementId);if(domElement!=null){domElement.innerHTML=eventData.html;}
htmlControl.html=eventData.html;return;}
var left=eventData.left;var top=eventData.top;var toLeft=true;var toTop=true;if(isNaN(left)){left=left.substring(0,left.length-1);toLeft=(isNaN(left)||left<60);}
else{offsetX+=left;}
if(isNaN(top)){top=top.substring(0,top.length-1);toTop=(isNaN(top)||top<60);}
else{offsetY+=top;}
if(toLeft){anchorPos=(toTop?G_ANCHOR_TOP_LEFT:G_ANCHOR_BOTTOM_LEFT);}
else{anchorPos=(toTop?G_ANCHOR_TOP_RIGHT:G_ANCHOR_BOTTOM_RIGHT);}
htmlControl=new GControl();htmlControl.containerId=domElementId;htmlControl.html=eventData.html;htmlControl.anchorPos=anchorPos;htmlControl.offsetX=offsetX;htmlControl.offsetY=offsetY;htmlControl.addedToMap=false;htmlControl.initialize=function(map)
{var container=document.createElement("div");container.id=this.containerId;container.className="googlemaps_htmlControl";container.innerHTML=this.html;map.getContainer().appendChild(container);return container;};htmlControl.getDefaultPosition=function()
{return new GControlPosition(this.anchorPos,new GSize(this.offsetX,this.offsetY));};this.mapControls[eventData.pluginName][eventData.panelType]=htmlControl;this.clientCore.debug("googlemapsPlugin._createMapControl: created map control for plugin "+eventData.pluginName);}
googlemapsPlugin.prototype._elementDropped=function(dragElement,dropElement,event)
{this.clientCore.debug("googlemaps: element dropped, mapping event point to latitude/longitude");var draggedPos=maxDomEvent.getPointerPosition(event);var mapPos=maxDom.getElementPosition(dropElement);var relativeX=draggedPos.x-mapPos.x;var relativeY=draggedPos.y-mapPos.y;var dragCorner=maxDom.getElementPosition(dragElement);var dragMeta=this.clientCore.getDraggableMetaProperties(dragElement);if(dragMeta==null){this.clientCore.debug("googlemaps: unable to find meta properties of draggable element, can't correct anchor position");}
else if(dragMeta.dragType!='placemark'){this.clientCore.debug("googlemaps: unknown dragType '"+dragMeta.dragType+"', can't correct anchor position");}
else{var iconStyle=this.clientCore.getIconStyle(dragMeta.pluginName,dragMeta.iconType);if(iconStyle==null){this.clientCore.debug("googlemaps: unable to find icon style of draggable element, can't correct anchor position");}
else{relativeX=relativeX-(draggedPos.x-dragCorner.x)+iconStyle.iconAnchorPxX;relativeY=relativeY-(draggedPos.y-dragCorner.y)+iconStyle.iconAnchorPxY;}}
var containerPos=new GPoint(relativeX,relativeY);var mapPoint=this.gmap.fromContainerPixelToLatLng(containerPos);this.clientCore.elementDropped('googlemaps',mapPoint.lat(),mapPoint.lng(),dragElement.id);}
googlemapsPlugin.prototype._setExtent=function(eventData)
{var extent=this._getGMapExtent();var margin=this.clientCore.getExtentMargin();if(margin.lon>0||margin.lat>0){var deltaLat=extent.north-extent.south;var deltaLon=extent.east-extent.west;var paddingLat=deltaLat*margin.lat;var paddingLon=deltaLon*margin.lon;extent.north-=paddingLat;extent.south+=paddingLat;extent.west+=paddingLon;extent.east-=paddingLon;}
this.clientCore.setExtent(extent.north,extent.west,extent.south,extent.east);}
googlemapsPlugin.prototype._mapLayerAdded=function(eventData)
{if(eventData.layerType=='overlay'){var mapLayer=this.clientCore.getMapLayer(eventData.pluginName,eventData.layerId);this._addGTileLayerOverlay(mapLayer);}
else{if(eventData.isVisible){this.gmap.setMapType(this.gmap.getCurrentMapType());}}}
googlemapsPlugin.prototype._mapLayerRemoved=function(eventData)
{if(eventData.layerType=='overlay'){var mapLayer=this.clientCore.getMapLayer(eventData.pluginName,eventData.layerId);if(!mapLayer)
return;var propertyId=mapLayer.pluginName+":"+mapLayer.layerId;var tileOverlay=this.tileOverlays[propertyId];if(tileOverlay==null){this.clientCore.debug("googlemapsPlugin._mapLayerRemoved: ignoring event, overlay not found");return;}
this.gmap.removeOverlay(tileOverlay);GEvent.clearInstanceListeners(tileOverlay);delete this.tileOverlays[propertyId];}
else{if(eventData.isVisible){this.gmap.setMapType(this.gmap.getCurrentMapType());}}}
googlemapsPlugin.prototype._moveView=function(eventData)
{this.gmap.panTo(new GLatLng(eventData.latitude,eventData.longitude));}
googlemapsPlugin.prototype._moveViewExtent=function(eventData)
{var margin=this.clientCore.getExtentMargin();var paddingLat=0;var paddingLon=0;if(margin.lon>0||margin.lat>0){var deltaLat=eventData.north-eventData.south;var deltaLon=eventData.east-eventData.west;paddingLat=(deltaLat/(1-margin.lat))-deltaLat;paddingLon=(deltaLon/(1-margin.lon))-deltaLon;}
var bounds=new GLatLngBounds(new GLatLng(eventData.south-paddingLat,eventData.west-paddingLon),new GLatLng(eventData.north+paddingLat,eventData.east+paddingLon));var level=this.gmap.getBoundsZoomLevel(bounds);var center=bounds.getCenter();if(Math.abs(level-this.gmap.getZoom())>1||!this.gmap.isLoaded()||!this.clientCore.isLoaded()){this.gmap.setCenter(center,level);}
else{this.gmap.setZoom(level);this.gmap.panTo(center);}}
googlemapsPlugin.prototype._openInfoWindow=function(eventData)
{var marker=eventData.marker;this.openInfoWindowExt(marker,eventData.html,eventData.latitude,eventData.longitude);}
googlemapsPlugin.prototype.openInfoWindowExt=function(marker,html,latitude,longitude)
{if(this.clientCore.getCustomInfoWindow()){var cssStyle=marker._pluginName+"_window";if(typeof(marker.openExtInfoWindow)=="function"){var options={beakOffset:12,paddingX:40,paddingY:40};if(html.startsWith('http://')){options['ajaxUrl']=html;html='Bezig met laden...';}
marker.openExtInfoWindow(this.gmap,cssStyle,html,options);}
else{this.openInfoWindow(html,latitude,longitude);}}else{this.openInfoWindow(html,latitude,longitude);}}
googlemapsPlugin.prototype.openInfoWindow=function(html,latitude,longitude)
{var newPoint=new GLatLng(latitude,longitude);html='<div id="googlemapsPluginInfoWindow" style="overflow: hidden; background-color: #fff">'+html+'</div>';this.gmap.openInfoWindowHtml(newPoint,html);}
googlemapsPlugin.prototype._openNotificationWindow=function(eventData)
{var notificationWindow=document.getElementById('googlemapsPluginNotificationWindow');if(notificationWindow==null){alert("interne fout in googlemapsPlugin._openNotificationWindow: page element not found");return;}
var title=eventData.title;var html=eventData.html;if(title!=null&&title!=''){var title=title.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');html='<h1>'+title+'</h1>'+html;}
notificationWindow.innerHTML=html;maxDom.showElement(notificationWindow);setTimeout("maxDom.hideElement('googlemapsPluginNotificationWindow')",3000);}
googlemapsPlugin.prototype._openMapControl=function(eventData)
{if(this.mapControls[eventData.pluginName]==null||this.mapControls[eventData.pluginName][eventData.panelType]==null){alert("interne fout in googlemapsPlugin._openMapControl: plugin '"+eventData.pluginName+"' heeft geen '"+eventData.panelType+"' control.");return;}
var htmlControl=this.mapControls[eventData.pluginName][eventData.panelType];if(!htmlControl.addedToMap){htmlControl.addedToMap=true;this.gmap.addControl(htmlControl);this.clientCore.debug("googlemapsPlugin._openMapControl: added control to map for plugin "+eventData.pluginName);}}
googlemapsPlugin.prototype._updatePlacemark=function(eventData)
{if(this.features[eventData.pluginName]==null||this.features[eventData.pluginName][eventData.index]==null){this.clientCore.debug("googlemapsPlugin._updatePlacemark: ignoring event, placemark not found");return;}
var marker=this._getFeaturePlacemark(this.features[eventData.pluginName][eventData.index]);if(eventData.title!=null){marker._title=eventData.title;marker.setTitle(eventData.title);}
if(eventData.description!=null){marker._description=eventData.description;}
if(eventData.latitude!=null||eventData.longitude!=null){marker.setPoint(new GLatLng(eventData.latitude,eventData.longitude));}
if(eventData.draggable!=null){if(eventData.draggable){marker.enableDragging();}
else{marker.disableDragging();}}
var iconType=eventData.iconType!=null?eventData.iconType:marker._iconType;var isActive=(this.activeFeature.pluginName==eventData.pluginName&&this.activeFeature.index==eventData.index);if(eventData.iconType!=null||eventData.customIconUrl!=null){marker._normalIcon=this.getGIconByType(eventData.pluginName,iconType,eventData.customIconUrl,false);if(!isActive){marker.setIcon(marker._normalIcon);}}
if(eventData.iconType!=null||eventData.customActiveIconUrl!=null){marker._activeIcon=this.getGIconByType(eventData.pluginName,iconType,eventData.customActiveIconUrl,true);if(isActive){marker.setIcon(marker._activeIcon);}}
var infoWindow=this.gmap.getInfoWindow();if(isActive&&infoWindow!=null&&!infoWindow.isHidden()){var point=marker.getPoint();this.closeInfoWindowExt();if(marker._description.length>0){this.openInfoWindowExt(marker,marker._description,point.lat(),point.lng());}}}
googlemapsPlugin.prototype._updateResultVisibility=function(eventData)
{if(this.features[eventData.pluginName]==null){return;}
var show=eventData.isVisible;var features=this.features[eventData.pluginName];for(var index in features){if(typeof(features[index])=='function'){continue;}
if(show){this._addGOverlay(eventData.pluginName,index);}
else{this._removeGOverlay(eventData.pluginName,index);}
this.visibility[eventData.pluginName][index]=show;}}
googlemapsPlugin.prototype._updateMapLayerVisibility=function(eventData)
{var mapLayer=this.clientCore.getMapLayer(eventData.pluginName,eventData.layerId);if(mapLayer==null){this.clientCore.debug("googlemapsPlugin._updateMapLayerVisibility: ignoring event, overlay not found");return;}
if(mapLayer.layerType=='overlay'){var tileOverlay=this.tileOverlays[mapLayer.pluginName+":"+mapLayer.layerId];if(eventData.isChanged){if(eventData.isVisible){this.gmap.addOverlay(tileOverlay);}
else{this.gmap.removeOverlay(tileOverlay);}}}
else{this.gmap.setMapType(this.gmap.getCurrentMapType());}}
googlemapsPlugin.prototype._setResultActive=function(eventData)
{if(this.features[eventData.pluginName]==null||this.features[eventData.pluginName][eventData.index]==null){this.clientCore.debug("googlemapsPlugin._setResultActive: ignoring event, placemark not found");return;}
var marker=this._getFeaturePlacemark(this.features[eventData.pluginName][eventData.index]);var point=this._getFeaturePoint(this.features[eventData.pluginName][eventData.index]);if(typeof this.features[eventData.pluginName][eventData.index].setIcon!='function'){if(marker._description.length>0){this.openInfoWindowExt(marker,marker._description,point.lat(),point.lng());}
return;}
var isActive=(this.activeFeature.pluginName==eventData.pluginName&&this.activeFeature.index==eventData.index);if(isActive){if(marker._description.length>0){this.openInfoWindowExt(marker,marker._description,point.lat(),point.lng());}}
else{if(marker.setIcon){var prevActive=this.activeFeature;if(prevActive.pluginName!=null){var prevMarker=this.features[prevActive.pluginName][prevActive.index];prevMarker.setIcon(prevMarker._normalIcon);}
marker.setIcon(marker._activeIcon);}
if(marker._description.length>0){this.openInfoWindowExt(marker,marker._description,point.lat(),point.lng());}
this.activeFeature.pluginName=eventData.pluginName;this.activeFeature.index=eventData.index;}}
googlemapsPlugin.prototype._removePlacemark=function(eventData)
{if(this.features[eventData.pluginName]==null||this.features[eventData.pluginName][eventData.index]==null){this.clientCore.debug("googlemapsPlugin._removePlacemark: ignoring event, placemark not found");return;}
this._removeGOverlay(eventData.pluginName,eventData.index);GEvent.clearInstanceListeners(this.features[eventData.pluginName][eventData.index]);this._unregisterFeature(eventData.pluginName,eventData.index);}
googlemapsPlugin.prototype._removeResult=function(eventData)
{if(this.features[eventData.pluginName]==null){return;}
this.clientCore.debug("googlemapsPlugin._removeResult: removing results for plugin '"+eventData.pluginName+"'");var features=this.features[eventData.pluginName];for(var index in features){if(typeof(features[index])=='function'){continue;}
this._removeGOverlay(eventData.pluginName,index);GEvent.clearInstanceListeners(features[index]);}
if(this.activeFeature.pluginName==eventData.pluginName){this.activeFeature.pluginName=null;this.activeFeature.index=null;}
this.features[eventData.pluginName]=new Object();this.visibility[eventData.pluginName]=new Object();if(!eventData.receivingNew){delete this.icons[eventData.pluginName];delete this.activeIcons[eventData.pluginName];}}
googlemapsPlugin.prototype._removeResultType=function(eventData)
{if(this.features[eventData.pluginName]==null){return;}
this.clientCore.debug("googlemapsPlugin._removeResultType: removing results for plugin '"+eventData.pluginName+"'");var features=this.features[eventData.pluginName];for(var index in features){if(typeof(features[index])=='function'){continue;}
if(typeof(features[index])=='undefined'){continue;}
if(features[index]._iconType==eventData.iconType){this._removeGOverlay(eventData.pluginName,index);GEvent.clearInstanceListeners(features[index]);}}}
googlemapsPlugin.prototype._removeMapControl=function(eventData)
{if(this.mapControls[eventData.pluginName]==null||this.mapControls[eventData.pluginName][eventData.panelType]==null){return;}
var htmlControl=this.mapControls[eventData.pluginName][eventData.panelType];if(htmlControl.addedToMap){htmlControl.addedToMap=false;this.gmap.removeControl(htmlControl);delete this.mapControls[eventData.pluginName][eventData.panelType];this.clientCore.debug("googlemapsPlugin._removeMapControl: removed control from map for plugin "+eventData.pluginName);}}
googlemapsPlugin.prototype._applyStartExtent=function()
{var startExtent=this.clientCore.getStartExtent();var eventData={pluginName:this.pluginName,north:startExtent.north,west:startExtent.west,south:startExtent.south,east:startExtent.east,minRange:null,maxRange:null};this._moveViewExtent(eventData);}
googlemapsPlugin.prototype._addGTileLayerOverlay=function(mapLayer)
{var myself=this;var tileLayer=new GTileLayer(new GCopyrightCollection(""),0,19);tileLayer._mapLayer=mapLayer;tileLayer.getTileUrl=function(t,z){return myself._getOverlayMapLayerTileUrl(this,t,z);};tileLayer.isPng=function(){return false;}
tileLayer.getOpacity=function(){return 0.7;}
var tileOverlay=new GTileLayerOverlay(tileLayer);this.tileOverlays[mapLayer.pluginName+":"+mapLayer.layerId]=tileOverlay;if(mapLayer.visible){this.gmap.addOverlay(tileOverlay);}
this.clientCore.debug("googlemapsPlugin._addGTileLayerOverlay: added overlay for "+mapLayer.pluginName+":"+mapLayer.layerId);}
googlemapsPlugin.prototype._createGIcon=function(iconStyle,customIconUrl,isActive)
{var iconUrl;if(customIconUrl==null||customIconUrl==""){iconUrl=(isActive?iconStyle.activeIconUrl:iconStyle.iconUrl);}
else{iconUrl=customIconUrl;}
icon=new GIcon();icon.image=iconUrl;icon.iconSize=new GSize(iconStyle.iconWidth,iconStyle.iconHeight);icon.iconAnchor=new GPoint(iconStyle.iconAnchorPxX,iconStyle.iconAnchorPxY);icon.shadow=iconStyle.shadowUrl;icon.shadowSize=new GSize(iconStyle.shadowWidth,iconStyle.shadowHeight);icon.infoWindowAnchor=new GPoint(0,0);return icon;}
googlemapsPlugin.prototype._addGOverlay=function(pluginName,index)
{var features=this.features[pluginName][index];for(var i=0;i<features.length;i++){this.gmap.addOverlay(features[i]);}
if(this.activeFeature.pluginName==pluginName&&this.activeFeature.index==index&&feature._description.length>0){if(feature.getPoint){var point=feature.getPoint();this.openInfoWindowExt(feature,feature._description,point.lat(),point.lng());}}}
googlemapsPlugin.prototype._getGMapExtent=function()
{var bounds=this.gmap.getBounds();var northEast=bounds.getNorthEast();var southWest=bounds.getSouthWest();return{north:northEast.lat(),west:southWest.lng(),south:southWest.lat(),east:northEast.lng()};}
googlemapsPlugin.prototype._getTileExtent=function(tile,zoom)
{var tileSize=256;var upperLeftPoint=new GPoint((tile.x)*tileSize,(tile.y+1)*tileSize);var lowerRightPoint=new GPoint((tile.x+1)*tileSize,(tile.y)*tileSize);var projection=this.gmap.getCurrentMapType().getProjection();var upperLeft=projection.fromPixelToLatLng(upperLeftPoint,zoom);var lowerRight=projection.fromPixelToLatLng(lowerRightPoint,zoom);var extent={west:upperLeft.lng(),east:lowerRight.lng(),south:upperLeft.lat(),north:lowerRight.lat()};return extent;}
googlemapsPlugin.prototype._getGroundMapLayerTileUrl=function(tileLayer,tile,zoom)
{var tileExtent=this._getTileExtent(tile,zoom);var mapExtent=this._getGMapExtent();var mapLayer=this.clientCore.getMapLayerByExtent(tileExtent,mapExtent,"ground",true);if(mapLayer==null){return G_SATELLITE_MAP.getTileLayers()[0].getTileUrl(tile,zoom);}
else{return this._getMapLayerTileUrl(mapLayer,tileExtent);}}
googlemapsPlugin.prototype._getOverlayMapLayerTileUrl=function(tileLayer,tile,zoom)
{var tileExtent=this._getTileExtent(tile,zoom);var mapExtent=this._getGMapExtent();var mapLayer=tileLayer._mapLayer;if(!this.clientCore.hasMapLayerTileForExtent(mapLayer,tileExtent,mapExtent)){return this.pluginGraphicsUrl+"transparent.gif";}
else{return this._getMapLayerTileUrl(mapLayer,tileExtent);}}
googlemapsPlugin.prototype._getMapLayerTileUrl=function(mapLayer,tileExtent)
{return this.clientCore.getMapLayerTileUrl(mapLayer,tileExtent,256,256);}
googlemapsPlugin.prototype._ordinatesToGLatLng=function(ordinates)
{var points=[];for(var i=0;i<ordinates.length;i++){var latlon=ordinates[i];points.push(new GLatLng(latlon[0],latlon[1]));}
return points;}
googlemapsPlugin.prototype._removeGOverlay=function(pluginName,index)
{if(this.activeFeature.pluginName==pluginName&&this.activeFeature.index==index){var infoWindow=this.gmap.getInfoWindow();if(infoWindow!=null){infoWindow.hide();}}
var features=this.features[pluginName][index];for(var i=0;i<features.length;i++){this.gmap.removeOverlay(features[i]);}}
googlemapsPlugin.prototype._registerFeature=function(pluginName,index,feature)
{if(this.features[pluginName]==null){this.features[pluginName]=new Object();this.visibility[pluginName]=new Object();}
if(this.features[pluginName][index]==null){this.features[pluginName][index]=[];}
this.features[pluginName][index].push(feature);this.visibility[pluginName][index]=true;}
googlemapsPlugin.prototype._unregisterFeature=function(pluginName,index)
{if(this.activeFeature.pluginName==pluginName){this.activeFeature.pluginName=null;this.activeFeature.index=null;}
delete this.features[pluginName][index];delete this.visibility[pluginName][index];};function hoewerkthetPlugin(clientCore)
{this.clientCore=clientCore;this.showTimeout=null;this.hideTimeout=null;var myself=this;clientCore.addEventListener('loaded',function(d){myself.showOverlayDiv()});}
hoewerkthetPlugin.prototype.showOverlayDiv=function(showDirectly,maxVisibleTime)
{if(typeof maxVisibleTime=='undefined'){maxVisibleTime=5000;}
if(this.showTimeout){clearTimeout(this.showTimeout);}
if(showDirectly){if(document.getElementById&&document.getElementById('startup_overlay')){this.showTimeout=setTimeout("maxDom.showElement('startup_overlay')",1);}}
else{if(document.getElementById&&document.getElementById('startup_overlay')){this.showTimeout=setTimeout("maxDom.showElement('startup_overlay')",500);}}
if(this.hideTimeout){clearTimeout(this.hideTimeout);}}
hoewerkthetPlugin.prototype.hideOverlayDiv=function()
{clearTimeout(this.showTimeout);clearTimeout(this.hideTimeout);this.showTimeout=null;this.hideTimeout=null;if(document.getElementById&&document.getElementById('login__loginForm_dialog2')){this.hideTimeout=setTimeout("maxDom.hideElement('login__loginForm_dialog')",50);this.hideTimeout=setTimeout("maxDom.hideElement('login__loginForm_dialog2')",50);}};function loginPlugin(clientCore)
{this.clientCore=clientCore;var myself=this;this.clientCore.addEventListener('loaded',function(d){myself._loaded(d)});}
loginPlugin.prototype._loaded=function(eventData)
{var graphicsUrl='moduleplugins/'+this.pluginName+'/graphics';var requestUri=window.location.search;if(requestUri.match('(aanmeldenstart)')!=null){this.clientCore.callPlugin(this.pluginName+':showLoginDiv',null);}}
loginPlugin.prototype.login=function()
{var graphicsUrl='moduleplugins/'+this.pluginName+'/graphics';this.clientCore.callPlugin(this.pluginName+':showLoginDiv',null);}
loginPlugin.prototype.doLogin=function(form)
{var loginname=form.loginname.isLabel?'':form.loginname.value;var password=form.password.isLabel?'':form.password.value;var rememberMe=form.loginFormRememberMe.checked;this.clientCore.callPlugin(this.pluginName+':doLogin',loginname,password,rememberMe);}
loginPlugin.prototype.goToAedForm=function()
{this.clientCore.callPlugin('aedaanmelden:showAanmeldenDiv',null);}
loginPlugin.prototype.goToAedFormAfterLogin=function()
{this.clientCore.callPlugin(this.pluginName+':hideOverlayDiv',null);this.clientCore.callPlugin('aedaanmelden:showAanmeldenDiv',null);}
loginPlugin.prototype.loginSuccess=function()
{location.href="/index.php";}
loginPlugin.prototype.showOverlayDiv=function(html)
{var overlayDiv=document.getElementById("registerLoginOverlay");maxDom.showElement(overlayDiv);var select_elements=document.getElementsByTagName('select');for(var i=0;i<select_elements.length;i++){var sel=select_elements[i];if(!sel.disabled){sel.style.visibility='hidden';sel.setAttribute('ie6hide','1');}}
overlayDiv.innerHTML=html;overlayDiv.scrollTop=0;}
loginPlugin.prototype.hideOverlayDiv=function()
{var overlayDiv=document.getElementById("registerLoginOverlay");maxDom.hideElement(overlayDiv);var select_elements=document.getElementsByTagName('select');for(var i=0;i<select_elements.length;i++){var sel=select_elements[i];if(sel.getAttribute('ie6hide')=='1'){sel.style.visibility='visible';sel.setAttribute('ie6hide','0');}}
overlayDiv.innerHTML="";}
loginPlugin.prototype.showRetrieve=function()
{this.clientCore.callPlugin(this.pluginName+':showRetrieve');}
loginPlugin.prototype.doRetrieve=function(form)
{var loginname=form.loginname.isLabel?'':form.loginname.value;this.clientCore.callPlugin(this.pluginName+':doRetrieve',loginname);};function nieuwsPlugin(clientCore)
{this.clientCore=clientCore;var myself=this;this.clientCore.addEventListener('loaded',function(d){myself._loaded(d)});}
nieuwsPlugin.prototype._loaded=function(eventData)
{this.clientCore.callPlugin(this.pluginName+':showNewsList',null);}
nieuwsPlugin.prototype.aanmelden=function()
{var graphicsUrl='moduleplugins/'+this.pluginName+'/graphics';this.clientCore.callPlugin(this.pluginName+':showAanmeldenDiv',null);}
nieuwsPlugin.prototype.doAanmelden=function(form)
{var loginname=form.loginname.isLabel?'':form.loginname.value;var password=form.password.isLabel?'':form.password.value;var rememberMe=form.loginFormRememberMe.checked;this.clientCore.callPlugin(this.pluginName+':doLogin',loginname,password,rememberMe);}
nieuwsPlugin.prototype.aanmeldenSuccess=function()
{location.href="/index.php";}
nieuwsPlugin.prototype.showOverlayDiv=function(html)
{var overlayDiv=document.getElementById("newsItemsDiv");maxDom.showElement(overlayDiv);var select_elements=document.getElementsByTagName('select');for(var i=0;i<select_elements.length;i++){var sel=select_elements[i];if(!sel.disabled){sel.style.visibility='hidden';sel.setAttribute('ie6hide','1');}}
overlayDiv.innerHTML=html;overlayDiv.scrollTop=0;}
nieuwsPlugin.prototype.hideOverlayDiv=function()
{var overlayDiv=document.getElementById("registerLoginOverlay");maxDom.hideElement(overlayDiv);var select_elements=document.getElementsByTagName('select');for(var i=0;i<select_elements.length;i++){var sel=select_elements[i];if(sel.getAttribute('ie6hide')=='1'){sel.style.visibility='visible';sel.setAttribute('ie6hide','0');}}
overlayDiv.innerHTML="";}
nieuwsPlugin.prototype.showRetrieve=function()
{this.clientCore.callPlugin(this.pluginName+':showRetrieve');}
nieuwsPlugin.prototype.doRetrieve=function(form)
{var loginname=form.loginname.isLabel?'':form.loginname.value;this.clientCore.callPlugin(this.pluginName+':doRetrieve',loginname);};function outputdisplayPlugin(clientCore)
{this.clientCore=clientCore;this.rootPanelId="outputDisplay";this.homePanelId="contentHome";this.activePanel=null;this.previousPanel=null;this.timeoutError=true;if(document.getElementById(this.rootPanelId)==null){alert("interne fout in outputdisplayPlugin<constructor>: panel root element id '"+this.rootPanelId+"' does not exist");return;}
var myself=this;clientCore.addEventListener('createContentPanel',function(d){myself.createContentPanel(d.pluginName,d.panelType,d.html)});clientCore.addEventListener('openContentPanel',function(d){myself.openContentPanel(d.pluginName,d.panelType)});clientCore.addEventListener('showErrorReport',function(d){myself.showErrorReport(d.pluginName,d.message,d.report)});clientCore.addEventListener('removeContentPanel',function(d){myself.removeContentPanel(d.pluginName,d.panelType)});clientCore.addEventListener('loaded',function(d){myself._loaded(d)});clientCore.addEventListener('callPlugin',function(d){myself._callPlugin(d)});var panels=this.getContentPanelList();for(var i=0;i<panels.length;i++){clientCore.addContentPanel(panels[i].pluginName,panels[i].panelType);}}
outputdisplayPlugin.prototype._loaded=function(eventData)
{if(location.host.indexOf('gemgids')==-1&&location.host.indexOf('nukaart')==-1&&location.host.indexOf('nuradar')==-1){var graphicsUrl='moduleplugins/'+this.pluginName+'/graphics';var html='<a href="http://www.max.nl" target="_blank"><img border="0" src="'+graphicsUrl+'/poweredbymax_transparent3.png" width="125" height="25" alt=""></a>';this.clientCore.createMapControl(this.pluginName,'logo',html,'100%','100%',16,20);this.clientCore.openMapControl(this.pluginName,'logo');}
if(this.clientCore.googlemapsPlugin){var gmap=this.clientCore.googlemapsPlugin.getMapObject();gmap.enableScrollWheelZoom();}}
outputdisplayPlugin.prototype.getActivePanel=function()
{return this.activePanel;}
outputdisplayPlugin.prototype.getActivePanelSource=function()
{if(this.activePanel==null){return null;}
return this.getPanelSource(this.activePanel.pluginName,this.activePanel.panelType);}
outputdisplayPlugin.prototype.isActivePanel=function(pluginName,panelType)
{return(this.activePanel!=null)&&(this.activePanel.pluginName==pluginName)&&(this.activePanel.panelType==panelType);}
outputdisplayPlugin.prototype.hasContentPanel=function(pluginName,panelType)
{var domElementId=pluginName+"__"+panelType;var panel=document.getElementById(domElementId);return(panel!=null);}
outputdisplayPlugin.prototype.getPanelSource=function(pluginName,panelType)
{var domElementId=pluginName+"__"+panelType;var panel=document.getElementById(domElementId);if(panel==null){return null;}
return panel.innerHTML;}
outputdisplayPlugin.prototype.openPreviousPanel=function()
{if(this.previousPanel==null){return;}
this.openContentPanel(this.previousPanel.pluginName,this.previousPanel.panelType);}
outputdisplayPlugin.prototype.createContentPanel=function(pluginName,panelType,html)
{var domElementId=pluginName+"__"+panelType;var panel=document.getElementById(domElementId);if(panel==null){panel=this._createPanel(domElementId,html);this.clientCore.addContentPanel(pluginName,panelType);this.clientCore.debug("outputdisplayPlugin.createContentPanel: creating layer '"+panelType+"' for plugin '"+pluginName+"'");}
else{panel.innerHTML=html;this.clientCore.debug("outputdisplayPlugin.createContentPanel: updating layer '"+panelType+"' for plugin '"+pluginName+"'");}}
outputdisplayPlugin.prototype.openContentPanel=function(pluginName,panelType)
{var domElementId=pluginName+"__"+panelType;var panel=document.getElementById(domElementId);if(panel==null){alert("interne fout in outputdisplayPlugin.openContentPanel: plugin '"+pluginName+"' heeft geen '"+panelType+"' paneel.");return false;}
this.clientCore.debug("outputdisplayPlugin.openContentPanel: displaying layer '"+panelType+"' for plugin '"+pluginName+"' and updating GeoMaxClientCore of panel change.");this._openPanel(domElementId);var homePanel=document.getElementById(this.homePanelId);if(homePanel!=null){maxDom.hideElement(homePanel);}
this.previousPanel=this.activePanel;this.activePanel={pluginName:pluginName,panelType:panelType};this.clientCore.setActiveContentPanel(this.activePanel.pluginName,this.activePanel.panelType);return true;}
outputdisplayPlugin.prototype.removeContentPanel=function(pluginName,panelType)
{var domElementId=pluginName+"__"+panelType;var panel=document.getElementById(domElementId);if(panel==null){this.clientCore.debug("outputdisplayPlugin.removeContentPanel: plugin '"+pluginName+"' has no '"+panelType+"' panel to remove.");return false;}
var rootPanel=document.getElementById(this.rootPanelId);if(panel.parentNode==null||panel.parentNode!=rootPanel){alert("interne fout in aanroep naar outputdisplayPlugin.removeContentPanel: element '"+domElementId+"' is not a valid content panel");return false;}
this.clientCore.debug("outputdisplayPlugin.removeContentPanel: removing layer '"+panelType+"' for plugin '"+pluginName+"'");panel.parentNode.removeChild(panel);if(this.activePanel==null||this.isActivePanel(pluginName,panelType)){this.activePanel=null;var homePanel=document.getElementById(this.homePanelId);if(homePanel==null){alert("interne fout in aanroep naar outputdisplayPlugin.removeContentPanel: home panel '"+this.homePanelId+"' does not exist.");return true;}
maxDom.showElement(homePanel);}
return true;}
outputdisplayPlugin.prototype.getContentPanelList=function()
{var panels=new Array();var rootPanel=document.getElementById(this.rootPanelId);var divs=rootPanel.getElementsByTagName('div');for(var i=0;i<divs.length;i++){if(divs[i].className=='contentPanel'){var panelId=divs[i].id;if(panelId.indexOf("__")!=-1){var panelData=panelId.split("__");panels[panels.length]={pluginName:panelData[0],panelType:panelData[1]};}}}
return panels;}
outputdisplayPlugin.prototype.showErrorReport=function(pluginName,message,report)
{var activePanelId=(this.activePanel==null?'contentHome':this.activePanel.pluginName+"__"+this.activePanel.panelType);var onclick="maxDom.hideElement('ajaxErrors'); maxDom.showElement('"+activePanelId+"'); return false";var ajaxErrors=document.getElementById('ajaxErrors');ajaxErrors.innerHTML='<h2>'+message+'</h2>'
+'<p><a href="#" onclick="'+onclick+'">terug naar het vorige scherm</a></p>'
+report;ajaxErrors.style.display='block';maxDom.hideElement(activePanelId);}
outputdisplayPlugin.prototype._callPlugin=function(eventData)
{var errorElement=document.getElementById("ajaxErrors");if(errorElement==null){alert("interne fout in outputdisplayPlugin._callPlugin: DOM element 'ajaxErrors' niet gevonden.");return;}
if(errorElement.style.display=='block'){this.clientCore.debug("outputdisplayPlugin._callPlugin: erasing error output element contents");errorElement.style.display='none';errorElement.innerHTML='';var activePanelId=(this.activePanel==null?'contentHome':this.activePanel.pluginName+"__"+this.activePanel.panelType);maxDom.showElement(activePanelId);}}
outputdisplayPlugin.prototype._createPanel=function(domElementId,html)
{var panel=document.createElement('div');panel.id=domElementId;panel.className="contentPanel";panel.innerHTML=html;panel.style.zIndex=100;panel.style.display='none';document.getElementById(this.rootPanelId).appendChild(panel);return panel;}
outputdisplayPlugin.prototype._openPanel=function(domElementId)
{var rootPanel=document.getElementById(this.rootPanelId);var divs=rootPanel.getElementsByTagName('div');for(var i=0;i<divs.length;i++){if(divs[i].className=='contentPanel'){maxDom.hideElement(divs[i]);}}
maxDom.showElement(domElementId);rootPanel.scrollTop=0;};function overlaydialogPlugin(clientCore)
{this.clientCore=clientCore;var myself=this;clientCore.addEventListener('closeModalDialog',function(d){myself.closeModalDialog(d.pluginName,d.panelType)});clientCore.addEventListener('createModalDialog',function(d){myself.createModalDialog(d.pluginName,d.panelType,d.html,d.width,d.height)});clientCore.addEventListener('openModalDialog',function(d){myself.openModalDialog(d.pluginName,d.panelType)});clientCore.addEventListener('removeModalDialog',function(d){myself.removeModalDialog(d.pluginName,d.panelType)});}
overlaydialogPlugin.prototype.getDialogId=function(pluginName,panelType){return pluginName+"__"+panelType.replace(/[^A-Za-z0-9_]/g,'')+"_dialog";}
overlaydialogPlugin.prototype.closeModalDialog=function(pluginName,panelType)
{var domElementId=this.getDialogId(pluginName,panelType);var dialog=document.getElementById(domElementId);if(dialog==null){alert("interne fout in overlaydialogPlugin.closeModalDialog: plugin '"+pluginName+"' heeft geen '"+panelType+"' dialog.");return false;}
maxDom.hideElement(domElementId);maxDom.hideElement(this.pluginName+"_OverlayBox");var body=document.getElementsByTagName("BODY")[0];var html=document.getElementsByTagName("HTML")[0];body.style.overflow=body._oldOverflow;html.style.overflow=html._oldOverflow;return true;}
overlaydialogPlugin.prototype._initializeOverlay=function()
{var domElementId=this.pluginName+"_OverlayBox";var overlay=document.getElementById(domElementId);if(overlay==null){overlay=document.createElement('div');overlay.id=domElementId;overlay.className="modalDialogOverlay";var body=document.getElementsByTagName("BODY")[0];body.appendChild(overlay);}}
overlaydialogPlugin.prototype.createModalDialog=function(pluginName,panelType,html,width,height)
{var style='';if(width!=null){if(!isNaN(width)){width+='px';}
style+="width: "+width+";";}
if(height!=null){if(!isNaN(height)){height+='px';}
style+="height: "+height+";";}
if(style.length>0){style=' style="'+style+'"';}
this._initializeOverlay();var domElementId=this.getDialogId(pluginName,panelType);var dialog=document.getElementById(domElementId);if(dialog==null){dialog=document.createElement('div');dialog.id=domElementId;dialog.className="modalDialogOverlay2";dialog.style.zIndex=10001;dialog.style.display='none';dialog.style.position='fixed';dialog.style.left=0;dialog.style.top=0;dialog.style.width='100%';dialog.style.height='100%';if(navigator.appName=="Microsoft Internet Explorer"){dialog.style.position='absolute';dialog.style.height='4000px';}
var body=document.getElementsByTagName("BODY")[0];body.appendChild(dialog);this.clientCore.debug("overlaydialogPlugin.createModalDialog: creating dialog '"+panelType+"' for plugin '"+pluginName+"'");}
else{this.clientCore.debug("overlaydialogPlugin.createModalDialog: updating dialog '"+panelType+"' for plugin '"+pluginName+"'");}
var closeAction=this.clientCore.getObjectName()+".closeModalDialog('"+pluginName+"', '"+panelType+"');";dialog.innerHTML='<div class="modalDialogSpacing">'
+'  <div class="modalDialogPanel dialogPanelAanmelden">'
+'    <div class="modalDialogCaption"><a href="#" onclick="'+closeAction+'; return false" class="closeButton">sluiten</a></div>'
+'    <div class="modalDialogContent"'+style+'>'+html+'</div>'
+'  </div>'
+'</div>';}
overlaydialogPlugin.prototype.openModalDialog=function(pluginName,panelType)
{var domElementId=this.getDialogId(pluginName,panelType);var panel=document.getElementById(domElementId);if(panel==null){alert("interne fout in overlaydialogPlugin.openModalDialog: plugin '"+pluginName+"' heeft geen '"+panelType+"' dialog.");return false;}
maxDom.showElement(domElementId);maxDom.showElement(this.pluginName+"_OverlayBox");var body=document.getElementsByTagName("BODY")[0];var html=document.getElementsByTagName("HTML")[0];body._oldOverflow=body.style.overflow;html._oldOverflow=html.style.overflow;body.style.overflow='hidden';html.style.overflow='hidden';return true;}
overlaydialogPlugin.prototype.removeModalDialog=function(pluginName,panelType)
{var domElementId=this.getDialogId(pluginName,panelType);var panel=document.getElementById(domElementId);if(panel==null){this.clientCore.debug("overlaydialogPlugin.removeModalDialog: plugin '"+pluginName+"' has no '"+panelType+"' panel to remove.");return;}
this.clientCore.debug("overlaydialogPlugin.removeModalDialog: removing dialog '"+panelType+"' for plugin '"+pluginName+"'");panel.parentNode.removeChild(panel);return true;};function progressoverlayPlugin(clientCore)
{this.clientCore=clientCore;this.showTimeout=null;this.hideTimeout=null;var myself=this;clientCore.addEventListener('callPlugin',function(d){myself.showOverlay()});clientCore.addEventListener('callPluginFinished',function(d){myself.hideOverlay()});}
progressoverlayPlugin.prototype.showOverlay=function(showDirectly,maxVisibleTime)
{if(typeof maxVisibleTime=='undefined'){maxVisibleTime=120000;}
if(this.showTimeout){clearTimeout(this.showTimeout);}
if(showDirectly){this.showTimeout=setTimeout("maxDom.showElement('ajaxProgress')",1);}
else{this.showTimeout=setTimeout("maxDom.showElement('ajaxProgress')",500);}
this.clientCore.debug("progressoverlayPlugin.showOverlay: displaying overlay");if(this.hideTimeout){clearTimeout(this.hideTimeout);}
this.hideTimeout=setTimeout("maxDom.hideElement('ajaxProgress')",500+maxVisibleTime);}
progressoverlayPlugin.prototype.hideOverlay=function()
{clearTimeout(this.showTimeout);clearTimeout(this.hideTimeout);this.showTimeout=null;this.hideTimeout=null;this.hideTimeout=setTimeout("maxDom.hideElement('ajaxProgress')",500);this.clientCore.debug("progressoverlayPlugin.hideOverlay: hiding overlay");};function registerPlugin(clientCore)
{this.clientCore=clientCore;var myself=this;this.clientCore.addEventListener('loaded',function(d){myself._loaded(d)});}
registerPlugin.prototype._loaded=function(eventData)
{var graphicsUrl='moduleplugins/'+this.pluginName+'/graphics';}
registerPlugin.prototype.register=function()
{var graphicsUrl='moduleplugins/'+this.pluginName+'/graphics';this.clientCore.callPlugin(this.pluginName+':showRegDiv',null);}
registerPlugin.prototype.doRegister=function(form)
{var formValues=maxDomForm.getFormValues(form);this.clientCore.callPlugin(this.pluginName+':doRegister',formValues);}
registerPlugin.prototype.showOverlayDiv=function(html)
{var overlayDiv=document.getElementById("registerLoginOverlay");maxDom.showElement(overlayDiv);var select_elements=document.getElementsByTagName('select');for(var i=0;i<select_elements.length;i++){var sel=select_elements[i];if(!sel.disabled){sel.style.visibility='hidden';sel.setAttribute('ie6hide','1');}}
overlayDiv.innerHTML=html;overlayDiv.scrollTop=0;}
registerPlugin.prototype.hideOverlayDiv=function()
{var overlayDiv=document.getElementById("registerLoginOverlay");maxDom.hideElement(overlayDiv);var select_elements=document.getElementsByTagName('select');for(var i=0;i<select_elements.length;i++){var sel=select_elements[i];if(sel.getAttribute('ie6hide')=='1'){sel.style.visibility='visible';sel.setAttribute('ie6hide','0');}}
overlayDiv.innerHTML="";}
registerPlugin.prototype.verified=function()
{alert('everified!');};function routePlugin(clientCore)
{this.clientCore=clientCore;var myself=this;this._loaded=function()
{var overlayDiv=$(this.pluginName+"_overlayDiv");this.overlayDivContent=overlayDiv.innerHTML;overlayDiv.remove();}
this.showForm=function(toAddress,lat,lon,options){var theurl=this.clientCore.getRestUrl(this.pluginName+':showForm',[this.clientCore.getObjectName(),toAddress,lat,lon,$H(options).toJSON()]);var width=document.viewport.getWidth()*0.8;var height=document.viewport.getHeight()*0.8;var width=760;var height=500;var iframe='<div class="elementTitle">Routeplanner</div>'+'<iframe src="'+theurl+'" '+'style="width: '+width+'px;'+'height:'+height+'px;"'+'scrolling="auto"  frameborder="0" border="0"></iframe>';var dialogName=toAddress.replace(/[\W]/,'_');this.clientCore.createModalDialog(this.pluginName,dialogName,iframe,width+40,height+50);this.clientCore.openModalDialog(this.pluginName,dialogName);}};function site_aedPlugin(clientCore)
{this.clientCore=clientCore;this.autoRefresh=true;this.zoomLevel=0;this.minZoomLevelObjects=0;var myself=this;this.clientCore.addEventListener('loaded',function(d){myself._loaded(d)});}
site_aedPlugin.prototype._loaded=function(eventData)
{var gmap=this.clientCore.googlemapsPlugin.getMapObject();gmap.addControl(new GNavLabelControl(),new GControlPosition(G_ANCHOR_BOTTOM_RIGHT,new GSize(0,0)));this.clientCore.googlemapsPlugin.setMapType('G_STREET_MAP');var myself=this;}
site_aedPlugin.prototype.showGeneralDiv=function(cityID,provinceID)
{this.clientCore.closeInfoWindow();this._display("tabGeneral");this.clientCore.callPlugin("aed:reShowList",1,cityID,provinceID);}
site_aedPlugin.prototype.showNonApproved=function()
{this._display("tabNonApproved");this.clientCore.callPlugin("aed:reShowList",3);}
site_aedPlugin.prototype.showAllAEDsDiv=function()
{this._display("tabAllAEDs");this.clientCore.callPlugin("aed:reShowList",4);}
site_aedPlugin.prototype.showBeheerdersDiv=function()
{this.clientCore.closeInfoWindow();this._display("tabBeheerders");this.clientCore.callPlugin("beheerders:showList");}
site_aedPlugin.prototype.showImportDiv=function()
{this._display("tabImport");this.clientCore.callPlugin("csvimport:showForm");}
site_aedPlugin.prototype._display=function(div)
{var tabs=new Array("tabGeneral","tabNonApproved","tabAllAEDs","tabBeheerders","tabImport");for(i=0;i<tabs.length;i++){var e=document.getElementById(tabs[i]);if(e!=null){e.setAttribute((document.all?"className":"class"),'tab');}}
var e2show=document.getElementById(div);if(e2show!=null){e2show.setAttribute((document.all?"className":"class"),'tab tabActive');}else{alert('Error: div does not exist');}}