function equalHeight(group)
{
	var tallest = 0;
	group.each(function() {
		var thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}

//////////////////////////////////////////////////////////////////////

function slideshow() 
{
	$('#home ul.slides').cycle({
			fx:      'fade', 
			speed:    1000, 
			timeout:  4500,
			pause: 1,
			pager:  '#toolbarnav'

		});

	$('#privateDining ul.slides').cycle({
		fx:      'fade', 
		speed:    1000, 
		timeout:  4500,
		pause: 1,
		pager:  '#toolbarnav'
	});
}

//////////////////////////////////////////////////////////////////////

function tabbedpanels()
{
	$('#menus #tabs').tabs({
			fx:{
				opacity: 'toggle'
			}
		});
}

//////////////////////////////////////////////////////////////////////

function print_menu()
{
	$('a.printBtn').click(function() {
		var link_el = $('link');
		
		if (link_el)
		{
			var print = false;
			
			link_el.each( function() {
				if ($(this).attr('media') == 'print')
				{
					print = true;
				}
			});
			
			if (print != true)
			{
				var link = $("<link>");
				link.attr({
			    type: 'text/css',
			    rel: 'stylesheet',
			    href: 'static/css/print.css',
					media: 'print'
				});
				$("head").append(link);
			}
		}
		
	  window.print();
	  return false;
	 });
}

//////////////////////////////////////////////////////////////////////

function validate_form()
{
	if ($('#SetMenuBooking'))
	{
		$('#SetMenuBooking').validate();
	}
	
	$("#date").mask("99/99/9999");
	$("#time").mask("99:99");
}

//////////////////////////////////////////////////////////////////////

$(document).ready(function(){
	$("a[rel='slides']").colorbox();
	$("a[rel='map']").colorbox();
	//$("a[rel='private']").colorbox();
	//equalHeight($("#content .equal"));
	slideshow();
	print_menu();
	tabbedpanels();
	validate_form();
});


