How to compare and select the right type of file?

Hi all,

Just a quick question, I have one array which contains several files of jpg and gif types.
ex: var tabImages:Array = new Array(“file_01.jpg”, “file_01.gif”, etc.);

I use a dropdown menu list to load each of them and I want to show them on two different movieclips (ex: on left side want to load only: JPG, on right side to load only: GIF)

How can I compare and select the right type of file to load in the right side of MC?

Does anyone have an idea of how to do that?