function goTo($link, $target)
{
    if($target == '_self')
    {
        window.location = $link;
    }
    else
    {
        window.open($link, "", "");
    }
}

function galleryWindow($theURL, $winName, $features)
{
    galleryPopup = window.open($theURL, "gallery", $features);
    galleryPopup.focus();
}

function popup($link, $width, $height)
{
    $w    = $width + 10;
    $h    = $height + 10;
    $left = Math.round((screen.width - $width) / 2);
    $top  = Math.round((screen.height - $height - 100) / 2);
    //alert($left + " - " + $top);
    $pop  = window.open("", "", "width=" + $w + ",height=" + $h + ", left=" + $left + ", top=" + $top + ", resizable=no, location=no, menubar=no, scrollbars=no, status=no, toolbar=no, fullscreen=no, dependent=no,");
    $pop.document.open();
    $pop.document.writeln("<html>");
    $pop.document.writeln("<head>");
    $pop.document.writeln("<title>" + $link + "</title>");
    $pop.document.writeln("<body style='margin: 5px;'>");
    $pop.document.writeln("<img src='" + $link + "' width='" + $width + "' height='" + $height + "' alt='' />");
    $pop.document.writeln("</body>");
    $pop.document.writeln("</html>");
    $pop.document.close();
    $pop.focus();
}

function ipixViewer($link)
{
    $left = Math.round((screen.width - 400) / 2);
    $top  = Math.round((screen.height - 300 - 100) / 2);
    //alert($left + " - " + $top);
    $pop  = window.open("", "ipixViewer", "width=400,height=300, left=" + $left + ", top=" + $top + ", resizable=no, location=no, menubar=no, scrollbars=no, status=no, toolbar=no, fullscreen=no, dependent=no,");
    $pop.document.open();
    $pop.document.writeln("<html>");
    $pop.document.writeln("<head>");
    $pop.document.writeln("<title>IpixViewer</title>");
    $pop.document.writeln("<style type='text/css'>");
    $pop.document.writeln("body { margin: 5px; }");
    $pop.document.writeln("a:link, a:visited { font-weight: bold; font-family: Verdana, Arial, Helvetica; font-size: 14px; color: #006600; text-decoration: none; }");
    $pop.document.writeln("a:hover, a:active { color: #ffcc00; }");
    $pop.document.writeln("</style>");
    $pop.document.writeln("<body bgcolor='#d0f7df'>");
    
    $pop.document.writeln("<center>");
    $pop.document.writeln("<applet code='IpixViewer.class' archive='images/content/java/IpixViewer.jar' align='baseline' width='330' height='240' name='IpixViewer'>");
    $pop.document.writeln("<param name='Warp' value='1'>");
    $pop.document.writeln("<param name='Toolbar' value='large'>");
    $pop.document.writeln("<param name='URL' value='images/content/java/" + $link + "'>");
    $pop.document.writeln("<param name='BackgroundColor' value='#ffffff'>");
    $pop.document.writeln("<param name='HelpURL' value='help/java3_2'>");
    $pop.document.writeln("<param name='SpinSpeed' value='-5'>");
    $pop.document.writeln("<param name='SpinStyle' value='flat'>");
    $pop.document.writeln("</applet>");
    $pop.document.writeln("</center>");
    
    $pop.document.writeln("<br /><div align='right'><a href='javascript: self.close();'>Schliessen</a>&nbsp;&nbsp;&nbsp;</div>");
    $pop.document.writeln("</body>");
    $pop.document.writeln("</html>");
    $pop.document.close();
    $pop.focus();
}
