$(function()
{	
	$("ul#nav li ul").each(function(){		
		var left = ($(this).parent("li").outerWidth() - $(this).outerWidth())/2;
		
		$(this).css("left",left);
	});
	$("ul#nav li").hover(function()
	{
		$(this).addClass("active");
		$("ul", $(this)).show();
	}, function()
	{
		$(this).removeClass("active");
		$("ul", $(this)).hide();
	});
	// Sets up and clears email address input on focus, adds label back in when empty on blur
	$("form.subscribe input.input-text").each(function()
	{
		$(this).data("default", $(this).val());
	});
	$("form.subscribe input.input-text").focus(function()
	{
		($(this).val() == $(this).data("default")) ? $(this).val('') : null;
	}).blur(function()
	{
		($(this).val() == '') ? $(this).val($(this).data("default")) : null;
	});
	$(".accordion").hide();
	$(".accordion:eq(0)").show().next("p.more").children("a").addClass("hide").text("Hide details");
	$(".listing p.more a").click(function()
	{
		$(".accordion:not(:hidden)").each(function(){
			$(this).slideToggle(500);
		});
		$e = $(this);
		$c = $e.parent().siblings(".accordion");
		$e.toggleClass("hide");
		($e.text() == "View details") ? $e.text("Hide details") : $e.text("View details");		
		$c.slideToggle(500);
		return false;
	});
});

function RSVPWidgetExpand() {
	$("#quick-reservations").css("width","411px");
}

function RSVPWidgetCollapse() {
	$("#quick-reservations").css("width","157px");
}
