<!--

if (typeof(console) == 'undefined'){
  console = {
    log: function(){},
    dir: function(){},
    time: function(){},
    timeEnd: function(){}
  }
}

Function.prototype.createDelegate = function(oScope, axArgs, bAppendArgs){
  var fn = this;
  return function(){
    var axCallArgs = axArgs || arguments;
    if ( bAppendArgs === true ){
      axCallArgs = Array.prototype.slice.call(arguments, 0);
      axCallArgs = axCallArgs.concat(axArgs);
    }else if (typeof bAppendArgs == "number"){
      axCallArgs = Array.prototype.slice.call(arguments, 0); // copy arguments first
      var axApplyArgs = [bAppendArgs, 0].concat(axArgs);     // create method call params
      Array.prototype.splice.apply(axCallArgs, axApplyArgs); // splice them in
    }
    return fn.apply(oScope || window, axCallArgs);
  };
}

if (typeof(Array.indexOf) == 'undefined'){
  Array.prototype.indexOf = function(xItem){
    for (var i=0;i<this.length;i++){
      if (this[i] === xItem){
        return i;
      }
    }
    return -1;
  }
}

_importNode = function(oNode,bImportChildren,oDoc,iCount){
  if (typeof(iCount) == 'undefined') var iCount = 0;
  var oNew;
  if (oNode.nodeType == 1){
    oNew = bfPage.createElement(oNode.nodeName,(oNode.name) ? {'name':oNode.name} : {},'',oDoc);//oDoc.createElement(oNode.nodeName);
    for (var i = 0; i < oNode.attributes.length; i++){
      if (oNode.attributes[i].nodeValue != null && oNode.attributes[i].nodeValue != ''){
        var sAttrName = oNode.attributes[i].name;
        if (sAttrName != 'name' && sAttrName != 'value'){
          //IE8 kompat-modus setzt mit 'type' einen default-value. daher value manuell im anschluss an die schleife
          if (sAttrName == 'class' || sAttrName == 'className'){
            oNew.className = oNode.attributes[i].value;
          }else{
            oNew.setAttribute(sAttrName, oNode.attributes[i].value);
          }
        }
      }
    }
    if (typeof(oNode.value) != 'undefined'){
      oNew.value = oNode.value;
    }
    if (oNode.style != null && oNode.style.cssText != null){
      oNew.style.cssText = oNode.style.cssText;
    }
  }else if (oNode.nodeType == 3){
    oNew = oDoc.createTextNode(oNode.nodeValue);
  }else if (oNode.nodeType == 8){
    oNew = oDoc.createComment(oNode.nodeValue);
  }
  if (bImportChildren && oNode.childNodes && oNode.childNodes.length > 0){
    for (var i=0;i<oNode.childNodes.length;i++){
      oNew.appendChild(_importNode(oNode.childNodes[i], true, oDoc, iCount+1));
    }
  }
  return oNew;
}


