$(document).ready(function() {

  $(".highlight").hover(
    function () {
      $(this).animate({
        backgroundColor: "#f5fbf5"
      }, 500);
    },

    function () {
      $(this).animate({
        backgroundColor: "#e4f2e3"
      }, 500);
    }
  );


  // Adds a dialog box to show google maps
  $("#map-dialog").dialog({
    autoOpen: false,
    width: 600,
    height: 500,
    close: function(event, ui) {
      GUnload();
    }
  });

});

/**
 * Opens the #map-dialog with the Google Map.
 */
function openMap() {
  GMapInitialize();
  $("#map-dialog").dialog('open');
}

/**
 * Initializes Google Map and sets Office location.
 */
function GMapInitialize() {
  address = "Via Cesare Balbo 35, Roma"
  if (GBrowserIsCompatible()) {
    var map = new GMap2(document.getElementById("map-dialog"), { size: new GSize(600, 500) });
    var geocoder = new GClientGeocoder();
    geocoder.getLatLng(
      address,
      function(point) {
        map.setCenter(point, 14);
        var marker = new GMarker(point);
        map.addOverlay(marker);
        marker.openInfoWindowHtml(address);
      }
    );
    map.setUIToDefault();
  }
}