var map, cluster, eventListeners=[], markersArray=[], json=[], icon;
var linkURL ='/producten/goedkoopste_reisverzekering';

function ClusterMarker($map, $options){
	this._map=$map;
	this._mapMarkers=[];
	this._iconBounds=[];
	this._clusterMarkers=[];
	this._eventListeners=[];
	if(typeof($options)==='undefined'){
		$options={};
	}
	this.borderPadding=($options.borderPadding)?$options.borderPadding:256;
	this.clusteringEnabled=($options.clusteringEnabled===false)?false:true;
	if($options.clusterMarkerClick){
		this.clusterMarkerClick=$options.clusterMarkerClick;
	}
	if($options.clusterMarkerIcon){
		this.clusterMarkerIcon=$options.clusterMarkerIcon;
	}else{
		this.clusterMarkerIcon=new GIcon();
		this.clusterMarkerIcon.image='../img/icons/orange_button.png';
		this.clusterMarkerIcon.iconSize=new GSize(28, 28);
		this.clusterMarkerIcon.iconAnchor=new GPoint(14, 14);
		this.clusterMarkerIcon.infoWindowAnchor=new GPoint(28, 0);
		//this.clusterMarkerIcon.shadow='../img/icons/orange_button.png';
		//this.clusterMarkerIcon.shadowSize=new GSize(28, 28);
	}
	this.clusterMarkerTitle=($options.clusterMarkerTitle)?$options.clusterMarkerTitle:'Click to zoom in and see %count markers';
	if($options.fitMapMaxZoom){
		this.fitMapMaxZoom=$options.fitMapMaxZoom;
	}
	this.intersectPadding=($options.intersectPadding)?$options.intersectPadding:0;
	if($options.markers){
		this.addMarkers($options.markers);
	}
	GEvent.bind(this._map, 'moveend', this, this._moveEnd);
	GEvent.bind(this._map, 'zoomend', this, this._zoomEnd);
	GEvent.bind(this._map, 'maptypechanged', this, this._mapTypeChanged);
}

ClusterMarker.prototype.addMarkers=function($markers){
	var i;
	if(!$markers[0]){
		//	assume $markers is an associative array and convert to a numerically indexed array
		var $numArray=[];
		for(i in $markers){
			$numArray.push($markers[i]);
		}
		$markers=$numArray;
	}
	for(i=$markers.length-1; i>=0; i--){
		$markers[i]._isVisible=false;
		$markers[i]._isActive=false;
		$markers[i]._makeVisible=false;
	}
	this._mapMarkers=this._mapMarkers.concat($markers);
};

ClusterMarker.prototype._clusterMarker=function($clusterGroupIndexes){
	function $newClusterMarker($location, $icon, $title){
		return new GMarker($location, {icon:$icon, title:$title});
	}
	var $clusterGroupBounds=new GLatLngBounds(), i, $clusterMarker, $clusteredMarkers=[], $marker, $this=this, $mapMarkers=this._mapMarkers;
	for(i=$clusterGroupIndexes.length-1; i>=0; i--){
		$marker=$mapMarkers[$clusterGroupIndexes[i]];
		$marker.index=$clusterGroupIndexes[i];
		$clusterGroupBounds.extend($marker.getLatLng());
		$clusteredMarkers.push($marker);
	}
	$clusterMarker=$newClusterMarker($clusterGroupBounds.getCenter(), this.clusterMarkerIcon, this.clusterMarkerTitle.replace(/%count/gi, $clusterGroupIndexes.length));
	$clusterMarker.clusterGroupBounds=$clusterGroupBounds;	//	only req'd for default cluster marker click action
	this._eventListeners.push(GEvent.addListener($clusterMarker, 'click', function(){
		$this.clusterMarkerClick({clusterMarker:$clusterMarker, clusteredMarkers:$clusteredMarkers });
	}));
	$clusterMarker._childIndexes=$clusterGroupIndexes;
	for(i=$clusterGroupIndexes.length-1; i>=0; i--){
		$mapMarkers[$clusterGroupIndexes[i]]._parentCluster=$clusterMarker;
	}
	return $clusterMarker;
};

ClusterMarker.prototype.clusterMarkerClick=function($args){
	this._map.setCenter($args.clusterMarker.getLatLng(), this._map.getBoundsZoomLevel($args.clusterMarker.clusterGroupBounds));
};

ClusterMarker.prototype._filterActiveMapMarkers=function(){
	var $borderPadding=this.borderPadding, $mapZoomLevel=this._map.getZoom(), $mapProjection=this._map.getCurrentMapType().getProjection(), $mapPointSw, $activeAreaPointSw, $activeAreaLatLngSw, $mapPointNe, $activeAreaPointNe, $activeAreaLatLngNe, $activeAreaBounds=this._map.getBounds(), i, $marker, $uncachedIconBoundsIndexes=[], $oldState, $mapMarkers=this._mapMarkers, $iconBounds=this._iconBounds;
	if($borderPadding){
		$mapPointSw=$mapProjection.fromLatLngToPixel($activeAreaBounds.getSouthWest(), $mapZoomLevel);
		$activeAreaPointSw=new GPoint($mapPointSw.x-$borderPadding, $mapPointSw.y+$borderPadding);
		$activeAreaLatLngSw=$mapProjection.fromPixelToLatLng($activeAreaPointSw, $mapZoomLevel);
		$mapPointNe=$mapProjection.fromLatLngToPixel($activeAreaBounds.getNorthEast(), $mapZoomLevel);
		$activeAreaPointNe=new GPoint($mapPointNe.x+$borderPadding, $mapPointNe.y-$borderPadding);
		$activeAreaLatLngNe=$mapProjection.fromPixelToLatLng($activeAreaPointNe, $mapZoomLevel);
		$activeAreaBounds.extend($activeAreaLatLngSw);
		$activeAreaBounds.extend($activeAreaLatLngNe);
	}
	this._activeMarkersChanged=false;
	if(typeof($iconBounds[$mapZoomLevel])==='undefined'){
		//	no iconBounds cached for this zoom level
		//	no need to check for existence of individual iconBounds elements
		this._iconBounds[$mapZoomLevel]=[];
		this._activeMarkersChanged=true;	//	force refresh(true) as zoomed to uncached zoom level
		for(i=$mapMarkers.length-1; i>=0; i--){
			$marker=$mapMarkers[i];
			$marker._isActive=$activeAreaBounds.containsLatLng($marker.getLatLng())?true:false;
			$marker._makeVisible=$marker._isActive;
			if($marker._isActive){
				$uncachedIconBoundsIndexes.push(i);
			}
		}
	}else{
		//	icondBounds array exists for this zoom level
		//	check for existence of individual iconBounds elements
		for(i=$mapMarkers.length-1; i>=0; i--){
			$marker=$mapMarkers[i];
			$oldState=$marker._isActive;
			$marker._isActive=$activeAreaBounds.containsLatLng($marker.getLatLng())?true:false;
			$marker._makeVisible=$marker._isActive;
			if(!this._activeMarkersChanged && $oldState!==$marker._isActive){
				this._activeMarkersChanged=true;
			}
			if($marker._isActive && typeof($iconBounds[$mapZoomLevel][i])==='undefined'){
				$uncachedIconBoundsIndexes.push(i);
			}
		}
	}
	return $uncachedIconBoundsIndexes;
};

