/* http://www.gertrud-von-helfta.de
 * $Id: winpop.js,v 1.3 2005/05/24 21:20:34 ringler Exp $
 */
function popWin(winText,winName,winTitle,winWidth,winHeight)
{
    winText=winText.replace(/((<BR>){1,10})$/g,"<BR>");
    scr="yes"; //"no" to activate screen-dependent scollbars
    var maxx=screen.availHeight-30; 
    if(maxx < winHeight){
     winHeight=maxx;
     winWidth+=15;
     scr="yes";
     }
    maxx=screen.availWidth-15;    
    if(maxx < winWidth){
     winWidth=maxx;
     scr="yes";
     }    
    specs="resizable=yes,scrollbars="+scr+",width="+winWidth+",height="+winHeight+"screenX=5,screenY=5";
    win=window.open("",winName, specs);
    win.resizeTo(winWidth, winHeight);
    win.document.open();
    win.document.writeln("<HTML><HEAD><TITLE>"+winTitle+"</TITLE>");
    win.document.writeln("<link rel='stylesheet' type='text/css' href='gertrud.css'>");    
    win.document.writeln("<style type='text/css'>div.right {text-align:right; margin-top:2em}</style></HEAD>");
    win.document.writeln("<BODY bgcolor='#ffffff' text='black' style='font:Garamond 12pt'>");
    win.document.writeln(winText+"<hr noshade color='silver'>");
    win.document.writeln("<div class='right'><a  href='javascript:window.close()'>Fenster schlie&szlig;en</a></div>");
    win.document.writeln("</BODY></HTML>");
    win.document.close();
    win.focus();
}

function popWinSrc(winSrc,winName,winWidth,winHeight)
{
    var maxx=screen.availHeight-30; 
    var scr="no"
    if(maxx < winHeight){
     winHeight=maxx;
     winWidth+=15;
     scr="yes"; //no
     }
    maxx=screen.availWidth-15;    
    if(maxx < winWidth){
     winWidth=maxx;
     scr="yes";
     }    
    specs="resizable=yes,scrollbars="+scr+",width="+winWidth+",height="+winHeight+"screenX=100,screenY=100";
    win=window.open(winSrc,winName, specs);
    win.focus();
}
