/*
	Dev Saroop Singh Khalsa 19Sep2011 for Taaj Palace NM
	
	Matches the left sidebar with content on repeating background pattern
*/
$(document).ready(function()
{
	// 19Sep2011 dssk
	function ReadjustHeight(contentHeight, sidebarHeight) {

		// 370 is the height of side bar background
		// find the multiples of side bar image
		var height = contentHeight;
		if (sidebarHeight > contentHeight)
		{
			height = sidebarHeight;
		}

		var temp = Math.floor(height / 370) + 1;

		// check to make sure content is long enough for menu
		return (temp * 370);
	}

	var content = $("#content");
	var sidebar = $("#food_menu");

	var contentHeight = content.height();
	var sidebarHeight = $("#food_menu").height();
	
	var newHeight = ReadjustHeight(contentHeight, sidebarHeight);
	sidebar.height(newHeight);
	content.height(newHeight);
	
////////////////
/*
	var content_height = $("#content").height();
	var sidebar_height = $("#food_menu").height();
	if (content_height > sidebar_height) {
	    $("#food_menu").height(content_height);
	}
	else if (content_height < sidebar_height) {
	    $("#content").height(sidebar_height);
	}
*/
    $("#contactinfoform").validate();
    $("#cateringform").validate();

});

