

 function turn_img(nr,turn_img,direction){
      
      var imgw = obj[nr].style.width;
      imgw = imgw.replace("px", "");
      imgw = parseInt(imgw);
      //nr = obj.id;
      //nr = nr.replace("obj", "");
      //nr = parseInt(nr);
      
      //alert(imgw);
      if(imgw > 0 && direction > 0 ){
        imgw = imgw + ( direction * -1 );
        if(imgw < 0)imgw = 0;//alert(imgw);
        setTimeout("turn_img(" + nr + "," + turn_img + ", " + direction + ");", 5 );
      }else{
        if(imgw < 180){
          if(imgw == 0){
            direction = ( direction * -1 );
            //bild wechzeln
            
            obj[nr].src = newimg[turn_img][nr].src;
            
          }
          imgw = imgw + ( direction * -1 );
          if(imgw > 180)imgw = 180;//alert(imgw);
          setTimeout("turn_img(" + nr + "," + turn_img + ", " + direction + ");", 10 );
        }
      }
      
      obj[nr].style.width = imgw + "px";
      
    }
    
    count_img = 0;
    function start_turn(){
      var session = new Image();
      session.src = newimg[count_img]['name'];
      for(i=1;i<13;i= i+4){
        setTimeout("run_turn(" + i + "," + count_img + ");",(1*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+4;n++){
        setTimeout("turn_img(" +n+ "," + img_nr + ",4 );",(1*next));
        next++;
      }
    }
   
    
    
