function CLoadingWindow(LoadingWindowID, Text){

	this.LoadingWindowID = LoadingWindowID;
	this.Text = Text;
	this.WorkingDocument = null;

	this.Show = function(){ //bAttachToParentWindow
		//bAttachToParentWindow = ( typeof(bAttachToParentWindow) == "undefined" || bAttachToParentWindow == false) ? false : true;
		bAttachToParentWindow = true;
		
		this.WorkingDocument = document;
		if(bAttachToParentWindow && typeof(window.top) != "undefined")
			this.WorkingDocument = window.top.document;
	
		var Div = this.WorkingDocument.createElement("DIV");
		Div = this.WorkingDocument.all("BodyDataContainer").appendChild(Div);

		Div.style.width = this.WorkingDocument.body.scrollWidth + 0;
		Div.style.height = this.WorkingDocument.body.scrollHeight + 0;
		Div.style.position = 'absolute';
		Div.style.top = '0px';
		Div.style.left = '0px';
		Div.style.zIndex = '200';
		//Div.setCapture(false);
		Div.onclick = new Function("return false");
		Div.onmouseover = new Function("return false");
		Div.onmouseout = new Function("return false");
		Div.onkeydown = new Function("return false");
		Div.onkeypress = new Function("return false");
		Div.onkeyup = new Function("return false");
		
		var Img = this.WorkingDocument.createElement("IMG");
		Img.src = "ApplicationFiles/Controls/SharedResources/Images/Spacer.gif";
		Img.style.width = document.body.scrollWidth + 0;
		Img.style.height = document.body.scrollHeight + 0;
		
		Div.appendChild(Img);

		var Message = this.WorkingDocument.createElement("DIV");
		Div.id = "_LoadingWindow_" + this.LoadingWindowID;
		Message = Div.appendChild(Message);
		Message.style.filter = "progid:DXImageTransform.Microsoft.dropshadow(OffX=3, OffY=3, Color='gray', Positive='true')";
		Message.style.width = "300px";
		Message.style.height = "40px";
		Message.style.border = "1px solid Tan";
		Message.style.backgroundColor = "Beige";
		Message.style.position = 'absolute';
		Message.style.top = ((Div.style.posHeight - 40) / 2) +'px';
		Message.style.left = ((Div.style.posWidth - 300) / 2) +'px';
		Message.style.paddingTop = "11px";
		Message.style.zIndex = '201';
		Message.align = "center";
		Message.innerText = this.Text;
		
		Message.focus();
	}
	
	this.Hide = function(){
		var LoadingWindow = this.WorkingDocument.all("_LoadingWindow_" + this.LoadingWindowID);
		if(LoadingWindow != null){
			if(LoadingWindow.length){
				for(var i = 0; i < LoadingWindow.length; i++){
					LoadingWindow[i].removeNode(true);
				}
			}else{
				LoadingWindow.removeNode(true);
			}
		}
	}
	
}
