// google.load('maps', '3', {
// 	other_params: 'sensor=false'
// });
// 
// google.setOnLoadCallback(initialize);
// 
// var styles = [[{
// 	url: 'images/map_marker_blank.png',
// 	height: 37,
// 	width: 42,
// 	opt_anchor: [0, 0],
// 	opt_textColor: '#ef722e',
// 	opt_textSize: 11
// },{
// 	url: 'images/map_marker_blank.png',
// 	height: 37,
// 	width: 42,
// 	opt_anchor: [0, 0],
// 	opt_textColor: '#ef722e',
// 	opt_textSize: 11
// },{
// 	url: 'images/map_marker_blank.png',
// 	height: 37,
// 	width: 42,
// 	opt_anchor: [0, 0],
// 	opt_textColor: '#ef722e',
// 	opt_textSize: 11
// }]];
// 	
// var markerClusterer = null;
// var map = null;
// var imageUrl = 'images/map_marker.png';
// var infoWindow = null;
// var markers = [];
// 
// function refreshMap() {
// 	
// 	var markerImage_white = new google.maps.MarkerImage('images/map_marker_white.png', new google.maps.Size(42, 37), new google.maps.Point(0,0), new google.maps.Point(27, 35) );
// 	var markerImage_orange = new google.maps.MarkerImage('images/map_marker_orange.png', new google.maps.Size(42, 37), new google.maps.Point(0,0), new google.maps.Point(27, 35) );
// 	var markerImage_alpha = new google.maps.MarkerImage('images/map_marker_alpha.png', new google.maps.Size(42, 37), new google.maps.Point(0,0), new google.maps.Point(27, 35) );
// 	
// 	for (var i = 0; i < data.stores.length; ++i) {
// 		if (data.stores[i].alpha == 1){
// 			var markerImage = markerImage_alpha;
// 		} else if (data.stores[i].promo == 1){
// 			var markerImage = markerImage_orange;
// 		} else {
// 			var markerImage = markerImage_white;
// 		}
// 		var latLng = new google.maps.LatLng(data.stores[i].latitude, data.stores[i].longitude)
// 		var marker = new google.maps.Marker({
// 			id: data.stores[i].id,
// 			map: map,
// 			position: latLng,
// 			icon: markerImage,
// 			title: '<h4>'+data.stores[i].title+'</h4><p>'+data.stores[i].address+'</p><p>'+data.stores[i].phone+'</p>'
// 		});
// 		markers.push(marker);
// 		var content = data.stores[i].title;
// 		google.maps.event.addListener(marker, 'click', function() {
// 			onMarkerClick(content,this);
// 		});
// 	    
// 	
// 		// google.maps.event.addListener(marker, 'click', function(e) {
// 		// 	alert(content)
// 		// 	var infobox = new SmartInfoWindow({position: latLng, map: map, content: content});
// 		// });
// 	  
// 	}
// 	
// 	var zoom = null;
// 	var size = null;
// 	var style = 0;
// 	
// 	markerClusterer = new MarkerClusterer(map, markers, {
// 		maxZoom: 12,
// 		gridSize: 25,
// 		styles: styles[style]
// 	});
// 	
// 	google.maps.event.addListener(map, 'click', function() {
// 		infoWindow.close();
// 		for (var i=0; i<markers.length; i++) { 
// 			markers[i].setVisible(true); 
// 		} 
// 	});
// 
// }
// 
// 	
// var onMarkerClick = function(content,marker) {
// 	// var marker = this;
// 	var latLng = marker.getPosition();
// 	infoWindow.setContent(marker.getTitle());
// 	infoWindow.open(map, marker);
// 	map.panTo(latLng);
// 	// map.setZoom(17);
// 	// marker.setVisible(false); 
// };
// 
// 
// var geocoder;
// 
// function initialize() {
// 	geocoder = new google.maps.Geocoder();
// 	map = new google.maps.Map(document.getElementById('Map'), {
// 		zoom: 3,
// 		center: new google.maps.LatLng(47.0843277,2.39540267),
// 		mapTypeId: google.maps.MapTypeId.ROADMAP
// 	});
// 	
// 	refreshMap();
// 	infoWindow = new google.maps.InfoWindow();
// 	// codeAddress("Belgium");
// }
// 
// function clearClusters(e) {
// 	e.preventDefault();
// 	e.stopPropagation();
// 	markerClusterer.clearMarkers();
// }
// 
// function codeAddress(address) {
// 	geocoder.geocode( { 'address': address}, function(results, status) {
// 		if (status == google.maps.GeocoderStatus.OK) {
// 			map.panTo(results[0].geometry.location);
// 			var ne = results[0].geometry.viewport.getNorthEast();
// 			var sw = results[0].geometry.viewport.getSouthWest();
// 			// map.panToBounds(results[0].geometry.viewport);
// 			map.fitBounds(results[0].geometry.viewport);               
// 		} else {
// 			alert("Geocode was not successful for the following reason: " + status);
// 		}
// 	});
// }
// 
// function showStore(latitude,longitude){
// 	var center = new google.maps.LatLng(latitude,longitude)
// 	map.panTo(center);
// 	map.setZoom(17);
// }
// 
// 
// // ####################################################### //
// 
// function getWhat(){
// 	return '';
// 	var whats = $('StoreSearch').getElements('.formWhat');
// 	var urlstring = '';
// 	whats.each(function(what){
// 		var index = whats.indexOf(what);
// 		if (what.checked == true){
// 			urlstring += '&search'+what.get('value')+'=1';
// 		} else {
// 			urlstring += '&search'+what.get('value')+'=0';
// 		}
// 	});
// 	return urlstring;
// }
// function ChangeFormWhat(){
// 	var urlstringwhat = getWhat();
// 	loadUrl('content.stores.form.country.inc.php?searchwhat=1'+urlstringwhat,$('StoresFormCountry'));
// 	loadUrl('content.stores.form.city.inc.php?var=1',$('StoresFormCity'));
// }
// function ChangeFormCountry(){
// 	var urlstringwhat = getWhat();
// 	loadUrl('content.stores.form.city.inc.php?searchcountry='+$('searchCountry').get('value')+urlstringwhat,$('StoresFormCity'));
// 	codeAddress($('country_option_'+$('searchCountry').get('value')).get('text'));
// }
// function ChangeFormCity(){
// 	var urlstringwhat = getWhat();
// 	loadUrl('content.stores.form.zip.inc.php?searchcity='+$('searchCity').get('value')+urlstringwhat,$('StoresFormZip'));
// 	codeAddress($('searchCity').get('value')+', '+$('searchCountry').get('value'));
// }
// 
// function ChangeFormZip(){
// 	$('SearchResult').set({'html':'<div class="BoxHeader"><div class="left">LOADING...</div><div class="right"></div><div class="clear"></div></div>'})
// 	var urlstringwhat = getWhat();
// 	loadUrl('content.stores.result.inc.php?searchcountry='+$('searchCountry').get('value')+'&searchcity='+$('searchCity').get('value')+'&searchzip='+$('searchZip').get('value')+urlstringwhat,$('SearchResult'));
// 	if ($('searchZip').get('value') == 'all'){
// 		codeAddress($('searchCity').get('value')+', '+$('searchCountry').get('value'));
// 	} else {
// 		codeAddress($('searchCity').get('value')+', '+$('searchZip').get('value')+' '+$('searchCountry').get('value'));
// 	}
// }  

