//
//
//

document.write('<script src="http://maps.google.com/maps?file=api&amp;v=2.x&amp;key=ABQIAAAAM-Xv_c2E_GBX6_1ic8GP1hSjgHOTYWDRtY4TSaOwJbAxEft8khRP0nCnBMWVi56EY9ecF2yBxXDdzg" type="text/javascript"><\/script>');

var map = Array();;
var geocoder = null;
var wnGmapsAddresses=Array();

function wnGmapsInit() {
   var i;
   
   for (i=0;i<wnGmapsAddresses.length;++i) {
      ShowAddress(i,wnGmapsAddresses[i]);
   }
}

function wnGmapsDone() {
   GUnload();
}

function wnGmapsAddAddress(address) {
   wnGmapsAddresses.push(address);
}

function ShowAddress(i,address) {
   id="wnGmaps"+i;
   
   // alert('id: '+id+', address: '+address);
   
   if (GBrowserIsCompatible()) {
      map[i] = new GMap2(document.getElementById(id));
      geocoder = new GClientGeocoder();

      if (geocoder) {
         geocoder.getLatLng(address,function(point) {
            if (!point) {
              // alert(address + " not found");
            } else {
              map[i].setCenter(point, 12);
              var marker = new GMarker(point);
              map[i].addOverlay(marker);
            }
         }
      );
      }
   }
}

