 
 
 showFileDialog = (p, callback) ->
-	path = p
-	path = path.replace "//", "/"
+	@path = p
+	@path = @path.replace "//", "/"
 	dialogIsOpen = true
-	debug "show save window:#{path}"
-	sendReq {action:'fileList',path:path}, 'POST', (data) ->
+	debug "show save window:#{@path}"
+	sendReq {action:'fileList',path:@path}, 'POST', (data) ->
 		# debug "save window file list:#{data}"
 		table = $("<table cellspacing='2' cellpadding='2' id='filebrowser'></table>")
 		table.append("<colgroup><col span='1'/><col span='1' style='width:100px;'/></colgroup>")
 		table.append("<thead><tr><th>file/dir name</th><th>type</th></tr></thead>")
 
 		do ->
-			if path is "/" then return
-			up = path
+			if @path is "/" then return
+			up = @path
 			if up isnt "/" and up.match "/$"
 				up = up.substring 0, up.length-1
 			

	else if m[1] isnt "none"
			open m[1]

else
	sendReq {action:"getConfig"}, 'POST', (data) ->
		path = data.config.home
		if data.config.lastFiles?
			for i,f of data.config.lastFiles
				if i is "0"




# @input.bind 'keyup', (e)->
	# e.preventDefault()
	# e.stopPropagation()
