//Copyright 1997-1999 Macromedia, Inc. All rights reserved.
function MM_checkBrowser(NSvers,NSpass,NSnoPass,IEvers,IEpass,IEnoPass,OBpass,URL,altURL) {
  var newURL = '', version = parseFloat(navigator.appVersion);
  if (navigator.appName.indexOf('Netscape') != -1) {
    if (version >= NSvers) {if (NSpass>0) newURL = (NSpass==1)?URL:altURL;}
    else {if (NSnoPass>0) newURL = (NSnoPass==1)?URL:altURL;}
  } else if (navigator.appName.indexOf('Microsoft') != -1) {
    if (version >= IEvers) {if (IEpass>0) newURL = (IEpass==1)?URL:altURL;}
    else {if (IEnoPass>0) newURL = (IEnoPass==1)?URL:altURL;}
  } else if (OBpass>0) newURL = (OBpass==1)?URL:altURL;
  if (newURL) {
    window.location = unescape(newURL);
    document.MM_returnValue = false;
  }
}

//Copyright 1997-1999 Macromedia, Inc. All rights reserved.
function MM_preloadImages() {
  if (document.images) {
    var imgFiles = MM_preloadImages.arguments;
    if (document.preloadArray==null) document.preloadArray = new Array();
    var i = document.preloadArray.length;
    with (document) for (var j=0; j<imgFiles.length; j++) if (imgFiles[j].charAt(0)!="#"){
      preloadArray[i] = new Image;
      preloadArray[i++].src = imgFiles[j];
  } }
}

//Copyright 1997-1999 Macromedia, Inc. All rights reserved.
function MM_swapImgRestore() {
  if (document.MM_swapImgData != null)
    for (var i=0; i<(document.MM_swapImgData.length-1); i+=2)
      document.MM_swapImgData[i].src = document.MM_swapImgData[i+1];
}

//Copyright 1997-1999 Macromedia, Inc. All rights reserved.
function MM_swapImage() {
  var i,j=0,objStr,obj,swapArray=new Array,oldArray=document.MM_swapImgData;
  for (i=0; i < (MM_swapImage.arguments.length-2); i+=3) {
    objStr = MM_swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1];
    if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ||
        (objStr.indexOf('document.all[')   ==0 && document.all   ==null))
      objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);
    obj = eval(objStr);
    if (obj != null) {
      swapArray[j++] = obj;
      swapArray[j++] = (oldArray==null || oldArray[j-1]!=obj)?obj.src:oldArray[j];
      obj.src = MM_swapImage.arguments[i+2];
  } }
  document.MM_swapImgData = swapArray;
}

//Copyright 1999 transoniqhackers. All rights reserved.
function tshScrollL(id) {
  if(ns) {
    this.css = document.layers[id]
    this.elm = this.event = this.css
    this.x   = this.css.left
    this.y   = this.css.top
    this.w   = this.css.clip.width
    this.h   = this.css.clip.height
  }
  else if(ie) {
    this.elm = this.event = document.all[id]
    this.css = document.all[id].style
    this.x   = this.elm.offsetLeft
    this.y   = this.elm.offsetTop
    ie4      = (navigator.appVersion.indexOf('MSIE 4') > 0)
    this.w   = (ie4)? this.css.pixelWidth : this.elm.offsetWidth
    this.h   = (ie4)? this.css.pixelHeight : this.elm.offsetHeight
  }

  this.obj = id + "Object"
  eval(this.obj + "=this")
}

//Copyright 1999 transoniqhackers. All rights reserved.
function tshKeyDown(e) {
  if(window.event.keyCode == 32) {
  }
}

