 
   # Obtain the file type suffix (after a period)
   #
-  # @param fileName the String name of the file
+  # @param path the path to the file
   #
   # @return {String} the suffix, or null if there is none.
-  getSuffix = ( fileName ) ->
-    split = fileName.split '.'
-
-    if split.length > 1
-      split[ split.length - 1 ]
+  getSuffix = ( path ) ->
+    splitBySlash = path.split '/'
+    fileName = splitBySlash[ splitBySlash.length - 1 ]
+
+    splitByDot = fileName.split('.')
+
+    if splitByDot.length > 1
+      splitByDot[ splitByDot.length - 1 ]
     else
       null
 

    # @param $content the DOM content to display.
    #
    # @return this
    showContent = ($content) =>
      $(@options.contentClass)
        .empty ()
        .append( $content );
      this


    # call init, and return the output
    @init()

  # object literal containing default options
  $.pseudositer.defaultOptions =
    loadingClass: 'pseudositer-load'
    contentClass: 'pseudositer-content'
    directoryClass: 'pseudositer-directory'
  	linkSelector   : 'a:not([href^="?"],[href^="/"])', # Find links from a directory listing that go deeper

  $.fn.pseudositer = (options) ->
    $.each @, (i, el) ->

    # Private methods.
    ###

    # Get the class name for links of a specified level.
    #
    # @param level the {int} level, starting with 0, of the links.
    #
    # @return {String} the name of the class
    getLinkClassForLevel = ( level ) =>

      @options.linkClass + '-' + level

    # Get the class name for links with a certain path.
    #
    # @param path the {String} path to the links.
    #
    # @return {String} the name of the class
    # getLinkClassForPath = ( path ) =>

    #   # generate a safe version of the path to use as the class name
    #   name = path.replace /[^a-zA-Z0-9]/g, '-'
    #   @options.linkClass + '-' + name

    # Calculate the actual path for an ajax request from a path from
    # the address bar.  Resolves the path against @rootPath.
    #
    # @param path a path from the address bar
    #
    # @return {String} a path that can be used for an ajax request.
    resolve = (path) =>

      # @rootPath always ends in '/'
      if path.charAt 0 is '/' then @rootPath + path.substr 1 else @rootPath + path

    # Show the loading notice
    #
