function Send ()
{
	
    var error   = '';
    var focus   = '';
	


    var country        =  $('#country').val() ;
    var city           = $.trim ( $('#city').val() );
	var country2       = $.trim ( $('#country2').val() );
    var city2          = $.trim ( $('#city2').val() );
    var class_type     = $.trim ( $('#class_type').val() );
    var takeof        = $.trim ( $('#takeof').val() );
	var return_date    = $.trim ( $('#return_date').val() );
    var adult          = $.trim ( $('#adult').val() );
	var children1      = $.trim ( $('#children1').val() );
    var children2      = $.trim ( $('#children2').val() );
    var email          = $.trim ( $('#email').val() );




	
    if ( country == '' )
    {
        error += "Пожалуйста, введите Страну из которой будете лететь!\n";
        focus = 'firstname';
    }
	
	  if ( city  == '' )
    {
        error += "Пожалуйста, введите город из которого будете лететь!\n";
        focus = focus ? focus : 'message';
    }


   if ( country2 == '' )
    {
        error += "Пожалуйста, введите Страну в которую будете лететь!\n";
        focus = 'firstname';
    }
	
	  if ( city2  == '' )
    {
        error += "Пожалуйста, введите город в который будете лететь!\n";
        focus = focus ? focus : 'message';
    }
		  if (takeof  == '' )
    {
        error += "Пожалуйста, введите дату вылета!\n";
        focus = focus ? focus : 'message';
    }
    if ( email == '' )
    {
        error += "Пожалуйста, введите Контактные данные!\n";
        focus = focus ? focus : 'email';
    }

  

    // Show error messages if exists and set field focus.
    if ( error )
    {
        alert(error);
        $(focus).focus();
    }
    // Send data.
    else
    {
	

        $.post("send_email.php",
            {
				country: country ,
	            city:  city,
	            country2:  country2,
                city2:   city2,
                class_type: class_type,
                takeof: takeof ,
				return_date: return_date,				
				adult: adult,
				children1: children1,
				children2: children2,
				email : email ,
				submit_button: ("df")
            },

            // Callback function.
            function ( data )
            {
                // Can't send message.
                if ( !data.result )
                {
                    // Show Error Message and set field focus.
                    alert("Ошибка!\n" + data.message);
                    $(data.focus).focus();
                }
                // Message is sent.
                else
                {
                    // Show Success Message.
                    alert("Ваше сообщение успешно отправлено мы вам ответим в течении 1-4 часа ");

                    // Clear form.
					
                  $('#country').val(''); 
	                $('#city').val(''); 
	                $('#country2').val(''); 
	                $('#city2').val('');
                    $('#class_type').val('');
                    $('#takeof').val('');
					$('#return_date').val('');
					$('#adult').val('');
					$('#children1').val('');
					$('#children2').val('');
					$('#email').val('');

                }

            },

            // Send data in JSON format.
            "json"
        );
    }

    // Don't allow to submit form.
    return false;
}


