<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">$(document).ready(function(){
	$('#fileinput').on('change',function(e){
		e.preventDefault();
		var cnt=this.files.length;
		if(cnt&gt;5)cnt=5;
		$('#input_file').text('+ Р¤Р°Р№Р»С‹ ('+cnt+')');
	});
	$('#fileinput2').on('change',function(e){
		e.preventDefault();
		var cnt=this.files.length;
		if(cnt&gt;5)cnt=5;
		$('#input_file2').text('+ Р¤Р°Р№Р»С‹ ('+cnt+')');
	});
	$('#cod, #tel').on('keyup',function(e){
		if($('#cod').val().length&gt;3){
			$('#cod').val($('#cod').val().replace(/\D/g,''));
			$('#cod').val($('#cod').val().substr(0,3));
		}
		if($('#tel').val().length&gt;7){
			$('#tel').val($('#tel').val().replace(/\D/g,''));
			$('#tel').val($('#tel').val().substr(0,7));
		}
	});
	$('#modal_form').on('submit',function(e){
		e.preventDefault();
		return;
	});
	let send = null;
	$('#submit_callback').on('click',function(e){
		e.preventDefault();
		let $that=$('.form_callback'),report='',error_box=document.getElementById('error_box1'),form=document.forms.form_callback,data=new FormData(form),input=form.elements,cod=input['cod'],tel=cod.value,xhr=new XMLHttpRequest,log;
		error_box.style.display='none';
		if(/^\+7 \(\d{3}\) \d{3}-\d{2}-\d{2}$/.test(tel)==false){errBox1('РџСЂРѕРІРµСЂСЊС‚Рµ РїСЂР°РІРёР»СЊРЅРѕСЃС‚СЊ РІРІРѕРґР° РЅРѕРјРµСЂР°. &lt;br&gt;РќРµРѕР±С…РѕРґРёРјС‹Р№ С„РѕСЂРјР°С‚: +7 (999) 999-99-99');return;}
		xhr.open('POST','mailer.php');
		xhr.addEventListener('readystatechange',function(){
			if(this.readyState==4&amp;&amp;this.status==200){
				log=this.responseText;
				$that.replaceWith(log);
				$that.trigger('reset');
				showSuccessMessage('success_mes', 'Р’Р°С€Рµ СЃРѕРѕР±С‰РµРЅРёРµ РѕС‚РїСЂР°РІР»РµРЅРѕ. РњС‹ СЃРІСЏР¶РµРјСЃСЏ СЃ РІР°РјРё РІ Р±Р»РёР¶Р°Р№С€РёРµ 15 РјРёРЅСѓС‚')
			}
		});
		xhr.send(data);
	});
	$('#modal_submit').on('click',function(e){
		e.preventDefault();
		let $that=$('.form_callback2'),report='',error_box=document.getElementById('error_box2'),form=document.forms.form_callback2,data=new FormData(form),input=form.elements,cod=input['cod'],tel=cod.value,email=input['email'].value,message=input['mess'].value,files=input['file'].files,i=0,xhr=new XMLHttpRequest,log;
		error_box.style.display='none';
		if(/^\+7 \(\d{3}\) \d{3}-\d{2}-\d{2}$/.test(tel)==false){errBox2('РџСЂРѕРІРµСЂСЊС‚Рµ РїСЂР°РІРёР»СЊРЅРѕСЃС‚СЊ РІРІРѕРґР° РЅРѕРјРµСЂР°. РќРµРѕР±С…РѕРґРёРјС‹Р№ С„РѕСЂРјР°С‚: +7 (999) 999-99-99');return;}
		if(/([\w\.]{1,25})\@([\w\.]{1,40})\.([a-zA-Z]{2,9})/.test(email)==false){errBox2('Email РЅСѓР¶РЅРѕ РІРІРѕРґРёС‚СЊ РІ С„РѕСЂРјР°С‚Рµ mail@domain.com');return;}
		var len=files.length;
		if(len&gt;0){
			if(len&gt;5){errBox2('Р”РѕР±Р°РІР»РµРЅРѕ С‚РѕР»СЊРєРѕ 5 С„Р°Р№Р»РѕРІ');}
			$.each(files,function(key,value){
				++i;
				if(i&lt;6){
					data.append(key,value);
				}
			});
		}
		xhr.open('POST','mailer.php');
		xhr.addEventListener('readystatechange',function(){
			if(this.readyState==4&amp;&amp;this.status==200){
				log=this.responseText;
				$that.replaceWith(log);
				$that.trigger('reset');
				showSuccessMessage2('success_mes2', 'Р’Р°С€Рµ СЃРѕРѕР±С‰РµРЅРёРµ РѕС‚РїСЂР°РІР»РµРЅРѕ. РњС‹ СЃРІСЏР¶РµРјСЃСЏ СЃ РІР°РјРё РІ Р±Р»РёР¶Р°Р№С€РёРµ 15 РјРёРЅСѓС‚')
			}
		});
		xhr.send(data);
	});

	$('#modal_submit_raschet').on('click',function(e){
		e.preventDefault();
		let $that=$('.form_callback3'),report='',error_box=document.getElementById('error_box3'),form=document.forms.form_callback3,data=new FormData(form),input=form.elements,cod=input['cod'],tel=cod.value,email=input['email'].value,files=input['file'].files,i=0,xhr=new XMLHttpRequest,log;
		error_box.style.display='none';
		if(/^\+7 \(\d{3}\) \d{3}-\d{2}-\d{2}$/.test(tel)==false){errBox3('РџСЂРѕРІРµСЂСЊС‚Рµ РїСЂР°РІРёР»СЊРЅРѕСЃС‚СЊ РІРІРѕРґР° РЅРѕРјРµСЂР°. РќРµРѕР±С…РѕРґРёРјС‹Р№ С„РѕСЂРјР°С‚: +7 (999) 999-99-99');return;}
		if(/([\w\.]{1,25})\@([\w\.]{1,40})\.([a-zA-Z]{2,9})/.test(email)==false){errBox3('Email РЅСѓР¶РЅРѕ РІРІРѕРґРёС‚СЊ РІ С„РѕСЂРјР°С‚Рµ mail@domain.com');return;}
		if (files.length === 0) {errBox3('РџРѕР¶Р°Р»СѓР№СЃС‚Р°, РїСЂРёРєСЂРµРїРёС‚Рµ С„Р°Р№Р»С‹');	return;}

		var len=files.length;
		if(len&gt;0){
			if(len&gt;5){errBox('Р”РѕР±Р°РІР»РµРЅРѕ С‚РѕР»СЊРєРѕ 5 С„Р°Р№Р»РѕРІ');}
			$.each(files,function(key,value){
				++i;
				if(i&lt;6){
					data.append(key,value);
				}
			});
		}
		xhr.open('POST','mailer.php');
		xhr.addEventListener('readystatechange',function(){
			if(this.readyState==4&amp;&amp;this.status==200){
				log=this.responseText;
				$that.replaceWith(log);
				$that.trigger('reset');
				showSuccessMessage3('success_mes3', 'Р’Р°С€Рµ СЃРѕРѕР±С‰РµРЅРёРµ РѕС‚РїСЂР°РІР»РµРЅРѕ. РњС‹ СЃРІСЏР¶РµРјСЃСЏ СЃ РІР°РјРё РІ Р±Р»РёР¶Р°Р№С€РёРµ 15 РјРёРЅСѓС‚')
			}
		});
		xhr.send(data);
	});
	function errBox1(val) {
		var errorBox = document.getElementById('error_box1');
		if (errorBox) {
			errorBox.style.display = 'block';
			errorBox.innerHTML = val;
			window.setTimeout(function() {
				errorBox.style.display = 'none';
			}, 2000);
		}
	}

	
	function showSuccessMessage(elementId, message) {
		var successBox = document.getElementById(elementId);
		if (successBox) {
			successBox.innerHTML = message;
			successBox.style.display = 'block';
		}
	}

	
	function errBox2(val) {
		var errorBox = document.getElementById('error_box2');
		if (errorBox) {
			errorBox.style.display = 'block';
			errorBox.innerHTML = val;
			window.setTimeout(function() {
				errorBox.style.display = 'none';
			}, 3000);
		}
	}

	function showSuccessMessage2(elementId, message) {
		var successBox = document.getElementById(elementId);
		if (successBox) {
			successBox.innerHTML = message;
			successBox.style.display = 'block';
		}
	}

	
	function errBox3(val) {
		var errorBox = document.getElementById('error_box3');
		if (errorBox) {
			errorBox.style.display = 'block';
			errorBox.innerHTML = val;
			window.setTimeout(function() {
				errorBox.style.display = 'none';
			}, 3000);
		}
	}

	function showSuccessMessage3(elementId, message) {
		var successBox = document.getElementById(elementId);
		if (successBox) {
			successBox.innerHTML = message;
			successBox.style.display = 'block';
		}
	}
	
	function ajaxSend(data,form){
		var request=new XMLHttpRequest();
		request.open('POST','mailer.php');
		request.addEventListener('readystatechange',function(){
			if(this.readyState==4&amp;&amp;this.status==200){
				var rdata=JSON.parse(this.responseText);
				var log=this.responseText;
				console.log(log);
				form.replaceWith(rdata);
				form.trigger('reset');
			}
		});
		console.log('send');
		request.send(data);
	}
	function cons(val){
		console.info(val);
	}
});</pre></body></html>