//$(document).ready(function() {
//	$('ul.faq-list li h2 a').click(function() {
//		$('ul.faq-list li h2 a').not(this).parent().parent().removeClass('active-answer');
//		$(this).parent().parent().toggleClass('active-answer');
//		return false;
//	});
//});

function checkMail(email){
	var pat=/^[\w-+\.]+@([\w-]+\.)+[\w-]{2,}$/i;
	if(pat.test(email)) return true;
		else return false;
}

function check_feedback_form()
{
	//company => phone
	if ($('#contact_name').val()=='')
	{
		$('#feedback_form_error').html("Представьтесь (заполните соответствующее поле)");
		$('#feedback_form_error').parent().show();
		return false;
	} 

	if (!checkMail($('#contact_email').val()))
	{
		$('#feedback_form_error').html("Введите правильный адрес электронной почты");
		$('#feedback_form_error').parent().show();
		return false;
	} 

	if ($('#contact_message').val()=='')
	{
		$('#feedback_form_error').html("Введите текст сообщения");
		$('#feedback_form_error').parent().show();
		return false;
	} 

	if ($('#contact_number').val()=='')
	{
		$('#feedback_form_error').html("Введите текст с картинки");
		$('#feedback_form_error').parent().show();
		return false;
	} 
	
	$('#feedback_form_error').html("");
	$('#feedback_form_error').parent().hide();
	
	return true;
}

function check_order_form()
{
	if ($('#order_name').val()=='')
	{
		$('#order_form_error').html("Представьтесь (заполните соответствующее поле)");
		$('#order_form_error').parent().show();
		return false;
	}

	if (!checkMail($('#order_email').val()))
	{
		$('#order_form_error').html("Введите правильный адрес электронной почты");
		$('#order_form_error').parent().show();
		return false;
	}

//	if ($('#contact_message').val()=='')
//	{
//		$('#feedback_form_error').html("Введите текст сообщения");
//		$('#feedback_form_error').parent().show();
//		return false;
//	}

//не юзаю 
//	if ($('#contact_number').val()=='')
//	{
//		$('#feedback_form_error').html("Введите текст с картинки");
//		$('#feedback_form_error').parent().show();
//		return false;
//	}

	$('#order_form_error').html("");
	$('#order_form_error').parent().hide();

	return true;
}
