function googleMap(address,postcode){
	if(document.getElementById("map_canvas")){
		var map = null;
		var geocoder = null;
		initialize(address,postcode);
		//addEvent(window,'unload',GUnload);
		//addEvent(window,'load',initialize(address,postcode));

	}
}

function initialize(address,postcode)
{
	if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById("map_canvas"));
		map.addControl(new GLargeMapControl());
		//map.addControl(new GMapTypeControl());
		map.setCenter(new GLatLng(37.4419, -122.1419), 10);
		geocoder = new GClientGeocoder();
		//var address ='<?php echo $bizdetails;?>';
		mapAddress(postcode, address)
	}
}

function showAddress(address)
{
	if (geocoder) {
		geocoder.getLatLng(
		address,
		function(point)
		{
			if (!point) {
				//alert(address + " not found");
				//document.getElementById('checkGoogleMapAddress').style.display = 'block';
			}
			else {
				//document.getElementById('checkGoogleMapAddress').style.display = 'none';
				map.setCenter(point, 10);
				var marker = new GMarker(point);
				map.addOverlay(marker);
				/*marker.openInfoWindowHtml(address);*/
			}
		}
		);
	}
}

function mapAddress(postcode,address)
{
	if (geocoder) {
		geocoder.getLatLng(
		postcode,
		function(point)
		{
			if (!point) {
				//alert(postcode + " not found");
				//document.getElementById('checkGoogleMapAddress').style.display = 'block';
			}
			else {
				//document.getElementById('checkGoogleMapAddress').style.display = 'none';
				map.setCenter(point, 13);
				var marker = new GMarker(point);
				map.addOverlay(marker);
				GEvent.addListener(marker,"mouseover", function() {
					/*marker.openInfoWindowHtml(address);*/
				}
				);
			}
		}
		);
	}
}