... così:

var str="c:\documenti\immagini\foto.gif";
str=str.substr(str.lastIndexOf('\\'));

Ciao !