//<![CDATA[
	
    function initialize(Lat, Lng, mhtml) {
	
	//alert (Lat+" "+Lng+" "+mhtml);
	
      if (GBrowserIsCompatible()) {
	  
		// -- info window color change -- 
		function colourWindow() {
        // Change any <imgs> that use iw2.png
        var imgs = document.getElementsByTagName("IMG")
        for (var n = 0 ; n < imgs.length ; n++ ){
          var a=imgs[n].src;
          if (a.indexOf("iw2.png") > -1) {
            imgs[n].src="images/212121iw.png";
          }
		  else if (imgs[n].src=="http://maps.google.com/intl/en_us/mapfiles/iw_close.gif" || imgs[n].src=="http://maps.google.com/intl/en_ALL/mapfiles/iw_close.gif") {
            imgs[n].src="images/kiwi_iw_close.gif";
          }
		  
        }  
        // Change any <divs> that use "white"
        var divs = document.getElementsByTagName("DIV")
        for (var n = 0 ; n < divs.length ; n++ ){
          if (divs[n].style.backgroundColor == "white") {
            divs[n].style.backgroundImage="URL(images/212121.png)";
          }
		  
		  if (divs[n].style.borderTop != "") {
            divs[n].style.borderTop="1px solid rgb(0,0,0)";
          }
		  if (divs[n].style.borderBottom != "") {
            divs[n].style.borderBottom="1px solid rgb(0,0,0)";
          }
		  if (divs[n].style.borderLeft != "") {
            divs[n].style.borderLeft="1px solid rgb(0,0,0)";
          }
		  if (divs[n].style.borderRight != "") {
            divs[n].style.borderRight="1px solid rgb(0,0,0)";
          }
        } 
		
      }
	  
	  
        map = new GMap2(document.getElementById("map_canvas"));
       
		var iw=map.getInfoWindow();
        colourWindow();	

		map.setCenter(new GLatLng(Lat, Lng), 16);
		//map.setMapType(G_HYBRID_MAP);
		
		
		var point = new GLatLng(Lat,Lng);
	    
		var newIcon = MapIconMaker.createMarkerIcon({width: 26, height: 46, primaryColor: "#77AD00"});
		var marker = new GMarker(map.getCenter(), {icon: newIcon});
		
	 
	
	GEvent.addListener(marker, "click", function() {
			  marker.openInfoWindowHtml(mhtml);
			  });
	
	
	map.addOverlay(marker); 
	marker.openInfoWindowHtml(mhtml);
	
	tl_cnr = new GScreenOverlay('images/map_cnr_tl.png',
        new GScreenPoint(0, 1,'fraction', 'fraction'),  
        new GScreenPoint(0, 1,'fraction', 'fraction'),
        new GScreenSize(5, 5)  
      );
	  map.addOverlay(tl_cnr);
	
	bl_cnr = new GScreenOverlay('images/map_cnr_bl.png',
        new GScreenPoint(0, 0,'fraction', 'fraction'), 
        new GScreenPoint(0, 0,'fraction', 'fraction'), 
        new GScreenSize(5, 5) 
      );
	  map.addOverlay(bl_cnr);
	  
	tr_cnr = new GScreenOverlay('images/map_cnr_tr.png',
        new GScreenPoint(1, 1,'fraction', 'fraction'), 
        new GScreenPoint(1, 1,'fraction', 'fraction'),  
        new GScreenSize(5, 5)  
      );
	  map.addOverlay(tr_cnr);  
	
	br_cnr = new GScreenOverlay('images/map_cnr_br.png',
        new GScreenPoint(1, 0,'fraction', 'fraction'),  
        new GScreenPoint(1, 0,'fraction', 'fraction'), 
        new GScreenSize(5, 5) 
      );
	  map.addOverlay(br_cnr);
	
	
	
	GEvent.addDomListener(document.getElementById("CENTERbutton"), "click", function() {
       map.setCenter(new GLatLng(Lat+0.00033, Lng), 16);
      });
		
	GEvent.addDomListener(document.getElementById("UPbutton"), "click", function() {
      map.panDirection(0,1);
      }); 

	GEvent.addDomListener(document.getElementById("DOWNbutton"), "click", function() {
      map.panDirection(0,-1);
      }); 
	
	GEvent.addDomListener(document.getElementById("LEFTbutton"), "click", function() {
      map.panDirection(1,0);
      }); 
	  
	GEvent.addDomListener(document.getElementById("RIGHTbutton"), "click", function() {
      map.panDirection(-1,0);
      });
	  
	GEvent.addDomListener(document.getElementById("INbutton"), "click", function() {
      //map.zoomIn(); 
      }); 
	  
	GEvent.addDomListener(document.getElementById("OUTbutton"), "click", function() {
     //map.zoomOut(); 
      })
	  
	GEvent.addDomListener(document.getElementById("NORMALbutton"), "click", function() {
     map.setMapType(G_NORMAL_MAP);
	  })
    
	GEvent.addDomListener(document.getElementById("SATELLITEbutton"), "click", function() {
     map.setMapType(G_SATELLITE_MAP);
	  })
	  
	GEvent.addDomListener(document.getElementById("HYBRIDbutton"), "click", function() {
     map.setMapType(G_HYBRID_MAP);
	  })
	  
	  
	  }
    }
	
	
		
	 /*function createMarker(point,html) {
		
        var marker = new GMarker(point);
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html+" - "+point);
        });
        return marker;
      } */
	  
	
	
	//]]>
	
	
//var used =0;
//var completed=0;

function toggleGmap(lat, lng,  mhtml) { // toggle gmap on/off
	
	
	
	
	
	if(document.getElementById("map_container").style.display!='block')
	{
		
		document.getElementById("map_container").style.display='block';
		document.getElementById("flashcontent").style.display='none';
		document.getElementById("gmap_toggle").innerHTML='<img src=\"'+r+'images/map_mag.gif\" border=\"0\" alt=\"\">&nbsp;VIEW GALLERY';
		initialize(lat,lng,  mhtml);	
		
	}
	else
	{
		document.getElementById("map_container").style.display='none';
		document.getElementById("flashcontent").style.display='block';
		document.getElementById("gmap_toggle").innerHTML='<img src=\"'+r+'images/map_mag.gif\" border=\"0\" alt=\"\">&nbsp;VIEW MAP';
	}
	
	
	
  
}	


function displayGmap(lat,lng,  mhtml)
{
	
	if(document.getElementById("map_container").style.display!='block')
	{
		document.getElementById("map_container").style.display='block';
		document.getElementById("flashcontent").style.display='none';
		document.getElementById("gmap_toggle").innerHTML='<img src=\"'+r+'/images/map_mag.gif\" border=\"0\" alt=\"\">&nbsp;GALLERY';
		
		initialize(lat,lng,  mhtml);
	}
	
	window.scroll(0,0);

}