function popUp(URL,w,h,scroll,isfoto,fotodesc) {
    day = new Date();
    id = day.getTime();
    if (scroll) {
        scrlbr = 1;
    } else {
        scrlbr = 0;
    }
    /*txt="available width: "+screen.availWidth+"\n";
    txt=txt+"available height: "+screen.availHeight+"\n";
    txt=txt+"passed width: "+w+"\n";
    txt=txt+"passed height: "+h+"\n";*/
    if (w > screen.availWidth || h > screen.availHeight) {
        facw=screen.availWidth/w;
        availheight = screen.availHeight - 80;
        fach=availheight/h;
        fac=Math.min(facw,fach);
        w = w*fac;
        h = h*fac;
        /*txt=txt+"factor width: "+facw+"\n";
        txt=txt+"factor height: "+fach+"\n";
        txt=txt+"resulting factor: "+fac+"\n";
        txt=txt+"calculated width: "+w+"\n";
        txt=txt+"calculated height: "+h+"\n";*/
        //scrlbr = 1;
    }
    l = (screen.availWidth-w)/2;
    t = (screen.availHeight-h)/2;
    /*txt=txt+"calculated top: "+t+"\n";
    txt=txt+"calculated left: "+l+"\n";*/
    //alert(txt);
    //if (fotodesc) {
        /*Dit gaat niet goed als taalomschrijving leeg is.
          Kan fotodsc dus niet gebruiken om te bepalen of het om
          een foto gaat die geopend moet worden.*/
    if (isfoto) {
        URL=URL+"&w="+w+"&h="+h+"&desc="+fotodesc;
    }
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars="+scrlbr+",location=0,statusbar=0,menubar=0,resizable=0,width="+w+",height="+h+",left ="+l+",top ="+t+"');");
}
