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
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser excludeLists'></span></div>
<!--}}}-->
To get started with this blank [[TiddlyWiki]], you'll need to modify the following tiddlers:
* [[SiteTitle]] & [[SiteSubtitle]]: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)
* [[MainMenu]]: The menu (usually on the left)
* [[DefaultTiddlers]]: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened
You'll also need to enter your username for signing your edits: <<option txtUserName>>
<<importTiddlers>>
<!--{{{-->
<link rel='alternate' type='application/rss+xml' title='RSS' href='index.xml' />
<!--}}}-->
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]]
<!--{{{-->
<div class='header' role='banner' 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' role='navigation' refresh='content' tiddler='MainMenu'></div>
<div id='sidebar'>
<div id='sidebarOptions' role='navigation' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' role='complementary' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea' role='main'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
/*{{{*/
body {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.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]];}
.readOnly {background:[[ColorPalette::TertiaryPale]];}

#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 0 1em 1em; left:-1px; top:-1px;}
.headerForeground {position:absolute; padding:4.5em 0 1em 1em; left:0; top:0;}

.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:0 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 0.3em 0;}
#sidebarTabs .tabContents {width:15em; overflow:hidden;}

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

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

.tiddlerPopupButton {padding:0.2em;}
.popupTiddler {position: absolute; z-index:300; padding: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 0;}
.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 0 0 0.5em;}
.tab {margin:0 0 0 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 0 14em;}

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

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

.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:0 0.25em; padding:0 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:0 3px 0 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 0; font-size:.9em;}
.editorFooter .button {padding-top:0; padding-bottom:0;}

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

.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;}
#backstageToolbar {position:relative;}
#backstageArea a {font-weight:bold; margin-left:0.5em; padding:0.3em 0.5em;}
#backstageButton {display:none; position:absolute; z-index:175; top:0; right:0;}
#backstageButton a {padding:0.1em 0.4em; margin:0.1em;}
#backstage {position:relative; width:100%; z-index:50;}
#backstagePanel {display:none; z-index:100; position:absolute; width:90%; margin-left:3em; padding:1em;}
.backstagePanelFooter {padding-top:0.2em; float:right;}
.backstagePanelFooter a {padding: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;}
noscript {display:none;} /* Fixes a feature in Firefox 1.5.0.2 where print preview displays the noscript content */
}
/*}}}*/
<!--{{{-->
<div class='toolbar' role='navigation' macro='toolbar [[ToolbarCommands::ViewToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>)</div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->
!description
Young person is involved in non-mandatory organized school or community activities, such as sports, clubs, church groups, etc.
!end of description

!breakdown
''0+'' = Actively engaged in range of social activities.<br>
''0 = No problem''. Regularly involved in at least one social activity e.g. club, sports team.<br>
''1 = Mild''. Periodic involvement but inconsistent, attendance, Actively, regularly involved in at least one social activity.<br>
''2 = Moderate''. Attends some activities sporadically, but not very involved in any one/does not maintain involvement.<br>
''3 = Severe''. Rare involvement or interest in organised activities, usually attends single occasion only.<br>
''4 = Very severe''. Has been repeatedly asked to leave social activities because of behaviour problems.<br>
!end of breakdown
!description
Attendance at School, Emplyoment or Training courses.  This is a measure of the extent of meaningful activity in the young person's life  Behaviour and attainment are coded separately. Rate the attendance by the young person in the most recent academic, training or work environment, during the most recent 3-month period for which information is available. 
!end of description

!breakdown
0+ = Attending at an above average level; e.g. particularly committed and working long hours productively.<br>
0  = No problem. Attending Education, Employment or a Training course for most or all of the working week.<br>
1 = Attending satisfactorily, but only part-time or on a reduced timetable on account of difficulties, so that some days during the working week are without meaningful activity.  Occasionally truants or refuses to attend scheduled activities.<br>
2 = Moderate problems with attendance - misses days or parts of days on most weeks, with or without the knowledge of parents or carers.<br>
3 = Severe. Missing more time than than attending, and very clear detrimental effect on progress at place of work.<br>
4 = Very severe. Rarely attends, if at all; at high risk of exclusion/dismissal, or has entirely dropped out of Education, Employment or Training.
!end of breakdown
!description
Functioning in school, employment or training; includes academic performance and behaviour.  Since intellectual ability is recorded elsewhere, do not adjust this rating for perceived ability. Rate how the young person is functioning in the most recent academic or work environment, during the most recent 3-month period for which information is available. 
!end of description

!breakdown
0+ = Working at above average level, areas of strength. Good reports from teachers or employers.<br>
0  = No problem. Working at least at an average level; may have some areas of weakness and/or strength.<br>
1 = Mild. Working below year level in at least one academic area, working satisfactorily in others.  Employer recognises certain problems (timekeeping, workrate, etc) but they do not threaten employment status.<br>
2 = Moderate. Significant academic problems in several areas (e.g. fails maths and science exams), receives formal warnings from employer.<br>
3 = Severe. Consistently working below year level in most areas e.g. D average if graded.  Threatened dismissal from work.<br>
4 = Very severe. Far below year expectations in most academic areas e.g. failing most academic classes, retained a year, dropped out of school, dismissed from employment or unemployed with little appreciable engagement with job-hunting.
!end of breakdown
!description
Skills/talents in activities such as athletics, art, music, mechanical, computers
!end of description

!breakdown
0+ = Very good. Young person excels in at least one area of interest, recognized by others as being talented or exceptionally skilled, e.g. wins art competitions, star basketball player, soloist in city-wide choir.<br>
0 = Good. Shows talent and persistent interest in at least one area, e.g. takes music lessons and plays in orchestra for several years,develops skills working on cars.<br>
1 = Average. Has some interests, and participates in individual or group hobbies or activities, but has not developed any one area where skills or abilities make him or her stand out.<br>
2 = Significant difficulties. Has few interests or activities, or moves quickly from one to another without persisting long enough to develop skills; e.g. joins soccer team and quits after a few weeks, tries an instrument but drops it when frustrated.<br>
3 = Major difficulties. No special interests or activities acknowledged by the young person.<br>
4 = Very severe difficulties - no one in the young person's network can identify interests or activities, even ones that were evident in the past.
!end of breakdown
!description
Includes major illnesses or injuries and chronic conditions such as diabetes, arthritis, side effects of medication, physical effects of  alcohol/substance abuse. Excludes transient conditions e.g. influenza, sprained wrist.
!end of description

!breakdown
0+ = In especially good physical condition, very fit, etc.<br>
0 = No problem. In good physical health, no obvious health problems.<br>
1 = Mild. Some health problems but well-controlled and/or unlikely to require significant adjustment of lifestyle.<br>
2 = Moderate. Significant health problems requiring medical intervention, monitoring, or adjustment of lifestyle to prevent deterioration, e.g. inadequately controlled diabetes, asthma, epilepsy.<br>
3 = Severe. In poor health.  Suffering from serious condition(s); physically frail.  Requires intensive medical intervention, major adaptation of lifestyle, and/or extensive monitoring, e.g. brittle diabetes, serious juvenile arthritis, cystic fibrosis.<br>
4 = Very severe. Very poor health.  Suffering from imminently life threatening condition, e.g. medically compromised anorectic, acute heart condition, active AIDS.<br>
!end of breakdown
!description
The extent to which the young person performs tasks such as hygiene, dressing, eating, and attention to personal health needs in age-appropriate manner; if the young person has not been given the opportunity to learn a particular skill (e.g. tie shoes because he has no shoes with ties), do not penalize, and rate on overall functioning.
!end of description

!breakdown
0+ = Good. Takes an active interest in maintaining good health and appearance; i.e. is aware of and maintains personal appearance, well turned out, good hygiene, healthy diet.<br>
0 = No problem. Maintains appearance, self-care to reasonable degree with little or no prompting.<br>
1 = Mild. Has skills but sometimes refuses or neglects self-care tasks, or has a circumscribed problem that does not affect social functioning seriously, e.g. compulsive hand washing.<br>
2 = Moderate. Substantive deficit in self-care in one area that impacts social functioning, e.g. daytime enuresis, unkempt appearance that leads to peer  teasing.<br>
3 = Severe. Significant deficits in self-care in more than one area, impacting social and/or family functioning, or deficits impact health, e.g. diabetic teen does not  monitor food and blood sugar.<br>
4 = Very severe. Significant deficits in most or all areas of self-care, cannot function independently to bathe, dress, and prepare for school, creating major family, social, and/or health problems.
!end of breakdown
!description
Rating of general impairment or disability from any cause that limits or prevents movement, or impairs sight or hearing, or otherwise interferes with personal functioning. Includes impairment resulting from congenital conditions, side effects of medication, physical disabilities resulting from accidents, etc.  DO NOT SELECT THIS AS A KEY PROBLEM if the disability is not amenable to change.
!end of description

!breakdown
0 = No physical impairment/disability.<br>
1 = Mild. Impairment/disability imposes mild restriction on activity/mobility, e.g. mild CP makes young person clumsy and impairs ability to compete in sports, hearing loss causes some problems in academic functioning.<br>
2 = Moderate. Restriction in significant areas of activity due to impairment/disability, severe seasonal asthma keeps the young person from participating in outdoor activities for several months each year.<br>
3 = Severe. Major restrictions in activity due to impairment/disability, e.g. confined to a wheelchair.<br>
4 = Very severe. Fully dependent. Activity/mobility severely restricted by impairment/disability e.g. quadriplegic, or confined to bed because of severe malnutrition related to anorexia.<br>
!end of breakdown
!description
Rate social development and maturity, in comparison with peers of the same culture and age. This item would cover (although is not limited to) the kinds of problems with social interaction that are commonly observed in pervasive developmental disorders such as the autistic spectrum.  DO NOT SELECT THIS AS A KEY PROBLEM IF A DEVELOPMENTAL DEFICIT IS NOT AMENABLE TO CHANGE.
!end of description

!breakdown
0+ = Good. Young person is mature for age, interacts like an older young person, gets along with older peers, seen as 'mature'.<br>
0 = No problem. Young person is typical for age, similar to peers.<br>
1 = Mild. Slightly immature, noticeably ‘younger’ in behaviour/attitudes/awareness e.g. less aware of dress/music other areas of interest shared by peer group.<br>
2 = Moderate. Young person is markedly immature, tends to fit in with younger peers, has regular lapses in social judgement. <br>
3 = Severe. Social deficit. Seen as immature or ‘out of tune’ socially, difficulty fitting in to a peer group, either because of overt immaturity or inappropriate responses to social cues.<br>
4= Very severe. Widespread social deficit. Grossly immature, no or minimal ability to respond appropriately, perceived as misfit, rejected by all groups, isolated.
!end of breakdown
!description
Young person is engaging, likeable, interested in interacting with people.  Social skills and interaction may be reduced for many reasons.  For (lilfe-long) developmental problems in managing reciprocal relationships (such as autistic spectrum difficulties) see also item 08 Young person daily life - Social development.
!end of description

!breakdown
0+ = Good. Young person is likeable, has good social skills, actively enjoys and seeks out interaction with people of all ages.<br>
0 = No problem. Interacts adequately with most people, adequate social skills in relation to people of all ages.<br>
1 = Mild. Engages adequately with most people, has adequate social skills but some difficulties in interaction e.g. shy, hard to engage, awkward with some adults.<br>
2 = Moderate. Noticeable difficulties in peer and/or adult interactions, is withdrawn or interacts inappropriately at times.<br>
3 = Severe. Widespread difficulties in interaction, frequently inappropriate social skills, poor understanding of social cues. <br>
4 = Very severe. Serious problems in social skills or interactions, e.g. is isolated, has no friends, consistently  misreads social cues or responds inappropriately, is consistently hostile and cannot maintain relationships
!end of breakdown
!description
Child or young person's ability to access stable, appropriate housing.  For older adolescents the assumption that the home is a //family// home may not be appropriate.
!end of description

!breakdown
0+ = Good. (Family) home is secure and young person stable within it.<br>
0 = No problem. (Family) home is stable, occasional conflicts are resolved without recourse to threats about eviction.<br>
1 = Mild. (Family's) tenure at home may be at risk, but not imminently so, or conflict at home results in occasional threats about the young person leaving, or having to leave home.<br>
2 = Moderate. Significant risk that the family/young person will lose tenure of the home, or that conflict will lead to permanent expulsion of the young person, who spends occasional nights with friends or relatives to avoid conflict.<br>
3 = Severe. Family/young person has no stable housing - accomodation may be temporary, and inappropriate, or young person may be spending significant periods out of the family home, either by choice or at the family's insistence, or is in temporary housing.<br>
4 = Very severe. Young person is homeless - staying with friends ('sofa-surfing'), or street homeless.
!end of breakdown
!description
Family's ability to provide concrete resources for the young person; e.g. financial stability, appropriate housing, clothing, etc.  In the case of older adolescents living independently, this may refer to their capacity to access the same independently, via work or appropriate benefits.
!end of description

!breakdown
0+ = Good. Family/young person is financially secure and can access funds/resources as required to help the young person.<br>
0 = No problem. Family/young person is financially stable, has access to funds and resources to meet the young person's basic needs.<br>
1 = Mild. Family/young person is financially stable but resources are stretched to meet all of the young person's significant needs.<br>
2 = Moderate. Family's/young person's limitations are such that some of the young person's needs cannot be met e.g. very limited funds for clothing or pocket money.<br>
3 = Severe. Family/young person has great difficulty making ends meet, precluding meeting of some of young person's needs.<br>
4 = Very severe. Family's/young person's resources are very limited and constitute a serious problem for the young person e.g. cannot afford clothes or school equipment, family/young person runs out of money each month, erratic or absent health care because of poor access.<br>
!end of breakdown
!description
The quality of interaction and affection __between members of the immediate family__ (parents and siblings and others living in the home). If variable, rate the best available relationship.
!end of description

!breakdown
0+ = Good. Relationships are warm, confiding, including planned sharing of activities and enjoyment of each others' company.<br>
0 = No problem. Generally positive relationships, family members spend time together, no major conflicts.<br>
1 = Mild. Relationships are generally positive but with limited contact or expressed affection OR mild over-involvement.<br>
2 = Moderate. Relationships are neutral or distant, with only occasional shared activities or conversation; OR significant over-involvement.<br>
3 = Severe. Distant relationships, with no positive interaction or affection expressed, and rarely shared activities or conversation OR severely over-involved or enmeshed relationships.<br>
4 = Very severe. Relationships characterised by hostility, actively destructive, undermining of young person and other family  members OR  highly destructive level of enmeshed relationships/over-involvement.
!end of breakdown
!description
The ways anger, conflict, and negative feelings are expressed and managed in the relationship; rate the relationship between the young person and the immediate family member in which there is the most problematic conflict.
!end of description

!breakdown
0+ = Family's conflict resolution skills are markedly strong - differences are recognised early, and can be explored honestly and effectively.<br>
0 = No problem. Anger and frustration are generally expressed and resolved with little or no long-term impact on the relationship.<br>
1 = Mild problem. Occasionally conflicts lead to residual feelings of frustration and tension that last several days, but most interaction is not coloured by effects of conflict.<br>
2 = Moderate problem. Persistent conflicts or periodic severe clashes; interaction is frequently coloured by conflict. Positive relationship undermined by impact of conflict.<br>
3 = Severe problem. Persistent serious conflict; the majority of interaction is characterized by hostility and conflict with minimal positive expression.<br>
4 = Very severe problem. Interaction with young person is dominated by conflict, e.g. cannot interact with ending up in a screaming fight.
!end of breakdown
!description
Parent or caregiver's typical patterns of discipline, limits, and rule-setting for the young person; too harsh, inconsistent, or inadequate discipline may be a problem.  If young person spends regular time in two households (e.g., divorced parents), and there are inconsistencies between discipline in the two, rate the effect of the combination of the two. If any indication of abuse, ensure that this is recorded in carefully in the history, and that Child Protection issues have been considered.
!end of description

!breakdown
0+ = A positive strength in the family.  Clear boundaries that are managed without recourse to coercion, and are respected by the youth.<br>
0  = No problem. Generally consistent, clearly expressed and age-appropriate discipline with only occasional impatience or inconsistency.<br>
1 = Mild. Generally adequate discipline, but with lapses such as inconsistency in some areas, ignoring when young person breaks a rule, yielding  to young person's persuasion against established policies, empty threats.<br>
2 = Moderate. Significant issues with discipline, such as frequent arguments between parents over discipline, frequent empty threats, frequent punishments inconsistent with the infraction, spanking for minor infractions, serious inconsistency, or very lax or inadequate discipline, where parent only responds when alerted by outside sources.<br>
3 = Severe. Frequent harsh, humiliating, or rejecting punishment, e.g., refusing  to speak to the young person for hours, beats young person with a belt, or no attempt at discipline at all.<br>
4 = Very severe. Sadistic, extreme, abusive discipline, e.g., tying young person to a bed all day, beatings which cause injury.
!end of breakdown
!description
Describes relationships with adults outside the family, such as teachers, coaches, neighbours, parents of friends, aunt or uncle, pastor, etc.
!end of description

!breakdown
0+ = Good. Has an enduring, close relationship with a helpful adult outside the family, to whom he or she turns for advice,
      comfort, and practical support on a regular basis.<br>
0 = No problem. Has relationship with a helpful adult outside the family; this person is available in times of crisis.<br>
1= Mild. Has relationship with helpful adult(s) outside the family but person may not be involved in the young person's day-to-day life or always available in times of crisis.<br>
2 = Moderate. Has generally supportive relationships with some adults, but does not identify any one in whom confides or relies on regularly.<br>
3 = Severe. Relationships with adults outside the family are neutral or distant, cannot envision asking for help or advice.<br>
4 = Very severe. So mistrustful of adults outside the family that he or she actively rejects offers of help.
!end of breakdown
!description
The extent to which the young person seeks out, relates to, and becomes attached to peers
!end of description

!breakdown
0+ = Good. Enjoys/seeks out peers, identifies peers as friends, interacts with a range of peers, admired within peer group.<br>
0 = No problem. Mixes with peers, seen as 'one of the gang', no obvious difficulties with peers.<br>
1 = Mild. Mixes with peers but slow to warm up and form relationships e.g. does not respond initially to friendly overtures from peers, but does interact and engage in some situations.<br>
2 = Moderate. Interacts socially at times, but does not form relationships that persist from one time to the next; or, extremely selective, will only interact with one or two individuals. Tends to be 'a loner'.<br>
3 = Severe. Rarely engages with peers; may watch peers, but does not interact.  Not perceived as part of peer group.<br>
4 = Very severe. Shows no interest in peers at all, ignores or treats them as objects. Rejected by peers.
!end of breakdown
!description
The extent to which the young person’s friendship group is identified as pro-social or antisocial.
!end of description

!breakdown
0+ = Good.  Positive links to socially responsible group, engages exclusively in prosocial activities (sports, clubs, community projects, etc) with these.<br>
0 = No problem.  Mixes with peers who are generally accepted as prosocial, may know antisocial peers, but is not unduly influenced by them, and does not engage in activities alongside them.<br>
1 = Mild. Has occasional contact with young people associated with antisocial groups/gangs, and occasionally witnesses antisocial activities carried out by these.<br>
2 = Moderate. Counts antisocial peers amongst friends.  Has regular exposure to antisocial activities in their presence, and occasionally takes part in these.<br>
3 = Severe. Majority of friendship group could be classified as antisocial, and most leisure time is spent in their company.  Regularly engaging in antisocial behaviours alongside this peergroup.<br>
4 = Very severe.  Strongly and almost exclusively identifies self as gang member.  Regularly engaged in gang-related activities including significant offending behaviours.
!end of breakdown
!description
Young person is bright, quick to learn, able to comprehend.
!end of description

!breakdown
0+ = Very good. Young person is well above average in intelligence, seen as 'gifted'.<br>
0 = Good. Young person is above average in intelligence, seen as 'bright', learns easily.<br>
1 = Average. Young person has average-range intellectual abilities.<br>
2 = Significant difficulties. Young person has below-average intellectual abilities, 'slow', struggles to learn.<br>
3 = Major difficulties. Has cognitive disabilities (not learning difficulty alone).<br>
4 = Severe difficulties.  Cognitive disability is apparent to anyone who meets the young person.
!end of breakdown
!description
Includes irrational fears and phobias, general anxiety, worries, and panic-like symptoms, repeatedly asking questions and seeking reassurance, or restless, agitated behaviour if clearly associated with anxiety.  These will often be provoked by new situations or people in milder forms, or more pervasive fears and inhibitions at higher levels of severity.
!end of description

!breakdown
0+ = A strength.  Recognised as someone who can remain calm under pressure, and yet mindful of risks.<br>
0 = No problem. Anxiety is transient and appropriate to the situation.<br>
1 = Mild. Often anxious, reluctant to try new things, but in familiar surroundings is comfortable; may worry or ruminate more than is typical.<br>
2 = Moderate. Often anxious such that s/he is inhibited and refuses to engage or try new activities, sometimes is anxious or inhibited even in familiar settings; worries, fears, or panic attacks restrict some activities.<br>
3 = Severe. Anxiety often interferes with functioning at school, home, or with peers, and is noticed with concern by teachers or other observers; e.g. anxiety and phobias lead to very limited activities outside of school, in spite of interest and desire to participate.<br>
4 = Very severe. Anxiety pervades daily functioning and interferes with normal tasks of development; e.g. refuses to go to school because of separation or social anxiety, frequent major panic attacks, etc.
!end of breakdown
!description
Obsessional ideas are recurrent, persistent thoughts, impulses, or images that enter the mind despite the person's efforts to exclude them, often recognized by the person as unrealistic. Compulsive behaviours are repetitive and purposeful behaviours associated with a subjective sense that they must be carried out, e.g. checking, washing.
!end of description

!breakdown
0 = No problem. No obsessive or compulsive symptoms, can tolerate changes in routine without anxiety.<br>
1 = Mild. Adherence to routines or habits, with some anxiety or anger when interfered with e.g. perfectionistic regarding homework and spends extra time each night checking and double-checking.<br>
2 = Moderate. Routines and fixed ideas impact functioning and cause conflict or require major adaptation by caregivers, e.g. family must rearrange schedule to accommodate hour-long showers twice a day, preoccupation with intrusive thoughts causes daily distress.<br>
3 = Severe. Obsessions or compulsions dominate daily functioning and interfere with social and cognitive development, e.g. compulsive counting/checking interferes with schoolwork, pervasive preoccupation with cleanliness leads  to isolation and restriction of activities.<br>
4 = Very severe. Incapacitated by rituals or compulsions, e.g. refuses to leave home because of fears of contamination, cannot speak or move because of indecision
!end of breakdown
!description
Recurrent trauma-related thoughts, images, feelings, or behaviours that have a highly charged, frightening, or overwhelming quality, are associated with emotional arousal, and which enter the person's mind in a manner that is beyond voluntary control. Includes intrusive memories, nightmares, flashbacks, reenactments. Excludes depressive ideation, obsessional ideas, or ideation associated with specific phobias.
!end of description

!breakdown
0 = No problem. No evidence of problem with post-traumatic intrusive experiences.<br>
1 = Mild. Thoughts, images, behaviours, or feelings that are transitory, voluntarily controlled, limited in intensity and do not interfere with normal functioning e.g. is reminded of an abuser by current stepfather, but maintains a distant yet congenial relationship.<br>
2 = Moderate. Thoughts, images, behaviours, or feelings that are intense and cause significant distress and disruption in functioning, but can be voluntarily contained e.g. young person listens to music for hours to block out intrusive ideation.<br>
3 = Severe. Thoughts, images, behaviours or feelings that are intense, easily triggered, cannot be voluntarily contained, and cause severe distress and major disruption in social and academic functioning, e.g. a boy has flashbacks to a traumatic beating when attending school, so is repeatedly truant and avoids school.<br>
4 = Very severe. Thoughts, images, behaviours, or feelings that are overwhelming and pervasive, causing intense personal distress and dominating daily functioning, e.g. after a rape, a girl panics whenever she sees a man, jumps at any sound, and so withdraws to her home, where she hides in her room and suffers intense anxiety.
!end of breakdown
!description
The extent to which the young person can focus on a task for appropriate periods of time without distraction or interruption of concentrated effort, without one-to-one supervision or other individual attention.  Rate typical behaviour, not lapses in attention due to fatigue or situation-specific factors.
!end of description

!breakdown
0+ = A noticeable strength.  Parents and teachers comment on powers of concentration and capacity to remain on task, even during undesired but necessary activities.<br>
0 = No problem.  Able to attend and concentrate on tasks for age-appropriate timespans - including tasks that are not immediately rewarding.<br>
1 = Mild. At times able to attend and persist at task for 45 minutes, but often (at least daily) is distracted, even from an activity s/he enjoys, unable to finish what s/he starts, or struggles to attend to tasks that are  frustrating or require rote practice.<br>
2 = Moderate. Is rarely able to attend to a task for more than 30 minutes, other than activities such as TV or video games, teacher notes distractibility at school, cannot persist with frustrating or boring tasks.<br>
3 = Severe. Unable to attend to most activities for more than 15 minutes without some interruption or distraction, even those s/he enjoys; distractibility interferes with acquiring skills and information in school.<br>
4 = Very severe. Unable to focus on any task or activity for more than a few minutes, constantly distracted, severe problems with learning at school or completing other sorts of work.
!end of breakdown
!description
General level of response to frustration, disappointment, criticisms, or provocation. Includes irritability associated with manic states.
!end of description

!breakdown
0+ = A strength.  Recognised by others as having a particularly even, placid temperament (without being passive, or timid.)<br>
0 = No problem. No unusual level of irritability; may respond irritably when tired, but generally even-tempered.<br>
1 = Mild. Responds more intensely than most, often seems crabby or irritable in response to mild frustration or disappointment.<br>
2 = Moderate. Often responds out of proportion to frustration or disappointment, yelling or crying; other people see the young person as hot-tempered or unpredictable.<br>
3 = Severe. Has major outbursts (e.g. yelling, crying, threatening) frequently, even to minor frustrations; these can significantly interfere with peer, family, and school functioning<br>
4 = Very severe. Has outbursts several times a day, and seems constantly angry or explosive; others avoid the young persons and may be afraid of his or her temper.
!end of breakdown
!description
Difficulties with sleep and arousal, including insomnia (difficulty initiating sleep), excessive daytime sleepiness, nightmares, night terrors, sleep apnoea, sleepwalking, and narcolepsy.  Rated on the basis of how much distress and functional disturbance is associated with the problem, regardless of whether sleep is the primary concern. 
!end of description

!breakdown
0 = No problem. May sometimes wake during the night, but sleeps again without difficulty, no persistent problems.<br>
1 = Mild. For example, consistent difficulty in going to sleep (up to 1 hr.), nightmares, or night waking causing daytime fatigue.<br>
2 = Moderate. Major difficulties that disrupt functioning, e.g. complains consistently of initial insomnia of more than an hour's duration; sleeping excessively during the day, sleepwalking that causes family disruption OR reversed sleep-wake cycle.<br>
3 = Severe. For example, nightly difficulties sleeping that leave them exhausted during the day and interfere with personal and/or family functioning, sleeping excessively during the day, narcolepsy symptoms interfere with school or social functioning, mania causes person to sleep only 3 hours per night.<br>
4 = Very severe. Nightly difficulties that constitute an acute risk to safety or development, e.g.  agitated sleepwalking or night terrors that lead to aggressive or uncontrollable behaviour, young person in psychotic break does not sleep for several days.
!end of breakdown
!description
Depression may be manifest in sadness, tearfulness, irritability, lethargy, boredom, etc.; one of the principal factors being an inability to take pleasure in normally pleasurable things.  Lack of activity or withdrawal associated with negative symptoms of psychosis are not rated unless there is clear evidence of dysphoric mood.
!end of description

!breakdown
0 = No problem. Is sad in response to normal stressors, appropriate range of affect.<br>
1 = Mild. Often sad, bored, or irritable, may cry often, is noticed by others as appearing sad, but also has periods of happiness and can engage in normal activities with pleasure.<br>
2 = Moderate. Seems sad, bored, or irritable much of the time, does not engage in normally enjoyable activities.<br>
3 = Severe. Appears sad, bored, irritable, or withdrawn almost all the time, cannot persist in normal activities, does not seem to derive pleasure from anything, may express morbid or suicidal ideation.<br>
4 = Very severe. Sad, tearful, or withdrawn almost all the time, is inactive and disengaged, cannot be cheered up by any intervention; sleep, appetite, and activity level may be affected; persistent morbid or  suicidal ideation.
!end of breakdown
!description
Includes purposeful and self-injurious behaviour; excludes suicidal behaviour, or unclearly motivated behaviours which can or do result in injury.  Ambiguous behaviours (e.g. punching a wall) may be considered self-injurious if repeated after causing pain or injury.  Self-tattooing/piercing are considered self-harm, but professional tattooing or piercing are not.
!end of description

!breakdown
0 = No problems - no self-injurious behaviours reported.<br>
1 = Mild. Habits such as nail-biting or skin-picking lead to mildly disfiguring or painful conditions.<br>
2 = Moderate. For example, self-tattooing or mild self-cutting; punches fist into wall or window.<br>
3 = Severe. Repeated self-cutting; self-injury that requires medical attention; burning self.<br>
4 = Very severe. Self-injury is repeated and severe so that health or bodily integrity is threatened (e.g. cutting leads to infection and severe scarring).
!end of breakdown
!description
Includes all forms of eating disorders, whether restricting calories, binge eating with or without purging, pica etc.  Increase or decrease in caloric intake as a result of depression or other problem is rated under Self Care (06). Includes not eating for reasons associated with delusional states e.g. belief that food is poisoned.
!end of description

!breakdown
0 = No problem. Normal eating habits for age.<br>
1 = Mild. Some concern with eating habits; e.g. restriction of eating to a few foods, chronic overeating in overweight person.<br>
2 = Moderate. Extreme restriction of type or quantity of food, or dramatic overeating (e.g. food must be locked up).<br>
3 = Severe. Food restriction or consumption constitutes a serious health problem e.g. over or under-weight so that physician recommends intervention, beyond dieting for overweight; binging and purging.<br>
4 = Very severe. Eating habits constitute an immediate threat to health, e.g. acute anorexia nervosa, purging from bulimia causes acute medical problems.
!end of breakdown
!description
Use of alcohol or illicit drugs (not cigarettes) without parental approval; culturally sanctioned use such as sips of parents' wine are not rated; in a restricted environment such as in young person unit or correctional facility, severity should be based on observations of attitude and interest expressed and apparent intentions regarding abstinence/treatment.
!end of description

!breakdown
0 = No problem. No use of alcohol or drugs, or only occasional (e.g. once a month) social use of alcohol.<br>
1 = Mild. Occasional use of alcohol or drugs, but with no adverse consequences or regular intoxication; while hospitalised or restricted, denies any problem with substance abuse and intends to continue social use.<br>
2 = Moderate. Use of alcohol or drugs to the point of intoxication at least once a week; while hospitalised or restricted, struggles with cravings, mixed motivation to abstain.<br>
3 = Severe. Frequent (more than twice a week) intoxication; substance use affects relationships, school, and/or work functioning; if hospitalised or restricted, craves substances, talks or thinks repeatedly about use, no plan to abstain.<br>
4 = Very severe. Substance use daily, in spite of adverse effects; while hospitalised or restricted, persistent cravings and attempts to obtain substances.<br>
!end of breakdown
!description
Suicidality is rated on the basis of both behaviour and ideation.  There must be clear evidence of intention to cause self-harm to rate behaviour as a suicide attempt; accidental self-injury is not rated.  Also, do not include injury or illness as a consequence of other symptomatic behaviour such as substance abuse or eating disorder, unless specific suicidal intent is expressed.  Use the Risk Assessment and Care Plan if this scores >1
!end of description

!breakdown
0 = No problem - no suicidal thoughts, plans or intentions.<br>
1 = Mild. Reports suicidal ideation, or persistent hopelessness.<br>
2 = Moderate. Talks about persistent suicidal ideation, with some thought about a method or plan.<br>
3 = Severe. Suicidal gestures e.g. taking 5 pills, cutting wrists superficially and/or significant preparations toward a suicide attempt.<br>
4 = Very severe. Suicide attempt or potentially lethal gesture, e.g. takes bottle of Prozac, or clear preparations for a serious suicide attempt that are interrupted against the young person's will.
!end of breakdown
!description
A style of opposition, noncompliance, and/or refusal to follow directives from authority figures (parents, teachers, social workers, police, etc); some degree of defiance is normally expected, and behaviour should be rated as problematic only if it deviates from age and cultural norms.
!end of description

!breakdown
0 = No problem. Occasional non-compliance, but usually responds to requests when limits and rules are clear.<br>
1 = Mild. Often ignores or argues with adult requests, but will usually comply after repeated demands and limits.<br>
2 = Moderate. Ignores or refuses to comply with adult requests often (e.g. half the time);often requires threats of punishment and ultimatums to comply.<br>
3 = Severe. Most of the time that requests or demands are made refuses and engages in a battle of wills; defiance is present in more than one setting or relationship.<br>
4 = Very severe. Most interactions with adults are characterized by opposition, defiance, and conflict, leading to major behavioural, academic, and social problems, and interfering with social and cognitive development.
!end of breakdown
!description
Refers to deliberate destruction of the young person's own or other people's property, whether in rage episodes or not, such as graffiti, breaking windows, throwing things, etc.
!end of description

!breakdown
0 = No problems - no destruction of property in any reports.<br>
1 = Mild . Occasional mild destruction of property e.g. throws own possessions when angry, draws on walls.<br>
2 = Moderate. Significant destructive behaviour either affecting many of his/her own possessions or deliberately breaking others' possessions more than once e.g. punches holes in wall, rips books.<br>
3 = Severe. Major repeated destructive behaviour e.g. rips up clothes, breaks parents' possessions.<br>
4 = Very severe. Destructive behaviour that has serious consequences for the family or community e.g. fire setting that causes property damage, repeated out of control rages where young person smashes and throws objects.
!end of breakdown
!description
Aggressive and/or sadistic behaviour that could or does result in harm to other people or animals; socially or culturally sanctioned forms of aggression (e.g. hunting, killing insects) are not considered, unless they are conducted in an unusually sadistic manner (e.g. taking pleasure in pulling the wings off butterflies).  Use the Risk Assessment and Care Plan if this scores >1.
!end of description

!breakdown
0 = No problem - has not precipitated any physical conflict with others.<br>
1 = Mild  Gets into physical fights with others more frequently than is typical for his/her peer group.<br>
2 = Moderate. Aggressive or belligerent frequently (several times per week), or shows severe aggression, so that injury is likely, or shows overt physical aggression toward an adult, or cruelty to animals that does not result in major injury but is intentional.<br>
3 = Severe. Repeatedly so aggressive that others are injured (e.g. bloody nose, black eye), cannot be contained by normal limits and structures, is seen as a danger to others, or has intentionally seriously injured or  killed an  animal.<br>
4 = Very severe. Has seriously injured another person (e.g. broken bones, required medical attention) and continues to be out of control so that further incidents are likely; or, repeated deliberate killing of animals; or sadistic behaviour in which overtly enjoys causing  pain.
!end of breakdown
!description
Rate preoccupations, anxieties and behaviours that cause distress, conflict, or risk to the young person or others.  These may include acting out, such as promiscuity, abuse, or exhibitionism, or inhibitions, such as obsessive worrying about sexual matters or anxieties that inhibit social interactions.  Gender identity issues are not rated here unless accompanied by problematic sexual anxieties or behaviours.  Use the Risk Assessment and Care Plan if this scores >1
!end of description

!breakdown
0 = No problems - no concerns reported from young person or others.<br>
1 = Mild. Disturbing worries or doubts regarding sexual issues, repeated inappropriate sexual comments.<br>
2 = Moderate. Sexual issues cause significant distress and/or social problems, for example, anxieties or obsessions with sexuality interfere with social relationships, public masturbation, inappropriate sex play with peers.<br>
3 = Severe. Sexual behaviour which creates social or physical risks, e.g. promiscuous unprotected sex, exhibitionism.<br>
4 = Very severe. Extremely inappropriate sexual behaviour, such as rape, molestation with coercion.
!end of breakdown
!description
Presence of psychotic symptoms, such as Delusions (firmly held false beliefs held without objective evidence, often impossible or highly improbable.  Delusions are not affected by rational argument or evidence to the contrary, and are not a conventional belief in the context of the person's social or cultural background) or Hallucinations (any experience of objectively unrealistic perceptions, such as hearing, seeing, hallucinations of touch or smelling things that others do not, when NOT under the influence of intoxicating substances. Rate descriptively only, not based on presumed cause. Rate flashbacks only if they are experienced as real, rather than as intense memory.)
!end of description

!breakdown
0 = No problems involving psychotic symptoms. Distortions and misperceptions just before or after sleep that are not persistent or repeatedly disturbing are counted as normal.<br>
1 = Mild. Circumscribed delusions that do not affect daily behaviour, e.g. believes that dead grandmother is actually alive, in spite of having attended the funeral and many attempts to convince otherwise. Repeatedly distorts perceptions in ways that cause or fuel anxiety, e.g. sees frightening figures at dusk, interprets sounds as voices.<br>
2 = Moderate. Delusional beliefs affect behaviour, but impact is confined to a specific arena  e.g. believes she may contract syphilis from eating utensils, and will  only use disposable tableware. Persistently claims to hear or see things others cannot, e.g. flashbacks to traumatic experiences, but does not react or respond to hallucinations.<br>
3 = Severe. Delusional beliefs play a major role in daily behaviour, influencing behaviour, attitudes, and communication e.g. believes is the son of God and talks about this constantly to peers and adults.  Can be observed to be responding to apparent hallucinations, which interfere with normal functioning.<br>
4 = Very severe. Behaviour dominated by response to delusional beliefs, e.g. cannot leave own room for fear of persecution by enemies.  Vivid apparent hallucinations that cause distress, or issue destructive commands (e.g. suicidal or homicidal).
!end of breakdown
!description
Mood which is unusually 'high', 'giddy', manic, unrealistically happy, out of proportion to real events. Irritability associated with manic states is rated separately.
!end of description

!breakdown
0 = No problem. Normal range of mood; may be giddy/silly at times, but settles down age-appropriately in a serious situation.<br>
1 = Mild. Often silly or giddy, and has trouble settling down in serious setting.<br>
2 = Moderate. Seems markedly 'high', unrealistically optimistic, hard to focus on realistic plans and goals; this interferes with functioning in some areas.<br>
3 = Severe. Elated mood clearly interferes with functioning (e.g. stays up late at night working on projects and cannot stop, makes grandiose plans).<br>
4 = Very severe. Elated mood dominates behaviour and severely disrupts judgment and functioning (e.g. wildly excessive ideas and plans, racing thoughts, promiscuity, dramatic overspending, does not sleep for several days).
!end of breakdown
!description
The capacity the young person has to show sensitive recognition of other people's changing mental states and the effect these have upon their actions, or to reflect thoughtfully upon affective states of their own. When present, the young person demonstrates 'mind-mindedness', but when absent there may be callous, unemotional traits or an incapacity to tolerate frustration and affective states without resorting to defensive or displacement activities.
!end of description

!breakdown
0 = No problem. Shows mentalizing capacity appropriate to age - generally reflective, sensitive and tolerates frustrations - it is normal for mentalizing capacity to diminish at times of high affect or conflict.<br>
1 = Mild. Occasional lapses in capacity, when young person 'misreads' people in ways that stand out, but can generally 'correct' such errors.<br>
2 = Moderate. Frequently misreads people, or appears to react without sensitivity to the people around him/her.<br>
3 = Severe. Major difficulty in empathising with people, frequently overwhelmed by situations, struggles to reflect on what makes people act the way they do, or to manage emotional states without "acting out", etc.<br>
4 = Very severe. May appear callous or unemotional, assume that own thoughts actually represent reality rather than representations of reality, frequently acts-out, chronic failure of confiding relationships.<br>
!end of breakdown
!description
The extent to which the young person demonstrates an age-appropriate awareness and understanding of his/her problems/difficulties.
!end of description

!breakdown
0+ = Good. Fully acknowledges presence and extent of problems/difficulties, actively seeks insight and uses it constructively to overcome difficulties.<br>
0 = No problem. Generally acknowledges difficulties/problems.<br>
1 = Mild difficulties. Able to acknowledge problems/difficulties but not to full extent. <br>
2 = Significant difficulties. Marked difficulty acknowledging presence of problems/difficulties, minimises extent. <br>
3 = Major difficulties. Disputes/actively minimises presence of problem/difficulties. <br>
4 = Very severe. Completely unable to acknowledge presence of problem/difficulties.
!end of breakdown
!description
The extent to which the young person is successfully engaged in the development and carrying out of his or her treatment and care.
!end of description

!breakdown
0 = Good. Fully involved in assessment, planning and implementation of care. Works towards realistic personal goals; co-operative with procedures and assessments.<br>
1 = Mild. With support involved in assessment, planning and implementation of care at a level appropriate to age, but some reluctance/resistance to comply with care plan.  Co-operative in most but not all areas. <br>
2 = Moderate. Significant difficulties in engaging with treatment plan and/or formulating realistic age-appropriate goals. <br>
3 = Severe. Refusal to engage or passive compliance with many aspects of care. Cannot agree realistic age-appropriate goals.<br>
4 = Very severe. Will not comply with most aspects of treatment/care plan.  Refuses to/unable to engage in age-appropriate discussion of goals.
!end of breakdown
!description
The length of time the young person has experienced significant behavioural or emotional problems (not limited to the presenting problem)
!end of description

!breakdown
0 = No significant problems.<br>
1 = Problems present for less than one month.<br>
2 = Problems present for one month to six months.<br>
3 = Problems present for six months to four years.<br>
4 = Problems present for more than four years.
!end of breakdown
!description
The extent to which the major problems the young person presents are evident in multiple settings or domains of functioning e.g. family, education, psychological, physical, social-environmental.
!end of description

!breakdown
0 = No significant problems.<br>
1 =Occasional problems, confined to one setting or domain of functioning e.g. argues with parents about once a week, or anxious at school exams.<br>
2 =Regular problems in one setting or domain e.g. behaviour problems at home with parents and caretakers, but not at school, or conflicts at school and over homework at home, but not in other areas at home, or aggressive outbursts occur in the household of one parent, but not the other.<br>
3 =Problems are present in more than one setting/domain e.g. anxiety affects schoolwork and relationships with peers, defiance is present at home and school, young person is defiant with mother and anxious at school.<br>
4 =Problems are present in all or almost all settings and domains e.g. failing in school, depressed at home, isolated with peers.
!end of breakdown
!This is content from AMASS!
>//This is an example of a page that has been [[cloned and customised|Clone and Customise]] from the original work by the AMASS team in Islington - to whom we are immensely grateful.//

We have been trialling the use of the cards which have been adapted from the [[AIM]] as an assessment tool as part of the direct work/outreach work with the young person. 

We would like these cards to become part of our assessment process within the [[AMASS Intervention Timeline]] and have started to integrate this into the core process for every young person working with AMASS.

Our Assistant Psychologist has identified a potential framework for incorporating it as a collaborative assessment tool and an outcome measure. It uses the Focal Ranking system followed by the Global Ranking system (please see [[AIM suggested interventions]]). 

!!!!!Suggested Framework:

* Have AIM card session in week 6. This enables parallel of ratings weeks and parent work (completion of [[Genogram]], [[End Goals]], [[Desired Changes]]) but also means time has been invested into developing trust between young person and worker.

* Explain to young person that these cards are strengths/challenges/difficulties that young people face as part of growing up. The session is aimed at trying to identify what particular strengths/challenges/difficulties are most relevant to them.

*See video produced by the AMASS team in Islington (@ambit-amass) showing how the cards can be used in a session with a young person:

<html><iframe width="420" height="315" src="//www.youtube.com/embed/wG9Of1PCHPI" frameborder="0" allowfullscreen></iframe></html>

!!!!!Incorporation of Outcomes:

*A follow up session can reflect on what three/four cards the young person chose and this allows the worker and the young person to collaboratively discuss how to focus on these cards.

*The young person can rate the severity of the problem indicated on the card, how much it affects them using the numbers on the card.

*At the end of the intervention the AIM card session can be repeated and the ratings of the three/four cards can be compared from the pre-intervention AIM card session. 

*Ratings can also be taken more frequently within the intervention and the ratings profile can be plotted on a graph which can be shared and reflected on with the young person at the rating points and/or the end of intervention.


!!!!!Helpful Hints:

*BE FLEXIBLE: The framework can be adapted according to what suits the young person - (i.e. some young people may need to be doing another activity whilst the worker reads the cards and puts them in piles according to what the young person wants or the way in which the ranking happens may change according to young person's choice).

*LISTEN: The session allows an exploration of what the young person feels about themselves and any challenges/difficulties they are facing. You can explore and ask questions about what the young person talks brings to the session.

*COLLABORATION: The cards enable a [[Thinking Together]] process with the young person to plan for future sessions together and for the young person to feel part of the intervention/outreach process. 
!What does this license apply to?

This license applies to all written material relating to the [[AIM]] questionnaire which remains the copyright of the [[Authors of the AIM]].  

!!!!If you're reading this in the AIM's ''__//own website//__''...

(E.g. in @ambit-aim or at the address {{{http://ambit-aim.tiddlyspace.com/}}}) ...then it applies to everything except the technical material about @tiddlywiki and @tiddlyspace which is licensed separately (and more openly, see at the bottom of the page.)  

!!!!If you're reading this in ''__//another wiki//__'' 

(E.g. in which the AIM questionnaire has been embedded or "included") ...then this license __only relates to material connected with the AIM__ (the content in whatever other wiki this has been embedded in may be licensed separately!)  

Complicated, but simpler than it sounds...

!Released under license:

<html><a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-sa/3.0/88x31.png" /></a><br /><span xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/InteractiveResource" property="dct:title" rel="dct:type">AMBIT AIM - Adolescent Integrative Measure</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="http://ambit-aim.tiddlyspace.com" property="cc:attributionName" rel="cc:attributionURL">Schneider, Fonagy, Target, Bevington, Fuggle</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License</a>.<br />Permissions beyond the scope of this license may be available at <a xmlns:cc="http://creativecommons.org/ns#" href="http://annafreud.org" rel="cc:morePermissions">http://annafreud.org</a></html>.

!Summary of terms:

''You are free:''

* to Share — to copy, distribute and transmit the work
* to Remix — to adapt the work

''Under the following conditions:''

* ''Attribution'' — You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
* ''Noncommercial'' — You may not use this work for commercial purposes.
* ''Share Alike'' — If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.

''With the understanding that:''

* ''Waiver'' — Any of the above conditions can be waived if you get permission from the copyright holder.
* ''Public Domain'' — Where the work or any of its elements is in the public domain under applicable law, that status is in no way affected by the license.
* ''Other Rights'' — In no way are any of the following rights affected by the license:
** Your fair dealing or fair use rights, or other applicable copyright exceptions and limitations;
** The author's moral rights;
** Rights other persons may have either in the work itself or in how the work is used, such as publicity or privacy rights.

''Notice'' — For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to the Creative Commons webpage defining this licence, [[here|http://creativecommons.org/licenses/by-nc-sa/3.0/]].

!@@color(red):Software licensed separately@@

The software in which the AIM is recorded ([[TiddlyWiki]] and [[TiddlySpace]]) is a freely available 'Open Source' development, licensed separately under slightly different (more open) terms.  We gratefully acknowledge that its modification for this manual has been kindly supported in a non-commercial open-source collaboration by its inventor Jeremy Ruston and his colleagues (particularly Jonathon Lister) at [[BT Osmosoft|http://www.osmosoft.com/]].
<<AIMForm AIMFormViewTemplate AIM>>
!Welcome to the AIM
This is an interactive assessment (your results generate relevant links to material in the manual), that can be filled in on your computer and then the results can be exported and saved.

!!Learn
There are instructions below, or watch videos.  See [[AIM]] for more description.

A short rather low-fi clip demonstrating the AIM questionnaire in the AMBIT manual:
<html><object width="480" height="360"><param name="movie" value="//www.youtube.com/v/Tmpd98rXznE?hl=en_US&amp;version=3&amp;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="//www.youtube.com/v/Tmpd98rXznE?hl=en_US&amp;version=3&amp;rel=0" type="application/x-shockwave-flash" width="480" height="360" allowscriptaccess="always" allowfullscreen="true"></embed></object></html>  
This video, from an AMBIT Train the Trainer training, describes the [[AIM Cards]] first (a self-report version), but discusses the AMBIT AIM and demonstrates it from 8min:45sec:
<html><iframe width="640" height="360" src="//www.youtube.com/embed/aqgImbhoyOE" frameborder="0" allowfullscreen></iframe></html>


!!Confidentiality
''ALTHOUGH THE ASSESSMENT IS CONDUCTED IN YOUR WEB BROWSER, YOUR ANSWERS TO THE AIM QUESTIONS DO NOT LEAVE YOUR LOCAL COMPUTER'' (this is because the whole website is effectively downloaded and runs from within your local computer when you open the site.)

|bgcolor(pink):''As additional (non-mandatory) precautions (a) You may wish to check that you are NOT in the "Edit mode" (see explanation of how to do this this [[here|Edit mode]]) and (b) Do NOT use an identifiable NAME for the Unique ID''|

A 'paper' version of the AIM is also available to download [[Here|https://docs.google.com/Doc?docid=0AZh_CVBdhJPYZDZoMmdiNF80OTRnaHIzdDdnNA&hl=en_GB]].  

You can see [[Topics covered by the AIM - a checklist]] to help guide the assessment interview.
!What to do:
!! Please fill in these details:
|Unique ID (//not// name): |<<option txtAIM_ID>> |
|Date of assessment: |<<option txtAIM_date>> |
|Name of assessor: |<<option txtAIM_assessor>> |
#The PRACTITIONER SCORES this questionnaire, not the young person, though it can be done collaboratively.  (''NOTE:'' A self-report version presented as playing cards ([[AIM Cards]]) for use by a young person and their keyworker is under development.)
##During the initial assessment, score all 40 items.
##You may need to go back to the young person to gather more information.
##Aim to complete this within one week of first contact.
#"KEY PROBLEMS": These are limited to a maximum of SIX - this may require careful consideration.  
##Key problems are those that appear to be the most important TARGETS for intervention.
##They can act as your [[Goals-based outcome measures]].  
##These are things that the young person and family should help you identify.  Ultimately it is the practitioner's decision (a young person with psychosis may not agree that this is the case, for instance - which does not mean that treating this is not an important treatment goal to measure your outcomes against.)
#ONCE COMPLETED:
##At the end of this form (see "AIM Results") there are instructions on how to:
###Export the results to a database
###List and rank [[AIM suggested interventions]] according to the results of the specific AIM assessment.  These are useful, in addition to your SupervisoryStructures, to help you develop your [[Care Plan]], or as a problem/solution-focused pathway into the manual.  This function only works if your AIM is embedded in a treatment manual, not if you are accessing the AIM site as a separate resource. 
#Use for OUTCOMES
##When you start a specific intervention directed at a specific problem, use the relevant item(s) on the AIM to measure progress with the problem(s).
##When you end a complete treatment episode, re-score the KEY PROBLEMS to act as [[Goals-based outcome measures]].
Well done! You have completed the AIM, now...

!!1. Save and date this set of AIM results
Clicking on the "Export AIM" button, just below.  There are instructions on how to [[Get AIM data into a spreadsheet]]:

<<exportAIM>>

!!2. Sort and rank suggested interventions 
If you are using the AIM embedded within a treatment manual (such as AMBIT) then at the bottom of this page you will find the [[AIM suggested interventions]] function, which helps you to sort and rank suggested interventions in different ways, relating directly to your client's AIM scores.  This works if you complete and ENTIRE AIM assessment, or even if you only answer a handful of questions (or just one!) so it is a good way to get prompts for //what interventions does this young person need// rather than //"what interventions do I like doing"//.  If you are using the AIM as a standalone assessment (outside of it being embedded in a treatment TiddlyManual), then this is not available.

Many of the young people AMBIT is designed for have high levels of [[Complexity]] and [[Comorbidities]].  The AMBIT [[AIM]] assessment can help you sort and rank potentially useful interventions for problems identified.  See also WhichInterventionWhen for other advice on how to sequence what to do, or [[I'm stuck: what next?]] if you are at a more general impasse.

!!!NOT a mechanical "tick box" operation!
There are different ways to sort these suggestions, depending on whether you want to look at the whole spread of a young person's difficulties (''GLOBAL ranking''), or to focus on the most severe ones (''FOCAL ranking''), and whether you want to limit your attention just to the [[KeyProblems]].  There is more explanation of this at [[AIM suggested interventions]]. 

<<AIMResults tag:'AIM' type:'weighted'>>
You have selected more than six key problems, which is not allowed. Please go back and remove some if you want this to be a key problem.
/*{{{*/
var $ = jQuery;
config.macros.AIMForm = {
	categories: null,
	$activeItem: null,
	parseItemTitleRegex: new RegExp('(\\d\\d) (.*) - (.*)'),
	parseItemTitle: function(item) {
		// item.title is like "04 Young person daily life - Other talents and abilities"
		var regex = config.macros.AIMForm.parseItemTitleRegex,
			matches = regex.exec(item),
			tiddlerTitle = matches[0],
			number = matches[1],
			category = matches[2],
			label = matches[3],
			itemData = {
				tiddlerTitle: tiddlerTitle,
				number: number,
				category: category,
				label: label
			};
			return itemData;
	},
	loadItems: function(tag) {
		var items = store.getTaggedTiddlers(tag),
			aimIntro = store.getTaggedTiddlers('AIM-intro')[0],
			aimResults = store.getTaggedTiddlers('AIM-results')[0],
			$aimForm = $('#aimForm'),
			$aimMenu = $aimForm.children('ul'),
			htmlToAdd = ['<li class="category"><a href="#">'+aimIntro.title+'</a></li>\n'],
			itemData,
			category,
			categories = config.macros.AIMForm.categories;
		if(!categories) {
			categories = {};
			$.each(items, function(i, item) {
				itemData = config.macros.AIMForm.parseItemTitle(item.title);
				category = itemData.category;
				if(!categories[category]) {
					categories[category] = [];
				}
				categories[category].push(itemData);
			});
			config.macros.AIMForm.categories = categories;
		}
		$.each(categories, function(category, categoryItems) {
			categoryItems.done = true;
			$.each(categoryItems, function(j, item) {
				if(!item.value) {
					delete categoryItems.done;
				}
			});
		});
		$.each(categories, function(category, categoryItems) {
			var categoryClass = categoryItems.done ? ' class="category done"' : ' class="category"';
			htmlToAdd.push('<li'+categoryClass+'><a href="#">'+category+'</a>\n<ul>');
			$.each(categoryItems, function(i, item) {
				var itemClass = item.value ? (item.isKeyProblem ? ' class="done keyProblem"' : ' class="done"') : "";
				htmlToAdd.push('<li'+itemClass+'><a href="#">'+item.label+'</a></li>');
			});
			htmlToAdd.push('</ul>\n</li>');
		});
		htmlToAdd.push('<li><a href="#">'+aimResults.title+'</a></li>'),
		$aimMenu.html(htmlToAdd.join('\n'));
	},
	displayItem: function(tiddler, item) {
		var heading = item.number+" - "+item.label,
			description = store.getTiddlerText(tiddler.title+"##description"),
			breakdown = store.getTiddlerText(tiddler.title+"##breakdown"),
			bits = breakdown.split("<br>\n"),
			bitsRegex = new RegExp(/(\d\+?)/),
			content = wikifyStatic('!'+heading+"\n",null,tiddler) +
				"<p>" + wikifyStatic(description,null,tiddler) + 
				"</p>\n",
			breakdownPieces = [],
			existingValue = item.value,
			isKeyProblem = item.isKeyProblem,
			$item;
		$.each(bits, function(i, bit) {
			var matches = bitsRegex.exec(bit),
				value = matches && matches[1];
			if(value) {
				breakdownPieces.push('<div class="choice">\n' +
					'<input type="radio" value="'+value+'" name="question" class="choice" id="'+value+'" />\n' +
					'<label for="'+value+'">'+wikifyStatic(bit,null,tiddler)+'</label>\n' +
					'</div>');
			}
		});
		// add key problem checkbox
		breakdownPieces.push('<div class="choice">\n' +
			'<input type="checkbox" value="yes" name="key_problem" class="choice" id="key_problem" />\n' +
			'<label for="key_problem">Key problem?</label>\n' +
			'</div>');
		content += breakdownPieces.join('\n');
		$item = $('#aimForm div.question div.item');
		$item.next('div.error').remove();
		$item.html(content);
		if(existingValue) {
			$item.find('input[value="'+existingValue+'"]').attr('checked','checked');
		}
		if(isKeyProblem) {
			$item.find('input[type=checkbox]').attr('checked','checked');
		}
		$item.find('input[type=checkbox]').change(function(e) {
			var plugin = config.macros.AIMForm,
				keyProblemCount = plugin.keyProblemCount || 0;
			$item.next('div.error').remove();
			if(!$('#aimForm').find('div.item input[type=radio]:checked').length) {
				$('<div class="error">Please choose an option first</div>').insertAfter($item);
				this.checked = false;
				return true; // don't pay attention if there is no item selected
			}
			if(this.checked) {
				if(keyProblemCount>=6) { // this allows six to be selected
					$('<div class="error">'+store.getRecursiveTiddlerText('AIMFormKeyProblemErrorMessage', 'too many key problems selected', 0)+'</div>').insertAfter($item);
					this.checked = false;
				} else {
					plugin.keyProblemCount = ++keyProblemCount;
					// make the item active
					config.macros.AIMForm.$activeItem.addClass("keyProblem");
				}
			} else {
				plugin.keyProblemCount = --keyProblemCount;
				// make the item inactive
				config.macros.AIMForm.$activeItem.removeClass("keyProblem");
			}
		});
	},
	closeItem: function($activeItem) {
		if(!$activeItem || $activeItem.hasClass('category')) {
			return false;
		}
		var $openItem = $('#aimForm').find('div.item'),
			$selected = $openItem.find('input[type=radio]:checked'),
			value = $selected.val(),
			isKeyProblem = !!$openItem.find('input[type=checkbox]:checked').length,
			$uncheckedItems,
			item = config.macros.AIMForm.getItemFromElement($activeItem);
		if(value && item) {
			$activeItem.addClass("done");
			$uncheckedItems = $activeItem.siblings().filter(function() {
				return !$(this).hasClass("done");
			});
			if($uncheckedItems.length===0) {
				$activeItem.parent().parent().addClass("done");
			}
			item.value = value;
			item.isKeyProblem = isKeyProblem;
			// setOption("AIM_"+item.tiddlerTitle,value); - Do this if I want to save between sessions in cookies
		}
	},
	getItemFromElement: function($item) {
		var categories = config.macros.AIMForm.categories,
			category = $item.parent().parent().children('a').text(),
			items = categories[category],
			label = $item.children('a').text(),
			matchingItem;
		if(items) {		
			$.each(items, function(i, item) {
				if(item.label===label) {
					matchingItem = item;
					return false;
				}
			});
		}
		return matchingItem;
	},
	getAllItems: function() {
		var items = {};
		$.each(config.macros.AIMForm.categories, function(i, category) {
			$.each(category, function(j, item) {
				items[item.tiddlerTitle] = item;
			});
		});
		return items;
	},
	addBehaviour: function() {
		var $container = $('#aimForm'),
			$navArrows = $container.find('.navigation').find('a'),
			$categories = $container.children('ul').children('li'),
			$items = $categories.children('ul').children('li'),
			plugin = config.macros.AIMForm,
			$itemHolder = $container.find('div.question'),
			clickedPrev,
			openAimItem = function($item) {
				var item = config.macros.AIMForm.getItemFromElement($item),
					tiddler = store.getTiddler(item.tiddlerTitle);
				config.macros.AIMForm.displayItem(tiddler,item);
			},
			findToOpen = function(selector) {
				var move = $(selector).hasClass('next') ? 'next' : 'prev',
					$toOpen = plugin.$activeItem[move](),
					$newCategory;
				if($toOpen.length) {
					return $toOpen;
				} else {
					if(plugin.$activeItem.hasClass('category')) {
						$newCategory = plugin.$activeItem[move]();
					} else {
						$newCategory = plugin.$activeItem.parent().parent()[move](); // assumes a li inside a ul inside a li
					}
					if($newCategory.length) {
						return $newCategory;
					}
				}
			},
			toggleNavArrows = function() {
				$navArrows.each(function(i, arrow) {
					if(!findToOpen(arrow)) {
						$(arrow).css('visibility','hidden');
					} else {
						$(arrow).css('visibility','visible');
					}
				});
			};
	
		$navArrows.click(function() {
			if(!plugin.$activeItem) {
				return false;
			}
			var $toOpen = findToOpen(this);
			if($toOpen.length) {
				$toOpen.click();
			}
			return false;
		});
	
		$categories.click(function(e) {
			var openLast = false,
				$items = $(this).children('ul').children('li'),
				clickIndex = openLast ? $items.length-1 : 0,
				title,
				tiddler,
				content,
				$nextButton,
				$place = $('#aimForm div.question div.item');
			if($items.length) {
				$(this)
					.addClass('active')
					.children('ul')
					.show()
					.end()
					.siblings()
					.removeClass('active')
					.children('ul')
					.hide();
				$items.eq(clickIndex).click();
			} else {
				// it has no children, so it's probably the intro or results
				config.macros.AIMForm.closeItem(plugin.$activeItem);
				title = $(this).find('a').text();
				tiddler = store.getTiddler(title);
				plugin.$activeItem = $(this).addClass('active');
				plugin.$activeItem
					.siblings()
					.removeClass('active');
				/*content = wikifyStatic('!~'+tiddler.title+"\n",null,tiddler) +
					"<p>" + wikifyStatic(tiddler.text,null,tiddler) + 
					"</p>\n";*/
				//$('#aimForm div.question div.item').html(content);
				wikify('!~'+tiddler.title+"\n",$place.empty().get(0));
				wikify(tiddler.text, $place.get(0));
				/*if($('#aimForm input[option]').length) {
					$('#aimForm input[option]').change(function(e) {
						config.macros.option.genericOnChange.apply(this,arguments);
					});
				}*/
				toggleNavArrows();
			}
			return false;
		});
		
		$items.click(function(e) {
			config.macros.AIMForm.closeItem(plugin.$activeItem);
			plugin.$activeItem = $(this).addClass('active');
			plugin.$activeItem
				.siblings()
				.removeClass('active');
			openAimItem(plugin.$activeItem);
			toggleNavArrows();
			return false;
		});
		$categories.eq(0).click();
	},
	handler: function(place,macroName,params) {
		var template = params[0],
			tag = params[1];
		$(place).append(store.getTiddler(template).text);
		config.macros.AIMForm.loadItems(tag);
		config.macros.AIMForm.addBehaviour();
	}
};

/*}}}*/
<!--{{{-->
<div id="aimForm">
	<div class="navigation left">
		<a class="previous">Prev<span></span></a>
		<a class="next">Next<span></span></a>
	</div>
	<ul class="AIMmenu">
	</ul>
	<div class="question">
		<div class="item"></div>
		<div class="navigation">
			<a class="next">Next<span></span></a>
		</div>
	</div>
</div>
<!--}}}-->
/*{{{*/
var $ = jQuery;

config.macros.AIMResults = {
	setup: false,
	createResults: function(keyOnly) {
		var interventions = store.getTaggedTiddlers('Specific interventions'),
			relatedAIMitems,
			aimFormItems = config.macros.AIMForm.getAllItems(),
			interventionObj,
			results = [];
		$.each(interventions, function(i, intervention) {
			relatedAIMitems = store.getTaggedTiddlers(intervention.title);
			relatedAIMitems = $(relatedAIMitems).filter(function() {
				return aimFormItems[this.title];
			});
			relatedAIMitems.sort(function(a,b) {
				return aimFormItems[a.title].value < aimFormItems[b.title].value ? +1 : (aimFormItems[a.title].value === aimFormItems[b.title].value ? 0 : -1);
			});
			interventionObj = {
				name: intervention.title,
				AIMitems: []
			};
			$.each(relatedAIMitems, function(j, item) {
				var aimFormItem = aimFormItems[item.title];
				if(aimFormItem.value >= 2) {
					if(!keyOnly || aimFormItem.isKeyProblem) {
						interventionObj.AIMitems.push(item);
					}
				}
			});
			if(interventionObj.AIMitems.length>0) {
				results.push(interventionObj);
			}
		});
		return results;
	},
	onChange: function(e) {
		if(!$(e.target).hasClass('resultsRadio')) {
			return true;
		}
		var keyOnly = $('#AIMResultsContainer').find('input[type=checkbox]').attr('checked'),
			label = $('#AIMResultsContainer').find('input[type=radio]:checked').attr('id'),
			aimFormItems = config.macros.AIMForm.getAllItems(),
			$resultsContainer = $("#AIMResults").empty(),
			place = $resultsContainer.get(0),
			results = [],
			interventionLabel;
		results = config.macros.AIMResults.createResults(keyOnly);
		if(results.length===0) {
			$resultsContainer.append('no AIM items to show');
		} else {
			wikify('!!Intervention suggestions:', place);
			interventionLabel = config.macros.AIMResults.analyseResults(results, label);
			$.each(results, function(i, intervention) {
				var intCount = (intervention.count === Math.floor(intervention.count)) ? Math.floor(intervention.count) : intervention.count.toFixed(1),
					label = intervention.count === 1 ? interventionLabel.single : interventionLabel.multi,
					toWikify = '* [['+intervention.name+']] ('+intCount+' '+label+') <html><a class="revealItems" href="#" title="Click to view matching AIM items">View AIM items</a></html>\n';
				$.each(intervention.AIMitems, function(j, AIMitem) {
					toWikify += "** [["+AIMitem.title+"]] (rating "+aimFormItems[AIMitem.title].value+")\n";
				});
				wikify(toWikify, place);
			});
			$(place).find('a.revealItems').click(function() {
				$(this).closest('li').children('ul').toggle();
				return false;
			});
		}
	},
	analyseResults: function(results, label) {
		var interventionLabel,
			aimFormItems = config.macros.AIMForm.getAllItems();
		switch(label) {
			case "global_ranking":
				interventionLabel = {
					single:"AIM item",
					multi:"AIM items"
				};
				$.each(results, function(i, interventionObj) {
					interventionObj.count = interventionObj.AIMitems.length;
				});
				results.sort(function(a,b) {
					return a.AIMitems.length < b.AIMitems.length ? +1 : (a.AIMitems.length === b.AIMitems.length ? 0 : -1);
				});
				break;
			case "focal_ranking": // weighted algorithm
				interventionLabel = {
					single:"average score",
					multi:"average score"
				};
				$.each(results, function(i, interventionObj) {
					var AIMitems = interventionObj.AIMitems,
						count = 0;
					$.each(AIMitems, function(j, AIMitem) {
						var score = aimFormItems[AIMitem.title].value;
						count += parseInt(score,10);
					});
					interventionObj.count = count / AIMitems.length;
				});
				results.sort(function(a,b) {
					return a.count < b.count ? +1 : (a.count === b.count ? 0 : -1);
				});
				break;
			default:
				// do nothing
				break;
		}
		this.results = results;
		return interventionLabel;
	},
	setBehaviours: function() {
		if(this.setup) {
			return;
		}
		$("#aimForm").live('change',this.onChange);
		this.setup = true;
	},
	handler: function(place, macroName, params) {
		$("<p>Display the AIM's suggested interventions, sorted according to:</p>").appendTo(place);
		var $container = $('<div id="AIMResultsContainer"></div>').appendTo(place),
			createChoiceHtml = function(label, name, text, type) {
				return '<div class="choice"><input class="resultsRadio" type="'+type+'" name="'+name+'" id="'+label+'" /><label for="'+label+'">'+text+'</label></div>';
			};
		$(createChoiceHtml('global_ranking', 'algorithm_choice', '<strong>GLOBAL RANKING</strong> - each suggested intervention is ranked according to how many different problems (that is AIM items scoring greater than 2) the young person has which that particular intervention is relevant for. This is good for COVERING THE WHOLE SET OF PROBLEMS AND CAUSES.', 'radio'))
				.appendTo($container)
				.find('input')
				.get(0);
		$(createChoiceHtml('focal_ranking', 'algorithm_choice', '<strong>FOCAL RANKING</strong> - each suggested intervention is ranked in order of how SEVERE the set of problems are (their averaged AIM scores) that indicate that particular intervention. This is good for FOCUSING ON THE MOST SEVERE PROBLEMS.', 'radio'))
				.appendTo($container)
				.find('input')
				.get(0);
		$(createChoiceHtml('limit_ranking', 'limit', '<strong>LIMIT</strong> suggested interventions only to those relevant for items identified as KEY PROBLEMS.', 'checkbox'))
				.appendTo($container)
				.find('input')
				.get(0);
		$container.append('<br class="clearboth" /><div id="AIMResults"></div>');
		this.setBehaviours();
	}
};


/*}}}*/
/*{{{*/

/* =========================================== AIM Form */

#aimForm {
	background-color: #f4f4f4;
	position: relative;
	left: -160px;
	width: 694px;
	padding: 0px;
	font-family: 'PT Sans Caption', lucida sans, helvetica, arial, serif;
	font-size: 0.8em;
	line-height: 1.5em;
	overflow: hidden;
	position: relative;
}

#aimForm p, #aimForm ul {
	font-size: 1em;
}

#aimForm ul.AIMmenu a {
	border-bottom: none;
}

#aimForm ul.AIMmenu {
	margin:40px 0px 0px 0px;
	padding: 0px;
	font-weight: bold;
	width: 150px;
	float: left;
}

#aimForm ul.AIMmenu li ul {
	font-weight: normal;
	float: none;
	line-height: 1.3em;
	width: 145px;
	margin: 0px;
	padding: 5px 0px 10px 5px;
	border-left: 2px #e4e4e4 solid;
	border-bottom: 2px #e4e4e4 solid;
}

#aimForm ul.AIMmenu li {
	list-style: none;
	list-style-image: none;
}

#aimForm ul.AIMmenu li a {
	display: block;
	zoom: 1;
	padding: 3px 0px 3px 10px;
}

#aimForm ul.AIMmenu li.active a {
	background-color: #e4e4e4;
}

#aimForm ul.AIMmenu li ul {
	display: none;
}

#aimForm ul.AIMmenu li.active ul {
	display: block;
}

#aimForm ul.AIMmenu li.active ul a {
	background-color: transparent;
}

#aimForm ul.AIMmenu li ul li.active a {
	font-weight: bold;
}

#aimForm ul.AIMmenu li.done a {
	color:#3ABB00;
}

#aimForm .question {
	float: left;
	width: 464px;
	padding: 0px 60px 20px 20px;
	background-color: #e4e4e4;
}

#aimForm h3 {
	float: none;
	width: auto;
	text-align: left;
	padding: 0px;
	font-weight: normal;
	margin: 15px 0 20px;
	font-size: 1.4em;
}

#aimForm h4 {
	margin-left: 0px;
	font-weight: normal;
	margin-bottom: 20px;
	font-size: 1.2em;
	letter-spacing: 0.02em;
}

#aimForm .navigation {
	width: 150px;
	position: absolute;
	left: 10px;
	top: 15px;
	overflow: hidden;
}

#aimForm .question .navigation {
	position: relative;
	float: left;
	margin-bottom: 20px;
}

#aimForm .question input[type=radio], #aimForm .question input[type=checkbox] {
	float: left;
	width: 30px;
	clear:both;
}

#aimForm .question label {
	margin-bottom: 20px;
	float: left;
	width: 400px;
}

#aimForm .navigation a {
	background-color: #949494;
	display: block;
	position: relative;
	padding: 3px;
	/*width: 40px;*/
	width: auto;
	height: 10px;
	font-weight: bold;
	border: none;
	color: white;
	line-height: 11px;		
	cursor: pointer;
	float: left;
	margin-left: 10px;
}

#aimForm a.export {
	background-color: #949494;
	display: block;
	position: relative;
	padding: 3px;
	height: 10px;
	font-weight: bold;
	border: none;
	color: white;
	line-height: 11px;		
	cursor: pointer;
	float: left;
	margin-left: 0px;
	-moz-border-radius: 3px 0px 0px 3px;
	border-radius: 3px 0px 0px 3px;
}

#aimForm a.export span {
	position: absolute;
	top: 0px;
	width: 0px;
	height: 0px;
	display: block;
	line-height:0em;
	border-top: #e4e4e4 solid 8px;
	border-bottom: #e4e4e4 solid 8px;
	border-left: #949494 solid 8px;
	right: -8px;
}

#aimForm .navigation a.next {
	-moz-border-radius: 3px 0px 0px 3px;
	border-radius: 3px 0px 0px 3px;
	width: 36px;
}

#aimForm .navigation a.previous {
	-moz-border-radius: 0px 3px 3px 0px;
	border-radius: 0px 3px 3px 0px;
	text-align: right;
	padding-right: 4px;
	width: 36px;
}

#aimForm .navigation a span {
	position: absolute;
	top: 0px;
	width: 0px;
	height: 0px;
	display: block;
	line-height:0em;
	border-top: #f4f4f4 solid 8px;
	border-bottom: #f4f4f4 solid 8px;
}

#aimForm .navigation a.next span {
	border-left: #949494 solid 8px;
	right: -8px;
}

#aimForm .navigation a.previous span {
	border-right: #949494 solid 8px;
	left: -8px;
}

#aimForm .question .navigation a span {
	border-top: #e4e4e4 solid 8px;
	border-bottom: #e4e4e4 solid 8px;
}

#aimForm .question .navigation {
	top: 0px;
}

#aimForm .navigation a:hover {
	background-color: #333;
}

#aimForm .navigation a:hover span{
	border-left-color: #333;
	border-right-color: #333;
}

#aimForm .question ul {
	padding-left: 0px;
}

#aimForm .question ul li {
	margin-top: 5px;
}
#aimForm .question ul li ul {
	font-style: italic;
	font-size: 0.9em;
}
#aimForm .question ul li ul li {
	list-style-type: circle;
}

#AIMResults ul li ul {
	display: none; /* so it can be revealed */
}

#AIMResultsContainer .choice {
	clear: both;
}

/*}}}*/
/*{{{*/
config.macros.AMBITFormatterChanges = {

	init: function() {
		for(var i=0;i<formatter.formatters.length;i++)
		{
			if(formatter.formatters[i].name=="heading") //(say)
			{
				formatter.formatters[i].handler = function(w) {
					var headingCount = w.matchLength + 2;
					if(headingCount > 6) {
						headingCount = 6;
					}
					w.subWikifyTerm(createTiddlyElement(w.output,"h" + headingCount),this.termRegExp);
				};
			} else if(formatter.formatters[i].name=="table") {
				formatter.formatters[i]._handler = formatter.formatters[i].handler;
				formatter.formatters[i].handler = function(w) {
					var _output = w.output;
					w.output = createTiddlyElement(w.output, "div", null, "tableContainer");
					this._handler.apply(this,arguments);
					w.output = _output;
				};
			}
		}
	}
};
/*}}}*/
/*{{{*/
config.macros.footerSlider = {
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		var $ = jQuery,
			$sliderButton = $('<a class="slider button" title="Show or hide related information for this tiddler">show/hide related information</a>').appendTo(place),
			$topicsContainer = $("<div></div>")
				.appendTo(place)
				.css('display', 'none'),
			topicsElem = $topicsContainer.get(0);
		$sliderButton.click(function() {
			$topicsContainer.slideToggle();
		});
		config.macros.ambitTags.handler(topicsElem,"ambitTags",params,wikifier,paramString,tiddler);
		$topicsContainer.append("<br />");
		config.macros.ambitTagging.handler(topicsElem,"ambitTags",params,wikifier,paramString,tiddler);
		$topicsContainer.append("<br />");
	}
};

// based on tags macro
config.macros.ambitTags = {};
config.macros.ambitTags.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
	params = paramString.parseParams("anon",null,true,false,false);
	var ul = createTiddlyElement(place,"ul");
	var title = getParam(params,"anon","");
	if(title && store.tiddlerExists(title))
		tiddler = store.getTiddler(title);
	var sep = getParam(params,"sep"," ");
	var lingo = config.views.wikified.tag;
	if(tiddler.tags.length===0) {
		createTiddlyElement(ul,"li",null,null,"no topic");
	}
	for(var t=0; t<tiddler.tags.length; t++) {
		var tag = store.getTiddler(tiddler.tags[t]);
		if(!tag || !tag.tags.contains("excludeLists")) {
			createTagButton(createTiddlyElement(ul,"li"),tiddler.tags[t],tiddler.title);
			if(t<tiddler.tags.length-1)
				createTiddlyText(ul,sep);
		}
	}
};

// based on tagging macro
config.macros.ambitTagging = {};
config.macros.ambitTagging.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
	params = paramString.parseParams("anon",null,true,false,false);
	var ul = createTiddlyElement(place,"ul");
	var title = getParam(params,"anon","");
	if(title == "" && tiddler instanceof Tiddler)
		title = tiddler.title;
	var sep = getParam(params,"sep"," ");
	ul.setAttribute("title",config.macros.tagging.tooltip.format([title]));
	var tagged = store.getTaggedTiddlers(title);
	if(tagged.length===0) {
		createTiddlyElement(ul,"li",null,"listTitle","no topics");
	} else {
		for(var t=0; t<tagged.length; t++) {
			createTiddlyLink(createTiddlyElement(ul,"li"),tagged[t].title,true);
			if(t<tagged.length-1)
				createTiddlyText(ul,sep);
		}
	}
};

// newHere plugin - http://mptw.tiddlyspot.com/#NewHerePlugin
config.macros.newHere = {
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		wikify("<<newTiddler "+paramString+" tag:[["+tiddler.title+"]]>>",place,null,tiddler);
	}
};

config.macros.ambitRevisions = {
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		config.macros.toolbar.createCommand(place,"revisions",tiddler);
	}
};

config.macros.ambitReferences = {
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		config.macros.toolbar.createCommand(place,"references",tiddler);
	}
};

(function($) {
	$(document).bind('startup', function() {
		$('.panelToggle').live('click', function() {
			$(this)
				.toggleClass('open')
				.closest('.headingPanel')
				.find('.infoPanel')
				.slideToggle();
			return false;
		});
	});
}(jQuery))


config.macros.ambitElsewhere = {
	searchURL: '/search.json?q=title:"%0"',
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		var url = config.macros.ambitElsewhere.searchURL.format(encodeURIComponent(tiddler.title)),
			$ = jQuery;
		$.ajax({
			url: url,
			dataType: "json",
			success: function(tiddlers) {
				tiddlers = $.grep(tiddlers, function(t, i) {
					return t.bag.indexOf('ambit')!==-1 && t.bag!==tiddler.fields['server.bag'];
				});
				var count = tiddlers.length;
				$(place).prepend(count);
				if(count) {
					config.macros.ambitElsewhere.wrapWithElsewhereLink(place, tiddlers, tiddler);
				}
			},
			error: function() {
				$(place).prepend('(error)');
			}
		});
	},
	wrapWithElsewhereLink: function(place, tiddlers, tiddler) {
		var $ = jQuery;
		var $place = $(place)
			.wrap("<a></a>")
			.parent().click(function() {
				var popup = Popup.create(this),
					$ul,
					bag,
					space,
					diffURL = "diff?rev1=bags/"+tiddler.fields['server.bag']+"/"+encodeURIComponent(tiddler.title)+"/"+tiddler.fields['server.page.revision']+"&rev2=bags/<bag>/"+encodeURIComponent(tiddler.title)+"/<revision>&format=horizontal";
				if(popup) {
					$ul = $(popup).append("<ul></ul>");
					$.each(tiddlers, function(i, t) {
						bag = t.bag;
						space = bag.substring(0, bag.lastIndexOf('_')); // TO-DO: filter this so it is against a known list of spaces, rather than all the hundreds in TiddlySpace
						$ul.append('<li><a href="'+diffURL.replace("<bag>",bag).replace("<revision>",t.revision)+'" target="_blank">'+space+'</li>');
					});
				}
				Popup.show();
				return false;
			});
	}
};

/*}}}*/
/***
|''Name''|AmbitSearchPlugin|
|''Description''|based on SimpleSearchPlugin by FND|
|''Authors''|Jonathan Lister|
|''Version''|0.1|
|''Status''|stable|
|''Source''|http://ambit-plugins.tiddlyspace.com/AmbitSearchPlugin|
|''License''|[[MIT|http://www.opensource.org/licenses/mit-license.php]]|
|''Keywords''|search|

Note: this does not add styles - there are sample styles in http://ambit-theme.tiddlyspace.com/Stylesheet

!Code
***/
//{{{
if(!version.extensions.AmbitSearchPlugin) { //# ensure that the plugin is only installed once
version.extensions.AmbitSearchPlugin = { installed: true };

if(!config.extensions) { config.extensions = {}; }

var $ = jQuery;

config.extensions.AmbitSearchPlugin = {
	heading: "Search Results",
	containerId: "searchResults",
	btnCloseLabel: "close",
	btnCloseTooltip: "dismiss search results",
	btnCloseId: "search_close",
	btnOpenLabel: "Open all",
	btnOpenTooltip: "open all search results",
	btnOpenId: "search_open",

	displayResults: function(matches, query) {
		story.refreshAllTiddlers(true); // update highlighting within story tiddlers
		window.scrollTo(0,0);
		query = '"""' + query + '"""'; // prevent WikiLinks
		var $container = $('<div id="'+this.containerId+'"><div class="jbasewrap"><div class="overlay"></div></div></div>').insertAfter('#header'),
			el = $container.find('.overlay').get(0),
			msg = "!" + this.heading + "\n";
		if(matches.length > 0) {
			msg += "''" + config.macros.search.successMsg.format([matches.length.toString(), query]) + ":''\n";
			this.results = [];
			for(var i = 0 ; i < matches.length; i++) {
				this.results.push(matches[i].title);
				msg += "* [[" + matches[i].title + "]]\n";
			}
		} else {
			msg += "''" + config.macros.search.failureMsg.format([query]) + "''"; // XXX: do not use bold here!?
		}
		createTiddlyButton(el, this.btnCloseLabel, this.btnCloseTooltip, config.extensions.AmbitSearchPlugin.closeResults, "button", this.btnCloseId);
		createTiddlyButton(el, this.btnOpenLabel, this.btnOpenTooltip, config.extensions.AmbitSearchPlugin.openAll, "button", this.btnOpenId);
		wikify(msg, el);
		createTiddlyButton(el, this.btnCloseLabel, this.btnCloseTooltip, config.extensions.AmbitSearchPlugin.closeResults, "button", this.btnCloseId);
		createTiddlyButton(el, this.btnOpenLabel, this.btnOpenTooltip, config.extensions.AmbitSearchPlugin.openAll, "button", this.btnOpenId);
		$container.click(function(e) {
			if($(e.target).hasClass('tiddlyLink')) {
				config.extensions.AmbitSearchPlugin.closeResults();
			}
			return false;
		});
	},

	closeResults: function() {
		var el = document.getElementById(config.extensions.AmbitSearchPlugin.containerId);
		removeNode(el);
		config.extensions.AmbitSearchPlugin.results = null;
		highlightHack = null;
	},

	openAll: function(ev) {
		story.displayTiddlers(null, config.extensions.AmbitSearchPlugin.results);
		return false;
	}
};

// override Story.search()
Story.prototype.search = function(text, useCaseSensitive, useRegExp) {
	highlightHack = new RegExp(useRegExp ? text : text.escapeRegExp(), useCaseSensitive ? "mg" : "img");
	var matches = store.search(highlightHack, null, "excludeSearch"),
		q = useRegExp ? "/" : "'";
	config.extensions.AmbitSearchPlugin.displayResults(matches, q + text + q);
};

// override TiddlyWiki.search() to sort by relevance
TiddlyWiki.prototype.search = function(searchRegExp, sortField, excludeTag, match) {
	var candidates = this.reverseLookup("tags", excludeTag, !!match),
		primary = [],
		secondary = [],
		tertiary = [],
		t,
		results;
	for(t = 0; t < candidates.length; t++) {
		if(candidates[t].title.search(searchRegExp) != -1) {
			primary.push(candidates[t]);
		} else if(candidates[t].tags.join(" ").search(searchRegExp) != -1) {
			secondary.push(candidates[t]);
		} else if(candidates[t].text.search(searchRegExp) != -1) {
			tertiary.push(candidates[t]);
		}
	}
	results = primary.concat(secondary).concat(tertiary);
	if(sortField) {
		results.sort(function(a, b) {
			return a[sortField] < b[sortField] ? -1 : (a[sortField] == b[sortField] ? 0 : +1);
		});
	}
	return results;
};

} //# end of "install only once"
//}}}
//{{{
config.macros.ambitSetup = {
	settings: {
		tidTitle: "AmbitSetup",
		tidText: "Please do not edit this tiddler. It was created during setup."
	},
	dispatch: function() {
		if(config.extensions.tiddlyspace.currentSpace.type !== "private") {
			return;
		}
		var plugin = config.macros.ambitSetup,
			tidTitle = plugin.settings.tidTitle,
			tidText = plugin.settings.tidText;
		if(!store.getTiddler(tidTitle)) {
			story.closeAllTiddlers();
			story.displayTiddler(null,"GettingStarted");
		}
	}
};

config.macros.completeSetup = {
	onChange: function(tiddler) {
		var settings = config.macros.ambitSetup.settings,
			tidTitle = settings.tidTitle,
			tidText = settings.tidText,
			tid = store.saveTiddler(tidTitle,tidTitle,tidText,null,null,null,config.defaultCustomFields);
		autoSaveChanges(null, [tid]);
		story.closeTiddler(tiddler.title);
		story.displayDefaultTiddlers();
	},
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		createTiddlyButton(place, "complete setup", "click to complete setup", function() {
			config.macros.completeSetup.onChange(tiddler);
		});
	}
};

jQuery(document).bind("startup", config.macros.ambitSetup.dispatch);
//}}}
I am also tagged differently

!heading 3
!!heading 4
!!!heading 5
!!!!heading 6
!!!!!heading 6
!!!!!!heading 6

!Welcome
The manual is not just a text that you read from cover to cover but something you refer in order to find something out or get something done.  It is something you ''//use//'' rather than just read. Just as getting to know a person takes a while, so getting to know your way around this manual is not instant.  Look at the Contents menu on the right to get an idea of what is in here.

!Work in Progress
The content of this manual and its layout is continually being updated and improved (your [[Feedback please!]] will help this.)  We see this as a working document, not a product set in stone; feedback helps us to improve its shape and coherence.  If needed (e.g. for formal intervention trials) it is possible to separate out a 'fixed' version.  You can keep a track of recent changes (last 21 days) in content here: <<recentChanges 21>>

Now, before anything else you need to be clear here and now:
!!!What am I here for?
What is your //intention// in visiting this manual right now? How long do you have available to spend doing this? How will you know if and when you have got what you came for?


!Starting points

1. there is advice on how to [[Find your way around]]. 
2. How this software works [[Understanding TiddlyManual format]] - you dont need to be a techno-wizard to use this, but knowing how to do basic things, and having a basic understanding of how tiddlymanuals work to marry 'top-down' or centrally-curated material with bottom-up or locally-curated material is a help. 
3. [[Videos]] - There is also a collection of streaming videos (you must be online to access the streaming content) that illustrate a range of therapy techniques (these are being added to quite regularly, so check back occasionally.)
  
!Follow your tracks

In the original site, you use the [[Breadcrumbs trail]] below the site title to remember where you have been (think of it as a trail of clickable breadcrumbs that you leave as you travel around the material).  In the NEW THEME, you use the history widget on the right sidebar to record your journey through the material.

!Mark the Task

Use the content and links at [[Start here: Mark the task]], which shows how to use the manual in a purposeful way rather than just browsing it. 

!Introduction 
Read the links shown in the drop down menu under the Introduction button on the home page (above in the old version, on the right sidebar in the NEW THEME.

!Help improve this

See [[Feedback please!]] for how to give feedback on what you like and more particularly what you do //not// like.

!Some slides and video:
Slides explaining the way a tiddlymanual can marry centrally-curated 'evidence-based practice' in the same place as locally-curated 'practice-based evidence':

<html><iframe src="https://docs.google.com/present/embed?id=d6h2gb4_693frqwcjzk&autoStart=true&loop=true&size=m" frameborder="0" width="555" height="451"></iframe></html>

Dickon Bevington addressing a conference at UCL in 2008, explaining the idea of TiddlyManuals.  Apologies for quality.

<html><object width="400" height="297"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=3922545&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=3922545&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="297"></embed></object></html>
<html><object width="400" height="297"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=3922602&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=3922602&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="297"></embed></object></html>
<html><object width="400" height="297"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=3922712&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=3922712&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="297"></embed></object></html>




 
I am also tagged
The AIM is derived from the Hampstead Child Adaptation Measure, which was originally authored by: 
*Tiffany Schneider
*Mary Target
*Peter Fonagy 

It was subsequently adapted (significantly shortened, minor alterations to questions) by:
*Dickon Bevington and 
*Peter Fuggle.

All the authors can be contacted via the [[Anna Freud Centre|http://annafreud.org]].
!SpaceUnplugged
{{unpluggedSpaceTab{
{{wizard{
<<image unsyncedIcon width:48>> Sync is currently unavailable in ~TiddlyWiki due to security constraints in modern browsers. Research is being done to build a suitable alternative. In the meantime if you have changed content in an offline ~TiddlyWiki, you can get your content back into ~TiddlySpace by using the ''import'' functionality from the backstage of the online wiki.
}}}
}}}

!Menu
<<message messages.memberStatus>> <<homeLink>>
{{unsyncedList{<<message messages.syncListHeading>> <<list filter [is[unsynced]]>>}}}

running TiddlySpace@glossary version <<message extensions.tiddlyweb.status.tiddlyspace_version>>
{{autotable{
<<tiddler Backstage##Resources>>
}}}

!Resources
[[blog|@@blog]] [[documentation|@@docs]] [[featured spaces|@@featured]] 

!ImportExport
<<fileImport>>
You can download this TiddlySpace as an offline TiddlyWiki:

{{chunkyButton{<<exportSpace>>}}}

!BackstageTiddlers
|upload a <<message messages.privacySetting>> file: <<binaryUpload>>|<<closeAll>><<permaview>><<newTiddler>><<newJournal "DD MMM YYYY" "journal">><<saveChanges>>|
|>|<<search>>|
|>|<<tiddler Backstage##Tiddlers>>|

!Tiddlers
<<tabs
	txtMainTab
	"Recent" "Recently edited tiddlers" TabTimeline
	"All" "All tiddlers" TabAll
	"Public" "All public tiddlers" [[TiddlySpaceTabs##Public]]
	"Private" "All private tiddlers" [[TiddlySpaceTabs##Private]]
	"Tags" "All tags" TabTags
	"Spaces" "Tiddlers grouped by space" [[TiddlySpaceTabs##Spaces]]
	"Missing" "Missing tiddlers" TabMoreMissing
	"Orphans" "Orphaned tiddlers" TabMoreOrphans
	"Shadows" "Shadowed tiddlers" TabMoreShadowed
>>

!BatchOps
<<tabs
	txtPublisherTab
	"Private" "Move tiddlers from private to public" Backstage##BatchPrivate
	"Public" "Move tiddlers from public to private" Backstage##BatchPublic
>>

!BatchPrivate
<<TiddlySpacePublisher type:private>>

!BatchPublic
<<TiddlySpacePublisher type:public>>

!Plugins
''Note:'' Many of these plugins are core TiddlySpace plugins and cannot be changed unless first cloned.

<<tiddler PluginManager>>

!Tweaks
These options change behavior in TiddlyWiki //only// and may be ineffective in TiddlySpace.

<<tiddler AdvancedOptions>>
/***
|''Name''|BinaryTiddlersPlugin|
|''Description''|renders base64-encoded binary tiddlers as images or links|
|''Author''|FND|
|''Version''|0.3.2|
|''Status''|@@beta@@|
|''Source''|http://svn.tiddlywiki.org/Trunk/association/plugins/BinaryTiddlersPlugin.js|
|''License''|[[BSD|http://www.opensource.org/licenses/bsd-license.php]]|
|''CoreVersion''|2.5|
!Code
***/
//{{{
(function($) {

"use strict";

var ctfield = "server.content-type";

var plugin = config.extensions.BinaryTiddlersPlugin = {
	isWikiText: function(tiddler) {
		var ctype = tiddler.fields[ctfield];
		if(ctype) {
			if (ctype === 'text/x-tiddlywiki') {
				return true;
			}
			return !this.isBinary(tiddler) && !this.isTextual(ctype);
		} else {
			return true;
		}
	},
	// NB: pseudo-binaries are considered non-binary here
	isBinary: function(tiddler) {
		var ctype = tiddler.fields[ctfield];
		return ctype ? !this.isTextual(ctype) : false;
	},
	isTextual: function(ctype) {
		return ctype.indexOf("text/") === 0
			|| this.endsWith(ctype, "+xml")
			|| ctype === 'application/json'
			|| ctype === 'application/javascript';
	},
	endsWith: function(str, suffix) {
		return str.length >= suffix.length &&
			str.substr(str.length - suffix.length) === suffix;
	},
	isLink: function(tiddler) {
		return this.isBinary(tiddler) && tiddler.text.indexOf("<html>") !== -1;
	}
};

// Disable edit for linked tiddlers (for now)
// This will be changed to a GET then PUT
config.commands.editTiddler.isEnabled = function(tiddler) {
    var existingTest = config.commands.editTiddler.isEnabled;
    if (existingTest) {
        return existingTest && !plugin.isLink(tiddler);
    } else {
        return !plugin.isLink(tiddler);
    }
};

// hijack text viewer to add special handling for binary tiddlers
var _view = config.macros.view.views.wikified;
config.macros.view.views.wikified = function(value, place, params, wikifier,
		paramString, tiddler) {
	var ctype = tiddler.fields["server.content-type"];
	if(params[0] === "text" && ctype && ctype !== 'text/x-tiddlywiki' &&
			!tiddler.tags.contains("systemConfig") && !plugin.isLink(tiddler)) {
		var el;
		if(plugin.isBinary(tiddler)) {
			var uri = "data:%0;base64,%1".format([ctype, tiddler.text]); // TODO: fallback for legacy browsers
			if(ctype.indexOf("image/") === 0) {
				el = $("<img />").attr("alt", tiddler.title).attr("src", uri);
			} else {
				el = $("<a />").attr("href", uri).text(tiddler.title);
			}
		} else {
			el = $("<pre />").text(tiddler.text);
		}
		el.appendTo(place);
	} else {
		_view.apply(this, arguments);
	}
};

// hijack edit macro to disable editing of binary tiddlers' body
var _editHandler = config.macros.edit.handler;
config.macros.edit.handler = function(place, macroName, params, wikifier,
		paramString, tiddler) {
	if(params[0] === "text" && plugin.isBinary(tiddler)) {
		return false;
	} else {
		_editHandler.apply(this, arguments);
	}
};

// hijack autoLinkWikiWords to ignore binary tiddlers
var _autoLink = Tiddler.prototype.autoLinkWikiWords;
Tiddler.prototype.autoLinkWikiWords = function() {
	return plugin.isWikiText(this) ? _autoLink.apply(this, arguments) : false;
};

}(jQuery));
//}}}
/***
|''Name''|BinaryUploadPlugin|
|''Version''|0.3.16|
|''Author''|Ben Gillies and Jon Robson|
|''Type''|plugin|
|''Source''|http://github.com/TiddlySpace/tiddlyspace/raw/master/src/plugins/BinaryUploadPlugin.js|
|''Description''|Upload a binary file to TiddlyWeb|
|''CoreVersion''|2.6.1|
|''Requires''|TiddlySpaceConfig TiddlyWebConfig|
!Usage
{{{
<<binaryUpload bag:<name> edit:tags edit:title tags:<default tags> title:<title> >>
}}}
* {{{bag:<name>}}}: optional; if left out, the file will be saved to the current workspace
* {{{edit:tags}}}: specifies that you want to tag the file being uploaded
* {{{edit:title}}}: specifies that you want to set the title to something other than the filename
* {{{tags:<default tags>}}}: specifies a default set of tags to apply to the file (requires {{{edit:tags}}} to be set)
* {{{title:<title>}}}: predefines the title of the binary tiddler
!Requires
TiddlyWeb
tiddlywebplugins.form
!Code
***/
//{{{
(function($) {

var tiddlyspace = config.extensions.tiddlyspace;

var macro = config.macros.binaryUpload = {
	locale: {
		titleDefaultValue: "Please enter a title...",
		tagsDefaultValue: "Please enter some tags...",
		titlePrefix: "title: ",
		tagsPrefix: "tags: ",
		loadSuccess: 'Tiddler %0 successfully uploaded',
		loadError: "An error occurred when uploading the tiddler %0",
		uploadInProgress: "Please wait while the file is uploaded...",
		membersOnly: "Only members can upload."
	},
	renderInputFields: function(container, options) {
		var locale = macro.locale;
		var editableFields = options.edit;
		var includeFields = {
			tags:  editableFields && editableFields.contains("tags") ? true : false,
			title: editableFields && editableFields.contains("title") ? true : false
		};
		var fields = ["title", "tags"];
		for(var i = 0; i < fields.length; i++) {
			var fieldName = fields[i];
			var userDefault = options[fieldName];
			var defaultValue = userDefault ? userDefault[0] : false;
			if(includeFields[fieldName] || defaultValue) {
				var localeDefault = locale["%0DefaultValue".format(fieldName)];
				var className = defaultValue ? "userInput" : "userInput notEdited";
				var inputEl;
				var val = defaultValue || localeDefault || "";
				var iContainer = $("<div />").addClass("binaryUpload%0".format(fieldName)).
					appendTo(container);
				if(defaultValue && !includeFields[fieldName]) {
					var label = locale["%0Prefix".format(fieldName)];
					$("<span />").text(label).appendTo(iContainer);
					$("<span />").addClass("disabledInput").text(val).appendTo(iContainer);
					inputEl = $("<input />").attr("type", "hidden");
				} else {
					inputEl = $("<input />").attr("type", "text");
				}
				inputEl.attr("name", fieldName).
					addClass("%0Edit".format(fieldName)).
					val(val).addClass(className).appendTo(iContainer);
			}
		}
	},
	getTiddlerName: function(fileName) {
		var fStart = fileName.lastIndexOf("\\");
		var fStart2 = fileName.lastIndexOf("/");
		fStart = fStart < fStart2 ? fStart2 : fStart;
		fileName = fileName.substr(fStart+1);
		return fileName;
	},
	errorHandler: function(fileName) {
		displayMessage("upload of file %0 failed".format(fileName));
	},
	uploadFile: function(place, baseURL, workspace, options) {
		var pleaseWait = $(".uploadProgress", place);
		var iframeName = options.target;
		var form = $("form", place);
		var existingVal = $("input[name=title]", form).val();
		var fileName = existingVal || $('input:file', form).val();
		if(!fileName) {
			return false; // the user hasn't selected a file yet
		}
		fileName = macro.getTiddlerName(fileName);
		$("input[name=title]", place).val(fileName);
		// we need to go somewhere afterwards to ensure the onload event triggers
		var redirectTo = "/%0/tiddlers.txt?select=title:%1".
			format(workspace, fileName);
		var token = tiddlyspace ? tiddlyspace.getCSRFToken() : "";
		var action = "%0?csrf_token=%1&redirect=%2"
			.format(baseURL, token, redirectTo);
		form[0].action = action; // dont use jquery to work with ie
		form[0].target = iframeName;
		// do not refactor following line... won't work in IE6 otherwise
		$(place).append($('<iframe name="' + iframeName + '" id="' + iframeName + '"/>').css('display','none'));
		macro.iFrameLoader(iframeName, function() {
			var content = document.getElementById(iframeName).contentWindow.document.documentElement;
			if($(content).text().indexOf(fileName) > -1) {
				options.callback(place, fileName, workspace, baseURL);
			} else {
				macro.errorHandler(fileName);
			}
			form.show(1000);
			pleaseWait.hide(1000);
		});
		form.hide(1000);
		pleaseWait.show(1000);
		return true;
	},
	createUploadForm: function(place, options) {
		var locale = macro.locale;
		if(readOnly) {
			$('<div class="annotation" />').text(locale.membersOnly).
				appendTo(place);
			return;
		}
		var bag = options.bag;
		options.callback = options.callback ? options.callback :
			function(place, fileName, workspace, baseurl) {
				macro.displayFile(place, fileName, workspace);
				displayMessage(locale.loadSuccess.format(fileName));
				$("input[type=text]", place).val("");
			};
		var defaults = config.defaultCustomFields;
		place = $("<div />").addClass("container").appendTo(place)[0];
		var workspace = bag ? "bags/%0".format(bag) : config.defaultCustomFields["server.workspace"];
		var baseURL = defaults["server.host"];
		baseURL += (baseURL[baseURL.length - 1] !== "/") ? "/" : "";
		baseURL = "%0%1/tiddlers".format(baseURL, workspace);
		//create the upload form, complete with invisible iframe
		var iframeName = "binaryUploadiframe%0".format(Math.random());
		// do not refactor following line of code to work in IE6.
		var form = $('<form action="%0" method="POST" enctype="multipart/form-data" />'.
					format(baseURL)).addClass("binaryUploadForm").
			appendTo(place)[0];
		macro.renderInputFields(form, options);
		$(form).
			append('<div class="binaryUploadFile"><input type="file" name="file" /></div>').
			append('<div class="binaryUploadSubmit"><input type="submit" value="Upload" disabled /></div>').
			submit(function(ev) {
				this.target = iframeName;
				options.target = iframeName;
				macro.uploadFile(place, baseURL, workspace, options);
			})
			.find('[type="file"]').bind('change', function() {
				$(form).find('[type="submit"]').prop('disabled', false);
			}).end();
		$('<div />').addClass("uploadProgress").text(locale.uploadInProgress).hide().appendTo(place);
		$("input[name=file]", place).change(function(ev) {
			var target = $(ev.target);
			var fileName = target.val();
			var title = $("input[type=text][name=title]", place);
			if(!title.val()) {
				title.val(fileName);
			}
		});
	},
	handler: function(place, macroName, params, wikifier, paramString, tiddler) {
		params = paramString.parseParams(null, null, true);
		macro.createUploadForm(place, params[0]);
	},
	iFrameLoader: function(iframeName, callback) {
		var iframe = document.getElementById(iframeName); //jQuery doesn't seem to want to do this!?
		var locale = macro.locale;
		$(".userInput").addClass("notEdited"); // reset editing
		var finishedLoading = function() {
			callback();
		};
		var iFrameLoadHandler = function() {
			finishedLoading.apply();
			return;
		};

		iframe.onload = iFrameLoadHandler;
		//IE
		completeReadyStateChanges = 0;
		iframe.onreadystatechange = function() {
			if (++(completeReadyStateChanges) == 3) {
				iFrameLoadHandler();
			}
		};
	},
	displayFile: function(place, title, workspace) {
		var adaptor = store.getTiddlers()[0].getAdaptor();
		var context = {
			workspace: workspace,
			host: config.defaultCustomFields['server.host']
		};
		adaptor.getTiddler(title, context, null, function(context) {
			if(context.status) {
				store.addTiddler(context.tiddler);
				story.displayTiddler(place, title);
				var image = config.macros.image;
				if(image && image.refreshImage) {
					image.refreshImage("/%0/tiddlers/%1".format(workspace, title));
					image.refreshImage(title);
					image.refreshImage("/%0".format(title));
					image.refreshImage("%0/%1/tiddlers/%2".format(config.extensions.tiddlyweb.host, workspace, title));
				}
			} else {
				displayMessage(macro.locale.loadError.format(title));
			}
		});
	}
};

if(tiddlyspace) {
	config.macros.binaryUploadPublic = {
		handler: function(place, macroName, params, wikifier, paramString, tiddler) {
			var options = paramString.parseParams(null, null, true)[0];
			var bag = tiddlyspace.getCurrentBag("public");
			options.bag = bag;
			macro.createUploadForm(place, options);
		}
	};
	config.messages.privacySetting = config.options.chkPrivateMode ?
		"private" : "public";
	config.macros.binaryUpload.defaultWorkspace = tiddlyspace.
		getCurrentWorkspace(config.messages.privacySetting);
}

})(jQuery);
//}}}
Overwriting BreadcrumbsPlugin in @ambit-plugins
/*{{{*/
(function($) {
	var $tiddlerDisplay,
		origPos,
		origZIndex;
	$(document).bind("startup", function() {
		$tiddlerDisplay = $('#tiddlerDisplay');
		origPos = $tiddlerDisplay.css('position');
		origZIndex = $tiddlerDisplay.css('zIndex');
		$tiddlerDisplay.hover(function() {
			$tiddlerDisplay.css({
				'position': 'relative',
				'zIndex': 1
			});
		}, function() {
			$tiddlerDisplay.css({
				'position': origPos,
				'zIndex': origZIndex
			});
		});
	});

}(jQuery));
/*}}}*/
/*{{{*/
function createTiddlyButtonButton(parent,text,tooltip,action,className,id,accessKey,attribs) {
		
		var btn = document.createElement("button");
		btn.setAttribute("type", "button");
		if(tooltip)
			btn.setAttribute("title",tooltip);
		if(text)
			btn.appendChild(document.createTextNode(text));
		btn.className = className || "";
		if(id)
			btn.id = id;
		if(attribs) {
			for(var i in attribs) {
				btn.setAttribute(i,attribs[i]);
			}
		}
		if(parent)
			parent.appendChild(btn);
		if(action) {
			jQuery(btn).click(action);
		}
		if(accessKey)
			btn.setAttribute("accessKey",accessKey);
		return btn;
}

config.macros.buttonPermaviewMacro = {
	handler: function(place, macroName, params) {
		var tooltip = "Click this button to generate a link in the address bar that will open exactly what is open in your manual right now";
		createTiddlyButtonButton(place, this.label, tooltip, this.onClick);
	},
	label: "snapshot",
	onClick: config.macros.permaview.onClick
};
/*}}}*/
<!--{{{-->
<h2><!--<<view title>>--></h2>
<!--<<view text wikified>>-->
<hr/>
<!--}}}-->
<!--{{{-->
<h1 style="page-break-before:always"><!--<<view title>>--></h1>
<!--<<view text wikified>>-->
<!--}}}-->
/***
|Name:|CloseOnCancelPlugin|
|Description:|Closes the tiddler if you click new tiddler then cancel. Default behaviour is to leave it open|
|Version:|3.0.1 ($Rev: 3861 $)|
|Date:|$Date: 2008-03-08 10:53:09 +1000 (Sat, 08 Mar 2008) $|
|Source:|http://mptw.tiddlyspot.com/#CloseOnCancelPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License:|http://mptw.tiddlyspot.com/#TheBSDLicense|
***/
//{{{
merge(config.commands.cancelTiddler,{

	handler_mptw_orig_closeUnsaved: config.commands.cancelTiddler.handler,

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

});

//}}}
/*{{{*/
Background: #f3f1e1
Foreground: #1d1b0b
PrimaryPale: #f7f5e9
PrimaryLight: #d0c581
PrimaryMid: #8d8134
PrimaryDark: #25220d
SecondaryPale: #eae9f7
SecondaryLight: #8681d0
SecondaryMid: #3a348d
SecondaryDark: #0f0d25
TertiaryPale: #e9eef7
TertiaryLight: #819bd0
TertiaryMid: #34528d
TertiaryDark: #0d1525
Error: #f88
ColorPaletteParameters: HSL([52|12], [0.45628478345702017],[0.1|0.3809564505878674|0.6619129011757348|0.9428693517636021])
/*}}}*/
Core Templates refer to the broader templates that are made available for new teams planning to work to AMBIT principles to download and start off with.  

At this early stage there is only one Core Template.

In due course, a differentiated array of Core Templates should be available - with basic adaptations attuned for:
*Different target groups
*Different geographic settings
*Different cultural milieux.
These differentiated Core Templates will be [[TeamTemplate]]s that have been adapted and evaluated so that their target group, and local details will be available alongside the outcome data.
[[Instructions/Welcome]]
[[AIM Form]]
[[AIMFormViewTemplate]]
[[AIMResultsMacro]]
[[AIMFormMacro]]
[[ExportAIMMacro]]
[[AIMStyleSheet]]

!AIM links
click me: <<tag AIM>>
Intro: [[AIM-Introduction]]
Results: [[AIM-Results]]
Export instructions: [[ExportAIMInstructions]]

<<newTiddler>>
/***
|''Name''|DiffFormatter|
|''Description''|highlighting of text comparisons|
|''Author''|FND|
|''Version''|0.9.0|
|''Status''|beta|
|''Source''|http://svn.tiddlywiki.org/Trunk/contributors/FND/formatters/DiffFormatter.js|
|''CodeRepository''|http://svn.tiddlywiki.org/Trunk/contributors/FND/|
|''License''|[[BSD|http://www.opensource.org/licenses/bsd-license.php]]|
|''Keywords''|formatting|
!Description
Highlights changes in a unified [[diff|http://en.wikipedia.org/wiki/Diff#Unified_format]].
!Notes
Based on Martin Budden's [[DiffFormatterPlugin|http://svn.tiddlywiki.org/Trunk/contributors/MartinBudden/formatters/DiffFormatterPlugin.js]].
!Usage
The formatter is applied to blocks wrapped in <html><code>{{{diff{..}}}</code></html> within tiddlers tagged with "diff".
!Revision History
!!v0.9 (2010-04-07)
* initial release; fork of DiffFormatterPlugin
!StyleSheet
.diff { white-space: pre; font-family: monospace; }
.diff ins, .diff del { display: block; text-decoration: none; }
.diff ins { background-color: #dfd; }
.diff del { background-color: #fdd; }
.diff .highlight { background-color: [[ColorPalette::SecondaryPale]]; }
!Code
***/
//{{{
(function() {

config.shadowTiddlers.StyleSheetDiffFormatter = store.getTiddlerText(tiddler.title + "##StyleSheet");
store.addNotification("StyleSheetDiffFormatter", refreshStyles);

var formatters = [{
		name: "diffWrapper",
		match: "^\\{\\{diff\\{\n", // XXX: suboptimal
		termRegExp: /(.*\}\}\})$/mg,
		handler: function(w) {
			var el = createTiddlyElement(w.output, "div", null, "diff");
			w.subWikifyTerm(el, this.termRegExp);
		}
	}, {
		name: "diffRange",
		match: "^(?:@@|[+\\-]{3}) ",
		lookaheadRegExp: /^(?:@@|[+\-]{3}) .*\n/mg,
		handler: function(w) {
			createTiddlyElement(w.output, "div", null, "highlight").
				innerHTML = "&#8230;";
			this.lookaheadRegExp.lastIndex = w.matchStart;
			var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
			if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
				w.nextMatch = this.lookaheadRegExp.lastIndex;
			}
		}
	}, {
		name: "diffAdded",
		match: "^\\+",
		termRegExp: /(\n)/mg,
		handler: function(w) {
			var el = createTiddlyElement(w.output, "ins", null, "added");
			w.subWikifyTerm(el, this.termRegExp);
		}
	}, {
		name: "diffRemoved",
		match: "^-",
		termRegExp: /(\n)/mg,
		handler: function(w) {
			var el = createTiddlyElement(w.output, "del", null, "removed");
			w.subWikifyTerm(el, this.termRegExp);
		}
	}
];

config.parsers.diffFormatter = new Formatter(formatters);
config.parsers.diffFormatter.format = "diff";
config.parsers.diffFormatter.formatTag = "diff";

})();
//}}}
<!--{{{-->
<div class="paperSheet editMode">
<div class='editToolbar'
	macro='toolbar [[ToolbarCommands::EditToolbar]] icons:yes'>
</div>
<div class='heading editorHeading'>
	<div class='editor title' macro='edit title'></div>
	<div class='tagClear'></div>
</div>
<div class='annotationsBox' macro='annotations'>
	<div class='editSpaceSiteIcon'
		macro='tiddlerOrigin height:16 width:16 label:no interactive:no'>
	</div>
	<div class="privacyEdit" macro='setPrivacy label:yes interactive:yes'></div>
	<div class='tagClear'></div>
</div>
<div class='editor' macro='edit text'></div>
<div class='editorFooter'>
	<div class='tagTitle'>tags</div>
	<div class='editor' macro='edit tags'></div>
	<div class='tagAnnotation'>
		<span macro='message views.editor.tagPrompt'></span>
		<span macro='tagChooser excludeLists'></span>
	</div>
</div>
</div>
<!--}}}-->
/***
|''Name''|ErrorHandlerPlugin|
|''Version''|0.4.3|
|''Author''|Jon Robson|
|''Description''|Localised tiddler save errors including edit conflict resolution.|
|''CoreVersion''|2.6.1|
|''Requires''|TiddlySpaceConfig|
***/
//{{{
(function($) {

var tiddlyspace = config.extensions.tiddlyspace;
var currentSpace = tiddlyspace.currentSpace.name;
tiddlyspace.getLocalTitle = function(title, workspace, suffix) {
	var endsWith = config.extensions.BinaryTiddlersPlugin.endsWith;
	if(!suffix) {
		var isPublic = endsWith(workspace, "_public");
		suffix = tiddlyspace.resolveSpaceName(workspace);
		if(currentSpace == suffix) {
			suffix = isPublic ? "public" : "private";
		} else {
			suffix = "@%0".format(suffix);
		}
	}
	return "%0 *(%1)*".format(title, suffix);
};

var sssp = config.extensions.ServerSideSavingPlugin;

var msgs = config.messages.editConflict = {
	loading: "Loading..",
	resolve: "[[Edit Conflict]]@glossary: this tiddler may have been changed by someone else.",
	reviewDiff: "review (recommended)",
	reviewDiffTooltip: "review changes made to this tiddler",
	reviewDiffError: "error retrieving revision.",
	save: "overwrite",
	saveTooltip: "make this revision the top revision of this tiddler",
	discard: "cancel",
	discardTooltip: "undo changes to this tiddler and get most recent version",
	diffTitle: "%0",
	diffFieldTitle: "%0 - fields",
	diffTextTitle: "%0 - text",
	updating: "updating your version...",
	diffHeader: ["Review the changes that have been made whilst you were editing this tiddler. ",
		"Fold relevant changes back into your version.\n",
		"{{removed{Red}}} highlight shows content removed. ",
		"{{added{Green}}} highlight shows content added.\n"].join(""),
	diffTextHeader: "View changes in text",
	diffFieldsHeader: "View changes in fields"
};

var plugin = config.extensions.errorHandler = {
	diffTags: ["excludeLists", "excludeMissing", "excludeSearch"],
	displayMessage: function(message, tiddler, context) {
		var desc = context && context.httpStatus ? context.statusText :
			sssp.locale.connectionError;
		var reportArea = plugin.reportError(tiddler.title);
		var msg = $("<div />").appendTo(reportArea);
		if(message == "saveConflict") {
			wikify(msgs.resolve, msg[0]);
			var choiceArea = $("<div />").appendTo(reportArea)[0];
			plugin.editConflictHandler(choiceArea, tiddler);
		} else {
			msg.text(sssp.locale[message].format(tiddler.title, desc));
		}
	},
	editConflictHandler: function(container, tiddler) {
		var title = tiddler.title;
		var myrev = tiddler.fields["server.page.revision"];
		// note user now needs to edit, fix problem and save. 
		// TODO: make sure this gets reset in save callback
		store.getTiddler(title).fields["server.page.revision"] = "false";

		var diffBtn = createTiddlyButton(container, msgs.reviewDiff, msgs.reviewDiffTooltip, function(ev) {
			var title = $(ev.target).data("title");
			plugin.displayDiff(ev.target, store.getTiddler(title), myrev);
		});
		var saveBtn = createTiddlyButton(container, msgs.save, msgs.saveTooltip, function(ev) {
				var title = $(ev.target).data("title");
				var tid = store.saveTiddler(store.getTiddler(title));
				autoSaveChanges(null, [tid]);
			});
		var ignoreBtn = createTiddlyButton(container, msgs.discard, msgs.discardTooltip, function(ev) {
			var title = $(ev.target).text(msgs.updating).data("title");
			plugin.resetToServerVersion(store.getTiddler(title));
		});
		$([diffBtn, ignoreBtn, saveBtn]).data("title", title);
	},
	getDiffTiddlerTexts: function(diffText) {
		var chunks = diffText.split("\n  \n");
		if(chunks.length < 2) {
			return [chunks[0], ""];
		} else {
			var diffFieldsText = "{{diff{\n%0\n}}}".format(chunks[0]);
			diffText = '{{diff{\n%0\n}}}'.format(chunks.splice(1, chunks.length).join("\n"));
			return [diffText, diffFieldsText];
		}
	},
	makeDiffTiddler: function(title, diff) {
		var newTiddler = new Tiddler(title);
		var tags = plugin.diffTags;
		newTiddler.text = msgs.loading;
		newTiddler.fields.doNotSave = true;
		newTiddler.tags = diff ? tags.concat(["diff"]) : tags;
		newTiddler = store.saveTiddler(newTiddler);
		$.extend(store.getTiddler(title).fields,
			config.defaultCustomFields); // allow option to save it
		return newTiddler;
	},
	displayDiff: function(src, tiddler, latestRevision) {
		var adaptor = tiddler.getAdaptor();
		var title = tiddler.title;
		var ts = new Date().formatString("0hh:0mm:0ss");
		var suffix = "edit conflict %0".format(ts);
		var diffTitle = tiddlyspace.getLocalTitle(msgs.diffTitle.format(title), "", suffix);
		var diffTextTitle = tiddlyspace.getLocalTitle(msgs.diffTextTitle.format(title), "", suffix);
		var diffFieldsTitle = tiddlyspace.getLocalTitle(msgs.diffFieldTitle.format(title), "", suffix);
		plugin.makeDiffTiddler(diffTextTitle, true);
		plugin.makeDiffTiddler(diffFieldsTitle, true);
		var newTiddler = plugin.makeDiffTiddler(diffTitle, false);
		newTiddler.text = ['%0\n<<slider chkViewDiffText "%1" "%2">>\n',
			'<<slider chkViewDiffField "%3" "%4">>'].join("").
			format(msgs.diffHeader, diffTextTitle, msgs.diffTextHeader,
				diffFieldsTitle, msgs.diffFieldsHeader);
		store.saveTiddler(newTiddler);

		var callback = function(r) {
			var text = plugin.getDiffTiddlerTexts(r);
			store.getTiddler(diffTextTitle).text = text[0];
			store.getTiddler(diffFieldsTitle).text = text[1];
			story.refreshTiddler(diffTitle, null, true);
		};
		var workspace = "bags/%0".format(tiddler.fields["server.bag"]);
		ajaxReq({
			type: "get",
			dataType: "text",
			url: "/diff?format=unified&rev1=%0/%1/%2&rev2=%0/%1".format(workspace, title, latestRevision),
			success: callback,
			error: function() {
				displayMessage(msgs.reviewDiffError);
			}
		});
		story.displayTiddler(src, diffTitle);
	},
	resetToServerVersion: function(tiddler) {
		var adaptor = tiddler.getAdaptor();
		var ctx = { 
			host: tiddler.fields["server.host"],
			workspace: "bags/" + tiddler.fields["server.bag"]
		};
		adaptor.getTiddler(tiddler.title, ctx, null, function(context) {
			store.saveTiddler(context.tiddler);
			story.refreshTiddler(tiddler.title);
			store.setDirty(false);
		});
	},
	reportError: function(title) {
		var el = story.getTiddler(title);
		if(!el) {
			el = story.displayTiddler(null, title);
		}
		return $("<div />").addClass("error annotation").prependTo(el)[0];
	}
};

sssp.reportFailure = function(message, tiddler, context) {
	config.options.chkViewDiffText = config.options.chkViewDiffText === undefined ?
		true : config.options.chkViewDiffText;
	config.options.chkViewDiffFields = config.options.chkViewDiffFields || false;
	plugin.displayMessage(message, tiddler, context);
};

})(jQuery);
//}}}
follow the instructions at the end of the [[AIM Form]] once you have completed the assessment - click the "EXPORT" button, and you will see the results open in a separate window that can be saved (copy and paste) and then the daa can easily be dropped into an EXcel or SPSS spreadsheet as it is recorded in "CSV" format.
!Purpose
Here we explain in simple steps how to export the data from a completed AIM questionnaire so that you can enter it into a database such as Excel or SPSS, etc.  The instructions are broken down into a totally simple copy-and-paste, or 12 steps that gets the data into a database format (don't be fooled into thinking this means it is complicated!)  

If you have reached this page by clicking the button at the end of a completed [[AIM Form]], and have jsut seen a new window open with this text on, then congratulations, your AIM results (in csv format) are laid out at the bottom of this page!

!How to do it:


!Simplest way:
Just copy all the text on this page, paste into a word document, and file, so that someone else can do the (very simple, honest) conversion into a database file.
!Most helpful way:
1. Ensure that you have filled in the ''Name/Unique ID'' of the young person, the ''Date of Assessment'', and your ''own Name'' as the Assessor (see the bottom of the AIM Introduction on the [[AIM Form]].
2. Copy all of the results (see below these instructions).
3. Open your 'Notepad' (this is the simplest word processor, and every operating system will have one - look under "Accessories" to find it in your "programs")
4. Paste the results there.
5. click "Save as..." 
6. If you have a drop-down menu for "Save as file type" and can select .csv out of the menu that this reveals, then select this option.  if .csv is NOT available, then in the box above ("File Name", give a name to your file, and END THE NAME WITH .csv - e.g ''{{{JohnSmith_AIMresults.csv}}}''
7. Save this file now - to a location that you will be able to find again (set up a folder titled "AIM csv results" for instance.)
8. Open your Database program (Excel, SPSS, etc)
9. click on the File menu, and select the "Open..." - then select the csv file you have just created to open.
10. You should see all the data open, with each bit of data in its own appropriate box/column.
11. Save the Excel or SPSS (etc) file, naming the file appropriately to ensure you label it with the unique ID of the young person whose data it is.
12. You are done.

YOUR AIM SCORES ARE BELOW
----
//{{{
var $ = jQuery;

config.macros.exportAIM = {
	tag: 'AIM',
	csv: "",
	setup: false,
	handler: function(place) {
		$(place).append('<a href="#" class="export marginbottomsmall" title="Export AIM to CSV">Export AIM</a>');
		this.setBehaviour();
	},
	setBehaviour: function() {
		if(this.setup) {
			return;
		}
		$('#aimForm').live('click', function(e) {
			if($(e.target).hasClass('export')) {
				config.macros.exportAIM.exportCSV();
			}
		});
		this.setup = true;
	},
	exportCSV: function() {
		var aimFormItems = config.macros.AIMForm.getAllItems(),
			csv = "",
			fields,
			score,
			keyOnly,
			newWindow,
			newDocument,
			interventionLabel,
			interventions,
			writeInterventionsList = function(newDocument, interventions) {
				newDocument.write("<ul>");
				$.each(interventions, function(i, intervention) {
					newDocument.write("<li>"+intervention.name+"<ul>");
					$.each(intervention.AIMitems, function(j, AIMitem) {
						newDocument.write("<li>"+AIMitem.title+" (rating "+aimFormItems[AIMitem.title].value+")</li>");
					});
					newDocument.write("</ul></li>");
				});
				newDocument.write("</ul>");	
			};
		$.each(aimFormItems, function(i, AIMitem) {
			if(AIMitem.value) {
				csv += '"'+AIMitem.tiddlerTitle+'","'+AIMitem.value+'","'+(AIMitem.isKeyProblem ? 'key problem' : '')+'"\n';
			}
		});
		if(!csv) {
			csv = "the AIM has not been filled in yet";
		}
		config.macros.exportAIM.csv = csv;
		newWindow = window.open("", "sourceWindow", "width=700,height=600,scrollbars=yes");
		newWindow.focus();
		newDocument = newWindow.document;
		newDocument.write("<html><head><title>AIM export to CSV</title>" +
			'<style type="text/css">textarea { border: 2px inset #B5B5B5; width: 100%; }</style>' +
			"</head><body onload=\"var exp = function() { window.opener.config.macros.exportAIM.save(); window.close(); }; var button = document.getElementsByTagName('button')[0]; if(button) { button.onclick=exp; } document.getElementsByTagName('textarea')[0].select();  \">" +
			"<h1>AIM export to CSV</h1>" +
			"<h2>Form information:</h2>" +
			"<dl><dt>Name/Unique ID:</dt><dd>"+(config.options.txtAIM_ID || "not filled in")+"</dd>" +
			"<dt>Date of assessment</dt><dd>"+(config.options.txtAIM_date || "not filled in")+"</dd>" +
			"<dt>Name of assessor</dt><dd>"+(config.options.txtAIM_assessor || "not filled in")+"</dd></dl>" +
			"<hr />");
		if(!config.options.txtAIM_ID || !config.options.txtAIM_date || !config.options.txtAIM_assessor) {
			newDocument.write("<p>Please go back and fill in the undefined details above</p><hr/>");
		}
		newDocument.write(wikifyStatic("<<tiddler ExportAIMInstructions>>") +
			"<textarea>" +
			csv +
			"</textarea>");
		newDocument.write("<h2>List of specific interventions:</h2>");
		// now show the list of interventions, if there are any
		keyOnly = true;
		interventions = config.macros.AIMResults.createResults(keyOnly);
		config.macros.AIMResults.analyseResults(interventions, "global_ranking");
		newDocument.write("<h3>Global ranking (key problems only):</h3>");
		writeInterventionsList(newDocument, interventions);
		config.macros.AIMResults.analyseResults(interventions, "focal_ranking");
		newDocument.write("<h3>Focal ranking (key problems only):</h3>");
		writeInterventionsList(newDocument, interventions);
		keyOnly = false;
		interventions = config.macros.AIMResults.createResults(keyOnly);
		config.macros.AIMResults.analyseResults(interventions, "global_ranking");
		newDocument.write("<h3>Global ranking (all results):</h3>");
		writeInterventionsList(newDocument, interventions);
		config.macros.AIMResults.analyseResults(interventions, "focal_ranking");
		newDocument.write("<h3>Focal ranking (all results):</h3>");
		writeInterventionsList(newDocument, interventions);
		newDocument.write("</body></html>");
		newDocument.close();
	},
	save: function() {
		// TiddlyTemplating.saveFile - http://svn.tiddlywiki.org/Trunk/contributors/JonathanLister/plugins/TiddlyTemplatingMacro.js
		var filename = (config.options.txtAIM_ID+"_"+config.options.txtAIM_date+"_"+config.options.txtAIM_assessor+".csv").replace(/ /g," "),
			content = config.macros.exportAIM.csv.replace(/<br\/>/g,"\n"),
			localPath = getLocalPath(document.location.toString()),
			savePath,
			p,
			fileSave;

		config.messages.fileSaved = "file successfully saved";
		config.messages.fileFailed = "file save failed";
		if((p = localPath.lastIndexOf("/")) != -1) {
			savePath = localPath.substr(0,p) + "/" + filename;
		} else {
			if((p = localPath.lastIndexOf("\\")) != -1) {
				savePath = localPath.substr(0,p) + "\\" + filename;
			} else {
				savePath = localPath + "." + filename;
			}
		}
		alert("saving AIM to file: "+savePath);
		fileSave = saveFile(savePath,convertUnicodeToUTF8(content));
		if(fileSave) {
			displayMessage("saved... click here to load","file://"+savePath);
		} else {
			displayMessage(config.messages.fileFailed,"file://"+savePath);
		}
	}
};
//}}}
/***
|Name:|ExtentTagButtonPlugin|
|Description:|Adds a New tiddler button in the tag drop down|
|Version:|3.2 ($Rev: 3861 $)|
|Date:|$Date: 2008-03-08 10:53:09 +1000 (Sat, 08 Mar 2008) $|
|Source:|http://mptw.tiddlyspot.com/#ExtendTagButtonPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License|http://mptw.tiddlyspot.com/#TheBSDLicense|
***/
//{{{

window.onClickTag_mptw_orig = window.onClickTag;
window.onClickTag = function(e) {
	window.onClickTag_mptw_orig.apply(this,arguments);
	var tag = this.getAttribute("tag");
	var title = this.getAttribute("tiddler");
	// Thanks Saq, you're a genius :)
	var popup = Popup.stack[Popup.stack.length-1].popup;
	createTiddlyElement(createTiddlyElement(popup,"li",null,"listBreak"),"div");
	wikify("<<newTiddler label:'Create new page as a sub topic of this one' tag:'"+tag+"'>>",createTiddlyElement(popup,"li"));
	return false;
}

//}}}
/*!**
|''Name''|ExtraFilters|
|''Author''|Jon Robson|
|''Version''|0.6.8|
|''Status''|@@experimental@@|
|''Requires''|TiddlySpaceFilters ImageMacroPlugin|
|''CodeRepository''|<...>|
|''License''|[[BSD|http://www.opensource.org/licenses/bsd-license.php]]|
!Notes
* Updates shadow tiddlers to known TiddlySpace shadow tiddlers
* adds the following filters 
{{{
[is[tiddler]] - allows you to match all tiddlers - useful for applying the isnot filter (see later)
[is[image]] - returns only image tiddlers (e.g. png, jpeg, gif etc..)
[is[shadow]] - returns if the tiddler is a known shadow tiddler
[is[svg]] - returns only svg tiddlers
[is[tagged]] - returns tiddlers with tags
[isnot[image]] - filters result of previous filters for ones that are not images
[notag[<tag>]] - filters result of previous filters for ones without a tag
[nofield[<field>]] - check for absence of field or field value in previous filters
[has[<field or attribute>]] - match tiddlers which have a field or attribute set.
[and[<filter expression>]] - e.g.[and[tag:foo]] checks all tiddlers from previous filters for a tag foo.
[nobag[foo]] - removes any tiddlers previously returned by a previous filter that belong to the given bag
[is[open]]
[startsWith[title,Foo]] returns all tiddlers who's titles start with Foo.

}}}
***/
//{{{
(function($) {
var _display = Story.prototype.displayTiddler;
Story.prototype.displayTiddler = function() {
	var res =  _display.apply(this, arguments);
	$("[macroName=list]").each(function(i, el) {
		config.macros.list.refresh(el);
	});
	return res;
};
var _close = Story.prototype.closeTiddler;
Story.prototype.closeTiddler = function() {
	var res =  _close.apply(this, arguments);
	$("[macroName=list]").each(function(i, el) {
		config.macros.list.refresh(el);
	});
	return res;
};

config.shadowTiddlers.SiteIcon = "";
config.shadowTiddlers.SiteInfo = "";
config.shadowTiddlers.SystemSettings = "";
config.shadowTiddlers[config.extensions.tiddlyspace.currentSpace.name + "SetupFlag"] = "";

config.filterHelpers["is"].image = config.macros.image.isImageTiddler;
config.filterHelpers["is"].svg = config.macros.image.isSVGTiddler;
config.filterHelpers["is"].tiddler = function(tiddler) {
	return tiddler ? true : false;
}
config.filterHelpers["is"].open = function(tiddler) {
	return story.getTiddler(tiddler.title) ? true : false;
}
config.filterHelpers["is"].shadow = function(tiddler) {
	return tiddler && tiddler.title && tiddler.title in config.shadowTiddlers ? true : false;
}
config.filterHelpers["is"].tagged = function(tiddler) {
	return tiddler && tiddler.tags.length > 0 ? true : false;
};
config.filterHelpers["is"].external = function(tiddler) {
	var endsWith = config.extensions.BinaryTiddlersPlugin.endsWith;
	var fields = tiddler.fields;
	var bag = fields["server.bag"] || "";
	var local = config.filterHelpers["is"].local(tiddler);
	if(!local && endsWith(bag, "_public") || bag.indexOf("_") === -1) {
		return true;
	} else {
		return false;
	}
};

config.filterHelpers["is"].privateAndExternal = function(tiddler) {
	var endsWith = config.extensions.BinaryTiddlersPlugin.endsWith;
	var fields = tiddler.fields;
	var bag = fields["server.bag"] || "";
	return !config.filterHelpers["is"].local(tiddler) && endsWith(bag, "_private");
};

config.filters.isnot = function(candidates, match) {
	var type = match[3];
	var results = [];
	for (var i = 0; i < candidates.length; i++) {
		var tiddler = candidates[i];
		var helper = config.filterHelpers.is[type];
		if(helper && !helper(tiddler)) {
			results.pushUnique(tiddler);
		}
	}
	return results;
};

config.filters.nobag = function(results, match) {
	var bag = match[3];
	var newResults = [];
  for(var i = 0; i < results.length; i++) {
    var tiddler = results[i];
    if(tiddler.fields["server.bag"] !== bag) {
      newResults.push(tiddler);
    }
  }
  return newResults;
};

config.filters.linksTo = function(results, match) {
	var name = match[3];
	results = this.getTiddlers();
  var newResults = [];
  for(var i = 0; i < results.length; i++) {
    var tiddler = results[i];
    var links = tiddler.getLinks("title", "excludeLists");
    if(links.contains(name)) {
      newResults.push(tiddler);
    }
  }
  return newResults;
};

config.filters.notag = function(results, match) {
  var tag = match[3];
  var newResults = [];
  for(var i = 0; i < results.length; i++) {
    var tiddler = results[i];
    if(!tiddler.tags.contains(tag)) {
      newResults.push(tiddler);
    }
  }
  return newResults;
};
config.filters.nofield = function(results, match) {
  var fieldname = match[3];
  var newResults = [];
  for(var i = 0; i < results.length; i++) {
    var tiddler = results[i];
    if(!tiddler.fields[fieldname]) {
      newResults.push(tiddler);
    }
  }
  return newResults;
};

config.filters.and = function(results, match) {
	var args = match[3].split(":");
	var negationMode = false;
	var handler = args[0];
	if(handler.indexOf("!") === 0) {
		handler = handler.substr(1);
		negationMode = true;
	}
	var value = args[1];
	if(config.filters[handler]) {
		var titles = [];
		var matches = config.filters[handler].call(this, [], [null, null, handler, value]); // note some filters require second argument :(
		for(var i = 0; i < matches.length; i++) {
			titles.push(matches[i].title);
		}
		var newResults = [];
		for(var i = 0; i < results.length; i++) {
			var tid = results[i];
			if(!negationMode && titles.contains(tid.title)) {
				newResults.push(tid);
			} else if(negationMode && !titles.contains(tid.title)) {
				newResults.push(tid);
			}
		}
		return newResults;
	} else {
		return results;
	}
};

config.filters.has = function(results, match) {
	var field = match[3];
	var results = [];
	this.forEachTiddler(function(title, tid) {
		if(tid[field] || tid.fields[field]) {
			results.push(tid);
		}
	});
	return results;
};

config.filters.startsWith = function(results, match) {
	var args = match[3].split(",");
	var field, str;
	if(args.length === 1) {
		field = "title";
		str = args[0]
	} else {
		field = args[0];
		str = args[1];
	}
	var newResults = [];
	// use this to keep the current store context
	this.forEachTiddler(function(i, tid) {
		var val = this.getValue(tid, field);
		if(val && val.indexOf(str) === 0) {
			newResults.push(tid);
		}
	})
	return newResults;
}

var scanMacro = config.macros.tsScan;
config.filterHelpers.loadingTiddler = new Tiddler("Loading...");
config.filterHelpers.loadingTiddler.text = "loading...";
config.filterHelpers.loadingTiddler.fields["msg.loading"] = "loading...";
config.filterHelpers.url = {};
config.filters.url = function(results, match) {
	var url = match[3];
	var tiddlers = config.filterHelpers.url[url];
	if(tiddlers) {
		return tiddlers;
	} else if(!status) {
		config.filterHelpers.url[url] = [ config.filterHelpers.loadingTiddler ];
		$.ajax({type:"get", url: url, dataType: "json", success: function(jstiddlers) {
			var tiddlers = scanMacro._tiddlerfy(jstiddlers, {});
			config.filterHelpers.url[url] = tiddlers;
			refreshDisplay();
		}, error: function() {
			displayMessage("unable to connect to %0".format(url));
		}
		});
	}
	return config.filterHelpers.url[url];
};

}(jQuery));
//}}}
/***
|''Name:''|FilterTiddlersPlugin|
|''Description:''|Filter the tiddlers in a TiddlyWiki|
|''Author''|JonathanLister|
|''CodeRepository:''|http://svn.tiddlywiki.org/Trunk/contributors/JonathanLister/plugins/FilterTiddlersPlugin.js |
|''Version:''|0.4|
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev |
|''License''|[[BSD License|http://www.opensource.org/licenses/bsd-license.php]] |
|''~CoreVersion:''|2.4|

! Usage
{{{
store.filterTiddlers(filter)
}}}
where "filter" is a filter expression, as explained below

Returns an array of Tiddler() objects that match the filter expression

! Filter expressions
Filter expressions are of the form:
{{{
filterStep | filterStep | ... // only one filterStep is required
}}}
where filterStep is of the form:
{{{
[filterElements]
}}}
where filterElements is one or more of the following:
* [TiddlerName]
* tag[TagName]
* sort[SortField]
* limit[NoOfResults]

***/

//{{{
if(!version.extensions.FilterTiddlersPlugin) {
version.extensions.FilterTiddlersPlugin = {installed:true};

TiddlyWiki.prototype.filterTiddlers = function(filter) {
	var makeStore = function(tiddlers) {
		if(tiddlers && tiddlers.length===0) {
			return store;
		}
		var TW = new TiddlyWiki();
		for(var i=0;i<tiddlers.length;i++) {
			TW.addTiddler(tiddlers[i]);
		}
		return TW;
	};
	var findRawDelimiter = function(delimiter,text,start)
	{
		var d = text.indexOf(delimiter,start);
		if(d==-1)
			return -1;
		var b = {start:-1,end:-1};
		var bs = text.indexOf('[',start);
		if(bs==-1 || bs >d)
			return d;
		var s1 = -1;
		if(bs!=-1 && bs <d) {
			var be = text.indexOf(']',bs);
			if(be!=-1) {
				b.start = bs;
				b.end = be;
			}
		}
		if(b.start!=-1 && d>b.start)
			s1 = b.end+2;
		return s1==-1 ? d : findRawDelimiter(delimiter,text,s1);
	};
	var filterTiddlers = function(filter,tiddlers)
	{
		var store = makeStore(tiddlers);
		var results = [];
		var accumulator = [];
		var addToResults = function(results,tiddlers) {
			for(var i=0;i<tiddlers.length;i++) {
				results.pushUnique(tiddlers[i]);
			}
		};
		var addAllToResults = function(results,toExclude) {
			if(toExclude && toExclude.length) {
				var titles = [];
				for(var i=0;i<toExclude.length;i++) {
					titles.push(toExclude[i].title);
				}
				store.forEachTiddler(function(title,tiddler) {
					if(titles && !titles.contains(title)) {
						results.pushUnique(tiddler);
					}
				});
			} else {
				store.forEachTiddler(function(title,tiddler) {
					results.pushUnique(tiddler);
				});
			}
		};
		var removeFromResults = function(results,tiddlers) {
			for(var i=0;i<tiddlers.length;i++) {
				var n = results.indexOf(tiddler[i]);
				if(n!=-1)
					results.splice(n,1);
			}
		};
		var tiddlerSort = function(field) {
			// if the accumulator is empty, sort the results array
			if(accumulator.length==0)
				results = store.sortTiddlers(results,field);
			else
				accumulator = store.sortTiddlers(accumulator,field);
		};
		var limitResults = function(limit) {
			// if the accumulator is empty, limit the results array
			var arrayToSplice = accumulator.length==0 ? results : accumulator;
			if(arrayToSplice.length>limit) {
				arrayToSplice.splice(limit,arrayToSplice.length-limit);
			}
		};
		if(filter) {
			var tiddler, tiddlers;
			var re = /([^ \[\]]+)|(?:\[((?:[ \w-+!]+\[[^\]]+\])+)\])|(?:\[\[([^\]]+)\]\])/mg;
			var re_inner = /([ \w-+!]+)\[([^\]]+)]/mg;
			var match = re.exec(filter);
			while(match) {
				if(match[1] || match[3]) {
					var title = match[1] ? match[1] : match[3];
					if(title=="*") {
						addAllToResults(results);
					} else {
						tiddler = store.fetchTiddler(title);
						if(tiddler) {
							addToResults(results,[tiddler]);
						} else if(store.isShadowTiddler(title)) {
							tiddler = new Tiddler();
							tiddler.set(title,store.getTiddlerText(title));
							addToResults(results,[tiddler]);
						}
					}
				} else if(match[2]) {
					// loop through the nested matches of the form 'tag[word]'
					var match_inner = re_inner.exec(match[2]);
					while(match_inner) {
						switch(match_inner[1]) {
						// Note: all 'tag' case fall-through are intentional
						case "-tag":
							tiddlers = store.getTaggedTiddlers(match_inner[2]);
							removeFromResults(accumulator,tiddlers);
							break;
						case "tag":
						case "+tag":
							tiddlers = store.getTaggedTiddlers(match_inner[2]);
							addToResults(accumulator,tiddlers);
							break;
						case "!tag":
							tiddlers = store.getTaggedTiddlers(match_inner[2]);
							addAllToResults(accumulator,tiddlers);
							break;
						case "-sort":
							// this is a syntax error
							displayError(config.messages.filterSortError);
							break;
						case "+sort":
							// this fall-through is intentional
						case "sort":
							tiddlerSort(match_inner[2]);
							break;
						case "limit":
							limitResults(match_inner[2]);
							break;
						}
						match_inner = re_inner.exec(match[2]);
					}
				}
				// push accumulator onto results stack
				for (var i=0; i<accumulator.length; i++) {
					results.pushUnique(accumulator[i]);
				}
				accumulator = [];
				match = re.exec(filter);
			}
		}
		return results;
	};
	var results = [];
	if(filter) {
		var delimiter = "|";
		var inc = delimiter.length;
		var start = 0;
		var end = findRawDelimiter(delimiter,filter,start);
		while(end!=-1) {
			results = filterTiddlers(filter.substr(start,end),results);
			start = end+inc;
			end = findRawDelimiter(delimiter,filter,start);
		}
		results = filterTiddlers(filter.substr(start),results);
	}
	return results;
};

// Move this to config.messages once approved
merge(config.messages,{
	filterSortError:"Error in tiddler filter expression: '[-sort[field]]' is invalid; use '[sort[-field]]' instead"
});

} //# end of 'install only once'
//}}}
ColorPalette
StyleSheet
SiteSubtitle
GettingStarted
SiteTitle
MainMenu
SiteIcon
DefaultTiddlers
ViewTemplate
PageTemplate
SideBarOptions
EditTemplate
SiteInfo
SideBarTabs
ToolbarCommands
!To get AIM data saved fast

1. Fill in the AIM questionnaire online - ''NB: NO private data will be saved online when you do this'' - as the information all remains wihtin your computer.) 

2. Click the ''"Export AIM"'' button at the end of the questionnaire -> a new window pops up with all the data in it.

3. Right click on this pop-up window and then "''Select all''" -> then ''Copy'' and ''Paste'' this into a new Word document.  ''__Done!__''  File this safely...  

You will see this document has all the actual data in a little window (with sliders to move around it) plus multiple long lists of all the "suggested treatments" that are sorted and ranked in different ways (you can ignore these for now if you are just after the data, or you can play with them online in the manual at [[AIM-Results]])

!To get AIM data into an Excel or SPSS file

1. Select and copy all the actual scores (that are all listed in the little window embedded in the results page) - you can do this from the Word document you just created, or you can do it directly from the window in the pop-up referred to in (2) above...

2. Open up your computer's "''Notepad''" text editor (which is the simplest text editor, versions of which are included in all computers: in a PC go to ''All Programmes'' -> select ''Accessories'' -> select ''Notepad'') and paste the data you just copied into there.

3. click ''File'' on the Notepad, and then select "''Save as...''".  When you save the file with all your data, save it //in a safe place// with the suffix ''.csv'' at the end (this is a data format that tells Excel and other statistics programs how to organise the data)

    eg: ''JohnSmith_AIM_Jan2012.csv''


4. Now open ''Excel'', go to the ''File'' menu, and click ''Open File...''

5. Now select the csv file that you have just created and saved... and all the data will open up, sorted and loaded into the right Excel boxes and columns.

6. Save this Excel file with the client's name or ID, in a clearly labelled central folder for our team's AIM RESULTS, as well as a copy in the young person's letters folder.  

Done!
This is the AMBIT theme.

Plugins:
[[AmbitSetupPlugin]]
[[AMBITFormatterChangesPlugin]]
[[AmbitFooterMacros]]
[[HistoryWidgetPlugin]]
[[LocalOrNotMacro]]
[[SearchBoxMacro]]
[[TreeMacroPlugin]]
[[YouAreReadingWidgetPlugin]]

Other tiddlers:
[[StyleSheet]]
[[PageTemplate]]
[[SiteTitle]]
[[SiteSubtitle]]
[[AmbitSetup]]

This shows the problem with long tables:
| hello this is a really long table | hello this is a really long table | hello this is a really long table | hello this is a really long table | hellothisisareallylongtable |
| hellothisisareallylongtable | hellothisisareallylongtable | hellothisisareallylongtable | hellothisisareallylongtable | hellothisisareallylongtable |
| hello this is a really long table | hello this is a really long table | hello this is a really long table | hello this is a really long table | hellothisisareallylongtable |

Welcome to your brand new [[TiddlySpace]]@glossary.

To get started with this blank [[TiddlySpace]]@glossary, you'll need to modify the following [[tiddlers|Tiddler]]@glossary:
* If you don't like the color scheme click <<RandomColorPaletteButton>> to generate a new random color scheme.
* Upload a [[SiteIcon|SiteIcon tiddler]]@glossary. [[Your SiteIcon|SiteIcon]] gives your space an identity to make it recognisable to others. A good site icon will be square and at least 48*48 pixels size.
<<binaryUploadPublic title:SiteIcon>>
* [[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 ~TiddlySpace is opened
* Many features of ~TiddlySpace are accessed via the backstage bar located at the top of the page. You can toggle it on or off using the button in the top right corner of the screen.
!Welcome to the AIM

Welcome to the AMBIT AIM (Adolescent Integrative Measure), which is a [[Licensed|AIM Creative Commons Licence]] resource, freely available for general use subject to the terms of its Creative Commons License.  The [[Authors of the AIM]] are acknowledged.

!How to use it:

Click on the [[AIM Form]].

Instructions for completing the assessment are included at the top of the [[AIM Form]]. Once you have completed the questions, you can [[Export data from the AIM]] so that it can easily be pasted into a local database.
 
!@@color(red):Confidentiality:@@

Please note that filling in an AIM questionnaire @@color(red):WILL NOT UPLOAD OR SAVE __''ANY''__ DETAILS ABOUT YOUR CLIENT //ONLINE//@@ - all of the data that you input about your case is only //ever// held on your local computer, in the short term memory of your browser - this is because of the way that the software that this runs on ([[Tiddlywiki|www.tiddlywiki.com]]) works.

!Additional functions:

*''__Ranking suggested interventions:__'' You will also see a link to generate a list of [[AIM suggested interventions]], but this will ''not'' generate any suggestions //''unless you are viewing the AIM when it is included as part of a __treatment manual__''//.  
**Because of the way that TiddlySpace works, the whole AIM questionnaire can very easily be [[included]] within another 'space' (or wiki); 
**indeed, it is //designed to be included// as part of wiki-based TREATMENT MANUALS (see @tiddlymanuals  or {{{www.tiddlymanuals.com}}}) such as the @ambit manual, or its local adaptations. 
**If you visit, say, the @ambit manual, you will find this same AIM questionnaire embedded within a rich mentalization-based framework for managing high risk, multi-problem, complex youth.  
**In these treatment manual(s), the individual items in the AIM are each '[[tagged|Tags]]' with what the AMBIT project's authorial team has considered to be the best evidence-based approach(es) to work in that specific problem area.  
**Clicking on [[AIM suggested interventions]] ''in a tiddlymanual'' once you have completed an AIM ''will generate ranked lists of these suggested interventions, as direct links to manualized content''.
**These ranked lists are not "therapy by numbers" - they can be sorted in different ways, for instance according to whether you want to address the MOST SEVERE PROBLEMS as a priority, or focus on the intervention(s) that are the MOST FREQUENTLY INDICATED across the range of difficulties that you have just mapped out.  You can limit your suggestions to just those problems identified as "Key Problems".  The idea is to offer a more or less objective prompt for the practitioner along the lines of ''"Are you offering the interventions that this set of problems requires, or your //favourite ones//?"''

!!Developing new evidence and new treatments

Because @tiddlymanuals are designed to be flexible, and adaptable to different settings and to the developing evidence base, new treatments (or adaptations of the core AMBIT content) are invited to include the {{{@ambit-AIM}}} space, and to edit the tags on individual AIM items, to suit the range of treatments that they are offering.
/***
|''Name''|GroupByPlugin|
|''Description''|Mimics allTags macro to provide ways of creating lists grouping tiddlers by any field|
|''Version''|0.6.1|
|''Author''|Jon Robson|
|''Status''|beta|
!Usage
{{{<<groupBy tags>>}}}
mimics allTags macro

{{{<<groupBy server.bag>>}}}
groups by the server.bag field (this version contains TiddlySpace specific code for turning a bag into a space name)

{{{groupBy modified dateFormat:"YYYY"}}}
group tiddlers by year.

{{{<<groupBy tags exclude:excludeLists exclude:systemConfig>>}}}
group tiddlers by tag but exclude the tags with values excludeLists and systemConfig

Within that group you can also exclude things by filter
{{{groupBy modifier filter:[tag[film]]}}}
will group tiddlers tagged with film by modifier.
***/
//{{{
(function($) {
var taglocale = config.views.wikified.tag;
var macro = config.macros.groupBy = {
	locale: {
		tooltip: "all tiddlers in group %0",
		noTiddlers: "no tiddlers",
		openAllText: taglocale.openAllText,
		openAllTooltip: taglocale.openAllTooltip,
		openTiddler: "open tiddler with title %0"
	},
	morpher: {
		// TODO: note currently the following 2 morphers are TiddlySpace specific and probably should be in separate plugin
		"server.workspace": function(value, options) {
			return macro.morpher["server.bag"](value.replace("bags/", "").replace("recipes/", ""));
		},
		"server.bag": function(value, options) {
			if(typeof(value) !== "string") {
				return false;
			} else if(value.indexOf("_public") === -1 && value.indexOf("_private") === -1) {
				value = "*%0".format(value); // add star for non-space bags.
			}
			return value.replace("_public", "").replace("_private", "");
		},
		created: function(value, options) {
			return value.formatString(options.dateFormat || "DD MMM YYYY");
		},
		modified: function(value, options) {
			return macro.morpher.created(value, options);
		}
	},

	handler: function(place, macroName, params, wikifier, paramString) {
		var field = params[0] || "server.workspace";
		var dateFormat = params[1] || "DD MMM YYYY";
		var container = $("<div />").attr("macroName", macroName).addClass("groupBy").
			attr("refresh", "macro").attr("fieldName", field).
			attr("paramString", paramString).
			attr("dateFormat", dateFormat).appendTo(place)[0];
		macro.refresh(container);
	},
	isTypeArray: function(value) {
		var valueType = typeof value;
		if(valueType === "object" && typeof value.length === "number" &&
			!(value.propertyIsEnumerable("length")) &&
			typeof value.splice === "function") { //is Array
			return true;
		} else {
			return false;
		}
	},
	_onClickGroup: function(ev, options) {
		var i, target = ev.target, locale = macro.locale;
		var tiddlers = $(target).closest(".templateContainer").data("tiddlers");
		var popup = $(Popup.create(target)).addClass("taggedTiddlerList")[0];
		var value = $(target).attr("value");
		var openAll = createTiddlyButton($("<li />").appendTo(popup)[0],
			locale.openAllText.format(value), locale.openAllTooltip);
		$(openAll).click(function(ev) {
			story.displayTiddlers(ev.target, tiddlers);
			return false;
		});
		var listBreak = $("<li />").addClass("listBreak").html("<div />").appendTo(popup);
		for(i = 0; i < tiddlers.length; i++) {
			var item = $("<li />").appendTo(popup)[0];
			var template = store.getTiddlerText(options.template) || macro.template;
			wikify(template, item, null, tiddlers[i]);
		}
		listBreak.clone().appendTo(popup);
		$(createTiddlyLink($("<li />").appendTo(popup)[0], value, false)).
			text(locale.openTiddler.format(value));
		Popup.show();
		ev.stopPropagation();
		return false;
	},
	_refresh: function(container, tiddlers, options) {
		var totalGroups = 0, locale = macro.locale, i, j;
		var excludeValues = options.exclude;
		var values = {}, value_ids = [];
		var field = options.field;
		var morpher = macro.morpher[field] || function(value) {
			return value;
		};
		for(i = 0; i < tiddlers.length; i++) {
			var tiddler = tiddlers[i];
			var value = tiddler[field] || tiddler.fields[field];
			value = macro.isTypeArray(value) ? value : [ value ];
			for(j = 0; j < value.length; j++) {
				var v = morpher(value[j], options);
				if(v && $.inArray(v, excludeValues) === -1) {
					totalGroups += 1;
					if(!values[v]) {
						values[v] = [];
					}
					values[v].push(tiddler);
					value_ids.pushUnique(v);
				}
			}
		}
		var ul = $("<ul />").appendTo(container)[0];
		if(totalGroups === 0) {
			$("<li />").addClass("listTitle").text(locale.noTiddlers);
		}
		value_ids = value_ids.sort();
		var groupTemplate = store.getTiddlerText(options.groupTemplate);
		var onClick = function(ev) {
			macro._onClickGroup(ev, options);
		};
		for(i = 0; i < value_ids.length; i++) {
			var title = value_ids[i];
			var info = getTiddlyLinkInfo(title);
			tiddlers = values[title];
			var btn = createTiddlyButton($("<li />").appendTo(ul)[0],
				"%0 (%1)".format(title, tiddlers.length), locale.tooltip.format(title), null, info.classes);
			if(groupTemplate) {
				$(btn).empty();
				wikify(groupTemplate, btn, null, tiddlers[0]);
			}
			$(btn).click(onClick).attr("value", title).attr("refresh", "link").attr("tiddlyLink", title);
			$(btn).addClass("templateContainer").data("tiddlers", tiddlers);
		}
	},
	refresh: function(container) {
		container = $(container).empty();
		var paramString = container.attr("paramString");
		var args = paramString.parseParams("name", null, true, false, true)[0];
		var options = { field: container.attr("fieldName"), dateFormat: container.attr("dateFormat"), exclude: args.exclude || [],
			template: args.template ? args.template[0] : false, groupTemplate: args.groupTemplate ? args.groupTemplate[0] : "" };
		var tiddlers = args.filter ? store.filterTiddlers(args.filter[0]) : store.getTiddlers("title");
		macro._refresh(container, tiddlers, options);
	},
	template: "<<view title link>>"
};

}(jQuery));
//}}}
/*{{{*/
(function() {
	var $ = jQuery,
		$historyBox,
		$historyList,
		scrollingInterval;

	config.macros.history = {
		init: function() {
			// add behaviour to tiddler opening
		},
		handler: function(place) {
			if(!$historyBox) {
				/* TW macro handlers get called twice (bug), but the first time, place is not set to the correct element - it is some mysterious element which ends up not in the document. So we have to let the HTML creation happen twice, but not the event binding */
				$(document).bind("startup", this.dispatch);
			}
			$historyBox = $('<div class="historyBox"></div>')
				.append('<div class="scrollBar"><span class="up">scroll up</span><span class="down">scroll down</span></div>')
				.appendTo(place);
			$historyList = $('<ul></ul>')
				.appendTo($historyBox)
				.css({
					position: 'relative',
					top: 0
				}); // prepare for scrolling
			$historyBox.find('.scrollBar span').mousedown(function(e) {
				var direction = e.target.className === "up" ? 1 : -1;
				scrollingInterval = window.setInterval(function() {
					var top = parseInt($historyList.css('top'),10),
						newTop = top;
					if(direction > 0 && top < 0) {
						newTop = top + 3;
					} else if(direction < 0 && $historyList.height()+top > $historyBox.height()) {
						newTop = top - 3;
					}
					$historyList.css({
						top: newTop+"px"
					});
				}, 100);
			}).mouseup(function(e) {
				window.clearInterval(scrollingInterval);
			}).mouseout(function(e) {
				window.clearInterval(scrollingInterval);
			});
		},
		listItem: function(title, active, addToBottom) {
			var mostRecentTiddler = $historyList.find('li').eq(0).text();
			if(title!==mostRecentTiddler) {
				var link = createTiddlyLink(null,title,true,(active ? "active" : "")),
					$newItem = $('<li></li>').append(link);
				if(addToBottom) {
					$historyList.append($newItem);
				} else {
					$historyList.prepend($newItem);
				}
			}
		},
		dispatch: function() {
			// populate history from story
			var title,
				id,
				idPrefix = "",
				prefixLength = idPrefix.length,
				plugin = config.macros.history;
			$(story.getContainer())
				.find('.tiddler')
				.each(function(i, tid) {
					title = $(tid).attr("tiddler");
					plugin.listItem(title, i===0, 'bottom');
				});
			
			// add to history whenever tiddler is opened
			var tmpDisplayTiddler = Story.prototype.displayTiddler;
			Story.prototype.displayTiddler = function(srcElement,tiddler,template,animate,slowly) {
				var t = story.chooseTemplateForTiddler(title, template);
				if(t.indexOf('ViewTemplate')!==-1) {
					var title = (tiddler instanceof Tiddler) ? tiddler.title : tiddler;
					plugin.listItem(title);
				}
				tmpDisplayTiddler.apply(this, arguments);
			};
		}
	};
}());

/*}}}*/
There are a lot of interesting people using ~TiddlySpace that you might like to keep track of and interact with. There are a number of ways of doing this.

If you see a number in the speech bubble in one of your tiddlers, it means that someone is writing about the same thing as you. You can find out what they're saying by clicking on it. Likewise, if you see something interesting in someone else's space, you can respond to it and write up your own thoughts on the subject by clicking "Reply to this tiddler".

Additionally, if you find anyone interesting, or you find an interesting looking space and you'd like to know when it's changed, you can "follow" that space. To do this, simply create a tiddler with the title: {{{@space-name}}} and tag it {{{follow}}}. If you want, you can store some notes about that space in the body of the tiddler.

If you then want to know what happening, simply [[include|How do I include/exclude spaces?]]@docs the @tivity space and then visit your activity stream at [[/activity|/activity]], or just visit the @tapas space directly.

!Not sure who to follow?
Here's a few suggestions:
* @fnd
* @cdent
* @pmario
* @bengillies
* @dickon
/***
|''Name''|ImageMacroPlugin|
|''Version''|0.9.4|
|''Description''|Allows the rendering of svg images in a TiddlyWiki|
|''Author''|Osmosoft|
|''License''|[[BSD|http://www.opensource.org/licenses/bsd-license.php]]|
|''Notes''|Currently only works in modern browsers (not IE)|
|''Requires''|BinaryTiddlersPlugin|
!Usage
{{{<<image SVG>>}}} will render the text of the tiddler with title SVG as an SVG image (but not in ie where it will fail silently)
!!Parameters
width/height: specify width/height parameters
link: make the image link to a given location
tiddlyLink: link to a tiddler

!Notes
Binary tiddlers in TiddlyWeb when passed through the wikifier will be shown as images.
eg. {{{<<view text wikified>>}}} on a binary tiddler will show the image.
{{{<<view fieldname image>>}}}
will render the value of the tiddler field 'fieldname' as an image. This field can contain a tid
{{{<<image SiteIcon>>}}}
will create an image tag where the tiddler has content type beginning image and not ending +xml
will attempt to create svg object in other scenarios
{{{<<image /photos/x.jpg>>}}}
will create an image tag with src /photos/x.jpg as long as there is not a tiddler called /photos/x.jpg in 
which case it will render that tiddler as an image. Note for the case of svg files it will attempt to render as an svg if possible via the image
tag. It doesn't embed the svg in the dom for security reasons as svg code can contain javascript.
!Code
***/
//{{{
(function($) {

var macro = config.macros.image = {
	shim: "/bags/common/tiddlers/shim",
	ieVersion: config.browser.isIE ? parseInt(config.browser.ieVersion[1], 10) : false,
	svgns: "http://www.w3.org/2000/svg",
	xlinkns: "http://www.w3.org/1999/xlink", 
	svgAvailable: document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"),
	_fixPrefix: 1,
	_external_cache: {},
	_image_tag_cache: {},
	_image_dimensions: {},
	locale: {
		badImage: "This image cannot be displayed."
	},
	handler: function(place, macroName, params, wikifier, paramString, tiddler){
		var imageSource = params[0];
		// collect named arguments
		var args = macro.getArguments(paramString, params);
		this.renderImage(place, imageSource, args);
	},
	init: function() {
		var startupImages = store.getTaggedTiddlers("systemImage");
		var place = $("<div />").attr("id", "systemImageArea").appendTo("body").hide()[0];
		for(var i = 0; i < startupImages.length; i++) {
			var image = startupImages[i];
			macro.renderImage(place, image.title, { idPrefix: "" });
		}
		var data = new Image();
		data.onload = function() {
			// note ie 8 only supports data uris up to 32k so cannot be relied on
			macro.supportsDataUris = this.width != 1 || this.height != 1 ? false : true;
			macro.supportsDataUris = macro.ieVersion && macro.ieVersion < 9 ? false : macro.supportsDataUris;
		};
		data.onerror = data.onload;
		data.src = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";
	},
	refreshImage: function(src) {
		var elements = macro._image_tag_cache[src] ? macro._image_tag_cache[src] : [];
		if(macro._image_dimensions[src]) {
			macro._image_dimensions[src] = false;
		}
		for(var i = 0; i < elements.length; i++) {
			var el = $(elements[i]);
			var newSrc = "%0?nocache=%1".format(src, Math.random());
			el.attr("src", newSrc); // force reload
		}
	},
	isBinaryImageType: function(contentType) {
		return (contentType && contentType.indexOf("image") === 0 &&
			contentType.indexOf("+xml") != contentType.length - 4) ? true : false;
	},
	isImageTiddler: function(tiddler) {
		return macro.isSVGTiddler(tiddler) || macro.isBinaryImageTiddler(tiddler);
	},
	isSVGTiddler: function(tiddler) {
		var type = tiddler ? tiddler.fields['server.content-type'] : false;
		return type == "image/svg+xml";
	},
	isBinaryImageTiddler: function(tiddler) {
		return macro.isBinaryImageType(tiddler.fields['server.content-type']);
	},
	renderImage: function(place, imageSource, options) {
		var imageTiddler = store.getTiddler(imageSource);
		var container;
		var classes = ["image"];
		if(options.link) {
			classes = classes.concat(["imageLink", "externalLink"]);
			container = $("<a />").attr("href", options.link).appendTo(place)[0];
		} else if(options.tiddlyLink) {
			classes.push("imageLink");
			container = createTiddlyLink(place, options.tiddlyLink, false);
		} else {
			container = $("<span />").appendTo(place)[0];
		}
		$(container).addClass(classes.join(" "));

		options = options ? options : {};
		if(imageTiddler && macro.isBinaryImageTiddler(imageTiddler)) { // handle the case where we have an image url
			return macro._renderBinaryImageTiddler(container, imageTiddler, options);
		} else if(imageTiddler){ // handle the case where we have a tiddler
			return macro._renderSVGTiddler(container, imageTiddler, options);
		} else { // we have a string representing a url
			return macro._renderBinaryImageUrl(container, imageSource, options);
		}
	},
	_renderAlternateText: function(container, options) {
		var img;
		var src = options.src || "";
		if(options.width && options.height) {
			img = $("<img />").attr("src", src).addClass("svgImageText").attr("width", options.width).
				attr("height", options.height).appendTo(container);
		}
		var alt = options.alt;
		if(img && alt) {
			img.attr("alt", alt).attr("title", alt);
		} else if(alt) {
			$(container).addClass("svgImageText").text(alt);
		}
		macro._image_tag_cache[src] = img;
	},
	_renderSVGTiddler: function(place, tiddler, options) {
		if(!options) {
			options = {};
		}
		merge(options, { tiddler: tiddler, fix: true});

		if(macro.svgAvailable) {
			this._importSVG(place, options); // display the svg
		} else if(options.altImage) {
			var image = options.altImage;
			delete options.altImage;
			this._renderBinaryImageUrl(place, image, options);
		} else {
			this._renderAlternateText(place, options); // instead of showing the image show the alternate text.
		}
	},
	_renderBinaryImageTiddler: function(place, tiddler, options) {
		var resourceURI;
		var fields = tiddler.fields;
		if(fields["server.type"] == "tiddlyweb") { // construct an accurate url for the resource
			resourceURI = "%0/%1/tiddlers/%2".format(config.defaultCustomFields["server.host"],
				fields["server.workspace"], encodeURI(fields["server.title"]));
		} else { // guess the url for the resource
			resourceURI = tiddler.title;
		}
		var ctype = fields["server.content-type"] || tiddler.type;
		var text = tiddler.text;
		if(macro.supportsDataUris && ctype && text.indexOf("<html") == -1) {
			var uri = "data:%0;base64,%1".format(ctype, text);
			options.src = resourceURI;
			return macro._renderBinaryImageUrl(place, uri, options);
		} else if(options.src) {
			return macro._renderBinaryImageUrl(place, options.src, options);
		} else {
			return macro._renderBinaryImageUrl(place, resourceURI, options);
		}
	},
	_renderImageTag: function(container, src, width, height, options) {
		var img;
		img = $("<img />").appendTo(container);
		if(height) {
			img.attr("height", height);
		}
		if(width) {
			img.attr("width", width);
		}
		if(macro.ieVersion && macro.ieVersion < 7 && macro.shim && options.ie6png) {
			$(img).css({width: userW, height: userH,
					filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%0', sizingMethod='scale')".format(src)
				}).attr("src", macro.shim);
		} else {
			img.attr("src", src);
		}
		if(!macro._image_tag_cache[options.srcUrl]) {
			macro._image_tag_cache[options.srcUrl] = [];
		}
		img = $(img).addClass(options.imageClass)[0];
		macro._image_tag_cache[options.srcUrl].push(img);
		return img;
	},
	_getDimensions: function(realDimensions, reqDimensions, preserve) {
		var w = realDimensions.width;
		var h = realDimensions.height;
		var reqh = reqDimensions.height;
		var reqw = reqDimensions.width;
		var finalw = w, finalh = h;
		var ratiow = reqw / w, ratioh = reqh / h;
		var scaledw = ratioh * w;
		var scaledh = ratiow * h;
		if(!reqw && reqh) {
			finalw = scaledw;
			finalh = reqh;
		} else if(reqw && !reqh) {
			finalw = reqw;
			finalh = scaledh;
		} else if(reqh && reqw) {
			var preserveWidth = w > h ? true : false;
			if(preserve) {
				if(preserveWidth && scaledh < reqh) {
					finalh = scaledh;
					finalw = reqw;
				} else {
					finalh = reqh;
					finalw = scaledw;
				}
			} else {
				finalw = reqw;
				finalh = reqh;
			}
		}
		return { width: parseInt(finalw, 10), height: parseInt(finalh, 10) };
	},
	_renderBinaryImageUrl: function(container, src, options) {
		var srcUrl = options.src ? options.src : src;
		srcUrl = srcUrl.indexOf("/") === -1 ? "/%0".format(srcUrl) : srcUrl; // for IE. 
		var image_dimensions = macro._image_dimensions[srcUrl];
		var image = new Image(); // due to weird scaling issues where you use just a width or just a height
		var createImageTag = function(dimensions, error) {
			if(error) {
				var altImage = options.altImage;
				if(altImage) {
					delete options.altImage;
					macro._renderBinaryImageUrl(container, altImage, options);
				} else {
					options.src = src;
					macro._renderAlternateText(container, options);
				}
			} else {
				var dim = macro._getDimensions(dimensions, { 
					width: options.width, height: options.height }, options.preserveAspectRatio);
				options.srcUrl = srcUrl;
				macro._renderImageTag(container, src, dim.width, dim.height, options);
			}
		};

		if(!image_dimensions) {
			image.onload = function() {
				var dimensions = { width: image.width, height: image.height};
				macro._image_dimensions[srcUrl] = dimensions;
				createImageTag(dimensions);
			};
			image.onerror = function() {
				createImageTag(null, true);
			};
			image.src = src;
		} else {
			createImageTag(image_dimensions);
		}
	},
	_generateIdPrefix: function(){
		return "twsvgfix_" + (this._fixPrefix++).toString() + "_";
	},
	_fixSVG: function(childNodes, idPrefix) {
		var urlPattern = /url\(\#([^\)]*)\)*/ig;
		var fixes = [
		{ attr: "id", pattern: /^(.*)$/ig },
		{ attr: "href", namespace: macro.xlinkns, pattern: /^#(.*)$/ig }
		];
		var url_fixes = ["filter", "fill", "mask", "stroke", "style"];
		for(var i = 0; i < url_fixes.length; i++) {
			fixes.push({ attr: url_fixes[i], pattern: urlPattern });
		}
		for(var t = 0; t < childNodes.length; t++) {
			var node = childNodes[t];
			for(var a = 0; a < fixes.length; a++) {
				var fix = fixes[a];
				var attr = fix.attr;
				var ns = fix.namespace || "";
				if(node.hasAttributeNS && node.hasAttributeNS(ns, attr)) {
					var v = node.getAttributeNS(ns, attr);
					fix.pattern.lastIndex = 0;
					var match = fix.pattern.exec(v);
					if(match) {
						// Make sure replacement string doesn't contain any single dollar signs
						var toReplace = match[1];
						if(toReplace.indexOf(idPrefix) !== 0 && toReplace.indexOf("twglobal_") !== 0) {
							var replacement = (idPrefix + toReplace).replace("$", "$$$$"); 
							v = v.replace(match[1], replacement);
						}
						node.setAttributeNS(ns, attr,v);
					}
				}
			}
			var children = node.childNodes;
			if(children.length > 0) {
				this._fixSVG(children, idPrefix);
			}
		}
	},
	_importSVG: function(place, options){
		options = options ? options : {};
		var svgDoc, tiddlerText = options.tiddler.text;
		if (window.DOMParser) {
			svgDoc = new DOMParser().parseFromString(tiddlerText, "application/xml").documentElement;
			var idPrefix = options.idPrefix || this._generateIdPrefix();
			this._fixSVG([svgDoc], idPrefix);
			var el = document.importNode(svgDoc, true);
			var svgHolder = document.createElementNS(macro.svgns,"svg");
			var width = options.width;
			var height = options.height;
			if(width || height) {
				if(width && height) { // set view box of containing svg element based on the svg viewbox and width and height.
					var viewBox = el.getAttribute("viewBox");
					var topLeft = "0 0";
					if(viewBox) {
						topLeft = viewBox.replace(/([0-9]*) +([0-9]*) +([0-9]*) +([0-9]*) */gi,"$1 $2");
					}
					svgHolder.setAttributeNS(macro.svgns, "viewBox", "0 0 %0 %1".format(width, height));
				} else {
					if(!width) {
						width = el.getAttribute("width");
					}
					if(!height) {
						height = el.getAttribute("height");
					}
				}
				svgHolder.setAttribute("width", width);
				svgHolder.setAttribute("height", height);

				el.setAttribute("width", "100%");
				el.setAttribute("height", "100%");
				svgHolder.setAttribute("class", "svgImage svgIcon %0".format(options.imageClass || ""));
				svgHolder.appendChild(el);
				place.appendChild(svgHolder);
			}
			else {
				var existing = el.className ? el.className.baseVal : "";
				el.setAttribute("class","svgImage %0".format(existing));
				place.appendChild(el);
			}
			// if a tiddler attribute is set this is read as a link
			$("[tiddler], [tiddlyLink]", place).attr("refresh", "link").click(function(ev) {
				var tiddler = $(ev.target).attr("tiddlyLink");
				if(tiddler) {
					story.displayTiddler(ev.target, tiddler);
				}
			});
		}
	},
	getArguments: function(paramString, params) {
		var args = paramString.parseParams("name", null, true, false, true)[0];
		var options = {};
		for(var id in args) {
			if(true) {
				var p = args[id];
				if(id == "def") {
					options[id] = p;
				} else {
					options[id] = p[0];
				}
			}
		}
		var width = isNaN(params[1]) ? false : parseInt(params[1], 10);
		var height = isNaN(params[2]) ? false : parseInt(params[2], 10);

		options.width = macro.lookupArgument(options, "width", width);
		options.height = macro.lookupArgument(options, "height", height);
		options.preserveAspectRatio = args.preserveAspectRatio && 
			args.preserveAspectRatio[0] == "yes" ? true : false;
		options.tiddlyLink = macro.lookupArgument(options, "tiddlyLink", false);
		options.link = macro.lookupArgument(options, "link", false);
		return options;
	},
	lookupArgument: function(args, id, ifEmpty) {
		return args[id] ? args[id] : ifEmpty;
	}
};

// update views
var _oldwikifiedview = config.macros.view.views.wikified;
// update wikifier to check tiddler type before rendering
merge(config.macros.view.views, {
	wikified: function(value, place, params, wikifier, paramString, tiddler) {
		if(macro.isImageTiddler(tiddler) && params[0] == "text") {
			var newplace = $("<div />").addClass("wikifiedImage").appendTo(place)[0];
			macro.renderImage(newplace, tiddler.title, { alt: macro.locale.badImage });
		} else {
			_oldwikifiedview.apply(this, arguments);
		}
	},
	image: function(value, place, params, wikifier, paramString, tiddler) {
		// a field can point to another tiddler whereas text is the current tiddler.
		var title = params[0] == "text" ? tiddler.title : value;
		var args = macro.getArguments(paramString, params);
		macro.renderImage(place, title, args);
	}
});
config.shadowTiddlers.StyleSheetImageMacro = [".wikifiedImage svg, .wikifiedImage .image { width: 80%; }",
	".svgImageText { background-color:[[ColorPalette::Error]]; color:#ddd; display: inline-block; }",
	"span.svgImageText { display: inline-block; overflow: hidden; }"
].join("");
store.addNotification("StyleSheetImageMacro", refreshStyles);

})(jQuery);
//}}}
/***
|Name|ImageMapPlugin|
|Source|http://www.TiddlyTools.com/#ImageMapPlugin|
|Documentation|http://www.TiddlyTools.com/#ImageMapPluginInfo|
|Version|1.2.2|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|apply image maps ('hotspots') with links to tiddlers|
!!!!!Documentation
>see [[ImageMapPluginInfo]]
!!!!!Revisions
<<<
2009.05.27 [1.2.2] improved autoscroll for {{{<<mapMaker>>}}} textarea
2009.05.14 [1.2.1] added cursor changes
see [[ImageMapPluginInfo]] for additional revision details
2009.05.09 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.ImageMapPlugin= {major: 1, minor: 2, revision: 2, date: new Date(2009,5,27)};
//}}}
//{{{
config.macros.imageMap = {
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		// image element must immediately precede macro
		var img=place.lastChild; if (!img||img.nodeName!='IMG') return;
		var map=params[0]; var items=store.getTiddlerText(map,'').split('\n----\n'); if (!items) return;
		var out=['<MAP NAME="'+map+'">'];
		var fmt='<AREA SHAPE="POLY" TIDDLER="%0" COORDS="%1" TITLE="%2" ALT="%2" ONCLICK="%3" STYLE="%4">';
		var click="story.displayTiddler(story.findContainingTiddler(this),this.getAttribute('tiddler'));";
		var style='cursor:pointer';
		for (var i=0; i<items.length; i++) {
			var lines=items[i].split('\n'); var tid=lines.shift(); var coords=lines.join('');
			var tip=store.tiddlerExists(tid)?store.getTiddler(tid).getSubtitle():tid;
			out.push(fmt.format([tid,coords,tip,click,style]));
		}
		out.push('</MAP>');
		createTiddlyElement(place,'span').innerHTML=out.join('');
		img.setAttribute('isMap',true);
		img.setAttribute('useMap','#'+map);
		img.style.border=0;
	}
}
//}}}
//{{{
config.macros.mapMaker= {
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		var img=place.lastChild; // image element must immediately precede macro
		if (!img||img.nodeName!='IMG') return;
		img.onmousemove=function(ev){ ev=ev||window.event;
			var mX=!config.browser.isIE?ev.pageX:(ev.clientX+findScrollX());
			var mY=!config.browser.isIE?ev.pageY:(ev.clientY+findScrollY());
			var ta=this.nextSibling.getElementsByTagName('textarea')[0];
			var lines=ta.value.split('\n'); var last=lines.length?lines.length-1:0;
			var vals=lines[last].split(','); vals.pop(); vals.pop(); lines[last]=vals.join(',');
			lines[last]+=(lines[last].length?',':'')+(mX-findPosX(this))+','+(mY-findPosY(this));
			ta.value=lines.join('\n');
			ta.scrollTop=ta.scrollHeight-ta.offsetHeight+this.emH*2;
			ta.scrollLeft=lines[last].length*this.emW-ta.offsetWidth;
			ta.focus();
		};
		img.onmouseout=function(ev){ ev=ev||window.event;
			var ta=this.nextSibling.getElementsByTagName('textarea')[0];
			var lines=ta.value.split('\n'); var last=lines.length?lines.length-1:0;
			var vals=lines[last].split(','); vals.pop(); vals.pop(); lines[last]=vals.join(',');
			ta.value=lines.join('\n');
			ta.scrollTop=ta.scrollHeight-ta.offsetHeight+this.emH*2;
			ta.scrollLeft=lines[last].length*this.emW-ta.offsetWidth;
		};
		img.onmouseover=img.onclick=function(ev) { ev=ev||window.event;
			var mX=!config.browser.isIE?ev.pageX:(ev.clientX+findScrollX());
			var mY=!config.browser.isIE?ev.pageY:(ev.clientY+findScrollY());
			var ta=this.nextSibling.getElementsByTagName('textarea')[0];
			ta.value+=(ta.value.length?',':'')+(mX-findPosX(this))+','+(mY-findPosY(this));
			var lines=ta.value.split('\n'); var last=lines.length?lines.length-1:0;
			ta.scrollTop=ta.scrollHeight-ta.offsetHeight+this.emH*2;
			ta.scrollLeft=lines[last].length*this.emW-ta.offsetWidth;
			ta.focus();
		}
		img.style.border='1px solid #999';
		img.style.cursor='crosshair';
		var map=params[0]||'';
		var s=createTiddlyElement(place,'div');
		s.style.height=s.style.width='1em';
		img.emW=s.offsetWidth; img.emH=s.offsetHeight; // get font metrics (for auto scrolling)
		s.style.height=s.style.width='';
		s.innerHTML+='<div class="toolbar">'
			+'<a href="javascript:;" '
			+'onclick="config.macros.mapMaker.load(this.parentNode.nextSibling)">load map</a>'
			+'<a href="javascript:;" '
			+'onclick="config.macros.mapMaker.save(this.parentNode.nextSibling)">save map</a>'
			+'</div>'
			+'<textarea rows="8" style="display:block;clear:both;width:100%;" tiddler="'+map+'">'
			+store.getTiddlerText(map,'')
			+'</textarea>';
	},
	load: function(ta) {
		var tid=prompt('Enter a tiddler title:',ta.getAttribute('tiddler')||'');
		if (!tid||!tid.length) return; // cancelled by user
		ta.value=store.getTiddlerText(tid,''); ta.setAttribute('tiddler',tid);
		return false;
	},
	save: function(ta) {
		var tid=prompt('Enter a tiddler title:',ta.getAttribute('tiddler')||'NewImageMap');
		while (tid && tid.length && store.tiddlerExists(tid)) {
			if(confirm(config.messages.overwriteWarning.format([tid]))) break;
			var tid=prompt('Enter a different tiddler title:',tid);
		}
		if (!tid||!tid.length) return; // cancelled by user
		store.saveTiddler(tid,tid,ta.value,config.options.txtUserName,new Date(),['imageMap'],{});
		story.displayTiddler(null,tid);
		displayMessage('image map saved to: '+tid);
		ta.setAttribute('tiddler',tid);
		return false;
	}
}
//}}}
/***
|Name|ImageMapPluginInfo|
|Source|http://www.TiddlyTools.com/#ImageMapPlugin|
|Documentation|http://www.TiddlyTools.com/#ImageMapPluginInfo|
|Version|1.2.1|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|documentation|
|Description|documentation for ImageMapPlugin|
!!!Usage
<<<
{{{
[img[...]]<<imageMap MapName>>
}}}
applies an image map to the embedded image immediately preceding the macro.   ''~MapName'' is the title of a tiddler (or a tiddler section) that contains an ''~HR-separated list'' of items, where the first line of each item is the ''tiddler to link to'' and the second line is a ''list of polygon coordinates'' using standard HTML <AREA COORDS="..."> syntax (e.g., a ''comma-separated series of X,Y pairs'': "x1,y1,x2,y2,x3,y3,...", that trace out the desired shape).
{{{
[img[...]]<<mapMaker MapName>>
}}}
adds interactive point-and-click calculation of X,Y map coordinates that are automatically entered into a text input field that you can then edit and save to a tiddler to create an ~HR-separated map definition.
<<<
!!!imageMap Example
<<<
{{{
[img[images/california.gif]]<<imageMap ImageMapPluginInfo##county_map>>
}}}
~~//(click a county to open a tiddler)//~~
[img[images/california.gif]]<<imageMap ImageMapPluginInfo##county_map>>
<<<
!!!mapMaker example
<<<
{{{
[img[images/california.gif]]<<mapMaker ImageMapPluginInfo##county_map>>
}}}
~~//(click anywhere inside image to record x,y coordinates)//~~
[img[images/california.gif]]<<mapMaker ImageMapPluginInfo##county_map>>
<<<
!!!Revisions
<<<
2009.05.14 1.2.1 added cursor changes
2009.05.13 1.2.0 add MAP/AREA elements using innerHTML
2009.05.12 1.1.1 fixed mapMaker event handling for IE
2009.05.10 1.1.0 added {{{<<mapMaker>>}}}
2009.05.10 1.0.1 open tiddlers following current tiddler instead of at top of story column
2009.05.09 1.0.0 initial release
<<<
!!!Sample Map
<<<
{{{
!county_map
San Francisco
50,231,51,225,54,222,55,226,55,231,50,231,50,231
----
San Mateo
59,252,60,242,58,239,55,238,54,232,49,233,50,240,50,244,50,249,54,253,59,252,59,252
----
Santa Clara
94,242,90,244,80,243,75,242,66,243,60,243,58,251,63,255,70,258,75,270,79,268,95,268,97,260,97,254,94,254,93,252,97,250,94,248,95,246,94,242,94,242
----
Alameda
94,223,95,242,90,243,80,242,75,241,65,242,66,235,63,225,70,224,80,226,94,221,94,224,95,225,95,231,94,223,94,223
----
Contra Costa
97,213,97,221,83,226,69,224,63,224,62,220,67,214,73,217,79,214,98,214,96,214,97,213,97,213
----
Santa Cruz
53,254,59,251,63,255,70,258,75,268,73,273,68,273,67,266,53,254,53,254
----
San Benito
117,292,116,302,114,304,110,302,111,307,104,304,101,306,91,292,91,288,87,288,87,285,73,273,75,271,78,269,96,270,116,292,117,292,117,292
----
Monterey
128,325,86,325,83,319,83,313,78,309,78,305,64,286,64,283,67,282,67,273,73,273,87,284,86,288,90,287,91,292,101,305,104,303,110,306,113,303,126,318,128,325,128,325
----
Fresno
123,266,133,278,149,271,164,269,170,261,176,261,176,257,181,258,182,254,190,252,194,245,203,237,211,243,213,248,211,253,218,267,221,276,215,276,214,278,195,278,195,282,179,282,177,285,166,285,162,289,154,291,152,294,146,294,146,302,126,318,116,304,118,302,116,299,117,290,106,278,123,265,123,266,123,266
----
Merced
114,249,117,245,142,238,145,245,148,249,153,251,152,256,143,256,136,258,130,262,125,263,106,278,96,269,97,261,99,255,113,250,114,249,114,249
----
Madera
167,243,173,243,174,239,178,238,179,234,192,227,194,228,193,235,198,232,203,236,192,245,188,252,180,254,180,258,172,257,175,261,168,260,163,269,146,270,132,278,122,266,124,263,130,262,135,258,142,256,151,256,152,252,167,243,167,243
----
Kings
162,324,161,303,164,302,164,295,162,294,162,289,153,291,151,295,146,295,146,303,128,318,128,325,161,324,162,324,162,324
----
Tulare
232,324,233,316,234,314,229,310,229,303,228,299,230,296,219,276,213,276,212,279,193,278,193,282,177,282,176,286,164,285,161,289,163,295,164,303,160,304,161,325,232,324,232,324
----
Mono
183,182,183,188,185,194,181,200,181,209,185,211,185,213,191,218,191,224,196,227,194,235,198,233,203,236,211,243,243,243,183,182,183,182
----
Inyo
241,243,320,324,233,324,233,317,235,314,229,310,229,303,228,299,231,295,220,276,217,267,211,253,213,247,211,242,242,244,241,243,241,243
----
San Luis Obispo
111,348,97,340,86,325,127,325,129,332,139,341,144,343,145,346,150,348,156,354,156,358,159,360,161,368,157,371,153,364,136,358,133,354,131,360,126,362,126,366,120,363,112,364,111,356,106,353,112,348,111,348,111,348
----
Santa Barbara
121,387,117,383,111,381,111,365,121,362,127,367,125,362,132,360,135,353,137,359,154,365,157,372,161,368,164,372,163,394,143,390,126,384,121,387,121,387
----
Ventura
186,402,175,401,163,395,163,372,166,369,172,371,177,376,186,376,193,397,186,402,186,402
----
Los Angeles
205,409,184,402,193,397,186,376,234,376,236,388,238,408,232,416,222,420,217,424,211,420,205,409,205,409
----
Kern
240,325,128,325,130,334,139,342,150,348,159,359,162,370,167,368,176,377,235,375,237,374,239,343,241,341,241,325,240,325,240,325
----
San Bernardino
392,401,320,324,240,325,241,342,238,345,236,374,234,377,237,407,256,422,264,413,290,414,303,417,386,414,390,409,392,401,392,401
----
Riverside
379,441,388,429,387,412,303,417,289,414,263,413,255,421,260,424,260,428,265,428,265,436,271,438,275,443,352,444,379,442,379,441,379,441
----
Orange
258,441,221,421,232,415,237,407,255,421,259,424,260,428,266,428,265,438,258,443,258,441,258,441
----
San Diego
322,482,284,484,280,475,276,464,270,451,258,440,264,437,272,438,275,443,283,445,321,444,321,483,322,482,322,482
----
Imperial
378,480,321,482,322,445,378,443,382,451,378,461,383,468,382,475,378,480,378,480
----
Stanislaus
113,229,95,240,98,257,113,249,118,244,141,237,132,228,127,214,124,230,112,229,113,229,113,229
----
Mariposa
168,228,154,225,151,228,148,227,147,231,144,231,145,236,141,237,143,245,151,254,165,242,172,243,172,238,177,238,177,234,191,227,194,226,189,224,184,221,181,223,178,220,169,229,157,226,153,226,151,229,152,229,168,228,168,228
----
Alpine
173,172,172,176,164,180,164,192,179,201,185,194,183,181,173,173,173,172,173,172
----
Calaveras
125,203,127,214,132,223,144,220,165,195,163,191,158,194,150,194,135,203,125,203,125,203
----
San Joaquin
108,205,97,213,97,222,94,225,95,240,113,229,124,229,127,215,125,203,120,206,107,206,108,205,108,205
----
Amador
125,189,126,194,125,203,135,203,150,194,158,194,163,191,164,179,154,186,142,189,124,189,125,189,125,189
----
Sacramento
83,212,96,213,107,205,118,205,124,203,125,195,123,188,120,180,104,180,106,189,103,197,102,203,94,206,93,210,79,212,83,212,83,212
----
Yolo
102,174,98,174,97,170,92,165,68,164,74,178,79,181,81,189,91,190,93,187,97,187,99,197,104,197,106,189,104,180,102,174,102,174
----
Solano
79,197,72,204,73,209,82,211,94,210,95,205,103,203,104,196,98,196,97,186,91,187,90,190,80,189,78,193,79,197,79,197
----
Napa
58,177,59,183,65,192,65,205,71,204,79,197,77,192,80,188,78,181,73,178,67,164,64,166,64,173,58,177,58,177
----
Sonoma
24,168,48,165,56,175,57,182,64,192,64,203,45,198,43,191,32,180,31,176,23,168,24,168,24,168
----
Marin
44,210,50,212,52,216,57,218,60,217,59,212,62,210,64,203,46,199,43,209,44,210,44,210
----
Tuolumne
165,195,144,219,131,223,132,227,142,237,146,236,145,230,149,230,149,226,154,228,155,225,169,228,178,220,182,222,185,221,190,225,190,218,185,213,185,210,180,209,180,200,165,193,164,196,165,195,165,195
----
Mendocino
10,107,16,116,16,126,15,132,20,151,21,161,24,169,50,165,43,158,46,155,46,150,43,145,45,137,53,132,53,114,56,109,11,108,10,107,10,107
----
Humboldt
21,38,17,50,19,59,12,70,9,70,1,85,2,92,10,107,31,108,33,73,32,65,39,65,39,59,45,53,43,51,44,42,33,43,30,37,21,37,21,38,21,38
----
Del Norte
24,14,19,24,20,37,29,37,32,43,37,42,38,37,35,34,42,31,43,21,50,15,24,14,24,14
----
Siskiyou
130,19,51,15,44,21,43,31,36,33,39,37,38,43,43,42,42,50,45,53,54,57,55,61,59,61,59,65,64,61,69,63,67,54,71,52,76,54,80,48,90,46,90,55,131,57,132,31,129,30,130,19,130,19
----
Modoc
183,22,130,19,131,57,179,60,182,22,183,22,183,22
----
Trinity
56,98,57,102,55,105,55,109,31,108,33,72,31,65,39,65,40,58,44,52,54,57,55,61,58,61,58,65,65,61,69,63,67,53,71,52,76,55,79,47,90,46,90,55,90,59,75,70,70,84,56,98,56,98
----
Shasta
124,95,120,96,115,94,111,96,94,96,83,97,78,95,71,98,67,96,57,98,69,84,74,70,90,59,89,54,131,57,132,93,124,95,124,95
----
Tehama
130,105,125,110,109,116,104,122,93,122,93,124,53,122,53,114,57,108,55,106,56,101,56,97,65,96,71,98,77,95,84,98,94,97,112,96,116,94,120,96,123,95,126,98,126,101,130,105,130,105
----
Lake
64,150,67,162,64,167,64,173,58,178,50,164,42,159,46,154,46,149,43,145,45,137,52,133,55,131,61,132,61,141,55,141,54,143,57,149,63,151,64,151,64,150,64,150
----
Colusa
95,143,92,149,92,156,94,164,67,163,64,151,57,149,53,143,56,141,83,142,84,140,87,141,89,143,95,143,95,143
----
Glenn
99,131,97,133,97,137,101,139,96,143,89,143,86,141,82,140,82,142,60,142,61,132,55,131,53,123,92,123,99,131,99,131
----
Sutter
113,166,111,170,111,179,103,180,102,174,97,173,97,169,93,164,92,156,91,149,108,151,108,157,113,166,113,166
----
Butte
120,143,115,144,115,146,107,151,91,149,95,143,101,139,96,137,96,132,99,131,92,123,102,122,109,116,125,109,128,117,126,124,130,128,132,135,126,140,121,138,120,143,120,143
----
El Dorado
170,160,163,160,157,164,149,164,148,167,131,166,122,177,126,188,143,188,155,185,162,180,172,176,173,172,170,169,170,160,170,160
----
Placer
171,152,146,151,138,158,135,158,129,163,121,161,113,165,111,170,111,179,120,179,122,177,131,166,146,168,150,164,157,164,163,161,171,160,171,153,171,152,171,152
----
Yuba
135,145,131,145,129,148,124,150,122,159,113,166,108,157,108,151,115,146,115,143,122,143,120,139,127,140,133,135,135,134,135,145,135,145
----
Nevada
172,143,150,142,146,139,136,144,131,144,129,148,124,150,122,161,130,164,136,157,138,158,146,151,170,152,171,143,171,144,172,143,172,143
----
Sierra
172,131,145,130,139,126,134,134,134,145,145,139,150,143,172,144,173,131,172,131,172,131
----
Plumas
141,94,124,94,126,102,130,105,125,110,128,117,126,124,130,129,132,134,140,126,145,130,168,131,171,124,169,117,154,102,149,103,148,106,141,102,141,93,141,94,141,94
----
Lassen
177,93,174,130,167,131,170,124,169,115,153,101,148,104,148,106,141,103,141,93,132,93,131,59,179,60,176,94,177,93,177,93
!end county_map
}}}
<<<
***/
 
!Welcome to the AIM - Instructions
Welcome to the AMBIT AIM (Adolescent Integrative Measure), which is a [[Licensed|AIM Creative Commons Licence]] resource, freely available for general use subject to the terms of its Creative Commons License.  [stuff on Authors, etc, here]

!How to use this:
Instructions for completing the assessment are included at the top of the [[AIM Form]]. Once you have completed the [[AIM Form]] you can [[Export data from the AIM]] so that it can easily be pasted into a local database.
 
!@@color(red):Confidentiality:@@
Please note that filling in an AIM questionnaire @@color(red):WILL NOT SAVE ANY DETAILS ABOUT YOUR CLIENT ONLINE@@ - all of the data that you input is only //ever// held on your local computer - this is because of the way that the software that this runs on ([[Tiddlywiki|www.tiddlywiki.com]]) works.

!Additional functions:
*''__Exporting data__'' - Using the AIM in the:{{{http://ambit-aim.tiddlyspace.com}}} space will give you scores that can be [[exported|Export data from the AIM]] to your local database.

*''__Ranking suggested interventions:__'' You will also see a link to generate a list of [[AIM suggested interventions]], but this will ''not'' generate any suggestions //''unless you are viewing the AIM when it is included as part of a __treatment manual__''//.  
**Because of the way that TiddlySpace works, the whole AIM questionnaire can very easily be [[included]] within another 'space' (or wiki); 
**indeed, it is //designed to be included// as part of wiki-based TREATMENT MANUALS (see @tiddlymanuals  or {{{www.tiddlymanuals.com}}}) such as the @ambit manual, or its local adaptations. 
**If you visit, say, the @ambit manual, you will find this same AIM questionnaire embedded within a rich mentalization-based framework for managing high risk, multi-problem, complex youth.  
**In these treatment manual(s), the individual items in the AIM are each '[[tagged|Tags]]' with what the AMBIT project's authorial team has considered to be the best evidence-based approach(es) to work in that specific problem area.  
**Clicking on [[AIM suggested interventions]] ''in a tiddlymanual'' once you have completed an AIM ''will generate ranked lists of these suggested interventions, as direct links to manualized content''.
**These ranked lists are not "therapy by numbers" - they can be sorted in different ways, for instance according to whether you want to address the MOST SEVERE PROBLEMS as a priority, or focus on the intervention(s) that are the MOST FREQUENTLY INDICATED across the range of difficulties that you have just mapped out.  You can limit your suggestions to just those problems identified as "Key Problems".  The idea is to offer a more or less objective prompt for the practitioner along the lines of ''"Are you offering the interventions that this set of problems requires, or your //favourite ones//?"''

!!Developing new evidence and new treatments
Because @tiddlymanuals are designed to be flexible, and adaptable to different settings and to the developing evidence base, new treatments (or adaptations of the core AMBIT content) are invited to include the {{{@ambit-AIM}}} space, and to edit the tags on individual AIM items, to suit the range of treatments that they are offering.

/*{{{*/
config.macros.localOrNot = {
	handler: function(place, macroName, params, wikifier, paramString, tiddler) {
		var $ = jQuery,
			coreBag = "ambit-content_public",
			encodedTitle = encodeURIComponent(tiddler.title),
			bag = tiddler.fields['server.bag'],
			diffURL;
		if(config.filterHelpers.is.local(tiddler)) {
			// it's local, so check core manual
			$.get("/bags/"+coreBag+"/tiddlers/"+encodedTitle+".json", function(t) {
				if(t && t.fields) {
					// there's a version on the core, make local click open the side-by-side view
					diffURL = "diff?rev2=bags/"+bag+"/"+encodedTitle+"/"+tiddler.fields['server.page.revision']+"&rev1=bags/"+encodeURIComponent(t.bag)+"/"+encodedTitle+"/"+t.revision+"&format=horizontal";
					
					place.innerHTML = '<a href="'+diffURL+'" target="_blank" title="Click to see comparison with core manual">local</a>';
				}
			});
			// alter the background-colour of the closest .headingPanel
			$(place)
				.closest('.headingPanel')
				.addClass('local');
		}
	}
};
/*config.macros.localOrNot = {
	// NB: hard-coding comparison to ambit-content space
	handler: function(place, macroName, params, wikifier, paramString, tiddler) {
		var coreBag = "ambit-content_public",
			bag = tiddler.fields['server.bag'],
			host = tiddler.fields['server.host'],
			bagStem = bag.substring(0,bag.lastIndexOf('_')),
			hostStem = host.substring(host.indexOf('http://')+7,host.indexOf('.')),
			diffURL,
			encodedTitle = encodeURIComponent(tiddler.title),
			$ = jQuery;
		if(bagStem===hostStem) {
			// it's local, so check core manual

			$.get("/bags/"+coreBag+"/tiddlers/"+encodedTitle+".json", function(t) {
				if(t && t.fields) {
					// there's a version on the core, make local click open the side-by-side view
					diffURL = "diff?rev2=bags/"+bag+"/"+encodedTitle+"/"+tiddler.fields['server.page.revision']+"&rev1=bags/"+encodeURIComponent(t.bag)+"/"+encodedTitle+"/"+t.revision+"&format=horizontal";
					
					place.innerHTML = '<a href="'+diffURL+'" target="_blank" title="Click to see comparison with core manual">local</a>';
				
					// alter the background-colour of the closest .headingPanel
					jQuery(place)
						.closest('.headingPanel')
						.css('backgroundColor', '#FCEBFF');				
				}
			});
		}
	}
};*/
/*}}}*/
[[GettingStarted]]
[[AIM Form]]
<!--{{{-->
<link rel="shortcut icon" href="/recipes/ambit-aim_public/tiddlers/favicon.ico" />
<link href="/bags/ambit-aim_public/tiddlers.atom" rel="alternate"
	type="application/atom+xml" title="ambit-aim's public feed" />
<link rel="canonical" href="http://ambit-aim.tiddlyspace.com/" />
<!--}}}-->
/***
|Name:|NewHerePlugin|
|Description:|Creates the new here and new journal macros|
|Version:|3.0 ($Rev: 3861 $)|
|Date:|$Date: 2008-03-08 10:53:09 +1000 (Sat, 08 Mar 2008) $|
|Source:|http://mptw.tiddlyspot.com/#NewHerePlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License|http://mptw.tiddlyspot.com/#TheBSDLicense|
***/
//{{{
merge(config.macros, {
	newHere: {
		handler: function(place,macroName,params,wikifier,paramString,tiddler) {
			wikify("<<newTiddler "+paramString+" tag:[["+tiddler.title+"]]>>",place,null,tiddler);
		}
	},
	newJournalHere: {
		handler: function(place,macroName,params,wikifier,paramString,tiddler) {
			wikify("<<newJournal "+paramString+" tag:[["+tiddler.title+"]]>>",place,null,tiddler);
		}
	}
});

//}}}
/***
|Name:|NewMeansNewPlugin|
|Description:|If 'New Tiddler' already exists then create 'New Tiddler (1)' and so on|
|Version:|1.1 ($Rev: 2263 $)|
|Date:|$Date: 2007-06-13 04:22:32 +1000 (Wed, 13 Jun 2007) $|
|Source:|http://mptw.tiddlyspot.com/empty.html#NewMeansNewPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License|http://mptw.tiddlyspot.com/#TheBSDLicense|
!!Note: I think this should be in the core
***/
//{{{

String.prototype.getNextFreeName = function() {
       var numberRegExp = / \(([0-9]+)\)$/;
       var match = numberRegExp.exec(this);
       if (match) {
               var num = parseInt(match[1]) + 1;
               return this.replace(numberRegExp," ("+num+")");
       }
       else {
               return this + " (1)";
       }
}

config.macros.newTiddler.checkForUnsaved = function(newName) {
	var r = false;
	story.forEachTiddler(function(title,element) {
		if (title == newName)
			r = true;
	});
	return r;
}

config.macros.newTiddler.getName = function(newName) {
       while (store.getTiddler(newName) || config.macros.newTiddler.checkForUnsaved(newName))
               newName = newName.getNextFreeName();
       return newName;
}


config.macros.newTiddler.onClickNewTiddler = function()
{
	var title = this.getAttribute("newTitle");
	if(this.getAttribute("isJournal") == "true") {
		var now = new Date();
		title = now.formatString(title.trim());
	}

	title = config.macros.newTiddler.getName(title); // <--- only changed bit

	var params = this.getAttribute("params");
	var tags = params ? params.split("|") : [];
	var focus = this.getAttribute("newFocus");
	var template = this.getAttribute("newTemplate");
	var customFields = this.getAttribute("customFields");
	story.displayTiddler(null,title,template,false,null,null);
	var tiddlerElem = document.getElementById(story.idPrefix + title);
	if(customFields)
		story.addCustomFields(tiddlerElem,customFields);
	var text = this.getAttribute("newText");
	if(typeof text == "string")
		story.getTiddlerField(title,"text").value = text.format([title]);
	for(var t=0;t<tags.length;t++)
		story.setTiddlerTag(title,tags[t],+1);
	story.focusTiddler(title,focus);
	return false;
};

//}}}
//{{{
config.filters.numbersort = function(results,match) {
	var field = match[3];
	results = results.sort(function(a, b) {
		var val1 = a[field] || a.fields[field];
		var val2 = b[field] || b.fields[field];
		return parseFloat(val1, 10) < parseFloat(val2, 10) ? -1 : 1;
	});
	return results;
};
//}}}
<!--{{{-->
<div id="displayArea">
		<div id="messageArea"></div>
		<!-- AMBIT HTML build here -->
		<div id="header">
			<span id="SiteIcon" macro="image SiteIcon"></span>
			<h1><span id="SiteTitle" class='siteTitle' refresh='content' tiddler='SiteTitle'></span> <span id="SiteSubtitle" class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span></h1>
			<img id="logo" src="http://ambit-theme.tiddlyspace.com/ambit_logo_dark.png" alt="AMBIT logo" />			
			<img id="annafreudlogo" src="http://ambit-theme.tiddlyspace.com/annafreud_logo_dark.png" alt="Anna Freud Centre logo" />
		</div>
		<div id="mainpane">
			<div id="tiddlerDisplay">
			</div> <!-- tiddlerDisplay -->
			<div id="sidebar">
				<div class="tools">
					<div macro="buttonPermaviewMacro"></div>
					<h2>Tools</h2>
				</div>
				<div class="wrap">
					<div id="search" class="module">
						<h2>Search</h2>
						<div class="moduleContent">
							<span macro="searchBox"></span>
						</div>
					</div>
					<div id="history" class="module">
						<h2>History</h2>
						<div class="moduleContent">
							<div macro="history"></div>
						</div>
					</div>
					<div id="youAreReading" class="module">
						<h2>You are reading</h2>
						<div class="moduleContent">
							<div macro="youAreReading"></div>
						</div>
					</div>
					<div id="contents" class="module">
						<h2>Contents</h2>
						<div class="moduleContent">
							<div id='mainMenu' refresh='content' tiddler='MainMenu'></div>
						</div>
					</div>
				</div>	
			</div> <!-- sidebar -->
		 </div> <!-- mainpane -->
	</div> <!-- displayArea -->
<!--}}}-->
List of plugins used by ambit, and the reason for their inclusion.

!!Other
SyncPlugin
JStorage
CloseOnCancelPlugin
ExtendTagButtonPlugin
ExtraFiltersPlugin
hijackCreateTagButton
NewHerePlugin
NewMeansNewPlugin
PrettyDatesPlugin
PrintClientNotesPlugin
QuickOpenTagPlugin
RecentChangesPlugin
RenameTagsPlugin
resetPlugin
SelectThemePlugin
SimpleSearchPlugin
StorySaverPlugin
TagglyTaggingPlugin
TemplateFormatterPlugin
TemplatePlugin
ValueSwitcherPlugin
zAutoUpdater
zConfigTweaks


!!Standard TiddlySpace plugins
BinaryTiddlersPlugin
BinaryUploadPlugin
BreadcrumbsPlugin
chrjs
chrjs.space
chrjs.users
DiffFormatter
ErrorHandler
GroupByPlugin
ImageMacroPlugin
LazyTiddlersPlugin
RandomColorPalettePlugin
RevisionsCommandPlugin
ServerSideSavingPlugin
TiddlyFileImporter
TiddlySpaceBackstage
TiddlySpaceChangePassword
TiddlySpaceCloneCommand
TiddlySpaceConfig
TiddlySpaceFilters
TiddlySpaceFollowingPlugin
TiddlySpaceIdentities
TiddlySpaceInclusion
TiddlySpaceInit
TiddlySpaceLinkPlugin
TiddlySpaceMembers
TiddlySpacePublishingCommands
TiddlySpaceRevertRevision
TiddlySpaceRevisionView
TiddlySpaceSpaces
TiddlySpaceTiddlerIconsPlugin
TiddlySpaceToolbar
TiddlySpaceUserControls
TiddlySpaceViewTypes
TiddlyWebAdaptor
TiddlyWebConfig
ToggleTiddlerPrivacyPlugin
/***
|Name:|PrettyDatesPlugin|
|Description:|Provides a new date format ('pppp') that displays times such as '2 days ago'|
|Version:|1.0 ($Rev: 3646 $)|
|Date:|$Date: 2008-02-27 02:34:38 +1000 (Wed, 27 Feb 2008) $|
|Source:|http://mptw.tiddlyspot.com/#PrettyDatesPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License:|http://mptw.tiddlyspot.com/#TheBSDLicense|
!!Notes
* If you want to you can rename this plugin. :) Some suggestions: LastUpdatedPlugin, RelativeDatesPlugin, SmartDatesPlugin, SexyDatesPlugin.
* Inspired by http://ejohn.org/files/pretty.js
***/
//{{{
Date.prototype.prettyDate = function() {
	var diff = (((new Date()).getTime() - this.getTime()) / 1000);
	var day_diff = Math.floor(diff / 86400);

	if (isNaN(day_diff))      return "";
	else if (diff < 0)        return "in the future";
	else if (diff < 60)       return "just now";
	else if (diff < 120)      return "1 minute ago";
	else if (diff < 3600)     return Math.floor(diff/60) + " minutes ago";
	else if (diff < 7200)     return "1 hour ago";
	else if (diff < 86400)    return Math.floor(diff/3600) + " hours ago";
	else if (day_diff == 1)   return "Yesterday";
	else if (day_diff < 7)    return day_diff + " days ago";
	else if (day_diff < 14)   return  "a week ago";
	else if (day_diff < 31)   return Math.ceil(day_diff/7) + " weeks ago";
	else if (day_diff < 62)   return "a month ago";
	else if (day_diff < 365)  return "about " + Math.ceil(day_diff/31) + " months ago";
	else if (day_diff < 730)  return "a year ago";
	else                      return Math.ceil(day_diff/365) + " years ago";
}

Date.prototype.formatString_orig_mptw = Date.prototype.formatString;

Date.prototype.formatString = function(template) {
	return this.formatString_orig_mptw(template).replace(/pppp/,this.prettyDate());
}

// for MPTW. otherwise edit your ViewTemplate as required.
// config.mptwDateFormat = 'pppp (DD/MM/YY)'; 
config.mptwDateFormat = 'pppp'; 

//}}}
PrintClientNotes = {
	tiddlers: {},
	getSince: function() {
		var t = store.getTiddler("Print ClientNotes");
		var since = t.fields.since;
		return since || "";
	},
	storeSince: function(since) {
		if(typeof since!=="string") {
			since = since.convertToYYYYMMDDHHMM();
		}
		var t = store.getTiddler("Print ClientNotes");
		t.fields.since = since;
		return since;
	},
	addToLog: function() {
		var now = new Date();
		var head = "| !date | !type | !print since |\n";
		var tiddler = store.getTiddler("PrintHistory");
		if (!tiddler) {
			tiddler = new Tiddler();
			tiddler.title = "PrintHistory";
			tiddler.text = head;
			tiddler.created = now;
		}
		if(tiddler.text.indexOf(head)===-1) {
			tiddler.text = head + tiddler.text;
		}
		var since = this.getSince();
		if(!since) {
			type = "Print all";
		} else {
			type = since;
		}
		var text ="| "+now.formatString("0DD/0MM/YYYY 0hh:0mm:0ss") + " (" + now.convertToYYYYMMDDHHMM() + ")"+" | "+type+" | <<chkPrintSince>> |\n";
		tiddler.text = tiddler.text + text;
		tiddler.modifier = config.options.txtUserName;
		tiddler.modified = now;
		store.addTiddler(tiddler);
		// refresh and notify for immediate update
		// goal is to get the Print ClientNotes tiddler to update
		//story.refreshTiddler(tiddler.title);
		//store.notify(tiddler.title, true);
	},
	print: function(str) {
		var srcWindow = window.open("", "sourceWindow", "width=700,height=600");
		var srcDocument = srcWindow.document;
		srcDocument.write("<html><head></head><body>" + str + "</body></html>");
		srcDocument.close();
		//srcDocument.print(); - there is a command for this, but it's not this
	}
};

config.macros.printClientNotes = {
	onclick: function() {
		PrintClientNotes.addToLog();
		if(PrintClientNotes.tiddlers) {
			// this only gets section tiddlers, change later to deal with all tiddlers - probably shape the templates somehow
			var str = "";
			var section, notes, note;
			for(var i in PrintClientNotes.tiddlers) {
				section = store.getTiddler(i);
				notes = PrintClientNotes.tiddlers[i];
				str += expandTemplate("ClientNotesSectionTemplate",[section]);
				for(var j=0;j<notes.length;j++) {
					note = store.getTiddler(notes[j]);
					str += expandTemplate("ClientNotesNoteTemplate",[note]);
				}
			}
			PrintClientNotes.print(str);
		} else {
			displayMessage('no tiddlers to print');
		}
	},
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		createTiddlyButton(place, "Print", "Print ClientNotes", config.macros.printClientNotes.onclick, "button");
	}
};

config.macros.chkPrintSince = {
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		var dateField = place.parentNode.getElementsByTagName('td')[0];
		var start = dateField.innerHTML.indexOf('(');
		var end = dateField.innerHTML.indexOf(')',start);
		var mySince;
		if(start && end) {
			// assumes dateField has (YYYYMMDDHHMM) after the human-readable date
			mySince = dateField.innerHTML.substring(start+1,end);
		}
		if(!mySince) {
			throw new Error('could not find date field for this row');
		}
		var change = function() {
			// update since and refresh Print ClientNotes tiddler
			return true;
		};
		var c = document.createElement("input");
		c.setAttribute("type","checkbox");
		c.className = "chkPrintSince";
		c.onclick = change;
		var since = PrintClientNotes.getSince();
		if(since === mySince) {
			c.checked = true;
		} else {
			c.checked = false;
		}
		place.appendChild(c);
		return c;
	}
};

config.macros.createTagGroup = {

	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		var title = params[0];
		var list = store.getTaggedTiddlers(title);
		var sortBy = "title";
		var sortOrder = "asc";

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

		PrintClientNotes.tiddlers = {};
		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]] = "";
						PrintClientNotes.tiddlers[list[i].tags[j]] = [];
					}

					allTagsHolder[list[i].tags[j]] += "**[["+list[i].title+"]]\n";
					PrintClientNotes.tiddlers[list[i].tags[j]].push(list[i].title);

					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]+"]]\n";
		}

		var output = "";

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

		for (var i=0;i<allTags.length;i++) {
			if (allTagsHolder[allTags[i]] != "") {
				output += "*[["+allTags[i]+"]]\n" + allTagsHolder[allTags[i]];
			}
		}

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

		wikify(output,place);
	}
};
/***
|Name:|QuickOpenTagPlugin|
|Description:|Changes tag links to make it easier to open tags as tiddlers|
|Version:|3.0.1 ($Rev: 3861 $)|
|Date:|$Date: 2008-03-08 10:53:09 +1000 (Sat, 08 Mar 2008) $|
|Source:|http://mptw.tiddlyspot.com/#QuickOpenTagPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License:|http://mptw.tiddlyspot.com/#TheBSDLicense|
***/
//{{{
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 do this: <<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(params[0]);
		var filter = params[1]; // new feature
		var ul = createTiddlyElement(place,"ul");
		if(tags.length == 0)
			createTiddlyElement(ul,"li",null,"listTitle",this.noTags);
		for(var t=0; t<tags.length; t++) {
			var title = tags[t][0];
			if (!filter || (title.match(new RegExp('^'+filter)))) {
				var info = getTiddlyLinkInfo(title);
				var theListItem =createTiddlyElement(ul,"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: [
"/*{{{*/",
"/* created by QuickOpenTagPlugin */",
".tagglyTagged .quickopentag, .tagged .quickopentag ",
"	{ margin-right:1.2em; border:1px solid #eee; padding:2px; padding-right:0px; padding-left:1px; }",
".quickopentag .tiddlyLink { padding:2px; padding-left:3px; }",
".quickopentag a.button { padding:1px; padding-left:2px; padding-right:2px;}",
"/* extra specificity to make it work right */",
"#displayArea .viewer .quickopentag a.button, ",
"#displayArea .viewer .quickopentag a.tiddyLink, ",
"#mainMenu .quickopentag a.tiddyLink, ",
"#mainMenu .quickopentag a.tiddyLink ",
"	{ border:0px solid black; }",
"#displayArea .viewer .quickopentag a.button, ",
"#mainMenu .quickopentag a.button ",
"	{ margin-left:0px; padding-left:2px; }",
"#displayArea .viewer .quickopentag a.tiddlyLink, ",
"#mainMenu .quickopentag a.tiddlyLink ",
"	{ margin-right:0px; padding-right:0px; padding-left:0px; margin-left:0px; }",
"a.miniTag {font-size:150%;} ",
"#mainMenu .quickopentag a.button ",
"	/* looks better in right justified main menus */",
"	{ margin-left:0px; padding-left:2px; margin-right:0px; padding-right:0px; }", 
"#topMenu .quickopentag { padding:0px; margin:0px; border:0px; }",
"#topMenu .quickopentag .tiddlyLink { padding-right:1px; margin-right:0px; }",
"#topMenu .quickopentag .button { padding-left:1px; margin-left:0px; border:0px; }",
"/*}}}*/",
		""].join("\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;
		store.addNotification("QuickOpenTagStyles",refreshStyles);
	}
}

config.quickOpenTag.init();

//}}}
/***
|''Name''|RandomColorPalettePlugin|
|''Description''|Adds a random color palette to TiddlyWiki|
|''Author''|Jon Robson|
|''Version''|1.4.0|
|''Status''|stable|
|''Source''|https://github.com/jdlrobson/TiddlyWikiPlugins/raw/master/plugins/RandomColorPalettePlugin/RandomColorPalettePlugin.js|
|''License''|[[BSD|http://www.opensource.org/licenses/bsd-license.php]]|
!Usage
{{{
<<RandomColorPalette>>
}}}
Sets and saves a random color palette on execution

{{{
<<RandomColorPaletteButton>>
}}}
Creates a button, which when clicked will change the color palette
More information at http://macros.tiddlyspace.com/#%5B%5BRandomColorPaletteButton%20macro%5D%5D
!Code
***/
//{{{
RGB.prototype.toRGBString = function() {
	return "rgb(%0,%1,%2)".format(parseInt(this.r * 255, 10),
		parseInt(this.g * 255, 10), parseInt(this.b * 255, 10))
}
function HSL_TO_RGB(h, s, l) { // h (hue) between 0 and 360, s (saturation) & l (lightness) between 0 and 1
	var c = l <= 0.5 ? 2 * l * s : ( 2 - (2 * l)) * s;
	var h1 = h / 60;
	var x = c * (1 - Math.abs((h1 % 2) - 1)); 
	var r, g, b;
	if(typeof(h) == 'undefined') {
		r = 0;
		g = 0;
		b = 0;
	} else if(0 <= h1 && h1 < 1) {
		r = c;
		g = x;
		b = 0;
	} else if(1 <= h1 && h1 < 2) {
		r = x;
		g = c;
		b = 0;
	} else if(2 <= h1 && h1 < 3) {
		r = 0;
		g = c;
		b = x;
	} else if(3 <= h1 && h1 < 4) {
		r = 0;
		g = x;
		b = c;
	} else if(4 <= h1 && h1 < 5) {
		r = x;
		g = 0;
		b = c;
	} else if(5 <= h1 && h1 < 6) {
		r = c;
		g = 0;
		b = x;
	}
	m = l - (0.5 * c);
	return new RGB(r + m, g + m, b + m);
}

(function($){
	var macro = config.macros.RandomColorPalette = {
		messagesOn: false, 
		changedPaletteText: "We have assigned you a random theme by adjusting the [[ColorPalette]] tiddler.\nDon't like it? Click <<RandomColorPalette>> for another one.", 
		handler: function(place, macroName, params, wikifier, paramString, tiddler) {
			paramString = paramString || "";
			var options = macro.getOptions(paramString);
			macro.generatePalette(options, true);
		},
		optionTypes: {
			floats: ["hue", "saturation", "darkest", "lightness", "huevariance", "dark", "pale", "light", "mid",
				"saturation_light", "saturation_pale", "saturation_mid", "saturation_dark"
			]
		},
		getOptions: function(paramString) {
			var args = paramString.parseParams("name", null, true, false, true)[0];
			var options = {};
			var numbers = macro.optionTypes.floats;
			for(var i in args) {
				options[i] = numbers.indexOf(i) > -1 ? parseFloat(args[i][0], 10) : args[i][0];
			}
			return options;
		},
		generateRandomNumber: function(min, max, info) {
			var num = (Math.random() * 1);
			info = !info ? { attempts:0 } : info;
			info.attempts += 1;
			var good = true;
			if(min == max) {
				return max;
			}
			if(min && num < min) {
				good = false;
			} else if(max && num > max) {
				good = false;
			}
			if(!good) {
				if(info.attempts < 5) {
					return macro.generateRandomNumber(min, max, info);
				} else {
					if(max) {
						return max;
					} else if(min) {
						return min;
					} else {
						return 1;
					}
				}
			}
			return num;
		},
		getExistingPalette: function(asJSON) {
			var title = "ColorPalette";
			var tiddlerText;
			if(store.tiddlerExists(title)) {
				tiddlerText = store.getTiddlerText(title);
			} else if(store.isShadowTiddler(title)){
				tiddlerText = config.shadowTiddlers[title];
			}
			if(asJSON) {
				var json = {};
				if(tiddlerText) {
					var lines = tiddlerText.split("\n");
					for(var i = 0; i < lines.length; i++) {
						var definition = lines[i].split(":");
						if(definition.length == 2) {
							var name = definition[0].trim();
							var value = definition[1].trim();
							json[name] = value;
						}
					}
				}
				return json;
			} else {
				return tiddlerText;
			}
		},
		generatePalette: function(options, save) {
			var outputRGB = options.rgb;
			var palette = macro.getExistingPalette(true);
			var hue = options.hue || Math.floor(Math.random() * 359);
			var saturation = options.saturation || macro.generateRandomNumber(0.3, 0.7);
			var dark = options.dark || options.darkest || macro.generateRandomNumber(0, 0.10);
			var pale = options.pale || options.lightness || macro.generateRandomNumber(0.90, 1);
			var delta = ( ( pale - dark ) / 3 );
			var mid = options.mid || dark + delta;
			var light = options.light || dark + (delta * 2);
			var lightness_values = {Dark: dark, Mid: mid, Light: light, Pale: pale};
			var saturation_values = {};
			for(i in lightness_values) {
				if(true) {
					saturation_values[i] = options["saturation_" + i.toLowerCase()] || saturation;
				}
			}

			var opposite_hue = (hue + 180) % 360;
			var seed = options.huevariance || Math.floor((85 * Math.random()) + 5); // we want it to be at least 5 degrees
			var huetwo = (opposite_hue + seed) % 360;
			var huethree = (opposite_hue - seed) % 360;
			if(huetwo < 0) {
				huetwo = 360 + huetwo;
			}
			if(huethree < 0) {
				huethree = 360 + huethree;
			}
			for(var j in lightness_values) {
				if(true) {
					var saturation = saturation_values[j];
					palette["Primary" + j] = HSL_TO_RGB(hue, saturation, lightness_values[j]);
					palette["Secondary" + j] = HSL_TO_RGB(huetwo, saturation, lightness_values[j]);
					palette["Tertiary" + j] = HSL_TO_RGB(huethree, saturation, lightness_values[j]);
				}
			}
			palette.Background = HSL_TO_RGB(hue, saturation, 0.92);
			palette.Foreground = HSL_TO_RGB(hue, saturation, 0.08);
			palette.ColorPaletteParameters = ["HSL([", hue, "|", seed, "], [", saturation_values.Pale, "|",
				saturation_values.Light, "|", saturation_values.Mid, "|", saturation_values.Dark, "],",
				"[", dark, "|", mid, "|", light, "|", pale, "])"].join("");
			// construct new ColorPalette
			var text = ["/*{{{*/\n"];
			var colorcode;
			for(var id in palette) {
				if(true) {
					var color = palette[id];
					colorcode = outputRGB ? color.toRGBString() : color.toString();
					text.push("%0: %1\n".format(id, colorcode));
				}
			}
			text.push("/*}}}*/");
			text = text.join("");
			if(save) {
				macro.saveColorPalette(text);
			}
			return text;
		},
		saveColorPalette: function(text) {
			var tid = store.getTiddler("ColorPalette");
			if(!tid) {
				tid = new Tiddler("ColorPalette");
				tid.fields = merge({}, config.defaultCustomFields);
			} // TODO: detect that the ColorPalette in the space comes from outside recipe
			tid.fields["server.page.revision"] = "false"; // edit conflicts dont matter

			// save the color palette in tid
			tid = store.saveTiddler(tid.title, tid.title, text, tid.modifier, tid.modified,
				tid.tags, tid.fields, false, tid.created, tid.creator);
			// an interval is used to cope with users clicking on the palette button quickly.
			if(macro._nextSave) {
				window.clearTimeout(macro._nextSave);
			}
			macro._nextSave = window.setTimeout(function() {
					autoSaveChanges(null, [tid]);
				}, 2000);
			// temporary workaround for IE.
			$.twStylesheet.remove({ id: "StyleSheetColors" });
			$.twStylesheet.remove({ id: "StyleSheet" });
			refreshAll();
			macro.reportChange();
			return tid;
		},
		reportChange: function() {
			if(macro.messagesOn) { // only display message once..
				var msgPlace = getMessageDiv();
				if(!$(".changedPalette", msgPlace)[0]) {
					var tempPlace = document.createElement("div");
					wikify("{{changedPalette{" + macro.changedPaletteText + "}}}", tempPlace);
					msgPlace.appendChild(tempPlace);
				}
			}
		}
	};
	var btnMacro = config.macros.RandomColorPaletteButton = {
			text: "New ColorPalette",
			tooltip: "Generate a random colour scheme for your TiddlyWiki",
			makeButton: function(place, options) {
				var btnHandler = function(ev) {
					var t = $(ev.target);
					var options = t.data("options");
					macro.generatePalette(options, true);
					ev.preventDefault();
					return false;
				};
				var btn = createTiddlyButton(place, this.text, this.tooltip, btnHandler);
				$(btn).data("options", options);
				return btn;
			},
			handler: function(place, macroName, params, wikifier, paramString, tiddler) {
				var options = macro.getOptions(paramString);
				btnMacro.makeButton(place, options);
			}
	};
})(jQuery);
//}}}
/***
|''Name''|RandomSortFilter|
|''Version''|0.1.2|
!Description
Updates the sort filter to take a keyword *random
!Usage
{{{
[sort[*random]]
}}}
***/
//{{{
(function() {
var _sort = config.filters.sort;
config.filters.sort = function(results,match) {
	if(match[3] === "*random") {
		results = results.sort(function(a, b) {
			var r = Math.random();
			return r < 0.5 ? -1 : 1;
		});
		return results;
	} else {
		return _sort.apply(this, arguments);
	}
};
})();
//}}}
/***
|Name|RecentChangesPlugin|
|Source|http://www.TiddlyTools.com/#RecentChangesPlugin|
|Version|1.0.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|display droplist of recently changed tiddlers with goto, edit, and preview buttons|
!!!!!Usage
<<<
The {{{<<recentChanges>>}}} macro displays a droplist of all tiddlers that have been changed within the last N days (default=10 days).  
<<<
!!!!!Examples
<<<
{{{<<recentChanges>>}}}
<<recentChanges>>
or
{{{<<recentChanges #ofdays previewheight previewclass>>}}}
where:
* #ofdays specifies the time limit for list changed tiddlers.  Use 0 (zero) to list all tiddlers in the document
* previewheight is a CSS height measurement and sets the FIXED height of the tiddler preview area (default is 15em)
* previewclass is any CSS classname, and can be used to apply custom styles to the preview area (default is to use the standard 'viewer' class)
<<recentChanges 14 10em groupbox>>
<<<
!!!!!Revisions
<<<
2008.05.01 [2.0.1] fixup for titles with double-quotes
2007.07.26 [2.0.0] re-written as plugin
2006.10.02 [1.0.0] initial release (as inline script ShowRecentChanges)
<<<
!!!!!Code
***/
//{{{
version.extensions.recentChanges= {major: 2, minor: 0, revision: 1, date: new Date(2008,5,1)};

config.shadowTiddlers.RecentChanges="<<recentChanges>>";

config.macros.recentChanges = {
	layout: '<form><!--\
		--><select size=1 name="list" style="width:69.5%" \
			onchange=" \
				this.form.goto.disabled=this.form.edit.disabled=this.form.preview.disabled=!this.value.length; \
				var target=this.parentNode.parentNode.nextSibling; removeChildren(target); \
				if (!this.value.length) \
					{ target.style.display=\'none\'; this.form.preview.value=\'preview\'; } \
				else if (target.style.display==\'block\') { \
					wikify(\'<\'+\'<tiddler [[\'+this.value+\']]>\'+\'>\',target); \
					target.style.display=\'block\'; \
					this.form.preview.value=\'done\'; \
				} \
			"><!--\
		-->%options%<!--\
		--></select><!--\
		--><input type="button" name="goto" value="goto" disabled title="view selected tiddler" style="width:10%" \
			onclick="var target=this.parentNode.parentNode.nextSibling; removeChildren(target); \
				target.style.display=\'none\'; this.form.preview.value=\'preview\'; \
				story.displayTiddler(story.findContainingTiddler(this),this.form.list.value); \
			"><!--\
		--><input type="button" name="edit" value="edit" disabled title="edit selected tiddler" style="width:10%" \
			onclick="var target=this.parentNode.parentNode.nextSibling; removeChildren(target); \
				target.style.display=\'none\'; this.form.preview.value=\'preview\'; \
				story.displayTiddler(story.findContainingTiddler(this),this.form.list.value,DEFAULT_EDIT_TEMPLATE); \
			"><!--\
		--><input type="button" name="preview" value="preview" disabled title="show/hide tiddler preview" style="width:10%" \
			onclick="var target=this.parentNode.parentNode.nextSibling; \
				if (this.value==\'preview\') { \
					removeChildren(target); \
					wikify(\'<\'+\'<tiddler [[\'+this.form.list.value+\']]>\'+\'>\',target); \
					target.style.display=this.form.list.value.length?\'block\':\'none\'; this.value=\'done\'; \
				} else { \
					removeChildren(target); \
					target.style.display=\'none\'; this.value=\'preview\'; \
				} \
			"><!--\
		--></form>',
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		var days=10; if (!isNaN(params[0])) days=parseInt(params[0]); // time limit in days (use 0 for all tiddlers)
		var height='15em'; if (params[1]) height=params[1]; // preview area fixed height
		var previewclass='viewer'; if (params[2]) previewclass=params[2]; // preview area CSS class
		var tiddlers=store.getTiddlers('modified','excludeLists').reverse();
		var count=tiddlers.length;
		if (days) {
			var timelimit=(new Date()).getTime()-86400000*days;
			for (var count=0; count<tiddlers.length && tiddlers[count].modified>timelimit; count++);
		}
		var opts="";
		opts+='<option value="">';
		opts+=count+' tiddlers have changed since ';
		opts+=new Date(timelimit).formatString("DDD, MMM DDth YYYY 0hh:0mm");
		opts+=' ('+days+' days ago)';
		opts+='</option>';
		for (var i=0; i<count; i++) { var t=tiddlers[i];
			opts+='<option value="'+t.title.replace(/"/g,"&#x22;")+'">';
			opts+=t.modified.formatString('YYYY.0MM.0DD 0hh:0mm')+' - '+t.title;
			opts+='</option>';
		}
		createTiddlyElement(place,"div").innerHTML=this.layout.replace(/%options%/,opts);
		var preview=createTiddlyElement(place,"div",null,previewclass);
		preview.style.display='none';
		preview.style.whiteSpace='normal';
		preview.style.overflow='auto';
		preview.style.height=height;
	}
}
//}}}
/***
|''Name''|RefreshTiddlerCommand|
|''Version''|0.3.0|
***/
//{{{
(function($) {

var cmd = config.commands.refreshTiddler = {
	text: "refresh",
	locale: {
		refreshing: "Refreshing tiddler..."
	},
	tooltip: "refresh this tiddler to be the one on the server",
	handler: function(ev, src, title) {
		var tiddler = store.getTiddler(title);
		if(!tiddler) {
			tiddler = new Tiddler(title);
			merge(tiddler.fields, config.defaultCustomFields);
		}
		$(story.getTiddler(title)).find(".viewer").
			empty().text(cmd.locale.refreshing);
		var dirtyStatus = store.isDirty();
		story.loadMissingTiddler(title, {
			"server.workspace": tiddler.fields["server.recipe"]  ? "recipes/" + tiddler.fields["server.recipe"] :
				tiddler.fields["server.workspace"] || "bags/"+tiddler.fields["server.bag"],
			"server.host": tiddler.fields["server.host"],
			"server.type": tiddler.fields["server.type"]
		}, function() {
			store.setDirty(dirtyStatus);
		});
	}
};

})(jQuery);
//}}}
/***
|Name:|RenameTagsPlugin|
|Description:|Allows you to easily rename or delete tags across multiple tiddlers|
|Version:|3.0 ($Rev: 5501 $)|
|Date:|$Date: 2008-06-10 23:11:55 +1000 (Tue, 10 Jun 2008) $|
|Source:|http://mptw.tiddlyspot.com/#RenameTagsPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License|http://mptw.tiddlyspot.com/#TheBSDLicense|
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,clearChangeCount,created) {
			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,clearChangeCount,created);
		},

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

//}}}
<!--{{{-->
<div macro='slideRevision'></div>
<div class='heading'>
	<span class="titleBar">
		<div class='title' macro='view title text'></div>
	</span>
	<span class='modifierIcon'
		macro='view modifier SiteIcon label:no height:48 width:48 preserveAspectRatio:yes'>
	</span>
	<div class='toolbar'
		macro='toolbar [[ToolbarCommands::RevisionToolbar]] icons:yes height:48 width:48 more:popup'>
	</div>
	<div class='tagClear'></div>
</div>
<div class='content'>
	<div class='viewer' macro='view text wikified'></div>
</div>
<div class='tagInfo'>
	<div class='tidTags' macro='tags'></div>
	<div class='tagging' macro='tagging'></div>
</div>
<!--}}}-->
/***
|''Name''|RevisionsCommandPlugin|
|''Description''|provides access to tiddler revisions|
|''Author''|FND|
|''Contributors''|Martin Budden|
|''Version''|0.3.3|
|''Status''|@@beta@@|
|''Source''|http://svn.tiddlywiki.org/Trunk/association/plugins/RevisionsCommandPlugin.js|
|''CodeRepository''|http://svn.tiddlywiki.org/Trunk/association/plugins/|
|''License''|[[BSD|http://www.opensource.org/licenses/bsd-license.php]]|
|''CoreVersion''|2.6.0|
|''Keywords''|serverSide|
!Usage
Extend [[ToolbarCommands]] with {{{revisions}}}.
!Revision History
!!v0.1 (2009-07-23)
* initial release (renamed from experimental ServerCommandsPlugin)
!!v0.2 (2010-03-04)
* suppressed wikification in diff view
!!v0.3 (2010-04-07)
* restored wikification in diff view
* added link to side-by-side diff view
!To Do
* strip server.* fields from revision tiddlers
* resolve naming conflicts
* i18n, l10n
* code sanitizing
* documentation
!Code
***/
//{{{
(function($) {

jQuery.twStylesheet(".diff { white-space: pre, font-family: monospace }",
	{ id: "diff" });

var cmd = config.commands.revisions = {
	type: "popup",
	hideShadow: true,
	text: "revisions",
	tooltip: "display tiddler revisions",
	revTooltip: "", // TODO: populate dynamically?
	loadLabel: "loading...",
	loadTooltip: "loading revision list",
	selectLabel: "select",
	selectTooltip: "select revision for comparison",
	selectedLabel: "selected",
	compareLabel: "compare",
	linkLabel: "side-by-side view",
	revSuffix: " [rev. #%0]",
	diffSuffix: " [diff: #%0 #%1]",
	dateFormat: "YYYY-0MM-0DD 0hh:0mm",
	listError: "revisions could not be retrieved",

	handlePopup: function(popup, title) {
		title = this.stripSuffix("rev", title);
		title = this.stripSuffix("diff", title);
		var tiddler = store.getTiddler(title);
		var type = _getField("server.type", tiddler);
		var adaptor = new config.adaptors[type]();
		var limit = null; // TODO: customizable
		var context = {
			host: _getField("server.host", tiddler),
			workspace: _getField("server.workspace", tiddler)
		};
		var loading = createTiddlyButton(popup, cmd.loadLabel, cmd.loadTooltip);
		var params = { popup: popup, loading: loading, origin: title };
		adaptor.getTiddlerRevisionList(title, limit, context, params, this.displayRevisions);
	},

	displayRevisions: function(context, userParams) {
		removeNode(userParams.loading);
		if(context.status) {
			var callback = function(ev) {
				var e = ev || window.event;
				var revision = resolveTarget(e).getAttribute("revision");
				context.adaptor.getTiddlerRevision(tiddler.title, revision, context,
					userParams, cmd.displayTiddlerRevision);
			};
			var table = createTiddlyElement(userParams.popup, "table");
			for(var i = 0; i < context.revisions.length; i++) {
				var tiddler = context.revisions[i];
				var row = createTiddlyElement(table, "tr");
				var timestamp = tiddler.modified.formatString(cmd.dateFormat);
				var revision = tiddler.fields["server.page.revision"];
				var cell = createTiddlyElement(row, "td");
				createTiddlyButton(cell, timestamp, cmd.revTooltip, callback, null,
					null, null, { revision: revision });
				cell = createTiddlyElement(row, "td", null, null, tiddler.modifier);
				cell = createTiddlyElement(row, "td");
				createTiddlyButton(cell, cmd.selectLabel, cmd.selectTooltip,
					cmd.revisionSelected, null, null, null,
					{ index:i, revision: revision, col: 2 });
				cmd.context = context; // XXX: unsafe (singleton)!?
			}
		} else {
			$("<li />").text(cmd.listError).appendTo(userParams.popup);
		}
	},

	revisionSelected: function(ev) {
		var e = ev || window.event;
		e.cancelBubble = true;
		if(e.stopPropagation) {
			e.stopPropagation();
		}
		var n = resolveTarget(e);
		var index = n.getAttribute("index");
		var col = n.getAttribute("col");
		while(!index || !col) {
			n = n.parentNode;
			index = n.getAttribute("index");
			col = n.getAttribute("col");
		}
		cmd.revision = n.getAttribute("revision");
		var table = n.parentNode.parentNode.parentNode;
		var rows = table.childNodes;
		for(var i = 0; i < rows.length; i++) {
			var c = rows[i].childNodes[col].firstChild;
			if(i == index) {
				if(c.textContent) {
					c.textContent = cmd.selectedLabel;
				} else {
					c.text = cmd.selectedLabel;
				}
			} else {
				if(c.textContent) {
					c.textContent = cmd.compareLabel;
				} else {
					c.text = cmd.compareLabel;
				}
				c.onclick = cmd.compareSelected;
			}
		}
	},

	compareSelected: function(ev) {
		var e = ev || window.event;
		var n = resolveTarget(e);
		var context = cmd.context;
		context.rev1 = n.getAttribute("revision");
		context.rev2 = cmd.revision;
		context.tiddler = context.revisions[n.getAttribute("index")];
		context.format = "unified";
		context.adaptor.getTiddlerDiff(context.tiddler.title, context,
			context.userParams, cmd.displayTiddlerDiffs);
	},

	displayTiddlerDiffs: function(context, userParams) {
		var tiddler = context.tiddler;
		tiddler.title += cmd.diffSuffix.format([context.rev1, context.rev2]);
		tiddler.text = "{{diff{\n" + context.diff + "\n}}}";
		tiddler.tags = ["diff"];
		tiddler.fields.doNotSave = "true"; // XXX: correct?
		if(!store.getTiddler(tiddler.title)) {
			store.addTiddler(tiddler);
		}
		var src = story.getTiddler(userParams.origin);
		var tiddlerEl = story.displayTiddler(src, tiddler);
		var uri = context.uri.replace("format=unified", "format=horizontal");
		var link = $('<a target="_blank" />').attr("href", uri).text(cmd.linkLabel);
		$(".viewer", tiddlerEl).prepend(link);
	},

	displayTiddlerRevision: function(context, userParams) {
		var tiddler = context.tiddler;
		tiddler.title += cmd.revSuffix.format([tiddler.fields["server.page.revision"]]);
		tiddler.fields.doNotSave = "true"; // XXX: correct?
		if(!store.getTiddler(tiddler.title)) {
			store.addTiddler(tiddler);
		}
		var src = story.getTiddler(userParams.origin);
		story.displayTiddler(src, tiddler);
	},

	stripSuffix: function(type, title) {
		var str = cmd[type + "Suffix"];
		var i = str.indexOf("%0");
		i = title.indexOf(str.substr(0, i));
		if(i != -1) {
			title = title.substr(0, i);
		}
		return title;
	}
};

var _getField = function(name, tiddler) {
	return tiddler.fields[name] || config.defaultCustomFields[name];
};

})(jQuery);
//}}}
/*{{{*/
(function($) {

$(document).bind('startup', function() {
    var $sidebar   = $("#sidebar"),
        $window    = $(window),
        offset     = $sidebar.offset(),
        topPadding = parseInt($sidebar.css('paddingTop'),10),
        msPause	   = 300,
        IS_HOVERING = false,
        timeout;
    $window.scroll(function() {
		if(timeout) {
    		window.clearTimeout(timeout);
    	}
    	timeout = window.setTimeout(function() {
    		if(IS_HOVERING) {
    			return;
    		}
	        if ($window.scrollTop() > offset.top) {
	            $sidebar.stop().animate({
	                paddingTop: $window.scrollTop() - offset.top + topPadding
	            }, 'slow', 'linear');
	        } else {
	            $sidebar.stop().animate({
	                paddingTop: topPadding
		        }, 'swing', 'linear');
   	        }
    	}, msPause);
    });
    $sidebar.hover(function() {
    	IS_HOVERING = true;
    }, function() {
    	IS_HOVERING = false;
    });
});

}(jQuery));
/*}}}*/
/*{{{*/
config.macros.searchBox = {
	handler: function(place,macroName,params) {
		var searchTimeout = null;
		var txt = createTiddlyElement(null,"input",null,"txtOptionInput searchField");
		if(params[0])
			txt.value = params[0];
		if(config.browser.isSafari) {
			txt.setAttribute("type","search");
			txt.setAttribute("results","5");
		} else {
			txt.setAttribute("type","text");
		}
		place.appendChild(txt);
		txt.onkeyup = this.onKeyPress;
		txt.onfocus = this.onFocus;
		txt.setAttribute("size",this.sizeTextbox);
		txt.setAttribute("accessKey",params[1] || this.accessKey);
		txt.setAttribute("autocomplete","off");
		txt.setAttribute("lastSearchText","");
	},
	onKeyPress: config.macros.search.onKeyPress,
	onFocus: config.macros.search.onFocus,
	sizeTextbox: config.macros.search.sizeTextbox,
	accessKey: config.macros.search.accessKey
};

//--
//-- Search macro
//--

config.macros.search.handler = function(place,macroName,params)
{
	var searchTimeout = null;
	var btn = createTiddlyButton(place,this.label,this.prompt,this.onClick,"searchButton");
	var txt = createTiddlyElement(null,"input",null,"txtOptionInput searchField");
	if(params[0])
		txt.value = params[0];
	if(config.browser.isSafari) {
		txt.setAttribute("type","search");
		txt.setAttribute("results","5");
	} else {
		txt.setAttribute("type","text");
	}
	place.appendChild(txt);
	txt.onkeyup = this.onKeyPress;
	txt.onfocus = this.onFocus;
	txt.setAttribute("size",this.sizeTextbox);
	txt.setAttribute("accessKey",params[1] || this.accessKey);
	txt.setAttribute("autocomplete","off");
	txt.setAttribute("lastSearchText","");
};

// Global because there's only ever one outstanding incremental search timer
config.macros.search.timeout = null;

config.macros.search.doSearch = function(txt)
{
	if(txt.value.length > 0) {
		story.search(txt.value,config.options.chkCaseSensitiveSearch,config.options.chkRegExpSearch);
		txt.setAttribute("lastSearchText",txt.value);
	}
};

config.macros.search.onClick = function(e)
{
	config.macros.search.doSearch(this.nextSibling);
	return false;
};

config.macros.search.onKeyPress = function(ev)
{
	var e = ev || window.event;
	switch(e.keyCode) {
		case 13: // Ctrl-Enter
		case 10: // Ctrl-Enter on IE PC
			config.macros.search.doSearch(this);
			break;
		case 27: // Escape
			this.value = "";
			clearMessage();
			break;
	}
	if(config.options.chkIncrementalSearch) {
		if(this.value.length > 2) {
			if(this.value != this.getAttribute("lastSearchText")) {
				if(config.macros.search.timeout)
					clearTimeout(config.macros.search.timeout);
				var txt = this;
				config.macros.search.timeout = setTimeout(function() {config.macros.search.doSearch(txt);},500);
			}
		} else {
			if(config.macros.search.timeout)
				clearTimeout(config.macros.search.timeout);
		}
	}
};

config.macros.search.onFocus = function(e)
{
	this.select();
};



/*}}}*/
/***
|Name:|SelectThemePlugin|
|Description:|Lets you easily switch theme and palette|
|Version:|1.0 ($Rev: 3646 $)|
|Date:|$Date: 2008-02-27 02:34:38 +1000 (Wed, 27 Feb 2008) $|
|Source:|http://mptw.tiddlyspot.com/#SelectThemePlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License:|http://mptw.tiddlyspot.com/#TheBSDLicense|
!Notes
* Borrows largely from ThemeSwitcherPlugin by Martin Budden http://www.martinswiki.com/#ThemeSwitcherPlugin
* Theme is cookie based. But set a default by setting config.options.txtTheme in MptwConfigPlugin (for example)
* Palette is not cookie based. It actually overwrites your ColorPalette tiddler when you select a palette, so beware. 
!Usage
* {{{<<selectTheme>>}}} makes a dropdown selector
* {{{<<selectPalette>>}}} makes a dropdown selector
* {{{<<applyTheme>>}}} applies the current tiddler as a theme
* {{{<<applyPalette>>}}} applies the current tiddler as a palette
* {{{<<applyTheme TiddlerName>>}}} applies TiddlerName as a theme
* {{{<<applyPalette TiddlerName>>}}} applies TiddlerName as a palette
***/
//{{{

config.macros.selectTheme = {
	label: {
      		selectTheme:"select theme",
      		selectPalette:"select palette"
	},
	prompt: {
		selectTheme:"Select the current theme",
		selectPalette:"Select the current palette"
	},
	tags: {
		selectTheme:'systemTheme',
		selectPalette:'systemPalette'
	}
};

config.macros.selectTheme.handler = function(place,macroName)
{
	var btn = createTiddlyButton(place,this.label[macroName],this.prompt[macroName],this.onClick);
	// want to handle palettes and themes with same code. use mode attribute to distinguish
	btn.setAttribute('mode',macroName);
};

config.macros.selectTheme.onClick = function(ev)
{
	var e = ev ? ev : window.event;
	var popup = Popup.create(this);
	var mode = this.getAttribute('mode');
	var tiddlers = store.getTaggedTiddlers(config.macros.selectTheme.tags[mode]);
	// for default
	if (mode == "selectPalette") {
		var btn = createTiddlyButton(createTiddlyElement(popup,'li'),"(default)","default color palette",config.macros.selectTheme.onClickTheme);
		btn.setAttribute('theme',"(default)");
		btn.setAttribute('mode',mode);
	}
	for(var i=0; i<tiddlers.length; i++) {
		var t = tiddlers[i].title;
		var name = store.getTiddlerSlice(t,'Name');
		var desc = store.getTiddlerSlice(t,'Description');
		var btn = createTiddlyButton(createTiddlyElement(popup,'li'),name ? name : title,desc ? desc : config.macros.selectTheme.label['mode'],config.macros.selectTheme.onClickTheme);
		btn.setAttribute('theme',t);
		btn.setAttribute('mode',mode);
	}
	Popup.show();
	return stopEvent(e);
};

config.macros.selectTheme.onClickTheme = function(ev)
{
	var mode = this.getAttribute('mode');
	var theme = this.getAttribute('theme');
	if (mode == 'selectTheme')
		story.switchTheme(theme);
	else // selectPalette
		config.macros.selectTheme.updatePalette(theme);
	return false;
};

config.macros.selectTheme.updatePalette = function(title)
{
	if (title != "") {
		store.deleteTiddler("ColorPalette");
		if (title != "(default)")
			store.saveTiddler("ColorPalette","ColorPalette",store.getTiddlerText(title),
					config.options.txtUserName,undefined,"");
		refreshAll();
		if(config.options.chkAutoSave)
			saveChanges(true);
	}
};

config.macros.applyTheme = {
	label: "apply",
	prompt: "apply this theme or palette" // i'm lazy
};

config.macros.applyTheme.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
	var useTiddler = params[0] ? params[0] : tiddler.title;
	var btn = createTiddlyButton(place,this.label,this.prompt,config.macros.selectTheme.onClickTheme);
	btn.setAttribute('theme',useTiddler);
	btn.setAttribute('mode',macroName=="applyTheme"?"selectTheme":"selectPalette"); // a bit untidy here
}

config.macros.selectPalette = config.macros.selectTheme;
config.macros.applyPalette = config.macros.applyTheme;

config.macros.refreshAll = { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
	createTiddlyButton(place,"refresh","refresh layout and styles",function() { refreshAll(); });
}};

//}}}
/***
|''Name''|ServerSideSavingPlugin|
|''Description''|server-side saving|
|''Author''|FND|
|''Version''|0.6.5|
|''Status''|stable|
|''Source''|http://svn.tiddlywiki.org/Trunk/association/plugins/ServerSideSavingPlugin.js|
|''License''|[[BSD|http://www.opensource.org/licenses/bsd-license.php]]|
|''CoreVersion''|2.5.3|
|''Keywords''|serverSide|
!Notes
This plugin relies on a dedicated adaptor to be present.
The specific nature of this plugin depends on the respective server.
!Revision History
!!v0.1 (2008-11-24)
* initial release
!!v0.2 (2008-12-01)
* added support for local saving
!!v0.3 (2008-12-03)
* added Save to Web macro for manual synchronization
!!v0.4 (2009-01-15)
* removed ServerConfig dependency by detecting server type from the respective tiddlers
!!v0.5 (2009-08-25)
* raised CoreVersion to 2.5.3 to take advantage of core fixes
!!v0.6 (2010-04-21)
* added notification about cross-domain restrictions to ImportTiddlers
!To Do
* conflict detection/resolution
* rename to ServerLinkPlugin?
* document deletion/renaming convention
!Code
***/
//{{{
(function($) {

readOnly = false; //# enable editing over HTTP

var plugin = config.extensions.ServerSideSavingPlugin = {};

plugin.locale = {
	saved: "%0 saved successfully",
	saveError: "Error saving %0: %1",
	saveConflict: "Error saving %0: edit conflict",
	deleted: "Removed %0",
	deleteError: "Error removing %0: %1",
	deleteLocalError: "Error removing %0 locally",
	removedNotice: "This tiddler has been deleted.",
	connectionError: "connection could not be established",
	hostError: "Unable to import from this location due to cross-domain restrictions."
};

plugin.sync = function(tiddlers) {
	tiddlers = tiddlers && tiddlers[0] ? tiddlers : store.getTiddlers();
	$.each(tiddlers, function(i, tiddler) {
		var changecount = parseInt(tiddler.fields.changecount, 10);
		if(tiddler.fields.deleted === "true" && changecount === 1) {
			plugin.removeTiddler(tiddler);
		} else if(tiddler.isTouched() && !tiddler.doNotSave() &&
				tiddler.getServerType() && tiddler.fields["server.host"]) { // XXX: server.host could be empty string
			delete tiddler.fields.deleted;
			plugin.saveTiddler(tiddler);
		}
	});
};

plugin.saveTiddler = function(tiddler) {
	try {
		var adaptor = this.getTiddlerServerAdaptor(tiddler);
	} catch(ex) {
		return false;
	}
	var context = {
		tiddler: tiddler,
		changecount: tiddler.fields.changecount,
		workspace: tiddler.fields["server.workspace"]
	};
	var serverTitle = tiddler.fields["server.title"]; // indicates renames
	if(!serverTitle) {
		tiddler.fields["server.title"] = tiddler.title;
	} else if(tiddler.title != serverTitle) {
		return adaptor.moveTiddler({ title: serverTitle },
			{ title: tiddler.title }, context, null, this.saveTiddlerCallback);
	}
	var req = adaptor.putTiddler(tiddler, context, {}, this.saveTiddlerCallback);
	return req ? tiddler : false;
};

plugin.saveTiddlerCallback = function(context, userParams) {
	var tiddler = context.tiddler;
	if(context.status) {
		if(tiddler.fields.changecount == context.changecount) { //# check for changes since save was triggered
			tiddler.clearChangeCount();
		} else if(tiddler.fields.changecount > 0) {
			tiddler.fields.changecount -= context.changecount;
		}
		plugin.reportSuccess("saved", tiddler);
		store.setDirty(false);
	} else {
		if(context.httpStatus == 412) {
			plugin.reportFailure("saveConflict", tiddler);
		} else {
			plugin.reportFailure("saveError", tiddler, context);
		}
	}
};

plugin.removeTiddler = function(tiddler) {
	try {
		var adaptor = this.getTiddlerServerAdaptor(tiddler);
	} catch(ex) {
		return false;
	}
	var context = {
		host: tiddler.fields["server.host"],
		workspace: tiddler.fields["server.workspace"],
		tiddler: tiddler
	};
	var req = adaptor.deleteTiddler(tiddler, context, {}, this.removeTiddlerCallback);
	return req ? tiddler : false;
};

plugin.removeTiddlerCallback = function(context, userParams) {
	var tiddler = context.tiddler;
	if(context.status) {
		if(tiddler.fields.deleted === "true") {
			store.deleteTiddler(tiddler.title);
		} else {
			plugin.reportFailure("deleteLocalError", tiddler);
		}
		plugin.reportSuccess("deleted", tiddler);
		store.setDirty(false);
	} else {
		plugin.reportFailure("deleteError", tiddler, context);
	}
};

plugin.getTiddlerServerAdaptor = function(tiddler) { // XXX: rename?
	var type = tiddler.fields["server.type"] || config.defaultCustomFields["server.type"];
	return new config.adaptors[type]();
};

plugin.reportSuccess = function(msg, tiddler) {
	displayMessage(plugin.locale[msg].format([tiddler.title]));
};

plugin.reportFailure = function(msg, tiddler, context) {
	var desc = (context && context.httpStatus) ? context.statusText :
		plugin.locale.connectionError;
	displayMessage(plugin.locale[msg].format([tiddler.title, desc]));
};

config.macros.saveToWeb = { // XXX: hijack existing sync macro?
	locale: { // TODO: merge with plugin.locale?
		btnLabel: "save to web",
		btnTooltip: "synchronize changes",
		btnAccessKey: null
	},

	handler: function(place, macroName, params, wikifier, paramString, tiddler) {
		createTiddlyButton(place, this.locale.btnLabel, this.locale.btnTooltip,
			plugin.sync, null, null, this.locale.btnAccessKey);
	}
};

// hijack saveChanges to trigger remote saving
var _saveChanges = saveChanges;
saveChanges = function(onlyIfDirty, tiddlers) {
	if(window.location.protocol == "file:") {
		_saveChanges.apply(this, arguments);
	} else {
		plugin.sync(tiddlers);
	}
};

// override removeTiddler to flag tiddler as deleted -- XXX: use hijack to preserve compatibility?
TiddlyWiki.prototype.removeTiddler = function(title) { // XXX: should override deleteTiddler instance method?
	var tiddler = this.fetchTiddler(title);
	if(tiddler) {
		tiddler.tags = ["excludeLists", "excludeSearch", "excludeMissing"];
		tiddler.text = plugin.locale.removedNotice;
		tiddler.fields.deleted = "true"; // XXX: rename to removed/tiddlerRemoved?
		tiddler.fields.changecount = "1";
		this.notify(title, true);
		this.setDirty(true);
	}
};

// hijack ImportTiddlers wizard to handle cross-domain restrictions
var _onOpen = config.macros.importTiddlers.onOpen;
config.macros.importTiddlers.onOpen = function(ev) {
	var btn = $(resolveTarget(ev));
	var url = btn.closest(".wizard").find("input[name=txtPath]").val();
	if(window.location.protocol != "file:" && url.indexOf("://") != -1) {
		var host = url.split("/")[2];
		var macro = config.macros.importTiddlers;
		if(host != window.location.host) {
			btn.text(macro.cancelLabel).attr("title", macro.cancelPrompt);
			btn[0].onclick = macro.onCancel;
			$('<span class="status" />').text(plugin.locale.hostError).insertAfter(btn);
			return false;
		}
	}
	return _onOpen.apply(this, arguments);
};

})(jQuery);
//}}}
If you're done setting up, click <<completeSetup>>.

------

Welcome to your brand new manual!

To get started with this blank manual, you'll probably want to set up the following things:
* Upload a SiteIcon. A SiteIcon gives your manual an identity to make it recognisable to others. Try to keep your SiteIcon 40px or less in height.
<<binaryUploadPublic title:SiteIcon>>
* [[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 that appears in the sidebar
* [[DefaultTiddlers]]: Contains the names of the tiddlers that you want to appear when the TiddlySpace is opened
* Many features of TiddlySpace are accessed via the backstage bar located at the top of the page. You can toggle it on or off using the button in the top right corner of the screen.
/*{{{*/

jQuery.each(config.shadowTiddlers, function(i) {
   if(i.indexOf('StyleSheet')===0) {
      config.shadowTiddlers[i] = "";
   }
});

jQuery('head')
	//.append('<link rel="stylesheet" href="http://dl.dropbox.com/u/331606/Ambit/css/reset.css" type="text/css" />')
	//.append('<link rel="stylesheet" href="http://dl.dropbox.com/u/331606/Ambit/css/jbase.css" type="text/css" />')
	//.append('<link rel="stylesheet" href="http://dl.dropbox.com/u/331606/Ambit/styles.css" type="text/css" />')
	.append("<link href='http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic' rel='stylesheet' type='text/css'>")
	.append("<link href='http://fonts.googleapis.com/css?family=PT+Sans+Caption:regular,bold' rel='stylesheet' type='text/css'>")
	.append("<link href='http://fonts.googleapis.com/css?family=Crimson+Text:regular,regularitalic,600,600italic,bold,bolditalic' rel='stylesheet' type='text/css'>");

if(config.browser.isIE) {
	if(config.browser.ieVersion[1].indexOf('8')!==-1) {
		jQuery('head').append('<link rel="stylesheet" href="http://dl.dropbox.com/u/331606/Ambit/css/ie8.css" type="text/css" />');
	}
	if(config.browser.ieVersion[1].indexOf('7')!==-1) {
		jQuery('head').append('<link rel="stylesheet" href="http://dl.dropbox.com/u/331606/Ambit/css/ie7.css" type="text/css" />');
	}
	if(config.browser.ieVersion[1].indexOf('6')!==-1) {
		jQuery('head').append('<link rel="stylesheet" href="http://dl.dropbox.com/u/331606/Ambit/css/ie6.css" type="text/css" />');
		jQuery('html').addClass('ie6');
	}
}
// if this wasn't a plugin you would need to refreshAll();
/*}}}*/
<<closeAll>><<permaview>><<newTiddler>>
<<tiddler Backstage##Tiddlers>>
Qk2yKQAAAAAAADYAAAAoAAAAOwAAADsAAAABABgAAAAAAHwpAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAA////////////////////////////////////zMzMZmZmIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIihoaG4+Pj////////////////////////////////////////////////////////////4+PjsrKylpaWVVVVVVVVVVVVd3d3lpaWzMzM////////////////////////////////////////////////AAAA////////////////////////mZmZIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiMzMzzMzM////////////////////////////////19fXTU1NIiIiIiIiZmZmsrKyzMzM////////////4+PjzMzMhoaGMzMzIiIiIiIimZmZ////////////////////////////////AAAA////////////////OTk5IiIiIiIiIiIiIiIid3d34+Pj////////////////////////////////////////zMzMVVVVIiIiIiIiIiIiIiIid3d3////////////////TU1NIiIid3d38fHx////////////////////////////////////////////////////////mZmZIiIiIiIi19fX////////////////////AAAA////////TU1NIiIiIiIiIiIihoaG////////////////////////////////////////////////////////////////////8fHxTU1NIiIiIiIiIiIilpaWMzMzIiIi4+Pj////////////////////////////////////////////////////////////////////////////////TU1NIiIizMzM////////////AAAA////////IiIiIiIisrKy////////////////////////////////////////////////////////////////////////////////////////d3d3IiIiIiIiIiIi8fHx////////////////////////////////////////////////////////////////////////////////////////////OTk5lpaW////////AAAA////////IiIihoaG////////////////////////////////////////////////////////////////////////////////////////////IiIi4+PjMzMzIiIiIiIilpaW////////////////////////////////////////////////////////////////////////////////////////VVVVlpaW////////AAAA////////IiIiVVVV////////////////////////////////////////////////////////////////////////////////////19fXOTk5////////////mZmZIiIiIiIiOTk5////////////////////////////////////////////////////////////////////////////////////VVVVlpaW////////AAAA////////IiIiIiIi////////////////////////////////////////////////////////////////////////////////srKyd3d3////////////////////8fHxIiIiIiIiIiIi////////////////////////////////////////////////////////////////////////////////IiIizMzM////////AAAA////////IiIiIiIi////////////////////////////////////////////////////////////////////////////d3d3srKy////////////////////////////////IiIiIiIiIiIi////////////////////////////////////////////////////////////////////////////IiIi////////////AAAA////////VVVVIiIi////////////////////////////////////////////////////////////////////////srKysrKy////////////////////////////////////////IiIiIiIiMzMz////////////////////////////////////////////////////////////////////////IiIi////////////AAAA////////srKyIiIi////////////////////////////////////////////////////////////////////19fXd3d3////////////////////////////////////////////////IiIiIiIiTU1N////////////////////////////////////////////////////////////////////IiIi////////////AAAA////////////IiIilpaW////////////////////////////////////////////////////////////////MzMz////////////////////////////////////////////////////////IiIiIiIiwMDA////////////////////////////////////////////////////////////hoaGTU1N////////////AAAA////////////IiIiIiIi////////////////////////////////////////////////////////////MzMz////////////////////////////////////////////////////////////19fXIiIiIiIi////////////////////////////////////////////////////////////IiIiwMDA////////////AAAA////////////d3d3IiIi////////////////////////////////////////////////////////wMDAzMzM////////////////////////////////////////////////////////////////TU1NIiIiOTk5////////////////////////////////////////////////////////IiIi////////////////AAAA////////////////IiIid3d3////////////////////////////////////////////////////MzMz////////////////////////////////////////////////////////////////////////IiIiIiIi8fHx////////////////////////////////////////////////d3d3OTk5////////////////AAAA////////////////IiIiIiIi////////////////////////////////////////////////lpaW8fHx////////////////////////////////////////////////////////////////////////lpaWIiIiIiIi////////////////////////////////////////////////IiIi8fHx////////////////AAAA////////////////4+PjIiIilpaW////////////////////////////////////////////MzMz////////////////////////////////////////////////////////////////////////////////IiIiIiIi8fHx////////////////////////////////////////lpaWIiIi////////////////////AAAA////////////////////IiIiIiIi////////////////////////////////////////wMDA4+Pj////////////////////////////////////////////////////////////////////////////////d3d3IiIiOTk5////////////////////////////////////////IiIi4+Pj////////////////////AAAA////////////////////8fHxIiIiOTk5////////////////////////////////////IiIi////////////////////////////////////////////////////////////////////////////////////////IiIiIiIi////////////////////////////////////VVVVOTk5////////////////////////AAAA////////////////////////VVVVIiIizMzM////////////////////////////////d3d3////////////////////////////////////////////////////////////////////////////////////////IiIiIiIi19fX////////////////////////////19fXIiIi////////////////////////////AAAA////////////////////////////IiIiIiIi////////////////////////////wMDA8fHx////////////////////////////////////////////////////////////////////////////////////////lpaWIiIiTU1N////////////////////////////IiIizMzM////////////////////////////AAAA////////////////////////////////IiIiIiIi////////////////////////VVVV////////////////////////////////////////////////////////////////////////////////////////////////IiIiIiIi////////////////////////IiIiVVVV////////////////////////////////AAAA////////////////////////////////19fXIiIiIiIi////////////////////IiIi////////////////////////////////////////////////////////////////////////////////////////////////IiIiIiIi////////////////////MzMzMzMz////////////////////////////////////AAAA////////////////////////////////////srKyIiIiIiIi////////////////VVVV////////////////////////////////////////////////////////////////////////////////////////////////IiIiIiIi////////////////MzMzMzMz////////////////////////////////////////AAAA////////////////////////////////////////srKyIiIiIiIi////////////lpaW////////////////////////////////////////////////////////////////////////////////////////////////IiIiIiIizMzM////////IiIiMzMz////////////////////////////////////////////AAAA////////////////////////////////////////////19fXIiIiIiIiwMDA////zMzM////////////////////////////////////////////////////////////////////////////////////////////////VVVVIiIilpaW4+PjIiIiTU1N////////////////////////////////////////////////AAAA////////////////////////////////////////////////////IiIiIiIiMzMzzMzM////////////////////////////////////////////////////////////////////////////////////////////////hoaGIiIiMzMzIiIiwMDA////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////hoaGIiIiIiIilpaW////////////////////////////////////////////////////////////////////////////////////////////VVVVIiIiMzMz////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////OTk5IiIiIiIilpaW////////////////////////////////////////////////////////////////////////////VVVVIiIiIiIiIiIiVVVV////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////////////d3d3IiIiIiIiIiIimZmZ////////////////////////////////////////////////////hoaGIiIiIiIiIiIilpaWIiIiIiIiVVVV////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////zMzM////////////19fXOTk5IiIiIiIiIiIiIiIiTU1NVVVVlpaWlpaWlpaWVVVVMzMzIiIiIiIiIiIiIiIiZmZm8fHx////////IiIiIiIilpaW////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////lpaW////////////////////////////wMDAZmZmMzMzIiIiIiIiIiIiIiIiIiIiTU1NhoaGzMzM////////////////////////IiIiIiIizMzM////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////VVVV////////////////////////////////////////////////////////////////////////////////////////////////IiIiIiIi////////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////lpaW////////////////////////////////////////////////////////////////////////////////////////////wMDAIiIiIiIi////////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////OTk5IiIiIiIi////////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////////mZmZ////////////////////////////////////////////////////////////////////////////////////////IiIiIiIimZmZ////////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////////ZmZm////////////////////////////////////////////////////////////////////////////////////19fXIiIiIiIi////////////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////IiIiIiIiIiIi////////////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////////////VVVV////////////////////////////////////////////////////////////////////////////8fHxIiIiIiIizMzM////////////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////////////4+Pj////////////////////////////////////////////////////////////////////////////MzMzIiIiIiIi////////////////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////////////////OTk5////////////////////////////////////////////////////////////////////4+PjIiIiIiIisrKy////////////////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////////////////8fHx4+Pj////////////////////////////////////////////////////////////////IiIiIiIiIiIi////////////////////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////////////////////ZmZm////////////////////////////////////////////////////////////TU1NIiIiIiIi8fHx////////////////////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////////////////////////TU1N////////////////////////////////////////////////////srKyIiIiIiIiZmZm////////////////////////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////////////////////////////mZmZ////////////////////////////////////////////19fXIiIiIiIiMzMz////////////////////////////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////////////////////////////8fHxwMDA////////////////////////////////////4+PjIiIiIiIiIiIi////////////////////////////////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////////////////////////////////8fHxzMzM////////////////////////////19fXIiIiIiIiIiIi////////////////////////////////////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////////////////////////////////////8fHxmZmZ////////////////////hoaGIiIiIiIiIiIi8fHx////////////////////////////////////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////////////////////////////////////////////TU1N////////////MzMzIiIiIiIiIiIi////////////////////////////////////////////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////////////////////////////////////////////////ZmZmlpaWIiIiIiIiIiIiOTk5////////////////////////////////////////////////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////////////////////////////////////////////////////8fHxIiIiIiIiwMDA////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAA////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAA
This space contains all the plugins that the @Ambit project is using.

Some plugins that have been left could be removed, they have been left because they look useful...
adapted from the HCAM (Fonagy, Target)
@@color(orange):The AIM - (AMBIT) Adolescent Integrative Measure@@
!Upload an icon
<<tiddler spaceIcon>>
!Describe your space
If you haven't already done so, you should provide a brief decscription of yourself and what you're using this space for. To do this, just edit the [[SiteInfo]] tiddler (keeping the title the same of course).

!Change the title
<<tiddler spaceTitle>>
!Change the theme
<<tiddler colorScheme>>
!Change the menu
If you'd like to change the menu items along the top, you can edit the [[MainMenu]] tiddler.

!Change the default tiddlers
<<tiddler setDefaultTiddlers>>
!More Advanced customisations
If you know HTML and CSS, you can edit some or all of the following tiddlers to customise your space further:
* PageTemplate
* EditTemplate
* ViewTemplate
* StyleSheet
Click the "new tiddler" button towards the top right of the screen to write something in your space. You'll need to give it a title, some content and, optionally, some tags that will help you identify it later.

!Stuck for ideas?
Not sure what to write about? Not sure what to keep in your space? Other people use ~TiddlySpace for almost anything. How about some of the following:

* [[Save interesting sites|http://bookmarks.tiddlyspace.com]], images or articles from around the web so that you can refer back to them.
* [[Record your family tree|http://familytree.tiddlyspace.com]], store notes on long lost relatives or ancestors and map their relationship to you.
* [[Make up a pocketbook|http://pocketbook.tiddlyspace.com]] to store some useful information in, then print it out, [[fold it up|http://www.pocketmod.com/]], and take it with you.
* [[Plan your holiday|http://the-web-is-your-oyster.tiddlyspace.com/]], record where you're planning to go, note down places of interest and refer back to it later.
* [[Create a mindmap|http://mindmaps.tiddlyspace.com/]] to visualise your inner thoughts and see how they relate to each other.
* [[Set up a questionnaire|http://questionnaire.tiddlyspace.com/]] and get all your friends to answer it.

If you don't like any of those ideas, you can still use this space directly to keep notes and link them together, make a todo list and keep track of everything you're doing, or any one of a hundred million other things.

Still stuck? Check out the @featured space for more suggestions.

You can also [[socialise with others|How to socialise]].
/***
|''Name''|StoryFilters|
|''Author''|Jon Robson|
|''Version''|0.6.7|
|''Status''|@@experimental@@|
|''Source''|https://raw.github.com/jdlrobson/TiddlyWikiPlugins/master/plugins/Filters/StoryFiltersPlugin.js|
|''License''|[[BSD|http://www.opensource.org/licenses/bsd-license.php]]|
!Notes
Adds the following filters
{{{
[story[open]]
[story[sort]]
}}}
***/
//{{{
(function($) {
var _display = Story.prototype.displayTiddler;
Story.prototype.displayTiddler = function() {
	var res =  _display.apply(this, arguments);
	$("[macroName=list]").each(function(i, el) {
		config.macros.list.refresh(el);
	});
	return res;
};
var _close = Story.prototype.closeTiddler;
Story.prototype.closeTiddler = function() {
	var res =  _close.apply(this, arguments);
	$("[macroName=list]").each(function(i, el) {
		config.macros.list.refresh(el);
	});
	return res;
};

config.storyFilters = {
	open: function(tiddler) {
		return story.getTiddler(tiddler.title) ? true : false;
	},
	sort: function(a, b) {
		var i = $(story.getTiddler(a.title)).index();
		var j = $(story.getTiddler(b.title)).index();
		return i < j ? -1 : 1;
	}
};
config.filters.story = function(results, match) {
	var arg = match[3];
	var newresults = [];
	var handler = config.storyFilters[arg];
	if(arg == "sort") {
		return results.sort(handler);
	} else {
		var tiddlers = store.getTiddlers();
		for(var i = 0; i < tiddlers.length; i++) {
			var tiddler = tiddlers[i];
			if(handler && handler(tiddler)) {
				newresults.push(tiddler);
			}
		}
	}
	return newresults;
}

}(jQuery));
//}}}
/***
|Name|StorySaverPlugin|
|Source|http://www.TiddlyTools.com/#StorySaverPlugin|
|Documentation|http://www.TiddlyTools.com/#StorySaverPluginInfo|
|Version|1.4.3|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires|MarkupPostBody|
|Overrides|confirmExit(), getParameters()|
|Description|save/restore current tiddler view between browser sessions|
This plugin automatically saves a list of the currently viewed tiddlers (the "story") in a local cookie, {{{txtSavedStory}}} and then opens those tiddlers when the document is subsequently reloaded... the tiddlers you were viewing in the last browser session are automatically redisplayed in the next session, allowing you to quickly resume working with the document from the same place you left off!!

In addition to automatic cookie-based story tracking, the plugin also provides {{{<<saveStory>>}}} and {{{<<openStory>>}}} macros that allow you to quickly save the current story definition to a tiddler, and then re-display saved stories using simple, one-click command links or droplists.
!!!!!Documentation
>see [[StorySaverPluginInfo]]
!!!!!Revisions
<<<
2008.09.07 [1.4.3] added removeCookie() function for compatibility with [[CookieManagerPlugin]]
2008.07.11 [1.4.2] in confirmExit(), corrected bracketing for titles containing spaces
2008.03.10 [*.*.*] plugin size reduction: documentation moved to [[StorySaverPluginInfo]]
|please see [[StorySaverPluginInfo]] for additional revision details|
2007.10.05 [1.0.0] initial release.   Moved [[SetDefaultTiddlers]] inline script and rewrote as a {{{<<saveStory>>}}} macro.
<<<
!!!!!Code
***/
//{{{
version.extensions.StorySaverPlugin= {major: 1, minor: 4, revision: 3, date: new Date(2008,9,7)};
//}}}
// // ''save or clear story cookie on exit:''
//{{{
// if removeCookie() function is not defined by TW core, define it here.
if (window.removeCookie===undefined) {
	window.removeCookie=function(name) {
		document.cookie = name+'=; expires=Thu, 01-Jan-1970 00:00:01 UTC; path=/;'; 
	}
}

if (config.options.chkSaveStory==undefined) config.options.chkSaveStory=false; 
if (window.coreTweaks_confirmExit==undefined) {
	window.coreTweaks_confirmExit=window.confirmExit;
	window.confirmExit=function() {
		if (config.options.chkSaveStory) { // save cookie
			var links=[];
			story.forEachTiddler(function(title,element){links.push('[['+title+']]');});
			config.options.txtSavedStory=links.join(" ");
			saveOptionCookie("txtSavedStory");
		} else removeCookie("txtSavedStory");
		return window.coreTweaks_confirmExit.apply(this,arguments);
	}
}
//}}}
/***
''apply saved story on startup:'' //important note: the following code is actually located in [[MarkupPostBody]].  This is because it needs to supercede the core's getParameters() function, which is called BEFORE plugins are loaded, preventing the normal plugin-based hijack method from working, while code loaded into [[MarkupPostBody]] will be processed as soon as the document is read, even before the TW main() function is invoked.//
<<tiddler MarkupPostBody>>
***/
// // MACRO definitions
//{{{
config.macros.saveStory = {
	label: "set default tiddlers",
	defaultTiddler: "DefaultTiddlers",
	prompt: "store a list of currently displayed tiddlers in another tiddler",
	askMsg: "Enter the name of a tiddler in which to save the current story:",
	tag: "story",
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		var tid=params[0]?params[0]:"DefaultTiddlers";
		var label=params[1]?params[1]:this.label;
		var tip=params[2]?params[2]:this.prompt;
		var btn=createTiddlyButton(place,label,tip,this.setTiddler,"button");
		btn.setAttribute("tid",tid);
	},
	setTiddler: function() {
		// get list of current open tiddlers
		var tids=[];
		story.forEachTiddler(function(title,element){tids.push("[["+title+"]]")}); // always put titles in brackets
		// get target tiddler
		var tid=this.getAttribute("tid");
		if (!tid || tid=="ask") {
			tid=prompt(config.macros.saveStory.askMsg,config.macros.saveStory.defaultTiddler);
			if (!tid || !tid.length) return; // cancelled by user
		}
		if(store.tiddlerExists(tid) && !confirm(config.messages.overwriteWarning.format([tid]))) return;
		tids=tids.join("\n"); // separate tiddler links by newlines for easier reading
		var t=store.getTiddler(tid); var tags=t?t.tags:[]; tags.push(config.macros.saveStory.tag);
		store.saveTiddler(tid,tid,tids,config.options.txtUserName,new Date(),tags,t?t.fields:null);
		story.displayTiddler(null,tid); story.refreshTiddler(tid,null,true);
		displayMessage(tid+" has been "+(t?"updated":"created"));
	}
}
//}}}

//{{{
if (config.options.chkStoryFold==undefined) config.options.chkStoryFold=true;
if (config.options.chkStoryClose==undefined) config.options.chkStoryClose=true;
config.macros.openStory = {
	label: "open story: %0",
	prompt: "open the set of tiddlers listed in: '%0'",
	popuplabel: "stories",
	popupprompt: "view a set of tiddlers",
	tag: "story",
	selectprompt: "select a story...",
	optionsprompt: "viewing options...",
	foldcmd: "[%0] fold story",
	foldprompt: "fold story tiddlers when opening a story",
	closecmd: "[%0] close others",
	closeprompt: "close other tiddlers when opening a story",
	addcmd: "add a story...",
	addprompt: "create a new story",
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		if (params[0].toLowerCase()=="list") return this.createList(place,params);
		else if (params[0].toLowerCase()=="popup") return this.createPopup(place,params);
		else this.createButton(place,params);
	},
	showStory: function(tid) {
		var tids=[];
		var tagged=store.getTaggedTiddlers(tid,"title");
		if (tagged.length) // if tiddler IS a tag, use tagged tiddlers as story
			for (var t=0; t<tagged.length; t++) tids.push(tagged[t].title);
		else { // get tiddler list from content
			var t=store.getTiddler(tid);
			if (t) { if (!t.linksUpdated) t.changed(); tids=t.links; }
		}
		// see [[CollapseTiddlersPlugin]] for more info, re: folding tiddlers
		var template=null;
		if (config.options.chkStoryFold) template="CollapsedTemplate";
		if (!store.tiddlerExists("CollapsedTemplate")) template=null;
		if (config.options.chkStoryClose) story.closeAllTiddlers();
		story.displayTiddlers(null,tids,template);
	},
	createButton: function(place,params) {
		var tid=params[0]?params[0]:"";
		var label=params[1]?params[1]:this.label; label=label.format([tid]);
		var tip=params[2]?params[2]:this.prompt; tip=tip.format([tid]);
		var fn=function(){config.macros.openStory.showStory(this.getAttribute("tid"))};
		var btn=createTiddlyButton(place,label,tip,fn,"button");
		btn.setAttribute("tid",tid);
	},
	createPopup: function(place,params) {
		var label=params[1]?params[1]:this.popuplabel;
		var tip=params[2]?params[2]:this.popupprompt;
		var btn=createTiddlyButton(place,label,tip,this.showPopup,"button");
	},
	showPopup: function(ev) { var e=ev||window.event;
		var indent="\xa0\xa0";
		var p=Popup.create(this); if (!p) return false;
		createTiddlyText(createTiddlyElement(p,"li"),config.macros.openStory.selectprompt);
		var stories=store.getTaggedTiddlers("story","title");
		for (var s=0; s<stories.length; s++) {
			var label=indent+stories[s].title;
			var tip=config.macros.openStory.prompt.format([stories[s].title]);
			var fn=function(){config.macros.openStory.showStory(this.getAttribute("tid"))};
			var btn=createTiddlyButton(createTiddlyElement(p,"li"),label,tip,fn,"button");
			btn.setAttribute("tid",stories[s].title);
		}
		createTiddlyText(createTiddlyElement(p,"li"),config.macros.openStory.optionsprompt);
		if (store.tiddlerExists("CollapsedTemplate")) {
			var label=indent+config.macros.openStory.foldcmd.format([config.options.chkStoryFold?"x":"\xa0\xa0"]);
			var tip=config.macros.openStory.foldprompt;
			var fn=function(){config.options.chkStoryFold=!config.options.chkStoryFold;saveOptionCookie('chkStoryFold')};
			var btn=createTiddlyButton(createTiddlyElement(p,"li"),label,tip,fn,"button");
		}
		var label=indent+config.macros.openStory.closecmd.format([config.options.chkStoryClose?"x":"\xa0\xa0"]);
		var tip=indent+config.macros.openStory.closeprompt;
		var fn=function(){config.options.chkStoryClose=!config.options.chkStoryClose;saveOptionCookie('chkStoryClose')};
		var btn=createTiddlyButton(createTiddlyElement(p,"li"),label,tip,fn,"button");
		if (!readOnly) {
			var label=config.macros.openStory.addcmd;
			var tip=config.macros.openStory.addprompt;
			var fn=config.macros.saveStory.setTiddler;
			createTiddlyElement(createTiddlyElement(p,"li"),"hr");
			var btn=createTiddlyButton(createTiddlyElement(p,"li"),label,tip,fn,"button");
		}
		Popup.show(p,false);
		e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation();
		return false;
	},
	createList: function(place,params) {
		var s=createTiddlyElement(place,"select",null,"storyListbox");
		s.size=1;
		s.onchange=function() {
			if (this.value=="_fold") {
				config.options.chkStoryFold=!config.options.chkStoryFold; saveOptionCookie('chkStoryFold');
				config.macros.openStory.refreshList();
			} else if (this.value=="_close") {
				config.options.chkStoryClose=!config.options.chkStoryClose; saveOptionCookie('chkStoryClose');
				config.macros.openStory.refreshList();
			} else if (this.value=="_add")
				config.macros.saveStory.setTiddler.apply(this,arguments);
			else config.macros.openStory.showStory(this.value);
		}
		setStylesheet(".storyListbox { width:100%; }", "StorySaverStyles");
		store.addNotification(null,this.refreshList); this.refreshList();
		return;
	},
	refreshList: function() {
		var indent="\xa0\xa0\xa0\xa0";
		var lists=document.getElementsByTagName("select");
		for (var i=0; i<lists.length; i++) { if (lists[i].className!="storyListbox") continue;
			var here=lists[i];
			while (here.length) here.options[0]=null; // remove current list items
			here.options[here.length]=new Option(config.macros.openStory.selectprompt,"",true,true);
			var stories=store.getTaggedTiddlers("story","title");
			for (var s=0; s<stories.length; s++)
				here.options[here.length]=new Option(indent+stories[s].title,stories[s].title,false,false);
			if (!readOnly)
				here.options[here.length]=new Option(config.macros.openStory.addcmd,"_add",false,false);
			here.options[here.length]=new Option(config.macros.openStory.optionsprompt,"",false,false);
			if (store.tiddlerExists("CollapsedTemplate")) {
				var msg=config.macros.openStory.foldcmd.format([config.options.chkStoryFold?"x":"\xa0\xa0"]);
				here.options[here.length]=new Option(indent+msg,"_fold",false,false);
			}
			var msg=config.macros.openStory.closecmd.format([config.options.chkStoryClose?"x":"\xa0\xa0"]);
			here.options[here.length]=new Option(indent+msg,"_close",false,false);
		}
	}
}
//}}}
/*{{{*/

/* ------------------------------------------------Mayer's Reset Reloaded: http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded */

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
	margin: 0;
	padding: 0;
	border: 0;
	outline: 0;
	font-weight: inherit;
	font-style: inherit;
	font-size: 100%;
	font-family: inherit;
	vertical-align: baseline;
}
/* remember to define focus styles! */
:focus {
	outline: 0;
}
body {
	line-height: 1;
	color: black;
	background: white;
}
ol, ul {
	list-style: none;
}
/* tables still need 'cellspacing="0"' in the markup */
table {
	border-collapse: separate;
	border-spacing: 0;
}
caption, th, td {
	text-align: left;
	font-weight: normal;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: "";
}
blockquote, q {
	quotes: "" "";
}


/* J-BASE */


/*--------------------------Global */

body {
	font-family: "Helvetica Neue", Helvetica, Arial, Sans-serif;
	letter-spacing: 0.02em;
	color: #545454;
	font-size: 62.5%;
	background-position: 0px 0px;
}

.grid {
	/*background-image: url(../images/24px6inc_grid.png);*/
}

.jbasewrap {
	/*padding: 48px 0;*/
	width: 940px;
	margin: auto;
	font-size: 1.4em;
	line-height: 1.714em;
}

a {
	color: #fca961;
	text-decoration: underline;
}

.clearboth {
	clear: both;
}

.alert {
	color: white;
	padding: 0px 5px;
	-moz-border-radius: 5px; /* FF1+ */
	-webkit-border-radius: 5px; /* Saf3+, Chrome */
	border-radius: 5px; /* Opera 10.5, IE 9 */	
	font-family: "Helvetica Neue", Helvetica, Arial, Sans-serif;
	/*
	-moz-box-shadow:inset 0 0 5px #d81900;
	-webkit-box-shadow:inset 0 0 5px #d81900;
	box-shadow:inset 0 0 5px #e33923;
	*/
	-moz-box-shadow: 1px 1px 3px #939393;
	-webkit-box-shadow: 1px 1px 3px #939393;
	box-shadow: 1px 1px 3px #939393;
}

.alert.error {
	text-shadow: #e33923 1px 1px 1px;
	background-color: #ff776d;
	border: #ff2413 1px solid;
}

.alert.success {
	text-shadow: #1e8c1e 1px 1px 1px;
	background-color: #6fc66f;
	border: #1e8c1e 1px solid;
}


/*--------------------------Grid Modification */

.grid4col, .grid2col {
	/*margin-top: 0.071em; */
} 




/*--------------------------Typography */

p {
	font-size: 1em;
	margin: 0 0 1.714em;
}

.tiddler .content {
	font-size: 1.15em;
}

.smallcaps {
	font-variant: small-caps;
}


strong {
	font-weight: 600;  /* JB */
}

del {
	text-decoration: line-through;
}

dfn {
	font-weight: bold;
}

em, dfn {
	font-style: italic;	
}

address {
	font-style: italic;
	margin-bottom: 1.714em;
}

pre, code, tt {
	font-family: 'andale mono','lucida console',monospace;
}

abbr, acronym {
	border-bottom: 1px dotted;
}

table {
	margin-bottom: 1.714em;
}

th {
}

ul, ol {
	margin: 0 0 1.714em 1.714em;
	padding: 0px; /* JB */
}

ul.noMargin, .ol.noMargin {
	margin: 0 0 1.714em 0;	
}

ul li {
	list-style: disc;
}

ul.noBullets ul.bullets li {
	list-style: disc;
}

ul.noBullets li {
	list-style: none;
}

ol li {
	list-style: decimal;
}

li ul, li ol {
	margin: 0 0 0  1.714em;
} 

dl dt {
	font-weight: bold;
}

dd {
	margin-left: 1.714em;
}

blockquote {
	font-style: italic;
	padding-left: 1.714em;
}

hr {
	border: none;
	height: 0.071em; /* ie. 1 px */
	color: #858585;
	background: #858585;
	/* margin:  0.821em 0; */
	margin: 0.786em 0; /* 0 0.857em; /* ie. 11 pixels above and 12 below = 24px total */
}

.small {
	font-size: 0.75em;
	line-height: 1.714em;
	padding-top: 0.4em; /* Made UP! */
	margin-bottom: 1.886em; /* 2.286 - 0.4em, where 2.286 = 24px when 1em = 10.5px */ 
	
}

.large {
	font-size: 1.5em;
	line-height: 1.714em;
	padding-top: 0em; /* Made UP! */
	margin: -0.25em 0 1.3em; /* Made UP! */
}

sup {
	vertical-align: top;
	font-size: 0.75em;
}
sub {
	vertical-align: bottom;
	font-size: 0.75em;
}

h1, h2, h3, h4, h5, h6 {
	font-weight: normal;
}


h1 {
	font-size: 2.25em;			/* 31.5px */
	line-height: 1.333em; 		/* ie. 42px, seven 6px increments */
	margin-bottom: 0.381em; 	/* ie 12px */
}

h2 {
	font-size: 2em;				/* 28px */
	line-height: 1.286em; 		/* ie 36px */
	margin-bottom: 0.429em; 	/* 12px */
}

h3 {
	font-size: 1.75em;			/* 24.5px */
	line-height: 1.224em; 		/* ie 30px */
	margin-bottom: 0.49em; 		/* 12px */
}

h4 {
	font-size: 1.5em;			/* 21px */
	line-height: 1.429em; 		/* ie 30px */
	margin-bottom: 0.571em; 	/* 12px */
}

h5 {
	font-size: 1.25em;			/* 17.5px */
	line-height: 1.714em; 		/* ie 30px */
	margin-bottom: 0.686em; 	/* ie 12px */
}

h6 {
	font-size: 1em; 			/* 14px */
	line-height: 1.714em;		/* 24px */
	margin-bottom: 0.857em; 	/* 12px */
	font-weight: ; 
}






/*--------------------------Colours */

.orange {
}




/*--------------------------Div Modifiers */

a.trigger {
	position: fixed;
	left: 0px;
	top: 48px;
	font-family: Helvetica, arial;
	font-size: 1.05em;
	padding: 1.2em;
	background-color: #fff;
	color: #555;
	text-decoration: none;
	text-transform: uppercase;
}

.box {
	background-color: #ffeed3;
	padding: 1.714em;
	margin-bottom: 1.714em;
}

.last {
	margin-bottom: 0;
}

.nomargintop {
	margin-top: 0;
}

.margintop {
	margin-top: 24px;
}
.marginbottom {
	margin-bottom: 24px;
}
.marginbottomsmall {
	margin-bottom: 12px;
}

.margintopsmall {
	margin-top: 12px;
}

.padtop {
	padding-top: 24px;
}

.padtopsmall {
	padding-top: 12px;
}

.padbottom {
	padding-bottom: 24px;
}
.padbottomsmall {
	padding-bottom: 12px;
}

.rounded5 {
	-moz-border-radius: 20px; /* FF1+ */
	-webkit-border-radius: 20px; /* Saf3+, Chrome */
	border-radius: 20px; /* Opera 10.5, IE 9 */	
}

.borderbottom {
	border-bottom: #e65d27 0.071em solid;
}


/* ------------------------------------------------ AMBIT Base Styles */

body {
	background-color: #e9e9e9;
	color: #545454;
	font-family: 'PT Sans', lucida sans, helvetica, arial, serif;	
	background-color: #cccccc;
	background-image: -moz-linear-gradient(top, #cccccc, #666666); 
	background-image: -o-linear-gradient(top, #cccccc, #666666); 
	background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #cccccc),color-stop(1, #666666)); 
	background-image: -webkit-linear-gradient(#cccccc, #666666); 
	background-image: linear-gradient(top, #cccccc, #666666);
	filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#cccccc', EndColorStr='#666666'); 
	height:100%;
	position:relative;
	background-repeat: no-repeat;
}

a {
	/* text-decoration: underline; */
	text-decoration: none;
	color: #545454;
	border-bottom: 1px #545454 dotted;
}

a:hover {
	background-color: #ffd9c5;
}

#contentWrapper {
	/* width: 940px; 
	padding: 0px 20px; */
	margin: auto;
	font-size: 1.4em;
	line-height: 1.514em;
	position: relative;
}

#mainpane {
	width: 940px; 
	padding: 40px 20px 0px;
	margin: auto;
	position: relative;
}

/* Header Styles */

#header {
	height: 40px;
	padding-top: 0px;
	background-color: #221e1e;
	background-image: -moz-linear-gradient(top, #221e1e, #545151); /* FF3.6 */
	background-image: -o-linear-gradient(top, #221e1e, #545151); /* Opera 11.10+ */
	background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #221e1e),color-stop(1, #545151)); /* Saf4+, Chrome */
	background-image: -webkit-linear-gradient(#221e1e, #545151); /* Chrome 10+, Saf5.1+ */
	background-image: linear-gradient(top, #221e1e, #545151);
	        filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#221e1e', EndColorStr='#545151'); /* IE6-IE9 */
	border-bottom: 1px solid #878787;
	color: #f1f1f1;
	position: fixed;
	width: 110%;
	left: -5%;
	padding-left: 5%;
	z-index: 10;	
	-moz-box-shadow: 0px 2px 2px #333;
	-webkit-box-shadow: 0px 2px 2px #333; 
	box-shadow: 0px 2px 2px #333; 
	

}

#SiteIcon {
	float: left;
	margin-top: 9px;
	padding-left: 10px;
}

#logo {
	width: 33px;
	margin: 7px 0 0 10px;
	position: absolute;
	right: 305px;
}

#annafreudlogo {
	width: 161px;
	margin-top: 9px;
	position: absolute;
	right: 140px;
}

h1 {
	color: #f1f1f1;
	float: left;
	/*width: 360px;*/
	padding: 0px 0px 0px 10px;
	line-height: 1em;
	font-size: 1.5em;
	margin-top: 9px;
}

h1 #SiteTitle {
	color: #f1f1f1;	
	font-weight: bold;
	margin-bottom: 0em;
	line-height: 1em;
}

h1 #SiteSubtitle {
	color: #f1f1f1;
	font-size: 0.55em;
	line-height: 0.5em;
	
}





/* Sidebar Styles */

#sidebar {
	width: 250px;
	margin: 40px 0px;
	right: -5px;
	top: 0px;
	font-family: 'PT Sans Caption', lucida sans, helvetica, arial, serif;
	position: absolute; 
	height: 580px;
	z-index: 9;
}

#sidebar .tools {
	position: fixed;
	top: 40px;
	height: 30px;
	width: 250px;
	background-color: #7e7e7e;
	background-image: -moz-linear-gradient(top, #7e7e7e, #9f9f9f); /* FF3.6 */
	background-image: -o-linear-gradient(top, #7e7e7e, #9f9f9f); /* Opera 11.10+ */
	background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #7e7e7e),color-stop(1, #9f9f9f)); /* Saf4+, Chrome */
	background-image: -webkit-linear-gradient(#7e7e7e, #9f9f9f); /* Chrome 10+, Saf5.1+ */
	background-image: linear-gradient(top, #7e7e7e, #9f9f9f);
	filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#7e7e7e', EndColorStr='#9f9f9f'); /* IE6-IE9 */
}

#sidebar .tools h2 {
	background-color: transparent;
    background-image: url("http://ambit-theme.tiddlyspace.com/down_arrow_grey.png");
    right: 16px;
    text-transform: none;
    top: 4px;
    font-size: 0.9em;
}

.tools button {
	color: #fff;
    font-size: 0.7em;
	background-color: transparent;
	border: none;
	border-right: 1px silver solid;
    padding: 2px 5px;
    text-transform: uppercase;
    height: 100%;
}
.tools button:hover {
	background-color: #F4F4F4;
	color: #535353;
	cursor: pointer;
}

#sidebar .wrap {
	overflow-y: auto;
	top:70px;
	height: 540px;
	width: 240px;
	position: fixed;
	background-color: #fafafa;
	padding: 10px 0px 0px 10px;
}

#sidebar h2 {
	background-color: #81AAED;
    color: #fff;
    font-family: 'PT Sans',lucida sans,helvetica,arial,serif;
    font-size: 0.7em;
    font-weight: bold;
    letter-spacing: 0.08em;
    padding: 3px 10px 3px 20px;;
    position: absolute;
    right: 0;
    text-transform: uppercase;
    -moz-border-radius: 3px 0px 0px 3px;
	border-radius: 3px 0px 0px 3px;
	background-image: url(http://ambit-theme.tiddlyspace.com/down_arrow.png);
	background-repeat: no-repeat;
	background-position: 7px 8px;
}

#sidebar .module {
	margin-bottom: 20px;
}

.moduleContent {
	padding-top: 30px;
}


#search input {
	background-color: #fff9f6;
	border: 1px solid #d5d5d5;
	-moz-border-radius: 5px; /* FF1+ */
	-webkit-border-radius: 5px; /* Saf3-4 */
	border-radius: 5px; /* Opera 10.5, IE9, Saf5, Chrome */
	
	box-shadow:inset 0px 0px 2px #ccc;
    -moz-box-shadow:inset 0px 0px 2px #ccc;
    -webkit-box-shadow:inset 0px 0px 2px #ccc;
    width: 212px;
    padding: 3px 2px
}

#contents ul {
	margin-left: 0px;
}
#contents ul ul{
	margin-left: 40px;
}

#contents ul li {
	list-style: none;
}

#contents ul li span {
	background-image: url(http://ambit-theme.tiddlyspace.com/contents_sprite.png);
	background-repeat: no-repeat; 
	width: 10px;
	height: 10px;
	text-indent: -999px;
	display: block;
	float: left;
	margin: 5px 8px 0px 6px;
}
#contents ul li span:hover {
	background-position: -10px 0px;
}
#contents ul li span:active {
	background-position: -20px 0px;
}

#contents ul li span.open {
	background-position: 0px -10px;
}

#contents ul li span.open:hover {
	background-position: -10px -10px;
}

#contents ul li span.open:active {
	background-position: -20px -10px;
}

#contents ul a h3 {
	font-size: 0.7em;
	text-transform: uppercase;
	display: inline;

}

#contents ul ul li {
	list-style: none;
	list-style-type: none;
	line-height: 1.2em;
}

#contents ul ul.closed {
	display: none;
}

#contents ul ul a {
	font-size: 0.75em;
}


.scrollBar {
	width: 15px;
	float: left;
	padding: 5px 0px 5px 1px;
}
.scrollBar span {
	background-image: url(http://ambit-theme.tiddlyspace.com/history_sprite.png);
	height: 25px;
	width: 15px;
	text-indent: -999px;
	display: block;
}
.scrollBar span.up:hover {
	background-position: -15px 0px;
}
.scrollBar span.up:active {
	background-position: -30px 0px;
}
.scrollBar span.down {
	background-position: 45px 25px;
}
.scrollBar span.down:hover {
	background-position: 30px 25px;
}
.scrollBar span.down:active {
	background-position: 15px 25px;
}

.historyBox {
	background-color: #fff9f6;
	border: 1px solid #d5d5d5;
	-moz-border-radius: 5px; /* FF1+ */
	-webkit-border-radius: 5px; /* Saf3-4 */
	border-radius: 5px; /* Opera 10.5, IE9, Saf5, Chrome */
	
	box-shadow:inset 0px 0px 2px #ccc;
    -moz-box-shadow:inset 0px 0px 2px #ccc;
    -webkit-box-shadow:inset 0px 0px 2px #ccc;
    width: 212px;
    padding: 3px 2px;
    
    height: 60px;
    overflow: hidden;
    font-size: 0.8em;
    line-height: 1.6em;
}

.historyBox ul li {
	list-style: none;
	list-style-type: none;
}

#youAreReading ul {
	font-size: 0.8em;
	margin-bottom: 0px;
	margin-left: 0px;
}

#youAreReading ul li {
	list-style: none;
}

#youAreReading span.close {
	font-size: 1.4em;
	margin-left: 6px;
	margin-right: 10px;
	color: #c8c8c8;
	font-family: lucida sans, helvetica, arial, serif;
}

#youAreReading span.close:hover {
	color: #d5b5a4;
	cursor: pointer;
}

#youAreReading span.close:active {
	color: #545454;
}

#youAreReading button {
	background-color: white;
	border: solid 1px #565656;
	margin-top: 10px;
	font-size: 0.7em;
	text-transform: uppercase;
	color: #565656;
	letter-spacing: 0.1em;
	-moz-border-radius: 5px; /* FF1+ */
	-webkit-border-radius: 5px; /* Saf3+, Chrome */
	border-radius: 5px; /* Opera 10.5, IE 9 */	
	-moz-box-shadow: 1px 1px 3px #939393;
	-webkit-box-shadow: 1px 1px 3px #939393;
	box-shadow: 1px 1px 3px #939393;
	outline-style: none;
	margin-left: 20px;
}

#youAreReading button:hover {
	cursor: pointer;
	color: white;
	background-color: #565656;
	
}

/* Content Styles */

#tiddlerDisplay {
	width:714px;
	background-color: white;
	-moz-box-shadow: 2px 2px 2px #CCCCCC;
	/* -moz-box-shadow: 0px 2px 4px #333; */
	-webkit-box-shadow: 2px 2px 2px #CCC; 
	box-shadow: 2px 2px 2px #CCC;
	z-index: 8;
	position: relative;
	font-family: 'Crimson Text', Times, serif, Georgia;
	font-size: 1.05em;
	line-height: 1.65em;
	overflow: hidden;
}

.paperSheet { /* - JB - this was previously .tiddler */
	width: 440px;
	margin-left: 180px;
	margin-bottom: 60px;
}

.tiddler h2, .tiddler p {
	/* margin-left: 180px;*/

}

/* Header Panels */ 

.headingPanel {
	border-bottom: #ebebeb 3px solid;
	width: 694px;
	margin: 0px 0px 20px -160px;
	overflow: visible;
	position: relative;
	padding-top: 30px;
}

.headingPanel.local {
	border-bottom-color: #a5c39a;
}

.panelToggle {
	float: left;
	margin-top: -36px;
	font-family: 'PT Sans Caption', lucida sans, helvetica, arial, serif;
	font-size: 0.6em;
	display: block;
	padding: 8px 5px 5px 30px;
	width: 80px;
	height: 23px;
	line-height: 1.3em;
	background-image: url(http://ambit-theme.tiddlyspace.com/paneltoggle.gif);
	background-repeat: no-repeat;
	background-position: 10px 12px;
	background-color: #f4f4f4;
	text-transform: uppercase;
	color: #b2b2b2;
}

.panelToggle.open {
	background-position: 10px -28px;
}

.infoPanel {
	background-color: #f4f4f4;
	margin-top:0px;
	padding: 10px;
	padding-right: 0px;
	border: 3px solid #ebebeb;
border-bottom: 0px;
	font-size: 0.7em;
	font-family: 'PT Sans Caption', lucida sans, helvetica, arial, serif;
	overflow: auto;
width: 695px;
display: none;
}

.local .infoPanel {
	border-color: #a5c39a;
}

.infoPanel ul {
	width: 149px;
	list-style: none;
	list-style-type: none;
	float: left;
	margin: 0px 20px 0px 0px;
}
.infoPanel ul li {
	list-style: none;
	list-style-type: none;
	margin-bottom: 5px;
	line-height: 1.8em;
}

.tiddler .infoPanel h4 {
	margin: 0px;
	float: none;
	text-align: left;
	font-style: normal;
	width: 149px;
	font-weight: bold;
	height: 40px;
	border-bottom:1px solid #a9a9a9;
	margin-bottom: 5px;
	padding-left: 0px;
	letter-spacing: 0.05em;
}

/* Tag Styles */

.tags {
	border-top: #8f8f8f 2px solid;
	border-bottom: #8f8f8f 2px solid;
	width: 714px;
	margin-left: -180px;
	padding-top: 1.4em;
	margin-bottom: 4em;
	overflow: hidden;
}

.tags div {
	margin-bottom: 20px;
	/*clear: both;*/
}

.tags div p {
	width: 110px;
	padding-left: 50px;
	text-align: right;
	font-style: italic;
	font-size: 0.9em;
	float: left;
	clear: both;
	margin-bottom: 20px;
}

/*.tags ul {
	margin-left: 180px;
}*/

.tags .grid2col {
	width: 180px;
}

.tags .left {
	float: left;
}

.tags .grid2col.first {
	margin-left: 180px;
	margin-right: 20px;
}

.tags .tagging ul {
	-moz-column-count: 2;
	-moz-column-gap: 20px;
	-webkit-column-count: 2;
	-webkit-column-gap: 20px;
	column-count: 2;
	column-gap: 20px;
}

.tags a {
	cursor: pointer;
	font-family: 'PT Sans Caption', lucida sans, helvetica, arial, serif;
	font-size: 0.8em;
	letter-spacing: 0.05em;
}

.tags ul li {
	list-style: none;
	list-style-type: none;
	font-size: 0.85em;
	margin-bottom: 5px;
	line-height: 1.4em;
}

.tiddlerTags ul li {
	display: inline;
}

.tiddlerTags ul li a {
	background: #e8e8e8;
	padding: 3px;
	border-bottom: none;
}
.tiddlerTags ul li a:hover {
	background-color: #ffd9c5;
}

/* Typographic Styles */


.tiddler h3 {
	float: left;
	clear: both;
	width: 140px;
	padding-left: 20px;
	margin-left: -180px;
	text-align: right;
	font-style: normal;
	font-weight: 600;
	font-size: 1.2em;
	line-height: 1.2em;
	letter-spacing: 0em;
}

.tiddler h4 {
	font-weight: 600;
	font-size: 1.2em;
	line-height: 1.2em;
	letter-spacing: 0.08em;
}

.tiddler h2 {
    font-size: 2em;
    margin: 0px 0px 0px 160px;
    padding: 20px 0px 3px 0px;
    width: 540px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #333030;
    letter-spacing: 0em;
}

.meta {
	font-size: 0.8em;
	font-family: 'PT Sans Caption', lucida sans, helvetica, arial, serif;
	line-height: 0.9em;
	margin-bottom: 1.5em;
}
/* =========================================== Tiddler Typography */

.content h6 {
	font-size: 0.9em;
    letter-spacing: 0.06em;
    line-height: 1.714em;
    margin-bottom: 0.857em;
    text-transform: uppercase;
}

.content h5 {
	font-size: 1.25em;
    line-height: 1.714em;
    margin-bottom: 0.686em;
}

.content h4 {
	font-size: 1.3em;
    font-weight: 600;
    letter-spacing: 0.08em;
    line-height: 1.2em;
}

.content h3 {
    clear: both;
    float: left;
    font-size: 1.25em;
    font-style: normal;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1em;
    margin-left: -180px;
    padding-left: 20px;
    text-align: right;
    width: 140px;
}

.content h2 {
	color: #333030;
    font-size: 1.7em;
    font-weight: 600;
    letter-spacing: 0;
	float: none;
	width: auto;
	margin-left: 0px
}

.content h1 {
	color: #565656;
    font-size: 2em;
    font-weight: bold;
    line-height: 1em;
    margin-top: 9px;
    padding: 0 0 0 0;
	float: none;
	width: auto;
	margin-left: 0px;
}

/* =========================================== AIM Form */

#aimForm {
	background-color: #f4f4f4;
	position: relative;
	left: -160px;
	width: 694px;
	padding: 0px;
	font-family: 'PT Sans Caption', lucida sans, helvetica, arial, serif;
	font-size: 0.8em;
	line-height: 1.5em;
	overflow: hidden;
	position: relative;
}

#aimForm p, #aimForm ul {
	font-size: 1em;
}

#aimForm ul.AIMmenu a {
	border-bottom: none;
}

#aimForm ul.AIMmenu {
	margin:40px 0px 0px 0px;
	padding: 0px;
	font-weight: bold;
	width: 150px;
	float: left;
}

#aimForm ul.AIMmenu li ul {
	font-weight: normal;
	float: none;
	line-height: 1.3em;
	width: 145px;
	margin: 0px;
	padding: 5px 0px 10px 5px;
	border-left: 2px #e4e4e4 solid;
	border-bottom: 2px #e4e4e4 solid;
}

#aimForm ul.AIMmenu li {
	list-style: none;
	list-style-image: none;
}

#aimForm ul.AIMmenu li a {
	display: block;
	zoom: 1;
	padding: 3px 0px 3px 10px;
}

#aimForm ul.AIMmenu li.active a {
	background-color: #e4e4e4;
}

#aimForm ul.AIMmenu li ul {
	display: none;
}

#aimForm ul.AIMmenu li.active ul {
	display: block;
}

#aimForm ul.AIMmenu li.active ul a {
	background-color: transparent;
}

#aimForm ul.AIMmenu li ul li.active a {
	font-weight: bold;
}

#aimForm ul.AIMmenu li.keyProblem {
	background-color: #FCFFA1;
}

#aimForm ul.AIMmenu li.done a {
	color:#3ABB00;
}

#aimForm .question {
	float: left;
	width: 464px;
	padding: 0px 60px 20px 20px;
	background-color: #e4e4e4;
}

#aimForm h3 {
	float: none;
	width: auto;
	text-align: left;
	padding: 0px;
	font-weight: normal;
	margin: 15px 0 20px;
	font-size: 1.4em;
}

#aimForm h4 {
	margin-left: 0px;
	font-weight: normal;
	margin-bottom: 20px;
	font-size: 1.2em;
	letter-spacing: 0.02em;
}

#aimForm .navigation {
	width: 150px;
	position: absolute;
	left: 10px;
	top: 15px;
	overflow: hidden;
}

#aimForm .question .navigation {
	position: relative;
	float: left;
	margin-bottom: 20px;
}

#aimForm .question .choice {
	overflow: hidden;
}

#aimForm .question input[type=radio], #aimForm .question input[type=checkbox], {
	float: left;
	width: 30px;
	clear:both;
}

#aimForm .question label {
	margin-bottom: 20px;
	float: left;
	width: 400px;
}

#aimForm .question .error {
	margin-bottom: 20px;
	color: red;
}

#aimForm .navigation a {
	background-color: #949494;
	display: block;
	position: relative;
	padding: 3px;
	width: 40px;
	height: 10px;
	font-weight: bold;
	border: none;
	color: white;
	line-height: 11px;		
	cursor: pointer;
	float: left;
	margin-left: 10px;
}

#aimForm a.export {
	background-color: #949494;
	display: block;
	position: relative;
	padding: 3px;
	height: 10px;
	font-weight: bold;
	border: none;
	color: white;
	line-height: 11px;		
	cursor: pointer;
	float: left;
	margin-left: 0px;
	-moz-border-radius: 3px 0px 0px 3px;
	border-radius: 3px 0px 0px 3px;
}

#aimForm a.export span {
	position: absolute;
	top: 0px;
	width: 0px;
	height: 0px;
	display: block;
	line-height:0em;
	border-top: #e4e4e4 solid 8px;
	border-bottom: #e4e4e4 solid 8px;
	border-left: #949494 solid 8px;
	right: -8px;
}

#aimForm .navigation a.next {
	-moz-border-radius: 3px 0px 0px 3px;
	border-radius: 3px 0px 0px 3px;
	width: 36px;
}

#aimForm .navigation a.previous {
	-moz-border-radius: 0px 3px 3px 0px;
	border-radius: 0px 3px 3px 0px;
	text-align: right;
	padding-right: 4px;
	width: 36px;
}

#aimForm .navigation a span {
	position: absolute;
	top: 0px;
	width: 0px;
	height: 0px;
	display: block;
	line-height:0em;
	border-top: #f4f4f4 solid 8px;
	border-bottom: #f4f4f4 solid 8px;
}

#aimForm .navigation a.next span {
	border-left: #949494 solid 8px;
	right: -8px;
}

#aimForm .navigation a.previous span {
	border-right: #949494 solid 8px;
	left: -8px;
}

#aimForm .question .navigation a span {
	border-top: #e4e4e4 solid 8px;
	border-bottom: #e4e4e4 solid 8px;
}

#aimForm .question .navigation {
	top: 0px;
}

#aimForm .navigation a:hover {
	background-color: #333;
}

#aimForm .navigation a:hover span{
	border-left-color: #333;
	border-right-color: #333;
}

#aimForm .question ul {
	padding-left: 0px;
}

#aimForm .question ul li {
	margin-top: 5px;
}
#aimForm .question ul li ul {
	font-style: italic;
	font-size: 0.9em;
}
#aimForm .question ul li ul li {
	list-style-type: circle;
}

#AIMResults ul li ul {
	display: none; /* so it can be revealed */
}

#AIMResultsContainer .choice {
	clear: both;
}

/* =================================== PAPERS ON A DESK - JB ======= */

/* NB requires paperSheet Div added around each tiddler- obviously this needs to change so that the tiddlers are the paperSheets, and contain the standard tiddler styles within that (because of the rendering system)*/

#tiddlerDisplay {
	background: transparent;
	-moz-box-shadow: none; 
	-webkit-box-shadow: none; 
	box-shadow: none; 
	overflow: visible;
}

div.tiddler {
	background-color: white;
	-moz-box-shadow: 0px 2px 4px #333; 
	-webkit-box-shadow: 0px 2px 4px #333; 
	box-shadow: 0px 2px 4px #333; 
	padding: 0px 0px 0px;
	overflow: hidden;
	margin-bottom: 10px;
}

#sidebar {
	right: -15px;
	overflow: hidden;
}

div.tiddler {
	margin-bottom: 10px;
}

#sidebar .wrap, #sidebar .tools {
	-moz-box-shadow: 0px 2px 4px #333; 
	-webkit-box-shadow: 0px 2px 4px #333; 
	box-shadow: 0px 2px 4px #333; 
}

.paperSheet.editMode {
	width: 674px;
	margin-left: 20px;
	margin-bottom: 60px;
}

/* =================================== Search Results Redux ======= */

/* NB change header to z-index 10, #sidebar to 9 to make this work */

#searchResults {
	width: 100%;
	position: absolute;
	z-index: 9;

}

#searchResults h3 {
	border-bottom: #ccc 1px solid;
	padding-bottom: 10px;
}

#searchResults .overlay {
	width: 674px;
	padding: 60px 20px 20px;
	font-size: 0.6em;
	background-color: #E9EFF2;
	-moz-box-shadow: 0px 2px 2px #333;
	-webkit-box-shadow: 0px 2px 2px #333; 
	box-shadow: 0px 2px 2px #333; 
	line-height: 1.7em;
	overflow: hidden;
	
}

#searchResults ul {
	padding-left: 0px;
	-moz-column-count: 3;
	-moz-column-gap: 20px;
	-webkit-column-count: 3;
	-webkit-column-gap: 20px;
	column-count: 3;
	column-gap: 20px;
	border-bottom: #ccc 1px solid;
	padding-bottom: 20px;
	margin-top: 10px;
}

#searchResults .button {
	float: right;
	margin-left: 20px;
}


/* JRL-added - want to merge with JB's */

/* Content embedding control */

iframe {
	margin-left: -160px;
	width: 672px;
	border: silver solid 1px;
	margin-top:20px;
}

.viewer img {
	max-width: 674px;
	height: auto;
	margin: 20px 0px 20px -160px;
}

.viewer a img {
	margin: 20px 0px -6px -160px;
}

/* making the header panel disappear smoothly on closing a tiddler */

.tiddler textarea { width: 100%; }
.toolbar svg {
	height: 16px;
	height: 16px;
	/*margin-top: 0.7em;*/
}
.toolbar svg .glyph {
       fill: #545454;
}

.toolbar a:hover .glyph {
       fill: black;
}
.toolbar {
	/*float: right;*/
	/*clear: both;
	width: 160px;
	margin-left: -180px;
	text-align: right;*/
	font-style: italic;
	line-height: 1.286em;
position: absolute;
right:0px;
}
.headingPanel .toolbar {
bottom: -27px;
}

.toolbar a {
	border: none;
	margin-right: 4px;
}

pre, code, tt {
	overflow: auto;
	border: 1px solid #C2A799;
	padding: 1px;
}

.historyBox {
    position: relative;
}

.historyBox .scrollBar span {
	background-image: url('http://ambit-theme.tiddlyspace.com/history_sprite.png');
}

#contents ul li span {
	background-image: url('http://ambit-theme.tiddlyspace.com/contents_sprite.png');
}

ol.popup li {
	list-style: none;
}

.tiddler .content, .tiddler .tags {
	padding-bottom: 1.4em;
}

.tags div {
	margin-bottom: 0;
	clear: none;
}

.tags .slider {
	position: relative;
	top: -1.4em;
}

.right {
	float: right;
}

/* from DiffFormatter StyleSheet */
.diff { white-space: pre; font-family: monospace; }
.diff ins, .diff del { display: block; text-decoration: none; }
.diff ins { background-color: #dfd; }
.diff del { background-color: #fdd; }
.diff .highlight { background-color: [[ColorPalette::SecondaryPale]]; }

/* from StyleSheetColors */
#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)';}

.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]];}

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

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


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

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

/* from StyleSheetLayout */
.annotation {padding:0.5em; margin:0.5em;}

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

.whenBackstage {display:none;}
.backstageVisible .whenBackstage {display:block;}

.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 0;}
.popup li.disabled {padding:0.4em;}
.popup li a {display:block; padding:0.4em; font-weight:normal; cursor:pointer;}

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

.tabset {padding:1em 0 0 0.5em;}
.tab {margin:0 0 0 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;}

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

/* from StyleSheetTiddler */
div.toolbar {
	/* visibility:hidden;
	right:-16px; */
}

.selected div.toolbar {
	visibility: visible;
}

/* all of StyleSheetPrint - check this looks OK */
@media print {
#mainMenu, #sidebar, #messageArea, .toolbar, #backstageButton, #backstageArea {display: none !important;}
#displayArea {margin: 1em 1em 0em;}
noscript {display:none;} /* Fixes a feature in Firefox 1.5.0.2 where print preview displays the noscript content */

}

#backstage, #backstageArea {
    font-size: 1.41em;
}

#backstageArea {
    position:absolute;
    width:100%;
    opacity: 0.8;
}

html, #displayArea {
	min-height:100%;
}

#backstageButton {
	width: 30px;
	height: 30px;
}

/*-------------- Pop ups etc */

ol.popup {
    background-color: #fbfbfb;
    border: 1px solid #CCCCCC;
    color: #565656;
	font-size: 1.1em;
    list-style: none outside none;
    margin: -1px 0 0;
    padding: 10px;
    position: absolute;
    z-index: 300;
	-moz-box-shadow: 1px 1px 3px #939393;
	-webkit-box-shadow: 1px 1px 3px #939393;
	box-shadow: 1px 1px 3px #939393;
}

ol.popup table {
	margin: 0px;	
}

ol.popup table td {
    font-weight: normal;
    padding: 4px 3px;
    text-align: left;
}

.popup li a {
    cursor: pointer;
    display: block;
    font-weight: normal;
    padding: 0.4em;
}
.popup li a:hover {
	background-color: #ffd9c5;
}

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


/*-------- Edit mode styles */

.editorHeading {
	padding-top: 20px;
}

.tiddler textarea {
	width: 674px;
}

div.editToolbar {
	float: right;
    margin: 20px;
    width: 150px;
    text-align: right;
}

.editor.title input {
	font-size: 1.5em;
    width: 440px;
}

.editToolbar a {
	border-bottom: none;
}
.editToolbar a:hover {
	background-color: white;
} 
.editToolbar svg {
	width: 20px;
	margin-left: 10px;
}

/*}}}*/
/*{{{*/
.publicLightText {
	color: #C0E5FC;
}

.privateLightText {
	color: #E2C1D6;
}

.tiddler .error.annotation .button{
	display: inline-block;
}

#backstageArea #backstageToolbar a.task_tiddlyspace {
	margin: 0px auto auto -75px;
	font-weight: bold;
	width: 150px;
	line-height:24px;
	font-size: 1.2em;
	padding: 0;
	top: 0;
	position: absolute;
	left: 50%;
}

.task_tiddlyspace .image,
.task_tiddlyspace .svgIcon {
	margin-top: -2px;
	display: inline;
}

.task_tiddlyspace .svgIconText {
	display: none;
}

.task_tiddlyspace .logoText {
	position: absolute;
	top: 0px;
	margin-left: 5px;
}

#backstageArea {
	z-index: 49;
	color: white;
	background-color: black;
	background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #222),color-stop(0.5, #333),color-stop(1, #555));
	background: -moz-linear-gradient(center bottom,#222 0%, #333 50%, #555 100%);
	/* For Internet Explorer 5.5 - 7 */
	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ff555555, endColorstr=#ff222222);
	/* For Internet Explorer 8 */
	-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#ff555555, endColorstr=#ff222222)";
	height: 24px;
	padding: 0;
	border-bottom: solid 1px black;
}

.backstageBackground {
	fill: black;
}

#backstageButton {
	overflow: hidden;
}

#backstageButton #backstageShow,
#backstageButton #backstageHide {
	margin: 0px;
	padding: 0px;
}

#backstageButton #backstageShow:hover,
#backstageButton #backstageHide:hover {
	background: none;
	color: none;
}

#backstageShow {
	margin-right: -3px;
	margin-top: -3px;
}

#backstageShow .svgIcon {
	left: 8px;
	position: relative;
	top: -5px;
}

#messageArea {
	top: 50px;
}

#backstageToolbar {
	position: relative;
}

#backstageArea a {
	padding: 0px;
	margin-left: 0px;
	color: white;
	background: none;
}

#backstageArea a:hover {
	background-color: white;
}

#backstage .tabContents ol,
#backstage .tabContents ul {
	padding: auto;
}

#backstageButton a {
	margin: 0;
}

.backstagePanelBody,
.backstagePanelBody .tabContents ul {
	padding: 5px;
	margin: 5px;
}

#backstage #backstagePanel {
	margin-left: 5%;
	padding: 0em;
	margin-right: 5%;
}

#backstageToolbar a {
	position: relative;
}

#backstageArea a.backstageSelTab,
#backstageToolbar .backstageTask {
	line-height: 24px;
	color: #767676;
}

.backstageTask .externalImage,
.backstageTask .image {
	display: inline;
}

.backstageTask .txtUserName,
.backstageTask .spaceName {
	color: #fff;
}

.backstageSelTab .txtUserName,
.backstageSelTab .spaceName,
a:hover .txtUserName,
a:hover .spaceName {
	color: #000;
}

.spaceSiteIcon {
	margin-right: 10px;
}

.userSiteIcon {
	margin-left: 10px;
}

#backstageToolbar .task_space {
	position: absolute;
	top: 0px;
	left: 0%;
}

#backstageToolbar .task_user,
#backstageToolbar .task_login {
	display: block;
	position: absolute;
	top: 0px;
	right: 5%;
}

#backstageToolbar .task_login img {
	position: relative;
	display: inline;
}

#backstageToolbar .task_login img,
#backstageToolbar .task_user img {
	float: right;
}

#backstageToolbar .task_space .svgIcon {
	float: left;
	position: relative;
	z-index: 2;
}

#backstageToolbar a span {
	z-index: 2;
}

#backstageToolbar .spaceSiteIcon {
	float: left;
}

a.backstageTask {
	display: block;
}

#backstageToolbar a span.txtUserName,
#backstageToolbar a .txtUserName span {
	display: inline;
	float: none;
}

#backstage .deleteButton {
	margin-left: 0.3em;
	font-weight: bold;
	color: red;
	font-size: 1.6em;
}

#backstage .deleteButton:hover {
	background: none;
}

#backstageArea .siteIcon {
	display: inline;
}

#backstagePanel .TiddlySpaceLogin {
	display: inline;
}

.backstagePanelBody .tabContents .button {
	display: block;
}

.backstagePanelBody .tab {
	margin: 0 0 0 0.6em;
	padding: 0.4em 0.5em 1px 0.5em;
}

#backstage .tabContents{
	padding: 1.5em;
}

#backstage .wizard {
	border: 0px;
}

#backstage .txtSpaceTab li {
	border: 1px solid #ddd;
	background: #eee;
	list-style: none;
	margin: 0.5em;
	padding: 0.5em;
	width: 80%;
}

#backstage .txtSpaceTab li.annotation {
	border: 2px solid [[ColorPalette::SecondaryMid]];
}

#backstage div  li.listLink {
	border: 0px;
	width: 78%;
	font-size: 0.7em;
}

#backstage div li.listTitle {
	font-weight: bold;
	text-decoration: underline;
	font-size: 1em;
	background: #ccc;
	width: 100%;
}

#backstage div.txtSpaceTab li .deleteButton {
	float: right;
}

#backstage fieldset {
	border: solid 1px [[ColorPalette::Background]];
}

#backstage .viewer table,#backstage table.twtable {
	border: 0px;
}

#backstageToolbar img {
	padding: 0;
}

#backstage .wizard,
#backstage .wizardFooter {
	background: none;
}

.viewer td, .viewer tr, .twtable td, .twtable tr {
	border: 1px solid #eee;
}

#backstage .inlineList ul li {
	background-color: [[ColorPalette::Background]];
	border: solid 1px [[ColorPalette::TertiaryMid]];
	display: block;
	float: left;
	list-style: none;
	margin-right: 1em;
	padding: 0.5em;
}

.backstageClear, .inlineList form {
	clear: both;
	display: block;
	margin-top: 3em;
}

.tiddlyspaceMenu {
	text-align: center;
}

span.chunkyButton {
	display: block;
	padding: 0;
	margin: 0;
	border: solid 2px #000;
}

span.chunkyButton a.button, span.chunkyButton a:active.button {
	white-space: nowrap;
	font-weight: bold;
	font-size: 1.8em;
	color: #fff;
	background-color: #04b;
	text-align: center;
	padding: 1em 3em;
	margin: 0;
	border-style: none;
	border-top: solid 1px #fff;
	display: block;
}

.chunkyButton {
	width: 18em;
}

span.chunkyButton a.button:hover {
	background-color: #014;
	border-style: none;
	color: #fff;
	border-top: solid 1px #8cf;
}

a.baskstageTask.task_login,
a.baskstageTask.task_user {
	_width: 200px;
	_text-align: right;
}

#backstageArea #backstageToolbar .task_login img,
#backstageArea #backstageToolbar .task_user img {
	_display: inline;
	_float: none;
}

#backstage .unpluggedSpaceTab .wizard,
.unpluggedSpaceTab .wizard {
	background: white;
	border: 2px solid #CCC;
	padding: 5px;
}

.syncKey .keyItem {
	border: 1px solid black;
	display: inline-block;
	margin: 0.2em;
	padding: 0.1em 0.1em 0.1em 0.1em;
}

.keyHeading {
	font-size: 2em;
	font-weight: bold;
	margin: 0.4em 0em -0.2em;
}

.unpluggedSpaceTab .putToServer,
.unpluggedSpaceTab .notChanged {
	display: none;
}

.tiddlyspaceMenu ul {
	margin: 0;
	padding: 0;
}

.tiddlyspaceMenu ul li {
	list-style: none;
}

.unsyncedChanges .unsyncedList {
	display: block;
}

.unsyncedList {
	display: none;
}

/* TODO: This is a presentational fix for a data problem that
   ought to go away with sync refactorings.  See:
   https://github.com/TiddlySpace/tiddlyspace/pull/536#commitcomment-216317
*/

.notFound td .externalLink {
	display: none;
}

/*}}}*/
/*{{{*/
.tiddler .originButton div {
	display: inline-block;
}

.tiddler .spaceSiteIcon .siteIcon {
	_display: inline; /* IE doesn't like inline-block */
}

.tiddler .originButton {
	display: block;
}

.selected .tagging,
.selected .tagging:hover {
	border: none;
	background: none;
}

.tagging {
	float: none;
	background: none;
	border: none;
}

.tagging li.listTitle {
	margin-left: 0px;
}
.tagging li {
	margin: 0 8px;
}

.tagging .tiddlyLink {
	-webkit-border-radius: 3px;
	-moz-border-radius: 3px;
	-o-border-radius: 3px;
	border-radius: 3px;
	padding: 1px 2px;
	line-height: 1.2em;
}

/* for following */
#popup .siteIcon {
	float: left;
	height: 25px;
}

.content {
	width: 100%; /* IE */
	font-size: 0.9em;
}

.editorHeading {
	height: 48px;
}

.heading {
	left: 0;
	margin-bottom: 40px;
	position: relative;
	top: 32px;
}

.followButton a {
	display: block;
	margin-top: -20px;
}

.tiddler .followPlaceHolder {
	display: block;
	position: absolute;
	top: 16px;
	right: 64px;
	_right: 138px; // add width of modifierIcon
}

.tiddler .followButton {
	position: relative;
	height: 24px;
	text-align: left;
	color: #fff;
	background: [[ColorPalette::PrimaryMid]];
	padding: 10px 0px 0px 10px;
	width: 38px;
	margin: -16px -8px 24px 0;
}

/* creates the larger triangle */
.followButton:before {
	content: "\00a0";
	display: block; /* reduce the damage in FF3.0 */
	position: relative;
	bottom: -20px;
	right: 0;
	width: 0;
	height: 0;
	border-width: 0 0 20px 20px;
	border-style: solid;
	border-color: transparent [[ColorPalette::PrimaryMid]];
}

.toolbar svg {
	height: 16px;
	width: 16px;
}

.toolbar svg .glyph {
	fill: #ccc;
}

.toolbar a:hover .glyph {
	fill: black;
}

.toolbar a:active .glyph {
	fill: [[ColorPalette::Background]];
}

.originButton,
.followPlaceHolder,
.tiddler .subtitle {
	cursor: pointer;
}

.editSpaceSiteIcon .originButton {
	cursor: auto;
}

.tiddler .subtitle:hover {
	font-weight: bold;
	background: none;
}

.originButton img,
.originButton svg {
	margin-left: 0px;
}

.modifierIcon {
	position: absolute;
	width: 74px;
	top: 0px;
	right: 0px;
	_right: 74px; /* in IE6 positioning works incorrectly so use -width instead */
	text-align: right;
}

.modifierIcon img,
.modifierIcon svg {
	margin-right: 8px;
}

.tiddler .viewer {
	padding-bottom: 16px;
	margin: 0 0 0 56px;
	line-height: 1.4em;
}

.viewer pre {
	margin-left: 0;
}

.siteIcon .label {
	color: [[ColorPalette::TertiaryDark]];
}

.tiddler .spaceSiteIcon {
	float: left;
	margin-right: 0;
	margin-top: 0;
	position: relative;
	display: block;
}

.tiddler .titleBar {
	display: block;
	margin-right: 136px;
	margin-left: 56px;
}

.followButton a {
	color: [[ColorPalette::Background]];
}

.tiddler {
	position: relative;
	padding: 0;
	margin-bottom: 3em;
	border-top: 3px solid [[ColorPalette::PrimaryMid]];
	background: #fff;
}

.tiddler .editor {
	padding: 0px 8px;
}

.tiddler .heading .title {
	position: relative;
	display: block;
	word-wrap: break-word;
	font-size: 32px;
	line-height: 32px;
}
.tiddler .heading .editor.title {
	font-size: 1.7em;
	line-height: normal;
}

.tiddler .headingClear {
	clear: both;
}

.tiddler .subtitle {
	font-style: italic;
	font-size: 0.9em;
	color: #a6a59e;
	margin-top: 0;
}

.toolbar {
	position: absolute;
	padding: 0;
	top: 8px;
	right: -8px;
}

.toolbar .moreCommand.highlight {
	background: none;
}

.tiddler .toolbar .button {
	border: none;
	display: inline;
	padding: 0px;
	margin-right: 16px;
}

.tiddler .toolbar a:hover {
	background: none;
}

.tiddler .tagged .listTitle {
	display: none;
}

.revButton {
	float: right;
}

/*! EditTemplate specific*/
.tiddler .privacySettings {
	text-align: center;
}
.tiddler .privacySettings .originButton {
	display: inline;
}

.editSpaceSiteIcon, .privacyEdit {
	float: left;
}

.editSpaceSiteIcon svg,
.editSpaceSiteIcon img,
.editSpaceSiteIcon .roundelLabel {
	float: left;
}

.tagTitle {
	position: absolute;
	text-align: center;
	width: 48px;
	top: 0px;
	left: -56px;
}

.editSpaceSiteIcon .originButton img,
.editSpaceSiteIcon .originButton svg {
	height: 16px;
	margin-left: 24px;
	margin-right: 32px;
	width: 16px;
}

.tagAnnotation {
	margin-top: 8px;
	padding-bottom: 8px;
}
.annotationsBox {
	margin-top: 8px;
}

.editorFooter {
	position: relative;
	padding: 0;
	margin-top: 16px;
	margin-left: 64px;
}

.tiddler .editorFooter .editor {
	padding-left: 0px;
}

.heading .editor input {
	width: 100%;
	font-size: 1.5em;
}

.spaceSiteIcon .externalImage .image a:hover,
.modifierIcon .externalImage .image a:hover {
	background: none;
}

div.toolbar {
	visibility:hidden;
	right:-16px;
}

.selected div.toolbar {
	visibility: visible;
}

.followButton a:hover {
	background: [[ColorPalette::PrimaryMid]];
	text-decoration: underline;
}

a.image:hover {
	background: transparent;
}

@media all and (max-device-width: 480px) {
	div.toolbar {
		visibility:visible;
	}
}
@media only screen and (device-width: 768px) {
	div.toolbar {
		visibility:visible;
	}
}
@media all and (max-width: 960px) {
	.tiddler .titleBar {
		margin-left: 36px;
		margin-right: 80px;
	}

	.tiddler .heading {
		margin-bottom: 48px;
	}

	.tiddler .heading .title {
		font-size: 32px;
		line-height: 32px;
	}

	.tiddler .modifierIcon img,
	.tiddler .modifierIcon svg,
	.tiddler .spaceSiteIcon .originButton img,
	.originButton svg {
		width: 32px;
		height: 32px;
		margin-left: 0px;
		margin-right: 0px;
	}

	.tiddler .followPlaceHolder {
		right: 48px;
	}

	.tiddler .followButton {
		width: 24px;
	}

	.tiddler .viewer {
		margin: 0px 0px 0px 36px;
		padding-top: 0;
	}

	br {
		line-height: 0.5em;
	}
}
/*}}}*/
/*{{{*/
body {
	font-size: 1em;
	font-family: helvetica, arial, sans-serif;
	background-color: #fff;
	color: [[ColorPalette::Foreground]];
}

body ul { margin: 0; }

#popup {
	background-color: [[ColorPalette::TertiaryPale]];
}

#popup.confirmationPopup, .followList {
	font-size: 0.8em;
	padding: 1em;
	border: solid 1px [[ColorPalette::SecondaryMid]];
	background-color: [[ColorPalette::SecondaryPale]];
}

.followList .listTitle {
	text-decoration: underline;
}

#popup .followTiddlersList a {
	display: inline;
	padding: 0;
}

#popup li a {
	color: [[ColorPalette::PrimaryMid]];
	font-weight: bold;
}

#popup li a:hover {
	color: [[ColorPalette::PrimaryPale]];
	background: [[ColorPalette::PrimaryMid]];
}

#popup li.listTitle {
	border-bottom: 1px solid #000;
	font-weight: bold;
	margin-bottom: 10px;
}

#popup.followList {
	margin-left: 50px;
	margin-top: -30px;
}

.followTiddlersList .label {
	display: block;
	left: 10px;
	top: 0px;
	line-height: 16px;
	position: relative;
}

#popup .followTiddlersList .siteIcon{
	height: auto;
}

#popup .followTiddlersList li{
	clear: both;
	display: block;
	height: 48px;
	margin-bottom: 8px;
	position: relative;
}

#popup .followTiddlersList a{
	display: inline;
}

#displayArea {
	margin: 0;
	top: 0px;
	left: 0px;
	width: 100%;
	position: relative;
}

.revisionCloak {
	position: absolute;
	position: fixed !important;
	height: 100%;
	width: 100%;
	top: 0;
	left: 0;
	border: 0;
	margin: 0;
	padding: 0;
	opacity: 0.5;
	filter: alpha(opacity=50);
	background-color: #000;
}

/* *** Header *** */
.header {
	position: relative;
	background-color: [[ColorPalette::PrimaryMid]];
	_width: 100%; /* ie 6 demands */
}

.headerForeground {
	background-color: [[ColorPalette::PrimaryMid]];
	float: left;
	margin: 24px 16px 0px 72px;
	padding: 0;
	position: relative;
	top: 0;
	_width: 70%; /*ie6: needed for the background to actually be transparent*/
	_background-color: transparent; /*ie6: needed to show the search box*/
}

.clearFloat {
	clear: both;
}

#contentWrapper {
	position: relative;
	padding-top: 1px;
	top: -1px;
}

#tiddlerDisplay {
	_position: relative; /* ie 6*/
}

.siteTitle {
	clear: both;
	display: block;
	font-size: 32px;
	font-weight: bold;
	line-height: 32px;
}

.siteSubtitle {
	display: block;
	font-size: 14px;
	height: 16px;
	margin-bottom: 8px;
}

#sidebarSearch {
	padding: 0;
	position: absolute;
	right: 80px;
	top: 8px;
	width: 176px;
}

#sidebarSearch .txtOptionInput {
	width: 100%;
	margin-top: 5px;
	_color: #bbb; /* ie6 danger */
}

#sidebarSearch .txtOptionInput:focus {
	color: #000;
}

#sidebarSearch .searchButton {
	display: none;
}

/* *** Menu Bar *** */

#mainMenu {
	position: static;
	text-align: left;
	margin-left: 72px;
	float: left;
	width: auto;
	padding: 0;
	font-size: 1em;
	line-height: normal;
}

#mainMenu a {
	color: #fff;
	padding: 8px;
	font-size: 0.9em;
	margin-right: 16px;
}

#mainMenu a:hover {
	background-color: [[ColorPalette::PrimaryMid]];
	color: [[ColorPalette::Background]]
}

#sidebarOptions {
	margin-right: 72px;
	float: right;
	font-size: 1.1em;
	line-height: 1.6em;
	min-height: 1em;
	padding-top: 0;
}

#sidebarOptions a {
	margin-right: 8px;
}

.confirmationPopup .button,
#sidebarOptions .button {
	cursor: pointer;
	line-height: 1.4em;
	text-align: center;
	margin-right: 8px;
	margin-left:-2px;
}

.confirmationPopup .button {
	font-size: 0.9em;
	padding: 2px;
}

#sidebarOptions .button {
	font-size: 0.7em;
	float: left;
	width: 80px;
	padding: 0px;
        color: #fff;
}

.confirmationPopup a.button,
#sidebarOptions a {
	border: none;
	margin: 0 0.2em;
	padding: 0.6em 0.25em;
	display: inline;
	color: #666;
}

.confirmationPopup a.button:hover,
#sidebarOptions a:hover {
	color: #000;
}

.confirmationPopup a.button:active,
#sidebarOptions a:active {
	border: solid 1px [[ColorPalette::PrimaryMid]];
	background-color: #fff;
	background: -webkit-gradient( linear, left bottom, left top, color-stop(0.1,rgb(200,200,200)), color-stop(1, rgb(100,100,100)));
	background: -moz-linear-gradient(center bottom , rgb(200,200,200) 10%,rgb(100,100,100) 100%) repeat scroll 0 0 transparent;
}
/* *** Sidebar *** */

#sidebar .wizard table {
	margin: 0px;
}

.tabContents .listTitle:first-child {
	margin-top: 0px;
}

#menuBar {
	background: [[ColorPalette::PrimaryLight]];
	left: 0;
	right: 0;
	position: relative;
	margin: 0;
	padding: 0.5em 0 0.5em 0;
	min-height: 1em;
	overflow: hidden;
	_width: 100%; /* for ie 6 */
}

#sidebarOptions a.button:hover {
	color: [[ColorPalette::PrimaryPale]];
    background: [[ColorPalette::PrimaryMid]];
}

#tiddlerDisplay, #searchResults {
	margin: 16px 448px 0 72px;
}

#sidebarTabs {
	position: absolute;
	right: 72px;
	width: 352px;
	top: 0;
}

#sidebarTabs .tabsetWrapper .tabset {
	width: 87px;
	border-top: 1px solid [[ColorPalette::PrimaryPale]];
	border-left: 1px solid [[ColorPalette::PrimaryPale]];
	border-bottom: 1px solid [[ColorPalette::PrimaryPale]];
	height: auto;
	float: left;
	word-wrap: break-word;
	top: 0;
	padding: 0;
}

#sidebarTabs .tabsetWrapper .tabContents {
	background-color: [[ColorPalette::PrimaryPale]];
	border: 3px solid [[ColorPalette::PrimaryMid]];
	width: 242px;
	_width: 238px;
	left: -3px;
	_left: -5px;
	position: relative;
	min-height: 34em;
	padding: 8px;
	font-size: 0.8em;
}

/* ---- Side style --- */

#sidebarTabs .tabsetWrapper .tabset .tab {
	font-size: 0.9em;
	padding: 0.7em 8px 0.5em;
	color: #fff;
	background: [[ColorPalette::PrimaryLight]];
	border: none;
	line-height: 16px;
	position: relative;
	display: block;
	margin: 0;
}

#sidebarTabs .tabsetWrapper .tabset .tabSelected {
	color: [[ColorPalette::PrimaryMid]];
	background: [[ColorPalette::PrimaryPale]];
	border-top: 3px solid [[ColorPalette::PrimaryMid]];
	border-bottom: 3px solid [[ColorPalette::PrimaryMid]];
	border-left: 3px solid [[ColorPalette::PrimaryMid]];
	z-index: 10;
	margin-top: -1px;
	font-weight: bold;
}

#sidebarTabs .tabContents li {
	border: none;
	margin-left: 0;
	word-wrap: break-word;
}

.tabContents .timeline {
	background: [[ColorPalette::PrimaryPale]];
	margin-bottom: 8px;
}

#sidebarTabs .timeline li.listTitle {
	color: #132E43;
	margin-left: 8px 0;
	padding: 0.3em 0.11em;
	font-size: 1em;
	border-bottom: none;
}

#sidebarTabs .tabContents li a {
	display: block;
	text-align: left;
	margin: 0 0 1px 0;
	padding: 0.3em 1em;
	background: [[ColorPalette::PrimaryPale]];
}

#sidebarTabs .tabsetWrapper .tabset a:hover,
#sidebarTabs .tabContents li a:hover {
	color: [[ColorPalette::PrimaryPale]];
	background: [[ColorPalette::PrimaryMid]];
}

/* Activity Stream */
#sidebarTabs .tabContents .activityStream .feedItem a {
	display: inline-block;
	padding: 0;
	background: none;
}

/* ---- Tagging box --- */
.tagInfo {
	border: 1px solid #cccccc;
	padding: 10px 15px;
	-moz-box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
	box-shadow: 0 2px 2px rgba(0,0,0,0.2);
	color: [[ColorPalette::TertiaryMid]];
	background: -moz-linear-gradient(100% 100% 90deg, #f4f4f4, #e5e5e5);
	background: -webkit-gradient(linear, left top, right top, from(#e5e5e5), to(#f4f4f4));
	margin-top: 1em;
	font-size: 13px;
	margin: 0 0 0 56px;
}

.tagInfo ul {
	list-style: none;
	padding-left: 2.2em;
}

.tagInfo ul li {
	display: inline;
}

.tagInfo ul li.listTitle,
.tagInfo .tagging ul li.listTitle {
	color: [[ColorPalette::PrimaryMid]];
	font-size: 13px;
}

.tagInfo ul li a {
	border: none;
}

.tagInfo .tagging ul li {
	float: none;
	display: inline-block;
}

.tagInfo .tagging {
	padding: 0;
}

.viewRevision .toolbar {
	right: 48px;
	top: 8px;
}

.viewRevision .modifierIcon img,
.viewRevision .modifierIcon svg {
	margin-right: 8px;
}

.viewRevision .toolbar svg {
	width: 32px;
	height: 32px;
}

/* --- IE hacks from lattice --- */

/* ie hacks */
* html #menuBar {
	margin-bottom: 8px;
}
.toolbar .svgIconText {
	*display: inline;
}

div.tiddler .toolbar a {
	cursor: pointer;
	float: left\9;
	display: inline\9;
}

* html .toolbar {
	right: 8px;
}
* html .followButton a {
	margin-top: 0px;
	margin-right: 8px;
}
* html #tiddlerDisplay {
	margin-top: 0px;
}

/* for printing purposes */
@media print {
	#mainMenu,
	#sidebar,
	#messageArea,
	.toolbar,
	.followPlaceHolder,
	#backstageButton,
	#backstageArea,
	#sidebarTabs,
	#sidebarSearch .txtOptionInput,
	#sidebarOptions {
		display: none !important;
	}
	#displayArea {
		margin: 1em 1em 0em;
	}
	noscript {
		display:none; /* Fixes a feature in Firefox 1.5.0.2 where print preview displays the noscript content */
	}
	#tiddlerDisplay {
		margin: 16px 16px;
	}
}

@media all and (max-width: 960px){
	#tiddlerDisplay,
	#searchResults {
		margin: 16px 366px 0 16px;
	}

	#mainMenu {
		margin-left: 16px;
	}

	.headerForeground {
		margin-left: 16px;
	}

	#sidebarSearch {
		right: 16px;
	}

	#sidebarOptions {
		margin-right: 16px;
	}

	#sidebarTabs {
		right: 16px;
		width: 326px;
	}

	#sidebarTabs .tabsetWrapper .tabset {
		font-size: 0.9em;
		width: 77px;
	}

	#sidebarTabs .tabsetWrapper .tabContents {
		width: 226px;
		_width: 222px;
	}

	#sidebarTabs .tabContents li a {
		font-size: 0.9em;
	}
}
/*}}}*/
[[StyleSheetTiddler]]
/*{{{*/
.statusBoxWrapper {
	margin-left: 0;
}

.statusBoxWrapper .pending {
	background-color: #FFFFDE;
	border: 3px solid #FFFF42;
	color: #6B736B;
}

.statusBoxWrapper ul {
	margin: 0;
}
/*}}}*/
<html>
<input name=TIDscore type=radio value="1" />bad
<input name=TIDscore type=radio value="2" />ok
<input name=TIDscore type=radio value="3" />ace
</html>
/***
|Name|TagCloudPlugin|
|Source|http://www.TiddlyTools.com/#TagCloudPlugin|
|Version|1.7.0|
|Author|Eric Shulman|
|Original Author|Clint Checketts|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|present a 'cloud' of tags (or links) using proportional font display|
!Usage
<<<
{{{
<<cloud type action:... limit:... tag tag tag ...>>
<<cloud type action:... limit:... +TiddlerName>>
<<cloud type action:... limit:... -TiddlerName>>
<<cloud type action:... limit:... =tagvalue>>
}}}
where:
* //type// is a keyword, one of:
** ''tags'' (default) - displays a cloud of tags, based on frequency of use
** ''links'' - displays a cloud of tiddlers, based on number of links //from// each tiddler
** ''references'' - displays a cloud of tiddlers, based on number of links //to// each tiddler
* ''action:popup'' (default) - clicking a cloud item shows a popup with links to related tiddlers<br>//or//<br> ''action:goto'' - clicking a cloud item immediately opens the tiddler corresponding to that item
* ''limit:N'' (optional) - restricts the cloud display to only show the N most popular tags/links
* ''tag tag tag...'' (or ''title title title'' if ''links''/''references'' is used)<br>shows all tags/links in the document //except// for those listed as macro parameters
* ''+TiddlerName''<br>show only tags/links read from a space-separated, bracketed list stored in a separate tiddler.
* ''-TiddlerName''<br>show all tags/links //except// those read from a space-separated, bracketed list stored in a separate tiddler.
* ''=tagvalue'' (//only if type=''tags''//)<br>shows only tags that are themselves tagged with the indicated tag value (i.e., ~TagglyTagging usage)
//note: for backward-compatibility, you can also use the macro {{{<<tagCloud ...>>}}} in place of {{{<<cloud ...>>}}}//
<<<
!Examples
<<<
//all tags excluding<<tag systemConfig>>, <<tag excludeMissing>> and <<tag script>>//
{{{<<cloud systemConfig excludeMissing script>>}}}
{{groupbox{<<cloud systemConfig excludeMissing script>>}}}
//top 10 tags excluding<<tag systemConfig>>, <<tag excludeMissing>> and <<tag script>>//
{{{<<cloud limit:10 systemConfig excludeMissing script>>}}}
{{groupbox{<<cloud limit:10 systemConfig excludeMissing script>>}}}
//tags listed in// [[FavoriteTags]]
{{{<<cloud +FavoriteTags>>}}}
{{groupbox{<<cloud +FavoriteTags>>}}}
//tags NOT listed in// [[FavoriteTags]]
{{{<<cloud -FavoriteTags>>}}}
{{groupbox{<<cloud -FavoriteTags>>}}}
//links to tiddlers tagged with 'package'//
{{{<<cloud action:goto =package>>}}}
{{groupbox{<<cloud action:goto =package>>}}}
//top 20 most referenced tiddlers//
{{{<<cloud references limit:20>>}}}
{{groupbox{<<cloud references limit:20>>}}}
//top 20 tiddlers that contain the most links//
{{{<<cloud links limit:20>>}}}
{{groupbox{<<cloud links limit:20>>}}}
<<<
!Revisions
<<<
2009.07.17 [1.7.0] added {{{-TiddlerName}}} parameter to exclude tags that are listed in the indicated tiddler
2009.02.26 [1.6.0] added {{{action:...}}} parameter to apply popup vs. goto action when clicking cloud items
2009.02.05 [1.5.0] added ability to show links or back-links (references) instead of tags and renamed macro to {{{<<cloud>>}}} to reflect more generalized usage.
2008.12.16 [1.4.2] corrected group calculation to prevent 'group=0' error
2008.12.16 [1.4.1] revised tag filtering so excluded tags don't affect calculations
2008.12.15 [1.4.0] added {{{limit:...}}} parameter to restrict the number of tags displayed to the top N most popular
2008.11.15 [1.3.0] added {{{+TiddlerName}}} parameter to include only tags that are listed in the indicated tiddler
2008.09.05 [1.2.0] added '=tagname' parameter to include only tags that are themselves tagged with the specified value (i.e., ~TagglyTagging usage)
2008.07.03 [1.1.0] added 'segments' property to macro object.  Extensive code cleanup
<<<
!Code
***/
//{{{
version.extensions.TagCloudPlugin= {major: 1, minor: 7 , revision: 0, date: new Date(2009,7,17)};
//Originally created by Clint Checketts, contributions by Jonny Leroy and Eric Shulman
//Currently maintained and enhanced by Eric Shulman
//}}}
//{{{
config.macros.cloud = {
	tagstip: "%1 tiddlers tagged with '%0'",
	refslabel: " (%0 references)",
	refstip: "%1 tiddlers have links to '%0'",
	linkslabel: " (%0 links)",
	linkstip: "'%0' has links to %1 other tiddlers",
	groups: 9,
	init: function() {
		config.macros.tagCloud=config.macros.cloud; // for backward-compatibility
		config.shadowTiddlers.TagCloud='<<cloud>>';
		config.shadowTiddlers.StyleSheetTagCloud=
			'/*{{{*/\n'
			+'.tagCloud span {line-height: 3.5em; margin:3px;}\n'
			+'.tagCloud1{font-size: 80%;}\n'
			+'.tagCloud2{font-size: 100%;}\n'
			+'.tagCloud3{font-size: 120%;}\n'
			+'.tagCloud4{font-size: 140%;}\n'
			+'.tagCloud5{font-size: 160%;}\n'
			+'.tagCloud6{font-size: 180%;}\n'
			+'.tagCloud7{font-size: 200%;}\n'
			+'.tagCloud8{font-size: 220%;}\n'
			+'.tagCloud9{font-size: 240%;}\n'
			+'/*}}}*/\n';
		setStylesheet(store.getTiddlerText('StyleSheetTagCloud'),'tagCloudsStyles');
	},
	getLinks: function(tiddler) { // get list of links to existing tiddlers and shadows
		if (!tiddler.linksUpdated) tiddler.changed();
		var list=[]; for (var i=0; i<tiddler.links.length; i++) {
			var title=tiddler.links[i];
			if (store.isShadowTiddler(title)||store.tiddlerExists(title))
				list.push(title);
		}
		return list;
	},
	handler: function(place,macroName,params) {
		// unpack params
		var inc=[]; var ex=[]; var limit=0; var action='popup';
		var links=(params[0]&&params[0].toLowerCase()=='links'); if (links) params.shift();
		var refs=(params[0]&&params[0].toLowerCase()=='references'); if (refs) params.shift();
		if (params[0]&&params[0].substr(0,7).toLowerCase()=='action:')
			action=params.shift().substr(7).toLowerCase();
		if (params[0]&&params[0].substr(0,6).toLowerCase()=='limit:')
			limit=parseInt(params.shift().substr(6));
		while (params.length) {
			if (params[0].substr(0,1)=='+') { // read taglist from tiddler
				inc=inc.concat(store.getTiddlerText(params[0].substr(1),'').readBracketedList());
			} else if (params[0].substr(0,1)=='-') { // exclude taglist from tiddler
				ex=ex.concat(store.getTiddlerText(params[0].substr(1),'').readBracketedList());
			} else if (params[0].substr(0,1)=='=') { // get tag list using tagged tags
				var tagged=store.getTaggedTiddlers(params[0].substr(1));
				for (var t=0; t<tagged.length; t++) inc.push(tagged[t].title);
			} else ex.push(params[0]); // exclude params
			params.shift();
		}
		// get all items, include/exclude specific items
		var items=[];
		var list=(links||refs)?store.getTiddlers('title','excludeLists'):store.getTags();
		for (var t=0; t<list.length; t++) {
			var title=(links||refs)?list[t].title:list[t][0];
			if (links)	var count=this.getLinks(list[t]).length;
			else if (refs)	var count=store.getReferringTiddlers(title).length;
			else 		var count=list[t][1];
			if ((!inc.length||inc.contains(title))&&(!ex.length||!ex.contains(title)))
				items.push({ title:title, count:count });
		}
		if(!items.length) return;
		// sort by decending count, limit results (optional)
		items=items.sort(function(a,b){return(a.count==b.count)?0:(a.count>b.count?-1:1);});
		while (limit && items.length>limit) items.pop();
		// find min/max and group size
		var most=items[0].count;
		var least=items[items.length-1].count;
		var groupSize=(most-least+1)/this.groups;
		// sort by title and draw the cloud of items
		items=items.sort(function(a,b){return(a.title==b.title)?0:(a.title>b.title?1:-1);});
		var cloudWrapper = createTiddlyElement(place,'div',null,'tagCloud',null);
		for (var t=0; t<items.length; t++) {
			cloudWrapper.appendChild(document.createTextNode(' '));
			var group=Math.ceil((items[t].count-least)/groupSize)||1;
			var className='tagCloudtag tagCloud'+group;
			var tip=refs?this.refstip:links?this.linkstip:this.tagstip;
			tip=tip.format([items[t].title,items[t].count]);
			if (action=='goto') { // TAG/LINK/REFERENCES GOTO
				var btn=createTiddlyLink(cloudWrapper,items[t].title,true,className);
				btn.title=tip;
				btn.style.fontWeight='normal';
			} else if (!links&&!refs) { // TAG POPUP
				var btn=createTiddlyButton(cloudWrapper,items[t].title,tip,onClickTag,className);
				btn.setAttribute('tag',items[t].title);
			} else { // LINK/REFERENCES POPUP
				var btn=createTiddlyButton(cloudWrapper,items[t].title,tip,
					function(ev) { var e=ev||window.event; var cmt=config.macros.cloud;
						var popup = Popup.create(this);
						var title = this.getAttribute('tiddler');
						var count = this.getAttribute('count');
						var refs  = this.getAttribute('refs')=='T';
						var links = this.getAttribute('links')=='T';
						var label = (refs?cmt.refslabel:cmt.linkslabel).format([count]);
						createTiddlyLink(popup,title,true);
						createTiddlyText(popup,label);
						createTiddlyElement(popup,'hr');
						if (refs) {
							popup.setAttribute('tiddler',title);
							config.commands.references.handlePopup(popup,title);
						}
						if (links) {
							var tiddler = store.fetchTiddler(title);
							var links=config.macros.cloud.getLinks(tiddler);
							for(var i=0;i<links.length;i++)
								createTiddlyLink(createTiddlyElement(popup,'li'),
									links[i],true);
						}
						Popup.show();
						e.cancelBubble=true; if(e.stopPropagation) e.stopPropagation();
						return false;
					}, className);
				btn.setAttribute('tiddler',items[t].title);
				btn.setAttribute('count',items[t].count);
				btn.setAttribute('refs',refs?'T':'F');
				btn.setAttribute('links',links?'T':'F');
				btn.title=tip;
			}
		}
	}
};
//}}}
/***
|Name|TaggedTemplateTweak|
|Source|http://www.TiddlyTools.com/#TaggedTemplateTweak|
|Documentation|http://www.TiddlyTools.com/#TaggedTemplateTweakInfo|
|Version|1.6.1|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|use alternative ViewTemplate/EditTemplate for specific tiddlers|
This plugin extends the core function, story.chooseTemplateForTiddler(), so that any given tiddler can be viewed and/or edited using alternatives to the standard tiddler templates.
!!!!!Documentation
>see [[TaggedTemplateTweakInfo]]
!!!!!Revisions
<<<
2009.09.02 [1.6.1] apply field-based template (if any) *before* tag-based template
| please see [[TaggedTemplateTweakInfo]] for previous revision details |
2007.06.11 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.TaggedTemplateTweak= {major: 1, minor: 6, revision: 1, date: new Date(2009,9,2)};

if (!config.options.txtTemplateTweakFieldname)	
	config.options.txtTemplateTweakFieldname='template';

Story.prototype.taggedTemplate_chooseTemplateForTiddler = Story.prototype.chooseTemplateForTiddler
Story.prototype.chooseTemplateForTiddler = function(title,template)
{
	// get core template and split into theme and template name
	var coreTemplate=this.taggedTemplate_chooseTemplateForTiddler.apply(this,arguments);
	var theme=""; var template=coreTemplate;
	var parts=template.split(config.textPrimitives.sectionSeparator);
	if (parts[1]) { theme=parts[0]; template=parts[1]; }
	else theme=config.options.txtTheme||""; // if theme is not specified
	theme+=config.textPrimitives.sectionSeparator;

	// look for template using title as prefix
	if (!store.getTaggedTiddlers(title).length) { // if tiddler is not a tag
		if (store.getTiddlerText(theme+title+template))
			{ return theme+title+template; } // theme##TitleTemplate
		if (store.getTiddlerText(title+template))
			{ return title+template; }	 // TitleTemplate
	}

	// look for templates using custom field value as prefix
	var v=store.getValue(title,config.options.txtTemplateTweakFieldname);
	if (store.getTiddlerText(theme+v+template))
		{ return theme+v+template; }	// theme##valueTemplate
	if (store.getTiddlerText(v+template))
		{ return v+template; }		// valueTemplate

	// look for template using tags as prefix
	var tiddler=store.getTiddler(title);
	if (!tiddler) return coreTemplate; // tiddler doesn't exist... use core result
	for (i=0; i<tiddler.tags.length; i++) {
		var t=tiddler.tags[i]+template; // add tag prefix to template
		var c=t.substr(0,1).toUpperCase()+t.substr(1); // capitalized for WikiWord title
		if (store.getTiddlerText(theme+t))	{ return theme+t; } // theme##tagTemplate
		if (store.getTiddlerText(theme+c))	{ return theme+c; } // theme##TagTemplate
		if (store.getTiddlerText(t)) 		{ return t; }	    // tagTemplate
		if (store.getTiddlerText(c))		{ return c; }	    // TagTemplate
	}
	
	// no match... use core result
	return coreTemplate;
}
//}}}
I am tagged differently
/***
|Name:|TagglyTaggingPlugin|
|Description:|tagglyTagging macro is a replacement for the builtin tagging macro in your ViewTemplate|
|Version:|3.1 ($Rev: 4092 $)|
|Date:|$Date: 2008-03-24 12:32:33 +1000 (Mon, 24 Mar 2008) $|
|Source:|http://mptw.tiddlyspot.com/#TagglyTaggingPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License:|http://mptw.tiddlyspot.com/#TheBSDLicense|
!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",
			numCols:    "cols\u00b1", // plus minus sign
			label:      "Tagged as '%0':",
			excerpts:   "excerpts",
			descr:      "descr",
			slices:     "slices",
			contents:   "contents",
			sliders:    "sliders",
			noexcerpts: "title only"
		},

		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",
			commas:   "Click to show a comma separated list",
			numCols:  "Click to change number of columns",
			excerpts: "Click to show excerpts",
			descr:    "Click to show the description slice",
			slices:    "Click to show all slices",
			contents: "Click to show entire tiddler contents",
			sliders:  "Click to show tiddler contents in sliders",
			noexcerpts: "Click to show entire title only"
		}
	},

	config: {
		showTaggingCounts: true,
		listOpts: {
			// the first one will be the default
			sortBy:     ["title","modified","created"],
			sortOrder:  ["asc","desc"],
			hideState:  ["show","hide"],
			listMode:   ["normal","group","commas"],
			numCols:    ["1","2","3","4","5","6"],
			excerpts:   ["noexcerpts","excerpts","descr","slices","contents","sliders"]
		},
		valuePrefix: "taggly.",
		excludeTags: ["excludeLists","excludeTagging"],
		excerptSize: 50,
		excerptMarker: "/%"+"%/"
	},

	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(),"");
		// 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 "";
	},

	getExcerpt: function(inTiddlerTitle,title,indent) {
		if (!indent)
			indent = 1;

		var displayMode = this.getTagglyOpt(inTiddlerTitle,"excerpts");
		var t = store.getTiddler(title);

		if (t && displayMode == "excerpts") {
			var text = t.text.replace(/\n/," ");
			var marker = text.indexOf(this.config.excerptMarker);
			if (marker != -1) {
				return " {{excerpt{<nowiki>" + text.substr(0,marker) + "</nowiki>}}}";
			}
			else if (text.length < this.config.excerptSize) {
				return " {{excerpt{<nowiki>" + t.text + "</nowiki>}}}";
			}
			else {
				return " {{excerpt{<nowiki>" + t.text.substr(0,this.config.excerptSize) + "..." + "</nowiki>}}}";
			}
		}
		else if (t && displayMode == "contents") {
			return "\n{{contents indent"+indent+"{\n" + t.text + "\n}}}";
		}
		else if (t && displayMode == "sliders") {
			return "<slider slide>\n{{contents{\n" + t.text + "\n}}}\n</slider>";
		}
		else if (t && displayMode == "descr") {
			var descr = store.getTiddlerSlice(title,'Description');
			return descr ? " {{excerpt{" + descr  + "}}}" : "";
		}
		else if (t && displayMode == "slices") {
			var result = "";
			var slices = store.calcAllSlices(title);
			for (var s in slices)
				result += "|%0|<nowiki>%1</nowiki>|\n".format([s,slices[s]]);
			return result ? "\n{{excerpt excerptIndent{\n" + result  + "}}}" : "";
		}
		return "";
	},

	notHidden: function(t,inTiddler) {
		if (typeof t == "string") 
			t = store.getTiddler(t);
		return (!t || !t.tags.containsAny(this.config.excludeTags) ||
				(inTiddler && this.config.excludeTags.contains(inTiddler)));
	},

	// 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 = [];
		var first = true;
		for (var i=0;i<list.length;i++) {
			if (this.notHidden(list[i],title)) {
				var countString = this.getTaggingCount(list[i].title);
				var excerpt = this.getExcerpt(title,list[i].title);
				if (useCommas)
					output.push((first ? "" : ", ") + "[[" + list[i].title + "]]" + countString + excerpt);
				else
					output.push("*[[" + list[i].title + "]]" + countString + excerpt + "\n");

				first = false;
			}
		}

		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 (this.notHidden(list[i].tags[j],title)) {

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

						if (this.notHidden(list[i],title)) {
							allTagsHolder[list[i].tags[j]] += "**[["+list[i].title+"]]"
										+ this.getTaggingCount(list[i].title) + this.getExcerpt(title,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++)
			if (this.notHidden(leftOvers[i],title))
				leftOverOutput += "*[["+leftOvers[i]+"]]" + this.getTaggingCount(leftOvers[i]) + this.getExcerpt(title,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++)
			if (allTagsHolder[allTags[i]] != "")
				output.push("*[["+allTags[i]+"]]" + this.getTaggingCount(allTags[i]) + this.getExcerpt(title,allTags[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)
				if (this.notHidden(list[i].title,this.config.inTiddler))
					childOutput += this.treeTraverse(list[i].title,depth+1,sortBy,sortOrder);

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

	// this if for the site map mode
	createTagglyListSiteMap: function(place,title) {
		this.config.inTiddler = title; // nasty. should pass it in to traverse probably
		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);
				if (params[0])
					refreshContainer.setAttribute("title",params[0]);
				else {
        			refreshContainer.setAttribute("title",tiddler.title);
				}
				this.refresh(refreshContainer);
			},

			refresh: function(place) {
				var title = place.getAttribute("title");
				removeChildren(place);
				addClass(place,"tagglyTagging");
				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,"excerpts");
						config.taggly.createListControl(place,title,"numCols");
						config.taggly.createTagglyList(place,title);
					}
				}
			}
		}
	},

	// todo fix these up a bit
	styles: [
"/*{{{*/",
"/* created by TagglyTaggingPlugin */",
".tagglyTagging { padding-top:0.5em; }",
".tagglyTagging li.listTitle { display:none; }",
".tagglyTagging ul {",
"	margin-top:0px; padding-top:0.5em; padding-left:2em;",
"	margin-bottom:0px; padding-bottom:0px;",
"}",
".tagglyTagging { vertical-align: top; margin:0px; padding:0px; }",
".tagglyTagging table { margin:0px; padding:0px; }",
".tagglyTagging .button { visibility:hidden; margin-left:3px; margin-right:3px; }",
".tagglyTagging .button, .tagglyTagging .hidebutton {",
"	color:[[ColorPalette::TertiaryLight]]; font-size:90%;",
"	border:0px; padding-left:0.3em;padding-right:0.3em;",
"}",
".tagglyTagging .button:hover, .hidebutton:hover, ",
".tagglyTagging .button:active, .hidebutton:active  {",
"	border:0px; background:[[ColorPalette::TertiaryPale]]; color:[[ColorPalette::TertiaryDark]];",
"}",
".selected .tagglyTagging .button { visibility:visible; }",
".tagglyTagging .hidebutton { color:[[ColorPalette::Background]]; }",
".selected .tagglyTagging .hidebutton { color:[[ColorPalette::TertiaryLight]] }",
".tagglyLabel { color:[[ColorPalette::TertiaryMid]]; font-size:90%; }",
".tagglyTagging ul {padding-top:0px; padding-bottom:0.5em; margin-left:1em; }",
".tagglyTagging ul ul {list-style-type:disc; margin-left:-1em;}",
".tagglyTagging ul ul li {margin-left:0.5em; }",
".editLabel { font-size:90%; padding-top:0.5em; }",
".tagglyTagging .commas { padding-left:1.8em; }",
"/* not technically tagglytagging but will put them here anyway */",
".tagglyTagged li.listTitle { display:none; }",
".tagglyTagged li { display: inline; font-size:90%; }",
".tagglyTagged ul { margin:0px; padding:0px; }",
".excerpt { color:[[ColorPalette::TertiaryDark]]; }",
".excerptIndent { margin-left:4em; }",
"div.tagglyTagging table,",
"div.tagglyTagging table tr,",
"td.tagglyTagging",
" {border-style:none!important; }",
".tagglyTagging .contents { border-bottom:2px solid [[ColorPalette::TertiaryPale]]; padding:0 1em 1em 0.5em;",
"  margin-bottom:0.5em; }",
".tagglyTagging .indent1  { margin-left:3em;  }",
".tagglyTagging .indent2  { margin-left:4em;  }",
".tagglyTagging .indent3  { margin-left:5em;  }",
".tagglyTagging .indent4  { margin-left:6em;  }",
".tagglyTagging .indent5  { margin-left:7em;  }",
".tagglyTagging .indent6  { margin-left:8em;  }",
".tagglyTagging .indent7  { margin-left:9em;  }",
".tagglyTagging .indent8  { margin-left:10em; }",
".tagglyTagging .indent9  { margin-left:11em; }",
".tagglyTagging .indent10 { margin-left:12em; }",
"/*}}}*/",
		""].join("\n"),

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

config.taggly.init();

//}}}

/***
InlineSlidersPlugin
By Saq Imtiaz
http://tw.lewcid.org/sandbox/#InlineSlidersPlugin

// syntax adjusted to not clash with NestedSlidersPlugin
// added + syntax to start open instead of closed

***/
//{{{
config.formatters.unshift( {
	name: "inlinesliders",
	// match: "\\+\\+\\+\\+|\\<slider",
	match: "\\<slider",
	// lookaheadRegExp: /(?:\+\+\+\+|<slider) (.*?)(?:>?)\n((?:.|\n)*?)\n(?:====|<\/slider>)/mg,
	lookaheadRegExp: /(?:<slider)(\+?) (.*?)(?:>)\n((?:.|\n)*?)\n(?:<\/slider>)/mg,
	handler: function(w) {
		this.lookaheadRegExp.lastIndex = w.matchStart;
		var lookaheadMatch = this.lookaheadRegExp.exec(w.source)
		if(lookaheadMatch && lookaheadMatch.index == w.matchStart ) {
			var btn = createTiddlyButton(w.output,lookaheadMatch[2] + " "+"\u00BB",lookaheadMatch[2],this.onClickSlider,"button sliderButton");
			var panel = createTiddlyElement(w.output,"div",null,"sliderPanel");
			panel.style.display = (lookaheadMatch[1] == '+' ? "block" : "none");
			wikify(lookaheadMatch[3],panel);
			w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
		}
   },
   onClickSlider : function(e) {
		if(!e) var e = window.event;
		var n = this.nextSibling;
		n.style.display = (n.style.display=="none") ? "block" : "none";
		return false;
	}
});

//}}}
/***
|''Name:''|TemplateFormatterPlugin|
|''Author:''|Martin Budden ( mjbudden [at] gmail [dot] com)|
|''Description:''|Plug to demonstrate template formatter|
|''CodeRepository:''|http://svn.tiddlywiki.org/Trunk/contributors/MartinBudden/experimental/TemplateFormatterPlugin.js |
|''Version:''|0.0.3|
|''Date:''|Mar 19, 2008|
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev |
|''License:''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]] |
|''~CoreVersion:''|2.3.0|

!!Description
Provides a formatter that can be used to expand templates

!!Usage
Then include this plugin and tag it systemConfig in the normal way. Templates can include:
{{{
<!--<<macroname macroparameters>>--> : macro that is expanded into the template
<!--comment--> : comment that is included in the output
<!--@@comment@@-->> : comment that is not included in the output (can be used to document the template itself)
}}}

***/

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

config.templateFormatters = [
{
	name: 'templateElement',
	match: '<!--(?:<<|@@)',
	lookaheadRegExp: /<!--<<([^>\s]+)(?:\s*)((?:[^>]|(?:>(?!>)))*)>>-->|<!--@@([^@]*)@@-->/mg,
	handler: function(w)
	{
		this.lookaheadRegExp.lastIndex = w.matchStart;
		var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
		if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
			w.nextMatch = this.lookaheadRegExp.lastIndex;
			if(lookaheadMatch[1]) {
				invokeMacro(w.output,lookaheadMatch[1],lookaheadMatch[2],w,w.tiddler);
			}
		}
	}
}
];

config.parsers.templateFormatter = new Formatter(config.templateFormatters);
config.parsers.templateFormatter.format = 'template';
config.parsers.templateFormatter.formatTag = 'TemplateFormat';
} //# end of 'install only once'
//}}}
/***
|''Name:''|TemplatePlugin |
|''Description:''|Collection of functions to support rendering of tiddlers through HTML templates |
|''Author:''|JonathanLister |
|''CodeRepository:''|http://svn.tiddlywiki.org/Trunk/contributors/JonathanLister/plugins/TemplatePlugin.js |
|''Version:''|0.0.4 |
|''Date:''|25/3/08 |
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev |
|''License:''|[[BSD License|http://www.opensource.org/licenses/bsd-license.php]] |
|''~CoreVersion:''|2.3|

The templateTiddlers macro finds a set of tiddlers and renders them once each through a template. The template can contain additional
calls to the macro to allow for e.g. looping inside a template (think RSS items). It needs to be able to support recursion, so that sub-templates make sense.

Usage:
{{{
<<templateTiddlers template:RssTemplate filter:"[tag[!excludeLists]]" [wikitext:true]>>
<<templateTiddlers RssTemplate filter:"[tag[!excludeLists]]">> // template qualification is optional
}}}

Parameters can be:
template - the name of the template
filter - a tiddler filter
wikitext - if true, renders the target tiddler's text as wikitext instead of using the special template formatter

If a parameter does not have a qualifier, it is assumed to be the template name

|''Name:''|templateTagsMacro |
|''Description:''|Renders a tiddler's tags through a template |

Usage:
{{{
<<templateTags template:RssItemCategoryTemplate>>
<<templateTiddlers RssTemplate>> // template qualification is optional
}}}

The templateTags macro renders a tiddler's tags through a template in an analagous way to how templateTiddlers renders a set of tiddlers. Future development might offer support for other data items other than tags, but this is what is needed for RSS, the use-case driving the development.

|''Name:''|PermalinkMacro |
|''Description:''|Creates a permalink to the tiddler |

Usage:
{{{
<<permalink>>
}}}
***/

//{{{
if(!version.extensions.templatePlugin) {
version.extensions.templatePlugin = {installed:true};

expandTemplate = function(template,tiddlers,wikitext)
{
	var defaultTemplate = "<<view text>>";
	var t = template;
	template = template ? store.getTiddlerText(template,template) : defaultTemplate;
	if(!tiddlers) {
		// no tiddlers provided, so create a temporary tiddler
		tiddlers = [];
		tiddlers.push(new Tiddler("temp"));
	}
	var output = "";
	// decide whether to parse as wikitext or simple template
	var format = wikitext ? null : 'template';
	for(var i=0; i<tiddlers.length; i++) {
		output += wikifyStatic(template,null,tiddlers[i],format).htmlDecode();
		// wikifyStatic returns html; htmlDecode is used so that nesting of templates doesn't cause encoded characters to be wikified
	}
	return output;
};

config.macros.templateTiddlers = {};
config.macros.templateTiddlers.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
	p = paramString.parseParams("anon",null,true,false,false);
	var template = getParam(p,"template",null);
	if(!template)
		template = getParam(p,"anon",null);
	var filter = getParam(p,"filter",null);
	var wikitext = getParam(p,"wikitext",null);
	var tiddlers = [];
	if(filter) {
		tiddlers = store.filterTiddlers(filter);
	} else {
		// no filter provided, so inherit or create temp tiddler
		tiddlers.push(tiddler ? tiddler : new Tiddler("temp"));
	}
	var output = expandTemplate(template,tiddlers,wikitext);
	// NOTE: the line below is contentious - should the .htmlEncode() be used?
	// if you don't use it, it seems that output is not always added in a format suitable for innerHTML
	// this is only an apparent problem when templateTiddlers is nested inside other templates (at two levels deep!)
	// this requires tests writing to iron this out once and for all
	// ALSO: HTMLPreviewTemplate uses the output of expandTemplate directly, but hasn't hit this problem yet (possibly because the nesting only goes one level deep on templates tested so far)
	//place.innerHTML += output;
	var newcontent = document.createElement('div');
	newcontent.innerHTML = output;
	while (newcontent.firstChild) {
        	place.appendChild(newcontent.firstChild);
	}
};

config.macros.templateTags = {};
config.macros.templateTags.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
	p = paramString.parseParams("anon",null,true,false,false);
	var template = getParam(p,"template",null);
	var tiddlers = [];
	if(!template)
		template = getParam(p,"anon",null);
	for(var i=0;i<tiddler.tags.length;i++) {
		var t = new Tiddler(tiddler.title);
		t.tags = [tiddler.tags[i]];
		tiddlers.push(t);
	}
	var output = expandTemplate(template,tiddlers);
	place.innerHTML += output;
};

config.macros.permalink = {};
config.macros.permalink.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
	var t = encodeURIComponent(String.encodeTiddlyLink(tiddler.title));
	createTiddlyText(place,window.location+"#"+t);
};

config.macros.view.views.slice = function(value,place,params,wikifier,paramString,tiddler) {
	var slice = "";
	if(params && params[2]) {
		slice = store.getTiddlerSlice(tiddler.title,params[2]);
		if(slice) {
			createTiddlyText(place,slice);
		}
	}
};

config.macros.view.views.section = function(value,place,params,wikifier,paramString,tiddler) {
	var section = "";
	if(params && params[2]) {
		section = store.getTiddlerText(tiddler.title+"##"+params[2]);
		if(section) {
			createTiddlyText(place,section);
		}
	}
};

} //# end of 'install only once'
//}}}
<<ambitTags>>
<<ambitTagging>>
/***
|''Name''|TiddlyFileImporter|
|''Version''|0.3.8|
|''Author''|Ben Gillies|
|''Type''|plugin|
|''Description''|Upload a TiddlyWiki file to TiddlyWeb, and import the tiddlers.|
!Usage
Upload a TiddlyWiki file to TiddlyWeb, and import the tiddlers.
!Requires
tiddlyweb
tiddlywebplugins.reflector
!Code
***/
//{{{
(function($){
if(!version.extensions.TiddlyFileImporter)
{ //# ensure that the plugin is only installed once
	version.extensions.TiddlyFileImporter = { installed: true };
}

config.macros.fileImport = {
	reflectorURI: '/reflector?csrf_token=%0',
	incorrectTypeError: 'Incorrect File Type. You must upload a TiddlyWiki',
	uploadLabel: 'Upload',
	uploadLabelPrompt: 'Import tiddlers from this TiddlyWiki',
	step1FileText: 'File:',
	step1PostText: 'In the next screen you will select the tiddlers to import.',
	step1Title: 'Step 1: Pick a TiddlyWiki to import',
	step1TypeChooser: 'Import From:',
	step3Html: ['<input type="hidden" name="markList" />',
		'<input type="hidden" checked="true" name="chkSync" />',
		'<input type="hidden" name="chkSave" />',
		'<input type="hidden" name="txtSaveTiddler" />'].join(),

	handler: function(place, macroName, params, wikifier, paramString) {
		var wizard = new Wizard();
		wizard.createWizard(place, 'Import a TiddlyWiki');
		this.restart(wizard);
	},

	restart: function(wizard) {
		var me = config.macros.fileImport;
		wizard.addStep(me.step1Title, ['<input type="hidden" ',
			'name="markList" />'].join(""));
		var markList = wizard.getElement('markList');
		var uploadWrapper = document.createElement('div');
		markList.parentNode.insertBefore(uploadWrapper, markList);
		uploadWrapper.setAttribute('refresh', 'macro');
		uploadWrapper.getAttribute('macroName', 'fileImport');
		var iframeName = 'reflectorImporter' + Math.random().toString();
		me.createForm(uploadWrapper, wizard, iframeName);
		$(uploadWrapper).append('<p>' + me.step1PostText + '</p>');
		wizard.setValue('serverType', 'tiddlyweb');
		wizard.setValue('adaptor', new config.adaptors.file());
		wizard.setValue('host', config.defaultCustomFields['server.host']);
		wizard.setValue('context', {});
		var iframe = $(['<iframe name="' + iframeName + '" ',
			'style="display: none" />'].join("")).appendTo(uploadWrapper);
		var onSubmit = function(ev) {
			var uploadType = $('select[name=uploadtype]', wizard.formElem).val();
			if (uploadType == "file") {
				// set an onload ready to hijack the form
				me.setOnLoad(uploadWrapper, wizard, iframe[0]);
				wizard.importType = 'file';
				wizard.formElem.submit();
			} else {
				var csrf_token = config.extensions.tiddlyspace.getCSRFToken();
				$.ajax({
					url: "%0/reflector?csrf_token=%1".format(
						config.defaultCustomFields["server.host"], csrf_token),
					type: "POST",
					dataType: "text",
					data: {
						uri: $("input", ".importFrom", wizard.formElem).val()
					},
					success: function(data, txtStatus, xhr) {
						wizard.POSTResponse = data;
						me.importTiddlers(uploadWrapper, wizard);
					},
					error: function(xhr, txtStatus, error) {
						displayMessage(["There was an error fetching the ",
							'url: ', txtStatus].join(""));
						me.restart(wizard);
					}
				});
				return false;
			}
		};
		wizard.setButtons([{
			caption: me.uploadLabel,
			tooltip: me.uploadLabelPrompt,
			onClick: onSubmit
		}]);
		$(wizard.formElem).submit(function(ev) {
			onSubmit(ev);
			ev.preventDefault();
		});
	},

	createForm: function(place, wizard, iframeName) {
		var form = wizard.formElem;
		var me = config.macros.fileImport;
		form.action = me.reflectorURI.format(
			config.extensions.tiddlyspace.getCSRFToken());
		form.enctype = 'multipart/form-data';
		form.encoding = 'multipart/form-data';
		form.method = 'POST';
		form.target = iframeName;
		onSelectChange = function(e) {
			var changeTo = $(this).val();
			if (changeTo == "file") {
				$(".importFrom").html('%0 <input type="file" name="file" />'.
					format(me.step1FileText));
			} else {
				$(".importFrom").html('URL: <input type="text" name="uri" />'
					+ ' Do you want <a target="_blank" href="http://faq.tiddlyspace.com/How%20do%20I%20include%2Fexclude%20spaces%3F">inclusion</a> instead?');
			}
		};
		$(place).append('<span>%0</span>'.format(me.step1TypeChooser)).
			append($(['<select name="uploadtype"><option value="file" selected="selected">file',
				'<option value="uri">url</select>'].join("")).change(onSelectChange)).
			append('<div class="importFrom">%0<input type="file" name="file" /></div>'.
					format(me.step1FileText));
	},

	setOnLoad: function(place, wizard, iframe) {
		var me = config.macros.fileImport;
		var loadHandler = function() {
			me.importTiddlers.apply(this, [place, wizard, iframe]);
		};
		iframe.onload = loadHandler;
		completeReadyStateChanges = 0;
		iframe.onreadystatechange = function() {
			if (++(completeReadyStateChanges) == 5) {
				loadHandler();
			}
		};
	},

	importTiddlers: function(place, wizard, iframe) {
		var tmpStore = new TiddlyWiki();
		var POSTedWiki = "";
		if (wizard.importType == "file") {
			try {
				POSTedWiki= iframe.contentWindow
					.document.documentElement.innerHTML;
			} catch(e) {
				displayMessage(config.macros.fileImport.incorrectTypeError);
				config.macros.fileImport.restart(wizard);
				return;
			}
			// now we are done, so remove the iframe
			$(iframe).remove();
		} else {
			POSTedWiki = wizard.POSTResponse;
		}

		tmpStore.importTiddlyWiki(POSTedWiki);
		var newTiddlers = tmpStore.getTiddlers();
		var workspace = config.defaultCustomFields['server.workspace'];
		var context = {
			status: true,
			statusText: 'OK',
			httpStatus: 200,
			adaptor: wizard.getValue('adaptor'),
			tiddlers: newTiddlers
		};
		context.adaptor.store = tmpStore;
		wizard.setValue('context', context);
		wizard.setValue('workspace', workspace);
		wizard.setValue('inFileImport', true);
		config.macros.importTiddlers.onGetTiddlerList(context, wizard);
	}
};

var _onGetTiddler = config.macros.importTiddlers.onGetTiddler;
config.macros.importTiddlers.onGetTiddler = function(context, wizard) {
	if (wizard.getValue('inFileImport')) {
		var me = config.macros.importTiddlers;
		if(!context.status)
			displayMessage("Error in importTiddlers.onGetTiddler: " + context.statusText);
		var tiddler = context.tiddler;
		var fields = tiddler.fields;
		merge(fields, config.defaultCustomFields);
		fields["server.workspace"] = wizard.getValue('workspace');
		delete fields['server.permissions'];
		delete fields['server.bag'];
		fields['server.page.revision'] = 'false';
		delete fields['server.recipe'];
		fields.changecount = 1;
		store.suspendNotifications();
		store.saveTiddler(tiddler.title, tiddler.title, tiddler.text,
			tiddler.modifier, tiddler.modified, tiddler.tags, tiddler.fields,
			false, tiddler.created);
		store.resumeNotifications();
		var remainingImports = wizard.getValue("remainingImports")-1;
		wizard.setValue("remainingImports",remainingImports);
		if(remainingImports === 0) {
			if(context.isSynchronous) {
				store.notifyAll();
				refreshDisplay();
			}
			wizard.setButtons([
					{caption: me.doneLabel, tooltip: me.donePrompt, onClick: me.onClose}
				],me.statusDoneImport);
			autoSaveChanges();
		}
	} else {
		_onGetTiddler.apply(this, arguments);
	}
};

var _onCancel = config.macros.importTiddlers.onCancel;
config.macros.importTiddlers.onCancel = function(e)
{
	var wizard = new Wizard(this);
	if (!wizard.getValue('inFileImport')) {
		return _onCancel.apply(this, arguments);
	}
	var place = wizard.clear();
	config.macros.fileImport.restart(wizard);
	return false;
};

var _step3Html = config.macros.importTiddlers.step3Html;
var _onGetTiddlerList = config.macros.importTiddlers.onGetTiddlerList;
config.macros.importTiddlers.onGetTiddlerList = function(context, wizard) {
	var fileImport = config.macros.fileImport;
	var importTiddlers = config.macros.importTiddlers;
	if (wizard.getValue('inFileImport')) {
		importTiddlers.step3Html = fileImport.step3Html;
	} else {
		importTiddlers.step3Html = _step3Html;
	}
	_onGetTiddlerList.apply(this, arguments);
};
})(jQuery);
//}}}
/***
|''Name''|TiddlySpaceBackstage|
|''Version''|0.8.0|
|''Description''|Provides a TiddlySpace version of the backstage and a homeLink macro|
|''Status''|@@beta@@|
|''Contributors''|Jon Lister, Jon Robson, Colm Britton|
|''Source''|http://github.com/TiddlySpace/tiddlyspace/raw/master/src/plugins/TiddlySpaceBackstage.js|
|''Requires''|TiddlySpaceConfig ImageMacroPlugin TiddlySpaceViewTypes|
!StyleSheet
.tiddler .error.annotation .button{
	display: inline-block;
}

#backstageArea {
	z-index: 49;
	color: white;
	background-color: black;
	background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #222),color-stop(0.5, #333),color-stop(1, #555));
	background: -moz-linear-gradient(center bottom,#222 0%, #333 50%, #555 100%);
	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ff555555, endColorstr=#ff222222);
	-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#ff555555, endColorstr=#ff222222)";
	height: 25px;
	padding: 0;
}

#backstageButton {
	overflow: hidden;
}

#backstageButton #backstageShow,
#backstageButton #backstageHide {
	margin: 0px;
	padding: 0px;
}

#backstageButton #backstageShow:hover,
#backstageButton #backstageHide:hover {
	background: none;
	color: none;
}

#backstageButton img,
#backstageButton svg {
	width: 24px;
	height: 24px;
}

#messageArea {
	top: 50px;
}

#backstageToolbar {
	position: relative;
}

#backstageArea a {
	padding: 0px;
	margin-left: 0px;
	color: white;
	background: none;
}

#backstageArea a:hover {
	background-color: white;
}

#backstage ol,
#backstage ul {
	padding: auto;
}

#backstageButton a {
	margin: 0;
}

.backstagePanelBody ul {
	padding: 5px;
	margin: 5px;
}

#backstage #backstagePanel {
	margin-left: 5%;
	padding: 0em;
	margin-right: 5%;
}

#backstageToolbar a {
	position: relative;
}

#backstageArea a.backstageSelTab,
#backstageToolbar .backstageTask {
	line-height: 25px;
	color: #767676;
}

.backstageTask .externalImage,
.backstageTask .image {
	display: inline;
}

#backstageToolbar a span {
	z-index: 2;
}

a.backstageTask {
	display: inline;
        margin-left: 1em !important;
}

.backstagePanelBody .button {
	display: inline-block;
	margin-right: 10px;
}

.backstagePanelBody {
	margin: 0 0 0 0.6em;
	padding: 0.4em 0.5em 1px 0.5em;
}

#backstage table {
	margin: auto;
}

#backstage .wizard table {
	border: 0px;
	margin: 0;
}

#backstage div  li.listLink {
	border: 0px;
	width: 78%;
	font-size: 0.7em;
}

#backstage div li.listTitle {
	font-weight: bold;
	text-decoration: underline;
	font-size: 1em;
	background: #ccc;
	width: 100%;
}

#backstage fieldset {
	border: solid 1px [[ColorPalette::Background]];
}

#backstage .viewer table,#backstage table.twtable {
	border: 0px;
}

#backstageToolbar img {
	padding: 0;
}

#backstage .wizard,
#backstage .wizardFooter {
	background: none;
}

.viewer td, .viewer tr, .twtable td, .twtable tr {
	border: 1px solid #eee;
}

#backstage .inlineList ul li {
	background-color: [[ColorPalette::Background]];
	border: solid 1px [[ColorPalette::TertiaryMid]];
	display: block;
	float: left;
	list-style: none;
	margin-right: 1em;
	padding: 0.5em;
}

.backstageClear, .inlineList form {
	clear: both;
	display: block;
	margin-top: 3em;
}

.tiddlyspaceMenu {
	text-align: center;
}

span.chunkyButton {
	display: inline-block;
	padding: 0;
	margin: 0;
	border: solid 2px #000;
	background-color: #04b;
}

span.chunkyButton a.button, span.chunkyButton a:active.button {
	white-space: nowrap;
	font-weight: bold;
	font-size: 1.8em;
	color: #fff;
	text-align: center;
	padding: 0.5em 0.5em;
	margin: 0;
	border-style: none;
	display: block;
}

span.chunkyButton:hover {
	background-color: #014;
}

span.chunkyButton a.button:hover {
	border-style: none;
	background: none;
	color: #fff;
}

#backstage .unpluggedSpaceTab .wizard,
.unpluggedSpaceTab .wizard {
	background: white;
	border: 2px solid #CCC;
	padding: 5px;
}

.syncKey .keyItem {
	border: 1px solid black;
	display: inline-block;
	margin: 0.2em;
	padding: 0.1em 0.1em 0.1em 0.1em;
}

.keyHeading {
	font-size: 2em;
	font-weight: bold;
	margin: 0.4em 0em -0.2em;
}

.unpluggedSpaceTab .putToServer,
.unpluggedSpaceTab .notChanged {
	display: none;
}

.tiddlyspaceMenu ul {
	margin: 0;
	padding: 0;
}

.tiddlyspaceMenu ul li {
	list-style: none;
}

.unsyncedChanges .unsyncedList {
	display: block;
}

.unsyncedList {
	display: none;
}
!Code
***/
//{{{
(function ($) {
    var name = "StyleSheet" + tiddler.title;
    config.shadowTiddlers[name] = "/*{{{*/\n%0\n/*}}}*/".
        format(store.getTiddlerText(tiddler.title + "##StyleSheet")); // this accesses the StyleSheet section of the current tiddler (the plugin that contains it)
    store.addNotification(name, refreshStyles);

    if (!config.extensions.tiddlyweb.status.tiddlyspace_version) { // unplugged
        config.extensions.tiddlyweb.status.tiddlyspace_version = "<unknown>";
        config.extensions.tiddlyweb.status.server_host = {
            url:config.extensions.tiddlyweb.host }; // TiddlySpaceLinkPlugin expects this
    }
    var disabled_tasks_for_nonmembers = ["tiddlers", "plugins", "batch", "sync"];

    var tweb = config.extensions.tiddlyweb;
    var tiddlyspace = config.extensions.tiddlyspace;
    var currentSpace = tiddlyspace.currentSpace.name;
    var imageMacro = config.macros.image;

    if (config.options.chkBackstage === undefined) {
        config.options.chkBackstage = false;
    }

// Set up Backstage
    config.tasks = {};
    config.tasks.status = {
        text:"status",
        tooltip:"TiddlySpace Info",
        content:"<<tiddler Backstage##Menu>>"
    };
    config.tasks.tiddlers = {
        text:"tiddlers",
        tooltip:"tiddlers control panel",
        content:"<<tiddler Backstage##BackstageTiddlers>>"
    };
    config.tasks.plugins = {
        text:"plugins",
        tooltip:"Manage installed plugins",
        content:"<<tiddler Backstage##Plugins>>"
    };
    config.tasks.batch = {
        text:"batch",
        tooltip:"Batch manage public/private tiddlers",
        content:"<<tiddler Backstage##BatchOps>>"
    };
    config.tasks.tweaks = {
        text:"tweaks",
        tooltip:"Tweak TiddlyWiki behaviors",
        content:"<<tiddler Backstage##Tweaks>>"
    };
    config.tasks.exportTiddlers = {
        text:"import/export",
        tooltip:"Import/export tiddlers from/to a TiddlyWiki",
        content:"<<tiddler Backstage##ImportExport>>"
    };
    config.tasks.sync = {
        text:"sync",
        tooltip:"Check Sync status",
        content:"<<tiddler Backstage##SpaceUnplugged>>"
    };

    if (window.location.protocol === "file:") {
        config.unplugged = true;
    }

    config.backstageTasks = ["status", "tiddlers", "plugins",
        "batch", "tweaks", "exportTiddlers", "sync"];

    config.messages.backstage.prompt = "";
// initialize state
    var _show = backstage.show;
    backstage.show = function () {
        // selectively hide backstage tasks and tabs based on user status
        var tasks = $("#backstageToolbar .backstageTask").show();
        var bs = backstage.tiddlyspace;
        if (!config.unplugged) {
            tweb.getUserInfo(function (user) {
                if (user.anon) {
                    jQuery.each(disabled_tasks_for_nonmembers, function (i, task) {
                        var taskIndex = config.backstageTasks.indexOf(task);
                        if (taskIndex !== -1) {
                            config.backstageTasks.splice(taskIndex, 1);
                        }
                    });
                    config.messages.memberStatus = bs.locale.loggedout;
                } else {
                    config.messages.memberStatus = readOnly ?
                        bs.locale.nonmember : bs.locale.member;
                }
            });
        } else {
            config.messages.memberStatus = bs.locale.unplugged;
        }

        // display backstage
        return _show.apply(this, arguments);
    };
    if (readOnly) {
        jQuery.each(disabled_tasks_for_nonmembers, function (i, task) {
            var taskIndex = config.backstageTasks.indexOf(task);
            if (taskIndex !== -1) {
                config.backstageTasks.splice(taskIndex, 1);
            }
        });
    }

    var tasks = config.tasks;
    var commonUrl = "/bags/common/tiddlers/%0";

    backstage.tiddlyspace = {
        locale:{
            member:"You are a member of this space.",
            nonmember:"You are not a member of this space.",
            loggedout:"You are currently logged out of TiddlySpace.",
            unplugged:"You are unplugged."
        },
        showButton:function () {
            var showBtn = $("#backstageShow")[0];
            var altText = $(showBtn).text();
            $(showBtn).empty();
            imageMacro.renderImage(showBtn, "backstage.svg",
                { altImage:commonUrl.format("backstage.png"), alt:altText});
        },
        hideButton:function () {
            var hideBtn = $("#backstageHide")[0];
            var altText = $(hideBtn).text();
            $(hideBtn).empty();
            imageMacro.renderImage(hideBtn, "close.svg",
                { altImage:commonUrl.format("close.png"), alt:altText, width:24, height:24 });
        }
    };

    var _init = backstage.init;
    backstage.init = function () {
        _init.apply(this, arguments);
        var init = function (user) {
            var bs = backstage.tiddlyspace;
            bs.showButton();
            bs.hideButton();
        };
        tweb.getUserInfo(init);
    };

    var home = config.macros.homeLink = {
        locale:{
            linkText:"your home space"
        },
        handler:function (place) {
            var container = $("<span />").appendTo(place)[0];
            tweb.getUserInfo(function (user) {
                if (!user.anon && user.name !== currentSpace) {
                    createSpaceLink(container, user.name, null, home.locale.linkText);
                }
            });
        }
    };

    config.macros.exportSpace = {
        handler:function (place, macroName, params) {
            var filename = params[0] ||
                "/tiddlers.wiki?download=%0.html".format(currentSpace);
            $('<a class="button">download</a>').// XXX: i18n
                attr("href", filename).appendTo(place);
        }
    };

}(jQuery));
//}}}
(function() {
var getCSRFToken = function(window) {
	// XXX: should not use RegEx - cf.
	// http://www.quirksmode.org/js/cookies.html
	// https://github.com/TiddlySpace/tiddlyspace/commit/5f4adbe009ed4bda3ce39058a3fb07de1420358d
	var regex = /^(?:.*; )?csrf_token=([^(;|$)]*)(?:;|$)/;
	var match = regex.exec(document.cookie);
	var csrf_token = null;
	if (match && (match.length === 2)) {
		csrf_token = match[1];
	}

	return csrf_token;
};

if (typeof config !== 'undefined' && config.extensions &&
		config.extensions.tiddlyspace &&
		config.extensions.tiddlyspace.getCSRFToken === null) {
	config.extensions.tiddlyspace.getCSRFToken = getCSRFToken;
} else {
	window.getCSRFToken = getCSRFToken;
}
})(window);
/***
|''Name''|TiddlySpaceCloneCommand|
|''Version''|0.5.8|
|''Description''|provides a toolbar command for cloning external tiddlers|
|''Status''|stable|
|''Source''|http://github.com/TiddlySpace/tiddlyspace/raw/master/src/plugins/TiddlySpaceCloneCommand.js|
|''Requires''|TiddlySpaceConfig TiddlySpaceFilters|
!Code
***/
//{{{
(function($) {

var cmd = config.commands;
var tiddlyspace = config.extensions.tiddlyspace;

var fieldsCache = {};

cmd.cloneTiddler = {
	text: cmd.editTiddler.text,
	tooltip: "Create a copy of this tiddler in the current space",
	errorMsg: "Error publishing %0: %1",

	isEnabled: function(tiddler) {
		return !config.filterHelpers.is.local(tiddler) && !readOnly;
	},
	handler: function(ev, src, title) {
		var tiddler = store.getTiddler(title);
		if(tiddler) {
			fieldsCache[title] = $.extend({}, tiddler.fields);
			tiddler.fields["server.workspace"] = tiddlyspace.getCurrentWorkspace(config.options.chkPrivateMode ?
		"private" : "public");
			tiddler.fields["server.permissions"] = "read, write, create"; // no delete
			delete tiddler.fields["server.page.revision"];
			delete tiddler.fields["server.title"];
			delete tiddler.fields["server.etag"];
			// special handling for pseudo-shadow tiddlers
			if(tiddlyspace.coreBags.contains(tiddler.fields["server.bag"])) {
				tiddler.tags.remove("excludeLists");
			}
		} else { // ensure workspace is the current space
			var el = story.findContainingTiddler(src);
			el = $(el);
			var fields = el.attr("tiddlyfields");
			if(fields) { // inherited via TiddlyLink
				fields = fields.decodeHashMap();
				fields["server.workspace"] = config.
					defaultCustomFields["server.workspace"];
			} else {
				fields = config.defaultCustomFields;
			}
			fields = String.encodeHashMap(fields);
			el.attr("tiddlyfields", fields);
		}
		cmd.editTiddler.handler.apply(this, arguments);
		if(tiddler) {
			tiddler.fields["server.permissions"] += ", delete";
		}
		return false;
	}
};

cmd.editTiddler.isEnabled = function(tiddler) {
	return !cmd.cloneTiddler.isEnabled.apply(this, arguments);
};

// hijack cancelTiddler to restore original fields
var _cancelHandler = cmd.cancelTiddler.handler;
cmd.cancelTiddler.handler = function(ev, src, title) {
	var tiddler = store.getTiddler(title);
	if(tiddler) {
		tiddler.fields = fieldsCache[title] || tiddler.fields;
		delete fieldsCache[title];
	}
	return _cancelHandler.apply(this, arguments);
};

// hijack saveTiddler to clear unused fields stash
var _saveHandler = cmd.saveTiddler.handler;
cmd.saveTiddler.handler =  function(ev, src, title) {
	delete fieldsCache[title];
	return _saveHandler.apply(this, arguments);
};

})(jQuery);
//}}}
/***
|''Name''|TiddlySpaceConfig|
|''Version''|0.7.7|
|''Description''|TiddlySpace configuration|
|''Status''|stable|
|''Source''|http://github.com/TiddlySpace/tiddlyspace/raw/master/src/plugins/TiddlySpaceConfig.js|
|''CoreVersion''|2.6.1|
|''Requires''|TiddlyWebConfig ServerSideSavingPlugin TiddlyFileImporter|
!Code
***/
//{{{
(function($) {

var tweb = config.extensions.tiddlyweb;

var recipe = config.defaultCustomFields["server.workspace"].split("recipes/")[1];
var currentSpace; // assigned later

var disabledTabs = [];

var coreBags = ["system", "tiddlyspace"];
var systemSpaces = ["plugins", "info", "images", "theme"];
systemSpaces = $.map(systemSpaces, function(item, i) {
	return "system-%0_public".format(item);
});

// hijack search macro to add custom attributes for mobile devices
var _search = config.macros.search.handler;
config.macros.search.handler = function(place, macroName, params) {
	_search.apply(this, arguments);
	$(".searchField:input", place).
		attr({ autocapitalize: "off", autocorrect: "off" });
};

// arg is either a container name or a tiddler object
// if fuzzy is truthy, space may be inferred from workspace (for new tiddlers)
// returns space object or false
var determineSpace = function(arg, fuzzy) {
	if(typeof arg == "string") { // container name
		var space = split(arg, "_", "r");
		return ["public", "private"].contains(space.type) ? space : false;
	} else if(arg) { // tiddler
		var container = determineContainer(arg, fuzzy);
		return container ? determineSpace(container.name, fuzzy) : false;
	} else {
		return false;
	}
};

// if fuzzy is truthy, container may be inferred from workspace for new tiddlers
// returns container object or false
var determineContainer = function(tiddler, fuzzy) { // TODO: expose?
	var bag = tiddler.fields["server.bag"];
	var recipe = tiddler.fields["server.recipe"]; // XXX: unused/irrelevant/redundant!?
	if(bag) {
		return { type: "bag", name: bag };
	} else if(recipe) {
		return { type: "recipe", name: recipe };
	} else if(fuzzy) { // new tiddler
		var workspace = tiddler.fields["server.workspace"];
		if(workspace) {
			var container = split(workspace, "/", "l");
			return ["bags", "recipes"].contains(container.type) ? container : false;
		} else {
			return false;
		}
	} else {
		return false;
	}
};

// hijack removeTiddlerCallback to restore tiddler from recipe cascade -- TODO: move into TiddlyWebWiki?
var sssp = config.extensions.ServerSideSavingPlugin;
var _removeTiddlerCallback = sssp.removeTiddlerCallback;
sssp.removeTiddlerCallback = function(context, userParams) {
	var title = context.tiddler.title;
	var recipe = context.tiddler.fields["server.recipe"];
	_removeTiddlerCallback.apply(this, arguments);
	if(recipe) {
		context.workspace = "recipes/" + recipe;
		var callback = function(context, userParams) {
			if(context.status) {
				var dirty = store.isDirty();
				store.saveTiddler(context.tiddler).clearChangeCount();
				store.setDirty(dirty);
			} else {
				store.notify(title, true);
			}
		};
		context.adaptor.getTiddler(title, context, null, callback);
	}
};

// splits a string once using delimiter
// mode "l" splits at the first, "r" at the last occurrence
// returns an object with members type and name
var split = function(str, sep, mode) {
	mode = mode == "r" ? "pop" : "shift"; // TODO: use +/-1 instead of "l"/"r"?
	var arr = str.split(sep);
	var type = arr.length > 1 ? arr[mode]() : null;
	return { type: type, name: arr.join(sep) };
};

var plugin = config.extensions.tiddlyspace = {
	currentSpace: determineSpace(recipe),
	coreBags: coreBags.concat(systemSpaces),

	determineSpace: determineSpace,
	isValidSpaceName: function(name) {
		return name.match(/^[a-z][0-9a-z\-]*[0-9a-z]$/) ? true : false;
	},
	getCurrentBag: function(type) {
		return "%0_%1".format(currentSpace, type);
	},
	getCurrentWorkspace: function(type) {
		return "bags/" + this.getCurrentBag(type);
	},
	// returns the URL for a space's avatar (SiteIcon) based on a server_host
	// object and an optional space name
	// optional nocors argument prevents cross-domain URLs from being generated
	getAvatar: function(host, space, nocors) {
		if(space && typeof space != "string") { // backwards compatibility -- XXX: deprecated
			space = space.name;
		}
		var subdomain = nocors ? currentSpace : space;
		host = host ? this.getHost(host, subdomain) : "";
		var bag = space ? "%0_public".format(space) : "tiddlyspace";
		return "%0/bags/%1/tiddlers/SiteIcon".format(host, bag);
	},
	// returns the URL based on a server_host object (scheme, host, port) and an
	// optional subdomain
	getHost: function(host, subdomain) {
		if(host === undefined) { // offline
			tweb.status.server_host = {}; // prevents exceptions further down the stack -- XXX: hacky workaround, breaks encapsulation
			return null;
		}
		subdomain = subdomain ? subdomain + "." : "";
		var url = "%0://%1%2".format(host.scheme, subdomain, host.host);
		var port = host.port;
		if(port && !["80", "443"].contains(port)) {
			url += ":" + port;
		}
		return url;
	},
	disableTab: function(tabTiddler) {
		if(typeof(tabTiddler) == "string") {
			disabledTabs.push(tabTiddler);
		} else {
			for(var i = 0; i < tabTiddler.length; i++) {
				plugin.disableTab(tabTiddler[i]);
			}
		}
	},
    checkSyncStatus: function(tiddler) {
		if(tiddler) {
			var title = typeof(tiddler) === "string" ? tiddler : tiddler.title;
			var el = story.getTiddler(title) || false;
			if(el) {
				refreshElements(el);
			}
		}
	},
	isDisabledTab: function(tabTitle) {
		var match = new RegExp("(?:\\[\\[([^\\]]+)\\]\\])", "mg").exec(tabTitle);
		var tabIdentifier = match ? match[1] : tabTitle;
		return disabledTabs.contains(tabIdentifier);
	},
	getCSRFToken: window.getCSRFToken || null // this may not have been processed yet
};

currentSpace = plugin.currentSpace.name;

tweb.serverPrefix = tweb.host.split("/")[3] || ""; // XXX: assumes root handler
tweb.getStatus(function(status) {
	var url = plugin.getHost(status.server_host);
	tweb.status.server_host.url = url;
	config.messages.tsVersion = status.version;
});

if(window.location.protocol == "file:") {
	// enable AutoSave by default
	config.options.chkAutoSave = config.options.chkAutoSave === undefined ?
		true : config.options.chkAutoSave;
} else {
	// set global read-only mode based on membership heuristics
	var indicator = store.getTiddler("SiteTitle") || tiddler;
	readOnly = !(recipe.split("_").pop() == "private" ||
		tweb.hasPermission("write", indicator));
	// replace TiddlyWiki's ImportTiddlers due to cross-domain restrictions
	if(config.macros.fileImport) {
		$.extend(config.macros.importTiddlers, config.macros.fileImport);
	}
}

// hijack saveChanges to ensure SystemSettings is private by default
var _saveChanges = saveChanges;
saveChanges = function(onlyIfDirty, tiddlers) {
	if(tiddlers && tiddlers.length == 1 &&
			tiddlers[0] && tiddlers[0].title == "SystemSettings") {
		var fields = tiddlers[0].fields;
		delete fields["server.recipe"];
		fields["server.bag"] = plugin.getCurrentBag("private");
		fields["server.workspace"] = plugin.getCurrentWorkspace("private");
	}
	return _saveChanges.apply(this, arguments);
};

// ensure backstage is always initialized
// required to circumvent TiddlyWiki's read-only based handling
config.macros.backstageInit = {
	init: function() {
		showBackstage = true;
	}
};

// disable evaluated macro parameters for security reasons
config.evaluateMacroParameters = "none";
var _parseParams = String.prototype.parseParams;
String.prototype.parseParams = function(defaultName, defaultValue, allowEval,
		noNames, cascadeDefaults) {
	if(config.evaluateMacroParameters == "none") {
		arguments[2] = false;
	}
	return _parseParams.apply(this, arguments);
};

var _tabsMacro = config.macros.tabs.handler;
config.macros.tabs.handler = function(place, macroName, params) {
	var newParams = [params[0]]; // keep cookie name
	for(var i = 1; i < params.length; i += 3) {
		var tabTitle = params[i + 2];
		if(!plugin.isDisabledTab(tabTitle)){
			newParams = newParams.concat(params[i], params[i + 1], tabTitle);
		}
	}
	_tabsMacro.apply(this, [place, macroName, newParams]);
};

// disable ControlView for XHRs by default
$.ajaxSetup({
	beforeSend: function(xhr) {
		xhr.setRequestHeader("X-ControlView", "false");
	}
});
// TiddlyWeb adaptor currently still uses httpReq, which needs extra magic -- XXX: obsolete this!
var _httpReq = httpReq;
httpReq = function(type, url, callback, params, headers, data, contentType,
		username, password, allowCache) {
	headers = headers || {};
	headers["X-ControlView"] = "false";
	_httpReq.apply(this, arguments);
};

// register style sheet for backstage separately (important)
store.addNotification("StyleSheetBackstage", refreshStyles);

// option for default privacy setting
config.optionsDesc.chkPrivateMode = "Set your default privacy mode to private";
config.optionsSource.chkPrivateMode = "setting";
config.options.chkPrivateMode = config.options.chkPrivateMode || false;
saveSystemSetting("chkPrivateMode", true);
config.defaultCustomFields["server.workspace"] = plugin.
	getCurrentWorkspace(config.options.chkPrivateMode ? "private" : "public");

config.paramifiers.follow = {
	onstart: function(v) {
		if(!readOnly) {
			var bag = "%0_public".format(currentSpace);
			story.displayTiddler(null, v, DEFAULT_EDIT_TEMPLATE, null, null,
				"server.bag:%0 server.workspace:bags/%0".format(bag));
			story.setTiddlerTag(v, "follow", 1);
			story.focusTiddler(v, "text");
		}
	}
};

var fImport = config.macros.fileImport;
if(fImport) {
	fImport.uploadTo = "Upload to: ";
	var _createForm = config.macros.fileImport.createForm;
	config.macros.fileImport.createForm = function(place, wizard, iframeName) {
		var container = $("<div />").text(fImport.uploadTo).appendTo(place);
		var select = $('<select name="mode" />').appendTo(container)[0];
		$('<option value="private" selected>private</a>').appendTo(select);
		$('<option value="public">public</a>').appendTo(select);
		wizard.setValue("importmode", select);
		_createForm.apply(this, [place, wizard, iframeName]);
	};

	var _onGet = config.macros.importTiddlers.onGetTiddler;
	config.macros.importTiddlers.onGetTiddler = function(context, wizard) {
		var type = $(wizard.getValue("importmode")).val();
		var ws =  plugin.getCurrentWorkspace(type);
		wizard.setValue("workspace", ws);
		_onGet.apply(this, [context, wizard]);
	};
}

config.extensions.ServerSideSavingPlugin.reportSuccess = function(msg, tiddler) {
	plugin.checkSyncStatus(tiddler);
	msg = config.extensions.ServerSideSavingPlugin.locale[msg];
	var link = "/" + encodeURIComponent(tiddler.title);
	displayMessage(msg.format([tiddler.title]), link);
};


})(jQuery);
//}}}
/***
|''Name''|TiddlySpaceFilters|
|''Description''|provide TiddlySpace-specific filter extensions|
|''Author''|Jon Robson|
|''Version''|0.6.1|
|''Status''|@@beta@@|
|''CoreVersion''|2.6.2|
|''Requires''|TiddlySpaceConfig|
|''License''|[[BSD|http://www.opensource.org/licenses/bsd-license.php]]|
!Usage
{{{
<<tsList Private>>
<<tsList Public>>
<<tsList Draft>>
}}}
!Code
***/
//{{{
(function($) {

var tiddlyspace = config.extensions.tiddlyspace;
var privateBag = tiddlyspace.getCurrentBag("private");
var publicBag = tiddlyspace.getCurrentBag("public");

config.filterHelpers = {
	is: {
		"private": function(tiddler) {
			var bag = tiddler.fields["server.bag"];
			return bag == privateBag;
		},
		"public": function(tiddler) {
			var bag = tiddler.fields["server.bag"];
			return bag == publicBag;
		},
		draft: function(tiddler) {
			var fields = tiddler.fields;
			var bag = fields["server.bag"];
			return (privateBag == bag && fields["publish.name"]) ? true : false;
		},
		local: function(tiddler) {
			return config.filterHelpers.is["public"](tiddler) ||
				config.filterHelpers.is["private"](tiddler);
		},
		unsynced: function(tiddler) {
			return tiddler ? tiddler.isTouched() : false;
		}
	}
};

config.filters.is = function(results, match) {
	var candidates = store.getTiddlers("title");
	var type = match[3];
	for (var i = 0; i < candidates.length; i++) {
		var tiddler = candidates[i];
		var helper = config.filterHelpers.is[type];
		if(helper && helper(tiddler)) {
			results.pushUnique(tiddler);
		}
	}
	return results;
};

})(jQuery);
//}}}
/***
|''Name''|TiddlySpaceFollowingPlugin|
|''Version''|0.7.1|
|''Description''|Provides a following macro|
|''Author''|Jon Robson|
|''Requires''|TiddlySpaceConfig TiddlySpaceTiddlerIconsPlugin ErrorHandler|
|''License''|[[BSD|http://www.opensource.org/licenses/bsd-license.php]]|
!Usage
Tag a tiddler with "follow" to express a list of followers.
Using the {{{<<followTiddlers X>>}}}
will reveal the number of tiddlers with name X in the set of spaces the *current* user viewing your space follows.
{{{<<following jon>>}}} will list all the users following Jon.
{{{<<followers jon>>}}} will list all the followers of jon.
{{{<linkedTiddlers>>}}} will list all tiddlers across TiddlySpace linked to the current tiddler
{{{<linkedTiddlers follow:yes>>}}} will list all tiddlers across TiddlySpace that come from your list of followers
adds spaceLink view type {{{<<view server.bag spaceLink>>}}} creates a link to the space described in server.bag
{{{<<view server.bag spaceLink title>>}}} makes a link to the tiddler with title expressed in the field title in space server.bag
If no name is given eg. {{{<<following>>}}} or {{{<<follow>>}}} it will default the current user.
!StyleSheet
.followTiddlersList li {
	list-style:none;
}

.followButton {
	width: 2em;
}

.followTiddlersList li .siteIcon {
	height:48px;
	width: 48px;
}

#sidebarTabs .followers li a,
.followers .siteIcon,
.followers .siteIcon div {
	display: inline;
}

.followTiddlersList li .externalImage, .followTiddlersList li .image {
	display: inline;
}

.scanResults li {
	list-style: none;
}
!Code
***/
//{{{
(function($) {
var LIMIT_FOLLOWING = 100;

var tweb = config.extensions.tiddlyweb;
var tiddlyspace = config.extensions.tiddlyspace;
var currentSpace = tiddlyspace.currentSpace.name;

var shadows = config.shadowTiddlers;
config.annotations.ScanTemplate = "This tiddler is the default template used in the display of tiddlers founding using the tsScan macro. To access attributes use the view macro e.g. {{{<<view title text>>}}}";
shadows.ScanTemplate = "<<view modifier SiteIcon width:24 height:24 spaceLink:yes label:no>> <<view title link>>";
shadows.FollowersTemplate = "<<view server.bag SiteIcon width:24 height:24 spaceLink:yes label:no>> <<view server.bag spaceLink>>";
shadows.FollowingTemplate = "<<view title SiteIcon width:24 height:24 spaceLink:yes label:no>> <<view title spaceLink>>";
shadows.FollowTiddlersBlackList = "";
shadows.FollowTiddlersHeading = "There are tiddlers in spaces you follow using the follow tag which use the title <<view title text>>";
shadows.FollowTiddlersTemplate = ["* <<view server.space SiteIcon width:24 height:24 spaceLink:yes label:no>> ",
	"<<view server.space spaceLink title external:no>> modified by <<view modifier spaceLink>> ",
	"in the <<view server.space spaceLink>> space (<<view modified date>> @ <<view modified date 0hh:0mm>>).\n"].join("");

var name = "StyleSheetFollowing";
shadows[name] = "/*{{{*/\n%0\n/*}}}*/".
	format(store.getTiddlerText(tiddler.title + "##StyleSheet"));
store.addNotification(name, refreshStyles);

// provide support for sucking in tiddlers from the server
tiddlyspace.displayServerTiddler = function(src, title, workspace, callback) {
	var adaptor = store.getTiddlers()[0].getAdaptor();
	var localTitle = tiddlyspace.getLocalTitle(title, workspace);
	var tiddler = new Tiddler(localTitle);
	tiddler.text = "Please wait while this tiddler is retrieved...";
	tiddler.fields.doNotSave = "true";
	store.addTiddler(tiddler);
	src = story.displayTiddler(src || null, tiddler.title);
	tweb.getStatus(function(status) {
		var context = {
			host: tweb.host, // TODO: inherit from source tiddler?
			workspace: workspace,
			headers: { "X-ControlView": "false" }
		};
		var getCallback = function(context, userParams) {
			var tiddler = context.tiddler;
			tiddler.title = localTitle;
			store.addTiddler(tiddler);
			story.refreshTiddler(localTitle, null, true); // overriding existing allows updating
			if(callback) {
				callback(src, tiddler);
			}
		};
		adaptor.getTiddler(title, context, null, getCallback);
	});
};

tiddlyspace.scroller = {
	runHandler: function(title, top, bottom, height) {
		var i;
		var handlers = tiddlyspace.scroller.handlers;
		var tidEl = story.getTiddler(title);
		if(tidEl) {
			var topEl = $(tidEl).offset().top + 20;
			if(top === false || (topEl > top && topEl < bottom)) {
				var h = handlers[title];
				for(i = 0; i < h.length; i++) {
					h[i]();
				}
				tiddlyspace.scroller.clearHandlers(title);
			}
		} else {
			tiddlyspace.scroller.clearHandlers(title);
		}
	},
	clearHandlers: function(title) {
		tiddlyspace.scroller.handlers[title] = [];
	},
	registerIsVisibleEvent: function(title, handler) {
		tiddlyspace.scroller.handlers[title] = tiddlyspace.scroller.handlers[title] || [];
		tiddlyspace.scroller.handlers[title].push(handler);
	},
	init: function() {
		this.handlers = {};
		this.interval = window.setInterval(function() {
			var top = $(window).scrollTop();
			var height = $(window).height();
			var bottom = top + height;
			var title;
			for(title in tiddlyspace.scroller.handlers) {
				if(title) {
					tiddlyspace.scroller.runHandler(title, top, bottom, height);
				}
			}
		}, 2000); // every 2 seconds check scroll position
	}
};
tiddlyspace.scroller.init();

var followMacro = config.macros.followTiddlers = {
	locale: {
		followListHeader: "Here are tiddlers from spaces you follow using the follow tag which use this title.",
		noTiddlersFromFollowers: "None of the spaces you follow contain a tiddler with this name.",
		errorMessage: "There was a problem retrieving tiddlers from the server. Please try again later."
	},
	init: function() {
		followMacro.lookup = {};
	},
	followTag: "follow",
	getHosts: function(callback) {
		tweb.getStatus(function(status) {
			callback(tweb.host, tiddlyspace.getHost(status.server_host, "%0"));
		});
	},
	getBlacklist: function() {
		return store.getTiddlerText("FollowTiddlersBlackList").split("\n");
	},
	handler: function(place, macroName, params, wikifier, paramString, tiddler) {
		var args = paramString.parseParams("anon")[0];
		var containingTiddler = story.findContainingTiddler(place).getAttribute('tiddler');
		var title = (args.anon && args.anon[0]) || tiddler.fields["server.title"] || tiddler.title;
		var tid = store.getTiddler(title);
		var user = params[1] || false;
		if(tid) {
			followMacro.makeButton(place, {
				url: "/search?q=title:%22" + encodeURIComponent(title) + "%22",
				containingTiddler: containingTiddler,
				blacklisted: followMacro.getBlacklist(), title: title, user: user,
				consultFollowRelationship: (args.follow &&
					args.follow[0] === 'false') ? false : true });
		}
	},
	makeButton: function(place, options) { // this is essentially the same code in TiddlySpaceFollowingPlugin
		var title = options.title;
		var blacklisted = options.blacklisted;
		var tiddler = store.getTiddler(title);
		var btn = $('<div class="followButton" />').addClass("notLoaded").appendTo(place)[0];
		if(blacklisted.contains(title)) {
			$(btn).remove();
			return;
		} else {
			var user = options.user;
			window.setTimeout(function() { // prevent multiple calls due to refresh
				tiddlyspace.scroller.registerIsVisibleEvent(options.containingTiddler, function() {
					var mkButton = function(followers, ignore) {
						if(!followers && !ignore) {
							$(btn).remove();
						} else {
							$("<a />").appendTo(btn);
							var scanOptions = { url: options.url,
								spaceField: options.spaceField || "bag", template: null, sort: "-modified",
								callback: function(tiddlers) {
									$(btn).removeClass("notLoaded");
									followMacro.constructInterface(btn, tiddlers);
								}
							};
							if(!ignore) {
								scanOptions.showBags = followMacro._getFollowerBags(followers);
							}
							scanOptions.hideBags = [tiddler.fields["server.bag"]];
							scanMacro.scan(null, scanOptions, user);
						}
					};
					if(options.consultFollowRelationship) {
						followMacro.getFollowers(mkButton);
					} else {
						mkButton([], true);
					}
				});
			}, 1000);
		}
	},
	constructInterface: function(container, tiddlers) {
		var txt = tiddlers.length;
		var className = txt > 0 ? "hasReplies" : "noReplies";
		var el = $(story.findContainingTiddler(container));
		$(container).empty().addClass(className);
		var btn = $("<a />").addClass("followedTiddlers").text(txt).
			click(function(ev) {
				followMacro.followingOnClick(ev);
			}).appendTo('<div class="followedTiddlers" />').appendTo(container)[0];
		$.data(btn, "tiddlers", tiddlers);
	},
	followingOnClick: function(ev) {
		var target = ev.target;
		var locale = followMacro.locale;
		var el = $('<div class="followTiddlersList" />')[0];
		var popup = Popup.create(target,"div");
		$(popup).addClass("taggedTiddlerList followList").click(function(ev) { // make it so only clicking on the document outside the popup removes the popup
			if(ev.target.parentNode != document) {
				ev.stopPropagation();
			}
		}).append(el);
		var tiddlers = $.data(target, "tiddlers") || [];
		scanMacro.template(el, tiddlers.slice(0,1), "FollowTiddlersHeading");
		scanMacro.template(el, tiddlers, "FollowTiddlersTemplate");
		if(tiddlers.length === 0) {
			$("<li />").text(locale.noTiddlersFromFollowers).appendTo(el);
		}
		Popup.show();
		ev.stopPropagation();
		return popup;
	},
	_getFollowerBags: function(followers) { // XXX: private or not?
		return $.map(followers, function(name, i) {
			return name != currentSpace ? "%0_public".format(name) : null;
		});
	},
	getFollowers: function(callback, username) {
		// returns a list of spaces being followed by the existing space
		var followersCallback = function(user) {
			if(!user.anon) {
				scanMacro.scan(null, { 
					url: "/search?q=bag:%0_public tag:%1 _limit:%2".format(user.name, followMacro.followTag, LIMIT_FOLLOWING),
					spaceField: "title", template: null, cache: true,
					callback: function(tiddlers) {
						var followers = [];
						for(var i = 0; i < tiddlers.length; i++) {
							followers.push(tiddlyspace.resolveSpaceName(tiddlers[i].title));
						}
						callback(followers);
					}
				});
			} else {
				callback(false);
			}
		};
		return !username ? tweb.getUserInfo(followersCallback) : followersCallback({ name: username });
	}
};

var scanMacro = config.macros.tsScan = {
	init: function () {
		this.scanned = {};
	},
	_tiddlerfy: function(jsontiddlers, options) {
		var tiddlers = [];
		var spaceField = options.spaceField || "bag"; // TODO: phase out use view types instead
		$.each(jsontiddlers, function(i, t) {
			var use = false;
			if(!options.showBags || (options.showBags && options.showBags.contains(t.bag))) {
				use = true;
			}
			if(options.hideBags && options.hideBags.contains(t.bag)) {
				use = false;
			}
			if(use) {
				var spaceName = t[spaceField];
				var tiddler = config.adaptors.tiddlyweb.toTiddler(t, tweb.host);
				tiddler.fields["server.space"] = tiddlyspace.resolveSpaceName(spaceName);
				tiddlers.push(tiddler);
			}
		});
		return tiddlers;
	},
	_scanCallback: function(place, jsontiddlers, options) {
		var locale = followersMacro.locale;
		var tiddlers = scanMacro._tiddlerfy(jsontiddlers, options);
		
		if(options.sort) {
			tiddlers = store.sortTiddlers(tiddlers, options.sort);
		}
		if(options.filter) {
			var _store = new TiddlyWiki();
			config.lastStore = _store;
			for(var i = 0; i < tiddlers.length; i++) {
				var clone = tiddlers[i];
				clone.title = tiddlyspace.getLocalTitle(clone.title, clone.fields['server.workspace']);
				_store.addTiddler(clone);
			}
			tiddlers = _store.filterTiddlers(options.filter);
		}
		if(place) {
			$(place).empty();
			var list = $("<ul />").appendTo(place)[0];
			scanMacro.template(list, tiddlers, options.template);
			if(tiddlers.length === 0) {
				$("<li />").text(options.emptyMessage || locale.noone).appendTo(list);
				$(list).addClass("emptyList");
			}
		}
		if(options.callback) {
			options.callback(tiddlers);
		}
	},
	constructSearchUrl: function(host, options) {
		if(options.url) {
			return options.url;
		}
		var inputs = options.searchValues;
		var tag = options.tag;
		var searchField = options.searchField || "title";
		var searchQuery = [];
		for(var i = 0; i < inputs.length; i++) {
			searchQuery.push('%0:"%1"'.format(searchField, inputs[i]));
		}
		var query = searchQuery.join(" OR ");
		query = tag ? "(%0) AND tag:%1".format(query, tag) : query;
		query = options.query ? "%0;%1;".format(query, options.query) : query;
		query = options.fat ? "%0&fat=1".format(query) : query;
		return '%0/search?q=%1'.format(host, query);
	},
	scan: function(place, options) { // TODO: make use of list macro with url filter
		var locale = followersMacro.locale;
		options.template = options.template ? options.template : "ScanTemplate";
		followMacro.getHosts(function(host, tsHost) {
			$(place).text(followersMacro.locale.pleaseWait);
			options = options ? options: {};
			var url = scanMacro.constructSearchUrl(host, options);
			if(options.cache && scanMacro.scanned[url]) {
				var tiddlers = scanMacro.scanned[url].tiddlers;
				var run = function(tiddlers) {
					scanMacro._scanCallback(place, tiddlers, options);
				};
				if(tiddlers) {
					run(tiddlers);
				} else {
					scanMacro.scanned[url].callbacks.push(run);
				}
			} else {
				var callback = function(tiddlers) {
					scanMacro._scanCallback(place, tiddlers, options);
				};
				if(scanMacro.scanned[url] && scanMacro.scanned[url].callbacks) {
					scanMacro.scanned[url].callbacks.push(callback);
				} else {
					scanMacro.scanned[url] = {
						callbacks: [callback]
					};
				}
				ajaxReq({
					url: url,
					dataType: "json",
					success: function(tiddlers) {
						scanMacro.scanned[url].tiddlers = tiddlers;
						var callbacks = scanMacro.scanned[url].callbacks;
						while(callbacks.length > 0) {
							callbacks.pop()(tiddlers);
						}
					},
					error: function(xhr) {
						$(place).empty();
						$("<span />").addClass("annotation error").text(locale.error.format(xhr.status)).appendTo(place);
					}
				});
			}
		});
	},
	template: function(place, tiddlers, template) { // TODO: make use of list macro.
		for(var i = 0; i < tiddlers.length; i++) {
			var tiddler = tiddlers[i];
			var item = $('<li class="spaceName" />').appendTo(place)[0];
			var spaceName = tiddler.fields["server.space"] || "";
			var templateText = store.getTiddlerText(template).replace(/\$1/mg, spaceName);
			wikify(templateText, item, null, tiddler);
		}
	},
	getOptions: function(paramString, tiddler) {
		var args = paramString.parseParams("name", null, true, false, true)[0];
		var options = { query: false, sort: false, tag: false, template: false, showBags: args.show || false,
			hideBags: args.hide || false, filter: false, spaceField: "bag", searchField: "title", fat: false,
			emptyMessage: false };
		for(var name in args) {
			if(name != "name") {
				if(name == "fat") {
					options[name] = true;
				} else {
					options[name] = args[name][0];
				}
			}
		}
		// if user has set searchField to modifier, then use the modifiers value if available otherwise use searchValues.
		var searchField = options.searchField;
		var searchValues = args[searchField] ? args[searchField] : args.searchValues;
		// if neither of those were used use the first parameter
		var defaultValues = tiddler ? [ tiddler.title ] : [];
		options.searchValues = searchValues ? searchValues : ( args.name ? [args.name[0]] : defaultValues);
		return options;
	},
	handler: function(place, macroName, params, wikifier, paramString, tiddler) {
		var container = $("<div />").addClass("scanResults resultsArea").appendTo(place)[0];
		var options = scanMacro.getOptions(paramString, tiddler);
		scanMacro.scan(container, options);
	}
};

var followersMacro = config.macros.followers = {
	locale: {
		loggedOut: "Please login to see the list of followers",
		noSupport: "We were unable to retrieve followers as your browser does not support following.",
		pleaseWait: "Please wait while we look this up...",
		error: "Error %0 occurred whilst retrieving data from server",
		noone: "None."
	},
	handler: function(place, macroName, params, wikifier, paramString, tiddler) {
		var locale = followersMacro.locale;
		var args = paramString.parseParams("name", null, true, false, true)[0];
		var username = args.name ? args.name[0] : false;
		var container = $('<div class="followers" />').text(locale.pleaseWait).
			appendTo(place)[0];
		var followersCallback = function(user) {
			if(user.anon) {
				$("<span />").text(locale.loggedOut).appendTo(container);
			} else {
				var options = scanMacro.getOptions(paramString);
				$.extend(options, {
					url: "/search?q=title:@%0 OR title:%0 tag:%1 _limit:%2".
						format(user.name, followMacro.followTag, LIMIT_FOLLOWING),
					spaceField: "bag",
					template: options.template ? options.template : "FollowersTemplate"
				});
				scanMacro.scan(container, options);
			}
		};
		return !username ? followersCallback({ name: currentSpace }) : followersCallback({ name: username });
	}
};

var followingMacro = config.macros.following = {
	locale: {
		pleaseWait: followersMacro.locale.pleaseWait,
		loggedOut: "Please login to see who you are following",
		noSupport: followersMacro.locale.noSupport,
		error: followersMacro.locale.error,
		noone: followersMacro.locale.noone
	},
	handler: function(place, macroName, params, wikifier, paramString, tiddler) {
		var locale = followingMacro.locale;
		var args = paramString.parseParams("name", null, true, false, true)[0];
		var fat = args.fat ? true : false;
		var username = args.name ? args.name[0] : false;
		var container = $('<div class="following" />').text(locale.pleaseWait).
			appendTo(place)[0];
		var followingCallback = function(user) {
			if(user.anon) {
				$("<span />").text(locale.loggedOut).appendTo(container);
			} else {
				var options = scanMacro.getOptions(paramString);
				$.extend(options, {
					url: "/search?q=bag:%0_public tag:%1 _limit:%2".format(user.name, followMacro.followTag, LIMIT_FOLLOWING),
					spaceField: "title",
					template: options.template ? options.template : "FollowingTemplate"
				});
				scanMacro.scan(container, options);
			}
		};
		return !username ? followingCallback({ name: currentSpace }) : followingCallback({ name: username });
	}
};

var linkedMacro = config.macros.linkedTiddlers = {
	handler: function(place, macroName, params, wikifier, paramString, tiddler) {
		var args = paramString.parseParams("anon")[0];
		var title = params[0] || tiddler.fields["server.title"] || tiddler.title;
		var tid = store.getTiddler(title);
		var containingTiddler = story.findContainingTiddler(place).getAttribute('tiddler');
		if(tid) {
			followMacro.makeButton(place, {
				spaceField: "recipe",
				url: "/bags/%0/tiddlers/%1/backlinks".format(tid.fields['server.bag'],
					encodeURIComponent(tid.title)),
				blacklisted: followMacro.getBlacklist(),
				title: title,
				containingTiddler: containingTiddler,
				user: params[1] || false,
				consultFollowRelationship: args.follow ? true : false });
		}
	}
};

if(config.options.chkFollowTiddlersIsLinkedTiddlers) {
	merge(config.macros.followTiddlers, config.macros.linkedTiddlers);
	config.shadowTiddlers.FollowTiddlersHeading = "These are the other tiddlers that link to this tiddler.";
}

})(jQuery);
//}}}
/***
|''Name''|TiddlySpaceInitialization|
|''Version''|0.7.3|
|''Description''|Initializes new TiddlySpaces the first time they are created|
|''Status''|@@beta@@|
|''Source''|http://github.com/TiddlySpace/tiddlyspace/blob/master/src/plugins/TiddlySpaceInit.js|
|''CoreVersion''|2.6.1|
|''Requires''|TiddlySpaceConfig RandomColorPalettePlugin chrjs ImageMacroPlugin|
!TODO
* robust error notification and recovery
!MarkupPreHead
<!--{{{-->
<link href="/bags/%0_public/tiddlers.atom" rel="alternate"
	type="application/atom+xml" title="%0's public feed" />
<link rel="canonical" href="%1/" />
<!--}}}-->
!Code
***/
//{{{
(function($) {

var versionField = "tiddlyspaceinit_version";
var markupPreHead = store.getTiddlerText(tiddler.title + "##MarkupPreHead", "");
var tiddlyspace = config.extensions.tiddlyspace;
var currentSpace = tiddlyspace.currentSpace;
var tweb = config.extensions.tiddlyweb;

var plugin = config.extensions.TiddlySpaceInit = {
	version: "0.6",
	SiteTitle: "%0",
	SiteSubtitle: "a TiddlySpace",
	flagTitle: "%0SetupFlag",
	flagWarning: "Please do not modify this tiddler; it was created " +
		"automatically upon space creation.",

	dispatch: function(ev) {
		var title = plugin.flagTitle.format([currentSpace.name]);
		config.annotations[title] = plugin.flagWarning;
		if(currentSpace.type != "private") {
			return;
		}
		var tiddlers = [];
		var tid = store.getTiddler(title);
		if(tid) {
			curVersion = parseFloat(tid.fields[versionField]);
			reqVersion = parseFloat(plugin.version);
			if(curVersion < reqVersion) {
				plugin.update(curVersion, tid);
				tid.fields[versionField] = plugin.version;
				tid.incChangeCount();
				tid = store.saveTiddler(tid);
				tiddlers.push(tid);
			}
		} else { // first run
			tid = new Tiddler(title);
			tid.tags = ["excludeLists", "excludeSearch", "excludePublisher"];
			tid.fields = $.extend({}, config.defaultCustomFields);
			tid.fields[versionField] = plugin.version;
			tid.text = "@@%0@@".format([plugin.flagWarning]);
			tid = store.saveTiddler(tid);
			tiddlers = tiddlers.concat(plugin.firstRun(), tid);
		}
		autoSaveChanges(null, tiddlers);
	},
	update: function(curVersion, flagTiddler) {
		if(curVersion < 0.2) {
			this.createAvatar();
		}
		if(curVersion < 0.3) {
			flagTiddler.tags.pushUnique("excludePublisher"); // XXX: never persisted
		}
		if(curVersion < 0.5) { // v0.4 was faulty
			this.setupMarkupPreHead();
		}
		if(curVersion < 0.6) {
			this.purgeSystemSettings();
		}
	},
	pubTid: {
		tags: ["excludeLists", "excludeSearch"],
		fields: $.extend({}, config.defaultCustomFields, {
			"server.workspace": tiddlyspace.getCurrentWorkspace("public")
		})
	},
	makeTiddlerIfNot: function(tiddler) {
		if (!store.tiddlerExists(tiddler.title)) {
			$.extend(true, tiddler, plugin.pubTid);
			return [store.saveTiddler(tiddler)];
		} else {
			return [];
		}
	},
	firstRun: function() {
		var tiddlers = [];
		// generate Site*itle
		$.each(["SiteTitle", "SiteSubtitle"], function(i, item) {
			var tid = new Tiddler(item);
			tid.text = plugin[item].format([currentSpace.name]);
			tiddlers.push.apply(tiddlers,
				plugin.makeTiddlerIfNot(tid));
		});
		// generate public ColorPalette
		var tid = new Tiddler("ColorPalette");
		tid.text = config.macros.RandomColorPalette.generatePalette({
			saturation_pale: 0.67, saturation_light: 0.53,
			saturation_mid: 0.43, saturation_dark: 0.06,
			pale: 0.99, light: 0.85, mid: 0.5, dark: 0.31
		},
			false);
		tiddlers.push.apply(tiddlers, plugin.makeTiddlerIfNot(tid));
		this.createAvatar();
		this.setupMarkupPreHead();
		return tiddlers;
	},
	// remove _cookie slices (TiddlyWiki 2.6.2 beta 6 remnants)
	purgeSystemSettings: function() {
		var ss = store.getTiddler("SystemSettings");
		if(ss) {
			var lines = ss.text.split("\n");
			var persistentOptions = $.grep(lines, function(line, i) {
				return line.indexOf("_cookie:") == -1;
			});
			ss.text = persistentOptions.join("\n");
			ss = store.saveTiddler(ss);
			autoSaveChanges(null, [ss]);
		}
	},
	createAvatar: function() {
		var avatar = "SiteIcon";
		var host = tweb.host;
		var notify = function(xhr, error, exc) {
			displayMessage("ERROR: could not create avatar - " + // TODO: i18n
				"%0: %1".format([xhr.statusText, xhr.responseText]));
			// TODO: resolve!?
		};

		var pubBag = tiddlyspace.getCurrentBag("public");
		var tid = new tiddlyweb.Tiddler(avatar);
		tid.bag = new tiddlyweb.Bag(pubBag, host);

		var callback = function(data, status, xhr) {}; // avatar already exists; do nothing
		var errback = function(xhr, error, exc) {
			if(xhr.status != 404) {
				return;
			}
			// copy default avatar
			var _notify = function(tid, status, xhr) {
				displayMessage("created avatar"); // TODO: i18n
				var image = config.macros.image;
				if(image && image.refreshImage) {
					var uri = "/%0/tiddlers/SiteIcon".
						format(tiddlyspace.getCurrentWorkspace("public"));
					image.refreshImage(uri);
					image.refreshImage("SiteIcon");
				}
			};
			var _callback = function(tid, status, xhr) {
				tid.title = avatar;
				tid.bag.name = pubBag;
				delete tid.etag;
				tid.put(_notify, notify); // TODO: add to current session document (via adaptor?)
			};
			tweb.getUserInfo(function(user) {
				var avatarTitle = currentSpace.name == user.name ?
					"defaultUserIcon" : "defaultSiteIcon";
				var tid = new tiddlyweb.Tiddler(avatarTitle);
				tid.bag = new tiddlyweb.Bag("common", host);
				tid.get(_callback, notify);
			});
		};
		tid.get(callback, errback);
	},
	savePublicTiddlerText: function(title, text, pubWorkspace) {
		var tid = new Tiddler(title);
		tid.text = text;
		tid.tags = ["excludeLists"];
		tid.fields = $.extend({}, config.defaultCustomFields);
		tid.fields["server.workspace"] = pubWorkspace;
		tid.fields["server.page.revision"] = "false";
		tid = store.saveTiddler(tid);
		autoSaveChanges(null, [tid]);
	},
	setupMarkupPreHead: function() {
		var pubWorkspace = tiddlyspace.getCurrentWorkspace("public");
		var existing = store.getTiddler("MarkupPreHead");
		if(!existing || existing.fields["server.workspace"] != pubWorkspace) {
			var context = this;
			tweb.getStatus(function(status) {
				var text = markupPreHead.format(currentSpace.name,
					tiddlyspace.getHost(status.server_host, currentSpace.name));
				context.savePublicTiddlerText("MarkupPreHead", text,
					pubWorkspace);
			});
		}
		// also set up DefaultTiddlers
		var title = "DefaultTiddlers";
		existing = store.getTiddler(title) || new Tiddler(title);
		if(existing.fields["server.workspace"] != pubWorkspace) {
			var text = existing.text || store.getShadowTiddlerText(title);
			this.savePublicTiddlerText(title, text, pubWorkspace);
		}
	}
};

$(document).bind("startup", plugin.dispatch);

})(jQuery);
//}}}
/***
|''Name:''|TiddlySpaceLinkPlugin|
|''Description:''|Formatter to reference other spaces from wikitext |
|''Author:''|PaulDowney (psd (at) osmosoft (dot) com) |
|''Source:''|http://github.com/TiddlySpace/tiddlyspace/raw/master/src/plugins/TiddlySpaceLinkPlugin.js|
|''Version:''|1.4.2|
|''License:''|[[BSD License|http://www.opensource.org/licenses/bsd-license.php]] |
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev |
|''~CoreVersion:''|2.4|
!!Documentation
This plugin provides wikitext formatters for referencing another [[space|Space]] on the same TiddlySpace server, as in the following examples:
<<<
  {{{@space}}} -- @space 
  {{{~@space}}} -- ~@space 
  {{{Tiddler@space}}} -- Tiddler@space
  {{{[[Tiddler Title]]@space}}} -- [[Tiddler Title]]@space 
  {{{[[Link text|Tiddler Title]]@space}}} -- [[Link text|Tiddler Title]]@space
<<<
Links to tiddlers with a title begining with an "@" remain as tiddlyLinks:
<<<
  {{{[[@tiddler]]}}} -- [[@tiddler]]
<<<
and these may be changed into a space link using {{{@@}}}:
<<<
  {{{[[@@space]]}}} -- [[@@space]]
  {{{[[Link to an another space|@@space]]}}} -- [[Link to another space|@@space]]
  {{{[[@space|@@space]]}}} -- [[@space|@@space]]
<<<
TiddlySpace includes the [[TiddlySpaceLinkPlugin]] which provides WikiText markup for linking to other spaces on the same server. For example @glossary is a link to the {{{glossary}}} space and [[Small Trusted Group]]@glossary a link to an individual tiddler in the @glossary space. Prefixing the link with a tilde escapes the link, for example {{{~@space}}}.
Email addresses, for example joe.bloggs@example.com and mary@had.a.little.lamb.org should be unaffected.
!!Features
The plugin provides external links decorated so that other plugins may be included to add features such as the ability to dynamically pull externally linked tiddlers into the current TiddlyWiki.
Wikitext linking to a space on another server, for example from a tiddler in a space on tiddlyspace.com to a tiddler or a space on example.com, isn't currently supported. 
!!Code
***/
//{{{
/*jslint onevar: false nomen: false plusplus: false */
/*global jQuery config createTiddlyText createExternalLink createTiddlyLink */

function createSpaceLink(place, spaceName, title, alt, isBag) {
	var link, a, currentSpaceName, label;
	try {
		if (spaceName === config.extensions.tiddlyspace.currentSpace.name) {
			title = title || spaceName;
			a = createTiddlyLink(place, title, false);
			jQuery(a).text(alt || title);
			return a;
		}
	} catch (ex1) {
		currentSpaceName = false;
	}

	a = jQuery("<a />").addClass('tiddlySpaceLink externalLink').appendTo(place)[0];
	if(title) {
		jQuery(a).attr('tiddler', title);
	}
	if(isBag) {
		jQuery(a).attr('bag', spaceName);
	} else {
		jQuery(a).attr('tiddlyspace', spaceName);
	}

	config.extensions.tiddlyweb.getStatus(function(status) {
		link = status.server_host.url;
		if (title) {
			label = alt || title;
			link = link + "/" + encodeURIComponent(title);
		} else {
			label = alt || spaceName;
		}
		// assumes a http URI without user:pass@ prefix
		if(!isBag) {
			link = link.replace("http://", "http://" + spaceName.toLowerCase() + ".");
		} else {
			link += "/bags/" + spaceName + "/tiddlers.wiki";
		}
		jQuery(a).attr("href", link).text(label);
	});
	return a;
}

(function ($) {

	config.textPrimitives.spaceName = "[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]";
	config.textPrimitives.spaceNameStrict = "[a-z][a-z0-9-]*";
	config.textPrimitives.bareTiddlerLetter = config.textPrimitives.anyLetterStrict;

	config.formatters.splice(0, 0, {
		name: "spacenameLink",
		match: config.textPrimitives.unWikiLink + "?" + config.textPrimitives.bareTiddlerLetter + "*@" + config.textPrimitives.spaceName + "\\.?.?",
		lookaheadRegExp: new RegExp(config.textPrimitives.unWikiLink + "?(" + config.textPrimitives.bareTiddlerLetter + "*)@(" + config.textPrimitives.spaceName + ")", "mg"),
		handler: function (w) {
			if (w.matchText.substr(w.matchText.length - 2, 1) === '.' && w.matchText.substr(w.matchText.length - 1, 1).match(/[a-zA-Z]/)) {
				w.outputText(w.output, w.matchStart, w.nextMatch);
				return;
			}
			if (w.matchText.substr(0, 1) === config.textPrimitives.unWikiLink) {
				w.outputText(w.output, w.matchStart + 1, w.nextMatch);
				return;
			}
			this.lookaheadRegExp.lastIndex = w.matchStart;
			var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
			if (lookaheadMatch && lookaheadMatch.index === w.matchStart) {
				createSpaceLink(w.output, lookaheadMatch[2], lookaheadMatch[1]);
				w.nextMatch = this.lookaheadRegExp.lastIndex;
			}
		}
	},
	{
		name: "tiddlySpaceLink",
		match: "\\[\\[[^\\|\\]]*\\|*@@" + config.textPrimitives.spaceName + "\\]",
		lookaheadRegExp: new RegExp("\\[\\[(.*?)(?:\\|@@(.*?))?\\]\\]", "mg"),
		handler: function (w) {
			this.lookaheadRegExp.lastIndex = w.matchStart;
			var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
			if (lookaheadMatch && lookaheadMatch.index === w.matchStart) {
				var alt = lookaheadMatch[2] ? lookaheadMatch[1] : lookaheadMatch[1].replace(/^@@/, "");
				var space = lookaheadMatch[2] || alt;
				createSpaceLink(w.output, space, "", alt);
				w.nextMatch = this.lookaheadRegExp.lastIndex;
			}
		}
	},
	{
		name: "tiddlyLinkSpacenameLink",
		match: "\\[\\[[^\\[]*\\]\\]@",
		lookaheadRegExp: new RegExp("\\[\\[(.*?)(?:\\|(.*?))?\\]\\]@(" + config.textPrimitives.spaceName + ")", "mg"),
		handler: function (w) {
			this.lookaheadRegExp.lastIndex = w.matchStart;
			var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
			if (lookaheadMatch && lookaheadMatch.index === w.matchStart) {
				var title = lookaheadMatch[2] || lookaheadMatch[1];
				var alt = lookaheadMatch[1] || lookaheadMatch[2];
				createSpaceLink(w.output, lookaheadMatch[3], title, alt);
				w.nextMatch = this.lookaheadRegExp.lastIndex;
			}
		}
	});

	// ensure space links don't appear as missing links
	config.textPrimitives.brackettedLink = "\\[\\[([^\\]][^@\\]][^\\]]*)\\]\\](?=[^@])";
	config.textPrimitives.titledBrackettedLink = "\\[\\[([^\\[\\]\\|]+)\\|([^\\[\\]\\|]+)\\]\\](?=[^@])";

	// reevaluate derrived expressions ..
	config.textPrimitives.tiddlerForcedLinkRegExp = new RegExp("(?:" + config.textPrimitives.titledBrackettedLink + ")|(?:" +
		config.textPrimitives.brackettedLink + ")|(?:" +
		config.textPrimitives.urlPattern + ")","mg");
	config.textPrimitives.tiddlerAnyLinkRegExp = new RegExp("("+ config.textPrimitives.wikiLink + ")|(?:" +
		config.textPrimitives.titledBrackettedLink + ")|(?:" +
		config.textPrimitives.brackettedLink + ")|(?:" +
		config.textPrimitives.urlPattern + ")","mg");

	// treat space links in titledBracketedLink as external links
	var missingTiddlySpaceLink = new RegExp("^@@" + config.textPrimitives.spaceName + "$", "");
	var isExternalLink = config.formatterHelpers.isExternalLink;
	config.formatterHelpers.isExternalLink = function(link) {
		return missingTiddlySpaceLink.test(link) || isExternalLink(link);
	};

}(jQuery));
//}}}
/***
|''Name''|TiddlySpacePublishingCommands|
|''Version''|0.8.5|
|''Status''|@@beta@@|
|''Description''|toolbar commands for drafting and publishing|
|''Author''|Jon Robson|
|''Source''|http://github.com/TiddlySpace/tiddlyspace/raw/master/src/plugins/TiddlySpacePublishingCommands.js|
|''CoreVersion''|2.6.1|
|''Requires''|TiddlySpaceConfig TiddlySpaceFilters|
!Usage
Provides changeToPrivate, changeToPublic and saveDraft commands
Provides TiddlySpacePublisher macro.
{{{<<TiddlySpacePublisher type:private>>}}} make lots of private tiddlers public.
{{{<<TiddlySpacePublisher type:public>>}}} make lots of public tiddlers public.
!TODO
* add public argument?
!Code
***/
//{{{
(function($) {

var tiddlyspace = config.extensions.tiddlyspace;
var originMacro = config.macros.tiddlerOrigin;

tiddlyspace.getTiddlerStatusType = function(tiddler) {
	var isShadow = store.isShadowTiddler(tiddler.title);
	var exists = store.tiddlerExists(tiddler.title);
	if(isShadow && !exists) {
		return "shadow";
	} else if(!exists) {
		return "missing";
	} else {
		var types = ["private", "public"];
		var type = "external";
		for(var i = 0; i < types.length; i++) {
			var t = types[i];
			type = config.filterHelpers.is[t](tiddler) ? t : type;
		}
		if(config.filterHelpers.is.unsynced(tiddler)) {
			type = type == "private" ? "unsyncedPrivate" : "unsyncedPublic";
		}
		return type;
	}
};

var cmd = config.commands.publishTiddler = {
	text: "make public",
	tooltip: "Change this private tiddler into a public tiddler",
	errorMsg: "Error publishing %0: %1",

	isEnabled: function(tiddler) {
		return !readOnly && config.filterHelpers.is["private"](tiddler);
	},
	handler: function(ev, src, title) {
		var tiddler = store.getTiddler(title);
		if(tiddler) {
			var newBag = cmd.toggleBag(tiddler.fields["server.bag"]);
			this.moveTiddler(tiddler, {
				title: tiddler.fields["publish.name"] || tiddler.title,
				fields: { "server.bag": newBag }
			});
		}
	},
	toggleBag: function(bag, to) {
		var newBag;
		if(typeof bag != typeof "") {
			var tiddler = bag;
			bag = tiddler.fields["server.bag"];
		}
		if(bag.indexOf("_private") > -1) { // should make use of endsWith
			to = to ? to : "public";
			newBag = bag.replace("_private", "_" + to);
		} else {
			to = to ? to : "private";
			newBag = bag.replace("_public", "_" + to);
		}
		return newBag;
	},
	copyTiddler: function(title, newTitle, newBag, callback) {
		var original = store.getTiddler(title);
		newTitle = newTitle ? newTitle : title;
		var adaptor = original.getAdaptor();
		var publish = function(original, callback) {
			var tiddler = $.extend(new Tiddler(newTitle), original);
			tiddler.fields = $.extend({}, original.fields, {
				"server.bag": newBag,
				"server.workspace": "bags/%0".format(newBag),
				"server.page.revision": "false"
			});
			delete tiddler.fields["server.title"];
			tiddler.title = newTitle;
			adaptor.putTiddler(tiddler, null, null, callback);
		};
		publish(original, callback);
	},
	moveTiddler: function(tiddler, newTiddler, callback) {
			var info = {
			copyContext: {},
			deleteContext: {}
		};
		var _dirty = store.isDirty();
		var adaptor = tiddler.getAdaptor();
		var newTitle = newTiddler.title;
		var oldTitle = tiddler.title;
		delete tiddler.fields["server.workspace"];
		var oldBag = tiddler.fields["server.bag"];
		var newBag = newTiddler.fields["server.bag"];
		var newWorkspace = "bags/%0".format(newBag);
		cmd.copyTiddler(oldTitle, newTitle, newBag, function(ctx) {
				info.copyContext = ctx;
				var context = {
					tiddler: tiddler,
					workspace: newWorkspace
				};
				store.addTiddler(ctx.tiddler);
				tiddler.title = oldTitle; // for cases where a rename occurs
				if(ctx.status) { // only do if a success
					if(oldBag != newBag) {
						adaptor.deleteTiddler(tiddler, context, {}, function(ctx) {
							info.deleteContext = ctx;
							var el;
							if(tiddler) {
								tiddler.fields["server.workspace"] = newWorkspace;
								tiddler.fields["server.bag"] = newBag;
							}
							el = el ? el : story.refreshTiddler(oldTitle, null, true);
							if(oldTitle != newTitle) {
								store.deleteTiddler(oldTitle);
								store.notify(oldTitle, true);
							}
							if(el) {
								story.displayTiddler(el, newTitle);
							}
							if(oldTitle != newTitle) {
								story.closeTiddler(oldTitle);
							}
							if(callback) {
								callback(info);
							}
							store.setDirty(_dirty);
						});
					} else {
						if(callback) {
							callback(info);
						}
					}
					refreshDisplay();
				}
		});
	}
};

var changeToPrivate = config.commands.changeToPrivate = {
	text: "make private",
	tooltip: "turn this public tiddler into a private tiddler",
	isEnabled: function(tiddler) {
		return !readOnly && config.filterHelpers.is["public"](tiddler);
	},
	handler: function(event, src, title) {
		var tiddler = store.getTiddler(title);
		var newBag = cmd.toggleBag(tiddler, "private");
		var newTiddler = { title: title, fields: { "server.bag": newBag }};
		cmd.moveTiddler(tiddler, newTiddler);
	}
};
config.commands.changeToPublic = cmd;

/* Save as draft command */
var saveDraftCmd = config.commands.saveDraft = {
	text: "save draft",
	tooltip: "Save as a private draft",
	isEnabled: function(tiddler) {
		return changeToPrivate.isEnabled(tiddler);
	},
	getDraftTitle: function(title) {
		var draftTitle;
		var draftNum = "";
		while(!draftTitle) {
			var suggestedTitle = "%0 [draft%1]".format(title, draftNum);
			if(store.getTiddler(suggestedTitle)) {
				draftNum = !draftNum ? 2 : draftNum + 1;
			} else {
				draftTitle = suggestedTitle;
			}
		}
		return draftTitle;
	},
	createDraftTiddler: function(title, gatheredFields) {
		var tiddler = store.getTiddler(title);
		var draftTitle = saveDraftCmd.getDraftTitle(title);
		var draftTiddler = new Tiddler(draftTitle);
		if(tiddler) {
			$.extend(true, draftTiddler, tiddler);
		} else {
			$.extend(draftTiddler.fields, config.defaultCustomFields);
		}
		for(var fieldName in gatheredFields) {
			if(TiddlyWiki.isStandardField(fieldName)) {
				draftTiddler[fieldName] = gatheredFields[fieldName];
			} else {
				draftTiddler.fields[fieldName] = gatheredFields[fieldName];
			}
		}
		var privateBag = tiddlyspace.getCurrentBag("private");
		var privateWorkspace = tiddlyspace.getCurrentWorkspace("private");
		draftTiddler.title = draftTitle;
		draftTiddler.fields["publish.name"] = title;
		draftTiddler.fields["server.workspace"] = privateWorkspace;
		draftTiddler.fields["server.bag"] = privateBag;
		draftTiddler.fields["server.title"] = draftTitle;
		draftTiddler.fields["server.page.revision"] = "false";
		delete draftTiddler.fields["server.etag"];
		return draftTiddler;
	},
	handler: function(ev, src, title) {
		var tiddler = store.getTiddler(title); // original tiddler
		var tidEl = story.getTiddler(title);
		var uiFields = {};
		story.gatherSaveFields(tidEl, uiFields);
		var tid = saveDraftCmd.createDraftTiddler(title, uiFields);
		tid = store.saveTiddler(tid.title, tid.title, tid.text, tid.modifier,
			new Date(), tid.tags, tid.fields);
		autoSaveChanges(null, [tid]);
		story.closeTiddler(title);
		story.displayTiddler(src, title);
		story.displayTiddler(src, tid.title);
	}
};

var macro = config.macros.TiddlySpacePublisher = {
	locale: {
		title: "Batch Publisher",
		changeStatusLabel: "Make %0",
		noTiddlersText: "No tiddlers to publish",
		changeStatusPrompt: "Make all the selected tiddlers %0.",
		description: "Change tiddlers from %0 to %1 in this space"
	},

	listViewTemplate: {
		columns: [
			{ name: "Selected", field: "Selected", rowName: "title", type: "Selector" },
			{ name: "Tiddler", field: "tiddler", title: "Tiddler", type: "Tiddler" },
			{ name: "Status", field: "status", title: "Status", type: "WikiText" }
		],
		rowClasses: []
	},

	changeStatus: function(tiddlers, status, callback) { // this is what is called when you click the publish button
		var publicBag;
		for(var i = 0; i < tiddlers.length; i++) {
			var tiddler = tiddlers[i];
			var newTiddler = {
				title: tiddler.title,
				fields: { "server.bag": cmd.toggleBag(tiddler, status) }
			};
			cmd.moveTiddler(tiddler, newTiddler, callback);
		}
	},
	getMode: function(paramString) {
		var params = paramString.parseParams("anon")[0];
		var status = params.type ?
			(["public", "private"].contains(params.type[0]) ? params.type[0] : "private") :
			"private";
		var newStatus = status == "public" ? "private" : "public";
		return [status, newStatus];
	},
	handler: function(place, macroName, params, wikifier, paramString, tiddler) {
		var wizard = new Wizard();
		var locale = macro.locale;
		var status = macro.getMode(paramString);
		wizard.createWizard(place, locale.title);
		wizard.addStep(macro.locale.description.format(status[0], status[1]),
			'<input type="hidden" name="markList" />');
		var markList = wizard.getElement("markList");
		var listWrapper = $("<div />").addClass("batchPublisher").
			attr("refresh", "macro").attr("macroName", macroName).
			attr("params", paramString)[0];
		markList.parentNode.insertBefore(listWrapper, markList);
		$.data(listWrapper, "wizard", wizard);
		macro.refresh(listWrapper);
	},
	getCheckedTiddlers: function(listWrapper, titlesOnly) {
		var tiddlers = [];
		$(".chkOptionInput[rowName]:checked", listWrapper).each(function(i, el) {
			var title = $(el).attr("rowName");
			if(titlesOnly) {
				tiddlers.push(title);
			} else {
				tiddlers.push(store.getTiddler(title));
			}
		});
		return tiddlers;
	},
	refresh: function(listWrapper) {
		var checked = macro.getCheckedTiddlers(listWrapper, true);
		var paramString = $(listWrapper).empty().attr("params");
		var wizard = $.data(listWrapper, "wizard");
		var locale = macro.locale;
		var params = paramString.parseParams("anon")[0];
		var publishCandidates = [];
		var status = macro.getMode(paramString);
		var pubType = status[0];
		var newPubType = status[1];
		var tiddlers = params.filter ? store.filterTiddlers(params.filter[0]) :
			store.filterTiddlers("[is[%0]]".format(pubType));
		var enabled = [];
		for(var i = 0; i < tiddlers.length; i++) {
			var tiddler = tiddlers[i];
			var title = tiddler.title;
			if(!tiddler.tags.contains("excludePublisher") && title !== "SystemSettings") {
				publishCandidates.push({ title: title, tiddler: tiddler, status: pubType});
			}
			if(checked.contains(title)) {
				enabled.push("[rowname=%0]".format(title));
			}
		}

		if(publishCandidates.length === 0) {
			createTiddlyElement(listWrapper, "em", null, null, locale.noTiddlersText);
		} else {
			var listView = ListView.create(listWrapper, publishCandidates, macro.listViewTemplate);
			wizard.setValue("listView", listView);
			var btnHandler = function(ev) {
				var tiddlers = macro.getCheckedTiddlers(listWrapper);
				var callback = function(status) {
					$(".batchPublisher").each(function(i, el) {
						macro.refresh(el);
					});
				};
				macro.changeStatus(tiddlers, newPubType, callback);
			};
			wizard.setButtons([{
				caption: locale.changeStatusLabel.format(newPubType),
				tooltip: locale.changeStatusPrompt.format(newPubType),
				onClick: btnHandler
			}]);
			$(enabled.join(",")).attr("checked", true); // retain what was checked before
		}
	}
};

})(jQuery);
//}}}
/***
|''Name''|TiddlySpaceRevertRevision|
|''Description''|Revert to a previous revision|
|''Author''|BenGillies|
|''Version''|0.1|
|''Status''|unstable|
|''Source''|http://github.com/TiddlySpace/tiddlyspace|
|''CodeRepository''|http://github.com/TiddlySpace/tiddlyspace|
|''License''|[[BSD|http://www.opensource.org/licenses/bsd-license.php]]|
|''CoreVersion''|2.6.0|
|''Requires''|TiddlyWebAdaptor TiddlySpaceRevisionView|
!Usage
Add a control button to revert to a particular revision.

The button must be called from within a revision, as generated by TiddlySpaceRevisionView
!Code
***/
//{{{
(function($) {

config.commands.revert = {
	text: "revert",
	tooltip: "make this revision the current one",
	handler: function(ev, src, title) {
		var revElem = story.getTiddler(title);
		var tidToRevert = store.getTiddler($(revElem).attr("revName"));

		var revision = store.getTiddler(title);
		if ((revision) && (tidToRevert)) {
			tidToRevert.text = revision.text;
			var newFields = merge({}, revision.fields);
			for (var fieldName in newFields) {
				if (fieldName.substr(0, 7) === "server.") {
					delete newFields[fieldName];
				}
			}
			merge(tidToRevert.fields, newFields);
			tidToRevert.tags = merge([], revision.tags);
			tidToRevert.fields.changecount = 1;
			delete tidToRevert.fields.doNotSave;

			store.saveTiddler(tidToRevert.title, tidToRevert.title,
				tidToRevert.text, null, null, tidToRevert.tags,
				tidToRevert.fields, false, tidToRevert.created, tidToRevert.creator);

			autoSaveChanges(true);
		}
	}
};

})(jQuery);
//}}}
/***
|''Name''|TiddlySpaceRevisionView|
|''Description''|Show tiddler revisions in a stack of cards view|
|''Author''|BenGillies|
|''Version''|0.2.0|
|''Status''|beta|
|''Source''|http://github.com/TiddlySpace/tiddlyspace|
|''CodeRepository''|http://github.com/TiddlySpace/tiddlyspace|
|''License''|[[BSD|http://www.opensource.org/licenses/bsd-license.php]]|
|''CoreVersion''|2.6.0|
|''Requires''|TiddlyWebAdaptor|
!Usage
The viewRevisions macro can be attached to any element, which should be passed
in as a parameter.

For example:

&lt;&lt;viewRevisions page:10 link:"<<view modified date>>"&gt;&gt;

would show the revisions "stack of cards" view, 10 at a time, when the modified
date is clicked.
!Code
***/
//{{{
(function($) {

var me = config.macros.viewRevisions = {
	revisionTemplate: "RevisionTemplate",
	revSuffix: " [rev. #%0]", // text to append to each tiddler title
	defaultPageSize: 5, // default number of revisions to show
	defaultLinkText: "View Revisions", // when there's nothing else to use
	offsetTop: 30, // in px
	offsetLeft: 10, // in px
	shiftDownDelay: 50, // in ms
	visibleSlideAmount: 20, // amount of revisions to show on left hand edge after sliding
	zIndex: 100, // default z-index
	handler: function(place, macroName, params, wikifier, paramString, tiddler) {
		params = paramString.parseParams(null, null, true)[0];
		var tiddlerElem = story.findContainingTiddler(place);

		var revButton;
		var pageSize = parseInt(params.page[0], 10) || me.defaultPageSize;
		var linkObj = params.link ? params.link[0] || me.defaultLinkText : false;
		if(linkObj) {
			revButton = $('<span class="button openRevisions" />')
				.appendTo(place);
			wikify(linkObj, revButton[0], null, tiddler);
		} else {
			revButton = place;
		}

		$(revButton).click(function() {
			if (!$(tiddlerElem).hasClass("revisions")) {
				me.showRevisions(tiddlerElem, tiddler, pageSize);
			} else {
				me.closeRevisions(tiddlerElem);
			}
		});
	},

	// initialisation for revision view
	showRevisions: function(tiddlerElem, tiddler, pageSize) {
		var context = {
			host: tiddler.fields["server.host"],
			workspace: tiddler.fields["server.workspace"]
		};
		$(tiddlerElem).addClass("revisions").attr("revName", tiddler.title);
		// ensure toolbar commands deactivate RevisionsView
		$("a", ".toolbar", tiddlerElem).each(function(index, btn) {
			var _onclick = btn.onclick;
			btn.onclick = function(e) {
				me.closeRevisions(tiddlerElem);
				_onclick.apply(this, arguments);
			};
		});
		// ensure default action deactivates RevisionsView
		var _ondblclick = tiddlerElem.ondblclick;
		tiddlerElem.ondblclick = function(e) {
			me.closeRevisions(tiddlerElem);
			_ondblclick.apply(this, arguments);
		};
		var type = tiddler.fields["server.type"];
		var adaptor = new config.adaptors[type]();
		var userParams = {
			tiddlerElem: tiddlerElem,
			pageSize: pageSize,
			title: tiddler.title
		};
		me.createCloak(tiddlerElem);
		adaptor.getTiddlerRevisionList(tiddler.title, null, context, userParams,
				function(context, userParams) {
					// strip the current revision
					context.revisions.shift();
					me.expandStack(context, userParams);
				});
	},

	// fetch the actual revision and put it in the tiddler div
	showRevision: function(place, revision, callback) {
		var context = {
			host: revision.fields["server.host"],
			workspace: revision.fields["server.workspace"]
		};
		var userParams = {
			revElem: place
		};
		var type = revision.fields["server.type"];
		var adaptor = new config.adaptors[type]();
		var revNo = revision.fields["server.page.revision"];
		adaptor.getTiddlerRevision(revision.title, revNo, context, userParams,
			function(context, userParams) {
				var tiddler = context.tiddler;
				tiddler.title += me.revSuffix
					.format([$(place).attr("revision")]);
				tiddler.fields.doNotSave = true;
				if (store.getTiddler(tiddler.title)) {
					store.deleteTiddler(tiddler.title);
				}
				store.addTiddler(tiddler);

				//now, populate the existing div
				var revElem = userParams.revElem;
				$(revElem).attr("id", story.tiddlerId(tiddler.title));
				$(revElem).attr("refresh", "tiddler");
				var getTemplate = function() {
					var themeName = config.options.txtTheme;
					if (themeName) {
						return store.getTiddlerSlice(themeName,
							me.revisionTemplate) || me.revisionTemplate ||
							"ViewTemplate";
					} else {
						return (store.getTiddler(me.revisionTemplate)) ?
							me.revisionTemplate : "ViewTemplate";
					}
				};
				var template = getTemplate();
				story.refreshTiddler(tiddler.title, template, true);
				callback(tiddler);
			});
	},

	createCloak: function(promoteElem) {
		var el = $(promoteElem);
		// cache styles for resetting later
		el.data({
			top: el.css("top"),
			left: el.css("left"),
			zIndex: el.css("z-index")
		});

		$('<div class="revisionCloak" />').css("z-index", me.zIndex)
			.click(function() {
				me.closeRevisions(promoteElem);
			})
			.appendTo(document.body);

		el.css("z-index", me.zIndex + 1);
	},

	// clean up, removing all evidence of revision view
	closeRevisions: function(promoteElem) {
		var el = $(promoteElem);
		// revert the original tiddler back to its previous state
		el.removeAttr("revName").removeClass("revisions").css({
			top: el.data("top"),
			left: el.data("left"),
			zIndex: el.data("zIndex")
		});

		// remove any revisions still in the store
		var revisions = $(".revisions");
		revisions.each(function(index, revision) {
			var revAttributes = revision.attributes;
			if ((revAttributes.revname) &&
					(revAttributes.revision)) {
				var revName = revAttributes.revname.value;
				var revNo = revAttributes.revision.value;
				var title = revName + me.revSuffix.format([revNo]);

				if (store.getTiddler(title)) {
					store.deleteTiddler(title);
				}
			}
		});

		// delete the previous revisions
		revisions.remove();

		// remove the cloak
		$(".revisionCloak").remove();
	},

	// calback from getting list of revisions
	expandStack: function(context, userParams) {
		var pageSize = userParams.pageSize;

		var from = userParams.from || 0;
		var tiddlerElem = userParams.tiddlerElem;

		userParams.defaultHeight = $(tiddlerElem).height();
		userParams.defaultWidth = $(tiddlerElem).width();
		if (from < context.revisions.length) {
			me.displayNextRevision(tiddlerElem, userParams, context, from,
				from + pageSize - 1);
		}
	},

	// place the next div above and behind the previous one
	displayNextRevision: function(tiddlerElem, userParams, context, from, to) {
		var revision = context.revisions[from];
		var callback = function() {
			var revText = revBtn.getRevisionText(tiddlerElem, revision);
			tiddlerElem = me.createRevisionObject(tiddlerElem, context,
				userParams, revText);
			$(tiddlerElem)
				.attr("revision", (context.revisions.length - from));
			if ((from < to) && ((from + 1) < context.revisions.length)){
				me.displayNextRevision(tiddlerElem, userParams, context,
					from + 1, to);
			} else if ((context.revisions.length - 1) > to) {
				me.showMoreButton(tiddlerElem, context, userParams, to + 1);
			}
		};
		me.shiftVisibleDown(userParams.title, callback);
	},

	createRevisionObject: function(tiddlerElem, context, userParams, text) {
		var newPosition = me.calculatePosition(tiddlerElem, context);
		return $('<div class="revisions tiddler" />')
			.css({
				position: "absolute",
				top: newPosition.top,
				left: newPosition.left,
				"z-index": me.zIndex + 1,
				height: userParams.defaultHeight,
				width: userParams.defaultWidth
			})
			.attr("revName", userParams.title)
			.append(text)
			.insertBefore(tiddlerElem);
	},

	// move the already present revisions down by 1 to fit the next one in
	shiftVisibleDown: function(title, callback) {
		var revisions = $("[revName='%0'].revisions".format([title]));
		var revisionCount = revisions.length;

		$(revisions).animate({top: "+=" + me.offsetTop},
				me.shiftDownDelay, function() {
					revisionCount -= 1;
					if ((callback) && (!revisionCount)) {
						callback();
					}
				});
	},

	// where we put the new revision
	calculatePosition: function(elem, context) {
		var offset = $(elem).offset();
		var currentPosition = $(elem).position();
		var newPosition = {
			top: currentPosition.top - me.offsetTop
		};
		if ((context.restrictLeft) ||
				((offset.left - me.offsetLeft) <
				$("#contentWrapper").offset().left)) {
			newPosition.left = $(elem).position().left;
			context.restrictLeft = true;
		} else {
			newPosition.left = currentPosition.left - me.offsetLeft;
		}
		return newPosition;
	},

	// equivalent of displayNextRevision, but for the more button
	showMoreButton: function(tiddlerElem, context, userParams, moreIndex) {
		userParams.from = moreIndex + 1;
		me.shiftVisibleDown(userParams.title, function() {
			var btn = me.createRevisionObject(tiddlerElem, context, userParams,
				"");

			var more = createTiddlyButton(btn[0], "more...", "show more revisions",
				function() {
					if ($(".viewRevision").length) {
						return;
					}
					userParams.tiddlerElem = btn[0];
					$(btn).text("")
						.append(revBtn
							.getRevisionText(btn[0], context.revisions[moreIndex]))
						.attr("revision", context.revisions.length - moreIndex);
					me.expandStack(context, userParams);
				});
			$(more).css("float", "right");
		});
	},

	stripRevFromTitle: function(revisionTitle) {
		return revisionTitle.split(/ ?\[rev\. #[0-9]+\]$/)[0];
	},

	onClickRevision: function(revElem, revision, callback) {
		// don't do anything if we are still loading
		if ($(".revisions").hasClass("loading")) {
			return null;
		}

		var origTitle = me.stripRevFromTitle(revision.title);
		if ($(revElem).hasClass("viewRevision")) {
			$(".revisions").addClass("loading");
			me.slideIn(revElem, revision, origTitle, function() {
				store.deleteTiddler(revision.title);
				revision.title = origTitle;
				$(revElem).text("").append(revBtn.getRevisionText(revElem,
						revision))
					.removeAttr("tags").removeAttr("tiddler")
					.removeAttr("refresh").removeAttr("template")
					.removeAttr("id");
				$(".revisions").removeClass("loading");
				if (callback) {
					callback();
				}
			});
			$(revElem).removeAttr("prevPos").removeClass("viewRevision");
		} else {
			var viewRevision = function() {
				var prevPos = $(revElem).position().left;
				$(revElem).addClass("viewRevision").attr("prevPos", prevPos);
				$(".revisions").addClass("loading");
				me.showRevision(revElem, revision, function(rev) {
					me.slideOut(revElem, rev, origTitle, function() {
						$(".revisions").removeClass("loading");
					});
				});
			};
			// make sure another revision isn't already out
			if ($(".viewRevision").length) {
				var newRevElem = $(".viewRevision")[0];
				var newRevision = store.getTiddler($(newRevElem)
					.attr("tiddler"));
				me.onClickRevision(newRevElem, newRevision, viewRevision);
			} else {
				viewRevision();
			}
		}
	},

	slideOut: function(revElem, revision, title, callback) {
		var leftMostPos = $("[revName='%0'].revisions".format([title]))
			.offset().left;
		var width = $(revElem).width();
		var originalLeftPos = $(story.getTiddler(title))
			.position().left;

		var slideAmount = leftMostPos + width - me.visibleSlideAmount;
		$("[revName='%0'].revisions:not(.viewRevision)".format([title]))
			.animate({left: "-=" + slideAmount}, 1000);
		$(revElem)
			.attr("baseHeight", $(revElem).css("height"))
			.css("height", "auto")
			.animate({left: originalLeftPos}, 1000, callback);
	},

	slideIn: function(revElem, revision, title, callback) {
		var slideAmount = $(revElem).offset().left -
			$(story.getTiddler(title)).offset().left;
		var origRevPos = $(revElem).attr("prevPos");

		$("[revName='%0'].revisions:not(.viewRevision)".format([title]))
			.animate({left: "+=" + slideAmount}, 1000);
		$(revElem).animate({left: origRevPos}, 1000, function() {
			$(revElem)
				.css("height", $(revElem).attr("baseHeight"))
				.removeAttr("baseHeight");
			callback();
		});
	}
};

var revBtn;
config.macros.slideRevision = revBtn = {
	btnText: "created by %0 at %1 on %2",
	handler: function(place, macroName, params, wikifier, paramString, tiddler) {
		var btn = revBtn.getRevisionText(place, tiddler);
		$(place).append(btn);
	},

	getRevisionText: function(place, revision) {
		var text = revBtn.btnText.format([revision.modifier,
			revision.modified.formatString("0hh:0mm"),
			revision.modified.formatString("0DD MMM YYYY")]);
		var btn = $('<a href="javascript:;" class="button revButton" />')
			.text(text)
			.click(function() {
				var revElem = story.findContainingTiddler(this);
				me.onClickRevision(revElem, revision);
			});
		return btn;
	}
};

})(jQuery);
//}}}
/***
|''Description''|Sanitisation for dynamically pulling tiddlers into your space and displaying them|
!Notes
Works both inside and outside TiddlyWiki. Uses the HTML Sanitizer provided by the Google Caja project
(see http://code.google.com/p/google-caja/wiki/JsHtmlSanitizer for more on this), which is licensed under
an Apache License (see http://www.apache.org/licenses/LICENSE-2.0).
!Code
***/
//{{{
(function($) {

var cleanURL = function(url) {
	var regexp = /^(?:http|https|mailto|ftp|irc|news):\/\//;
	return (regexp.test(url)) ? url : null;
};

$.sanitize = function(html) {
	return html_sanitize(html, cleanURL);
};

/*
 * HTML Sanitizer, provided by Google Caja
 */

/* Copyright Google Inc.
 * Licensed under the Apache Licence Version 2.0
 * Autogenerated at Tue May 17 17:39:24 BST 2011
 * @provides html4
 */var html4={};html4.atype={NONE:0,URI:1,URI_FRAGMENT:11,SCRIPT:2,STYLE:3,ID:4,IDREF:5,IDREFS:6,GLOBAL_NAME:7,LOCAL_NAME:8,CLASSES:9,FRAME_TARGET:10},html4.ATTRIBS={"*::class":9,"*::dir":0,"*::id":4,"*::lang":0,"*::onclick":2,"*::ondblclick":2,"*::onkeydown":2,"*::onkeypress":2,"*::onkeyup":2,"*::onload":2,"*::onmousedown":2,"*::onmousemove":2,"*::onmouseout":2,"*::onmouseover":2,"*::onmouseup":2,"*::style":3,"*::title":0,"a::accesskey":0,"a::coords":0,"a::href":1,"a::hreflang":0,"a::name":7,"a::onblur":2,"a::onfocus":2,"a::rel":0,"a::rev":0,"a::shape":0,"a::tabindex":0,"a::target":10,"a::type":0,"area::accesskey":0,"area::alt":0,"area::coords":0,"area::href":1,"area::nohref":0,"area::onblur":2,"area::onfocus":2,"area::shape":0,"area::tabindex":0,"area::target":10,"bdo::dir":0,"blockquote::cite":1,"br::clear":0,"button::accesskey":0,"button::disabled":0,"button::name":8,"button::onblur":2,"button::onfocus":2,"button::tabindex":0,"button::type":0,"button::value":0,"canvas::height":0,"canvas::width":0,"caption::align":0,"col::align":0,"col::char":0,"col::charoff":0,"col::span":0,"col::valign":0,"col::width":0,"colgroup::align":0,"colgroup::char":0,"colgroup::charoff":0,"colgroup::span":0,"colgroup::valign":0,"colgroup::width":0,"del::cite":1,"del::datetime":0,"dir::compact":0,"div::align":0,"dl::compact":0,"font::color":0,"font::face":0,"font::size":0,"form::accept":0,"form::action":1,"form::autocomplete":0,"form::enctype":0,"form::method":0,"form::name":7,"form::onreset":2,"form::onsubmit":2,"form::target":10,"h1::align":0,"h2::align":0,"h3::align":0,"h4::align":0,"h5::align":0,"h6::align":0,"hr::align":0,"hr::noshade":0,"hr::size":0,"hr::width":0,"iframe::align":0,"iframe::frameborder":0,"iframe::height":0,"iframe::marginheight":0,"iframe::marginwidth":0,"iframe::width":0,"img::align":0,"img::alt":0,"img::border":0,"img::height":0,"img::hspace":0,"img::ismap":0,"img::name":7,"img::src":1,"img::usemap":11,"img::vspace":0,"img::width":0,"input::accept":0,"input::accesskey":0,"input::align":0,"input::alt":0,"input::autocomplete":0,"input::checked":0,"input::disabled":0,"input::ismap":0,"input::maxlength":0,"input::name":8,"input::onblur":2,"input::onchange":2,"input::onfocus":2,"input::onselect":2,"input::readonly":0,"input::size":0,"input::src":1,"input::tabindex":0,"input::type":0,"input::usemap":11,"input::value":0,"ins::cite":1,"ins::datetime":0,"label::accesskey":0,"label::for":5,"label::onblur":2,"label::onfocus":2,"legend::accesskey":0,"legend::align":0,"li::type":0,"li::value":0,"map::name":7,"menu::compact":0,"ol::compact":0,"ol::start":0,"ol::type":0,"optgroup::disabled":0,"optgroup::label":0,"option::disabled":0,"option::label":0,"option::selected":0,"option::value":0,"p::align":0,"pre::width":0,"q::cite":1,"select::disabled":0,"select::multiple":0,"select::name":8,"select::onblur":2,"select::onchange":2,"select::onfocus":2,"select::size":0,"select::tabindex":0,"table::align":0,"table::bgcolor":0,"table::border":0,"table::cellpadding":0,"table::cellspacing":0,"table::frame":0,"table::rules":0,"table::summary":0,"table::width":0,"tbody::align":0,"tbody::char":0,"tbody::charoff":0,"tbody::valign":0,"td::abbr":0,"td::align":0,"td::axis":0,"td::bgcolor":0,"td::char":0,"td::charoff":0,"td::colspan":0,"td::headers":6,"td::height":0,"td::nowrap":0,"td::rowspan":0,"td::scope":0,"td::valign":0,"td::width":0,"textarea::accesskey":0,"textarea::cols":0,"textarea::disabled":0,"textarea::name":8,"textarea::onblur":2,"textarea::onchange":2,"textarea::onfocus":2,"textarea::onselect":2,"textarea::readonly":0,"textarea::rows":0,"textarea::tabindex":0,"tfoot::align":0,"tfoot::char":0,"tfoot::charoff":0,"tfoot::valign":0,"th::abbr":0,"th::align":0,"th::axis":0,"th::bgcolor":0,"th::char":0,"th::charoff":0,"th::colspan":0,"th::headers":6,"th::height":0,"th::nowrap":0,"th::rowspan":0,"th::scope":0,"th::valign":0,"th::width":0,"thead::align":0,"thead::char":0,"thead::charoff":0,"thead::valign":0,"tr::align":0,"tr::bgcolor":0,"tr::char":0,"tr::charoff":0,"tr::valign":0,"ul::compact":0,"ul::type":0},html4.eflags={OPTIONAL_ENDTAG:1,EMPTY:2,CDATA:4,RCDATA:8,UNSAFE:16,FOLDABLE:32,SCRIPT:64,STYLE:128},html4.ELEMENTS={a:0,abbr:0,acronym:0,address:0,applet:16,area:2,b:0,base:18,basefont:18,bdo:0,big:0,blockquote:0,body:49,br:2,button:0,canvas:0,caption:0,center:0,cite:0,code:0,col:2,colgroup:1,dd:1,del:0,dfn:0,dir:0,div:0,dl:0,dt:1,em:0,fieldset:0,font:0,form:0,frame:18,frameset:16,h1:0,h2:0,h3:0,h4:0,h5:0,h6:0,head:49,hr:2,html:49,i:0,iframe:4,img:2,input:2,ins:0,isindex:18,kbd:0,label:0,legend:0,li:1,link:18,map:0,menu:0,meta:18,nobr:0,noframes:20,noscript:20,object:16,ol:0,optgroup:0,option:1,p:1,param:18,pre:0,q:0,s:0,samp:0,script:84,select:0,small:0,span:0,strike:0,strong:0,style:148,sub:0,sup:0,table:0,tbody:1,td:1,textarea:8,tfoot:1,th:1,thead:1,title:24,tr:1,tt:0,u:0,ul:0,"var":0},html4.ueffects={NOT_LOADED:0,SAME_DOCUMENT:1,NEW_DOCUMENT:2},html4.URIEFFECTS={"a::href":2,"area::href":2,"blockquote::cite":0,"body::background":1,"del::cite":0,"form::action":2,"img::src":1,"input::src":1,"ins::cite":0,"q::cite":0},html4.ltypes={UNSANDBOXED:2,SANDBOXED:1,DATA:0},html4.LOADERTYPES={"a::href":2,"area::href":2,"blockquote::cite":2,"body::background":1,"del::cite":2,"form::action":2,"img::src":1,"input::src":1,"ins::cite":2,"q::cite":2};var html=function(a){function x(b,c,d){var e=[];w(function(b,e){for(var f=0;f<e.length;f+=2){var g=e[f],h=e[f+1],i=null,j;if((j=b+"::"+g,a.ATTRIBS.hasOwnProperty(j))||(j="*::"+g,a.ATTRIBS.hasOwnProperty(j)))i=a.ATTRIBS[j];if(i!==null)switch(i){case a.atype.NONE:break;case a.atype.SCRIPT:case a.atype.STYLE:h=null;break;case a.atype.ID:case a.atype.IDREF:case a.atype.IDREFS:case a.atype.GLOBAL_NAME:case a.atype.LOCAL_NAME:case a.atype.CLASSES:h=d?d(h):h;break;case a.atype.URI:h=c&&c(h);break;case a.atype.URI_FRAGMENT:h&&"#"===h.charAt(0)?(h=d?d(h):h,h&&(h="#"+h)):h=null;break;default:h=null}else h=null;e[f+1]=h}return e})(b,e);return e.join("")}function w(b){var c,d;return v({startDoc:function(a){c=[],d=!1},startTag:function(e,f,g){if(!d){if(!a.ELEMENTS.hasOwnProperty(e))return;var h=a.ELEMENTS[e];if(h&a.eflags.FOLDABLE)return;if(h&a.eflags.UNSAFE){d=!(h&a.eflags.EMPTY);return}f=b(e,f);if(f){h&a.eflags.EMPTY||c.push(e),g.push("<",e);for(var i=0,j=f.length;i<j;i+=2){var k=f[i],l=f[i+1];l!==null&&l!==void 0&&g.push(" ",k,'="',r(l),'"')}g.push(">")}}},endTag:function(b,e){if(d)d=!1;else{if(!a.ELEMENTS.hasOwnProperty(b))return;var f=a.ELEMENTS[b];if(!(f&(a.eflags.UNSAFE|a.eflags.EMPTY|a.eflags.FOLDABLE))){var g;if(f&a.eflags.OPTIONAL_ENDTAG)for(g=c.length;--g>=0;){var h=c[g];if(h===b)break;if(!(a.ELEMENTS[h]&a.eflags.OPTIONAL_ENDTAG))return}else for(g=c.length;--g>=0;)if(c[g]===b)break;if(g<0)return;for(var i=c.length;--i>g;){var h=c[i];a.ELEMENTS[h]&a.eflags.OPTIONAL_ENDTAG||e.push("</",h,">")}c.length=g,e.push("</",b,">")}}},pcdata:function(a,b){d||b.push(a)},rcdata:function(a,b){d||b.push(a)},cdata:function(a,b){d||b.push(a)},endDoc:function(a){for(var b=c.length;--b>=0;)a.push("</",c[b],">");c.length=0}})}function v(c){return function(d,e){d=String(d);var f=null,g=!1,h=[],j=void 0,l=void 0,m=void 0;c.startDoc&&c.startDoc(e);while(d){var n=d.match(g?t:u);d=d.substring(n[0].length);if(g){if(n[1]){var o=b(n[1]),p;if(n[2]){var q=n[3];switch(q.charCodeAt(0)){case 34:case 39:q=q.substring(1,q.length-1)}p=k(i(q))}else p=o;h.push(o,p)}else if(n[4]){l!==void 0&&(m?c.startTag&&c.startTag(j,h,e):c.endTag&&c.endTag(j,e));if(m&&l&(a.eflags.CDATA|a.eflags.RCDATA)){f===null?f=b(d):f=f.substring(f.length-d.length);var r=f.indexOf("</"+j);r<0&&(r=d.length),l&a.eflags.CDATA?c.cdata&&c.cdata(d.substring(0,r),e):c.rcdata&&c.rcdata(s(d.substring(0,r)),e),d=d.substring(r)}j=l=m=void 0,h.length=0,g=!1}}else if(n[1])c.pcdata&&c.pcdata(n[0],e);else if(n[3])m=!n[2],g=!0,j=b(n[3]),l=a.ELEMENTS.hasOwnProperty(j)?a.ELEMENTS[j]:void 0;else if(n[4])c.pcdata&&c.pcdata(n[4],e);else if(n[5]&&c.pcdata)switch(n[5]){case"<":c.pcdata("&lt;",e);break;case">":c.pcdata("&gt;",e);break;default:c.pcdata("&amp;",e)}}c.endDoc&&c.endDoc(e)}}function s(a){return a.replace(m,"&amp;$1").replace(n,"&lt;").replace(o,"&gt;")}function r(a){return a.replace(l,"&amp;").replace(n,"&lt;").replace(o,"&gt;").replace(p,"&#34;").replace(q,"&#61;")}function k(a){return a.replace(j,g)}function i(a){return a.replace(h,"")}function g(a,b){return f(b)}function f(a){a=b(a);if(c.hasOwnProperty(a))return c[a];var f=a.match(d);if(f)return String.fromCharCode(parseInt(f[1],10));if(!!(f=a.match(e)))return String.fromCharCode(parseInt(f[1],16));return""}var b;"script"==="SCRIPT".toLowerCase()?b=function(a){return a.toLowerCase()}:b=function(a){return a.replace(/[A-Z]/g,function(a){return String.fromCharCode(a.charCodeAt(0)|32)})};var c={lt:"<",gt:">",amp:"&",nbsp:"240",quot:'"',apos:"'"},d=/^#(\d+)$/,e=/^#x([0-9A-Fa-f]+)$/,h=/\0/g,j=/&(#\d+|#x[0-9A-Fa-f]+|\w+);/g,l=/&/g,m=/&([^a-z#]|#(?:[^0-9x]|x(?:[^0-9a-f]|$)|$)|$)/gi,n=/</g,o=/>/g,p=/\"/g,q=/\=/g,t=new RegExp("^\\s*(?:(?:([a-z][a-z-]*)(\\s*=\\s*(\"[^\"]*\"|'[^']*'|(?=[a-z][a-z-]*\\s*=)|[^>\"'\\s]*))?)|(/?>)|[\\s\\S][^a-z\\s>]*)","i"),u=new RegExp("^(?:&(\\#[0-9]+|\\#[x][0-9a-f]+|\\w+);|<!--[\\s\\S]*?-->|<!\\w[^>]*>|<\\?[^>*]*>|<(/)?([a-z][a-z0-9]*)|([^<&>]+)|([<&>]))","i");return{escapeAttrib:r,makeHtmlSanitizer:w,makeSaxParser:v,normalizeRCData:s,sanitize:x,unescapeEntities:k}}(html4),html_sanitize=html.sanitize

// stop here if we're not in TiddlyWiki
// XXX: is this the correct way of checking for TiddlyWiki?
if (!window.TiddlyWiki || !window.store || !store instanceof TiddlyWiki) {
	return;
}

var tiddlyspace = config.extensions.tiddlyspace;

var _subWikify = Wikifier.prototype.subWikify;

var cleanedTitle = 'This section has been cleaned of any potentially harmful code';

var replaceFunctions = {
	html: function(w) {
		var sanitizedHTML, spanEl;
		this.lookaheadRegExp.lastIndex = w.matchStart;
		var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
		if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
			sanitizedHTML = $.sanitize(lookaheadMatch[1]);
			spanEl = createTiddlyElement(w.output, 'span', null, 'sanitized');
			spanEl.innerHTML = sanitizedHTML;
			spanEl.setAttribute('title', cleanedTitle);
			w.nextMatch = this.lookaheadRegExp.lastIndex;
		}
	},
	customFormat: function(w) {
		switch(w.matchText) {
			case '@@':
				var e = createTiddlyElement(w.output, 'span');
				var styles = config.formatterHelpers.inlineCssHelper(w);
				if (styles.length === 0) {
					e.className = 'marked';
				}
				w.subWikifyTerm(e, /(@@)/mg);
				break;
			case '{{':
				var lookaheadRegExp = /\{\{[\s]*([\w]+[\s\w]*)[\s]*\{(\n?)/mg;
				lookaheadRegExp.lastIndex = w.matchStart;
				var lookaheadMatch = lookaheadRegExp.exec(w.source);
				if(lookaheadMatch) {
					w.nextMatch = lookaheadRegExp.lastIndex;
					e = createTiddlyElement(w.output,lookaheadMatch[2] == "\n" ? "div" : "span",null,lookaheadMatch[1]);
					w.subWikifyTerm(e,/(\}\}\})/mg);
				}
				break;
		}
	}
};

Wikifier.prototype.subWikify = function(output, terminator) {
	var tid = this.tiddler,
		spaceName = tiddlyspace.currentSpace.name,
		tidSpace, recipeName, stripped;
	try {
		recipeName = tid.fields['server.recipe'] ||
			tid.fields['server.workspace'];
		tidSpace = tiddlyspace.resolveSpaceName(recipeName);
		if (tidSpace !== spaceName) {
			// external tiddler, so replace dangerous formatters
			stripped = stripHTML(tid, this.formatter);
		}
	} catch(e) {
		// do nothing. There's no tiddler, so assume it's safe (?!?!?)
	}

	_subWikify.apply(this, arguments);

	if (stripped) {
		// change back to the original function
		unstripHTML(stripped, this.formatter);
	}
};

// replace potentially unsafe formatters with versions that strip bad HTML/CSS
var stripHTML = function(tid, formatter) {
	var popped = {}, _handler;
	for (var i = 0; i < formatter.formatters.length; i++) {
		var f = formatter.formatters[i];
		if (replaceFunctions[f.name]) {
			_handler = f.handler;
			popped[f.name] = _handler;
			f.handler = replaceFunctions[f.name];
		}
	};

	return popped;
};

// put the original formatters back where they belong
var unstripHTML = function(stripped, formatter) {
	for (var i = 0; i < formatter.formatters.length; i++) {
		var f = formatter.formatters[i];
		if (stripped[f.name]) {
			f.handler = stripped[f.name];
		}
	};
};

})(jQuery);
//}}}
/***
|''Name''|TiddlySpaceSearcher|
|''Version''|0.2.5|
|''Requires''|TiddlySpaceConfig TiddlySpaceFollowingPlugin|
***/
//{{{
(function($) {
var tiddlyspace = config.extensions.tiddlyspace;
var tsScan = config.macros.tsScan;

config.shadowTiddlers.SearchTemplate = "<<view server.bag SiteIcon label:no width:24 height:24 preserveAspectRatio:yes>> <<view server.bag spaceLink title external:no>> in space <<view server.bag spaceLink>>";
config.shadowTiddlers.StyleSheetSearch = [".resultsArea .siteIcon { display: inline; }",
	".searchForm {text-align: left;}"].join("\n");
store.addNotification("StyleSheetSearch", refreshStyles);

var search = config.macros.tsSearch = {
	locale: {
		advanced: "Advanced Options",
		header: "Search",
		resultsHeader: "Results (%0)",
		find: "find",
		noResults: "No tiddlers matched your search query",
		query: "QUERY: ",
		error: "please provide a search query or a tag, modifier or title!",
		titleAdvanced: "where the title is",
		modifierAdvanced: "where the last modifier is",
		spaceAdvanced: "only in the space: ",
		notspaceAdvanced: "but not in the spaces: ",
		tagsAdvanced: "with the tags: "
	},
	andConstructor: function(container, label, fieldname, negationMode) {
		var tags = $("<div />").appendTo(container);
		$('<span />').text(label).appendTo(tags);
		var id = "area" + Math.random();
		container = $("<span />").attr("id", id).appendTo(tags)[0];
		function add(container) {
			var el = $('<input type="text" />').attr("field", fieldname).appendTo(container);
			if(negationMode) {
				el.attr("negation", "true");
			}
		}
		add(container);
		var el = $("<button />").text("AND").click(function(ev) {
			add($(ev.target).data("container"));
			ev.preventDefault();
		}).appendTo(tags);
		$(el).data("container", container);
	},
	fieldConstructor: function(container, label, field) {
		container = $("<div />").appendTo(container)[0];
		$("<span />").text(label).appendTo(container);
		$("<input />").attr("text", "input").attr("field", field).appendTo(container);
	},
	advancedOptions: function(form) {
		var locale = search.locale;
		var container = $("<div />").addClass("tsAdvancedOptions").appendTo(form)[0];
		$("<h2/ >").text(search.locale.advanced).appendTo(container);
		$("<div />").addClass("separator").appendTo(container);
		search.fieldConstructor(container, locale.titleAdvanced, "title");
		search.fieldConstructor(container, locale.modifierAdvanced, "modifier");
		search.fieldConstructor(container, locale.spaceAdvanced, "space");
		search.andConstructor(container, locale.notspaceAdvanced, "space", true);
		search.andConstructor(container, locale.tagsAdvanced, "tag");
	},
	constructSearchQuery: function(form) {
		var data = [], select = [];
		var query = $("[name=q]", form).val();
		if(query) {
			data.push("q=%0".format(query));
		}

		// add tags, fields etc..
		$("[field]", form).each(function(i, el) {
			var val = $(el).val();
			var name = $(el).attr("field");
			var negate = $(el).attr("negation") == "true";
			if(val && name) {
				val = encodeURIComponent(val);
				val = negate ? "!" + val : val;
				if(name == "space") {
					val += "_public";
					name = "bag";
				}
				if(negate) {
					select.push("select=%0:%1".format(name,val));
				} else {
					var prefix = data.length === 0 ? "q=" : "";
					data.push('%0%1:"%2"'.format(prefix, name, val));
				}
			}
		});
		var dataString = data.join(" ");
		if(dataString.length === 0 && !query) {
			return false;
		}
		var selectStatement = select.join("&");
		if(dataString.length > 0 && selectStatement.length > 0) {
			dataString += "&";
		}
		dataString += selectStatement;
		return "/search?%0".format(dataString);
	},
	constructForm: function(place) {
		var locale = search.locale;
		$("<h1 />").text(locale.header).appendTo(place);
		var form = $("<form />").appendTo(place)[0];
		$('<input type="text" name="q" />').appendTo(form);
		$('<input type="submit" />').val(locale.find).appendTo(form);
		search.advancedOptions(form);
		var query = $('<h2 class="query"/>').appendTo(place)[0];
		var results = $("<div />").appendTo(place).addClass("resultsArea")[0];
		var lookup = function(url) {
			if(!url) {
				results.empty().addClass("error").text(locale.error);
				return;
			}
			config.extensions.tiddlyweb.getStatus(function(status) {
				$(query).text(locale.query);
				var href = status.server_host.url + url;
				$("<a />").attr("href", href).text(href).appendTo(query);
				tsScan.scan(results, { url: url, emptyMessage: search.locale.noResults, cache: true,
					template: "SearchTemplate", sort: "title", callback: function(tiddlers) {
						$("<h2 />").text(locale.resultsHeader.format(tiddlers.length)).prependTo(results);
					}
				});
			});
		};
		$(form).submit(function(ev) {
			ev.preventDefault();
			var url = search.constructSearchQuery(form);
			config.macros.tsSearch.lastSearch = url;
			lookup(url);
		});
		if(search.lastSearch) {
			lookup(search.lastSearch);
		}
		return form;
	},
	handler: function(place) {
		var container = $("<div />").addClass("searchForm").appendTo(place)[0];
		search.constructForm(container);
	}
};

})(jQuery);
//}}}
!Spaces
<<groupBy server.bag>>

!Private
<<list filter [is[private]]>>

!Public
<<list filter [is[public]]>>

!Drafts
<<list filter [is[draft]]>>
/***
|''Name''|TiddlySpaceTiddlerIconsPlugin|
|''Version''|0.8.10|
|''Status''|@@beta@@|
|''Author''|Jon Robson|
|''Description''|Provides ability to render SiteIcons and icons that correspond to the home location of given tiddlers|
|''Source''|http://github.com/TiddlySpace/tiddlyspace/raw/master/src/plugins/TiddlySpaceTiddlerIconsPlugin.js|
|''Requires''|TiddlySpaceConfig BinaryTiddlersPlugin ImageMacroPlugin TiddlySpacePublishingCommands|
!Notes
{{{<<tiddlerOrigin>>}}} shows the origin of the tiddler it is being run on.
In TiddlySpace terms this means it will determine whether the tiddler is external, public or private.
Where private it will analyse whether a public version exists and distinguish between the different scenarios.
If a tiddler is external, the SiteIcon of that external space will be shown

!Parameters
width / height : define a width or height of the outputted icon
label: if label parameter is set to yes, a label will accompany the icon.
!Code
***/
//{{{
(function($) {

if(!config.macros.image) {
	throw "Missing dependency: ImageMacroPlugin";
}

var imageMacro = config.macros.image;
var tiddlyspace = config.extensions.tiddlyspace;
var tweb = config.extensions.tiddlyweb;
var cmds = config.commands;
var cmd = cmds.publishTiddler;
tiddlyspace.resolveSpaceName = function(value) {
	var endsWith = config.extensions.BinaryTiddlersPlugin.endsWith;
	if(value) {
		value = value.indexOf("bags/") === 0 ? value.substr(5) : value;
		value = value.indexOf("recipes/") === 0 ? value.substr(8) : value;
		if(value.indexOf("@") === 0) {
			value = value.substr(1);
		}
		if(endsWith(value, "_public")) {
			value = value.substr(0, value.length - 7);
		} else if(endsWith(value, "_private")) {
			value = value.substr(0, value.length - 8);
		}
		value = value.toLowerCase();
	}
	return value;
};

tiddlyspace.renderAvatar = function(place, value, options) {
	options = options ? options : {};
	options.labelOptions = options.labelOptions ? options.labelOptions : { include: false, height: 48, width: 48 };
	options.imageOptions = options.imageOptions ? options.imageOptions : {};
	options.imageOptions.altImage = "/bags/common/tiddlers/defaultUserIcon";
	var container = $('<div class="siteIcon" />').appendTo(place);
	value = tiddlyspace.resolveSpaceName(value);

	tweb.getStatus(function(status) {
		var link, noLabel;
		if(!value || value == config.views.wikified.defaultModifier ||
			value == config.views.wikified.shadowModifier) {
			var icon = config.views.wikified.shadowModifier == value ? "shadowIcon" : "missingIcon";
			if(store.tiddlerExists(icon)) {
				imageMacro.renderImage(container, icon, options.imageOptions);
			} else {
				noLabel = true;
			}
		} else {
			var spaceURI;
			if(value != tiddlyspace.currentSpace.name) {
				spaceURI = options.notSpace ? tiddlyspace.getHost(status.server_host) :
					tiddlyspace.getHost(status.server_host, value);
			}
			link = spaceURI ? $("<a />").attr("href", spaceURI) : $("<span />");
			link.text(value);

			var imageOptions = options.imageOptions;
			if(options.spaceLink && !imageOptions.link) {
				imageOptions.link = spaceURI;
			}
			var avatar = options.notSpace ? false : value;
			var uri = tiddlyspace.getAvatar(status.server_host, avatar);
			imageMacro.renderImage(container, uri, options.imageOptions);
			if(!value) {
				value = "tiddlyspace";
			}
		}
		if(!noLabel && options.labelOptions.include) {
			var prefix = $("<span />").text(options.labelOptions.prefix || "")[0];
			var suffix = $("<span />").text(options.labelOptions.suffix || "")[0];
			$('<div class="label" />').append(prefix).append(link).
				append(suffix).appendTo(container);
		}
	});
	if(value) {
		var prefix = options.labelOptions.prefix || "";
		var suffix = options.labelOptions.suffix || "";
		var label = "%0%1%2".format(prefix, value, suffix);
		$(container).attr("title", label);
	}
};

var originMacro = config.macros.tiddlerOrigin = {
	locale: {
		"shadow": "shadow tiddler",
		"missing": "missing tiddler",
		"private": "private",
		"unknown": "unknown state",
		"public": "public",
		"unsyncedPrivate": "unsynced and private",
		"unsyncedPublic": "unsynced and public",
		externalPrefix: "from ",
		externalBagSuffix: " bag",
		externalSuffix: " space",
		publishPrivateDeletePrivate: "Are you sure you want to make this tiddler public?",
		moveToPrivate: "Are you sure you want to make this tiddler private? Only members will be able to see it.",
		pleaseWait: "please wait..",
		keepPublic: "keep public",
		cannotPublishDirtyTiddler: "The current tiddler is unsaved so cannot be published. Please save the tiddler first.",
		keepPrivate: "keep private",
		makePublic: "make public",
		makePrivate: "make private"
	},
	handler: function(place, macroName, params,wikifier, paramString, tiddler){
		var adaptor = tiddler.getAdaptor();
		var btn = $("<div />").addClass("originButton").attr("params", paramString).
			attr("refresh", "macro").attr("macroName", macroName).appendTo(place)[0];
		$(btn).data("tiddler", tiddler);
		originMacro.refresh(btn);
	},
	refresh: function(btn) {
		$(btn).empty();
		var paramString = $(btn).attr("params");
		var tiddler = $(btn).data("tiddler");
		var options = originMacro.getOptions(paramString);
		var type = tiddlyspace.getTiddlerStatusType(tiddler);
		originMacro.renderIcon(tiddler, type, btn, options);
	},
	getOptions: function(paramString) {
		paramString = "%0 label:no width:48 height:48 spaceLink:yes preserveAspectRatio:yes".format(paramString);
		var parsedParams = paramString.parseParams("name");
		var params = parsedParams[0].name;
		var options = {
			labelOptions: originMacro._getLabelOptions(parsedParams),
			imageOptions: imageMacro.getArguments(paramString, []),
			noclick: parsedParams[0].interactive &&
				parsedParams[0].interactive[0] == "no" ? true : false
		};
		if(!options.noclick) {
			var spaceLink = parsedParams[0].spaceLink;
			options.spaceLink = spaceLink && spaceLink[0] == "no" ? false : true;
		} else {
			options.spaceLink = false;
		}
		return options;
	},
	_getLabelOptions: function(parsedParams) {
		parsedParams = parsedParams[0];
		var includeLabel = !parsedParams.label || ( parsedParams.label && parsedParams.label[0] == "yes" );
		var prefix = parsedParams.labelPrefix ? parsedParams.labelPrefix[0] : false;
		var suffix = parsedParams.labelSuffix ? parsedParams.labelSuffix[0] : false;
		return { include: includeLabel, suffix: suffix, prefix: prefix };
	},
	_isSpace: function(value) {
		value = value ? value : "";
		var endsWith = config.extensions.BinaryTiddlersPlugin.endsWith;
		if(endsWith(value, "_private") || endsWith(value, "_public")) {
			return true;
		} else {
			return false;
		}
	},
	renderIcon: function(tiddler, type, button, options) {
		var locale = originMacro.locale;
		originMacro.annotateTiddler(button, type);
		if(type != "external") {
			originMacro.showPrivacyRoundel(tiddler, type, button,
				options);
		} else {
			var prefix = options.labelOptions.prefix, suffix = options.labelOptions.suffix;
			var space = tiddler.fields["server.bag"];
			options.notSpace = !originMacro._isSpace(space);
			options.labelOptions.prefix = prefix ? prefix : locale.externalPrefix;
			options.labelOptions.suffix = suffix ? suffix : (options.notSpace ? locale.externalBagSuffix : locale.externalSuffix);

			tiddlyspace.renderAvatar(button, space, options);
		}
	},
	showPrivacyRoundel: function(thisTiddler, privacyType, button, options) {
		// there is a public tiddler as well as the current tiddler!
		// TODO: not this is not enough.. we also need to check if the public tiddler is the same as..
		// .. the private tiddler to determine whether this is a draft
		// use of hashes would be useful here.
		$(button).empty();
		var icon = "%0Icon".format(privacyType);
		if(privacyType.indexOf("unsynced") === 0 && !store.tiddlerExists(icon)) {
			icon = "unsyncedIcon";
		}
		if(privacyType == "shadow") {
			if(!store.tiddlerExists(icon)) {
				icon = "bags/tiddlyspace/tiddlers/SiteIcon";
			}
		}
		if(privacyType == "missing" && !store.tiddlerExists(icon)) {
			return; // the user is not making use of the missingIcon
		} else {
			imageMacro.renderImage(button, icon, options.imageOptions);
			originMacro.showLabel(button, privacyType, options.labelOptions);
			var cmd = originMacro.iconCommands[privacyType];
			if(cmd && thisTiddler && !options.noclick) {
				$(button).click(function(ev) {
					cmd(ev, thisTiddler);
				});
			}
		}
	},
	annotateTiddler: function(place, type) {
		var tidEl = $(story.findContainingTiddler(place));
		tidEl.
			removeClass("private public external privateAndPublic privateNotPublic shadow").
			addClass(type);
	},
	showLabel: function(button, type, options) {
		var locale = originMacro.locale;
		var label = options.label ? options.label : locale[type];
		label = label ? label : locale.unknown;
		if(options && options.include) {
			$('<div class="roundelLabel" />').html(label).appendTo(button);
		}
		$(button).attr("title", label);
	},
	confirm: function(ev, msg, onYes, options) {
		options = options ? options : {};
		onYes = onYes ? onYes : function(ev) {};
		var btn = $(".originButton", $(ev.target).parents())[0];
		var popup = Popup.create(btn);
		$(popup).addClass("confirmationPopup");
		$("<div />").addClass("message").text(msg).appendTo(popup);
		$("<button />").addClass("button").text(options.yesLabel || "yes").appendTo(popup).click(onYes);
		$("<button />").addClass("button").text(options.noLabel || "no").click(function(ev) {
			Popup.remove();
		}).appendTo(popup);
		Popup.show();
		ev.stopPropagation();
		return false;
	},
	alert: function(ev, msg) {
		var popup = Popup.create(ev.target);
		$(popup).addClass("confirmationPopup alert");
		$("<div />").addClass("message").text(msg).appendTo(popup);
		Popup.show();
		ev.stopPropagation();
	},
	reportDirty: function(el) {
		originMacro.alert(el, originMacro.locale.cannotPublishDirtyTiddler);
	},
	iconCommands: {
		"public": function(ev, tiddler) {
			if(!readOnly) {
				var locale = originMacro.locale;
				var msg = locale.moveToPrivate;
				if(story.isDirty(tiddler.title)) {
					originMacro.reportDirty(ev);
				} else {
					originMacro.confirm(ev, msg, function(ev) {
						var target = $(ev.target);
						var onComplete = function(info) {};
						var privateBag = cmd.toggleBag(tiddler, "private");
						cmd.moveTiddler(tiddler, {
							title: tiddler.title,
							fields: { "server.bag": privateBag }
						}, onComplete);
					}, { yesLabel: locale.makePrivate, noLabel: locale.keepPublic });
				}
			}
		},
		"private": function(ev, tiddler) {
			if(!readOnly) {
				var locale = originMacro.locale;
				var adaptor = tiddler.getAdaptor();
				var publishTo = tiddler.fields["publish.name"] || tiddler.title;
				var workspace = "bags/%0".format(tiddler.fields["server.bag"]);
				tiddler.fields["server.workspace"] = workspace;
				var publicBag = cmd.toggleBag(tiddler, "public");
				var msg;
				msg = locale.publishPrivateDeletePrivate;
				var title = tiddler.title;
				var newTitle = publishTo || tiddler.title;
				tiddler.fields["server.page.revision"] = "false";
				store.addTiddler(tiddler);
				if(story.isDirty(tiddler.title)) {
					originMacro.reportDirty(ev);
				} else {
					originMacro.confirm(ev, msg, function(ev) {
						var onComplete = function(info) {};
						cmd.moveTiddler(tiddler, {
							title: newTitle,
							fields: { "server.bag": publicBag }
						}, onComplete);
					}, { yesLabel: locale.makePublic, noLabel: locale.keepPrivate });
				}
			}
		}
	}
};

})(jQuery);
//}}}
/***
|''Name''|TiddlySpaceToolbar|
|''Description''|augments tiddler toolbar commands with SVG icons|
|''Author''|Osmosoft|
|''Version''|0.6.6|
|''Status''|@@beta@@|
|''Source''|http://github.com/TiddlySpace/tiddlyspace/raw/master/src/plugins/TiddlySpaceToolbar.js|
|''CodeRepository''|http://github.com/TiddlySpace/tiddlyspace|
|''License''|[[BSD|http://www.opensource.org/licenses/bsd-license.php]]|
|''CoreVersion''|2.5.0|
|''Requires''|ImageMacroPlugin|
|''Keywords''|toolbar icons SVG|
!Description
replaces tiddler toolbar commands with SVG icons if available
!Notes
requires [[ImageMacroPlugin|http://svn.tiddlywiki.org/Trunk/contributors/JonRobson/plugins/ImageMacroPlugin/plugins/ImageMacroPlugin.tid]]

SVG icons are drawn from tiddlers titled {{{<command>.svg}}}
In readonly mode a tiddler called {{{<command>ReadOnly.svg}}} will be used if it exists.
!TODO
* rename (IconToolbarPlugin?)
* support more than one more popup menu in the toolbar.
!Code
***/
//{{{
(function($) {

if(!config.macros.image) {
	throw "Missing dependency: ImageMacroPlugin";
}

var macro = config.macros.toolbar;

macro.icons = {
	cloneTiddler: "editTiddler"
};

var _handler = macro.handler;
macro.handler = function(place, macroName, params, wikifier,
		paramString, tiddler) {
	var toolbar = $(place);
	toolbar.attr({
		refresh: "macro",
		macroName: macroName
	}).data("args", arguments);
	var status = _handler.apply(this, arguments);
	if(tiddler.isReadOnly()) {
		toolbar.addClass("toolbarReadOnly");
	} else {
		toolbar.removeClass("toolbarReadOnly");
	}
	var parsedParams = paramString.parseParams("name")[0];
	if(parsedParams.icons && parsedParams.icons == "yes") {
		this.augmentCommandButtons(place);
	}
	if(parsedParams.more && parsedParams.more == "popup") {
		// note we must override the onclick event like in createTiddlyButton
		// otherwise the click event is the popup AND the slider
		$(".moreCommand", place).each(function(i, el) {
			el.onclick = macro.onClickMorePopUp;
		});
		// buttons that are after a less command should not be in more menu.
		$(".lessCommand ~ .button", place).appendTo(place);
		$(".lessCommand", place).remove();
	}
	return status;
};

macro.refresh = function(place, params) {
	var args = $(place).empty().data("args");
	this.handler.apply(this, args);
};

var imageMacro = config.macros.image;
macro.augmentCommandButtons = function(toolbar) {
	$(".button", toolbar).each(function(i, el) {
		var cmd = $(el).attr("commandname");
		cmd = cmd ? cmd : "moreCommand"; // XXX: special-casing of moreCommand due to ticket #1234
		var icon = store.tiddlerExists(cmd) ? cmd : macro.icons[cmd];
		var text = $(el).text();
		if(readOnly) {
			var readOnlyAlternative = "%0ReadOnly".format([icon]);
			if(store.tiddlerExists(readOnlyAlternative)) {
				icon = readOnlyAlternative;
			}
		}
		if(store.tiddlerExists(icon)) {
			$(el).css({display: "inline-block"}).empty();
			imageMacro.renderImage(el, icon, { alt: text });
		}
	});
};

// provide onClickMore to provide extra commands in a popup
macro.onClickMorePopUp = function(ev) {
	ev = ev || window.event;
	var sibling = this.nextSibling;
	if(sibling) {
		var commands = sibling.childNodes;
		var popup = Popup.create(this);
		$(popup).addClass("taggedTiddlerList");
		for(var i = 0; i < commands.length; i++) {
			var li = createTiddlyElement(popup, "li", null);
			var oldCommand = commands[i];
			var command = oldCommand.cloneNode(true);
			command.onclick = oldCommand.onclick;
			li.appendChild(command);
		}
		Popup.show();
	}
	ev.cancelBubble = true;
	if(ev.stopPropagation) {
		ev.stopPropagation();
	}
	return false;
};

})(jQuery);
//}}}
/***
|''Name''|TiddlySpaceViewTypes|
|''Version''|0.6.0|
|''Status''|@@beta@@|
|''Description''|Provides TiddlySpace specific view types|
|''Author''|Jon Robson|
|''Source''|http://github.com/TiddlySpace/tiddlyspace/raw/master/src/plugins/TiddlySpaceViewTypes.js|
|''Requires''|TiddlySpaceConfig TiddlySpaceTiddlerIconsPlugin|
!Usage
Provides replyLink, spaceLink and SiteIcon view types.
!!SiteIcon view parameters
* labelPrefix / labelSuffix : prefix or suffix the label with additional text. eg. labelPrefix:'modified by '
* spaceLink: if set to "yes" will make any avatars link to the corresponding space. {{{<<originMacro spaceLink:yes>>}}}

!Code
***/
//{{{
(function($) {

var tiddlyspace = config.extensions.tiddlyspace;
var originMacro = config.macros.tiddlerOrigin;
var tweb = config.extensions.tiddlyweb;

config.macros.view.replyLink = {
	locale: {
		label: "Reply to this tiddler"
	}
};

var _replyButtons = [];
var _replyInitialised, _replyScriptLoaded;
config.macros.view.views.replyLink = function(value, place, params, wikifier,
		paramString, tiddler) {
	var valueField = params[0];
	var imported;
	if(valueField == "title") { // special casing for imported tiddlers
		var localTitle = tiddler.title;
		var serverTitle = tiddler.fields["server.title"];
		if(serverTitle && localTitle != serverTitle) {
			value = serverTitle ? serverTitle : localTitle;
			imported = true;
		}
	} else {
		title = tiddler[valueField] ? tiddler[valueField] : tiddler.fields[valueField];
	}
	var args = paramString.parseParams("anon")[0];
	var label = (args.label) ? args.label : config.macros.view.replyLink.locale.label;
	var space;
	if(tiddler) {
		var bag = tiddler.fields["server.bag"];
		space = tiddlyspace.resolveSpaceName(bag);
	}
	var container = $('<span class="replyLink" />').appendTo(place)[0];

	tweb.getUserInfo(function(user) {
		if ((!user.anon) && ((space && user.name != space &&
				user.name != tiddlyspace.currentSpace.name) || imported)) {
			var link = $("<a />")
				.text(config.macros.view.replyLink.locale.label)
				.appendTo(container)[0];

			if(typeof(createReplyButton) === "undefined") {
				_replyButtons.push(link);
			}
			if(_replyInitialised) {
				createReplyButton(link);
			} else if(!_replyScriptLoaded) {
				_replyScriptLoaded = true;
				$.getScript("/bags/common/tiddlers/_reply-button.js",
					function() {
						_replyInitialised = true;
						for(var i = 0; i < _replyButtons.length; i++) {
							createReplyButton(_replyButtons[i]);
						}
						_replyButtons = [];
					});
			}
		}
	});

};

config.macros.view.views.spaceLink = function(value, place, params, wikifier,
		paramString, tiddler) {
		var spaceName = tiddlyspace.resolveSpaceName(value);
		var isBag = params[0] == "server.bag" && value === spaceName ? true : false;
		var args = paramString.parseParams("anon")[0];
		var titleField = args.anon[2];
		var labelField = args.labelField ? args.labelField[0] : false;
		var label;
		if(labelField) {
			label = tiddler[labelField] ? tiddler[labelField] : tiddler.fields[labelField];
		} else {
			label = args.label ? args.label[0] : false;
		}
		var title = tiddler[titleField] ? tiddler[titleField] : tiddler.fields[titleField];

		var link = createSpaceLink(place, spaceName, title, label, isBag);
		if(args.external && args.external[0] == "no") {
			$(link).click(function(ev) {
				var el = $(ev.target);
				var title = el.attr("tiddler");
				var bag = el.attr("bag");
				var space = el.attr("tiddlyspace");
				bag = space ? space + "_public" : bag;
				if(title && bag) {
					ev.preventDefault();
					tiddlyspace.displayServerTiddler(el[0], title,
						"bags/" + bag);
				}
				return false;
			});
		}
};

config.macros.view.views.SiteIcon = function(value, place, params, wikifier,
		paramString, tiddler) {
	var options = originMacro.getOptions(paramString);
	if(!tiddler || value == "None") { // some core tiddlers lack modifier
		value = false;
	}
	var field = params[0];
	if(field == "server.bag") {
		options.notSpace = !originMacro._isSpace(value);
	}
	tiddlyspace.renderAvatar(place, value, options);
};

})(jQuery);
//}}}
/***
|''Name''|TiddlyWebAdaptor|
|''Description''|adaptor for interacting with TiddlyWeb|
|''Author:''|FND|
|''Contributors''|Chris Dent, Martin Budden|
|''Version''|1.4.10|
|''Status''|stable|
|''Source''|http://svn.tiddlywiki.org/Trunk/association/adaptors/TiddlyWebAdaptor.js|
|''CodeRepository''|http://svn.tiddlywiki.org/Trunk/association/|
|''License''|[[BSD|http://www.opensource.org/licenses/bsd-license.php]]|
|''CoreVersion''|2.5|
|''Keywords''|serverSide TiddlyWeb|
!Notes
This plugin includes [[jQuery JSON|http://code.google.com/p/jquery-json/]].
!To Do
* createWorkspace
* document custom/optional context attributes (e.g. filters, query, revision) and tiddler fields (e.g. server.title, origin)
!Code
***/
//{{{
(function($) {

var adaptor = config.adaptors.tiddlyweb = function() {};

adaptor.prototype = new AdaptorBase();
adaptor.serverType = "tiddlyweb";
adaptor.serverLabel = "TiddlyWeb";
adaptor.mimeType = "application/json";

adaptor.parsingErrorMessage = "Error parsing result from server";
adaptor.noBagErrorMessage = "no bag specified for tiddler";
adaptor.locationIDErrorMessage = "no bag or recipe specified for tiddler"; // TODO: rename

// retrieve current status (requires TiddlyWeb status plugin)
adaptor.prototype.getStatus = function(context, userParams, callback) {
	context = this.setContext(context, userParams, callback);
	var uriTemplate = "%0/status";
	var uri = uriTemplate.format([context.host]);
	var req = httpReq("GET", uri, adaptor.getStatusCallback, context,
		null, null, null, null, null, true);
	return typeof req == "string" ? req : true;
};

adaptor.getStatusCallback = function(status, context, responseText, uri, xhr) {
	context.status = responseText ? status : false;
	try {
		context.statusText = xhr.statusText;
	} catch(exc) { // offline (Firefox)
		context.status = false;
		context.statusText = null;
	}
	context.httpStatus = xhr.status;
	if(context.status) {
		context.serverStatus = $.evalJSON(responseText); // XXX: error handling!?
	}
	if(context.callback) {
		context.callback(context, context.userParams);
	}
};

// retrieve a list of workspaces
adaptor.prototype.getWorkspaceList = function(context, userParams, callback) {
	context = this.setContext(context, userParams, callback);
	context.workspaces = [];
	var uriTemplate = "%0/recipes"; // XXX: bags?
	var uri = uriTemplate.format([context.host]);
	var req = httpReq("GET", uri, adaptor.getWorkspaceListCallback,
		context, { accept: adaptor.mimeType }, null, null, null, null, true);
	return typeof req == "string" ? req : true;
};

adaptor.getWorkspaceListCallback = function(status, context, responseText, uri, xhr) {
	context.status = status;
	context.statusText = xhr.statusText;
	context.httpStatus = xhr.status;
	if(status) {
		try {
			var workspaces = $.evalJSON(responseText);
		} catch(ex) {
			context.status = false; // XXX: correct?
			context.statusText = exceptionText(ex, adaptor.parsingErrorMessage);
			if(context.callback) {
				context.callback(context, context.userParams);
			}
			return;
		}
		context.workspaces = workspaces.map(function(itm) { return { title: itm }; });
	}
	if(context.callback) {
		context.callback(context, context.userParams);
	}
};

// retrieve a list of tiddlers
adaptor.prototype.getTiddlerList = function(context, userParams, callback) {
	context = this.setContext(context, userParams, callback);
	var uriTemplate = "%0/%1/%2/tiddlers%3";
	var params = context.filters ? "?" + context.filters : "";
	if(context.format) {
		params = context.format + params;
	}
	var workspace = adaptor.resolveWorkspace(context.workspace);
	var uri = uriTemplate.format([context.host, workspace.type + "s",
		adaptor.normalizeTitle(workspace.name), params]);
	var req = httpReq("GET", uri, adaptor.getTiddlerListCallback,
		context, merge({ accept: adaptor.mimeType }, context.headers), null, null, null, null, true);
	return typeof req == "string" ? req : true;
};

adaptor.getTiddlerListCallback = function(status, context, responseText, uri, xhr) {
	context.status = status;
	context.statusText = xhr.statusText;
	context.httpStatus = xhr.status;
	if(status) {
		context.tiddlers = [];
		try {
			var tiddlers = $.evalJSON(responseText); //# NB: not actual tiddler instances
		} catch(ex) {
			context.status = false; // XXX: correct?
			context.statusText = exceptionText(ex, adaptor.parsingErrorMessage);
			if(context.callback) {
				context.callback(context, context.userParams);
			}
			return;
		}
		for(var i = 0; i < tiddlers.length; i++) {
			var tiddler = adaptor.toTiddler(tiddlers[i], context.host);
			context.tiddlers.push(tiddler);
		}
	}
	if(context.callback) {
		context.callback(context, context.userParams);
	}
};

// perform global search
adaptor.prototype.getSearchResults = function(context, userParams, callback) {
	context = this.setContext(context, userParams, callback);
	var uriTemplate = "%0/search?q=%1%2";
	var filterString = context.filters ? ";" + context.filters : "";
	var uri = uriTemplate.format([context.host, context.query, filterString]); // XXX: parameters need escaping?
	var req = httpReq("GET", uri, adaptor.getSearchResultsCallback,
		context, { accept: adaptor.mimeType }, null, null, null, null, true);
	return typeof req == "string" ? req : true;
};

adaptor.getSearchResultsCallback = function(status, context, responseText, uri, xhr) {
	adaptor.getTiddlerListCallback(status, context, responseText, uri, xhr); // XXX: use apply?
};

// retrieve a particular tiddler's revisions
adaptor.prototype.getTiddlerRevisionList = function(title, limit, context, userParams, callback) {
	context = this.setContext(context, userParams, callback);
	var uriTemplate = "%0/%1/%2/tiddlers/%3/revisions";
	var workspace = adaptor.resolveWorkspace(context.workspace);
	var uri = uriTemplate.format([context.host, workspace.type + "s",
		adaptor.normalizeTitle(workspace.name), adaptor.normalizeTitle(title)]);
	var req = httpReq("GET", uri, adaptor.getTiddlerRevisionListCallback,
		context, merge({ accept: adaptor.mimeType }, context.headers), null, null, null, null, true);
	return typeof req == "string" ? req : true;
};

adaptor.getTiddlerRevisionListCallback = function(status, context, responseText, uri, xhr) {
	context.status = status;
	context.statusText = xhr.statusText;
	context.httpStatus = xhr.status;
	if(status) {
		context.revisions = [];
		try {
			var tiddlers = $.evalJSON(responseText); //# NB: not actual tiddler instances
		} catch(ex) {
			context.status = false; // XXX: correct?
			context.statusText = exceptionText(ex, adaptor.parsingErrorMessage);
			if(context.callback) {
				context.callback(context, context.userParams);
			}
			return;
		}
		for(var i = 0; i < tiddlers.length; i++) {
			var tiddler = adaptor.toTiddler(tiddlers[i], context.host);
			context.revisions.push(tiddler);
		}
		var sortField = "server.page.revision";
		context.revisions.sort(function(a, b) {
			return a.fields[sortField] < b.fields[sortField] ? 1 :
				(a.fields[sortField] == b.fields[sortField] ? 0 : -1);
		});
	}
	if(context.callback) {
		context.callback(context, context.userParams);
	}
};

// retrieve an individual tiddler revision -- XXX: breaks with standard arguments list -- XXX: convenience function; simply use getTiddler?
adaptor.prototype.getTiddlerRevision = function(title, revision, context, userParams, callback) {
	context = this.setContext(context, userParams, callback);
	context.revision = revision;
	return this.getTiddler(title, context, userParams, callback);
};

// retrieve an individual tiddler
//# context is an object with members host and workspace
//# callback is passed the new context and userParams
adaptor.prototype.getTiddler = function(title, context, userParams, callback) {
	context = this.setContext(context, userParams, callback);
	context.title = title;
	if(context.revision) {
		var uriTemplate = "%0/%1/%2/tiddlers/%3/revisions/%4";
	} else {
		uriTemplate = "%0/%1/%2/tiddlers/%3";
	}
	if(!context.tiddler) {
		context.tiddler = new Tiddler(title);
	}
	context.tiddler.fields["server.type"] = adaptor.serverType;
	context.tiddler.fields["server.host"] = AdaptorBase.minHostName(context.host);
	context.tiddler.fields["server.workspace"] = context.workspace;
	var workspace = adaptor.resolveWorkspace(context.workspace);
	var uri = uriTemplate.format([context.host, workspace.type + "s",
		adaptor.normalizeTitle(workspace.name), adaptor.normalizeTitle(title),
		context.revision]);
	var req = httpReq("GET", uri, adaptor.getTiddlerCallback, context,
		merge({ accept: adaptor.mimeType }, context.headers), null, null, null, null, true);
	return typeof req == "string" ? req : true;
};

adaptor.getTiddlerCallback = function(status, context, responseText, uri, xhr) {
	context.status = status;
	context.statusText = xhr.statusText;
	context.httpStatus = xhr.status;
	if(status) {
		try {
			var tid = $.evalJSON(responseText);
		} catch(ex) {
			context.status = false;
			context.statusText = exceptionText(ex, adaptor.parsingErrorMessage);
			if(context.callback) {
				context.callback(context, context.userParams);
			}
			return;
		}
		var tiddler = adaptor.toTiddler(tid, context.host);
		tiddler.title = context.tiddler.title;
		tiddler.fields["server.etag"] = xhr.getResponseHeader("Etag");
		// normally we'd assign context.tiddler = tiddler here - but we can't do
		// that because of IE, which triggers getTiddler in putTiddlerCallback,
		// and since ServerSideSavingPlugin foolishly relies on persistent
		// object references, we need to merge the data into the existing object
		$.extend(context.tiddler, tiddler);
	}
	if(context.callback) {
		context.callback(context, context.userParams);
	}
};

// retrieve tiddler chronicle (all revisions)
adaptor.prototype.getTiddlerChronicle = function(title, context, userParams, callback) {
	context = this.setContext(context, userParams, callback);
	context.title = title;
	var uriTemplate = "%0/%1/%2/tiddlers/%3/revisions?fat=1";
	var workspace = adaptor.resolveWorkspace(context.workspace);
	var uri = uriTemplate.format([context.host, workspace.type + "s",
		adaptor.normalizeTitle(workspace.name), adaptor.normalizeTitle(title)]);
	var req = httpReq("GET", uri, adaptor.getTiddlerChronicleCallback,
		context, { accept: adaptor.mimeType }, null, null, null, null, true);
	return typeof req == "string" ? req : true;
};

adaptor.getTiddlerChronicleCallback = function(status, context, responseText, uri, xhr) {
	context.status = status;
	context.statusText = xhr.statusText;
	context.httpStatus = xhr.status;
	if(status) {
		context.responseText = responseText;
	}
	if(context.callback) {
		context.callback(context, context.userParams);
	}
};

// store an individual tiddler
adaptor.prototype.putTiddler = function(tiddler, context, userParams, callback) {
	context = this.setContext(context, userParams, callback);
	context.title = tiddler.title;
	context.tiddler = tiddler;
	context.host = context.host || this.fullHostName(tiddler.fields["server.host"]);
	var uriTemplate = "%0/%1/%2/tiddlers/%3";
	try {
		context.workspace = context.workspace || tiddler.fields["server.workspace"];
		var workspace = adaptor.resolveWorkspace(context.workspace);
	} catch(ex) {
		return adaptor.locationIDErrorMessage;
	}
	var uri = uriTemplate.format([context.host, workspace.type + "s",
		adaptor.normalizeTitle(workspace.name),
		adaptor.normalizeTitle(tiddler.title)]);
	var etag = adaptor.generateETag(workspace, tiddler);
	var headers = etag ? { "If-Match": etag } : null;
	var payload = {
		type: tiddler.fields["server.content-type"] || null,
		text: tiddler.text,
		tags: tiddler.tags,
		fields: $.extend({}, tiddler.fields)
	};
	delete payload.fields.changecount;
	$.each(payload.fields, function(key, value) {
		if(key.indexOf("server.") == 0) {
			delete payload.fields[key];
		}
	});
	payload = $.toJSON(payload);
	var req = httpReq("PUT", uri, adaptor.putTiddlerCallback,
		context, headers, payload, adaptor.mimeType, null, null, true);
	return typeof req == "string" ? req : true;
};

adaptor.putTiddlerCallback = function(status, context, responseText, uri, xhr) {
	context.status = [204, 1223].contains(xhr.status);
	context.statusText = xhr.statusText;
	context.httpStatus = xhr.status;
	if(context.status) {
		var loc = xhr.getResponseHeader("Location");
		var etag = xhr.getResponseHeader("Etag");
		if(loc && etag) {
			var bag = loc.split("/bags/").pop().split("/")[0];
			context.tiddler.fields["server.bag"] = bag;
			context.tiddler.fields["server.workspace"] = "bags/" + bag;
			var rev = etag.split("/").pop().split(/;|:/)[0];
			context.tiddler.fields["server.page.revision"] = rev;
			context.tiddler.fields["server.etag"] = etag;
			if(context.callback) {
				context.callback(context, context.userParams);
			}
		} else { // IE
			context.adaptor.getTiddler(context.tiddler.title, context,
				context.userParams, context.callback);
		}
	} else if(context.callback) {
		context.callback(context, context.userParams);
	}
};

// store a tiddler chronicle
adaptor.prototype.putTiddlerChronicle = function(revisions, context, userParams, callback) {
	context = this.setContext(context, userParams, callback);
	context.title = revisions[0].title;
	var headers = null;
	var uriTemplate = "%0/%1/%2/tiddlers/%3/revisions";
	var host = context.host || this.fullHostName(tiddler.fields["server.host"]);
	var workspace = adaptor.resolveWorkspace(context.workspace);
	var uri = uriTemplate.format([host, workspace.type + "s",
		adaptor.normalizeTitle(workspace.name),
		adaptor.normalizeTitle(context.title)]);
	if(workspace.type == "bag") { // generate ETag
		var etag = [adaptor.normalizeTitle(workspace.name),
			adaptor.normalizeTitle(context.title), 0].join("/"); //# zero-revision prevents overwriting existing contents
		headers = { "If-Match": '"' + etag + '"' };
	}
	var payload = $.toJSON(revisions);
	var req = httpReq("POST", uri, adaptor.putTiddlerChronicleCallback,
		context, headers, payload, adaptor.mimeType, null, null, true);
	return typeof req == "string" ? req : true;
};

adaptor.putTiddlerChronicleCallback = function(status, context, responseText, uri, xhr) {
	context.status = [204, 1223].contains(xhr.status);
	context.statusText = xhr.statusText;
	context.httpStatus = xhr.status;
	if(context.callback) {
		context.callback(context, context.userParams);
	}
};

// store a collection of tiddlers (import TiddlyWiki HTML store)
adaptor.prototype.putTiddlerStore = function(store, context, userParams, callback) {
	context = this.setContext(context, userParams, callback);
	var uriTemplate = "%0/%1/%2/tiddlers";
	var host = context.host;
	var workspace = adaptor.resolveWorkspace(context.workspace);
	var uri = uriTemplate.format([host, workspace.type + "s",
		adaptor.normalizeTitle(workspace.name)]);
	var req = httpReq("POST", uri, adaptor.putTiddlerStoreCallback,
		context, null, store, "text/x-tiddlywiki", null, null, true);
	return typeof req == "string" ? req : true;
};

adaptor.putTiddlerStoreCallback = function(status, context, responseText, uri, xhr) {
	context.status = [204, 1223].contains(xhr.status);
	context.statusText = xhr.statusText;
	context.httpStatus = xhr.status;
	if(context.callback) {
		context.callback(context, context.userParams);
	}
};

// rename an individual tiddler or move it to a different workspace -- TODO: make {from|to}.title optional
//# from and to are objects with members title and workspace (bag; optional),
//# representing source and target tiddler, respectively
adaptor.prototype.moveTiddler = function(from, to, context, userParams, callback) { // XXX: rename parameters (old/new)?
	var self = this;
	var newTiddler = store.getTiddler(from.title) || store.getTiddler(to.title); //# local rename might already have occurred
	var oldTiddler = $.extend(true, {}, newTiddler); //# required for eventual deletion
	oldTiddler.title = from.title; //# required for original tiddler's ETag
	var _getTiddlerChronicle = function(title, context, userParams, callback) {
		return self.getTiddlerChronicle(title, context, userParams, callback);
	};
	var _putTiddlerChronicle = function(context, userParams) {
		if(!context.status) {
			return callback(context, userParams);
		}
		var revisions = $.evalJSON(context.responseText); // XXX: error handling?
		// change current title while retaining previous location
		for(var i = 0; i < revisions.length; i++) {
			delete revisions[i].revision;
			if(!revisions[i].fields.origin) { // NB: origin = "<workspace>/<title>"
				revisions[i].fields.origin = ["bags", revisions[i].bag, revisions[i].title].join("/");
			}
			revisions[i].title = to.title;
		}
		// add new revision
		var rev = $.extend({}, revisions[0]);
		$.each(newTiddler, function(i, item) {
			if(!$.isFunction(item)) {
				rev[i] = item;
			}
		});
		rev.title = to.title;
		rev.created = rev.created.convertToYYYYMMDDHHMM();
		rev.modified = new Date().convertToYYYYMMDDHHMM();
		delete rev.fields.changecount;
		revisions.unshift(rev);
		if(to.workspace) {
			context.workspace = to.workspace;
		} else if(context.workspace.substring(0, 4) != "bags") { // NB: target workspace must be a bag
			context.workspace = "bags/" + rev.bag;
		}
		var subCallback = function(context, userParams) {
			if(!context.status) {
				return callback(context, userParams);
			}
			context.adaptor.getTiddler(newTiddler.title, context, userParams, _deleteTiddler);
		};
		return self.putTiddlerChronicle(revisions, context, context.userParams, subCallback);
	};
	var _deleteTiddler = function(context, userParams) {
		if(!context.status) {
			return callback(context, userParams);
		}
		$.extend(true, newTiddler, context.tiddler);
		context.callback = null;
		return self.deleteTiddler(oldTiddler, context, context.userParams, callback);
	};
	callback = callback || function() {};
	context = this.setContext(context, userParams);
	context.host = context.host || oldTiddler.fields["server.host"];
	context.workspace = from.workspace || oldTiddler.fields["server.workspace"];
	return _getTiddlerChronicle(from.title, context, userParams, _putTiddlerChronicle);
};

// delete an individual tiddler
adaptor.prototype.deleteTiddler = function(tiddler, context, userParams, callback) {
	context = this.setContext(context, userParams, callback);
	context.title = tiddler.title; // XXX: not required!?
	var uriTemplate = "%0/bags/%1/tiddlers/%2";
	var host = context.host || this.fullHostName(tiddler.fields["server.host"]);
	var bag = tiddler.fields["server.bag"];
	if(!bag) {
		return adaptor.noBagErrorMessage;
	}
	var uri = uriTemplate.format([host, adaptor.normalizeTitle(bag),
		adaptor.normalizeTitle(tiddler.title)]);
	var etag = adaptor.generateETag({ type: "bag", name: bag }, tiddler);
	var headers = etag ? { "If-Match": etag } : null;
	var req = httpReq("DELETE", uri, adaptor.deleteTiddlerCallback, context, headers,
		null, null, null, null, true);
	return typeof req == "string" ? req : true;
};

adaptor.deleteTiddlerCallback = function(status, context, responseText, uri, xhr) {
	context.status = [204, 1223].contains(xhr.status);
	context.statusText = xhr.statusText;
	context.httpStatus = xhr.status;
	if(context.callback) {
		context.callback(context, context.userParams);
	}
};

// compare two revisions of a tiddler (requires TiddlyWeb differ plugin)
//# if context.rev1 is not specified, the latest revision will be used for comparison
//# if context.rev2 is not specified, the local revision will be sent for comparison
//# context.format is a string as determined by the TiddlyWeb differ plugin
adaptor.prototype.getTiddlerDiff = function(title, context, userParams, callback) {
	context = this.setContext(context, userParams, callback);
	context.title = title;

	var tiddler = store.getTiddler(title);
	try {
		var workspace = adaptor.resolveWorkspace(tiddler.fields["server.workspace"]);
	} catch(ex) {
		return adaptor.locationIDErrorMessage;
	}
	var tiddlerRef = [workspace.type + "s", workspace.name, tiddler.title].join("/");

	var rev1 = context.rev1 ? [tiddlerRef, context.rev1].join("/") : tiddlerRef;
	var rev2 = context.rev2 ? [tiddlerRef, context.rev2].join("/") : null;

	var uriTemplate = "%0/diff?rev1=%1";
	if(rev2) {
		uriTemplate += "&rev2=%2";
	}
	if(context.format) {
		uriTemplate += "&format=%3";
	}
	var host = context.host || this.fullHostName(tiddler.fields["server.host"]);
	var uri = uriTemplate.format([host, adaptor.normalizeTitle(rev1),
		adaptor.normalizeTitle(rev2), context.format]);

	if(rev2) {
		var req = httpReq("GET", uri, adaptor.getTiddlerDiffCallback, context, null,
			null, null, null, null, true);
	} else {
		var payload = {
			title: tiddler.title,
			text: tiddler.text,
			modifier: tiddler.modifier,
			tags: tiddler.tags,
			fields: $.extend({}, tiddler.fields)
		}; // XXX: missing attributes!?
		payload = $.toJSON(payload);
		req = httpReq("POST", uri, adaptor.getTiddlerDiffCallback, context,
			null, payload, adaptor.mimeType, null, null, true);
	}
	return typeof req == "string" ? req : true;
};

adaptor.getTiddlerDiffCallback = function(status, context, responseText, uri, xhr) {
	context.status = status;
	context.statusText = xhr.statusText;
	context.httpStatus = xhr.status;
	context.uri = uri;
	if(status) {
		context.diff = responseText;
	}
	if(context.callback) {
		context.callback(context, context.userParams);
	}
};

// generate tiddler information
adaptor.prototype.generateTiddlerInfo = function(tiddler) {
	var info = {};
	var uriTemplate = "%0/%1/%2/tiddlers/%3";
	var host = this.host || tiddler.fields["server.host"]; // XXX: this.host obsolete?
	host = this.fullHostName(host);
	var workspace = adaptor.resolveWorkspace(tiddler.fields["server.workspace"]);
	info.uri = uriTemplate.format([host, workspace.type + "s",
		adaptor.normalizeTitle(workspace.name),
		adaptor.normalizeTitle(tiddler.title)]);
	return info;
};

// create Tiddler instance from TiddlyWeb tiddler JSON
adaptor.toTiddler = function(json, host) {
	var created = Date.convertFromYYYYMMDDHHMM(json.created);
	var modified = Date.convertFromYYYYMMDDHHMM(json.modified);
	var fields = json.fields;
	fields["server.type"] = adaptor.serverType;
	fields["server.host"] = AdaptorBase.minHostName(host);
	fields["server.bag"] = json.bag;
	fields["server.title"] = json.title;
	if(json.recipe) {
		fields["server.recipe"] = json.recipe;
	}
	if(json.type && json.type != "None") {
		fields["server.content-type"] = json.type;
	}
	fields["server.permissions"] = json.permissions.join(", ");
	fields["server.page.revision"] = json.revision;
	fields["server.workspace"] = "bags/" + json.bag;
	var tiddler = new Tiddler(json.title);
	tiddler.assign(tiddler.title, json.text, json.modifier, modified, json.tags,
		created, json.fields, json.creator);
	return tiddler;
};

adaptor.resolveWorkspace = function(workspace) {
	var components = workspace.split("/");
	return {
		type: components[0] == "bags" ? "bag" : "recipe",
		name: components[1] || components[0]
	};
};

adaptor.generateETag = function(workspace, tiddler) {
	var revision = tiddler.fields["server.page.revision"];
	var etag = revision == "false" ? null : tiddler.fields["server.etag"];
	if(!etag && workspace.type == "bag") {
		if(typeof revision == "undefined") {
			revision = "0";
		} else if(revision == "false") {
			return null;
		}
		etag = [adaptor.normalizeTitle(workspace.name),
			adaptor.normalizeTitle(tiddler.title), revision].join("/");
		etag = '"' + etag + '"';
	}
	return etag;
};

adaptor.normalizeTitle = function(title) {
	return encodeURIComponent(title);
};

})(jQuery);


/*
 * jQuery JSON Plugin
 * version: 1.3
 * source: http://code.google.com/p/jquery-json/
 * license: MIT (http://www.opensource.org/licenses/mit-license.php)
 */
(function($){function toIntegersAtLease(n)
{return n<10?'0'+n:n;}
Date.prototype.toJSON=function(date)
{return this.getUTCFullYear()+'-'+
toIntegersAtLease(this.getUTCMonth())+'-'+
toIntegersAtLease(this.getUTCDate());};var escapeable=/["\\\x00-\x1f\x7f-\x9f]/g;var meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};$.quoteString=function(string)
{if(escapeable.test(string))
{return'"'+string.replace(escapeable,function(a)
{var c=meta[a];if(typeof c==='string'){return c;}
c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16);})+'"';}
return'"'+string+'"';};$.toJSON=function(o,compact)
{var type=typeof(o);if(type=="undefined")
return"undefined";else if(type=="number"||type=="boolean")
return o+"";else if(o===null)
return"null";if(type=="string")
{return $.quoteString(o);}
if(type=="object"&&typeof o.toJSON=="function")
return o.toJSON(compact);if(type!="function"&&typeof(o.length)=="number")
{var ret=[];for(var i=0;i<o.length;i++){ret.push($.toJSON(o[i],compact));}
if(compact)
return"["+ret.join(",")+"]";else
return"["+ret.join(", ")+"]";}
if(type=="function"){throw new TypeError("Unable to convert object of type 'function' to json.");}
var ret=[];for(var k in o){var name;type=typeof(k);if(type=="number")
name='"'+k+'"';else if(type=="string")
name=$.quoteString(k);else
continue;var val=$.toJSON(o[k],compact);if(typeof(val)!="string"){continue;}
if(compact)
ret.push(name+":"+val);else
ret.push(name+": "+val);}
return"{"+ret.join(", ")+"}";};$.compactJSON=function(o)
{return $.toJSON(o,true);};$.evalJSON=function(src)
{return eval("("+src+")");};$.secureEvalJSON=function(src)
{var filtered=src;filtered=filtered.replace(/\\["\\\/bfnrtu]/g,'@');filtered=filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']');filtered=filtered.replace(/(?:^|:|,)(?:\s*\[)+/g,'');if(/^[\],:{}\s]*$/.test(filtered))
return eval("("+src+")");else
throw new SyntaxError("Error parsing JSON, source is not valid.");};})(jQuery);
//}}}
/***
|''Name''|TiddlyWebConfig|
|''Description''|configuration settings for TiddlyWebWiki|
|''Author''|FND|
|''Version''|1.3.2|
|''Status''|stable|
|''Source''|http://svn.tiddlywiki.org/Trunk/association/plugins/TiddlyWebConfig.js|
|''License''|[[BSD|http://www.opensource.org/licenses/bsd-license.php]]|
|''Requires''|TiddlyWebAdaptor ServerSideSavingPlugin|
|''Keywords''|serverSide TiddlyWeb|
!Code
***/
//{{{
(function($) {

if(!config.extensions.ServerSideSavingPlugin) {
	throw "Missing dependency: ServerSideSavingPlugin";
}
if(!config.adaptors.tiddlyweb) {
	throw "Missing dependency: TiddlyWebAdaptor";
}

if(window.location.protocol != "file:") {
	config.options.chkAutoSave = true;
}

var adaptor = tiddler.getAdaptor();
var recipe = tiddler.fields["server.recipe"];
var workspace = recipe ? "recipes/" + recipe : "bags/common";

var plugin = config.extensions.tiddlyweb = {
	host: tiddler.fields["server.host"].replace(/\/$/, ""),
	username: null,
	status: {},

	getStatus: null, // assigned later
	getUserInfo: function(callback) {
		this.getStatus(function(status) {
			callback({
				name: plugin.username,
				anon: plugin.username ? plugin.username == "GUEST" : true
			});
		});
	},
	hasPermission: function(type, tiddler) {
		var perms = tiddler.fields["server.permissions"];
		if(perms) {
			return perms.split(", ").contains(type);
		} else {
			return true;
		}
	}
};

config.defaultCustomFields = {
	"server.type": tiddler.getServerType(),
	"server.host": plugin.host,
	"server.workspace": workspace
};

// modify toolbar commands

config.shadowTiddlers.ToolbarCommands = config.shadowTiddlers.ToolbarCommands.
	replace("syncing ", "revisions syncing ");

config.commands.saveTiddler.isEnabled = function(tiddler) {
	return plugin.hasPermission("write", tiddler) && !tiddler.isReadOnly();
};

config.commands.deleteTiddler.isEnabled = function(tiddler) {
	return !readOnly && plugin.hasPermission("delete", tiddler);
};

// hijack option macro to disable username editing
var _optionMacro = config.macros.option.handler;
config.macros.option.handler = function(place, macroName, params, wikifier,
		paramString) {
	if(params[0] == "txtUserName") {
		params[0] = "options." + params[0];
		var self = this;
		var args = arguments;
		args[0] = $("<span />").appendTo(place)[0];
		plugin.getUserInfo(function(user) {
			config.macros.message.handler.apply(self, args);
		});
	} else {
		_optionMacro.apply(this, arguments);
	}
};

// hijack isReadOnly to take into account permissions and content type
var _isReadOnly = Tiddler.prototype.isReadOnly;
Tiddler.prototype.isReadOnly = function() {
	return _isReadOnly.apply(this, arguments) ||
		!plugin.hasPermission("write", this);
};

var getStatus = function(callback) {
	if(plugin.status.version) {
		callback(plugin.status);
	} else {
		var self = getStatus;
		if(self.pending) {
			if(callback) {
				self.queue.push(callback);
			}
		} else {
			self.pending = true;
			self.queue = callback ? [callback] : [];
			var _callback = function(context, userParams) {
				var status = context.serverStatus || {};
				for(var key in status) {
					if(key == "username") {
						plugin.username = status[key];
						config.macros.option.propagateOption("txtUserName",
							"value", plugin.username, "input");
					} else {
						plugin.status[key] = status[key];
					}
				}
				for(var i = 0; i < self.queue.length; i++) {
					self.queue[i](plugin.status);
				}
				delete self.queue;
				delete self.pending;
			};
			adaptor.getStatus({ host: plugin.host }, null, _callback);
		}
	}
};
(plugin.getStatus = getStatus)(); // XXX: hacky (arcane combo of assignment plus execution)

})(jQuery);
//}}}
/***
|''Name''|ToggleTiddlerPrivacyPlugin|
|''Version''|0.7.1|
|''Status''|@@beta@@|
|''Description''|Allows you to set the privacy of new tiddlers and external tiddlers within an EditTemplate, and allows you to set a default privacy setting|
|''CoreVersion''|2.6.1|
|''Requires''|TiddlySpaceConfig|
|''Source''|http://github.com/TiddlySpace/tiddlyspace/raw/master/src/plugins/ToggleTiddlerPrivacyPlugin.js|
!Notes
When used in conjunction with TiddlySpaceTiddlerIconsPlugin changing the privacy setting will also interact with any privacy icons.

Currently use of
{{{<<setPrivacy defaultValue:public>>}}} is in conflict with {{{<<newTiddler fields:"server.workspace:x_private">>}}}

There is an option, found in the tweak tab of the backstage, called txtPrivacyMode. Set this to either ''public'' or ''private'' depending on your security preference. If you choose not to set it then it will default to ''public''.
!Params
defaultValue:[private|public]
Allows you to set the default privacy value (Default is private)

!Code
***/
//{{{
(function($) {

	var tiddlyspace = config.extensions.tiddlyspace,
		macro;
	macro = config.macros.setPrivacy = {
		handler: function(place, macroName, params, wikifier, paramString, tiddler) {
			if(readOnly) {
				return;
			}
			var el = $(story.findContainingTiddler(place)),
				args = paramString.parseParams("name",
					null, true, false, true)[0],
				container = $("<div />").
					addClass("privacySettings").
					appendTo(place)[0],
				currentSpace = tiddlyspace.currentSpace.name,
				currentBag = tiddler ? tiddler.fields["server.bag"] : false,
				// XXX: is the following reliable?
				isNewTiddler = el.hasClass("missing") || !currentBag,
				tiddlerStatus = tiddlyspace.getTiddlerStatusType(tiddler),
				customFields = el.attr("tiddlyfields"),
				defaultValue = "public",
				options = config.macros.tiddlerOrigin ?
						config.macros.tiddlerOrigin.getOptions(paramString) :
						{};
			customFields = customFields ? customFields.decodeHashMap() : {};
			if(isNewTiddler || !["public", "private", "unsyncedPrivate",
					"unsyncedPublic"].contains(tiddlerStatus)) {
				if(args.defaultValue) {
					defaultValue = args.defaultValue[0].toLowerCase();
				} else {
					defaultValue = config.options.chkPrivateMode ?
							"private" : "public";
				}
				defaultValue = defaultValue ?
						"%0_%1".format(currentSpace, defaultValue) :
						customFields["server.bag"];
				this.createRoundel(container, tiddler, currentSpace,
						defaultValue, options);
			}
		},
		updateEditFields: function(tiddlerEl, bag) {
			var saveBagField = $('[edit="server.bag"]', tiddlerEl),
				saveWorkspaceField = $('[edit="server.workspace"]', tiddlerEl),
				input = $("<input />").attr("type", "hidden"),
				workspace = "bags/" + bag;
			if(saveBagField.length === 0) {
				input.clone().attr("edit", "server.bag").val(bag).
					appendTo(tiddlerEl);
			} else {
				saveBagField.val(bag);
			}
			// reset to prevent side effects
			$(tiddlerEl).attr("tiddlyFields", "");
			if(saveWorkspaceField.length === 0) {
				input.clone().attr("edit", "server.workspace").
					val(workspace).appendTo(tiddlerEl);
			} else {
				saveWorkspaceField.val(workspace);
			}
		},
		setBag: function(tiddlerEl, newBag, options) {
			var bagStatus,
				title = $(tiddlerEl).attr("tiddler"),
				tiddler = store.getTiddler(title),
				originButton = $(".originButton", tiddlerEl)[0],
				refreshIcon,
				newWorkspace = "bags/" + newBag,
				rPrivate = $("input[type=radio].isPrivate", tiddlerEl),
				rPublic = $("input[type=radio].isPublic", tiddlerEl);
			refreshIcon = function(type) {
				var originMacro = config.macros.tiddlerOrigin;
				if(originButton && originMacro) {
					options.noclick = true;
					originMacro.showPrivacyRoundel(tiddler, type,
							originButton, options);
				}
			};
			macro.updateEditFields(tiddlerEl, newBag);
			if(tiddler) {
				tiddler.fields["server.bag"] = newBag;
				// for external tiddlers
				tiddler.fields["server.workspace"] = newWorkspace;
			}
			if(newBag.indexOf("_public") > -1) {
				rPrivate.attr("checked", false);
				rPublic.attr("checked", true);
				bagStatus = "public";
			} else {
				rPublic.attr("checked", false); // explicitly do this for ie
				rPrivate.attr("checked", true);
				bagStatus = "private";
			}
			refreshIcon(bagStatus);
		},
		createRoundel: function(container, tiddler, currentSpace,
							   defaultValue, options) {
			var privateBag = "%0_private".format(currentSpace),
				publicBag = "%0_public".format(currentSpace),
				rbtn = $("<input />").attr("type", "radio").
					attr("name", tiddler.title),
				el = story.findContainingTiddler(container);
			rbtn.clone().val("private").addClass("isPrivate").
				appendTo(container);
			$("<label />").text("private").appendTo(container); // TODO: i18n
			rbtn.clone().val("public").addClass("isPublic")
				.appendTo(container);
			$("<label />").text("public").appendTo(container); // TODO: i18n
			$("[type=radio]", container).click(function(ev) {
				var btn = $(ev.target);
				tiddler.fields["server.page.revision"] = "false";
				if(btn.hasClass("isPrivate")) { // private button clicked.
					$(el).addClass("isPrivate").removeClass("isPublic");
					macro.setBag(el, privateBag, options);
				} else {
					$(el).addClass("isPublic").removeClass("isPrivate");
					macro.setBag(el, publicBag, options);
				}
			});
			window.setTimeout(function() {
				macro.setBag(el, defaultValue, options);
			}, 100);
			// annoyingly this is needed as customFields are added to end of EditTemplate so are not present yet
			// and don't seem to respect any existing customFields.
		}
	};

}(jQuery));
//}}}
|~ViewToolbar|+editTiddler +cloneTiddler > fields refreshTiddler changeToPublic changeToPrivate revisions syncing permalink references jump closeOthers < closeTiddler|
|~EditToolbar|+saveTiddler saveDraft -cancelTiddler deleteTiddler|
|~RevisionToolbar|> fields revert|
!@@color(green):Young person's Daily Life@@

!!![_] 01 Social activities	
Young person is involved in non-mandatory organized school or community activities, such as sports, clubs, church groups, etc.
!!![_] 02 Attendance at Education, Employment or Training	
Attendance at School, Emplyoment or Training courses. This is a measure of the extent of meaningful activity in the young person's life Behaviour and attainment are coded separately. Rate the attendance by the young person in the most recent academic, training or work environment, during the most recent 3-month period for which information is available.
!!![_] 03 Attainment in Education, Employment or Training	
Functioning in school, employment or training; includes academic performance and behaviour. Since intellectual ability is recorded elsewhere, do not adjust this rating for perceived ability. Rate how the young person is functioning in the most recent academic or work environment, during the most recent 3-month period for which information is available.
!!![_] 04  Other talents and abilities	
Skills/talents in activities such as athletics, art, music, mechanical, computers
!!![_] 05 Physical health condition
Includes major illnesses or injuries and chronic conditions such as diabetes, arthritis, side effects of medication, physical effects of alcohol/substance abuse. Excludes transient conditions e.g. influenza, sprained wrist.
!!![_] 06 Self care
The extent to which the young person performs tasks such as hygiene, dressing, eating, and attention to personal health needs in age-appropriate manner; if the young person has not been given the opportunity to learn a particular skill (e.g. tie shoes because he has no shoes with ties), do not penalize, and rate on overall functioning.
!!![_] 07 Physical impairment or disability
Rating of general impairment or disability from any cause that limits or prevents movement, or impairs sight or hearing, or otherwise interferes with personal functioning. Includes impairment resulting from congenital conditions, side effects of medication, physical disabilities resulting from accidents, etc. DO NOT SELECT THIS AS A KEY PROBLEM if the disability is not amenable to change.
!!![_] 08 Social development
Rate social development and maturity, in comparison with peers of the same culture and age. This item would cover (although is not limited to) the kinds of problems with social interaction that are commonly observed in pervasive developmental disorders such as the autistic spectrum. DO NOT SELECT THIS AS A KEY PROBLEM IF A DEVELOPMENTAL DEFICIT IS NOT AMENABLE TO CHANGE.
!!![_] 09 Social skills and interaction	
Young person is engaging, likeable, interested in interacting with people. Social skills and interaction may be reduced for many reasons. For (lilfe-long) developmental problems in managing reciprocal relationships (such as autistic spectrum difficulties) see also item 08 

!@@color(green):The Family/Care setting@@

!!![_] 10 Provision of Stable Housing
Family's ability to provide stable, appropriate housing.
!!![_] 11 Income and Provision of Material Resources
Family's ability to provide concrete resources for the young person; e.g. financial stability, appropriate housing, clothing, etc.
!!![_] 12 Relationships
Quality of interaction and affection between members of the immediate family (parents and siblings and others living in the home). If variable, rate the best available relationship.
!!![_] 13 Conflict with young person
The ways anger, conflict, and negative feelings are expressed and managed in the relationship; rate the relationship between the young person and the immediate family member in which there is the most problematic conflict.
!!![_] 14 Parental discipline
Parent or caregiver's typical patterns of discipline, limits, and rule-setting for the young person; too harsh, inconsistent, or inadequate discipline may be a problem. If young person spends regular time in two households (e.g., divorced parents), and there are inconsistencies between discipline in the two, rate the effect of the combination of the two. If any indication of abuse, ensure that this is recorded in carefully in the history, and that Child Protection issues have been considered.

!@@color(green):The Social context@@

!!![_] 15 Supportive adult relationships outside the family
Describes relationships with adults outside the family, such as teachers, coaches, neighbours, parents of friends, aunt or uncle, pastor, etc.
!!![_] 16 Peer friendships	
The extent to which the young person seeks out, relates to, and becomes attached to peers.
!!![_] 17 Prosocial or antisocial peergroup
The extent to which the young person’s friendship group is identified as pro-social or antisocial.

!@@color(green):Mental State and Behaviours@@

!!![_] 18 Cognitive ability
Extent to which the young person is bright, quick to learn, able to comprehend.
!!![_] 19 Anxiety
Includes irrational fears and phobias, general anxiety, worries, and panic-like symptoms, repeatedly asking questions and seeking reassurance, or restless, agitated behaviour if clearly associated with anxiety. These will often be provoked by new situations or people in milder forms, or more pervasive fears and inhibitions at higher levels of severity.
!!![_] 20 Obsessional Ideas and Compulsive Behaviour
Obsessional ideas are recurrent, persistent thoughts, impulses, or images that enter the mind despite the person's efforts to exclude them, often recognized by the person as unrealistic. Compulsive behaviours are repetitive and purposeful behaviours associated with a subjective sense that they must be carried out, e.g. checking, washing.
!!![_] 21 Post-traumatic intrusive experience
Recurrent trauma-related thoughts, images, feelings, or behaviours that have a highly charged, frightening, or overwhelming quality, are associated with emotional arousal, and which enter the person’s mind in a manner that is beyond voluntary control. Includes intrusive memories, nightmares, flashbacks, reenactments. Excludes depressive ideation, obsessional ideas, or ideation associated with specific phobias.
!!![_] 22 Attention and concentration
The extent to which the young person can focus on a task for appropriate periods of time without distraction or interruption of concentrated effort, without one-to-one supervision or other individual attention. Rate typical behaviour, not lapses in attention due to fatigue or situation-specific factors.
!!![_] 23 Irritability
General level of response to frustration, disappointment, criticisms, or provocation. Includes irritability associated with manic states.
!!![_] 24 Sleep disturbance
Difficulties with sleep and arousal, including insomnia (difficulty initiating sleep), excessive daytime sleepiness, nightmares, night terrors, sleep apnoea, sleepwalking, and narcolepsy. Rated on the basis of how much distress and functional disturbance is associated with the problem, regardless of whether sleep is the primary concern.
!!![_] 25 Depression
Depression may be manifest in sadness, tearfulness, irritability, lethargy, boredom, etc.; one of the principal factors being an inability to take pleasure in normally pleasurable things. Lack of activity or withdrawal associated with negative symptoms of psychosis are not rated unless there is clear evidence of dysphoric mood.
!!![_] 26 Deliberate Self Harm	
Includes purposeful and self-injurious behaviour; excludes suicidal behaviour, or unclearly motivated behaviours which can or do result in injury. Ambiguous behaviours (e.g. punching a wall) may be considered self-injurious if repeated after causing pain or injury. Self-tattooing/piercing are considered self-harm, but professional tattooing or piercing are not.
!!![_] 27 Eating problems
Includes all forms of eating disorders, whether restricting calories, binge eating with or without purging, pica etc. Increase or decrease in caloric intake as a result of depression or other problem is rated under Diet and/or Appetite. Includes not eating for reasons associated with delusional states e.g. belief that food is poisoned.
!!![_] 28 Substance misuse
Use of alcohol or illicit drugs (not cigarettes) without parental approval; culturally sanctioned use such as sips of parents' wine are not rated; in a restricted environment such as in young person unit or correctional facility, severity should be based on observations of attitude and interest expressed and apparent intentions regarding abstinence/treatment.
!!![_] 29 Suicidality
Suicidality is rated on the basis of both behaviour and ideation. There must be clear evidence of intention to cause self-harm to rate behaviour as a suicide attempt; accidental self-injury is not rated. Also, do not include injury or illness as a consequence of other symptomatic behaviour such as substance abuse or eating disorder, unless specific suicidal intent is expressed. Use the Risk Assessment and Care Plan if this scores >1
!!![_] 30 Defiance
A style of opposition, noncompliance, and/or refusal to follow directives from authority figures; some degree of defiance is normally expected, and behaviour should be rated as problematic only if it deviates from age and cultural norms.
!!![_] 31 Destruction of Property
Refers to deliberate destruction of the young person's own or other people's property, whether in rage episodes or not, such as graffiti, breaking windows, throwing things, etc.
!!![_] 32 Physical harm to others
Aggressive and/or sadistic behaviour that could or does result in harm to other people or animals; socially or culturally sanctioned forms of aggression (e.g. hunting, killing insects) are not considered, unless they are conducted in an unusually sadistic manner (e.g. taking pleasure in pulling the wings off butterflies). Use the Risk Assessment and Care Plan if this scores >1.
!!![_] 33 Problematic sexual behaviour
Rate preoccupations, anxieties and behaviours that cause distress, conflict, or risk to the young person or others. These may include acting out, such as promiscuity, abuse, or exhibitionism, or inhibitions, such as obsessive worrying about sexual matters or anxieties that inhibit social interactions. Gender identity issues are not rated here unless accompanied by problematic sexual anxieties or behaviours. Use the Risk Assessment and Care Plan if this scores >1
!!![_] 34 Psychotic experiences
Presence of psychotic symptoms, such as Delusions (firmly held false beliefs held without objective evidence, often impossible or highly improbable. Delusions are not affected by rational argument or evidence to the contrary, and are not a conventional belief in the context of the person's social or cultural background) or Hallucinations (any experience of objectively unrealistic perceptions, such as hearing, seeing, hallucinations of touch or smelling things that others do not, when NOT under the influence of intoxicating substances. Rate descriptively only, not based on presumed cause. Rate flashbacks only if they are experienced as real, rather than as intense memory.)
!!![_] 35 Elated mood
Mood which is unusually 'high', 'giddy', manic, unrealistically happy, out of proportion to real events. Irritability associated with manic states is rated separately.
!!![_] 36 Mentalizing Capacity
The capacity the young person has to show sensitive recognition of other people's changing mental states and the effect these have upon their actions, or to reflect thoughtfully upon affective states of their own. When present, the young person demonstrates 'mind-mindedness', but when absent there may be callous, unemotional traits or an incapacity to tolerate frustration and affective states without resorting to defensive or displacement activities.

!@@color(green):Response to the Situation@@

!!![_] 37 Insight	
The extent to which the young person demonstrates an age-appropriate awareness and understanding of his/her problems/difficulties.
!!![_] 38  Engagement with treatment and care
The extent to which the young person is successfully engaged in the development and carrying out of his or her treatment and care.

!@@color(green):Complexity of the situation@@

!!![_] 39 Chronicity
The length of time the young person has experienced significant behavioural or emotional problems (not limited to the presenting problem)
!!![_] 40 Pervasiveness
The extent to which the major problems the young person presents are evident in multiple settings or domains of functioning e.g. family, education, psychological, physical, social-environmental.
/*{{{*/
(function() {
	var $ = jQuery,
		plugin;
		config.macros.tree = {};
	plugin = config.macros.tree;
	plugin.handler = function(place,macroName,params) {
		var tags = params[0],
			$contentsList;
		if(!tags) {
			return;
		}
		tags = params[0].readBracketedList();
		$contentsList = $('<ul></ul>')
			.appendTo(place);
		$.each(tags, function(i, tag) {
			plugin.addListItems(tag, $contentsList);
		});
	};
	plugin.addListItems = function(tag, $parentList, recursionLevel) {
		if(!recursionLevel) {
			recursionLevel = 0;
		}
		var tiddlers,
			moreTids,
			link,
			$listItem,
			$subList;

		link = createTiddlyLink(null,tag,false);
		$listItem = $('<li></li>').appendTo($parentList);
		$(link)
			.append(recursionLevel === 0 ? '<h3>'+tag+'</h3>' : tag)
			.appendTo($listItem);

		if(recursionLevel<2) {
			tiddlers = store.getTaggedTiddlers(tag);
			moreTids = tiddlers.length;
			if(moreTids) {
				$listItem.prepend('<span class="closed">+</span>');
				$subList = $("<ul></ul>")
					.css('display','none')
					.appendTo($listItem);
			
				$listItem.click(function(e) {
					$(this)
						.children('span')
						.toggleClass('closed open')
						.end()
						.children('ul')
						.slideToggle();
					return false;
				});
				
				$.each(tiddlers, function(i, tid) {
					plugin.addListItems(tid.title, $subList, recursionLevel+1);
				});
			}
		}
		if(!moreTids) {
			$listItem.click(function(e) {
				return false;
			});
		}
	};
}());
/*}}}*/

/* structure we're aiming for:
	<ul>
		<li>
			<span class="open">+</span><a><h3>Introduction</h3></a>
			<ul>
				<li><a>Overview of AMBIT</a></li>
				<li><a>Core Features of Ambit</a></li>
				<li><a>Feedback Please!</a></li>
				<li><a>Find your way around</a></li>
				<li><a>Security and authorisation</a></li>
				<li><a>Start here: Mark the task</a></li>
				<li><a>Using the Manual</a></li>
				<li><a>Videos</a></li>
			</ul>
		</li>
		<li><span>+</span><a><h3>What is our team?</h3></a>
			<ul class="closed">
				<li><a>Sample link</a></li>
			</ul>
		</li>
		<li><span>+</span><a><h3>What's the problem?</h3></a>
			<ul class="closed">
				<li><a>Sample link</a></li>
			</ul>
		</li>
		<li><span>+</span><a><h3>what to do?</h3></a>
			<ul class="closed">
				<li><a>Sample link</a></li>
			</ul>
		</li>
		<li><span>+</span><a><h3>Who does what?</h3></a>
			<ul class="closed">
				<li><a>Sample link</a></li>
			</ul>
		</li>
		<li><span>+</span><a><h3>Why do this?</h3></a>
			<ul class="closed">
				<li><a>Sample link</a></li>
			</ul>
		</li>
	</ul>
*/
/***
|''Name:''|ValueSwitcherPlugin|
|''Description:''|Gather values from a definition tiddler, and present the user with a UI for setting a value from those available options as an extende field |
|''Version:''|0.2|
|''Date:''|25 Sept, 2007|
|''Source:''|http://www.hawksworx.com/playground/TeamTasks/#ValueTogglerPlugin|
|''Author:''|PhilHawksworth (phawksworth (at) gmail (dot) com)|
|''License:''|[[BSD open source license]]|
|''CoreVersion:''|2.3|
***/

//{{{
// Ensure that this Plugin is only installed once.
if(!version.extensions.ValueSwitcher) 
{
	version.extensions.ValueSwitcher = {installed:true};
	config.macros.ValueSwitcher = {

		handler: function(place,macroName,params,wikifier,paramString,tiddler) {

			var fieldPrefix = "tt_";
			var params = paramString.parseParams("anon",null,true,false,false);
			var taskTiddler = getParam(params,"tiddler",null);
			if(!taskTiddler)
				taskTiddler = story.findContainingTiddler(place);
			if(!(taskTiddler && taskTiddler != 'undefined')) {
				return;
			}
			var ctrlType = getParam(params,"type",null);
			//var id = taskTiddler.id;
			//var title = id.substr(7);
			var tiddler = store.getTiddler(taskTiddler);

			// build a drop down control
			if(ctrlType == 'dropdown') {
				var showPleaseSelect = getParam(params,"showPleaseSelect", true);
				var valueSrc = getParam(params,"valuesSource", null);
				if(!valueSrc) {
					displayMessage("No definition tiddler defined for a TeamTasks dropdown.");
					return;
				}
				var fieldName = fieldPrefix + valueSrc.toLowerCase().substr(0,valueSrc.length-11);
				var selected = fieldName + '::' + store.getValue(tiddler,fieldName);
				var values = this.getDefValues(valueSrc);
				var options = [];
				if(showPleaseSelect==="true") {
					options.push({'caption': 'Please select', 'name': null});
				}
				for (var i=0; i < values.length; i++) {
					options.push({'caption': values[i], 'name': fieldName + '::' + values[i]});				
				}
				var dd = createTiddlyDropDown(place,this.setDropDownMetaData,options,selected);
				dd.tiddler = tiddler;
			}
			// Build a free text box.
			else if(ctrlType == 'freetext') {
				var metaDataName = getParam(params,"metaDataName", null);
				if(!metaDataName) {
					displayMessage("No metaDataName defined for a TeamTasks free text box.");
					return;
				}	
				var fieldName = fieldPrefix + metaDataName.toLowerCase();
				var text = store.getValue(tiddler,fieldName);
				if(text == undefined) text = "";	
				var i = createTiddlyElement(place,"input",null,null,null,{"value":text, "type":"input", "ttname":fieldName});
				i.onblur = config.macros.ValueSwitcher.changeFreetext;
			}

			/*
				TODO: Build in deadline support
			*/
		},


		//Get definition values for populating UI from definition tiddlers.
		getDefValues: function(src) {
			var text = store.getTiddlerText(src).split('\n');
			var output = [];
			for(var t=0; t<text.length; t++) {
				//support calling the old TaskViewBuilder macro to list the tasks here too.
				var blob = wikifyStatic(text[t],null,tiddler,null);				
				var linktitle = /tiddlylink="[^"]*"/mg;
				var titles = blob.match(linktitle);
				if(titles) {
					for(var n=0; n<titles.length; n++) {
						output.push(titles[n].replace(/tiddlylink="([^"]*)"/,'$1'));
					}
				}
				else {
					output.push(text[t]);
				}
			}
			return (output);	
		},


		// Ensure that changes to a dropdown field are stored as an extended field.
		setDropDownMetaData: function(ev) {
			var e = ev ? ev : window.event;
			//var taskTiddler = story.findContainingTiddler(this);
			var taskTiddler = this.tiddler;
			if(taskTiddler && taskTiddler != undefined) {
				//var title = taskTiddler.getAttribute('tiddler');
				//var tiddler =  store.getTiddler(title);
				var title = taskTiddler.title;
				var tiddler = taskTiddler;

				var option = this[this.selectedIndex].value.split('::');
				var extField = option[0];
				var extFieldVal = option[1];
				store.setValue(tiddler,extField,extFieldVal);
				story.saveTiddler(title);
			}
		},


		// Ensure that changes to a free text field are stored as an extended field.
		changeFreetext: function(ev) {
			var e = ev ? ev : window.event;
			var ttField = this.getAttribute('ttname');
			var value = this.value;
			if(ttField) {
				var t = story.findContainingTiddler(this);
				var title = t.getAttribute('tiddler');
				var tiddler =  store.getTiddler(title);
				store.setValue(tiddler,ttField,value);
				story.saveTiddler(tiddler);
			}
			return false;
		}
	};
}
//}}}
<!--{{{-->
<div class="paperSheet">
	<div class="headingPanel">
		<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]] icons:yes height:16 width:16 more:popup'></div>
		<span class="right localOrNot" macro="localOrNot"></span>
		<h2 class='title' macro='view title text'></h2>
		<a href="#"><span class="left panelToggle">show related information</span></a>
		<div class="infoPanel">
			<ul>
				<li><h4>Information:</h4></li>
				<li>Edited by <span macro='view modifier link'></span></li>
				<li>Edited on <span macro='view modified date "DDth MMM YYYY at hh:mm"'></span></li>
				<li>Explore this topic's <span macro="ambitRevisions"></span></li>
				<li>Explore this topic's <span macro="ambitReferences"></span></li>
			</ul>
			<ul>
				<li><h4>Elsewhere:</h4></li>
				<li>There are <span macro="ambitElsewhere"> other manuals</span> with different versions of this topic</li>
			</ul>
			<ul>
				<li><h4>This topic contains these sub-topics:</h4></li>
				<div macro="ambitTagging"></div>
				<span macro="newHere label:'new sub-topic' title:'new sub-topic'"></span>
			</ul>
			<ul>
				<li><h4>This topic is a sub-topic of:</h4></li>
				<div macro="ambitTags"></div>
			</ul>
		</div>
		<!--<div class="meta" macro='viewRevisions page:5'>
			last modified by <span class="modifier" macro="view modifier"></span> on <span macro="view modified date 'DDth MMM YYYY'"></span>
		</div>-->
	</div>
	<div class="content">
		<div class='viewer' macro='view text wikified'></div>
		<br class="clearboth" />
	</div>
</div>
<!--}}}-->
/*{{{*/
(function($) {
	var $readingList,
		plugin;
	config.macros.youAreReading = {};
	plugin = config.macros.youAreReading;
	
	plugin.handler = function(place) {
		if(!$readingList) {
			$(document).bind("startup", this.dispatch);
		}
		$readingList = $('<ul></ul>').appendTo(place);
	};
	plugin.addItem = function(title, flashing) {
		var link = createTiddlyLink(null,title,true,(flashing ? "active" : "")),
			$newItem = $('<li></li>')
				.append('<span class="close">x</span>')
				.append(link);
		$newItem
			.appendTo($readingList)
			.find('span.close')
			.click(function() {
				story.closeTiddler(title, true);
			});
		if(flashing) {
			$newItem.css('backgroundColor', '#FFF')
				.fadeOut(function() {
					$newItem.fadeIn(function() {
						$newItem.css('backgroundColor', 'transparent');
					});
				});
		}
	};
	plugin.refreshList = function(activeTitle, omit) {
		var title,
			active,
			id,
			idPrefix = "",
			prefixLength = idPrefix.length;
		$readingList.empty();
		$(story.getContainer())
			.find('.tiddler')
			.each(function(i, tid) {
				id = $(tid).attr("tiddler");
				title = id.substring(prefixLength);
				if(title && omit!==title) {
					active = activeTitle===title;
					plugin.addItem(title, active);
				}
			});
	};
	plugin.dispatch = function() {
		// populate list with default story
		plugin.refreshList();
			
		var tmpDisplayTiddler = Story.prototype.displayTiddler;
		Story.prototype.displayTiddler = function(srcElement,tiddler,template,animate,slowly) {
			var $element = $(srcElement);
			// disable scrolling for opening tiddlers from #tiddlerDisplay
			if($element.closest('#tiddlerDisplay').length) {
				/*var tmpStartAnimating = anim.startAnimating;
				anim.startAnimating = function() {
					anim.startAnimating = tmpStartAnimating;
				};*/
				var tmpAnimate = config.options.chkAnimate;
				var tmpScrollTo = window.scrollTo;
				window.scrollTo = function() {
					window.scrollTo = tmpScrollTo;
					config.options.chkAnimate = tmpAnimate;
				};
				config.options.chkAnimate = false;
				var tmpPositionTiddler = Story.prototype.positionTiddler;
				Story.prototype.positionTiddler = function() {
					Story.prototype.positionTiddler = tmpPositionTiddler;
					return null; // open at bottom
				};
				// animate the title over to the you are reading list
				var linkText = $element.is('a') ? $element.text() : (tiddler instanceof Tiddler ? tiddler.title : tiddler),
					$linkClone = $("<span>"+linkText+"</span>").appendTo($('#mainpane')),
					y = $element.offset().top,
					mainPaneOffset = $('#mainpane').offset(),
					x = $element.offset().left-mainPaneOffset.left,
					$readingList = $('#youAreReading li'),
					$target = $readingList.eq($readingList.length-1),
					toY = $target.offset().top + $target.height() + parseInt($target.css('paddingTop'),10) + parseInt($target.css('paddingBottom'),10) + parseInt($target.css('marginTop'),10) + parseInt($target.css('marginBottom'),10),
					toX = $target.offset().left;
				$linkClone.css({
					"position": "absolute",
					"z-index": "10",
					"top": y+'px',
					"left": x+'px',
					"lineHeight": "1em",
					"color": "#000000",
					"opacity": 0.7
				}).animate({
					'opacity': 0.5,
					'top': toY+'px',
					'left': toX-mainPaneOffset.left+'px'
				},
				1000,
				function() {
					$(this).remove();
				});
			}
			// recreate list when tiddler opened - JRL: this looks wrong, as title is used before it is defined...
			var t = story.chooseTemplateForTiddler(title, template);
			tmpDisplayTiddler.apply(this, [srcElement, tiddler, template, animate, slowly]);

			if(t.indexOf('ViewTemplate')!==-1) {
				var title = (tiddler instanceof Tiddler) ? tiddler.title : tiddler;
				plugin.refreshList(title);
			}
		};
		
		// recreate list when tiddler closed
		var tmpCloseTiddler = Story.prototype.closeTiddler;
		Story.prototype.closeTiddler = function(title, animate, unused) {
			tmpCloseTiddler.apply(this, arguments);
			plugin.refreshList(title, title);
		}
	};
}(jQuery));
/*}}}*/
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>)</div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
	<title>Account</title>
	<link href="/bags/common/tiddlers/profile.css" type='text/css' rel='stylesheet' >
	<link href="/bags/common/tiddlers/admin.css" type='text/css' rel='stylesheet' >
	<link href="/bags/common/tiddlers/jquery-ui.custom.css" type='text/css' rel='stylesheet' >
</head>
<body>

<div id="container">
	<div class="main section">
		<a class="app" href="/">home</a>
		<div class="left">
		<div id="siteiconArea">
		<h2>User Icon</h2>
		<div>
			<img id="siteicon" class="siteicon">
			<form id="upload" method="POST" enctype="multipart/form-data">
				<input type="hidden" name="title" value="SiteIcon" />
				<input type="hidden" name="tags" value="excludeLists">
				<input type="hidden" name="csrf_token" class="csrf" />
				<input type="file" name="file" accept="image/*" />
				<input type="submit" value="upload" />
			</form>
			<div id="dropzone">Drop file here
				<img class="notloading" src="/bags/common/tiddlers/ajax-loader.gif" alt="submitting SiteIcon" />
			</div>
		</div>
		</div>
		<h2>Find Space</h2>
		<form class="spaceSearch">
			<input class="inputBox" type="text" placeholder="find space" />
			<a href="http://docs.tiddlyspace.com/What%20is%20a%20Space%3F" class="help"
				title="What is a space?">What is a space?</a>
			<button>view all</button>
		</form>
		<div class='list-container'>
			You are a member of the following spaces:
			<ul class='ts-space-search'>
			</ul>
		</div>
		<h2>Create New Space</h2>
		<form class="ts-spaces">
			<input class="inputBox" type="text" name="spacename" placeholder="space name"><span class="hostSuffix">.tiddlyspace.com</span>
			<input type="submit" value="Create Space" />
		</form>
		</div>
		<div class="right">
		<h2>Change Password</h2>
		<form class="ts-password">
			<input class="inputBox" placeholder="existing password" type="password" name="password">
			<input class="inputBox" placeholder="new password" type="password" name="new_password">
			<input class="inputBox" placeholder="new password"	type="password" name="new_password_confirm">
			<input type="submit" value="Change password">
		</form>
		<h2>OpenID</h2>
		<h3>Why OpenID?</h3>
		<a href="http://openid.net/"><img src="/bags/common/tiddlers/openid.png" alt="openid" ></a><br />
		Use just one username and password across hundreds of OpenID-enabled sites.<br />
		It's an open standard.<br />
		<a href="http://openid.net/what/">learn more</a>
		<ul class="ts-identities"></ul>
		<form class="ts-openid" target="_top">
			<div>
				Add an openid:
			</div>
			<input class="inputBox" type="text" name="openid" placeholder="your openid" />
			<input type="submit" value="Register" />
			<a href="http://openid.net/get-an-openid/" class="help"
			title="What is an open id?">What is an open id?</a>
		</form>
		</div>
		<div class="clear"></div>
	</div>
</div>
<script src="/bags/common/tiddlers/backstage.js"></script>
<script src='/bags/common/tiddlers/jquery.js'></script>
<script src='/bags/tiddlyspace/tiddlers/chrjs'></script>
<script src='/bags/common/tiddlers/chrjs.space'></script>
<script src='/bags/common/tiddlers/chrjs.users'></script>
<script src='/bags/common/tiddlers/chrjs.identities'></script>
<script src="/bags/common/tiddlers/jquery-ui.custom.js"></script>
<script src='/bags/common/tiddlers/jquery-form.js'></script>
<script src="/bags/common/tiddlers/siteiconupload.js"></script>
<script src='/bags/common/tiddlers/ts.js'></script>
<script src="/status.js"></script>
<script type="text/javascript">
/*
 * jQuery UI Autocomplete HTML Extension
 *
 * Copyright 2010, Scott González (http://scottgonzalez.com)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 *
 * http://github.com/scottgonzalez/jquery-ui-extensions
 */
(function( $ ) {

var proto = $.ui.autocomplete.prototype,
	initSource = proto._initSource;

function filter( array, term ) {
	var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" );
	return $.grep( array, function(value) {
		return matcher.test( $( "<div>" ).html( value.label || value.value || value ).text() );
	});
}

$.extend( proto, {
	_initSource: function() {
		if ( this.options.html && $.isArray(this.options.source) ) {
			this.source = function( request, response ) {
				response( filter( this.options.source, request.term ) );
			};
		} else {
			initSource.call( this );
		}
	},

	_renderItem: function( ul, item) {
		return $( "<li></li>" )
			.data( "item.autocomplete", item )
			.append( $( "<a></a>" )[ this.options.html ? "html" : "text" ]( item.label ) )
			.appendTo( ul );
	}
});

})( jQuery );

/***
_accounts application specific javascript
***/
var link;
ts.init(function(ts) {
	if(ts.user.anon) { // redirect to homepage when user not logged in
		window.location = ts.getHost();
	} else if(ts.user.name === ts.currentSpace){
		initSiteIconUpload(ts.user.name);
	} else {
		link = $("<a />").attr("href", ts.getHost(ts.user.name) + "/_account").text("Change User Icon");
		$("#siteiconArea div").empty().append(link);
	}
	$(".hostSuffix").text("." + ts.getHost("").split("//")[1]);
	ts.getSpaces(function(spaces) {
		$("<div class='info' />").text("You have " + spaces.length + " spaces.").insertBefore($(".spaceSearch")[0]);
		$("form.spaceSearch input").autocomplete({
			html: true,
			source: function(req, response) {
				ts.getSpaces(function(spaces) {
					var selected = [];
					for(var i = 0; i < spaces.length; i++) {
						var space = spaces[i];
						if(space.name.indexOf(req.term) > -1) {
							var host = ts.getHost(space.name) ;
							var img = host + "/SiteIcon";
							selected.push({
								value: space.name,
								label: '<a href="' + host + '" target="_parent" class="autocompleteLink"><img src="' + img + '" style="height:24px;width:auto;max-height:24px;max-width:24px;"/>' + space.name + '</a>'
							});
						}
					}
					response(selected);
				});
			},
			select: function(event, ui) {
				window.top.location = ts.getHost(ui.item.value);
			}
		});

		var $ul = $('.ts-space-search');
		$.each(spaces, function(i, space) {
			$ul.append($('<li/>').html($('<a/>').attr('href', space.uri)
				.text(space.name)));
		});

		$('form.spaceSearch button').click(function(ev) {
			$('.list-container').slideToggle('fast');
			ev.preventDefault();
			return false;
		});
	});
});

if(window != window.top) {
	$("html").addClass("iframeMode");
	$("a").live("click",function(ev) {
		$(ev.target).attr("target", "_parent");
	});
}
</script>
<!--[if lt IE 8]>
<script type="text/javascript" src="/bags/common/tiddlers/json2.js"></script>
<![endif]-->
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<title>Reply</title>
	<link rel="stylesheet" href="//tiddlyspace.com/bags/benspa_public/tiddlers/bootvelcro.css">
	<style>
		html,
		body {
			overflow: hidden;
			background-color: transparent;
		}

		#container {
			/* prevent a fouc if no images present */
			display: none;
		}

		.modal-header {
			border-bottom: none;
			padding: 5px 0 0;
			position: absolute;
			width: 100%;
			background-color: #e0e0e0;
			-webkit-border-radius: 6px 6px 0 0;
			-moz-border-radius: 6px 6px 0 0;
			border-radius: 6px 6px 0 0;
			cursor: move;
		}

		.form-actions {
			position: absolute;
			bottom: 0;
			box-sizing: border-box;
			-moz-box-sizing: border-box;
			width: 100%;
			margin: 0;
			border-radius: 0 0 6px 6px;
			background-color: #e0e0e0;
			border-top: 1px solid gray;
		}

		.form-actions input.btn {
			width: auto;
			float: right;
			margin: 0 0.2em;
		}

		.closeBtn {
			background-color: #DCE7F1 !important;
		}

		.primary {
			background-color: #09F !important;
		}

		h1 {
			margin-bottom: 9px;
			margin-top: 9px;
		}

		body {
			width: 100%;
			height: 100%;
			position: absolute;
		}

		.modal {
			margin: 10px;
			top: 0;
			left: 0;
			bottom: 0;
			width: 510px;
			position: absolute;
			box-shadow: #444 0px 0px 10px 2px;
			border-radius: 6px;
			background-color: white;
			border: 1px solid gray;
			background-color: #F0F4F8;
		}

		label em {
			cursor: pointer;
		}

		.modal-body {
			overflow: auto;
			position: absolute;
			top: 0;
			bottom: 0;
			left: 0;
			right: 0;
			margin: 65px 20px 67px;
			background-color: transparent;
		}

		.nav-tabs {
			padding-left: 1%;
			margin: 0;
			width: 99%;
			border-color: gray;
		}

		.nav-tabs > li {
			cursor: pointer;
		}

		.nav-tabs > li > a {
			line-height: 2.4em;
			font-weight: bold;
			font-size: 100%;
		}

		.nav-tabs > li.active > a{
			background-color: #F0F4F8;
			border-color: gray;
			border-bottom-color: #F0F4F8;
		}

		.active {
			display: block;
		}

		input,
		textarea,
		select,
		.uneditable-input {
			color: #606060;
		}

		.imagePicker {
			-moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
			-webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
			box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
			border: 1px solid #CCC;
			height: 110px;
			overflow: auto;
			-webkit-border-radius: 3px;
			-moz-border-radius: 3px;
			border-radius: 3px;
			margin-left: 0;
		}

		.imagePicker img {
			margin: 5px;
			border: 2px solid transparent;
		}

		.imagePicker .current {
			border: 2px dotted #555;
		}

		label {
			font-weight: bold;
		}

		.form-actions label {
			float: left;
			margin-top: 0.75em;
		}

		fieldset input,
		fieldset textarea {
			width: 90%;
			border-color: gray;
		}

		@media all and (max-width: 550px) {
			.modal {
				width: 95%;
			}
		}

		#help {
			position: absolute;
			border: 0;
			right: 4px;
			top: 5px;
			text-indent: -9999px;
			color: transparent;
			height: 16px;
			width: 16px;
			background: none;
			background-image: url(/bags/common/tiddlers/help.png);
			background-repeat: no-repeat;
			background-color: white;
			z-index: 2;
			border-radius: 10px;
		}

		#help-info {
			padding: 0;
			border: 1px solid gray;
			width: 60%;
			height: 50px;
			color: #404040;
			background-color: white;
			position: absolute;
			top: 5px;
			right: 5px;
			z-index: 1;
			cursor: auto;
			border-radius: 5px;

		}

		#help-info p {
			padding: 10px 25px;
			margin-bottom: 0;
		}
	</style>
</head>
<body>
	<div id="container">
		<form action="#" class="modal">
			<div class="modal-header">
				<button id="help">help</button>
				<div id="help-info" style="display:none;"><p>
				Found something interesting? Write about it in your own space. <a href="//docs.tiddlyspace.com/Reply to this Tiddler" target="_blank">Find out more</a>
				</p></div>
				<ul class="nav nav-tabs" data-tabs="tabs">
					<li class="active" data-tab-name="post"><a href="#postForm">Reply</a></li>
				</ul>
			</div>


			<fieldset id="postForm" class="modal-body">
				<label>Title
					<input type="text" name="title">
				</label>
				<input type="hidden" name="url">
				<label>Post
					<textarea name="text" rows="8"></textarea>
				</label>
				<label>Tags
					<input type="text" name="tags" value="">
				</label>
			</fieldset>


			<div class="form-actions">
				<label class="checkbox">
					<input type="checkbox" name="private" val="private">
					keep private
				</label>
				<input type="submit" class="btn primary btn-large" value="Done">
				<input type="button" class="btn btn-large closeBtn" value="Cancel">
			</div>
		</form>
	</div>

	<script type="text/javascript"
            src="/bags/common/tiddlers/jquery.js"></script>
	<script type="text/javascript" src="/bags/tiddlyspace/tiddlers/chrjs"></script>
	<script type="text/javascript" src="/bags/common/tiddlers/_reply.js"></script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
	<title>This Space</title>
	<link href="/bags/common/tiddlers/profile.css" type='text/css' rel='stylesheet' >
	<link href="/bags/common/tiddlers/admin.css" type='text/css' rel='stylesheet' >
	<!--[if lte IE 8]>
	<script type="text/javascript" src="/bags/common/tiddlers/json2.js"></script>
	<script type="text/javascript" src="/bags/common/tiddlers/es5-shim.min.js"></script>
	<![endif]-->
</head>
<body>
<div id="container">
	<div id="text-html" class="main section">
		<a class="app" href="/">home</a>
		<div class="left">
		<h2>About this space <button class='toggleNext'></button></h2>
		<div id="siteinfo"></div>
		<h2>Site Icon</h2>
		<div>
			<img id="siteicon" class="siteicon">
			<form id="upload" method="POST" enctype="multipart/form-data">
				<input type="hidden" name="title" value="SiteIcon" />
				<input type="hidden" name="tags" value="excludeLists">
				<input type="hidden" name="csrf_token" class="csrf" />
				<input type="file" name="file" accept="image/*" />
				<input class="btn" type="submit" value="upload" />
			</form>
			<div id="dropzone">Drop file here
				<img class="notloading" src="/bags/common/tiddlers/ajax-loader.gif" alt="submitting SiteIcon" />
			</div>
		</div>
		<h2>Vital Statistics</h2>
		<div id="info">please wait while information is loaded about this space...</div>
		<button class="spacereset">Reset Space</button>
		<div class="reset-confirm-wrap messageArea">
			<button class="close-btn" title="cancel reset">×</button>
			<p>Are you sure you want to reset the space? You can't go back! This will remove all the content from the space!</p>
			<form class="cf">
				<label for="reset-confirm">Enter the space name to confirm.</label>
				<input type="text" name="reset-confirm" class="reset-confirm-input inputBox" />
				<button type="submit">Reset Now</button>
			</form>
			<div class="reset-message-area">
				<p class="performing">Resetting...</p>
				<p class="finished">Reset Done!</p>
				<p class="recipe-error-msg">Error removing includes. Please remove manually.</p>
			</div>
		</div>
		</div>
		<div class="right">
		<div class="ts-membership">
			<h2>
				Add Member
				<a href="http://docs.tiddlyspace.com/What%20is%20a%20member%3F" title="What is a Member?" class="help">What is a Member?</a>
			</h2>
			<div>
				<p>Add a new member to your space by entering their name below. Enter a space name instead and prefix with @ to add everyone who is already a member of that space.</p>
				<form class="ts-members">
					<input class="inputBox" type="text" name="username">
					<input type="submit" value="Add Member" class="btn" />
				</form>
			</div>
			<h2>
				Existing Members <button class='toggleNext'></button>
			</h2>
			<div>
				Your space currently has the following members: 
				<ul class="ts-members"></ul>
			</div>
			<h2>
				Include Space
				<a class="help" href="http://docs.tiddlyspace.com/What%20is%20space%20inclusion%3F" title="What is inclusion?">What is Inclusion?</a>
			</h2>
			<form class="ts-includes">
				<input class="inputBox" type="text" name="spacename">
				<input type="submit" value="Include Space" class="btn" />
			</form>
		</div>
		<div>
			<h2>Included Spaces <button class='toggleNext'></button></h2>
			<div>
			This space includes the following spaces:
			<ul class="ts-includes"></ul>
			</div>
		</div>
		</div>
		<div class="clear"></div>
	</div>
</div>
<script src='/bags/common/tiddlers/backstage.js'></script>
<script src='/bags/common/tiddlers/jquery.js'></script>
<script src='/bags/tiddlyspace/tiddlers/chrjs'></script>
<script src='/bags/common/tiddlers/chrjs.space'></script>
<script src='/bags/common/tiddlers/chrjs.users'></script>
<script src='/bags/common/tiddlers/chrjs.identities'></script>
<script src='/bags/tiddlyspace/tiddlers/TiddlySpaceCSRF'></script>
<script src='/bags/common/tiddlers/jquery-form.js'></script>
<script src="/bags/common/tiddlers/siteiconupload.js"></script>
<script src="/bags/common/tiddlers/ts.js"></script>
<script src="/status.js"></script>
<script src="/bags/common/tiddlers/space.js"></script>
</body>
</html>
@@Please do not modify this tiddler; it was created automatically upon space creation.@@
@@Please do not modify this tiddler; it was created automatically upon space creation.@@
iVBORw0KGgoAAAANSUhEUgAAAEQAAABACAIAAAAs4EbzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAADXlJREFUeNrsWnlUU1caf+8lYcnCkoR9l92yg4K2Fq1isWMLKmjVWtHTxdbxn1rrsaOtC3rqONa2M+LUkepMp3rUgraoaAHL5oIiUkA22UoImxAgGwkk780Hb/LOCyEY3E+Pl5x3nnn33ne/7ff9vi+ihFqJ/FEG+lyY58I8F+a5MH+IgT3yHYnRK667gdHQIt6z78CiZStPnz2v0T0lP8+0ZYjRD0pujSDyIW1hYUFOTl5hYRGTyWQwGHPmzNmwYb0j3xrXTYMbxjMoDCkJppOnrbv3pzM/+fj5xMTEFBVd+faf33Z2deI4HhAQsGnTprCpvoRuFaoT7Fm0DMjT0CrOysqKi4sL8vMmHzW3dX39zd+Liwq1Wq2zi0tqamr4C37aUTGwZx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pDwC2D4kchsj/J/nyvPboz2R0cWBJNZZTzrchnsNudB4+WFnREOd1qn4CJD5wmLcOR8AekyivIVQgXrCfQIC80TYibURC1HIyXKILSd83JYlheKnhdIIElSMuorAVkyiebTJBYT2plSg1pn6j58PB9YhqrKPkSvWg1ouU4ikTDGJJIvIYBEN+5G7rldTJZADiQMDmjzssBfC/5CP2rJ42iW/xOnm235aJ+k32AQKWrQJ8x09OaihBqAdkYEoVYbKTjCXAhmlZFZ7T0RBy3QG1ntusEsFlTl5++Gsa56mdrTzlAhDFqK8T8KQdgj0EREpBKChJk1N/MO0iDqWA0zciwlU4xVDnmZ+NN8DMMgVjkP2qBoOq9987HgywE7oMLimnyvlFE2xGacX10tr4OU5pRSaCo1YAYajjnfsJhmnrFfYObnXS6ASGLLNQzT6XRigVgHfphYwMbIAjIGBAgLM9cwqhi0MZ0FNOyi1ULVgc/AlLQZMUhk4Yy4VWBXCh4Vo7J1ulaMF5ly5j80oVC51Dsy7TfZN9zdZDeKiuqbqY4dOuWSzYJhrWCIZqsC96lUsIBqX0wVkFvBC2zBlEuFbKyVRAawAWTymrKHO8Wdffa62PRvzpHZd3mponZ5gMlkChjpopHJyomyE4xJxtmyUuF3O+6cvvvqXT02+38CDADRtrlAPje1nwAAAABJRU5ErkJggg==
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8"/>
	<title>TiddlySpace Apps</title>
	<link rel="stylesheet" href="/bags/common/tiddlers/reset.css" />
	<link rel="stylesheet" href="/bags/common/tiddlers/appspage.css" />
	<!--[if lt IE 7 ]>
	<link rel="stylesheet" href="/bags/common/tiddlers/appspageie6.css" />
	<![endif]-->
</head>
<body>
	
	<div id="wrapper">
		<div id="TSbar"></div>
		<div id="main-content">
			<div id="space-details">
				<a href="/_space"><img class="siteicon"></a>
				<div id="title-subtitle">
					<h1 class="spaceaddress">
						<span class="spaceName"></span><span class="hostName"></span>
					</h1>
					<p class="tagline"><span class="subTitle"></span><a class="managespaces" href="/_space">manage space</a></p>
				</div>
			</div>
			<div id="holder">
				<div id="appswitcher-wrapper">
					<div id="appswitcher">
						<h2>Your Apps</h2>
						<ul id="app-list">
							<li class="htmlserialisation">
								<a href="/tiddlers.html?select=tag:!excludeLists;sort=-modified">
									<img src="/bags/common/tiddlers/browse_read_blue.png" alt="Icon for the HTML Serialisation" class="app-img" />
									BROWSE
								</a>
							</li>
							<li class="tiddlywiki">
								<a href="/tiddlers.wiki">
									<img src="/bags/common/tiddlers/tiddlywiki2_blue.png" alt="Icon for TiddlyWiki" class="app-img" />
									TIDDLYWIKI
								</a>
							</li>
						</ul>
						<div id="addapp">
							<button class="inactive">Add More!</button>
						</div>
					</div>
					<div id="app-desc">
						<ul>
							<li class="htmlserialisationdesc"><p>an easy to understand HTML representation of your content.</p></li>
							<li class="tiddlywikidesc"><p>use TiddlyWiki to create, edit and organise your content.</p></li>
						</ul>
					</div>
					<div style="clear: both;"></div>
				</div>
			</div>
		</div>
		<div id="footer"><!-- ie doesn't support footer tag -->
			<div id="footer-content">
				<div class="links">
					<a href="http://blog.tiddlyspace.com">blog</a>
					<a href="http://featured.tiddlyspace.com">featured</a>
					<a href="http://docs.tiddlyspace.com">documentation</a>
					<a href="https://github.com/TiddlySpace/tiddlyspace">source</a>
				</div>
				<p>TiddlySpace 2011, created by <a href="http://osmosoft.com">Osmosoft</a></p>
			</div>
		</div>
	</div>
	
	<script type="text/javascript" src="/bags/common/tiddlers/backstage.js"></script>
	<script type="text/javascript" src="/bags/common/tiddlers/jquery.js"></script>
	<script type="text/javascript" src="/bags/tiddlyspace/tiddlers/chrjs"></script>
	<script type="text/javascript" src="/bags/common/tiddlers/chrjs-store.js"></script>
	<script type="text/javascript" src="/bags/common/tiddlers/jquery-json.js"></script>
	<script type="text/javascript" src="/bags/common/tiddlers/appspage.js"></script>
</body>
</html>
<svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="100%" width="100%" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" viewBox="0 0 40 40"><metadata><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/><dc:title/></cc:Work></rdf:RDF></metadata><defs><linearGradient id="lG3826" x1="7.0996" gradientUnits="userSpaceOnUse" y1="18.829" gradientTransform="matrix(1.5858347,0,0,1.8078238,1098.1851,351.13716)" x2="1.5461" y2="-0.95166"><stop stop-color="#000" offset="0"/><stop stop-color="#9c9b99" offset="1"/></linearGradient><linearGradient id="lG3828" y2="372.44" gradientUnits="userSpaceOnUse" y1="375.7" x2="1111.7" x1="1097.7"><stop style="stop-color:#ac9393;" offset="0"/><stop style="stop-color:#c8b7b7;" offset="1"/></linearGradient></defs><g transform="translate(-1080.9375,-357.3329)"><path style="stroke-width:0;stroke-miterlimit:4;fill:url(#lG3826);" d="m1080.9,357.32,39.996-0.0426-0.01,40.008c-15.507-25.519-15.36-25.95-39.988-39.965z"/><path style="stroke-dashoffset:0;stroke:#7aa3be;stroke-linecap:round;stroke-miterlimit:4;stroke-width:1.49999988;fill:#c1e6fd;" d="m1091.9,363.55c6.5716-6.4925,16.576-7.3925,23.147-0.90003,6.5717,6.4925,6.5717,17.019,0,23.511-4.4424-8.6113-12.288-15.713-23.147-22.611z"/><path style="stroke-dashoffset:0;stroke:#ce81b0;stroke-linecap:round;stroke-miterlimit:4;stroke-width:1.5;fill:#f4c4e2;" d="m1110.2,367.62c3.217,3.2168,3.217,8.4323,0,11.649-3.8194-4.2357-8.3307-8.1824-11.649-11.649,3.217-3.2168,8.4325-3.2168,11.649-0.00002z"/><path style="stroke-linejoin:bevel;stroke:#000000;stroke-linecap:round;stroke-dasharray:none;stroke-miterlimit:4;stroke-width:0.80000001;fill:url(#lG3828);" d="m1081,357.34c18.79,6.4752,32.53,16.56,39.894,39.892-11.19-17.028-14.878-19.19-27.352-14.96,6.2984-12.098,3.9371-13.19-12.542-24.932z"/></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="72 648 70 70" 
width="30" height="30">
<g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1">
	<g>
		<path d="M 77.59005 669.34003 C 71.532745 681.90424 73.714462 697.4441 84.135193 707.86475 
		C 97.315445 721.0451 118.684715 721.0451 131.8649 707.86475 
		C 145.04515 694.68457 145.04515 673.31537 131.8649 660.13513 
		C 121.4441 649.7141 105.90419 647.53253 93.339905 653.5899 L 102.047455 662.2976 
		C 109.58637 660.2373 117.987976 662.16803 123.90997 668.08997 
		C 132.69673 676.8767 132.69673 691.12317 123.90997 699.90985 
		C 115.12313 708.6966 100.87699 708.6966 92.09012 699.90985 
		C 86.168266 693.98804 84.23744 685.58643 86.297653 678.04755 Z M 72 648 L 72 668.25 L 78.75 661.49957 
		L 99.00019 681.7502 L 105.750175 675.00006 L 85.50013 654.75012 L 92.249985 648 Z" fill="black"
		class="glyph"/>
	</g>
</g>
</svg>
/***
https://raw.github.com/tiddlyweb/chrjs/master/main.js
***/
//{{{
// TiddlyWeb adaptor
// v0.14.3

/*jslint vars: true, unparam: true, nomen: true, white: true */
/*global jQuery */

var tiddlyweb = (function($) {

"use strict";

var tw = {
	routes: {
		// host is the TiddlyWeb instance's URI (including server_prefix)
		// placeholders "_type" & "name" refer to the respective bag/recipe
		root     : "{host}/",
		bags     : "{host}/bags",
		bag      : "{host}/bags/{name}",
		recipes  : "{host}/recipes",
		recipe   : "{host}/recipes/{name}",
		tiddlers : "{host}/{_type}s/{name}/tiddlers",
		tiddler  : "{host}/{_type}s/{name}/tiddlers/{title}",
		revisions: "{host}/{_type}s/{name}/tiddlers/{title}/revisions",
		revision : "{host}/{_type}s/{name}/tiddlers/{title}/revisions/{revision}",
		search   : "{host}/search?q={query}"
	}
};

var convertTimestamp, supplant;

// host (optional) is the URI of the originating TiddlyWeb instance
tw.Resource = function(type, host) {
	if(arguments.length) { // initialization
		this._type = type;
		if(host !== false) {
			this.host = host !== undefined ? host.replace(/\/$/, "") : null;
		}
	}
};
$.extend(tw.Resource.prototype, {
	// retrieves resource from server
	// callback is passed resource, status, XHR (cf. jQuery.ajax success)
	// errback is passed XHR, error, exception, resource (cf. jQuery.ajax error)
	// filters is an optional filter string (e.g. "select=tag:foo;limit=5")
	get: function(callback, errback, filters) {
		var uri = this.route();
		if(filters) {
			var separator = uri.indexOf("?") === -1 ? "?" : ";";
			uri += separator + filters;
		}
		var self = this;
		return $.ajax({
			url: uri,
			type: "GET",
			dataType: "json",
			success: function(data, status, xhr) {
				var resource = self.parse(data);
				resource.etag = xhr.getResponseHeader("Etag");
				callback(resource, status, xhr);
			},
			error: function(xhr, error, exc) {
				errback(xhr, error, exc, self);
			}
		});
	},
	// sends resource to server
	// callback is passed data, status, XHR (cf. jQuery.ajax success)
	// errback is passed XHR, error, exception, resource (cf. jQuery.ajax error)
	put: function(callback, errback) {
		var self = this;
		var options = {
			url: this.route(),
			type: "PUT",
			contentType: "application/json",
			data: JSON.stringify(this.baseData()),
			success: function(data, status, xhr) {
				callback(self, status, xhr);
			},
			error: function(xhr, error, exc) {
				errback(xhr, error, exc, self);
			}
		};
		if(this.ajaxSetup) {
			this.ajaxSetup(options);
		}
		return $.ajax(options);
	},
	// deletes resource on server
	// callback is passed data, status, XHR (cf. jQuery.ajax success)
	// errback is passed XHR, error, exception, resource (cf. jQuery.ajax error)
	"delete": function(callback, errback) {
		var self = this;
		var options = {
			url: this.route(),
			type: "DELETE",
			success: function(data, status, xhr) {
				callback(self, status, xhr);
			},
			error: function(xhr, error, exc) {
				errback(xhr, error, exc, self);
			}
		};
		if(this.ajaxSetup) {
			this.ajaxSetup(options);
		}
		return $.ajax(options);
	},
	// returns an object carrying only the essential information of the resource
	baseData: function() {
		var data = {},
			self = this;
		$.each(this.data, function(i, item) {
			var value = self[item];
			if(value !== undefined) {
				data[item] = value;
			}
		});
		return data;
	},
	// returns corresponding instance from a raw object (if applicable)
	parse: function(data) {
		return data;
	},
	// list of accepted keys in serialization
	data: [],
	// returns resource's URI
	route: function() {
		return supplant(tw.routes[this._type], this);
	}
});

var Container = function(type, name, host) {
	if(arguments.length) { // initialization
		tw.Resource.apply(this, [type, host]);
		this.name = name;
		this.desc = "";
		this.policy = new tw.Policy({});
	}
};
Container.prototype = new tw.Resource();
$.extend(Container.prototype, {
	tiddlers: function() {
		return new tw.TiddlerCollection(this);
	},
	parse: function(data) {
		var type = tw._capitalize(this._type),
			container = new tw[type](this.name, this.host);
		data.policy = new tw.Policy(data.policy);
		return $.extend(container, data);
	},
	data: ["desc", "policy"]
});

// attribs is an object whose members are merged into the instance (e.g. query)
tw.Collection = function(type, host, attribs) {
	if(arguments.length) { // initialization
		tw.Resource.apply(this, [type, host]);
		$.extend(this, attribs);
	}
};
tw.Collection.prototype = new tw.Resource();

tw.TiddlerCollection = function(container, tiddler) {
	if(arguments.length) { // initialization
		tw.Collection.apply(this, [tiddler ? "revisions" : "tiddlers"]);
		this.container = container || null;
		this.tiddler = tiddler || null;
	}
};
tw.TiddlerCollection.prototype = new tw.Collection();
$.extend(tw.TiddlerCollection.prototype, {
	parse: function(data) {
		var container = this.container;
		return $.map(data, function(item, i) {
			var tiddler = new tw.Tiddler(item.title, container),
				bag = item.bag;
			tiddler = tw.Tiddler.prototype.parse.apply(tiddler, [item]);
			if(!tiddler.bag && bag) { // XXX: bag always present!?
				tiddler.bag = new tw.Bag(bag, container.host);
			}
			if(!tiddler.recipe && item.recipe) {
				tiddler.recipe = new tw.Recipe(item.recipe, container.host);
			}
			delete item.recipe;
			return $.extend(tiddler, item);
		});
	},
	route: function() {
		var params = this.container;
		if(this.tiddler) {
			var container = this.tiddler.bag || this.tiddler.recipe;
			params = {
				_type: container._type,
				host: container.host,
				name: container.name,
				title: this.tiddler.title
			};
		}
		return supplant(tw.routes[this._type], params);
	}
});

tw.Search = function(query, host) {
	tw.Collection.apply(this, ["search", host]);
	this.query = query;
};
tw.Search.prototype = new tw.Collection();
$.extend(tw.Search.prototype, {
	parse: function(data) {
		this.container = { // XXX: hacky
			_type: "bag",
			host: this.host
		};
		var tiddlers = tw.TiddlerCollection.prototype.parse.apply(this, arguments);
		delete this.container;
		return tiddlers;
	}
});

// title is the name of the tiddler
// container (optional) is an instance of either Bag or Recipe
// optionally accepts a single object representing tiddler attributes
tw.Tiddler = function(title, container) {
	tw.Resource.apply(this, ["tiddler", false]);
	this.title = title;
	this.bag = container && container._type === "bag" ? container : null;
	this.recipe = container && container._type === "recipe" ? container : null;
	var self = this;
	$.each(this.data, function(i, item) {
		self[item] = undefined; // exposes list of standard attributes for inspectability
	});
	if(title && title.title) { // title is an object of tiddler attributes
		$.extend(this, title);
	}
};
tw.Tiddler.prototype = new tw.Resource();
$.extend(tw.Tiddler.prototype, {
	revisions: function() {
		return new tw.TiddlerCollection(this.bag || this.recipe, this);
	},
	route: function() {
		var container = this.bag || this.recipe;
		var params = $.extend({}, this, {
			host: container ? container.host : null,
			_type: this.bag ? "bag" : (this.recipe ? "recipe" : null),
			name: container ? container.name : null
		});
		return supplant(tw.routes[this._type], params);
	},
	parse: function(data) {
		var tiddler = new tw.Tiddler(this.title),
			container = this.bag || this.recipe;
		if(data.bag) {
			tiddler.bag = new tw.Bag(data.bag, container.host);
			delete data.bag;
		}
		delete data.recipe;
		tiddler.created = data.created ? convertTimestamp(data.created) : new Date();
		delete data.created;
		tiddler.modified = data.modified ? convertTimestamp(data.modified) : new Date();
		delete data.modified;
		if(this.recipe) {
			tiddler.recipe = this.recipe;
		}
		return $.extend(tiddler, data);
	},
	data: ["created", "creator", "modifier", "modified", "tags", "type", "text",
			"fields"],
	ajaxSetup: function(options) {
		var self = this;
		if(this.etag && (options.type === "PUT" || options.type === "DELETE")) {
			options.beforeSend = function(xhr) {
				xhr.setRequestHeader("If-Match", self.etag);
			};
		}
		if(options.type === "PUT") {
			var callback = options.success;
			options.success = function(data, status, xhr) {
				var loc = xhr.getResponseHeader("Location"),
					etag = xhr.getResponseHeader("Etag");
				if(loc && etag) {
					self.etag = etag;
					if(!self.bag) {
						var bag = loc.split("/bags/").pop().split("/")[0];
						self.bag = new tw.Bag(bag, self.recipe.host);
					}
					callback(self, status, xhr);
				} else { // IE
					self.get(callback, options.error);
				}
			};
		}
	}
});

tw.Revision = function(id, tiddler) {
	var container = tiddler.bag || tiddler.recipe;
	tw.Tiddler.apply(this, [tiddler.title, container]);
	this._type = "revision";
	this.revision = id;
};
tw.Revision.prototype = new tw.Tiddler();
$.extend(tw.Revision.prototype, {
	revisions: false,
	data: false,
	put: false,
	"delete": false
});

tw.Bag = function(name, host) {
	Container.apply(this, ["bag", name, host]);
};
tw.Bag.prototype = new Container();

tw.Recipe = function(name, host) {
	Container.apply(this, ["recipe", name, host]);
	this.recipe = [];
};
tw.Recipe.prototype = new Container();
$.extend(tw.Recipe.prototype, {
	data: ["recipe"].concat(Container.prototype.data)
});

tw.Policy = function(constraints) { // TODO: validation?
	var self = this;
	$.each(this.constraints, function(i, item) {
		self[item] = constraints[item];
	});
};
tw.Policy.prototype.constraints = ["read", "write", "create", "delete",
	"manage", "accept", "owner"];

/*
 * utilities
 */

tw._capitalize = function(str) {
	return str.charAt(0).toUpperCase() + str.slice(1);
};

// convert YYYYMMDDhhmmss timestamp to Date instance
convertTimestamp = function(t) {
	if (t.match(/^\d{12,17}$/)) {
		return new Date(Date.UTC(
			parseInt(t.substr(0, 4), 10),
			parseInt(t.substr(4, 2), 10) - 1,
			parseInt(t.substr(6, 2), 10),
			parseInt(t.substr(8, 2), 10),
			parseInt(t.substr(10, 2), 10),
			parseInt(t.substr(12, 2) || "0", 10),
			parseInt(t.substr(14, 3) || "0", 10)
		));
	} else {
		return new Date(Date.parse(t));
	}
};

// adapted from Crockford (http://javascript.crockford.com/remedial.html)
supplant = function(str, obj) {
	return str.replace(/{([^{}]*)}/g, function (a, b) {
		var r = obj[b];
		r = typeof r === "string" || typeof r === "number" ? r : a;
		return $.inArray(b, ["host", "query"]) !== -1 ? r : encodeURIComponent(r); // XXX: special-casing
	});
};

return tw;

}(jQuery));
//}}}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:xlink="http://www.w3.org/1999/xlink"
   version="1.1"
   width="14pt"
   height="14pt"
   viewBox="918 510 14 14"
   id="svg3070">
  <metadata
     id="metadata3089">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title></dc:title>
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <defs
     id="defs3072">
    <radialGradient
       cx="0"
       cy="0"
       r="1"
       id="Gradient"
       gradientUnits="userSpaceOnUse">
      <stop
         id="stop3075"
         style="stop-color:#ffffff;stop-opacity:1"
         offset="0" />
      <stop
         id="stop3077"
         style="stop-color:#2b2b2b;stop-opacity:1"
         offset="1" />
    </radialGradient>
    <radialGradient
       id="Obj_Gradient"
       xlink:href="#Gradient"
       gradientTransform="matrix(11.473944,0,0,11.473944,922.3752,513.7837)" />
  </defs>
  <g
     id="g3080"
     style="fill:none;stroke:none">
    <g
       id="g3082">
      <path
         d="m 929.6952,512.9018 c -2.5384,-2.53843 -6.654,-2.53843 -9.1924,0 -2.5384,2.5384 -2.5384,6.654 0,9.19238 2.5384,2.53839 6.654,2.53839 9.1924,0 2.5384,-2.53838 2.5384,-6.65398 0,-9.19238 m -4.5962,2.8407 2.07733,-2.07734 1.75547,1.75549 -2.0773,2.07735 2.0773,2.07732 -1.75547,1.75548 -2.07733,-2.07732 -2.07733,2.07732 -1.75547,-1.75548 2.0773,-2.07732 -2.0773,-2.07735 1.75547,-1.75549 z"
         id="path3084"
         style="fill:url(#Obj_Gradient)" />
      <path
         d="m 927.61447,515.38354 a 4.51205,4.2590378 0 1 1 -9.0241,0 4.51205,4.2590378 0 1 1 9.0241,0 z"
         transform="matrix(1.0218069,0,0,1.0462046,-18.063694,-21.648443)"
         id="path2394"
         style="fill:#000000;fill-opacity:0;fill-rule:evenodd;stroke:none;stroke-width:5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
    </g>
  </g>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="78 222 60 60" 
width="30" height="30">
<g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1">
	<g>
		<path d="M 107.92718 244.14815 L 86.651474 222.89253 L 78.85206 230.69925 L 100.120415 251.9476 L 78.774 273.27396 
		L 86.57342 281.08075 L 107.927216 259.74707 L 129.39981 281.19946 L 137.19922 273.39267 L 115.73397 251.94763 
		L 137.121155 230.58054 L 129.32175 222.77374 Z" fill="black" class="glyph"/>
	</g>
</g>
</svg>
Unless you're delighted with the default theme you can make some quick changes by generating a new random color palette, hit this button to cycle through some alternatives.

<<RandomColorPaletteButton saturation_pale:0.67 saturation_light:0.53
saturation_mid:0.43 saturation_dark:0.06 pale:0.99 light:0.85 mid:0.5 dark:0.31>>

You can also change the look and feel completely by installing a new theme. To do this, find one you like in the @themes space, note down the name, and include it in this space by going to the space menu. You can reach the space menu by clicking on the blue and pink circle at the top-right of the page and chooshing "THIS SPACE". Here are a few to check out:
* @pip
* @caspian-ii
* @basalt
* @simplicity
* @cheesecake
* @jelly-doughnut

(//Note that if you are using a custom TiddlySpace install, these themes may not be present.//)
iVBORw0KGgoAAAANSUhEUgAAAB4AAAAUCAMAAACtdX32AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAxQTFRF/9nFyMjI////kJCQMCKyCQAAAElJREFUeNq0kEEKACAIBF33/38OUTuFBUt7CuYwNobDuGfwGmA1sF+Jgcbujck3nL7AaQlc5gesueePXbLI1RSsVvt32phlCTAAmkkC6coKMZAAAAAASUVORK5CYII=
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="450 366 38 57"
width="30" height="30">
	<g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1">
		<g>
			<path d="M 452.1094 421.2422 L 450 421.2422 L 450 423 L 487.9688 423 L 487.9688 421.2422 L 485.8595 421.2422 
			L 485.8595 377.29688 L 487.9688 377.29688 L 487.9688 375.53906 L 485.8595 375.53906 
			C 485.8595 375.53906 481.12463 371.59341 473.02023 370.52802 C 472.6824 368.9689 471.72098 366.75 468.9844 366.75 
			C 466.24783 366.75 465.28638 368.9689 464.94864 370.52802 
			C 456.84418 371.59341 452.1094 375.53906 452.1094 375.53906 L 450 375.53906 L 450 377.29688 L 452.1094 377.29688 
			Z M 467.12247 370.32086 L 467.12247 370.32086 C 467.3805 369.42395 467.90762 368.50781 468.9844 368.50781 
			C 470.0612 368.50781 470.5883 369.42395 470.84634 370.32086 
			C 470.24136 370.2848 469.62054 370.26562 468.9844 370.26562 
			C 468.34827 370.26562 467.72748 370.2848 467.12247 370.32086 Z M 454.21875 420.92804 L 454.21875 420.92804 
			C 455.46762 420.42087 456.32816 419.35281 456.32816 418.11716 L 456.32816 377.29688 L 458.4375 377.29688 
			L 458.4375 421.2422 L 454.21875 421.2422 Z M 460.5469 420.92804 L 460.5469 420.92804 
			C 461.79578 420.42087 462.65625 419.35281 462.65625 418.11716 L 462.65625 377.29688 L 464.76566 377.29688 
			L 464.76566 421.2422 L 460.5469 421.2422 Z M 466.87503 420.92804 L 466.87503 420.92804 
			C 468.1239 420.42087 468.9844 419.35281 468.9844 418.11716 L 468.9844 377.29688 L 471.09378 377.29688 
			L 471.09378 421.2422 L 466.87503 421.2422 Z M 473.2032 420.92804 L 473.2032 420.92804 
			C 474.45203 420.42087 475.31256 419.35281 475.31256 418.11716 L 475.31256 377.29688 L 477.4219 377.29688 
			L 477.4219 421.2422 L 473.2032 421.2422 Z M 479.5313 420.92804 L 479.5313 420.92804 
			C 480.78018 420.42087 481.64066 419.35281 481.64066 418.11716 L 481.64066 377.29688 L 483.75006 377.29688 
			L 483.75006 421.2422 L 479.5313 421.2422 Z" fill="black" class="glyph"/>
		</g>
	</g>
</svg>
iVBORw0KGgoAAAANSUhEUgAAAAgAAAAGCAMAAADJ2y/JAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADxQTFRF/////f39+/v7hKzttczys8vxydr1ibDu+fn58vX6mLrwy9z38fP4irDu5uz2n77x/Pz9m7vv4ev7gartiLogxgAAABR0Uk5T/////////////////////////wBPT+cRAAAAMklEQVR42hzGxxEAIAzEQAdyhuu/Vwx6aJYmvQ4IlZlXMfQsEmCASy1+6PD4wFbbFWAAMxACQh6A8QAAAAAASUVORK5CYII=
iVBORw0KGgoAAAANSUhEUgAAAAgAAAAGCAMAAADJ2y/JAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADlQTFRF/////f39+/v7lZWVmpqa+fn5/Pz85ubmqamp8vLy0NDQ09PT6enpvb29rKysv7+/9PT0p6enk5OTnFiLlQAAABN0Uk5T////////////////////////ALJ93AgAAAAySURBVHjaHMbHEQAwCMRAMDjn679YY/TQLC36ZRA6M6dr0BNCgwE7VnXImHCgiO0JMAAvVgIfm4zQ/wAAAABJRU5ErkJggg==
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="301 225 48 52"
width="30" height="30">
<g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1">
	<g>
		<path d="M 333.00003 234 L 306 258.75003 L 301.5 270 L 312.75 265.50003 L 339.75 240.74998 Z M 337.5 229.50002 
		L 335.24988 231.75008 L 341.99997 238.50003 L 344.24997 236.24995 Z M 342 225.00003 L 339.74988 227.25009 
		L 346.5 234.00005 L 348.75 231.75003 Z M 301.5 273.9719 C 301.5 273.9719 309.59888 277.99927 317.70013 273.97183 
		C 325.80066 269.94437 341.99997 276.65686 341.99997 276.65686 L 341.99997 273.97195 
		C 341.99997 273.97195 325.80014 267.2594 317.70013 271.28687 C 309.6 275.31451 301.5 271.28683 301.5 271.28683 Z" 
		fill="#101010" class="glyph"/>
	</g>
</g>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="506 234 68 36" width="30" height="30"><metadata xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:date>2010-09-16 14:51Z</dc:date><!-- Produced by OmniGraffle Professional 5.2.3 --></metadata><defs></defs><g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1"><rect width="1118" height="783"/><g><path d="M 538.68195 244.31807 C 540.43927 246.07547 540.43927 248.9247 538.68195 250.68204 C 536.92456 252.4394 534.07532 252.4394 532.318 250.68204 C 530.5606 248.9247 530.5606 246.07547 532.318 244.31807 C 534.07532 242.56075 536.92456 242.56075 538.68195 244.31807 M 511.12607 257.99356 C 511.26108 258.13019 511.39728 258.26608 511.53473 258.40121 C 527.2556 273.86606 552.74414 273.86606 568.46515 258.40121 C 568.60248 258.26617 568.73853 258.13037 568.87354 257.9938 C 568.8736 257.99374 568.8736 257.99371 568.8736 257.99362 C 568.87366 257.99371 568.87366 257.9938 568.87372 257.9939 C 570.72504 256.12051 572.35046 254.11153 573.74994 252 C 573.74994 251.99997 573.74994 251.99994 573.74994 251.99992 C 572.35046 249.8884 570.72504 247.87938 568.87372 246.00606 C 568.87366 246.00613 568.87366 246.00621 568.8736 246.00627 C 568.73865 245.86966 568.60254 245.73383 568.46515 245.5987 C 552.74414 230.13387 527.2556 230.13387 511.53473 245.5987 C 511.39728 245.73383 511.26108 245.86974 511.12613 246.00635 C 511.126 246.00624 511.126 246.00616 511.12595 246.00606 C 509.2748 247.87938 507.64954 249.88837 506.24994 251.9998 L 506.24994 251.99983 C 506.24994 251.9999 506.25 251.99992 506.25 251.99997 C 506.25 252 506.24994 252.00005 506.24994 252.00009 L 506.24994 252.00012 C 507.64954 254.11157 509.2748 256.12051 511.12595 257.9939 C 511.126 257.99377 511.126 257.99365 511.12607 257.99359 Z M 515.44916 252 C 515.8548 251.55469 516.27502 251.11778 516.71014 250.68985 C 522.16632 245.32257 529.06055 242.23206 536.17273 241.41824 C 534.6662 241.96199 533.2525 242.83762 532.04498 244.04512 C 527.65155 248.43852 527.65155 255.56163 532.04498 259.95502 C 533.2522 261.16226 534.6656 262.03778 536.17175 262.58154 C 529.05988 261.76761 522.16608 258.6771 516.71014 253.31009 C 516.2751 252.88219 515.85486 252.44528 515.44922 252 Z M 564.55054 251.99995 C 564.14502 252.44525 563.7248 252.88217 563.28973 253.31009 C 557.83368 258.67712 550.93988 261.76764 543.828 262.58157 C 545.33423 262.03781 546.74756 261.1623 547.9549 259.95502 C 552.34833 255.56163 552.34833 248.43852 547.9549 244.04512 C 546.74744 242.83765 545.33374 241.96202 543.82715 241.41824 C 550.9394 242.23206 557.83356 245.3226 563.28973 250.68985 C 563.7248 251.11775 564.14502 251.55467 564.55054 251.99995 Z M 568.8736 257.99362 C 570.7249 256.12033 572.35028 254.11139 573.74988 252.00002" fill="black" class="glyph"/></g></g></svg>
AAABAAYAEBAQAAEABAAoAQAAZgAAABAQAAABAAgAaAUAAI4BAAAQEAAAAQAgAGgEAAD2BgAAICAQAAEABADoAgAAXgsAACAgAAABAAgAqAgAAEYOAAAgIAAAAQAgAKgQAADuFgAAKAAAABAAAAAgAAAAAQAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAjD3WKwEAAAAQAAAAgACAM4CAAADAwMAigICAAAAA/wAA/wAAAP//AP8AAAD/AP8A//8AAAAAALsREYh4h4gRERFId3d3d4QRFId3d3d3eEEYd3d3d3d3gYd3d3d3d3d4h3d3d3d3d3h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AAAAAAAAAAAAAEAAAACAAAAAwAAAAUAAAAGAAAACI98Wye0nXWavKF4876kev++pHr/vqR6/76kev++pHr/vqR6/76kev++pHr/vqR6/76kev+8oXjztJ11mo98WycAAAAIAAAABgAAAAUAAAADAAAAAgAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAQAAAAHAAAAChwcHBKulnGJvaN5+L6kev++pHr/y7GJ/9/Fnv/s1K7/9t25//rivv/64r7/9t25/+zUrv/fxZ7/y7GJ/76kev++pHr/vaN5+K6WcYkcHBwSAAAACgAAAAcAAAAEAAAAAgAAAAEAAAAAAAAAAAAAAAEAAAADAAAABwAAAAtuYkUst552z76kev++pHr+1LuS//Latf/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD/8tq1/9S7kv++pHr+vqR6/7eeds9uYkUsAAAACwAAAAcAAAADAAAAAQAAAAAAAAABAAAAAgAAAAQAAAAIi3hbNbqgd+a+pHr/xayD/+3Vr//85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA/+3Vr//FrIP/vqR6/7qgd+aJdVg0AAAACAAAAAQAAAACAAAAAQAAAAEAAAACAAAABIl8WSW8oXjlvqR6/8yyiv/54Lz//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//ngvP/Msor/vqR6/7yheOWJfFklAAAABAAAAAIAAAABAAAAAAAAAAFfXz8Iu6F4zL6kev/Msor/+uK+//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//rivv/Msor/vqR6/7uheMxfXz8IAAAAAQAAAAAAAAAAAAAAAbqid4K+pHr/xayD//ngvP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//fgvP/Fr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Pz/+HD8//hw/P/4cPz/+HD8//hw/P/4cPz/9W06v+vgc3/u5HK//zlwP/85cD//OXA//zlwP/85cD/9t25/76kev+9o3jqvaF4+b6kev/64r7//OXA//zlwP/85cD//OXA//zlwP+zhsz/r4HN/93A8P/hw/P/4cPz/+HD8//hw/P/4cPz/+HD8//hw/P/4cPz/+HD8//hw/P/3cDw/6+Bzf+zhsz//OXA//zlwP/85cD//OXA//zlwP/64r7/vqR6/72hePm9oXj5vqR6//rivv/85cD//OXA//zlwP/85cD//OXA/7OGzP+vgc3/3cDw/+HD8//hw/P/4cPz/+HD8//hw/P/4cPz/+HD8//hw/P/4cPz/+HD8//dwPD/r4HN/7OGzP/85cD//OXA//zlwP/85cD//OXA//rivv++pHr/vaF4+b2jeOq+pHr/9t25//zlwP/85cD//OXA//zlwP/85cD/u5HK/6+Bzf/VtOr/4cPz/+HD8//hw/P/4cPz/+HD8//hw/P/4cPz/+HD8//hw/P/4cPz/9W06v+vgc3/u5HK//zlwP/85cD//OXA//zlwP/85cD/9t25/76kev+9o3jqvKF3yL6kev/s1K7//OXA//zlwP/85cD//OXA//zlwP/Qq8f/r4HN/8Ob3P/hw/P/4cPz/+HD8//hw/P/4cPz/+HD8//hw/P/4cPz/+HD8//hw/P/w5vc/6+Bzf/Qq8f//OXA//zlwP/85cD//OXA//zlwP/s1K7/vqR6/7yhd8i9oXiYvqR6/9/Fnv/85cD//OXA//zlwP/85cD//OXA/+/Twv+vgcz/r4PN/9a16//hw/P/4cPz/+HD8//hw/P/4cPz/+HD8//hw/P/4cPz/9a16/+vg83/r4HM/+/Twv/85cD//OXA//zlwP/85cD//OXA/9/Fnv++pHr/vaF4mL2feFW+pHr/y7GJ//zlwP/85cD//OXA//zlwP/85cD//OXA/8+rx/+vgc3/tIfQ/9a16//hw/P/4cPz/+HD8//hw/P/4cPz/+HD8//Wtev/tIfQ/6+Bzf/Pq8f//OXA//zlwP/85cD//OXA//zlwP/85cD/y7GJ/76kev+9n3hVootzC7yhePO+pHr/8tq1//zlwP/85cD//OXA//zlwP/85cD/+uLA/8Obyf+vgc3/r4PN/8Ob3P/VtOr/3cDw/93A8P/VtOr/w5vc/6+Dzf+vgc3/w5vJ//riwP/85cD//OXA//zlwP/85cD//OXA//Latf++pHr/vKF486KLcwsAAAAAu6N3l76kev/Uu5L//OXA//zlwP/85cD//OXA//zlwP/85cD/+uLA/8+rx/+vgcz/r4HN/6+Bzf+vgc3/r4HN/6+Bzf+vgc3/r4HM/8+rx//64sD//OXA//zlwP/85cD//OXA//zlwP/85cD/1LmS/76kev+7oXiWAAAAAAAAAAC3l28gvaN5+L6kev7t1a///OXA//zlwP/85cD//OXA//zlwP/85cD//OXA/+/Twv/Qq8f/u5HK/7OGzP+zhsz/u5HK/9Crx//v08L//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA/+3Vr/++pHr+vaN5+LeXbyAAAAAAAAAAAAAAAAC6oneCvqR6/8Wsg//54Lz//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/34Lz/xayD/76kev+6oneCAAAAAAAAAAAAAAAAAAAAAH9/VQa8oHjLvqR6/8yyiv/64r7//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD/+uK+/8yyiv++pHr/vKB4y39/VQYAAAAAAAAAAAAAAAAAAAAAAAAAALKhbh67o3nkvqR6/8yyiv/54Lz//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//ngvP/Msor/vqR6/7ujeeSyoW4eAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALqbdim7o3nkvqR6/8Wsg//t1a///OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/t1a//xayD/76kev+7o3nkupt2KQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALKhbh68oHjLvqR6/76kev7Uu5L/8tq1//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/85cD//OXA//zlwP/y2rX/1LmS/76kev6+pHr/vKB4y7Khbh4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH9/VQa6oneCvaN5+L6kev++pHr/y7GJ/9/Fnv/s1K7/9t25//rivv/64r7/9t25/+zUrv/fxZ7/y7GJ/76kev++pHr/vaN5+Lqid4J/f1UGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC3l28gu6F4lryhePO+pHr/vqR6/76kev++pHr/vqR6/76kev++pHr/vqR6/76kev++pHr/vKF487uheJa3l28gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAootzC72feFW9oXiYvKF3yL2jeOq9oXj5vaF4+b2jeOq8oXfIvaF4mL2feFWii3MLAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/gB///gAH//gAAf/wAAD/4AAAf8AAAD+AAAAfAAAADwAAAA4AAAAGAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAGAAAABwAAAA8AAAAPgAAAH8AAAD/gAAB/8AAA//gAAf/+AAf//4Af/
window.createTagButton = function (place, tag, excludeTiddler) {
	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);
	var theTag = createTiddlyButton(sp, tag, config.views.wikified.tag.tooltip.format([tag]), onClickTag);
	theTag.setAttribute("tag", tag);
	theTag.style.marginLeft = "5px";
	if (excludeTiddler) {
		theTag.setAttribute("tiddler", excludeTiddler);
	}
	return theTag;
};
iVBORw0KGgoAAAANSUhEUgAAAC0AAAA8CAMAAADFTsOWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAF1QTFRFZmZm4NzZ/9nF//n29vDu/ff0zcnHhoWEamlprquqhYODhX15nJqZmpiXsq+tsK2rpZWNp5eOpaOhp6SjrpyT17us19PR+vTx+PLv5N/dnpyb9NG+9tK/9O/s//n2JlLF2gAAAB90Uk5T////////////////////////////////////////AM0ZdhAAAADVSURBVHja7Na5FoIwEIXhK0tMXADFFZX3f0wzzMRMCjhHG5uk4fzkK8LQBOM3C/wwu1q/nUvWxmKv9o3t0zxIQjAUN/ZS9jrPhXAEHDnhMnLChXB8MMCnY+x5SMKeUyJi5gELD5g5FAaG2thNXJTbuIYa95Vet+XEL38n66yzzjrrrLP+l27UpQDrajkxNjrHsTm+5MbhpuwecuM4+fQnaTX2KdxJCic8nbvVmHgVMfFnwPyVTmOfnjuVnjOWmTiNibskO8FhgsnufIZ5X9PBzuRbgAEADzgU6SZ2lO4AAAAASUVORK5CYII=
ya
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAKGmlDQ1BJQ0MgUHJvZmlsZQAAeAHVlmdUFMkWx6t7ciLNkNOQc84gOSfJUVSGAYY4wpAxIbK4AooiIgLKEpao4KoEWQMiigERUEBF3UEWAWVdDIiKyuuBd9w977z99r6826eqfn3r9q3quvXhDwDpIyMpKQEWACCRncrxdbajB4eE0nGTAAIUgAe6wJDBTEmy9fb2AP9oH8aRaMTua/Fy/WPYf58QjIxKYQIAeSPTEZEpzESEzyNsyEzipCI8h/BwRmoSwnA3wjQOskGEB3nMWmcujyPW+f1ajL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QCJmYv0bD8v8eUuTmxQDF25YUAhxES3tnOWH4CUZYFTxqjWLCPmiorflvvACX6p80AktNbFa76T5gFrBY9SQlF+KTXz58shZesLdD/n8XY9QFT0AftY6dOtLU1MRDqWklKSbkPHziIKTSu2SrRVfSbLIe0AzNp/Kn8/8MBNUt217cJn7NSoCW6TvgPHTyMbgy7soszEFZJfnzzybS7LgHTbiGHyyTFR6FXkkAq3CI6T5AJPy0kmo1ADx/oF2YNC3PjuCPXymfXRCaUDGdAOQRP1QyUvkvkBHwrBmpXGa/cPBj8f0yYsTSAtMJwJTXDE0X5kIG3AWgBOXJmZh/xFuKgukE4AeCT/zuaaRO+78zN5BC0zfcOghPVTfF+AD8HQ3iD9MJ6D79NTCfwVHnFWNqaBz5gIzn+gQaOd9vUB0eC2nwGTGUxKRJCaMX/3RyuaTgw+AGDoDFF4n/dvC5StWn7npua09iUMWjkkJgfirnodZ0gu1Vs17iuvdl8+4A8/r5/6QSCJ0oWfX/A3UKXhQwWVptAAAAAElFTkSuQmCC
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="434 218 68 68"
width="30" height="30">
<g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1">
	<g>
		<path d="M 478.39694 232.53705 L 478.39694 232.53705 
		C 477.1145 231.85132 475.77875 231.30147 474.41058 230.88734 L 474.41058 218.24994 L 461.58942 218.24994 
		L 461.58942 230.88734 C 460.22125 231.30147 458.8855 231.85132 457.60306 232.53705 L 448.66824 223.60214 
		L 439.6022 232.66814 L 448.53717 241.60304 C 447.8515 242.8854 447.30157 244.22116 446.88745 245.58936 
		L 434.25 245.58936 L 434.25 258.41052 L 446.88745 258.41052 
		C 447.30157 259.77869 447.8515 261.11447 448.53717 262.39688 L 439.6022 271.33173 L 448.66824 280.3978 
		L 457.60306 271.46283 C 458.8855 272.14862 460.22125 272.69846 461.58942 273.11252 L 461.58942 285.74988 
		L 474.41058 285.74988 L 474.41058 273.11252 C 475.77875 272.69846 477.1145 272.14862 478.39694 271.46283 
		L 487.33176 280.3978 L 496.39767 271.33173 L 487.46286 262.39688 
		C 488.14853 261.11447 488.69836 259.77869 489.11255 258.41052 L 501.74988 258.41052 L 501.74988 245.58936 
		L 489.11255 245.58936 C 488.69836 244.22116 488.14853 242.8854 487.46286 241.60304 L 496.39767 232.66814 
		L 487.33176 223.60214 Z M 475.3328 244.66714 C 479.3825 248.71698 479.3825 255.2829 475.3328 259.33273 
		C 471.28296 263.3826 464.71704 263.3826 460.66724 259.33273 
		C 456.61737 255.2829 456.61737 248.71698 460.66724 244.66714 
		C 464.71704 240.61734 471.28296 240.61734 475.3328 244.66714" fill="#111"
		class="glyph"/>
	</g>
</g>
</svg>
Type the text for 'new sub-topic'
R0lGODlhDAA0ALMJAFRUVNTQzX99faqnpd/a2PTv7Ork4p+cm7+7uf/59gAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAkALAAAAAAMADQAAARDMEk5xrwTAIw1v95VBGSglcGorSwQEEIsaLJAdNsnhTr/+bqgcEgsGo/IpHLJbDqf0Kh0Sq1eDKgbZsAScBC1g9UZAQA7
iVBORw0KGgoAAAANSUhEUgAAAC0AAAAtCAYAAAA6GuKaAAAABGdBTUEAALGPC/xhBQAACkNpQ0NQSUNDIFByb2ZpbGUAAHgBnZZ3VFNZE8Dvey+90BJCkRJ6DU1KAJESepFeRSUkAUIJGBKwV0QFVxQVaYoiiyIuuLoUWSuiWFgUFLAvyCKgrIuriIplX/QcZf/Y/b6z88ec35s7c+/cmbnnPAAovoFCUSasAECGSCIO8/FgxsTGMfHdAAZEgAPWAHB52VlB4d4RABU/Lw4zG3WSsUygz/p1/xe4xfINYTI/m/5/pcjLEkvQnULQkLl8QTYP5TyU03MlWTL7JMr0xDQZwxgZi9EEUVaVcfIXNv/s84XdZMzPEPFRH1nOWfwMvow7UN6SIxWgjASinJ8jFOSifBtl/XRphhDlNyjTMwTcbAAwFJldIuCloGyFMkUcEcZBe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ieLkpScaH7OHc6qwtTm8Uh7DzVdwiCWZeZGVvVhGY3lPhZtgjjH59c6U5yPvHHmqNuTVbFGccpj7k5BIi/gI19pT18/v1LryhslzOGvXOtQ7BjPv1bRAafvqWr6yd89/Y2Hm3pZJZMtkFU2AxNTYDYX8orneoWddp3dN5EphlKUQd/VOYWXM30ZyCqCf93jfVIS6HlYSnnYoVKxzQmsqG4w5OUMlgEcHRtHXxlYxk7Ixz88c+SJcxvyJUCui4iS9A4l5KnUWWylxcRus8FWi0k1qA+H52DE50fnDiwHy7+9kGeRudqzKg/nqqVTLd6X0K1fS/32IlelthgMhCXGLM9kGQcL4Fk8PDe/wIOfNCFvHBniN4zW0rHEhoHmhUqvVxsdhecxWDpOKDyZcyGdaRZIK8Zvfzh71N13D/3XJ9xsqHSQFXuWaicVcmavpHGYFbEkAxf5HwGENm0cPsVTbgH+l+S/c0hKbtisAOEAAAAASUVORK5CYII=
config.macros.reset = {};
config.macros.reset.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
	params = paramString.parseParams('anon',null,true,false,false);
	var filter = getParam(params,"filter","");
	var fields = getParam(params,"fields","").split(',');
	var options = getParam(params,"options","").split(',');
	var label = getParam(params,"label","Reset");
	var resetMessage = getParam(params,"message","Reset done.");
	var btn = createTiddlyButton(place,label,label,function() {
		var tiddlers = store.filterTiddlers(filter);
		for(var i=0; i<tiddlers.length; i++) {
			for(var j=0; j<fields.length; j++) {
				var field = fields[j];
				tiddlers[i].fields[field] = null;
			}
			story.saveTiddler(tiddlers[i].title);
		}
		for(i=0; i<options.length; i++) {
			config.options[options[i]] = "";
			removeCookie(options[i]);
		}
		displayMessage(resetMessage);
		return false;
	});
};
User-agent: *
Disallow: /bags
Disallow: /recipes
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="364 157 64 51" width="30" height="30"><g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1"><g><path class="glyph" d="M 364.50006 184.50061 L 386.99985 207.00037 L 396 198.00002 L 373.50003 175.50066 Z M 403.02295 181.97704 C 400.38693 179.34099 396.11307 179.34099 393.47702 181.97704 C 390.841 184.61307 390.841 188.88695 393.47702 191.52298 C 396.11307 194.15903 400.38693 194.15903 403.02295 191.52298 C 405.65906 188.88695 405.65906 184.61307 403.02295 181.97704 M 414.27298 170.72704 C 411.63693 168.091 407.36307 168.091 404.72702 170.72704 C 402.091 173.36308 402.091 177.63693 404.72702 180.27296 C 407.36307 182.90901 411.63693 182.90901 414.27298 180.27296 C 416.90903 177.63693 416.90903 173.36308 414.27298 170.72704 M 425.523 159.47705 C 422.88696 156.841 418.6131 156.841 415.97705 159.47705 C 413.341 162.11308 413.341 166.38695 415.97705 169.02295 C 418.6131 171.65903 422.88696 171.65903 425.523 169.02295 C 428.15906 166.38695 428.15906 162.11308 425.523 159.47705" fill="#020202"/></g></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="2 724 68 55" 
width="30" height="30">
<g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1">
	<g>
		<path d="M 2.25 756 L 11.25 747 L 24.75 760.4994 L 60.750004 724.4994 L 69.75 733.49902 
		L 24.749977 778.49976 Z" fill="#101010" class="glyph"/>
	</g>
</g>
</svg>
Once you have some content then you may choose to determine a tiddler, or set of tiddlers to display each time you load ~TiddlySpace. This is determined by the [[DefaultTiddlers]].
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAKGmlDQ1BJQ0MgUHJvZmlsZQAAeAHVlmdUFMkWx6t7ciLNkNOQc84gOSfJUVSGAYY4wpAxIbK4AooiIgLKEpao4KoEWQMiigERUEBF3UEWAWVdDIiKyuuBd9w977z99r6826eqfn3r9q3quvXhDwDpIyMpKQEWACCRncrxdbajB4eE0nGTAAIUgAe6wJDBTEmy9fb2AP9oH8aRaMTua/Fy/WPYf58QjIxKYQIAeSPTEZEp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E2c74PM5169b0+A8Sdvp2QikCbSQAa0qdAx7TVbU/dse3tVOs7ik+rdoAoxEMHiP1etseMPrdn5RherIJkC3B/TXUkqKCymRBlom0K/SPzT7H3p41/tLBc18T8uSCDAjweBdZq/jytcNBu5Gi9XE07cSjyeTBJrddL2iqOr+B7c/8cG0w1J/L5kAAxQM3mR022+gwy18dNO0W1O0Vx/Y/sTRUoMtZK8kBAoZvlxtc2aMywViKX7+D10+ywDx0s0HAAAAAElFTkSuQmCC
A [[SiteIcon|SiteIcon tiddler]]@glossary helps provide some identity to your space.  Ideally it'd be a square and a minimum of 48*48 pixels size.  You can upload your site icon using the uploader below.

<<binaryUploadPublic title:SiteIcon>>
The title and subtitle of your space are visible to visitors and are also displayed in your browser's tabs. Click on the SiteTitle and SiteSubtitle tiddler links below to make changes.
* [[SiteTitle]]
* [[SiteSubtitle]]
iVBORw0KGgoAAAANSUhEUgAAACwAAAArCAYAAAADgWq5AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAk5SURBVFiF1ZlrbBzVFYC/O7Mz+16/vc47tmM7sZOQB5QGAkqiqhE0VKAqrSgJjfiRqpX4UyFaqCLLotDSIrVCoghKSyqSliYgSgpNVSC4SWlSIIoJBGPjPByIE9sbr1/7mp2d2x9jz67j9dp50Krn1+zcO+d+99xzzzn3rpBS8v8kyv8a4HLFdbUKHtzZWqWr1g1SUeqRsh5ENWCCHBEwIpEREIdMQz/4+H03j1zteOJKXKJl9/5QSrq/IRD3AOuZ2UqZCPEelvyLnhFPN29bN3jZA3OZwC07Wz2Gy/oRiAcB76XtLpeKz+tDCDDNDKZpYqQN8gwxBDxpKdovf/rttdEvBPjhXW9/XcCvgOrxd7qmURWuIFxZQcDvR9e1Sd+ZpslAdJCB6CCRgSixWPxS8O2Pblm/55oBf3PvXrUuVf5rYPv4u1AwQG3NQirKShFCzHQsAPojF+k63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WQfy0fQjweV3U1hQVhHjnyHlOtA8wPGLw4suF94bP62JRVt+al/94+x3TAgM8umXdgyBfAtufD7971Ikc5uAJZNq+XlrcUIKqFL5ou/Wm2dxy0yzmzPZz39bFBfuCvWJO4snI9bltU17nSJAtprLVcEkv8LV4IsGR94/RsKiGSjW7Gf2+6W+EvF4XB/9217T9xkXTFHRNIZnKIATzZgQM0LxtXVLAHQ/vbn0YKVssy1LbO7s45xbUoQAWxz6IUL0whK5fu79L+vsTJFO2C4qxomxcZnyhveOFAxssIZ4H5gNUi9cp5cQ1g5xCzohM+vq77n3TOUfN2CyPbN1wQHdH6oSU3wPOdsuN9Mi1pAl8EaASOCIVuSkXFq70T5m9e3UjVXEvyDsF1q06Q0Fh1/+FJK2SOuiRA69VqUda3SIyRYAHN+7Iprv3RfK1XRFwrrS0trpSZzM3IJRbBLISIYJIAgipC5QzlrA6sUSn5cm0TXe7PhO5auD/tvwHQhyDgtGxXlsAAAAASUVORK5CYII=
//{{{
config.options.txtClientName = "Type client's name here";
config.options.txtDateOfBirth = "Type client's date of birth here";
config.options.txtKeyWorkerName = "Type Keyworker name here";
config.options.txtDateOfTOP = "Type date of this TOP assesst";
config.options.txtUnitsPerDay = "Record average amount on a using day";
config.options.textDaysPerWeek = "Record number days (0 - 7) used that week";
config.options.textDaysPerMonth = "Record total days (0 - 28) used last month";

window.createTiddlyText = function(theParent,theText)
{
        return theParent.appendChild(document.createTextNode(theText));

};
//}}}