var map, s;

function loadSnapShot(mapContainerID, optionsArg) {

   if ( ! GBrowserIsCompatible() ) return;
   options = optionsArg;
   
   s = time();
    
   if ( options.countID ) {
      c = document.getElementById(options['countID']); 
      if (  c ) {
         c.innerHTML = dots.length;
      }
   }
   s += time();
   var c = document.getElementById(mapContainerID); 
   if ( ! c ) return
   if ( options['center'] ) {
     latlong = new GLatLng( options['center'][0] , options['center'][1] );
   } else {
     latlong = new GLatLng(20,10);
   }
   map = new GMap2(c);
   map.setCenter( latlong, ( options['zoom'] ? options['zoom'] : 0 ) );
   map.disableDragging();

   s += time();
   setTimeout('loadMarkers()',1);
}
function loadMarkers() {
   icon = new GIcon( G_DEFAULT_ICON );
   icon.image = "tiny.png";
   icon.shadow = "tiny.png";
   icon.iconSize = new GSize(2,2);
   icon.shadowSize = new GSize(2,2);
   icon.iconAnchor = new GPoint(1,1);
   icon.infoWindowAnchor = new GPoint(1, 1);
   
   options = {icon:icon};
   markers = new Array(dots.length);
   s += time();
   for ( var i=0 ; i < dots.length ; i++ ) {
       markers[i] = new GMarker ( new GLatLng(dots[i].latlong[0], dots[i].latlong[1]), options );
   }
   s += time();
   for ( var i=0 ; i < dots.length ; i++ ) {
       map.addOverlay( markers[i] );
   }
   s += time();
   //setTimeout('alert(s)',1000);
}
function time () {
	d = new Date();
	return d.getSeconds() + ' ' + d.getMilliseconds() + '\n';
}

