
//-----------------------------------------------------------------------
// Function: openURL
//
// Params: strName - string die URL die geöffnet werden soll
//           nWidth - int die Breite
//           nHeight - int die Höhe
//
// RetValue:
//
// Description:
//
// Sample:
//
//
var myPage = null;
var oldPage = null;

function openURL(strName,nWidth,nHeight)
        {
        var strParams;

        strParams = "toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=no,resizable=yes,copyhistory=yes,width=";
        strParams = strParams + nWidth + ",height=" + nHeight;

        if(myPage)
                {
                oldPage = myPage;
                }
        myPage = window.open(strName,"_blank",strParams);

        if(oldPage)
                {
                oldPage.close();
                oldPage = null;
                }
        }

function openURLWithScrollBars(strName,nWidth,nHeight)
        {
        var strParams;

        strParams = "toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width=";
        strParams = strParams + nWidth + ",height=" + nHeight;

        if(myPage)
                {
                oldPage = myPage;
                }
        myPage = window.open(strName,"_blank",strParams);

        if(oldPage)
                {
                oldPage.close();
                oldPage = null;
                }
        }

function openURLExtended(strName,nWidth,nHeight,fWithMenu,fWithStatus,fWithScrollbars)
        {
        var strParams;
        var strStatus = "yes";
        var strMenu = "yes";
        var strScrollBars = "yes";

        if(fWithMenu == false) strMenu = "no";
        if(fWithStatus == false) strStatus = "no";
        if(fWithScrollbars == false) strScrollBars = "no";

        strParams = "toolbar=no,location=no,directories=no,status=" + strStatus + ",menubar=" + strMenu + ",scrollbars=" + strScrollBars + ",resizable=yes,copyhistory=yes,width=";
        strParams = strParams + nWidth + ",height=" + nHeight;

        if(myPage)
                {
                oldPage = myPage;
                }
        myPage = window.open(strName,"_blank",strParams);
		myPage.opener = self; // Merken des Aufrufers
		
        if(oldPage)
                {
                oldPage.close();
                oldPage = null;
                }
        }

function openURLWithoutMenu(strName,nWidth,nHeight)
        {
        var strParams;

        strParams = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=";
        strParams = strParams + nWidth + ",height=" + nHeight;

        if(myPage)
                {
                oldPage = myPage;
                }
        myPage = window.open(strName,"_blank",strParams);

        if(oldPage)
                {
                oldPage.close();
                oldPage = null;
                }
        //return myPage // sonst kommt es immer zu einem "komischen" Object Fehler
        }

function openURLWithoutMenuPlusRetValue(strName,nWidth,nHeight) // Wird eigentlich nur für openDynamic Window benötigt
        {
        var strParams;

        strParams = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=";
        strParams = strParams + nWidth + ",height=" + nHeight;

        if(myPage)
                {
                oldPage = myPage;
                }
        myPage = window.open(strName,"_blank",strParams);

        if(oldPage)
                {
                oldPage.close();
                oldPage = null;
                }
        return myPage // sonst kommt es immer zu einem "komischen" Object Fehler
        }

/**
Function: openDynamicWindow

Params: strGrafFile - Name von GIF oder JPG File
        nWidth - int die Breite
        nHeight - int die Höhe

Description: VORAUSSETZUNG ist dass in diesem Folder ein File mit dem Namen popup.html existiert
             der Inhalt von popup.html wird dann dynamisch erzeugt
Sample:

*/
function openDynamicWindow(strGrafFile,nWidth,nHeight)
        {
        var myPage = openURLWithoutMenuPlusRetValue("popup.html",nWidth,nHeight);

        if(myPage)
                {
                myPage.document.write("<html>");
                myPage.document.write("<head>");
                myPage.document.write("<title></title>");
                myPage.document.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">");
                myPage.document.write("</head>");

                myPage.document.write("<body bgcolor=\"#FFFFFF\">");
                myPage.document.write("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"100%\">");
                myPage.document.write("  <tr align=\"center\" valign=\"middle\">");
                myPage.document.write("    <td><img src=\"" + strGrafFile + "\"></td>");
                myPage.document.write("  </tr>");
                myPage.document.write("</table>");
                myPage.document.write("</body>");
                myPage.document.write("</html>");
                }
        }