var dragapproved=false
var minrestore=0
var initialwidth,initialheight
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all
var browser=navigator.appName;
var b_version=navigator.appVersion;
var version=parseFloat(b_version);

function iecompattest(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function drag_drop_image_big(e){
if (ie5&&dragapproved&&event.button==1){
document.getElementById("dwindow_image_big").style.left=tempx+event.clientX-offsetx+"px"
document.getElementById("dwindow_image_big").style.top=tempy+event.clientY-offsety+"px"
}
else if (ns6&&dragapproved){
document.getElementById("dwindow_image_big").style.left=tempx+e.clientX-offsetx+"px"
document.getElementById("dwindow_image_big").style.top=tempy+e.clientY-offsety+"px"
}
}

function initializedrag_image_big(e){
offsetx=ie5? event.clientX : e.clientX
offsety=ie5? event.clientY : e.clientY
document.getElementById("dwindowcontent_image_big").style.display="none" //extra
tempx=parseInt(document.getElementById("dwindow_image_big").style.left)
tempy=parseInt(document.getElementById("dwindow_image_big").style.top)

dragapproved=true
document.getElementById("dwindow_image_big").onmousemove=drag_drop_image_big
}

function loadwindow_image_big(url,width,height){

if (!ie5&&!ns6 || browser=="Microsoft Internet Explorer")
window.open(url,"","width=width,height=height,scrollbars=0")
else{

document.getElementById("dwindow_image_big").style.display='block';

document.getElementById("dwindow_image_big").style.width=initialwidth=width+"px";

document.getElementById("dwindow_image_big").style.height=initialheight=height+"px";
document.getElementById("dwindow_image_big").style.left="250px";
document.getElementById("dwindow_image_big").style.top=-ns6? window.pageYOffset*1+30+"px" : iecompattest().scrollTop*1+30+"px";

//document.getElementById("cframe_image_big").style.width=initialwidth=width+"px"
//document.getElementById("cframe_image_big").style.height=initialheight=height+"px"
//document.getElementById("cframe_image_big").src=url;
//alert("ok");
}
}

function maximize_image_big(){
if (minrestore==0){
minrestore=1 //maximize window
document.getElementById("maxname_image_big").setAttribute("src","restore.gif")
document.getElementById("dwindow_image_big").style.width=ns6? window.innerWidth-20+"px" : iecompattest().clientWidth+"px"
document.getElementById("dwindow_image_big").style.height=ns6? window.innerHeight-20+"px" : iecompattest().clientHeight+"px"
}
else{
minrestore=0 //restore window
document.getElementById("maxname_image_big").setAttribute("src","max.gif")
document.getElementById("dwindow_image_big").style.width=initialwidth
document.getElementById("dwindow").style.height=initialheight
}
document.getElementById("dwindow_image_big").style.left=ns6? window.pageXOffset+"px" : iecompattest().scrollLeft+"px"
document.getElementById("dwindow_image_big").style.top=ns6? window.pageYOffset+"px" : iecompattest().scrollTop+"px"
}

function closeit_image_big(){

document.getElementById("dwindow_image_big").style.display="none"
}

function stopdrag_image_big(){
dragapproved=false;
document.getElementById("dwindow_image_big").onmousemove=null;
document.getElementById("dwindowcontent_image_big").style.display="" //extra
}

