c  lkmap.f
c GMT lkst   Time of Day
c 01 06:30   Sunrise
c 02 07:30   Morning
c 03 08:30   Morning
c 04 09:30   Morning
c 05 10:30   Morning
c 06 11:30   Morning
c 07 12:30   Noon
c 08 13:30   Afternoon
c 09 14:30   Afternoon
c 10 15:30   Afternoon
c 11 16:30   Afternoon
c 12 17:30   Afternoon
c 13 18:30   Sunset
c 14 19:30   Evening
c 15 20:30   Evening
c 16 21:30   Evening
c 17 22:30   Evening
c 18 23:30   Evening
c 19 00:30   Midnight
c 20 01:30   Night
c 21 02:30   Night
c 22 03:30   Night
c 23 04:30   Night
c 00 05:30   Night

       character*132 card
       data luin,lout/5,6/
       character*15 tofday(24)/
     1   'Sunrise   06:30','Morning   07:30','Morning   08:30',
     1   'Morning   09:30','Morning   10:30','Morning   11:30',
     1   'Noon      12:30','Afternoon 13:30','Afternoon 14:30',
     1   'Afternoon 15:30','Afternoon 16:30','Afternoon 17:30',
     1   'Sunset    18:30','Twilight  19:30','Evening   20:30',
     1   'Evening   21:30','Evening   22:30','Evening   23:30',
     1   'Midnight  00:30','Night     01:30','Night     02:30',
     1   'Night     03:30','Night     04:30','Twilight  05:30'/
       open(10,status="old",file="lkmap.dat")
c      open(luin,status="old",file="lkmap.img")
c      open(lout,status="unknown",file="lkmap.html")
       lm = 0
       do while(.true.)
         read(10,'(A)') card
         if(index(card,'LOOPSTART').ne.0) goto 10
         ld = lnblnk(card)
         write(lout,'(A)') card(:ld)
         lm = max(ld,lm)
       enddo
 10    do while(.true.)
         read(luin,'(A)',end=20) card
         ld = lnblnk(card)
         read(card(14:15),'(I2)') ih
         it = ih
         if(it.eq.0) it=24
         write(lout,'(A)') 's = new slide();'
         write(lout,'(A)') 's.src =  "'//card(:ld)//'";'
         write(lout,'(A)') 's.link =  "'//card(:ld)//'";'
         write(lout,'(A)') 's.title =  "'//card(:ld-4)//' GMT ";'
         write(lout,'(A)') 's.text =  "'//card(:ld-4)//' GMT - <big>'
       1                            //tofday(it)//' in Lanka</big>";'
c //s.target = "";
c //s.attr = "";
c //s.filter = "";
c //s.timeout = "";
         write(lout,'(A)') 'ss.add_slide(s);'
         write(lout,'(A)') ' '
       enddo
 20    continue
       do while(.true.)
         read(10,'(A)',end=30) card
         ld = lnblnk(card)
         lm = max(ld,lm)
         write(lout,'(A)') card(:ld)
       enddo
 30    continue
c      write(6,*) lm
       stop
       end
