////////////////////
//HEMO TEXT      //
//////////////////
function part19() {
    this.vbl = 0 ;
    this.canvaspart;
    this.initdone = 0 ;
    var visage_x=0;
    var visage_y=842;
    var visage_mytile = 0 ;
    var visage_canvas;  
    var vbl_visage=0;
    var visage_all_drawn=0;

    var SIZEx = 200;
    var SIZEy = 234;

    var myfont_big_tile = new codef_Tile() ;

    var cpt_visage_y=0;
    var pos_y=-266;
    var rot=0;
    var vbl_visage=0;
    var mycanvas_scr2;
    var mycanvas_scr3;
    var mycanvas_scr4;
    var endblack;    

    var scr_move=0;
    var scr_stop=0;
    var scr_vbl=0;
    var vbl_visage=0;

    function do_visage(dest) {
      visage.drawTile(dest,visage_mytile,visage_x,visage_y) ;
      visage_mytile ++
      visage_x += visage.tilew ;
      if ( visage_x >= visage.img.width ) {
          visage_x = 0 ;
          visage_y -= visage.tileh;
     
        if ( visage_y <= 0 ) visage_all_drawn = 1 ;
      }
  }
    
    this.init = function(dest,black) {
       
        this.canvaspart.fill("#0"); 
        this.canvaspart.draw(black);

        visage_canvas = new canvas(visage.img.width, visage.img.height) ;

        visage.initTile(visage.img.width,1,0) ;

        scr_move=0;
        scr_stop=0;
        scr_vbl=0;
        vbl_visage=0;
        cpt_visage_y=0;
        pos_y=-266;
        visage_all_drawn = 0 ;
        visage_x=0;
        visage_y=842;
        visage_mytile = 0 ;
        
        mycanvas_scr2=new canvas(720,576);
        mycanvas_scr4=new canvas(720,576);
        mycanvas_scr3=new canvas(1200,1200);
        background.draw(mycanvas_scr3,0,0);
        background.draw(mycanvas_scr3,0,800);

        endblack = new canvas(720,576) ;
        endblack.fill("#000000") ;

        //myfont_big.initTile(450,417,32);
        // codef_Tile for speed
        myfont_big_tile.initTile(myfont_big,myfont_big.img.width,myfont_big.img.height,450,417,32) ;

        myscrolltext_big = new scrolltext_horizontal();
        myscrolltext_big.scrtxt="INSERT DISK 3...";
        myscrolltext_big.init(mycanvas_scr4,myfont_big_tile,25);

        this.initdone = 1 ;
    }

    this.render = function(dest) {
        
        if (this.initdone == 0) { this.canvaspart = new canvas(720,576) ; this.init(this.canvaspart,dest) ; }
        
        this.canvaspart.fill("#0");

        if (vbl_visage>=100){
            mycanvas_scr2.clear();
            mycanvas_scr4.clear();
            myscrolltext_big.draw(1);
            mycanvas_scr4.draw(mycanvas_scr2,0,scr_move);
  
            scr_stop++;
            if (scr_stop<120){scr_move++;}
            if ((scr_stop>=120)&&(scr_stop<=238)){scr_move--;}
            if (scr_stop>238){scr_stop=0}
            
            mycanvas_scr2.contex.globalCompositeOperation='source-in';
            mycanvas_scr3.draw(mycanvas_scr2,-200+Math.sin((scr_vbl*Math.PI)/200)*100,-100+Math.cos((scr_vbl*Math.PI)/200)*50);
            mycanvas_scr2.contex.globalCompositeOperation='source-over';
            
            mycanvas_scr2.draw(this.canvaspart,0,30,1);

            scr_vbl++;
            }

          if (visage_all_drawn == 0) 
          {
            do_visage(visage_canvas) ;
            cpt_visage_y++;
            if (cpt_visage_y>=576) pos_y+=1; 
            visage_canvas.draw(this.canvaspart,0,pos_y) ;
          }
          else
          {
            vbl_visage++;
            
            if ((vbl_visage>0)&&(vbl_visage<115))
            {
            cpt_visage_y=0;
            visage_canvas.draw(this.canvaspart,0,pos_y,1);
             }
              else
            if ((vbl_visage>=115)&&(vbl_visage<170))
             {
              cpt_visage_y++;
              pos_y+=10; 
              visage_canvas.draw(this.canvaspart,0,pos_y,1) ;
            }
           
           }

        if (this.vbl<100) mycanvasblack.draw(dest,60,88,1-this.vbl/100);
          
       this.canvaspart.draw(dest);

        if (this.vbl>intro_parts[part_running].part_duration-100) {
            endblack.draw(dest,0,0,1-(intro_parts[part_running].part_duration-this.vbl)/100);
        }
            
             this.vbl++ ;
    }

    return this ;
}

///////////////
//END PART19//
/////////////