function initializeMap()
{
	var mapContainer = document.getElementById( containerId );
	if( !mapContainer ) return;

	mapObject = new GMap2( mapContainer );
	if( !mapObject ) return;

	var markerObject = new GIcon();
	if( !markerObject ) return;

	GEvent.addDomListener( mapContainer , "DOMMouseScroll", wheelEvent);
	mapContainer.onmousewheel = wheelEvent;

	markerObject.image 		= '/images/mapPointer.gif';
	markerObject.shadow 		= '/images/mapPointerShadow.png';
	markerObject.iconSize 		= new GSize( 30, 50 );
	markerObject.shadowSize	 	= new GSize( 80, 42 );
	markerObject.iconAnchor 	= new GPoint( 9, 50 );
	markerObject.infoWindowAnchor 	= new GPoint( 9, 15 );
	markerObject.infoShadowAnchor 	= new GPoint( 9, 15 );

	if( latitude > 0 && longitude > 0 )
	{
		var geoCoordinate = new GLatLng( latitude, longitude );
		globalGeo = geoCoordinate;
		if( mapCenter ) {
			mapObject.setCenter( new GLatLng( mapCenter['latitude'], mapCenter['longitude']), mapZoom );
		} else {
			mapObject.setCenter( geoCoordinate, mapZoom );
		}
		mapObject.addOverlay( new GMarker( geoCoordinate, markerObject ) );
	}
	else
	{
		var geoCoder = new GClientGeocoder();
		geoCoder.getLatLng( address,
			function( geoCoordinate ) {
				globalGeo = geoCoordinate;
				if( mapCenter ) {

					mapObject.setCenter( new GLatLng( mapCenter['latitude'], mapCenter['longitude']), mapZoom );
				} else {
					mapObject.setCenter( geoCoordinate, mapZoom );
				}
				mapObject.addOverlay( new GMarker( geoCoordinate, markerObject ) );
			}
		);
	}

	mapObject.addControl( new GSmallZoomControl() );
	mapObject.addControl( new GMapTypeControl() );
	if( overview ) mapObject.addControl( new GOverviewMapControl() );

	mapObject.enableScrollWheelZoom();
	mapObject.enableContinuousZoom();
}

function resizeMap( containerId )
{
	if( !mapObject ) return;

	var mapContainer = document.getElementById( containerId );
	if( !mapContainer ) return;

	new Effect.MoveAndResizeTo(mapContainer, 24, 0, 730, (mapContainer.offsetHeight+400), {'onFinish':mapObject.checkSize});
}

function wheelEvent(e)
{
	if (!e) e = window.event;
	if (e.preventDefault) e.preventDefault();
	e.returnValue = false;
}
