function appear(direct,limit,zu) {
zuf=zu;
i=x1;
j=x2;
k=x3;
dir=direct; 		
if (limit==0) {
lim1=0;lim2=0;lim3=0;
lim11=0;lim12=0;lim13=0;
lim21=0;lim22=0;lim23=0;
lim31=0;lim32=0;lim33=0;
limit=1;z=0;
}
     if (lim1==1 && lim2==1 && lim3==1) {
        alert("limit erreicht"+lim1+lim2+lim3);
      }
	  else
	  {
        setTimeout('clipping(i,j,k,dir,limit,zuf)',2);
	 }
	 
}
function clipping(i,j,k,dir,limit,zu) {
      eval("document.getElementById('textfeld1').style.clip= 'rect(0 316 "+x1+" 0)';");
      eval("document.getElementById('textfeld2').style.clip= 'rect(0 316 "+x2+" 0)';");
      eval("document.getElementById('textfeld3').style.clip= 'rect(0 316 "+x3+" 0)';");
      document.getElementById('bild1').style.top=y1;
      document.getElementById("bild2").style.top=y2;
      document.getElementById("bild3").style.top=y3;
	  
  if (dir==1) {
      if (zu!=1){ 
	    if ( x1<51){
		   x1++;
		   y1--;
	    }
		else
		{
		lim11=1;
		}
		}
		else
		{
	    if ( x1>0){
		   x1--;
		   y1++;
	    }
		else
		{
		lim11=1;
		}		
		}
	    if ( x2>0){
		   x2--;
		   y2++;
	    }  
		else
		{
		lim12=1;
		}
	    if ( x3>0){
		   x3--;
		   y3++;
		}  
		else
		{
		lim13=1;
		}
    }
  if (dir==2) {   
	    if ( x1>0){
		  x1--;
		  y1++;
	    }
		else
		{
		lim21=1;
		}
      if (zu!=2){ 
	    if ( x2<51){
		  x2++;
		  y2--;
	    }
		else
		{
		lim22=1;
		}
        }
		else
		{
	    if ( x2>0){
		  x2--;
		  y2++;
	    }
		else
		{
		lim22=1;
		}		
		}
	    if ( x3>0){
		  x3--;
		  y3++;
		}  
		else
		{
		lim23=1;
		}
    }
  if (dir==3) {   

	    if ( x1>0){
		  x1--;
		  y1++;
	    }
		else
		{
		lim31=1;
		}
	    if ( x2>0){
		  x2--;
		  y2++;
	    }
		else
		{
		lim32=1;
		}
      if (zu!=3){ 
	    if (x3<51){
		  x3++;
		  y3--;
		}  
		else
		{
		lim33=1;
		}
		}
        else
		{
	    if (x3>0){
		  x3--;
		  y3++;
		}  
		else
		{
		lim33=1;
		}		
		}
    }
    if (lim11==1 && lim21==1 && lim31==1)
	  lim1=1;
    if (lim12==1 && lim22==1 && lim32==1)
	  lim2=1;
    if (lim13==1 && lim23==1 && lim33==1)
	  lim3=1;
if ((x1==0 || x1==51) && (x2==0 || x2==51) && (x3==0 || x3==51) )  {
    //test
	}
	else
	{
 	appear(dir,limit,zu);
   }
}   
