var map;
var markerManager;
var data2;
var current;
var woord;
var colors = new Array(
	'red',
	'green',
	'blue',
	'yellow',
	'orange',
	'pink',
	'lightblue',
	'206',
	'210',
	'214',
	'002',
	'006',
	'010',
	'022',
	'033',
	'051',
	'079',
	'105',
	'133',
	'136',
	'162',
	'196',
	'216'
	
);

/**
 * Display All
 */
function displayAll () {
	for (var i = 0; i < data2.length; ++i) {
		displayMarkers(i);
	}
}

/**
 * Focus Woord
 */
function focusWoord (i) {
	if (i == current) {
		return;
	}

	markerManager.clearMarkers();

	$('#dialect_woord_' + current).hide("slow");
	$('#dialect_woord_' + i).show("slow");

	displayMarkers(i);

	current = i;
}

/**
 * Apply Criteria
 */
function applyCriteria () {
	var criteria = new Array();
	var mogelijkheden = new Array();
	var i = 0;

	markerManager.clearMarkers();

	$('#criteria input').each(function (index, element) {
		if (element.checked) {
			criteria[i] = element.name;
			mogelijkheden[i] = element.value;
			++i;
		}
	});

	for (var j = 0; j < data2.length; ++j) {
		var display = true;

		for (var k = 0; k < criteria.length; ++k) {
			var found = false;

			for (var l = 0; l < data2[j].criteria.length; ++l) {
				if (criteria[k] == data2[j].criteria[l].criterium.criterium_id) {
					for (var m = 0; m < data2[j].criteria[l].mogelijkheden.length; ++m) {
						if (mogelijkheden[k] == data2[j].criteria[l].mogelijkheden[m].mogelijkheid_id) {
							found = true;
						}
					}
				}
			}

			if (!found) {
				display = false;
				break;
			}
		}

		if (display) {
			displayMarkers(j);
		}
	}
}

/**
 * Reset Criteria
 */
function resetCriteria () {
	$('#criteria input').each(function (index, element) {
		if ($(element).attr('checked')) {
			$(element).removeAttr('checked');
		}
	});
}

/**
 * Display Markers
 */
function displayMarkers (i) {
	var criteria = '';

	for (var k = 0; k < data2[i].criteria.length; ++k) {
		criteria += '<strong>' + data2[i].criteria[k].criterium.criterium_name + ':</strong> ';
					
		for (var m = 0; m < data2[i].criteria[k].mogelijkheden.length; ++m) {
			if (m != 0) {
				criteria += ', ';
			}

			criteria += data2[i].criteria[k].mogelijkheden[m].mogelijkheid;
		}
					
		criteria += '<br />';
	}

	for (var k = 0; k < data2[i].locaties.length; ++k) {
		var Icon = new GIcon(G_DEFAULT_ICON, pad + 'taalkaart/assets/img/markers/' + colors[i%colors.length] + '.png');
		//Icon.mozPrintImage = '/taalkaart/assets/img/markers/1gif.gif';
		Icon.printImage = 'taalkaart/assets/img/markers/' + colors[i%colors.length] + 'ie.gif';
		//Icon.printImage = 'taalkaart/assets/img/markers/redie.gif';
		var marker = new GMarker(
			new google.maps.LatLng(
				data2[i].locaties[k].lengtegraad,
				data2[i].locaties[k].breedtegraad
			), {
				icon: Icon
			}
		);

		marker.bindInfoWindow('<strong>' + data2[i].woord + '</strong><br />' + data2[i].locaties[k].toelichting + '<br />' + criteria);
		markerManager.addMarker(marker, 0);
	}

	markerManager.refresh();
}

/**
 * Replace Woorden
 */
