/*****************************************************************
 Name         :  kommunen.js
 Version      :  3.3.03.01
 Description  :  Javascript-Funktionen für die Templates
 Author       :  Thu Le
 Author       :  Edy Hinzen
 ******************************************************************/

parent.parent.contFrame = window;
var initialKeepmeinformed = "0";
var bIsModeOffline = false;
imageObject = new Image();

/*****************************************************************
 Name    :  onInformMe
 Date    :  08.10.2002
 Author    :  Thu Le
 Description  :  send info from ratingform
 Deprecated: Wird nur vor 3.2 an dieser Stelle benötigt
 ******************************************************************/

function onInformMe()
{
  if (document.ratingform.keepmeinformed.value == "0" || document.ratingform.keepmeinformed.value == "-2")
  {
    document.ratingform.keepmeinformed.value = "1";
  }
  else
  {
    document.ratingform.keepmeinformed.value = "0";
  }
}

/*****************************************************************
 Name    :  storeInitialAboState
 Date    :  08.10.2002
 Author    :  Thu Le
 Description  :  onload function inserted due to bug 4009
 ******************************************************************/

function storeInitialAboState()
{
  if (document.ratingform != null && document.ratingform.keepmeinformed != null)
  {
    initialKeepmeinformed = document.ratingform.keepmeinformed.value;
  }
}

/*****************************************************************
 Name    :  setClickedButton
 Date    :  08.10.2002
 Author    :  Thu Le
 Description  :  executed before submitting the ratingform.
 ensures that either Rating or Abo will be executed, not both (Bug 4009)
 ******************************************************************/
function setClickedButton(btn)
{
  if (btn == "Order")
  {
    // 'uncheck' all RadioButtons
    for (i = 0; i < document.ratingform.Rate.length; i++)
    {
      document.ratingform.Rate[i].checked = false;
    }
  }
  else
    if (btn == "RateOK")
    {
      if (document.ratingform != null && document.ratingform.keepmeinformed != null)
      {
        document.ratingform.keepmeinformed.value = initialKeepmeinformed;
      }
    }
}

/*****************************************************************
 Name    :  bWin
 Date    :  08.10.2002
 Author    :  Thu Le
 Description  :  get a window handle and open

 ******************************************************************/

function bWin(url, title, sizeH, sizeV, bReturnValue, prop)
{

  if (bIsModeOffline)
  {
    if (navigator.appVersion.indexOf("MSIE 3", 0) >= 0)return;
    return(true);
  }
  if (prop == null)
  {
    winHandle = oWinInner(url, title, 'toolbar=no,directories=no,status=no,scrollbars=yes,menubar=yes,resizable=yes,width=' + sizeH + ',height=' + sizeV);
  }
  else
  {
    winHandle = oWinInner(url, title, prop + ',width=' + sizeH + ',height=' + sizeV);
  }

  if (navigator.appVersion.indexOf("MSIE 3", 0) == -1)
  {
    id = setTimeout('winHandle.focus()', 1000);
  }
  else
  {
    return;
  }

  return(false);
}

/*****************************************************************
 Name    :  oWinInner
 Date    :  08.10.2002
 Author    :  Thu Le
 Description  :  open the window by url

 ******************************************************************/
function oWinInner(url, title, prop)
{
  var newWin;
  newWin = window.open(url, title, prop);

  if (newWin != null)
  {
    if (newWin.opener == null)
    {
      newWin.opener = self;
    }
  }

  return newWin;
}

/*****************************************************************
 Name    :  changeImage
 Date    :  14.10.2002
 Author    :  Thu Le
 Description  :  change the image

 ******************************************************************/

function changeImage(imageName, imageSrc, imageBorder, imageAlign, imageHeight, imageWidth, imageHspace, imageVspace)
{
  if (document.images)
  {
    if (imageSrc != "")
    {
      document[imageName].src = imageSrc;
      document[imageName].border = imageBorder;
      document[imageName].align = imageAlign;
      document[imageName].height = imageHeight;
      document[imageName].width = imageWidth;
      document[imageName].hspace = imageHspace;
      document[imageName].vspace = imageVspace;
    }
  }
}

