
        function jElement (ID, targetX, targetY, targetW, targetH)
        {
          this.speedX=0;              this.speedY=0;       
		  
          this.delay=null;
          this.objekt = document.getElementById(ID);
          this.X=0;         this.Y=0;         this.W=0;         this.H=0;
          if(this.objekt)
          {
           if(this.objekt.style.left){ this.X = this.objekt.style.left;this.X = this.X.substring(0, this.X.indexOf("p")); this.X=parseInt(this.X); }
           if(this.objekt.style.top) { this.Y = this.objekt.style.top;  this.Y =  this.Y.substring(0, this.Y.indexOf("p")); this.Y = parseInt(this.Y);  }
           if(this.objekt.style.width){ this.W = this.objekt.style.width;this.W = this.W.substring(0, this.W.indexOf("p"));this.W = parseInt(this.W); }
		   if(this.objekt.style.height) { this.H = this.objekt.style.height;this.H = this.H.substring(0, this.H.indexOf("p"));this.H = parseInt(this.H);} 
		  }
		  
		  if(targetX!=0)this.tX = targetX; else this.tX=this.X;         
		  if(targetY!=0)this.tY = targetY; else this.tY=this.Y;
		  if(targetW!=0)this.tW = targetW; else this.tW=this.W;         
		  if(targetH!=0)this.tH = targetH; else this.tH=this.H;

        }

        var objekte = new Array();

        function scrollen(uID, uTargetX, uTargetY, uTargetW, uTargetH)
        {
                var used=false;
                if(objekte.length>0)
                {
                        for (var i=0; i<objekte.length; i++)
                        {
                         if(objekte[i].objekt==document.getElementById(uID))
                         {
                          clearInterval(objekte[i].delay);
                          //objekte[i].tX = uTargetX;
                          //objekte[i].tY = uTargetY;
						  /*if(uTargetX!=0)*/objekte[i].tX = uTargetX;
						  /*if(uTargetY!=0)*/objekte[i].tY = uTargetY;
						 /* if(uTargetW!=0)*/objekte[i].tW = uTargetW;
						  /*if(uTargetH!=0)*/objekte[i].tH = uTargetH;
                          objekte[i].delay = window.setInterval("move( objekte["+i+"] )", 15);

                          used=true;                          
                         }
                        }
                }
                if( (objekte.length==0) || (!used) )
                {
                        objekte.push( new jElement(uID, uTargetX, uTargetY, uTargetW, uTargetH));
                        clearInterval(objekte[objekte.length-1].delay);
                        objekte[objekte.length-1].delay = window.setInterval("move( objekte["+(objekte.length-1)+"] )", 15);
                }

     	}
		
		
		function z_index(zID, zZ)
     	{	   
	   
	   	var z_objekt = document.getElementById(zID);   // --------       
		if(z_objekt)z_objekt.style.zIndex=zZ; 
     	}
				


		function calc(c, cT)
		{
		var speed = Math.round((cT-c)/10); 
		if((cT>c)&&(speed<1))speed=1;     
        if((cT<c)&&(speed>-1))speed=-1;   
		return speed;
		}
		
		
		
		function move(jID)
		{
          		if(jID.X!=jID.tX)jID.X+=calc(jID.X, jID.tX); 
				if(jID.Y!=jID.tY)jID.Y+=calc(jID.Y,jID.tY); //Bewegen
				if(jID.W!=jID.tW)jID.W+=calc(jID.W, jID.tW); 
				if(jID.H!=jID.tH)jID.H+=calc(jID.H, jID.tH); 
				
				//jID.objekt.firstChild.nodeValue="X: "+jID.X+" Y: "+jID.Y+" W: "+jID.W+" H: "+jID.H;              
				
				if((jID.X==jID.tX)&&(jID.Y==jID.tY)&&(jID.W==jID.tW)&&(jID.H==jID.tH)) {clearInterval(jID.delay); /*objekte.pop();*/}//Stop
                
				if(jID.objekt)
				{ 
				  jID.objekt.style.left=jID.X+"px";  jID.objekt.style.top=jID.Y+"px";
				  jID.objekt.style.width=jID.W+"px"; jID.objekt.style.height=jID.H+"px";
				}                
   		}