function replaceWoorden (e) {
	if($('#nederlands_woord').attr('value').length!=0) {
		woord = $('#nederlands_woord').attr('value');
	}
	else if (e != ''){
		woord = e;
	}

	$.get(pad + 'ajax/dialect_woorden.php?q=' + woord, null, function (data, textStatus) {
		data2 = data;
		resetCriteria();
		$('#woord_nl').html('<p>Gezocht naar: <span class="search_word">' + woord + '</span></p>');
		$('#dialect_woorden').html('');
		markerManager.clearMarkers();
		
		var lastData = data2.length - 1;	
		
		for (var i = 0; i < data2.length; ++i) {
			var criteria = '';
			var plaatsen = '';

			for (var k = 0; k < data2[i].criteria.length; ++k) {
				criteria += '<strong>' + data2[i].criteria[k].criterium.criterium_name + ':</strong> ';
							
				for (var m = 0; m < data2[i].criteria[k].mogelijkheden.length; ++m) {
					if (m != 0) {
						criteria += ', ';
					}
		
					criteria += data2[i].criteria[k].mogelijkheden[m].mogelijkheid;
				}
							
				criteria += '<br />';
			}
	
			for (var k = 0; k < data2[i].locaties.length; ++k) {
				var Icon = new GIcon(G_DEFAULT_ICON, pad + 'taalkaart/assets/img/markers/' + colors[i%colors.length] + '.png');
				Icon.printImage = 'taalkaart/assets/img/markers/' + colors[i%colors.length] + 'ie.gif';
				//Icon.printImage = 'taalkaart/assets/img/markers/redie.gif';
				var marker = new GMarker(
					new google.maps.LatLng(
						data2[i].locaties[k].lengtegraad,
						data2[i].locaties[k].breedtegraad
					), {
						icon: Icon
					}
				);
						
				plaatsen += '<li>' + data2[i].locaties[k].plaats + '</li>';
		
				marker.bindInfoWindow('<strong>' + data2[i].woord + '</strong><br />' + data2[i].locaties[k].toelichting + '<br />' + criteria);
				markerManager.addMarker(marker, 0);
			}
			
			
			if(i==lastData)
			{
				$('#opmerkingValue').html('<p>' + data2[i].opmerking + '</p>');
			}
			
			
			$('#dialect_woorden').html($('#dialect_woorden').html() + ('<li class="' + colors[i%colors.length] + '"><img src="' + pad + 'taalkaart/assets/img/markers/' + colors[i%colors.length] + '.png" /><p onclick="focusWoord(' + i + ');" onmouseover="this.style.cursor = \'pointer\'">' + data2[i].woord + '</p><ul id="dialect_woord_' + i + '" class="plaatsen">' + plaatsen + '</ul></li>'));
		}

		markerManager.refresh();
		$('#dialect_woorden').html($('#dialect_woorden').html());
		$('#woord_nl').html($('#woord_nl').html());
	}, 'json');

	document.getElementById("nederlands_woord").value = "";
}

/**
 * Initialize
 */
