function createMarker(point, text, icon) {
	var marker = new GMarker(point, icon);
	GEvent.addListener(marker, 'click', function() {
		marker.openInfoWindowHtml(text);
	});
	return marker;
}
function loadmap(longitude, latitude, address , customicon) {
	if (GBrowserIsCompatible()) {
		
	    if(customicon){
	       var icon = new GIcon();
		  icon.image = customicon;
		  icon.iconSize = new GSize(30, 31);
		  icon.iconAnchor = new GPoint(6, 20);
		  icon.infoWindowAnchor = new GPoint(5, 1);
	    }
	    
		var map = new GMap(document.getElementById("map"));
	    map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
		
		map.centerAndZoom(new GPoint(longitude, latitude), 3);
		map.addOverlay(createMarker(new GPoint(longitude, latitude), address, icon));
		
		//alert('loaded gmap');
	}
}

function loadMultipointMap(centerLong, centerLat, mapPin , customicon) {
	if (GBrowserIsCompatible()) {
		
	    if(customicon){
	       var icon = new GIcon();
		  icon.image = customicon;
		  icon.iconSize = new GSize(30, 31);
		  icon.iconAnchor = new GPoint(6, 20);
		  icon.infoWindowAnchor = new GPoint(5, 1);
	    }
	    
		var map = new GMap(document.getElementById("map"));
	    map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
		
		map.centerAndZoom(new GPoint(centerLong, centerLat), 10);
		for ( x = 0; x < 11; x++ ) {
			map.addOverlay(createMarker(new GPoint(mapPin[x]['longitude'], mapPin[x]['latitude']), mapPin[x]['address'], icon));
		}
		//alert('loaded gmap');
	}
}