function clientFinder(){
        this.ver=navigator.appVersion
        this.dom=document.getElementById?1:0
        this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
        this.ie4=(document.all && !this.dom)?1:0;
        this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
        this.ns4=(document.layers && !this.dom)?1:0;
        this.perc=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
        return this
}
perc=new clientFinder()



var speed=200;
var maxspeed=20;
var startspeed=200;

var loop, timer

function ConstructArea(obj,nest){
    nest=(!nest) ? '':'document.'+nest+'.';
        this.el=perc.dom?document.getElementById(obj):perc.ie4?document.all[obj]:perc.ns4?eval(nest+'document.'+obj):0;
        this.css=perc.dom?document.getElementById(obj).style:perc.ie4?document.all[obj].style:perc.ns4?eval(nest+'document.'+obj):0;
        this.ActivateHeight=perc.ns4?this.css.document.height:this.el.offsetHeight;
        this.clipHeight=perc.ns4?this.css.clip.height:this.el.offsetHeight;
        this.up=INvertAction;this.down=vertAction;
        this.Cine=Cine;
        this.x;
        this.y;
        this.obj = obj + "Object";
        eval(this.obj + "=this");
    return this;
}
function Cine(x,y){
        this.x=x;this.y=y;
        this.css.left=x+'px';
        this.css.top=y+'px';       
}

function vertAction(move){
		speed=speed*0.5;
		if (speed<=maxspeed)
		{
		 speed=maxspeed;
		}		
        if(this.y>-this.ActivateHeight+oCont.clipHeight){

                this.Cine(0,this.y-move);
                        if(loop) timer=setTimeout(this.obj+".down("+move+")",speed);
        }
}

function INvertAction(move){
		speed=speed*0.5;
		if (speed<=maxspeed)
		{
		 speed=maxspeed;
		}
        if(this.y<0){

                this.Cine(0,this.y-move);
                if(loop) timer=setTimeout(this.obj+".up("+move+")",speed);
        }
}

function Activate(speed){
        if(loaded){
                loop=true;
                if(speed>0) oActivate.down(speed);
                else oActivate.up(speed);
        }
}

function SlidePause(){
		speed=startspeed;
        loop=false;
        if(timer) clearTimeout(timer);
}

var loaded;
function ActivateMech(){
        oCont=new ConstructArea('txtArea');
        oActivate=new ConstructArea('txtActual','txtArea');
        oActivate.Cine(0,0);
        oCont.css.visibility='visible';
        loaded=true;
}

/* Onload Event Override!!!!
  Das Ereignis Onload wird überschrieben. Daher muss die vorhandene Funktion "start" nocheinmal
  in ActivateMech aufgerufen werden. Wenn neue Funktion zum Body-Onload Ereignis hinzugefügt werden sollen
  so muss dies im Body Tag geschehen und in der ActivateMech Funktion
*/


// Betriebssystem
os_Mac = (navigator.appVersion.indexOf("Mac") != -1);
os_PC = (! os_Mac) ? true : false;

// Browserfeatures
has_DOM = (document.getElementById) ? true : false; // Unterstuetzt DOM (Document Object Model)

// Netscape Navigator
is_NS = (navigator.userAgent.indexOf("Netscape")!=-1);
is_NS4 = (document.layers) ? true : false;
is_NS6 = (navigator.userAgent.indexOf("Netscape6")!=-1);
is_NS7 = (navigator.userAgent.indexOf("Netscape/7")!=-1);

// Internet Explorer
is_IE = (document.all) ? true : false; // Internet Explorer (PC und Mac)
is_IE4 = is_IE && (! has_DOM);
is_IE4Mac = is_IE4 && os_Mac;
is_IE5Mac = ((is_IE) && (! is_IE4Mac) && (os_Mac));

// Opera
is_Opera = (navigator.userAgent.indexOf("Opera")!=-1);

// FireFox
is_FF = (navigator.userAgent.indexOf("Firefox")!=-1);


// Konqueror	
is_Konqueror = (navigator.userAgent.indexOf("Konqueror")!=-1);

// Safari MAC
is_SAF = (navigator.userAgent.indexOf("Safari")!=-1);  

function BrowserOptimize(NS6Add, IEMACAdd)
{
  // Abwärtskompatibilität
  if (typeof(NS6Add) == "undefined") NS6Add = 0;
  if (typeof(IEMACAdd) == "undefined") IEMACAdd = 0;

  NS6_LAYERPOSPATCH_TOP = 130;
  IEMAC_LAYERPOSPATCH_TOP = 130 + Number(IEMACAdd);

  // nur fuer PC
  if (os_PC)
    NS6_LAYERPOSPATCH_TOP = NS6_LAYERPOSPATCH_TOP + Number(NS6Add);

  // Netscape 7 und 6 Layerkorrektur (auf PC)
  if ((is_NS6) || (is_NS7))
  {

    if (document.getElementById('txtArea'))
      document.getElementById('txtArea').style.top = Number(document.getElementById('txtArea').style.top.replace('px','')) + NS6_LAYERPOSPATCH_TOP + 'px'

    if (document.getElementById('buttonlist'))
      document.getElementById('buttonlist').style.top = Number(document.getElementById('buttonlist').style.top.replace('px','')) + NS6_LAYERPOSPATCH_TOP + 'px'
  }

  // MAC IE 5 Layerkorrektur
  if (is_IE5Mac)
  {
    if (document.getElementById('txtArea'))
      document.getElementById('txtArea').style.top = Number(document.getElementById('txtArea').style.top.replace('px','')) + IEMAC_LAYERPOSPATCH_TOP + 'px'

    if (document.getElementById('buttonlist'))
      document.getElementById('buttonlist').style.top = Number(document.getElementById('buttonlist').style.top.replace('px','')) + IEMAC_LAYERPOSPATCH_TOP + 'px'
  }

}


onload=ActivateMech;