/*
var hReg = null;
*/
var jsHelper = {};
jsHelper.hFormPwdFlds = {};
jsHelper.hEvents = {};
jsHelper.getPreviousSibling = function(oCaller){
  var oNode = oCaller.previousSibling;
  while(oNode != null && oNode.tagName != oCaller.tagName){
    oNode = oNode.previousSibling;
  }
  return oNode;
}
jsHelper.getNextSibling = function(oCaller){
  var oNode = oCaller.nextSibling;
  while(oNode != null && oNode.tagName != oCaller.tagName){
    oNode = oNode.nextSibling;
  }
  return oNode;
}
jsHelper.getNodeTag = function(oCaller,sTagName){
  var oNode = oCaller;
  while(oNode != null && oNode.tagName != sTagName){
    oNode = oNode.parentNode;
  }
  return oNode;
}
jsHelper.getFirstChild = function(oCaller){
  var oNode = oCaller.firstChild;
  while(oNode != null && oNode.nodeType != 1){
    oNode = oNode.nextSibling;
  }
  return oNode;
}
jsHelper.getTable = function(oCaller){
  return jsHelper.getNodeTag(oCaller,'TABLE');
}
jsHelper.getTBody = function(oTable){
  oTBdy = null;
  if (oTable.childNodes.length > 0){
    var oTBdy = oTable.firstChild;
    while (oTBdy && oTBdy.nodeName != 'TBODY'){
      oTBdy = oTBdy.nextSibling;
    }
  }
  return oTBdy;
}
jsHelper.getTr = function(oCaller){
  return jsHelper.getNodeTag(oCaller,'TR');
}
jsHelper.getStruct = function(data){
  var sRet = '';
  var sPre = (jsHelper.getStruct.arguments.length>1) ? jsHelper.getStruct.arguments[1] : '';
  if (typeof(data) == "object"){
    for (x in data){
      var entry = data[x];
      sRet+= sPre+'['+x+'] => ';
      if (typeof(entry) == "object"){
        sRet+= '<br>';
        entry = jsHelper.getStruct(entry,sPre+'  ');
      }
      sRet+= entry+'<br>';
    }
  }else{
    sRet = data;
  }
  return sRet;
}
jsHelper.getRealStyle = function(oTgt,sCssRule,bToInt,oDocument){
  var oDocument = (typeof(oDocument)) == 'undefined' ? document : oDocument;
  if (typeof(bToInt) == 'undefined'){
    bToInt = 0;
  }
  var sValue = "";
  if (oDocument.defaultView && oDocument.defaultView.getComputedStyle){
    sValue = oDocument.defaultView.getComputedStyle(oTgt,'').getPropertyValue(sCssRule);
  }else if (oTgt.currentStyle){
    sCssRule = sCssRule.replace(/\-(\w)/g, function (sMatch, sSub1){
      return sSub1.toUpperCase();
    });
    sValue = oTgt.currentStyle[sCssRule];
  }
  if (bToInt){
    var iRet = parseInt(sValue.replace(/[^0-9\.]*/g,''));
    return (isNaN(iRet)) ? 0 : iRet;
  }else{
    return sValue;
  }
}
jsHelper.getRGB = function(sColor){
  var aiRgb = [];
  if (sColor.indexOf('rgb') == 0){
    var aiRGB = sColor.match(/[0-9]{1,3}/g);
    var iSys = 10;
  }else if (sColor.indexOf('#') == 0){
    var aiRGB = sColor.match(/[0-9a-f]{2}/g);
    var iSys = 16;
  }
  for (var i=0;i<aiRGB.length;i++){
    aiRGB[i] = parseInt(aiRGB[i],iSys);
  }
  return aiRGB;
}
jsHelper.rgbToCssColor = function(sColor){
  function hex(iC){
    var iC = parseInt(iC).toString(16);
    return iC.length < 2 ? '0'+iC : iC;
  }
  var aiRgb = jsHelper.getRGB(sColor);
  if (aiRgb.length == 3){
    return '#'+hex(aiRgb[0])+hex(aiRgb[1])+hex(aiRgb[2]);
  }else{
    return '';
  }
}
jsHelper.restoreOpHref = function(oCaller){
  oCaller.setAttribute('href',oCaller.lang);
  oCaller.onmousedown = '';
}
jsHelper.formRead = function(oForm,bGetText){
  if (typeof(bGetText) == 'undefined'){
    var bGetText = 0;
  }
  var hRet = {};
  var hArrCount = {};
  function cleanHash(hData,hParent,sPKey){
    var bHasData = 0;
    for (sKey in hData){
      bHasData = 1;
      if (typeof(hData[sKey]) == 'object'){
        cleanHash(hData[sKey],hData,sKey);
      }
    }
    if (!bHasData && typeof(hParent) != 'undefined'){
      delete hParent[sPKey];
    }
  }
  for (var i=0;i<oForm.elements.length;i++){
    var oInput = oForm.elements[i];
    var xPointer = hRet;
    var asPath = this.getPathByName(oForm.elements[i]);
    for (var j=0;j<asPath.length;j++){
      if (typeof(xPointer[asPath[j]]) == 'undefined'){
        if (j < (asPath.length - 1)){
          xPointer[asPath[j]] = {};
        }else{
          if (  (oInput.tagName == 'INPUT' && (oInput.type == 'text' || oInput.type == 'hidden' || oInput.type == 'password'))
              ||(oInput.tagName == 'INPUT' && oInput.type == 'checkbox' && oInput.checked)
              ||(oInput.tagName == 'INPUT' && oInput.type == 'radio' && oInput.checked)
              || oInput.tagName == 'TEXTAREA'
              ||(oInput.tagName == 'SELECT' && !oInput.multiple)
          ){
            if (!bGetText || oInput.tagName != 'SELECT'){
              var xValue = oInput.value;
            }else{
              var xValue = {
                'value': oInput.value,
                'text':  oInput.options[oInput.selectedIndex].text
              };
            }
            if (asPath[j].length > 0){
              xPointer[asPath[j]] = xValue;
            }else{
              if (typeof(hArrCount[oForm.elements[i].name]) == 'undefined'){
                hArrCount[oForm.elements[i].name] = 0;
              }else{
                hArrCount[oForm.elements[i].name]++;
              }
              xPointer[hArrCount[oForm.elements[i].name].toString()] = xValue;
            }
          }else if (oInput.tagName == 'SELECT' && oInput.multiple){
            if (asPath[j].length > 0){
              if (!bGetText){
                xPointer[asPath[j]] = oInput.value;
              }else{
                xPointer[asPath[j]] = {
                  'value': oInput.options[oInput.selectedIndex].value,
                  'text':  oInput.options[oInput.selectedIndex].text
                };
              }
            }else{
              if (typeof(hArrCount[oForm.elements[i].name]) == 'undefined'){
                hArrCount[oForm.elements[i].name] = 0;
              }
              for (var k=0;k<oInput.options.length;k++){
                if (oInput.options[k].selected){
                  if (!bGetText){
                    xPointer[hArrCount[oForm.elements[i].name].toString()] = oInput.options[k].value;
                  }else{
                    xPointer[hArrCount[oForm.elements[i].name].toString()] = {
                      'value': oInput.options[k].value,
                      'text':  oInput.options[k].text
                    };
                  }
                  hArrCount[oForm.elements[i].name]++;
                }
              }
            }
          }
        }
      }
      xPointer = xPointer[asPath[j]];
    }
  }
  cleanHash(hRet);
  return hRet;
}
jsHelper.objIsEmpty = function(oObj){
  if (typeof(oObj) != 'undefined'){
    if (typeof(oObj.length) != 'undefined'){
      return (oObj.length > 0) ? 0 : 1;
    }else{
      var sKey;
      for (sKey in oObj){
        return 0;
      }
    }
  }
  return 1;
}
jsHelper.objLength = function(oObj){
  var iLength = 0;
  for (var sKey in oObj){
    iLength ++;
  }
  return iLength;
}
jsHelper.objClone = function(oObj){
  return jQuery.extend(true,{},oObj);
}
jsHelper.formPwdPolicy = function(oForm){
  _auth['policy']
  if (typeof(jsHelper.hFormPwdFlds[oForm.name]) == 'undefined'){
    jsHelper.hFormPwdFlds[oForm.name] = {};
    for(var i=0; i<oForm.elements.length; i++){
      if (oForm.elements[i].tagName == 'INPUT' && (oForm.elements[i].type == 'text' || oForm.elements[i].type == 'password') && oForm.elements[i].name.indexOf('[password]') >= 0){
        hFormPwdFlds[oForm.name][oForm.elements[i].name] = {
          'element' : oForm.elements[i],
          'type'    : oForm.elements[i].type
        };
      }
    }
  }

  /*
        if (typeof(jsHelper.hFormPwdFlds[oForm.name]) == 'undefined'){
          jsHelper.hFormPwdFlds[oForm.name] = {};
          if (oForm.elements[i].type == 'password' || (oForm.elements[i].type == 'text' && oForm.elements[i].name.indexOf('[password]') >= 0)){
            hFormPwdFlds[oForm.name][oForm.elements[i].name] = oForm.elements[i];
          }
        }
  */
  /*
jsHelper.hFormPwdFlds = {};

  var aiRmvElmentIds = [];
  if (typeof(jsHelper.hDeletedPasswordItems[oForm.name]) == 'object'){
    for(var sInpName in jsHelper.hDeletedPasswordItems[oForm.name]){
      jsHelper.hDeletedPasswordItems[oForm.name][sInpName]['element'].value = '';
      jsHelper.hDeletedPasswordItems[oForm.name][sInpName]['parent'].appendChild(jsHelper.hDeletedPasswordItems[oForm.name][sInpName]['element']);
      delete jsHelper.hDeletedPasswordItems[oForm.name][sInpName];
    }
  }

  while(iId = aiRmvElmentIds.pop()){
    var oInp = oForm.elements[iId];
    if (typeof(jsHelper.hDeletedPasswordItems[oForm.name]) == 'undefined'){
      jsHelper.hDeletedPasswordItems[oForm.name] = {};
    }
    jsHelper.hDeletedPasswordItems[oForm.name][oForm.elements[iId].name] = {
      'element' : oForm.elements[iId].cloneNode(true),
      'parent'  : oForm.elements[iId].parentNode
    };
    jsHelper.rmvInput(oForm,oForm.elements[iId].name);
  }
  */
}

jsHelper.ieEuro = function(xValue){
  return (bIE && typeof(xValue) == 'string') ? xValue.replace(new RegExp(String.fromCharCode(128),'g'),String.fromCharCode(8364)) : xValue;
}

