OK, now I understand. It's very easy.
Let's say, you have a form element named FIELD1, from which you get filenames.
In order to receive file extentions you have to get last 3 chars of a string:
filename = document.forms[0].field1.value;
ext = filename.substring(filename.length-3, filename.length);
You may also write it as one expressin if you want:
ext = document.forms[0].field1.value.substring(document.forms[0].field1.value.length-3, document.forms[0].field1.value.length)
where
document.forms[0].field1.value - total filename string
document.forms[0].field1.value.length - number of characters in it
we use Substring() function to get only the chars we need. In our case - last three ones.
It works everywhere - IE, NN, Opera.
Enjoy!
Andrew | starway@mail.com
P.S. I just recalled that some files have 4-char extention, with .JPEG being one of them. Maybe you should check it too.