function sendForm(e) {
    good = true;

    if (    
        (mtrim(document.getElementById('bron_Name').value) == '') ||
        (mtrim(document.getElementById('bron_Name').value) == 'Иванов Иван Иванович')
    ) {
        good = false;
        alert('Пожалуйста, заполните поле "Ваше имя"');
    } else

    if (
        (mtrim(document.getElementById('bron_Phone').value) == '') ||
        (mtrim(document.getElementById('bron_Phone').value) == '8 (926) 123-45-67')
    ) {
        good = false;
        alert('Пожалуйста, заполните поле "Телефон"');
    } else 


    if (
        (mtrim(document.getElementById('bron_Email').value) == '') ||
        (mtrim(document.getElementById('bron_Email').value) == 'name@name.ru')
    ) {
        good = false;
        alert('Пожалуйста, заполните поле "Email"');
    }
    

    if (good) {

        if (document.getElementById('bron_Check').checked) {
            document.getElementById('bron_Check').value = 'Да';
        } else {
            document.getElementById('bron_Check').value = 'Нет';
        }

	  //brontype

	  if (document.getElementById('brontype')) {
		  brontype = document.getElementById('brontype').value;
	  } else {
		  brontype = '';
	  }


          var pars = "bron_Name=" + document.getElementById('bron_Name').value
                    + '&bron_Comp=' + document.getElementById('bron_Comp').value
                    + '&bron_Phone=' + document.getElementById('bron_Phone').value
                    + '&bron_Fax=' + document.getElementById('bron_Fax').value
                    + '&bron_Email=' + document.getElementById('bron_Email').value
                    + '&bron_Datecomin=' + document.getElementById('bron_Datecomin').value
                    + '&time_hour=' + document.getElementById('time_hour').value
                    + '&time_minute=' + document.getElementById('time_minute').value
                    + '&bron_Count=' + document.getElementById('bron_Count').value
                    + '&bron_Count3=' + document.getElementById('bron_Count3').value
                    + '&bron_Count14=' + document.getElementById('bron_Count14').value
                    + '&bron_Txt=' + document.getElementById('bron_Txt').value
                    + '&bron_Check=' + document.getElementById('bron_Check').value
		    + '&number=' + document.getElementById('number').value
		    + '&dateout=' + document.getElementById('bron_Dateout').value
		    + '&brontype=' + brontype
		    
                ;
          var myAjax = new Ajax('/modules/mod_mrcallback/mrsend.php', {data: pars, update: 'response'});
          myAjax.request();
    }
}

function mtrim(str, chars) {
	return ltrim(rtrim(str, chars), chars);
}

function mltrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}

function mrtrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}
function clearForm() {
        $('callme_form').reset();
}
