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



    var name        = $.trim ( $('#firstname').val() );
    var email       = $.trim ( $('#email').val() );
    var phone       = $.trim ( $('#telephone').val() );
    var description     = $.trim ( $('#description').val() );



	
    if ( name == '' )
    {
        error += "Пожалуйста, введите Ваше Имя!\n";
        focus = 'firstname';
    }

    if ( email == '' && phone == '' )
    {
        error += "Пожалуйста, введите Ваш E-mail или Телефон!\n";
        focus = focus ? focus : 'email';
    }

    if ( description == '' )
    {
        error += "Пожалуйста, введите Описание сайта!\n";
        focus = focus ? focus : 'message';
    }

    // Show error messages if exists and set field focus.
    if ( error )
    {
        alert(error);
        $(focus).focus();
    }
    // Send data.
    else
    {
	
var send_button = document.order_form.submit_button;
send_button.disabled = true;
        $.post("send_index.php",
            {
				
	          
	            firstname:    name,
                email:   email,
                telephone:   phone,
                description: description ,
				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.
					
                    $('#firstname').val(''); 	              
	                $('#email').val('');
                    $('#telephone').val('');
                    $('#description').val('');

                }
send_button.disabled = false;
            },

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

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

