function winH() {
    if (window.innerHeight) return window.innerHeight;
    else if (document.documentElement && document.documentElement.clientHeight) return document.documentElement.clientHeight;
    else if (document.body && document.body.clientHeight) return document.body.clientHeight;
    else return false;
}

function setHelements() {
    rcolH=document.getElementById('r-col').offsetHeight;
    lcolH=document.getElementById('l-col').offsetHeight;

    maxH=document.body.offsetHeight;
    (winH()>maxH) ? maxH=winH() : false;
    ((rcolH)>maxH) ? maxH=(rcolH) : false;
    (lcolH>maxH) ? maxH=lcolH : false;

    (document.getElementById && document.all) ? maxH = maxH - 5 : false;    
    document.getElementById('l-col').style.height=maxH;
    document.getElementById('r-col').style.height=maxH;
    document.getElementById('r-colb').style.height=maxH;
    document.getElementById('page').style.height=maxH;

    if (document.getElementById('r-col').offsetHeight < document.getElementById('r-col').scrollHeight) {
        document.getElementById('r-col').style.height = document.getElementById('r-col').scrollHeight;
    }
}

function popupww(gid,id,urlFiles,winw,winh)
{
    if (!pww.closed && pww.location)
    {
        pww.resizeBy(winw-pwwinW(),winh-pwwinH());
        pww.location.href = ("photoview.php?gid="+gid+"&id="+id+urlFiles);
    }
    else
    {
        pww=window.open("photoview.php?gid="+gid+"&id="+id+urlFiles,"pww",'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width='+winw+',height='+winh+',left=0,top=0');
    }
    if (window.focus) {pww.focus()};
}


function pwwinW()
{
    if (pww.innerWidth) return pww.innerWidth;
    else if (pww.document.documentElement && pww.document.documentElement.clientWidth) return pww.document.documentElement.clientWidth;
    else if (pww.document.body && pww.document.body.clientWidth) return pww.document.body.clientWidth;
    else return false;
}

function pwwinH()
{
    if (pww.innerHeight) return pww.innerHeight;
    else if (pww.document.documentElement && pww.document.documentElement.clientHeight) return pww.document.documentElement.clientHeight;
    else if (pww.document.body && pww.document.body.clientHeight) return pww.document.body.clientHeight;
    else return false;
}



window.onresize=setHelements;
window.onload=setHelements;
var pww="";