var LoadingDialog = new Object();
LoadingDialog.ShowWindow = function(width,height, imgUrl,message)
{
	var	windowstr =	this.WindowCode(imgUrl,message);

	//create the iframe
	theiFrame=document.createElement('iFrame');
	theiFrame.id='myiFrame';
	theiFrame.style.filter='alpha(opacity=0)';
	theiFrame.style.position='absolute';
	theiFrame.style.zIndex=999998; //iFrame	will be	just below the theDiv
	theiFrame.src="/hfsecure/blank.htm";
	document.body.appendChild(theiFrame);

	document.getElementById("infoDiv").innerHTML=windowstr;
	document.getElementById("infoDiv").style.left=((document.body.clientWidth-width)>0?(document.body.clientWidth-width):0)/2+"px";
	document.getElementById("infoDiv").style.top=((document.body.clientHeight-height)>0?(document.body.clientHeight-height):0)/2+"px";
	document.getElementById("infoDiv").style.width=width;
	document.getElementById("infoDiv").style.height=height;
	document.getElementById("tranDiv").style.height=(document.body.clientHeight*2)+	"px";
	document.getElementById("tranDiv").style.width=document.body.clientWidth+ "px";
	document.getElementById("tranDiv").style.display="";
	document.getElementById("tranDivBack").style.display="";
	document.getElementById("infoDiv").style.display="";
	
	//set the position of the iframe and display it
	theiFrame.style.top=-1;	//one less than	the	value given	for	theDiv
	theiFrame.style.left=-1; //one less	than the value given for theDiv
	theiFrame.style.height = document.body.clientHeight+ "px";
	theiFrame.style.width =	document.body.clientWidth+ "px";
	theiFrame.style.display='block';
	return theiFrame;
}
	
LoadingDialog.WindowCode = function(imgUrl, message)
{
	if(message == null)
		message = "Processing...";
	var windowstr = "<table border=0 cellpadding=0 cellspacing=0>";
	windowstr += "<tr><td><img src='"+imgUrl+"' alt='"+message+"' border='0'></td></tr>";
	windowstr += "<tr><td height=18 class=broadFont align=center>"+message+"</td></tr>";
	windowstr += "</table>";

	return windowstr;			
}
	
LoadingDialog.Close = function(theiFrame)
{
	theiFrame.style.display="none";
	document.getElementById("tranDiv").style.display="none";
	document.getElementById("tranDivBack").style.display="none";
	document.getElementById("infoDiv").style.display="none";
}