ClusterMarker.prototype._filterIntersectingMapMarkers=function(){
	var $clusterGroup, i, j, $mapZoomLevel=this._map.getZoom(), $mapMarkers=this._mapMarkers, $iconBounds=this._iconBounds;
	for(i=$mapMarkers.length-1; i>0; i--)
	{
		if($mapMarkers[i]._makeVisible){
			$clusterGroup=[];
			for(j=i-1; j>=0; j--){
				if($mapMarkers[j]._makeVisible && $iconBounds[$mapZoomLevel][i].intersects($iconBounds[$mapZoomLevel][j])){
					$clusterGroup.push(j);
				}
			}
			if($clusterGroup.length!==0){
				$clusterGroup.push(i);
				for(j=$clusterGroup.length-1; j>=0; j--){
					$mapMarkers[$clusterGroup[j]]._makeVisible=false;
				}
				this._clusterMarkers.push(this._clusterMarker($clusterGroup));
			}
		}
	}
};

ClusterMarker.prototype.fitMapToMarkers=function(){
	var $mapMarkers=this._mapMarkers, $markersBounds=new GLatLngBounds(), i;
	for(i=$mapMarkers.length-1; i>=0; i--){
		$markersBounds.extend($mapMarkers[i].getLatLng());
	}
	var $fitMapToMarkersZoom=this._map.getBoundsZoomLevel($markersBounds);
		
	if(this.fitMapMaxZoom && $fitMapToMarkersZoom>this.fitMapMaxZoom){
		$fitMapToMarkersZoom=this.fitMapMaxZoom;
	}
	this._map.setCenter($markersBounds.getCenter(), $fitMapToMarkersZoom);
	this.refresh();
};

ClusterMarker.prototype._mapTypeChanged=function(){
	this.refresh(true);
};

ClusterMarker.prototype._moveEnd=function(){
	if(!this._cancelMoveEnd){
		this.refresh();
	}else{
		this._cancelMoveEnd=false;
	}
};

ClusterMarker.prototype._preCacheIconBounds=function($indexes, $mapZoomLevel){
	var $mapProjection=this._map.getCurrentMapType().getProjection(), i, $marker, $iconSize, $iconAnchorPoint, $iconAnchorPointOffset, $iconBoundsPointSw, $iconBoundsPointNe, $iconBoundsLatLngSw, $iconBoundsLatLngNe, $intersectPadding=this.intersectPadding, $mapMarkers=this._mapMarkers;
	for(i=$indexes.length-1; i>=0; i--){
		$marker=$mapMarkers[$indexes[i]];
		$iconSize=$marker.getIcon().iconSize;
		$iconAnchorPoint=$mapProjection.fromLatLngToPixel($marker.getLatLng(), $mapZoomLevel);
		$iconAnchorPointOffset=$marker.getIcon().iconAnchor;
		$iconBoundsPointSw=new GPoint($iconAnchorPoint.x-$iconAnchorPointOffset.x-$intersectPadding, $iconAnchorPoint.y-$iconAnchorPointOffset.y+$iconSize.height+$intersectPadding);
		$iconBoundsPointNe=new GPoint($iconAnchorPoint.x-$iconAnchorPointOffset.x+$iconSize.width+$intersectPadding, $iconAnchorPoint.y-$iconAnchorPointOffset.y-$intersectPadding);
		$iconBoundsLatLngSw=$mapProjection.fromPixelToLatLng($iconBoundsPointSw, $mapZoomLevel);
		$iconBoundsLatLngNe=$mapProjection.fromPixelToLatLng($iconBoundsPointNe, $mapZoomLevel);
		this._iconBounds[$mapZoomLevel][$indexes[i]]=new GLatLngBounds($iconBoundsLatLngSw, $iconBoundsLatLngNe);
	}
};

ClusterMarker.prototype.refresh=function($forceFullRefresh){
	var i, $marker, $zoomLevel=this._map.getZoom(), $uncachedIconBoundsIndexes=this._filterActiveMapMarkers();
	if(this._activeMarkersChanged || $forceFullRefresh){
		this._removeClusterMarkers();
		if(this.clusteringEnabled && $zoomLevel<this._map.getCurrentMapType().getMaximumResolution()){
			if($uncachedIconBoundsIndexes.length>0){
				this._preCacheIconBounds($uncachedIconBoundsIndexes, $zoomLevel);
			}
			this._filterIntersectingMapMarkers();
		}
		for(i=this._clusterMarkers.length-1; i>=0; i--){
			this._map.addOverlay(this._clusterMarkers[i]);
		}
		for(i=this._mapMarkers.length-1; i>=0; i--){
			$marker=this._mapMarkers[i];
			if(!$marker._isVisible && $marker._makeVisible){
				this._map.addOverlay($marker);
				$marker._isVisible=true;
			}
			if($marker._isVisible && !$marker._makeVisible){
				this._map.removeOverlay($marker);
				$marker._isVisible=false;
			}
		}
	}
};