//Copyright 1999 transoniqhackers. All rights reserved.
function tshScrollLGetClip(obj, which) {
  if(ns) {
    if(which=="t") return obj.clip.top
    if(which=="r") return obj.clip.right
    if(which=="b") return obj.clip.bottom
    if(which=="l") return obj.clip.left
  }
  else if(ie) {
    var clipv = eval('tshScrollL'+activeLayer+'DIV.style.clip.split("rect(")[1].split(")")[0].split("px")')
    if(which=="t") return Number(clipv[0])
    if(which=="r") return Number(clipv[1])
    if(which=="b") return Number(clipv[2])
    if(which=="l") return Number(clipv[3])
  }
}

//Copyright 1999 transoniqhackers. All rights reserved.
function tshScrollLClipBy(obj, t, r, b, l) {
  if(ns) {
    obj.clip.top    = tshScrollLGetClip(obj, 't') + t
    obj.clip.right  = tshScrollLGetClip(obj, 'r') + r
    obj.clip.bottom = tshScrollLGetClip(obj, 'b') + b
    obj.clip.left   = tshScrollLGetClip(obj, 'l') + l
  }
  else if(ie) {
    obj.clip = "rect("+(this.tshScrollLGetClip(obj,'t')+t)+"px "+(this.tshScrollLGetClip(obj,'r')+r)+"px "+Number(this.tshScrollLGetClip(obj,'b')+b)+"px "+Number(this.tshScrollLGetClip(obj,'l')+l)+"px)"
  }
}

//Copyright 1999 transoniqhackers. All rights reserved.
function tshScrollLDown(num) {
  if(activeLayer && scrolling==1 && eval('tshScrollL'+(num==0)?activeLayer:num+'.UDenabled == 1')) {
    if(num && num != activeLayer) {
      var currentScroll = num
      activeLayer = currentScroll
    }
    else {
      currentScroll = activeLayer
    }

    if(eval('tshScrollL'+currentScroll+'.topPos') > 0) {
      eval('tshScrollLClipBy(tshScrollL'+currentScroll+'.css, '+ -scrollStep +', 0, '+ -scrollStep +', 0)')
      eval('tshScrollL'+currentScroll+'.y += '+scrollStep)
      eval('tshScrollL'+currentScroll+'.topPos -= '+scrollStep)
      eval('tshScrollL'+currentScroll+'.css.top = tshScrollL'+currentScroll+'.y')
      if(num) {
        setTimeout("tshScrollLDown("+num+")", threadDuration)
      }
      else {
        setTimeout("tshScrollLDown()", threadDuration)
      }
    }
    else {
      scrolling = 0
    }
  }
}

//Copyright 1999 transoniqhackers. All rights reserved.
function tshScrollLUp(num) {
  if(activeLayer && scrolling==1 && eval('tshScrollL'+(num==0)?activeLayer:num+'.UDenabled == 1')) {
    if(num && num != activeLayer) {
      var currentScroll = num
      activeLayer = currentScroll
    }
    else {
      currentScroll = activeLayer
    }

    if((eval('tshScrollL'+currentScroll+'.topPos') - 2 * scrollStep) < (eval('tshScrollL'+currentScroll+'.contentHeight') - eval('tshScrollL'+currentScroll+'.scrollHeight'))) {
      eval('tshScrollLClipBy(tshScrollL'+currentScroll+'.css, '+ scrollStep +', 0, '+ scrollStep +', 0)')
      eval('tshScrollL'+currentScroll+'.y -= '+scrollStep)
      eval('tshScrollL'+currentScroll+'.topPos += '+scrollStep)
      eval('tshScrollL'+currentScroll+'.css.top = tshScrollL'+currentScroll+'.y')
      if(num) {
        setTimeout("tshScrollLUp("+num+")", threadDuration)
      }
      else {
        setTimeout("tshScrollLUp()", threadDuration)
      }
    }
    else {
      scrolling = 0
    }
  }
}

