jQuery(document).ready(function ($) {
  /* Javascript detection. If JS is disabled this class remains and can be used accordingly */
  $("#wrapper").removeClass("no-js");

  $("#menu > ul > li").hover(
    function () {
      $(this).children(".submenu").stop(true, true).slideDown(500);
    },
    function () {
      $(this).children(".submenu").stop(true, true).delay(400).slideUp(500);
    }
  );
});

function initializeGoogleMap(mapId, latitude, longitude, zoom, title) {
  yepnope([{ load: 'http://www.google.com/jsapi', callback: function () {
    google.load("maps", "3", {
      callback: function () {
        var myLatlng = new google.maps.LatLng(latitude, longitude);
        var myOptions = {
          zoom: zoom,
          center: myLatlng,
          mapTypeId: google.maps.MapTypeId.ROADMAP
        }

        var map = new google.maps.Map(document.getElementById(mapId), myOptions);

        var infowindow = new google.maps.InfoWindow({
          content: title,
          maxWidth: 200
        });

        var marker = new google.maps.Marker({
          position: myLatlng,
          map: map,
          title: title
        });

        google.maps.event.addListener(marker, 'mouseover', function () {
          infowindow.open(map, marker);
        });
      },
      other_params: "sensor=false"
    });
  }
  }]);
}
