 SystemMessageManager = require("../Features/SystemMessages/SystemMessageManager")
 _ = require("underscore")
 Modules = require "./Modules"
-url = require "url"
+Url = require "url"
 
 fingerprints = {}
 Path = require 'path'

			if !opts.qs?.fingerprint? and doFingerPrint
				opts.qs.fingerprint = getFingerprint(p)

			p = url.resolve(staticFilesBase, p)
			qs = querystring.stringify(opts.qs)

			if qs? and qs.length > 0
				p = p + "?" + qs
			return p


		res.locals.buildCssPath = (cssFile)->
			p = Path.join(cssPath, cssFile)
			return url.resolve(staticFilesBase, p) + "?fingerprint=" + getFingerprint(p)

		res.locals.buildImgPath = (imgFile)->
			p = Path.join(imgPath, imgFile)
			return url.resolve(staticFilesBase, p)

		next()



	webRouter.use (req, res, next)-> 
		res.locals.jsPath = jsPath
		res.locals.fullJsPath = Url.resolve(staticFilesBase, jsPath)

		imgPath = "/img/"
		cssPath = "/stylesheets/"

		res.locals.buildJsPath = (jsFile, opts = {})->
			path = Path.join(jsPath, jsFile)

			doFingerPrint = opts.fingerprint != false
			
