function ShadDlg()
{
	this.container = document.createElement( 'DIV' );
	this.backdrop = document.createElement( 'DIV' );
	this.ieFix = document.createElement( 'IFRAME' );
	this.dialogue = document.createElement( 'DIV' );
	this.posX = 0;
	this.posY = 0;

	this.ieFix.style.opacity = '0';
	this.ieFix.style.filter = 'alpha(opacity=0)';
	
	this.container.className = 'shadDlg';
	this.backdrop.className = 'backdrop';
	this.dialogue.className = 'dialogue';
	
	this.container.style.position = 'absolute';
	this.backdrop.style.position = 'absolute';
	this.dialogue.style.position = 'absolute';
	this.ieFix.style.position = 'absolute';
	
	this.container.style.overflow = 'visible';
	
	this.container.style.top = 0;
	this.container.style.left = 0;
	
	this.container.appendChild( this.ieFix );
	this.container.appendChild( this.backdrop );
	this.container.appendChild( this.dialogue );
}

ShadDlg.prototype.setContent = function( newContent )
{
	this.dialogue.innerHTML = newContent;
}

ShadDlg.prototype.show = function()
{
	document.body.appendChild( this.container );
	this.update();
}

ShadDlg.prototype.update = function()
{
	this.layBackdrop();
	this.centerDialogue();
}

ShadDlg.prototype.layBackdrop = function()
{
	var h;
	var w;
	
	var docH = document.body.clientHeight;
	var docW = document.body.clientWidth;
	
	var viewH;
	var viewW;

	if( window.innerHeight != undefined )
	{
		viewH = window.innerHeight;
		viewW = window.innerWidth;
	}
	else
	{
		viewH = document.documentElement.clientHeight;
		viewW = document.documentElement.clientWidth;
	}

	if( docH > viewH )
	{
		h = docH;
		w = docW;
	}
	else
	{
		h = viewH;
		w = viewW;
	}

	this.ieFix.style.height = h + 'px';
	this.ieFix.style.width = w + 'px';

	this.backdrop.style.height = h + 'px';
	this.backdrop.style.width = w + 'px';
}

ShadDlg.prototype.centerDialogue = function()
{
	var posY;
	var posX;
	
	var viewH;
	var viewW;

	if( window.innerHeight != undefined )
	{
		viewH = window.innerHeight;
		viewW = window.innerWidth;
	}
	else
	{
		viewH = document.documentElement.clientHeight;
		viewW = document.documentElement.clientWidth;
	}
	
	var scrollY;
	var scrollX;
	
	if( typeof( window.pageYOffset ) == 'number' )
	{
		scrollY = window.pageYOffset;
		scrollX = window.pageXOffset;
	}
	else if( document.documentElement && typeof( document.documentElement.scrollLeft ) == 'number' )
	{
		scrollY = document.documentElement.scrollTop;
		scrollX = document.documentElement.scrollLeft;
	}
	else
	{
		scrollY = document.body.scrollTop;
		scrollX = document.body.scrollLeft;
	}
	
	var eleH = 0;
	var eleW = 0;
	
	if( this.dialogue.offsetWidth )
		eleW = this.dialogue.offsetWidth;
	if( this.dialogue.offsetHeight )
		eleH = this.dialogue.offsetHeight;
	
	posY = viewH/2 + scrollY - eleH/2;
	posX = viewW/2 + scrollX - eleW/2;
	
	this.dialogue.style.top = posY + 'px';
	this.dialogue.style.left = posX + 'px';
}

ShadDlg.prototype.hide = function()
{
	document.body.removeChild( this.container );
}

ShadDlg.prototype.destroy = function()
{
	this.hide();
	return null;
}