ClusterMarker.prototype._removeClusterMarkers=function(){
	var i, j, $map=this._map, $eventListeners=this._eventListeners, $clusterMarkers=this._clusterMarkers, $childIndexes, $mapMarkers=this._mapMarkers;
	for(i=$clusterMarkers.length-1; i>=0; i--){
		$childIndexes=$clusterMarkers[i]._childIndexes;
		for(j=$childIndexes.length-1; j>=0; j--){
			delete $mapMarkers[$childIndexes[j]]._parentCluster;
		}
		$map.removeOverlay($clusterMarkers[i]);
	}
	for(i=$eventListeners.length-1; i>=0; i--){
		GEvent.removeListener($eventListeners[i]);
	}
	this._clusterMarkers=[];
	this._eventListeners=[];
};

ClusterMarker.prototype.removeMarkers=function(){
	var i, $mapMarkers=this._mapMarkers, $map=this._map;
	for(i=$mapMarkers.length-1; i>=0; i--){
		if($mapMarkers[i]._isVisible){
			$map.removeOverlay($mapMarkers[i]);
		}
		delete $mapMarkers[i]._isVisible;
		delete $mapMarkers[i]._isActive;
		delete $mapMarkers[i]._makeVisible;
	}
	this._removeClusterMarkers();
	this._mapMarkers=[];
	this._iconBounds=[];
};

ClusterMarker.prototype.triggerClick=function($index){
	var $marker=this._mapMarkers[$index];
	if($marker._isVisible){
		//	$marker is visible
		GEvent.trigger($marker, 'click');
	}
	else if($marker._isActive){
		//	$marker is clustered
		var $clusteredMarkersIndexes=$marker._parentCluster._childIndexes, $intersectDetected=true, $uncachedIconBoundsIndexes, i, $mapZoomLevel=this._map.getZoom(), $clusteredMarkerIndex, $iconBounds=this._iconBounds, $mapMaxZoomLevel=this._map.getCurrentMapType().getMaximumResolution();
		while($intersectDetected && $mapZoomLevel<$mapMaxZoomLevel){
			$intersectDetected=false;
			$mapZoomLevel++;
			if(typeof($iconBounds[$mapZoomLevel])==='undefined'){
				//	no iconBounds cached for this zoom level
				//	no need to check for existence of individual iconBounds elements
				$iconBounds[$mapZoomLevel]=[];
				// need to create cache for all clustered markers at $mapZoomLevel
				this._preCacheIconBounds($clusteredMarkersIndexes, $mapZoomLevel);
			}else{
				//	iconBounds array exists for this zoom level
				//	check for existence of individual iconBounds elements
				$uncachedIconBoundsIndexes=[];
				for(i=$clusteredMarkersIndexes.length-1; i>=0; i--){
					if(typeof($iconBounds[$mapZoomLevel][$clusteredMarkersIndexes[i]])==='undefined'){
						$uncachedIconBoundsIndexes.push($clusteredMarkersIndexes[i]);
					}
				}
				if($uncachedIconBoundsIndexes.length>=1){
					this._preCacheIconBounds($uncachedIconBoundsIndexes, $mapZoomLevel);
				}
			}
			for(i=$clusteredMarkersIndexes.length-1; i>=0; i--){
				$clusteredMarkerIndex=$clusteredMarkersIndexes[i];
				if($clusteredMarkerIndex!==$index && $iconBounds[$mapZoomLevel][$clusteredMarkerIndex].intersects($iconBounds[$mapZoomLevel][$index])){	
					$intersectDetected=true;
					break;
				}
			}
			
		};
		this._map.setCenter($marker.getLatLng(), $mapZoomLevel);
		this.triggerClick($index);
	}else{
		// $marker is not within active area (map bounds + border padding)
		this._map.setCenter($marker.getLatLng());
		this.triggerClick($index);
	}
};

