// JavaScript Document
       var map = null;
       var geocoder = null;
      function initialize() {
        if (GBrowserIsCompatible()) {
          map = new GMap2(document.getElementById("map_canvas"));
          map.setCenter(new GLatLng(37.4419, -122.1419),3);
          geocoder = new GClientGeocoder();
          map.addControl(new GSmallMapControl());
          map.addControl(new GMapTypeControl());  
          // bind a search control to the map, suppress result list
          var options = {
      suppressZoomToBounds : true,
      searchFormHint :"Pool rooms in usa"
      };
          //map.addControl(new google.maps.LocalSearch(options), new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10,20)));   
       }
    }
    function showAddress(address) {
    initialize();
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              var marker = new GMarker(point);
              marker.openInfoWindowHtml("No Map view");
            } else {
              map.setCenter(point, 13);
              var marker = new GMarker(point);
              map.addOverlay(marker);
              marker.openInfoWindowHtml("<div style='background:#CFE3F7; width:150px; height:150px; padding:10;'><b>Pool Room</b><br>Location:"+address+"<br><a title='Play89 Pool - Free Download -Try it NOW!' href='http://www.play89.co.uk/download.html'>Click to Play Pool!</a></b></div>");
                  
            }
          }
        );
      }
    }
    function showcityAddress(address) {
      initialize();
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
             map.setCenter(point, 13);
             var marker = new GMarker(point);
             map.addOverlay(marker);
             marker.openInfoWindowHtml('usa');
            } else {
              map.setCenter(point, 13);
              var marker = new GMarker(point);
              map.addOverlay(marker);
              marker.openInfoWindowHtml(address);
            }
          }
        );
      }
    }
function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
  {
  return false;
  }
else {
return true
}
}
}
function validate_form(thisform)
{
with (thisform)
{
if (validate_required(query,"Not a valid query address!")==false)
  {query.focus();return false;}
}
}
GSearch.setOnLoadCallback(initialize);

