function clearField(field){
field.value = '';
}
function showRequest(formData, jqForm, options) { 
	
	var queryString = $.param(formData);
    //alert('About to submit: \n\n' + queryString);
	$('.button').hide();
	
	var w = $(window);
	$('<div>',
		{
		id: 'request',
		width: '200px',
		height: '50px',		
		}).html('Отправка запроса...')
		.css({
		cursor: 'pointer',
		position: 'fixed',
		color: '#fff',
		textAlign: 'center',
		fontSize: '12px',
		zIndex: '99999',
		background: 'url("../images/fot/sep_bg.png") repeat-x scroll 0 0',
		//left: (w.width()-100)/2+w.scrollLeft() + 'px',
		//top: (w.height()-100)/2+w.scrollTop() + 'px',
		left: 0,
		top: 0,
		padding: '10px 5px 5px 5px',
		}).appendTo('body');

    return true;
}
//Для арнеллии
function showRequest2(formData, jqForm, options) { 
	
	var queryString = $.param(formData);
    //alert('About to submit: \n\n' + queryString);
	$('<div>',{
		id: 'req_message',
		width: '200px',
		height: '30px',
		})
		.html('Отправка запроса...')
		.css({
		fontSize: '14px',
		textAlign: 'center',
		marginTop: '20px',
		padding: '3px'
		})
		.appendTo('#zakaz');
	
	
    return true;
}
function showResponse2(responseText, statusText, xhr, $form)  {
    setTimeout(thanks2, 2000);
	
}
function thanks2(){
		$('#req_message').css({background: 'green'});
		$('#req_message').css({color: '#fff'}).html('Запрос отправлен.<br /> Спасибо!');
		$('#order').resetForm();
		setTimeout(removeThanks2, 2000);
}
function removeThanks2(){
	$("#form_overlay").hide();
	$('#board_form_zakaz').hide("slow");
	$('#req_message').remove();
}
///////////////////////////////////////////////
function thanks(){
		$('#request').css({fontWeight: 'bold'}).html('Запрос отправлен.<br /> Спасибо!');
		$('#form1').resetForm();
		if ($('#board_call_form').css("display") == "block"){
			$('#colleft').animate({"padding-top" : "15px"}, "slow");
		}
		$('#board_call_form').slideUp("slow");
		$('#board_call_first').show("slow");
		$('#callmeIntext').resetForm();
		$('#callme').resetForm();
		$('#form3').resetForm();
		removeThanks();
}

function removeThanks(){
	$('#request').fadeOut(5000, function(){
		$('#request').remove();
	});
	$('.button').show();
}
function showResponse(responseText, statusText, xhr, $form)  {
    setTimeout(thanks, 2000);
	
}
function showRequest3(formData, jqForm, options) { 
	
	var queryString = $.param(formData);
    //alert('About to submit: \n\n' + queryString);
	$('#callme_popup').css('display', 'none');
	$('<div>',{
		id: 'send_phone'	
		})
		.html('Отправка запроса...')
		.css({
		fontSize: '14px',
		textAlign: 'center',
		marginTop: '20px',
		padding: '3px'
		})
		.appendTo('#call_popup');
	
	
    return true;
}
function showResponse3(responseText, statusText, xhr, $form)  {
    setTimeout(thanks3, 2000);
	
}
function thanks3(){
		$('#send_phone').css({background: 'green'});
		$('#send_phone').css({color: '#fff'}).html('Запрос отправлен.<br /> Спасибо!');
		$('#callme_popup').resetForm();		
		setTimeout(removeThanks3, 2000);
}
function removeThanks3(){
	$("#popup_overlay").hide();
	$('#call_popup').hide("slow");
	$('#send_phone').remove();
	$('#callme_popup').css('display', 'block');
}
function showRequest4(formData, jqForm, options) { 
	
	var queryString = $.param(formData);
    //alert('About to submit: \n\n' + queryString);
	$('#form3').css('display', 'none');
	$('<div>',{
		id: 'send_wish'	
		})
		.html('Отправка запроса...')
		.css({
		fontSize: '14px',
		textAlign: 'center',
		marginTop: '20px',
		padding: '3px'
		})
		.appendTo('#form_popup');
	
	
    return true;
}
function showResponse4(responseText, statusText, xhr, $form)  {
    setTimeout(thanks4, 2000);
	
}
function thanks4(){
		$('#send_wish').css({background: 'green'});
		$('#send_wish').css({color: '#fff'}).html('Запрос отправлен.<br /> Спасибо!');
		$('#form3').resetForm();		
		setTimeout(removeThanks4, 2000);
}
function removeThanks4(){
	$("#popup_overlay2").hide();
	$('#form_popup').hide("slow");
	$('#send_wish').remove();
	$('#form3').css('display', 'block');
}
/* Plugin to make variable height divs equal heights */
$.fn.sameHeights = function() {
	$(this).each(function(){
	var tallest = 0;
	$(this).children().each(function(i){
	if (tallest < $(this).height()) { tallest = $(this).height(); }
	});
	$(this).children().css({'height': tallest});
	});
	return this;
};
$(document).ready(function(){
	/* Make boxes same height */
	//$('.equal-z141382').sameHeights();
	$('.equal-xn----8sbtddr4bi.xn--p1ai').sameHeights();
});