/*****************************************************************
 Name    :  show
 Date    :  14.10.2002
 Author    :  Thu Le
 Description  :  show url

 ******************************************************************/
function show(url)
{
  opener.location.href = url;
  if (typeof(opener.focus) == "function") opener.focus();
  if (!document.images)
  {
    return;
  }
  return false;
}

/*****************************************************************
 Name    :  chgImg
 Date    :  19.10.2002
 Author    :  Thu Le
 Description  :  change only image without other parameter seem width, heigt

 ******************************************************************/
function chgImg(imgID, src, bMOver)
{
  document.images[imgID].src = src;
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Variablen für Versionen über 3.1.9; Können 'von aussen' überschrieben werden.
var is_master_Version32 = false;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Variablen für onChangedropdown(); Können 'von aussen' überschrieben werden.
var sitemapNewWindow = true;    // Sitemap öffnet in neuem Fenster
var contentTarget = "_top";  // Target für Content
var useMasterSearch = false;   // Integrierte Suche (ab V3.2) verwenden
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function onChangedropdown(index, menuID, langID)
{
  if (index == 'seperator')
  {
    return false;
  }

  var linkTarget = 'NeuesFenster';
  var targetUrl = '../../menu/';
  var windowOptions = 'height=600,width=800,resize=yes,toolbar=no,directories=no,status=no,scrollbars=no,menubar=no,resizable=yes'

  if (index == 'home')
  {
    targetUrl += '-1';
  }
  else
  {
    targetUrl += menuID;
  }

  if (langID != -1)
  {
    targetUrl += '_l';
    targetUrl += langID;
  }

  if (index == 'home')
  {
    linkTarget = "_top";
    targetUrl += '/index.html';
  }
  if (index == 'sitemap')
  {
    if (sitemapNewWindow)
    {
      targetUrl += '_psitemap/sitemap.html';
    }
    else
    {
      linkTarget = contentTarget;
      targetUrl += '_psitemapin/sitemap.html';
    }
    windowOptions = 'height=600,width=800,resize=yes,toolbar=no,directories=no,status=no,scrollbars=yes,menubar=no,resizable=yes';
  }
  if (index == 'schnellsuche')
  { // Gabs mal vor V3.1.9
    targetUrl += '_pfastsearchform/suche.html?menuid=';
    targetUrl += menuID;
    targetUrl += '&langid=';
    targetUrl += langID;
    windowOptions = 'height=10,width=200,resize=yes,toolbar=no,directories=no,status=no,scrollbars=no,menubar=no,resizable=yes';
  }
  if (index == 'suche')
  {
    if (useMasterSearch)
    {
      linkTarget = contentTarget;
      targetUrl += '_pmastersearch/suche.html';
    }
    else
    {
      targetUrl += '_psearch/suche.html';
      windowOptions = 'height=600,width=800,resize=yes,toolbar=no,directories=no,status=no,scrollbars=no,menubar=no,resizable=yes';
    }
  }
  if (index == 'kontakt')
  { // Vor 3.1
    targetUrl += '_pcontact/index.html';
  }
  if (index == 'impressum')
  { // Vor 3.1
    targetUrl += '_pimpressum/index.html';
  }
  if (index == 'login')
  {
    linkTarget = "_top";
    targetUrl += '_xlogin/index.html';
  }
  if (index == 'logout')
  {
    linkTarget = "_top";
    targetUrl += '_xlogout/index.html';
  }
  window.open(targetUrl, linkTarget, windowOptions);
  return true;
}

/*****************************************************************
 Name    :  onChangedropdownLinks
 Date    :  19.10.2002
 Author    :  John Zander
 Description  :  opens the given url in the given target

 ******************************************************************/
function onChangedropdownLinks(hreflink, target)
{
  if (target == '')
  {
    target = "_top"
  }

  if (target == "-" || hreflink == "-")
  {
    return false;
  }

  window.open(hreflink, target, '');

  return true;
}

//********************************************************************************************************************************
//*Autor        : Panos Kastanidis, Philipp Rosenhagen / Berata GmbH Böblingen
//*Name         : CheckString
//*Beschreibung : Diese Funktion nimmt einen Wert entgegen und leitet jedes einzelne Zeichen dieses Wertes an die
//*      Funktion CheckChar(charcode).
//*Parameter    : String (Wert der auf Sonderzeichen überprüft werden soll)
//*Parameter  : Array (Array mit erlaubten Zeichen)
//*Rückgabewert : boolean oder String
//********************************************************************************************************************************
function CheckString(myString, myArray)
{
  var g = 0;
  var invalidChars = new Array();
  for (g; g < myString.length; g++)
  {
    if (!CheckChar(myString.charCodeAt(g), myArray))
    {
      invalidChars[myString.charCodeAt(g)] = 1;
    }
  }
  if (invalidChars.length > 0)
  {
    return (getCharsFromCodeArray(invalidChars));
  }
  else
  {
    return (true);
  }
}

//********************************************************************************************************************************
//*Autor        : Panos Kastanidis, Philipp Rosenhagen / Berata GmbH Böblingen
//*Name         : CheckChar
//*Beschreibung : Diese Funktion überprüft ob der übergebenen Charactercode im Array erlaubt wurde oder nicht.
//*Parameter    : String (Charactercode)
//*Parameter  : Array (Array mit erlaubten Zeichen)
//*Rückgabewert : boolean
//********************************************************************************************************************************
function CheckChar(charcode, myArray)
{
  if (myArray[charcode] == 1)
  {
    return (true);
  }
  else
  {
    return (false);
  }
}

//********************************************************************************************************************************
//*Autor        : Philipp Rosenhagen / Berata GmbH Böblingen
//*Name         : getCharsFromCodeArray
//*Beschreibung : Diese Funktion gibt die druckbaren Zeichen eines Arrays von Charcodes zurueck.
//*Parameter  : Array (Array mit Zeichencodes)
//*Rückgabewert : String
//********************************************************************************************************************************
function getCharsFromCodeArray(charcodes)
{
  var sReturnValue = "";
  for (var Charcode in charcodes)
  {

    if (charcodes[Charcode] == 1)
    {
      sReturnValue = sReturnValue.concat(String.fromCharCode(Charcode));
      sReturnValue = sReturnValue.concat(" ");
    }
  }
  return sReturnValue;
}

//********************************************************************************************************************************
//*Autor        : Philipp Rosenhagen / Berata GmbH Böblingen
//*Name         : checkEmail
//*Beschreibung : Diese Funktion prueft einen String, ob es sich dabei um eine gueltige E-Mail Adresse handelt.
//*Parameter  : String (E-Mail Adresse)
//*Rückgabewert : boolean
//********************************************************************************************************************************
function checkEmail(email)
{
  var proto = "(mailto:)?";
  var usr = "([a-zA-Z0-9][a-zA-Z0-9_.-]*|\"([^\\\\\x80-\xff\015\012\"]|\\\\[^\x80-\xff])+\")";
  var domain = "([a-zA-Z0-9][a-zA-Z0-9._-]*\\.)*[a-zA-Z0-9][a-zA-Z0-9._-]*\\.[a-zA-Z]{2,5}";
  var regex = "^" + proto + "?" + usr + "\@" + domain + "$";

  // auf dem Mac mit IE gibt es Probleme mit den regulaeren Ausdruecken - deshalb dort simple Ueberpruefung durchfuehren
  if (navigator.appVersion.indexOf("Macintosh") != -1)
  {
    var res = (email.search('@') >= 1 && email.lastIndexOf('.') > email.search('@') && email.lastIndexOf('.') >= email.length - 5);
    return res;
  }

  var rgx = new RegExp(regex);
  return rgx.exec(email);
}

// prüft, ob der übergebene String ein gültiger Datum-String
// der Form "TT.MM.YY" ist.
// gibt entsprechend "true" oder "false" zurück

function isValidDate(date2check)
{

  var maxdays;

  if (date2check.length != 10)
  {
    return false;
  }
  else
  {
    //die Länge stimmt schonmal
    tokens = date2check.split(".");
    if (tokens.length != 3)
    {
      return false;
    }
    else
    {
      // es sind drei tokens mit einem Punkt getrennt
      day = tokens[0];
      month = tokens[1];
      year = tokens[2];
      // gültiges Jahr? ("YYYY")
      if (!(year.length == 4) || !(year >= 1970))
      {
        return false;
      }
      else
      {
        // ja!
        // gültiger Monat?
        if (!(month >= 1) || !(month <= 12))
        {
          return false;
        }
        else
        {
          // gültiger Monat!
          // testen ob 28, 29, 30 oder 31 Tage
          if (month == 2)
          {
            if (isSchaltjahr("20" + year))
            {
              maxdays = 29;
            }
            else
            {
              maxdays = 28;
            }
          }
          else if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12)
          {
            maxdays = 31;
          }
          else if (month == 4 || month == 6 || month == 9 || month == 11)
          {
            maxdays = 30;
          }
        }

        // gültiger Tag?
        if (!(day >= 1) || !(day <= maxdays))
        {
          return false;
        }
      }
    }
  }
  // Korrektes Datum!
  return true;
}

