var map = null;
var geocoder = null;
var address = 'Legionowo, Warszawska 59/4';

function initialize() {
  if (GBrowserIsCompatible()) {
    map = new GMap2(document.getElementById("map_canvas"));
    map.setCenter(new GLatLng(52.4, 20.9), 10);
    
    map.addControl(new GLargeMapControl());
    
    geocoder = new GClientGeocoder();

		var blueIcon = new GIcon(G_DEFAULT_ICON);
		//blueIcon.image = "http://www.activepharma.pl/var/img/ap.jpg";                
		//blueIcon.iconSize = new GSize(40, 26);
		blueIcon.shadowSize = new GSize(0, 0);
		blueIcon.iconAnchor = new GPoint(0, 20);
		blueIcon.infoWindowAnchor = new GPoint(5, 1);
		
		markerOptions = { icon:blueIcon };
        
    geocoder.getLatLng(address, function(point) {
                                  if (!point) {
                                    alert(address + " not found");
                                  } else {
                                    map.setCenter(point, 12);
                                    var marker = new GMarker(point,markerOptions);
                                    map.addOverlay(marker);
                                    marker.openInfoWindowHtml('<div style="font-family: verdana; font-size: 10px;"><img src="/var/img/logo/mam-map.png" style="margin-right: 5px;" align="left"><br /><b>MG BABY Felicki Przemysław</b><br>ul. Warszawska 59/4<br>05-120 Legionowo, Polska<br>tel. +48 22 766 01 80<br>fax. + 48 22 784 01 99</div>');
                                  }
                                });
  }
}
