function gmap() {
    if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
        var point = new GLatLng(40.720956,-73.987934);
        var marker = new GMarker(point);
        map.addControl( new GSmallZoomControl() );
        map.setCenter(point, 16);
        GEvent.addListener(marker, "click",
            function() {
                marker.openInfoWindowHtml("FIG European Antiques/Interiors" +
                                          "<br/>153 Ludlow Street" +
                                          "<br/>New York, NY 10002<br/>" +
                                          "(212) 228-2665<br/>" +
                                          "<a href=\"mailto:ficus@earthlink.com\">" +
                                          "ficus@earthlink.com</a>");
            }
        );
        map.addOverlay(marker);

    }
}

$(document).ready(function(){
    var sb = $('#searchbox');
    sb.focus(function(){
        if (sb.val() == 'search'){
            sb.val('');
        }
    });
    sb.blur(function(){
        if (sb.val() == ''){
            sb.val('search');
        }
    });
    $(window).resize(adjust_vertical);

    // By default the png logo is shown, swap it out for the gif one for IE.
    if ( !$.browser.mise ){
        $('#fig-logo').attr('src', $('#fig-logo').attr('src').replace(/gif/, 'png'));
    }
    
    /* JQuery seems to think the DOM has loaded before it actually has.
     * Give it a few extra ms to sort stuff out before positioning #main
     */
    if ( $.browser.safari ){
      setTimeout(adjust_vertical, 20);
    } else {
      adjust_vertical();
    }
    
});

/* Use JS to optimally position the main content box. As low and to the
 * right as possible, without making anyone scroll, or covering the box
 * with logged-in user links */
function adjust_vertical(){
  var margin_top =  $(window).height() - 522;
  if (!margin_top){
    return;
  }
  if (margin_top-Math.round(margin_top/3) < 20){
    margin_top = 20;
  }
  else {
    margin_top -= Math.round(margin_top/3);
  }
  $('#main').css('margin-top', margin_top);
  return margin_top;
}

