/* this is javascript that goes on every page of the site */

$(document).ready(function(){
	// Initialize the New Window Popup JS
	initPopupLinks();
	initDateFields();
	// Initialize the Mini Res App date fields
	//initDateFields();

	// Initialize the css-popup (wine hour etc)
	$(".csspop").hover(function () {
		$("div.css-popup").fadeIn("slow");
	},function(){
		$("div.css-popup").fadeOut("slow");
	});

	// Bind calendar popup to calendar button
	//$(".btn-calendar").click(function() {
		//calePopUp(200,190);
	//});

	$('#nv-photo').fancybox({
	  type: 'iframe',
	  autoDimensions: false,
	  autoScale: false,
	  scrolling: 'no',
	  width: 750,
	  height: 550
	});

});
jQuery.fn.anchorAnimate = function(settings) {

	settings = jQuery.extend({
		speed : 1100
	}, settings);

	return this.each(function(){
		var caller = this
		$(caller).click(function (event) {
			event.preventDefault();
			var locationHref = window.location.href;
			var elementClick = $(caller).attr("href");

			var destination = $(elementClick).offset().top;
			$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, settings.speed, function() {
				window.location.hash = elementClick;
			});
			return false;
		})
	})
};