// Ist ein Jahr ohne Rest durch 4 teilbar, ist es grundsätzlich ein Schaltjahr.
// Ist es zusätzlich ohne Rest durch 100 teilbar, ist es nur ein Schaltjahr,
// wenn es auch ohne Rest durch 400 teilbar ist.

function isSchaltjahr(aYear)
{
  return (aYear % 4 == 0 && (aYear % 100 != 0 || aYear % 400 == 0));
}

// prüft, ob der übergebene String ein gültiger Zeit-String
// der Form "HH:MM" ist.
// gibt entsprechend "true" oder "false" zurück

function isValidTime(time2check)
{
  if (time2check.length != 5)
  {
    return false;
  }
  else
  {
    tokens = time2check.split(":");
    if (tokens.length != 2)
    {
      return false;
    }
    else
    {
      hh = tokens[0];
      mm = tokens[1];

      if (hh.length != 2 || mm.length != 2)
      {
        return false;
      }
      else
      {
        if (!(hh >= 0) || !(hh <= 23))
        {
          return false;
        }
        else
        {
          if (!(mm >= 0) || !(mm <= 59))
          {
            return false;
          }
        }
      }
    }
  }
  return true;
}

/*************************************************************************************
 *  Extrahiert die Objekt-ID aus einem URL
 *  Date:    2006-06-20
 *************************************************************************************/
