// JavaScript Document

function makeReservation(locationID, hostURL)
	{
	    if (!locationID || locationID.length == 0)
	    {
	        return;
	    }
	    
	    if(hostURL == '')
	    {
	        hostURL = "http://www.perryssteakhouse.com.php5-2.dfw1-1.websitetestlink.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 + 'locations-menus/' + option.value;// + '/' + option.getAttribute('locality');
    				
				    if (option.getAttribute('locality') && option.getAttribute('locality') != "")
				    {
					    url += '/' + option.getAttribute('locality');
				    }
				    break;
    				
			    }        		
		    }
		    document.location.href = url;
        }
	}