ClusterMarker.prototype._zoomEnd=function(){
	this._cancelMoveEnd=true;
	this.refresh(true);
};
json[0]={"companyName":"Bremavo Verzekeringen","addressCity":"Zwijndrecht","webURL":"www.bremavoverzekeringen.nl","lat":"51.8159225","lng":"4.6419057"};json[1]={"companyName":"4Klik Verzekeringen","addressCity":"Zwanenburg","webURL":"www.4klikverzekeringen.nl","lat":"52.38021","lng":"4.74993"};json[2]={"companyName":"Peter van Zutphen Verzekeringen","addressCity":"Zwaagwesteinde","webURL":"www.pvz.nl","lat":"53.2544938","lng":"6.0307255"};json[3]={"companyName":"Weenink & Mellens B.V.","addressCity":"Zuidlaren","webURL":"www.weeninkmellens.nl","lat":"53.0946734","lng":"6.6869973"};json[4]={"companyName":"Assurantiekantoor G.Strabbing","addressCity":"Zuidbroek","webURL":"www.strabbing.com","lat":"53.16548","lng":"6.86118"};json[5]={"companyName":"BB Assuranti&euml;n BV","addressCity":"Zoetermeer","webURL":"www.bbassurantien.nl","lat":"52.04072","lng":"4.46361"};json[6]={"companyName":"Hat&eacute;ka Assurantiekantoor en Makelaardij","addressCity":"Zaamslag","webURL":"www.hateka.nl","lat":"51.3127985","lng":"3.912718"};json[7]={"companyName":"Oosterveld Assuranti&euml;n","addressCity":"Westerbork","webURL":"www.oosterveld.nl","lat":"52.852261","lng":"6.6015197"};json[8]={"companyName":"SuyderseeDirect.nl","addressCity":"Wervershoof","webURL":"www.suyderseedirect.nl","lat":"52.7332735","lng":"5.1604683"};json[9]={"companyName":"Finas Adviesgroep","addressCity":"Wageningen","webURL":"www.finas.nl","lat":"51.9667624","lng":"5.6620732"};json[10]={"companyName":"Van der Maat Assuranti&euml;n","addressCity":"Voorschoten","webURL":"www.maatpolis.nu","lat":"52.1425907","lng":"4.4580295"};json[11]={"companyName":"RESIDENTIEPOLIS.NL","addressCity":"Voorburg","webURL":"www.residentiepolis.nl","lat":"52.0679455","lng":"4.3604238"};json[12]={"companyName":"Post Financi&euml;le Diensten","addressCity":"Vlijmen","webURL":"www.postfinancielediensten.nl","lat":"51.6968169","lng":"5.2139599"};json[13]={"companyName":"Assurantor BV","addressCity":"Vlaardingen","webURL":"www.assurantor.nl","lat":"51.9093714","lng":"4.3490193"};json[14]={"companyName":"Financi&euml;le Dienstverlening Vecht en Venen","addressCity":"Vinkeveen","webURL":"www.fdvev.nl","lat":"52.2153581","lng":"4.9226499"};json[15]={"companyName":"Jos van Boom Advies","addressCity":"Venlo","webURL":"www.josvanboom.nl","lat":"51.3663028","lng":"6.1709926"};json[16]={"companyName":"Assurantiekantoor Rijtma","addressCity":"Velp","webURL":"www.rijtma.nl","lat":"51.9941676","lng":"5.9758756"};json[17]={"companyName":"Assurantiekantoor Van Duijn","addressCity":"Vaassen","webURL":"www.vanduijnassurantie.nl","lat":"52.2955904","lng":"5.9749352"};json[18]={"companyName":"RAAT Adviesgroep BV","addressCity":"Utrecht","webURL":"www.raat.info","lat":"52.0955541","lng":"5.1327027"};json[19]={"companyName":"De Jong Assurantien","addressCity":"Utrecht","webURL":"www.uwverzekeringssite.nl","lat":"52.0924574","lng":"5.0593385"};json[20]={"companyName":"Bourgondi&euml;n Kok Financi&euml;le Diensten","addressCity":"Ulft","webURL":"www.fdbk.nl","lat":"51.8998353","lng":"6.3763145"};json[21]={"companyName":"Finance Partner BV","addressCity":"Uden","webURL":"www.financepartner.nl","lat":"51.6552587","lng":"5.6188368"};json[22]={"companyName":"Finion Hypotheken &amp; Financi&euml;le Planning","addressCity":"Tilburg","webURL":"www.finion.nl","lat":"51.5561072","lng":"5.0993604"};json[23]={"companyName":"De Raedgevers","addressCity":"Tilburg","webURL":"www.deraedgevers.nl","lat":"51.5507428","lng":"5.072188"};json[24]={"companyName":"Het Lam Assuranti&euml;","addressCity":"Tienhoven","webURL":"www.lamverzekeringen.nl","lat":"51.9549583","lng":"4.9544607"};json[25]={"companyName":"BAAK verzekeringen","addressCity":"Ter Aar","webURL":"www.baakverzekeringen.nl","lat":"52.1629356","lng":"4.7273597"};json[26]={"companyName":"Lodewijks - Van Ginneken Assurantiegroep BV","addressCity":"Sprundel","webURL":"www.lvg.nl","lat":"51.5370472","lng":"4.5961254"};json[27]={"companyName":"Life & Finance","addressCity":"Spijkenisse","webURL":"www.lifefinance.nl","lat":"51.8489737","lng":"4.3313045"};json[28]={"companyName":"M&amp;L Advies","addressCity":"Spijkenisse","webURL":"www.menlverzekeringen.nl","lat":"51.8304259","lng":"4.3632362"};json[29]={"companyName":"Huis en Zekerheid","addressCity":"Soest","webURL":"www.huisenzekerheidsoest.nl","lat":"52.1744637","lng":"5.3112968"};json[30]={"companyName":"Ariaans Assuranti&euml;n B.V.","addressCity":"Sittard","webURL":"www.ariaansassurantien.nl","lat":"50.9943624","lng":"5.8579391"};json[31]={"companyName":"Mijnassurantiekantoor.nu","addressCity":"Sint Anthonis","webURL":"www.mijnassurantiekantoor.nu","lat":"51.6297507","lng":"5.8852386"};json[32]={"companyName":"Renaud &amp; Wolf Adviesgroep","addressCity":"Schipluiden","webURL":"www.renaudwolf.nl","lat":"51.9759423","lng":"4.3167624"};json[33]={"companyName":"Totaal Adviesgroep B.V.","addressCity":"Schijndel","webURL":"www.totaaladviesgroeponline.nl ","lat":"51.6115191","lng":"5.4750943"};json[34]={"companyName":"Goes Assuranti&euml;n","addressCity":"Scherpenzeel","webURL":"www.goesassurantien.nl","lat":"52.0783509","lng":"5.4788998"};json[35]={"companyName":"Van der Wijst Assurantien","addressCity":"Schaijk","webURL":"www.wijst.net","lat":"51.7473224","lng":"5.6305026"};json[36]={"companyName":"Financeel Adviesbureau Van den Haspel","addressCity":"Rotterdam","webURL":"www.vandenhaspel.nl","lat":"51.890043","lng":"4.4904937"};json[37]={"companyName":"Financieel Bureau 10","addressCity":"Rotterdam","webURL":"www.fb10.nl","lat":"51.8957591","lng":"4.51156"};json[38]={"companyName":"De Rotterdamse Adviesgroep","addressCity":"Rotterdam","webURL":"www.derotterdamseadviesgroep.nl","lat":"51.92407","lng":"4.49178"};json[39]={"companyName":"De Nederlandse Geldmeesters B.V.","addressCity":"ROSMALEN","webURL":"www.geldmeestersdirect.nl","lat":"51.7093924","lng":"5.3850323"};json[40]={"companyName":"WDO Verzekeringen","addressCity":"Roosendaal","webURL":"www.wdoverzekeringen.nl","lat":"51.5346007","lng":"4.4596534"};json[41]={"companyName":"YorTrust Financial Services BV","addressCity":"Roermond","webURL":"www.yortrust.nl","lat":"51.1907791","lng":"5.9872352"};json[42]={"companyName":"Meer Direct","addressCity":"ROELOFARENDSVEEN","webURL":"www.meer-direct.nl","lat":"52.2013825","lng":"4.6315304"};json[43]={"companyName":"Assurantiekantoor Ben Weeterings","addressCity":"Ridderkerk","webURL":"www.benweeterings.nl","lat":"51.8664409","lng":"4.5891688"};json[44]={"companyName":"Verkerk &amp; Verheij Adviesgroep","addressCity":"Ridderkerk","webURL":"www.verkerk-verheij.nl","lat":"51.85471","lng":"4.6402721"};json[45]={"companyName":"Perdijk Assuranti&euml;n","addressCity":"Reeuwijk","webURL":"www.perdijkassurantien.nl","lat":"52.039157","lng":"4.7175325"};json[46]={"companyName":"OOK financieel advies","addressCity":"Ravenstein","webURL":"www.ookfinancieeladvies.nl","lat":"51.7913864","lng":"5.6550289"};json[47]={"companyName":"FPO Financi&euml;le Planning","addressCity":"Overberg","webURL":"www.fpo.nl","lat":"52.031725","lng":"5.5165037"};json[48]={"companyName":"Adviesgroep De Vogel","addressCity":"Ouddorp","webURL":"www.devogel.nl","lat":"51.8078994","lng":"3.9389588"};json[49]={"companyName":"Schep Assuranti&euml;n BV","addressCity":"Oud-Beijerland","webURL":"www.schep-assurantien.nl","lat":"51.8147523","lng":"4.4147487"};json[50]={"companyName":"Hofmeester en Partners","addressCity":"Oud-Beijerland","webURL":"www.hofmeesterenpartners.nl","lat":"51.8258013","lng":"4.4154413"};json[51]={"companyName":"Krooswijk &amp; van Hoof","addressCity":"Oosterhout","webURL":"www.krooswijkenvanhoof.nl","lat":"51.642234","lng":"4.8512002"};json[52]={"companyName":"Voordeelpolis","addressCity":"Oldenzaal","webURL":"www.voordeelpolis.nl","lat":"52.3100049","lng":"6.9272796"};json[53]={"companyName":"Hallema Financial Consultancy","addressCity":"Nuth","webURL":"www.hallema-fc.nl","lat":"50.9148688","lng":"5.8877766"};json[54]={"companyName":"Van den Hoek","addressCity":"Nunspeet","webURL":"www.vandenhoekverzekeringen.nl","lat":"52.3784776","lng":"5.7797217"};json[55]={"companyName":"Nuenenpolis.nu","addressCity":"Nuenen","webURL":"www.nuenenpolis.nu\/","lat":"51.4775131","lng":"5.5511533"};json[56]={"companyName":"Ouddeken Assuranti&euml;n B.V.","addressCity":"Noordwijk","webURL":"www.nouddeken.nl","lat":"52.2374785","lng":"4.4477778"};json[57]={"companyName":"Goedkoopste-Verzekering.nl","addressCity":"NIJVERDAL","webURL":"www.goedkoopste-verzekering.nl","lat":"52.364796","lng":"6.467279"};json[58]={"companyName":"Timmermans Koch en Brink","addressCity":"Nijmegen","webURL":"www.tkenb.nl","lat":"51.8341064","lng":"5.838788"};json[59]={"companyName":"RBG Assuranti&euml;n BV","addressCity":"Nieuw-Vennep","webURL":"www.rbg-assurantien.nl","lat":"52.264213","lng":"4.6340822"};json[60]={"companyName":"Le&euml;n Assuranti&euml;n B.V.","addressCity":"Nederweert","webURL":"www.leenassurantienonline.nl","lat":"51.2828791","lng":"5.7616177"};json[61]={"companyName":"RibbensDirect.nl","addressCity":"Moordrecht","webURL":"www.ribbensdirect.nl","lat":"51.9861295","lng":"4.6714797"};json[62]={"companyName":"Jacobi Assuranti&euml;n","addressCity":"Montfoort","webURL":"www.jacobibv.nl","lat":"52.0453402","lng":"4.947624"};json[63]={"companyName":"De Vries Verzekeringen","addressCity":"Monster","webURL":"www.devriesverzekeringen.nl","lat":"52.02535","lng":"4.17769"};json[64]={"companyName":"Van Berkel hypotheken &amp; verzekeringen","addressCity":"Middelharnis","webURL":"www.vanberkeladvies.nl","lat":"51.7547245","lng":"4.1767665"};json[65]={"companyName":"Arjo assurantien","addressCity":"Middelharnis","webURL":"www.devogel.nl","lat":"51.8078994","lng":"3.9389588"};json[66]={"companyName":"Nijboer Financi&euml;le Diensten","addressCity":"Makkum","webURL":"www.nijboermakkum.nl","lat":"53.055216","lng":"5.4025239"};json[67]={"companyName":"Swertz en Partners BV ","addressCity":"Maassluis","webURL":"www.swertz.nl","lat":"51.920024","lng":"4.2504191"};json[68]={"companyName":"Waardevast B.V.","addressCity":"Lelystad","webURL":"www.waardevast.com","lat":"52.4878641","lng":"5.4951165"};json[69]={"companyName":"Hessels &amp; Hessels Adviesgroep","addressCity":"Lelystad","webURL":"www.hessels.net","lat":"52.5059505","lng":"5.4745914"};json[70]={"companyName":"VergelijkMijnPremie.nl","addressCity":"Leeuwarden","webURL":"www.vergelijkmijnpremie.nl","lat":"53.2038416","lng":"5.8527127"};json[71]={"companyName":"Hoogstins Hellema Assuranti&euml;n","addressCity":"Leeuwarden","webURL":"www.hoogstins-hellema.nl","lat":"53.2018921","lng":"5.7952784"};json[72]={"companyName":"Van den Beukel Assuranti&euml;n BV","addressCity":"Leerdam","webURL":"www.vdbeukel.nl","lat":"51.892799","lng":"5.09587"};json[73]={"companyName":"Bolhuis adviesbureau","addressCity":"Leek","webURL":"www.bolhuisadviesbureau.nl","lat":"53.1658823","lng":"6.3848053"};json[74]={"companyName":"EverCare Horst-Sevenum","addressCity":"Kronenberg","webURL":"www.evercare-hs.nl","lat":"51.4199235","lng":"6.0045455"};json[75]={"companyName":"Compiet Advies & Bemiddeling","addressCity":"Kloosterzande","webURL":"www.compiet.nl","lat":"51.368242","lng":"4.0188271"};json[76]={"companyName":"Van de Laar Financi&euml;le Dienstverlening","addressCity":"Klimmen","webURL":"www.vdlaaradvies.nl","lat":"50.8819535","lng":"5.8755034"};json[77]={"companyName":"LimburgDirect.nl","addressCity":"Kerkrade","webURL":"www.limburgdirect.nl","lat":"50.86454","lng":"6.02260"};json[78]={"companyName":"Ferwerda Joure","addressCity":"Joure","webURL":"www.ferwerda-joure.nl","lat":"52.96037","lng":"5.81322"};json[79]={"companyName":"Aarendonk Assuranti&euml;n &amp; Hypotheken","addressCity":"IJsselstein","webURL":"www.aarendonkadvies.nl","lat":"52.018724","lng":"5.040445"};json[80]={"companyName":"Buro Brederode","addressCity":"IJmuiden","webURL":"www.burobrederode.nl","lat":"52.4569916","lng":"4.6295084"};json[81]={"companyName":"Verboeket Hypotheken & verzekeringen","addressCity":"Hoensbroek","webURL":"www.verboeket.eu","lat":"50.9245791","lng":"5.9269869"};json[82]={"companyName":"LaagstePrijsVerzekering.nl","addressCity":"Hoek van Holland","webURL":"www.laagsteprijsverzekering.nl","lat":"51.9777376","lng":"4.131891"};json[83]={"companyName":"Assurantiekantoor Kruis","addressCity":"Hindeloopen","webURL":"www.assurantiekantoormkruis.nl","lat":"52.94325","lng":"5.40133"};json[84]={"companyName":"Asrodirect.nl","addressCity":"Hendrik-Ido-Ambacht","webURL":"www.asrodirect.nl","lat":"51.8390453","lng":"4.643548"};json[85]={"companyName":"Assurantie Advieswinkel van Sintmaartensdijk","addressCity":"Hellevoetsluis","webURL":"www.vansintmaartensdijk.nl","lat":"51.8363279","lng":"4.1313162"};json[86]={"companyName":"KennemerDirect","addressCity":"Heemstede","webURL":"www.kennemerdirect.nl","lat":"52.3294362","lng":"4.6119531"};json[87]={"companyName":"Multias Adviesgroep B.V.","addressCity":"Heemstede","webURL":"www.multias.nl","lat":"52.3479387","lng":"4.6294351"};json[88]={"companyName":"Assurantiebedrijf Hoekstra BV","addressCity":"Harderwijk","webURL":"www.asshoekstra.nl","lat":"52.3450868","lng":"5.6241501"};json[89]={"companyName":"Assurantiekantoor W. Busscher","addressCity":"Harbrinkhoek","webURL":"www.a-wb.nl","lat":"52.3825396","lng":"6.7126159"};json[90]={"companyName":"Adviesbureau Verhoeven BV","addressCity":"Hank","webURL":"www.adviesbureauverhoeven.nl","lat":"51.7326188","lng":"4.8953734"};json[91]={"companyName":"Hamza Assuranti&euml;n","addressCity":"Haarlem","webURL":"www.hamzahaarlem.nl","lat":"52.3859415","lng":"4.6393185"};json[92]={"companyName":"Verzekeringsgemak.nl","addressCity":"Groningen","webURL":"www.verzekeringsgemak.nl","lat":"53.1966486","lng":"6.580722"};json[93]={"companyName":"Spaak Assuranti&euml;n","addressCity":"Groningen","webURL":"www.spaakassurantien.nl","lat":"53.228177","lng":"6.5636441"};json[94]={"companyName":"Van Dalfsen Assuranti&euml;n","addressCity":"GENEMUIDEN","webURL":"www.vandalfsenassurantien.nl","lat":"52.6221706","lng":"6.0410899"};json[95]={"companyName":"Huisman Assuranti&euml;n BV","addressCity":"Genemuiden","webURL":"www.huisman-assurantien.nl","lat":"52.6214562","lng":"6.0409729"};json[96]={"companyName":"Rovers & Van Hoof Assuranti","addressCity":"Etten-Leur","webURL":"www.roversvanhoof.nl","lat":"51.577155","lng":"4.6495715"};json[97]={"companyName":"De Hypotheekspecialist Huisman","addressCity":"Epe","webURL":"www.hs-huisman.nl","lat":"52.35026","lng":"5.98114"};json[98]={"companyName":"De Verzekeringspartner","addressCity":"Enschede","webURL":"www.deverzekeringspartner.com","lat":"52.2247284","lng":"6.949529"};json[99]={"companyName":"Thijssen Assuranti&euml;n BV","addressCity":"Emmeloord","webURL":"www.thijssenverzekeringen.nl","lat":"52.7115291","lng":"5.7511906"};json[100]={"companyName":"VerzekeringsDiscounter","addressCity":"Eindhoven","webURL":"www.verzekeringsdiscounter.nl","lat":"51.4313959","lng":"5.485247"};json[101]={"companyName":"ABC Consulting Financi&euml;le Diensten","addressCity":"EINDHOVEN","webURL":"www.abczelfverzekerd.nl","lat":"51.4191337","lng":"5.4424582"};json[102]={"companyName":"A1B Verzekeringen","addressCity":"Ede","webURL":"www.a1bverzekeringen.nl","lat":"52.02833","lng":"5.64719"};json[103]={"companyName":"Verzekeringskantoor Peer","addressCity":"DUIVEN","webURL":"www.peer-duiven.nl","lat":"51.94196","lng":"6.01649"};json[104]={"companyName":"Jafin Advies","addressCity":"Drachten","webURL":"www.jafinadvies.nl","lat":"53.1153732","lng":"6.0968933"};json[105]={"companyName":"de Boer's kantoren BV","addressCity":"Doornspijk","webURL":"www.boerverzekeringen.nl","lat":"52.4207223","lng":"5.8220326"};json[106]={"companyName":"FINEAS BV","addressCity":"Dongen","webURL":"www.fineas.nl","lat":"51.6276575","lng":"4.9405734"};json[107]={"companyName":"Verzekeringsadvies Jansen B.V.","addressCity":"Dirkshorn","webURL":"www.verzekeringsadviesjansen.nl","lat":"52.7457848","lng":"4.7782354"};json[108]={"companyName":"EverCare West-Brabant","addressCity":"Dinteloord","webURL":"www.evercare-wb.nl","lat":"51.636665","lng":"4.3716485"};json[109]={"companyName":"Diemen Adviesgroep B.V.","addressCity":"Diemen","webURL":"www.diemenadviesgroep.nl","lat":"52.3409763","lng":"4.9558312"};json[110]={"companyName":"Spikker | Redejo","addressCity":"Deventer","webURL":"www.spikker.nl","lat":"52.2562857","lng":"6.1601008"};json[111]={"companyName":"Vos Garant","addressCity":"Den Ilp","webURL":"www.vosgarant.nl","lat":"52.4511719","lng":"4.9076171"};json[112]={"companyName":"Assuriant","addressCity":"Den Haag","webURL":"www.assuriant.nl","lat":"52.0795093","lng":"4.293195"};json[113]={"companyName":"Sieh &amp; Van Leeuwen","addressCity":"Den Haag","webURL":"www.senl-advies.nl","lat":"52.070294","lng":"4.3977739"};json[114]={"companyName":"Brouwer Delft","addressCity":"Delft","webURL":"www.brouwerdelft.nl","lat":"52.0160634","lng":"4.3645479"};json[115]={"companyName":"Van der Weij Assuranti&euml;n","addressCity":"Chaam","webURL":"www.verzekerjebijons.nl","lat":"51.5057234","lng":"4.8612707"};json[116]={"companyName":"Urban Finance BV","addressCity":"Capelle aan den IJssel","webURL":"www.urbanfinance.nl","lat":"51.9121444","lng":"4.5676319"};json[117]={"companyName":"Assurantiekantoor van Hunsel &amp; Govers BV","addressCity":"Budel","webURL":"www.vanhunselengovers.nl","lat":"51.2737318","lng":"5.5755227"};json[118]={"companyName":"Schouten &amp; Hendriks Assuranti&euml;n","addressCity":"Brummen","webURL":"www.schoutenenhendriks.nl","lat":"52.08728","lng":"6.15599"};json[119]={"companyName":"Adviesgroep Koeman-De Baronie B.V.","addressCity":"BREDA","webURL":"www.debaronie.nl","lat":"51.5852","lng":"4.7672"};json[120]={"companyName":"Bureau Van der Leeden","addressCity":"Berkel en Rodenrijs","webURL":"www.bureauvanderleeden.nl","lat":"52.0073096","lng":"4.4821435"};json[121]={"companyName":"Van Ballegooij Assuranti","addressCity":"Berghem","webURL":"www.vbaberghem.nl","lat":"51.7690561","lng":"5.5624915"};json[122]={"companyName":"Duijvelaar &amp; Groffen Verzekeringen","addressCity":"Bergen op Zoom","webURL":"www.duijvelaar-groffen.nl","lat":"51.4951471","lng":"4.2818404"};json[123]={"companyName":"Assurantiekantoor A.S.J. Diks","addressCity":"Beesd","webURL":"www.assurantiekantoordiks.nl","lat":"51.8857934","lng":"5.1960092"};json[124]={"companyName":"Assurantie-en Financieringskantoor L.P. Dolman","addressCity":"Beekbergen","webURL":"www.dolmanverzekeringen.nl","lat":"52.1601899","lng":"5.9631966"};json[125]={"companyName":"ASKAL-online","addressCity":"Beek","webURL":"www.askal-online.nl","lat":"50.9397808","lng":"5.7985718"};json[126]={"companyName":"B & K Advies en bemiddeling","addressCity":"Barendrecht","webURL":"www.bnkadvies.nl","lat":"51.8520085","lng":"4.5099661"};json[127]={"companyName":"Assurantiekantoor Havekes","addressCity":"Arnhem","webURL":"www.havekesverzekeringen.nl","lat":"51.9898376","lng":"5.9121919"};json[128]={"companyName":"EQ Verzekeringen","addressCity":"Apeldoorn","webURL":"www.eqverzekeringen.nl","lat":"52.2115163","lng":"5.988069"};json[129]={"companyName":"XSadvies","addressCity":"Apeldoorn","webURL":"www.xsadvies.nl","lat":"52.1829459","lng":"5.9430397"};json[130]={"companyName":"Hin Verzekeringen","addressCity":"Apeldoorn","webURL":"www.hin.nl","lat":"52.2178357","lng":"5.9624657"};json[131]={"companyName":"KleinAdvies","addressCity":"Ankeveen","webURL":"www.kleinadvies.nl","lat":"52.26042","lng":"5.12083"};json[132]={"companyName":"de Westfriesche","addressCity":"Andijk","webURL":"www.dewestfriesche.nl","lat":"52.744656","lng":"5.215315"};json[133]={"companyName":"Merkelbag Adviesgroep","addressCity":"Amsterdam","webURL":"www.merkelbag.nl","lat":"52.3415596","lng":"4.9067958"};json[134]={"companyName":"Assurantiekantoor Jansen &amp; Zn","addressCity":"Amsterdam","webURL":"www.jansenenzoon.nl","lat":"52.3517152","lng":"4.8084298"};json[135]={"companyName":"BK Groep Nederland","addressCity":"Amsterdam","webURL":"www.bkgn.nl","lat":"52.3479727","lng":"4.8573477"};json[136]={"companyName":"M&eacute;lis Assurantie","addressCity":"Amsterdam","webURL":"www.melisassurantie.nl","lat":"52.3946615","lng":"4.8689395"};json[137]={"companyName":"Assurantie Bemiddeling Collectief Nederland","addressCity":"Amsterdam","webURL":"www.abcn.nl","lat":"52.3594948","lng":"4.7845323"};json[138]={"companyName":"Assurwest Verzekeringen","addressCity":"Amsterdam","webURL":"www.assurwest.nl","lat":"52.37704","lng":"4.819456"};json[139]={"companyName":"Amaska Verzekeringen B.V.","addressCity":"Amsterdam","webURL":"www.amaska.nl","lat":"52.3555891","lng":"4.8794117"};json[140]={"companyName":"Colijn Verzekeringen","addressCity":"Alphen aan den Rijn","webURL":"www.colijnverzekeringen.nl","lat":"52.1324664","lng":"4.6376642"};json[141]={"companyName":"Attent Direct","addressCity":"Almere","webURL":"www.attent-direct.nl","lat":"52.3762964","lng":"5.2714262"};json[142]={"companyName":"Totaal Garant B.V.","addressCity":"Almelo","webURL":"www.totaalgarant.nl","lat":"52.3551199","lng":"6.6600105"};json[143]={"companyName":"Van Wanrooij Assuranti&euml;n","addressCity":"'s-Hertogenbosch","webURL":"www.wanrooijassurantien.nl","lat":"51.7341215","lng":"5.3219428"};json[144]={"companyName":"Assurantiebedrijf van Peppen","addressCity":"'s-Gravenhage","webURL":"www.vanpeppen.nl","lat":"52.0719947","lng":"4.2581808"};json[145]={"companyName":"Van Eersel Assuranti&euml;n","addressCity":"&rsquo;s Gravenmoer","webURL":"www.vaneerselverzekeringen.nl","lat":"51.65689","lng":"4.93868"};// JavaScript Document
String.prototype.unescapeHtml = function () {
    var temp = document.createElement("div");
    temp.innerHTML = this;
    var result = temp.childNodes[0].nodeValue;
    temp.removeChild(temp.firstChild)
    return result;
} 
 
