function show_form(form)
	{
		style = (form == 'venue') ? '' : 'none';
		document.getElementById('find-a-venue-wrap').style.display = style;

		switch (form)
		{
			case 'offer-food': style =  ''; index = 1; break;
			case 'offer-drink': style =  ''; index = 2; break;
			case 'offer-loyalty': style =  ''; index = 4; break;
			case 'offer-lifestyle': style = ''; index = 5; break;
			default: style =  'none'; index = 0; break;
		}
		
		document.getElementById('find-an-offer-wrap').style.display = style;
		document.getElementById('roffer_type').selectedIndex = index;
		get_offers();
		
		style = (form == 'table') ? '' : 'none';
		document.getElementById('book-a-table-wrap').style.display = style;

		if (form != '')
		{
			toggle_bigdd();
		}


		return false;
	}

	function get_offers()
	{
	var id = $('#offer_location').val();
	var date = $('#offer_date').val();
	var type = $('#roffer_type').val();
	$('#offers').html('<img src="/images/bo-ajax-loader.gif"/>');

	$.getJSON
		(
					"/offers/ajax/offers.php?venue_id=<? echo $venue_site->id;?>&roffer_type="+type+"&location_id="+id+"&date=" + date
					,
					function(json){

						if (json != null)
						{
							$('#offers').empty();

							$('#offers').append('<select name="offer_type" id="offer_type"></select>');
							$('#offer_type').append('<option value="">Select Type</option>');
							$('#offer_type').append('<option value="">View All Offers</option>');

							for (var i = 0; i < json.length; i++)
							{
								$('#offer_type').append('<option value="'+json[i]['id']+'">'+json[i]['title']+'</option>');
							}

							$('#offers').append('<input type="image" alt="View all offers" id="offer_button" src="/templates/0/images/go-button2.gif"/>');
						}
						else
						{
							$('#offers').empty();

							$('#offers').append('<select name="offer_type" id="offer_type"></select>');
							$('#offer_type').append('<option value="">Select Type</option>');
							$('#offer_type').append('<option value="">View All Offers</option>');
							$('#offers').append('<input type="image" alt="View all offers" id="offer_button" src="/templates/0/images/go-button2.gif"/>');
						}
					}
		);
	}

	function search_location_change()
	{
		var location_id = document.getElementById('search_location').value;
		var select = document.getElementById('search_venue');

		select.options.length = 0;

		if (location_id > 0)
		{
			select.options[0] = new Option("All", "", true, true);

			for (i = 0; i < venues[location_id].length; i++)
			{
				select.options[i+1] = new Option(venues[location_id][i]['name'], venues[location_id][i]['id'], false, false);
			}
		}
		else
		{
			select.options[0] = new Option("Please Select", "", false, false);
			select.options[0].disabled = true;
		}
	}

	function ajax_get_venues1()
	{
		var location_id = $('#search_location').val();
		var channel = $('#channel').val();
		$('#venue_search_venue').html('<img src="/images/bo-ajax-loader.gif"/>');
		//$('#venues img').center();
		if (location_id == '') location_id = 'all';
		if (channel == 'home') channel = 'all';
		$.getJSON
			(
				"/ajax/get.venues.php?location_id=" + location_id + "&channel=" + channel
				,
				function(json){

					if (json != null)
					{
						$('#venue_search_venue').empty();

						$('#venue_search_venue').append('<select name="search_venue" id="search_venue"></select>');
						$('#venue_search_venue select').append('<option value="">All</option>');

						for (var i = 0; i < json.length; i++)
						{
							$('#venue_search_venue select').append('<option value="'+json[i]['id']+'">'+json[i]['name']+'</option>');
						}

						$('#venue_search_venue').append('<input type="image" alt="View all venues" id="venue_button" src="/templates/0/images/go-button.gif"/>');
					}
					else
					{
						$('#venue_search_venue').html("<p>Sorry, no venues to display.</p>");
						//$('#venues div').center();
					}
				}
			);
	}

	function toggle_bigdd()
	{
		$('#big-dd').toggle();
		$('#big-dd-wrap').css('height', 'auto');
		$('#big-dd-wrap').css('minHeight', '0px');
		$('#big-dd-wrap').css('marginBottom', '10px');
		$('#clickme').css('display', 'none');
	}