;+
;
;  Name:
;       OCC_FILETYPE
;
;
; PURPOSE:  
;	This function examines the input filename and returns the filetype
;	'.bdb','.cont','.discsp','cont_data','discsp_msfc', etc
;	
;
; CATEGORY: 
;	BATSE, OCCULTS
;
; CALLING SEQUENCE:
;	filetype = occ_filetype(filename)
;
; CALLED BY:
;
;
; CALLS:    BREAK_FILE
;
; INPUTS:
;	filename - data filename
; OPTIONAL INPUTS:
;
; OUTPUTS:
;       Returns a string with the filetype
; OPTIONAL OUTPUTS:
;
; KEYWORDS:
;
; COMMON BLOCKS:
;	none
;
; SIDE EFFECTS:
;	none
;
; RESTRICTIONS:
;	none
;
; PROCEDURE:
;	none
;
; MODIFICATION HISTORY: 
;	ras, 27-sep-1996
;-

function occ_filetype, filename, filetypes=filetypes

filetypes=['occ_discsp','.discsp','discsp_msfc','.bdb','cont_msfc','cont',$
	'hkg_data']

break_file, filename, disk, dir, fnam, ext
test = strlowcase((fnam+ext)(0))
i=0
while strpos(test,filetypes(i)) eq -1 do i=i+1

return, filetypes(i)
end
