var dragapproved=false;
var minrestore=0;
var initialwidth,initialheight;
var ie5=document.all&&document.getElementById;
var ns6=document.getElementById&&!document.all;
var kk;
var tempx=0;
var tempy=0;

function iecompattest(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function drag_drop(e){    
if (ie5&&dragapproved&&event.button==1){
kk.style.left=(tempx+event.clientX-offsetx)+"px"
kk.style.top=(tempy+event.clientY-offsety)+"px"
}
else if (ns6&&dragapproved){
kk.style.left=(tempx+e.clientX-offsetx)+"px"
kk.style.top=(tempy+e.clientY-offsety)+"px"
}                                                                        
}

function initializedrag(e){
offsetx=ie5? event.clientX : e.clientX
offsety=ie5? event.clientY : e.clientY
//document.getElementById("dwindowcontent").style.display="none" //extra
kk=document.getElementById("dwindow");
tempx=kk.offsetLeft
tempy=kk.offsetTop

dragapproved=true
document.onmousemove=drag_drop
}

function stopdrag(){
dragapproved=false;
document.onmousemove=null;
//document.kk.style.display="" //extra
}



function okno_detail(url, features) {
detail=window.open(url, '', features);
if (!detail.opener) {
detail.opener = self;
}
if (window.focus) {
detail.focus();
}
return false;
}