function load() {
	if (GBrowserIsCompatible()) {
		map=new GMap2(document.getElementById('map'));
 	    map.setCenter(new GLatLng(52.1326330, 5.2912660), 8);
	    var customUI = map.getDefaultUI();
		map.addMapType(G_MAPMAKER_NORMAL_MAP);
       	customUI.maptypes.hybrid = false;
       	customUI.maptypes.normal = false;
		customUI.maptypes.satellite = false;
	 	customUI.zoom.doubleclick = true;
	 	customUI.zoom.scrollwheel = false;
       	map.setUI(customUI);
		
		function myClusterClick(args) {
			cluster.defaultClickAction=function(){
				map.setCenter(args.clusterMarker.getLatLng(), map.getBoundsZoomLevel(args.clusterMarker.clusterGroupBounds))
				delete cluster.defaultClickAction;
			}
			var html='<div class="infoWindow"><div class="infoBalloon"><strong>'+args.clusteredMarkers.length+' adviseurs:</strong><br/>';
			for (i=0; i<args.clusteredMarkers.length; i++) {
				var rowcolor = (i%2) ? 'even' : 'odd';
				var titletext = args.clusteredMarkers[i].getTitle().split(' | ');
				html+='<div class="'+rowcolor+'">'+getTitleHtml(titletext[0],titletext[1],titletext[2])+'</div>';
			}
			html+='<span style="font-size:10px; padding-top:10px;">Klik op de kantoornaam om je premie te berekenen.</span></div></div>';
			map.openInfoWindowHtml(args.clusterMarker.getLatLng(), html);
		}
		
		//	create a ClusterMarker
		cluster=new ClusterMarker(map, {clusterMarkerTitle:'%count adviseurs' , clusterMarkerClick:myClusterClick });
		icon=new GIcon();
		icon.iconSize=new GSize(20, 20);
		icon.iconAnchor=new GPoint(10, 10);
		icon.infoWindowAnchor=new GPoint(15, 5);
		newMarkerCluster();
	}
}
 
