//--------------WerteFenster--------------------------------------

//DHTML Window script- Copyright Dynamic Drive (http://www.dynamicdrive.com)
//For full source code, documentation, and terms of usage,
//Visit http://www.dynamicdrive.com/dynamicindex9/dhtmlwindow.htm

var seldragapproved=false
var selminrestore=0
var selinitialwidth,selinitialheight
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all

function seldrag_drop(e){
if (ie5&&seldragapproved&&event.button==1){
document.getElementById("selwindow").style.left=tempx+event.clientX-offsetx
document.getElementById("selwindow").style.top=tempy+event.clientY-offsety
}
else if (ns6&&seldragapproved){
document.getElementById("selwindow").style.left=tempx+e.clientX-offsetx
document.getElementById("selwindow").style.top=tempy+e.clientY-offsety
}
}

function selinitializedrag(e){
offsetx=ie5? event.clientX : e.clientX
offsety=ie5? event.clientY : e.clientY
if (ie5)
document.getElementById("selsaver").style.display=''

tempx=parseInt(document.getElementById("selwindow").style.left)
tempy=parseInt(document.getElementById("selwindow").style.top)

seldragapproved=true
document.onmousemove=seldrag_drop
}

function selloadwindow(url,width,height){
if (!ie5&&!ns6)
window.open(url,"","width=width,height=height,scrollbars=1")
else{
document.getElementById("selwindow").style.display=''
document.getElementById("selwindow").style.width=selinitialwidth=width
document.getElementById("selwindow").style.height=selinitialheight=height
document.getElementById("selwindow").style.left=30
document.getElementById("selwindow").style.top=ns6? window.pageYOffset*1+30 : document.body.scrollTop*1+30
document.getElementById("selframe").src=url
}
}

function selmaximize(){
if (selminrestore==0){
selminrestore=1 //maximize window
document.getElementById("selmaxname").setAttribute("src","images/restore.gif")
document.getElementById("selwindow").style.width=ns6? window.innerWidth-20 : document.body.clientWidth
document.getElementById("selwindow").style.height=ns6? window.innerHeight-20 : document.body.clientHeight
}
else{
selminrestore=0 //restore window
document.getElementById("selmaxname").setAttribute("src","images/max.gif")
document.getElementById("selwindow").style.width=selinitialwidth
document.getElementById("selwindow").style.height=selinitialheight
}
document.getElementById("selwindow").style.left=ns6? window.pageXOffset : document.body.scrollLeft
document.getElementById("selwindow").style.top=ns6? window.pageYOffset : document.body.scrollTop
}

function selcloseit(){
document.getElementById("selwindow").style.display="none"
}

//if (ie5||ns6)
//document.onmouseup=new Function("seldragapproved=false;document.onmousemove=null;document.getElementById('selsaver').style.display='none'")


