
//-----------------------------------------------------------------------
// 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 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("<div align=\"center\">");
				// Table scheint am MAC nicht zu funktionieren
//                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("<img src=\"" + strGrafFile + "\">");
				myPage.document.write("</div>");
                myPage.document.write("</body>");
                myPage.document.write("</html>");
                }
        }