//Copyright 1999 transoniqhackers. All rights reserved.
function tshScrollLRight(num) {
  if(activeLayer && scrolling==1 && eval('tshScrollL'+(num==0)?activeLayer:num+'.UDenabled == 1')) {
    if(num && num != activeLayer) {
      var currentScroll = num
      activeLayer = currentScroll
    }
    else {
      currentScroll = activeLayer
    }

    if((eval('tshScrollL'+currentScroll+'.topPos') - 2 * scrollStep) < (eval('tshScrollL'+currentScroll+'.contentHeight') - eval('tshScrollL'+currentScroll+'.scrollHeight'))) {
      eval('tshScrollLClipBy(tshScrollL'+currentScroll+'.css, 0, '+ scrollStep +', 0, '+ scrollStep +')')
      eval('tshScrollL'+currentScroll+'.x -= '+scrollStep)
      eval('tshScrollL'+currentScroll+'.topPos += '+scrollStep)
      eval('tshScrollL'+currentScroll+'.css.left = tshScrollL'+currentScroll+'.x')
      if(num) {
        setTimeout("tshScrollLRight("+num+")", threadDuration)
      }
      else {
        setTimeout("tshScrollLRight()", threadDuration)
      }
    }
    else {
      scrolling = 0
    }
  }
}

//Copyright 1999 transoniqhackers. All rights reserved.
function tshScrollLLeft(num) {
  if(activeLayer && scrolling==1 && eval('tshScrollL'+(num==0)?activeLayer:num+'.UDenabled == 1')) {
    if(num && num != activeLayer) {
      var currentScroll = num
      activeLayer = currentScroll
    }
    else {
      currentScroll = activeLayer
    }

    if(eval('tshScrollL'+currentScroll+'.topPos') > 0) {
      eval('tshScrollLClipBy(tshScrollL'+currentScroll+'.css, 0, '+ -scrollStep +', 0, '+ -scrollStep +')')
      eval('tshScrollL'+currentScroll+'.x += '+scrollStep)
      eval('tshScrollL'+currentScroll+'.topPos -= '+scrollStep)
      eval('tshScrollL'+currentScroll+'.css.left = tshScrollL'+currentScroll+'.x')
      if(num) {
        setTimeout("tshScrollLLeft("+num+")", threadDuration)
      }
      else {
        setTimeout("tshScrollLLeft()", threadDuration)
      }
    }
    else {
      scrolling = 0
    }
  }
}

//Copyright 1999 transoniqhackers. All rights reserved.
function tshSlideL(id) {
  if(ns) {
    this.css = document.layers[id]
    this.x   = this.css.left
    this.y   = this.css.top
  }
  else if(ie) {
    this.css = document.all[id].style
    this.x   = this.css.pixelLeft
    this.y   = this.css.pixelTop
  }

  this.endx  = 0
  this.step  = 0
  this.speed = 0

  this.obj = id + "Obj"
  eval(this.obj + "=this")

  this.moveTo  = tshLayerMoveTo
  this.slideX  = tshLayerSlideX
  this._slideX = tshLayerSlideXInternal
}

//Copyright 1999 transoniqhackers. All rights reserved.
function tshLayerMoveTo(x, y) {
  this.x        = x
  this.css.left = this.x
  this.y        = y
  this.css.top  = this.y
}

//Copyright 1999 transoniqhackers. All rights reserved.
function tshLayerSlideX(endx, step, speed) {
  this.endx = endx
  this.speed = speed
  if(endx < this.x) {
    step *= -1
  }
  this.step = step
  setTimeout(this.obj + "._slideX()", this.speed)
}

//Copyright 1999 transoniqhackers. All rights reserved.
function tshLayerSlideXInternal() {
  if(this.step < 0) {
    if(this.x + this.step <= this.endx) {
      this.moveTo(this.endx, this.y)
    }
    else {
      this.moveTo(this.x + this.step, this.y)
      setTimeout(this.obj + "._slideX()", this.speed)
    }
  }
  else {
    if(this.x + this.step >= this.endx) {
      this.moveTo(this.endx, this.y)
    }
    else {
      this.moveTo(this.x + this.step, this.y)
      setTimeout(this.obj + "._slideX()", this.speed)
    }
  }
}

