   "Note contents as a string of XHTML")
 (make-variable-buffer-local 'evernote-note-xhtml-mode-content)
 
-
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Menu Settings
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defvar evernote-mode-display-menu t
+  "display the evernote menu on the menubar if this variable is not nil")
 
 (defvar evernote-mode-map (make-sparse-keymap)
   "Keymap used in evernote mode.")

  "Major mode for browsing notes."
  (interactive)
  (if (called-interactively-p) (enh-clear-onmem-cache))
  (use-local-map evernote-browsing-mode-map)
  (setq truncate-lines t
        major-mode 'evernote-browsing-mode

(define-key evernote-mode-map "\C-cer"   'evernote-rename-note)
(define-key evernote-mode-map "\C-ced"   'evernote-delete-note)
(define-key evernote-mode-map "\C-x\C-q" 'evernote-toggle-read-only)


(defun enh-menu-is-visible-on-ordinary-mode ()
	(not evernote-browsing-mode))

(defun enh-menu-is-visible-on-evernote-mode ()
	(and evernote-mode (not evernote-browsing-mode)))

(defun enh-menu-is-visible-on-evernote-browsing-mode ()
	evernote-browsing-mode)

(let ((menu-bar-map (make-sparse-keymap "Evernote")))
	(define-key-after global-map [menu-bar evernote]
		`(menu-item "Evernote" ,menu-bar-map
								:visible evernote-mode-display-menu)
		'tools)
	(define-key menu-bar-map [browser]
		'(menu-item "Evernote Browser" evernote-browser
								:visible (enh-menu-is-visible-on-ordinary-mode)))
	(define-key menu-bar-map [seperator-0]
		'(menu-item "--" nil
								:visible (enh-menu-is-visible-on-ordinary-mode)))
	(define-key menu-bar-map [toggle-read-only]
		'(menu-item "Toggle Read Only" evernote-toggle-read-only
								:visible (enh-menu-is-visible-on-evernote-mode)))
	(define-key menu-bar-map [delete-note]
		'(menu-item "Delete Note" evernote-delete-note
								:visible (enh-menu-is-visible-on-evernote-mode)))
	(define-key menu-bar-map [rename-note]
		'(menu-item "Rename Note" evernote-rename-note
								:visible (enh-menu-is-visible-on-evernote-mode)))
	(define-key menu-bar-map [change-edit-mode]
		'(menu-item "Change Edit Mode" evernote-change-edit-mode
								:visible (enh-menu-is-visible-on-evernote-mode)))
	(define-key menu-bar-map [edit-tag]
		'(menu-item "Edit Tag" evernote-edit-tags
								:visible (enh-menu-is-visible-on-evernote-mode)))
	(define-key menu-bar-map [save-note]
		'(menu-item "Save Note" evernote-save-note
								:visible (enh-menu-is-visible-on-evernote-mode)))
	(define-key menu-bar-map [seperator-1]
		'(menu-item "--" nil
								:visible (enh-menu-is-visible-on-evernote-mode)))
	(define-key menu-bar-map [edit-search]
		'(menu-item "Edit Saved Search" evernote-edit-search
								:visible (enh-menu-is-visible-on-ordinary-mode)))
	(define-key menu-bar-map [create-search]
		'(menu-item "Create Saved Search" evernote-create-search
								:visible (enh-menu-is-visible-on-ordinary-mode)))
	(define-key menu-bar-map [do-saved-search]
		'(menu-item "Do Saved Search" evernote-do-saved-search
								:visible (enh-menu-is-visible-on-ordinary-mode)))
	(define-key menu-bar-map [search-note]
		'(menu-item "Search Note" evernote-search-notes
								:visible (enh-menu-is-visible-on-ordinary-mode)))
	(define-key menu-bar-map [seperator-2]
		'(menu-item "--" nil
								:visible (enh-menu-is-visible-on-ordinary-mode)))
	(define-key menu-bar-map [post-region]
		'(menu-item "Post Region" evernote-write-note
								:visible (enh-menu-is-visible-on-ordinary-mode)))
	(define-key menu-bar-map [write-note]
		'(menu-item "Write Note" evernote-write-note
								:visible (enh-menu-is-visible-on-ordinary-mode)))
	(define-key menu-bar-map [create-note]
		'(menu-item "Create Note" evernote-create-note
								:visible (enh-menu-is-visible-on-ordinary-mode)))
	(define-key menu-bar-map [open-note]
		'(menu-item "Open Note" evernote-open-note
								:visible (enh-menu-is-visible-on-ordinary-mode)))
	(define-key menu-bar-map [browsing-prev-page]
		'(menu-item "Prev Page" evernote-browsing-prev-page
								:visible (enh-menu-is-visible-on-evernote-browsing-mode)))
	(define-key menu-bar-map [browsing-next-page]
		'(menu-item "Next Page" evernote-browsing-next-page
								:visible (enh-menu-is-visible-on-evernote-browsing-mode)))
	(define-key menu-bar-map [browsing-search-notes]
		'(menu-item "Searche Notes" evernote-browsing-search-notes
								:visible (enh-menu-is-visible-on-evernote-browsing-mode)))
	(define-key menu-bar-map [browsing-list-searches]
		'(menu-item "List Saved Searches" evernote-browsing-list-searches
								:visible (enh-menu-is-visible-on-evernote-browsing-mode)))
	(define-key menu-bar-map [browsing-list-tags]
		'(menu-item "List Tags" evernote-browsing-list-tags
								:visible (enh-menu-is-visible-on-evernote-browsing-mode)))
	(define-key menu-bar-map [browsing-list-notebooks]
		'(menu-item "List Notebooks" evernote-browsing-list-notebooks
								:visible (enh-menu-is-visible-on-evernote-browsing-mode))))


(defun evernote-mode (&optional guid)
