	function doSubmitRegistration()
	{
		document.getElementById('submitRegistration').submit();
	}
	
	function loadRestaurantPage(locationID, hostURL)
	{
	    if (!locationID || locationID.length == 0)
	    {
	        return;
	    }
	    
	    if(!hostURL && hostURL == '')
	    {
	        hostURL = "http://www.ruthschris.com/";
	    }
	    	    
		var locations = document.getElementById('locations');
		for(i = 0; i < locations.length; i++)
		{
			if (locations.options[i].value == locationID)
			{
				var option = document.getElementById('locations').options[i];

				var url = hostURL + 'Steak-House/' + option.value + '/' + option.getAttribute('city');// + '/' + option.getAttribute('locality');
				
				if (option.getAttribute('locality') && option.getAttribute('locality') != "")
				{
					url += '/' + option.getAttribute('locality');
				}
				document.location.href = url;
				
			}
			
		}
		
	}
	
	function loadPrivateDiningPage(locationID, hostURL)
	{
	    if (!locationID || locationID.length == 0)
	    {
	        return;
	    }
	    
	    if(!hostURL && hostURL == '')
	    {
	        hostURL = "http://www.ruthschris.com/";
	    }
	    
		var locations = document.getElementById('locations');
		for(i = 0; i < locations.length; i++)
		{
			if (locations.options[i].value == locationID)
			{
				var option = document.getElementById('locations').options[i];

				var url = hostURL + 'Private-Dining/' + option.value + '/' + option.getAttribute('city');// + '/' + option.getAttribute('locality');
				
				if (option.getAttribute('locality') && option.getAttribute('locality') != "")
				{
					url += '/' + option.getAttribute('locality');
				}
				document.location.href = url;
				
			}
			
		}
	}
	
	function makeReservation(locationID, hostURL)
	{
	    if (!locationID || locationID.length == 0)
	    {
	        return;
	    }
	    
	    if(hostURL == '')
	    {
	        hostURL = "http://www.ruthschris.com/";
	    }
	    
		if (locationID.length > 0)
		{
		    var locations = document.getElementById('reservation');
		    var url = '';
		    for(i = 0; i < locations.length; i++)
		    {
			    if (locations.options[i].value == locationID)
			    {
				    var option = document.getElementById('reservation').options[i];

				    url = hostURL + 'Reservation/' + option.value + '/' + option.getAttribute('city');// + '/' + option.getAttribute('locality');
    				
				    if (option.getAttribute('locality') && option.getAttribute('locality') != "")
				    {
					    url += '/' + option.getAttribute('locality');
				    }
				    break;
    				
			    }        		
		    }
		    document.location.href = url;
        }
	}



document.observe("dom:loaded", function() {
					
		// Image rollover for #nav
		$('nav').select('a').each(function(e){
				e.observe('mouseover', function() {	
												
					// find the img within this link
					imgsrc = e.select('img')[0].src;
					matches = imgsrc.match(/_over/);
					
					// don't do the rollover if state is already ON
					if (!matches) {
					imgsrcON = imgsrc.replace('OFF', 'ON'); // add over state
					e.select('img')[0].src = imgsrcON;
					}
				});	 // end mouseover
				
				e.observe('mouseout', function() {
					e.select('img')[0].src = imgsrc;					
				}); // end mouseout
				
		});	 // end initial 'each'			

	// Strip the border from any last #subnav element
	$$('ul#subnav li:last-child').each(function(e){ e.setStyle({'border':'none'}); });
	
	// add alternating row colors for tables with a class of 'chart'
	$$('table.chart tr:nth-child(even) td').each(function(td) {
			td.addClassName('alt');
			// also can do this:
			//td.setStyle('background:blue');
	});
	
	
	// Management Bios ---------------------------------------------- */
	// Initialize first opened management bio
	nowOpen = 'Stiles';
	
	if(document.location.href.match(/#(\w.+)/)) {
		anchor = RegExp.$1;
		$('link' + nowOpen).removeClassName('faded');
		$('bio' + nowOpen).hide();
		$('link' + anchor).addClassName('faded');
		$('bio' + anchor).show();
		nowOpen = anchor;
	} 
	
	// Expand and contract the management bios

	$$('dl.mgmtList a').each(function(e) {
		// keep the link from actually going anywhere							  
		e.onclick = function() { return false; }
		
		e.observe('click', function(event) {
									
			bioLink = Event.element(event);
			lastName = bioLink.id.gsub('link', ''); // strip off 'link' part of ID
			bioLink.addClassName('faded');
			
			// Close the previously opened bio
			$('link' + nowOpen).removeClassName('faded');
			$('bio' + nowOpen).fade({ afterFinish: function() {
				nowOpen = lastName;
				$('bio' + nowOpen).appear();
			}});
		}); // end click listener
	}); // end each 
	
	
}); // end dom:loaded
