








































var undefined = null;

var iINF = 0;
var iWRN = 1;
var iERR = 2;

function dbg(sMsg, iSeverity)   //debug alert function
{
    return;
    var sSeverity = "ERR:";
    if(iSeverity == 0)  sSeverity = "INF:";
    if(iSeverity == 1)  sSeverity = "WRN:";
    alert(sSeverity+"\n"+sMsg);
}
function checkcookies(sFrm, sChk)
{
    var oChk = getelement(sChk);
    if(!oChk) return;
    if(!oChk.checked) return;
    if(navigator.cookieEnabled) return;
    alert("Dieses Feature funktioniert nur dann, wenn Cookies erlaubt sind!");
}
function checkObject(oObject)
{
    if(oObject!=null)
    return true;
    return false;
}
function collapsTree(sRootAli)
{
    var sNowAli="";
    if(!top.left)
        return;
    sNowAli = getparam("alias", top.left.location.search);
    if(sNowAli == "")
        return;
    sNowAli = sNowAli.toUpperCase();
    sRootAli = sRootAli.toUpperCase();
    if(sNowAli == sRootAli)
        return;
    top.left.location.href="./left.jsp?mode=nosync&alias="+sRootAli;
}
function doAddDoc2OutputList()
{
  var sAli = getCurAlias();
  if(sAli == "")
  {
    alert("Wählen Sie ein Dokument im Baum aus!");
    return;
  }
  openFeatPopup(44, "./bboutputlist.jsp?mode=add&alias="+sAli+"#"+sAli, "preview", 'dependent=yes,width=250,height=70,resizable=yes,menubar=no,status=no,scrollbars=no');
}
function doAddToFavorites()
{
  var sAli = "";
  if(sAli == "")
  {
    if(top.left == null)
    {
        alert("Wählen Sie ein Dokument im Baum aus!");
        return;
    }
    if(top.left.navigatorframe == null)
    {
        alert("Wählen Sie ein Dokument im Baum aus!");
        return;
    }
    if(top.left.navigatorframe.navigatorincon == null)
    {
        alert("Wählen Sie ein Dokument im Baum aus!");
        return;
    }
    if(top.left.navigatorframe.navigatorincon.idcur)
        sAli = top.left.navigatorframe.navigatorincon.idcur;
    if(sAli.toLowerCase().indexOf("id")==0)
        sAli = sAli.substring(2);
    if(sAli == "")
        sAli = getparam("alias", top.left.navigatorframe.navigatorincon.location.search);
  }

  if(sAli == "")
  {
    alert("Wählen Sie ein Dokument im Baum aus!");
    return;
  }
  var sTopLoc = top.location.href;

  sTopLoc = sTopLoc.replace(/\?.*/, "");

  if(sTopLoc.indexOf('?') > 1)
    sTopLoc = sTopLoc+"&alias="+sAli;
  else
    sTopLoc = sTopLoc+"?alias="+sAli;

  var sGesetz = "Gesetz";
  {
    var oDsp=null;
    if(top.right)
    {
        if(top.right.displayframe != null)
        {
            if(top.right.displayframe.middleframe)
                oDsp = top.right.displayframe.middleframe;
            else
                oDsp = top.right.displayframe;
        }
        else
        {
            if(top.right.middleframe)
                oDsp = top.right.middleframe;
            else
                oDsp = top.right;
        }
    }
    if(oDsp)
        sGesetz = oDsp.document.title;
  }
  if(sGesetz=="")
    sGesetz = "Gesetz";
  var sTxt = window.prompt("Geben Sie den Namen für den Favoriten-Eintrag an", sGesetz);
  if(sTxt == null)
    return;
  if(sTxt == "")
    sTxt = "Gesetz";

  if(sTxt.length > 189)
     sTxt = (sTxt.substring(0, 185) + "...");

  if(document.all)
  {
    top.window.external.AddFavorite(sTopLoc, sTxt);
  }
  else if(window.sidebar)
  {
    top.window.sidebar.addPanel(sTxt, sTopLoc,'');
  }
}
function doAufschlagen()
{
    top.right.location.href="./bbaufschlagenfset.htm";
}
function dobblogout()
{
    var oRght = getframe(top, "right");
    if(!oRght)
        oRght = top.right;
    if(!oRght)
        return;
    oRght.location.href = getpath(top.location.href) + '/jiplogout.jsp';
}
function docookie(wnd, sFrm, sChkName)
{
  if(navigator.cookieEnabled == false)
  {
      return;
  }
  var oFrm = wnd.getelement(sFrm);
  if(!oFrm || (oFrm.elements['j_username'].value == ""))
  {
    return;
  }
  if(oFrm.elements['j_password'].value == "")
  {
    return;
  }

  var oChk = wnd.getelement(sChkName);
  if(!oChk)
  {
    return;
  }
  if(!oChk.checked)
  {
      wnd.document.cookie = null;
      return;
  }
  var now = new Date();
  var til = new Date(now.getTime() + ((1000 * 60 * 60 * 24 * 365)*9));

  document.cookie     = "un="+trim(oFrm.elements['j_username'].value)+"; expires="+trim(til.toGMTString());
  document.cookie     = "pw="+trim(oFrm.elements['j_password'].value)+"; expires="+trim(til.toGMTString());
  wnd.document.cookie = "un="+trim(oFrm.elements['j_username'].value)+"; expires="+trim(til.toGMTString());
  wnd.document.cookie = "pw="+trim(oFrm.elements['j_password'].value)+"; expires="+trim(til.toGMTString());
  top.document.cookie = "un="+trim(oFrm.elements['j_username'].value)+"; expires="+trim(til.toGMTString());
  top.document.cookie = "pw="+trim(oFrm.elements['j_password'].value)+"; expires="+trim(til.toGMTString());
  //alert("docookie\ntopcookie:"+top.document.cookie+"\nwndcookie:"+wnd.document.cookie+"\nselfcookie:"+document.cookie+"\nwndloc:"+wnd.location.href+"\nselfloc:"+self.location.href);
}
function dolink(sLink)
{
    sLink = sLink.replace(/ipsoftlink\.jsp\?anchor=/, "softlink.jsp?name=");

    oFrameSoftLink = getframe(top, "softlink");
    if(top.softlink && (oFrameSoftLink == null))
        oFrameSoftLink = top.softlink;

    if(oFrameSoftLink == null)
    {
        return;
    }

    var sName = "";
    var iStelle = 0;
    iStelle = sLink.search(/name=/);
    iStelle = iStelle + 5;

    sName = sLink.substring(iStelle, sLink.length);

    var sCurrentUrl = oFrameSoftLink.location.href;

    var sUrl  = "";

    iStelle = sCurrentUrl.search(/name=/);
    if(iStelle > -1)
    {
        iStelle = iStelle - 1;
        sUrl = sCurrentUrl.substring(0, iStelle);
    }
    else
    {
        sUrl = sCurrentUrl;

    }

    oFrameSoftLink.location.href = sUrl + "?name=" + sName;
}
function dolink2(sLink)
{
    sLink = sLink.replace(/ipsoftlink\.jsp\?anchor=/, "softlink.jsp?name=");

    oFrameSoftLink = getframe(top, "softlink");
    if(oFrameSoftLink == null)
    {
        return;
    }

    oFrameSoftLink.location.href = "../" + sLink;
}
function dome()
{
}
function doNoteAddEdit()
{
    var sDoc = "";
    if(top.right)
    {
        if(top.right.displayframe)
            sDoc = getparam("doc", top.right.displayframe.location.search);
        else
            sDoc = getparam("doc", top.right.location.search);
    }
    if(sDoc == "")
    {
        alert("Wählen Sie ein Dokument aus!");
        return;
    }

    openFeatPopup(12, "./bbnotesaddedit.jsp?fn="+sDoc, "Notiz editieren", "dependent=yes,width=380,height=450,resizable=yes,menubar=no,status=yes");
}
function doSearch()
{
    if((top.left == null) || (top.left.navigatortab == null))
        return;
    if( top.left.navigatortab.document.links[1] != null)
        top.left.navigatortab.document.links[1].click();
}
function doShowContext()
{
  var sAli = getCurAlias();
  if(sAli == "")
  {
    alert("Wählen Sie ein Dokument im Baum aus!");
    return;
  }
  var win = openFeatPopup(44, "./lmshowcontextfset.html?mode=show&alias="+sAli, "Context", 'dependent=yes,width=450,height=400,resizable=yes,menubar=no,status=no,scrollbars=no');
  win.oOpenerTop = top;
}
function doShowOutputManager()
{
  openFeatPopup(44, "./lmoutputlistfset.html", "Ausgabemanager", 'dependent=yes,width=650,height=500,resizable=yes,menubar=no,status=yes,scrollbars=yes');
}
function doShowOutputManager_pdf()
{
  openFeatPopup(44, "./bboutputlistfset_pdf.html", "Ausgabemanager", 'dependent=yes,width=650,height=500,resizable=yes,menubar=no,status=yes,scrollbars=yes');
}
function doShowOutputManager_pdfrtf()
{
  openFeatPopup(44, "./bboutputlistfset_pdfrtf.html", "Ausgabemanager", 'dependent=yes,width=650,height=500,resizable=yes,menubar=no,status=yes,scrollbars=yes');
}
function doShowOutputManager_printonly()
{
  openFeatPopup(44, "./bboutputlistfset.html", "Ausgabemanager", 'dependent=yes,width=650,height=500,resizable=yes,menubar=no,status=yes,scrollbars=yes');
}
function doShowOutputManager_rtf()
{
  openFeatPopup(44, "./bboutputlistfset_rtf.html", "Ausgabemanager", 'dependent=yes,width=650,height=500,resizable=yes,menubar=no,status=yes,scrollbars=yes');
}
function fillfromcookie(wnd, sForm, sChk)
{
  if(top.cookielogin == true)       //try it only one time!
  {
     return;
  }
  top.cookielogin = true;
  if((top.location.href).toLowerCase().indexOf("logout=1") > -1)
  {
    return;
  }

  var oChk = getelement(sChk);
  var oFrm = getelement(sForm);
  if(!oChk || !oFrm)
  {
      return;
  }
  if(navigator.cookieEnabled == false)
  {
      oChk.checked = false;
      return;
  }
  if(document.cookie == null || document.cookie == "")
  {
    return;
  }

  var sck = ""+document.cookie+"";
  var sun = "";
  var spw = "";
  var ack = sck.split(';');
  var i=0;
  for(i=0; i < ack.length;i++)
  {
      var acke = ack[i].split('=');
      if(acke.length != 2)  continue;
      if(trim(acke[0]).toLowerCase() == "un")
      {
         sun = trim(acke[1]);
      }
      if(trim(acke[0]).toLowerCase() == "pw")
      {
         spw = trim(acke[1]);
      }
  }
  if((spw == "") || (sun == ""))
  {
      //alert("fillfromcookie\nNOCOOKIEFOUND\ntopcookie:"+top.document.cookie+"\nwndcookie:"+wnd.document.cookie+"\nselfcookie:"+document.cookie+"\nwndloc:"+wnd.location.href+"\nselfloc:"+self.location.href);
      return;
  }

  oChk.checked = true;
  oFrm.elements['j_username'].value = sun;
  oFrm.elements['j_password'].value = spw;
  setTimeout('document.forms[0].submit();top.reloadlaterleftwithoutsync();top.reloadlatertoolbar();', 900);
}
function getCurAliasRightLeft()
{
  var sAli = "";
  if(top.right)
  {
      if(top.right.displayframe != null)
          sAli = getparam("alias", top.right.displayframe.location.search);
      if(sAli == "")
          sAli = getparam("alias", top.right.location.search);
  }
  if(sAli != "")
   return sAli;
  return getCurLeftAlias();
}
function getCurAlias(bForceLeft)
{
    if(bForceLeft == true)
        return getCurLeftAlias();
    return getCurAliasRightLeft();
}
function getDocTitle(salias)
{
    var sTitle = "";
    if((top.left!=null)&&(top.left.navigatorframe!=null)&&(top.left.navigatorframe.navigatorincon!=null)&&(top.left.navigatorframe.navigatorincon.getElement("id"+salias)!=null))
       sTitle = top.left.navigatorframe.navigatorincon.getElement("id"+salias).innerHTML;
    if((sTitle != "") && (sTitle != null) && (sTitle != undefined) && (sTitle.toLowerCase() != "undefined"))
    {
        sTitle = unescape(sTitle);
        return sTitle;
    }
    if((top.opener!=null)&&(top.opener.top!=null)&&(top.opener.top.left!=null)&&(top.opener.top.left.navigatorframe!=null)&&(top.opener.top.left.navigatorframe.navigatorincon!=null)&&(top.opener.top.left.navigatorframe.navigatorincon.getElement("id"+salias)!=null))
    {
        var oElem = top.opener.top.left.navigatorframe.navigatorincon.getElement("id"+salias);
        sTitle = top.opener.top.left.navigatorframe.navigatorincon.getElement("id"+salias).innerHTML;
    }
    if((sTitle != "") && (sTitle != null) && (sTitle != undefined) && (sTitle.toLowerCase() != "undefined"))
    {
        sTitle = unescape(sTitle);
        return sTitle;
    }
    return "";
}
function getelement(sValue)
{
    return getElement(sValue);
}
function getElement(sValue)
{
    var oE = null;
    if(document.getElementById)
        oE = document.getElementById(sValue);
    if (oE != null)
        return oE;
    oE = document.getElementsByName(sValue);
    if (oE.length == 0)
        return null;
    return oE[0];
}
function getframe(pwnd, sFrName)
{
    if((pwnd == null) || (pwnd == undefined))
    {
        return null;
    }

    if(pwnd.name == sFrName)
    {
        return    pwnd;
    }

    var i=0;
    for(i=0; i < pwnd.frames.length; i++)
    {
        if(pwnd.frames[i].name == sFrName)
        {
            return pwnd.frames[i];
        }

        var ppwnd = null;
        if(pwnd.frames[i].closed != false)
            ppwnd = getframe(pwnd.frames[i], sFrName);
        if((ppwnd != null) && (ppwnd != undefined))
        {
            return ppwnd;
        }
    }

    return null;
}
function getlastelement(sValue)
{
    oE = document.getElementsByName(sValue);
    if (oE.length == 0)
        return null;
    return oE[oE.length-1];
}
function getparam(sParName, sSearch)
{
    if((sParName == null) || (sSearch == null)) return "";
    var iFr = sSearch.indexOf('?');                             //remove pathname
    if(iFr > -1)
        sSearch = sSearch.substring(iFr+1, sSearch.length);

    var iR = sSearch.indexOf('#');                              //remove anchor
    if(iR > -1)
        sSearch = sSearch.substring(0, iR);

    var parsarray = sSearch.split('&');
    var i=0;
    for(i=0; i < parsarray.length; i++)
    {
        var par = parsarray[i];
        var pararray = par.split('=');
        if((pararray.length == 2) && (pararray[0].toLowerCase() == sParName.toLowerCase()))
            return pararray[1];
    }
    return "";
}
function getpath(sUrl)
{
    //remove parameter/anchor
    var iE1 = sUrl.indexOf('?');
    var iE2 = sUrl.indexOf('#');
    var iE = iE1;
    if((iE2 > -1) && (iE2 < iE1))
        iE = iE2;
    if(iE > -1)     sUrl = sUrl.substring(0, iE);

    //remove fn
    var iLastSlash = sUrl.lastIndexOf('/');
    if (iLastSlash < 1)
        return sUrl;
    return sUrl.substring(0,iLastSlash);
}
function gotosearchtree(sAli)
{
    var lft = getframe(top, "left");
    if(!lft) lft = top.left;
    if(!lft) return;
    lft.location.href = setparam(lft.location.href, "alias", sAli);

    var rgt = getframe(top, "right");
    if(!rgt) rgt = top.right;
    if(!rgt) return;
    top.right.location.href = getpath(lft.location.href) + "/lmexpertsearch.jsp?mode=fset&alias="+sAli+"&gotologo=0";
}
function loadbbexpertsearch()
{
    top.right.location.href = './bbexpertsearch.jsp?mode=fset';
}
function ipcallmenufunc(sFun)
{
    var lft = getframe(top, "left");
    if(!lft) lft = top.left;
    if(!lft) return false;

    sFun = sFun.toUpperCase();
    if((sFun == "IPV_CHANGEUP") || (sFun == "IPV_CHANGEDOWN"))
    {
        var sAli = getCurAlias(true);

        var rgt = getframe(top, "right");
        if(!rgt) rgt = top.right;
        if( rgt)
            rgt.location.href = getpath(top.location.href)+ "/lmright.jsp?dispmode=nosync&alias="+sAli+"&mode="+sFun+"&tsmp="+((new Date()).getTime());

        lft.location.href = getpath(top.location.href)+ "/lmleft.jsp?alias="+sAli+"&mode="+sFun+"&tsmp="+((new Date()).getTime());
        return true;
    }
    return false;
}
function ipcallmenufunc_IPV_CHANGEDOWN()
{
    ipcallmenufunc('IPV_CHANGEDOWN');
}
function ipcallmenufunc_IPV_CHANGEUP()
{
    ipcallmenufunc('IPV_CHANGEUP');
}
function ipcallmenufunc_IPV_CHANGEPREV()
{
    if (getWebAppTop(self).onavigation)
        getWebAppTop(self).onavigation.navigateback();
}
function ipcallmenufunc_IPV_CHANGENEXT()
{
    if (getWebAppTop(self).onavigation)
        getWebAppTop(self).onavigation.navigatenext();
}
function ipdolink(sLink)
{
    dolink(sLink);
}
function isie()
{
    if(document.all)    return true;
    return false;
}
function IPDoLinkFS(uri)
{
    var wnd = getWebAppTop(self);
    if(!wnd)  wnd = top;
    if(!wnd.sRightJsp)
        wnd.sRightJsp = "bbright.jsp";

    uri = uri.replace('bbdisplay.jsp', wnd.sRightJsp);
    uri = uri.replace('lmdisplay.jsp', wnd.sRightJsp);
    uri = uri.replace('sgbdisplay.jsp',wnd.sRightJsp);

    i = uri.indexOf(wnd.sRightJsp);
    j = window.location.pathname.indexOf('/docs/');

    if((j < 0) && !isie() && (top.oOpenerTop == null))      //HACK for firefox, that doesnot look for <base href> ==> "window.location.pathname" is ALLWAYS jsp-name!
        j = 0;

    if(self.location.href.toLowerCase().indexOf("display.jsp") > -1)
    {
        if ((i >= 0) && !isie())
        {
            var sDispMode = getparam("dispmode", self.location.search).toUpperCase();
            if((sDispMode != "TOP")&&(sDispMode != "BOTTOM"))
                uri = '../' + uri.substr(i);
        }
    }
    else
    {
        if ((i >= 0) && (j >= 0))
        uri = '../' + uri.substr(i);
        else if((j >= 0) || (self.location.href.toLowerCase().indexOf("updateinfo.htm") > -1))
        uri = '../' + uri.substr(i);
    }
    uri = uri.replace('file=', 'doc=');
    uri = uri.replace('fn=', 'doc=');

    if((top.oOpenerTop != null) && (top.oOpenerTop.right != null))
    {
        top.oOpenerTop.right.location.href = uri;
    }
    else
    {
        if(top.right != null)
        {
            top.right.location.href = uri;
        }
        else if((top.opener != null) && (top.opener != top) && (top.opener != self))
        {
           if(top.opener.top.right != null)
              top.opener.top.right.location.href = uri;
        }
    }
}
function getCurTopAlias()
{
    var wnd = getWebAppTop(self);
    if(wnd.getCurAlias)
        return wnd.getCurAlias();
    if(self.getCurAlias)
        return self.getCurAlias();
    return "";
}
function getCurTopTitle()
{
    var wnd = getWebAppTop(self);
    if(wnd.getDocTitle)
        return wnd.getDocTitle();
    if(self.getDocTitle)
        return self.getDocTitle();
    return "";
}
function loadEditNotes(i, sURL, sID)
{
    var salias      = getCurTopAlias();
    var sdoctitle   = getCurTopTitle(salias);

    if(salias == "")
    {
        alert("Wählen Sie bitte ein Dokument aus!");
        return;
    }

    openFeatPopup(13, "./jipnotesuserhandler.jsp?notemode=edit&alias="+salias+"&doctitle="+sdoctitle, "Notizen", "dependent=yes,width=680,height=480,resizable=yes,menubar=no,status=yes,scrollbars=yes");
    //lm?
    openFeatPopup(13, "./static/noteseditfset.html?alias="+salias+"&doctitle="+sdoctitle, "Notizen", "dependent=yes,width=680,height=480,resizable=yes,menubar=no,status=yes,scrollbars=yes");
}
function getWebAppTop(wnd, iRecDepth)
{
    if(iRecDepth == null)   iRecDepth = 0;

    try
    {
        if(!wnd && (iRecDepth > 9))
            return self;
        if(!wnd)
            wnd = self;

        while(wnd)
        {
            if(wnd.name == "ipwebtop")
                return wnd;
            if(wnd == wnd.parent)
                break;
            wnd = wnd.parent;
        }
        if(wnd.opener)
        {
            return getWebAppTop(wnd.opener, iRecDepth+1);
        }
        else
            return wnd;
    }
    catch(e)
    {
        return wnd;
    }
    return wnd;
}
function closepopup(wnd, i)
{
    if(wnd.awins && wnd.awins[i] && (wnd.awins != null) && (wnd.awins[i] != null))
    {
        if(!wnd.awins[i].closed)
        {
            wnd.awins[i].close();
        }
        wnd.awins[i] = null;
    }
}
function openFeatPopup(n, src, name, sFeatures)
{
    var wnd = getWebAppTop(self);
    closepopup(wnd, n);

    if((sFeatures == null) || (sFeatures == ""))
    {

        var swidth = 480;
        var sheight = 650;
        if(swidth > screen.width)
            swidth = screen.width-110;
        if(sheight > screen.height)
            sheight = screen.height-110;
        sFeatures = "dependent=yes,width="+swidth+",height="+sheight+",resizable=yes,menubar=no,status=yes";
    }
    name = name.replace("-", "_");
    name = name.replace(" ", "_");
    win = window.open(src, name, sFeatures);
    try
    {
        if(!wnd.awins)
            wnd.awins = new Array(1000);
        wnd.awins[n] = win;
    }
    catch(e)
    {
    }
    try
    {
        win.focus();
    }
    catch(e)
    {
    }
    return win;
}
function openNotesPopup(n, src, name, sFeatures)
{
    openFeatPopup(13, "./jipnotesuserhandler.jsp?notemode=manage", "Notizen", "dependent=yes,width=680,height=480,resizable=yes,menubar=no,status=yes,scrollbars=yes");
}
function reloadfunction()
{
    parent.frametop.location.reload(true);
    parent.framebelow.location.reload(true);
}
function reloadlaterleftwithoutsync()
{
    setTimeout('reloadleftwithoutsync()', 900);
    return true;
}
function reloadlatertoolbar()
{
    setTimeout('reloadtoolbar()', 1100);
    return true;
}
function reloadleftwithoutsync()
{
    var lft = top.left;
    if(!lft)    return;
    var sLft = removeAnchor(lft.location.href);

    sLft = sLft.replace("syncto=","nosync=");
    sLft = sLft.replace("mode="  ,"nomode=");
    var sSp = "&";
    if(sLft.indexOf('?') < 0)
        sSp = "?";
    sLft = sLft + sSp + "mode=nosync&syncto=nosync&sync=nosync&tsmp=" + ((new Date()).getTime());
    top.left.location.href = sLft;
    return true;
}
function reloadtoolbar()
{
    var oTb = getframe(top, "toolbar");
    if(!oTb)
        oTb = top.toolbar;
    if(!oTb)
        return;
    var sSp = "&";
    if(oTb.location.href.indexOf('?') < 0)
        sSp = "?";
    oTb.location.href = oTb.location.href + sSp + "tsmp=" + ((new Date()).getTime());
}
function removeAnchor(sUrl)
{
    var iA = sUrl.indexOf('#');
    if(iA < 0)
        return sUrl;
    return sUrl.substring(0, iA);
}
function setNewLeftAli(sAli, bWithNoSync)
{
    if(bWithNoSync == null) bWithNoSync = false;
    // Safety bailout!
    var tp = getWebAppTop(self);
    if(tp.left == null)  return;
    if(sAli.length < 2) return;

    // Prepare/Get all Params
    var sAlias  = getparam("alias", tp.left.location.search);
    var sMode   = getparam("mode"  , tp.left.location.search);
    sAli        = sAli.toUpperCase();
    sAlias      = sAlias.toUpperCase();
    sMode       = sMode.toUpperCase();

    // Nothing to do!
    if(sAlias == sAli && sMode != "IPV_CHANGEUP" && sMode != "IPV_CHANGEDOWN")
        return;

    // Set desired Alias & Clear mode
    sLoc = setparam(tp.left.location.href, "alias", sAli);
    sLoc = setparam(sLoc, "mode", (bWithNoSync ? "nosync" : "") );

    // Update
    tp.left.location.href = sLoc;
}
function setparam(sHref, sParam, sValue)
{
    if(sValue == null)  sValue = "";
    if(sHref == null)  return "";
    if((sParam == null) || (trim(sParam) == ""))
    {
        return sHref;
        return;
    }
    if ((sParam == "") && (sValue == ""))
        return sHref;

    var iRaute = sHref.indexOf("#");
    if(iRaute == 0)
        return sHref;

    var sAnchor="";
    if(iRaute > 0)
    {
        sAnchor = sHref.substring(iRaute+1);
        sHref = sHref.substring(0, iRaute);
    }

    if (sValue == "")
        sHref = sHref.replace(sParam + "=" + getparam(sParam, sHref), "");
    else
    {
        // Get current Param
        var sParamNow = getparam(sParam, sHref);

        // Get limiter
        var limiter = "&";
        if (sHref.indexOf("?") < 0)
            limiter = "?";

        // Return URL with Param set
        if(sHref.indexOf(sParam + "=") > -1)
        {
            sHref = sHref.replace(sParam + "=" + sParamNow, sParam + "=" + sValue);
        }
        else
        {
            sHref = sHref + limiter + sParam + "=" + sValue;
        }
    }
    return sHref+"#"+sAnchor;
}
function setToolbar(bToolbarOnDoc)
{
    if(top.toolbar == null)
        return;
    if((top.sUrlToolbarOnEmpty == null) || (top.sUrlToolbarOnDocument == null))
        return;
    var sLocNow = top.toolbar.location.href;
     if(bToolbarOnDoc == true)
     {
        if(sLocNow.indexOf(top.sUrlToolbarOnDocument) > 0)
            return;
        sLocNow = sLocNow.replace(top.sUrlToolbarOnEmpty, top.sUrlToolbarOnDocument);
        top.toolbar.location.href=sLocNow;
     }
     else
     {
         if(sLocNow.indexOf(top.sUrlToolbarOnEmpty) > 0)
            return;
        sLocNow = sLocNow.replace(top.sUrlToolbarOnDocument, top.sUrlToolbarOnEmpty);
        top.toolbar.location.href=sLocNow;
      }
}
function showpreview(sUrl)
{
    sUrl = escape(sUrl);
    openFeatPopup(11, "./bbpreview.jsp?mode=fset&url="+sUrl, "preview");
}
function trim(sTxt)
{
  return sTxt.replace(/^\s*|\s*$/g,"");
}
function setNewLeftAndRight(sAli)
{
  if(top.left == null)  return;
  if(sAli.length < 2)
  {
    return;
  }
  var sUrl = top.left.location.href;
  if(sUrl.toUpperCase().indexOf("ALIAS="+sAli.toUpperCase()) > 0)
  {
    return;
  }
  top.left.location.href = setparam(top.left.location.href, "alias", sAli);
  if(top.right)
     top.right.location.href = setparam(top.right.location.href, "alias", sAli);
}
function isempty(sTxt)
{
    if(sTxt == null)
        return true;
    while(sTxt.indexOf(" ") > -1)
        sTxt = sTxt.replace(" ", "");
    if(sTxt == "")
        return true;
    return false;
}
function reloadframe(wnd)
{
    if(!wnd)    return;

    var sBw = "#";
    var sUrl = wnd.location.href;

    if(sUrl.indexOf('#')>-1)
        sBw = "#";
    else if(sUrl.indexOf('?')>-1)
        sBw = "&";
    else
        sBw = "?";

    sUrl = sUrl.replace("action=", "didaction=");

    wnd.location.href = sUrl + sBw + ((new Date()).getTime());
}
function getCurLeftAlias()
{
  if(top.left == null)
   return "";
  if(top.left.navigatorframe == null)
   return "";
  if(top.left.navigatorframe.navigatorincon == null)
    return "";
  if(top.left.navigatorframe.navigatorincon.idcur && (top.left.navigatorframe.navigatorincon.idcur.length > 2))
  {
      var sAli = top.left.navigatorframe.navigatorincon.idcur;
      if (sAli.toLowerCase().indexOf("id")==0)
        return sAli.substring(2);
      return sAli;
  }

  return getparam("alias", top.left.navigatorframe.navigatorincon.location.search);
}
function synpathnavi(sAli)
{
    var oTbNavi = getframe(top, "tbpathnavi");
    if(!oTbNavi)
        oTbNavi = top.tbpathnavi;
    if(!oTbNavi)    return;

    oTbNavi.location.href = setparam(oTbNavi.location.href, "alias", sAli);
}
function doSgbLogin(n, src, name)
{
    var nav = getframe(top, "right");
    nav.location.href = "./sgblogin.jsp";
}
function gotoIntegro(n, src, name)
{
    var nav = getframe(top, "left");
    nav.location.href = "./sgbleft.jsp?nav=sgbnavigatorsb&alias=INTEGRO_ROOT_TREE_ENTRY#INTEGRO_ROOT_TREE_ENTRY";
    var nav = getframe(top, "right");
    nav.location.href = "./sgbintegrodoclist.jsp?tsmp=" + ((new Date()).getTime());
}
function newIntegro(n, src, name)
{
    var nav = getframe(top, "right");
    nav.location.href = "./sgbintegrodocedit.jsp?action=new&alias=" + getCurLeftAlias();
}
function setElementText(oElem, sTxt)
{
    if(!oElem) return false;
    if(!sTxt) sTxt = " ";
    if(sTxt == "") sTxt = " ";

    if (oElem.nodeValue)
    {
        oElem.nodeValue = sTxt;
        return true;
    }
    if (oElem.firstChild)
    {
        oElem.firstChild.nodeValue = sTxt;
        return true;
    }
    if (oElem.innerText)
    {
        oElem.innerText = sTxt;
        return true;
    }
    return false;
}
function toggleCheckBoxes(checked, sIDs)
{
    var idsarray = sIDs.split(',');
    var i=0;
    for(i=0; i < idsarray.length; i++)
    {
        getElement(idsarray[i]).checked = checked;
    }

    return true;
}
function selectelement(sEle)
{
    var o = getelement(sEle);
    if(!o) return;
    o.focus();
}
function getlastelement(sValue)
{
    oE = document.getElementsByName(sValue);
    if (oE.length == 0)
        return null;
    return oE[oE.length-1];
}
function getpath(sUrl)
{
    //remove parameter/anchor
    var iE1 = sUrl.indexOf('?');
    var iE2 = sUrl.indexOf('#');
    var iE = iE1;
    if((iE2 > -1) && (iE2 < iE1))
        iE = iE2;
    if(iE > -1)     sUrl = sUrl.substring(0, iE);

    //remove fn
    var iLastSlash = sUrl.lastIndexOf('/');
    if (iLastSlash < 1)
        return sUrl;
    return sUrl.substring(0,iLastSlash);
}
function changeleftwidth(sStr1, sStr2, sStr3)
{
    var sLeftWidth = top.sLeftWidth;
    var sLeftWidthBlownUp = top.sLeftWidthBlownUp;
    var sLWText = top.sLWText;
    var sLWBlwnUpText = top.sLWBlwnUpText;

    var sText = "";

    if(top.toolbar.document.getElementById(sStr3.substring(sStr3.lastIndexOf('_lnkid_')+7)))
        sText = top.toolbar.document.getElementById(sStr3.substring(sStr3.lastIndexOf('_lnkid_')+7)).innerHTML;

    if(top.document.getElementById("middle").cols == sLeftWidth+',*')
    {
        if(top.toolbar.document.getElementById(sStr3.substring(sStr3.lastIndexOf('_lnkid_')+7)))
            top.toolbar.document.getElementById(sStr3.substring(sStr3.lastIndexOf('_lnkid_')+7)).innerHTML = sLWBlwnUpText;
            //works from ie5 or ns 7 or ff1
        top.document.getElementById("middle").cols = sLeftWidthBlownUp+',*';
    }
    else
    {
        if(top.toolbar.document.getElementById(sStr3.substring(sStr3.lastIndexOf('_lnkid_')+7)))
            top.toolbar.document.getElementById(sStr3.substring(sStr3.lastIndexOf('_lnkid_')+7)).innerHTML = sLWText;
        //works from ie5 or ns 7 or ff1
        top.document.getElementById("middle").cols = sLeftWidth+',*';
    }
}
function changeWinSize()
{
    if(getWebAppTop(self).leftright == null)
    {
        return;
    }
    if (navigator.appName.toUpperCase().indexOf("MICROSOFT") < 0)
    {
        return;
    }
    if (top.leftright.document.body.rows == "0,50,27,*")        //hack for ie-bug!
        top.leftright.document.body.rows =  "0,50,28,*";
    else
        top.leftright.document.body.rows =  "0,50,27,*";
}
//////////////////////////////////////////////////////////////////// NAVIGATION /////////////////////////   BEGIN
function navigation()
{
    this.iNavigationPosition = -1;
    this.asNavigation = new Array();

    this.add2navigation = function(sUrl)
    {
        if(sUrl.toLowerCase().indexOf("fwdurl=1") > -1)
            return;
        if(sUrl.toLowerCase() == "about:blank")
            return;
        if(sUrl == "")
        {
            dbg("add2navigation\n!sUrl", iWRN);
            return;
        }

        var sUrlLast = "";
        if(this.asNavigation.length > 0)
            sUrlLast = this.asNavigation[this.asNavigation.length-1];
        if(sUrlLast == sUrl)    return;

        if (this.iNavigationPosition < 0)
            this.iNavigationPosition = 0;

        while(this.asNavigation.length > (this.iNavigationPosition+1))
        {
            this.asNavigation.pop();
        }
        //this.alertnavigation("add2navigation.5::ADDING.URL:\n"+sUrl+"\nself.url:"+self.location.href+"\nthis:"+this+"\n");
        this.asNavigation.push(sUrl);
        this.iNavigationPosition = this.asNavigation.length - 1;
        //this.alertnavigation("add2navigation.6::ADDEDD.URL:\n"+sUrl+"\nself.url:"+self.location.href+"\nthis:"+this+"\n");
    }
    this.navigateback = function()
    {
        if(this.iNavigationPosition < 1)
        {
            alert("Keine Navigation rückwärts verfügbar!");
            return;
        }

        this.iNavigationPosition = this.iNavigationPosition - 1;
        this.navigate2(this.asNavigation[this.iNavigationPosition]);
    }
    this.navigatenext = function()
    {
        if(this.iNavigationPosition >= (this.asNavigation.length-1))
        {
            alert("Keine Navigation vorwärts verfügbar!");
            return;
        }

        this.iNavigationPosition = this.iNavigationPosition + 1;
        this.navigate2(this.asNavigation[this.iNavigationPosition]);
    }
    this.navigate2 = function(sUrl)
    {
        if((sUrl == null) || (trim(sUrl) == ""))
        {
            dbg("navigate2\n!sUrl:"+sUrl, iERR);
            return;
        }
        var rght = getWebAppTop(self).right;
        if(!rght)   rght = top.right;
        if(!rght)
        {
            dbg("navigate2\n!rght", iERR);
            return;
        }

        var sAli = getparam("alias", sUrl);
        rght.location.href  = setparam(setparam(sUrl,"fwdurl","1"), "sync","nosync");
        if(sAli == "")  return;
        setNewLeftAli(sAli, true);
    }
    this.alertnavigation = function(sPrefix)
    {
        if(sPrefix == null) sPrefix = "";
        var s = "iNavigationPosition:"+this.iNavigationPosition+" asNavigation.length:"+this.asNavigation.length+" this:"+this+" self:"+self.location.href+"\n";
        for(var i=0; i < this.asNavigation.length; i++)
        {
            if(i == this.iNavigationPosition)
                s += ">>>AKTUELL>>>";
            s += this.asNavigation[i]+"\n";
        }
        alert(sPrefix+s);
    }
}
//var onavigation = new navigation();
function recordnavigation(wnd)
{
    if(wnd.onavigation == null)
    {
        dbg("recordnavigation\n!onavigation", iERR);
        return;
    }

    var rght = getWebAppTop(self).right;
    if(!rght)   rght = wnd.right;
    if(!rght)
    {
        dbg("recordnavigation\n!rght", iERR);
        return;
    }

    wnd.onavigation.add2navigation(rght.location.href);

    wnd.setTimeout("recordnavigation(self);", 4000);
}
//////////////////////////////////////////////////////////////////// NAVIGATION /////////////////////////   END
function doShowOutputManager_printonly()
{
  //attenzione: bbramicro-specific size!!!
  openFeatPopup(44, "./raoutputlistfset.html", "Ausgabemanager", 'dependent=yes,width=450,height=500,resizable=yes,menubar=no,status=yes,scrollbars=yes');
}