      character*5 iden
      character*128 radek
      OPEN(1,FILE = 'fol.pom', STATUS='OLD')
      OPEN(2,FILE = 'followup.html')
      OPEN(3,FILE = 'fol.dat', STATUS='OLD')
1     format(A5,A128)
      read(3,1) iden, radek
      write(2,1) iden, radek
      iden='xxxxx' 
10    IF (iden .NE. '<ul> ') THEN
      read(1,1) iden, radek
      write(2,1) iden, radek  
      GOTO 10 
      ENDIF
      call VYPLN(i)
      iden='xxxxx'
11    IF (iden .NE. '<ul> ') THEN
      read(1,1) iden, radek
      write(2,1) iden, radek  
      GOTO 11
      ENDIF  
      call VYPLN(i) 
      iden='xxxxx'
12    IF (iden .NE. '<ul> ') THEN
      read(1,1) iden, radek
      write(2,1) iden, radek  
      GOTO 12
      ENDIF  
      call VYPLN(i)
13    read(1,1,END=15) iden, radek
      write(2,1) iden, radek  
      GOTO 13
15    close(1)
      close(2)              
      close(3)
      write(*,*) '-------------------'
      write(*,*) i, ' objektu'
      write(*,*) '-------------------'
      stop
      end


      SUBROUTINE vypln(i)
      character*33 balast
      character*9 value 
      character*11 check                           
      character*1 stoleti
      character*2 rok
      character*1 mesic1
      character*1 cislo1,cislo2,c1,c2
      character*1 mesic2  
      character*2 stcis
      balast='<p><input type="checkbox" name="O'
      value='" value="'    
      check='" CHECKED> '
2     format(A5)
3     format(A7)
4     format(A1,A2,A1,A1,A1,A1)  
5     format(A33,I2.2,A9,A1,A2,A1,A1,A1,A1,A11,A2,A2,A1,A1,A1,A5,A1,
     *A1,A6)
      read(3,4) stoleti, rok, mesic1, cislo1, cislo2,mesic2    
      IF (stoleti .EQ. ' ') THEN 
      read(3,4) stoleti, rok, mesic1, cislo1, cislo2,mesic2
      ENDIF
20    IF (stoleti .NE. ' ') THEN
      i=i+1            
      IF (stoleti .EQ. 'J') THEN 
      stcis='19' 
      ENDIF
      IF (stoleti .EQ. 'K') THEN 
      stcis='20' 
      ENDIF       
      c1=cislo1
      c2=cislo2
      IF (cislo1 .EQ. '0') THEN
      c1=' ' 
      IF (cislo2 .EQ. '0') THEN
      c2=' '
      ENDIF
      ENDIF                          
      write(2,5) balast, i, value, stoleti, rok, mesic1, cislo1, cislo2,
     *mesic2,check, stcis, rok,' ',mesic1, mesic2,'<SUB>',c1,c2,
     *'</SUB>'
      read(3,4,END=30) stoleti, rok, mesic1, cislo1,cislo2, mesic2    
      GOTO 20
      ENDIF        
30    continue
      RETURN
      END
