function _onmouseout (_scr, _Img) {
	eval ("document.images." + _Img + ".src = '" + _scr + "'" ) ;
}
function checkEmailAddress(emailStr)
{
	var re_check_email = new RegExp("[A-Za-z0-9_]+([-+.][A-Za-z0-9_]+)*@[A-Za-z0-9_]+([-.][A-Za-z0-9_]+)*\\.[A-Za-z0-9_]{2,}([-.][A-Za-z0-9_]+)*");
	var ares = re_check_email.exec(emailStr);
	if( ares == null )
	{
		return false;
	}
	return true;
}
function sendQM(bIsSendToSender)
{
	var theForm = document.forms.quick_question_form;

	if (!theForm.name.value)
	{
		alert("Пожалуйста, введите ФИО.");
		theForm.name.focus();
		return false;
	}

	if (!theForm.email.value)
	{
		alert("Пожалуйста, введите адрес электронной почты.");
		theForm.email.focus();
		return false;
	}

	if (!checkEmailAddress(theForm.email.value))
	{
		alert("Пожалуйста, введите правильный адрес электронной почты.");
		theForm.email.focus();
		return false;
	}

	if (!theForm.q_text.value)
	{
		alert("Пожалуйста, введите вопрос.");
		theForm.q_text.focus();
		return false;
	}
    var aQuestionInfo = [theForm.name.value, theForm.email.value, theForm.q_text.value];
    sendQuickMessage(aQuestionInfo, bIsSendToSender);

    return true;
}

function sendQuickMessage(aQuestionInfo, bIsSendToSender)
{
	agent.call('', 'sendQuickMessageBackground', 'callbackSendQuickMessage', aQuestionInfo, bIsSendToSender);
}

function callbackSendQuickMessage(sThanksStr)
{
	document.getElementById('quick_contact_table').rows[0].cells[0].innerHTML = '<table><tr><td align="center" valign="top" class="text">'+ "Спасибо за сообщение!" + '</td></tr></table>';
} 