function newMarker(markerLocation, markerIcon, companyName, addressCity, webURL) {
	var marker=new GMarker(markerLocation, {title: companyName.unescapeHtml()+' | '+addressCity+' | '+webURL, icon:markerIcon});
	eventListeners.push(GEvent.addListener(marker, 'click', function() {
	marker.openInfoWindowHtml('<div class="infoBalloon"><div class="odd">'+getTitleHtml(companyName, addressCity, webURL)+'</div></div><span style="font-size:10px; padding-top:10px;">Klik op de kantoornaam om je premie te berekenen.</span>');
	}));
	return marker;
}
 
function getTitleHtml (companyName, addressCity, webURL) {
	var title='<a href="http://'+webURL+''+linkURL+'" rel="nofollow" target="_blank" onclick="javascript: pageTracker._trackPageview(\'/uitgaande_klik/'+companyName+'\');"><b>'+companyName+'</b><br /><span style="font-size:11px;">'+addressCity+'</span></a>';
	return title;
}
 
function newMarkerCluster(){
		var marker, newIcon, j=1, title, lat, lng;
		for (var i=0; i<json.length; i++) {
			newIcon=new GIcon(icon, '../img/icons/orange_button.png');
			icon.iconSize=new GSize(20, 20);
			lat=Math.round(json[i].lat*100)/100;
			lng=Math.round(json[i].lng*100)/100;
			marker=newMarker(new GLatLng(json[i].lat, json[i].lng), newIcon,json[i].companyName,json[i].addressCity,json[i].webURL);
			markersArray.push(marker);
		}
		cluster.removeMarkers();
		cluster.addMarkers(markersArray);
		cluster.fitMapToMarkers();
		map.savePosition();
		json=[];
}