function initialize() {
	$('#nederlands_woord').autocomplete(null, {minChars: 0, url: pad + 'ajax/woorden.php'});
	$('#submit_nederlands_woord').bind('click', null, replaceWoorden);
	$('#nederlands_woord').bind('keypress', null, function (e) {
		if (e.which == 13) {
			replaceWoorden();
		}
	});

	var latlngs = new Array(
		new google.maps.LatLng(53.105980054058676, 6.634883880615234),
		new google.maps.LatLng(53.110205086531366, 6.636943817138672),
		new google.maps.LatLng(53.11164768548236, 6.635398864746094),
		new google.maps.LatLng(53.112781122136006, 6.636257171630859),
		new google.maps.LatLng(53.1146357722166, 6.633338928222656),
		new google.maps.LatLng(53.115253971132816, 6.628875732421875),
		new google.maps.LatLng(53.117005486459036, 6.627674102783203),
		new google.maps.LatLng(53.11937507009121, 6.630764007568359),
		new google.maps.LatLng(53.11999320086315, 6.629390716552734),
		new google.maps.LatLng(53.123392761234726, 6.626644134521484),
		new google.maps.LatLng(53.12782208800838, 6.6213226318359375),
		new google.maps.LatLng(53.13039706814956, 6.618404388427734),
		new google.maps.LatLng(53.131530010531854, 6.618919372558594),
		new google.maps.LatLng(53.132971893999084, 6.616859436035156),
		new google.maps.LatLng(53.13276591360896, 6.613941192626953),
		new google.maps.LatLng(53.1357525326208, 6.6144561767578125),
		new google.maps.LatLng(53.138224060321306, 6.610507965087891),
		new google.maps.LatLng(53.13935679633247, 6.606903076171875),
		new google.maps.LatLng(53.144608182129, 6.599521636962891),
		new google.maps.LatLng(53.14399040535813, 6.595916748046875),
		new google.maps.LatLng(53.14522595001395, 6.595401763916016),
		new google.maps.LatLng(53.14502002837294, 6.590080261230469),
		new google.maps.LatLng(53.145431870667636, 6.587848663330078),
		new google.maps.LatLng(53.148108749320514, 6.587505340576172),
		new google.maps.LatLng(53.153564946780364, 6.584587097167969),
		new google.maps.LatLng(53.1545943402534, 6.584415435791016),
		new google.maps.LatLng(53.15613838418693, 6.5869903564453125),
		new google.maps.LatLng(53.157682372590045, 6.584930419921875),
		new google.maps.LatLng(53.15788823351487, 6.583385467529297),
		new google.maps.LatLng(53.15953508537486, 6.583385467529297),
		new google.maps.LatLng(53.16118187405575, 6.581668853759766),
		new google.maps.LatLng(53.16200524470436, 6.581840515136719),
		new google.maps.LatLng(53.16231400462561, 6.580467224121094),
		new google.maps.LatLng(53.16324027106289, 6.581153869628906),
		new google.maps.LatLng(53.157579441757434, 6.563472747802734),
		new google.maps.LatLng(53.16982647814065, 6.558837890625),
		new google.maps.LatLng(53.175279915771824, 6.554203033447266),
		new google.maps.LatLng(53.175279915771824, 6.553001403808594),
		new google.maps.LatLng(53.18093841064469, 6.5485382080078125),
		new google.maps.LatLng(53.178726542417365, 6.542701721191406),
		new google.maps.LatLng(53.17841790057368, 6.535062789916992),
		new google.maps.LatLng(53.19580126354454, 6.529397964477539),
		new google.maps.LatLng(53.198423585190405, 6.516008377075195),
		new google.maps.LatLng(53.19790941711878, 6.515064239501953),
		new google.maps.LatLng(53.198937747094654, 6.509056091308594),
		new google.maps.LatLng(53.2001202960694, 6.506996154785156),
		new google.maps.LatLng(53.19811508508752, 6.496524810791016),
		new google.maps.LatLng(53.19816650192552, 6.494464874267578),
		new google.maps.LatLng(53.19862925069218, 6.492919921875),
		new google.maps.LatLng(53.20094291959256, 6.492404937744141),
		new google.maps.LatLng(53.20294799828711, 6.488971710205078),
		new google.maps.LatLng(53.203770567539344, 6.4881134033203125),
		new google.maps.LatLng(53.203873387585794, 6.480388641357422),
		new google.maps.LatLng(53.20048019580346, 6.463222503662109),
		new google.maps.LatLng(53.19718957145726, 6.448802947998047),
		new google.maps.LatLng(53.188241909458405, 6.443996429443359),
		new google.maps.LatLng(53.18711046289337, 6.440219879150391),
		new google.maps.LatLng(53.18536180493618, 6.437644958496094),
		new google.maps.LatLng(53.18567039681577, 6.435756683349609),
		new google.maps.LatLng(53.18556753310264, 6.434125900268555),
		new google.maps.LatLng(53.18433314930021, 6.432065963745117),
		new google.maps.LatLng(53.18335590359261, 6.430263519287109),
		new google.maps.LatLng(53.18284155480246, 6.427431106567383),
		new google.maps.LatLng(53.182224328112014, 6.425457000732422),
		new google.maps.LatLng(53.18155565584039, 6.424341201782227),
		new google.maps.LatLng(53.18119559722236, 6.420564651489258),
		new google.maps.LatLng(53.18016684165888, 6.418247222900391),
		new google.maps.LatLng(53.17965245462434, 6.416187286376953),
		new google.maps.LatLng(53.17985821017838, 6.415157318115234),
		new google.maps.LatLng(53.17893230241279, 6.411123275756836),
		new google.maps.LatLng(53.17852078143498, 6.410951614379883),
		new google.maps.LatLng(53.17821213811081, 6.40751838684082),
		new google.maps.LatLng(53.17666888817896, 6.40528678894043),
		new google.maps.LatLng(53.17455969015246, 6.404428482055664),
		new google.maps.LatLng(53.17260473109397, 6.403827667236328),
		new google.maps.LatLng(53.1701866321902, 6.403913497924805),
		new google.maps.LatLng(53.168540189001156, 6.403913497924805),
		new google.maps.LatLng(53.166893682638815, 6.402111053466797),
		new google.maps.LatLng(53.16514420040849, 6.398763656616211),
		new google.maps.LatLng(53.16354902209986, 6.394901275634766),
		new google.maps.LatLng(53.16205670484548, 6.393098831176758),
		new google.maps.LatLng(53.159895325797365, 6.39155387878418),
		new google.maps.LatLng(53.159689474497554, 6.390094757080078),
		new google.maps.LatLng(53.158557274702794, 6.389923095703125),
		new google.maps.LatLng(53.15773383791379, 6.388120651245117),
		new google.maps.LatLng(53.153564946780364, 6.381340026855469),
		new google.maps.LatLng(53.1496530264914, 6.381425857543945),
		new google.maps.LatLng(53.14960155148045, 6.3823699951171875),
		new google.maps.LatLng(53.13966571915176, 6.376447677612305),
		new google.maps.LatLng(53.12210508060531, 6.365633010864258),
		new google.maps.LatLng(53.10747432030009, 6.363487243652344),
		new google.maps.LatLng(53.1071136400986, 6.356878280639648),
		new google.maps.LatLng(53.105980054058676, 6.355762481689453),
		new google.maps.LatLng(53.08711692100424, 6.344261169433594),
		new google.maps.LatLng(53.0940755966723, 6.315164566040039),
		new google.maps.LatLng(53.081085158534364, 6.305122375488281),
		new google.maps.LatLng(53.067368775341656, 6.367692947387695),
		new google.maps.LatLng(53.033936138891946, 6.362457275390625),
		new google.maps.LatLng(52.97169690489081, 6.427516937255859),
		new google.maps.LatLng(52.93291347754709, 6.393699645996094),
		new google.maps.LatLng(52.90600321605871, 6.3329315185546875),
		new google.maps.LatLng(52.92504913083215, 6.3027191162109375),
		new google.maps.LatLng(52.92753276309978, 6.2567138671875),
		new google.maps.LatLng(52.9240142420002, 6.246757507324219),
		new google.maps.LatLng(52.91883942676673, 6.2436676025390625),
		new google.maps.LatLng(52.91345696284071, 6.231651306152344),
		new google.maps.LatLng(52.88984903106573, 6.205902099609375),
		new google.maps.LatLng(52.8736888238234, 6.162300109863281),
		new google.maps.LatLng(52.85482763597397, 6.1200714111328125),
		new google.maps.LatLng(52.84840052378115, 6.128654479980469),
		new google.maps.LatLng(52.84425349476003, 6.130027770996094),
		new google.maps.LatLng(52.83305453774939, 6.145133972167969),
		new google.maps.LatLng(52.81604319154933, 6.169166564941406),
		new google.maps.LatLng(52.81438319143107, 6.176719665527344),
		new google.maps.LatLng(52.79342023692752, 6.202125549316406),
		new google.maps.LatLng(52.774939553453855, 6.176719665527344),
		new google.maps.LatLng(52.77265487903398, 6.171226501464844),
		new google.maps.LatLng(52.76766971862722, 6.1681365966796875),
		new google.maps.LatLng(52.76600787164062, 6.160926818847656),
		new google.maps.LatLng(52.7626839873847, 6.156463623046875),
		new google.maps.LatLng(52.75894431432526, 6.136894226074219),
		new google.maps.LatLng(52.75790545926437, 6.127281188964844),
		new google.maps.LatLng(52.75437316671497, 6.1200714111328125),
		new google.maps.LatLng(52.75063278003463, 6.1200714111328125),
		new google.maps.LatLng(52.71092333526231, 6.145477294921875),
		new google.maps.LatLng(52.69282379680006, 6.1571502685546875),
		new google.maps.LatLng(52.69178336534999, 6.161441802978516),
		new google.maps.LatLng(52.688765973933684, 6.164703369140625),
		new google.maps.LatLng(52.68866192223463, 6.167106628417969),
		new google.maps.LatLng(52.6867889492525, 6.170539855957031),
		new google.maps.LatLng(52.679816621541825, 6.162815093994141),
		new google.maps.LatLng(52.677631035975715, 6.171913146972656),
		new google.maps.LatLng(52.67523717392846, 6.181182861328125),
		new google.maps.LatLng(52.67742287926603, 6.184101104736328),
		new google.maps.LatLng(52.68158582500139, 6.179981231689453),
		new google.maps.LatLng(52.68262649944353, 6.185646057128906),
		new google.maps.LatLng(52.679816621541825, 6.187877655029297),
		new google.maps.LatLng(52.679192179681635, 6.1928558349609375),
		new google.maps.LatLng(52.68543619658095, 6.191654205322266),
		new google.maps.LatLng(52.68606054917485, 6.194744110107422),
		new google.maps.LatLng(52.687205172413364, 6.1956024169921875),
		new google.maps.LatLng(52.6847077739394, 6.204700469970703),
		new google.maps.LatLng(52.68501995655923, 6.2120819091796875),
		new google.maps.LatLng(52.6862686647225, 6.213970184326172),
		new google.maps.LatLng(52.68606054917485, 6.218605041503906),
		new google.maps.LatLng(52.68429152697491, 6.219120025634766),
		new google.maps.LatLng(52.68356308524067, 6.222209930419922),
		new google.maps.LatLng(52.68168989356146, 6.226158142089844),
		new google.maps.LatLng(52.68179396187352, 6.232509613037109),
		new google.maps.LatLng(52.67929625394492, 6.233539581298828),
		new google.maps.LatLng(52.67752695774488, 6.238517761230469),
		new google.maps.LatLng(52.67898403041115, 6.242637634277344),
		new google.maps.LatLng(52.67606983647568, 6.247272491455078),
		new google.maps.LatLng(52.67430040959238, 6.248302459716797),
		new google.maps.LatLng(52.672947270089935, 6.246585845947266),
		new google.maps.LatLng(52.67128181009286, 6.250019073486328),
		new google.maps.LatLng(52.67024086535617, 6.253795623779297),
		new google.maps.LatLng(52.66982448051777, 6.258087158203125),
		new google.maps.LatLng(52.67013676951855, 6.261005401611328),
		new google.maps.LatLng(52.66909579750283, 6.265296936035156),
		new google.maps.LatLng(52.66659736348296, 6.266498565673828),
		new google.maps.LatLng(52.66503576968076, 6.269588470458984),
		new google.maps.LatLng(52.665556307148215, 6.2738800048828125),
		new google.maps.LatLng(52.66784659834868, 6.275768280029297),
		new google.maps.LatLng(52.66899169893728, 6.278858184814453),
		new google.maps.LatLng(52.66795069964218, 6.283836364746094),
		new google.maps.LatLng(52.66389056542801, 6.28692626953125),
		new google.maps.LatLng(52.66222476021814, 6.292247772216797),
		new google.maps.LatLng(52.66284944461211, 6.296024322509766),
		new google.maps.LatLng(52.66628504918656, 6.296710968017578),
		new google.maps.LatLng(52.66638915420003, 6.299629211425781),
		new google.maps.LatLng(52.66753429298023, 6.3027191162109375),
		new google.maps.LatLng(52.66659736348296, 6.305980682373047),
		new google.maps.LatLng(52.66836710233616, 6.314048767089844),
		new google.maps.LatLng(52.670449056287424, 6.3191986083984375),
		new google.maps.LatLng(52.670449056287424, 6.324520111083984),
		new google.maps.LatLng(52.66628504918656, 6.3288116455078125),
		new google.maps.LatLng(52.66284944461211, 6.325550079345703),
		new google.maps.LatLng(52.65899708194756, 6.326923370361328),
		new google.maps.LatLng(52.65493611590031, 6.334476470947266),
		new google.maps.LatLng(52.654727851062205, 6.340484619140625),
		new google.maps.LatLng(52.649625052612684, 6.346321105957031),
		new google.maps.LatLng(52.64847944457791, 6.352500915527344),
		new google.maps.LatLng(52.64650059637081, 6.353702545166016),
		new google.maps.LatLng(52.64462581546951, 6.3617706298828125),
		new google.maps.LatLng(52.64233430744707, 6.364688873291016),
		new google.maps.LatLng(52.63858430807344, 6.362800598144531),
		new google.maps.LatLng(52.63566741962704, 6.36932373046875),
		new google.maps.LatLng(52.632125222186644, 6.36932373046875),
		new google.maps.LatLng(52.62931209639509, 6.373958587646484),
		new google.maps.LatLng(52.62410212661482, 6.373958587646484),
		new google.maps.LatLng(52.620246349661215, 6.3768768310546875),
		new google.maps.LatLng(52.61764090267856, 6.376361846923828),
		new google.maps.LatLng(52.61555643344044, 6.379451751708984),
		new google.maps.LatLng(52.61555643344044, 6.3823699951171875),
		new google.maps.LatLng(52.61232530998123, 6.383914947509766),
		new google.maps.LatLng(52.617224016770706, 6.39404296875),
		new google.maps.LatLng(52.616286008963186, 6.4029693603515625),
		new google.maps.LatLng(52.61795356450421, 6.406059265136719),
		new google.maps.LatLng(52.620558992878436, 6.406402587890625),
		new google.maps.LatLng(52.62170533223729, 6.410350799560547),
		new google.maps.LatLng(52.61868310008009, 6.414299011230469),
		new google.maps.LatLng(52.619412623498405, 6.418418884277344),
		new google.maps.LatLng(52.62285164157529, 6.4208221435546875),
		new google.maps.LatLng(52.62493576345979, 6.426658630371094),
		new google.maps.LatLng(52.62743657872523, 6.427001953125),
		new google.maps.LatLng(52.628686932769725, 6.431121826171875),
		new google.maps.LatLng(52.62535257592787, 6.432666778564453),
		new google.maps.LatLng(52.62128848503485, 6.435585021972656),
		new google.maps.LatLng(52.619933704210986, 6.4345550537109375),
		new google.maps.LatLng(52.61639023304538, 6.439189910888672),
		new google.maps.LatLng(52.61534798105803, 6.4469146728515625),
		new google.maps.LatLng(52.6142014752139, 6.452922821044922),
		new google.maps.LatLng(52.61607756005443, 6.45721435546875),
		new google.maps.LatLng(52.61639023304538, 6.459789276123047),
		new google.maps.LatLng(52.6204547787208, 6.462192535400391),
		new google.maps.LatLng(52.62368530223796, 6.464252471923828),
		new google.maps.LatLng(52.62503996694896, 6.470603942871094),
		new google.maps.LatLng(52.62326847389146, 6.473865509033203),
		new google.maps.LatLng(52.6207674204494, 6.475582122802734),
		new google.maps.LatLng(52.61857888145644, 6.481418609619141),
		new google.maps.LatLng(52.619412623498405, 6.488456726074219),
		new google.maps.LatLng(52.61784934414378, 6.499271392822266),
		new google.maps.LatLng(52.616181784632865, 6.505451202392578),
		new google.maps.LatLng(52.61461838990366, 6.5100860595703125),
		new google.maps.LatLng(52.61378455655418, 6.5183258056640625),
		new google.maps.LatLng(52.64650059637081, 6.513690948486328),
		new google.maps.LatLng(52.66316178346096, 6.545448303222656),
		new google.maps.LatLng(52.66545220015074, 6.552143096923828),
		new google.maps.LatLng(52.67430040959238, 6.614284515380859),
		new google.maps.LatLng(52.65410305059522, 6.682949066162109),
		new google.maps.LatLng(52.648791886109336, 6.7078399658203125),
		new google.maps.LatLng(52.646083985338116, 6.705436706542969),
		new google.maps.LatLng(52.64358423579714, 6.705436706542969),
		new google.maps.LatLng(52.64191765672587, 6.70166015625),
		new google.maps.LatLng(52.64056351447151, 6.705436706542969),
		new google.maps.LatLng(52.63629248352393, 6.702861785888672),
		new google.maps.LatLng(52.63368799170261, 6.704235076904297),
		new google.maps.LatLng(52.63014563400263, 6.702003479003906),
		new google.maps.LatLng(52.62754077626012, 6.70166015625),
		new google.maps.LatLng(52.628270152057674, 6.705780029296875),
		new google.maps.LatLng(52.62754077626012, 6.709728240966797),
		new google.maps.LatLng(52.63035401592367, 6.715221405029297),
		new google.maps.LatLng(52.63316707473261, 6.726551055908203),
		new google.maps.LatLng(52.63795927692179, 6.730499267578125),
		new google.maps.LatLng(52.64035518117301, 6.736164093017578),
		new google.maps.LatLng(52.64556321596617, 6.742000579833984),
		new google.maps.LatLng(52.64566737033666, 6.749897003173828),
		new google.maps.LatLng(52.646083985338116, 6.754188537597656),
		new google.maps.LatLng(52.648791886109336, 6.758480072021484),
		new google.maps.LatLng(52.64712550547839, 6.767234802246094),
		new google.maps.LatLng(52.65014577361598, 6.7710113525390625),
		new google.maps.LatLng(52.65264514811467, 6.781654357910156),
		new google.maps.LatLng(52.652853422873996, 6.790065765380859),
		new google.maps.LatLng(52.65077063063463, 6.794700622558594),
		new google.maps.LatLng(52.65222859561964, 6.8025970458984375),
		new google.maps.LatLng(52.6509789143232, 6.805858612060547),
		new google.maps.LatLng(52.64889603279042, 6.807403564453125),
		new google.maps.LatLng(52.647958703731284, 6.819248199462891),
		new google.maps.LatLng(52.648687739180225, 6.826114654541016),
		new google.maps.LatLng(52.65129133799579, 6.831779479980469),
		new google.maps.LatLng(52.65170789942009, 6.838130950927734),
		new google.maps.LatLng(52.648791886109336, 6.851692199707031),
		new google.maps.LatLng(52.65014577361598, 6.864738464355469),
		new google.maps.LatLng(52.65306169664117, 6.8726348876953125),
		new google.maps.LatLng(52.65056234595391, 6.88018798828125),
		new google.maps.LatLng(52.65170789942009, 6.897010803222656),
		new google.maps.LatLng(52.647958703731284, 6.903362274169922),
		new google.maps.LatLng(52.64650059637081, 6.914176940917969),
		new google.maps.LatLng(52.64202181977826, 6.915378570556641),
		new google.maps.LatLng(52.63973017532399, 6.918468475341797),
		new google.maps.LatLng(52.63920933029471, 6.9316864013671875),
		new google.maps.LatLng(52.63785510419495, 6.939754486083984),
		new google.maps.LatLng(52.63920933029471, 6.945590972900391),
		new google.maps.LatLng(52.63910516054466, 6.953315734863281),
		new google.maps.LatLng(52.641501002035774, 6.9591522216796875),
		new google.maps.LatLng(52.64223014513886, 6.967906951904297),
		new google.maps.LatLng(52.646083985338116, 6.9756317138671875),
		new google.maps.LatLng(52.641292673202365, 6.992282867431641),
		new google.maps.LatLng(52.64202181977826, 7.002582550048828),
		new google.maps.LatLng(52.63754258452599, 7.00927734375),
		new google.maps.LatLng(52.63452144595455, 7.028675079345703),
		new google.maps.LatLng(52.63483398720576, 7.036571502685547),
		new google.maps.LatLng(52.63295870620807, 7.039661407470703),
		new google.maps.LatLng(52.63337544226485, 7.0429229736328125),
		new google.maps.LatLng(52.64389671230341, 7.054424285888672),
		new google.maps.LatLng(52.810232913769745, 7.071590423583984),
		new google.maps.LatLng(52.83844698864907, 7.0923614501953125),
		new google.maps.LatLng(52.83865437723678, 7.071590423583984),
		new google.maps.LatLng(52.84560132264028, 7.071418762207031),
		new google.maps.LatLng(52.8486078648344, 7.076740264892578),
		new google.maps.LatLng(52.8505775554518, 7.0758819580078125),
		new google.maps.LatLng(52.85192518701361, 7.067127227783203),
		new google.maps.LatLng(52.852028849247, 7.062320709228516),
		new google.maps.LatLng(52.865295571398775, 7.047901153564453),
		new google.maps.LatLng(52.86498467901085, 7.044124603271484),
		new google.maps.LatLng(52.872445481488825, 7.040691375732422),
		new google.maps.LatLng(52.87285993289373, 7.0147705078125),
		new google.maps.LatLng(52.91594126008629, 7.046012878417969),
		new google.maps.LatLng(52.91873592415367, 7.026100158691406),
		new google.maps.LatLng(52.92484215504479, 7.015800476074219),
		new google.maps.LatLng(52.992573833889765, 6.936321258544922),
		new google.maps.LatLng(53.05194551917203, 6.848602294921875),
		new google.maps.LatLng(53.110308130918526, 6.751441955566406),
		new google.maps.LatLng(53.119272047431764, 6.737537384033203),
		new google.maps.LatLng(53.12092038035579, 6.712646484375),
		new google.maps.LatLng(53.12133245371114, 6.695823669433594),
		new google.maps.LatLng(53.117520624446, 6.675052642822266),
		new google.maps.LatLng(53.11185376709613, 6.653938293457031),
		new google.maps.LatLng(53.105980054058676, 6.634883880615234)
	);

	map = new google.maps.Map2(document.getElementById('taalkaart'), {mapTypes: new Array(G_PHYSICAL_MAP)});
	map.setCenter(new google.maps.LatLng(52.905589081407825, 6.61102294921875), 10);
	var ui = map.getDefaultUI();
	var polygon = new google.maps.Polygon(latlngs, '#FF9900', 3, 0.7, '#FFFFFF', 0.00); 
	map.addOverlay(polygon);

	ui.maptypes.normal = false;
	ui.maptypes.satellite = false;
	ui.maptypes.hybrid = false;
	ui.maptypes.physical = false;
	ui.zoom.scrollweel = false;
	ui.zoom.doubleclick = false;
	ui.keyboard = false;
	ui.controls.largemapcontrol3d = true;
	ui.controls.smallzoomcontrol3d = false;
	ui.controls.maptypecontrol = false;
	ui.controls.menumaptypecontrol = false;
	ui.controls.scalecontrol = true;

	map.setUI(ui);
	
map.disableScrollWheelZoom();	

	markerManager = new MarkerManager(map);
}

google.setOnLoadCallback(initialize);
