﻿

// Define the BusyBox class (function)
function MsgBox(id, instanceVarName,msgText)
{
	// Initialize object
	this.id = id;
	this.Enabled = true;
	
	// Retain the name of the instantiated object variable so that we can animate using the setTimeout statement
	this.instanceVarName = instanceVarName;
	
	div = document.getElementById(this.id);
	
	this.ImageWidth = div.clientWidth;
	this.ImageHeight = div.clientHeight;
		
	// Center the BusyBox in the window regardless of the scroll positions
	ImageLeft = (document.body.clientWidth)/2;
	ImageTop = (document.body.clientHeight)*2;
	
	ImageLeft = ImageLeft + document.body.scrollLeft;
	ImageTop = ImageTop + document.body.scrollTop;
	
	div = document.getElementById(this.id);
	
	div.style.display = "block";
	div.style.position = "absolute";
	div.style.zIndex = "99999" ;

	var div = document.getElementById("msgText");
	
	div.innerHTML = msgText;
			
}

MsgBox.prototype.Hide = function()
{
	div = document.getElementById(this.id);
	div.style.display = "none";
}