//Copyright 1997-1999 Macromedia, Inc. All rights reserved.
function MM_showHideLayers() {
  var i, visStr, args, theObj;
  args = MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) {
    visStr   = args[i+2];
    if (navigator.appName == 'Netscape' && document.layers != null) {
      theObj = eval(args[i]);
      if (theObj) theObj.visibility = visStr;
    } else if (document.all != null) {
      if (visStr == 'show') visStr = 'visible';
      if (visStr == 'hide') visStr = 'hidden';
      theObj = eval(args[i+1]);
      if (theObj) theObj.style.visibility = visStr;
  } }
}

//Copyright 1997-1999 Macromedia, Inc. All rights reserved.
function MM_timelineGoto(tmLnName, fNew, numGotos) {
  var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,lastKeyFr,propNum,theObj;
  if (document.MM_Time == null) MM_initTimelines();
  tmLn = document.MM_Time[tmLnName];
  if (numGotos != null)
    if (tmLn.gotoCount == null) tmLn.gotoCount = 1;
    else if (tmLn.gotoCount++ >= numGotos) {tmLn.gotoCount=0; return}
  jmpFwd = (fNew > tmLn.curFrame);
  for (i = 0; i < tmLn.length; i++) {
    sprite = (jmpFwd)? tmLn[i] : tmLn[(tmLn.length-1)-i];
    if (sprite.charAt(0) == "s") {
      numKeyFr = sprite.keyFrames.length;
      firstKeyFr = sprite.keyFrames[0];
      lastKeyFr = sprite.keyFrames[numKeyFr - 1];
      if ((jmpFwd && fNew<firstKeyFr) || (!jmpFwd && lastKeyFr<fNew)) continue;
      for (keyFrm=1; keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]; keyFrm++);
      for (j=0; j<sprite.values.length; j++) {
        props = sprite.values[j];
        if (numKeyFr == props.length) propNum = keyFrm-1
        else propNum = Math.min(Math.max(0,fNew-firstKeyFr),props.length-1);
        if (sprite.obj != null) {
          if (props.prop2 == null) sprite.obj[props.prop] = props[propNum];
          else        sprite.obj[props.prop2][props.prop] = props[propNum];
      } }
    } else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
  }
  tmLn.curFrame = fNew;
  if (tmLn.ID == 0) eval('MM_timelinePlay(tmLnName)');
}

//Copyright 1997-1999 Macromedia, Inc. All rights reserved.
function MM_timelinePlay(tmLnName, myID) {
  var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstTime=false;
  if (document.MM_Time == null) MM_initTimelines();
  tmLn = document.MM_Time[tmLnName];
  if (myID == null) { myID = ++tmLn.ID; firstTime=true;}
  if (myID == tmLn.ID) {
    setTimeout('MM_timelinePlay("'+tmLnName+'",'+myID+')',tmLn.delay);
    fNew = ++tmLn.curFrame;
    for (i=0; i<tmLn.length; i++) {
      sprite = tmLn[i];
      if (sprite.charAt(0) == 's') {
        if (sprite.obj) {
          numKeyFr = sprite.keyFrames.length; firstKeyFr = sprite.keyFrames[0];
          if (fNew >= firstKeyFr && fNew <= sprite.keyFrames[numKeyFr-1]) {
            keyFrm=1;
            for (j=0; j<sprite.values.length; j++) {
              props = sprite.values[j];
              if (numKeyFr != props.length) {
                if (props.prop2 == null) sprite.obj[props.prop] = props[fNew-firstKeyFr];
                else        sprite.obj[props.prop2][props.prop] = props[fNew-firstKeyFr];
              } else {
                while (keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]) keyFrm++;
                if (firstTime || fNew==sprite.keyFrames[keyFrm-1]) {
                  if (props.prop2 == null) sprite.obj[props.prop] = props[keyFrm-1];
                  else        sprite.obj[props.prop2][props.prop] = props[keyFrm-1];
        } } } } }
      } else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
      if (fNew > tmLn.lastFrame) tmLn.ID = 0;
  } }
}

