$(function(){
	
	//Do what we need to when form is submitted.	
	$('#form_submit').click(function(){
	
	//Setup any needed variables.
	var input_full_name = $('#full_name').val(),
		input_mode = $('#mode').val(),
		input_email = $('#email').val(),
		input_country = $('#country').val(),
		input_number_of_people = $('#number_of_people').val(),
		input_arriving = $('#Arriving_datepicker').val(),
		input_departing = $('#Departing_datepicker').val(),
		input_destination = $('#destination').val(),
		input_age = $('#Age').val(),
		input_additional_comments = $('#additional_comments').val(),
		response_text = $('#response');
		//Hide any previous response text 
		response_text.hide();
		
		//Change response text to 'loading...'
		response_text.html('<img src="http://www.guesthousemongolia.mn/images/ajax-loader.gif">').show();
		
		//Make AJAX request 
		$.post('http://www.guesthousemongolia.mn/assets/php/contact-send.php', {mode: input_mode, full_name: input_full_name, email: input_email, country: input_country, number_of_people: input_number_of_people, arriving: input_arriving, departing: input_departing, age: input_age, destination: input_destination, additional_comments: input_additional_comments}, function(data){
			response_text.html(data);
		});
		
		
		//Cancel default action
		return false;
	});

	$('#form_submit_car').click(function(){
	
	//Setup any needed variables.
	var input_car_full_name = $('#car_full_name').val(),
		input_mode_car = $('#mode_car').val(),
		input_car_email = $('#car_email').val(),
		input_car_country = $('#car_country').val(),
		input_car_number_of_days = $('#car_number_of_days').val(),
		input_car_number_of_people = $('#car_number_of_people').val(),
		input_rent_date_from = $('#Renting_Date_from').val(),
		input_rent_date_to = $('#Renting_Date_to').val(),
		input_car_type = $('#car_type').val(),
		input_car_additional_comments = $('#car_additional_comments').val(),
		response_text = $('#response_car');
		//Hide any previous response text 
		response_text.hide();
		
		//Change response text to 'loading...'
		response_text.html('<img src="http://www.guesthousemongolia.mn/images/ajax-loader.gif">').show();
		
		//Make AJAX request 
		$.post('http://www.guesthousemongolia.mn/assets/php/car.php', {mode_car: input_mode_car,car_full_name: input_car_full_name, car_email: input_car_email, car_country: input_car_country, car_number_of_days: input_car_number_of_days, car_number_of_people: input_car_number_of_people, rent_date_from: input_rent_date_from, rent_date_to: input_rent_date_to, car_type: input_car_type, car_additional_comments: input_car_additional_comments}, function(data){
			response_text.html(data);
		});
		
		
		//Cancel default action
		return false;
	});

	$('#form_submit_car_cont').click(function(){
	
	//Setup any needed variables.
	var input_car_full_name = $('#car_full_name').val(),
		input_mode_car = $('#mode_car').val(),
		input_car_email = $('#car_email').val(),
		input_car_country = $('#car_country').val(),
		input_car_number_of_days = $('#car_number_of_days').val(),
		input_car_number_of_people = $('#car_number_of_people').val(),
		input_rent_date_from = $('#Renting_Date_from').val(),
		input_rent_date_to = $('#Renting_Date_to').val(),
		input_car_type = $('#car_type').val(),
		input_car_additional_comments_cont = $('#car_additional_comments_cont').val(),
		response_text = $('#response_car');
		//Hide any previous response text 
		response_text.hide();
		
		//Change response text to 'loading...'
		response_text.html('<img src="http://www.guesthousemongolia.mn/images/ajax-loader1.gif">').show();
		
		//Make AJAX request 
		$.post('http://www.guesthousemongolia.mn/assets/php/car.php', {mode_car: input_mode_car,car_full_name: input_car_full_name, car_email: input_car_email, car_country: input_car_country, car_number_of_days: input_car_number_of_days, car_number_of_people: input_car_number_of_people, rent_date_from: input_rent_date_from, rent_date_to: input_rent_date_to, car_type: input_car_type, car_additional_comments: input_car_additional_comments_cont}, function(data){
			response_text.html(data);
		});
		
		
		//Cancel default action
		return false;
	});

	$('#form_submit_hostel').click(function(){
	//Setup any needed variables.
	var input_hostel_full_name = $('#hostel_full_name').val(),
		input_mode_hostel = $('#mode_hostel').val(),
		input_hostel_email = $('#hostel_email').val(),
		input_hostel_phone = $('#hostel_phone').val(),
		input_length_of_stay = $('#length_of_stay').val(),
		input_hostel_number_of_people = $('#hostel_number_of_people').val(),
		input_check_in_date = $('#check_in_date').val(),
		input_check_out_date = $('#check_out_date').val(),
		input_room_type = $('#room_type').val(),
		input_hostel_additional_comments = $('#hostel_additional_comments').val(),
		response_text = $('#response_hostel');
		//Hide any previous response text 
		response_text.hide();
		
		//Change response text to 'loading...'
		response_text.html('<img src="http://www.guesthousemongolia.mn/images/ajax-loader.gif">').show();
		
		//Make AJAX request 
		$.post('http://www.guesthousemongolia.mn/assets/php/hostel.php', {mode_hostel: input_mode_hostel,hostel_full_name: input_hostel_full_name, hostel_email: input_hostel_email, hostel_phone: input_hostel_phone, length_of_stay: input_length_of_stay, hostel_number_of_people: input_hostel_number_of_people, check_in_date: input_check_in_date, check_out_date: input_check_out_date, room_type: input_room_type, hostel_additional_comments: input_hostel_additional_comments}, function(data){
			response_text.html(data);
		});
		
		
		//Cancel default action
		return false;
	});

	$('#form_submit_train').click(function(){
	//Setup any needed variables.
	var input_train_full_name = $('#train_full_name').val(),
		input_mode_train = $('#mode_train').val(),
		input_train_email = $('#train_email').val(),
		input_from = $('#from').val(),
		input_to = $('#to').val(),
		input_departure_date = $('#departure_date').val(),
		input_number_of_ticket = $('#number_of_ticket').val(),
		input_train_additional_comments = $('#train_additional_comments').val(),
		response_text = $('#response_train');
		//Hide any previous response text 
		response_text.hide();
		
		//Change response text to 'loading...'
		response_text.html('<img src="http://www.guesthousemongolia.mn/images/ajax-loader.gif">').show();
		
		//Make AJAX request 
		$.post('http://www.guesthousemongolia.mn/assets/php/train.php', {mode_train: input_mode_train,train_full_name: input_train_full_name, train_email: input_train_email, from: input_from, to: input_to, departure_date: input_departure_date, number_of_ticket: input_number_of_ticket, train_additional_comments: input_train_additional_comments}, function(data){
			response_text.html(data);
		});
		
		
		//Cancel default action
		return false;
	});


});

