/*********************************/
/* script to display commercials */
/*********************************/

/* this script will read the file scripts\commerce.txt 
   each line in this file has the format:
   <filename of a commercial-file> <expire>  */ 

call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs

filename = 'scripts\commerce.txt'

actline = 0

do while lines(filename) 
  actline = actline + 1; 
  aline = linein(filename)

  if (\ (aline = '')) then
    do
      parse value aline with file expire rest
      call addtickerobject "kgs",,'commerceK'actline, expire
      call addtickerobject "img", file, 'commerce'actline, expire

    end
end

call settickerspeed 40, 2

/* atomatically adjust the size of the ticker to the size of
   the largest commercial */
call adjusttickersize

exit

