<div id="loading_symbol_main" style="display:none;width:100%;height:100%;position:absolute;top:0px;left:0px;z-index:100">
	<div id="loading_symbol_background" style="display:none;transition:0.3s;width:100%;height:100%;position:absolute;top:0px;left:0px;background:<%= $gray %>;opacity:0.5"></div>
	<div  id="loading_symbol_container" style="opacity:1;overflow:hidden;transition:0.6s;width:0px;height:0px;border:0px solid <%= $gray %>;background:<%= $white %>;border-radius:0px;position:absolute;top:calc(50%);left:calc(50%);">
		<%= image_tag( "shared/sensor_anim.gif", id:"loading_symbol", style:";width:100px;height:100px;transition:0.6s;opacity:1;top:-50px;left:-50px;position:absolute") %>
	</div>
</div>
<script>
function show_loading(type){
	if (type == 1){
		//document.getElementById("loading_symbol_container").style.display=""
		document.getElementById("loading_symbol_background").style.display=""
		document.getElementById("loading_symbol_main").style.display=""
		document.getElementById('loading_symbol_container').style.width="200px"
		document.getElementById('loading_symbol_container').style.height="200px"
		document.getElementById('loading_symbol_container').style.top="calc(50% - 100px)"
		document.getElementById('loading_symbol_container').style.left="calc(50% - 100px)"
		document.getElementById('loading_symbol_container').style.borderRadius="100px"
		
		document.getElementById('loading_symbol').style.top="50px"
		document.getElementById('loading_symbol').style.left="50px"
		
		//document.getElementById('loading_symbol_background').style.opacity='0.5'
		
		
		
	}else{
		document.getElementById('loading_symbol_container').style.width="0px"
		document.getElementById('loading_symbol_container').style.height="0px"
		document.getElementById('loading_symbol_container').style.top="calc(50%)"
		document.getElementById('loading_symbol_container').style.left="calc(50%)"
		document.getElementById('loading_symbol_container').style.borderRadius="0px"
		
		document.getElementById('loading_symbol').style.top="-50px"
		document.getElementById('loading_symbol').style.left="-50px"
		//setTimeout('document.getElementById("loading_symbol_container").style.display="none"',400)
		
		//document.getElementById('loading_symbol_background').style.opacity='0'
		setTimeout('document.getElementById("loading_symbol_background").style.display="none"',300)
		setTimeout('document.getElementById("loading_symbol_main").style.display="none"',600)
	}
}
</script>


<!--                            Окно с ошибками                            -->

<div id="error_block" style="display:none;width:100%;height:100%;position:absolute;top:0px;left:0px;z-index:100">
	<div id="error_background" style="transition:0.3s;width:100%;height:100%;position:absolute;top:0px;left:0px;background:<%= $gray %>;opacity:0.5"></div>
	<div id="error_container" style="width:500px;height:300px;border-radius:10px;background:<%= $l_gray %>;border:1px solid <%= $gray %>;position:absolute;top:calc(50% - 150px);left:calc(50% - 250px)">
		<div class="text_header_red_line" style="width:calc(100% - 30px);height:30px;top:5px;left:15px;" align="center"><b><%= t(:error_head) %></b></div>
		<table class="table_body" style="width:100%;position:relative;top:40px">
			<tr>
				<td style="width:120px" align="right"><%= t(:error_code) %>:</td>
				<td id="error_show_code">
				</td>
			</tr>
			<tr>
				<td align="right"><div style="width:100%;height:150px;"><%= t(:error_text) %>:</div></td>
				<td>
					<div id="error_show_text" style="width:calc(100% - 20px);height:150px;overflow:scroll;overflow-x:hidden;border:1px solid <%= $gray %>;background:<%= $white %>;padding:5px">
					</div>
				</td>
			</tr>
		</table>
		<div class="button" onclick="error_get_logs()" style="width:150px;left:10px;bottom:10px"><%= t(:error_log) %></div>
		<div class="button" onclick="" style="width:150px;left:170px;bottom:10px"><%= t(:error_backtrace) %></div>
		<div class="red_button" onclick="error_close()" style="width:150px;right:10px;bottom:10px"><%= t(:close) %></div>
	</div>
</div>

<script>
$(document).ready(
	function() { 
		$("#error_show_text").niceScroll(scroll_settings);
	}
);
function error_show(error){
	document.getElementById('error_show_code').innerHTML='<b>'+error.status+' '+error.statusText+'</b>'
	document.getElementById('error_show_text').innerHTML='<b>'+error.responseText+'</b>'
	document.getElementById('error_block').style.display=''
}
function error_close(){
	document.getElementById('error_block').style.display='none'
}

function error_get_logs(){
	window.open('/common/get_errors_log','_self');
}
function error_get_backtrace(){
	window.open('/common/get_errors_backtrace_log','_self');
}

</script>