<!-- transflowOnline DHTML-Extensions Version, 2.1.4, 9.1.2002 -->
<!-- getestet mit IE6, Netscape6.2, Opera5.12 -->
<!--Admin users -->

  function FAR_statis(button){
    var i1=0;
    var loc;
    i1 = 5;
    loc =  "sdgStatusHistory.jsp?";
    var i2=button.name.length;
    var ind = button.name.substring(i1,i2);
    var sdgName = "stati.sdg_sdgid_"+ind;
    var sdgField = document.getElementById(sdgName);
    var loc1 = loc +"SDGID="+escape(sdgField.value);
    win1 =
    window.open(loc1, "History", "width=750,height=500,resizable=yes,screenX=0,screenY=0");
    win1.focus();

  }

  function FAR_ladnr_onselect(){
     var stateField = document.getElementById("STATE__");
     stateField.value = 1;
     var x = document.forms[0];
     x.submit();

  }

  function ADM_setref(val){

      var loc = "sysAdminInetadr.jsp?ID="+escape(val.value)+"&cmd=1&source="+escape(val.name);
      document.forms[0].submit();
      window.location.href = loc;


  }
  function ADM_call(command,adrFieldId){
    var adrField = document.getElementById(adrFieldId);
    var adrFieldVal = adrField.value;
    //var loc = document.forms[0].action+"&cmd="+command+"&ID="+adrFieldVal;
    document.getElementById("cmd").value = command;
    document.getElementById("ID").value = adrFieldVal;
    document.forms[0].submit();
    //window.location.href = loc;
  }

  <!--ENDE Admin Users-->

  <!--Konfigurator-->

  var prevElem = null;	// CfgTree: save previous selected element

  // Konfigurator: bei onLoad von cfgNewProp.jsp ausfuehren
  function CfgNewProp_onLoad() {
      document.getElementById('propID').focus();
      //document.getElementById('propID').select();
  }


  // OnClick-Action fuer Checkbox 'Custom-Property'
  function CfgNewProp_chxCustProp(val, profileIDField, profileNameField) {
      var profIDVal = document.getElementById(profileIDField).value;
      var profNameVal = document.getElementById(profileNameField).value;
      var loc = "cfgNewProp.jsp?profileID="+escape(profIDVal)+"&profileName="+escape(profNameVal);
      if (val.checked) {  // Parameter fuer Custom-Property
      	loc = loc + "&custProp=1";
      } else {	// Standard-Property
      	loc = loc + "&custProp=0";
      }
      //alert("Location: " + loc);
      document.forms[0].submit();
      window.location.href = loc;
  }
 
  // OnChange-Action fuer Combobox PropertyID
  function CfgNewProp_propSelected(val, profileIDField, profileNameField) {
      // profileID, profileName
      var profIDVal = document.getElementById(profileIDField).value;
      var profNameVal = document.getElementById(profileNameField).value;      
      var loc = "cfgNewProp.jsp?ID="+escape(val.value)+"&source="+escape(val.name)+"&profileID="+escape(profIDVal)+"&profileName="+escape(profNameVal);      
      document.forms[0].submit();
      window.location.href = loc;
  }

  function CfgTree_call(command,btnCtrlId){
    var btnCtrl = document.getElementById(btnCtrlId);
    var btnCtrlName = btnCtrl.name;
    document.getElementById("cmd").value = command;
    document.getElementById("btn").value = escape(btnCtrlName);
    document.forms[0].submit();
    //window.location.href = loc;
  }  

  function CfgTree_itemSelected(elem) {
    if (prevElem != null) {
	  // standard font-weight
	  prevElem.className = 'tfstdtext';
	}
	// font-weight bold
	elem.className = 'tfboldtext';
	// save last element
	prevElem = elem;
  }
  
  
  <!-- Funktion analog zu TFRowHeader -->
function CfgPropEditor_toggleDeleteMark(image,flagID) {
	var flag = document.getElementById(flagID);
	if (flag.value!=null && flag.value=='LOADED') {
		image.src='images/cancel_on.gif';
		flag.value='DEL';
	} else {
		image.src='images/cancel_off.gif';
		flag.value='LOADED';
	}
}

  
  <!--ENDE Configurator-->
  
  <!--Artikel Auswahl-->

var artAuswahlSettings='height=550, width=650, scrollbars=1, toolbar=0,status=0,menubar=0,resizable=1';
var _artAuswahl=null;

var _combofield=null;
var _artnrfield=null;
var _bezfield=null;
var _grup1field=null;
var _grup2field=null;
var _mengefield=null;