function extractObjectId(fullUrl)
{
  var result = fullUrl;
  if (result.indexOf("../../") == 0)
  {
    result = result.substring(11, 18)
  }
  if (result.indexOf("-1") == 0)
  {
    result = "-1";
  }
  return result;
}

/*************************************************************************************
 *  Function:  getIDFromPBPageLoadDialog()
 *  Parameter:
 *    linkFieldName = Das Feld in das die ID geschrieben werden soll
 *  Description:  Ruft getURLFromPBPageLoadDialog auf und ändert den Rueckgabewert im Feld
 *  Date:    20.01.2005
 *************************************************************************************/

function getIDFromPBPageLoadDialog(linkFieldName, languageID)
{
  getURLFromPBPageLoadDialog(linkFieldName, languageID);
  // Ergebnis stutzen auf Menu-Id:
  document.information[linkFieldName].value = extractObjectId(document.information[linkFieldName].value);
}

/*************************************************************************************
 *  Function:  getTextAndIDFromPBPageLoadDialog()
 *  Parameter:
 *    linkFieldName = Das Feld in das die ID geschrieben werden soll
 *    textFieldName = Das Feld, in das der Name der Seite geschrieben werden soll
 *     languageID = Sprach-Id
 *  Description:  ruft getPBPageLoadDialog auf und beschreibt die korrespondierenden Felder
 *  Date:    20.01.2005
 *************************************************************************************/

