﻿function ShowMapPanel(){
    glow.ready(function() {
        var myInfoPanel = new glow.widgets.InfoPanel("#kartta1", {
          context: "#kartta",
          width:600,
          offsetInContext: { x: "80%", y: "20%" }
    });
    var arr = document.getElementsByTagName('kartta1');
    document.getElementById('kartta1').style.display = 'block';
    myInfoPanel.show();
    });
}
//                    
//function ShowAddress(strAddress)
//{
//    if (GBrowserIsCompatible()) {
//        map = new GMap2(document.getElementById("map_canvas"));
//        map.setCenter(new GLatLng(62.359805,29.360962), 7);
//        var customUI = map.getDefaultUI();
//        customUI.maptypes.normal  = true;
//        customUI.controls.maptypecontrol = false;
//        map.setUI(customUI);
//        var geocoder = new GClientGeocoder();
//        if (geocoder) {
//        geocoder.getLatLng(
//          address,
//        function(point) {
//    if (!point) {
//        alert(address + " not found");
//    } else {
//        map.setCenter(point,13 );
//        var marker = new GMarker(point);
//        map.addOverlay(marker);
//       // marker.openInfoWindowHtml(address);
//    }
//}
//        );
//      }
//     }//
 //}
function ShowAddress(address) {
    var map = null;
    var geocoder = null;
    var bounds = new GLatLngBounds();
   
        if (GBrowserIsCompatible()) {
            map = new GMap2(document.getElementById("map_canvas"));
            map.setCenter(new GLatLng(62.359805, 29.360962), 7);
            geocoder = new GClientGeocoder();
            map.addControl(new GSmallMapControl());
            map.addControl(new GMapTypeControl());
        }
    

    if (geocoder) {
        geocoder.getLatLng(
address,
function(point) {
    if (point) {

        map.setCenter(point, 13);
        var marker = new GMarker(point);
        map.addOverlay(marker);
      
          marker.openInfoWindowHtml(address);
    }
}
);
    } 
}
     
 