/* 	Realtime Related Tweets Bar v1.0
	Blog : http://www.moretechtips.net
	Project: http://code.google.com/p/realtime-related-tweets-bar/
	Copyright 2009 [Mike @ moretechtips.net] 
	Licensed under the Apache License, Version 2.0 
	(the "License"); you may not use this file except in compliance with the License. 
	You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 
*/

(function($){$.fn.relatedTweets=function(allOptions){var defaults={debug:0,query:'',default_query:'',realtime:1,status:1,lang:'en',n:50,max_tags:5,or_tags:1,show_avatar:1,show_author:1,show_date:1,show_source:0,image_width:48,from_users:'',to_users:'',at_users:'',links_only:0,geocode:'',stay_time:8000,enter_time:300,exit_time:200,animate:'opacity'};allOptions=$.extend({},defaults,allOptions);return this.each(function(){var div=$(this);var count=0,ul=null,max_id=0;var visibleI=-1;var calls=0,removeExtra=false;var effectParams=new Object;var op=allOptions;if(div.attr('options')){try{op=eval('('+div.attr('options')+')')}catch(e){if(op.debug)div.html('<b style="color:red">'+e+'</b>');return}op=$.extend({},defaults,op)};var searchLoaded=function(json,status){if(!json.results||!json.max_id){if(op.debug)div.html('<b style="color:red">Error:'+(json.error?json.error:'unkown')+'</b>');return}var rs=json.results;if(json.max_id>0)max_id=json.max_id;if(calls==0){if(rs.length==0)return;count=rs.length;var inDiv=$('<div class="rrt-inner"></div>').appendTo(div.html(''));ul=$('<ul></ul>').appendTo(inDiv)}calls++;for(var i=rs.length-1;i>=0;i--)appendLI(rs[i],rs.length-1-i);if(calls>1&&rs.length)removeExtra=true;if(calls==1)fadeOut()};var appendLI=function(x,i){$('<li style="display:none;">'+(op.show_avatar?'<span class="rrt-author-img">'+'<a href="http://twitter.com/'+x.from_user+'" title="'+x.from_user+'" onclick="window.open(\'http://twitter.com/'+x.from_user+'\');return false;">'+'<img src="'+x.profile_image_url+'" height="'+op.image_width+'" width="'+op.image_width+'" border="0"/>'+'</a>'+'</span>':'')+'<span class="rrt-body">'+(op.show_author?'<strong>'+'<a href="http://twitter.com/'+x.from_user+'" title="'+x.from_user+'" onclick="window.open(\'http://twitter.com/'+x.from_user+'\');return false;">'+x.from_user+'</a>'+'</strong>':'')+'<span class="rrt-content">'+linkify(x.text)+'</span>'+'<span class="rrt-meta">&nbsp;&nbsp;'+(op.show_date?'<a class="rrt-date" href="http://twitter.com/'+x.from_user+'/status/'+x.id+'" onclick="window.open(\'http://twitter.com/'+x.from_user+'/status/'+x.id+'\');return false;">'+formatDate(x.created_at)+'</a>':'')+(op.show_source?'<span class="rrt-source"> from '+decodeHTML(x.source)+'</span>':'')+'</span>'+'</span>'+'</li>').appendTo(ul)};var fadeOut=function(){if(visibleI>-1){$('li',ul).eq(visibleI).fadeOut(op.exit_time,fadeIn)}else fadeIn()};var fadeIn=function(){if(removeExtra)removeExtraLI();visibleI++;if(visibleI>=count)visibleI=0;effectParams[op.animate]='show';$('li',ul).eq(visibleI).animate(effectParams,op.enter_time,"linear",fadeStill);if(visibleI+1>=count&&op.realtime)search()};var fadeStill=function(){$('li',ul).eq(visibleI).animate({opacity:1},op.stay_time,"linear",fadeOut)};var removeExtraLI=function(){var crntCount=$('li',ul).size();if(crntCount>op.n){$('li:lt('+(crntCount-op.n)+')',ul).remove();count=op.n}else{count=crntCount}removeExtra=false};var linkify=function(d){return d.replace(/\bhttps?\:\/\/\S+/gi,function(b){var c='';b=b.replace(/(\.*|\?*|\!*)$/,function(m,a){c=a;return''});return'<a class="rrt-link" href="'+b+'" onclick="window.open(\''+b+'\');return false;">'+((b.length>25)?b.substr(0,24)+'...':b)+'</a>'+c}).replace(/\B\@([A-Z0-9_]{1,15})/gi,'@<a class="rrt-at" href="http://twitter.com/$1" onclick="window.open(\'http://twitter.com/$1\');return false;">$1</a>').replace(/\B\#([A-Z0-9_]+)/gi,'<a class="rrt-hashtag" href="http://search.twitter.com/search?q=%23$1" onclick="window.open(\'http://search.twitter.com/search?q=%23$1\');return false;">#$1</a>')};var decodeHTML=function(s){return s.replace(/&lt;/gi,'<').replace(/&gt;/gi,'>').replace(/&quot;/gi,'"')};var formatDate=function(dstr){var dat=new Date(),tody=new Date();dat.setTime(Date.parse(dstr));var td=tody.getDate(),tm=tody.getMonth()+1,ty=tody.getFullYear(),th=tody.getHours(),tmn=tody.getMinutes(),ts=tody.getSeconds();var d=dat.getDate(),m=dat.getMonth()+1,y=dat.getFullYear(),h=dat.getHours(),mn=dat.getMinutes(),s=dat.getSeconds();if(y==ty&&m==tm&&d==td){var dh=th-h;if(dh>0)return dh+' hour'+(dh>1?'s':'')+' ago';var dmn=tmn-mn;if(dmn>0)return dmn+' minute'+(dmn>1?'s':'')+' ago';var ds=ts-s;return ds+' second'+(ds>1?'s':'')+' ago'}else return d+'-'+m+'-'+y};var search=function(){var data={lang:op.lang,q:op.query,rpp:op.n,since_id:max_id};if(op.geocode)data.geocode=op.geocode;var url="http://search.twitter.com/search.json?rpp=50&callback=?&q=traaginternet";$.getJSON(url,function(json){searchLoaded(json)})};var init=function(){var tags=[];if(!op.query&&!op.status)$('a[rel="tag"]:lt('+op.max_tags+')').each(function(){var tag=$.trim($(this).text().replace(/\n/g,''));if($.inArray(tag,tags)==-1)tags[tags.length]=tag});if(tags.length>0)op.query=tags.join((op.or_tags?' OR ':' '));if(!op.query)op.query=op.default_query;if(op.from_users)op.query+=" from:"+op.from_users.replace(/\s/g,'').replace(/,/g,' OR from:');if(op.to_users)op.query+=" to:"+op.to_users.replace(/\s/g,'').replace(/,/g,' OR to:');if(op.at_users)op.query+=" @"+op.at_users.replace(/\s/g,'').replace(/,/g,' OR @');if(op.links_only)op.query+=' filter:links';search()};init()})}})(jQuery);jQuery(document).ready(function(){jQuery('div.related-tweets').relatedTweets()});

/**
 * @name MarkerClusterer
 * @version 1.0
 * @author Xiaoxi Wu
 * @copyright (c) 2009 Xiaoxi Wu
 * @fileoverview
 * This javascript library creates and manages per-zoom-level 
 * clusters for large amounts of markers (hundreds or thousands).
 * This library was inspired by the <a href="http://www.maptimize.com">
 * Maptimize</a> hosted clustering solution.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function MarkerClusterer(map,opt_markers,opt_opts){var clusters_=[];var map_=map;var maxZoom_=null;var me_=this;var gridSize_=60;var sizes=[53,56,66,78,90];var styles_=[];var leftMarkers_=[];var mcfn_=null;var i=0;for(i=1;i<=5;++i){styles_.push({'url':"http://gmaps-utility-library.googlecode.com/svn/trunk/markerclusterer/images/m"+i+".png",'height':sizes[i-1],'width':sizes[i-1]})}if(typeof opt_opts==="object"&&opt_opts!==null){if(typeof opt_opts.gridSize==="number"&&opt_opts.gridSize>0){gridSize_=opt_opts.gridSize}if(typeof opt_opts.maxZoom==="number"){maxZoom_=opt_opts.maxZoom}if(typeof opt_opts.styles==="object"&&opt_opts.styles!==null&&opt_opts.styles.length!==0){styles_=opt_opts.styles}}function addLeftMarkers_(){if(leftMarkers_.length===0){return}var leftMarkers=[];for(i=0;i<leftMarkers_.length;++i){me_.addMarker(leftMarkers_[i],true,null,null,true)}leftMarkers_=leftMarkers}this.getStyles_=function(){return styles_};this.clearMarkers=function(){for(var i=0;i<clusters_.length;++i){if(typeof clusters_[i]!=="undefined"&&clusters_[i]!==null){clusters_[i].clearMarkers()}}clusters_=[];leftMarkers_=[];GEvent.removeListener(mcfn_)};function isMarkerInViewport_(marker){return map_.getBounds().containsLatLng(marker.getLatLng())}function reAddMarkers_(markers){var len=markers.length;var clusters=[];for(var i=len-1;i>=0;--i){me_.addMarker(markers[i].marker,true,markers[i].isAdded,clusters,true)}addLeftMarkers_()}this.addMarker=function(marker,opt_isNodraw,opt_isAdded,opt_clusters,opt_isNoCheck){if(opt_isNoCheck!==true){if(!isMarkerInViewport_(marker)){leftMarkers_.push(marker);return}}var isAdded=opt_isAdded;var clusters=opt_clusters;var pos=map_.fromLatLngToDivPixel(marker.getLatLng());if(typeof isAdded!=="boolean"){isAdded=false}if(typeof clusters!=="object"||clusters===null){clusters=clusters_}var length=clusters.length;var cluster=null;for(var i=length-1;i>=0;i--){cluster=clusters[i];var center=cluster.getCenter();if(center===null){continue}center=map_.fromLatLngToDivPixel(center);if(pos.x>=center.x-gridSize_&&pos.x<=center.x+gridSize_&&pos.y>=center.y-gridSize_&&pos.y<=center.y+gridSize_){cluster.addMarker({'isAdded':isAdded,'marker':marker});if(!opt_isNodraw){cluster.redraw_()}return}}cluster=new Cluster(this,map);cluster.addMarker({'isAdded':isAdded,'marker':marker});if(!opt_isNodraw){cluster.redraw_()}clusters.push(cluster);if(clusters!==clusters_){clusters_.push(cluster)}};this.removeMarker=function(marker){for(var i=0;i<clusters_.length;++i){if(clusters_[i].remove(marker)){clusters_[i].redraw_();return}}};this.redraw_=function(){if(allowClusterRedraw==0)return;var clusters=this.getClustersInViewport_();for(var i=0;i<clusters.length;++i){clusters[i].redraw_(true)}};this.getClustersInViewport_=function(){var clusters=[];var curBounds=map_.getBounds();for(var i=0;i<clusters_.length;i++){if(clusters_[i].isInBounds(curBounds)){clusters.push(clusters_[i])}}return clusters};this.getMaxZoom_=function(){return maxZoom_};this.getMap_=function(){return map_};this.getGridSize_=function(){return gridSize_};this.getTotalMarkers=function(){var result=0;for(var i=0;i<clusters_.length;++i){result+=clusters_[i].getTotalMarkers()}return result};this.getTotalClusters=function(){return clusters_.length};this.resetViewport=function(){var clusters=this.getClustersInViewport_();var tmpMarkers=[];var removed=0;for(var i=0;i<clusters.length;++i){var cluster=clusters[i];var oldZoom=cluster.getCurrentZoom();if(oldZoom===null){continue}var curZoom=map_.getZoom();if(curZoom!==oldZoom){var mks=cluster.getMarkers();for(var j=0;j<mks.length;++j){var newMarker={'isAdded':false,'marker':mks[j].marker};tmpMarkers.push(newMarker)}cluster.clearMarkers();removed++;for(j=0;j<clusters_.length;++j){if(cluster===clusters_[j]){clusters_.splice(j,1)}}}}reAddMarkers_(tmpMarkers);this.redraw_()};this.addMarkers=function(markers){for(var i=0;i<markers.length;++i){this.addMarker(markers[i],true)}this.redraw_()};if(typeof opt_markers==="object"&&opt_markers!==null){this.addMarkers(opt_markers)}mcfn_=GEvent.addListener(map_,"moveend",function(){me_.resetViewport()})}function Cluster(markerClusterer){var center_=null;var markers_=[];var markerClusterer_=markerClusterer;var map_=markerClusterer.getMap_();var clusterMarker_=null;var zoom_=map_.getZoom();this.getMarkers=function(){return markers_};this.isInBounds=function(bounds){if(center_===null){return false}if(!bounds){bounds=map_.getBounds()}var sw=map_.fromLatLngToDivPixel(bounds.getSouthWest());var ne=map_.fromLatLngToDivPixel(bounds.getNorthEast());var centerxy=map_.fromLatLngToDivPixel(center_);var inViewport=true;var gridSize=markerClusterer.getGridSize_();if(zoom_!==map_.getZoom()){var dl=map_.getZoom()-zoom_;gridSize=Math.pow(2,dl)*gridSize}if(ne.x!==sw.x&&(centerxy.x+gridSize<sw.x||centerxy.x-gridSize>ne.x)){inViewport=false}if(inViewport&&(centerxy.y+gridSize<ne.y||centerxy.y-gridSize>sw.y)){inViewport=false}return inViewport};this.getCenter=function(){return center_};this.addMarker=function(marker){if(center_===null){center_=marker.marker.getLatLng()}markers_.push(marker)};this.removeMarker=function(marker){for(var i=0;i<markers_.length;++i){if(marker===markers_[i].marker){if(markers_[i].isAdded){map_.removeOverlay(markers_[i].marker)}markers_.splice(i,1);return true}}return false};this.getCurrentZoom=function(){return zoom_};this.redraw_=function(isForce){if(!isForce&&!this.isInBounds()){return}zoom_=map_.getZoom();var i=0;var mz=markerClusterer.getMaxZoom_();if(mz===null){mz=map_.getCurrentMapType().getMaximumResolution()}if(zoom_>=mz||this.getTotalMarkers()===1){for(i=0;i<markers_.length;++i){if(markers_[i].isAdded){if(markers_[i].marker.isHidden()){markers_[i].marker.show()}}else{map_.addOverlay(markers_[i].marker);markers_[i].isAdded=true}}if(clusterMarker_!==null){clusterMarker_.hide()}}else{for(i=0;i<markers_.length;++i){if(markers_[i].isAdded&&(!markers_[i].marker.isHidden())){markers_[i].marker.hide()}}if(clusterMarker_===null){clusterMarker_=new ClusterMarker_(center_,this.getTotalMarkers(),markerClusterer_.getStyles_(),markerClusterer_.getGridSize_());map_.addOverlay(clusterMarker_)}else{if(clusterMarker_.isHidden()){clusterMarker_.show()}clusterMarker_.redraw(true)}}};this.clearMarkers=function(){if(clusterMarker_!==null){map_.removeOverlay(clusterMarker_)}for(var i=0;i<markers_.length;++i){if(markers_[i].isAdded){map_.removeOverlay(markers_[i].marker)}}markers_=[]};this.getTotalMarkers=function(){return markers_.length}}function ClusterMarker_(latlng,count,styles,padding){var index=0;var dv=count;while(dv!==0){dv=parseInt(dv/10,10);index++}if(styles.length<index){index=styles.length}this.url_=styles[index-1].url;this.height_=styles[index-1].height;this.width_=styles[index-1].width;this.textColor_=styles[index-1].opt_textColor;this.anchor_=styles[index-1].opt_anchor;this.latlng_=latlng;this.index_=index;this.styles_=styles;this.text_=count;this.padding_=padding}ClusterMarker_.prototype=new GOverlay();ClusterMarker_.prototype.initialize=function(map){this.map_=map;var div=document.createElement("div");var latlng=this.latlng_;var pos=map.fromLatLngToDivPixel(latlng);pos.x-=parseInt(this.width_/2,10);pos.y-=parseInt(this.height_/2,10);var mstyle="";if(document.all){mstyle='filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="'+this.url_+'");'}else{mstyle="background:url("+this.url_+");"}if(typeof this.anchor_==="object"){if(typeof this.anchor_[0]==="number"&&this.anchor_[0]>0&&this.anchor_[0]<this.height_){mstyle+='height:'+(this.height_-this.anchor_[0])+'px;padding-top:'+this.anchor_[0]+'px;'}else{mstyle+='height:'+this.height_+'px;line-height:'+this.height_+'px;'}if(typeof this.anchor_[1]==="number"&&this.anchor_[1]>0&&this.anchor_[1]<this.width_){mstyle+='width:'+(this.width_-this.anchor_[1])+'px;padding-left:'+this.anchor_[1]+'px;'}else{mstyle+='width:'+this.width_+'px;text-align:center;'}}else{mstyle+='height:'+this.height_+'px;line-height:'+this.height_+'px;';mstyle+='width:'+this.width_+'px;text-align:center;'}var txtColor=this.textColor_?this.textColor_:'black';div.style.cssText=mstyle+'cursor:pointer;top:'+pos.y+"px;left:"+pos.x+"px;color:"+txtColor+";position:absolute;font-size:11px;"+'font-family:Arial,sans-serif;font-weight:bold';div.innerHTML=this.text_;map.getPane(G_MAP_MAP_PANE).appendChild(div);var padding=this.padding_;GEvent.addDomListener(div,"click",function(){var pos=map.fromLatLngToDivPixel(latlng);var sw=new GPoint(pos.x-padding,pos.y+padding);sw=map.fromDivPixelToLatLng(sw);var ne=new GPoint(pos.x+padding,pos.y-padding);ne=map.fromDivPixelToLatLng(ne);var zoom=map.getBoundsZoomLevel(new GLatLngBounds(sw,ne),map.getSize());map.setCenter(latlng,zoom)});this.div_=div};ClusterMarker_.prototype.remove=function(){this.div_.parentNode.removeChild(this.div_)};ClusterMarker_.prototype.copy=function(){return new ClusterMarker_(this.latlng_,this.index_,this.text_,this.styles_,this.padding_)};ClusterMarker_.prototype.redraw=function(force){if(!force){return}var pos=this.map_.fromLatLngToDivPixel(this.latlng_);pos.x-=parseInt(this.width_/2,10);pos.y-=parseInt(this.height_/2,10);this.div_.style.top=pos.y+"px";this.div_.style.left=pos.x+"px"};ClusterMarker_.prototype.hide=function(){this.div_.style.display="none"};ClusterMarker_.prototype.show=function(){this.div_.style.display=""};ClusterMarker_.prototype.isHidden=function(){return this.div_.style.display==="none"};

/*
 * Forwart Design website fontend
 *
 * Copyright (C) 2003-2010
 * Forwart Design
 * Author(s): Peter Arts, Grad van Horck
 * http://www.forwart.nl
 *
 * Date: 2010-04-07
 * Revision: 0001
 */
var geocoder;var map;var clickMapEventListener;var targetPoints=new Array();function mapInit(){if(GBrowserIsCompatible()){map=new GMap2(document.getElementById("gmap"));map.setCenter(new GLatLng(52.18958,5.29524),7);map.addControl(new GSmallMapControl());map.disableScrollWheelZoom();var mapType=G_PHYSICAL_MAP;mapType.getMaximumResolution=function(latlng){return 15};mapType.getMinimumResolution=function(latlng){return 7};map.setMapType(mapType)}else{$('div#gmap').html('<p class="error">De browser die je gebruikt kan niet overweg met Google Maps. Gebruik s.v.p. een recente browser.</p>')}}function addPointsDisable(){targetPoints.splice(0,targetPoints.length);targetPoints=new Array();writePoints();$('div#gmap div.msg').fadeOut();map.clearOverlays();allowClusterRedraw=1;map.getDragObject().setDraggableCursor('url(http://maps.gstatic.com/intl/en_ALL/mapfiles/openhand_8_8.cur), default');GEvent.removeListener(clickMapEventListener);map.setCenter(new GLatLng(52.18958,5.29524),7)}function addPointsEnable(){map.clearOverlays();allowClusterRedraw=0;map.getDragObject().setDraggableCursor("crosshair");geocoder=new GClientGeocoder();if($('div#gmap div.msg').length==0){$('div#gmap').append('<div class="msg"></div>');$('div#gmap div.msg').html('Selecteer s.v.p. &eacute;&eacute;n of meerdere punten om aan te geven waar je traag internet ervaart.')}setTimeout(function(){$('div#gmap div.msg').fadeOut()},6000);clickMapEventListener=GEvent.bind(map,"click",this,function(overlay,latlng){if(latlng){if((targetPoints.length-removeCount)<5){$('#map_response p.msg').fadeOut();addLocation(latlng)}else{$('#map_response p.msg').html("Op dit moment kun je per melding maximaal 5 punten aanklikken. Je kunt later een nieuwe melding invoeren of een ander punt verwijderen door erop te klikken.").fadeOut().fadeIn()}}});map.setCenter(new GLatLng(52.18958,5.29524),7)}function addLocation(latlng){geocoder.getLocations(latlng,addAddressToMap)}function addAddressToMap(response){if(!response||response.Status.code!=200){$('#map_response p.msg').html("We kunnen geen plaats bepalen bij het aangeklikte punt.").fadeOut().fadeIn().fadeOut(4000);return}place=response.Placemark[0];point=new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);if(place.AddressDetails.Country.CountryNameCode!='NL'){$('#map_response p.msg').html("Het aangeklikte punt bevindt zich niet in Nederland.").fadeOut().fadeIn().fadeOut().fadeIn().fadeOut(4000);return}for(key in targetPoints){if(targetPoints[key][2]==place.Point.coordinates){return}}var postalCode='';var cityName='';var marker=new GMarker(point);map.addOverlay(marker);if(place.AddressDetails.Country.AdministrativeArea.Locality.DependentLocality){cityName=place.AddressDetails.Country.AdministrativeArea.Locality.DependentLocality.DependentLocalityName}else{cityName=place.AddressDetails.Country.AdministrativeArea.Locality.LocalityName}var uPoint=new Array(cityName,marker,place.Point.coordinates);var index=targetPoints.push(uPoint);writePoints();GEvent.addListener(marker,"click",function(){marker.openInfoWindowHtml("<div class='marker'><span class='minilogo'>Traag internet in: </span><strong>"+cityName+"</strong><br /><span style='float:right;'>[ <a href='#' onclick='removeUpoint("+(index-1)+");'>verwijder punt</a> ]</span></div>",{maxWidth:220})})}var removeCount=0;function removeUpoint(index){map.removeOverlay(targetPoints[index][1]);targetPoints[index]='[=]';removeCount++;writePoints()}function writePoints(){$('#map_response p.points').empty();for(var i=0;i<targetPoints.length;i++){if(targetPoints[i]!='[=]'){$('#map_response p.points').append('Plaats: <a href="#" onclick="GEvent.trigger(targetPoints['+i+'][1], \'click\');">'+targetPoints[i][0]+'</a><br />')}}}function submitReport(){var form=$('form#addReport');if(form.find('input[name*=point]').length>0){form.find('input[name*=point]').remove();form.find('input[name*=pointlat]').remove();form.find('input[name*=pointlng]').remove()}$.each(targetPoints,function(key,value){if(value!='[=]'){form.find('fieldset').append('<input type="hidden" name="point[]" value="'+value[0]+'" />');form.find('fieldset').append('<input type="hidden" name="pointlat[]" value="'+value[2][1]+'" />');form.find('fieldset').append('<input type="hidden" name="pointlng[]" value="'+value[2][0]+'" />')}});var check=form.find('input[name=email]').attr('value');if(!checkEmail(check)){$('#map_response p.msg').html("Vul s.v.p. een geldig e-mail adres in.").fadeOut().fadeIn()}check=form.find('select[name=provider]').attr('value');if(check<=0){$('#map_response p.msg').html("Selecteer je aanbieder of kieze voor overige aanbieder en specificeer de naam van de aanbieder in het tekstvak.").fadeOut().fadeIn()}var formData=form.serialize();if($('#submitReportLoad').length==0){form.prepend('<span class="loading" id="submitReportLoad">Bezig met verzenden...</span>').show()}else{$('#submitReportLoad').fadeIn()}$.post('/submit-report',formData,function(data){$('#submitReportLoad').fadeOut();if(data=='OK'){form.slideUp().after('<p>Bedankt voor je bijdrage. Klik s.v.p. op de link in het e-mail bericht dat je zometeen ontvangt om de melding actief te maken.</p><p><strong>Twitter dit</strong>! <a href="#" onclick="window.open(\'http://twitter.com/home?status=Ik+heb+zojuist+mijn+trage+internetverbinding+gemeld+op+http%3A%2F%2Ftraag-internet.nl+%23traaginternet&in_reply_to=traaginternet\');return false;" title="Twitter dit!">Klik hier om je followers te laten weten dat je een melding op deze website hebt doorgegeven</a>.</p>');$('div#gmap').removeClass('add');addPointsDisable()}else{$('#map_response p.msg').html(data).fadeIn()}})}function checkEmail(value){return/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value)}var allowClusterRedraw=0;function loadMarkers(){GDownloadUrl("get-markers?t="+Math.round(new Date().getTime()/1000),function(data){var json=jQuery.parseJSON(data);var markers=[];allowClusterRedraw=1;for(var i=0;i<json.length;i++){var point=new GLatLng(parseFloat(json[i].gps_lat),parseFloat(json[i].gps_lng));var marker=new GMarker(point);GEvent.addListener(marker,"click",function(){var mark=this;geocoder=new GClientGeocoder();geocoder.getLocations(this.getPoint(),function(response){if(response&&response.Status.code==200){var place=response.Placemark[0];var pointDetail=place.address.replace(', Nederland','');if(place.AddressDetails.Country.AdministrativeArea.Locality.DependentLocality){cityName=place.AddressDetails.Country.AdministrativeArea.Locality.DependentLocality.DependentLocalityName}else{cityName=place.AddressDetails.Country.AdministrativeArea.Locality.LocalityName}mark.openInfoWindowHtml("<div class='marker'><span class='minilogo'>Traag internet in: </span><strong>"+cityName+"</strong><br />"+pointDetail+"</div>",{maxWidth:220})}})});markers.push(marker)}var mcOptions={gridSize:50,maxZoom:15};var clusterer=MarkerClusterer(map,markers,mcOptions)})}function showNotification(type,message){var n=$('<div id="notification" class="'+type+'">'+message+'</div>');var close=$('<div class="close"><a href="/">[sluiten]</a></div>');close.children('a').bind('click',function(){n.fadeOut();return false});n.prepend(close);n.hide();$('#wrapper').append(n);n.fadeIn()}$(document).ready(function(){$('a[rel*=blank]').click(function(e){e.preventDefault();window.open($(this).attr('href'))});$('a[rel*=nofollow]').click(function(e){e.preventDefault();window.open($(this).attr('href'))});mapInit();loadMarkers();$('div#sidebar div.tab h2').click(function(){if(!$(this).hasClass('active')){var target=$(this);if(target.next('ul').length==0)return;var active=$('div#sidebar div.tab h2.active');if(active.length>0){$('div#sidebar div.tab h2.active').removeClass('active').next('ul').slideUp(200,function(){target.addClass('active').next('ul').slideDown(600)})}else{target.addClass('active').next('ul').slideDown(600)}}});$('div#add_trigger').click(function(){$('div#add').fadeIn();if($('div#add div#providers').html()==''){$('div#add div#providers').html('<span class="loading">Laden...</span>');$('div#add div#providers').load('/get-providers')}$('div#gmap').addClass('add');addPointsEnable()});$('a#close_add').click(function(e){e.preventDefault();if((targetPoints.length>0)&&!confirm('Weet je zeker dat je wilt annuleren? Aangeklikte punten gaan dan verloren.')){return}$('div#add').fadeOut();$('div#gmap').removeClass('add');addPointsDisable()});setTimeout(function(){$('div#sidebar div.tab:first').find('h2').click()},1000);$('#rrt').relatedTweets()});
