

 function turn_img(nr,turn_img,direction){
      var w = obj[nr].style.width;
      w = w.replace("px", "");
      w = parseInt(w);
      //nr = obj.id;
      //nr = nr.replace("obj", "");
      //nr = parseInt(nr);
      
      //alert(w);
      if(w > 0 && direction > 0 ){
        w = w + ( direction * -1 );
        if(w < 0)w = 0;//alert(w);
        setTimeout("turn_img(" + nr + "," + turn_img + ", " + direction + ");", 30 );
      }else{
        if(w < 70){
          if(w == 0){
            direction = ( direction * -1 );
            //bild wechzeln
            
            obj[nr].src = newimg[turn_img][nr].src;
            
          }
          w = w + ( direction * -1 );
          if(w > 70)w = 70;//alert(w);
          setTimeout("turn_img(" + nr + "," + turn_img + ", " + direction + ");", 30 );
        }
      }
      
      obj[nr].style.width = w + "px";
      
    }
    
    count_img = 0;
    function start_turn(){
      var session = new Image();
      session.src = newimg[count_img]['name'];
      for(i=1;i<29;i= i+7){
        setTimeout("run_turn(" + i + "," + count_img + ");",(30*i));
      }
      count_img++;
      if( count_img >= newimg.length ) count_img = 0;
      setTimeout( "start_turn()",9000 );
    }
    
    function run_turn(startnr,img_nr){
      next = 0;
      for(n = startnr;n<startnr+7;n++){
        setTimeout("turn_img(" +n+ "," + img_nr + ",7 );",(150*next));
        next++;
      }
    }
   
    
    