	function getCost()
	{
		bookingType =	$('#booking_type').val ();
		locale_iesucks =		$('#locale').val();
		
		switch (bookingType)
		{
		case 'Spaces':
			if (page == 1)
			{
				arrivalDay =	$('#arrival_day').val ();
				arrivalMonth =	$('#arrival_month').val ();
				arrivalYear =	$('#arrival_year').val ();
				
				departureDay =	$('#departure_day').val ();
				departureMonth =$('#departure_month').val ();
				departureYear =	$('#departure_year').val ();
				
				action =		"action=get_cost_space&arrival="+arrivalDay+"-"+arrivalMonth+"-"+arrivalYear+"&departure="+departureDay+"-"+departureMonth+"-"+departureYear+"&locale="+locale_iesucks;
			}
			else
			{
				arrival =		$('#val_booking_arrival').val ();
				departure =		$('#val_booking_departure').val ();
				action =		"action=get_cost_space&arrival="+arrival+"&departure="+departure+"&locale="+locale_iesucks;
			}
			break;
			
		case 'Events':
			if (page == 1)
			{
				event_iesucks =			$('#select_event').val ();
			}
			else
			{
				event_iesucks =			$('#val_booking_event').val ();
			}
			action = 		"action=get_cost_event&event="+event_iesucks;
			break;
		}

		$.ajax({
			type: "POST",
			url: "ajax.php",
			data: action,
			success: function(msg){
				$('#response').html (msg);
			}
		});
	}
	
	function getLocationType ()
	{
		locale_iesucks = $('#locale').val();

		$.ajax({
			type: "POST",
			url: "ajax.php",
			data: "action=get_location_type&location="+locale_iesucks,
			success: function(msg){
				switch(msg)
				{
				case 'Spaces':
					$('#booking_info_events').hide ();
					$('#booking_info_spaces').fadeIn ();
					$('#booking_type').val ('Spaces');
					break;
					
				case 'Events':
					$('#booking_info_events').fadeIn ();
					$('#booking_info_spaces').hide ();
					$('#booking_type').val ('Events');
					populateEventsList (locale_iesucks);
					break;
				}
				getCost ();
			}
		});
	}
	
	function populateEventsList (locale_iesucks)
	{
		$.ajax({
			type: "POST",
			url: "ajax.php",
			data: "action=get_event_options&location="+locale_iesucks,
			success: function(msg){
				$('#select_event').html(msg);
				getCost ();
			}
		});
	}
	
