<!--{{{-->
<link rel='alternate' type='application/rss+xml' title='RSS' href='index.xml' />
<!--}}}-->
Background: #fff
Foreground: #000
PrimaryPale: #8cf
PrimaryLight: #18f
PrimaryMid: #04b
PrimaryDark: #014
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
/*{{{*/
body {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}

a {color:[[ColorPalette::PrimaryMid]];}
a:hover {background-color:[[ColorPalette::PrimaryMid]]; color:[[ColorPalette::Background]];}
a img {border:0;}

h1,h2,h3,h4,h5,h6 {color:[[ColorPalette::SecondaryDark]]; background:transparent;}
h1 {border-bottom:2px solid [[ColorPalette::TertiaryLight]];}
h2,h3 {border-bottom:1px solid [[ColorPalette::TertiaryLight]];}

.button {color:[[ColorPalette::PrimaryDark]]; border:1px solid [[ColorPalette::Background]];}
.button:hover {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::SecondaryLight]]; border-color:[[ColorPalette::SecondaryMid]];}
.button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::SecondaryDark]];}

.header {background:[[ColorPalette::PrimaryMid]];}
.headerShadow {color:[[ColorPalette::Foreground]];}
.headerShadow a {font-weight:normal; color:[[ColorPalette::Foreground]];}
.headerForeground {color:[[ColorPalette::Background]];}
.headerForeground a {font-weight:normal; color:[[ColorPalette::PrimaryPale]];}

.tabSelected{color:[[ColorPalette::PrimaryDark]];
	background:[[ColorPalette::TertiaryPale]];
	border-left:1px solid [[ColorPalette::TertiaryLight]];
	border-top:1px solid [[ColorPalette::TertiaryLight]];
	border-right:1px solid [[ColorPalette::TertiaryLight]];
}
.tabUnselected {color:[[ColorPalette::Background]]; background:[[ColorPalette::TertiaryMid]];}
.tabContents {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::TertiaryPale]]; border:1px solid [[ColorPalette::TertiaryLight]];}
.tabContents .button {border:0;}

#sidebar {}
#sidebarOptions input {border:1px solid [[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel {background:[[ColorPalette::PrimaryPale]];}
#sidebarOptions .sliderPanel a {border:none;color:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:hover {color:[[ColorPalette::Background]]; background:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:active {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::Background]];}

.wizard {background:[[ColorPalette::PrimaryPale]]; border:1px solid [[ColorPalette::PrimaryMid]];}
.wizard h1 {color:[[ColorPalette::PrimaryDark]]; border:none;}
.wizard h2 {color:[[ColorPalette::Foreground]]; border:none;}
.wizardStep {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];
	border:1px solid [[ColorPalette::PrimaryMid]];}
.wizardStep.wizardStepDone {background:[[ColorPalette::TertiaryLight]];}
.wizardFooter {background:[[ColorPalette::PrimaryPale]];}
.wizardFooter .status {background:[[ColorPalette::PrimaryDark]]; color:[[ColorPalette::Background]];}
.wizard .button {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryLight]]; border: 1px solid;
	border-color:[[ColorPalette::SecondaryPale]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryPale]];}
.wizard .button:hover {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Background]];}
.wizard .button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::Foreground]]; border: 1px solid;
	border-color:[[ColorPalette::PrimaryDark]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryDark]];}

.wizard .notChanged {background:transparent;}
.wizard .changedLocally {background:#80ff80;}
.wizard .changedServer {background:#8080ff;}
.wizard .changedBoth {background:#ff8080;}
.wizard .notFound {background:#ffff80;}
.wizard .putToServer {background:#ff80ff;}
.wizard .gotFromServer {background:#80ffff;}

#messageArea {border:1px solid [[ColorPalette::SecondaryMid]]; background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]];}
#messageArea .button {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::SecondaryPale]]; border:none;}

.popupTiddler {background:[[ColorPalette::TertiaryPale]]; border:2px solid [[ColorPalette::TertiaryMid]];}

.popup {background:[[ColorPalette::TertiaryPale]]; color:[[ColorPalette::TertiaryDark]]; border-left:1px solid [[ColorPalette::TertiaryMid]]; border-top:1px solid [[ColorPalette::TertiaryMid]]; border-right:2px solid [[ColorPalette::TertiaryDark]]; border-bottom:2px solid [[ColorPalette::TertiaryDark]];}
.popup hr {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::PrimaryDark]]; border-bottom:1px;}
.popup li.disabled {color:[[ColorPalette::TertiaryMid]];}
.popup li a, .popup li a:visited {color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:active {background:[[ColorPalette::SecondaryPale]]; color:[[ColorPalette::Foreground]]; border: none;}
.popupHighlight {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
.listBreak div {border-bottom:1px solid [[ColorPalette::TertiaryDark]];}

.tiddler .defaultCommand {font-weight:bold;}

.shadow .title {color:[[ColorPalette::TertiaryDark]];}

.title {color:[[ColorPalette::SecondaryDark]];}
.subtitle {color:[[ColorPalette::TertiaryDark]];}

.toolbar {color:[[ColorPalette::PrimaryMid]];}
.toolbar a {color:[[ColorPalette::TertiaryLight]];}
.selected .toolbar a {color:[[ColorPalette::TertiaryMid]];}
.selected .toolbar a:hover {color:[[ColorPalette::Foreground]];}

.tagging, .tagged {border:1px solid [[ColorPalette::TertiaryPale]]; background-color:[[ColorPalette::TertiaryPale]];}
.selected .tagging, .selected .tagged {background-color:[[ColorPalette::TertiaryLight]]; border:1px solid [[ColorPalette::TertiaryMid]];}
.tagging .listTitle, .tagged .listTitle {color:[[ColorPalette::PrimaryDark]];}
.tagging .button, .tagged .button {border:none;}

.footer {color:[[ColorPalette::TertiaryLight]];}
.selected .footer {color:[[ColorPalette::TertiaryMid]];}

.sparkline {background:[[ColorPalette::PrimaryPale]]; border:0;}
.sparktick {background:[[ColorPalette::PrimaryDark]];}

.error, .errorButton {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Error]];}
.warning {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryPale]];}
.lowlight {background:[[ColorPalette::TertiaryLight]];}

.zoomer {background:none; color:[[ColorPalette::TertiaryMid]]; border:3px solid [[ColorPalette::TertiaryMid]];}

.imageLink, #displayArea .imageLink {background:transparent;}

.annotation {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border:2px solid [[ColorPalette::SecondaryMid]];}

.viewer .listTitle {list-style-type:none; margin-left:-2em;}
.viewer .button {border:1px solid [[ColorPalette::SecondaryMid]];}
.viewer blockquote {border-left:3px solid [[ColorPalette::TertiaryDark]];}

.viewer table, table.twtable {border:2px solid [[ColorPalette::TertiaryDark]];}
.viewer th, .viewer thead td, .twtable th, .twtable thead td {background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::Background]];}
.viewer td, .viewer tr, .twtable td, .twtable tr {border:1px solid [[ColorPalette::TertiaryDark]];}

.viewer pre {border:1px solid [[ColorPalette::SecondaryLight]]; background:[[ColorPalette::SecondaryPale]];}
.viewer code {color:[[ColorPalette::SecondaryDark]];}
.viewer hr {border:0; border-top:dashed 1px [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::TertiaryDark]];}

.highlight, .marked {background:[[ColorPalette::SecondaryLight]];}

.editor input {border:1px solid [[ColorPalette::PrimaryMid]];}
.editor textarea {border:1px solid [[ColorPalette::PrimaryMid]]; width:100%;}
.editorFooter {color:[[ColorPalette::TertiaryMid]];}

#backstageArea {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::TertiaryMid]];}
#backstageArea a {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstageArea a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; }
#backstageArea a.backstageSelTab {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
#backstageButton a {background:none; color:[[ColorPalette::Background]]; border:none;}
#backstageButton a:hover {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstagePanel {background:[[ColorPalette::Background]]; border-color: [[ColorPalette::Background]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]];}
.backstagePanelFooter .button {border:none; color:[[ColorPalette::Background]];}
.backstagePanelFooter .button:hover {color:[[ColorPalette::Foreground]];}
#backstageCloak {background:[[ColorPalette::Foreground]]; opacity:0.6; filter:'alpha(opacity:60)';}
/*}}}*/
/*{{{*/
* html .tiddler {height:1%;}

body {font-size:.75em; font-family:arial,helvetica; margin:0; padding:0;}

h1,h2,h3,h4,h5,h6 {font-weight:bold; text-decoration:none;}
h1,h2,h3 {padding-bottom:1px; margin-top:1.2em;margin-bottom:0.3em;}
h4,h5,h6 {margin-top:1em;}
h1 {font-size:1.35em;}
h2 {font-size:1.25em;}
h3 {font-size:1.1em;}
h4 {font-size:1em;}
h5 {font-size:.9em;}

hr {height:1px;}

a {text-decoration:none;}

dt {font-weight:bold;}

ol {list-style-type:decimal;}
ol ol {list-style-type:lower-alpha;}
ol ol ol {list-style-type:lower-roman;}
ol ol ol ol {list-style-type:decimal;}
ol ol ol ol ol {list-style-type:lower-alpha;}
ol ol ol ol ol ol {list-style-type:lower-roman;}
ol ol ol ol ol ol ol {list-style-type:decimal;}

.txtOptionInput {width:11em;}

#contentWrapper .chkOptionInput {border:0;}

.externalLink {text-decoration:underline;}

.indent {margin-left:3em;}
.outdent {margin-left:3em; text-indent:-3em;}
code.escaped {white-space:nowrap;}

.tiddlyLinkExisting {font-weight:bold;}
.tiddlyLinkNonExisting {font-style:italic;}

/* the 'a' is required for IE, otherwise it renders the whole tiddler in bold */
a.tiddlyLinkNonExisting.shadow {font-weight:bold;}

#mainMenu .tiddlyLinkExisting,
	#mainMenu .tiddlyLinkNonExisting,
	#sidebarTabs .tiddlyLinkNonExisting {font-weight:normal; font-style:normal;}
#sidebarTabs .tiddlyLinkExisting {font-weight:bold; font-style:normal;}

.header {position:relative;}
.header a:hover {background:transparent;}
.headerShadow {position:relative; padding:4.5em 0em 1em 1em; left:-1px; top:-1px;}
.headerForeground {position:absolute; padding:4.5em 0em 1em 1em; left:0px; top:0px;}

.siteTitle {font-size:3em;}
.siteSubtitle {font-size:1.2em;}

#mainMenu {position:absolute; left:0; width:10em; text-align:right; line-height:1.6em; padding:1.5em 0.5em 0.5em 0.5em; font-size:1.1em;}

#sidebar {position:absolute; right:3px; width:16em; font-size:.9em;}
#sidebarOptions {padding-top:0.3em;}
#sidebarOptions a {margin:0em 0.2em; padding:0.2em 0.3em; display:block;}
#sidebarOptions input {margin:0.4em 0.5em;}
#sidebarOptions .sliderPanel {margin-left:1em; padding:0.5em; font-size:.85em;}
#sidebarOptions .sliderPanel a {font-weight:bold; display:inline; padding:0;}
#sidebarOptions .sliderPanel input {margin:0 0 .3em 0;}
#sidebarTabs .tabContents {width:15em; overflow:hidden;}

.wizard {padding:0.1em 1em 0em 2em;}
.wizard h1 {font-size:2em; font-weight:bold; background:none; padding:0em 0em 0em 0em; margin:0.4em 0em 0.2em 0em;}
.wizard h2 {font-size:1.2em; font-weight:bold; background:none; padding:0em 0em 0em 0em; margin:0.4em 0em 0.2em 0em;}
.wizardStep {padding:1em 1em 1em 1em;}
.wizard .button {margin:0.5em 0em 0em 0em; font-size:1.2em;}
.wizardFooter {padding:0.8em 0.4em 0.8em 0em;}
.wizardFooter .status {padding:0em 0.4em 0em 0.4em; margin-left:1em;}
.wizard .button {padding:0.1em 0.2em 0.1em 0.2em;}

#messageArea {position:fixed; top:2em; right:0em; margin:0.5em; padding:0.5em; z-index:2000; _position:absolute;}
.messageToolbar {display:block; text-align:right; padding:0.2em 0.2em 0.2em 0.2em;}
#messageArea a {text-decoration:underline;}

.tiddlerPopupButton {padding:0.2em 0.2em 0.2em 0.2em;}
.popupTiddler {position: absolute; z-index:300; padding:1em 1em 1em 1em; margin:0;}

.popup {position:absolute; z-index:300; font-size:.9em; padding:0; list-style:none; margin:0;}
.popup .popupMessage {padding:0.4em;}
.popup hr {display:block; height:1px; width:auto; padding:0; margin:0.2em 0em;}
.popup li.disabled {padding:0.4em;}
.popup li a {display:block; padding:0.4em; font-weight:normal; cursor:pointer;}
.listBreak {font-size:1px; line-height:1px;}
.listBreak div {margin:2px 0;}

.tabset {padding:1em 0em 0em 0.5em;}
.tab {margin:0em 0em 0em 0.25em; padding:2px;}
.tabContents {padding:0.5em;}
.tabContents ul, .tabContents ol {margin:0; padding:0;}
.txtMainTab .tabContents li {list-style:none;}
.tabContents li.listLink { margin-left:.75em;}

#contentWrapper {display:block;}
#splashScreen {display:none;}

#displayArea {margin:1em 17em 0em 14em;}

.toolbar {text-align:right; font-size:.9em;}

.tiddler {padding:1em 1em 0em 1em;}

.missing .viewer,.missing .title {font-style:italic;}

.title {font-size:1.6em; font-weight:bold;}

.missing .subtitle {display:none;}
.subtitle {font-size:1.1em;}

.tiddler .button {padding:0.2em 0.4em;}

.tagging {margin:0.5em 0.5em 0.5em 0; float:left; display:none;}
.isTag .tagging {display:block;}
.tagged {margin:0.5em; float:right;}
.tagging, .tagged {font-size:0.9em; padding:0.25em;}
.tagging ul, .tagged ul {list-style:none; margin:0.25em; padding:0;}
.tagClear {clear:both;}

.footer {font-size:.9em;}
.footer li {display:inline;}

.annotation {padding:0.5em; margin:0.5em;}

* html .viewer pre {width:99%; padding:0 0 1em 0;}
.viewer {line-height:1.4em; padding-top:0.5em;}
.viewer .button {margin:0em 0.25em; padding:0em 0.25em;}
.viewer blockquote {line-height:1.5em; padding-left:0.8em;margin-left:2.5em;}
.viewer ul, .viewer ol {margin-left:0.5em; padding-left:1.5em;}

.viewer table, table.twtable {border-collapse:collapse; margin:0.8em 1.0em;}
.viewer th, .viewer td, .viewer tr,.viewer caption,.twtable th, .twtable td, .twtable tr,.twtable caption {padding:3px;}
table.listView {font-size:0.85em; margin:0.8em 1.0em;}
table.listView th, table.listView td, table.listView tr {padding:0px 3px 0px 3px;}

.viewer pre {padding:0.5em; margin-left:0.5em; font-size:1.2em; line-height:1.4em; overflow:auto;}
.viewer code {font-size:1.2em; line-height:1.4em;}

.editor {font-size:1.1em;}
.editor input, .editor textarea {display:block; width:100%; font:inherit;}
.editorFooter {padding:0.25em 0em; font-size:.9em;}
.editorFooter .button {padding-top:0px; padding-bottom:0px;}

.fieldsetFix {border:0; padding:0; margin:1px 0px 1px 0px;}

.sparkline {line-height:1em;}
.sparktick {outline:0;}

.zoomer {font-size:1.1em; position:absolute; overflow:hidden;}
.zoomer div {padding:1em;}

* html #backstage {width:99%;}
* html #backstageArea {width:99%;}
#backstageArea {display:none; position:relative; overflow: hidden; z-index:150; padding:0.3em 0.5em 0.3em 0.5em;}
#backstageToolbar {position:relative;}
#backstageArea a {font-weight:bold; margin-left:0.5em; padding:0.3em 0.5em 0.3em 0.5em;}
#backstageButton {display:none; position:absolute; z-index:175; top:0em; right:0em;}
#backstageButton a {padding:0.1em 0.4em 0.1em 0.4em; margin:0.1em 0.1em 0.1em 0.1em;}
#backstage {position:relative; width:100%; z-index:50;}
#backstagePanel {display:none; z-index:100; position:absolute; width:90%; margin:0em 3em 0em 3em; padding:1em 1em 1em 1em;}
.backstagePanelFooter {padding-top:0.2em; float:right;}
.backstagePanelFooter a {padding:0.2em 0.4em 0.2em 0.4em;}
#backstageCloak {display:none; z-index:20; position:absolute; width:100%; height:100px;}

.whenBackstage {display:none;}
.backstageVisible .whenBackstage {display:block;}
/*}}}*/
/***
StyleSheet for use when a translation requires any css style changes.
This StyleSheet can be used directly by languages such as Chinese, Japanese and Korean which need larger font sizes.
***/
/*{{{*/
body {font-size:0.8em;}
#sidebarOptions {font-size:1.05em;}
#sidebarOptions a {font-style:normal;}
#sidebarOptions .sliderPanel {font-size:0.95em;}
.subtitle {font-size:0.8em;}
.viewer table.listView {font-size:0.95em;}
/*}}}*/
/*{{{*/
@media print {
#mainMenu, #sidebar, #messageArea, .toolbar, #backstageButton, #backstageArea {display: none ! important;}
#displayArea {margin: 1em 1em 0em 1em;}
/* Fixes a feature in Firefox 1.5.0.2 where print preview displays the noscript content */
noscript {display:none;}
}
/*}}}*/
<!--{{{-->
<div class='header' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</div>
<div id='mainMenu' refresh='content' tiddler='MainMenu'></div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>)</div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser excludeLists'></span></div>
<!--}}}-->
To get started with this blank TiddlyWiki, you'll need to modify the following tiddlers:
* SiteTitle & SiteSubtitle: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)
* MainMenu: The menu (usually on the left)
* DefaultTiddlers: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened
You'll also need to enter your username for signing your edits: <<option txtUserName>>
These InterfaceOptions for customising TiddlyWiki are saved in your browser

Your username for signing your edits. Write it as a WikiWord (eg JoeBloggs)

<<option txtUserName>>
<<option chkSaveBackups>> SaveBackups
<<option chkAutoSave>> AutoSave
<<option chkRegExpSearch>> RegExpSearch
<<option chkCaseSensitiveSearch>> CaseSensitiveSearch
<<option chkAnimate>> EnableAnimations

----
Also see [[AdvancedOptions]]
<<importTiddlers>>
<pre xml:lang="latex">\frac{22}{4}</pre>
If you've got a singularity in your velocity field, the quantity "curl" (i.e, local angular velocity) might be zero everywhere in the domain, yet the circulation around the singularity might still be non-zero.

As an example, consider the velocity field associated with a 2-D point vortex:

[img[http://latex.codecogs.com/gif.latex?\vec{v}(r,\theta)=\frac{\Gamma}{2\pi{r}}\vec{i}_{\theta}]]

The curl is then:

[img[http://latex.codecogs.com/gif.latex?\nabla\times\vec{v}=\vec{i}_{r}\times\frac{\partial}{\partial{r}}(\frac{\Gamma}{2\pi{r}}\vec{i}_{\theta})+\vec{i}_{\theta}\times\frac{1}{r}\frac{\partial}{\partial{\theta}}(\frac{\Gamma}{2\pi{r}}\vec{i}_{\theta})=-\frac{\Gamma}{2\pi{r}^{2}}(\vec{i}_{r}\times\vec{i}_{\theta}+\vec{i}_{\theta}\times\vec{i}_{r})=\vec{0}]]

However, the circulation on a (circular) path of radius R containing the origin is:

[img[http://latex.codecogs.com/gif.latex?C=\int_{0}^{2\pi}\vec{v}\cdot\vec{i}_{\theta}Rd\theta=\Gamma]]

The interpretation is as follows:
Place a small paddlewheel with a vertical pole in it some distance from the vortex (the origin). The paddle-wheel will of course circle about the origin, BUT IT WILL NOT ROTATE ABOUT ITS OWN AXIS, due to zero curl.

''NOTE: This example was done for John Kent on ABC ~Science-Matters news group as a demonstration of the capabilities of TW Math designed by Morris Gray''
<<newTiddler title:'ADemoEquation' template:demoEditTemplate  text:'' tag: 'demo' label: 'A Click Only Demo'>>
[img[http://latex.codecogs.com/gif.latex?\nabla\times\vec{v}=\vec{i}_{r}\times\frac{\partia l}{\partial{r}}(\frac{\Gamma}{2\pi{r}}\vec{i}_{\th eta})+\vec{i}_{\theta}\times\frac{1}{r}\frac{\partial}{\partial{\theta}}(\frac{\Gamma}{2\pi{r}}\vec{ i}_{\theta})=-\frac{\Gamma}{2\pi{r}^{2}}(\vec{i}_{r}\times\vec{i }_{\theta}+\vec{i}_{\theta}\times\vec{i}_{r})=\vec {0}]]
----
<html><hide linebreaks>
@@font-size:14pt;''Calculating annual acre feet (AF) pumped @@color:#00F;(US gallons)@@@@<p></p>
''The easiest way to calculate total acre feet'' used in a year is to
multiply the gallons per minute rate you pumped the well, times the
number of hours the well was pumped for the year, times the numerical
factor .0001841.<br><br>

<blockquote>
''The Formula is:''<br>
[img[http://latex.codecogs.com/gif.latex?Rate \times Hours \times .0001841 = AF per\:  year]]
<br>
''Example:''<br>
[img[http://latex.codecogs.com/gif.latex?600 gpm \times 1500 Hours \times .0001841 = 165.7 AF per\: year]]
</blockquote>

<br>
<br>
''The long way to calculate this is'' to convert gallons per minute (GPM) to
gallons per hour (GPH) by multiplying GPM times 60, then multiplying
GPH times hours pumped for the year, and finally dividing by 325,851
(number of gallons in an AF)<br><br>
<blockquote>
''The Formula is:''<br><br>
[img[http://latex.codecogs.com/gif.latex?\frac{GPM \times 60 \times Hours }{325,851} = AF per\: year.]]<br>
''Example:''<br><br>
[img[http://latex.codecogs.com/gif.latex?\frac{600 GPM \times 60 \times 1500 }{325,851} = 165.7 AF per\: year.]]
</blockquote>
</html>

<<attach inline>>
text/plain
.txt .text .js .vbs .asp .cgi .pl
----
text/html
.htm .html .hta .htx .mht
----
text/comma-separated-values
.csv
----
text/javascript
.js
----
text/css
.css
----
text/xml
.xml .xsl .xslt
----
image/gif
.gif
----
image/jpeg
.jpg .jpe .jpeg
----
image/png
.png
----
image/bmp
.bmp
----
image/tiff
.tif .tiff
----
audio/basic
.au .snd
----
audio/wav
.wav
----
audio/x-pn-realaudio
.ra .rm .ram
----
audio/x-midi
.mid .midi
----
audio/mp3
.mp3
----
audio/m3u
.m3u
----
video/x-ms-asf
.asf
----
video/avi
.avi
----
video/mpeg
.mpg .mpeg
----
video/quicktime
.qt .mov .qtvr
----
application/pdf
.pdf
----
application/rtf
.rtf
----
application/postscript
.ai .eps .ps
----
application/wordperfect
.wpd
----
application/mswrite
.wri
----
application/msexcel
.xls .xls3 .xls4 .xls5 .xlw
----
application/msword
.doc
----
application/mspowerpoint
.ppt .pps
----
application/x-director
.swa
----
application/x-shockwave-flash
.swf
----
application/x-zip-compressed
.zip
----
application/x-gzip
.gz
----
application/x-rar-compressed
.rar
----
application/octet-stream
.com .exe .dll .ocx
----
application/java-archive
.jar
[img[http://latex.codecogs.com/gif.latex?$$ FORMULA GOES HERE $$]]
{{textcenter {
[[Open in a new window|TYPE URL HERE]]&nbsp;&raquo;<<tiddler NavButtons>><html><div align="center"><iframe  src ="TYPE URL HERE" width="100%" align="center" height="600" scrolling="auto" frameborder="0" allowtransparency style="border:none;"></iframe></div></html>}}}
/***
!!!<<gradient horiz #fc3 #fff >><<tiddler RefreshStyles>>&nbsp;ButtonStyle>>/%==================================================%/
***/

.button {border: solid 0px;}

input.btn{
   color:#008;
   font-family:Trebuchet MS,aerial,helvetica,sans-serif;
   font-size:100%;
   font-weight:normal;
   background-color:#eee;
   background:url("http://img520.imageshack.us/img520/8688/mainmenugray7ef.gif") repeat-x top left;top left;
   border:1px solid;
   border-top-color:#009;
   border-left-color:#009;
   border-right-color:#009;
   border-bottom-color:#009;
   -moz-border-radius : .25em 0.25em 0.25em 0.25em;
}


input.btnhov{
   color:#a00;
   background:#fff;
   background:url("http://img520.imageshack.us/img520/8688/mainmenugray7ef.gif") repeat-x top left;top left;
   border-top-color:#c06;
   border-left-color:#c06;
   border-right-color:#c06;
   border-bottom-color:#c06;
   -moz-border-radius : .25em 0.25em 0.25em 0.25em;
}
/***
|Name:|CloseOnCancelPlugin|
|Description:|Closes the tiddler if you click new tiddler then cancel. Default behaviour is to leave it open|
|Version:|3.0.1 ($Rev: 3861 $)|
|Date:|$Date: 2008-03-08 10:53:09 +1000 (Sat, 08 Mar 2008) $|
|Source:|http://mptw.tiddlyspot.com/#CloseOnCancelPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License:|http://mptw.tiddlyspot.com/#TheBSDLicense|
***/
//{{{
merge(config.commands.cancelTiddler,{

	handler_mptw_orig_closeUnsaved: config.commands.cancelTiddler.handler,

	handler: function(event,src,title) {
		this.handler_mptw_orig_closeUnsaved(event,src,title);
		if (!store.tiddlerExists(title) && !store.isShadowTiddler(title))
			story.closeTiddler(title,true);
	 	return false;
	}

});

//}}}

<script label="$2">
	var tiddler=story.findContainingTiddler(place);
	story.displayTiddler(tiddler,"$1");
	story.closeTiddler(tiddler.id.substr(7)); // close self
	return false;
</script>
Unit Conversion
http://www.unitconversion.org/
----
length
http://www.unitconversion.org/unit_converter/length.html
----
weight
http://www.unitconversion.org/unit_converter/weight.html
----
currency
http://www.unitconversion.org/unit_converter/currency.html
----
volume
http://www.unitconversion.org/unit_converter/volume.html
----
temperature
http://www.unitconversion.org/unit_converter/temperature.html
----
area
http://www.unitconversion.org/unit_converter/area.html
----
pressure
http://www.unitconversion.org/unit_converter/pressure.html
----
energy
http://www.unitconversion.org/unit_converter/energy.html
----
power
http://www.unitconversion.org/unit_converter/power.html
----
force
http://www.unitconversion.org/unit_converter/force.html
----
time
http://www.unitconversion.org/unit_converter/time.html
----
velocity
http://www.unitconversion.org/unit_converter/velocity.html
----
angle
http://www.unitconversion.org/unit_converter/angle.html
----
fuel-consumption
http://www.unitconversion.org/unit_converter/fuel-consumption.html
----
numbers
http://www.unitconversion.org/unit_converter/numbers.html
----
data-storage
http://www.unitconversion.org/unit_converter/data-storage.html
----
velocity-angular
http://www.unitconversion.org/unit_converter/velocity-angular.html
----
acceleration
http://www.unitconversion.org/unit_converter/acceleration.html
----
density
http://www.unitconversion.org/unit_converter/density.html
----
specific-volume
http://www.unitconversion.org/unit_converter/specific-volume.html
----
moment-of-inertia
http://www.unitconversion.org/unit_converter/moment-of-inertia.html
----
moment-of-force
http://www.unitconversion.org/unit_converter/moment-of-force.html
----
torque
http://www.unitconversion.org/unit_converter/torque.html
----
fuel-efficiency-mass
http://www.unitconversion.org/unit_converter/fuel-efficiency-mass.html
----
fuel-efficiency-volume
http://www.unitconversion.org/unit_converter/fuel-efficiency-volume.html
----
temperature-interval
http://www.unitconversion.org/unit_converter/temperature-interval.html
----
thermal-expansion
http://www.unitconversion.org/unit_converter/thermal-expansion.html
----
thermal-resistance
http://www.unitconversion.org/unit_converter/thermal-resistance.html
----
thermal-conductivity
http://www.unitconversion.org/unit_converter/thermal-conductivity.html
----
specific-heat-capacity
http://www.unitconversion.org/unit_converter/specific-heat-capacity.html
----
heat-density
http://www.unitconversion.org/unit_converter/heat-density.html
----
heat-flux-density
http://www.unitconversion.org/unit_converter/heat-flux-density.html
----
heat-transfer-coefficient
http://www.unitconversion.org/unit_converter/heat-transfer-coefficient.html
----
flow
http://www.unitconversion.org/unit_converter/flow.html
----
flow-mass
http://www.unitconversion.org/unit_converter/flow-mass.html
----
flow-molar
http://www.unitconversion.org/unit_converter/flow-molar.html
----
mass-flux-density
http://www.unitconversion.org/unit_converter/mass-flux-density.html
----
concentration-molar
http://www.unitconversion.org/unit_converter/concentration-molar.html
----
concentration-solution
http://www.unitconversion.org/unit_converter/concentration-solution.html
----
viscosity-dynamic
http://www.unitconversion.org/unit_converter/viscosity-dynamic.html
----
surface-tension
http://www.unitconversion.org/unit_converter/surface-tension.html
----
permeability
http://www.unitconversion.org/unit_converter/permeability.html
----
sound
http://www.unitconversion.org/unit_converter/sound.html
----
luminance
http://www.unitconversion.org/unit_converter/luminance.html
----
luminous-intensity
http://www.unitconversion.org/unit_converter/luminous-intensity.html
----
illumination
http://www.unitconversion.org/unit_converter/illumination.html
----
digital-image-resolution
http://www.unitconversion.org/unit_converter/digital-image-resolution.html
----
frequency-wavelength
http://www.unitconversion.org/unit_converter/frequency-wavelength.html
----
charge
http://www.unitconversion.org/unit_converter/charge.html
----
linear-charge-density
http://www.unitconversion.org/unit_converter/linear-charge-density.html
----
surface-charge-density
http://www.unitconversion.org/unit_converter/surface-charge-density.html
----
volume-charge-density
http://www.unitconversion.org/unit_converter/volume-charge-density.html
----
current
http://www.unitconversion.org/unit_converter/current.html
----
linear-current-density
http://www.unitconversion.org/unit_converter/linear-current-density.html
----
surface-current-density
http://www.unitconversion.org/unit_converter/surface-current-density.html
----
electric-field-strength
http://www.unitconversion.org/unit_converter/electric-field-strength.html
----
electric-potential
http://www.unitconversion.org/unit_converter/electric-potential.html
----
electric-resistance
http://www.unitconversion.org/unit_converter/electric-resistance.html
----
electric-resistivity
http://www.unitconversion.org/unit_converter/electric-resistivity.html
----
electric-conductance
http://www.unitconversion.org/unit_converter/electric-conductance.html
----
electric-conductivity
http://www.unitconversion.org/unit_converter/electric-conductivity.html
----
electrostatic-capacitance
http://www.unitconversion.org/unit_converter/electrostatic-capacitance.html
----
inductance
http://www.unitconversion.org/unit_converter/inductance.html
----
magnetomotive-force
http://www.unitconversion.org/unit_converter/magnetomotive-force.html
----
magnetic-field-strength
http://www.unitconversion.org/unit_converter/magnetic-field-strength.html
----
magnetic-flux
http://www.unitconversion.org/unit_converter/magnetic-flux.html
----
magnetic-flux-density
http://www.unitconversion.org/unit_converter/magnetic-flux-density.html
----
radiation
http://www.unitconversion.org/unit_converter/radiation.html
----
radiation-activity
http://www.unitconversion.org/unit_converter/radiation-activity.html
----
radiation-exposure
http://www.unitconversion.org/unit_converter/radiation-exposure.html
----
radiation-absorbed-dose
http://www.unitconversion.org/unit_converter/radiation-absorbed-dose.html
----
prefixes
http://www.unitconversion.org/unit_converter/prefixes.html
----
data-transfer
http://www.unitconversion.org/unit_converter/data-transfer.html
----
eu-currency
http://www.unitconversion.org/unit_converter/eu-currency.html
----
typography
http://www.unitconversion.org/unit_converter/typography.html
----
volume-lumber
http://www.unitconversion.org/unit_converter/volume-lumber.html
----

/***
|Name|CoreTweaks|
|Source|http://www.TiddlyTools.com/#CoreTweaks|
|Version|n/a|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2.0|
|Type|plugin|
|Requires||
|Overrides|various|
|Description|a small collection of overrides to TW core functions   |
This tiddler contains changes TW core functions to provide minor changes in standard features or behavior.  It is hoped that some of these tweaks may someday be added into the TW core, so that these adjustments will be available without needing these add-on definitions.
>''Note: the changes contained in this tiddler are generally applicable for version 2.4.1 of TiddlyWiki. Please view [[CoreTweaksArchive]] for tweaks that may be used with earlier versions of TiddlyWiki.''
----
***/
// // {{block{
/***
!!!824 ~WindowTitle - alternative to combined ~SiteTitle/~SiteSubtitle in window titlebar
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/824 - OPEN
This tweak allows definition of an optional [[WindowTitle]] tiddler that, when present, provides alternative text for display in the browser window's titlebar, instead of using the combined text content from [[SiteTitle]] and [[SiteSubtitle]] (which will still be displayed as usual in the TiddlyWiki document header area).

Note: this ticket replaces http://trac.tiddlywiki.org/ticket/401 (closed), which proposed using a custom [[PageTitle]] tiddler for this purpose.  ''If you were using the previous '401 ~PageTitle' tweak, you will need to rename [[PageTitle]] to [[WindowTitle]] to continue to use your custom window title text''
***/
//{{{
config.shadowTiddlers.WindowTitle='<<tiddler SiteTitle>> - <<tiddler SiteSubtitle>>';
window.getPageTitle=function() { return wikifyPlain('WindowTitle'); }
store.addNotification('WindowTitle',refreshPageTitle); // so title stays in sync with tiddler changes
//}}}
// // }}}}}}// // {{block{
/***
!!!823 apply option values via paramifiers (e.g. #chk...and #txt...)
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/823 - no ticket yet
This tweak extends and ''//replaces//'' the core {{{invokeParamifier()}}} function to support use of ''option paramifiers'' that set TiddlyWiki option values on-the-fly, directly from a document URL.

If a paramifier begins with 'chk' (checkbox) or 'txt' (text field), it's value will be automatically stored in {{{config.options.*}}}, adding to or overriding any existing 'chk' or 'txt' option values that may have already been loaded from browser cookies and/or assigned by the TW core or plugin initialization functions using hard-coded default values.  Note: option values that have been overriden by paramifiers are only applied during the current document session, and are not //automatically// retained.  However, if you edit an overridden option value during that session, then the modified value is, of course, saved in a browser cookie, as usual.
***/
//{{{
function invokeParamifier(params,handler)
{
	if(!params || params.length == undefined || params.length <= 1)
		return;
	for(var t=1; t<params.length; t++) {
		var p = config.paramifiers[params[t].name];
		if(p && p[handler] instanceof Function)
			p[handler](params[t].value);
		else { // not a paramifier with handler()... check for an 'option' prefix
			var h=config.optionHandlers[params[t].name.substr(0,3)];
			if (h && h.set instanceof Function)
				h.set(params[t].name,params[t].value);
		}
	}
}
//}}}
// // }}}}}}// // {{block{
/***
!!!784 allow tiddler sections in TiddlyLinks to be used as anchor points for intra-tiddler scrolling.  
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/784 - OPEN
You can use the tiddler section syntax within the {{{<<tiddler>>}}} macro to //transclude// a subsection of one tiddler into another (e.g., {{{<<tiddler SomeTiddler##SomeSection>>}}}).  However, if this syntax is used in a TiddlyLink (e.g., {{{[[SomeTiddler##SomeSection]]}}}), the entire reference is treated as a link to a (non-existent) tiddler that includes the section reference in the tiddler title itself.

This tweak extends the TiddlyLink and displayTiddler() processing so that section references in links can be used to auto-scroll to the indicated heading within a tiddler (i.e., the same 'anchor' behavior as {{{<a name="foo">}}} and {{{<a href="#foo">...</a>}}} when using HTML syntax).
***/
//{{{
Story.prototype.scrollToSection = function(title,section) {
	if (!title||!section) return; var t=this.getTiddler(title); if (!t) return null;
	var elems=t.getElementsByTagName('*');
	for (var i=0; i<elems.length; i++) { var e=elems[i];
		if (!['H1','H2','H3','H4','H5'].contains(e.nodeName)) continue;
		if (getPlainText(e).indexOf(section)!=-1) {
			var delay=config.options.chkAnimate?config.animDuration+1:0; // scroll *after* tiddler animation
			setTimeout('window.scrollTo(0,'+findPosY(e)+')',delay);
			return e;
		}
	}
}
window.createTiddlyLink_sectionanchor=window.createTiddlyLink;
window.createTiddlyLink=function(place,title) {
	var t=story.findContainingTiddler(place); var tid=t?t.getAttribute('tiddler'):'';
	var parts=title.split(config.textPrimitives.sectionSeparator);
	if (!parts[0].length) parts[0]=tid;  // default to current tiddler for '##section' links
	if (parts[1]) arguments[1]=parts[0]; // trim section from tiddler title
	var btn=createTiddlyLink_sectionanchor.apply(this,arguments);
	if (parts[1]) btn.setAttribute('section',parts[1]); // save section
	return btn;
}
window.onClickTiddlerLink_sectionanchor=window.onClickTiddlerLink;
window.onClickTiddlerLink=function(ev) {
	var e=ev||window.event;	var target=resolveTarget(e); var title=null;
	while (target!=null && title==null) {
		title=target.getAttribute('tiddlyLink');
		section=target.getAttribute('section');
		target=target.parentNode;
	} 
	var t=story.findContainingTiddler(target); var tid=t?t.getAttribute('tiddler'):'';
	if (title!=tid||!section) onClickTiddlerLink_sectionanchor.apply(this,arguments); // avoid excess scrolling
	story.scrollToSection(title,section);
	return false;
}
Story.prototype.displayTiddler_sectionanchor=Story.prototype.displayTiddler;
Story.prototype.displayTiddler = function(srcElement,tiddler)
{
	var title=(tiddler instanceof Tiddler)?tiddler.title:tiddler;
	var parts=title.split(config.textPrimitives.sectionSeparator);
	if (parts[0].length && parts[1]) arguments[1]=parts[0]; // trim section from tiddler title
	this.displayTiddler_sectionanchor.apply(this,arguments);
	story.scrollToSection(parts[0],parts[1]);
}
config.formatterHelpers.isExternalLink_sectionanchor=config.formatterHelpers.isExternalLink;
config.formatterHelpers.isExternalLink=function(link) {
	if (link.indexOf(config.textPrimitives.sectionSeparator)!=-1) return false;
	return config.formatterHelpers.isExternalLink_sectionanchor.apply(this,arguments);
}
//}}}
// // }}}}}}// // {{block{
/***
!!!757 add removeCookie() function
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/757 - OPEN
When a TW option is reset to it's hard-coded default value, the corresponding browser cookie is usually just set to that default value, which results in an accumulation of unnecessary cookies.  Unfortunately, there is a browser-imposed limit on the number of cookies that are stored for any given domain and, when that limit is reached, the browser starts removing cookies on it's own, thereby unexpectedly discarding some TW settings.  In order to allow core and/or plugin code to 'clean up after themselves' and remove unneeded cookies, this tweak provides a new 'core' function, removeCookie() that is the inverse of the existing saveOptionCookie(), and results in the actual deletion of the browser cookie associated with the specified TW option.
***/
//{{{
if (window.removeCookie===undefined) {
	window.removeCookie=function(name) {
		document.cookie = name+'=; expires=Thu, 01-Jan-1970 00:00:01 UTC; path=/;'; 
	}
}
//}}}
// // }}}}}}// // {{block{
/***
!!!749 ieCreatePath fixup for handling / in UNC paths
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/749 - OPEN
***/
//{{{
// tweak ieCreatePath to add fallback check for / (in addition to current check for \)
var fn=window.ieCreatePath;
fn=fn.toString().replace(/function ieCreatePath\(path\)/,'window.ieCreatePath=function(path)');
fn=fn.toString().replace(/var pos = path.lastIndexOf\("\\\\"\);/,
	'var pos=path.lastIndexOf("\\\\"); if(pos==-1) pos=path.lastIndexOf("/");');
eval(fn);
//}}}
// // }}}}}}// // {{block{
/***
!!!741 allow """<hr>""" directly in wiki-formatted content
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/741 - OPEN
This tweak extends the 'horizontal rule' formatter to recognize {{{<hr>}}} (or {{{<hr />}}}) directly in tiddler content without being enclosed within an HTML block (i.e., {{{<html><hr></html>}}}).  This allows HR elements to be used within table cell content, bullet items and other ''line-mode'' syntax, where the required use of newlines surrounding the """----""" syntax would interfere with the enclosing line-mode formatting.
***/
//{{{
config.formatters[config.formatters.findByField('name','rule')].match+='|<hr ?/?>\\n?';
//}}}
// // }}}}}}// // {{block{
/***
!!!683 FireFox3 Import bug: 'browse' button replacement
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/683 - OPEN
The web standard 'type=file' input control that has been used as a local path/file picker for TiddlyWiki no longer works as expected in FireFox3, which has, for security reasons, limited javascript access to this control so that *no* local filesystem path information can be revealed, even when it is intentional and necessary, as it is with TiddlyWiki.  This tweak provides alternative HTML source that patches the backstage import panel.  It replaces the 'type=file' input control with a text+button combination of controls that invokes a system-native secure 'file-chooser' dialog box to provide TiddlyWiki with access to a complete path+filename so that TW functions properly locate user-selected local files.
>Note: ''This tweak also requires http://trac.tiddlywiki.org/ticket/604 - cross-platform askForFilename()''
***/
//{{{
if (window.Components) {
	var fixhtml='<input name="txtBrowse" style="width:30em"><input type="button" value="..."'
		+' onClick="window.browseForFilename(this.previousSibling,true)">';
	var cmi=config.macros.importTiddlers;
	cmi.step1Html=cmi.step1Html.replace(/<input type='file' size=50 name='txtBrowse'>/,fixhtml);
}

merge(config.messages,{selectFile:'Please enter or select a file'}); // ready for I18N translation

window.browseForFilename=function(target,mustExist) { // note: both params are optional
	var msg=config.messages.selectFile;
	if (target && target.title) msg=target.title; // use target field tooltip (if any) as dialog prompt text
	// get local path for current document
	var path=getLocalPath(document.location.href);
	var p=path.lastIndexOf('/'); if (p==-1) p=path.lastIndexOf('\\'); // Unix or Windows
	if (p!=-1) path=path.substr(0,p+1); // remove filename, leave trailing slash
	var file=''
	var result=window.askForFilename(msg,path,file,mustExist); // requires #604
	if (target && result.length) // set target field and trigger handling
		{ target.value=result; target.onchange(); }
	return result; 
}
//}}}
// // }}}}}}// // {{block{
/***
!!!604 cross-platform askForFilename()
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/604 - OPEN
invokes a system-native secure 'file-chooser' dialog box to provide TiddlyWiki with access to a complete path+filename so that TW functions properly locate user-selected local files.
***/
//{{{
window.askForFilename=function(msg,path,file,mustExist) {
	var r = window.mozAskForFilename(msg,path,file,mustExist);
	if(r===null || r===false)
		r = window.ieAskForFilename(msg,path,file,mustExist);
	if(r===null || r===false)
		r = window.javaAskForFilename(msg,path,file,mustExist);
	if(r===null || r===false)
		r = prompt(msg,path+file);
	return r||'';
}

window.mozAskForFilename=function(msg,path,file,mustExist) {
	if(!window.Components) return false;
	try {
		netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
		var nsIFilePicker = window.Components.interfaces.nsIFilePicker;
		var picker = Components.classes['@mozilla.org/filepicker;1'].createInstance(nsIFilePicker);
		picker.init(window, msg, mustExist?nsIFilePicker.modeOpen:nsIFilePicker.modeSave);
		var thispath = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
		thispath.initWithPath(path);
		picker.displayDirectory=thispath;
		picker.defaultExtension='html';
		picker.defaultString=file;
		picker.appendFilters(nsIFilePicker.filterAll|nsIFilePicker.filterText|nsIFilePicker.filterHTML);
		if (picker.show()!=nsIFilePicker.returnCancel)
			var result=picker.file.persistentDescriptor;
	}
	catch(ex) { displayMessage(ex.toString()); }
	return result;
}

window.ieAskForFilename=function(msg,path,file,mustExist) {
	if(!config.browser.isIE) return false;
	try {
		var s = new ActiveXObject('UserAccounts.CommonDialog');
		s.Filter='All files|*.*|Text files|*.txt|HTML files|*.htm;*.html|';
		s.FilterIndex=3; // default to HTML files;
		s.InitialDir=path;
		s.FileName=file;
		return s.showOpen()?s.FileName:'';
	}
	catch(ex) { displayMessage(ex.toString()); }
	return result;
}

window.javaAskForFilename=function(msg,path,file,mustExist) {
	if(!document.applets['TiddlySaver']) return false;
	// TBD: implement java-based askFile(...) function
	try { return document.applets['TiddlySaver'].askFile(msg,path,file,mustExist); } 
	catch(ex) { displayMessage(ex.toString()); }
}
//}}}
// // }}}}}}// // {{block{
/***
!!!676 #story:... paramifier
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/676 - OPEN
extends #story:... to scan the specified 'story' tiddler content for embedded links, rather than simply parsing the content as a space-separated bracketed list.  This allows links from ''any'' tiddler to be used as a story, regardless of other wiki-syntax contained in that tiddler.  If specified tiddler is a shadow, fallback to using parseParams() to extract the list of links.
***/
//{{{
config.paramifiers.story = {
	onstart: function(v) {
		var t=store.getTiddler(v); if (t) t.changed();
		var list=t?t.links:store.getTiddlerText(v,'').parseParams('open',null,false);
		story.displayTiddlers(null,list);
	}
};
//}}}
// // }}}}}}// // {{block{
/***
!!!664 Loose links (case-folded/space-folded wiki words)
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/664 - OPEN
This tweak matches non-WikiWord variations of mixed-case and/or added/omitted spaces within double-bracketed text with titles of //existing// tiddlers, using a 'loose' (case-folded/space-folded) comparison.  This allows text that occurs in normal prose to be more easily linked to tiddler titles by using double-brackets without the full 'pretty link' syntax.  For example:
{{{
[[CoreTweaks]], [[coreTweaks]], [[core tweaks]],
[[CORE TWEAKS]], [[CoRe TwEaKs]], [[coreTWEAKS]]
}}}
>[[CoreTweaks]], [[coreTweaks]], [[core tweaks]],
>[[CORE TWEAKS]], [[CoRe TwEaKs]], [[coreTWEAKS]]
Configuration:
><<option chkLooseLinks>> Allow case-folded and/or space-folded text to link to existing tiddler titles
>"""<<option chkLooseLinks>>"""
***/
//{{{
if (!config.options.chkLooseLinks)
	config.options.chkLooseLinks=false; // default to standard behavior
window.caseFold_createTiddlyLink = window.createTiddlyLink;
window.createTiddlyLink = function(place,title,includeText,className) {
	var btn=window.caseFold_createTiddlyLink.apply(this,arguments); // create core link
	if (!config.options.chkLooseLinks) return btn;
	if (store.getTiddlerText(title)) return btn; // matching tiddler (or shadow) exists
	var target=title.toLowerCase().replace(/\s/g,'');
	var tids=store.getTiddlers('title');
	for (var t=0; t<tids.length; t++) {
		if (tids[t].title.toLowerCase().replace(/\s/g,'')==target) {
			var i=getTiddlyLinkInfo(tids[t].title,className);
			btn.setAttribute('tiddlyLink',tids[t].title);
			btn.title=i.subTitle;
			btn.className=i.classes;
			break;
		}
	}
	return btn;
}
//}}}
// // }}}}}}// // {{block{
/***
!!!657 wrap tabs onto multiple lines
***/

// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/657 - OPEN
This tweak inserts an extra space element following each tab, allowing them to wrap onto multiple lines if needed.
***/
//{{{
config.macros.tabs.handler = function(place,macroName,params)
{
	var cookie = params[0];
	var numTabs = (params.length-1)/3;
	var wrapper = createTiddlyElement(null,'div',null,'tabsetWrapper ' + cookie);
	var tabset = createTiddlyElement(wrapper,'div',null,'tabset');
	tabset.setAttribute('cookie',cookie);
	var validTab = false;
	for(var t=0; t<numTabs; t++) {
		var label = params[t*3+1];
		var prompt = params[t*3+2];
		var content = params[t*3+3];
		var tab = createTiddlyButton(tabset,label,prompt,this.onClickTab,'tab tabUnselected');
		createTiddlyElement(tab,'span',null,null,' ',{style:'font-size:0pt;line-height:0px'}); // ELS
		tab.setAttribute('tab',label);
		tab.setAttribute('content',content);
		tab.title = prompt;
		if(config.options[cookie] == label)
			validTab = true;
	}
	if(!validTab)
		config.options[cookie] = params[1];
	place.appendChild(wrapper);
	this.switchTab(tabset,config.options[cookie]);
};
//}}}
// // }}}}}}// // {{block{
/***
!!!637 TiddlyLink tooltip - custom formatting
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/637 - OPEN
This tweak modifies the tooltip format that appears when you mouseover a link to a tiddler.  It adds an option to control the date format, as well as displaying the size of the tiddler (in bytes)

Tiddler link tooltip format:
{{stretch{<<option txtTiddlerLinkTootip>>}}}
^^where: %0=title, %1=username, %2=modification date, %3=size in bytes, %4=description slice^^
Tiddler link tooltip date format:
{{stretch{<<option txtTiddlerLinkTooltipDate>>}}}
***/
//{{{
config.messages.tiddlerLinkTooltip='%0 - %1, %2 (%3 bytes) - %4';
config.messages.tiddlerLinkTooltipDate='DDD, MMM DDth YYYY 0hh12:0mm AM';

config.options.txtTiddlerLinkTootip=
	config.options.txtTiddlerLinkTootip||config.messages.tiddlerLinkTooltip;
config.options.txtTiddlerLinkTooltipDate=
	config.options.txtTiddlerLinkTooltipDate||config.messages.tiddlerLinkTooltipDate;

Tiddler.prototype.getSubtitle = function() {
	var modifier = this.modifier;
	if(!modifier) modifier = config.messages.subtitleUnknown;
	var modified = this.modified;
	if(modified) modified = modified.formatString(config.options.txtTiddlerLinkTooltipDate);
	else modified = config.messages.subtitleUnknown;
	var descr=store.getTiddlerSlice(this.title,'Description')||'';
	return config.options.txtTiddlerLinkTootip.format([this.title,modifier,modified,this.text.length,descr]);
};
//}}}
// // }}}}}}// // {{block{
/***
!!!628 hide 'no such macro' errors
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/628 - OPEN
When invoking a macro that is not defined, this tweak prevents the display of the 'error in macro... no such macro' message.  This is useful when rendering tiddler content or templates that reference macros that are defined by //optional// plugins that have not been installed in the current document.

<<option chkHideMissingMacros>> hide 'no such macro' error messages
***/
//{{{
if (config.options.chkHideMissingMacros===undefined)
	config.options.chkHideMissingMacros=false;

window.coreTweaks_missingMacro_invokeMacro = window.invokeMacro;
window.invokeMacro = function(place,macro,params,wikifier,tiddler) {
	if (!config.macros[macro] || !config.macros[macro].handler)
		if (config.options.chkHideMissingMacros) return;
	window.coreTweaks_missingMacro_invokeMacro.apply(this,arguments);
}
//}}}
// // }}}}}}// // {{block{
/***
!!!609/610 toolbars - separators and transclusion
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/609 - OPEN (separators)
http://trac.tiddlywiki.org/ticket/610 - OPEN (wikify tiddler/slice/section content)
These tweaks extend the """<<toolbar>>""" macro to permit use of '|' as separators, as well as recognizing references to tiddlernames, slices, or sections and rendering their content inline within the toolbar
''see [[ToolbarCommands]] for examples of how these features can be used''
***/
//{{{
merge(config.macros.toolbar,{
	separator: '|'
	});
config.macros.toolbar.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
	for(var t=0; t<params.length; t++) {
		var c = params[t];
		switch(c) {
			case '|':  // ELS - SEPARATOR
			case '!':  // ELS - SEPARATOR (alternative for use in tiddler slices)
				createTiddlyText(place,this.separator); // ELS
				break; // ELS
			case '>':
				var btn = createTiddlyButton(place,this.moreLabel,this.morePrompt,config.macros.toolbar.onClickMore);
				addClass(btn,'moreCommand');
				var e = createTiddlyElement(place,'span',null,'moreCommand');
				e.style.display = 'none';
				place = e;
				break;
			default:
				var theClass = '';
				switch(c.substr(0,1)) {
					case '+':
						theClass = 'defaultCommand';
						c = c.substr(1);
						break;
					case '-':
						theClass = 'cancelCommand';
						c = c.substr(1);
						break;
				}
				if(c in config.commands)

					this.createCommand(place,c,tiddler,theClass);
				else { // ELS - WIKIFY TIDDLER/SLICE/SECTION
					if (c.substr(0,1)=='~') c=c.substr(1); // ignore leading ~
					var txt=store.getTiddlerText(c);
					if (txt) {
						txt=txt.replace(/^\n*/,'').replace(/\n*$/,''); // trim any leading/trailing newlines
						txt=txt.replace(/^\{\{\{\n/,'').replace(/\n\}\}\}$/,''); // trim PRE format wrapper if any
						wikify(txt,createTiddlyElement(place,'span'),null,tiddler);
					}
				} // ELS - end WIKIFY CONTENT
				break;
		}
	}
};
//}}}
// // }}}}}}// // {{block{
/***
!!!608 toolbar - more/less toggle
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/608 - OPEN
This tweak extends the """<<toolbar>>""" macro to make the '>' (more) a //toggle// between more/less with the additional toolbar commands displayed on a separate line.
***/
//{{{
merge(config.macros.toolbar,{
	moreLabel: 'more',
	morePrompt: 'Show additional commands',
	lessLabel: 'less',
	lessPrompt: 'Hide additional commands'
});
config.macros.toolbar.onClickMore = function(ev)
{
	var e = this.nextSibling;
	var showing=e.style.display=='block';
	e.style.display = showing?'none':'block';
	this.innerHTML=showing?config.macros.toolbar.moreLabel:config.macros.toolbar.lessLabel;
	this.title=showing?config.macros.toolbar.morePrompt:config.macros.toolbar.lessPrompt;
	return false;
};
//}}}
// // }}}}}}// // {{block{
/***
!!!607 add HREF link on permaview command
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/607 - OPEN
This tweak automatically sets the HREF for the 'permaview' sidebar command link so you can use the 'right click' context menu for faster, easier bookmarking.  Note that this does ''not'' automatically set the permaview in the browser's current location URL... it just sets the HREF on the command link.  You still have to click the link to apply the permaview.
***/
//{{{
config.macros.permaview.handler = function(place)
{
	var btn=createTiddlyButton(place,this.label,this.prompt,this.onClick);
	addEvent(btn,'mouseover',this.setHREF);
	addEvent(btn,'focus',this.setHREF);
};
config.macros.permaview.setHREF = function(event){
	var links = [];
	story.forEachTiddler(function(title,element) {
		links.push(String.encodeTiddlyLink(title));
	});
	var newURL=document.location.href;
	var hashPos=newURL.indexOf('#');
	if (hashPos!=-1) newURL=newURL.substr(0,hashPos);
	this.href=newURL+'#'+encodeURIComponent(links.join(' '));
}
//}}}
// // }}}}}}// // {{block{
/***
!!!529 IE fixup - case-sensitive element lookup of tiddler elements
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/529 - OPEN
This tweak hijacks the standard browser function, document.getElementById(), to work-around the case-INsensitivity error in Internet Explorer (all versions up to and including IE7) //''Note: This tweak is only applied when using IE, and only for lookups of rendered tiddler elements within the containing 'tiddlerDisplay' element.''//
***/
//{{{
if (config.browser.isIE) {
document.coreTweaks_coreGetElementById=document.getElementById;
document.getElementById=function(id) {
	var e=document.coreTweaks_coreGetElementById(id);
	if (!e || !e.parentNode || e.parentNode.id!='tiddlerDisplay') return e;
	for (var i=0; i<e.parentNode.childNodes.length; i++)
		if (id==e.parentNode.childNodes[i].id) return e.parentNode.childNodes[i];
	return null;
};
}
//}}}
// // }}}}}}// // {{block{
/***
!!!471 'creator' field for new tiddlers
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/471 - OPEN
This tweak HIJACKS the core's saveTiddler() function to automatically add a 'creator' field to a tiddler when it is FIRST created. You can use """<<view creator>>""" (or """<<view creator wikified>>""" if you prefer) to show this value embedded directly within the tiddler content, or {{{<span macro="view creator"></span>}}} in the ViewTemplate and/or EditTemplate to display the creator value in each tiddler.  
***/
//{{{
// hijack saveTiddler()
TiddlyWiki.prototype.CoreTweaks_creatorSaveTiddler=TiddlyWiki.prototype.saveTiddler;
TiddlyWiki.prototype.saveTiddler=function(title,newTitle,newBody,modifier,modified,tags,fields)
{
	var existing=store.tiddlerExists(title);
	var tiddler=this.CoreTweaks_creatorSaveTiddler.apply(this,arguments);
	if (!existing) store.setValue(title,'creator',config.options.txtUserName);
	return tiddler;
}
//}}}
// // }}}}}}// // {{block{
/***
!!!458 add permalink-like HREFs on internal TiddlyLinks
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/458 - CLOSED: WON'T FIX
This tweak assigns a permalink-like HREF to internal Tiddler links (which normally do not have any HREF defined).  This permits the link's context menu (right-click) to include 'open link in another window/tab' command.  Based on a request from Dustin Spicuzza.
***/
//{{{
window.coreTweaks_createTiddlyLink=window.createTiddlyLink;
window.createTiddlyLink=function(place,title,includeText,theClass,isStatic,linkedFromTiddler,noToggle)
{
	// create the core button, then add the HREF (to internal links only)
	var link=window.coreTweaks_createTiddlyLink.apply(this,arguments);
	if (!isStatic)
		link.href=document.location.href.split('#')[0]+'#'+encodeURIComponent(String.encodeTiddlyLink(title));
	return link;
}
//}}}
// // }}}}}}// // {{block{
/***
!!!444 'tiddler' and 'place' - global variables for use in computed macro parameters
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/444 - OPEN
When invoking a macro, this tweak makes the current containing tiddler object and DOM rendering location available as global variables (window.tiddler and window.place, respectively).  These globals can then be used within //computed macro parameters// to retrieve tiddler-relative and/or DOM-relative values or perform tiddler-specific side-effect functionality.
***/
//{{{
window.coreTweaks_invokeMacro = window.invokeMacro;
window.invokeMacro = function(place,macro,params,wikifier,tiddler) {
	var here=story.findContainingTiddler(place);
	window.tiddler=here?store.getTiddler(here.getAttribute('tiddler')):tiddler;
	window.place=place;
	window.coreTweaks_invokeMacro.apply(this,arguments);
}
//}}}
// // }}}}}}// // {{block{
/***
!!!067 Missing links - ignore non-wiki syntax source content
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/67 - OPEN
The missing links list includes items contained within quoted text (i.e., content that will not render as wiki-syntax, and so CANNOT create any tiddler links, even if the quoted text matches valid link syntax).  This tweak removes content contained between certain delimiters before scanning tiddler source for possible links.

Delimiters include:
{{{
/%...%/
{{{...}}}
"""..."""
<nowiki>...</nowiki>
<html>...</html>
<script>...</script>
}}}
***/
//{{{
Tiddler.prototype.coreTweaks_changed = Tiddler.prototype.changed;
Tiddler.prototype.changed = function()
{
	var savedtext=this.text;
	// remove 'quoted' text before scanning tiddler source
	this.text=this.text.replace(/\/%((?:.|\n)*?)%\//g,''); // /%...%/
	this.text=this.text.replace(/\{{3}((?:.|\n)*?)\}{3}/g,''); // {{{...}}}
	this.text=this.text.replace(/"{3}((?:.|\n)*?)"{3}/g,''); // """..."""
	this.text=this.text.replace(/\<nowiki\>((?:.|\n)*?)\<\/nowiki\>/g,''); // <nowiki>...</nowiki>
	this.text=this.text.replace(/\<html\>((?:.|\n)*?)\<\/html\>/g,''); // <html>...</html>
	this.text=this.text.replace(/\<script((?:.|\n)*?)\<\/script\>/g,''); // <script>...</script>
	this.coreTweaks_changed.apply(this,arguments);
	// restore quoted text to tiddler source
	this.text=savedtext;
};
//}}}
// // }}}}}}// // {{block{
/***
!!!(no ticket) """<<tag>>""" macro - sortby parameter
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/TBD - TBD
This tweak adds an optional 'sortby' parameter to the """<<tag tagname label tip sortby>>""" macro, as well as the """<<allTags excludeTag sortby>>""" macro used to generate the sidebar contents 'tags' list.  Specify the field on which the contents of each tag popup is to be sorted, with a '+' or '-' prefix to indicate ascending/descending order, respectively.

Example: """<<tag systemConfig "plugins" "list plugins by date, most recent first" "-modified">>"""
Try it: <<tag systemConfig "plugins" "list plugins by date, most recent first" "-modified">>

Similarly, to change the sort order used by the popups from all tags shown in the sidebar contents, edit the [[TagTags]] shadow tiddler and enter: """<<allTags excludeLists -modified>>"""
***/
//{{{
// hijack tag handler() to add 'sortby' attribute to tag button
config.macros.tag.CoreTweaksSortTags_handler=config.macros.tag.handler;
config.macros.tag.handler = function(place,macroName,params)
{
	this.CoreTweaksSortTags_handler.apply(this,arguments);
	var btn=place.lastChild;
	if (params[3]) btn.setAttribute('sortby',params[3]);
}

// tweak <<allTags>> macro to add 'sortby' attribute to each tag button
var fn=config.macros.allTags.handler;
var lines=fn.toString().split('\n');
lines.splice(lines.length-2,0,['if(params[1]) btn.setAttribute("sortby",params[1]);']);
fn=lines.join('\n');
eval('config.macros.allTags.handler='+fn);

// tweak tag event handler to:
// * use tag filtering (only if '[' is present in tag value)
// * use optional 'sortby' attribute
// * save 'sortby' value in 'open all' command (for displaying tiddlers in sorted order)
var fn=onClickTag;
fn=fn.toString().replace(
	/store.getTaggedTiddlers\(tag\);/g,
	'(tag.indexOf("[")==-1?store.getTaggedTiddlers(tag):store.filterTiddlers(tag));'
	+'var sortby=this.getAttribute("sortby");'
	+'if(sortby&&sortby.length) store.sortTiddlers(tagged,sortby);'
);
fn=fn.toString().replace(
	/openAll.setAttribute\("tag",\s*tag\);/g,
	'openAll.setAttribute("tag",tag); openAll.setAttribute("sortby",sortby);'
);
eval(fn);

// tweak 'open all' event handler to use 'sortby' attribute
var fn=onClickTagOpenAll;
fn=fn.toString().replace(
	/story.displayTiddlers\(this,\s*tiddlers\);/g,
	'var sortby=this.getAttribute("sortby");'
	+'if(sortby&&sortby.length) store.sortTiddlers(tiddlers,sortby);'
	+'story.displayTiddlers(this,tiddlers);'
);
eval(fn);
//}}}
// // }}}}}}// // {{block{
/***
!!!(no ticket) backslash-quoting for embedding newlines in 'line-mode' formats
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/TBD - TBD
This tweak pre-processes source content to convert 'double-backslash-newline' into {{{<br>}}} before wikify(), so that literal newlines can be embedded in line-mode wiki syntax (e.g., tables, bullets, etc.)
***/
//{{{
window.coreWikify = wikify;
window.wikify = function(source,output,highlightRegExp,tiddler)
{
	if (source) arguments[0]=source.replace(/\\\\\n/mg,'<br>');
	coreWikify.apply(this,arguments);
}
//}}}
// // }}}}}}
// // <<foldHeadings>>
/***
!!!<<gradient horiz #fc3 #fff >><<tiddler RefreshStyles>>&nbsp;CustomCSS>>/%==================================================%/
***/
/***CustomCSS is a style sheet that contains the "custom class" CSS to customize special features in TW Help.  It is placed in StyleSheet as a [[NestedStyleSheet|NestedStyleSheets]] and is an essential component.***/

/***There may be extra nested stylesheets at the end of this stylesheet***/



/***
!!!<<gradient horiz #FF8888 #ffffff >>&nbsp;~CustomTable>>/%==================================================%/
***/
/*{{{*/

.viewer th, .viewer thead td, .twtable th, .twtable thead td {
background: #abf;
border: 1px solid #666;
color: #006;
vertical-align:top;
padding:5px;
}

.topMenu{
background:#eee;
}

#tiddlerShowUnsavedChanges a {
color:#c06;
}


 .toolbar {
         visibility: hidden;
     }
     .selected .toolbar {
         visibility: visible;
     } 

.systemcontents {
 height: 150px; 
 width: auto; 
 position:relative;
 overflow: auto;
 margin:auto;
 margin-left:0em;
 }

.scrollcontents {
 height: 225px; 
 width: auto; 
 position:relative;
 overflow: auto;
 margin:auto;
 margin-left:0em;
 }

.popup {
 max-height:275px;
 min-height:auto;
 width: auto; 
 overflow: auto;
 margin:auto;
-moz-border-radius : 0.65em 0.2em 0.2em 0.65em;
background:#eee;
color:#900;
}

.popup {position:absolute; z-index:300; font-size:.9em; padding:0; list-style:none; margin:0;}





backstagePanel {background-color:#abf; border-color:#fcf ;}

.doubleborder {
    border: 4px double #fcf;
    margin: 8px;
}

.tableright  table {border:0 !important;td.vertical-align:top;margin-left:auto ; margin-right:0  auto !important; text-align:left; padding:0px;}


.tablecenter  table { border:0 !important;td.vertical-align:top;margin-left: auto; margin-right: auto; text-align:left; padding:0px;}
.tablecenterpad17 table { td.vertical-align:top;margin-left: auto; margin-right: auto; text-align:
left; padding:17px;}

.borderless, .borderless table, .borderless td, .borderless tr, .borderless th, .borderless tbody
	{ border:0 !important; margin:0 !important; padding:3px !important; td.vertical-align:top !important;margin-left: auto !important; margin-right: auto !important;}

.borderless5px, .borderless5px table, .borderless5px td, .borderless5px tr, .borderless5px th, .borderless5px tbody { border:0 !important; margin:0 !important; padding:5px !important; td.vertical-align:top !important;margin-left: auto !important; margin-right: auto !important;}

.borderlessL, .borderlessL table, .borderlessL td, .borderlessL tr, .borderlessL th, .borderlessL tbody
	{ border:0 !important; margin:0 !important; padding:7px !important; td.vertical-align:top !important;margin-left: 0 !important; margin-right: auto !important;}

.borderlessL0, .borderlessL 0table, .borderlessL0 td, .borderlessL0 tr, .borderlessL0 th, .borderlessL0 tbody
	{ border:0 !important; margin:0 !important; padding:0px !important; td.vertical-align:top !important;margin-left: 0 !important; margin-right: auto !important;}

.borderlessR, .borderlessR table, .borderlessR td, .borderlessR tr, .borderlessR th, .borderlessR tbody
	{ border:0 !important; margin:0 !important; padding:7px !important; td.vertical-align:top !important;margin-left: auto !important; margin-right: 0 !important;}

.viewer tr.oddRow { background-color: #eaeaea;}
.viewer tr.evenRow { background-color:#fff; } 


/%row code for html%/
tr.d0 td {background-color: #ccc; color: black;}
tr.d1 td {background-color: #eaeaea; color: black;}


/*}}}*/
/***
!!!<<gradient horiz #FF8888 #ffffff >>&nbsp;~CustomText>>/%==================================================%/
***/
/*{{{*/

.textleft { display:block;text-align:left; }
.textright { display:block;text-align:right; }
.textcenter { display:block;text-align:center; }
.textjustify { display:block;text-align:justify; }
.textindent { display:block;margin:0;padding:0;border:0;margin-left:2em; }

.wrap { white-space:normal; }
.nowrap	{ white-space:nowrap; }

.headingcolor{color:#FFF;background:#ff8888;}
.wrappingClass{padding: 0px 0.5em 0px 0.5em;color: #FFF; background: #06f;}



.firstletter{
display:block;
float:left;
width:1.0em;
font-size:400%;
font-family:times,courier;
line-height:80%;
}

.firstletterK{
display:block;
float:left;
width:0.75em;
font-size:400%;
font-family:times,courier;
line-height:80%;
}

.firstletterT{
display:block;
float:left;
width:0.65em;
font-size:300%;
font-family:times,courier;
line-height:95%;
}





/*}}}*/
/***
!!!<<gradient horiz #FF8888 #ffffff >>&nbsp;Layout>>/%==================================================%/
***/
/*{{{*/


/* Anything with the tag "multicolumn" gets a new multi-column format */

div[tags~="multicolumn"] .viewer {-moz-column-width:30em; -moz-column-gap:2em; padding-top:
0em;}

.twocolumns { display:block; -moz-column-count:2; -moz-column-gap:1em; -moz-column-
width:50%;}
.threecolumns { display:block; -moz-column-count:3; -moz-column-gap:1em; -moz-column-
width:33%}
.fourcolumns { display:block; -moz-column-count:4; -moz-column-gap:1em; -moz-column-
width:25%}

.doubleborder {
    border: 4px double #fcf;
    margin: 8px;
}

.floatboxright {
    float: right;
    width: 20em;
    border: solid 1px;
    padding:3px;
    background-color:#fcf;
    /* whatever other styling you want.. */
} 


.floatboxleft {
    float: left;
    width: 20em;
    border: solid 1px;
    padding:3px;
    background-color:#fcf;
    /* whatever other styling you want.. */
} 

.floatleft{ float:left; }
.floatright{ float:right; }

.moveovermainmenu{margin-left:7px;}
.textleftpad5{text-align:left;padding: 0px 5px 0px 5px;}
.textindent25 {text-indent:25px;}
.smallform{ white-space:nowrap; }

.imgfloatright{display:block;float:right;padding:0.3em;}
.imgfloatleft{display:block;float:left;padding:0.3em;}
.imgfloatcenter{display:block;margin-left: auto;margin-right: auto;padding:0.3em;}

.imgfloatrightM{display:block;float:right;margin-left:0em;padding-right:1.3em;}

.alt { background-color:#abf; }
.fdfbackground {background:#fdf;} 

/*}}}*/
/***
!!!<<gradient horiz #FF8888 #ffffff >>&nbsp;Links>>/%==================================================%/
***/
/*{{{*/

.boldLink a {font-weight:bold;}
.unboldlink a {font-weight:normal;}

.bigLink a { font-size:10pt;font-weight:bold;}
.whiteLink a { color: #fff;font-weight:normal; } 
.twLink a { color: #090;font-weight:normal; }
.locLink a { color: #f6f;font-weight:normal; }
.remLink a { color: #c90;font-weight:normal; } 
.blueLink a {color:#00f;}
.grayLink a {color:#ccc;}
.redLink a {color:#d00;}
.menublueLink a {color:#3cf;} 

.wrappingLinks{color: #000; background: #B3FFB3;}
.wrappingLinksAlt{color: #000; background: #C0FFFF;}

/*}}}*/
/***
!!!<<gradient horiz #FF8888 #ffffff >>Tiddler Specific Custom CSS>>/%=================================================%/
***/
/*{{{*/

{{{
#tiddlerNew\000020Tiddler a {
	color: #f00;
}
}}}

#tiddlerEditTemplate .button {color: #000;text-decoration:none;}

#tiddlerTWHelp-SearchResults .viewer {
overflow: auto;
}

#tiddlerTranslate .viewer {
overflow: auto;
}

#tiddlerSlantedMenu {
border-top: 1px solid #fcf:
}

#tiddlerSideBarOptions {
color:#ffc;
background: transparent;
}

#tiddlerNewWelcome .viewer .tabContents {
background: white;
border-top: 1px solid #999;
border-right: 0px solid #999;
border-bottom: 0px solid #999;
border-left: 0px solid #999;
}

#tiddlerTWHelpSiteLinks ol { list-style-type: decimal }

#tiddlerIndex .title {
visibility: hidden; 
}


#tiddlerBorderlessIframe .viewer {
background:#fff;
}



#mainMenu a:hover{
	background: #FFF;
	color: #F00;
}

#tiddlerMargin_Properties.viewer th{
        border: 1px solid #000;
	padding: 0px;
        vertical-align:top;
}

#tiddlerFormattingPageIntro .viewer th, .viewer td, .viewer tr,.viewer caption{
        border: 1px solid #F6F;
	padding: 0px;
        vertical-align:top;
}

#tiddlerTWHelp-SearchResults .viewer table, .viewer td{
border: 1px solid #F6F;
padding-left: 5px;
padding-right: 5px;
vertical-align:top;
td.vertical-align:top;
margin-left: auto;
margin-right: auto;
}

#tiddlerTables .viewer td.even{
background:#ccc;
}

#tiddlerTWHelp-SearchResults .viewer a {
color:#04b;
text-decoration:none;

}


#tiddlerAlpha .viewer tr.oddRow { background-color: #abf;}
#tiddlerAlpha .viewer tr.evenRow { background-color:#eaeaea; } 

#tiddlerNewWelcome .viewer tr.oddRow { background-color: #eaeaea;}
#tiddlerNewWelcome .viewer tr.evenRow { background-color:#fff; } 

#tiddlerImages img {
    border: 5px double #999;
    margin: 4px;

} 

#searchBar {
	float: right;
	font-size: 0.9em;
        padding-right: 1.5em;
        padding-bottom: 0em;
}

#searchBar .button {
	padding-right: 0.5em;
	border: none;
}

.gotoBar {
	float: right;
	font-size: 0.9em;
        padding-right: 1.5em;
        padding-top: 1.0em;
}


/*}}}*/
/***
!!!<<gradient horiz #FF8888 #ffffff >>Footer >>/%==================================================%/
***/
/*{{{*/

#ContentFooter {

 clear: both;
 color:#000;
 background: #ADAFFF;
 padding: 1em 2em;
 font-weight:normal;
 margin-right:0.0em;
 border-top: solid 1px #008;
 border-bottom: solid 1px #008;
}


#ContentFooter a {
 color:#009;
}


#ContentFooter .viewer{
background:#000;
color:#fff;
 }



/*}}}*/
/***
!!!<<gradient horiz #090 #fff>>&nbsp;@@color:#fff;End@@>>/%==================================================%/
***/
/*{{{*/

[[Introduction]]
<<tiddler ADemoEquation>>
<<slider "" "LaunchWithEmbedCode" "Quick Demo" "Quick Demo" >>
/***
|''Name:''|DoBackupMacro|
|''Version:''|2.0 (9-Apr-2006)|
|''Author:''|[[Jack]]|
|''Type:''|Macro|
!Description
Creates a button which allows you to backup your TiddlyWiki on demand.
!Usage
Add the following command to your SideBarOptions tiddler:
{{{<<doBackup>>}}}
!Revision History
* Original by [[Jack]] 9-Apr-2006
!To Do
* List non-explicit links (e.g. from tagging macro)

!Code
***/
//{{{
version.extensions.doBackup= {major: 2, minor: 0, revision: 0, date: new Date("Apr 9, 2006")};
config.macros.doBackup={label: "backup", prompt: "Backup this TiddlyWiki"}
config.macros.doBackup.handler = function(place)
{
 if(!readOnly)
 createTiddlyButton(place,this.label,this.prompt,function ()
{doBackup(); return false;},null,null,this.accessKey);
}

doBackup = function() {
 var optSaveBackups = config.options.chkSaveBackups
 config.options.chkSaveBackups = true
 saveChanges()
 config.options.chkSaveBackups = optSaveBackups
}

//}}}
You can edit a formula

Click on the formula. [img[http://latex.codecogs.com/gif.latex?x=1+sin(x)][http://www.codecogs.com/components/equationeditor/equationeditor.php?tw&latex=1@plus;sin(x)]]
<script label="edit a tiddler">
   var title=prompt("Enter the title of a tiddler to edit (case sensitive)");
   while (title && title.length && !store.tiddlerExists(title)) {
      displayMessage("The tiddler '%0' doesn't exist".format([title]));
      var title=prompt("Please enter a tiddler title",title);
   }
   if (!title||!title.length) return; /* cancelled by user */
   story.displayTiddler(null,title,2);
</script> 
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='showWhen tiddler.tags.contains("equation") || tiddler.title =="ANewEquationTiddler"'>[[LaunchEditor]]</div>
<div macro='tiddler QuickEditToolbar'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser'></span></div>
<!--}}}-->
<script>
/*<![CDATA[*/

/***********************************************
* Encrypt Email script- Please keep notice intact
* Tool URL: http://www.dynamicdrive.com/emailriddler/
* **********************************************/
<!-- Encrypted version of: tiddlywikihelp [at] *****.***.** //-->

var emailriddlerarray=[116,105,100,100,108,121,119,105,107,105,104,101,108,112,64,121,97,104,111,111,46,99,111,109,46,97,117]
var encryptedemail_id69='' //variable to contain encrypted email 
for (var i=0; i<emailriddlerarray.length; i++)
 encryptedemail_id69+=String.fromCharCode(emailriddlerarray[i])

document.write('<a href="mailto:'+encryptedemail_id69+'?subject=From TW Math Page">Email Author</a>')

/*]]>*/
</script>
<<tabs "txtopenTab" [[Intro ]] "" [[EntitiesCodeIntro]] [[GreekHtmlEntities ]] "" [[GreekHtmlEntities]] [[HtmlEntities ]] "" [[HtmlEntities]] [[ LatinHtmlEntities ]] "" [[LatinHtmlEntities]] [[MathHtmlEntities ]] "" [[MathHtmlEntities]] [[URL_Encoding ]] "" [[URL_Encoding]] [[UTF-8 ]] "" [[UTF-8]]>>

!!!<<gradient horiz #fc3 #ffffff>>[[Intro|EntitiesCodeIntro]]^^<<tiddler CloseThisOpen with: Entities-Codes  '« back'>>|<<toolbar editTiddler>>» ^^>>
These tabs contain many of the codes for non-keyboard characters such as :
*ASCII
*Greek {&omega; &psi;}
*Html {&pound; &euro;}
*Latin {&auml; &atilde; &aelig;} 
*Mathematics {&sum; &asymp; &le;}
!!!!&nbsp;Code
{{{
*Greek {&omega; &psi;}
*Html {&pound; &euro;}
*Latin {&auml; &atilde; &aelig;} 
*Mathematics {&sum; &asymp; &le;}
}}}
*[[Character entities defined in HTML 4.01|http://www.eki.ee/letter/chardata.cgi?HTML4=1]] (decimal and ~UTF-8 values)

/***
|Name|EquationEditorPlugin|
|Source|http://twmath.tiddlyspot.com/#EquationEditorPlugin|
|Version|1.0.0|
|Author|Morris Gray - twhelp.tiddlywiki.com & Will Bateman - CodeCogs.com|
|License|BSD open source license.|
|~CoreVersion|2.2|
|Type|script|
|Requires|See below|
|Overrides|config.macros.edit.handler and config.views.editor.defaultText|
|Description|definition for toolbar button for equation editing|

''Requirements:''
QuickEditPlugin package http://tiddlytools.com/#QuickEditPackage
Put the following in MarkupPreHead
{{{
<script type="text/javascript" src="http://latex.codecogs.com/editor.js"></script>
}}}

''Usage:''
Add the button to QuickEditToolbar like this:  {{{%/<<tiddler QuickEdit_equation>>/%}}}
OR
EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_equation'></span>

!Code
***/

config.views.editor.defaultText = "";

config.macros.edit.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
	var field = params[0];
	var rows = params[1] || 0;
	var defVal = params[2] || "";
	if((tiddler instanceof Tiddler) && field) {
		story.setDirty(tiddler.title,true);
		var e,v;
		if(field != "text" && !rows) {
			e = createTiddlyElement(null,"input");
			if(tiddler.isReadOnly())
				e.setAttribute("readOnly","readOnly");
			e.setAttribute("edit",field);
			e.setAttribute("type","text");
			e.value = store.getValue(tiddler,field) || defVal;
			e.setAttribute("size","40");
			e.setAttribute("autocomplete","off");
			place.appendChild(e);
		} else {
			var wrapper1 = createTiddlyElement(null,"fieldset",null,"fieldsetFix");
			var wrapper2 = createTiddlyElement(wrapper1,"div");
			e = createTiddlyElement(wrapper2,"textarea");
			if(tiddler.isReadOnly())
				e.setAttribute("readOnly","readOnly");
			e.value = v = store.getValue(tiddler,field) || defVal;
			rows = rows || 10;
			var lines = v.match(/\n/mg);
			var maxLines = Math.max(parseInt(config.options.txtMaxEditRows),5);
			if(lines != null && lines.length > rows)
				rows = lines.length + 5;
			rows = Math.min(rows,maxLines);
			e.setAttribute("rows",rows);
			e.setAttribute("edit",field);
			e.id="eqntarget";
			place.appendChild(wrapper1);
		}
		return e;
	}
};
''Examples''
-------------
<<<
[img[http://latex.codecogs.com/gif.latex?f(x)=\displaystyle\frac{(x
+1)^2}{(x+1)}=(x+1)]]

{{{[img[http://latex.codecogs.com/gif.latex?f(x)=\displaystyle\frac{(x+1)^2}{(x+1)}=(x+1)]]}}}
<<<
----
<<<
''Find current with Ohms Law in ~AC-Circuits'' &nbsp;[img[http://latex.codecogs.com/gif.latex?I=\sqrt\frac{P}{{Z}\cos\theta}]]

{{{[img[http://latex.codecogs.com/gif.latex?I=\sqrt\frac{P}{{Z}\cos\theta}]]}}}
<<<
----
''You can  tick 'compress' in the equation editor to reduce the size of the equation.
<<<
''Find current with Ohms Law in ~AC-Circuits'' &nbsp;[img[http://latex.codecogs.com/gif.latex?\inline I=\sqrt\frac{P}{{Z}\cos\theta}]]
<<<
----
''You can also include a link from the formula for further information if need be.'' 
<<<
Click on the formula.

''Find current with Ohms Law in ~AC-Circuits [img[http://latex.codecogs.com/gif.latex?I=\sqrt\frac{P}{{Z}\cos\theta}][OhmsLawAC-Circuits]]

{{{''Find current for Ohms Law in ~AC-Circuits [img[http://latex.codecogs.com/gif.latex?I=\sqrt\frac{P}{{Z}\cos\theta}][OhmsLawAC-Circuits]]}}}
<<<
<<slider "" "Formulas" "Formula Example" "Formula Example" >>
----
''You can  tick 'compress''' in the equation editor to reduce the size of the equation.

''Find current with Ohms Law in ~AC-Circuits'' &nbsp;[img[http://latex.codecogs.com/gif.latex?\inline I=\sqrt\frac{P}{{Z}\cos\theta}]]
/***
|Name|FullScreenPlugin|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/#FullScreenPlugin|
|Version|1.1|
|Requires|~TW2.x|
!Description:
Toggle between viewing tiddlers fullscreen and normally. Very handy for when you need more viewing space.

!Demo:
Click the ↕ button in the toolbar for this tiddler. Click it again to turn off fullscreen.

!Installation:
Copy the contents of this tiddler to your TW, tag with systemConfig, save and reload your TW.
Edit the ViewTemplate to add the fullscreen command to the toolbar.

!History:
*25-07-06: ver 1.1
*20-07-06: ver 1.0

!Code
***/
//{{{
var lewcidFullScreen = false;

config.commands.fullscreen =
{
            text:" «FullScreen» ",
            tooltip:"Fullscreen mode"
};

config.commands.fullscreen.handler = function (event,src,title)
{
            if (lewcidFullScreen == false)
               {
                lewcidFullScreen = true;
                setStylesheet('#sidebar,  #mainMenu{display:none;} #displayArea{margin:0em 0 0 0 !important;}',"lewcidFullScreenStyle");
               }
            else
               {
                lewcidFullScreen = false;
                setStylesheet(' ',"lewcidFullScreenStyle");
               }
}

config.macros.fullscreen={};
config.macros.fullscreen.handler =  function(place,macroName,params,wikifier,paramString,tiddler)
{
        var label = params[0]||" «Screen» ";
        var tooltip = params[1]||"Fullscreen mode";
        createTiddlyButton(place,label,tooltip,config.commands.fullscreen.handler);
}

var lewcid_fullscreen_closeTiddler = Story.prototype.closeTiddler;
Story.prototype.closeTiddler =function(title,animate,slowly)
{
           lewcid_fullscreen_closeTiddler.apply(this,arguments);
           if (story.isEmpty() && lewcidFullScreen == true)
              config.commands.fullscreen.handler();
}


Slider.prototype.lewcidStop = Slider.prototype.stop;
Slider.prototype.stop = function()
{
           this.lewcidStop();
           if (story.isEmpty() && lewcidFullScreen == true)
              config.commands.fullscreen.handler();
}
//}}}
<html><hide linebreaks><ul>
<li><strong>Getting Started</strong> New to Twitter?&nbsp; Check out our<a href="http://twitter.zendesk.com/forums/10711/entries"> Getting Started</a> articles to get a feel for the basics.</li>
<li><strong>How-To Information</strong> If you're not sure how to do something, find it <a href="http://twitter.zendesk.com/forums/23786/entries">here</a>!&nbsp; If you can't find it, try using the search box.</li>
<li><strong>Trouble Shooting</strong> Check out <a href="http://twitter.zendesk.com/forums/10713/entries">common problems</a>, and how to resolve them</li>
<li><strong>Terms of Service and Rules and Policies</strong> Use our <a href="http://twitter.zendesk.com/forums/26257/entries">Rules and Policies</a> section to learn about what Twitter does about Spam, Impersonation, Trademark, Copyright and other Terms of Service or Rules violations, and find out what you need to do to resolve a violation.</li>
<li><span style="font-weight: bold;">Get Satisfaction:</span> to get help from other people who use Twitter, use the Get Satisfaction widget in the sidebar to get help from other people who use Twitter.</li></ul></html>
!!!<<gradient horiz #fc3 #ffffff>>&nbsp;GreekHtmlEntities^^&nbsp;<<tiddler CloseThisOpen with: Entities-Codes  '« back'>>|<<toolbar editTiddler>>» ^^>>
{{twocolumns{
|>|>| !Greek Letters [[^|GreekHtmlEntities]] |
| !Symbol | !upper-case | !lower-case |
| {{{&Alpha;}}} | &Alpha; | &alpha; |
| {{{&Beta;}}} | &Beta; | &beta; |
| {{{&Gamma;}}} | &Gamma; | &gamma; |
| {{{&Delta;}}} | &Delta; | &delta; |
| {{{&Epsilon;}}} | &Epsilon; | &epsilon; |
| {{{&Zeta;}}} | &Zeta; | &zeta; |
| {{{&Eta;}}} | &Eta; | &eta; |
| {{{&Theta;}}} | &Theta; | &theta; |
| {{{&Thetasym;}}} | &thetasym; | |
| {{{&Iota;}}} | &Iota; | &iota; |
| {{{&Kappa;}}} | &Kappa; | &kappa; |
| {{{&Lambda;}}} | &Lambda; | &lambda; |
| {{{&Mu;}}} | &Mu; | &mu; |
| {{{&Nu;}}} | &Nu; | &nu; |
| {{{&Xi;}}} | &Xi; | &xi; |
| {{{&Omicron;}}} | &Omicron; | &omicron; |
| {{{&Pi;}}} | &Pi; | &pi; |
| {{{&Pi;}}} | &pi; | |
| {{{&Rho;}}} | &Rho; | &rho; |
| {{{&Sigma;}}} | &Sigma; | &sigma; |
| {{{&Tau;}}} | &Tau; | &tau; |
| {{{&Upsilon;}}} | &Upsilon; | &upsilon; |
| {{{&Upsilon;}}} | &upsih; | |
| {{{&Phi;}}} | &Phi; | &phi; |
| {{{&Chi;}}} | &Chi; | &chi; |
| {{{&Psi;}}} | &Psi; | &psi; |
| {{{&Omega;}}} | &Omega; | &omega; |
}}}
/***
|Name|HTMLFormattingPlugin|
|Source|http://www.TiddlyTools.com/#|
|Documentation|http://www.TiddlyTools.com/#HTMLFormattingPluginInfo|
|Version|2.3.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|'HTML' formatter|
|Description|embed wiki syntax formatting inside of HTML content|
The ~HTMLFormatting plugin allows you to ''mix wiki-style formatting syntax within HTML formatted content'' by extending the action of the standard TiddlyWiki formatting handler.
!!!!!Documentation
>see [[HTMLFormattingPluginInfo]]
!!!!!Revisions
<<<
2008.10.02 [2.3.0] added use of {{{<nowiki>}}} marker to bypass all wikification inside a specific HTML block
2008.09.19 [2.2.0] in wikifyTextNodes(), don't wikify the contents of STYLE nodes (thanks to MorrisGray for bug report)
| see [[HTMLFormattingPluginInfo]] for additional revision details |
2005.06.26 [1.0.0] Initial Release (as code adaptation - pre-dates TiddlyWiki plugin architecture!!)
<<<
!!!!!Code
***/
//{{{
version.extensions.HTMLFormattingPlugin= {major: 2, minor: 3, revision: 0, date: new Date(2008,10,2)};

// find the formatter for HTML and replace the handler
initHTMLFormatter();
function initHTMLFormatter()
{
	for (var i=0; i<config.formatters.length && config.formatters[i].name!="html"; i++);
	if (i<config.formatters.length)	config.formatters[i].handler=function(w) {
		if (!this.lookaheadRegExp)  // fixup for TW2.0.x
			this.lookaheadRegExp = new RegExp(this.lookahead,"mg");
		this.lookaheadRegExp.lastIndex = w.matchStart;
		var lookaheadMatch = this.lookaheadRegExp.exec(w.source)
		if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
			var html=lookaheadMatch[1];
			// if <nowiki> is present, just let browser handle it!
			if (html.indexOf('<nowiki>')!=-1)
				createTiddlyElement(w.output,"span").innerHTML=html;
			else {
				// if <hide linebreaks> is present, suppress wiki-style literal handling of newlines
				if (html.indexOf('<hide linebreaks>')!=-1) html=html.replace(/\n/g,' ');
				// remove all \r's added by IE textarea and mask newlines and macro brackets
				html=html.replace(/\r/g,'').replace(/\n/g,'\\n').replace(/<</g,'%%(').replace(/>>/g,')%%');
				// create span, let browser parse HTML
				var e=createTiddlyElement(w.output,"span"); e.innerHTML=html;
				// then re-render text nodes as wiki-formatted content
				wikifyTextNodes(e);
			}
			w.nextMatch = this.lookaheadRegExp.lastIndex; // continue parsing
		}
	}
}

// wikify #text nodes that remain after HTML content is processed (pre-order recursion)
function wikifyTextNodes(theNode)
{
	function unmask(s) { return s.replace(/\%%\(/g,'<<').replace(/\)\%%/g,'>>').replace(/\\n/g,'\n'); }
	switch (theNode.nodeName.toLowerCase()) {
		case 'style': case 'option': case 'select':
			theNode.innerHTML=unmask(theNode.innerHTML);
			break;
		case 'textarea':
			theNode.value=unmask(theNode.value);
			break;
		case '#text':
			var txt=unmask(theNode.nodeValue);
			var newNode=createTiddlyElement(null,"span");
			theNode.parentNode.replaceChild(newNode,theNode);
			wikify(txt,newNode);
			break;
		default:
			for (var i=0;i<theNode.childNodes.length;i++)
				wikifyTextNodes(theNode.childNodes.item(i)); // recursion
			break;
	}
}
//}}}
/***
|Name:|HideWhenPlugin|
|Description:|Allows conditional inclusion/exclusion in templates|
|Version:|3.1 ($Rev: 3919 $)|
|Date:|$Date: 2008-03-13 02:03:12 +1000 (Thu, 13 Mar 2008) $|
|Source:|http://mptw.tiddlyspot.com/#HideWhenPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License:|http://mptw.tiddlyspot.com/#TheBSDLicense|
For use in ViewTemplate and EditTemplate. Example usage:
{{{<div macro="showWhenTagged Task">[[TaskToolbar]]</div>}}}
{{{<div macro="showWhen tiddler.modifier == 'BartSimpson'"><img src="bart.gif"/></div>}}}
***/
//{{{

window.hideWhenLastTest = false;

window.removeElementWhen = function(test,place) {
	window.hideWhenLastTest = test;
	if (test) {
		removeChildren(place);
		place.parentNode.removeChild(place);
	}
};


merge(config.macros,{

	hideWhen: { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		removeElementWhen( eval(paramString), place);
	}},

	showWhen: { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		removeElementWhen( !eval(paramString), place);
	}},

	hideWhenTagged: { handler: function (place,macroName,params,wikifier,paramString,tiddler) {
		removeElementWhen( tiddler.tags.containsAll(params), place);
	}},

	showWhenTagged: { handler: function (place,macroName,params,wikifier,paramString,tiddler) {
		removeElementWhen( !tiddler.tags.containsAll(params), place);
	}},

	hideWhenTaggedAny: { handler: function (place,macroName,params,wikifier,paramString,tiddler) {
		removeElementWhen( tiddler.tags.containsAny(params), place);
	}},

	showWhenTaggedAny: { handler: function (place,macroName,params,wikifier,paramString,tiddler) {
		removeElementWhen( !tiddler.tags.containsAny(params), place);
	}},

	hideWhenTaggedAll: { handler: function (place,macroName,params,wikifier,paramString,tiddler) {
		removeElementWhen( tiddler.tags.containsAll(params), place);
	}},

	showWhenTaggedAll: { handler: function (place,macroName,params,wikifier,paramString,tiddler) {
		removeElementWhen( !tiddler.tags.containsAll(params), place);
	}},

	hideWhenExists: { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		removeElementWhen( store.tiddlerExists(params[0]) || store.isShadowTiddler(params[0]), place);
	}},

	showWhenExists: { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		removeElementWhen( !(store.tiddlerExists(params[0]) || store.isShadowTiddler(params[0])), place);
	}},

	hideWhenTitleIs: { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		removeElementWhen( tiddler.title == params[0], place);
	}},

	showWhenTitleIs: { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		removeElementWhen( tiddler.title != params[0], place);
	}},

	'else': { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		removeElementWhen( !window.hideWhenLastTest, place);
	}}

});

//}}}

!!!<<gradient horiz #fc3 #ffffff>>&nbsp;HtmlEntities ^^<<tiddler CloseThisOpen with: Entities-Codes  '« back'>>|<<toolbar editTiddler>>» ^^>>
 Check this out &#x2713;
{{twocolumns{
|>|>|width:96%; !Whitespace |
|vertical-align:middle; !Symbol | !~~Character<br>(spaces marked with i)~~ |vertical-align:middle; !Description |
| {{{&nbsp;}}} | i&nbsp;i |non-breaking space |
| {{{&ensp;}}} | i&ensp;i |en space |
| {{{&emsp;}}} | i&emsp;i |em space |
| {{{&thinsp;}}} | i&thinsp;i |thin space |
| {{{&zwnj;}}} | i&zwnj;i |zero width non-joiner (ignored by ~FireFox)  |
| {{{&zwj;}}} | i&zwj;i |zero width joiner (ignored by ~FireFox)  |
| {{{&lrm;}}} | i&lrm;i |left-to-right mark (ignored by ~FireFox)  |
| {{{&rlm;}}} | i&rlm;i |right-to-left mark (ignored by ~FireFox)  |
| {{{&shy;}}} | i&shy;i |soft hyphen (ignored by ~FireFox) |

|>|>|width:96%; !Money |
| !Symbol | !Character | !Description |
| {{{&cent;}}} | &cent; |cent sign |
| {{{&pound;}}} | &pound; |pound sign |
| {{{&curren;}}} | &curren; |currency sign |
| {{{&yen;}}} | &yen; |yen sign |
| {{{&euro;}}} | &euro; |euro sign |

|>|>|width:96%; !Symbols |
| !Symbol | !Character | !Description |
| {{{&copy;}}} | &copy; |copyright sign |
| {{{&reg;}}} | &reg; |registered trade mark |
| {{{&trade;}}} | &trade; |trade mark sign |
| {{{&ordm;}}} | &ordm; |masculine ordinal indicator |
| {{{&ordf;}}} | &ordf; |feminine ordinal indicator |
| {{{&dagger;}}} | &dagger; |dagger |
| {{{&Dagger;}}} | &Dagger; |double dagger |
| {{{&bull;}}} | &bull; |bullet |
| {{{&spades;}}} | &spades; |spade |
| {{{&clubs;}}} | &clubs; |club |
| {{{&hearts;}}} | &hearts; |heart |
| {{{&diams;}}} | &diams; |diamond |

|>|>|width:96%; !Lines |
| !Symbol | !Character | !Description |
| {{{&macr;}}} | &macr; |overline |
| {{{&brvbar;}}} | &brvbar; |broken vertical bar |
| {{{&ndash;}}} | &ndash; |en dash |
| {{{&mdash;}}} | &mdash; |em dash |
| {{{&oline;}}} | &oline; |overline |
| {{{&lceil;}}} | &lceil; |left ceiling |
| {{{&rceil;}}} | &rceil; |right ceiling |
| {{{&lfloor;}}} | &lfloor; |left floor |
| {{{&rfloor;}}} | &rfloor; |right floor |

|>|>|width:96%; !Arrows |
| !Symbol | !Character | !Description |
| {{{&larr;}}} | &larr; |left arrow |
| {{{&uarr;}}} | &uarr; |up arrow |
| {{{&rarr;}}} | &rarr; |right arrow |
| {{{&darr;}}} | &darr; |down arrow |
| {{{&harr;}}} | &harr; |left right arrow |
| {{{&crarr;}}} | &crarr; |down arrow with corner leftwards / carriage return |
| {{{&lArr;}}} | &lArr; |left double arrow |
| {{{&uArr;}}} | &uArr; |up double arrow |
| {{{&rArr;}}} | &rArr; |right double arrow |
| {{{&dArr;}}} | &dArr; |down double arrow |
| {{{&hArr;}}} | &hArr; |left right double arrow |

|>|>|width:96%; !Punctuation |
| !Symbol | !Character | !Description |
| {{{&iexcl;}}} | &iexcl; |inverted exclamation mark |
| {{{&iquest;}}} | &iquest; |inverted question mark |
| {{{&uml;}}} | &uml; |diaeresis |
| {{{&acute;}}} | &acute; |acute accent |
| {{{&para;}}} | &para; |paragraph sign |
| {{{&sect;}}} | &sect; |section sign |
| {{{&cedil;}}} | &cedil; |cedilla |
| {{{&amp;}}} | &amp; |ampersand |
| {{{&apos;}}} | &apos; |apostrophe mark |
| {{{&circ;}}} | &circ; |circumflex accent |
| {{{&tilde;}}} | &tilde; |small tilde |
| {{{&hellip;}}} | &hellip; |horizontal ellipsis |

|>|>|width:96%; !Quotations |
| !Symbol | !Character | !Description |
| {{{&quot;}}} | &quot; |quotation mark |
| {{{&raquo;}}} | &raquo; |right double angle quotation mark |
| {{{&laquo;}}} | &laquo; |left double angle quotation mark |
| {{{&lsquo;}}} | &lsquo; |left single quotation mark|
| {{{&rsquo;}}} | &rsquo; |right single quotation mark |
| {{{&sbquo;}}} | &sbquo; |single low-9 quotation mark |
| {{{&ldquo;}}} | &ldquo; |left double quotation mark |
| {{{&rdquo;}}} | &rdquo; |right double quotation mark |
| {{{&bdquo;}}} | &bdquo; |double low-9 quotation mark |
| {{{&lsaquo;}}} | &lsaquo; |single left-pointing angle quotation mark |
| {{{&rsaquo;}}} | &rsaquo; |single right-pointing angle quotation mark |
}}}
----
''You may get this warning in IE''

''To help protect your security,'' Internet Explorer stopped this site from installing an ~ActiveX control on your computer. Click here for options. Click Allow Blocked Content

''You can allow content but will have to do it each time''' the Editor is opened. To permantly allow this content do the following.
#Open Internet Explorer. 
#Click the Tools button, and then click Internet Options.
#Click the Security tab, and then click Custom level.
#Do one or both of the following:
#To turn off the Information bar for ~ActiveX controls, scroll to the ~ActiveX controls and plug-ins section of the list, and then, under Automatic prompting for ~ActiveX controls, click Enable.
#To turn off the Information bar for file downloads, scroll to the Downloads section of the list, and then, under Automatic prompting for file downloads, click Enable.
#Click OK, click Yes to confirm that you want to make the change, and then click OK again.


<<importTiddlers inline>>
On Sunday, 17 May 2009 12:38:31 PM, MsgRay imported 1 tiddler from
[[F:\TiddlyWiki\TWExperiments\TiddlyTools\tiddlytools.com_index.htm|F:\TiddlyWiki\TWExperiments\TiddlyTools\tiddlytools.com_index.htm]]:
<<<
#[[QuickEditPlugin]] - replaces QuickEditPlugin - 1/6/2009 18:40:00 by MsgRay
<<<

----
On Sunday, 17 May 2009 12:32:42 PM, MsgRay imported 2 tiddlers from
[[F:\TiddlyWiki\TWExperiments\TiddlyTools\tiddlytools.com_index.htm|F:\TiddlyWiki\TWExperiments\TiddlyTools\tiddlytools.com_index.htm]]:
<<<
#[[QuickEdit_custom]] - added
#[[QuickEdit_customList]] - added
<<<

----
On Tuesday, 3 February 2009 8:47:06 AM, MsgRay imported 1 tiddler from
[[F:\TiddlyWiki2.4\TWMath\twmath.html|F:\TiddlyWiki2.4\TWMath\twmath.html]]:
<<<
#[[SideBarOptions]] - replaces SideBarOptions - 1/5/2009 07:44:00 by MsgRay
<<<

----
On Tuesday, 3 February 2009 8:45:16 AM, MsgRay imported 153 tiddlers from
[[F:\TiddlyWiki2.4\TWMath\twmath.html|F:\TiddlyWiki2.4\TWMath\twmath.html]]:
<<<
#[[2 February 2009]] - added
#[[A Click Only Demo]] - added
#[[ADemoEquation]] - added
#[[ADemoShadow]] - added
#[[AligningTextWithEquations]] - added
#[[AnnualAcreFeet]] - added
#[[AttachFile]] - added
#[[AttachFileMIMETypes]] - added
#[[BlankFormula]] - added
#[[BlankIframe]] - added
#[[ButtonStyle]] - added
#[[CloseOnCancelPlugin]] - added
#[[CloseThisOpen]] - added
#[[CoreTweaks]] - added
#[[CustomCSS]] - added
#[[DefaultTiddlers]] - added
#[[DemoShadow]] - added
#[[DemoSlider]] - added
#[[EditAFormula]] - added
#[[EditATiddler]] - added
#[[EditTemplate]] - added
#[[EmailTWMath]] - added
#[[Entities-Codes]] - added
#[[EntitiesCodeIntro]] - added
#[[EquationDemo]] - added
#[[EquationEditorPlugin]] - added
#[[Examples]] - added
#[[FormulaSlider]] - added
#[[Formulas]] - added
#[[FullScreenPlugin]] - added
#[[GreekHtmlEntities]] - added
#[[HTMLFormattingPlugin]] - added
#[[HideWhenPlugin]] - added
#[[HtmlEntities]] - added
#[[IE-Security]] - added
#[[ImportTiddlers]] - added
#[[InlineJavascriptPlugin]] - added
#[[Instructions]] - added
#[[Introduction]] - added
#[[IntroductionObsolete]] - added
#[[LaTexMath]] - added
#[[LastModified]] - added
#[[LatinHtmlEntities]] - added
#[[LaunchEditor]] - added
#[[LaunchEditorDemo]] - added
#[[LaunchWithEmbedCode]] - added
#[[LinkTestTiddler]] - added
#[[LoadRemoteFileThroughProxy]] - added
#[[MainMenu]] - added
#[[MarkupPostBody]] - added
#[[MarkupPostHead]] - added
#[[MarkupPreHead]] - added
#[[MathHtmlEntities]] - added
#[[MathReferences]] - added
#[[MemorizablePlugin]] - added
#[[NavButtons]] - added
#[[NestedSlidersPlugin]] - added
#[[New Formula]] - added
#[[NewEquation]] - added
#[[NewEquationTiddler]] - added
#[[NewEquationTry]] - added
#[[NewFormulaButton]] - added
#[[NewFormulaFromTemplate]] - added
#[[NewHTMLFormula]] - added
#[[NewIframeFromTemplate]] - added
#[[NewShadowTiddler]] - added
#[[NewTestFormula]] - added
#[[NewiframeButton]] - added
#[[NumberEmpire]] - added
#[[OhmsLawAC-Circuits]] - added
#[[OhmsLawAC-CircuitsSlider]] - added
#[[OhmsLawCircle]] - added
#[[OhmsLawCirclePower]] - added
#[[OhmsLawDC-Circuits]] - added
#[[OtherMathLinks]] - added
#[[OverView]] - added
#[[PageTemplate]] - added
#[[PasswordOptionsPlugin]] - added
#[[Pearson]] - added
#[[PluginManager]] - added
#[[Plugins]] - added
#[[PublishMacro]] - added
#[[QuickDemoToolbar]] - added
#[[QuickEditPackage]] - added
#[[QuickEditPlugin]] - added
#[[QuickEditToolbar]] - added
#[[QuickEdit_Demo1]] - added
#[[QuickEdit_Demo2]] - added
#[[QuickEdit_Demo3]] - added
#[[QuickEdit_Demo4]] - added
#[[QuickEdit_align]] - added
#[[QuickEdit_color]] - added
#[[QuickEdit_css]] - added
#[[QuickEdit_equation]] - added
#[[QuickEdit_equationButton]] - added
#[[QuickEdit_file]] - added
#[[QuickEdit_font]] - added
#[[QuickEdit_fontList]] - added
#[[QuickEdit_format]] - added
#[[QuickEdit_image]] - added
#[[QuickEdit_link]] - added
#[[QuickEdit_macro]] - added
#[[QuickEdit_replace]] - added
#[[QuickEdit_sort]] - added
#[[QuickEdit_split]] - added
#[[QuickEdit_tiddler]] - added
#[[ReEditFormula]] - added
#[[RefreshStyles]] - added
#[[SaveAsPlugin]] - added
#[[SaveCloseTiddlerPlugin]] - added
#[[SearchOptionsPlugin]] - added
#[[ShowQuickEdit=true]] - added
#[[SideBarOptions]] - added
#[[SideBarTabs]] - added
#[[SideBarTabsSlider]] - added
#[[SiteSubtitle]] - added
#[[SiteTitle]] - added
#[[SquareBracketBug]] - added
#[[StyleSheet]] - added
#[[StyleSheetShortcuts]] - added
#[[StyleSheetTiddlersBar]] - added
#[[System]] - added
#[[TWHelp-SearchResults]] - added
#[[TWLinks]] - added
#[[TableHelp]] - added
#[[TabsCSS]] - added
#[[TaggedTemplateTweak]] - added
#[[TiddlersBarPluginMG]] - added
#[[ToggleSideBarMacro]] - added
#[[ToggleTiddlersBarMacro]] - added
#[[ToolbarCommands]] - added
#[[TopMenu]] - added
#[[TopMenuStyle]] - added
#[[TspotOptions]] - added
#[[TspotSetupPlugin]] - added
#[[Tutorial]] - added
#[[TwHelpSearchPlugin]] - added
#[[URL_Encoding]] - added
#[[UTF-8]] - added
#[[UploadLog]] - added
#[[UploadPlugin]] - added
#[[ViewTemplate]] - added
#[[ViewerTabsCSS]] - added
#[[asciiMathCalculator]] - added
#[[configMyQuickEdi]] - added
#[[demoEditTemplate]] - added
#[[editA]] - added
#[[eqntarget.true]] - added
#[[leftbackdo6.gif]] - added
#[[navbargrayhw1.jpg]] - added
#[[navbarredlt5.jpg]] - added
#[[new]] - added
#[[redbanneryd3.jpg]] - added
<<<
/***
|Name|InlineJavascriptPlugin|
|Source|http://www.TiddlyTools.com/#InlineJavascriptPlugin|
|Version|1.6.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|Insert Javascript executable code directly into your tiddler content.|

''Call directly into TW core utility routines, define new functions, calculate values, add dynamically-generated TiddlyWiki-formatted output'' into tiddler content, or perform any other programmatic actions each time the tiddler is rendered.
!!!!!Usage
<<<
When installed, this plugin adds new wiki syntax for surrounding tiddler content with {{{<script>}}} and {{{</script>}}} markers, so that it can be treated as embedded javascript and executed each time the tiddler is rendered.

''Deferred execution from an 'onClick' link''
By including a {{{label="..."}}} parameter in the initial {{{<script>}}} marker, the plugin will create a link to an 'onclick' script that will only be executed when that specific link is clicked, rather than running the script each time the tiddler is rendered.  You may also include a {{{title="..."}}} parameter to specify the 'tooltip' text that will appear whenever the mouse is moved over the onClick link text

''External script source files:''
You can also load javascript from an external source URL, by including a src="..." parameter in the initial {{{<script>}}} marker (e.g., {{{<script src="demo.js"></script>}}}).  This is particularly useful when incorporating third-party javascript libraries for use in custom extensions and plugins.  The 'foreign' javascript code remains isolated in a separate file that can be easily replaced whenever an updated library file becomes available.

''Display script source in tiddler output''
By including the keyword parameter "show", in the initial {{{<script>}}} marker, the plugin will include the script source code in the output that it displays in the tiddler.

''Defining javascript functions and libraries:''
Although the external javascript file is loaded while the tiddler content is being rendered, any functions it defines will not be available for use until //after// the rendering has been completed.  Thus, you cannot load a library and //immediately// use it's functions within the same tiddler.  However, once that tiddler has been loaded, the library functions can be freely used in any tiddler (even the one in which it was initially loaded).

To ensure that your javascript functions are always available when needed, you should load the libraries from a tiddler that will be rendered as soon as your TiddlyWiki document is opened.  For example, you could put your {{{<script src="..."></script>}}} syntax into a tiddler called LoadScripts, and then add {{{<<tiddler LoadScripts>>}}} in your MainMenu tiddler.

Since the MainMenu is always rendered immediately upon opening your document, the library will always be loaded before any other tiddlers that rely upon the functions it defines.  Loading an external javascript library does not produce any direct output in the tiddler, so these definitions should have no impact on the appearance of your MainMenu.

''Creating dynamic tiddler content''
An important difference between this implementation of embedded scripting and conventional embedded javascript techniques for web pages is the method used to produce output that is dynamically inserted into the document:
* In a typical web document, you use the document.write() function to output text sequences (often containing HTML tags) that are then rendered when the entire document is first loaded into the browser window.
* However, in a ~TiddlyWiki document, tiddlers (and other DOM elements) are created, deleted, and rendered "on-the-fly", so writing directly to the global 'document' object does not produce the results you want (i.e., replacing the embedded script within the tiddler content), and completely replaces the entire ~TiddlyWiki document in your browser window.
* To allow these scripts to work unmodified, the plugin automatically converts all occurences of document.write() so that the output is inserted into the tiddler content instead of replacing the entire ~TiddlyWiki document.

If your script does not use document.write() to create dynamically embedded content within a tiddler, your javascript can, as an alternative, explicitly return a text value that the plugin can then pass through the wikify() rendering engine to insert into the tiddler display.  For example, using {{{return "thistext"}}} will produce the same output as {{{document.write("thistext")}}}.

//Note: your script code is automatically 'wrapped' inside a function, {{{_out()}}}, so that any return value you provide can be correctly handled by the plugin and inserted into the tiddler.  To avoid unpredictable results (and possibly fatal execution errors), this function should never be redefined or called from ''within'' your script code.//

''Accessing the ~TiddlyWiki DOM''
The plugin provides one pre-defined variable, 'place', that is passed in to your javascript code so that it can have direct access to the containing DOM element into which the tiddler output is currently being rendered.

Access to this DOM element allows you to create scripts that can:
* vary their actions based upon the specific location in which they are embedded
* access 'tiddler-relative' information (use findContainingTiddler(place))
* perform direct DOM manipulations (when returning wikified text is not enough)
<<<
!!!!!Examples
<<<
an "alert" message box:
>
dynamic output:
><script show>
	return (new Date()).toString();
</script>
wikified dynamic output:
><script show>
	return "link to current user: [["+config.options.txtUserName+"]]";
</script>
dynamic output using 'place' to get size information for current tiddler:
><script show>
   if (!window.story) window.story=window;
   var title=story.findContainingTiddler(place).id.substr(7);
   return title+" is using "+store.getTiddlerText(title).length+" bytes";
</script>
creating an 'onclick' button/link that runs a script:
><script label="click here" title="clicking this link will show an 'alert' box" show>
   if (!window.story) window.story=window;
   alert("Hello World!\nlinktext='"+place.firstChild.data+"'\ntiddler='"+story.findContainingTiddler(place).id.substr(7)+"'");
</script>
loading a script from a source url:
>http://www.TiddlyTools.com/demo.js contains:
>>{{{function demo() { alert('this output is from demo(), defined in demo.js') } }}}
>>{{{alert('InlineJavascriptPlugin: demo.js has been loaded'); }}}
><script src="demo.js" show>
	return "loading demo.js..."
</script>
><script label="click to execute demo() function" show>
	demo()
</script>
<<<
!!!!!Installation
<<<
import (or copy/paste) the following tiddlers into your document:
''InlineJavascriptPlugin'' (tagged with <<tag systemConfig>>)
<<<
!!!!!Revision History
<<<
''2007.02.19 [1.6.0]'' added support for title="..." to specify mouseover tooltip when using an onclick (label="...") script
''2006.10.16 [1.5.2]'' add newline before closing '}' in 'function out_' wrapper.  Fixes error caused when last line of script is a comment.
''2006.06.01 [1.5.1]'' when calling wikify() on script return value, pass hightlightRegExp and tiddler params so macros that rely on these values can render properly
''2006.04.19 [1.5.0]'' added 'show' parameter to force display of javascript source code in tiddler output
''2006.01.05 [1.4.0]'' added support 'onclick' scripts.  When label="..." param is present, a button/link is created using the indicated label text, and the script is only executed when the button/link is clicked.  'place' value is set to match the clicked button/link element.
''2005.12.13 [1.3.1]'' when catching eval error in IE, e.description contains the error text, instead of e.toString().  Fixed error reporting so IE shows the correct response text.  Based on a suggestion by UdoBorkowski
''2005.11.09 [1.3.0]'' for 'inline' scripts (i.e., not scripts loaded with src="..."), automatically replace calls to 'document.write()' with 'place.innerHTML+=' so script output is directed into tiddler content.  Based on a suggestion by BradleyMeck
''2005.11.08 [1.2.0]'' handle loading of javascript from an external URL via src="..." syntax
''2005.11.08 [1.1.0]'' pass 'place' param into scripts to provide direct DOM access 
''2005.11.08 [1.0.0]'' initial release
<<<
!!!!!Credits
<<<
This feature was developed by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]]
<<<
!!!!!Code
***/
//{{{
version.extensions.inlineJavascript= {major: 1, minor: 6, revision: 0, date: new Date(2007,2,19)};

config.formatters.push( {
	name: "inlineJavascript",
	match: "\\<script",
	lookahead: "\\<script(?: src=\\\"((?:.|\\n)*?)\\\")?(?: label=\\\"((?:.|\\n)*?)\\\")?(?: title=\\\"((?:.|\\n)*?)\\\")?( show)?\\>((?:.|\\n)*?)\\</script\\>",

	handler: function(w) {
		var lookaheadRegExp = new RegExp(this.lookahead,"mg");
		lookaheadRegExp.lastIndex = w.matchStart;
		var lookaheadMatch = lookaheadRegExp.exec(w.source)
		if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
			if (lookaheadMatch[1]) { // load a script library
				// make script tag, set src, add to body to execute, then remove for cleanup
				var script = document.createElement("script"); script.src = lookaheadMatch[1];
				document.body.appendChild(script); document.body.removeChild(script);
			}
			if (lookaheadMatch[5]) { // there is script code
				if (lookaheadMatch[4]) // show inline script code in tiddler output
					wikify("{{{\n"+lookaheadMatch[0]+"\n}}}\n",w.output);
				if (lookaheadMatch[2]) { // create a link to an 'onclick' script
					// add a link, define click handler, save code in link (pass 'place'), set link attributes
					var link=createTiddlyElement(w.output,"a",null,"tiddlyLinkExisting",lookaheadMatch[2]);
					link.onclick=function(){try{return(eval(this.code))}catch(e){alert(e.description?e.description:e.toString())}}
					link.code="function _out(place){"+lookaheadMatch[5]+"\n};_out(this);"
					link.setAttribute("title",lookaheadMatch[3]?lookaheadMatch[3]:"");
					link.setAttribute("href","javascript:;");
					link.style.cursor="pointer";
				}
				else { // run inline script code
					var code="function _out(place){"+lookaheadMatch[5]+"\n};_out(w.output);"
					code=code.replace(/document.write\(/gi,'place.innerHTML+=(');
					try { var out = eval(code); } catch(e) { out = e.description?e.description:e.toString(); }
					if (out && out.length) wikify(out,w.output,w.highlightRegExp,w.tiddler);
				}
			}
			w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
		}
	}
} )
//}}}
----
''Whenever a tiddler is in edit mode, clicking on'' {{makeborder{equation}}}  in the ~QuickEditToolbar will  launch an equation editor where you can construct math equations. Once you are done with the equation simply click the {{makeborder{Copy to Document}}} in the Equation Editor to insert the equation into the tiddler at the cursor position.

''While composing'' the supporting text for your equations page you can use the ''wysiwyg'' editor to easily format your page. When you are finished composing the new tiddler with your text and equations simply name the tiddler and click done.  

''If you wish'' you can then import it into any number of other ~TiddlyWikis as it will be a stand alone tiddler.

<<<
''If you require an HTML page.'' 

You can construct your page as a tiddler and convert it to an HTML page. Just click 'publish' located in the tiddlers toolbar.  This will publish your HTML page in a folder named 'publish' on your local disk located in the same directory where you've saved TW Math.
<<<

''Please make any comments or suggestions at the ~TiddlyWiki'' [[Discussion Group|http://groups.google.com/group/TiddlyWiki/]]

<html><style>

#tiddlerMathEquations .viewer blockquote {border-left: 2px solid #c06;}

</style></html>
----
{{headline{Announcing an Equation button for ~QuickEdit plugin}}}

@@font-size:10pt;Allows you to use the {{blueLinktext{~CodeCogs Equation Editor}}} to insert equations directly into a tiddler.@@
|NOTE: If you are installing the plugin in your own ~TiddlyWiki you must put in the shadow tiddler MarkupPreHead this code: {{{<script type="text/javascript" src="http://latex.codecogs.com/editor.js"></script>}}}|
----

@@font-size:12pt;color:#C06;''&raquo; &raquo;'' @@  @@font-size:10pt;To try the Equation Button just click''<<newTiddler>>'' here or in right<<toggleSideBar>>@@
/%@@font-size:12pt;color:#C06;''&raquo; &raquo;'' @@  @@font-size:10pt;Can't do equations? Click here {{blueLink{<<tiddler [[A Click Only Demo]]>>}}}@@%/
@@font-size:12pt;color:#C06;''&raquo; &raquo;'' @@  @@font-size:10pt;__Get  a ready to use__ TW Math capable Note taking ~TiddlyWiki here [[TWT-Notes|http://twt-notes.tiddlyspot.com/]]@@

@@font-size:12pt;color:#C06;''&raquo; &raquo;'' @@  @@font-size:10pt;__Get  a ready to use__  Equation ready empty ~TiddlyWiki here [[TW Equation|http://twequation.tiddlyspot.com/]]@@

----
|!Required|
|The Plugin: EquationEditorPlugin get it here|
|The button: QuickEdit_equation get it here.|
|Requires:QuickEditPlugin package http://tiddlytools.com/#QuickEditPackage|
|Just edit the QuickEditToolbar and add the equation button.|
''Please make any comments or suggestions at the ~TiddlyWiki'' [[Discussion Group|http://groups.google.com/group/TiddlyWiki/]]

{{headline{''TW Math is under construction.'' }}}<<tiddler LastModified>>

''TW Math is intended to be a quick and easy'' way to generate formulas for use in ~TiddlyWiki using the [[CodeCogs Equation Editor|http://www.codecogs.com/components/equationeditor/equation_install.php]]

''Clicking on'' @@color:#C06;new equation@@ in the right sidebar will create a new tiddler tagged 'equation'. In the edit mode you can launch an equation editor where you can construct math equations.  

''While composing'' the supporting text for your equations page there is a ''wysiwyg'' editor that you can toggle on and off with the '''quickedit''' button. When you are finished composing the new tiddler with your text and equations simply name the tiddler and click done.  

''If you wish'' you can then import it into any number of other ~TiddlyWikis as it will be a stand alone tiddler.

<<<
''If you require an HTML page.'' 

After you have<html><a href='http://twmath.tiddlyspot.com/download' class='button'>Downloaded</a></html>TW Math to your local disk  you can construct your page as a tiddler and convert it to an HTML page. Just click 'publish' located in the tiddlers toolbar.  This will publish your HTML page in a folder named 'publish' on your local disk located in the same directory where you've saved TW Math.
<<<

''Please make any comments or suggestions at the ~TiddlyWiki'' [[Discussion Group|http://groups.google.com/group/TiddlyWiki/]]
version.extensions.Math= {major: 0, minor: 1, revision: 1, date: new Date("Oct 31, 2008")};
config.macros.Math= {};
config.macros.Math.handler = function(place,macroName,params) {
var latex= params.join(" ");
var theImage = createTiddlyElement(place,"img");
theImage.src = "http://latex.codecogs.com/gif.latex?" +  latex;
}
<script>
        var tiddlers=store.getTiddlers("modified");
        var last=tiddlers[tiddlers.length-1];
        var when=last.modified.formatString("YYYY/0MM/0DD at 0hh:0mm:0ss");
        return "Last Modified:  " +when
</script> 
!!!<<gradient horiz #fc3 #ffffff>>&nbsp;LatinHtmlEntities&nbsp;^^<<tiddler CloseThisOpen with: Entities-Codes  '« back'>>|<<toolbar editTiddler>>» ^^>>
|>|>| !Latin Letters |
| !Symbol | !upper-case | !lower-case |
| {{{&Agrave;}}} | &Agrave; | &agrave; |
| {{{&Aacute;}}} | &Aacute; | &aacute; |
| {{{&Acirc;}}} | &Acirc; | &acirc; |
| {{{&Atilde;}}} | &Atilde; | &atilde; |
| {{{&Auml;}}} | &Auml; | &auml; |
| {{{&Aring;}}} | &Aring; | &aring; |
| {{{&AElig;}}} | &AElig; | &aelig; |
| {{{&Ccedil;}}} | &Ccedil; | &ccedil; |
| {{{&Egrave;}}} | &Egrave; | &egrave; |
| {{{&Eacute;}}} | &Eacute; | &eacute; |
| {{{&Ecirc;}}} | &Ecirc; | &ecirc; |
| {{{&Euml;}}} | &Euml; | &euml; |
| {{{&Igrave;}}} | &Igrave; | &igrave; |
| {{{&Iacute;}}} | &Iacute; | &iacute; |
| {{{&Icirc;}}} | &Icirc; | &icirc; |
| {{{&Iuml;}}} | &Iuml; | &iuml; |
| {{{&ETH;}}} | &ETH; | &eth; |
| {{{&Ntilde;}}} | &Ntilde; | &ntilde; |
| {{{&Ograve;}}} | &Ograve; | &ograve; |
| {{{&Oacute;}}} | &Oacute; | &oacute; |
| {{{&Ocirc;}}} | &Ocirc; | &ocirc; |
| {{{&Otilde;}}} | &Otilde; | &otilde; |
| {{{&Ouml;}}} | &Ouml; | &ouml; |
| {{{&Oslash;}}} | &Oslash; | &oslash; |
| {{{&Ugrave;}}} | &Ugrave; | &ugrave; |
| {{{&Uacute;}}} | &Uacute; | &uacute; |
| {{{&Ucirc;}}} | &Ucirc; | &ucirc; |
| {{{&Uuml;}}} | &Uuml; | &uuml; |
| {{{&Yacute;}}} | &Yacute; | &yacute; |
| {{{&THORN;}}} | &THORN; | &thorn; |
| {{{&Yuml;}}} | &Yuml; | &yuml; |
| {{{&OElig;}}} | &OElig; | &oelig; |
| {{{&Scaron;}}} | &Scaron; | &scaron; |
| {{{ &szlig;}}} | &szlig; |&szlig; |
<!--{{{-->
<html><hide linbreaks><a onclick="OpenLatexEditor('testbox','tw','',true,'')" style="cursor:pointer;">Launch Equation Editor for TW markup here</a><br><textarea id="testbox" rows="3" cols="40"></textarea></html><br>
<a style="color: #5566ff">1: Compose equation in Editor then click Copy to Document<br>2: Cut and paste equations into tiddler. Compose supporting text. Rename tiddler then click done.</a>
<!--}}}-->
<!--{{{-->
1: Set the cursor in the tiddler where you want the equation to appear.<br>2: Click one of the demo buttons to launch the Equation Editor.
The editor will appear as a popup window with an equation already showing.<br> 3: In the Equation Editor click 'Copy to Document' after the equation renders.<br> 4: Click 'done in the tiddler toolbar above to see the equation.
<!--}}}-->
----
''For an easy trial this will launch the Editor with code already inserted''.
Then just click __Copy to Document__ in editor and it will insert the formula in the text box.
<html><hide linbreaks>
<a onclick="OpenLatexEditor('testbox','tw','',true,'1+sin(x)')" style="cursor:pointer;">Launch Equation Editor for ~TiddlyWiki trial run</a>
<textarea id="testbox" rows="3" cols="40">
</textarea>
</html>
''Find current with Ohms Law in ~AC-Circuits [img[http://latex.codecogs.com/gif.latex?I=\sqrt\frac{P}{{Z}\cos\theta}][<<slider "" "OhmsLawAC-Circuits" "title text" "tooltip" >>]]
/***
|''Name:''|LoadRemoteFileThroughProxy (previous LoadRemoteFileHijack)|
|''Description:''|When the TiddlyWiki file is located on the web (view over http) the content of [[SiteProxy]] tiddler is added in front of the file url. If [[SiteProxy]] does not exist "/proxy/" is added. |
|''Version:''|1.1.0|
|''Date:''|mar 17, 2007|
|''Source:''|http://tiddlywiki.bidix.info/#LoadRemoteFileHijack|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0|
***/
//{{{
version.extensions.LoadRemoteFileThroughProxy = {
 major: 1, minor: 1, revision: 0, 
 date: new Date("mar 17, 2007"), 
 source: "http://tiddlywiki.bidix.info/#LoadRemoteFileThroughProxy"};

if (!window.bidix) window.bidix = {}; // bidix namespace
if (!bidix.core) bidix.core = {};

bidix.core.loadRemoteFile = loadRemoteFile;
loadRemoteFile = function(url,callback,params)
{
 if ((document.location.toString().substr(0,4) == "http") && (url.substr(0,4) == "http")){ 
 url = store.getTiddlerText("SiteProxy", "/proxy/") + url;
 }
 return bidix.core.loadRemoteFile(url,callback,params);
}
//}}}
{{moveovermainmenu textleft{
[img[http://latex.codecogs.com/gif.latex?\inline {\color{blue} I=\sqrt\frac{P}{{Z}\cos\theta}}]]
----
[[Introduction]]
[[Instructions]]
----
{{blueLink{<<tiddler [[A Click Only Demo]]>>}}}
[[IE-Security Issues|IE-Security]]
----
[[Examples]]
[[Examples2|OhmsLawAC-Circuits]]
[[Vortex Curl|2DCurlExampleForJohnKent]]
[[Pearson Example|Pearson]]
[[AnnualAcreFeet]]
[[Alignment|AligningTextWithEquations]]
----
[[Equations for HTML|NewHTMLFormula]]
----
Entities-Codes
MathReferences
----
<<tiddler [[EmailTWMath]]>>
{{blueLink{<html><a href='http://twmath.tiddlyspot.com/download' class='button'>Download TW Math</a></html>}}}
----
<<slider "" "TWLinks" "Other TW Sites" "Links" >>
 
<html><a href="http://www.codecogs.com"><img src="http://www.codecogs.com/images/poweredbycc.gif" border="0" title="CodeCogs - An Open Source Numerical Library" alt="CodeCogs - An Open Source Numerical Library"></a>
</html>
}}}

/%{{c06Link{<<tiddler [[new equation]]>>}}}%/
<!-- Start of StatCounter Code -->
<script type="text/javascript">
var sc_project=4338348; 
var sc_invisible=1; 
var sc_partition=54; 
var sc_click_stat=1; 
var sc_security="ecf78a44"; 
</script>

<script type="text/javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><div class="statcounter"><a title="free web stats" href="http://www.statcounter.com/" target="_blank"><img class="statcounter" src="http://c.statcounter.com/4338348/0/ecf78a44/1/" alt="free web stats" ></a></div></noscript>
<!-- End of StatCounter Code -->
<script type="text/javascript">
var popupwindows = new Array();
function popupnr( url, windowname, refocus, width, height )
{
	if(typeof(popupwindows[windowname])!='undefined')
	  newwindow = popupwindows[windowname];
	else newwindow=null;

  if (newwindow==null || newwindow.closed || !newwindow.location) 
	{
		newwindow=window.open(url,windowname,'width='+width+',height='+height+',status=1,scrollbars=no,resizable=1');
		if (!newwindow.opener) newwindow.opener = self;
		popupwindows[windowname]=newwindow;
	}
	if (window.focus) { newwindow.focus() }
	return false;
}
</script>
<!--{{{-->
<link rel='alternate' type='application/rss+xml' title='RSS' href='index.xml' />
<script type="text/javascript" src="http://latex.codecogs.com/editor.js"></script>
<!--}}}-->
!!!<<gradient horiz #fc3 #ffffff>>&nbsp;MathHtmlEntities&nbsp;^^<<tiddler CloseThisOpen with: Entities-Codes  '« back'>>|<<toolbar editTiddler>>» ^^>>
|>|>| !Math Html Entities |
| !Symbol | !Character | !Description |
| {{{&deg;}}} | &deg; |degree sign |
| {{{&plusmn;}}} | &plusmn; |plus or minus sign |
| {{{&times;}}} | &times; |multiplication sign |
| {{{&divide;}}} | &divide; |division sign |
| {{{&lt;}}} | &lt; |less-than sign |
| {{{&gt;}}} | &gt; |greater-than sign |
| {{{&lang;}}} | &lang; |left angle bracket |
| {{{&rang;}}} | &rang; |right angle bracket |
| {{{&not;}}} | &not; |not sign |
| {{{&sup1;}}} | &sup1; |superscript one |
| {{{&sup2;}}} | &sup2; |superscript two |
| {{{&sup3;}}} | &sup3; |superscript three |
| {{{&middot;}}} | &middot; |middle dot |
| {{{&afrac14;}}} | &frac14; |one quarter |
| {{{&frac12;}}} | &frac12; |one half |
| {{{&frac34;}}} | &frac34; |three quarters |
| {{{&permil;}}} | &permil; |per mille sign |
| {{{&fnof;}}} | &fnof; |latin small f with hook (function) |
| {{{&prime;}}} | &prime; |prime / minutes / feet |
| {{{&Prime;}}} | &Prime; |double prime / seconds / inches |
| {{{&frasl;}}} | &frasl; |fraction slash |
| {{{&weierp;}}} | &weierp; |script capital P |
| {{{&image;}}} | &image; |bold I / imaginary part |
| {{{&real;}}} | &real; |bold R / real part |
| {{{&alefsym;}}} | &alefsym; |first transfinite cardinal |
| {{{&micro;}}} | &micro; |micro sign |
| {{{&forall;}}} | &forall; |for all |
| {{{&part;}}} | &part; |partial differential |
| {{{&exist;}}} | &exist; |there exists |
| {{{&empty;}}} | &empty; |empty set / diameter |
| {{{&nabla;}}} | &nabla; |backward difference |
| {{{&isin;}}} | &isin; |element of |
| {{{&notin;}}} | &notin; |not an element of |
| {{{&ni;}}} | &ni; |contains as member |
| {{{&prod;}}} | &prod; |product sign |
| {{{&sum;}}} | &sum; |n-ary sumation |
| {{{&minus;}}} | &minus; |minus sign |
| {{{&lowast;}}} | &lowast; |asterisk operator |
| {{{&radic;}}} | &radic; |square root / radical |
| {{{&prop;}}} | &prop; |proportional to |
| {{{&infin;}}} | &infin; |infinity |
| {{{&ang;}}} | &ang; |angle |
| {{{&and;}}} | &and; |logical and |
| {{{&or;}}} | &or; |logical or |
| {{{&cap;}}} | &cap; |intersection |
| {{{&cup;}}} | &cup; |union |
| {{{&int;}}} | &int; |integral |
| {{{&there4;}}} | &there4; |therefore |
| {{{&sim;}}} | &sim; |similar to |
| {{{&cong;}}} | &cong; |approximately equal to |
| {{{&asymp;}}} | &asymp; |almost equal to |
| {{{&ne;}}} | &ne; |not equal to |
| {{{&equiv;}}} | &equiv; |identical to |
| {{{&le;}}} | &le; |less-than or equal to |
| {{{&ge;}}} | &ge; |greater-than or equal to |
| {{{&sub;}}} | &sub; |subset of |
| {{{&sup;}}} | &sup; |superset of |
| {{{&nsub;}}} | &nsub; |not a subset of |
| {{{&sube;}}} | &sube; |subset of or equal to |
| {{{&supe;}}} | &supe; |superset of or equal to |
| {{{&oplus;}}} | &oplus; |direct sum |
| {{{&otimes;}}} | &otimes; |vector product |
| {{{&perp;}}} | &perp; |orthogonal to / perpendicular |
| {{{&sdot;}}} | &sdot; |dot operator |
----
[img[http://img36.imageshack.us/img36/1407/tinylightbulb.gif]]
[[CodeCogs Forums|http://www.codecogs.com/pages/forums/forum_view.php?f=28#comments]]
[[Installation - CodeCogs|http://www.codecogs.com/components/equationeditor/equation_install.php]]
[[CodeCogs Commands Page|http://www.codecogs.com/pages/standards/commands.php]]
----
[[Free Online Calculators|http://freeonlinecalculator.net/]]
----
http://www.artofproblemsolving.com/LaTeX/AoPS_L_GuideLay.php
----
''Other Math References:''
*[[Math Help Forum|http://www.mathhelpforum.com/]]
*[[Asciisvg-Scalable Vector Graphics|http://www1.chapman.edu/~jipsen/svg/asciisvg.html]]
*[[Displaying a formula|http://en.wikipedia.org/wiki/Help:Formula]]
*[[LaTeX constants|http://math.chapman.edu/cgi-bin/mathxml.pl?Complete_list_of_LaTeX_constants]]
*[[asciimathcalculator|http://www1.chapman.edu/~jipsen/mathml/asciimathcalculator.html]]
*[[ASciencePad|http://math.chapman.edu/~jipsen/asciencepad/asciencepad.html]]
**[[Download ASciencePad.zip|http://math.chapman.edu/~jipsen/asciencepad/asciencepad.zip]]
*[[ASCIIMathML.js|http://www1.chapman.edu/~jipsen/mathml/asciimathdemo.html]]
*[[TiddlyMath |http://math.chapman.edu/~jipsen/tiddly/tiddlymath.html]]
*[[MathPlayer for IE|http://www.dessci.com/en/products/mathplayer/]]
*[[Moodle|http://moodle.org/]]
*[[Tiddlywiki/Moodle Wiki integration|http://morfeo.upc.es/crom/mod/wiki/view.php?id=22&page=Tiddlywiki+integration+with+New+Moodle+Wiki&gid=0&uid=0]]
[[Creative Solutions|http://www.geocities.com/philip32189/#The%20Limit]]
http://www1.chapman.edu/~jipsen/
http://www.math.ist.utl.pt/~psoares/addons.html
http://www.mayer.dial.pipex.com/tex.htm
http://www.forkosh.com/mimetex.html
http://tinyurl.com/9koare
----
*[[OakRoadSystems|http://oakroadsystems.com/math/mathlinx.htm]] (Builds custom software and does technical writing for clients in business, industry, and government.)
----
''Math for Money'' 
[[Math Magic|http://www.mathmagic.com/]]
[[MathType|http://www.dessci.com/en/products/mathtype/]]
[[BaKoMa TeX|http://www.bakoma-tex.com/]]
----
[[OddMath|http://www.faqs.org/faqs/sci-math-faq/specialnumbers/lawPieq3/]]
/***

|Name|MemorizablePlugin|
|Source|URL: http://memorizable.com|
|Version|1.0.0|
|Author|Craig D. Muth Copyright (c) 2007|
|For use in TiddlyWiki see|http://tinyurl.com/34fjk6|
***/
//{{{
// License
//
// Note: This is a modified version of the X11 (aka MIT) open source
// license.  It lets you use, modify, distribute and sell, etc.,
// requiring only that you leave the "Help" and "About Memorizable
// Tables" links (under "Options") in tact.  If you desire to use the
// software without these links please contact the author.
//
// COPYRIGHT AND PERMISSION NOTICE for Memorizable Tables
//
// Copyright (c) 2007, Craig D. Muth, memorizable.com
// Author's Website URL: http://memorizable.com
//
// All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use, copy,
// modify, merge, publish, distribute, and/or sell copies of the
// Software, and to permit persons to whom the Software is furnished
// to do so, subject to the following conditions:
//
// The above copyright notice, Author's Website URL, and this
// permission notice shall be included in all copies or substantial
// portions of the Software, and any hyperlinks in the user interface
// in the Software which refer to any page on the Author's Website may
// not be removed, disabled, altered, obscured, or repositioned.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE
// COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR
// ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY
// DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
// WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
// ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
// OF THIS SOFTWARE.
//
// Except as contained in this notice, the name of a copyright holder
// shall not be used in advertising or otherwise to promote the sale,
// use or other dealings in this Software without prior written
// authorization of the copyright holder.
//

Mem = new Object();

Mem.blankRowCount = 9;
Mem.mGray = "#d8d4c0";
Mem.mGreen = "#fff";
Mem.mClicked = "#b8b4a0";

Mem.myCellIndex = function(th) {
 var cells = th.parentNode.cells;
 var inn = 0;
 for(var x=0; x<cells.length; x++) {
  if(cells.item(x) == th)
   inn = x;
 }
 return inn;
}
Mem.start = function( item ) {
 var columnClicked;

 item.parentNode.parentNode.parentNode.parentNode.isMem = true;
 var t = this.setT( item );

 columnClicked = Mem.myCellIndex(item.parentNode);

 // If already in progress
 if( t.s && t.s.tbodyBackup ) {
  // Kill blinking processes
  this.tChile('directionsDiv').cycles = 1;
  Mem.restore();
 }

 // Create new if necessary
 if( typeof( t.s ) != 'object')
  t.s = new Array();

 t.s.column = columnClicked;

 // Create backup
 var bak = t.tBodies[0].cloneNode( true );
 t.s.tbodyBackup = bak;

 // Init correct count
 t.s.correctCount = 0;

 t.s.pending = new Array();

 var initialLength = t.tBodies[0].rows.length;
 for(var x=1; x<initialLength; x++) {
  // Build up list of indexes
  t.s.pending[t.s.pending.length] = t.tBodies[0].rows[1];
  // Remove from table
  t.tBodies[0].removeChild( t.tBodies[0].rows[1] );
 }

 t.s.totalQuestions = t.s.pending.length;

 var tds = t.s.pending[0].getElementsByTagName("TD");
 var numberOfColumns=tds.length;

 // Add blank rows to end
 for(var x=1; x<t.s.pending.length; x++) {
  if( x <= this.blankRowCount ) {
   var tr = document.createElement("TR");

   // For each column
   for(var y=0; y<numberOfColumns; y++) {
     var td = document.createElement("TD");  td.innerHTML = "&nbsp;";
     tr.appendChild( td );
   }
   t.tBodies[0].appendChild( tr );
  }
 }

 // If hidden blank rows
 if( t.s.pending.length > this.blankRowCount + 1 ) {

   // Add ... row
   var tr = document.createElement("TR");
   var td = document.createElement("TD");
   //   td.innerHTML = ". &nbsp; . &nbsp; .";
   td.innerHTML = "<div style='text-align: center; font-weight: bold; font-size: 6px; font-family: arial black; margin-top: 2px;'>. &nbsp; &nbsp; . &nbsp; &nbsp; .</div>";
   var colspan = document.createAttribute("COLSPAN");
   colspan.nodeValue=numberOfColumns;
   td.setAttributeNode(colspan);
   tr.appendChild( td );
   //numberOfColumns
   t.tBodies[0].appendChild( tr );

 }

 this.shuffle( t.s.pending ); t.s.pending.reverse(); this.shuffle( t.s.pending );

 // Add buttons, etc. to end of table.
 var tr = document.createElement("TR");
 var statusTd = document.createElement("TD");
 statusTd.id = 'statusTd';
 tr.appendChild( statusTd );
 var colspan = document.createAttribute("COLSPAN");
 colspan.nodeValue=numberOfColumns;
 statusTd.setAttributeNode(colspan);
 t.tBodies[0].appendChild( tr );


 // Create placeholders for buttons, etc.
 statusTd.innerHTML = "\
  <div id=mode style='text-align:right; height:19px; font-size:10px; color:#666;'>" + Mem.getModeDiv(0) + "</div>\
  <div id=directionsDiv style='margin-bottom:4px; text-align: left; font-size:10px; font-family:verdana,arial,sans-serif; color:#666;'></div>\
  <div id=buttons style='float:left; height:21px;'></div>\
  <div id=options style='padding: 5px 0px 0px 8px; width:55px; margin-top:0px; float:right;'><a href='#' onclick='return Mem.showOptions(this);' id=optionsLink>Options</a></div>\
  <div id=progress style='margin-top:6px; float:right; font-size:8px; font-family:impact; color:#aaa; text-align:right; vertical-align:middle; '></div>\
" + this.getOptions();

 // Enable options if enabled before
 if( t.s.optionsOn )
  this.showOptions( statusTd );

 this.presentQuestion();

 this.glow(100);
 t.s.mode = "flashcard";

 return false;
}

Mem.addEvent = function( obj, type, fn ) {
 if ( obj.attachEvent ) {
  obj['e'+type+fn] = fn;
  obj[type+fn] = function() {obj['e'+type+fn]( window.event );}
  obj.attachEvent( 'on'+type, obj[type+fn] );
 } else
  obj.addEventListener( type, fn, false );
}

Mem.getQuestionCell = function() {
 return Mem.t.s.pending[0].cells[ Mem.t.s.column ];
}

Mem.createProgressBar = function() {
 var progress = "";
 var progressDups = "";
 var foundAlready = new Array();
 for(var x=0; x<Mem.t.s.pending.length ;x++) {

  // If found already
  if( foundAlready[ Mem.t.s.pending[x].innerHTML ] )
   progressDups += "|";
  else
   progress += "|";

  // Remember we found this one
  foundAlready[ Mem.t.s.pending[x].innerHTML ] = true;
 }
 return progress + "<span style='color:#f00;'>" + progressDups + "</span>";
}


Mem.presentQuestion = function() {

 this.tChile('directionsDiv').innerHTML = 
  "<div style='text-align:center;'>Guess the answer <b style='color:#4d0'>in your head</b>.<span style='font-size:7px;'></span> Then click <b>show answer</b>, or type <b>1</b>.</div>";
 this.tChile('buttons').innerHTML = "<button id=showAnswer style='margin-right:111px; width:11em; margin-bottom:1px; font-family: verdana,arial,sans-serif; font-size:9px;' onclick='Mem.showAnswer( this )' >show answer &nbsp;<span style='color:#aaa;text-decoration:underline;'>1</span></button>";

 var iveGuessed = this.tChile('showAnswer');
 Mem.addEvent( iveGuessed, 'mouseover', function(){ if(typeof( iveGuessedOnMouseOver ) =='function') iveGuessedOnMouseOver() } );
 Mem.addEvent( iveGuessed, 'mouseout', function(){ if(typeof( iveGuessedOnMouseOver ) =='function') iveGuessedOnMouseOut() } );

 // Add pending row
 Mem.t.tBodies[0].insertBefore( Mem.t.s.pending[0], Mem.t.tBodies[0].rows[ Mem.t.s.correctCount + 1 ] );

 // Insert "guess the answer", remembering old value
 var questionCell = this.getQuestionCell();
 Mem.t.s.questionCellOld = questionCell.innerHTML;
 questionCell.innerHTML = "<span style='text-decoration:none; color:#4d0; font-weight:bold; cursor:pointer;' title=\"Guess the answer in your head.  Then, click the 'show answer' button.\">what&nbsp;goes&nbsp;here?</span>";

 // Help alert
 Mem.addEvent( questionCell.getElementsByTagName("SPAN")[0], 'mousedown', function(){ alert('Guess the answer in your head.  Then, click the \'show answer\' button at the bottom of the table.') } );

 this.tChile('progress').innerHTML = this.createProgressBar();
}

Mem.showAnswer = function( button, noScroll ) {
 var t = this.setT( button );

 // Exit if other mode
 if( t.s.mode != "flashcard" )
  return;

 // Exit if no answer to show
 if( t.s.questionCellOld == null )
  return;

 var questionCell = this.getQuestionCell();
 questionCell.innerHTML = t.s.questionCellOld;
 t.s.questionCellOld = null;

 // Default
 var iWasRightText = "I was right";

 // Count how many of this remaining
 var timesFound = 0;
 for(var x=0; x<t.s.pending.length ;x++)
  if( t.s.pending[x].innerHTML == t.s.pending[0].innerHTML )
   timesFound++;

 // If not the last time
 if( timesFound > 1 )
  iWasRightText = "show later";

 this.tChile('directionsDiv').innerHTML = 
  "<div style='text-align:center;'>Press the appropriate button based on your guess, or type <b>1</b> or <b>2</b>.</div>";
 this.tChile('buttons').innerHTML = "\
<button id=iWasWrong style='width:11em; padding:0px; margin: 0px 12px 1px 0px; font-family: verdana,arial,sans-serif; font-size:9px;' onclick='Mem.answer( false, this )'>I was wrong &nbsp;<span style='color:#aaa;text-decoration:underline;'>1</span></button>\
<button id=iWasRight class='iWasRightButton' style='width:10em; margin-bottom:1px; font-family: verdana,arial,sans-serif; font-size:9px;' onclick='Mem.answer( true, this )' >" + iWasRightText + " &nbsp;<span style='color:#aaa;text-decoration:underline;'>2</span></button>\
";
 this.tChile('progress').innerHTML = this.createProgressBar();

 var iWasRight = this.tChile('iWasRight');
 var iWasWrong = this.tChile('iWasWrong');
 Mem.addEvent( iWasRight, 'mouseover', function(){ if(typeof( iWasRightOnMouseOver ) =='function') iWasRightOnMouseOver() } );
 Mem.addEvent( iWasRight, 'mouseout', function(){ if(typeof( iWasRightOnMouseOut ) =='function') iWasRightOnMouseOut() } );
 Mem.addEvent( iWasWrong, 'mouseover', function(){ if(typeof( iWasWrongOnMouseOver ) =='function') iWasWrongOnMouseOver() } );
 Mem.addEvent( iWasWrong, 'mouseout', function(){ if(typeof( iWasWrongOnMouseOut ) =='function') iWasWrongOnMouseOut() } );

 if(! noScroll)
  this.scrollDownIfNecessary( this.tChile('statusTd') );

}

Mem.answer = function( correct, button, noScroll ) {

 var t = this.setT( button );

 // If answer not shown
 if( t.s.questionCellOld != null )
  return;

 // If other mode
 if( t.s.mode != "flashcard" )
  return;

 var dup = this.currentIsDuplicate();
 var last = t.s.pending[0];

 // Remove from front of pending
 t.s.pending.splice( 0, 1 );

 var allRows = t.tBodies[0].rows;

 if( correct ) {
  // If elsewhere in pending, remove from table
  if( dup )
   t.tBodies[0].removeChild( last );

  // If pending is empty, they're finished
  if( t.s.pending.length == 0 ) {
   this.finished();
   return;
  }

  // If not dup, increase count of correct
  if( ! dup ) {
   t.s.correctCount++;

   // If enough rows in table, remove last one (blank or ...)
   if( t.s.correctCount + this.blankRowCount >= t.s.totalQuestions - 1 )
    t.tBodies[0].removeChild( allRows[allRows.length - 2] );
  }
 }
 // If they missed it
 else {

  // Remove from table
  t.tBodies[0].removeChild( last );
  t.s.pending.push( last );
  t.s.pending.splice( 2, 0, last );
 }

 this.presentQuestion();

 if(this.tChile('directionsDiv').cycles >= 3)
  this.tChile('directionsDiv').cycles = 2;

 if(! noScroll)
  this.scrollDownIfNecessary( this.tChile('statusTd') );
}

Mem.currentIsDuplicate = function() {
 for(var x=1; x<Mem.t.s.pending.length ;x++) {
  if( Mem.t.s.pending[x] == Mem.t.s.pending[0] )
   return true;
 }
 return false;
}

Mem.message = function( s ) {
 var d = document.createElement('div');
 var t = document.createTextNode( s );
 d.appendChild(t);
 document.body.appendChild(d);
}

Mem.shuffle = function( list ) {
  var holder, swaps, i, j;
  for (swaps=0; swaps<(list.length*2); swaps++) {
    i = Math.floor(Math.random()*list.length);
    j = Math.floor(Math.random()*list.length);
    holder = list[i];
    list[i] = list[j];
    list[j]=holder;
  }
  return list;
}

Mem.dump = function( o ) {
 var s = "";
 for(m in o)
  s += m + ", ";
 return s;
}

Mem.keyWasPressed = function( keyp ) {

 var pressed;
 if( navigator.appName == "Netscape" ) pressed = keyp.which;
 if( navigator.appVersion.indexOf("MSIE") != -1 ) pressed = event.keyCode;

 // In case no table in progress
 try {
  // Show answer
  if ( ( pressed == "1".charCodeAt(0) ) || ( pressed == 97 ) ) {
   // If answer not shown yet
   if( Mem.t.s.questionCellOld != null )
    Mem.showAnswer();
   else
    Mem.answer( false );
  }

  // TODO make sure there are no modifiers held down (because of ctrl-r)
  // I was right
  if ( ( pressed == "2".charCodeAt(0) ) || ( pressed == 98 ) )
   Mem.answer( true );

 } catch(e) {}
}

Mem.memorizeAllTables = function( item, onlyDoTheseTables ) {

 // If we are a "hide" link
 if( item.innerHTML == "close" ) {
  item.innerHTML = item.innerHTML_old;

  var removeThis = item.parentNode.getElementsByTagName("DIV")[0];
  // Close and exit
  item.parentNode.removeChild( removeThis );
  return false;
 }

 // Change link to 'close'
 item.innerHTML_old = item.innerHTML;
 item.innerHTML = "close";

 // Create table in new div
 var d = document.createElement("div");
 d.innerHTML = "\
 <table class=\"memorizableAll\"><tr> \
   <th>Left Side <a style=\"font-size: 9px;\" href=\"#\" onclick=\"return Mem.start(this)\">(memorize)</a></th> \
   <th>Right Side <a style=\"font-size: 9px;\" href=\"#\" onclick=\"return Mem.start(this)\">(memorize)</a></th>\
 </tr></table>";

 // Get ref to it
 var tb = d.getElementsByTagName("TBODY")[0];

 var memTableCount = 0;

 // Convert list to map
 var onlyMap = [];
 if( onlyDoTheseTables )
  for(var x=0; x<onlyDoTheseTables.length; x++)
   onlyMap[ onlyDoTheseTables[x].toString() ] = true;

 // For each table
 var ts = document.getElementsByTagName("table");
 for(var x=0; x<ts.length; x++) {

  // In case null pointer when seeking anchor
  try {

   // If mem table
   if( ts[x].id == "memTable" ) {
    memTableCount++;

    if( onlyDoTheseTables && ! onlyMap[memTableCount.toString()] )
     continue;

    var rs = ts[x].rows;

    // If in progress, use backup
    if( ts[x].s && ts[x].s.tbodyBackup )
     rs = ts[x].s.tbodyBackup.rows;

    // Add each row to the table    
    for(var z=1; z<rs.length; z++)
     tb.appendChild( rs[z].cloneNode( true ) );
   }
  } catch(e) {}
 }

 // Append div
 item.parentNode.appendChild( d )

 // Start a session, using the 2nd "(memorize)" link
 Mem.start( d.getElementsByTagName("A")[1] );

 return false;
}

// Returns Y coord of top of element.
Mem.findY = function( o ) {
 var curtop = 0;
 if (o.offsetParent) {
  curtop = o.offsetTop
  while (o = o.offsetParent)
   curtop += o.offsetTop
 }
 return curtop;
}

// Get distance from page top to window bottom
Mem.getWindowBottomY = function() {
 // Get scrollY
 var scrollY = document.body.scrollTop;
 if( window.pageYOffset )
  scrollY = window.pageYOffset

 var winY = document.body.clientHeight;
 if( window.innerHeight )
  winY = window.innerHeight;

 return scrollY + winY;
}

Mem.scrollDownIfNecessary = function( obj ) {
 // If last row close to getting off-screen
 if( this.findY( obj ) + 55 > this.getWindowBottomY() ) {
  // Scroll down smoothly
  var myInterval = window.setInterval(function () { window.scrollBy( 0, 2 ); }, 10);
  window.setTimeout(function () { clearInterval(myInterval); },650);
 }
}

Mem.startFirst = function(level) {
 var as = byid('memTable').getElementsByTagName('a');
 var a = as.length == 1 ? as[0] : as[1];
 Mem.start( a );

 // If 2, start another record
 if(level == 2) {
  Mem.showAnswer(this.tChile('showAnswer'), true);
  Mem.answer(true, this.tChile('iWasRightButton'), true);
  this.tChile('directionsDiv').cycles = 100;
 }
}

Mem.parents = function(node, levels) {
 for(x=1;x<=levels;x++) node = node.parentNode;
 return node; 
}

Mem.showOptions = function(node) {

 this.setT(node);
 this.tChile('optionsLink').style.display="none";
 this.tChile('optionsBox').style.display="block";

 Mem.t.s.optionsOn = true;

 // Don't let clicking on options change default table
 this.restoreTBody();

 return false;
}

Mem.hideOptions = function(node) {

 this.setT(node);
 this.tChile('optionsLink').style.display="block";
 this.tChile('optionsBox').style.display="none";

 Mem.t.s.optionsOn = false;

 // Don't let clicking on options change default table
 this.restoreTBody();

 return false;
}

Mem.close = function( node ) {

 var t = this.setT( node );

 // Don't re-open options
 Mem.t.s.optionsOn = false;

 Mem.restore();

 // Invoke hook if reset
 if(node != null) {
  // In case method not there
  try {
   mem_close( t );
  } catch(e) {}
 }

 return false;
}

Mem.finished = function() {

 var directions = this.tChile('directionsDiv');
 var buttons = this.tChile('buttons');
 // Default values
 directions.innerHTML = "<div style='text-align:center;'>Congratulations, you've finished.</div>";
 buttons.innerHTML = "";

 // Restore rows
 this.addRowsFromBackup();

 // Call hook
 try {
  mem_finished( [directions, buttons] );
 } catch(e) {}

 Mem.glow(2, "finished");
 return false;
}

Mem.startOver = function( node ) {

 var t = this.setT( node );

 if( t.s.mode == "flashcard" )
  Mem.start( t.getElementsByTagName('a')[t.s.column] );

 else if( t.s.mode == "matching" )
  Mem.startMatching( t );

 return false;
}


Mem.startMatching = function( node ) {
 var t = this.setT( node );

 t.s.match0 = t.s.match1 = null;

 // Change help text
 this.tChile('mode').innerHTML = Mem.getModeDiv(1);
 this.tChile('directionsDiv').innerHTML = 
  "<div style='text-align:center;'><b>Note:</b> this table has been <i style='font-weight:bold; color:#f90; cursor: pointer;'><span onclick='Mem.startOver(this);'>shuffled</span></i>. Click items to identify matches.</div>";
 this.tChile('buttons').innerHTML = "";
 this.tChile('progress').innerHTML = "";

 var rows = t.rows;

 // Add rows from backup
 this.addRowsFromBackup();

 // Format them
 rows = t.rows;
 for(var x=1; x<(rows.length-1); x++) {
  var tds = rows[x].cells;
  // Add click events
  Mem.addEvent( tds[0], 'click', function(){ Mem.matchingClicked( this, 0 ) } );
  Mem.addEvent( tds[1], 'click', function(){ Mem.matchingClicked( this, 1 ) } );
  tds[0].style.cursor = tds[1].style.cursor = "pointer";
  tds[0].style.background = tds[1].style.background = tds[0].style.endColor = tds[1].style.endColor = Mem.mGray;
  // Add indexes
  tds[0].mIndex = tds[1].mIndex = x;
 }

 // Shuffle columns
 for (swaps=0; swaps<(rows.length*4); swaps++) {
  Mem.swapOnce(rows,0);
  Mem.swapOnce(rows,1);
 }

 this.glow(100);

 t.s.mode = "matching";

 return false; 
}

Mem.matchingClicked = function(cell, side) {

 // Exit if already correct
 if(cell.mState == "correct")
  return;

 var t = this.setT( cell );

 var rows = t.rows;
 // Update colors of others, and count remaining
 var remaining = 0;
 for(var x=1; x<(rows.length-1); x++) {
  var td = rows[x].cells[side];

  // If gray, clear it
  if((cell != td) && (td.mState == "guess")) {
   td.mState = null;
   td.style.background = td.endColor= Mem.mGray;
  }

  if(td.mState != "correct")  remaining++;
 }

 // Remember this was clicked
 if(side == 0)  t.s.match0 = cell;
 else  t.s.match1 = cell;

 // If already guessed
 if(cell.mState == "guess") {
  cell.mState = null;
  cell.style.background = cell.endColor = Mem.mGray;
  // Clear it
  if(side == 0)  t.s.match0 = null;
  else  t.s.match1 = null;

 } else {
  // Make it selected
  cell.mState = "guess";
  cell.style.background = cell.endColor = Mem.mClicked;
 }

 // Exit if neither are selected
 if(! (t.s.match0 && t.s.match1))
  return;

 // Go through backup table and look for matches
 var found = false;
 var backupRows = t.s.tbodyBackup.getElementsByTagName('tr');

 for(var x=1; x<backupRows.length; x++) {
  var tds = backupRows[x].getElementsByTagName('td');
  if((trim(t.s.match0.innerHTML) == trim(tds[0].innerHTML))
  && (trim(t.s.match1.innerHTML) == trim(tds[1].innerHTML)))
   found = true;
 }

 // If match
 if(found) {
  var directions = this.tChile('directionsDiv');
  if(directions.cycles > 2)
   directions.cycles = 2;

  // Make me dark green
  t.s.match0.mState = t.s.match1.mState = "correct";
  t.s.match0.endColor = t.s.match1.endColor = Mem.mGreen;
  t.s.match0.style.cursor = t.s.match1.style.cursor = "";

  // If finished - congrats message, restore rows
  if(remaining == 1) {
   directions.innerHTML = "<div style='text-align:center;'>Congratulations, you've finished. \
&nbsp; Try <a href='#' onclick='return Mem.flashcardMode(this)'>flashcard mode</a>.</div>";
   Mem.glow(2, "finished");
   this.addRowsFromBackup();
  } else {
   cell.style.background = Mem.mGray;
   Mem.glow(1, "green", t.s.match0, Mem.mGreen);
   Mem.glow(1, "green", t.s.match1, Mem.mGreen);
  }
  t.s.match0 = t.s.match1 = null;

  return;
 }

 // Must not have been found
 cell.style.background = Mem.mGray;
 Mem.glow(1, "red", cell, Mem.mClicked);

}

Mem.swapOnce = function( rows, index ) {
 var r1 = rows[Math.floor(Math.random() * (rows.length-2)) + 1];
 var r2 = rows[Math.floor(Math.random() * (rows.length-2)) + 1];
 var c1 = r1.cells[index];
 r1.replaceChild(r2.cells[index], c1);
 if(index == 0)
  r2.insertBefore(c1, r2.cells[0]);
 else
  r2.appendChild(c1);
}

Mem.getModeDiv = function( index ) {

 var r = "\
<span style='width:260px; text-align:right; padding: 0px 0px 2px 10px; letter-spacing:2px;\
border-left: solid #ccc 1px; \
border-bottom: solid #ccc 1px;'>\
";

 var modes = [["flashcard mode", "return Mem.flashcardMode(this)"], ["matching mode", "return Mem.startMatching(this)"]];
 for(var x=0; x<modes.length; x++) {

  if( x > 0 ) r += " | ";

  if(index == x)
   r += "<b>" + modes[x][0] + "</b>";
  else
   r += "<a style='color:#aaa;' href='#' onclick=\"" + modes[x][1] + "\">" + modes[x][0] + "</a>";

 }   
 r += "</span>";

 return r;
}

Mem.getOptions = function() {
 return "\
 <div style='display:none; line-height:17px; margin:27px 6px 4px 6px; padding: 3px 4px 4px 20px; border:dashed #fc0 2px;' id=optionsBox>\
  <a style='float:right; margin-top:-7px; font-size:9px;' href='#' onClick='return Mem.hideOptions(this)'>Hide Options</a>\
  -&nbsp;<a target='_blank' href='http://memorizable.com/Help'>Help</a>\
  &nbsp; &nbsp; -&nbsp;<a onclick='return Mem.startOver(this)' href='#'>Restart</a>\
  &nbsp; &nbsp; -&nbsp;<a onclick='return Mem.close(this)' href='#'>Cancel</a>\
 <br>\
  -&nbsp;<a target='_blank' href='http://memorizable.com/About_Memorizable_Tables'>About Memorizable Tables</a>\
 </div>\
 ";
}

Mem.setT = function(node) {

 // Return current, if no change
 if(! node)
  return this.t;

 // Remember last, for restoreTBody
 if(( typeof( Mem.t ) == 'object'))
   Mem.lastT = Mem.t;

 // Climb up parent until we find table
 while( ! node.isMem )
  node = node.parentNode;

 this.t = node;

 return node;
}

Mem.lookupT = function(nodex) {

 // Climb up parent until we find table
 while(! nodex.isMem)
  nodex = nodex.parentNode;

 return nodex;
}


Mem.restoreTBody = function() {
 Mem.t = Mem.lastT;
}

Mem.restore = function() {
 var orig = Mem.t.s.tbodyBackup;
 Mem.t.replaceChild( orig, Mem.t.tBodies[0] );
 Mem.t = orig.parentNode;
 // Whipe out ref to backup
 Mem.t.s.tbodyBackup = null;
}

Mem.addRowsFromBackup = function() {
 var t = this.t;
 var rows = t.rows;
 // Delete rows - except top and bottom
 var length = rows.length;
 for(var x=1; x<=length-2; x++)
  t.tBodies[0].removeChild( rows[length - (x+1)] );

 // Make copies from backup, add them to table
 var bak = t.s.tbodyBackup.cloneNode( true );
 var backupRows = bak.getElementsByTagName('tr');
 var length = backupRows.length;
 for(var x=1; x<length; x++)
  t.tBodies[0].insertBefore( backupRows[1], rows[rows.length-1] );
}


Mem.glow = function(cycles, color, glowDiv, endColor) {

 // Remember table
 if(!glowDiv) {
  glowDiv = this.tChile('directionsDiv');
  // Do nothing if already going
  if(glowDiv.cycles >= 1)
    return;
 }

 glowDiv.cycles = cycles;

 if(!endColor)
  endColor = "#fff";
 // Set end color to cell
 glowDiv.endColor = endColor;

 var glowLevel = color == "green" ? 35 : 0;
 var glowIncrement = color == "red" ? 8 : 2;
 if(color == "green") glowIncrement = 1;

 var myInterval = window.setInterval(function () {
  // Stop if cycles over
  if(glowDiv.cycles <= 0) {
   clearInterval(myInterval);
   return;
  }

  // Change level
  glowLevel += glowIncrement;
  // Go darker
  if(glowLevel < 0) {
   glowIncrement = 2;
   glowLevel += glowIncrement;
   // If this is the end, set it to the end color
   if(--glowDiv.cycles == 0) {
    glowDiv.style.background = glowDiv.endColor;
    return;
   }
  }
  // Go lighter
  if(glowLevel > 44) {
   glowIncrement = -2;
   glowLevel += glowIncrement;
   if(glowDiv.cycles == 1) {
    glowIncrement = color == "red" ? -6 : -1;
    if(color == "green") glowIncrement = -6;
   }
  }

  if(color == "red")
    Mem.glowColor(glowDiv, glowLevel, 180, 1, -2, -2);
  else if(color == "green")
    Mem.glowColor(glowDiv, glowLevel, 255, -3, 0, -5);
  else if(color == "finished")
    Mem.glowColor(glowDiv, glowLevel, 255, -2, 0, -4);
  else  // Orange
    Mem.glowColor(glowDiv, glowLevel, 255, 0, -1, -4);

 }, 43);
}

Mem.glowColor = function(glowDiv, glowLevel, start, r, g, b) {
  glowDiv.style.background = "rgb(" + (start+glowLevel*r) + "," + (start+glowLevel*g) + "," + (start+glowLevel*b) + ")";
}

Mem.chile = function(root, idName) {

 var maybe = root.getElementsByTagName( '*' );

 for(var x=0; x<maybe.length; x++)
  if( maybe[x].id == idName )
   return maybe[x];
}

Mem.tChile = function(idName) {

 return this.chile(this.t, idName);
}

Mem.flashcardMode = function(node) {

 Mem.setT(node);
 return Mem.start( Mem.t.getElementsByTagName('a')[Mem.t.s.column] );
}


function trim( s ) {
 return s.replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1");
}

function byid( key ) {
  return document.getElementById( key );
}

Mem.addEvent( document, "keydown", Mem.keyWasPressed );

//}}}
/***
|Name|MiniBrowserPlugin|
|Source|http://www.TiddlyTools.com/#MiniBrowserPlugin|
|Version|1.4.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires|PlayerPlugin (optional, recommended)|
|Overrides||
|Options|##Configuration|
|Description|embedded browser-in-browser with favorites lists and media support|
!!!!!Usage
<<<
{{{<<miniBrowser noplayer expand hidecontrols URL TiddlerName TiddlerName TiddlerName...>>}}}
* ''noplayer'' (optional)<br>disables support for embedded media player (using [[PlayerPlugin]], if installed)
* ''expand'' (optional)<br>displays minibrowser controls on two lines instead of one for increased readability, especially when long titles or URLs are displayed.
* ''hidecontrols'' (optional)<br>hide initial display of minibrowser controls (except for 'show controls' checkbox)<br>//note: if no initial URL is specified, controls will be shown anyway//
* ''URL'' (optional)<br>specifies an initial URL to open when the mini browser is rendered
* ''TiddlerName'', ''TiddlerName''... (optional)<br>indicates one or more tiddlers containing "HR-separated" lists of favorites.<br>//notes: if no tiddler is specified, [[MiniBrowserList]] is used by default.  In addition, when adding/deleting favorites, the plugin automatically updates [[MiniBrowserList]], regardless of any alternative lists of favorites stored in separate tiddlers.  After changes to [[MiniBrowserList]] are made, you can then use cut/paste to manually move entries from that tiddler into other tiddlers.//
<<<
!!!!!Configuration
<<<
Default mini browser size:
width: <<option txtMiniBrowserWidth>> height: <<option txtMiniBrowserHeight>>
<<<
!!!!!Example
>{{{<<miniBrowser>>}}}<br>{{smallform small{<<miniBrowser>>}}}
>{{{<<miniBrowser expand>>}}}<br>{{smallform small{<<miniBrowser expand>>}}}
>{{{<<miniBrowser hidecontrols http://www.TiddlyWiki.com>>}}}<br>{{smallform small{<<miniBrowser hidecontrols http://www.TiddlyWiki.com>>}}}
!!!!!Revisions
<<<
2008.09.30 [1.4.0] removed hard-coded 8pt fontsize.  Added optional "expand" display mode to show controls on two lines instead of one for increased readability.
2008.09.16 [1.3.1] fixed getWikifiedData() when using IE (remove \r and multiple \n)
2008.08.12 [1.3.0] added support for wikifying content from favorites lists to enable use of forEachTiddler or inline script output to generate lists on the fly.
2008.08.06 [1.2.2] corrected size control buttons to use fixed width
2008.04.07 [1.2.1] added txtMiniBrowserWidth and txtMiniBrowserHeight.  cleanup init handling (somewhat)
2008.04.06 [1.2.0] added support for specifying initial URL to view (suggested by Richard Berg).  When opening a URL, select matching entry (if any) in bookmarks droplist.  Added support for hiding minibrowser controls.
2008.01.19 [1.1.0] added support for optional extra favorites lists stored in separate tiddlers
2007.10.15 [1.0.0] combined MiniBrowser and MediaCenter inline scripts and converted to true plugin
2006.03.01 [0.0.0] inline script
<<<
!!!!!Code
***/
//{{{
version.extensions.MiniBrowserPlugin={major: 1, minor: 4, revision: 0, date: new Date(2008,9,30)};
//}}}
//{{{
config.shadowTiddlers.MiniBrowser="<<miniBrowser>>";
//}}}
//{{{
if (config.options.txtMiniBrowserWidth==undefined) config.options.txtMiniBrowserWidth="100%";
if (config.options.txtMiniBrowserHeight==undefined) config.options.txtMiniBrowserHeight="480";
//}}}
//{{{
config.macros.miniBrowser= {
	favoritesList:
		"MiniBrowserList",
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {

		var noPlayer=params[0]&&params[0].toLowerCase()=="noplayer"; if (noPlayer) params.shift();
		if (!config.macros.player) noPlayer=true; // if PlayerPlugin not installed
		var expand=params[0]&&params[0].toLowerCase()=="expand"; if (expand) params.shift();
		var hideControls=params[0]&&params[0].toLowerCase()=="hidecontrols"; if (hideControls) params.shift();
		var url=(params[0]&&!store.tiddlerExists(params[0]))?params.shift():"";
		hideControls=hideControls&&url.length; // if no initial URL, then show controls anyway
		var w=config.options.txtMiniBrowserWidth;
		var h=config.options.txtMiniBrowserHeight;

		// create form
		var guid=new Date().getTime()+Math.random().toString(); // globally unique ID
		var html=this.html;
		html=html.replace(/%id%/g,guid);
		html=html.replace(/%noplayer%/g,noPlayer?"true":"");
		html=html.replace(/%hidecontrols%/g,hideControls?"none":"block");
		html=html.replace(/%bookmarksize%/g,expand?"70%":"20%");
		html=html.replace(/%urlsize%/g,expand?"69.5%":"20%");
		html=html.replace(/%linebreak%/g,expand?"<br>":"");
		html=html.replace(/%favorites%/g,params[0]||config.macros.miniBrowser.favoritesList);
		createTiddlyElement(place,"span").innerHTML=html;

		// init form
		document.getElementById("minibrowser_controls_"+guid).style.display=hideControls?"none":"block";
		document.getElementById("minibrowser_resize_"+guid).style.display=hideControls?"none":"block";
		document.getElementById("minibrowser_togglecontrols_"+guid).checked=!hideControls;
		document.getElementById("minibrowser_form_"+guid).url.value=url;
		document.getElementById("minibrowser_form_"+guid).w.value=w;
		document.getElementById("minibrowser_form_"+guid).h.value=h;
		if (noPlayer) { // hide "type" list no PlayerPlugin
			document.getElementById("minibrowser_type_"+guid).style.display="none";
			document.getElementById("minibrowser_url_"+guid).style.width="36%";
		}

		// load bookmarks droplist from HR-separated tiddler contents
		var b=document.getElementById("minibrowser_bookmarks_"+guid);
		while (b.options[1]) b.options[1]=null; // clear list but leave 'prompt' item
		var p; while (p=params.shift()) this.getFavorites(b,p); // load custom bookmarks
		if (b.length<2) this.getFavorites(b,config.macros.miniBrowser.favoritesList); // default list

		// load initial URL (if any)
		var place=document.getElementById("minibrowser_player_"+guid);
		this.load(place,guid,"","",w,h,true,noPlayer);
		this.go(document.getElementById("minibrowser_form_"+guid));
	},
	getFavorites: function(list,tid) {
		var txt=store.getTiddlerText(tid); if (!txt||!txt.trim().length) return;
		txt=this.getWikifiedData(txt);
		var parts=txt.split("\n----\n");
		for (var p=0; p<parts.length; p++) {
			var lines=parts[p].split("\n");
			var label=lines.shift()||""; // 1st line=display text
			var value=lines.shift()||""; // 2nd line=item value
			var indent=value&&value.length?"\xa0\xa0":"";
			list.options[list.length]=new Option(indent+label,value,false,false);
		}
	},
	getWikifiedData: // wikify tiddler content, then extract text WITH newlines and HRs included
	function(txt) {
		var e=createTiddlyElement(document.body,"div"); wikify(txt,e);
		var breaks=e.getElementsByTagName("br");
		for (var b=0; b<breaks.length; b++)
			breaks[b].parentNode.insertBefore(document.createTextNode("\n"),breaks[b]);
		var lines=e.getElementsByTagName("hr");
		for (var l=0; l<lines.length; l++)
			lines[l].parentNode.insertBefore(document.createTextNode("----\n"),lines[l]);
		var items=e.getElementsByTagName("li");
		for (var i=0; i<items.length; i++)
			items[i].parentNode.insertBefore(document.createTextNode("\n"),items[i]);
		var txt=getPlainText(e);
		removeNode(e);
		return txt.replace(/\r*/g,"").replace(/\n\n/g,"\n");
	},
	load: function(place,id,type,url,w,h,showcontrols,noPlayer) {
		if (noPlayer) {
			if (!place) place=document.getElementById(id).parentNode;
			place.innerHTML="<iframe name='"+id+"' id='"+id+"' \
				src='"+url+"' width='"+w+"' height='"+h+"' \
				style='background:#fff;border:1px solid'></iframe>"
		} else
			config.macros.player.loadURL(place,id,type,url,w,h,showcontrols);
	},
	go: function(f) {
		var url=f.url.value.trim();
		if (!url.length) url=f.url.value=f.bookmarks.value.trim();
		if (!url.length) { this.done(f); return false; }
		var id=f.playerID.value;
		document.getElementById("minibrowser_player_"+id).style.display="block";
		document.getElementById("minibrowser_controls2_"+id).style.display="block";
		this.load(null,id,f.type.value,f.url.value,f.w.value,f.h.value,f.ctrls.checked,f.noPlayer.value=="true");
		var matched=false; for (var i=0; i<f.bookmarks.options.length; i++) // select matching bookmark
			if (f.bookmarks.options[i].value==url) { f.bookmarks.selectedIndex=i; matched=true; break; }
		if (!matched) f.bookmarks.selectedIndex=0;
		f.done.disabled=false;
		return false;
	},
	done: function(f) {
		var id=f.playerID.value;
		this.load(null,id,null,null,f.w.value,0,f.ctrls.checked,f.noPlayer.value=="true");
		document.getElementById("minibrowser_player_"+id).style.display="none";
		document.getElementById("minibrowser_controls2_"+id).style.display="none";
		f.done.disabled=true; 
		return false;
	},
	fit: function(place) {
		var trim=89; 	// fudge factor to account for the other controls + padding + borders.  ADJUST THIS VALUE TO FIT LAYOUT
		var t=story.findContainingTiddler(place);
		if (!t) { t=place; while (t && t.className!='floatingPanel') t=t.parentNode; } if (!t) return;
		var w="100%"; // horizontal stretching via CSS works, but vertical stretching doesn't... so:
		var h=t.offsetHeight-trim; // workaround: get containing panel/tiddler height and subtract "trim" height
		var f=place.form;
		this.load(null,f.playerID.value,f.type.value,f.url.value,w,h,f.ctrls.checked,f.noPlayer.value=="true"); // reload player with new size
		place.form.w.value=w; place.form.h.value=h; // update width/height input fields
	},
	add: function(place,title) {
		var v=place.value; if (!v.length) return;
		var d=prompt("Please enter a description for\n"+place.value); if (!d || !d.length) return;
		var who=config.options.txtUserName;
		var when=new Date();
		var tid=store.getTiddler(title);
		var txt="%0\n%1\n----\n%2".format([d,v,tid?tid.text:""]);
		store.saveTiddler(title,title,txt,who,when,tid?tid.tags:[],tid?tid.fields:{});
		if (!tid) story.displayTiddler(story.findContainingTiddler(place),title);
		else story.refreshTiddler(title,1,true);
		var here=story.findContainingTiddler(place);
		if (here) story.refreshTiddler(here.getAttribute("tiddler"),1,true);
	},
	del: function(place,title) {
		var v=place.value; if (!v.length) return;
		var d=place.options[place.selectedIndex].text; if (!d.length) return;
		if (!confirm("Are you sure you want to remove this favorite?\n\n"+d+"\n"+v)) return;
		var tid=store.getTiddler(title); if (!tid) return;
		var who=config.options.txtUserName;
		var when=new Date();
		var pat='%0\n%1\n----\n'.format([d.replace(/\xa0/g,''),v]); var re=new RegExp(pat,"i");
		var txt=tid.text.replace(re,"");
		store.saveTiddler(title,title,txt,who,when,tid?tid.tags:[],tid?tid.fields:{});
		story.refreshTiddler(title,1,true);
		var here=story.findContainingTiddler(place);
		if (here) story.refreshTiddler(here.getAttribute("tiddler"),1,true);
	},
	html: "<form id='minibrowser_form_%id%' style='display:block;margin:0;padding:0' onsubmit='return config.macros.miniBrowser.go(this);'><!-- \
		--><nobr><input type='hidden' name='playerID' value='%id%'><input type='hidden' name='noPlayer' value='%noplayer%'><!-- \
		--><div id='minibrowser_controls_%id%' style='display:%hidecontrols%'><!-- \
		--><input type='button' value='<' title='back' style='width:3%' \
			onclick='try{window.frames[\"player_%id%\"].history.go(-1)}catch(e){window.history.go(-1)}' ><!-- \
		--><input type='button' value='>' title='forward' style='width:3%' \
			onclick='try{window.frames[\"player_%id%\"].history.go(+1)}catch(e){window.history.go(+1)}'><!-- \
		--><input type='button' value='+' title='refresh'style='width:3%' \
			onclick='try{window.frames[\"player_%id%\"].location.reload()}catch(e){;}'><!-- \
		--><input type='button' value='x' title='stop'style='width:3%' \
			onclick='window.stop()'><!-- \
		--><select name='bookmarks' id='minibrowser_bookmarks_%id%' size='1' style='width:%bookmarksize%' \
			onchange='this.form.url.value=this.value; return config.macros.miniBrowser.go(this.form);'><!-- \
		--><option value=''>bookmarks...</option><!-- \
		--></select><!-- \
		--><input type='button' value='add' title='add URL to the bookmarks' style='width:6%' \
			favorites=\"%favorites%\" \
			onclick='config.macros.miniBrowser.add(this.form.url,this.getAttribute(\"favorites\"));'><!-- \
		--><input type='button' value='del' title='remove URL from the bookmarks' style='width:6%' \
			favorites=\"%favorites%\" \
			onclick='config.macros.miniBrowser.del(this.form.bookmarks,this.getAttribute(\"favorites\"));'><!-- \
		--><input type='button' value='edit' title='edit the bookmarks list' style='width:6%' \
			favorites=\"%favorites%\" \
			onclick='story.displayTiddler(null,this.getAttribute(\"favorites\"),2)'><!-- \
		-->%linebreak%<!-- \
		--><select name='type' id='minibrowser_type_%id%' size='1' style='width:12%' \
			onchange='var opt=this.options; for (var i=0; i<opt.length; i++) \
				if (i==this.selectedIndex) opt[i].text=opt[i].text.replace(/\xa0\xa0/,\"&radic;\"); \
				else opt[i].text=opt[i].text.replace(/&radic;/,\"\xa0\xa0\"); \
				if (this.selectedIndex==0) opt[1].text=opt[1].text.replace(/\xa0\xa0/,\"&radic;\");'><!-- \
		--><option value=''>type...</option><!-- \
		--><option value=''>&radic; auto-detect</option><!-- \
		--><option value='iframe'>&nbsp;&nbsp; web page</option><!-- \
		--><option value='windows'>&nbsp;&nbsp; windows media</option><!-- \
		--><option value='realone'>&nbsp;&nbsp; real one</option><!-- \
		--><option value='quicktime'>&nbsp;&nbsp; quicktime</option><!-- \
		--><option value='flash'>&nbsp;&nbsp; flash</option><!-- \
		--><option value='image'>&nbsp;&nbsp; jpg/gif/png</option><!-- \
		--></select><!-- \
		--><input type='text' name='url' id='minibrowser_url_%id%' size='60' value='' style='width:%urlsize%' \
			onfocus='this.select()'><!-- \
		--><input type='submit' value='go' title='view URL in embedded player' style='width:6%'><!-- \
		--><input type='button' value='open' title='view URL in a separate player' style='width:6%' \
			onclick='if (this.form.url.value.length) window.open(this.form.url.value)'><!-- \
		--><input type='button' value='done' name='done' disabled title='disconnect from URL' style='width:6%' \
			onclick='return config.macros.miniBrowser.done(this.form);'><!-- \
		--></div><!-- \
		--><div id='minibrowser_player_%id%' style='display:none;text-align:center'></div><!-- \
		--><span id='minibrowser_controls2_%id%' style='margin-top:2px;display:none;'><!-- \
		--><div id='minibrowser_resize_%id%' style='display:%hidecontrols%;float:right'><!-- \
		--> size: <input type='text' name='w' size='3' value='' style='' \
			onfocus='this.select()'><!-- \
		-->x<input type='text' name='h' size='3' value='' style='' \
			onfocus='this.select()'><!-- \
		--> <input type='submit' value='set' style='width:5em' \
			onclick='var f=this.form; \
				if(!f.w.value.trim().length) f.w.value=config.options.txtMiniBrowserWidth; \
				if(!f.h.value.trim().length) f.h.value=config.options.txtMiniBrowserHeight; \
				config.options.txtMiniBrowserWidth=f.w.value; config.options.txtMiniBrowserHeight=f.h.value; \
				saveOptionCookie(\"txtMiniBrowserWidth\"); saveOptionCookie(\"txtMiniBrowserHeight\");'><!-- \
		--><input type='submit' value='reset' style='width:5em' \
			onclick='var f=this.form; f.ctrls.checked=true; f.w.value=\"100%\"; f.h.value=\"480\"; \
				config.options.txtMiniBrowserWidth=f.w.value; config.options.txtMiniBrowserHeight=f.h.value; \
				saveOptionCookie(\"txtMiniBrowserWidth\"); saveOptionCookie(\"txtMiniBrowserHeight\");'><!-- \
		--><input type='button' value='fit' title='resize player to fit containing window' style='width:5em' \
			onclick='config.macros.miniBrowser.fit(this)'><!-- \
		--></div><!-- \
		--> <input type='checkbox' name='ctrls' id='minibrowser_togglecontrols_%id%' title='toggle minibrowser controls' CHECKED  \
			onclick='document.getElementById(\"minibrowser_controls_%id%\").style.display=this.checked?\"block\":\"none\"; \
				document.getElementById(\"minibrowser_resize_%id%\").style.display=this.checked?\"block\":\"none\";' \
		><a href='' title='toggle minibrowser controls' \
			onclick='this.previousSibling.click();return false;'>show controls</a><!-- \
		--></span><!-- \
		--></nobr></form> \
	"
}
//}}}
<html><div align="center"><font size="-1"><input type="button" value="&laquo; Back" onClick="history.go(-1)" name="button" class="btn" onmouseover="this.className='btn btnhov'" onmouseout="this.className='btn'"/>@@color:#ffe;|@@<a href="javascript:;" onclick="var tid=story.findContainingTiddler(this); if (tid) story.refreshTiddler(tid.getAttribute('tiddler'),null,true); return false;"><input class="btn" type="button"  onmouseover="this.className='btn btnhov'" onmouseout="this.className='btn'" value="Reload " ></a>@@color:#ffe;|@@<input class="btn" type="button"  onmouseover="this.className='btn btnhov'" onmouseout="this.className='btn'" value="Forward &raquo; "onClick="history.forward()"</font></div></html>
/***
|Name|NestedSlidersPlugin|
|Source|http://www.TiddlyTools.com/#NestedSlidersPlugin|
|Version|2.3.2|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|Slider.prototype.stop|
|Description|show content in nest-able 'slider' or 'floating' panels, without needing to create separate tiddlers for each panel|

!!!!!Configuration
<<<
Enable animation for slider panels
<<option chkFloatingSlidersAnimate>> allow sliders to animate when opening/closing
>(note: This setting is in //addition// to the general option for enabling/disabling animation effects:
><<option chkAnimate>> enable animations (entire document)
>For slider animation to occur, you must also allow animation in general.

Debugging messages for 'lazy sliders' deferred rendering:
<<option chkDebugLazySliderDefer>> show debugging alert when deferring slider rendering
<<option chkDebugLazySliderRender>> show debugging alert when deferred slider is actually rendered
<<<
!!!!!Usage
<<<
When installed, this plugin adds new wiki syntax for embedding 'slider' panels directly into tiddler content.  Use {{{+++}}} and {{{===}}} to delimit the slider content.  You can also 'nest' these sliders as deep as you like (see complex nesting example below), so that expandable 'tree-like' hierarchical displays can be created.  This is most useful when converting existing in-line text content to create in-line annotations, footnotes, context-sensitive help, or other subordinate information displays.

Additional optional syntax elements let you specify
*default to open
*cookiename
*heading level
*floater (with optional CSS width value)
*transient display (clicking elsewhere closes panel)
*custom class/label/tooltip/accesskey
*alternate label/tooltip (displayed when panel is open)
*panelID (for later use with {{{<<DOM>>}}} macro.  See [[DOMTweaksPlugin]])
*automatic blockquote style on panel
*deferred rendering of panel content
The complete syntax, using all options, is:
//{{{
++++(cookiename)!!!!!^width^*{{class{[label=key|tooltip][altlabel|alttooltip]}}}#panelID:>...
content goes here
===
//}}}
where:
* {{{+++}}} (or {{{++++}}}) and {{{===}}}<br>marks the start and end of the slider definition, respectively.  When the extra {{{+}}} is used, the slider will be open when initially displayed.
* {{{(cookiename)}}}<br>saves the slider opened/closed state, and restores this state whenever the slider is re-rendered.
* {{{!}}} through {{{!!!!!}}}<br>displays the slider label using a formatted headline (Hn) style instead of a button/link style
* {{{^width^}}} (or just {{{^}}})<br>makes the slider 'float' on top of other content rather than shifting that content downward.  'width' must be a valid CSS value (e.g., "30em", "180px", "50%", etc.).  If omitted, the default width is "auto" (i.e., fit to content)
* {{{"*"}}} //(without the quotes)//<br>denotes "transient display": when a click occurs elsewhere in the document, the slider/floating panel will be automatically closed.  This is useful for creating 'pulldown menus' that automatically go away after they are used.  //Note: using SHIFT-click on a slider label will open/close that slider without triggering the automatic closing of any transient slider panels that are currently displayed, permitting ''temporary'' display of several transient panels at once.//
* """{{class{[label=key|tooltip][altlabel|alttooltip]}}}"""<br>uses label/tooltip/accesskey.  """{{class{...}}}""", """=key""", """|tooltip""" and """[altlabel|alttooltip]""" are optional.  'class' is any valid CSS class name, used to style the slider label text.  'key' must be a ''single letter only''.  altlabel/alttooltip specifiy alternative label/tooltip for use when slider/floating panel is displayed.
* {{{#panelID:}}}<br>defines a unique DOM element ID that is assigned to the panel element used to display the slider content.  This ID can then be used later to reposition the panel using the {{{<<DOM move id>>}}} macro (see [[DOMTweaksPlugin]]), or to access/modify the panel element through use of {{{document.getElementById(...)}}}) javascript code in a plugin or inline script.
* {{{">"}}} //(without the quotes)//<br>automatically adds blockquote formatting to slider content
* {{{"..."}}} //(without the quotes)//<br>defers rendering of closed sliders until the first time they are opened.  //Note: deferred rendering may produce unexpected results in some cases.  Use with care.//

//Note: to make slider definitions easier to read and recognize when editing a tiddler, newlines immediately following the {{{+++}}} 'start slider' or preceding the {{{===}}} 'end slider' sequence are automatically supressed so that excess whitespace is eliminated from the output.//
<<<
!!!!!Examples
<<<
simple in-line slider: 
{{{
+++
   content
===
}}}
+++
   content
===
----
use a custom label and tooltip: 
{{{
+++[label|tooltip]
   content
===
}}}
+++[label|tooltip]
   content
===
----
content automatically blockquoted: 
{{{
+++>
   content
===
}}}
+++>
   content
===
----
all options combined //(default open, cookie, heading, sized floater, transient, class, label/tooltip/key, blockquoted, deferred)//
{{{
++++(testcookie)!!!^30em^*{{big{[label=Z|click or press Alt-Z to open]}}}>...
   content
===
}}}
++++(testcookie)!!!^30em^*{{big{[label=Z|click or press Alt-Z to open]}}}>...
   content
===
----
complex nesting example:
{{{
+++[get info...=I|click for information or press Alt-I]
	put some general information here,
	plus a floating panel with more specific info:
	+++^10em^[view details...|click for details]
		put some detail here, which could in turn contain a transient panel,
		perhaps with a +++^25em^*[glossary definition]explaining technical terms===
	===
===
}}}
+++[get info...=I|click for information or press Alt-I]
	put some general information here,
	plus a floating panel with more specific info:
	+++^10em^[view details...|click for details]
		put some detail here, which could in turn contain a transient panel,
		perhaps with a +++^25em^*[glossary definition]explaining technical terms===
	===
===
<<<
!!!!!Installation
<<<
import (or copy/paste) the following tiddlers into your document:
''NestedSlidersPlugin'' (tagged with <<tag systemConfig>>)
<<<
!!!!!Revision History
<<<
''2007.11.14 - 2.3.2'' in onClickNestedSlider(), prevent SHIFT-click events from opening a new, empty browser window by setting "cancelBubble=true" and calling "stopPropagation()".  Note: SHIFT-click is still processed as a normal click (i.e., it toggles the slider panel display).  Also, using SHIFT-click will prevent 'transient' sliders from being automatically closed when another slider is opened, allowing you to *temporarily* display several transient sliders at once.
''2007.07.26 - 2.3.1'' in document.onclick(), propagate return value from hijacked core click handler to consume OR bubble up click as needed.  Fixes "IE click disease", whereby nearly every mouse click causes a page transition.
|please see [[NestedSlidersPluginHistory]] for additional revision details|
''2005.11.03 - 1.0.0'' initial public release
<<<
!!!!!Credits
<<<
This feature was implemented by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]] with initial research and suggestions from RodneyGomes, GeoffSlocock, and PaulPetterson.
<<<
!!!!!Code
***/
//{{{
version.extensions.nestedSliders = {major: 2, minor: 3, revision: 2, date: new Date(2007,11,14)};
//}}}

//{{{
// options for deferred rendering of sliders that are not initially displayed
if (config.options.chkDebugLazySliderDefer==undefined) config.options.chkDebugLazySliderDefer=false;
if (config.options.chkDebugLazySliderRender==undefined) config.options.chkDebugLazySliderRender=false;
if (config.options.chkFloatingSlidersAnimate==undefined) config.options.chkFloatingSlidersAnimate=false;

// default styles for 'floating' class
setStylesheet(".floatingPanel { position:absolute; z-index:10; padding:0.5em; margin:0em; \
	background-color:#eee; color:#000; border:1px solid #000; text-align:left; }","floatingPanelStylesheet");
//}}}

//{{{
config.formatters.push( {
	name: "nestedSliders",
	match: "\\n?\\+{3}",
	terminator: "\\s*\\={3}\\n?",
	lookahead: "\\n?\\+{3}(\\+)?(\\([^\\)]*\\))?(\\!*)?(\\^(?:[^\\^\\*\\[\\>]*\\^)?)?(\\*)?(?:\\{\\{([\\w]+[\\s\\w]*)\\{)?(\\[[^\\]]*\\])?(\\[[^\\]]*\\])?(?:\\}{3})?(\\#[^:]*\\:)?(\\>)?(\\.\\.\\.)?\\s*",
	handler: function(w)
		{
			lookaheadRegExp = new RegExp(this.lookahead,"mg");
			lookaheadRegExp.lastIndex = w.matchStart;
			var lookaheadMatch = lookaheadRegExp.exec(w.source)
			if(lookaheadMatch && lookaheadMatch.index == w.matchStart)
			{
				// var defopen=lookaheadMatch[1]
				// var cookiename=lookaheadMatch[2]
				// var header=lookaheadMatch[3]
				// var panelwidth=lookaheadMatch[4]
				// var transient=lookaheadMatch[5]
				// var class=lookaheadMatch[6]
				// var label=lookaheadMatch[7]
				// var openlabel=lookaheadMatch[8]
				// var panelID=lookaheadMatch[9]
				// var blockquote=lookaheadMatch[10]
				// var deferred=lookaheadMatch[11]

				// location for rendering button and panel
				var place=w.output;

				// default to closed, no cookie, no accesskey, no alternate text/tip
				var show="none"; var cookie=""; var key="";
				var closedtext=">"; var closedtip="";
				var openedtext="<"; var openedtip="";

				// extra "+", default to open
				if (lookaheadMatch[1]) show="block";

				// cookie, use saved open/closed state
				if (lookaheadMatch[2]) {
					cookie=lookaheadMatch[2].trim().slice(1,-1);
					cookie="chkSlider"+cookie;
					if (config.options[cookie]==undefined)
						{ config.options[cookie] = (show=="block") }
					show=config.options[cookie]?"block":"none";
				}

				// parse label/tooltip/accesskey: [label=X|tooltip]
				if (lookaheadMatch[7]) {
					var parts=lookaheadMatch[7].trim().slice(1,-1).split("|");
					closedtext=parts.shift();
					if (closedtext.substr(closedtext.length-2,1)=="=")	
						{ key=closedtext.substr(closedtext.length-1,1); closedtext=closedtext.slice(0,-2); }
					openedtext=closedtext;
					if (parts.length) closedtip=openedtip=parts.join("|");
					else { closedtip="show "+closedtext; openedtip="hide "+closedtext; }
				}

				// parse alternate label/tooltip: [label|tooltip]
				if (lookaheadMatch[8]) {
					var parts=lookaheadMatch[8].trim().slice(1,-1).split("|");
					openedtext=parts.shift();
					if (parts.length) openedtip=parts.join("|");
					else openedtip="hide "+openedtext;
				}

				var title=show=='block'?openedtext:closedtext;
				var tooltip=show=='block'?openedtip:closedtip;

				// create the button
				if (lookaheadMatch[3]) { // use "Hn" header format instead of button/link
					var lvl=(lookaheadMatch[3].length>6)?6:lookaheadMatch[3].length;
					var btn = createTiddlyElement(createTiddlyElement(place,"h"+lvl,null,null,null),"a",null,lookaheadMatch[6],title);
					btn.onclick=onClickNestedSlider;
					btn.setAttribute("href","javascript:;");
					btn.setAttribute("title",tooltip);
				}
				else
					var btn = createTiddlyButton(place,title,tooltip,onClickNestedSlider,lookaheadMatch[6]);
				btn.innerHTML=title; // enables use of HTML entities in label

				// set extra button attributes
				btn.setAttribute("closedtext",closedtext);
				btn.setAttribute("closedtip",closedtip);
				btn.setAttribute("openedtext",openedtext);
				btn.setAttribute("openedtip",openedtip);
				btn.sliderCookie = cookie; // save the cookiename (if any) in the button object
				btn.defOpen=lookaheadMatch[1]!=null; // save default open/closed state (boolean)
				btn.keyparam=key; // save the access key letter ("" if none)
				if (key.length) {
					btn.setAttribute("accessKey",key); // init access key
					btn.onfocus=function(){this.setAttribute("accessKey",this.keyparam);}; // **reclaim** access key on focus
				}
				btn.onmouseover=function(event) // mouseover on button aligns floater position with button
					{ if (window.adjustSliderPos) window.adjustSliderPos(this.parentNode,this,this.sliderPanel,this.sliderPanel.className); }

				// create slider panel
				var panelClass=lookaheadMatch[4]?"floatingPanel":"sliderPanel";
				var panelID=lookaheadMatch[9]; if (panelID) panelID=panelID.slice(1,-1); // trim off delimiters
				var panel=createTiddlyElement(place,"div",panelID,panelClass,null);
				panel.button = btn; // so the slider panel know which button it belongs to
				btn.sliderPanel=panel; // so the button knows which slider panel it belongs to
				panel.defaultPanelWidth=(lookaheadMatch[4] && lookaheadMatch[4].length>2)?lookaheadMatch[4].slice(1,-1):"";
				panel.setAttribute("transient",lookaheadMatch[5]=="*"?"true":"false");
				panel.style.display = show;
				panel.style.width=panel.defaultPanelWidth;
				panel.onmouseover=function(event) // mouseover on panel aligns floater position with button
					{ if (window.adjustSliderPos) window.adjustSliderPos(this.parentNode,this.button,this,this.className); }

				// render slider (or defer until shown) 
				w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
				if ((show=="block")||!lookaheadMatch[11]) {
					// render now if panel is supposed to be shown or NOT deferred rendering
					w.subWikify(lookaheadMatch[10]?createTiddlyElement(panel,"blockquote"):panel,this.terminator);
					// align floater position with button
					if (window.adjustSliderPos) window.adjustSliderPos(place,btn,panel,panelClass);
				}
				else {
					var src = w.source.substr(w.nextMatch);
					var endpos=findMatchingDelimiter(src,"+++","===");
					panel.setAttribute("raw",src.substr(0,endpos));
					panel.setAttribute("blockquote",lookaheadMatch[10]?"true":"false");
					panel.setAttribute("rendered","false");
					w.nextMatch += endpos+3;
					if (w.source.substr(w.nextMatch,1)=="\n") w.nextMatch++;
					if (config.options.chkDebugLazySliderDefer) alert("deferred '"+title+"':\n\n"+panel.getAttribute("raw"));
				}
			}
		}
	}
)

// TBD: ignore 'quoted' delimiters (e.g., "{{{+++foo===}}}" isn't really a slider)
function findMatchingDelimiter(src,starttext,endtext) {
	var startpos = 0;
	var endpos = src.indexOf(endtext);
	// check for nested delimiters
	while (src.substring(startpos,endpos-1).indexOf(starttext)!=-1) {
		// count number of nested 'starts'
		var startcount=0;
		var temp = src.substring(startpos,endpos-1);
		var pos=temp.indexOf(starttext);
		while (pos!=-1)  { startcount++; pos=temp.indexOf(starttext,pos+starttext.length); }
		// set up to check for additional 'starts' after adjusting endpos
		startpos=endpos+endtext.length;
		// find endpos for corresponding number of matching 'ends'
		while (startcount && endpos!=-1) {
			endpos = src.indexOf(endtext,endpos+endtext.length);
			startcount--;
		}
	}
	return (endpos==-1)?src.length:endpos;
}
//}}}

//{{{
window.onClickNestedSlider=function(e)
{
	if (!e) var e = window.event;
	var theTarget = resolveTarget(e);
	var theLabel = theTarget.firstChild.data;
	var theSlider = theTarget.sliderPanel
	var isOpen = theSlider.style.display!="none";

	// toggle label
	theTarget.innerHTML=isOpen?theTarget.getAttribute("closedText"):theTarget.getAttribute("openedText");
	// toggle tooltip
	theTarget.setAttribute("title",isOpen?theTarget.getAttribute("closedTip"):theTarget.getAttribute("openedTip"));

	// deferred rendering (if needed)
	if (theSlider.getAttribute("rendered")=="false") {
		if (config.options.chkDebugLazySliderRender)
			alert("rendering '"+theLabel+"':\n\n"+theSlider.getAttribute("raw"));
		var place=theSlider;
		if (theSlider.getAttribute("blockquote")=="true")
			place=createTiddlyElement(place,"blockquote");
		wikify(theSlider.getAttribute("raw"),place);
		theSlider.setAttribute("rendered","true");
	}
	// show/hide the slider
	if(config.options.chkAnimate && (theSlider.className!='floatingPanel' || config.options.chkFloatingSlidersAnimate))
		anim.startAnimating(new Slider(theSlider,!isOpen,e.shiftKey || e.altKey,"none"));
	else
		theSlider.style.display = isOpen ? "none" : "block";
	// reset to default width (might have been changed via plugin code)
	theSlider.style.width=theSlider.defaultPanelWidth;
	// align floater panel position with target button
	if (!isOpen && window.adjustSliderPos) window.adjustSliderPos(theSlider.parentNode,theTarget,theSlider,theSlider.className);
	// if showing panel, set focus to first 'focus-able' element in panel
	if (theSlider.style.display!="none") {
		var ctrls=theSlider.getElementsByTagName("*");
		for (var c=0; c<ctrls.length; c++) {
			var t=ctrls[c].tagName.toLowerCase();
			if ((t=="input" && ctrls[c].type!="hidden") || t=="textarea" || t=="select")
				{ ctrls[c].focus(); break; }
		}
	}
	var cookie=theTarget.sliderCookie;
	if (cookie && cookie.length) {
		config.options[cookie]=!isOpen;
		if (config.options[cookie]!=theTarget.defOpen)
			saveOptionCookie(cookie);
		else { // remove cookie if slider is in default display state
			var ex=new Date(); ex.setTime(ex.getTime()-1000);
			document.cookie = cookie+"=novalue; path=/; expires="+ex.toGMTString();
		}
	}
	// prevent SHIFT-CLICK from being processed by browser (opens blank window... yuck!)
	// but allow plain click to bubble up to page background (to dismiss open popup, if any)
	if (e.shiftKey) { e.cancelBubble=true; if (e.stopPropagation) e.stopPropagation(); }
	return false;
}
//}}}

//{{{
// click in document background closes transient panels 
document.nestedSliders_savedOnClick=document.onclick;
document.onclick=function(ev) { if (!ev) var ev=window.event; var target=resolveTarget(ev);
	// call original click handler
	if (document.nestedSliders_savedOnClick)
		var retval=document.nestedSliders_savedOnClick.apply(this,arguments);
	// if click was inside transient panel (or something contained by a transient panel)... leave it alone
	var p=target;
	while (p)
		if ((p.className=="floatingPanel"||p.className=="sliderPanel")&&p.getAttribute("transient")=="true") break;
		else p=p.parentNode;
	if (p) return retval;
	// otherwise, find and close all transient panels...
	var all=document.all?document.all:document.getElementsByTagName("DIV");
	for (var i=0; i<all.length; i++) {
		 // if it is not a transient panel, or the click was on the button that opened this panel, don't close it.
		if (all[i].getAttribute("transient")!="true" || all[i].button==target) continue;
		// otherwise, if the panel is currently visible, close it by clicking it's button
		if (all[i].style.display!="none") window.onClickNestedSlider({target:all[i].button}) 
	}
	return retval;
};
//}}}

//{{{
// adjust floating panel position based on button position
if (window.adjustSliderPos==undefined) window.adjustSliderPos=function(place,btn,panel,panelClass) {
	if (panelClass=="floatingPanel") {
		var left=0;
		var top=btn.offsetHeight; 
		if (place.style.position!="relative") {
			var left=findPosX(btn);
			var top=findPosY(btn)+btn.offsetHeight;
			var p=place; while (p && p.className!='floatingPanel') p=p.parentNode;
			if (p) { left-=findPosX(p); top-=findPosY(p); }
		}
		if (findPosX(btn)+panel.offsetWidth > getWindowWidth())  // adjust position to stay inside right window edge
			left-=findPosX(btn)+panel.offsetWidth-getWindowWidth()+15; // add extra 15px 'fudge factor'
		panel.style.left=left+"px"; panel.style.top=top+"px";
	}
}

function getWindowWidth() {
	if(document.width!=undefined)
		return document.width; // moz (FF)
	if(document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
		return document.documentElement.clientWidth; // IE6
	if(document.body && ( document.body.clientWidth || document.body.clientHeight ) )
		return document.body.clientWidth; // IE4
	if(window.innerWidth!=undefined)
		return window.innerWidth; // IE - general
	return 0; // unknown
}
//}}}

//{{{
// TW2.1 and earlier:
// hijack Slider animation handler 'stop' handler so overflow is visible after animation has completed
Slider.prototype.coreStop = Slider.prototype.stop;
Slider.prototype.stop = function()
	{ this.coreStop.apply(this,arguments); this.element.style.overflow = "visible"; }

// TW2.2+
// hijack Morpher animation handler 'stop' handler so overflow is visible after animation has completed
if (version.major+.1*version.minor+.01*version.revision>=2.2) {
	Morpher.prototype.coreStop = Morpher.prototype.stop;
	Morpher.prototype.stop = function()
		{ this.coreStop.apply(this,arguments); this.element.style.overflow = "visible"; }
}
//}}}
[img[http://www.yourequations.com/eq.latex?$$ FORMULA GOES HERE $$]]
[img[http://latex.codecogs.com/gif.latex?$$ FORMULA GOES HERE $$]]
[img[http://latex.codecogs.com/gif.latex?\sqrt%5B2%5D{45}]]
<<newTiddler title:'ANewEquationTiddler' tag: 'equation' label: 'NewEquation'>>
[img[http://latex.codecogs.com/gif.latex?\sum_{x-1}^{x+1}+{y}]]
<<newTiddler label:"New Equation" title:'New Equation' text:{{store.getTiddlerText('LaunchEditor')}} tag:'equation'>>
<<tiddler NewFormulaFromTemplate>>
<<newTiddler label:"NewTWFormula" title:'New TW Formula' text:{{store.getTiddlerText('BlankFormula')}} tag:'equation'>>
!!!<<gradient horiz #fc3 #ffffff>>&nbsp;@@color:#04b;Create HTML math formulas with ~CodeCogs Equation Editor@@>>

For code suitable for ~TiddlyWiki markup click  @@color:#C06;''&raquo; &raquo;'' @@ new tiddler
<html><hide linbreaks>
<a onclick="OpenLatexEditor('testbox','html','',false,'')"
 style="cursor:pointer;">Launch Equation Editor for HTML markup here</a>
<textarea id="testbox" rows="3" cols="40">
</textarea>
</html>
Create math formula then click __Copy to Document__ in editor.

See [[Introduction]]
See<<tiddler FormulaSlider>>
<<newTiddler label:"newIframe" title:'New iframe' text:{{store.getTiddlerText('BlankIframe')}} tag:'iframe'>>
[img[http://www.yourequations.com/eq.latex?$\sum_{x-1}^{x+1}={0}$]]
<<tiddler NewIframeFromTemplate>>
{{borderless{
|vertical-align:bottom;<<toggleSideBar "" "" hide>>|<<tiddler NavButtons>>|vertical-align:bottom;Open in a new window [img[Open outside link in a new window|http://img229.imageshack.us/img229/1687/extlink7226466sx5.gif][http://www.numberempire.com/texequationeditor/equationeditor.php]]|
----
<html><div align="center"><iframe  src ="http://www.numberempire.com/texequationeditor/equationeditor.php" width="100%" align="center" height="600" scrolling="auto" frameborder="0" allowtransparency style="border:none;"></iframe></div></html>}}}
Ohms Law for AC circuits &nbsp;&nbsp;  Go To @@color:#C06;''&raquo; &raquo;'' @@ [[Ohms Law for DC circuits|OhmsLawDC-Circuits]]
----
''Variables''
*''P=Power (Watts)''
*''I=Current (Amps)''
*''E=Electromotive Force (Volts across Z)''
*''Z=Impedence (Ohms)''
*''&Theta;=Phase angle in degrees''
----
*@@color:#c06;''Click (memorize this) to start then use control buttons at the bottom''@@
*+++[Help]
<<tiddler TableHelp>>
===

| !Known  | !Answer<br><script label="(memorize this)">return Mem.start(place)</script> |
|''I'' and ''Z'' find @@font-size:12pt;color:#C06;''E''@@|[img[http://latex.codecogs.com/gif.latex?$$E=\inline{I}{Z}$$]]|
|''I'' and ''Z'' find @@font-size:12pt;color:#C06;''P''@@|[img[http://latex.codecogs.com/gif.latex?$$P=\inline{I^2}{Z}\cos\theta$$]]|
|''I'' and ''E'' find @@font-size:12pt;color:#C06;''Z''@@|[img[http://latex.codecogs.com/gif.latex?$$Z=\frac{I}{E}$$]]|
|''I'' and ''E'' find @@font-size:12pt;color:#C06;''P''@@|[img[http://latex.codecogs.com/gif.latex?$$P=\inline{I}{E}\cos\theta$$]]|
|''I'' and ''P''  find @@font-size:12pt;color:#C06; ''Z''@@|[img[http://latex.codecogs.com/gif.latex?$$Z=\frac{P}\left{I^2}\cos\theta$$]]|
|''I'' and ''P''  find @@font-size:12pt;color:#C06; ''E''@@|[img[http://latex.codecogs.com/gif.latex?$$E=\frac{P}\left{I}\cos\theta$$]]|
|''Z'' and ''E''  find @@font-size:12pt;color:#C06; ''I''@@|[img[http://latex.codecogs.com/gif.latex?$$I=\frac{E}{Z}$$]]|
|''Z'' and ''E''  find @@font-size:12pt;color:#C06; ''P''@@|[img[http://latex.codecogs.com/gif.latex?$$P=\frac{{E^2}\cos\theta}{Z}$$]]|
|''Z'' and ''P''  find @@font-size:12pt;color:#C06; ''I''@@|[img[http://latex.codecogs.com/gif.latex?$$I=\sqrt\frac{P}{{Z}\cos\theta}$$]]|
|''Z'' and ''P''  find @@font-size:12pt;color:#C06; ''E''@@|[img[http://latex.codecogs.com/gif.latex?$$E=\sqrt\frac{{P}{Z}}\left\cos\theta$$]]|
|''E'' and ''P''  find @@font-size:12pt;color:#C06; ''I''@@|[img[http://latex.codecogs.com/gif.latex?$$I=\frac{P}{{E}\left\cos\theta}$$]]|
|''E'' and ''P''  find @@font-size:12pt;color:#C06; ''Z''@@|[img[http://latex.codecogs.com/gif.latex?$$Z=\frac{{E^2}\cos\theta}{P}$$]]|

<<slider "" "OhmsLawAC-Circuits" "title text" "tooltip" >>
*''For simple Ohm's Law use the circle method''
[img[http://img338.imageshack.us/img338/9926/ol9578382fk1.jpg]]
*[[For  Ohm's Law including Power use this circle method|OhmsLawCirclePower]]
*''For  Ohm's Law including Power use this circle method''
[img[http://img354.imageshack.us/img354/5100/ohmslawcirclepowecolorxo9.jpg]]
----
Ohms Law for DC circuits &nbsp;&nbsp;Go to @@color:#C06;''&raquo; &raquo;'' @@ [[Ohms Law for AC circuits|OhmsLawAC-Circuits]]
<<<
Go to @@color:#C06;''&raquo; &raquo;'' @@ [[Simple Ohm's Law circle|##Simple Ohm's Law circle]]
Go to @@color:#C06;''&raquo; &raquo;'' @@ [[Ohm's Law circle w/Power|##Ohm's Law circle w/Power]]
<<<
----
''Variables''
*''P=Power (Watts)''
*''I=Current (Amps)''
*''E=Electromotive Force (Volts)''
*''R=Resistance (Ohms)''
----
*@@color:#c06;''Click (memorize this) to start then use control buttons at the bottom''@@
*+++[Help]
<<tiddler TableHelp>>
===

| !Known  | !Answer<br><script label="(memorize this)">return Mem.start(place)</script> |
|''E'' and ''R''  (find) @@font-size:12pt;color:#C06; ''I''@@|[img[http://latex.codecogs.com/gif.latex?$$I=\frac{E}{R}$$]]|
|''E'' and ''I''  find @@font-size:12pt;color:#C06; ''R''@@|[img[http://latex.codecogs.com/gif.latex?$$R=\frac{E}{I}$$]]|
|''I'' and ''R''  find @@font-size:12pt;color:#C06; ''E''@@|[img[http://latex.codecogs.com/gif.latex?$$E=\inline{I}{R}$$]]|
|''I'' and ''R'' find @@font-size:12pt;color:#C06;''P''@@|[img[http://latex.codecogs.com/gif.latex?$$P=\inline{I^2}{R}$$]]|
|''E'' and ''R''  find @@font-size:12pt;color:#C06; ''P''@@|[img[http://latex.codecogs.com/gif.latex?$$P=\frac{E^2}{R}$$]]|
|''E'' and ''I''  find @@font-size:12pt;color:#C06; ''P''@@|[img[http://latex.codecogs.com/gif.latex?$$P=\inline{E}{I}$$]]|
|''P'' and ''R'' find @@font-size:12pt;color:#C06;''E''@@|[img[http://latex.codecogs.com/gif.latex?$$E={PR}$$]]|
|''P'' and ''R'' find @@font-size:12pt;color:#C06;''I''@@|[img[http://latex.codecogs.com/gif.latex?$$I=\sqrt\frac{P}{R}$$]]|
|''P'' and ''I''  find @@font-size:12pt;color:#C06; ''R''@@|[img[http://latex.codecogs.com/gif.latex?$$R=\frac{P}{I^2}$$]]|
|''P'' and ''I''  find @@font-size:12pt;color:#C06; ''E''@@|[img[http://latex.codecogs.com/gif.latex?$$E=\frac{P}{I}$$]]|
|''P'' and ''E''  find @@font-size:12pt;color:#C06; ''I''@@|[img[http://latex.codecogs.com/gif.latex?$$I=\frac{P}{E}$$]]|
|''P'' and ''E''   find @@font-size:12pt;color:#C06; ''R''@@|[img[http://latex.codecogs.com/gif.latex?$$R=\frac{E^2}{P}$$]]|
!Simple Ohm's Law circle
<<tiddler OhmsLawCircle>>

!Ohm's Law circle w/Power
<<tiddler OhmsLawCirclePower>>

<html><style>
#tiddlerOhmsLawDC-Circuits .viewer blockquote {border-left: 2px solid #c06;}
</style></html>
<html> 
<a href="http://www.w3.org/Math/" target="_blank">~MathML</a>
<a href="http://www.cs.tut.fi/%7Ejkorpela/math/" target="_blank"><span class="caps">HTML</span>/CSS</a> 
<a href="http://www1.chapman.edu/%7Ejipsen/mathml/asciimath.html" target="_blank"><span class="caps">ASCII</span> stunts</a>
<a href="http://www.codecogs.com/components/equationeditor/equationeditor.php" target="_blank">Equation Editors</a>
<a href="http://ktd.club.fr/programmation/latexit_en.php" target="_blank">~LaTeX Tools</a>
<a href="http://www.math.union.edu/%7Edpvc/jsmath/" target="_blank">~JavaScript</a></html>
----
The TW Math is an enhanced TiddlyWiki capable of generating math equations. It supplies everything you need to add equations to a tiddler.  


install and configure the equation editor on your own website is provided on this page. Alternatively if you don't want to install anything (perhaps you want to create equations on a 3rd party forum or blog), then the CodeCogs Editor will construct HTML code (see the yellow box at the bottom of the editor) that generates the graphical equations using the CodeCogs servers. If you are familiar with LaTeX, then you can also write the equations out by hand, avoiding the need to use the editor at all.

For example, the following code:
{{{
[img[http://www.yourequations.com/eq.latex?$$f(x)=\displaystyle\frac{(x
+1)^2}{(x+1)}=(x+1)$$]]
}}}
will create:
[img[http://www.yourequations.com/eq.latex?$$f(x)=\displaystyle\frac{(x
+1)^2}{(x+1)}=(x+1)$$]]
<!--{{{-->
<div class='header' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</div><div id='slantedmenu' refresh='content'  force='true' tiddler='TopMenu'></div>
<div id='tiddlersBar' refresh='none' ondblclick='config.macros.tiddlersBar.onTiddlersBarAction(event)'></div>
<div id='mainMenu' refresh='content' tiddler='MainMenu'></div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>

<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
/***
|''Name:''|PasswordOptionPlugin|
|''Description:''|Extends TiddlyWiki options with non encrypted password option.|
|''Version:''|1.0.2|
|''Date:''|Apr 19, 2007|
|''Source:''|http://tiddlywiki.bidix.info/#PasswordOptionPlugin|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0 (Beta 5)|
***/
//{{{
version.extensions.PasswordOptionPlugin = {
	major: 1, minor: 0, revision: 2, 
	date: new Date("Apr 19, 2007"),
	source: 'http://tiddlywiki.bidix.info/#PasswordOptionPlugin',
	author: 'BidiX (BidiX (at) bidix (dot) info',
	license: '[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D]]',
	coreVersion: '2.2.0 (Beta 5)'
};

config.macros.option.passwordCheckboxLabel = "Save this password on this computer";
config.macros.option.passwordInputType = "password"; // password | text
setStylesheet(".pasOptionInput {width: 11em;}\n","passwordInputTypeStyle");

merge(config.macros.option.types, {
	'pas': {
		elementType: "input",
		valueField: "value",
		eventName: "onkeyup",
		className: "pasOptionInput",
		typeValue: config.macros.option.passwordInputType,
		create: function(place,type,opt,className,desc) {
			// password field
			config.macros.option.genericCreate(place,'pas',opt,className,desc);
			// checkbox linked with this password "save this password on this computer"
			config.macros.option.genericCreate(place,'chk','chk'+opt,className,desc);			
			// text savePasswordCheckboxLabel
			place.appendChild(document.createTextNode(config.macros.option.passwordCheckboxLabel));
		},
		onChange: config.macros.option.genericOnChange
	}
});

merge(config.optionHandlers['chk'], {
	get: function(name) {
		// is there an option linked with this chk ?
		var opt = name.substr(3);
		if (config.options[opt]) 
			saveOptionCookie(opt);
		return config.options[name] ? "true" : "false";
	}
});

merge(config.optionHandlers, {
	'pas': {
 		get: function(name) {
			if (config.options["chk"+name]) {
				return encodeCookie(config.options[name].toString());
			} else {
				return "";
			}
		},
		set: function(name,value) {config.options[name] = decodeCookie(value);}
	}
});

// need to reload options to load passwordOptions
loadOptionsCookie();

/*
if (!config.options['pasPassword'])
	config.options['pasPassword'] = '';

merge(config.optionsDesc,{
		pasPassword: "Test password"
	});
*/
//}}}
<html><hide linebreaks>
''Pearson product-moment correlation coefficient''

''Definition''
<p>The statistic is defined as the sum of the products of the standard scores of the two measures divided by the degrees of freedom If the data comes from a sample, then</p>
<dl>
<dd>
<img src="http://latex.codecogs.com/gif.latex?\frac {1}{n - 1} \sum ^n _{i=1} \left( \frac{X_i - \bar{X}}{s_X} \right) \left( \frac{Y_i - \bar{Y}}{s_Y} \right)" /></dd>
</dl>

<p>where</p>
<dl>
<dd><img src="http://latex.codecogs.com/gif.latex?\frac{X_i - \bar{X}}{s_X}, \bar{X}, \text{ and } s_X" /></dd>
</dl>
<p>are the standard score, sample mean, and sample standard deviation (calculated using <i>n</i> − 1 in the denominator).</p>

<p>If the data comes from a population, then</p>
<dl>
<dd><img src="http://latex.codecogs.com/gif.latex?\rho = \frac {1}{n} \sum ^n _{i=1} \left( \frac{X_i - \mu_X}{\sigma_X} \right) \left( \frac{Y_i - \mu_Y}{\sigma_Y} \right)" /></dd>
</dl>
<p>where</p>
<dl>
<dd><img src="http://latex.codecogs.com/gif.latex?\frac{X_i - \mu_X}{\sigma_X}, \mu_X, \text{ and } \sigma_X" /></dd>
</dl>
<p>are the standard score, population mean, and population standard deviation (calculated using <i>n</i> in the denominator).</p>

<p>The result obtained is equivalent to dividing the covariance between the two variables by the product of their standard deviations.</p>
</html>
<<plugins>>
<script>
// get all tiddlers tagged with "systemConfig"
var tids=store.getTaggedTiddlers("systemConfig");
// keep only tiddlers *also* tagged with New
var list=[];
for (var t=0; t<tids.length; t++)
   if (tids[t].isTagged("systemConfig")) list.push(tids[t]);
// create output list of tiddler titles, one per line
var out="";
for (var t=0; t<list.length; t++) out+="*[["+list[t].title+"]]\n";
return out;
</script> 
<div class='viewer' id='contentWrapper'><small><a href="./publish/index.html">Home</a> > %1</small><h1>%0</h1><h2>%1</h2>
<ul>%2
</ul>
<small>Published: %6</small>
</div>


/***
|''Name:''|Publish Macro|
|''Version:''|2.4.1 (2 July 2008)|
|''Source''|http://jackparke.googlepages.com/jtw.html#PublishMacro ([[del.icio.us|http://del.icio.us/post?url=http://jackparke.googlepages.com/jtw.html%23PublishMacro]])|
|''Author:''|[[Jack]]|
|''Type:''|Macro|
!Description
<<doPublish>> tiddlers tagged with these tags <<option txtPublishTags>> (comma seperated) as HTML pages to the subfolder 'publish' (you must create this). Use the [[PublishTemplateHead]] and [[PublishTemplateBody]] templates to style your pages and the [[PublishIndexTemplate]] to define an index page. For publishing individual tiddlers the [[PublishTemplateBodySingle]] template is used.
!Usage
To publish all tagged tiddlers:
{{{<<doPublish>>}}} <<doPublish>>
To publish a single tiddler, use the {{{<<publishTiddler>>}}} macro or add the "publishTiddler" command to your ViewTemplate
!Template placeholders
|!Placeholder|!Meaning|
|%0|Your SiteTitle "<<tiddler SiteTitle>>"|
|%1|The current tiddler title|
|%2|The rendered tiddler HTML|
|%3|CSV list of tags|
|%4|Tiddler modifier|
|%5|Tiddler modified date|
|%6|Tiddler creation date|
|%7|Tiddler wiki text|
!Revision History
* Original by [[Jack]] 24 May 2006
* Updated 2 Jan 2007
* Refactored 4 Jan 2007
* Small improvements
* Publish single tiddlers
* Template placeholder %7 for tiddler's wiki text

!Code
***/
//{{{
version.extensions.doPublish = {
 major: 2,
 minor: 4,
 revision: 1,
 date: new Date("July 2, 2008")
};
config.macros.doPublish = {
 label: "publish",
 prompt: "Publish Tiddlers as HTML files"
};
if (config.options.txtPublishTags == undefined) config.options.txtPublishTags = "Publish";
config.shadowTiddlers.PublishTemplateHead = '<title>%0 - %1</title>\n<link rel="stylesheet" type="text/css" href="style.css"/>\n<meta name="keywords" content="%3"/>'
config.shadowTiddlers.PublishTemplateBody = '<div class=\'viewer\' id=\'contentWrapper\'><small><a href=\"./publish/index.html\">Home</a> > %1</small><h1>%0</h1>\n<h2>%1</h2>\n%2\n<hr>Tags: %3\n<hr>%4, %5&nbsp;(created %6)\n</div>\n'
config.shadowTiddlers.PublishTemplateBodySingle = '<h1>%0</h1>\n<h2>%1</h2>\n%2\n<hr>Tags: %3\n<hr>%4, %5&nbsp;(created %6)\n</div>\n'
config.shadowTiddlers.PublishIndexTemplate = '<div class=\'viewer\' id=\'contentWrapper\'><small><a href="./publish/index.html">Home</a> > %1</small><h1>%0</h1><h2>%1</h2>\n<ul>%2\n</ul>\n<small>Published: %6</small>\n</div>\n';
config.macros.doPublish.handler = function(place)
 {
 if (!readOnly)
 createTiddlyButton(place, this.label, this.prompt, 
 function() {
  doPublish();
  return false;
 },
 null, null, this.accessKey);

}
config.macros.publishTiddler = {
 label : 'publish',
 prompt : 'Publish this tiddler as an HTML file.',
 handler : function(place,macroName,params,wikifier,paramString,tiddler)
 {
  var btn = createTiddlyButton(place, this.label, this.prompt, 
  function(e) {
   if(!e) var e = window.event;
   publishTiddler(this.getAttribute('tiddler'))
   return false;
  },
  null, null, this.accessKey);
  btn.setAttribute('tiddler', tiddler.title);
}}
config.commands.publishTiddler = {handler : function(event,src,title) {publishTiddler(title);},text: "publish", tooltip: "Publish this tiddler as HTML"};
function publishTiddler(title) {
 //debugger
 
 var PublishFolder = getWikiPath('publish');
 var place = document.getElementById(story.container)
 var HTMLTemplateHead = store.getTiddlerText("PublishTemplateHead");
 var HTMLTemplateBody = store.getTiddlerText("PublishTemplateBodySingle") || store.getTiddlerText("PublishTemplateBody");
 HTMLTemplateBody = renderTemplate(HTMLTemplateBody)
 HTMLTemplateBody = wiki2Web(HTMLTemplateBody);
 
 var tiddler = store.getTiddler(title);
 var tiddlerText = store.getValue(tiddler, 'text');
 var tiddlerHTML = wikifyStatic(tiddlerText);
 var HTML = '<html>\n\<head>\n' + HTMLTemplateHead + '\n</head>\n<body>\n' + HTMLTemplateBody + '\n</body>\n</html>';
 HTML = HTML.format([
  wikifyPlain("SiteTitle").htmlEncode(), 
  tiddler.title.htmlEncode(), 
  wiki2Web(tiddlerHTML), 
  tiddler.tags.join(", "), 
  tiddler.modifier, 
  tiddler.modified.toLocaleString(), 
  tiddler.created.toLocaleString(),
  tiddlerText
 ]);
 saveFile(PublishFolder + tiddler.title.filenameEncode() + ".html", HTML);
 //story.closeTiddler(tiddler.title);
 //var indexWin = window.open((PublishFolder + title.filenameEncode() + ".html").replace(/\\/g, "/"), null);
 indexWin.focus();
}
function doPublish() {
 var savedTiddlers = [];
 var tiddlers = store.getTiddlers("title");
 var place = document.getElementById(story.container)
 var HTMLTemplateHead = store.getTiddlerText("PublishTemplateHead");
 var HTMLTemplateBody = store.getTiddlerText("PublishTemplateBody");
 HTMLTemplateBody = renderTemplate(HTMLTemplateBody)
 HTMLTemplateBody = wiki2Web(HTMLTemplateBody);

 var PublishTags = config.options.txtPublishTags || "publish";
 PublishTags = PublishTags.split(",")
 var PublishFolder = getWikiPath('publish');
 if (!PublishFolder) return;
 var indexFile = "";

 var indexFileTemplate = store.getTiddlerText("PublishIndexTemplate");
 // This does not allow <<myMacro>> but wants <div macro="myMacro">
 indexFileTemplate = renderTemplate(indexFileTemplate)
 // This option allows WIKI-syntax but is limited in it's HTML capabilities
 //indexFileTemplate = wikifyStatic(indexFileTemplate)

 for (var t = 0; t < tiddlers.length; t++) {
  var tiddler = tiddlers[t];
  if (tiddler.tags.containsAny(PublishTags)) {
   var tiddlerText = store.getValue(tiddler, 'text');
   var tiddlerHTML = wikifyStatic(tiddlerText);
   var HTML = '<html>\n\<head>\n' + HTMLTemplateHead + '\n</head>\n<body>\n' + HTMLTemplateBody + '\n</body>\n</html>';
   HTML = HTML.format([
   wikifyPlain("SiteTitle").htmlEncode(), 
   tiddler.title.htmlEncode(), 
   wiki2Web(tiddlerHTML), 
   tiddler.tags.join(", "), 
   tiddler.modifier, 
   tiddler.modified.toLocaleString(), 
   tiddler.created.toLocaleString(),
  tiddlerText
   ]);
   //saveFile(PublishFolder + tiddler.created.formatString("YYYY0MM0DD") + ".html", HTML);
   saveFile(PublishFolder + tiddler.title.filenameEncode() + ".html", HTML);
   indexFile += "<li><a href=\"" + tiddler.title.filenameEncode() + ".html" + "\" class=\"tiddlyLink tiddlyLinkExisting\">" + tiddler.title + "</a></li>\n";
   story.closeTiddler(tiddler.title);

  }

 }
 indexFileTemplate = '<html>\n\<head>\n' + HTMLTemplateHead + '\n</head>\n<body>\n' + indexFileTemplate + '\n</body>\n</html>';
 indexFileTemplate = indexFileTemplate.format([wikifyPlain("SiteTitle").htmlEncode(), wikifyPlain("SiteSubtitle").htmlEncode(), "%2", "", "", "", (new Date()).toLocaleString()])

 indexFile = indexFileTemplate.replace("%2", indexFile)
 indexFile = wiki2Web(indexFile);
 saveFile(PublishFolder + "index.html", indexFile)
 saveFile(PublishFolder + "style.css", store.getTiddlerText("StyleSheet") + store.getTiddlerText("StyleSheetLayout") + store.getTiddlerText("StyleSheetColors"))
var indexWin = window.open("file:///" + PublishFolder.replace(/\\/g, "/") + "index.html", null);
 indexWin.focus();

}

function renderTemplate(html) {
 var result = document.createElement("div");
 result.innerHTML = html;
 applyHtmlMacros(result, null);
 var temp = result.innerHTML;
 //result.parentNode.removeChild(result);
 return temp;

}

// Convert wikified text to html
function wiki2Web(wikiHTML) {
 //var regexpLinks = new RegExp("<a tiddlylink=.*?</a>", "img");
 var regexpLinks = /<a[^>]+tiddlylink\s*=\s*["']?\s*?([^ "'>]*)\s*["']?[^>]*>[^<]+<\/a>/img;
 var result = wikiHTML.match(regexpLinks);
 if (result) {
  for (i = 0; i < result.length; i++) {
   var className = result[i].match(/ class="(.*?)"/i) ? result[i].match(/ class="(.*?)"/i)[1] : "";
   var tiddlerName = result[i].match(/ tiddlylink="(.*?)"/i)[1]; 
   var url = tiddlerName.htmlDecode().filenameEncode() + ".html"; 
   var tiddlerLabel = result[i].match(/">(.*?)<\/a>/i)[1]; 
   if (!className.match(/tiddlyLinkNonExisting/i)) 
   wikiHTML = wikiHTML.myReplace(result[i], "<a class=\"" + className + "\" href=\"" + url + "\">" + tiddlerLabel + "</a>"); 
   else
   wikiHTML = wikiHTML.myReplace(result[i], "<a class=\"" + className + "\" title=\"Page does not exist\" href=\"#\">" + tiddlerName + "</a>");

  }
  wikiHTML = wikiHTML.replace(/ href="http:\/\//gi, " target=\"_blank\" href=\"http://");

 }
 return wikiHTML

}
function getWikiPath(folderName) {
 var originalPath = document.location.toString();
 if (originalPath.substr(0, 5) != 'file:') {
  alert(config.messages.notFileUrlError);
  if (store.tiddlerExists(config.messages.saveInstructions))
  story.displayTiddler(null, config.messages.saveInstructions);
  return;

 }
 var localPath = getLocalPath(originalPath);
 var backSlash = localPath.lastIndexOf('\\') == -1 ? '/': '\\';
 var dirPathPos = localPath.lastIndexOf(backSlash);
 var subPath = localPath.substr(0, dirPathPos) + backSlash + (folderName ? folderName + backSlash: '');
 return subPath;

}

// Replace without regex
String.prototype.myReplace = function(sea, rep) {
 var t1 = this.indexOf(sea);
 var t2 = parseInt(this.indexOf(sea)) + parseInt(sea.length);
 var t3 = this.length;
 return this.substring(0, t1) + rep + this.substring(t2, t3)

}
// Convert illegal characters to underscores
String.prototype.filenameEncode = function()
 {
 return (this.toLowerCase().replace(/[^a-z0-9_-]/g, "_"));

}
//}}}
/%
|Name|QuickEditToolbar|
|Source|http://www.TiddlyTools.com/#QuickEditToolbar|
|Version|2.1.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin, InlineJavascriptPlugin|
|Optional|QuickEdit_replace, QuickEdit_split, QuickEdit_link, QuickEdit_macro, QuickEdit_image, QuickEdit_tiddler, QuickEdit_file, QuickEdit_format, QuickEdit_sort|
|Overrides||
|Description|quickly insert TiddlyWiki tiddler links or common formatting sequences directly into tiddler content|

Usage (in EditTemplate): <div macro='tiddler QuickEditToolbar with: show'></div>

where "show" is an OPTIONAL keyword to force the toolbar to be displayed regardless of the current 'toggle' state

%/<<tiddler HideTiddlerTags>>/%

TOOLBAR DEFINITIONS BEGIN HERE...
= = = = = = = = = = = = = = = = =
%/{{hidden fine center quickEdit{
<script>
	// note: always show toolbar when directly viewing the tiddler containing the actual toolbar definition!
	var here=story.findContainingTiddler(place); if (here) var tid=here.getAttribute("tiddler");
	var show="$1"!="$"+"1"||config.options.chkShowQuickEdit||tid=="QuickDemoToolbar" 
	place.style.display=show?"block":"none";
</script>/%
%/<<tiddler QuickEdit_Demo1>>/%
%/ &nbsp;/% (SPACER)
%/<<tiddler QuickEdit_Demo2>>/%
%/ &nbsp;/% (SPACER)
%/<<tiddler QuickEdit_Demo3>>/%
%/ &nbsp;/% (SPACER)
%/<<tiddler QuickEdit_Demo4>>/%
%/ &nbsp;/% (SPACER)
%/<<tiddler QuickEdit_Demo5>>/%

%/}}}
 @@color:#C06;''&raquo; &raquo;'' @@ Get it here http://tiddlytools.com/#QuickEditPackage 

Provides a secondary toolbar for use when editing a tiddler.  This toolbar allows you to quickly insert TiddlyWiki tiddler links, images, macros, etc. or common formatting sequences directly into tiddler content, as well as providing find/replace, sort, and 'split' functions that operate on the tiddler source content displayed in the editor.

{{textleft{<<tiddler QuickEditToolbar with: show>>}}}
+++[installation instructions...]>...
After importing these tiddlers, add the following line to your EditTemplate:
{{{
<div macro='tiddler QuickEditToolbar'></div>
}}}
and add the following line to your StyleSheet:
{{{
[[StyleSheetShortcuts]]
}}}
Note that, after adding the QuickEditToolbar to your EditTemplate, it is //not automatically displayed when editing a tiddler//.  To enable display of the toolbar, you can add the following configuration option control to your SideBarOptions (or any other suitable location):
{{{
<<option chkShowQuickEdit>> show QuickEdit toolbar
}}}
When this option is checked and you subsequently edit a tiddler, the QuickEditToolbar will then be displayed.  Alternatively, you can 'hard-code' this setting, so that the QuickEditToolbar will //always// be displayed, by creating a tiddler (e.g., ConfigTweaks), tagged with <<tag systemConfig>>, containing:
{{{
config.options.chkShowQuickEdit=true;
}}}
Optionally, to add a tiddler command item that toggles the display of the QuickEditToolbar while editing a tiddler, insert the following line to your EditTemplate:
{{{
<span class='toolbar' macro='toolbar toggleQuickEdit'></span>
}}}
You can also add individual ~QuickEdit toolbar buttons (e.g. [[QuickEdit_replace]], [[QuickEdit_link]], etc) directly to the tiddler editor menu, by inserting one or more lines to your EditTemplate, like this:
{{{
<span class='toolbar' macro='tiddler QuickEdit_replace'></span>
}}}
===
/***
|Name|QuickEditPlugin|
|Source|http://www.TiddlyTools.com/#QuickEditPlugin|
|Documentation|http://www.TiddlyTools.com/#QuickEditPlugin|
|Version|2.4.2|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|Support functions for ~QuickEdit package: styles, utility functions, and 'toggleQuickEdit' command|
!!!!!Revisions
<<<
2009.05.07 [2.4.2] added processed() function to abbreviate event handler code
2008.09.07 [2.4.1] added removeCookie() function for compatibility with [[CookieManagerPlugin]]
2008.05.17 [2.4.0] copied code from StickyPopupPlugin to remove dependency
2008.05.12 [2.3.0] added "toggleQuickEdit" command handler (replaces inline script command)
2008.01.11 [2.2.0] converted from inline script
2007.03.29 [1.0.0] initial release (as inline script)
<<<
!!!!!Code
***/
//{{{
version.extensions.QuickEditPlugin= {major: 2, minor: 4, revision: 2, date: new Date(2009,5,7)};

// SET STYLESHEET
setStylesheet("\
.quickEdit a { border:2px outset ButtonFace; padding:0px 3px !important; \
	-moz-border-radius:.5em; -webkit-border-radius:.5em; \
	-moz-appearance:button !important; -webkit-appearance:push-button !important; \
	background-color:ButtonFace; color:ButtonText !important;  \
	line-height:200%; font-weight:normal; } \
.quickEdit a:hover { border: 2px inset ButtonFace; background-color:ButtonFace; }\
", "quickEditStyles");

// REMOVE COOKIE
if (window.removeCookie===undefined) {
	window.removeCookie=function(name) {
		document.cookie = name+'=; expires=Thu, 01-Jan-1970 00:00:01 UTC; path=/;'; 
	}
}

// UTILITY FUNCTIONS
config.quickEdit = {
	processed: function(ev) {
		ev.cancelBubble=true;
		if(ev.stopPropagation) ev.stopPropagation();
		return false;
	},
	getField: function(where) {
		var here=story.findContainingTiddler(where); if (!here) return null;
		var e=story.getTiddlerField(here.getAttribute("tiddler"),"text");
		if (e&&e.getAttribute("edit")=="text") return e;
		return null;
	},
	setSelection: function(where,newtext) {
		var e=this.getField(where); if (!e) return false;
		e.focus(); replaceSelection(e,newtext);
		return false;
	},
	wrapSelection: function(where,before,after) {
		var e=this.getField(where); if (!e) return false;
		e.focus(); replaceSelection(e,before+config.quickEdit.getSelection(e)+after);
		return false;
	},
	getSelection: function(e) {
		var seltext="";
		if (e&&e.setSelectionRange)
			seltext=e.value.substr(e.selectionStart,e.selectionEnd-e.selectionStart);
		else if (document.selection) {
			var range = document.selection.createRange();
			if (range.parentElement()==e) seltext=range.text
		}
		return seltext;
	},
	promptForFilename: function(msg,path,file) {
		if(window.Components) { // moz
			try {
				netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
				var nsIFilePicker = window.Components.interfaces.nsIFilePicker;
				var picker = Components.classes['@mozilla.org/filepicker;1'].createInstance(nsIFilePicker);
				picker.init(window, msg, nsIFilePicker.modeOpen);
				var thispath = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
				thispath.initWithPath(path);
				picker.displayDirectory=thispath;
				picker.defaultExtension='jpg';
				picker.defaultString=file;
				picker.appendFilters(nsIFilePicker.filterAll|nsIFilePicker.filterImages);
				if (picker.show()!=nsIFilePicker.returnCancel)
					var result="file:///"+picker.file.persistentDescriptor.replace(/\\/g,'/');
			}
			catch(e) { alert('error during local file access: '+e.toString()) }
		}
		else { // IE
			try { // XP only
				var s = new ActiveXObject('UserAccounts.CommonDialog');
				s.Filter='All files|*.*|JPG files|*.jpg|GIF files|*.gif|PNG files|*.png|';
				s.FilterIndex=1; // default to JPG
				s.InitialDir=path;
				s.FileName=file;
				if (s.showOpen()) var result=s.FileName;
			}
			catch(e) { var result=prompt(msg,path+file); } // fallback for non-XP IE
		}
		return result;
	}
}
//}}}

//{{{
if (config.options.chkShowQuickEdit===undefined) config.options.chkShowQuickEdit=false;
config.commands.toggleQuickEdit = {
	hideReadOnly: true,
	getText: function() { return config.options.chkShowQuickEdit?'\u221Aquickedit':'quickedit'; },

	tooltip: 'show QuickEdit toolbar buttons',
	handler: function(event,src,title) {
		config.options.chkShowQuickEdit=!config.options.chkShowQuickEdit;
		config.macros.option.propagateOption("chkShowQuickEdit","checked", config.options.chkShowQuickEdit,"input");
		if (config.options.chkShowQuickEdit) saveOptionCookie("chkShowQuickEdit");
		else removeCookie("chkShowQuickEdit");
		src.innerHTML=config.commands.toggleQuickEdit.getText();
		story.forEachTiddler(function(t,e){if (story.isDirty(t)) refreshElements(e);});
		return false;
	}
};
//}}}

// // COPIED FROM [[StickyPopupPlugin]] TO ELIMINATE PLUGIN DEPENDENCY
//{{{
if (config.options.chkStickyPopups==undefined) config.options.chkStickyPopups=false;
Popup.stickyPopup_onDocumentClick = function(ev)
{
	// if click is in a sticky popup, ignore it so popup will remain visible
	var e = ev ? ev : window.event; var target = resolveTarget(e);
	var p=target; while (p) {
		if (hasClass(p,"popup") && (hasClass(p,"sticky")||config.options.chkStickyPopups)) break;
		else p=p.parentNode;
	}
	if (!p) // not in sticky popup (or sticky popups disabled)... use normal click handling
		Popup.onDocumentClick(ev);
	return true;
};
try{removeEvent(document,"click",Popup.onDocumentClick);}catch(e){};
try{addEvent(document,"click",Popup.stickyPopup_onDocumentClick);}catch(e){};
//}}}
/%
|Name|QuickEditToolbar|
|Source|http://www.TiddlyTools.com/#QuickEditToolbar|
|Version|2.1.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin, InlineJavascriptPlugin|
|Optional|QuickEdit_replace, QuickEdit_split, QuickEdit_link, QuickEdit_macro, QuickEdit_image, QuickEdit_tiddler, QuickEdit_file, QuickEdit_format, QuickEdit_sort|
|Overrides||
|Description|quickly insert TiddlyWiki tiddler links or common formatting sequences directly into tiddler content|

Usage (in EditTemplate): <div macro='tiddler QuickEditToolbar with: show'></div>

where "show" is an OPTIONAL keyword to force the toolbar to be displayed regardless of the current 'toggle' state

%/<<tiddler HideTiddlerTags>>/%

TOOLBAR DEFINITIONS BEGIN HERE...
= = = = = = = = = = = = = = = = =
%/{{hidden fine center quickEdit{
<script>
	// note: always show toolbar when directly viewing the tiddler containing the actual toolbar definition!
	var here=story.findContainingTiddler(place); if (here) var tid=here.getAttribute("tiddler");
	var show="$1"!="$"+"1"||config.options.chkShowQuickEdit||tid=="QuickEditToolbar" 
	place.style.display=show?"block":"none";
</script>/%
%/<<tiddler QuickEdit_format>>/%
%/<<tiddler QuickEdit_align>>/%
%/<<tiddler QuickEdit_color>>/%
%/<<tiddler QuickEdit_font>>/%
%/ &nbsp;/% (SPACER)
%/<<tiddler QuickEdit_custom>>/%
%/ &nbsp;/% (SPACER)
%/<<tiddler QuickEdit_equation>>/%
%/ &nbsp;/% (SPACER)
%/<<tiddler QuickEdit_link>>/%
%/<<tiddler QuickEdit_macro>>/%
%/<<tiddler QuickEdit_image>>/%
%/<<tiddler QuickEdit_tiddler>>/%
%/}}}
<html><hide linebreaks><a href="javascript:;" class="tiddlyLink"	title="embed an equation" onclick="config.quickEdit.id='eqntarget'; OpenLatexEditor('eqntarget','tw','',true,'I=\\sqrt\\frac{P}{{Z}\cos\\theta}')">Demo1</a></html>
<html><hide linebreaks><a href="javascript:;" class="tiddlyLink"	title="embed an equation" onclick="config.quickEdit.id='eqntarget'; OpenLatexEditor('eqntarget','tw','',true,'f(x)=\\displaystyle\\frac{(x+1)^2}{(x+1)}=(x+1)')">Demo2</a></html>
<html><hide linebreaks><a href="javascript:;" class="tiddlyLink"	title="embed an equation" onclick="config.quickEdit.id='eqntarget'; OpenLatexEditor('eqntarget','tw','',true,'E=\\frac{P}\\left{I}\\cos\\theta')">Demo3</a></html>
<html><hide linebreaks><a href="javascript:;" class="tiddlyLink"	title="embed an equation" onclick="config.quickEdit.id='eqntarget'; OpenLatexEditor('eqntarget','tw','',true,'\\frac{1+sin(x)}{x}')">Demo4</a></html>
<html><hide linebreaks><a href="javascript:;" class="tiddlyLink"	title="embed an equation" onclick="config.quickEdit.id='eqntarget'; OpenLatexEditor('eqntarget','tw','',true,'\\nabla\\times\\vec{v}=\\vec{i}_{r}\\times\\frac{\\partia  l}{\\partial{r}}(\\frac{\\Gamma}{2\\pi{r}}\\vec{i}_{\\th  eta})+\\vec{i}_{\\theta}\\times\\frac{1}{r}\\frac{\\partial}{\\partial{\\theta}}(\\frac{\\Gamma}{2\\pi{r}}\\vec{  i}_{\\theta})=-\\frac{\\Gamma}{2\\pi{r}^{2}}(\\vec{i}_{r}\\times\\vec{i  }_{\\theta}+\\vec{i}_{\\theta}\\times\\vec{i}_{r})=\\vec  {0} ')">Demo5</a></html>
/%
|Name|QuickEdit_align|
|Source|http://www.TiddlyTools.com/#QuickEdit_align|
|Version|2.2.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|definition for toolbar button for text alignment|

Usage:
QuickEditToolbar: <<tiddler QuickEdit_align>>
OR
EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_align'></span>

**** ALIGNMENT ****
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink"
title="align text"
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
	var s=createTiddlyElement(p,'select'); s.button=this;
	s.options[0]=new Option('select text alignment...','');
	s.onchange=function(){
		config.quickEdit.wrapSelection(this.button,'{{'+this.value+'{','}}}');
		Popup.remove(); return false;
	};
	s.options[s.length]=new Option('left','left');
	s.options[s.length-1].title='{{left{...}}}';
	s.options[s.length]=new Option('center','center');
	s.options[s.length-1].title='{{center{...}}}';
	s.options[s.length]=new Option('right','right');
	s.options[s.length-1].title='{{right{...}}}';
	s.options[s.length]=new Option('justify','justify');
	s.options[s.length-1].title='{{justify{...}}}';
	s.options[s.length]=new Option('float left','floatleft');
	s.options[s.length-1].title='{{floatleft{...}}}';
	s.options[s.length]=new Option('float right','floatright');
	s.options[s.length-1].title='{{floatright{...}}}';
	Popup.show(p,false);
	event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation();return false;"
>align</a></html>
/%
|Name|QuickEdit_color|
|Source|http://www.TiddlyTools.com/#QuickEdit_color|
|Version|2.2.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|definition of toolbar button for "color" command|

Usage:
QuickEditToolbar: <<tiddler QuickEdit_color>>
OR
EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_color'></span>

**** COLOR ****
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink"
title="text/background color - @@color:#RGB;background-color:#RGB;...@@"
onclick="var p=Popup.create(this,null,'popup sticky smallform'); if (!p) return false;
 	p.style.padding='2px';
	function hex(d) { return '0123456789ABCDEF'.substr(d,1); }
	var fg=createTiddlyElement(p,'select'); fg.button=this;
	fg.style.width='12em';
	fg.options[0]=new Option('text color...','');
	fg.options[1]=new Option('\xa0 or enter a value','_ask');
	fg.options[2]=new Option('\xa0 or use default color','');
	for (var r=0;r<16;r+=3) for (var g=0;g<16;g+=3) for (var b=0;b<16;b+=3) {
		var label=hex(r)+hex(g)+hex(b);
		fg.options[fg.length]=new Option(label,'#'+label);
		fg.options[fg.length-1].style.color='#'+label;
	}
	fg.onchange=function(){ var val=this.value;
		if (val=='_ask') { val=prompt('Enter a CSS color value');
		if (!val||!val.length) return false; }
		this.options[0].value=val; this.options[0].text=val.length?'text: '+val:'text color...';
		var bg=this.nextSibling;
		for (var i=3;i<bg.options.length;i++) bg.options[i].style.color=val;
		var preview=this.nextSibling.nextSibling.nextSibling;
		var t=config.quickEdit.getSelection(config.quickEdit.getField(this.button));
		t=t.replace(/^@@(color\:.+;)?(background-color\:.+;)?/,'').replace(/@@$/,'');
		if (!t.length) t='~AaBbCcDdEeFfGgHhIiJj 1234567890';
		var fg=this.value; if (fg.length) fg='color:'+fg+';';
		var bg=this.nextSibling.value; if (bg.length) bg='background-color:'+bg+';';
		if (fg.length||bg.length) t='@@'+fg+bg+t+'@@';
		removeChildren(preview); wikify(t,preview);
		this.selectedIndex=0; return false;
	};
	var bg=createTiddlyElement(p,'select'); bg.button=this;
	bg.style.width='12em';
	bg.options[0]=new Option('background color...','');
	bg.options[1]=new Option('\xa0 or enter a value','_ask');
	bg.options[2]=new Option('\xa0 or use default color','');
	for (var r=0;r<16;r+=3) for (var g=0;g<16;g+=3) for (var b=0;b<16;b+=3) {
		var label=hex(15-r)+hex(15-g)+hex(15-b);
		bg.options[bg.length]=new Option(label,'#'+label);
		bg.options[bg.length-1].style.backgroundColor='#'+label;
	}
	bg.onchange=function(){ var val=this.value;
		if (val=='_ask') { val=prompt('Enter a CSS color value');
		if (!val||!val.length) return false; }
		this.options[0].value=val;
		this.options[0].text=val.length?'background: '+val:'background color...';
		var fg=this.previousSibling;
		for (var i=3;i<fg.options.length;i++) fg.options[i].style.backgroundColor=val;
		var preview=this.nextSibling.nextSibling;
		var t=config.quickEdit.getSelection(config.quickEdit.getField(this.button));
		t=t.replace(/^@@(color\:.+;)?(background-color\:.+;)?/,'').replace(/@@$/,'');
		if (!t.length) t='~AaBbCcDdEeFfGgHhIiJj 1234567890';
		var fg=this.previousSibling.value; if (fg.length) fg='color:'+fg+';';
		var bg=this.value; if (bg.length) bg='background-color:'+bg+';';
		if (fg.length||bg.length) t='@@'+fg+bg+t+'@@';
		removeChildren(preview); wikify(t,preview);
		this.selectedIndex=0; return false;
	};
	var b=createTiddlyElement(p,'input',null,null,null,{type:'button'}); b.button=this;
	b.value='ok'; b.style.width='4em';
	b.onclick=function() {
		var fg=this.previousSibling.previousSibling.value; if (fg.length) fg='color:'+fg+';';
		var bg=this.previousSibling.value; if (bg.length) bg='background-color:'+bg+';';
		var t=config.quickEdit.getSelection(config.quickEdit.getField(this.button));
		t=t.replace(/^@@(color\:.+;)?(background-color\:.+;)?/,'').replace(/@@$/,'');
		if (fg.length||bg.length) config.quickEdit.setSelection(this.button,'@@'+fg+bg+t+'@@');
		Popup.remove(); return false;
	};
	var preview=createTiddlyElement(p,'div',null,'viewer'); var s=preview.style;
	s.border='1px solid'; s.margin='2px'; s.width='24em'; s.padding='3px'; s.MozBorderRadius='3px';
	s.overflow='hidden'; s.textAlign='center'; s.whiteSpace='normal';
	var t=config.quickEdit.getSelection(config.quickEdit.getField(this));
	wikify(t.length?t:'~AaBbCcDdEeFfGgHhIiJj 1234567890',preview);
	Popup.show(p,false);
	event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation();return false;"
>color</a></html>
/%
|Name|QuickEdit_css|
|Source|http://www.TiddlyTools.com/#QuickEdit_css|
|Version|2.2.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|definition for toolbar button for inline css and css class wrappers|

Usage:
QuickEditToolbar: <<tiddler QuickEdit_css>>
OR
EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_css'></span>

%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink"
	title="inline CSS styles - @@attr:value;attr:value;...@@"
	onclick="var css=prompt('Enter CSS attribute/value pairs (attr:val;attr:val;...;)','');
		if (!css) return false; /* cancelled by user */
		return config.quickEdit.wrapSelection(this,'@@'+css+';','@@');"
>style</a></html>/%

%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink"
	title="CSS class wrapper - {{classname classname etc{...}}}"
	onclick="var c=prompt('Enter a CSS classname','');
		if (!c) return false; /* cancelled by user */
		return config.quickEdit.wrapSelection(this,'{{'+c+'{','}}}');"
>class</a></html>
/%
|Name|QuickEdit_custom|
|Source|http://www.TiddlyTools.com/#QuickEdit_custom|
|Version|2.3.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|provides a droplist of custom-defined formats|

Usage:
in QuickEditToolbar: <<tiddler QuickEdit_custom>>
OR
in EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_custom'></span>

!help
Reminders:

Custom format definitions are stored as an "HR-separated list" in a tiddler named [[QuickEdit_customList]].

The first line of each list item is the text 'label' to show in the droplist, followed by one or more lines of wiki content to be inserted into the tiddler source.

To embed the tiddler editor's current selected text within the formatted output, use "$1" (without quotes) to mark the position(s) where the selection should be inserted.
!end help

%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" tabindex="-1" 
title="custom defined formats"
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
	var s=createTiddlyElement(p,'select'); s.button=this;
	s.options[0]=new Option('select a custom format...','');
	var items=store.getTiddlerText('QuickEdit_customList','').split('\n----\n');
	for (var i=0; i<items.length; i++) {
		if (!items[i].length) continue; var lines=items[i].split('\n');
		var label=lines.shift(); var val=lines.join('\n');
		s.options[s.length]=new Option(label,val); s.options[s.length-1].title=val;
	}
	s.options[s.length]=new Option('[Edit custom formats...]','_edit');
	s.options[s.length-1].title='add/change custom format definitions...';
	s.size=Math.min(s.length,15);
	s.onclick=function(){ if (!this.value.length) return;
		if (this.value=='_edit') {
			alert(store.getTiddlerText('QuickEdit_custom##help'));
			story.displayTiddler(story.findContainingTiddler(this.button),
				'QuickEdit_customList',DEFAULT_EDIT_TEMPLATE);
		} else {
		        var e=config.quickEdit.getField(this.button); if (!e) return false;
			e.focus(); var txt=config.quickEdit.getSelection(e);
			replaceSelection(e,this.value.replace(/\$\x31/g,txt));
		}
		Popup.remove(); return false;
	};
	s.onkeyup=function(ev){
		var k=(ev||window.event).keyCode; if (k==13) this.onclick(); if (k==27) Popup.remove();
	};
	Popup.show(p,false);
	s.focus();
	return config.quickEdit.processed(event);"
>custom</a></html>
scrollbox
@@display:block;height:10em;overflow:auto;$1@@@@display:block;text-align:right;^^scroll for more...^^@@
----
nested Introduction
+++[Introduction]<<tiddler Introduction>>===
----
nested slider
+++[$1]<<tiddler $1>>===
----
big red
@@font-size:36pt;color:red;$1@@
----
/%
|Name|QuickEdit_equation|
|Source|TBA|
|Version|1.0.0|
|Author|Morris Gray - twhelp.tiddlywiki.com & Will Bateman - CodeCogs.com|
|License|http://www.codecogs.com|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin Package http://tiddlytools.com/#QuickEditPackage|
|Overrides||
|Description|definition for toolbar button for equation editing|

This script must be put in MarkupPreHead
<script type="text/javascript" src="http://latex.codecogs.com/editor.js"></script>

Usage:
Add the button to QuickEditToolbar like this: <<tiddler QuickEdit_equation>>
OR
EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_equation'></span>


**** INSERT EQUATION ****
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink"
	title="embed an equation - "
	onclick="config.quickEdit.id='eqntarget'; OpenLatexEditor('eqntarget','tw',''); "
>equation</a></html>
/***
|Name|QuickEdit_equationButton|
|Source|http://twhelp.tiddlywiki.com/#EquationEditorPlugin|
|Version|1.0.0|
|Author|Morris Gray - twhelp.tiddlywiki.com & Will Bateman - CodeCogs.com|
|License|BSD open source license http://www.codecogs.com|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin, EquationEditorPlugin|
|Overrides||
|Description|definition for toolbar button for equation editing|

This script must be put in MarkupPreHead
{{{<script type="text/javascript" src="http://latex.codecogs.com/editor.js"></script>}}}

Usage:
{{{
QuickEditToolbar: <<tiddler QuickEdit_equation>>
OR
EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_equation'></span>
}}}

!Code for QuickEdit_equation button
***/
//{{{
<html><hide linebreaks><a href="javascript:;" class="tiddlyLink"
	title="embed an equation"
	onclick="config.quickEdit.id='eqntarget'; OpenLatexEditor('eqntarget','tw',''); "
>equation</a></html>

//}}}
/%
|Name|QuickEdit_file|
|Source|http://www.TiddlyTools.com/#QuickEdit_file|
|Version|2.2.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|definition for toolbar buttons that insert content from external files|

Usage:
QuickEditToolbar: <<tiddler QuickEdit_file>>
OR
EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_file'></span>

**** INSERT FILE ****
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink"
	title="insert content from an external text file"
	onclick="var fn=config.quickEdit.promptForFilename('Enter/select a text file',getLocalPath(document.location.href),'');
	if (!fn) return false; /* cancelled by user */
	var text=loadFile(getLocalPath(fn)); if (!text) { alert('Error: unable to read contents from \0027'+fn+'\0027'); return; }
	return config.quickEdit.setSelection(place,text);"
>file</a></html>
/%
|Name|QuickEdit_font|
|Source|http://www.TiddlyTools.com/#QuickEdit_font|
|Version|2.2.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|definition for toolbar button that set font-family CSS attribute|

Usage:
QuickEditToolbar: <<tiddler QuickEdit_font>>
OR
EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_macro'></span>

%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink"
title="set font-family CSS attribute - @@font-family:facename;...@@"
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
	var s=createTiddlyElement(p,'select'); s.button=this;
	s.options[0]=new Option('select a font family...','');
	s.onchange=function(){
		if (this.value=='_edit')
			story.displayTiddler(story.findContainingTiddler(this.button),'QuickEdit_fontList',DEFAULT_EDIT_TEMPLATE);			
		else
			config.quickEdit.wrapSelection(this.button,'@@font-family:\x22'+this.value+'\x22;','@@');
		Popup.remove(); return false;
	};
	var fonts=store.getTiddlerText('QuickEdit_fontList','').split('\n');
	for (var i=0; i<fonts.length; i++) {
		if (!fonts[i].length) continue;
		s.options[s.length]=new Option(fonts[i],fonts[i]);
		s.options[s.length-1].style.fontFamily=fonts[i];
	}
	s.options[s.length]=new Option('[Edit font list...]','_edit');
	s.options[s.length-1].title='enter fonts, one per line...';
	Popup.show(p,false);
	event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation();return false;"
>font</a></html>
Arial,helvetica,sans-serif
Times New Roman,times,serif
Courier,monospaced
/%
|Name|QuickEdit_format|
|Source|http://www.TiddlyTools.com/#QuickEdit_format|
|Version|2.2.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|definition for toolbar button for text formatting|

Usage:
QuickEditToolbar: <<tiddler QuickEdit_format>>
OR
EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_format'></span>

%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" title="''bold''" accesskey="B" 
onclick="config.quickEdit.wrapSelection(this,'\x27\x27','\x27\x27'); return false;"
>&nbsp;B&nbsp;</a></html>/%

%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" title="//italics//" accesskey="I" 
onclick="config.quickEdit.wrapSelection(this,'//','//'); return false;"
>&nbsp;I&nbsp;</a></html>/%

%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" title="__underline__" accesskey="U" 
onclick="config.quickEdit.wrapSelection(this,'__','__'); return false;"
>&nbsp;U&nbsp;</a></html>/%

%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink" title="--strikethrough--" accesskey="S" 
onclick="config.quickEdit.wrapSelection(this,'--','--'); return false;"
>&nbsp;S&nbsp;</a></html>/%

%/ &nbsp;/%  SPACER

%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink"
title="format text"
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
	var s=createTiddlyElement(p,'select'); s.button=this;
	s.options[0]=new Option('select text format...','');
	s.onchange=function(){
		var parts=this.value.split(',');
		config.quickEdit.wrapSelection(this.button,parts[0],parts[1]);
		Popup.remove(); return false;
	};
	s.options[s.length]=new Option('superscript','^^,^^');
	s.options[s.length-1].title='^^superscript^^';
	s.options[s.length]=new Option('subscript','~~,~~');
	s.options[s.length-1].title='~~subcript~~';
	s.options[s.length]=new Option('blockquote','\n\<\<\<\n,\n\<\<\<\n');
	s.options[s.length-1].title='indented blockquote - \<\<\<';
	s.options[s.length]=new Option('monospaced','{{{,}}}');
	s.options[s.length-1].title='inline monospaced text - {{{...}}}';
	s.options[s.length]=new Option('pre','\n{{{\n,\n}}}\n');
	s.options[s.length-1].title='multi-line monospaced text box - {{{...}}}';
	s.options[s.length]=new Option('heading 1','\n!,\n');
	s.options[s.length-1].title='H1 heading - !';
	s.options[s.length]=new Option('heading 2','\n!!,\n');
	s.options[s.length-1].title='H2 heading - !';
	s.options[s.length]=new Option('heading 3','\n!!!,\n');
	s.options[s.length-1].title='H3 heading - !';
	s.options[s.length]=new Option('heading 4','\n!!!!,\n');
	s.options[s.length-1].title='H4 heading - !';
	s.options[s.length]=new Option('heading 5','\n!!!!!,\n');
	s.options[s.length-1].title='H5 heading - !';
	s.options[s.length]=new Option('comment','/%,%/');
	s.options[s.length-1].title='comment (hidden content) - /%...%/';
	s.options[s.length]=new Option('HTML','<html>,<\x2fhtml>');
	s.options[s.length-1].title='HTML syntax - <html>...<\x2fhtml>';
	Popup.show(p,false);
	event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation();return false;"
>format</a></html>
/%
|Name|QuickEdit_image|
|Source|http://www.TiddlyTools.com/#QuickEdit_image|
|Version|2.2.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|definition for toolbar buttons that insert embedded image references|

Usage:
QuickEditToolbar: <<tiddler QuickEdit_image>>
OR
EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_image'></span>

**** INSERT IMAGE ****
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink"
	title="embed an image (jpg/gif/png) - [img[tooltip|URL]] or [img[tooltip|path/to/file.ext]]"
	onclick="var fn=config.quickEdit.promptForFilename('Enter/select an image file',getLocalPath(document.location.href),'');
	if (!fn) return false;  /* cancelled by user */
	var tip=prompt('Enter a tooltip for this image',''); if (!tip) tip=''; else tip+='|';
	return config.quickEdit.setSelection(this,'[img['+tip+fn+']]');"
>image</a></html>
/%
|Name|QuickEdit_link|
|Source|http://www.TiddlyTools.com/#QuickEdit_link|
|Version|2.2.1|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|toolbar button that inserts a ~PrettyTiddlyLink to a tiddler or external file|

Usage:
QuickEditToolbar: <<tiddler QuickEdit_link>>
OR
EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_link'></span>

**** INSERT LINK ****
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink"
title="add a 'PrettyLink' to another tiddler - [[link text|TiddlerName]]"
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
	var s=createTiddlyElement(p,'select'); s.button=this;
	s.options[0]=new Option('select a tiddler or file...','');
	s.onchange=function(){
		var title=this.value; var txt=title;
		if (title=='_file') {
			title=config.quickEdit.promptForFilename('Select a file',
				getLocalPath(document.location.href),'');
			if (!title) { this.selectedIndex=0; this.focus(); return false; }
			var txt=title.substr(title.lastIndexOf('/')+1);
		}
		var txt=prompt('Enter the text to display for this link',txt);
		if (!txt) { this.selectedIndex=0; this.focus(); return false; }
		config.quickEdit.setSelection(this.button,'[['+txt+'|'+title+']]');
		Popup.remove(); return false;
	};
	s.options[s.length]=new Option('[browse for file...]','_file');
	var tids=store.getTiddlers('title');
	for (var t=0; t<tids.length; t++) {
		s.options[s.length]=new Option(tids[t].title,tids[t].title);
		s.options[s.length-1].title=tids[t].getSubtitle();
	}
	var s=createTiddlyElement(p,'select');
	s.options[0]=new Option('match tag...','');
	s.onchange=function(){
		var tag=this.value;
		var tids=tag.length?store.getTaggedTiddlers(tag,'title'):store.getTiddlers('title');
		var list=this.previousSibling;
		while (list.length) list.options[0]=null;
		var prompt='select a tiddler or file...';
		if (tag.length) prompt='select a tagged tiddler ['+tids.length+' matches]...';
		list.options[0]=new Option(prompt,'');
		if (!tag.length) list.options[list.length]=new Option('[browse for file...]','_file');
		for (var t=0; t<tids.length; t++) {
			list.options[list.length]=new Option(tids[t].title,tids[t].title);
			list.options[list.length-1].title=tids[t].getSubtitle();
		}
	};
	var tags=store.getTags();
	for (var t=0; t<tags.length; t++) s.options[s.length]=new Option(tags[t][0],tags[t][0]);
	Popup.show(p,false);
	event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation();return false;"
>link</a></html>
/%
|Name|QuickEdit_macro|
|Source|http://www.TiddlyTools.com/#QuickEdit_macro|
|Version|2.2.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|definition for toolbar button that inserts macros with guide text|

Usage:
QuickEditToolbar: <<tiddler QuickEdit_macro>>
OR
EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_macro'></span>

**** INSERT MACRO ****
The "macro" command can include optional "guideText" for any given macro, as an aide to entering macro parameters, by embedding placeholders or recommended default values into the macro syntax that is inserted into your tiddler content.  For built-in TW core macros, this guideText is defined below.  You can add guideText to your own plugin-defined macros by using the following javascript syntax: config.macros.macroName.guideText="guide text goes here";
%/<<tiddler {{
	/* SET MACRO GUIDE TEXT (for built-in core macros) (11/17 - TBD - incomplete list) */
	config.macros.edit.guideText="fieldname #rows";
	config.macros.view.guideText="fieldname (link,wikified,date) format";
	config.macros.slider.guideText="cookie TiddlerName label tooltip";
	config.macros.option.guideText="(txtCookieName,chkCookieName)";
	config.macros.tiddler.guideText="TiddlerName with: params...";
	""; /* must return blank to suppress output */ }}>>/%
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink"
title="add a macro - \<\<macroName ...\>\>"
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
	var s=createTiddlyElement(p,'select'); s.button=this;
	s.options[0]=new Option('select a macro...','');
	s.onchange=function(){
		config.quickEdit.setSelection(this.button,'\<\<'+this.value+'\>\>');
		Popup.remove(); return false;
	};
	var macros=[]; for (var m in config.macros) if (config.macros[m].handler) macros.push(m); macros.sort();
	for (var i=0; i<macros.length; i++) { var m=macros[i];
		var help=config.macros[m].guideText; if (!help) help=''; else help=' '+help;
		s.options[s.length]=new Option(m,m+help);
		s.options[s.length-1].title='\<\<'+m+help+'\>\>';
	}
	Popup.show(p,false);
	event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation();return false;"
>macro</a></html>
/%
|Name|QuickEdit_replace|
|Source|http://www.TiddlyTools.com/#QuickEdit_replace|
|Version|2.2.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|definition for find/replace toolbar button|

Usage:find/replace selected text with replacement text
QuickEditToolbar: <<tiddler QuickEdit_replace>>
OR
EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_replace'></span>

**** FIND/REPLACE/NEXT/ALL ****
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink"
title="find/replace selected text with replacement text"
onclick="var here=story.findContainingTiddler(this); if (!here) return false;
	var e=config.quickEdit.getField(here);
	var s=config.quickEdit.getSelection(e); 
	var p=Popup.create(this,null,'popup sticky smallform'); if (!p) return false;
	var t=createTiddlyElement(p,'input'); t.onfocus=function(){this.select()};
	t.value=s.length?s:'enter target text';
	var r=createTiddlyElement(p,'input'); r.onfocus=function(){this.select()};
	r.value='enter replacement text';
	var tid=here.getAttribute('tiddler');
	var b=createTiddlyElement(p,'button',null,null,'?',{tid:tid});
	b.style.width='2em';
	b.title='FIND/FIND NEXT target text';
	b.onclick=function(ev) { /* FIND */
		var e=story.getTiddlerField(this.getAttribute('tid'),'text');
		if (!e||e.getAttribute('edit')!='text') return;
		var t=this.previousSibling.previousSibling;
		e.focus();
		if (e.setSelectionRange) { /* MOZ */
			var newstart=e.value.indexOf(t.value,e.selectionStart+1);
			if (newstart==-1) newstart=e.value.indexOf(t.value); /* wrap around */
			if (newstart==-1) { alert('\u0022'+t.value+'\u0022 not found'); t.focus(); return; }
			e.setSelectionRange(newstart,newstart+t.value.length);
			var linecount=e.value.split('\n').length;
			var thisline=e.value.substr(0,e.selectionStart).split('\n').length;
			e.scrollTop=Math.floor((thisline-1-e.rows/2)*e.scrollHeight/linecount);
		} else if (document.selection) { /* IE */
			var range=document.selection.createRange();
			if(range.parentElement()==e) {
				range.collapse(false);
				var found=false; try{found=range.findText(t.value,e.value.length,4)}catch(e){}
				if (found) range.select();
				else { alert('\u0022'+t.value+'\u0022 not found'); t.focus(); }
			}
		}
	};
	b=createTiddlyElement(p,'button',null,null,'=',{tid:tid});
	b.style.width='2em';
	b.title='REPLACE selected text';
	b.onclick=function(ev) { /* REPLACE */
		var e=story.getTiddlerField(this.getAttribute('tid'),'text');
		if (!e||e.getAttribute('edit')!='text') return;
		var t=this.previousSibling.previousSibling.previousSibling;
		var r=this.previousSibling.previousSibling;
		if (   (e.selectionStart!==undefined && e.selectionEnd==e.selectionStart)
		    || (document.selection && document.selection.createRange().text==''))
			this.previousSibling.click(); /* no selection... do FIND first */
		if (   (e.selectionStart!==undefined && e.selectionEnd==e.selectionStart)
		    || (document.selection && document.selection.createRange().text==''))
			{ t.focus(); return; } /* still no selection... goto target input */
		e.focus(); replaceSelection(e,r.value);
	};
	b=createTiddlyElement(p,'button',null,null,'+',{tid:tid});
	b.style.width='2em';
	b.title='REPLACE selected text AND FIND NEXT target text';
	b.onclick=function(ev) { /* REPLACE and FIND NEXT */
		this.previousSibling.click();
		this.previousSibling.previousSibling.click();
	};
	b=createTiddlyElement(p,'button',null,null,'!',{tid:tid});
	b.style.width='2em';
	b.title='REPLACE ALL occurrences of target text';
	b.onclick=function(ev) { /* REPLACE ALL */
		var e=story.getTiddlerField(this.getAttribute('tid'),'text');
		if (!e||e.getAttribute('edit')!='text') return;
		var t=this.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling;
		var r=this.previousSibling.previousSibling.previousSibling.previousSibling;
		if (!t.value.length) { alert('Please enter the target text'); t.focus(); return; }
		var m='This will replace all occurences of:\n\n';
		m+='\''+t.value+'\'\n\nwith:\n\n\''+r.value+'\'\n\nAre you sure?';
		if (!confirm(m)) { r.focus(); r.select(); return; }
		e.value=e.value.replace(new RegExp(t.value.escapeRegExp(),'gm'),r.value);
		e.focus(); e.select(); Popup.remove();
	};
	Popup.show(p,false);
	if (!s.length) {t.focus();t.select()} else {r.focus();r.select()}
	event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation();return false;"
>replace</a></html>
/%
|Name|QuickEdit_sort|
|Source|http://www.TiddlyTools.com/#QuickEdit_sort|
|Version|2.2.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|definition for toolbar "sort" button|

Usage:
QuickEditToolbar: <<tiddler QuickEdit_sort>>
OR
EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_sort'></span>

**** SORT LINES ****
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink"
title="sort lines of text"
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
	var s=createTiddlyElement(p,'select'); s.button=this;
	s.options[0]=new Option('select sort order...','');
	s.onchange=function(){
		var e=config.quickEdit.getField(this.button); if (!e) return false;
		var lines=config.quickEdit.getSelection(e).split('\n').sort();
		if (this.value=='D') lines=lines.reverse();
		replaceSelection(e,lines.join('\n'));
		e.focus();
		Popup.remove(); return false;
	};
	s.options[s.length]=new Option('ascending','A');
	s.options[s.length-1].title='ascending';
	s.options[s.length]=new Option('descending','D');
	s.options[s.length-1].title='descending';
	Popup.show(p,false);
	event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation();return false;"
>sort</a></html>
/%
|Name|QuickEdit_split|
|Source|http://www.TiddlyTools.com/#QuickEdit_split|
|Version|2.2.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|toolbar button: split selected content into separate tiddler|

Based on ideas originally developed by YannPerrin
(http://yann.perrin.googlepages.com/twkd.html#easySlicer)

Usage
QuickEditToolbar: <<tiddler QuickEdit_split>>
OR
EditTemplate:
<div class='toolbar'>
	<span macro='toolbar +saveTiddler -cancelTiddler deleteTiddler'></span>
	<span macro='tiddler QuickEdit_split'></span>
</div>

**** SPLIT TIDDLER ****
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink"
title="move selection to new tiddler and insert link, embedded tiddler, or slider"
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
	p.style.whiteSpace='nowrap';
	var i=createTiddlyElement(p,'input');
	i.defaultValue='Enter a new tiddler title';
	i.onfocus=function(){this.select()};
	var s=createTiddlyElement(p,'select'); s.button=this;
	s.options[0]=new Option('select type...','');
	s.options[0].title='select split type';
	s.options[1]=new Option('link','link');
	s.options[1].title='replace with [[TiddlerName]]';
	s.options[2]=new Option('embed','embed');
	s.options[2].title='replace with \<\<tiddler TiddlerName\>\>';
	s.options[3]=new Option('slider','slider');
	s.options[3].title='replace with \<\<slider \u0022\u0022 [[TiddlerName]] [[label]] [[tooltip]]\>\>';
	s.onchange=function(){
		if (s.previousSibling.value==s.previousSibling.defaultValue)
			{ alert('A tiddler title is required'); s.selectedIndex=0; s.previousSibling.focus(); return false; }
		var tid=s.previousSibling.value;
		if (store.tiddlerExists(tid) && !confirm(config.messages.overwriteWarning.format([tid])))
			{ s.previousSibling.focus(); return false; }
		switch(s.value) {
			case 'link':
				var newtxt='[['+tid+']]';
				break;
			case 'embed':
				var newtxt='\<\<tiddler [['+tid+']]\>\>';
				break;
			case 'slider':
				var label=prompt('Enter a slider label',tid);
				if (!label) { Popup.remove(); return false; }
				var tip=prompt('Enter a slider tooltip',label);
				if (!tip) { Popup.remove(); return false; }
				var newtxt='\<\<slider \u0022\u0022 [['+tid+']] [['+label+']] [['+tip+']]\>\>';
				break;
		}
		var txt=config.quickEdit.getSelection(config.quickEdit.getField(this.button));
		store.saveTiddler(tid,tid,txt,config.options.txtUserName,new Date(),[],{});
		story.displayTiddler(story.findContainingTiddler(this.button),tid);
		config.quickEdit.setSelection(this.button,newtxt);
		Popup.remove(); return false;
	};
	Popup.show(p,false);
	event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation();return false;"
>split</a></html>
/%
|Name|QuickEdit_tiddler|
|Source|http://www.TiddlyTools.com/#QuickEdit_tiddler|
|Version|2.2.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2|
|Type|script|
|Requires|QuickEditPlugin|
|Overrides||
|Description|definition for toolbar button that inserts content from another tiddler|

Usage:
QuickEditToolbar: <<tiddler QuickEdit_tiddler>>
OR
EditTemplate: <span class='toolbar' macro='tiddler QuickEdit_tiddler'></span>

**** INSERT TIDDLER ****
%/<html><hide linebreaks><a href="javascript:;" class="tiddlyLink"
title="copy content from another tiddler"
onclick="var p=Popup.create(this); if (!p) return false; p.className+=' sticky smallform';
	var s=createTiddlyElement(p,'select'); s.button=this;
	s.options[0]=new Option('select a tiddler...','');
	s.onchange=function(){
		var txt=store.getTiddlerText(this.value);
		if (!txt) { displayMessage(this.value+' not found'); this.selectedIndex=0; this.focus(); return false; }
		config.quickEdit.setSelection(this.button,txt);
		Popup.remove(); return false;
	};
	var tids=store.getTiddlers('title');
	for (var t=0; t<tids.length; t++) {
		s.options[s.length]=new Option(tids[t].title,tids[t].title);
		s.options[s.length-1].title=tids[t].getSubtitle();
	}
	var s=createTiddlyElement(p,'select');
	s.options[0]=new Option('match tag...','');
	s.onchange=function(){
		var tag=this.value;
		var tids=tag.length?store.getTaggedTiddlers(tag,'title'):store.getTiddlers('title');
		var list=this.previousSibling;
		while (list.length) list.options[0]=null;
		var prompt='select a '+(tag.length?'tagged ':'')+'tiddler'+(tag.length?(' ['+tids.length+' matches]'):'')+'...';
		list.options[0]=new Option(prompt,'');
		for (var t=0; t<tids.length; t++) {
			list.options[list.length]=new Option(tids[t].title,tids[t].title);
			list.options[list.length-1].title=tids[t].getSubtitle();
		}
	};
	var tags=store.getTags();
	for (var t=0; t<tags.length; t++) s.options[s.length]=new Option(tags[t][0],tags[t][0]);
	Popup.show(p,false);
	event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation();return false;"
>tiddler</a></html>
<html><hide linebreaks><a href="javascript:;" class="tiddlyLink"
	title="embed an equation - "
	onclick="config.quickEdit.id='eqntarget'; OpenLatexEditor('eqntarget','tw',''); "
><button>equation</button></a></html>
This is a demo of how Numbers Empire can call up the equations editor with an inserted code for re-editing. It is on the page http://www.numberempire.com/integralcalculator.php (x*x)
----
!Example using Numbers Empire HTML
<<<
[img[http://latex.codecogs.com/gif.latex?\frac{\partial f}{\partial x} = 2\,x]]
<html><a class="" href="http://www.numberempire.com/texequationeditor/equationeditor.php?tex=\int{x^2}\,dx = {{x^3}\over{3}}" target="_blank">Click Here to Edit</a></html>
<<<
!!&nbsp;&nbsp;Empire Code
<<<
{{{<html><a class="" href="http://www.numberempire.com/texequationeditor/equationeditor.php?tex=\int{x^2}\,dx = {{x^3}\over{3}}" target="_blank">Click Here to Edit</a></html>}}}
<<<
----
!Example using ~TiddlyWiki markup
<<<
[img[http://latex.codecogs.com/gif.latex?\frac{\partial f}{\partial x} = 2\,x][http://www.numberempire.com/texequationeditor/equationeditor.php?tex=\int{x^2}\,dx = {{x^3}\over{3}}]]
@@color:#00f;Click formula to edit@@
<<<
!!&nbsp;&nbsp;TW Markup Code
<<<
{{{[img[http://latex.codecogs.com/gif.latex?%3F%5Cint%7Bx%5E2%7D%5C%2Cdx%26space%3B%3D%26space%3B%7B%7Bx%5E3%7D%5Cover%7B56%7D%7D%5D%5D][http://www.numberempire.com/texequationeditor/equationeditor.php?tex=\int{x^2}\,dx = {{x^3}\over{3}}]]}}}
<<<
''Note''
~TiddlyWiki image markup
''Normal image'' {{{[img[Link to Image]]}}}
''Optional link __from image__''{{{[img[Link to Image][Optional Link from Image]]}}}

[img[http://latex.codecogs.com/gif.latex?\frac{\partial f}{\partial x} = 2\,x][http://www.codecogs.com/components/equationeditor/equationeditor.php?tw&latex=%3F%5Cint%7Bx%5E2%7D%5C%2Cdx%26space%3B%3D%26space%3B%7B%7Bx%5E3%7D%5Cover%7B56%7D%7D%5D%5D]]
@@color:#00f;Click formula to edit@@

[img[http://latex.codecogs.com/gif.latex?\inline&space;\int{x^2}\,dx&space;=&space;{{x^3}\over{45}}]]

http://www.codecogs.com/components/equationeditor/equationeditor.php?tw&latex=1@plus;sin(x)
<html><input type="button" value="Refresh Styles" onClick="javascript:refreshStyles('StyleSheet');" name="button" class="btn" onmouseover="this.className='btn btnhov'" onmouseout="this.className='btn'"/></html>
/***
|Name|SaveAsPlugin|
|Source|http://www.TiddlyTools.com/#SaveAsPlugin|
|Documentation|http://www.TiddlyTools.com/#SaveAsPluginInfo|
|Version|2.5.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|Save current document to a different path/filename|
Adds a 'save as' command to the TiddlyWiki 'backstage' menu so you can quickly create an exact copy of the current TiddlyWiki document.  The plugin also defines a macro that you can use to place a "save as..." command link into your sidebar/mainmenu/any tiddler (or wherever you like).
>//Note: This plugin replaces functionality previously provided by [[NewDocumentPlugin]], except for the HTML+CSS "snapshot" feature, which has been moved to a separate [[SnapshotPlugin]].//
!!!!!Documentation
<<<
see [[SaveAsPluginInfo]]
<<<
!!!!!Revisions
<<<
2009.04.19 [2.5.0] added CSV format
| Please see [[SaveAsPluginInfo]] for additional revision details |
2006.02.03 [1.0.0] Created.
<<<
!!!!!Code
***/
//{{{
version.extensions.SaveAsPlugin= {major: 2, minor: 5, revision: 0, date: new Date(2009,4,19)};

config.macros.saveAs = {
	label: "save as...",
	labelparam: "label:",
	prompt: "Save current document to a different path/file",
	promptparam: "prompt:",
	filePrompt: "Please select or enter a target path/filename",
	targetparam: "target:",
	defaultFilename: "new.html",
	filenameparam: "filename:",
	currfilekeyword: "here",
	typeparam: "type:",
	type_TW: "tw", type_PS: "ps", type_TX: "tx", type_CS: "cs", type_NF: "nf", // file type tokens
	type_map: { // map filetype param alternatives/abbreviations to token values
		tiddlywiki:"tw", tw:"tw", wiki: "tw",
		purestore: "ps", ps:"ps", store:"ps",
		plaintext: "tx", tx:"tx", text: "tx",
		comma:     "cs", cs:"cs", csv:  "cs",
		newsfeed:  "nf", nf:"nf", xml:  "nf", rss:"nf"
	},
	replaceparam: "replace",
	mergeparam: "merge",
	quietparam: "quiet",
	openparam: "open",
	askParam: "ask",
	askMsg: "Enter a tag filter (use * for all tiddlers, 'none' for blank document)",
	emptyParam: "none",
	confirmmsg: "Found %0 tiddlers matching\n\n'%1'\n\nPress OK to proceed",
	mergeprompt: "%0\nalready contains tiddler definitions.\n"
		+"\nPress OK to add new/revised tiddlers to current file contents."
		+"\nPress Cancel to completely replace file contents",
	mergestatus: "Merged %0 new/revised tiddlers and %1 existing tiddlers",
	okmsg: "%0 tiddlers written to %1",
	failmsg: "An error occurred while creating %1",
	filter: "",
	handler: function(place,macroName,params) {
		if (params[0] && params[0].substr(0,this.labelparam.length)==this.labelparam)
			var label=params.shift().substr(this.labelparam.length);
		if (params[0] && params[0].substr(0,this.promptparam.length)==this.promptparam)
			var prompt=params.shift().substr(this.promptparam.length);
		if (params[0] && params[0].substr(0,this.targetparam.length)==this.targetparam)
			var target=params.shift().substr(this.targetparam.length);
		if (params[0] && params[0].substr(0,this.filenameparam.length)==this.filenameparam)
			var filename=params.shift().substr(this.filenameparam.length);
		if (params[0] && params[0].substr(0,this.typeparam.length)==this.typeparam)
			var filetype=this.type_map[params.shift().substr(this.typeparam.length).toLowerCase()];
		var q=(params[0] && params[0]==this.quietparam);   if (q) params.shift();
		var o=(params[0] && params[0]==this.replaceparam); if (o) params.shift();
		var m=(params[0] && params[0]==this.mergeparam);   if (m) params.shift();
		var a=(params[0] && params[0]==this.openparam);    if (a) params.shift();
		var btn=createTiddlyButton(place,label||this.label,prompt||this.prompt,
			function(){config.macros.saveAs.go(
				this.getAttribute('target'),
				this.getAttribute('filename'),
				this.getAttribute('filetype'),
				this.getAttribute('filter'),
				this.getAttribute('quiet')=="true",
				this.getAttribute('overwrite')=="true",
				this.getAttribute('merge')=="true",
				this.getAttribute('autoopen')=="true");  return false;}
		);
		if (target) btn.setAttribute("target",target);
		if (filename) btn.setAttribute("filename",filename);
		btn.setAttribute("filetype",filetype||this.type_TW);
		btn.setAttribute("filter",params.join(" "));
		btn.setAttribute("quiet",q?"true":"false");
		btn.setAttribute("overwrite",o?"true":"false");
		btn.setAttribute("merge",m?"true":"false");
		btn.setAttribute("autoopen",a?"true":"false");
	},
	go: function(target,filename,filetype,filter,quiet,overwrite,merge,autoopen) {
		var cm=config.messages; // abbreviation
		var cms=config.macros.saveAs; // abbreviation
		if (window.location.protocol!="file:") // make sure we are local
			{ displayMessage(cm.notFileUrlError); return; }

		// get tidders, confirm filtered results
		var tids=cms.selectTiddlers(filter);
		if (tids===false) return; // cancelled by user
		if (cms.filter!=cms.emptyParam && cms.filter.length && !quiet)
			if (!confirm(cms.confirmmsg.format([tids.length,cms.filter]))) return;

		// get target path/filename
		if (!filetype) filetype=this.type_TW;
		target=target||cms.getTarget(filename,filetype==this.type_TX?'txt':filetype==this.type_CS?'csv':'html');
		if (!target) return; // cancelled by user

		var link="file:///"+target.replace(/\\/g,'/');
		var samefile=link==decodeURIComponent(window.location.href);
		var p=getLocalPath(document.location.href);
		if (samefile) {
			if (config.options.chkSaveBackups) { var t=loadOriginal(p);if(t)saveBackup(p,t); }
			if (config.options.chkGenerateAnRssFeed && saveRss instanceof Function) saveRss(p);
		}
		var notes="";
		var total={val:0};
		var out=this.assembleFile(target,filetype,tids,notes,quiet,overwrite,merge,total);
		var ok=saveFile(target,out);
		if (ok && autoopen) {
			if (!samefile) window.open(link).focus();
			else { store.setDirty(false); window.location.reload(); }
		}
		if (!quiet || !(ok && autoopen))
			displayMessage((ok?this.okmsg:this.failmsg).format([total.val,target]),link);
	},
	selectTiddlers: function(filter) {
		var cms=config.macros.saveAs; // abbreviation
		cms.filter=filter||"";
		if (filter==cms.emptyParam) return [];
		if (!filter||!filter.length) return store.getTiddlers("title");
		// get filtered tiddlers
		if (filter==config.macros.saveAs.askParam) {
			filter=prompt(config.macros.saveAs.askMsg,"");
			if (!filter) return false;  // cancelled by user
			cms.filter=filter=="*"?"":filter;
			if (filter=="*") return store.getTiddlers("title");
		}
		return store.filterTiddlers("[tag["+filter+"]]");
	},
	getTarget: function(defName,defExt) {
		var cms=config.macros.saveAs; // abbreviation
		// get new target path/filename
		var newPath=getLocalPath(window.location.href);
		var slashpos=newPath.lastIndexOf("/"); if (slashpos==-1) slashpos=newPath.lastIndexOf("\\"); 
		if (slashpos!=-1) newPath=newPath.substr(0,slashpos+1); // trim filename
		if (!defName||!defName.length) { // use current filename as default
			var p=getLocalPath(window.location.href);
			var s=p.lastIndexOf("/"); if (s==-1) s=p.lastIndexOf("\\"); 
			if (s!=-1) defName=p.substr(s+1);
		}
		var defFilename=(defName||cms.defaultFilename).replace(/.html$/,'.'+defExt);
		var target=cms.askForFilename(cms.filePrompt,newPath,defFilename,defExt);
		if (!target) return; // cancelled by user
		// if specified file does not include a path, assemble fully qualified path and filename
		var slashpos=target.lastIndexOf("/"); if (slashpos==-1) slashpos=target.lastIndexOf("\\");
		if (slashpos==-1) target=target+(defName||cms.defaultFilename).replace(/.html$/,'.'+defExt);
		return target;
	},
	askForFilename: function(msg,path,file,defExt) {
		if(window.Components) { // moz
			try {
				netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
				var nsIFilePicker = window.Components.interfaces.nsIFilePicker;
				var picker = Components.classes['@mozilla.org/filepicker;1'].createInstance(nsIFilePicker);
				picker.init(window, msg, nsIFilePicker.modeSave);
				var thispath = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
				thispath.initWithPath(path);
				picker.displayDirectory=thispath;
				picker.defaultExtension=defExt||'html';
				picker.defaultString=file;
				picker.appendFilters(nsIFilePicker.filterAll|nsIFilePicker.filterText|nsIFilePicker.filterHTML);
				if (picker.show()!=nsIFilePicker.returnCancel) var result=picker.file.persistentDescriptor;
			}
			catch(e) { alert('error during local file access: '+e.toString()) }
		}
		else { // IE
			try { // XP/Vista only
				var s = new ActiveXObject('UserAccounts.CommonDialog');
				s.Filter='All files|*.*|Text files|*.txt|HTML files|*.htm;*.html|';
				s.FilterIndex=(defExt=='txt')?2:3; // default to HTML files;
				s.InitialDir=path;
				s.FileName=file;
				if (s.showOpen()) var result=s.FileName;
			}
			catch(e) { var result=prompt(msg,path+file); } // fallback for non-XP IE
		}
		return result;
	},
	plainTextHeader:
		 'Source:\n\t%0\n'
		+'Title:\n\t%1\n'
		+'Subtitle:\n\t%2\n'
		+'Created:\n\t%3 by %4\n'
		+'Application:\n\tTiddlyWiki %5 / %6 %7\n\n',
	plainTextTiddler:
		'- - - - - - - - - - - - - - -\n'
		+'|     title: %0\n'
		+'|   created: %1\n'
		+'|  modified: %2\n'
		+'| edited by: %3\n'
		+'|      tags: %4\n'
		+'- - - - - - - - - - - - - - -\n'
		+'%5\n',
	plainTextFooter:
		'',
	csvHeader:
		 'title,created,modified,modifier,tags,text\n',
	csvTiddler:
		'%0,%1,%2,%3,%4,%5',
	csvFooter:
		'',
	newsFeedHeader:
		 '<'+'?xml version="1.0"?'+'>\n'
		+'<rss version="2.0">\n'
		+'<channel>\n'
		+'<title>%1</title>\n'
		+'<link>%0</link>\n'
		+'<description>%2</description>\n'
		+'<language>en-us</language>\n'
		+'<copyright>Copyright '+(new Date().getFullYear())+' %4</copyright>\n'
		+'<pubDate>%3</pubDate>\n'
		+'<lastBuildDate>%3</lastBuildDate>\n'
		+'<docs>http://blogs.law.harvard.edu/tech/rss</docs>\n'
		+'<generator>TiddlyWiki %5 / %6 %7</generator>\n',
	newsFeedTiddler:
		'\n%0\n',
	newsFeedFooter:
		'</channel></rss>',
	pureStoreHeader:
		 '<html><body>'
		+'<style type="text/css">'
		+'	#storeArea {display:block;margin:1em;}'
		+'	#storeArea div {padding:0.5em;margin:1em;border:2px solid black;height:10em;overflow:auto;}'
		+'	#pureStoreHeading {width:100%;text-align:left;background-color:#eeeeee;padding:1em;}'
		+'</style>'
		+'<div id="pureStoreHeading">'
		+'	TiddlyWiki "PureStore" export file<br>'
		+'	Source'+': <b>%0</b><br>'
		+'	Title: <b>%1</b><br>'
		+'	Subtitle: <b>%2</b><br>'
		+'	Created: <b>%3</b> by <b>%4</b><br>'
		+'	TiddlyWiki %5 / %6 %7<br>'
		+'	Notes:<hr><pre>%8</pre>'
		+'</div>'
		+'<div id="storeArea">',
	pureStoreTiddler:
		'%0\n%1',
	pureStoreFooter:
		'</div><!--POST-BODY-START-->\n<!--POST-BODY-END--></body></html>',
	assembleFile: function(target,filetype,tids,notes,quiet,overwrite,merge,total) {
		var revised="";
		var now = new Date().toLocaleString();
		var src=convertUnicodeToUTF8(document.location.href);
		var title = convertUnicodeToUTF8(wikifyPlain("SiteTitle").htmlEncode());
		var subtitle = convertUnicodeToUTF8(wikifyPlain("SiteSubtitle").htmlEncode());
		var user = convertUnicodeToUTF8(config.options.txtUserName.htmlEncode());
		var twver = version.major+"."+version.minor+"."+version.revision;
		var v=version.extensions.SaveAsPlugin; var pver = v.major+"."+v.minor+"."+v.revision;
		var headerargs=[src,title,subtitle,now,user,twver,"SaveAsPlugin",pver,notes];
		switch (filetype) {
			case this.type_TX: // plain text
				var header=this.plainTextHeader.format(headerargs);
				var footer=this.plainTextFooter;
				break;
			case this.type_CS: // comma-separated
				var header=this.csvHeader;
				var footer=this.csvFooter;
				break;
			case this.type_NF: // news feed (XML)
				headerargs[0]=store.getTiddlerText("SiteUrl","");
				var header=this.newsFeedHeader.format(headerargs);
				var footer=this.newsFeedFooter;
				break;
			case this.type_PS: // PureStore (no code)
				var header=this.pureStoreHeader.format(headerargs);
				var footer=this.pureStoreFooter;
				break;
			case this.type_TW: // full TiddlyWiki
			default:
				var currPath=getLocalPath(window.location.href);
				var original=loadFile(currPath);
				if (!original) { alert(config.messages.cantSaveError); return; }
				var posDiv = locateStoreArea(original);
				if (!posDiv) { alert(config.messages.invalidFileError.format([currPath])); return; }
				var header = original.substr(0,posDiv[0]+startSaveArea.length)+"\n";
				var footer = "\n"+original.substr(posDiv[1]);
				break;
		}
		var out=this.getData(target,filetype,tids,quiet,overwrite,merge);
		var revised = header+convertUnicodeToUTF8(out.join("\n"))+footer;
		// if full TW, insert page title and language attr, and reset MARKUP blocks as needed...
		if (filetype==this.type_TW) {
			var newSiteTitle=convertUnicodeToUTF8(getPageTitle()).htmlEncode();
			revised=revised.replaceChunk("<title"+">","</title"+">"," " + newSiteTitle + " ");
			revised=updateLanguageAttribute(revised);
			var titles=[]; for (var i=0; i<tids.length; i++) titles.push(tids[i].title);
			revised=updateMarkupBlock(revised,"PRE-HEAD",
				titles.contains("MarkupPreHead")? "MarkupPreHead" :null);
			revised=updateMarkupBlock(revised,"POST-HEAD",
				titles.contains("MarkupPostHead")?"MarkupPostHead":null);
			revised=updateMarkupBlock(revised,"PRE-BODY",
				titles.contains("MarkupPreBody")? "MarkupPreBody" :null);
			revised=updateMarkupBlock(revised,"POST-SCRIPT",
				titles.contains("MarkupPostBody")?"MarkupPostBody":null);
		}
		total.val=out.length;
		return revised;
	},
	getData: function(target,filetype,tids,quiet,overwrite,merge) {
		// output selected tiddlers and gather list of titles (for use with merge)
		var out=[]; var titles=[];
		var url=store.getTiddlerText("SiteUrl","");
		for (var i=0; i<tids.length; i++) {
			out.push(this.formatItem(store,filetype,tids[i],url));
			titles.push(tids[i].title);
		}
		// if TW or PureStore format, ask to merge with existing tiddlers (if any)
		if (filetype==this.type_TW || filetype==this.type_PS) {
			if (overwrite) return out; // skip merge... forced overwrite
			var text=loadFile(target);
			if (text && text.length) {
				var remoteStore=new TiddlyWiki();
				if (remoteStore.importTiddlyWiki(convertUTF8ToUnicode(text))
					&& (merge||confirm(this.mergeprompt.format([target])))) {
					var existing=remoteStore.getTiddlers("title");
					for (var i=0; i<existing.length; i++)
						if (!titles.contains(existing[i].title))
							out.push(this.formatItem(remoteStore,filetype,existing[i],url));
					if (!quiet) displayMessage(this.mergestatus.format([tids.length,out.length-tids.length]));
				}
			}
		}
		return out;
	},
	formatItem: function(s,f,t,u) {
		var args=[t.title, t.created.toLocaleString(), t.modified.toLocaleString(),
			t.modifier, String.encodeTiddlyLinkList(t.tags), t.text];
		if (f==this.type_CS) for (var a=0; a<args.length; a++) args[a]=this.encodeCSV(args[a]);
		if (f==this.type_TX) var r=this.plainTextTiddler.format(args);
		if (f==this.type_CS) var r=this.csvTiddler.format(args);
		if (f==this.type_TW) var r=s.getSaver().externalizeTiddler(s,t);
		if (f==this.type_PS) var r=this.pureStoreTiddler.format([t.title,s.getSaver().externalizeTiddler(s,t)]);
		if (f==this.type_NF) var r=this.newsFeedTiddler.format([t.saveToRss(u)]);
		return r||"";
	},
	encodeCSV: function(t) {
		return (t.indexOf('"'!=-1)||t.indexOf(','!=-1))?'"'+t.replace(/"/g,'""')+'"':t;
	}
};
//}}}
//{{{
// automatically add saveAs to backstage
config.tasks.saveAs = {
	text: "saveAs",
	tooltip: config.macros.saveAs.prompt,
	action: function(){ clearMessage(); config.macros.saveAs.go(); }
}
config.backstageTasks.splice(config.backstageTasks.indexOf("save")+1,0,"saveAs");
//}}}
/***
|Name:|SaveCloseTiddlerPlugin|
|Description:|Provides two extra toolbar commands, saveCloseTiddler and cancelCloseTiddler|
|Version:|3.0 ($Rev: 5502 $)|
|Date:|$Date: 2008-06-10 23:31:39 +1000 (Tue, 10 Jun 2008) $|
|Source:|http://mptw.tiddlyspot.com/#SaveCloseTiddlerPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License:|http://mptw.tiddlyspot.com/#TheBSDLicense|
To use these you must add them to the tool bar in your EditTemplate
***/
//{{{
merge(config.commands,{

	saveCloseTiddler: {
		text: 'done/close',
		tooltip: 'Save changes to this tiddler and close it',
		handler: function(ev,src,title) {
			var closeTitle = title;
			var newTitle = story.saveTiddler(title,ev.shiftKey);
			if (newTitle)
				closeTitle = newTitle;
			return config.commands.closeTiddler.handler(ev,src,closeTitle);
		}
	},

	cancelCloseTiddler: {
		text: 'cancel/close',
		tooltip: 'Undo changes to this tiddler and close it',
		handler: function(ev,src,title) {
			// the same as closeTiddler now actually
			return config.commands.closeTiddler.handler(ev,src,title);
		}
	}

});

//}}}

/***
|Name|SearchOptionsPlugin|
|Source|http://www.TiddlyTools.com/#SearchOptionsPlugin|
|Documentation|http://www.TiddlyTools.com/#SearchOptionsPluginInfo|
|Version|3.0.5|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|Story.prototype.search, TiddlyWiki.prototype.search, config.macros.search.onKeyPress|
|Options|##Configuration|
|Description|extend core search function with additional user-configurable options|
Adds extra options to core search function including selecting which data items to search, enabling/disabling incremental key-by-key searches, and generating a ''list of matching tiddlers'' instead of immediately displaying all matches.  This plugin also adds syntax for rendering 'search links' within tiddler content to embed one-click searches using pre-defined 'hard-coded' search terms.
!!!!!Documentation
>see [[SearchOptionsPluginInfo]]
!!!!!Configuration
<<<
Search in:
<<option chkSearchTitles>> titles <<option chkSearchText>> text <<option chkSearchTags>> tags <<option chkSearchFields>> fields <<option chkSearchShadows>> shadows
<<option chkSearchHighlight>> Highlight matching text in displayed tiddlers
<<option chkSearchList>> Show list of matches
<<option chkSearchListTiddler>> Write list to [[SearchResults]] tiddler
<<option chkSearchTitlesFirst>> Show title matches first
<<option chkSearchByDate>> Sort matching tiddlers by modification date (most recent first)
<<option chkIncrementalSearch>> Incremental key-by-key search: {{twochar{<<option txtIncrementalSearchMin>>}}} or more characters,  {{threechar{<<option txtIncrementalSearchDelay>>}}} msec delay
<<option chkSearchOpenTiddlers>> Search only in tiddlers that are currently displayed
<<option chkSearchExcludeTags>> Exclude tiddlers tagged with: <<option txtSearchExcludeTags>>
<<<
!!!!!Revisions
<<<
2009.01.16 [3.0.5] added chkSearchOpenTiddlers option to limit searches to displayed tiddlers only
|please see [[SearchOptionsPluginInfo]] for additional revision details|
2005.10.18 [1.0.0] Initial Release
<<<
!!!!!Code
***/
//{{{
version.extensions.SearchOptionsPlugin= {major: 3, minor: 0, revision: 5, date: new Date(2009,1,16)};

var co=config.options; // abbrev
if (co.chkSearchTitles===undefined) co.chkSearchTitles=true;
if (co.chkSearchText===undefined) co.chkSearchText=true;
if (co.chkSearchTags===undefined) co.chkSearchTags=true;
if (co.chkSearchFields===undefined) co.chkSearchFields=true;
if (co.chkSearchTitlesFirst===undefined) co.chkSearchTitlesFirst=true;
if (co.chkSearchList===undefined) co.chkSearchList=true;
if (co.chkSearchHighlight===undefined) co.chkSearchHighlight=true;
if (co.chkSearchListTiddler===undefined) co.chkSearchListTiddler=false;
if (co.chkSearchByDate===undefined) co.chkSearchByDate=false;
if (co.chkIncrementalSearch===undefined) co.chkIncrementalSearch=true;
if (co.chkSearchShadows===undefined) co.chkSearchShadows=true;
if (co.txtIncrementalSearchDelay===undefined) co.txtIncrementalSearchDelay=500;
if (co.txtIncrementalSearchMin===undefined) co.txtIncrementalSearchMin=3;
if (co.chkSearchOpenTiddlers===undefined) co.chkSearchOpenTiddlers=false;
if (co.chkSearchExcludeTags===undefined) co.chkSearchExcludeTags=true;
if (co.txtSearchExcludeTags===undefined) co.txtSearchExcludeTags="excludeSearch";
if (config.macros.search.reportTitle==undefined)
	config.macros.search.reportTitle="SearchResults"; // note: not a cookie!
config.macros.search.label+="\xa0"; // a little bit of space just because it looks better
//}}}
// // searchLink: {{{[search[text to find]] OR [search[text to display|text to find]]}}}
//{{{
config.formatters.push( {
	name: "searchLink",
	match: "\\[search\\[",
	lookaheadRegExp: /\[search\[(.*?)(?:\|(.*?))?\]\]/mg,
	prompt: "search for: '%0'",
	handler: function(w)
	{
		this.lookaheadRegExp.lastIndex = w.matchStart;
		var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
		if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
			var label=lookaheadMatch[1];
			var text=lookaheadMatch[2]||label;
			var prompt=this.prompt.format([text]);
			var btn=createTiddlyButton(w.output,label,prompt,
				function(){story.search(this.getAttribute("searchText"))},"searchLink");
			btn.setAttribute("searchText",text);
			w.nextMatch = this.lookaheadRegExp.lastIndex;
		}
	}
});
//}}}
// // incremental search uses option settings instead of hard-coded delay and minimum input values
//{{{
var fn=config.macros.search.onKeyPress;
fn=fn.toString().replace(/500/g, "config.options.txtIncrementalSearchDelay||500");
fn=fn.toString().replace(/> 2/g, ">=(config.options.txtIncrementalSearchMin||3)");
eval("config.macros.search.onKeyPress="+fn);
//}}}
// // REPLACE story.search() for option to "show search results in a list"
//{{{
Story.prototype.search = function(text,useCaseSensitive,useRegExp)
{
	var co=config.options; // abbrev
	var re=new RegExp(useRegExp ? text : text.escapeRegExp(),useCaseSensitive ? "mg" : "img");
	if (config.options.chkSearchHighlight) highlightHack=re;
	var matches = store.search(re,co.chkSearchByDate?"modified":"title","");
	if (co.chkSearchByDate) matches=matches.reverse(); // most recent first
	var q = useRegExp ? "/" : "'";
	clearMessage();
	if (!matches.length) {
		if (co.chkSearchListTiddler) discardSearchResults();
		displayMessage(config.macros.search.failureMsg.format([q+text+q]));
	} else {
		if (co.chkSearchList||co.chkSearchListTiddler) 
			reportSearchResults(text,matches);
		else {
			var titles = []; for(var t=0; t<matches.length; t++) titles.push(matches[t].title);
			this.closeAllTiddlers(); story.displayTiddlers(null,titles);
			displayMessage(config.macros.search.successMsg.format([matches.length, q+text+q]));
		}
	}
	highlightHack = null;
}
//}}}
// // REPLACE store.search() for enhanced searching/sorting options
//{{{
TiddlyWiki.prototype.search = function(searchRegExp,sortField,excludeTag)
{
	var co=config.options; // abbrev
	var tids = this.reverseLookup("tags",excludeTag,false,sortField);
	var opened=[]; story.forEachTiddler(function(tid,elem){opened.push(tid);});

	// eliminate tiddlers tagged with excluded tags
	if (co.chkSearchExcludeTags&&co.txtSearchExcludeTags.length) {
		var ex=co.txtSearchExcludeTags.readBracketedList();
		var temp=[]; for(var t=tids.length-1; t>=0; t--)
			if (!tids[t].tags.containsAny(ex)) temp.push(tids[t]);
		tids=temp;
	}

	// scan for matching titles first...
	var results = [];
	if (co.chkSearchTitles) {
		for(var t=0; t<tids.length; t++) {
			if (co.chkSearchOpenTiddlers && !opened.contains(tids[t].title)) continue; 
			if(tids[t].title.search(searchRegExp)!=-1) results.push(tids[t]);
		}
		if (co.chkSearchShadows)
			for (var t in config.shadowTiddlers) {
				if (co.chkSearchOpenTiddlers && !opened.contains(t)) continue; 
				if ((t.search(searchRegExp)!=-1) && !store.tiddlerExists(t))
					results.push((new Tiddler()).assign(t,config.shadowTiddlers[t]));
			}
	}
	// then scan for matching text, tags, or field data
	for(var t=0; t<tids.length; t++) {
		if (co.chkSearchOpenTiddlers && !opened.contains(tids[t].title)) continue; 
		if (co.chkSearchText && tids[t].text.search(searchRegExp)!=-1)
			results.pushUnique(tids[t]);
		if (co.chkSearchTags && tids[t].tags.join(" ").search(searchRegExp)!=-1)
			results.pushUnique(tids[t]);
		if (co.chkSearchFields && store.forEachField!=undefined)
			store.forEachField(tids[t],
				function(tid,field,val) {
					if (val.search(searchRegExp)!=-1) results.pushUnique(tids[t]);
				},
				true); // extended fields only
	}
	// then check for matching text in shadows
	if (co.chkSearchShadows)
		for (var t in config.shadowTiddlers) {
			if (co.chkSearchOpenTiddlers && !opened.contains(t)) continue; 
			if ((config.shadowTiddlers[t].search(searchRegExp)!=-1) && !store.tiddlerExists(t))
				results.pushUnique((new Tiddler()).assign(t,config.shadowTiddlers[t]));
		}

	// if not 'titles first', or sorting by modification date,
	// re-sort results to so titles, text, tag and field matches are mixed together
	if(!sortField) sortField = "title";
	var bySortField=function(a,b){
		if(a[sortField]==b[sortField])return(0);else return(a[sortField]<b[sortField])?-1:+1;
	}
	if (!co.chkSearchTitlesFirst || co.chkSearchByDate) results.sort(bySortField);

	return results;
}
//}}}
// // HIJACK core {{{<<search>>}}} macro to add "report" and "simple inline" output
//{{{
config.macros.search.SOP_handler=config.macros.search.handler;
config.macros.search.handler = function(place,macroName,params)
{
	// if "report", use SearchOptionsPlugin report generator for inline output
	if (params[1]&&params[1].substr(0,6)=="report") {
		var keyword=params[0];
		var options=params[1].split("=")[1]; // split "report=option+option+..."
		var heading=params[2]?params[2].unescapeLineBreaks():"";
		var matches=store.search(new RegExp(keyword.escapeRegExp(),"img"),"title","excludeSearch");
		if (matches.length) wikify(heading+window.formatSearchResults(keyword,matches,options),place);
	} else if (params[1]) {
		var keyword=params[0];
		var heading=params[1]?params[1].unescapeLineBreaks():"";
		var seperator=params[2]?params[2].unescapeLineBreaks():", ";
		var matches=store.search(new RegExp(keyword.escapeRegExp(),"img"),"title","excludeSearch");
		if (matches.length) {
			var out=[];
			for (var m=0; m<matches.length; m++) out.push("[["+matches[m].title+"]]");
			wikify(heading+out.join(seperator),place);
		}
	} else
		config.macros.search.SOP_handler.apply(this,arguments);
};
//}}}
// // SearchResults panel handling
//{{{
setStylesheet(".searchResults { padding:1em 1em 0 1em; }","searchResults"); // matches std tiddler padding

config.macros.search.createPanel=function(text,matches,body) {

	function getByClass(e,c) { var d=e.getElementsByTagName("div");
		for (var i=0;i<d.length;i++) if (hasClass(d[i],c)) return d[i]; }
	var panel=createTiddlyElement(null,"div","searchPanel","searchPanel");
	this.renderPanel(panel,text,matches,body);
	var oldpanel=document.getElementById("searchPanel");
	if (!oldpanel) { // insert new panel just above tiddlers
		var da=document.getElementById("displayArea");
		da.insertBefore(panel,da.firstChild);
	} else { // if panel exists
		var oldwrap=getByClass(oldpanel,"searchResults");
		var newwrap=getByClass(panel,"searchResults");
		// if no prior content, just insert new content
		if (!oldwrap) oldpanel.insertBefore(newwrap,null);
		else {	// swap search results content but leave containing panel intact
			oldwrap.style.display='block'; // unfold wrapper if needed
			var i=oldwrap.getElementsByTagName("input")[0]; // get input field
			if (i) { var pos=this.getCursorPos(i); i.onblur=null; } // get cursor pos, ignore blur
			oldpanel.replaceChild(newwrap,oldwrap);
			panel=oldpanel; // use existing panel
		} 
	}
	this.showPanel(true,pos);
	return panel;
}

config.macros.search.renderPanel=function(panel,text,matches,body) {

	var wrap=createTiddlyElement(panel,"div",null,"searchResults");
	wrap.onmouseover = function(e){ addClass(this,"selected"); }
	wrap.onmouseout = function(e){ removeClass(this,"selected"); }
	// create toolbar: "open all", "fold/unfold", "close"
	var tb=createTiddlyElement(wrap,"div",null,"toolbar");
	var b=createTiddlyButton(tb, "open all", "open all matching tiddlers", function() {
		story.displayTiddlers(null,this.getAttribute("list").readBracketedList()); return false; },"button");
	var list=""; for(var t=0;t<matches.length;t++) list+='[['+matches[t].title+']] ';
	b.setAttribute("list",list);
	var b=createTiddlyButton(tb, "fold", "toggle display of search results", function() {
		config.macros.search.foldPanel(this); return false; },"button");
	var b=createTiddlyButton(tb, "close", "dismiss search results",	function() {
		config.macros.search.showPanel(false); return false; },"button");
	createTiddlyText(createTiddlyElement(wrap,"div",null,"title"),"Search for: "+text); // title
	wikify(body,createTiddlyElement(wrap,"div",null,"viewer")); // report
	return panel;
}

config.macros.search.showPanel=function(show,pos) {
	var panel=document.getElementById("searchPanel");
	var i=panel.getElementsByTagName("input")[0];
	i.onfocus=show?function(){config.macros.search.stayFocused(true);}:null;
	i.onblur=show?function(){config.macros.search.stayFocused(false);}:null;
	if (show && panel.style.display=="block") { // if shown, grab focus, restore cursor
		if (i&&this.stayFocused()) { i.focus(); this.setCursorPos(i,pos); }
		return;
	}
	if(!config.options.chkAnimate) {
		panel.style.display=show?"block":"none";
		if (!show) { removeChildren(panel); config.macros.search.stayFocused(false); }
	} else {
		var s=new Slider(panel,show,false,show?"none":"children");
		s.callback=function(e,p){e.style.overflow="visible";}
		anim.startAnimating(s);
	}
	return panel;
}

config.macros.search.foldPanel=function(button) {
	var d=document.getElementById("searchPanel").getElementsByTagName("div");
	for (var i=0;i<d.length;i++) if (hasClass(d[i],"viewer")) var v=d[i]; if (!v) return;
	var show=v.style.display=="none";
	if(!config.options.chkAnimate)
		v.style.display=show?"block":"none";
	else {
		var s=new Slider(v,show,false,"none");
		s.callback=function(e,p){e.style.overflow="visible";}
		anim.startAnimating(s);
	}
	button.innerHTML=show?"fold":"unfold";
	return false;
}

config.macros.search.stayFocused=function(keep) { // TRUE/FALSE=set value, no args=get value
	if (keep===undefined) return this.keepReportInFocus;
	this.keepReportInFocus=keep;
	return keep
}	

config.macros.search.getCursorPos=function(i) {
	var s=0; var e=0; if (!i) return { start:s, end:e };
	try {
		if (i.setSelectionRange) // FF
			{ s=i.selectionStart; e=i.selectionEnd; }
		if (document.selection && document.selection.createRange) { // IE
			var r=document.selection.createRange().duplicate();
			var len=r.text.length; s=0-r.moveStart('character',-100000); e=s+len;
		}
	}catch(e){};
	return { start:s, end:e };
}
config.macros.search.setCursorPos=function(i,pos) {
	if (!i||!pos) return; var s=pos.start; var e=pos.end;
	if (i.setSelectionRange) //FF
		i.setSelectionRange(s,e);
	if (i.createTextRange) // IE
		{ var r=i.createTextRange(); r.collapse(true); r.moveStart("character",s); r.select(); }
}
//}}}
// // SearchResults report generation
// note: these functions are defined globally, so they can be more easily redefined to customize report formats//
//{{{
if (!window.reportSearchResults) window.reportSearchResults=function(text,matches)
{
	var cms=config.macros.search; // abbrev
	var body=window.formatSearchResults(text,matches);
	if (!config.options.chkSearchListTiddler) // show #searchResults panel
		window.scrollTo(0,ensureVisible(cms.createPanel(text,matches,body)));
	else { // write [[SearchResults]] tiddler
		var title=cms.reportTitle;
		var who=config.options.txtUserName;
		var when=new Date();
		var tags="excludeLists excludeSearch temporary";
		var tid=store.getTiddler(title); if (!tid) tid=new Tiddler();
		tid.set(title,body,who,when,tags);
		store.addTiddler(tid);
		story.closeTiddler(title);
		story.displayTiddler(null,title);
	}
}

if (!window.formatSearchResults) window.formatSearchResults=function(text,matches,opt)
{
	var body='';
	var title=config.macros.search.reportTitle
	var q = config.options.chkRegExpSearch ? "/" : "'";
	if (!opt) var opt="all";
	var parts=opt.split("+");
	for (var i=0; i<parts.length; i++) { var p=parts[i].toLowerCase();
		if (p=="again"||p=="all")   body+=window.formatSearchResults_again(text,matches);
		if (p=="summary"||p=="all") body+=window.formatSearchResults_summary(text,matches);
		if (p=="list"||p=="all")    body+=window.formatSearchResults_list(text,matches);
		if (p=="buttons"||p=="all") body+=window.formatSearchResults_buttons(text,matches);
	}
	return body;
}

if (!window.formatSearchResults_again) window.formatSearchResults_again=function(text,matches)
{
	var title=config.macros.search.reportTitle
	var body='';
	// search again
	body+='{{span{<<search "'+text.replace(/"/g,'&#x22;')+'">> /%\n';
	body+='%/<html><input type="button" value="search again"';
	body+=' onclick="var t=this.parentNode.parentNode.getElementsByTagName(\'input\')[0];';
	body+=' config.macros.search.doSearch(t); return false;">';
	body+=' <a href="javascript:;" onclick="';
	body+=' var e=this.parentNode.nextSibling;';
	body+=' var show=e.style.display!=\'block\';';
	body+=' if(!config.options.chkAnimate) e.style.display=show?\'block\':\'none\';';
	body+=' else anim.startAnimating(new Slider(e,show,false,\'none\'));';
	body+=' return false;">options...</a>';
	body+='</html>@@display:none;border-left:1px dotted;margin-left:1em;padding:0;padding-left:.5em;font-size:90%;/%\n';
	body+='	%/<<option chkSearchTitles>>titles /%\n';
	body+='	%/<<option chkSearchText>>text /%\n';
	body+='	%/<<option chkSearchTags>>tags /%\n';
	body+='	%/<<option chkSearchFields>>fields /%\n';
	body+='	%/<<option chkSearchShadows>>shadows\n';
	body+='	<<option chkCaseSensitiveSearch>>case-sensitive /%\n';
	body+='	%/<<option chkRegExpSearch>>text patterns /%\n';
	body+='	%/<<option chkSearchByDate>>sorted by date\n';
	body+='	<<option chkSearchHighlight>> highlight matching text in displayed tiddlers\n';
	body+='	<<option chkIncrementalSearch>>incremental key-by-key search: /%\n';
	body+='	%/{{twochar{<<option txtIncrementalSearchMin>>}}} or more characters, /%\n';
	body+='	%/{{threechar{<<option txtIncrementalSearchDelay>>}}} msec delay\n';
	body+='	<<option chkSearchOpenTiddlers>> search only in tiddlers that are currently displayed\n';
	body+='	<<option chkSearchExcludeTags>>exclude tiddlers tagged with:\n';
	body+='	{{editor{<<option txtSearchExcludeTags>>}}}/%\n';
	body+='%/@@}}}\n\n';
	return body;
}

if (!window.formatSearchResults_summary) window.formatSearchResults_summary=function(text,matches)
{
	// summary: nn tiddlers found matching '...', options used
	var body='';
	var co=config.options; // abbrev
	var title=config.macros.search.reportTitle
	var q = co.chkRegExpSearch ? "/" : "'";
	body+="''"+config.macros.search.successMsg.format([matches.length,q+"{{{"+text+"}}}"+q])+"''\n";
	var opts=[];
	if (co.chkSearchTitles) opts.push("titles");
	if (co.chkSearchText) opts.push("text");
	if (co.chkSearchTags) opts.push("tags");
	if (co.chkSearchFields) opts.push("fields");
	if (co.chkSearchShadows) opts.push("shadows");
	if (co.chkSearchOpenTiddlers) body+="^^//search limited to displayed tiddlers only//^^\n";
	body+="~~&nbsp; searched in "+opts.join(" + ")+"~~\n";
	body+=(co.chkCaseSensitiveSearch||co.chkRegExpSearch?"^^&nbsp; using ":"")
		+(co.chkCaseSensitiveSearch?"case-sensitive ":"")
		+(co.chkRegExpSearch?"pattern ":"")
		+(co.chkCaseSensitiveSearch||co.chkRegExpSearch?"matching^^\n":"");
	return body;
}

if (!window.formatSearchResults_list) window.formatSearchResults_list=function(text,matches)
{
	// bullet list of links to matching tiddlers
	var body='';
	var pattern=co.chkRegExpSearch?text:text.escapeRegExp();
	var sensitive=co.chkCaseSensitiveSearch?"mg":"img";
	var link='{{tiddlyLinkExisting{<html><nowiki><a href="javascript:;" onclick="'
		+'if(config.options.chkSearchHighlight)'
		+'	highlightHack=new RegExp(\x27'+pattern+'\x27,\x27'+sensitive+'\x27);'
		+'story.displayTiddler(null,\x27%0\x27);'
		+'highlightHack = null; return false;'
		+'" title="%2">%1</a></html>}}}';
	for(var t=0;t<matches.length;t++) {
		body+="* ";
		if (config.options.chkSearchByDate)
			body+=matches[t].modified.formatString('YYYY.0MM.0DD 0hh:0mm')+" ";
		var title=matches[t].title;
		var fixup=title.replace(/'/g,"\\x27").replace(/"/g,"\\x22");
		var tid=store.getTiddler(title);
		var tip=tid?tid.getSubtitle():''; tip=tip.replace(/"/g,"&quot;");
		body+=link.format([fixup,title,tip])+'\n';
	}
	return body;
}

if (!window.formatSearchResults_buttons) window.formatSearchResults_buttons=function(text,matches)
{
	// embed buttons only if writing SearchResults to tiddler
	if (!config.options.chkSearchListTiddler) return "";
	// "open all" button
	var title=config.macros.search.reportTitle;
	var body="";
	body+="@@diplay:block;<html><input type=\"button\" href=\"javascript:;\" "
		+"onclick=\"story.displayTiddlers(null,[";
	for(var t=0;t<matches.length;t++)
		body+="'"+matches[t].title.replace(/\'/mg,"\\'")+"'"+((t<matches.length-1)?", ":"");
	body+="],1);\" accesskey=\"O\" value=\"open all matching tiddlers\"></html> ";
	// "discard SearchResults" button
	body+="<html><input type=\"button\" href=\"javascript:;\" "
		+"onclick=\"discardSearchResults()\" value=\"discard "+title+"\"></html>";
	body+="@@\n";
	return body;
}

if (!window.discardSearchResults) window.discardSearchResults=function()
{
	// remove the tiddler
	story.closeTiddler(config.macros.search.reportTitle);
	store.deleteTiddler(config.macros.search.reportTitle);
	store.notify(config.macros.search.reportTitle,true);
}
//}}}
config.options.chkShowQuickEdit=true;
@@padding-left:0.7em;font-size:9px;color:#aaa;TW Ver:<<version>>@@<<search>><<closeAll>><<permaview>><<newTiddler>><<newJournal "DD MMM YYYY" "journal">><<saveChanges>><<doBackup>><<tiddler TspotSidebar>><<slider chkSliderOptionsPanel OptionsPanel "options »" "Change TiddlyWiki advanced options">>
@@padding:0.6em;<<slider chkSliderSideBarTabs SideBarTabsSlider 'index »' 'tiddlers, timeline, all, tags'>>@@
<<tabs MainTab [[Timeline]] 'Timeline' [[TabTimeline]] [[All]] 'All tiddlers' [[TabAll]] [[Shadowed ]] "Shadowed tiddlers" [[TabMoreShadowed]]  [[Tags]] 'All tags' [[TabTags]]  [[Orphans]] "Orphaned" [[TabMoreOrphans]] [[Plugins ]] "" [[Plugins]]>>
quick and easy math equations
@@font-size:0.75em;TW Math@@
2009.01.29 1050 GMT

''Another solution to square bracket problem''

This uses URL Encoding for the square brackets.

{{{[=%5B}}} and {{{]=%5D}}}

{{{[img[http://latex.codecogs.com/gif.latex?\sqrt%5B3%5D{x+y}]]}}}
.
[img[http://latex.codecogs.com/gif.latex?\sqrt%5B3%5D{x+y}]]


----
Square brackets in latex breaks 'img' tag

{{{[img[http://latex.codecogs.com/gif.latex?\sqrt[3]{x+y}]]}}}

Broken code

----

Macro fix for ~SquareBracketBug
{{{<<Math \sqrt[3]{x+y}>>}}}

Display:

<<Math \sqrt[3]{x+y}>>

LaTexMath macro
{{{
version.extensions.Math= {major: 0, minor: 1, revision: 1, date: new Date("Oct 31, 2008")};
config.macros.Math= {};
config.macros.Math.handler = function(place,macroName,params) {
var latex= params.join(" ");
var theImage = createTiddlyElement(place,"img");
theImage.src = "http://latex.codecogs.com/gif.latex?" +  latex;
}
}}}
.header {position:relative; height:40px;}
.header a:hover {background:transparent;}
.headerShadow {position: relative;padding: 0em 0em 0em 1em;left: 0px; top: 0px;}
.headerForeground {position:absolute;padding:0.0em 0em 1em 1em; left:0px; top:0px;}

.small	{ font-size:8pt;line-height:120% }
.smallform	{ white-space:nowrap; }
.smallform input, .smallform textarea, .smallform button, .smallform checkbox, .smallform radio, .smallform select
 { font-size:12pt; }



#displayArea {margin-top:0.0em}

a:hover {background:transparent;color:#a00;}

#sidebarTabs .tabContents {
	max-height: 35em; /* not IE6-compatible */
	overflow: auto;
	width: 92.5%;
}

#sidebarTabs .tabContents .tabContents {
	max-height: 30em !important; /* not IE6-compatible */
}



.viewer .button {color: #04b;border: 0px; font-weight:bold;}

.viewer blockquote {border-left: 2px solid #c06;color:#040;}

.viewer hr {border: 0px;border-top: solid 1px #c06;color: #c06;}

.blueLink .button {color:#00f;}
.blueLinktext  {color:#00f;font-weight:bold;}

.c06Link .button {color:#c06;}
.c06Link {color:#c06;}

 /* custom styles for parallel columns. Classes cola and colb */
.cola {width:45%; float:left; margin-left:0.5em;}
.colb {width:45%; float:left; margin-left:1.5em;}
.clear{clear:both;}


.popup {
 max-height:275px;
 min-height:auto;
 width: auto; 
 overflow: auto;
 margin:auto;
-moz-border-radius : 0.65em 0.2em 0.2em 0.65em;
background:#eee;
color:#900;
}

/* GIFFMEX TWEAKS TO STYLESHEETPRINT (so that nothing but tiddler title and text are printed) */
@media print {#tiddlersBar {display: none ! important;}}
@media print {#mainMenu {display: none ! important;}}
@media print {#topMenu {display: none ! important;}}
@media print {#slantedmenu {display: none ! important;}}
@media print {#sidebar {display: none ! important;}}
@media print {#messageArea {display: none ! important;}} 
@media print {#toolbar {display: none ! important;}}
@media print {.header {display: none ! important;}}
@media print {.tiddler .subtitle {display: none ! important;}}
@media print {.tiddler .toolbar {display; none ! important; }}
@media print {.tiddler .tagging {display; none ! important; }}
@media print {.tiddler .tagged {display; none ! important; }}
@media print {#displayArea {margin: 1em 1em 0em 1em;}}
@media print {.pageBreak {page-break-before: always;}}
[[ButtonStyle]]
[[ViewerTabsCSS]]
[[TopMenuStyle]]
[[TabsCSS]]
[[StyleSheetShortcuts]]
[[CustomCSS]]
/***
|Name|StyleSheetShortcuts|
|Source|http://www.TiddlyTools.com/#StyleSheetShortcuts|
|Version||
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|CSS|
|Requires||
|Overrides||
|Description|'convenience' classes for common formatting, alignment, boxes, tables, etc.|

These 'style tweaks' can be easily included in other stylesheet tiddler so they can share a baseline look-and-feel that can then be customized to create a wide variety of 'flavors'.
***/
/*{{{*/

/* text alignments */

.headline{
color:#c06;
font-size:140%;
font-family:times,arial;
line-height:60%;
}


.left
	{ display:block;text-align:left; }
.center
	{ display:block;text-align:center; }
.right	
	{ display:block;text-align:right; }
.justify
	{ display:block;text-align:justify; }
.indent
	{ display:block;margin:0;padding:0;border:0;margin-left:2em; }
.floatleft
	{ float:left; }
.floatright
	{ float:right; }
.valignTop, .valignTop table, .valignTop tbody, .valignTop th, .valignTop tr, .valignTop td
	{ vertical-align:top; }
.valignBottom, .valignBottom table, .valignBottom tbody, .valignBottom th, .valignBottom tr, .valignBottom td
	{ vertical-align:bottom; }
.clear
	{ clear:both; }
.wrap
	{ white-space:normal; }
.nowrap
	{ white-space:nowrap; }
.hidden
	{ display:none; }
.show
	{ display:inline !important; }
.span
	{ display:span; }
.block
	{ display:block; }
.relative
	{ position:relative; }
.absolute
	{ position:absolute; }

/* font sizes */
.big
	{ font-size:14pt;line-height:120% }
.medium
	{ font-size:12pt;line-height:120% }
.normal
	{ font-size:9pt;line-height:120% }
.small
	{ font-size:8pt;line-height:120% }
.fine
	{ font-size:7pt;line-height:120% }
.tiny
	{ font-size:6pt;line-height:120% }
.larger
	{ font-size:120%; }
.smaller
	{ font-size:80%; }

/* font styles */
.bold
	{ font-weight:bold; }
.italic
	{ font-style:italic; }
.underline
	{ text-decoration:underline; }

/* plain list items (no bullets or indent) */
.nobullets li { list-style-type: none; margin-left:-2em; }

/* multi-column tiddler content (not supported in Internet Explorer) */
.twocolumns { display:block;
	-moz-column-count:2; -moz-column-gap:1em; -moz-column-width:50%; /* FireFox */
	-webkit-column-count:2; -webkit-column-gap:1em; -webkit-column-width:50%; /* Safari */
	column-count:2; column-gap:1em; column-width:50%; /* Opera */
}
.threecolumns { display:block;
	-moz-column-count:3; -moz-column-gap:1em; -moz-column-width:33%; /* FireFox */
	-webkit-column-count:3; -webkit-column-gap:1em; -webkit-column-width:33%; /* Safari */
	column-count:3; column-gap:1em; column-width:33%; /* Opera */
}
.fourcolumns { display:block;
	-moz-column-count:4; -moz-column-gap:1em; -moz-column-width:25%; /* FireFox */
	-webkit-column-count:4; -webkit-column-gap:1em; -webkit-column-width:25%; /* Safari */
	column-count:4; column-gap:1em; column-width:25%; /* Opera */
}

/* show/hide browser-specific content for InternetExplorer vs. non-IE ("moz") browsers */
*[class="ieOnly"]
	{ display:none; } /* hide in moz (uses CSS selector) */
* html .mozOnly, *:first-child+html .mozOnly
	{ display: none; } /* hide in IE (uses IE6/IE7 CSS hacks) */

/* borderless tables */
.borderless, .borderless table, .borderless td, .borderless tr, .borderless th, .borderless tbody
	{ border:0 !important; margin:0 !important; padding:7px !important; td.vertical-align:top !important;margin-left: auto !important; margin-right: auto !important;}


.widetable, .widetable table
	{ width:100%; }

/* thumbnail images (fixed-sized scaled images) */
.thumbnail img { height:5em !important; }

/* stretchable images (auto-size to fit tiddler) */
.stretch img { width:95%; }

/* grouped content */
.outline
	{ display:block; padding:1em; -moz-border-radius:1em;-webkit-border-radius:1em; border:1px solid; }
.menubox
	{ display:block; padding:1em; -moz-border-radius:1em;-webkit-border-radius:1em; border:1px solid; background:#fff; color:#000; }
.menubox .button, .menubox .tiddlyLinkExisting, .menubox .tiddlyLinkNonExisting
	{ color:#009 !important; }
.groupbox
	{ display:block; padding:1em; -moz-border-radius:1em;-webkit-border-radius:1em; border:1px solid; background:#ffe; color:#000; }
.groupbox a, .groupbox .button, .groupbox .tiddlyLinkExisting, .groupbox .tiddlyLinkNonExisting
	{ color:#009 !important; }
.groupbox code
	{ color:#333 !important; }
.borderleft
	{ margin:0;padding:0;border:0;margin-left:1em; border-left:1px dotted; padding-left:.5em; }
.borderright
	{ margin:0;padding:0;border:0;margin-right:1em; border-right:1px dotted; padding-right:.5em; }
.borderbottom
	{ margin:0;padding:1px 0;border:0;border-bottom:1px dotted; margin-bottom:1px; padding-bottom:1px; }
.bordertop
	{ margin:0;padding:0;border:0;border-top:1px dotted; margin-top:1px; padding-top:1px; }

/* compact form */
.smallform
	{ white-space:nowrap; }
.smallform input, .smallform textarea, .smallform button, .smallform checkbox, .smallform radio, .smallform select
	{ font-size:8pt; }

/* stretchable edit fields and textareas (auto-size to fit tiddler) */
.stretch input { width:99%; }
.stretch textarea { width:99%; }

/* compact input fields (limited to a few characters for entering percentages and other small values) */
.onechar input { width:1em; }
.twochar input { width:2em; }
.threechar input { width:3em; }
.fourchar input { width:4em; }
.fivechar input { width:5em; }

/* text colors */
.green { color:#0c0 !important }
.red { color:#f66 !important }
.blue { color:#99f !important }
.gray { color:#999 !important }

/* rollover highlighting */
.mouseover 
	{color:[[ColorPalette::TertiaryLight]] !important;}
.mouseover a
	{color:[[ColorPalette::TertiaryLight]] !important;}
.selected .mouseover
	{color:[[ColorPalette::Foreground]] !important;}
.selected .mouseover .button, .selected .mouseover a
	{color:[[ColorPalette::PrimaryDark]] !important;}

/* rollover zoom text */
.zoomover
	{ font-size:80% !important; }
.selected .zoomover
	{ font-size:100% !important; }

/*}}}*/
!!!StyleSheetTiddlersBar

#tiddlersBar .button {border:1px; color:#000;}
#tiddlersBar .tab {white-space:nowrap;}
#tiddlersBar {padding : 0.55em 0.5em 0.0em 1.0em;margin-left:0em;margin-right:0em}
#tiddlersBar {margin-bottom:0px;}

.tabSelected .button:hover {font-size:0.95em;font-weight:bold;color: #f00;background: #fff;padding : 0px 0px 0px 2px;}
.tabUnselected .button:hover {font-size:0.95em;color: #f00;background: #fff; padding : 0px 0px 0px 2px;}

.tabUnselected .button {font-size:0.95em;font-weight:bold;color: #008; padding : 0px 0px 0px 2px;}
.tabSelected .button {font-size:0.95em;font-weight:bold;color: #008;padding : 0px 0px 0px 2px;}

.tabUnselected {
background:url("http://img261.imageshack.us/img261/8603/navbargrayhw1.png") repeat-x top left;top left;
background-color:#eee;
border:0px #eee solid; border-bottom:0px;font-size:0.95em; }


.tabSelected {
background:url("http://img505.imageshack.us/img505/489/navbarredlt5.gif") repeat-x top left;top left;
background-color:#fcb;
color: #a00;border: 0px #c06 solid;border-bottom:0px; font-size:0.95em;}

.tabUnselected .tabButton {font-weight:bold;font-size:0.75em;color:#333;background:transparent; padding : 0px 2px 0px 2px; margin: 0 0 0 1px;}
.tabSelected .tabButton {font-weight:bold;font-size:0.75em;color:#000;background:transparent;padding : 0px 2px 0px 2px; margin: 0 0 0 1px;}

.tabSelected .tabButton:hover {font-weight:bold;color: #f00;background: #fff;}
.tabUnselected .tabButton:hover {font-weight:bold;color: #f00;background: #fff;}

.tiddler, .tabContents {border-top:0px #fa0 solid;margin-left:0.5em;margin-right:0.5em;}
#tiddlersBar .tab {-moz-border-radius : 0.4em 0.4em 0 0;}
#tiddlersBar  {background:#abf;line-height: 1.45em;}
#tiddlersBar  {background: url("http://img168.imageshack.us/img168/1254/leftbackdo6.gif"); background-repeat: repeat;line-height: 1.45em;}








<script>
// get all tiddlers tagged with "system"
var tids=store.getTaggedTiddlers("system");
// keep only tiddlers *also* tagged with New
var list=[];
for (var t=0; t<tids.length; t++)
   if (tids[t].isTagged("system")) list.push(tids[t]);
// create output list of tiddler titles, one per line
var out="";
for (var t=0; t<list.length; t++) out+="*[["+list[t].title+"]]\n";
return out;
</script> 
|>|bgcolor(#8af):@@color(#000080):''24 tiddlers found matching /{{{Align}}}/''@@|bgcolor(#8af):  @@color(#A00000): SearchHelp@@ |
|>|>|bgcolor(#E3FFE3):<<search>> <<option chkSearchTitles>> Titles <<option chkSearchText>> Text <<option chkSearchTags>>Tags <<option chkHoldSearches>> Hold |

|bgcolor(#8af):&nbsp;|bgcolor(#8af): @@color(#000080):sort by: ''Titles''@@ |bgcolor(#8af): @@color(#000080): ''Size'' (bytes)@@ |bgcolor(#8af): @@color(#000080): ''Tags''@@ |h
| 1|[[QuickEdit_align]]| 1760|@@QuickEditPackage@@|
| 2|[[demoEditTemplate]]| 869|@@@@|
| 3|[[asciiMathCalculator]]| 560|@@@@|
| 4|[[UTF-8]]| 475|@@e-c,iframe@@|
| 5|[[URL_Encoding]]| 702|@@@@|
| 6|[[TopMenuStyle]]| 1358|@@@@|
| 7|[[ToggleTiddlersBarMacro]]| 3161|@@systemConfig@@|
| 8|[[ToggleSideBarMacro]]| 3022|@@systemConfig@@|
| 9|[[StyleSheetShortcuts]]| 6117|@@css@@|
| 10|[[SaveAsPlugin]]| 15889|@@systemConfig@@|
| 11|[[QuickEdit_customList]]| 278|@@settings,QuickEditPackage@@|
| 12|[[QuickEdit_color]]| 4726|@@QuickEditPackage@@|
| 13|[[QuickEditToolbar]]| 1754|@@script,QuickEditPackage@@|
| 14|[[NumberEmpire]]| 552|@@@@|
| 15|[[NestedSlidersPlugin]]| 20581|@@systemConfig@@|
| 16|[[NavButtons]]| 716|@@@@|
| 17|[[MiniBrowserPlugin]]| 16402|@@systemConfig@@|
| 18|[[MemorizablePlugin]]| 26403|@@systemConfig@@|
| 19|[[MainMenu]]| 985|@@@@|
| 20|[[ImportedTiddlers]]| 5309|@@@@|
| 21|[[HtmlEntities]]| 3993|@@html,non-keyboard@@|
| 22|[[CustomCSS]]| 9356|@@@@|
| 23|[[BlankIframe]]| 282|@@@@|
| 24|[[StyleSheetLayout]]| 6872|@@@@|
[[Science|http://science.tiddlyspot.com]]
[[SideMinder|http://sideminder.tiddlyspot.com]]
[[SideSnips|http://sidesnips.tiddlyspot.com]]
[[SidebarPluginVault|http://sidebarpluginvault.tiddlyspot.com]]
[[SidebarRadio|http://sidebarradio.tiddlyspot.com]]
[[TW Equation|http://twequation.tiddlyspot.com/]]
[[TW Help|http://twhelp.tiddlyspot.com/]]
[[TW Math|http://twmath.tiddlyspot.com/]]
[[TW Notes|http://twnotes.tiddlyspot.com/]]
[[TW T-Notes|http://twt-notes.tiddlyspot.com/]]
----
''1:'' When the  memorizable Ohms Law table first loads it shows all of the questions and formulas at once in a table format.  So it can be studied like any two column table.

''2:'' When you click on (memorize this) a new table appears showing one
question at a time at random.

  '' 2a:''  Now you can try to guess the answer.  Next at the bottom of the table you click '''I was right''' or '''I was wrong'''

  '' 2b:''  If you click '''I was right''' it moves on to the next random question.  If you click '''I was wrong''' it moves on the the next random question but will ask that wrong question again at a later time.  This continues until all questions are answered right. 
#sidebarTabs .tabSelected {

        background:url("navbarredlt5.gif") repeat-x top left;top left;
        background-color:#fcb;
        font-size:0.95em;
        font-weight:bold;
        color:#a00;
	text-decoration:none;
        border: 0px solid #999;      
}



#sidebarTabs .tabUnselected {
        background:url("navbargrayhw1.jpg") repeat-x top left;top left;
        background-color:#eee;
        font-size:0.95em;
        font-weight:bold;
	color:#008;
        text-decoration:none;
        border: 0px solid #999; 

}
/***
|Name|TaggedTemplateTweak|
|Source|http://www.TiddlyTools.com/#TaggedTemplateTweak|
|Documentation|http://www.TiddlyTools.com/#TaggedTemplateTweakInfo|
|Version|1.5.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|Story.prototype.chooseTemplateForTiddler()|
|Description|use alternative ViewTemplate/EditTemplate for tiddler's tagged with specific tag values|
This tweak extends story.chooseTemplateForTiddler() so that ''whenever a tiddler is marked with a specific tag value, it can be viewed and/or edited using alternatives to the standard tiddler templates.'' 
!!!!!Documentation
>see [[TaggedTemplateTweakInfo]]
!!!!!Revisions
<<<
2008.12.18 [1.5.0] added handling for using tiddler //title// as prefix (e.g., {{{SomeTiddlerViewTemplate}}}) 
| please see [[TaggedTemplateTweakInfo]] for previous revision details |
2007.06.11 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.TaggedTemplateTweak= {major: 1, minor: 5, revision: 0, date: new Date(2008,12,18)};

Story.prototype.taggedTemplate_chooseTemplateForTiddler = Story.prototype.chooseTemplateForTiddler
Story.prototype.chooseTemplateForTiddler = function(title,template)
{
	// get default template from core
	var coreTemplate=this.taggedTemplate_chooseTemplateForTiddler.apply(this,arguments);

	// if the tiddler doesn't exist yet, return core result
	var tiddler=store.getTiddler(title); if (!tiddler) return coreTemplate;

	// split core template into theme prefix and template name
	var theme="";
	var template=coreTemplate;
	var parts=template.split(config.textPrimitives.sectionSeparator);
	if (parts[1]) { theme=parts[0]; template=parts[1]; }
	else theme=config.options.txtTheme||""; // fallback if theme is not specified
	theme+=config.textPrimitives.sectionSeparator;

	// look for template whose prefix matches a *tag* on this tiddler (if any)
	for (i=0; i<tiddler.tags.length; i++) {
		var t=tiddler.tags[i]+template; // add tag prefix to template
		var c=t.substr(0,1).toUpperCase()+t.substr(1); // capitalized for WikiWord title
		if (store.getTiddlerText(theme+t))	{ return theme+t; } // theme##tagTemplate
		if (store.getTiddlerText(theme+c))	{ return theme+c; } // theme##TagTemplate
		if (store.getTiddlerText(t)) 		{ return t; }	    // tagTemplate
		if (store.getTiddlerText(c))		{ return c; }	    // TagTemplate
	}

	// if no tagged template found, and tiddler title is not itself a tag,
	// then look for the template whose prefix matches the *title* of this tiddler
	var isTag=store.getTaggedTiddlers(title).length;
	if (!isTag && store.getTiddlerText(title+template)) { return title+template; }

	// no matching tag OR title prefix... return core result
	return coreTemplate;
}
//}}}
/***
|''Name:''|TiddlersBarPluginMG|
|''Description:''|A bar to switch between tiddlers through tabs (like browser tabs bar).|
|''Version:''|1.2.5|
|''Date:''|Jan 18,2008|
|''Source:''|http://visualtw.ouvaton.org/VisualTW.html|
|''Author:''|Pascal Collin|
|''License:''|[[BSD open source license|License]]|
|''~CoreVersion:''|2.1.0|
|''Browser:''|Firefox 2.0; InternetExplorer 6.0, others|
!Modification
2008.09.06 -  Morris Gray (Added http://tw.lewcid.org/#OpenTopPlugin code to this plugin to overcome jumping to the top when invoking any popup. Deleted the offending code)
!Demos
On [[homepage|http://visualtw.ouvaton.org/VisualTW.html]], open several tiddlers to use the tabs bar.
!Installation
#import this tiddler from [[homepage|http://visualtw.ouvaton.org/VisualTW.html]] (tagged as systemConfig)
#save and reload
#''if you're using a custom [[PageTemplate]]'', add {{{<div id='tiddlersBar' refresh='none' ondblclick='config.macros.tiddlersBar.onTiddlersBarAction(event)'></div>}}} before {{{<div id='tiddlerDisplay'></div>}}}
#optionally, adjust StyleSheetTiddlersBar
!Tips
*Doubleclick on the tiddlers bar (where there is no tab) create a new tiddler.
*Tabs include a button to close {{{x}}} or save {{{!}}} their tiddler.
*By default, click on the current tab close all others tiddlers.
!Configuration options 
<<option chkDisableTabsBar>> Disable the tabs bar (to print, by example).
<<option chkHideTabsBarWhenSingleTab >> Automatically hide the tabs bar when only one tiddler is displayed. 
<<option txtSelectedTiddlerTabButton>> ''selected'' tab command button.
<<option txtPreviousTabKey>> previous tab access key.
<<option txtNextTabKey>> next tab access key.
!Code
***/
//{{{


config.options.chkDisableTabsBar = config.options.chkDisableTabsBar ? config.options.chkDisableTabsBar : false;
config.options.chkHideTabsBarWhenSingleTab  = config.options.chkHideTabsBarWhenSingleTab  ? config.options.chkHideTabsBarWhenSingleTab  : false;
config.options.txtSelectedTiddlerTabButton = config.options.txtSelectedTiddlerTabButton ? config.options.txtSelectedTiddlerTabButton : "do nothing";
config.options.txtPreviousTabKey = config.options.txtPreviousTabKey ? config.options.txtPreviousTabKey : "";
config.options.txtNextTabKey = config.options.txtNextTabKey ? config.options.txtNextTabKey : "";
config.macros.tiddlersBar = {
	tooltip : "see ",
	tooltipClose : "click here to close this tab",
	tooltipSave : "click here to save this tab",
	promptRename : "Enter tiddler new name",
	currentTiddler : "",
	previousState : false,
	previousKey : config.options.txtPreviousTabKey,
	nextKey : config.options.txtNextTabKey,	
	tabsAnimationSource : null, //use document.getElementById("tiddlerDisplay") if you need animation on tab switching.
	handler: function(place,macroName,params) {
		var previous = null;
		if (config.macros.tiddlersBar.isShown())
			story.forEachTiddler(function(title,e){
				if (title==config.macros.tiddlersBar.currentTiddler){
					var d = createTiddlyElement(null,"span",null,"tab tabSelected");
					config.macros.tiddlersBar.createActiveTabButton(d,title);
					if (previous && config.macros.tiddlersBar.previousKey) previous.setAttribute("accessKey",config.macros.tiddlersBar.nextKey);
					previous = "active";
				}
				else {
					var d = createTiddlyElement(place,"span",null,"tab tabUnselected");
					var btn = createTiddlyButton(d,title,config.macros.tiddlersBar.tooltip + title,config.macros.tiddlersBar.onSelectTab);
					btn.setAttribute("tiddler", title);
					if (previous=="active" && config.macros.tiddlersBar.nextKey) btn.setAttribute("accessKey",config.macros.tiddlersBar.previousKey);
					previous=btn;
				}
				var isDirty =story.isDirty(title);
				var c = createTiddlyButton(d,isDirty ?"!":"x",isDirty?config.macros.tiddlersBar.tooltipSave:config.macros.tiddlersBar.tooltipClose, isDirty ? config.macros.tiddlersBar.onTabSave : config.macros.tiddlersBar.onTabClose,"tabButton");
				c.setAttribute("tiddler", title);
				if (place.childNodes) {
					place.insertBefore(document.createTextNode(" "),place.firstChild); // to allow break line here when many tiddlers are open
					place.insertBefore(d,place.firstChild); 
				}
				else place.appendChild(d);
			})
	}, 
	refresh: function(place,params){
		removeChildren(place);
		config.macros.tiddlersBar.handler(place,"tiddlersBar",params);
		if (config.macros.tiddlersBar.previousState!=config.macros.tiddlersBar.isShown()) {
			story.refreshAllTiddlers();
			if (config.macros.tiddlersBar.previousState) story.forEachTiddler(function(t,e){e.style.display="";});
			config.macros.tiddlersBar.previousState = !config.macros.tiddlersBar.previousState;
		}
	},
	isShown : function(){
		if (config.options.chkDisableTabsBar) return false;
		if (!config.options.chkHideTabsBarWhenSingleTab) return true;
		var cpt=0;
		story.forEachTiddler(function(){cpt++});
		return (cpt>1);
	},
	selectNextTab : function(){  //used when the current tab is closed (to select another tab)
		var previous="";
		story.forEachTiddler(function(title){
			if (!config.macros.tiddlersBar.currentTiddler) {
				story.displayTiddler(null,title);
				return;
			}
			if (title==config.macros.tiddlersBar.currentTiddler) {
				if (previous) {
					story.displayTiddler(null,previous);
					return;
				}
				else config.macros.tiddlersBar.currentTiddler=""; 	// so next tab will be selected
			}
			else previous=title;
			});		
	},
	onSelectTab : function(e){
		var t = this.getAttribute("tiddler");
		if (t) story.displayTiddler(null,t);
		return false;
	},
	onTabClose : function(e){
		var t = this.getAttribute("tiddler");
		if (t) {
			if(story.hasChanges(t) && !readOnly) {
				if(!confirm(config.commands.cancelTiddler.warning.format([t])))
				return false;
			}
			story.closeTiddler(t);
		}
		return false;
	},
	onTabSave : function(e) {
		var t = this.getAttribute("tiddler");
		if (!e) e=window.event;
		if (t) config.commands.saveTiddler.handler(e,null,t);
		return false;
	},
	onSelectedTabButtonClick : function(event,src,title) {
		var t = this.getAttribute("tiddler");
		if (!event) event=window.event;
		if (t && config.options.txtSelectedTiddlerTabButton && config.commands[config.options.txtSelectedTiddlerTabButton])
			config.commands[config.options.txtSelectedTiddlerTabButton].handler(event, src, t);
		return false;
	},
	onTiddlersBarAction: function(event) {
		var source = event.target ? event.target.id : event.srcElement.id; // FF uses target and IE uses srcElement;
		if (source=="tiddlersBar") story.displayTiddler(null,'New Tiddler',DEFAULT_EDIT_TEMPLATE,false,null,null);
	},
	createActiveTabButton : function(place,title) {
		if (config.options.txtSelectedTiddlerTabButton && config.commands[config.options.txtSelectedTiddlerTabButton]) {
			var btn = createTiddlyButton(place, title, config.commands[config.options.txtSelectedTiddlerTabButton].tooltip ,config.macros.tiddlersBar.onSelectedTabButtonClick);
			btn.setAttribute("tiddler", title);
		}
		else
			createTiddlyText(place,title);
	}
}

story.coreCloseTiddler = story.coreCloseTiddler? story.coreCloseTiddler : story.closeTiddler;
story.coreDisplayTiddler = story.coreDisplayTiddler ? story.coreDisplayTiddler : story.displayTiddler;

story.closeTiddler = function(title,animate,unused) {
	if (title==config.macros.tiddlersBar.currentTiddler)
		config.macros.tiddlersBar.selectNextTab();
	story.coreCloseTiddler(title,false,unused); //disable animation to get it closed before calling tiddlersBar.refresh
	var e=document.getElementById("tiddlersBar");
	if (e) config.macros.tiddlersBar.refresh(e,null);
}

story.displayTiddler = function(srcElement,tiddler,template,animate,unused,customFields,toggle){
	story.coreDisplayTiddler(config.macros.tiddlersBar.tabsAnimationSource,tiddler,template,animate,unused,customFields,toggle);
	var title = (tiddler instanceof Tiddler)? tiddler.title : tiddler;  
	if (config.macros.tiddlersBar.isShown()) {
		story.forEachTiddler(function(t,e){
			if (t!=title) e.style.display="none";
			else e.style.display="";
		})
		config.macros.tiddlersBar.currentTiddler=title;
	}
	var e=document.getElementById("tiddlersBar");
	if (e) config.macros.tiddlersBar.refresh(e,null);
}

var coreRefreshPageTemplate = coreRefreshPageTemplate ? coreRefreshPageTemplate : refreshPageTemplate;
refreshPageTemplate = function(title) {
	coreRefreshPageTemplate(title);
	if (config.macros.tiddlersBar) config.macros.tiddlersBar.refresh(document.getElementById("tiddlersBar"));
}

ensureVisible=function (e) {return 0} //disable bottom scrolling (not useful now)

config.shadowTiddlers.StyleSheetTiddlersBar = "/*{{{*/\n";
config.shadowTiddlers.StyleSheetTiddlersBar += "#tiddlersBar .button {border:0}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += "#tiddlersBar .tab {white-space:nowrap}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += "#tiddlersBar {padding : 1em 0.5em 2px 0.5em}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += ".tabUnselected .tabButton, .tabSelected .tabButton {padding : 0 2px 0 2px; margin: 0 0 0 4px;}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += ".tiddler, .tabContents {border:1px [[ColorPalette::TertiaryPale]] solid;}\n";
config.shadowTiddlers.StyleSheetTiddlersBar +="/*}}}*/";
store.addNotification("StyleSheetTiddlersBar", refreshStyles);

config.refreshers.none = function(){return true;}
config.shadowTiddlers.PageTemplate=config.shadowTiddlers.PageTemplate.replace(/<div id='tiddlerDisplay'><\/div>/m,"<div id='tiddlersBar' refresh='none' ondblclick='config.macros.tiddlersBar.onTiddlersBarAction(event)'></div>\n<div id='tiddlerDisplay'></div>");

//}}}
/***

|Name|ToggleSideBarMacro|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/#ToggleSideBarMacro|
|Version|1.0|
|Requires|~TW2.x|
!Description:
Provides a button for toggling visibility of the SideBar. You can choose whether the SideBar should initially be hidden or displayed.

!Demo
<<toggleSideBar "Toggle Sidebar">>

!Usage:
{{{<<toggleSideBar>>}}} <<toggleSideBar>>
additional options:
{{{<<toggleSideBar label tooltip show/hide>>}}} where:
label = custom label for the button,
tooltip = custom tooltip for the button,
show/hide = use one or the other, determines whether the sidebar is shown at first or not.
(default is to show the sidebar)

You can add it to your tiddler toolbar, your MainMenu, or where you like really.
If you are using a horizontal MainMenu and want the button to be right aligned, put the following in your StyleSheet:
{{{ .HideSideBarButton {float:right;} }}}

!History
*23-07-06: version 1.0: completely rewritten, now works with custom stylesheets too, and easier to customize start behaviour. 
*20-07-06: version 0.11
*27-04-06: version 0.1: working.

!Code
***/
//{{{
config.macros.toggleSideBar={};

config.macros.toggleSideBar.settings={
         styleHide :  "#sidebar { display: none;}\n"+"#contentWrapper #displayArea { margin-right: 0em !important;}}\n"+"",
         styleShow : " ",
         arrow1: "Sidebar «",
         arrow2: "Sidebar »"
};

config.macros.toggleSideBar.handler=function (place,macroName,params,wikifier,paramString,tiddler)
{
          var tooltip= params[1]||'toggle sidebar';
          var mode = (params[2] && params[2]=="hide")? "hide":"show";
          var arrow = (mode == "hide")? this.settings.arrow1:this.settings.arrow2;
          var label= (params[0]&&params[0]!='.')?params[0]+" "+arrow:arrow;
          var theBtn = createTiddlyButton(place,label,tooltip,this.onToggleSideBar,"button HideSideBarButton");
          if (mode == "hide")
             { 
             (document.getElementById("sidebar")).setAttribute("toggle","hide");
              setStylesheet(this.settings.styleHide,"ToggleSideBarStyles");
             }
};

config.macros.toggleSideBar.onToggleSideBar = function(){
          var sidebar = document.getElementById("sidebar");
          var settings = config.macros.toggleSideBar.settings;
          if (sidebar.getAttribute("toggle")=='hide')
             {
              setStylesheet(settings.styleShow,"ToggleSideBarStyles");
              sidebar.setAttribute("toggle","show");
              this.firstChild.data= (this.firstChild.data).replace(settings.arrow1,settings.arrow2);
              }
          else
              {    
               setStylesheet(settings.styleHide,"ToggleSideBarStyles");
               sidebar.setAttribute("toggle","hide");
               this.firstChild.data= (this.firstChild.data).replace(settings.arrow2,settings.arrow1);
              }

     return false;
}

setStylesheet(".HideSideBarButton .button {font-weight:bold; padding: 0 5px;}\n","ToggleSideBarButtonStyles");

//}}}
/***

|Name|ToggleTiddlersBarMacro|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/|
|Version|1.0|
|Requires|~TW2.x|
!Description:

{{c06{Modified by Morris Gray to toggle the TiddlersBar}}}

Provides a button for toggling visibility of the Toolbars. You can choose whether the Toolbars should initially be hidden or displayed.

!Demo
<<toggleTiddlersBar "Toggle Sidebar">>

!Usage:
{{{<<toggleTiddlersBar>>}}} <<toggleTiddlersBar>>
additional options:
{{{<<toggleTiddlersBar label tooltip show/hide>>}}} where:
label = custom label for the button,
tooltip = custom tooltip for the button,
show/hide = use one or the other, determines whether the sidebar is shown at first or not.
(default is to show the sidebar)

You can add it to your tiddler toolbar, your MainMenu, or where you like really.
If you are using a horizontal MainMenu and want the button to be right aligned, put the following in your StyleSheet:
{{{ .HideTiddlersBarButton {float:right;} }}}

!History
*23-07-06: version 1.0: completely rewritten, now works with custom stylesheets too, and easier to customize start behaviour. 
*20-07-06: version 0.11
*27-04-06: version 0.1: working.

!Code
***/
//{{{
config.macros.toggleTiddlersBar={};

config.macros.toggleTiddlersBar.settings={
         styleHide :  ".title, #tiddlersBar { display: none;}\n"+"#contentWrapper #displayArea { margin-right: 0em !important;}}\n"+"",
         styleShow : " ",
         arrow1: "Tabs   ",
         arrow2: "NoTabs"
};

config.macros.toggleTiddlersBar.handler=function (place,macroName,params,wikifier,paramString,tiddler)
{
          var tooltip= params[1]||'toggle tabs hidden/visible';
          var mode = (params[2] && params[2]=="hide")? "hide":"show";
          var arrow = (mode == "hide")? this.settings.arrow1:this.settings.arrow2;
          var label= (params[0]&&params[0]!='.')?params[0]+" "+arrow:arrow;
          var theBtn = createTiddlyButton(place,label,tooltip,this.onToggleTiddlersBar,"button HideTiddlersBarButton");
          if (mode == "hide")
             { 
             (document.getElementById("sidebar")).setAttribute("toggle","hide");
              setStylesheet(this.settings.styleHide,"ToggleTiddlersBarStyles");
             }
};

config.macros.toggleTiddlersBar.onToggleTiddlersBar = function(){
          var sidebar = document.getElementById("sidebar");
          var settings = config.macros.toggleTiddlersBar.settings;
          if (sidebar.getAttribute("toggle")=='hide')
             {
              setStylesheet(settings.styleShow,"ToggleTiddlersBarStyles");
              sidebar.setAttribute("toggle","show");
              this.firstChild.data= (this.firstChild.data).replace(settings.arrow1,settings.arrow2);
              }
          else
              {    
               setStylesheet(settings.styleHide,"ToggleTiddlersBarStyles");
               sidebar.setAttribute("toggle","hide");
               this.firstChild.data= (this.firstChild.data).replace(settings.arrow2,settings.arrow1);
              }

     return false;
}

setStylesheet(".HideTiddlersBarButton .button {font-weight:bold; padding: 0 5px;}\n","ToggleTiddlersBarButtonStyles");

//}}}
|~ViewToolbar|closeTiddler closeOthers +editTiddler > fields syncing permalink references jump|
|~EditToolbar|+saveTiddler saveCloseTiddler -cancelTiddler  cancelCloseTiddler deleteTiddler|
<script>place.style.backgroundColor="#ccc"; /* set background color */ </script><html><hide linebreaks><div id="slantedmenu" style="font-size:1.05em;"><ul><li><<fullscreen>></li><li>&nbsp;<a href="javascript:void(0)" onclick="story.closeAllTiddlers();story.displayTiddlers(null,store.getTiddlerText('DefaultTiddlers').readBracketedList())"
><span title="Close all tiddlers and open Welcome" style="cursor:pointer">''Home''</span></a></li><li>[[Introduction|Introduction]]</li><li>[[Tutorial|Tutorial]]</li><li>[[TW Discussion Group|http://groups.google.com/group/TiddlyWiki/]]</li><li>[[CodeCogs Forums|http://www.codecogs.com/pages/forums/forum_view.php?f=28#comments]]</li><li><<tiddler GoTo>></li><li>[[UnitConversion|UnitConversion]]</li><li><<toggleSideBar>></li></ul></div></html>{{redLink textcenter{<<tiddler ShowUnsavedChanges>> }}}
/***
!!!SlantedStyle /%==================================================%/
***/

{{{
http://img261.imageshack.us/img261/8603/navbargrayhw1.png
http://img520.imageshack.us/img520/8688/mainmenugray7ef.gif
background-image: url("http://img264.imageshack.us/img264/4134/headbackbgdc6.png");background-repeat: repeat-x top-left;
}}}

/*Credits: Dynamic Drive CSS Library */
/*URL: http://www.dynamicdrive.com/style/ */

{{{
#slantedmenu{
  font-size: 90%;
     position: fixed !important;
         width: 100%;
z-index:1
     } 
}}}

#slantedmenu{

  font-size: 90%;}

#slantedmenu:after{ /*Add margin between menu and rest of content in Firefox*/
content: "."; 
display: block; 
height: 0; 
clear: both; 
visibility: hidden;
}

#slantedmenu ul{
text-indent: 10px;
padding: 3px 0;
margin: 0;
background:url("http://img261.imageshack.us/img261/8603/navbargrayhw1.png") repeat-x top left;top left;
/%background-color: #000; %/
border-top: 0px solid #f6f;
border-bottom: 0px solid #f6f;
text-align: center; /*set value to "center" for example to center items*/
}

#slantedmenu ul li{
display: inline;
}

#slantedmenu ul li a{
font-weight: normal;
color: #00a;
padding: 3px 0;
padding-right: 5px;
padding-left: 5px;
margin: 0;
text-decoration: none;
background: transparent url() top right no-repeat;
}


#slantedmenu ul li a:hover{
color: #f00;
background:#fff;

}
tiddlyspot password:
<<option pasUploadPassword>>
/***
Description: Contains the stuff you need to use Tiddlyspot
Note, you also need UploadPlugin, PasswordOptionPlugin and LoadRemoteFileThroughProxy
from http://tiddlywiki.bidix.info for a complete working Tiddlyspot site.
***/
//{{{

// edit this if you are migrating sites or retrofitting an existing TW
config.tiddlyspotSiteId = 'twmath';

// make it so you can by default see edit controls via http
config.options.chkHttpReadOnly = false;
window.readOnly = false; // make sure of it (for tw 2.2)
window.showBackstage = true; // show backstage too

// disable autosave in d3
if (window.location.protocol != "file:")
	config.options.chkGTDLazyAutoSave = false;

// tweak shadow tiddlers to add upload button, password entry box etc
with (config.shadowTiddlers) {
	SiteUrl = 'http://'+config.tiddlyspotSiteId+'.tiddlyspot.com';
	SideBarOptions = SideBarOptions.replace(/(<<saveChanges>>)/,"$1<<tiddler TspotSidebar>>");
	OptionsPanel = OptionsPanel.replace(/^/,"<<tiddler TspotOptions>>");
	DefaultTiddlers = DefaultTiddlers.replace(/^/,"[[WelcomeToTiddlyspot]] ");
	MainMenu = MainMenu.replace(/^/,"[[WelcomeToTiddlyspot]] ");
}

// create some shadow tiddler content
merge(config.shadowTiddlers,{

'WelcomeToTiddlyspot':[
 "This document is a ~TiddlyWiki from tiddlyspot.com.  A ~TiddlyWiki is an electronic notebook that is great for managing todo lists, personal information, and all sorts of things.",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //What now?// &nbsp;&nbsp;@@ Before you can save any changes, you need to enter your password in the form below.  Then configure privacy and other site settings at your [[control panel|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/controlpanel]] (your control panel username is //" + config.tiddlyspotSiteId + "//).",
 "<<tiddler TspotControls>>",
 "See also GettingStarted.",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //Working online// &nbsp;&nbsp;@@ You can edit this ~TiddlyWiki right now, and save your changes using the \"save to web\" button in the column on the right.",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //Working offline// &nbsp;&nbsp;@@ A fully functioning copy of this ~TiddlyWiki can be saved onto your hard drive or USB stick.  You can make changes and save them locally without being connected to the Internet.  When you're ready to sync up again, just click \"upload\" and your ~TiddlyWiki will be saved back to tiddlyspot.com.",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //Help!// &nbsp;&nbsp;@@ Find out more about ~TiddlyWiki at [[TiddlyWiki.com|http://tiddlywiki.com]].  Also visit [[TiddlyWiki.org|http://tiddlywiki.org]] for documentation on learning and using ~TiddlyWiki. New users are especially welcome on the [[TiddlyWiki mailing list|http://groups.google.com/group/TiddlyWiki]], which is an excellent place to ask questions and get help.  If you have a tiddlyspot related problem email [[tiddlyspot support|mailto:support@tiddlyspot.com]].",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //Enjoy :)// &nbsp;&nbsp;@@ We hope you like using your tiddlyspot.com site.  Please email [[feedback@tiddlyspot.com|mailto:feedback@tiddlyspot.com]] with any comments or suggestions."
].join("\n"),

'TspotControls':[
 "| tiddlyspot password:|<<option pasUploadPassword>>|",
 "| site management:|<<upload http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/store.cgi index.html . .  " + config.tiddlyspotSiteId + ">>//(requires tiddlyspot password)//<br>[[control panel|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/controlpanel]], [[download (go offline)|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/download]]|",
 "| links:|[[tiddlyspot.com|http://tiddlyspot.com/]], [[FAQs|http://faq.tiddlyspot.com/]], [[blog|http://tiddlyspot.blogspot.com/]], email [[support|mailto:support@tiddlyspot.com]] & [[feedback|mailto:feedback@tiddlyspot.com]], [[donate|http://tiddlyspot.com/?page=donate]]|"
].join("\n"),

'TspotSidebar':[
 "<<upload http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/store.cgi index.html . .  " + config.tiddlyspotSiteId + ">><html><a href='http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/download' class='button'>download</a></html>"
].join("\n"),

'TspotOptions':[
 "tiddlyspot password:",
 "<<option pasUploadPassword>>",
 ""
].join("\n")

});
//}}}
~~(An exercise in minimalism)~~
[img[http://img36.imageshack.us/img36/1407/tinylightbulb.gif]]{{blueLinktext{See}}} @@color:#C06;''&raquo; &raquo;''@@{{blueLink{<<tiddler [[A Click Only Demo]]>>}}}
----
!!!!End of Tutorial

 @@color:#C06;''&raquo; &raquo;'' @@ ''To Get started:'' Click @@color:#C06;new tiddler@@ in the right sidebar. @@color:#C06;''&raquo; &raquo;'' @@ 
----
+++[+More Instructions]
<<tiddler Instructions>>
===
/***
|Name|TwHelpSearchPlugin|
|Source|http://twhelp.tiddlyspot.com/#TwHelpSearchPlugin|
|Documentation|http://twhelp.tiddlyspot.com/#TWHelpSearchDoc|
|Version|1.0.6|
|Author|Morris Gray|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.0 - 2.4|
|Type|plugin|
|Requires|[[SearchOptionsPlugin|http://www.TiddlyTools.com/#SearchOptionsPlugin]] [[TableSortingPlugin|http://tw.lewcid.org/#TableSortingPlugin]] (only for sorting option)|
|Overrides|SearchOptionsPlugin's search results|
|Description|Extends the search results from SearchOptionsPlugin to a sortable table showing title, size and tags.|
 ''Demo search:''
|>|>|>|<<search>> |
|>|>| look for in |>|>|>|
| <<option chkSearchTitles>> | <<option chkSearchText>> | <<option chkSearchTags>> | <<option chkHoldSearches>> |
| titles |  text  | tags | hold |

''A Plugin Tweak for:'' SearchOptionsPlugin
!!!!!Description
<<<
This plugin defines an alternative format for the SearchResults tiddler that is generated by the SearchOptionsPlugin . It presents the search results in tabular form numbering the rows; and showing the tiddler title, the size in bytes, and the tags.  It is ready to be used with the [[TableSortingPlugin|http://tw.lewcid.org/#TableSortingPlugin]] (check versions) so any column can be sorted; such as size in ascending or descending order.
<<<
!!!!!Installation
<<<
Import (or copy/paste) the following tiddlers into your ~TiddlyWiki:
* http://twhelp.tiddlyspot.com/#TwHelpSearchPlugin
*SearchOptionsPlugin from http://www.tiddlytools.com/#SearchOptionsPlugin
* Get more documentation here [[TWHelpSearchDoc]] or here:
* http://twhelp.tiddlyspot.com/#TwHelpSearchDoc
<<<
!!!!!Revision History
<<<
''2008.09.14  [1.0.6]'' 
Cosmetic - Add header.
''2007.09.12  [1.0.6]''
Added overflow scroll to TWHelp-SearchResults for long titles or tags.
''2006.02.03  [1.0.5]''
Added facility for holding the results of multiple searches with tick box on dashboard.
''2006.02.02  [1.0.4]''
Added several options, cleaned up design.Planning one version basic and one with added options this is the added options version.
''2006.01.27  [1.0.3''
Added a column for the size of the text in each tiddler, this does not include the size of the title or tags.  Added overall TW statistics button requires TiddlerStatsPlugin.
''2006.01.23 [1.0.2 ]''
''a)''Changed function reportSearchResults(text,matches) to  window.reportSearchResults=function(text,matches)
''b)''Added a line so that Incremental Search is automatically disabled config.options.chkSearchIncremental=false; turn off key-by-key searching
''c)''Removed space inside parens. bgcolor(#fe8 )" to "bgcolor(#fe8)".  This
is what was causing IE to 'crap out' halfway through drawing the table
headings.
''d)''Added {{{config.options.chkSearchList=true;}}}
''2006.01.20 [1.0.1]''
ELS: reportSearchResults() definition moved to this Plugin Tweak tiddler and removed extranous code
''2006.01.19 [1.0.0]''
This is an adaptation of Eric Shulman's SearchOptionsPlugin. Adapted by MorrisGray to provide search results in table form. All the necessary controls for refining the search is provided within the table including slide-down access to AdvancedOptions.
<<<
!!!!!Code
***/

//{{{
if (config.options.chkSinglePageMode==undefined) config.options.chkSinglePageMode=false;
if (config.options.chkRegExpSearch==undefined) config.options.chkRegExpSearch=true;
if (config.options.chkSearchTitles==undefined) config.options.chkSearchTitles=false;
if (config.options.chkSearchText==undefined) config.options.chkSearchText=true;
if (config.options.chkSearchTags==undefined) config.options.chkSearchTags=false;
if (config.options.chkSearchTitlesFirst==undefined) config.options.chkSearchTitlesFirst=true;
if (config.options.chkSearchList==undefined) config.options.chkSearchList=true;
if (config.options.chkSearchIncremental==undefined) config.options.chkSearchIncremental=false;
if (config.options.chkToggleLinks==true) config.options.chkToggleLinks=false;
if (config.options.chkHoldSearches==undefined) config.options.chkHoldSearches=false;
if (config.options.chkSortTags==undefined) config.options.chkSortTags=false;

config.options.chkToggleLinks=false;
config.options.chkSinglePageMode=false;
config.options.chkHoldSearches=false;
config.options.chkSearchIncremental=false;
config.options.chkHttpReadOnly = false;
config.options.chkRegExpSearch=true;
config.options.chkSearchList=true;
config.options.chkToggleLinks=false;

config.shadowTiddlers.AdvancedOptions += "\n<<option chkHoldSearches>> Hold search results";


//}}}

//{{{

// Give the report a custom name
config.macros.search.reportTitle="TWHelp-SearchResults";

// Override default SearchOptionsPlugin formatting for SearchResults tiddler
window.reportSearchResults=function(text,matches)

{
  
        var title=config.macros.search.reportTitle
	config.macros.search.reportTitle;
      	var q = config.options.chkRegExpSearch ? "/" : "'";
        if (!config.options.chkHoldSearches)  body=""; 
      
body+="\n|>|bgcolor(#8af):@@color(#000080):''"+config.macros.search.successMsg.format([matches.length,q+"{{{"+text+"}}}"+q])+"''@@|bgcolor(#8af):  @@color(#A00000): SearchHelp@@ "+"|"+"\n";
        body+="|>|>|bgcolor(#E3FFE3):<<search>> <<option chkSearchTitles>> Titles <<option chkSearchText>> Text <<option chkSearchTags>>Tags <<option chkHoldSearches>> Hold |"+"\n";
        body+="\n|bgcolor(#8af):&nbsp;|bgcolor(#8af): @@color(#000080):sort by: ''Titles''@@ |bgcolor(#8af): @@color(#000080): ''Size'' (bytes)@@ |bgcolor(#8af): @@color(#000080): ''Tags''@@ |h";
	for(var t=0;t<matches.length;t++) 
        body+="\n"+"| "+(t+1)+"|[["+matches[t].title+"]]| "+matches[t].text.length+"|"+"@@"+matches[t].tags+"@@"+"|";
         body+="\n";

      


        

        
       


	// create/update the tiddler
	var tiddler=store.getTiddler(title); if (!tiddler) tiddler=new Tiddler();
	tiddler.set(title,body,config.options.txtUserName,(new Date()),"excludeLists excludeSearch killbookmark");
	store.addTiddler(tiddler); story.closeTiddler(title);

	// render tiddler
	var oldprompt=config.macros.search.label;
	config.macros.search.label="search again"; // use alternate "search again" label
        story.displayTiddler(null,title,1); // force refresh
	config.macros.search.label=oldprompt;	// restore standard search label
}

//}}}
!!!<<gradient horiz #fc3 #fff>>&nbsp;URL_Encoding&nbsp;^^<<tiddler CloseThisOpen with: Entities-Codes  '« back'>>|<<toolbar editTiddler>>» ^^>>
{{borderless{
|vertical-align:bottom;<<toolbar fullscreen>><<toggleSideBar>>|<<tiddler NavButtons>>|vertical-align:bottom;Open in a new window&nbsp;[img[Open outside link in a new window|http://img229.imageshack.us/img229/1687/extlink7226466sx5.gif][http://www.flashbible.com/Members/Database/URL_Encoding.htm]]|
----
<html><div align="center"><iframe  src ="http://www.flashbible.com/Members/Database/URL_Encoding.htm" width="100%" align="center" height="600" scrolling="auto" frameborder="0" allowtransparency style="border:none;"></iframe></div></html>}}}
!!!<<gradient horiz #fc3 #fff>>&nbsp;UTF-8&nbsp;^^<<tiddler CloseThisOpen with: Entities-Codes  '« back'>>|<<toolbar editTiddler>>» ^^>>
{{borderless{
|vertical-align:bottom;<<toggleSideBar>>|<<tiddler NavButtons>>|vertical-align:bottom;[[Open in a new window|http://www.eki.ee/letter/chardata.cgi?HTML4=1]]&nbsp;&raquo;|
<html><div align="center"><iframe src ="http://www.eki.ee/letter/chardata.cgi?HTML4=1" width="100%" align="center" height="600"></iframe></div></html>}}}
{{textright{<<toggleSideBar "" "" hide>>}}}
{{smallform{<<miniBrowser noplayer http://www.unitconversion.org/ ConversionList>>}}}

<html><style>
#tiddlerUnitConversion {font-size:1.0em;}
</style></html>
http://www.unitconversion.org/unit_converter/length.html
http://www.unitconversion.org/unit_converter/weight.html
http://www.unitconversion.org/unit_converter/currency.html
http://www.unitconversion.org/unit_converter/volume.html
http://www.unitconversion.org/unit_converter/temperature.html
http://www.unitconversion.org/unit_converter/area.html
http://www.unitconversion.org/unit_converter/pressure.html
http://www.unitconversion.org/unit_converter/energy.html
http://www.unitconversion.org/unit_converter/power.html
http://www.unitconversion.org/unit_converter/force.html
http://www.unitconversion.org/unit_converter/time.html
http://www.unitconversion.org/unit_converter/velocity.html
http://www.unitconversion.org/unit_converter/angle.html
http://www.unitconversion.org/unit_converter/fuel-consumption.html
http://www.unitconversion.org/unit_converter/numbers.html
http://www.unitconversion.org/unit_converter/data-storage.html
http://www.unitconversion.org/unit_converter/velocity-angular.html
http://www.unitconversion.org/unit_converter/acceleration.html
http://www.unitconversion.org/unit_converter/density.html
http://www.unitconversion.org/unit_converter/specific-volume.html
http://www.unitconversion.org/unit_converter/moment-of-inertia.html
http://www.unitconversion.org/unit_converter/moment-of-force.html
http://www.unitconversion.org/unit_converter/torque.html
http://www.unitconversion.org/unit_converter/fuel-efficiency-mass.html
http://www.unitconversion.org/unit_converter/fuel-efficiency-volume.html
http://www.unitconversion.org/unit_converter/temperature-interval.html
http://www.unitconversion.org/unit_converter/thermal-expansion.html
http://www.unitconversion.org/unit_converter/thermal-resistance.html
http://www.unitconversion.org/unit_converter/thermal-conductivity.html
http://www.unitconversion.org/unit_converter/specific-heat-capacity.html
http://www.unitconversion.org/unit_converter/heat-density.html
http://www.unitconversion.org/unit_converter/heat-flux-density.html
http://www.unitconversion.org/unit_converter/heat-transfer-coefficient.html
http://www.unitconversion.org/unit_converter/flow.html
http://www.unitconversion.org/unit_converter/flow-mass.html
http://www.unitconversion.org/unit_converter/flow-molar.html
http://www.unitconversion.org/unit_converter/mass-flux-density.html
http://www.unitconversion.org/unit_converter/concentration-molar.html
http://www.unitconversion.org/unit_converter/concentration-solution.html
http://www.unitconversion.org/unit_converter/viscosity-dynamic.html
http://www.unitconversion.org/unit_converter/surface-tension.html
http://www.unitconversion.org/unit_converter/permeability.html
http://www.unitconversion.org/unit_converter/sound.html
http://www.unitconversion.org/unit_converter/luminance.html
http://www.unitconversion.org/unit_converter/luminous-intensity.html
http://www.unitconversion.org/unit_converter/illumination.html
http://www.unitconversion.org/unit_converter/digital-image-resolution.html
http://www.unitconversion.org/unit_converter/frequency-wavelength.html
http://www.unitconversion.org/unit_converter/charge.html
http://www.unitconversion.org/unit_converter/linear-charge-density.html
http://www.unitconversion.org/unit_converter/surface-charge-density.html
http://www.unitconversion.org/unit_converter/volume-charge-density.html
http://www.unitconversion.org/unit_converter/current.html
http://www.unitconversion.org/unit_converter/linear-current-density.html
http://www.unitconversion.org/unit_converter/surface-current-density.html
http://www.unitconversion.org/unit_converter/electric-field-strength.html
http://www.unitconversion.org/unit_converter/electric-potential.html
http://www.unitconversion.org/unit_converter/electric-resistance.html
http://www.unitconversion.org/unit_converter/electric-resistivity.html
http://www.unitconversion.org/unit_converter/electric-conductance.html
http://www.unitconversion.org/unit_converter/electric-conductivity.html
http://www.unitconversion.org/unit_converter/electrostatic-capacitance.html
http://www.unitconversion.org/unit_converter/inductance.html
http://www.unitconversion.org/unit_converter/magnetomotive-force.html
http://www.unitconversion.org/unit_converter/magnetic-field-strength.html
http://www.unitconversion.org/unit_converter/magnetic-flux.html
http://www.unitconversion.org/unit_converter/magnetic-flux-density.html
http://www.unitconversion.org/unit_converter/radiation.html
http://www.unitconversion.org/unit_converter/radiation-activity.html
http://www.unitconversion.org/unit_converter/radiation-exposure.html
http://www.unitconversion.org/unit_converter/radiation-absorbed-dose.html
http://www.unitconversion.org/unit_converter/prefixes.html
http://www.unitconversion.org/unit_converter/data-transfer.html
http://www.unitconversion.org/unit_converter/eu-currency.html
http://www.unitconversion.org/unit_converter/typography.html
http://www.unitconversion.org/unit_converter/volume-lumber.html
| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |
| 22/04/2009 01:01:12 | MsgRay | [[twmath.html|file:///F:/TiddlyWiki/TW%20Math/twmath.html]] | [[store.cgi|http://twmath.tiddlyspot.com/store.cgi]] | . | [[index.html | http://twmath.tiddlyspot.com/index.html]] | . | ok |
| 22/04/2009 01:48:27 | MsgRay | [[twmath.html|file:///F:/TiddlyWiki/TW%20Math/twmath.html]] | [[store.cgi|http://twmath.tiddlyspot.com/store.cgi]] | . | [[index.html | http://twmath.tiddlyspot.com/index.html]] | . | ok |
| 22/04/2009 01:51:16 | MsgRay | [[twmath.html|file:///F:/TiddlyWiki/TW%20Math/twmath.html]] | [[store.cgi|http://twmath.tiddlyspot.com/store.cgi]] | . | [[index.html | http://twmath.tiddlyspot.com/index.html]] | . | ok |
| 22/04/2009 03:14:42 | MsgRay | [[twmath.html|file:///F:/TiddlyWiki/TW%20Math/twmath.html]] | [[store.cgi|http://twmath.tiddlyspot.com/store.cgi]] | . | [[index.html | http://twmath.tiddlyspot.com/index.html]] | . | ok |
| 17/05/2009 07:45:11 | MsgRay | [[twmath.html|file:///F:/TiddlyWiki/TW%20Math/twmath.html]] | [[store.cgi|http://twmath.tiddlyspot.com/store.cgi]] | . | [[index.html | http://twmath.tiddlyspot.com/index.html]] | . | ok |
| 27/05/2009 09:39:37 | YourName | [[twmath.html|file:///F:/TiddlyWiki/TW%20Math/twmath.html]] | [[store.cgi|http://twmath.tiddlyspot.com/store.cgi]] | . | [[index.html | http://twmath.tiddlyspot.com/index.html]] | . |
| 03/05/2010 12:34:57 | YourName | [[/|http://twmath.tiddlyspot.com/]] | [[store.cgi|http://twmath.tiddlyspot.com/store.cgi]] | . | [[index.html | http://twmath.tiddlyspot.com/index.html]] | . |
| 15/10/2010 11:15:29 | YourName | [[twmath.html|file:///G:/Documents/TiddlyWiki/twmath.html]] | [[store.cgi|http://twmath.tiddlyspot.com/store.cgi]] | . | [[index.html | http://twmath.tiddlyspot.com/index.html]] | . | ok |
| 15/10/2010 11:36:00 | YourName | [[twmath.html|file:///G:/Documents/TiddlyWiki/twmath.html]] | [[store.cgi|http://twmath.tiddlyspot.com/store.cgi]] | . | [[index.html | http://twmath.tiddlyspot.com/index.html]] | . |
| 07/03/2012 02:38:43 | YourName | [[/|http://twmath.tiddlyspot.com/]] | [[store.cgi|http://twmath.tiddlyspot.com/store.cgi]] | . | [[index.html | http://twmath.tiddlyspot.com/index.html]] | . |
/***
|''Name:''|UploadPlugin|
|''Description:''|Save to web a TiddlyWiki|
|''Version:''|4.1.3|
|''Date:''|Feb 24, 2008|
|''Source:''|http://tiddlywiki.bidix.info/#UploadPlugin|
|''Documentation:''|http://tiddlywiki.bidix.info/#UploadPluginDoc|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0|
|''Requires:''|PasswordOptionPlugin|
***/
//{{{
version.extensions.UploadPlugin = {
	major: 4, minor: 1, revision: 3,
	date: new Date("Feb 24, 2008"),
	source: 'http://tiddlywiki.bidix.info/#UploadPlugin',
	author: 'BidiX (BidiX (at) bidix (dot) info',
	coreVersion: '2.2.0'
};

//
// Environment
//

if (!window.bidix) window.bidix = {}; // bidix namespace
bidix.debugMode = false;	// true to activate both in Plugin and UploadService
	
//
// Upload Macro
//

config.macros.upload = {
// default values
	defaultBackupDir: '',	//no backup
	defaultStoreScript: "store.php",
	defaultToFilename: "index.html",
	defaultUploadDir: ".",
	authenticateUser: true	// UploadService Authenticate User
};
	
config.macros.upload.label = {
	promptOption: "Save and Upload this TiddlyWiki with UploadOptions",
	promptParamMacro: "Save and Upload this TiddlyWiki in %0",
	saveLabel: "save to web", 
	saveToDisk: "save to disk",
	uploadLabel: "upload"	
};

config.macros.upload.messages = {
	noStoreUrl: "No store URL in parmeters or options",
	usernameOrPasswordMissing: "Username or password missing"
};

config.macros.upload.handler = function(place,macroName,params) {
	if (readOnly)
		return;
	var label;
	if (document.location.toString().substr(0,4) == "http") 
		label = this.label.saveLabel;
	else
		label = this.label.uploadLabel;
	var prompt;
	if (params[0]) {
		prompt = this.label.promptParamMacro.toString().format([this.destFile(params[0], 
			(params[1] ? params[1]:bidix.basename(window.location.toString())), params[3])]);
	} else {
		prompt = this.label.promptOption;
	}
	createTiddlyButton(place, label, prompt, function() {config.macros.upload.action(params);}, null, null, this.accessKey);
};

config.macros.upload.action = function(params)
{
		// for missing macro parameter set value from options
		if (!params) params = {};
		var storeUrl = params[0] ? params[0] : config.options.txtUploadStoreUrl;
		var toFilename = params[1] ? params[1] : config.options.txtUploadFilename;
		var backupDir = params[2] ? params[2] : config.options.txtUploadBackupDir;
		var uploadDir = params[3] ? params[3] : config.options.txtUploadDir;
		var username = params[4] ? params[4] : config.options.txtUploadUserName;
		var password = config.options.pasUploadPassword; // for security reason no password as macro parameter	
		// for still missing parameter set default value
		if ((!storeUrl) && (document.location.toString().substr(0,4) == "http")) 
			storeUrl = bidix.dirname(document.location.toString())+'/'+config.macros.upload.defaultStoreScript;
		if (storeUrl.substr(0,4) != "http")
			storeUrl = bidix.dirname(document.location.toString()) +'/'+ storeUrl;
		if (!toFilename)
			toFilename = bidix.basename(window.location.toString());
		if (!toFilename)
			toFilename = config.macros.upload.defaultToFilename;
		if (!uploadDir)
			uploadDir = config.macros.upload.defaultUploadDir;
		if (!backupDir)
			backupDir = config.macros.upload.defaultBackupDir;
		// report error if still missing
		if (!storeUrl) {
			alert(config.macros.upload.messages.noStoreUrl);
			clearMessage();
			return false;
		}
		if (config.macros.upload.authenticateUser && (!username || !password)) {
			alert(config.macros.upload.messages.usernameOrPasswordMissing);
			clearMessage();
			return false;
		}
		bidix.upload.uploadChanges(false,null,storeUrl, toFilename, uploadDir, backupDir, username, password); 
		return false; 
};

config.macros.upload.destFile = function(storeUrl, toFilename, uploadDir) 
{
	if (!storeUrl)
		return null;
		var dest = bidix.dirname(storeUrl);
		if (uploadDir && uploadDir != '.')
			dest = dest + '/' + uploadDir;
		dest = dest + '/' + toFilename;
	return dest;
};

//
// uploadOptions Macro
//

config.macros.uploadOptions = {
	handler: function(place,macroName,params) {
		var wizard = new Wizard();
		wizard.createWizard(place,this.wizardTitle);
		wizard.addStep(this.step1Title,this.step1Html);
		var markList = wizard.getElement("markList");
		var listWrapper = document.createElement("div");
		markList.parentNode.insertBefore(listWrapper,markList);
		wizard.setValue("listWrapper",listWrapper);
		this.refreshOptions(listWrapper,false);
		var uploadCaption;
		if (document.location.toString().substr(0,4) == "http") 
			uploadCaption = config.macros.upload.label.saveLabel;
		else
			uploadCaption = config.macros.upload.label.uploadLabel;
		
		wizard.setButtons([
				{caption: uploadCaption, tooltip: config.macros.upload.label.promptOption, 
					onClick: config.macros.upload.action},
				{caption: this.cancelButton, tooltip: this.cancelButtonPrompt, onClick: this.onCancel}
				
			]);
	},
	options: [
		"txtUploadUserName",
		"pasUploadPassword",
		"txtUploadStoreUrl",
		"txtUploadDir",
		"txtUploadFilename",
		"txtUploadBackupDir",
		"chkUploadLog",
		"txtUploadLogMaxLine"		
	],
	refreshOptions: function(listWrapper) {
		var opts = [];
		for(i=0; i<this.options.length; i++) {
			var opt = {};
			opts.push();
			opt.option = "";
			n = this.options[i];
			opt.name = n;
			opt.lowlight = !config.optionsDesc[n];
			opt.description = opt.lowlight ? this.unknownDescription : config.optionsDesc[n];
			opts.push(opt);
		}
		var listview = ListView.create(listWrapper,opts,this.listViewTemplate);
		for(n=0; n<opts.length; n++) {
			var type = opts[n].name.substr(0,3);
			var h = config.macros.option.types[type];
			if (h && h.create) {
				h.create(opts[n].colElements['option'],type,opts[n].name,opts[n].name,"no");
			}
		}
		
	},
	onCancel: function(e)
	{
		backstage.switchTab(null);
		return false;
	},
	
	wizardTitle: "Upload with options",
	step1Title: "These options are saved in cookies in your browser",
	step1Html: "<input type='hidden' name='markList'></input><br>",
	cancelButton: "Cancel",
	cancelButtonPrompt: "Cancel prompt",
	listViewTemplate: {
		columns: [
			{name: 'Description', field: 'description', title: "Description", type: 'WikiText'},
			{name: 'Option', field: 'option', title: "Option", type: 'String'},
			{name: 'Name', field: 'name', title: "Name", type: 'String'}
			],
		rowClasses: [
			{className: 'lowlight', field: 'lowlight'} 
			]}
};

//
// upload functions
//

if (!bidix.upload) bidix.upload = {};

if (!bidix.upload.messages) bidix.upload.messages = {
	//from saving
	invalidFileError: "The original file '%0' does not appear to be a valid TiddlyWiki",
	backupSaved: "Backup saved",
	backupFailed: "Failed to upload backup file",
	rssSaved: "RSS feed uploaded",
	rssFailed: "Failed to upload RSS feed file",
	emptySaved: "Empty template uploaded",
	emptyFailed: "Failed to upload empty template file",
	mainSaved: "Main TiddlyWiki file uploaded",
	mainFailed: "Failed to upload main TiddlyWiki file. Your changes have not been saved",
	//specific upload
	loadOriginalHttpPostError: "Can't get original file",
	aboutToSaveOnHttpPost: 'About to upload on %0 ...',
	storePhpNotFound: "The store script '%0' was not found."
};

bidix.upload.uploadChanges = function(onlyIfDirty,tiddlers,storeUrl,toFilename,uploadDir,backupDir,username,password)
{
	var callback = function(status,uploadParams,original,url,xhr) {
		if (!status) {
			displayMessage(bidix.upload.messages.loadOriginalHttpPostError);
			return;
		}
		if (bidix.debugMode) 
			alert(original.substr(0,500)+"\n...");
		// Locate the storeArea div's 
		var posDiv = locateStoreArea(original);
		if((posDiv[0] == -1) || (posDiv[1] == -1)) {
			alert(config.messages.invalidFileError.format([localPath]));
			return;
		}
		bidix.upload.uploadRss(uploadParams,original,posDiv);
	};
	
	if(onlyIfDirty && !store.isDirty())
		return;
	clearMessage();
	// save on localdisk ?
	if (document.location.toString().substr(0,4) == "file") {
		var path = document.location.toString();
		var localPath = getLocalPath(path);
		saveChanges();
	}
	// get original
	var uploadParams = new Array(storeUrl,toFilename,uploadDir,backupDir,username,password);
	var originalPath = document.location.toString();
	// If url is a directory : add index.html
	if (originalPath.charAt(originalPath.length-1) == "/")
		originalPath = originalPath + "index.html";
	var dest = config.macros.upload.destFile(storeUrl,toFilename,uploadDir);
	var log = new bidix.UploadLog();
	log.startUpload(storeUrl, dest, uploadDir,  backupDir);
	displayMessage(bidix.upload.messages.aboutToSaveOnHttpPost.format([dest]));
	if (bidix.debugMode) 
		alert("about to execute Http - GET on "+originalPath);
	var r = doHttp("GET",originalPath,null,null,username,password,callback,uploadParams,null);
	if (typeof r == "string")
		displayMessage(r);
	return r;
};

bidix.upload.uploadRss = function(uploadParams,original,posDiv) 
{
	var callback = function(status,params,responseText,url,xhr) {
		if(status) {
			var destfile = responseText.substring(responseText.indexOf("destfile:")+9,responseText.indexOf("\n", responseText.indexOf("destfile:")));
			displayMessage(bidix.upload.messages.rssSaved,bidix.dirname(url)+'/'+destfile);
			bidix.upload.uploadMain(params[0],params[1],params[2]);
		} else {
			displayMessage(bidix.upload.messages.rssFailed);			
		}
	};
	// do uploadRss
	if(config.options.chkGenerateAnRssFeed) {
		var rssPath = uploadParams[1].substr(0,uploadParams[1].lastIndexOf(".")) + ".xml";
		var rssUploadParams = new Array(uploadParams[0],rssPath,uploadParams[2],'',uploadParams[4],uploadParams[5]);
		var rssString = generateRss();
		// no UnicodeToUTF8 conversion needed when location is "file" !!!
		if (document.location.toString().substr(0,4) != "file")
			rssString = convertUnicodeToUTF8(rssString);	
		bidix.upload.httpUpload(rssUploadParams,rssString,callback,Array(uploadParams,original,posDiv));
	} else {
		bidix.upload.uploadMain(uploadParams,original,posDiv);
	}
};

bidix.upload.uploadMain = function(uploadParams,original,posDiv) 
{
	var callback = function(status,params,responseText,url,xhr) {
		var log = new bidix.UploadLog();
		if(status) {
			// if backupDir specified
			if ((params[3]) && (responseText.indexOf("backupfile:") > -1))  {
				var backupfile = responseText.substring(responseText.indexOf("backupfile:")+11,responseText.indexOf("\n", responseText.indexOf("backupfile:")));
				displayMessage(bidix.upload.messages.backupSaved,bidix.dirname(url)+'/'+backupfile);
			}
			var destfile = responseText.substring(responseText.indexOf("destfile:")+9,responseText.indexOf("\n", responseText.indexOf("destfile:")));
			displayMessage(bidix.upload.messages.mainSaved,bidix.dirname(url)+'/'+destfile);
			store.setDirty(false);
			log.endUpload("ok");
		} else {
			alert(bidix.upload.messages.mainFailed);
			displayMessage(bidix.upload.messages.mainFailed);
			log.endUpload("failed");			
		}
	};
	// do uploadMain
	var revised = bidix.upload.updateOriginal(original,posDiv);
	bidix.upload.httpUpload(uploadParams,revised,callback,uploadParams);
};

bidix.upload.httpUpload = function(uploadParams,data,callback,params)
{
	var localCallback = function(status,params,responseText,url,xhr) {
		url = (url.indexOf("nocache=") < 0 ? url : url.substring(0,url.indexOf("nocache=")-1));
		if (xhr.status == 404)
			alert(bidix.upload.messages.storePhpNotFound.format([url]));
		if ((bidix.debugMode) || (responseText.indexOf("Debug mode") >= 0 )) {
			alert(responseText);
			if (responseText.indexOf("Debug mode") >= 0 )
				responseText = responseText.substring(responseText.indexOf("\n\n")+2);
		} else if (responseText.charAt(0) != '0') 
			alert(responseText);
		if (responseText.charAt(0) != '0')
			status = null;
		callback(status,params,responseText,url,xhr);
	};
	// do httpUpload
	var boundary = "---------------------------"+"AaB03x";	
	var uploadFormName = "UploadPlugin";
	// compose headers data
	var sheader = "";
	sheader += "--" + boundary + "\r\nContent-disposition: form-data; name=\"";
	sheader += uploadFormName +"\"\r\n\r\n";
	sheader += "backupDir="+uploadParams[3] +
				";user=" + uploadParams[4] +
				";password=" + uploadParams[5] +
				";uploaddir=" + uploadParams[2];
	if (bidix.debugMode)
		sheader += ";debug=1";
	sheader += ";;\r\n"; 
	sheader += "\r\n" + "--" + boundary + "\r\n";
	sheader += "Content-disposition: form-data; name=\"userfile\"; filename=\""+uploadParams[1]+"\"\r\n";
	sheader += "Content-Type: text/html;charset=UTF-8" + "\r\n";
	sheader += "Content-Length: " + data.length + "\r\n\r\n";
	// compose trailer data
	var strailer = new String();
	strailer = "\r\n--" + boundary + "--\r\n";
	data = sheader + data + strailer;
	if (bidix.debugMode) alert("about to execute Http - POST on "+uploadParams[0]+"\n with \n"+data.substr(0,500)+ " ... ");
	var r = doHttp("POST",uploadParams[0],data,"multipart/form-data; ;charset=UTF-8; boundary="+boundary,uploadParams[4],uploadParams[5],localCallback,params,null);
	if (typeof r == "string")
		displayMessage(r);
	return r;
};

// same as Saving's updateOriginal but without convertUnicodeToUTF8 calls
bidix.upload.updateOriginal = function(original, posDiv)
{
	if (!posDiv)
		posDiv = locateStoreArea(original);
	if((posDiv[0] == -1) || (posDiv[1] == -1)) {
		alert(config.messages.invalidFileError.format([localPath]));
		return;
	}
	var revised = original.substr(0,posDiv[0] + startSaveArea.length) + "\n" +
				store.allTiddlersAsHtml() + "\n" +
				original.substr(posDiv[1]);
	var newSiteTitle = getPageTitle().htmlEncode();
	revised = revised.replaceChunk("<title"+">","</title"+">"," " + newSiteTitle + " ");
	revised = updateMarkupBlock(revised,"PRE-HEAD","MarkupPreHead");
	revised = updateMarkupBlock(revised,"POST-HEAD","MarkupPostHead");
	revised = updateMarkupBlock(revised,"PRE-BODY","MarkupPreBody");
	revised = updateMarkupBlock(revised,"POST-SCRIPT","MarkupPostBody");
	return revised;
};

//
// UploadLog
// 
// config.options.chkUploadLog :
//		false : no logging
//		true : logging
// config.options.txtUploadLogMaxLine :
//		-1 : no limit
//      0 :  no Log lines but UploadLog is still in place
//		n :  the last n lines are only kept
//		NaN : no limit (-1)

bidix.UploadLog = function() {
	if (!config.options.chkUploadLog) 
		return; // this.tiddler = null
	this.tiddler = store.getTiddler("UploadLog");
	if (!this.tiddler) {
		this.tiddler = new Tiddler();
		this.tiddler.title = "UploadLog";
		this.tiddler.text = "| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |";
		this.tiddler.created = new Date();
		this.tiddler.modifier = config.options.txtUserName;
		this.tiddler.modified = new Date();
		store.addTiddler(this.tiddler);
	}
	return this;
};

bidix.UploadLog.prototype.addText = function(text) {
	if (!this.tiddler)
		return;
	// retrieve maxLine when we need it
	var maxLine = parseInt(config.options.txtUploadLogMaxLine,10);
	if (isNaN(maxLine))
		maxLine = -1;
	// add text
	if (maxLine != 0) 
		this.tiddler.text = this.tiddler.text + text;
	// Trunck to maxLine
	if (maxLine >= 0) {
		var textArray = this.tiddler.text.split('\n');
		if (textArray.length > maxLine + 1)
			textArray.splice(1,textArray.length-1-maxLine);
			this.tiddler.text = textArray.join('\n');		
	}
	// update tiddler fields
	this.tiddler.modifier = config.options.txtUserName;
	this.tiddler.modified = new Date();
	store.addTiddler(this.tiddler);
	// refresh and notifiy for immediate update
	story.refreshTiddler(this.tiddler.title);
	store.notify(this.tiddler.title, true);
};

bidix.UploadLog.prototype.startUpload = function(storeUrl, toFilename, uploadDir,  backupDir) {
	if (!this.tiddler)
		return;
	var now = new Date();
	var text = "\n| ";
	var filename = bidix.basename(document.location.toString());
	if (!filename) filename = '/';
	text += now.formatString("0DD/0MM/YYYY 0hh:0mm:0ss") +" | ";
	text += config.options.txtUserName + " | ";
	text += "[["+filename+"|"+location + "]] |";
	text += " [[" + bidix.basename(storeUrl) + "|" + storeUrl + "]] | ";
	text += uploadDir + " | ";
	text += "[[" + bidix.basename(toFilename) + " | " +toFilename + "]] | ";
	text += backupDir + " |";
	this.addText(text);
};

bidix.UploadLog.prototype.endUpload = function(status) {
	if (!this.tiddler)
		return;
	this.addText(" "+status+" |");
};

//
// Utilities
// 

bidix.checkPlugin = function(plugin, major, minor, revision) {
	var ext = version.extensions[plugin];
	if (!
		(ext  && 
			((ext.major > major) || 
			((ext.major == major) && (ext.minor > minor))  ||
			((ext.major == major) && (ext.minor == minor) && (ext.revision >= revision))))) {
			// write error in PluginManager
			if (pluginInfo)
				pluginInfo.log.push("Requires " + plugin + " " + major + "." + minor + "." + revision);
			eval(plugin); // generate an error : "Error: ReferenceError: xxxx is not defined"
	}
};

bidix.dirname = function(filePath) {
	if (!filePath) 
		return;
	var lastpos;
	if ((lastpos = filePath.lastIndexOf("/")) != -1) {
		return filePath.substring(0, lastpos);
	} else {
		return filePath.substring(0, filePath.lastIndexOf("\\"));
	}
};

bidix.basename = function(filePath) {
	if (!filePath) 
		return;
	var lastpos;
	if ((lastpos = filePath.lastIndexOf("#")) != -1) 
		filePath = filePath.substring(0, lastpos);
	if ((lastpos = filePath.lastIndexOf("/")) != -1) {
		return filePath.substring(lastpos + 1);
	} else
		return filePath.substring(filePath.lastIndexOf("\\")+1);
};

bidix.initOption = function(name,value) {
	if (!config.options[name])
		config.options[name] = value;
};

//
// Initializations
//

// require PasswordOptionPlugin 1.0.1 or better
bidix.checkPlugin("PasswordOptionPlugin", 1, 0, 1);

// styleSheet
setStylesheet('.txtUploadStoreUrl, .txtUploadBackupDir, .txtUploadDir {width: 22em;}',"uploadPluginStyles");

//optionsDesc
merge(config.optionsDesc,{
	txtUploadStoreUrl: "Url of the UploadService script (default: store.php)",
	txtUploadFilename: "Filename of the uploaded file (default: in index.html)",
	txtUploadDir: "Relative Directory where to store the file (default: . (downloadService directory))",
	txtUploadBackupDir: "Relative Directory where to backup the file. If empty no backup. (default: ''(empty))",
	txtUploadUserName: "Upload Username",
	pasUploadPassword: "Upload Password",
	chkUploadLog: "do Logging in UploadLog (default: true)",
	txtUploadLogMaxLine: "Maximum of lines in UploadLog (default: 10)"
});

// Options Initializations
bidix.initOption('txtUploadStoreUrl','');
bidix.initOption('txtUploadFilename','');
bidix.initOption('txtUploadDir','');
bidix.initOption('txtUploadBackupDir','');
bidix.initOption('txtUploadUserName','');
bidix.initOption('pasUploadPassword','');
bidix.initOption('chkUploadLog',true);
bidix.initOption('txtUploadLogMaxLine','10');


// Backstage
merge(config.tasks,{
	uploadOptions: {text: "upload", tooltip: "Change UploadOptions and Upload", content: '<<uploadOptions>>'}
});
config.backstageTasks.push("uploadOptions");


//}}}

<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'><span macro='publishTiddler'></span></div>
<div class='title' macro='view title'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->
.viewer .tabSelected {

        background:url("navbarredlt5.gif") repeat-x top left;top left;
        background-color:#fcb;
        font-size:0.95em;
        font-weight:bold;
        color:#a00;
	text-decoration:none;
        border: 0px solid #999;      
}



        .viewer .tabUnselected {
        background:url("navbargrayhw1.jpg") repeat-x top left;top left;
        background-color:#eee;
        font-size:0.95em;
        font-weight:bold;
	color:#006;
        text-decoration:none;
        border: 0px solid #999; 

}
config.options.chkSearchIncremental=false;
config.options.chkIncrementalSearch=false;
{{borderless{
|vertical-align:bottom;<<toolbar fullscreen>><<toggleSideBar>>|<<tiddler NavButtons>>|vertical-align:bottom;Open in a new window[img[Open outside link in a new window|http://img229.imageshack.us/img229/1687/extlink7226466sx5.gif][http://www1.chapman.edu/~jipsen/mathml/asciimathcalculator.html]]|
----
<html><div align="center"><iframe  src ="http://www1.chapman.edu/~jipsen/mathml/asciimathcalculator.html" width="100%" align="center" height="600" scrolling="auto" frameborder="0" allowtransparency style="border:none;"></iframe></div></html>}}}
config.shadowTiddlers.MyQuickEdit_equation = "<html><a href="javascript:;" class="tiddlyLink" onclick="config.quickEdit.id='eqntarget'; OpenLatexEditor('eqntarget','tw',''); ">equation</a></html>"
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div style="align:center;" macro='showWhen tiddler.tags.contains("demo") || tiddler.title =="ADemoEquation"'>[[LaunchEditorDemo]]</div><br><center><span macro='tiddler QuickEdit_Demo1'></span>&nbsp;|&nbsp;<span macro='tiddler QuickEdit_Demo2'></span>&nbsp;|&nbsp;<span macro='tiddler QuickEdit_Demo3'></span>&nbsp;|&nbsp;<span macro='tiddler QuickEdit_Demo4'></span>&nbsp;|&nbsp;<span macro='tiddler QuickEdit_Demo5'></span></center></div>


<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser'></span></div>
<!--}}}-->
config.tasks.viewTabs = {
	text: "editA",
	tooltip: "A custom backstage tab",
	content: "|width:18em;<<tiddler EditATiddler>>|"
};
config.backstageTasks.splice(config.backstageTasks.indexOf("save")+0,0,"viewTabs");
For tw editor inline ticked use OpenLatexEditor('eqntarget','tw','',true,'');
| source file:|{{{F:\TiddlyWiki2.4\TWMath\leftbackdo6.gif}}}|
| attached on:|22 December 2008 by MsgRay|
| embedded:|[[leftbackdo6.gif|leftbackdo6.gif]] - {{{type=image/gif, size=64 bytes, encoded=89 bytes}}}|
| local file:|/%LOCAL_LINK%/[[./leftbackdo6.gif|./leftbackdo6.gif]]|
| remote link:|//none//|
image
<<<
usage: {{{[img[tooltip|leftbackdo6.gif]] or [img[tooltip|leftbackdo6.gif][link]]}}}
[img[tooltip|leftbackdo6.gif]]
<<<

/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/gif;base64,
R0lGODlhbgACAIAAAHKOqgAzZiH5BAAAAAAALAAAAABuAAIAAAIXDIynyesNn4x0
2lqB3rz7D4biSJZmVwAAOw==
---END_DATA---
%/
| source file:|{{{F:\TiddlyWiki2.4\TWMath\navbargrayhw1.jpg}}}|
| attached on:|22 December 2008 by MsgRay|
| embedded:|[[navbargrayhw1.jpg|navbargrayhw1.jpg]] - {{{type=image/jpeg, size=689 bytes, encoded=934 bytes}}}|
| local file:|/%LOCAL_LINK%/[[./navbargrayhw1.jpg|./navbargrayhw1.jpg]]|
| remote link:|//none//|
image
<<<
usage: {{{[img[tooltip|navbargrayhw1.jpg]] or [img[tooltip|navbargrayhw1.jpg][link]]}}}
[img[tooltip|navbargrayhw1.jpg]]
<<<

/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/jpeg;base64,
/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8L
CwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQUF
BQcGBw4ICA4eFBEUHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4e
Hh4eHh4eHh4eHh4eHh7/wAARCAA8AAoDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEA
AAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIh
MUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6
Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZ
mqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx
8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREA
AgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAV
YnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hp
anN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPE
xcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD3
37cP+gZY/wDflf8ACj7cP+gZY/8Aflf8KvfYf9mj7D/s1vdGZ032P2o+x+1X80ua
yuUJRTsUYpAOxRinUUhn/9k=
---END_DATA---
%/
| source file:|{{{F:\TiddlyWiki2.4\TWMath\navbarredlt5.jpg}}}|
| attached on:|22 December 2008 by MsgRay|
| embedded:|[[navbarredlt5.jpg|navbarredlt5.jpg]] - {{{type=image/jpeg, size=718 bytes, encoded=975 bytes}}}|
| local file:|/%LOCAL_LINK%/[[./navbarredlt5.jpg|./navbarredlt5.jpg]]|
| remote link:|//none//|
image
<<<
usage: {{{[img[tooltip|navbarredlt5.jpg]] or [img[tooltip|navbarredlt5.jpg][link]]}}}
[img[tooltip|navbarredlt5.jpg]]
<<<

/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/jpeg;base64,
/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8L
CwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQUF
BQcGBw4ICA4eFBEUHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4e
Hh4eHh4eHh4eHh4eHh7/wAARCAA8AAoDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEA
AAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIh
MUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6
Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZ
mqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx
8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREA
AgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAV
YnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hp
anN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPE
xcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD6
X+0j/n0t/wDv0P8ACk+1L/z6W3/fsf4VZNsfSjyCONv61jqfR89PsbX2celHkH0H
+fxqzmitDxvaSCinY46UfN2XP/AaDO47FG1e5UUp/mT/ADprNhiNq9fSmQf/2Q==

---END_DATA---
%/

| source file:|{{{F:\TiddlyWiki2.4\TWMath\redbanneryd3.jpg}}}|
| attached on:|22 December 2008 by MsgRay|
| embedded:|[[redbanneryd3.jpg|redbanneryd3.jpg]] - {{{type=image/jpeg, size=717 bytes, encoded=970 bytes}}}|
| local file:|/%LOCAL_LINK%/[[./redbanneryd3.jpg|./redbanneryd3.jpg]]|
| remote link:|//none//|
image
<<<
usage: {{{[img[tooltip|redbanneryd3.jpg]] or [img[tooltip|redbanneryd3.jpg][link]]}}}
[img[tooltip|redbanneryd3.jpg]]
<<<

/% DO NOT EDIT BELOW THIS POINT
---BEGIN_DATA---
image/jpeg;base64,
/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8L
CwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQUF
BQcGBw4ICA4eFBEUHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4e
Hh4eHh4eHh4eHh4eHh7/wAARCAAeAAoDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEA
AAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIh
MUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6
Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZ
mqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx
8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREA
AgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAV
YnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hp
anN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPE
xcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDx
r+29M/6A0H5Uh1rTc/8AIHgH4VCNMb/nkf8Avk03+zG/55H8jXHzH659XX8q+5Ho
f9jf7HvQdGOeFH5Gj/hZuk/9AW4/76Wj/hZuk/8AQFuP++lq/ZeZ1e2XY//Z
---END_DATA---
%/