function loadState(elementId)
{
	this.elementId = elementId
	this.i = 0;
};

loadState.prototype.pageLoading = function(onoff)  // T/F
{
	var loading = document.getElementById(this.elementId);
	if(onoff == true)
	{
		this.i++;
		if(this.i == 1)
			loading.style.display = 'block';
			//loading.innerHTML = loading.innerHTML + i;
	}
	else if(onoff == false)
	{
		this.i--;
		if(this.i == 0)
			loading.style.display = 'none';
	}
};

loadState.prototype.isLoading = function()
{
	if(this.i>0)
		return true;
	else
		return false;
};
