pro movy_wrapper,year,month=month

;+
; NAME
;       movy_wrapper.pro
; PURPOSE
;       Calls jsmovie.pro to create the .html smoothy from the .jpg files.
; CALLING SEQUENCE
;       movy_wrapper,year
; INPUT
;       year
;	year=[1991,1992,1993,1994,1995,1996,1997,1998,1999,2000]
; OPTIONAL INPUT
;	month, e.g., '03'
; OUTPUT
;	.html smoothy file to
;	  /yla/smoothy/smthy_mov/smoothy_year.html
; HISTORY
; 	27-Oct-2016  Made this a pro with year as an input.
;              year can be in any format.
;        6-Dec-2016 LWA  Added header.
;	14-Dec-2016 LWA  Added keyword month.
;-


for i=0,n_elements(year)-1 do begin
   yyyy=strtrim(year(i),2)
   help,yyyy
;   name='/yla/smoothy/smthy_mov/smoothy_'+yyyy+'.html'
   jpgz=file_search('/yla/smoothy/smthy_jpg/'+yyyy+'/*.jpg')
   jpgz=file_break(jpgz)
   if keyword_set(month) then begin
      help,month
      mm=strmid(jpgz,5,2)
      mn=strwhere(mm,month)
      jpgz=jpgz(mn)
      name='/yla/smoothy/smthy_mov/smoothy_'+yyyy+'_'+month+'.html
   endif else begin
      name='/yla/smoothy/smthy_mov/smoothy_'+yyyy+'.html
   endelse
   url='/yla/smoothy/smthy_jpg/'+yyyy
   help,name,jpgz,url
   jsmovie,name,jpgz,url=url
endfor
end