function getTextAndIDFromPBPageLoadDialog(linkFieldName, textFieldName, languageID)
{
  linkForm = document.information;
  getPBPageLoadDialog(linkForm, linkFieldName, textFieldName, languageID);
  // Ergebnis stutzen auf Menu-Id:
  document.information[linkFieldName].value = extractObjectId(document.information[linkFieldName].value);
}

/*************************************************************************************
 *  Function:  getUrlFromPBPageLoadDialog()
 *  Parameter:
 *  Parameter:
 *    linkFieldName  = Das Feld in das die ID geschrieben werden soll
 *    textFieldName  = Das Feld, in das der Name der Seite geschrieben werden soll
 *    titleFieldName = Das Feld, in das Title-Attribut geschrieben werden soll
 *    languageID     = Sprach-Id
 *  Description:  ruft getPBPageLoadDialog auf und beschreibt die korrespondierenden Felder
 *  Date:    2006-08-14
 *************************************************************************************/

function getUrlFromPBPageLoadDialog(linkFieldName, textFieldName, titleFieldName, languageID)
{
  var linkForm = document.information;
  getPBPageLoadDialog(linkForm, linkFieldName, textFieldName, languageID, titleFieldName);
}

/*************************************************************************************
 *  Function:  getTextAndURLFromPBPageLoadDialog()
 *  Parameter:
 *     theUrl   = Das Feld in das der URL geschrieben werden soll
 *     theName = Das Feld, in das der Name der Seite geschrieben werden soll
 *     languageID = Sprach-Id
 *  Description:  ruft getPBPageLoadDialog auf und beschreibt die korrespondierenden Felder
 *  Date:    2006-06-20
 *************************************************************************************/

function getTextAndURLFromPBPageLoadDialog(linkFieldName, textFieldName, languageID)
{
  var linkForm = document.information;
  getPBPageLoadDialog(linkForm, linkFieldName, textFieldName, languageID);
}

/*************************************************************************************
 *  Function:  getURLFromPBPageLoadDialog()
 *  Parameter:
 *    linkFieldName = Das Feld in das der URL geschrieben werden soll
 *  Description:  ruft getPBPageLoadDialog auf und schreibt den URL in das übergebene Feld
 *  Date:    20.01.2005
 *************************************************************************************/

function getURLFromPBPageLoadDialog(linkFieldName, languageID)
{
  getTextAndURLFromPBPageLoadDialog(linkFieldName, "", languageID);
}

/*************************************************************************************
 *  Function:  cleanPageName(pageName)
 *  Parameter:  pageName = Seitenname
 *  Description: Bereinigt einen Seitennamen um reservierte Zeichen
 *************************************************************************************/
function cleanPageName(pageName)
{
  var reservedPrefixes = "#!%~";

  while (pageName.length > 0)
  {
    if (reservedPrefixes.indexOf(pageName.charAt(0)) >= 0)
    {
      pageName = pageName.substring(1);
    }
    else
    {
      break;
    }
  }
  return pageName;
}