function TFDouble_ComputeSumm(changedFieldName,tableName,numbRowsFieldId,sumFieldId){

    var numbRowsField = document.getElementById(numbRowsFieldId);

    var numbRows = numbRowsField.value;
    var fieldId = "";
    var sum = 0;
    var val = 0;
    for(i = 0; i < numbRows; i++){
       fieldId = changedFieldName+"_"+i;
       var fld = document.getElementById(fieldId);
       val = parseFloat(fld.value);
       if (isNaN(val)){
          val = 0;
       }
       sum += val;
    }
    var sumField = document.getElementById(sumFieldId);
    sumField.value = sum;

}



function TFDouble_ComputeSumm_Validate(thisObj,scale,precision,
                            changedFieldName,tableName,numbRowsFieldId,sumFieldId){
    TFDouble_validate(thisObj,scale,precision);
    TFDouble_ComputeSumm(changedFieldName,tableName,numbRowsFieldId,sumFieldId);

}

function TFChildTable_extend(tableFieldId){

  tableField = document.getElementById(tableFieldId);
  tableField.value="Y";
  var x = document.forms[0];
  x.submit();

}

function ArtAuswahlWebBean_pick(artnr,bez,grup1,grup2) {
  if (window.opener && !window.opener.closed)
    window.opener.TFLookupArt_setValue(artnr,bez,grup1,grup2);
  window.close();

}

function ArtAuswahlWebBeanCmb_pick(artnr,bez,grup1,grup2,keys,values) {
  if (window.opener && !window.opener.closed)
    window.opener.TFLookupArt_setValue(artnr,bez,grup1,grup2,keys,values);

  window.close();

}

function TFLookupArt_setValue(artnr,bez,grup1,grup2,keys,values) {
  if (_artnrfield!=null)
    _artnrfield.value=artnr;
  if (_bezfield!=null)
    _bezfield.value=bez;
  if (_grup1field != null&&grup1!="null")
    _grup1field.value = grup1;
  if (_grup2field != null&&grup2!="null")
    _grup2field.value = grup2;
  reRenderCombo(keys,values);
  if (_mengefield != null)
     _mengefield.value=1;
  _mengefield.focus();
  _mengefield.select();

}

function reRenderCombo(keys,values){
  keys1 = keys.substring(0,keys.length-1);
  values1 = values.substring(0,values.length-1);

  KeysArray = keys1.split(",");
  ValuesArray = values1.split(",");
  len = _combofield.options.length;
  for (i=0;i<len;i++){
    _combofield.options[i]=null;
  }
  lenNeu = KeysArray.length;

  for (i1=0;i1<lenNeu;i1++){
    newOption = new Option();
    newOption.text = ValuesArray[i1];
    newOption.value=KeysArray[i1];
    _combofield.options[i1] = newOption;
  }
}


function TFLookupArt_validateAutoTake(artnrFieldId,bezFieldId,comboFieldId,
                                      mengeFieldId,grup1FieldId,grup2FieldId) {
    _artnrfield=document.getElementById(artnrFieldId);
    _bezfield=document.getElementById(bezFieldId);
    _combofield=document.getElementById(comboFieldId);
    _grup1field=document.getElementById(grup1FieldId);
    _grup2field=document.getElementById(grup2FieldId);
    _mengefield=document.getElementById(mengeFieldId);
    if (_artnrfield.value) {
         TFLookupArt_openAuswahl(artnrFieldId,bezFieldId,comboFieldId,
                                 mengeFieldId,
                                 grup1FieldId,
                                 grup2FieldId,1);
    } else {
		_bezfield.value=_artnrfield.value;
    }
}



function TFLookupArt_openAuswahl(artnrFieldId,bezFieldId,comboFieldId,mengeFieldId,
                                 grup1FieldId,
                                 grup2FieldId,autotake) {
    _artnrfield=document.getElementById(artnrFieldId);
    _bezfield=document.getElementById(bezFieldId);
    _combofield=document.getElementById(comboFieldId);
    _grup1field=document.getElementById(grup1FieldId);
    _grup2field=document.getElementById(grup2FieldId);
    _mengefield=document.getElementById(mengeFieldId);
    suche=escape(_artnrfield.value);
	internal_close(_artAuswahl);
    _artAuswahl=window.open('artAuswahl.jsp?suchbegriff='+suche+'&autotake='+autotake,'artAuswahl',artAuswahlSettings);
    if (window.focus) {
    	_artAuswahl.focus();
    }
}

<!--END Artikel -->


<!-- Status Auswahl -->

var _pocidfield=null;
var _statiPopup=null;

function TFLookupStatus_openAuswahl(pocidFieldId,autotake) {
    _pocidfield=document.getElementById(pocidFieldId);
    suche=escape(_pocidfield.value);
    internal_close(_statiPopup);
    _statiPopup=window.open('statiAuswahl.jsp?suchbegriff='+suche+'&autotake='+autotake,'statiAuswahl',statiAuswahlSettings);
    if (window.focus) {
    	_statiPopup.focus();
    }
}