jsHelper.formFill = function(oForm,hData){
  for (var i=0;i<oForm.elements.length;i++){
    var sValue;
    if (oForm.elements[i].name.length && (sValue = this.getValueByPath(oForm.elements[i],hData)) !== false && sValue != null){
      if (oForm.elements[i].tagName == 'INPUT' && (oForm.elements[i].type == 'text' || (oForm.elements[i].type == 'hidden' && (typeof(oForm[oForm.elements[i].name].length) == 'undefined' || oForm[oForm.elements[i].name][1].type != 'checkbox')) || oForm.elements[i].type == 'password')){
        oForm.elements[i].value = jsHelper.ieEuro(sValue);
      }else if (oForm.elements[i].tagName == 'INPUT' && oForm.elements[i].type == 'checkbox'){
        oForm.elements[i].checked = (sValue == '1') ? true : false;
      }else if (oForm.elements[i].tagName == 'INPUT' && oForm.elements[i].type == 'radio'){
        oForm.elements[i].checked = (sValue == oForm.elements[i].value) ? true : false;
      }else if (oForm.elements[i].tagName == 'TEXTAREA'){
        oForm.elements[i].value = jsHelper.ieEuro(sValue);
      }else if (oForm.elements[i].tagName == 'SELECT'){
        for (var j=0;j<oForm.elements[i].options.length;j++){
          if (oForm.elements[i].options[j].value == sValue){
            oForm.elements[i].selectedIndex = j;
            break;
          }
        }
      }
    }
  }
}
jsHelper.formReset = function(oForm){
  for (var i=0;i<oForm.elements.length;i++){
    if (oForm.elements[i].tagName == 'INPUT' && (oForm.elements[i].type == 'text' || oForm.elements[i].type == 'hidden' || oForm.elements[i].type == 'password') && oForm.elements[i].readOnly == false){
      oForm.elements[i].value = '';
    }else if (oForm.elements[i].tagName == 'INPUT' && oForm.elements[i].type == 'checkbox'){
      oForm.elements[i].checked = false;
    }else if (oForm.elements[i].tagName == 'INPUT' && oForm.elements[i].type == 'radio'){
      oForm.elements[i].checked = false;
    }else if (oForm.elements[i].tagName == 'TEXTAREA' && oForm.elements[i].readOnly == false){
      oForm.elements[i].value = '';
    }else if (oForm.elements[i].tagName == 'SELECT'){
      oForm.elements[i].selectedIndex = 0;
    }
    var oTmp;
    if ((oTmp = jQuery.data(oForm.elements[i],'mirlObj')) && typeof(oTmp) != 'undefined' && typeof(oTmp.reset) == 'function'){
      oTmp.reset();
    }
  }
}
jsHelper.getPathByName = function(oInput){
  var asRet = [];
  if (typeof(oInput.name) != 'undefined' && oInput.name.length > 0){
    asRet = oInput.name.substr(oInput.name.indexOf('[')+1,oInput.name.length - (oInput.name.indexOf('[')+2)).split('][');
  }
  return asRet;
}
jsHelper.getValueByPath = function(oInput,hData){
  var asPath = this.getPathByName(oInput);
  var xRet = hData;
  for (var i=0;i<asPath.length;i++){
    if (!xRet){
      return null;
    }
    //pruefe checkboxen/radios:
    if (typeof(xRet[asPath[i]]) == 'undefined'){
      if (asPath[i].length == 0 && typeof(xRet) == 'object'){
        for (var sKey in xRet){
          if (xRet[sKey] == oInput.value){
            return '1';
          }
        }
      }
      return false;
    }
    xRet = xRet[asPath[i]];
  }
  return ((typeof(xRet) != 'object') ? xRet : '');
}
jsHelper.dateOut = function (sIn,bAddTime){
  if (typeof(bAddTime) == 'undefined'){
    bAddTime = 0;
  }
  var oIn = null;
  if (typeof(sIn) == 'number' && (oIn = new Date(sIn*1000))){
    var sIn = ('0'+oIn.getDate()).substr(-2)+'.'+('0'+(oIn.getMonth()+1)).substr(-2)+'.'+oIn.getFullYear();
    if (bAddTime){
      sIn += ' '+('0'+oIn.getHours()).substr(-2)+':'+('0'+oIn.getMinutes()).substr(-2)+':'+('0'+oIn.getSeconds()).substr(-2);
    }
    return sIn;
  }else{
    return (sIn.match(/^[0-9]{2,2}-[0-9]{2,2}-[0-9]{4,4}( [0-9]{2,2}:[0-9]{2,2}:[0-9]{2,2})$/))
      ? sIn
      : sIn.split(' ').shift().split('-').reverse().join(".") + ((bAddTime)
        ? ' ' + sIn.split(' ').pop().substr(0,5)
        : '');
  }
}
jsHelper.tblReCycle = function(sId,bDataEntryOnly){
  var bDataEntryOnly = bDataEntryOnly || 0;
  var sBaseClass = 'data_entry';
  var sClass   = 'data_entry_stripe';
  var sClassLv = 'lv_entry_stripe_';
  var bSwitch = 0;
  var bTestLv = 1;
  var bLv     = 0;
  var iLastRow = -1;
  var oTBdy = jsHelper.getTBody(document.getElementById(sId));
  if (oTBdy){
    var oRows = oTBdy.rows;
    for (var x=0; x<oRows.length; x++){
      if (oRows[x].style.display != 'none' && (!bDataEntryOnly || oRows[x].className.indexOf(sBaseClass) >= 0)){
        if (bTestLv){
          if (oRows[x].className.indexOf('lv_entry_row') >= 0){
            bLv = 1;
          }
          bTestLv = 0;
        }
        if (!bLv){
          jsHelper.setClass(oRows[x],bSwitch,sClass);
        }else{
          jsHelper.setClass(oRows[x],bSwitch,sClassLv+'row');
          jsHelper.setClass(oRows[x],0,'lv_row_last');
          var aoCells = oRows[x].cells;
          for (var i=0; i<aoCells.length; i++){
            jsHelper.setClass(aoCells[i],bSwitch,sClassLv+'cell');
            if (i == 0){
              jsHelper.setClass(aoCells[i],bSwitch,sClassLv+'cell_first');
            }
            if (i == aoCells.length - 1){
              jsHelper.setClass(aoCells[i],bSwitch,sClassLv+'cell_last');
            }
          }
          iLastRow = x;
        }
        bSwitch = (bSwitch) ? 0 : 1;
      }
    }
    if (iLastRow >= 0){
      jsHelper.setClass(oRows[iLastRow],1,'lv_row_last');
    }
  }
}
jsHelper.getCookieVal = function(sName){
  var sCookie = document.cookie;
  var sPrefix = sName + "=";
  var iBegin = sCookie.indexOf("; " + sPrefix);

  if (iBegin == -1){
    iBegin = sCookie.indexOf(sPrefix);
    if (iBegin != 0){
      return null;
    }
  } else {
    iBegin += 2;
  }
  var iEnd = document.cookie.indexOf(";", iBegin);
  if (iEnd == -1){
    iEnd = sCookie.length;
  }
  return unescape(sCookie.substring(iBegin + sPrefix.length, iEnd));
}
jsHelper.setCookieVal = function (sName,sValue,sPath,sDomain){
  var bSecure = false;
  sPath = "/";
  document.cookie= sName + "=" + escape(sValue) +
  ((sPath) ? "; path=" + sPath : "") +
  ((sDomain) ? "; domain=" + sDomain : "") +
  ((bSecure) ? "; secure" : "");
}
jsHelper.cleanTbl = function(oTbl){
  var oChild = jsHelper.getTBody(oTbl).firstChild;
  while(oChild){
    var oTmp = oChild;
    oChild = oChild.nextSibling;
    if (oTmp.nodeName && oTmp.nodeName != 'TR'){
      oTmp.parentNode.removeChild(oTmp);
    }
  }
}
jsHelper.tblEnabled = function(table,bEnabled,bImg){
  var types = new Array('input','select','textarea');
  for(var i=0;i<types.length;i++){
    var inputs = table.getElementsByTagName(types[i]);
    for(var j=0;j<inputs.length;j++){
      if (inputs[j].style.display != 'none' && inputs[j].className.indexOf('pwd_disabled') < 0){
        inputs[j].disabled = (bEnabled) ? false : true;
        inputs[j].readOnly = (bEnabled) ? false : true;
      }
    }
  }
  var tds = table.getElementsByTagName('td');
  for(var i=0;i<tds.length;i++){
    if (bEnabled){
      tds[i].className = tds[i].className.replace(/ disabled/,'');
      if (tds[i].className == 'disabled'){
        tds[i].className = '';
      }
    }else{
      if (!tds[i].className.match(/disabled/)){
        tds[i].className = (bEnabled) ? tds[i].className.replace(/ disabled/,'') : tds[i].className+' disabled';
      }
    }
  }
  if (bImg){
    var imgs = table.getElementsByTagName('img');
    for(var i=0;i<imgs.length;i++){
      if (imgs[i].className=='ico16' || imgs[i].className=='ico1012'){
        var iLength = imgs[i].src.length;
        imgs[i].src = (bEnabled) ? imgs[i].src.replace(/_off/,'') : ((imgs[i].src.search(/_off/) == -1) ? imgs[i].src.substr(0,iLength-4)+'_off'+imgs[i].src.substr(iLength-4) : imgs[i].src);
      }
    }
  }
}
jsHelper.tblBtnEnabled = function(oTbl,bEnabled){
  var oTBdy = oTbl.getElementsByTagName('tbody')[0];
  var oTr = oTBdy.rows[0];
  var oImg = oTr.cells[0].getElementsByTagName('img')[0];
  var oTd = oTr.cells[1];
  if (bEnabled && oTr.className.indexOf('form_button_off') >= 0){
    this.setClass(oTr,0,'form_button_off');
    this.setClass(oTr,1,'form_button');
    if (typeof(oTr.onclick) != 'undefined' && oTr.onclick != null){
      this.setEvent(oTr,'onclick',this.getEvent(oTr,'onclick').replace(/^\/+/,''));
    }
    if (typeof(oTbl.onclick) != 'undefined' && oTbl.onclick != null){
      this.setEvent(oTbl,'onclick',this.getEvent(oTbl,'onclick').replace(/^\/+/,''));
    }
    oImg.src = oImg.src.replace(/_off\.gif$/,'.gif');
    this.setClass(oTd,0,'disabled');
  }else if (!bEnabled && oTr.className.indexOf('form_button_off') < 0){
    this.setClass(oTr,0,'form_button');
    this.setClass(oTr,1,'form_button_off');
    if (typeof(oTr.onclick) != 'undefined' && oTr.onclick != null){
      this.setEvent(oTr,'onclick','//'+this.getEvent(oTr,'onclick'));
    }
    if (typeof(oTbl.onclick) != 'undefined' && oTbl.onclick != null){
      this.setEvent(oTbl,'onclick','//'+this.getEvent(oTbl,'onclick'));
    }
    oImg.src = oImg.src.replace(/\.gif$/,'_off.gif');
    this.setClass(oTd,1,'disabled');
  }
}
jsHelper.objEnabled = function (oObj,bEnabled,sType){
  if (oObj.tagName == 'TABLE'){
    if (sType == undefined){
      var inputs = oObj.getElementsByTagName('input');
    }else if (sType == 'text' || sType == 'checkbox'){
      var inputs = oObj.getElementsByTagName('input');
    }else if (sType == 'select-one'){
      var inputs = oObj.getElementsByTagName('select');
    }
  }else{
    var inputs = new Array();
    inputs[0] = oObj;
  }
  for(var x=0;x<inputs.length;x++){
    if (sType == undefined || (sType != undefined && inputs[x].type == sType)){
      if (bEnabled){
        inputs[x].disabled = false;
        inputs[x].readOnly = false;
      }else{
        inputs[x].disabled = true;
        inputs[x].readOnly = true;
      }
    }
  }
}
jsHelper.elementsEnabled = function(sFrm,aFlds,bOn){
  for (var i=0;i<aFlds.length;i++){
    if (typeof(document[sFrm][aFlds[i]].length) == 'undefined' || document[sFrm][aFlds[i]].tagName == 'SELECT'){
      jsHelper.objEnabled(document[sFrm][aFlds[i]],bOn);
    }else{
      for (var j=0;j<document[sFrm][aFlds[i]].length;j++){
        jsHelper.objEnabled(document[sFrm][aFlds[i]][j],bOn);
      }
    }
  }
}
jsHelper.setEvent = function(oTgt,sEvent,sEval,sEventKey){
  var bDoc = (typeof(oTgt) != 'undefined' && typeof(oTgt.nodeName) != 'undefined' && oTgt.nodeName == '#document') ? 1 : 0;
  if (typeof(sEval) == 'function'){
    var fctEval = sEval;
    sEval = sEval.toString().replace(/\r?\n/g,'').replace(/^[^{]+{|}[^}]*$/g,'');
  }else{
    var fctEval = null;
  }
  if (bDoc && typeof(sEventKey) == 'undefined'){
    shStatus.add('err','Document benoetigt zwingend einen EventKey!');
  }else if(typeof(sEventKey) != 'undefined' && !bDoc && (typeof(oTgt.id) == 'undefined' || oTgt.id.length == 0)){
    shStatus.add('err','Das Zielobject benoetigt zwingend eine ID!');
  }else{
    if (typeof(sEventKey) == 'undefined'){
      if (bIE){
        var oFunc = new Function(sEval);
        oTgt[sEvent] = oFunc;
      }else{
        oTgt.setAttribute(sEvent,sEval);
      }
    }else{
      var sId = (bDoc) ? 'document' : oTgt.id;
      var fctCache = null;
      if (typeof(jsHelper.hEvents[sId]) != 'undefined' && typeof(jsHelper.hEvents[sId][sEvent]) != 'undefined' && typeof(jsHelper.hEvents[sId][sEvent][sEventKey]) != 'undefined'){
        if (document.removeEventListener){
          oTgt.removeEventListener(sEvent.replace(/^on/,''), jsHelper['hEvents'][sId][sEvent][sEventKey]['fct'], false);
        }else if(document.detachEvent){
          oTgt.detachEvent(sEvent, jsHelper['hEvents'][sId][sEvent][sEventKey]['fct']);
        }
        if (jsHelper.hEvents[sId][sEvent][sEventKey]['fctCache']){
          fctCache = jsHelper.hEvents[sId][sEvent][sEventKey]['fctCache'];
        }
        delete jsHelper.hEvents[sId][sEvent][sEventKey];
      }
      if (sEval.length > 0){
        var oEvent = {};
        oEvent['fct']   = (fctEval) ? fctEval : new Function('oEvent',sEval);
        oEvent['oTgt']  = oTgt;
        oEvent['sEval'] = sEval;
        if (typeof(fctCache) == 'function') {
          oEvent['fctCache'] = fctCache;
        }
        if (typeof(jsHelper.hEvents[sId]) == 'undefined'){
          jsHelper.hEvents[sId] = {};
        }
        if (typeof(jsHelper.hEvents[sId][sEvent]) == 'undefined'){
          jsHelper.hEvents[sId][sEvent] = {};
        }
        jsHelper.hEvents[sId][sEvent][sEventKey] = oEvent;
        if (document.addEventListener){
          oTgt.addEventListener(sEvent.replace(/^on/,''), jsHelper['hEvents'][sId][sEvent][sEventKey]['fct'], false);
        }else{
          oTgt.attachEvent(sEvent, jsHelper['hEvents'][sId][sEvent][sEventKey]['fct']);
        }
      }
    }
  }
}
jsHelper.getEvent = function(oSrc,sEvent,sEventKey){
  var sFunction;
  if (typeof(sEventKey) != 'undefined'){
    var sId = (oSrc == document) ? 'document' : oSrc.id;
    if (   typeof(jsHelper.hEvents[sId]) == 'undefined'
        || typeof(jsHelper.hEvents[sId][sEvent]) == 'undefined'
        || typeof(jsHelper.hEvents[sId][sEvent][sEventKey]) == 'undefined'){
      sFunction = '';
    }else{
      sFunction = jsHelper.hEvents[sId][sEvent][sEventKey]['sEval'];
    }
  }else{
    if (bIE){
      sFunction = (oSrc[sEvent]) ? oSrc[sEvent].toString() : '';
    }else{
      sFunction = (oSrc.getAttribute(sEvent)) ? oSrc.getAttribute(sEvent).toString() : '';
    }
    if (sFunction.indexOf('function') == 0){
      sFunction = sFunction.replace(/\r?\n/g,'').replace(/^[^{]+{|}[^}]*$/g,'');
    }
  }
  return sFunction;
}
jsHelper.enableEvent = function(oTgt,sEvent,bOn){
  if (typeof(bOn) == 'undefined'){
    var bOn = 1;
  }
  var sActEvent = jsHelper.getEvent(oTgt,sEvent);
  if ((sActEvent.indexOf('//') == 0 && bOn) || (sActEvent.indexOf('//') != 0 && !bOn)){
    jsHelper.setEvent(oTgt,sEvent,((bOn) ? sActEvent.replace(/^\/{2,}/,'') : '//'+sActEvent));
    if (oTgt.id && typeof(jsHelper.hEvents[oTgt.id]) != 'undefined' && typeof(jsHelper.hEvents[oTgt.id][sEvent]) != 'undefined'){
      for (var sEventKey in jsHelper.hEvents[oTgt.id][sEvent]){
        if (bOn){
          var fctActEvent = jsHelper.hEvents[oTgt.id][sEvent][sEventKey]['fctCache'];
          if (typeof(fctActEvent) != 'undefined'){
            jsHelper.setEvent(oTgt,sEvent,fctActEvent,sEventKey);
          }
        }else{
          if (typeof(jsHelper.hEvents[oTgt.id][sEvent][sEventKey]['fct']) != 'undefined'){
            jsHelper.hEvents[oTgt.id][sEvent][sEventKey]['fctCache'] = jsHelper.hEvents[oTgt.id][sEvent][sEventKey]['fct'];
            jsHelper.setEvent(oTgt,sEvent,new Function('return;//placeholder, event disabled'),sEventKey);
          }
        }
      }
    }
  }
}
jsHelper.disableEvent = function(oTgt,sEvent){
  jsHelper.enableEvent(oTgt,sEvent,0);
}
jsHelper.enableImage = function(oTgt,bOn){
  if (typeof(bOn) == 'undefined'){
    bOn = 1;
  }
  if (bOn){
    jsHelper.setClass(oTgt,1,'hand');
    jsHelper.setEvent(oTgt,'onclick',jsHelper.getEvent(oTgt,'onclick').replace(/^(\/\/)+/,''));
    if (oTgt.tagName == 'IMG'){
      oTgt.src = oTgt.src.replace(/_off\.gif$/,'.gif');
    }
  }else{
    jsHelper.setClass(oTgt,0,'hand');
    jsHelper.setEvent(oTgt,'onclick','//'+jsHelper.getEvent(oTgt,'onclick'));
    if (oTgt.tagName == 'IMG' && oTgt.src.indexOf('_off.gif') < 0){
      oTgt.src = oTgt.src.replace(/\.gif$/,'_off.gif');
    }
  }
}
jsHelper.setClass = function(oTarget,bAdd,sName){
  if (bAdd){
    if (typeof(oTarget.className) == 'undefined'){
      oTarget.className = sName;
    }else{
      var bMatched = 0;
      var aTmp = oTarget.className.split(' ');
      for (var i=0; i<aTmp.length; i++){
        if (aTmp[i] == sName){
          bMatched = 1;
          break;
        }
      }
      if (!bMatched){
        oTarget.className += ' '+sName;
      }
    }
  }else if (typeof(oTarget.className) != 'undefined'){
    if (oTarget.className.indexOf(sName) >= 0){
      if (hReg == null){
        hReg = new Object();
      }
      if (typeof(hReg[sName]) == 'undefined'){
        hReg[sName] = new RegExp(" ?\\b"+sName+"\\b",'g');
      }
      oTarget.className = oTarget.className.replace(hReg[sName],'');
    }
  }
}
jsHelper.trim = function(sIn){
  return sIn.replace(/^\s+|\s+$/g, '');
}
jsHelper.rowUpd = function (oRow,oSrc,oFrm){
  var bMatch = 0;
  for(var i=0; i<oRow.cells.length; i++){
    var aMatch = null;
    if ((aMatch = decodeURI(oSrc.cells[i].innerHTML).match(/\$([a-zA-Z0-9\[\]_-]+)/)) && typeof(oFrm[aMatch[1]]) != 'undefined'){
      bMatch = 1;
      oRow.cells[i].innerHTML = oSrc.cells[i].innerHTML;
    }
  }
  if (bMatch == 1){
    jsHelper.rowFill(oRow,oFrm);
  }
}
jsHelper.rowFill = function (oRow,oFrm,iId){
  for(var i=0; i<oRow.cells.length; i++){
    var bChanges = 0;
    var aMatch = null;
    var sNew = decodeURI(oRow.cells[i].innerHTML);
    while(aMatch = sNew.match(/\$([a-zA-Z0-9\[\]_-]+)/)){
      if (aMatch[1] == 'Id'){
        sNew = sNew.replace(aMatch[0],iId);
        bChanges = 1;
      }else{
        if (typeof(oFrm[aMatch[1]]) != 'undefined'){
          sNew = sNew.replace(aMatch[0],oFrm[aMatch[1]].value);
          bChanges = 1;
        }else{
          sNew = sNew.replace(aMatch[0],'?'+aMatch[1]+'?');
          //bChanges = 1;
        }
      }
    }
    while(aMatch = sNew.match(/\$\(([a-zA-Z0-9\'\(\)\.:\?! _=-]+)\)/)){
      sNew = sNew.replace(aMatch[0],eval(aMatch[1]));
      bChanges = 1;
    }
    if (bChanges == 1){
      oRow.cells[i].innerHTML = sNew;
    }
  }
}
jsHelper.localNumber = function(xIn){
  if (xIn.indexOf(_dec_point) != -1){
    xIn = xIn.replace(_thousands_sep,'');
    xIn = xIn.replace(_dec_point,'.');
  }else if(_thousands_sep != '.' && xIn.indexOf(_thousands_sep) != -1){
    xIn = xIn.replace(_thousands_sep,'');
  }
  return Number(xIn);
}
jsHelper.formatNumber = function(xIn){
  var sDecPoint = _dec_point;
  var sThousandsSep = _thousands_sep;
  if (typeof(xIn) == 'undefined'){
    xIn = 0;
  }
  xIn = (xIn == null) ? '' : xIn.toString();
  if (xIn.search(/\./) == -1){
    var iNum = Number(xIn.replace(sDecPoint,'.'));
  }else{
    var iNum = Number(xIn.replace(/,/,''));
  }
  if (jsHelper.formatNumber.arguments.length>1){
    iNum = iNum.toFixed(jsHelper.formatNumber.arguments[1]);
  }else{
    iNum = iNum.toFixed(2);
  }
  var sRet = iNum.toString();
  var aTmp = sRet.split('.');
  delete sRet;
  var sInteger = aTmp[0];
  var sExponent = aTmp[1];
  delete aTmp;
  if (sThousandsSep != null && sThousandsSep != ''){
    for(i = sInteger.length-3; i>0; i -= 3){
      sInteger = sInteger.substring(0,i)+sThousandsSep+sInteger.substring(i);
    }
  }
  return sInteger+sDecPoint+sExponent;
}
jsHelper.formatPrice = function(fNumber,iDigits){
  if (typeof(iDigits) == 'undefined'){
    var iDigits = 2;
  }
  return this.formatNumber(fNumber,iDigits)+' '+_currency;
}
jsHelper.getParentId = function(sId){
  aTmp = sId.split("/");
  var tmp = aTmp.pop();
  while(!tmp && aTmp.length){
    tmp = aTmp.pop();
  }
  return aTmp.join("/");
}
jsHelper.tblReExpand = function(sId){
  tblReExpand(sId);
}
jsHelper.selectSwitchTo = function(oSelect,sValue){
  var aoOptions = oSelect.getElementsByTagName('option');
  for (var i=0;i<aoOptions.length;i++){
    if (aoOptions[i].value == sValue){
      oSelect.selectedIndex = i;
      break;
    }
  }
}
jsHelper.selectAddOptions = function(oSelect,hOptions,bSetTitle){
  var bSetTitle = bSetTitle || 0;
  var sKey;
  var oDoc = oSelect.ownerDocument;
  for (sKey in hOptions){
    if (typeof(hOptions[sKey]) == 'object'){
      var sText = hOptions[sKey]['text'];
      var sDisabled = (hOptions[sKey]['disabled']) ? 'disabled' : '';
    }else{
      var sText = hOptions[sKey];
      var sDisabled = '';
    }
    var oOption = bfPage.createElement('option',{
      'disabled': sDisabled,
      'value': sKey
    },sText,oDoc);
    if (bSetTitle){
      oOption.title = sKey;
    }
    oSelect.appendChild(oOption);
  }
}
jsHelper.selectRmvOptions = function(oSelect,asOptions){
  for (var i=0; i<asOptions.length; i++){
    for (var j=0; j<oSelect['options'].length; j++){
      if (asOptions[i] == oSelect['options'][j].value){
        oSelect.removeChild(oSelect['options'][j]);
        break;
      }
    }
  }
}
jsHelper.selectReset = function(oSelect,iPreserve){
  if (typeof(iPreserve) == 'undefined'){
    iPreserve = 0;
  }
  var aoChilds = oSelect['options'];
  while (aoChilds.length > iPreserve){
    oSelect.removeChild(aoChilds[(aoChilds.length-1)]);
  }
}
jsHelper.selectUpdateOptions = function(oSelect,oOptions){
  for (var sKey in oOptions){
    for (var i=0; i<oSelect['options'].length; i++){
      var oOption = oSelect['options'][i];
      if (sKey == oOption.value){
        while(oOption.firstChild){
          oOption.removeChild(oOption.firstChild);
        }
        oOption.appendChild(document.createTextNode(oOptions[sKey]));
      }
    }
  }
}
jsHelper.stopBubbling = function(oEvent){
  if (!oEvent){
    var oEvent = window.event;
  }
  oEvent.cancelBubble = true;
  if (oEvent.stopPropagation){
    oEvent.stopPropagation();
  }
}
jsHelper.htmlspecialchars = function(sIn){
  return (typeof(sIn.indexOf) == 'function' && sIn.indexOf('<') != -1) ? sIn.replace(/&/g,'&amp;').replace(/</g,'&lt;') : sIn;
}
jsHelper.rmvChilds = function(oPrt){
  while (oPrt.childNodes.length > 0){
    oPrt.removeChild(oPrt.firstChild);
  }
}
jsHelper.rmvInput = function(oFrm,sName){
  if (typeof(oFrm[sName]) != 'undefined'){
    if (typeof(oFrm[sName].length) == 'number'){
      for (var i=oFrm[sName].length-1;i>=0;i--){
        if (typeof(oFrm[sName][i]) != 'undefined'){
          if (oFrm[sName][i].parentNode){
            oFrm[sName][i].parentNode.removeChild(oFrm[sName][i]);
          }
          try{
            delete oFrm[sName][i];
          }catch(e){}
          if (typeof(oFrm[sName]) != 'undefined' && typeof(oFrm[sName][i]) != 'undefined'){
            oFrm[sName][i] = undefined;
          }
        }
      }
    }
    if (typeof(oFrm[sName]) != 'undefined'){
      if (oFrm[sName].parentNode){
        oFrm[sName].parentNode.removeChild(oFrm[sName]);
      }
      try{
        delete oFrm[sName];
      }catch(e){}
      if (typeof(oFrm[sName]) != 'undefined'){
        oFrm[sName] = undefined;
      }
    }
  }
}
jsHelper.oSimPasswordTimeout = null;
jsHelper.oSimPasswordTimeoutXCmpl = null;
jsHelper.simPassword = function(sFrm,oInput){
  //oInput:: lang definiert Namen des Ziel-Hidden-Fields
  function doIt(){
    function xCmpl(){
      oInput.value = oInput.value.replace(/[^×]/g,'×');
    }
    var oFrm  = document[sFrm];
    var sName = oInput.lang;
    var oPwd  = oFrm[sName];
    var sPwd  = oPwd.value;
    var sNew  = oInput.value;
    var iFirstChar = sNew.search(/[^×]/);
    var iPwdSub = (iFirstChar >= 0) ? iFirstChar : sNew.length;
    var sActPwd = sPwd.substr(0,iPwdSub) + sNew.substr(iPwdSub);
    oPwd.value = sActPwd;
    if (sNew.length >= sPwd.length){
      var sSimPwd = sActPwd.replace(/[^×]/g,'×').substr(0,sActPwd.length-1)+sActPwd.substr(sActPwd.length-1);
      oInput.value = sSimPwd;
    }
    jsHelper.oSimPasswordTimeout = null;
    if (jsHelper.oSimPasswordTimeoutXCmpl){
      window.clearTimeout(jsHelper.oSimPasswordTimeoutXCmpl);
    }
    jsHelper.oSimPasswordTimeoutXCmpl = window.setTimeout(xCmpl,200);
  }
  if (!jsHelper.oSimPasswordTimeout){
    if (jsHelper.oSimPasswordTimeoutXCmpl){
      window.clearTimeout(jsHelper.oSimPasswordTimeoutXCmpl);
    }
    jsHelper.oSimPasswordTimeout = window.setTimeout(doIt,200);
  }
}

if (typeof(jsHelper.autoCmpl) == 'undefined'){
  jsHelper.autoCmpl = new Object();
}
jsHelper.autoCmpl.init = function(sName){
  if (typeof(this[sName]) == 'undefined'){
    this[sName] = new Object();
  }
  if (typeof(this[sName].bInit) != 'undefined' && this[sName].bInit){
    return;
  }
  if (typeof(this[sName].sFctOnEnter) == 'undefined'){
    this[sName].sFctOnEnter = '';
  }
  this[sName].asResKey = new Array();
  this[sName].asResVal = new Array();
  this[sName].bInit = 1;
  this[sName].bOpen = 0;
  this[sName].bPrecheck = 1;
  this[sName].iSelKey = -1;
  this[sName].sScrollCache = '';
  this[sName].sEditCache = '';
  this[sName].oTgt = document.getElementsByName(sName)[0];
  var oTmp = this[sName].oTgt.nextSibling;
  while (oTmp.nodeType != 1 || oTmp.nodeName != 'DIV'){
    oTmp = oTmp.nextSibling;
  }
  this[sName].oSrc    = oTmp.getElementsByTagName('input')[0];
  this[sName].oFrm    = this[sName].oSrc.parentNode;
  while (this[sName].oFrm && (!this[sName].oFrm.tagName || this[sName].oFrm.tagName != 'FORM')){
    this[sName].oFrm = this[sName].oFrm.parentNode;
  }
  this[sName].sOnsubmit = null;
  this[sName].oCntr   = oTmp.getElementsByTagName('div')[0];
  this[sName].oSrcTbl = oTmp.getElementsByTagName('table')[0];
  if (this[sName].oCntr.style.display == 'none'){
    this[sName].oCntr.style.display = '';
  }
  if (this[sName].oCntr.clientWidth != this[sName].oSrc.clientWidth){
    this[sName].oCntr.style.width = this[sName].oSrc.clientWidth.toString() + 'px';
  }
  var iTop = jsHelper.getRealStyle(this[sName].oSrc.parentNode,'padding-top',1) + jsHelper.getRealStyle(this[sName].oSrc,'margin-top',1) + this[sName].oSrc.offsetHeight;
  if (iTop != parseInt(this[sName].oCntr.style.top)){
    this[sName].oCntr.style.top = iTop.toString() + 'px';
  }
}
jsHelper.autoCmpl.showCntr = function(sName,bShow){
  if (this[sName].bOpen != bShow){
    this[sName].oCntr.style.display = (bShow) ? '' : 'none';
    this[sName].bOpen = bShow;
  }
}
jsHelper.autoCmpl.updateCntr = function(sName){
  var oTbl = this[sName].oSrcTbl.cloneNode(true);
  var oTBdy = oTbl.getElementsByTagName('tbody')[0];
  oTbl.style.display = '';
  for (var i=0; i < this[sName].asResVal.length; i++){
    var oTr = oTbl.rows[0].cloneNode(true);
    oTBdy.appendChild(oTr);
    oTr.cells[0].innerHTML = this[sName].asResVal[i];
  }
  if (!this[sName].oCntr.childNodes || this[sName].oCntr.childNodes.length == 0){
    this[sName].oCntr.appendChild(oTbl);
  }else{
    var oTmp = this[sName].oCntr.firstChild;
    this[sName].oCntr.replaceChild(oTbl,oTmp);
    delete oTmp;
  }
  this.showCntr(sName,1);
  this.scrollReset(sName,0);
}
jsHelper.autoCmpl.scrollReset = function(sName,bResetSrc){
  if (this[sName].iSelKey >= 0){
    var oTr;
    if (oTr = this[sName].oCntr.getElementsByTagName('table')[0].rows[this[sName].iSelKey+1]){
      for (var i=0; i<oTr.cells.length; i++){
        jsHelper.setClass(oTr.cells[i],0,'data_selected');
      }
    }
    this[sName].iSelKey = -1;
  }
  if (bResetSrc){
    this[sName].oSrc.value = this[sName].sScrollCache;
  }
  this[sName].sScrollCache = '';
}
jsHelper.autoCmpl.scrollTo = function(oSrc,sName){
  var iPos = oSrc.rowIndex - 1;
  if (this[sName].iSelKey < 0){
    this[sName].iSelKey = 0;
  }
  var iAmnt = (this[sName].iSelKey > iPos) ? -(this[sName].iSelKey - iPos) : iPos - this[sName].iSelKey;
  this.scroll(iAmnt,sName);
}
jsHelper.autoCmpl.scroll = function(iAmnt,sName){
  if (!this[sName].bOpen){
    this.showCntr(sName,1);
    //this.scrollReset(sName,0);
  }
  var iNewKey = this[sName].iSelKey + iAmnt;
  if (iNewKey < -1){
    iNewKey = this[sName].asResKey.length - 1;
  }
  if (iNewKey >= 0 && iNewKey < this[sName].asResKey.length){
    var oTr = this[sName].oCntr.getElementsByTagName('table')[0].rows[this[sName].iSelKey+1];
    for (var j=0; j<oTr.cells.length; j++){
      jsHelper.setClass(oTr.cells[j],0,'data_selected');
    }
    oTr = this[sName].oCntr.getElementsByTagName('table')[0].rows[iNewKey+1];
    for (var j=0; j<oTr.cells.length; j++){
      jsHelper.setClass(oTr.cells[j],1,'data_selected');
    }
    if (this[sName].sScrollCache.length == 0){
      this[sName].sScrollCache = this[sName].oSrc.value;
    }
    this[sName].oSrc.value = this[sName].asResVal[iNewKey];
    this[sName].sEditCache = this[sName].asResVal[iNewKey];
    this[sName].iSelKey = iNewKey;
  }else if (this[sName].iSelKey >= 0){
    this.scrollReset(sName,1);
  }
}
jsHelper.autoCmpl.eventHdl = function(oEvent,sName){
  if (!oEvent){
    var oEvent = window.event;
  }
  if (oEvent.ctrlKey || oEvent.altKey){
    return true;
  }
  if (oEvent.type == 'mouseover'){
    this.scrollTo(jsHelper.getTr(oEvent.target || oEvent.srcElement),sName);
  }else{
    if (oEvent.type == 'keydown'){
      this[sName].iKeyCode = (oEvent.which) ? oEvent.which : oEvent.keyCode;
      this[sName].iCharCode = null;
    }
    if (oEvent.type == 'keypress'){
      this[sName].iCharCode = (typeof(oEvent.charCode) == 'undefined') ? oEvent.keyCode : oEvent.charCode;
    }
    var iKeyCode  = this[sName].iKeyCode;
    var iCharCode = this[sName].iCharCode;
    if (typeof(this[sName].bInit) == 'undefined') {
      this.init(sName);
    }
    if (this[sName].asResKey.length > 0 && oEvent.type == 'keydown' && (iKeyCode == 38 || iKeyCode == 40)){
      this.scroll(((iKeyCode == 38) ? -1 : 1),sName);
    }else if (oEvent.type == 'keyup' && iKeyCode == 27){
      this.showCntr(sName,0);
      this.scrollReset(sName,1);
    }else if ((oEvent.type == 'keydown' || oEvent.type == 'keypress') && iKeyCode == 13){
      if (this[sName].oFrm){
        if (!this[sName].sOnsubmit && typeof(this[sName].oFrm.onsubmit) != 'undefined'){
          this[sName].sOnsubmit = this[sName].oFrm.onsubmit.toString().replace(/^[^{]+{|\r?\n|}$/g,'');
        }
        if (this[sName].sOnsubmit){
          jsHelper.setEvent(this[sName].oFrm,'onsubmit','return false;');
        }
      }
    }else if (oEvent.type == 'keyup' && iKeyCode == 13){
      if (this[sName].sOnsubmit){
        jsHelper.setEvent(this[sName].oFrm,'onsubmit',this[sName].sOnsubmit);
      }
      if (this[sName].bOpen){
        this.autoInput(sName);
        this.showCntr(sName,0);
        //this.scrollReset(sName,0);
      }else if (this[sName].sFctOnEnter.length > 0){
        window.setTimeout(this[sName].sFctOnEnter,0);
      }
    }else if (   oEvent.type == 'keypress'
              && (   (iKeyCode > 47 && iKeyCode < 91)
                  || (iKeyCode > 95 && iKeyCode < 112)
                  || iKeyCode > 185)){
      this.checkInput(sName, iCharCode);
      if (!this[sName].bPrecheck){
        this[sName].bPrecheck = 1;
        if (oEvent.preventDefault){
          oEvent.preventDefault();
        }
        if (oEvent.returnValue){
          oEvent.returnValue = false;
        }
        return false;
      }
    }else if (oEvent.type == 'keyup' && !(iKeyCode == 38 || iKeyCode == 40 || iKeyCode == 27)){
      this.checkInput(sName);
    }
  }
  if (oEvent.type == 'keyup' || oEvent.type == 'mouseover'){
    var sKey = '';
    for (var i=0; i<this[sName].asResVal.length; i++){
      if (this[sName].oSrc.value == this[sName].asResVal[i]){
        sKey = this[sName].asResKey[i];
      }
    }
    this[sName].oTgt.value = sKey;
  }
}
jsHelper.autoCmpl.autoInput = function(sName){
  if (this[sName].oTgt.value.length == 0 && this[sName].oSrc.value.length > 0){
    if (this[sName].asResVal.length > 0){
      var iKey = (this[sName].iSelKey >= 0) ? this[sName].iSelKey : 0;
      this[sName].oTgt.value = this[sName].asResKey[iKey];
      this[sName].oSrc.value = this[sName].asResVal[iKey];
    }else{
      this[sName].oSrc.value = '';
    }
  }
}
jsHelper.autoCmpl.checkInput = function(sName,iCharCode){
  if (typeof(iCharCode) == 'undefined'){
    iCharCode = -1;
  }
  this[sName].asResKey   = new Array();
  this[sName].asResVal   = new Array();
  if (iCharCode < 0){
    var sNewVal = this[sName].oSrc.value;
  }else if (iCharCode == 0){
    return;
  }else{
    if (this[sName].oSrc.createTextRange) {
      var oRng = document.selection.createRange().duplicate();
      oRng.moveEnd('character', this[sName].oSrc.value.length)
      if (oRng.text == ''){
        var iStart = this[sName].oSrc.value.length;
      }else{
        var iStart = this[sName].oSrc.value.lastIndexOf(oRng.text);
      }
      var oRng = document.selection.createRange().duplicate();
      oRng.moveStart('character',-this[sName].oSrc.value.length);
      var iEnd = oRng.text.length;
    }else{
      var iStart = this[sName].oSrc.selectionStart;
      var iEnd   = this[sName].oSrc.selectionEnd;
    }
    var sNewVal = this[sName].oSrc.value.substr(0,iStart) + String.fromCharCode(iCharCode) + this[sName].oSrc.value.substr(iEnd);
    if (sNewVal == this[sName].oSrc.value){
      return;
    }
  }
  var i = 0;
  for (sKey in this[sName].hData){
    if (this[sName].hData[sKey].indexOf(sNewVal) >= 0){
      this[sName].asResKey.push(sKey);
      this[sName].asResVal.push(this[sName].hData[sKey]);
      i++;
      if (i==10){
        break;
      }
    }
  }
  if (iCharCode >= 0 && i==0){
    this[sName].bPrecheck = 0;
    return;
  }
  if (i==0){
    if (this[sName].oSrc.value != this[sName].sEditCache){
      this[sName].oSrc.value = this[sName].sEditCache;
      this.checkInput(sName);
    }
  }else{
    this[sName].sEditCache = sNewVal;
    this.updateCntr(sName);
  }
}
jsHelper.getBodyScrollTop = function(){
  return (document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
}
jsHelper.getBodyScrollLeft = function(){
  return (document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft;
}
jsHelper.scrollTo = function(oCntr,oNode){
  if (!oNode){
    oCntr.scrollTop = 0;
  }else{
    var oPrt = oNode.offsetParent;
    var iScrollTop = oNode.offsetTop;
    while (oPrt && oPrt != oCntr){
      iScrollTop += oPrt.offsetTop;
      oPrt = oPrt.offsetParent;
    }
    oCntr.scrollTop = iScrollTop;
  }
}
jsHelper.getDateByString = function(sDate){
  var xRet = 0;
  var aDate;
  if (aDate = jsHelper.getDateHash(sDate)){
    xRet = new Date(aDate['year'],aDate['month'],aDate['day']);
  }
  return xRet;
}
jsHelper.getDateHash = function(sDate){
  //ready for use in JS-Date-Object, month goes 0-11
  var xRet = 0;
  var aDate;
  if (aDate = sDate.match(/^([0-9]+)-([0-9]+)-([0-9]+)/)){
    xRet = {
      'year':  parseInt(aDate[1],10),
      'month': parseInt(aDate[2],10)-1,
      'day':   parseInt(aDate[3],10)
    }
  }
  return xRet;
}
jsHelper.getDateDiff = function(oDate1,oDate2,sUnit){
  var hUnits = {
    'days':   86400000,               //1000*60*60*24,
    'weeks':  604800000,              //1000*60*60*24*7,
    'months': 2592000000              //1000*60*60*24*30
  };
  if (typeof(hUnits[sUnit]) == 'undefined'){
    return 0;
  }else{
    return Math.round((oDate1.getTime()-oDate2.getTime())/(hUnits[sUnit]));
  }
}
jsHelper.cloneDate = function(oDate){
  return (new Date(oDate.getFullYear(),oDate.getMonth(),oDate.getDate()));
}
jsHelper.getWeekends = function(oStartDate,oEndDate){
  var aoWeekends = [];
  var oStart = jsHelper.cloneDate(oStartDate);
  while(oEndDate >= oStart){
    if (oStart.getDay() == 0 || oStart.getDay() == 6){
      aoWeekends.push(oStart.getFullYear()+'-'+(parseInt(oStart.getMonth())+1)+'-'+oStart.getDate());
    }
    oStart.setDate(oStart.getDate()+1);
  }
  return aoWeekends;
}
jsHelper.getTmplRow = function(oTbl,sKey){
  var aoRet = $('tr.selTpl_'+sKey,oTbl.tHead);
  return (aoRet.length) ? aoRet[0] : null;
}
jsHelper.sort = function(ahData,sFld,bNumeric,bDescend){
  function numericSort(a,b){
    return parseFloat(a)-parseFloat(b);
  }
  var sTyp = (typeof(bNumeric) == 'undefined') ? 'str' : ((bNumeric) ? 'num' : 'str');
  var sOrder = (typeof(bDescend) == 'undefined') ? 'asc' : ((bDescend) ? 'desc' : 'asc');
  var ahRet = [];
  var aTmp = [];
  for (var i=0; i<ahData.length; i++){
    aTmp[i] = [ahData[i][sFld],i];
  }
  if (sTyp == 'str'){
    aTmp.sort()
  }else{
    aTmp.sort(numericSort);
  }
  if (sOrder == 'asc'){
    for(var i=0; i<aTmp.length; i++){
      ahRet[i] = ahData[aTmp[i][1]];
    }
  }else{
    for(var i=aTmp.length-1; i>=0; i--){
      ahRet.push(ahData[aTmp[i][1]]);
    }
  }
  return ahRet;
}
jsHelper.serialize = function(xData){
  var _getType = function(xIn){
    var sType = typeof xIn, asMatch;
    if (sType == 'object' && !xIn){
      return 'null';
    }
    if (sType == "object"){
      if (!xIn.constructor){
        return 'object';
      }
      var sCons = xIn.constructor.toString();
      asMatch = sCons.match(/(\w+)\(/);
      if (asMatch){
        sCons = asMatch[1].toLowerCase();
      }
      var asTypes = ["boolean", "number", "string", "array"];
      for (var i in asTypes){
        if (sCons == asTypes[i]){
          sType = asTypes[i];
          break;
        }
      }
    }
    return sType;
  };
  var sType = _getType(xData);
  var sVal, sKType = '';
  switch (sType){
    case "function":
      sVal = "";
    break;
    case "boolean":
      sVal = "b:" + (xData ? "1" : "0");
    break;
    case "number":
      sVal = (Math.round(xData) == xData ? "i" : "d") + ":" + xData;
    break;
    case "string":
//      xData = this.utf8_encode(xData);
//      sVal = "s:" + encodeURIComponent(xData).replace(/%../g, 'x').length + ":\""+xData+"\"";
      sVal = "s:" + escape(xData).replace(/%[0-9A-F][0-9A-F]/g, 'x').length + ":\""+xData+"\"";
    break;
    case "array":
    case "object":
      sVal = "a";
      var i = 0;
      var sVals = '';
      var sOKey;
      var sKey;
      for (sKey in xData) {
        sKType = _getType(xData[sKey]);
        if (sKType == "function") {
          continue;
        }
        sOKey = (sKey.match(/^[0-9]+$/) ? parseInt(sKey, 10) : sKey);
        sVals += this.serialize(sOKey)+jsHelper.serialize(xData[sKey]);
        i++;
      }
      sVal += ":"+i+":{" + sVals + "}";
    break;
    case "undefined": // Fall-through
    default: // if the JS object has a property which contains a null value, the string cannot be unserialized by PHP
      sVal = "N";
    break;
  }
  if (sType != "object" && sType != "array") {
    sVal += ";";
  }
  return sVal;
}
jsHelper.forceRedraw = function(oNode){
  $('*').each(function(){
    this.className = this.className;
  });
  oNode.className = oNode.className;
  return oNode;
}
-->
