jQuery.noConflict();

function load() {
  if (GBrowserIsCompatible()) {
    var map = new GMap2(document.getElementById("la_meena_map"),{ size: new GSize(300,300) });
	var m_center = new GLatLng(42.541933, -83.785248);
    map.setCenter(m_center, 14);
	map.addControl(new GSmallMapControl());


    // Create a base icon for all of our markers that specifies the
    // shadow, icon dimensions, etc.
    var baseIcon = new GIcon();
    baseIcon.shadow = "http://lameena.com/images/x_marks_the_shadow.png";
    baseIcon.iconSize = new GSize(108, 47);
    baseIcon.shadowSize = new GSize(108, 47);
    baseIcon.iconAnchor = new GPoint(29, 42);
    baseIcon.infoWindowAnchor = new GPoint(29, 43);
    baseIcon.infoShadowAnchor = new GPoint(29, 43);


	// Creates a marker whose info window displays the letter corresponding
	// to the given index.

	function createMarker(point, html) {
	  // Create a lettered icon for this point using our icon class
	  var la_meena_icon = new GIcon(baseIcon);
	  la_meena_icon.image = "http://lameena.com/images/x_marks_the_spot.png";

	  // Set up our GMarkerOptions object
	  markerOptions = { icon:la_meena_icon };
	  var marker = new GMarker(point, markerOptions);

	  GEvent.addListener(marker, "click", function() {
	    marker.openInfoWindowHtml(html);
	  });
	  return marker;
	}


	// Add Marker
	map.addOverlay(createMarker(new GLatLng(42.541933, -83.785248), "<div style='width: 200px;'><h4>La Meena Mediterranean Grill</h4><small>We're located in the building behind Taco Bell near Best Buy.</small></div>"));
  }
}

jQuery(document).ready(function() {
  // jQuery('#nav.tabs').addClass('ui-tabs-nav').find('a').click(function() {
  //  _switch(this.href);
  //  return false;
  // }).parents('li:first').addClass('ui-tabs-selected');
	
	jQuery('#menu_listing > div').not(':first').hide();
	jQuery('#menu_categories a').click(function() {
		jQuery('#menu_listing > div').hide();
		var goal = this.href.match(/#[\w_]+/);
		jQuery(goal[0]).show();
		return false;
	});

	jQuery('#slides').cycle({delay:3000,timeout: 8000, speed:  2000});
	
});

function _switch(what) {
	var goal = what.match(/#[\w_]+/);
	if (!goal)
		goal = "#home";
	else
		goal = goal[0];

	jQuery('#content_inner > div').hide();
	jQuery('#content_inner').find(goal).show();
	jQuery('#nav.tabs a[href$=' + goal + ']').parents('li:first').addClass('ui-tabs-selected').siblings('li').removeClass('ui-tabs-selected');
	document.location.hash = goal;
	return false;
}