var sHideMapButtonText = '';
var sShowMapButtonText = '';

function setMapButtonText(sHideText, sShowText) {
  sHideMapButtonText = sHideText;
  sShowMapButtonText = sShowText;
}

function cH(nId, nLatitude, nLongitude, oAnchor) {
  var oDiv = document.getElementById("map_"+nId);
  if(!oDiv) { return false; }

  var sButtonText;
  if(!oDiv.style.display || oDiv.style.display=="none") {
    oDiv.style.display = "block";
    oDiv.style.width = "100%";
    oDiv.style.height = "250px";
    oDiv.style.border = "1px solid #666666";
    oDiv.style.clear = "both";
  
    var map = new GMap2(oDiv);
    map.setCenter(new GLatLng(nLatitude, nLongitude), 14);
    map.addControl(new GSmallMapControl());
    map.addOverlay(new GMarker(new GLatLng(nLatitude, nLongitude)));        
    
    sButtonText = sHideMapButtonText;
  }
  else {
    oDiv.style.display = "none";    
    
    sButtonText = sShowMapButtonText;
  }
  
  if(oAnchor && oAnchor.firstChild && oAnchor.firstChild.nodeValue) {
    oAnchor.firstChild.nodeValue = sButtonText; 
  }
    
  return false;
}

