<?xml version="1.0" ?>

<?xml-stylesheet href="chrome://global/skin/" type="text/css" ?>
<?xml-stylesheet href="chrome://scrapbook/skin/scrapbook.css" type="text/css" ?>
<?xml-stylesheet href="chrome://scrapbook/skin/note.css" type="text/css" ?>

<!DOCTYPE window SYSTEM "chrome://scrapbook/locale/note.dtd">

<window id="sbNoteWindow"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        onload="sbNoteService2.init();"
        onunload="sbNoteService2.finalize(false);">

	<script type="application/x-javascript" src="chrome://scrapbook/content/common.js" />
	<script type="application/x-javascript" src="chrome://scrapbook/content/scrapnote.js" />
	<script type="application/x-javascript" src="chrome://scrapbook/content/note.js" />

	<browser id="sbNoteBrowser" type="content-primary" flex="3" collapsed="true" onload="event.stopPropagation();" />
	<splitter id="sbSplitter" class="plain" collapsed="true" />
	<vbox id="sbNoteEditor" flex="2">
		<hbox id="sbNoteHeader" class="sb-header" align="center">
		    <image id="sbNoteImage" />
			<label id="sbNoteLabel" flex="1" crop="end" />
			<spacer flex="1" />
			<toolbarbutton image="chrome://scrapbook/skin/expander_up.png" style="-moz-appearance:none;" hidden="true" oncommand="sbNoteService2.toggleHTMLView(false);" />
		</hbox>
		<textbox id="sbNoteTextbox"
		         multiline="true"
		         oninput="sbNoteService.change(true);"
		         onkeypress="sbNoteService.insertString(event);"
		         class="plain" flex="1" />
	</vbox>
	<vbox id="sbNoteTemplate" flex="2" collapsed="true">
		<hbox id="sbNoteTemplateHeader" class="sb-header sb-header-red" align="center">
			<label value="&sb.note.template;" />
			<spacer flex="1" />
			<toolbarbutton class="sb-header-exit" oncommand="sbNoteTemplate.exit(true);" />
		</hbox>
		<textbox id="sbNoteTemplateTextbox"
		         multiline="true"
		         oninput="sbNoteTemplate.change(true);"
		         onkeypress="sbNoteService.insertString(event);"
		         class="plain" flex="1" wrap="off" />
	</vbox>
	<toolbar id="sbNoteToolbar" align="center">
		<toolbarbutton id="sbNoteToolbarS" accesskey="&sb.note.save.accesskey;" label="&sb.note.save;"       disabled="true" oncommand="sbNoteService.save();sbNoteTemplate.save();" />
		<toolbarbutton id="sbNoteToolbarH" accesskey="&sb.note.htmlview.accesskey;" label="&sb.note.htmlview;"   oncommand="sbNoteService2.initHTMLView();" />
		<toolbarbutton id="sbNoteToolbarN" accesskey="&sb.note.normalview.accesskey;" label="&sb.note.normalview;" disabled="true" oncommand="sbNoteService2.toggleHTMLView(false);" />
		<toolbarbutton type="menu" label="&sb.note.tools;" accesskey="&sb.note.tools.accesskey;">
			<menupopup>
				<menuitem label="&sb.note.help;" oncommand="ScrapBookUtils.loadURL('chrome://scrapbook/locale/templateHelp.html', true);" />
				<menuseparator />
				<menuitem id="sbNoteToolbarL" type="checkbox" label="&sb.note.autolinefeed;" tooltiptext="&sb.note.autolinefeed.t;" />
				<menuitem id="sbNoteToolbarT" type="checkbox" label="&sb.note.template;" oncommand="this.getAttribute('checked') ? sbNoteTemplate.load() : sbNoteTemplate.exit(false);" />
			</menupopup>
		</toolbarbutton>
		<toolbarbutton type="menu" id="sbNoteToolbarF" label="&sb.note.fontsize;" accesskey="&sb.note.fontsize.accesskey;">
			<menupopup oncommand="sbNoteService2.changeFontSize(parseInt(event.originalTarget.label, 10));">
				<menuitem id="sbNoteToolbarF18" type="radio" label="18px" />
				<menuitem id="sbNoteToolbarF17" type="radio" label="17px" />
				<menuitem id="sbNoteToolbarF16" type="radio" label="16px" />
				<menuitem id="sbNoteToolbarF15" type="radio" label="15px" />
				<menuitem id="sbNoteToolbarF14" type="radio" label="14px" />
				<menuitem id="sbNoteToolbarF13" type="radio" label="13px" />
				<menuitem id="sbNoteToolbarF12" type="radio" label="12px" />
			</menupopup>
		</toolbarbutton>
		<toolbarbutton id="sbNoteToolbarP" accesskey="&sb.note.print.accesskey;" label="&sb.note.print;" oncommand="sbNoteService2.initHTMLView(); sbNoteService2.BROWSER.contentWindow.print();" />
		<spacer flex="1" />
		<toolbarbutton class="sb-header-locate" oncommand="ScrapBookUtils.getBrowserWindow().ScrapBookBrowserOverlay.execLocate(sbNoteService.resource);" />
		<toolbarbutton class="sb-header-exit" id="sbNoteToolbarX" accesskey="&sb.note.exit.accesskey;" tooltiptext="&sb.note.exit;" oncommand="sbNoteService2.finalize(true);" />
	</toolbar>

</window>
