function feedback_check( frm ) {

    if ( frm.subject.value.match(/^\s*$/i) ) {
        alert("Тема сообщения не может быть пустой");
        frm.subject.focus();
        frm.subject.select();
        return false;
    }

    if ( frm.message.value.match(/^\s*$/i) ) {
        alert("Сообщение не может быть пустым");
        frm.message.focus();
        frm.message.select();
        return false;
    }

    if ( !frm.email.value.match(/^[a-z0-9_\-\.]+@([a-z0-9_\-]+\.)+[a-z]{2,5}$/i) ) {
        alert("Неправильный ввод в поле E-mail");
        frm.email.focus();
        frm.email.select();
        return false;
    }

    if ( frm.sender.value.match(/^\s*$/i) ) {
        alert("Ф.И.О. отправителя не может быть пустым");
        frm.sender.focus();
        frm.sender.select();
        return false;
    }

    return true;
}

function passports_check( frm ) {
    if ( frm.message.value.match(/^\s*$/i) ) {
        alert("Сообщение не может быть пустым");
        frm.message.focus();
        frm.message.select();
        return false;
    }

    if ( !frm.email.value.match(/^[a-z0-9_\-\.]+@([a-z0-9_\-]+\.)+[a-z]{2,5}$/i) ) {
        alert("Неправильный ввод в поле E-mail");
        frm.email.focus();
        frm.email.select();
        return false;
    }

    if ( frm.sender.value.match(/^\s*$/i) ) {
        alert("Ф.И.О. отправителя не может быть пустым");
        frm.sender.focus();
        frm.sender.select();
        return false;
    }

    return true;
}
