This looks like a difficult question for IDL programmers, who are not also ENVI users. Are you aware that RSI has a User Forum specifically for ENVI users? You might want to resubmit your question there. Here is the direct URL:
http://www.rsinc.com/foru...h.asp?urlCategory=57
although it should be easy to find the link any time even on RSI's home page.
James Jones