$(document).ready(function () {
	$('.map_select').change(function () {
		$('.map').hide();
		var map = $('#' + $(this).val());
		map.html(map.html().replace('<!-- ', '').replace(' -->', ''));
		// get map guid
		var guid = map.find('iframe').attr('src').split("/");
		guid = guid[guid.length-1];
		
		// hide any previous list if one exists
		map.find('.location_list').remove();
		
		// create location list
		map.append('<iframe class="location_list" frameborder="0" src="http://2map2.com/embed/location-list/guid/' + guid + '"></iframe>');
		map.find('.location_list').css({'height': map.find('iframe').attr('height') + 'px'});
		
		// show it!
		map.show();
		
		// move footer back down
		$("#footer").animate({'padding-top':$("#info").height()+50}, 100);
	});
	
	$("#dining").click(function () { $('div.dining .map_select').change(); });
	$("#things_to_do").click(function () { $('div.things_to_do .map_select').change(); });
});