if(typeof document.attachEvent!='undefined'){window.attachEvent('onload',init);document.attachEvent('onmousemove',moveMouse);document.attachEvent('onclick',checkMove);}
else{window.addEventListener('load',init,false);document.addEventListener('mousemove',moveMouse,false);document.addEventListener('click',checkMove,false);}
var oDv=document.createElement("div");var dvHdr=document.createElement("div");var dvBdy=document.createElement("div");var windowlock,boxMove,fixposx,fixposy,lockX,lockY,fixx,fixy,ox,oy,boxLeft,boxRight,boxTop,boxBottom,evt,mouseX,mouseY,boxOpen,totalScrollTop,totalScrollLeft;boxOpen=false;ox=10;oy=10;lockX=0;lockY=0;function init(){oDv.appendChild(dvHdr);oDv.appendChild(dvBdy);oDv.style.position="absolute";oDv.style.visibility='hidden';oDv.style.zIndex=100000;document.body.appendChild(oDv);}
function defHdrStyle(){dvHdr.innerHTML='<img  style="vertical-align:middle"  src="info.gif">&nbsp;&nbsp;'+dvHdr.innerHTML;dvHdr.style.fontWeight='bold';dvHdr.style.width='150px';dvHdr.style.fontFamily='Verdana,arial';dvHdr.style.border='1px solid #A5CFE9';dvHdr.style.padding='3';dvHdr.style.fontSize='11';dvHdr.style.color='#4B7A98';dvHdr.style.background='#D5EBF9';dvHdr.style.filter='alpha(opacity=85)';dvHdr.style.opacity='0.85';}
function defBdyStyle(){dvBdy.style.borderBottom='1px solid #A5CFE9';dvBdy.style.borderLeft='1px solid #A5CFE9';dvBdy.style.borderRight='1px solid #A5CFE9';dvBdy.style.width='150px';dvBdy.style.fontFamily='Verdana,arial';dvBdy.style.fontSize='11';dvBdy.style.padding='3';dvBdy.style.color='#1B4966';dvBdy.style.background='#FFFFFF';dvBdy.style.filter='alpha(opacity=85)';dvBdy.style.opacity='0.85';}
function checkElemBO(txt){if(!txt||typeof(txt)!='string')return false;if((txt.indexOf('header')>-1)&&(txt.indexOf('body')>-1)&&(txt.indexOf('[')>-1)&&(txt.indexOf('[')>-1))
return true;else
return false;}
function scanBO(curNode){if(checkElemBO(curNode.title)){curNode.boHDR=getParam('header',curNode.title);curNode.boBDY=getParam('body',curNode.title);curNode.boCSSBDY=getParam('cssbody',curNode.title);curNode.boCSSHDR=getParam('cssheader',curNode.title);curNode.IEbugfix=(getParam('hideselects',curNode.title)=='on')?true:false;curNode.fixX=parseInt(getParam('fixedrelx',curNode.title));curNode.fixY=parseInt(getParam('fixedrely',curNode.title));curNode.absX=parseInt(getParam('fixedabsx',curNode.title));curNode.absY=parseInt(getParam('fixedabsy',curNode.title));curNode.offY=(getParam('offsety',curNode.title)!='')?parseInt(getParam('offsety',curNode.title)):10;curNode.offX=(getParam('offsetx',curNode.title)!='')?parseInt(getParam('offsetx',curNode.title)):10;curNode.fade=(getParam('fade',curNode.title)=='on')?true:false;curNode.fadespeed=(getParam('fadespeed',curNode.title)!='')?getParam('fadespeed',curNode.title):0.04;curNode.delay=(getParam('delay',curNode.title)!='')?parseInt(getParam('delay',curNode.title)):0;if(getParam('requireclick',curNode.title)=='on'){curNode.requireclick=true;document.all?curNode.attachEvent('onclick',showHideBox):curNode.addEventListener('click',showHideBox,false);document.all?curNode.attachEvent('onmouseover',hideBox):curNode.addEventListener('mouseover',hideBox,false);}
else{if(getParam('doubleclickstop',curNode.title)!='off'){document.all?curNode.attachEvent('ondblclick',pauseBox):curNode.addEventListener('dblclick',pauseBox,false);}
if(getParam('singleclickstop',curNode.title)=='on'){document.all?curNode.attachEvent('onclick',pauseBox):curNode.addEventListener('click',pauseBox,false);}}
curNode.windowLock=getParam('windowlock',curNode.title).toLowerCase()=='off'?false:true;curNode.title='';curNode.hasbox=1;}
else
curNode.hasbox=2;}
function getParam(param,list){var reg=new RegExp('([^a-zA-Z]'+param+'|^'+param+')\\s*=\\s*\\[\\s*(((\\[\\[)|(\\]\\])|([^\\]\\[]))*)\\s*\\]');var res=reg.exec(list);var returnvar;if(res)
return res[2].replace('[[','[').replace(']]',']');else
return'';}
function Left(elem){var x=0;if(elem.calcLeft)
return elem.calcLeft;var oElem=elem;while(elem){if((elem.currentStyle)&&(!isNaN(parseInt(elem.currentStyle.borderLeftWidth)))&&(x!=0))
x+=parseInt(elem.currentStyle.borderLeftWidth);x+=elem.offsetLeft;elem=elem.offsetParent;}
oElem.calcLeft=x;return x;}
function Top(elem){var x=0;if(elem.calcTop)
return elem.calcTop;var oElem=elem;while(elem){if((elem.currentStyle)&&(!isNaN(parseInt(elem.currentStyle.borderTopWidth)))&&(x!=0))
x+=parseInt(elem.currentStyle.borderTopWidth);x+=elem.offsetTop;elem=elem.offsetParent;}
oElem.calcTop=x;return x;}
var ah,ab;function applyStyles(){if(ab)
oDv.removeChild(dvBdy);if(ah)
oDv.removeChild(dvHdr);dvHdr=document.createElement("div");dvBdy=document.createElement("div");CBE.boCSSBDY?dvBdy.className=CBE.boCSSBDY:defBdyStyle();CBE.boCSSHDR?dvHdr.className=CBE.boCSSHDR:defHdrStyle();dvHdr.innerHTML=CBE.boHDR;dvBdy.innerHTML=CBE.boBDY;ah=false;ab=false;if(CBE.boHDR!=''){oDv.appendChild(dvHdr);ah=true;}
if(CBE.boBDY!=''){oDv.appendChild(dvBdy);ab=true;}}
var CSE,iterElem,LSE,CBE,LBE,totalScrollLeft,totalScrollTop,width,height;var ini=false;function SHW(){if(document.body&&(document.body.clientWidth!=0)){width=document.body.clientWidth;height=document.body.clientHeight;}
if(document.documentElement&&(document.documentElement.clientWidth!=0)&&(document.body.clientWidth+20>=document.documentElement.clientWidth)){width=document.documentElement.clientWidth;height=document.documentElement.clientHeight;}
return[width,height];}
var ID=null;function moveMouse(e){e?evt=e:evt=event;CSE=evt.target?evt.target:evt.srcElement;if(!CSE.hasbox){iElem=CSE;while((iElem.parentNode)&&(!iElem.hasbox)){scanBO(iElem);iElem=iElem.parentNode;}}
if((CSE!=LSE)&&(!isChild(CSE,dvHdr))&&(!isChild(CSE,dvBdy))){if(!CSE.boxItem){iterElem=CSE;while((iterElem.hasbox==2)&&(iterElem.parentNode))
iterElem=iterElem.parentNode;CSE.boxItem=iterElem;}
iterElem=CSE.boxItem;if(CSE.boxItem&&(CSE.boxItem.hasbox==1)){LBE=CBE;CBE=iterElem;if(CBE!=LBE){applyStyles();if(!CBE.requireclick)
if(CBE.fade){if(ID!=null)
clearTimeout(ID);ID=setTimeout("fadeIn("+CBE.fadespeed+")",CBE.delay);}
else{if(ID!=null)
clearTimeout(ID);COL=1;ID=setTimeout("oDv.style.visibility='visible';ID=null;",CBE.delay);}
if(CBE.IEbugfix){hideSelects();}
fixposx=!isNaN(CBE.fixX)?Left(CBE)+CBE.fixX:CBE.absX;fixposy=!isNaN(CBE.fixY)?Top(CBE)+CBE.fixY:CBE.absY;lockX=0;lockY=0;boxMove=true;ox=CBE.offX?CBE.offX:10;oy=CBE.offY?CBE.offY:10;}}
else if(!isChild(CSE,dvHdr)&&!isChild(CSE,dvBdy)&&(boxMove)){if((!isChild(CBE,CSE))||(CSE.tagName!='TABLE')){CBE=null;if(ID!=null)
clearTimeout(ID);fadeOut();showSelects();}}
LSE=CSE;}
else if(((isChild(CSE,dvHdr)||isChild(CSE,dvBdy))&&(boxMove))){totalScrollLeft=0;totalScrollTop=0;iterElem=CSE;while(iterElem){if(!isNaN(parseInt(iterElem.scrollTop)))
totalScrollTop+=parseInt(iterElem.scrollTop);if(!isNaN(parseInt(iterElem.scrollLeft)))
totalScrollLeft+=parseInt(iterElem.scrollLeft);iterElem=iterElem.parentNode;}
if(CBE!=null){boxLeft=Left(CBE)-totalScrollLeft;boxRight=parseInt(Left(CBE)+CBE.offsetWidth)-totalScrollLeft;boxTop=Top(CBE)-totalScrollTop;boxBottom=parseInt(Top(CBE)+CBE.offsetHeight)-totalScrollTop;doCheck();}}
if(boxMove&&CBE){bodyScrollTop=document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;bodyScrollLet=document.documentElement&&document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft;mouseX=evt.pageX?evt.pageX-bodyScrollLet:evt.clientX-document.body.clientLeft;mouseY=evt.pageY?evt.pageY-bodyScrollTop:evt.clientY-document.body.clientTop;if((CBE)&&(CBE.windowLock)){mouseY>(SHW()[1]-oDv.offsetHeight-oy)?lockY=-oDv.offsetHeight-2*oy:lockY=0;mouseY<-oy+lockY?lockY=-mouseY-oy:lockY=lockY;mouseX<-ox?lockX=-mouseX-ox:lockX=0;mouseX>(SHW()[0]-dvBdy.offsetWidth-ox)?lockX=-mouseX-ox+SHW()[0]-dvBdy.offsetWidth:lockX=lockX;}
oDv.style.left=((fixposx)||(fixposx==0))?fixposx:bodyScrollLet+mouseX+ox+lockX+"px";oDv.style.top=((fixposy)||(fixposy==0))?fixposy:bodyScrollTop+mouseY+oy+lockY+"px";}}
function doCheck(){if((mouseX<boxLeft)||(mouseX>boxRight)||(mouseY<boxTop)||(mouseY>boxBottom)){if(!CBE.requireclick)
fadeOut();if(CBE.IEbugfix){showSelects();}
CBE=null;}}
function pauseBox(e){e?evt=e:evt=event;boxMove=false;evt.cancelBubble=true;}
function showHideBox(e){oDv.style.visibility=(oDv.style.visibility!='visible')?'visible':'hidden';}
function hideBox(e){oDv.style.visibility='hidden';}
var COL=0;var stopfade=false;function fadeIn(fs){ID=null;COL=0;oDv.style.visibility='visible';fadeIn2(fs);}
function fadeIn2(fs){COL=COL+fs;COL=(COL>1)?1:COL;oDv.style.filter='alpha(opacity='+parseInt(100*COL)+')';oDv.style.opacity=COL;if(COL<1)
setTimeout("fadeIn2("+fs+")",20);}
function fadeOut(){oDv.style.visibility='hidden';}
function isChild(s,d){while(s){if(s==d)
return true;s=s.parentNode;}
return false;}
var cSrc;function checkMove(e){e?evt=e:evt=event;cSrc=evt.target?evt.target:evt.srcElement;if((!boxMove)&&(!isChild(cSrc,oDv))){fadeOut();if(CBE&&CBE.IEbugfix){showSelects();}
boxMove=true;CBE=null;}}
function showSelects(){var elements=document.getElementsByTagName("select");for(i=0;i<elements.length;i++){elements[i].style.visibility='visible';}}
function hideSelects(){var elements=document.getElementsByTagName("select");for(i=0;i<elements.length;i++){elements[i].style.visibility='hidden';}}
var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS";},searchString:function(data){for(var i=0;i<data.length;i++){var dataString=data[i].string;var dataProp=data[i].prop;this.versionSearchString=data[i].versionSearch||data[i].identity;if(dataString){if(dataString.indexOf(data[i].subString)!=-1)
return data[i].identity;}
else if(dataProp)
return data[i].identity;}},searchVersion:function(dataString){var index=dataString.indexOf(this.versionSearchString);if(index==-1)return;return parseFloat(dataString.substring(index+this.versionSearchString.length+1));},dataBrowser:[{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Chrome",versionSearch:"AppleWebKit",identity:"Chrome"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.userAgent,subString:"Iceweasel",versionSearch:"Iceweasel",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};BrowserDetect.init();var supported=false;if((BrowserDetect.browser=='Explorer'&&BrowserDetect.version>=6)||(BrowserDetect.browser=='Firefox'&&BrowserDetect.version>=1.5)||(BrowserDetect.browser=='Safari'&&BrowserDetect.version>=500)||(BrowserDetect.browser=='Chrome'&&BrowserDetect.version>=500))
{supported=true;}
if(!supported){var warningDiv=document.createElement("div");warningDiv.id='warningMessageContainer';warningDiv.innerHTML='<b>U maakt gebruik van een browser die we niet volledig ondersteunen. Hierdoor kan het zijn dat de applicatie niet naar behoren werkt. Gebruik Internet Explorer 6+, FireFox 1+, Safari 3+ of Chrome 5+ voor volledige ondersteuning</b>';warningDiv.style.display='block';warningDiv.style.marginTop='0px';document.getElementsByTagName('body')[0].insertBefore(warningDiv,document.getElementById('main_box'));}
TextResizeDetector=function(){var el=null;var iIntervalDelay=200;var iInterval=null;var iCurrSize=-1;var iBase=-1;var aListeners=[];var createControlElement=function(){el=document.createElement('span');el.id='textResizeControl';el.innerHTML='&nbsp;';el.style.position="absolute";el.style.left="-9999px";var elC=document.getElementById(TextResizeDetector.TARGET_ELEMENT_ID);if(elC)
elC.insertBefore(el,elC.firstChild);iBase=iCurrSize=TextResizeDetector.getSize();};function _stopDetector(){window.clearInterval(iInterval);iInterval=null;};function _startDetector(){if(!iInterval){iInterval=window.setInterval('TextResizeDetector.detect()',iIntervalDelay);}};function _detect(){var iNewSize=TextResizeDetector.getSize();if(iNewSize!==iCurrSize){for(var i=0;i<aListeners.length;i++){aListnr=aListeners[i];var oArgs={iBase:iBase,iDelta:((iCurrSize!=-1)?iNewSize-iCurrSize+'px':"0px"),iSize:iCurrSize=iNewSize};if(!aListnr.obj){aListnr.fn('textSizeChanged',[oArgs]);}
else{aListnr.fn.apply(aListnr.obj,['textSizeChanged',[oArgs]]);}}}
return iCurrSize;};var onAvailable=function(){if(!TextResizeDetector.onAvailableCount_i){TextResizeDetector.onAvailableCount_i=0;}
if(document.getElementById(TextResizeDetector.TARGET_ELEMENT_ID)){TextResizeDetector.init();if(TextResizeDetector.USER_INIT_FUNC){TextResizeDetector.USER_INIT_FUNC();}
TextResizeDetector.onAvailableCount_i=null;}
else{if(TextResizeDetector.onAvailableCount_i<600)
{TextResizeDetector.onAvailableCount_i++;setTimeout(onAvailable,200);}}};setTimeout(onAvailable,500);return{init:function(){createControlElement();_startDetector();},addEventListener:function(fn,obj,bScope){aListeners[aListeners.length]={fn:fn,obj:obj}
return iBase;},detect:function(){return _detect();},getSize:function(){var iSize;return el.offsetHeight;},stopDetector:function(){return _stopDetector();},startDetector:function(){return _startDetector();}}}();TextResizeDetector.TARGET_ELEMENT_ID='doc';TextResizeDetector.USER_INIT_FUNC=null;Geotool={};Geotool.Control={};Geotool.Format={};Geotool.Layer={};Geotool.Marker={};Geotool.Popup={};Geotool.Strategy={};Geotool.Strategy.Marker={};Geotool.componentClasses=[];Geotool.searcherClasses=[];Geotool.controllerName="rwsnlcontroller";Geotool.cookieName="RWSNLgeotool";Geotool.dirNameByProjectType={'wegen':'wegwerk','vaarwegen':'vaarwegwerk','geluid':'geluidbl'};Geotool._scriptName="lib/Geotool.js";Geotool._getScriptLocation=function(){var scriptLocation="";var isGeotool=new RegExp("(^|(.*?\\/))("+Geotool._scriptName+")(\\?|$)");var scripts=document.getElementsByTagName('script');for(var i=0,len=scripts.length;i<len;i++){var src=scripts[i].getAttribute('src');if(src){var match=src.match(isGeotool);if(match){scriptLocation=match[1];break;}}}
return scriptLocation;};Geotool.getComponentBaseUrl=function(projecttype){if(Geotool.dirNameByProjectType[projecttype]){dirName=Geotool.dirNameByProjectType[projecttype];}else{dirName=projecttype;}
return Geotool._getScriptLocation()+"components/"+dirName;};Geotool.loadCss=function(url)
{var addNode=true;var nodes=document.getElementsByTagName('link');for(var i=0,len=nodes.length;i<len;++i){if(OpenLayers.Util.isEquivalentUrl(nodes.item(i).href,url)){addNode=false;break;}}
if(addNode){var cssNode=document.createElement('link');cssNode.setAttribute('rel','stylesheet');cssNode.setAttribute('type','text/css');cssNode.setAttribute('href',url);document.getElementsByTagName('head')[0].appendChild(cssNode);}};Geotool.Calendar={monthNames:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],formatYYYYMMDD:function(dateYYYYMMDDstr)
{var year=parseInt(dateYYYYMMDDstr.substr(0,4),10);var month=parseInt(dateYYYYMMDDstr.substr(4,2),10);var day=parseInt(dateYYYYMMDDstr.substr(6,2),10);return""+day+" "+Geotool.Calendar.monthNames[month-1]+" "+year;},formatMMDD:function(dateMMDDstr){var month=parseInt(dateMMDDstr.substr(0,2),10);var day=parseInt(dateMMDDstr.substr(2,2),10);return""+day+" "+Geotool.Calendar.monthNames[month-1];},formatAsTime:function(timestampInSeconds){var d=new Date(timestampInSeconds*1000);return d.getHours()+':'+(d.getMinutes()<10?'0':'')+d.getMinutes();},formatAsDate:function(timestampInSeconds){var d=new Date(timestampInSeconds*1000);return d.getDate()+'/'+(d.getMonth()+1);},formatAsLongDate:function(timestampInSeconds){var d=new Date(timestampInSeconds*1000);return d.getDate()+'-'+(d.getMonth()+1)+'-'+d.getFullYear();}}
Geotool.Component=OpenLayers.Class({title:null,projecttype:null,map:null,baselayerCache:{},cssUrl:null,initialize:function(map,options){OpenLayers.Util.extend(this,options);this.map=map;this.cssUrl=Geotool.getComponentBaseUrl(this.projecttype)+"/style.css";},load:function()
{return;},activate:function(){var activated=true;if(this.cssUrl){Geotool.loadCss(this.cssUrl);}
if(this.groupLayer){this.map.addLayer(this.groupLayer);}
this.controller=this.map.getControl(Geotool.controllerName);if(this.controller&&this.controller.events){this.controller.events.on({"changebaselayertype":this.setBaseLayer,scope:this});this.controller.events.on({"changecategory":this.categoryChanged,scope:this});}
var legendControl=this.map.getControl(Geotool.legendControlId);var legendEl=document.getElementById('legend'+this.projecttype);if(legendControl&&legendEl&&legendEl.style){legendControl.activate();}
this.setVisibility(true);return activated;},deactivate:function(){var deactivated=true;if(this.groupLayer){this.map.removeLayer(this.groupLayer);}
this.setVisibility(false);var legendControl=this.map.getControl(Geotool.legendControlId);var legendEl=document.getElementById('legend'+this.projecttype);if(legendControl&&legendEl&&legendEl.style){legendControl.deactivate();}
if(this.controller&&this.controller.events){this.controller.events.un({"changebaselayertype":this.setBaseLayer,scope:this});this.controller.events.un({"changecategory":this.categoryChanged,scope:this});this.controller=null;}
return deactivated;},setVisibility:function(visible)
{if(this.groupLayer){this.groupLayer.setVisibility(visible);}
if(this.categoryControl){this.categoryControl.setVisibility(visible);if(visible==true){this.categoryControl.setCategory();}}
this.setDisplayStyle('legend'+this.projecttype,(visible?'block':'none'));},setDisplayStyle:function(elementId,style)
{var element=document.getElementById(elementId);if(element&&element.style){element.style.display=style;}},setBaseLayer:function(baselayertype)
{if(baselayertype&&typeof baselayertype!="string"){if(baselayertype.layernameprefix&&baselayertype.layernameprefix.length>0){this.layernameprefix=baselayertype.layernameprefix;}
baselayertype=baselayertype.baselayertype;}
var layernameprefix;var layername=null;if(typeof this.layernameprefix=="function"){layernameprefix=this.layernameprefix();}else{layernameprefix=this.layernameprefix;}
if(baselayertype=='SATLUFO'){layername=layernameprefix+"satlufo2";}else{layername=layernameprefix+"topo2";}
if(layername!=null){if(!this.baselayerCache[layername]){this.baselayerCache[layername]=this.addBaseLayer(baselayertype,layername);}
this.map.setBaseLayer(this.baselayerCache[layername]);}},addBaseLayer:function(baselayertype,layers)
{var attribution=null;if(baselayertype=='SATLUFO'){attribution='<span style="color:white">&copy; Eurosense 2008</span>';}else{attribution='<span style="color:black">&copy; &nbsp; <a href="http://creativecommons.org/licenses/by-sa/2.0/" title="Creative Commons Attribution-ShareAlike 2.0">OpenStreetMap</a></span>';}
if(attribution){var layer=new OpenLayers.Layer.TileCache(baselayertype,tilecache_files_url,layers,{'format':'image/jpeg','buffer':0,isBaseLayer:true,'projection':'EPSG:28992','units':'m','attribution':attribution});this.map.addLayer(layer);return layer;}
return null;},categoryChanged:function(categoryEvent)
{},CLASS_NAME:"Geotool.Component"});Geotool.Component.BPRW=OpenLayers.Class(Geotool.Component,{layernameprefix:"waterkaart_",projecttype:'bprw',searcherTypes:"adres,vaarweg",groupLayer:null,popup:null,title:"Projecten waterkwaliteit",featureInfoControl:null,firstActivate:true,wmsLayer:null,initialLayers:'leefgebied,water,vis',iconLookup:null,layerLookup:null,initialize:function(map,bLoadProjects,options){Geotool.Component.prototype.initialize.apply(this,arguments);this.categoryControl=new Geotool.Control.CategoryControl("categorybprwform","categorybprwinput","categorybprw");this.categoryControl.setPolicy('toggle');if(map){map.addControl(this.categoryControl);}
this.categoryControl.setCategory('1,2,3',true);this.groupLayer=new Geotool.Layer.Group("BPRWProjecten");this.wmsLayer=null;this.layerLookup={1:"leefgebied",2:"water",3:"vis"};var styleMap=new OpenLayers.StyleMap({fillOpacity:1,pointRadius:30});this.iconLookup={2:{externalGraphic:"components/bprw/icons/icon_set02_leefgebied_omg.png"},3:{externalGraphic:"components/bprw/icons/icon_set02_leefgebied_punt.png"},5:{externalGraphic:"components/bprw/icons/icon_set02_schoonwater_omg.png"},6:{externalGraphic:"components/bprw/icons/icon_set02_schoonwater_punt.png"},8:{externalGraphic:"components/bprw/icons/icon_set02_vis_omg.png"},9:{externalGraphic:"components/bprw/icons/icon_set02_vis_punt.png"}}
styleMap.addUniqueValueRules("default","ICONCATNR",this.iconLookup);var icon=new OpenLayers.Icon("_img/almost_transparent_marker.png",new OpenLayers.Size(17,17));this.featureInfoControl=new Geotool.Control.FeatureInfo({markerIcon:icon,handlerOptions:{delay:500}});},activate:function(){Geotool.Component.prototype.activate.apply(this,arguments);this.map.addControl(this.featureInfoControl);this.featureInfoControl.events.on({'featureinfostart':this.featureInfoStart,scope:this});this.featureInfoControl.events.on({'beforefeatureadded':this.doBeforeFeatureAdded,scope:this});this.map.activeLayer=this.wmsLayer;this.featureInfoControl.activate();setTimeout(OpenLayers.Function.bind(this.makeLayer,this),10);},deactivate:function()
{this.map.removeControl(this.featureInfoControl);Geotool.Component.prototype.deactivate.apply(this,arguments)
this.featureInfoControl.deactivate();this.featureInfoControl.events.un({'featureinfostart':this.featureInfoStart,scope:this});this.featureInfoControl.events.un({'beforefeatureadded':this.doBeforeFeatureAdded,scope:this});},makeLayer:function()
{if(!this.wmsLayer){this.wmsLayer=new OpenLayers.Layer.WMS('bprw','wms.php/rwsnl/bprw',{layers:this.initialLayers,'format':'image/png',transparent:true},{'buffer':0,isBaseLayer:false,'projection':'EPSG:28992','units':'m',singleTile:true,alpha:true});this.wmsLayer.setVisibility(true);this.groupLayer.addLayer(this.wmsLayer)
if(this.map){this.map.activeLayer=this.wmsLayer;}}
return this.wmsLayer;},featureInfoStart:function(evt)
{this.removePopupAndFeature();},onPopupClose:function(event){this.removePopupAndFeature();},removePopupAndFeature:function(){if(this.popup){map.removePopup(this.popup)};this.featureInfoControl.destroyFeature(true);},doBeforeFeatureAdded:function(evt){if(!evt.featurelist||!evt.feature||evt.featurelist.length==0||evt.featurelist[0].features.length==0){return false;}
var attrs=evt.featurelist[0].features[0].attributes;var iconPath='components/bprw/icons/';var icons=['',iconPath+'icon_leefgebied.gif',iconPath+'icon_schoonwater.gif',iconPath+'icon_vis.gif'];var catName=['','Herstel leefgebied','Schoon water','Ruim baan voor vis'];var html='<div class="bprw bprw_'+attrs.CATEGORIE+'">'
+'<table class="olPopupTable" cellspacing="0">'
+'<tr><td class="popinleftbar"><img border="0" src="'
+icons[attrs.CATEGORIE]+'"></td>'
+'<td class="title">&nbsp;</td><td class="title">'+attrs.MARKERTITLE+'</td></tr>'
+'<tr><td>&nbsp;</td><td class="subtitle">&nbsp;</td><td class="subtitle">'+catName[attrs.CATEGORIE]+'</td></tr>';evt.feature.data['miniPopupContentHTML']=html+"</table></div>";var staging=(document.location.pathname.indexOf('/staging/')!=-1);if(staging&&attrs.CMS_ID){html+="<tr class='roweven'><td colspan='2' class='rowlabel'>CMS ID:</td><td class='rowtext'>"+attrs.CMS_ID+"</td></tr>";}
html+=attrs.MARKERDESCRIPTION
+"</table></div>";evt.feature.data['popupContentHTML']=html;if(evt.feature.lonlat){evt.feature.data.ids=evt.feature.lonlat.lon+","+evt.feature.lonlat.lat;evt.feature.lonlat.lon=attrs.X;evt.feature.lonlat.lat=attrs.Y;}
iconSize=new OpenLayers.Size(55,75);iconOffset=new OpenLayers.Pixel(-27,-48);if(attrs.ICONCATNR%3==0){iconSize=new OpenLayers.Size(55,55);iconOffset=new OpenLayers.Pixel(-27,-48);}
evt.feature.data.icon=new OpenLayers.Icon(this.iconLookup[attrs.ICONCATNR].externalGraphic,iconSize,iconOffset);evt.feature.data.popupClass='bprw bprw_'+attrs.CATEGORIE+' olPopup';return true;},categoryChanged:function(categoryEvent)
{this.removePopupAndFeature();layers="";for(var i=0;i<categoryEvent.allCategories.length;i++){if(i==0){layers=this.layerLookup[categoryEvent.allCategories[i]];}
else{layers=layers+","+this.layerLookup[categoryEvent.allCategories[i]];}}
if(!this.wmsLayer){this.initialLayers=layers;}else{if(layers.length==0){this.wmsLayer.setVisibility(false);}
else{this.wmsLayer.setVisibility(true);}
this.wmsLayer.mergeNewParams({"LAYERS":layers});}},CLASS_NAME:"Geotool.Component.BPRW"});Geotool.componentClasses.push(Geotool.Component.BPRW);Geotool.Component.VectorBase=OpenLayers.Class(Geotool.Component,{hoverCtrl:null,selectCtrl:null,vectorLayer:null,initialize:function(map,bLoadProjects,options){Geotool.Component.prototype.initialize.apply(this,arguments);this.loadEndEventHandlerOnThis=OpenLayers.Function.bind(this.loadEndEventHandler,this);},activate:function(){Geotool.Component.prototype.activate.apply(this,arguments);this.activateLayer();},deactivate:function()
{if(this.vectorLayer){this.hoverCtrl.deactivate();this.map.removeControl(this.hoverCtrl);this.selectCtrl.deactivate();this.map.removeControl(this.selectCtrl);}
Geotool.Component.prototype.deactivate.apply(this,arguments)},activateLayer:function()
{if(this.vectorLayer==null&&this.makeLayer){var layer=this.makeLayer();if(layer){this.vectorLayer=layer;this.vectorLayer.events.register('featuresadded',this.vectorLayer,this.loadEndEventHandlerOnThis);this.groupLayer.addLayer(this.vectorLayer);}}
if(this.vectorLayer){if(!this.map.getControl(this.hoverCtrl.id)){this.map.addControl(this.hoverCtrl);this.hoverCtrl.activate();}
if(!this.map.getControl(this.selectCtrl.id)){this.map.addControl(this.selectCtrl);this.selectCtrl.activate();}}},loadEndEventHandler:function()
{this.vectorLayer.events.unregister('featuresadded',this.vectorLayer,this.loadEndEventHandlerOnThis);setTimeout(OpenLayers.Function.bind(this.openWorksFeature,this),300);},openWorksFeature:function()
{if(!hasInitialPopupOpened&&Geotool.argParser.getParam('works')){hasInitialPopupOpened=true;var works=Geotool.argParser.getParam('works');if(this.vectorLayer){var feature=this.getFeatureById(works);if(feature!=null)
{this.selectCtrl.clickFeature(feature);}}}},addControls:function(vectorLayer)
{this.hoverCtrl=new OpenLayers.Control.SelectFeature(vectorLayer,{hover:true,highlightOnly:true,eventListeners:{featurehighlighted:this.onFeatureHighlight,featureunhighlighted:this.onFeatureUnhighlight}})
this.selectCtrl=new OpenLayers.Control.SelectFeature(vectorLayer,{clickout:true,toggle:true,onSelect:this.onFeatureSelect,onUnselect:this.onFeatureUnselect})
this.hoverCtrl.handlers.feature.stopDown=false;this.selectCtrl.handlers.feature.stopDown=false;},onFeatureHighlight:function(event){event.feature.openMiniPopup();event.feature.clearTimer();},onFeatureUnhighlight:function(event){if(!event.feature.mouseOverPopup){event.feature.closeMiniPopupDelayed();}},onFeatureSelect:function(feature){for(var i=0;i<feature.layer.map.popups.length;i++){feature.layer.map.removePopup(feature.layer.map.popups[i]);}
feature.layer.map.addPopup(feature.createPopup(feature.popupCloseFunc));feature.removeLinksFromTabOrder(feature.popup);feature.layer.map.selectedFeature=feature;},onFeatureUnselect:function(feature){for(var i=0;i<feature.layer.map.popups.length;i++){feature.layer.map.removePopup(feature.layer.map.popups[i]);}
feature.layer.map.selectedFeature=null;},addPopupFunctions:function(feature){var me=this;feature.popupOpenFunc=function(evt){me.selectCtrl.clickFeature(feature);if(evt){OpenLayers.Event.stop(evt);}};feature.popupCloseFunc=function(evt){me.selectCtrl.clickFeature(feature);if(evt){OpenLayers.Event.stop(evt);}};},getFeatureById:function(featureId){var feature=null;var id=null;var attrs=null;for(var i=0,len=this.vectorLayer.features.length;i<len;++i){attrs=this.vectorLayer.features[i].attributes;if(attrs.id){id=attrs.id;}else if(attrs.ids&&attrs.ids.length&&attrs.ids.length>0){id=attrs.ids[0];}
if(id==featureId){feature=this.vectorLayer.features[i];break;}}
return feature;},CLASS_NAME:"Geotool.Component.VectorBase"});Geotool.Control.ArgParser=OpenLayers.Class(OpenLayers.Control,{displayProjection:null,preferredAsUrlParameters:['projecttype','kml','kmllegend','baselayer'],onlyAsUrlParameters:['width','height'],initialize:function(options){OpenLayers.Control.prototype.initialize.apply(this,arguments);var parameterFromCookie=getCookie(Geotool.cookieName);var urlParams=OpenLayers.Util.getParameters(window.location.href);if(!parameterFromCookie||parameterFromCookie==""){this.params=urlParams;}
else{this.params=OpenLayers.Util.getParameters(parameterFromCookie);var paramName='';for(var oi=0;oi<this.onlyAsUrlParameters.length;oi++){paramName=this.onlyAsUrlParameters[oi];if(urlParams[paramName]){this.params[paramName]=urlParams[paramName];}else{delete this.params[paramName];}}
for(var pi=0;pi<this.preferredAsUrlParameters.length;pi++){paramName=this.preferredAsUrlParameters[pi];if(typeof this['fixParam'+paramName]=='function'){this.params[paramName]=this['fixParam'+paramName](urlParams[paramName],this.params[paramName]);}else if(urlParams[paramName]){this.params[paramName]=urlParams[paramName];}}}},fixParambaselayer:function(urlvalue,cookievalue)
{var layernameprefix='';var baselayer='';if(urlvalue){var pos=urlvalue.indexOf('_');if(pos>0){layernameprefix=urlvalue.substring(0,pos+1);baselayer=urlvalue.substring(pos+1);}else{baselayer=urlvalue;}}
if(cookievalue){var pos=cookievalue.indexOf('_');if(pos>0){baselayer=cookievalue.substring(pos+1);}else{baselayer=cookievalue;}}
return layernameprefix+baselayer;},getParam:function(paramName){if(this.params[paramName]){var value=this.params[paramName];if(typeof value=="string"){if(value.indexOf(",")>=0){value=value.split(",");}}
return value;}
return null;},setMap:function(map){OpenLayers.Control.prototype.setMap.apply(this,arguments);var controller=null;if(this.map){controller=this.map.getControl(Geotool.controllerName);}
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"||control.CLASS_NAME=="Geotool.Control.ArgParser")){if(control.displayProjection!=this.displayProjection){this.displayProjection=control.displayProjection;}
break;}}
if(i==this.map.controls.length&&controller!=null){var baselayer=this.getParam('baselayer');if(baselayer!=null&&baselayer!=""&&baselayer!="null")
{controller.baseLayerTypeControl.setBaseLayerType(baselayer.toUpperCase());}else{controller.baseLayerTypeControl.setBaseLayerType("KAART");}
var projecttype=this.getParam("projecttype");if(projecttype){controller.changefilter({'projecttype':projecttype});}
if(!controller.currentComponent){controller.changefilter({'projecttype':"wegen"});}
var bbox=this.getParam('bbox');var center=this.getParam('center');var mapscale=this.getParam('mapscale');if(bbox&&bbox.length&&bbox.length==4){this.map.zoomToExtent(new OpenLayers.Bounds(bbox[0],bbox[1],bbox[2],bbox[3]),true);}else{if(center&&mapscale&&center.length&&center.length==2&&(mapscale!="")){this.center=new OpenLayers.LonLat(center[0],center[1]);this.mapscale=mapscale;}else{this.center=null;}
this.map.events.register('changebaselayer',this,this.setCenter);this.setCenter();}
if(this.getParam('legend')&&controller.currentComponent.categoryControl&&controller.currentComponent.categoryControl.radioForm)
{var value=this.getParam('legend');controller.currentComponent.categoryControl.setCategory(value,true);}}},setCenter:function(){if(this.map.baseLayer){this.map.events.unregister('changebaselayer',this,this.setCenter);if(this.center&&this.mapscale){if(this.displayProjection){this.center.transform(this.displayProjection,this.map.getProjectionObject());}
var res=OpenLayers.Util.getResolutionFromScale(parseInt(this.mapscale),this.map.baseLayer.units);this.map.setCenter(this.center,this.map.getZoomForResolution(res));}else{var maxExtent=this.map.getMaxExtent();var center=maxExtent.getCenterLonLat();this.map.setCenter(center,1);}}},CLASS_NAME:"OpenLayers.Control.ArgParser"});Geotool.Control.BaseLayerTypeControl=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["changebaselayertype"],initialize:function(options)
{this.EVENT_TYPES=Geotool.Control.BaseLayerTypeControl.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[options]);this.selectlist=document.getElementById("baselayertypeselect");this.satlufobutton=document.getElementById("SATLUFO");this.kaartbutton=document.getElementById("KAART");var changehandler=OpenLayers.Function.bind(this.changeBaseLayerType,this);var onclickHandler=function(event){changehandler(this);return false;}
if(this.satlufobutton){this.satlufobutton.onclick=onclickHandler;}
if(this.kaartbutton){this.kaartbutton.onclick=onclickHandler;}
if(this.selectlist){this.selectlist.onchange=onclickHandler;}},changeBaseLayerType:function(srcobj)
{var id=null;if(srcobj.options){id=srcobj.options[srcobj.selectedIndex].value;}else{id=srcobj.id;}
this.setBaseLayerType(id);return true;},setBaseLayerType:function(baselayer)
{var layernameprefix='';var pos=baselayer.indexOf('_');if(pos>0){layernameprefix=baselayer.substring(0,pos+1).toLowerCase();baselayer=baselayer.substring(pos+1);}
if(baselayer=='SATLUFO')
{this.currentBaseLayer=baselayer;if(this.satlufobutton){this.satlufobutton.className='satelliet_btn_active';}
if(this.kaartbutton){this.kaartbutton.className='kaart_btn_inactive';}}
else
{this.currentBaseLayer='KAART';if(this.kaartbutton){this.kaartbutton.className='kaart_btn_active';}
if(this.satlufobutton){this.satlufobutton.className='satelliet_btn_inactive';}}
if(this.selectlist&&this.currentBaseLayer){for(var i=0;i<this.selectlist.options.length;i++){if(this.currentBaseLayer==this.selectlist.options[i].value){this.selectlist.options[i].selected=true;this.selectlist.selectedIndex=i;break;}}}
this.events.triggerEvent("changebaselayertype",{baselayertype:this.currentBaseLayer,layernameprefix:layernameprefix});},CLASS_NAME:"Geotool.Control.BaseLayerTypeControl"});Geotool.Control.FeatureInfo=OpenLayers.Class(OpenLayers.Control,{showMarker:true,markerIcon:OpenLayers.Marker.defaultIcon(),EVENT_TYPES:['featureinfostart','featureinfoend','beforefeatureadded'],callbacks:null,markerLayer:null,location:null,feature:null,counter:null,defaultHandlerOptions:{'delay':500,'pixelTolerance':5,'stopMove':false},initialOpenPopup:false,openPopup:false,initialize:function(options){this.EVENT_TYPES=Geotool.Control.FeatureInfo.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[options]);this.handlerOptions=OpenLayers.Util.extend({},this.defaultHandlerOptions);OpenLayers.Util.extend(this.handlerOptions,options.handlerOptions);this.handler=new OpenLayers.Handler.Hover(this,{'pause':this.onPause,'move':this.onMove},this.handlerOptions);this.handlers={};var clickCallbacks={'click':this.defaultClick};var clickOptions={'stopSingle':true};this.handlers.click=new OpenLayers.Handler.Click(this,clickCallbacks,clickOptions);},destroy:function(){if(this.showMarker&&this.markerLayer){this.markerLayer.destroy();this.markerLayer=null;this.destroyFeature(true);}
OpenLayers.Control.prototype.destroy.apply(this,arguments);},destroyFeature:function(forceAll){if(this.openFeature&&(forceAll||!this.map||this.openFeature!=this.map.selectedFeature)){this.openFeature.control=null;if(this.openFeature.marker){this.openFeature.marker.events.remove('click');this.openFeature.marker.events.remove('mousemove');if(this.markerLayer){this.markerLayer.removeMarker(this.openFeature.marker);}}
if(this.map&&this.openFeature==this.map.selectedFeature){this.map.selectedFeature=null;}
this.openFeature.destroy();}
if(this.feature){if(!forceAll&&this.map&&this.feature==this.map.selectedFeature){this.openFeature=this.feature;}else{this.feature.control=null;if(this.feature.marker){this.feature.marker.events.remove('click');this.feature.marker.events.remove('mousemove');if(this.markerLayer){this.markerLayer.removeMarker(this.feature.marker);}}
this.feature.destroy();}
this.feature=null;}},performRequest:function(layer,evt){var url=layer.getFullRequestString({REQUEST:"GetFeatureInfo",EXCEPTIONS:"application/vnd.ogc.se_xml",BBOX:this.map.getExtent().toBBOX(),X:evt.xy.x,Y:evt.xy.y,INFO_FORMAT:'application/vnd.ogc.gml',QUERY_LAYERS:layer.params.LAYERS,WIDTH:this.map.size.w,HEIGHT:this.map.size.h});this.wmsRequest=OpenLayers.Request.GET({url:url,success:this.returnResponse,failure:this.returnFailure,scope:{control:this,layer:layer}});},onMove:function(evt){this.abort();},abort:function(){if(this.wmsRequest){if(typeof this.wmsRequest.abort=="function"){this.wmsRequest.abort();this.map.div.style.cursor="default";this.events.triggerEvent('featureinfoend',{});}
this.wmsRequest=null;}
this.openPopup=false;},onPause:function(evt){if(!this.map.activeLayer||this.map.activeLayer.params.LAYERS.length==0){return;}
this.map.div.style.cursor="wait";this.events.triggerEvent('featureinfostart');this.counter=0;this.start();this.location=this.map.getLonLatFromPixel(evt.xy);this.performRequest(this.map.activeLayer,evt);},defaultClick:function(evt){this.openPopup=true;},returnFailure:function(response){if(this.control.showMarker){this.control.markerLayer.clearMarkers();this.control.destroyFeature();}
this.control.map.div.style.cursor="default";this.initialOpenPopup=false;this.openPopup=false;this.control.events.triggerEvent('featureinfoend',{});},returnResponse:function(response){this.control.counter++;this.control.wmsRequest=null;this.control.info(response,this.layer);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.markerLayer.clearMarkers();var icon=this.markerIcon.clone();icon.imageDiv.className='olIcon';var newFeature=new Geotool.Feature(this.markerLayer,this.location,{icon:icon});var result=this.events.triggerEvent('beforefeatureadded',{feature:newFeature,featurelist:this.featurelist});if(!result){this.destroyFeature();}else{this.destroyFeature(true);this.feature=newFeature;this.feature.control=this;var marker=this.feature.createMarker();marker.events.register('click',this.feature,this.feature.markerClick);marker.events.register('mousemove',this,this.onPopupMousemove);marker.events.register('mouseout',this.feature,this.feature.closeMiniPopupDelayed);this.markerLayer.addMarker(marker);if(this.initialOpenPopup||this.openPopup){this.initialOpenPopup=false;this.openPopup=false;this.feature.markerClick();}else{this.feature.openMiniPopup();}}}
this.map.div.style.cursor="default";this.events.triggerEvent('featureinfoend',{featurelist:this.featurelist});},onPopupMousemove:function(evt){this.handler.clearTimer();if(this.feature){this.feature.openMiniPopupDelayed();}
OpenLayers.Event.stop(evt,true);},info:function(response,layer){var format=new OpenLayers.Format.WMSGetFeatureInfo();var features=format.read(response.responseXML||response.responseText||'testRene');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);}},activate:function()
{OpenLayers.Control.prototype.activate.apply(this,arguments);this.handlers.click.setMap(this.map);this.handlers.click.activate();if(this.markerLayer&&this.showMarker){this.markerLayer.setVisibility(true);}
if(!hasInitialPopupOpened&&Geotool.argParser.getParam('works')){hasInitialPopupOpened=true;if(this.map.getExtent()==null||!this.map.activeLayer){window.setTimeout(OpenLayers.Function.bind(this.openInitialPopup,this),50);}else{this.openInitialPopup();}}},openInitialPopup:function()
{var coords=Geotool.argParser.getParam('works');if(typeof coords=='object'&&coords.constructor==Array&&coords.length==2){this.initialOpenPopup=true;var location=new OpenLayers.LonLat(coords[0],coords[1]);this.onPause({xy:this.map.getPixelFromLonLat(location)});}},deactivate:function()
{if(this.markerLayer){this.markerLayer.setVisibility(false);}
this.handlers.click.deactivate();OpenLayers.Control.prototype.deactivate.apply(this,arguments);},CLASS_NAME:"Geotool.Control.FeatureInfo"});Geotool.Control.InfoPanel=OpenLayers.Class(OpenLayers.Control,{addCloseButton:true,contentUrl:null,element:null,initialize:function(element,options){OpenLayers.Control.prototype.initialize.apply(this,[options]);this.element=OpenLayers.Util.getElement(element);this.element.onclick=OpenLayers.Function.bind(this.onclick,this);},destroy:function(){if(this.closeDiv){OpenLayers.Event.stopObservingElement(this.closeDiv);this.div.removeChild(this.closeDiv);}
this.closeDiv=null;if(this.contentDiv){this.div.removeChild(this.contentDiv);}
this.contentDiv=null;OpenLayers.Control.prototype.destroy.apply(this,arguments);},onclick:function(){if(this.div.style.display=='none'){this.div.style.display='block';}else{this.div.style.display='none';}
return false;},draw:function(){var div=OpenLayers.Control.prototype.draw.apply(this,arguments);if(this.addCloseButton){this.addCloseBox(div);}
if(this.contentUrl){this.loadContent(this.contentUrl);}
return div;},addCloseBox:function(div){this.closeDiv=OpenLayers.Util.createDiv(this.id+"_close",null,new OpenLayers.Size(12,12));this.closeDiv.className="geotoolInfoPanelCloseBox";this.closeDiv.title="Sluiten";div.insertBefore(this.closeDiv,div.firstChild);var closeFunc=function(e){this.onclick();OpenLayers.Event.stop(e);};OpenLayers.Event.observe(this.closeDiv,"click",OpenLayers.Function.bindAsEventListener(closeFunc,this));},activate:function(){if(OpenLayers.Control.prototype.activate.apply(this,arguments)){this.setVisible(true);}},deactivate:function(){if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){this.setVisible(false);}},setVisible:function(isVisible){if(this.element&&this.element.style){if(!isVisible){this.element.style.display="none";}else{this.element.style.display="block";}}},loadContent:function(url){OpenLayers.Request.GET({url:url,callback:OpenLayers.Function.bind(this.loadContentHandler,this)});},loadContentHandler:function(request){if(!this.contentDiv){this.contentDiv=OpenLayers.Util.createDiv(this.id+"_content",null,null,null,'relative');this.div.appendChild(this.contentDiv);}
if(request.status==200){this.contentDiv.innerHTML=request.responseText;}
else{this.contentDiv.innerHTML="Inhoud niet beschikbaar.";}},CLASS_NAME:"Geotool.Control.InfoPanel"});Geotool.Control.Legend=OpenLayers.Class(OpenLayers.Control,{initialize:function(options){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.div=document.getElementById("legendaContainer");this.legendBtn=document.getElementById("legendaButton");this.legendBtn.onclick=OpenLayers.Function.bind(this.openCloseLegend,this);this.openCloseLegend(false);this.setVisible(false);if(OpenLayers.Util.alphaHack()){this.div.style.backgroundImage="url(data/legenda_bg.gif)";}},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments);this.div=null;if(this.legendBtn.onclick){this.legendBtn.onclick=null;}
this.legendBtn=null;},openCloseLegend:function(openState){var legendHeight="21px";var openIt=true;if(typeof openState!='boolean'){openIt=this.div.style.height==legendHeight;}else{openIt=openState;}
if(openIt){this.div.style.height="";this.div.style.overflow="visible";this.legendBtn.className="legenda_btn_active";}else{this.div.style.height=legendHeight;this.div.style.overflow="hidden";this.legendBtn.className="legenda_btn_inactive";}
return false;},activate:function(){if(OpenLayers.Control.prototype.activate.apply(this,arguments)){this.setVisible(true);}},deactivate:function(){if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){this.setVisible(false);}},setVisible:function(isVisible){if(this.div&&this.div.style){if(!isVisible){this.div.style.display='none';}else{this.div.style.display='block';}}},CLASS_NAME:"Geotool.Control.Legend"});Geotool.Control.LoadingPanel=OpenLayers.Class.create();Geotool.Control.LoadingPanel.prototype=OpenLayers.Class.inherit(OpenLayers.Control,{counter:0,maximized:false,layer:null,initialize:function(layer,options){OpenLayers.Control.prototype.initialize.apply(this,[options]);if(!layer){this.map.events.register('addlayer',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);}}else{this.layer=layer;layer.events.register('loadstart',this,this.maximizeControl);layer.events.register('loadend',this,this.minimizeControl);}},addLayer:function(evt){var layer=this.map.layers[this.map.layers.length-1];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.maximizeControl();}}},decreaseCounter:function(){if(this.counter>0){this.counter--;}
if(this.counter==0){if(this.maximized){this.minimizeControl();}}},draw:function(){if(this.div==null){var viewSize=this.map.getSize();msgW=Math.max(viewSize.w,300);msgH=Math.max(viewSize.h,200);var centerPx=new OpenLayers.Pixel(viewSize.w/2,viewSize.h/2);var size=new OpenLayers.Size(msgW,msgH);var centerPx2=centerPx.add(-msgW/2,-msgH/2);this.div=OpenLayers.Util.createDiv('OpenLayers_Control_LoadingPanel'+"_warning",centerPx2,size,null,null,null,"auto",.75);this.div.className='loading';}
return this.div;},minimizeControl:function(e){this.div.style.width="0px";this.div.style.height="0px";this.maximized=false;if(e!=null){OpenLayers.Event.stop(e);}},maximizeControl:function(e){var viewSize=this.map.getSize();msgW=Math.max(viewSize.w,300);msgH=Math.max(viewSize.h,200);this.div.style.width=msgW+"px";this.div.style.height=msgH+"px";this.maximized=true;if(e!=null){OpenLayers.Event.stop(e);}},destroy:function(){if(this.layer){this.layer.events.unregister('loadstart',this,this.maximizeControl);this.layer.events.unregister('loadend',this,this.minimizeControl);}else{if(this.map){this.map.events.unregister('addlayer',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:"Geotool.Control.LoadingPanel"});Geotool.Control.MousePosition=OpenLayers.Class(OpenLayers.Control,{element:null,numdigits:0,initialize:function(options){OpenLayers.Control.prototype.initialize.apply(this,arguments);},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.element){this.div.left="";this.div.top="";this.div.className=this.displayClass;this.element=this.div;}
this.redraw();return this.div;},redraw:function(evt){var lonLat;if(evt==null){lonLat=new OpenLayers.LonLat(0,0);}else{lonLat=this.map.getLonLatFromPixel(evt.xy);}
var mapScale;if(!this.map||!this.map.getScale()){mapScale='';}else{mapScale=this.map.getScale();}
var digits=parseInt(this.numdigits);var newHtml='<form name="xypicker"><LABEL for="mouse_x">X:&nbsp;</LABEL><input type="text" size="10" name="mouse_x" value="'+
lonLat.lon.toFixed(digits)+'"/>'+'&nbsp;&nbsp;<LABEL for=""mouse_y">Y:&nbsp;</LABEL>&nbsp;&nbsp;<input type="text" name="mouse_y" size="10" value="'+
lonLat.lat.toFixed(digits)+'"/>&nbsp;&nbsp;<LABEL for="scale">Schaal: </LABEL><input type="text" name="scale" size="10" value="'+
mapScale+'"/></form>';if(newHtml!=this.element.innerHTML){this.element.innerHTML=newHtml;}},setMap:function(){OpenLayers.Control.prototype.setMap.apply(this,arguments);this.map.events.register('click',this,this.redraw);},CLASS_NAME:"Geotool.Control.MousePosition"});Geotool.Control.Navigation=OpenLayers.Class(OpenLayers.Control,{dragPan:null,zoomBox:null,noclick:false,activate:function(){this.dragPan.activate();this.zoomBox.activate();return OpenLayers.Control.prototype.activate.apply(this,arguments);},deactivate:function(){this.zoomBox.deactivate();this.dragPan.deactivate();return OpenLayers.Control.prototype.deactivate.apply(this,arguments);},draw:function(){this.map.events.register("dblclick",this,this.defaultDblClick);if(!this.noclick){this.map.events.register("click",this,this.defaultClick);}
this.dragPan=new OpenLayers.Control.DragPan({map:this.map});this.zoomBox=new OpenLayers.Control.ZoomBox({map:this.map,keyMask:OpenLayers.Handler.MOD_SHIFT});this.dragPan.draw();this.zoomBox.draw();this.activate();},defaultClick:function(evt){var newCenter=this.map.getLonLatFromViewPortPx(evt.xy);this.map.setCenter(newCenter,this.map.zoom);OpenLayers.Event.stop(evt);return false;},defaultDblClick:function(evt){this.defaultClick(evt);return false;},CLASS_NAME:"Geotool.Control.Navigation"});Geotool.Control.PanZoom=OpenLayers.Class(OpenLayers.Control.PanZoom,{draw:function(px){OpenLayers.Control.prototype.draw.apply(this,arguments);px=new OpenLayers.Pixel(20,10);this.buttons=[];var sz=new OpenLayers.Size(22,22);var centered=new OpenLayers.Pixel(px.x+sz.w/2,px.y);var wposition=sz.w;if(this.zoomWorldIcon){centered=new OpenLayers.Pixel(px.x+sz.w,px.y);}
this._addButton("panup","north-mini.png",centered,sz)['title']="Naar boven schuiven";px.y=centered.y+sz.h;this._addButton("panleft","west-mini.png",px.add(-10,0),sz)['title']="Naar links schuiven";if(this.zoomWorldIcon){this._addButton("zoomworld","zoom-world-mini.png",px.add(sz.w,0),sz);wposition*=2;}
this._addButton("panright","east-mini.png",px.add(wposition,0).add(10,0),sz)['title']="Naar rechts schuiven";this._addButton("pandown","south-mini.png",centered.add(0,sz.h*2),sz)['title']="Naar beneden schuiven";this._addButton("zoomin","zoom-plus-mini.png",centered.add(0,sz.h*3+5),sz)['title']="Inzoomen";this._addButton("zoomout","zoom-minus-mini.png",centered.add(0,sz.h*4+5),sz)['title']="Uitzoomen";return this.div;},CLASS_NAME:"Geotool.Control.PanZoom"});Geotool.Control.PanZoomBar=OpenLayers.Class(OpenLayers.Control.PanZoomBar,{zoombarTop:10,zoombarBottom:6,zoombarSliderImgLocation:null,draw:function(px){OpenLayers.Control.prototype.draw.apply(this,arguments);px=new OpenLayers.Pixel(20,10);this.buttons=[];var sz=new OpenLayers.Size(22,22);var centered=new OpenLayers.Pixel(px.x+sz.w/2,px.y);var wposition=sz.w;if(this.zoomWorldIcon){centered=new OpenLayers.Pixel(px.x+sz.w,px.y);}
this._addButton("panup","north-mini.png",centered,sz)['title']="Naar boven schuiven";px.y=centered.y+sz.h;this._addButton("panleft","west-mini.png",px.add(-10,0),sz)['title']="Naar links schuiven";if(this.zoomWorldIcon){this._addButton("zoomworld","zoom-world-mini.png",px.add(sz.w,0),sz);wposition*=2;}
this._addButton("panright","east-mini.png",px.add(wposition,0).add(10,0),sz)['title']="Naar rechts schuiven";this._addButton("pandown","south-mini.png",centered.add(0,sz.h*2),sz)['title']="Naar beneden schuiven";this._addButton("zoomin","zoom-plus-mini.png",centered.add(0,sz.h*3+5),sz)['title']="Inzoomen";centered=this._addZoomBar(centered.add(3,sz.h*4+5));this._addButton("zoomout","zoom-minus-mini.png",centered.add(-3,+2),sz)['title']="Uitzoomen";return this.div;},_addZoomBar:function(centered){var imgLocation=OpenLayers.Util.getImagesLocation();if(this.zoombarSliderImgLocation){imgLocation=this.zoombarSliderImgLocation;}
var id=this.id+"_"+this.map.id;var zoomsToEnd=this.map.getNumZoomLevels()-1-this.map.getZoom();var slider=OpenLayers.Util.createAlphaImageDiv(id,centered.add(-2,zoomsToEnd*this.zoomStopHeight+this.zoombarTop),new OpenLayers.Size(20,9),imgLocation+"slider.png","absolute");slider.style.cursor='n-resize';this.slider=slider;this.slider['title']="Sleep de knop om in of uit te zoomen";imgLocation=OpenLayers.Util.getImagesLocation();this.sliderEvents=new OpenLayers.Events(this,slider,null,true,{includeXY:true});this.sliderEvents.on({"mousedown":this.zoomBarDown,"mousemove":this.zoomBarDrag,"mouseup":this.zoomBarUp,"dblclick":this.doubleClick,"click":this.doubleClick});var sz=new OpenLayers.Size();sz.h=this.zoomStopHeight*this.map.getNumZoomLevels()
+this.zoombarTop+this.zoombarBottom;sz.w=this.zoomStopWidth;var div=null;var zbid='OpenLayers_Control_PanZoomBar_Zoombar'+this.map.id;if(OpenLayers.Util.alphaHack()){div=OpenLayers.Util.createAlphaImageDiv(zbid,centered,new OpenLayers.Size(sz.w,this.zoomStopHeight),imgLocation+"zoombar.png","absolute",null,"crop");div.style.height=sz.h+"px";}else{div=OpenLayers.Util.createDiv(zbid,centered,sz,imgLocation+"zoombar.png");}
div.style.cursor='pointer';this.zoombarDiv=div;this.divEvents=new OpenLayers.Events(this,div,null,true,{includeXY:true});this.divEvents.on({"mousedown":this.divClick,"mousemove":this.passEventToSlider,"dblclick":this.doubleClick,"click":this.doubleClick});this.div.appendChild(div);this.startTop=parseInt(div.style.top);this.div.appendChild(slider);this.map.events.register("zoomend",this,this.moveZoomBar);centered=centered.add(0,this.zoomStopHeight*this.map.getNumZoomLevels()
+this.zoombarTop+this.zoombarBottom);return centered;},_addButton:function(id,img,xy,sz){var btn=OpenLayers.Control.PanZoomBar.prototype._addButton.apply(this,arguments);btn.style.cursor='pointer';return btn;},divClick:function(evt){if(!OpenLayers.Event.isLeftClick(evt)){return;}
var y=evt.xy.y;var top=OpenLayers.Util.pagePosition(evt.object)[1]+this.zoombarTop-3;var levels=(y-top)/this.zoomStopHeight;if(!this.map.fractionalZoom){levels=Math.floor(levels);}
var zoom=(this.map.getNumZoomLevels()-1)-levels;zoom=Math.min(Math.max(zoom,0),this.map.getNumZoomLevels()-1);this.map.zoomTo(zoom);OpenLayers.Event.stop(evt);},zoomBarDrag:function(evt){if(this.mouseDragStart!=null){var offsets=OpenLayers.Util.pagePosition(this.zoombarDiv);if((evt.clientY-offsets[1])>this.zoombarTop+1&&(evt.clientY-offsets[1])<parseInt(this.zoombarDiv.style.height)-8-this.zoombarBottom){OpenLayers.Control.PanZoomBar.prototype.zoomBarDrag.apply(this,arguments);}else{OpenLayers.Event.stop(evt);}}},zoomBarUp:function(evt){OpenLayers.Control.PanZoomBar.prototype.zoomBarUp.apply(this,arguments);this.zoomStart=null;},moveZoomBar:function(){var newTop=((this.map.getNumZoomLevels()-1)-this.map.getZoom())*this.zoomStopHeight+this.startTop+this.zoombarTop;this.slider.style.top=newTop+"px";},CLASS_NAME:"Geotool.Control.PanZoomBar"});Geotool.Control.PeriodControl=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["changeperiod"],startCalendar:null,endCalendar:null,lastDate:null,now:new Date(),initialize:function(formName,periodDivId,defaultPeriodDays,startDateStr,endDateStr,lastEndDateStr,options)
{this.EVENT_TYPES=Geotool.Control.PeriodControl.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[options]);this.div=document.getElementById(periodDivId);this.lastDate=this.createDateFromString(lastEndDateStr);this.defaultPeriodDays=defaultPeriodDays;var startDate=this.getDefaultStartDateObject();var endDate=this.getDefaultEndDateObject();this.now.setHours(0);this.now.setMinutes(1);if(startDateStr&&endDateStr){if(this.createDateFromString(startDateStr)!=null&&this.createDateFromString(endDateStr)!=null){startDate=this.createDateFromString(startDateStr);endDate=this.createDateFromString(endDateStr);}}
this.startCalendar=this.createCalendar('startcalendar','startperiodeinput',startDate);this.endCalendar=this.createCalendar('endcalendar','eindperiodeinput',endDate);this.updateDateInputs();document.getElementById("triggereindperiode").onclick=OpenLayers.Function.bind(function(){this.endCalendar.showAtElement(document.getElementById("triggereindperiode"),"BL");},this);document.getElementById("triggerstartperiode").onclick=OpenLayers.Function.bind(function(){this.startCalendar.showAtElement(document.getElementById("triggerstartperiode"),"BL");},this);},getDefaultStartDate:function()
{return this.formatDate(this.getDefaultStartDateObject());},getDefaultStartDateObject:function()
{return new Date();},getDefaultEndDate:function()
{return this.formatDate(this.getDefaultEndDateObject());},getDefaultEndDateObject:function()
{var endDate=new Date();if(this.defaultPeriodDays){endDate.setDate(endDate.getDate()+this.defaultPeriodDays);}else{endDate.setDate(endDate.getDate()+7);}
return endDate;},getStartDate:function()
{return this.formatDateFromCalendar(this.startCalendar);},getEndDate:function()
{return this.formatDateFromCalendar(this.endCalendar);},setLastDate:function(newDate)
{var lastDate=this.createDateFromString(newDate);this.lastDate=lastDate;this.startCalendar.lastDate=lastDate;this.endCalendar.lastDate=lastDate;},changeperiod:function(){this.updateDateInputs();this.events.triggerEvent("changeperiod");return false;},updateDateInputs:function(){document.getElementById("startperiodeinput").value=this.startCalendar.date.print(this.startCalendar.dateFormat);document.getElementById("eindperiodeinput").value=this.endCalendar.date.print(this.endCalendar.dateFormat);},createCalendar:function(calendarDivId,calendarInputId,date){var cal=new Calendar(1,date,this.onSelect,this.onClose);cal.lastDate=this.lastDate;cal.now=this.now;cal.periodControl=this;cal.inputId=calendarInputId;cal.setDateStatusHandler(this.disableNonValidDates);cal.yearStep=1;if(this.lastDate){cal.setRange(this.now.getFullYear(),this.lastDate.getFullYear());}
cal.weekNumbers=false;cal.ifFormat="%e %b %Y";cal.create();cal.element.id=calendarDivId;return cal;},onSelect:function(calendar,date){if(calendar.dateClicked){if(calendar.periodControl.startCalendar.date>calendar.periodControl.endCalendar.date){var newDate=new Date();if(calendar==calendar.periodControl.startCalendar){newDate.setDate(calendar.periodControl.startCalendar.date.getDate());newDate.setMonth(calendar.periodControl.startCalendar.date.getMonth());newDate.setFullYear(calendar.periodControl.startCalendar.date.getFullYear());calendar.periodControl.endCalendar.setDate(newDate);}
else{newDate.setDate(calendar.periodControl.endCalendar.date.getDate());newDate.setMonth(calendar.periodControl.endCalendar.date.getMonth());newDate.setFullYear(calendar.periodControl.endCalendar.date.getFullYear());calendar.periodControl.startCalendar.setDate(newDate);}}
calendar.callCloseHandler();calendar.periodControl.changeperiod();}},onClose:function(calendar){calendar.hide();},disableNonValidDates:function(date){if(date>this.lastDate||date<=this.now){return true;}
return false;},formatDateFromCalendar:function(calendar){var dateObject=new Date();if(calendar){dateObject=calendar.date;}
return this.formatDate(dateObject);},formatDate:function(dateObject){var day=(dateObject.getDate()<10?"0":"")+dateObject.getDate();var month=dateObject.getMonth()+1;var yearmonth=dateObject.getFullYear()+"-"+(month<10?"0":"")+month;return yearmonth+"-"+day;},createDateFromString:function(dateStr)
{var newDate=new Date();if(!dateStr){return null;}
newDate.setDate(1);dateArr=dateStr.split("-");if(dateArr.length<3){return null;}
var year=parseInt(dateArr[0],10);if(isNaN(year)){return null;}
newDate.setFullYear(year);var month=parseInt(dateArr[1],10);if(isNaN(month)||month<1||month>12){return null;}
newDate.setMonth(month-1);var day=parseInt(dateArr[2],10);if(isNaN(day)||day<1||day>31){return null;}
newDate.setDate(day);return newDate;},activate:function()
{OpenLayers.Control.prototype.activate.apply(this,arguments);this.div.style.display='block';},deactivate:function()
{this.div.style.display='none';OpenLayers.Control.prototype.deactivate.apply(this,arguments);},CLASS_NAME:"Geotool.Control.PeriodControl"});Geotool.Control.RadioForm=OpenLayers.Class({initialize:function(formName,radioFieldName,onClickFunction,divIdPrefix,options)
{OpenLayers.Util.extend(this,options);this.form=document.forms[formName];if(!this.form){return;}
this.policy='exclusive';if(!this.form.elements){return;}
this.radioFields=this.form.elements[radioFieldName];if(!this.radioFields){return;}
this.isSelect=false;this.isRadioOrCheckbox=false;if(this.radioFields.options){this.isSelect=true;}
if(!divIdPrefix){var divIdPrefix="";}
this.classElement=new Array();if(!this.isSelect){for(var i=0;i<this.radioFields.length;i++){filterId=divIdPrefix+this.radioFields[i].value;this.classElement[i]=document.getElementById(filterId);if(this.classElement[i]){this.classElement[i].filterid=this.radioFields[i].value;this.classElement[i].onclick=onClickFunction;}else if(this.radioFields[i].type=="radio"||this.radioFields[i].type=="checkbox"){this.isRadioOrCheckbox=true;this.radioFields[i].filterid=this.radioFields[i].value;this.radioFields[i].onclick=function(event){onClickFunction.apply(this,[event]);return true;}}}}else{this.radioFields.onchange=onClickFunction;}},setPolicy:function(newPolicy)
{this.policy=newPolicy;},highlightElement:function(value,isActive)
{if(!this.radioFields){return;}
if(!this.isSelect){for(var i=0;i<this.radioFields.length;i++){if(value==this.radioFields[i].value){if(this.policy=='toggle'){this.radioFields[i].checked=isActive;}else{this.radioFields[i].checked=true;}}
if(this.classElement[i]){var classname=this.classElement[i].className;var pos=classname.indexOf("_active");if(pos>0){classname=classname.substring(0,pos);}
var newIsActive=(pos>0);if(this.policy=='toggle'){if(value==this.radioFields[i].value){newIsActive=isActive;}}else{newIsActive=(value==this.radioFields[i].value);}
this.classElement[i].className=classname+(newIsActive?"_active":"");}}}else{for(var i=0;i<this.radioFields.options.length;i++){if(value==this.radioFields.options[i].value){this.radioFields.options[i].selected=true;this.radioFields.selectedIndex=i;break;}}}},getCount:function()
{if(!this.isSelect){return this.radioFields.length;}
return this.radioFields.options.length;},getValue:function(index)
{if(!this.isSelect){return this.radioFields[index].value;}
return this.radioFields.options[index].value;},isSelected:function(index)
{if(!this.isSelect){return this.radioFields[index].checked;}
return this.radioFields.options[index].selected;},CLASS_NAME:"Geotool.Control.RadioForm"});Geotool.Control.SearchContainer=new OpenLayers.Class(OpenLayers.Control,{searchers:[],searcherTypes:"",searchersDiv:null,searchTypeDropDown:null,searcherSelect:null,resultDropDown:null,currentSearcher:null,initialize:function(options){OpenLayers.Control.prototype.initialize.apply(this,arguments);if(this.div==null){return;}
this.div.innerHTML="";var form=document.createElement('form');form.id='searchercontainerform';form.action='';form.method='GET';this.div.appendChild(form);var me=this;form.onsubmit=function(){me.currentSearcher.hideResultDiv();me.currentSearcher.showMessage(me.currentSearcher.DEFAULT_MESSAGE);me.currentSearcher.search();return false;};var searchBlock1Div=document.createElement('div');searchBlock1Div.id="searchblock1div";form.appendChild(searchBlock1Div);searchBlock1Div.innerHTML="<span style='font-weight:bold'><label for='searcherSelect'>Zoek locatie: &nbsp;</label></span>";searchBlock1Div.innerHTML+='<select name="searcherSelect" id="searcherSelect">'+'</select>&nbsp;&nbsp;&nbsp;'
var searcherSelect=$('searcherSelect');this.searcherSelect=searcherSelect;var me=this;this.searcherSelect.onchange=function(){me.currentSearcher.hideResultDiv();me.selectSearcher(me.getSearcher(this.value));};var searchBlock2Div=document.createElement('div');searchBlock2Div.id="searchblock2div";form.appendChild(searchBlock2Div);var resultDiv=document.createElement('div');resultDiv.style.display="none";resultDiv.id="searchresultdiv";this.resultDropDown=resultDiv;searchBlock2Div.appendChild(this.resultDropDown);var searchersDiv=document.createElement('div');searchersDiv.className="inline";this.searchersDiv=searchersDiv;searchBlock2Div.appendChild(searchersDiv);var submitsearchbuttonDiv=document.createElement('input');submitsearchbuttonDiv['type']="image";submitsearchbuttonDiv['src']="_img/a_pixel.gif";submitsearchbuttonDiv.id="submitsearchbtn";submitsearchbuttonDiv.className="submitsearchbtnmouseout";submitsearchbuttonDiv['title']="Zoeken";submitsearchbuttonDiv['alt']="Zoeken";searchBlock2Div.appendChild(submitsearchbuttonDiv);submitsearchbuttonDiv.onmouseover=function(){document.getElementById('submitsearchbtn').className='submitsearchbtnmouseover';};submitsearchbuttonDiv.onmouseout=function(){document.getElementById('submitsearchbtn').className='submitsearchbtnmouseout';};submitsearchbuttonDiv.onfocus=function(){document.getElementById('submitsearchbtn').className='submitsearchbtnmouseover';};submitsearchbuttonDiv.onblur=function(){document.getElementById('submitsearchbtn').className='submitsearchbtnmouseout';};searchBlock2Div.appendChild(document.createElement('br'));var searchmessagesDiv=document.createElement('div');searchmessagesDiv.id="searchmessages";searchmessagesDiv.style.backgroundColor="white";searchmessagesDiv.style.position="relative";searchmessagesDiv.style.zIndex="999";searchBlock2Div.appendChild(searchmessagesDiv);for(var j=0;j<Geotool.searcherClasses.length;j++){var searcherClass=Geotool.searcherClasses[j];var searcher=new searcherClass(this,{});this.addSearcher(searcher);}},setMap:function(map){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var i=0;i<this.searchers.length;i++){this.map.addControl(this.searchers[i]);}},addSearcher:function(searcher){this.searchers.push(searcher);searcher.div.style.display="none";searcher.addEvents();},setSearchers:function(searcherString){var searcherTypes=null;if(typeof searcherString=='string'){searcherTypes=searcherString.split(',');}else if(typeof searcherString=='object'&&searcherString.constructor==Array){searcherTypes=searcherString;}else{this.div.style.display="none";return;}
this.div.style.display="";var selected=true;this.searcherSelect.innerHTML="";for(var i=0;i<searcherTypes.length;i++){var searcherType=searcherTypes[i];for(var j=0;j<this.searchers.length;j++){var searcher=this.searchers[j];if(searcherType==searcher.searchType){var optionId="searchSelect_"+OpenLayers.Util.createUniqueID();var option=document.createElement('option');option.appendChild(document.createTextNode(searcher.title));option['value']=searcher.CLASS_NAME;option['id']=optionId;if(selected){option['selected']='true'}
this.searcherSelect.appendChild(option);if(selected){searcher.div.style.display="inline";selected=false;this.selectSearcher(searcher);}
else{searcher.div.style.display="none";}}}}},getSearcher:function(classname){for(var i=0;i<this.searchers.length;i++){if(this.searchers[i].CLASS_NAME==classname){return this.searchers[i];}}},selectSearcher:function(searcher){if(this.currentSearcher&&this.currentSearcher.markerLayer){this.currentSearcher.markerLayer.clearMarkers();this.currentSearcher.markerLayer.clearFeatures();}
for(var i=0;i<this.searchers.length;i++){if(this.searchers[i].CLASS_NAME==searcher.CLASS_NAME){this.searchers[i].div.style.display="inline";this.currentSearcher=this.searchers[i];this.currentSearcher.activate();this.currentSearcher.setExampleInput();}
else{this.searchers[i].div.style.display="none";this.searchers[i].deactivate();}}},CLASS_NAME:"Geotool.Control.SearchContainer"});Geotool.Control.Searcher=OpenLayers.Class(OpenLayers.Control,{searchersDiv:null,searchersContainer:null,searchInputs:null,resultsArr:null,markerLayer:null,inputIsExample:false,DEFAULT_MESSAGE:'',GENERAL_ERROR_MESSAGE:'Probleem met deze zoekaktie, probeer a.u.b. opnieuw...',initialize:function(container,options){OpenLayers.Control.prototype.initialize.apply(this,[options]);this.searchersDiv=container.searchersDiv;this.searchersContainer=container;this.searchInputs=[];},setMap:function(map){OpenLayers.Control.prototype.setMap.apply(this,arguments);if(!this.markerLayer){this.markerLayer=new Geotool.Layer.JSON();this.map.addLayer(this.markerLayer);}},destroy:function(){return OpenLayers.Control.prototype.destroy.apply(this,arguments);},addEvents:function(){for(var i=0;i<this.searchInputs.length;i++){var me=this;this.searchInputs[i].onkeyup=function(e){if(!e)e=window.event;var key=e.keyCode||e.which;switch(key)
{case Event.KEY_RETURN:me.search();Event.stop(e);break;case Event.KEY_ESC:me.hideResultDiv();break;case Event.KEY_DELETE:me.hideResultDiv();break;case Event.KEY_BACKSPACE:me.hideResultDiv();break;default:me.hideResultDiv();}
return true;}
this.searchInputs[i].onfocus=function(e){for(var s=0;s<me.searchInputs.length;s++){if(me.searchInputs[s].example&&me.inputIsExample){if(me.searchInputs[s].value==me.searchInputs[s].example){me.searchInputs[s].value="";}}
me.searchInputs[s].style.color='black';}
me.inputIsExample=false;}}},search:function(){this.setInputBusy(true);this.searchImpl();},showMessage:function(msg){$('searchmessages').style.color='black';$('searchmessages').innerHTML=msg;for(var i=0;i<this.searchInputs.length;i++){this.searchInputs[i].style.borderColor='black';this.searchInputs[i].style.color='black';}
this.inputIsExample=false;},showErrorMessage:function(msg){$('searchmessages').style.color='red';$('searchmessages').innerHTML=msg;for(var i=0;i<this.searchInputs.length;i++){this.searchInputs[i].style.borderColor='red';this.searchInputs[i].style.color='red';}
this.inputIsExample=false;this.setInputBusy(false);},setInputBusy:function(busy){for(var i=0;i<this.searchInputs.length;i++){if(busy){OpenLayers.Element.addClass(this.searchInputs[i],'searchinput_busy');}else{OpenLayers.Element.removeClass(this.searchInputs[i],'searchinput_busy');}}},setExampleInput:function(){for(var i=0;i<this.searchInputs.length;i++){if(this.searchInputs[i].example){this.searchInputs[i].value=this.searchInputs[i].example;this.searchInputs[i].style.color="#bfbfbf";}}
this.inputIsExample=true;},handleGeneralError:function(req){this.showErrorMessage(this.GENERAL_ERROR_MESSAGE);this.setInputBusy(false);},showResultDiv:function(childDiv){for(var i=0;i<this.searchersContainer.resultDropDown.childNodes.length;i++){this.searchersContainer.resultDropDown.removeChild(this.searchersContainer.resultDropDown.childNodes[i]);}
this.searchersContainer.resultDropDown.appendChild(childDiv);this.searchersContainer.resultDropDown.style.display="inline";},hideResultDiv:function(){this.searchersContainer.resultDropDown.style.display="none";for(var i=0;i<this.searchersContainer.resultDropDown.childNodes.length;i++){this.searchersContainer.resultDropDown.removeChild(this.searchersContainer.resultDropDown.childNodes[i]);}},createDOMElement:function(type,attr,cont,html){var ne=document.createElement(type);if(!ne)
return 0;for(var a in attr)
ne[a]=attr[a];var t=typeof(cont);if(t=="string"&&!html)
ne.appendChild(document.createTextNode(cont));else if(t=="string"&&html)
ne.innerHTML=cont;else if(t=="object")
ne.appendChild(cont);return ne;},zoomTo:function(value,info,geometry,zoomLevel,markerLocation){this.markerLayer.clearMarkers();this.markerLayer.clearFeatures();if(geometry==null){this.showMessage("Gevonden: '"+value+"', "+info+" (maar geen XY beschikbaar)");return;}
var center=geometry.getBounds().getCenterLonLat();var zoom=this.map.getZoomForExtent(geometry.getBounds(),true);if(zoomLevel){zoom=zoomLevel;}
this.map.setCenter(center,zoom,false,true);this.markerLayer.setZIndex(this.map.Z_INDEX_BASE['Popup']-1);if(!markerLocation){markerLocation=center;}
var data={location:markerLocation,icon:{url:"_img/flag-32.png",width:32,height:32,offset:{x:-4,y:-27}},popupContentHTML:"<div class='olPopupContentTitle'>"+value+"<br/>"+info+"</div>",miniPopupContentHTML:"<div class='olPopupContentTitle'>"+value+"<br/>"+info+"</div>",description:null,popupPreferredSize:new OpenLayers.Size(225,null)};var feature=this.markerLayer.makeFeature(data);if(feature!=null){feature.control=this;var marker=this.markerLayer.makeMarker(feature,data);this.markerLayer.addFeatures([feature]);}
this.showMessage("Gevonden: '"+value+"', "+info);},handleResults:function(arr){this.setInputBusy(false);if(arr.length==1){obj=arr[0];this.zoomTo(obj.value,obj.info,obj.geometry,obj.zoom,obj.marker);}
else if(arr.length==0){this.showErrorMessage("Niets gevonden, probeer evt. een andere zoekterm.");}
else{var results=document.createElement('div');var MAX_RESULTS=10;for(var i=0,l=arr.length;i<l&&i<MAX_RESULTS;i++)
{this.resultsArr=arr;var val=arr[i].value;var output=val;var inputString=this.searchInputs[0].value;var st=val.toLowerCase().indexOf(inputString.toLowerCase());if(st>=0){output=val.substring(0,st)+'<em>'+val.substring(st,st+inputString.length)+'</em>'+val.substring(st+inputString.length);}
var span=this.createDOMElement('span',{},output,true);if(arr[i].info!=''&&arr[i].info!=null)
{var br=this.createDOMElement('br',{});span.appendChild(br);var small=this.createDOMElement('small',{},arr[i].info);span.appendChild(small);}
var a=this.createDOMElement('a',{href:'#'});a.appendChild(span);me=this;a.onclick=function(){var obj=me.resultsArr[parseInt(this.name)-1];me.zoomTo(obj.value,obj.info,obj.geometry,obj.zoom,obj.marker);me.hideResultDiv();return false;};a.onmouseover=function(){var obj=me.resultsArr[parseInt(this.name)-1];me.showMessage("Gevonden: '"+obj.value+"', "+obj.info+". Klik om in te zoomen.");};a.name=i+1;var li=this.createDOMElement('li',{},a);results.appendChild(li);}
if(arr.length>(MAX_RESULTS-1)){var span=this.createDOMElement('span',{},"<span>Meer dan "+MAX_RESULTS+" resultaten....    Verfijn uw zoekopdracht.</span>",true);var li=this.createDOMElement('li',{},span);results.appendChild(li);}
this.showResultDiv(results);}},CLASS_NAME:"Geotool.Control.Searcher"});Geotool.Format.KML=OpenLayers.Class(OpenLayers.Format.KML,{initialize:function(options){OpenLayers.Format.KML.prototype.initialize.apply(this,[options]);},parseFeature:function(node){var order=["MultiGeometry","Polygon","LineString","Point"];var type,nodeList,geometry,parser;for(var i=0,len=order.length;i<len;++i){type=order[i];this.internalns=node.namespaceURI?node.namespaceURI:this.kmlns;nodeList=this.getElementsByTagNameNS(node,this.internalns,type);if(nodeList.length>0){var parser=this.parseGeometry[type.toLowerCase()];if(parser){geometry=parser.apply(this,[nodeList[0]]);if(this.internalProjection&&this.externalProjection){geometry.transform(this.externalProjection,this.internalProjection);}}else{OpenLayers.Console.error(OpenLayers.i18n("unsupportedGeometryType",{'geomType':type}));}
break;}}
var attributes;if(this.extractAttributes){attributes=this.parseAttributes(node);}
var feature=new Geotool.Feature.Vector(geometry,attributes);var fid=node.getAttribute("id")||node.getAttribute("name");if(fid!=null){feature.fid=fid;}
feature.data.title=feature.attributes.name;var popup_icon="components/kml/icons/kml.gif";if(this.styles["#popup_icon"]){stylePopup=this.styles["#popup_icon"];popup_icon=stylePopup.externalGraphic;}
var styleUrl=this.styles[feature.attributes.styleUrl];if(styleUrl&&styleUrl.id){var stylePopup=this.styles["#"+styleUrl.id+"_popup_icon"];if(stylePopup&&stylePopup.externalGraphic){popup_icon=stylePopup.externalGraphic;}}
var html='<div class="kml">'
+'<table class="olPopupTable" cellspacing="0">'
+'<tr><td class="popinleftbar"><img border="0" src="'+popup_icon+'"></td>'
+'<td class="title">&nbsp;</td><td class="title">'+feature.data.title+'</td></tr>'
+'<tr><td class="subtitle">&nbsp;</td><td class="subtitle">&nbsp;</td><td class="subtitle">&nbsp;</td></tr>';feature.data['miniPopupContentHTML']=html+"</table></div>";replsdStr=feature.attributes.description;replsdStr=replsdStr.replace('<a href','<a target="_blank" href');replsdStr=replsdStr.replace('<A href','<A target="_blank" href');feature.data['popupContentHTML']=html+"<tr class='rowodd'><td colspan='3'>"+replsdStr+"</td></tr>"+"</table></div>";feature.data.popupClass="kml olPopup";feature.data.overflow=feature.data.overflow||"auto";return feature;},CLASS_NAME:"Geotool.Format.KML"});Geotool.Format.XLSAddress=OpenLayers.Class({addressee:null,countryCode:null,freeFormAddress:null,street:null,building:null,place:null,postalCode:null,initialize:function(countryCode,options){this.street=[];this.place={CountrySubdivision:null,CountrySecondarySubdivision:null,Municipality:null,MunicipalitySubdivision:null};OpenLayers.Util.extend(this,options);this.countryCode=countryCode;},format:function(){if(this.freeFormAddress){return this.freeFormAddress;}else{return this.getStreetText()+' '+this.getBuildingText()
+' '+this.getPostalCodeText()+' '+this.getPlaceText();}},getStreetText:function(address){if(!address){address=this;}
var text='';for(var si=0;si<address.street.length;si++){if(text!=''){text+=' ';}
text+=address.formatObject(address.street[si],Geotool.Format.XLSAddress.formattedStreetProperties);}
return text;},getBuildingText:function(address){if(!address){address=this;}
return address.formatObject(address.building,Geotool.Format.XLSAddress.formattedBuildingProperties);},getPostalCodeText:function(address){if(!address){address=this;}
return!address.postalCode?'':address.postalCode;},getPlaceText:function(address){if(!address){address=this;}
return address.formatObject(address.place,Geotool.Format.XLSAddress.formattedPlaceProperties);},formatObject:function(obj,props){if(!obj){return''};var text='';if(typeof obj=='string'){text=obj;}else if(props instanceof Array){for(var pi=0;pi<props.length;pi++){if(obj[props[pi]]){if(text!=''){text+=' ';}
text+=obj[props[pi]];}}}
return text;},CLASS_NAME:"Geotool.Format.XLSAddress"});Geotool.Format.XLSAddress.formattedPlaceProperties=['Municipality','MunicipalitySubdivision','CountrySecondarySubdivision','CountrySubdivision'];Geotool.Format.XLSAddress.formattedStreetProperties=['directionalPrefix','typePrefix','officialName','typeSuffix','directionalSuffix','muniOctant'];Geotool.Format.XLSAddress.formattedBuildingProperties=['number','subdivision','buildingName'];Geotool.Format.XLSLUS=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:"1.1.0",version:null,parser:null,initialize:function(options){OpenLayers.Format.XML.prototype.initialize.apply(this,[options]);},writeGeocodeRequest:function(address,options){var version=(options&&options.version)||this.version||this.defaultVersion;if(!this.parser||this.parser.VERSION!=version){var format=Geotool.Format.XLSLUS["v"+version.replace(/\./g,"_")];if(!format){throw"Can't find a XLSLUS parser for version "+
version;}
this.parser=new format(options);}
var root=this.parser.writeGeocodeRequest(address);return OpenLayers.Format.XML.prototype.write.apply(this,[root]);},writeReverseGeocodeRequest:function(position,options){var version=(options&&options.version)||this.version||this.defaultVersion;if(!this.parser||this.parser.VERSION!=version){var format=Geotool.Format.XLSLUS["v"+version.replace(/\./g,"_")];if(!format){throw"Can't find a XLSLUS parser for version "+
version;}
this.parser=new format(options);}
var root=this.parser.writeReverseGeocodeRequest(position);return OpenLayers.Format.XML.prototype.write.apply(this,[root]);},read:function(data,options){if(typeof data=="string"){data=OpenLayers.Format.XML.prototype.read.apply(this,[data]);}
var root=data.documentElement;var version=this.version;if(!version){version=root.getAttribute("version");if(!version){version=this.defaultVersion;}}
if(!this.parser||this.parser.VERSION!=version){var format=Geotool.Format.XLSLUS["v"+version.replace(/\./g,"_")];if(!format){throw"Can't find a XLSLUS parser for version "+
version;}
this.parser=new format(options);}
var xlslus=this.parser.read(data);return xlslus;},CLASS_NAME:"Geotool.Format.XLSLUS"});Geotool.Format.XLSLUS.v1=OpenLayers.Class(OpenLayers.Format.GML,{namespaces:{xls:"http://www.opengis.net/xls",gml:"http://www.opengis.net/gml",xsi:"http://www.w3.org/2001/XMLSchema-instance"},defaultPrefix:"xls",schemaLocation:null,addressClass:Geotool.Format.XLSAddress,srsName:'EPSG:4326',initialize:function(options){OpenLayers.Format.GML.prototype.initialize.apply(this,[options]);},read:function(data){var xlslus=[];this.readChildNodes(data,xlslus);return xlslus;},readers:{"xls":{"GeocodeResponse":function(node,xlslus){this.readChildNodes(node,xlslus);},"GeocodeResponseList":function(node,xlslus){var responseList={};responseList.features=[];responseList.numberOfGeocodedAddresses=node.getAttribute("numberOfGeocodedAddresses");this.readChildNodes(node,responseList);xlslus.push(responseList);},"GeocodedAddress":function(node,responseList){var feature=new OpenLayers.Feature.Vector();this.readChildNodes(node,feature);responseList.features.push(feature);},"GeocodeMatchCode":function(node,feature){var matchCode={};matchCode.accuracy=node.getAttribute("accuracy");matchCode.matchType=node.getAttribute("matchType");feature.attributes.geocodeMatchCode=matchCode;},"ReverseGeocodeResponse":function(node,xlslus){this.readChildNodes(node,xlslus);},"ReverseGeocodedLocation":function(node,xlslus){var feature=new OpenLayers.Feature.Vector();this.readChildNodes(node,feature);xlslus.push(feature);},"SearchCentreDistance":function(node,feature){var distance={};distance.value=node.getAttribute("value");distance.accuracy=node.getAttribute("accuracy");distance.uom=node.getAttribute("uom");if(!distance.uom){distance.uom="M";}
feature.attributes.searchCentreDistance=distance;},"Address":function(node,feature){var countryCode=node.getAttribute("countryCode");var address=new this.addressClass(countryCode);address.addressee=node.getAttribute("addressee");this.readChildNodes(node,address);feature.attributes.address=address;},"freeFormAddress":function(node,address){address.freeFormAddress=this.getChildValue(node);},"StreetAddress":function(node,address){this.readChildNodes(node,address);},"Building":function(node,address){var building={};building.number=node.getAttribute("number");building.subdivision=node.getAttribute("subdivision");building.buildingName=node.getAttribute("buildingName");address.building=building;},"Street":function(node,address){var street={};street.name=this.getChildValue(node);street.directionalPrefix=node.getAttribute("directionalPrefix");street.typePrefix=node.getAttribute("typePrefix");street.officialName=node.getAttribute("officialName");street.typeSuffix=node.getAttribute("typeSuffix");street.directionalSuffix=node.getAttribute("directionalSuffix");street.muniOctant=node.getAttribute("muniOctant");if(!street.directionalPrefix&&!street.typePrefix&&!street.officialName&&!street.typeSuffix&&!street.directionalSuffix&&!street.muniOctant){street=street.name;}
address.street.push(street);},"Place":function(node,address){var type=node.getAttribute("type");address.place[type]=this.getChildValue(node);},"PostalCode":function(node,address){address.postalCode=this.getChildValue(node);}},"gml":{"Point":function(node,feature){var parser=this.parseGeometry["point"];var geometry=parser.apply(this,[node]);if(this.internalProjection&&this.externalProjection){geometry.transform(this.externalProjection,this.internalProjection);}
feature.geometry=geometry;}}},writeGeocodeRequest:function(address){return this.writers.xls.GeocodeRequest.apply(this,[address]);},writeReverseGeocodeRequest:function(position){return this.writers.xls.ReverseGeocodeRequest.apply(this,[position]);},writers:{"xls":{"GeocodeRequest":function(address){var root=this.createElementNSPlus("GeocodeRequest",{attributes:{"xsi:schemaLocation":this.schemaLocation}});if(!(address instanceof Array)){address=[address];}
for(var i=0;i<address.length;i++){this.writeNode(root,"Address",address[i]);}
return root;},"ReverseGeocodeRequest":function(position){var root=this.createElementNSPlus("ReverseGeocodeRequest",{attributes:{"xsi:schemaLocation":this.schemaLocation}});this.writeNode(root,"Position",position);return root;},"Address":function(address){var node=this.createElementNSPlus("Address",{attributes:{"countryCode":address.countryCode,"addressee":address.addressee}});if(address.freeFormAddress){this.writeNode(node,"freeFormAddess",address.freeFormAddress);}else{this.writeNode(node,"StreetAddress",address);if(address.place){var classification=Geotool.Format.XLSLUS.v1.NamedPlaceClassification;for(var i=0;i<classification.length;i++){if(address.place[classification[i]]){var placeNode=this.writeNode(node,"Place",address.place[classification[i]]);this.setAttributes(placeNode,{"type":classification[i]});}}}
if(address.postalCode){this.writeNode(node,"PostalCode",address.postalCode);}}
return node;},"freeFormAddress":function(freeFormAddress){return this.createElementNSPlus("freeFormAddress",{value:freeFormAddress});},"StreetAddress":function(address){var node=this.createElementNSPlus("StreetAddress",{});if(address.building){this.writeNode(node,"Building",address.building);}
var street=address.street;if(!(street instanceof Array)){street=[street];}
for(var i=0;i<street.length;i++){this.writeNode(node,"Street",street[i]);}
return node;},"Building":function(building){return this.createElementNSPlus("Building",{attributes:{"number":building.number,"subdivision":building.subdivision,"buildingName":building.buildingName}});},"Street":function(street){if(typeof street=='string'){return this.createElementNSPlus("Street",{value:street});}else if(street&&street.name){return this.createElementNSPlus("Street",{value:street.name});}else{return this.createElementNSPlus("Street",{attributes:{"directionalPrefix":street.directionalPrefix,"typePrefix":street.typePrefix,"officialName":street.officialName,"typeSuffix":street.typeSuffix,"directionalSuffix":street.directionalSuffix,"muniOctant":street.muniOctant}});}},"Place":function(place){return this.createElementNSPlus("Place",{value:place});},"PostalCode":function(postalCode){return this.createElementNSPlus("PostalCode",{value:postalCode});},"Position":function(position){var node=this.createElementNSPlus("Position",{attributes:{"levelOfConf":position.levelOfConf}});if(position.CLASS_NAME&&position.CLASS_NAME=="OpenLayers.Geometry.Point"){position={point:position};}
this.writeNode(node,"gml:Point",position.point);if(position.shape){if(position.shape.CLASS_NAME&&position.shape.CLASS_NAME=="OpenLayers.Geometry.Polygon"){this.writeNode(node,"gml:Polygon",position.shape);}else if(position.shape.CLASS_NAME&&position.shape.CLASS_NAME=="OpenLayers.Geometry.MultiPolygon"){this.writeNode(node,"gml:MultiPolygon",position.shape);}}
if(position.qop){}
if(position.time){}
if(position.speed){}
if(position.direction){}
return node;}},"gml":{"Point":function(point){var node=this.createElementNSPlus("gml:Point",{attributes:{srsName:this.srsName}});this.writeNode(node,"gml:pos",point);return node;},"pos":function(point){return this.createElementNSPlus("gml:pos",{value:point.x+' '+point.y});},"CircleByCenterPoint":function(geometry){},"Polygon":function(geometry){return this.buildGeometryNode(geometry);},"MultiPolygon":function(geometry){return this.buildGeometryNode(geometry);}}},getNamespacePrefix:function(uri){var prefix=null;if(uri==null){prefix=this.namespaces[this.defaultPrefix];}else{var gotPrefix=false;for(prefix in this.namespaces){if(this.namespaces[prefix]==uri){gotPrefix=true;break;}}
if(!gotPrefix){prefix=null;}}
return prefix;},readChildNodes:function(node,obj){var children=node.childNodes;var child,group,reader,prefix,local;for(var i=0;i<children.length;++i){child=children[i];if(child.nodeType==1){prefix=this.getNamespacePrefix(child.namespaceURI);local=child.nodeName.split(":").pop();group=this.readers[prefix];if(group){reader=group[local];if(reader){reader.apply(this,[child,obj]);}}}}},writeNode:function(parent,name,obj){var prefix,local;var split=name.indexOf(":");if(split>0){prefix=name.substring(0,split);local=name.substring(split+1);}else{prefix=this.getNamespacePrefix(parent.namespaceURI);local=name;}
var child=this.writers[prefix][local].apply(this,[obj]);parent.appendChild(child);return child;},createElementNSPlus:function(name,options){options=options||{};var loc=name.indexOf(":");var uri=options.uri||this.namespaces[options.prefix];if(!uri){loc=name.indexOf(":");uri=this.namespaces[name.substring(0,loc)];}
if(!uri){uri=this.namespaces[this.defaultPrefix];}
var node=this.createElementNS(uri,name);if(options.attributes){this.setAttributes(node,options.attributes);}
if(options.value){node.appendChild(this.createTextNode(options.value));}
return node;},setAttributes:function(node,obj){var value,loc,alias,uri;for(var name in obj){if(obj[name]){value=obj[name].toString();uri=this.namespaces[name.substring(0,name.indexOf(":"))]||null;this.setAttributeNS(node,uri,name,value);}}},CLASS_NAME:"Geotool.Format.XLSLUS.v1"});Geotool.Format.XLSLUS.v1.NamedPlaceClassification=["CountrySubdivision","CountrySecondarySubdivision","Municipality","MunicipalitySubdivision"];Geotool.Layer.Group=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:false,layers:null,drawn:false,initialize:function(name,options){OpenLayers.Layer.prototype.initialize.apply(this,arguments);this.layers=new Array();},destroy:function(){this.layers=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments);},display:function(display){OpenLayers.Layer.prototype.display.apply(this,arguments);if(this.layers!=null){for(idx=0,len=this.layers.length;idx<len;idx++){if(display){this.layers[idx].display(this.layers[idx].getVisibility());}else{this.layers[idx].display(false);}}}},setMap:function(map){if(this.map==null){OpenLayers.Layer.prototype.setMap.apply(this,arguments);if(this.layers!=null){this.map.events.register('addlayer',this,this.addLayersToMap);}}},removeMap:function(map){if(this.map!=null){if(this.layers!=null){for(idx=0,len=this.layers.length;idx<len;idx++){this.map.removeLayer(this.layers[idx]);}}
OpenLayers.Layer.prototype.removeMap.apply(this,arguments);}},addLayersToMap:function(){this.map.events.unregister('addlayer',this,this.addLayersToMap);var layer=this.map.layers[this.map.layers.length-1];if(layer==this){for(idx=0,len=this.layers.length;idx<len;idx++){this.map.addLayer(this.layers[idx]);}}},addLayer:function(layer){this.layers.push(layer);if(this.map){this.map.addLayer(layer);if(this.layers.length==1){idx=this.map.getLayerIndex(this)+1;}else{idx=this.map.getLayerIndex(this.layers[this.layers.length-2])+1;}
this.map.setLayerIndex(layer,idx);}},removeLayer:function(layer){OpenLayers.Util.removeItem(this.layers,layer);if(this.map&&this.map.getExtent()){this.map.removeLayer(layer);}},getLayerIndex:function(layer){return OpenLayers.Util.indexOf(this.layers,layer);},setLayerIndex:function(layer,idx){var base=this.getLayerIndex(layer);if(idx<0){idx=0;}else if(idx>this.layers.length){idx=this.layers.length;}
if(base!=idx){this.layers.splice(base,1);this.layers.splice(idx,0,layer);if(this.map){var mapLayerIdx=0;if(idx==0){mapLayerIdx=this.map.getLayerIndex(this)+1;}else{mapLayerIdx=this.map.getLayerIndex(this.layers[idx-1])+1;}
this.map.setLayerIndex(layer,mapLayerIdx);}}},clearLayers:function(){if(this.layers!=null){while(this.layers.length>0){this.removeLayer(this.layers[0]);}}},getLayers:function(){return this.layers;},setVisibility:function(visibility,noEvent){if(this.layers!=null){for(idx=0,len=this.layers.length;idx<len;idx++){this.layers[idx].setVisibility(visibility,false);}}
OpenLayers.Layer.prototype.setVisibility.apply(this,arguments);},CLASS_NAME:"Geotool.Layer.Group"});Geotool.Layer.Markers=OpenLayers.Class(OpenLayers.Layer.Markers,{strategies:null,EVENT_TYPES:["beforefeaturesadded"],initialize:function(name,options){this.EVENT_TYPES=Geotool.Layer.Markers.prototype.EVENT_TYPES.concat(this.EVENT_TYPES);OpenLayers.Layer.Markers.prototype.initialize.apply(this,arguments);this.features=new Array();if(this.strategies){for(var i=0,len=this.strategies.length;i<len;i++){this.strategies[i].setLayer(this);}}},destroy:function(){if(this.strategies){var strategy,i,len;for(i=0,len=this.strategies.length;i<len;i++){strategy=this.strategies[i];if(strategy.autoDestroy){strategy.destroy();}}
this.strategies=null;}
this.clearFeatures();this.features=null;OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments);},setMap:function(map){OpenLayers.Layer.Markers.prototype.setMap.apply(this,arguments);if(this.strategies){var strategy,i,len;for(i=0,len=this.strategies.length;i<len;i++){strategy=this.strategies[i];if(strategy.autoActivate){strategy.activate();}}}},removeMap:function(map){if(this.strategies){var strategy,i,len;for(i=0,len=this.strategies.length;i<len;i++){strategy=this.strategies[i];if(strategy.autoActivate){strategy.deactivate();}}}
OpenLayers.Layer.Markers.prototype.removeMap.apply(this,arguments);},addFeatures:function(features,options){if(!(features instanceof Array)){features=[features];}
var notify=!options||!options.silent;if(notify){var event={features:features};var ret=this.events.triggerEvent("beforefeaturesadded",event);if(ret===false){return false;}
features=event.features;}
for(var i=0;i<features.length;i++){var marker=features[i].marker;if(!marker){marker=features[i].createMarker();}
this.features.push(features[i]);this.addMarker(marker);}
return true;},clearFeatures:function(){if(this.features!=null){while(this.features.length>0){var feature=this.features[0];OpenLayers.Util.removeItem(this.features,feature);feature.destroy();}}},CLASS_NAME:"Geotool.Layer.Markers"});Geotool.Marker.Html=OpenLayers.Class(OpenLayers.Marker,{contentHtml:null,contentHtmlClassName:"olIconHtml",initialize:function(lonlat,icon){OpenLayers.Marker.prototype.initialize.apply(this,arguments);if(typeof icon.contentHtml!="undefined"&&icon.contentHtml!=null){this.contentHtml=icon.contentHtml;}
this.contentHtmlId=OpenLayers.Util.createUniqueID("OL_Icon_Html_");},setContentHtml:function(newContentHtml){if(typeof newContentHtml!="undefined"&&newContentHtml!=null){this.contentHtml=newContentHtml;}else{this.contentHtml=null;}
this.draw();},draw:function(px){if(!this.icon){return;}
var icondiv=OpenLayers.Marker.prototype.draw.apply(this,arguments);icondiv.className='olIcon';var contentHtmlDiv=OpenLayers.Util.getElement(this.contentHtmlId);if(!contentHtmlDiv&&this.contentHtml!=null){contentHtmlDiv=OpenLayers.Util.createDiv(this.contentHtmlId,new OpenLayers.Pixel(0,0));contentHtmlDiv.className=this.contentHtmlClassName;this.icon.imageDiv.appendChild(contentHtmlDiv);}
if(contentHtmlDiv){contentHtmlDiv.innerHTML=this.contentHtml;}
return icondiv;},setContentHtmlClassName:function(newClassName)
{this.contentHtmlClassName=newClassName;var contentHtmlDiv=OpenLayers.Util.getElement(this.contentHtmlId);if(contentHtmlDiv&&contentHtmlDiv.className!=this.contentHtmlClassName){contentHtmlDiv.className=this.contentHtmlClassName;}},CLASS_NAME:"Geotool.Marker.Html"});Geotool.Popup.AnchoredBubble=OpenLayers.Class(OpenLayers.Popup.Anchored,{arrowDiv:null,map:null,initialize:function(id,lonlat,contentSize,contentHTML,anchor,closeFunc){var newArguments=new Array(id,lonlat,contentSize,contentHTML,anchor);OpenLayers.Popup.Anchored.prototype.initialize.apply(this,newArguments);this.contentDiv.style.width="";this.contentDiv.style.height="";this.contentDiv.style.overflow="";this.div.style.overflow="";var id=this.div.id+"_topDiv";this.topDiv=OpenLayers.Util.createDiv(id,null,null,null,"relative");this.topDiv.className='olPopupTop';this.div.insertBefore(this.topDiv,this.groupDiv);id=this.div.id+"_bottomDiv";this.bottomDiv=OpenLayers.Util.createDiv(id,null,null,null,"relative");this.bottomDiv.className='olPopupBottom';this.div.appendChild(this.bottomDiv);id=this.div.id+"_arrowDiv";this.arrowDiv=OpenLayers.Util.createDiv(id);this.arrowDiv.className='olPopupArrow';this.div.appendChild(this.arrowDiv);id=this.div.id+"_printDivPopup";this.printDivPopup=OpenLayers.Util.createDiv(id,null,null,null,"absolute");this.printDivPopup.className='olPrintDivPopup';this.printDivPopup.textContent='Popup';this.printDivPopup.innerHTML='Popup';id=this.div.id+"_printDivMap";this.printDivMap=OpenLayers.Util.createDiv(id,null,null,null,"absolute");this.printDivMap.className='olPrintDivMap';this.printDivMap.textContent='Kaart';this.printDivMap.innerHTML='Kaart';this.div.appendChild(this.printDivPopup);this.div.appendChild(this.printDivMap);OpenLayers.Event.observe(this.printDivPopup,"click",window.printPopup);OpenLayers.Event.observe(this.printDivMap,"click",window.printMap);if(closeFunc){var closeSize=new OpenLayers.Size(17,17);var img=OpenLayers.Util.getImagesLocation()+"close.gif";this.closeImg=OpenLayers.Util.createAlphaImageDiv(this.id+"_close",null,closeSize,img);this.closeImg.className="olPopupClose";this.div.appendChild(this.closeImg);OpenLayers.Event.observe(this.closeImg,"click",closeFunc);}},destroy:function(){if(this.closeImg){OpenLayers.Event.stopObservingElement(this.closeImg);this.div.removeChild(this.closeImg);this.closeImg=null;}
OpenLayers.Event.stopObservingElement(this.printDivMap);OpenLayers.Event.stopObservingElement(this.printDivPopup);this.div.removeChild(this.printDivMap);this.div.removeChild(this.printDivPopup);this.div.removeChild(this.arrowDiv);this.div.removeChild(this.bottomDiv);this.div.removeChild(this.topDiv);this.printDivMap=null;this.printDivPopup=null;this.arrowDiv=null;this.bottomDiv=null;this.topDiv=null;OpenLayers.Popup.Anchored.prototype.destroy.apply(this,arguments);},draw:function(px){OpenLayers.Popup.Anchored.prototype.draw.apply(this,arguments);this.arrowDiv.className="olPopupArrow_"+this.relativePosition;this.map.events.triggerEvent("popupopen");return this.div;},moveTo:function(px){OpenLayers.Popup.Anchored.prototype.moveTo.apply(this,arguments);this.arrowDiv.className="olPopupArrow_"+this.relativePosition;this.setArrowImg();},setArrowImg:function(){if(this.arrowDiv.childNodes.length>0)
{this.arrowDiv.removeChild(this.arrowDiv.childNodes[0]);}
var arrowsize;var imagename;var size=this.size||this.contentSize;if(size.h<65)
{arrowsize=new OpenLayers.Size(24,32);imagename="pijl_"+this.relativePosition+"_pr.gif"}
else
{arrowsize=new OpenLayers.Size(24,64);imagename="pijl_"+this.relativePosition+".gif"}
var img=OpenLayers.Util.getImagesLocation()+imagename;var arrowImg=OpenLayers.Util.createImage(this.id+"_arrow",null,arrowsize,img,null,null,null,true);this.arrowDiv.appendChild(arrowImg);},setBorder:function(border){this.border=0;},setSize:function(contentSize){if(contentSize!=undefined){this.size=contentSize.clone();}
if(this.div!=null){this.div.style.width=this.size.w+"px";this.div.style.height=this.size.h+"px";}},calculateNewPx:function(px){var newPx=px;var size=this.size||this.contentSize;var top=(this.relativePosition.charAt(0)=='t');newPx.y+=(top)?-size.h-4:4-20;var left=(this.relativePosition.charAt(1)=='l');newPx.x+=(left)?-size.w-4:4;return newPx;},CLASS_NAME:"Geotool.Popup.AnchoredBubble"});Geotool.Popup.Framed=OpenLayers.Class(OpenLayers.Popup.Framed,{keepInMap:false,preferredSize:new OpenLayers.Size(300,null),animateOpenStartSize:null,map:null,isAlphaImage:true,positionBlocks:{'tr':{'offset':new OpenLayers.Pixel(-28,1),'padding':new OpenLayers.Bounds(2,15,5,2),'blocks':[{size:new OpenLayers.Size('auto','auto'),anchor:new OpenLayers.Bounds(0,15,5,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(5,'auto'),anchor:new OpenLayers.Bounds(null,15,0,0),position:new OpenLayers.Pixel(-681,0)},{size:new OpenLayers.Size('auto',5),anchor:new OpenLayers.Bounds(0,10,5,null),position:new OpenLayers.Pixel(0,-683)},{size:new OpenLayers.Size(5,5),anchor:new OpenLayers.Bounds(null,10,0,null),position:new OpenLayers.Pixel(-681,-683)},{size:new OpenLayers.Size(15,15),anchor:new OpenLayers.Bounds(20,0,null,null),position:new OpenLayers.Pixel(-2,-697)}]}},relativePosition:"tr",fixedRelativePosition:true,barDisplayClass:'olPopupBar',barDiv:null,initialize:function(id,lonlat,contentSize,contentHTML,anchor,closeBox,closeBoxCallback,hideBottomBar){if(!OpenLayers.Util.alphaHack()){this.imageSrc=OpenLayers.Util.getImagesLocation()+'shadow-popup-relative.png';}else{this.imageSrc=OpenLayers.Util.getImagesLocation()+'shadow-popup-relative.gif';this.isAlphaImage=false;}
if(!hideBottomBar){this.positionBlocks={'tr':{offset:this.positionBlocks.tr.offset,padding:this.positionBlocks.tr.padding.clone(),blocks:this.positionBlocks.tr.blocks}};this.positionBlocks.tr.padding.bottom+=17;}
OpenLayers.Popup.Framed.prototype.initialize.apply(this,arguments);this.autoSize=true;if(!hideBottomBar){var id=this.div.id+"_bottomDiv";this.barDiv=OpenLayers.Util.createDiv(id);this.barDiv.className=this.barDisplayClass;this.barDiv.style.overflow='hidden';this.barDiv.style.width='100%';this.barDiv.style.height='17px';this.barDiv.style.left=this.positionBlocks.tr.padding.left+"px";this.barDiv.style.bottom=(this.positionBlocks.tr.padding.bottom-17)+"px";this.barDiv.style.zIndex=2;this.groupDiv.appendChild(this.barDiv);if(closeBox&&this.closeDiv){this.mycloseDiv=this.closeDiv;this.closeDiv=null;this.mycloseDiv.style.right="";this.mycloseDiv.style.top="";this.mycloseDiv.style.height="";this.mycloseDiv.style.width="";this.mycloseDiv.style.left=(this.positionBlocks.tr.padding.left+2)+"px";this.mycloseDiv.style.bottom=(this.positionBlocks.tr.padding.bottom-15)+"px";this.mycloseDiv.style.zIndex=3;this.mycloseDiv.innerHTML="Sluiten";}}},destroy:function(){if(this.barDiv){this.groupDiv.removeChild(this.barDiv);}
this.barDiv=null;if(this.mycloseDiv){this.closeDiv=this.mycloseDiv;}
this.mycloseDiv=null;OpenLayers.Popup.Framed.prototype.destroy.apply(this,arguments);},draw:function(px){var div=OpenLayers.Popup.Framed.prototype.draw.apply(this,arguments);if(this.animateOpenStartSize&&this.div!=null&&!OpenLayers.Util.alphaHack()){if(!this.openTween){this.openTween=new OpenLayers.Tween();}
var div=this.div;var contentDiv=this.contentDiv;var startObj={r:this.animateOpenStartSize.w,b:this.animateOpenStartSize.h,t:0,l:0};var endObj={r:this.size.w,b:this.size.h,t:0,l:0};if(this.relativePosition.charAt(0)=='t'){startObj.t+=(endObj.b-startObj.b);startObj.b=endObj.b;}
if(this.relativePosition.charAt(1)=='l'){startObj.l+=(endObj.r-startObj.r);startObj.r=endObj.r;}
this.openTween.start(startObj,endObj,30,{callbacks:{start:function(obj){if(contentDiv!=null&&OpenLayers.Util.getBrowserName()=='firefox'){var style=document.defaultView.getComputedStyle(contentDiv,null);var currentOverflow=style.getPropertyValue("overflow");if(currentOverflow!="hidden"){contentDiv._oldOverflow=currentOverflow;contentDiv.style.overflow="hidden";}}
div.style.clip="rect("+obj.t+"px, "+obj.r+"px, "+obj.b+"px, "+obj.l+"px)";},eachStep:function(obj){div.style.clip="rect("+obj.t+"px, "+obj.r+"px, "+obj.b+"px, "+obj.l+"px)";},done:function(lonlat){if(document.all&&!window.opera){div.style.clip="rect(auto, auto, auto, auto)";}else{div.style.clip="";}
if(contentDiv!=null){var oldOverflow=contentDiv._oldOverflow;if(oldOverflow){contentDiv.style.overflow=oldOverflow;contentDiv._oldOverflow=null;}}}}});}
this.map.events.triggerEvent("popupopen");return div;},visible:function(){try{return OpenLayers.Popup.Framed.prototype.visible.apply(this,arguments);}catch(err){return false;}},setSize:function(contentSize){var div=OpenLayers.Popup.Framed.prototype.setSize.apply(this,arguments);if(this.contentDiv!=null&&this.barDiv!=null){this.barDiv.style.width=this.contentDiv.style.width;}},updateSize:function(){if(!this.groupDiv){return;}
if((!this.visible()||this.panMapIfOutOfView)&&this.map&&this.map.panTween){this.map.panTween.stop();}
if(this.openTween){this.openTween.stop();}
var preparedHTML="<div class='"+this.contentDisplayClass+"'>"+
this.contentDiv.innerHTML+"<div>";var limitSize=new OpenLayers.Size();var sizeFound=false;var preferredSizeIncr=0;var triedNoLimit=false;var realSize=null;var safeSize=null;var noLimitSafeSize=null;var minHeight=10000;var optimalWidth=null;while(!sizeFound){if(this.preferredSize&&preferredSizeIncr<100){if(this.preferredSize.w){if(realSize&&realSize.h<minHeight){minHeight=realSize.h;optimalWidth=safeSize.w;}
limitSize.w=this.preferredSize.w+preferredSizeIncr;}
if(this.preferredSize.h){limitSize.h=this.preferredSize.h+preferredSizeIncr;}
preferredSizeIncr+=25;}else if(!triedNoLimit){limitSize=null;triedNoLimit=true;}else{limitSize=new OpenLayers.Size();limitSize.w=(safeSize.w<realSize.w)?safeSize.w:null;limitSize.h=(safeSize.h<realSize.h)?safeSize.h:null;if(realSize.h==minHeight&&optimalWidth!=null){var scrollBar=OpenLayers.Util.getScrollbarWidth();limitSize.w=optimalWidth+scrollBar;}
if(limitSize.w&&limitSize.h){safeSize=limitSize;sizeFound=true;break;}
noLimitSafeSize=safeSize;}
realSize=OpenLayers.Util.getRenderedDimensions(preparedHTML,limitSize,{displayClass:this.displayClass});safeSize=this.getSafeContentSize(realSize);if(safeSize.w>=realSize.w&&safeSize.h>=realSize.h){sizeFound=true;}
if(noLimitSafeSize){var currentOverflow=OpenLayers.Element.getStyle(this.contentDiv,"overflow");if((currentOverflow!="hidden")&&(noLimitSafeSize.equals(safeSize))){var scrollBar=OpenLayers.Util.getScrollbarWidth();if(limitSize.w){safeSize.h+=scrollBar;}else{safeSize.w+=scrollBar;}}
sizeFound=true;}}
this.setSize(safeSize);var currentOverflow=OpenLayers.Element.getStyle(this.contentDiv,"overflow");if(currentOverflow!="hidden"){var styleOverflow=this.contentDiv.style.overflow;this.contentDiv.style.overflow="hidden";var contentDiv=this.contentDiv;window.setTimeout(function(){contentDiv.style.overflow=styleOverflow;},10);}
if(this.visible()&&this.panMapIfOutOfView&&this.map){this.panIntoView();}},CLASS_NAME:"Geotool.Popup.Framed"});Geotool.Strategy.Marker.Cluster=OpenLayers.Class(OpenLayers.Strategy.Cluster,{mainClusterDistance:50000,clusterAreaFactor:1.1,maxClusterZoomLevel:null,groupIcon:null,initialize:function(options){OpenLayers.Strategy.Cluster.prototype.initialize.apply(this,[options]);this.mainClusterDistanceSquare=this.mainClusterDistance*this.mainClusterDistance;},activate:function(){var activated=OpenLayers.Strategy.Cluster.prototype.activate.call(this);if(activated){this.layer.map.events.on({"moveend":this.cluster,scope:this});}
return activated;},deactivate:function(){var deactivated=OpenLayers.Strategy.Cluster.prototype.deactivate.call(this);if(deactivated){if(this.layer&&this.layer.map&&this.layer.map.events){this.layer.map.events.un({"moveend":this.cluster,scope:this});}}
return deactivated;},clearCache:function(){this.layer.clearMarkers();if(this.layer.clearFeatures){this.layer.clearFeatures();}
OpenLayers.Strategy.Cluster.prototype.clearCache.call(this);this.destroyClusters(this.mainClusters);this.mainClusters=null;},destroyClusters:function(features)
{if(!features){return;}
for(var i=0;i<features.length;i++){var feature=features[i];if(feature.cluster){feature.cluster=null;feature.destroy();}}},cluster:function(){if(this.features){if(!this.maxClusterZoomLevel){this.maxClusterZoomLevel=this.layer.map.getNumZoomLevels()-5;}
if(!this.mainClusters){this.mainClusters=this.getMainClusters();}
var resolution=this.layer.getResolution();var mapBounds=this.layer.map.getExtent();if(resolution!=this.resolution||!mapBounds||!mapBounds.equals(this.mapBounds)||!this.clustersExist()){this.resolution=resolution;this.mapBounds=mapBounds;var checkBounds=null;if(mapBounds){var center=mapBounds.getCenterLonLat();var dataWidth=mapBounds.getWidth()*this.clusterAreaFactor;var dataHeight=mapBounds.getHeight()*this.clusterAreaFactor;checkBounds=new OpenLayers.Bounds(center.lon-(dataWidth/2),center.lat-(dataHeight/2),center.lon+(dataWidth/2),center.lat+(dataHeight/2));}
var mustNotCluster=this.layer.map.getZoom()>this.maxClusterZoomLevel;this.distanceSquareByRes=this.distance*this.distance*this.resolution*this.resolution;var clusters=[];var feature,clustered,cluster,mainCluster,subClusters;for(var ci=0;ci<this.mainClusters.length;++ci){mainCluster=this.mainClusters[ci];if(!checkBounds||(mainCluster.bounds?checkBounds.intersectsBounds(mainCluster.bounds):checkBounds.containsLonLat(mainCluster.lonlat))){if(typeof mainCluster.cluster=='undefined'){subClusters=[mainCluster];}else{subClusters=[];for(var i=0;i<mainCluster.cluster.length;++i){feature=mainCluster.cluster[i];if(!checkBounds||checkBounds.containsLonLat(feature.lonlat)){clustered=false;if(!mustNotCluster){for(var j=0;j<subClusters.length;++j){cluster=subClusters[j];if(this.shouldCluster2(cluster,feature)){cluster=this.addToCluster(cluster,feature);subClusters[j]=cluster;clustered=true;break;}}}
if(!clustered){subClusters.push(feature);}}}}
for(var j=0;j<subClusters.length;j++){clusters.push(subClusters[j]);}}}
this.layer.clearMarkers();this.destroyClusters(this.clusters);if(clusters.length>0){this.clustering=true;for(var i=0;i<clusters.length;i++){var marker=clusters[i].marker;if(clusters[i].cluster&&!marker){marker=this.makeMarker(clusters[i]);}
if(marker){this.layer.addMarker(marker);}}
this.clustering=false;}
this.clusters=clusters;}}},clustersExist:function(){var exist=false;if(this.clusters&&this.clusters.length>0&&this.clusters.length==this.layer.markers.length){exist=true;for(var i=0;i<this.clusters.length;++i){if(this.clusters[i].marker!=this.layer.markers[i]){exist=false;break;}}}
return exist;},shouldCluster2:function(cluster,feature){var cc=cluster.lonlat;var fc=feature.lonlat;var distanceSquareByRes=((cc.lon-fc.lon)*(cc.lon-fc.lon)+(cc.lat-fc.lat)*(cc.lat-fc.lat));return(distanceSquareByRes<=this.distanceSquareByRes);},createCluster:function(feature){var center=feature.lonlat;var icon=this.groupIcon.clone();var gImageDiv=this.groupIcon.imageDiv;if(typeof gImageDiv.className!='undefined'){icon.imageDiv.className=gImageDiv.className;}
if(typeof gImageDiv.title!='undefined'){icon.imageDiv.title=gImageDiv.title;}
if(typeof this.groupIcon.contentHtml!='undefined'){icon.contentHtml=this.groupIcon.contentHtml;}
var cluster=new Geotool.Feature(this.layer,new OpenLayers.LonLat(center.lon,center.lat),{icon:icon});cluster.cluster=[feature];cluster.attributes={count:1};cluster.bounds=new OpenLayers.Bounds();cluster.bounds.extend(center);return cluster;},addToCluster:function(cluster,feature){if(!cluster.cluster){cluster=this.createCluster(cluster);}
cluster.cluster.push(feature);cluster.attributes.count+=1;cluster.bounds.extend(feature.lonlat);cluster.lonlat=cluster.bounds.getCenterLonLat();return cluster;},getMainClusters:function(){var clusters=[];var feature,clustered,cluster;for(var i=0;i<this.features.length;++i){feature=this.features[i];clustered=false;for(var j=0;j<clusters.length;++j){cluster=clusters[j];if(this.shouldMainCluster(cluster,feature)){cluster=this.addToCluster(cluster,feature);clusters[j]=cluster;clustered=true;break;}}
if(!clustered){clusters.push(this.features[i]);}}
return clusters;},shouldMainCluster:function(cluster,feature){var cc=cluster.lonlat;var fc=feature.lonlat;var distanceSquare=((cc.lon-fc.lon)*(cc.lon-fc.lon)+(cc.lat-fc.lat)*(cc.lat-fc.lat));return(distanceSquare<=this.mainClusterDistanceSquare);},makeMarker:function(feature){var marker=feature.createMarker();marker.events.register('click',feature,this.markerClick);marker.events.register('mousemove',feature.data.icon,this.markerMousemove);marker.events.register('mouseout',feature.data.icon,this.markerMouseout);return marker;},markerMouseout:function(evt){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,null,this.imageDiv.firstChild.src.replace(/set01/,"set02"),"absolute");OpenLayers.Event.stop(evt);},markerMousemove:function(evt){var oldSrc=this.imageDiv.firstChild.src;var newSrc=oldSrc.replace(/set02/,"set01");if(oldSrc!=newSrc){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,null,newSrc,"absolute");}
OpenLayers.Event.stop(evt);},markerClick:function(evt){var map=this.layer.map;var newCenter=this.lonlat.clone();var px=map.getViewPortPxFromLonLat(newCenter);map.zoomIn();var newPx=map.getViewPortPxFromLonLat(newCenter);map.pan(newPx.x-px.x,newPx.y-px.y,{animate:false,dragging:true});map.panTo(newCenter);OpenLayers.Event.stop(evt);},CLASS_NAME:"Geotool.Strategy.Marker.Cluster"});Geotool.Strategy.Marker.Fixed=OpenLayers.Class(OpenLayers.Strategy,{url:null,initialize:function(url,options){OpenLayers.Strategy.prototype.initialize.apply(this,[options]);this.url=url;},activate:function(){var activated=OpenLayers.Strategy.prototype.activate.call(this);if(activated){window.setTimeout(OpenLayers.Function.bind(this.update,this),10);}
return activated;},deactivate:function(){var deactivated=OpenLayers.Strategy.prototype.deactivate.call(this);return deactivated;},update:function(options){var newLocation=this.url;if((options&&options.force)||!this.layer.location||this.layer.location!=newLocation){this.layer.location=newLocation;this.layer.reload(true);}},CLASS_NAME:"Geotool.Strategy.Marker.Fixed"});Geotool.Strategy.Marker.IconSwitcher=OpenLayers.Class(OpenLayers.Strategy,{iconsByScale:null,currentIconIndex:-1,initialize:function(newIconsByScale,options){OpenLayers.Strategy.prototype.initialize.apply(this,[options]);this.iconsByScale=newIconsByScale;},destroy:function(){this.features=null;this.iconsByScale=null;OpenLayers.Strategy.prototype.destroy.apply(this,arguments);},activate:function(){var activated=OpenLayers.Strategy.prototype.activate.call(this);if(activated){this.layer.events.on({"beforefeaturesadded":this.featuresAdded,scope:this});this.layer.map.events.on({"zoomend":this.switchIcons,scope:this});if(this.layer.features&&this.layer.features.length){this.featuresAdded({features:this.layer.features});}}
return activated;},deactivate:function(){var deactivated=OpenLayers.Strategy.prototype.deactivate.call(this);if(deactivated){if(this.layer&&this.layer.map&&this.layer.map.events){this.layer.events.un({"beforefeaturesadded":this.featuresAdded,scope:this});this.layer.map.events.un({"zoomend":this.switchIcons,scope:this});}}
return deactivated;},featuresAdded:function(evt){this.features=evt.features;this.currentIconIndex=-1;this.switchIcons();return true;},switchIcons:function(evt){if(!this.features||!this.iconsByScale){return;}
var iconIdx=this.getIconIndex();if(iconIdx<0){}else if(this.currentIconIndex!=iconIdx){this.layer.events.triggerEvent("loadstart");try{this.currentIconIndex=iconIdx;var iconInfo=this.iconsByScale[iconIdx];for(var fi=0;fi<this.features.length;fi++){var marker=this.features[fi].marker;if(!marker){marker=this.features[fi].createMarker();}
if(marker){marker.icon.offset=iconInfo.icon.offset;marker.icon.size=iconInfo.icon.size;if(marker.icon.px){var iconUrl=String(iconInfo.icon.url);if(this.features[fi].data.iconnr){iconUrl=iconUrl.replace("_0"+this.features[fi].data.category+"_","_0"+this.features[fi].data.iconnr+"_");}
marker.setUrl(iconUrl);}else{marker.icon.url=iconInfo.icon.url;if(this.features[fi].data.iconnr){if(this.features[fi].data.category!=this.features[fi].data.iconnr){var iconUrl=String(iconInfo.icon.url);iconUrl=iconUrl.replace("_0"+this.features[fi].data.category+"_","_0"+this.features[fi].data.iconnr+"_");marker.icon.url=iconUrl;}}}
if(iconInfo.contentHtmlClassName&&typeof marker.setContentHtmlClassName=='function'){marker.setContentHtmlClassName(iconInfo.contentHtmlClassName);}}}}catch(err){if(console&&console.log){console.log("Error in switchIcons:"+err);}}
this.layer.events.triggerEvent("loadend");}
return true;},getIconIndex:function()
{var mapScale=this.layer.map.getScale();var idx=-1;for(var si=0;si<this.iconsByScale.length;si++){if(this.iconsByScale[si].minscale<mapScale&&mapScale<=this.iconsByScale[si].maxscale){idx=si;break;}}
return idx;},CLASS_NAME:"Geotool.Strategy.Marker.IconSwitcher"});Geotool.Strategy.Marker.Period=OpenLayers.Class(OpenLayers.Strategy,{baseUrl:null,initialize:function(baseUrl,options){OpenLayers.Strategy.prototype.initialize.apply(this,[options]);this.baseUrl=baseUrl;},activate:function(){var activated=OpenLayers.Strategy.prototype.activate.call(this);if(activated){this.controller=this.layer.map.getControl(Geotool.controllerName);this.controller.events.on({"changeperiod":this.update,scope:this});this.update();}
return activated;},deactivate:function(){var deactivated=OpenLayers.Strategy.prototype.deactivate.call(this);if(deactivated){if(this.controller.events){this.controller.events.un({"changeperiod":this.update,scope:this});}}
return deactivated;},update:function(options){var newLocation=this.getLocation();if((options&&options.force)||!this.layer.location||this.layer.location!=newLocation){this.layer.location=newLocation;this.layer.clearMarkers();this.layer.clearFeatures();this.layer.reload();}},getLocation:function()
{var url=this.baseUrl;if(this.controller.startDate){url+="&startdate="+encodeURIComponent(this.controller.startDate);}
if(this.controller.endDate){url+="&enddate="+encodeURIComponent(this.controller.endDate);}
return url;},CLASS_NAME:"Geotool.Strategy.Marker.Period"});function AddLoadEvent(func)
{var oldonload=window.onload;if(typeof window.onload!='function')
{window.onload=func;}
else
{window.onload=function()
{oldonload();func();}}}
AddLoadEvent(mapInit);function AddUnLoadEvent(func)
{var oldonunload=window.onbeforeunload;if(typeof window.onbeforeunload!='function')
{window.onbeforeunload=func;}
else
{window.onbeforeunload=function()
{oldonunload();func();}}}
if(!Array.prototype.indexOf)
{Array.prototype.indexOf=function(elt)
{var len=this.length;var from=Number(arguments[1])||0;from=(from<0)?Math.ceil(from):Math.floor(from);if(from<0)
from+=len;for(;from<len;from++)
{if(from in this&&this[from]===elt)
return from;}
return-1;};}
var map=null;var rwsnlController=null;var hasInitialPopupOpened=false;var filterPeriods=null;OpenLayers.Feature.Vector.style['default']['strokeWidth']='5';OpenLayers.Feature.Vector.style['default']['strokeColor']='#ffff00';OpenLayers.Feature.Vector.style['default']['pointRadius']='0';var defaultPeriodDaysByProjecttype={'vaarwegen':90,'wegen':7};TextResizeDetector.TARGET_ELEMENT_ID='main_box';TextResizeDetector.USER_INIT_FUNC=initTextResize;function initTextResize(){TextResizeDetector.addEventListener(onFontResize,null);}
function onFontResize(e,args){map.events.element.offsets=null;for(var i=0;i<map.controls.length;i++){var control=map.controls[i];if(control.divEvents){control.divEvents.element.offsets=null;}
if(control.sliderEvents){control.sliderEvents.element.offsets=null;}
if(control.elementEvents){control.elementEvents.element.offsets=null;}
if(control.rectEvents){control.rectEvents.element.offsets=null;}}}
function mapInit()
{loadFilterPeriods();}
function mapInit2()
{hasInitialPopupOpened=false;var argParser=new Geotool.Control.ArgParser();Geotool.argParser=argParser;resize();var projecttype=argParser.getParam('projecttype');if(!projecttype||projecttype==""){projecttype="wegen";}
projecttype=projecttype.toLowerCase();var defaultPeriodDays=defaultPeriodDaysByProjecttype[projecttype];var lastEndDate=null;if(filterPeriods&&filterPeriods[projecttype]){lastEndDate=filterPeriods[projecttype].lastenddate;}
var periodControl=new Geotool.Control.PeriodControl("periodeform","periodediv",defaultPeriodDays,argParser.getParam('startdate'),argParser.getParam('enddate'),lastEndDate);OpenLayers.Popup.COLOR="transparent";var printing=argParser.getParam('printing');if(printing&&printing=="map")
{OpenLayers.Popup.WIDTH=344;OpenLayers.Popup.HEIGHT=55;}
else{OpenLayers.Popup.WIDTH=344;OpenLayers.Popup.HEIGHT=240;}
OpenLayers.DOTS_PER_INCH=90.714;OpenLayers.IMAGE_RELOAD_ATTEMPTS=3;OpenLayers.Feature.prototype.popupClass=Geotool.Popup.Framed;Geotool.Feature.prototype.popupClass=Geotool.Popup.Framed;OpenLayers.Util.onImageLoadError=function(){this._attempts=(this._attempts)?(this._attempts+1):1;if(this._attempts<=OpenLayers.IMAGE_RELOAD_ATTEMPTS){this.src=this.src;}else{this.src="./_img/a_pixel.gif";}
this.style.display="";};var rdextent=new OpenLayers.Bounds(-285401,22598,595401,903401);map=new OpenLayers.Map($('imgMapContainer'),{controls:[],'projection':'EPSG:28992','units':'m','scales':[6144000,3072000,1536000,768000,384000,192000,96000,48000,24000,12000,6000],'tileSize':new OpenLayers.Size(256,256),'maxExtent':rdextent,restrictedExtent:rdextent,paddingForPopups:new OpenLayers.Bounds(74,15,15,33)});var staging=(document.location.pathname.indexOf('/staging/')!=-1);var xypicker=argParser.getParam('xypicker');if(staging&&xypicker&&(xypicker.toLowerCase()=='true')){document.getElementById('xypicker').style.display='block';map.addControl(new Geotool.Control.MousePosition({div:$('xypickercontent')}));map.addControl(new Geotool.Control.Navigation({noclick:true}));}else{map.addControl(new Geotool.Control.Navigation({noclick:true}));}
var loadinPanel=new Geotool.Control.LoadingPanel(null,{map:map});map.addControl(loadinPanel);var requestedSize=getRequestedSize();var panZoomBar=null;if(!requestedSize.height||requestedSize.height>350){panZoomBar=new Geotool.Control.PanZoomBar({slideRatio:0.5});panZoomBar.zoomStopWidth=16;panZoomBar.zoomStopHeight=15;}else{panZoomBar=new Geotool.Control.PanZoom();}
map.addControl(panZoomBar);map.addControl(new OpenLayers.Control.Attribution());map.viewPortDiv.onscroll=function(){if(map.viewPortDiv.scrollTop!=0){map.viewPortDiv.scrollTop=0;}
if(map.viewPortDiv.scrollLeft!=0){map.viewPortDiv.scrollLeft=0;}}
if($('searchcontainer')){var searchContainer=new Geotool.Control.SearchContainer({div:$('searchcontainer')});map.addControl(searchContainer);var searchersString=argParser.getParam('searchers');if(!searchersString){searchersString="adres"};searchContainer.setSearchers(searchersString);}
var legendControl=new Geotool.Control.Legend();map.addControl(legendControl);Geotool.legendControlId=legendControl.id;rwsnlController=new Geotool.Control.RwsnlController(periodControl,searchContainer,{id:Geotool.controllerName});map.addControl(rwsnlController);rwsnlController.activate();map.events.register("popupopen",map.popups,popupopenevent);map.addControl(argParser);map.addControl(new Geotool.Control.Permalink('permabtn',getTopURL(),{div:document.getElementById('permalinkdiv')}));fontsize=argParser.getParam('fontsize');if(fontsize!=""){setFontSize(parseInt(fontsize));}else{setFontSize(3);}
if(typeof cookieload!='undefined'&&cookieload!=null&&!printing){AddUnLoadEvent(setCookieAtUnload);}
if(printing){setTimeout("startPrinting()",2500);}
resize();}
function getWindowSize(){var myHeight=0;var myWidth=0;if(typeof(window.innerHeight)=='number'){myHeight=window.innerHeight;myWidth=window.innerWidth;}else if(document.documentElement&&document.documentElement.clientHeight){myHeight=document.documentElement.clientHeight;myWidth=document.documentElement.clientWidth;}else if(document.body&&document.body.clientHeight){myHeight=document.body.clientHeight;myWidth=document.body.clientWidth;}
return{width:myWidth,height:myHeight};}
function getRequestedSize(){var requestedSize=getWindowSize();if(Geotool.argParser){var confWidth=Geotool.argParser.getParam('width');var confHeight=Geotool.argParser.getParam('height');if(confWidth){if(confWidth!="auto"){requestedSize.width=parseInt(confWidth);}}else{requestedSize.width=null;}
if(confHeight){if(confHeight!="auto"){requestedSize.height=parseInt(confHeight);}}else{requestedSize.height=null;}}
return requestedSize;}
function resize(){var minheight=200;var minwidth=200;var smallWidth=500;var requestedSize=getRequestedSize();var topcontent=['printbuttons','map_bar_1','map_bar_2'];var topheight=2;for(var ti=0;ti<topcontent.length;ti++){var obj=$(topcontent[ti]);if(requestedSize.height&&requestedSize.height-topheight-obj.scrollHeight<minheight){obj.style.display='none';}else if(requestedSize.width&&requestedSize.width<smallWidth){obj.style.display='none';}else{topheight+=obj.scrollHeight;}}
var mapContainer=$('imgMapContainer');var mapArea=$('map_area');mapArea.style.top="0px";topheight=OpenLayers.Util.pagePosition(mapArea)[1];if(requestedSize.height){var newHeight=Math.max(minheight,requestedSize.height-topheight);var topoffset=0;if(newHeight%2==1){newHeight--;topoffset=1;}
mapArea.style.height=newHeight+"px";mapArea.style.top=topoffset+"px";mapContainer.style.height=newHeight+"px";}
if(requestedSize.width){mapArea.style.width=Math.max(minwidth,requestedSize.width)+"px";mapContainer.style.width=Math.max(minwidth,requestedSize.width)+"px";var mainBox=$('main_box');mainBox.style.width=Math.max(minwidth,requestedSize.width)+"px";}
if(map){map.updateSize();}}
function popupopenevent(evt)
{OpenLayers.Event.stop(evt);}
function setFontSize(fontSize)
{switch(fontSize)
{case 1:document.getElementById('htmlNode').style.fontSize='50%';break;case 2:document.getElementById('htmlNode').style.fontSize='56.25%';break;case 3:document.getElementById('htmlNode').style.fontSize='62.5%';break;case 4:document.getElementById('htmlNode').style.fontSize='68.75%';break;case 5:document.getElementById('htmlNode').style.fontSize='75%';break;default:document.getElementById('htmlNode').style.fontSize='62.5%';break;}}
function setCookieAtUnload()
{var expires=1;var value=rwsnlController.getPermalink();deleteCookie(Geotool.cookieName,null,null);deleteCookie(Geotool.cookieName,getCookiePath(),null);setCookie(Geotool.cookieName,value,expires,getCookiePath());}
function loadFilterPeriods()
{var url="?mode=FILTERPERIODS";var request=OpenLayers.loadURL(url,null,null,filterPeriodsHandler,null);}
function filterPeriodsHandler(ajaxRequest)
{var text=ajaxRequest.responseText;var jsonParser=new OpenLayers.Format.JSON();var obj=jsonParser.read(text);filterPeriods=obj.filterperiods;mapInit2();}
function printPopup()
{var querystring=rwsnlController.getPermalink()+"&printing=popup";var URL=document.location.href;URL=URL.substring(0,URL.indexOf("?"));printwindow=window.open(URL+querystring,'Geotool','left=20,top=20,width=680,height=900,toolbar=0,menubar=1,resizable=1,status=1,scrollbars=1');setTimeout("printwindow.focus()",1000);}
function printMap()
{var querystring=rwsnlController.getPermalink()+"&printing=map";var URL=document.location.href;URL=URL.substring(0,URL.indexOf("?"));printwindow=window.open(URL+querystring,'Geotool','left=20,top=20,width=680,height=900,toolbar=0,menubar=1,resizable=1,status=1,scrollbars=1');setTimeout("printwindow.focus()",1000);}
function startPrinting(){window.print();}
Geotool.Component.KML=OpenLayers.Class(Geotool.Component.VectorBase,{layernameprefix:"autoww_",projecttype:'kml',searcherTypes:"adres",groupLayer:null,popup:null,title:"KML",kmlurl:null,kmllegendurl:null,kmlfromcookie:true,kmllegendfromcookie:true,initialize:function(map,bLoadProjects,options){Geotool.Component.VectorBase.prototype.initialize.apply(this,arguments);this.groupLayer=new Geotool.Layer.Group("KML");},makeLayer:function(){var theKmlUrl=this.getKmlUrl();if(!theKmlUrl){return null;}
var proxiedkmlurl="kml.php?kml="+encodeURIComponent(theKmlUrl);if(!this.vectorLayer){var KMLformat=new Geotool.Format.KML({extractStyles:true,extractAttributes:true,internalProjection:new OpenLayers.Projection(this.map.projection),externalProjection:new OpenLayers.Projection("EPSG:4326"),alwaysInRange:true});this.vectorLayer=new OpenLayers.Layer.Vector("KML",{strategies:[new OpenLayers.Strategy.Fixed()],protocol:new OpenLayers.Protocol.HTTP({url:proxiedkmlurl,format:KMLformat})});this.vectorLayer.events.on({"loadend":this.loadEnd,scope:this});this.vectorLayer.setVisibility(true);this.addControls(this.vectorLayer);}
else{this.vectorLayer.events.triggerEvent("refresh",{url:proxiedkmlurl});}
return this.vectorLayer;},getKmlUrl:function(){if(typeof(this.kmlurl)=="string"&&this.kmlurl.length>0){return this.kmlurl;}
var argparsers=this.map.getControlsByClass('OpenLayers.Control.ArgParser');if(!argparsers[0]){return null;}
var kmlParam=argparsers[0].getParam('kml');if((kmlParam&&OpenLayers.String.trim(kmlParam).length>0)){if(this.kmlfromcookie){this.kmlurl=kmlParam;}}
var kmlLegendParam=argparsers[0].getParam('kmllegend');if((kmlLegendParam&&OpenLayers.String.trim(kmlLegendParam).length>0)){if(this.kmllegendfromcookie){this.kmllegendurl=kmlLegendParam;}}
return this.kmlurl;},setKmlUrl:function(kmlUrl){for(var i=this.map.popups.length-1;i>=0;i--)
{this.map.removePopup(this.map.popups[i]);}
if(!kmlUrl||OpenLayers.String.trim(kmlUrl).length==0){this.kmlurl=undefined;this.kmlfromcookie=false;if(this.vectorLayer){this.vectorLayer.destroyFeatures();}}
else{this.kmlurl=kmlUrl;if(!this.vectorLayer){this.activateLayer();}else{this.makeLayer();}}},setKmlLegendUrl:function(kmlLegendUrl){if(!kmlLegendUrl||OpenLayers.String.trim(kmlLegendUrl).length==0){this.kmllegendurl="components/kml/nolegend.html";this.kmllegendfromcookie=false;}
else{this.kmllegendurl=kmlLegendUrl;}},setLegend:function(){if(!this.kmllegendurl||this.kmllegendurl.length==0||this.kmllegendurl==null){return;}
var proxiedkmllegendurl="kml.php?kml="+encodeURIComponent(this.kmllegendurl);OpenLayers.Request.GET({url:proxiedkmllegendurl,callback:handler});function handler(request){if(request.status==200){document.getElementById("legendkml").innerHTML=request.responseText;return;}
else{alert("Probleem bij het ophalen van de legenda, deze zal niet worden getoond.");document.getElementById("legendkml").innerHTML="&nbsp;";}}},loadEnd:function(obj){var features=this.vectorLayer.features;if(features.length<=0){alert("Probleem bij het ophalen van de gegevens");}
else{for(var fi=0;fi<features.length;fi++){this.addPopupFunctions(features[fi]);}
this.setLegend();}},CLASS_NAME:"Geotool.Component.KML"});Geotool.componentClasses.push(Geotool.Component.KML);Geotool.Component.Kustlijnzorg=OpenLayers.Class(Geotool.Component.VectorBase,{layernameprefix:"kustlijnzorg_",projecttype:'kustlijnzorg',searcherTypes:"adres",groupLayer:null,popup:null,title:"Kustlijnzorg",features:[],kustlijnStyleMap:new OpenLayers.StyleMap({"default":new OpenLayers.Style({fillColor:"#66ccff",strokeColor:"#3399ff",strokeWidth:2,fillOpacity:0.1}),"select":new OpenLayers.Style({fillColor:"#ff0000",strokeColor:"#ff0000",strokeWidth:2,fillOpacity:0.1})}),initialize:function(map,bLoadProjects,options){Geotool.Component.VectorBase.prototype.initialize.apply(this,arguments);this.categoryControl=new Geotool.Control.CategoryControl("legendaKustlijnzorgForm","legendaInputKustlijnzorg","legendaKustlijnzorg");if(map){map.addControl(this.categoryControl);}
this.categoryControl.setCategory('1',true);this.groupLayer=new Geotool.Layer.Group("Kustlijnzorg");this.location="index.php?mode=features&projecttype=kustlijnzorg";this.jsonParser=new OpenLayers.Format.JSON();this.wktParser=new OpenLayers.Format.WKT();},makeLayer:function(){this.vectorLayer=new OpenLayers.Layer.Vector("Kustlijn vectors",{styleMap:this.kustlijnStyleMap});this.vectorLayer.setVisibility(true);this.addControls(this.vectorLayer);OpenLayers.loadURL(this.location,null,this,this.parseData,function(msg){alert(msg)});return this.vectorLayer;},parseData:function(ajaxRequest){var text=ajaxRequest.responseText;var obj=this.jsonParser.read(text);var rows=obj.features;var newFeatures=[];if(rows&&rows.length){for(var i=0;i<rows.length;i++){var data=rows[i];var feature=this.makeFeature(data);newFeatures.push(feature);}}
this.vectorLayer.addFeatures(newFeatures,{});},makeFeature:function(data){var title=null;if(data.loc){var openlayersFeature=this.wktParser.read(data.loc);data.location=null;data.loc=null;data.title="Kaart "+data.code+", "+data.titeloms+", "+data.bladoms;var html='<div class="kustlijnzorg">'
+'<table class="olPopupTable" cellspacing="0">'
+'<tr><td class="popinleftbar"><img border="0" src="components/kustlijnzorg/icons/icon_kustlijn.gif"></td>'
+'<td class="title">&nbsp;</td><td class="title">'+data.title+'</td></tr>'
+'<tr><td>&nbsp;</td><td class="subtitle">&nbsp;</td><td class="subtitle">Kaarten, Tabellen en Rapporten als PDF</td></tr>';data['miniPopupContentHTML']=html+"</table></div>";table="<tr class='rowodd'><td colspan='3'>&nbsp;</td></tr>";rowclass="roweven";var year=2020;while(year>2005){if(data['report'+year]){var rapportlink="";if(data['report'+year]){rapportlink='<a href="'+data['report'+year]+'" target="_blank" title="Rapport '+data.titeloms+', '+data.bladoms+', '+year+' (opent in nieuw scherm)">Rapport</a>';}
var kaartlink="";if(data['map'+year]){kaartlink='<a href="'+data['map'+year]+'" target="_blank" title="Kustlijnkaart '+data.code+', '+year+' (opent in nieuw scherm)">Kaart</a>';}
var tabellink="";if(data['table'+year]){tabellink='<a href="'+data['table'+year]+'" target="_blank" title="Tabel '+data.titeloms+', '+data.bladoms+', '+year+' (opent in nieuw scherm)">Tabel</a>';}
table+="<tr class='"+rowclass+"'><td colspan='2'>"+year+":</td><td>"+kaartlink+"&nbsp;&nbsp;&nbsp;&nbsp;"+tabellink+"&nbsp;&nbsp;&nbsp;&nbsp;"+rapportlink+"</td></tr>";if(rowclass=="rowodd"){rowclass="roweven";}else{rowclass="rowodd";}}
year--;}
table+="<tr class='rowsimple'><td colspan='2'>&nbsp;</td><td>&nbsp;<br/><a href='"+link_kustlijnkaarten+"' target='_top' title='Kustlijnkaarten eerdere jaren'>Gegevens van eerdere jaren</a></td></tr>";data['popupContentHTML']=html+table+"</table></div>";data.popupClass="kustlijnzorg olPopup";data.overflow=data.overflow||"auto";var feature=new Geotool.Feature.Vector(openlayersFeature.geometry,data);this.addPopupFunctions(feature);if(typeof result=="undefined"||result===true){this.features.push(feature);return feature;}}
return null;},CLASS_NAME:"Geotool.Component.Kustlijnzorg"});Geotool.componentClasses.push(Geotool.Component.Kustlijnzorg);Geotool.Component.MarkerBase=OpenLayers.Class(Geotool.Component,{categories:null,loadProjects:null,highlightVectorLayer:null,categoryControl:null,markerLayer:null,initialize:function(map,options){Geotool.Component.prototype.initialize.apply(this,arguments)
this.loadEndEventHandlerOnThis=OpenLayers.Function.bind(this.loadEndEventHandler,this);},activate:function()
{Geotool.Component.prototype.activate.apply(this,arguments);if(this.markerLayer==null&&this.makeLayer){this.markerLayer=this.makeLayer();if(this.categoryControl&&this.markerLayer&&this.markerLayer.defaultLegendValue){this.categoryControl.setCategory(this.markerLayer.defaultLegendValue,true);}
this.markerLayer.events.register('loadend',this.markerLayer,this.loadEndEventHandlerOnThis);this.groupLayer.addLayer(this.markerLayer);}},loadEndEventHandler:function()
{this.markerLayer.events.unregister('loadend',this.markerLayer,this.loadEndEventHandlerOnThis);setTimeout(OpenLayers.Function.bind(this.openWorksMarker,this),300);},openWorksMarker:function()
{if(!hasInitialPopupOpened&&Geotool.argParser.getParam('works')){hasInitialPopupOpened=true;var works=Geotool.argParser.getParam('works');if(this.markerLayer&&typeof this.markerLayer.getMarkerById=='function'){var marker=this.markerLayer.getMarkerById(works);if(marker!=null)
{marker.events.triggerEvent('click');}}}},getLocation:function()
{var url="?mode=features&projecttype="+encodeURIComponent(this.projecttype);if(typeof this.loadProjects!='undefined'){url+="&loadprojects="+(this.loadProjects?"1":"0");}
return url;},categoryChanged:function(categoryEvent)
{var control=categoryEvent.control;var currentLevels=categoryEvent.allCategories;var layers=this.markerLayer.getLayers();if(layers){for(var i=0;i<layers.length;i++){if(typeof layers[i].category!='undefined'){var catLevel=layers[i].category;var visibility=false;for(ci=0;ci<currentLevels.length;ci++){if(currentLevels[ci]==catLevel){visibility=true;}}
layers[i].setVisibility(visibility);}}}},CLASS_NAME:"Geotool.Component.MarkerBase"});Geotool.Component.WMSBase=OpenLayers.Class(Geotool.Component,{groupLayer:null,highlightVectorLayer:null,control:null,highlightFeature:null,style:null,initialize:function(map,bLoadProjects,options){Geotool.Component.prototype.initialize.apply(this,arguments);if(!this.style){this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style['default'],{});this.style['strokeWidth']='5';this.style['strokeColor']='#ffff00';this.style['pointRadius']='3';}
this.groupLayer=new Geotool.Layer.Group(this.projecttype+"Group");this.highlightVectorLayer=new OpenLayers.Layer.Vector(this.projecttype+" Highlight layer",{style:this.style});this.groupLayer.addLayer(this.highlightVectorLayer);var printing=Geotool.argParser.getParam("printing");if(printing&&printing=="map"){this.highlightVectorLayer.div.style.display="none";this.highlightVectorLayer.div.className="highlightvectorlayer";}},activate:function(){Geotool.Component.prototype.activate.apply(this,arguments);if(!this.control){this.makeFeatureInfoControl();}
this.map.addControl(this.control);this.control.events.on({'featureinfoend':this.loadHighlight,scope:this});this.control.events.on({'beforefeatureadded':this.doBeforeFeatureAdded,scope:this});this.control.activate();},deactivate:function()
{this.hideHighlight();Geotool.Component.prototype.deactivate.apply(this,arguments)
this.control.deactivate();this.control.events.un({'featureinfoend':this.loadHighlight,scope:this});this.control.events.un({'beforefeatureadded':this.doBeforeFeatureAdded,scope:this});this.map.removeControl(this.control);},makeFeatureInfoControl:function(){var icon=new OpenLayers.Icon("_img/almost_transparent_marker.png",new OpenLayers.Size(17,17));this.control=new Geotool.Control.FeatureInfo({markerIcon:icon});},doBeforeFeatureAdded:function(evt){if(!evt.featurelist||!evt.feature||evt.featurelist.length==0||evt.featurelist[0].features.length==0){return false;}
evt.feature.data.ids=evt.feature.lonlat.lon+","+evt.feature.lonlat.lat;return true;},hideHighlight:function(){if(this.highlightFeature){this.highlightVectorLayer.removeFeatures(this.highlightFeature);this.highlightFeature=null;}},loadHighlight:function(event){var featurelist=event.featurelist;if(!featurelist){return;}
this.hideHighlight();if(featurelist.length>0&&featurelist[0].features.length>0){var feature=this.getPreferredFeature(featurelist[0].features);if(feature.geometry){this.highlightFeature=feature;if(this.highlightVectorLayer.getFeatureById(this.highlightFeature.id)==null){this.highlightVectorLayer.addFeatures(this.highlightFeature);}}}},getPreferredFeature:function(features)
{if(features&&features.length>0){return features[0];}
return null;},CLASS_NAME:"Geotool.Component.WMSBase"});Geotool.Control.AwdMeetpuntSearch=new OpenLayers.Class(Geotool.Control.Searcher,{searchType:"awdmeetpunt",title:"Watermeetpunt",initialize:function(container,options){Geotool.Control.Searcher.prototype.initialize.apply(this,arguments);var div=document.createElement('div');div.id="awdmeetpuntsearchdiv";this.searchersDiv.appendChild(div);div.innerHTML='<input type="text" id="awdmeetpuntsearchinput" class="searchinput" size="20" maxsize="4" style="">';this.div=div;this.searchInputs[0]=$('awdmeetpuntsearchinput');this.searchInputs[0].example='IJMH';this.DEFAULT_MESSAGE="<label for='awdmeetpuntsearchinput'>Actuele WaterData meetpunt (4-lettercode of deel van naam)</label>";},activate:function(){Geotool.Control.Searcher.prototype.activate.apply(this,arguments);this.showMessage(this.DEFAULT_MESSAGE);},searchImpl:function(){var awdmeetlocatiecode=this.searchInputs[0].value;var invalidMessage="Ongeldige invoer, geef minstens 1 letter.";if(this.searchInputs[0].value.length<1){this.showErrorMessage(invalidMessage);return false;}
OpenLayers.Request.GET({url:"searchdata.php",params:{awdmeetpunt:awdmeetlocatiecode},scope:this,success:this.handleSearch,failure:this.handleGeneralError});return false;},handleSearch:function(req){if(req.responseText&&req.responseText.indexOf('result')>0)
{resultObject=eval("("+req.responseText+")");results=[];for(var i=0;i<resultObject.result.length;i++){var obj=resultObject.result[i];var result={};result.value=obj.LOCATIENAAM;result.info=obj.LOCATIECODE+" ("+obj.MEETNETCODE+")";if(obj.X!=0&&obj.Y!=0&&obj.X!=null&&obj.Y!=null){result.geometry=new OpenLayers.Geometry.Point(obj.X,obj.Y);}
else{result.geometry=null;}
result.zoom=8;results.push(result);}
this.handleResults(results);}},CLASS_NAME:"Geotool.Control.AwdMeetpuntSearch"});Geotool.searcherClasses.push(Geotool.Control.AwdMeetpuntSearch);Geotool.Control.BruggenSluizenSearch=new OpenLayers.Class(Geotool.Control.Searcher,{searchType:"bruggensluizen",title:"Brug/Sluisnaam",initialize:function(container,options){Geotool.Control.Searcher.prototype.initialize.apply(this,arguments);var div=document.createElement('div');div.id="bruggensluizensearchdiv";this.searchersDiv.appendChild(div);div.innerHTML='<input type="text" id="bruggensluizensearchinput" class="searchinput" size="20" maxsize="4" style="">';this.div=div;this.searchInputs[0]=$('bruggensluizensearchinput');this.searchInputs[0].example='magere brug';this.DEFAULT_MESSAGE="<label for='bruggensluizensearchinput'>Brug- of Sluisnaam (of deel van de naam)</label>";},activate:function(){Geotool.Control.Searcher.prototype.activate.apply(this,arguments);this.showMessage(this.DEFAULT_MESSAGE);},searchImpl:function(){var bruggensluizenstring=this.searchInputs[0].value;var invalidMessage="Ongeldige invoer, geef minstens 1 letter.";if(this.searchInputs[0].value.length<1){this.showErrorMessage(invalidMessage);return false;}
OpenLayers.Request.GET({url:"searchdata.php",params:{bruggensluizen:bruggensluizenstring},scope:this,success:this.handleSearch,failure:this.handleGeneralError});return false;},handleSearch:function(req){if(req.responseText&&req.responseText.indexOf('result')>0)
{resultObject=eval("("+req.responseText+")");results=[];for(var i=0;i<resultObject.result.length;i++){var obj=resultObject.result[i];var result={};result.value=obj.NAAM;result.info=obj.PLAATSNAAM;if(obj.X>0&&obj.Y>0&&obj.X!=null&&obj.Y!=null){result.geometry=new OpenLayers.Geometry.Point(obj.X,obj.Y);}
else{result.geometry=null;}
result.zoom=8;results.push(result);}
this.handleResults(results);}},CLASS_NAME:"Geotool.Control.BruggenSluizenSearch"});Geotool.searcherClasses.push(Geotool.Control.BruggenSluizenSearch);Geotool.Control.CategoryControl=OpenLayers.Class(OpenLayers.Control,{initialize:function(formName,filterFieldName,legendDivId,options)
{OpenLayers.Control.prototype.initialize.apply(this,[options]);this.div=document.getElementById(legendDivId);var changehandler=OpenLayers.Function.bind(this.changeCategory,this);var onclickHandler=function(event){changehandler(this);return false;}
this.radioForm=new Geotool.Control.RadioForm(formName,filterFieldName,onclickHandler,legendDivId+"item");this.currentCategories=null;this.setVisibility(true)
this.setPolicy('priority');},changeCategory:function(srcobj)
{var id=null;if(srcobj.options){id=srcobj.options[srcobj.selectedIndex].value;}else{id=srcobj.filterid;}
this.setCategory(id);return true;},setPolicy:function(newPolicy)
{this.policy=newPolicy;this.radioForm.setPolicy(newPolicy=='toggle'?newPolicy:'exclusive');},setVisibility:function(visible)
{if(!this.div){return;}
if(visible){this.div.style.display='block';}else{this.div.style.display="none";}},setCategory:function(value,forceOn)
{if(!this.radioForm.radioFields){return;}
var selectedCats;if(!value){value=this.currentCategories;forceOn=true;}
if(typeof value=='undefined'||value==null){return;}
if(typeof value=='string'){selectedCats=value.split(",");for(var i=0;i<selectedCats.length;i++){selectedCats[i]=parseInt(selectedCats[i]);}}else if(typeof value=='object'&&value.constructor==Array){selectedCats=new Array();for(var i=0;i<value.length;i++){selectedCats[i]=parseInt(value[i]);}}else{selectedCats=new Array();selectedCats[0]=value;}
for(var i=selectedCats.length-1;i>=0;i--){if(value<0||value>this.radioForm.getCount()){selectedCats.splice(i,1);}}
var allCategories=new Array();if(this.policy=='single'){this.currentCategories=selectedCats[0];this.radioForm.highlightElement(this.currentCategories);var selectedIndex;for(var i=0;i<this.radioForm.getCount();i++){if(this.radioForm.isSelected(i)){selectedIndex=i;}}
var selectedValue=this.radioForm.getValue(selectedIndex);allCategories[0]=selectedValue;}
else if(this.policy!='toggle'){if(selectedCats.length==0){return;}
this.currentCategories=selectedCats[0];this.radioForm.highlightElement(this.currentCategories);for(var i=0;i<this.radioForm.getCount();i++){var catLevel=parseInt(this.radioForm.getValue(i));if(catLevel<=this.currentCategories){allCategories[allCategories.length]=catLevel;}}}else{for(var i=0;i<this.radioForm.getCount();i++){var catLevel=this.radioForm.getValue(i);var selected=this.radioForm.isSelected(i);if(!this.radioForm.isRadioOrCheckbox||forceOn){if(OpenLayers.Util.indexOf(selectedCats,parseInt(catLevel))>=0){selected=!selected||forceOn;}else if(forceOn){selected=false;}}
this.radioForm.highlightElement(catLevel,selected);if(selected){allCategories[allCategories.length]=catLevel;}}
this.currentCategories=allCategories.join(",");}
var controller=this.map.getControl(Geotool.controllerName);controller.changecategory({selectedCategories:this.currentCategories,allCategories:allCategories,control:this});},CLASS_NAME:"Geotool.Control.CategoryControl"});Geotool.Control.Geocode=OpenLayers.Class(Geotool.Control.Searcher,{searchType:"adres",title:"Adressen",json:false,minchars:2,delay:1000,cache:false,maxentries:10,resultsArr:null,MINIMALCHARS:3,initialize:function(container,options){Geotool.Control.Searcher.prototype.initialize.apply(this,arguments);var geocoderdiv=document.createElement('div');geocoderdiv.id="geocoderdiv";this.searchersDiv.appendChild(geocoderdiv);var formhtml='<input type="text" id="zoeklocatie" size="20" maxlength="40" class="searchinput" style=""/>';geocoderdiv.innerHTML=formhtml;this.div=geocoderdiv;this.searchInputs[0]=$('zoeklocatie');this.searchInputs[0].example="Griffioenlaan 2 Utrecht"
this.DEFAULT_MESSAGE="<label for='zoeklocatie'>Postcode, plaatsnaam en/of adres</label>";},searchImpl:function(){if($('zoeklocatie').value==''||!$('zoeklocatie').value){this.showErrorMessage("Geen invoer opgegeven, voer a.u.b. postcode of adres in");return false;}
if($('zoeklocatie').value.length<this.MINIMALCHARS){this.showErrorMessage("Te weinig tekens, geef a.u.b. minstens "+this.MINIMALCHARS+" letters om te zoeken");return false;}
OpenLayers.Request.GET({url:"geocoder.php",params:{search:$('zoeklocatie').value},scope:this,success:this.parseResponse,failure:this.handleGeneralError});return false;},activate:function(){Geotool.Control.Searcher.prototype.activate.apply(this,arguments);this.showMessage(this.DEFAULT_MESSAGE);},setMap:function(map){Geotool.Control.Searcher.prototype.setMap.apply(this,arguments);if(!this.markerLayer){this.markerLayer=new Geotool.Layer.JSON();this.map.addLayer(this.markerLayer);}},destroy:function(){if(this.markerLayer){this.markerLayer.destroy();this.markerLayer=null;}
return Geotool.Control.Searcher.prototype.destroy.apply(this,arguments);},parseResponse:function(req){this.markerLayer.clearMarkers();this.markerLayer.clearFeatures();var responseText=req.responseText;if(responseText&&(responseText.indexOf('FAILED')!=-1||responseText.indexOf('Exception')!=-1||responseText.indexOf('No more credits')!=-1)){this.showErrorMessage("Er is iets mis gegaan, probeer het nog eens.");return false;}
var features;var xlslusFormat=new Geotool.Format.XLSLUS();var xlslus=xlslusFormat.read(req.responseXML||req.responseText);var features=xlslus;if(xlslus.length>0&&xlslus[0].features){features=xlslus[0].features;}
var records=[];for(var i=0;i<features.length;i++){var feature=features[i];var record={id:feature.fid||feature.id,value:'',info:'',zoom:9,geometry:(feature.geometry?feature.geometry:null)};var address=feature.attributes.address;if(address){if(address.freeFormAddress){record.value=address.freeFormAddress;}else{record.value=OpenLayers.String.trim(address.getStreetText()+' '+address.getBuildingText());var postalCode=OpenLayers.String.trim(address.getPostalCodeText());record.info=(!postalCode||postalCode=='null'?'':postalCode+' ')+this.getPlaceText(address.place);if(!record.value||record.value==''){record.value=record.info;record.info='(gemeente)';record.zoom=7;if((!postalCode||postalCode=='')&&!address.place.Municipality&&!address.place.MunicipalitySubdivision){record.zoom=4;if(address.place.CountrySubdivision){record.info='(provincie)';}}}}}
var bounds=null;if(feature.geometry){bounds=feature.geometry.getBounds();}
if(i<this.maxentries&&!this.recordExists(records,record)){records.push(record);}
feature.destroy();}
this.handleResults(records);},getPlaceText:function(place){var munisub=place.MunicipalitySubdivision;var muni=place.Municipality;var prov=place.CountrySubdivision;return OpenLayers.String.trim((munisub?munisub:(muni?muni:''))+(prov?" "+prov:""));},recordExists:function(array,record){var exists=false;for(var i=0;i<array.length;i++){arec=array[i];if(arec.value==record.value&&arec.info==record.info){return true;}}
return false;},createList:function(arr){if(arr.length==1){this.zoomTo(arr[0]);}
else if(arr.length==0){this.showErrorMessage("Niets gevonden, probeer evt. een andere zoekterm.");}
else{this.resultsArr=arr;var results=document.createElement('div');for(var i=0,l=arr.length;i<l;i++)
{var val=arr[i].value;var output=val;var inputString=this.searchInputs[0].value;var st=val.toLowerCase().indexOf(inputString.toLowerCase());if(st>=0){output=val.substring(0,st)+'<em>'+val.substring(st,st+inputString.length)+'</em>'+val.substring(st+inputString.length);}
var span=this.createDOMElement('span',{},output,true);if(arr[i].info!='')
{var br=this.createDOMElement('br',{});span.appendChild(br);var small=this.createDOMElement('small',{},arr[i].info);span.appendChild(small);}
var a=this.createDOMElement('a',{href:'#'});a.appendChild(span);a.name=i+1;me=this;a.onclick=function(){me.zoomTo((me.resultsArr[parseInt(this.name)-1]));me.hideResultDiv();return false;};a.onmouseover=function(){};var li=this.createDOMElement('li',{},a);results.appendChild(li);}
this.showResultDiv(results);}},onPopupMousemove:function(evt){var controls=this.map.getControlsByClass("Geotool.Control.FeatureInfo");for(var i=0;i<controls.length;i++){controls[i].handler.clearTimer();}
OpenLayers.Event.stop(evt,true);},CLASS_NAME:"Geotool.Control.Geocode"});Geotool.searcherClasses.push(Geotool.Control.Geocode);Geotool.Control.HectometerSearch=new OpenLayers.Class(Geotool.Control.Searcher,{searchType:"hectometerpaal",title:"Snelweglocaties",initialize:function(container,options){Geotool.Control.Searcher.prototype.initialize.apply(this,arguments);var div=document.createElement('div');div.id="hectometersearchdiv";this.searchersDiv.appendChild(div);div.innerHTML='<input type="text" id="hectometersearchinput" class="searchinput" size="8" maxsize="8" value="N674" style=""> '+'<input type="text" id="hectometersearchinput2" class="searchinput" size="8" maxsize="8" style=""> '
this.div=div;this.searchInputs[0]=$('hectometersearchinput');this.searchInputs[0].example="A2";this.searchInputs[1]=$('hectometersearchinput2');this.searchInputs[1].example="81.6";this.DEFAULT_MESSAGE="<label for='hectometersearchinput'>Locaties op snelwegen (snelwegnummer</label> - <label for='hectometersearchinput2'>hectometerpaal)</label>";},activate:function(){Geotool.Control.Searcher.prototype.activate.apply(this,arguments);this.showMessage(this.DEFAULT_MESSAGE);},searchImpl:function(){if(this.searchInputs[0].value==''&&this.searchInputs[1].value==''){this.showErrorMessage("Geen invoer opgegeven, voer a.u.b. snelweg en/of hectometer-aanduiding in");return false;}
var hectosnelweg=this.searchInputs[0].value.toUpperCase();if(hectosnelweg&&hectosnelweg!=null&&hectosnelweg.length>0){if(hectosnelweg.search(/^[AN]\d{1,3}$/)<0){this.showErrorMessage("Ongeldige weg-invoer. Geldige waarden zijn: A2, N62, a208");return false;}}
var hectonummer=document.getElementById("hectometersearchinput2").value;if(hectonummer&&hectonummer!=null&&hectonummer.length>0){if(hectonummer.search(/^\d{1,3}\.\d$/)<0){this.showErrorMessage("Ongeldige nummer-invoer. Geldige waarden zijn: 100.9 10.0 12.3");return false;}
hectonummer=parseFloat(hectonummer)*10;}
OpenLayers.Request.GET({url:"searchdata.php",params:{'hectosnelweg':hectosnelweg,'hectonummer':hectonummer},scope:this,success:this.handleSearch,failure:this.handleGeneralError});return false;},handleSearch:function(req){if(req.responseText&&req.responseText.indexOf('result')>0)
{resultObject=eval("("+req.responseText+")");results=[];var wktObj=new OpenLayers.Format.WKT;for(var i=0;i<resultObject.result.length;i++){var obj=resultObject.result[i];var feature=wktObj.read(obj.LOC);var result={};var wegnummers=obj.ROUTELTR+obj.ROUTENR;if(obj.ROUTE2NR>0&&obj.ROUTELTR!=null){wegnummers=wegnummers+"/"+obj.ROUTE2LTR+obj.ROUTE2NR;}
result.value=wegnummers+' - '+obj.LABEL;result.info=obj.STT_NAAM+" ("+obj.GME_NAAM+")";if(feature&&feature.geometry){result.geometry=feature.geometry;}
else{result.geometry=null;}
result.zoom=8;results.push(result);}
this.handleResults(results);}
else{this.handleGeneralError();}},CLASS_NAME:"Geotool.Control.HectometerSearch"});Geotool.searcherClasses.push(Geotool.Control.HectometerSearch);Geotool.Control.Permalink=OpenLayers.Class(OpenLayers.Control.Permalink,{textElement:null,initialize:function(element,base,options){this.argParserClass=Geotool.Control.ArgParser;OpenLayers.Control.Permalink.prototype.initialize.apply(this,arguments);this.element.onmouseover=OpenLayers.Function.bind(this.updateLink,this);this.element.onclick=OpenLayers.Function.bind(this.onclick,this);if(this.div&&!this.textElement){var inputs=this.div.getElementsByTagName("INPUT");for(var ii=0;ii<inputs.length;ii++){if(inputs[ii].type&&inputs[ii].type.toUpperCase()=='TEXT'){this.textElement=inputs[ii];break;}}}},destroy:function(){this.controller=null;this.textElement=null;OpenLayers.Control.Permalink.prototype.destroy.apply(this,arguments);},onclick:function(){this.updateLink();if(this.div.style.display=='none'){this.div.style.display='block';if(this.textElement){if(this.textElement.nodeName=="INPUT"){this.textElement.focus();this.textElement.select();}}}else{this.div.style.display='none';}
return false;},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.CLASS_NAME==this.argParserClass.prototype.CLASS_NAME){if(control.displayProjection!=this.displayProjection){this.displayProjection=control.displayProjection;}
break;}}
if(i==this.map.controls.length){this.map.addControl(new this.argParserClass({'displayProjection':this.displayProjection}));}
if(this.map){this.controller=this.map.getControl(Geotool.controllerName);}},updateLink:function(){var href=this.base;if(this.controller){href=this.controller.getPermalink(this.base);}
if(this.element.href){this.element.href=href;}
if(this.textElement){if(this.textElement.nodeName=="INPUT"){this.textElement.value=href;}else if(this.textElement.nodeName=="A"){this.textElement.href=href;}else{this.textElement.innerHTML=href;}}},CLASS_NAME:"Geotool.Control.Permalink"});Geotool.Control.RwsnlController=OpenLayers.Class(OpenLayers.Control,{periodControl:null,startDate:null,endDate:null,projecttype:null,baseLayerType:null,layernameprefix:'',selectedCategories:null,currentComponent:null,EVENT_TYPES:["changebaselayertype","changeperiod","changecategory","closepopup","popupdataloaded"],initialize:function(periodControl,searchContainer,options){this.EVENT_TYPES=Geotool.Control.RwsnlController.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[options]);this.periodControl=periodControl;this.searchContainer=searchContainer;this.baseLayerTypeControl=new Geotool.Control.BaseLayerTypeControl();this.componentsByProjecttype={};},setMap:function(map){OpenLayers.Control.prototype.setMap.apply(this,arguments);if(this.map){this.map.addControl(this.periodControl);this.map.addControl(this.baseLayerTypeControl);}},activate:function()
{OpenLayers.Control.prototype.activate.apply(this,arguments);if(this.periodControl){this.periodControl.events.on({"changeperiod":this.changeperiod,scope:this});this.startDate=this.periodControl.getStartDate();this.endDate=this.periodControl.getEndDate();this.defaultStartDate=this.periodControl.getDefaultStartDate();this.defaultEndDate=this.periodControl.getDefaultEndDate();}
this.baseLayerTypeControl.events.on({"changebaselayertype":this.changebaselayertype,scope:this});},deactivate:function()
{if(this.periodControl){this.periodControl.events.un({"changeperiod":this.changeperiod,scope:this});}
this.baseLayerTypeControl.events.un({"changebaselayertype":this.changebaselayertype,scope:this});OpenLayers.Control.prototype.deactivate.apply(this,arguments);},changecategory:function(categoryEvent)
{this.closePopup();if(this.selectedCategories!=categoryEvent.selectedCategories){this.selectedCategories=categoryEvent.selectedCategories;this.events.triggerEvent("changecategory",categoryEvent);}},changeperiod:function()
{this.closePopup();this.startDate=this.periodControl.getStartDate();this.endDate=this.periodControl.getEndDate();this.events.triggerEvent("changeperiod");},changefilter:function(filterEvent)
{this.closePopup();this.projecttype=filterEvent.projecttype;if(filterPeriods&&filterPeriods[this.projecttype]){this.periodControl.setLastDate(filterPeriods[this.projecttype].lastenddate);}
this.selectedCategories=null;if(this.currentComponent){this.currentComponent.deactivate();this.currentComponent=null;}
this.activateComponent();if(this.events.listeners["changeperiod"].length==0){this.periodControl.deactivate();}else{this.periodControl.activate();}
if(this.currentComponent!=null&&this.searchContainer){var searcherTypes=this.currentComponent.searcherTypes;if(!searcherTypes){searcherTypes="adres";}
this.searchContainer.setSearchers(searcherTypes);}},changebaselayertype:function(baseLayerTypeEvent)
{this.baseLayerType=baseLayerTypeEvent.baselayertype;if(baseLayerTypeEvent.layernameprefix&&baseLayerTypeEvent.layernameprefix.length>0){this.layernameprefix=baseLayerTypeEvent.layernameprefix;}else{baseLayerTypeEvent.layernameprefix=this.layernameprefix;}
this.events.triggerEvent("changebaselayertype",baseLayerTypeEvent);},closePopup:function()
{if(!this.map)return false;this.events.triggerEvent("closepopup");for(var i=this.map.popups.length-1;i>=0;i--)
{this.map.removePopup(this.map.popups[i]);}},activateComponent:function()
{var component=this.componentsByProjecttype[this.projecttype];if(!component){for(var i=0;i<Geotool.componentClasses.length;i++){var componentClass=Geotool.componentClasses[i];if(componentClass.prototype.projecttype==this.projecttype){component=new componentClass(this.map,bLoadProjects);}}
this.componentsByProjecttype[this.projecttype]=component;}
if(!component){this.currentComponent=null;}else{this.currentComponent=component;}
if(this.currentComponent!=null){this.currentComponent.activate();this.events.triggerEvent("changebaselayertype",{baselayertype:this.baseLayerType,layernameprefix:this.layernameprefix});}},getSelectedFeatureId:function()
{var featureId=null;if(this.map&&this.map.selectedFeature!=null&&this.map.selectedFeature.data){var data=this.map.selectedFeature.data;if(typeof(data.ids)=='object'&&data.ids.length&&data.ids.length>0){featureId=data.ids[0];}else if(typeof(data.ids)=='string'||typeof(data.ids)=='number'){featureId=data.ids;}else if(typeof(data.id)=='string'||typeof(data.id)=='number'){featureId=data.id;}}
return featureId;},getPermalink:function(baseurl,withoutProjectType)
{var params=OpenLayers.Util.getParameters(baseurl);if(params.cookieload){delete params.cookieload;}
delete params.width;delete params.height;params.baselayer=this.layernameprefix+this.baseLayerType;if(!withoutProjectType){params.projecttype=this.projecttype;}
delete params.bbox;var center=this.map.getCenter();var lat=Math.round(center.lat);var lon=Math.round(center.lon);params.center=lon+","+lat;params.mapscale=this.map.getScale();delete params.legend;if(this.selectedCategories){params.legend=this.selectedCategories;}
delete params.startdate;delete params.enddate;if(this.startDate!=this.defaultStartDate||this.endDate!=this.defaultEndDate){params.startdate=this.startDate;params.enddate=this.endDate;}
delete params.works;var openPopinWorkId=this.getSelectedFeatureId();if(openPopinWorkId){params.works=openPopinWorkId;}
if(this.currentComponent&&typeof(this.currentComponent.kmlurl)=="string"&&this.currentComponent.kmlurl.length>0){params.kml=this.currentComponent.kmlurl;params.kmllegend=this.currentComponent.kmllegendurl;}
var href=(!baseurl?"":baseurl);if(href.indexOf('?')!=-1){href=href.substring(0,href.indexOf('?'));}
href+='?'+OpenLayers.Util.getParameterString(params);return href;},CLASS_NAME:"OpenLayers.Control.RwsnlController"});Geotool.Control.VaarwegSearch=new OpenLayers.Class(Geotool.Control.Searcher,{searchType:"vaarweg",title:"Vaarwegen",initialize:function(container,options){Geotool.Control.Searcher.prototype.initialize.apply(this,arguments);var div=document.createElement('div');div.id="vaarwegsearchdiv";this.searchersDiv.appendChild(div);div.innerHTML='<input type="text" id="vaarweginput" class="searchinput" size="20" maxsize="40" value="IJssel" style=""> ';this.div=div;this.searchInputs[0]=$('vaarweginput');this.searchInputs[0].example="IJssel";this.DEFAULT_MESSAGE="<label for='vaarweginput'>Vaarwegen in Nederland</label>";},activate:function(){Geotool.Control.Searcher.prototype.activate.apply(this,arguments);this.showMessage(this.DEFAULT_MESSAGE);},searchImpl:function(){var vaarwegnaam=this.searchInputs[0].value;var invalidMessage="Ongeldige invoer, geef minstens 3 letters.";if(this.searchInputs[0].value.length<3){this.showErrorMessage(invalidMessage);return false;}
OpenLayers.Request.GET({url:"searchdata.php",params:{vaarweg:vaarwegnaam},scope:this,success:this.handleSearch,failure:this.handleGeneralError});return false;},handleSearch:function(req){if(req.responseText&&req.responseText.indexOf('result')>0)
{resultObject=eval("("+req.responseText+")");results=[];var wktObj=new OpenLayers.Format.WKT();for(var i=0;i<resultObject.result.length;i++){var obj=resultObject.result[i];var result={};result.value=obj.VAARWEG;result.info="";var feature=wktObj.read(obj.GEOMETRY);if(feature&&feature.geometry){result.geometry=feature.geometry;}
else{result.geometry=null;}
var marker=wktObj.read(obj.MARKER);if(marker&&marker.geometry){var lonlat=new OpenLayers.LonLat(marker.geometry.x,marker.geometry.y);result.marker=lonlat;}
results.push(result);}
this.handleResults(results);}
else{this.handleGeneralError();}},CLASS_NAME:"Geotool.Control.VaarwegSearch"});Geotool.searcherClasses.push(Geotool.Control.VaarwegSearch);Geotool.Control.ZipSearch=new OpenLayers.Class(Geotool.Control.Searcher,{searchType:"postcode4",title:"Postcode4",initialize:function(container,options){Geotool.Control.Searcher.prototype.initialize.apply(this,arguments);var div=document.createElement('div');div.id="zipsearchdiv";this.searchersDiv.appendChild(div);div.innerHTML='<input type="text" id="zipsearchinput" class="searchinput" size="20" maxsize="4" style="">';this.div=div;this.searchInputs[0]=$('zipsearchinput');this.searchInputs[0].example=$('2622 HA');this.DEFAULT_MESSAGE="<label for='zipsearchinput'>postcode 4</label>";},activate:function(){Geotool.Control.Searcher.prototype.activate.apply(this,arguments);this.showMessage(this.DEFAULT_MESSAGE);},searchImpl:function(){var pc4Value=document.getElementById('zipsearchinput').value;this.invalidPostcodeMessage="Ongeldige postcode: '"
+pc4Value+"'. "
+"Voer een geldige postcode-4 in a.u.b. "
+" (alleen de 4 cijfers) ";if(pc4Value.search(Geotool.Control.ZipSearch.VALID_REGEXP)<0){this.showErrorMessage(this.invalidPostcodeMessage);return false;}
OpenLayers.Request.GET({url:"searchdata.php",params:{pc4:pc4Value},scope:this,success:this.handleSearch,failure:this.handleGeneralError});return false;},handleSearch:function(req){if(req.responseText&&req.responseText.indexOf('result')>0)
{resultObject=eval("("+req.responseText+")");if(resultObject.result[0]&&resultObject.result[0].PC&&resultObject.result[0].X&&resultObject.result[0].Y)
{this.zoomTo(resultObject.result[0].PC,resultObject.result[0].GEMEENTE+" ("+resultObject.result[0].PROVINCIE+")",new OpenLayers.Geometry.Point(resultObject.result[0].X,resultObject.result[0].Y),null);document.getElementById('zipsearchinput').value="";}
else{this.showErrorMessage(this.invalidPostcodeMessage);}}},CLASS_NAME:"Geotool.Control.ZipSearch"});Geotool.Control.ZipSearch.VALID_REGEXP=/^\d\d\d\d$/;Geotool.searcherClasses.push(Geotool.Control.ZipSearch);Geotool.Feature=OpenLayers.Class(OpenLayers.Feature,{miniPopup:null,delayMiniPopupOpen:100,delayMiniPopupClose:500,timerId:null,initialize:function(layer,lonlat,data){this.popupClass=Geotool.Popup.Framed;OpenLayers.Feature.prototype.initialize.apply(this,arguments);this.popupCloseFunc=OpenLayers.Function.bindAsEventListener(this.markerClick,this);this.markerClickBoundToThis=OpenLayers.Function.bind(this.markerClick,this);},destroy:function(){if((this.layer!=null)&&(this.layer.map!=null)){if(this.miniPopup!=null){this.layer.map.removePopup(this.miniPopup);}}
OpenLayers.Feature.prototype.destroy.apply(this,arguments);if(this.miniPopup!=null){this.destroyMiniPopup();this.miniPopup=null;}},createMarker:function(){if(this.lonlat!=null){this.marker=new Geotool.Marker.Html(this.lonlat,this.data.icon);}
return this.marker;},createPopup:function(closeFunc){if(this.lonlat!=null){var id=this.id+"_popup";if(!this.popup){this.popup=new this.popupClass(id,this.lonlat,this.data.popupSize,this.data.popupContentHTML,null,!!closeFunc,closeFunc);if(this.popup.autoSize){this.popup.panMapIfOutOfView=true;if(this.data.popupsize){this.popup.minSize=new OpenLayers.Size(this.data.popupsize,71);this.popup.maxSize=new OpenLayers.Size(this.data.popupsize+200,400);}
else{this.popup.minSize=new OpenLayers.Size(200,71);this.popup.maxSize=new OpenLayers.Size(450,400);}
if(this.data.popupPreferredSize){this.popup.preferredSize=this.data.popupPreferredSize;}}
if(this.data.popupClass&&this.popup.div){this.popup.div.className=this.data.popupClass;}
if(this.data.popupContentURL){this.layer.events.triggerEvent("loadstart");this.popupLoadLayer=this.layer;var popupContentURL=this.data.popupContentURL;OpenLayers.loadURL(popupContentURL,null,this,this.popupDataLoaded,this.popupDataLoadFailed);}
this.popup.events.on({"mousemove":moveMouse});}
if(this.data.overflow!=null){this.popup.contentDiv.style.overflow=this.data.overflow;}
this.popup.feature=this;}
return this.popup;},popupDataLoaded:function(request)
{try{if(this.layer&&this.layer.map){var controller=this.layer.map.getControl(Geotool.controllerName);controller.events.triggerEvent('popupdataloaded',{request:request,feature:this});}}catch(err){if(console&&console.log){console.log("Error in popupDataLoadFailed:"+err);}}
var layer=(this.layer?this.layer:this.popupLoadLayer);this.popupLoadLayer=null;if(layer){layer.events.triggerEvent("loadend");}},popupDataLoadFailed:function(request)
{try{if(this.layer&&this.layer.map){var controller=this.layer.map.getControl(Geotool.controllerName);controller.events.triggerEvent('popupdataloaded',{request:request,feature:this,failed:true});}}catch(err){if(console&&console.log){console.log("Error in popupDataLoadFailed:"+err);}}
var layer=(this.layer?this.layer:this.popupLoadLayer);this.popupLoadLayer=null;if(layer){layer.events.triggerEvent("loadend");}},createMiniPopup:function(closeBox){if(this.lonlat!=null){var id=this.id+"_minipopup";var anchor=this.anchor;if(!this.miniPopup){this.miniPopup=new this.popupClass(id,this.lonlat,this.data.miniPopupSize,this.data.miniPopupContentHTML||" ",null,closeBox,null,true);if(this.miniPopup.autoSize){this.miniPopup.minSize=new OpenLayers.Size(200,65);this.miniPopup.maxSize=new OpenLayers.Size(320,150);if(this.data.popupPreferredSize){this.miniPopup.preferredSize=this.data.popupPreferredSize;}
this.miniPopup.div.className="olPopupMini";this.miniPopup.displayClass="olPopupMini";}else{this.miniPopup.div.className="olPopupMiniFixed";this.miniPopup.displayClass="olPopupMiniFixed";}}
if(this.data.overflow!=null){this.miniPopup.contentDiv.style.overflow=this.data.overflow;}
this.miniPopup.feature=this;}
return this.miniPopup;},destroyMiniPopup:function(){if(this.miniPopup){if(this.miniPopup.clickmeDiv){OpenLayers.Event.stopObserving(this.miniPopup.clickmeDiv,"click",this.markerClickBoundToThis);this.miniPopup.clickmeDiv=null;}
this.miniPopup.feature=null;this.miniPopup.destroy();this.miniPopup=null;}},markerClick:function(evt){var sameMarkerClicked=(typeof this.layer.map.selectedFeature!='undefined'&&this==this.layer.map.selectedFeature);if(this.layer.removePopupHighlightFeatures){this.layer.removePopupHighlightFeatures();}
if(this.layer.map.selectedFeature&&this.layer.map.selectedFeature.destroyPopup){this.layer.map.selectedFeature.destroyPopup();}
this.layer.map.selectedFeature=(!sameMarkerClicked)?this:null;for(var i=0;i<this.layer.map.popups.length;i++){this.layer.map.removePopup(this.layer.map.popups[i]);}
if(!sameMarkerClicked){this.layer.map.addPopup(this.createPopup(this.popupCloseFunc));this.removeLinksFromTabOrder(this.popup);if(this.control&&this.control.onPopupMousemove){this.popup.events.un({"mousemove":this.popup.onmousemove,scope:this.popup});this.popup.events.on({"mousemove":this.control.onPopupMousemove,scope:this.control});}
var icon=(this.data?this.data.icon:null);if(icon&&icon.highlightFeatures&&icon.highlightVectorLayer.getFeatureById(icon.highlightFeatures[0].id)==null)
{icon.highlightVectorLayer.addFeatures(icon.highlightFeatures);}}
if(evt){OpenLayers.Event.stop(evt);}},openMiniPopupDelayed:function(evt){this.clearTimer();this.timerId=window.setTimeout(OpenLayers.Function.bind(this.openMiniPopup,this),this.delayMiniPopupOpen);if(evt){OpenLayers.Event.stop(evt);}},openMiniPopup:function(evt){if(!this.popup||!this.popup.map){if(!this.miniPopup){var popup=this.createMiniPopup();if(popup){popup.events.on({"mousemove":moveMouse});popup.events.on({"click":hideBox});if(this.layer.onPopupMousemove){popup.events.on({"mousemove":this.layer.onPopupMousemove,scope:this});}
if(this.layer.onPopupMouseout){popup.events.on({"mouseout":this.layer.onPopupMouseout,scope:this});}
if(this.control&&this.control.onPopupMousemove){popup.events.un({"mousemove":popup.onmousemove,scope:popup});popup.events.on({"mousemove":this.control.onPopupMousemove,scope:this.control});}
popup.events.un({"click":popup.onclick,scope:popup});popup.events.on({"click":this.markerClick,scope:this});popup.events.on({"mouseover":this.clearTimer,scope:this});popup.events.on({"mouseout":this.closeMiniPopupDelayed,scope:this});popup.div.title="body=[ Klik voor details ] cssbody=[hdrtooltip] header= cssheader=[none]";}}
if(this.miniPopup&&!this.miniPopup.map){this.layer.map.addPopup(this.miniPopup);this.removeLinksFromTabOrder(this.miniPopup);}}
if(evt){OpenLayers.Event.stop(evt);}},closeMiniPopupDelayed:function(evt){this.clearTimer();this.timerId=window.setTimeout(OpenLayers.Function.bind(this.closeMiniPopup,this),this.delayMiniPopupClose);if(evt){OpenLayers.Event.stop(evt);}},closeMiniPopup:function(evt){if(this.miniPopup&&this.miniPopup.map){if(this.layer.removePopupHighlightFeatures){if(!this.layer.map||!this.layer.map.selectedFeature){this.layer.removePopupHighlightFeatures();}}
this.layer.map.removePopup(this.miniPopup);this.destroyMiniPopup();}
if(evt){OpenLayers.Event.stop(evt);}},clearTimer:function(){if(this.timerId!=null){window.clearTimeout(this.timerId);this.timerId=null;}},removeLinksFromTabOrder:function(popup)
{var links=popup.div.getElementsByTagName("A");for(var li=0;links&&li<links.length;li++){var linkElem=links[li];linkElem.tabIndex=-1;}},CLASS_NAME:"Geotool.Feature"});Geotool.Format.XLSLUS.v1_1_0=OpenLayers.Class(Geotool.Format.XLSLUS.v1,{VERSION:"1.1.0",schemaLocation:"http://www.opengis.net/xls http://schemas.opengis.net/ols/1.1.0/LocationUtilityService.xsd",initialize:function(options){Geotool.Format.XLSLUS.v1.prototype.initialize.apply(this,[options]);},CLASS_NAME:"Geotool.Format.XLSLUS.v1_1_0"});Geotool.Strategy.Marker.Periodic=OpenLayers.Class(Geotool.Strategy.Marker.Fixed,{interval:300000,timerId:null,updateCallback:null,savedFeatureId:null,initialize:function(url,options){Geotool.Strategy.Marker.Fixed.prototype.initialize.apply(this,arguments);this.updateCallback=OpenLayers.Function.bind(this.update,this);},activate:function(){var activated=Geotool.Strategy.Marker.Fixed.prototype.activate.call(this);this.layer.events.on({"loadstart":this.saveState,scope:this});this.layer.events.on({"loadend":this.restoreState,scope:this});return activated;},deactivate:function(){this.layer.events.un({"loadstart":this.saveState,scope:this});this.layer.events.un({"loadend":this.restoreState,scope:this});var deactivated=Geotool.Strategy.Marker.Fixed.prototype.deactivate.call(this);if(deactivated){if(this.timerId!=null){clearTimeout(this.timerId);this.timerId=null;}}
return deactivated;},update:function(options){if(typeof options!='object'){options={};}
options.force=true;try{Geotool.Strategy.Marker.Fixed.prototype.update.call(this,options);}catch(e){}
this.timerId=window.setTimeout(this.updateCallback,this.interval);},saveState:function(){if(!this.layer||!this.layer.map){this.savedFeatureId=null;}else{var controller=this.layer.map.getControl(Geotool.controllerName);this.savedFeatureId=controller.getSelectedFeatureId();}},restoreState:function(){if(this.savedFeatureId==null){return;}
if(!this.layer||!this.layer.map){return;}
var controller=this.layer.map.getControl(Geotool.controllerName);if(controller.getSelectedFeatureId()!=null){return;}
if(this.layer&&typeof this.layer.getMarkerById=='function'){var marker=this.layer.getMarkerById(this.savedFeatureId);if(marker!=null)
{marker.events.triggerEvent('click');}}},CLASS_NAME:"Geotool.Strategy.Marker.Periodic"});Geotool.Component.BruggenSluizen=OpenLayers.Class(Geotool.Component,{layernameprefix:"waterkaart_",projecttype:'bruggensluizen',searcherTypes:"bruggensluizen,vaarweg,adres",groupLayer:null,vectorLayer:null,title:"Openingstijden Bruggen en Sluizen",featureInfoControl:null,jsonParser:null,wktParser:null,dayCodes:{'NNNNNJNN':'za','JNNNNNNN':'ma','JJJJNNNN':'ma t/m do','NNNNNNJN':'zo','NJJNNNNN':'di t/m wo','NNNNJJJN':'vr t/m zo','NNNNNNNJ':'fstd','JJNJJNNN':'ma/di/do/vr','JJJJJNNN':'ma t/m vr','NNNNNNJJ':'zo/fstd','NJJJJNNN':'di t/m vr','JJJJJJJN':'dagelijks','NJJJJJNN':'di t/m za','NNNNJJNN':'vr/za','JJNJJJJJ':'ma/di/do/vr/za/zo/fstd','JJJJJNJN':'ma t/m vr, zo','NNNNNJNJ':'za, fstd','JJJJJJNN':'ma t/m za','NNNNNJJJ':'za/zo/fstd','NNNJNNNN':'do','NNNNJJJJ':'vr t/m zo, fstd','JJJJNJNN':'ma t/m do, za','NNJNNNNN':'wo','JJJJJJJJ':'dagelijks','NNNNNJJN':'za t/m zo','NNNNJNNN':'vr','NJJJNNNN':'di t/m do'},bedieningsAanwijzingen:{'ZUID':'Alleen zuidgaand','HAR ':'HAR ???','KAN ':'KAN ???','VERZ':'Alleen op afroep','BSCH':'Begeleide scheepvaart','GEEN':'Geen bediening','OPEN':'Staat (in het algemeen) open','STDU':'Alleen de stad uit','OPSC':'Opschutten','FACO':'Facultatieve opening','AFSC':'Afschutten','ZELF':'Zelfbediening','BERP':'Uitsluitend voor beroepsvaart','BVAF':'Uitsl. beroepsvaart op afroep','RECR':'Recreatievaart','KONV':'Konvooivaart','AFVT':'Afvaart'},wmsLayer:null,initialize:function(map,bLoadProjects,options){Geotool.Component.prototype.initialize.apply(this,arguments);this.categoryControl=new Geotool.Control.CategoryControl("legendaBruggenSluizenform","legendaInputBruggenSluizen","legendaBruggenSluizen");this.categoryControl.setPolicy('toggle');this.groupLayer=new Geotool.Layer.Group("BruggenSluizen");this.wmsLayer=new OpenLayers.Layer.WMS('bruggenensluizen','wms.php/rwsnl/bruggenensluizen',{layers:'bruggenensluizen','format':'image/png',transparent:true},{'buffer':0,isBaseLayer:false,'projection':'EPSG:28992','units':'m',singleTile:true,alpha:true});this.wmsLayer.setVisibility(true);this.groupLayer.addLayer(this.wmsLayer)
var clustericon='components/bruggensluizen/icons/cluster.png';var style_green={strokeColor:"#ffff00",strokeOpacity:1,strokeWidth:3,pointRadius:6,externalGraphic:clustericon,graphicWidth:29,graphicHeight:23,graphicYOffset:-20,graphicXOffset:-13,pointerEvents:"visiblePainted"};this.vectorLayer=new OpenLayers.Layer.Vector("Brug Highlight layer");this.vectorLayer.style=style_green;this.vectorLayer.setVisibility(true);this.groupLayer.addLayer(this.vectorLayer);if(map){map.addControl(this.categoryControl);}
var icon=new OpenLayers.Icon("_img/almost_transparent_marker.png",new OpenLayers.Size(17,17));this.featureInfoControl=new Geotool.Control.FeatureInfo({markerIcon:icon,handlerOptions:{delay:500}});this.jsonParser=new OpenLayers.Format.JSON();this.wktParser=new OpenLayers.Format.WKT();},activate:function(){Geotool.Component.prototype.activate.apply(this,arguments);this.map.addControl(this.featureInfoControl);this.featureInfoControl.events.on({'featureinfostart':this.featureInfoStart,scope:this});this.featureInfoControl.events.on({'beforefeatureadded':this.doBeforeFeatureAdded,scope:this});map.getControl(Geotool.controllerName).events.register('popupdataloaded',this,this.onPopupDataLoaded);this.map.activeLayer=this.wmsLayer;this.featureInfoControl.activate();},deactivate:function()
{this.vectorLayer.destroyFeatures();this.map.removeControl(this.featureInfoControl);Geotool.Component.prototype.deactivate.apply(this,arguments)
this.featureInfoControl.deactivate();this.featureInfoControl.events.un({'featureinfostart':this.featureInfoStart,scope:this});this.featureInfoControl.events.un({'beforefeatureadded':this.doBeforeFeatureAdded,scope:this});},featureInfoStart:function(evt)
{this.vectorLayer.destroyFeatures();},onPopupDataLoaded:function(obj){var response=obj.request.responseText;var obj=this.jsonParser.read(response);if(obj&&obj.objecttype=="cluster"&&obj.toelichting){var html="<table class='olPopupTable' cellspacing='0'>";html+="<tr><td colspan=2>&nbsp;</td></tr>";html+="<tr><td colspan=2><b>Clustertoelichting<b></td></tr>";html+="<tr><td colspan='2'>"+obj.toelichting+"</td></tr></table>";document.getElementById('clustertoelichting').innerHTML=html;}
if(obj&&obj.bedieningsperiodes){var html="<table class='olPopupTable' cellspacing='0'>";for(var i=0;i<obj.bedieningsperiodes.length;i++){var periode=obj.bedieningsperiodes[i];html+="<tr><td colspan='3'>&nbsp;</td></tr>";Geotool.Calendar.formatMMDD(periode.begin);html+="<tr><td colspan='3'><b>"+Geotool.Calendar.formatMMDD(periode.begin)+" t/m "+Geotool.Calendar.formatMMDD(periode.eind)+"</b></td></tr>";var perioderegels=periode.regels;var dayString;for(var j=0;j<perioderegels.length;j++){var dayString=this.dayCodes[perioderegels[j].dagcode];if(!dayString){alert('ongeldige dagcode: '+perioderegels[j].dagcode+' geef aub door aan rijkswaterstaat');dayString=perioderegels[j].dagcode;}
var tijdstart=perioderegels[j].tijdstart;if(!tijdstart){tijdstart=''};var tijdeind=perioderegels[j].tijdeind;if(!tijdeind){tijdeind=''}
else{tijdeind='-'+tijdeind};html+="<tr><td>"+dayString+"</td><td>"+tijdstart+tijdeind+"</td>";var aanwijzing=this.bedieningsAanwijzingen[perioderegels[j].aanwijzing];if(!aanwijzing){aanwijzing=''};var toelichting=perioderegels[j].toelichting;if(!toelichting){toelichting=''};html+="<td>"+aanwijzing+" "+toelichting+"</td></tr>";}
html+="<tr><td colspan='2'>"+"</td></tr>";}
html+="</table>";document.getElementById('bedieningsperiodes').innerHTML=html;}
if(obj&&obj.clusterobjecten){var features=[];var html="<table class='olPopupTable' cellspacing='0'>";html+="<tr><td colspan='2'>&nbsp;</td></tr>";html+="<tr><td colspan='2'><b>Andere sluizen en/of bruggen in dit cluster</b></td></tr>";for(var i=0;i<obj.clusterobjecten.length;i++){var clusterobj=obj.clusterobjecten[i];var meetpunt='';if(clusterobj['meetpunt']){meetpunt=" ("+(clusterobj['meetpunt']).trim()+")"};var telefoon='';if(clusterobj['telefoon']){telefoon="T:&nbsp;"+(clusterobj['telefoon'])+" "};var marifoon='';if(clusterobj['marifoon']){marifoon="Mk:&nbsp;"+(clusterobj['marifoon'])};html+="<tr><td>"+clusterobj['naam']+meetpunt+"</td><td>"+telefoon+marifoon+"</td>";}
html+="</table>";document.getElementById('clusterobjecten').innerHTML=html;}},tableRow:function(key,value){if(value){return"<tr><td>"+key+"</td><td>"+value+"</td></tr>";}
return"";},doBeforeFeatureAdded:function(evt){if(!evt.featurelist||!evt.feature||evt.featurelist.length==0||evt.featurelist[0].features.length==0){return false;}
var attrs=evt.featurelist[0].features[0].attributes;var type=(attrs.OTP_CODE).toLowerCase();var typeText=(type=='sls'?'sluis':'brug');var iconPath='components/bruggensluizen/icons/';var plaatsnaam='';if(attrs.PLAATSNAAM){plaatsnaam=' ('+attrs.PLAATSNAAM+')';}
var telnr='';if(attrs.TEL_NR){telnr='tel: '+attrs.TEL_NR};var marifoon='';if(attrs.MARIFOONKA){marifoon=' marifoon: '+attrs.MARIFOONKA}
var html='<div class="bruggensluizen bruggensluizen_'+type+'">'
+'<table class="olPopupTable" cellspacing="0">'
+'<tr><td class="popinleftbar"><img border="0" src="'+iconPath+type+'.png"></td>'
+'<td class="title">&nbsp;</td><td class="title">'+attrs.NAAM+plaatsnaam+'</td></tr>'
+'<tr><td class="popiniconsubscript">'+typeText+'</td><td class="subtitle">&nbsp;</td><td class="subtitle">'+telnr+marifoon+'</td></tr>';evt.feature.data['miniPopupContentHTML']=html+"</table></div>";html+="<tr class='rowsimple'><td colspan='3' id='clustertoelichting'>";html+="</td></tr>";html+="<tr class='rowsimple'><td colspan='3' id='bedieningsperiodes'>";html+="</td></tr>";html+="<tr class='rowsimple'><td colspan='3'>";html+="<table class='olPopupTable' cellspacing='0'>";html+="<tr><td colspan=2>&nbsp;</td></tr>";html+="<tr><td colspan=2><b>Algemene Gegevens<b></td></tr>";html+="<tr><td>Naam</td><td>"+attrs.NAAM+"</td></tr>";if("BRG"==attrs.OTP_CODE){html+=this.tableRow('Type','Brug');html+=this.tableRow('Beweegbaar',attrs.BEWEEGB);html+=this.tableRow('Max hoogte gesloten&nbsp;(m)',attrs.MAX_BRG_H_GESL);html+=this.tableRow('Aantal openingen',attrs.NR_OPENING);}
else if("SLS"==attrs.OTP_CODE){html+=this.tableRow('Type','Sluis');html+=this.tableRow('Max kolk breedte&nbsp;(m)',attrs.MAX_SKK_KOLKW);html+=this.tableRow('Max kolk lengte&nbsp;(m)',attrs.MAX_SKK_KOLKL);html+=this.tableRow('Aantal kolken',attrs.NR_KOLKEN);}
html+=this.tableRow('Afstandsbediend',attrs.AFST_BED);html+=this.tableRow('Haven/Vaar',attrs.HAVEN_VAAR);html+=this.tableRow('Referentievlak',attrs.REF_VLAK);html+=this.tableRow('Refvlak BeBu',attrs.REF_V_BEBU);html+=this.tableRow('Refvlak BoBi',attrs.REF_V_BOBI);var afdeling="";if(attrs.BHR_AFDELI&&attrs.BHR_AFDELI.length>2){afdeling=attrs.BHR_AFDELI;}
html+="<tr><td>Beheerder</td><td>"+attrs.BHR_TYPE+" "+attrs.BHR_NAAM+afdeling+"</td></tr>";html+=this.tableRow('Beheerder adres',attrs.BHR_BE_ADR);html+=this.tableRow('&nbsp',attrs.BHR_B_PLTS);html+=this.tableRow('Beheerder postadres',attrs.BHR_POSTAD);html+="<tr><td>&nbsp;</td><td>"+attrs.BHR_POS_PC+" "+attrs.BHR_P_PLTS+"</td></tr>";html+=this.tableRow('Beheerder telefoon',attrs.BHR_TEL_NR);html+=this.tableRow('Beheerder fax',attrs.BHR_FAX_NR);html+="</table></td></tr>";html+="<tr class='rowsimple'><td colspan='3' id='clusterobjecten'>";html+="</td></tr>";html+="</table></div>";evt.feature.data['popupContentHTML']=html;if(evt.feature.lonlat){evt.feature.lonlat.lon=attrs.X;evt.feature.lonlat.lat=attrs.Y;}
evt.feature.data.popupClass='bruggensluizen bruggensluizen_'+type+' olPopup';var clusterID=attrs.BCT_ID;if(clusterID){evt.feature.data.popupContentURL='bruggensluizen.php?mode=data&clusterid='+clusterID;}
var clusterFeature=this.wktParser.read(attrs.CLUSTER_WKT);this.vectorLayer.addFeatures(clusterFeature);return true;},CLASS_NAME:"Geotool.Component.BruggenSluizen"});Geotool.Component.GeluidBL=OpenLayers.Class(Geotool.Component,{projecttype:'geluid',title:'Geluidsbelasting rond snelwegen',searcherTypes:"adres,hectometerpaal",groupLayer:null,initialize:function(map,options){Geotool.Component.prototype.initialize.apply(this,arguments);this.categoryControl=new Geotool.Control.CategoryControl("categorygeluidform","categorygeluidinput","categorygeluid");this.categoryControl.setVisibility=this.categorySetVisibility;this.groupLayer=new Geotool.Layer.Group("Geluidsbelasting");if(map){map.addControl(this.categoryControl);}
this.groupLayer.defaultLegendValue=1;this.categoryControl.setCategory(this.groupLayer.defaultLegendValue,true);},setVisibility:function(visible){Geotool.Component.prototype.setVisibility.apply(this,arguments);this.setDisplayStyle('geluidsubfilter',(visible?'block':'none'));},layernameprefix:function()
{if(!this.categoryControl.currentCategories){this.categoryControl.currentCategories=1;}
if(this.categoryControl.currentCategories==1){return"geluid_lden_";}
if(this.categoryControl.currentCategories==2){return"geluid_lnight_";}
return"geluid_lden_";},categorySetVisibility:function(visible)
{if(!this.div){return;}
if(visible){this.div.style.display='block';var value=this.currentCategories;if(value==null){value=1;}
if(document.getElementById('legendaLDEN')&&document.getElementById('legendaLNIGHT')){document.getElementById('legendaLDEN').style.display=(value==1?'block':'none');document.getElementById('legendaLNIGHT').style.display=(value==1?'none':'block');}}else{this.div.style.display="none";if(document.getElementById('legendaLDEN')&&document.getElementById('legendaLNIGHT')){document.getElementById('legendaLDEN').style.display="none";document.getElementById('legendaLNIGHT').style.display="none";}}},categoryChanged:function(categoryEvent)
{var value=categoryEvent.selectedCategories;if(value==1){document.getElementById('legendaLDEN').style.display='block';document.getElementById('legendaLNIGHT').style.display='none';}
else{document.getElementById('legendaLDEN').style.display='none';document.getElementById('legendaLNIGHT').style.display='block';}
var controller=this.map.getControl(Geotool.controllerName);controller.events.triggerEvent("changebaselayertype",{baselayertype:controller.baseLayerType});},CLASS_NAME:"Geotool.Component.GeluidBL"});Geotool.Component.prototype.setDisplayStyle('geluidsubfilter','none');Geotool.componentClasses.push(Geotool.Component.GeluidBL);Geotool.Component.Geluidsregister=OpenLayers.Class(Geotool.Component.WMSBase,{layernameprefix:"autoww_",projecttype:'geluidsregister',searcherTypes:"adres,hectometerpaal",popup:null,title:"Geluidsregister",wmsLayer:null,initialLayers:'homogenewegvakken,afschermendeobjecten,referentiepunten',layerLookup:null,categoryByLayer:null,downloadControl:null,viewSpecByType:{'referentiepunten':{name:'Referentiepunten',title:'Referentiepunt ${ID} met geluidsproductieplafond ${gpp}',subtitle:'Info referentiepunten',columns:{'ID':{name:'Code'},'H_W_1vast':{name:'Heersende waarde bij vaststelling'},'beg_dat':{name:'Begindatum',format:Geotool.Calendar.formatYYYYMMDD},'eind_dat':{name:'Einddatum',format:Geotool.Calendar.formatYYYYMMDD},'gpp':{name:'Geluidproductieplafond',format:"${gpp} dB"},'gpp_hist':{name:'Historie referentiepunt'},'recent_bes':{name:'Meest recente besluit',format:"formatDocUri",type:'html'},'ontheffing':{name:'Verleende ontheffing',format:"formatDocUri",type:'html'},'opschort_b':{name:'Opschortingsbesluit',format:"formatDocUri",type:'html'},'san_opschb':{name:'Vrijstelling',format:"formatDocUri",type:'html'},'overschr_b':{name:'Overschrijdingsbesluit',format:"formatDocUri",type:'html'},'artikel':{name:'Wetsartikel'},'POINT_X':{name:'X coordinaat in RD',format:"formatRound2Decimal"},'POINT_Y':{name:'Y coordinaat in RD',format:"formatRound2Decimal"},'POINT_Z':{name:'Hoogte t.o.v. NAP',format:'${me.formatRound2Decimal} meters'}}},'homogenewegvakken':{name:'Homogene wegvakken',title:'Homogene wegvakken Rijksweg ${WEG} tussen ${BEGINKM} en ${EINDKM} km',subtitle:'Info Homogene wegvakken',columns:{'OBJECTID':{name:'Kenmerk van het wegvak'},'AR':{name:'Administratieve richting (links of rechts of # (indien anders))'},'HECTOLETT':{name:'Hectoletter'},'WEG':{name:'Wegnummer'},'INT_D_CAT1':{name:'Aantal motorrijwielen dag'},'INT_D_CAT2':{name:'Aantal lichte motorvoertuigen dag'},'INT_D_CAT3':{name:'Aantal middelzware motorvoertuigen dag'},'INT_D_CAT4':{name:'Aantal zware motorvoertuigen dag'},'INT_D_CAT5':{name:'Aantal elektrische motorvoertuigen dag'},'INT_D_CAT6':{name:'Aantal bussen dag'},'INT_A_CAT1':{name:'Aantal motorrijwielen avond'},'INT_A_CAT2':{name:'Aantal lichte motorvoertuigen avond'},'INT_A_CAT3':{name:'Aantal middelzware motorvoertuigen avond'},'INT_A_CAT4':{name:'Aantal zware motorvoertuigen avond'},'INT_A_CAT5':{name:'Aantal elektrische motorvoertuigen avond'},'INT_A_CAT6':{name:'Aantal bussen avond'},'INT_N_CAT1':{name:'Aantal motorrijwielen nacht'},'INT_N_CAT2':{name:'Aantal lichte motorvoertuigen nacht'},'INT_N_CAT3':{name:'Aantal middelzware motorvoertuigen nacht'},'INT_N_CAT4':{name:'Aantal zware motorvoertuigen nacht'},'INT_N_CAT5':{name:'Aantal elektrische motorvoertuigen nacht'},'INT_N_CAT6':{name:'Aantal bussen nacht'},'SPEED1':{name:'Snelheid akoestisch onderzoek motorrijwielen'},'SPEED2':{name:'Snelheid akoestisch onderzoek lichte motorvoertuigen'},'SPEED3':{name:'Snelheid akoestisch onderzoek middelzware motorvoertuigen'},'SPEED4':{name:'Snelheid akoestisch onderzoek zware motorvoertuigen'},'SPEED5':{name:'Snelheid akoestisch onderzoek elektrische motorvoertuigen'},'SPEED6':{name:'Snelheid akoestisch onderzoek bussen'},'RD_WIDTH':{name:'Maximale wegbreedte'},'RD_SURF':{name:'Type wegverharding',format:"formatRdSurf"},'KUNSTWERK':{name:'Type kunstwerk die eventueel aanwezig is'},'WVK_ID':{name:'Kenmerk van het wegvak'},'ADMRICHTNG':{name:'Administratieve richting (heen of terug)'},'BAANSUBSTR':{name:'Type rijbaan (hoofdrijbaan, nevenrijbaan, oprit, ed)'},'STT_NAAM':{name:'Straatnaam'},'GME_NAAM':{name:'Gemeentenaam'},'BEGINKM':{name:'Beginkilometrering'},'EINDKM':{name:'Eindkilometrering'},'SRC_HEIGHT':{name:'Bronhoogte wegverkeer'},'GRAD_COR':{name:'Hellingscorrectie'},'SHAPE_LEN':{name:'GIS lengte van het wegvak',format:"${me.formatRound1Decimal} meters"},'CPLAFOND':{name:'Plafondcorrectie'}}},'afschermendeobjecten':{name:'Afschermende objecten',title:'Afschermende object ${OBJECTID} / ${SCHERMTYPE}',subtitle:'Info Afschermende objecten',columns:{'OBJECTID':{name:'Kenmerkcode van het schermdeel'},'C_SCHERMID':{name:'Kenmerkcode van het scherm'},'PROF_COR':{name:'Profiel correctie',format:"${PROF_COR} dB"},'REFL_L_1':{name:'Reflectiefactor linkerzijde scherm voor 63 Hz octaafband (van beginpunt scherm kijkende naar eindpunt scherm)'},'REFL_L_2':{name:'Reflectiefactor linkerzijde scherm voor 125 Hz octaafband (van beginpunt scherm kijkende naar eindpunt scherm)'},'REFL_L_3':{name:'Reflectiefactor linkerzijde scherm voor 250 Hz octaafband (van beginpunt scherm kijkende naar eindpunt scherm)'},'REFL_L_4':{name:'Reflectiefactor linkerzijde scherm voor 500 Hz octaafband (van beginpunt scherm kijkende naar eindpunt scherm)'},'REFL_L_5':{name:'Reflectiefactor linkerzijde scherm voor 1K Hz octaafband (van beginpunt scherm kijkende naar eindpunt scherm)'},'REFL_L_6':{name:'Reflectiefactor linkerzijde scherm voor 2K Hz octaafband (van beginpunt scherm kijkende naar eindpunt scherm)'},'REFL_L_7':{name:'Reflectiefactor linkerzijde scherm voor 4K Hz octaafband (van beginpunt scherm kijkende naar eindpunt scherm)'},'REFL_L_8':{name:'Reflectiefactor linkerzijde scherm voor 8K Hz octaafband (van beginpunt scherm kijkende naar eindpunt scherm)'},'REFL_L_9':{name:'Reflectiefactor linkerzijde scherm voor 16K Hz octaafband (van beginpunt scherm kijkende naar eindpunt scherm)'},'REFL_R_1':{name:'Reflectiefactor rechterzijde scherm voor 63 Hz octaafband (van beginpunt scherm kijkende naar eindpunt scherm)'},'REFL_R_2':{name:'Reflectiefactor rechterzijde scherm voor 125 Hz octaafband (van beginpunt scherm kijkende naar eindpunt scherm)'},'REFL_R_3':{name:'Reflectiefactor rechterzijde scherm voor 250 Hz octaafband (van beginpunt scherm kijkende naar eindpunt scherm)'},'REFL_R_4':{name:'Reflectiefactor rechterzijde scherm voor 500 Hz octaafband (van beginpunt scherm kijkende naar eindpunt scherm)'},'REFL_R_5':{name:'Reflectiefactor rechterzijde scherm voor 1K Hz octaafband (van beginpunt scherm kijkende naar eindpunt scherm)'},'REFL_R_6':{name:'Reflectiefactor rechterzijde scherm voor 2K Hz octaafband (van beginpunt scherm kijkende naar eindpunt scherm)'},'REFL_R_7':{name:'Reflectiefactor rechterzijde scherm voor 4K Hz octaafband (van beginpunt scherm kijkende naar eindpunt scherm)'},'REFL_R_8':{name:'Reflectiefactor rechterzijde scherm voor 8K Hz octaafband (van beginpunt scherm kijkende naar eindpunt scherm)'},'REFL_R_9':{name:'Reflectiefactor rechterzijde scherm voor 16K Hz octaafband (van beginpunt scherm kijkende naar eindpunt scherm)'},'SCHERMTYPE':{name:'Scherm, wal of combinatie',format:"formatSchermType"},'SOORT':{name:'Indien van toepassing scherp of stomp'},'OMSCHR':{name:'Omschrijving'},'SHAPE_LEN':{name:'Gislengte van het afschermende object',format:"${me.formatRound1Decimal} meters"}}}},schermTypeDescription:{1:"1=Doorzichtig geluidscherm",2:"2=Geluidswal",3:"3=Geluidswal met daarop of -in een scherm",4:"4=Geluidswand",5:"5=Geluidswand met luifelconstructie",6:"6=Niet doorzichtig geluidscherm"},rdSurfDescription:{1:"1=dicht asfaltbeton (dab)",2:"2=niet-elementenverharding met grove oppervlaktetextuur (Grof)",3:"3=klinkers",4:"4=MUG-ZOAB (Zoab85)",5:"5=(ZOAB 90)",6:"6=fijn gebezemd beton (GebBet)",7:"7=beton met opp. beh. 2/4 (Bet+Opp)",8:"8=uitgewassen beton (GewBet)",9:"9=ZOAB 6/16",10:"10=ZOAB 4/8 - 11/16 (Dzoab)",11:"11=SMA 0/6, (SMA 0/6)",12:"12=asfalt met opp.beh. 4/8 (Asf+Opp)",13:"13=ZOAB",14:"14=tweelaags ZOAB (2ZOAB)",15:"15=tweelaags ZOAB, fijn (2ZOAB-f)",16:"16=SMA 0/6",17:"17=uitgeborsteld beton (UitBet)",18:"18=geoptimaliseerd uitgeborsteld beton (OptBet)",19:"19=fijngebezemd beton (GebBet-f)",20:"20=oppervlakbewerking (Opp)",21:"21=gewone elementenverharding (GewElm)",22:"22=stille elementenverharding (StilElm)",23:"23=dunne deklagen 1 (DunDek1)",24:"24=dunne deklagen 2 (DunDek2)"},initialize:function(map,bLoadProjects,options){Geotool.Component.WMSBase.prototype.initialize.apply(this,arguments);this.categoryControl=new Geotool.Control.CategoryControl("categorygeluidsregisterform","categorygeluidsregisterinput","categorygeluidsregister");this.categoryControl.setPolicy('toggle');if(map){map.addControl(this.categoryControl);}
this.categoryControl.setCategory('1,2,3',true);this.wmsLayer=null;this.layerLookup={1:"homogenewegvakken",2:"afschermendeobjecten",3:"referentiepunten"};this.categoryByLayer={};for(var aCat in this.layerLookup){if(typeof(this.layerLookup[aCat])=='string'){this.categoryByLayer[this.layerLookup[aCat]]=aCat;}}
this.downloadControl=new Geotool.Control.InfoPanel('downloadbtndiv',{div:document.getElementById('downloaddiv'),contentUrl:'components/geluidsregister/download.php'});},activate:function(){Geotool.Component.WMSBase.prototype.activate.apply(this,arguments);setTimeout(OpenLayers.Function.bind(this.makeLayer,this),10);if(!this.map.getControl(this.downloadControl.id)){this.map.addControl(this.downloadControl);}
this.downloadControl.activate();},deactivate:function()
{this.downloadControl.deactivate();this.map.removeControl(this.downloadControl);Geotool.Component.WMSBase.prototype.deactivate.apply(this,arguments)},makeLayer:function()
{if(!this.wmsLayer){this.wmsLayer=new OpenLayers.Layer.WMS('geluidsregister','wms.php/rwsnl/geluidsregister',{layers:this.initialLayers,'format':'image/png',transparent:true},{'buffer':0,isBaseLayer:false,'projection':'EPSG:28992','units':'m',singleTile:true,alpha:true});this.wmsLayer.setVisibility(true);this.groupLayer.addLayer(this.wmsLayer)
if(this.map){this.map.activeLayer=this.wmsLayer;}
this.groupLayer.setLayerIndex(this.highlightVectorLayer,100);}
this.map.activeLayer=this.wmsLayer;return this.wmsLayer;},featureInfoStart:function(evt)
{this.removePopupAndFeature();},onPopupClose:function(event){this.removePopupAndFeature();},removePopupAndFeature:function(){if(this.popup){map.removePopup(this.popup)};this.control.destroyFeature(true);},doBeforeFeatureAdded:function(evt){var result=Geotool.Component.WMSBase.prototype.doBeforeFeatureAdded.apply(this,arguments);if(!result){return result;}
var feature=this.getPreferredFeature(evt.featurelist[0].features);var attrs=feature.attributes;var categorie=this.categoryByLayer[feature['type']];var viewSpec=this.viewSpecByType[feature['type']];var htmlFormattedAttrs=this.getHtmlFormattedAttributes(viewSpec,attrs);var html='<div class="geluidsregister geluidsregister_'+categorie+'">'
+'<table class="olPopupTable" cellspacing="0">'
+'<tr><td class="popinleftbar">&nbsp;</td>'
+'<td class="title">&nbsp;</td><td class="title">'
+OpenLayers.String.format(viewSpec.title,htmlFormattedAttrs)+'</td></tr>'
+'<tr><td>&nbsp;</td><td class="subtitle">&nbsp;</td><td class="subtitle">'
+OpenLayers.String.format(viewSpec.subtitle,htmlFormattedAttrs)+'</td></tr>';evt.feature.data['miniPopupContentHTML']=html+"</table></div>";html+=this.formatMarkerDescription(viewSpec,htmlFormattedAttrs)
+"</table></div>";evt.feature.data['popupContentHTML']=html;evt.feature.data.popupClass='geluidsregister geluidsregister_'+categorie+' olPopup';return true;},getPreferredFeature:function(features)
{var feature=features[0];var featureByType={};for(var fi=features.length-1;fi>=0;fi--){featureByType[features[fi].type]=features[fi];}
if(featureByType["referentiepunten"]){feature=featureByType["referentiepunten"];}else if(featureByType["afschermendeobjecten"]){feature=featureByType["afschermendeobjecten"];}
return feature;},getHtmlFormattedAttributes:function(viewSpec,attrs)
{var htmlFormattedAttrs={};attrs.me=this;for(var colName in viewSpec.columns){if(typeof(colName)=='string'){var colSpec=viewSpec.columns[colName];var value='';if(attrs[colName]!=undefined){value=attrs[colName];if(typeof(colSpec.format)=="function"){value=colSpec.format(value);}else if(typeof(colSpec.format)=="string"){if(typeof(this[colSpec.format])=="function"){value=this[colSpec.format](value);}else{value=OpenLayers.String.format(colSpec.format,attrs,[value]);}}}
if(!colSpec.type||colSpec.type!='html'){value=this.xmlencode(value);}
htmlFormattedAttrs[colName]=value;}}
delete attrs.me;return htmlFormattedAttrs;},formatMarkerDescription:function(viewSpec,htmlFormattedAttrs)
{var iseven=true;var description="<tr><td colspan='3'>"
+"<table class='geluidsregisterTable' cellspacing='0'>";for(var colName in viewSpec.columns){if(typeof(colName)=='string'){var colSpec=viewSpec.columns[colName];var value='';if(htmlFormattedAttrs[colName]!=undefined){value=htmlFormattedAttrs[colName];}
description+="<tr class='"+(iseven?'roweven':'rowodd')+"'>"
+"<td>"+this.xmlencode(colSpec.name)+"</td>"
+"<td>"+value+"</td>"
+"</tr>";iseven=!iseven;}}
description+="</table></td></tr>";return description;},formatDocUri:function(relativeURI)
{relativeURI=relativeURI.replace(/\\/g,'/');relativeURI=relativeURI.replace(/\/[\/]*/g,'/');var pos=relativeURI.lastIndexOf('/');var docName=relativeURI;if(pos>=0){docName=relativeURI.substr(pos+1);}
var url=download_baseurl+"/"+this.projecttype+"/"+relativeURI;return"<a href='"+this.xmlencode(url)+"' target='_blank' "
+"title='Document "+this.xmlencode(docName)+". Link opent in nieuw venster.' "
+"alt='Document "+this.xmlencode(docName)+". Link opent in nieuw venster.'>"+this.xmlencode(docName)+"</a>";},formatSchermType:function(schermTypeId)
{if(this.schermTypeDescription[schermTypeId]){return this.schermTypeDescription[schermTypeId];}
return schermTypeId;},formatRdSurf:function(rdSurfId)
{if(this.rdSurfDescription[rdSurfId]){return this.rdSurfDescription[rdSurfId];}
return rdSurfId;},formatRound1Decimal:function(realNum)
{var num=new Number(realNum);var roundedNum=num.toFixed(1)
return(roundedNum=="NaN"?xmlencode(realNum):roundedNum);},formatRound2Decimal:function(realNum)
{var num=new Number(realNum);var roundedNum=num.toFixed(2)
return(roundedNum=="NaN"?xmlencode(realNum):roundedNum);},xmlencode:function(string)
{return string.replace(/\&/g,'&'+'amp;').replace(/</g,'&'+'lt;').replace(/>/g,'&'+'gt;').replace(/\'/g,'&'+'apos;').replace(/\"/g,'&'+'quot;');},categoryChanged:function(categoryEvent)
{this.removePopupAndFeature();layers="";for(var i=0;i<categoryEvent.allCategories.length;i++){if(i==0){layers=this.layerLookup[categoryEvent.allCategories[i]];}
else{layers=layers+","+this.layerLookup[categoryEvent.allCategories[i]];}}
if(!this.wmsLayer){this.initialLayers=layers;}else{if(layers.length==0){this.wmsLayer.setVisibility(false);}
else{this.wmsLayer.setVisibility(true);}
this.wmsLayer.mergeNewParams({"LAYERS":layers});}},CLASS_NAME:"Geotool.Component.Geluidsregister"});Geotool.componentClasses.push(Geotool.Component.Geluidsregister);Geotool.Component.Wegbeheerders=OpenLayers.Class(Geotool.Component.WMSBase,{projecttype:'wegbeheerders',title:'Wegbeheerders',layernameprefix:"wegbeheerders_",searcherTypes:"adres,hectometerpaal",wmsLayerName:'wegbeheerderinfo',wmsLayer:null,wegbeheerdernaam:{'R':"Rijkswaterstaat","P":"Provincie","W":"Waterschap","G":"Gemeente","T":"Overige"},initialize:function(map,options){Geotool.Component.WMSBase.prototype.initialize.apply(this,arguments);},activate:function(){Geotool.Component.WMSBase.prototype.activate.apply(this,arguments);if(!this.wmsLayer){this.makeLayer();}
this.selectWMSLayer();this.map.events.on({'zoomend':this.selectWMSLayer,scope:this});},deactivate:function(){Geotool.Component.WMSBase.prototype.deactivate.apply(this,arguments);this.map.events.un({'zoomend':this.selectWMSLayer,scope:this});},makeLayer:function(){this.wmsLayer=new OpenLayers.Layer.WMS('wegbeheerdersinfo','wms.php/rwsnl/wegbeheerders',{layers:this.wmsLayerName,'format':'image/gif',transparent:true},{'buffer':0,isBaseLayer:false,'projection':'EPSG:28992','units':'m',singleTile:true});this.wmsLayer_PR=new OpenLayers.Layer.WMS('wegbeheerdersinfo_PR','wms.php/rwsnl/wegbeheerders',{layers:this.wmsLayerName+"_PR",'format':'image/gif',transparent:true},{'buffer':0,isBaseLayer:false,'projection':'EPSG:28992','units':'m',singleTile:true});this.wmsLayer_R=new OpenLayers.Layer.WMS('wegbeheerdersinfo_R','wms.php/rwsnl/wegbeheerders',{layers:this.wmsLayerName+"_R",'format':'image/gif',transparent:true},{'buffer':0,isBaseLayer:false,'projection':'EPSG:28992','units':'m',singleTile:true});this.wmsLayer.setVisibility(false);this.wmsLayer_PR.setVisibility(false);this.wmsLayer_R.setVisibility(false);},selectWMSLayer:function(){var zoom=this.map.getZoom();var layer=this.wmsLayer;if(zoom<4){layer=this.wmsLayer_R;}else if(zoom<7){layer=this.wmsLayer_PR;}
layer.setMap(this.map);this.map.activeLayer=layer;},doBeforeFeatureAdded:function(evt){var result=Geotool.Component.WMSBase.prototype.doBeforeFeatureAdded.apply(this,arguments);if(!result){return result;}
var attrs=evt.featurelist[0].features[0].attributes;if(attrs.WEGBEHSRT!="R"&&this.map.getZoom()<3){return false;}
else if((attrs.WEGBEHSRT!="R"&&attrs.WEGBEHSRT!="P")&&this.map.getZoom()<6){return false;}
var streetName=attrs.STT_NAAM;streetName=streetName.replace(/ryksweg/i,"Rijksweg");streetName=streetName.replace(/rykswg/i,"Rijksweg");streetName=streetName.replace(/ryksw$/i,"Rijksweg");streetName=streetName.replace(/rijksweg/i,"Rijksweg");streetName=streetName.replace(/rijkswg/i,"Rijksweg");streetName=streetName.replace(/rijksw$/i,"Rijksweg");streetName=streetName.replace(/rijksw /i,"Rijksweg ");if((attrs.WEGBEHSRT=="R"||attrs.WEGBEHSRT=="P")&&attrs.ROUTENAAM){streetName=streetName.replace(/-?[an][0-9]+/i,"");streetName=attrs.ROUTENAAM+" "+streetName;}
var wegbeheerder=(attrs.NAAMLANG?attrs.NAAMLANG:attrs.BHRNAAM);var maxsnelheid=(attrs.MAXSNELHEID?attrs.MAXSNELHEID:"");var html="<div class='wegbeheerder wegbeheerder_"+attrs.WEGBEHSRT+"'>"
+"<div class='olPopupContentTitle'>"
+"<p class='wb_maxsnelheid'>"+maxsnelheid+"</p>"
+"<p class='title'>"+streetName+"</p>"
+"<p class='subtitle'>"+wegbeheerder+"</p></div>";evt.feature.data['miniPopupContentHTML']=html+"</div>";html+=this.formatMarkerDescription(attrs,streetName)
+"</div>";evt.feature.data['popupContentHTML']=html;evt.feature.data.popupClass='wegbeheerder wegbeheerder_'+attrs.WEGBEHSRT+' olPopup';return true;},formatMarkerDescription:function(attrs,streetName)
{var html="<div class='olPopupContentDescription'>";if(attrs.BEGINKM&&attrs.BEGINKM!="0"&&attrs.EINDKM!="0"){html+="<p>Hectometer: <span class='wb_tekst1'>"+(Math.round(attrs.BEGINKM*10)/10)
+" - "+(Math.round(attrs.EINDKM*10)/10);if(attrs.RPE_CODE){html+=" ("
+(attrs.RPE_CODE=="R"?"Re":(attrs.RPE_CODE=="L"?"Li":""))
+")";}
html+="</span></p>";}
if(attrs.TELNO1||(attrs.CONTACTPERSOON1&&attrs.CONTACTPERSOON1.indexOf("@")>0)||attrs.LINK1){html+="<p><span class='wb_tekst1'>Neem contact met ons op ...</span><br>"
+"voor al uw vragen, mededelingen of klachten.</p>";}
html+="<table border='0' cellpadding='0' cellspacing='0'>";if(attrs.TELNO1){html+="<tr><td>Bel:</td><td class='wb_tekst2'>"+attrs.TELNO1+"</td></tr>";}
if(attrs.CONTACTPERSOON1){if(attrs.CONTACTPERSOON1.indexOf("@")>0){html+="<tr><td>Mail:</td><td class='wb_tekst2'><a href='mailto:"+attrs.CONTACTPERSOON1+"'>"+attrs.CONTACTPERSOON1+"</a></td></tr>";}else{html+="<tr><td>Contactpersoon:</td><td class='wb_tekst2'>"+attrs.CONTACTPERSOON1+"</td></tr>";}}
if(attrs.LINK1){html+="<tr><td>Bekijk:</td><td class='wb_tekst2'><a target='_blank' href='"+attrs.LINK1+"'>"+attrs.LINK1+"</a></td></tr>";}
html+="</table>";if(attrs.DISKFOTO){var title='Foto omgeving van '+streetName+', '+attrs.GME_NAAM;title=title.replace(/<[bB][rR]\/?>/,'\n');title=title.replace(/<[^>]*>/,' ');title=title.replace(/"/,'&quot;');html+='<img class="kustwerkfoto" src="fotos/kunstwerken/'+attrs.DISKFOTO+'" border="0" title="'+title+'">';}
html+="</div>";return html;},CLASS_NAME:"Geotool.Component.Wegbeheerders"});Geotool.componentClasses.push(Geotool.Component.Wegbeheerders);Geotool.Feature.Vector=OpenLayers.Class(OpenLayers.Feature.Vector,{miniPopup:null,delayMiniPopupOpen:100,delayMiniPopupClose:500,timerId:null,initialize:function(geometry,attributes,style){this.popupClass=Geotool.Popup.Framed;OpenLayers.Feature.Vector.prototype.initialize.apply(this,arguments);this.lonlat=this.geometry.getBounds().getCenterLonLat();},destroy:function(){Geotool.Feature.prototype.destroy.apply(this,arguments);OpenLayers.Feature.Vector.prototype.destroy.apply(this,arguments);},createPopup:function(closeFunc){if(this.lonlat!=null){var id=this.id+"_popup";if(!this.popup){this.popup=new this.popupClass(id,this.lonlat,this.data.popupSize,this.data.popupContentHTML,null,!!closeFunc,closeFunc);if(this.popup.autoSize){this.popup.panMapIfOutOfView=true;this.popup.minSize=new OpenLayers.Size(200,71);this.popup.maxSize=new OpenLayers.Size(450,400);if(this.data.popupPreferredSize){this.popup.preferredSize=this.data.popupPreferredSize;}}
if(this.data.popupClass&&this.popup.div){this.popup.div.className=this.data.popupClass;}
if(this.data.popupContentURL){this.layer.events.triggerEvent("loadstart");this.popupLoadLayer=this.layer;OpenLayers.loadURL(this.data.popupContentURL,null,this,this.popupDataLoaded,this.popupDataLoadFailed);}
this.popup.events.on({"mousemove":moveMouse});}
if(this.data.overflow!=null){this.popup.contentDiv.style.overflow=this.data.overflow;}
this.popup.feature=this;}
return this.popup;},popupDataLoaded:function(request)
{try{if(this.layer&&this.layer.map){var controller=this.layer.map.getControl(Geotool.controllerName);controller.events.triggerEvent('popupdataloaded',{request:request,feature:this});}}catch(err){if(console&&console.log){console.log("Error in popupDataLoadFailed:"+err);}}
var layer=(this.layer?this.layer:this.popupLoadLayer);this.popupLoadLayer=null;if(layer){layer.events.triggerEvent("loadend");}},popupDataLoadFailed:function(request)
{try{if(this.layer&&this.layer.map){var controller=this.layer.map.getControl(Geotool.controllerName);controller.events.triggerEvent('popupdataloaded',{request:request,feature:this,failed:true});}}catch(err){if(console&&console.log){console.log("Error in popupDataLoadFailed:"+err);}}
var layer=(this.layer?this.layer:this.popupLoadLayer);this.popupLoadLayer=null;if(layer){layer.events.triggerEvent("loadend");}},createMiniPopup:function(closeBox){if(this.lonlat!=null){var id=this.id+"_minipopup";var anchor=this.anchor;if(!this.miniPopup){this.miniPopup=new this.popupClass(id,this.lonlat,this.data.miniPopupSize,this.data.miniPopupContentHTML||" ",null,closeBox,null,true);if(this.miniPopup.autoSize){this.miniPopup.minSize=new OpenLayers.Size(200,67);this.miniPopup.maxSize=new OpenLayers.Size(320,150);if(this.data.popupPreferredSize){this.miniPopup.preferredSize=this.data.popupPreferredSize;}
this.miniPopup.div.className="olPopupMini";this.miniPopup.displayClass="olPopupMini";}else{this.miniPopup.div.className="olPopupMiniFixed";this.miniPopup.displayClass="olPopupMiniFixed";}}
if(this.data.overflow!=null){this.miniPopup.contentDiv.style.overflow=this.data.overflow;}
this.miniPopup.feature=this;}
return this.miniPopup;},destroyMiniPopup:function(){if(this.miniPopup){if(this.miniPopup.clickmeDiv){OpenLayers.Event.stopObserving(this.miniPopup.clickmeDiv,"click",this.markerClickBoundToThis);this.miniPopup.clickmeDiv=null;}
this.miniPopup.feature=null;this.miniPopup.destroy();this.miniPopup=null;}},openMiniPopupDelayed:function(evt){this.clearTimer();this.timerId=window.setTimeout(OpenLayers.Function.bind(this.openMiniPopup,this),this.delayMiniPopupOpen);if(evt){OpenLayers.Event.stop(evt);}},openMiniPopup:function(evt){if(!this.popup||!this.popup.map){if(!this.miniPopup){var popup=this.createMiniPopup();if(popup){popup.events.on({"mousemove":moveMouse});popup.events.on({"click":hideBox});if(this.layer.onPopupMousemove){popup.events.on({"mousemove":this.layer.onPopupMousemove,scope:this});}
if(this.layer.onPopupMouseout){popup.events.on({"mouseout":this.layer.onPopupMouseout,scope:this});}
if(this.control&&this.control.onPopupMousemove){popup.events.un({"mousemove":popup.onmousemove,scope:popup});popup.events.on({"mousemove":this.control.onPopupMousemove,scope:this.control});}
if(this.popupOpenFunc){popup.events.un({"click":popup.onclick,scope:popup});popup.events.on({"click":this.popupOpenFunc,scope:this});}
popup.events.on({"mouseover":this.popupMouseover,scope:this});popup.events.on({"mouseout":this.popupMouseout,scope:this});popup.div.title="body=[ Klik voor details ] cssbody=[hdrtooltip] header= cssheader=[none]";}}
if(this.miniPopup&&!this.miniPopup.map){this.layer.map.addPopup(this.miniPopup);this.removeLinksFromTabOrder(this.miniPopup);}}
if(evt){OpenLayers.Event.stop(evt);}},closeMiniPopupDelayed:function(evt){this.clearTimer();this.timerId=window.setTimeout(OpenLayers.Function.bind(this.closeMiniPopup,this),this.delayMiniPopupClose);if(evt){OpenLayers.Event.stop(evt);}},closeMiniPopup:function(evt){if(this.miniPopup&&this.miniPopup.map){if(this.layer.removePopupHighlightFeatures){if(!this.layer.map||!this.layer.map.selectedFeature){this.layer.removePopupHighlightFeatures();}}
this.layer.map.removePopup(this.miniPopup);this.destroyMiniPopup();}
if(evt){OpenLayers.Event.stop(evt);}},popupMouseover:function(){this.clearTimer();this.mouseOverPopup=true;},popupMouseout:function(){this.mouseOverPopup=false;this.closeMiniPopupDelayed();},clearTimer:function(){if(this.timerId!=null){window.clearTimeout(this.timerId);this.timerId=null;}},removeLinksFromTabOrder:function(popup)
{var links=popup.div.getElementsByTagName("A");for(var li=0;links&&li<links.length;li++){var linkElem=links[li];linkElem.tabIndex=-1;}},CLASS_NAME:"Geotool.Feature.Vector"});Geotool.Layer.JSON=OpenLayers.Class(Geotool.Layer.Markers,{location:null,features:null,endHinderPeriod:null,EVENT_TYPES:['beforefeatureadded'],initialize:function(name,options){this.EVENT_TYPES=Geotool.Layer.JSON.prototype.EVENT_TYPES.concat(this.EVENT_TYPES);Geotool.Layer.Markers.prototype.initialize.apply(this,arguments);this.jsonParser=new OpenLayers.Format.JSON();this.reload();},reload:function(clearFeatures){if(this.location!=null){var onFail=function(e){this.events.triggerEvent("loadend");};this.events.triggerEvent("loadstart");if(clearFeatures==true){OpenLayers.loadURL(this.location,null,this,this.parseDataClearFeatures,onFail);}else{OpenLayers.loadURL(this.location,null,this,this.parseData,onFail);}}},destroy:function(){Geotool.Layer.Markers.prototype.destroy.apply(this,arguments);},parseDataClearFeatures:function(ajaxRequest){this.clearMarkers();this.clearFeatures();this.parseData(ajaxRequest);},parseData:function(ajaxRequest){var text=ajaxRequest.responseText;var obj=this.jsonParser.read(text);var rows=obj.features;var newFeatures=[];if(rows&&rows.length){for(var ci=0;ci<rows.length;ci++){var data=rows[ci];var feature=this.makeFeature(data);if(feature!=null){var marker=this.makeMarker(feature,data);}
newFeatures.push(feature);}}
if(obj.endhinderperiod){this.endHinderPeriod=obj.endhinderperiod;}
this.addFeatures(newFeatures);this.events.triggerEvent("loadend");},makeFeature:function(data){var location=new OpenLayers.LonLat(0,0);var title=null;if(data.location){location.lat=data.location.lat;location.lon=data.location.lon;data.location=null;if(typeof data.icon!='undefined'&&typeof data.icon.title!='undefined'){title=data.icon.title;}
data.icon=this.makeIcon(data.icon);if((data.title!=null)&&(data.description!=null)){data['popupContentHTML']="<div class='olPopupContentTitle'>"+data.title+"</div>"+"<div class='olPopupContentDescription'>"+data.description+"</div>";if(title!=null&&!data.miniPopupContentHTML){data.miniPopupContentHTML="<div class='olPopupContentTitle'>"+title+"</div>";}}
data.overflow=data.overflow||"auto";var feature=new Geotool.Feature(this,location,data);var result=this.events.triggerEvent('beforefeatureadded',{feature:feature});if(typeof result=="undefined"||result===true){return feature;}}
return null;},makeIcon:function(iconData)
{var icon=null;var url;var iconSize;var iconOffset=null;if(typeof iconData!='undefined'){url=iconData.url||null;iconSize=new OpenLayers.Size(iconData.width,iconData.height);if(typeof iconData.offset!='undefined'){iconOffset=new OpenLayers.Pixel(iconData.offset.x,iconData.offset.y);}
icon=new OpenLayers.Icon(url,iconSize,iconOffset);icon.imageDiv.className='olIcon';if(typeof iconData.contentHtml!='undefined'){icon.contentHtml=iconData.contentHtml;}}else{icon=OpenLayers.Marker.defaultIcon();if(iconSize!=null){icon.setSize(iconSize);}}
return icon;},makeMarker:function(feature,data){var marker=feature.createMarker();if(feature.data.popupContentHTML){marker.events.register('click',feature,feature.markerClick);marker.events.register('mousemove',feature,feature.openMiniPopupDelayed);marker.events.register('mouseout',feature,feature.closeMiniPopupDelayed);}
return marker;},markerMouseout:function(evt){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,null,this.imageDiv.firstChild.src.replace(/set01/,"set02"),"absolute");OpenLayers.Event.stop(evt);},markerMousemove:function(evt){var oldSrc=this.imageDiv.firstChild.src;var newSrc=oldSrc.replace(/set02/,"set01");if(oldSrc!=newSrc){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,null,newSrc,"absolute");}
OpenLayers.Event.stop(evt);},CLASS_NAME:"Geotool.Layer.JSON"});Geotool.Layer.CategorizedJSON=OpenLayers.Class(Geotool.Layer.JSON,Geotool.Layer.Group,{categories:null,strategiesByCat:null,initialize:function(name,options){Geotool.Layer.JSON.prototype.initialize.apply(this,arguments);Geotool.Layer.Group.prototype.initialize.apply(this,arguments);if(this.categories!=null){for(idx=0;idx<this.categories.length;idx++){this.getOrMakeCategoryLayer(this.categories[idx]);}}
this.events.on({"beforefeaturesadded":this.passFeaturesToLayers,scope:this});},destroy:function(){this.events.un({"beforefeaturesadded":this.passFeaturesToLayers,scope:this});Geotool.Layer.Group.prototype.destroy.apply(this,arguments);Geotool.Layer.JSON.prototype.destroy.apply(this,arguments);},setMap:function(map){Geotool.Layer.Group.prototype.setMap.apply(this,arguments);Geotool.Layer.JSON.prototype.setMap.apply(this,arguments);},removeMap:function(map){Geotool.Layer.Group.prototype.removeMap.apply(this,arguments);Geotool.Layer.JSON.prototype.removeMap.apply(this,arguments);},makeMarker:function(feature,data){var marker=Geotool.Layer.JSON.prototype.makeMarker.apply(this,arguments);marker.category=data.category;if(typeof data.ids!='undefined'){marker.ids=data.ids;}
return marker;},passFeaturesToLayers:function(event){var propagate=true;var features=event.features;var featuresByCat={};for(var i=0;i<features.length;i++){var feature=features[i];var cat=feature.data.category;if(!featuresByCat[cat]){featuresByCat[cat]=[];}
featuresByCat[cat].push(feature);}
for(var cat in featuresByCat){var layer=this.getOrMakeCategoryLayer(cat);var ret=layer.addFeatures(featuresByCat[cat]);if(ret===false){propagate=false;}}
return propagate;},addMarker:function(marker){var layer=this.getOrMakeCategoryLayer(marker.category);layer.addMarker(marker);},getOrMakeCategoryLayer:function(category){var layer=this.getCategoryLayer(category);if(layer==null){var options={category:category};if(this.strategiesByCat&&this.strategiesByCat[category]){options.strategies=this.strategiesByCat[category];}
layer=new Geotool.Layer.Markers("Marker category "+category,options);this.addLayer(layer);}
return layer;},getCategoryLayer:function(category){if(this.layers!=null){for(idx=0,len=this.layers.length;idx<len;idx++){if(typeof this.layers[idx].category!='undefined'&&this.layers[idx].category==category){return this.layers[idx];}}}
return null;},setCategoryVisibility:function(category,visibility,noEvent){var layer=this.getCategoryLayer(category);if(layer!=null){layer.setVisibility(visibility,noEvent);}},getMarkerById:function(id){if(this.layers!=null){for(idx=this.layers.length-1;idx>=0;idx--){if(typeof this.layers[idx].markers!='undefined'){var markers=this.layers[idx].markers;for(j=0;j<markers.length;j++){if(typeof markers[j].ids!='undefined'){var ids=markers[j].ids;if(id==ids){return markers[j];}
for(mi=0;mi<(ids.length?ids.length:0);mi++){if(id==ids[mi]){return markers[j];}}}}}}}
return null;},clearMarkers:function(){if(this.layers!=null){for(idx=this.layers.length-1;idx>=0;idx--){if(typeof this.layers[idx].markers!='undefined'){this.layers[idx].clearMarkers();}}}},CLASS_NAME:"Geotool.Layer.CategorizedJSON"});Geotool.Component.RWSAdressen=OpenLayers.Class(Geotool.Component.MarkerBase,{layernameprefix:"autoww_",projecttype:'rwsadressen',searcherTypes:"adres",groupLayer:null,title:"Rijkswaterstaatlocaties",initialize:function(map,options){Geotool.Component.MarkerBase.prototype.initialize.apply(this,arguments);this.groupLayer=new Geotool.Layer.Group("rwsadressen");},makeLayer:function()
{var categories=[6];var iconsByScale=[{icon:new OpenLayers.Icon('components/rwsadressen/icons/locatie_icon_small.png',new OpenLayers.Size(29,23),new OpenLayers.Pixel(-12,-22)),maxscale:20000000,minscale:750000,contentHtmlClassName:"olIcon"},{icon:new OpenLayers.Icon('components/rwsadressen/icons/locatie_icon.png',new OpenLayers.Size(54,66),new OpenLayers.Pixel(-26,-62)),maxscale:750000,minscale:1,contentHtmlClassName:"olIcon"}];var stategiesByCat={};stategiesByCat[6]=[new Geotool.Strategy.Marker.IconSwitcher(iconsByScale)];var options={displayInLayerSwitcher:false,categories:categories,strategies:[new Geotool.Strategy.Marker.Fixed(this.getLocation())],strategiesByCat:stategiesByCat};var layer=new Geotool.Layer.CategorizedJSON(this.title,options);layer.events.on({'beforefeatureadded':this.doBeforeFeatureAdded,scope:this});layer.hasLegend=false;layer.location=null;return layer;},doBeforeFeatureAdded:function(evt){if(!evt.feature||!evt.feature.data){return false;}
evt.feature.data.popupClass='rwsadressen olPopup';evt.feature.data['popupContentHTML']=evt.feature.data.description;},CLASS_NAME:"Geotool.Component.RWSAdressen"});Geotool.componentClasses.push(Geotool.Component.RWSAdressen);Geotool.Component.WaterLayers=OpenLayers.Class(Geotool.Component.MarkerBase,{componentName:null,projecttype:null,categories:[],parameters:[],layernameprefix:"waterkaart_",searcherTypes:"adres,awdmeetpunt,vaarweg",groupLayer:null,title:null,refreshInterval:300000,iconHtmlSmall:["olIconHtmlSmall","olIconHtmlSmall","olIconHtmlSmall","olIconHtmlSmall","olIconHtmlSmall","olIconHtmlSmall","olIconHtmlSmall","olIconHtmlSmall"],iconHtml:["olIconHtml","olIconHtml","olIconHtml","olIconHtml","olIconHtml","olIconHtml","olIconHtml","olIconHtml"],iconScale:[1,1,1,1,1,1,1,1],initialize:function(map,options)
{Geotool.Component.MarkerBase.prototype.initialize.apply(this,arguments);this.groupLayer=new Geotool.Layer.Group(this.projecttype);},activate:function()
{Geotool.Component.MarkerBase.prototype.activate.apply(this,arguments);if(this.controller&&this.controller.events){this.controller.events.on({'popupdataloaded':this.doPopupDataLoaded,scope:this});}},deactivate:function()
{if(this.controller&&this.controller.events){this.controller.events.un({'popupdataloaded':this.doPopupDataLoaded,scope:this});}
Geotool.Component.MarkerBase.prototype.deactivate.apply(this,arguments);},makeLayer:function()
{var strategiesByCat={};for(var ci=0;ci<this.categories.length;ci++){if(this.iconScale[ci]==1){var iconsByScale=[{icon:new OpenLayers.Icon('components/'+this.projecttype+'/icons/'+this.projecttype+'_0'+this.categories[ci]+'_icon_small.png',new OpenLayers.Size(29,23),new OpenLayers.Pixel(-15,-22)),maxscale:20000000,minscale:750000,contentHtmlClassName:this.iconHtmlSmall[ci]},{icon:new OpenLayers.Icon('components/'+this.projecttype+'/icons/'+this.projecttype+'_0'+this.categories[ci]+'_icon.png',new OpenLayers.Size(51,65),new OpenLayers.Pixel(-26,-64)),maxscale:750000,minscale:1,contentHtmlClassName:this.iconHtml[ci]},];}
else if(this.iconScale[ci]==1.5){var iconsByScale=[{icon:new OpenLayers.Icon('components/'+this.projecttype+'/icons/'+this.projecttype+'_0'+this.categories[ci]+'_icon_smallXL.png',new OpenLayers.Size(44,23),new OpenLayers.Pixel(-22,-22)),maxscale:20000000,minscale:750000,contentHtmlClassName:this.iconHtmlSmall[ci]},{icon:new OpenLayers.Icon('components/'+this.projecttype+'/icons/'+this.projecttype+'_0'+this.categories[ci]+'_iconXL.png',new OpenLayers.Size(75,65),new OpenLayers.Pixel(-39,-64)),maxscale:750000,minscale:1,contentHtmlClassName:'olIconHtml'},];}
else{var iconsByScale=[{icon:new OpenLayers.Icon('components/'+this.projecttype+'/icons/'+this.projecttype+'_0'+this.categories[ci]+'_icon_small.png',new OpenLayers.Size(29,23),new OpenLayers.Pixel(-15,-22)),maxscale:20000000,minscale:750000,contentHtmlClassName:this.iconHtmlSmall[ci]},{icon:new OpenLayers.Icon('components/'+this.projecttype+'/icons/'+this.projecttype+'_0'+this.categories[ci]+'_icon.png',new OpenLayers.Size(51,65),new OpenLayers.Pixel(-26,-64)),maxscale:750000,minscale:1,contentHtmlClassName:this.iconHtml[ci]},];}
strategiesByCat[''+this.categories[ci]]=[new Geotool.Strategy.Marker.IconSwitcher(iconsByScale)];}
var options={displayInLayerSwitcher:false,categories:this.categories,strategies:[new Geotool.Strategy.Marker.Periodic(this.getLocation(),{interval:this.refreshInterval})],strategiesByCat:strategiesByCat};var layer=new Geotool.Layer.CategorizedJSON(this.title,options);layer.events.on({'beforefeatureadded':this.doBeforeFeatureAdded,scope:this});layer.hasLegend=false;layer.location=null;layer.defaultLegendValue=1;return layer;},doBeforeFeatureAdded:function(evt){if(!evt.feature||!evt.feature.data){return false;}
var data=evt.feature.data;var meettijd=Geotool.Calendar.formatAsTime(data.meettijd)+"&nbsp;uur";var meetdatum=Geotool.Calendar.formatAsLongDate(data.meettijd)+' '+meettijd;var waarde=(data.waarde==null?"---":(data.waarde>0?"+"+data.waarde:data.waarde));var subtitle=data.parameternaam+' '
+(data.waarde==null?"niet beschikbaar":waarde+' '+data.eenheid)
+' op '+meetdatum;var html='<div class="'+this.projecttype+' '+this.projecttype+'_'+evt.feature.data.category+'">'
+'<table class="olPopupTable" cellspacing="0">'
+'<tr><td class="popinleftbar" width="'+data.icon.size.w+'px" height="33px">'
+'<span class="'+this.iconHtml[evt.feature.data.category-1]+'">'+waarde+"</span>"
+'</td>'
+'<td class="title">&nbsp;</td><td class="title">'+data.locatienaam+'</td></tr>'
+'<tr><td class="popiniconsubscript">'+meettijd
+'</td><td class="subtitle">&nbsp;</td><td class="subtitle">'
+subtitle+'</td></tr>';evt.feature.data['miniPopupContentHTML']=html+"</table></div>";evt.feature.data['popupContentHTML']=html+"</table><div id='awdpopindescription' name='awdpopindescription'><div id='dummy' style='width: "+data.graphsize+"px; height: 250px;'></div></div></div>";evt.feature.data.icon.contentHtml=waarde+'<br>'
+'<div class="popiniconsubscript">'
+meettijd+'</div>';evt.feature.data['popupContentURL']="awd.php?mode=data&loc="+evt.feature.data.loc+"&net="+evt.feature.data.net+"&projecttype="+this.projecttype+"&category="+evt.feature.data.category;evt.feature.data.popupClass=this.projecttype+' '+this.projecttype+'_'+evt.feature.data.category+' olPopup';evt.feature.data.popupPreferredSize=new OpenLayers.Size(330,null);return true;},doPopupDataLoaded:function(evt){if(!evt.request||!evt.feature||!evt.feature.popup){return false;}
var html=null;if(evt.failed){html="<p>Het is niet gelukt de data op te halen. Probeer het later nog eens.</p>";}else{html=this.parseData(evt.request.responseText,evt.feature);}
var contentHTML=evt.feature.popup.contentHTML;var toggletablegraphDiv=OpenLayers.Util.createDiv();toggletablegraphDiv.className="toggletablegraph";toggletablegraphDiv.innerHTML='<a href="#" id="toggletablegraphlinkbutton">Tabel'+'<img id="'+this.projecttype+'tablegrafiekicon" style="cursor:auto; border: 0px none;" '+'onmouseover="this.style.cursor=\'pointer\'" src="components/'+this.projecttype+'/icons/tabel.gif"></a>';var linkElement=toggletablegraphDiv.getElementsByTagName('a')[0];linkElement.onclick=OpenLayers.Function.bind(this.toggleTableGraph,this);evt.feature.popup.groupDiv.appendChild(toggletablegraphDiv);var searchStr1="name='awdpopindescription'>";var searchStr2="</div></div>";var pattern=new RegExp(searchStr1+".*"+searchStr2+"$");contentHTML=contentHTML.replace(pattern,searchStr1+html+searchStr2);evt.feature.popup.setContentHTML(contentHTML);return true;},parseData:function(responseText,feature){var format=new OpenLayers.Format.JSON();var doc=format.read(responseText);if(!doc){return"<p class='popindataerror'>Gegevens konden niet worden geladen. Probeer het later nog eens.</p>";}
var oCount=-1;var oObj=[];for(att in doc)
{oCount++;oObj[oCount]=doc[att];oObj[oCount].sort(function(a,b){return b.tijd-a.tijd});}
oObj.sort(function(a,b){return(b[0].parameternaam>a[0].parameternaam?-1:(b[0].parameternaam==a[0].parameternaam?0:1))});html='<div id="'+this.projecttype+'data" >'+'<div id="'+this.projecttype+'graph" ><img id="image" width="'+feature.data.graphsize+'" height="250px" src="awd.php?mode=grafiek&loc='+feature.data.loc+'&net='+feature.data.net+'&projecttype='+this.projecttype+'&category='+feature.data.category+'"/></div>'+'<div id="'+this.projecttype+'table" style="display:none">'+'<table cellspacing="0">'+'<thead>'+'<tr>';for(colCount=0;colCount<=oCount;colCount++)
{if(colCount==0){html+='<th class="rowlabel">&nbsp;</th>'+'<th colspan="2" class="rowlabel">'+oObj[colCount][0].parameternaam+'</th>';}else{html+='<th class="rowlabel">'+oObj[colCount][0].paramlabel+'</th>';}}
html+='</tr>'+'<tr>';for(colCount=0;colCount<=oCount;colCount++)
{if(colCount==0){html+='<th class="rowlabel">dag</th><th class="rowlabel">&nbsp;tijd&nbsp;</th>';}
html+='<th class="wsh2">'+feature.data.eenheid+'</th>';}
html+='</tr>';html+='</thead>';html+='<tbody id="'+this.projecttype+'.tbody1" '+'>';var finished=false;var i=0;var odd=true;var secondtbody=false;while(!finished)
{html+='<tr class="'+((odd==true)?'rowoddawd':'rowevenawd')+'">';odd=!odd;for(colCount=0;colCount<=oCount;colCount++)
{if(oObj[colCount][i]){if(colCount==0){html+='<td>'+oObj[colCount][i].datumdag+'</td><td>'+oObj[colCount][i].datumtijd+'</td>';}
html+='<td>'+this.formatWaarde(oObj[colCount][i].waarde)+'</td>';}}
i++;html+='</tr>';if(i>=oObj[oCount].length)
{finished=true;}}
html+='</tbody>';html+='</table>'+'</div>'+'</div>';return html;},formatWaarde:function(value){if(!value||value=='null')
{return'geen data';}
else
{return value;}},toggleTableGraph:function(){var button=document.getElementById("toggletablegraphlinkbutton");if(button.innerHTML.indexOf("Tabel")>=0)
{button.innerHTML=button.innerHTML.replace("Tabel","Grafiek");document.getElementById(this.projecttype+'tablegrafiekicon').src='components/'+this.projecttype+'/icons/grafiek.gif';document.getElementById(this.projecttype+'graph').style.display="none";document.getElementById(this.projecttype+'table').style.display="block";}
else
{button.innerHTML=button.innerHTML.replace("Grafiek","Tabel");document.getElementById(this.projecttype+'tablegrafiekicon').src='components/'+this.projecttype+'/icons/tabel.gif';document.getElementById(this.projecttype+'graph').style.display="block";document.getElementById(this.projecttype+'table').style.display="none";}
if(this.map&&this.map.selectedFeature){var popup=this.map.selectedFeature.popup;if(popup&&popup.contentDiv){var currentOverflow=OpenLayers.Element.getStyle(popup.contentDiv,"overflow");if(currentOverflow==null){currentOverflow="auto";}
if(currentOverflow!="hidden"){popup.contentDiv.style.overflow="hidden";window.setTimeout(function(){popup.contentDiv.style.overflow=currentOverflow;},10);}}}
return false;},CLASS_NAME:"Geotool.Component.WaterLayers"});Geotool.Layer.HighlightedCategorizedJSON=OpenLayers.Class(Geotool.Layer.CategorizedJSON,{highlightVectorLayer:null,wktParser:new OpenLayers.Format.WKT(),initialize:function(name,options){Geotool.Layer.CategorizedJSON.prototype.initialize.apply(this,arguments);},setMap:function(map){Geotool.Layer.CategorizedJSON.prototype.setMap.apply(this,arguments);this.controller=this.map.getControl(Geotool.controllerName);if(this.controller&&this.controller.events){this.controller.events.on({"closepopup":this.closePopup,scope:this});}},removeMap:function(map){Geotool.Layer.CategorizedJSON.prototype.removeMap.apply(this,arguments);if(this.controller&&this.controller.events){this.controller.events.un({"closepopup":this.closePopup,scope:this});this.controller=null;}},makeMarker:function(feature,data){var marker=Geotool.Layer.CategorizedJSON.prototype.makeMarker.apply(this,arguments);if(data.geometry)
{data.icon.highlightFeatures=this.wktParser.read(data.geometry);if(typeof data.icon.highlightFeatures=='undefined'){data.icon.highlightFeatures=null;}else if(!(data.icon.highlightFeatures instanceof Array)){data.icon.highlightFeatures=[data.icon.highlightFeatures];}else if(data.icon.highlightFeatures.length>0&&typeof data.icon.highlightFeatures[0]=='undefined'){data.icon.highlightFeatures=null;}
data.icon.highlightVectorLayer=this.highlightVectorLayer;marker.events.registerPriority('mousemove',feature,this.onPopupMousemove);marker.events.registerPriority('mouseout',feature,this.onPopupMouseout);}
return marker;},onPopupMouseout:function(evt){if(this.data&&this.data.icon&&this.data.icon.highlightFeatures)
{var layer=this.data.icon.highlightVectorLayer;if(!layer.map||!layer.map.selectedFeature||layer.map.selectedFeature!=this)
{if(!this.miniPopup||!this.miniPopup.map){layer.removeFeatures(this.data.icon.highlightFeatures);}}}},onPopupMousemove:function(evt){if(this.data&&this.data.icon&&this.data.icon.highlightFeatures&&this.data.icon.highlightFeatures.length&&this.data.icon.highlightFeatures.length>0)
{var layer=this.data.icon.highlightVectorLayer;if(!layer.map||!layer.map.selectedFeature)
{if(layer.getFeatureById(this.data.icon.highlightFeatures[0].id)==null){layer.addFeatures(this.data.icon.highlightFeatures);}}}},removePopupHighlightFeatures:function(){var map=(this.layer?this.layer.map:this.map);if(map){for(var i=0;i<map.popups.length;i++){var feature=map.popups[i].feature;var icon=(feature&&feature.data?feature.data.icon:null);if(icon&&icon.highlightFeatures){icon.highlightVectorLayer.removeFeatures(icon.highlightFeatures);}}}},closePopup:function(){this.removePopupHighlightFeatures();this.map.selectedFeature=null;},CLASS_NAME:"Geotool.Layer.HighlightedCategorizedJSON"});Geotool.Component.Afvoer_en_Stroomsnelheid=OpenLayers.Class(Geotool.Component.WaterLayers,{componentName:"Afvoer_en_Stroomsnelheid",projecttype:"afvoer_en_stroomsnelheid",categories:[1,2],title:"Afvoer en Stroomsnelheid",iconHtmlSmall:["olIconHtmlSmall","olIconHtmlSmall","olIconHtmlSmall"],iconHtml:["olIconHtmlXL","olIconHtml","olIconHtmlXL"],iconScale:[1.5,1,1.5],doPopupDataLoaded:function(evt){if(!evt.request||!evt.feature||!evt.feature.popup){return false;}
var html=null;if(evt.failed){html="<p>Het is niet gelukt de data op te halen. Probeer het later nog eens.</p>";}else{html=this.parseData(evt.request.responseText,evt.feature);}
var contentHTML=evt.feature.popup.contentHTML;var toggletablegraphDiv=OpenLayers.Util.createDiv();toggletablegraphDiv.className="toggletablegraph";toggletablegraphDiv.innerHTML='<a href="#" id="toggletablegraphlinkbutton">Tabel'+'<img id="'+this.projecttype+'tablegrafiekicon" style="cursor:auto; border: 0px none;" '+'onmouseover="this.style.cursor=\'pointer\'" src="components/'+this.projecttype+'/icons/tabel.gif"></a>';var linkElement=toggletablegraphDiv.getElementsByTagName('a')[0];linkElement.onclick=OpenLayers.Function.bind(this.toggleTableGraph,this);evt.feature.popup.groupDiv.appendChild(toggletablegraphDiv);var searchStr1="name='awdpopindescription'>";var searchStr2="</div></div>";var pattern=new RegExp(searchStr1+".*"+searchStr2+"$");contentHTML=contentHTML.replace(pattern,searchStr1+html+searchStr2);evt.feature.popup.setContentHTML(contentHTML);return true;},initialize:function(map,bLoadProjects,options)
{Geotool.Component.WaterLayers.prototype.initialize.apply(this,arguments);this.loadProjects=bLoadProjects;this.categoryControl=new Geotool.Control.CategoryControl("categoryafvoer_en_stroomsnelheidform","categoryafvoer_en_stroomsnelheidinput","categoryafvoer_en_stroomsnelheid");this.categoryControl.setPolicy('single');if(map){map.addControl(this.categoryControl);}},doBeforeFeatureAdded:function(evt){if(!evt.feature||!evt.feature.data){return false;}
var data=evt.feature.data;var meettijd=Geotool.Calendar.formatAsTime(data.meettijd)+"&nbsp;uur";var meetdatum=Geotool.Calendar.formatAsLongDate(data.meettijd)+' '+meettijd;var waarde=(data.waarde==null?"---":(data.waarde>0?"+"+data.waarde:data.waarde));var subtitle=data.parameternaam+' '
+(data.waarde==null?"niet beschikbaar":waarde+' '+data.eenheid)
+' op '+meetdatum;var html='<div class="'+this.projecttype+' '+this.projecttype+'_'+evt.feature.data.iconnr+'">'
+'<table class="olPopupTable" cellspacing="0">'
+'<tr><td class="popinleftbar" width="'+data.icon.size.w+'px" height="33px">'
+'<span class="'+this.iconHtml[evt.feature.data.category-1]+'">'+waarde+"</span>"
+'</td>'
+'<td class="title">&nbsp;</td><td class="title">'+data.locatienaam+'</td></tr>'
+'<tr><td class="popiniconsubscript">'+meettijd
+'</td><td class="subtitle">&nbsp;</td><td class="subtitle">'
+subtitle+'</td></tr>';evt.feature.data['miniPopupContentHTML']=html+"</table></div>";evt.feature.data['popupContentHTML']=html+"</table><div id='awdpopindescription' name='awdpopindescription'><div id='dummy' style='width: "+data.graphsize+"px; height: 250px;'></div></div></div>";evt.feature.data.icon.contentHtml=waarde+'<br>'
+'<div class="popiniconsubscript">'
+meettijd+'</div>';evt.feature.data['popupContentURL']="awd.php?mode=data&loc="+evt.feature.data.loc+"&net="+evt.feature.data.net+"&projecttype="+this.projecttype+"&category="+evt.feature.data.category;evt.feature.data.popupClass=this.projecttype+' '+this.projecttype+'_'+evt.feature.data.iconnr+' olPopup';evt.feature.data.popupPreferredSize=new OpenLayers.Size(330,null);return true;},parseData:function(responseText,feature){var format=new OpenLayers.Format.JSON();var doc=format.read(responseText);if(!doc){return"<p class='popindataerror'>Gegevens konden niet worden geladen. Probeer het later nog eens.</p>";}
var oCount=-1;var oObj=[];var oRow=[];for(att in doc)
{oCount++;oObj[oCount]=doc[att];oObj[oCount].sort(function(a,b){return b.tijd-a.tijd});oRow[oCount]=0;}
html='<div id="'+this.projecttype+'data" >'+'<div id="'+this.projecttype+'graph" ><img id="image" width="'+feature.data.graphsize+'" height="250px" src="awd.php?mode=grafiek&loc='+feature.data.loc+'&net='+feature.data.net+'&projecttype='+this.projecttype+'&category='+feature.data.category+'"/></div>'+'<div id="'+this.projecttype+'table" style="display:none">'+
(doc['Q10V']?'<a href="#" id="toggleVerwachting" onclick="Geotool.Component.'+this.componentName+'.prototype.toggleVerwachting(); return false;">Toon</a> Verwachtingen':'')+'<table cellspacing="0">'+'<thead>'+'<tr>';for(colCount=0;colCount<=oCount;colCount++)
{if(colCount==0){html+='<th class="rowlabel">&nbsp;</th>'+'<th colspan="2" class="rowlabel">'+oObj[colCount][0].parameternaam+'</th>';}else{html+='<th class="rowlabel">'+oObj[colCount][0].paramlabel+'</th>';}}
html+='</tr>'+'<tr>';for(colCount=0;colCount<=oCount;colCount++)
{if(colCount==0){html+='<th class="rowlabel">dag</th><th class="rowlabel">&nbsp;tijd&nbsp;</th>';}
html+='<th class="wsh2">'+feature.data.eenheid+'</th>';}
html+='</tr>';html+='</thead>';html+='<tbody id="'+this.projecttype+'.tbody1"';if(doc['Q10V']){html+='style="display:none"';}
html+='>';var finished=false;var odd=true;var secondtbody=false;while(!finished)
{activeColNr=0;for(colCount=0;colCount<=oCount;colCount++)
{if(oRow[colCount]<oObj[colCount].length){activeColNr=colCount;}}
for(colCount=0;colCount<=oCount;colCount++)
{if((oObj[colCount][oRow[colCount]])&&(oObj[activeColNr][oRow[activeColNr]])){if(oObj[activeColNr][oRow[activeColNr]].tijd<=oObj[colCount][oRow[colCount]].tijd){activeColNr=colCount;}}}
if(!secondtbody&&oCount>0){if(oObj[activeColNr][oRow[activeColNr]].tijd==oObj[0][oRow[0]].tijd){html+='</tbody>';html+='<tbody id="'+this.projecttype+'.tbody2">';html+='<tr class="'+((odd==true)?'roweven':'rowodd')+'">';secondtbody=true;}}
html+='<tr class="'+((odd==true)?'rowoddawd':'rowevenawd')+'">';odd=!odd;if(oObj[activeColNr][oRow[activeColNr]]){html+='<td>'+oObj[activeColNr][oRow[activeColNr]].datumdag+'</td><td>'+oObj[activeColNr][oRow[activeColNr]].datumtijd+'</td>';}
for(colCount=0;colCount<=oCount;colCount++)
{if((oObj[activeColNr][oRow[activeColNr]])&&(oObj[colCount][oRow[colCount]])){if(oObj[activeColNr][oRow[activeColNr]].tijd==oObj[colCount][oRow[colCount]].tijd){html+='<td>'+this.formatWaarde(oObj[colCount][oRow[colCount]].waarde)+'</td>';oRow[colCount]++;}
else{html+='<td> </td>';}}
else{html+='<td> </td>';}}
html+='</tr>';finished=true;for(colCount=0;colCount<=oCount;colCount++){if(oRow[colCount]<oObj[colCount].length){finished=false;}}}
html+='</tbody>';html+='</table>'+'</div>'+'</div>';return html;},toggleVerwachting:function(){var button=document.getElementById("toggleVerwachting");if(button.innerHTML=="Verberg")
{button.innerHTML="Toon";document.getElementById(this.projecttype+'.tbody1').style.display="none";}
else
{button.innerHTML="Verberg";document.getElementById(this.projecttype+'.tbody1').style.display="";}
return false;},CLASS_NAME:"Geotool.Component.Afvoer_en_Stroomsnelheid"});Geotool.componentClasses.push(Geotool.Component.Afvoer_en_Stroomsnelheid);Geotool.Component.AutoWW=OpenLayers.Class(Geotool.Component.MarkerBase,{highlightVectorLayer:null,layernameprefix:"autoww_",projecttype:'wegen',groupLayer:null,title:"Wegwerkzaamheden",searcherTypes:"adres,hectometerpaal",initialize:function(map,bLoadProjects,options){Geotool.Component.MarkerBase.prototype.initialize.apply(this,arguments);this.loadProjects=bLoadProjects;this.highlightVectorLayer=new OpenLayers.Layer.Vector("Weg Highlight layer");this.categoryControl=new Geotool.Control.CategoryControl("categorywegwerkform","categorywegwerkinput","categorywegwerk");this.categoryControl.setPolicy('priority');this.groupLayer=new Geotool.Layer.Group("WegwerkzaamhedenGroup");if(map){map.addControl(this.categoryControl);}
this.groupLayer.addLayer(this.highlightVectorLayer);var printing=Geotool.argParser.getParam("printing");if(printing&&printing=="map"){this.highlightVectorLayer.div.style.display="none";this.highlightVectorLayer.div.className="highlightvectorlayer";}},makeLayer:function()
{var categories=new Array(5,4,3,2,1);var stategiesByCat={};for(var ci=0;ci<categories.length;ci++){var iconsByScale=[{icon:new OpenLayers.Icon('components/wegwerk/icons/wegwerk_0'+categories[ci]+'_icon_small.png',new OpenLayers.Size(29,23),new OpenLayers.Pixel(-12,-22)),maxscale:20000000,minscale:750000,contentHtmlClassName:"olIcon"},{icon:new OpenLayers.Icon('components/wegwerk/icons/wegwerk_0'+categories[ci]+'_icon.png',new OpenLayers.Size(54,66),new OpenLayers.Pixel(-26,-62)),maxscale:750000,minscale:1,contentHtmlClassName:"olIcon"}];stategiesByCat[''+categories[ci]]=[new Geotool.Strategy.Marker.IconSwitcher(iconsByScale)];}
var options={displayInLayerSwitcher:false,categories:categories,highlightVectorLayer:this.highlightVectorLayer,strategies:[new Geotool.Strategy.Marker.Period(this.getLocation())],strategiesByCat:stategiesByCat};var layer=new Geotool.Layer.HighlightedCategorizedJSON(this.title,options);layer.events.on({'beforefeatureadded':this.doBeforeFeatureAdded,scope:this});layer.hasLegend=true;if(this.loadProjects){layer.defaultLegendValue=5;}else{layer.defaultLegendValue=4;}
layer.location=null;return layer;},doBeforeFeatureAdded:function(evt){if(!evt.feature||!evt.feature.data){return false;}
evt.feature.data.popupClass='wegwerk wegwerk_'+evt.feature.data.category+' olPopup';evt.feature.data['popupContentHTML']=evt.feature.data.description;},CLASS_NAME:"Geotool.Component.AutoWW"});Geotool.componentClasses.push(Geotool.Component.AutoWW);Geotool.Component.Chlorositeit=OpenLayers.Class(Geotool.Component.WaterLayers,{componentName:"Chlorositeit",projecttype:"chlorositeit",categories:[1,2],parameters:["CL10"],title:"Chlorositeit",iconHtml:["olIconHtmlXL"],iconScale:[1.5],CLASS_NAME:"Geotool.Component.Chlorositeit"});Geotool.componentClasses.push(Geotool.Component.Chlorositeit);Geotool.Component.GolfGegevens=OpenLayers.Class(Geotool.Component.WaterLayers,{componentName:"GolfGegevens",projecttype:"golfgegevens",categories:[1,2,3,4,5,6,7,8],parameters:["Hm0_B0","Hm0_B2","Hm0_B3","H1d3","Fp","Tm02","S0bh_B0","S0bh_B0"],title:"GolfGegevens",initialize:function(map,bLoadProjects,options)
{Geotool.Component.WaterLayers.prototype.initialize.apply(this,arguments);this.categoryControl=new Geotool.Control.CategoryControl("categorygolfgegevensform","categorygolfgegevensinput","categorygolfgegevens");this.categoryControl.setPolicy('single');if(map){map.addControl(this.categoryControl);}},CLASS_NAME:"Geotool.Component.GolfGegevens"});Geotool.componentClasses.push(Geotool.Component.GolfGegevens);Geotool.Component.Luchtgegevens=OpenLayers.Class(Geotool.Component.WaterLayers,{componentName:"Luchtgegevens",projecttype:"luchtgegevens",categories:[1,2,3],parameters:["TL10","PQFF10","ZM10"],title:"Luchtgegevens",iconHtml:["olIconHtml","olIconHtmlXL","olIconHtmlXL"],iconScale:[1,1.5,1.5],initialize:function(map,bLoadProjects,options)
{Geotool.Component.WaterLayers.prototype.initialize.apply(this,arguments);this.loadProjects=bLoadProjects;this.categoryControl=new Geotool.Control.CategoryControl("categoryluchtgegevensform","categoryluchtgegevensinput","categoryluchtgegevens");this.categoryControl.setPolicy('single');if(map){map.addControl(this.categoryControl);}},CLASS_NAME:"Geotool.Component.Luchtgegevens"});Geotool.componentClasses.push(Geotool.Component.Luchtgegevens);Geotool.Component.Stromingsgegevens=OpenLayers.Class(Geotool.Component.WaterLayers,{componentName:"Stromingsgegevens",projecttype:"stromingsgegevens",categories:[1,2,3],title:"Stromingsgegevens",iconHtml:["olIconHtmlXL","olIconHtml","olIconHtml"],iconScale:[1.5,1,1],initialize:function(map,bLoadProjects,options)
{Geotool.Component.WaterLayers.prototype.initialize.apply(this,arguments);this.categoryControl=new Geotool.Control.CategoryControl("categorystromingsgegevensform","categorystromingsgegevensinput","categorystromingsgegevens");this.categoryControl.setPolicy('single');if(map){map.addControl(this.categoryControl);}},CLASS_NAME:"Geotool.Component.Stromingsgegevens"});Geotool.componentClasses.push(Geotool.Component.Stromingsgegevens);Geotool.Component.VaarWW=OpenLayers.Class(Geotool.Component.MarkerBase,{highlightVectorLayer:null,layernameprefix:"vaarww_",projecttype:'vaarwegen',searcherTypes:"adres,vaarweg",groupLayer:null,title:"Vaarwegwerkzaamheden",initialize:function(map,bLoadProjects,options){Geotool.Component.MarkerBase.prototype.initialize.apply(this,arguments);this.loadProjects=bLoadProjects;this.highlightVectorLayer=new OpenLayers.Layer.Vector("VaarWeg Highlight layer");this.categoryControl=new Geotool.Control.CategoryControl("categoryvaarwegwerkform","categoryvaarwegwerkinput","categoryvaarwegwerk");this.categoryControl.setPolicy('priority');this.groupLayer=new Geotool.Layer.Group("VaarwegwerkzaamhedenGroup");if(map){map.addControl(this.categoryControl);}
this.groupLayer.addLayer(this.highlightVectorLayer);var printing=Geotool.argParser.getParam("printing");if(printing&&printing=="map"){this.highlightVectorLayer.div.style.display="none";this.highlightVectorLayer.div.className="highlightvectorlayer";}},makeLayer:function()
{var categories=new Array(2,1);var categoriesIds=new Array(5,2);var stategiesByCat={};for(var ci=0;ci<categories.length;ci++){var iconsByScale=[{icon:new OpenLayers.Icon('components/vaarwegwerk/icons/vaarwegwerk_0'+categoriesIds[ci]+'_icon_small.png',new OpenLayers.Size(29,23),new OpenLayers.Pixel(-12,-22)),maxscale:20000000,minscale:750000,contentHtmlClassName:"olIcon"},{icon:new OpenLayers.Icon('components/vaarwegwerk/icons/vaarwegwerk_0'+categoriesIds[ci]+'_icon.png',new OpenLayers.Size(54,66),new OpenLayers.Pixel(-26,-62)),maxscale:750000,minscale:1,contentHtmlClassName:"olIcon"}];stategiesByCat[''+categories[ci]]=[new Geotool.Strategy.Marker.IconSwitcher(iconsByScale)];}
var options={displayInLayerSwitcher:false,categories:categories,highlightVectorLayer:this.highlightVectorLayer,strategies:[new Geotool.Strategy.Marker.Period(this.getLocation())],strategiesByCat:stategiesByCat};var layer=new Geotool.Layer.HighlightedCategorizedJSON(this.title,options);layer.events.on({'beforefeatureadded':this.doBeforeFeatureAdded,scope:this});layer.hasLegend=true;if(this.loadProjects){layer.defaultLegendValue=2;}else{layer.defaultLegendValue=1;}
layer.location=null;return layer;},doBeforeFeatureAdded:function(evt){if(!evt.feature||!evt.feature.data){return false;}
evt.feature.data.popupClass='vaarwegwerk vaarwegwerk_'+evt.feature.data.category+' olPopup';evt.feature.data['popupContentHTML']=evt.feature.data.description;},CLASS_NAME:"Geotool.Component.VaarWW"});Geotool.componentClasses.push(Geotool.Component.VaarWW);Geotool.Component.Waterstanden=OpenLayers.Class(Geotool.Component.WaterLayers,{componentName:"Waterstanden",projecttype:"waterstanden",categories:[1,2,3,4],parameters:["H10","H10A"],title:"Waterhoogten",parseData:function(responseText,feature){var format=new OpenLayers.Format.JSON();var doc=format.read(responseText);if(!doc){return"<p class='popindataerror'>Gegevens konden niet worden geladen. Probeer het later nog eens.</p>";}
var oCount=-1;var oObj=[];var oRow=[];for(att in doc)
{oCount++;if(att=='H10'){oObj[0]=doc[att];}
if(att=='H10A'){oObj[1]=doc[att];}
if(att=='H10V'){if(doc['H10A']){oObj[2]=doc[att];}
else{oObj[1]=doc[att];}}}
var i=0;for(i=0;i<=oCount;i++)
{oObj[i].sort(function(a,b){return b.tijd-a.tijd});oRow[i]=0;}
html='<div id="'+this.projecttype+'data" >'+'<div id="'+this.projecttype+'graph" ><img id="image" width="'+feature.data.graphsize+'" height="250px" src="awd.php?mode=grafiek&loc='+feature.data.loc+'&net='+feature.data.net+'&projecttype='+this.projecttype+'&category='+feature.data.category+'"/></div>'+'<div id="'+this.projecttype+'table" style="display:none">'+
(doc['H10V']||doc['H10A']?'<a href="#" id="toggleVerwachting" onclick="Geotool.Component.'+this.componentName+'.prototype.toggleVerwachting(); return false;">Toon</a> Verwachtingen':'')+'<table cellspacing="0">'+'<thead>'+'<tr>';for(colCount=0;colCount<=oCount;colCount++)
{if(colCount==0){html+='<th class="rowlabel">&nbsp;</th>'+'<th colspan="2" class="rowlabel">'+oObj[colCount][0].parameternaam+'</th>';}else{html+='<th class="rowlabel">'+oObj[colCount][0].paramlabel+'</th>';}}
html+='</tr>'+'<tr>';for(colCount=0;colCount<=oCount;colCount++)
{if(colCount==0){html+='<th class="rowlabel">dag</th><th class="rowlabel">&nbsp;tijd&nbsp;</th>';}
html+='<th class="wsh2">'+feature.data.eenheid+'</th>';}
html+='</tr>';html+='</thead>';html+='<tbody id="'+this.projecttype+'.tbody1"';if(doc['H10V']||doc['H10A']){html+='style="display:none"';}
html+='>';var finished=false;var odd=true;var secondtbody=false;while(!finished)
{activeColNr=0;for(colCount=0;colCount<=oCount;colCount++)
{if(oRow[colCount]<oObj[colCount].length){activeColNr=colCount;}}
for(colCount=0;colCount<=oCount;colCount++)
{if((oObj[colCount][oRow[colCount]])&&(oObj[activeColNr][oRow[activeColNr]])){if(oObj[activeColNr][oRow[activeColNr]].tijd<=oObj[colCount][oRow[colCount]].tijd){activeColNr=colCount;}}}
if(!secondtbody&&oCount>0){if(oObj[activeColNr][oRow[activeColNr]].tijd==oObj[0][oRow[0]].tijd){html+='</tbody>';html+='<tbody id="'+this.projecttype+'.tbody2">';html+='<tr class="'+((odd==true)?'roweven':'rowodd')+'">';secondtbody=true;}}
html+='<tr class="'+((odd==true)?'rowoddawd':'rowevenawd')+'">';odd=!odd;if(oObj[activeColNr][oRow[activeColNr]]){html+='<td>'+oObj[activeColNr][oRow[activeColNr]].datumdag+'</td><td>'+oObj[activeColNr][oRow[activeColNr]].datumtijd+'</td>';}
for(colCount=0;colCount<=oCount;colCount++)
{if((oObj[activeColNr][oRow[activeColNr]])&&(oObj[colCount][oRow[colCount]])){if(oObj[activeColNr][oRow[activeColNr]].tijd==oObj[colCount][oRow[colCount]].tijd){html+='<td>'+this.formatWaarde(oObj[colCount][oRow[colCount]].waarde)+'</td>';oRow[colCount]++;}
else{html+='<td> </td>';}}
else{html+='<td> </td>';}}
html+='</tr>';finished=true;for(colCount=0;colCount<=oCount;colCount++){if(oRow[colCount]<oObj[colCount].length){finished=false;}}}
html+='</tbody>';html+='</table>'+'</div>'+'</div>';return html;},toggleAstroGetij:function(){var button=document.getElementById("toggleastrogetij");if(button.innerHTML=="Verberg")
{button.innerHTML="Toon";document.getElementById(this.projecttype+'.tbody1').style.display="none";}
else
{button.innerHTML="Verberg";document.getElementById(this.projecttype+'.tbody1').style.display="";}
return false;},toggleVerwachting:function(){var button=document.getElementById("toggleVerwachting");if(button.innerHTML=="Verberg")
{button.innerHTML="Toon";document.getElementById(this.projecttype+'.tbody1').style.display="none";}
else
{button.innerHTML="Verberg";document.getElementById(this.projecttype+'.tbody1').style.display="";}
return false;},CLASS_NAME:"Geotool.Component.Waterstanden"});Geotool.componentClasses.push(Geotool.Component.Waterstanden);Geotool.Component.WaterstandenTAW=OpenLayers.Class(Geotool.Component.WaterLayers,{componentName:"WaterstandenTAW",projecttype:"waterstandentaw",categories:[1],parameters:["xH10R"],title:"WaterhoogtenTAW",CLASS_NAME:"Geotool.Component.WaterstandenTAW"});Geotool.componentClasses.push(Geotool.Component.WaterstandenTAW);Geotool.Component.WaterTemperatuur=OpenLayers.Class(Geotool.Component.WaterLayers,{componentName:"Watertemperatuur",projecttype:"watertemperatuur",categories:[1],parameters:["TW10","TW10S"],title:"WaterTemperatuur",CLASS_NAME:"Geotool.Component.WaterTemperatuur"});Geotool.componentClasses.push(Geotool.Component.WaterTemperatuur);Geotool.Component.Windsnelheden_en_Windstoten=OpenLayers.Class(Geotool.Component.WaterLayers,{componentName:"Windsnelheden_en_Windstoten",projecttype:"windsnelheden_en_windstoten",categories:[1,2],parameters:["WC10","WC10MXS3","WR10"],title:"Windsnelheden en windstoten",initialize:function(map,bLoadProjects,options)
{Geotool.Component.WaterLayers.prototype.initialize.apply(this,arguments);this.loadProjects=bLoadProjects;this.categoryControl=new Geotool.Control.CategoryControl("categorywindsnelheden_en_windstotenform","categorywindsnelheden_en_windstoteninput","categorywindsnelheden_en_windstoten");this.categoryControl.setPolicy('single');if(map){map.addControl(this.categoryControl);}},CLASS_NAME:"Geotool.Component.Windsnelheden_en_Windstoten"});Geotool.componentClasses.push(Geotool.Component.Windsnelheden_en_Windstoten);