function TFLookupStatus_validateAutoTake(pocidFieldId) {
    _pocidfield=document.getElementById(pocidFieldId);
    if (_pocidfield.value) {
        TFLookupStatus_openAuswahl(pocidFieldId,1);
    }
}

function TFLookupStatus_setValue(pocid) {
  if (_pocidfield!=null)
    _pocidfield.value=pocid;
  _pocidfield.focus();
  _pocidfield.select();
}


function StatiAuswahlWebBean_pick(pocid) {
  if (window.opener && !window.opener.closed)
    window.opener.TFLookupStatus_setValue(pocid);
  window.close();
}

<!--END Status -->


<!-- allgemeine Einstellungen -->

var adrEditSettings='toolbar=0,status=0,menubar=0,height=400,width=650,resizable=1';
var adrAuswahlSettings='height=450, width=650, scrollbars=1, toolbar=0,status=0,menubar=0,resizable=1';
var sysPopupTextSettings='height=400, width=610, toolbar=0,status=0,menubar=0,resizable=1';
var statiAuswahlSettings='height=500, width=550, scrollbars=1, toolbar=0,status=0,menubar=0,resizable=1';

<!-- interne Routinen -->

function internal_close(windowobj) {
	if (windowobj!=null && !windowobj.closed) windowobj.close();
}



<!-- methoden fuer TFLookupAdr -->

var _codefield=null;
var _textfield=null;
var _popuptextfield=null;
var _adrAuswahl=null;
var _adrEdit=null;
var _sysPopupText=null;

function TFLookupAdr_setValue(adrid,text) {
  if (_codefield!=null)
    _codefield.value=adrid;
  if (_textfield!=null)
    _textfield.value=text;
}

function TFLookupAdr_openAuswahl(codeFieldId,textFieldId,autotake) {
    _codefield=document.getElementById(codeFieldId);
    _textfield=document.getElementById(textFieldId);
    suche=escape(_codefield.value);
	internal_close(_adrAuswahl);
    _adrAuswahl=window.open('adrAuswahl.jsp?suchbegriff='+suche+'&autotake='+autotake,'adrAuswahl',adrAuswahlSettings);
    if (window.focus) {
    	_adrAuswahl.focus();
    }
}


function TFLookupAdr_openTextAdr(codeFieldId,textFieldId) {
    _codefield=document.getElementById(codeFieldId);
    _textfield=document.getElementById(textFieldId);
    cmd="cmd=1";
    if (_codefield.value)
    	cmd="cmd=2&ID="+escape(_codefield.value);
    internal_close(_adrEdit);
    _adrEdit=window.open('adrEdit.jsp?'+cmd+'&textadr=1','adrEdit',adrEditSettings);
}

function TFLookupAdr_validate(codeFieldId,textFieldId) {
    codefield=document.getElementById(codeFieldId);
    textfield=document.getElementById(textFieldId);
	if (!codefield.value) {
		textfield.value=codefield.value;
		return;
	}
	TFLong_validate(codefield); 	// frueher: TFInteger_validate(codefield);
}

function TFLookupAdr_validateAutoTake(codeFieldId,textFieldId) {
    codefield=document.getElementById(codeFieldId);
    textfield=document.getElementById(textFieldId);
	if (codefield.value) {
		TFLookupAdr_openAuswahl(codeFieldId,textFieldId,1);
	} else {
		textfield.value=codefield.value;
	}
}



<!-- methoden fuer AdrAuswahlWebBean -->


function AdrAuswahlWebBean_pick(adrid,text) {
  if (window.opener && !window.opener.closed)
    window.opener.TFLookupAdr_setValue(adrid,text);
  window.close();
}

function AdrAuswahlWebBean_openNew() {
   internal_close(_adrEdit);
   _adrEdit=window.open('adrEdit.jsp?cmd=1','adrNew',adrEditSettings);
}

function AdrAuswahlWebBean_openEdit(adrid) {
   internal_close(_adrEdit);
   _adrEdit=window.open('adrEdit.jsp?cmd=2&ID='+escape(adrid),'adrEdit',adrEditSettings);
}



<!-- methoden fuer TFRowHeader -->

function TFRowHeader_toggleDeleteMark(image,flag) {
	if (flag.value!=null && flag.value=='LOADED') {
		image.src='images/cancel_on.gif';
		flag.value='DEL';
	} else {
		image.src='images/cancel_off.gif';
		flag.value='LOADED';
	}
}

<!-- Methoden fuer TFAbortButton -->

function TFAbortButton_Click() {
	if (window.opener)
		window.close();
}