// Fügt weitere zusätzliche Werte in das Settings-Array (für Dialogmasken) hinzu
function restoreAdditionalValuesInCustomSettings(initialCustomSettings)
{
  var functionalRights = getFunctionalRights();
  initialCustomSettings["functionalRights"] = functionalRights;
  initialCustomSettings["pageoptions-useclassification"] = "yes";
  initialCustomSettings["pageoptions-open-langversion"] = "yes";
  initialCustomSettings["pageoptions-create-page"] = "yes";
  initialCustomSettings["pageoptions-objectupload"] = initialCustomSettings["pageoptions-imageupload"] = (functionalRights["add_object_to_actual_version"] ||
                                                                                                          functionalRights["all_objects_all_rights"]) ? "yes" : "no";

  if (typeof(useObjectPool) != "undefined")
  {
    initialCustomSettings["objectpool"] = (useObjectPool) ? "yes" : "no";
  }
  else
  {
    initialCustomSettings["objectpool"] = "no";
  }
  return initialCustomSettings;
}

// Ermittelt die funktionellen Rechte des aktuellen Users und erzeugt hieraus ein Array
function getFunctionalRights()
{
  var arr = new Array();

  var xmlFunctionalRights = new ActiveXObject("Microsoft.XMLDOM");
  xmlFunctionalRights.async = false;
  xmlFunctionalRights.validateOnParse = false;
  try
  {
    xmlFunctionalRights.load("../../menu/-1_xlogin_etemplate-wizard_pxml/request.xml?ContentType=text/xml&ACTION=GET_FUNCTIONALRIGHTS");
  }
  catch(except)
  {
    try
    {
      xmlFunctionalRights.load("../../menu/-1_xlogin_etemplate-wizard_pxml/request.xml?ContentType=text/xml&ACTION=GET_FUNCTIONALRIGHTS");
    }
    catch(except)
    {

    }
  }
  if (xmlFunctionalRights.parseError == 0)
  {
    var root = xmlFunctionalRights.documentElement;
    var frights = root.getElementsByTagName("functionalright");
    var i;
    for (i = 0; i < frights.length; i++)
    {
      var rightName = getAttributeValue(frights[i], "name", "");
      var rightValue = getAttributeValue(frights[i], "value", "false");
      if (rightName != "" && rightValue != "")
      {
        arr[rightName] = eval(rightValue);
      }
    }
  }
  else
  {

  }

  return arr;
}

// Ermittelt Wert aus XMl-Knoten
function getAttributeValue(node, attributeName, defaultValue)
{
  var attributes = node.attributes;
  var i;
  for (i = 0; i < attributes.length; i++)
  {
    if (attributes.item(i).nodeName == attributeName)
    {
      return attributes.item(i).nodeValue;
    }
  }
  return defaultValue;

}

/*************************************************************************************
 *  Function:  getPBPageLoadDialog(linkForm, linkFieldName, textFieldName, languageID, titleFieldName)
 *  Parameter:  linkForm = Formular in dem der Link und andere Eigenschaften gesetzt werden soll.
 *  Description:  Öffnet den Page- oder Objektlistdialog und übergibt die ausgewählten Werte
 *  Date:    2006-08-14
 *************************************************************************************/

