Distorted Reality is loading ...

Requires Javascript.
Distorted Reality - it ain't real...but it is a learning experience
<!--{{{-->
<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]];}

#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; 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 closeTiddler closeOthers +editTiddler > fields syncing permalink references jump'></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 +saveTiddler -cancelTiddler deleteTiddler'></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'></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>>
|''Type:''|file|
|''URL:''|http://distortedreality.tiddlyspot.com/|
|''Workspace:''|(default)|

This tiddler was automatically created to record the details of this server
<<<
//Truth is not what you seek, it is what you find.//
//What you find, is not what you were looking for.//
<<<

That being said,
<<<
//If what you find is not what you were seeking...
If you are unsatisfied with the truth you find...
Remember that it requires a change in perception...
To understand that you did indeed find what you were looking for...
You just did not realize what it was you were really wanting to find.//
<<<
<<search>><<closeAll>><<permaview>><<newTiddler>><<newJournal 'DD MMM YYYY'>><<saveChanges>><<tiddler TspotSidebar>><<slider chkSliderOptionsPanel OptionsPanel 'options »' 'Change TiddlyWiki advanced options'>>
everything in our world is just an approximation of perfection
I think we all are, when we remain silent, and not say anything. When we tell people their behavior is ok. When we let our friends and family continue destructive patterns of behavior.<br /><br />I have to admit, as much as I don't want to, that I am a passive enabler.<br /><br />To everyone, examine your lives, see where you are enabling, and turn that around into a push for growth.
/***
|Name|AutoOpenTiddlersPlugin|
|Created by|SaqImtiaz|
|Location|http://lewcid.googlepages.com/lewcid.html#AutoOpenTiddlersPlugin|
|Version|0.21|
|Requires|~TW2.x|
!!!Description:
Open a user defined number of recent tiddlers automatically when the TW loads.
You can also specify a tag and only load tiddlers that have that tag.
To change the number of tiddlers automatically opened, or define a tag to use, ed the config.autoOpenTiddlers part of the code below.

!!!To Do
*add an option to exclude tiddlers with a particular tag

!!!Code
***/
//{{{
//edit this section to change the default settings
config.autoOpenTiddlers = 
{
 count: 5, //number of tiddlers opened.
 tag: 'DefaultTiddlers' //change if you want to open tiddlers with a specific tag, eg: 'DefaultTiddlers'
}


config.autoOpenTiddlers.handler = function()
{
 if (this.tag == undefined)
 var newTiddlers = store.getTiddlers("modified");
 else
 var newTiddlers = store.getTaggedTiddlers(this.tag,"modified");
 var newTiddlers = newTiddlers.reverse();
 var max = Math.min(this.count,newTiddlers.length-1);
 for (var i=max; i>=0; i--)
 { story.displayTiddler(null,newTiddlers[i].title);} 
}

window.old_lewcid_autoOpenTiddlers_restart = restart;
restart = function ()
{
 window.old_lewcid_autoOpenTiddlers_restart();
 config.autoOpenTiddlers.handler();
}
//}}}
Always remember where you come from...it is where YOU began...everything you are, started there.<br /><br />You cannot "earn" it...you cannot "find" it...you cannot "BUY" it...happiness is a choice.
/***
|Name|BetterTimelineMacro|
|Created by|SaqImtiaz|
|Location|http://lewcid.googlepages.com/lewcid.html#BetterTimelineMacro|
|Version|0.5 beta|
|Requires|~TW2.x|
!!!Description:
A replacement for the core timeline macro that offers more features:
*list tiddlers with only specfic tag
*exclude tiddlers with a particular tag
*limit entries to any number of days, for example one week
*specify a start date for the timeline, only tiddlers after that date will be listed.

!!!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.

!!!Syntax:
{{{<<timeline better:true>>}}}
''the param better:true enables the advanced features, without it you will get the old timeline behaviour.''

additonal params:
(use only the ones you want)
{{{<<timeline better:true onlyTag:Tag1 excludeTag:Tag2 sortBy:modified/created firstDay:YYYYMMDD maxDays:7 maxEntries:30>>}}}

''explanation of syntax:''
onlyTag: only tiddlers with this tag will be listed. Default is to list all tiddlers.
excludeTag: tiddlers with this tag will not be listed.
sortBy: sort tiddlers by date modified or date created. Possible values are modified or created.
firstDay: useful for starting timeline from a specific date. Example: 20060701 for 1st of July, 2006
maxDays: limits timeline to include only tiddlers from the specified number of days. If you use a value of 7 for example, only tiddlers from the last 7 days will be listed.
maxEntries: limit the total number of entries in the timeline.


!!!History:
*28-07-06: ver 0.5 beta, first release

!!!Code
***/
//{{{
// Return the tiddlers as a sorted array
TiddlyWiki.prototype.getTiddlers = function(field,excludeTag,includeTag)
{
 var results = [];
 this.forEachTiddler(function(title,tiddler)
 {
 if(excludeTag == undefined || tiddler.tags.find(excludeTag) == null)
 if(includeTag == undefined || tiddler.tags.find(includeTag)!=null)
 results.push(tiddler);
 });
 if(field)
 results.sort(function (a,b) {if(a[field] == b[field]) return(0); else return (a[field] < b[field]) ? -1 : +1; });
 return results;
}



//this function by Udo
function getParam(params, name, defaultValue)
{
 if (!params)
 return defaultValue;
 var p = params[0][name];
 return p ? p[0] : defaultValue;
}

window.old_timeline_handler= config.macros.timeline.handler;
config.macros.timeline.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
 var args = paramString.parseParams("list",null,true);
 var betterMode = getParam(args, "better", "false");
 if (betterMode == 'true')
 {
 var sortBy = getParam(args,"sortBy","modified");
 var excludeTag = getParam(args,"excludeTag",undefined);
 var includeTag = getParam(args,"onlyTag",undefined);
 var tiddlers = store.getTiddlers(sortBy,excludeTag,includeTag);
 var firstDayParam = getParam(args,"firstDay",undefined);
 var firstDay = (firstDayParam!=undefined)? firstDayParam: "00010101";
 var lastDay = "";
 var field= sortBy;
 var maxDaysParam = getParam(args,"maxDays",undefined);
 var maxDays = (maxDaysParam!=undefined)? maxDaysParam*24*60*60*1000: (new Date()).getTime() ;
 var maxEntries = getParam(args,"maxEntries",undefined);
 var last = (maxEntries!=undefined) ? tiddlers.length-Math.min(tiddlers.length,parseInt(maxEntries)) : 0;
 for(var t=tiddlers.length-1; t>=last; t--)
 {
 var tiddler = tiddlers[t];
 var theDay = tiddler[field].convertToLocalYYYYMMDDHHMM().substr(0,8);
 if ((theDay>=firstDay)&& (tiddler[field].getTime()> (new Date()).getTime() - maxDays))
 {
 if(theDay != lastDay)
 {
 var theDateList = document.createElement("ul");
 place.appendChild(theDateList);
 createTiddlyElement(theDateList,"li",null,"listTitle",tiddler[field].formatString(this.dateFormat));
 lastDay = theDay;
 }
 var theDateListItem = createTiddlyElement(theDateList,"li",null,"listLink",null);
 theDateListItem.appendChild(createTiddlyLink(place,tiddler.title,true));
 }
 }
 }

 else
 {
 window.old_timeline_handler.apply(this,arguments);
 }
}
//}}}
/***
|''Name:''|BreadCrumbsPlugin|
|''Version:''|2.0.10 (28-Apr-2006)|
|''Author:''|AlanHecht|
|''Adapted By:''|[[Jack]]|
|''Type:''|Plugin|
!Description
This plugin creates an area at the top of the tiddler area that displays "breadcrumbs" of where you've been. This is especially useful for ~TWs using ~SinglePageMode by Eric Schulman.
!Usage
Just install the plugin and tag with systemConfig. Optionally position the following div in your PageTemplate to control the positioning of the breadcrumbs menu:
{{{
<div id='breadCrumbs'></div>
}}}
!Revision History
* Original by AlanHecht
* 2.0 Made 2.0.x compatible by [[Jack]]
* Made 2.0.10 compatible (onstart paramifier)
!Code
***/

// // Use the following line to set the number of breadcrumbs to display before rotating them off the list.
//{{{
version.extensions.breadCrumbs = {major: 2, minor: 0, revision: 10, date: new Date("Apr 28, 2006")};
var crumbsToShow = 7;
var breadCrumbs = [];

var onClickTiddlerLink_orig_breadCrumbs = onClickTiddlerLink;
onClickTiddlerLink = function(e){
 onClickTiddlerLink_orig_breadCrumbs(e);
 breadcrumbsAdd(e);
}

var restart_orig_breadCrumbs = restart;
restart = function() {
 restart_orig_breadCrumbs()
 breadCrumbs = [];
 breadcrumbsRefresh();
}

function breadcrumbsAdd(e) {
 var uniqueCrumb = true;
 var crumbIndex = 0;
 if (!e) var e = window.event;
 var target = resolveTarget(e);
 var thisCrumb="[["+resolveTarget(e).getAttribute("tiddlyLink")+"]]";
 var lastInactiveCrumb = breadCrumbs.length -(breadCrumbs.length < crumbsToShow ? breadCrumbs.length : crumbsToShow);
 for(t=lastInactiveCrumb; t<breadCrumbs.length; t++)
 if(breadCrumbs[t] == thisCrumb) {
 uniqueCrumb = false;
 crumbIndex = t+1;
 }
 if(uniqueCrumb)
 breadCrumbs.push(thisCrumb);
 else
 breadCrumbs = breadCrumbs.slice(0,crumbIndex);
 breadcrumbsRefresh(); 
}

function breadcrumbsRefresh() {
 
 if (!document.getElementById("breadCrumbs")) {
 // Create breadCrumbs div
 var ca = document.createElement("div");
 ca.id = "breadCrumbs";
 ca.style.visibility= "hidden";
 var targetArea = document.getElementById("tiddlerDisplay");
 targetArea.parentNode.insertBefore(ca,targetArea);
 }

 var crumbArea = document.getElementById("breadCrumbs");
 crumbArea.style.visibility = "visible";
 removeChildren(crumbArea);
 createTiddlyButton(crumbArea,"Home",null,restart);
// crumbArea.appendChild(document.createTextNode(" > "));
 
 var crumbLine = "";
 var crumbCount = breadCrumbs.length;
 var firstCrumb = crumbCount -(crumbCount < crumbsToShow ? crumbCount : crumbsToShow);
 for(t=firstCrumb; t<crumbCount; t++) {
 crumbLine += " > ";
 crumbLine += breadCrumbs[t];
 }
 wikify(crumbLine,crumbArea)
}


//}}}
Choice.  A simple choice changes small things.  A simple choice changes large things.  It always starts with a choice.

Yet...we all ask...//why//?

Why did this happen?  Why me?  Why does it always happen to me?

You...made a choice at some time.  You made many choices.  Some were good, some were bad.  Some good choices led to bad things, other bad choices led to good things.

Don't confuse bad judgment with a bad choice.  Don't confuse luck with a good choice.  The mix isn't what matters.

It is the lesson learned.
I used to say that "I don't care, it doesn't affect me in ways that are meaningful" or "It doesn't matter".  I often tried to articulate what this means to people, as I try to help them find the center they can journey through their lives.  This has proven to be difficult.  Frustratingly so.

Recently, I had a thought, an epiphany.  It finally crystallized and quantified the quality I've been trying to communicate.  It is simply, //''choose how to react''//.

We all have situations in life that we dislike, that are frustrating or downright hellish.  Our jobs, the people we work with, the traffic, the government...all of these situations can and usually are stressful.  What makes them stressful?  The fact that we let them stress us...our chosen reaction to those elements is stress.

What if we choose to react differently?  What if we choose to react positively or neutrally instead of negatively?  No...no, it isn't easy.  It takes conscious effort...but the effort is worth it to the general well being of all of us. 

Choose how to react.  It makes a difference.
/***
| Name:|CloseOnCancelPlugin|
| Description:|Closes the tiddler if you click new tiddler then cancel. Default behaviour is to leave it open|
| Version:|6.9.3|
| Date:|30-Sep-2006|
| Source:|http://mptw.tiddlyspot.com/#CloseOnCancelPlugin|
| Author:|Simon Baird <simon.baird@gmail.com>|
| CoreVersion:|2.1.x|
***/
//{{{
merge(config.commands.cancelTiddler,{

 handler_orig_closeUnsaved: config.commands.cancelTiddler.handler,

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

});

//}}}

config.options.chkHttpReadOnly = false;
//{{{
config.options.chkHttpReadOnly = false; // means web visitors can experiment with your site by clicking edit
config.options.chkInsertTabs = true;    // tab inserts a tab when editing a tiddler
config.views.wikified.defaultText = ""; // don't need message when a tiddler doesn't exist
config.views.editor.defaultText = "";   // don't need message when creating a new tiddler 
//}}}
/***
|''Name:''|CryptoFunctionsPlugin|
|''Description:''|Support for cryptographic functions|
***/
//{{{
if(!version.extensions.CryptoFunctionsPlugin) {
version.extensions.CryptoFunctionsPlugin = {installed:true};

//--
//-- Crypto functions and associated conversion routines
//--

// Crypto "namespace"
function Crypto() {}

// Convert a string to an array of big-endian 32-bit words
Crypto.strToBe32s = function(str)
{
	var be = Array();
	var len = Math.floor(str.length/4);
	var i, j;
	for(i=0, j=0; i<len; i++, j+=4) {
		be[i] = ((str.charCodeAt(j)&0xff) << 24)|((str.charCodeAt(j+1)&0xff) << 16)|((str.charCodeAt(j+2)&0xff) << 8)|(str.charCodeAt(j+3)&0xff);
	}
	while (j<str.length) {
		be[j>>2] |= (str.charCodeAt(j)&0xff)<<(24-(j*8)%32);
		j++;
	}
	return be;
};

// Convert an array of big-endian 32-bit words to a string
Crypto.be32sToStr = function(be)
{
	var str = "";
	for(var i=0;i<be.length*32;i+=8)
		str += String.fromCharCode((be[i>>5]>>>(24-i%32)) & 0xff);
	return str;
};

// Convert an array of big-endian 32-bit words to a hex string
Crypto.be32sToHex = function(be)
{
	var hex = "0123456789ABCDEF";
	var str = "";
	for(var i=0;i<be.length*4;i++)
		str += hex.charAt((be[i>>2]>>((3-i%4)*8+4))&0xF) + hex.charAt((be[i>>2]>>((3-i%4)*8))&0xF);
	return str;
};

// Return, in hex, the SHA-1 hash of a string
Crypto.hexSha1Str = function(str)
{
	return Crypto.be32sToHex(Crypto.sha1Str(str));
};

// Return the SHA-1 hash of a string
Crypto.sha1Str = function(str)
{
	return Crypto.sha1(Crypto.strToBe32s(str),str.length);
};

// Calculate the SHA-1 hash of an array of blen bytes of big-endian 32-bit words
Crypto.sha1 = function(x,blen)
{
	// Add 32-bit integers, wrapping at 32 bits
	add32 = function(a,b)
	{
		var lsw = (a&0xFFFF)+(b&0xFFFF);
		var msw = (a>>16)+(b>>16)+(lsw>>16);
		return (msw<<16)|(lsw&0xFFFF);
	};
	// Add five 32-bit integers, wrapping at 32 bits
	add32x5 = function(a,b,c,d,e)
	{
		var lsw = (a&0xFFFF)+(b&0xFFFF)+(c&0xFFFF)+(d&0xFFFF)+(e&0xFFFF);
		var msw = (a>>16)+(b>>16)+(c>>16)+(d>>16)+(e>>16)+(lsw>>16);
		return (msw<<16)|(lsw&0xFFFF);
	};
	// Bitwise rotate left a 32-bit integer by 1 bit
	rol32 = function(n)
	{
		return (n>>>31)|(n<<1);
	};

	var len = blen*8;
	// Append padding so length in bits is 448 mod 512
	x[len>>5] |= 0x80 << (24-len%32);
	// Append length
	x[((len+64>>9)<<4)+15] = len;
	var w = Array(80);

	var k1 = 0x5A827999;
	var k2 = 0x6ED9EBA1;
	var k3 = 0x8F1BBCDC;
	var k4 = 0xCA62C1D6;

	var h0 = 0x67452301;
	var h1 = 0xEFCDAB89;
	var h2 = 0x98BADCFE;
	var h3 = 0x10325476;
	var h4 = 0xC3D2E1F0;

	for(var i=0;i<x.length;i+=16) {
		var j,t;
		var a = h0;
		var b = h1;
		var c = h2;
		var d = h3;
		var e = h4;
		for(j = 0;j<16;j++) {
			w[j] = x[i+j];
			t = add32x5(e,(a>>>27)|(a<<5),d^(b&(c^d)),w[j],k1);
			e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
		}
		for(j=16;j<20;j++) {
			w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
			t = add32x5(e,(a>>>27)|(a<<5),d^(b&(c^d)),w[j],k1);
			e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
		}
		for(j=20;j<40;j++) {
			w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
			t = add32x5(e,(a>>>27)|(a<<5),b^c^d,w[j],k2);
			e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
		}
		for(j=40;j<60;j++) {
			w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
			t = add32x5(e,(a>>>27)|(a<<5),(b&c)|(d&(b|c)),w[j],k3);
			e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
		}
		for(j=60;j<80;j++) {
			w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
			t = add32x5(e,(a>>>27)|(a<<5),b^c^d,w[j],k4);
			e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
		}

		h0 = add32(h0,a);
		h1 = add32(h1,b);
		h2 = add32(h2,c);
		h3 = add32(h3,d);
		h4 = add32(h4,e);
	}
	return Array(h0,h1,h2,h3,h4);
};


}
//}}}
/***
|Name|HoverMenuPlugin|
|Created by|SaqImtiaz|
|Location|http://lewcid.googlepages.com/lewcid.html#HoverMenuPlugin|
|Version|1.11|
|Requires|~TW2.x|
!Description:
Provides a hovering menu on the edge of the screen for commonly used commands, that scrolls with the page.

!Demo:
Observe the hovering menu on the right edge of the screen.

!Installation:
Copy the contents of this tiddler to your TW, tag with systemConfig, save and reload your TW.
To customize your HoverMenu, edit the HoverMenu shadow tiddler.

To customize whether the menu sticks to the right or left edge of the screen, and its start position, edit the HoverMenu configuration settings part of the code below. It's well documented, so don't be scared!

The menu has an id of hoverMenu, in case you want to style the buttons in it using css.

!Notes:
Since the default HoverMenu contains buttons for toggling the side bar and jumping to the top of the screen and to open tiddlers, the ToggleSideBarMacro, JumpMacro and the JumpToTopMacro are included in this tiddler, so you dont need to install them separately. Having them installed separately as well could lead to complications.

If you dont intend to use these three macros at all, feel free to remove those sections of code in this tiddler.

!To Do:
* rework code to allow multiple hovering menus in different positions, horizontal etc.
* incorporate code for keyboard shortcuts that correspond to the buttons in the hovermenu

!History:
*03-08-06, ver 1.1.2: compatibility fix with SelectThemePlugin
*03-08-06, ver 1.11: fixed error with button tooltips
*27-07-06, ver 1.1 : added JumpMacro to hoverMenu
*23-07-06

!Code
***/

/***
start HoverMenu plugin code
***/
//{{{
config.hoverMenu={};
//}}}

/***
HoverMenu configuration settings
***/
//{{{
config.hoverMenu.settings={
 align: 'right', //align menu to right or left side of screen, possible values are 'right' and 'left' 
 x: 18, // horizontal distance of menu from side of screen, increase to your liking.
 y: 200 //vertical distance of menu from top of screen at start, increase or decrease to your liking
 };
//}}}

//{{{
//continue HoverMenu plugin code
config.hoverMenu.handler=function()
{ 
 if (!document.getElementById("hoverMenu"))
 {
 var theMenu = createTiddlyElement(document.getElementById("contentWrapper"), "div","hoverMenu");
 theMenu.setAttribute("refresh","content");
 theMenu.setAttribute("tiddler","HoverMenu");
 var menuContent = store.getTiddlerText("HoverMenu");
 wikify(menuContent,theMenu);
 }

 var Xloc = this.settings.x;
 Yloc =this.settings.y;
 var ns = (navigator.appName.indexOf("Netscape") != -1);
 function SetMenu(id)
 {
 var GetElements=document.getElementById?document.getElementById(id):document.all?document.all[id]:document.layers[id];
 if(document.layers)GetElements.style=GetElements;
 GetElements.sP=function(x,y){this.style[config.hoverMenu.settings.align]=x +"px";this.style.top=y +"px";};
 GetElements.x = Xloc;
 GetElements.y = findScrollY();
 GetElements.y += Yloc;
 return GetElements;
 }
 window.LoCate_XY=function()
 {
 var pY = findScrollY();
 ftlObj.y += (pY + Yloc - ftlObj.y)/15;
 ftlObj.sP(ftlObj.x, ftlObj.y);
 setTimeout("LoCate_XY()", 10);
 }
 ftlObj = SetMenu("hoverMenu");
 LoCate_XY();
};

window.old_lewcid_hovermenu_restart = restart;
restart = function()
{
 window.old_lewcid_hovermenu_restart();
 config.hoverMenu.handler();
};

setStylesheet(
"#hoverMenu .imgLink, #hoverMenu .imgLink:hover {border:none; padding:0px; float:right; margin-bottom:2px; margin-top:0px;}\n"+
"#hoverMenu .button, #hoverMenu .tiddlyLink {border:none; font-weight:bold; background:#18f; color:#FFF; padding:0 5px; float:right; margin-bottom:4px;}\n"+
"#hoverMenu .button:hover, #hoverMenu .tiddlyLink:hover {font-weight:bold; border:none; color:#fff; background:#000; padding:0 5px; float:right; margin-bottom:4px;}\n"+
"#hoverMenu .button {width:100%; text-align:center}"+
"#hoverMenu { position:absolute; width:7px;}\n"+
"\n","hoverMenuStyles");


config.macros.renameButton={};
config.macros.renameButton.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{

 if (place.lastChild.tagName!="BR")
 {
 place.lastChild.firstChild.data = params[0];
 if (params[1]) {place.lastChild.title = params[1];}
 }
};

config.shadowTiddlers["HoverMenu"]="<<top>>\n<<toggleSideBar>><<renameButton '>' >>\n<<jump j '' top>>\n<<saveChanges>><<renameButton s 'Save TiddlyWiki'>>\n<<newTiddler>><<renameButton n>>\n";
//}}}
//end HoverMenu plugin code

//Start ToggleSideBarMacro code
//{{{
config.macros.toggleSideBar={};

config.macros.toggleSideBar.settings={
 styleHide : "#sidebar { display: none;}\n"+"#contentWrapper #displayArea { margin-right: 1em;}\n"+"",
 styleShow : " ",
 arrow1: "�",
 arrow2: "�"
};

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");
//}}}
//end ToggleSideBarMacro code

//start JumpToTopMacro code
//{{{
config.macros.top={};
config.macros.top.handler=function(place,macroName)
{
 createTiddlyButton(place,"^","jump to top",this.onclick);
}
config.macros.top.onclick=function()
{
 window.scrollTo(0,0);
};

config.commands.top =
{
 text:" ^ ",
 tooltip:"jump to top"
};

config.commands.top.handler = function(event,src,title)
{
 window.scrollTo(0,0);
}
//}}}
//end JumpToStartMacro code

//start JumpMacro code
//{{{
config.macros.jump= {};
config.macros.jump.handler = function (place,macroName,params,wikifier,paramString,tiddler)
{
 var label = (params[0] && params[0]!=".")? params[0]: 'jump';
 var tooltip = (params[1] && params[1]!=".")? params[1]: 'jump to an open tiddler';
 var top = (params[2] && params[2]=='top') ? true: false; 

 var btn =createTiddlyButton(place,label,tooltip,this.onclick);
 if (top==true)
 btn.setAttribute("top","true")
}

config.macros.jump.onclick = function(e)
{
 if (!e) var e = window.event;
 var theTarget = resolveTarget(e);
 var top = theTarget.getAttribute("top");
 var popup = Popup.create(this);
 if(popup)
 {
 if(top=="true")
 {createTiddlyButton(createTiddlyElement(popup,"li"),'Top ?','Top of TW',config.macros.jump.top);
 createTiddlyElement(popup,"hr");}
 
 story.forEachTiddler(function(title,element) {
 createTiddlyLink(createTiddlyElement(popup,"li"),title,true);
 });
 }
 Popup.show(popup,false);
 e.cancelBubble = true;
 if (e.stopPropagation) e.stopPropagation();
 return false;
}

config.macros.jump.top = function()
{
 window.scrollTo(0,0);
}
//}}}
//end JumpMacro code

//utility functions
//{{{
Popup.show = function(unused,slowly)
{
 var curr = Popup.stack[Popup.stack.length-1];
 var rootLeft = findPosX(curr.root);
 var rootTop = findPosY(curr.root);
 var rootHeight = curr.root.offsetHeight;
 var popupLeft = rootLeft;
 var popupTop = rootTop + rootHeight;
 var popupWidth = curr.popup.offsetWidth;
 var winWidth = findWindowWidth();
 if (isChild(curr.root,'hoverMenu'))
 var x = config.hoverMenu.settings.x;
 else
 var x = 0;
 if(popupLeft + popupWidth+x > winWidth)
 popupLeft = winWidth - popupWidth -x;
 if (isChild(curr.root,'hoverMenu'))
 {curr.popup.style.right = x + "px";}
 else
 curr.popup.style.left = popupLeft + "px";
 curr.popup.style.top = popupTop + "px";
 curr.popup.style.display = "block";
 addClass(curr.root,"highlight");
 if(config.options.chkAnimate)
 anim.startAnimating(new Scroller(curr.popup,slowly));
 else
 window.scrollTo(0,ensureVisible(curr.popup));
}

window.isChild = function(e,parentId) {
 while (e != null) {
 var parent = document.getElementById(parentId);
 if (parent == e) return true;
 e = e.parentNode;
 }
 return false;
};
//}}}


Custom Menu:
*[[Welcome]]
*[[CustomMenu]]
*''<<popup [[Plugins]] [[<<tiddlerList tags:Plugin$))]]>>''
----
<<forEachTiddler
where
'tiddler.tags.contains("systemConfig")'
>>
Nature CAN create deception (water stains that look like Jesus or the Virgin Mary come to mind). Only humans (and perhaps a few other species) can PERCEIVE deception. Or, more simply, humans perceive unusual patterns IN nature that can be interpreted as deception. Deception, or seeing something in nothing, is based, instinctually, in fear our primate brain fills in the gaps when there is a lack of information about a given stimulus thus, once we fill in the gaps with knowledge, we see the fallacy of our own perception. In other words, we delude and deceive ourselves. If you are aware enough and see enough of the pattern, you cannot be deceived, so is it truly deception or a deliberate presentation of a lack of information?
[[Site Map]]
/***
|''Name:''|Definition Macro|
|''Version:''|0.1|
|''Source''|http://jackparke.googlepages.com/jtw.html#DefinitionMacro ([[del.icio.us|http://del.icio.us/post?url=http://jackparke.googlepages.com/jtw.html%23DefinitionMacro]])|
|''Author:''|[[Jack]]|
|''Type:''|Macro|
!Description
Allow definitions of glossary terms to be easily visible via mouseover
!Usage
{{{<<def MyTermTiddler>>}}}
!Revision History
* Original by [[Jack]] 24 May 2006

!Code
***/
//{{{
version.extensions.def = {major: 0, minor: 1, revision: 0, date: new Date("May 24, 2006")};

config.macros.def = {};
config.macros.def.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
 var text = store.getTiddlerText(params[0]);
 var wrapper = createTiddlyButton(place,params[0],text?"":"No definition available.",onClickTiddlerLink,"definition")
 var e = createTiddlyElement(wrapper,"span",null,null,text)
 wrapper.setAttribute("tiddlyLink", params[0])
}
config.macros.def.editMe = function(e) {
 var title = this.getAttribute("tiddlyLink");
 clearMessage();
 story.displayTiddler(null,title,DEFAULT_VIEW_TEMPLATE);
 story.focusTiddler(title,"text");
}
setStylesheet("a.definition {position:relative; z-index:24;} a.definition:hover {z-index:25;} a.definition span{display:none;} a.definition:hover span{display:block; position:absolute; top:2em; left:2em; width:15em; border:1px solid #ffd; background-color:#ffd; color:#000; text-align: center}");

//}}}
/***
|''Name:''|DeprecatedFunctionsPlugin|
|''Description:''|Support for deprecated functions removed from core|
***/
//{{{
if(!version.extensions.DeprecatedFunctionsPlugin) {
version.extensions.DeprecatedFunctionsPlugin = {installed:true};

//--
//-- Deprecated code
//--

// @Deprecated: Use createElementAndWikify and this.termRegExp instead
config.formatterHelpers.charFormatHelper = function(w)
{
	w.subWikify(createTiddlyElement(w.output,this.element),this.terminator);
};

// @Deprecated: Use enclosedTextHelper and this.lookaheadRegExp instead
config.formatterHelpers.monospacedByLineHelper = 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) {
		var text = lookaheadMatch[1];
		if(config.browser.isIE)
			text = text.replace(/\n/g,"\r");
		createTiddlyElement(w.output,"pre",null,null,text);
		w.nextMatch = lookaheadRegExp.lastIndex;
	}
};

// @Deprecated: Use <br> or <br /> instead of <<br>>
config.macros.br = {};
config.macros.br.handler = function(place)
{
	createTiddlyElement(place,"br");
};

// Find an entry in an array. Returns the array index or null
// @Deprecated: Use indexOf instead
Array.prototype.find = function(item)
{
	var i = this.indexOf(item);
	return i == -1 ? null : i;
};

// Load a tiddler from an HTML DIV. The caller should make sure to later call Tiddler.changed()
// @Deprecated: Use store.getLoader().internalizeTiddler instead
Tiddler.prototype.loadFromDiv = function(divRef,title)
{
	return store.getLoader().internalizeTiddler(store,this,title,divRef);
};

// Format the text for storage in an HTML DIV
// @Deprecated Use store.getSaver().externalizeTiddler instead.
Tiddler.prototype.saveToDiv = function()
{
	return store.getSaver().externalizeTiddler(store,this);
};

// @Deprecated: Use store.allTiddlersAsHtml() instead
function allTiddlersAsHtml()
{
	return store.allTiddlersAsHtml();
}

// @Deprecated: Use refreshPageTemplate instead
function applyPageTemplate(title)
{
	refreshPageTemplate(title);
}

// @Deprecated: Use story.displayTiddlers instead
function displayTiddlers(srcElement,titles,template,unused1,unused2,animate,unused3)
{
	story.displayTiddlers(srcElement,titles,template,animate);
}

// @Deprecated: Use story.displayTiddler instead
function displayTiddler(srcElement,title,template,unused1,unused2,animate,unused3)
{
	story.displayTiddler(srcElement,title,template,animate);
}

// @Deprecated: Use functions on right hand side directly instead
var createTiddlerPopup = Popup.create;
var scrollToTiddlerPopup = Popup.show;
var hideTiddlerPopup = Popup.remove;

// @Deprecated: Use right hand side directly instead
var regexpBackSlashEn = new RegExp("\\\\n","mg");
var regexpBackSlash = new RegExp("\\\\","mg");
var regexpBackSlashEss = new RegExp("\\\\s","mg");
var regexpNewLine = new RegExp("\n","mg");
var regexpCarriageReturn = new RegExp("\r","mg");

}
//}}}
It's about Heaven, Hell and chopsticks.

Once upon a time, in a temple nestled in the misty end of south hill, lived a pair of monks. One old and one young.

'What are the differences between Heaven and Hell?' the young monk asked the learned master one day.

'There are no material differences,' replied the old monk peacefully.

'None at all?' asked the confused young monk.

'Yes. Both Heaven and Hell look the same. They all have a dining hall with a big hot pot in the center in which some delicious noodles are boiled, giving off an appetizing scent,' said our old priest. 'The size of the pan and the number of people sitting around the pot are the same in these two places.'

'But oddly, each diner is given a pair of meter-long chopsticks and must use them to eat the noodles. And to eat the noodles, one must hold the chopsticks properly at their ends, no cheating is allowed,' the zen master went on to describe to our young monk.

'In the case of Hell, people are always starved because no matter how hard they try, they fail to get the noodles into their mouths,' said the old priest.

'But isn't it the same happens to the people in Heaven?' the junior questioned.

'No. They can eat because they each feed the person sitting opposite them at the table. You see, that is the difference between Heaven and Hell,' explained the old monk.

The moral of this story is simple: A turn in mind is all the difference between Heaven and Hell lies.
/***
| Name:|''dropTagging''|
| Created by:|SaqImtiaz|
| Location:|http://lewcid.googlepages.com/lewcid.html|
| Version:|0.1 (06-Apr-2006)|
| Requires:|~TW2.07|

!About
*provides a drop down list of tiddlers tagged with the specified tag, a replacement for the core tagging macro.

!Demonstration
*<<dropTagging Saq>>
''I recommend using either TaggerPlugin or monkeyTagger, with dropTags and dropTagging in the toolbar:''


!Usage
{{{<<dropTagging>>}}} for tiddlers tagged by current tiddler/tag
{{{<<dropTagging 'Saq'>>}}} for tiddlers tagged by the tag 'Saq' <<dropTagging 'Saq'>>
{{{<<dropTagging 'Saq' 'custom label'>>}}} for tiddlers tagged by the tag 'Saq' with a custom label. <<dropTagging 'Saq' 'custom label'>>

!Installation:
*Copy this tiddler to your TW with the systemConfig tag
* copy the following to your ViewTemplate:
#either {{{<div class='tagging' macro='dropTagging'></div>}}} to add next to or replace tagging macro, or
#{{{<div class='toolbar' >
<span style="padding-right:1.75em;" macro='dropTagging''></span>
<span macro='toolbar -closeTiddler closeOthers +editTiddler permalink references jump'></span>
</div>}}}(adjust padding to taste)

!To Do
*tweak popup css to optimize placement and colors.
*''optimize code to use core onClickTag function, can cut code size by half!''

!Code
***/
//{{{
config.macros.dropTagging={};
config.macros.dropTagging.dropdownchar = (document.all?"▼":"▾"); // the fat one is the only one that works in IE
config.macros.dropTagging.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
 var arrow=': '+ config.macros.dropTagging.dropdownchar;
 if(params[0] && store.tiddlerExists(params[0]))
 tiddler = store.getTiddler(params[0]);



 var droptagginglabel= (params[1] && params[1] !='.')? params[1]: 'tagging'+arrow;
 var droptaggingtooltip="tiddlers tagged with '"+tiddler.title+"'";
 
 if(params[0] && store.tiddlerExists(params[0]))
 tiddler = store.getTiddler(params[0]);
 var tagged = store.getTaggedTiddlers(tiddler.title);

 if(tagged.length==0)
 return false; 
 
 var droptagging = function(e)
 { if (!e) var e = window.event;
 var popup = Popup.create(this);
 


 for(var t=0; t<tagged.length; t++)
 createTiddlyLink(createTiddlyElement(popup,"li"),tagged[t].title,true);

 Popup.show(popup,false);
 e.cancelBubble = true;
 if (e.stopPropagation)
 e.stopPropagation();
 return(false);
 };
 
var createdropperButton = function(place){
var sp = createTiddlyElement(place,"span",null,"taggingdropbutton");
var theDropDownBtn = createTiddlyButton(sp,droptagginglabel,droptaggingtooltip,droptagging);
 };
createdropperButton(place);
};

setStylesheet(
 ".toolbar .taggingdropbutton {margin-right:0em; border:0px solid #eee; padding:0px; padding-right:0px; padding-left:0px; }\n"+
 ".taggingdropbutton a.button {padding:2px; padding-left:2px; padding-right:2px;}\n"+
// ".taggingdropbutton {font-size:150%;}\n"+
".popup .highlight{background: #fe8; color:#000;}\n"+
 "",
"DropTaggingStyles");

//}}}
/***
|''Name:''|''dropTags''|
|''Version:''|0.5 (12-May-2006)|
|''Created by:''|SaqImtiaz|
|''Location:''|http://lewcid.googlepages.com/lewcid.html#DropTagsMacro|
|''Description:''|provides a drop down list of tags in the current tiddler,<<br>> a replacement for the core tags macro.|
|''Documentation:''|DropTagsMacroDocumentation |
|''Source Code:''|[[DropTagsMacroSource|DropTagsMacroDocumentation]] |
|''Requires:''|~TW2.07|

***/
// /%
config.macros.dropTags={};config.macros.dropTags.dropdownchar=(document.all?"▼":"▾");config.macros.dropTags.handler=function(_1,_2,_3,_4,_5,_6){var _7=config.macros.dropTags.dropdownchar;var _8=(_3[0]&&_3[0]!=".")?_3[0]+_7:"tags"+_7;var _9="current tags for this tiddler";var _a=function(e){if(!e){var e=window.event;}var _d=Popup.create(this);var _e=config.views.wikified.tag;if(_6.tags.length==0){createTiddlyElement(_d,"li",null,"listTitle",_e.labelNoTags);}else{for(var t=0;t<_6.tags.length;t++){createTagButton(createTiddlyElement(_d,"li"),_6.tags[t],_6.title);}}if(version.extensions.IntelliTaggerPlugin){createTiddlyElement(createTiddlyElement(_d,"li"),"hr");abego.IntelliTagger.createEditTagsButton(_6,createTiddlyElement(_d,"li"),"[IntelliEdit]","Edit tags with Intellitagger");}Popup.show(_d,false);e.cancelBubble=true;if(e.stopPropagation){e.stopPropagation();}return (false);};createTiddlyButton(_1,_8,_8,_a,"button","dropTagBtn");};setStylesheet(".popup .highlight{background: #fe8; color:#000;}\n"+"#nestedtagger {background:#2E5ADF; border: 1px solid #0331BF;}\n"+"","DropTagsStyles");if(!config.macros.tagger){window.onClickTag=function(e){if(!e){var e=window.event;}var _12=resolveTarget(e);var _13=(!isNested(_12));if((Popup.stack.length>1)&&(_13==true)){Popup.removeFrom(1);}else{if(Popup.stack.length>0&&_13==false){Popup.removeFrom(0);}}var _14=(_13==false)?"popup":"nestedtagger";var _15=createTiddlyElement(document.body,"ol",_14,"popup",null);Popup.stack.push({root:this,popup:_15});var tag=this.getAttribute("tag");var _17=this.getAttribute("tiddler");if(_15&&tag){var _18=store.getTaggedTiddlers(tag);var _19=[];var li,r;for(r=0;r<_18.length;r++){if(_18[r].title!=_17){_19.push(_18[r].title);}}var _1b=config.views.wikified.tag;if(_19.length>0){var _1c=createTiddlyButton(createTiddlyElement(_15,"li"),_1b.openAllText.format([tag]),_1b.openAllTooltip,onClickTagOpenAll);_1c.setAttribute("tag",tag);createTiddlyElement(createTiddlyElement(_15,"li"),"hr");for(r=0;r<_19.length;r++){createTiddlyLink(createTiddlyElement(_15,"li"),_19[r],true);}}else{createTiddlyText(createTiddlyElement(_15,"li",null,"disabled"),_1b.popupNone.format([tag]));}createTiddlyElement(createTiddlyElement(_15,"li"),"hr");var h=createTiddlyLink(createTiddlyElement(_15,"li"),tag,false);createTiddlyText(h,_1b.openTag.format([tag]));}Popup.show(_15,false);e.cancelBubble=true;if(e.stopPropagation){e.stopPropagation();}return (false);};}if(!window.isNested){window.isNested=function(e){while(e!=null){var _1f=document.getElementById("contentWrapper");if(_1f==e){return true;}e=e.parentNode;}return false;};};config.shadowTiddlers.DropTagsMacroDocumentation="The documentation is available [[here.|http://lewcid.googlepages.com/lewcid.html#DropTagsMacroDocumentation]]";config.shadowTiddlers.DropTagsMacroSource="The documentation is available [[here.|http://lewcid.googlepages.com/lewcid.html#DropTagsMacroDocumentation]]";
// %/
/***
|''Name:''|''dropTags''|
|''Version:''|0.5 (12-May-2006)|
|''Created by:''|SaqImtiaz|
|''Location:''|http://lewcid.googlepages.com/lewcid.html#DropTagsMacro|
|''Description:''|provides a drop down list of tags in the current tiddler,<<br>> a replacement for the core tags macro.|
|''Documentation:''|DropTagsMacroDocumentation |
|''Source Code:''|DropTagsMacroSource |
|''Requires:''|~TW2.07|

!About
*provides a drop down list of tags in the current tiddler, a replacement for the core tags macro.

''I recommend using either TaggerPlugin or monkeyTagger, with dropTags and dropTagging in the toolbar:''


!Usage
{{{<<dropTags>>}}} for <<dropTags>>
or {{{<<dropTags 'custom label'>>}}} for <<dropTags 'custom label'>>

!Installation:
*Copy this tiddler to your TW with the systemConfig tag
* copy the following to your ViewTemplate:
#either {{{<div class='tagged' macro='dropTags'></div>}}} to add to next to the tags macro in the viewer area, or
#{{{<div class='toolbar' >
<span style="padding-right:8.75em;" macro='dropTags "current tags: "+config.macros.dropTags.dropdownchar}}'></span>
<span macro='toolbar -closeTiddler closeOthers +editTiddler permalink references jump'></span>
</div>}}}


!History
*May 12th, version 0.5, fixed some nesting bugs, added support for IntellitaggerPlugin.
*May 3rd, version 0.41, made compatible with CustomPopups.

!Source Code
***/
//{{{
config.macros.dropTags={};
config.macros.dropTags.dropdownchar = (document.all?"?":"?"); // the fat one is the only one that works in IE
config.macros.dropTags.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
 var arrow=config.macros.dropTags.dropdownchar;
 var droptaglabel= (params[0] && params[0] !='.')? params[0]+arrow: 'tags'+arrow;
 var droptagtooltip="current tags for this tiddler";

 var droptag = function(e){
 if (!e) var e = window.event;
 var popup = Popup.create(this);
 var lingo = config.views.wikified.tag;
 if (tiddler.tags.length==0)
 createTiddlyElement(popup,"li",null,"listTitle",lingo.labelNoTags);
 else
 for(var t=0; t<tiddler.tags.length; t++)
 {createTagButton(createTiddlyElement(popup,"li"),tiddler.tags[t],tiddler.title);}
 if (version.extensions.IntelliTaggerPlugin)
 {createTiddlyElement(createTiddlyElement(popup,"li"),"hr");
 abego.IntelliTagger.createEditTagsButton(tiddler, createTiddlyElement(popup,"li"),"[IntelliEdit]","Edit tags with Intellitagger");}
 Popup.show(popup,false);
 e.cancelBubble = true;
 if (e.stopPropagation)
 e.stopPropagation();
 return(false);
 };
 createTiddlyButton(place,droptaglabel,droptaglabel,droptag,"button","dropTagBtn");
};

setStylesheet(
".popup .highlight{background: #fe8; color:#000;}\n"+
"#nestedtagger {background:#2E5ADF; border: 1px solid #0331BF;}\n"+
 "",
"DropTagsStyles");

if (!config.macros.tagger)
 window.onClickTag=function(e){
 if (!e) var e = window.event;
 var theTarget = resolveTarget(e);

 var nested = (!isNested(theTarget));
 if ((Popup.stack.length > 1)&&(nested==true)) {Popup.removeFrom(1);}
 else if(Popup.stack.length > 0 && nested==false) {Popup.removeFrom(0);};

 var theId = (nested==false)? "popup" : "nestedtagger";
 var popup = createTiddlyElement(document.body,"ol",theId,"popup",null);
 Popup.stack.push({root: this, popup: popup});

 var tag = this.getAttribute("tag");
 var title = this.getAttribute("tiddler");
 if(popup && tag)
 {
 var tagged = store.getTaggedTiddlers(tag);
 var titles = [];
 var li,r;
 for(r=0;r<tagged.length;r++)
 if(tagged[r].title != title)
 titles.push(tagged[r].title);
 var lingo = config.views.wikified.tag;
 if(titles.length > 0)
 {
 var openAll = createTiddlyButton(createTiddlyElement(popup,"li"),lingo.openAllText.format([tag]),lingo.openAllTooltip,onClickTagOpenAll);
 openAll.setAttribute("tag",tag);
 createTiddlyElement(createTiddlyElement(popup,"li"),"hr");
 for(r=0; r<titles.length; r++)
 {
 createTiddlyLink(createTiddlyElement(popup,"li"),titles[r],true);
 }
 }
 else
 createTiddlyText(createTiddlyElement(popup,"li",null,"disabled"),lingo.popupNone.format([tag]));
 createTiddlyElement(createTiddlyElement(popup,"li"),"hr");
 var h = createTiddlyLink(createTiddlyElement(popup,"li"),tag,false);
 createTiddlyText(h,lingo.openTag.format([tag]));
 }
 Popup.show(popup,false);
 e.cancelBubble = true;
 if (e.stopPropagation) e.stopPropagation();
 return(false);
 }

if (!window.isNested)
 window.isNested = function(e) {
 while (e != null) {
 var contentWrapper = document.getElementById("contentWrapper");
 if (contentWrapper == e) return true;
 e = e.parentNode;
 }
 return false;
 };

config.shadowTiddlers.DropTagsMacroDocumentation="The documentation is available [[here.|http://lewcid.googlepages.com/lewcid.html#DropTagsMacroDocumentation]]";

config.shadowTiddlers.DropTagsMacroSource="The documentation is available [[here.|http://lewcid.googlepages.com/lewcid.html#DropTagsMacroDocumentation]]";

//}}}
// // Excludes any tiddlers from timeline that have been tagged with ''excludeTimeline''
/*{{{*/
config.macros.timeline.handler = function(place,macroName,params)
{
 var field = params[0] ? params[0] : "modified";
 var tiddlers = store.reverseLookup("tags","excludeTimeline",false,field);
 var lastDay = "";
 var last = params[1] ? tiddlers.length-Math.min(tiddlers.length,parseInt(params[1])) : 0;
 for(var t=tiddlers.length-1; t>=last; t--)
 {
 var tiddler = tiddlers[t];
 var theDay = tiddler[field].convertToLocalYYYYMMDDHHMM().substr(0,8);
 if(theDay != lastDay)
 {
 var theDateList = document.createElement("ul");
 place.appendChild(theDateList);
 createTiddlyElement(theDateList,"li",null,"listTitle",tiddler[field].formatString(this.dateFormat));
 lastDay = theDay;
 }
 var theDateListItem = createTiddlyElement(theDateList,"li",null,"listLink");
 theDateListItem.appendChild(createTiddlyLink(place,tiddler.title,true));
 }
}
/*}}}*/
Expectation is the most challenging of emotional states to push through.  When on a path, there are many obstacles...expectation is one of them.  There is expectation in what will happen next.  There is expectation of other people.  The former is easier to accept than the latter.

Facing down expectation within the larger framework of walking the path isn't for the meek...it is a larger and more dangerous lesson to learn.
/***
| Name:|ExtentTagButtonPlugin|
| Description:|Adds a New tiddler button in the tag drop down|
| Version:|3.0 ($Rev: 1845 $)|
| Date:|$Date: 2007-03-16 15:19:22 +1000 (Fri, 16 Mar 2007) $|
| Source:|http://mptw.tiddlyspot.com/#ExtendTagButtonPlugin|
| Author:|Simon Baird <simon.baird@gmail.com>|
| License|http://mptw.tiddlyspot.com/#TheBSDLicense|
***/
//{{{

// can't hijack a click handler. must redefine this entirely.
// would be good to refactor in the core...
// this version copied from 2.1.3 core

// Event handler for clicking on a tiddler tag
function onClickTag(e)
{
	if (!e) var e = window.event;
	var theTarget = resolveTarget(e);
	var popup = Popup.create(this);
	var tag = this.getAttribute("tag");
	var title = this.getAttribute("tiddler");
	if(popup && tag)
		{
		var tagged = store.getTaggedTiddlers(tag);
		var titles = [];
		var li,r;
		for(r=0;r<tagged.length;r++)
			if(tagged[r].title != title)
				titles.push(tagged[r].title);
		var lingo = config.views.wikified.tag;

		wikify("<<newTiddler label:'New tiddler' tag:"+tag+">>",createTiddlyElement(popup,"li")); // <---- the only modification

		if(titles.length > 0)
			{
			var openAll = createTiddlyButton(createTiddlyElement(popup,"li"),lingo.openAllText.format([tag]),lingo.openAllTooltip,onClickTagOpenAll);
			openAll.setAttribute("tag",tag);
			createTiddlyElement(createTiddlyElement(popup,"li",null,"listBreak"),"div");
			for(r=0; r<titles.length; r++)
				{
				createTiddlyLink(createTiddlyElement(popup,"li"),titles[r],true);
				}
			}
		else
			createTiddlyText(createTiddlyElement(popup,"li",null,"disabled"),lingo.popupNone.format([tag]));
		createTiddlyElement(createTiddlyElement(popup,"li",null,"listBreak"),"div");
		var h = createTiddlyLink(createTiddlyElement(popup,"li"),tag,false);
		createTiddlyText(h,lingo.openTag.format([tag]));
		}
	Popup.show(popup,false);
	e.cancelBubble = true;
	if (e.stopPropagation) e.stopPropagation();
	return(false);
}

//}}}

With my eyes open, do I see better than with them closed?  What we see is an interpretation of reality.  What reality truly is we cannot fathom...I simply try to expand my perception to see more of it.
/***
|Name|FontSizePlugin|
|Created by|SaqImtiaz|
|Location|http://lewcid.googlepages.com/lewcid.html#FontSizePlugin|
|Version|1.0|
|Requires|~TW2.x|
!Description:
Resize tiddler text on the fly. The text size is remembered between sessions by use of a cookie.
You can customize the maximum and minimum allowed sizes.
(only affects tiddler content text, not any other text)

Also, you can load a TW file with a font-size specified in the url.
Eg: http://lewcid.googlepages.com/lewcid.html#font:110

!Demo:
Try using the font-size buttons in the sidebar, or in the MainMenu above.

!Installation:
Copy the contents of this tiddler to your TW, tag with systemConfig, save and reload your TW.
Then put {{{<<fontSize "font-size:">>}}} in your SideBarOptions tiddler, or anywhere else that you might like.

!Usage
{{{<<fontSize>>}}} results in <<fontSize>>
{{{<<fontSize font-size: >>}}} results in <<fontSize font-size:>>

!Customizing:
The buttons and prefix text are wrapped in a span with class fontResizer, for easy css styling.
To change the default font-size, and the maximum and minimum font-size allowed, edit the config.fontSize.settings section of the code below.

!Notes:
This plugin assumes that the initial font-size is 100% and then increases or decreases the size by 10%. This stepsize of 10% can also be customized.

!History:
*27-07-06, version 1.0 : prevented double clicks from triggering editing of containing tiddler.
*25-07-06, version 0.9

!Code
***/

//{{{
config.fontSize={};

//configuration settings
config.fontSize.settings =
{
 defaultSize : 100, // all sizes in %
 maxSize : 200,
 minSize : 40,
 stepSize : 10
};

//startup code
var fontSettings = config.fontSize.settings;

if (!config.options.txtFontSize)
 {config.options.txtFontSize = fontSettings.defaultSize;
 saveOptionCookie("txtFontSize");}
setStylesheet(".tiddler .viewer {font-size:"+config.options.txtFontSize+"%;}\n","fontResizerStyles");
setStylesheet("#contentWrapper .fontResizer .button {display:inline;font-size:105%; font-weight:bold; margin:0 1px; padding: 0 3px; text-align:center !important;}\n .fontResizer {margin:0 0.5em;}","fontResizerButtonStyles");

//macro
config.macros.fontSize={};
config.macros.fontSize.handler = function (place,macroName,params,wikifier,paramString,tiddler)
{

 var sp = createTiddlyElement(place,"span",null,"fontResizer");
 sp.ondblclick=this.onDblClick;
 if (params[0])
 createTiddlyText(sp,params[0]);
 createTiddlyButton(sp,"+","increase font-size",this.incFont);
 createTiddlyButton(sp,"=","reset font-size",this.resetFont);
 createTiddlyButton(sp,"–","decrease font-size",this.decFont);
}

config.macros.fontSize.onDblClick = function (e)
{
 if (!e) var e = window.event;
 e.cancelBubble = true;
 if (e.stopPropagation) e.stopPropagation();
 return false;
}

config.macros.fontSize.setFont = function ()
{
 saveOptionCookie("txtFontSize");
 setStylesheet(".tiddler .viewer {font-size:"+config.options.txtFontSize+"%;}\n","fontResizerStyles");
}

config.macros.fontSize.incFont=function()
{
 if (config.options.txtFontSize < fontSettings.maxSize)
 config.options.txtFontSize = (config.options.txtFontSize*1)+fontSettings.stepSize;
 config.macros.fontSize.setFont();
}

config.macros.fontSize.decFont=function()
{

 if (config.options.txtFontSize > fontSettings.minSize)
 config.options.txtFontSize = (config.options.txtFontSize*1) - fontSettings.stepSize;
 config.macros.fontSize.setFont();
}

config.macros.fontSize.resetFont=function()
{

 config.options.txtFontSize=fontSettings.defaultSize;
 config.macros.fontSize.setFont();
}

config.paramifiers.font =
{
 onstart: function(v)
 {
 config.options.txtFontSize = v;
 config.macros.fontSize.setFont();
 }
};
//}}}
Copyright 2006 Brian Gant -- Design: Lewcid TW Themes and Extensions » Lewcid 2006
//{{{
//This ensures that the footer sticks to the bottom of the screen when there are no tiddlers open. If that is not desirable, it can be deleted.
function setFooter() {
         if (document.getElementById && document.getElementById("contentFooter") ) {
            var windowHeight=findWindowHeight();
         if (windowHeight>0) {
            var contentHeight= document.getElementById('mainMenu').offsetHeight + document.getElementById("header").offsetHeight + document.getElementById("contentFooter").offsetHeight;
            var menu= document.getElementById('mainMenu');
            if (windowHeight-(contentHeight)>=0) {
               menu.style.position='relative';
               menu.style.marginBottom=(windowHeight-(contentHeight))+'px';
               }
            else {
                 menu.style.position='';
                 menu.style.marginBottom='';
                 }
            }
         }
}
window.onresize = function() {
  setFooter();
}

Story.prototype.refreshTiddler_footerhack=Story.prototype.refreshTiddler;
Story.prototype.refreshTiddler = function (title,template,force)
{    
var theTiddler = Story.prototype.refreshTiddler_footerhack.apply(this,arguments);
setFooter();
   return theTiddler;}

//}}}
/***
|''Name:''|ForEachTiddlerPlugin|
|''Version:''|1.0.5 (2006-02-05)|
|''Source:''|http://tiddlywiki.abego-software.de/#ForEachTiddlerPlugin|
|''Author:''|UdoBorkowski (ub [at] abego-software [dot] de)|
|''Licence:''|[[BSD open source license]]|
|''Macros:''|[[ForEachTiddlerMacro]] v1.0.5|
|''TiddlyWiki:''|1.2.38+, 2.0|
|''Browser:''|Firefox 1.0.4+; Firefox 1.5; InternetExplorer 6.0|
!Description

Create customizable lists, tables etc. for your selections of tiddlers. Specify the tiddlers to include and their order through a powerful language.

''Syntax:'' 
|>|{{{<<}}}''forEachTiddler'' [''in'' //tiddlyWikiPath//] [''where'' //whereCondition//] [''sortBy'' //sortExpression// [''ascending'' //or// ''descending'']] [''script'' //scriptText//] [//action// [//actionParameters//]]{{{>>}}}|
|//tiddlyWikiPath//|The filepath to the TiddlyWiki the macro should work on. When missing the current TiddlyWiki is used.|
|//whereCondition//|(quoted) JavaScript boolean expression. May refer to the build-in variables {{{tiddler}}} and {{{context}}}.|
|//sortExpression//|(quoted) JavaScript expression returning "comparable" objects (using '{{{<}}}','{{{>}}}','{{{==}}}'. May refer to the build-in variables {{{tiddler}}} and {{{context}}}.|
|//scriptText//|(quoted) JavaScript text. Typically defines JavaScript functions that are called by the various JavaScript expressions (whereClause, sortClause, action arguments,...)|
|//action//|The action that should be performed on every selected tiddler, in the given order. By default the actions [[addToList|AddToListAction]] and [[write|WriteAction]] are supported. When no action is specified [[addToList|AddToListAction]] is used.|
|//actionParameters//|(action specific) parameters the action may refer while processing the tiddlers (see action descriptions for details). <<tiddler [[JavaScript in actionParameters]]>>|
|>|~~Syntax formatting: Keywords in ''bold'', optional parts in [...]. 'or' means that exactly one of the two alternatives must exist.~~|

See details see [[ForEachTiddlerMacro]] and [[ForEachTiddlerExamples]].

!Revision history
* v1.0.5
** Pass tiddler containing the macro with wikify, context object also holds reference to tiddler containing the macro ("inTiddler"). Thanks to SimonBaird.
** Support Firefox 1.5.0.1
** Internal
*** Make "JSLint" conform
*** "Only install once"
* v1.0.4 (2006-01-06)
** Support TiddlyWiki 2.0
* v1.0.3 (2005-12-22)
** Features: 
*** Write output to a file supports multi-byte environments (Thanks to Bram Chen) 
*** Provide API to access the forEachTiddler functionality directly through JavaScript (see getTiddlers and performMacro)
** Enhancements:
*** Improved error messages on InternetExplorer.
* v1.0.2 (2005-12-10)
** Features: 
*** context object also holds reference to store (TiddlyWiki)
** Fixed Bugs: 
*** ForEachTiddler 1.0.1 has broken support on win32 Opera 8.51 (Thanks to BrunoSabin for reporting)
* v1.0.1 (2005-12-08)
** Features: 
*** Access tiddlers stored in separated TiddlyWikis through the "in" option. I.e. you are no longer limited to only work on the "current TiddlyWiki".
*** Write output to an external file using the "toFile" option of the "write" action. With this option you may write your customized tiddler exports.
*** Use the "script" section to define "helper" JavaScript functions etc. to be used in the various JavaScript expressions (whereClause, sortClause, action arguments,...).
*** Access and store context information for the current forEachTiddler invocation (through the build-in "context" object) .
*** Improved script evaluation (for where/sort clause and write scripts).
* v1.0.0 (2005-11-20)
** initial version

!Code
***/
//{{{

 
//============================================================================
//============================================================================
// ForEachTiddlerPlugin
//============================================================================
//============================================================================

// Only install once
if (!version.extensions.ForEachTiddlerPlugin) {

version.extensions.ForEachTiddlerPlugin = {major: 1, minor: 0, revision: 5, date: new Date(2006,2,5), source: "http://tiddlywiki.abego-software.de/#ForEachTiddlergPlugin"};

// For backward compatibility with TW 1.2.x
//
if (!TiddlyWiki.prototype.forEachTiddler) {
 TiddlyWiki.prototype.forEachTiddler = function(callback) {
 for(var t in this.tiddlers) {
 callback.call(this,t,this.tiddlers[t]);
 }
 };
}

//============================================================================
// forEachTiddler Macro
//============================================================================

version.extensions.forEachTiddler = {major: 1, minor: 0, revision: 5, date: new Date(2006,2,5), provider: "http://tiddlywiki.abego-software.de"};

// ---------------------------------------------------------------------------
// Configurations and constants 
// ---------------------------------------------------------------------------

config.macros.forEachTiddler = {
 // Standard Properties
 label: "forEachTiddler",
 prompt: "Perform actions on a (sorted) selection of tiddlers",

 // actions
 actions: {
 addToList: {},
 write: {}
 }
};

// ---------------------------------------------------------------------------
// The forEachTiddler Macro Handler 
// ---------------------------------------------------------------------------

config.macros.forEachTiddler.getContainingTiddler = function(e) {
 while(e && !hasClass(e,"tiddler"))
 e = e.parentNode;
 var title = e ? e.getAttribute("tiddler") : null; 
 return title ? store.getTiddler(title) : null;
};

config.macros.forEachTiddler.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
 // config.macros.forEachTiddler.traceMacroCall(place,macroName,params,wikifier,paramString,tiddler);

 if (!tiddler) tiddler = config.macros.forEachTiddler.getContainingTiddler(place);
 // --- Parsing ------------------------------------------

 var i = 0; // index running over the params
 // Parse the "in" clause
 var tiddlyWikiPath = undefined;
 if ((i < params.length) && params[i] == "in") {
 i++;
 if (i >= params.length) {
 this.handleError(place, "TiddlyWiki path expected behind 'in'.");
 return;
 }
 tiddlyWikiPath = this.paramEncode((i < params.length) ? params[i] : "");
 i++;
 }

 // Parse the where clause
 var whereClause ="true";
 if ((i < params.length) && params[i] == "where") {
 i++;
 whereClause = this.paramEncode((i < params.length) ? params[i] : "");
 i++;
 }

 // Parse the sort stuff
 var sortClause = null;
 var sortAscending = true; 
 if ((i < params.length) && params[i] == "sortBy") {
 i++;
 if (i >= params.length) {
 this.handleError(place, "sortClause missing behind 'sortBy'.");
 return;
 }
 sortClause = this.paramEncode(params[i]);
 i++;

 if ((i < params.length) && (params[i] == "ascending" || params[i] == "descending")) {
 sortAscending = params[i] == "ascending";
 i++;
 }
 }

 // Parse the script
 var scriptText = null;
 if ((i < params.length) && params[i] == "script") {
 i++;
 scriptText = this.paramEncode((i < params.length) ? params[i] : "");
 i++;
 }

 // Parse the action. 
 // When we are already at the end use the default action
 var actionName = "addToList";
 if (i < params.length) {
 if (!config.macros.forEachTiddler.actions[params[i]]) {
 this.handleError(place, "Unknown action '"+params[i]+"'.");
 return;
 } else {
 actionName = params[i]; 
 i++;
 }
 } 
 
 // Get the action parameter
 // (the parsing is done inside the individual action implementation.)
 var actionParameter = params.slice(i);


 // --- Processing ------------------------------------------
 try {
 this.performMacro({
 place: place, 
 inTiddler: tiddler,
 whereClause: whereClause, 
 sortClause: sortClause, 
 sortAscending: sortAscending, 
 actionName: actionName, 
 actionParameter: actionParameter, 
 scriptText: scriptText, 
 tiddlyWikiPath: tiddlyWikiPath});

 } catch (e) {
 this.handleError(place, e);
 }
};

// Returns an object with properties "tiddlers" and "context".
// tiddlers holds the (sorted) tiddlers selected by the parameter,
// context the context of the execution of the macro.
//
// The action is not yet performed.
//
// @parameter see performMacro
//
config.macros.forEachTiddler.getTiddlersAndContext = function(parameter) {

 var context = config.macros.forEachTiddler.createContext(parameter.place, parameter.whereClause, parameter.sortClause, parameter.sortAscending, parameter.actionName, parameter.actionParameter, parameter.scriptText, parameter.tiddlyWikiPath, parameter.inTiddler);

 var tiddlyWiki = parameter.tiddlyWikiPath ? this.loadTiddlyWiki(parameter.tiddlyWikiPath) : store;
 context["tiddlyWiki"] = tiddlyWiki;
 
 // Get the tiddlers, as defined by the whereClause
 var tiddlers = this.findTiddlers(parameter.whereClause, context, tiddlyWiki);
 context["tiddlers"] = tiddlers;

 // Sort the tiddlers, when sorting is required.
 if (parameter.sortClause) {
 this.sortTiddlers(tiddlers, parameter.sortClause, parameter.sortAscending, context);
 }

 return {tiddlers: tiddlers, context: context};
};

// Returns the (sorted) tiddlers selected by the parameter.
//
// The action is not yet performed.
//
// @parameter see performMacro
//
config.macros.forEachTiddler.getTiddlers = function(parameter) {
 return this.getTiddlersAndContext(parameter).tiddlers;
};

// Performs the macros with the given parameter.
//
// @param parameter holds the parameter of the macro as separate properties.
// The following properties are supported:
//
// place
// whereClause
// sortClause
// sortAscending
// actionName
// actionParameter
// scriptText
// tiddlyWikiPath
//
// All properties are optional. 
// For most actions the place property must be defined.
//
config.macros.forEachTiddler.performMacro = function(parameter) {
 var tiddlersAndContext = this.getTiddlersAndContext(parameter);

 // Perform the action
 var actionName = parameter.actionName ? parameter.actionName : "addToList";
 var action = config.macros.forEachTiddler.actions[actionName];
 if (!action) {
 this.handleError(parameter.place, "Unknown action '"+actionName+"'.");
 return;
 }

 var actionHandler = action.handler;
 actionHandler(parameter.place, tiddlersAndContext.tiddlers, parameter.actionParameter, tiddlersAndContext.context);
};

// ---------------------------------------------------------------------------
// The actions 
// ---------------------------------------------------------------------------

// Internal.
//
// --- The addToList Action -----------------------------------------------
//
config.macros.forEachTiddler.actions.addToList.handler = function(place, tiddlers, parameter, context) {
 // Parse the parameter
 var p = 0;

 // Check for extra parameters
 if (parameter.length > p) {
 config.macros.forEachTiddler.createExtraParameterErrorElement(place, "addToList", parameter, p);
 return;
 }

 // Perform the action.
 var list = document.createElement("ul");
 place.appendChild(list);
 for (var i = 0; i < tiddlers.length; i++) {
 var tiddler = tiddlers[i];
 var listItem = document.createElement("li");
 list.appendChild(listItem);
 createTiddlyLink(listItem, tiddler.title, true);
 }
};

// Internal.
//
// --- The write Action ---------------------------------------------------
//
config.macros.forEachTiddler.actions.write.handler = function(place, tiddlers, parameter, context) {
 // Parse the parameter
 var p = 0;
 if (p >= parameter.length) {
 this.handleError(place, "Missing expression behind 'write'.");
 return;
 }

 var textExpression = config.macros.forEachTiddler.paramEncode(parameter[p]);
 p++;

 // Parse the "toFile" option
 var filename = null;
 var lineSeparator = undefined;
 if ((p < parameter.length) && parameter[p] == "toFile") {
 p++;
 if (p >= parameter.length) {
 this.handleError(place, "Filename expected behind 'toFile' of 'write' action.");
 return;
 }
 
 filename = config.macros.forEachTiddler.getLocalPath(config.macros.forEachTiddler.paramEncode(parameter[p]));
 p++;
 if ((p < parameter.length) && parameter[p] == "withLineSeparator") {
 p++;
 if (p >= parameter.length) {
 this.handleError(place, "Line separator text expected behind 'withLineSeparator' of 'write' action.");
 return;
 }
 lineSeparator = config.macros.forEachTiddler.paramEncode(parameter[p]);
 p++;
 }
 }
 
 // Check for extra parameters
 if (parameter.length > p) {
 config.macros.forEachTiddler.createExtraParameterErrorElement(place, "write", parameter, p);
 return;
 }

 // Perform the action.
 var func = config.macros.forEachTiddler.getEvalTiddlerFunction(textExpression, context);
 var count = tiddlers.length;
 var text = "";
 for (var i = 0; i < count; i++) {
 var tiddler = tiddlers[i];
 text += func(tiddler, context, count, i);
 }
 
 if (filename) {
 if (lineSeparator !== undefined) {
 lineSeparator = lineSeparator.replace(/\\n/mg, "\n").replace(/\\r/mg, "\r");
 text = text.replace(/\n/mg,lineSeparator);
 }
 saveFile(filename, convertUnicodeToUTF8(text));
 } else {
 var wrapper = createTiddlyElement(place, "span");
 wikify(text, wrapper, null/* highlightRegExp */, context.inTiddler);
 }
};


// ---------------------------------------------------------------------------
// Helpers
// ---------------------------------------------------------------------------

// Internal.
//
config.macros.forEachTiddler.createContext = function(placeParam, whereClauseParam, sortClauseParam, sortAscendingParam, actionNameParam, actionParameterParam, scriptText, tiddlyWikiPathParam, inTiddlerParam) {
 return {
 place : placeParam, 
 whereClause : whereClauseParam, 
 sortClause : sortClauseParam, 
 sortAscending : sortAscendingParam, 
 script : scriptText,
 actionName : actionNameParam, 
 actionParameter : actionParameterParam,
 tiddlyWikiPath : tiddlyWikiPathParam,
 inTiddler : inTiddlerParam
 };
};

// Internal.
//
// Returns a TiddlyWiki with the tiddlers loaded from the TiddlyWiki of 
// the given path.
//
config.macros.forEachTiddler.loadTiddlyWiki = function(path, idPrefix) {
 if (!idPrefix) {
 idPrefix = "store";
 }
 var lenPrefix = idPrefix.length;
 
 // Read the content of the given file
 var content = loadFile(this.getLocalPath(path));
 if(content === null) {
 throw "TiddlyWiki '"+path+"' not found.";
 }
 
 // Locate the storeArea div's
 var posOpeningDiv = content.indexOf(startSaveArea);
 var posClosingDiv = content.lastIndexOf(endSaveArea);
 if((posOpeningDiv == -1) || (posClosingDiv == -1)) {
 throw "File '"+path+"' is not a TiddlyWiki.";
 }
 var storageText = content.substr(posOpeningDiv + startSaveArea.length, posClosingDiv);
 
 // Create a "div" element that contains the storage text
 var myStorageDiv = document.createElement("div");
 myStorageDiv.innerHTML = storageText;
 myStorageDiv.normalize();
 
 // Create all tiddlers in a new TiddlyWiki
 // (following code is modified copy of TiddlyWiki.prototype.loadFromDiv)
 var tiddlyWiki = new TiddlyWiki();
 var store = myStorageDiv.childNodes;
 for(var t = 0; t < store.length; t++) {
 var e = store[t];
 var title = null;
 if(e.getAttribute)
 title = e.getAttribute("tiddler");
 if(!title && e.id && e.id.substr(0,lenPrefix) == idPrefix)
 title = e.id.substr(lenPrefix);
 if(title && title !== "") {
 var tiddler = tiddlyWiki.createTiddler(title);
 tiddler.loadFromDiv(e,title);
 }
 }
 tiddlyWiki.dirty = false;

 return tiddlyWiki;
};


 
// Internal.
//
// Returns a function that has a function body returning the given javaScriptExpression.
// The function has the parameters:
// 
// (tiddler, context, count, index)
//
config.macros.forEachTiddler.getEvalTiddlerFunction = function (javaScriptExpression, context) {
 var script = context["script"];
 var functionText = "var theFunction = function(tiddler, context, count, index) { return "+javaScriptExpression+"}";
 var fullText = (script ? script+";" : "")+functionText+";theFunction;";
 return eval(fullText);
};

// Internal.
//
config.macros.forEachTiddler.findTiddlers = function(whereClause, context, tiddlyWiki) {
 var result = [];
 var func = config.macros.forEachTiddler.getEvalTiddlerFunction(whereClause, context);
 tiddlyWiki.forEachTiddler(function(title,tiddler) {
 if (func(tiddler, context, undefined, undefined)) {
 result.push(tiddler);
 }
 });
 return result;
};

// Internal.
//
config.macros.forEachTiddler.createExtraParameterErrorElement = function(place, actionName, parameter, firstUnusedIndex) {
 var message = "Extra parameter behind '"+actionName+"':";
 for (var i = firstUnusedIndex; i < parameter.length; i++) {
 message += " "+parameter[i];
 }
 this.handleError(place, message);
};

// Internal.
//
config.macros.forEachTiddler.sortAscending = function(tiddlerA, tiddlerB) {
 var result = 
 (tiddlerA.forEachTiddlerSortValue == tiddlerB.forEachTiddlerSortValue) 
 ? 0
 : (tiddlerA.forEachTiddlerSortValue < tiddlerB.forEachTiddlerSortValue)
 ? -1 
 : +1; 
 return result;
};

// Internal.
//
config.macros.forEachTiddler.sortDescending = function(tiddlerA, tiddlerB) {
 var result = 
 (tiddlerA.forEachTiddlerSortValue == tiddlerB.forEachTiddlerSortValue) 
 ? 0
 : (tiddlerA.forEachTiddlerSortValue < tiddlerB.forEachTiddlerSortValue)
 ? +1 
 : -1; 
 return result;
};

// Internal.
//
config.macros.forEachTiddler.sortTiddlers = function(tiddlers, sortClause, ascending, context) {
 // To avoid evaluating the sortClause whenever two items are compared 
 // we pre-calculate the sortValue for every item in the array and store it in a 
 // temporary property ("forEachTiddlerSortValue") of the tiddlers.
 var func = config.macros.forEachTiddler.getEvalTiddlerFunction(sortClause, context);
 var count = tiddlers.length;
 var i;
 for (i = 0; i < count; i++) {
 var tiddler = tiddlers[i];
 tiddler.forEachTiddlerSortValue = func(tiddler,context, undefined, undefined);
 }

 // Do the sorting
 tiddlers.sort(ascending ? this.sortAscending : this.sortDescending);

 // Delete the temporary property that holds the sortValue. 
 for (i = 0; i < tiddlers.length; i++) {
 delete tiddlers[i].forEachTiddlerSortValue;
 }
};


// Internal.
//
config.macros.forEachTiddler.trace = function(message) {
 displayMessage(message);
};

// Internal.
//
config.macros.forEachTiddler.traceMacroCall = function(place,macroName,params) {
 var message ="<<"+macroName;
 for (var i = 0; i < params.length; i++) {
 message += " "+params[i];
 }
 message += ">>";
 displayMessage(message);
};


// Internal.
//
// Creates an element that holds an error message
// 
config.macros.forEachTiddler.createErrorElement = function(place, exception) {
 var message = (exception.description) ? exception.description : exception.toString();
 return createTiddlyElement(place,"span",null,"forEachTiddlerError","<<forEachTiddler ...>>: "+message);
};

// Internal.
//
// @param place [may be null]
//
config.macros.forEachTiddler.handleError = function(place, exception) {
 if (place) {
 this.createErrorElement(place, exception);
 } else {
 throw exception;
 }
};

// Internal.
//
// Encodes the given string.
//
// Replaces 
// "$))" to ">>"
// "$)" to ">"
//
config.macros.forEachTiddler.paramEncode = function(s) {
 var reGTGT = new RegExp("\\$\\)\\)","mg");
 var reGT = new RegExp("\\$\\)","mg");
 return s.replace(reGTGT, ">>").replace(reGT, ">");
};

// Internal.
//
// Returns the given original path (that is a file path, starting with "file:")
// as a path to a local file, in the systems native file format.
//
// Location information in the originalPath (i.e. the "#" and stuff following)
// is stripped.
// 
config.macros.forEachTiddler.getLocalPath = function(originalPath) {
 // Remove any location part of the URL
 var hashPos = originalPath.indexOf("#");
 if(hashPos != -1)
 originalPath = originalPath.substr(0,hashPos);
 // Convert to a native file format assuming
 // "file:///x:/path/path/path..." - pc local file --> "x:\path\path\path..."
 // "file://///server/share/path/path/path..." - FireFox pc network file --> "\\server\share\path\path\path..."
 // "file:///path/path/path..." - mac/unix local file --> "/path/path/path..."
 // "file://server/share/path/path/path..." - pc network file --> "\\server\share\path\path\path..."
 var localPath;
 if(originalPath.charAt(9) == ":") // pc local file
 localPath = unescape(originalPath.substr(8)).replace(new RegExp("/","g"),"\\");
 else if(originalPath.indexOf("file://///") === 0) // FireFox pc network file
 localPath = "\\\\" + unescape(originalPath.substr(10)).replace(new RegExp("/","g"),"\\");
 else if(originalPath.indexOf("file:///") === 0) // mac/unix local file
 localPath = unescape(originalPath.substr(7));
 else if(originalPath.indexOf("file:/") === 0) // mac/unix local file
 localPath = unescape(originalPath.substr(5));
 else // pc network file
 localPath = "\\\\" + unescape(originalPath.substr(7)).replace(new RegExp("/","g"),"\\"); 
 return localPath;
};

// ---------------------------------------------------------------------------
// Stylesheet Extensions (may be overridden by local StyleSheet)
// ---------------------------------------------------------------------------
//
setStylesheet(
 ".forEachTiddlerError{color: #ffffff;background-color: #880000;}",
 "forEachTiddler");

//============================================================================
// End of forEachTiddler Macro
//============================================================================


//============================================================================
// String.startsWith Function
//============================================================================
//
// Returns true if the string starts with the given prefix, false otherwise.
//
version.extensions["String.startsWith"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
String.prototype.startsWith = function(prefix) {
 var n = prefix.length;
 return (this.length >= n) && (this.slice(0, n) == prefix);
};



//============================================================================
// String.endsWith Function
//============================================================================
//
// Returns true if the string ends with the given suffix, false otherwise.
//
version.extensions["String.endsWith"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
String.prototype.endsWith = function(suffix) {
 var n = suffix.length;
 return (this.length >= n) && (this.right(n) == suffix);
};


//============================================================================
// String.contains Function
//============================================================================
//
// Returns true when the string contains the given substring, false otherwise.
//
version.extensions["String.contains"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
String.prototype.contains = function(substring) {
 return this.indexOf(substring) >= 0;
};

//============================================================================
// Array.indexOf Function
//============================================================================
//
// Returns the index of the first occurance of the given item in the array or 
// -1 when no such item exists.
//
// @param item [may be null]
//
version.extensions["Array.indexOf"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
Array.prototype.indexOf = function(item) {
 for (var i = 0; i < this.length; i++) {
 if (this[i] == item) {
 return i;
 }
 }
 return -1;
};

//============================================================================
// Array.contains Function
//============================================================================
//
// Returns true when the array contains the given item, otherwise false. 
//
// @param item [may be null]
//
version.extensions["Array.contains"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
Array.prototype.contains = function(item) {
 return (this.indexOf(item) >= 0);
};

//============================================================================
// Array.containsAny Function
//============================================================================
//
// Returns true when the array contains at least one of the elements 
// of the item. Otherwise (or when items contains no elements) false is returned.
//
version.extensions["Array.containsAny"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
Array.prototype.containsAny = function(items) {
 for(var i = 0; i < items.length; i++) {
 if (this.contains(items[i])) {
 return true;
 }
 }
 return false;
};


//============================================================================
// Array.containsAll Function
//============================================================================
//
// Returns true when the array contains all the items, otherwise false.
// 
// When items is null false is returned (even if the array contains a null).
//
// @param items [may be null] 
//
version.extensions["Array.containsAll"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
Array.prototype.containsAll = function(items) {
 for(var i = 0; i < items.length; i++) {
 if (!this.contains(items[i])) {
 return false;
 }
 }
 return true;
};


} // of "install only once"

// Used Globals (for JSLint) ==============
// ... DOM
/*global document */
// ... TiddlyWiki Core
/*global convertUnicodeToUTF8, createTiddlyElement, createTiddlyLink, 
 displayMessage, endSaveArea, hasClass, loadFile, saveFile, 
 startSaveArea, store, wikify */
//}}}


/***
!Licence and Copyright
Copyright (c) abego Software ~GmbH, 2005 ([[www.abego-software.de|http://www.abego-software.de]])

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.

Neither the name of abego Software nor the names of its contributors may be
used to endorse or promote products derived from this software without specific
prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
***/

|!Effect|!To get|!Type this|h
|BoldText|''Bold''|{{{''Bold''}}}|
|UnderlinedText|__Underline__|{{{__Underline__}}}|
|ItalicText|//Italic//|{{{//Italic//}}}|
|InlineHTML|<html><p align="right">right-aligned text</p></html>|{{{<html><p align="right">right-aligned text</p></html>}}}|
|CamelCase|CamelCase links|{{{CamelCase links}}}|
|TiddlyLinks|[[Simple links]]|{{{[[Simple links]]}}}|
|AliasTiddlyLinks|[[Alias to Tiddly links|Tiddly links]]|{{{[[Alias to Tiddly links|Tiddly links]]}}}|
|ExternalLinks|http://www.tiddlywiki.com |{{{http://www.tiddlywiki.com}}} |
|AliasExternalLinks|[[Tiddly Wiki|http://www.tiddywiki.com]]|{{{[[Tiddly Wiki|http://www.tiddlywiki.com]]}}} |
|RedirectLinks|<<redirect TW TiddlyWiki>>|{{{<<redirect TW TiddlyWiki>>}}} redirects [[TW]] to TiddlyWiki|
|SuperScript|e2^^ <html>&pi;</html> i^^ = 1|{{{e2^^ <html>&pi;</html> i^^ = 1}}}|
|SubScript|a~~ij~~ = - a~~ji~~|{{{a~~ii~~ = - a~~ji~~}}}|
|StrikeThrough|==Strikethrough==|{{{==Strikethrough==}}} - not working on GR's browser|
||<html><s>Strikethrough</s></html>|{{{<html><s>Strikethrough</s></html>}}} - alternate method|
|HighlightedText|@@highlight@@|{{{@@highlight@@}}}|
|StyledText|@@font-family:comic sans ms;Comic sans MS@@|{{{@@font-family:comic sans ms;Comic sans MS@@}}}|
||@@font-size:120%;font-weight:bold;larger font, in bold@@|{{{@@font-size:120%;font-weight:bold;larger font, in bold@@}}}|
|OldStyle|@@color(#ffffff):bgcolor(#ff0000):white text, red background@@|{{{@@color(#ffffff):bgcolor(#ff0000):white text, red background@@}}}}|
||@@color(#00ff00):bgcolor(#000000):green text, black background@@|{{{@@color(#00ff00):bgcolor(#000000):green text, black background@@}}}|
|HiddenText|/%hidden comments%/|{{{/%hidden comments%/}}}|
|BlockQuotes||{{{<<< ... <<< }}}|
|[[MultiLevel BlockQuote]]||{{{> >> >>>}}} etc. at beginning of line|
|[[Bullets]]||{{{* ** ***}}} etc. at beginning of line|
|NumberedBullets||{{{# ## ###}}} etc. at beginning of line|
|[[Tables]]||{{{|}}} .... {{{|}}} separates cells|
|[[CellAlignment|left|{{{|left|}}}|
|| center |{{{| center |}}}|
|| right|{{{| right|}}}|
|RowAlignment\n\n||top?|
|||middle?|
|||bottom?|
|[[HeaderRows||{{{|h}}} at end of row|h
|SubHeadings||{{{! !! !!!}}} etc. at beginning of line|
|InvokeMacro|''importTiddlers'' macro|{{{<<importTiddlers>>}}}|

''Double-click'' on this tiddler to see more detail, or follow the links to the specific formatting types.

''Note'' this needs some additional editing / revision - and addressing the question of consistent / clear naming of the specific formatting types (in left column) and ideally a consistent format for each formatting type. Also, needs correct coding for RowAlignment
Friendship, in its truest form, requires nothing from a friend, except their friendship. True friendship transcends time. I have some friends that I see but once or twice a year, but they endure and are strong. Some, I see more often, and they too are strong.

Why? We expect nothing more from each other. At the core, there is confidence. In a truly strong friendship, you have absolute confidence in that friendship at all times. If there is doubt, then that friendship is not strong, and we are in denial.

My truest and dearest friends (and you know who you are, for you are in my thoughts always) know that they are with me in thought, in heart, even when I cannot be in body. I am but a phone call, a quick drive, or a simple email saying hi, away. When we are together, there is no awkwardness, no pregnant pauses that feel uncomfortable. We are open with each other. When we are apart, there is a sense of "missing", but not a sense of "loss".

My wife, my daughter, my daughter's mother, and my soul brothers and sisters, you are all my friends, my family, you are me, and make me who I am and who I want to be. We know that we are strongly connected, not by love, not by philosophy....but by the bond of confidence and trust in each other
/***
|Name|FullScreenPlugin|
|Created by|SaqImtiaz|
|Location|http://lewcid.googlepages.com/lewcid.html#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:" ↕ ",
 tooltip:"Fullscreen mode"
};

config.commands.fullscreen.handler = function (event,src,title)
{
 if (lewcidFullScreen == false)
 {
 lewcidFullScreen = true;
 setStylesheet('#sidebar, .header, #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]||" ? ";
 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();
}
//}}}
<<closeAll>><<permaview>><<newTiddler>><<newJournal 'DD MMM YYYY'>><<saveChanges>><<slider chkSliderOptionsPanel OptionsPanel 'options »' 'Change TiddlyWiki advanced options'>>
/***
| Name:|HideWhenPlugin|
| Description:|Allows conditional inclusion/exclusion in templates|
| Version:|6.1.2|
| Date:|20-Oct-2006|
| Source:|http://mptw.tiddlyspot.com/#HideWhenPlugin|
| Author:|Simon Baird <simon.baird@gmail.com>|
For use in ViewTemplate and EditTemplate. Eg
{{{<div macro="showWhenTagged Task">[[TaskToolbar]]</div>}}}
{{{<div macro="showWhen tiddler.modifier == 'BartSimpson'"><img src="bart.gif"/></div>}}}
***/
//{{{

window.removeElementWhen = function(test,place) {
 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);
 }},

 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);
 }}

});

//}}}

<<top>><<icon top.bmp 16 16>>
<<toggleSideBar>><<icon toggle.bmp 16 16>>
<<jump j '' top>><<icon jump.bmp 16 16>>
<<fullscreen f>><<icon full.bmp 16 16>>
<<saveChanges>><<icon save.bmp 16 16>>
<<newTiddler>><<icon new.bmp 16 16>>
/***
|Name|HoverMenuPlugin|
|Created by|SaqImtiaz|
|Location|http://lewcid.googlepages.com/lewcid.html#HoverMenuPlugin|
|Version|1.11|
|Requires|~TW2.x|
!Description:
Provides a hovering menu on the edge of the screen for commonly used commands, that scrolls with the page.

!Demo:
Observe the hovering menu on the right edge of the screen.

!Installation:
Copy the contents of this tiddler to your TW, tag with systemConfig, save and reload your TW.
To customize your HoverMenu, edit the HoverMenu shadow tiddler.

To customize whether the menu sticks to the right or left edge of the screen, and its start position, edit the HoverMenu configuration settings part of the code below. It's well documented, so don't be scared!

The menu has an id of hoverMenu, in case you want to style the buttons in it using css.

!Notes:
Since the default HoverMenu contains buttons for toggling the side bar and jumping to the top of the screen and to open tiddlers, the ToggleSideBarMacro, JumpMacro and the JumpToTopMacro are included in this tiddler, so you dont need to install them separately. Having them installed separately as well could lead to complications.

If you dont intend to use these three macros at all, feel free to remove those sections of code in this tiddler.

!To Do:
* rework code to allow multiple hovering menus in different positions, horizontal etc.
* incorporate code for keyboard shortcuts that correspond to the buttons in the hovermenu

!History:
*03-08-06, ver 1.1.2: compatibility fix with SelectThemePlugin
*03-08-06, ver 1.11: fixed error with button tooltips
*27-07-06, ver 1.1 : added JumpMacro to hoverMenu
*23-07-06

!Code
***/

/***
start HoverMenu plugin code
***/
//{{{
config.hoverMenu={};
//}}}

/***
HoverMenu configuration settings
***/
//{{{
config.hoverMenu.settings={
 align: 'right', //align menu to right or left side of screen, possible values are 'right' and 'left' 
 x: 1, // horizontal distance of menu from side of screen, increase to your liking.
 y: 158 //vertical distance of menu from top of screen at start, increase or decrease to your liking
 };
//}}}

//{{{
//continue HoverMenu plugin code
config.hoverMenu.handler=function()
{ 
 if (!document.getElementById("hoverMenu"))
 {
 var theMenu = createTiddlyElement(document.getElementById("contentWrapper"), "div","hoverMenu");
 theMenu.setAttribute("refresh","content");
 theMenu.setAttribute("tiddler","HoverMenu");
 var menuContent = store.getTiddlerText("HoverMenu");
 wikify(menuContent,theMenu);
 }

 var Xloc = this.settings.x;
 Yloc =this.settings.y;
 var ns = (navigator.appName.indexOf("Netscape") != -1);
 function SetMenu(id)
 {
 var GetElements=document.getElementById?document.getElementById(id):document.all?document.all[id]:document.layers[id];
 if(document.layers)GetElements.style=GetElements;
 GetElements.sP=function(x,y){this.style[config.hoverMenu.settings.align]=x +"px";this.style.top=y +"px";};
 GetElements.x = Xloc;
 GetElements.y = findScrollY();
 GetElements.y += Yloc;
 return GetElements;
 }
 window.LoCate_XY=function()
 {
 var pY = findScrollY();
 ftlObj.y += (pY + Yloc - ftlObj.y)/15;
 ftlObj.sP(ftlObj.x, ftlObj.y);
 setTimeout("LoCate_XY()", 10);
 }
 ftlObj = SetMenu("hoverMenu");
 LoCate_XY();
};

window.old_lewcid_hovermenu_restart = restart;
restart = function()
{
 window.old_lewcid_hovermenu_restart();
 config.hoverMenu.handler();
};

setStylesheet(
"#hoverMenu .imgLink, #hoverMenu .imgLink:hover {border:none; padding:0px; float:right; margin-bottom:2px; margin-top:0px;}\n"+
"#hoverMenu .button, #hoverMenu .tiddlyLink {border:none; font-weight:bold; background:#18f; color:#FFF; padding:0 5px; float:right; margin-bottom:4px;}\n"+
"#hoverMenu .button:hover, #hoverMenu .tiddlyLink:hover {font-weight:bold; border:none; color:#fff; background:#000; padding:0 5px; float:right; margin-bottom:4px;}\n"+
"#hoverMenu .button {width:100%; text-align:center}"+
"#hoverMenu { position:absolute; width:7px;}\n"+
"\n","hoverMenuStyles");


config.macros.renameButton={};
config.macros.renameButton.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{

 if (place.lastChild.tagName!="BR")
 {
 place.lastChild.firstChild.data = params[0];
 if (params[1]) {place.lastChild.title = params[1];}
 }
};

config.shadowTiddlers["HoverMenu"]="<<top>>\n<<toggleSideBar>><<renameButton '>' >>\n<<jump j '' top>>\n<<saveChanges>><<renameButton s 'Save TiddlyWiki'>>\n<<newTiddler>><<renameButton n>>\n";
//}}}
//end HoverMenu plugin code

//Start ToggleSideBarMacro code
//{{{
config.macros.toggleSideBar={};

config.macros.toggleSideBar.settings={
 styleHide : "#sidebar { display: none;}\n"+"#contentWrapper #displayArea { margin-right: 1em;}\n"+"",
 styleShow : " ",
 arrow1: "�",
 arrow2: "�"
};

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");
//}}}
//end ToggleSideBarMacro code

//start JumpToTopMacro code
//{{{
config.macros.top={};
config.macros.top.handler=function(place,macroName)
{
 createTiddlyButton(place,"^","jump to top",this.onclick);
}
config.macros.top.onclick=function()
{
 window.scrollTo(0,0);
};

config.commands.top =
{
 text:" ^ ",
 tooltip:"jump to top"
};

config.commands.top.handler = function(event,src,title)
{
 window.scrollTo(0,0);
}
//}}}
//end JumpToStartMacro code

//start JumpMacro code
//{{{
config.macros.jump= {};
config.macros.jump.handler = function (place,macroName,params,wikifier,paramString,tiddler)
{
 var label = (params[0] && params[0]!=".")? params[0]: 'jump';
 var tooltip = (params[1] && params[1]!=".")? params[1]: 'jump to an open tiddler';
 var top = (params[2] && params[2]=='top') ? true: false; 

 var btn =createTiddlyButton(place,label,tooltip,this.onclick);
 if (top==true)
 btn.setAttribute("top","true")
}

config.macros.jump.onclick = function(e)
{
 if (!e) var e = window.event;
 var theTarget = resolveTarget(e);
 var top = theTarget.getAttribute("top");
 var popup = Popup.create(this);
 if(popup)
 {
 if(top=="true")
 {createTiddlyButton(createTiddlyElement(popup,"li"),'Top ?','Top of TW',config.macros.jump.top);
 createTiddlyElement(popup,"hr");}
 
 story.forEachTiddler(function(title,element) {
 createTiddlyLink(createTiddlyElement(popup,"li"),title,true);
 });
 }
 Popup.show(popup,false);
 e.cancelBubble = true;
 if (e.stopPropagation) e.stopPropagation();
 return false;
}

config.macros.jump.top = function()
{
 window.scrollTo(0,0);
}
//}}}
//end JumpMacro code

//utility functions
//{{{
Popup.show = function(unused,slowly)
{
 var curr = Popup.stack[Popup.stack.length-1];
 var rootLeft = findPosX(curr.root);
 var rootTop = findPosY(curr.root);
 var rootHeight = curr.root.offsetHeight;
 var popupLeft = rootLeft;
 var popupTop = rootTop + rootHeight;
 var popupWidth = curr.popup.offsetWidth;
 var winWidth = findWindowWidth();
 if (isChild(curr.root,'hoverMenu'))
 var x = config.hoverMenu.settings.x;
 else
 var x = 0;
 if(popupLeft + popupWidth+x > winWidth)
 popupLeft = winWidth - popupWidth -x;
 if (isChild(curr.root,'hoverMenu'))
 {curr.popup.style.right = x + "px";}
 else
 curr.popup.style.left = popupLeft + "px";
 curr.popup.style.top = popupTop + "px";
 curr.popup.style.display = "block";
 addClass(curr.root,"highlight");
 if(config.options.chkAnimate)
 anim.startAnimating(new Scroller(curr.popup,slowly));
 else
 window.scrollTo(0,ensureVisible(curr.popup));
}

window.isChild = function(e,parentId) {
 while (e != null) {
 var parent = document.getElementById(parentId);
 if (parent == e) return true;
 e = e.parentNode;
 }
 return false;
};
//}}}


//{{{
// version: beta 1.1
//replace macro buttons with icons
// params[0] = image location
//params[1] = image width
//params[2] = image height
//params[3] = image title (optional)
config.macros.icon={};
config.macros.icon.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{

 if (place.lastChild.tagName!="BR")
 {
 var tempTitle = place.lastChild.firstChild.title;
 removeChildren(place.lastChild);
 place.lastChild.className = "imgLink";
 var img = createTiddlyElement(place.lastChild,"img");
 img.src = params[0];
 if (params[3])
 img.title = params[3];
 img.width= params[1];
 img.height =params[2];
 }
};

//use icons for toolbar commands.
// used in view template like:
// <span macro='commandIcon jump jump.bmp'></span>
//params[0] = command name
//params[1] = image location
config.macros.commandIcon={};
config.macros.commandIcon.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{if(!e) var e = window.event;
 var img = createTiddlyElement(place,"img",null,"toolbarImg");
 img.src = params[1];
 img.onclick = function(){config.commands[params[0]].handler(e,place,story.findContainingTiddler(place).getAttribute("tiddler"));};
 img.title = config.commands[params[0]].tooltip;
}

setStylesheet(".toolbarImg {vertical-align: middle; cursor:pointer;}\n","commandIconStyles"); 

//}}}
/***
''InlineJavascriptPlugin for ~TiddlyWiki version 1.2.x and 2.0''
^^author: Eric Shulman - ELS Design Studios
source: http://www.TiddlyTools.com/#InlineJavascriptPlugin
license: [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]^^

Insert Javascript executable code directly into your tiddler content. Lets you ''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.

''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:
><script show>
 alert('InlineJavascriptPlugin: this is a demonstration message');
</script>
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" 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
<<<
''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: 5, revision: 1, date: new Date(2006,6,1)};

config.formatters.push( {
 name: "inlineJavascript",
 match: "\\<script",
 lookahead: "\\<script(?: src=\\\"((?:.|\\n)*?)\\\")?(?: label=\\\"((?:.|\\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[4]) { // there is script code
 if (lookaheadMatch[3]) // 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[4]+"};_out(this);"
 link.setAttribute("href","javascript:;"); link.setAttribute("title",""); link.style.cursor="pointer";
 }
 else { // run inline script code
 var code="function _out(place){"+lookaheadMatch[4]+"};_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;
 }
 }
} )
//}}}
When you think you have arrived at your destination, and that you have no further to go...look again.  If your path appears to be complete...your way has been lost.

Make another choice.
/***
|Name|JumpMacro|
|Created by|SaqImtiaz|
|Location|http://lewcid.googlepages.com/lewcid.html#JumpMacro|
|Version|1.0|
|Requires|~TW2.x|
!Description:
Macro version of the core jump command, that also provides an optional 'jump to top' button.

!Demo:
click the 'j' button in the hoverMenu on the right.

!Installation:
Copy the contents of this tiddler to your TW, tag with systemConfig, save and reload your TW.

!Usage
{{{<<jump>>}}}<<jump>>
{{{<<jump customlabel customtooltip top>>}}} <<jump customlabel customtooltip top>>
Note: passing the third parameter as top, enables the 'top' button in the dropdown.

!History:
27-07-06, ver1.0

!Code
***/

//{{{
config.macros.jump= {};
config.macros.jump.handler = function (place,macroName,params,wikifier,paramString,tiddler)
{
 var label = (params[0] && params[0]!=".")? params[0]: 'jump';
 var tooltip = (params[1] && params[1]!=".")? params[1]: 'jump to an open tiddler';
 var top = (params[2] && params[2]=='top') ? true: false; 

 var btn =createTiddlyButton(place,label,tooltip,this.onclick);
 if (top==true)
 btn.setAttribute("top","true")
}

config.macros.jump.onclick = function(e)
{
 if (!e) var e = window.event;
 var theTarget = resolveTarget(e);
 var top = theTarget.getAttribute("top");
 var popup = Popup.create(this);
 if(popup)
 {
 if(top=="true")
 {createTiddlyButton(createTiddlyElement(popup,"li"),'Top ?','Top of TW',config.macros.jump.top);
 createTiddlyElement(popup,"hr");}
 
 story.forEachTiddler(function(title,element) {
 createTiddlyLink(createTiddlyElement(popup,"li"),title,true);
 });
 }
 Popup.show(popup,false);
 e.cancelBubble = true;
 if (e.stopPropagation) e.stopPropagation();
 return false;
}

config.macros.jump.top = function()
{
 window.scrollTo(0,0);
}
//}}}
/***
|Name|JumpToTopMacro|
|Created by|SaqImtiaz|
|Location|http://lewcid.googlepages.com/lewcid.html#JumpToTopMacro|
|Version|1.0|
|Requires|~TW2.x|
!Description:
Provides a toolbar command and a macro, that create a button for quickly jumping to the top of your TW.
Handy to place in the tiddler toolbar (edit the ViewTemplate)

Note: You can add an extra toolbar to the bottom of tiddlers as well with buttons of your choice, to allow easy access to the buttons/commands in it.

!Demo:
{{{<<top>>}}}<<top>>

!Installation:
Copy the contents of this tiddler to your TW, tag with systemConfig, save and reload your TW.

!History:
*23-07-06: ver 1.0

!Code
***/
//{{{
config.macros.top={};
config.macros.top.handler=function(place,macroName)
{
 createTiddlyButton(place,"^","jump to top",this.onclick);
}
config.macros.top.onclick=function()
{
 window.scrollTo(0,0);
};

config.commands.top =
{
 text:" ^ ",
 tooltip:"jump to top"
};

config.commands.top.handler = function(event,src,title)
{
 window.scrollTo(0,0);
}
//}}}
function OnKeyPress(event)
{
if ((event==null) && (!window.event)) { return; }
if ((event!=null) && (window.event)) { return; }
if(!event)var event = window.event;

var KeyCode = event.keyCode ? event.keyCode : event.which;


if ((KeyCode == 83 || KeyCode == 115) && event.ctrlKey && !event.shiftKey)
{
saveChanges();
killEvent(event);
}

else if ((KeyCode == 117 || KeyCode == 85) && event.ctrlKey && !event.shiftKey)
{
config.macros.top.onclick();
killEvent(event);
}

else if ((KeyCode == 110 || KeyCode == 78) && event.ctrlKey && !event.shiftKey)
{
config.macros.newTiddler.onClick();
killEvent(event);
}

else if ((KeyCode == 122 || KeyCode == 90) && event.ctrlKey && !event.shiftKey)
{
config.macros.toggleSideBar.onToggleSideBar();
return false;
killEvent(event);
}


else if ((KeyCode == 114 || KeyCode == 82) && event.ctrlKey && !event.shiftKey)
{
config.macros.saveAndReload.onclick();
return false;
killEvent(event);
}

else if (KeyCode == 121|| KeyCode == 40)
{
config.commands.fullscreen.handler();
return false;
killEvent(event);
}


}

function killEvent(event){
try{
 event.keyCode = 0;
}
catch(e)
{
}
if(window.event){
 event.returnValue = false;
 event.cancelBubble = true; 
}
if(event.preventDefault)
{
 event.preventDefault();
}
if(event.stopPropagation)
{
 event.stopPropagation();
}
}

document.onkeypress = function(event){OnKeyPress(event);};
document.onkeydown = function(){OnKeyPress()};
window.lewcidLastVisit = '';
window.old_lewcid_whatsnew_restart = restart;
restart = function(){
 if(config.options.txtLastVisit)
 lewcidLastVisit= config.options.txtLastVisit;
 config.options.txtLastVisit = (new Date()).convertToYYYYMMDDHHMM();
 saveOptionCookie('txtLastVisit');
 window.old_lewcid_whatsnew_restart();
}
/***
|''Name:''|LegacyStrikeThroughPlugin|
|''Description:''|Support for legacy (pre 2.1) strike through formatting|
|''Version:''|1.0.2|
|''Date:''|Jul 21, 2006|
|''Source:''|http://www.tiddlywiki.com/#LegacyStrikeThroughPlugin|
|''Author:''|MartinBudden (mjbudden (at) gmail (dot) com)|
|''License:''|[[BSD open source license]]|
|''CoreVersion:''|2.1.0|
***/

//{{{
// Ensure that the LegacyStrikeThrough Plugin is only installed once.
if(!version.extensions.LegacyStrikeThroughPlugin) {
version.extensions.LegacyStrikeThroughPlugin = {installed:true};

config.formatters.push(
{
	name: "legacyStrikeByChar",
	match: "==",
	termRegExp: /(==)/mg,
	element: "strike",
	handler: config.formatterHelpers.createElementAndWikify
});

} //# end of "install only once"
//}}}
Life is a very precarious thing. We are far more fragile and vulnerable than we ever truly know. So many times in our lives, we are but one breath away from death, yet, we journey on, oblivious to the dangers.<br /><br />Some see them, steer us away, guide us to safety. Those start out as our parents, who watch over us until we can stretch our wings and fly on our own. We are then at the mercy of our own awareness. Capable of so much, knowing so very little. Yet we learn to survive.<br /><br />We all know we are mortal, that there is an end to that which began. We journey toward it every minute of every hour. Yet we continue to move on. We gather our friends and family with us, and we face the future uncertain. Together.
''[[Site Map]]''
<!--{{{-->
<link rel='alternate' type='application/rss+xml' title='RSS' href='index.xml'/>
<!--}}}-->

<style type="text/css">#contentWrapper {display:none;}</style><div id="SplashScreen" style="border: 3px solid #ccc; display: block; text-align: center; width: 320px; margin: 100px auto; padding: 50px; color:#000; font-size: 28px; font-family:Tahoma; background-color:#eee;"><b>Distorted Reality</b> is loading<blink> ...</blink><br><br><span style="font-size: 14px; color:red;">Requires Javascript.</span></div>
/***

|Name|MenuEditPlugin|
|Created by|SaqImtiaz|
|Location|http://lewcid.googlepages.com/lewcid.html#MenuEditPlugin|
|Version|0.2|
|Requires|~TW2.x|
!Description:
Adds 'doubleclick to edit source' to the MainMenu, SideBarOptions, and SideBarTabs

!History
*20-07-06: version 0.2: hijacked restart, no need to put a macro in the mainMenu anymore.
*28-04-06: version 0.1: working.

!Code
***/
//{{{

window.restart_lewcid_menuedit = restart;
window.restart = function () {
 window.restart_lewcid_menuedit();
var menus = new Array("topMenu","sidebarOptions","sidebarTabs","contentFooter","mainMenu");
for(var t=0; t<menus.length; t++){
 if (document.getElementById(menus[t]))
 {var menu = document.getElementById(menus[t]);
 menu.ondblclick = window.onMenuDblClick;}}
}



window.onMenuDblClick = function(e){
if (!e) var e = window.event;
story.displayTiddler(null,this.getAttribute("tiddler"),2,false,null)
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
return false;
}
//}}}
/***
| Name:|''monkeyTagger''|
| Created by:|SaqImtiaz|
| Location:|http://lewcid.googlepages.com/lewcid.html|
| Version:|0.9 (08-Apr-2006)|
| Requires:|~TW2.07|

!About:
*an adaptation of TagAdderMacro for monkeyGTD and tagglytagging user, but could be useful to just about anyone!
*{{{<<monkeyTagger Project>>}}} gives a drop down list of all tags, tagged with Project.
*The list allows toggling of tags on the current tiddler.
*logging options for task management.

!Demo:
<<monkeyTagger Status>>

!Installation:
*Copy this tiddler to your TW with the systemConfig tag
*either copy the following to your ViewTemplate:
{{{<div class='tagged' macro='monkeyTagger tagToTrack'></div>}}}
or
*better yet, define your own toolbar class and add as many as you need to create a nice toolbar.
Eg:
{{{<div class='toolbar' >
<span style="padding-right:0.15em;" macro='monkeyTagger Project'></span>
<span style="padding-right:0.15em;" macro='monkeyTagger Status'></span>
<span macro='toolbar -closeTiddler closeOthers +editTiddler permalink references jump'></span>
</div>}}}
 (adjust padding to taste)

!Usage:

''Syntax:''
|>|{{{<<monkeyTagger source:"sourcetag" label:"customlabel" logging:"true/false" anchor:"anchortext" arrow:"true/false">>}}}|
|label:|quoted text to use as a customlabel|
|arrow:|add arrow to custom label, values are "true" or "false"|
|anchor:|quoted text to specify where to add logging text|
|logging:|enable logging of tags added (for task management), values are "true" or "false"|

the only parameter you ''have'' to pass is the source. When passing only one parameter, you can write either something like:
{{{<<monkeyTagger "Project">>}}} or {{{<<monkeyTagger source:"Project">>}}} for <<monkeyTagger Project>>
All other parameters are optional, and can be written in any order.

''Defaults:''
|label:|default label if not specified = source tag + arrow|
|arrow:|true |
|logging:|false |
|anchor:|none used by default, logging text added to end of tiddler |

''Examples:''
|custom label| {{{<<monkeyTagger source:"Project" label:"customlabel">>}}} |<<monkeyTagger source:"Project" label:"customlabel">>|
|custom label without arrow| {{{<<monkeyTagger source:"Project" label:"customlabel" arrow:"false">>}}} |<<monkeyTagger source:"Project" label:"customlabel" arrow:"false">>|
|logging enabled| {{{<<monkeyTagger source:"Project" logging:"true"}}} |<<monkeyTagger source:"Project" logging:"true">>|
|logging enabled with anchor text|{{{<<monkeyTagger source:"Project" logging:"true" anchor:"anchortext"}}} |<<monkeyTagger source:"Project" logging:"true" anchor:"anchortext">>|

''Tips:''
*Make sure your anchor text doesn't occur more than once in every tiddler, as the first instance will be used.
*I recommend using something like {{{/%StatusLog%/}}} as an invisible anchor.
*Use a tag based template, and add monkeyTagger macro's with logging enabled to the toolbar in just your taskmanagement templates.

!To Do:
*add sorting options if requested.
*''add exclude tag feature''!

!History
*Version 0.9: 
**changed to named parameters to make it more user friendly
**added option to disable/enable dropdown arrow in custom labels
**added logging option with anchor text.

!CODE
***/
//{{{

config.macros.monkeyTagger= {};
//config.macros.monkeyTagger.dropdownchar = (document.all?"?":"?"); // the fat one is the only one that works in IE
config.macros.monkeyTagger.dropdownchar = "?"; // uncomment previous line and comment this for smaller version in FF
config.macros.monkeyTagger.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
 var nAV = paramString.parseParams('test', null, true);

 if ((nAV[0].arrow)&&(nAV[0].arrow[0])=='false')
 var arrow=': ';
 else
 var arrow=': '+ config.macros.monkeyTagger.dropdownchar;

 if((nAV[0].source)&&(nAV[0].source[0])!='.')
 {var tagToTrack = nAV[0].source[0]}
 else if(params[0]&&(params[0]!='.'))
 {var tagToTrack = params[0]}
 else
 {return false;};
 var monkeylabel = ((nAV[0].label)&&(nAV[0].label[0])!='.')?nAV[0].label[0]+arrow: tagToTrack+arrow;
 var logmode = ((nAV[0].logging)&&(nAV[0].logging[0])!='.')?nAV[0].logging[0]: "false";
 if ((nAV[0].anchor)&&(nAV[0].anchor[0])!='.')
 var anchor = nAV[0].anchor[0];
 var monkeytooltip=tagToTrack + ' :';


 if(tiddler instanceof Tiddler)
 {var title = tiddler.title;
 
 var addcomment = function(tiddler,newTag){
 var now = new Date();
 var timeFormat= 'DD/0MM/YY 0hh:0mm';
 var formattednow= now.formatString(timeFormat);
 var txt="\n*''"+tagToTrack+"'' set as ''"+newTag+"'' on "+formattednow;
 if (anchor && anchor!='.')
 {var pos=tiddler.text.indexOf(anchor);
 if (pos!=-1) {pos=pos + anchor.length}
 else if (pos==-1) {pos=tiddler.text.length}}
 else if (!anchor){var pos = tiddler.text.length;};

 tiddler.set(null,tiddler.text.substr(0,pos)+txt+tiddler.text.substr(pos));
 story.refreshTiddler(tiddler.title,null,true);
 return false;
}

 var ontagclick = function(e) {
 if (!e) var e = window.event;
 var tag = this.getAttribute("tag");
 var t=store.getTiddler(title);
 if (!t || !t.tags) return;
 if (t.tags.find(tag)==null)
 {t.tags.push(tag)
 if (logmode=="true"){addcomment(t,tag);}}
 else
 {t.tags.splice(t.tags.find(tag),1)};
 story.saveTiddler(title);
 story.refreshTiddler(title,null,true);
 return false;
 };
 var onclick = function(e) {
 if (!e) var e = window.event;
 var popup = Popup.create(this);
 var thistiddler=store.getTiddler(title);

 var taggedarray = new Array();
 var tagslabel = new Array();

 var taggedtiddlers = store.getTaggedTiddlers(tagToTrack);
 for (var t=0; t<taggedtiddlers.length; t++){
 var taggedtitle= ((taggedtiddlers[t]).title);
 taggedarray.push(taggedtitle);}

 for (var t=0; t<taggedarray.length; t++){
 var temptag = taggedarray[t];
 if (thistiddler.tags.find(temptag)==null)
 {var temptag='[ ] '+ temptag;
 tagslabel.push(temptag);}
 else
 {var temptag ='[x] '+ temptag;
 tagslabel.push(temptag);}
 }

 if(tagslabel.length == 0)
 createTiddlyText(createTiddlyElement(popup,"li"),('no '+tagToTrack));
 for (var t=0; t<tagslabel.length; t++)
 {
 var theTag = createTiddlyButton(createTiddlyElement(popup,"li"),tagslabel[t],("toggle '"+ ([taggedarray[t]]))+"'",ontagclick);
 theTag.setAttribute("tag",taggedarray[t]);
 }
 Popup.show(popup,false);
 e.cancelBubble = true;
 if (e.stopPropagation) e.stopPropagation();
 return(false);
};
 //createTiddlyButton(place,monkeylabel,monkeylabel,onclick);

var createdropperButton = function(place){
var sp = createTiddlyElement(place,"span",null,"monkeytaggerbutton");
var theDropDownBtn = createTiddlyButton(sp,monkeylabel,monkeytooltip,onclick);
};

createdropperButton(place);
 }
};
setStylesheet(
 ".toolbar .monkeytaggerbutton {margin-right:0em; border:0px solid #fff; padding:0px; padding-right:0px; padding-left:0px;}\n"+
 ".monkeytaggerbutton a.button {padding:2px; padding-left:2px; padding-right:2px;}\n"+
// ".monkeytaggerbutton {font-size:130%;}\n"+
//".monkeytaggerbutton .button {color:#703;}\n"+
 "",
"MonkeyTaggerStyles");

//}}}
/***
| Name|MptwLayoutPlugin|
| Description|A package containing templates and css for the MonkeyPirateTiddlyWiki layout|
| Version|3.0 ($Rev: 1845 $)|
| Source|http://mptw.tiddlyspot.com/#MptwLayoutPlugin|
| Author|Simon Baird <simon.baird@gmail.com>|
| License|http://mptw.tiddlyspot.com/#TheBSDLicense|
!Notes
Presumes you have TagglyTaggingPlugin installed. To enable this you should have a PageTemplate containing {{{[[MptwPageTemplate]]}}} and similar for ViewTemplate and EditTemplate.
***/
//{{{
// used in MptwViewTemplate
config.mptwDateFormat = 'DD/MM/YY';
config.mptwJournalFormat = 'Journal DD/MM/YY';
//config.mptwDateFormat = 'MM/0DD/YY';
//config.mptwJournalFormat = 'Journal MM/0DD/YY';

config.shadowTiddlers.GettingStarted += "\n\nSee also MonkeyPirateTiddlyWiki.";

//}}}

//{{{
merge(config.shadowTiddlers,{

'MptwEditTemplate':[
 "<!--{{{-->",
 "<!--- http://mptw.tiddlyspot.com/#MptwEditTemplate ($Rev: 1829 $) --->",
 "<div class=\"toolbar\" macro=\"toolbar +saveTiddler saveCloseTiddler closeOthers -cancelTiddler cancelCloseTiddler deleteTiddler\"></div>",
 "<div class=\"title\" macro=\"view title\"></div>",
 "<div class=\"editLabel\">Title</div><div class=\"editor\" macro=\"edit title\"></div>",
 "<div class=\"editLabel\">Tags</div><div class=\"editor\" macro=\"edit tags\"></div>",
 "<div class=\"editorFooter\"><span macro=\"message views.editor.tagPrompt\"></span><span macro=\"tagChooser\"></span></div>",
 "<div macro=\"showWhenExists EditPanelTemplate\">[[EditPanelTemplate]]</div>",
 "<div class=\"editor\" macro=\"edit text\"></div>",
 "<!--}}}-->",
 ""
].join("\n"),

'MptwPageTemplate':[
 "<!--{{{-->",
 "<!-- http://mptw.tiddlyspot.com/#MptwPageTemplate ($Rev: 1829 $) -->",
 "<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>",
 "<!-- horizontal MainMenu -->",
 "<div id='topMenu' refresh='content' tiddler='MainMenu'></div>",
 "<!-- original MainMenu menu -->",
 "<!-- <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>",
 "<!--}}}-->",
 ""
].join("\n"),

'MptwStyleSheet':[
 "/*{{{*/",
 "/* http://mptw.tiddlyspot.com/#MptwStyleSheet ($Rev: 1860 $) */",
 "",
 "/* a contrasting background so I can see where one tiddler ends and the other begins */",
 "body {",
 "	background: [[ColorPalette::TertiaryLight]];",
 "}",
 "",
 "/* sexy colours and font for the header */",
 ".headerForeground {",
 "	color: [[ColorPalette::PrimaryPale]];",
 "}",
 ".headerShadow, .headerShadow a {",
 "	color: [[ColorPalette::PrimaryMid]];",
 "}",
 "",
 "/* separate the top menu parts */",
 ".headerForeground, .headerShadow {",
 "	padding: 1em 1em 0;",
 "}",
 "",
 ".headerForeground, .headerShadow {",
 "	font-family: 'Trebuchet MS' sans-serif;",
 "	font-weight:bold;",
 "}",
 ".headerForeground .siteSubtitle {",
 "	color: [[ColorPalette::PrimaryLight]];",
 "}",
 ".headerShadow .siteSubtitle {",
 "	color: [[ColorPalette::PrimaryMid]];",
 "}",
 "",
 "/* make shadow go and down right instead of up and left */",
 ".headerShadow {",
 "	left: 1px;",
 "	top: 1px;",
 "}",
 "",
 "/* prefer monospace for editing */",
 ".editor textarea {",
 "	font-family: 'Consolas' monospace;",
 "}",
 "",
 "/* sexy tiddler titles */",
 ".title {",
 "	font-size: 250%;",
 "	color: [[ColorPalette::PrimaryLight]];",
 "	font-family: 'Trebuchet MS' sans-serif;",
 "}",
 "",
 "/* more subtle tiddler subtitle */",
 ".subtitle {",
 "	padding:0px;",
 "	margin:0px;",
 "	padding-left:0.5em;",
 "	font-size: 90%;",
 "	color: [[ColorPalette::TertiaryMid]];",
 "}",
 ".subtitle .tiddlyLink {",
 "	color: [[ColorPalette::TertiaryMid]];",
 "}",
 "",
 "/* a little bit of extra whitespace */",
 ".viewer {",
 "	padding-bottom:3px;",
 "}",
 "",
 "/* don't want any background color for headings */",
 "h1,h2,h3,h4,h5,h6 {",
 "	background: [[ColorPalette::Background]];",
 "	color: [[ColorPalette::Foreground]];",
 "}",
 "",
 "/* give tiddlers 3d style border and explicit background */",
 ".tiddler {",
 "	background: [[ColorPalette::Background]];",
 "	border-right: 2px [[ColorPalette::TertiaryMid]] solid;",
 "	border-bottom: 2px [[ColorPalette::TertiaryMid]] solid;",
 "	margin-bottom: 1em;",
 "	padding-bottom: 2em;",
 "}",
 "",
 "/* make options slider look nicer */",
 "#sidebarOptions .sliderPanel {",
 "	border:solid 1px [[ColorPalette::PrimaryLight]];",
 "}",
 "",
 "/* the borders look wrong with the body background */",
 "#sidebar .button {",
 "	border-style: none;",
 "}",
 "",
 "/* this means you can put line breaks in SidebarOptions for readability */",
 "#sidebarOptions br {",
 "	display:none;",
 "}",
 "/* undo the above in OptionsPanel */",
 "#sidebarOptions .sliderPanel br {",
 "	display:inline;",
 "}",
 "",
 "/* horizontal main menu stuff */",
 "#displayArea {",
 "	margin: 1em 15.7em 0em 1em; /* use the freed up space */",
 "}",
 "#topMenu br {",
 "	display: none;",
 "}",
 "#topMenu {",
 "	background: [[ColorPalette::PrimaryMid]];",
 "	color:[[ColorPalette::PrimaryPale]];",
 "}",
 "#topMenu {",
 "	padding:2px;",
 "}",
 "#topMenu .button, #topMenu .tiddlyLink, #topMenu a {",
 "	margin-left: 0.5em;",
 "	margin-right: 0.5em;",
 "	padding-left: 3px;",
 "	padding-right: 3px;",
 "	color: [[ColorPalette::PrimaryPale]];",
 "	font-size: 115%;",
 "}",
 "#topMenu .button:hover, #topMenu .tiddlyLink:hover {",
 "	background: [[ColorPalette::PrimaryDark]];",
 "}",
 "",
 "/* for Tagger Plugin, thanks sb56637 */",
 ".popup li a {",
 "   display:inline;",
 "}",
 "",
 "/* make it print a little cleaner */",
 "@media print {",
 "	#topMenu {",
 "		display: none ! important;",
 "	}",
 "	/* not sure if we need all the importants */",
 "	.tiddler {",
 "		border-style: none ! important;",
 "		margin:0px ! important;",
 "		padding:0px ! important;",
 "		padding-bottom:2em ! important;",
 "	}",
 "	.tagglyTagging .button, .tagglyTagging .hidebutton {",
 "		display: none ! important;",
 "	}",
 "	.headerShadow {",
 "		visibility: hidden ! important;",
 "	}",
 "	.tagglyTagged .quickopentag, .tagged .quickopentag {",
 "		border-style: none ! important;",
 "	}",
 "	.quickopentag a.button, .miniTag {",
 "		display: none ! important;",
 "	}",
 "}",
 "/*}}}*/",
 ""
].join("\n"),

'MptwViewTemplate':[
 "<!--{{{-->",
 "<!--- http://mptw.tiddlyspot.com/#MptwViewTemplate ($Rev: 1830 $) --->",
 "",
 "<div class='toolbar'>",
 "	<span macro=\"showWhenTagged systemConfig\">",
 "		<span macro=\"toggleTag systemConfigDisable . '[[disable|systemConfigDisable]]'\"></span>",
 "	</span>",
 "	<span style=\"padding:1em;\"></span>",
 "	<span macro='toolbar closeTiddler closeOthers +editTiddler deleteTiddler undoChanges permalink references jump'></span>",
 "	<span macro='newHere label:\"new here\"'></span>",
 "	<span macro='newJournalHere {{config.mptwJournalFormat?config.mptwJournalFormat:\"MM/0DD/YY\"}}'></span>",
 "</div>",
 "",
 "<div class=\"tagglyTagged\" macro=\"tags\"></div>",
 "",
 "<div class='titleContainer'>",
 "	<span class='title' macro='view title'></span>",
 "	<span macro=\"miniTag\"></span>",
 "</div>",
 "",
 "<div class='subtitle'>",
 "	<span macro='view modifier link'></span>,",
 "	<span macro='view modified date {{config.mptwDateFormat?config.mptwDateFormat:\"MM/0DD/YY\"}}'></span>",
 "	(<span macro='message views.wikified.createdPrompt'></span>",
 "	<span macro='view created date {{config.mptwDateFormat?config.mptwDateFormat:\"MM/0DD/YY\"}}'></span>)",
 "</div>",
 "",
 "<div macro=\"showWhenExists ViewPanelTemplate\">[[ViewPanelTemplate]]</div>",
 "",
 "<div macro=\"hideWhen tiddler.tags.containsAny(['css','html','pre','systemConfig']) && !tiddler.text.match('{{'+'{')\">",
 "	<div class='viewer' macro='view text wikified'></div>",
 "</div>",
 "<div macro=\"showWhen tiddler.tags.containsAny(['css','html','pre','systemConfig']) && !tiddler.text.match('{{'+'{')\">",
 "	<div class='viewer'><pre macro='view text'></pre></div>",
 "</div>",
 "",
 "<div macro=\"showWhenExists ViewDashboardTemplate\">[[ViewDashboardTemplate]]</div>",
 "",
 "<div class=\"tagglyTagging\" macro=\"tagglyTagging\"></div>",
 "",
 "<!--}}}-->",
 ""
].join("\n")

});
//}}}
For upgrading directly from tiddlyspot. See [[ImportTiddlers]].
URL: /proxy/mptw.tiddlyspot.com/upgrade.html
For upgrading. See [[ImportTiddlers]].
URL: http://mptw.tiddlyspot.com/upgrade.html
/***

|Name|NavigationMacro|
|Created by|SaqImtiaz|
|Location|http://lewcid.googlepages.com/lewcid.html#NavigationMacro|
|Version|0.3 |
|Requires|~TW2.08+|
!Description:
*Creates Next and Prev buttons on tiddlers, to cycle through tiddlers in order.
**you can create next and previous buttons to navigate through your journals, or the tiddlers of a tutorial.
*You can exclude certain tiddlers, or navigate through tiddlers with a specific tag only.
*The tiddlers can be sorted by modified or created.
*Custom ordering will be available after the release of TW 2.1
*Needs to be added to the ViewTemplate
*Buttons are updated dynamically and are hidden if there is no next or previous tiddler.

!Usage
{{{<<navigation>>}}}
or for more options:
{{{<<navigation sort exclude tag labelPrevious labelNext >>}}}
where sort is ''created'' (default) or ''modified''
exlcude is the tag to exclude.
tag is the tag to navigate through.
labelPrevious is the label for the previous button.
labelNext is the label for the next button. 

I recommend adding it to the ViewTemplate in the viewer div:
{{{<div class='viewer'>
<span macro='view text wikified'></span>
<span macro='navigation "" "" plugin'></span></div>}}}



!Example:
The next and previous buttons at the bottom of this tiddler will cycle through all of my extensions for TW.
!History
* 25-06-06 : version 0.3, first release

!Code
***/
//{{{
window.refreshNavLink = function (e) {
 var title = e.getAttribute("here");
 var sort = e.getAttribute("sort");
 var exclude = e.getAttribute("exclude");
 if (e.getAttribute("tag")!=undefined) var tag = e.getAttribute("tag");
 var navtype = e.getAttribute("navtype");
 if (tag) {var tiddlers = store.getTaggedTiddlers(tag,sort);}
 else {var tiddlers = store.getTiddlers(sort,exclude);}
 for (var g=0; g<tiddlers.length; g++)
 {if (title==tiddlers[g].title)
 {if(navtype=="next" && !tiddlers[g+1]) 
 e.className += " navNonExisting"
 else if (navtype=="prev" && !tiddlers[g-1])
 e.className += " navNonExisting"
 else e.className = "button";}
 }
}


config.refreshers.navLink = function(e,changeList){ 
 refreshNavLink(e);
} 



config.macros.navigation={};
config.macros.navigation.handler = function(place,macroName,params,wikifier,paramString,tiddler){

 var sort = (params[0] && params[0]!=".")? params[0]: "created";
 var exclude =(params[1] && params[1]!=".")? params[1]: undefined;
 if (params[2])
 {var tag= params[2];
 if(tiddler.tags.contains(tag)==false)
 return false;
 }
 var labelPrev = params[3] ? params[3] : "Previous";
 var labelNext = params[4] ? params[4] : "Next";

 var next = function(e){
 if (!e) var e=window.event;
 var theTarget = resolveTarget(e);
 var navtype = theTarget.getAttribute("navtype");
 if (tag) {var tiddlers = store.getTaggedTiddlers(tag,sort);}
 else {var tiddlers = store.getTiddlers(sort,exclude);}
 for (var g=0; g<tiddlers.length; g++)
 {if (tiddler.title==tiddlers[g].title)
 {if (navtype == "next")
 story.displayTiddler(theTarget,tiddlers[g+1].title)
 else if (navtype == "prev")
 story.displayTiddler(theTarget,tiddlers[g-1].title)}
 }
 }

 var createNavBtn = function(text,theId,mode){
 var nextBtn = createTiddlyButton(place,text,text,next,null,theId);
 nextBtn.setAttribute("refresh","navLink");
 nextBtn.setAttribute("here",tiddler.title);
 nextBtn.setAttribute("sort",sort);
 nextBtn.setAttribute("exclude",exclude);
 nextBtn.setAttribute("navtype",mode);
 if (tag) nextBtn.setAttribute("tag",tag);
 refreshNavLink(nextBtn);
 }
 createNavBtn(labelNext+" ►","NavNext","next");
 createNavBtn("◄ "+labelPrev,"NavPrevious","prev");

}

setStylesheet(
"#NavNext {float:right;}\n"+
"#NavPrevious {float:left;}\n"+
".navNonExisting {display:none;}\n"+
 "",
"NavMacroStyles");
//}}}
/***
| Name:|NewHerePlugin|
| Description:|Creates the new here and new journal toolbar commands|
| Version:|6.1.6|
| Date:|06-Oct-2006|
| Source:|http://mptw.tiddlyspot.com/#NewHerePlugin|
| Author:|Simon Baird <simon.baird@gmail.com>|
| CoreVersion:|2.1.x|
To use edit your ViewTemplate and add newHere to the toolbar div, eg
{{{<div class='toolbar' macro='toolbar ... newHere'></div>}}}
Note: would be good if we could do this instead some day
{{{<<newTiddler tag:{{tiddler.title}} label:'new here'>>}}}
***/
//{{{
merge(config.commands,{

 newHere: {
 text: 'new here',
 tooltip: 'Create a new tiddler tagged as this tiddler',
 hideReadOnly: true,
 handler: function(e,src,title) {
 if (!readOnly) {
 clearMessage();
 var t=document.getElementById('tiddler'+title);
 story.displayTiddler(t,config.macros.newTiddler.title,DEFAULT_EDIT_TEMPLATE);
 story.setTiddlerTag(config.macros.newTiddler.title, title, 0);
 story.focusTiddler(config.macros.newTiddler.title,"title"); // doesn't work??
 return false;
 }
 }
 },

 newJournalHere: {
 //text: 'new journal here', // too long
 text: 'new journal',
 hideReadOnly: true,
 dataFormat: 'DD MMM YYYY', // adjust to your preference
 //dataFormat: 'YYYY-0MM-0DD', 
 tooltip: 'Create a new journal tiddler tagged as this tiddler',
 handler: function(e,src,title) {
 if (!readOnly) {
 clearMessage();
 var now = new Date();
 var t=document.getElementById('tiddler'+title);
 var newtitle = now.formatString(this.dataFormat)
 story.displayTiddler(t,newtitle,DEFAULT_EDIT_TEMPLATE);
 story.setTiddlerTag(newtitle, title, 0);
 story.focusTiddler(newtitle,"title");
 return false;
 }
 }
 }

});
//}}}
...what path you walk...<br /><br />...who you walk it with...<br /><br />...how long your journey is...<br /><br />You are always between a beginning and another beginning.
/***
|Name|OpenTiddlersMacro|
|Created by|SaqImtiaz|
|Location|http://lewcid.googlepages.com/lewcid.html#openTiddlersMacro|
|Version|0.2 |
|Requires|~TW2.08+|
!Description:
*Allows creation of tiddlyLinks that open multiple tiddlers.
*Also useful for creating links to shadowTiddlers, which if normally created are not in bold.

!Usage
{{{<<openTiddlers text:"TextForLink" tiddlers:"Tiddler1 Tiddler2 [[Tiddler with spaces]] Tiddler4">>}}}

!Example:
{{{<<openTiddlers text:"This link opens multiple tiddlers" tiddlers:"Project Saq">>}}}
<<openTiddlers text:"This link opens multiple tiddlers" tiddlers:"Project Saq">>

!History
*30-04-06, version 0.2, modifed and rename following feedback from Eric.
*29-04-06, version 0.1, working.

!To Do:
*option to close other tiddlers
*option to open in edit template

!Code
***/
//{{{
window.onClickMultiLink= function(e){
 story.displayTiddlers(this,this.getAttribute("tiddlerstring").readBracketedList());
 return(false);
}

config.macros.openTiddlers={};
config.macros.openTiddlers.handler = function(place,macroName,params,wikifier,paramString,tiddler){
 var nAV = paramString.parseParams('test', null, true);
 var text = nAV[0].text[0];
 var tiddlerstring = nAV[0].tiddlers[0];
 var btn= createTiddlyButton(place,text,null,onClickMultiLink,"tiddlyLinkExisting");
 btn.setAttribute("tiddlerstring",tiddlerstring);
}
//}}}
/***
|Name|OpenTopPlugin|
|Created by|SaqImtiaz|
|Location|http://lewcid.googlepages.com/lewcid.html#OpenTopPlugin|
|Version|0.1|
|Requires|~TW2.x|
!!!Description:
Open new tiddlers at the top of the screen.

!!!Code
***/
//{{{
Story.prototype.coreLewcidDisplayTiddler=Story.prototype.displayTiddler ;
Story.prototype.displayTiddler =
function(srcElement,title,template,unused1,unused2,animate,slowly)
{
 var srcElement=null;
 if (document.getElementById(this.idPrefix + title))
 {story.closeTiddler(title);}
 this.coreLewcidDisplayTiddler(srcElement,title,template,unused1,unused2,animate,slowly);
 window.scrollTo(0,0);
}
//}}}
<<tiddler TspotOptions>>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
PluginManager
ImportTiddlers
the owl's wisdom is rooted in its view of predator and prey.
it is a simple view absent of doubt.
<<<
//''it is a true path''//
<<<
<!--{{{-->
<div id='header' class='header'>
	<div class='headerShadow'>
		<span class='searchBar' macro='search'></span>
		<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
		<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
	</div>
	<div id='topMenu' refresh='content' tiddler='MainMenu'></div>
</div>
<div id='bodywrapper'>
	<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 id='ContentFooter' refresh='content' tiddler='FooterContent'></div>
</div>
<!--}}}-->
The day that I am perfect, is the day that I can judge others for not being so.<br /><br />Judging by my progress thus far, others will not be judged by me any time soon.
/***
|''Name:''|~PopupMacro|
|''Version:''|1.0.0 (2006-05-09)|
|''Source:''|http://lewcid.googlepages.com/lewcid.html#PopupMacro|
|''Author:''|Saq Imtiaz|
|''Description:''|Create popups with custom content|
|''Documentation:''|[[PopupMacro Documentation|PopupMacroDocs]]|
|''~Requires:''|TW Version 2.0.8 or better|
***/
// /%
{{{
config.macros.popup = {};
config.macros.popup.arrow = (document.all?"▼":"▾");
config.macros.popup.handler = function(place,macroName,params,wikifier,paramString,theTiddler) {

 if (!params[0] || !params[1]) 
 {createTiddlyError(place,'missing macro parameters','missing label or content parameter');
 return false;};
 
 var label = params[0];
 var source = (params[1]).replace(/\$\)\)/g,">>"); 
 var nestedId = params[2]? params[2]: 'nestedpopup'; 

 var onclick = function(event) {
 if(!event){var event = window.event;}
 var theTarget = resolveTarget(event);
 var nested = (!isNested(theTarget));
 
 if ((Popup.stack.length > 1)&&(nested==true)) {Popup.removeFrom(1);}
 else if(Popup.stack.length > 0 && nested==false) {Popup.removeFrom(0);};
 
 var theId = (nested==false)? "popup" : nestedId; 
 var popup = createTiddlyElement(document.body,"ol",theId,"popup",null);
 Popup.stack.push({root: button, popup: popup});

 wikify(source,popup);
 Popup.show(popup,true);
 event.cancelBubble = true;
 if (event.stopPropagation) event.stopPropagation();
 return false;
 }
 var button = createTiddlyButton(place, label+this.arrow,label, onclick, null);
};

window.isNested = function(e) {
 while (e != null) {
 var contentWrapper = document.getElementById("contentWrapper");
 if (contentWrapper == e) return true;
 e = e.parentNode;
 }
 return false;
};

setStylesheet(
".popup, .popup a, .popup a:visited {color: #fff;}\n"+
".popup a:hover {background: #014; color: #fff; border: none;}\n"+
".popup li , .popup ul, .popup ol {list-style:none !important; margin-left:0.3em !important; margin-right:0.3em; font-size:100%; padding-top:0.5px !important; padding:0px !important;}\n"+
"#nestedpopup {background:#2E5ADF; border: 1px solid #0331BF; margin-left:1em; }\n"+
"",
"CustomPopupStyles");

config.shadowTiddlers.PopupMacroDocs="The documentation is available [[here.|http://lewcid.googlepages.com/lewcid.html#PopupMacroDocs]]";
}}}
//%/
/***
| Name:|QuickOpenTagPlugin|
| Description:|Changes tag links to make it easier to open tags as tiddlers|
| Version:|6.1.1|
| Date:|01-Oct-2006|
| Source:|http://mptw.tiddlyspot.com/#QuickOpenTagPlugin|
| Author:|Simon Baird <simon.baird@gmail.com>|
| CoreVersion:|2.1.x|
***/
//{{{
config.quickOpenTag = {

 dropdownChar: (document.all ? "\u25bc" : "\u25be"), // the little one doesn't work in IE

 createTagButton: function(place,tag,excludeTiddler) {
 // little hack so we can to <<tag PrettyTagName|RealTagName>>
 var splitTag = tag.split("|");
 var pretty = tag;
 if (splitTag.length == 2) {
 tag = splitTag[1];
 pretty = splitTag[0];
 }
 
 var sp = createTiddlyElement(place,"span",null,"quickopentag");
 createTiddlyText(createTiddlyLink(sp,tag,false),pretty);
 
 var theTag = createTiddlyButton(sp,config.quickOpenTag.dropdownChar,
 config.views.wikified.tag.tooltip.format([tag]),onClickTag);
 theTag.setAttribute("tag",tag);
 if (excludeTiddler)
 theTag.setAttribute("tiddler",excludeTiddler);
 return(theTag);
 },

 miniTagHandler: function(place,macroName,params,wikifier,paramString,tiddler) {
 var tagged = store.getTaggedTiddlers(tiddler.title);
 if (tagged.length > 0) {
 var theTag = createTiddlyButton(place,config.quickOpenTag.dropdownChar,
 config.views.wikified.tag.tooltip.format([tiddler.title]),onClickTag);
 theTag.setAttribute("tag",tiddler.title);
 theTag.className = "miniTag";
 }
 },

 allTagsHandler: function(place,macroName,params) {
 var tags = store.getTags();
 var theDateList = createTiddlyElement(place,"ul");
 if(tags.length == 0)
 createTiddlyElement(theDateList,"li",null,"listTitle",this.noTags);
 for (var t=0; t<tags.length; t++) {
 var theListItem = createTiddlyElement(theDateList,"li");
 var theLink = createTiddlyLink(theListItem,tags[t][0],true);
 var theCount = " (" + tags[t][1] + ")";
 theLink.appendChild(document.createTextNode(theCount));
 var theDropDownBtn = createTiddlyButton(theListItem," " +
 config.quickOpenTag.dropdownChar,this.tooltip.format([tags[t][0]]),onClickTag);
 theDropDownBtn.setAttribute("tag",tags[t][0]);
 }
 },

 // todo fix these up a bit
 styles: 
"/*{{{*/\n"+
"/* created by QuickOpenTagPlugin */\n"+
".tagglyTagged .quickopentag, .tagged .quickopentag \n"+
" { margin-right:1.2em; border:1px solid #eee; padding:2px; padding-right:0px; padding-left:1px; }\n"+
".quickopentag .tiddlyLink { padding:2px; padding-left:3px; }\n"+
".quickopentag a.button { padding:1px; padding-left:2px; padding-right:2px;}\n"+
"/* extra specificity to make it work right */\n"+
"#displayArea .viewer .quickopentag a.button, \n"+
"#displayArea .viewer .quickopentag a.tiddyLink, \n"+
"#mainMenu .quickopentag a.tiddyLink, \n"+
"#mainMenu .quickopentag a.tiddyLink \n"+
" { border:0px solid black; }\n"+
"#displayArea .viewer .quickopentag a.button, \n"+
"#mainMenu .quickopentag a.button \n"+
" { margin-left:0px; padding-left:2px; }\n"+
"#displayArea .viewer .quickopentag a.tiddlyLink, \n"+
"#mainMenu .quickopentag a.tiddlyLink \n"+
" { margin-right:0px; padding-right:0px; padding-left:0px; margin-left:0px; }\n"+
"a.miniTag {font-size:150%;} \n"+
"#mainMenu .quickopentag a.button \n"+
" /* looks better in right justified main menus */\n"+
" { margin-left:0px; padding-left:2px; margin-right:0px; padding-right:0px; }\n" + 
"#topMenu .quickopentag { padding:0px; margin:0px; border:0px; }\n" +
"#topMenu .quickopentag .tiddlyLink { padding-right:1px; margin-right:0px; }\n" +
"#topMenu .quickopentag .button { padding-left:1px; margin-left:0px; border:0px; }\n" +
"/*}}}*/\n"+
 "",

 init: function() {
 // we fully replace these builtins. can't hijack them easily
 window.createTagButton = this.createTagButton;
 config.macros.allTags.handler = this.allTagsHandler;
 config.macros.miniTag = { handler: this.miniTagHandler };
 config.shadowTiddlers["QuickOpenTagStyles"] = this.styles;
 if (store)
 store.addNotification("QuickOpenTagStyles",refreshStyles);
 else
 config.notifyTiddlers.push({name:"QuickOpenTagStyles", notify: refreshStyles});
 }

}

config.quickOpenTag.init();

//}}}
In youth, you think everything happens for a reason.
In wisdom, you know only half of what happens happens for a reason.

The other half is simply a random, chaotic event.

It is about balance.
/***
| Name:|RenameTagsPlugin|
| Description:|Allows you to easily rename or delete tags across multiple tiddlers|
| Version:|6.1.18|
| Date:|18-Oct-2006|
| Source:|http://mptw.tiddlyspot.com/#RenameTagsPlugin|
| Author:|Simon Baird <simon.baird@gmail.com>|
| CoreVersion:|2.1.x|
Rename a tag and you will be prompted to rename it in all its tagged tiddlers.
***/
//{{{
config.renameTags = {

	prompts: {
		rename: "Rename the tag '%0' to '%1' in %2 tidder%3?",
		remove: "Remove the tag '%0' from %1 tidder%2?"
	},

	removeTag: function(tag,tiddlers) {
		store.suspendNotifications();
		for (var i=0;i<tiddlers.length;i++) {
			store.setTiddlerTag(tiddlers[i].title,false,tag);
		}
		store.resumeNotifications();
		store.notifyAll();
	},

	renameTag: function(oldTag,newTag,tiddlers) {
		store.suspendNotifications();
		for (var i=0;i<tiddlers.length;i++) {
			store.setTiddlerTag(tiddlers[i].title,false,oldTag); // remove old
			store.setTiddlerTag(tiddlers[i].title,true,newTag);  // add new
		}
		store.resumeNotifications();
		store.notifyAll();
	},

	storeMethods: {

		saveTiddler_orig_renameTags: TiddlyWiki.prototype.saveTiddler,

		saveTiddler: function(title,newTitle,newBody,modifier,modified,tags,fields) {
			if (title != newTitle) {
				var tagged = this.getTaggedTiddlers(title);
				if (tagged.length > 0) {
					// then we are renaming a tag
					if (confirm(config.renameTags.prompts.rename.format([title,newTitle,tagged.length,tagged.length>1?"s":""])))
						config.renameTags.renameTag(title,newTitle,tagged);

					if (!this.tiddlerExists(title) && newBody == "")
						// dont create unwanted tiddler
						return null;
				}
			}
			return this.saveTiddler_orig_renameTags(title,newTitle,newBody,modifier,modified,tags,fields);
		},

		removeTiddler_orig_renameTags: TiddlyWiki.prototype.removeTiddler,

		removeTiddler: function(title) {
			var tagged = this.getTaggedTiddlers(title);
			if (tagged.length > 0)
				if (confirm(config.renameTags.prompts.remove.format([title,tagged.length,tagged.length>1?"s":""])))
					config.renameTags.removeTag(title,tagged);
			return this.removeTiddler_orig_renameTags(title);
		}

	},

	init: function() {
		merge(TiddlyWiki.prototype,this.storeMethods);
	}
}

config.renameTags.init();

//}}}

We choose our responsibilities...

We then choose to succeed or fail at them.
We must not only ask if what we are doing is the right thing....but also how is it the right thing.<br /><br />That is an often forgotten part of "doing the right thing". You can do the right thing for selfish reasons. You can do the right thing for selfless reasons.<br /><br />It is easy to state "I'm doing the right thing".  It isn't so easy to explain how it is right.
/***
|Name|SaveAndReloadMacro|
|Created by|SaqImtiaz|
|Location|http://lewcid.googlepages.com/lewcid.html#SaveAndReloadMacro|
|Version|1.0|
|Requires|~TW2.x|
!Description:
Provides a button to save and reload TW. Useful if you are testing code and dont have AutoSave enabled.

!Demo:
{{{<<saveAndReload>>}}}<<saveAndReload>>

!Installation:
Copy the contents of this tiddler to your TW, tag with systemConfig, save and reload your TW.

!History:
*24-07-06: ver 1.0

!Code
***/
//{{{
config.macros.saveAndReload={};
config.macros.saveAndReload.handler= function(place,macroName,params,wikifier,paramString,tiddler)
{
 var label = params[0]||"Save & Reload";
 var tooltip = params[1]||"Save & reload";
 createTiddlyButton(place,label,tooltip,this.onclick);
}
config.macros.saveAndReload.onclick= function()
{
 saveChanges();
 window.location.reload( false );
}
//}}}
/***
| Name|SaveCloseTiddlerPlugin|
| Description|Provides two extra toolbar commands, saveCloseTiddler and cancelCloseTiddler|
| Version|3.0 ($Rev: 1845 $)|
| Date|$Date: 2007-03-16 15:19:22 +1000 (Fri, 16 Mar 2007) $|
| 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: 'Undo changes to this tiddler and close it',
		handler: function(e,src,title) {
			config.commands.saveTiddler.handler(e,src,title);
			config.commands.closeTiddler.handler(e,src,title);
			return false;
		}
	},

	cancelCloseTiddler: {
		text: 'cancel/close',
		tooltip: 'Save changes to this tiddler and close it',
		handler: function(e,src,title) {
			config.commands.cancelTiddler.handler(e,src,title);
			config.commands.closeTiddler.handler(e,src,title);
			return false;
		}
	}

});

//}}}

The wise man knows "self" and knows "not self"...balancing the two on our journey is the path to "wisdom"
<<closeAll>><<permaview>><<newTiddler>><<newJournal 'DD MMM YYYY'>><<saveChanges>><<tiddler TspotSidebar>><<slider chkSliderOptionsPanel OptionsPanel 'options »' 'Change TiddlyWiki advanced options'>>
/***
|''Name:''|SimileTimelineBundlePlugin|
|''Description:''|[[Simile Timelines|http://simile.mit.edu/SimileTimeline/]]|
|''Author:''|Martin Budden (mjbudden [at] gmail [dot] com)|
|''Subversion:''|http://svn.tiddlywiki.org/Trunk/contributors/MartinBudden/plugins/SimileTimelineBundlePlugin.js|
|''Version:''|0.1.0|
|''Date:''|Mar 4, 2007|
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev|
|''License:''|BSD-style license from MIT|
|''~CoreVersion:''|2.2|
***/

/*{{{*/
// Ensure that the SimileTimelineBundlePlugin is only installed once.
if(!version.extensions.SimileTimelineBundlePlugin) {
version.extensions.SimileTimelineBundlePlugin = {installed:true};

if(version.major < 2 || (version.major == 2 && version.minor < 2))
	{alertAndThrow('SimileTimelineBundlePlugin requires TiddlyWiki 2.2 or newer.');}
	
// Following code is from Simile (Semantic Interoperability of Metadata and Information in unLike Environments).
// SIMILE is a joint project conducted by the MIT Libraries and MIT CSAIL.
// Code is released under a BSD-style license.
// See:
// http://simile.mit.edu/repository/timeline/trunk/src/webapp/api/bundle.js

var Timeline = new Object();
Timeline.Platform = new Object();
Timeline.Platform.serverLocale = "en";
Timeline.Platform.clientLocale = "en";


/* timeline.js */

Timeline.strings={};Timeline.create=function(elmt,bandInfos,orientation,unit){return new Timeline._Impl(elmt,bandInfos,orientation,unit);};Timeline.HORIZONTAL=0;Timeline.VERTICAL=1;Timeline._defaultTheme=null;Timeline.createBandInfo=function(params){var theme=("theme"in params)?params.theme:Timeline.getDefaultTheme();var eventSource=("eventSource"in params)?params.eventSource:null;var ether=new Timeline.LinearEther({centersOn:("date"in params)?params.date:new Date(),interval:Timeline.DateTime.gregorianUnitLengths[params.intervalUnit],pixelsPerInterval:params.intervalPixels});var etherPainter=new Timeline.GregorianEtherPainter({unit:params.intervalUnit,multiple:("multiple"in params)?params.multiple:1,theme:theme,align:("align"in params)?params.align:undefined});var layout=new Timeline.StaticTrackBasedLayout({eventSource:eventSource,ether:ether,showText:("showEventText"in params)?params.showEventText:true,theme:theme});var eventPainterParams={showText:("showEventText"in params)?params.showEventText:true,layout:layout,theme:theme};if("trackHeight"in params){eventPainterParams.trackHeight=params.trackHeight;}
if("trackGap"in params){eventPainterParams.trackGap=params.trackGap;}
var eventPainter=new Timeline.DurationEventPainter(eventPainterParams);return{width:params.width,eventSource:eventSource,timeZone:("timeZone"in params)?params.timeZone:0,ether:ether,etherPainter:etherPainter,eventPainter:eventPainter};};Timeline.createHotZoneBandInfo=function(params){var theme=("theme"in params)?params.theme:Timeline.getDefaultTheme();var eventSource=("eventSource"in params)?params.eventSource:null;var ether=new Timeline.HotZoneEther({centersOn:("date"in params)?params.date:new Date(),interval:Timeline.DateTime.gregorianUnitLengths[params.intervalUnit],pixelsPerInterval:params.intervalPixels,zones:params.zones});var etherPainter=new Timeline.HotZoneGregorianEtherPainter({unit:params.intervalUnit,zones:params.zones,theme:theme,align:("align"in params)?params.align:undefined});var layout=new Timeline.StaticTrackBasedLayout({eventSource:eventSource,ether:ether,theme:theme});var eventPainterParams={showText:("showEventText"in params)?params.showEventText:true,layout:layout,theme:theme};if("trackHeight"in params){eventPainterParams.trackHeight=params.trackHeight;}
if("trackGap"in params){eventPainterParams.trackGap=params.trackGap;}
var eventPainter=new Timeline.DurationEventPainter(eventPainterParams);return{width:params.width,eventSource:eventSource,timeZone:("timeZone"in params)?params.timeZone:0,ether:ether,etherPainter:etherPainter,eventPainter:eventPainter};};Timeline.getDefaultTheme=function(){if(Timeline._defaultTheme==null){Timeline._defaultTheme=Timeline.ClassicTheme.create(Timeline.Platform.getDefaultLocale());}
return Timeline._defaultTheme;};Timeline.setDefaultTheme=function(theme){Timeline._defaultTheme=theme;};Timeline.loadXML=function(url,f){var fError=function(statusText,status,xmlhttp){alert("Failed to load data xml from "+url+"\n"+statusText);};var fDone=function(xmlhttp){var xml=xmlhttp.responseXML;if(!xml.documentElement&&xmlhttp.responseStream){xml.load(xmlhttp.responseStream);}
f(xml,url);};Timeline.XmlHttp.get(url,fError,fDone);};Timeline.loadJSON=function(url,f){var fError=function(statusText,status,xmlhttp){alert("Failed to load json data from "+url+"\n"+statusText);};var fDone=function(xmlhttp){f(eval('('+xmlhttp.responseText+')'),url);};Timeline.XmlHttp.get(url,fError,fDone);};Timeline._Impl=function(elmt,bandInfos,orientation,unit){this._containerDiv=elmt;this._bandInfos=bandInfos;this._orientation=orientation==null?Timeline.HORIZONTAL:orientation;this._unit=(unit!=null)?unit:Timeline.NativeDateUnit;this._initialize();};Timeline._Impl.prototype.dispose=function(){for(var i=0;i<this._bands.length;i++){this._bands[i].dispose();}
this._bands=null;this._bandInfos=null;this._containerDiv.innerHTML="";};Timeline._Impl.prototype.getBandCount=function(){return this._bands.length;};Timeline._Impl.prototype.getBand=function(index){return this._bands[index];};Timeline._Impl.prototype.layout=function(){this._distributeWidths();};Timeline._Impl.prototype.paint=function(){for(var i=0;i<this._bands.length;i++){this._bands[i].paint();}};Timeline._Impl.prototype.getDocument=function(){return this._containerDiv.ownerDocument;};Timeline._Impl.prototype.addDiv=function(div){this._containerDiv.appendChild(div);};Timeline._Impl.prototype.removeDiv=function(div){this._containerDiv.removeChild(div);};Timeline._Impl.prototype.isHorizontal=function(){return this._orientation==Timeline.HORIZONTAL;};Timeline._Impl.prototype.isVertical=function(){return this._orientation==Timeline.VERTICAL;};Timeline._Impl.prototype.getPixelLength=function(){return this._orientation==Timeline.HORIZONTAL?this._containerDiv.offsetWidth:this._containerDiv.offsetHeight;};Timeline._Impl.prototype.getPixelWidth=function(){return this._orientation==Timeline.VERTICAL?this._containerDiv.offsetWidth:this._containerDiv.offsetHeight;};Timeline._Impl.prototype.getUnit=function(){return this._unit;};Timeline._Impl.prototype.loadXML=function(url,f){var tl=this;var fError=function(statusText,status,xmlhttp){alert("Failed to load data xml from "+url+"\n"+statusText);tl.hideLoadingMessage();};var fDone=function(xmlhttp){try{var xml=xmlhttp.responseXML;if(!xml.documentElement&&xmlhttp.responseStream){xml.load(xmlhttp.responseStream);}
f(xml,url);}finally{tl.hideLoadingMessage();}};this.showLoadingMessage();window.setTimeout(function(){Timeline.XmlHttp.get(url,fError,fDone);},0);};Timeline._Impl.prototype.loadJSON=function(url,f){var tl=this;var fError=function(statusText,status,xmlhttp){alert("Failed to load json data from "+url+"\n"+statusText);tl.hideLoadingMessage();};var fDone=function(xmlhttp){try{f(eval('('+xmlhttp.responseText+')'),url);}finally{tl.hideLoadingMessage();}};this.showLoadingMessage();window.setTimeout(function(){Timeline.XmlHttp.get(url,fError,fDone);},0);};Timeline._Impl.prototype._initialize=function(){var containerDiv=this._containerDiv;var doc=containerDiv.ownerDocument;containerDiv.className=containerDiv.className.split(" ").concat("timeline-container").join(" ");while(containerDiv.firstChild){containerDiv.removeChild(containerDiv.firstChild);}
var elmtCopyright=Timeline.Graphics.createTranslucentImage(doc,Timeline.urlPrefix+(this.isHorizontal()?"images/copyright-vertical.png":"images/copyright.png"));elmtCopyright.className="timeline-copyright";elmtCopyright.title="Timeline (c) SIMILE - http://simile.mit.edu/timeline/";Timeline.DOM.registerEvent(elmtCopyright,"click",function(){window.location="http://simile.mit.edu/timeline/";});containerDiv.appendChild(elmtCopyright);this._bands=[];for(var i=0;i<this._bandInfos.length;i++){var band=new Timeline._Band(this,this._bandInfos[i],i);this._bands.push(band);}
this._distributeWidths();for(var i=0;i<this._bandInfos.length;i++){var bandInfo=this._bandInfos[i];if("syncWith"in bandInfo){this._bands[i].setSyncWithBand(this._bands[bandInfo.syncWith],("highlight"in bandInfo)?bandInfo.highlight:false);}}
var message=Timeline.Graphics.createMessageBubble(doc);message.containerDiv.className="timeline-message-container";containerDiv.appendChild(message.containerDiv);message.contentDiv.className="timeline-message";message.contentDiv.innerHTML="<img src='"+Timeline.urlPrefix+"images/progress-running.gif' /> Loading...";this.showLoadingMessage=function(){message.containerDiv.style.display="block";};this.hideLoadingMessage=function(){message.containerDiv.style.display="none";};};Timeline._Impl.prototype._distributeWidths=function(){var length=this.getPixelLength();var width=this.getPixelWidth();var cumulativeWidth=0;for(var i=0;i<this._bands.length;i++){var band=this._bands[i];var bandInfos=this._bandInfos[i];var widthString=bandInfos.width;var x=widthString.indexOf("%");if(x>0){var percent=parseInt(widthString.substr(0,x));var bandWidth=percent*width/100;}else{var bandWidth=parseInt(widthString);}
band.setBandShiftAndWidth(cumulativeWidth,bandWidth);band.setViewLength(length);cumulativeWidth+=bandWidth;}};Timeline._Band=function(timeline,bandInfo,index){this._timeline=timeline;this._bandInfo=bandInfo;this._index=index;this._locale=("locale"in bandInfo)?bandInfo.locale:Timeline.Platform.getDefaultLocale();this._timeZone=("timeZone"in bandInfo)?bandInfo.timeZone:0;this._labeller=("labeller"in bandInfo)?bandInfo.labeller:timeline.getUnit().createLabeller(this._locale,this._timeZone);this._dragging=false;this._changing=false;this._originalScrollSpeed=5;this._scrollSpeed=this._originalScrollSpeed;this._onScrollListeners=[];var b=this;this._syncWithBand=null;this._syncWithBandHandler=function(band){b._onHighlightBandScroll();};this._selectorListener=function(band){b._onHighlightBandScroll();};var inputDiv=this._timeline.getDocument().createElement("div");inputDiv.className="timeline-band-input";this._timeline.addDiv(inputDiv);this._keyboardInput=document.createElement("input");this._keyboardInput.type="text";inputDiv.appendChild(this._keyboardInput);Timeline.DOM.registerEventWithObject(this._keyboardInput,"keydown",this,this._onKeyDown);Timeline.DOM.registerEventWithObject(this._keyboardInput,"keyup",this,this._onKeyUp);this._div=this._timeline.getDocument().createElement("div");this._div.className="timeline-band";this._timeline.addDiv(this._div);Timeline.DOM.registerEventWithObject(this._div,"mousedown",this,this._onMouseDown);Timeline.DOM.registerEventWithObject(this._div,"mousemove",this,this._onMouseMove);Timeline.DOM.registerEventWithObject(this._div,"mouseup",this,this._onMouseUp);Timeline.DOM.registerEventWithObject(this._div,"mouseout",this,this._onMouseOut);Timeline.DOM.registerEventWithObject(this._div,"dblclick",this,this._onDblClick);this._innerDiv=this._timeline.getDocument().createElement("div");this._innerDiv.className="timeline-band-inner";this._div.appendChild(this._innerDiv);this._ether=bandInfo.ether;bandInfo.ether.initialize(timeline);this._etherPainter=bandInfo.etherPainter;bandInfo.etherPainter.initialize(this,timeline);this._eventSource=bandInfo.eventSource;if(this._eventSource){this._eventListener={onAddMany:function(){b._onAddMany();},onClear:function(){b._onClear();}}
this._eventSource.addListener(this._eventListener);}
this._eventPainter=bandInfo.eventPainter;bandInfo.eventPainter.initialize(this,timeline);this._decorators=("decorators"in bandInfo)?bandInfo.decorators:[];for(var i=0;i<this._decorators.length;i++){this._decorators[i].initialize(this,timeline);}
this._bubble=null;};Timeline._Band.SCROLL_MULTIPLES=5;Timeline._Band.prototype.dispose=function(){this.closeBubble();if(this._eventSource){this._eventSource.removeListener(this._eventListener);this._eventListener=null;this._eventSource=null;}
this._timeline=null;this._bandInfo=null;this._labeller=null;this._ether=null;this._etherPainter=null;this._eventPainter=null;this._decorators=null;this._onScrollListeners=null;this._syncWithBandHandler=null;this._selectorListener=null;this._div=null;this._innerDiv=null;this._keyboardInput=null;this._bubble=null;};Timeline._Band.prototype.addOnScrollListener=function(listener){this._onScrollListeners.push(listener);};Timeline._Band.prototype.removeOnScrollListener=function(listener){for(var i=0;i<this._onScrollListeners.length;i++){if(this._onScrollListeners[i]==listener){this._onScrollListeners.splice(i,1);break;}}};Timeline._Band.prototype.setSyncWithBand=function(band,highlight){if(this._syncWithBand){this._syncWithBand.removeOnScrollListener(this._syncWithBandHandler);}
this._syncWithBand=band;this._syncWithBand.addOnScrollListener(this._syncWithBandHandler);this._highlight=highlight;this._positionHighlight();};Timeline._Band.prototype.getLocale=function(){return this._locale;};Timeline._Band.prototype.getTimeZone=function(){return this._timeZone;};Timeline._Band.prototype.getLabeller=function(){return this._labeller;};Timeline._Band.prototype.getIndex=function(){return this._index;};Timeline._Band.prototype.getEther=function(){return this._ether;};Timeline._Band.prototype.getEtherPainter=function(){return this._etherPainter;};Timeline._Band.prototype.getEventSource=function(){return this._eventSource;};Timeline._Band.prototype.getEventPainter=function(){return this._eventPainter;};Timeline._Band.prototype.layout=function(){this.paint();};Timeline._Band.prototype.paint=function(){this._etherPainter.paint();this._paintDecorators();this._paintEvents();};Timeline._Band.prototype.softLayout=function(){this.softPaint();};Timeline._Band.prototype.softPaint=function(){this._etherPainter.softPaint();this._softPaintDecorators();this._softPaintEvents();};Timeline._Band.prototype.setBandShiftAndWidth=function(shift,width){var inputDiv=this._keyboardInput.parentNode;var middle=shift+Math.floor(width/2);if(this._timeline.isHorizontal()){this._div.style.top=shift+"px";this._div.style.height=width+"px";inputDiv.style.top=middle+"px";inputDiv.style.left="-1em";}else{this._div.style.left=shift+"px";this._div.style.width=width+"px";inputDiv.style.left=middle+"px";inputDiv.style.top="-1em";}};Timeline._Band.prototype.getViewWidth=function(){if(this._timeline.isHorizontal()){return this._div.offsetHeight;}else{return this._div.offsetWidth;}};Timeline._Band.prototype.setViewLength=function(length){this._viewLength=length;this._recenterDiv();this._onChanging();};Timeline._Band.prototype.getViewLength=function(){return this._viewLength;};Timeline._Band.prototype.getTotalViewLength=function(){return Timeline._Band.SCROLL_MULTIPLES*this._viewLength;};Timeline._Band.prototype.getViewOffset=function(){return this._viewOffset;};Timeline._Band.prototype.getMinDate=function(){return this._ether.pixelOffsetToDate(this._viewOffset);};Timeline._Band.prototype.getMaxDate=function(){return this._ether.pixelOffsetToDate(this._viewOffset+Timeline._Band.SCROLL_MULTIPLES*this._viewLength);};Timeline._Band.prototype.getMinVisibleDate=function(){return this._ether.pixelOffsetToDate(0);};Timeline._Band.prototype.getMaxVisibleDate=function(){return this._ether.pixelOffsetToDate(this._viewLength);};Timeline._Band.prototype.getCenterVisibleDate=function(){return this._ether.pixelOffsetToDate(this._viewLength/2);};Timeline._Band.prototype.setMinVisibleDate=function(date){if(!this._changing){this._moveEther(Math.round(-this._ether.dateToPixelOffset(date)));}};Timeline._Band.prototype.setMaxVisibleDate=function(date){if(!this._changing){this._moveEther(Math.round(this._viewLength-this._ether.dateToPixelOffset(date)));}};Timeline._Band.prototype.setCenterVisibleDate=function(date){if(!this._changing){this._moveEther(Math.round(this._viewLength/2-this._ether.dateToPixelOffset(date)));}};Timeline._Band.prototype.dateToPixelOffset=function(date){return this._ether.dateToPixelOffset(date)-this._viewOffset;};Timeline._Band.prototype.pixelOffsetToDate=function(pixels){return this._ether.pixelOffsetToDate(pixels+this._viewOffset);};Timeline._Band.prototype.createLayerDiv=function(zIndex){var div=this._timeline.getDocument().createElement("div");div.className="timeline-band-layer";div.style.zIndex=zIndex;this._innerDiv.appendChild(div);var innerDiv=this._timeline.getDocument().createElement("div");innerDiv.className="timeline-band-layer-inner";if(Timeline.Platform.browser.isIE){innerDiv.style.cursor="move";}else{innerDiv.style.cursor="-moz-grab";}
div.appendChild(innerDiv);return innerDiv;};Timeline._Band.prototype.removeLayerDiv=function(div){this._innerDiv.removeChild(div.parentNode);};Timeline._Band.prototype.closeBubble=function(){if(this._bubble!=null){this._bubble.close();this._bubble=null;}};Timeline._Band.prototype.openBubbleForPoint=function(pageX,pageY,width,height){this.closeBubble();this._bubble=Timeline.Graphics.createBubbleForPoint(this._timeline.getDocument(),pageX,pageY,width,height);return this._bubble.content;};Timeline._Band.prototype.scrollToCenter=function(date){var pixelOffset=this._ether.dateToPixelOffset(date);if(pixelOffset<-this._viewLength/2){this.setCenterVisibleDate(this.pixelOffsetToDate(pixelOffset+this._viewLength));}else if(pixelOffset>3*this._viewLength/2){this.setCenterVisibleDate(this.pixelOffsetToDate(pixelOffset-this._viewLength));}
this._autoScroll(Math.round(this._viewLength/2-this._ether.dateToPixelOffset(date)));};Timeline._Band.prototype._onMouseDown=function(innerFrame,evt,target){this.closeBubble();this._dragging=true;this._dragX=evt.clientX;this._dragY=evt.clientY;};Timeline._Band.prototype._onMouseMove=function(innerFrame,evt,target){if(this._dragging){var diffX=evt.clientX-this._dragX;var diffY=evt.clientY-this._dragY;this._dragX=evt.clientX;this._dragY=evt.clientY;this._moveEther(this._timeline.isHorizontal()?diffX:diffY);this._positionHighlight();}};Timeline._Band.prototype._onMouseUp=function(innerFrame,evt,target){this._dragging=false;this._keyboardInput.focus();};Timeline._Band.prototype._onMouseOut=function(innerFrame,evt,target){var coords=Timeline.DOM.getEventRelativeCoordinates(evt,innerFrame);coords.x+=this._viewOffset;if(coords.x<0||coords.x>innerFrame.offsetWidth||coords.y<0||coords.y>innerFrame.offsetHeight){this._dragging=false;}};Timeline._Band.prototype._onDblClick=function(innerFrame,evt,target){var coords=Timeline.DOM.getEventRelativeCoordinates(evt,innerFrame);var distance=coords.x-(this._viewLength/2-this._viewOffset);this._autoScroll(-distance);};Timeline._Band.prototype._onKeyDown=function(keyboardInput,evt,target){if(!this._dragging){switch(evt.keyCode){case 27:break;case 37:case 38:this._scrollSpeed=Math.min(50,Math.abs(this._scrollSpeed*1.05));this._moveEther(this._scrollSpeed);break;case 39:case 40:this._scrollSpeed=-Math.min(50,Math.abs(this._scrollSpeed*1.05));this._moveEther(this._scrollSpeed);break;default:return true;}
this.closeBubble();Timeline.DOM.cancelEvent(evt);return false;}
return true;};Timeline._Band.prototype._onKeyUp=function(keyboardInput,evt,target){if(!this._dragging){this._scrollSpeed=this._originalScrollSpeed;switch(evt.keyCode){case 35:this.setCenterVisibleDate(this._eventSource.getLatestDate());break;case 36:this.setCenterVisibleDate(this._eventSource.getEarliestDate());break;case 33:this._autoScroll(this._timeline.getPixelLength());break;case 34:this._autoScroll(-this._timeline.getPixelLength());break;default:return true;}
this.closeBubble();Timeline.DOM.cancelEvent(evt);return false;}
return true;};Timeline._Band.prototype._autoScroll=function(distance){var b=this;var a=Timeline.Graphics.createAnimation(function(abs,diff){b._moveEther(diff);},0,distance,1000);a.run();};Timeline._Band.prototype._moveEther=function(shift){this.closeBubble();this._viewOffset+=shift;this._ether.shiftPixels(-shift);if(this._timeline.isHorizontal()){this._div.style.left=this._viewOffset+"px";}else{this._div.style.top=this._viewOffset+"px";}
if(this._viewOffset>-this._viewLength*0.5||this._viewOffset<-this._viewLength*(Timeline._Band.SCROLL_MULTIPLES-1.5)){this._recenterDiv();}else{this.softLayout();}
this._onChanging();}
Timeline._Band.prototype._onChanging=function(){this._changing=true;this._fireOnScroll();this._setSyncWithBandDate();this._changing=false;};Timeline._Band.prototype._fireOnScroll=function(){for(var i=0;i<this._onScrollListeners.length;i++){this._onScrollListeners[i](this);}};Timeline._Band.prototype._setSyncWithBandDate=function(){if(this._syncWithBand){var centerDate=this._ether.pixelOffsetToDate(this.getViewLength()/2);this._syncWithBand.setCenterVisibleDate(centerDate);}};Timeline._Band.prototype._onHighlightBandScroll=function(){if(this._syncWithBand){var centerDate=this._syncWithBand.getCenterVisibleDate();var centerPixelOffset=this._ether.dateToPixelOffset(centerDate);this._moveEther(Math.round(this._viewLength/2-centerPixelOffset));if(this._highlight){this._etherPainter.setHighlight(this._syncWithBand.getMinVisibleDate(),this._syncWithBand.getMaxVisibleDate());}}};Timeline._Band.prototype._onAddMany=function(){this._paintEvents();};Timeline._Band.prototype._onClear=function(){this._paintEvents();};Timeline._Band.prototype._positionHighlight=function(){if(this._syncWithBand){var startDate=this._syncWithBand.getMinVisibleDate();var endDate=this._syncWithBand.getMaxVisibleDate();if(this._highlight){this._etherPainter.setHighlight(startDate,endDate);}}};Timeline._Band.prototype._recenterDiv=function(){this._viewOffset=-this._viewLength*(Timeline._Band.SCROLL_MULTIPLES-1)/2;if(this._timeline.isHorizontal()){this._div.style.left=this._viewOffset+"px";this._div.style.width=(Timeline._Band.SCROLL_MULTIPLES*this._viewLength)+"px";}else{this._div.style.top=this._viewOffset+"px";this._div.style.height=(Timeline._Band.SCROLL_MULTIPLES*this._viewLength)+"px";}
this.layout();};Timeline._Band.prototype._paintEvents=function(){this._eventPainter.paint();};Timeline._Band.prototype._softPaintEvents=function(){this._eventPainter.softPaint();};Timeline._Band.prototype._paintDecorators=function(){for(var i=0;i<this._decorators.length;i++){this._decorators[i].paint();}};Timeline._Band.prototype._softPaintDecorators=function(){for(var i=0;i<this._decorators.length;i++){this._decorators[i].softPaint();}};

/* platform.js */

Timeline.Platform.os={isMac:false,isWin:false,isWin32:false,isUnix:false};Timeline.Platform.browser={isIE:false,isNetscape:false,isMozilla:false,isFirefox:false,isOpera:false,isSafari:false,majorVersion:0,minorVersion:0};(function(){var an=navigator.appName.toLowerCase();var ua=navigator.userAgent.toLowerCase();Timeline.Platform.os.isMac=(ua.indexOf('mac')!=-1);Timeline.Platform.os.isWin=(ua.indexOf('win')!=-1);Timeline.Platform.os.isWin32=Timeline.Platform.isWin&&(ua.indexOf('95')!=-1||ua.indexOf('98')!=-1||ua.indexOf('nt')!=-1||ua.indexOf('win32')!=-1||ua.indexOf('32bit')!=-1);Timeline.Platform.os.isUnix=(ua.indexOf('x11')!=-1);Timeline.Platform.browser.isIE=(an.indexOf("microsoft")!=-1);Timeline.Platform.browser.isNetscape=(an.indexOf("netscape")!=-1);Timeline.Platform.browser.isMozilla=(ua.indexOf("mozilla")!=-1);Timeline.Platform.browser.isFirefox=(ua.indexOf("firefox")!=-1);Timeline.Platform.browser.isOpera=(an.indexOf("opera")!=-1);var parseVersionString=function(s){var a=s.split(".");Timeline.Platform.browser.majorVersion=parseInt(a[0]);Timeline.Platform.browser.minorVersion=parseInt(a[1]);};var indexOf=function(s,sub,start){var i=s.indexOf(sub,start);return i>=0?i:s.length;};if(Timeline.Platform.browser.isMozilla){var offset=ua.indexOf("mozilla/");if(offset>=0){parseVersionString(ua.substring(offset+8,indexOf(ua," ",offset)));}}
if(Timeline.Platform.browser.isIE){var offset=ua.indexOf("msie ");if(offset>=0){parseVersionString(ua.substring(offset+5,indexOf(ua,";",offset)));}}
if(Timeline.Platform.browser.isNetscape){var offset=ua.indexOf("rv:");if(offset>=0){parseVersionString(ua.substring(offset+3,indexOf(ua,")",offset)));}}
if(Timeline.Platform.browser.isFirefox){var offset=ua.indexOf("firefox/");if(offset>=0){parseVersionString(ua.substring(offset+8,indexOf(ua," ",offset)));}}})();Timeline.Platform.getDefaultLocale=function(){return Timeline.Platform.clientLocale;};

/* data-structure.js */

Timeline.SortedArray=function(compare,initialArray){this._a=(initialArray instanceof Array)?initialArray:[];this._compare=compare;};Timeline.SortedArray.prototype.add=function(elmt){var sa=this;var index=this.find(function(elmt2){return sa._compare(elmt2,elmt);});if(index<this._a.length){this._a.splice(index,0,elmt);}else{this._a.push(elmt);}};Timeline.SortedArray.prototype.remove=function(elmt){var sa=this;var index=this.find(function(elmt2){return sa._compare(elmt2,elmt);});while(index<this._a.length&&this._compare(this._a[index],elmt)==0){if(this._a[index]==elmt){this._a.splice(index,1);return true;}else{index++;}}
return false;};Timeline.SortedArray.prototype.removeAll=function(){this._a=[];};Timeline.SortedArray.prototype.elementAt=function(index){return this._a[index];};Timeline.SortedArray.prototype.length=function(){return this._a.length;};Timeline.SortedArray.prototype.find=function(compare){var a=0;var b=this._a.length;while(a<b){var mid=Math.floor((a+b)/2);var c=compare(this._a[mid]);if(mid==a){return c<0?a+1:a;}else if(c<0){a=mid;}else{b=mid;}}
return a;};Timeline.SortedArray.prototype.getFirst=function(){return(this._a.length>0)?this._a[0]:null;};Timeline.SortedArray.prototype.getLast=function(){return(this._a.length>0)?this._a[this._a.length-1]:null;};Timeline.EventIndex=function(unit){var eventIndex=this;this._unit=(unit!=null)?unit:Timeline.NativeDateUnit;this._events=new Timeline.SortedArray(function(event1,event2){return eventIndex._unit.compare(event1.getStart(),event2.getStart());});this._indexed=true;};Timeline.EventIndex.prototype.getUnit=function(){return this._unit;};Timeline.EventIndex.prototype.add=function(evt){this._events.add(evt);this._indexed=false;};Timeline.EventIndex.prototype.removeAll=function(){this._events.removeAll();this._indexed=false;};Timeline.EventIndex.prototype.getCount=function(){return this._events.length();};Timeline.EventIndex.prototype.getIterator=function(startDate,endDate){if(!this._indexed){this._index();}
return new Timeline.EventIndex._Iterator(this._events,startDate,endDate,this._unit);};Timeline.EventIndex.prototype.getAllIterator=function(){return new Timeline.EventIndex._AllIterator(this._events);};Timeline.EventIndex.prototype.getEarliestDate=function(){var evt=this._events.getFirst();return(evt==null)?null:evt.getStart();};Timeline.EventIndex.prototype.getLatestDate=function(){var evt=this._events.getLast();if(evt==null){return null;}
if(!this._indexed){this._index();}
var index=evt._earliestOverlapIndex;var date=this._events.elementAt(index).getEnd();for(var i=index+1;i<this._events.length();i++){date=this._unit.later(date,this._events.elementAt(i).getEnd());}
return date;};Timeline.EventIndex.prototype._index=function(){var l=this._events.length();for(var i=0;i<l;i++){var evt=this._events.elementAt(i);evt._earliestOverlapIndex=i;}
var toIndex=1;for(var i=0;i<l;i++){var evt=this._events.elementAt(i);var end=evt.getEnd();toIndex=Math.max(toIndex,i+1);while(toIndex<l){var evt2=this._events.elementAt(toIndex);var start2=evt2.getStart();if(this._unit.compare(start2,end)<0){evt2._earliestOverlapIndex=i;toIndex++;}else{break;}}}
this._indexed=true;};Timeline.EventIndex._Iterator=function(events,startDate,endDate,unit){this._events=events;this._startDate=startDate;this._endDate=endDate;this._unit=unit;this._currentIndex=events.find(function(evt){return unit.compare(evt.getStart(),startDate);});if(this._currentIndex-1>=0){this._currentIndex=this._events.elementAt(this._currentIndex-1)._earliestOverlapIndex;}
this._currentIndex--;this._maxIndex=events.find(function(evt){return unit.compare(evt.getStart(),endDate);});this._hasNext=false;this._next=null;this._findNext();};Timeline.EventIndex._Iterator.prototype={hasNext:function(){return this._hasNext;},next:function(){if(this._hasNext){var next=this._next;this._findNext();return next;}else{return null;}},_findNext:function(){var unit=this._unit;while((++this._currentIndex)<this._maxIndex){var evt=this._events.elementAt(this._currentIndex);if(unit.compare(evt.getStart(),this._endDate)<0&&unit.compare(evt.getEnd(),this._startDate)>0){this._next=evt;this._hasNext=true;return;}}
this._next=null;this._hasNext=false;}};Timeline.EventIndex._AllIterator=function(events){this._events=events;this._index=0;};Timeline.EventIndex._AllIterator.prototype={hasNext:function(){return this._index<this._events.length();},next:function(){return this._index<this._events.length()?this._events.elementAt(this._index++):null;}};

/* date-time.js */

Timeline.DateTime=new Object();Timeline.DateTime.MILLISECOND=0;Timeline.DateTime.SECOND=1;Timeline.DateTime.MINUTE=2;Timeline.DateTime.HOUR=3;Timeline.DateTime.DAY=4;Timeline.DateTime.WEEK=5;Timeline.DateTime.MONTH=6;Timeline.DateTime.YEAR=7;Timeline.DateTime.DECADE=8;Timeline.DateTime.CENTURY=9;Timeline.DateTime.MILLENNIUM=10;Timeline.DateTime.EPOCH=-1;Timeline.DateTime.ERA=-2;Timeline.DateTime.gregorianUnitLengths=[];(function(){var d=Timeline.DateTime;var a=d.gregorianUnitLengths;a[d.MILLISECOND]=1;a[d.SECOND]=1000;a[d.MINUTE]=a[d.SECOND]*60;a[d.HOUR]=a[d.MINUTE]*60;a[d.DAY]=a[d.HOUR]*24;a[d.WEEK]=a[d.DAY]*7;a[d.MONTH]=a[d.DAY]*31;a[d.YEAR]=a[d.DAY]*365;a[d.DECADE]=a[d.YEAR]*10;a[d.CENTURY]=a[d.YEAR]*100;a[d.MILLENNIUM]=a[d.YEAR]*1000;})();Timeline.DateTime.parseGregorianDateTime=function(o){if(o==null){return null;}else if(o instanceof Date){return o;}
var s=o.toString();if(s.length>0&&s.length<8){var space=s.indexOf(" ");if(space>0){var year=parseInt(s.substr(0,space));var suffix=s.substr(space+1);if(suffix.toLowerCase()=="bc"){year=1-year;}}else{var year=parseInt(s);}
var d=new Date(0);d.setUTCFullYear(year);return d;}
try{return new Date(Date.parse(s));}catch(e){return null;}};Timeline.DateTime._iso8601DateRegExp="^(-?)([0-9]{4})("+["(-?([0-9]{2})(-?([0-9]{2}))?)","(-?([0-9]{3}))","(-?W([0-9]{2})(-?([1-7]))?)"].join("|")+")?$";Timeline.DateTime.setIso8601Date=function(dateObject,string){var regexp=Timeline.DateTime._iso8601DateRegExp;var d=string.match(new RegExp(regexp));if(!d){throw new Error("Invalid date string: "+string);}
var sign=(d[1]=="-")?-1:1;var year=sign*d[2];var month=d[5];var date=d[7];var dayofyear=d[9];var week=d[11];var dayofweek=(d[13])?d[13]:1;dateObject.setUTCFullYear(year);if(dayofyear){dateObject.setUTCMonth(0);dateObject.setUTCDate(Number(dayofyear));}else if(week){dateObject.setUTCMonth(0);dateObject.setUTCDate(1);var gd=dateObject.getUTCDay();var day=(gd)?gd:7;var offset=Number(dayofweek)+(7*Number(week));if(day<=4){dateObject.setUTCDate(offset+1-day);}else{dateObject.setUTCDate(offset+8-day);}}else{if(month){dateObject.setUTCDate(1);dateObject.setUTCMonth(month-1);}
if(date){dateObject.setUTCDate(date);}}
return dateObject;};Timeline.DateTime.setIso8601Time=function(dateObject,string){var timezone="Z|(([-+])([0-9]{2})(:?([0-9]{2}))?)$";var d=string.match(new RegExp(timezone));var offset=0;if(d){if(d[0]!='Z'){offset=(Number(d[3])*60)+Number(d[5]);offset*=((d[2]=='-')?1:-1);}
string=string.substr(0,string.length-d[0].length);}
var regexp="^([0-9]{2})(:?([0-9]{2})(:?([0-9]{2})(\.([0-9]+))?)?)?$";var d=string.match(new RegExp(regexp));if(!d){dojo.debug("invalid time string: "+string);return false;}
var hours=d[1];var mins=Number((d[3])?d[3]:0);var secs=(d[5])?d[5]:0;var ms=d[7]?(Number("0."+d[7])*1000):0;dateObject.setUTCHours(hours);dateObject.setUTCMinutes(mins);dateObject.setUTCSeconds(secs);dateObject.setUTCMilliseconds(ms);return dateObject;};Timeline.DateTime.setIso8601=function(dateObject,string){var comps=(string.indexOf("T")==-1)?string.split(" "):string.split("T");Timeline.DateTime.setIso8601Date(dateObject,comps[0]);if(comps.length==2){Timeline.DateTime.setIso8601Time(dateObject,comps[1]);}
return dateObject;};Timeline.DateTime.parseIso8601DateTime=function(string){try{return Timeline.DateTime.setIso8601(new Date(0),string);}catch(e){return null;}};Timeline.DateTime.roundDownToInterval=function(date,intervalUnit,timeZone,multiple,firstDayOfWeek){var timeShift=timeZone*Timeline.DateTime.gregorianUnitLengths[Timeline.DateTime.HOUR];var date2=new Date(date.getTime()+timeShift);var clearInDay=function(d){d.setUTCMilliseconds(0);d.setUTCSeconds(0);d.setUTCMinutes(0);d.setUTCHours(0);};var clearInYear=function(d){clearInDay(d);d.setUTCDate(1);d.setUTCMonth(0);};switch(intervalUnit){case Timeline.DateTime.MILLISECOND:var x=date2.getUTCMilliseconds();date2.setUTCMilliseconds(x-(x%multiple));break;case Timeline.DateTime.SECOND:date2.setUTCMilliseconds(0);var x=date2.getUTCSeconds();date2.setUTCSeconds(x-(x%multiple));break;case Timeline.DateTime.MINUTE:date2.setUTCMilliseconds(0);date2.setUTCSeconds(0);var x=date2.getUTCMinutes();date2.setTime(date2.getTime()-
(x%multiple)*Timeline.DateTime.gregorianUnitLengths[Timeline.DateTime.MINUTE]);break;case Timeline.DateTime.HOUR:date2.setUTCMilliseconds(0);date2.setUTCSeconds(0);date2.setUTCMinutes(0);var x=date2.getUTCHours();date2.setUTCHours(x-(x%multiple));break;case Timeline.DateTime.DAY:clearInDay(date2);break;case Timeline.DateTime.WEEK:clearInDay(date2);var d=(date2.getUTCDay()+7-firstDayOfWeek)%7;date2.setTime(date2.getTime()-
d*Timeline.DateTime.gregorianUnitLengths[Timeline.DateTime.DAY]);break;case Timeline.DateTime.MONTH:clearInDay(date2);date2.setUTCDate(1);var x=date2.getUTCMonth();date2.setUTCMonth(x-(x%multiple));break;case Timeline.DateTime.YEAR:clearInYear(date2);var x=date2.getUTCFullYear();date2.setUTCFullYear(x-(x%multiple));break;case Timeline.DateTime.DECADE:clearInYear(date2);date2.setUTCFullYear(Math.floor(date2.getUTCFullYear()/10)*10);break;case Timeline.DateTime.CENTURY:clearInYear(date2);date2.setUTCFullYear(Math.floor(date2.getUTCFullYear()/100)*100);break;case Timeline.DateTime.MILLENNIUM:clearInYear(date2);date2.setUTCFullYear(Math.floor(date2.getUTCFullYear()/1000)*1000);break;}
date.setTime(date2.getTime()-timeShift);};Timeline.DateTime.roundUpToInterval=function(date,intervalUnit,timeZone,multiple,firstDayOfWeek){var originalTime=date.getTime();Timeline.DateTime.roundDownToInterval(date,intervalUnit,timeZone,multiple,firstDayOfWeek);if(date.getTime()<originalTime){date.setTime(date.getTime()+
Timeline.DateTime.gregorianUnitLengths[intervalUnit]*multiple);}};Timeline.DateTime.incrementByInterval=function(date,intervalUnit){switch(intervalUnit){case Timeline.DateTime.MILLISECOND:date.setTime(date.getTime()+1)
break;case Timeline.DateTime.SECOND:date.setTime(date.getTime()+1000);break;case Timeline.DateTime.MINUTE:date.setTime(date.getTime()+
Timeline.DateTime.gregorianUnitLengths[Timeline.DateTime.MINUTE]);break;case Timeline.DateTime.HOUR:date.setTime(date.getTime()+
Timeline.DateTime.gregorianUnitLengths[Timeline.DateTime.HOUR]);break;case Timeline.DateTime.DAY:date.setUTCDate(date.getUTCDate()+1);break;case Timeline.DateTime.WEEK:date.setUTCDate(date.getUTCDate()+7);break;case Timeline.DateTime.MONTH:date.setUTCMonth(date.getUTCMonth()+1);break;case Timeline.DateTime.YEAR:date.setUTCFullYear(date.getUTCFullYear()+1);break;case Timeline.DateTime.DECADE:date.setUTCFullYear(date.getUTCFullYear()+10);break;case Timeline.DateTime.CENTURY:date.setUTCFullYear(date.getUTCFullYear()+100);break;case Timeline.DateTime.MILLENNIUM:date.setUTCFullYear(date.getUTCFullYear()+1000);break;}};Timeline.DateTime.removeTimeZoneOffset=function(date,timeZone){return new Date(date.getTime()+
timeZone*Timeline.DateTime.gregorianUnitLengths[Timeline.DateTime.HOUR]);};

/* debug.js */

Timeline.Debug=new Object();Timeline.Debug.log=function(msg){};Timeline.Debug.exception=function(e){alert("Caught exception: "+(Timeline.Platform.isIE?e.message:e));};

/* dom.js */

Timeline.DOM=new Object();Timeline.DOM.registerEventWithObject=function(elmt,eventName,obj,handler){Timeline.DOM.registerEvent(elmt,eventName,function(elmt2,evt,target){return handler.call(obj,elmt2,evt,target);});};Timeline.DOM.registerEvent=function(elmt,eventName,handler){var handler2=function(evt){evt=(evt)?evt:((event)?event:null);if(evt){var target=(evt.target)?evt.target:((evt.srcElement)?evt.srcElement:null);if(target){target=(target.nodeType==1||target.nodeType==9)?target:target.parentNode;}
return handler(elmt,evt,target);}
return true;}
if(Timeline.Platform.browser.isIE){elmt.attachEvent("on"+eventName,handler2);}else{elmt.addEventListener(eventName,handler2,false);}};Timeline.DOM.getPageCoordinates=function(elmt){var left=0;var top=0;if(elmt.nodeType!=1){elmt=elmt.parentNode;}
while(elmt!=null){left+=elmt.offsetLeft;top+=elmt.offsetTop;elmt=elmt.offsetParent;}
return{left:left,top:top};};Timeline.DOM.getEventRelativeCoordinates=function(evt,elmt){if(Timeline.Platform.browser.isIE){return{x:evt.offsetX,y:evt.offsetY};}else{var coords=Timeline.DOM.getPageCoordinates(elmt);return{x:evt.pageX-coords.left,y:evt.pageY-coords.top};}};Timeline.DOM.cancelEvent=function(evt){evt.returnValue=false;evt.cancelBubble=true;if("preventDefault"in evt){evt.preventDefault();}};

/* graphics.js */

Timeline.Graphics=new Object();Timeline.Graphics.pngIsTranslucent=(!Timeline.Platform.browser.isIE)||(Timeline.Platform.browser.majorVersion>6);Timeline.Graphics.createTranslucentImage=function(doc,url,verticalAlign){var elmt;if(Timeline.Graphics.pngIsTranslucent){elmt=doc.createElement("img");elmt.setAttribute("src",url);}else{elmt=doc.createElement("img");elmt.style.display="inline";elmt.style.width="1px";elmt.style.height="1px";elmt.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+url+"', sizingMethod='image')";}
elmt.style.verticalAlign=(verticalAlign!=null)?verticalAlign:"middle";return elmt;};Timeline.Graphics.setOpacity=function(elmt,opacity){if(Timeline.Platform.browser.isIE){elmt.style.filter="progid:DXImageTransform.Microsoft.Alpha(Style=0,Opacity="+opacity+")";}else{var o=(opacity/100).toString();elmt.style.opacity=o;elmt.style.MozOpacity=o;}};Timeline.Graphics._bubbleMargins={top:33,bottom:42,left:33,right:40}
Timeline.Graphics._arrowOffsets={top:0,bottom:9,left:1,right:8}
Timeline.Graphics._bubblePadding=15;Timeline.Graphics._bubblePointOffset=6;Timeline.Graphics._halfArrowWidth=18;Timeline.Graphics.createBubbleForPoint=function(doc,pageX,pageY,contentWidth,contentHeight){var bubble={_closed:false,_doc:doc,close:function(){if(!this._closed){this._doc.body.removeChild(this._div);this._doc=null;this._div=null;this._content=null;this._closed=true;}}};var docWidth=doc.body.offsetWidth;var docHeight=doc.body.offsetHeight;var margins=Timeline.Graphics._bubbleMargins;var bubbleWidth=margins.left+contentWidth+margins.right;var bubbleHeight=margins.top+contentHeight+margins.bottom;var pngIsTranslucent=Timeline.Graphics.pngIsTranslucent;var urlPrefix=Timeline.urlPrefix;var setImg=function(elmt,url,width,height){elmt.style.position="absolute";elmt.style.width=width+"px";elmt.style.height=height+"px";if(pngIsTranslucent){elmt.style.background="url("+url+")";}else{elmt.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+url+"', sizingMethod='crop')";}}
var div=doc.createElement("div");div.style.width=bubbleWidth+"px";div.style.height=bubbleHeight+"px";div.style.position="absolute";div.style.zIndex=1000;bubble._div=div;var divInner=doc.createElement("div");divInner.style.width="100%";divInner.style.height="100%";divInner.style.position="relative";div.appendChild(divInner);var createImg=function(url,left,top,width,height){var divImg=doc.createElement("div");divImg.style.left=left+"px";divImg.style.top=top+"px";setImg(divImg,url,width,height);divInner.appendChild(divImg);}
createImg(urlPrefix+"images/bubble-top-left.png",0,0,margins.left,margins.top);createImg(urlPrefix+"images/bubble-top.png",margins.left,0,contentWidth,margins.top);createImg(urlPrefix+"images/bubble-top-right.png",margins.left+contentWidth,0,margins.right,margins.top);createImg(urlPrefix+"images/bubble-left.png",0,margins.top,margins.left,contentHeight);createImg(urlPrefix+"images/bubble-right.png",margins.left+contentWidth,margins.top,margins.right,contentHeight);createImg(urlPrefix+"images/bubble-bottom-left.png",0,margins.top+contentHeight,margins.left,margins.bottom);createImg(urlPrefix+"images/bubble-bottom.png",margins.left,margins.top+contentHeight,contentWidth,margins.bottom);createImg(urlPrefix+"images/bubble-bottom-right.png",margins.left+contentWidth,margins.top+contentHeight,margins.right,margins.bottom);var divClose=doc.createElement("div");divClose.style.left=(bubbleWidth-margins.right+Timeline.Graphics._bubblePadding-16-2)+"px";divClose.style.top=(margins.top-Timeline.Graphics._bubblePadding+1)+"px";divClose.style.cursor="pointer";setImg(divClose,urlPrefix+"images/close-button.png",16,16);Timeline.DOM.registerEventWithObject(divClose,"click",bubble,bubble.close);divInner.appendChild(divClose);var divContent=doc.createElement("div");divContent.style.position="absolute";divContent.style.left=margins.left+"px";divContent.style.top=margins.top+"px";divContent.style.width=contentWidth+"px";divContent.style.height=contentHeight+"px";divContent.style.overflow="auto";divContent.style.background="white";divInner.appendChild(divContent);bubble.content=divContent;(function(){if(pageX-Timeline.Graphics._halfArrowWidth-Timeline.Graphics._bubblePadding>0&&pageX+Timeline.Graphics._halfArrowWidth+Timeline.Graphics._bubblePadding<docWidth){var left=pageX-Math.round(contentWidth/2)-margins.left;left=pageX<(docWidth/2)?Math.max(left,-(margins.left-Timeline.Graphics._bubblePadding)):Math.min(left,docWidth+(margins.right-Timeline.Graphics._bubblePadding)-bubbleWidth);if(pageY-Timeline.Graphics._bubblePointOffset-bubbleHeight>0){var divImg=doc.createElement("div");divImg.style.left=(pageX-Timeline.Graphics._halfArrowWidth-left)+"px";divImg.style.top=(margins.top+contentHeight)+"px";setImg(divImg,urlPrefix+"images/bubble-bottom-arrow.png",37,margins.bottom);divInner.appendChild(divImg);div.style.left=left+"px";div.style.top=(pageY-Timeline.Graphics._bubblePointOffset-bubbleHeight+
Timeline.Graphics._arrowOffsets.bottom)+"px";return;}else if(pageY+Timeline.Graphics._bubblePointOffset+bubbleHeight<docHeight){var divImg=doc.createElement("div");divImg.style.left=(pageX-Timeline.Graphics._halfArrowWidth-left)+"px";divImg.style.top="0px";setImg(divImg,urlPrefix+"images/bubble-top-arrow.png",37,margins.top);divInner.appendChild(divImg);div.style.left=left+"px";div.style.top=(pageY+Timeline.Graphics._bubblePointOffset-
Timeline.Graphics._arrowOffsets.top)+"px";return;}}
var top=pageY-Math.round(contentHeight/2)-margins.top;top=pageY<(docHeight/2)?Math.max(top,-(margins.top-Timeline.Graphics._bubblePadding)):Math.min(top,docHeight+(margins.bottom-Timeline.Graphics._bubblePadding)-bubbleHeight);if(pageX-Timeline.Graphics._bubblePointOffset-bubbleWidth>0){var divImg=doc.createElement("div");divImg.style.left=(margins.left+contentWidth)+"px";divImg.style.top=(pageY-Timeline.Graphics._halfArrowWidth-top)+"px";setImg(divImg,urlPrefix+"images/bubble-right-arrow.png",margins.right,37);divInner.appendChild(divImg);div.style.left=(pageX-Timeline.Graphics._bubblePointOffset-bubbleWidth+
Timeline.Graphics._arrowOffsets.right)+"px";div.style.top=top+"px";}else{var divImg=doc.createElement("div");divImg.style.left="0px";divImg.style.top=(pageY-Timeline.Graphics._halfArrowWidth-top)+"px";setImg(divImg,urlPrefix+"images/bubble-left-arrow.png",margins.left,37);divInner.appendChild(divImg);div.style.left=(pageX+Timeline.Graphics._bubblePointOffset-
Timeline.Graphics._arrowOffsets.left)+"px";div.style.top=top+"px";}})();doc.body.appendChild(div);return bubble;};Timeline.Graphics.createMessageBubble=function(doc){var containerDiv=doc.createElement("div");if(Timeline.Graphics.pngIsTranslucent){var topDiv=doc.createElement("div");topDiv.style.height="33px";topDiv.style.background="url("+Timeline.urlPrefix+"images/message-top-left.png) top left no-repeat";topDiv.style.paddingLeft="44px";containerDiv.appendChild(topDiv);var topRightDiv=doc.createElement("div");topRightDiv.style.height="33px";topRightDiv.style.background="url("+Timeline.urlPrefix+"images/message-top-right.png) top right no-repeat";topDiv.appendChild(topRightDiv);var middleDiv=doc.createElement("div");middleDiv.style.background="url("+Timeline.urlPrefix+"images/message-left.png) top left repeat-y";middleDiv.style.paddingLeft="44px";containerDiv.appendChild(middleDiv);var middleRightDiv=doc.createElement("div");middleRightDiv.style.background="url("+Timeline.urlPrefix+"images/message-right.png) top right repeat-y";middleRightDiv.style.paddingRight="44px";middleDiv.appendChild(middleRightDiv);var contentDiv=doc.createElement("div");middleRightDiv.appendChild(contentDiv);var bottomDiv=doc.createElement("div");bottomDiv.style.height="55px";bottomDiv.style.background="url("+Timeline.urlPrefix+"images/message-bottom-left.png) bottom left no-repeat";bottomDiv.style.paddingLeft="44px";containerDiv.appendChild(bottomDiv);var bottomRightDiv=doc.createElement("div");bottomRightDiv.style.height="55px";bottomRightDiv.style.background="url("+Timeline.urlPrefix+"images/message-bottom-right.png) bottom right no-repeat";bottomDiv.appendChild(bottomRightDiv);}else{containerDiv.style.border="2px solid #7777AA";containerDiv.style.padding="20px";containerDiv.style.background="white";Timeline.Graphics.setOpacity(containerDiv,90);var contentDiv=doc.createElement("div");containerDiv.appendChild(contentDiv);}
return{containerDiv:containerDiv,contentDiv:contentDiv};};Timeline.Graphics.createAnimation=function(f,from,to,duration){return new Timeline.Graphics._Animation(f,from,to,duration);};Timeline.Graphics._Animation=function(f,from,to,duration){this.f=f;this.from=from;this.to=to;this.current=from;this.duration=duration;this.start=new Date().getTime();this.timePassed=0;};Timeline.Graphics._Animation.prototype.run=function(){var a=this;window.setTimeout(function(){a.step();},100);};Timeline.Graphics._Animation.prototype.step=function(){this.timePassed+=100;var timePassedFraction=this.timePassed/this.duration;var parameterFraction=-Math.cos(timePassedFraction*Math.PI)/2+0.5;var current=parameterFraction*(this.to-this.from)+this.from;try{this.f(current,current-this.current);}catch(e){}
this.current=current;if(this.timePassed<this.duration){this.run();}};

/* html.js */

Timeline.HTML=new Object();Timeline.HTML._e2uHash={};(function(){e2uHash=Timeline.HTML._e2uHash;e2uHash['nbsp']='\u00A0[space]';e2uHash['iexcl']='\u00A1';e2uHash['cent']='\u00A2';e2uHash['pound']='\u00A3';e2uHash['curren']='\u00A4';e2uHash['yen']='\u00A5';e2uHash['brvbar']='\u00A6';e2uHash['sect']='\u00A7';e2uHash['uml']='\u00A8';e2uHash['copy']='\u00A9';e2uHash['ordf']='\u00AA';e2uHash['laquo']='\u00AB';e2uHash['not']='\u00AC';e2uHash['shy']='\u00AD';e2uHash['reg']='\u00AE';e2uHash['macr']='\u00AF';e2uHash['deg']='\u00B0';e2uHash['plusmn']='\u00B1';e2uHash['sup2']='\u00B2';e2uHash['sup3']='\u00B3';e2uHash['acute']='\u00B4';e2uHash['micro']='\u00B5';e2uHash['para']='\u00B6';e2uHash['middot']='\u00B7';e2uHash['cedil']='\u00B8';e2uHash['sup1']='\u00B9';e2uHash['ordm']='\u00BA';e2uHash['raquo']='\u00BB';e2uHash['frac14']='\u00BC';e2uHash['frac12']='\u00BD';e2uHash['frac34']='\u00BE';e2uHash['iquest']='\u00BF';e2uHash['Agrave']='\u00C0';e2uHash['Aacute']='\u00C1';e2uHash['Acirc']='\u00C2';e2uHash['Atilde']='\u00C3';e2uHash['Auml']='\u00C4';e2uHash['Aring']='\u00C5';e2uHash['AElig']='\u00C6';e2uHash['Ccedil']='\u00C7';e2uHash['Egrave']='\u00C8';e2uHash['Eacute']='\u00C9';e2uHash['Ecirc']='\u00CA';e2uHash['Euml']='\u00CB';e2uHash['Igrave']='\u00CC';e2uHash['Iacute']='\u00CD';e2uHash['Icirc']='\u00CE';e2uHash['Iuml']='\u00CF';e2uHash['ETH']='\u00D0';e2uHash['Ntilde']='\u00D1';e2uHash['Ograve']='\u00D2';e2uHash['Oacute']='\u00D3';e2uHash['Ocirc']='\u00D4';e2uHash['Otilde']='\u00D5';e2uHash['Ouml']='\u00D6';e2uHash['times']='\u00D7';e2uHash['Oslash']='\u00D8';e2uHash['Ugrave']='\u00D9';e2uHash['Uacute']='\u00DA';e2uHash['Ucirc']='\u00DB';e2uHash['Uuml']='\u00DC';e2uHash['Yacute']='\u00DD';e2uHash['THORN']='\u00DE';e2uHash['szlig']='\u00DF';e2uHash['agrave']='\u00E0';e2uHash['aacute']='\u00E1';e2uHash['acirc']='\u00E2';e2uHash['atilde']='\u00E3';e2uHash['auml']='\u00E4';e2uHash['aring']='\u00E5';e2uHash['aelig']='\u00E6';e2uHash['ccedil']='\u00E7';e2uHash['egrave']='\u00E8';e2uHash['eacute']='\u00E9';e2uHash['ecirc']='\u00EA';e2uHash['euml']='\u00EB';e2uHash['igrave']='\u00EC';e2uHash['iacute']='\u00ED';e2uHash['icirc']='\u00EE';e2uHash['iuml']='\u00EF';e2uHash['eth']='\u00F0';e2uHash['ntilde']='\u00F1';e2uHash['ograve']='\u00F2';e2uHash['oacute']='\u00F3';e2uHash['ocirc']='\u00F4';e2uHash['otilde']='\u00F5';e2uHash['ouml']='\u00F6';e2uHash['divide']='\u00F7';e2uHash['oslash']='\u00F8';e2uHash['ugrave']='\u00F9';e2uHash['uacute']='\u00FA';e2uHash['ucirc']='\u00FB';e2uHash['uuml']='\u00FC';e2uHash['yacute']='\u00FD';e2uHash['thorn']='\u00FE';e2uHash['yuml']='\u00FF';e2uHash['quot']='\u0022';e2uHash['amp']='\u0026';e2uHash['lt']='\u003C';e2uHash['gt']='\u003E';e2uHash['OElig']='';e2uHash['oelig']='\u0153';e2uHash['Scaron']='\u0160';e2uHash['scaron']='\u0161';e2uHash['Yuml']='\u0178';e2uHash['circ']='\u02C6';e2uHash['tilde']='\u02DC';e2uHash['ensp']='\u2002';e2uHash['emsp']='\u2003';e2uHash['thinsp']='\u2009';e2uHash['zwnj']='\u200C';e2uHash['zwj']='\u200D';e2uHash['lrm']='\u200E';e2uHash['rlm']='\u200F';e2uHash['ndash']='\u2013';e2uHash['mdash']='\u2014';e2uHash['lsquo']='\u2018';e2uHash['rsquo']='\u2019';e2uHash['sbquo']='\u201A';e2uHash['ldquo']='\u201C';e2uHash['rdquo']='\u201D';e2uHash['bdquo']='\u201E';e2uHash['dagger']='\u2020';e2uHash['Dagger']='\u2021';e2uHash['permil']='\u2030';e2uHash['lsaquo']='\u2039';e2uHash['rsaquo']='\u203A';e2uHash['euro']='\u20AC';e2uHash['fnof']='\u0192';e2uHash['Alpha']='\u0391';e2uHash['Beta']='\u0392';e2uHash['Gamma']='\u0393';e2uHash['Delta']='\u0394';e2uHash['Epsilon']='\u0395';e2uHash['Zeta']='\u0396';e2uHash['Eta']='\u0397';e2uHash['Theta']='\u0398';e2uHash['Iota']='\u0399';e2uHash['Kappa']='\u039A';e2uHash['Lambda']='\u039B';e2uHash['Mu']='\u039C';e2uHash['Nu']='\u039D';e2uHash['Xi']='\u039E';e2uHash['Omicron']='\u039F';e2uHash['Pi']='\u03A0';e2uHash['Rho']='\u03A1';e2uHash['Sigma']='\u03A3';e2uHash['Tau']='\u03A4';e2uHash['Upsilon']='\u03A5';e2uHash['Phi']='\u03A6';e2uHash['Chi']='\u03A7';e2uHash['Psi']='\u03A8';e2uHash['Omega']='\u03A9';e2uHash['alpha']='\u03B1';e2uHash['beta']='\u03B2';e2uHash['gamma']='\u03B3';e2uHash['delta']='\u03B4';e2uHash['epsilon']='\u03B5';e2uHash['zeta']='\u03B6';e2uHash['eta']='\u03B7';e2uHash['theta']='\u03B8';e2uHash['iota']='\u03B9';e2uHash['kappa']='\u03BA';e2uHash['lambda']='\u03BB';e2uHash['mu']='\u03BC';e2uHash['nu']='\u03BD';e2uHash['xi']='\u03BE';e2uHash['omicron']='\u03BF';e2uHash['pi']='\u03C0';e2uHash['rho']='\u03C1';e2uHash['sigmaf']='\u03C2';e2uHash['sigma']='\u03C3';e2uHash['tau']='\u03C4';e2uHash['upsilon']='\u03C5';e2uHash['phi']='\u03C6';e2uHash['chi']='\u03C7';e2uHash['psi']='\u03C8';e2uHash['omega']='\u03C9';e2uHash['thetasym']='\u03D1';e2uHash['upsih']='\u03D2';e2uHash['piv']='\u03D6';e2uHash['bull']='\u2022';e2uHash['hellip']='\u2026';e2uHash['prime']='\u2032';e2uHash['Prime']='\u2033';e2uHash['oline']='\u203E';e2uHash['frasl']='\u2044';e2uHash['weierp']='\u2118';e2uHash['image']='\u2111';e2uHash['real']='\u211C';e2uHash['trade']='\u2122';e2uHash['alefsym']='\u2135';e2uHash['larr']='\u2190';e2uHash['uarr']='\u2191';e2uHash['rarr']='\u2192';e2uHash['darr']='\u2193';e2uHash['harr']='\u2194';e2uHash['crarr']='\u21B5';e2uHash['lArr']='\u21D0';e2uHash['uArr']='\u21D1';e2uHash['rArr']='\u21D2';e2uHash['dArr']='\u21D3';e2uHash['hArr']='\u21D4';e2uHash['forall']='\u2200';e2uHash['part']='\u2202';e2uHash['exist']='\u2203';e2uHash['empty']='\u2205';e2uHash['nabla']='\u2207';e2uHash['isin']='\u2208';e2uHash['notin']='\u2209';e2uHash['ni']='\u220B';e2uHash['prod']='\u220F';e2uHash['sum']='\u2211';e2uHash['minus']='\u2212';e2uHash['lowast']='\u2217';e2uHash['radic']='\u221A';e2uHash['prop']='\u221D';e2uHash['infin']='\u221E';e2uHash['ang']='\u2220';e2uHash['and']='\u2227';e2uHash['or']='\u2228';e2uHash['cap']='\u2229';e2uHash['cup']='\u222A';e2uHash['int']='\u222B';e2uHash['there4']='\u2234';e2uHash['sim']='\u223C';e2uHash['cong']='\u2245';e2uHash['asymp']='\u2248';e2uHash['ne']='\u2260';e2uHash['equiv']='\u2261';e2uHash['le']='\u2264';e2uHash['ge']='\u2265';e2uHash['sub']='\u2282';e2uHash['sup']='\u2283';e2uHash['nsub']='\u2284';e2uHash['sube']='\u2286';e2uHash['supe']='\u2287';e2uHash['oplus']='\u2295';e2uHash['otimes']='\u2297';e2uHash['perp']='\u22A5';e2uHash['sdot']='\u22C5';e2uHash['lceil']='\u2308';e2uHash['rceil']='\u2309';e2uHash['lfloor']='\u230A';e2uHash['rfloor']='\u230B';e2uHash['lang']='\u2329';e2uHash['rang']='\u232A';e2uHash['loz']='\u25CA';e2uHash['spades']='\u2660';e2uHash['clubs']='\u2663';e2uHash['hearts']='\u2665';e2uHash['diams']='\u2666';})();Timeline.HTML.deEntify=function(s){e2uHash=Timeline.HTML._e2uHash;var re=/&(\w+?);/;while(re.test(s)){var m=s.match(re);s=s.replace(re,e2uHash[m[1]]);}
return s;};

/* xmlhttp.js */

Timeline.XmlHttp=new Object();Timeline.XmlHttp._onReadyStateChange=function(xmlhttp,fError,fDone){switch(xmlhttp.readyState){case 4:try{if(xmlhttp.status==0||xmlhttp.status==200){if(fDone){fDone(xmlhttp);}}else{if(fError){fError(xmlhttp.statusText,xmlhttp.status,xmlhttp);}}}catch(e){Timeline.Debug.exception(e);}
break;}};Timeline.XmlHttp._createRequest=function(){if(Timeline.Platform.browser.isIE){var programIDs=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];for(var i=0;i<programIDs.length;i++){try{var programID=programIDs[i];var f=function(){return new ActiveXObject(programID);};var o=f();Timeline.XmlHttp._createRequest=f;return o;}catch(e){}}
throw new Error("Failed to create an XMLHttpRequest object");}else{try{var f=function(){return new XMLHttpRequest();};var o=f();Timeline.XmlHttp._createRequest=f;return o;}catch(e){throw new Error("Failed to create an XMLHttpRequest object");}}};Timeline.XmlHttp.get=function(url,fError,fDone){var xmlhttp=Timeline.XmlHttp._createRequest();xmlhttp.open("GET",url,true);xmlhttp.onreadystatechange=function(){Timeline.XmlHttp._onReadyStateChange(xmlhttp,fError,fDone);};xmlhttp.send(null);};Timeline.XmlHttp.post=function(url,body,fError,fDone){var xmlhttp=Timeline.XmlHttp._createRequest();xmlhttp.open("POST",url,true);xmlhttp.onreadystatechange=function(){Timeline.XmlHttp._onReadyStateChange(xmlhttp,fError,fDone);};xmlhttp.send(body);};Timeline.XmlHttp._forceXML=function(xmlhttp){try{xmlhttp.overrideMimeType("text/xml");}catch(e){xmlhttp.setrequestheader("Content-Type","text/xml");}};

/* decorators.js */

Timeline.SpanHighlightDecorator=function(params){this._unit=("unit"in params)?params.unit:Timeline.NativeDateUnit;this._startDate=(typeof params.startDate=="string")?this._unit.parseFromObject(params.startDate):params.startDate;this._endDate=(typeof params.endDate=="string")?this._unit.parseFromObject(params.endDate):params.endDate;this._startLabel=params.startLabel;this._endLabel=params.endLabel;this._color=params.color;this._opacity=("opacity"in params)?params.opacity:100;};Timeline.SpanHighlightDecorator.prototype.initialize=function(band,timeline){this._band=band;this._timeline=timeline;this._layerDiv=null;};Timeline.SpanHighlightDecorator.prototype.paint=function(){if(this._layerDiv!=null){this._band.removeLayerDiv(this._layerDiv);}
this._layerDiv=this._band.createLayerDiv(10);this._layerDiv.setAttribute("name","span-highlight-decorator");this._layerDiv.style.display="none";var minDate=this._band.getMinDate();var maxDate=this._band.getMaxDate();if(this._unit.compare(this._startDate,maxDate)<0&&this._unit.compare(this._endDate,minDate)>0){minDate=this._unit.later(minDate,this._startDate);maxDate=this._unit.earlier(maxDate,this._endDate);var minPixel=this._band.dateToPixelOffset(minDate);var maxPixel=this._band.dateToPixelOffset(maxDate);var doc=this._timeline.getDocument();var createTable=function(){var table=doc.createElement("table");table.insertRow(0).insertCell(0);return table;};var div=doc.createElement("div");div.style.position="absolute";div.style.overflow="hidden";div.style.background=this._color;if(this._opacity<100){Timeline.Graphics.setOpacity(div,this._opacity);}
this._layerDiv.appendChild(div);var tableStartLabel=createTable();tableStartLabel.style.position="absolute";tableStartLabel.style.overflow="hidden";tableStartLabel.style.fontSize="300%";tableStartLabel.style.fontWeight="bold";tableStartLabel.style.color=this._color;tableStartLabel.rows[0].cells[0].innerHTML=this._startLabel;this._layerDiv.appendChild(tableStartLabel);var tableEndLabel=createTable();tableEndLabel.style.position="absolute";tableEndLabel.style.overflow="hidden";tableEndLabel.style.fontSize="300%";tableEndLabel.style.fontWeight="bold";tableEndLabel.style.color=this._color;tableEndLabel.rows[0].cells[0].innerHTML=this._endLabel;this._layerDiv.appendChild(tableEndLabel);if(this._timeline.isHorizontal()){div.style.left=minPixel+"px";div.style.width=(maxPixel-minPixel)+"px";div.style.top="0px";div.style.height="100%";tableStartLabel.style.right=(this._band.getTotalViewLength()-minPixel)+"px";tableStartLabel.style.width=(this._startLabel.length)+"em";tableStartLabel.style.top="0px";tableStartLabel.style.height="100%";tableStartLabel.style.textAlign="right";tableEndLabel.style.left=maxPixel+"px";tableEndLabel.style.width=(this._endLabel.length)+"em";tableEndLabel.style.top="0px";tableEndLabel.style.height="100%";}else{div.style.top=minPixel+"px";div.style.height=(maxPixel-minPixel)+"px";div.style.left="0px";div.style.width="100%";tableStartLabel.style.bottom=minPixel+"px";tableStartLabel.style.height="1.5px";tableStartLabel.style.left="0px";tableStartLabel.style.width="100%";tableEndLabel.style.top=maxPixel+"px";tableEndLabel.style.height="1.5px";tableEndLabel.style.left="0px";tableEndLabel.style.width="100%";}}
this._layerDiv.style.display="block";};Timeline.SpanHighlightDecorator.prototype.softPaint=function(){};Timeline.PointHighlightDecorator=function(params){this._unit=("unit"in params)?params.unit:Timeline.NativeDateUnit;this._date=(typeof params.date=="string")?this._unit.parseFromObject(params.date):params.date;this._width=("width"in params)?params.width:10;this._color=params.color;this._opacity=("opacity"in params)?params.opacity:100;};Timeline.PointHighlightDecorator.prototype.initialize=function(band,timeline){this._band=band;this._timeline=timeline;this._layerDiv=null;};Timeline.PointHighlightDecorator.prototype.paint=function(){if(this._layerDiv!=null){this._band.removeLayerDiv(this._layerDiv);}
this._layerDiv=this._band.createLayerDiv(10);this._layerDiv.setAttribute("name","span-highlight-decorator");this._layerDiv.style.display="none";var minDate=this._band.getMinDate();var maxDate=this._band.getMaxDate();if(this._unit.compare(this._date,maxDate)<0&&this._unit.compare(this._date,minDate)>0){var pixel=this._band.dateToPixelOffset(this._date);var minPixel=pixel-Math.round(this._width/2);var doc=this._timeline.getDocument();var div=doc.createElement("div");div.style.position="absolute";div.style.overflow="hidden";div.style.background=this._color;if(this._opacity<100){Timeline.Graphics.setOpacity(div,this._opacity);}
this._layerDiv.appendChild(div);if(this._timeline.isHorizontal()){div.style.left=minPixel+"px";div.style.width=this._width+"px";div.style.top="0px";div.style.height="100%";}else{div.style.top=minPixel+"px";div.style.height=this._width+"px";div.style.left="0px";div.style.width="100%";}}
this._layerDiv.style.display="block";};Timeline.PointHighlightDecorator.prototype.softPaint=function(){};

/* ether-painters.js */

Timeline.GregorianEtherPainter=function(params){this._params=params;this._theme=params.theme;this._unit=params.unit;this._multiple=("multiple"in params)?params.multiple:1;};Timeline.GregorianEtherPainter.prototype.initialize=function(band,timeline){this._band=band;this._timeline=timeline;this._backgroundLayer=band.createLayerDiv(0);this._backgroundLayer.setAttribute("name","ether-background");this._backgroundLayer.style.background=this._theme.ether.backgroundColors[band.getIndex()];this._markerLayer=null;this._lineLayer=null;var align=("align"in this._params&&this._params.align!=undefined)?this._params.align:this._theme.ether.interval.marker[timeline.isHorizontal()?"hAlign":"vAlign"];var showLine=("showLine"in this._params)?this._params.showLine:this._theme.ether.interval.line.show;this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,align,showLine);this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer);}
Timeline.GregorianEtherPainter.prototype.setHighlight=function(startDate,endDate){this._highlight.position(startDate,endDate);}
Timeline.GregorianEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer);}
this._markerLayer=this._band.createLayerDiv(100);this._markerLayer.setAttribute("name","ether-markers");this._markerLayer.style.display="none";if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer);}
this._lineLayer=this._band.createLayerDiv(1);this._lineLayer.setAttribute("name","ether-lines");this._lineLayer.style.display="none";var minDate=this._band.getMinDate();var maxDate=this._band.getMaxDate();var timeZone=this._band.getTimeZone();var labeller=this._band.getLabeller();Timeline.DateTime.roundDownToInterval(minDate,this._unit,timeZone,1,this._theme.firstDayOfWeek);var p=this;var incrementDate=function(date){for(var i=0;i<p._multiple;i++){Timeline.DateTime.incrementByInterval(date,p._unit);}};while(minDate.getTime()<maxDate.getTime()){this._intervalMarkerLayout.createIntervalMarker(minDate,labeller,this._unit,this._markerLayer,this._lineLayer);incrementDate(minDate);}
this._markerLayer.style.display="block";this._lineLayer.style.display="block";};Timeline.GregorianEtherPainter.prototype.softPaint=function(){};Timeline.HotZoneGregorianEtherPainter=function(params){this._params=params;this._theme=params.theme;this._zones=[{startTime:Number.NEGATIVE_INFINITY,endTime:Number.POSITIVE_INFINITY,unit:params.unit,multiple:1}];for(var i=0;i<params.zones.length;i++){var zone=params.zones[i];var zoneStart=Timeline.DateTime.parseGregorianDateTime(zone.start).getTime();var zoneEnd=Timeline.DateTime.parseGregorianDateTime(zone.end).getTime();for(var j=0;j<this._zones.length&&zoneEnd>zoneStart;j++){var zone2=this._zones[j];if(zoneStart<zone2.endTime){if(zoneStart>zone2.startTime){this._zones.splice(j,0,{startTime:zone2.startTime,endTime:zoneStart,unit:zone2.unit,multiple:zone2.multiple});j++;zone2.startTime=zoneStart;}
if(zoneEnd<zone2.endTime){this._zones.splice(j,0,{startTime:zoneStart,endTime:zoneEnd,unit:zone.unit,multiple:(zone.multiple)?zone.multiple:1});j++;zone2.startTime=zoneEnd;zoneStart=zoneEnd;}else{zone2.multiple=zone.multiple;zone2.unit=zone.unit;zoneStart=zone2.endTime;}}}}};Timeline.HotZoneGregorianEtherPainter.prototype.initialize=function(band,timeline){this._band=band;this._timeline=timeline;this._backgroundLayer=band.createLayerDiv(0);this._backgroundLayer.setAttribute("name","ether-background");this._backgroundLayer.style.background=this._theme.ether.backgroundColors[band.getIndex()];this._markerLayer=null;this._lineLayer=null;var align=("align"in this._params&&this._params.align!=undefined)?this._params.align:this._theme.ether.interval.marker[timeline.isHorizontal()?"hAlign":"vAlign"];var showLine=("showLine"in this._params)?this._params.showLine:this._theme.ether.interval.line.show;this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,align,showLine);this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer);}
Timeline.HotZoneGregorianEtherPainter.prototype.setHighlight=function(startDate,endDate){this._highlight.position(startDate,endDate);}
Timeline.HotZoneGregorianEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer);}
this._markerLayer=this._band.createLayerDiv(100);this._markerLayer.setAttribute("name","ether-markers");this._markerLayer.style.display="none";if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer);}
this._lineLayer=this._band.createLayerDiv(1);this._lineLayer.setAttribute("name","ether-lines");this._lineLayer.style.display="none";var minDate=this._band.getMinDate();var maxDate=this._band.getMaxDate();var timeZone=this._band.getTimeZone();var labeller=this._band.getLabeller();var p=this;var incrementDate=function(date,zone){for(var i=0;i<zone.multiple;i++){Timeline.DateTime.incrementByInterval(date,zone.unit);}};var zStart=0;while(zStart<this._zones.length){if(minDate.getTime()<this._zones[zStart].endTime){break;}
zStart++;}
var zEnd=this._zones.length-1;while(zEnd>=0){if(maxDate.getTime()>this._zones[zEnd].startTime){break;}
zEnd--;}
for(var z=zStart;z<=zEnd;z++){var zone=this._zones[z];var minDate2=new Date(Math.max(minDate.getTime(),zone.startTime));var maxDate2=new Date(Math.min(maxDate.getTime(),zone.endTime));Timeline.DateTime.roundDownToInterval(minDate2,zone.unit,timeZone,zone.multiple,this._theme.firstDayOfWeek);Timeline.DateTime.roundUpToInterval(maxDate2,zone.unit,timeZone,zone.multiple,this._theme.firstDayOfWeek);while(minDate2.getTime()<maxDate2.getTime()){this._intervalMarkerLayout.createIntervalMarker(minDate2,labeller,zone.unit,this._markerLayer,this._lineLayer);incrementDate(minDate2,zone);}}
this._markerLayer.style.display="block";this._lineLayer.style.display="block";};Timeline.HotZoneGregorianEtherPainter.prototype.softPaint=function(){};Timeline.YearCountEtherPainter=function(params){this._params=params;this._theme=params.theme;this._startDate=Timeline.DateTime.parseGregorianDateTime(params.startDate);this._multiple=("multiple"in params)?params.multiple:1;};Timeline.YearCountEtherPainter.prototype.initialize=function(band,timeline){this._band=band;this._timeline=timeline;this._backgroundLayer=band.createLayerDiv(0);this._backgroundLayer.setAttribute("name","ether-background");this._backgroundLayer.style.background=this._theme.ether.backgroundColors[band.getIndex()];this._markerLayer=null;this._lineLayer=null;var align=("align"in this._params)?this._params.align:this._theme.ether.interval.marker[timeline.isHorizontal()?"hAlign":"vAlign"];var showLine=("showLine"in this._params)?this._params.showLine:this._theme.ether.interval.line.show;this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,align,showLine);this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer);};Timeline.YearCountEtherPainter.prototype.setHighlight=function(startDate,endDate){this._highlight.position(startDate,endDate);};Timeline.YearCountEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer);}
this._markerLayer=this._band.createLayerDiv(100);this._markerLayer.setAttribute("name","ether-markers");this._markerLayer.style.display="none";if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer);}
this._lineLayer=this._band.createLayerDiv(1);this._lineLayer.setAttribute("name","ether-lines");this._lineLayer.style.display="none";var minDate=new Date(this._startDate.getTime());var maxDate=this._band.getMaxDate();var yearDiff=this._band.getMinDate().getUTCFullYear()-this._startDate.getUTCFullYear();minDate.setUTCFullYear(this._band.getMinDate().getUTCFullYear()-yearDiff%this._multiple);var p=this;var incrementDate=function(date){for(var i=0;i<p._multiple;i++){Timeline.DateTime.incrementByInterval(date,Timeline.DateTime.YEAR);}};var labeller={labelInterval:function(date,intervalUnit){var diff=date.getUTCFullYear()-p._startDate.getUTCFullYear();return{text:diff,emphasized:diff==0};}};while(minDate.getTime()<maxDate.getTime()){this._intervalMarkerLayout.createIntervalMarker(minDate,labeller,Timeline.DateTime.YEAR,this._markerLayer,this._lineLayer);incrementDate(minDate);}
this._markerLayer.style.display="block";this._lineLayer.style.display="block";};Timeline.YearCountEtherPainter.prototype.softPaint=function(){};Timeline.QuarterlyEtherPainter=function(params){this._params=params;this._theme=params.theme;this._startDate=Timeline.DateTime.parseGregorianDateTime(params.startDate);};Timeline.QuarterlyEtherPainter.prototype.initialize=function(band,timeline){this._band=band;this._timeline=timeline;this._backgroundLayer=band.createLayerDiv(0);this._backgroundLayer.setAttribute("name","ether-background");this._backgroundLayer.style.background=this._theme.ether.backgroundColors[band.getIndex()];this._markerLayer=null;this._lineLayer=null;var align=("align"in this._params)?this._params.align:this._theme.ether.interval.marker[timeline.isHorizontal()?"hAlign":"vAlign"];var showLine=("showLine"in this._params)?this._params.showLine:this._theme.ether.interval.line.show;this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,align,showLine);this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer);};Timeline.QuarterlyEtherPainter.prototype.setHighlight=function(startDate,endDate){this._highlight.position(startDate,endDate);};Timeline.QuarterlyEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer);}
this._markerLayer=this._band.createLayerDiv(100);this._markerLayer.setAttribute("name","ether-markers");this._markerLayer.style.display="none";if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer);}
this._lineLayer=this._band.createLayerDiv(1);this._lineLayer.setAttribute("name","ether-lines");this._lineLayer.style.display="none";var minDate=new Date(0);var maxDate=this._band.getMaxDate();minDate.setUTCFullYear(Math.max(this._startDate.getUTCFullYear(),this._band.getMinDate().getUTCFullYear()));minDate.setUTCMonth(this._startDate.getUTCMonth());var p=this;var incrementDate=function(date){date.setUTCMonth(date.getUTCMonth()+3);};var labeller={labelInterval:function(date,intervalUnit){var quarters=(4+(date.getUTCMonth()-p._startDate.getUTCMonth())/3)%4;if(quarters!=0){return{text:"Q"+(quarters+1),emphasized:false};}else{return{text:"Y"+(date.getUTCFullYear()-p._startDate.getUTCFullYear()+1),emphasized:true};}}};while(minDate.getTime()<maxDate.getTime()){this._intervalMarkerLayout.createIntervalMarker(minDate,labeller,Timeline.DateTime.YEAR,this._markerLayer,this._lineLayer);incrementDate(minDate);}
this._markerLayer.style.display="block";this._lineLayer.style.display="block";};Timeline.QuarterlyEtherPainter.prototype.softPaint=function(){};Timeline.EtherIntervalMarkerLayout=function(timeline,band,theme,align,showLine){var horizontal=timeline.isHorizontal();if(horizontal){if(align=="Top"){this.positionDiv=function(div,offset){div.style.left=offset+"px";div.style.top="0px";};}else{this.positionDiv=function(div,offset){div.style.left=offset+"px";div.style.bottom="0px";};}}else{if(align=="Left"){this.positionDiv=function(div,offset){div.style.top=offset+"px";div.style.left="0px";};}else{this.positionDiv=function(div,offset){div.style.top=offset+"px";div.style.right="0px";};}}
var markerTheme=theme.ether.interval.marker;var lineTheme=theme.ether.interval.line;var weekendTheme=theme.ether.interval.weekend;var stylePrefix=(horizontal?"h":"v")+align;var labelStyler=markerTheme[stylePrefix+"Styler"];var emphasizedLabelStyler=markerTheme[stylePrefix+"EmphasizedStyler"];var day=Timeline.DateTime.gregorianUnitLengths[Timeline.DateTime.DAY];this.createIntervalMarker=function(date,labeller,unit,markerDiv,lineDiv){var offset=Math.round(band.dateToPixelOffset(date));if(showLine&&unit!=Timeline.DateTime.WEEK){var divLine=timeline.getDocument().createElement("div");divLine.style.position="absolute";if(lineTheme.opacity<100){Timeline.Graphics.setOpacity(divLine,lineTheme.opacity);}
if(horizontal){divLine.style.borderLeft="1px solid "+lineTheme.color;divLine.style.left=offset+"px";divLine.style.width="1px";divLine.style.top="0px";divLine.style.height="100%";}else{divLine.style.borderTop="1px solid "+lineTheme.color;divLine.style.top=offset+"px";divLine.style.height="1px";divLine.style.left="0px";divLine.style.width="100%";}
lineDiv.appendChild(divLine);}
if(unit==Timeline.DateTime.WEEK){var firstDayOfWeek=theme.firstDayOfWeek;var saturday=new Date(date.getTime()+(6-firstDayOfWeek-7)*day);var monday=new Date(saturday.getTime()+2*day);var saturdayPixel=Math.round(band.dateToPixelOffset(saturday));var mondayPixel=Math.round(band.dateToPixelOffset(monday));var length=Math.max(1,mondayPixel-saturdayPixel);var divWeekend=timeline.getDocument().createElement("div");divWeekend.style.position="absolute";divWeekend.style.background=weekendTheme.color;if(weekendTheme.opacity<100){Timeline.Graphics.setOpacity(divWeekend,weekendTheme.opacity);}
if(horizontal){divWeekend.style.left=saturdayPixel+"px";divWeekend.style.width=length+"px";divWeekend.style.top="0px";divWeekend.style.height="100%";}else{divWeekend.style.top=saturdayPixel+"px";divWeekend.style.height=length+"px";divWeekend.style.left="0px";divWeekend.style.width="100%";}
lineDiv.appendChild(divWeekend);}
var label=labeller.labelInterval(date,unit);var div=timeline.getDocument().createElement("div");div.innerHTML=label.text;div.style.position="absolute";(label.emphasized?emphasizedLabelStyler:labelStyler)(div);this.positionDiv(div,offset);markerDiv.appendChild(div);return div;};};Timeline.EtherHighlight=function(timeline,band,theme,backgroundLayer){var horizontal=timeline.isHorizontal();this._highlightDiv=null;this._createHighlightDiv=function(){if(this._highlightDiv==null){this._highlightDiv=timeline.getDocument().createElement("div");this._highlightDiv.setAttribute("name","ether-highlight");this._highlightDiv.style.position="absolute";this._highlightDiv.style.background=theme.ether.highlightColor;var opacity=theme.ether.highlightOpacity;if(opacity<100){Timeline.Graphics.setOpacity(this._highlightDiv,opacity);}
backgroundLayer.appendChild(this._highlightDiv);}}
this.position=function(startDate,endDate){this._createHighlightDiv();var startPixel=Math.round(band.dateToPixelOffset(startDate));var endPixel=Math.round(band.dateToPixelOffset(endDate));var length=Math.max(endPixel-startPixel,3);if(horizontal){this._highlightDiv.style.left=startPixel+"px";this._highlightDiv.style.width=length+"px";this._highlightDiv.style.top="2px";this._highlightDiv.style.height=(band.getViewWidth()-4)+"px";}else{this._highlightDiv.style.top=startPixel+"px";this._highlightDiv.style.height=length+"px";this._highlightDiv.style.left="2px";this._highlightDiv.style.width=(band.getViewWidth()-4)+"px";}}};

/* ethers.js */

Timeline.LinearEther=function(params){this._params=params;this._interval=params.interval;this._pixelsPerInterval=params.pixelsPerInterval;};Timeline.LinearEther.prototype.initialize=function(timeline){this._timeline=timeline;this._unit=timeline.getUnit();if("startsOn"in this._params){this._start=this._unit.parseFromObject(this._params.startsOn);}else if("endsOn"in this._params){this._start=this._unit.parseFromObject(this._params.endsOn);this.shiftPixels(-this._timeline.getPixelLength());}else if("centersOn"in this._params){this._start=this._unit.parseFromObject(this._params.centersOn);this.shiftPixels(-this._timeline.getPixelLength()/2);}else{this._start=this._unit.makeDefaultValue();this.shiftPixels(-this._timeline.getPixelLength()/2);}};Timeline.LinearEther.prototype.setDate=function(date){this._start=this._unit.cloneValue(date);};Timeline.LinearEther.prototype.shiftPixels=function(pixels){var numeric=this._interval*pixels/this._pixelsPerInterval;this._start=this._unit.change(this._start,numeric);};Timeline.LinearEther.prototype.dateToPixelOffset=function(date){var numeric=this._unit.compare(date,this._start);return this._pixelsPerInterval*numeric/this._interval;};Timeline.LinearEther.prototype.pixelOffsetToDate=function(pixels){var numeric=pixels*this._interval/this._pixelsPerInterval;return this._unit.change(this._start,numeric);};Timeline.HotZoneEther=function(params){this._params=params;this._interval=params.interval;this._pixelsPerInterval=params.pixelsPerInterval;};Timeline.HotZoneEther.prototype.initialize=function(timeline){this._timeline=timeline;this._unit=timeline.getUnit();this._zones=[{startTime:Number.NEGATIVE_INFINITY,endTime:Number.POSITIVE_INFINITY,magnify:1}];var params=this._params;for(var i=0;i<params.zones.length;i++){var zone=params.zones[i];var zoneStart=this._unit.parseFromObject(zone.start);var zoneEnd=this._unit.parseFromObject(zone.end);for(var j=0;j<this._zones.length&&this._unit.compare(zoneEnd,zoneStart)>0;j++){var zone2=this._zones[j];if(this._unit.compare(zoneStart,zone2.endTime)<0){if(this._unit.compare(zoneStart,zone2.startTime)>0){this._zones.splice(j,0,{startTime:zone2.startTime,endTime:zoneStart,magnify:zone2.magnify});j++;zone2.startTime=zoneStart;}
if(this._unit.compare(zoneEnd,zone2.endTime)<0){this._zones.splice(j,0,{startTime:zoneStart,endTime:zoneEnd,magnify:zone.magnify*zone2.magnify});j++;zone2.startTime=zoneEnd;zoneStart=zoneEnd;}else{zone2.magnify*=zone.magnify;zoneStart=zone2.endTime;}}}}
if("startsOn"in this._params){this._start=this._unit.parseFromObject(this._params.startsOn);}else if("endsOn"in this._params){this._start=this._unit.parseFromObject(this._params.endsOn);this.shiftPixels(-this._timeline.getPixelLength());}else if("centersOn"in this._params){this._start=this._unit.parseFromObject(this._params.centersOn);this.shiftPixels(-this._timeline.getPixelLength()/2);}else{this._start=this._unit.makeDefaultValue();this.shiftPixels(-this._timeline.getPixelLength()/2);}};Timeline.HotZoneEther.prototype.setDate=function(date){this._start=this._unit.cloneValue(date);};Timeline.HotZoneEther.prototype.shiftPixels=function(pixels){this._start=this.pixelOffsetToDate(pixels);};Timeline.HotZoneEther.prototype.dateToPixelOffset=function(date){return this._dateDiffToPixelOffset(this._start,date);};Timeline.HotZoneEther.prototype.pixelOffsetToDate=function(pixels){return this._pixelOffsetToDate(pixels,this._start);};Timeline.HotZoneEther.prototype._dateDiffToPixelOffset=function(fromDate,toDate){var scale=this._getScale();var fromTime=fromDate;var toTime=toDate;var pixels=0;if(this._unit.compare(fromTime,toTime)<0){var z=0;while(z<this._zones.length){if(this._unit.compare(fromTime,this._zones[z].endTime)<0){break;}
z++;}
while(this._unit.compare(fromTime,toTime)<0){var zone=this._zones[z];var toTime2=this._unit.earlier(toTime,zone.endTime);pixels+=(this._unit.compare(toTime2,fromTime)/(scale/zone.magnify));fromTime=toTime2;z++;}}else{var z=this._zones.length-1;while(z>=0){if(this._unit.compare(fromTime,this._zones[z].startTime)>0){break;}
z--;}
while(this._unit.compare(fromTime,toTime)>0){var zone=this._zones[z];var toTime2=this._unit.later(toTime,zone.startTime);pixels+=(this._unit.compare(toTime2,fromTime)/(scale/zone.magnify));fromTime=toTime2;z--;}}
return pixels;};Timeline.HotZoneEther.prototype._pixelOffsetToDate=function(pixels,fromDate){var scale=this._getScale();var time=fromDate;if(pixels>0){var z=0;while(z<this._zones.length){if(this._unit.compare(time,this._zones[z].endTime)<0){break;}
z++;}
while(pixels>0){var zone=this._zones[z];var scale2=scale/zone.magnify;if(zone.endTime==Number.POSITIVE_INFINITY){time=this._unit.change(time,pixels*scale2);pixels=0;}else{var pixels2=this._unit.compare(zone.endTime,time)/scale2;if(pixels2>pixels){time=this._unit.change(time,pixels*scale2);pixels=0;}else{time=zone.endTime;pixels-=pixels2;}}
z++;}}else{var z=this._zones.length-1;while(z>=0){if(this._unit.compare(time,this._zones[z].startTime)>0){break;}
z--;}
pixels=-pixels;while(pixels>0){var zone=this._zones[z];var scale2=scale/zone.magnify;if(zone.startTime==Number.NEGATIVE_INFINITY){time=this._unit.change(time,-pixels*scale2);pixels=0;}else{var pixels2=this._unit.compare(time,zone.startTime)/scale2;if(pixels2>pixels){time=this._unit.change(time,-pixels*scale2);pixels=0;}else{time=zone.startTime;pixels-=pixels2;}}
z--;}}
return time;};Timeline.HotZoneEther.prototype._getScale=function(){return this._interval/this._pixelsPerInterval;};

/* labellers.js */

Timeline.GregorianDateLabeller=function(locale,timeZone){this._locale=locale;this._timeZone=timeZone;};Timeline.GregorianDateLabeller.monthNames=[];Timeline.GregorianDateLabeller.dayNames=[];Timeline.GregorianDateLabeller.labelIntervalFunctions=[];Timeline.GregorianDateLabeller.getMonthName=function(month,locale){return Timeline.GregorianDateLabeller.monthNames[locale][month];};Timeline.GregorianDateLabeller.prototype.labelInterval=function(date,intervalUnit){var f=Timeline.GregorianDateLabeller.labelIntervalFunctions[this._locale];if(f==null){f=Timeline.GregorianDateLabeller.prototype.defaultLabelInterval;}
return f.call(this,date,intervalUnit);};Timeline.GregorianDateLabeller.prototype.labelPrecise=function(date){return Timeline.DateTime.removeTimeZoneOffset(date,this._timeZone).toUTCString();};Timeline.GregorianDateLabeller.prototype.defaultLabelInterval=function(date,intervalUnit){var text;var emphasized=false;date=Timeline.DateTime.removeTimeZoneOffset(date,this._timeZone);switch(intervalUnit){case Timeline.DateTime.MILLISECOND:text=date.getUTCMilliseconds();break;case Timeline.DateTime.SECOND:text=date.getUTCSeconds();break;case Timeline.DateTime.MINUTE:var m=date.getUTCMinutes();if(m==0){text=date.getUTCHours()+":00";emphasized=true;}else{text=m;}
break;case Timeline.DateTime.HOUR:text=date.getUTCHours()+"hr";break;case Timeline.DateTime.DAY:text=Timeline.GregorianDateLabeller.getMonthName(date.getUTCMonth(),this._locale)+" "+date.getUTCDate();break;case Timeline.DateTime.WEEK:text=Timeline.GregorianDateLabeller.getMonthName(date.getUTCMonth(),this._locale)+" "+date.getUTCDate();break;case Timeline.DateTime.MONTH:var m=date.getUTCMonth();if(m!=0){text=Timeline.GregorianDateLabeller.getMonthName(m,this._locale);break;}
case Timeline.DateTime.YEAR:case Timeline.DateTime.DECADE:case Timeline.DateTime.CENTURY:case Timeline.DateTime.MILLENNIUM:var y=date.getUTCFullYear();if(y>0){text=date.getUTCFullYear();}else{text=(1-y)+"BC";}
emphasized=(intervalUnit==Timeline.DateTime.MONTH)||(intervalUnit==Timeline.DateTime.DECADE&&y%100==0)||(intervalUnit==Timeline.DateTime.CENTURY&&y%1000==0);break;default:text=date.toUTCString();}
return{text:text,emphasized:emphasized};}

/* layouts.js */

Timeline.StaticTrackBasedLayout=function(params){this._eventSource=params.eventSource;this._ether=params.ether;this._theme=params.theme;this._showText=("showText"in params)?params.showText:true;this._laidout=false;var layout=this;if(this._eventSource!=null){this._eventSource.addListener({onAddMany:function(){layout._laidout=false;}});}};Timeline.StaticTrackBasedLayout.prototype.initialize=function(timeline){this._timeline=timeline;};Timeline.StaticTrackBasedLayout.prototype.getTrack=function(evt){if(!this._laidout){this._tracks=[];this._layout();this._laidout=true;}
return this._tracks[evt.getID()];};Timeline.StaticTrackBasedLayout.prototype.getTrackCount=function(){if(!this._laidout){this._tracks=[];this._layout();this._laidout=true;}
return this._trackCount;};Timeline.StaticTrackBasedLayout.prototype._layout=function(){if(this._eventSource==null){return;}
var streams=[Number.NEGATIVE_INFINITY];var layout=this;var showText=this._showText;var theme=this._theme;var eventTheme=theme.event;var layoutInstant=function(evt,startPixel,endPixel,streamOffset){var finalPixel=startPixel-1;if(evt.isImprecise()){finalPixel=endPixel;}
if(showText){finalPixel=Math.max(finalPixel,startPixel+eventTheme.label.width);}
return finalPixel;};var layoutDuration=function(evt,startPixel,endPixel,streamOffset){if(evt.isImprecise()){var startDate=evt.getStart();var endDate=evt.getEnd();var startPixel2=Math.round(layout._ether.dateToPixelOffset(startDate));var endPixel2=Math.round(layout._ether.dateToPixelOffset(endDate));}else{var startPixel2=startPixel;var endPixel2=endPixel;}
var finalPixel=endPixel2;var length=Math.max(endPixel2-startPixel2,1);if(showText){if(length<eventTheme.label.width){finalPixel=endPixel2+eventTheme.label.width;}}
return finalPixel;};var layoutEvent=function(evt){var startDate=evt.getStart();var endDate=evt.getEnd();var startPixel=Math.round(layout._ether.dateToPixelOffset(startDate));var endPixel=Math.round(layout._ether.dateToPixelOffset(endDate));var streamIndex=0;for(;streamIndex<streams.length;streamIndex++){if(streams[streamIndex]<startPixel){break;}}
if(streamIndex>=streams.length){streams.push(Number.NEGATIVE_INFINITY);}
var streamOffset=(eventTheme.track.offset+
streamIndex*(eventTheme.track.height+eventTheme.track.gap))+"em";layout._tracks[evt.getID()]=streamIndex;if(evt.isInstant()){streams[streamIndex]=layoutInstant(evt,startPixel,endPixel,streamOffset);}else{streams[streamIndex]=layoutDuration(evt,startPixel,endPixel,streamOffset);}};var iterator=this._eventSource.getAllEventIterator();while(iterator.hasNext()){var evt=iterator.next();layoutEvent(evt);}
this._trackCount=streams.length;};

/* painters.js */

Timeline.DurationEventPainter=function(params){this._params=params;this._theme=params.theme;this._layout=params.layout;this._showText=params.showText;this._showLineForNoText=("showLineForNoText"in params)?params.showLineForNoText:params.theme.event.instant.showLineForNoText;this._filterMatcher=null;this._highlightMatcher=null;};Timeline.DurationEventPainter.prototype.initialize=function(band,timeline){this._band=band;this._timeline=timeline;this._layout.initialize(band,timeline);this._eventLayer=null;this._highlightLayer=null;};Timeline.DurationEventPainter.prototype.getLayout=function(){return this._layout;};Timeline.DurationEventPainter.prototype.setLayout=function(layout){this._layout=layout;};Timeline.DurationEventPainter.prototype.getFilterMatcher=function(){return this._filterMatcher;};Timeline.DurationEventPainter.prototype.setFilterMatcher=function(filterMatcher){this._filterMatcher=filterMatcher;};Timeline.DurationEventPainter.prototype.getHighlightMatcher=function(){return this._highlightMatcher;};Timeline.DurationEventPainter.prototype.setHighlightMatcher=function(highlightMatcher){this._highlightMatcher=highlightMatcher;};Timeline.DurationEventPainter.prototype.paint=function(){var eventSource=this._band.getEventSource();if(eventSource==null){return;}
if(this._highlightLayer!=null){this._band.removeLayerDiv(this._highlightLayer);}
this._highlightLayer=this._band.createLayerDiv(105);this._highlightLayer.setAttribute("name","event-highlights");this._highlightLayer.style.display="none";if(this._eventLayer!=null){this._band.removeLayerDiv(this._eventLayer);}
this._eventLayer=this._band.createLayerDiv(110);this._eventLayer.setAttribute("name","events");this._eventLayer.style.display="none";var minDate=this._band.getMinDate();var maxDate=this._band.getMaxDate();var doc=this._timeline.getDocument();var p=this;var eventLayer=this._eventLayer;var highlightLayer=this._highlightLayer;var showText=this._showText;var theme=this._params.theme;var eventTheme=theme.event;var trackOffset=eventTheme.track.offset;var trackHeight=("trackHeight"in this._params)?this._params.trackHeight:eventTheme.track.height;var trackGap=("trackGap"in this._params)?this._params.trackGap:eventTheme.track.gap;var appendIcon=function(evt,div){var icon=evt.getIcon();var img=Timeline.Graphics.createTranslucentImage(doc,icon!=null?icon:eventTheme.instant.icon);div.appendChild(img);div.style.cursor="pointer";Timeline.DOM.registerEvent(div,"mousedown",function(elmt,domEvt,target){p._onClickInstantEvent(img,domEvt,evt);});};var createHighlightDiv=function(highlightIndex,startPixel,length,highlightOffset,highlightWidth){if(highlightIndex>=0){var color=eventTheme.highlightColors[Math.min(highlightIndex,eventTheme.highlightColors.length-1)];var div=doc.createElement("div");div.style.position="absolute";div.style.overflow="hidden";div.style.left=(startPixel-3)+"px";div.style.width=(length+6)+"px";div.style.top=highlightOffset+"em";div.style.height=highlightWidth+"em";div.style.background=color;highlightLayer.appendChild(div);}};var createInstantDiv=function(evt,startPixel,endPixel,streamOffset,highlightIndex,highlightOffset,highlightWidth){if(evt.isImprecise()){var length=Math.max(endPixel-startPixel,1);var divImprecise=doc.createElement("div");divImprecise.style.position="absolute";divImprecise.style.overflow="hidden";divImprecise.style.top=streamOffset;divImprecise.style.height=trackHeight+"em";divImprecise.style.left=startPixel+"px";divImprecise.style.width=length+"px";divImprecise.style.background=eventTheme.instant.impreciseColor;if(eventTheme.instant.impreciseOpacity<100){Timeline.Graphics.setOpacity(divImprecise,eventTheme.instant.impreciseOpacity);}
eventLayer.appendChild(divImprecise);}
var div=doc.createElement("div");div.style.position="absolute";div.style.overflow="hidden";eventLayer.appendChild(div);var foreground=evt.getTextColor();var background=evt.getColor();var realign=-8;var length=16;if(showText){div.style.width=eventTheme.label.width+"px";div.style.color=foreground!=null?foreground:eventTheme.label.outsideColor;appendIcon(evt,div);div.appendChild(doc.createTextNode(evt.getText()));}else{if(p._showLineForNoText){div.style.width="1px";div.style.borderLeft="1px solid "+(background!=null?background:eventTheme.instant.lineColor);realign=0;length=1;}else{appendIcon(evt,div);}}
div.style.top=streamOffset;div.style.height=trackHeight+"em";div.style.left=(startPixel+realign)+"px";createHighlightDiv(highlightIndex,(startPixel+realign),length,highlightOffset,highlightWidth);};var createDurationDiv=function(evt,startPixel,endPixel,streamOffset,highlightIndex,highlightOffset,highlightWidth){var attachClickEvent=function(elmt){elmt.style.cursor="pointer";Timeline.DOM.registerEvent(elmt,"mousedown",function(elmt,domEvt,target){p._onClickDurationEvent(domEvt,evt,target);});};var length=Math.max(endPixel-startPixel,1);if(evt.isImprecise()){var div=doc.createElement("div");div.style.position="absolute";div.style.overflow="hidden";div.style.top=streamOffset;div.style.height=trackHeight+"em";div.style.left=startPixel+"px";div.style.width=length+"px";div.style.background=eventTheme.duration.impreciseColor;if(eventTheme.duration.impreciseOpacity<100){Timeline.Graphics.setOpacity(div,eventTheme.duration.impreciseOpacity);}
eventLayer.appendChild(div);var startDate=evt.getLatestStart();var endDate=evt.getEarliestEnd();var startPixel2=Math.round(p._band.dateToPixelOffset(startDate));var endPixel2=Math.round(p._band.dateToPixelOffset(endDate));}else{var startPixel2=startPixel;var endPixel2=endPixel;}
var foreground=evt.getTextColor();var outside=true;if(startPixel2<=endPixel2){length=Math.max(endPixel2-startPixel2,1);outside=!(length>eventTheme.label.width);div=doc.createElement("div");div.style.position="absolute";div.style.overflow="hidden";div.style.top=streamOffset;div.style.height=trackHeight+"em";div.style.left=startPixel2+"px";div.style.width=length+"px";var background=evt.getColor();div.style.background=background!=null?background:eventTheme.duration.color;if(eventTheme.duration.opacity<100){Timeline.Graphics.setOpacity(div,eventTheme.duration.opacity);}
eventLayer.appendChild(div);}else{var temp=startPixel2;startPixel2=endPixel2;endPixel2=temp;}
if(div==null){console.log(evt);}
attachClickEvent(div);if(showText){var divLabel=doc.createElement("div");divLabel.style.position="absolute";divLabel.style.top=streamOffset;divLabel.style.height=trackHeight+"em";divLabel.style.left=((length>eventTheme.label.width)?startPixel2:endPixel2)+"px";divLabel.style.width=eventTheme.label.width+"px";divLabel.style.color=foreground!=null?foreground:(outside?eventTheme.label.outsideColor:eventTheme.label.insideColor);divLabel.style.overflow="hidden";divLabel.appendChild(doc.createTextNode(evt.getText()));eventLayer.appendChild(divLabel);attachClickEvent(divLabel);}
createHighlightDiv(highlightIndex,startPixel,endPixel-startPixel,highlightOffset,highlightWidth);};var createEventDiv=function(evt,highlightIndex){var startDate=evt.getStart();var endDate=evt.getEnd();var startPixel=Math.round(p._band.dateToPixelOffset(startDate));var endPixel=Math.round(p._band.dateToPixelOffset(endDate));var streamOffset=(trackOffset+
p._layout.getTrack(evt)*(trackHeight+trackGap));if(evt.isInstant()){createInstantDiv(evt,startPixel,endPixel,streamOffset+"em",highlightIndex,streamOffset-trackGap,trackHeight+2*trackGap);}else{createDurationDiv(evt,startPixel,endPixel,streamOffset+"em",highlightIndex,streamOffset-trackGap,trackHeight+2*trackGap);}};var filterMatcher=(this._filterMatcher!=null)?this._filterMatcher:function(evt){return true;};var highlightMatcher=(this._highlightMatcher!=null)?this._highlightMatcher:function(evt){return-1;};var iterator=eventSource.getEventIterator(minDate,maxDate);while(iterator.hasNext()){var evt=iterator.next();if(filterMatcher(evt)){createEventDiv(evt,highlightMatcher(evt));}}
this._highlightLayer.style.display="block";this._eventLayer.style.display="block";};Timeline.DurationEventPainter.prototype.softPaint=function(){};Timeline.DurationEventPainter.prototype._onClickInstantEvent=function(icon,domEvt,evt){domEvt.cancelBubble=true;var c=Timeline.DOM.getPageCoordinates(icon);this._showBubble(c.left+Math.ceil(icon.offsetWidth/2),c.top+Math.ceil(icon.offsetHeight/2),evt);};Timeline.DurationEventPainter.prototype._onClickDurationEvent=function(domEvt,evt,target){domEvt.cancelBubble=true;if("pageX"in domEvt){var x=domEvt.pageX;var y=domEvt.pageY;}else{var c=Timeline.DOM.getPageCoordinates(target);var x=domEvt.offsetX+c.left;var y=domEvt.offsetY+c.top;}
this._showBubble(x,y,evt);};Timeline.DurationEventPainter.prototype._showBubble=function(x,y,evt){var div=this._band.openBubbleForPoint(x,y,this._theme.event.bubble.width,this._theme.event.bubble.height);evt.fillInfoBubble(div,this._theme,this._band.getLabeller());};

/* sources.js */

Timeline.DefaultEventSource=function(eventIndex){this._events=(eventIndex instanceof Object)?eventIndex:new Timeline.EventIndex();this._listeners=[];};Timeline.DefaultEventSource.prototype.addListener=function(listener){this._listeners.push(listener);};Timeline.DefaultEventSource.prototype.removeListener=function(listener){for(var i=0;i<this._listeners.length;i++){if(this._listeners[i]==listener){this._listeners.splice(i,1);break;}}};Timeline.DefaultEventSource.prototype.loadXML=function(xml,url){var base=this._getBaseURL(url);var wikiURL=xml.documentElement.getAttribute("wiki-url");var wikiSection=xml.documentElement.getAttribute("wiki-section");var dateTimeFormat=xml.documentElement.getAttribute("date-time-format");var parseDateTimeFunction=this._events.getUnit().getParser(dateTimeFormat);var node=xml.documentElement.firstChild;var added=false;while(node!=null){if(node.nodeType==1){var description="";if(node.firstChild!=null&&node.firstChild.nodeType==3){description=node.firstChild.nodeValue;}
var evt=new Timeline.DefaultEventSource.Event(parseDateTimeFunction(node.getAttribute("start")),parseDateTimeFunction(node.getAttribute("end")),parseDateTimeFunction(node.getAttribute("latestStart")),parseDateTimeFunction(node.getAttribute("earliestEnd")),node.getAttribute("isDuration")!="true",node.getAttribute("title"),description,this._resolveRelativeURL(node.getAttribute("image"),base),this._resolveRelativeURL(node.getAttribute("link"),base),this._resolveRelativeURL(node.getAttribute("icon"),base),node.getAttribute("color"),node.getAttribute("textColor"));evt._node=node;evt.getProperty=function(name){return this._node.getAttribute(name);};evt.setWikiInfo(wikiURL,wikiSection);this._events.add(evt);added=true;}
node=node.nextSibling;}
if(added){this._fire("onAddMany",[]);}};Timeline.DefaultEventSource.prototype.loadJSON=function(data,url){var base=this._getBaseURL(url);var added=false;if(data&&data.events){var wikiURL=("wikiURL"in data)?data.wikiURL:null;var wikiSection=("wikiSection"in data)?data.wikiSection:null;var dateTimeFormat=("dateTimeFormat"in data)?data.dateTimeFormat:null;var parseDateTimeFunction=this._events.getUnit().getParser(dateTimeFormat);for(var i=0;i<data.events.length;i++){var event=data.events[i];var evt=new Timeline.DefaultEventSource.Event(parseDateTimeFunction(event.start),parseDateTimeFunction(event.end),parseDateTimeFunction(event.latestStart),parseDateTimeFunction(event.earliestEnd),event.isDuration||false,event.title,event.description,this._resolveRelativeURL(event.image,base),this._resolveRelativeURL(event.link,base),this._resolveRelativeURL(event.icon,base),event.color,event.textColor);evt._obj=event;evt.getProperty=function(name){return this._obj[name];};evt.setWikiInfo(wikiURL,wikiSection);this._events.add(evt);added=true;}}
if(added){this._fire("onAddMany",[]);}};Timeline.DefaultEventSource.prototype.loadSPARQL=function(xml,url){var base=this._getBaseURL(url);var dateTimeFormat='iso8601';var parseDateTimeFunction=this._events.getUnit().getParser(dateTimeFormat);if(xml==null){return;}
var node=xml.documentElement.firstChild;while(node!=null&&(node.nodeType!=1||node.nodeName!='results')){node=node.nextSibling;}
var wikiURL=null;var wikiSection=null;if(node!=null){wikiURL=node.getAttribute("wiki-url");wikiSection=node.getAttribute("wiki-section");node=node.firstChild;}
var added=false;while(node!=null){if(node.nodeType==1){var bindings={};var binding=node.firstChild;while(binding!=null){if(binding.nodeType==1&&binding.firstChild!=null&&binding.firstChild.nodeType==1&&binding.firstChild.firstChild!=null&&binding.firstChild.firstChild.nodeType==3){bindings[binding.getAttribute('name')]=binding.firstChild.firstChild.nodeValue;}
binding=binding.nextSibling;}
if(bindings["start"]==null&&bindings["date"]!=null){bindings["start"]=bindings["date"];}
var evt=new Timeline.DefaultEventSource.Event(parseDateTimeFunction(bindings["start"]),parseDateTimeFunction(bindings["end"]),parseDateTimeFunction(bindings["latestStart"]),parseDateTimeFunction(bindings["earliestEnd"]),bindings["isDuration"]!="true",bindings["title"],bindings["description"],this._resolveRelativeURL(bindings["image"],base),this._resolveRelativeURL(bindings["link"],base),this._resolveRelativeURL(bindings["icon"],base),bindings["color"],bindings["textColor"]);evt._bindings=bindings;evt.getProperty=function(name){return this._bindings[name];};evt.setWikiInfo(wikiURL,wikiSection);this._events.add(evt);added=true;}
node=node.nextSibling;}
if(added){this._fire("onAddMany",[]);}};Timeline.DefaultEventSource.prototype.add=function(evt){this._events.add(evt);this._fire("onAddOne",[evt]);};Timeline.DefaultEventSource.prototype.addMany=function(events){for(var i=0;i<events.length;i++){this._events.add(events[i]);}
this._fire("onAddMany",[]);};Timeline.DefaultEventSource.prototype.clear=function(){this._events.removeAll();this._fire("onClear",[]);};Timeline.DefaultEventSource.prototype.getEventIterator=function(startDate,endDate){return this._events.getIterator(startDate,endDate);};Timeline.DefaultEventSource.prototype.getAllEventIterator=function(){return this._events.getAllIterator();};Timeline.DefaultEventSource.prototype.getCount=function(){return this._events.getCount();};Timeline.DefaultEventSource.prototype.getEarliestDate=function(){return this._events.getEarliestDate();};Timeline.DefaultEventSource.prototype.getLatestDate=function(){return this._events.getLatestDate();};Timeline.DefaultEventSource.prototype._fire=function(handlerName,args){for(var i=0;i<this._listeners.length;i++){var listener=this._listeners[i];if(handlerName in listener){try{listener[handlerName].apply(listener,args);}catch(e){Timeline.Debug.exception(e);}}}};Timeline.DefaultEventSource.prototype._getBaseURL=function(url){if(url.indexOf("://")<0){var url2=this._getBaseURL(document.location.href);if(url.substr(0,1)=="/"){url=url2.substr(0,url2.indexOf("/",url2.indexOf("://")+3))+url;}else{url=url2+url;}}
var i=url.lastIndexOf("/");if(i<0){return"";}else{return url.substr(0,i+1);}};Timeline.DefaultEventSource.prototype._resolveRelativeURL=function(url,base){if(url==null||url==""){return url;}else if(url.indexOf("://")>0){return url;}else if(url.substr(0,1)=="/"){return base.substr(0,base.indexOf("/",base.indexOf("://")+3))+url;}else{return base+url;}};Timeline.DefaultEventSource.Event=function(start,end,latestStart,earliestEnd,instant,text,description,image,link,icon,color,textColor){this._id="e"+Math.floor(Math.random()*1000000);this._instant=instant||(end==null);this._start=start;this._end=(end!=null)?end:start;this._latestStart=(latestStart!=null)?latestStart:(instant?this._end:this._start);this._earliestEnd=(earliestEnd!=null)?earliestEnd:(instant?this._start:this._end);this._text=Timeline.HTML.deEntify(text);this._description=Timeline.HTML.deEntify(description);this._image=(image!=null&&image!="")?image:null;this._link=(link!=null&&link!="")?link:null;this._icon=(icon!=null&&icon!="")?icon:null;this._color=(color!=null&&color!="")?color:null;this._textColor=(textColor!=null&&textColor!="")?textColor:null;this._wikiURL=null;this._wikiSection=null;};Timeline.DefaultEventSource.Event.prototype={getID:function(){return this._id;},isInstant:function(){return this._instant;},isImprecise:function(){return this._start!=this._latestStart||this._end!=this._earliestEnd;},getStart:function(){return this._start;},getEnd:function(){return this._end;},getLatestStart:function(){return this._latestStart;},getEarliestEnd:function(){return this._earliestEnd;},getText:function(){return this._text;},getDescription:function(){return this._description;},getImage:function(){return this._image;},getLink:function(){return this._link;},getIcon:function(){return this._icon;},getColor:function(){return this._color;},getTextColor:function(){return this._textColor;},getProperty:function(name){return null;},getWikiURL:function(){return this._wikiURL;},getWikiSection:function(){return this._wikiSection;},setWikiInfo:function(wikiURL,wikiSection){this._wikiURL=wikiURL;this._wikiSection=wikiSection;},fillDescription:function(elmt){elmt.innerHTML=this._description;},fillWikiInfo:function(elmt){if(this._wikiURL!=null&&this._wikiSection!=null){var wikiID=this.getProperty("wikiID");if(wikiID==null||wikiID.length==0){wikiID=this.getText();}
wikiID=wikiID.replace(/\s/g,"_");var url=this._wikiURL+this._wikiSection.replace(/\s/g,"_")+"/"+wikiID;var a=document.createElement("a");a.href=url;a.target="new";a.innerHTML=Timeline.strings[Timeline.Platform.clientLocale].wikiLinkLabel;elmt.appendChild(document.createTextNode("["));elmt.appendChild(a);elmt.appendChild(document.createTextNode("]"));}else{elmt.style.display="none";}},fillTime:function(elmt,labeller){if(this._instant){if(this.isImprecise()){elmt.appendChild(elmt.ownerDocument.createTextNode(labeller.labelPrecise(this._start)));elmt.appendChild(elmt.ownerDocument.createElement("br"));elmt.appendChild(elmt.ownerDocument.createTextNode(labeller.labelPrecise(this._end)));}else{elmt.appendChild(elmt.ownerDocument.createTextNode(labeller.labelPrecise(this._start)));}}else{if(this.isImprecise()){elmt.appendChild(elmt.ownerDocument.createTextNode(labeller.labelPrecise(this._start)+" ~ "+labeller.labelPrecise(this._latestStart)));elmt.appendChild(elmt.ownerDocument.createElement("br"));elmt.appendChild(elmt.ownerDocument.createTextNode(labeller.labelPrecise(this._earliestEnd)+" ~ "+labeller.labelPrecise(this._end)));}else{elmt.appendChild(elmt.ownerDocument.createTextNode(labeller.labelPrecise(this._start)));elmt.appendChild(elmt.ownerDocument.createElement("br"));elmt.appendChild(elmt.ownerDocument.createTextNode(labeller.labelPrecise(this._end)));}}},fillInfoBubble:function(elmt,theme,labeller){var doc=elmt.ownerDocument;var title=this.getText();var link=this.getLink();var image=this.getImage();if(image!=null){var img=doc.createElement("img");img.src=image;theme.event.bubble.imageStyler(img);elmt.appendChild(img);}
var divTitle=doc.createElement("div");var textTitle=doc.createTextNode(title);if(link!=null){var a=doc.createElement("a");a.href=link;a.appendChild(textTitle);divTitle.appendChild(a);}else{divTitle.appendChild(textTitle);}
theme.event.bubble.titleStyler(divTitle);elmt.appendChild(divTitle);var divBody=doc.createElement("div");this.fillDescription(divBody);theme.event.bubble.bodyStyler(divBody);elmt.appendChild(divBody);var divTime=doc.createElement("div");this.fillTime(divTime,labeller);theme.event.bubble.timeStyler(divTime);elmt.appendChild(divTime);var divWiki=doc.createElement("div");this.fillWikiInfo(divWiki);theme.event.bubble.wikiStyler(divWiki);elmt.appendChild(divWiki);}};

/* themes.js */

Timeline.ClassicTheme=new Object();Timeline.ClassicTheme.implementations=[];Timeline.ClassicTheme.create=function(locale){if(locale==null){locale=Timeline.Platform.getDefaultLocale();}
var f=Timeline.ClassicTheme.implementations[locale];if(f==null){f=Timeline.ClassicTheme._Impl;}
return new f();};Timeline.ClassicTheme._Impl=function(){this.firstDayOfWeek=0;this.ether={backgroundColors:["#EEE","#DDD","#CCC","#AAA"],highlightColor:"white",highlightOpacity:50,interval:{line:{show:true,color:"#aaa",opacity:25},weekend:{color:"#FFFFE0",opacity:30},marker:{hAlign:"Bottom",hBottomStyler:function(elmt){elmt.className="timeline-ether-marker-bottom";},hBottomEmphasizedStyler:function(elmt){elmt.className="timeline-ether-marker-bottom-emphasized";},hTopStyler:function(elmt){elmt.className="timeline-ether-marker-top";},hTopEmphasizedStyler:function(elmt){elmt.className="timeline-ether-marker-top-emphasized";},vAlign:"Right",vRightStyler:function(elmt){elmt.className="timeline-ether-marker-right";},vRightEmphasizedStyler:function(elmt){elmt.className="timeline-ether-marker-right-emphasized";},vLeftStyler:function(elmt){elmt.className="timeline-ether-marker-left";},vLeftEmphasizedStyler:function(elmt){elmt.className="timeline-ether-marker-left-emphasized";}}}};this.event={track:{offset:0.5,height:1.5,gap:0.5},instant:{icon:Timeline.urlPrefix+"images/dull-blue-circle.png",lineColor:"#58A0DC",impreciseColor:"#58A0DC",impreciseOpacity:20,showLineForNoText:true},duration:{color:"#58A0DC",opacity:100,impreciseColor:"#58A0DC",impreciseOpacity:20},label:{insideColor:"white",outsideColor:"black",width:200},highlightColors:["#FFFF00","#FFC000","#FF0000","#0000FF"],bubble:{width:250,height:125,titleStyler:function(elmt){elmt.className="timeline-event-bubble-title";},bodyStyler:function(elmt){elmt.className="timeline-event-bubble-body";},imageStyler:function(elmt){elmt.className="timeline-event-bubble-image";},wikiStyler:function(elmt){elmt.className="timeline-event-bubble-wiki";},timeStyler:function(elmt){elmt.className="timeline-event-bubble-time";}}};};

/* units.js */

Timeline.NativeDateUnit=new Object();Timeline.NativeDateUnit.createLabeller=function(locale,timeZone){return new Timeline.GregorianDateLabeller(locale,timeZone);};Timeline.NativeDateUnit.makeDefaultValue=function(){return new Date();};Timeline.NativeDateUnit.cloneValue=function(v){return new Date(v.getTime());};Timeline.NativeDateUnit.getParser=function(format){if(typeof format=="string"){format=format.toLowerCase();}
return(format=="iso8601"||format=="iso 8601")?Timeline.DateTime.parseIso8601DateTime:Timeline.DateTime.parseGregorianDateTime;};Timeline.NativeDateUnit.parseFromObject=function(o){return Timeline.DateTime.parseGregorianDateTime(o);};Timeline.NativeDateUnit.toNumber=function(v){return v.getTime();};Timeline.NativeDateUnit.fromNumber=function(n){return new Date(n);};Timeline.NativeDateUnit.compare=function(v1,v2){var n1,n2;if(typeof v1=="object"){n1=v1.getTime();}else{n1=Number(v1);}
if(typeof v2=="object"){n2=v2.getTime();}else{n2=Number(v2);}
return n1-n2;};Timeline.NativeDateUnit.earlier=function(v1,v2){return Timeline.NativeDateUnit.compare(v1,v2)<0?v1:v2;};Timeline.NativeDateUnit.later=function(v1,v2){return Timeline.NativeDateUnit.compare(v1,v2)>0?v1:v2;};Timeline.NativeDateUnit.change=function(v,n){return new Date(v.getTime()+n);};

Timeline.GregorianDateLabeller.monthNames["en"] = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
Timeline.strings["en"] = {wikiLinkLabel:"Discuss"};

} // end of 'install only once'
/*}}}*/
/***
From:
// http://simile.mit.edu/repository/timeline/trunk/src/webapp/api/bundle.css
***/
/*{{{*/
.timeline-ether-marker-bottom {
    width:          5em; 
    height:         1.5em; 
    border-left:    1px solid #aaa; 
    padding-left:   2px; 
    color:          #aaa;
}

.timeline-ether-marker-bottom-emphasized {
    width:          5em; 
    height:         2em; 
    border-left:    1px solid #aaa; 
    padding-left:   2px; 
    color:          black;
}

.timeline-ether-marker-top {
    width:          5em; 
    height:         1.5em; 
    border-left:    1px solid #aaa; 
    padding-left:   2px; 
    color:          #aaa;
}

.timeline-ether-marker-top-emphasized {
    width:          5em; 
    height:         2em; 
    border-left:    1px solid #aaa; 
    padding-left:   2px; 
    color:          black;
}


.timeline-ether-marker-right {
    width:          5em; 
    height:         1.5em; 
    border-top:     1px solid #aaa; 
    padding-top:    2px; 
    color:          #aaa;
}

.timeline-ether-marker-right-emphasized {
    width:          7em; 
    height:         1.5em; 
    border-top:     1px solid #aaa; 
    padding-top:    2px; 
    color:          black;
}
.timeline-ether-marker-left {
    width:          5em; 
    height:         1.5em; 
    border-top:     1px solid #aaa; 
    padding-top:    2px; 
    color:          #aaa;
}

.timeline-ether-marker-left-emphasized {
    width:          7em; 
    height:         1.5em; 
    border-top:     1px solid #aaa; 
    padding-top:    2px; 
    color:          black;
}
.timeline-duration-event {
    position: absolute;
    overflow: hidden;
    border: 1px solid blue;
}

.timeline-instant-event2 {
    position: absolute;
    overflow: hidden;
    border-left: 1px solid blue;
    padding-left: 2px;
}

.timeline-instant-event {
    position: absolute;
    overflow: hidden;
}

.timeline-event-bubble-title {
    font-weight: bold;
    border-bottom: 1px solid #888;
    margin-bottom: 0.5em;
}

.timeline-event-bubble-body {
}

.timeline-event-bubble-wiki {
    margin:     0.5em;
    text-align: right;
    color:      #A0A040;
}
.timeline-event-bubble-wiki a {
    color:      #A0A040;
}

.timeline-event-bubble-time {
    color: #aaa;
}

.timeline-event-bubble-image {
    float: right;
    padding-left: 5px;
    padding-bottom: 5px;
}.timeline-container {
    position: relative;
    overflow: hidden;
}

.timeline-copyright {
    position: absolute;
    bottom: 0px;
    left: 0px;
    z-index: 1000;
    cursor: pointer;
}

.timeline-message-container {
    position:   absolute;
    top:        30%;
    left:       35%;
    right:      35%;
    z-index:    1000;
    display:    none;
}
.timeline-message {
    font-size:      120%;
    font-weight:    bold;
    text-align:     center;
}
.timeline-message img {
    vertical-align: middle;
}

.timeline-band {
    position:   absolute;
    background: #eee;
    z-index:    10;
}

.timeline-band-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

.timeline-band-input {
    position:   absolute;
    width:      1em;
    height:     1em;
    overflow:   hidden;
    z-index:    0;
}
.timeline-band-input input{
    width:      0;
}

.timeline-band-layer {
    position:   absolute;
    width:      100%;
    height:     100%;
}

.timeline-band-layer-inner {
    position:   relative;
    width:      100%;
    height:     100%;
}
/*}}}*/
/***
|''Name:''|SinglePageModePlugin|
|''Source:''|http://www.TiddlyTools.com/#SinglePageModePlugin|
|''Author:''|Eric Shulman - ELS Design Studios|
|''License:''|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|''~CoreVersion:''|2.0.10|

Normally, as you click on the links in TiddlyWiki, more and more tiddlers are displayed on the page. The order of this tiddler display depends upon when and where you have clicked. Some people like this non-linear method of reading the document, while others have reported that when many tiddlers have been opened, it can get somewhat confusing.

!!!!!Usage
<<<
SinglePageMode allows you to configure TiddlyWiki to navigate more like a traditional multipage web site with only one item displayed at a time. When SinglePageMode is enabled, the title of the current tiddler is automatically displayed in the browser window's titlebar and the browser's location URL is updated with a 'permalink' for the current tiddler so that it is easier to create a browser 'bookmark' for the current tiddler.

Even when SinglePageMode is disabled (i.e., displaying multiple tiddlers is permitted), you can reduce the potential for confusion by enable TopOfPageMode, which forces tiddlers to always open at the top of the page instead of being displayed following the tiddler containing the link that was clicked.
<<<
!!!!!Configuration
<<<
When installed, this plugin automatically adds checkboxes in the AdvancedOptions tiddler so you can enable/disable the plugin behavior. For convenience, these checkboxes are also included here:

<<option chkSinglePageMode>> Display one tiddler at a time
<<option chkTopOfPageMode>> Always open tiddlers at the top of the page
<<<
!!!!!Installation
<<<
import (or copy/paste) the following tiddlers into your document:
''SinglePageModePlugin'' (tagged with <<tag systemConfig>>)
^^documentation and javascript for SinglePageMode handling^^

When installed, this plugin automatically adds checkboxes in the ''shadow'' AdvancedOptions tiddler so you can enable/disable this behavior. However, if you have customized your AdvancedOptions, you will need to ''manually add these checkboxes to your customized tiddler.''
<<<
!!!!!Revision History
<<<
''2006.07.04 [2.2.1]'' in hijack for displayTiddlers(), suspend TPM as well as SPM so that DefaultTiddlers displays in the correct order.
''2006.06.01 [2.2.0]'' added chkTopOfPageMode (TPM) handling
''2006.02.04 [2.1.1]'' moved global variable declarations to config.* to avoid FireFox 1.5.0.1 crash bug when assigning to globals
''2005.12.27 [2.1.0]'' hijack displayTiddlers() so that SPM can be suspended during startup while displaying the DefaultTiddlers (or #hash list). Also, corrected initialization for undefined SPM flag to "false", so default behavior is to display multiple tiddlers
''2005.12.27 [2.0.0]'' Update for TW2.0
''2005.11.24 [1.1.2]'' When the back and forward buttons are used, the page now changes to match the URL. Based on code added by Clint Checketts
''2005.10.14 [1.1.1]'' permalink creation now calls encodeTiddlyLink() to handle tiddler titles with spaces in them
''2005.10.14 [1.1.0]'' added automatic setting of window title and location bar ('auto-permalink'). feature suggestion by David Dickens.
''2005.10.09 [1.0.1]'' combined documentation and code in a single tiddler
''2005.08.15 [1.0.0]'' Initial Release
<<<
!!!!!Credits
<<<
This feature was developed by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]].
Support for BACK/FORWARD buttons adapted from code developed by Clint Checketts
<<<
!!!!!Code
***/
//{{{
version.extensions.SinglePageMode= {major: 2, minor: 2, revision: 1, date: new Date(2006,7,3)};

if (config.options.chkSinglePageMode==undefined) config.options.chkSinglePageMode=false;
config.shadowTiddlers.AdvancedOptions += "\n<<option chkSinglePageMode>> Display one tiddler at a time";

if (config.options.chkTopOfPageMode==undefined) config.options.chkTopOfPageMode=false;
config.shadowTiddlers.AdvancedOptions += "\n<<option chkTopOfPageMode>> Always open tiddlers at the top of the page";

config.SPMTimer = 0;
config.lastURL = window.location.hash;
function checkLastURL()
{
 if (!config.options.chkSinglePageMode)
 { window.clearInterval(config.SPMTimer); config.SPMTimer=0; return; }
 if (config.lastURL == window.location.hash)
 return;
 var tiddlerName = convertUTF8ToUnicode(decodeURI(window.location.hash.substr(1)));
 tiddlerName=tiddlerName.replace(/\[\[/,"").replace(/\]\]/,""); // strip any [[ ]] bracketing
 if (tiddlerName.length) story.displayTiddler(null,tiddlerName,1,null,null);
}

if (Story.prototype.SPM_coreDisplayTiddler==undefined) Story.prototype.SPM_coreDisplayTiddler=Story.prototype.displayTiddler;
Story.prototype.displayTiddler = function(srcElement,title,template,animate,slowly)
{
 if (config.options.chkSinglePageMode) {
 window.location.hash = encodeURIComponent(String.encodeTiddlyLink(title));
 config.lastURL = window.location.hash;
 document.title = wikifyPlain("SiteTitle") + " - " + title;
 story.closeAllTiddlers();
 if (!config.SPMTimer) config.SPMTimer=window.setInterval(function() {checkLastURL();},1000);
 }
 if (config.options.chkTopOfPageMode) { story.closeTiddler(title); window.scrollTo(0,0); srcElement=null; }
 this.SPM_coreDisplayTiddler(srcElement,title,template,animate,slowly)
}

if (Story.prototype.SPM_coreDisplayTiddlers==undefined) Story.prototype.SPM_coreDisplayTiddlers=Story.prototype.displayTiddlers;
Story.prototype.displayTiddlers = function(srcElement,titles,template,unused1,unused2,animate,slowly)
{
 // suspend single-page mode when displaying multiple tiddlers
 var saveSPM=config.options.chkSinglePageMode; config.options.chkSinglePageMode=false;
 var saveTPM=config.options.chkTopOfPageMode; config.options.chkTopOfPageMode=false;
 this.SPM_coreDisplayTiddlers(srcElement,titles,template,unused1,unused2,animate,slowly);
 config.options.chkSinglePageMode=saveSPM; config.options.chkTopOfPageMode=saveTPM;
}
//}}}
|<<siteMap choice>><<siteMap knowledge>> |<<siteMap perception>><<siteMap perspective>><<siteMap responsibility>> |<<siteMap [[the path]]>><<siteMap unknown>><<siteMap wisdom>>  |

/***
| Name:|SiteMapMacro|
| Author:|Simon Baird|
| Location:|http://simonbaird.com/mptw/#SiteMapMacro|
| Version:|1.0.3, 15-Mar-06|

!!Examples
See SiteMap and SliderSiteMap for example usage.

!!Parameters
* Name of tiddler to start at
* Max depth (a number) 
* Format (eg, nested, see formats below)
* Don't show root flag (anything other than null turns it on)
* Tags - a string containing a bracketed list of tags that we are interested in

!!History
* 1.0.3 (15-Mar-06)
** added tag filtering
* 1.0.2 (15-Mar-06)
** Added json format and dontshowroot option
* 1.0.1 (9-Mar-06)
** Added selectable formats and fixed nested slider format
* 1.0.0 (8-Mar-06)
** first release

***/
//{{{

version.extensions.SiteMapMacro = {
	major: 1,
	minor: 0,
	revision: 3,
	date: new Date(2006,3,15),
	source: "http://simonbaird.com/mptw/#SiteMapMacro"
};

config.macros.siteMap = {

	formats: {
		bullets: {
			formatString: "%0[[%1]]\n%2",
			indentString: "*"
		},

		// put this in your StyleSheet to make it look good.
		// .sliderPanel { margin-left: 2em; }

		sliders: {
			formatString: "[[%1]]+++\n%2===\n\n",
			formatStringLeaf: "[[%1]]\n"
		},

		openSliders: {
			formatString: "[[%1]]++++\n%2===\n\n",
			formatStringLeaf: "[[%1]]\n"
		},

		popups: {
			formatString: "[[%1]]+++^\n%2===\n\n",
			formatStringLeaf: "[[%1]]\n"
		},

		// these don't work too well
		openPopups: {
			formatString: "[[%1]]++++^\n%2===\n\n",
			formatStringLeaf: "[[%1]]\n"
		},
		
		// this is a little nuts but it works
		json: {
			formatString: '\n%0{"%1":[%2\n%0]}',
			formatStringLeaf: '\n%0"%1"',
			indentString: "  ",
			separatorString: ","
		}


	},

	defaultFormat: "bullets",

	treeTraverse: function(title,depth,maxdepth,format,dontshowroot,tags,excludetags) {

		var tiddler = store.getTiddler(title);
		var tagging = store.getTaggedTiddlers(title);

		if (dontshowroot)
			depth = 0;

		var indent = "";
		if (this.formats[format].indentString)
			for (var j=0;j<depth;j++)
				indent += this.formats[format].indentString;

		var childOutput = "";
		if (!maxdepth || depth < parseInt(maxdepth)) 
			for (var i=0;i<tagging.length;i++)
				if (tagging[i].title != title) {
					if (this.formats[format].separatorString && i != 0)
						childOutput += this.formats[format].separatorString;
					childOutput += this.treeTraverse(tagging[i].title,depth+1,maxdepth,format,null,tags,excludetags);
				}

		if (childOutput == "" && (
				(tags && tags != "" && !tiddler.tags.containsAll(tags.readBracketedList())) ||
				(excludetags && excludetags != "" && tiddler.tags.containsAny(excludetags.readBracketedList()))
				)
			) {
			// so prune it cos it doesn't have the right tags and neither do any of it's children
			return "";
		}

		if (dontshowroot)
			return childOutput;

		if (this.formats[format].formatStringLeaf && childOutput == "") {
			// required for nestedSliders
			return this.formats[format].formatStringLeaf.format([indent,title,childOutput]);
		}

		return this.formats[format].formatString.format([indent,title,childOutput]);
	},

	handler: function (place,macroName,params,wikifier,paramString,tiddler) {
		wikify(this.treeTraverse(
			params[0] && params[0] != '.' ? params[0] : tiddler.title, 1, 
			params[1] && params[1] != '.' ? params[1] : null, // maxdepth
			params[2] && params[2] != '.' ? params[2] : this.defaultFormat, // format
			params[3] && params[3] != '.' ? params[3] : null, // dontshowroot
			params[4] && params[4] != '.' ? params[4] : null, // tags
			params[5] && params[5] != '.' ? params[5] : null // excludetags
			),place);
	}

}

//}}}
it ain't real...but it is a learning experience
Distorted Reality
/***
|''Name:''|SparklinePlugin|
|''Description:''|Sparklines macro|
***/
//{{{
if(!version.extensions.SparklinePlugin) {
version.extensions.SparklinePlugin = {installed:true};

//--
//-- Sparklines
//--

config.macros.sparkline = {};
config.macros.sparkline.handler = function(place,macroName,params)
{
	var data = [];
	var min = 0;
	var max = 0;
	var v;
	for(var t=0; t<params.length; t++) {
		v = parseInt(params[t]);
		if(v < min)
			min = v;
		if(v > max)
			max = v;
		data.push(v);
	}
	if(data.length < 1)
		return;
	var box = createTiddlyElement(place,"span",null,"sparkline",String.fromCharCode(160));
	box.title = data.join(",");
	var w = box.offsetWidth;
	var h = box.offsetHeight;
	box.style.paddingRight = (data.length * 2 - w) + "px";
	box.style.position = "relative";
	for(var d=0; d<data.length; d++) {
		var tick = document.createElement("img");
		tick.border = 0;
		tick.className = "sparktick";
		tick.style.position = "absolute";
		tick.src = "data:image/gif,GIF89a%01%00%01%00%91%FF%00%FF%FF%FF%00%00%00%C0%C0%C0%00%00%00!%F9%04%01%00%00%02%00%2C%00%00%00%00%01%00%01%00%40%02%02T%01%00%3B";
		tick.style.left = d*2 + "px";
		tick.style.width = "2px";
		v = Math.floor(((data[d] - min)/(max-min)) * h);
		tick.style.top = (h-v) + "px";
		tick.style.height = v + "px";
		box.appendChild(tick);
	}
};


}
//}}}
/***

''Inspired by [[TiddlyPom|http://www.warwick.ac.uk/~tuspam/tiddlypom.html]]''

|Name|SplashScreenPlugin|
|Created by|SaqImtiaz|
|Location|http://lewcid.googlepages.com/lewcid.html#SplashScreenPlugin|
|Version|0.21 |
|Requires|~TW2.08+|
!Description:
Provides a simple splash screen that is visible while the TW is loading.

!Installation
Copy the source text of this tiddler to your TW in a new tiddler, tag it with systemConfig and save and reload. The SplashScreen will now be installed and will be visible the next time you reload your TW.

!Customizing
Once the SplashScreen has been installed and you have reloaded your TW, the splash screen html will be present in the MarkupPreHead tiddler. You can edit it and customize to your needs.

!History
* 20-07-06 : version 0.21, modified to hide contentWrapper while SplashScreen is displayed.
* 26-06-06 : version 0.2, first release

!Code
***/
//{{{
var old_lewcid_splash_restart=restart;

restart = function()
{ if (document.getElementById("SplashScreen"))
 document.getElementById("SplashScreen").style.display = "none";
 if (document.getElementById("contentWrapper"))
 document.getElementById("contentWrapper").style.display = "block";
 
 old_lewcid_splash_restart();
 
 if (splashScreenInstall)
 {if(config.options.chkAutoSave)
 {saveChanges();}
 displayMessage("TW SplashScreen has been installed, please save and refresh your TW.");
 }
}


var oldText = store.getTiddlerText("MarkupPreHead");
if (oldText.indexOf("SplashScreen")==-1)
 {var siteTitle = store.getTiddlerText("SiteTitle");
 var splasher='\n\n<style type="text/css">#contentWrapper {display:none;}</style><div id="SplashScreen" style="border: 3px solid #ccc; display: block; text-align: center; width: 320px; margin: 100px auto; padding: 50px; color:#000; font-size: 28px; font-family:Tahoma; background-color:#eee;"><b>'+siteTitle +'</b> is loading<blink> ...</blink><br><br><span style="font-size: 14px; color:red;">Requires Javascript.</span></div>';
 if (! store.tiddlerExists("MarkupPreHead"))
 {var myTiddler = store.createTiddler("MarkupPreHead");}
 else
 {var myTiddler = store.getTiddler("MarkupPreHead");}
 myTiddler.set(myTiddler.title,oldText+splasher,config.options.txtUserName,null,null);
 store.setDirty(true);
 var splashScreenInstall = true;
}
//}}}
/*{{{*/
/*Haemoglobin Theme for TiddlyWiki*/
/*Design and CSS by Saq Imtiaz*/
/*Version 1.0*/
/*}}}*/
/*{{{*/

#sidebarTabs {font-family:arial,helvetica;}

body
{background:#fefefe;}

#contentWrapper {
	font-family: Verdana, Arial, Tahoma, Sans-Serif;
	color: #555555;
margin:1.9em auto 1em ; width:800px;}

#header {background:#fefefe;}

.headerShadow {	padding: 1.4em 0em 0.5em 1em; }

.siteTitle {
			font-family: 'Trebuchet MS' sans-serif;
			font-weight: bold;
			font-size: 36px;
			color: #1b5790;
			background-color: transparent;
}

.siteSubtitle {
	font-size: 1.0em;
        display: block;
        margin: .5em 3em; color: #999;
}

.clearAll {clear:both;}
.tagClear {clear:none;}
#sidebar {position:relative; float:right; display:inline; right:0;}

a{
color:#1b5790;
text-decoration: none; font-weight:normal;
}

a:hover{
color:#1b5790;
background-color: #fefefe;
border-bottom:1px solid #1b5790;
}

.viewer .button, .editorFooter .button{
color: #555;
border: 1px solid #1b5790;
}

.viewer .button:hover,
.editorFooter .button:hover{
color: #fff;
background: #1b5790;
border-color: #1b5790;
}

.viewer .button:active, .viewer .highlight,.editorFooter .button:active, .editorFooter .highlight{color:#fff; background:#9F1313;border-color:#9F1313;}

#topMenu br {display:none;}

#topMenu {padding:0.45em 1em; background:#1b5790;}

#topMenu a, #topMenu .tiddlyLink, #topMenu .button {color:#f1f1f1; padding:0.3em 0.45em; margin:0 4px;font-size:120%;font-weight:normal; border:none; background:#1b5790; text-decoration:none; }

#topMenu a:hover, #topMenu .tiddlyLink:hover, #topMenu .button:hover, #topMenu .button:active, #topMenu .highlight {color:#fff;text-decoration:none; background:#2e6ab1; }



#displayArea{margin:0 17em 2em 0.5em;}

.tiddler {padding-left:0;}

.title {color:#1b5790; border-bottom:1px solid#1b5790; }
.subtitle, .subtitle a { color: #999999; font-size: 1.0em;margin:0.2em;}
.shadow .title{color:#999;}

.toolbar {font-size:85%;}
.selected .toolbar a {color:#999999;}
.selected .toolbar a:hover {color:#333; background:transparent;border:1px solid #fff;}

.toolbar .button:hover, .toolbar .highlight, .toolbar .marked, .toolbar a.button:active{color:#333; background:transparent;border:1px solid #fff;}

    *  html .viewer pre {

margin-left: 0em;
}

    * html .editor textarea, * html .editor input {

width: 98%;
}

/***
!Sidebar
***/
#sidebar {position:relative;float:right; line-height: 1.4em; border-left:0px solid#000; display:inline; background:#fefefe; right:0; margin-bottom:2em !important; margin-bottom:1em;
width: 16em;}

/***
!SidebarOptions
***/
#sidebarOptions {padding-left:0.5em; padding-top:2em;}

#sidebarOptions a {
			color:#999;
			text-decoration: none;}

#sidebarOptions	a:hover, #sidebarOptions a:active {
			color:#2e6ab1;
			background-color:#f5f5f5;border:1px solid #f5f5f5;
		}

#sidebarOptions input {border:1px solid #999; }



 .listTitle {color:#888;}

#sidebarTabs .tabContents {background:#fefefe;}
#sidebarTabs .tabContents .tiddlyLink, #sidebarTabs .tabContents .button{color:#999;}
#sidebarTabs .tabContents .tiddlyLink:hover,#sidebarTabs .tabContents .button:hover{color:#2e6ab1;background:#fefefe; text-decoration:none;border:none;}

#sidebarTabs .tabContents .button:hover, #sidebarTabs .tabContents .highlight, #sidebarTabs .tabContents .marked, #sidebarTabs .tabContents a.button:active{color:#2e6ab1;background:#fefefe}


.tabSelected{color:#fefefe; background:#999;}



 .tabSelected, .tabSelected:hover {
 color: #555;
 background: #fefefe;
 border: solid 1px #ccc;

}

#sidebarTabs .tabUnselected:hover { border-bottom: none;padding-bottom:3px;color:#999;}

 .tabUnselected {
 color: #999;
 background: #eee;
 border: solid 1px #ccc;

}

.tabUnselected:hover {text-decoration:none; border:1px solid #ccc;}

#sidebarTabs .tabUnselected { border-bottom: none;padding-bottom:3px;}
#sidebarTabs .tabSelected{padding-bottom:3px;}

#sidebarOptions .sliderPanel {
	background: #eee; border:1px solid#ccc;
	font-size: .9em;
}

#sidebarOptions .sliderPanel input {border:1px solid #999;}
#sidebarOptions .sliderPanel .txtOptionInput {border:1px solid #999;width:9em;}

#sidebarOptions .sliderPanel a {font-weight:normal; color:#555;background-color: #eee; border-bottom:1px dotted #333;}


#sidebarOptions .sliderPanel a:hover {
color:#111;
background-color: #eee;
border:none;
border-bottom:1px dotted #111;
}

.tabContents {background:#fefefe;}




.tagging, .tagged {
border: 1px solid #eee;
background-color: #F7F7F7;
}

.selected .tagging, .selected .tagged {
background-color: #f7f7f7;
border: 1px solid #ccc;
}

.tagging .listTitle, .tagged .listTitle {
color: #bbb;
}

.selected .tagging .listTitle, .selected .tagged .listTitle {
color: #666;
}

.tagging .button, .tagged .button {
color:#ccc;
}
.selected .tagging .button, .selected .tagged .button {
color:#aaa;
}

.highlight, .marked {background:transparent; color:#111; border:none; text-decoration:underline;}

.tagging .button:hover, .tagged .button:hover, .tagging .button:active, .tagged .button:active {
border: none; background:transparent; text-decoration:underline; color:#333;
}

.popup {
background: #1b5790;
border: 1px solid #1b5790;
}

.popup li.disabled {
color: #000;
}

.popup li a, .popup li a:visited {
color: #eee;
border: none;
}

.popup li a:hover {
background: #2e6ab1;
color: #fff;
border: none;
}



   #messageArea {

border: 4px solid #1b5790;
background: #fefefe;
color: #555;
font-size:90%;
}

   #messageArea a:hover { background:#f5f5f5; border:none;}


   #messageArea .button{
color: #666;
border: 1px solid #1b5790;
}

   #messageArea .button:hover {
color: #fff;
background: #1b5790;
border-color: #1b5790;
}

   #ContentFooter {background:#1b5790; color:#fff; clear: both; padding: 0.5em 1em; }


#ContentFooter a {
color: #fff;
border-bottom: 1px dotted #fff; font-weight:normal;text-decoration:none;
}



#contentFooter a:hover {
color: #000;
background-color: #fff;
border-bottom: 1px dotted #fff; text-decoration:none;
}




.searchBar {float:right;font-size: 1.0em;position:relative; margin-top:1.3em;}
.searchBar .button {color:#999;display:block;}
.searchBar .button:hover {border:1px solid #fefefe;color:#4F4B45;}
.searchBar input {			
                        background-color: #fefefe;
			color: #999999;
			border: 1px solid #CCC;		margin-right:3px;
}

.tiddler {padding-bottom:10px;}

.viewer blockquote {
border-left: 5px solid #1b5790;
}

.viewer table, .viewer td {
border: 1px solid #1b5790;
}

.viewer th, thead td {
background: #1b5790;
border: 1px solid #1b5790;
color: #fff;
}
.viewer pre {
	border: 1px solid #ccc;
	background: #f5f5f5;
}

.viewer code {
color: #111; background:#f5f5f5;
}

.viewer hr {
border-top: dashed 1px #555;
}

.editor input {
border: 1px solid #888; margin-top:5px;
}

.editor textarea {
border: 1px solid #888;
}

h1,h2,h3,h4,h5 { color: #1b5790; background: transparent; padding-bottom:2px; font-family: Arial, Helvetica, sans-serif; }
h1 {font-size:18px;}
h2 {font-size:16px;}
h3 {font-size: 14px;}
/*}}}*/
/***
|Name|TabEditPlugin|
|Created by|SaqImtiaz|
|Location|http://lewcid.googlepages.com/lewcid.html#TabEditPlugin|
|Version|0.32|
|Requires|~TW2.x|

!Description
Makes editing of tabs easier.

!Usage
*Double click a tab to edit the source tiddler
*Double click outside the tabset to edit the containing tiddler. 

!Demo
TestTabs

!History
*28-04-06, v0.32 - fixed previous bug fix!
*27-04-06, v0.31 - fixed conflicts with tabs created using PartTiddler.
*26-04-06, v0.30 - first public release

***/

//{{{

//tab on double click event handler
Story.prototype.onTabDblClick = function(e){
 if (!e) var e = window.event;
 var theTarget = resolveTarget(e);
 var title= this.getAttribute("source");
 if ((version.extensions.PartTiddlerPlugin)&&(title.indexOf("/")!=-1))
 {if (!oldFetchTiddler.call(this, [title]))
 {return false;}} 
 story.displayTiddler(theTarget,title,2,false,null)
 e.cancelBubble = true;
 if (e.stopPropagation) e.stopPropagation();
 return false;
 }

config.macros.tabs.switchTab = function(tabset,tab)
{
 var cookie = tabset.getAttribute("cookie");
 var theTab = null
 var nodes = tabset.childNodes;
 for(var t=0; t<nodes.length; t++)
 if(nodes[t].getAttribute && nodes[t].getAttribute("tab") == tab)
 {
 theTab = nodes[t];
 theTab.className = "tab tabSelected";
 }
 else
 nodes[t].className = "tab tabUnselected"
 if(theTab)
 {
 if(tabset.nextSibling && tabset.nextSibling.className == "tabContents")
 tabset.parentNode.removeChild(tabset.nextSibling);
 var tabContent = createTiddlyElement(null,"div",null,"tabContents",null);
 tabset.parentNode.insertBefore(tabContent,tabset.nextSibling);
 var contentTitle = theTab.getAttribute("content");

 //set source attribute equal to title of tiddler displayed in tab
 tabContent.setAttribute("source",contentTitle);
 //add dbl click event
 tabContent.ondblclick = story.onTabDblClick;

 wikify(store.getTiddlerText(contentTitle),tabContent,null,store.getTiddler(contentTitle));
 if(cookie)
 {
 config.options[cookie] = tab;
 saveOptionCookie(cookie);
 }
 }
}

//}}}
<<timeline '' '' '20060721'>>
/***
| Name:|''tagAdder''|
| Created by:|SaqImtiaz|
| Location:|http://lewcid.googlepages.com/lewcid.html|
| Version:|0.61 (07 Apr-2006)|
| Requires:|~TW2.07|
!About
*provides a drop down list for toggling tags 
*you can specify which tags to list, and have multiple drop downs with different tag lists.

!Demonstration
<<tagAdder>>
{{{<<tagAdder>>}}}

''I recommend using either tagAdder or monkeyTagger, with dropTags and dropTagging in the toolbar:''


!Installation:
*Copy this tiddler to your TW with the systemConfig tag
* copy the following to your ViewTemplate:
#either {{{
<div class='tagged' macro='tagAdder'></div>
}}} to add to next to the tags macro in the viewer area, or
#{{{<div class='toolbar' >
<span style="padding-right:1.75em;" macro='tagAdder'></span>
<span macro='toolbar -closeTiddler closeOthers +editTiddler permalink references jump'></span></div>}}} to add to the toolbar.
(adjust padding to taste)

!Usage:
*by default {{{<<tagAdder>>}}} will display drop down list of all tags, with tags present on the tiddler grouped together.
*to sort alphabetically (ignoring the [x]), use {{{<<tagAdder 'nogroup'>>}}}
*to specify what tags to list, use {{{<<tagAdder 'group/nogroup' 'tiddler'>>}}} where tiddler is a tiddler that is tagged with the tags you want to list. (use one of either group or no group, not both!)
Eg: TagDataBase is my tiddler that is tagged with the tags I want to list, so I will use {{{<<tagAdder 'group' 'TagDataBase'>>}}}
 for a list like this: <<tagAdder 'group' 'TagDataBase'>>
*you can specify a custom label by giving the macro an additional parameter.
Eg: {{{<<tagAdder 'group' 'TagDataBase' 'custom label'>>}}} gives <<tagAdder 'group' 'TagDataBase' 'custom label'>>

!Tips:
*On the tiddler you want to use as your TagsDataBase, add {{{<<tagAdder>>}}} for a drop down list of all tags, so you can easily toggle tags on it!
*You can have as many TagDataBases as you like.

!Notes:
*use css to style to taste
*tags to be removed are preceded by [x]

!To Do:
*Combine with features of normal tags drop down list.(drop tag macro)
*TagsDB manager
*''add exclude tag feature''

!History
*07 Apr-2006, version 0.61
**fixed IE bug with not returning false 

!CODE
***/
//{{{

config.macros.tagAdder= {};
//config.macros.tagAdder.dropdownchar = (document.all?"?":"?"); // the fat one is the only one that works in IE
config.macros.tagAdder.dropdownchar = "?"; // uncomment previous line and comment this for smaller version in FF
config.macros.tagAdder.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
 var arrow=': '+ config.macros.tagAdder.dropdownchar;
 var tAsort = (params[0] && params[0] !='.') ? params[0]: 'group';
 if (params[1]){var tAsource=params[1]};
 if ((tAsource)&&(!store.getTiddler(tAsource)))
 return false;
 var tAlabel= (params[2] && params[2] !='.')? params[2]: 'toggle tags'+arrow;
 var tAtooltip= (params[2] && params[2] !='.')? params[2]: 'toggle tags on this tiddler';

 if(tiddler instanceof Tiddler)
 {
 var title = tiddler.title;
 var lingo = config.views.editor.tagChooser;
 
 var ontagclick = function(e) {
 if (!e) var e = window.event;
 var tag = this.getAttribute("tag");

 var t=store.getTiddler(title);
 if (!t || !t.tags) return;
 if (t.tags.find(tag)==null)
 {t.tags.push(tag)}
 else
 {t.tags.splice(t.tags.find(tag),1)};
 story.saveTiddler(title);
 story.refreshTiddler(title,null,true);
 return false;
 };

 var onclick = function(e) {
 if (!e) var e = window.event;
 var popup = Popup.create(this);
 var t=store.getTiddler(title);
 if (!t) return false;
 var tagsarray = store.getTags();
 var tagsvalue=new Array();

 for (var i=0; i<tagsarray.length; i++){
 var thetagonly= (tagsarray[i][0]);
 tagsvalue.push(thetagonly);}

 if (tAsource)
 {var sourcetiddler=store.getTiddler(tAsource);
 var tagsvalue=sourcetiddler.tags;
 }
 var tagslabel=new Array();
 var tagssorted=new Array();

 for (var i=0;i<tagsvalue.length;i++){
 var temptag=(tagsvalue[i]);
 if (t.tags.find(temptag)==null)
 {var temptagx = '[ ] '+temptag;
 tagslabel.push(temptagx);
 tagssorted.push(temptag);
 }
 else
 {var temptagx ='[x] '+temptag;
 if (tAsort=='group'){
 tagslabel.unshift(temptagx);
 tagssorted.unshift(temptag);}
 else if (tAsort=='nogroup'){
 tagslabel.push(temptagx);
 tagssorted.push(temptag);} }
 ;}


 if(tagsvalue.length == 0)
 createTiddlyText(createTiddlyElement(popup,"li"),lingo.popupNone);
 for (var t=0; t<tagsvalue.length; t++)
 {
 var theTag = createTiddlyButton(createTiddlyElement(popup,"li"),tagslabel[t],"toggle '"+([tagssorted[t]])+"'",ontagclick);
 theTag.setAttribute("tag",tagssorted[t]);
 }
 Popup.show(popup,false);
 e.cancelBubble = true;
 if (e.stopPropagation) e.stopPropagation();
 return(false);
 };
 //createTiddlyButton(place,tAlabel,tAtooltip,onclick);
var createdropperButton = function(place){
var sp = createTiddlyElement(place,"span",null,"tagadderbutton");
var theDropDownBtn = createTiddlyButton(sp,tAlabel,tAtooltip,onclick);
};

createdropperButton(place);
}
};
setStylesheet(
 ".toolbar .tagadderbutton { margin-right:0em; border:0px solid #eee; padding:0px; padding-right:0px; padding-left:0px; }\n"+
 ".tagadderbutton a.button { padding:2px; padding-left:2px; padding-right:2px;}\n"+
// ".tagadderbutton {font-size:150%;}\n"+
 "",
"TagAdderStyles");

//}}}

/***
|''Name:''|~TaggerPlugin|
|''Version:''|1.0.1 (2006-06-01)|
|''Source:''|http://lewcid.googlepages.com/lewcid.html/#TaggerPlugin|
|''Author:''|SaqImtiaz|
|''Description:''|Provides a drop down listing current tiddler tags, and allowing toggling of tags.|
|''Documentation:''|[[TaggerPluginDocumentation]]|
|''Source Code:''|[[TaggerPluginSource]]|
|''~TiddlyWiki:''|Version 2.0.8 or better|
***/
// /%
config.tagger={defaults:{label:"Tags: ",tooltip:"Manage tiddler tags",taglist:"true",excludeTags:"",notags:"tiddler has no tags",aretags:"current tiddler tags:",toggletext:"add tags:"}};config.macros.tagger={};config.macros.tagger.arrow=(document.all?"▼":"▾");config.macros.tagger.handler=function(_1,_2,_3,_4,_5,_6){var _7=config.tagger.defaults;var _8=_5.parseParams("tagman",null,true);var _9=((_8[0].label)&&(_8[0].label[0])!=".")?_8[0].label[0]+this.arrow:_7.label+this.arrow;var _a=((_8[0].tooltip)&&(_8[0].tooltip[0])!=".")?_8[0].tooltip[0]:_7.tooltip;var _b=((_8[0].taglist)&&(_8[0].taglist[0])!=".")?_8[0].taglist[0]:_7.taglist;var _c=((_8[0].exclude)&&(_8[0].exclude[0])!=".")?(_8[0].exclude[0]).readBracketedList():_7.excludeTags.readBracketedList();if((_8[0].source)&&(_8[0].source[0])!="."){var _d=_8[0].source[0];}if(_d&&!store.getTiddler(_d)){return false;}var _e=function(e){if(!e){var e=window.event;}var _11=Popup.create(this);var _12=store.getTags();var _13=new Array();for(var i=0;i<_12.length;i++){_13.push(_12[i][0]);}if(_d){var _15=store.getTiddler(_d);_13=_15.tags.sort();}var _16=_6.tags.sort();var _17=function(_18,_19,_1a){var sp=createTiddlyElement(createTiddlyElement(_11,"li"),"span",null,"tagger");var _1c=createTiddlyButton(sp,_18,_1a+" '"+_19+"'",taggerOnToggle,"button","toggleButton");_1c.setAttribute("tiddler",_6.title);_1c.setAttribute("tag",_19);insertSpacer(sp);if(window.createTagButton_orig_mptw){createTagButton_orig_mptw(sp,_19)}else{createTagButton(sp,_19);}};createTiddlyElement(_11,"li",null,"listTitle",(_6.tags.length==0?_7.notags:_7.aretags));for(var t=0;t<_16.length;t++){_17("[x]",_16[t],"remove tag ");}createTiddlyElement(createTiddlyElement(_11,"li"),"hr");if(_b!="false"){createTiddlyElement(_11,"li",null,"listTitle",_7.toggletext);for(var i=0;i<_13.length;i++){if(!_6.tags.contains(_13[i])&&!_c.contains(_13[i])){_17("[ ]",_13[i],"add tag ");}}createTiddlyElement(createTiddlyElement(_11,"li"),"hr");}var _1f=createTiddlyButton(createTiddlyElement(_11,"li"),("Create new tag"),null,taggerOnToggle);_1f.setAttribute("tiddler",_6.title);if(_d){_1f.setAttribute("source",_d);}Popup.show(_11,false);e.cancelBubble=true;if(e.stopPropagation){e.stopPropagation();}return (false);};createTiddlyButton(_1,_9,_a,_e,"button","taggerDrpBtn");};window.taggerOnToggle=function(e){var tag=this.getAttribute("tag");var _22=this.getAttribute("tiddler");var _23=store.getTiddler(_22);if(!tag){var _24=prompt("Enter new tag:","");if(_24!=""&&_24!=null){var tag=_24;if(this.getAttribute("source")){var _26=store.getTiddler(this.getAttribute("source"));_26.tags.pushUnique(_24);}}else{return false;}}if(!_23||!_23.tags){store.saveTiddler(_22,_22,"",config.options.txtUserName,new Date(),tag);}else{if(_23.tags.find(tag)==null){_23.tags.push(tag);}else{if(!_24){_23.tags.splice(_23.tags.find(tag),1);}}store.saveTiddler(_23.title,_23.title,_23.text,_23.modifier,_23.modified,_23.tags);}story.refreshTiddler(_22,null,true);if(config.options.chkAutoSave){saveChanges();}return false;};setStylesheet(".tagger a.button {font-weight: bold;display:inline; padding:0px;}\n"+".tagger #toggleButton {padding-left:2px; padding-right:2px; margin-right:1px; font-size:110%;}\n"+"#nestedtagger {background:#2E5ADF; border: 1px solid #0331BF;}\n"+".popup .listTitle {color:#000;}\n"+"","TaggerStyles");window.lewcidTiddlerSwapTag=function(_27,_28,_29){for(var i=0;i<_27.tags.length;i++){if(_27.tags[i]==_28){_27.tags[i]=_29;return true;}}return false;};window.lewcidRenameTag=function(e){var tag=this.getAttribute("tag");var _2d=prompt("Rename tag '"+tag+"' to:",tag);if((_2d==tag)||(_2d==null)){return false;}if(store.tiddlerExists(_2d)){if(confirm(config.messages.overwriteWarning.format([_2d.toString()]))){story.closeTiddler(_2d,false,false);}else{return null;}}tagged=store.getTaggedTiddlers(tag);if(tagged.length!=0){for(var j=0;j<tagged.length;j++){lewcidTiddlerSwapTag(tagged[j],tag,_2d);}}if(store.tiddlerExists(tag)){store.saveTiddler(tag,_2d);}if(document.getElementById("tiddler"+tag)){var _2f=document.getElementById(story.idPrefix+tag);var _30=story.positionTiddler(_2f);var _31=document.getElementById(story.container);story.closeTiddler(tag,false,false);story.createTiddler(_31,_30,_2d,null);story.saveTiddler(_2d);}if(config.options.chkAutoSave){saveChanges();}return false;};window.onClickTag=function(e){if(!e){var e=window.event;}var _34=resolveTarget(e);var _35=(!isNested(_34));if((Popup.stack.length>1)&&(_35==true)){Popup.removeFrom(1);}else{if(Popup.stack.length>0&&_35==false){Popup.removeFrom(0);}}var _36=(_35==false)?"popup":"nestedtagger";var _37=createTiddlyElement(document.body,"ol",_36,"popup",null);Popup.stack.push({root:this,popup:_37});var tag=this.getAttribute("tag");var _39=this.getAttribute("tiddler");if(_37&&tag){var _3a=store.getTaggedTiddlers(tag);var _3b=[];var li,r;for(r=0;r<_3a.length;r++){if(_3a[r].title!=_39){_3b.push(_3a[r].title);}}var _3d=config.views.wikified.tag;if(_3b.length>0){var _3e=createTiddlyButton(createTiddlyElement(_37,"li"),_3d.openAllText.format([tag]),_3d.openAllTooltip,onClickTagOpenAll);_3e.setAttribute("tag",tag);createTiddlyElement(createTiddlyElement(_37,"li"),"hr");for(r=0;r<_3b.length;r++){createTiddlyLink(createTiddlyElement(_37,"li"),_3b[r],true);}}else{createTiddlyText(createTiddlyElement(_37,"li",null,"disabled"),_3d.popupNone.format([tag]));}createTiddlyElement(createTiddlyElement(_37,"li"),"hr");var h=createTiddlyLink(createTiddlyElement(_37,"li"),tag,false);createTiddlyText(h,_3d.openTag.format([tag]));createTiddlyElement(createTiddlyElement(_37,"li"),"hr");var _40=createTiddlyButton(createTiddlyElement(_37,"li"),("Rename tag '"+tag+"'"),null,lewcidRenameTag);_40.setAttribute("tag",tag);}Popup.show(_37,false);e.cancelBubble=true;if(e.stopPropagation){e.stopPropagation();}return (false);};if(!window.isNested){window.isNested=function(e){while(e!=null){var _42=document.getElementById("contentWrapper");if(_42==e){return true;}e=e.parentNode;}return false;};}config.shadowTiddlers.TaggerPluginDocumentation="The documentation is available [[here.|http://lewcid.googlepages.com/lewcid.html#TaggerPluginDocumentation]]";config.shadowTiddlers.TaggerPluginSource="The uncompressed source code is available [[here.|http://lewcid.googlepages.com/lewcid.html#TaggerPluginSource]]";
// %/
/***
|''Name:''|~TaggerPlugin|
|''Version:''|1.0.1 (2006-06-01)|
|''Source:''|http://lewcid.googlepages.com/lewcid.html/#TaggerPlugin|
|''Author:''|SaqImtiaz|
|''Description:''|Provides a drop down listing current tiddler tags, and allowing toggling of tags.|
|''Documentation:''|[[TaggerPluginDocumentation]]|
|''Source Code:''|[[TaggerPluginSource]]|
|''~TiddlyWiki:''|Version 2.0.8 or better|
***/
//{{{

config.tagger={
 defaults:{
 label: 'Tags: ',
 tooltip: 'Manage tiddler tags',
 taglist: 'true',
 excludeTags: '',
 notags: 'tiddler has no tags',
 aretags: 'current tiddler tags:',
 toggletext: 'add tags:'
 }
};

config.macros.tagger={};
config.macros.tagger.arrow = (document.all?"?":"?"); // the fat one is the only one that works in IE
config.macros.tagger.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
 var defaults = config.tagger.defaults;
 var nAV = paramString.parseParams('tagman', null, true);
 var label = ((nAV[0].label)&&(nAV[0].label[0])!='.')?nAV[0].label[0]+this.arrow: defaults.label+this.arrow;
 var tooltip = ((nAV[0].tooltip)&&(nAV[0].tooltip[0])!='.')?nAV[0].tooltip[0]: defaults.tooltip;
 var taglist = ((nAV[0].taglist)&&(nAV[0].taglist[0])!='.')?nAV[0].taglist[0]: defaults.taglist;
 var exclude = ((nAV[0].exclude)&&(nAV[0].exclude[0])!='.')?(nAV[0].exclude[0]).readBracketedList(): defaults.excludeTags.readBracketedList();
 if ((nAV[0].source)&&(nAV[0].source[0])!='.')var source = nAV[0].source[0];
 if (source&&!store.getTiddler(source)) return false;

 var onclick = function(e) {
 if (!e) var e = window.event;
 var popup = Popup.create(this);
 var tagsarray = store.getTags();
 var tags=new Array();

 for (var i=0; i<tagsarray.length; i++){
 tags.push(tagsarray[i][0]);}

 if (source)
 {var sourcetiddler=store.getTiddler(source);
 tags=sourcetiddler.tags.sort();}

 var currentTags = tiddler.tags.sort();

 var createButtons=function(text,theTag,tooltipPrefix){
 var sp = createTiddlyElement(createTiddlyElement(popup,"li"),"span",null,"tagger");
 var theToggle = createTiddlyButton(sp,text,tooltipPrefix+" '"+theTag+"'",taggerOnToggle,"button","toggleButton");
 theToggle.setAttribute("tiddler",tiddler.title);
 theToggle.setAttribute("tag",theTag);
 insertSpacer(sp);
 if (window.createTagButton_orig_mptw)
 createTagButton_orig_mptw(sp,theTag);
 else
 createTagButton(sp,theTag);
 }

 createTiddlyElement(popup,"li",null,"listTitle",(tiddler.tags.length == 0 ? defaults.notags : defaults.aretags));

 for (var t=0; t<currentTags.length; t++){
 createButtons("[x]",currentTags[t],"remove tag ");
 }

 createTiddlyElement(createTiddlyElement(popup,"li"),"hr");

 if (taglist!='false')
 { createTiddlyElement(popup,"li",null,"listTitle",defaults.toggletext);
 for (var i=0; i<tags.length; i++){
 if (!tiddler.tags.contains(tags[i])&&!exclude.contains(tags[i]))
 {createButtons("[ ]",tags[i],"add tag ");
 }
 }
 createTiddlyElement(createTiddlyElement(popup,"li"),"hr");
 }

 var newTagButton = createTiddlyButton(createTiddlyElement(popup,"li"),("Create new tag"),null,taggerOnToggle);
 newTagButton.setAttribute("tiddler",tiddler.title);
 if (source) newTagButton.setAttribute("source",source);

 Popup.show(popup,false);
 e.cancelBubble = true;
 if (e.stopPropagation) e.stopPropagation();
 return(false);
 };

 createTiddlyButton(place,label,tooltip,onclick,"button","taggerDrpBtn");
};

window.taggerOnToggle = function(e) {
 var tag = this.getAttribute("tag");
 var title = this.getAttribute("tiddler");
 var tiddler = store.getTiddler(title);
 if (!tag)
 {
 var newtag=prompt("Enter new tag:","");
 if (newtag!=''&&newtag!=null)
 {
 var tag=newtag;
 if (this.getAttribute("source"))
 {var sourcetiddler = store.getTiddler(this.getAttribute("source"));
 sourcetiddler.tags.pushUnique(newtag);}
 }
 else
 {return false;};
 }
 if (!tiddler || !tiddler.tags)
 {store.saveTiddler(title,title,'',config.options.txtUserName,new Date(),tag);}
 else
 {if (tiddler.tags.find(tag)==null)
 {tiddler.tags.push(tag)}
 else if(!newtag)
 {tiddler.tags.splice(tiddler.tags.find(tag),1)};
 store.saveTiddler(tiddler.title,tiddler.title,tiddler.text,tiddler.modifier,tiddler.modified,tiddler.tags);};
 story.refreshTiddler(title,null,true);
 if(config.options.chkAutoSave)
 saveChanges();
 return false;
};

setStylesheet(
 ".tagger a.button {font-weight: bold;display:inline; padding:0px;}\n"+
 ".tagger #toggleButton {padding-left:2px; padding-right:2px; margin-right:1px; font-size:110%;}\n"+
 "#nestedtagger {background:#2E5ADF; border: 1px solid #0331BF;}\n"+
 ".popup .listTitle {color:#000;}\n"+
 "",
"TaggerStyles");

window.lewcidTiddlerSwapTag = function (tiddler, oldTag, newTag){
 for (var i = 0; i < tiddler.tags.length; i++)
 if (tiddler.tags[i] == oldTag) {
 tiddler.tags[i] = newTag;
 return true;}
 return false;
}

window.lewcidRenameTag = function(e) {
 var tag=this.getAttribute("tag");
 var newtag=prompt("Rename tag '"+tag+"' to:",tag);

 if ((newtag==tag)||(newtag==null)) {return false;}

 if(store.tiddlerExists(newtag))
 {if(confirm(config.messages.overwriteWarning.format([newtag.toString()])))
 story.closeTiddler(newtag,false,false);
 else
 return null;}

 tagged=store.getTaggedTiddlers(tag);
 if (tagged.length!=0){
 for (var j = 0; j < tagged.length; j++)
 lewcidTiddlerSwapTag(tagged[j],tag,newtag);}

 if (store.tiddlerExists(tag))
 {store.saveTiddler(tag,newtag);}
 if (document.getElementById("tiddler"+tag))
 {var oldTagTiddler = document.getElementById(story.idPrefix + tag);
 var before= story.positionTiddler(oldTagTiddler);
 var place = document.getElementById(story.container);
 story.closeTiddler(tag,false,false);
 story.createTiddler(place,before,newtag,null);
 story.saveTiddler(newtag);}
 if(config.options.chkAutoSave)
 saveChanges();
 return false;
}


window.onClickTag=function(e)
{
 if (!e) var e = window.event;
 var theTarget = resolveTarget(e);

 var nested = (!isNested(theTarget));
 if ((Popup.stack.length > 1)&&(nested==true)) {Popup.removeFrom(1);}
 else if(Popup.stack.length > 0 && nested==false) {Popup.removeFrom(0);};

 var theId = (nested==false)? "popup" : "nestedtagger";
 var popup = createTiddlyElement(document.body,"ol",theId,"popup",null);
 Popup.stack.push({root: this, popup: popup});

 var tag = this.getAttribute("tag");
 var title = this.getAttribute("tiddler");
 if(popup && tag)
 {
 var tagged = store.getTaggedTiddlers(tag);
 var titles = [];
 var li,r;
 for(r=0;r<tagged.length;r++)
 if(tagged[r].title != title)
 titles.push(tagged[r].title);
 var lingo = config.views.wikified.tag;
 if(titles.length > 0)
 {
 var openAll = createTiddlyButton(createTiddlyElement(popup,"li"),lingo.openAllText.format([tag]),lingo.openAllTooltip,onClickTagOpenAll);
 openAll.setAttribute("tag",tag);
 createTiddlyElement(createTiddlyElement(popup,"li"),"hr");
 for(r=0; r<titles.length; r++)
 {
 createTiddlyLink(createTiddlyElement(popup,"li"),titles[r],true);
 }
 }
 else
 createTiddlyText(createTiddlyElement(popup,"li",null,"disabled"),lingo.popupNone.format([tag]));
 createTiddlyElement(createTiddlyElement(popup,"li"),"hr");
 var h = createTiddlyLink(createTiddlyElement(popup,"li"),tag,false);
 createTiddlyText(h,lingo.openTag.format([tag]));

 createTiddlyElement(createTiddlyElement(popup,"li"),"hr");

 var renameTagButton = createTiddlyButton(createTiddlyElement(popup,"li"),("Rename tag '"+tag+"'"),null,lewcidRenameTag);
 renameTagButton.setAttribute("tag",tag)
 }
 Popup.show(popup,false);
 e.cancelBubble = true;
 if (e.stopPropagation) e.stopPropagation();
 return(false);
}

if (!window.isNested)
 window.isNested = function(e) {
 while (e != null) {
 var contentWrapper = document.getElementById("contentWrapper");
 if (contentWrapper == e) return true;
 e = e.parentNode;
 }
 return false;
 };

config.shadowTiddlers.TaggerPluginDocumentation="The documentation is available [[here.|http://lewcid.googlepages.com/lewcid.html#TaggerPluginDocumentation]]";

config.shadowTiddlers.TaggerPluginSource="The uncompressed source code is available [[here.|http://lewcid.googlepages.com/lewcid.html#TaggerPluginSource]]";
//}}}
/***
| Name:|TagglyTaggingPlugin|
| Description:|tagglyTagging macro is a replacement for the builtin tagging macro in your ViewTemplate|
| Version:|6.1.5|
| Date:|05-Oct-2006|
| Source:|http://mptw.tiddlyspot.com/#TagglyTaggingPlugin|
| Author:|Simon Baird <simon.baird@gmail.com>|
| CoreVersion:|2.1.x|
!Notes
See http://mptw.tiddlyspot.com/#TagglyTagging
***/
//{{{
config.taggly = {

 // for translations
 lingo: {
 labels: {
 asc: "\u2191", // down arrow
 desc: "\u2193", // up arrow
 title: "title",
 modified: "modified",
 created: "created",
 show: "+",
 hide: "-",
 normal: "normal",
 group: "group",
 commas: "commas",
 sitemap: "sitemap",
 numCols: "cols\u00b1", // plus minus sign
 label: "Tagged as '%0':"
 },

 tooltips: {
 title: "Click to sort by title",
 modified: "Click to sort by modified date",
 created: "Click to sort by created date",
 show: "Click to show tagging list",
 hide: "Click to hide tagging list",
 normal: "Click to show a normal ungrouped list",
 group: "Click to show list grouped by tag",
 sitemap: "Click to show a sitemap style list",
 commas: "Click to show a comma separated list",
 numCols: "Click to change number of columns"
 }
 },

 config: {
 showTaggingCounts: true,
 listOpts: {
 // the first one will be the default
 sortBy: ["title","modified","created"],
 sortOrder: ["asc","desc"],
 hideState: ["show","hide"],
 listMode: ["normal","group","sitemap","commas"],
 numCols: ["1","2","3","4","5","6"]
 },
 valuePrefix: "taggly."
 },

 getTagglyOpt: function(title,opt) {
 var val = store.getValue(title,this.config.valuePrefix+opt);
 return val ? val : this.config.listOpts[opt][0];
 },

 setTagglyOpt: function(title,opt,value) {
 if (!store.tiddlerExists(title))
 // create it silently
 store.saveTiddler(title,title,config.views.editor.defaultText.format([title]),config.options.txtUserName,new Date(),null);
 // if value is default then remove it to save space
 return store.setValue(title,
 this.config.valuePrefix+opt,
 value == this.config.listOpts[opt][0] ? null : value);
 },

 getNextValue: function(title,opt) {
 var current = this.getTagglyOpt(title,opt);
 var pos = this.config.listOpts[opt].indexOf(current);
 // a little usability enhancement. actually it doesn't work right for grouped or sitemap
 var limit = (opt == "numCols" ? store.getTaggedTiddlers(title).length : this.config.listOpts[opt].length);
 var newPos = (pos + 1) % limit;
 return this.config.listOpts[opt][newPos];
 },

 toggleTagglyOpt: function(title,opt) {
 var newVal = this.getNextValue(title,opt);
 this.setTagglyOpt(title,opt,newVal);
 }, 

 createListControl: function(place,title,type) {
 var lingo = config.taggly.lingo;
 var label;
 var tooltip;
 var onclick;

 if ((type == "title" || type == "modified" || type == "created")) {
 // "special" controls. a little tricky. derived from sortOrder and sortBy
 label = lingo.labels[type];
 tooltip = lingo.tooltips[type];

 if (this.getTagglyOpt(title,"sortBy") == type) {
 label += lingo.labels[this.getTagglyOpt(title,"sortOrder")];
 onclick = function() {
 config.taggly.toggleTagglyOpt(title,"sortOrder");
 return false;
 }
 }
 else {
 onclick = function() {
 config.taggly.setTagglyOpt(title,"sortBy",type);
 config.taggly.setTagglyOpt(title,"sortOrder",config.taggly.config.listOpts.sortOrder[0]);
 return false;
 }
 }
 }
 else {
 // "regular" controls, nice and simple
 label = lingo.labels[type == "numCols" ? type : this.getNextValue(title,type)];
 tooltip = lingo.tooltips[type == "numCols" ? type : this.getNextValue(title,type)];
 onclick = function() {
 config.taggly.toggleTagglyOpt(title,type);
 return false;
 }
 }

 // hide button because commas don't have columns
 if (!(this.getTagglyOpt(title,"listMode") == "commas" && type == "numCols"))
 createTiddlyButton(place,label,tooltip,onclick,type == "hideState" ? "hidebutton" : "button");
 },

 makeColumns: function(orig,numCols) {
 var listSize = orig.length;
 var colSize = listSize/numCols;
 var remainder = listSize % numCols;

 var upperColsize = colSize;
 var lowerColsize = colSize;

 if (colSize != Math.floor(colSize)) {
 // it's not an exact fit so..
 upperColsize = Math.floor(colSize) + 1;
 lowerColsize = Math.floor(colSize);
 }

 var output = [];
 var c = 0;
 for (var j=0;j<numCols;j++) {
 var singleCol = [];
 var thisSize = j < remainder ? upperColsize : lowerColsize;
 for (var i=0;i<thisSize;i++) 
 singleCol.push(orig[c++]);
 output.push(singleCol);
 }

 return output;
 },

 drawTable: function(place,columns,theClass) {
 var newTable = createTiddlyElement(place,"table",null,theClass);
 var newTbody = createTiddlyElement(newTable,"tbody");
 var newTr = createTiddlyElement(newTbody,"tr");
 for (var j=0;j<columns.length;j++) {
 var colOutput = "";
 for (var i=0;i<columns[j].length;i++) 
 colOutput += columns[j][i];
 var newTd = createTiddlyElement(newTr,"td",null,"tagglyTagging"); // todo should not need this class
 wikify(colOutput,newTd);
 }
 return newTable;
 },

 createTagglyList: function(place,title) {
 switch(this.getTagglyOpt(title,"listMode")) {
 case "group": return this.createTagglyListGrouped(place,title); break;
 case "normal": return this.createTagglyListNormal(place,title,false); break;
 case "commas": return this.createTagglyListNormal(place,title,true); break;
 case "sitemap":return this.createTagglyListSiteMap(place,title); break;
 }
 },

 getTaggingCount: function(title) {
 // thanks to Doug Edmunds
 if (this.config.showTaggingCounts) {
 var tagCount = store.getTaggedTiddlers(title).length;
 if (tagCount > 0)
 return " ("+tagCount+")";
 }
 return "";
 },

 // this is for normal and commas mode
 createTagglyListNormal: function(place,title,useCommas) {

 var list = store.getTaggedTiddlers(title,this.getTagglyOpt(title,"sortBy"));

 if (this.getTagglyOpt(title,"sortOrder") == "desc")
 list = list.reverse();

 var output = [];
 for (var i=0;i<list.length;i++) {
 var countString = this.getTaggingCount(list[i].title);
 if (useCommas)
 output.push((i > 0 ? ", " : "") + "[[" + list[i].title + "]]" + countString);
 else
 output.push("*[[" + list[i].title + "]]" + countString + "\n");
 }

 return this.drawTable(place,
 this.makeColumns(output,useCommas ? 1 : parseInt(this.getTagglyOpt(title,"numCols"))),
 useCommas ? "commas" : "normal");
 },

 // this is for the "grouped" mode
 createTagglyListGrouped: function(place,title) {
 var sortBy = this.getTagglyOpt(title,"sortBy");
 var sortOrder = this.getTagglyOpt(title,"sortOrder");

 var list = store.getTaggedTiddlers(title,sortBy);

 if (sortOrder == "desc")
 list = list.reverse();

 var leftOvers = []
 for (var i=0;i<list.length;i++)
 leftOvers.push(list[i].title);

 var allTagsHolder = {};
 for (var i=0;i<list.length;i++) {
 for (var j=0;j<list[i].tags.length;j++) {

 if (list[i].tags[j] != title) { // not this tiddler

 if (!allTagsHolder[list[i].tags[j]])
 allTagsHolder[list[i].tags[j]] = "";

 allTagsHolder[list[i].tags[j]] += "**[["+list[i].title+"]]"
 + this.getTaggingCount(list[i].title) + "\n";
 leftOvers.setItem(list[i].title,-1); // remove from leftovers. at the end it will contain the leftovers
 }
 }
 }

 var allTags = [];
 for (var t in allTagsHolder)
 allTags.push(t);

 var sortHelper = function(a,b) {
 if (a == b) return 0;
 if (a < b) return -1;
 return 1;
 };

 allTags.sort(function(a,b) {
 var tidA = store.getTiddler(a);
 var tidB = store.getTiddler(b);
 if (sortBy == "title") return sortHelper(a,b);
 else if (!tidA && !tidB) return 0;
 else if (!tidA) return -1;
 else if (!tidB) return +1;
 else return sortHelper(tidA[sortBy],tidB[sortBy]);
 });

 var leftOverOutput = "";
 for (var i=0;i<leftOvers.length;i++)
 leftOverOutput += "*[["+leftOvers[i]+"]]" + this.getTaggingCount(leftOvers[i]) + "\n";

 var output = [];

 if (sortOrder == "desc")
 allTags.reverse();
 else if (leftOverOutput != "")
 // leftovers first...
 output.push(leftOverOutput);

 for (var i=0;i<allTags.length;i++)
 output.push("*[["+allTags[i]+"]]" + this.getTaggingCount(leftOvers[i]) + "\n" + allTagsHolder[allTags[i]]);

 if (sortOrder == "desc" && leftOverOutput != "")
 // leftovers last...
 output.push(leftOverOutput);

 return this.drawTable(place,
 this.makeColumns(output,parseInt(this.getTagglyOpt(title,"numCols"))),
 "grouped");

 },

 // used to build site map
 treeTraverse: function(title,depth,sortBy,sortOrder) {

 var list = store.getTaggedTiddlers(title,sortBy);
 if (sortOrder == "desc")
 list.reverse();

 var indent = "";
 for (var j=0;j<depth;j++)
 indent += "*"

 var childOutput = "";
 for (var i=0;i<list.length;i++)
 if (list[i].title != title)
 childOutput += this.treeTraverse(list[i].title,depth+1,sortBy,sortOrder);

 if (depth == 0)
 return childOutput;
 else
 return indent + "[["+title+"]]" + this.getTaggingCount(title) + "\n"+childOutput;
 },

 // this if for the site map mode
 createTagglyListSiteMap: function(place,title) {
 var output = this.treeTraverse(title,0,this.getTagglyOpt(title,"sortBy"),this.getTagglyOpt(title,"sortOrder"));
 return this.drawTable(place,
 this.makeColumns(output.split(/(?=^\*\[)/m),parseInt(this.getTagglyOpt(title,"numCols"))), // regexp magic
 "sitemap"
 );
 },

 macros: {
 tagglyTagging: {
 handler: function (place,macroName,params,wikifier,paramString,tiddler) {
 var refreshContainer = createTiddlyElement(place,"div");
 // do some refresh magic to make it keep the list fresh - thanks Saq
 refreshContainer.setAttribute("refresh","macro");
 refreshContainer.setAttribute("macroName",macroName);
 refreshContainer.setAttribute("title",tiddler.title);
 this.refresh(refreshContainer);
 },

 refresh: function(place) {
 var title = place.getAttribute("title");
 removeChildren(place);
 if (store.getTaggedTiddlers(title).length > 0) {
 var lingo = config.taggly.lingo;
 config.taggly.createListControl(place,title,"hideState");
 if (config.taggly.getTagglyOpt(title,"hideState") == "show") {
 createTiddlyElement(place,"span",null,"tagglyLabel",lingo.labels.label.format([title]));
 config.taggly.createListControl(place,title,"title");
 config.taggly.createListControl(place,title,"modified");
 config.taggly.createListControl(place,title,"created");
 config.taggly.createListControl(place,title,"listMode");
 config.taggly.createListControl(place,title,"numCols");
 config.taggly.createTagglyList(place,title);
 }
 }
 }
 }
 },

 // todo fix these up a bit
 styles: 
"/*{{{*/\n"+
"/* created by TagglyTaggingPlugin */\n"+
".tagglyTagging { padding-top:0.5em; }\n"+
".tagglyTagging li.listTitle { display:none; }\n"+
".tagglyTagging ul {\n"+
" margin-top:0px; padding-top:0.5em; padding-left:2em;\n"+
" margin-bottom:0px; padding-bottom:0px;\n"+
"}\n"+
".tagglyTagging { vertical-align: top; margin:0px; padding:0px; }\n"+
".tagglyTagging table { margin:0px; padding:0px; }\n"+
".tagglyTagging .button { display:none; margin-left:3px; margin-right:3px; }\n"+
".tagglyTagging .button, .tagglyTagging .hidebutton {\n"+
" color:[[ColorPalette::TertiaryLight]]; font-size:90%;\n"+
" border:0px; padding-left:0.3em;padding-right:0.3em;\n"+
"}\n"+
".tagglyTagging .button:hover, .hidebutton:hover {\n"+
" background:[[ColorPalette::TertiaryPale]]; color:[[ColorPalette::TertiaryDark]];\n"+
"}\n"+
".selected .tagglyTagging .button {\n"+
" display:inline;\n"+
"}\n"+
".tagglyTagging .hidebutton { color:[[ColorPalette::Background]]; }\n"+
".selected .tagglyTagging .hidebutton { color:[[ColorPalette::TertiaryLight]] }\n"+
".tagglyLabel { color:[[ColorPalette::TertiaryMid]]; font-size:90%; }\n"+
".tagglyTagging ul {padding-top:0px; padding-bottom:0.5em; margin-left:1em; }\n"+
".tagglyTagging ul ul {list-style-type:disc; margin-left:-1em;}\n"+
".tagglyTagging ul ul li {margin-left:0.5em; }\n"+
".editLabel { font-size:90%; padding-top:0.5em; }\n"+
".tagglyTagging .commas { padding-left:1.8em; }\n"+
"/*}}}*/\n"+
 "",

 init: function() {
 merge(config.macros,this.macros);
 config.shadowTiddlers["TagglyTaggingStyles"] = this.styles;
 if (store)
 store.addNotification("TagglyTaggingStyles",refreshStyles);
 else
 config.notifyTiddlers.push({name:"TagglyTaggingStyles", notify: refreshStyles});
 }
};

config.taggly.init();

//}}}

That which was once unknown, is now known.  What was designated as supernatural is now, natural.  Evolution of thought is the increased knowledge acquired to explain the unknown.
<<<
//''...you must give up the way it is to have it the way you want it...''//
<<<

We all talk about change and wanting to change and wanting to have things be different. Most of us are stuck. These few words show you the way....but can you follow them?
/***

|Name|TiddlerWithEditPlugin|
|Created by|SaqImtiaz|
|Location|http://lewcid.googlepages.com/lewcid.html#TiddlerWithEditPlugin|
|Version|0.2|
|Requires|~TW2.x|
!Description:
Adds 'doubleclick to edit source' capabilites to the core {{{<<tiddler>>}}} macro.

!Notes:
*because of the rewrite, only clicking on actual embedded text opens the source tiddler for editing. Clicking on any white space opens the containing tiddler for editing.

!History
*29-04-06, version 0.2, rewritten after input from Udo.
*28-04-06, version 0.1, working.

!Code
***/
//{{{
config.macros.tiddler.onTiddlerMacroDblClick = function(e){
 if (!e) var e = window.event;
 var theTarget = resolveTarget(e);
 var title= this.getAttribute("source");
 if ((version.extensions.PartTiddlerPlugin)&&(title.indexOf("/")!=-1))
 {if (!oldFetchTiddler.call(this, [title]))
 {title=title.slice(0,title.lastIndexOf("/"))}} 
 story.displayTiddler(theTarget,title,2,false,null)
 e.cancelBubble = true;
 if (e.stopPropagation) e.stopPropagation();
 return false;
 }

var oldTiddlerHandler=config.macros.tiddler.handler;
config.macros.tiddler.handler = function(place,macroName,params){
 oldTiddlerHandler.apply(this,arguments);
 place.lastChild.setAttribute("source",params[0]);
 place.lastChild.ondblclick = this.onTiddlerMacroDblClick;
}
//}}}
/***

|Name|ToggleSideBarMacro|
|Created by|SaqImtiaz|
|Location|http://lewcid.googlepages.com/lewcid.html#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: 1em;}\n"+"",
 styleShow : " ",
 arrow1: "�",
 arrow2: "�"
};

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:|ToggleTagMacro|
| Description:|Makes a checkbox which toggles a tag in a tiddler|
| Version:|6.1.2|
| Date:|20-Oct-2006|
| Source:|http://tiddlyspot.com/mptw/#ToggleTagMacro|
| Author:|SimonBaird|
| License:|[[BSD open source license]]|
| CoreVersion:|2.1|
!Usage
{{{<<toggleTag }}}//{{{TagName TiddlerName LabelText}}}//{{{>>}}}
* TagName - the tag to be toggled, default value "checked"
* TiddlerName - the tiddler to toggle the tag in, default value the current tiddler
* LabelText - the text (gets wikified) to put next to the check box, default value is '{{{[[TagName]]}}}' or '{{{[[TagName]] [[TiddlerName]]}}}'
(If a parameter is '.' then the default will be used)

Examples:

|Code|Description|Example|h
|{{{<<toggleTag>>}}}|Toggles the default tag (checked) in this tiddler|<<toggleTag>>|
|{{{<<toggleTag TagName>>}}}|Toggles the TagName tag in this tiddler|<<toggleTag TagName>>|
|{{{<<toggleTag TagName TiddlerName>>}}}|Toggles the TagName tag in the TiddlerName tiddler|<<toggleTag TagName TiddlerName>>|
|{{{<<toggleTag TagName TiddlerName 'click me'>>}}}|Same but with custom label|<<toggleTag TagName TiddlerName 'click me'>>|
|{{{<<toggleTag . . 'click me'>>}}}|dot means use default value|<<toggleTag . . 'click me'>>|
(Note if TiddlerName doesn't exist it will be silently created)

!Known issues
* Doesn't smoothly handle the case where you toggle a tag in a tiddler that is current open for editing. Should it stick the tag in the edit box?

***/
//{{{

merge(config.macros,{

 toggleTag: {

 doRefreshAll: true,
 createIfRequired: true,
 shortLabel: "[[%0]]",
 longLabel: "[[%0]] [[%1]]",

 handler: function(place,macroName,params,wikifier,paramString,tiddler) {
 var tag = (params[0] && params[0] != '.') ? params[0] : "checked";
 var title = (params[1] && params[1] != '.') ? params[1] : tiddler.title;
 var defaultLabel = (title == tiddler.title ? this.shortLabel : this.longLabel);
 var label = (params[2] && params[2] != '.') ? params[2] : defaultLabel;
 var theTiddler = title == tiddler.title ? tiddler : store.getTiddler(title);
 var cb = createTiddlyCheckbox(place, label.format([tag,title]), theTiddler && theTiddler.isTagged(tag), function(e) {
 if (!store.tiddlerExists(title)) {
 if (config.macros.toggleTag.createIfRequired) {
 var content = store.getTiddlerText(title); // just in case it's a shadow
 store.saveTiddler(title,title,content?content:"",config.options.txtUserName,new Date(),null);
 }
 else 
 return false;
 }
 //store.suspendNotifications(); 
 store.setTiddlerTag(title,this.checked,tag);
 //refreshDisplay(); 
 //store.resumeNotifications();
 return true;
 });
 }
 }
});

//}}}

//{{{
//replaces toolbar buttons with icons.
//for each command that you want to use an icon, add a line like the following in a systemConfig tiddler, specifying the icon image location:
//config.commands.jump.imgLoc= "jump.bmp";
//No need to edit the ViewTemplate! If an image location is specified, then the icon will be used for that command!

config.macros.toolbar.createCommand = function(place,commandName,tiddler,theClass)
{
 if(typeof commandName != "string")
 {
 var c = null;
 for(var t in config.commands)
 if(config.commands[t] == commandName)
 c = t;
 commandName = c;
 }
 if((tiddler instanceof Tiddler) && (typeof commandName == "string"))
 {
 var title = tiddler.title;
 var command = config.commands[commandName];
 var ro = tiddler.isReadOnly();
 var shadow = store.isShadowTiddler(title) && !store.tiddlerExists(title);
 var text = ro && command.readOnlyText ? command.readOnlyText : command.text;
 var tooltip = ro && command.readOnlyTooltip ? command.readOnlyTooltip : command.tooltip;
 if((!ro || (ro && !command.hideReadOnly)) && !(shadow && command.hideShadow))
 {
 if(command.imgLoc)
 {
 var img = createTiddlyElement(place,"img",null,"toolbarImg");
 img.src = command.imgLoc;
 img.onclick = this.onClickCommand;
 img.setAttribute("commandName",commandName);
 img.setAttribute("tiddler",title);
 img.title = command.tooltip;
 }
 else
 {
 var btn = createTiddlyButton(null,text,tooltip,this.onClickCommand);
 btn.setAttribute("commandName", commandName);
 btn.setAttribute("tiddler", title);
 if(theClass)
 addClass(btn,theClass);
 place.appendChild(btn);
 }
 }
 }
}

setStylesheet(".toolbarImg {vertical-align: middle; cursor:pointer;}\n","commandIconStyles"); 
//}}}
...if you want to know what the truth is, be prepared to hear it...

...if you don't want to hear the truth, don't ask for it...

Truth is very rarely what we truly want to hear. We want a version of the truth to fit our INDIVIDUAL perspective and desire. It is very rare indeed when that happens.

Those who truly seek out truth for what truth is are prepared for disappointment. I know of only 3 people who truly understand that. Another 2 or so are pragmatists....and that gets close.
/***
Required by Tiddlyspot
***/
//{{{

config.options.chkHttpReadOnly = false; // make it so you can by default see edit controls via http

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

config.tiddlyspotSiteId = 'distortedreality';

// probably will need to redo this for TW 2.2
with (config.shadowTiddlers) {
 SiteUrl = 'http://'+config.tiddlyspotSiteId+'.tiddlyspot.com';
 SideBarOptions = SideBarOptions.replace(/(<<saveChanges>>)/,"$1<<tiddler TspotSidebar>>");
 OptionsPanel = OptionsPanel.replace(/^/,"<<tiddler TspotOptions>>");
 DefaultTiddlers = DefaultTiddlers.replace(/^/,"[[Welcome to Tiddlyspot]] ");
 MainMenu = MainMenu.replace(/^/,"[[Welcome to Tiddlyspot]] ");
}

merge(config.shadowTiddlers,{

'Welcome to Tiddlyspot':[
 "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 Guides|http://tiddlywikiguides.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/]], [[announcements|http://announce.tiddlyspot.com/]], [[blog|http://tiddlyspot.com/blog/]], 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")

});
//}}}
Only in understanding the self, can one begin to understand others.
| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |
| 14/4/2007 18:19:28 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 14/4/2007 18:22:3 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 15/4/2007 15:18:10 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 13:9:22 | BrianG | [[distortedreality.html|file:///C:/Documents%20and%20Settings/briang/Desktop/distortedreality.html]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 13:20:0 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 17/4/2007 21:30:15 | YourName | [[distortedreality.html|file:///home/brian/Desktop/distortedreality.html]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 10:6:5 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 10:8:28 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 10:9:19 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 10:10:10 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 10:21:55 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 10:21:56 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 10:22:11 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 10:22:12 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 10:22:45 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 10:22:50 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 10:23:0 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 10:23:2 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 10:23:15 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 10:23:17 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 10:23:17 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 10:23:17 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 10:26:56 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 18/4/2007 10:27:10 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 18/4/2007 10:27:40 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 10:28:11 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 10:28:13 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 10:28:17 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 10:28:32 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 10:28:33 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 10:28:48 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 18/4/2007 10:35:23 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 10:35:25 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 10:35:36 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 18/4/2007 10:36:19 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 10:52:2 | BrianG | [[distortedreality.html|file:///C:/DOCUME~1/briang/LOCALS~1/Temp/distortedreality.html]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 18/4/2007 10:59:54 | BrianG | [[distortedreality.html|file:///C:/DOCUME~1/briang/LOCALS~1/Temp/distortedreality.html]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 18/4/2007 11:7:14 | BrianG | [[distortedreality.html|file:///C:/DOCUME~1/briang/LOCALS~1/Temp/distortedreality.html#Story]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 18/4/2007 11:9:1 | BrianG | [[distortedreality.html|file:///C:/DOCUME~1/briang/LOCALS~1/Temp/distortedreality.html#Story]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 18/4/2007 12:36:45 | BrianG | [[distortedreality.html|file:///C:/DOCUME~1/briang/LOCALS~1/Temp/distortedreality.html#StyleSheet]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 18/4/2007 13:2:54 | BrianG | [[distortedreality.html|file:///C:/DOCUME~1/briang/LOCALS~1/Temp/distortedreality.html#Story]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 18/4/2007 13:3:38 | BrianG | [[distortedreality.html|file:///C:/DOCUME~1/briang/LOCALS~1/Temp/distortedreality.html#StyleSheet]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 15:55:4 | BrianGant | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 18/4/2007 16:0:2 | BrianGant | [[/|http://distortedreality.tiddlyspot.com/#Story]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 19/4/2007 12:36:33 | BrianGant | [[/|http://distortedreality.tiddlyspot.com/#StyleSheet]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 19/4/2007 12:53:25 | BrianG | [[distortedreality.html|file:///C:/Documents%20and%20Settings/briang/Desktop/distortedreality.html#%5B%5BSite%20Map%5D%5D]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 19/4/2007 12:54:53 | BrianGant | [[index.html|http://distortedreality.tiddlyspot.com/index.html#%5B%5BSite%20Map%5D%5D]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 19/4/2007 12:55:11 | BrianGant | [[index.html|http://distortedreality.tiddlyspot.com/index.html#%5B%5BSite%20Map%5D%5D]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 20/4/2007 18:10:24 | YourName | [[empty.html|file:///home/brian/Desktop/empty.html]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 20/4/2007 18:12:7 | YourName | [[empty.html|file:///home/brian/Desktop/empty.html]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 20/4/2007 22:37:19 | BrianG | [[distortedreality(2).html|file:///home/brian/Desktop/distortedreality(2).html]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 20/4/2007 23:10:21 | BrianG | [[distortedreality(2).html|file:///home/brian/Desktop/distortedreality(2).html]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 20/4/2007 23:21:4 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 20/4/2007 23:55:47 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 21/4/2007 13:29:53 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 21/4/2007 16:30:11 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 21/4/2007 17:2:48 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 21/4/2007 17:21:8 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 21/4/2007 17:21:20 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 22/4/2007 17:14:19 | BrianG | [[/|http://distortedreality.tiddlyspot.com/]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 22/4/2007 17:17:55 | BrianG | [[distortedreality.html|file:///home/brian/Desktop/distortedreality.html]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 22/4/2007 17:29:48 | BrianG | [[distortedreality.html|file:///home/brian/Desktop/distortedreality.html]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 22/4/2007 17:33:16 | BrianG | [[index.html|http://distortedreality.tiddlyspot.com/index.html#readOnly:no]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 22/4/2007 19:34:47 | BrianG | [[index.html|http://distortedreality.tiddlyspot.com/index.html#readOnly:no]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 7/6/2007 21:51:55 | BrianG | [[empty3.html|file:///home/brian/Desktop/empty3.html]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 8/12/2007 10:5:53 | BrianG | [[distortedreality.tiddlyspot.com.htm|file:///C:/Documents%20and%20Settings/Brian/Desktop/distortedreality.tiddlyspot.com.htm]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 8/12/2007 10:10:21 | BrianG | [[empty.html|file:///C:/Documents%20and%20Settings/Brian/Desktop/empty.html]] | [[store.cgi|http://distortedreality.tiddlyspot.com/store.cgi]] | . | index.html | . |
/***
|''Name:''|UploadPlugin|
|''Description:''|Save to web a TiddlyWiki|
|''Version:''|3.4.5|
|''Date:''|Oct 15, 2006|
|''Source:''|http://tiddlywiki.bidix.info/#UploadPlugin|
|''Documentation:''|http://tiddlywiki.bidix.info/#UploadDoc|
|''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.0.0|
|''Browser:''|Firefox 1.5; InternetExplorer 6.0; Safari|
|''Include:''|config.lib.file; config.lib.log; config.lib.options; PasswordTweak|
|''Require:''|[[UploadService|http://tiddlywiki.bidix.info/#UploadService]]|
***/
//{{{
version.extensions.UploadPlugin = {
 major: 3, minor: 4, revision: 5, 
 date: new Date(2006,9,15),
 source: 'http://tiddlywiki.bidix.info/#UploadPlugin',
 documentation: 'http://tiddlywiki.bidix.info/#UploadDoc',
 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.0.0',
 browser: 'Firefox 1.5; InternetExplorer 6.0; Safari'
};
//}}}

////+++!![config.lib.file]

//{{{
if (!config.lib) config.lib = {};
if (!config.lib.file) config.lib.file= {
 author: 'BidiX',
 version: {major: 0, minor: 1, revision: 0}, 
 date: new Date(2006,3,9)
};
config.lib.file.dirname = function (filePath) {
 var lastpos;
 if ((lastpos = filePath.lastIndexOf("/")) != -1) {
 return filePath.substring(0, lastpos);
 } else {
 return filePath.substring(0, filePath.lastIndexOf("\\"));
 }
};
config.lib.file.basename = function (filePath) {
 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);
};
window.basename = function() {return "@@deprecated@@";};
//}}}
////===

////+++!![config.lib.log]

//{{{
if (!config.lib) config.lib = {};
if (!config.lib.log) config.lib.log= {
 author: 'BidiX',
 version: {major: 0, minor: 1, revision: 1}, 
 date: new Date(2006,8,19)
};
config.lib.Log = function(tiddlerTitle, logHeader) {
 if (version.major < 2)
 this.tiddler = store.tiddlers[tiddlerTitle];
 else
 this.tiddler = store.getTiddler(tiddlerTitle);
 if (!this.tiddler) {
 this.tiddler = new Tiddler();
 this.tiddler.title = tiddlerTitle;
 this.tiddler.text = "| !date | !user | !location |" + logHeader;
 this.tiddler.created = new Date();
 this.tiddler.modifier = config.options.txtUserName;
 this.tiddler.modified = new Date();
 if (version.major < 2)
 store.tiddlers[tiddlerTitle] = this.tiddler;
 else
 store.addTiddler(this.tiddler);
 }
 return this;
};

config.lib.Log.prototype.newLine = function (line) {
 var now = new Date();
 var newText = "| ";
 newText += now.getDate()+"/"+(now.getMonth()+1)+"/"+now.getFullYear() + " ";
 newText += now.getHours()+":"+now.getMinutes()+":"+now.getSeconds()+" | ";
 newText += config.options.txtUserName + " | ";
 var location = document.location.toString();
 var filename = config.lib.file.basename(location);
 if (!filename) filename = '/';
 newText += "[["+filename+"|"+location + "]] |";
 this.tiddler.text = this.tiddler.text + "\n" + newText;
 this.addToLine(line);
};

config.lib.Log.prototype.addToLine = function (text) {
 this.tiddler.text = this.tiddler.text + text;
 this.tiddler.modifier = config.options.txtUserName;
 this.tiddler.modified = new Date();
 if (version.major < 2)
 store.tiddlers[this.tiddler.tittle] = this.tiddler;
 else {
 store.addTiddler(this.tiddler);
 story.refreshTiddler(this.tiddler.title);
 store.notify(this.tiddler.title, true);
 }
 if (version.major < 2)
 store.notifyAll(); 
};
//}}}
////===

////+++!![config.lib.options]

//{{{
if (!config.lib) config.lib = {};
if (!config.lib.options) config.lib.options = {
 author: 'BidiX',
 version: {major: 0, minor: 1, revision: 0}, 
 date: new Date(2006,3,9)
};

config.lib.options.init = function (name, defaultValue) {
 if (!config.options[name]) {
 config.options[name] = defaultValue;
 saveOptionCookie(name);
 }
};
//}}}
////===

////+++!![PasswordTweak]

//{{{
version.extensions.PasswordTweak = {
 major: 1, minor: 0, revision: 3, date: new Date(2006,8,30),
 type: 'tweak',
 source: 'http://tiddlywiki.bidix.info/#PasswordTweak'
};
//}}}
/***
!!config.macros.option
***/
//{{{
config.macros.option.passwordCheckboxLabel = "Save this password on this computer";
config.macros.option.passwordType = "password"; // password | text

config.macros.option.onChangeOption = function(e)
{
 var opt = this.getAttribute("option");
 var elementType,valueField;
 if(opt) {
 switch(opt.substr(0,3)) {
 case "txt":
 elementType = "input";
 valueField = "value";
 break;
 case "pas":
 elementType = "input";
 valueField = "value";
 break;
 case "chk":
 elementType = "input";
 valueField = "checked";
 break;
 }
 config.options[opt] = this[valueField];
 saveOptionCookie(opt);
 var nodes = document.getElementsByTagName(elementType);
 for(var t=0; t<nodes.length; t++) 
 {
 var optNode = nodes[t].getAttribute("option");
 if (opt == optNode) 
 nodes[t][valueField] = this[valueField];
 }
 }
 return(true);
};

config.macros.option.handler = function(place,macroName,params)
{
 var opt = params[0];
 if(config.options[opt] === undefined) {
 return;}
 var c;
 switch(opt.substr(0,3)) {
 case "txt":
 c = document.createElement("input");
 c.onkeyup = this.onChangeOption;
 c.setAttribute ("option",opt);
 c.className = "txtOptionInput "+opt;
 place.appendChild(c);
 c.value = config.options[opt];
 break;
 case "pas":
 // input password
 c = document.createElement ("input");
 c.setAttribute("type",config.macros.option.passwordType);
 c.onkeyup = this.onChangeOption;
 c.setAttribute("option",opt);
 c.className = "pasOptionInput "+opt;
 place.appendChild(c);
 c.value = config.options[opt];
 // checkbox link with this password "save this password on this computer"
 c = document.createElement("input");
 c.setAttribute("type","checkbox");
 c.onclick = this.onChangeOption;
 c.setAttribute("option","chk"+opt);
 c.className = "chkOptionInput "+opt;
 place.appendChild(c);
 c.checked = config.options["chk"+opt];
 // text savePasswordCheckboxLabel
 place.appendChild(document.createTextNode(config.macros.option.passwordCheckboxLabel));
 break;
 case "chk":
 c = document.createElement("input");
 c.setAttribute("type","checkbox");
 c.onclick = this.onChangeOption;
 c.setAttribute("option",opt);
 c.className = "chkOptionInput "+opt;
 place.appendChild(c);
 c.checked = config.options[opt];
 break;
 }
};
//}}}
/***
!! Option cookie stuff
***/
//{{{
window.loadOptionsCookie_orig_PasswordTweak = window.loadOptionsCookie;
window.loadOptionsCookie = function()
{
 var cookies = document.cookie.split(";");
 for(var c=0; c<cookies.length; c++) {
 var p = cookies[c].indexOf("=");
 if(p != -1) {
 var name = cookies[c].substr(0,p).trim();
 var value = cookies[c].substr(p+1).trim();
 switch(name.substr(0,3)) {
 case "txt":
 config.options[name] = unescape(value);
 break;
 case "pas":
 config.options[name] = unescape(value);
 break;
 case "chk":
 config.options[name] = value == "true";
 break;
 }
 }
 }
};

window.saveOptionCookie_orig_PasswordTweak = window.saveOptionCookie;
window.saveOptionCookie = function(name)
{
 var c = name + "=";
 switch(name.substr(0,3)) {
 case "txt":
 c += escape(config.options[name].toString());
 break;
 case "chk":
 c += config.options[name] ? "true" : "false";
 // is there an option link with this chk ?
 if (config.options[name.substr(3)]) {
 saveOptionCookie(name.substr(3));
 }
 break;
 case "pas":
 if (config.options["chk"+name]) {
 c += escape(config.options[name].toString());
 } else {
 c += "";
 }
 break;
 }
 c += "; expires=Fri, 1 Jan 2038 12:00:00 UTC; path=/";
 document.cookie = c;
};
//}}}
/***
!! Initializations
***/
//{{{
// define config.options.pasPassword
if (!config.options.pasPassword) {
 config.options.pasPassword = 'defaultPassword';
 window.saveOptionCookie('pasPassword');
}
// since loadCookies is first called befor password definition
// we need to reload cookies
window.loadOptionsCookie();
//}}}
////===

////+++!![config.macros.upload]

//{{{
config.macros.upload = {
 accessKey: "U",
 formName: "UploadPlugin",
 contentType: "text/html;charset=UTF-8",
 defaultStoreScript: "store.php"
};

// only this two configs need to be translated
config.macros.upload.messages = {
 aboutToUpload: "About to upload TiddlyWiki to %0",
 backupFileStored: "Previous file backuped in %0",
 crossDomain: "Certainly a cross-domain isue: access to an other site isn't allowed",
 errorDownloading: "Error downloading",
 errorUploadingContent: "Error uploading content",
 fileLocked: "Files is locked: You are not allowed to Upload",
 fileNotFound: "file to upload not found",
 fileNotUploaded: "File %0 NOT uploaded",
 mainFileUploaded: "Main TiddlyWiki file uploaded to %0",
 passwordEmpty: "Unable to upload, your password is empty",
 urlParamMissing: "url param missing",
 rssFileNotUploaded: "RssFile %0 NOT uploaded",
 rssFileUploaded: "Rss File uploaded to %0"
};

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.handler = function(place,macroName,params){
 // parameters initialization
 var storeUrl = params[0];
 var toFilename = params[1];
 var backupDir = params[2];
 var uploadDir = params[3];
 var username = params[4];
 var password; // for security reason no password as macro parameter
 var label;
 if (document.location.toString().substr(0,4) == "http")
 label = this.label.saveLabel;
 else
 label = this.label.uploadLabel;
 var prompt;
 if (storeUrl) {
 prompt = this.label.promptParamMacro.toString().format([this.toDirUrl(storeUrl, uploadDir, username)]);
 }
 else {
 prompt = this.label.promptOption;
 }
 createTiddlyButton(place, label, prompt, 
 function () {
 config.macros.upload.upload(storeUrl, toFilename, uploadDir, backupDir, username, password); 
 return false;}, 
 null, null, this.accessKey);
};
config.macros.upload.UploadLog = function() {
 return new config.lib.Log('UploadLog', " !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |" );
};
config.macros.upload.UploadLog.prototype = config.lib.Log.prototype;
config.macros.upload.UploadLog.prototype.startUpload = function(storeUrl, toFilename, uploadDir, backupDir) {
 var line = " [[" + config.lib.file.basename(storeUrl) + "|" + storeUrl + "]] | ";
 line += uploadDir + " | " + toFilename + " | " + backupDir + " |";
 this.newLine(line);
};
config.macros.upload.UploadLog.prototype.endUpload = function() {
 this.addToLine(" Ok |");
};
config.macros.upload.basename = config.lib.file.basename;
config.macros.upload.dirname = config.lib.file.dirname;
config.macros.upload.toRootUrl = function (storeUrl, username)
{
 return root = (this.dirname(storeUrl)?this.dirname(storeUrl):this.dirname(document.location.toString()));
}
config.macros.upload.toDirUrl = function (storeUrl, uploadDir, username)
{
 var root = this.toRootUrl(storeUrl, username);
 if (uploadDir && uploadDir != '.')
 root = root + '/' + uploadDir;
 return root;
}
config.macros.upload.toFileUrl = function (storeUrl, toFilename, uploadDir, username)
{
 return this.toDirUrl(storeUrl, uploadDir, username) + '/' + toFilename;
}
config.macros.upload.upload = function(storeUrl, toFilename, uploadDir, backupDir, username, password)
{
 // parameters initialization
 storeUrl = (storeUrl ? storeUrl : config.options.txtUploadStoreUrl);
 toFilename = (toFilename ? toFilename : config.options.txtUploadFilename);
 backupDir = (backupDir ? backupDir : config.options.txtUploadBackupDir);
 uploadDir = (uploadDir ? uploadDir : config.options.txtUploadDir);
 username = (username ? username : config.options.txtUploadUserName);
 password = config.options.pasUploadPassword; // for security reason no password as macro parameter
 if (!password || password === '') {
 alert(config.macros.upload.messages.passwordEmpty);
 return;
 }
 if (storeUrl === '') {
 storeUrl = config.macros.upload.defaultStoreScript;
 }
 if (config.lib.file.dirname(storeUrl) === '') {
 storeUrl = config.lib.file.dirname(document.location.toString())+'/'+storeUrl;
 }
 if (toFilename === '') {
 toFilename = config.lib.file.basename(document.location.toString());
 }

 clearMessage();
 // only for forcing the message to display
 if (version.major < 2)
 store.notifyAll();
 if (!storeUrl) {
 alert(config.macros.upload.messages.urlParamMissing);
 return;
 }
 // Check that file is not locked
 if (window.BidiX && BidiX.GroupAuthoring && BidiX.GroupAuthoring.lock) {
 if (BidiX.GroupAuthoring.lock.isLocked() && !BidiX.GroupAuthoring.lock.isMyLock()) {
 alert(config.macros.upload.messages.fileLocked);
 return;
 }
 }
 
 var log = new this.UploadLog();
 log.startUpload(storeUrl, toFilename, uploadDir, backupDir);
 if (document.location.toString().substr(0,5) == "file:") {
 saveChanges();
 }
 var toDir = config.macros.upload.toDirUrl(storeUrl, toFilename, uploadDir, username);
 displayMessage(config.macros.upload.messages.aboutToUpload.format([toDir]), toDir);
 this.uploadChanges(storeUrl, toFilename, uploadDir, backupDir, username, password);
 if(config.options.chkGenerateAnRssFeed) {
 //var rssContent = convertUnicodeToUTF8(generateRss());
 var rssContent = generateRss();
 var rssPath = toFilename.substr(0,toFilename.lastIndexOf(".")) + ".xml";
 this.uploadContent(rssContent, storeUrl, rssPath, uploadDir, '', username, password, 
 function (responseText) {
 if (responseText.substring(0,1) != '0') {
 displayMessage(config.macros.upload.messages.rssFileNotUploaded.format([rssPath]));
 }
 else {
 var toFileUrl = config.macros.upload.toFileUrl(storeUrl, rssPath, uploadDir, username);
 displayMessage(config.macros.upload.messages.rssFileUploaded.format(
 [toFileUrl]), toFileUrl);
 }
 // for debugging store.php uncomment last line
 //DEBUG alert(responseText);
 });
 }
 return;
};

config.macros.upload.uploadChanges = function(storeUrl, toFilename, uploadDir, backupDir, 
 username, password) {
 var original;
 if (document.location.toString().substr(0,4) == "http") {
 original = this.download(storeUrl, toFilename, uploadDir, backupDir, username, password);
 return;
 }
 else {
 // standard way : Local file
 
 original = loadFile(getLocalPath(document.location.toString()));
 if(window.Components) {
 // it's a mozilla browser
 try {
 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 var converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]
 .createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
 converter.charset = "UTF-8";
 original = converter.ConvertToUnicode(original);
 }
 catch(e) {
 }
 }
 }
 //DEBUG alert(original);
 this.uploadChangesFrom(original, storeUrl, toFilename, uploadDir, backupDir, 
 username, password);
};

config.macros.upload.uploadChangesFrom = function(original, storeUrl, toFilename, uploadDir, backupDir, 
 username, password) {
 var startSaveArea = '<div id="' + 'storeArea">'; // Split up into two so that indexOf() of this source doesn't find it
 var endSaveArea = '</d' + 'iv>';
 // Locate the storeArea div's
 var posOpeningDiv = original.indexOf(startSaveArea);
 var posClosingDiv = original.lastIndexOf(endSaveArea);
 if((posOpeningDiv == -1) || (posClosingDiv == -1))
 {
 alert(config.messages.invalidFileError.format([document.location.toString()]));
 return;
 }
 var revised = original.substr(0,posOpeningDiv + startSaveArea.length) + 
 allTiddlersAsHtml() + "\n\t\t" +
 original.substr(posClosingDiv);
 var newSiteTitle;
 if(version.major < 2){
 newSiteTitle = (getElementText("siteTitle") + " - " + getElementText("siteSubtitle")).htmlEncode();
 } else {
 newSiteTitle = (wikifyPlain ("SiteTitle") + " - " + wikifyPlain ("SiteSubtitle")).htmlEncode();
 }

 revised = revised.replaceChunk("<title"+">","</title"+">"," " + newSiteTitle + " ");
 revised = revised.replaceChunk("<!--PRE-HEAD-START--"+">","<!--PRE-HEAD-END--"+">","\n" + store.getTiddlerText("MarkupPreHead","") + "\n");
 revised = revised.replaceChunk("<!--POST-HEAD-START--"+">","<!--POST-HEAD-END--"+">","\n" + store.getTiddlerText("MarkupPostHead","") + "\n");
 revised = revised.replaceChunk("<!--PRE-BODY-START--"+">","<!--PRE-BODY-END--"+">","\n" + store.getTiddlerText("MarkupPreBody","") + "\n");
 revised = revised.replaceChunk("<!--POST-BODY-START--"+">","<!--POST-BODY-END--"+">","\n" + store.getTiddlerText("MarkupPostBody","") + "\n");

 var response = this.uploadContent(revised, storeUrl, toFilename, uploadDir, backupDir, 
 username, password, function (responseText) {
 if (responseText.substring(0,1) != '0') {
 alert(responseText);
 displayMessage(config.macros.upload.messages.fileNotUploaded.format([getLocalPath(document.location.toString())]));
 }
 else {
 if (uploadDir !== '') {
 toFilename = uploadDir + "/" + config.macros.upload.basename(toFilename);
 } else {
 toFilename = config.macros.upload.basename(toFilename);
 }
 var toFileUrl = config.macros.upload.toFileUrl(storeUrl, toFilename, uploadDir, username);
 if (responseText.indexOf("destfile:") > 0) {
 var destfile = responseText.substring(responseText.indexOf("destfile:")+9, 
 responseText.indexOf("\n", responseText.indexOf("destfile:")));
 toFileUrl = config.macros.upload.toRootUrl(storeUrl, username) + '/' + destfile;
 }
 else {
 toFileUrl = config.macros.upload.toFileUrl(storeUrl, toFilename, uploadDir, username);
 }
 displayMessage(config.macros.upload.messages.mainFileUploaded.format(
 [toFileUrl]), toFileUrl);
 if (backupDir && responseText.indexOf("backupfile:") > 0) {
 var backupFile = responseText.substring(responseText.indexOf("backupfile:")+11, 
 responseText.indexOf("\n", responseText.indexOf("backupfile:")));
 toBackupUrl = config.macros.upload.toRootUrl(storeUrl, username) + '/' + backupFile;
 displayMessage(config.macros.upload.messages.backupFileStored.format(
 [toBackupUrl]), toBackupUrl);
 }
 var log = new config.macros.upload.UploadLog();
 log.endUpload();
 store.setDirty(false);
 // erase local lock
 if (window.BidiX && BidiX.GroupAuthoring && BidiX.GroupAuthoring.lock) {
 BidiX.GroupAuthoring.lock.eraseLock();
 // change mtime with new mtime after upload
 var mtime = responseText.substr(responseText.indexOf("mtime:")+6);
 BidiX.GroupAuthoring.lock.mtime = mtime;
 }
 
 
 }
 // for debugging store.php uncomment last line
 //DEBUG alert(responseText);
 }
 );
};

config.macros.upload.uploadContent = function(content, storeUrl, toFilename, uploadDir, backupDir, 
 username, password, callbackFn) {
 var boundary = "---------------------------"+"AaB03x"; 
 var request;
 try {
 request = new XMLHttpRequest();
 } 
 catch (e) { 
 request = new ActiveXObject("Msxml2.XMLHTTP"); 
 }
 if (window.netscape){
 try {
 if (document.location.toString().substr(0,4) != "http") {
 netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');}
 }
 catch (e) {}
 } 
 //DEBUG alert("user["+config.options.txtUploadUserName+"] password[" + config.options.pasUploadPassword + "]");
 // compose headers data
 var sheader = "";
 sheader += "--" + boundary + "\r\nContent-disposition: form-data; name=\"";
 sheader += config.macros.upload.formName +"\"\r\n\r\n";
 sheader += "backupDir="+backupDir
 +";user=" + username 
 +";password=" + password
 +";uploaddir=" + uploadDir;
 // add lock attributes to sheader
 if (window.BidiX && BidiX.GroupAuthoring && BidiX.GroupAuthoring.lock) {
 var l = BidiX.GroupAuthoring.lock.myLock;
 sheader += ";lockuser=" + l.user
 + ";mtime=" + l.mtime
 + ";locktime=" + l.locktime;
 }
 sheader += ";;\r\n"; 
 sheader += "\r\n" + "--" + boundary + "\r\n";
 sheader += "Content-disposition: form-data; name=\"userfile\"; filename=\""+toFilename+"\"\r\n";
 sheader += "Content-Type: " + config.macros.upload.contentType + "\r\n";
 sheader += "Content-Length: " + content.length + "\r\n\r\n";
 // compose trailer data
 var strailer = new String();
 strailer = "\r\n--" + boundary + "--\r\n";
 //strailer = "--" + boundary + "--\r\n";
 var data;
 data = sheader + content + strailer;
 //request.open("POST", storeUrl, true, username, password);
 try {
 request.open("POST", storeUrl, true); 
 }
 catch(e) {
 alert(config.macros.upload.messages.crossDomain + "\nError:" +e);
 exit;
 }
 request.onreadystatechange = function () {
 if (request.readyState == 4) {
 if (request.status == 200)
 callbackFn(request.responseText);
 else
 alert(config.macros.upload.messages.errorUploadingContent + "\nStatus: "+request.status.statusText);
 }
 };
 request.setRequestHeader("Content-Length",data.length);
 request.setRequestHeader("Content-Type","multipart/form-data; boundary="+boundary);
 request.send(data); 
};


config.macros.upload.download = function(uploadUrl, uploadToFilename, uploadDir, uploadBackupDir, 
 username, password) {
 var request;
 try {
 request = new XMLHttpRequest();
 } 
 catch (e) { 
 request = new ActiveXObject("Msxml2.XMLHTTP"); 
 }
 try {
 if (uploadUrl.substr(0,4) == "http") {
 netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
 }
 else {
 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 }
 } catch (e) { }
 //request.open("GET", document.location.toString(), true, username, password);
 try {
 request.open("GET", document.location.toString(), true);
 }
 catch(e) {
 alert(config.macros.upload.messages.crossDomain + "\nError:" +e);
 exit;
 }
 
 request.onreadystatechange = function () {
 if (request.readyState == 4) {
 if(request.status == 200) {
 config.macros.upload.uploadChangesFrom(request.responseText, uploadUrl, 
 uploadToFilename, uploadDir, uploadBackupDir, username, password);
 }
 else
 alert(config.macros.upload.messages.errorDownloading.format(
 [document.location.toString()]) + "\nStatus: "+request.status.statusText);
 }
 };
 request.send(null);
};

//}}}
////===

////+++!![Initializations]

//{{{
config.lib.options.init('txtUploadStoreUrl','store.php');
config.lib.options.init('txtUploadFilename','');
config.lib.options.init('txtUploadDir','');
config.lib.options.init('txtUploadBackupDir','');
config.lib.options.init('txtUploadUserName',config.options.txtUserName);
config.lib.options.init('pasUploadPassword','');
setStylesheet(
 ".pasOptionInput {width: 11em;}\n"+
 ".txtOptionInput.txtUploadStoreUrl {width: 25em;}\n"+
 ".txtOptionInput.txtUploadFilename {width: 25em;}\n"+
 ".txtOptionInput.txtUploadDir {width: 25em;}\n"+
 ".txtOptionInput.txtUploadBackupDir {width: 25em;}\n"+
 "",
 "UploadOptionsStyles");
if (document.location.toString().substr(0,4) == "http") {
 config.options.chkAutoSave = false; 
 saveOptionCookie('chkAutoSave');
}
config.shadowTiddlers.UploadDoc = "[[Full Documentation|http://tiddlywiki.bidix.info/l#UploadDoc ]]\n"; 

//}}}
////===

////+++!![Core Hijacking]

//{{{
config.macros.saveChanges.label_orig_UploadPlugin = config.macros.saveChanges.label;
config.macros.saveChanges.label = config.macros.upload.label.saveToDisk;

config.macros.saveChanges.handler_orig_UploadPlugin = config.macros.saveChanges.handler;

config.macros.saveChanges.handler = function(place)
{
 if ((!readOnly) && (document.location.toString().substr(0,4) != "http"))
 createTiddlyButton(place,this.label,this.prompt,this.onClick,null,null,this.accessKey);
};

//}}}
////===

What was once, can never be again.
What is now, can never be again.
What will be then, can happen only once.

How you choose to be, is always based upon all three.
/***
|''Name:''|WikiBar|
|''Version:''|2.0.0 beta3|
|''Source:''|[[AiddlyWiki|http://aiddlywiki.sourceforge.net]]|
|''Author:''|[[Arphen Lin|mailto:arphenlin@gmail.com]]|
|''Type:''|toolbar macro command extension|
|''Required:''|TiddlyWiki 2.0.0 beta6|
!Description
WikiBar is a toolbar that gives access to most of TiddlyWiki's formatting features with a few clicks. It's a handy tool for people who are not familiar with TiddlyWiki syntax.
Besides, with WikiBar-addons, users can extend the power of WikiBar.
!Support browser
*Firefox 1.5
!Revision history
*v2.0.0 beta3 (2005/12/30)
** remove macros (replaced by TWMacro addon)
** add wikibar command in toolbar automatically
** rename DOIT to HANDLER
** rename TIP to TOOLTIP
*v2.0.0 beta2 (2005/12/21)
** re-design Wikibar addon framework
*v2.0.0 beta1 (2005/12/14)
** Note:
*** WikiBarPlugin is renamed to WikiBar
** New Features:
*** support TiddlyWiki 2.0.0 template mechanism
*** new wikibar data structure
*** new wikibar-addon framework for developers
**** support dynamic popup menu generator
*** support most new macros added in TiddlyWiki 2.0.0
*** multi-level popup menu
*** fix wikibar tab stop
*** remove paletteSelector
** Known Bugs:
*** popup-menu and color-picker can't be closed correctly
*** some macros can't be displayed correctly in previewer
*** text in previewer will be displayed italic
*v1.2.0 (2005/11/21)
**New Features:
***User defined color palettes supported
####Get color palettes from [[ColorZilla Palettes|http://www.iosart.com/firefox/colorzilla/palettes.html]].
####Save the palette file(*.gpl) as a new tiddler and tag it with 'ColorPalettes', then you can use it in WikiBar.
***WikiBar style sheet supported
***Click on document to close current colorPicker, paletteSelector or aboutWikibar
*v1.1.1 (2005/11/03)
**Bugs fixed:
***'Not enough parameters!' message is displayed when the parameter includes '%+number', ex: 'hello%20world!'
*v1.1.0 (2005/11/01)
**Bugs fixed:
***WikiBar overruns (reported by by GeoffS <gslocock@yahoo.co.uk>)
**New features:
***Insert a color code at the cursor. (Thanks to RunningUtes <RunningUtes@gmail.com>)
***Enable gradient macro. (Thanks to RunningUtes <RunningUtes@gmail.com>)
***Insert tiddler comment tags {{{/% ... %/}}}. (new feature supported by TiddlyWiki 1.2.37)
***Insert DateFormatString for {{{<<today>>}}} macro. (new feature supported by TiddlyWiki 1.2.37)
**Enhanced:
***Allow optional parameters in syntax.
**Bugs:
***'Not enough parameters!' message is displayed when the parameter includes '%+number', ex: 'hello%20world!'
*v1.0.0 (2005/10/30)
**Initial release
!Code
***/
//{{{
config.macros.wikibar = {major: 2, minor: 0, revision: 0, beta: 3, date: new Date(2005,12,30)};
config.macros.wikibar.handler = function(place,macroName,params,wikifier,paramString,tiddler){
 if(!(tiddler instanceof Tiddler)) {return;}
 story.setDirty(tiddler.title,true);
 place.id = 'wikibar'+tiddler.title;
 place.className = 'toolbar wikibar';
};
function wikibar_install(){
 config.commands.wikibar = {
 text: 'wikibar',
 tooltip: 'wikibar on/off',
 handler: function(e,src,title) {
 if(!e){ e = window.event; }
 var theButton = resolveTarget(e);
 theButton.id = 'wikibarButton'+title;
 wikibarPopup.remove();
 wikibar_installAddons(theButton, title);
 wikibar_createWikibar(title);
 return(false);
 }
 };
 config.shadowTiddlers['EditTemplate'] = wikibar_addWikibarCommand(config.shadowTiddlers['EditTemplate']);
 var tiddler = store.getTiddler('EditTemplate');
 if(tiddler){
 tiddler.text = wikibar_addWikibarCommand(tiddler.text);
 }
}
function wikibar_installAddons(theButton, title){
 var tiddlers = store.getTaggedTiddlers('wikibarAddons');
 if(!tiddlers) { return; }
 theButton.addons=[];
 for(var i=0; i<tiddlers.length; i++){
 try{
 eval(tiddlers[i].text);
 try{
 wikibar_addonInstall(title);
 wikibar_addonInstall = null;
 theButton.addons.push({ok:true, name:tiddlers[i].title});
 }catch(ex){
 theButton.addons.push({ok:false, name:tiddlers[i].title, error:ex});
 }
 }catch(ex){
 theButton.addons.push({ok:false, name:tiddlers[i].title, error:ex});
 }
 }
}
function wikibar_addWikibarCommand(tiddlerText){
 var div = document.createElement('div');
 div.style.display = 'none';
 div.innerHTML = tiddlerText;
 for(var i=0; i<div.childNodes.length; i++){
 var o=div.childNodes[i];
 if(o.tagName==='DIV'){
 if(o.className=='toolbar'){
 var macroText = o.getAttribute('macro').trim();
 if(macroText.search('wikibar')<=0){
 macroText += ' wikibar';
 o.setAttribute('macro', macroText);
 }
 break;
 }
 }
 }
 return div.innerHTML.replace(/\"/g, "\'");
}
function wikibar_processSyntaxParams(theSyntax, params){
 try{
 var pcr = 'AplWikibarPcr';
 var rx=null;
 var allParams=null;
 if(params){
 if(typeof(params)=='object'){
 for(var i=0; i<params.length; i++){
 if(params[i]){
 params[i] = params[i].replace(new RegExp('%','g'), pcr).trim();
 rx = '(\\[%'+(i+1)+'\\])' + '|' + '(%'+(i+1)+')';
 theSyntax = theSyntax.replace(new RegExp(rx,'g'), params[i] );
 }
 }
 allParams = params.join(' ').trim();
 }else{
 allParams = params.replace(new RegExp('%','g'), pcr).trim();
 rx = /(\[%1{1}\])|(%1{1})/g;
 theSyntax = theSyntax.replace(rx, allParams);
 }
 }
 if(allParams){
 theSyntax = theSyntax.replace(new RegExp('%N{1}','g'), allParams);
 }
 rx=/\[%(([1-9]{1,}[0-9]{0,})|(N{1}))\]/g;
 theSyntax = theSyntax.replace(rx, '');
 rx=/%(([1-9]{1,}[0-9]{0,})|(N{1}))/g;
 if( theSyntax.match(rx) ){
 throw 'Not enough parameters! ' + theSyntax;
 }
 theSyntax=theSyntax.replace(new RegExp(pcr,'g'), '%');
 return theSyntax;
 } catch(ex){
 return null;
 }
}
function wikibar_resolveEditItem(tiddlerWrapper, itemName){
 if(tiddlerWrapper.hasChildNodes()){
 var c=tiddlerWrapper.childNodes;
 for(var i=0; i<c.length; i++){
 var txt=wikibar_resolveEditItem(c[i], itemName);
 if(!txt){
 continue;
 }else{
 return txt;
 }
 }
 }
 return ((tiddlerWrapper.getAttribute && tiddlerWrapper.getAttribute('edit')==itemName)? tiddlerWrapper : null);
}
function wikibar_resolveEditItemValue(tiddlerWrapper, itemName){
 var o = wikibar_resolveEditItem(tiddlerWrapper, itemName);
 return (o? o.value.replace(/\r/mg,'') : null);
}
function wikibar_resolveTiddlerEditorWrapper(obj){
 if(obj.id=='tiddlerDisplay'){return null;}
 if((obj.getAttribute && obj.getAttribute('macro')=='edit text')){return obj;}
 return wikibar_resolveTiddlerEditorWrapper(obj.parentNode);
}
function wikibar_resolveTiddlerEditor(obj){
 if(obj.hasChildNodes()){
 var c = obj.childNodes;
 for(var i=0; i<c.length; i++){
 var o=wikibar_resolveTiddlerEditor(c[i]);
 if(o){ return o;}
 }
 }
 return ((obj.getAttribute && obj.getAttribute('edit')=='text')? obj : null);
}
function wikibar_resolveTargetButton(obj){
 if(obj.id && obj.id.substring(0,7)=='wikibar'){ return null; }
 if(obj.tiddlerTitle){
 return obj;
 }else{
 return wikibar_resolveTargetButton(obj.parentNode);
 }
}
function wikibar_isValidMenuItem(tool){
 if(!tool){ return false; }
 if(tool.TYPE=='MENU' || tool.TYPE=='MAIN_MENU'){
 for(var key in tool){
 if(key.substring(0,8)=='DYNAITEM'){ return true; }
 if(wikibar_isValidMenuItem(tool[key])){ return true; }
 }
 return false;
 }else{
 return (tool.HANDLER? true : false);
 }
}
function wikibar_editFormat(param){
 var editor = param.button.editor;
 var params = param.params;
 clearMessage();
 if(!editor){ return; }
 var repText = wikibar_processSyntaxParams(this.syntax, params);
 if(repText===null){ return; }
 var st = editor.scrollTop;
 var ss = editor.selectionStart;
 var se = editor.selectionEnd;
 var frontText= '';
 var endText = '';
 var fullText = editor.value;
 if(se>ss && ss>=0){
 frontText = fullText.substring(0, ss);
 endText = fullText.substring(se, fullText.length);
 }
 else if(ss===0 && (se===0 || se == fullText.length) ){
 endText = fullText;
 }
 else if(se==ss && ss>0){
 frontText = fullText.substring(0, ss);
 endText = fullText.substring(se, fullText.length);
 }
 if(repText.indexOf('user_text')>=0 && this.hint){
 repText = repText.replace('user_text', this.hint);
 }
 editor.value = frontText + repText + endText;
 editor.selectionStart = ss;
 editor.selectionEnd = ss + repText.length;
 editor.scrollTop = st;
 editor.focus();
}
function wikibar_editFormatByWord(param){
 var editor = param.button.editor;
 var params = param.params;
 clearMessage();
 if(!editor){return;}
 var repText = wikibar_processSyntaxParams(this.syntax, params);
 if(repText===null){ return; }
 var st = editor.scrollTop;
 var ss = editor.selectionStart;
 var se = editor.selectionEnd;
 var frontText= '';
 var selText = '';
 var endText = '';
 var fullText = editor.value;
 if(se>ss && ss>=0){
 frontText = fullText.substring(0, ss);
 selText = fullText.substring(ss,se);
 endText = fullText.substring(se, fullText.length);
 }
 else if(ss===0 && (se===0 || se == fullText.length) ){
 endText = fullText;
 }
 else if(se==ss && ss>0){
 frontText = fullText.substring(0, ss);
 endText = fullText.substring(se, fullText.length);
 if(!( fullText.charAt(ss-1).match(/\W/gi) || fullText.charAt(ss).match(/\W/gi) )){
 var m = frontText.match(/\W/gi);
 if(m){
 ss = frontText.lastIndexOf(m[m.length-1])+1;
 }
 else{
 ss = 0;
 }
 m = endText.match(/\W/gi);
 if(m){
 se += endText.indexOf(m[0]);
 }
 else{
 se = fullText.length;
 }
 frontText = fullText.substring(0, ss);
 endText = fullText.substring(se, fullText.length);
 selText = fullText.substring(ss,se);
 }
 }
 if(selText.length>0){
 repText = repText.replace('user_text', selText);
 }
 if(repText.indexOf('user_text')>=0 && this.hint){
 repText = repText.replace('user_text', this.hint);
 }
 editor.value = frontText + repText + endText;
 editor.selectionStart = ss;
 editor.selectionEnd = ss + repText.length;
 editor.scrollTop = st;
 editor.focus();
}
function wikibar_editFormatByCursor(param){
 var editor = param.button.editor;
 var params = param.params;
 clearMessage();
 if(!editor){ return; }
 var repText = wikibar_processSyntaxParams(this.syntax, params);
 if(repText===null){ return; }
 var st = editor.scrollTop;
 var ss = editor.selectionStart;
 var se = editor.selectionEnd;
 var frontText= '';
 var endText = '';
 var fullText = editor.value;
 if(se>ss && ss>=0){
 frontText = fullText.substring(0, ss);
 endText = fullText.substring(se, fullText.length);
 }
 else if(ss===0 && (se===0 || se == fullText.length) ){
 endText = fullText;
 }
 else if(se==ss && ss>0){
 frontText = fullText.substring(0, ss);
 endText = fullText.substring(se, fullText.length);
 }
 if(repText.indexOf('user_text')>=0 && this.hint){
 repText = repText.replace('user_text', this.hint);
 }
 editor.value = frontText + repText + endText;
 editor.selectionStart = ss;
 editor.selectionEnd = ss + repText.length;
 editor.scrollTop = st;
 editor.focus();
}
function wikibar_editFormatByLine(param){
 var editor = param.button.editor;
 var params = param.params;
 clearMessage();
 if(!editor){ return; }
 var repText = wikibar_processSyntaxParams(this.syntax, params);
 if(repText===null){ return; }
 var st = editor.scrollTop;
 var ss = editor.selectionStart;
 var se = editor.selectionEnd;
 var frontText= '';
 var selText = '';
 var endText = '';
 var fullText = editor.value;
 if(se>ss && ss>=0){
 if(this.byBlock){
 frontText = fullText.substring(0, ss);
 selText = fullText.substring(ss,se);
 endText = fullText.substring(se, fullText.length);
 }
 else{
 se = ss;
 }
 }
 if(ss===0 && (se===0 || se == fullText.length) ){
 var m=fullText.match(/(\n|\r)/g);
 if(m){
 se = fullText.indexOf(m[0]);
 }else{
 se = fullText.length;
 }
 selText = fullText.substring(0, se);
 endText = fullText.substring(se, fullText.length);
 }
 else if(se==ss && ss>0){
 frontText = fullText.substring(0, ss);
 endText = fullText.substring(se, fullText.length);
 m = frontText.match(/(\n|\r)/g);
 if(m){
 ss = frontText.lastIndexOf(m[m.length-1])+1;
 }
 else{
 ss = 0;
 }
 m = endText.match(/(\n|\r)/g);
 if(m){
 se += endText.indexOf(m[0]);
 }
 else{
 se = fullText.length;
 }
 frontText = fullText.substring(0, ss);
 selText = fullText.substring(ss,se);
 endText = fullText.substring(se, fullText.length);
 }
 if(selText.length>0){
 repText = repText.replace('user_text', selText);
 }
 if(repText.indexOf('user_text')>=0 && this.hint){
 repText = repText.replace('user_text', this.hint);
 }
 if(this.byBlock){
 if( (frontText.charAt(frontText.length-1)!='\n') && ss>0 ){
 repText = '\n' + repText;
 }
 if( (endText.charAt(0)!='\n') || se==fullText.length){
 repText += '\n';
 }
 }
 editor.value = frontText + repText + endText;
 editor.selectionStart = ss;
 editor.selectionEnd = ss + repText.length;
 editor.scrollTop = st;
 editor.focus();
}
function wikibar_editFormatByTableCell(param){
 var editor = param.button.editor;
 var params = param.params;
 clearMessage();
 if(!editor){ return; }
 var repText = wikibar_processSyntaxParams(this.syntax, params);
 if(repText===null){ return; }
 var st = editor.scrollTop;
 var ss = editor.selectionStart;
 var se = editor.selectionEnd;
 var frontText= '';
 var selText = '';
 var endText = '';
 var fullText = editor.value;
 if(ss===0 || ss==fullText.length){
 throw 'not valid cell!';
 }
 se=ss;
 frontText = fullText.substring(0, ss);
 endText = fullText.substring(se, fullText.length);
 i=frontText.lastIndexOf('\n');
 j=frontText.lastIndexOf('|');
 if(i>j || j<0){
 throw 'not valid cell!';
 }
 ss = j+1;
 i=endText.indexOf('\n');
 j=endText.indexOf('|');
 if(i<j || j<0){
 throw 'not valid cell!';
 }
 se += j;
 frontText = fullText.substring(0, ss-1);
 selText = fullText.substring(ss,se);
 endText = fullText.substring(se+1, fullText.length);
 if(this.key.substring(0,5)=='align'){
 selText = selText.trim();
 if( selText=='>' || selText=='~' || selText.substring(0,8)=='bgcolor(') {return; }
 }
 if(selText.length>0){
 repText = repText.replace('user_text', selText);
 }
 if(repText.indexOf('user_text')>=0 && this.hint){
 repText = repText.replace('user_text', this.hint);
 }
 editor.value = frontText + repText + endText;
 editor.selectionStart = ss;
 editor.selectionEnd = ss + repText.length - 2;
 editor.scrollTop = st;
 editor.focus();
}
function wikibar_editSelectAll(param){
 var editor = param.button.editor;
 editor.selectionStart = 0;
 editor.selectionEnd = editor.value.length;
 editor.scrollTop = 0;
 editor.focus();
}
function wikibar_doPreview(param){
 var theButton = param.button;
 var editor = param.button.editor;
 var wikibar = theButton.parentNode;
 if(!wikibar) { return; }
 title = theButton.tiddlerTitle;
 var editorWrapper = wikibar_resolveTiddlerEditorWrapper(editor);
 var tiddlerWrapper = editorWrapper.parentNode;
 var previewer = document.getElementById('previewer'+title);
 if(previewer){
 previewer.parentNode.removeChild(previewer);
 editorWrapper.style.display = 'block';
 visible=true;
 }else{
 previewer = document.createElement('div');
 previewer.id = 'previewer'+title;
 previewer.className = 'viewer previewer';
 previewer.style.height = (editor.offsetHeight) + 'px';
 wikify(editor.value, previewer);
 tiddlerWrapper.insertBefore(previewer, editorWrapper);
 editorWrapper.style.display = 'none';
 visible=false;
 }
 var pv=null;
 for(var i=0; i<wikibar.childNodes.length; i++){
 try{
 var btn = wikibar.childNodes[i];
 if(btn.toolItem.key == 'preview'){ pv=btn; }
 if(btn.toolItem.key != 'preview'){
 btn.style.display = visible ? '': 'none';
 }
 }catch(ex){}
 }
 if(!pv) { return; }
 if(visible){
 pv.innerHTML = '<font face=\"verdana\">&infin;</font>';
 pv.title = 'preview current tiddler';
 }
 else{
 pv.innerHTML = '<font face=\"verdana\">&larr;</font>';
 pv.title = 'back to editor';
 }
}
function wikibar_doListAddons(param){
 clearMessage();
 var title = param.button.tiddlerTitle;
 var wikibarButton = document.getElementById('wikibarButton'+title);
 var ok=0, fail=0;
 for(var i=0; i<wikibarButton.addons.length; i++){
 var addon=wikibarButton.addons[i];
 if(addon.ok){
 displayMessage('[ o ] '+addon.name);
 ok++;
 }
 else{
 displayMessage('[ x ] '+addon.name + ': ' + addon.error);
 fail++;
 }
 }
 displayMessage('---------------------------------');
 displayMessage(ok + ' ok ; ' + fail + ' failed');
}
function wikibar_getColorCode(param){
 var cbOnPickColor = function(colorCode, param){
 param.params = colorCode;
 param.button.toolItem.doMore(param);
 };
 wikibarColorTool.openColorPicker(param.button, cbOnPickColor, param);
}
function wikibar_getLinkUrl(param){
 var url= prompt('Please enter the link target', (this.param? this.param : ''));
 if (url && url.trim().length>0){
 param.params = url;
 this.doMore(param);
 }
}
function wikibar_getTableRowCol(param){
 var rc= prompt('Please enter (rows x cols) of the table', '2 x 3');
 if (!rc || (rc.trim()).length<=0){ return; }
 var arr = rc.toUpperCase().split('X');
 if(arr.length != 2) { return; }
 for(var i=0; i<arr.length; i++){
 if(isNaN(arr[i].trim())) { return; }
 }
 var rows = parseInt(arr[0].trim(), 10);
 var cols = parseInt(arr[1].trim(), 10);
 var txtTable='';
 for(var r=0; r<rows; r++){
 for(var c=0; c<=cols; c++){
 if(c===0){
 txtTable += '|';
 }else{
 txtTable += ' |';
 }
 }
 txtTable += '\n';
 }
 if(txtTable.trim().length>0){
 param.params = txtTable.trim();
 this.doMore(param);
 }
}
function wikibar_getMacroParam(param){
 var p = prompt('Please enter the parameters of macro \"' + this.key + '\":' +
 '\nSyntax: ' + this.syntax +
 '\n\nNote: '+
 '\n%1,%2,... - parameter needed'+
 '\n[%1] - optional parameter'+
 '\n%N - more than one parameter(1~n)'+
 '\n[%N] - any number of parameters(0~n)'+
 '\n\nPS:'+
 '\n1. Parameters should be seperated with space character'+
 '\n2. Use \" to wrap the parameter that includes space character, ex: \"hello world\"'+
 '\n3. Input the word(null) for the optional parameter ignored',
 (this.param? this.param : '') );
 if(!p) { return; }
 p=p.readMacroParams();
 for(var i=0; i<p.length; i++){
 var s=p[i].trim();
 if(s.indexOf(' ')>0){ p[i]="'"+s+"'"; }
 if(s.toLowerCase()=='null'){ p[i]=null; }
 }
 param.params = p;
 this.doMore(param);
}
function wikibar_getMorePalette(unused){
 clearMessage();
 displayMessage('Get more color palettes(*.gpl) from ColorZilla Palettes site', 'http:\/\/www.iosart.com/firefox/colorzilla/palettes.html');
 displayMessage('Save it as a new tiddler with \"ColorPalettes\" tag');
}
function wikibar_createWikibar(title){
 var theWikibar = document.getElementById('wikibar' + title);
 if(theWikibar){
 if(theWikibar.hasChildNodes()){
 theWikibar.style.display = (theWikibar.style.display=='block'? 'none':'block');
 return;
 }
 }
 var tiddlerWrapper = document.getElementById('tiddler'+title);
 var theTextarea = wikibar_resolveTiddlerEditor(tiddlerWrapper);
 if(!theTextarea){
 clearMessage();
 displayMessage('WikiBar only works in tiddler edit mode now');
 return;
 }else{
 if(!theTextarea.id){ theTextarea.id = 'editor'+title; }
 if(!theTextarea.parentNode.id){ theTextarea.parentNode.id='editorWrapper'+title; }
 }
 if(theWikibar){
 theWikibar = document.getElementById('wikibar'+title);
 }else{
 var editorWrapper = wikibar_resolveTiddlerEditorWrapper(theTextarea);
 theWikibar = createTiddlyElement(tiddlerWrapper, 'div', 'wikibar'+title, 'toolbar');
 addClass(theWikibar, 'wikibar');
 var previewer = document.getElementById('previewer'+title);
 if(previewer){
 tiddlerWrapper.insertBefore(theWikibar, previewer);
 }else{
 tiddlerWrapper.insertBefore(theWikibar, editorWrapper);
 }
 }
 wikibar_createMenu(theWikibar,wikibarStore,title,theTextarea);
 if(config.options['chkWikibarSetEditorHeight'] && config.options['txtWikibarEditorRows']){
 theTextarea.rows = config.options['txtWikibarEditorRows'];
 }
 setStylesheet(
 '.wikibar{text-align:left;visibility:visible;margin:2px;padding:1px;}.previewer{overflow:auto;display:block;border:1px solid;}#colorPicker{position:absolute;display:none;z-index:10;margin:0px;padding:0px;}#colorPicker table{margin:0px;padding:0px;border:2px solid #000;border-spacing:0px;border-collapse:collapse;}#colorPicker td{margin:0px;padding:0px;border:1px solid;font-size:11px;text-align:center;cursor:auto;}#colorPicker .header{background-color:#fff;}#colorPicker .button{background-color:#fff;cursor:pointer;cursor:hand;}#colorPicker .button:hover{padding-top:3px;padding-bottom:3px;color:#fff;background-color:#136;}#colorPicker .cell{padding:4px;font-size:7px;cursor:crosshair;}#colorPicker .cell:hover{padding:10px;}.wikibarPopup{position:absolute;z-index:10;border:1px solid #014;color:#014;background-color:#cef;}.wikibarPopup table{margin:0;padding:0;border:0;border-spacing:0;border-collapse:collapse;}.wikibarPopup .button:hover{color:#eee;background-color:#014;}.wikibarPopup .disabled{color:#888;}.wikibarPopup .disabled:hover{color:#888;background-color:#cef;}.wikibarPopup tr .seperator hr{margin:0;padding:0;background-color:#cef;width:100%;border:0;border-top:1px dashed #014;}.wikibarPopup tr .icon{font-family:verdana;font-weight:bolder;}.wikibarPopup tr .marker{font-family:verdana;font-weight:bolder;}.wikibarPopup td{font-size:0.9em;padding:2px;}.wikibarPopup input{border:0;border-bottom:1px solid #014;margin:0;padding:0;font-family:arial;font-size:100%;background-color:#fff;}',
 'WikiBarStyleSheet');
}
function wikibar_createMenu(place,toolset,title,editor){
 if(!wikibar_isValidMenuItem(toolset)){return;}
 if(!(toolset.TYPE=='MAIN_MENU' || toolset.TYPE=='MENU')){ return; }
 for(var key in toolset){
 if(key.substring(0,9)=='SEPERATOR'){
 wikibar_createMenuSeperator(place);
 continue;
 }
 if(key.substring(0,8)=='DYNAITEM'){
 var dynaTools = toolset[key](title,editor);
 if(dynaTools.TYPE && dynaTools.TYPE=='MENU'){
 wikibar_createMenuItem(place,dynaTools,null,editor,title);
 }else{
 dynaTools.TYPE = 'MENU';
 wikibar_createMenu(place, dynaTools, title, editor);
 }
 continue;
 }
 if((toolset[key].TYPE!='MENU' && toolset[key].TYPE!='MAIN_MENU') && !toolset[key].HANDLER){continue;}
 wikibar_createMenuItem(place,toolset,key,editor,title);
 }
}
function wikibar_createMenuItem(place,toolset,key,editor,title){
 if(!key){
 var tool = toolset;
 }else{
 tool = toolset[key];
 tool.key = key;
 }
 if(!wikibar_isValidMenuItem(tool)){return;}
 var toolIsOnMainMenu = (toolset.TYPE=='MAIN_MENU');
 var toolIsMenu = (tool.TYPE=='MENU');
 var theButton;
 if(toolIsOnMainMenu){
 theButton = createTiddlyButton(
 place,
 '',
 (tool.TOOLTIP? tool.TOOLTIP : ''),
 (toolIsMenu? wikibar_onClickMenuItem : wikibar_onClickItem),
 'button');
 theButton.innerHTML = (tool.CAPTION? tool.CAPTION : key);
 theButton.isOnMainMenu = true;
 addClass(theButton, (toolIsMenu? 'menu' : 'item'));
 place.appendChild( document.createTextNode('\n') );
 if(!toolIsMenu){
 if(config.options['chkWikibarPopmenuOnMouseOver']){
 theButton.onmouseover = function(e){ wikibarPopup.remove(); };
 }
 }
 }else{
 theButton=createTiddlyElement(place, 'tr',key,'button');
 theButton.title = (tool.TOOLTIP? tool.TOOLTIP : '');
 theButton.onclick = (toolIsMenu? wikibar_onClickMenuItem : wikibar_onClickItem);
 var tdL = createTiddlyElement(theButton, 'td','','marker');
 var td = createTiddlyElement(theButton, 'td');
 var tdR = createTiddlyElement(theButton, 'td','','marker');
 td.innerHTML = (tool.CAPTION? tool.CAPTION : key);
 if(toolIsMenu){
 tdR.innerHTML='&nbsp;&nbsp;&rsaquo;';
 }
 if(tool.SELECTED){
 tdL.innerHTML = '&radic; ';
 addClass(theButton, 'selected');
 }
 if(tool.DISABLED){
 addClass(theButton, 'disabled');
 }
 }
 theButton.tiddlerTitle = title;
 theButton.toolItem = tool;
 theButton.editor = editor;
 theButton.tabIndex = 999;
 if(toolIsMenu){
 if(config.options['chkWikibarPopmenuOnMouseOver']){
 theButton.onmouseover = wikibar_onClickMenuItem;
 }
 }
}
function wikibar_createMenuSeperator(place){
 if(place.id.substring(0,7)=='wikibar') { return; }
 var onclickSeperator=function(e){
 if(!e){ e = window.event; }
 e.cancelBubble = true;
 if (e.stopPropagation){ e.stopPropagation(); }
 return(false);
 };
 var theButton=createTiddlyElement(place,'tr','','seperator');
 var td = createTiddlyElement(theButton, 'td','','seperator');
 td.colSpan=3;
 theButton.onclick=onclickSeperator;
 td.innerHTML = '<hr>';
}
function wikibar_genWikibarAbout(){
 var toolset={};
 toolset.version = {
 CAPTION: '<center>WikiBar ' +
 config.macros.wikibar.major + '.' +
 config.macros.wikibar.minor + '.' +
 config.macros.wikibar.revision +
 (config.macros.wikibar.beta? ' beta '+config.macros.wikibar.beta : '') +
 '</center>',
 HANDLER: function(){}
 };
 toolset.SEPERATOR = {};
 toolset.author = {
 CAPTION: '<center>Arphen Lin<br>arphenlin@gmail.com</center>',
 TOOLTIP: 'send mail to the author',
 HANDLER: function(){ window.open('mailto:arphenlin@gmail.com'); }
 };
 toolset.website = {
 CAPTION: '<center>aiddlywiki.sourceforge.net</center>',
 TOOLTIP: 'go to the web site of WikiBar',
 HANDLER: function(){ window.open('http:\/\/aiddlywiki.sourceforge.net/'); }
 };
 return toolset;
}
function wikibar_genWikibarOptions(title, editor){
 var toolset={};
 toolset.popOnMouseOver = {
 CAPTION:'popup menu on mouse over',
 SELECTED: config.options['chkWikibarPopmenuOnMouseOver'],
 HANDLER: function(param){
 config.options['chkWikibarPopmenuOnMouseOver'] = !config.options['chkWikibarPopmenuOnMouseOver'];
 saveOptionCookie('chkWikibarPopmenuOnMouseOver');
 var title = param.button.tiddlerTitle;
 var wikibar = document.getElementById('wikibar'+title);
 if(wikibar){ wikibar.parentNode.removeChild(wikibar); }
 wikibar_createWikibar(title);
 }
 };
 toolset.setEditorSize = {
 CAPTION:'set editor height: <input id=\"txtWikibarEditorRows\" type=text size=1 MAXLENGTH=3 value=\"' +
 (config.options['txtWikibarEditorRows']? config.options['txtWikibarEditorRows']:editor.rows) + '\"> ok',
 HANDLER: function(param){
 var input = document.getElementById('txtWikibarEditorRows');
 if(input){
 var rows = parseInt(input.value, 10);
 if(!isNaN(rows)){
 var editor = param.button.editor;
 editor.rows = rows;
 }else{
 rows=config.maxEditRows;
 }
 config.options['txtWikibarEditorRows'] = rows;
 saveOptionCookie('txtWikibarEditorRows');
 config.maxEditRows = rows;
 }
 }
 };
 toolset.setEditorSizeOnLoadingWikibar = {
 CAPTION:'set editor height on loading wikibar',
 SELECTED: config.options['chkWikibarSetEditorHeight'],
 HANDLER: function(param){
 config.options['chkWikibarSetEditorHeight'] = !config.options['chkWikibarSetEditorHeight'];
 saveOptionCookie('chkWikibarSetEditorHeight');
 if(config.options['chkWikibarSetEditorHeight']){
 var rows = config.options['txtWikibarEditorRows'];
 if(!isNaN(rows)){ rows = 15; }
 var editor = param.button.editor;
 editor.rows = rows;
 config.options['txtWikibarEditorRows'] = rows;
 saveOptionCookie('txtWikibarEditorRows');
 }
 }
 };
 toolset.SEPERATOR = {};
 toolset.update = {
 CAPTION: 'check for updates',
 DISABLED: true,
 HANDLER: function(){}
 };
 return toolset;
}
function wikibar_genPaletteSelector(){
 try{
 var cpTiddlers = store.getTaggedTiddlers('ColorPalettes');
 if(!cpTiddlers) { return; }
 var palettes=[];
 palettes.push(wikibarColorTool.defaultPaletteName);
 for(var i=0; i<cpTiddlers.length; i++){
 palettes.push(cpTiddlers[i].title.trim());
 }
 var toolset={};
 for(i=0; i<palettes.length; i++){
 toolset[palettes[i]] = {
 TOOLTIP: palettes[i],
 SELECTED: (palettes[i]==wikibarColorTool.paletteName),
 HANDLER: wikibar_doSelectPalette
 };
 }
 return toolset;
 }catch(ex){ return null; }
}
function wikibar_onClickItem(e){
 if(!e){ e = window.event; }
 var theTarget = resolveTarget(e);
 if(theTarget.tagName=='INPUT'){
 e.cancelBubble = true;
 if (e.stopPropagation){ e.stopPropagation(); }
 return;
 }
 var theButton = wikibar_resolveTargetButton(theTarget);
 if(!theButton){ return(false); }
 var o = theButton.toolItem;
 if(!o) { return; }
 var param = {
 event: e,
 button: theButton
 };
 if(o.HANDLER){ o.HANDLER(param); }
 if(o.DISABLED){
 e.cancelBubble = true;
 if (e.stopPropagation){ e.stopPropagation(); }
 }
 return(false);
}
function wikibar_onClickMenuItem(e){
 if(!e){ e = window.event; }
 var theButton = wikibar_resolveTargetButton(resolveTarget(e));
 if(!theButton){ return(false); }
 e.cancelBubble = true;
 if (e.stopPropagation){ e.stopPropagation(); }
 var title = theButton.tiddlerTitle;
 var editor = theButton.editor;
 var tool = theButton.toolItem;
 if(!tool) { return; }
 var popup = wikibarPopup.create(this);
 if(popup){
 wikibar_createMenu(popup,tool,title,editor);
 if(!popup.hasChildNodes()){
 wikibarPopup.remove();
 }else{
 wikibarPopup.show(popup, false);
 }
 }
 return(false);
}
var wikibarColorTool = {
 defaultPaletteName : 'default',
 defaultColumns : 16,
 defaultPalette : [
 '#FFF','#DDD','#CCC','#BBB','#AAA','#999','#666','#333','#111','#000','#FC0','#F90','#F60','#F30','#C30','#C03',
 '#9C0','#9D0','#9E0','#E90','#D90','#C90','#FC3','#FC6','#F96','#F63','#600','#900','#C00','#F00','#F36','#F03',
 '#CF0','#CF3','#330','#660','#990','#CC0','#FF0','#C93','#C63','#300','#933','#C33','#F33','#C36','#F69','#F06',
 '#9F0','#CF6','#9C3','#663','#993','#CC3','#FF3','#960','#930','#633','#C66','#F66','#903','#C39','#F6C','#F09',
 '#6F0','#9F6','#6C3','#690','#996','#CC6','#FF6','#963','#630','#966','#F99','#F39','#C06','#906','#F3C','#F0C',
 '#3F0','#6F3','#390','#6C0','#9F3','#CC9','#FF9','#C96','#C60','#C99','#F9C','#C69','#936','#603','#C09','#303',
 '#0C0','#3C0','#360','#693','#9C6','#CF9','#FFC','#FC9','#F93','#FCC','#C9C','#969','#939','#909','#636','#606',
 '#060','#3C3','#6C6','#0F0','#3F3','#6F6','#9F9','#CFC','#9CF','#FCF','#F9F','#F6F','#F3F','#F0F','#C6C','#C3C',
 '#030','#363','#090','#393','#696','#9C9','#CFF','#39F','#69C','#CCF','#C9F','#96C','#639','#306','#90C','#C0C',
 '#0F3','#0C3','#063','#396','#6C9','#9FC','#9CC','#06C','#369','#99F','#99C','#93F','#60C','#609','#C3F','#C0F',
 '#0F6','#3F6','#093','#0C6','#3F9','#9FF','#699','#036','#039','#66F','#66C','#669','#309','#93C','#C6F','#90F',
 '#0F9','#6F9','#3C6','#096','#6FF','#6CC','#366','#069','#36C','#33F','#33C','#339','#336','#63C','#96F','#60F',
 '#0FC','#6FC','#3C9','#3FF','#3CC','#399','#033','#39C','#69F','#00F','#00C','#009','#006','#003','#63F','#30F',
 '#0C9','#3FC','#0FF','#0CC','#099','#066','#3CF','#6CF','#09C','#36F','#0CF','#09F','#06F','#03F','#03C','#30C'
 ],
 colorPicker : null,
 pickColorHandler: null,
 userData: null
};
wikibarColorTool.paletteName = wikibarColorTool.defaultPaletteName;
wikibarColorTool.columns = wikibarColorTool.defaultColumns;
wikibarColorTool.palette = wikibarColorTool.defaultPalette;
wikibarColorTool.onPickColor = function(e){
 if (!e){ e = window.event; }
 var theCell = resolveTarget(e);
 if(!theCell){ return(false); }
 color = theCell.bgColor.toLowerCase();
 if(!color) { return; }
 wikibarColorTool.displayColorPicker(false);
 if(wikibarColorTool.pickColorHandler){
 wikibarColorTool.pickColorHandler(color, wikibarColorTool.userData);
 }
 return(false);
};
wikibarColorTool.onMouseOver = function(e){
 if (!e){ e = window.event; }
 var theButton = resolveTarget(e);
 if(!theButton){ return(false); }
 if(!wikibarColorTool) { return; }
 color = theButton.bgColor.toUpperCase();
 if(!color) { return; }
 td=document.getElementById('colorPickerInfo');
 if(!td) { return; }
 td.bgColor = color;
 td.innerHTML = '<span style=\"color:#000;\">'+color+'</span>&nbsp;&nbsp;&nbsp;' +
 '<span style=\"color:#fff;\">'+color+'</span>';
 e.cancelBubble = true;
 if (e.stopPropagation){ e.stopPropagation(); }
 return(false);
};
wikibarColorTool.openColorPicker = function(theTarget, pickColorHandler, userData){
 wikibarColorTool.skipClickDocumentEvent = true;
 wikibarColorTool.pickColorHandler = pickColorHandler;
 wikibarColorTool.userData = userData;
 wikibarColorTool.moveColorPicker(theTarget);
};
wikibarColorTool.convert3to6HexColor = function(c){
 c=c.trim();
 var rx=/^\#(\d|[a-f])(\d|[a-f])(\d|[a-f])$/gi;
 return (rx.test(c)? c.replace(rx, '#$1$1$2$2$3$3') : c);
};
wikibarColorTool.numToHexColor = function (n){
 if(typeof(n)=='number' && (n>=0 && n<=255)) {
 s = n.toString(16).toLowerCase();
 return ((s.length==1)? '0'+s : s);
 }else{
 return null;
 }
};
wikibarColorTool.renderColorPalette = function(){
 if(wikibarColorTool.paletteName==wikibarColorTool.defaultPaletteName){
 wikibarColorTool.palette=wikibarColorTool.defaultPalette;
 wikibarColorTool.columns=wikibarColorTool.defaultColumns;
 return;
 }
 tiddlerText = (store.getTiddlerText(wikibarColorTool.paletteName, '')).trim();
 if(tiddlerText.length<=0) { return; }
 var cpContents = tiddlerText.split('\n');
 var colors=[];
 columns = wikibarColorTool.defaultColumns;
 var tmpArray=null;
 errCount=0;
 for(var i=0; i<cpContents.length; i++){
 cpLine=cpContents[i].trim();
 if( (!cpLine) || (cpLine.length<=0) || (cpLine.charAt(0) == '#') ){ continue; }
 if(cpLine.substring(0,8).toLowerCase()=='columns:'){
 tmpArray = cpLine.split(':');
 try{
 columns = parseInt(tmpArray[1],10);
 }catch(ex){
 columns = wikibarColorTool.defaultColumns;
 }
 }else{
 tmpArray = cpLine.replace('\t', ' ').split(/[ ]{1,}/);
 try{
 color='';
 for(var j=0; j<3; j++){
 c=parseInt(tmpArray[j].trim(), 10);
 if(isNaN(c)){
 break;
 }else{
 c=wikibarColorTool.numToHexColor(c);
 if(!c) {break;}
 color+=c;
 }
 }
 if(color.length==6){
 colors.push('#'+color);
 } else {
 throw 'error';
 }
 }catch(ex){
 }
 }
 }
 if(colors.length>0){
 wikibarColorTool.palette = colors;
 wikibarColorTool.columns = columns;
 }else{
 throw 'renderColorPalette(): No color defined in the palette.';
 }
};
wikibarColorTool.displayColorPicker = function(visible){
 if(wikibarColorTool.colorPicker){
 wikibarColorTool.colorPicker.style.display = (visible? 'block' : 'none');
 }
};
wikibarColorTool.moveColorPicker = function(theTarget){
 if(!wikibarColorTool.colorPicker){
 wikibarColorTool.createColorPicker();
 }
 var cp = wikibarColorTool.colorPicker;
 var rootLeft = findPosX(theTarget);
 var rootTop = findPosY(theTarget);
 var popupLeft = rootLeft;
 var popupTop = rootTop;
 var popupWidth = cp.offsetWidth;
 var winWidth = findWindowWidth();
 if(popupLeft + popupWidth > winWidth){
 popupLeft = winWidth - popupWidth;
 }
 cp.style.left = popupLeft + 'px';
 cp.style.top = popupTop + 'px';
 wikibarColorTool.displayColorPicker(true);
};
wikibarColorTool.createColorPicker = function(unused, palette){
 if(palette){ wikibarColorTool.paletteName=palette; }
 wikibarColorTool.renderColorPalette();
 wikibarColorTool.colorPicker = document.createElement('div');
 wikibarColorTool.colorPicker.id = 'colorPicker';
 document.body.appendChild(wikibarColorTool.colorPicker);
 var theTable = document.createElement('table');
 wikibarColorTool.colorPicker.appendChild(theTable);
 var theTR = document.createElement('tr');
 theTable.appendChild(theTR);
 var theTD = document.createElement('td');
 theTD.className = 'header';
 theTD.colSpan = wikibarColorTool.columns;
 theTD.innerHTML = wikibarColorTool.paletteName;
 theTR.appendChild(theTD);
 for(var i=0; i<wikibarColorTool.palette.length; i++){
 if((i%wikibarColorTool.columns)===0){
 theTR = document.createElement('tr');
 theTable.appendChild(theTR);
 }
 theTD = document.createElement('td');
 theTD.className = 'cell';
 theTD.bgColor = wikibarColorTool.convert3to6HexColor(wikibarColorTool.palette[i]);
 theTD.onclick = wikibarColorTool.onPickColor;
 theTD.onmouseover = wikibarColorTool.onMouseOver;
 theTR.appendChild(theTD);
 }
 rest = wikibarColorTool.palette.length % wikibarColorTool.columns;
 if(rest>0){
 theTD = document.createElement('td');
 theTD.colSpan = wikibarColorTool.columns-rest;
 theTD.bgColor = '#000000';
 theTR.appendChild(theTD);
 }
 theTR = document.createElement('tr');
 theTable.appendChild(theTR);
 theTD = document.createElement('td');
 theTD.colSpan = wikibarColorTool.columns;
 theTD.id = 'colorPickerInfo';
 theTR.appendChild(theTD);
};
wikibarColorTool.onDocumentClick = function(e){
 if (!e){ e = window.event; }
 if(wikibarColorTool.skipClickDocumentEvent) {
 wikibarColorTool.skipClickDocumentEvent = false;
 return true;
 }
 if((!e.eventPhase) || e.eventPhase == Event.BUBBLING_PHASE || e.eventPhase == Event.AT_TARGET){
 wikibarColorTool.displayColorPicker(false);
 }
 return true;
};
function wikibar_doSelectPalette(param){
 clearMessage();
 var theButton = param.button;
 if(!theButton.toolItem.key) { return; }
 var palette = theButton.toolItem.key;
 var oldPaletteName = wikibarColorTool.paletteName;
 if(oldPaletteName != palette){
 try{
 wikibarColorTool.createColorPicker(theButton, palette);
 displayMessage('Palette \"'+palette+'\" ('+ wikibarColorTool.palette.length +' colors) is selected');
 }catch(ex){
 errMsg = ex;
 if(errMsg.substring(0,18)=='renderColorPalette'){
 displayMessage('Invalid palette \"' + palette + '\", please check it out!');
 wikibarColorTool.createColorPicker(theButton, oldPaletteName);
 }
 }
 }
}
var wikibarPopup = {
 skipClickDocumentEvent: false,
 stack: []
};
wikibarPopup.resolveRootPopup = function(o){
 if(o.isOnMainMenu){ return null; }
 if(o.className.substring(0,12)=='wikibarPopup'){ return o;}
 return wikibarPopup.resolveRootPopup(o.parentNode);
};
wikibarPopup.create = function(root){
 for(var i=0; i<wikibarPopup.stack.length; i++){
 var p=wikibarPopup.stack[i];
 if(p.root==root){
 wikibarPopup.removeFrom(i+1);
 return null;
 }
 }
 var rootPopup = wikibarPopup.resolveRootPopup(root);
 if(!rootPopup){
 wikibarPopup.remove();
 }else{
 wikibarPopup.removeFromRootPopup(rootPopup);
 }
 var popup = createTiddlyElement(document.body,'div','wikibarPopup'+root.toolItem.key,'wikibarPopup');
 var pop = createTiddlyElement(popup,'table','','');
 wikibarPopup.stack.push({rootPopup: rootPopup, root: root, popup: popup});
 return pop;
};
wikibarPopup.show = function(unused,slowly){
 var curr = wikibarPopup.stack[wikibarPopup.stack.length-1];
 var overlayWidth = 1;
 var rootLeft, rootTop, rootWidth, rootHeight, popupLeft, popupTop, popupWidth;
 if(curr.rootPopup){
 rootLeft = findPosX(curr.rootPopup);
 rootTop = findPosY(curr.root);
 rootWidth = curr.rootPopup.offsetWidth;
 popupLeft = rootLeft + rootWidth - overlayWidth;
 popupTop = rootTop;
 }else{
 rootLeft = findPosX(curr.root);
 rootTop = findPosY(curr.root);
 rootHeight = curr.root.offsetHeight;
 popupLeft = rootLeft;
 popupTop = rootTop + rootHeight;
 }
 var winWidth = findWindowWidth();
 popupWidth = curr.popup.offsetWidth;
 if(popupLeft + popupWidth > winWidth){
 popupLeft = rootLeft - popupWidth + overlayWidth;
 }
 curr.popup.style.left = popupLeft + 'px';
 curr.popup.style.top = popupTop + 'px';
 curr.popup.style.display = 'block';
 addClass(curr.root, 'highlight');
 if(config.options.chkAnimate){
 anim.startAnimating(new Scroller(curr.popup,slowly));
 }else{
 window.scrollTo(0,ensureVisible(curr.popup));
 }
};
wikibarPopup.remove = function(){
 if(wikibarPopup.stack.length > 0){
 wikibarPopup.removeFrom(0);
 }
};
wikibarPopup.removeFrom = function(from){
 for(var t=wikibarPopup.stack.length-1; t>=from; t--){
 var p = wikibarPopup.stack[t];
 removeClass(p.root,'highlight');
 p.popup.parentNode.removeChild(p.popup);
 }
 wikibarPopup.stack = wikibarPopup.stack.slice(0,from);
};
wikibarPopup.removeFromRootPopup = function(from){
 for(var t=0; t<wikibarPopup.stack.length; t++){
 var p = wikibarPopup.stack[t];
 if(p.rootPopup==from){
 wikibarPopup.removeFrom(t);
 break;
 }
 }
};
wikibarPopup.onDocumentClick = function(e){
 if (!e){ e = window.event; }
 if(wikibarPopup.skipClickDocumentEvent){
 wikibarPopup.skipClickDocumentEvent=false;
 return true;
 }
 if((!e.eventPhase) || e.eventPhase == Event.BUBBLING_PHASE || e.eventPhase == Event.AT_TARGET){
 wikibarPopup.remove();
 }
 return true;
};
var wikibarStore = {
 TYPE: 'MAIN_MENU',
 help:{
 TYPE:'MENU',
 CAPTION: '<font face=\"verdana\">?</font>',
 TOOLTIP: 'about WikiBar',
 options:{
 TYPE:'MENU',
 DYNAITEM: wikibar_genWikibarOptions
 },
 about:{
 TYPE:'MENU',
 DYNAITEM: wikibar_genWikibarAbout
 }
 },
 preview:{
 TOOLTIP: 'preview this tiddler',
 CAPTION: '<font face=\"verdana\">&infin;</font>',
 HANDLER: wikibar_doPreview
 },
 line:{
 TOOLTIP: 'horizontal line',
 CAPTION: '<font face=\"verdana\">&mdash;</font>',
 syntax: '\n----\n',
 HANDLER: wikibar_editFormatByCursor
 },
 crlf:{
 TOOLTIP: 'new line',
 CAPTION: '<font face=\"verdana\">&para;</font>',
 syntax: '\n',
 HANDLER: wikibar_editFormatByCursor
 },
 selectAll:{
 TOOLTIP: 'select all',
 CAPTION: '<font face=\"verdana\">&sect;</font>',
 HANDLER: wikibar_editSelectAll
 },
 deleteSelected:{
 TOOLTIP: 'delete selected',
 CAPTION: '<font face=\"verdana\">&times;</font>',
 syntax: '',
 HANDLER: wikibar_editFormat
 },
 textFormat:{
 TYPE: 'MENU',
 CAPTION: 'text',
 TOOLTIP: 'text formatters',
 ignore:{
 TOOLTIP: 'ignore wiki word',
 CAPTION: 'ignore wikiWord',
 syntax: '~user_text',
 hint: 'wiki_word',
 HANDLER: wikibar_editFormatByWord
 },
 bolder:{
 TOOLTIP: 'bolder text',
 CAPTION: '<strong>bolder</strong>',
 syntax: "''user_text''",
 hint: 'bold_text',
 HANDLER: wikibar_editFormatByWord
 },
 italic:{
 TOOLTIP: 'italic text',
 CAPTION: '<em>italic</em>',
 syntax: '\/\/user_text\/\/',
 hint: 'italic_text',
 HANDLER: wikibar_editFormatByWord
 },
 underline:{
 TOOLTIP: 'underline text',
 CAPTION: '<u>underline</u>',
 syntax: '__user_text__',
 hint: 'underline_text',
 HANDLER: wikibar_editFormatByWord
 },
 strikethrough:{
 TOOLTIP: 'strikethrough text',
 CAPTION: '<strike>strikethrough</strike>',
 syntax: '==user_text==',
 hint: 'strikethrough_text',
 HANDLER: wikibar_editFormatByWord
 },
 superscript:{
 TOOLTIP: 'superscript text',
 CAPTION: 'X<sup>superscript</sup>',
 syntax: '^^user_text^^',
 hint: 'superscript_text',
 HANDLER: wikibar_editFormatByWord
 },
 subscript:{
 TOOLTIP: 'subscript text',
 CAPTION: 'X<sub>subscript</sub>',
 syntax: '~~user_text~~',
 hint: 'subscript_text',
 HANDLER: wikibar_editFormatByWord
 },
 comment:{
 TOOLTIP: 'comment text',
 CAPTION: 'comment text',
 syntax: '/%user_text%/',
 hint: 'comment_text',
 HANDLER: wikibar_editFormatByWord
 },
 monospaced:{
 TOOLTIP: 'monospaced text',
 CAPTION: '<code>monospaced</code>',
 syntax: '{{{user_text}}}',
 hint: 'monospaced_text',
 HANDLER: wikibar_editFormatByWord
 }
 },
 paragraph:{
 TYPE: 'MENU',
 TOOLTIP: 'paragarph formatters',
 list:{
 TYPE: 'MENU',
 TOOLTIP: 'list tools',
 bullet:{
 TOOLTIP: 'bullet point',
 syntax: '*user_text',
 hint: 'bullet_text',
 HANDLER: wikibar_editFormatByLine
 },
 numbered:{
 TOOLTIP: 'numbered list',
 syntax: '#user_text',
 hint: 'numbered_text',
 HANDLER: wikibar_editFormatByLine
 }
 },
 heading:{
 TYPE: 'MENU',
 heading1:{
 CAPTION:'<h1>Heading 1</h1>',
 TOOLTIP: 'Heading 1',
 syntax: '!user_text',
 hint: 'heading_1',
 HANDLER: wikibar_editFormatByLine
 },
 heading2:{
 CAPTION:'<h2>Heading 2<h2>',
 TOOLTIP: 'Heading 2',
 syntax: '!!user_text',
 hint: 'heading_2',
 HANDLER: wikibar_editFormatByLine
 },
 heading3:{
 CAPTION:'<h3>Heading 3</h3>',
 TOOLTIP: 'Heading 3',
 syntax: '!!!user_text',
 hint: 'heading_3',
 HANDLER: wikibar_editFormatByLine
 },
 heading4:{
 CAPTION:'<h4>Heading 4</h4>',
 TOOLTIP: 'Heading 4',
 syntax: '!!!!user_text',
 hint: 'heading_4',
 HANDLER: wikibar_editFormatByLine
 },
 heading5:{
 CAPTION:'<h5>Heading 5</h5>',
 TOOLTIP: 'Heading 5',
 syntax: '!!!!!user_text',
 hint: 'heading_5',
 HANDLER: wikibar_editFormatByLine
 }
 },
 comment:{
 TYPE: 'MENU',
 commentByLine:{
 CAPTION:'comment by line',
 TOOLTIP: 'line comment',
 syntax: '/%user_text%/',
 hint: 'comment_text',
 HANDLER: wikibar_editFormatByLine
 },
 commentByBlock:{
 CAPTION:'comment by block',
 TOOLTIP: 'block comment',
 syntax: '/%\nuser_text\n%/',
 hint: 'comment_text',
 byBlock: true,
 HANDLER: wikibar_editFormatByLine
 }
 },
 monospaced:{
 TYPE: 'MENU',
 monosByLine:{
 CAPTION: 'monospaced by line',
 TOOLTIP: 'line monospaced',
 syntax: '{{{\nuser_text\n}}}',
 hint: 'monospaced_text',
 HANDLER: wikibar_editFormatByLine
 },
 monosByBlock:{
 CAPTION: 'monospaced by block',
 TOOLTIP: 'block monospaced',
 syntax: '{{{\nuser_text\n}}}',
 hint: 'monospaced_text',
 byBlock: true,
 HANDLER: wikibar_editFormatByLine
 }
 },
 quote:{
 TYPE: 'MENU',
 quoteByLine:{
 CAPTION: 'quote by line',
 TOOLTIP: 'line quote',
 syntax: '>user_text',
 hint: 'quote_text',
 HANDLER: wikibar_editFormatByLine
 },
 quoteByBlcok:{
 CAPTION: 'quote by block',
 TOOLTIP: 'block quote',
 syntax: '<<<\nuser_text\n<<<',
 hint: 'quote_text',
 byBlock: true,
 HANDLER: wikibar_editFormatByLine
 }
 },
 plugin:{
 TYPE: 'MENU',
 code:{
 CAPTION: 'code area',
 TOOLTIP: 'block monospaced for plugin',
 syntax: '\n\/\/{{{\nuser_text\n\/\/}}}\n',
 hint: 'monospaced_plugin_code',
 byBlock: true,
 HANDLER: wikibar_editFormatByLine
 },
 commentByLine:{
 CAPTION: 'comment by line',
 TOOLTIP: 'line comment',
 syntax: '\/\/user_text',
 hint: 'plugin_comment',
 HANDLER: wikibar_editFormatByLine
 },
 commentByBlock:{
 CAPTION: 'comment by block',
 TOOLTIP: 'block comment',
 syntax: '\/\***\nuser_text\n***\/',
 hint: 'plugin_comment',
 byBlock: true,
 HANDLER: wikibar_editFormatByLine
 }
 },
 css:{
 TYPE: 'MENU',
 code:{
 CAPTION: 'code area',
 TOOLTIP: 'block monospaced for css',
 syntax: '\n\nuser_text\n\n',
 hint: 'monospaced_css_code',
 byBlock: true,
 HANDLER: wikibar_editFormatByLine
 },
 commentByLine:{
 CAPTION: 'comment by line',
 TOOLTIP: 'line comment',
 syntax: '',
 hint: 'css_comment',
 HANDLER: wikibar_editFormatByLine
 },
 commentByBlock:{
 CAPTION: 'comment by block',
 TOOLTIP: 'block comment',
 syntax: '',
 hint: 'css_comment',
 byBlock: true,
 HANDLER: wikibar_editFormatByLine
 }
 }
 },
 color:{
 TYPE: 'MENU',
 TOOLTIP: 'color tools',
 highlight:{
 CAPTION:'highlight text',
 TOOLTIP: 'highlight text',
 syntax: '@@user_text@@',
 hint: 'highlight_text',
 HANDLER: wikibar_editFormatByWord
 },
 color:{
 CAPTION:'text color',
 TOOLTIP: 'text color',
 hint: 'your_text',
 syntax: '@@color(%1):user_text@@',
 HANDLER: wikibar_getColorCode,
 doMore: wikibar_editFormatByWord
 },
 bgcolor:{
 CAPTION:'background color',
 TOOLTIP: 'background color',
 hint: 'your_text',
 syntax: '@@bgcolor(%1):user_text@@',
 HANDLER: wikibar_getColorCode,
 doMore: wikibar_editFormatByWord
 },
 colorcode:{
 CAPTION:'color code',
 TOOLTIP: 'insert color code',
 syntax: '%1',
 HANDLER: wikibar_getColorCode,
 doMore: wikibar_editFormatByCursor
 },
 'color palette':{
 TYPE:'MENU',
 DYNAITEM: wikibar_genPaletteSelector,
 SEPERATOR:{},
 morePalette:{
 CAPTION:'more palettes',
 TOOLTIP:'get more palettes',
 HANDLER: wikibar_getMorePalette
 }
 }
 },
 link:{
 TYPE: 'MENU',
 TOOLTIP: 'insert link',
 wiki:{
 CAPTION:'wiki link',
 TOOLTIP: 'wiki link',
 syntax: '[[user_text]]',
 hint: 'wiki_word',
 HANDLER: wikibar_editFormatByWord
 },
 pretty:{
 CAPTION: 'pretty link',
 TOOLTIP: 'pretty link',
 syntax: '[[user_text|%1]]',
 hint: 'pretty_word',
 param: 'PrettyLink Target',
 HANDLER: wikibar_getLinkUrl,
 doMore: wikibar_editFormatByWord
 },
 url:{
 TOOLTIP: 'url link',
 syntax: '[[user_text|%1]]',
 hint: 'your_text',
 param: 'http:\/\/...',
 HANDLER: wikibar_getLinkUrl,
 doMore: wikibar_editFormatByWord
 },
 image:{
 TOOLTIP: 'image link',
 syntax: '[img[user_text|%1]]',
 hint: 'alt_text',
 param: 'image/icon.jpg',
 HANDLER: wikibar_getLinkUrl,
 doMore: wikibar_editFormatByWord
 }
 },
 macro:{},
 more:{
 TYPE: 'MENU',
 TOOLTIP: 'more tools',
 table:{
 TYPE: 'MENU',
 TOOLTIP: 'table',
 table:{
 CAPTION:'create table',
 TOOLTIP: 'create a new table',
 syntax: '\n%1\n',
 HANDLER: wikibar_getTableRowCol,
 doMore: wikibar_editFormatByWord
 },
 header:{
 TOOLTIP: 'table header text',
 syntax: '|user_text|c',
 hint: 'table_header',
 HANDLER: wikibar_editFormatByWord
 },
 cell:{
 TOOLTIP: 'create a tabel cell',
 syntax: '|user_text|',
 hint: 'your_text',
 HANDLER: wikibar_editFormatByWord
 },
 columnHeader:{
 CAPTION:'column header',
 TOOLTIP: 'create a column header cell',
 syntax: '|!user_text|',
 hint: 'column_header',
 HANDLER: wikibar_editFormatByWord
 },
 cell:{
 TYPE: 'MENU',
 CAPTION: 'cell options',
 bgcolor:{
 CAPTION: 'background color',
 TOOLTIP: 'cell bgcolor',
 syntax: '|bgcolor(%1):user_text|',
 hint: 'your_text',
 HANDLER: wikibar_getColorCode,
 doMore: wikibar_editFormatByTableCell
 },
 alignLeft:{
 CAPTION: 'align left',
 TOOLTIP: 'left align cell text',
 syntax: '|user_text|',
 hint: 'your_text',
 HANDLER: wikibar_editFormatByTableCell
 },
 alignCenter:{
 CAPTION: 'align center',
 TOOLTIP: 'center align cell text',
 syntax: '| user_text |',
 hint: 'your_text',
 HANDLER: wikibar_editFormatByTableCell
 },
 alignRight:{
 CAPTION: 'align right',
 TOOLTIP: 'right align cell text',
 syntax: '| user_text|',
 hint: 'your_text',
 HANDLER: wikibar_editFormatByTableCell
 }
 }
 },
 html:{
 TYPE: 'MENU',
 html:{
 CAPTION: '<html>',
 TOOLTIP: 'html tag',
 syntax: '<html>\nuser_text\n</html>',
 hint: 'html_content',
 byBlock: true,
 HANDLER: wikibar_editFormatByLine
 }
 }
 },
 addon:{
 TYPE: 'MENU',
 TOOLTIP:'3rd party tools',
 'about addons':{
 TOOLTIP: 'list loaded addons',
 HANDLER: wikibar_doListAddons
 },
 SEPERATOR:{}
 }
};
addEvent(document, 'click', wikibarColorTool.onDocumentClick);
addEvent(document, 'click', wikibarPopup.onDocumentClick);
wikibar_install();
//}}}
There are many words...

...but only one path
/***
|''Name:''|YourSearchPlugin|
|''Version:''|2.0.2 (2006-02-13)|
|''Source:''|http://tiddlywiki.abego-software.de/#YourSearchPlugin|
|''Author:''|UdoBorkowski (ub [at] abego-software [dot] de)|
|''Licence:''|[[BSD open source license]]|
|''TiddlyWiki:''|2.0|
|''Browser:''|Firefox 1.0.4+; Firefox 1.5; InternetExplorer 6.0|
<<tiddler [[YourSearch Introduction]]>>
For more information see [[Help|YourSearch Help]].

!Compatibility
This plugin requires TiddlyWiki 2.0. 
Use http://tiddlywiki.abego-software.de/#YourSearchPlugin-1.0.1 for older TiddlyWiki versions.

!Revision history
* v2.0.2 (2006-02-13)
** Bugfix for Firefox 1.5.0.1 related to the "Show prefix" checkbox. Thanks to Ted Pavlic for reporting and to BramChen for fixing. 
** Internal
*** Make "JSLint" conform
* v2.0.1 (2006-02-05)
** Support "Exact Word Match" (use '=' to prefix word)
** Support default filter settings (when no filter flags are given in search term)
** Rework on the "less than 3 chars search text" feature (thanks to EricShulman)
** Better support SinglePageMode when doing "Open all tiddlers" (thanks to EricShulman)
** Support Firefox 1.5.0.1
** Bug: Fixed a hilite bug in "classic search mode" (thanks to EricShulman)
* v2.0.0 (2006-01-16)
** Add User Interface
* v1.0.1 (2006-01-06)
** Support TiddlyWiki 2.0
* v1.0.0 (2005-12-28)
** initial version
!Code
The code is compressed. 

You can retrieve a readable source code version from http://tiddlywiki.abego-software.de/#YourSearchPlugin-src.
/%
***/
if(!version.extensions.YourSearchPlugin){version.extensions.YourSearchPlugin={major:2,minor:0,revision:2,date:new Date(2006,2,13),type:"plugin",source:"http://tiddlywiki.abego-software.de/#YourSearchPlugin"};var alertAndThrow=function(_1){alert(_1);throw _1;};if(!window.abego){window.abego={};}if(abego.YourSearch){alertAndThrow("abego.YourSearch already defined");}abego.YourSearch={};if(version.major<2){alertAndThrow("YourSearchPlugin requires TiddlyWiki 2.0 or newer.\n\nGet YourSearch 1.0.1 to use YourSearch with older versions of TiddlyWiki.\n\nhttp://tiddlywiki.abego-software.de/#YourSearchPlugin-1.0.1");}var STQ=function(_2,_3,_4,_5){this.queryText=_2;this.caseSensitive=_3;if(_5){this.regExp=new RegExp(_2,_3?"mg":"img");return;}this.terms=[];var re=/\s*(\-)?([#%!=]*)(?:(?:("(?:(?:\\")|[^"])*")|(\S+)))(?:\s+((?:[aA][nN][dD])|(?:[oO][rR]))(?!\S))?/mg;var _7=re.exec(_2);while(_7!=null&&_7.length==6){var _8="-"==_7[1];var _9=_7[2];var _a=_9.indexOf("!")>=0;var _b=_9.indexOf("%")>=0;var _c=_9.indexOf("#")>=0;var _d=_9.indexOf("=")>=0;if(!_a&&!_b&&!_c){_a=config.options.chkSearchInTitle;_b=config.options.chkSearchInText;_c=config.options.chkSearchInTags;if(!_a&&!_b&&!_c){_a=_b=_c=true;}}if(_4){_b=false;_c=false;}var _e;if(_7[3]){try{_e=eval(_7[3]);}catch(ex){}}else{_e=_7[4];}if(!_e){throw "Invalid search expression: %0".format([_2]);}var _f=_7[5]&&_7[5].charAt(0).toLowerCase()=="o";this.terms.push(new STQ.Term(_e,_a,_b,_c,_8,_f,_3,_d));_7=re.exec(_2);}};var me=STQ.prototype;me.getMatchingTiddlers=function(_10){var _11=[];for(var i in _10){var t=_10[i];if((t instanceof Tiddler)&&this.matchesTiddler(t)){_11.push(t);}}return _11;};me.matchesTiddler=function(_14){if(this.regExp){return this.regExp.test(_14.title)||this.regExp.test(_14.text);}var n=this.terms.length;if(n==0){return false;}var _16=this.terms[0].matchesTiddler(_14);for(var i=1;i<this.terms.length;i++){if(this.terms[i-1].orFollows){if(!_16){_16|=this.terms[i].matchesTiddler(_14);}}else{if(_16){_16&=this.terms[i].matchesTiddler(_14);}}}return _16;};me.getOnlyMatchTitleQuery=function(){if(!this.onlyMatchTitleQuery){this.onlyMatchTitleQuery=new STQ(this.queryText,this.caseSensitive,true,this.useRegExp);}return this.onlyMatchTitleQuery;};me.getMarkRegExp=function(){if(this.regExp){return "".search(this.regExp)>=0?null:this.regExp;}var _18={};var n=this.terms.length;for(var i=0;i<this.terms.length;i++){var _1b=this.terms[i];if(!_1b.negate){_18[_1b.text]=true;}}var _1c=[];for(var t in _18){_1c.push("("+t.escapeRegExp()+")");}if(_1c.length==0){return null;}var _1e=_1c.join("|");return new RegExp(_1e,this.caseSensitive?"mg":"img");};me.toString=function(){if(this.regExp){return this.regExp.toString();}var _1f="";for(var i=0;i<this.terms.length;i++){_1f+=this.terms[i].toString();}return _1f;};STQ.Term=function(_21,_22,_23,_24,_25,_26,_27,_28){this.text=_21;this.inTitle=_22;this.inText=_23;this.inTag=_24;this.negate=_25;this.orFollows=_26;this.caseSensitive=_27;this.wordMatch=_28;var _29=_21.escapeRegExp();if(this.wordMatch){_29="\\b"+_29+"\\b";}this.regExp=new RegExp(_29,"m"+(_27?"":"i"));};STQ.Term.prototype.toString=function(){return (this.negate?"-":"")+(this.inTitle?"!":"")+(this.inText?"%":"")+(this.inTag?"#":"")+(this.wordMatch?"=":"")+"\""+this.text+"\""+(this.orFollows?" OR ":" AND ");};STQ.Term.prototype.matchesTiddler=function(_2a){if(!_2a){return false;}if(this.inTitle&&this.regExp.test(_2a.title)){return !this.negate;}if(this.inText&&this.regExp.test(_2a.text)){return !this.negate;}if(this.inTag){var _2b=_2a.tags;if(_2b){for(var i=0;i<_2b.length;i++){if(this.regExp.test(_2b[i])){return !this.negate;}}}}return this.negate;};var stringToInt=function(s,_2e){if(!s){return _2e;}var n=parseInt(s);return (n==NaN)?_2e:n;};var getIntAttribute=function(_30,_31,_32){return stringToInt(_30.getAttribute(_31));};var isDescendantOrSelf=function(_33,e){while(e!=null){if(_33==e){return true;}e=e.parentNode;}return false;};var getMatchCount=function(s,re){var m=s.match(re);return m?m.length:0;};var createEllipsis=function(_38){var e=createTiddlyElement(_38,"span");e.innerHTML="&hellip;";};var isWordChar=function(c){return (c>="a"&&c<="z")||(c>="A"&&c<="Z")||c=="_";};var getWordBounds=function(s,_3c){if(!isWordChar(s[_3c])){return null;}for(var i=_3c-1;i>=0&&isWordChar(s[i]);i--){}var _3e=i+1;var n=s.length;for(i=_3c+1;i<n&&isWordChar(s[i]);i++){}return {start:_3e,end:i};};var removeTextDecoration=function(s){var _41=["''","{{{","}}}","//","<<<","/***","***/"];var _42="";for(var i=0;i<_41.length;i++){if(i!=0){_42+="|";}_42+="("+_41[i].escapeRegExp()+")";}return s.replace(new RegExp(_42,"mg"),"").trim();};var logText="";var lastLogTime=null;var logMessage=function(_44,s){var now=new Date();var _47=lastLogTime?(now-lastLogTime).toString():"";logText+="<tr><td>"+now.convertToYYYYMMDDHHMMSSMMM()+"</td><td align='right'>"+_47+"</td><td>"+_44+"</td><td>"+s.htmlEncode()+"</td></tr>\n";lastLogTime=now;};function writeLog(){var t=" <<JsDoIt 'WriteLog' 'WriteLog' 'javascript:writeLog();story.closeTiddler(\"Log\");story.displayTiddler(null,\"Log\");'>>"+"<html><table><tbody><tr><th>Time</th><th>Delta (ms)</th><th>Kind</th><th>Message</th></tr>\n"+logText+"</tbody></table></html>";store.saveTiddler("Log","Log",t,config.options.txtUserName,new Date(),["System","Log"]);logText="";lastLogTime=null;}var yourSearchResultID="yourSearchResult";var yourSearchResultItemsID="yourSearchResultItems";var maxCharsInTitle=80;var maxCharsInTags=50;var maxCharsInText=250;var maxPagesInNaviBar=10;var itemsPerPageDefault=25;var itemsPerPageWithPreviewDefault=10;var minMatchWithContextSize=40;var maxMovementForWordCorrection=4;var matchInTitleWeight=4;var precisionInTitleWeight=10;var matchInTagsWeight=2;var resultElement;var lastResults;var lastQuery;var lastSearchText;var searchInputField;var searchButton;var firstIndexOnPage=0;var currentTiddler;var indexInPage;var indexInResult;var getItemsPerPage=function(){var n=(config.options.chkPreviewText)?stringToInt(config.options.txtItemsPerPageWithPreview,itemsPerPageWithPreviewDefault):stringToInt(config.options.txtItemsPerPage,itemsPerPageDefault);return (n>0)?n:1;};var standardRankFunction=function(_4a,_4b){var _4c=_4b.getMarkRegExp();if(!_4c){return 1;}var _4d=_4a.title.match(_4c);var _4e=_4d?_4d.length:0;var _4f=getMatchCount(_4a.getTags(),_4c);var _50=_4d?_4d.join("").length:0;var _51=_4a.title.length>0?_50/_4a.title.length:0;var _52=_4e*matchInTitleWeight+_4f*matchInTagsWeight+_51*precisionInTitleWeight+1;return _52;};var findMatches=function(_53,_54,_55,_56,_57,_58){lastSearchText=_54;var _59=_53.reverseLookup("tags",_58,false);var _5a=new STQ(_54,_55,false,_56);lastQuery=_5a;var _5b=_5a.getMatchingTiddlers(_59);var _5c=abego.YourSearch.getRankFunction();for(var i=0;i<_5b.length;i++){var _5e=_5b[i];var _5f=_5c(_5e,_5a);_5e.searchRank=_5f;}if(!_57){_57="title";}var _60=function(a,b){var _63=a.searchRank-b.searchRank;if(_63==0){if(a[_57]==b[_57]){return (0);}else{return (a[_57]<b[_57])?-1:+1;}}else{return (_63>0)?-1:+1;}};_5b.sort(_60);lastResults=_5b;return _5b;};var moveToWordBorder=function(s,_65,_66){var _67;if(_66){_67=getWordBounds(s,_65);}else{if(_65<=0){return _65;}_67=getWordBounds(s,_65-1);}if(!_67){return _65;}if(_66){if(_67.start>=_65-maxMovementForWordCorrection){return _67.start;}if(_67.end<=_65+maxMovementForWordCorrection){return _67.end;}}else{if(_67.end<=_65+maxMovementForWordCorrection){return _67.end;}if(_67.start>=_65-maxMovementForWordCorrection){return _67.start;}}return _65;};var getContextRangeAround=function(s,_69,_6a,_6b,_6c){var _6d=Math.max(Math.floor(_6c/(_6b+1)),minMatchWithContextSize);var _6e=Math.max(_6d-(_6a-_69),0);var _6f=Math.min(Math.floor(_6a+_6e/3),s.length);var _70=Math.max(_6f-_6d,0);_70=moveToWordBorder(s,_70,true);_6f=moveToWordBorder(s,_6f,false);return {start:_70,end:_6f};};var getTextAndMatchArray=function(s,_72){var _73=[];if(_72){var _74=0;var n=s.length;var _76=0;do{_72.lastIndex=_74;var _77=_72.exec(s);if(_77){if(_74<_77.index){var t=s.substring(_74,_77.index);_73.push({text:t});}_73.push({text:_77[0],isMatch:true});_74=_77.index+_77[0].length;}else{_73.push({text:s.substr(_74)});break;}}while(true);}else{_73.push({text:s});}return _73;};var simpleCreateLimitedTextWithMarks=function(_79,s,_7b){if(!lastQuery){return;}var _7c=getTextAndMatchArray(s,lastQuery.getMarkRegExp());var _7d=0;for(var i=0;i<_7c.length&&_7d<_7b;i++){var t=_7c[i];var _80=t.text;if(t.isMatch){createTiddlyElement(_79,"span",null,"marked",_80);}else{var _81=_7b-_7d;if(_81<_80.length){_80=_80.substring(0,_81)+"...";}createTiddlyText(_79,_80);}_7d+=_80.length;}};var addRange=function(_82,_83,_84){var n=_82.length;if(n==0){_82.push({start:_83,end:_84});return;}var i=0;for(;i<n;i++){var _87=_82[i];if(_87.start<=_84&&_83<=_87.end){var r;var _89=i+1;for(;_89<n;_89++){r=_82[_89];if(r.start>_84||_83>_87.end){break;}}var _8a=_83;var _8b=_84;for(var j=i;j<_89;j++){r=_82[j];_8a=Math.min(_8a,r.start);_8b=Math.max(_8b,r.end);}_82.splice(i,_89-i,{start:_8a,end:_8b});return;}if(_87.start>_84){break;}}_82.splice(i,0,{start:_83,end:_84});};var getTotalRangesSize=function(_8d){var _8e=0;for(var i=0;i<_8d.length;i++){var _90=_8d[i];_8e+=_90.end-_90.start;}return _8e;};var writeTextAndMatchRange=function(_91,s,_93,_94,_95){var t;var _97;var pos=0;var i=0;var _9a=0;for(;i<_93.length;i++){t=_93[i];_97=t.text;if(_94<pos+_97.length){_9a=_94-pos;break;}pos+=_97.length;}var _9b=_95-_94;for(;i<_93.length&&_9b>0;i++){t=_93[i];_97=t.text.substr(_9a);_9a=0;if(_97.length>_9b){_97=_97.substr(0,_9b);}if(t.isMatch){createTiddlyElement(_91,"span",null,"marked",_97);}else{createTiddlyText(_91,_97);}_9b-=_97.length;}if(_95<s.length){createEllipsis(_91);}};var getMatchedTextCount=function(_9c){var _9d=0;for(var i=0;i<_9c.length;i++){if(_9c[i].isMatch){_9d++;}}return _9d;};var getMatchedTextWithContextRanges=function(_9f,s,_a1){var _a2=[];var _a3=getMatchedTextCount(_9f);var pos=0;for(var i=0;i<_9f.length;i++){var t=_9f[i];var _a7=t.text;if(t.isMatch){var _a8=getContextRangeAround(s,pos,pos+_a7.length,_a3,_a1);addRange(_a2,_a8.start,_a8.end);}pos+=_a7.length;}return _a2;};var fillUpRanges=function(s,_aa,_ab){var _ac=_ab-getTotalRangesSize(_aa);while(_ac>0){if(_aa.length==0){addRange(_aa,0,moveToWordBorder(s,_ab,false));return;}else{var _ad=_aa[0];var _ae;var _af;if(_ad.start==0){_ae=_ad.end;if(_aa.length>1){_af=_aa[1].start;}else{addRange(_aa,_ae,moveToWordBorder(s,_ae+_ac,false));return;}}else{_ae=0;_af=_ad.start;}var _b0=Math.min(_af,_ae+_ac);addRange(_aa,_ae,_b0);_ac-=(_b0-_ae);}}};var writeRanges=function(_b1,s,_b3,_b4,_b5){if(_b4.length==0){return;}if(_b4[0].start>0){createEllipsis(_b1);}var _b6=_b5;for(var i=0;i<_b4.length&&_b6>0;i++){var _b8=_b4[i];var len=Math.min(_b8.end-_b8.start,_b6);writeTextAndMatchRange(_b1,s,_b3,_b8.start,_b8.start+len);_b6-=len;}};var createLimitedTextWithMarksAndContext=function(_ba,s,_bc){if(!lastQuery){return;}if(s.length<_bc){_bc=s.length;}var _bd=getTextAndMatchArray(s,lastQuery.getMarkRegExp());var _be=getMatchedTextWithContextRanges(_bd,s,_bc);fillUpRanges(s,_be,_bc);writeRanges(_ba,s,_bd,_be,_bc);};var createLimitedTextWithMarks=function(_bf,s,_c1){return createLimitedTextWithMarksAndContext(_bf,s,_c1);};var myStorySearch=function(_c2,_c3,_c4){highlightHack=new RegExp(_c4?_c2:_c2.escapeRegExp(),_c3?"mg":"img");var _c5=findMatches(store,_c2,_c3,_c4,"title","excludeSearch");firstIndexOnPage=0;showResult();highlightHack=null;};var myMacroSearchHandler=function(_c6,_c7,_c8){var _c9="";var _ca=null;var _cb=function(txt){if(config.options.chkUseYourSearch){myStorySearch(txt.value,config.options.chkCaseSensitiveSearch,config.options.chkRegExpSearch);}else{story.search(txt.value,config.options.chkCaseSensitiveSearch,config.options.chkRegExpSearch);}_c9=txt.value;};var _cd=function(e){_cb(searchInputField);return false;};var _cf=function(e){if(!e){var e=window.event;}switch(e.keyCode){case 13:_cb(this);break;case 27:if(isResultOpen()){closeResult();}else{this.value="";clearMessage();}break;}if(String.fromCharCode(e.keyCode)==this.accessKey||e.altKey){reopenResultIfApplicable();}if(this.value.length<3&&_ca){clearTimeout(_ca);}if((this.value.length>2)&&(this.value!=_c9)){if(!config.options.chkUseYourSearch||config.options.chkSearchAsYouType){if(_ca){clearTimeout(_ca);}var txt=this;_ca=setTimeout(function(){_cb(txt);},500);}}if(this.value.length==0){closeResult();}};var _d3=function(e){this.select();reopenResultIfApplicable();};var btn=createTiddlyButton(_c6,this.label,this.prompt,_cd);var txt=createTiddlyElement(_c6,"input",null,null,null);if(_c8[0]){txt.value=_c8[0];}txt.onkeyup=_cf;txt.onfocus=_d3;txt.setAttribute("size",this.sizeTextbox);txt.setAttribute("accessKey",this.accessKey);txt.setAttribute("autocomplete","off");if(config.browser.isSafari){txt.setAttribute("type","search");txt.setAttribute("results","5");}else{txt.setAttribute("type","text");}searchInputField=txt;searchButton=btn;};var isResultOpen=function(){return resultElement!=null&&resultElement.parentNode==document.body;};var closeResult=function(){if(isResultOpen()){document.body.removeChild(resultElement);}};var openAllFoundTiddlers=function(){closeResult();if(lastResults){var _d7=[];for(var i=0;i<lastResults.length;i++){_d7.push(lastResults[i].title);}story.displayTiddlers(null,_d7);}};var refreshResult=function(){if(!resultElement||!searchInputField){return;}var _d9=store.getTiddlerText("YourSearchResultTemplate");if(!_d9){_d9="<b>Tiddler YourSearchResultTemplate not found</b>";}resultElement.innerHTML=_d9;firstIndexOnPage=Math.floor(firstIndexOnPage/getItemsPerPage())*getItemsPerPage();applyHtmlMacros(resultElement,null);refreshElements(resultElement,null);if(lastResults&&lastResults.length>0){var _da=store.getTiddlerText("YourSearchItemTemplate");if(!_da){alertAndThrow("YourSearchItemTemplate not found");}var _db=document.getElementById(yourSearchResultItemsID);if(!_db){_db=createTiddlyElement(resultElement,"div",yourSearchResultItemsID);}var _dc=Math.min(firstIndexOnPage+getItemsPerPage(),lastResults.length);indexInPage=-1;for(var i=firstIndexOnPage;i<_dc;i++){currentTiddler=lastResults[i];indexInPage++;indexInResult=i;var _de=createTiddlyElement(_db,"div",null,"yourSearchItem");_de.innerHTML=_da;applyHtmlMacros(_de,null);refreshElements(_de,null);}}currentTiddler=null;ensureResultIsDisplayedNicely();};var ensureResultIsDisplayedNicely=function(){adjustResultPositionAndSize();scrollVisible();};var scrollVisible=function(){if(resultElement){window.scrollTo(0,ensureVisible(resultElement));}if(searchInputField){window.scrollTo(0,ensureVisible(searchInputField));}};var adjustResultPositionAndSize=function(){if(!searchInputField){return;}var _df=searchInputField;var _e0=findPosX(_df);var _e1=findPosY(_df);var _e2=_df.offsetHeight;var _e3=_e0;var _e4=_e1+_e2;var _e5=findWindowWidth();if(_e5<resultElement.offsetWidth){resultElement.style.width=(_e5-100)+"px";_e5=findWindowWidth();}var _e6=resultElement.offsetWidth;if(_e3+_e6>_e5){_e3=_e5-_e6-30;}if(_e3<0){_e3=0;}resultElement.style.left=_e3+"px";resultElement.style.top=_e4+"px";resultElement.style.display="block";};var showResult=function(){if(!resultElement){resultElement=createTiddlyElement(document.body,"div",yourSearchResultID,"yourSearchResult");}else{if(resultElement.parentNode!=document.body){document.body.appendChild(resultElement);}}refreshResult();};var reopenResultIfApplicable=function(){if(searchInputField==null||!config.options.chkUseYourSearch){return;}if((searchInputField.value==lastSearchText)&&lastSearchText&&!isResultOpen()){if(resultElement&&(resultElement.parentNode!=document.body)){document.body.appendChild(resultElement);ensureResultIsDisplayedNicely();}else{showResult();}}};var setFirstIndexOnPage=function(_e7){if(!lastResults||lastResults.length==0){return;}firstIndexOnPage=Math.min(Math.max(0,_e7),lastResults.length-1);refreshResult();};var onDocumentClick=function(e){if(e.target==searchInputField){return;}if(e.target==searchButton){return;}if(resultElement&&isDescendantOrSelf(resultElement,e.target)){return;}closeResult();};var onDocumentKeyup=function(e){if(e.keyCode==27){closeResult();}};addEvent(document,"click",onDocumentClick);addEvent(document,"keyup",onDocumentKeyup);config.macros.yourSearch={label:"yourSearch",prompt:"Gives access to the current/last YourSearch result",funcs:{},tests:{"true":function(){return true;},"false":function(){return false;},"found":function(){return lastResults&&lastResults.length>0;},"previewText":function(){return config.options.chkPreviewText;}}};config.macros.yourSearch.handler=function(_ea,_eb,_ec,_ed,_ee,_ef){if(_ec.length==0){return;}var _f0=_ec[0];var _f1=config.macros.yourSearch.funcs[_f0];if(_f1){_f1(_ea,_eb,_ec,_ed,_ee,_ef);}};config.macros.yourSearch.funcs.itemRange=function(_f2){if(lastResults){var _f3=Math.min(firstIndexOnPage+getItemsPerPage(),lastResults.length);var s="%0 - %1".format([firstIndexOnPage+1,_f3]);createTiddlyText(_f2,s);}};config.macros.yourSearch.funcs.count=function(_f5){if(lastSearchText){createTiddlyText(_f5,lastResults.length.toString());}};config.macros.yourSearch.funcs.query=function(_f6){if(lastResults){createTiddlyText(_f6,lastSearchText);}};config.macros.yourSearch.funcs.version=function(_f7){var t="YourSearch %0.%1.%2".format([version.extensions.YourSearchPlugin.major,version.extensions.YourSearchPlugin.minor,version.extensions.YourSearchPlugin.revision]);var e=createTiddlyElement(_f7,"a");e.setAttribute("href","http://tiddlywiki.abego-software.de/#YourSearchPlugin");e.innerHTML="<font color=\"black\" face=\"Arial, Helvetica, sans-serif\">"+t+"<font>";};config.macros.yourSearch.funcs.copyright=function(_fa){var e=createTiddlyElement(_fa,"a");e.setAttribute("href","http://tiddlywiki.abego-software.de");e.innerHTML="<font color=\"black\" face=\"Arial, Helvetica, sans-serif\">&copy; 2005-2006 <b><font color=\"red\">abego</font></b> Software<font>";};config.macros.yourSearch.funcs.linkButton=function(_fc,_fd,_fe,_ff,_100,_101){if(_fe<2){return;}var _102=_fe[1];var text=_fe<3?_102:_fe[2];var _104=_fe<4?text:_fe[3];var _105=_fe<5?null:_fe[4];var btn=createTiddlyButton(_fc,text,_104,closeResultAndDisplayTiddler,null,null,_105);btn.setAttribute("tiddlyLink",_102);};config.macros.yourSearch.funcs.closeButton=function(_107,_108,_109,_10a,_10b,_10c){var _10d=createTiddlyButton(_107,"close","Close the Search Results (Shortcut: ESC)",closeResult);};config.macros.yourSearch.funcs.openAllButton=function(_10e,_10f,_110,_111,_112,_113){if(!lastResults){return;}var n=lastResults.length;if(n==0){return;}var _115=n==1?"open tiddler":"open all %0 tiddlers".format([n]);var _116=createTiddlyButton(_10e,_115,"Open all found tiddlers (Shortcut: Alt-O)",openAllFoundTiddlers);_116.setAttribute("accessKey","O");};var onNaviButtonClick=function(e){if(!e){var e=window.event;}var _119=getIntAttribute(this,"page");setFirstIndexOnPage(_119*getItemsPerPage(),0);};config.macros.yourSearch.funcs.naviBar=function(_11a,_11b,_11c,_11d,_11e,_11f){if(!lastResults||lastResults.length==0){return;}var _120;var _121=Math.floor(firstIndexOnPage/getItemsPerPage());var _122=Math.floor((lastResults.length-1)/getItemsPerPage());if(_121>0){_120=createTiddlyButton(_11a,"Previous","Go to previous page (Shortcut: Alt-'<')",onNaviButtonClick,"prev");_120.setAttribute("page",(_121-1).toString());_120.setAttribute("accessKey","<");}for(var i=-maxPagesInNaviBar;i<maxPagesInNaviBar;i++){var _124=_121+i;if(_124<0){continue;}if(_124>_122){break;}var _125=(i+_121+1).toString();var _126=_124==_121?"currentPage":"otherPage";_120=createTiddlyButton(_11a,_125,"Go to page %0".format([_125]),onNaviButtonClick,_126);_120.setAttribute("page",(_124).toString());}if(_121<_122){_120=createTiddlyButton(_11a,"Next","Go to next page (Shortcut: Alt-'>')",onNaviButtonClick,"next");_120.setAttribute("page",(_121+1).toString());_120.setAttribute("accessKey",">");}};config.macros.yourSearch.funcs["if"]=function(_127,_128,_129,_12a,_12b,_12c){if(_129.length<2){return;}var _12d=_129[1];var _12e=(_12d=="not");if(_12e){if(_129.length<3){return;}_12d=_129[2];}var test=config.macros.yourSearch.tests[_12d];var _130=false;try{if(test){_130=test(_127,_128,_129,_12a,_12b,_12c)!=_12e;}else{_130=(!eval(_12d))==_12e;}}catch(ex){}if(!_130){_127.style.display="none";}};var createOptionWithRefresh=function(_131,_132,_133,_134){invokeMacro(_131,"option",_132,_133,_134);var elem=_131.lastChild;var _136=elem.onclick;elem.onclick=function(e){var _138=_136.apply(this,arguments);refreshResult();return _138;};return elem;};config.macros.yourSearch.funcs.chkPreviewText=function(_139,_13a,_13b,_13c,_13d,_13e){var _13f=_13b.slice(1).join(" ");var elem=createOptionWithRefresh(_139,"chkPreviewText",_13c,_13e);elem.setAttribute("accessKey","P");elem.title="Show text preview of found tiddlers (Shortcut: Alt-P)";return elem;};config.macros.foundTiddler={label:"foundTiddler",prompt:"Provides information on the tiddler currently processed on the YourSearch result page",funcs:{}};config.macros.foundTiddler.handler=function(_141,_142,_143,_144,_145,_146){if(!currentTiddler){return;}var name=_143[0];var func=config.macros.foundTiddler.funcs[name];if(func){func(_141,_142,_143,_144,_145,_146);}};var closeResultAndDisplayTiddler=function(e){closeResult();var _14a=this.getAttribute("tiddlyLink");if(_14a){var _14b=this.getAttribute("withHilite");var _14c=highlightHack;if(_14b&&_14b=="true"&&lastQuery){highlightHack=lastQuery.getMarkRegExp();}story.displayTiddler(this,_14a);highlightHack=_14c;}return (false);};var getShortCutNumber=function(){if(!currentTiddler){return -1;}if(indexInPage>=0&&indexInPage<=9){return indexInPage<9?(indexInPage+1):0;}else{return -1;}};config.macros.foundTiddler.funcs.title=function(_14d,_14e,_14f,_150,_151,_152){if(!currentTiddler){return;}var _153=getShortCutNumber();var _154=_153>=0?"Open tiddler (Shortcut: Alt-%0)".format([_153.toString()]):"Open tiddler";var btn=createTiddlyButton(_14d,null,_154,closeResultAndDisplayTiddler,null);btn.setAttribute("tiddlyLink",currentTiddler.title);btn.setAttribute("withHilite","true");createLimitedTextWithMarks(btn,currentTiddler.title,maxCharsInTitle);if(_153>=0){btn.setAttribute("accessKey",_153.toString());}};config.macros.foundTiddler.funcs.tags=function(_156,_157,_158,_159,_15a,_15b){if(!currentTiddler){return;}createLimitedTextWithMarks(_156,currentTiddler.getTags(),maxCharsInTags);};config.macros.foundTiddler.funcs.text=function(_15c,_15d,_15e,_15f,_160,_161){if(!currentTiddler){return;}createLimitedTextWithMarks(_15c,removeTextDecoration(currentTiddler.text),maxCharsInText);};config.macros.foundTiddler.funcs.number=function(_162,_163,_164,_165,_166,_167){var _168=getShortCutNumber();if(_168>=0){var text="%0)".format([_168.toString()]);createTiddlyElement(_162,"span",null,"shortcutNumber",text);}};function scrollToAnchor(name){return false;}if(config.options.chkUseYourSearch==undefined){config.options.chkUseYourSearch=true;}if(config.options.chkPreviewText==undefined){config.options.chkPreviewText=true;}if(config.options.chkSearchAsYouType==undefined){config.options.chkSearchAsYouType=true;}if(config.options.chkSearchInTitle==undefined){config.options.chkSearchInTitle=true;}if(config.options.chkSearchInText==undefined){config.options.chkSearchInText=true;}if(config.options.chkSearchInTags==undefined){config.options.chkSearchInTags=true;}if(config.options.txtItemsPerPage==undefined){config.options.txtItemsPerPage=itemsPerPageDefault;}if(config.options.txtItemsPerPageWithPreview==undefined){config.options.txtItemsPerPageWithPreview=itemsPerPageWithPreviewDefault;}config.shadowTiddlers.AdvancedOptions+="\n<<option chkUseYourSearch>> Use 'Your Search' //([[more options|YourSearch Options]])//";config.shadowTiddlers["YourSearch Introduction"]="!About YourSearch\n"+"\n"+"YourSearch gives you a bunch of new features to simplify and speed up your daily searches in TiddlyWiki. It seamlessly integrates into the standard TiddlyWiki search: just start typing into the 'search' field and explore!\n"+"\n"+"''May the '~Alt-F' be with you.''\n"+"\n"+"\n"+"!Features\n"+"* YourSearch searches for tiddlers that match your query ''as you type'' into the 'search' field. It presents a list of the ''\"Top Ten\"'' tiddlers in a ''popup-like window'': the ''[[YourSearch Result]]''. The tiddlers currently displayed in your TiddlyWiki are not affected.\n"+"* Using ''~TiddlerRank technology'' the [[YourSearch Result]] lists the ''most interesting tiddlers first''.\n"+"* Through ''Filtered Search'' and ''Boolean Search'' you can easily refining your search, like excluding words or searching for multiple words. This way less tiddlers are displayed in the [[YourSearch Result]] and you can faster scan the result for the tiddler you are looking for.\n"+"* The [[YourSearch Result]] lists the found tiddlers ''page-wise'', e.g. 10 per page. Use the ''Result Page Navigation Bar'' to navigate between pages if the result does not fit on one page.\n"+"* The [[YourSearch Result]] states the ''total number of found tiddlers''. This way you can quickly decide if you want to browse the result list or if you want to refine your search first to shorten the result list.\n"+"* Beside the ''title of the found tiddlers'' the [[YourSearch Result]] also ''displays tags'' and ''tiddler text previews''. The ''tiddler text preview'' is an extract of the tiddler's content, showing the most interesting parts related to your query (e.g. the texts around the words you are looking for).\n"+"* The words you are looking for are hilited in the titles, tags and text previews of the [[YourSearch Result]].\n"+"* If you are not interested in the tiddler text previews but prefer to get longer lists of tiddlers on one result page you may ''switch of the text preview''.\n"+"* If the [[YourSearch Result]] contains the tiddler you are looking for you can just ''click its title to display'' it in your TiddlyWiki. Alternatively you may also ''open all found tiddlers'' at once. \n"+"* Use [[YourSearch Options]] to customize YourSearch to your needs. E.g. depending on the size of your screen you may change the number of tiddlers displayed in the [[YourSearch Result]]. In the [[YourSearch Options]] and the AdvancedOptions you may also switch off YourSearch in case you temporarily want to use the standard search.\n"+"* For the most frequently actions ''access keys'' are defined so you can perform your search without using the mouse.\n"+"\n";config.shadowTiddlers["YourSearch Help"]="<<tiddler [[YourSearch Introduction]]>>"+"\n"+"!Filtered Search<html><a name='Filtered'/></html>\n"+"Using the Filtered Search you can restrict your search to certain parts of a tiddler, e.g only search the tags or only the titles.\n"+"|!What you want|!What you type|!Example|\n"+"|Search ''titles only''|start word with ''!''|{{{!jonny}}}|\n"+"|Search ''contents only''|start word with ''%''|{{{%football}}}|\n"+"|Search ''tags only''|start word with ''#''|{{{#Plugin}}}|\n"+"\n"+"You may use more than one filter for a word. E.g. {{{!#Plugin}}} finds tiddlers containing \"Plugin\" either in the title or in the tags (but does not look for \"Plugin\" in the content).\n"+"\n"+"!Boolean Search<html><a name='Boolean'/></html>\n"+"The Boolean Search is useful when searching for multiple words.\n"+"|!What you want|!What you type|!Example|\n"+"|''All words'' must exist|List of words|{{{jonny jeremy}}}|\n"+"|''At least one word'' must exist|Separate words by ''or''|{{{jonny or jeremy}}}|\n"+"|A word ''must not exist''|Start word with ''-''|{{{-jonny}}}|\n"+"\n"+"''Note:'' When you specify two words, separated with a space, YourSearch finds all tiddlers that contain both words, but not necessarily next to each other. If you want to find a sequence of word, e.g. '{{{John Brown}}}', you need to put the words into quotes. I.e. you type: {{{\"john brown\"}}}.\n"+"\n"+"!'Exact Word' Search<html><a name='Exact'/></html>;\n"+"By default a search result all matches that 'contain' the searched text. \n"+" E.g. if you search for 'Task' you will get all tiddlers containing 'Task', but also 'CompletedTask', 'TaskForce' etc.\n"+"\n"+"If you only want to get the tiddlers that contain 'exactly the word' you need to prefix it with a '='. E.g. typing '=Task' will the tiddlers that contain the word 'Task', ignoring words that just contain 'Task' as a substring.\n"+"\n"+"!Combined Search<html><a name='Combined'/></html>\n"+"You are free to combine the various search options. \n"+"\n"+"''Examples''\n"+"|!What you type|!Result|\n"+"|{{{!jonny !jeremy -%football}}}| all tiddlers with both {{{jonny}}} and {{{jeremy}}} in its titles, but no {{{football}}} in content.|\n"+"|{{{#=Task}}}|All tiddlers tagged with 'Task' (the exact word). Tags named 'CompletedTask', 'TaskForce' etc. are not considered.|\n"+"\n"+"!~CaseSensitiveSearch and ~RegExpSearch<html><a name='Case'/></html>\n"+"The standard search options ~CaseSensitiveSearch and ~RegExpSearch are fully supported by YourSearch. However when ''~RegExpSearch'' is on Filtered and Boolean Search are disabled.\n"+"\n"+"!Access Keys<html><a name='Access'/></html>\n"+"You are encouraged to use the access keys (also called \"shortcut\" keys) for the most frequently used operations. For quick reference these shortcuts are also mentioned in the tooltip for the various buttons etc.\n"+"\n"+"|!Key|!Operation|\n"+"|{{{Alt-F}}}|''The most important keystroke'': It moves the cursor to the search input field so you can directly start typing your query. Pressing {{{Alt-F}}} will also display the previous search result. This way you can quickly display multiple tiddlers using \"Press {{{Alt-F}}}. Select tiddler.\" sequences.|\n"+"|{{{ESC}}}|Closes the [[YourSearch Result]]. When the [[YourSearch Result]] is already closed and the cursor is in the search input field the field's content is cleared so you start a new query.|\n"+"|{{{Alt-1}}}, {{{Alt-2}}},... |Pressing these keys opens the first, second etc. tiddler from the result list.|\n"+"|{{{Alt-O}}}|Opens all found tiddlers.|\n"+"|{{{Alt-P}}}|Toggles the 'Preview Text' mode.|\n"+"|{{{Alt-'<'}}}, {{{Alt-'>'}}}|Displays the previous or next page in the [[YourSearch Result]].|\n"+"|{{{Return}}}|When you have turned off the 'as you type' search mode pressing the {{{Return}}} key actually starts the search (as does pressing the 'search' button).|\n"+"\n";config.shadowTiddlers["YourSearch Options"]="|>|!YourSearch Options|\n"+"|>|<<option chkUseYourSearch>> Use 'Your Search'|\n"+"|!|<<option chkPreviewText>> Show Text Preview|\n"+"|!|<<option chkSearchAsYouType>> 'Search As You Type' Mode (No RETURN required to start search)|\n"+"|!|Default Search Filter:<<option chkSearchInTitle>>Titles ('!') <<option chkSearchInText>>Texts ('%') <<option chkSearchInTags>>Tags ('#') <html><br><font size=\"-2\">The parts of a tiddlers that are searched when you don't explicitly specify a filter in the search text (using a '!', '%' or '#' prefix).</font></html>|\n"+"|!|Number of items on search result page: <<option txtItemsPerPage>>|\n"+"|!|Number of items on search result page with preview text: <<option txtItemsPerPageWithPreview>>|\n";config.shadowTiddlers["YourSearchStyleSheet"]="/***\n"+"!~YourSearchResult Stylesheet\n"+"***/\n"+"/*{{{*/\n"+".yourSearchResult {\n"+"\tposition: absolute;\n"+"\twidth: 800px;\n"+"\n"+"\tpadding: 0.2em;\n"+"\tlist-style: none;\n"+"\tmargin: 0;\n"+"\n"+"\tbackground: White;\n"+"\tborder: 1px solid DarkGray;\n"+"}\n"+"\n"+"/*}}}*/\n"+"/***\n"+"!!Summary Section\n"+"***/\n"+"/*{{{*/\n"+".yourSearchResult .summary {\n"+"\tborder-bottom-width: thin;\n"+"\tborder-bottom-style: solid;\n"+"\tborder-bottom-color: #999999;\n"+"\tpadding-bottom: 4px;\n"+"}\n"+"\n"+".yourSearchRange, .yourSearchCount, .yourSearchQuery {\n"+"\tfont-weight: bold;\n"+"}\n"+"\n"+".yourSearchResult .summary .button {\n"+"\tfont-size: 10px;\n"+"\n"+"\tpadding-left: 0.3em;\n"+"\tpadding-right: 0.3em;\n"+"}\n"+"\n"+".yourSearchResult .summary .chkBoxLabel {\n"+"\tfont-size: 10px;\n"+"\n"+"\tpadding-right: 0.3em;\n"+"}\n"+"\n"+"/*}}}*/\n"+"/***\n"+"!!Items Area\n"+"***/\n"+"/*{{{*/\n"+".yourSearchResult .marked {\n"+"\tbackground: none;\n"+"\tfont-weight: bold;\n"+"}\n"+"\n"+".yourSearchItem {\n"+"\tmargin-top: 2px;\n"+"}\n"+"\n"+".yourSearchNumber {\n"+"\tcolor: #808080;\n"+"}\n"+"\n"+"\n"+".yourSearchTags {\n"+"\tcolor: #008000;\n"+"}\n"+"\n"+".yourSearchText {\n"+"\tcolor: #808080;\n"+"\tmargin-bottom: 6px;\n"+"}\n"+"\n"+"/*}}}*/\n"+"/***\n"+"!!Footer\n"+"***/\n"+"/*{{{*/\n"+".yourSearchFooter {\n"+"\tmargin-top: 8px;\n"+"\tborder-top-width: thin;\n"+"\tborder-top-style: solid;\n"+"\tborder-top-color: #999999;\n"+"}\n"+"\n"+".yourSearchFooter a:hover{\n"+"\tbackground: none;\n"+"\tcolor: none;\n"+"}\n"+"/*}}}*/\n"+"/***\n"+"!!Navigation Bar\n"+"***/\n"+"/*{{{*/\n"+".yourSearchNaviBar a {\n"+"\tfont-size: 16px;\n"+"\tmargin-left: 4px;\n"+"\tmargin-right: 4px;\n"+"\tcolor: black;\n"+"\ttext-decoration: underline;\n"+"}\n"+"\n"+".yourSearchNaviBar a:hover {\n"+"\tbackground-color: none;\n"+"}\n"+"\n"+".yourSearchNaviBar .prev {\n"+"\tfont-weight: bold;\n"+"\tcolor: blue;\n"+"}\n"+"\n"+".yourSearchNaviBar .currentPage {\n"+"\tcolor: #FF0000;\n"+"\tfont-weight: bold;\n"+"\ttext-decoration: none;\n"+"}\n"+"\n"+".yourSearchNaviBar .next {\n"+"\tfont-weight: bold;\n"+"\tcolor: blue;\n"+"}\n"+"/*}}}*/\n";config.shadowTiddlers["YourSearchResultTemplate"]="<!--\n"+"{{{\n"+"-->\n"+"<span macro=\"yourSearch if found\">\n"+"<!-- The Summary Header ============================================ -->\n"+"<table class=\"summary\" border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tbody>\n"+" <tr>\n"+"\t<td align=\"left\">\n"+"\t\tYourSearch Result <span class=\"yourSearchRange\" macro=\"yourSearch itemRange\"></span>\n"+"\t\t&nbsp;of&nbsp;<span class=\"yourSearchCount\" macro=\"yourSearch count\"></span>\n"+"\t\tfor&nbsp;<span class=\"yourSearchQuery\" macro=\"yourSearch query\"></span>\n"+"\t</td>\n"+"\t<td class=\"yourSearchButtons\" align=\"right\">\n"+"\t\t<span macro=\"yourSearch chkPreviewText\"></span><span class=\"chkBoxLabel\">preview text</span>\n"+"\t\t<span macro=\"yourSearch openAllButton\"></span>\n"+"\t\t<span macro=\"yourSearch linkButton 'YourSearch Options' options 'Configure YourSearch'\"></span>\n"+"\t\t<span macro=\"yourSearch linkButton 'YourSearch Help' help 'Get help how to use YourSearch'\"></span>\n"+"\t\t<span macro=\"yourSearch closeButton\"></span>\n"+"\t</td>\n"+" </tr>\n"+"</tbody></table>\n"+"\n"+"<!-- The List of Found Tiddlers ============================================ -->\n"+"<div id=\"yourSearchResultItems\" itemsPerPage=\"25\" itemsPerPageWithPreview=\"10\"></div>\n"+"\n"+"<!-- The Footer (with the Navigation) ============================================ -->\n"+"<table class=\"yourSearchFooter\" border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tbody>\n"+" <tr>\n"+"\t<td align=\"left\">\n"+"\t\tResult page: <span class=\"yourSearchNaviBar\" macro=\"yourSearch naviBar\"></span>\n"+"\t</td>\n"+"\t<td align=\"right\"><span macro=\"yourSearch version\"></span>, <span macro=\"yourSearch copyright\"></span>\n"+"\t</td>\n"+" </tr>\n"+"</tbody></table>\n"+"<!-- end of the 'tiddlers found' case =========================================== -->\n"+"</span>\n"+"\n"+"\n"+"<!-- The \"No tiddlers found\" case =========================================== -->\n"+"<span macro=\"yourSearch if not found\">\n"+"<table class=\"summary\" border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tbody>\n"+" <tr>\n"+"\t<td align=\"left\">\n"+"\t\tYourSearch Result: No tiddlers found for <span class=\"yourSearchQuery\" macro=\"yourSearch query\"></span>.\n"+"\t</td>\n"+"\t<td class=\"yourSearchButtons\" align=\"right\">\n"+"\t\t<span macro=\"yourSearch linkButton 'YourSearch Options' options 'Configure YourSearch'\"></span>\n"+"\t\t<span macro=\"yourSearch linkButton 'YourSearch Help' help 'Get help how to use YourSearch'\"></span>\n"+"\t\t<span macro=\"yourSearch closeButton\"></span>\n"+"\t</td>\n"+" </tr>\n"+"</tbody></table>\n"+"</span>\n"+"\n"+"\n"+"<!--\n"+"}}}\n"+"-->\n";config.shadowTiddlers["YourSearchItemTemplate"]="<!--\n"+"{{{\n"+"-->\n"+"<span class='yourSearchNumber' macro='foundTiddler number'></span>\n"+"<span class='yourSearchTitle' macro='foundTiddler title'/></span>&nbsp;-&nbsp;\n"+"<span class='yourSearchTags' macro='foundTiddler tags'/></span>\n"+"<span macro=\"yourSearch if previewText\"><div class='yourSearchText' macro='foundTiddler text'/></div></span>\n"+"<!--\n"+"}}}\n"+"-->";config.shadowTiddlers["YourSearch"]="<<tiddler [[YourSearch Help]]>>";config.shadowTiddlers["YourSearch Result"]="The popup-like window displaying the result of a YourSearch query.";setStylesheet(store.getTiddlerText("YourSearchStyleSheet"),"yourSearch");var origMacros_search_handler=config.macros.search.handler;config.macros.search.handler=myMacroSearchHandler;var ownsOverwrittenFunctions=function(){var _16b=(config.macros.search.handler==myMacroSearchHandler);return _16b;};var checkForOtherHijacker=function(){if(!ownsOverwrittenFunctions()){alert("Message from YourSearchPlugin:\n\n\n"+"Another plugin has disabled the 'Your Search' features.\n\n\n"+"You may disable the other plugin or change the load order of \n"+"the plugins (by changing the names of the tiddlers)\n"+"to enable the 'Your Search' features.");}};setTimeout(checkForOtherHijacker,5000);abego.YourSearch.getStandardRankFunction=function(){return standardRankFunction;};abego.YourSearch.getRankFunction=function(){return abego.YourSearch.getStandardRankFunction();};abego.YourSearch.getCurrentTiddler=function(){return currentTiddler;};}
/***
%/
!Licence and Copyright
Copyright (c) abego Software ~GmbH, 2005-2006 ([[www.abego-software.de|http://www.abego-software.de]])

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.

Neither the name of abego Software nor the names of its contributors may be
used to endorse or promote products derived from this software without specific
prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
***/

Copyright 2006 Brian Gant
/***
|''Name:''|SimileTimelinePlugin|
|''Description:''|Plugin to support Simile Timelines, see http://simile.mit.edu/SimileTimeline/ |
|''Author:''|Martin Budden ( mjbudden [at] gmail [dot] com)|
|''Subversion:''|http://svn.tiddlywiki.org/Trunk/contributors/MartinBudden/plugins/SimileTimelinePlugin.js |
|''Version:''|0.1.0|
|''Date:''|Mar 4, 2007|
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev |
|''License:''|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/ ]]|
|''~CoreVersion:''|2.2|
***/

/*{{{*/
// Ensure that the SimileTimelinePlugin is only installed once.
if(!version.extensions.SimileTimelinePlugin) {
version.extensions.SimileTimelineBundlePlugin = {installed:true};

if(version.major < 2 || (version.major == 2 && version.minor < 2))
	{alertAndThrow('SimileTimelineBundlePlugin requires TiddlyWiki 2.2 or newer.');}

config.macros.SimileTimeline = {};

config.macros.SimileTimeline.closeTiddler = Story.prototype.closeTiddler;
Story.prototype.closeTiddler = function(title,animate,slowly)
{
	config.macros.SimileTimeline.closeTiddler.apply(this,arguments);
	if(config.macros.SimileTimeline.tickTitle && config.macros.SimileTimeline.tickTitle==title) {
		config.macros.SimileTimeline.clearTick();
	}
};

// used for date string in bubble
Timeline.urlPrefix = 'http://martinswiki.com/timeline/' //!! kludge for now

Timeline.GregorianDateLabeller.prototype.labelPrecise = function(date)
{
	var dt = Timeline.DateTime.removeTimeZoneOffset(date,this._timeZone);
	var template = "mmm DD, YYYY";
	return dt.formatString(template);
	//return dt.toUTCString();
};

Timeline.GregorianDateLabeller.labelIntervalWeek = function(date)
{
	var dt = Timeline.DateTime.removeTimeZoneOffset(date,this._timeZone);
	var text = '' + dt.getWeek();
	return {text:text,emphasized:false};
}

Timeline.GregorianDateLabeller.labelIntervalFunctions['en'] = function(date,intervalUnit)
{
	if(intervalUnit==Timeline.DateTime.WEEK) {
		var dt = Timeline.DateTime.removeTimeZoneOffset(date,this._timeZone);
		var text = '' + dt.getWeek();
		return {text:text,emphasized:false};
	} else {
		return this.defaultLabelInterval(date,intervalUnit);
	}
};
/*
Timeline.DefaultEventSource.Event.prototype.fillInfoBubble = function(elmt,theme,labeller)
{
	var doc = elmt.ownerDocument;

	var image = this.getImage();
	if(image) {
		var img = doc.createElement("img");
		img.src = image;
		
		theme.event.bubble.imageStyler(img);
		elmt.appendChild(img);
	}

	var divTitle = doc.createElement("div");
	var title = this.getText();
	var textTitle = doc.createTextNode(title);
	var link = this.getLink();
	if(link) {
		var a = doc.createElement("a");
		a.href = link;
		a.appendChild(textTitle);
		divTitle.appendChild(a);
	} else {
		divTitle.appendChild(textTitle);
	}
	theme.event.bubble.titleStyler(divTitle);
	elmt.appendChild(divTitle);

	var divBody = doc.createElement("div");
	this.fillDescription(divBody);
	theme.event.bubble.bodyStyler(divBody);
	elmt.appendChild(divBody);

	var divTime = doc.createElement("div");
	this.fillTime(divTime,labeller);
	theme.event.bubble.timeStyler(divTime);
	elmt.appendChild(divTime);

	var divWiki = doc.createElement("div");
	this.fillWikiInfo(divWiki);
	theme.event.bubble.wikiStyler(divWiki);
	elmt.appendChild(divWiki);
};
*/

Timeline.loadTiddlers = function(data,fn)
{
	fn(data);
};

Timeline.DefaultEventSource.prototype.loadTiddlers = function(data)
{
	if(data.type && data.type=='tiddlerFields') {
		var include = false;
		var tag = 'excludeLists';
	} else {
		include = true;
		tag = data.params;
	}
	var url = data.url ? data.url : "dummy";
	var base = this._getBaseURL(url);
	// wikiURL and wikiSection used for the "Discuss" button.
	var wikiURL = data.wikiURL;
	var wikiSection = data.wikiSection;

	var dateTimeFormat = null;
	var parseDateTimeFunction = this._events.getUnit().getParser(dateTimeFormat);

	var added = false;  
	var tiddlers = store.reverseLookup('tags',tag,include);
	for(var i=0; i<tiddlers.length; i++) {
		//var event = config.macros.SimileTimeline.getEvent(tiddlers[i].title);
		var event = tiddlers[i].getSimileTimelineEvent(data.type);
		var evt = new Timeline.DefaultEventSource.Event(
			parseDateTimeFunction(event.start),
			parseDateTimeFunction(event.end),
			parseDateTimeFunction(event.latestStart),
			parseDateTimeFunction(event.earliestEnd),
			event.isDuration || false,
			event.title,
			event.description,
			this._resolveRelativeURL(event.image,base),
			this._resolveRelativeURL(event.link,base),
			this._resolveRelativeURL(event.icon,base),
			event.color,
			event.textColor);
		evt._obj = event;
		evt.getProperty = function(name) {
			return this._obj[name];
		};
		evt.setWikiInfo(wikiURL,wikiSection);

		this._events.add(evt);
		added = true;
	}

	if (added) {
		this._fire('onAddMany',[]);
	}
};

Tiddler.prototype.getSimileTimelineEvent = function(type,eventFields)
{
	var t = this.title;
	var f = eventFields ? eventFields : config.macros.SimileTimeline.eventFields;
	var ev = {};
	if(type && type=='tiddlerFields') {
		ev.start = this.created;
		ev.title = this.title;
		ev.description = this.text;
		ev.link = null;
		//ev.link = 'index.html#' + encodeURIComponent(String.encodeTiddlyLink(this.title));
	} else {
		ev.start = store.getTiddlerSlice(t,f.start);
		ev.latestStart = store.getTiddlerSlice(t,f.latestStart);
		ev.end = store.getTiddlerSlice(t,f.end);
		ev.earliestEnd = store.getTiddlerSlice(t,f.earliestEnd);
		ev.isDuration = store.getTiddlerSlice(t,f.isDuration);
		ev.title = store.getTiddlerSlice(t,f.title);
		ev.description = store.getTiddlerSlice(t,f.description);
		ev.image = store.getTiddlerSlice(t,f.image);
		ev.link = store.getTiddlerSlice(t,f.link);
		ev.icon = store.getTiddlerSlice(t,f.icon);
		ev.color = store.getTiddlerSlice(t,f.color);
		ev.textColor = store.getTiddlerSlice(t,f.textColor);
	}
	return ev;
};

// to allow loading from tiddlers with differently named fields
config.macros.SimileTimeline.eventFields = {
	start:'start',latestStart:'latestStart',end:'end',earliestEnd:'earliestEnd',
	isDuration:'isDuration',title:'title',description:'description',image:'image',link:'link',
	icon:'icon',color:'color',textColor:'textColor'
	};

config.macros.SimileTimeline.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
	this.clearTick();
	var spec = params[0];
	var eventSource = new Timeline.DefaultEventSource();
	var theme = Timeline.ClassicTheme.create();

	var bWidth = store.getTiddlerSlice(spec,'bubbleWidth');
	if(bWidth)
		theme.event.bubble.width = bWidth;
	var bHeight = store.getTiddlerSlice(spec,'bubbleHeight');
	if(bHeight)
		theme.event.bubble.height = bHeight;

	//var defaultDate = Timeline.DateTime.parseGregorianDateTime('2000');
	var defaultDate = new Date();
	var eventSources = [];
	var ev = {};
	var bandInfos = [];
	var i = 0;
	var bandParams = config.macros.SimileTimeline.getBandParams(spec,'0',defaultDate);
	while(bandParams) {
		if(bandParams.ev.type && bandParams.ev.type != 'none') {
			bandParams.bp.eventSource = eventSource;
			ev = bandParams.ev;
			if(bandParams.ev.type != 'timer') {
				ev.source = eventSource;
			}
			if(eventSources.length==0)// !!!for now only deal with one eventSource
				eventSources.push(ev);
		}
		bandParams.theme = theme;
		defaultDate = bandParams.bp.date;
		bi = bandParams.bp.zones ? Timeline.createHotZoneBandInfo(bandParams.bp) : Timeline.createBandInfo(bandParams.bp);
		bandInfos.push(bi);
		if(i>0) {
			bandInfos[i].syncWith = 0;
			bandInfos[i].highlight = bandParams.highlight;
		}
		i++;
		bandParams = config.macros.SimileTimeline.getBandParams(spec,String(i),defaultDate);
	}
	var timelineElem = createTiddlyElement(place,'div',null,'simileTimeline');// simileTimeline css class
	var tHeight = store.getTiddlerSlice(spec,'timelineHeight');
	timelineElem.style['height'] = tHeight ? tHeight + 'px' : '150px';
	var tBorder = store.getTiddlerSlice(spec,'timelineBorder');
	if(tBorder)
		timelineElem.style['border'] = tBorder + 'px';
	config.macros.SimileTimeline.timeline = Timeline.create(timelineElem,bandInfos);
	var data = {};
	for(i=0;i<eventSources.length;i++) {
		ev = eventSources[i];
		if(ev.type=='timer') {
			config.macros.SimileTimeline.tickTitle = tiddler.title;//!!! temporary kludge, only support one timer
			config.macros.SimileTimeline.timerId = setTimeout("config.macros.SimileTimeline.tick()",1000);
		}
		data.type = ev.type;
		data.params = ev.params;
		if(ev.source && data.type||data.params) {
			Timeline.loadTiddlers(data,function(data,url) { if(ev.source) ev.source.loadTiddlers(data,url); });
		}
	}
};

config.macros.SimileTimeline.tick = function()
{
	config.macros.SimileTimeline.timeline.getBand(0).setCenterVisibleDate(new Date());
	if(config.macros.SimileTimeline.timerId)
		config.macros.SimileTimeline.timerId = setTimeout('config.macros.SimileTimeline.tick()',1000);
};

config.macros.SimileTimeline.clearTick = function()
{
	if(config.macros.SimileTimeline.timerId)
		clearTimeout(config.macros.SimileTimeline.timerId)
	config.macros.SimileTimeline.timerId = null;
};

config.macros.SimileTimeline.getBandParams = function(title,n,defaultDate)
{
	var t = title;
	var width = store.getTiddlerSlice(t,'width'+n);
	if(!width)
		return null;
	var bp = {};
	bp.width = width;
	var intervalUnit = store.getTiddlerSlice(t,'intervalUnit'+n);
	switch(intervalUnit) {
	case 'MILLISECOND':
		bp.intervalUnit = 0;
		break;
	case 'SECOND':
		bp.intervalUnit = 1;
		break;
	case 'MINUTE':
		bp.intervalUnit = 2;
		break;
	case 'HOUR':
		bp.intervalUnit = 3;
		break;
	case 'DAY':
		bp.intervalUnit = 4;
		break;
	case 'WEEK':
		bp.intervalUnit = 5;
		break;
	case 'MONTH':
		bp.intervalUnit = 6;
		break;
	case 'YEAR':
		bp.intervalUnit = 7;
		break;
	case 'DECADE':
		bp.intervalUnit = 8;
		break;
	case 'CENTURY':
		bp.intervalUnit = 9;
		break;
	case 'MILLENNIUM':
		bp.intervalUnit = 10;
		break;
	case 'EPOCH':
		bp.intervalUnit = -1;
		break;
	case 'ERA':
		bp.intervalUnit = -2;
		break;
	default:
		bp.intervalUnit = 7;
		break;
	}
	var intervalPixels = store.getTiddlerSlice(t,'intervalPixels'+n);
	bp.intervalPixels = eval(intervalPixels);
	var date = store.getTiddlerSlice(t,'date'+n);
	bp.date = date ? Timeline.DateTime.parseGregorianDateTime(date) : defaultDate;
	var showEventText = store.getTiddlerSlice(t,'showEventText'+n);
	bp.showEventText = showEventText ? eval(showEventText) : true;
	var trackHeight = store.getTiddlerSlice(t,'trackHeight'+n);
	if(trackHeight)
		bp.trackHeight = eval(trackHeight);
	var trackGap = store.getTiddlerSlice(t,'trackGap'+n);
	if(trackGap)
		bp.trackGap = eval(trackGap);
	var ev = {};
	ev.type = store.getTiddlerSlice(t,'eventSourceType'+n);
	ev.params = store.getTiddlerSlice(t,'eventSourceParams'+n);
	var ret = {};
	var highlight = store.getTiddlerSlice(t,'highlight'+n);
	bp.highlight = highlight ? eval(highlight) : true;
	ret.ev = ev;
	ret.bp = bp;
	return ret;
};
} // end of 'install only once'
/*}}}*/
/***
{{{<<writeIt {{'[[Current TW Directory|'+getTiddlyWikiDir()+']]'}}>>}}}
<<writeIt {{'[[Current TW Directory|'+getTiddlyWikiDir()+']]'}}>>

{{{<<writeIt {{"TW Last modified: "+(new Date(document.lastModified)).formatString("DD/MM/YYYY")}}>>}}}
<<writeIt {{"TW Last modified: "+(new Date(document.lastModified)).formatString("DD/MM/YYYY")}}>>


***/
//{{{


config.macros.writeIt = {};
config.macros.writeIt.handler= function(place,macroName,params,wikifier,paramString,tiddler) {
 wikify(params[0],place);

}
//}}}

//{{{
window.getTiddlyWikiDir=getTiddlyWikiDir;
//this function written by Udo
function getTiddlyWikiDir() {
 var path = document.location.toString();
 var i = path.lastIndexOf("/");
 return (i >= 0) ? path.substr(0, i+1) : path;
}

//}}}