﻿
function SetSystemWorking() {
	setTimeout('SystemWorking( )', 50);
}

function StopSystemWorking() {
	var div = document.getElementById('divLoadingSystem');
	if (div) {
		div.style.display = "none";
	}
}

function SystemWorking() {
	var div = document.getElementById('divLoadingSystem');
	var img = document.getElementById('imgSpinner');
	var scrollLeft = document.documentElement.scrollLeft;
	var scrollTop = document.documentElement.scrollTop;
	var divWidth = 200;
	var divHeight = 100;
	if (div) {
		divWidth = div.style.width.replace("px", "");
		divHeight = div.style.height.replace("px", "");
	}
	var screenWidth = document.documentElement.clientWidth / 2;
	var screenHeight = document.documentElement.clientHeight / 2;

	if (div) {
		div.style.display = "block";
		div.style.left = ((scrollLeft + screenWidth) - (divWidth / 2)) + "px";
		div.style.top = ((scrollTop + screenHeight) - (divHeight / 2)) + 50 + "px";
		img.src = "images/spinner.gif";
	}
}
