function splash_Engine() {

	this.layerNr = 0;
	this.opacity = 70;
	this.zIndex = 100;
	this.queue = new Object();

};

splash_Engine.prototype = {

	newLayer: function(p, dim, windowName) {
		var w,h;
		var test1 = dim.scrollHeight;
		var test2 = dim.offsetHeight;

		w = dim.scrollWidth;
		h = dim.scrollHeight;
		

		// all but Explorer Mac
		if ( dim.offsetHeight > h ) 
		{
			w = dim.offsetWidth;
			h = dim.offsetHeight;
		}

		if ( window.innerHeight > h ) 
		{
			w = window.innerWidth;
			h = window.innerHeight;
		}

		if ( document.documentElement.clientHeight > h ) 
		{
			w = document.documentElement.clientWidth;
			h = document.documentElement.clientHeight;
		}

		var splash = document.createElement('div');
		splash.setAttribute('id', windowName + 'splash' + this.layerNr);

		splash.style.left = 0;
		splash.style.top = 0;
		splash.style.width = w+'px';
		splash.style.height = h+'px';

		splash.style.visibility = 'visible';
		splash.style.position = 'absolute';
		splash.style.backgroundColor = '#ffffff';

		splash.style.zIndex = getZIndex();

		splash.style.opacity = (this.opacity / 100);
		splash.style.MozOpacity = (this.opacity / 100);
		splash.style.KhtmlOpacity = (this.opacity / 100);
		splash.style.filter = "alpha(opacity=" + this.opacity + ")"; 

		p.appendChild(splash);

		this.queue[windowName + 'splash' + this.layerNr] = splash;
		this.layerNr++;
	},

	remove: function(p, windowName) {
		if ( this.layerNr == 0 ) {
			return;
		}

		var splash = this.queue[windowName + 'splash' + (this.layerNr - 1) ];
		p.removeChild(splash);

		this.layerNr--;
	}

}

var splash = new splash_Engine();