function popup(f,width,height,link)
{
  w = window.open("","","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width="+width+", height="+height);
  with ( w.document ) {
    writeln("<html><head><title>Werk aan de Winkel</title>");
    writeln("<link rel=\"stylesheet\" href=\"style/screen.css\" type=\"text/css\">");
    writeln("</head>");
    writeln("<body id=\"body\" onBlur=\"window.close()\"><div id=\"popup\">");
    if (link) {
      writeln("<a href=\""+link+"\" target=\"_new\">");
    }
    writeln("<img src=\""+f+"\">");
    if (link) {
      writeln("</a>");
    }
    writeln("</div></body></html>");
  }
}

function togglediv( id, vis ) // 1 visible, 0 hidden
{
    if ( document.layers ) { obj = document.layers[id]; }
    else if (document.getElementById) { obj = document.getElementById(id).style; }
    else if (document.all[id]) { obj = document.all[id].style; }

    if ( document.layers ) {
        obj.visibility = vis ? "show" : "hide";
    } else {
        obj.visibility = vis ? "visible" : "hidden";
    }
}

function movedivx(id, x) {
    browserName = navigator.appName;
    if ( document.layers ) { obj = document.layers[id]; }
    else if (document.getElementById) { obj = document.getElementById(id).style; }
    else if (document.all[id]) { obj = document.all[id].style; }

    if (browserName == "Microsoft Internet Explorer") {
        obj.marginLeft = x + "px";
    } else {
        obj.marginLeft = x + "px";
    }
}

function movedivy(id, y) {
    obj = document.layers ? document.layers[id].visibility :
              document.getElementById ? document.getElementById(id).style :
                   document.all[id].style;

    obj.top = y;
}

function movedivxy(id, x, y) {
    movedivx(id, x);
    movedivy(id, y);
}

function move( x ) {
    movedivx( "trans_top", x );
    togglediv( "trans_top", 1 );
    movedivx( "trans_bottom", x );
    togglediv( "trans_bottom", 1 );
}

function fade() {
    togglediv( "trans_top", 0 );
    togglediv( "trans_bottom", 0 );
}
