 
         next: ->
             list = @list
-            i = $.inArray(this.cur, list)
+            i = $.inArray(@cur, list)
             l = list.length
             next = i + 1
 

            @cur = list[next]

        setCur: (sid) ->
            sid = sid + ''
            unless sid in @list
                @add(sid)
            @cur = '' + sid

    Events.mixTo(Playlist)
    Playlist

do (root = @, factory = (utils, Events) ->
    class Playlist
        constructor: (options) ->
            @opts = $.extend({}, @defaults, options)
