if (typeof dhtmlwindow=="undefined")
alert('ERROR: Modal Window script requires all files from "DHTML Window widget" in order to work!')

var dhtmlmodal={
veilstack: 0,
open:function(t, contenttype, contentsource, title, attr, recalonload){
	var d=dhtmlwindow 
	this.interVeil=document.getElementById("interVeil") 
	this.veilstack++
	this.loadveil()
	if (typeof recalonload!="undefined" && recalonload=="recal" && d.scroll_top==0)
		d.addEvent(window, function(){dhtmlmodal.loadveil()}, "load")
		var t=d.open(t, contenttype, contentsource, title, attr, recalonload)
	t.controls.firstChild.style.display="none"
	t.controls.onclick=function(){dhtmlmodal.forceclose(this._parent)}
	t.show=function(){dhtmlmodal.show(this)}
	t.hide=function(){dhtmlmodal.close(this)}
return t
},


loadveil:function(){
	var d=dhtmlwindow
	d.getviewpoint()
	this.docheightcomplete=(d.standardbody.offsetHeight>d.standardbody.scrollHeight)? d.standardbody.offsetHeight : d.standardbody.scrollHeight
	this.interVeil.style.width=d.docwidth+"px"
	this.interVeil.style.height=this.docheightcomplete+"px"
	this.interVeil.style.left=0
	this.interVeil.style.top=0
	this.interVeil.style.visibility="visible"
	this.interVeil.style.display="block"
},

adjustveil:function(){
	if (this.interVeil && this.interVeil.style.display=="block")
		this.loadveil()
},


close:function(t){
	t.contentDoc=(t.contentarea.datatype=="iframe")? window.frames["_iframe-"+t.id].document : t.contentarea
	var closewinbol=dhtmlwindow.close(t)
	if (closewinbol){ 
		this.veilstack--
		if (this.veilstack==0) 
			this.interVeil.style.display="none"
 }
},

forceclose:function(t){ 
	dhtmlwindow.rememberattrs(t)
	t.style.display="none"
	this.veilstack--
		if (this.veilstack==0) 
			this.interVeil.style.display="none"
},

show:function(t){
	dhtmlmodal.veilstack++
	dhtmlmodal.loadveil()
	dhtmlwindow.show(t)
}
}


document.write('<div id="interVeil"></div>')
dhtmlwindow.addEvent(window, function(){if (typeof dhtmlmodal!="undefined") dhtmlmodal.adjustveil()}, "resize")