 		console.log "default options #{JSON.stringify(opt)}"
 		load_site_options() if $('#site')?
 
+# Whether the site's password options has ever been saved.
+site_option_saved = false
+
 save_site_options = (show_note = true)->
 	input = gather_input()
 	optjson = JSON.stringify {

##################################################

gen_passwd = (show_note = true) ->
	if $('#site').val() == '' || $('#salt').val() == '' || $('#passphrase').val() == ''
		$('#passwd').val ''
		return false
	input = gather_input()
	p = passwdgen.generate input
	$('#passwd').val p
	if show_note
		util.notify 'Password for <b>' + $('#site').val() + '</b> generated.'
	return true

lastInputTime = new Date(1970, 1, 1)

		return
	util.storage.sync.get site, (json) ->
		if json?
			site_option_saved = true
			opt = JSON.parse(json)
			console.log "loaded options for #{site}: #{json}"
			update_passwd_options opt
			util.notify "Password option for <b>#{site}</b> loaded.", util.NOTIFY_KEEP
		set_tabindex()

##################################################