function getPBPageLoadDialog(linkForm, linkFieldName, textFieldName, languageID, titleFieldName)
{

  var acturl = "";
  if ('undefined' != typeof linkForm[linkFieldName]) acturl = linkForm[linkFieldName].value;
  var acttarget = "_top";
  var actfilename = "";
  if ('undefined' != typeof linkForm[textFieldName]) actfilename = linkForm[textFieldName].value;
  var title = "";
  if ('undefined' != typeof linkForm[titleFieldName]) title = linkForm[titleFieldName].value;
  var ec2ksettings = null;
  var LinkIntern = "";
  var LinkObject = "";
  var args = new Array();
  var arr = null;
  var objectpool = false;
  var isOject = false;

  var xmlCustomSettings = new ActiveXObject("Microsoft.XMLDOM");
  xmlCustomSettings.async = false;
  xmlCustomSettings.validateOnParse = false;
  xmlCustomSettings.load("../../menu/-1_xlogin_eactivex-edit_padminpage/" + qeEC2KVersion + "settings.js?ContentType=text/html&ACTION=GET-CURRENT-SETTINGS&AREAID=" + qeUserarea);
  if (xmlCustomSettings.parseError == 0)
  {
    ec2ksettings = qeGetArrayFromSettingsNode(xmlCustomSettings);
    ec2ksettings["initialized"] = true;
    ec2ksettings = restoreAdditionalValuesInCustomSettings(ec2ksettings);
  }
  else
  {
    ec2ksettings = new Array();
  }

  if ('undefined' == typeof linkForm[titleFieldName])
  { // Es gibt kein Feld für die Übernahme des Title-Attributs. Also Eingabefeld deaktivieren:
    ec2ksettings["pageoptions-edittitle"] = "no";
    ec2ksettings["format-pblink-title"] = "no"; // MAS-854
  }

  args["opener"] = window;
  args["initialCustomSettings"] = ec2ksettings;
  args["acturl"] = acturl;
  args["acttarget"] = acttarget;
  args["mode"] = "returnResult";

  arr = showModalDialog("../../menu/-1_xlogin_yno_eactivex-edit_plink-addpirobase/index.html?PBUSERLANGUAGE=" + languageID,
      args,
      "dialogWidth:620px; dialogHeight:480px; resizable:no; status: no; help: no");

  if (arr != null)
  {

    acturl = getPbUrlFromArray(arr);
    acttarget = arr["target"];
    actfilename = arr["filename"];
    title = arr["title"];
    isOject = !arr["isMenu"];

    if (isOject) alert('Bitte passen Sie den Namen und Link des Objekts manuell an');
    if (!isOject && arr.cachedPageTree != null)
    {
      for (i = 0; i < arr.cachedPageTree.nodeArray.length; i++)
      {
        if (arr["id"] * 1 == arr.cachedPageTree.nodeArray[i].pbid * 1)
        {
          actfilename = arr.cachedPageTree.nodeArray[i].Name;
          break;
        }
      }
    }

    if ('undefined' != typeof linkForm[linkFieldName])  linkForm[linkFieldName].value = acturl;
    if ('undefined' != typeof linkForm[textFieldName])  linkForm[textFieldName].value = cleanPageName(actfilename);
    if ('undefined' != typeof linkForm[titleFieldName]) linkForm[titleFieldName].value = title;
    if (LinkIntern != "") document.all[LinkIntern].value = "1";
    if (LinkObject != "")
    {
      if (isOject)
        document.all[LinkObject].value = "1";
      else
        document.all[LinkObject].value = "0";
    }
  }

}

/*************************************************************************************
 *  Function:  getPbUrlFromArray()
 *  Parameter:  arr = Array mit allen relevanten Daten; über ihn wird der Link zusammengebaut
 *  Description:  Erstellt den Link-URL anhand des uebergebenen Arrays
 *  Date:    24.06.2003
 *************************************************************************************/

function getPbUrlFromArray(arr)
{
  var url = "";
  if (arr["isMenu"])
  {
    url = "../../menu/" + arr["id"];
  }
  else
  {
    url = "../../show/" + arr["id"];
  }

  if (arr["languageid"] > 0)
  {
    url += "_l" + arr["languageid"];
  }

  if (!arr["isMenu"])
  {
    if (arr["objectpool"] == true)
    {
      url += "_k1";
    }
  }

  url += "/" + arr["filename"];

  // MAS-803
  var anchor = arr["anchor"];
  if (anchor != null && anchor != "")
  {
    url += "?pbanker=" + myescape(anchor) + "#" + anchor;
  }

  return url;
}
//  tool function for escaping URI parts
function myescape(string)
{
  if (string == null)
  {
    return escape(null);
  }
  var result = escape(string);
  result = result.replace(/\u002B/g, "%2B");
  result = result.replace(/%u/g, "%25u");
  return result;
}
