$(function() {
	$("#menubar").addClass("magicline").append('<div id="magicline"></div>');
	$("#magicline")
		.css("left", $("#menubar .selected").position().left+10)
		.width($("#menubar .selected").outerWidth()-20);
	$("#menubar").delegate("a", "mouseover mouseout", function(e) {
		if (e.type == 'mouseover') {
			$("#magicline").stop().animate({
				left: $(this).position().left+10,
				width: $(this).outerWidth()-20
			});
		} else {
			$("#magicline").stop().animate({
				left: $("#menubar .selected").position().left+10,
				width: $("#menubar .selected").outerWidth()-20
			});
		}
	});
	$("#attractionbar a.photolink").each(function() {
		$('<span class="tooltip"></span>')
			.text($(this).find("img").attr("title"))
			.css({ opacity: 0 })
			.appendTo($(this));
		$(this).find("img").attr("title", "");
	});
	$("#attractionbar").delegate("a.photolink", "mouseover mouseout", function(e) {
		if (e.type == 'mouseover') {
			$(this).find(".tooltip").stop().animate({ opacity: 1, top: -28 });
		} else {
			$(this).find(".tooltip").stop().animate({ opacity: 0, top: 0 });
		}
	});
	$("#sidebar a[rel=photolink]").fancybox({
		overlayColor: "#e6f1ed",
		transitionIn: "elastic",
		transitionOut: "elastic",
		titleShow: false
	});
});
