var dhtmlwindow1={
imagefiles:['tl_files/img/5242.png'],
zIndexvalue:100,
tobjects: [],
lastactivet: {},
init:function(t){
	var domwindow=document.createElement("div")
	domwindow.id=t
	domwindow.className = "dhtmlwindow"
	var domwindowdata = ''
	if ( $.browser.msie ){

		domwindowdata  = '<div style="border-left:2px solid #BDBDBD;border-top:2px solid #BDBDBD;float:left;height:17px;"></div><div style="border-top:2px solid #BDBDBD;float:left;height:17px;background-color:#BDBDBD;"></div><div style="border-right:2px solid #BDBDBD;float:left;height:17px;border-top:2px solid #BDBDBD;"></div>'
		domwindowdata += '<div class="drag-handle" style="background-color:#BDBDBD;margin-left:0px;color:#464646;font-size:12px;font-weight:normal;text-align:left;">'
		domwindowdata += 'DHTML Window  <div class="drag-controls"  style="right:94px;top:5px"><img src="'+this.imagefiles[0]+'" title="Close" /></div></div><div style="border-left:2px solid #BDBDBD;float:left;clear:both;width:0px">'
		domwindowdata += '</div><div class="drag-contentarea"></div><div style="border-right:2px solid #BDBDBD;float:left;"></div>'
		domwindowdata += '<div class="drag-statusarea"><div class="drag-resizearea" >&nbsp;</div></div>'
		
		domwindowdata += '<div style="border-left:2px solid #BDBDBD;float:left;clear:left;border-bottom:2px solid #BDBDBD;height:0px"></div><div style="border-bottom:2px solid #BDBDBD;float:left;height:0px">&nbsp;</div><div  style="border-right:2px solid #BDBDBD;float:left;border-bottom:2px solid #BDBDBD;height:0px"></div>'
		
		domwindowdata += '</div>' 
	}else{
		domwindowdata  = '<div style="border-left:2px solid #BDBDBD;border-top:2px solid #BDBDBD;float:left;height:17px;"></div><div style="border-top:2px solid #BDBDBD;float:left;height:17px;background-color:#BDBDBD;"></div><div style="border-right:2px solid #BDBDBD;float:left;height:17px;border-top:2px solid #BDBDBD;"></div>'
		domwindowdata += '<div style="border-left:2px solid #BDBDBD;float:left;clear:both;width:0px"><div class="drag-handle" style="background-color:#BDBDBD;margin-left:0px;color:#464646;font-size:12px;font-weight:normal;text-align:left;">'
		domwindowdata += 'DHTML Window  <div class="drag-controls"  style="right:94px;top:5px"><img src="'+this.imagefiles[0]+'" title="Close" /></div></div>'
		domwindowdata += '</div><div class="drag-contentarea"></div><div style="border-right:2px solid #BDBDBD;float:left;"></div>'
		domwindowdata += '<div class="drag-statusarea"><div class="drag-resizearea" >&nbsp;</div></div>'
		domwindowdata += '<div style="border-left:2px solid #BDBDBD;float:left;clear:left;border-bottom:2px solid #BDBDBD"></div><div style="border-bottom:2px solid #BDBDBD;float:left;"></div><div  style="border-right:2px solid #BDBDBD;float:left;border-bottom:2px solid #BDBDBD"></div>'
		domwindowdata += '</div>' 
	}
	domwindow.innerHTML=domwindowdata
	document.getElementById("dhtmlwindowholder").appendChild(domwindow)
	var t=document.getElementById(t)
	var divs=t.getElementsByTagName("div")
	for (var i=0; i<divs.length; i++){
		if (/drag-/.test(divs[i].className))
			t[divs[i].className.replace(/drag-/, "")]=divs[i]
	}
	t.handle._parent=t
	t.resizearea._parent=t
	t.controls._parent=t
	t.onclose=function(){return true}
	t.onmousedown=function(){dhtmlwindow1.setfocus(this)}
	t.handle.onmousedown=dhtmlwindow1.setupdrag
	t.resizearea.onmousedown=dhtmlwindow1.setupdrag
	t.close=function(){dhtmlwindow1.close(this)}
	t.setSize=function(w, h){dhtmlwindow1.setSize(this, w, h)}
	t.moveTo=function(x, y){dhtmlwindow1.moveTo(this, x, y)}
	t.isResize=function(bol){dhtmlwindow1.isResize(this, bol)}
	t.isScrolling=function(bol){dhtmlwindow1.isScrolling(this, bol)}
	t.load=function(contenttype, contentsource, title){dhtmlwindow1.load(this, contenttype, contentsource, title)}
	this.tobjects[this.tobjects.length]=t
	return t
},
open:function(t, contenttype, contentsource, title, attr, recalonload){
	var d=dhtmlwindow1
	function getValue(Name){
		var config=new RegExp(Name+"=([^,]+)", "i")
		return (config.test(attr))? parseInt(RegExp.$1) : 0
	}
	if (document.getElementById(t)==null)
		t=this.init(t)
	else
		t=document.getElementById(t)
	this.setfocus(t)
	t.setSize(getValue(("width")), (getValue("height")))
	var xpos=getValue("center")? "middle" : getValue("left")
	var ypos=getValue("center")? "middle" : getValue("top")
	t.isResize(getValue("resize"))
	t.isScrolling(getValue("scrolling"))
	t.style.visibility="visible"
	t.style.display="block"
	t.contentarea.style.display="block"
	t.moveTo(xpos, ypos)
	t.load(contenttype, contentsource, title)
	if (t.state=="minimized" && t.controls.firstChild.title=="Restore"){
		t.controls.firstChild.setAttribute("src", dhtmlwindow1.imagefiles[0])
		t.controls.firstChild.setAttribute("title", "Minimize")
		t.state="fullview"
	}
	return t
},
setSize:function(t, w, h){
	w = Math.max(parseInt(w), 150)
	t.style.width = w+"px"
	h = Math.max(parseInt(h), 100)
	t.contentarea.style.width = (w-92) +'px';
	t.childNodes[1].style.width = (w-92) +'px';
	if ($.browser.msie){
		t.handle.style.width = (w-90) +'px';
		t.contentarea.style.height=(h+1)+"px"
		t.childNodes[9].style.width = (w-92) +'px';
		t.contentarea.previousSibling.style.height=(h+7)+"px"
		t.contentarea.nextSibling.style.height=(h+7)+"px"
	}else{
		t.contentarea.previousSibling.style.height=(h+8)+"px"
		t.contentarea.nextSibling.style.height=(h+8)+"px"
		t.handle.style.width = (w-92) +'px';
		t.contentarea.style.height=(h)+"px"
		t.childNodes[8].style.width = (w-92) +'px';
	}
},
moveTo:function(t, x, y){
	this.getviewpoint()
	t.style.left=(x=="middle")? this.scroll_left+(this.docwidth-t.offsetWidth)/2+"px" : this.scroll_left+parseInt(x)+"px"
	t.style.top=(y=="middle")? this.scroll_top+(this.docheight-t.offsetHeight)/2+"px" : this.scroll_top+parseInt(y)+"px"
},
isResize:function(t, bol){
	t.statusarea.style.display=(bol)? "block" : "none"
	t.resizeBool=(bol)? 1 : 0
},
isScrolling:function(t, bol){
	t.contentarea.style.overflow=(bol)? "auto" : "hidden"
},
load:function(t, contenttype, contentsource, title){
	if (t.isClosed){
		alert("DHTML Window has been closed, so no window to load contents into. Open/Create the window again.")
		return
	}
	var contenttype=contenttype.toLowerCase()
	if (typeof title!="undefined")
		t.handle.firstChild.nodeValue=title
	if (contenttype=="inline")
		t.contentarea.innerHTML=contentsource
	else if (contenttype=="div"){
		var inlinedivref=document.getElementById(contentsource)
		t.contentarea.innerHTML=(inlinedivref.defaultHTML || inlinedivref.innerHTML)
		if (!inlinedivref.defaultHTML)
			inlinedivref.defaultHTML=inlinedivref.innerHTML
		inlinedivref.innerHTML=""
		inlinedivref.style.display="none"
	}
	else if (contenttype=="iframe"){
		t.contentarea.style.overflow="hidden"
		if (!t.contentarea.firstChild || t.contentarea.firstChild.tagName!="IFRAME")
			t.contentarea.innerHTML='<iframe src="" style="margin:0; padding:0; width:100%; height: 100%" name="_iframe-'+t.id+'"></iframe>'
		window.frames["_iframe-"+t.id].location.replace(contentsource)
	}
	t.contentarea.datatype=contenttype
},
setupdrag:function(e){
	var d=dhtmlwindow1
	var t=this._parent
	d.etarget=this
	var e=window.event || e
	d.initmousex=e.clientX
	d.initmousey=e.clientY
	d.initx=parseInt(t.offsetLeft)
	d.inity=parseInt(t.offsetTop)
	d.width=parseInt(t.offsetWidth)
	d.contentheight=parseInt(t.contentarea.offsetHeight)
	if (t.contentarea.datatype=="iframe"){
		t.style.backgroundColor="#F8F8F8"
		t.contentarea.style.visibility="hidden"
	}
	document.onmousemove=d.getdistance
	document.onmouseup=function(){
		if (t.contentarea.datatype=="iframe"){
			t.contentarea.style.backgroundColor="white"
			t.contentarea.style.visibility="visible"
		}
		d.stop()
	}
	return false
},
getdistance:function(e){
	var d=dhtmlwindow1
	var etarget=d.etarget
	var e=window.event || e
	d.distancex=e.clientX-d.initmousex
	d.distancey=e.clientY-d.initmousey
	if (etarget.className=="drag-handle")
		d.move(etarget._parent, e)
	return false
},
getviewpoint:function(){
	var ie=document.all && !window.opera
	var domclientWidth=document.documentElement && parseInt(document.documentElement.clientWidth) || 100000
	this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
	this.scroll_top=(ie)? this.standardbody.scrollTop : window.pageYOffset
	this.scroll_left=(ie)? this.standardbody.scrollLeft : window.pageXOffset
	this.docwidth=(ie)? this.standardbody.clientWidth : (/Safari/i.test(navigator.userAgent))? window.innerWidth : Math.min(domclientWidth, window.innerWidth-16)
	this.docheight=(ie)? this.standardbody.clientHeight: window.innerHeight
},
move:function(t, e){
	t.style.left=dhtmlwindow1.distancex+dhtmlwindow1.initx+"px"
	t.style.top=dhtmlwindow1.distancey+dhtmlwindow1.inity+"px"
},
close:function(t){
	try{
		var closewinbol=t.onclose()
	}
	catch(err){
		var closewinbol=true
	}
	finally{
		if (typeof closewinbol=="undefined"){
			alert("An error has occu#BDBDBD somwhere inside your \"onclose\" event handler")
			var closewinbol=true
		}
	}
	if (closewinbol){
		if (window.frames["_iframe-"+t.id])
			window.frames["_iframe-"+t.id].location.replace("about:blank")
		else
			t.contentarea.innerHTML=""
		t.style.display="none"
		t.isClosed=true
	}
	return closewinbol
},
setfocus:function(t){
	this.zIndexvalue++
	t.style.zIndex=this.zIndexvalue
	t.isClosed=false
	this.lastactivet=t
},
stop:function(){
	dhtmlwindow1.etarget=null
	document.onmousemove=null
	document.onmouseup=null
}
}
document.write('<div id="dhtmlwindowholder" ><span style="display:none">.</span></div>')
if (typeof dhtmlwindow1=="undefined")
alert('ERROR: Modal Window script requires all files from "DHTML Window widget" in order to work!')
var layermodal={
veilstack: 0,
open:function(t, contenttype, contentsource, title, attr, recalonload){
	var d=dhtmlwindow1
	this.interVeil=document.getElementById("interVeil")
	this.veilstack++
	var t=d.open(t, contenttype, contentsource, title, attr, recalonload)
	t.controls.firstChild.style.display="block"
	t.controls.onclick=function(){layermodal.close(this._parent, true)}
	return t
},
close:function(t, forceclose){
	t.contentDoc=(t.contentarea.datatype=="iframe")? window.frames["_iframe-"+t.id].document : t.contentarea
	if (typeof forceclose!="undefined")
		t.onclose=function(){return true}
	dhtmlwindow1.close(t)
}
}
