//////////Anfang: Anstatt document.onload=fktneuAufbau muss diese fkt////////////////
//////////verwendet werden, weil das Menue von Sitextrem auch ein onload verwendet////////////////

if (!document.loadHandlers)
{
	document.loadHandlers=new Array();
	document.loadHandlers[0]='fktneuAufbau';
	document.lastLoadHandler=0;
}
else
{
	document.lastLoadHandler++;
	document.loadHandlers[document.lastLoadHandler]='fktneuAufbau';
}

//////////ENDE: Anstatt document.onload=fktneuAufbau////////////////
//////////Anfang: Die Rahmenbreite und Rahmenhöhe des Hauptfensters festlegen////////////////

window.onresize = fktneuAufbau;

function fktneuAufbau()
{ Hoehe = fktFensterhoehe();
  if (Hoehe < 400)
  { Hoehe = 400;}
  aktHoehe = document.IMGV1.height;
  if(Hoehe != aktHoehe)
  { document.IMGV1.height = Hoehe
  }
}

function fktFensterhoehe()
{ if (window.outerHeight)
  {
    varValue = (window.innerHeight - 53)
    return varValue;
  }
  else if (document.all && document.all.tdContent.offsetHeight && document.all.HTMLBody.offsetHeight)
  {
    varValue = (document.all.HTMLBody.offsetHeight - 53)
    varValue2 = (document.all.tdContent.offsetHeight)
    if (varValue2 > varValue)
    { varValue = varValue2;}
    return varValue
  }
  else return "400";
}

//////////ENDE: Die Rahmenbreite und Rahmenhöhe des Hauptfensters festlegen////////////////
/////////START: Links to the current site or to another site in any window//////////////

function fktRedirect(JSType,JSTarget,JSURL,JSWindowType,JSWindowName)
  {
  switch (JSType)
    {
    case "ThisSite":
      JSURL = window.location.pathname + JSURL;
      switch (JSTarget)
        {
        case "ThisWindow":
          window.location.href = JSURL
          break;
        default:
          if (JSWindowType == '')
            {
            var features = "toolbar=yes,scrollbars=yes,menubar=yes,location=yes,directories=yes,status=yes,resizable=yes"
            }         
          else
            {
            var features = JSWindowType;
            }
          
          if (JSWindowName == 'random')
          	{
          	JSTime = new Date();
          	JSTime = JSTime.getTime();
          	JSWindowName = JSTime
          	}

          mywin = window.open(JSURL, 'Win_' + JSWindowName, features);
          mywin.focus();
          break;
        }
      break;
    case "OtherSite":
      switch (JSTarget)
        {
        case "ThisWindow":
          window.location.href = JSURL
          break;
        default:
          if (JSWindowType == '')
            {
            var features = "toolbar=yes,scrollbars=yes,menubar=yes,location=yes,directories=yes,status=yes,resizable=yes"
            }         
          else
            {
            var features = JSWindowType;
            }
          
          if (JSWindowName == 'random')
          	{
          	JSTime = new Date();
          	JSTime = JSTime.getTime();
          	JSWindowName = 'Win_' + JSTime
          	}

          mywin = window.open(JSURL, 'Win_' + JSWindowName, features);
          mywin.focus();
          break;
        }
      break;
      
    default:
      break;
    }
  }
/////////END: Links to the current site or to another site in any window//////////////
/////////START: Links to the current site or to any other site; same window//////////////

function fktSubmit(JSType,JSFormName,JSURL,JSUserConfirmation)
  {
  if(JSUserConfirmation != '')
    {
    var JSSicher = window.confirm(unescape("Wenn Sie Informationen auf dieser Seite eingetragen haben und diese Speichern wollen%2C machen Sie dies bitte mit dem daf%FCr vorgesehenen %27Button%27.\n\nDies ist eine Standardabfrage%2C die erforderlich ist weil das System nicht automatisch feststellen kann ob Sie die eventuell eingegebenen Informationen speichern wollen. Klicken Sie auf OK%2C um fortzufahren. Klicken Sie auf Abbrechen%2C um abzubrechen und die Informationen anschlie%DFend h%E4ndisch zu speichern."));
    }
  if(JSSicher || JSUserConfirmation == '')
    {
    switch (JSType)
      {
      case "ThisSite":
        document.forms[JSFormName].action = window.location.pathname + JSURL;
        document.forms[JSFormName].submit();
        break;
      case "OtherSite":
        document.forms[JSFormName].action = "http://" + window.location.hostname + JSURL;
        document.forms[JSFormName].submit();
        break;
      }
    }
  }
/////////END: Links to the current site or to any other site; same window//////////////
//////////START: This function returns the Standard-DateTimeString "YYYYMMDDHHMMSS"/////////////

function fktGetDateTimeStr()
  {
  var JSDateTimeStr;
  d = new Date();

  JSDateTimeStr = "" + d.getFullYear() + fktFixNumLen((d.getMonth()+1),2) + fktFixNumLen(d.getDate(),2);
  JSDateTimeStr = "" + JSDateTimeStr + fktFixNumLen(d.getHours(),2) + fktFixNumLen(d.getMinutes(),2);
  JSDateTimeStr = "" + JSDateTimeStr + fktFixNumLen(d.getSeconds(),2);
  return JSDateTimeStr;
  }

//////////END: This function returns the Standard-DateTimeString "YYYYMMDDHHMMSS"//////////////
//////////START: This function writes back a number as a string with leading zero's////////////

function fktFixNumLen(JSNum, JSLen)
  {
  var JSZeroString = '';
  var StrNum = '' + JSNum
  var JSLengthDifference = (JSLen - StrNum.length);

  if(JSLengthDifference > 0)
    {
    for(i=0; i<JSLengthDifference; i++)
      {
      JSZeroString = JSZeroString + '0';
      }
    return (JSZeroString + StrNum);
    }
  else
    {
    if(JSLengthDifference == 0)
      {
      return StrNum;
      }
    else
      {
      return '';
      }
    }
  }

//////////END: This function writes back a number as a string with leading zero's/////////////
//////////START: Here we define the trim functions /////////////

function ltrim(str)
  { 
  while (str.charAt(0)==' ')
    {
    str=str.substring(1);
    } 
  return str; 
  } 
  
function rtrim(str)
  { 
  while (str.charAt(str.length-1)==' ')
    {
    str=str.substring(0,str.length-1);
    } 
    return str; 
  } 

//////////END: Here we define the trim functions /////////////