//Copyright 1997-1999 Macromedia, Inc. All rights reserved.
function MM_timelinePlay_tsh(tmLnName, myID) {
  var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstTime=false;
  if (document.MM_Time == null) MM_initTimelines();
  tmLn = document.MM_Time[tmLnName];
  if (myID == null) { myID = ++tmLn.ID; firstTime=true;}
  if (myID == tmLn.ID) {
    setTimeout('MM_timelinePlay_tsh("'+tmLnName+'",'+myID+')',tmLn.delay);
    fNew = ++tmLn.curFrame;
    for (i=0; i<tmLn.length; i++) {
      sprite = tmLn[i];
      if (sprite.charAt(0) == 's') {
        if (sprite.obj) {
          numKeyFr = sprite.keyFrames.length; firstKeyFr = sprite.keyFrames[0];
          if (fNew >= firstKeyFr && fNew <= sprite.keyFrames[numKeyFr-1]) {
            keyFrm=1;
            for (j=0; j<sprite.values.length; j++) {
              props = sprite.values[j];
              if (numKeyFr != props.length) {
                if (props.prop2 == null) sprite.obj[props.prop] = props[fNew-firstKeyFr];
                else        sprite.obj[props.prop2][props.prop] = props[fNew-firstKeyFr];
              } else {
                while (keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]) keyFrm++;
                if (firstTime || fNew==sprite.keyFrames[keyFrm-1]) {
                  if (props.prop2 == null) sprite.obj[props.prop] = props[keyFrm-1];
                  else        sprite.obj[props.prop2][props.prop] = props[keyFrm-1];
        } } } } }
      } else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
      if (fNew > tmLn.lastFrame) {
        tmLn.ID = 0;
        inmotion = 0;
      }
  } }
}

//Copyright 1997-1999 Macromedia, Inc. All rights reserved.
function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

//Copyright 1997-1999 Macromedia, Inc. All rights reserved.
function MM_validateForm() {
  var i,objStr,field,theCheck,atPos,theNum,colonPos,min,max,errors='';
  for (i=0; i<(MM_validateForm.arguments.length-2); i+=3) {
    objStr = MM_validateForm.arguments[(navigator.appName == 'Netscape')?i:i+1];
    if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ||
        (objStr.indexOf('document.all[')   ==0 && document.all   ==null))
      objStr = 'document'+objStr.substring(objStr.substring(0,objStr.lastIndexOf('.')).
                 lastIndexOf('.'),objStr.length);
    field = eval(objStr);
    field.name = (field.name)?field.name:objStr;
    theCheck = MM_validateForm.arguments[i+2];
    if (field.value) {
      if (theCheck.indexOf('isEmail') != -1) {
        atPos = field.value.indexOf('@');
        if (atPos < 1 || atPos == (field.value.length - 1))
          errors += '[ '+field.name+' ] muß eine gültige email-adresse enthalten!\n';
      } else if (theCheck != 'R') {
        theNum = parseFloat(field.value);
        if (field.value != ''+theNum) errors += '- '+field.name+' must contain a number.\n';
        if (theCheck.indexOf('inRange') != -1) {
          colonPos = theCheck.indexOf(':');
          min = theCheck.substring(8,colonPos);
          max = theCheck.substring(colonPos+1,theCheck.length);
          if (theNum < min || max < theNum)
            errors += '- '+field.name+' must contain a number between '+min+' and '+max+'.\n';
    } } }
    else if (theCheck.charAt(0) == 'R') errors += '[ '+field.name+' ]\n';
  }
  if (errors) alert('folgende eingabefelder müssen\nausgefüllt sein:\n\n'+
                    errors);
  document.MM_returnValue = (errors == '')
}

//Copyright 1999 transoniqhackers. All rights reserved.
function tshGoURL() {
  eval(tshGoURL.arguments[0]+".location='"+tshGoURL.arguments[1]+"'");
}
