strippath in JS ?

    Nov 23 2012 | 3:15 pm
    hi everyone !
    could someone please help me to get the filename from the path ?
    knowing Javascript string command/operations wont help .
    var filename = this.substring(this.lastIndexOf("/") + 1, this.lastIndexOf("."));
    max is returning an error about not existing function .
    perhaps regular expression would help ,but im also getting errors .and additionaly i would like to get rid of extension string too .
    would be great if some of you have a clue what to do in my case .