/*

    FDE Grabber 4
    File: ROOT/tpl/js/ajax_loading.js;
    Copyright: FDSTAR Company
    Release date: Thu, 16 Feb 2012 20:49:51 +0200;
    More info: http://fdstar.net/
    
    Licensed to: Vladimir_Fleks
    Licensed domain: test_com
    License key: 1_a854c96746a7f29a035f8644682ade3df3e8ebda

*/
   var write_span_counter = 0;
function plese_wait_show()
{
	doc_client_height = document.body.clientHeight;
	doc_width = document.body.scrollWidth;
	doc_height = document.body.scrollHeight;
	
	doc_top = document.body.scrollTop;
	
	document.getElementById('busy_layer').style.visibility = 'visible';
	document.getElementById('busy_layer').style.height = doc_height;
	document.getElementById('busy_layer').style.width = doc_width;
	
	document.getElementById('loading-layer').style.display = 'block';
	document.getElementById('loading-layer').style.left = (doc_width/2 - 150)+ 'px';
	document.getElementById('loading-layer').style.top = (doc_top+ doc_client_height/2 - 15)+ 'px';
}
function plese_wait_hide()
{
	document.getElementById('busy_layer').style.visibility = 'hidden';
	document.getElementById('loading-layer').style.display = 'none';
}
function write_span(address)
{
	//alert(1);
	var html_id = 'writed_span_'+ write_span_counter;	
	document.write("<span id='"+ html_id+ "'>...</span>");
	address+= '&html_id='+ html_id;
	
	FDMK(address, 'GET', false);	
	write_span_counter++;
}
function fde_ajax_query(url, html_id)
{
	plese_wait_show();
	FDMK(url+ '&ajax=1&html_id='+ html_id, 'GET', false);
	return false;
}
function fde_post_query(form_id)
{
	plese_wait_show();
	fde_send_form_by_ajax(form_id);
	return false;
}
