jQuery(document).ready( function($) {
		
	// Mouseovers for main menu
	$("#nav .sf-menu > li a:not(.active, .inactive)").hover(
		function() {
			$(this).css("background-position", "0 0");
		},
		function() {
			$(this).css("background-position", "0 -39px");
		}
	);
	
	// Replace OpenTable submit button
	$(".OT_TableButton").attr('src','images/find-a-table.gif');
	
	// Initialize menu lightbox
	$("a[rel='menu']").colorbox();
	$(".menu-thumb").click(function(e){
		$("a[rel='menu']:first").trigger('click');
		e.preventDefault();
	});
	
	// Initialize superfish
	$("ul.sf-menu").superfish({
		autoArrows: false,
		dropShadows: false
	});
	
	// History link
	$("li.history a").colorbox({href: "/images/history.jpg"});
	
	// Press piece lightboxes
	$("#sources a[rel^='piece'], #pieces a").colorbox();
	
	// Media page scroll
	$('.scroll-buttons .scroll-down').mousedown( function() {
			$('.scrollable').scrollTo('max', "slow", {easing: 'linear', axis: "y"});
		}).mouseup( function() {
			$('.scrollable').stop();
		}
	);
	
	// Menus lightboxes
	$(".view-menu a[rel='menu']").colorbox();

	$('.scroll-buttons .scroll-up').mousedown( function() {
			$('.scrollable').scrollTo(0, "slow", {easing: 'linear', axis: "y"});
		}).mouseup( function() {
			$('.scrollable').stop();
		}
	);

	$('.scrollable').scrollTo(0,0);
	
	// Media menu lightboxes
	$("li.media li.fact-sheet").colorbox({href: "/images/press/factsheet.jpg"});
	$("li.media li.opening").colorbox({href: "/images/press/openingannouncement-1.jpg", rel: "opening"})
	.append($("<a>Page 2</a>").css("display","none").attr({href:"/images/press/openingannouncement-2.jpg",rel: "opening"}).colorbox());

	// Private Events sample menus lightbox
	$("li.private-events li.sample-menus").colorbox({href: "/images/samplemenus-1.jpg", rel: "samplemenus"})
	.append($("<a>Page 2</a>").css("display","none").attr({href:"/images/samplemenus-2.jpg",rel: "samplemenus"}).colorbox())
	.append($("<a>Page 3</a>").css("display","none").attr({href:"/images/samplemenus-3.jpg",rel: "samplemenus"}).colorbox());
	
	// Contact page Street View lightbox
	$(".street-view a").colorbox();
	
	// Preload press rollovers
	var rollovers = new Array();
	$("#sources img").each(function(i,v) {
		rollovers[i] = new Image();
		rollovers[i].src = $(this).attr('src');
	});
	
	// Rollover for press page
	$("#sources img").hover(
		function() {
			$(this).attr('src',$(this).attr('src').substr(0,$(this).attr('src').search(".jpg")) + "_ro.jpg");
		},
		function() {
			$(this).attr('src',$(this).attr('src').replace("_ro.jpg",".jpg"));
		}
	);
	
	// Signup link on contact page
	$("#signup").colorbox({width: "500px",height: "400px"});
	
	// Press photos
	$("#photos a[rel='photos']").colorbox();
	
	// Floorplans
	$(".floorplan").colorbox();
});
