/*-----------------------------------------------------------------------------------------------------
VARS
-----------------------------------------------------------------------------------------------------*/
var geocoder;
var map;


function showOnMap(theAddress){
	geocoder = new google.maps.Geocoder();
    var latlng = new google.maps.LatLng(51.136074, 4.902761);
    var myOptions = {
      zoom: 13,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP,
    }
    map = new google.maps.Map(document.getElementById("mapCanvas"), myOptions);
	if (geocoder) {
		geocoder.geocode( { 'address': theAddress}, function(results, status) {
			if (status == google.maps.GeocoderStatus.OK) {
				map.setCenter(results[0].geometry.location);
				map.setZoom(13);
				var marker = new google.maps.Marker({
				  map: map, 
				  position: latlng
				});
			} 
			else {
			  alert("Geocode was not successful for the following reason: " + status);
			}
		});
	}
	theWidth=$(window).width() - 30;
	theHeight=$(window).height() - 30;
	
	$( "#mapCanvas" ).dialog( "option", "width", theWidth );
	$( "#mapCanvas" ).dialog( "option", "height", theHeight );
		
	$('#mapCanvas').dialog('open');
	google.maps.event.trigger(map, 'resize');
}
/*
var geocoder;
var map;


function showOnMap(theAddress){
	geocoder = new google.maps.Geocoder();
    var latlng = new google.maps.LatLng(51.136074, 4.902761);
    var myOptions = {
      zoom: 14,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP,
    }
    map = new google.maps.Map(document.getElementById("mapCanvas"), myOptions);
	if (geocoder) {
		geocoder.geocode( { 'address': theAddress}, function(results, status) {
			if (status == google.maps.GeocoderStatus.OK) {
				map.setCenter(latlng);
				map.setZoom(14);
				var marker = new google.maps.Marker({
				  map: map, 
				  position: latlng
				});
			} 
			else {
			  alert("Geocode was not successful for the following reason: " + status);
			}
		});
	}
	//$('#mapCanvas').dialog('open');
	google.maps.event.trigger(map, 'resize');
}*/