<!-- Methoden fuer TFInteger -->

function TFInteger_validate(obj) {
	if (!obj.value) return;
	var zahl=parseInt(obj.value);
	if (isNaN(zahl)) {
		window.status='Ungueltige Zahl '+obj.value;
		obj.select();
		obj.focus();
	} else {
		window.status='';	// Statuszeile leeren
		obj.value=zahl;
	}
}


function TFInteger_validateMinMax(obj, minVal, maxVal) {
	if (!obj.value) return;
	var zahl=parseInt(obj.value);
	if (isNaN(zahl)) {
		window.status='Ungueltige Zahl '+obj.value;
		obj.select(); obj.focus();
	} else if (zahl>maxVal) {
		window.status='Zahl zu gross!';
		obj.select(); obj.focus();
	} else if (zahl<minVal) {
		window.status='Zahl zu klein!';
		obj.select(); obj.focus();
	} else {
		window.status='';	// Statuszeile leeren
		obj.value=zahl;
	}
}


<!-- Methoden fuer TFLong -->
<!-- Bemerkung: Momentan gleich wie TFInteger, -->
<!-- da JavaScript 15stellige Integer verwendet-->

function TFLong_validate(obj) {
	if (!obj.value) return;
	var zahl=parseInt(obj.value);
	if (isNaN(zahl)) {
		window.status='Ungueltige Zahl '+obj.value;
		obj.select();
		obj.focus();
	} else {
		window.status='';	// Statuszeile leeren
		obj.value=zahl;
	}
}


<!-- Methoden fuer TFDouble -->

function TFDouble_validate(obj,scale,precision) {
	if (!obj.value) return;
	zahl=parseFloat(obj.value);
	if (isNaN(zahl)) {
		window.status='Ungueltige Zahl '+obj.value;
		obj.select();
		obj.focus();
		return;
	}
  var intL = scale-precision;
  var intMax = Math.pow(10,intL);

  if (zahl > intMax){
		window.status='Ungueltige Zahl - zu gross - bis'+intMax+' zugelassen!';
		obj.select();
		obj.focus();
		return;
  }
  window.status='';	// Statuszeile leeren
  var fract = Math.round((zahl-Math.floor(zahl))*Math.pow(10,precision));
  var endVar = Math.floor(zahl)+fract/Math.pow(10,precision);
  obj.value=endVar;
}

<!-- Methoden fuer TFPopupText -->


function TFPopupText_open(textFieldId) {
    _popuptextfield=document.getElementById(textFieldId);
	internal_close(_sysPopupText);
    _sysPopupText=window.open('sysPopupText.jsp','sysPopupText','height=400, width=610');
    if (window.focus) {
    	_sysPopupText.focus();
    }
}

function TFPopupText_setText(text) {
	_popuptextfield.value=text;
}

function TFPopupText_getText() {
	return _popuptextfield.value;
}

function SysPopupTextWebBean_return(field) {
  if (window.opener && !window.opener.closed)
    window.opener.TFPopupText_setText(field.value);
  window.close();
}


<!-- Methoden fuer TFText -->

function setupper(myfield)
{
	if (myfield.inchange)
		return;
	myfield.inchange=true;
	myfield.value=myfield.value.toUpperCase();
	myfield.inchange=false;
}


<!-- Pflichtfeld-Eingabe sicherstellen -->

// Pflichtfeld definieren - einzelne Feld-ID
// Aufruf wie folgt:        <form .... onsubmit="return manatoryField('iusr_usrid')"> .... </form>
// Stellt sicher, dass Input-Feld mit id="iusr_usrid" eingegeben wurde, 
// ansonsten erscheint eine Aufforderung zur Eingabe der Pflichtfelder.    
function mandatoryField(fieldID) {
	res = true;
	obj = document.getElementById(fieldID);
	if (obj.value == '') {res = false;} // Feld ist leer
	if (res == false) {  // Validierungsfehler: Eingabe ist leer
		alert('Bitte die Pflichtfelder im Formular ausfüllen! ['+ obj.name +']');
		obj.focus();  // Element soll Fokus bekommen
		//obj.select(); // ACHTUNG: select() funktioniert nicht bei Comboboxen!
	}
	return res;
}

// Pflichtfelder definieren - Array von Feld-IDs
// Aufruf wie folgt:        <form .... onsubmit="return manatoryFields('iusr_usrid','iusr_text')"> .... </form>
// siehe manadatoryField
function mandatoryFields(fieldIDs) {
	res = true;
	for (var i=0; res && (i<fieldIDs.length); i++) {	// Kurzschluss-Auswertung: res && ...
	  res = res && mandatoryField( fieldIDs[i] );
	}
	return res;
}

