Bible Study is loading ...

Requires Javascript.
Best viewed in Firefox web browser.
Bible Study - World English Bible version for small group or personal use (F11 = fullscreen)
Background: #fff
Foreground: #000
PrimaryPale: #8cf
PrimaryLight: #18f
PrimaryMid: #04b
PrimaryDark: #014
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
/*{{{*/
body {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

hr {height:1px;}

a {text-decoration:none;}

dt {font-weight:bold;}

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

.txtOptionInput {width:11em;}

#contentWrapper .chkOptionInput {border:0;}

.externalLink {text-decoration:underline;}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.whenBackstage {display:none;}
.backstageVisible .whenBackstage {display:block;}
/*}}}*/
/***
StyleSheet for use when a translation requires any css style changes.
This StyleSheet can be used directly by languages such as Chinese, Japanese and Korean which use a logographic writing system and 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;}

.htmlarea .toolbarHA table {border:1px solid ButtonFace; margin:0em 0em;}
/*}}}*/
/*{{{*/
@media print {
#mainMenu, #sidebar, #messageArea, .toolbar, #backstageButton {display: none ! important;}
#displayArea {margin: 1em 1em 0em 1em;}
/* Fixes a feature in Firefox 1.5.0.2 where print preview displays the noscript content */
noscript {display:none;}
}
/*}}}*/
<!--{{{-->
<div class='header' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</div>
<div id='mainMenu' refresh='content' tiddler='MainMenu'></div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar closeTiddler closeOthers +editTiddler > fields syncing permalink references jump'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>)</div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler deleteTiddler'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser'></span></div>
<!--}}}-->
To get started with this blank TiddlyWiki, you'll need to modify the following tiddlers:
* SiteTitle & SiteSubtitle: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)
* MainMenu: The menu (usually on the left)
* DefaultTiddlers: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened
You'll also need to enter your username for signing your edits: <<option txtUserName>>
These InterfaceOptions for customising TiddlyWiki are saved in your browser

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

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

----
Also see AdvancedOptions
how are prophets picked (tribes) and are there any before samuel?  and why is it odd for Saul to be a prophet?
|''Type:''|file|
|''URL:''|file://D:\My Documents\DavesDell My Documents\DavesGame\bibleTW2.html|
|''Workspace:''|(default)|

This tiddler was automatically created to record the details of this server

<<openTiddlers
     text:"1Samuel 12"
     tiddlers:{{
         var key = "1Sam 12:";
         t = store.getTiddlers();
         var m = "";
         for(var i=0; i<t.length; i++) {
             if(t[i].title.search(key) != -1) {
                 m += "'" + t[i].title + "' ";
             }
         }
     }}
     closeAll:true
     keepMe:false
 >> 
20 And in due time Hannah conceived and bore a son, and she called his name Samuel, for she said, “I have asked for him from the Lord.”
	Now  there  was  a  certain  man  of  Ramathaim  Zophim,  of  the  hill  country  of  Ephraim,  and  his  name  was  Elkanah,  the  son  of  Jeroham,  the  son  of  Elihu,  the  son  of  Tohu,  the  son  of  Zuph,  an  Ephraimite	
	 She  was  in  bitterness  of  soul,  and  prayed  to  Yahweh,  and  wept  bitterly.	
	 She  vowed  a  vow,  and  said,  "Yahweh  of  Armies,  if  you  will  indeed  look  on  the  affliction  of  your  handmaid,  and  remember  me,  and  not  forget  your  handmaid,  but  will  give  to  your  handmaid  a  boy,  then  I  will  give  him  to  Yahweh  all  the  days  of  his  life,  and  no  razor  shall  come  on  his  head."	
	 It  happened,  as  she  continued  praying  before  Yahweh,  that  Eli  saw  her  mouth.	
	 Now  Hannah  spoke  in  her  heart.  Only  her  lips  moved,  but  her  voice  was  not  heard.  Therefore  Eli  thought  she  had  been  drunken.	
	 Eli  said  to  her,  "How  long  will  you  be  drunken?  Put  away  your  wine  from  you."	
	 Hannah  answered,  "No,  my  lord,  I  am  a  woman  of  a  sorrowful  spirit.  I  have  drunk  neither  wine  nor  strong  drink,  but  I  poured  out  my  soul  before  Yahweh.	
	 Don't  count  your  handmaid  for  a  wicked  woman;  for  I  have  been  speaking  out  of  the  abundance  of  my  complaint  and  my  provocation."	
	 Then  Eli  answered,  "Go  in  peace;  and  may  the  God  {The  Hebrew  word  rendered  "God"  is  "Elohim."}  of  Israel  grant  your  petition  that  you  have  asked  of  him."	
	 She  said,  "Let  your  handmaid  find  favor  in  your  sight."  So  the  woman  went  her  way,  and  ate;  and  her  facial  expression  wasn't  sad  any  more.	
	 They  rose  up  in  the  morning  early,  and  worshiped  before  Yahweh,  and  returned,  and  came  to  their  house  to  Ramah	
	and  he  had  two  wives;  the  name  of  the  one  was  Hannah,  and  the  name  of  other  Peninnah	
	 It  happened,  when  the  time  had  come,  that  Hannah  conceived,  and  bore  a  son;  and  she  named  him  Samuel,  {Samuel  sounds  like  the  Hebrew  for  "heard  by  God."}  saying,  "Because  I  have  asked  him  of  Yahweh."	
	 The  man  Elkanah,  and  all  his  house,  went  up  to  offer  to  Yahweh  the  yearly  sacrifice,  and  his  vow.	
	 But  Hannah  didn't  go  up;  for  she  said  to  her  husband,  "Not  until  the  child  is  weaned;  then  I  will  bring  him,  that  he  may  appear  before  Yahweh,  and  stay  there  forever."	
	 Elkanah  her  husband  said  to  her,  "Do  what  seems  good  to  you.  Wait  until  you  have  weaned  him;  only  may  Yahweh  establish  his  word."  So  the  woman  waited  and  nursed  her  son,  until  she  weaned  him.	
	 When  she  had  weaned  him,  she  took  him  up  with  her,  with  three  bulls,  and  one  ephah  {1  ephah  is  about  22  litres  or  about  2/3  of  a  bushel}  of  meal,  and  a  bottle  of  wine,  and  brought  him  to  Yahweh's  house  in  Shiloh.  The  child  was  young.	
	 They  killed  the  bull,  and  brought  the  child  to  Eli.	
	 She  said,  "Oh,  my  lord,  as  your  soul  lives,  my  lord,  I  am  the  woman  who  stood  by  you  here,  praying  to  Yahweh.	
	 For  this  child  I  prayed;  and  Yahweh  has  given  me  my  petition  which  I  asked  of  him.	
	 Therefore  also  I  have  granted  him  to  Yahweh.  As  long  as  he  lives  he  is  granted  to  Yahweh."  He  worshiped  Yahweh  there.	
	This  man  went  up  out  of  his  city  from  year  to  year  to  worship  and  to  sacrifice  to  Yahweh  {"Yahweh"  is  God's  proper  Name,  sometimes  rendered  "LORD"  (all  caps)  in  other  translations.}  of  Armies  in  Shiloh.  The  two  sons  of  Eli,  Hophni  and  Phinehas,  priests  to  Yahweh,  were  there.	
	When  the  day  came  that  Elkanah  sacrificed,  he  gave  to  Peninnah  his  wife,  and  to  all  her  sons  and  her  daughters,  portions	
	but  to  Hannah  he  gave  a  double  portion;  for  he  loved  Hannah,  but  Yahweh  had  shut  up  her  womb.	
	Her  rival  provoked  her  severely,  to  make  her  fret,  because  Yahweh  had  shut  up  her  womb.	
	As  he  did  so  year  by  year,  when  she  went  up  to  the  house  of  Yahweh,  so  she  provoked  her;  therefore  she  wept,  and  didn't  eat.	
	Elkanah  her  husband  said  to  her,  "Hannah,  why  do  you  weep?  Why  don't  you  eat?  Why  is  your  heart  grieved?  Am  I  not  better  to  you  than  ten  sons?"	
	So  Hannah  rose  up  after  they  had  eaten  in  Shiloh,  and  after  they  had  drunk.  Now  Eli  the  priest  was  sitting  on  his  seat  by  the  doorpost  of  the  temple  of  Yahweh.	
	  When  they  came  there  to  the  hill,  behold,  a  band  of  prophets  met  him;  and  the  Spirit  of  God  came  mightily  on  him,  and  he  prophesied  among  them.	
	  It  happened,  when  all  who  knew  him  before  saw  that,  behold,  he  prophesied  with  the  prophets,  then  the  people  said  one  to  another,  "What  is  this  that  has  come  to  the  son  of  Kish?  Is  Saul  also  among  the  prophets?"	
	  One  of  the  same  place  answered,  "Who  is  their  father?"  Therefore  it  became  a  proverb,  "Is  Saul  also  among  the  prophets?"	
	  When  he  had  made  an  end  of  prophesying,  he  came  to  the  high  place.	
	  Saul's  uncle  said  to  him  and  to  his  servant,  "Where  did  you  go?"  He  said,  "To  seek  the  donkeys.  When  we  saw  that  they  were  not  found,  we  came  to  Samuel."	
	  Saul's  uncle  said,  "Please  tell  me  what  Samuel  said  to  you."	
	  Saul  said  to  his  uncle,  "He  told  us  plainly  that  the  donkeys  were  found."  But  concerning  the  matter  of  the  kingdom,  of  which  Samuel  spoke,  he  didn't  tell  him.	
	  Samuel  called  the  people  together  to  Yahweh  to  Mizpah;	
	  and  he  said  to  the  children  of  Israel,  "Thus  says  Yahweh,  the  God  of  Israel,  'I  brought  up  Israel  out  of  Egypt,  and  I  delivered  you  out  of  the  hand  of  the  Egyptians,  and  out  of  the  hand  of  all  the  kingdoms  that  oppressed  you	
	  but  you  have  this  day  rejected  your  God,  who  himself  saves  you  out  of  all  your  calamities  and  your  distresses;  and  you  have  said  to  him,  'No!  Set  a  king  over  us.'  Now  therefore  present  yourselves  before  Yahweh  by  your  tribes,  and  by  your  thousands."	
	 When  you  have  departed  from  me  today,  then  you  shall  find  two  men  by  Rachel's  tomb,  in  the  border  of  Benjamin  at  Zelzah;  and  they  will  tell  you,  'The  donkeys  which  you  went  to  seek  have  been  found;  and  behold,  your  father  has  stopped  caring  about  the  donkeys,  and  is  anxious  for  you,  saying,  "What  shall  I  do  for  my  son?"'	
	  So  Samuel  brought  all  the  tribes  of  Israel  near,  and  the  tribe  of  Benjamin  was  taken.	
	  He  brought  the  tribe  of  Benjamin  near  by  their  families;  and  the  family  of  the  Matrites  was  taken;  and  Saul  the  son  of  Kish  was  taken	
	  Therefore  they  asked  of  Yahweh  further,  "Is  there  yet  a  man  to  come  here?"  Yahweh  answered,  "Behold,  he  has  hidden  himself  among  the  baggage."	
	  They  ran  and  fetched  him  there;  and  when  he  stood  among  the  people,  he  was  higher  than  any  of  the  people  from  his  shoulders  and  upward.	
	  Samuel  said  to  all  the  people,  "You  see  him  whom  Yahweh  has  chosen,  that  there  is  none  like  him  among  all  the  people?"  All  the  people  shouted,  and  said,  "Let  the  king  live!"	
	  Then  Samuel  told  the  people  the  regulations  of  the  kingdom,  and  wrote  it  in  a  book,  and  laid  it  up  before  Yahweh.  Samuel  sent  all  the  people  away,  every  man  to  his  house.	
	  Saul  also  went  to  his  house  to  Gibeah;  and  there  went  with  him  the  army,  whose  hearts  God  had  touched.	
	  But  certain  worthless  fellows  said,  "How  shall  this  man  save  us?"  They  despised  him,  and  brought  him  no  present.  But  he  held  his  peace.	
	 "Then  you  shall  go  on  forward  from  there,  and  you  shall  come  to  the  oak  of  Tabor;  and  three  men  shall  meet  you  there  going  up  to  God  to  Bethel,  one  carrying  three  young  goats,  and  another  carrying  three  loaves  of  bread,  and  another  carrying  a  bottle  of  wine	
	 and  they  will  greet  you,  and  give  you  two  loaves  of  bread,  which  you  shall  receive  of  their  hand.	
	 "After  that  you  shall  come  to  the  hill  of  God,  where  is  the  garrison  of  the  Philistines	
	 and  the  Spirit  of  Yahweh  will  come  mightily  on  you,  and  you  shall  prophesy  with  them,  and  shall  be  turned  into  another  man.	
	 Let  it  be,  when  these  signs  have  come  to  you,  that  you  do  as  occasion  shall  serve  you;  for  God  is  with  you.	
	 "You  shall  go  down  before  me  to  Gilgal;  and  behold,  I  will  come  down  to  you,  to  offer  burnt  offerings,  and  to  sacrifice  sacrifices  of  peace  offerings	
	 It  was  so,  that  when  he  had  turned  his  back  to  go  from  Samuel,  God  gave  him  another  heart	
	 Then  Nahash  the  Ammonite  came  up,  and  encamped  against  Jabesh  Gilead	
	  Therefore  the  men  of  Jabesh  said,  "Tomorrow  we  will  come  out  to  you,  and  you  shall  do  with  us  all  that  seems  good  to  you."	
	  It  was  so  on  the  next  day,  that  Saul  put  the  people  in  three  companies;  and  they  came  into  the  midst  of  the  camp  in  the  morning  watch,  and  struck  the  Ammonites  until  the  heat  of  the  day	
	  The  people  said  to  Samuel,  "Who  is  he  who  said,  'Shall  Saul  reign  over  us?'  Bring  those  men,  that  we  may  put  them  to  death!"	
	  Saul  said,  "There  shall  not  a  man  be  put  to  death  this  day;  for  today  Yahweh  has  worked  deliverance  in  Israel."	
	  Then  Samuel  said  to  the  people,  "Come,  and  let  us  go  to  Gilgal,  and  renew  the  kingdom  there."	
	  All  the  people  went  to  Gilgal;  and  there  they  made  Saul  king  before  Yahweh  in  Gilgal;  and  there  they  offered  sacrifices  of  peace  offerings  before  Yahweh;  and  there  Saul  and  all  the  men  of  Israel  rejoiced  greatly.	
	 Nahash  the  Ammonite  said  to  them,  "On  this  condition  I  will  make  it  with  you,  that  all  your  right  eyes  be  put  out;  and  I  will  lay  it  for  a  reproach  on  all  Israel."	
	 The  elders  of  Jabesh  said  to  him,  "Give  us  seven  day,  that  we  may  send  messengers  to  all  the  borders  of  Israel;  and  then,  if  there  is  no  one  to  save  us,  we  will  come  out  to  you."	
	 Then  the  messengers  came  to  Gibeah  of  Saul,  and  spoke  these  words  in  the  ears  of  the  people	
	 Behold,  Saul  came  following  the  oxen  out  of  the  field;  and  Saul  said,  "What  ails  the  people  that  they  weep?"  They  told  him  the  words  of  the  men  of  Jabesh.	
	 The  Spirit  of  God  came  mightily  on  Saul  when  he  heard  those  words,  and  his  anger  was  kindled  greatly.	
	 He  took  a  yoke  of  oxen,  and  cut  them  in  pieces,  and  sent  them  throughout  all  the  borders  of  Israel  by  the  hand  of  messengers,  saying,  "Whoever  doesn't  come  forth  after  Saul  and  after  Samuel,  so  shall  it  be  done  to  his  oxen."  The  dread  of  Yahweh  fell  on  the  people,  and  they  came  out  as  one  man.	
	 He  numbered  them  in  Bezek;  and  the  children  of  Israel  were  three  hundred  thousand,  and  the  men  of  Judah  thirty  thousand.	
	 They  said  to  the  messengers  who  came,  "Thus  you  shall  tell  the  men  of  Jabesh  Gilead,  'Tomorrow,  by  the  time  the  sun  is  hot,  you  shall  have  deliverance.'"  The  messengers  came  and  told  the  men  of  Jabesh;  and  they  were  glad.	
	 Samuel  said  to  all  Israel,  "Behold,  I  have  listened  to  your  voice  in  all  that  you  said  to  me,  and  have  made  a  king  over  you.	
	  They  cried  to  Yahweh,  and  said,  'We  have  sinned,  because  we  have  forsaken  Yahweh,  and  have  served  the  Baals  and  the  Ashtaroth	
	  Yahweh  sent  Jerubbaal,  and  Bedan,  and  Jephthah,  and  Samuel,  and  delivered  you  out  of  the  hand  of  your  enemies  on  every  side;  and  you  lived  in  safety.	
	  "When  you  saw  that  Nahash  the  king  of  the  children  of  Ammon  came  against  you,  you  said  to  me,  'No,  but  a  king  shall  reign  over  us;'  when  Yahweh  your  God  was  your  king.	
	  Now  therefore  see  the  king  whom  you  have  chosen,  and  whom  you  have  asked  for	
	  If  you  will  fear  Yahweh,  and  serve  him,  and  listen  to  his  voice,  and  not  rebel  against  the  commandment  of  Yahweh,  then  both  you  and  also  the  king  who  reigns  over  you  are  followers  of  Yahweh  your  God.	
	  But  if  you  will  not  listen  to  the  voice  of  Yahweh,  but  rebel  against  the  commandment  of  Yahweh,  then  will  the  hand  of  Yahweh  be  against  you,  as  it  was  against  your  fathers.	
	  "Now  therefore  stand  still  and  see  this  great  thing,  which  Yahweh  will  do  before  your  eyes.	
	  Isn't  it  wheat  harvest  today?  I  will  call  to  Yahweh,  that  he  may  send  thunder  and  rain;  and  you  shall  know  and  see  that  your  wickedness  is  great,  which  you  have  done  in  the  sight  of  Yahweh,  in  asking  for  a  king."	
	  So  Samuel  called  to  Yahweh;  and  Yahweh  sent  thunder  and  rain  that  day	
	  All  the  people  said  to  Samuel,  "Pray  for  your  servants  to  Yahweh  your  God,  that  we  not  die;  for  we  have  added  to  all  our  sins  this  evil,  to  ask  us  a  king."	
	 Now,  behold,  the  king  walks  before  you;  and  I  am  old  and  gray-headed;  and  behold,  my  sons  are  with  you	
	  Samuel  said  to  the  people,  "Don't  be  afraid.  You  have  indeed  done  all  this  evil;  yet  don't  turn  aside  from  following  Yahweh,  but  serve  Yahweh  with  all  your  heart.	
	  Don't  turn  aside  to  go  after  vain  things  which  can't  profit  nor  deliver,  for  they  are  vain.	
	  For  Yahweh  will  not  forsake  his  people  for  his  great  name's  sake,  because  it  has  pleased  Yahweh  to  make  you  a  people  to  himself.	
	  Moreover  as  for  me,  far  be  it  from  me  that  I  should  sin  against  Yahweh  in  ceasing  to  pray  for  you	
	  Only  fear  Yahweh,  and  serve  him  in  truth  with  all  your  heart;  for  consider  how  great  things  he  has  done  for  you.	
	  But  if  you  shall  still  do  wickedly,  you  shall  be  consumed,  both  you  and  your  king."	
	 Here  I  am.  Witness  against  me  before  Yahweh,  and  before  his  anointed.  Whose  ox  have  I  taken?  Whose  donkey  have  I  taken?  Whom  have  I  defrauded?  Whom  have  I  oppressed?  Of  whose  hand  have  I  taken  a  ransom  to  blind  my  eyes  therewith?  I  will  restore  it  to  you."	
	 They  said,  "You  have  not  defrauded  us,  nor  oppressed  us,  neither  have  you  taken  anything  of  any  man's  hand."	
	 He  said  to  them,  "Yahweh  is  witness  against  you,  and  his  anointed  is  witness  this  day,  that  you  have  not  found  anything  in  my  hand."  They  said,  "He  is  witness."	
	 Samuel  said  to  the  people,  "It  is  Yahweh  who  appointed  Moses  and  Aaron,  and  that  brought  your  fathers  up  out  of  the  land  of  Egypt.	
	 Now  therefore  stand  still,  that  I  may  plead  with  you  before  Yahweh  concerning  all  the  righteous  acts  of  Yahweh,  which  he  did  to  you  and  to  your  fathers.	
	 "When  Jacob  had  come  into  Egypt,  and  your  fathers  cried  to  Yahweh,  then  Yahweh  sent  Moses  and  Aaron,  who  brought  your  fathers  out  of  Egypt,  and  made  them  to  dwell  in  this  place.	
	 "But  they  forgot  Yahweh  their  God;  and  he  sold  them  into  the  hand  of  Sisera,  captain  of  the  army  of  Hazor,  and  into  the  hand  of  the  Philistines,  and  into  the  hand  of  the  king  of  Moab;  and  they  fought  against  them.	
	 Saul  reigned  a  year;  and  when  he  had  reigned  two  years  over  Israel,	
	  It  came  to  pass  that  as  soon  as  he  had  made  an  end  of  offering  the  burnt  offering,  behold,  Samuel  came;  and  Saul  went  out  to  meet  him,  that  he  might  greet  him.	
	  Samuel  said,  "What  have  you  done?"  Saul  said,  "Because  I  saw  that  the  people  were  scattered  from  me,  and  that  you  didn't  come  within  the  days  appointed,  and  that  the  Philistines  assembled  themselves  together  at  Michmash;	
	  therefore  I  said,  'Now  the  Philistines  will  come  down  on  me  to  Gilgal,  and  I  haven't  entreated  the  favor  of  Yahweh.'  I  forced  myself  therefore,  and  offered  the  burnt  offering."	
	  Samuel  said  to  Saul,  "You  have  done  foolishly.  You  have  not  kept  the  commandment  of  Yahweh  your  God,  which  he  commanded  you;  for  now  Yahweh  would  have  established  your  kingdom  on  Israel  forever.	
	  But  now  your  kingdom  shall  not  continue.  Yahweh  has  sought  for  himself  a  man  after  his  own  heart,  and  Yahweh  has  appointed  him  to  be  prince  over  his  people,  because  you  have  not  kept  that  which  Yahweh  commanded  you."	
	  Samuel  arose,  and  went  from  Gilgal  to  Gibeah  of  Benjamin.  Saul  numbered  the  people  who  were  present  with  him,  about  six  hundred  men.	
	  Saul,  and  Jonathan  his  son,  and  the  people  who  were  present  with  them,  stayed  in  Geba  of  Benjamin	
	  The  spoilers  came  out  of  the  camp  of  the  Philistines  in  three  companies	
	  and  another  company  turned  the  way  to  Beth  Horon;  and  another  company  turned  the  way  of  the  border  that  looks  down  on  the  valley  of  Zeboim  toward  the  wilderness.	
	  Now  there  was  no  smith  found  throughout  all  the  land  of  Israel;  for  the  Philistines  said,  "Lest  the  Hebrews  make  them  swords  or  spears;"	
	 Saul  chose  for  himself  three  thousand  men  of  Israel,  of  which  two  thousand  were  with  Saul  in  Michmash  and  in  the  Mount  of  Bethel,  and  one  thousand  were  with  Jonathan  in  Gibeah  of  Benjamin	
	  but  all  the  Israelites  went  down  to  the  Philistines,  to  sharpen  every  man  his  plowshare,  mattock,  axe,  and  sickle;	
	  yet  they  had  a  file  for  the  mattocks,  and  for  the  plowshares,  and  for  the  forks,  and  for  the  axes,  and  to  set  the  goads.	
	  So  it  came  to  pass  in  the  day  of  battle,  that  there  was  neither  sword  nor  spear  found  in  the  hand  of  any  of  the  people  who  were  with  Saul  and  Jonathan	
	  The  garrison  of  the  Philistines  went  out  to  the  pass  of  Michmash.	
	 Jonathan  struck  the  garrison  of  the  Philistines  that  was  in  Geba	
	 All  Israel  heard  that  Saul  had  struck  the  garrison  of  the  Philistines,  and  also  that  Israel  was  had  in  abomination  with  the  Philistines.  The  people  were  gathered  together  after  Saul  to  Gilgal.	
	 The  Philistines  assembled  themselves  together  to  fight  with  Israel,  thirty  thousand  chariots,  and  six  thousand  horsemen,  and  people  as  the  sand  which  is  on  the  seashore  in  multitude	
	 When  the  men  of  Israel  saw  that  they  were  in  a  strait  (for  the  people  were  distressed),  then  the  people  hid  themselves  in  caves,  and  in  thickets,  and  in  rocks,  and  in  coverts,  and  in  pits.	
	 Now  some  of  the  Hebrews  had  gone  over  the  Jordan  to  the  land  of  Gad  and  Gilead;  but  as  for  Saul,  he  was  yet  in  Gilgal,  and  all  the  people  followed  him  trembling.	
	 He  stayed  seven  days,  according  to  the  time  set  by  Samuel	
	 Saul  said,  "Bring  here  the  burnt  offering  to  me,  and  the  peace  offerings."  He  offered  the  burnt  offering.	
	 Now  it  fell  on  a  day,  that  Jonathan  the  son  of  Saul  said  to  the  young  man  who  bore  his  armor,  "Come,  and  let  us  go  over  to  the  Philistines'  garrison,  that  is  on  the  other  side."  But  he  didn't  tell  his  father.	
	  But  if  they  say  this,  'Come  up  to  us!'  then  we  will  go  up;  for  Yahweh  has  delivered  them  into  our  hand.  This  shall  be  the  sign  to  us."	
	  Both  of  them  revealed  themselves  to  the  garrison  of  the  Philistines	
	  The  men  of  the  garrison  answered  Jonathan  and  his  armor  bearer,  and  said,  "Come  up  to  us,  and  we  will  show  you  something!"  Jonathan  said  to  his  armor  bearer,  "Come  up  after  me;  for  Yahweh  has  delivered  them  into  the  hand  of  Israel."	
	  Jonathan  climbed  up  on  his  hands  and  on  his  feet,  and  his  armor  bearer  after  him	
	  That  first  slaughter,  which  Jonathan  and  his  armor  bearer  made,  was  about  twenty  men,  within  as  it  were  half  a  furrow's  length  in  an  acre  of  land.	
	  There  was  a  trembling  in  the  camp,  in  the  field,  and  among  all  the  people;  the  garrison,  and  the  spoilers,  they  also  trembled;  and  the  earth  quaked	
	  The  watchmen  of  Saul  in  Gibeah  of  Benjamin  looked;  and  behold,  the  multitude  melted  away,  and  scattered.	
	  Then  Saul  said  to  the  people  who  were  with  him,  "Count  now,  and  see  who  is  missing  from  us."  When  they  had  counted,  behold,  Jonathan  and  his  armor  bearer  were  not  there.	
	  Saul  said  to  Ahijah,  "Bring  the  ark  of  God  here."  For  the  ark  of  God  was  with  the  children  of  Israel  at  that  time.	
	  It  happened,  while  Saul  talked  to  the  priest,  that  the  tumult  that  was  in  the  camp  of  the  Philistines  went  on  and  increased	
	 Saul  stayed  in  the  uttermost  part  of  Gibeah  under  the  pomegranate  tree  which  is  in  Migron	
	  Saul  and  all  the  people  who  were  with  him  were  gathered  together,  and  came  to  the  battle	
	  Now  the  Hebrews  who  were  with  the  Philistines  as  before,  and  who  went  up  with  them  into  the  camp,  from  all  around,  even  they  also  turned  to  be  with  the  Israelites  who  were  with  Saul  and  Jonathan.	
	  Likewise  all  the  men  of  Israel  who  had  hidden  themselves  in  the  hill  country  of  Ephraim,  when  they  heard  that  the  Philistines  fled,  even  they  also  followed  hard  after  them  in  the  battle.	
	  So  Yahweh  saved  Israel  that  day	
	  The  men  of  Israel  were  distressed  that  day;  for  Saul  had  adjured  the  people,  saying,  "Cursed  is  the  man  who  eats  any  food  until  it  is  evening,  and  I  am  avenged  of  my  enemies."  So  none  of  the  people  tasted  food.	
	  All  the  people  came  into  the  forest;  and  there  was  honey  on  the  ground.	
	  When  the  people  had  come  to  the  forest,  behold,  the  honey  dropped	
	  But  Jonathan  didn't  hear  when  his  father  commanded  the  people  with  the  oath	
	  Then  one  of  the  people  answered,  and  said,  "Your  father  directly  commanded  the  people  with  an  oath,  saying,  'Cursed  is  the  man  who  eats  food  this  day.'"  The  people  were  faint.	
	  Then  Jonathan  said,  "My  father  has  troubled  the  land.  Please  look  how  my  eyes  have  been  enlightened,  because  I  tasted  a  little  of  this  honey.	
	 and  Ahijah,  the  son  of  Ahitub,  Ichabod's  brother,  the  son  of  Phinehas,  the  son  of  Eli,  the  priest  of  Yahweh  in  Shiloh,  wearing  an  ephod.  The  people  didn't  know  that  Jonathan  was  gone.	
	  How  much  more,  if  perhaps  the  people  had  eaten  freely  today  of  the  spoil  of  their  enemies  which  they  found?  For  now  has  there  been  no  great  slaughter  among  the  Philistines."	
	  They  struck  of  the  Philistines  that  day  from  Michmash  to  Aijalon.  The  people  were  very  faint;	
	  and  the  people  flew  on  the  spoil,  and  took  sheep,  and  cattle,  and  calves,  and  killed  them  on  the  ground;  and  the  people  ate  them  with  the  blood.	
	  Then  they  told  Saul,  saying,  "Behold,  the  people  are  sinning  against  Yahweh,  in  that  they  eat  meat  with  the  blood."  He  said,  "You  have  dealt  treacherously.  Roll  a  large  stone  to  me  this  day!"	
	  Saul  said,  "Disperse  yourselves  among  the  people,  and  tell  them,  'Bring  me  here  every  man  his  ox,  and  every  man  his  sheep,  and  kill  them  here,  and  eat;  and  don't  sin  against  Yahweh  in  eating  meat  with  the  blood.'"  All  the  people  brought  every  man  his  ox  with  him  that  night,  and  killed  them  there.	
	  Saul  built  an  altar  to  Yahweh.  This  was  the  first  altar  that  he  built  to  Yahweh.	
	  Saul  said,  "Let  us  go  down  after  the  Philistines  by  night,  and  take  spoil  among  them  until  the  morning  light,  and  let  us  not  leave  a  man  of  them."  They  said,  "Do  whatever  seems  good  to  you."  Then  the  priest  said,  "Let  us  draw  near  here  to  God."	
	  Saul  asked  counsel  of  God,  "Shall  I  go  down  after  the  Philistines?  Will  you  deliver  them  into  the  hand  of  Israel?"  But  he  didn't  answer  him  that  day.	
	  Saul  said,  "Draw  near  here,  all  you  chiefs  of  the  people;  and  know  and  see  in  which  this  sin  has  been  this  day.	
	  For,  as  Yahweh  lives,  who  saves  Israel,  though  it  is  in  Jonathan  my  son,  he  shall  surely  die."  But  there  was  not  a  man  among  all  the  people  who  answered  him.	
	 Between  the  passes,  by  which  Jonathan  sought  to  go  over  to  the  Philistines'  garrison,  there  was  a  rocky  crag  on  the  one  side,  and  a  rocky  crag  on  the  other  side	
	  Then  he  said  to  all  Israel,  "You  be  on  one  side,  and  I  and  Jonathan  my  son  will  be  on  the  other  side."  The  people  said  to  Saul,  "Do  what  seems  good  to  you."	
	  Therefore  Saul  said  to  Yahweh,  the  God  of  Israel,  "Show  the  right."  Jonathan  and  Saul  were  chosen;  but  the  people  escaped.	
	  Saul  said,  "Cast  lots  between  me  and  Jonathan  my  son."  Jonathan  was  selected.	
	  Then  Saul  said  to  Jonathan,  "Tell  me  what  you  have  done!"  Jonathan  told  him,  and  said,  "I  certainly  did  taste  a  little  honey  with  the  end  of  the  rod  that  was  in  my  hand;  and  behold,  I  must  die."	
	  Saul  said,  "God  do  so  and  more  also;  for  you  shall  surely  die,  Jonathan."	
	  The  people  said  to  Saul,  "Shall  Jonathan  die,  who  has  worked  this  great  salvation  in  Israel?  Far  from  it!  As  Yahweh  lives,  there  shall  not  one  hair  of  his  head  fall  to  the  ground;  for  he  has  worked  with  God  this  day!"  So  the  people  rescued  Jonathan,  that  he  didn't  die.	
	  Then  Saul  went  up  from  following  the  Philistines;  and  the  Philistines  went  to  their  own  place.	
	  Now  when  Saul  had  taken  the  kingdom  over  Israel,  he  fought  against  all  his  enemies  on  every  side,  against  Moab,  and  against  the  children  of  Ammon,  and  against  Edom,  and  against  the  kings  of  Zobah,  and  against  the  Philistines	
	  He  did  valiantly,  and  struck  the  Amalekites,  and  delivered  Israel  out  of  the  hands  of  those  who  despoiled  them.	
	  Now  the  sons  of  Saul  were  Jonathan,  and  Ishvi,  and  Malchishua;  and  the  names  of  his  two  daughters  were  these	
	 The  one  crag  rose  up  on  the  north  in  front  of  Michmash,  and  the  other  on  the  south  in  front  of  Geba.	
	  and  the  name  of  Saul's  wife  was  Ahinoam  the  daughter  of  Ahimaaz.  The  name  of  the  captain  of  his  army  was  Abner  the  son  of  Ner,  Saul's  uncle.	
	  Kish  was  the  father  of  Saul;  and  Ner  the  father  of  Abner  was  the  son  of  Abiel.	
	  There  was  severe  war  against  the  Philistines  all  the  days  of  Saul	
	 Jonathan  said  to  the  young  man  who  bore  his  armor,  "Come,  and  let  us  go  over  to  the  garrison  of  these  uncircumcised.  It  may  be  that  Yahweh  will  work  for  us;  for  there  is  no  restraint  on  Yahweh  to  save  by  many  or  by  few."	
	 His  armor  bearer  said  to  him,  "Do  all  that  is  in  your  heart.  Turn  and,  behold,  I  am  with  you  according  to  your  heart."	
	 Then  Jonathan  said,  "Behold,  we  will  pass  over  to  the  men,  and  we  will  reveal  ourselves  to  them.	
	 If  they  say  thus  to  us,  'Wait  until  we  come  to  you!'  then  we  will  stand  still  in  our  place,  and  will  not  go  up  to  them.	
	 Samuel  said  to  Saul,  "Yahweh  sent  me  to  anoint  you  to  be  king  over  his  people,  over  Israel.  Now  therefore  listen  to  the  voice  of  the  words  of  Yahweh.	
	  Then  the  word  of  Yahweh  came  to  Samuel,  saying,	
	  "It  grieves  me  that  I  have  set  up  Saul  to  be  king;  for  he  is  turned  back  from  following  me,  and  has  not  performed  my  commandments."  Samuel  was  angry;  and  he  cried  to  Yahweh  all  night.	
	  Samuel  rose  early  to  meet  Saul  in  the  morning;  and  it  was  told  Samuel,  saying,  "Saul  came  to  Carmel,  and  behold,  he  set  up  a  monument  for  himself,  and  turned,  and  passed  on,  and  went  down  to  Gilgal."	
	  Samuel  came  to  Saul;  and  Saul  said  to  him,  "You  are  blessed  by  Yahweh!  I  have  performed  the  commandment  of  Yahweh."	
	  Samuel  said,  "Then  what  does  this  bleating  of  the  sheep  in  my  ears,  and  the  lowing  of  the  cattle  which  I  hear  mean?"	
	  Saul  said,  "They  have  brought  them  from  the  Amalekites;  for  the  people  spared  the  best  of  the  sheep  and  of  the  cattle,  to  sacrifice  to  Yahweh  your  God.  We  have  utterly  destroyed  the  rest."	
	  Then  Samuel  said  to  Saul,  "Stay,  and  I  will  tell  you  what  Yahweh  has  said  to  me  last  night."  He  said  to  him,  "Say  on."	
	  Samuel  said,  "Though  you  were  little  in  your  own  sight,  weren't  you  made  the  head  of  the  tribes  of  Israel?  Yahweh  anointed  you  king  over  Israel;	
	  and  Yahweh  sent  you  on  a  journey,  and  said,  'Go,  and  utterly  destroy  the  sinners  the  Amalekites,  and  fight  against  them  until  they  are  consumed.'	
	  Why  then  didn't  you  obey  the  voice  of  Yahweh,  but  took  the  spoils,  and  did  that  which  was  evil  in  the  sight  of  Yahweh?"	
	 Thus  says  Yahweh  of  Armies,  'I  have  marked  that  which  Amalek  did  to  Israel,  how  he  set  himself  against  him  in  the  way,  when  he  came  up  out  of  Egypt.	
	  Saul  said  to  Samuel,  "But  I  have  obeyed  the  voice  of  Yahweh,  and  have  gone  the  way  which  Yahweh  sent  me,  and  have  brought  Agag  the  king  of  Amalek,  and  have  utterly  destroyed  the  Amalekites.	
	  But  the  people  took  of  the  spoil,  sheep  and  cattle,  the  chief  of  the  devoted  things,  to  sacrifice  to  Yahweh  your  God  in  Gilgal."	
	  Samuel  said,  "Has  Yahweh  as  great  delight  in  burnt  offerings  and  sacrifices,  as  in  obeying  the  voice  of  Yahweh?  Behold,  to  obey  is  better  than  sacrifice,  and  to  listen  than  the  fat  of  rams.	
	  For  rebellion  is  as  the  sin  of  witchcraft,  and  stubbornness  is  as  idolatry  and  teraphim.  Because  you  have  rejected  the  word  of  Yahweh,  he  has  also  rejected  you  from  being  king."	
	  Saul  said  to  Samuel,  "I  have  sinned;  for  I  have  transgressed  the  commandment  of  Yahweh,  and  your  words,  because  I  feared  the  people,  and  obeyed  their  voice.	
	  Now  therefore,  please  pardon  my  sin,  and  turn  again  with  me,  that  I  may  worship  Yahweh."	
	  Samuel  said  to  Saul,  "I  will  not  return  with  you;  for  you  have  rejected  the  word  of  Yahweh,  and  Yahweh  has  rejected  you  from  being  king  over  Israel."	
	  As  Samuel  turned  about  to  go  away,  Saul  grabbed  the  skirt  of  his  robe,  and  it  tore.	
	  Samuel  said  to  him,  "Yahweh  has  torn  the  kingdom  of  Israel  from  you  this  day,  and  has  given  it  to  a  neighbor  of  yours  who  is  better  than  you.	
	  Also  the  Strength  of  Israel  will  not  lie  nor  repent;  for  he  is  not  a  man,  that  he  should  repent."	
	 Now  go  and  strike  Amalek,  and  utterly  destroy  all  that  they  have,  and  don't  spare  them;  but  kill  both  man  and  woman,  infant  and  nursing  baby,  ox  and  sheep,  camel  and  donkey.'"	
	  Then  he  said,  "I  have  sinned	
	  So  Samuel  went  back  with  Saul;  and  Saul  worshiped  Yahweh.	
	  Then  Samuel  said,  "Bring  here  to  me  Agag  the  king  of  the  Amalekites!"  Agag  came  to  him  cheerfully.  Agag  said,  "Surely  the  bitterness  of  death  is  past."	
	  Samuel  said,  "As  your  sword  has  made  women  childless,  so  your  mother  will  be  childless  among  women!"  Samuel  cut  Agag  in  pieces  before  Yahweh  in  Gilgal.	
	  Then  Samuel  went  to  Ramah;  and  Saul  went  up  to  his  house  to  Gibeah  of  Saul.	
	  Samuel  came  no  more  to  see  Saul  until  the  day  of  his  death;  for  Samuel  mourned  for  Saul	
	 Saul  summoned  the  people,  and  numbered  them  in  Telaim,  two  hundred  thousand  footmen,  and  ten  thousand  men  of  Judah.	
	 Saul  came  to  the  city  of  Amalek,  and  laid  wait  in  the  valley.	
	 Saul  said  to  the  Kenites,  "Go,  depart,  go  down  from  among  the  Amalekites,  lest  I  destroy  you  with  them;  for  you  showed  kindness  to  all  the  children  of  Israel,  when  they  came  up  out  of  Egypt."  So  the  Kenites  departed  from  among  the  Amalekites.	
	 Saul  struck  the  Amalekites,  from  Havilah  as  you  go  to  Shur,  that  is  before  Egypt.	
	 He  took  Agag  the  king  of  the  Amalekites  alive,  and  utterly  destroyed  all  the  people  with  the  edge  of  the  sword.	
	 But  Saul  and  the  people  spared  Agag,  and  the  best  of  the  sheep,  and  of  the  cattle,  and  of  the  fatlings,  and  the  lambs,  and  all  that  was  good,  and  wouldn't  utterly  destroy  them	
	 Yahweh  said  to  Samuel,  "How  long  will  you  mourn  for  Saul,  since  I  have  rejected  him  from  being  king  over  Israel?  Fill  your  horn  with  oil,  and  go.  I  will  send  you  to  Jesse  the  Bethlehemite;  for  I  have  provided  a  king  for  myself  among  his  sons."	
	  Jesse  made  seven  of  his  sons  to  pass  before  Samuel.  Samuel  said  to  Jesse,  "Yahweh  has  not  chosen  these."	
	  Samuel  said  to  Jesse,  "Are  all  your  children  here?"  He  said,  "There  remains  yet  the  youngest,  and  behold,  he  is  keeping  the  sheep."  Samuel  said  to  Jesse,  "Send  and  get  him;  for  we  will  not  sit  down  until  he  comes  here."	
	  He  sent,  and  brought  him  in.  Now  he  was  ruddy,  and  withal  of  a  beautiful  face,  and  goodly  to  look  on.  Yahweh  said,  "Arise,  anoint  him;  for  this  is  he."	
	  Then  Samuel  took  the  horn  of  oil,  and  anointed  him  in  the  midst  of  his  brothers	
	  Now  the  Spirit  of  Yahweh  departed  from  Saul,  and  an  evil  spirit  from  Yahweh  troubled  him.	
	  Saul's  servants  said  to  him,  "See  now,  an  evil  spirit  from  God  troubles  you.	
	  Let  our  lord  now  command  your  servants  who  are  before  you,  to  seek  out  a  man  who  is  a  skillful  player  on  the  harp.  It  shall  happen,  when  the  evil  spirit  from  God  is  on  you,  that  he  shall  play  with  his  hand,  and  you  shall  be  well."	
	  Saul  said  to  his  servants,  "Provide  me  now  a  man  who  can  play  well,  and  bring  him  to  me."	
	  Then  one  of  the  young  men  answered,  and  said,  "Behold,  I  have  seen  a  son  of  Jesse  the  Bethlehemite,  who  is  skillful  in  playing,  a  mighty  man  of  valor,  a  man  of  war,  prudent  in  speech,  and  a  comely  person;  and  Yahweh  is  with  him."	
	  Therefore  Saul  sent  messengers  to  Jesse,  and  said,  "Send  me  David  your  son,  who  is  with  the  sheep."	
	 Samuel  said,  "How  can  I  go?  If  Saul  hears  it,  he  will  kill  me."  Yahweh  said,  "Take  a  heifer  with  you,  and  say,  I  have  come  to  sacrifice  to  Yahweh.	
	  Jesse  took  a  donkey  loaded  with  bread,  and  a  bottle  of  wine,  and  a  young  goat,  and  sent  them  by  David  his  son  to  Saul.	
	  David  came  to  Saul,  and  stood  before  him.  He  loved  him  greatly;  and  he  became  his  armor  bearer.	
	  Saul  sent  to  Jesse,  saying,  "Please  let  David  stand  before  me;  for  he  has  found  favor  in  my  sight."	
	  It  happened,  when  the  spirit  from  God  was  on  Saul,  that  David  took  the  harp,  and  played  with  his  hand	
	 Call  Jesse  to  the  sacrifice,  and  I  will  show  you  what  you  shall  do.  You  shall  anoint  to  me  him  whom  I  name  to  you."	
	 Samuel  did  that  which  Yahweh  spoke,  and  came  to  Bethlehem.  The  elders  of  the  city  came  to  meet  him  trembling,  and  said,  "Do  you  come  peaceably?"	
	 He  said,  "Peaceably;  I  have  come  to  sacrifice  to  Yahweh.  Sanctify  yourselves,  and  come  with  me  to  the  sacrifice."  He  sanctified  Jesse  and  his  sons,  and  called  them  to  the  sacrifice.	
	 It  happened,  when  they  had  come,  that  he  looked  at  Eliab,  and  said,  "Surely  Yahweh's  anointed  is  before  him."	
	 But  Yahweh  said  to  Samuel,  "Don't  look  on  his  face,  or  on  the  height  of  his  stature;  because  I  have  rejected  him	
	 Then  Jesse  called  Abinadab,  and  made  him  pass  before  Samuel.  He  said,  "Neither  has  Yahweh  chosen  this  one."	
	 Then  Jesse  made  Shammah  to  pass  by.  He  said,  "Neither  has  Yahweh  chosen  this  one."	
	 Now  the  Philistines  gathered  together  their  armies  to  battle;  and  they  were  gathered  together  at  Socoh,  which  belongs  to  Judah,  and  encamped  between  Socoh  and  Azekah,  in  Ephesdammim.	
	  The  Philistine  said,  "I  defy  the  armies  of  Israel  this  day!  Give  me  a  man,  that  we  may  fight  together!"	
	  When  Saul  and  all  Israel  heard  those  words  of  the  Philistine,  they  were  dismayed,  and  greatly  afraid.	
	  Now  David  was  the  son  of  that  Ephrathite  of  Bethlehem  Judah,  whose  name  was  Jesse;  and  he  had  eight  sons	
	  The  three  eldest  sons  of  Jesse  had  gone  after  Saul  to  the  battle	
	  David  was  the  youngest;  and  the  three  eldest  followed  Saul.	
	  Now  David  went  back  and  forth  from  Saul  to  feed  his  father's  sheep  at  Bethlehem.	
	  The  Philistine  drew  near  morning  and  evening,  and  presented  himself  forty  days.	
	  Jesse  said  to  David  his  son,  "Now  take  for  your  brothers  an  ephah  {1  ephah  is  about  22  litres  or  about  2/3  of  a  bushel}  of  this  parched  grain,  and  these  ten  loaves,  and  carry  them  quickly  to  the  camp  to  your  brothers;	
	  and  bring  these  ten  cheeses  to  the  captain  of  their  thousand,  and  see  how  your  brothers  are  doing,  and  bring  back  news."	
	  Now  Saul,  and  they,  and  all  the  men  of  Israel,  were  in  the  valley  of  Elah,  fighting  with  the  Philistines.	
	 Saul  and  the  men  of  Israel  were  gathered  together,  and  encamped  in  the  valley  of  Elah,  and  set  the  battle  in  array  against  the  Philistines.	
	  David  rose  up  early  in  the  morning,  and  left  the  sheep  with  a  keeper,  and  took,  and  went,  as  Jesse  had  commanded  him;  and  he  came  to  the  place  of  the  wagons,  as  the  army  which  was  going  forth  to  the  fight  shouted  for  the  battle.	
	  Israel  and  the  Philistines  put  the  battle  in  array,  army  against  army.	
	  David  left  his  baggage  in  the  hand  of  the  keeper  of  the  baggage,  and  ran  to  the  army,  and  came  and  greeted  his  brothers.	
	  As  he  talked  with  them,  behold,  there  came  up  the  champion,  the  Philistine  of  Gath,  Goliath  by  name,  out  of  the  ranks  of  the  Philistines,  and  spoke  according  to  the  same  words	
	  All  the  men  of  Israel,  when  they  saw  the  man,  fled  from  him,  and  were  terrified.	
	  The  men  of  Israel  said,  "Have  you  seen  this  man  who  has  come  up?  He  has  surely  come  up  to  defy  Israel.  It  shall  be,  that  the  man  who  kills  him,  the  king  will  enrich  him  with  great  riches,  and  will  give  him  his  daughter,  and  make  his  father's  house  free  in  Israel."	
	  David  spoke  to  the  men  who  stood  by  him,  saying,  "What  shall  be  done  to  the  man  who  kills  this  Philistine,  and  takes  away  the  reproach  from  Israel?  For  who  is  this  uncircumcised  Philistine,  that  he  should  defy  the  armies  of  the  living  God?"	
	  The  people  answered  him  in  this  way,  saying,  "So  shall  it  be  done  to  the  man  who  kills  him."	
	  Eliab  his  eldest  brother  heard  when  he  spoke  to  the  men;  and  Eliab's  anger  was  kindled  against  David,  and  he  said,  "Why  have  you  come  down?  With  whom  have  you  left  those  few  sheep  in  the  wilderness?  I  know  your  pride,  and  the  naughtiness  of  your  heart;  for  you  have  come  down  that  you  might  see  the  battle."	
	  David  said,  "What  have  I  now  done?  Is  there  not  a  cause?"	
	 The  Philistines  stood  on  the  mountain  on  the  one  side,  and  Israel  stood  on  the  mountain  on  the  other  side	
	  He  turned  away  from  him  toward  another,  and  spoke  like  that  again;  and  the  people  answered  him  again  the  same  way.	
	  When  the  words  were  heard  which  David  spoke,  they  rehearsed  them  before  Saul;  and  he  sent  for  him.	
	  David  said  to  Saul,  "Let  no  man's  heart  fail  because  of  him.  Your  servant  will  go  and  fight  with  this  Philistine."	
	  Saul  said  to  David,  "You  are  not  able  to  go  against  this  Philistine  to  fight  with  him;  for  you  are  but  a  youth,  and  he  a  man  of  war  from  his  youth."	
	  David  said  to  Saul,  "Your  servant  was  keeping  his  father's  sheep;  and  when  a  lion  or  a  bear  came,  and  took  a  lamb  out  of  the  flock,	
	  I  went  out  after  him,  and  struck  him,  and  rescued  it  out  of  his  mouth.  When  he  arose  against  me,  I  caught  him  by  his  beard,  and  struck  him,  and  killed  him.	
	  Your  servant  struck  both  the  lion  and  the  bear.  This  uncircumcised  Philistine  shall  be  as  one  of  them,  since  he  has  defied  the  armies  of  the  living  God."	
	  David  said,  "Yahweh  who  delivered  me  out  of  the  paw  of  the  lion,  and  out  of  the  paw  of  the  bear,  he  will  deliver  me  out  of  the  hand  of  this  Philistine."  Saul  said  to  David,  "Go;  and  Yahweh  shall  be  with  you."	
	  Saul  dressed  David  with  his  clothing.  He  put  a  helmet  of  brass  on  his  head,  and  he  clad  him  with  a  coat  of  mail.	
	  David  strapped  his  sword  on  his  clothing,  and  he  tried  to  move;  for  he  had  not  tested  it.  David  said  to  Saul,  "I  can't  go  with  these;  for  I  have  not  tested  them."  David  took  them  off.	
	 There  went  out  a  champion  out  of  the  camp  of  the  Philistines,  named  Goliath,  of  Gath,  whose  height  was  six  cubits  and  a  span.	
	  He  took  his  staff  in  his  hand,  and  chose  for  himself  five  smooth  stones  out  of  the  brook,  and  put  them  in  the  shepherd's  bag  which  he  had,  even  in  his  wallet.  His  sling  was  in  his  hand;  and  he  drew  near  to  the  Philistine.	
	  The  Philistine  came  on  and  drew  near  to  David;  and  the  man  who  bore  the  shield  went  before  him.	
	  When  the  Philistine  looked  about,  and  saw  David,  he  disdained  him;  for  he  was  but  a  youth,  and  ruddy,  and  withal  of  a  fair  face.	
	  The  Philistine  said  to  David,  "Am  I  a  dog,  that  you  come  to  me  with  sticks?"  The  Philistine  cursed  David  by  his  gods.	
	  The  Philistine  said  to  David,  "Come  to  me,  and  I  will  give  your  flesh  to  the  birds  of  the  sky,  and  to  the  animals  of  the  field."	
	  Then  David  said  to  the  Philistine,  "You  come  to  me  with  a  sword,  and  with  a  spear,  and  with  a  javelin	
	  Today,  Yahweh  will  deliver  you  into  my  hand.  I  will  strike  you,  and  take  your  head  from  off  you.  I  will  give  the  dead  bodies  of  the  army  of  the  Philistines  this  day  to  the  birds  of  the  sky,  and  to  the  wild  animals  of  the  earth;  that  all  the  earth  may  know  that  there  is  a  God  in  Israel,	
	  and  that  all  this  assembly  may  know  that  Yahweh  doesn't  save  with  sword  and  spear	
	  It  happened,  when  the  Philistine  arose,  and  came  and  drew  near  to  meet  David,  that  David  hurried,  and  ran  toward  the  army  to  meet  the  Philistine.	
	  David  put  his  hand  in  his  bag,  took  a  stone,  and  slung  it,  and  struck  the  Philistine  in  his  forehead;  and  the  stone  sank  into  his  forehead,  and  he  fell  on  his  face  to  the  earth.	
	 He  had  a  helmet  of  brass  on  his  head,  and  he  was  clad  with  a  coat  of  mail;  and  the  weight  of  the  coat  was  five  thousand  shekels  of  brass.	
	  So  David  prevailed  over  the  Philistine  with  a  sling  and  with  a  stone,  and  struck  the  Philistine,  and  killed  him;  but  there  was  no  sword  in  the  hand  of  David.	
	  Then  David  ran,  and  stood  over  the  Philistine,  and  took  his  sword,  and  drew  it  out  of  its  sheath,  and  killed  him,  and  cut  off  his  head  therewith.  When  the  Philistines  saw  that  their  champion  was  dead,  they  fled.	
	  The  men  of  Israel  and  of  Judah  arose,  and  shouted,  and  pursued  the  Philistines,  until  you  come  to  Gai,  and  to  the  gates  of  Ekron.  The  wounded  of  the  Philistines  fell  down  by  the  way  to  Shaaraim,  even  to  Gath,  and  to  Ekron.	
	  The  children  of  Israel  returned  from  chasing  after  the  Philistines,  and  they  plundered  their  camp.	
	  David  took  the  head  of  the  Philistine,  and  brought  it  to  Jerusalem;  but  he  put  his  armor  in  his  tent.	
	  When  Saul  saw  David  go  forth  against  the  Philistine,  he  said  to  Abner,  the  captain  of  the  army,  "Abner,  whose  son  is  this  youth?"  Abner  said,  "As  your  soul  lives,  O  king,  I  can't  tell."	
	  The  king  said,  "Inquire  whose  son  the  young  man  is!"	
	  As  David  returned  from  the  slaughter  of  the  Philistine,  Abner  took  him,  and  brought  him  before  Saul  with  the  head  of  the  Philistine  in  his  hand.	
	  Saul  said  to  him,  "Whose  son  are  you,  you  young  man?"  David  answered,  "I  am  the  son  of  your  servant  Jesse  the  Bethlehemite."	
	 He  had  brass  shin  armor  on  his  legs,  and  a  javelin  of  brass  between  his  shoulders.	
	 The  staff  of  his  spear  was  like  a  weaver's  beam;  and  his  spear's  head  weighed  six  hundred  shekels  of  iron	
	 He  stood  and  cried  to  the  armies  of  Israel,  and  said  to  them,  "Why  have  you  come  out  to  set  your  battle  in  array?  Am  I  not  a  Philistine,  and  you  servants  to  Saul?  Choose  a  man  for  yourselves,  and  let  him  come  down  to  me.	
	 If  he  be  able  to  fight  with  me,  and  kill  me,  then  will  we  be  your  servants;  but  if  I  prevail  against  him,  and  kill  him,  then  you  will  be  our  servants,  and  serve  us."	
	 It  happened,  when  he  had  made  an  end  of  speaking  to  Saul,  that  the  soul  of  Jonathan  was  knit  with  the  soul  of  David,  and  Jonathan  loved  him  as  his  own  soul.	
	  It  happened  on  the  next  day,  that  an  evil  spirit  from  God  came  mightily  on  Saul,  and  he  prophesied  in  the  midst  of  the  house.  David  played  with  his  hand,  as  he  did  day  by  day.  Saul  had  his  spear  in  his  hand;	
	  and  Saul  threw  the  spear;  for  he  said,  "I  will  pin  David  even  to  the  wall!"  David  escaped  from  his  presence  twice.	
	  Saul  was  afraid  of  David,  because  Yahweh  was  with  him,  and  was  departed  from  Saul.	
	  Therefore  Saul  removed  him  from  him,  and  made  him  his  captain  over  a  thousand;  and  he  went  out  and  came  in  before  the  people.	
	  David  behaved  himself  wisely  in  all  his  ways;  and  Yahweh  was  with  him.	
	  When  Saul  saw  that  he  behaved  himself  very  wisely,  he  stood  in  awe  of  him.	
	  But  all  Israel  and  Judah  loved  David;  for  he  went  out  and  came  in  before  them.	
	  Saul  said  to  David,  "Behold,  my  elder  daughter  Merab,  I  will  give  her  to  you  as  wife.  Only  be  valiant  for  me,  and  fight  Yahweh's  battles."  For  Saul  said,  "Don't  let  my  hand  be  on  him,  but  let  the  hand  of  the  Philistines  be  on  him."	
	  David  said  to  Saul,  "Who  am  I,  and  what  is  my  life,  or  my  father's  family  in  Israel,  that  I  should  be  son-in-law  to  the  king?"	
	  But  it  happened  at  the  time  when  Merab,  Saul's  daughter,  should  have  been  given  to  David,  that  she  was  given  to  Adriel  the  Meholathite  as  wife.	
	 Saul  took  him  that  day,  and  would  let  him  go  no  more  home  to  his  father's  house.	
	  Michal,  Saul's  daughter,  loved  David;  and  they  told  Saul,  and  the  thing  pleased  him.	
	  Saul  said,  I  will  give  her  to  him,  that  she  may  be  a  snare  to  him,  and  that  the  hand  of  the  Philistines  may  be  against  him.  Therefore  Saul  said  to  David,  "You  shall  this  day  be  my  son-in-law  a  second  time."	
	  Saul  commanded  his  servants,  "Talk  with  David  secretly,  and  say,  'Behold,  the  king  has  delight  in  you,  and  all  his  servants  love  you	
	  Saul's  servants  spoke  those  words  in  the  ears  of  David.  David  said,  "Does  it  seems  to  you  a  light  thing  to  be  the  king's  son-in-law,  since  I  am  a  poor  man,  and  lightly  esteemed?"	
	  The  servants  of  Saul  told  him,  saying,  "David  spoke  like  this."	
	  Saul  said,  "You  shall  tell  David,  'The  king  desires  no  dowry  except  one  hundred  foreskins  of  the  Philistines,  to  be  avenged  of  the  king's  enemies.'"  Now  Saul  thought  to  make  David  fall  by  the  hand  of  the  Philistines.	
	  When  his  servants  told  David  these  words,  it  pleased  David  well  to  be  the  king's  son-in-law.  The  days  were  not  expired;	
	  and  David  arose  and  went,  he  and  his  men,  and  killed  of  the  Philistines  two  hundred  men;  and  David  brought  their  foreskins,  and  they  gave  them  in  full  number  to  the  king,  that  he  might  be  the  king's  son-in-law.  Saul  gave  him  Michal  his  daughter  as  wife.	
	  Saul  saw  and  knew  that  Yahweh  was  with  David;  and  Michal,  Saul's  daughter,  loved  him.	
	  Saul  was  yet  the  more  afraid  of  David;  and  Saul  was  David's  enemy  continually.	
	 Then  Jonathan  and  David  made  a  covenant,  because  he  loved  him  as  his  own  soul.	
	  Then  the  princes  of  the  Philistines  went  forth	
	 Jonathan  stripped  himself  of  the  robe  that  was  on  him,  and  gave  it  to  David,  and  his  clothing,  even  to  his  sword,  and  to  his  bow,  and  to  his  sash.	
	 David  went  out  wherever  Saul  sent  him,  and  behaved  himself  wisely	
	 It  happened  as  they  came,  when  David  returned  from  the  slaughter  of  the  Philistine,  that  the  women  came  out  of  all  the  cities  of  Israel,  singing  and  dancing,  to  meet  king  Saul,  with  tambourines,  with  joy,  and  with  instruments  of  music.	
	 The  women  sang  one  to  another  as  they  played,  and  said,  "Saul  has  slain  his  thousands,  David  his  ten  thousands."	
	 Saul  was  very  angry,  and  this  saying  displeased  him;  and  he  said,  "They  have  ascribed  to  David  ten  thousands,  and  to  me  they  have  ascribed  but  thousands.  What  can  he  have  more  but  the  kingdom?"	
	 Saul  eyed  David  from  that  day  and  forward.	
	 Saul  spoke  to  Jonathan  his  son,  and  to  all  his  servants,  that  they  should  kill  David.  But  Jonathan,  Saul's  son,  delighted  much  in  David.	
	  Saul  sought  to  pin  David  even  to  the  wall  with  the  spear;  but  he  slipped  away  out  of  Saul's  presence,  and  he  stuck  the  spear  into  the  wall.  David  fled,  and  escaped  that  night.	
	  Saul  sent  messengers  to  David's  house,  to  watch  him,  and  to  kill  him  in  the  morning.  Michal,  David's  wife,  told  him,  saying,  "If  you  don't  save  your  life  tonight,  tomorrow  you  will  be  killed."	
	  So  Michal  let  David  down  through  the  window.  He  went,  fled,  and  escaped.	
	  Michal  took  the  teraphim,  and  laid  it  in  the  bed,  and  put  a  pillow  of  goats'  hair  at  its  head,  and  covered  it  with  the  clothes.	
	  When  Saul  sent  messengers  to  take  David,  she  said,  "He  is  sick."	
	  Saul  sent  the  messengers  to  see  David,  saying,  "Bring  him  up  to  me  in  the  bed,  that  I  may  kill  him."	
	  When  the  messengers  came  in,  behold,  the  teraphim  was  in  the  bed,  with  the  pillow  of  goats'  hair  at  its  head.	
	  Saul  said  to  Michal,  "Why  have  you  deceived  me  thus,  and  let  my  enemy  go,  so  that  he  is  escaped?"  Michal  answered  Saul,  "He  said  to  me,  'Let  me  go!  Why  should  I  kill  you?'"	
	  Now  David  fled,  and  escaped,  and  came  to  Samuel  to  Ramah,  and  told  him  all  that  Saul  had  done  to  him.  He  and  Samuel  went  and  lived  in  Naioth.	
	  It  was  told  Saul,  saying,  "Behold,  David  is  at  Naioth  in  Ramah."	
	 Jonathan  told  David,  saying,  "Saul  my  father  seeks  to  kill  you.  Now  therefore,  please  take  care  of  yourself  in  the  morning,  and  live  in  a  secret  place,  and  hide  yourself.	
	  Saul  sent  messengers  to  take  David	
	  When  it  was  told  Saul,  he  sent  other  messengers,  and  they  also  prophesied.  Saul  sent  messengers  again  the  third  time,  and  they  also  prophesied.	
	  Then  went  he  also  to  Ramah,  and  came  to  the  great  well  that  is  in  Secu	
	  He  went  there  to  Naioth  in  Ramah.  Then  the  Spirit  of  God  came  on  him  also,  and  he  went  on,  and  prophesied,  until  he  came  to  Naioth  in  Ramah.	
	  He  also  stripped  off  his  clothes,  and  he  also  prophesied  before  Samuel,  and  lay  down  naked  all  that  day  and  all  that  night.  Therefore  they  say,  "Is  Saul  also  among  the  prophets?"	
	 I  will  go  out  and  stand  beside  my  father  in  the  field  where  you  are,  and  I  will  talk  with  my  father  about  you;  and  if  I  see  anything,  I  will  tell  you."	
	 Jonathan  spoke  good  of  David  to  Saul  his  father,  and  said  to  him,  "Don't  let  the  king  sin  against  his  servant,  against  David;  because  he  has  not  sinned  against  you,  and  because  his  works  have  been  very  good  toward  you;	
	 for  he  put  his  life  in  his  hand,  and  struck  the  Philistine,  and  Yahweh  worked  a  great  victory  for  all  Israel.  You  saw  it,  and  rejoiced.  Why  then  will  you  sin  against  innocent  blood,  to  kill  David  without  a  cause?"	
	 Saul  listened  to  the  voice  of  Jonathan	
	 Jonathan  called  David,  and  Jonathan  showed  him  all  those  things.  Jonathan  brought  David  to  Saul,  and  he  was  in  his  presence,  as  before.	
	 There  was  war  again.  David  went  out,  and  fought  with  the  Philistines,  and  killed  them  with  a  great  slaughter;  and  they  fled  before  him.	
	 An  evil  spirit  from  Yahweh  was  on  Saul,  as  he  sat  in  his  house  with  his  spear  in  his  hand;  and  David  was  playing  with  his  hand.	
	Hannah  prayed,  and  said	
	 Those  who  strive  with  Yahweh  shall  be  broken  to  pieces.  He  will  thunder  against  them  in  the  sky.    "Yahweh  will  judge  the  ends  of  the  earth.  He  will  give  strength  to  his  king,  and  exalt  the  horn  of  his  anointed."	
	 Elkanah  went  to  Ramah  to  his  house.  The  child  served  Yahweh  before  Eli  the  priest.	
	 Now  the  sons  of  Eli  were  base  men;  they  didn't  know  Yahweh.	
	 The  custom  of  the  priests  with  the  people  was  that  when  any  man  offered  sacrifice,  the  priest's  servant  came,  while  the  flesh  was  boiling,  with  a  fork  of  three  teeth  in  his  hand;	
	 and  he  struck  it  into  the  pan,  or  kettle,  or  caldron,  or  pot;  all  that  the  fork  brought  up  the  priest  took  therewith.  So  they  did  in  Shiloh  to  all  the  Israelites  who  came  there.	
	 Yes,  before  they  burnt  the  fat,  the  priest's  servant  came,  and  said  to  the  man  who  sacrificed,  "Give  meat  to  roast  for  the  priest;  for  he  will  not  accept  boiled  meat  from  you,  but  raw."	
	 If  the  man  said  to  him,  "Let  the  fat  be  burned  first,  and  then  take  as  much  as  your  soul  desires;"  then  he  would  say,  "No,  but  you  shall  give  it  to  me  now;  and  if  not,  I  will  take  it  by  force."	
	 The  sin  of  the  young  men  was  very  great  before  Yahweh;  for  the  men  despised  the  offering  of  Yahweh.	
	 But  Samuel  ministered  before  Yahweh,  being  a  child,  clothed  with  a  linen  ephod.	
	 Moreover  his  mother  made  him  a  little  robe,  and  brought  it  to  him  from  year  to  year,  when  she  came  up  with  her  husband  to  offer  the  yearly  sacrifice.	
	There  is  no  one  as  holy  as  Yahweh,  For  there  is  no  one  besides  you,  nor  is  there  any  rock  like  our  God.	
	 Eli  blessed  Elkanah  and  his  wife,  and  said,  "Yahweh  give  you  seed  of  this  woman  for  the  petition  which  was  asked  of  Yahweh."  They  went  to  their  own  home.	
	 Yahweh  visited  Hannah,  and  she  conceived,  and  bore  three  sons  and  two  daughters.  The  child  Samuel  grew  before  Yahweh.	
	 Now  Eli  was  very  old;  and  he  heard  all  that  his  sons  did  to  all  Israel,  and  how  that  they  lay  with  the  women  who  served  at  the  door  of  the  Tent  of  Meeting.	
	 He  said  to  them,  "Why  do  you  do  such  things?  for  I  hear  of  your  evil  dealings  from  all  this  people.	
	 No,  my  sons;  for  it  is  no  good  report  that  I  hear	
	 If  one  man  sin  against  another,  God  shall  judge  him;  but  if  a  man  sin  against  Yahweh,  who  shall  entreat  for  him?"  Notwithstanding,  they  didn't  listen  to  the  voice  of  their  father,  because  Yahweh  intended  to  kill  them.	
	 The  child  Samuel  grew  on,  and  increased  in  favor  both  with  Yahweh,  and  also  with  men.	
	 A  man  of  God  came  to  Eli,  and  said  to  him,  "Thus  says  Yahweh,  'Did  I  reveal  myself  to  the  house  of  your  father,  when  they  were  in  Egypt  in  bondage  to  Pharaoh's  house?	
	 Did  I  choose  him  out  of  all  the  tribes  of  Israel  to  be  my  priest,  to  go  up  to  my  altar,  to  burn  incense,  to  wear  an  ephod  before  me?  Did  I  give  to  the  house  of  your  father  all  the  offerings  of  the  children  of  Israel  made  by  fire?	
	 Why  do  you  kick  at  my  sacrifice  and  at  my  offering,  which  I  have  commanded  in  my  habitation,  and  honor  your  sons  above  me,  to  make  yourselves  fat  with  the  best  of  all  the  offerings  of  Israel  my  people?'	
	"Talk  no  more  so  exceeding  proudly.  Don't  let  arrogance  come  out  of  your  mouth,  For  Yahweh  is  a  God  of  knowledge.  By  him  actions  are  weighed.	
	 "Therefore  Yahweh,  the  God  of  Israel,  says,  'I  said  indeed  that  your  house,  and  the  house  of  your  father,  should  walk  before  me  forever.'  But  now  Yahweh  says,  'Be  it  far  from  me;  for  those  who  honor  me  I  will  honor,  and  those  who  despise  me  shall  be  lightly  esteemed.	
	 Behold,  the  days  come,  that  I  will  cut  off  your  arm,  and  the  arm  of  your  father's  house,  that  there  shall  not  be  an  old  man  in  your  house.	
	 You  shall  see  the  affliction  of  my  habitation,  in  all  the  wealth  which  I  shall  give  Israel;  and  there  shall  not  be  an  old  man  in  your  house  forever.	
	 The  man  of  yours,  whom  I  shall  not  cut  off  from  my  altar,  shall  consume  your  eyes,  and  grieve  your  heart;  and  all  the  increase  of  your  house  shall  die  in  the  flower  of  their  age.	
	 "'This  shall  be  the  sign  to  you,  that  shall  come  on  your  two  sons,  on  Hophni  and  Phinehas	
	 I  will  raise  me  up  a  faithful  priest,  that  shall  do  according  to  that  which  is  in  my  heart  and  in  my  mind.  I  will  build  him  a  sure  house;  and  he  shall  walk  before  my  anointed  forever.	
	 It  shall  happen,  that  everyone  who  is  left  in  your  house  shall  come  and  bow  down  to  him  for  a  piece  of  silver  and  a  loaf  of  bread,  and  shall  say,  "Please  put  me  into  one  of  the  priests'  offices,  that  I  may  eat  a  morsel  of  bread."'"	
	"The  bows  of  the  mighty  men  are  broken.  Those  who  stumbled  are  armed  with  strength.	
	Those  who  were  full  have  hired  themselves  out  for  bread.  Those  who  were  hungry  are  satisfied.  Yes,  the  barren  has  borne  seven.  She  who  has  many  children  languishes.	
	"Yahweh  kills,  and  makes  alive.  He  brings  down  to  Sheol  {Sheol  is  the  place  of  the  dead.},  and  brings  up.	
	Yahweh  makes  poor,  and  makes  rich.  He  brings  low,  he  also  lifts  up.	
	He  raises  up  the  poor  out  of  the  dust.  He  lifts  up  the  needy  from  the  dunghill,  To  make  them  sit  with  princes,  and  inherit  the  throne  of  glory.  For  the  pillars  of  the  earth  are  Yahweh's.  He  has  set  the  world  on  them.	
	He  will  keep  the  feet  of  his  holy  ones,  but  the  wicked  shall  be  put  to  silence  in  darkness;  for  no  man  shall  prevail  by  strength.	
	 David  fled  from  Naioth  in  Ramah,  and  came  and  said  before  Jonathan,  "What  have  I  done?  What  is  my  iniquity?  What  is  my  sin  before  your  father,  that  he  seeks  my  life?"	
	  Then  David  said  to  Jonathan,  "Who  shall  tell  me  if  perchance  your  father  answers  you  roughly?"	
	  Jonathan  said  to  David,  "Come,  and  let  us  go  out  into  the  field."  They  both  went  out  into  the  field.	
	  Jonathan  said  to  David,  "By  Yahweh,  the  God  of  Israel,  when  I  have  sounded  my  father  about  this  time  tomorrow,  or  the  third  day,  behold,  if  there  is  good  toward  David,  shall  I  not  then  send  to  you,  and  disclose  it  to  you?	
	  Yahweh  do  so  to  Jonathan,  and  more  also,  should  it  please  my  father  to  do  you  evil,  if  I  don't  disclose  it  to  you,  and  send  you  away,  that  you  may  go  in  peace	
	  You  shall  not  only  while  yet  I  live  show  me  the  loving  kindness  of  Yahweh,  that  I  not  die;	
	  but  also  you  shall  not  cut  off  your  kindness  from  my  house  forever;  no,  not  when  Yahweh  has  cut  off  the  enemies  of  David  everyone  from  the  surface  of  the  earth."	
	  So  Jonathan  made  a  covenant  with  the  house  of  David,  saying,  "Yahweh  will  require  it  at  the  hand  of  David's  enemies."	
	  Jonathan  caused  David  to  swear  again,  for  the  love  that  he  had  to  him;  for  he  loved  him  as  he  loved  his  own  soul.	
	  Then  Jonathan  said  to  him,  "Tomorrow  is  the  new  moon	
	  When  you  have  stayed  three  days,  you  shall  go  down  quickly,  and  come  to  the  place  where  you  hid  yourself  when  this  started,  and  shall  remain  by  the  stone  Ezel.	
	 He  said  to  him,  "Far  from  it;  you  shall  not  die.  Behold,  my  father  does  nothing  either  great  or  small,  but  that  he  discloses  it  to  me;  and  why  should  my  father  hide  this  thing  from  me?  It  is  not  so."	
	  I  will  shoot  three  arrows  on  its  side,  as  though  I  shot  at  a  mark.	
	  Behold,  I  will  send  the  boy,  saying,  'Go,  find  the  arrows!'  If  I  tell  the  boy,  'Behold,  the  arrows  are  on  this  side  of  you.  Take  them;'  then  come;  for  there  is  peace  to  you  and  no  hurt,  as  Yahweh  lives.	
	  But  if  I  say  this  to  the  boy,  'Behold,  the  arrows  are  beyond  you;'  then  go  your  way;  for  Yahweh  has  sent  you  away.	
	  Concerning  the  matter  which  you  and  I  have  spoken  of,  behold,  Yahweh  is  between  you  and  me  forever."	
	  So  David  hid  himself  in  the  field	
	  The  king  sat  on  his  seat,  as  at  other  times,  even  on  the  seat  by  the  wall;  and  Jonathan  stood  up,  and  Abner  sat  by  Saul's  side	
	  Nevertheless  Saul  didn't  say  anything  that  day	
	  It  happened  on  the  next  day  after  the  new  moon,  the  second  day,  that  David's  place  was  empty.  Saul  said  to  Jonathan  his  son,  "Why  doesn't  the  son  of  Jesse  come  to  eat,  neither  yesterday,  nor  today?"	
	  Jonathan  answered  Saul,  "David  earnestly  asked  leave  of  me  to  go  to  Bethlehem.	
	  He  said,  'Please  let  me  go,  for  our  family  has  a  sacrifice  in  the  city.  My  brother  has  commanded  me  to  be  there.  Now,  if  I  have  found  favor  in  your  eyes,  please  let  me  go  away  and  see  my  brothers.'  Therefore  he  has  not  come  to  the  king's  table."	
	 David  swore  moreover,  and  said,  "Your  father  knows  well  that  I  have  found  favor  in  your  eyes;  and  he  says,  'Don't  let  Jonathan  know  this,  lest  he  be  grieved	
	  Then  Saul's  anger  was  kindled  against  Jonathan,  and  he  said  to  him,  "You  son  of  a  perverse  rebellious  woman,  don't  I  know  that  you  have  chosen  the  son  of  Jesse  to  your  own  shame,  and  to  the  shame  of  your  mother's  nakedness?	
	  For  as  long  as  the  son  of  Jesse  lives  on  the  earth,  you  shall  not  be  established,  nor  your  kingdom.  Therefore  now  send  and  bring  him  to  me,  for  he  shall  surely  die!"	
	  Jonathan  answered  Saul  his  father,  and  said  to  him,  "Why  should  he  be  put  to  death?  What  has  he  done?"	
	  Saul  cast  his  spear  at  him  to  strike  him.  By  this  Jonathan  knew  that  his  father  was  determined  to  put  David  to  death.	
	  So  Jonathan  arose  from  the  table  in  fierce  anger,  and  ate  no  food  the  second  day  of  the  month;  for  he  was  grieved  for  David,  because  his  father  had  done  him  shame.	
	  It  happened  in  the  morning,  that  Jonathan  went  out  into  the  field  at  the  time  appointed  with  David,  and  a  little  boy  with  him.	
	  He  said  to  his  boy,  "Run,  find  now  the  arrows  which  I  shoot."  As  the  boy  ran,  he  shot  an  arrow  beyond  him.	
	  When  the  boy  had  come  to  the  place  of  the  arrow  which  Jonathan  had  shot,  Jonathan  cried  after  the  boy,  and  said,  "Isn't  the  arrow  beyond  you?"	
	  Jonathan  cried  after  the  boy,  "Go  fast!  Hurry!  Don't  delay!"  Jonathan's  boy  gathered  up  the  arrows,  and  came  to  his  master.	
	  But  the  boy  didn't  know  anything.  Only  Jonathan  and  David  knew  the  matter.	
	 Then  Jonathan  said  to  David,  "Whatever  your  soul  desires,  I  will  even  do  it  for  you."	
	  Jonathan  gave  his  weapons  to  his  boy,  and  said  to  him,  "Go,  carry  them  to  the  city."	
	  As  soon  as  the  boy  was  gone,  David  arose  out  of  the  south,  and  fell  on  his  face  to  the  ground,  and  bowed  himself  three  times.  They  kissed  one  another,  and  wept  one  with  another,  and  David  wept  the  most.	
	  Jonathan  said  to  David,  "Go  in  peace,  because  we  have  both  sworn  in  the  name  of  Yahweh,  saying,  'Yahweh  shall  be  between  me  and  you,  and  between  my  seed  and  your  seed,  forever.'"  He  arose  and  departed;  and  Jonathan  went  into  the  city.	
	 David  said  to  Jonathan,  "Behold,  tomorrow  is  the  new  moon,  and  I  should  not  fail  to  dine  with  the  king;  but  let  me  go,  that  I  may  hide  myself  in  the  field  to  the  third  day  at  evening.	
	 If  your  father  miss  me  at  all,  then  say,  'David  earnestly  asked  leave  of  me  that  he  might  run  to  Bethlehem  his  city;  for  it  is  the  yearly  sacrifice  there  for  all  the  family.'	
	 If  he  says,  'It  is  well;'  your  servant  shall  have  peace	
	 Therefore  deal  kindly  with  your  servant;  for  you  have  brought  your  servant  into  a  covenant  of  Yahweh  with  you	
	 Jonathan  said,  "Far  be  it  from  you;  for  if  I  should  at  all  know  that  evil  were  determined  by  my  father  to  come  on  you,  then  wouldn't  I  tell  you  that?"	
	 Then  came  David  to  Nob  to  Ahimelech  the  priest.  Ahimelech  came  to  meet  David  trembling,  and  said  to  him,  "Why  are  you  alone,  and  no  man  with  you?"	
	  David  arose,  and  fled  that  day  for  fear  of  Saul,  and  went  to  Achish  the  king  of  Gath.	
	  The  servants  of  Achish  said  to  him,  "Isn't  this  David  the  king  of  the  land?  Didn't  they  sing  one  to  another  about  him  in  dances,  saying,  'Saul  has  slain  his  thousands,  David  his  ten  thousands?'"	
	  David  laid  up  these  words  in  his  heart,  and  was  very  afraid  of  Achish  the  king  of  Gath.	
	  He  changed  his  behavior  before  them,  and  pretended  to  be  mad  in  their  hands,  and  scrabbled  on  the  doors  of  the  gate,  and  let  his  spittle  fall  down  on  his  beard.	
	  Then  Achish  said  to  his  servants,  "Look,  you  see  the  man  is  mad.  Why  then  have  you  brought  him  to  me?	
	  Do  I  lack  madmen,  that  you  have  brought  this  fellow  to  play  the  madman  in  my  presence?  Shall  this  fellow  come  into  my  house?"	
	 David  said  to  Ahimelech  the  priest,  "The  king  has  commanded  me  a  business,  and  has  said  to  me,  'Let  no  man  know  anything  of  the  business  about  which  I  send  you,  and  what  I  have  commanded  you;  and  I  have  appointed  the  young  men  to  such  and  such  a  place.'	
	 Now  therefore  what  is  under  your  hand?  Give  me  five  loaves  of  bread  in  my  hand,  or  whatever  there  is  present."	
	 The  priest  answered  David,  and  said,  "There  is  no  common  bread  under  my  hand,  but  there  is  holy  bread;  if  only  the  young  men  have  kept  themselves  from  women."	
	 David  answered  the  priest,  and  said  to  him,  "Truly,  women  have  been  kept  from  us  about  these  three  days.  When  I  came  out,  the  vessels  of  the  young  men  were  holy,  though  it  was  but  a  common  journey.  How  much  more  then  today  shall  their  vessels  be  holy?"	
	 So  the  priest  gave  him  holy  bread;  for  there  was  no  bread  there  but  the  show  bread,  that  was  taken  from  before  Yahweh,  to  put  hot  bread  in  the  day  when  it  was  taken  away.	
	 Now  a  certain  man  of  the  servants  of  Saul  was  there  that  day,  detained  before  Yahweh;  and  his  name  was  Doeg  the  Edomite,  the  best  of  the  herdsmen  who  belonged  to  Saul.	
	 David  said  to  Ahimelech,  "Isn't  there  here  under  your  hand  spear  or  sword?  For  I  have  neither  brought  my  sword  nor  my  weapons  with  me,  because  the  king's  business  required  haste."	
	 The  priest  said,  "The  sword  of  Goliath  the  Philistine,  whom  you  killed  in  the  valley  of  Elah,  behold,  it  is  here  wrapped  in  a  cloth  behind  the  ephod.  If  you  will  take  that,  take  it;  for  there  is  no  other  except  that  here."  David  said,  "There  is  none  like  that.  Give  it  to  me."	
	 David  therefore  departed  there,  and  escaped  to  the  cave  of  Adullam.  When  his  brothers  and  all  his  father's  house  heard  it,  they  went  down  there  to  him.	
	  He  inquired  of  Yahweh  for  him,  gave  him  food,  and  gave  him  the  sword  of  Goliath  the  Philistine."	
	  Then  the  king  sent  to  call  Ahimelech  the  priest,  the  son  of  Ahitub,  and  all  his  father's  house,  the  priests  who  were  in  Nob	
	  Saul  said,  "Hear  now,  you  son  of  Ahitub."  He  answered,  "Here  I  am,  my  lord."	
	  Saul  said  to  him,  "Why  have  you  conspired  against  me,  you  and  the  son  of  Jesse,  in  that  you  have  given  him  bread,  and  a  sword,  and  have  inquired  of  God  for  him,  that  he  should  rise  against  me,  to  lie  in  wait,  as  at  this  day?"	
	  Then  Ahimelech  answered  the  king,  and  said,  "Who  among  all  your  servants  is  so  faithful  as  David,  who  is  the  king's  son-in-law,  and  is  taken  into  your  council,  and  is  honorable  in  your  house?	
	  Have  I  today  begun  to  inquire  of  God  for  him?  Be  it  far  from  me!  Don't  let  the  king  impute  anything  to  his  servant,  nor  to  all  the  house  of  my  father;  for  your  servant  knows  nothing  of  all  this,  less  or  more."	
	  The  king  said,  "You  shall  surely  die,  Ahimelech,  you,  and  all  your  father's  house."	
	  The  king  said  to  the  guard  who  stood  about  him,  "Turn,  and  kill  the  priests  of  Yahweh;  because  their  hand  also  is  with  David,  and  because  they  knew  that  he  fled,  and  didn't  disclose  it  to  me."  But  the  servants  of  the  king  wouldn't  put  forth  their  hand  to  fall  on  the  priests  of  Yahweh.	
	  The  king  said  to  Doeg,  "Turn  and  attack  the  priests!"  Doeg  the  Edomite  turned,  and  he  attacked  the  priests,  and  he  killed  on  that  day  eighty-five  people  who  wore  a  linen  ephod.	
	  He  struck  Nob,  the  city  of  the  priests,  with  the  edge  of  the  sword,  both  men  and  women,  children  and  nursing  babies,  and  cattle  and  donkeys  and  sheep,  with  the  edge  of  the  sword.	
	 Everyone  who  was  in  distress,  and  everyone  who  was  in  debt,  and  everyone  who  was  discontented,  gathered  themselves  to  him;  and  he  became  captain  over  them	
	  One  of  the  sons  of  Ahimelech,  the  son  of  Ahitub,  named  Abiathar,  escaped,  and  fled  after  David.	
	  Abiathar  told  David  that  Saul  had  slain  Yahweh's  priests.	
	  David  said  to  Abiathar,  "I  knew  on  that  day,  when  Doeg  the  Edomite  was  there,  that  he  would  surely  tell  Saul.  I  am  responsible  for  the  death  of  all  the  persons  of  your  father's  house.	
	  Stay  with  me,  don't  be  afraid;  for  he  who  seeks  my  life  seeks  your  life.  For  with  me  you  shall  be  in  safeguard."	
	 David  went  there  to  Mizpeh  of  Moab,  and  he  said  to  the  king  of  Moab,  "Please  let  my  father  and  my  mother  come  out  with  you,  until  I  know  what  God  will  do  for  me."	
	 He  brought  them  before  the  king  of  Moab;  and  they  lived  with  him  all  the  while  that  David  was  in  the  stronghold.	
	 The  prophet  Gad  said  to  David,  "Don't  stay  in  the  stronghold.  Depart,  and  go  into  the  land  of  Judah."  Then  David  departed,  and  came  into  the  forest  of  Hereth.	
	 Saul  heard  that  David  was  discovered,  and  the  men  who  were  with  him.  Now  Saul  was  sitting  in  Gibeah,  under  the  tamarisk  tree  in  Ramah,  with  his  spear  in  his  hand,  and  all  his  servants  were  standing  about  him.	
	 Saul  said  to  his  servants  who  stood  about  him,  "Hear  now,  you  Benjamites!  Will  the  son  of  Jesse  give  everyone  of  you  fields  and  vineyards,  will  he  make  you  all  captains  of  thousands  and  captains  of  hundreds,	
	 that  all  of  you  have  conspired  against  me,  and  there  is  none  who  discloses  to  me  when  my  son  makes  a  treaty  with  the  son  of  Jesse,  and  there  is  none  of  you  who  is  sorry  for  me,  or  discloses  to  me  that  my  son  has  stirred  up  my  servant  against  me,  to  lie  in  wait,  as  at  this  day?"	
	 Then  Doeg  the  Edomite,  who  stood  by  the  servants  of  Saul,  answered  and  said,  "I  saw  the  son  of  Jesse  coming  to  Nob,  to  Ahimelech  the  son  of  Ahitub.	
	 David  was  told,  "Behold,  the  Philistines  are  fighting  against  Keilah,  and  are  robbing  the  threshing  floors."	
	  Then  David  said,  "O  Yahweh,  the  God  of  Israel,  your  servant  has  surely  heard  that  Saul  seeks  to  come  to  Keilah,  to  destroy  the  city  for  my  sake.	
	  Will  the  men  of  Keilah  deliver  me  up  into  his  hand?  Will  Saul  come  down,  as  your  servant  has  heard?  Yahweh,  the  God  of  Israel,  I  beg  you,  tell  your  servant."  Yahweh  said,  "He  will  come  down."	
	  Then  David  said,  "Will  the  men  of  Keilah  deliver  me  and  my  men  into  the  hand  of  Saul?"  Yahweh  said,  "They  will  deliver  you  up."	
	  Then  David  and  his  men,  who  were  about  six  hundred,  arose  and  departed  out  of  Keilah,  and  went  wherever  they  could  go.  It  was  told  Saul  that  David  was  escaped  from  Keilah;  and  he  gave  up  going  there.	
	  David  stayed  in  the  wilderness  in  the  strongholds,  and  remained  in  the  hill  country  in  the  wilderness  of  Ziph.  Saul  sought  him  every  day,  but  God  didn't  deliver  him  into  his  hand.	
	  David  saw  that  Saul  had  come  out  to  seek  his  life.  David  was  in  the  wilderness  of  Ziph  in  the  wood.	
	  Jonathan,  Saul's  son,  arose,  and  went  to  David  into  the  woods,  and  strengthened  his  hand  in  God.	
	  He  said  to  him,  "Don't  be  afraid;  for  the  hand  of  Saul  my  father  shall  not  find  you;  and  you  shall  be  king  over  Israel,  and  I  shall  be  next  to  you;  and  that  also  Saul  my  father  knows."	
	  They  both  made  a  covenant  before  Yahweh	
	  Then  the  Ziphites  came  up  to  Saul  to  Gibeah,  saying,  "Doesn't  David  hide  himself  with  us  in  the  strongholds  in  the  wood,  in  the  hill  of  Hachilah,  which  is  on  the  south  of  the  desert?	
	 Therefore  David  inquired  of  Yahweh,  saying,  "Shall  I  go  and  strike  these  Philistines?"  Yahweh  said  to  David,  "Go  strike  the  Philistines,  and  save  Keilah."	
	  Now  therefore,  O  king,  come  down,  according  to  all  the  desire  of  your  soul  to  come  down;  and  our  part  shall  be  to  deliver  him  up  into  the  king's  hand."	
	  Saul  said,  "You  are  blessed  by  Yahweh;  for  you  have  had  compassion  on  me.	
	  Please  go  make  yet  more  sure,  and  know  and  see  his  place  where  his  haunt  is,  and  who  has  seen  him  there;  for  it  is  told  me  that  he  deals  very  subtly.	
	  See  therefore,  and  take  knowledge  of  all  the  lurking  places  where  he  hides  himself,  and  come  again  to  me  with  certainty,  and  I  will  go  with  you	
	  They  arose,  and  went  to  Ziph  before  Saul	
	  Saul  and  his  men  went  to  seek  him.  When  David  was  told,  he  went  down  to  the  rock,  and  stayed  in  the  wilderness  of  Maon.  When  Saul  heard  that,  he  pursued  David  in  the  wilderness  of  Maon.	
	  Saul  went  on  this  side  of  the  mountain,  and  David  and  his  men  on  that  side  of  the  mountain	
	  But  a  messenger  came  to  Saul,  saying,  "Hurry  and  come;  for  the  Philistines  have  made  a  raid  on  the  land!"	
	  So  Saul  returned  from  pursuing  after  David,  and  went  against  the  Philistines	
	  David  went  up  from  there,  and  lived  in  the  strongholds  of  En  Gedi.	
	 David's  men  said  to  him,  "Behold,  we  are  afraid  here  in  Judah	
	 Then  David  inquired  of  Yahweh  yet  again.  Yahweh  answered  him,  and  said,  "Arise,  go  down  to  Keilah;  for  I  will  deliver  the  Philistines  into  your  hand."	
	 David  and  his  men  went  to  Keilah,  and  fought  with  the  Philistines,  and  brought  away  their  livestock,  and  killed  them  with  a  great  slaughter.  So  David  saved  the  inhabitants  of  Keilah.	
	 It  happened,  when  Abiathar  the  son  of  Ahimelech  fled  to  David  to  Keilah,  that  he  came  down  with  an  ephod  in  his  hand.	
	 It  was  told  Saul  that  David  had  come  to  Keilah.  Saul  said,  "God  has  delivered  him  into  my  hand;  for  he  is  shut  in,  by  entering  into  a  town  that  has  gates  and  bars."	
	 Saul  summoned  all  the  people  to  war,  to  go  down  to  Keilah,  to  besiege  David  and  his  men.	
	 David  knew  that  Saul  was  devising  mischief  against  him;  and  he  said  to  Abiathar  the  priest,  "Bring  the  ephod  here."	
	 It  happened,  when  Saul  was  returned  from  following  the  Philistines,  that  it  was  told  him,  saying,  "Behold,  David  is  in  the  wilderness  of  En  Gedi."	
	  Behold,  this  day  your  eyes  have  seen  how  that  Yahweh  had  delivered  you  today  into  my  hand  in  the  cave.  Some  urged  me  to  kill  you;  but  I  spared  you;  and  I  said,  I  will  not  put  forth  my  hand  against  my  lord;  for  he  is  Yahweh's  anointed.	
	  Moreover,  my  father,  behold,  yes,  see  the  skirt  of  your  robe  in  my  hand;  for  in  that  I  cut  off  the  skirt  of  your  robe,  and  didn't  kill  you,  know  and  see  that  there  is  neither  evil  nor  disobedience  in  my  hand,  and  I  have  not  sinned  against  you,  though  you  hunt  for  my  life  to  take  it.	
	  May  Yahweh  judge  between  me  and  you,  and  may  Yahweh  avenge  me  of  you;  but  my  hand  shall  not  be  on  you.	
	  As  the  proverb  of  the  ancients  says,  'Out  of  the  wicked  comes  forth  wickedness;'  but  my  hand  shall  not  be  on  you.	
	  Against  whom  has  the  king  of  Israel  come  out?  Whom  do  you  pursue?  A  dead  dog?  A  flea?	
	  May  Yahweh  therefore  be  judge,  and  give  sentence  between  me  and  you,  and  see,  and  plead  my  cause,  and  deliver  me  out  of  your  hand."	
	  It  came  to  pass,  when  David  had  made  an  end  of  speaking  these  words  to  Saul,  that  Saul  said,  "Is  this  your  voice,  my  son  David?"  Saul  lifted  up  his  voice,  and  wept.	
	  He  said  to  David,  "You  are  more  righteous  than  I;  for  you  have  done  good  to  me,  whereas  I  have  done  evil  to  you.	
	  You  have  declared  this  day  how  you  have  dealt  well  with  me,  because  when  Yahweh  had  delivered  me  up  into  your  hand,  you  didn't  kill  me.	
	  For  if  a  man  finds  his  enemy,  will  he  let  him  go  away  unharmed?  Therefore  may  Yahweh  reward  you  good  for  that  which  you  have  done  to  me  this  day.	
	 Then  Saul  took  three  thousand  chosen  men  out  of  all  Israel,  and  went  to  seek  David  and  his  men  on  the  rocks  of  the  wild  goats.	
	  Now,  behold,  I  know  that  you  shall  surely  be  king,  and  that  the  kingdom  of  Israel  shall  be  established  in  your  hand.	
	  Swear  now  therefore  to  me  by  Yahweh,  that  you  will  not  cut  off  my  seed  after  me,  and  that  you  will  not  destroy  my  name  out  of  my  father's  house."	
	  David  swore  to  Saul.  Saul  went  home;  but  David  and  his  men  went  up  to  the  stronghold.	
	 He  came  to  the  sheep  pens  by  the  way,  where  there  was  a  cave;  and  Saul  went  in  to  relieve  himself.  Now  David  and  his  men  were  abiding  in  the  innermost  parts  of  the  cave.	
	 The  men  of  David  said  to  him,  "Behold,  the  day  of  which  Yahweh  said  to  you,  'Behold,  I  will  deliver  your  enemy  into  your  hand,  and  you  shall  do  to  him  as  it  shall  seem  good  to  you.'"  Then  David  arose,  and  cut  off  the  skirt  of  Saul's  robe  secretly.	
	 It  happened  afterward,  that  David's  heart  struck  him,  because  he  had  cut  off  Saul's  skirt.	
	 He  said  to  his  men,  "Yahweh  forbid  that  I  should  do  this  thing  to  my  lord,  Yahweh's  anointed,  to  put  forth  my  hand  against  him,  since  he  is  Yahweh's  anointed."	
	 So  David  checked  his  men  with  these  words,  and  didn't  allow  them  to  rise  against  Saul.  Saul  rose  up  out  of  the  cave,  and  went  on  his  way.	
	 David  also  arose  afterward,  and  went  out  of  the  cave,  and  cried  after  Saul,  saying,  "My  lord  the  king!"  When  Saul  looked  behind  him,  David  bowed  with  his  face  to  the  earth,  and  showed  respect.	
	 David  said  to  Saul,  "Why  do  you  listen  to  men's  words,  saying,  'Behold,  David  seeks  your  hurt?'	
	  Nabal  answered  David's  servants,  and  said,  "Who  is  David?  Who  is  the  son  of  Jesse?  There  are  many  servants  who  break  away  from  their  masters  these  days.	
	  Shall  I  then  take  my  bread,  and  my  water,  and  my  meat  that  I  have  killed  for  my  shearers,  and  give  it  to  men  who  I  don't  know  where  they  come  from?"	
	  So  David's  young  men  turned  on  their  way,  and  went  back,  and  came  and  told  him  according  to  all  these  words.	
	  David  said  to  his  men,  "Every  man  put  on  his  sword!"  Every  man  put  on  his  sword.  David  also  put  on  his  sword.  About  four  hundred  men  followed  David;  and  two  hundred  stayed  by  the  baggage.	
	  But  one  of  the  young  men  told  Abigail,  Nabal's  wife,  saying,  "Behold,  David  sent  messengers  out  of  the  wilderness  to  Greet  our  master;  and  he  railed  at  them.	
	  But  the  men  were  very  good  to  us,  and  we  were  not  hurt,  neither  missed  we  anything,  as  long  as  we  went  with  them,  when  we  were  in  the  fields.	
	  They  were  a  wall  to  us  both  by  night  and  by  day,  all  the  while  we  were  with  them  keeping  the  sheep.	
	  Now  therefore  know  and  consider  what  you  will  do;  for  evil  is  determined  against  our  master,  and  against  all  his  house;  for  he  is  such  a  worthless  fellow  that  one  can't  speak  to  him."	
	  Then  Abigail  hurried  and  took  two  hundred  loaves  of  bread,  two  bottles  of  wine,  five  sheep  ready  dressed,  five  measures  of  parched  grain,  one  hundred  clusters  of  raisins,  and  two  hundred  cakes  of  figs,  and  laid  them  on  donkeys.	
	  She  said  to  her  young  men,  "Go  on  before  me.  Behold,  I  come  after  you."  But  she  didn't  tell  her  husband,  Nabal.	
	 There  was  a  man  in  Maon,  whose  possessions  were  in  Carmel;  and  the  man  was  very  great,  and  he  had  three  thousand  sheep,  and  a  thousand  goats	
	  It  was  so,  as  she  rode  on  her  donkey,  and  came  down  by  the  covert  of  the  mountain,  that  behold,  David  and  his  men  came  down  toward  her;  and  she  met  them.	
	  Now  David  had  said,  "Surely  in  vain  have  I  kept  all  that  this  fellow  has  in  the  wilderness,  so  that  nothing  was  missed  of  all  that  pertained  to  him.  He  has  returned  me  evil  for  good.	
	  God  do  so  to  the  enemies  of  David,  and  more  also,  if  I  leave  of  all  that  belongs  to  him  by  the  morning  light  so  much  as  one  who  urinates  on  a  wall.  {or,  male.}"	
	  When  Abigail  saw  David,  she  hurried,  and  alighted  from  her  donkey,  and  fell  before  David  on  her  face,  and  bowed  herself  to  the  ground.	
	  She  fell  at  his  feet,  and  said,  "On  me,  my  lord,  on  me  be  the  iniquity;  and  please  let  your  handmaid  speak  in  your  ears.  Hear  the  words  of  your  handmaid.	
	  Please  don't  let  my  lord  regard  this  worthless  fellow,  even  Nabal;  for  as  his  name  is,  so  is  he.  Nabal  is  his  name,  and  folly  is  with  him;  but  I,  your  handmaid,  didn't  see  the  young  men  of  my  lord,  whom  you  sent.	
	  Now  therefore,  my  lord,  as  Yahweh  lives,  and  as  your  soul  lives,  since  Yahweh  has  withheld  you  from  blood  guiltiness,  and  from  avenging  yourself  with  your  own  hand,  now  therefore  let  your  enemies,  and  those  who  seek  evil  to  my  lord,  be  as  Nabal.	
	  Now  this  present  which  your  servant  has  brought  to  my  lord,  let  it  be  given  to  the  young  men  who  follow  my  lord.	
	  Please  forgive  the  trespass  of  your  handmaid.  For  Yahweh  will  certainly  make  my  lord  a  sure  house,  because  my  lord  fights  the  battles  of  Yahweh;  and  evil  shall  not  be  found  in  you  all  your  days.	
	  Though  men  may  rise  up  to  pursue  you,  and  to  seek  your  soul,  yet  the  soul  of  my  lord  shall  be  bound  in  the  bundle  of  life  with  Yahweh  your  God.  He  will  sling  out  the  souls  of  your  enemies,  as  from  the  hollow  of  a  sling.	
	 Now  the  name  of  the  man  was  Nabal;  and  the  name  of  his  wife  Abigail;  and  the  woman  was  of  good  understanding,  and  of  a  beautiful  face	
	  It  shall  come  to  pass,  when  Yahweh  has  done  to  my  lord  according  to  all  the  good  that  he  has  spoken  concerning  you,  and  shall  have  appointed  you  prince  over  Israel,	
	  that  this  shall  be  no  grief  to  you,  nor  offense  of  heart  to  my  lord,  either  that  you  have  shed  blood  without  cause,  or  that  my  lord  has  avenged  himself.  When  Yahweh  has  dealt  well  with  my  lord,  then  remember  your  handmaid."	
	  David  said  to  Abigail,  "Blessed  is  Yahweh,  the  God  of  Israel,  who  sent  you  this  day  to  meet  me!	
	  Blessed  is  your  discretion,  and  blessed  are  you,  that  have  kept  me  this  day  from  blood  guiltiness,  and  from  avenging  myself  with  my  own  hand.	
	  For  indeed,  as  Yahweh,  the  God  of  Israel,  lives,  who  has  withheld  me  from  hurting  you,  unless  you  had  hurried  and  come  to  meet  me,  surely  there  wouldn't  have  been  left  to  Nabal  by  the  morning  light  so  much  as  one  who  urinates  on  a  wall.  {or,  male.}"	
	  So  David  received  of  her  hand  that  which  she  had  brought  him	
	  Abigail  came  to  Nabal;  and  behold,  he  held  a  feast  in  his  house,  like  the  feast  of  a  king.  Nabal's  heart  was  merry  within  him,  for  he  was  very  drunken.  Therefore  she  told  him  nothing,  less  or  more,  until  the  morning  light.	
	  It  happened  in  the  morning,  when  the  wine  was  gone  out  of  Nabal,  that  his  wife  told  him  these  things,  and  his  heart  died  within  him,  and  he  became  as  a  stone.	
	  It  happened  about  ten  days  after,  that  Yahweh  struck  Nabal,  so  that  he  died.	
	  When  David  heard  that  Nabal  was  dead,  he  said,  "Blessed  is  Yahweh,  who  has  pleaded  the  cause  of  my  reproach  from  the  hand  of  Nabal,  and  has  kept  back  his  servant  from  evil.  Yahweh  has  returned  the  evildoing  of  Nabal  on  his  own  head."  David  sent  and  spoke  concerning  Abigail,  to  take  her  to  him  as  wife.	
	 David  heard  in  the  wilderness  that  Nabal  was  shearing  his  sheep.	
	  When  the  servants  of  David  had  come  to  Abigail  to  Carmel,  they  spoke  to  her,  saying,  "David  has  sent  us  to  you,  to  take  you  to  him  as  wife."	
	  She  arose,  and  bowed  herself  with  her  face  to  the  earth,  and  said,  "Behold,  your  handmaid  is  a  servant  to  wash  the  feet  of  the  servants  of  my  lord."	
	  Abigail  hurried,  and  arose,  and  rode  on  a  donkey,  with  five  ladies  of  hers  who  followed  her;  and  she  went  after  the  messengers  of  David,  and  became  his  wife.	
	  David  also  took  Ahinoam  of  Jezreel;  and  they  both  became  his  wives.	
	  Now  Saul  had  given  Michal  his  daughter,  David's  wife,  to  Palti  the  son  of  Laish,  who  was  of  Gallim.	
	 David  sent  ten  young  men,  and  David  said  to  the  young  men,  "Go  up  to  Carmel,  and  go  to  Nabal,  and  greet  him  in  my  name.	
	 You  shall  tell  him,  'Long  life  to  you!  Peace  be  to  you,  and  peace  be  to  your  house,  and  peace  be  to  all  that  you  have.	
	 Now  I  have  heard  that  you  have  shearers.  Your  shepherds  have  now  been  with  us,  and  we  didn't  hurt  them,  neither  was  there  anything  missing  from  them,  all  the  while  they  were  in  Carmel.	
	 Ask  your  young  men,  and  they  will  tell  you.  Therefore,  let  the  young  men  find  favor  in  your  eyes;  for  we  come  in  a  good  day.  Please  give  whatever  comes  to  your  hand,  to  your  servants,  and  to  your  son  David.'"	
	 When  David's  young  men  came,  they  spoke  to  Nabal  according  to  all  those  words  in  the  name  of  David,  and  ceased.	
	 The  Ziphites  came  to  Saul  to  Gibeah,  saying,  "Doesn't  David  hide  himself  in  the  hill  of  Hachilah,  which  is  before  the  desert?"	
	  David  said,  "As  Yahweh  lives,  Yahweh  will  strike  him;  or  his  day  shall  come  to  die;  or  he  shall  go  down  into  battle  and  perish.	
	  Yahweh  forbid  that  I  should  put  forth  my  hand  against  Yahweh's  anointed;  but  now  please  take  the  spear  that  is  at  his  head,  and  the  jar  of  water,  and  let  us  go."	
	  So  David  took  the  spear  and  the  jar  of  water  from  Saul's  head;  and  they  went  away	
	  Then  David  went  over  to  the  other  side,  and  stood  on  the  top  of  the  mountain  afar  off;  a  great  space  being  between  them;	
	  and  David  cried  to  the  people,  and  to  Abner  the  son  of  Ner,  saying,  "Don't  you  answer,  Abner?"  Then  Abner  answered,  "Who  are  you  who  cries  to  the  king?"	
	  David  said  to  Abner,  "Aren't  you  a  man?  Who  is  like  you  in  Israel?  Why  then  have  you  not  kept  watch  over  your  lord,  the  king?  For  one  of  the  people  came  in  to  destroy  the  king  your  lord.	
	  This  thing  isn't  good  that  you  have  done.  As  Yahweh  lives,  you  are  worthy  to  die,  because  you  have  not  kept  watch  over  your  lord,  Yahweh's  anointed.  Now  see  where  the  king's  spear  is,  and  the  jar  of  water  that  was  at  his  head."	
	  Saul  knew  David's  voice,  and  said,  "Is  this  your  voice,  my  son  David?"  David  said,  "It  is  my  voice,  my  lord,  O  king."	
	  He  said,  "Why  does  my  lord  pursue  after  his  servant?  For  what  have  I  done?  Or  what  evil  is  in  my  hand?	
	  Now  therefore,  please  let  my  lord  the  king  hear  the  words  of  his  servant.  If  it  is  so  that  Yahweh  has  stirred  you  up  against  me,  let  him  accept  an  offering.  But  if  it  is  the  children  of  men,  they  are  cursed  before  Yahweh;  for  they  have  driven  me  out  this  day  that  I  shouldn't  cling  to  Yahweh's  inheritance,  saying,  'Go,  serve  other  gods!'	
	 Then  Saul  arose,  and  went  down  to  the  wilderness  of  Ziph,  having  three  thousand  chosen  men  of  Israel  with  him,  to  seek  David  in  the  wilderness  of  Ziph.	
	  Now  therefore,  don't  let  my  blood  fall  to  the  earth  away  from  the  presence  of  Yahweh;  for  the  king  of  Israel  has  come  out  to  seek  a  flea,  as  when  one  hunts  a  partridge  in  the  mountains."	
	  Then  Saul  said,  "I  have  sinned.  Return,  my  son  David;  for  I  will  no  more  do  you  harm,  because  my  life  was  precious  in  your  eyes  this  day.  Behold,  I  have  played  the  fool,  and  have  erred  exceedingly."	
	  David  answered,  "Behold  the  spear,  O  king!  Then  let  one  of  the  young  men  come  over  and  get  it.	
	  Yahweh  will  render  to  every  man  his  righteousness  and  his  faithfulness;  because  Yahweh  delivered  you  into  my  hand  today,  and  I  wouldn't  put  forth  my  hand  against  Yahweh's  anointed.	
	  Behold,  as  your  life  was  respected  this  day  in  my  eyes,  so  let  my  life  be  respected  in  the  eyes  of  Yahweh,  and  let  him  deliver  me  out  of  all  oppression."	
	  Then  Saul  said  to  David,  "You  are  blessed,  my  son  David.  You  shall  both  do  mightily,  and  shall  surely  prevail."  So  David  went  his  way,  and  Saul  returned  to  his  place.	
	 Saul  encamped  in  the  hill  of  Hachilah,  which  is  before  the  desert,  by  the  way.  But  David  stayed  in  the  wilderness,  and  he  saw  that  Saul  came  after  him  into  the  wilderness.	
	 David  therefore  sent  out  spies,  and  understood  that  Saul  had  certainly  come.	
	 David  arose,  and  came  to  the  place  where  Saul  had  encamped;  and  David  saw  the  place  where  Saul  lay,  and  Abner  the  son  of  Ner,  the  captain  of  his  army	
	 Then  answered  David  and  said  to  Ahimelech  the  Hittite,  and  to  Abishai  the  son  of  Zeruiah,  brother  to  Joab,  saying,  "Who  will  go  down  with  me  to  Saul  to  the  camp?"  Abishai  said,  "I  will  go  down  with  you."	
	 So  David  and  Abishai  came  to  the  people  by  night	
	 Then  Abishai  said  to  David,  "God  has  delivered  up  your  enemy  into  your  hand  this  day.  Now  therefore  please  let  me  strike  him  with  the  spear  to  the  earth  at  one  stroke,  and  I  will  not  strike  him  the  second  time."	
	 David  said  to  Abishai,  "Don't  destroy  him;  for  who  can  put  forth  his  hand  against  Yahweh's  anointed,  and  be  guiltless?"	
	 David  said  in  his  heart,  "I  shall  now  perish  one  day  by  the  hand  of  Saul.  There  is  nothing  better  for  me  than  that  I  should  escape  into  the  land  of  the  Philistines;  and  Saul  will  despair  of  me,  to  seek  me  any  more  in  all  the  borders  of  Israel.  So  shall  I  escape  out  of  his  hand."	
	  Achish  said,  "Against  whom  have  you  made  a  raid  today?"  David  said,  "Against  the  South  of  Judah,  against  the  South  of  the  Jerahmeelites,  and  against  the  South  of  the  Kenites."	
	  David  saved  neither  man  nor  woman  alive,  to  bring  them  to  Gath,  saying,  "Lest  they  should  tell  of  us,  saying,  'David  this,  and  this  has  been  his  way  all  the  time  he  has  lived  in  the  country  of  the  Philistines.'"	
	  Achish  believed  David,  saying,  "He  has  made  his  people  Israel  utterly  to  abhor  him.  Therefore  he  shall  be  my  servant  forever."	
	 David  arose,  and  passed  over,  he  and  the  six  hundred  men  who  were  with  him,  to  Achish  the  son  of  Maoch,  king  of  Gath.	
	 David  lived  with  Achish  at  Gath,  he  and  his  men,  every  man  with  his  household,  even  David  with  his  two  wives,  Ahinoam  the  Jezreelitess,  and  Abigail  the  Carmelitess,  Nabal's  wife.	
	 It  was  told  Saul  that  David  was  fled  to  Gath	
	 David  said  to  Achish,  "If  now  I  have  found  favor  in  your  eyes,  let  them  give  me  a  place  in  one  of  the  cities  in  the  country,  that  I  may  dwell  there.  For  why  should  your  servant  dwell  in  the  royal  city  with  you?"	
	 Then  Achish  gave  him  Ziklag  that  day	
	 The  number  of  the  days  that  David  lived  in  the  country  of  the  Philistines  was  a  full  year  and  four  months.	
	 David  and  his  men  went  up,  and  made  a  raid  on  the  Geshurites,  and  the  Girzites,  and  the  Amalekites;  for  those  were  the  inhabitants  of  the  land,  who  were  of  old,  as  you  go  to  Shur,  even  to  the  land  of  Egypt.	
	 David  struck  the  land,  and  saved  neither  man  nor  woman  alive,  and  took  away  the  sheep,  and  the  cattle,  and  the  donkeys,  and  the  camels,  and  the  clothing;  and  he  returned,  and  came  to  Achish.	
	 It  happened  in  those  days,  that  the  Philistines  gathered  their  armies  together  for  warfare,  to  fight  with  Israel.  Achish  said  to  David,  "Know  assuredly  that  you  shall  go  out  with  me  in  the  army,  you  and  your  men."	
	  Saul  swore  to  her  by  Yahweh,  saying,  "As  Yahweh  lives,  no  punishment  shall  happen  to  you  for  this  thing."	
	  Then  the  woman  said,  "Whom  shall  I  bring  up  to  you?"  He  said,  "Bring  Samuel  up  for  me."	
	  When  the  woman  saw  Samuel,  she  cried  with  a  loud  voice;  and  the  woman  spoke  to  Saul,  saying,  "Why  have  you  deceived  me?  For  you  are  Saul!"	
	  The  king  said  to  her,  "Don't  be  afraid.  For  what  do  you  see?"  The  woman  said  to  Saul,  "I  see  a  god  coming  up  out  of  the  earth."	
	  He  said  to  her,  "What  does  he  look  like?"  She  said,  "An  old  man  comes  up.  He  is  covered  with  a  robe."  Saul  perceived  that  it  was  Samuel,  and  he  bowed  with  his  face  to  the  ground,  and  showed  respect.	
	  Samuel  said  to  Saul,  "Why  have  you  disturbed  me,  to  bring  me  up?"  Saul  answered,  "I  am  very  distressed;  for  the  Philistines  make  war  against  me,  and  God  has  departed  from  me,  and  answers  me  no  more,  neither  by  prophets,  nor  by  dreams.  Therefore  I  have  called  you,  that  you  may  make  known  to  me  what  I  shall  do."	
	  Samuel  said,  "Why  then  do  you  ask  of  me,  since  Yahweh  has  departed  from  you  and  has  become  your  adversary?	
	  Yahweh  has  done  to  you  as  he  spoke  by  me.  Yahweh  has  torn  the  kingdom  out  of  your  hand,  and  given  it  to  your  neighbor,  even  to  David.	
	  Because  you  didn't  obey  the  voice  of  Yahweh,  and  didn't  execute  his  fierce  wrath  on  Amalek,  therefore  Yahweh  has  done  this  thing  to  you  this  day.	
	  Moreover  Yahweh  will  deliver  Israel  also  with  you  into  the  hand  of  the  Philistines;  and  tomorrow  you  and  your  sons  will  be  with  me.  Yahweh  will  deliver  the  army  of  Israel  also  into  the  hand  of  the  Philistines."	
	 David  said  to  Achish,  "Therefore  you  shall  know  what  your  servant  will  do."  Achish  said  to  David,  "Therefore  will  I  make  you  my  bodyguard  for  ever."	
	  Then  Saul  fell  immediately  his  full  length  on  the  earth,  and  was  terrified,  because  of  the  words  of  Samuel.  There  was  no  strength  in  him;  for  he  had  eaten  no  bread  all  the  day,  nor  all  the  night.	
	  The  woman  came  to  Saul,  and  saw  that  he  was  very  troubled,  and  said  to  him,  "Behold,  your  handmaid  has  listened  to  your  voice,  and  I  have  put  my  life  in  my  hand,  and  have  listened  to  your  words  which  you  spoke  to  me.	
	  Now  therefore,  please  listen  also  to  the  voice  of  your  handmaid,  and  let  me  set  a  morsel  of  bread  before  you;  and  eat,  that  you  may  have  strength,  when  you  go  on  your  way."	
	  But  he  refused,  and  said,  I  will  not  eat.  But  his  servants,  together  with  the  woman,  constrained  him;  and  he  listened  to  their  voice.  So  he  arose  from  the  earth,  and  sat  on  the  bed.	
	  The  woman  had  a  fattened  calf  in  the  house.  She  hurried  and  killed  it;  and  she  took  flour,  and  kneaded  it,  and  baked  unleavened  bread  of  it.	
	  She  brought  it  before  Saul,  and  before  his  servants;  and  they  ate.  Then  they  rose  up,  and  went  away  that  night.	
	 Now  Samuel  was  dead,  and  all  Israel  had  lamented  him,  and  buried  him  in  Ramah,  even  in  his  own  city.  Saul  had  put  away  those  who  had  familiar  spirits,  and  the  wizards,  out  of  the  land.	
	 The  Philistines  gathered  themselves  together,  and  came  and  encamped  in  Shunem	
	 When  Saul  saw  the  army  of  the  Philistines,  he  was  afraid,  and  his  heart  trembled  greatly.	
	 When  Saul  inquired  of  Yahweh,  Yahweh  didn't  answer  him,  neither  by  dreams,  nor  by  Urim,  nor  by  prophets.	
	 Then  Saul  said  to  his  servants,  "Seek  me  a  woman  who  has  a  familiar  spirit,  that  I  may  go  to  her,  and  inquire  of  her."  His  servants  said  to  him,  "Behold,  there  is  a  woman  who  has  a  familiar  spirit  at  Endor."	
	 Saul  disguised  himself,  and  put  on  other  clothing,  and  went,  he  and  two  men  with  him,  and  they  came  to  the  woman  by  night	
	 The  woman  said  to  him,  "Behold,  you  know  what  Saul  has  done,  how  he  has  cut  off  those  who  have  familiar  spirits,  and  the  wizards,  out  of  the  land.  Why  then  do  you  lay  a  snare  for  my  life,  to  cause  me  to  die?"	
	 Now  the  Philistines  gathered  together  all  their  armies  to  Aphek	
	  Therefore  now  rise  up  early  in  the  morning  with  the  servants  of  your  lord  who  have  come  with  you;  and  as  soon  as  you  are  up  early  in  the  morning,  and  have  light,  depart."	
	  So  David  rose  up  early,  he  and  his  men,  to  depart  in  the  morning,  to  return  into  the  land  of  the  Philistines.  The  Philistines  went  up  to  Jezreel.	
	 The  lords  of  the  Philistines  passed  on  by  hundreds,  and  by  thousands;  and  David  and  his  men  passed  on  in  the  rear  with  Achish.	
	 Then  the  princes  of  the  Philistines  said,  "What  about  these  Hebrews?"  Achish  said  to  the  princes  of  the  Philistines,  "Isn't  this  David,  the  servant  of  Saul  the  king  of  Israel,  who  has  been  with  me  these  days,  or  rather  these  years,  and  I  have  found  no  fault  in  him  since  he  fell  away  to  this  day?"	
	 But  the  princes  of  the  Philistines  were  angry  with  him;  and  the  princes  of  the  Philistines  said  to  him,  "Make  the  man  return,  that  he  may  go  back  to  his  place  where  you  have  appointed  him,  and  let  him  not  go  down  with  us  to  battle,  lest  in  the  battle  he  become  an  adversary  to  us.  For  with  what  should  this  fellow  reconcile  himself  to  his  lord?  Should  it  not  be  with  the  heads  of  these  men?	
	 Is  not  this  David,  of  whom  they  sang  one  to  another  in  dances,  saying,  'Saul  has  slain  his  thousands,  David  his  ten  thousands?'"	
	 Then  Achish  called  David,  and  said  to  him,  "As  Yahweh  lives,  you  have  been  upright,  and  your  going  out  and  your  coming  in  with  me  in  the  army  is  good  in  my  sight;  for  I  have  not  found  evil  in  you  since  the  day  of  your  coming  to  me  to  this  day.  Nevertheless,  the  lords  don't  favor  you.	
	 Therefore  now  return,  and  go  in  peace,  that  you  not  displease  the  lords  of  the  Philistines."	
	 David  said  to  Achish,  "But  what  have  I  done?  What  have  you  found  in  your  servant  so  long  as  I  have  been  before  you  to  this  day,  that  I  may  not  go  and  fight  against  the  enemies  of  my  lord  the  king?"	
	 Achish  answered  David,  "I  know  that  you  are  good  in  my  sight,  as  an  angel  of  God.  Notwithstanding  the  princes  of  the  Philistines  have  said,  'He  shall  not  go  up  with  us  to  the  battle.'	
	The  child  Samuel  ministered  to  Yahweh  before  Eli.  The  word  of  Yahweh  was  precious  in  those  days;  there  was  no  frequent  vision.	
	 Yahweh  came,  and  stood,  and  called  as  at  other  times,  "Samuel!  Samuel!"  Then  Samuel  said,  "Speak;  for  your  servant  hears."	
	 Yahweh  said  to  Samuel,  "Behold,  I  will  do  a  thing  in  Israel,  at  which  both  the  ears  of  everyone  who  hears  it  shall  tingle.	
	 In  that  day  I  will  perform  against  Eli  all  that  I  have  spoken  concerning  his  house,  from  the  beginning  even  to  the  end.	
	 For  I  have  told  him  that  I  will  judge  his  house  forever,  for  the  iniquity  which  he  knew,  because  his  sons  brought  a  curse  on  themselves,  and  he  didn't  restrain  them.	
	 Therefore  I  have  sworn  to  the  house  of  Eli,  that  the  iniquity  of  Eli's  house  shall  not  be  removed  with  sacrifice  nor  offering  forever."	
	 Samuel  lay  until  the  morning,  and  opened  the  doors  of  the  house  of  Yahweh.  Samuel  feared  to  show  Eli  the  vision.	
	 Then  Eli  called  Samuel,  and  said,  "Samuel,  my  son!"  He  said,  "Here  I  am."	
	 He  said,  "What  is  the  thing  that  he  has  spoken  to  you?  Please  don't  hide  it  from  me.  God  do  so  to  you,  and  more  also,  if  you  hide  anything  from  me  of  all  the  things  that  he  spoke  to  you."	
	 Samuel  told  him  every  bit,  and  hid  nothing  from  him.  He  said,  "It  is  Yahweh.  Let  him  do  what  seems  good  to  him."	
	 Samuel  grew,  and  Yahweh  was  with  him,  and  let  none  of  his  words  fall  to  the  ground.	
	It  happened  at  that  time,  when  Eli  was  laid  down  in  his  place  (now  his  eyes  had  begun  to  grow  dim,  so  that  he  could  not  see),	
	 All  Israel  from  Dan  even  to  Beersheba  knew  that  Samuel  was  established  to  be  a  prophet  of  Yahweh.	
	 Yahweh  appeared  again  in  Shiloh;  for  Yahweh  revealed  himself  to  Samuel  in  Shiloh  by  the  word  of  Yahweh.	
	and  the  lamp  of  God  hadn't  yet  gone  out,  and  Samuel  had  laid  down  in  the  temple  of  Yahweh,  where  the  ark  of  God  was;	
	that  Yahweh  called  Samuel;  and  he  said,  "Here  I  am."	
	He  ran  to  Eli,  and  said,  "Here  I  am;  for  you  called  me."  He  said,  "I  didn't  call;  lie  down  again."  He  went  and  lay  down.	
	Yahweh  called  yet  again,  "Samuel!"  Samuel  arose  and  went  to  Eli,  and  said,  "Here  I  am;  for  you  called  me."  He  answered,  "I  didn't  call,  my  son;  lie  down  again."	
	Now  Samuel  didn't  yet  know  Yahweh,  neither  was  the  word  of  Yahweh  yet  revealed  to  him.	
	Yahweh  called  Samuel  again  the  third  time.  He  arose  and  went  to  Eli,  and  said,  "Here  I  am;  for  you  called  me."  Eli  perceived  that  Yahweh  had  called  the  child.	
	Therefore  Eli  said  to  Samuel,  "Go,  lie  down	
	 It  happened,  when  David  and  his  men  had  come  to  Ziklag  on  the  third  day,  that  the  Amalekites  had  made  a  raid  on  the  South,  and  on  Ziklag,  and  had  struck  Ziklag,  and  burned  it  with  fire,	
	  But  David  pursued,  he  and  four  hundred  men;  for  two  hundred  stayed  behind,  who  were  so  faint  that  they  couldn't  go  over  the  brook  Besor.	
	  They  found  an  Egyptian  in  the  field,  and  brought  him  to  David,  and  gave  him  bread,  and  he  ate;  and  they  gave  him  water  to  drink.	
	  They  gave  him  a  piece  of  a  cake  of  figs,  and  two  clusters  of  raisins.  when  he  had  eaten,  his  spirit  came  again  to  him;  for  he  had  eaten  no  bread,  nor  drunk  any  water,  three  days  and  three  nights.	
	  David  asked  him,  "To  whom  do  you  belong?  Where  are  you  from?"  He  said,  "I  am  a  young  man  of  Egypt,  servant  to  an  Amalekite;  and  my  master  left  me,  because  three  days  ago  I  fell  sick.	
	  We  made  a  raid  on  the  South  of  the  Cherethites,  and  on  that  which  belongs  to  Judah,  and  on  the  South  of  Caleb;  and  we  burned  Ziklag  with  fire."	
	  David  said  to  him,  "Will  you  bring  me  down  to  this  troop?"  He  said,  "Swear  to  me  by  God  that  you  will  neither  kill  me,  nor  deliver  me  up  into  the  hands  of  my  master,  and  I  will  bring  you  down  to  this  troop."	
	  When  he  had  brought  him  down,  behold,  they  were  spread  around  over  all  the  ground,  eating,  drinking,  and  dancing,  because  of  all  the  great  spoil  that  they  had  taken  out  of  the  land  of  the  Philistines,  and  out  of  the  land  of  Judah.	
	  David  struck  them  from  the  twilight  even  to  the  evening  of  the  next  day.  Not  a  man  of  them  escaped  from  there,  except  four  hundred  young  men,  who  rode  on  camels  and  fled.	
	  David  recovered  all  that  the  Amalekites  had  taken;  and  David  rescued  his  two  wives.	
	  There  was  nothing  lacking  to  them,  neither  small  nor  great,  neither  sons  nor  daughters,  neither  spoil,  nor  anything  that  they  had  taken  to  them.  David  brought  back  all.	
	 and  had  taken  captive  the  women  and  all  who  were  therein,  both  small  and  great.  They  didn't  kill  any,  but  carried  them  off,  and  went  their  way.	
	  David  took  all  the  flocks  and  the  herds,  which  they  drove  before  those  other  livestock,  and  said,  "This  is  David's  spoil."	
	  David  came  to  the  two  hundred  men,  who  were  so  faint  that  they  could  not  follow  David,  whom  also  they  had  made  to  stay  at  the  brook  Besor;  and  they  went  forth  to  meet  David,  and  to  meet  the  people  who  were  with  him.  When  David  came  near  to  the  people,  he  greeted  them.	
	  Then  all  the  wicked  men  and  base  fellows,  of  those  who  went  with  David,  answered  and  said,  "Because  they  didn't  go  with  us,  we  will  not  give  them  anything  of  the  spoil  that  we  have  recovered,  except  to  every  man  his  wife  and  his  children,  that  he  may  lead  them  away,  and  depart."	
	  Then  David  said,  "You  shall  not  do  so,  my  brothers,  with  that  which  Yahweh  has  given  to  us,  who  has  preserved  us,  and  delivered  the  troop  that  came  against  us  into  our  hand.	
	  Who  will  listen  to  you  in  this  matter?  For  as  his  share  is  who  goes  down  to  the  battle,  so  shall  his  share  be  who  tarries  by  the  baggage	
	  It  was  so  from  that  day  forward,  that  he  made  it  a  statute  and  an  ordinance  for  Israel  to  this  day.	
	  When  David  came  to  Ziklag,  he  sent  of  the  spoil  to  the  elders  of  Judah,  even  to  his  friends,  saying,  "Behold,  a  present  for  you  of  the  spoil  of  the  enemies  of  Yahweh."	
	  He  sent  it  to  those  who  were  in  Bethel,  and  to  those  who  were  in  Ramoth  of  the  South,  and  to  those  who  were  in  Jattir,	
	  and  to  those  who  were  in  Aroer,  and  to  those  who  were  in  Siphmoth,  and  to  those  who  were  in  Eshtemoa,	
	  and  to  those  who  were  in  Racal,  and  to  those  who  were  in  the  cities  of  the  Jerahmeelites,  and  to  those  who  were  in  the  cities  of  the  Kenites,	
	 When  David  and  his  men  came  to  the  city,  behold,  it  was  burned  with  fire;  and  their  wives,  and  their  sons,  and  their  daughters,  were  taken  captive.	
	  and  to  those  who  were  in  Hormah,  and  to  those  who  were  in  Borashan,  and  to  those  who  were  in  Athach,	
	  and  to  those  who  were  in  Hebron,  and  to  all  the  places  where  David  himself  and  his  men  used  to  stay.	
	 Then  David  and  the  people  who  were  with  him  lifted  up  their  voice  and  wept,  until  they  had  no  more  power  to  weep.	
	 David's  two  wives  were  taken  captive,  Ahinoam  the  Jezreelitess,  and  Abigail  the  wife  of  Nabal  the  Carmelite.	
	 David  was  greatly  distressed;  for  the  people  spoke  of  stoning  him,  because  the  soul  of  all  the  people  was  grieved,  every  man  for  his  sons  and  for  his  daughters	
	 David  said  to  Abiathar  the  priest,  the  son  of  Ahimelech,  "Please  bring  me  here  the  ephod."  Abiathar  brought  the  ephod  to  David.	
	 David  inquired  of  Yahweh,  saying,  "If  I  pursue  after  this  troop,  shall  I  overtake  them?"  He  answered  him,  "Pursue;  for  you  shall  surely  overtake  them,  and  shall  without  fail  recover  all."	
	 So  David  went,  he  and  the  six  hundred  men  who  were  with  him,  and  came  to  the  brook  Besor,  where  those  who  were  left  behind  stayed.	
	 Now  the  Philistines  fought  against  Israel	
	  They  put  his  armor  in  the  house  of  the  Ashtaroth;  and  they  fastened  his  body  to  the  wall  of  Beth  Shan.	
	  When  the  inhabitants  of  Jabesh  Gilead  heard  concerning  him  that  which  the  Philistines  had  done  to  Saul,	
	  all  the  valiant  men  arose,  and  went  all  night,  and  took  the  body  of  Saul  and  the  bodies  of  his  sons  from  the  wall  of  Beth  Shan;  and  they  came  to  Jabesh,  and  burnt  them  there.	
	  They  took  their  bones,  and  buried  them  under  the  tamarisk  tree  in  Jabesh,  and  fasted  seven  days.	
	 The  Philistines  followed  hard  on  Saul  and  on  his  sons;  and  the  Philistines  killed  Jonathan,  and  Abinadab,  and  Malchishua,  the  sons  of  Saul.	
	 The  battle  went  hard  against  Saul,  and  the  archers  overtook  him;  and  he  was  greatly  distressed  by  reason  of  the  archers.	
	 Then  Saul  said  to  his  armor  bearer,  "Draw  your  sword,  and  thrust  me  through  with  it,  lest  these  uncircumcised  come  and  thrust  me  through,  and  abuse  me!"  But  his  armor  bearer  would  not;  for  he  was  terrified.  Therefore  Saul  took  his  sword,  and  fell  on  it.	
	 When  his  armor  bearer  saw  that  Saul  was  dead,  he  likewise  fell  on  his  sword,  and  died  with  him.	
	 So  Saul  died,  and  his  three  sons,  and  his  armor  bearer,  and  all  his  men,  that  same  day  together.	
	 When  the  men  of  Israel  who  were  on  the  other  side  of  the  valley,  and  those  who  were  beyond  the  Jordan,  saw  that  the  men  of  Israel  fled,  and  that  Saul  and  his  sons  were  dead,  they  forsook  the  cities,  and  fled;  and  the  Philistines  came  and  lived  in  them.	
	 It  happened  on  the  next  day,  when  the  Philistines  came  to  strip  the  slain,  that  they  found  Saul  and  his  three  sons  fallen  on  Mount  Gilboa.	
	 They  cut  off  his  head,  and  stripped  off  his  armor,  and  sent  into  the  land  of  the  Philistines  all  around,  to  carry  the  news  to  the  house  of  their  idols,  and  to  the  people.	
	The  word  of  Samuel  came  to  all  Israel.  Now  Israel  went  out  against  the  Philistines  to  battle,  and  encamped  beside  Ebenezer	
	 The  Philistines  fought,  and  Israel  was  struck,  and  they  fled  every  man  to  his  tent	
	 The  ark  of  God  was  taken;  and  the  two  sons  of  Eli,  Hophni  and  Phinehas,  were  slain.	
	 There  ran  a  man  of  Benjamin  out  of  the  army,  and  came  to  Shiloh  the  same  day,  with  his  clothes  torn,  and  with  earth  on  his  head.	
	 When  he  came,  behold,  Eli  was  sitting  on  his  seat  by  the  road  watching;  for  his  heart  trembled  for  the  ark  of  God.  When  the  man  came  into  the  city,  and  told  it,  all  the  city  cried  out.	
	 When  Eli  heard  the  noise  of  the  crying,  he  said,  "What  does  the  noise  of  this  tumult  mean?"  The  man  hurried,  and  came  and  told  Eli.	
	 Now  Eli  was  ninety-eight  years  old;  and  his  eyes  were  set,  so  that  he  could  not  see.	
	 The  man  said  to  Eli,  "I  am  he  who  came  out  of  the  army,  and  I  fled  today  out  of  the  army."  He  said,  "How  did  the  matter  go,  my  son?"	
	 He  who  brought  the  news  answered,  "Israel  has  fled  before  the  Philistines,  and  there  has  been  also  a  great  slaughter  among  the  people.  Your  two  sons  also,  Hophni  and  Phinehas,  are  dead,  and  the  ark  of  God  has  been  captured."	
	 It  happened,  when  he  made  mention  of  the  ark  of  God,  that  Eli  fell  from  off  his  seat  backward  by  the  side  of  the  gate;  and  his  neck  broke,  and  he  died;  for  he  was  an  old  man,  and  heavy.  He  had  judged  Israel  forty  years.	
	 His  daughter-in-law,  Phinehas'  wife,  was  with  child,  near  to  be  delivered.  When  she  heard  the  news  that  the  ark  of  God  was  taken,  and  that  her  father-in-law  and  her  husband  were  dead,  she  bowed  herself  and  gave  birth;  for  her  pains  came  on  her.	
	The  Philistines  put  themselves  in  array  against  Israel	
	 About  the  time  of  her  death  the  women  who  stood  by  her  said  to  her,  "Don't  be  afraid;  for  you  have  given  birth  to  a  son."  But  she  didn't  answer,  neither  did  she  regard  it.	
	 She  named  the  child  Ichabod,  {"Ichabod"  means  "no  glory."}  saying,  "The  glory  has  departed  from  Israel;"  because  the  ark  of  God  was  taken,  and  because  of  her  father-in-law  and  her  husband.	
	 She  said,  "The  glory  has  departed  from  Israel;  for  the  ark  of  God  is  taken."	
	When  the  people  had  come  into  the  camp,  the  elders  of  Israel  said,  "Why  has  Yahweh  struck  us  today  before  the  Philistines?  Let  us  get  the  ark  of  the  covenant  of  Yahweh  out  of  Shiloh  to  us,  that  it  may  come  among  us,  and  save  us  out  of  the  hand  of  our  enemies."	
	So  the  people  sent  to  Shiloh;  and  they  brought  from  there  the  ark  of  the  covenant  of  Yahweh  of  Armies,  who  sits  above  the  cherubim	
	When  the  ark  of  the  covenant  of  Yahweh  came  into  the  camp,  all  Israel  shouted  with  a  great  shout,  so  that  the  earth  rang  again.	
	When  the  Philistines  heard  the  noise  of  the  shout,  they  said,  "What  does  the  noise  of  this  great  shout  in  the  camp  of  the  Hebrews  mean?"  They  understood  that  the  ark  of  Yahweh  had  come  into  the  camp.	
	The  Philistines  were  afraid,  for  they  said,  "God  has  come  into  the  camp."  They  said,  "Woe  to  us!  For  there  has  not  been  such  a  thing  before.	
	Woe  to  us!  Who  shall  deliver  us  out  of  the  hand  of  these  mighty  gods?  These  are  the  gods  that  struck  the  Egyptians  with  all  kinds  of  plagues  in  the  wilderness.	
	Be  strong,  and  behave  like  men,  O  you  Philistines,  that  you  not  be  servants  to  the  Hebrews,  as  they  have  been  to  you.  Strengthen  yourselves  like  men,  and  fight!"	
	Now  the  Philistines  had  taken  the  ark  of  God,  and  they  brought  it  from  Ebenezer  to  Ashdod.	
	 So  they  sent  the  ark  of  God  to  Ekron.  It  happened,  as  the  ark  of  God  came  to  Ekron,  that  the  Ekronites  cried  out,  saying,  "They  have  brought  about  the  ark  of  the  God  of  Israel  to  us,  to  kill  us  and  our  people."	
	 They  sent  therefore  and  gathered  together  all  the  lords  of  the  Philistines,  and  they  said,  "Send  away  the  ark  of  the  God  of  Israel,  and  let  it  go  again  to  its  own  place,  that  it  not  kill  us  and  our  people."  For  there  was  a  deadly  confusion  throughout  all  the  city;  the  hand  of  God  was  very  heavy  there.	
	 The  men  who  didn't  die  were  struck  with  the  tumors;  and  the  cry  of  the  city  went  up  to  heaven.	
	The  Philistines  took  the  ark  of  God,  and  brought  it  into  the  house  of  Dagon,  and  set  it  by  Dagon.	
	When  they  of  Ashdod  arose  early  on  the  next  day,  behold,  Dagon  was  fallen  on  his  face  to  the  ground  before  the  ark  of  Yahweh.  They  took  Dagon,  and  set  him  in  his  place  again.	
	When  they  arose  early  on  the  next  day  morning,  behold,  Dagon  was  fallen  on  his  face  to  the  ground  before  the  ark  of  Yahweh;  and  the  head  of  Dagon  and  both  the  palms  of  his  hands  were  cut  off  on  the  threshold.  Only  Dagon's  torso  was  intact.	
	Therefore  neither  the  priests  of  Dagon,  nor  any  who  come  into  Dagon's  house,  tread  on  the  threshold  of  Dagon  in  Ashdod,  to  this  day.	
	But  the  hand  of  Yahweh  was  heavy  on  them  of  Ashdod,  and  he  destroyed  them,  and  struck  them  with  tumors,  even  Ashdod  and  its  borders.	
	When  the  men  of  Ashdod  saw  that  it  was  so,  they  said,  "The  ark  of  the  God  of  Israel  shall  not  stay  with  us;  for  his  hand  is  severe  on  us,  and  on  Dagon  our  god."	
	They  sent  therefore  and  gathered  all  the  lords  of  the  Philistines  to  them,  and  said,  "What  shall  we  do  with  the  ark  of  the  God  of  Israel?"  They  answered,  "Let  the  ark  of  the  God  of  Israel  be  carried  over  to  Gath."  They  carried  the  ark  of  the  God  of  Israel  there.	
	It  was  so,  that  after  they  had  carried  it  about,  the  hand  of  Yahweh  was  against  the  city  with  a  very  great  confusion	
	The  ark  of  Yahweh  was  in  the  country  of  the  Philistines  seven  months.	
	 The  men  did  so,  and  took  two  milk  cows,  and  tied  them  to  the  cart,  and  shut  up  their  calves  at  home;	
	 and  they  put  the  ark  of  Yahweh  on  the  cart,  and  the  coffer  with  the  mice  of  gold  and  the  images  of  their  tumors.	
	 The  cows  took  the  straight  way  by  the  way  to  Beth  Shemesh;  they  went  along  the  highway,  lowing  as  they  went,  and  didn't  turn  aside  to  the  right  hand  or  to  the  left;  and  the  lords  of  the  Philistines  went  after  them  to  the  border  of  Beth  Shemesh.	
	 They  of  Beth  Shemesh  were  reaping  their  wheat  harvest  in  the  valley;  and  they  lifted  up  their  eyes,  and  saw  the  ark,  and  rejoiced  to  see  it.	
	 The  cart  came  into  the  field  of  Joshua  of  Beth  Shemesh,  and  stood  there,  where  there  was  a  great  stone	
	 The  Levites  took  down  the  ark  of  Yahweh,  and  the  coffer  that  was  with  it,  in  which  the  jewels  of  gold  were,  and  put  them  on  the  great  stone	
	 When  the  five  lords  of  the  Philistines  had  seen  it,  they  returned  to  Ekron  the  same  day.	
	 These  are  the  golden  tumors  which  the  Philistines  returned  for  a  trespass  offering  to  Yahweh	
	 and  the  golden  mice,  according  to  the  number  of  all  the  cities  of  the  Philistines  belonging  to  the  five  lords,  both  of  fortified  cities  and  of  country  villages,  even  to  the  great  stone,  whereon  they  set  down  the  ark  of  Yahweh.  That  stone  remains  to  this  day  in  the  field  of  Joshua  of  Beth  Shemesh.	
	 He  struck  of  the  men  of  Beth  Shemesh,  because  they  had  looked  into  the  ark  of  Yahweh,  he  struck  of  the  people  fifty  thousand  seventy  men;  and  the  people  mourned,  because  Yahweh  had  struck  the  people  with  a  great  slaughter.	
	The  Philistines  called  for  the  priests  and  the  diviners,  saying,  "What  shall  we  do  with  the  ark  of  Yahweh?  Show  us  with  which  we  shall  send  it  to  its  place."	
	 The  men  of  Beth  Shemesh  said,  "Who  is  able  to  stand  before  Yahweh,  this  holy  God?  To  whom  shall  he  go  up  from  us?"	
	 They  sent  messengers  to  the  inhabitants  of  Kiriath  Jearim,  saying,  "The  Philistines  have  brought  back  the  ark  of  Yahweh;  come  down,  and  bring  it  up  to  yourselves."	
	They  said,  "If  you  send  away  the  ark  of  the  God  of  Israel,  don't  send  it  empty;  but  by  all  means  return  him  a  trespass  offering	
	Then  they  said,  "What  shall  be  the  trespass  offering  which  we  shall  return  to  him?"  They  said,  "Five  golden  tumors,  and  five  golden  mice,  for  the  number  of  the  lords  of  the  Philistines;  for  one  plague  was  on  you  all,  and  on  your  lords.	
	Therefore  you  shall  make  images  of  your  tumors,  and  images  of  your  mice  that  mar  the  land;  and  you  shall  give  glory  to  the  God  of  Israel	
	Why  then  do  you  harden  your  hearts,  as  the  Egyptians  and  Pharaoh  hardened  their  hearts?  When  he  had  worked  wonderfully  among  them,  didn't  they  let  the  people  go,  and  they  departed?	
	"Now  therefore  take  and  prepare  yourselves  a  new  cart,  and  two  milk  cows,  on  which  there  has  come  no  yoke;  and  tie  the  cows  to  the  cart,  and  bring  their  calves  home  from  them;	
	and  take  the  ark  of  Yahweh,  and  lay  it  on  the  cart;  and  put  the  jewels  of  gold,  which  you  return  him  for  a  trespass  offering,  in  a  coffer  by  its  side;  and  send  it  away,  that  it  may  go.	
	Behold;  if  it  goes  up  by  the  way  of  its  own  border  to  Beth  Shemesh,  then  he  has  done  us  this  great  evil	
	The  men  of  Kiriath  Jearim  came,  and  fetched  up  the  ark  of  Yahweh,  and  brought  it  into  the  house  of  Abinadab  in  the  hill,  and  sanctified  Eleazar  his  son  to  keep  the  ark  of  Yahweh.	
	 As  Samuel  was  offering  up  the  burnt  offering,  the  Philistines  drew  near  to  battle  against  Israel;  but  Yahweh  thundered  with  a  great  thunder  on  that  day  on  the  Philistines,  and  confused  them;  and  they  were  struck  down  before  Israel.	
	 The  men  of  Israel  went  out  of  Mizpah,  and  pursued  the  Philistines,  and  struck  them,  until  they  came  under  Beth  Kar.	
	 Then  Samuel  took  a  stone,  and  set  it  between  Mizpah  and  Shen,  and  called  its  name  Ebenezer,  {"Ebenezer"  means  "stone  of  help."}  saying,  "Yahweh  helped  us  until  now."	
	 So  the  Philistines  were  subdued,  and  they  came  no  more  within  the  border  of  Israel.  The  hand  of  Yahweh  was  against  the  Philistines  all  the  days  of  Samuel.	
	 The  cities  which  the  Philistines  had  taken  from  Israel  were  restored  to  Israel,  from  Ekron  even  to  Gath;  and  Israel  recovered  its  border  out  of  the  hand  of  the  Philistines.  There  was  peace  between  Israel  and  the  Amorites.	
	 Samuel  judged  Israel  all  the  days  of  his  life.	
	 He  went  from  year  to  year  in  circuit  to  Bethel  and  Gilgal,  and  Mizpah;  and  he  judged  Israel  in  all  those  places.	
	 His  return  was  to  Ramah,  for  there  was  his  house;  and  there  he  judged  Israel	
	It  happened,  from  the  day  that  the  ark  stayed  in  Kiriath  Jearim,  that  the  time  was  long;  for  it  was  twenty  years	
	Samuel  spoke  to  all  the  house  of  Israel,  saying,  "If  you  do  return  to  Yahweh  with  all  your  heart,  then  put  away  the  foreign  gods  and  the  Ashtaroth  from  among  you,  and  direct  your  hearts  to  Yahweh,  and  serve  him  only;  and  he  will  deliver  you  out  of  the  hand  of  the  Philistines."	
	Then  the  children  of  Israel  removed  the  Baals  and  the  Ashtaroth,  and  served  Yahweh  only.	
	Samuel  said,  "Gather  all  Israel  to  Mizpah,  and  I  will  pray  for  you  to  Yahweh."	
	They  gathered  together  to  Mizpah,  and  drew  water,  and  poured  it  out  before  Yahweh,  and  fasted  on  that  day,  and  said  there,  "We  have  sinned  against  Yahweh."  Samuel  judged  the  children  of  Israel  in  Mizpah.	
	When  the  Philistines  heard  that  the  children  of  Israel  were  gathered  together  at  Mizpah,  the  lords  of  the  Philistines  went  up  against  Israel.  When  the  children  of  Israel  heard  it,  they  were  afraid  of  the  Philistines.	
	The  children  of  Israel  said  to  Samuel,  "Don't  cease  to  cry  to  Yahweh  our  God  for  us,  that  he  will  save  us  out  of  the  hand  of  the  Philistines."	
	Samuel  took  a  suckling  lamb,  and  offered  it  for  a  whole  burnt  offering  to  Yahweh	
	It  happened,  when  Samuel  was  old,  that  he  made  his  sons  judges  over  Israel.	
	 Samuel  told  all  the  words  of  Yahweh  to  the  people  who  asked  of  him  a  king.	
	 He  said,  "This  will  be  the  way  of  the  king  who  shall  reign  over  you	
	 and  he  will  appoint  them  to  him  for  captains  of  thousands,  and  captains  of  fifties;  and  he  will  assign  some  to  plow  his  ground,  and  to  reap  his  harvest,  and  to  make  his  instruments  of  war,  and  the  instruments  of  his  chariots.	
	 He  will  take  your  daughters  to  be  perfumers,  and  to  be  cooks,  and  to  be  bakers.	
	 He  will  take  your  fields,  and  your  vineyards,  and  your  olive  groves,  even  their  best,  and  give  them  to  his  servants.	
	 He  will  take  the  tenth  of  your  seed,  and  of  your  vineyards,  and  give  to  his  officers,  and  to  his  servants.	
	 He  will  take  your  male  servants,  and  your  female  servants,  and  your  best  young  men,  and  your  donkeys,  and  put  them  to  his  work.	
	 He  will  take  the  tenth  of  your  flocks	
	 You  shall  cry  out  in  that  day  because  of  your  king  whom  you  shall  have  chosen  you;  and  Yahweh  will  not  answer  you  in  that  day."	
	 But  the  people  refused  to  listen  to  the  voice  of  Samuel;  and  they  said,  "No;  but  we  will  have  a  king  over  us,	
	Now  the  name  of  his  firstborn  was  Joel;  and  the  name  of  his  second,  Abijah	
	 that  we  also  may  be  like  all  the  nations,  and  that  our  king  may  judge  us,  and  go  out  before  us,  and  fight  our  battles."	
	 Samuel  heard  all  the  words  of  the  people,  and  he  rehearsed  them  in  the  ears  of  Yahweh.	
	 Yahweh  said  to  Samuel,  "Listen  to  their  voice,  and  make  them  a  king."  Samuel  said  to  the  men  of  Israel,  "Every  man  go  to  his  city."	
	His  sons  didn't  walk  in  his  ways,  but  turned  aside  after  lucre,  and  took  bribes,  and  perverted  justice.	
	Then  all  the  elders  of  Israel  gathered  themselves  together,  and  came  to  Samuel  to  Ramah;	
	and  they  said  to  him,  "Behold,  you  are  old,  and  your  sons  don't  walk  in  your  ways	
	But  the  thing  displeased  Samuel,  when  they  said,  "Give  us  a  king  to  judge  us."  Samuel  prayed  to  Yahweh.	
	Yahweh  said  to  Samuel,  "Listen  to  the  voice  of  the  people  in  all  that  they  tell  you;  for  they  have  not  rejected  you,  but  they  have  rejected  me,  that  I  should  not  be  king  over  them.	
	According  to  all  the  works  which  they  have  done  since  the  day  that  I  brought  them  up  out  of  Egypt  even  to  this  day,  in  that  they  have  forsaken  me,  and  served  other  gods,  so  do  they  also  to  you.	
	Now  therefore  listen  to  their  voice	
	Now  there  was  a  man  of  Benjamin,  whose  name  was  Kish,  the  son  of  Abiel,  the  son  of  Zeror,  the  son  of  Becorath,  the  son  of  Aphiah,  the  son  of  a  Benjamite,  a  mighty  man  of  valor.	
	 Then  Saul  said  to  his  servant,  "Well  said.  Come,  let  us  go."  So  they  went  to  the  city  where  the  man  of  God  was.	
	 As  they  went  up  the  ascent  to  the  city,  they  found  young  maidens  going  out  to  draw  water,  and  said  to  them,  "Is  the  seer  here?"	
	 They  answered  them,  and  said,  "He  is.  Behold,  he  is  before  you.  Hurry  now,  for  he  has  come  today  into  the  city;  for  the  people  have  a  sacrifice  today  in  the  high  place.	
	 As  soon  as  you  have  come  into  the  city,  you  shall  immediately  find  him,  before  he  goes  up  to  the  high  place  to  eat;  for  the  people  will  not  eat  until  he  come,  because  he  blesses  the  sacrifice.  Afterwards  those  who  are  invited  eat.  Now  therefore  go  up;  for  at  this  time  you  shall  find  him."	
	 They  went  up  to  the  city.  As  they  came  within  the  city,  behold,  Samuel  came  out  toward  them,  to  go  up  to  the  high  place.	
	 Now  Yahweh  had  revealed  to  Samuel  a  day  before  Saul  came,  saying,	
	 "Tomorrow  about  this  time  I  will  send  you  a  man  out  of  the  land  of  Benjamin,  and  you  shall  anoint  him  to  be  prince  over  my  people  Israel;  and  he  shall  save  my  people  out  of  the  hand  of  the  Philistines	
	 When  Samuel  saw  Saul,  Yahweh  said  to  him,  "Behold,  the  man  of  whom  I  spoke  to  you!  this  same  shall  have  authority  over  my  people."	
	 Then  Saul  drew  near  to  Samuel  in  the  gate,  and  said,  "Please  tell  me  where  the  seer's  house  is."	
	 Samuel  answered  Saul,  and  said,  "I  am  the  seer.  Go  up  before  me  to  the  high  place,  for  you  shall  eat  with  me  today.  In  the  morning  I  will  let  you  go,  and  will  tell  you  all  that  is  in  your  heart.	
	He  had  a  son,  whose  name  was  Saul,  an  impressive  young  man;  and  there  was  not  among  the  children  of  Israel  a  better  person  than  he.  From  his  shoulders  and  upward  he  was  higher  than  any  of  the  people.	
	 As  for  your  donkeys  who  were  lost  three  days  ago,  don't  set  your  mind  on  them;  for  they  are  found.  For  whom  is  all  that  is  desirable  in  Israel?  Is  it  not  for  you,  and  for  all  your  father's  house?"	
	 Saul  answered,  "Am  I  not  a  Benjamite,  of  the  smallest  of  the  tribes  of  Israel?  And  my  family  the  least  of  all  the  families  of  the  tribe  of  Benjamin?  Why  then  do  you  speak  to  me  like  this?"	
	 Samuel  took  Saul  and  his  servant,  and  brought  them  into  the  guest  room,  and  made  them  sit  in  the  best  place  among  those  who  were  invited,  who  were  about  thirty  persons.	
	 Samuel  said  to  the  cook,  "Bring  the  portion  which  I  gave  you,  of  which  I  said  to  you,  'Set  it  aside.'"	
	 The  cook  took  up  the  thigh,  and  that  which  was  on  it,  and  set  it  before  Saul.  Samuel  said,  "Behold,  that  which  has  been  reserved!  Set  it  before  yourself  and  eat;  because  for  the  appointed  time  has  it  been  kept  for  you,  for  I  said,  'I  have  invited  the  people.'"  So  Saul  ate  with  Samuel  that  day.	
	 When  they  had  come  down  from  the  high  place  into  the  city,  he  talked  with  Saul  on  the  housetop.	
	 They  arose  early	
	 As  they  were  going  down  at  the  end  of  the  city,  Samuel  said  to  Saul,  "Tell  the  servant  pass  on  before  us"  (and  he  passed  on),  "but  stand  still  first,  that  I  may  cause  you  to  hear  the  word  of  God."	
	The  donkeys  of  Kish,  Saul's  father,  were  lost.  Kish  said  to  Saul  his  son,  "Take  now  one  of  the  servants  with  you,  and  arise,  go  seek  the  donkeys."	
	He  passed  through  the  hill  country  of  Ephraim,  and  passed  through  the  land  of  Shalishah,  but  they  didn't  find  them	
	When  they  had  come  to  the  land  of  Zuph,  Saul  said  to  his  servant  who  was  with  him,  "Come,  and  let  us  return,  lest  my  father  stop  caring  about  the  donkeys,  and  be  anxious  for  us."	
	He  said  to  him,  "See  now,  there  is  in  this  city  a  man  of  God,  and  he  is  a  man  who  is  held  in  honor.  All  that  he  says  comes  surely  to  pass.  Now  let  us  go  there.  Perhaps  he  can  tell  us  concerning  our  journey  whereon  we  go."	
	Then  Saul  said  to  his  servant,  "But,  behold,  if  we  go,  what  shall  we  bring  the  man?  For  the  bread  is  spent  in  our  vessels,  and  there  is  not  a  present  to  bring  to  the  man  of  God.  What  do  we  have?"	
	The  servant  answered  Saul  again,  and  said,  "Behold,  I  have  in  my  hand  the  fourth  part  of  a  shekel  of  silver.  I  will  give  that  to  the  man  of  God,  to  tell  us  our  way."	
	(In  earlier  times  in  Israel,  when  a  man  went  to  inquire  of  God,  thus  he  said,  "Come,  and  let  us  go  to  the  seer;"  for  he  who  is  now  called  a  prophet  was  before  called  a  Seer.)	
	 Then  Samuel  took  the  @@vial  of  oil@@+++^*see [[1Sam 16:01]]===,  and  poured  it  on  his  head,  and  kissed  him,  and  said,  "Isn't  it  that  Yahweh  has  anointed  you  to  be  prince  over  his  inheritance?	
	 When  you  have  departed  from  me  today,  then  you  shall  find  two  men  by  Rachel's  tomb,  in  the  border  of  Benjamin  at  Zelzah;  and  they  will  tell  you,  'The  donkeys  which  you  went  to  seek  have  been  found;  and  behold,  your  father  has  stopped  caring  about  the  donkeys,  and  is  anxious  for  you,  saying,  "What  shall  I  do  for  my  son?"'	
	 Then  Samuel  took  the  vial  of  oil,  and  poured  it  on  his  head,  and  kissed  him,  and  said,  "Isn't  it  that  Yahweh  has  anointed  you  to  be  prince  over  his  inheritance?	
	  When  they  came  there  to  the  hill,  behold,  a  band  of  prophets  met  him;  and  the  Spirit  of  God  came  mightily  on  him,  and  he  prophesied  among  them.	
	  It  happened,  when  all  who  knew  him  before  saw  that,  behold,  he  prophesied  with  the  prophets,  then  the  people  said  one  to  another,  "What  is  this  that  has  come  to  the  son  of  Kish?  Is  Saul  also  among  the  prophets?"	
	  One  of  the  same  place  answered,  "Who  is  their  father?"  Therefore  it  became  a  proverb,  "Is  Saul  also  among  the  prophets?"	
	  When  he  had  made  an  end  of  prophesying,  he  came  to  the  high  place.	
	  Saul's  uncle  said  to  him  and  to  his  servant,  "Where  did  you  go?"  He  said,  "To  seek  the  donkeys.  When  we  saw  that  they  were  not  found,  we  came  to  Samuel."	
	  Saul's  uncle  said,  "Please  tell  me  what  Samuel  said  to  you."	
	  Saul  said  to  his  uncle,  "He  told  us  plainly  that  the  donkeys  were  found."  But  concerning  the  matter  of  the  kingdom,  of  which  Samuel  spoke,  he  didn't  tell  him.	
	  Samuel  called  the  people  together  to  Yahweh  to  Mizpah;	
	  and  he  said  to  the  children  of  Israel,  "Thus  says  Yahweh,  the  God  of  Israel,  'I  brought  up  Israel  out  of  Egypt,  and  I  delivered  you  out  of  the  hand  of  the  Egyptians,  and  out  of  the  hand  of  all  the  kingdoms  that  oppressed  you	
	  but  you  have  this  day  rejected  your  God,  who  himself  saves  you  out  of  all  your  calamities  and  your  distresses;  and  you  have  said  to  him,  'No!  Set  a  king  over  us.'  Now  therefore  present  yourselves  before  Yahweh  by  your  tribes,  and  by  your  thousands."	
	  So  Samuel  brought  all  the  tribes  of  Israel  near,  and  the  tribe  of  Benjamin  was  taken.	
	  He  brought  the  tribe  of  Benjamin  near  by  their  families;  and  the  family  of  the  Matrites  was  taken;  and  Saul  the  son  of  Kish  was  taken	
	  Therefore  they  asked  of  Yahweh  further,  "Is  there  yet  a  man  to  come  here?"  Yahweh  answered,  "Behold,  he  has  hidden  himself  among  the  baggage."	
	  They  ran  and  fetched  him  there;  and  when  he  stood  among  the  people,  he  was  higher  than  any  of  the  people  from  his  shoulders  and  upward.	
	  Samuel  said  to  all  the  people,  "You  see  him  whom  Yahweh  has  chosen,  that  there  is  none  like  him  among  all  the  people?"  All  the  people  shouted,  and  said,  "Let  the  king  live!"	
	  Then  Samuel  told  the  people  the  regulations  of  the  kingdom,  and  wrote  it  in  a  book,  and  laid  it  up  before  Yahweh.  Samuel  sent  all  the  people  away,  every  man  to  his  house.	
	  Saul  also  went  to  his  house  to  Gibeah;  and  there  went  with  him  the  army,  whose  hearts  God  had  touched.	
	  But  certain  worthless  fellows  said,  "How  shall  this  man  save  us?"  They  despised  him,  and  brought  him  no  present.  But  he  held  his  peace.	
	 "Then  you  shall  go  on  forward  from  there,  and  you  shall  come  to  the  oak  of  Tabor;  and  three  men  shall  meet  you  there  going  up  to  God  to  Bethel,  one  carrying  three  young  goats,  and  another  carrying  three  loaves  of  bread,  and  another  carrying  a  bottle  of  wine	
	 and  they  will  greet  you,  and  give  you  two  loaves  of  bread,  which  you  shall  receive  of  their  hand.	
	 "After  that  you  shall  come  to  the  hill  of  God,  where  is  the  garrison  of  the  Philistines	
	 and  the  Spirit  of  Yahweh  will  come  mightily  on  you,  and  you  shall  prophesy  with  them,  and  shall  be  turned  into  another  man.	
	 Let  it  be,  when  these  signs  have  come  to  you,  that  you  do  as  occasion  shall  serve  you;  for  God  is  with  you.	
	 "You  shall  go  down  before  me  to  Gilgal;  and  behold,  I  will  come  down  to  you,  to  offer  burnt  offerings,  and  to  sacrifice  sacrifices  of  peace  offerings	
	 It  was  so,  that  when  he  had  turned  his  back  to  go  from  Samuel,  God  gave  him  another  heart	
<<openTiddlers
     text:"1Samuel 11"
     tiddlers:{{
         var key = "1Sam 11:";
         t = store.getTiddlers();
         var m = "";
         for(var i=0; i<t.length; i++) {
             if(t[i].title.search(key) != -1) {
                 m += "'" + t[i].title + "' ";
             }
         }
     }}
     closeAll:false
     keepMe:false
 >> 
from Mathew Henry:+++
*Jabesh-Gilead delivered  +++The first fruit of Saul's government was the rescue of Jabesh-gilead from the Ammonites. To save their lives, men will part with liberty, and even consent to have their eyes put out; is it then no wisdom to part with that sin which is as dear to us as our right eye, rather than to be cast into hell-fire? See the faith and confidence of Saul, and, grounded thereon, his courage and resolution. See also his activity in this business. When the Spirit of the Lord comes upon men, it will

make them expert, even without experience. When zeal for the glory of God, and love for the brethren, urge men to earnest efforts, and when God is pleased to help, great effects may speedily be produced. (1Sa 11:12-15)===


*Saul confirmed as King +++They now honoured Saul whom they had despised; and if an enemy be made a friend, that is more to our advantage than to have him slain. The once despised Saviour will at length be acknowledged by all as the Lord's own anointed king. As yet, upon his mercy-seat, he receives the submission of rebels, and even pleads their cause; but shortly, from his righteous tribunal, he will condemn all who persist in opposing him.===
	 Then ''Nahash'' the [[Ammonite]] came up, and encamped against __Jabesh Gilead__: and all ''the men of Jabesh'' said to Nahash, "Make a covenant with us, and we will serve you." 	
	 Nahash the Ammonite said to them, "On this condition I will make it with you, that [[all your right eyes be put out]]; and I will lay it for a reproach on all Israel." 	
	 ''The elders of Jabesh'' said to him, "Give us //''[[seven day]]''//, that we may send messengers to all the borders of Israel; and then, if there is no one to save us, we will come out to you." 	
	 Then ''the messengers'' came to __Gibeah__ of ''Saul'', and spoke these words in the ears of the people: and all the people lifted up their voice, and wept. 	
	 Behold, Saul came following the oxen out of the field; and Saul said, "What ails the people that they weep?" They told him the words of the men of Jabesh. 	
	 __''The Spirit of God''__ came mightily on Saul when he heard those words, and his anger was kindled greatly. 	
	 He took a yoke of oxen, and cut them in pieces, and sent them __throughout all the borders of Israel__ by the hand of messengers, saying, "Whoever doesn't come forth after Saul and after ''Samuel'', so shall it be done to his oxen." The dread of Yahweh fell on the people, and they came out as one man. 	+++ why include Samuel in the message? +++ he didn't think he had a good enough reputation yet?? ===
	 He numbered them in __Bezek__; and ''the children of Israel'' were three hundred thousand, and ''the men of Judah'' thirty thousand. 	
	 They said to the messengers who came, "Thus you shall tell the men of Jabesh Gilead, "''//Tomorrow, by the time the sun is hot//'', you shall have deliverance." The messengers came and told the men of Jabesh; and they were glad. 	
	 Therefore the men of Jabesh said, "Tomorrow we will come out to you, and you shall do with us all that seems good to you." 	
	 It was so ''//on the next day//'', that Saul put the people in three companies; and they came into the midst of the camp in the morning watch, @@and struck the Ammonites until the heat of the day: and it happened, that those who remained were scattered, so that no two of them were left together.@@ 	
	 The people said to Samuel, "Who is he who said, 'Shall Saul reign over us?'  Bring those men, that we may put them to death!" 	
	 Saul said, @@"There shall not a man be put to death this day; for today Yahweh has worked deliverance in Israel."@@ 	
	 Then Samuel said to the people, "Come, and let us go to Gilgal, and renew __''the kingdom''__ there." 	
note that the first thing out of Samuels mouth this chapter is about the Kingdom.  Do you think this has any tie with the passage "seek first the kingdom of God"
	 All the people went to Gilgal; and there they made Saul //''king''// before Yahweh in Gilgal; and there they offered sacrifices of peace offerings before Yahweh; and there Saul and all the men of Israel rejoiced greatly. 	

<<tiddler [[1Sam 12]]>> 
* what are your initial impressions? +++
<<formTiddler TextBoxTemplate>><data>{"notes10":"\n"}</data>
===
* who were the Key people(s) involved? +++
<<formTiddler ShortTextBoxTemplate1>><data>{"notes":"\nSaul, (Samuel) , Nahash & Ammonites,  Elders of Jabesh","notes2":"40 miles around JG","notes3":"3-4 days?","notes4":"Israel threatened , Spirit of God thru saul leads to victory, **contrast between cowardice before the spirit of God and the victory after","notes6":"Seek first the Kingdom of God"}</data>
===

* Where did this take place (key places, how big an area?) +++
<<formTiddler ShortTextBoxTemplate2>> 
===

* When did this take place (how long a time frame?) +++
 <<formTiddler ShortTextBoxTemplate3>>
===

* What do you think is most important here? (summarize the chapter)+++
 <<formTiddler ShortTextBoxTemplate4>>
===

* Why did certain things happen? (what needs explaining?) +++
 <<formTiddler ShortTextBoxTemplate5>>
===
 
*How is this applicable to us today? +++
<<formTiddler ShortTextBoxTemplate6>>
===


Key verse is: +++
<<formTiddler ShortTextBoxTemplate7>>
===
<<openTiddlers
     text:"1Samuel 12"
     tiddlers:{{
         var key = "1Sam 12:";
         t = store.getTiddlers();
         var m = "";
         for(var i=0; i<t.length; i++) {
             if(t[i].title.search(key) != -1) {
                 m += "'" + t[i].title + "' ";
             }
         }
     }}
     closeAll:false
     keepMe:false
 >> 
	 ''Samuel'' said to ''all Israel'', "Behold, I have listened to your voice in all that you said to me, and have made a __''king''__ over you. 	
	 Now, behold, __''the king''__ walks before you; and I am old and gray-headed; and behold, my sons are with you: and I have walked before you from my youth to this day. 	
	 @@Here I am. Witness against me before Yahweh, and before his anointed. Whose ox have I taken? Whose donkey have I taken? Whom have I defrauded? Whom have I oppressed? Of whose hand have I taken a ransom to blind my eyes therewith? I will restore it to you."@@ 	
	 They said, "You have not defrauded us, nor oppressed us, neither have you taken anything of any man's hand." 	
	 He said to them, "Yahweh is witness against you, and ''his anointed'' is witness this day, that you have not found anything in my hand." They said, "He is witness." 	
	 Samuel said to the people, "It is Yahweh who appointed Moses and Aaron, and that brought your fathers up out of the land of Egypt. 	
	 Now therefore stand still, that I may plead with you before Yahweh concerning all the righteous acts of Yahweh, which he did to you and to your fathers. 	
	 "When Jacob had come into Egypt, and your fathers cried to Yahweh, then Yahweh sent Moses and Aaron, who brought ''your fathers'' out of Egypt, and made them to dwell in this place. 	
	 "But they forgot Yahweh their God; and he sold them into the hand of Sisera, captain of the army of Hazor, and into the hand of the Philistines, and into the hand of the king of Moab; and they fought against them. 	
	 They cried to Yahweh, and said, 'We have sinned, because we have forsaken Yahweh, and have served the Baals and the Ashtaroth: but now deliver us out of the hand of our enemies, and we will serve you.'  	
	 Yahweh sent Jerubbaal, and Bedan, and Jephthah, and Samuel, and delivered you out of the hand of your enemies on every side; and you lived in safety. 	
	 "When you saw that Nahash the king of the children of Ammon came against you, you said to me, 'No, but a __''king''__ shall reign over us;' when Yahweh your God was your __''king''__. 	
	 Now therefore see the __''king''__ whom you have chosen, and whom you have asked for: and behold, Yahweh has set a __''king''__ over you. 	
	 @@If you will fear Yahweh, and serve him, and listen to his voice, and not rebel against the commandment of Yahweh, then both you and also the king who reigns over you are followers of Yahweh your God.@@ 	
@@	 But if you will not listen to the voice of Yahweh, but rebel against the commandment of Yahweh, then will the hand of Yahweh be against you, as it was against your fathers.@@ 	
	 "Now therefore stand still and see this great thing, which Yahweh will do before your eyes. 	
	 Isn't it wheat harvest today? I will call to Yahweh, that he may send thunder and rain; and @@you shall know and see that your wickedness is great, which you have done in the sight of Yahweh, in asking for a __''king''__."@@ 	
	 So Samuel called to Yahweh; and Yahweh sent thunder and rain that day: and all the people greatly feared Yahweh and Samuel. 	
	 All the people said to Samuel, "Pray for your servants to Yahweh your God, that we not die; for we have added to all our sins this __''evil''__, to ask us a __''king''__." 	
	 Samuel said to the people, "Don't be afraid. You have indeed done all this __''evil''__; yet don't turn aside from following Yahweh, but serve Yahweh with all your heart. 	
	 Don't turn aside to go after vain things which can't profit nor deliver, for they are vain. 	
	@@ For Yahweh will not forsake his people for his great name1Sam s sake, because it has pleased Yahweh to make you a people to himself. @@	
	 Moreover as for me, far be it from me that I should sin against Yahweh in ceasing to pray for you: but I will instruct you in the good and the right way. 	
	 Only fear Yahweh, and serve him in truth with all your heart*; for consider how great things he has done for you. 	
{{{"with all your heart"...Is there any significance that it doesn't go on like in the new testament (and all your strength and all your mind and all your soul)?
}}}
	 But if you shall still do __''wickedly''__, you shall be consumed, both you and your __''king''__." 	
{{{this is a reiteration of which covenant? }}}+++ the Mosaic (not Abrahamic) ===
* who were the Key people(s) involved? +++
<<formTiddler ShortTextBoxTemplate1>><data>{"notes":"\nSaul, Samuel** , Isreal","notes2":"gilgal","notes3":"one day?","notes4":"Obey God, seek the Kingdom, God is enough, obey God in all circumstances\n","notes6":"Obey God, seek the Kingdom,","notes7":"1Sam 12:22"}</data>
===

* Where did this take place (key places, how big an area?) +++
<<formTiddler ShortTextBoxTemplate2>> 
===

* When did this take place (how long a time frame?) +++
 <<formTiddler ShortTextBoxTemplate3>>
===

* What do you think is most important here? (summarize the chapter)+++
 <<formTiddler ShortTextBoxTemplate4>>
===

* Why did certain things happen? (what needs explaining?) +++
 <<formTiddler ShortTextBoxTemplate5>>
===
 
*How is this applicable to us today? +++
<<formTiddler ShortTextBoxTemplate6>>
===


Key verse is: +++
<<formTiddler ShortTextBoxTemplate7>>
===
<<openTiddlers
     text:"1Samuel 13"
     tiddlers:{{
         var key = "1Sam 13:";
         t = store.getTiddlers();
         var m = "";
         for(var i=0; i<t.length; i++) {
             if(t[i].title.search(key) != -1) {
                 m += "'" + t[i].title + "' ";
             }
         }
     }}
     closeAll:false
     keepMe:false
 >> 
	 ''Saul'' reigned //''a year''//; and when he had reigned //''two years''// over Israel, 	
	 Saul chose for himself @@three thousand men of Israel@@, of which two thousand were with Saul in __Michmash__ and in the Mount of Bethel, and one thousand were with ''Jonathan'' in __Gibeah of Benjamin__: and the rest of the people he sent every man to his tent. 	
	 ''Jonathan'' struck the garrison of ''the Philistines'' that was in __Geba__: and @@the Philistines heard of it.@@+++^must not have been much of a fight.=== Saul blew the trumpet throughout all the land, saying, "Let the Hebrews hear!" 	
	 ''All Israel'' @@heard that Saul had struck the garrison of the Philistines@@,+++charitable guy, wasn't he!=== and also that Israel was had in abomination with the Philistines. The people were gathered together after Saul to __Gilgal__. 	(NASB: +++^All Israel heard the news that Saul had smitten the garrison of the Philistines, and also that Israel had become odious to the Philistines. The people were then summoned to Saul at Gilgal.===)
	 The Philistines assembled themselves together to fight with Israel, thirty thousand chariots, and six thousand horsemen, and people as the sand which is on the seashore in multitude: and they came up, and encamped in __Michmash__, eastward of Beth Aven. 	
	 When the men of Israel saw that they were in a strait (for the people were distressed), then @@the people hid themselves in caves, and in thickets, and in rocks, and in coverts, and in pits. @@	
	 Now some of the Hebrews had @@gone over __the Jordan__ to the land of __Gad and Gilead__@@; but as for Saul, he was yet in __Gilgal__, and all the people followed him trembling. 	
	 He stayed //''seven days''//, @@according to the time set by Samuel@@: but ''Samuel'' didn't come to Gilgal; and the people were scattered from him. 	
	 Saul said, "Bring here the @@bgcolor(#ff6633):burnt offering to me@@, and the peace offerings." He offered the burnt offering. 	
	 It came to pass that as soon as he had made an end of offering the burnt offering, behold, Samuel came; and Saul went out to meet him, that he might greet him. 	
	 Samuel said, "What have you done?" Saul said, "Because I saw that the people were scattered from me, and that you didn't come within the days appointed, and that the Philistines assembled themselves together at Michmash; 	
	 therefore I said, 'Now the Philistines will come down on me to Gilgal, and I haven't entreated the favor of ''Yahweh''.' I forced myself therefore, and offered the burnt offering." 	
	 @@color(#ff0033):Samuel said to Saul, "You have done foolishly. You have not kept the commandment of Yahweh your God, which he commanded you; for now Yahweh would have established your kingdom on Israel forever@@. 	
	 @@color(#ff0033):But now your kingdom shall not continue. Yahweh has sought for himself a man after his own heart, and Yahweh has appointed him to be prince over his people, because you have not kept that which Yahweh commanded you."@@ 	
	 Samuel arose, and went from __Gilgal__ to __Gibeah__ of Benjamin. Saul numbered the people who were present with him, about six hundred men. 	
	 Saul, and Jonathan his son, and the people who were present with them, stayed in Geba of Benjamin: but the Philistines encamped in Michmash. 	
	 The spoilers came out of the camp of the Philistines in three companies: one company turned to the way that leads to Ophrah, to the land of Shual; 	
	 and another company turned the way to Beth Horon; and another company turned the way of the border that looks down on the valley of Zeboim toward the wilderness. 	
	 Now there was no smith found throughout all the land of Israel; for the Philistines said, "Lest the Hebrews make them swords or spears;" 	
	 but all the Israelites went down to the Philistines, to sharpen every man his plowshare, mattock, axe, and sickle; 	
	 yet they had a file for the mattocks, and for the plowshares, and for the forks, and for the axes, and to set the goads. 	
	 So it came to pass in the day of battle, that there was neither sword nor spear found in the hand of any of the people who were with Saul and Jonathan: but with Saul and with Jonathan his son was there found. 	
	 The garrison of the Philistines went out to the pass of Michmash. 	
* who were the Key people(s) involved? +++
<<formTiddler ShortTextBoxTemplate1>><data>{"notes":"\n"}</data>
===

* Where did this take place (key places, how big an area?) +++
<<formTiddler ShortTextBoxTemplate2>> 
===

* When did this take place (how long a time frame?) +++
 <<formTiddler ShortTextBoxTemplate3>>
===

* What do you think is most important here? (summarize the chapter)+++
 <<formTiddler ShortTextBoxTemplate4>>
===

* Why did certain things happen? (what needs explaining?) +++
 <<formTiddler ShortTextBoxTemplate5>>
===
 
*How is this applicable to us today? +++
<<formTiddler ShortTextBoxTemplate6>>
===


Key verse is: +++
<<formTiddler ShortTextBoxTemplate7>>
===
<<openTiddlers
     text:"1Samuel 14"
     tiddlers:{{
         var key = "1Sam 14:";
         t = store.getTiddlers();
         var m = "";
         for(var i=0; i<t.length; i++) {
             if(t[i].title.search(key) != -1) {
                 m += "'" + t[i].title + "' ";
             }
         }
     }}
     closeAll:false
     keepMe:false
 >> 
	 Now  it  fell  on  a  day,  that  Jonathan  the  son  of  Saul  said  to  the  young  man  who  bore  his  armor,  "Come,  and  let  us  go  over  to  the  Philistines'  garrison,  that  is  on  the  other  side."  But  he  didn't  tell  his  father.	
	 Saul  stayed  in  the  uttermost  part  of  Gibeah  under  the  pomegranate  tree  which  is  in  Migron	
	 and  Ahijah,  the  son  of  Ahitub,  Ichabod's  brother,  the  son  of  Phinehas,  the  son  of  Eli,  the  priest  of  Yahweh  in  Shiloh,  wearing  an  ephod.  The  people  didn't  know  that  Jonathan  was  gone.	
	 Between  the  passes,  by  which  Jonathan  sought  to  go  over  to  the  Philistines'  garrison,  there  was  a  rocky  crag  on  the  one  side,  and  a  rocky  crag  on  the  other  side	
	 The  one  crag  rose  up  on  the  north  in  front  of  Michmash,  and  the  other  on  the  south  in  front  of  Geba.	
	 Jonathan  said  to  the  young  man  who  bore  his  armor,  "Come,  and  let  us  go  over  to  the  garrison  of  these  uncircumcised.  It  may  be  that  Yahweh  will  work  for  us;  for  there  is  no  restraint  on  Yahweh  to  save  by  many  or  by  few."	
	 His  armor  bearer  said  to  him,  "Do  all  that  is  in  your  heart.  Turn  and,  behold,  I  am  with  you  according  to  your  heart."	
	 Then  Jonathan  said,  "Behold,  we  will  pass  over  to  the  men,  and  we  will  reveal  ourselves  to  them.	
	 If  they  say  thus  to  us,  'Wait  until  we  come  to  you!'  then  we  will  stand  still  in  our  place,  and  will  not  go  up  to  them.	
	  But  if  they  say  this,  'Come  up  to  us!'  then  we  will  go  up;  for  Yahweh  has  delivered  them  into  our  hand.  This  shall  be  the  sign  to  us."	
	  Both  of  them  revealed  themselves  to  the  garrison  of  the  Philistines	
	  The  men  of  the  garrison  answered  Jonathan  and  his  armor  bearer,  and  said,  "Come  up  to  us,  and  we  will  show  you  something!"  Jonathan  said  to  his  armor  bearer,  "Come  up  after  me;  for  Yahweh  has  delivered  them  into  the  hand  of  Israel."	
	  Jonathan  climbed  up  on  his  hands  and  on  his  feet,  and  his  armor  bearer  after  him	
	  That  first  slaughter,  which  Jonathan  and  his  armor  bearer  made,  was  about  twenty  men,  within  as  it  were  half  a  furrow's  length  in  an  acre  of  land.	
	  There  was  a  trembling  in  the  camp,  in  the  field,  and  among  all  the  people;  the  garrison,  and  the  spoilers,  they  also  trembled;  and  the  earth  quaked	
	  The  watchmen  of  Saul  in  Gibeah  of  Benjamin  looked;  and  behold,  the  multitude  melted  away,  and  scattered.	
	  Then  Saul  said  to  the  people  who  were  with  him,  "Count  now,  and  see  who  is  missing  from  us."  When  they  had  counted,  behold,  Jonathan  and  his  armor  bearer  were  not  there.	
	  Saul  said  to  Ahijah,  "Bring  the  ark  of  God  here."  For  the  ark  of  God  was  with  the  children  of  Israel  at  that  time.	
	  It  happened,  while  Saul  talked  to  the  priest,  that  the  tumult  that  was  in  the  camp  of  the  Philistines  went  on  and  increased	
	  Saul  and  all  the  people  who  were  with  him  were  gathered  together,  and  came  to  the  battle	
	  Now  the  Hebrews  who  were  with  the  Philistines  as  before,  and  who  went  up  with  them  into  the  camp,  from  all  around,  even  they  also  turned  to  be  with  the  Israelites  who  were  with  Saul  and  Jonathan.	
	  Likewise  all  the  men  of  Israel  who  had  hidden  themselves  in  the  hill  country  of  Ephraim,  when  they  heard  that  the  Philistines  fled,  even  they  also  followed  hard  after  them  in  the  battle.	
	  So  Yahweh  saved  Israel  that  day	
	  The  men  of  Israel  were  distressed  that  day;  for  Saul  had  adjured  the  people,  saying,  "Cursed  is  the  man  who  eats  any  food  until  it  is  evening,  and  I  am  avenged  of  my  enemies."  So  none  of  the  people  tasted  food.	
	  All  the  people  came  into  the  forest;  and  there  was  honey  on  the  ground.	
	  When  the  people  had  come  to  the  forest,  behold,  the  honey  dropped	
	  But  Jonathan  didn't  hear  when  his  father  commanded  the  people  with  the  oath	
	  Then  one  of  the  people  answered,  and  said,  "Your  father  directly  commanded  the  people  with  an  oath,  saying,  'Cursed  is  the  man  who  eats  food  this  day.'"  The  people  were  faint.	
	  Then  Jonathan  said,  "My  father  has  troubled  the  land.  Please  look  how  my  eyes  have  been  enlightened,  because  I  tasted  a  little  of  this  honey.	
	  How  much  more,  if  perhaps  the  people  had  eaten  freely  today  of  the  spoil  of  their  enemies  which  they  found?  For  now  has  there  been  no  great  slaughter  among  the  Philistines."	
	  They  struck  of  the  Philistines  that  day  from  Michmash  to  Aijalon.  The  people  were  very  faint;	
	  and  the  people  flew  on  the  spoil,  and  took  sheep,  and  cattle,  and  calves,  and  killed  them  on  the  ground;  and  the  people  ate  them  with  the  blood.	
	  Then  they  told  Saul,  saying,  "Behold,  the  people  are  sinning  against  Yahweh,  in  that  they  eat  meat  with  the  blood."  He  said,  "You  have  dealt  treacherously.  Roll  a  large  stone  to  me  this  day!"	
	  Saul  said,  "Disperse  yourselves  among  the  people,  and  tell  them,  'Bring  me  here  every  man  his  ox,  and  every  man  his  sheep,  and  kill  them  here,  and  eat;  and  don't  sin  against  Yahweh  in  eating  meat  with  the  blood.'"  All  the  people  brought  every  man  his  ox  with  him  that  night,  and  killed  them  there.	
	  Saul  built  an  altar  to  Yahweh.  This  was  the  first  altar  that  he  built  to  Yahweh.	
	  Saul  said,  "Let  us  go  down  after  the  Philistines  by  night,  and  take  spoil  among  them  until  the  morning  light,  and  let  us  not  leave  a  man  of  them."  They  said,  "Do  whatever  seems  good  to  you."  Then  the  priest  said,  "Let  us  draw  near  here  to  God."	
	  Saul  asked  counsel  of  God,  "Shall  I  go  down  after  the  Philistines?  Will  you  deliver  them  into  the  hand  of  Israel?"  But  he  didn't  answer  him  that  day.	
	  Saul  said,  "Draw  near  here,  all  you  chiefs  of  the  people;  and  know  and  see  in  which  this  sin  has  been  this  day.	
	  For,  as  Yahweh  lives,  who  saves  Israel,  though  it  is  in  Jonathan  my  son,  he  shall  surely  die."  But  there  was  not  a  man  among  all  the  people  who  answered  him.	
	  Then  he  said  to  all  Israel,  "You  be  on  one  side,  and  I  and  Jonathan  my  son  will  be  on  the  other  side."  The  people  said  to  Saul,  "Do  what  seems  good  to  you."	
	  Therefore  Saul  said  to  Yahweh,  the  God  of  Israel,  "Show  the  right."  Jonathan  and  Saul  were  chosen;  but  the  people  escaped.	
	  Saul  said,  "Cast  lots  between  me  and  Jonathan  my  son."  Jonathan  was  selected.	
	  Then  Saul  said  to  Jonathan,  "Tell  me  what  you  have  done!"  Jonathan  told  him,  and  said,  "I  certainly  did  taste  a  little  honey  with  the  end  of  the  rod  that  was  in  my  hand;  and  behold,  I  must  die."	
	  Saul  said,  "God  do  so  and  more  also;  for  you  shall  surely  die,  Jonathan."	
	  The  people  said  to  Saul,  "Shall  Jonathan  die,  who  has  worked  this  great  salvation  in  Israel?  Far  from  it!  As  Yahweh  lives,  there  shall  not  one  hair  of  his  head  fall  to  the  ground;  for  he  has  worked  with  God  this  day!"  So  the  people  rescued  Jonathan,  that  he  didn't  die.	
	  Then  Saul  went  up  from  following  the  Philistines;  and  the  Philistines  went  to  their  own  place.	
	  Now  when  Saul  had  taken  the  kingdom  over  Israel,  he  fought  against  all  his  enemies  on  every  side,  against  Moab,  and  against  the  children  of  Ammon,  and  against  Edom,  and  against  the  kings  of  Zobah,  and  against  the  Philistines	
	  He  did  valiantly,  and  struck  the  Amalekites,  and  delivered  Israel  out  of  the  hands  of  those  who  despoiled  them.	
	  Now  the  sons  of  Saul  were  Jonathan,  and  Ishvi,  and  Malchishua;  and  the  names  of  his  two  daughters  were  these	
	  and  the  name  of  Saul's  wife  was  Ahinoam  the  daughter  of  Ahimaaz.  The  name  of  the  captain  of  his  army  was  Abner  the  son  of  Ner,  Saul's  uncle.	
	  Kish  was  the  father  of  Saul;  and  Ner  the  father  of  Abner  was  the  son  of  Abiel.	
	  There  was  severe  war  against  the  Philistines  all  the  days  of  Saul	
<<openTiddlers
     text:"1Samuel 15"
     tiddlers:{{
         var key = "1Sam 15:";
         t = store.getTiddlers();
         var m = "";
         for(var i=0; i<t.length; i++) {
             if(t[i].title.search(key) != -1) {
                 m += "'" + t[i].title + "' ";
             }
         }
     }}
     closeAll:false
     keepMe:false
 >> 
	 ''Samuel''  said  to  ''Saul'',  "Yahweh  sent  me  to  anoint  you  to  be  __''king''__  over  his  people,  over  ''Israel''.  Now  therefore  listen  to  the  voice  of  the  words  of  Yahweh. +++^* is this to help him gain back favour from the incident at [[1Sam 13:13]]? ===
	 Thus  says  Yahweh  of  Armies,  'I  have  marked  that  which  ''[[Amalek]]''  did  to  Israel,  how  he  set  himself  against  him  in  the  way,  when  he  came  up  out  of  Egypt.	
	 Now  go  and  strike  Amalek,  and  @@utterly  destroy  all  that  they  have,  and  don't  spare  them;  but  kill  both  man  and  woman,  infant  and  nursing  baby,  ox  and  sheep,  camel  and  donkey.'@@"	+++^* [[What's with all the death and destruction of foreigners in the land of Israel?]] ===
	 Saul  summoned  the  people,  and  numbered  them  in  __Telaim__,  two  hundred  thousand  footmen,  and  ten  thousand  men  of  __Judah__.	
	 Saul  came  to  the  city  of  Amalek,  and  laid  wait  in  the  valley.	
	 Saul  said  to  the  ''Kenites'', @@ "[[Go,  depart,  go  down  from  among  the  Amalekites]],  @@lest  I  destroy  you  with  them;  for  you  showed  kindness  to  all  the  children  of  Israel,  when  they  came  up  out  of  Egypt."  So  the  Kenites  departed  from  among  the  Amalekites.	
	 Saul  struck  the  Amalekites,  __from  Havilah  as  you  go  to  Shur,  that  is  before  Egypt__.	
	 He  took  __Agag__  the  king  of  the  Amalekites  @@alive@@,  and  utterly  destroyed  all  the  people  with  the  edge  of  the  sword.	
	 But  ''Saul  and  the  people''  spared  Agag,  and  the  best  of  the  sheep,  and  of  the  cattle,  and  of  the  fatlings,  and  the  lambs,  and  all  that  was  good,  and  wouldn't  utterly  destroy  them	
	  Then  the  word  of  Yahweh  came  to  Samuel,  saying,	
	  "It  grieves  me  that  I  have  set  up  Saul  to  be  __''king''__;  for  he  is  turned  back  from  following  me,  and  has  not  performed  my  commandments."  @@Samuel  was  angry@@ +++^*who was he angry with? +++^* Saul? God? Himself?=== ===;  and  he  cried  to  Yahweh  //''all  night''//.	
	  Samuel  rose  //''early''//  to  meet  Saul  in  the  morning;  and  it  was  told  Samuel,  saying,  "Saul  came  to  __Carmel__,  and  behold,  @@[[he  set  up  a  monument  for  himself]]@@,  and  turned,  and  passed  on,  and  went  down  to  __Gilgal__."	
	  Samuel  came  to  Saul;  and  Saul  said  to  him,  "You  are  blessed  by  Yahweh!  I  have  performed  the  commandment  of  Yahweh."	+++^*Who does this remind you of? +++^* our children? === ===
	  Samuel  said,  "Then  what  does  this  bleating  of  the  sheep  in  my  ears,  and  the  lowing  of  the  cattle  which  I  hear  mean?"	
	  Saul  said,  "They  have  brought  them  from  the  Amalekites;  for  @@the  people@@+++^*see [[1Sam 15:09]] seems to be a little story editing my Saul... ===  spared  the  best  of  the  sheep  and  of  the  cattle,  to  sacrifice  to  Yahweh  your  God.  We  have  utterly  destroyed  the  rest."	
	  Then  Samuel  said  to  Saul,  "Stay,  and  I  will  tell  you  what  Yahweh  has  said  to  me  last  night."  He  said  to  him,  "Say  on."	
	  Samuel  said,  "Though  you  were  little  in  your  own  sight,  weren't  you  made  the  head  of  the  tribes  of  Israel?  Yahweh  anointed  you  king  over  Israel;	
	  and  Yahweh  sent  you  on  a  journey,  and  said,  'Go,  and  utterly  destroy  the  sinners  the  Amalekites,  and  fight  against  them  until  they  are  consumed.'	
	  Why  then  didn't  you  obey  the  voice  of  Yahweh,  but  took  the  spoils,  and  did  that  which  was  evil  in  the  sight  of  Yahweh?"	
	  Saul  said  to  Samuel,  "But  I  have  obeyed  the  voice  of  Yahweh,  and  have  gone  the  way  which  Yahweh  sent  me,  and  have  brought  Agag  the  king  of  Amalek,  and  have  utterly  destroyed  the  Amalekites.	
	  But  the  people  took  of  the  spoil,  sheep  and  cattle,  the  chief  of  the  devoted  things,  to  sacrifice  to  Yahweh  your  God  in  Gilgal."	
	  @@color(#ff0033):Samuel  said,  "Has  Yahweh  as  great  delight  in  burnt  offerings  and  sacrifices,  as  in  obeying  the  voice  of  Yahweh?  Behold,  to  obey  is  better  than  sacrifice,  and  to  listen  than  the  fat  of  rams.	@@
@@color(#cc0033):	For  rebellion  is  as  the  sin  of  witchcraft,  and  stubbornness  is  as  idolatry  and  teraphim.  Because  you  have  rejected  the  word  of  Yahweh,  he  has  also  rejected  you  from  being  king."	@@
	  Saul  said  to  Samuel,  "I  have  sinned;  for  I  have  transgressed  the  commandment  of  Yahweh,  and  your  words,  @@because  I  feared  the  people,  and  obeyed  their  voice.@@ +++^* where have we heard that before? +++^* Adam: "It was this woman you put with me"(paraphrase)=== ===	
	  Now  therefore,  please  pardon  my  sin,  and  @@turn  again  with  me@@,  that  I  may  worship  Yahweh."	
	  Samuel  said  to  Saul,  "@@bgcolor(#ff9900):I  will  not  return  with  you;@@  for  you  have  rejected  the  word  of  Yahweh,  and  Yahweh  has  rejected  you  from  being  king  over  Israel."	
	  As  Samuel  turned  about  to  go  away,  @@Saul  grabbed  the  skirt  of  his  robe@@,  @@bgcolor(#ff9900):and  it  tore.@@	
	@@color(#cc0033):  Samuel  said  to  him,  "[[Yahweh  has  torn  the  kingdom  of  Israel  from  you  this  day]],  and  has  given  it  to  a  neighbor  of  yours  who  is  better  than  you.	@@ 
	  Also  ''the  Strength  of  Israel''  will  not  lie  nor  repent;  for  he  is  not  a  man,  that  he  should  repent."	
	  Then  he  said,  @@"I  have  sinned	@@
	  @@bgcolor(#ff9900):So  Samuel  went  back  with  Saul@@;  and  Saul  worshiped  Yahweh.	
	  Then  Samuel  said,  "Bring  here  to  me  Agag  the  king  of  the  Amalekites!"  Agag  came  to  him  cheerfully.  Agag  said,  "Surely  the  bitterness  of  death  is  past."	
	  Samuel  said,  "As  your  sword  has  made  women  childless,  so  your  mother  will  be  childless  among  women!"  Samuel  cut  Agag  in  pieces  before  Yahweh  in  __Gilgal__.	
	  Then  Samuel  went  to  __Ramah__;  and  Saul  went  up  to  his  house  to  __Gibeah__  of  Saul.	
	  Samuel  came  no  more  to  see  Saul  until  the  day  of  his  death;  for  Samuel  mourned  for  Saul	
* who were the Key people(s) involved? +++
<<formTiddler ShortTextBoxTemplate1>><data>{"notes":"\nSaul, Samuel,  Amalekites, King Agag,","notes2":"100 miles ish","notes3":"6 weeks??","notes4":"Theme:Obedience to God completely - selective obedience is disobedience\nSaul had one last chance and failed ","notes7":"1Sam 15:22","notes5":"God greiving","notes6":"Letting go of our little disobediences - test the spirits (ideas), get \nrid of the \"self\" perspective"}</data>
===

* Where did this take place (key places, how big an area?) +++
<<formTiddler ShortTextBoxTemplate2>> 
===

* When did this take place (how long a time frame?) +++
 <<formTiddler ShortTextBoxTemplate3>>
===

* What do you think is most important here? (summarize the chapter)+++
 <<formTiddler ShortTextBoxTemplate4>>
===

* Why did certain things happen? (what needs explaining?) +++
 <<formTiddler ShortTextBoxTemplate5>>
===
 
*How is this applicable to us today? +++
<<formTiddler ShortTextBoxTemplate6>>
===


Key verse is: +++
<<formTiddler ShortTextBoxTemplate7>>
===
<<openTiddlers
     text:"1Samuel 16"
     tiddlers:{{
         var key = "1Sam 16:";
         t = store.getTiddlers();
         var m = "";
         for(var i=0; i<t.length; i++) {
             if(t[i].title.search(key) != -1) {
                 m += "'" + t[i].title + "' ";
             }
         }
     }}
     closeAll:false
     keepMe:false
 >> 
''Yahweh'' said to ''Samuel'', "How long will you mourn for ''Saul'', since I have rejected him from being ''__king__'' over Israel? Fill your horn with oil+++^* compare with [[1Sam 10:01]]===, and go. I will send you to ''Jesse'' the __Bethlehem__ite; for I have provided a __''king''__ for myself among his sons." 
	 Samuel  said,  "How  can  I  go?  If  Saul  hears  it,  he  will  kill  me."  Yahweh  said,  "Take  a  heifer  with  you,  and  say,  I  have  come  to  sacrifice  to  Yahweh.	
	 Call  Jesse  to  the  sacrifice,  and  I  will  show  you  what  you  shall  do.  You  shall  anoint  to  me  him  whom  I  name  to  you."	
	 Samuel  did  that  which  Yahweh  spoke,  and  came  to  __Bethlehem__.  ''The  elders  of  the  city''  came  to  meet  him  trembling,  and  said,  @@"Do  you  come  peaceably?@@" +++^* [[Why were the elders afraid?]] ===
	 He  said,  "Peaceably;  I  have  come  to  sacrifice  to  Yahweh.  Sanctify  yourselves,  and  come  with  me  to  the  sacrifice."  He  sanctified  Jesse  and  his  sons,  and  called  them  to  the  sacrifice.	
	 It  happened,  when  they  had  come,  that  he  looked  at  ''Eliab'',  and  said,  "Surely  Yahweh's  anointed  is  before  him."	
	 But  Yahweh  said  to  Samuel,  "Don't  look  on  his  face,  or  on  the  height  of  his  stature;  because  I  have  rejected  him	:  	
But the LORD said to Samuel, "Do not look at his appearance or at his physical stature, because I have refused him. For the LORD does not see as man sees;[fn1] for man looks at the outward appearance, but the LORD looks at the heart."
	 Then  Jesse  called  ''Abinadab'',  and  made  him  pass  before  Samuel.  He  said,  "Neither  has  Yahweh  chosen  this  one."	
	 Then  Jesse  made  ''Shammah''  to  pass  by.  He  said,  "Neither  has  Yahweh  chosen  this  one."	
	  Jesse  made  seven  of  his  sons  to  pass  before  Samuel.  Samuel  said  to  Jesse,  "Yahweh  has  not  chosen  these."	
	  Samuel  said  to  Jesse,  "Are  all  your  children  here?"  He  said,  "There  remains  yet  the  youngest,  and  behold,  he  is  keeping  the  sheep."  Samuel  said  to  Jesse,  "Send  and  get  him;  for  we  will  not  sit  down  until  he  comes  here."	
	  He  sent,  and  brought  him  in.  Now  he  was  ruddy,  and  withal  of  a  beautiful  face,  and  goodly  to  look  on.  @@Yahweh  said,  "Arise,  anoint  him;  for  this  is  he."@@ +++^* now why didn't he name him here? +++^width 60px^* I think it adds to the suspense of the story (why wouldn't the creator of the universe be a good story teller?=== ===
	  Then  Samuel  took  the  horn  of  oil,  and  anointed  him  in  the  midst  of  his  brothers	 +++^* Where have we seen this before? +++^* Joseph and his brothers (sort of) === ===
	  Now  the  __''Spirit  of  Yahweh''__  departed  from  Saul,  and  an  ''evil  spirit  from  Yahweh  ''troubled  him.	+++^* How do we reconcile an [[evil spirit from Yaweh]] with God being holy and good? ===
	  ''Saul's  servants''  said  to  him,  "See  now,  an  evil  spirit  from  God  troubles  you.	
	  Let  our  lord  now  command  your  servants  who  are  before  you,  to  seek  out  ''a  man  who  is  a  skillful  player  on  the  harp''.  It  shall  happen,  when  the  evil  spirit  from  God  is  on  you,  that  he  shall  play  with  his  hand,  and  you  shall  be  well."	
	  Saul  said  to  his  servants,  "Provide  me  now  a  man  who  can  play  well,  and  bring  him  to  me."	
	  Then  one  of  the  young  men  answered,  and  said,  "Behold,  I  have  seen  a  son  of  Jesse  the  Bethlehemite,  who  is  skillful  in  playing,  a  mighty  man  of  valor,  a  man  of  war,+++^* why was he called [[a man of war?]] ===  prudent  in  speech,  and  a  comely  person;  and  Yahweh  is  with  him."	
	  Therefore  Saul  sent  messengers  to  Jesse,  and  said,  "Send  me  ''David''  your  son,  who  is  with  the  sheep."	
	  Jesse  took  a  donkey  loaded  with  bread,  and  a  bottle  of  wine,  and  a  young  goat,  and  sent  them  by  David  his  son  to  Saul.	+++^* So I guess David's family were pretty good at keeping secrets... ===
	  David  came  to  Saul,  and  stood  before  him.  He  loved  him  greatly;  and  he  became  his  armor  bearer.	
	  Saul  sent  to  Jesse,  saying,  "Please  let  David  stand  before  me;  for  he  has  found  favor  in  my  sight."	
	  It  happened,  when  the  spirit  from  God  was  on  Saul,  that  David  took  the  harp,  and  played  with  his  hand	
* who were the Key people(s) involved? +++
<<formTiddler ShortTextBoxTemplate1>><data>{"notes":"Samuel, Saul, Jesse, David,","notes2":"Ramah, Bethlehem","notes3":"?? unknown, months??","notes4":"theme: God looks at the heart; bad news?- get over it.\nSummary:God annoints David","notes6":"its all about Character.","notes7":" \t\nBut the LORD said to Samuel, \"Do not look at his appearance or at his physical stature, because I have refused him. For the LORD does not see as man sees;[fn1] for man looks at the outward appearance, but the LORD looks at the heart.\""}</data>
===

* Where did this take place (key places, how big an area?) +++
<<formTiddler ShortTextBoxTemplate2>> 
===

* When did this take place (how long a time frame?) +++
 <<formTiddler ShortTextBoxTemplate3>>
===

* What do you think is most important here? (summarize the chapter)+++
 <<formTiddler ShortTextBoxTemplate4>>
===

* Why did certain things happen? (what needs explaining?) +++
 <<formTiddler ShortTextBoxTemplate5>>
===
 
*How is this applicable to us today? +++
<<formTiddler ShortTextBoxTemplate6>>
===


Key verse is: +++
<<formTiddler ShortTextBoxTemplate7>>
===
<<openTiddlers
     text:"1Samuel 17"
     tiddlers:{{
         var key = "1Sam 17:";
         t = store.getTiddlers();
         var m = "";
         for(var i=0; i<t.length; i++) {
             if(t[i].title.search(key) != -1) {
                 m += "'" + t[i].title + "' ";
             }
         }
     }}
     closeAll:false
     keepMe:false
 >> 
	 Now  ''the  Philistines''  gathered  together  their  armies  to  battle;  and  they  were  gathered  together  at  __Socoh__,  which  belongs  to  Judah,  and  encamped  between  Socoh  and  Azekah,  in  __Ephesdammim__.	
	 ''Saul''  and  ''the  men  of  Israel''  were  gathered  together,  and  encamped  in  the  valley  of  __Elah__,  and  set  the  battle  in  array  against  the  Philistines.	
	 The  Philistines  stood  on  the  mountain  on  the  one  side,  and  Israel  stood  on  the  mountain  on  the  other  side	
	 There  went  out  a  champion  out  of  the  camp  of  the  Philistines,  named  ''Goliath'',  of  __Gath__,  whose  height  was  six  cubits  and  a  span. +++^*one cubit being 18 inches = about 9 feet tall===
	 He  had  a  helmet  of  brass  on  his  head,  and  he  was  clad  with  a  coat  of  mail;  and  the  weight  of  the  coat  was  five  thousand  shekels  of  brass.	
	 He  had  brass  shin  armor  on  his  legs,  and  a  javelin  of  brass  between  his  shoulders.	
	 The  staff  of  his  spear  was  like  a  weaver's  beam;  and  his  spear's  head  weighed  six  hundred  shekels  of  iron	
	 He  stood  and  cried  to  the  armies  of  Israel,  and  said  to  them,  "Why  have  you  come  out  to  set  your  battle  in  array?  Am  I  not  a  Philistine,  and  you  servants  to  Saul?  Choose  a  man  for  yourselves,  and  let  him  come  down  to  me.	
	 @@If  he  be  able  to  fight  with  me,  and  kill  me,  then  will  we  be  your  servants;  but  if  I  prevail  against  him,  and  kill  him,  then  you  will  be  our  servants,  and  serve  us."@@	
	  The  Philistine  said,  "I  defy  the  armies  of  Israel  this  day!  Give  me  a  man,  that  we  may  fight  together!"	
	  When  Saul  and  all  Israel  heard  those  words  of  the  Philistine,  they  were  dismayed,  and  greatly  afraid.	
	  Now  ''David''  was  the  son  of  that  Ephrathite  of  __Bethlehem__  Judah,  whose  name  was  Jesse;  and  he  had  eight  sons	
	  The  three  eldest  sons  of  Jesse  had  gone  after  Saul  to  the  battle	
	  David  was  the  youngest;  and  the  three  eldest  followed  Saul.	
	  Now  David  went  back  and  forth  from  Saul  to  feed  his  father's  sheep  at  Bethlehem.	
	  The  Philistine  drew  near  morning  and  evening,  and  presented  himself  //''forty  days''//.	
	  ''Jesse''  said  to  David  his  son,  "Now  take  for  your  brothers  an  ephah  {1  ephah  is  about  22  litres  or  about  2/3  of  a  bushel}  of  this  parched  grain,  and  these  ten  loaves,  and  carry  them  quickly  to  the  camp  to  your  brothers;	
	  and  bring  these  ten  cheeses  to  the  captain  of  their  thousand,  and  see  how  your  brothers  are  doing,  and  bring  back  news."	
	  Now  Saul,  and  they,  and  all  the  men  of  Israel,  were  in  the  valley  of  Elah,  @@fighting  with  the  Philistines@@.	+++^* I thought it was just 40 days of waiting around and being verbally abused??===
	  David  rose  up  //''early  in  the  morning''//,  and  left  the  sheep  with  a  keeper,  and  took,  and  went,  as  Jesse  had  commanded  him;  and  he  came  to  __the  place  of  the  wagons__,  as  the  army  which  was  going  forth  to  the  fight  shouted  for  the  battle.	
	  Israel  and  the  Philistines  put  the  battle  in  array,  army  against  army.	
	  David  left  his  baggage  in  the  hand  of  the  keeper  of  the  baggage,  and  ran  to  the  army,  and  came  and  greeted  his  brothers.	
	  As  he  talked  with  them,  behold,  there  came  up  the  champion,  the  Philistine  of  Gath,  Goliath  by  name,  out  of  the  ranks  of  the  Philistines,  and  spoke  according  to  the  same  words	
	  All  the  men  of  Israel,  when  they  saw  the  man,  fled  from  him,  and  were  terrified.	
	  The  men  of  Israel  said,  "Have  you  seen  this  man  who  has  come  up?  He  has  surely  come  up  to  defy  Israel.  It  shall  be,  that  the  man  who  kills  him,  the  king  will  enrich  him  with  great  riches,  and  will  give  him  his  daughter,  and  make  his  father's  house  free  in  Israel."	
	  David  spoke  to  the  men  who  stood  by  him,  saying,  "What  shall  be  done  to  the  man  who  kills  this  Philistine,  and  takes  away  the  reproach  from  Israel?  For  @@who  is  this  uncircumcised  Philistine,  that  he  should  defy  the  armies  of  the  living  God?"	@@
	  The  people  answered  him  in  this  way,  saying,  "So  shall  it  be  done  to  the  man  who  kills  him."	
	  ''Eliab''  his  eldest  brother  heard  when  he  spoke  to  the  men;  and  Eliab's  anger  was  kindled  against  David,  and  he  said,  "Why  have  you  come  down?  With  whom  have  you  left  those  few  sheep  in  the  wilderness?  I  know  your  pride,  and  the  naughtiness  of  your  heart;  for  you  have  come  down  that  you  might  see  the  battle."	+++^* What's his problem? +++^* Is Eliab thinking back to David's annointing or is it just a brother thing?=== ===
	  David  said,  "What  have  I  now  done?  Is  there  not  a  cause?"	
	  He  turned  away  from  him  toward  another,  and  spoke  like  that  again;  and  the  people  answered  him  again  the  same  way.	
	  When  the  words  were  heard  which  David  spoke,  they  rehearsed  them  before  Saul;  and  he  sent  for  him.	
	  @@David  said  to  Saul,  "Let  no  man's  heart  fail  because  of  him.  Your  servant  will  go  and  fight  with  this  Philistine."@@	
	  Saul  said  to  David,  "You  are  not  able  to  go  against  this  Philistine  to  fight  with  him;  for  you  are  but  a  youth,  and  he  a  man  of  war  from  his  youth."	
	  David  said  to  Saul,  "Your  servant  was  keeping  his  father's  sheep;  and  when  a  lion  or  a  bear  came,  and  took  a  lamb  out  of  the  flock,	
	  I  went  out  after  him,  and  struck  him,  and  rescued  it  out  of  his  mouth.  When  he  arose  against  me,  I  caught  him  by  his  beard,  and  struck  him,  and  killed  him.	
	  Your  servant  struck  both  the  lion  and  the  bear.  This  uncircumcised  Philistine  shall  be  as  one  of  them,  since  he  has  defied  the  armies  of  the  living  God."	
	  David  said,  "Yahweh  who  delivered  me  out  of  the  paw  of  the  lion,  and  out  of  the  paw  of  the  bear,  he  will  deliver  me  out  of  the  hand  of  this  Philistine."  Saul  said  to  David,  "Go;  and  Yahweh  shall  be  with  you."	
	  Saul  dressed  David  with  his  clothing.  He  put  a  helmet  of  brass  on  his  head,  and  he  clad  him  with  a  coat  of  mail.	
	  David  strapped  his  sword  on  his  clothing,  and  he  tried  to  move;  for  he  had  not  tested  it.  David  said  to  Saul,  "I  can't  go  with  these;  for  I  have  not  tested  them." +++^*trivia question: what movie refers back to this (sort of)? +++^* the Ghost and the Darkness=== === David  took  them  off.	+++^* what's the application here?===
	  He  took  his  staff  in  his  hand,  and  chose  for  himself  five  smooth  stones +++^*why five? +++^* Goliath had four brothers (not sure where I got that from...=== === out  of  the  brook,  and  put  them  in  the  shepherd's  bag  which  he  had,  even  in  his  wallet.  His  sling  was  in  his  hand;  and  he  drew  near  to  the  Philistine.	
	  The  Philistine  came  on  and  drew  near  to  David;  and  the  man  who  bore  the  shield  went  before  him.	
	  When  the  Philistine  looked  about,  and  saw  David,  he  disdained  him;  for  he  was  but  a  youth,  and  ruddy,  and  withal  of  a  fair  face.	
	  The  Philistine  said  to  David,  "Am  I  a  dog,  that  you  come  to  me  with  sticks?"  The  Philistine  cursed  David  by  his  gods.	
	  The  Philistine  said  to  David,  "Come  to  me,  and  I  will  give  your  flesh  to  the  birds  of  the  sky,  and  to  the  animals  of  the  field."	
	  Then  David  said  to  the  Philistine,  "You  come  to  me  with  a  sword,  and  with  a  spear,  and  with  a  javelin	
	  @@Today,  Yahweh  will  deliver  you  into  my  hand.  I  will  strike  you,  and  take  your  head  from  off  you.  I  will  give  the  dead  bodies  of  the  army  of  the  Philistines  this  day  to  the  birds  of  the  sky,  and  to  the  wild  animals  of  the  earth;  that  all  the  earth  may  know  that  there  is  a  God  in  Israel,@@	
	  @@and  that  all  this  assembly  may  know  that  Yahweh  doesn't  save  with  sword  and  spear	@@ +++^* you'd think the Jews of Christs time would remember that line... (why?) +++^* they wanted a conquering messiah to get rid of the Romans by force === ===
	  It  happened,  when  the  Philistine  arose,  and  came  and  drew  near  to  meet  David,  that  David  hurried,  and  ran  toward  the  army  to  meet  the  Philistine.	
	  David  put  his  hand  in  his  bag,  took  a  stone,  and  slung  it,  and  struck  the  Philistine  in  his  forehead;  and  the  stone  sank  into  his  forehead,  and  he  fell  on  his  face  to  the  earth.	
	  So  David  prevailed  over  the  Philistine  with  a  sling  and  with  a  stone,  and  struck  the  Philistine,  and  killed  him;  but  there  was  no  sword  in  the  hand  of  David.	
	  Then  David  ran,  and  stood  over  the  Philistine,  and  took  his  sword,  and  drew  it  out  of  its  sheath,  and  killed  him,  and  cut  off  his  head  therewith.  When  the  Philistines  saw  that  their  champion  was  dead,  they  fled.	
	  The  men  of  Israel  and  of  Judah  arose,  and  shouted,  and  pursued  the  Philistines,  until  you  come  to  __Gai__,  and  to  __the  gates  of  Ekron__.  The  wounded  of  the  Philistines  fell  down  by  the  way  to  __Shaaraim__,  even  to  __Gath__,  and  to  __Ekron__.	
	  The  children  of  Israel  returned  from  chasing  after  the  Philistines,  and  they  plundered  their  camp.	
	  David  took  the  head  of  the  Philistine,  and  brought  it  to  __Jerusalem__;  but  he  put  his  armor  in  his  tent.	
	  When  Saul  saw  David  go  forth  against  the  Philistine,  he  said  to  ''Abner'',  the  captain  of  the  army,  "Abner,  whose  son  is  this  youth?" +++^* did he really not know?=== Abner  said,  "As  your  soul  lives,  O  king,  I  can't  tell."	
	  The  king  said,  "Inquire  whose  son  the  young  man  is!"	
	  As  David  returned  from  the  slaughter  of  the  Philistine,  Abner  took  him,  and  brought  him  before  Saul  with  the  head  of  the  Philistine  in  his  hand.	
	  Saul  said  to  him,  "Whose  son  are  you,  you  young  man?"  David  answered,  "I  am  the  son  of  your  servant  Jesse  the  Bethlehemite."	
* who were the Key people(s) involved? +++
<<formTiddler ShortTextBoxTemplate1>><data>{"notes":"\nDavid, Saul, Goliath, Jesse, Eliab, Abner","notes2":"15 miles w of Bethlehem, Jerusalem","notes3":"40 days","notes4":"theme:the battle is the Lord's\nSummary:David kills Goliath","notes6":"Align yourself with God - it doesn't matter how big the task is. \n Have faith (look how positive David was)","notes7":"verse 47"}</data>
===

* Where did this take place (key places, how big an area?) +++
<<formTiddler ShortTextBoxTemplate2>> 
===

* When did this take place (how long a time frame?) +++
 <<formTiddler ShortTextBoxTemplate3>>
===

* What do you think is most important here? (summarize the chapter)+++
 <<formTiddler ShortTextBoxTemplate4>>
===

* Why did certain things happen? (what needs explaining?) +++
 <<formTiddler ShortTextBoxTemplate5>>
===
 
*How is this applicable to us today? +++
<<formTiddler ShortTextBoxTemplate6>>
===


Key verse is: +++
<<formTiddler ShortTextBoxTemplate7>>
===
<<openTiddlers
     text:"1Samuel 18"
     tiddlers:{{
         var key = "1Sam 18:";
         t = store.getTiddlers();
         var m = "";
         for(var i=0; i<t.length; i++) {
             if(t[i].title.search(key) != -1) {
                 m += "'" + t[i].title + "' ";
             }
         }
     }}
     closeAll:false
     keepMe:false
 >> 
	 It  happened,  when  he  had  made  an  end  of  speaking  to  ''Saul'',  that  the  soul  of  ''Jonathan''  was  knit  with  the  soul  of  ''David'',  and  Jonathan  loved  him  as  his  own  soul. +++^* I guess they were "kindred spirits" as Anne of Green Gables would say===
	 Saul  took  him  that  day,  and  would  let  him  go  no  more  home  to  his  father's  house.	
	 Then  Jonathan  and  David  made  a  covenant,  because  he  loved  him  as  his  own  soul.	
	 Jonathan  stripped  himself  of  the  robe  that  was  on  him,  and  gave  it  to  David,  and  his  clothing,  even  to  his  sword,  and  to  his  bow,  and  to  his  sash.	
	 David  went  out  wherever  Saul  sent  him,  and  behaved  himself  wisely	
	 It  happened  as  they  came,  when  David  returned  from  the  slaughter  of  the  Philistine,  that  the  women  came  out  of  all  the  cities  of  Israel,  singing  and  dancing,  to  meet  king  Saul,  with  tambourines,  with  joy,  and  with  instruments  of  music.	
	 The  women  sang  one  to  another  as  they  played,  and  said,  "Saul  has  slain  his  thousands,  David  his  ten  thousands."	
	 Saul  was  very  angry,  and  this  saying  displeased  him;  and  he  said,  "They  have  ascribed  to  David  ten  thousands,  and  to  me  they  have  ascribed  but  thousands.  What  can  he  have  more  but  the  kingdom?"	
	 Saul  eyed  David  from  that  day  and  forward.	
	  It  happened  on  //''the  next  day''//,  that  an  evil  spirit  from  God  came  mightily  on  Saul,  and  he  prophesied  in  the  midst  of  the  house. +++^*What do you suppose he prophesied about? +++^*he probably spilled the beans about David's annointing - is it really true "prophesying" if its old news?=== === David  played  with  his  hand,  as  he  did  day  by  day.  Saul  had  his  spear  in  his  hand;	
	  and  Saul  threw  the  spear;  for  he  said,  "I  will  pin  David  even  to  the  wall!"  David  escaped  from  his  presence  twice.	+++^* why twice? ===
	  Saul  was  afraid  of  David,  because  Yahweh  was  with  him,  and  was  departed  from  Saul.	
	  Therefore  Saul  removed  him  from  him,  and  made  him  his  captain  over  a  thousand; +++^* what?? is that the evil spirit srewing up his senses?+++^* see a few verses down - he must have hoped he'd screw up before the people +++^* kind of a minor version of what David would do later with Uriah=== === === and  he  went  out  and  came  in  before  the  people.	
	  @@David  behaved  himself  wisely  in  all  his  ways;  and  Yahweh  was  with  him.@@	
	  When  Saul  saw  that  he  behaved  himself  very  wisely,  he  stood  in  awe  of  him.	
	  But  all  Israel  and  Judah  loved  David;  for  he  went  out  and  came  in  before  them.	
	  Saul  said  to  David,  "Behold,  my  elder  daughter  Merab,  I  will  give  her  to  you  as  wife.  Only  be  valiant  for  me,  and  fight  Yahweh's  battles."  For  Saul  said,  "Don't  let  my  hand  be  on  him,  but  let  the  hand  of  the  Philistines  be  on  him."	
	  David  said  to  Saul,  "Who  am  I,  and  what  is  my  life,  or  my  father's  family  in  Israel,  that  I  should  be  son-in-law  to  the  king?"	
	  But  it  happened  at  the  time  when  Merab,  Saul's  daughter,  should  have  been  given  to  David,  that  she  was  given  to  Adriel  the  Meholathite  as  wife.	
	  Michal,  Saul's  daughter,  loved  David;  and  they  told  Saul,  and  the  thing  pleased  him.	
	  Saul  said,  I  will  give  her  to  him,  that  she  may  be  a  snare  to  him,  and  that  the  hand  of  the  Philistines  may  be  against  him.  Therefore  Saul  said  to  David,  "You  shall  this  day  be  my  son-in-law  a  second  time."	
	  Saul  commanded  his  servants,  "Talk  with  David  secretly,  and  say,  'Behold,  the  king  has  delight  in  you,  and  all  his  servants  love  you	
	  Saul's  servants  spoke  those  words  in  the  ears  of  David.  David  said,  "Does  it  seems  to  you  a  light  thing  to  be  the  king's  son-in-law,  since  I  am  a  poor  man,  and  lightly  esteemed?"	
	  The  servants  of  Saul  told  him,  saying,  "David  spoke  like  this."	
	  Saul  said,  "You  shall  tell  David,  'The  king  desires  no  dowry  except  one  hundred  foreskins  of  the  Philistines,  to  be  avenged  of  the  king's  enemies.'"  Now  Saul  thought  to  make  David  fall  by  the  hand  of  the  Philistines.	
	  When  his  servants  told  David  these  words,  it  pleased  David  well  to  be  the  king's  son-in-law.  The  days  were  not  expired;	
	  and  David  arose  and  went,  he  and  his  men,  and  killed  of  the  Philistines  two  hundred  men;  and  David  brought  their  foreskins,  and  they  gave  them  in  full  number  to  the  king,  that  he  might  be  the  king's  son-in-law.  Saul  gave  him  Michal  his  daughter  as  wife.	
	  Saul  saw  and  knew  that  Yahweh  was  with  David;  and  Michal,  Saul's  daughter,  loved  him.	
	  Saul  was  yet  the  more  afraid  of  David;  and  Saul  was  David's  enemy  continually.	
	  Then  the  princes  of  the  Philistines  went  forth	
* who were the Key people(s) involved? +++
<<formTiddler ShortTextBoxTemplate1>><data>{"notes":"Jonathan, Saul, David, Michal, \n","notes2":"a small area (Gibeah? Gilgal?) (Where-ever Saul was)","notes3":"? weeks to months?","notes4":"theme:As long as you're in God's will you'll be successful (eventually)\nsummary:Saul tries to get David killed but David is too successful (ends up with a son-in law instead)","notes7":"14","notes5":"the whole multiple wives thing. E.g. how God used all the wives of Jacob (Isreal)","notes6":"Keep walking within Gods will, even if its easier on the short run to stray for short term gain"}</data>
===

* Where did this take place (key places, how big an area?) +++
<<formTiddler ShortTextBoxTemplate2>> 
===

* When did this take place (how long a time frame?) +++
 <<formTiddler ShortTextBoxTemplate3>>
===

* What do you think is most important here? (summarize the chapter)+++
 <<formTiddler ShortTextBoxTemplate4>>
===

* Why did certain things happen? (what needs explaining?) +++
 <<formTiddler ShortTextBoxTemplate5>>
===
 
*How is this applicable to us today? +++
<<formTiddler ShortTextBoxTemplate6>>
===


Key verse is: +++
<<formTiddler ShortTextBoxTemplate7>>
===
<<openTiddlers
     text:"1Samuel 19"
     tiddlers:{{
         var key = "1Sam 19:";
         t = store.getTiddlers();
         var m = "";
         for(var i=0; i<t.length; i++) {
             if(t[i].title.search(key) != -1) {
                 m += "'" + t[i].title + "' ";
             }
         }
     }}
     closeAll:false
     keepMe:false
 >> 
	 ''Saul''  spoke  to  ''Jonathan''  his  son,  and  to  all  his  servants,  that  they  should  kill  ''David''.  But  Jonathan,  Saul's  son,  delighted  much  in  David.	
	 Jonathan  told  David,  saying,  "Saul  my  father  seeks  to  kill  you.  Now  therefore,  @@please  take  care  of  yourself  in  the  morning,  and  live  in  a  secret  place,  and  hide  yourself.	@@
	 I  will  go  out  and  stand  beside  my  father  in  the  field  where  you  are,  and  I  will  talk  with  my  father  about  you;  and  if  I  see  anything,  I  will  tell  you."	+++^* what does that mean? ===
	 Jonathan  spoke  good  of  David  to  Saul  his  father,  and  said  to  him,  "Don't  let  the  __''king''__  ''__sin__''  against  his  servant,  against  David;  because  he  has  not  __''sinned''__  against  you,  and  because  his  works  have  been  very  good  toward  you;	
	 for  he  put  his  life  in  his  hand,  and  struck  the  Philistine,  and  ''Yahweh''  worked  a  great  victory  for  all  Israel.  You  saw  it,  and  rejoiced.  Why  then  will  you  __''sin''__  against  innocent  blood,  to  kill  David  without  a  cause?"	
	 Saul  listened  to  the  voice  of  Jonathan	
	 Jonathan  called  David,  and  Jonathan  showed  him  all  those  things.  Jonathan  brought  David  to  Saul,  and  he  was  in  his  presence,  as  before.	
	 There  was  war  again.  David  went  out,  and  fought  with  the  ''Philistines'',  and  killed  them  with  a  great  slaughter;  and  they  fled  before  him.	
	 An  evil  spirit  from  Yahweh  was  on  Saul,  as  he  sat  in  his  house  with  his  spear  in  his  hand;+++^* you'd think that he'd learn not to go in when Saul had his spear in his hand === and  David  was  playing  with  his  hand.	
	  Saul  sought  to  pin  David  even  to  the  wall  with  the  spear;  but  he  slipped  away  out  of  Saul's  presence,  and  he  stuck  the  spear  into  the  wall.  David  fled,  and  escaped  that  night.	
	  Saul  sent  messengers  to  David's  house,  to  watch  him,  and  to  kill  him  in  the  morning.  ''Michal''+++^* pronounced me·käl'===,  David's  wife,  told  him,  saying,  "If  you  don't  save  your  life  tonight,  tomorrow  you  will  be  killed."	
	  So  Michal  let  David  down  through  the  window.  He  went,  fled,  and  escaped.	
	  Michal  took  the  teraphim,  and  laid  it  in  the  bed,  and  put  a  pillow  of  goats'  hair  at  its  head,  and  covered  it  with  the  clothes.	
	  When  Saul  sent  messengers  to  take  David,  she  said,  "He  is  sick."	
	  Saul  sent  the  messengers  to  see  David,  saying,  "Bring  him  up  to  me  in  the  bed,  that  I  may  kill  him."	
	  When  the  messengers  came  in,  behold,  the  teraphim  was  in  the  bed,  with  the  pillow  of  goats'  hair  at  its  head.	
	  Saul  said  to  Michal,  "Why  have  you  deceived  me  thus,  and  let  my  enemy  go,  so  that  he  is  escaped?"  Michal  answered  Saul,  "He  said  to  me,  'Let  me  go!  Why  should  I  kill  you?'"	+++^* like father, like daughter!===
	  Now  David  fled,  and  escaped,  and  came  to  ''Samuel''  to  __Ramah__,  and  told  him  all  that  Saul  had  done  to  him.  @@He and Samuel went and lived in __Naioth__.@@+++

 Naioth [EBD]

dwellings, the name given to the prophetical college established by Samuel near Ramah. It consisted of a cluster of separate dwellings, and hence its name. David took refuge here when he fled from Saul (1 Sam. 19:18, 19, 22, 23), and here he passed a few weeks in peace (comp. Ps. 11). It was probably the common residence of the "sons of the prophets." ===
	  It  was  told  Saul,  saying,  "Behold,  David  is  at  Naioth  in  Ramah."	
	  Saul  sent  messengers  to  take  David	
<<<
NASB: Then Saul sent messengers to take David, but when they saw the company of the prophets prophesying, with Samuel standing  and presiding over them, the Spirit of God came upon the messengers of Saul; and they also prophesied.
<<<
	  When  it  was  told  Saul,  he  sent  other  messengers,  and  they  also  prophesied.  Saul  sent  messengers  again  the  third  time,  and  they  also  prophesied.	
	  Then  went  he  also  to  __Ramah__,  and  came  to  the  great  well  that  is  in  __Secu__	
	  He  went  there  to  Naioth  in  Ramah.  @@Then  the  Spirit  of  God  came  on  him  also,@@  and  he  went  on,  and  prophesied,  until  he  came  to  Naioth  in  Ramah.	
	  @@He  also  stripped  off  his  clothes,  and  he  also  prophesied  before  Samuel,  and  lay  down  naked  all  that  day  and  all  that  night.  Therefore  they  say,  "Is  Saul  also  among  the  prophets?"	@@
* who were the Key people(s) involved? +++
<<formTiddler ShortTextBoxTemplate1>><data>{"notes":"\nSaul, Jonathan, Michal, soldiers, David, Samuel, God","notes2":"RAmah , Gilgal(pretty sure),Naioth, a field","notes4":"summary: God keeps providing a way for David to escape Saul's wrath\ntheme: contentment, obedience and patience","notes5":"the whole evil spirit thing...see 1Sam 18:10 (jealousy and fear)","notes6":"we should be obedient to God, (fear of the Lord), trust God and be \npatient in all circumstances (think of David)","notes7":"verse 20?"}</data>
===

* Where did this take place (key places, how big an area?) +++
<<formTiddler ShortTextBoxTemplate2>> 
===

* When did this take place (how long a time frame?) +++
 <<formTiddler ShortTextBoxTemplate3>>
===

* What do you think is most important here? (summarize the chapter)+++
 <<formTiddler ShortTextBoxTemplate4>>
===

* Why did certain things happen? (what needs explaining?) +++
 <<formTiddler ShortTextBoxTemplate5>>
===
 
*How is this applicable to us today? +++
<<formTiddler ShortTextBoxTemplate6>>
===


Key verse is: +++
<<formTiddler ShortTextBoxTemplate7>>
===
	Now  there  was  a  certain  man  of  Ramathaim  Zophim,  of  the  hill  country  of  Ephraim,  and  his  name  was  Elkanah,  the  son  of  Jeroham,  the  son  of  Elihu,  the  son  of  Tohu,  the  son  of  Zuph,  an  Ephraimite	
	 She  was  in  bitterness  of  soul,  and  prayed  to  Yahweh,  and  wept  bitterly.	
	 She  vowed  a  vow,  and  said,  "Yahweh  of  Armies,  if  you  will  indeed  look  on  the  affliction  of  your  handmaid,  and  remember  me,  and  not  forget  your  handmaid,  but  will  give  to  your  handmaid  a  boy,  then  I  will  give  him  to  Yahweh  all  the  days  of  his  life,  and  no  razor  shall  come  on  his  head."	
	 It  happened,  as  she  continued  praying  before  Yahweh,  that  Eli  saw  her  mouth.	
	 Now  Hannah  spoke  in  her  heart.  Only  her  lips  moved,  but  her  voice  was  not  heard.  Therefore  Eli  thought  she  had  been  drunken.	
	 Eli  said  to  her,  "How  long  will  you  be  drunken?  Put  away  your  wine  from  you."	
	 Hannah  answered,  "No,  my  lord,  I  am  a  woman  of  a  sorrowful  spirit.  I  have  drunk  neither  wine  nor  strong  drink,  but  I  poured  out  my  soul  before  Yahweh.	
	 Don't  count  your  handmaid  for  a  wicked  woman;  for  I  have  been  speaking  out  of  the  abundance  of  my  complaint  and  my  provocation."	
	 Then  Eli  answered,  "Go  in  peace;  and  may  the  God  {The  Hebrew  word  rendered  "God"  is  "Elohim."}  of  Israel  grant  your  petition  that  you  have  asked  of  him."	
	 She  said,  "Let  your  handmaid  find  favor  in  your  sight."  So  the  woman  went  her  way,  and  ate;  and  her  facial  expression  wasn't  sad  any  more.	
	 They  rose  up  in  the  morning  early,  and  worshiped  before  Yahweh,  and  returned,  and  came  to  their  house  to  Ramah	
	and  he  had  two  wives;  the  name  of  the  one  was  Hannah,  and  the  name  of  other  Peninnah	
	 It  happened,  when  the  time  had  come,  that  Hannah  conceived,  and  bore  a  son;  and  she  named  him  Samuel,  {Samuel  sounds  like  the  Hebrew  for  "heard  by  God."}  saying,  "Because  I  have  asked  him  of  Yahweh."	
	 The  man  Elkanah,  and  all  his  house,  went  up  to  offer  to  Yahweh  the  yearly  sacrifice,  and  his  vow.	
	 But  Hannah  didn't  go  up;  for  she  said  to  her  husband,  "Not  until  the  child  is  weaned;  then  I  will  bring  him,  that  he  may  appear  before  Yahweh,  and  stay  there  forever."	
	 Elkanah  her  husband  said  to  her,  "Do  what  seems  good  to  you.  Wait  until  you  have  weaned  him;  only  may  Yahweh  establish  his  word."  So  the  woman  waited  and  nursed  her  son,  until  she  weaned  him.	
	 When  she  had  weaned  him,  she  took  him  up  with  her,  with  three  bulls,  and  one  ephah  {1  ephah  is  about  22  litres  or  about  2/3  of  a  bushel}  of  meal,  and  a  bottle  of  wine,  and  brought  him  to  Yahweh's  house  in  Shiloh.  The  child  was  young.	
	 They  killed  the  bull,  and  brought  the  child  to  Eli.	
	 She  said,  "Oh,  my  lord,  as  your  soul  lives,  my  lord,  I  am  the  woman  who  stood  by  you  here,  praying  to  Yahweh.	
	 For  this  child  I  prayed;  and  Yahweh  has  given  me  my  petition  which  I  asked  of  him.	
	 Therefore  also  I  have  granted  him  to  Yahweh.  As  long  as  he  lives  he  is  granted  to  Yahweh."  He  worshiped  Yahweh  there.	
	This  man  went  up  out  of  his  city  from  year  to  year  to  worship  and  to  sacrifice  to  Yahweh  {"Yahweh"  is  God's  proper  Name,  sometimes  rendered  "LORD"  (all  caps)  in  other  translations.}  of  Armies  in  Shiloh.  The  two  sons  of  Eli,  Hophni  and  Phinehas,  priests  to  Yahweh,  were  there.	
	When  the  day  came  that  Elkanah  sacrificed,  he  gave  to  Peninnah  his  wife,  and  to  all  her  sons  and  her  daughters,  portions	
	but  to  Hannah  he  gave  a  double  portion;  for  he  loved  Hannah,  but  Yahweh  had  shut  up  her  womb.	
	Her  rival  provoked  her  severely,  to  make  her  fret,  because  Yahweh  had  shut  up  her  womb.	
	As  he  did  so  year  by  year,  when  she  went  up  to  the  house  of  Yahweh,  so  she  provoked  her;  therefore  she  wept,  and  didn't  eat.	
	Elkanah  her  husband  said  to  her,  "Hannah,  why  do  you  weep?  Why  don't  you  eat?  Why  is  your  heart  grieved?  Am  I  not  better  to  you  than  ten  sons?"	
	So  Hannah  rose  up  after  they  had  eaten  in  Shiloh,  and  after  they  had  drunk.  Now  Eli  the  priest  was  sitting  on  his  seat  by  the  doorpost  of  the  temple  of  Yahweh.	
<<openTiddlers
     text:"1Samuel 20"
     tiddlers:{{
         var key = "1Sam 20:";
         t = store.getTiddlers();
         var m = "";
         for(var i=0; i<t.length; i++) {
             if(t[i].title.search(key) != -1) {
                 m += "'" + t[i].title + "' ";
             }
         }
     }}
     closeAll:false
     keepMe:false
 >> 
	 ''David''  fled  from  __Naioth  in  Ramah__,  and  came  and  said  before  ''Jonathan'',  "What  have  I  done?  What  is  my  iniquity?  What  is  my  sin  before  your  father,  that  he  seeks  my  life?"	
	 He  said  to  him,  "Far  from  it;  you  shall  not  die.  Behold,  my  father  does  nothing  either  great  or  small,  but  that  he  discloses  it  to  me;+++^* is that actually true?===  and  why  should  my  father  hide  this  thing  from  me?  It  is  not  so."	
	 David  swore  moreover,  and  said,  "Your  father  knows  well  that  I  have  found  favor  in  your  eyes;  and  he  says,  'Don't  let  Jonathan  know  this,  lest  he  be  grieved	
	 Then  Jonathan  said  to  David,  "Whatever  your  soul  desires,  I  will  even  do  it  for  you."	
	 David  said  to  Jonathan,  "Behold,  tomorrow  is  the  new  moon,  and  I  should  not  fail  to  dine  with  the  king;  but  let  me  go,  that  I  may  hide  myself  in  the  field  to  the  third  day  at  evening.	
	 If  your  father  miss  me  at  all,  then  say,  'David  earnestly  asked  leave  of  me  that  he  might  run  to  Bethlehem  his  city;  for  it  is  the  yearly  sacrifice  there  for  all  the  family.'	
	 If  he  says,  'It  is  well;'  your  servant  shall  have  peace	
	 Therefore  deal  kindly  with  your  servant;  for  you  have  brought  your  servant  into  a  covenant  of  Yahweh  with  you	
	 Jonathan  said,  "Far  be  it  from  you;  for  if  I  should  at  all  know  that  evil  were  determined  by  my  father  to  come  on  you,  then  wouldn't  I  tell  you  that?"	
	  Then  David  said  to  Jonathan,  "Who  shall  tell  me  if  perchance  your  father  answers  you  roughly?"	
	  Jonathan  said  to  David,  "Come,  and  let  us  go  out  into  the  field."  They  both  went  out  into  the  field.	
	  Jonathan  said  to  David,  "By  Yahweh,  the  God  of  Israel,  when  I  have  sounded  my  father  about  this  time  tomorrow,  or  the  third  day,  behold,  if  there  is  good  toward  David,  shall  I  not  then  send  to  you,  and  disclose  it  to  you?	
	  Yahweh  do  so  to  Jonathan,  and  more  also,  should  it  please  my  father  to  do  you  evil,  if  I  don't  disclose  it  to  you,  and  send  you  away,  that  you  may  go  in  peace	
	  You  shall  not  only  while  yet  I  live  show  me  the  loving  kindness  of  Yahweh,  that  I  not  die;	
	  but  also  you  shall  not  cut  off  your  kindness  from  my  house  forever;  no,  not  when  Yahweh  has  cut  off  the  enemies  of  David  everyone  from  the  surface  of  the  earth."	
	  So  Jonathan  made  a  covenant  with  the  house  of  David,  saying,  "Yahweh  will  require  it  at  the  hand  of  David's  enemies."	
	  Jonathan  caused  David  to  swear  again,  for  the  love  that  he  had  to  him;  for  he  loved  him  as  he  loved  his  own  soul.	
	  Then  Jonathan  said  to  him,  "Tomorrow  is  the  new  moon	
	  When  you  have  stayed  three  days,  you  shall  go  down  quickly,  and  come  to  the  place  where  you  hid  yourself  when  this  started,  and  shall  remain  by  the  stone  Ezel.	
	  I  will  shoot  three  arrows  on  its  side,  as  though  I  shot  at  a  mark.	
	  Behold,  I  will  send  the  boy,  saying,  'Go,  find  the  arrows!'  If  I  tell  the  boy,  'Behold,  the  arrows  are  on  this  side  of  you.  Take  them;'  then  come;  for  there  is  peace  to  you  and  no  hurt,  as  Yahweh  lives.	
	  But  if  I  say  this  to  the  boy,  'Behold,  the  arrows  are  beyond  you;'  then  go  your  way;  for  Yahweh  has  sent  you  away.	
	  Concerning  the  matter  which  you  and  I  have  spoken  of,  behold,  Yahweh  is  between  you  and  me  forever."	
	  So  David  hid  himself  in  the  field	
	  The  king  sat  on  his  seat,  as  at  other  times,  even  on  the  seat  by  the  wall;  and  Jonathan  stood  up,  and  Abner  sat  by  Saul's  side	
	  Nevertheless  Saul  didn't  say  anything  that  day	
	  It  happened  on  the  next  day  after  the  new  moon,  the  second  day,  that  David's  place  was  empty.  Saul  said  to  Jonathan  his  son,  "Why  doesn't  the  son  of  Jesse  come  to  eat,  neither  yesterday,  nor  today?"	
	  Jonathan  answered  Saul,  "David  earnestly  asked  leave  of  me  to  go  to  Bethlehem.	
	  He  said,  'Please  let  me  go,  for  our  family  has  a  sacrifice  in  the  city.  My  brother  has  commanded  me  to  be  there.  Now,  if  I  have  found  favor  in  your  eyes,  please  let  me  go  away  and  see  my  brothers.'  Therefore  he  has  not  come  to  the  king's  table."	
	  Then  Saul's  anger  was  kindled  against  Jonathan,  and  he  said  to  him,  "You  son  of  a  perverse  rebellious  woman,  don't  I  know  that  you  have  chosen  the  son  of  Jesse  to  your  own  shame,  and  to  the  shame  of  your  mother's  nakedness?	
	  For  as  long  as  the  son  of  Jesse  lives  on  the  earth,  you  shall  not  be  established,  nor  your  kingdom.  Therefore  now  send  and  bring  him  to  me,  for  he  shall  surely  die!"	
	  Jonathan  answered  Saul  his  father,  and  said  to  him,  "Why  should  he  be  put  to  death?  What  has  he  done?"	
	  Saul  cast  his  spear  at  him  to  strike  him.  By  this  Jonathan  knew  that  his  father  was  determined  to  put  David  to  death.	
	  So  Jonathan  arose  from  the  table  in  fierce  anger,  and  ate  no  food  the  second  day  of  the  month;  for  he  was  grieved  for  David,  because  his  father  had  done  him  shame.	
	  It  happened  in  the  morning,  that  Jonathan  went  out  into  the  field  at  the  time  appointed  with  David,  and  a  little  boy  with  him.	
	  He  said  to  his  boy,  "Run,  find  now  the  arrows  which  I  shoot."  As  the  boy  ran,  he  shot  an  arrow  beyond  him.	
	  When  the  boy  had  come  to  the  place  of  the  arrow  which  Jonathan  had  shot,  Jonathan  cried  after  the  boy,  and  said,  "Isn't  the  arrow  beyond  you?"	
	  Jonathan  cried  after  the  boy,  "Go  fast!  Hurry!  Don't  delay!"  Jonathan's  boy  gathered  up  the  arrows,  and  came  to  his  master.	
	  But  the  boy  didn't  know  anything.  Only  Jonathan  and  David  knew  the  matter.	
	  Jonathan  gave  his  weapons  to  his  boy,  and  said  to  him,  "Go,  carry  them  to  the  city."	
	  As  soon  as  the  boy  was  gone,  David  arose  out  of  the  south,  and  fell  on  his  face  to  the  ground,  and  bowed  himself  three  times.  They  kissed  one  another,  and  wept  one  with  another,  and  David  wept  the  most.	
	  Jonathan  said  to  David,  "Go  in  peace,  because  we  have  both  sworn  in  the  name  of  Yahweh,  saying,  'Yahweh  shall  be  between  me  and  you,  and  between  my  seed  and  your  seed,  forever.'"  He  arose  and  departed;  and  Jonathan  went  into  the  city.	
* who were the Key people(s) involved? +++
<<formTiddler ShortTextBoxTemplate1>><data>{"notes":"Jonathan, David, Saul, the arrow boy,\n","notes2":"Gibeah?","notes3":"few days","notes4":"summary: Jonathan sees the true Saul, David on the run.this time you see why his \"heart was after Gods\"\ntheme: friendship loyalty, the bitterness of truth, being aligned with God\n","notes6":"Our rough patches are tests of our relationship with God, for loyalty, etc\n(this annointed king put on a path of turmoil)","notes7":"42?"}</data>
===

* Where did this take place (key places, how big an area?) +++
<<formTiddler ShortTextBoxTemplate2>> 
===

* When did this take place (how long a time frame?) +++
 <<formTiddler ShortTextBoxTemplate3>>
===

* What do you think is most important here? (summarize the chapter)+++
 <<formTiddler ShortTextBoxTemplate4>>
===

* Why did certain things happen? (what needs explaining?) +++
 <<formTiddler ShortTextBoxTemplate5>>
===
 
*How is this applicable to us today? +++
<<formTiddler ShortTextBoxTemplate6>>
===


Key verse is: +++
<<formTiddler ShortTextBoxTemplate7>>
===
<<openTiddlers
     text:"1Samuel 21"
     tiddlers:{{
         var key = "1Sam 21:";
         t = store.getTiddlers();
         var m = "";
         for(var i=0; i<t.length; i++) {
             if(t[i].title.search(key) != -1) {
                 m += "'" + t[i].title + "' ";
             }
         }
     }}
     closeAll:false
     keepMe:false
 >> 
* who were the Key people(s) involved? +++
<<formTiddler ShortTextBoxTemplate1>><data>{"notes":"David, Ahimilech, Saul, Doeg, king Achish,\n","notes2":"Gath, Nob, Gibeah, Moab, (Judah),","notes3":"? week ish","notes4":"theme: Saul's instability\nsummary: David getting established in hiding, with beginnings of army, Saul kills innocents, cutting ties to Saul's reign ","notes6":"take responsibility","notes7":"1Sam 22:22&23"}</data>
===

* Where did this take place (key places, how big an area?) +++
<<formTiddler ShortTextBoxTemplate2>> 
===

* When did this take place (how long a time frame?) +++
 <<formTiddler ShortTextBoxTemplate3>>
===

* What do you think is most important here? (summarize the chapter)+++
 <<formTiddler ShortTextBoxTemplate4>>
===

* Why did certain things happen? (what needs explaining?) +++
 <<formTiddler ShortTextBoxTemplate5>>
===
 
*How is this applicable to us today? +++
<<formTiddler ShortTextBoxTemplate6>>
===


Key verse is: +++
<<formTiddler ShortTextBoxTemplate7>>
===
	 Then  came  ''David''  to  __Nob__  to  ''Ahimelech''  the  priest.  Ahimelech  came  to  meet  David  trembling,  and  said  to  him,  "Why  are  you  alone,  and  no  man  with  you?"	
	 David  said  to  Ahimelech  the  priest,  "The  king  has  commanded  me  a  business,  and  has  said  to  me,  'Let  no  man  know  anything  of  the  business  about  which  I  send  you,  and  what  I  have  commanded  you;  and  I  have  appointed  the  young  men  to  such  and  such  a  place.'	+++^* David lies here===
	 Now  therefore  what  is  under  your  hand?  Give  me  five  loaves  of  bread  in  my  hand,  or  whatever  there  is  present."	
	 The  priest  answered  David,  and  said,  "There  is  no  common  bread  under  my  hand,  but  there  is  holy  bread;  if  only  the  young  men  have  kept  themselves  from  women."	+++^* why did he say that? +++^200px^* women must have been unclean I guess (read further)=== ===
	 David  answered  the  priest,  and  said  to  him,  "Truly,  women  have  been  kept  from  us  about  these  three  days.  When  I  came  out,  the  vessels  of  the  young  men  were  holy,  though  it  was  but  a  common  journey.  How  much  more  then  today  shall  their  vessels  be  holy?"	+++^* is he lying because he's hungry or telling the truth? +++ was there anyone even with him here? (see verse 1)=== ===
	 So  the  priest  gave  him  holy  bread;  for  there  was  no  bread  there  but  the  show  bread,  that  was  taken  from  before  Yahweh,  to  put  hot  bread  in  the  day  when  it  was  taken  away.	
	 Now  a  certain  man  of  the  servants  of  Saul  was  there  that  day,  detained  before  Yahweh;  and  his  name  was  ''Doeg  the  Edomite'',  the  best  of  the  herdsmen  who  belonged  to  Saul.	
	 David  said  to  Ahimelech,  "Isn't  there  here  under  your  hand  spear  or  sword?  For  I  have  neither  brought  my  sword  nor  my  weapons  with  me,  because  the  king's  business  required  haste."	
	 The  priest  said,  "The  sword  of  Goliath  the  Philistine,  whom  you  killed  in  the  __valley  of  Elah__,  behold,  it  is  here  wrapped  in  a  cloth  behind  the  ''__ephod__''.  If  you  will  take  that,  take  it;  for  there  is  no  other  except  that  here."  David  said,  "There  is  none  like  that.  Give  it  to  me."	
	  David  arose,  and  fled  ''//that  day//''  for  fear  of  Saul,  and  went  to  ''Achish''  the  king  of  __Gath__.	
	  The  ''servants  of  Achish''  said  to  him,  "Isn't  this  David  the  king  of  the  land?  Didn't  they  sing  one  to  another  about  him  in  dances,  saying,  'Saul  has  slain  his  thousands,  David  his  ten  thousands?'"	
	  David  laid  up  these  words  in  his  heart,  and  was  very  afraid  of  Achish  the  king  of  Gath.	
	  He  changed  his  behavior  before  them,  and  pretended  to  be  mad  in  their  hands,  and  scrabbled  on  the  doors  of  the  gate,  and  let  his  spittle  fall  down  on  his  beard.	
	  Then  Achish  said  to  his  servants,  "Look,  you  see  the  man  is  mad.  Why  then  have  you  brought  him  to  me?	
	  Do  I  lack  madmen,  that  you  have  brought  this  fellow  to  play  the  madman  in  my  presence?  Shall  this  fellow  come  into  my  house?"	
<<openTiddlers
     text:"1Samuel 22"
     tiddlers:{{
         var key = "1Sam 22:";
         t = store.getTiddlers();
         var m = "";
         for(var i=0; i<t.length; i++) {
             if(t[i].title.search(key) != -1) {
                 m += "'" + t[i].title + "' ";
             }
         }
     }}
     closeAll:false
     keepMe:false
 >> 
	 ''David''  therefore  departed  there,  and  escaped  to  the  __cave  of  Adullam__.  When  his  brothers  and  all  his  father's  house  ((heard  it(I hope they were the only ones that heard it))),  they  went  down  there  to  him.	
	 Everyone  who  was  in  distress,  and  everyone  who  was  in  debt,  and  everyone  who  was  discontented,  gathered  themselves  to  him;  and  he  became  captain  over  them	+++^* who does this remind you of? +++^200px^* starts with a "J"=== ===
	 David  went  there  to  ''Mizpeh''  of  __Moab__,  and  he  said  to  the  king  of  Moab,  "Please  let  my  father  and  my  mother  come  out  with  you,  until  I  know  what  God  will  do  for  me."	
	 He  brought  them  before  the  king  of  Moab;  and  they  lived  with  him  all  the  while  that  David  was  in  the  stronghold.	
	 ''The  prophet  Gad''  said  to  David,  "Don't  stay  in  the  stronghold.  Depart,  and  go  into  the  land  of  Judah."  Then  David  departed,  and  came  into  the  __forest  of  Hereth__.	+++^* why do you think he said that? +++^200px^* maybe so Saul didn't come and attack him?=== ===
	 ''Saul''  heard  that  David  was  discovered,  and  the  men  who  were  with  him.  Now  Saul  was  sitting  in  __Gibeah__,  under  the  tamarisk  tree  in  __Ramah__,  with  his  spear  in  his  hand,  and  all  his  servants  were  standing  about  him.	
	 Saul  said  to  his  servants  who  stood  about  him,  "Hear  now,  you  ''Benjamites''!  Will  the  son  of  Jesse  give  everyone  of  you  fields  and  vineyards,  will  he  make  you  all  captains  of  thousands  and  captains  of  hundreds,	
	 that  all  of  you  have  conspired  against  me,  and  there  is  none  who  discloses  to  me  when  my  son  makes  a  treaty  with  the  son  of  Jesse,  and  there  is  none  of  you  who  is  ((sorry  for  me(whah whah whah!))),  or  discloses  to  me  that  my  son  has  stirred  up  my  servant  against  me,  to  lie  in  wait,  as  at  this  day?"	
	 Then  ''Doeg  the  Edomite'',  who  stood  by  the  servants  of  Saul,  answered  and  said,  "I  saw  the  son  of  Jesse  coming  to  Nob,  to  Ahimelech  the  son  of  Ahitub.	
	  He  inquired  of  Yahweh  for  him,  gave  him  food,  and  gave  him  the  sword  of  Goliath  the  Philistine."	
	  Then  the  king  sent  to  call  ''Ahimelech''  the  priest,  the  son  of  Ahitub,  and  all  his  father's  house,  the  priests  who  were  in  __Nob	__
	  Saul  said,  "Hear  now,  you  son  of  Ahitub."  He  answered,  "Here  I  am,  my  lord."	
	  Saul  said  to  him,  "Why  have  you  conspired  against  me,  you  and  the  son  of  Jesse,  in  that  you  have  given  him  bread,  and  a  sword,  and  have  inquired  of  God  for  him,  that  he  should  rise  against  me,  to  lie  in  wait,  as  at  this  day?"	
	  Then  Ahimelech  answered  the  king,  and  said,  "Who  among  all  your  servants  is  so  faithful  as  David,  who  is  the  king's  son-in-law,  and  is  taken  into  your  council,  and  is  honorable  in  your  house?	
	  Have  I  today  begun  to  inquire  of  God  for  him?  Be  it  far  from  me!  Don't  let  the  king  impute  anything  to  his  servant,  nor  to  all  the  house  of  my  father;  for  your  servant  knows  nothing  of  all  this,  less  or  more."	
	  The  king  said,  "You  shall  surely  die,  Ahimelech,  you,  and  all  your  father's  house."	
	  The  king  said  to  the  guard  who  stood  about  him,  "((Turn,  and  kill  the  priests  of  Yahweh(he just keeps digging his hole deeper and deeper...)));  because  their  hand  also  is  with  David,  and  because  they  knew  that  he  fled,  and  didn't  disclose  it  to  me."  But  the  servants  of  the  king  wouldn't  put  forth  their  hand  to  fall  on  the  priests  of  Yahweh.	
	  The  king  said  to  Doeg,  "Turn  and  attack  the  priests!"  Doeg  the  Edomite  turned,  and  he  attacked  the  priests,  and  he  killed  on  that  day  eighty-five  people  who  wore  a  linen  ephod.	
	  He  struck  Nob,  the  city  of  the  priests,  with  the  edge  of  the  sword,  both  men  and  women,  children  and  nursing  babies,  and  cattle  and  donkeys  and  sheep,  with  the  edge  of  the  sword.	
	  One  of  the  sons  of  Ahimelech,  the  son  of  Ahitub,  named  ''Abiathar'',  escaped,  and  fled  after  David.	
	  Abiathar  told  David  that  Saul  had  slain  Yahweh's  priests.	
	  David  said  to  Abiathar,  "I  knew  on  that  day,  when  Doeg  the  Edomite  was  there,  that  he  would  surely  tell  Saul.  ((I  am  responsible(do you think Saul would ever have such a thought?)))  for  the  death  of  all  the  persons  of  your  father's  house.	
	  Stay  with  me,  don't  be  afraid;  for  he  who  seeks  my  life  seeks  your  life.  For  with  me  you  shall  be  in  safeguard."	
<<openTiddlers
     text:"1Samuel 23"
     tiddlers:{{
         var key = "1Sam 23:";
         t = store.getTiddlers();
         var m = "";
         for(var i=0; i<t.length; i++) {
             if(t[i].title.search(key) != -1) {
                 m += "'" + t[i].title + "' ";
             }
         }
     }}
     closeAll:false
     keepMe:false
 >> 
	 David  was  told,  "Behold,  the  Philistines  are  fighting  against  Keilah,  and  are  robbing  the  threshing  floors."	
	 Therefore  David  inquired  of  Yahweh,  saying,  "Shall  I  go  and  strike  these  Philistines?"  Yahweh  said  to  David,  "Go  strike  the  Philistines,  and  save  Keilah."	
	 David's  men  said  to  him,  "Behold,  we  are  afraid  here  in  Judah	
	 Then  David  inquired  of  Yahweh  yet  again.  Yahweh  answered  him,  and  said,  "Arise,  go  down  to  Keilah;  for  I  will  deliver  the  Philistines  into  your  hand."	
	 David  and  his  men  went  to  Keilah,  and  fought  with  the  Philistines,  and  brought  away  their  livestock,  and  killed  them  with  a  great  slaughter.  So  David  saved  the  inhabitants  of  Keilah.	
	 It  happened,  when  Abiathar  the  son  of  Ahimelech  fled  to  David  to  Keilah,  that  he  came  down  with  an  ephod  in  his  hand.	
	 It  was  told  Saul  that  David  had  come  to  Keilah.  Saul  said,  "God  has  delivered  him  into  my  hand;  for  he  is  shut  in,  by  entering  into  a  town  that  has  gates  and  bars."	
	 Saul  summoned  all  the  people  to  war,  to  go  down  to  Keilah,  to  besiege  David  and  his  men.	
	 David  knew  that  Saul  was  devising  mischief  against  him;  and  he  said  to  Abiathar  the  priest,  "Bring  the  ephod  here."	
	  Then  David  said,  "O  Yahweh,  the  God  of  Israel,  your  servant  has  surely  heard  that  Saul  seeks  to  come  to  Keilah,  to  destroy  the  city  for  my  sake.	
	  Will  the  men  of  Keilah  deliver  me  up  into  his  hand?  Will  Saul  come  down,  as  your  servant  has  heard?  Yahweh,  the  God  of  Israel,  I  beg  you,  tell  your  servant."  Yahweh  said,  "He  will  come  down."	
	  Then  David  said,  "Will  the  men  of  Keilah  deliver  me  and  my  men  into  the  hand  of  Saul?"  Yahweh  said,  "They  will  deliver  you  up."	
	  Then  David  and  his  men,  who  were  about  six  hundred,  arose  and  departed  out  of  Keilah,  and  went  wherever  they  could  go.  It  was  told  Saul  that  David  was  escaped  from  Keilah;  and  he  gave  up  going  there.	
	  David  stayed  in  the  wilderness  in  the  strongholds,  and  remained  in  the  hill  country  in  the  wilderness  of  Ziph.  Saul  sought  him  every  day,  but  God  didn't  deliver  him  into  his  hand.	
	  David  saw  that  Saul  had  come  out  to  seek  his  life.  David  was  in  the  wilderness  of  Ziph  in  the  wood.	
	  Jonathan,  Saul's  son,  arose,  and  went  to  David  into  the  woods,  and  strengthened  his  hand  in  God.	
	  He  said  to  him,  "Don't  be  afraid;  for  the  hand  of  Saul  my  father  shall  not  find  you;  and  you  shall  be  king  over  Israel,  and  I  shall  be  next  to  you;  and  that  also  Saul  my  father  knows."	
	  They  both  made  a  covenant  before  Yahweh	
	  Then  the  Ziphites  came  up  to  Saul  to  Gibeah,  saying,  "Doesn't  David  hide  himself  with  us  in  the  strongholds  in  the  wood,  in  the  hill  of  Hachilah,  which  is  on  the  south  of  the  desert?	
	  Now  therefore,  O  king,  come  down,  according  to  all  the  desire  of  your  soul  to  come  down;  and  our  part  shall  be  to  deliver  him  up  into  the  king's  hand."	
	  Saul  said,  "You  are  blessed  by  Yahweh;  for  you  have  had  compassion  on  me.	
	  Please  go  make  yet  more  sure,  and  know  and  see  his  place  where  his  haunt  is,  and  who  has  seen  him  there;  for  it  is  told  me  that  he  deals  very  subtly.	
	  See  therefore,  and  take  knowledge  of  all  the  lurking  places  where  he  hides  himself,  and  come  again  to  me  with  certainty,  and  I  will  go  with  you	
	  They  arose,  and  went  to  Ziph  before  Saul	
	  Saul  and  his  men  went  to  seek  him.  When  David  was  told,  he  went  down  to  the  rock,  and  stayed  in  the  wilderness  of  Maon.  When  Saul  heard  that,  he  pursued  David  in  the  wilderness  of  Maon.	
	  Saul  went  on  this  side  of  the  mountain,  and  David  and  his  men  on  that  side  of  the  mountain	
	  But  a  messenger  came  to  Saul,  saying,  "Hurry  and  come;  for  the  Philistines  have  made  a  raid  on  the  land!"	
	  So  Saul  returned  from  pursuing  after  David,  and  went  against  the  Philistines	
	  David  went  up  from  there,  and  lived  in  the  strongholds  of  En  Gedi.	
* who were the Key people(s) involved? +++
<<formTiddler ShortTextBoxTemplate1>><data>{"notes":"David, Saul, Abiathar,\n","notes2":"keilah, ziph, maon","notes4":"summary: People scared by Saul to reveal David's whereabouts, but David eludes\ntheme: patience and persistence","notes6":"not every open door (opportunity) is from God, sometimes its\nthe hard stuff that's from God"}</data>
===

* Where did this take place (key places, how big an area?) +++
<<formTiddler ShortTextBoxTemplate2>> 
===

* When did this take place (how long a time frame?) +++
 <<formTiddler ShortTextBoxTemplate3>>
===

* What do you think is most important here? (summarize the chapter)+++
 <<formTiddler ShortTextBoxTemplate4>>
===

* Why did certain things happen? (what needs explaining?) +++
 <<formTiddler ShortTextBoxTemplate5>>
===
 
*How is this applicable to us today? +++
<<formTiddler ShortTextBoxTemplate6>>
===


Key verse is: +++
<<formTiddler ShortTextBoxTemplate7>>
===
<<openTiddlers
     text:"1Samuel 24"
     tiddlers:{{
         var key = "1Sam 24:";
         t = store.getTiddlers();
         var m = "";
         for(var i=0; i<t.length; i++) {
             if(t[i].title.search(key) != -1) {
                 m += "'" + t[i].title + "' ";
             }
         }
     }}
     closeAll:false
     keepMe:false
 >> 
	 It  happened,  when  Saul  was  returned  from  following  the  Philistines,  that  it  was  told  him,  saying,  "Behold,  David  is  in  the  wilderness  of  En  Gedi."	
	 Then  Saul  took  three  thousand  chosen  men  out  of  all  Israel,  and  went  to  seek  David  and  his  men  on  the  rocks  of  the  wild  goats.	
	 He  came  to  the  sheep  pens  by  the  way,  where  there  was  a  cave;  and  Saul  went  in  to  relieve  himself.  Now  David  and  his  men  were  abiding  in  the  innermost  parts  of  the  cave.	
	 The  men  of  David  said  to  him,  "Behold,  the  day  of  which  Yahweh  said  to  you,  'Behold,  I  will  deliver  your  enemy  into  your  hand,  and  you  shall  do  to  him  as  it  shall  seem  good  to  you.'"  Then  David  arose,  and  cut  off  the  skirt  of  Saul's  robe  secretly.	
	 It  happened  afterward,  that  David's  heart  struck  him,  because  he  had  cut  off  Saul's  skirt.	
	 He  said  to  his  men,  "Yahweh  forbid  that  I  should  do  this  thing  to  my  lord,  Yahweh's  anointed,  to  put  forth  my  hand  against  him,  since  he  is  Yahweh's  anointed."	
	 So  David  checked  his  men  with  these  words,  and  didn't  allow  them  to  rise  against  Saul.  Saul  rose  up  out  of  the  cave,  and  went  on  his  way.	
	 David  also  arose  afterward,  and  went  out  of  the  cave,  and  cried  after  Saul,  saying,  "My  lord  the  king!"  When  Saul  looked  behind  him,  David  bowed  with  his  face  to  the  earth,  and  showed  respect.	
	 David  said  to  Saul,  "Why  do  you  listen  to  men's  words,  saying,  'Behold,  David  seeks  your  hurt?'	
	  Behold,  this  day  your  eyes  have  seen  how  that  Yahweh  had  delivered  you  today  into  my  hand  in  the  cave.  Some  urged  me  to  kill  you;  but  I  spared  you;  and  I  said,  I  will  not  put  forth  my  hand  against  my  lord;  for  he  is  Yahweh's  anointed.	
	  Moreover,  my  father,  behold,  yes,  see  the  skirt  of  your  robe  in  my  hand;  for  in  that  I  cut  off  the  skirt  of  your  robe,  and  didn't  kill  you,  know  and  see  that  there  is  neither  evil  nor  disobedience  in  my  hand,  and  I  have  not  sinned  against  you,  though  you  hunt  for  my  life  to  take  it.	
	  May  Yahweh  judge  between  me  and  you,  and  may  Yahweh  avenge  me  of  you;  but  my  hand  shall  not  be  on  you.	
	  As  the  proverb  of  the  ancients  says,  'Out  of  the  wicked  comes  forth  wickedness;'  but  my  hand  shall  not  be  on  you.	
	  Against  whom  has  the  king  of  Israel  come  out?  Whom  do  you  pursue?  A  dead  dog?  A  flea?	
	  May  Yahweh  therefore  be  judge,  and  give  sentence  between  me  and  you,  and  see,  and  plead  my  cause,  and  deliver  me  out  of  your  hand."	
	  It  came  to  pass,  when  David  had  made  an  end  of  speaking  these  words  to  Saul,  that  Saul  said,  "Is  this  your  voice,  my  son  David?"  Saul  lifted  up  his  voice,  and  wept.	
	  He  said  to  David,  "You  are  more  righteous  than  I;  for  you  have  done  good  to  me,  whereas  I  have  done  evil  to  you.	
	  You  have  declared  this  day  how  you  have  dealt  well  with  me,  because  when  Yahweh  had  delivered  me  up  into  your  hand,  you  didn't  kill  me.	
	  For  if  a  man  finds  his  enemy,  will  he  let  him  go  away  unharmed?  Therefore  may  Yahweh  reward  you  good  for  that  which  you  have  done  to  me  this  day.	
	  Now,  behold,  I  know  that  you  shall  surely  be  king,  and  that  the  kingdom  of  Israel  shall  be  established  in  your  hand.	
	  Swear  now  therefore  to  me  by  Yahweh,  that  you  will  not  cut  off  my  seed  after  me,  and  that  you  will  not  destroy  my  name  out  of  my  father's  house."	
	  David  swore  to  Saul.  Saul  went  home;  but  David  and  his  men  went  up  to  the  stronghold.	
<<openTiddlers
     text:"1Samuel 25"
     tiddlers:{{
         var key = "1Sam 25:";
         t = store.getTiddlers();
         var m = "";
         for(var i=0; i<t.length; i++) {
             if(t[i].title.search(key) != -1) {
                 m += "'" + t[i].title + "' ";
             }
         }
     }}
     closeAll:false
     keepMe:false
 >> 
	 Samuel  died;  and  all  Israel  gathered  themselves  together,  and  lamented  him,  and  buried  him  in  his  house  at  Ramah.  David  arose,  and  went  down  to  the  wilderness  of  Paran.	
	 There  was  a  man  in  Maon,  whose  possessions  were  in  Carmel;  and  the  man  was  very  great,  and  he  had  three  thousand  sheep,  and  a  thousand  goats	
	 Now  the  name  of  the  man  was  Nabal;  and  the  name  of  his  wife  Abigail;  and  the  woman  was  of  good  understanding,  and  of  a  beautiful  face	
	 David  heard  in  the  wilderness  that  Nabal  was  shearing  his  sheep.	
	 David  sent  ten  young  men,  and  David  said  to  the  young  men,  "Go  up  to  Carmel,  and  go  to  Nabal,  and  greet  him  in  my  name.	
	 You  shall  tell  him,  'Long  life  to  you!  Peace  be  to  you,  and  peace  be  to  your  house,  and  peace  be  to  all  that  you  have.	
	 Now  I  have  heard  that  you  have  shearers.  Your  shepherds  have  now  been  with  us,  and  we  didn't  hurt  them,  neither  was  there  anything  missing  from  them,  all  the  while  they  were  in  Carmel.	
	 Ask  your  young  men,  and  they  will  tell  you.  Therefore,  let  the  young  men  find  favor  in  your  eyes;  for  we  come  in  a  good  day.  Please  give  whatever  comes  to  your  hand,  to  your  servants,  and  to  your  son  David.'"	
	 When  David's  young  men  came,  they  spoke  to  Nabal  according  to  all  those  words  in  the  name  of  David,  and  ceased.	
	 Samuel  died;  and  all  Israel  gathered  themselves  together,  and  lamented  him,  and  buried  him  in  his  house  at  Ramah.  David  arose,  and  went  down  to  the  wilderness  of  Paran.	
	  Nabal  answered  David's  servants,  and  said,  "Who  is  David?  Who  is  the  son  of  Jesse?  There  are  many  servants  who  break  away  from  their  masters  these  days.	
	  Shall  I  then  take  my  bread,  and  my  water,  and  my  meat  that  I  have  killed  for  my  shearers,  and  give  it  to  men  who  I  don't  know  where  they  come  from?"	
	  So  David's  young  men  turned  on  their  way,  and  went  back,  and  came  and  told  him  according  to  all  these  words.	
	  David  said  to  his  men,  "Every  man  put  on  his  sword!"  Every  man  put  on  his  sword.  David  also  put  on  his  sword.  About  four  hundred  men  followed  David;  and  two  hundred  stayed  by  the  baggage.	
	  But  one  of  the  young  men  told  Abigail,  Nabal's  wife,  saying,  "Behold,  David  sent  messengers  out  of  the  wilderness  to  Greet  our  master;  and  he  railed  at  them.	
	  But  the  men  were  very  good  to  us,  and  we  were  not  hurt,  neither  missed  we  anything,  as  long  as  we  went  with  them,  when  we  were  in  the  fields.	
	  They  were  a  wall  to  us  both  by  night  and  by  day,  all  the  while  we  were  with  them  keeping  the  sheep.	
	  Now  therefore  know  and  consider  what  you  will  do;  for  evil  is  determined  against  our  master,  and  against  all  his  house;  for  he  is  such  a  worthless  fellow  that  one  can't  speak  to  him."	
	  Then  Abigail  hurried  and  took  two  hundred  loaves  of  bread,  two  bottles  of  wine,  five  sheep  ready  dressed,  five  measures  of  parched  grain,  one  hundred  clusters  of  raisins,  and  two  hundred  cakes  of  figs,  and  laid  them  on  donkeys.	
	  She  said  to  her  young  men,  "Go  on  before  me.  Behold,  I  come  after  you."  But  she  didn't  tell  her  husband,  Nabal.	
	  It  was  so,  as  she  rode  on  her  donkey,  and  came  down  by  the  covert  of  the  mountain,  that  behold,  David  and  his  men  came  down  toward  her;  and  she  met  them.	
	  Now  David  had  said,  "Surely  in  vain  have  I  kept  all  that  this  fellow  has  in  the  wilderness,  so  that  nothing  was  missed  of  all  that  pertained  to  him.  He  has  returned  me  evil  for  good.	
	  God  do  so  to  the  enemies  of  David,  and  more  also,  if  I  leave  of  all  that  belongs  to  him  by  the  morning  light  so  much  as  one  who  urinates  on  a  wall.  {or,  male.}"	
	  When  Abigail  saw  David,  she  hurried,  and  alighted  from  her  donkey,  and  fell  before  David  on  her  face,  and  bowed  herself  to  the  ground.	
	  She  fell  at  his  feet,  and  said,  "On  me,  my  lord,  on  me  be  the  iniquity;  and  please  let  your  handmaid  speak  in  your  ears.  Hear  the  words  of  your  handmaid.	
	  Please  don't  let  my  lord  regard  this  worthless  fellow,  even  Nabal;  for  as  his  name  is,  so  is  he.  Nabal  is  his  name,  and  folly  is  with  him;  but  I,  your  handmaid,  didn't  see  the  young  men  of  my  lord,  whom  you  sent.	
	  Now  therefore,  my  lord,  as  Yahweh  lives,  and  as  your  soul  lives,  since  Yahweh  has  withheld  you  from  blood  guiltiness,  and  from  avenging  yourself  with  your  own  hand,  now  therefore  let  your  enemies,  and  those  who  seek  evil  to  my  lord,  be  as  Nabal.	
	  Now  this  present  which  your  servant  has  brought  to  my  lord,  let  it  be  given  to  the  young  men  who  follow  my  lord.	
	  Please  forgive  the  trespass  of  your  handmaid.  For  Yahweh  will  certainly  make  my  lord  a  sure  house,  because  my  lord  fights  the  battles  of  Yahweh;  and  evil  shall  not  be  found  in  you  all  your  days.	
	  Though  men  may  rise  up  to  pursue  you,  and  to  seek  your  soul,  yet  the  soul  of  my  lord  shall  be  bound  in  the  bundle  of  life  with  Yahweh  your  God.  He  will  sling  out  the  souls  of  your  enemies,  as  from  the  hollow  of  a  sling.	
	  It  shall  come  to  pass,  when  Yahweh  has  done  to  my  lord  according  to  all  the  good  that  he  has  spoken  concerning  you,  and  shall  have  appointed  you  prince  over  Israel,	
	  that  this  shall  be  no  grief  to  you,  nor  offense  of  heart  to  my  lord,  either  that  you  have  shed  blood  without  cause,  or  that  my  lord  has  avenged  himself.  When  Yahweh  has  dealt  well  with  my  lord,  then  remember  your  handmaid."	
	  David  said  to  Abigail,  "Blessed  is  Yahweh,  the  God  of  Israel,  who  sent  you  this  day  to  meet  me!	
	  Blessed  is  your  discretion,  and  blessed  are  you,  that  have  kept  me  this  day  from  blood  guiltiness,  and  from  avenging  myself  with  my  own  hand.	
	  For  indeed,  as  Yahweh,  the  God  of  Israel,  lives,  who  has  withheld  me  from  hurting  you,  unless  you  had  hurried  and  come  to  meet  me,  surely  there  wouldn't  have  been  left  to  Nabal  by  the  morning  light  so  much  as  one  who  urinates  on  a  wall.  {or,  male.}"	
	  So  David  received  of  her  hand  that  which  she  had  brought  him	
	  Abigail  came  to  Nabal;  and  behold,  he  held  a  feast  in  his  house,  like  the  feast  of  a  king.  Nabal's  heart  was  merry  within  him,  for  he  was  very  drunken.  Therefore  she  told  him  nothing,  less  or  more,  until  the  morning  light.	
	  It  happened  in  the  morning,  when  the  wine  was  gone  out  of  Nabal,  that  his  wife  told  him  these  things,  and  his  heart  died  within  him,  and  he  became  as  a  stone.	
	  It  happened  about  ten  days  after,  that  Yahweh  struck  Nabal,  so  that  he  died.	
	  When  David  heard  that  Nabal  was  dead,  he  said,  "Blessed  is  Yahweh,  who  has  pleaded  the  cause  of  my  reproach  from  the  hand  of  Nabal,  and  has  kept  back  his  servant  from  evil.  Yahweh  has  returned  the  evildoing  of  Nabal  on  his  own  head."  David  sent  and  spoke  concerning  Abigail,  to  take  her  to  him  as  wife.	
	  When  the  servants  of  David  had  come  to  Abigail  to  Carmel,  they  spoke  to  her,  saying,  "David  has  sent  us  to  you,  to  take  you  to  him  as  wife."	
	  She  arose,  and  bowed  herself  with  her  face  to  the  earth,  and  said,  "Behold,  your  handmaid  is  a  servant  to  wash  the  feet  of  the  servants  of  my  lord."	
	  Abigail  hurried,  and  arose,  and  rode  on  a  donkey,  with  five  ladies  of  hers  who  followed  her;  and  she  went  after  the  messengers  of  David,  and  became  his  wife.	
	  David  also  took  Ahinoam  of  Jezreel;  and  they  both  became  his  wives.	
	  Now  Saul  had  given  Michal  his  daughter,  David's  wife,  to  Palti  the  son  of  Laish,  who  was  of  Gallim.	
<<openTiddlers
     text:"1Samuel 26"
     tiddlers:{{
         var key = "1Sam 26:";
         t = store.getTiddlers();
         var m = "";
         for(var i=0; i<t.length; i++) {
             if(t[i].title.search(key) != -1) {
                 m += "'" + t[i].title + "' ";
             }
         }
     }}
     closeAll:false
     keepMe:false
 >> 
	 The  ''Ziphites''  came  to  ''Saul''  to  __Gibeah__,  saying,  "Doesn't  David  hide  himself  in  the  hill  of  __Hachilah__,  which  is  before  the  desert?"	
	 Then  Saul  arose,  and  went  down  to  the  __wilderness  of  Ziph__,  @@color:#191;having  three  thousand  chosen  men  of  Israel  with  him@@,  to  seek  David  in  the  wilderness  of  Ziph.	
	 Saul  encamped  in  the  hill  of  Hachilah,  which  is  before  the  desert,  by  the  way.  But  ''David''  stayed  in  the  ((wilderness(<<tiddler DefWilderness>>))),  and  he  saw  that  Saul  came  after  him  into  the  wilderness.	
	 David  therefore  sent  out  spies,  and  understood  that  Saul  had  certainly  come.	
	 David  arose,  and  came  to  the  place  where  Saul  had  encamped;  and  David  saw  the  place  where  Saul  lay,  and  ''Abner  the  son  of  Ner'',  the  captain  of  his  army	
	 Then  answered  David  and  said  to  ''Ahimelech  the  Hittite'',  and  to  ''Abishai''  the  son  of  Zeruiah,  brother  to  Joab,  saying,  "Who  will  go  down  with  me  to  Saul  to  the  camp?"  Abishai  said,  "I  will  go  down  with  you."	
<<esv [1Sam 26:07]>>
	 Then  Abishai  said  to  David,  "God  has  delivered  up  your  enemy  into  your  hand  this  day.  Now  therefore  please  let  me  strike  him  with  the  spear  to  the  earth  at  one  stroke,  and  I  will  not  strike  him  the  second  time."	
@@	 David  said  to  Abishai,  "Don't  destroy  him;  for  who  can  put  forth  his  hand  against  Yahweh's  anointed,  and  be  guiltless?"	@@
	  David  said,  "As  Yahweh  lives,  Yahweh  will  strike  him;  or  his  day  shall  come  to  die;  or  he  shall  go  down  into  battle  and  perish.	
	  Yahweh  forbid  that  I  should  put  forth  my  hand  against  Yahweh's  anointed;  but  now  please  take  the  spear  that  is  at  his  head,  and  the  jar  of  water,  and  let  us  go."	
	  So  David  took  the  spear  and  the  jar  of  water  from  Saul's  head;  and  they  went  away	
	  Then  David  went  over  to  the  other  side,  and  stood  on  the  top  of  the  mountain  afar  off;  a  great  space  being  between  them;	
	  and  David  cried  ((to  the  people,(down in Saul's army)))  and  to  Abner  the  son  of  Ner,  saying,  "Don't  you  answer,  Abner?"  Then  Abner  answered,  "Who  are  you  who  cries  to  the  king?"	
	  David  said  to  Abner,  "Aren't  you  a  man?  Who  is  like  you  in  Israel?  Why  then  have  you  not  kept  watch  over  your  lord,  the  king?  For  one  of  the  people  came  in  to  destroy  the  king  your  lord.	
	  This  thing  isn't  good  that  you  have  done.  As  Yahweh  lives,  you  are  worthy  to  die,  because  you  have  not  kept  watch  over  your  lord,  Yahweh's  anointed.  Now  see  where  the  king's  spear  is,  and  the  jar  of  water  that  was  at  his  head."	
	  Saul  knew  David's  voice,  and  said,  "Is  this  your  voice,  my  son  David?"  David  said,  "It  is  my  voice,  my  lord,  O  king."	
	  He  said,  "Why  does  my  lord  pursue  after  his  servant?  For  what  have  I  done?  Or  what  evil  is  in  my  hand?	
	  Now  therefore,  please  let  my  lord  the  king  hear  the  words  of  his  servant.  If  it  is  so  that  Yahweh  has  stirred  you  up  against  me,  let  him  accept  an  offering.  But  if  it  is  the  children  of  men,  they  are  cursed  before  Yahweh;  for  they  have  driven  me  out  this  day  that  I  shouldn't  cling  to  Yahweh's  inheritance,  saying,  'Go,  serve  other  gods!'	
	  Now  therefore,  don't  let  my  blood  fall  to  the  earth  away  from  the  presence  of  Yahweh;  for  the  king  of  Israel  has  come  out  to  seek  a  flea,  as  when  one  hunts  a  partridge  in  the  mountains."	
	  @@Then  Saul  said,  "I  have  sinned.  Return,  my  son  David;  for  I  will  no  more  do  you  harm,  because  my  life  was  precious  in  your  eyes  this  day.  Behold,  I  have  played  the  fool,  and  have  erred  exceedingly."	@@
	  David  answered,  "Behold  the  spear,  O  king!  Then  let  one  of  the  young  men  come  over  and  get  it.	
	  Yahweh  will  render  to  every  man  his  righteousness  and  his  faithfulness;  because  Yahweh  delivered  you  into  my  hand  today,  and  I  wouldn't  put  forth  my  hand  against  Yahweh's  anointed.	
	  Behold,  as  your  life  was  respected  this  day  in  my  eyes,  so  let  my  life  be  respected  in  the  eyes  of  Yahweh,  and  let  him  deliver  me  out  of  all  oppression."	
@@	  Then  Saul  said  to  David,  "You  are  blessed,  my  son  David.  You  shall  both  do  mightily,  and  shall  surely  prevail."  So  David  went  his  way,  and  Saul  returned  to  his  place.	@@
* who were the Key people(s) involved? +++
<<formTiddler ShortTextBoxTemplate1>><data>{"notes":"\n"}</data>
===

* Where did this take place (key places, how big an area?) +++
<<formTiddler ShortTextBoxTemplate2>> 
===

* When did this take place (how long a time frame?) +++
 <<formTiddler ShortTextBoxTemplate3>>
===

* What do you think is most important here? (summarize the chapter)+++
 <<formTiddler ShortTextBoxTemplate4>>
===

* Why did certain things happen? (what needs explaining?) +++
 <<formTiddler ShortTextBoxTemplate5>>
===
 
*How is this applicable to us today? +++
<<formTiddler ShortTextBoxTemplate6>>
===

*Key verse is: +++
<<formTiddler ShortTextBoxTemplate7>>
===
<<openTiddlers
     text:"1Samuel 27"
     tiddlers:{{
         var key = "1Sam 27:";
         t = store.getTiddlers();
         var m = "";
         for(var i=0; i<t.length; i++) {
             if(t[i].title.search(key) != -1) {
                 m += "'" + t[i].title + "' ";
             }
         }
     }}
     closeAll:false
     keepMe:false
 >> 
	 ''David''  said  in  his  heart,  "I  shall  now  perish  one  day  by  the  hand  of  Saul.  There  is  nothing  better  for  me  than  that  I  should  escape  into  the  land  of  the  Philistines;  and  Saul  will  despair  of  me,  to  seek  me  any  more  in  all  the  borders  of  Israel.  So  shall  I  escape  out  of  his  hand."	
	 David  arose,  and  passed  over,  he  and  the  six  hundred  men  who  were  with  him,  to  ''Achish  the  son  of  Maoch,  king  of  Gath.''	
	 David  lived  with  Achish  at  Gath,  he  and  his  men,  every  man  with  his  household,  even  David  with  his  two  wives,  ''Ahinoam''  the  Jezreelitess,  and  ''Abigail''  the  Carmelitess,  Nabal's  wife.	
	 It  was  told  ''Saul''  that  David  was  fled  to  Gath	
	 David  said  to  Achish,  "If  now  I  have  found  favor  in  your  eyes,  let  them  give  me  a  place  in  one  of  the  cities  in  the  country,  that  I  may  dwell  there.  For  why  should  your  servant  dwell  in  the  royal  city  with  you?"	
	 Then  Achish  gave  him  __Ziklag__  that  day	
	 The  number  of  the  days  that  David  lived  in  the  country  of  the  Philistines  was  ''//a  full  year  and  four  months//''.	
	 David  and  his  men  went  up,  and  made  a  raid  on  the  ''Geshurites'',  and  the  ''Girzites'',  and  the  ''Amalekites'';  for  those  were  the  inhabitants  of  the  land,  who  were  of  old,  as  you  go  to  Shur,  even  to  the  land  of  Egypt.	
	 David  struck  the  land,  and  saved  neither  man  nor  woman  alive,  and  took  away  the  sheep,  and  the  cattle,  and  the  donkeys,  and  the  camels,  and  the  clothing;  and  he  returned,  and  came  to  Achish.	
	  ''Achish''  said,  "Against  whom  have  you  made  a  raid  today?"  David  said,  "Against  the  South  of  ''Judah'',  against  the  South  of  the  ''Jerahmeelites'',  and  against  the  South  of  the  ''Kenites''."	
	  David  ((saved  neither  man  nor  woman  alive(didn't bring any captives))),  to  bring  them  to  __Gath__,  saying,  (("Lest  they  should  tell  of  us,  saying,(so they wouldn't go and tell Saul what he was up to)))  'David  this,  and  this  has  been  his  way  all  the  time  he  has  lived  in  the  country  of  the  Philistines.'"	
	  Achish  believed  David,  saying,  "He  has  made  his  people  Israel  utterly  to  abhor  him.  Therefore  he  shall  be  my  servant  forever."	+++^*[Question:] Why did David do all this raiding?  What was the purpose? +++ was it to prove his usefulness to Achish?=== ===
* who were the Key people(s) involved? +++
<<formTiddler ShortTextBoxTemplate1>><data>{"notes":"\n"}</data>
===

* Where did this take place (key places, how big an area?) +++
<<formTiddler ShortTextBoxTemplate2>> 
===

* When did this take place (how long a time frame?) +++
 <<formTiddler ShortTextBoxTemplate3>>
===

* What do you think is most important here? (summarize the chapter)+++
 <<formTiddler ShortTextBoxTemplate4>>
===

* Why did certain things happen? (what needs explaining?) +++
 <<formTiddler ShortTextBoxTemplate5>>
===
 
*How is this applicable to us today? +++
<<formTiddler ShortTextBoxTemplate6>>
===

*Key verse is: +++
<<formTiddler ShortTextBoxTemplate7>>
===
<<openTiddlers
     text:"1Samuel 28"
     tiddlers:{{
         var key = "1Sam 28:";
         t = store.getTiddlers();
         var m = "";
         for(var i=0; i<t.length; i++) {
             if(t[i].title.search(key) != -1) {
                 m += "'" + t[i].title + "' ";
             }
         }
     }}
     closeAll:false
     keepMe:false
 >> 
	 It  happened  in  those  days,  that  ''the  Philistines''  gathered  their  armies  together  for  warfare,  to  fight  with  ''Israel''.  ''Achish''  said  to  ''David'',  "Know  assuredly  that  you  shall  go  out  with  me  in  the  army,  you  and  your  men."	
	 David  said  to  Achish,  "Therefore  you  shall  know  what  your  servant  will  do."  Achish  said  to  David,  "Therefore  will  I  make  you  my  bodyguard  for  ever."	+++^*[question]Why do you suppose Achish would trust him so much? +++was he just a trustworthy guy, or was it the raiding that he did?=== ===
	 Now  +++^*[Samuel  was  dead] 1Sam 25:01<<tiddler [[1Sam 25:01]]>> ===,  and  all  Israel  had  lamented  him,  and  buried  him  in  __Ramah__,  even  in  his  own  city.  ''Saul''  had  put  away  those  who  had  familiar  spirits,  and  the  wizards,  out  of  the  land.	
	 The  Philistines  gathered  themselves  together,  and  came  and  encamped  in  __Shunem__	
	 When  Saul  saw  the  army  of  the  Philistines,  he  was  afraid,  and  his  heart  trembled  greatly.	
	 When  Saul  inquired  of  Yahweh,  Yahweh  didn't  answer  him,  neither  by  dreams,  nor  by  Urim,  nor  by  prophets.	
	 Then  Saul  said  to  his  servants,  "Seek  me  a  woman  who  has  a  familiar  spirit,  that  I  may  go  to  her,  and  inquire  of  her."  His  servants  said  to  him,  "Behold,  there  is  a  woman  who  has  a  familiar  spirit  at  __Endor__."	
	 Saul  disguised  himself,  and  put  on  other  clothing,  and  went,  he  and  two  men  with  him,  and  they  came  to  the  woman  by  night	
	 The  woman  said  to  him,  "Behold,  you  know  what  Saul  has  done,  how  he  has  cut  off  those  who  have  familiar  spirits,  and  the  wizards,  out  of  the  land.  Why  then  do  you  lay  a  snare  for  my  life,  to  cause  me  to  die?"	
	  Saul  swore  to  her  by  Yahweh,  saying,  "As  Yahweh  lives,  no  punishment  shall  happen  to  you  for  this  thing."	
	  Then  the  woman  said,  "Whom  shall  I  bring  up  to  you?"  He  said,  @@color:#900;"Bring  Samuel  up  for  me."@@	
	  When  +++^*[the  woman  saw  Samuel|click] <<tiddler "the woman saw Samuel">> === ,  she  cried  with  a  loud  voice;  and  the  woman  spoke  to  Saul,  saying,  "Why  have  you  deceived  me?  For  you  are  Saul!"	
	  The  king  said  to  her,  "Don't  be  afraid.  For  what  do  you  see?"  The  woman  said  to  Saul,  "I  see  a  god  coming  up  out  of  the  earth."	
	  He  said  to  her,  "What  does  he  look  like?"  She  said,  "An  old  man  comes  up.  He  is  covered  with  a  robe."  Saul  perceived  that  it  was  ''Samuel'',  and  he  bowed  with  his  face  to  the  ground,  and  showed  respect.	
	  Samuel  said  to  Saul,  "Why  have  you  disturbed  me,  to  bring  me  up?"  Saul  answered,  "I  am  very  distressed;  for  the  Philistines  make  war  against  me,  and  God  has  departed  from  me,  and  answers  me  no  more,  neither  by  prophets,  nor  by  dreams.  Therefore  I  have  called  you,  that  you  may  make  known  to  me  what  I  shall  do."	
	  @@Samuel  said,  "Why  then  do  you  ask  of  me,  since  Yahweh  has  departed  from  you  and  has  become  your  adversary?	@@
	  Yahweh  has  done  to  you  as  he  spoke  by  me.  Yahweh  has  torn  the  kingdom  out  of  your  hand,  and  given  it  to  your  neighbor,  even  to  David.	
	  Because  you  didn't  obey  the  voice  of  Yahweh,  and  didn't  execute  his  fierce  wrath  on  Amalek,  therefore  Yahweh  has  done  this  thing  to  you  this  day. +++^* 1Sam 15:26 <<tiddler [[1Sam 15:26]]>> === .	
	  Moreover  Yahweh  will  deliver  Israel  also  with  you  into  the  hand  of  the  Philistines;  and  tomorrow  you  and  your  sons  will  be  with  me.  Yahweh  will  deliver  the  army  of  Israel  also  into  the  hand  of  the  Philistines."	
	  Then  Saul  fell  immediately  his  full  length  on  the  earth,  and  was  terrified,  because  of  the  words  of  Samuel.  There  was  no  strength  in  him;  for  he  had  eaten  no  bread  all  the  day,  nor  all  the  night.	
	  The  woman  came  to  Saul,  and  saw  that  he  was  very  troubled,  and  said  to  him,  "Behold,  your  handmaid  has  listened  to  your  voice,  and  I  have  put  my  life  in  my  hand,  and  have  listened  to  your  words  which  you  spoke  to  me.	
	  Now  therefore,  please  listen  also  to  the  voice  of  your  handmaid,  and  let  me  set  a  morsel  of  bread  before  you;  and  eat,  that  you  may  have  strength,  when  you  go  on  your  way."	
	  But  he  refused,  and  said,  I  will  not  eat.  But  his  servants,  together  with  the  woman,  constrained  him;  and  he  listened  to  their  voice.  So  he  arose  from  the  earth,  and  sat  on  the  bed.	
	  The  woman  had  a  fattened  calf  in  the  house.  She  hurried  and  killed  it;  and  she  took  flour,  and  kneaded  it,  and  baked  unleavened  bread  of  it.	
	  She  brought  it  before  Saul,  and  before  his  servants;  and  they  ate.  Then  they  rose  up,  and  went  away  that  night.	
* who were the Key people(s) involved? +++
<<formTiddler ShortTextBoxTemplate1>><data>{"notes":"\n"}</data>
===

* Where did this take place (key places, how big an area?) +++
<<formTiddler ShortTextBoxTemplate2>> 
===

* When did this take place (how long a time frame?) +++
 <<formTiddler ShortTextBoxTemplate3>>
===

* What do you think is most important here? (summarize the chapter)+++
 <<formTiddler ShortTextBoxTemplate4>>
===

* Why did certain things happen? (what needs explaining?) +++
 <<formTiddler ShortTextBoxTemplate5>>
===
 
*How is this applicable to us today? +++
<<formTiddler ShortTextBoxTemplate6>>
===


Key verse is: +++
<<formTiddler ShortTextBoxTemplate7>>
===
<<openTiddlers
     text:"1Samuel 29"
     tiddlers:{{
         var key = "1Sam 29:";
         t = store.getTiddlers();
         var m = "";
         for(var i=0; i<t.length; i++) {
             if(t[i].title.search(key) != -1) {
                 m += "'" + t[i].title + "' ";
             }
         }
     }}
     closeAll:false
     keepMe:false
 >> 
	 Now  the  ''Philistines''  gathered  together  all  their  armies  to  __Aphek__	
	 The  lords  of  the  Philistines  passed  on  by  hundreds,  and  by  thousands;  and  ''David''  and  his  men  passed  on  ((in  the  rear  with  ''Achish''(the benefits of being the king's guard))).	
	 Then  ''the  princes  of  the  Philistines''  said,  "What  about  these  Hebrews?"  ''Achish''  said  to  the  princes  of  the  Philistines,  "Isn't  this  David,  the  servant  of  Saul  the  king  of  Israel,  who  has  been  with  me  these  days,  or  rather  these  years,  and  I  have  found  no  fault  in  him  since  he  fell  away  to  this  day?"	
	 But  the  princes  of  the  Philistines  were  angry  with  him;  and  the  princes  of  the  Philistines  said  to  him,  "Make  the  man  return,  that  he  may  go  back  to  his  place  where  you  have  appointed  him,  and  let  him  not  go  down  with  us  to  battle,  lest  in  the  battle  he  become  an  adversary  to  us.  For  with  what  should  this  fellow  reconcile  himself  to  his  lord?  Should  it  not  be  with  the  heads  of  these  men?	
	 Is  not  this  David,  of  whom  they  sang  one  to  another  in  dances,  saying,  'Saul  has  slain  his  thousands,  David  his  ten  thousands?'"	
	 Then  Achish  called  David,  and  said  to  him,  "As  Yahweh  lives,  you  have  been  upright,  and  your  going  out  and  your  coming  in  with  me  in  the  army  is  good  in  my  sight;  for  I  have  not  found  evil  in  you  since  the  day  of  your  coming  to  me  to  this  day.  Nevertheless,  the  lords  don't  favor  you.	
	 Therefore  now  return,  and  go  in  peace,  that  you  not  displease  the  lords  of  the  Philistines."	
	 David  said  to  Achish,  "But  what  have  I  done?  What  have  you  found  in  your  servant  so  long  as  I  have  been  before  you  to  this  day,  that  I  may  not  go  and  fight  against  the  enemies  of  my  lord  the  king?"	
	 Achish  answered  David,  "I  know  that  you  are  good  in  my  sight,  as  an  angel  of  God.  Notwithstanding  the  princes  of  the  Philistines  have  said,  'He  shall  not  go  up  with  us  to  the  battle.'	
	  Therefore  now  rise  up  early  in  the  morning  with  the  servants  of  your  lord  who  have  come  with  you;  and  as  soon  as  you  are  up  early  in  the  morning,  and  have  light,  depart."	
	  So  David  rose  up  early,  he  and  his  men,  to  depart  in  the  morning,  to  return  into  the  land  of  the  Philistines.  The  Philistines  went  up  to  __Jezreel__.	
* who were the Key people(s) involved? +++
<<formTiddler ShortTextBoxTemplate1>><data>{"notes":"\n"}</data>
===

* Where did this take place (key places, how big an area?) +++
<<formTiddler ShortTextBoxTemplate2>> 
===

* When did this take place (how long a time frame?) +++
 <<formTiddler ShortTextBoxTemplate3>>
===

* What do you think is most important here? (summarize the chapter)+++
 <<formTiddler ShortTextBoxTemplate4>>
===

* Why did certain things happen? (what needs explaining?) +++
 <<formTiddler ShortTextBoxTemplate5>>
===
 
*How is this applicable to us today? +++
<<formTiddler ShortTextBoxTemplate6>>
===


Key verse is: +++
<<formTiddler ShortTextBoxTemplate7>>
===
	Hannah  prayed,  and  said	
	 Those  who  strive  with  Yahweh  shall  be  broken  to  pieces.  He  will  thunder  against  them  in  the  sky.    "Yahweh  will  judge  the  ends  of  the  earth.  He  will  give  strength  to  his  king,  and  exalt  the  horn  of  his  anointed."	
	 Elkanah  went  to  Ramah  to  his  house.  The  child  served  Yahweh  before  Eli  the  priest.	
	 Now  the  sons  of  Eli  were  base  men;  they  didn't  know  Yahweh.	
	 The  custom  of  the  priests  with  the  people  was  that  when  any  man  offered  sacrifice,  the  priest's  servant  came,  while  the  flesh  was  boiling,  with  a  fork  of  three  teeth  in  his  hand;	
	 and  he  struck  it  into  the  pan,  or  kettle,  or  caldron,  or  pot;  all  that  the  fork  brought  up  the  priest  took  therewith.  So  they  did  in  Shiloh  to  all  the  Israelites  who  came  there.	
	 Yes,  before  they  burnt  the  fat,  the  priest's  servant  came,  and  said  to  the  man  who  sacrificed,  "Give  meat  to  roast  for  the  priest;  for  he  will  not  accept  boiled  meat  from  you,  but  raw."	
	 If  the  man  said  to  him,  "Let  the  fat  be  burned  first,  and  then  take  as  much  as  your  soul  desires;"  then  he  would  say,  "No,  but  you  shall  give  it  to  me  now;  and  if  not,  I  will  take  it  by  force."	
	 The  sin  of  the  young  men  was  very  great  before  Yahweh;  for  the  men  despised  the  offering  of  Yahweh.	
	 But  Samuel  ministered  before  Yahweh,  being  a  child,  clothed  with  a  linen  ephod.	
	 Moreover  his  mother  made  him  a  little  robe,  and  brought  it  to  him  from  year  to  year,  when  she  came  up  with  her  husband  to  offer  the  yearly  sacrifice.	
	There  is  no  one  as  holy  as  Yahweh,  For  there  is  no  one  besides  you,  nor  is  there  any  rock  like  our  God.	
	 Eli  blessed  Elkanah  and  his  wife,  and  said,  "Yahweh  give  you  seed  of  this  woman  for  the  petition  which  was  asked  of  Yahweh."  They  went  to  their  own  home.	
	 Yahweh  visited  Hannah,  and  she  conceived,  and  bore  three  sons  and  two  daughters.  The  child  Samuel  grew  before  Yahweh.	
	 Now  Eli  was  very  old;  and  he  heard  all  that  his  sons  did  to  all  Israel,  and  how  that  they  lay  with  the  women  who  served  at  the  door  of  the  Tent  of  Meeting.	
	 He  said  to  them,  "Why  do  you  do  such  things?  for  I  hear  of  your  evil  dealings  from  all  this  people.	
	 No,  my  sons;  for  it  is  no  good  report  that  I  hear	
	 If  one  man  sin  against  another,  God  shall  judge  him;  but  if  a  man  sin  against  Yahweh,  who  shall  entreat  for  him?"  Notwithstanding,  they  didn't  listen  to  the  voice  of  their  father,  because  Yahweh  intended  to  kill  them.	
	 The  child  Samuel  grew  on,  and  increased  in  favor  both  with  Yahweh,  and  also  with  men.	
	 A  man  of  God  came  to  Eli,  and  said  to  him,  "Thus  says  Yahweh,  'Did  I  reveal  myself  to  the  house  of  your  father,  when  they  were  in  Egypt  in  bondage  to  Pharaoh's  house?	
	 Did  I  choose  him  out  of  all  the  tribes  of  Israel  to  be  my  priest,  to  go  up  to  my  altar,  to  burn  incense,  to  wear  an  ephod  before  me?  Did  I  give  to  the  house  of  your  father  all  the  offerings  of  the  children  of  Israel  made  by  fire?	
	 Why  do  you  kick  at  my  sacrifice  and  at  my  offering,  which  I  have  commanded  in  my  habitation,  and  honor  your  sons  above  me,  to  make  yourselves  fat  with  the  best  of  all  the  offerings  of  Israel  my  people?'	
	"Talk  no  more  so  exceeding  proudly.  Don't  let  arrogance  come  out  of  your  mouth,  For  Yahweh  is  a  God  of  knowledge.  By  him  actions  are  weighed.	
	 "Therefore  Yahweh,  the  God  of  Israel,  says,  'I  said  indeed  that  your  house,  and  the  house  of  your  father,  should  walk  before  me  forever.'  But  now  Yahweh  says,  'Be  it  far  from  me;  for  those  who  honor  me  I  will  honor,  and  those  who  despise  me  shall  be  lightly  esteemed.	
	 Behold,  the  days  come,  that  I  will  cut  off  your  arm,  and  the  arm  of  your  father's  house,  that  there  shall  not  be  an  old  man  in  your  house.	
	 You  shall  see  the  affliction  of  my  habitation,  in  all  the  wealth  which  I  shall  give  Israel;  and  there  shall  not  be  an  old  man  in  your  house  forever.	
	 The  man  of  yours,  whom  I  shall  not  cut  off  from  my  altar,  shall  consume  your  eyes,  and  grieve  your  heart;  and  all  the  increase  of  your  house  shall  die  in  the  flower  of  their  age.	
	 "'This  shall  be  the  sign  to  you,  that  shall  come  on  your  two  sons,  on  Hophni  and  Phinehas	
	 I  will  raise  me  up  a  faithful  priest,  that  shall  do  according  to  that  which  is  in  my  heart  and  in  my  mind.  I  will  build  him  a  sure  house;  and  he  shall  walk  before  my  anointed  forever.	
	 It  shall  happen,  that  everyone  who  is  left  in  your  house  shall  come  and  bow  down  to  him  for  a  piece  of  silver  and  a  loaf  of  bread,  and  shall  say,  "Please  put  me  into  one  of  the  priests'  offices,  that  I  may  eat  a  morsel  of  bread."'"	
	"The  bows  of  the  mighty  men  are  broken.  Those  who  stumbled  are  armed  with  strength.	
	Those  who  were  full  have  hired  themselves  out  for  bread.  Those  who  were  hungry  are  satisfied.  Yes,  the  barren  has  borne  seven.  She  who  has  many  children  languishes.	
	"Yahweh  kills,  and  makes  alive.  He  brings  down  to  Sheol  {Sheol  is  the  place  of  the  dead.},  and  brings  up.	
	Yahweh  makes  poor,  and  makes  rich.  He  brings  low,  he  also  lifts  up.	
	He  raises  up  the  poor  out  of  the  dust.  He  lifts  up  the  needy  from  the  dunghill,  To  make  them  sit  with  princes,  and  inherit  the  throne  of  glory.  For  the  pillars  of  the  earth  are  Yahweh's.  He  has  set  the  world  on  them.	
	He  will  keep  the  feet  of  his  holy  ones,  but  the  wicked  shall  be  put  to  silence  in  darkness;  for  no  man  shall  prevail  by  strength.	
<<openTiddlers
     text:"1Samuel 30"
     tiddlers:{{
         var key = "1Sam 30:";
         t = store.getTiddlers();
         var m = "";
         for(var i=0; i<t.length; i++) {
             if(t[i].title.search(key) != -1) {
                 m += "'" + t[i].title + "' ";
             }
         }
     }}
     closeAll:false
     keepMe:false
 >> 
	 It  happened,  when  ''David''  and  his  men  had  come  to  __Ziklag__  on  //''the  third  day''//,  that  ''the  Amalekites''  had  made  a  raid  on  the  South,  and  on  Ziklag,  and  had  struck  Ziklag,  and  burned  it  with  fire,	 +++^*[question]Weren't the Amalekites killed in Chapter 15 or so? +++ Mathew Henry <<tiddler [[MH 1Sam 30:01]]>>=== ===
	 and  had  taken  captive  the  women  and  all  who  were  therein,  both  small  and  great.  They  didn't  kill  any,  but  carried  them  off,  and  went  their  way.	
	 When  David  and  his  men  came  to  the  city,  behold,  it  was  burned  with  fire;  and  their  wives,  and  their  sons,  and  their  daughters,  were  taken  captive.	
	 Then  David  and  the  people  who  were  with  him  lifted  up  their  voice  and  wept,  until  they  had  no  more  power  to  weep.	
@@color:#904;	 David's  two  wives  were  taken  captive,  Ahinoam  the  Jezreelitess,  and  Abigail  the  wife  of  Nabal  the  Carmelite.	@@
	 David  was  greatly  distressed;  for  the  people  spoke  of  stoning  him,  because  the  soul  of  all  the  people  was  grieved,  every  man  for  his  sons  and  for  his  daughters	
	 David  said  to  ''Abiathar''  the  priest,  the  son  of  Ahimelech,  "Please  bring  me  here  the  __''ephod''__."  Abiathar  brought  the  ephod  to  David.	
	 David  inquired  of  Yahweh,  saying,  "If  I  pursue  after  this  troop,  shall  I  overtake  them?"  He  answered  him,  "Pursue;  for  you  shall  surely  overtake  them,  and  shall  without  fail  recover  all."	
	 So  David  went,  he  and  the  six  hundred  men  who  were  with  him,  and  came  to  the  brook  __Besor__,  where  those  who  were  left  behind  stayed.	
	  But  David  pursued,  he  and  four  hundred  men;  for  two  hundred  stayed  behind,  who  were  so  faint  that  they  couldn't  go  over  the  brook  Besor.	
	  They  found  ''an  Egyptian''  in  the  field,  and  brought  him  to  David,  and  gave  him  bread,  and  he  ate;  and  they  gave  him  water  to  drink.	
	  They  gave  him  a  piece  of  a  cake  of  figs,  and  two  clusters  of  raisins.  when  he  had  eaten,  his  spirit  came  again  to  him;  for  he  had  eaten  no  bread,  nor  drunk  any  water,  three  days  and  three  nights.	
	  David  asked  him,  "To  whom  do  you  belong?  Where  are  you  from?"  He  said,  "I  am  a  young  man  of  Egypt,  servant  to  an  Amalekite;  and  my  master  left  me,  because  three  days  ago  I  fell  sick.	
	  We  made  a  raid  on  the  South  of  the  Cherethites,  and  on  that  which  belongs  to  Judah,  and  on  the  South  of  Caleb;  and  we  burned  Ziklag  with  fire."	
	  David  said  to  him,  "Will  you  bring  me  down  to  this  troop?"  He  said,  "Swear  to  me  by  God  that  you  will  neither  kill  me,  nor  deliver  me  up  into  the  hands  of  my  master,  and  I  will  bring  you  down  to  this  troop."	
	  When  he  had  brought  him  down,  behold,  they  were  spread  around  over  all  the  ground,  eating,  drinking,  and  dancing,  because  of  all  the  great  spoil  that  they  had  taken  out  of  the  land  of  the  Philistines,  and  out  of  the  land  of  Judah.	
	  David  struck  them  //''from  the  twilight  even  to  the  evening  of  the  next  day''//.  Not  a  man  of  them  escaped  from  there,  except  four  hundred  young  men,  who  rode  on  camels  and  fled.	
	 @@ David  recovered  all  that  the  Amalekites  had  taken;  and  David  rescued  his  two  wives.	@@
	  There  was  nothing  lacking  to  them,  neither  small  nor  great,  neither  sons  nor  daughters,  neither  spoil,  nor  anything  that  they  had  taken  to  them.  David  brought  back  all.	
	  David  took  all  the  flocks  and  the  herds,  which  they  drove  before  those  other  livestock,  and  said,  "This  is  David's  spoil."	
	  David  came  to  the  two  hundred  men,  who  were  so  faint  that  they  could  not  follow  David,  whom  also  they  had  made  to  stay  at  the  brook  Besor;  and  they  went  forth  to  meet  David,  and  to  meet  the  people  who  were  with  him.  When  David  came  near  to  the  people,  he  greeted  them.	
	  Then  all  the  wicked  men  and  base  fellows,  of  those  who  went  with  David,  answered  and  said,  "Because  they  didn't  go  with  us,  we  will  not  give  them  anything  of  the  spoil  that  we  have  recovered,  except  to  every  man  his  wife  and  his  children,  that  he  may  lead  them  away,  and  depart."	
	  Then  David  said,  "You  shall  not  do  so,  my  brothers,  with  that  which  Yahweh  has  given  to  us,  who  has  preserved  us,  and  delivered  the  troop  that  came  against  us  into  our  hand.	
	  Who  will  listen  to  you  in  this  matter?  For  as  his  share  is  who  goes  down  to  the  battle,  so  shall  his  share  be  who  tarries  by  the  baggage	
	  It  was  so  from  that  day  forward,  that  he  made  it  a  statute  and  an  ordinance  for  Israel  to  this  day.	
	  When  David  came  to  Ziklag,  @@color:#FA3;he  sent  of  the  spoil  to  the  elders  of  Judah,  even  to  his  friends,  saying,  "Behold,  a  present  for  you  of  the  spoil  of  the  enemies  of  Yahweh."	@@
	  He  sent  it  to  those  who  were  in  __Bethel__,  and  to  those  who  were  in  __Ramoth__  of  the  South,  and  to  those  who  were  in  __Jattir__,	
	  and  to  those  who  were  in  __Aroer__,  and  to  those  who  were  in  __Siphmoth__,  and  to  those  who  were  in  __Eshtemoa__,	
	  and  to  those  who  were  in  Racal,  and  to  those  who  were  in  the  cities  of  the  Jerahmeelites,  and  to  those  who  were  in  the  cities  of  the  Kenites,	
	  and  to  those  who  were  in  Hormah,  and  to  those  who  were  in  Borashan,  and  to  those  who  were  in  Athach,	
	  and  to  those  who  were  in  Hebron,  and  to  all  the  places  where  David  himself  and  his  men  used  to  stay.	+++^*[question] What does this look like he's doing? +++* cashing in on any and all previous contacts for when Saul is overtaken by the Phillistines, but...+++* how could he possibly know what was to happen? === === ===
* who were the Key people(s) involved? +++
<<formTiddler ShortTextBoxTemplate1>><data>{"notes":"\n"}</data>
===

* Where did this take place (key places, how big an area?) +++
<<formTiddler ShortTextBoxTemplate2>> 
===

* When did this take place (how long a time frame?) +++
 <<formTiddler ShortTextBoxTemplate3>>
===

* What do you think is most important here? (summarize the chapter)+++
 <<formTiddler ShortTextBoxTemplate4>>
===

* Why did certain things happen? (what needs explaining?) +++
 <<formTiddler ShortTextBoxTemplate5>>
===
 
*How is this applicable to us today? +++
<<formTiddler ShortTextBoxTemplate6>>
===


Key verse is: +++
<<formTiddler ShortTextBoxTemplate7>>
===
<<openTiddlers
     text:"1Samuel 31"
     tiddlers:{{
         var key = "1Sam 31:";
         t = store.getTiddlers();
         var m = "";
         for(var i=0; i<t.length; i++) {
             if(t[i].title.search(key) != -1) {
                 m += "'" + t[i].title + "' ";
             }
         }
     }}
     closeAll:false
     keepMe:false
 >> 
	 Now  the  ''Philistines''  fought  against  ''Israel''	
	 The  Philistines  followed  hard  on  ''Saul''  and  on  ''his  sons'';  and  ((the  Philistines  killed( at least David didn't have to do it...)))  ''Jonathan'',  and  ''Abinadab'',  and  ''Malchishua'',  the  sons  of  Saul.	
	 The  battle  went  hard  against  Saul,  and  the  archers  overtook  him;  and  he  was  greatly  distressed  by  reason  of  the  archers.	
	 @@Then  Saul  said  to  his  armor  bearer,  "Draw  your  sword,  and  thrust  me  through  with  it,  lest  these  uncircumcised  come  and  thrust  me  through,  and  abuse  me!"  But  his  armor  bearer  would  not;  for  he  was  terrified.  Therefore  Saul  took  his  sword,  and  fell  on  it.@@	
	 When  his  armor  bearer  saw  that  Saul  was  dead,  he  likewise  fell  on  his  sword,  and  died  with  him.	
	 So  Saul  died,  and  his  three  sons,  and  his  armor  bearer,  and  all  his  men,  that  same  day  together.	
	 When  the  men  of  Israel  who  were  on  the  other  side  of  the  valley,  and  those  who  were  beyond  the  Jordan,  saw  that  the  men  of  Israel  fled,  and  that  Saul  and  his  sons  were  dead,  they  forsook  the  cities,  and  fled;  and  the  Philistines  came  and  lived  in  them.	
	 It  happened  on  the  next  day,  when  the  Philistines  came  to  strip  the  slain,  that  they  found  Saul  and  his  three  sons  fallen  on  __Mount  Gilboa__.	
	 They  cut  off  his  head,  and  stripped  off  his  armor,  and  sent  into  the  land  of  the  Philistines  all  around,  to  carry  the  news  to  the  house  of  their  idols,  and  to  the  people.	
	  They  put  his  armor  in  the  __house  of  the  Ashtaroth__;  and  they  fastened  his  body  to  the  wall  of  Beth  Shan.	
	  When  the  inhabitants  of  __Jabesh  Gilead__  heard  concerning  him  that  which  the  Philistines  had  done  to  Saul,	
	  all  the  valiant  men  arose,  and  went  all  night,  and  took  the  body  of  Saul  and  the  bodies  of  his  sons  from  the  wall  of  Beth  Shan;  and  they  came  to  __Jabesh__,  and  burnt  them  there.	
	  They  took  their  bones,  and  buried  them  under  the  tamarisk  tree  in  Jabesh,  and  fasted  seven  days.	
* who were the Key people(s) involved? +++
<<formTiddler ShortTextBoxTemplate1>><data>{"notes":"\n"}</data>
===

* Where did this take place (key places, how big an area?) +++
<<formTiddler ShortTextBoxTemplate2>> 
===

* When did this take place (how long a time frame?) +++
 <<formTiddler ShortTextBoxTemplate3>>
===

* What do you think is most important here? (summarize the chapter)+++
 <<formTiddler ShortTextBoxTemplate4>>
===

* Why did certain things happen? (what needs explaining?) +++
 <<formTiddler ShortTextBoxTemplate5>>
===
 
*How is this applicable to us today? +++
<<formTiddler ShortTextBoxTemplate6>>
===


Key verse is: +++
<<formTiddler ShortTextBoxTemplate7>>
===
	The  child  Samuel  ministered  to  Yahweh  before  Eli.  The  word  of  Yahweh  was  precious  in  those  days;  there  was  no  frequent  vision.	
	 Yahweh  came,  and  stood,  and  called  as  at  other  times,  "Samuel!  Samuel!"  Then  Samuel  said,  "Speak;  for  your  servant  hears."	
	 Yahweh  said  to  Samuel,  "Behold,  I  will  do  a  thing  in  Israel,  at  which  both  the  ears  of  everyone  who  hears  it  shall  tingle.	
	 In  that  day  I  will  perform  against  Eli  all  that  I  have  spoken  concerning  his  house,  from  the  beginning  even  to  the  end.	
	 For  I  have  told  him  that  I  will  judge  his  house  forever,  for  the  iniquity  which  he  knew,  because  his  sons  brought  a  curse  on  themselves,  and  he  didn't  restrain  them.	
	 Therefore  I  have  sworn  to  the  house  of  Eli,  that  the  iniquity  of  Eli's  house  shall  not  be  removed  with  sacrifice  nor  offering  forever."	
	 Samuel  lay  until  the  morning,  and  opened  the  doors  of  the  house  of  Yahweh.  Samuel  feared  to  show  Eli  the  vision.	
	 Then  Eli  called  Samuel,  and  said,  "Samuel,  my  son!"  He  said,  "Here  I  am."	
	 He  said,  "What  is  the  thing  that  he  has  spoken  to  you?  Please  don't  hide  it  from  me.  God  do  so  to  you,  and  more  also,  if  you  hide  anything  from  me  of  all  the  things  that  he  spoke  to  you."	
	 Samuel  told  him  every  bit,  and  hid  nothing  from  him.  He  said,  "It  is  Yahweh.  Let  him  do  what  seems  good  to  him."	
	 Samuel  grew,  and  Yahweh  was  with  him,  and  let  none  of  his  words  fall  to  the  ground.	
	It  happened  at  that  time,  when  Eli  was  laid  down  in  his  place  (now  his  eyes  had  begun  to  grow  dim,  so  that  he  could  not  see),	
	 All  Israel  from  Dan  even  to  Beersheba  knew  that  Samuel  was  established  to  be  a  prophet  of  Yahweh.	
	 Yahweh  appeared  again  in  Shiloh;  for  Yahweh  revealed  himself  to  Samuel  in  Shiloh  by  the  word  of  Yahweh.	
	and  the  lamp  of  God  hadn't  yet  gone  out,  and  Samuel  had  laid  down  in  the  temple  of  Yahweh,  where  the  ark  of  God  was;	
	that  Yahweh  called  Samuel;  and  he  said,  "Here  I  am."	
	He  ran  to  Eli,  and  said,  "Here  I  am;  for  you  called  me."  He  said,  "I  didn't  call;  lie  down  again."  He  went  and  lay  down.	
	Yahweh  called  yet  again,  "Samuel!"  Samuel  arose  and  went  to  Eli,  and  said,  "Here  I  am;  for  you  called  me."  He  answered,  "I  didn't  call,  my  son;  lie  down  again."	
	Now  Samuel  didn't  yet  know  Yahweh,  neither  was  the  word  of  Yahweh  yet  revealed  to  him.	
	Yahweh  called  Samuel  again  the  third  time.  He  arose  and  went  to  Eli,  and  said,  "Here  I  am;  for  you  called  me."  Eli  perceived  that  Yahweh  had  called  the  child.	
	Therefore  Eli  said  to  Samuel,  "Go,  lie  down	
	The  word  of  Samuel  came  to  all  Israel.  Now  Israel  went  out  against  the  Philistines  to  battle,  and  encamped  beside  Ebenezer	
	 The  Philistines  fought,  and  Israel  was  struck,  and  they  fled  every  man  to  his  tent	
	 The  ark  of  God  was  taken;  and  the  two  sons  of  Eli,  Hophni  and  Phinehas,  were  slain.	
	 There  ran  a  man  of  Benjamin  out  of  the  army,  and  came  to  Shiloh  the  same  day,  with  his  clothes  torn,  and  with  earth  on  his  head.	
	 When  he  came,  behold,  Eli  was  sitting  on  his  seat  by  the  road  watching;  for  his  heart  trembled  for  the  ark  of  God.  When  the  man  came  into  the  city,  and  told  it,  all  the  city  cried  out.	
	 When  Eli  heard  the  noise  of  the  crying,  he  said,  "What  does  the  noise  of  this  tumult  mean?"  The  man  hurried,  and  came  and  told  Eli.	
	 Now  Eli  was  ninety-eight  years  old;  and  his  eyes  were  set,  so  that  he  could  not  see.	
	 The  man  said  to  Eli,  "I  am  he  who  came  out  of  the  army,  and  I  fled  today  out  of  the  army."  He  said,  "How  did  the  matter  go,  my  son?"	
	 He  who  brought  the  news  answered,  "Israel  has  fled  before  the  Philistines,  and  there  has  been  also  a  great  slaughter  among  the  people.  Your  two  sons  also,  Hophni  and  Phinehas,  are  dead,  and  the  ark  of  God  has  been  captured."	
	 It  happened,  when  he  made  mention  of  the  ark  of  God,  that  Eli  fell  from  off  his  seat  backward  by  the  side  of  the  gate;  and  his  neck  broke,  and  he  died;  for  he  was  an  old  man,  and  heavy.  He  had  judged  Israel  forty  years.	
	 His  daughter-in-law,  Phinehas'  wife,  was  with  child,  near  to  be  delivered.  When  she  heard  the  news  that  the  ark  of  God  was  taken,  and  that  her  father-in-law  and  her  husband  were  dead,  she  bowed  herself  and  gave  birth;  for  her  pains  came  on  her.	
	The  Philistines  put  themselves  in  array  against  Israel	
	 About  the  time  of  her  death  the  women  who  stood  by  her  said  to  her,  "Don't  be  afraid;  for  you  have  given  birth  to  a  son."  But  she  didn't  answer,  neither  did  she  regard  it.	
	 She  named  the  child  Ichabod,  {"Ichabod"  means  "no  glory."}  saying,  "The  glory  has  departed  from  Israel;"  because  the  ark  of  God  was  taken,  and  because  of  her  father-in-law  and  her  husband.	
	 She  said,  "The  glory  has  departed  from  Israel;  for  the  ark  of  God  is  taken."	
	When  the  people  had  come  into  the  camp,  the  elders  of  Israel  said,  "Why  has  Yahweh  struck  us  today  before  the  Philistines?  Let  us  get  the  ark  of  the  covenant  of  Yahweh  out  of  Shiloh  to  us,  that  it  may  come  among  us,  and  save  us  out  of  the  hand  of  our  enemies."	
	So  the  people  sent  to  Shiloh;  and  they  brought  from  there  the  ark  of  the  covenant  of  Yahweh  of  Armies,  who  sits  above  the  cherubim	
	When  the  ark  of  the  covenant  of  Yahweh  came  into  the  camp,  all  Israel  shouted  with  a  great  shout,  so  that  the  earth  rang  again.	
	When  the  Philistines  heard  the  noise  of  the  shout,  they  said,  "What  does  the  noise  of  this  great  shout  in  the  camp  of  the  Hebrews  mean?"  They  understood  that  the  ark  of  Yahweh  had  come  into  the  camp.	
	The  Philistines  were  afraid,  for  they  said,  "God  has  come  into  the  camp."  They  said,  "Woe  to  us!  For  there  has  not  been  such  a  thing  before.	
	Woe  to  us!  Who  shall  deliver  us  out  of  the  hand  of  these  mighty  gods?  These  are  the  gods  that  struck  the  Egyptians  with  all  kinds  of  plagues  in  the  wilderness.	
	Be  strong,  and  behave  like  men,  O  you  Philistines,  that  you  not  be  servants  to  the  Hebrews,  as  they  have  been  to  you.  Strengthen  yourselves  like  men,  and  fight!"	
	Now  the  Philistines  had  taken  the  ark  of  God,  and  they  brought  it  from  Ebenezer  to  Ashdod.	
	 So  they  sent  the  ark  of  God  to  Ekron.  It  happened,  as  the  ark  of  God  came  to  Ekron,  that  the  Ekronites  cried  out,  saying,  "They  have  brought  about  the  ark  of  the  God  of  Israel  to  us,  to  kill  us  and  our  people."	
	 They  sent  therefore  and  gathered  together  all  the  lords  of  the  Philistines,  and  they  said,  "Send  away  the  ark  of  the  God  of  Israel,  and  let  it  go  again  to  its  own  place,  that  it  not  kill  us  and  our  people."  For  there  was  a  deadly  confusion  throughout  all  the  city;  the  hand  of  God  was  very  heavy  there.	
	 The  men  who  didn't  die  were  struck  with  the  tumors;  and  the  cry  of  the  city  went  up  to  heaven.	
	The  Philistines  took  the  ark  of  God,  and  brought  it  into  the  house  of  Dagon,  and  set  it  by  Dagon.	
	When  they  of  Ashdod  arose  early  on  the  next  day,  behold,  Dagon  was  fallen  on  his  face  to  the  ground  before  the  ark  of  Yahweh.  They  took  Dagon,  and  set  him  in  his  place  again.	
	When  they  arose  early  on  the  next  day  morning,  behold,  Dagon  was  fallen  on  his  face  to  the  ground  before  the  ark  of  Yahweh;  and  the  head  of  Dagon  and  both  the  palms  of  his  hands  were  cut  off  on  the  threshold.  Only  Dagon's  torso  was  intact.	
	Therefore  neither  the  priests  of  Dagon,  nor  any  who  come  into  Dagon's  house,  tread  on  the  threshold  of  Dagon  in  Ashdod,  to  this  day.	
	But  the  hand  of  Yahweh  was  heavy  on  them  of  Ashdod,  and  he  destroyed  them,  and  struck  them  with  tumors,  even  Ashdod  and  its  borders.	
	When  the  men  of  Ashdod  saw  that  it  was  so,  they  said,  "The  ark  of  the  God  of  Israel  shall  not  stay  with  us;  for  his  hand  is  severe  on  us,  and  on  Dagon  our  god."	
	They  sent  therefore  and  gathered  all  the  lords  of  the  Philistines  to  them,  and  said,  "What  shall  we  do  with  the  ark  of  the  God  of  Israel?"  They  answered,  "Let  the  ark  of  the  God  of  Israel  be  carried  over  to  Gath."  They  carried  the  ark  of  the  God  of  Israel  there.	
	It  was  so,  that  after  they  had  carried  it  about,  the  hand  of  Yahweh  was  against  the  city  with  a  very  great  confusion	
	The  ark  of  Yahweh  was  in  the  country  of  the  Philistines  seven  months.	
	 The  men  did  so,  and  took  two  milk  cows,  and  tied  them  to  the  cart,  and  shut  up  their  calves  at  home;	
	 and  they  put  the  ark  of  Yahweh  on  the  cart,  and  the  coffer  with  the  mice  of  gold  and  the  images  of  their  tumors.	
	 The  cows  took  the  straight  way  by  the  way  to  Beth  Shemesh;  they  went  along  the  highway,  lowing  as  they  went,  and  didn't  turn  aside  to  the  right  hand  or  to  the  left;  and  the  lords  of  the  Philistines  went  after  them  to  the  border  of  Beth  Shemesh.	
	 They  of  Beth  Shemesh  were  reaping  their  wheat  harvest  in  the  valley;  and  they  lifted  up  their  eyes,  and  saw  the  ark,  and  rejoiced  to  see  it.	
	 The  cart  came  into  the  field  of  Joshua  of  Beth  Shemesh,  and  stood  there,  where  there  was  a  great  stone	
	 The  Levites  took  down  the  ark  of  Yahweh,  and  the  coffer  that  was  with  it,  in  which  the  jewels  of  gold  were,  and  put  them  on  the  great  stone	
	 When  the  five  lords  of  the  Philistines  had  seen  it,  they  returned  to  Ekron  the  same  day.	
	 These  are  the  golden  tumors  which  the  Philistines  returned  for  a  trespass  offering  to  Yahweh	
	 and  the  golden  mice,  according  to  the  number  of  all  the  cities  of  the  Philistines  belonging  to  the  five  lords,  both  of  fortified  cities  and  of  country  villages,  even  to  the  great  stone,  whereon  they  set  down  the  ark  of  Yahweh.  That  stone  remains  to  this  day  in  the  field  of  Joshua  of  Beth  Shemesh.	
	 He  struck  of  the  men  of  Beth  Shemesh,  because  they  had  looked  into  the  ark  of  Yahweh,  he  struck  of  the  people  fifty  thousand  seventy  men;  and  the  people  mourned,  because  Yahweh  had  struck  the  people  with  a  great  slaughter.	
	The  Philistines  called  for  the  priests  and  the  diviners,  saying,  "What  shall  we  do  with  the  ark  of  Yahweh?  Show  us  with  which  we  shall  send  it  to  its  place."	
	 The  men  of  Beth  Shemesh  said,  "Who  is  able  to  stand  before  Yahweh,  this  holy  God?  To  whom  shall  he  go  up  from  us?"	
	 They  sent  messengers  to  the  inhabitants  of  Kiriath  Jearim,  saying,  "The  Philistines  have  brought  back  the  ark  of  Yahweh;  come  down,  and  bring  it  up  to  yourselves."	
	They  said,  "If  you  send  away  the  ark  of  the  God  of  Israel,  don't  send  it  empty;  but  by  all  means  return  him  a  trespass  offering	
	Then  they  said,  "What  shall  be  the  trespass  offering  which  we  shall  return  to  him?"  They  said,  "Five  golden  tumors,  and  five  golden  mice,  for  the  number  of  the  lords  of  the  Philistines;  for  one  plague  was  on  you  all,  and  on  your  lords.	
	Therefore  you  shall  make  images  of  your  tumors,  and  images  of  your  mice  that  mar  the  land;  and  you  shall  give  glory  to  the  God  of  Israel	
	Why  then  do  you  harden  your  hearts,  as  the  Egyptians  and  Pharaoh  hardened  their  hearts?  When  he  had  worked  wonderfully  among  them,  didn't  they  let  the  people  go,  and  they  departed?	
	"Now  therefore  take  and  prepare  yourselves  a  new  cart,  and  two  milk  cows,  on  which  there  has  come  no  yoke;  and  tie  the  cows  to  the  cart,  and  bring  their  calves  home  from  them;	
	and  take  the  ark  of  Yahweh,  and  lay  it  on  the  cart;  and  put  the  jewels  of  gold,  which  you  return  him  for  a  trespass  offering,  in  a  coffer  by  its  side;  and  send  it  away,  that  it  may  go.	
	Behold;  if  it  goes  up  by  the  way  of  its  own  border  to  Beth  Shemesh,  then  he  has  done  us  this  great  evil	
	The  men  of  Kiriath  Jearim  came,  and  fetched  up  the  ark  of  Yahweh,  and  brought  it  into  the  house  of  Abinadab  in  the  hill,  and  sanctified  Eleazar  his  son  to  keep  the  ark  of  Yahweh.	
	 As  Samuel  was  offering  up  the  burnt  offering,  the  Philistines  drew  near  to  battle  against  Israel;  but  Yahweh  thundered  with  a  great  thunder  on  that  day  on  the  Philistines,  and  confused  them;  and  they  were  struck  down  before  Israel.	
	 The  men  of  Israel  went  out  of  Mizpah,  and  pursued  the  Philistines,  and  struck  them,  until  they  came  under  Beth  Kar.	
	 Then  Samuel  took  a  stone,  and  set  it  between  Mizpah  and  Shen,  and  called  its  name  Ebenezer,  {"Ebenezer"  means  "stone  of  help."}  saying,  "Yahweh  helped  us  until  now."	
	 So  the  Philistines  were  subdued,  and  they  came  no  more  within  the  border  of  Israel.  The  hand  of  Yahweh  was  against  the  Philistines  all  the  days  of  Samuel.	
	 The  cities  which  the  Philistines  had  taken  from  Israel  were  restored  to  Israel,  from  Ekron  even  to  Gath;  and  Israel  recovered  its  border  out  of  the  hand  of  the  Philistines.  There  was  peace  between  Israel  and  the  Amorites.	
	 Samuel  judged  Israel  all  the  days  of  his  life.	
	 He  went  from  year  to  year  in  circuit  to  Bethel  and  Gilgal,  and  Mizpah;  and  he  judged  Israel  in  all  those  places.	
	 His  return  was  to  Ramah,  for  there  was  his  house;  and  there  he  judged  Israel	
	It  happened,  from  the  day  that  the  ark  stayed  in  Kiriath  Jearim,  that  the  time  was  long;  for  it  was  twenty  years	
	Samuel  spoke  to  all  the  house  of  Israel,  saying,  "If  you  do  return  to  Yahweh  with  all  your  heart,  then  put  away  the  foreign  gods  and  the  Ashtaroth  from  among  you,  and  direct  your  hearts  to  Yahweh,  and  serve  him  only;  and  he  will  deliver  you  out  of  the  hand  of  the  Philistines."	
	Then  the  children  of  Israel  removed  the  Baals  and  the  Ashtaroth,  and  served  Yahweh  only.	
	Samuel  said,  "Gather  all  Israel  to  Mizpah,  and  I  will  pray  for  you  to  Yahweh."	
	They  gathered  together  to  Mizpah,  and  drew  water,  and  poured  it  out  before  Yahweh,  and  fasted  on  that  day,  and  said  there,  "We  have  sinned  against  Yahweh."  Samuel  judged  the  children  of  Israel  in  Mizpah.	
	When  the  Philistines  heard  that  the  children  of  Israel  were  gathered  together  at  Mizpah,  the  lords  of  the  Philistines  went  up  against  Israel.  When  the  children  of  Israel  heard  it,  they  were  afraid  of  the  Philistines.	
	The  children  of  Israel  said  to  Samuel,  "Don't  cease  to  cry  to  Yahweh  our  God  for  us,  that  he  will  save  us  out  of  the  hand  of  the  Philistines."	
	Samuel  took  a  suckling  lamb,  and  offered  it  for  a  whole  burnt  offering  to  Yahweh	
	It  happened,  when  Samuel  was  old,  that  he  made  his  sons  judges  over  Israel.	
	 Samuel  told  all  the  words  of  Yahweh  to  the  people  who  asked  of  him  a  king.	
	 He  said,  "This  will  be  the  way  of  the  king  who  shall  reign  over  you	
	 and  he  will  appoint  them  to  him  for  captains  of  thousands,  and  captains  of  fifties;  and  he  will  assign  some  to  plow  his  ground,  and  to  reap  his  harvest,  and  to  make  his  instruments  of  war,  and  the  instruments  of  his  chariots.	
	 He  will  take  your  daughters  to  be  perfumers,  and  to  be  cooks,  and  to  be  bakers.	
	 He  will  take  your  fields,  and  your  vineyards,  and  your  olive  groves,  even  their  best,  and  give  them  to  his  servants.	
	 He  will  take  the  tenth  of  your  seed,  and  of  your  vineyards,  and  give  to  his  officers,  and  to  his  servants.	
	 He  will  take  your  male  servants,  and  your  female  servants,  and  your  best  young  men,  and  your  donkeys,  and  put  them  to  his  work.	
	 He  will  take  the  tenth  of  your  flocks	
	 You  shall  cry  out  in  that  day  because  of  your  king  whom  you  shall  have  chosen  you;  and  Yahweh  will  not  answer  you  in  that  day."	
	 But  the  people  refused  to  listen  to  the  voice  of  Samuel;  and  they  said,  "No;  but  we  will  have  a  king  over  us,	
	Now  the  name  of  his  firstborn  was  Joel;  and  the  name  of  his  second,  Abijah	
	 that  we  also  may  be  like  all  the  nations,  and  that  our  king  may  judge  us,  and  go  out  before  us,  and  fight  our  battles."	
	 Samuel  heard  all  the  words  of  the  people,  and  he  rehearsed  them  in  the  ears  of  Yahweh.	
	 Yahweh  said  to  Samuel,  "Listen  to  their  voice,  and  make  them  a  king."  Samuel  said  to  the  men  of  Israel,  "Every  man  go  to  his  city."	
	His  sons  didn't  walk  in  his  ways,  but  turned  aside  after  lucre,  and  took  bribes,  and  perverted  justice.	
	Then  all  the  elders  of  Israel  gathered  themselves  together,  and  came  to  Samuel  to  Ramah;	
	and  they  said  to  him,  "Behold,  you  are  old,  and  your  sons  don't  walk  in  your  ways	
	But  the  thing  displeased  Samuel,  when  they  said,  "Give  us  a  king  to  judge  us."  Samuel  prayed  to  Yahweh.	
	Yahweh  said  to  Samuel,  "Listen  to  the  voice  of  the  people  in  all  that  they  tell  you;  for  they  have  not  rejected  you,  but  they  have  rejected  me,  that  I  should  not  be  king  over  them.	
	According  to  all  the  works  which  they  have  done  since  the  day  that  I  brought  them  up  out  of  Egypt  even  to  this  day,  in  that  they  have  forsaken  me,  and  served  other  gods,  so  do  they  also  to  you.	
	Now  therefore  listen  to  their  voice	
	Now  there  was  a  man  of  Benjamin,  whose  name  was  Kish,  the  son  of  Abiel,  the  son  of  Zeror,  the  son  of  Becorath,  the  son  of  Aphiah,  the  son  of  a  Benjamite,  a  mighty  man  of  valor.	
	 Then  Saul  said  to  his  servant,  "Well  said.  Come,  let  us  go."  So  they  went  to  the  city  where  the  man  of  God  was.	
	 As  they  went  up  the  ascent  to  the  city,  they  found  young  maidens  going  out  to  draw  water,  and  said  to  them,  "Is  the  seer  here?"	
	 They  answered  them,  and  said,  "He  is.  Behold,  he  is  before  you.  Hurry  now,  for  he  has  come  today  into  the  city;  for  the  people  have  a  sacrifice  today  in  the  high  place.	
	 As  soon  as  you  have  come  into  the  city,  you  shall  immediately  find  him,  before  he  goes  up  to  the  high  place  to  eat;  for  the  people  will  not  eat  until  he  come,  because  he  blesses  the  sacrifice.  Afterwards  those  who  are  invited  eat.  Now  therefore  go  up;  for  at  this  time  you  shall  find  him."	
	 They  went  up  to  the  city.  As  they  came  within  the  city,  behold,  Samuel  came  out  toward  them,  to  go  up  to  the  high  place.	
	 Now  Yahweh  had  revealed  to  Samuel  a  day  before  Saul  came,  saying,	
	 "Tomorrow  about  this  time  I  will  send  you  a  man  out  of  the  land  of  Benjamin,  and  you  shall  anoint  him  to  be  prince  over  my  people  Israel;  and  he  shall  save  my  people  out  of  the  hand  of  the  Philistines	
	 When  Samuel  saw  Saul,  Yahweh  said  to  him,  "Behold,  the  man  of  whom  I  spoke  to  you!  this  same  shall  have  authority  over  my  people."	
	 Then  Saul  drew  near  to  Samuel  in  the  gate,  and  said,  "Please  tell  me  where  the  seer's  house  is."	
	 Samuel  answered  Saul,  and  said,  "I  am  the  seer.  Go  up  before  me  to  the  high  place,  for  you  shall  eat  with  me  today.  In  the  morning  I  will  let  you  go,  and  will  tell  you  all  that  is  in  your  heart.	
	He  had  a  son,  whose  name  was  Saul,  an  impressive  young  man;  and  there  was  not  among  the  children  of  Israel  a  better  person  than  he.  From  his  shoulders  and  upward  he  was  higher  than  any  of  the  people.	
	 As  for  your  donkeys  who  were  lost  three  days  ago,  don't  set  your  mind  on  them;  for  they  are  found.  For  whom  is  all  that  is  desirable  in  Israel?  Is  it  not  for  you,  and  for  all  your  father's  house?"	
	 Saul  answered,  "Am  I  not  a  Benjamite,  of  the  smallest  of  the  tribes  of  Israel?  And  my  family  the  least  of  all  the  families  of  the  tribe  of  Benjamin?  Why  then  do  you  speak  to  me  like  this?"	
	 Samuel  took  Saul  and  his  servant,  and  brought  them  into  the  guest  room,  and  made  them  sit  in  the  best  place  among  those  who  were  invited,  who  were  about  thirty  persons.	
	 Samuel  said  to  the  cook,  "Bring  the  portion  which  I  gave  you,  of  which  I  said  to  you,  'Set  it  aside.'"	
	 The  cook  took  up  the  thigh,  and  that  which  was  on  it,  and  set  it  before  Saul.  Samuel  said,  "Behold,  that  which  has  been  reserved!  Set  it  before  yourself  and  eat;  because  for  the  appointed  time  has  it  been  kept  for  you,  for  I  said,  'I  have  invited  the  people.'"  So  Saul  ate  with  Samuel  that  day.	
	 When  they  had  come  down  from  the  high  place  into  the  city,  he  talked  with  Saul  on  the  housetop.	
	 They  arose  early	
	 As  they  were  going  down  at  the  end  of  the  city,  Samuel  said  to  Saul,  "Tell  the  servant  pass  on  before  us"  (and  he  passed  on),  "but  stand  still  first,  that  I  may  cause  you  to  hear  the  word  of  God."	
	The  donkeys  of  Kish,  Saul's  father,  were  lost.  Kish  said  to  Saul  his  son,  "Take  now  one  of  the  servants  with  you,  and  arise,  go  seek  the  donkeys."	
	He  passed  through  the  hill  country  of  Ephraim,  and  passed  through  the  land  of  Shalishah,  but  they  didn't  find  them	
	When  they  had  come  to  the  land  of  Zuph,  Saul  said  to  his  servant  who  was  with  him,  "Come,  and  let  us  return,  lest  my  father  stop  caring  about  the  donkeys,  and  be  anxious  for  us."	
	He  said  to  him,  "See  now,  there  is  in  this  city  a  man  of  God,  and  he  is  a  man  who  is  held  in  honor.  All  that  he  says  comes  surely  to  pass.  Now  let  us  go  there.  Perhaps  he  can  tell  us  concerning  our  journey  whereon  we  go."	
	Then  Saul  said  to  his  servant,  "But,  behold,  if  we  go,  what  shall  we  bring  the  man?  For  the  bread  is  spent  in  our  vessels,  and  there  is  not  a  present  to  bring  to  the  man  of  God.  What  do  we  have?"	
	The  servant  answered  Saul  again,  and  said,  "Behold,  I  have  in  my  hand  the  fourth  part  of  a  shekel  of  silver.  I  will  give  that  to  the  man  of  God,  to  tell  us  our  way."	
	(In  earlier  times  in  Israel,  when  a  man  went  to  inquire  of  God,  thus  he  said,  "Come,  and  let  us  go  to  the  seer;"  for  he  who  is  now  called  a  prophet  was  before  called  a  Seer.)	
	Now there was a certain man from __Ramathaim-zophim__ from the hill country of __Ephraim__, and his name was ''Elkanah'' the son of Jeroham, the son of Elihu, the son of Tohu, the son of Zuph, an Ephraimite. 	
	He had two wives: the name of one was ''Hannah'' and the name of the other ''Peninnah''; and Peninnah had children, @@but Hannah had no children@@. 	
	Now this man would go up from his city yearly to worship and to sacrifice to the LORD of hosts in Shiloh. And the two sons of Eli, Hophni and Phinehas, were priests to the LORD there. 	
	When the day came that Elkanah sacrificed, he would give portions to Peninnah his wife and to all her sons and her daughters; 	
	but to Hannah he would give a double portion, for he loved Hannah, but the LORD had closed her womb. 	
	Her rival, however, would provoke her bitterly to irritate her, because the LORD had closed her womb. 	
	It happened year after year, as often as she went up to the house of the LORD, she would provoke her; so she wept and would not eat. 	
	Then Elkanah her husband said to her, "Hannah, why do you weep and why do you not eat and why is your heart sad? Am I not better to you than ten sons?" 	
	Then Hannah rose after eating and drinking in Shiloh. Now Eli the priest was sitting on the seat by the doorpost of the temple of the LORD. 	
	She, greatly distressed, prayed to the LORD and wept bitterly. 	
	She made a vow and said, "O LORD of hosts, if You will indeed look on the affliction of Your maidservant and remember me, and not forget Your maidservant, but will give Your maidservant a son, then I will give him to the LORD all the days of his life, and a razor shall never come on his head." 	
	Now it came about, as she continued praying before the LORD, that Eli was watching her mouth. 	
	As for Hannah, she was speaking in her heart, only her lips were moving, but her voice was not heard. So Eli thought she was drunk. 	
	Then Eli said to her, "How long will you make yourself drunk? Put away your wine from you." 	
	But Hannah replied, "No, my lord, I am a woman oppressed in spirit; I have drunk neither wine nor strong drink, but I have poured out my soul before the LORD. 	
	"Do not consider your maidservant as a worthless woman, for I have spoken until now out of my great concern and provocation." 	
	Then Eli answered and said, "Go in peace; and may the God of Israel grant your petition that you have asked of Him." 	
	She said, "Let your maidservant find favor in your sight." So the woman went her way and ate, and her face was no longer {sad.} 	
	Then they arose early in the morning and worshiped before the LORD, and returned again to their house in Ramah. And Elkanah had relations with Hannah his wife, and the LORD remembered her. 	
	It came about in due time, after Hannah had conceived, that she gave birth to a son; and she named him Samuel, {saying,} "Because I have asked him of the LORD." 	
	Then the man Elkanah went up with all his household to offer to the LORD the yearly sacrifice and {pay} his vow. 	
	But Hannah did not go up, for she said to her husband, "{I will not go up} until the child is weaned; then I will bring him, that he may appear before the LORD and stay there forever." 	
	Elkanah her husband said to her, "Do what seems best to you. Remain until you have weaned him; only may the LORD confirm His word." So the woman remained and nursed her son until she weaned him. 	
	Now when she had weaned him, she took him up with her, with a three-year-old bull and one ephah of flour and a jug of wine, and brought him to the house of the LORD in Shiloh, although the child was young. 	
	Then they slaughtered the bull, and brought the boy to Eli. 	
	She said, "Oh, my lord! As your soul lives, my lord, I am the woman who stood here beside you, praying to the LORD. 	
	"For this boy I prayed, and the LORD has given me my petition which I asked of Him. 	
	"So I have also dedicated him to the LORD; as long as he lives he is dedicated to the LORD." And he worshiped the LORD there.	
<<openTiddlers
     text:"1Samuel.01"
     tiddlers:{{
         var key = "1Samuel 1:";
         t = store.getTiddlers();
         var m = "";
         for(var i=0; i<t.length; i++) {
             if(t[i].title.search(key) != -1) {
                 m += "'" + t[i].title + "' ";
             }
         }
     }}
     closeAll:true
     keepMe:false
 >> 
1 Samuel 2

1Sa 2:1   	Then Hannah prayed and said, "My heart exults in the LORD; My horn is exalted in the LORD, My mouth speaks boldly against my enemies, Because I rejoice in Your salvation.
1Sa 2:2   	"There is no one holy like the LORD, Indeed, there is no one besides You, Nor is there any rock like our God.
1Sa 2:3   	"Boast no more so very proudly, Do not let arrogance come out of your mouth; For the LORD is a God of knowledge, And with Him actions are weighed.
1Sa 2:4   	"The bows of the mighty are shattered, But the feeble gird on strength.
1Sa 2:5   	"Those who were full hire themselves out for bread, But those who were hungry cease {to hunger.} Even the barren gives birth to seven, But she who has many children languishes.
1Sa 2:6   	"The LORD kills and makes alive; He brings down to Sheol and raises up.
1Sa 2:7   	"The LORD makes poor and rich; He brings low, He also exalts.
1Sa 2:8   	"He raises the poor from the dust, He lifts the needy from the ash heap To make them sit with nobles, And inherit a seat of honor; For the pillars of the earth are the LORD'S, And He set the world on them.
1Sa 2:9   	"He keeps the feet of His godly ones, But the wicked ones are silenced in darkness; For not by might shall a man prevail.
1Sa 2:10   	"Those who contend with the LORD will be shattered; Against them He will thunder in the heavens, The LORD will judge the ends of the earth; And He will give strength to His king, And will exalt the horn of His anointed."
1Sa 2:11   	Then Elkanah went to his home at Ramah. But the boy ministered to the LORD before Eli the priest.
1Sa 2:12   	Now the sons of Eli were worthless men; they did not know the LORD
1Sa 2:13   	and the custom of the priests with the people. When any man was offering a sacrifice, the priest's servant would come while the meat was boiling, with a three-pronged fork in his hand.
1Sa 2:14   	Then he would thrust it into the pan, or kettle, or caldron, or pot; all that the fork brought up the priest would take for himself. Thus they did in Shiloh to all the Israelites who came there.
1Sa 2:15   	Also, before they burned the fat, the priest's servant would come and say to the man who was sacrificing, "Give the priest meat for roasting, as he will not take boiled meat from you, only raw."
1Sa 2:16   	If the man said to him, "They must surely burn the fat first, and then take as much as you desire," then he would say, "No, but you shall give {it to me} now; and if not, I will take it by force."
1Sa 2:17   	Thus the sin of the young men was very great before the LORD, for the men despised the offering of the LORD.
1Sa 2:18   	Now Samuel was ministering before the LORD, {as} a boy wearing a linen ephod.
1Sa 2:19   	And his mother would make him a little robe and bring it to him from year to year when she would come up with her husband to offer the yearly sacrifice.
1Sa 2:20   	Then Eli would bless Elkanah and his wife and say, "May the LORD give you children from this woman in place of the one she dedicated to the LORD." And they went to their own home.
1Sa 2:21   	The LORD visited Hannah; and she conceived and gave birth to three sons and two daughters. And the boy Samuel grew before the LORD.
1Sa 2:22   	Now Eli was very old; and he heard all that his sons were doing to all Israel, and how they lay with the women who served at the doorway of the tent of meeting.
1Sa 2:23   	He said to them, "Why do you do such things, the evil things that I hear from all these people?
1Sa 2:24   	"No, my sons; for the report is not good which I hear the LORD'S people circulating.
1Sa 2:25   	"If one man sins against another, God will mediate for him; but if a man sins against the LORD, who can intercede for him?" But they would not listen to the voice of their father, for the LORD desired to put them to death.
1Sa 2:26   	Now the boy Samuel was growing in stature and in favor both with the LORD and with men.
1Sa 2:27   	Then a man of God came to Eli and said to him, "Thus says the LORD, 'Did I {not} indeed reveal Myself to the house of your father when they were in Egypt {in bondage} to Pharaoh's house?
1Sa 2:28   	'Did I {not} choose them from all the tribes of Israel to be My priests, to go up to My altar, to burn incense, to carry an ephod before Me; and did I {not} give to the house of your father all the fire {offerings} of the sons of Israel?
1Sa 2:29   	'Why do you kick at My sacrifice and at My offering which I have commanded {in My} dwelling, and honor your sons above Me, by making yourselves fat with the choicest of every offering of My people Israel?'
1Sa 2:30   	"Therefore the LORD God of Israel declares, 'I did indeed say that your house and the house of your father should walk before Me forever'; but now the LORD declares, 'Far be it from Me for those who honor Me I will honor, and those who despise Me will be lightly esteemed.
1Sa 2:31   	'Behold, the days are coming when I will break your strength and the strength of your father's house so that there will not be an old man in your house.
1Sa 2:32   	'You will see the distress of {My} dwelling, in {spite of} all the good that I do for Israel; and an old man will not be in your house forever.
1Sa 2:33   	'Yet I will not cut off every man of yours from My altar so that your eyes will fail {from weeping} and your soul grieve, and all the increase of your house will die in the prime of life.
1Sa 2:34   	'This will be the sign to you which will come concerning your two sons, Hophni and Phinehas: on the same day both of them will die.
1Sa 2:35   	'But I will raise up for Myself a faithful priest who will do according to what is in My heart and in My soul; and I will build him an enduring house, and he will walk before My anointed always.
1Sa 2:36   	'Everyone who is left in your house will come and bow down to him for a piece of silver or a loaf of bread and say, "Please assign me to one of the priest's offices so that I may eat a piece of bread.'""
1 Samuel 3

1Sa 3:1   	Now the boy Samuel was ministering to the LORD before Eli. And word from the LORD was rare in those days, visions were infrequent.
1Sa 3:2   	It happened at that time as Eli was lying down in his place (now his eyesight had begun to grow dim {and} he could not see {well),}
1Sa 3:3   	and the lamp of God had not yet gone out, and Samuel was lying down in the temple of the LORD where the ark of God {was,}
1Sa 3:4   	that the LORD called Samuel; and he said, "Here I am."
1Sa 3:5   	Then he ran to Eli and said, "Here I am, for you called me." But he said, "I did not call, lie down again." So he went and lay down.
1Sa 3:6   	The LORD called yet again, "Samuel!" So Samuel arose and went to Eli and said, "Here I am, for you called me." But he answered, "I did not call, my son, lie down again."
1Sa 3:7   	Now Samuel did not yet know the LORD, nor had the word of the LORD yet been revealed to him.
1Sa 3:8   	So the LORD called Samuel again for the third time. And he arose and went to Eli and said, "Here I am, for you called me." Then Eli discerned that the LORD was calling the boy.
1Sa 3:9   	And Eli said to Samuel, "Go lie down, and it shall be if He calls you, that you shall say, 'Speak, LORD, for Your servant is listening.' " So Samuel went and lay down in his place.
1Sa 3:10   	Then the LORD came and stood and called as at other times, "Samuel! Samuel!" And Samuel said, "Speak, for Your servant is listening."
1Sa 3:11   	The LORD said to Samuel, "Behold, I am about to do a thing in Israel at which both ears of everyone who hears it will tingle.
1Sa 3:12   	"In that day I will carry out against Eli all that I have spoken concerning his house, from beginning to end.
1Sa 3:13   	"For I have told him that I am about to judge his house forever for the iniquity which he knew, because his sons brought a curse on themselves and he did not rebuke them.
1Sa 3:14   	"Therefore I have sworn to the house of Eli that the iniquity of Eli's house shall not be atoned for by sacrifice or offering forever."
1Sa 3:15   	So Samuel lay down until morning. Then he opened the doors of the house of the LORD. But Samuel was afraid to tell the vision to Eli.
1Sa 3:16   	Then Eli called Samuel and said, "Samuel, my son." And he said, "Here I am."
1Sa 3:17   	He said, "What is the word that He spoke to you? Please do not hide it from me. May God do so to you, and more also, if you hide anything from me of all the words that He spoke to you."
1Sa 3:18   	So Samuel told him everything and hid nothing from him. And he said, "It is the LORD; let Him do what seems good to Him."
1Sa 3:19   	Thus Samuel grew and the LORD was with him and let none of his words fail.
1Sa 3:20   	All Israel from Dan even to Beersheba knew that Samuel was confirmed as a prophet of the LORD.
1Sa 3:21   	And the LORD appeared again at Shiloh, because the LORD revealed Himself to Samuel at Shiloh by the word of the LORD.
1Sa 4:1   	Thus the word of Samuel came to all Israel. Now Israel went out to meet the Philistines in battle and camped beside Ebenezer while the Philistines camped in Aphek.
1Sa 4:2   	The Philistines drew up in battle array to meet Israel. When the battle spread, Israel was defeated before the Philistines who killed about four thousand men on the battlefield.
1Sa 4:3   	When the people came into the camp, the elders of Israel said, "Why has the LORD defeated us today before the Philistines? Let us take to ourselves from Shiloh the ark of the covenant of the LORD, that it may come among us and deliver us from the power of our enemies."
1Sa 4:4   	So the people sent to Shiloh, and from there they carried the ark of the covenant of the LORD of hosts who sits {above} the cherubim; and the two sons of Eli, Hophni and Phinehas, {were} there with the ark of the covenant of God.
1Sa 4:5   	As the ark of the covenant of the LORD came into the camp, all Israel shouted with a great shout, so that the earth resounded.
1Sa 4:6   	When the Philistines heard the noise of the shout, they said, "What {does} the noise of this great shout in the camp of the Hebrews {mean?}" Then they understood that the ark of the LORD had come into the camp.
1Sa 4:7   	The Philistines were afraid, for they said, "God has come into the camp." And they said, "Woe to us! For nothing like this has happened before.
1Sa 4:8   	"Woe to us! Who shall deliver us from the hand of these mighty gods? These are the gods who smote the Egyptians with all {kinds of} plagues in the wilderness.
1Sa 4:9   	"Take courage and be men, O Philistines, or you will become slaves to the Hebrews, as they have been slaves to you; therefore, be men and fight."
1Sa 4:10   	So the Philistines fought and Israel was defeated, and every man fled to his tent; and the slaughter was very great, for there fell of Israel thirty thousand foot soldiers.
1Sa 4:11   	And the ark of God was taken; and the two sons of Eli, Hophni and Phinehas, died.
1Sa 4:12   	Now a man of Benjamin ran from the battle line and came to Shiloh the same day with his clothes torn and dust on his head.
1Sa 4:13   	When he came, behold, Eli was sitting on {his} seat by the road eagerly watching, because his heart was trembling for the ark of God. So the man came to tell {it} in the city, and all the city cried out.
1Sa 4:14   	When Eli heard the noise of the outcry, he said, "What {does} the noise of this commotion {mean?}" Then the man came hurriedly and told Eli.
1Sa 4:15   	Now Eli was ninety-eight years old, and his eyes were set so that he could not see.
1Sa 4:16   	The man said to Eli, "I am the one who came from the battle line. Indeed, I escaped from the battle line today." And he said, "How did things go, my son?"
1Sa 4:17   	Then the one who brought the news replied, "Israel has fled before the Philistines and there has also been a great slaughter among the people, and your two sons also, Hophni and Phinehas, are dead, and the ark of God has been taken."
1Sa 4:18   	When he mentioned the ark of God, Eli fell off the seat backward beside the gate, and his neck was broken and he died, for he was old and heavy. Thus he judged Israel forty years.
1Sa 4:19   	Now his daughter-in-law, Phinehas's wife, was pregnant and about to give birth; and when she heard the news that the ark of God was taken and that her father-in-law and her husband had died, she kneeled down and gave birth, for her pains came upon her.
1Sa 4:20   	And about the time of her death the women who stood by her said to her, "Do not be afraid, for you have given birth to a son." But she did not answer or pay attention.
1Sa 4:21   	And she called the boy Ichabod, saying, "The glory has departed from Israel," because the ark of God was taken and because of her father-in-law and her husband.
1Sa 4:22   	She said, "The glory has departed from Israel, for the ark of God was taken."

1 Samuel 4
Prior Book    Prior Chapter    	    	   Next Chapter    Next Book


Copyright Information

New American Standard Bible®, Copyright © The Lockman Foundation 1960, 1962, 1963, 1968, 1971, 1972, 1973, 1975, 1977, 1995. All rights reserved. Used by permission.

Please visit their website at www.lockman.org.

Return to Bible Text
1Sa 5:1   	Now the Philistines took the ark of God and brought it from Ebenezer to Ashdod.
1Sa 5:2   	Then the Philistines took the ark of God and brought it to the house of Dagon and set it by Dagon.
1Sa 5:3   	When the Ashdodites arose early the next morning, behold, Dagon had fallen on his face to the ground before the ark of the LORD. So they took Dagon and set him in his place again.
1Sa 5:4   	But when they arose early the next morning, behold, Dagon had fallen on his face to the ground before the ark of the LORD. And the head of Dagon and both the palms of his hands {were} cut off on the threshold; only the trunk of Dagon was left to him.
1Sa 5:5   	Therefore neither the priests of Dagon nor all who enter Dagon's house tread on the threshold of Dagon in Ashdod to this day.
1Sa 5:6   	Now the hand of the LORD was heavy on the Ashdodites, and He ravaged them and smote them with tumors, both Ashdod and its territories.
1Sa 5:7   	When the men of Ashdod saw that it was so, they said, "The ark of the God of Israel must not remain with us, for His hand is severe on us and on Dagon our god."
1Sa 5:8   	So they sent and gathered all the lords of the Philistines to them and said, "What shall we do with the ark of the God of Israel?" And they said, "Let the ark of the God of Israel be brought around to Gath." And they brought the ark of the God of Israel {around.}
1Sa 5:9   	After they had brought it around, the hand of the LORD was against the city with very great confusion; and He smote the men of the city, both young and old, so that tumors broke out on them.
1Sa 5:10   	So they sent the ark of God to Ekron. And as the ark of God came to Ekron the Ekronites cried out, saying, "They have brought the ark of the God of Israel around to us, to kill us and our people."
1Sa 5:11   	They sent therefore and gathered all the lords of the Philistines and said, "Send away the ark of the God of Israel, and let it return to its own place, so that it will not kill us and our people." For there was a deadly confusion throughout the city; the hand of God was very heavy there.
1Sa 5:12   	And the men who did not die were smitten with tumors and the cry of the city went up to heaven.

1 Samuel 5
Prior Book    Prior Chapter    	    	   Next Chapter    Next Book


Copyright Information

New American Standard Bible®, Copyright © The Lockman Foundation 1960, 1962, 1963, 1968, 1971, 1972, 1973, 1975, 1977, 1995. All rights reserved. Used by permission.

Please visit their website at www.lockman.org.

Return to Bible Text










































































1Sa 6:1   	Now the ark of the LORD had been in the country of the Philistines seven months.
1Sa 6:2   	And the Philistines called for the priests and the diviners, saying, "What shall we do with the ark of the LORD? Tell us how we shall send it to its place."
1Sa 6:3   	They said, "If you send away the ark of the God of Israel, do not send it empty; but you shall surely return to Him a guilt offering. Then you will be healed and it will be known to you why His hand is not removed from you."
1Sa 6:4   	Then they said, "What shall be the guilt offering which we shall return to Him?" And they said, "Five golden tumors and five golden mice {according to} the number of the lords of the Philistines, for one plague was on all of you and on your lords.
1Sa 6:5   	"So you shall make likenesses of your tumors and likenesses of your mice that ravage the land, and you shall give glory to the God of Israel; perhaps He will ease His hand from you, your gods, and your land.
1Sa 6:6   	"Why then do you harden your hearts as the Egyptians and Pharaoh hardened their hearts? When He had severely dealt with them, did they not allow the people to go, and they departed?
1Sa 6:7   	"Now therefore, take and prepare a new cart and two milch cows on which there has never been a yoke; and hitch the cows to the cart and take their calves home, away from them.
1Sa 6:8   	"Take the ark of the LORD and place it on the cart; and put the articles of gold which you return to Him as a guilt offering in a box by its side. Then send it away that it may go.
1Sa 6:9   	"Watch, if it goes up by the way of its own territory to Beth-shemesh, then He has done us this great evil. But if not, then we will know that it was not His hand that struck us; it happened to us by chance."
1Sa 6:10   	Then the men did so, and took two milch cows and hitched them to the cart, and shut up their calves at home.
1Sa 6:11   	They put the ark of the LORD on the cart, and the box with the golden mice and the likenesses of their tumors.
1Sa 6:12   	And the cows took the straight way in the direction of Beth-shemesh; they went along the highway, lowing as they went, and did not turn aside to the right or to the left. And the lords of the Philistines followed them to the border of Beth-shemesh.
1Sa 6:13   	Now {the people of} Beth-shemesh were reaping their wheat harvest in the valley, and they raised their eyes and saw the ark and were glad to see {it.}
1Sa 6:14   	The cart came into the field of Joshua the Beth-shemite and stood there where there {was} a large stone; and they split the wood of the cart and offered the cows as a burnt offering to the LORD.
1Sa 6:15   	The Levites took down the ark of the LORD and the box that was with it, in which were the articles of gold, and put them on the large stone; and the men of Beth-shemesh offered burnt offerings and sacrificed sacrifices that day to the LORD.
1Sa 6:16   	When the five lords of the Philistines saw it, they returned to Ekron that day.
1Sa 6:17   	These are the golden tumors which the Philistines returned for a guilt offering to the LORD: one for Ashdod, one for Gaza, one for Ashkelon, one for Gath, one for Ekron;
1Sa 6:18   	and the golden mice, {according} to the number of all the cities of the Philistines belonging to the five lords, both of fortified cities and of country villages. The large stone on which they set the ark of the LORD {is a witness} to this day in the field of Joshua the Beth-shemite.
1Sa 6:19   	He struck down some of the men of Beth-shemesh because they had looked into the ark of the LORD. He struck down of all the people, 50,070 men, and the people mourned because the LORD had struck the people with a great slaughter.
1Sa 6:20   	The men of Beth-shemesh said, "Who is able to stand before the LORD, this holy God? And to whom shall He go up from us?"
1Sa 6:21   	So they sent messengers to the inhabitants of Kiriath-jearim, saying, "The Philistines have brought back the ark of the LORD; come down and take it up to you."
1Sa 7:1   	And the men of Kiriath-jearim came and took the ark of the LORD and brought it into the house of Abinadab on the hill, and consecrated Eleazar his son to keep the ark of the LORD.
1Sa 7:2   	From the day that the ark remained at Kiriath-jearim, the time was long, for it was twenty years; and all the house of Israel lamented after the LORD.
1Sa 7:3   	Then Samuel spoke to all the house of Israel, saying, "If you return to the LORD with all your heart, remove the foreign gods and the Ashtaroth from among you and direct your hearts to the LORD and serve Him alone; and He will deliver you from the hand of the Philistines."
1Sa 7:4   	So the sons of Israel removed the Baals and the Ashtaroth and served the LORD alone.
1Sa 7:5   	Then Samuel said, "Gather all Israel to Mizpah and I will pray to the LORD for you."
1Sa 7:6   	They gathered to Mizpah, and drew water and poured it out before the LORD, and fasted on that day and said there, "We have sinned against the LORD." And Samuel judged the sons of Israel at Mizpah.
1Sa 7:7   	Now when the Philistines heard that the sons of Israel had gathered to Mizpah, the lords of the Philistines went up against Israel. And when the sons of Israel heard it, they were afraid of the Philistines.
1Sa 7:8   	Then the sons of Israel said to Samuel, "Do not cease to cry to the LORD our God for us, that He may save us from the hand of the Philistines."
1Sa 7:9   	Samuel took a suckling lamb and offered it for a whole burnt offering to the LORD; and Samuel cried to the LORD for Israel and the LORD answered him.
1Sa 7:10   	Now Samuel was offering up the burnt offering, and the Philistines drew near to battle against Israel. But the LORD thundered with a great thunder on that day against the Philistines and confused them, so that they were routed before Israel.
1Sa 7:11   	The men of Israel went out of Mizpah and pursued the Philistines, and struck them down as far as below Beth-car.
1Sa 7:12   	Then Samuel took a stone and set it between Mizpah and Shen, and named it Ebenezer, saying, "Thus far the LORD has helped us."
1Sa 7:13   	So the Philistines were subdued and they did not come anymore within the border of Israel. And the hand of the LORD was against the Philistines all the days of Samuel.
1Sa 7:14   	The cities which the Philistines had taken from Israel were restored to Israel, from Ekron even to Gath; and Israel delivered their territory from the hand of the Philistines. So there was peace between Israel and the Amorites.
1Sa 7:15   	Now Samuel judged Israel all the days of his life.
1Sa 7:16   	He used to go annually on circuit to Bethel and Gilgal and Mizpah, and he judged Israel in all these places.
1Sa 7:17   	Then his return {was} to Ramah, for his house {was} there, and there he judged Israel; and he built there an altar to the LORD.
1Sa 8:1   	And it came about when Samuel was old that he appointed his sons judges over Israel.
1Sa 8:2   	Now the name of his firstborn was Joel, and the name of his second, Abijah; {they} were judging in Beersheba.
1Sa 8:3   	His sons, however, did not walk in his ways, but turned aside after dishonest gain and took bribes and perverted justice.
1Sa 8:4   	Then all the elders of Israel gathered together and came to Samuel at Ramah;
1Sa 8:5   	and they said to him, "Behold, you have grown old, and your sons do not walk in your ways. Now appoint a king for us to judge us like all the nations."
1Sa 8:6   	But the thing was displeasing in the sight of Samuel when they said, "Give us a king to judge us." And Samuel prayed to the LORD.
1Sa 8:7   	The LORD said to Samuel, "Listen to the voice of the people in regard to all that they say to you, for they have not rejected you, but they have rejected Me from being king over them.
1Sa 8:8   	"Like all the deeds which they have done since the day that I brought them up from Egypt even to this day in that they have forsaken Me and served other gods so they are doing to you also.
1Sa 8:9   	"Now then, listen to their voice; however, you shall solemnly warn them and tell them of the procedure of the king who will reign over them."
1Sa 8:10   	So Samuel spoke all the words of the LORD to the people who had asked of him a king.
1Sa 8:11   	He said, "This will be the procedure of the king who will reign over you: he will take your sons and place {them} for himself in his chariots and among his horsemen and they will run before his chariots.
1Sa 8:12   	"He will appoint for himself commanders of thousands and of fifties, and {some} to do his plowing and to reap his harvest and to make his weapons of war and equipment for his chariots.
1Sa 8:13   	"He will also take your daughters for perfumers and cooks and bakers.
1Sa 8:14   	"He will take the best of your fields and your vineyards and your olive groves and give {them} to his servants.
1Sa 8:15   	"He will take a tenth of your seed and of your vineyards and give to his officers and to his servants.
1Sa 8:16   	"He will also take your male servants and your female servants and your best young men and your donkeys and use {them} for his work.
1Sa 8:17   	"He will take a tenth of your flocks, and you yourselves will become his servants.
1Sa 8:18   	"Then you will cry out in that day because of your king whom you have chosen for yourselves, but the LORD will not answer you in that day."
1Sa 8:19   	Nevertheless, the people refused to listen to the voice of Samuel, and they said, "No, but there shall be a king over us,
1Sa 8:20   	that we also may be like all the nations, that our king may judge us and go out before us and fight our battles."
1Sa 8:21   	Now after Samuel had heard all the words of the people, he repeated them in the LORD'S hearing.
1Sa 8:22   	The LORD said to Samuel, "Listen to their voice and appoint them a king." So Samuel said to the men of Israel, "Go every man to his city."

1 Samuel 8
Prior Book    Prior Chapter    	    	   Next Chapter    Next Book


Copyright Information

New American Standard Bible®, Copyright © The Lockman Foundation 1960, 1962, 1963, 1968, 1971, 1972, 1973, 1975, 1977, 1995. All rights reserved. Used by permission.

Please visit their website at www.lockman.org.

Return to Bible Text










































































1Sa 9:1   	Now there was a man of Benjamin whose name was Kish the son of Abiel, the son of Zeror, the son of Becorath, the son of Aphiah, the son of a Benjamite, a mighty man of valor.
1Sa 9:2   	He had a son whose name was Saul, a choice and handsome {man,} and there was not a more handsome person than he among the sons of Israel; from his shoulders and up he was taller than any of the people.
1Sa 9:3   	Now the donkeys of Kish, Saul's father, were lost. So Kish said to his son Saul, "Take now with you one of the servants, and arise, go search for the donkeys."
1Sa 9:4   	He passed through the hill country of Ephraim and passed through the land of Shalishah, but they did not find {them.} Then they passed through the land of Shaalim, but {they were} not {there.} Then he passed through the land of the Benjamites, but they did not find {them.}
1Sa 9:5   	When they came to the land of Zuph, Saul said to his servant who was with him, "Come, and let us return, or else my father will cease {to be concerned} about the donkeys and will become anxious for us."
1Sa 9:6   	He said to him, "Behold now, there is a man of God in this city, and the man is held in honor; all that he says surely comes true. Now let us go there, perhaps he can tell us about our journey on which we have set out."
1Sa 9:7   	Then Saul said to his servant, "But behold, if we go, what shall we bring the man? For the bread is gone from our sack and there is no present to bring to the man of God. What do we have?"
1Sa 9:8   	The servant answered Saul again and said, "Behold, I have in my hand a fourth of a shekel of silver; I will give {it} to the man of God and he will tell us our way."
1Sa 9:9   	(Formerly in Israel, when a man went to inquire of God, he used to say, "Come, and let us go to the seer"; for {he who is called} a prophet now was formerly called a seer.)
1Sa 9:10   	Then Saul said to his servant, "Well said; come, let us go." So they went to the city where the man of God was.
1Sa 9:11   	As they went up the slope to the city, they found young women going out to draw water and said to them, "Is the seer here?"
1Sa 9:12   	They answered them and said, "He is; see, {he is} ahead of you. Hurry now, for he has come into the city today, for the people have a sacrifice on the high place today.
1Sa 9:13   	"As soon as you enter the city you will find him before he goes up to the high place to eat, for the people will not eat until he comes, because he must bless the sacrifice; afterward those who are invited will eat. Now therefore, go up for you will find him at once."
1Sa 9:14   	So they went up to the city. As they came into the city, behold, Samuel was coming out toward them to go up to the high place.
1Sa 9:15   	Now a day before Saul's coming, the LORD had revealed {this} to Samuel saying,
1Sa 9:16   	"About this time tomorrow I will send you a man from the land of Benjamin, and you shall anoint him to be prince over My people Israel; and he will deliver My people from the hand of the Philistines. For I have regarded My people, because their cry has come to Me."
1Sa 9:17   	When Samuel saw Saul, the LORD said to him, "Behold, the man of whom I spoke to you! This one shall rule over My people."
1Sa 9:18   	Then Saul approached Samuel in the gate and said, "Please tell me where the seer's house is."
1Sa 9:19   	Samuel answered Saul and said, "I am the seer. Go up before me to the high place, for you shall eat with me today; and in the morning I will let you go, and will tell you all that is on your mind.
1Sa 9:20   	"As for your donkeys which were lost three days ago, do not set your mind on them, for they have been found. And for whom is all that is desirable in Israel? Is it not for you and for all your father's household?"
1Sa 9:21   	Saul replied, "Am I not a Benjamite, of the smallest of the tribes of Israel, and my family the least of all the families of the tribe of Benjamin? Why then do you speak to me in this way?"
1Sa 9:22   	Then Samuel took Saul and his servant and brought them into the hall and gave them a place at the head of those who were invited, who were about thirty men.
1Sa 9:23   	Samuel said to the cook, "Bring the portion that I gave you, concerning which I said to you, 'Set it aside.' "
1Sa 9:24   	Then the cook took up the leg with what was on it and set {it} before Saul. And {Samuel} said, "Here is what has been reserved! Set {it} before you {and} eat, because it has been kept for you until the appointed time, since I said I have invited the people." So Saul ate with Samuel that day.
1Sa 9:25   	When they came down from the high place into the city, {Samuel} spoke with Saul on the roof.
1Sa 9:26   	And they arose early; and at daybreak Samuel called to Saul on the roof, saying, "Get up, that I may send you away." So Saul arose, and both he and Samuel went out into the street.
1Sa 9:27   	As they were going down to the edge of the city, Samuel said to Saul, "Say to the servant that he might go ahead of us and pass on, but you remain standing now, that I may proclaim the word of God to you."
1Sa 9:1 Now there was a man of Benjamin whose name was Kish the son of Abiel, the son of Zeror, the son of Becorath, the son of Aphiah, the son of a Benjamite, a mighty man of valor.
1Sa 9:2 He had a son whose name was Saul, a choice and handsome {man,} and there was not a more handsome person than he among the sons of Israel; from his shoulders and up he was taller than any of the people.
1Sa 9:3 Now the donkeys of Kish, Saul's father, were lost. So Kish said to his son Saul, "Take now with you one of the servants, and arise, go search for the donkeys."
1Sa 9:4 He passed through the hill country of Ephraim and passed through the land of Shalishah, but they did not find {them.} Then they passed through the land of Shaalim, but {they were} not {there.} Then he passed through the land of the Benjamites, but they did not find {them.}
1Sa 9:5 When they came to the land of Zuph, Saul said to his servant who was with him, "Come, and let us return, or else my father will cease {to be concerned} about the donkeys and will become anxious for us."
1Sa 9:6 He said to him, "Behold now, there is a man of God in this city, and the man is held in honor; all that he says surely comes true. Now let us go there, perhaps he can tell us about our journey on which we have set out."
1Sa 9:7 Then Saul said to his servant, "But behold, if we go, what shall we bring the man? For the bread is gone from our sack and there is no present to bring to the man of God. What do we have?"
1Sa 9:8 The servant answered Saul again and said, "Behold, I have in my hand a fourth of a shekel of silver; I will give {it} to the man of God and he will tell us our way."
1Sa 9:9 (Formerly in Israel, when a man went to inquire of God, he used to say, "Come, and let us go to the seer"; for {he who is called} a prophet now was formerly called a seer.)
1Sa 9:10 Then Saul said to his servant, "Well said; come, let us go." So they went to the city where the man of God was.
1Sa 9:11 As they went up the slope to the city, they found young women going out to draw water and said to them, "Is the seer here?"
1Sa 9:12 They answered them and said, "He is; see, {he is} ahead of you. Hurry now, for he has come into the city today, for the people have a sacrifice on the high place today.
1Sa 9:13 "As soon as you enter the city you will find him before he goes up to the high place to eat, for the people will not eat until he comes, because he must bless the sacrifice; afterward those who are invited will eat. Now therefore, go up for you will find him at once."
1Sa 9:14 So they went up to the city. As they came into the city, behold, Samuel was coming out toward them to go up to the high place.
1Sa 9:15 Now a day before Saul's coming, the LORD had revealed {this} to Samuel saying,
1Sa 9:16 "About this time tomorrow I will send you a man from the land of Benjamin, and you shall anoint him to be prince over My people Israel; and he will deliver My people from the hand of the Philistines. For I have regarded My people, because their cry has come to Me."
1Sa 9:17 When Samuel saw Saul, the LORD said to him, "Behold, the man of whom I spoke to you! This one shall rule over My people."
1Sa 9:18 Then Saul approached Samuel in the gate and said, "Please tell me where the seer's house is."
1Sa 9:19 Samuel answered Saul and said, "I am the seer. Go up before me to the high place, for you shall eat with me today; and in the morning I will let you go, and will tell you all that is on your mind.
1Sa 9:20 "As for your donkeys which were lost three days ago, do not set your mind on them, for they have been found. And for whom is all that is desirable in Israel? Is it not for you and for all your father's household?"
1Sa 9:21 Saul replied, "Am I not a Benjamite, of the smallest of the tribes of Israel, and my family the least of all the families of the tribe of Benjamin? Why then do you speak to me in this way?"
1Sa 9:22 Then Samuel took Saul and his servant and brought them into the hall and [[gave them a place at the head of those who were invited, who were about thirty men.]]
1Sa 9:23 Samuel said to the cook, "Bring the portion that I gave you, concerning which I said to you, 'Set it aside.' "
1Sa 9:24 Then the cook took up the leg with what was on it and set {it} before Saul. And {Samuel} said, "Here is what has been reserved! Set {it} before you {and} eat, because it has been kept for you until the appointed time, since I said I have invited the people." So Saul ate with Samuel that day.
1Sa 9:25 When they came down from the high place into the city, {Samuel} spoke with Saul on the roof.
1Sa 9:26 And they arose early; and at daybreak Samuel called to Saul on the roof, saying, "Get up, that I may send you away." So Saul arose, and both he and Samuel went out into the street.
1Sa 9:27 As they were going down to the edge of the city, Samuel said to Saul, "Say to the servant that he might go ahead of us and pass on, but you remain standing now, that I may proclaim the word of God to you."
1Sa 10:1   	Then ''Samuel'' took the flask of oil, poured it on his head, kissed him and said, "Has not the LORD anointed you a ruler over His inheritance?

1Sa 10:2   	"When you go from me today, then you will find ''two men'' close to Rachel's tomb in the territory of Benjamin at __Zelzah__; and they will say to you, 'The donkeys which you went to look for have been found. Now behold, your father has ceased to be concerned about the donkeys and is anxious for you, saying, "What shall I do about my son?'"

1Sa 10:3   	"Then you will go on further from there, and you will come as far as __the oak of Tabor__, and there ''three men'' going up to God at Bethel will meet you, one carrying three young goats, another carrying three loaves of bread, and another carrying a jug of wine;

1Sa 10:4   	and they will greet you and give you two {loaves} of bread, which you will accept from their hand.

1Sa 10:5   	''//Afterward//'' you will come to the __hill of God__ where the Philistine garrison is; and it shall be as soon as you have come there to the city, that you will meet a group of prophets coming down from the high place with harp, tambourine, flute, and a lyre before them, and they will be prophesying.

1Sa 10:6   	"Then the __''Spirit of the LORD''__ will come upon you mightily, and you shall prophesy with them and [[be changed into another man]].

1Sa 10:7   	"It shall be when these signs come to you, do for yourself what the occasion requires, for God is with you.

1Sa 10:8   	"And you shall go down before me to __Gilgal__; and behold, I will come down to you to offer burnt offerings and sacrifice peace offerings. You shall wait //''seven days''// until I come to you and show you what you should do."

1Sa 10:9   	''//Then it//'' happened when he turned his back to leave Samuel, God changed his heart; and all those signs came about on that day.

1Sa 10:10   	@@color(#990000):When they came to the hill there, behold, a group of prophets met him; and the __''Spirit of God''__ came upon him mightily, so that he prophesied among them.@@

1Sa 10:11   	It came about, when ''all who knew him previously'' saw that he prophesied now with the prophets, that the people said to one another, "What has happened to the son of Kish? Is Saul also among the prophets?"

1Sa 10:12   	A man there said, "Now, who is their father?" Therefore it became a proverb: [["Is Saul also among the prophets?"]]

1Sa 10:13   	When he had finished prophesying, he came to the high place.

1Sa 10:14   	Now ''Saul's uncle'' said to him and his servant, "Where did you go?" And he said, "To look for the donkeys. When we saw that they could not be found, we went to Samuel."

1Sa 10:15   	Saul's uncle said, "Please tell me what Samuel said to you."

1Sa 10:16   	So Saul said to his uncle, "He told us plainly that the donkeys had been found." But he did not tell him about the matter of the __''kingdom ''__which Samuel had mentioned. [[Why didn't he tell his uncle?]]

1Sa 10:17   	''//Thereafter//'' Samuel called the people together to the LORD at __Mizpah__;

1Sa 10:18   	and he said to the ''sons of Israel'', "Thus says the LORD, the God of Israel, 'I brought Israel up from Egypt, and I delivered you from the hand of the Egyptians and from the power of all the kingdoms that were oppressing you.'

1Sa 10:19   	"But you have today rejected your God, who delivers you from all your calamities and your distresses; yet you have said, 'No, but set a king over us!' Now therefore, present yourselves before the LORD by your tribes and by your clans."

1Sa 10:20   	@@color(#ff3333):Thus Samuel brought all the tribes of Israel near, and the ''tribe of Benjamin'' was taken by lot.@@[[Why would Saul be picked if not from Judah? Gen49:10]]

1Sa 10:21   	Then he brought the tribe of Benjamin near by its families, and the ''Matrite family'' was taken. And Saul the son of Kish was taken; but when they looked for him, he could not be found. [[Why was he hiding?]]

1Sa 10:22   	Therefore they inquired further of the LORD, "Has the man come here yet?" So the LORD said, "Behold, he is hiding himself by the baggage."

1Sa 10:23   	So they ran and took him from there, and when he stood among the people, he was taller than any of the people from his shoulders upward.

1Sa 10:24   	Samuel said to all the people, "Do you see him whom the LORD has chosen? Surely there is no one like him among all the people." So all the people shouted and said, "{Long} live the __''king''__!"

1Sa 10:25   	Then Samuel told the people the ordinances of the __''kingdom''__, and wrote {them} in the book and placed {it} before the LORD. And Samuel sent all the people away, each one to his house.

1Sa 10:26   	Saul also went to his house at __Gibeah__; and ''the valiant {men} whose hearts God had touched'' went with him.

1Sa 10:27   	But certain ''worthless men'' said, "How can this one deliver us?" And they despised him and did not bring him any present. But he kept silent.
Chapter 10

We left Samuel and Saul walking together, probably some private way over the fields down from Ramah, perhaps in the paths of the vineyards, and Saul expecting to hear from Samuel the word of God. Now here we have, I. The anointing of Saul then and there (v. 1). The signs Samuel gave him (v. 2-6). And instructions (v. 7-8). II. The accomplishment of those signs to the satisfaction of Saul (v. 9–13). III. His return to his father’s house (v. 14–16). IV. His public election by lot, and solemn inauguration (v. 17–25). V. His return to his own city (v. 26, 27). It is a great work that is here a doing, the setting up not only of a monarch, but of monarchy itself, in Israel; and therefore in all the advances towards it much of God is seen.

1Sa 10:1-8

Samuel is here executing the office of a prophet, giving Saul full assurance from God that he should be king, as he was afterwards, according to these prophecies which went before of him.

I. He anointed him and kissed him, v. 1. This was not done in a solemn assembly, but it was done by divine appointment, which made up the want of all external solemnities, nor was it ever the less valid for its being done in private, under a hedge, or, as the Jews say, by a fountain. God’s institutions are great and honourable, though the circumstances of their administration be ever so mean and despicable. 

1. Samuel, by anointing Saul, assured him that it was God’s act to make him king: Is it not because the Lord hath anointed thee? And, in token of that, the high priest was anointed to his office, to signify the conferring of those gifts upon him that were requisite for the discharge of its duties, and the same was intimated in the anointing of kings; for whom God calls he qualifies, and suitable qualifications furnish good proof of a commission. @@These sacred unctions, then used, pointed at the great Messiah, or anointed one, the king of the church, and high priest of our profession, who was anointed with the oil of the Spirit, not by measure, but without measure, and above all the priests and princes of the Jewish church.@@ 

It was common oil, no doubt, which Samuel used, and we read not of his blessing it or praying over it. @@But it was only a vial of oil that he anointed him with, the vessel brittle, because his kingdom would soon be cracked and broken, and the quantity small, because he had but little of the Spirit conferred upon him to what David had, who was therefore anointed with a horn of oil, as were Solomon and Jehu with a box of oil.@@ 

2. By kissing him, he assured him of his own approbation of the choice, not only his consent to it, but his complacency in it, though it abridged his power and eclipsed his glory and the glory of his family. "God has anointed thee,’’ says Samuel, "to be king, and I am satisfied and very well pleased, in pledge of which take this kiss.’’ It was likewise a kiss of homage and allegiance; hereby he not only owns him to be king, but his king, and in this sense we are commanded to kiss the Son, Ps. 2:12. God has anointed him, and therefore we must thus acknowledge him and do homage to him. In Samuel’s explication of the ceremony, he reminds him, 
(1.) Of the nature of the government to which he is called. He was anointed to be a captain, a commander indeed, which bespeaks honour and power, but a commander in war, which bespeaks care, and toil, and danger. 
(2.) Of the origin of it: The Lord hath anointed thee. By him he ruled, and therefore must rule for him, in dependence on him, and with an eye to his glory. 
(3.) Of the end of it. It is over his inheritance, to take care of that, protect it, and order all the affairs of it for the best, as a steward whom a great man sets over his estate, to manage it for his service and give an account of it to him.

II. For his further satisfaction he gives him some signs, which should come to pass immediately, this very day; and they were such as would not only confirm the word of Samuel in general, and prove him a true prophet, but would confirm this word to Saul in particular, that he should be king. 

1. He should presently meet with some that would bring him intelligence from home of the care his father’s house was in concerning him, v. 2. These he would meet hard by Rachel’s sepulchre. The first place Samuel directed him to was a sepulchre, the sepulchre of one of his ancestors, for Rachel died in travail with Benjamin; there he must read a lecture of his own mortality, and now that he had a crown in his eye must think of his grave, in which all his honour would be laid in the dust. Here two men would meet him, perhaps sent on purpose to look after him, and would tell him the asses were found, and his father was in pain concerning him, saying, What shall I do for my son? He would reckon it happened well that he met with these messengers; and it is good to eye Providence in favourable conjunctures (though the matter be minute) and to be encouraged to trust it in greater matters. 

2. He should next meet with others going to Bethel, where, it should seem, there was a high place for religious worship, and these men were bringing their sacrifices thither, v. 3, 4. It was a token for good to one that was designed for the government of Israel, wherever he came, to meet with people going to worship God. It is supposed that those kids and loaves, and the bottle of wine which the three men had with them, were designed for sacrifice, with the meat-offerings and drink-offerings that were to attend the sacrifice; yet Samuel tells Saul that they will give him two of their loaves, and he must take them. Such a present would look to us now like the relieving of a beggar. Saul must hereafter remember the time when he received alms, and must therefore be humble and charitable to the poor. But perhaps it would then be construed a fit present for a prince; and, as such, Saul must receive it, the first present that was brought to him, by such as knew not what they did, nor why they did it, but God put it into their hearts, which made it the more fit to be a sign to him. These two loaves, which were the first tribute paid to this newly-anointed king, might serve for an admonition to him not to spend the wealth of his crown in luxury, but still to be content with plain food. Bread is the staff of life. 

3. The most remarkable sign of all would be his joining with a company of prophets that he should meet with, under the influence of a spirit of prophecy, which should at that time come upon him. What God works in us by his Spirit serves much more for the confirming of faith than any thing wrought for us by his providence. He here (v. 5, 6) tells him, 
(1.) Where this would happen: At the hill of God, where there was a garrison of the Philistines, which is supposed to be near Gibeah, his own city, for there was the Philistines’ garrison, ch. 13:3. Perhaps it was one of the articles of Samuel’s agreement with them that they should have a garrison there, or, rather, after they were subdued in the beginning of his time they got ground again, so far as to force this garrison into that place, and thence God raised up the man that should chastise them. There was a place that was called the hill of God, because of one of the schools of the prophets built upon it; and such respect did even Philistines themselves pay to religion that a garrison of their soldiers suffered a school of God’s prophets to live peaceably by them, and did not only not dislodge them, but not restrain nor disturb the public exercises of their devotion. 
(2.) Upon what occasion; he should meet a company of prophets with music before them, prophesying, and with them he should join himself. These prophets were not (as it should seem) divinely inspired to foretel things to come, nor did God reveal himself to them by dreams and visions, but they employed themselves in the study of the law, in instructing their neighbours, and in the acts of piety, especially in praising God, wherein they were wonderfully assisted and enlarged by the Spirit of God. It was happy for Israel that they had not only prophets, but companies of prophets, who gave them good instructions and set them good examples, and helped very much to keep up religion among them. Now the word of the Lord was not precious, as it had been when Samuel was first raised up, who had been instrumental in founding these colleges, or religious houses, whence, it is probable, the synagogues took their rise. What a pity was it that Israel should be weary of the government of such a man, who though he had not, as a man of war, expelled the Philistines, yet (which was a greater kindness to Israel) had, as a man of God, settled the schools of the prophets! Music was then used as a proper means to dispose the mind to receive the impressions of the good Spirit, as it did Elisha’s, 2 Ki. 3:15. But we have no reason to look for the same benefit by it now, unless we saw it as effectual as it was then in Saul’s case, to drive away the evil spirit. These prophets had been at the high place, probably offering sacrifice, and now they came back singing psalms. We should come from holy ordinances with our hearts greatly enlarged in holy joy and praise. See Ps. 138:5. Saul should find himself strongly moved to join with them, and should be turned thereby into another man from what he had been while he lived in a private capacity. The Spirit of God, by his ordinances, changes men, wonderfully transforms them; Saul, by praising God in the communion of saints, became another man, but whether a new man or no may be questioned.

III. He directs him to proceed in the administration of his government as Providence should lead him, and as Samuel should advise him. 

1. He must follow Providence in ordinary cases (v. 7): "Do as occasion shall serve thee. Take such measures as thy own prudence shall direct thee.’’ But, 
2. In an extraordinary strait that would hereafter befal him at Gilgal, and would be the most critical juncture of all, when he would have special need of divine aids, he must wait for Samuel to come to him, and must tarry seven days in expectation of him, v. 8. How his failing in this matter proved his fall we find afterwards, ch. 13:11. It was now a plain intimation to him that he was upon his good behaviour, and, though a king, must act under the direction of Samuel, and do as he should order him. The greatest of men must own themselves in subjection to God and his word.

1Sa 10:9-16

Saul has now taken his leave of Samuel, much amazed, we may well suppose, at what has been done to him, almost ready to question whether he be awake or no, and whether it be not all a dream. Now here we are told,

I. What occurred by the way, v. 9. Those signs which Samuel had given him came to pass very punctually; but that which gave him the greatest satisfaction of all was this, he found immediately that God had given him another heart. A new fire was kindled in his breast, such as he had never before been acquainted with: seeking the asses is quite out of his mind, and he thinks of nothing but fighting the Philistines, redressing the grievances of Israel, making laws, administering justice, and providing for the public safety; these are the things that now fill his head. He finds himself raised to such a pitch of boldness and bravery as he never thought he should be conscious of. He has no longer the heart of a husbandman, which is low, and mean, and narrow, and concerned only about his corn and cattle; but the heart of a statesman, a general, a prince. Whom God calls to any service he will make fit for it. If he advance to another station, he will give another heart, to those who sincerely desire to serve him with their power.

II. What occurred when he came near home. They came to the hill (v. 10), that is, to Gibeah, or Geba, which signifies a hill, and so the Chaldee here takes it as a proper name; he met with the prophets as Samuel had told him, and the Spirit of God came upon him, strongly and suddenly (so the word signifies), but not so as to rest and abide upon him. It came on so as to go off quickly. However, for the present, it had a strange effect upon him; for he immediately joined with the prophets in their devotion, and that with as much decorum and as great a transport of affection as any of them: He prophesied among them. Now,

1. His prophesying was publicly taken notice of, v. 11, 12. He was now among his acquaintance, who, when they saw him among the prophets, called one another to come and see a strange sight. This would prepare them to accept him as a king, though one of themselves, when they had seen how God had advanced him to the honour of a prophet. The seventy elders prophesied before they were made judges, Num. 11:25. Now, 
(1.) They all wondered to see Saul among the prophets: What is this that has come to the son of Kish? Though this school of the prophets was near his father’s house, yet he had never associated with them, nor shown them any respect, perhaps had sometimes spoken slightly of them; and now to see him prophesying among them was a surprise to them, as it was long after when his namesake, in the New Testament, preached that gospel which he had before persecuted, Acts 9:21. Where God gives another heart it will soon show itself. 
(2.) One of them, that was wiser than the rest, asked, "Who is their father, or instructor? Is is not God? Are they not all taught of him? Do they not all owe their gifts to him? And is he limited? Cannot he make Saul a prophet, as well as any of them, if he please?’’ Or, "Is not Samuel their father?’’ Under God, he was so; and Saul had now lately been with him, which, by his servant, he might know. No marvel for him to prophesy who lay last night under Samuel’s roof. 
(3.) It became a proverb, commonly used in Israel, when they would express their wonder at a bad man’s either becoming good, or at least being found in good company, Is Saul among the prophets? Note, Saul among the prophets is a wonder to a proverb. Let not the worst be despaired of, yet let not an external show of devotion, and a sudden change for the present, be too much relied on; for Saul among the prophets was Saul still.

2. His being anointed was kept private. When he had done prophesying, 
(1.) It should seem he uttered all his words before the Lord, and recommended the affair to his favour, for he went straight to the high place (v. 13), to give God thanks for his mercies to him and to pray for the continuance of those mercies. But, 
(2.) He industriously concealed from his relations what had passed. His uncle, who met with him either at the high place or as soon as he came home, examined him, v. 14. Saul owned, for his servant knew it, that they had been with Samuel, and that he told them the asses were found, but said not a word of the kingdom, v. 14, 15. This was an instance, 
[1.] Of his humility. Many a one would have been so elated with this surprising elevation as to proclaim it upon the house-top. But Saul, though he might please himself with it in his own breast, did not pride himself in it among his neighbours. The heirs of the kingdom of glory are well enough pleased that the world knows them not, 1 Jn. 3:1. 
[2.] Of his prudence. Had he been forward to proclaim it, he would have been envied, and he knew not what difficulty that might have created him. Samuel had communicated it to him as a secret, and he knows how to keep counsel. Thus it appears that he had another heart, a heart fit for government. 
[3.] Of his dependence upon God. He does not go about to make an interest for himself, but leaves it to God to carry on his own work by Samuel, and, for his own part, sits still, to see how the matter will fall.

1Sa 10:17-27

Saul’s nomination to the throne is here made public, in a general assembly of the elders of Israel, the representatives of their respective tribes at Mizpeh. It is probable that this convention of the states was called as soon as conveniently it might, after Saul was anointed, for, if there must be a change in their government, the sooner the better: it might be of bad consequence to be long in the doing. The people having met in a solemn assembly, in which God was in a peculiar manner present (and therefore it is said they were called together unto the Lord, v. 17), Samuel acts for God among them.

I. He reproves them for casting off the government of a prophet, and desiring that of a captain. 1. He shows them (v. 18) how happy they had been under the divine government; when God ruled them, he delivered them out of the hand of those that oppressed them, and what would they desire more? Could the mightiest man of valour do that for them which the Almighty God had done? 
2. He likewise shows them (v. 19) what an affront they had put upon God (who had himself saved them out of all their tribulations, by his own power, and by such as he had immediately called and qualified) in desiring a king to save them. He tells them in plain terms, "You have this day rejected your God; you have in effect done it: so he construes it, and he might justly, for your so doing, reject you.’’ Those that can live better by sense than by faith, that stay themselves upon an arm of flesh rather than upon the almighty arm, forsake a fountain of living waters for broken cisterns. And some make their obstinacy in this matter to be a presage of their rejecting Christ, in casting off whom they cast off God, that he should not reign over them.

II. He puts them upon choosing their king by lot. He knew whom God had chosen, and had already anointed him, but he knew also the peevishness of that people, and that there were those among them who would not acquiesce in the choice if it depended upon his single testimony; and therefore, that every tribe and every family of the chosen tribe might please themselves with having a chance for it, he calls them to the lot, v. 19. Benjamin is taken out of all the tribes (v. 20), and out of that tribe Saul the son of Kish, v. 21. By this method it would appear to the people, as it already appeared to Samuel, that Saul was appointed of God to be king; for the disposal of the lot is of the Lord. It would also prevent all disputes and exceptions; for the lot causeth contentions to cease, and parteth between the mighty. When the tribe of Benjamin was taken, they might easily foresee that they were setting up a family that would soon be put down again; for dying Jacob had, by the spirit of prophecy, entailed the dominion upon Judah. Judah is the tribe that must rule as a lion; Benjamin shall only ravin as a wolf, Gen. 49:10, 27. Those therefore that knew the scriptures could not be very fond of the doing of that which they foresaw must, ere long, be undone again.

III. It is with much ado, and not without further enquiries of the Lord, that Saul is at length produced. When the lot fell upon him, every one expected he should answer to his name at the first call, but, instead of that, none of his friends could find him (v. 21), he had hidden himself among the stuff (v. 22), so little fond was he now of that power which yet, when he was in possession of, he could not without the utmost indignation think of parting with.

1. He withdrew, in hopes that, upon his not appearing, they would proceed to another choice, or thus to express his modesty; for, by what had already passed, he knew he must be the man. We may suppose he was at this time really averse to take upon him the government, 
(1.) Because he was conscious to himself of unfitness for so great a trust. He had not been bred up to books, or arms, or courts, and feared he should be guilty of some fatal blunder. 
(2.) Because it would expose him to the envy of his neighbours that were ill-affected towards him. 
(3.) Because he understood, by what Samuel had said, that the people sinned in asking a king, and it was in anger that God granted their request. 
(4.) Because the affairs of Israel were at this time in a bad posture; the Philistines were strong, the Ammonites threatening: and he must be bold indeed that will set sail in a storm.

2. But the congregation, believing that choice well made which God himself made, would leave no way untried to find him out on whom the lot fell. They enquired of the Lord, either by the high priest, and his breast-plate of judgment, or by Samuel, and his spirit of prophecy; and the Lord directed them where they should find him, hidden among the carriages, and thence they fetched him, v. 23. Note, None will be losers at last by their humility and modesty. Honour, like the shadow, follows those that flee from it, but flees from those that pursue it.

IV. Samuel presents him to the people, and they accept him. He needed not to mount the bench, or scaffold, to be seen; when he stood upon even ground with the rest he was seen above them all, for he was taller than any of them by head and shoulders, v. 23. "Look you,’’ said Samuel, "what a king God has chosen for you, just such a one as you wished for; there is none like him among all the people, that has so much majesty in his countenance and such a graceful stateliness in his mien; he is in the crowd like a cedar among the shrubs. Let your own eyes be judges, is he not a brave and gallant man?’’ The people hereupon signified their approbation of the choice, and their acceptance of him; they shouted and said, Let the king live, that is, "Let him long reign over us in health and prosperity.’’ Subjects were wont to testify their affection and allegiance to their prince by their good wishes, and those turned (as our translation does this) into addresses to God. Ps. 72:15, Prayer shall be made for him continually. See Ps. 20:1. Samuel had told them they would soon be weary of their king, but, in the mind they are now in, they will never be so: Let the king live.

V. Samuel settles the original contract between them, and leaves it upon record, v. 25. He had before told them the manner of the king (ch. 8:11), how he would abuse his power; now he tells them the manner of the kingdom, or rather the law, or judgment, or constitution, of it, what power the prince might challenge and the utmost of the property the subject might claim. He fixed the land-marks between them, that neither might encroach upon the other. Let them rightly understand one another at first, and let the agreement remain in black and white, which will tend to preserve a good understanding between them ever after. The learned bishop Patrick thinks he now repeated and registered what he had told them (ch. 8:11) of the arbitrary power their kings would assume, that it might hereafter be a witness against them that they had drawn the calamity upon themselves, for they were warned what it would come to and yet they would have a king.

VI. The convention was dissolved when the solemnity was over: Samuel sent every man to his house. Here were no votes passed, nor, for aught that appears, so much as a motion made, for the raising of money to support the dignity of their new-elected king; if therefore he afterwards thinks fit to take what they do not think fit to give (which yet it was necessary that he should have), they must thank themselves. They went every man to his house, pleased with the name of a king over them, and Saul also went home to Gibeah, to his father’s house, not puffed up with the name of a kingdom under him. At Gibeah he had no palace, no throne, no court, yet thither he goes. If he must be a king, as one mindful of the rock out of which he was hewn, he will make his own city the royal city, nor will he be ashamed (as too many are when they are preferred) of his mean relations. Such a humble spirit as this puts a beauty and lustre upon great advancements. The condition rising, and the mind not rising with it, behold how good and pleasant it is! But,

1. How did the people stand affected to their new king? The generality of them, it should seem, did not show themselves much concerned: They went every man to his own house. Their own domestic affairs lay nearer their hearts than any interests of the public; this was the general temper. But, 
(1.) There were some so faithful as to attend him: A band of men whose hearts God had touched, v. 26. Not the body of the people, but a small company, who because they were fond of their own choice of a king, or because they had so much more sense than their neighbours as to conclude that if he was a king he ought to be respected accordingly, went with him to Gibeah, as his life-guard. They were those whose hearts God had touched, in this instance, to do their duty. Note, Whatever good there is in us, or is done by us, at any time, it must be ascribed to the grace of God. If the heart bend at any time the right way, it is because he has touched it. One touch is enough, when it is divine. 
(2.) There were others so spiteful as to affront him; children of Belial, men that would endure no yoke, that would be pleased with nothing that either God or Samuel did; they despised him (v. 27) for the meanness of his tribe and family, the smallness of his estate, and the privacy of his education; and they said, How shall this man save us? Yet they did not propose any man more likely; nor, whomsoever they had, must their salvation come from the man, but from God. They would not join with their neighbours in testifying an affection to him and his government, by bringing him presents, or addressing him upon his accession to the crown. Perhaps those discontented spirits were most earnest for a king, and yet, now that they had one, they quarrelled with him, because he was not altogether such a one as themselves. It was reason enough for them not to like him because others did. Thus differently are men affected to our exalted Redeemer. God hath set him king upon the holy hill of Sion. There is a remnant that submit to him, rejoice in him, bring him presents, and follow him wherever he goes; and they are those whose hearts God has touched, whom he has made willing in the day of his power. But there are others who despise him, who ask, How shall this man save us? They are offended in him, stumble at his external meanness, and they will be broken by it.

2. How did Saul resent the bad conduct of those that were disaffected to his government? He held his peace. Margin, He was as though he had been deaf. He was so far from resenting it that he seemed not to take notice of it, which was an evidence of his humility and modesty, and the mercifulness of his disposition, and also that he was well satisfied with his title to the crown; for those are commonly most jealous of their honour, and most revengeful of affronts, that gain their power by improper means. Christ held his peace when he was affronted, for it was the day of his patience; but there is a day of recompence coming.
Return to Top

Cite This Page: (explanation of citations)

Henry, Matthew. "Commentary on 1 Samuel 10." Matthew Henry Commentary on the Whole Bible. Blue Letter Bible. 01 Mar 1996. 4 Oct 2007.
<http://www.blueletterbible.org/Comm/mhc/1Sa/1Sa010.html>.
clear
1Sa 10:1   	Then ''Samuel'' took the flask of oil, poured it on his head, kissed him and said, 
<<<

"Has not the LORD anointed you a ruler over His inheritance?

1Sa 10:2   	"When you go from me //''today''//, then you will find ''two men'' close to Rachel's tomb in the territory of Benjamin at __Zelzah__; and they will say to you, 'The donkeys which you went to look for have been found. Now behold, your father has ceased to be concerned about the donkeys and is anxious for you, saying, "What shall I do about my son?'"

1Sa 10:3   	"//''Then''// you will go on further from there, and you will come as far as __the oak of Tabor__, and there three men going up to God at Bethel will meet you, one carrying three young goats, another carrying three loaves of bread, and another carrying a jug of wine;

1Sa 10:4   	and they will greet you and give you two {loaves} of bread, which you will accept from their hand.

1Sa 10:5   	''//Afterward//'' you will come to __the hill of God__ where the Philistine garrison is; and it shall be as soon as you have come there to the city, that you will meet ''a group of prophets'' coming down from the high place with harp, tambourine, flute, and a lyre before them, and they will be prophesying.

1Sa 10:6   	"Then the __''Spirit of the LORD''__ will come upon you mightily, and @@you shall prophesy with them@@ and [[be changed into another man]].

1Sa 10:7   	"It shall be when these signs come to you, do for yourself what the occasion requires, for God is with you.

1Sa 10:8   	"And you shall go down before me to __Gilgal__*; and behold, I will come down to you to offer burnt offerings and sacrifice peace offerings. You shall wait seven days until I come to you and show you what you should do."

<<<
1Sa 10:9   	Then it happened when he turned his back to leave Samuel, God @@changed his heart@@; and all those signs came about //''on that day''//.

1Sa 10:10   	When they came to the hill there, behold, a group of prophets met him; and the __''Spirit of God''__ came upon him mightily, so that he prophesied among them.

1Sa 10:11   	It came about, when all who knew him previously saw that he prophesied now with the prophets, that the people said to one another, "What has happened to the son of Kish? Is ''Saul'' also among the prophets?"

1Sa 10:12   	A man there said, "Now, who is their father?" Therefore it became a proverb: "Is Saul also among the prophets?"

1Sa 10:13   	When he had finished prophesying, he came to the high place.

1Sa 10:14   	Now ''Saul's uncle'' said to him and his servant, "Where did you go?" And he said, "To look for the donkeys. When we saw that they could not be found, we went to Samuel."

1Sa 10:15   	Saul's uncle said, "Please tell me what Samuel said to you."

1Sa 10:16   	So Saul said to his uncle, "He told us plainly that the donkeys had been found." [[But he did not tell him about the matter of the kingdom which Samuel had mentioned.]]

1Sa 10:17   	//''Thereafter''// Samuel called the people together to the LORD at __Mizpah__*;

<<<
1Sa 10:18   	and he said to the sons of Israel, "Thus says the LORD, the God of Israel, 'I brought Israel up from Egypt, and I delivered you from the hand of the Egyptians and from the power of all the kingdoms that were oppressing you.'

1Sa 10:19   	@@color(#cc0000):"But you have today rejected your God, who delivers you from all your calamities and your distresses; yet you have said, 'No, but set a king over us!' Now therefore, present yourselves before the LORD by your tribes and by your clans."@@
<<<

1Sa 10:20   	Thus Samuel brought ''all the tribes of Israel'' near, and [[the tribe of Benjamin was taken by lot]].

1Sa 10:21   	Then he brought the tribe of Benjamin near by its families, and the Matrite family was taken. And Saul the son of Kish was taken; but when they looked for him, he could not be found.

1Sa 10:22   	Therefore they inquired further of the LORD, "Has the man come here yet?" So the LORD said, "Behold, he is hiding himself by the baggage."

1Sa 10:23   	So they ran and took him from there, and when he stood among the people, he was taller than any of the people from his shoulders upward.

1Sa 10:24   	Samuel said to all the people, "Do you see him whom the LORD has chosen? Surely there is no one like him among all the people." So all the people shouted and said, "{Long} live the __''king''__!"

1Sa 10:25   	Then Samuel told the people the ordinances of the kingdom, and wrote {them} in the book and placed {it} before the LORD. And Samuel sent all the people away, each one to his house.

1Sa 10:26   	Saul also went to his house at __Gibeah__*; and ''the valiant {men} whose hearts God had touched'' went with him.

1Sa 10:27   	But certain worthless men said, "How can this one deliver us?" And they despised him and did not bring him any present. But he kept silent.
God chooses unstable king for unstable people
1Sa 11:1   	Now Nahash the Ammonite came up and besieged Jabesh-gilead; and all the men of Jabesh said to Nahash, "Make a covenant with us and we will serve you."
1Sa 11:2   	But Nahash the Ammonite said to them, "I will make {it} with you on this condition, that I will gouge out the right eye of every one of you, thus I will make it a reproach on all Israel."
1Sa 11:3   	The elders of Jabesh said to him, "Let us alone for seven days, that we may send messengers throughout the territory of Israel. Then, if there is no one to deliver us, we will come out to you."
1Sa 11:4   	Then the messengers came to Gibeah of Saul and spoke these words in the hearing of the people, and all the people lifted up their voices and wept.
1Sa 11:5   	Now behold, Saul was coming from the field behind the oxen, and he said, "What is {the matter} with the people that they weep?" So they related to him the words of the men of Jabesh.
1Sa 11:6   	Then the Spirit of God came upon Saul mightily when he heard these words, and he became very angry.
1Sa 11:7   	He took a yoke of oxen and cut them in pieces, and sent {them} throughout the territory of Israel by the hand of messengers, saying, "Whoever does not come out after Saul and after Samuel, so shall it be done to his oxen." Then the dread of the LORD fell on the people, and they came out as one man.
1Sa 11:8   	He numbered them in Bezek; and the sons of Israel were 300,000, and the men of Judah 30,000.
1Sa 11:9   	They said to the messengers who had come, "Thus you shall say to the men of Jabesh-gilead, 'Tomorrow, by the time the sun is hot, you will have deliverance.' " So the messengers went and told the men of Jabesh; and they were glad.
1Sa 11:10   	Then the men of Jabesh said, "Tomorrow we will come out to you, and you may do to us whatever seems good to you."
1Sa 11:11   	The next morning Saul put the people in three companies; and they came into the midst of the camp at the morning watch and struck down the Ammonites until the heat of the day. Those who survived were scattered, so that no two of them were left together.
1Sa 11:12   	Then the people said to Samuel, "Who is he that said, 'Shall Saul reign over us?' Bring the men, that we may put them to death."
1Sa 11:13   	But Saul said, "Not a man shall be put to death this day, for today the LORD has accomplished deliverance in Israel."
1Sa 11:14   	Then Samuel said to the people, "Come and let us go to Gilgal and renew the kingdom there."
1Sa 11:15   	So all the people went to Gilgal, and there they made Saul king before the LORD in Gilgal. There they also offered sacrifices of peace offerings before the LORD; and there Saul and all the men of Israel rejoiced greatly.

1 Samuel 11
Prior Book    Prior Chapter    	    	   Next Chapter    Next Book


Copyright Information

New American Standard Bible®, Copyright © The Lockman Foundation 1960, 1962, 1963, 1968, 1971, 1972, 1973, 1975, 1977, 1995. All rights reserved. Used by permission.

Please visit their website at www.lockman.org.

Return to Bible Text











































































1 There was a certain man of Ramathaim-zophim of the hill country of Ephraim whose name was [[Elkanah]] the son of Jeroham, son of Elihu, son of Tohu, son of Zuph, an Ephrathite. 
2 He had two wives. The name of the one was Hannah, and the name of the other, Peninnah. And Peninnah had children, but Hannah had no children.
3 Now this man used to go up year by year from his city to worship and to sacrifice to the Lord of hosts at Shiloh, where the two sons of Eli, Hophni and Phinehas, were priests of the Lord. 
4 On the day when Elkanah sacrificed, he would give portions to Peninnah his wife and to all her sons and daughters. 
| Main Division | Chapters | Chapter Themes | Summary (& map[[here|http://scriptures.lds.org/biblemaps/10]])  |
| [[Samuel, the last Judge]] | <<tiddler [[1Samuel.01]]>> |   |  |
| [[Samuel, the last Judge]] | [[1Samuel.02]] |   |   |
| [[Samuel, the last Judge]] | [[1Samuel.03]] |   |   |
| [[Samuel, the last Judge]] | [[1Samuel.04]] |   |   |
| [[Samuel, the last Judge]] | [[1Samuel.05]] |   |   |
| [[Samuel, the last Judge]] | [[1Samuel.06]] |   |   |
| [[Samuel, the last Judge]] | [[1Samuel.07]] |   |   |
| [[From Samuel to Saul, Judges to Kings]] | [[1Samuel.08]] |   |   |
| [[From Samuel to Saul, Judges to Kings]]  | [[1Samuel.09]] |   |   |
|  [[From Samuel to Saul, Judges to Kings]]  | [[1Samuel.10]] | <<tiddler [[1Samuel.10theme]]>>  |   |
|  [[From Samuel to Saul, Judges to Kings]]  | <<tiddler [[1Sam 11]]>> |   |   |
|  [[From Samuel to Saul, Judges to Kings]]  | <<tiddler [[1Sam 12]]>> |   |   |
|  [[From Samuel to Saul, Judges to Kings]]  | <<tiddler [[1Sam 13]]>> |   |   |
|  [[From Samuel to Saul, Judges to Kings]]  | <<tiddler [[1Sam 14]]>> |   |   |
|  [[From Samuel to Saul, Judges to Kings]]  | <<tiddler [[1Sam 15]]>> |  Obedience to God completely | Saul had one last chance and failed   |
| [[the Preparation of another King]] | <<tiddler [[1Sam 16]]>> |  God looks at the heart | God annoints David  |
| [[the Preparation of another King]] | <<tiddler [[1Sam 17]]>> | the battle is the Lord's  |  David kills Goliath |
| [[the Preparation of another King]] | <<tiddler [[1Sam 18]]>> | As long as you're in God's will you'll be successful (eventually)  |  Saul tries to get David killed but David is too successful (Saul ends up with a son-in law instead) |
| [[the Preparation of another King]] | <<tiddler [[1Sam 19]]>> |  contentment, obedience and patience | God keeps providing a way for David to escape Saul's wrath  |
| [[the Preparation of another King]] | <<tiddler [[1Sam 20]]>> |  friendship loyalty, the bitterness of truth, being aligned with God | Jonathan sees the true Saul, David on the run. This time you see why he was "a man after God's own heart" David goes into hiding |
| [[the Preparation of another King]] | <<tiddler [[1Sam 21]]>> |  Saul's instability | David getting established in hiding, with beginnings of army, Saul kills innocents, cutting ties to Saul's reign  |
| [[the Preparation of another King]] | <<tiddler [[1Sam 22]]>> | cont...  | cont...  |
| [[the Preparation of another King]] | <<tiddler [[1Sam 23]]>> | patience and persistence | People scared by Saul to reveal David's whereabouts, but David eludes|
| [[the Preparation of another King]]  | <<tiddler [[1Sam 24]]>> |   |   |
| [[the Preparation of another King]]  | <<tiddler [[1Sam 25]]>> |   |   |
|  [[the Preparation of another King]]  | <<tiddler [[1Sam 26]]>> |   |   |
|  [[the Preparation of another King]]  | <<tiddler [[1Sam 27]]>> |   |   |
|  [[the Preparation of another King]]  | <<tiddler [[1Sam 28]]>> |   |   |
|  [[the Preparation of another King]]  | <<tiddler [[1Sam 29]]>> |   |   |
|  [[the Preparation of another King]]  | <<tiddler [[1Sam 30]]>> |   |   |
|  [[the Preparation of another King]]  | <<tiddler [[1Sam 31]]>> |   |   |
written approximately 700 BC, about same time as [[2nd Samuel]], 300 years after Ruth was written.  Then next bible book written was probably [[1st Kings]] approximately 100 years after

this would have put the writing shortly after the northern kingdom of Isreal was captured and disbursed by the Assyrians in 721 BC

   [1:1]After the death of Saul, when David had returned from striking 
down the Amalekites, David remained two days in Ziklag. [2]And on the 
third day, behold, a man came from Saul's camp, with his clothes torn and 
dirt on his head. And when he came to David, he fell to the ground and 
paid homage. [3]David said to him, "Where do you come from?" And he said 
to him, "I have escaped from the camp of Israel." [4]And David said to 
him, "How did it go? Tell me." And he answered, "The people fled from the 
battle, and also many of the people have fallen and are dead, and Saul 
and his son Jonathan are also dead." [5]Then David said to the young man 
who told him, "How do you know that Saul and his son Jonathan are dead?" 
[6]And the young man who told him said, "By chance I happened to be on 
Mount Gilboa, and there was Saul leaning on his spear, and behold, the 
chariots and the horsemen were close upon him. [7]And when he looked 
behind him, he saw me, and called to me. And I answered, 'Here I am.' 
[8]And he said to me, 'Who are you?' I answered him, 'I am an Amalekite.' 
[9]And he said to me 'Stand beside me and kill me, for anguish has seized 
me, and yet my life still lingers.' [10]So I stood beside him and killed 
him, because I was sure that he could not live after he had fallen. And I 
took the crown that was on his head and the armlet that was on his arm, 
and I have brought them here to my lord."
   [11]Then David took hold of his clothes and tore them, and so did all 
the men who were with him. [12]And they mourned and wept and fasted until 
evening for Saul and for Jonathan his son and for the people of the LORD 
and for the house of Israel, because they had fallen by the sword. 
[13]And David said to the young man who told him, "Where do you come 
from?" And he answered, "I am the son of a sojourner, an Amalekite." 
[14]David said to him, "How is it you were not afraid to put out your 
hand to destroy the LORD's anointed?" [15]Then David called one of the 
young men and said, "Go, execute him." And he struck him down so that he 
died. [16]And David said to him, "Your blood be on your head, for your 
own mouth has testified against you, saying, 'I have killed the LORD's 
anointed.'"
   [17]And David lamented with this lamentation over Saul and Jonathan 
his son, [18]and he said it should be taught to the people of Judah; 
behold, it is written in the Book of Jashar. He said:

  [19]"Your glory, O Israel, is slain on your high places!
    How the mighty have fallen!
  [20]Tell it not in Gath,
    publish it not in the streets of Ashkelon,
  lest the daughters of the Philistines rejoice,
    lest the daughters of the uncircumcised exult.

  [21]"You mountains of Gilboa,
    let there be no dew or rain upon you,
    nor fields of offerings!
  For there the shield of the mighty was defiled,
    the shield of Saul, not anointed with oil.

  [22]"From the blood of the slain,
    from the fat of the mighty,
  the bow of Jonathan turned not back,
    and the sword of Saul returned not empty.

  [23]"Saul and Jonathan, beloved and lovely!
    In life and in death they were not divided;
  they were swifter than eagles;
    they were stronger than lions.

  [24]"You daughters of Israel, weep over Saul,
    who clothed you luxuriously in scarlet,
    who put ornaments of gold on your apparel.

  [25]"How the mighty have fallen
    in the midst of the battle!

  "Jonathan lies slain on your high places.
    [26]I am distressed for you, my brother Jonathan;
  very pleasant have you been to me;
    your love to me was extraordinary,
    surpassing the love of women.

  [27]"How the mighty have fallen,
    and the weapons of war perished!"
   [2:1]After this David inquired of the LORD, "Shall I go up into any of 
the cities of Judah?" And the LORD said to him, "Go up." David said, "To 
which shall I go up?" And he said, "To Hebron." [2]So David went up 
there, and his two wives also, Ahinoam of Jezreel and Abigail the widow 
of Nabal of Carmel. [3]And David brought up his men who were with him, 
everyone with his household, and they lived in the towns of Hebron. 
[4]And the men of Judah came, and there they anointed David king over the 
house of Judah.
   When they told David, "It was the men of Jabesh-gilead who buried 
Saul," [5]David sent messengers to the men of Jabesh-gilead and said to 
them, "May you be blessed by the LORD, because you showed this loyalty to 
Saul your lord and buried him. [6]Now may the LORD show steadfast love 
and faithfulness to you. And I will do good to you because you have done 
this thing. [7]Now therefore let your hands be strong, and be valiant, 
for Saul your lord is dead, and the house of Judah has anointed me king 
over them."
   [8]But Abner the son of Ner, commander of Saul's army, took Ish-
bosheth the son of Saul and brought him over to Mahanaim, [9]and he made 
him king over Gilead and the Ashurites and Jezreel and Ephraim and 
Benjamin and all Israel. [10]Ish-bosheth, Saul's son, was forty years old 
when he began to reign over Israel, and he reigned two years. But the 
house of Judah followed David. [11]And the time that David was king in 
Hebron over the house of Judah was seven years and six months.
   [12]Abner the son of Ner, and the servants of Ish-bosheth the son of 
Saul, went out from Mahanaim to Gibeon. [13]And Joab the son of Zeruiah 
and the servants of David went out and met them at the pool of Gibeon. 
And they sat down, the one on the one side of the pool, and the other on 
the other side of the pool. [14]And Abner said to Joab, "Let the young 
men arise and compete before us." And Joab said, "Let them arise." 
[15]Then they arose and passed over by number, twelve for Benjamin and 
Ish-bosheth the son of Saul, and twelve of the servants of David. [16]And 
each caught his opponent by the head and thrust his sword in his 
opponent's side, so they fell down together. Therefore that place was 
called Helkath-hazzurim, which is at Gibeon. [17]And the battle was very 
fierce that day. And Abner and the men of Israel were beaten before the 
servants of David.
   [18]And the three sons of Zeruiah were there, Joab, Abishai, and 
Asahel. Now Asahel was as swift of foot as a wild gazelle. [19]And Asahel 
pursued Abner, and as he went, he turned neither to the right hand nor to 
the left from following Abner. [20]Then Abner looked behind him and said, 
"Is it you, Asahel?" And he answered, "It is I." [21]Abner said to him, 
"Turn aside to your right hand or to your left, and seize one of the 
young men and take his spoil." But Asahel would not turn aside from 
following him. [22]And Abner said again to Asahel, "Turn aside from 
following me. Why should I strike you to the ground? How then could I 
lift up my face to your brother Joab?" [23]But he refused to turn aside. 
Therefore Abner struck him in the stomach with the butt of his spear, so 
that the spear came out at his back. And he fell there and died where he 
was. And all who came to the place where Asahel had fallen and died, 
stood still.
   [24]But Joab and Abishai pursued Abner. And as the sun was going down 
they came to the hill of Ammah, which lies before Giah on the way to the 
wilderness of Gibeon. [25]And the people of Benjamin gathered themselves 
together behind Abner and became one group and took their stand on the 
top of a hill. [26]Then Abner called to Joab, "Shall the sword devour 
forever? Do you not know that the end will be bitter? How long will it be 
before you tell your people to turn from the pursuit of their brothers?" 
[27]And Joab said, "As God lives, if you had not spoken, surely the men 
would not have given up the pursuit of their brothers until the morning." 
[28]So Joab blew the trumpet, and all the men stopped and pursued Israel 
no more, nor did they fight anymore.
   [29]And Abner and his men went all that night through the Arabah. They 
crossed the Jordan, and marching the whole morning, they came to 
Mahanaim. [30]Joab returned from the pursuit of Abner. And when he had 
gathered all the people together, there were missing from David's 
servants nineteen men besides Asahel. [31]But the servants of David had 
struck down of Benjamin 360 of Abner's men. [32]And they took up Asahel 
and buried him in the tomb of his father, which was at Bethlehem. And 
Joab and his men marched all night, and the day broke upon them at 
Hebron. (ESV)
   [3:1]There was a long war between the house of Saul and the house of 
David. And David grew stronger and stronger, while the house of Saul 
became weaker and weaker.
   [2]And sons were born to David at Hebron: his firstborn was Amnon, of 
Ahinoam of Jezreel; [3]and his second, Chileab, of Abigail the widow of 
Nabal of Carmel; and the third, Absalom the son of Maacah the daughter of 
Talmai king of Geshur; [4]and the fourth, Adonijah the son of Haggith; 
and the fifth, Shephatiah the son of Abital; [5]and the sixth, Ithream, 
of Eglah, David's wife. These were born to David in Hebron.
   [6]While there was war between the house of Saul and the house of 
David, Abner was making himself strong in the house of Saul. [7]Now Saul 
had a concubine whose name was Rizpah, the daughter of Aiah. And Ish-
bosheth said to Abner, "Why have you gone in to my father's concubine?" 
[8]Then Abner was very angry over the words of Ish-bosheth and said, "Am 
I a dog's head of Judah? To this day I keep showing steadfast love to the 
house of Saul your father, to his brothers, and to his friends, and have 
not given you into the hand of David. And yet you charge me today with a 
fault concerning a woman. [9]God do so to Abner and more also, if I do 
not accomplish for David what the LORD has sworn to him, [10]to transfer 
the kingdom from the house of Saul and set up the throne of David over 
Israel and over Judah, from Dan to Beersheba." [11]And Ish-bosheth could 
not answer Abner another word, because he feared him.
   [12]And Abner sent messengers to David on his behalf, saying, "To whom 
does the land belong? Make your covenant with me, and behold, my hand 
shall be with you to bring over all Israel to you." [13]And he said, 
"Good; I will make a covenant with you. But one thing I require of you; 
that is, you shall not see my face unless you first bring Michal, Saul's 
daughter, when you come to see my face." [14]Then David sent messengers 
to Ish-bosheth, Saul's son, saying, "Give me my wife Michal, for whom I 
paid the bridal price of a hundred foreskins of the Philistines." [15]And 
Ish-bosheth sent and took her from her husband Paltiel the son of Laish. 
[16]But her husband went with her, weeping after her all the way to 
Bahurim. Then Abner said to him, "Go, return." And he returned.
   [17]And Abner conferred with the elders of Israel, saying, "For some 
time past you have been seeking David as king over you. [18]Now then 
bring it about, for the LORD has promised David, saying, 'By the hand of 
my servant David I will save my people Israel from the hand of the 
Philistines, and from the hand of all their enemies.'" [19]Abner also 
spoke to Benjamin. And then Abner went to tell David at Hebron all that 
Israel and the whole house of Benjamin thought good to do.
   [20]When Abner came with twenty men to David at Hebron, David made a 
feast for Abner and the men who were with him. [21]And Abner said to 
David, "I will arise and go and will gather all Israel to my lord the 
king, that they may make a covenant with you, and that you may reign over 
all that your heart desires." So David sent Abner away, and he went in 
peace.
   [22]Just then the servants of David arrived with Joab from a raid, 
bringing much spoil with them. But Abner was not with David at Hebron, 
for he had sent him away, and he had gone in peace. [23]When Joab and all 
the army that was with him came, it was told Joab, "Abner the son of Ner 
came to the king, and he has let him go, and he has gone in peace." 
[24]Then Joab went to the king and said, "What have you done? Behold, 
Abner came to you. Why is it that you have sent him away, so that he is 
gone? [25]You know that Abner the son of Ner came to deceive you and to 
know your going out and your coming in, and to know all that you are 
doing."
   [26]When Joab came out from David's presence, he sent messengers after 
Abner, and they brought him back from the cistern of Sirah. But David did 
not know about it. [27]And when Abner returned to Hebron, Joab took him 
aside into the midst of the gate to speak with him privately, and there 
he struck him in the stomach, so that he died, for the blood of Asahel 
his brother. [28]Afterward, when David heard of it, he said, "I and my 
kingdom are forever guiltless before the LORD for the blood of Abner the 
son of Ner. [29]May it fall upon the head of Joab and upon all his 
father's house, and may the house of Joab never be without one who has a 
discharge or who is leprous or who holds a spindle or who falls by the 
sword or who lacks bread!" [30]So Joab and Abishai his brother killed 
Abner, because he had put their brother Asahel to death in the battle at 
Gibeon.
   [31]Then David said to Joab and to all the people who were with him, 
"Tear your clothes and put on sackcloth and mourn before Abner." And King 
David followed the bier. [32]They buried Abner at Hebron. And the king 
lifted up his voice and wept at the grave of Abner, and all the people 
wept. [33]And the king lamented for Abner, saying,

  "Should Abner die as a fool dies?
  [34]Your hands were not bound;
    your feet were not fettered;
  as one falls before the wicked
    you have fallen."
And all the people wept again over him. [35]Then all the people came to 
persuade David to eat bread while it was yet day. But David swore, 
saying, "God do so to me and more also, if I taste bread or anything else 
till the sun goes down!" [36]And all the people took notice of it, and it 
pleased them, as everything that the king did pleased all the people. 
[37]So all the people and all Israel understood that day that it had not 
been the king's will to put to death Abner the son of Ner. [38]And the 
king said to his servants, "Do you not know that a prince and a great man 
has fallen this day in Israel? [39]And I was gentle today, though 
anointed king. These men, the sons of Zeruiah, are more severe than I. 
The LORD repay the evildoer according to his wickedness!" (ESV)
   [4:1]When Ish-bosheth, Saul's son, heard that Abner had died at 
Hebron, his courage failed, and all Israel was dismayed. [2]Now Saul's 
son had two men who were captains of raiding bands; the name of the one 
was Baanah, and the name of the other Rechab, sons of Rimmon a man of 
Benjamin from Beeroth (for Beeroth also is counted part of Benjamin; 
[3]the Beerothites fled to Gittaim and have been sojourners there to this 
day).
   [4]Jonathan, the son of Saul, had a son who was crippled in his feet. 
He was five years old when the news about Saul and Jonathan came from 
Jezreel, and his nurse took him up and fled, and as she fled in her 
haste, he fell and became lame. And his name was Mephibosheth.
   [5]Now the sons of Rimmon the Beerothite, Rechab and Baanah, set out, 
and about the heat of the day they came to the house of Ish-bosheth as he 
was taking his noonday rest. [6]And they came into the midst of the house 
as if to get wheat, and they stabbed him in the stomach. Then Rechab and 
Baanah his brother escaped. [7]When they came into the house, as he lay 
on his bed in his bedroom, they struck him and put him to death and 
beheaded him. They took his head and went by the way of the Arabah all 
night, [8]and brought the head of Ish-bosheth to David at Hebron. And 
they said to the king, "Here is the head of Ish-bosheth, the son of Saul, 
your enemy, who sought your life. The LORD has avenged my lord the king 
this day on Saul and on his offspring." [9]But David answered Rechab and 
Baanah his brother, the sons of Rimmon the Beerothite, "As the LORD 
lives, who has redeemed my life out of every adversity, [10]when one told 
me, 'Behold, Saul is dead,' and thought he was bringing good news, I 
seized him and killed him at Ziklag, which was the reward I gave him for 
his news. [11]How much more, when wicked men have killed a righteous man 
in his own house on his bed, shall I not now require his blood at your 
hand and destroy you from the earth?" [12]And David commanded his young 
men, and they killed them and cut off their hands and feet and hanged 
them beside the pool at Hebron. But they took the head of Ish-bosheth and 
buried it in the tomb of Abner at Hebron. (ESV)
[[2Sam 01]]...[[2Sam 11]]...[[2Sam 20]]
[[2Sam 02]]...[[2Sam 12]]...[[2Sam 21]]
[[2Sam 03]]...[[2Sam 13]]...[[2Sam 22]]
[[2Sam 04]]...[[2Sam 14]]...[[2Sam 23]]
[[2Sam 05]]...[[2Sam 15]]...[[2Sam 24]]
[[2Sam 06]]...[[2Sam 16]]
[[2Sam 07]]...[[2Sam 17]]
[[2Sam 08]]...[[2Sam 18]]
[[2Sam 09]]...[[2Sam 19]]
[[2Sam 10]]...[[2Sam 20]]



<<options>>
<<option chkUseYourSearch>> Use 'Your Search' //([[more options|YourSearch Options]])//
from Robert Jamieson:  ''Amalek-the powerful tribe which inhabited the country immediately to the eastward of the northern Cushites. Their territory extended over the whole of the eastern portion of the desert of Sinai to Rephidim-the earliest opponent ( Deu 25:18  Exd 17:8-16 ) -the hereditary and restless enemy of Israel ( Num 14:45  Jdg 3:13  6:3 ), and who had not repented ( 1Sa 14:48 ) of their bitter and sleepless hatred during the five hundred years that had elapsed since their doom was pronounced. Being a people of nomadic habits, they were as plundering and dangerous as the Bedouin Arabs, particularly to the southern tribes.''
Ammon

The Hebrew tradition makes ''this tribe descendants of Lot and hence related to the Israelites'' (Genesis 19:38). This is reflected in the name usually employed in Old Testament to designate them, Ben `Ammi, Bene `Ammon, "son of my people," "children of my people," i.e. relatives. Hence we find that the Israelites are commanded to avoid conflict with them on their march to the Promised Land (Deuteronomy 2:19). Their dwelling-place was on the east of the Dead Sea and the Jordan, between the Arnon and the Jabbok, but, before the advance of the Hebrews, they had been dispossessed of a portion of their land by the Amorites, who founded, along the east side of the Jordan and the Dead Sea, the kingdom of Sihon (Numbers 21:21-31).

We know from the records of Egypt, especially Tell el-Amarna Letters, the approximate date of the Amorite invasion (14th and 13th centuries, BC). They were pressed on the north by the Hittites who forced them upon the tribes of the south, and some of them settled east of the Jordan. Thus, Israel helped Ammonites by destroying their old enemies, and this makes their conduct at a later period the more reprehensible. In the days of Jephthah they oppressed the Israelites east of the Jordan, claiming that the latter had deprived them of their territory when they came from Egypt, whereas it was the possessions of the Amorites they took (Judges 11:1-28). They were defeated, but their hostility did not cease, and their conduct toward the Israelites was particularly shameful, as in the days of Saul (1 Samuel 11) and of David (2 Samuel 10). This may account for the cruel treatment meted out to them in the war that followed (2 Samuel 12:26-31).

They seem to have been completely subdued by David and their capital was taken, and we find a better spirit manifested afterward, for Nahash of Rabbah showed kindness to him when a fugitive (2 Samuel 17:27-29). Their country came into the possession of Jeroboam, on the division of the kingdom, and when the Syrians of Damascus deprived the kingdom of Israel of their possessions east of the Jordan, the Ammonites became subjects of Benhadad, and we find a contingent of 1,000 of them serving as allies of that king in the great battle of the Syrians with the Assyrians at Qarqar (854 BC) in the reign of Shalmaneser II. They may have regained their old territory when Tiglath-pileser carried off the Israelites East of the Jordan into captivity (2 Kings 15:29; 1 Chronicles 5:26). Their hostility to both kingdoms, Judah and Israel, was often manifested. In the days of Jehoshaphat they joined with the Moabites in an attack upon him, but met with disaster (2 Chronicles 20). They paid tribute to Jotham (2 Chronicles 27:5). After submitting to Tiglath-pileser they were generally tributary to Assyria, but we have mention of their joining In the general uprising that took place under Sennacherib; but they submitted and we find them tributary in the reign of Esarhaddon.

Their hostility to Judah is shown in their joining the Chaldeans to destroy it (2 Kings 24:2). Their cruelty is denounced by the prophet Amos 1:13, and their destruction by Jeremiah 49:1-6; Ezekiel 21:28-32; Zechariah 2:8,9. Their murder of Gedaliah (2 Kings 25:22-26; Jeremiah 40:14) was a dastardly act. Tobiah the Ammonites united with Sanballat to oppose Ne (Nehemiah 4), and their opposition to the Jews did not cease with the establishment of the latter in Judea.

They joined the Syrians in their wars with the Maccabees and were defeated by Judas (1 Mac 5:6). Their religion was a degrading and cruel superstition. Their chief god was Molech, or Moloch, to whom they offered human sacrifices (1 Kings 11:7) against which Israel was especially warned (Leviticus 20:2-5). This worship was common to other tribes for we find it mentioned among the Phoenicians. 
/***
|''Name:''|AnnotationsPlugin|
|''Description:''|Inline annotations for tiddler text.|
|''Author:''|Saq Imtiaz ( lewcid@gmail.com )|
|''Source:''|http://tw.lewcid.org/#AnnotationsPlugin|
|''Code Repository:''|http://tw.lewcid.org/svn/plugins|
|''Version:''|2.0|
|''Date:''||
|''License:''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''~CoreVersion:''|2.2.3|

!!Usage:
*{{{((text to annotate(annotation goes here)}}}
* To include the text being annotated, in the popup as a title, put {{{^}}} as the first letter of the annotation text.
** {{{((text to annotate(^annotation goes here)}}}

!!Examples:
Mouse over, the text below:
* ((banana(the best fruit in the world)))
* ((banana(^ the best fruit in the world)))

***/
// /%
config.formatters.unshift({name:"annotations",match:"\\(\\(",lookaheadRegExp:/\(\((.*?)\((\^?)((?:.|\n)*?)\)\)\)/g,handler:function(w){
this.lookaheadRegExp.lastIndex=w.matchStart;
var _2=this.lookaheadRegExp.exec(w.source);
if(_2&&_2.index==w.matchStart){
var _3=createTiddlyElement(w.output,"span",null,"annosub",_2[1]);
_3.anno=_2[3];
if(_2[2]){
_3.subject=_2[1];
}
_3.onmouseover=this.onmouseover;
_3.onmouseout=this.onmouseout;
_3.ondblclick=this.onmouseout;
w.nextMatch=_2.index+_2[0].length;
}
},onmouseover:function(e){
popup=createTiddlyElement(document.body,"div",null,"anno");
this.popup=popup;
if(this.subject){
wikify("!"+this.subject+"\n",popup);
}
wikify(this.anno,popup);
addClass(this,"annosubover");
Popup.place(this,popup,{x:25,y:7});
},onmouseout:function(e){
removeNode(this.popup);
this.popup=null;
removeClass(this,"annosubover");
}});
setStylesheet(".anno{position:absolute;border:2px solid #000;background-color:#DFDFFF; color:#000;padding:0.5em;max-width:40em;width:expression(document.body.clientWidth > (255/12) *parseInt(document.body.currentStyle.fontSize)?'15em':'auto' );}\n"+".anno h1, .anno h2{margin-top:0;color:#000;}\n"+".annosub{background:#ccc;}\n"+".annosubover{z-index:25; background-color:#DFDFFF;cursor:help;}\n","AnnotationStyles");


// %/
+++ [[link out|http://www.blueletterbible.org/]] ===
<html> <iframe width="100%" height="350" style="border-style:none;" src=" http://www.blueletterbible.org/"></iframe>

</html> 
[[Bible Maps (search by bible book)|http://biblemap.org/]]
|	[[Genesis]] 	|	[[Ezra]] 	|	[[Joel]] 	|	[[Matthew]] 	|	[[1 Timothy]] 	|
|	[[Exodus]] 	|	[[Nehemiah]] 	|	[[Amos]] 	|	[[Mark]] 	|	[[2 Timothy]] 	|
|	[[Leviticus]] 	|	[[Esther]] 	|	[[Obadiah]] 	|	[[Luke]] 	|	[[Titus]] 	|
|	[[Numbers]] 	|	[[Job]] 	|	[[Jonah]] 	|	[[John]] 	|	[[Philemon]] 	|
|	[[Deuteronomy]] 	|	[[Psalms]] 	|	[[Micah]] 	|	[[Acts]] 	|	[[Hebrews]] 	|
|	[[Joshua]] 	|	[[Proverbs]]	|	[[Nahum]] 	|	[[Romans]] 	|	[[James]] 	|
|	[[Judges]] 	|	[[Ecclesiastes]] 	|	[[Habakkuk]]	|	[[1 Corinthians]] 	|	[[1 Peter]] 	|
|	[[Ruth]] 	|	[[Song of Solomon]] 	|	[[Zephaniah]] 	|	[[2 Corinthians]] 	|	[[2 Peter]] 	|
|	[[1st Samuel]] 	|	[[Isaiah]] 	|	[[Haggai]]	|	[[Galatians]] 	|	[[1 John]] 	|
|	[[2nd Samuel]] 	|	[[Jermiah]] 	|	[[Zechariah]] 	|	[[Ephesians]] 	|	[[2 John]] 	|
|	[[1st Kings]] 	|	[[Lamentations]] 	|	[[Malachi]] 	|	[[Philippians]] 	|	[[3 John]] 	|
|	[[2nd Kings]] 	|	[[Ezekiel]] 	|		|	[[Colossians]] 	|	[[Jude]] 	|
|	[[1st Chronicles]] 	|	[[Daniel]] 	|		|	[[1 Thessalonians]]	|	[[Revelation]] 	|
|	[[2nd Chronicles]] 	|	[[Hosea ]]	|		|	[[2 Thessalonians]] 	|		|
why not? Is it for the same reason that he hides behind barrels (or whatever) later on?
* who were the Key people(s) involved? +++
<<formTiddler ShortTextBoxTemplate1>><data>{"notes":"\n"}</data>
===

* Where did this take place (key places, how big an area?) +++
<<formTiddler ShortTextBoxTemplate2>> 
===

* When did this take place (how long a time frame?) +++
 <<formTiddler ShortTextBoxTemplate3>>
===

* What do you think is most important here? (summarize the chapter)+++
 <<formTiddler ShortTextBoxTemplate4>>
===

* Why did certain things happen? (what needs explaining?) +++
 <<formTiddler ShortTextBoxTemplate5>>
===
 
*How is this applicable to us today? +++
<<formTiddler ShortTextBoxTemplate6>>
===

*Key verse is: +++
<<formTiddler ShortTextBoxTemplate7>>
===
/***
| Name|CloseOnCancelPlugin|
| Description|Closes the tiddler if you click new tiddler then cancel. Default behaviour is to leave it open|
| Version|3.0 ($Rev: 1845 $)|
| Date|$Date: 2007-03-16 15:19:22 +1000 (Fri, 16 Mar 2007) $|
| Source|http://mptw.tiddlyspot.com/#CloseOnCancelPlugin|
| Author|Simon Baird <simon.baird@gmail.com>|
| License|http://mptw.tiddlyspot.com/#TheBSDLicense|
***/
//{{{
merge(config.commands.cancelTiddler,{

	handler_orig_closeUnsaved: config.commands.cancelTiddler.handler,

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

});

//}}}

+++ or click "L" beside verse in blueletterbible for available commentary about a particular verse===
<html> <iframe width="100%" height="350" style="border-style:none;" src=" http://cf.blueletterbible.org/commentaries///"></iframe>

</html> 
http://www.biblegateway.com/resources/commentaries/index.php?action=getMainPage&source=2
/%
|Name|CompareTiddlers|
|Source|http://www.TiddlyTools.com/#CompareTiddlers|
|Version|0.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|script|
|Requires|InlineJavascriptPlugin|
|Overrides||
|Description|TidIDE: show color-coded differences between two selected tiddlers|
%/<<tiddler HideTiddlerTags>>{{smallform small{
<html><form action="javascript:;" style="display:inline"><!--
	--><select name=list1 size=1 style="width:30%" onchange="var f=this.form; f.view1.disabled=f.edit1.disabled=f.done.disabled=!this.value.length; f.compare.disabled=!f.list1.value.length||!f.list2.value.length; if (!this.value.length) return; f.text1.style.display=f.text2.style.display='inline'; f.text1.value=store.getTiddlerText(this.value);"></select><!--
	--><input type=button name=view1 style="width:10%" value='view' disabled 
		onclick="if (this.form.list1.value.length) story.displayTiddler(story.findContainingTiddler(this),this.form.list1.value,DEFAULT_VIEW_TEMPLATE)"><!--
	--><input type=button name=edit1 style="width:10%" value='edit' disabled 
		onclick="if (this.form.list1.value.length) story.displayTiddler(story.findContainingTiddler(this),this.form.list1.value,DEFAULT_EDIT_TEMPLATE)"><!--
	--><select name=list2 size=1 style="width:30%" onchange="var f=this.form; f.view2.disabled=f.edit2.disabled=f.done.disabled=!this.value.length; f.compare.disabled=!f.list1.value.length||!f.list2.value.length; if (!this.value.length) return; f.text1.style.display=f.text2.style.display='inline'; f.text2.value=store.getTiddlerText(this.value)"></select><!--
	--><input type=button name=view2 style="width:10%" value='view' disabled 
		onclick="if (this.form.list2.value.length) story.displayTiddler(story.findContainingTiddler(this),this.form.list2.value,DEFAULT_VIEW_TEMPLATE)"><!--
	--><input type=button name=edit2 style="width:10%" value='edit' disabled 
		onclick="if (this.form.list2.value.length) story.displayTiddler(story.findContainingTiddler(this),this.form.list2.value,DEFAULT_EDIT_TEMPLATE)"><br><!--
	--><textarea name=text1 style="width:49.5%;display:none" rows="10" readonly></textarea><!--
	--><textarea name=text2 style="width:49.5%;display:none" rows="10" readonly></textarea><!--
	--><div style='float:left'><!--
	-->Compare two tiddlers using <!--
	--><a target="_blank" href="http://bradleymeck.tiddlyspot.com/#[[Diff Function]]">Bradley Meck's Diff Function</a>.
The output shows additions in green, and deletions in red<!--
	--></div><!--
	--><div style='text-align:right'><!--
	--><input type=button name=compare style="width:10%" value='compare' disabled 
		onclick="var f=this.form; if (!f.list1.value.length) { f.list1.focus(); return alert('select a tiddler'); } var t1=store.getTiddlerText(f.list1.value); if (!t1) { displayMessage(f.list1.value+' not found');return false; } if (!f.list2.value.length) { f.list2.focus(); return alert('select a tiddler'); } var t2=store.getTiddlerText(f.list2.value); if (!t2) { displayMessage(f.list2.value+' not found');return false; } removeChildren(f.parentNode.nextSibling); var out=diffString(t1,t2); if (!out || !out.length) out='no differences'; f.parentNode.nextSibling.innerHTML=out;  f.parentNode.nextSibling.style.display='block'; f.done.disabled=false;"><!--
	--><input type=button name=done style="width:10%" value='done' disabled 
		onclick="var f=this.form; f.text1.style.display='none'; f.text1.value=''; var list=f.list1; while (list.options[0]) list.options[0]=null; list.options[0]=new Option('select a tiddler...','',false,false); var tids=store.getTiddlers('title','excludeLists'); for (i=0; i<tids.length; i++) list.options[list.length]=new Option(tids[i].title,tids[i].title,false,false); f.text2.style.display='none'; f.text2.value=''; var list=f.list2; while (list.options[0]) list.options[0]=null; list.options[0]=new Option('select a tiddler...','',false,false); var tids=store.getTiddlers('title','excludeLists'); for (i=0; i<tids.length; i++) list.options[list.length]=new Option(tids[i].title,tids[i].title,false,false); f.parentNode.nextSibling.style.display='none'; removeChildren(f.parentNode.nextSibling); f.view1.disabled=f.view2.disabled=f.edit1.disabled=f.edit2.disabled=f.compare.disabled=this.disabled=true;"><!--
	--></div><!--
--></form></html><script>

	// initialize form
	var form=place.lastChild.firstChild;
	var tids=store.getTiddlers('title','excludeLists');
	while (form.list1.options[0]) form.list1.options[0]=null; 
	form.list1.options[0]=new Option("select a tiddler...","",false,false);
	for (i=0; i<tids.length; i++)
		form.list1.options[form.list1.length]=new Option(tids[i].title,tids[i].title,false,false);
	while (form.list2.options[0]) form.list2.options[0]=null; 
	form.list2.options[0]=new Option("select a tiddler...","",false,false);
	for (i=0; i<tids.length; i++)
		form.list2.options[form.list2.length]=new Option(tids[i].title,tids[i].title,false,false);


</script>@@display:none;margin-top:1em;border:1px solid;-moz-border-radius:1em;padding:1em;white-space:normal;/%
this will be replaced with output from compare button 
%/@@}}}<html><div style='clear:both'></div></html><script>


//{{{
// returns difference between old and new text, color-formatted additions and deletions
window.diffString=function( o, n ) {
  if (o==n) return ""; // simple check, saves time if true
  var error = 5;
  var reg = new RegExp( "\\n|(?:.{0,"+error+"})", "g" );
  var oarr = o.match( reg ); // dices text into chunks
  var narr = n.match( reg );
  var out = diff(oarr,narr); // compare the word arrays
  var str = ""; // construct output
  for (i=0; i<out.length; i++) {
	switch (out[i].change) {
		case "ADDED":
			str+="<span style='color:green'>";
			str+=narr.slice(out[i].index,out[i].index+out[i].length).join("");
			str+="</span> ";
			break;
		case "DELETED":
			str+="<span style='color:red'>";
			str+=oarr.slice(out[i].index,out[i].index+out[i].length).join("");
			str+="</span> ";
			break;
		default:
			str+="<span>";
			str+=oarr.slice(out[i].index,out[i].index+out[i].length).join("");
			str+="</span> ";
			break;
	}	
  }
  return str;
  return "<html>"+str+"</html>";
}

/***
!About
|Author - Bradley Meck|
|Date - Dec 24, 2006|
|Version - 1.4.1|
This is a simple function to be used to find the differences between one set of objects and another. ''The objects do not need to be Strings''. It outputs and array of objects with the properties value and change. This function is pretty hefts but appears to be rather light for a diff and tops out at O(N^^2^^) for absolute worst cast scenario that I can find.
!History
*December 23, 2006 - Function made to be minimal edit diff, and changed output.
!Code
***/

function diff( oldArray, newArray ) {
	var newElementHash = { };
	for( var i = 0; i < newArray.length; i++ ) {
		if( ! newElementHash [ newArray [ i ] ] ) {
			newElementHash [ newArray [ i ] ] = [ ];
		}
		newElementHash [ newArray [ i ] ].push( i );
	}
	var substringTable = [ ];
	for( var i = 0; i < oldArray.length; i++ ) {
		if(newElementHash [ oldArray [ i ] ] ) {
			var locations = newElementHash [ oldArray [ i ] ] ;
			for( var j = 0; j < locations.length; j++){
				var length = 1;
				while( i + length < oldArray.length && locations [ j ] + length < newArray.length
					&& oldArray [ i + length ] == newArray [ locations [ j ] + length ] ){
					length++;
				}
				substringTable.push( {
					oldArrayIndex : i,
					newArrayIndex : locations [ j ],
					matchLength : length
				} );
			}
		}
	}
	substringTable.sort( function( a, b ) {
		if ( a.matchLength > b.matchLength /* a is less than b by some ordering criterion */ ) {
			return -1;
		}
		if ( a.matchLength < b.matchLength /* a is greater than b by the ordering criterion */ ) {
			return 1;
		}
		// a must be equal to b
		return 0
	} );
	//displayMessage( substringTable.toSource( ) );
	for( var i = 0; i < substringTable.length; i++) {
		for( var j = 0; j < i; j++) {
			var oldDelta = substringTable [ i ].oldArrayIndex + substringTable [ i ].matchLength - 1 - substringTable [ j ].oldArrayIndex;
			var newDelta = substringTable [ i ].newArrayIndex + substringTable [ i ].matchLength - 1 - substringTable [ j ].newArrayIndex;
			//displayMessage( "oldDelta ::: " + oldDelta );
			//displayMessage( "newDelta ::: " + newDelta );
			//displayMessage( "matchLength ::: " + substringTable [ j ].matchLength );
			if( ( oldDelta >= 0 && oldDelta <= substringTable [ j ].matchLength )
			|| ( newDelta >= 0 && newDelta <= substringTable [ j ].matchLength )
			|| ( oldDelta < 0 && newDelta > 0 )
			|| ( oldDelta > 0 && newDelta < 0 ) ) {
				substringTable.splice( i, 1 );
				i--;
				break;
			}
		}
	}
	//displayMessage( substringTable.toSource(  ) );
	substringTable.sort( function( a, b ) {
		if ( a.oldArrayIndex < b.oldArrayIndex /* a is less than b by some ordering criterion */ ) {
			return -1;
		}
		if ( a.oldArrayIndex > b.oldArrayIndex /* a is greater than b by the ordering criterion */ ) {
			return 1;
		}
		// a must be equal to b
		return 0
	} );
	//displayMessage( substringTable.toSource( ) );
	var oldArrayIndex = 0;
	var newArrayIndex = 0;
	var results = [ ];
	for( var i = 0; i < substringTable.length; i++ ) {
		if( oldArrayIndex != substringTable [ i ].oldArrayIndex ) {
			results.push( {
				change : "DELETED",
				length : substringTable [ i ].oldArrayIndex - oldArrayIndex,
				index : oldArrayIndex
			} );
		}
		if( newArrayIndex != substringTable [ i ].newArrayIndex ) {
			results.push( {
				change : "ADDED",
				length : substringTable [ i ].newArrayIndex - newArrayIndex,
				index : newArrayIndex
			} );
		}
		results.push( {
			change : "STAYED",
			length : substringTable [ i ].matchLength,
			index : substringTable [ i ].oldArrayIndex
		} );
		oldArrayIndex = substringTable [ i ].oldArrayIndex + substringTable [ i ].matchLength;
		newArrayIndex = substringTable [ i ].newArrayIndex + substringTable [ i ].matchLength;
	}
	if( oldArrayIndex != oldArray.length ) {
		results.push( {
			change : "DELETED",
			length : oldArray.length - oldArrayIndex,
			index : oldArrayIndex
		} );
	}
	if( newArrayIndex != newArray.length ) {
		results.push( {
			change : "ADDED",
			length : newArray.length - newArrayIndex,
			index : newArrayIndex
		} );
	}
	return results;
}
//}}}
</script>
//{{{
config.options.chkHttpReadOnly = false; // means web visitors can experiment with your site by clicking edit
config.options.chkInsertTabs = true;    // tab inserts a tab when editing a tiddler
config.views.wikified.defaultText = ""; // don't need message when a tiddler doesn't exist
config.views.editor.defaultText = "";   // don't need message when creating a new tiddler 
//}}}
<<tag ToDos>>
<<tag HowTo>>



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

See also MonkeyPirateTiddlyWiki.
/***
|''Name:''|DataTiddlerPlugin|
|''Version:''|1.0.4 (2006-02-05)|
|''Source:''|http://tiddlywiki.abego-software.de/#DataTiddlerPlugin|
|''Author:''|UdoBorkowski (ub [at] abego-software [dot] de)|
|''Licence:''|[[BSD open source license]]|
|''TiddlyWiki:''|1.2.38+, 2.0|
|''Browser:''|Firefox 1.0.4+; InternetExplorer 6.0|
!Description
Enhance your tiddlers with structured data (such as strings, booleans, numbers, or even arrays and compound objects) that can be easily accessed and modified through named fields (in JavaScript code).

Such tiddler data can be used in various applications. E.g. you may create tables that collect data from various tiddlers. 

''//Example: "Table with all December Expenses"//''
{{{
<<forEachTiddler
 where
 'tiddler.tags.contains("expense") && tiddler.data("month") == "Dec"'
 write
 '"|[["+tiddler.title+"]]|"+tiddler.data("descr")+"| "+tiddler.data("amount")+"|\n"'
>>
}}}

//(This assumes that expenses are stored in tiddlers tagged with "expense".)//
<<forEachTiddler
 where
 'tiddler.tags.contains("expense") && tiddler.data("month") == "Dec"'
 write
 '"|[["+tiddler.title+"]]|"+tiddler.data("descr")+"| "+tiddler.data("amount")+"|\n"'
>>
For other examples see DataTiddlerExamples.




''Access and Modify Tiddler Data''

You can "attach" data to every tiddler by assigning a JavaScript value (such as a string, boolean, number, or even arrays and compound objects) to named fields. 

These values can be accessed and modified through the following Tiddler methods:
|!Method|!Example|!Description|
|{{{data(field)}}}|{{{t.data("age")}}}|Returns the value of the given data field of the tiddler. When no such field is defined or its value is undefined {{{undefined}}} is returned.|
|{{{data(field,defaultValue)}}}|{{{t.data("isVIP",false)}}}|Returns the value of the given data field of the tiddler. When no such field is defined or its value is undefined the defaultValue is returned.|
|{{{data()}}}|{{{t.data()}}}|Returns the data object of the tiddler, with a property for every field. The properties of the returned data object may only be read and not be modified. To modify the data use DataTiddler.setData(...) or the corresponding Tiddler method.|
|{{{setData(field,value)}}}|{{{t.setData("age",42)}}}|Sets the value of the given data field of the tiddler to the value. When the value is {{{undefined}}} the field is removed.|
|{{{setData(field,value,defaultValue)}}}|{{{t.setData("isVIP",flag,false)}}}|Sets the value of the given data field of the tiddler to the value. When the value is equal to the defaultValue no value is set (and the field is removed).|

Alternatively you may use the following functions to access and modify the data. In this case the tiddler argument is either a tiddler or the name of a tiddler.
|!Method|!Description|
|{{{DataTiddler.getData(tiddler,field)}}}|Returns the value of the given data field of the tiddler. When no such field is defined or its value is undefined {{{undefined}}} is returned.|
|{{{DataTiddler.getData(tiddler,field,defaultValue)}}}|Returns the value of the given data field of the tiddler. When no such field is defined or its value is undefined the defaultValue is returned.|
|{{{DataTiddler.getDataObject(tiddler)}}}|Returns the data object of the tiddler, with a property for every field. The properties of the returned data object may only be read and not be modified. To modify the data use DataTiddler.setData(...) or the corresponding Tiddler method.|
|{{{DataTiddler.setData(tiddler,field,value)}}}|Sets the value of the given data field of the tiddler to the value. When the value is {{{undefined}}} the field is removed.|
|{{{DataTiddler.setData(tiddler,field,value,defaultValue)}}}|Sets the value of the given data field of the tiddler to the value. When the value is equal to the defaultValue no value is set (and the field is removed).|
//(For details on the various functions see the detailed comments in the source code.)//


''Data Representation in a Tiddler''

The data of a tiddler is stored as plain text in the tiddler's content/text, inside a "data" section that is framed by a {{{<data>...</data>}}} block. Inside the data section the information is stored in the [[JSON format|http://www.crockford.com/JSON/index.html]]. 

//''Data Section Example:''//
{{{
<data>{"isVIP":true,"user":"John Brown","age":34}</data>
}}}

The data section is not displayed when viewing the tiddler (see also "The showData Macro").

Beside the data section a tiddler may have all kind of other content.

Typically you will not access the data section text directly but use the methods given above. Nevertheless you may retrieve the text of the data section's content through the {{{DataTiddler.getDataText(tiddler)}}} function.


''Saving Changes''

The "setData" methods respect the "ForceMinorUpdate" and "AutoSave" configuration values. I.e. when "ForceMinorUpdate" is true changing a value using setData will not affect the "modifier" and "modified" attributes. With "AutoSave" set to true every setData will directly save the changes after a setData.


''Notifications''

No notifications are sent when a tiddler's data value is changed through the "setData" methods. 

''Escape Data Section''
In case that you want to use the text {{{<data>}}} or {{{</data>}}} in a tiddler text you must prefix the text with a tilde ('~'). Otherwise it may be wrongly considered as the data section. The tiddler text {{{~<data>}}} is displayed as {{{<data>}}}.


''The showData Macro''

By default the data of a tiddler (that is stored in the {{{<data>...</data>}}} section of the tiddler) is not displayed. If you want to display this data you may used the {{{<<showData ...>>}}} macro:

''Syntax:'' 
|>|{{{<<}}}''showData '' [''JSON''] [//tiddlerName//] {{{>>}}}|
|''JSON''|By default the data is rendered as a table with a "Name" and "Value" column. When defining ''JSON'' the data is rendered in JSON format|
|//tiddlerName//|Defines the tiddler holding the data to be displayed. When no tiddler is given the tiddler containing the showData macro is used. When the tiddler name contains spaces you must quote the name (or use the {{{[[...]]}}} syntax.)|
|>|~~Syntax formatting: Keywords in ''bold'', optional parts in [...]. 'or' means that exactly one of the two alternatives must exist.~~|


!Revision history
* v1.0.4 (2006-02-05)
** Bugfix: showData fails in TiddlyWiki 2.0
* v1.0.3 (2006-01-06)
** Support TiddlyWiki 2.0
* v1.0.2 (2005-12-22)
** Enhancements:
*** Handle texts "<data>" or "</data>" more robust when used in a tiddler text or as a field value.
*** Improved (JSON) error messages.
** Bugs fixed: 
*** References are not updated when using the DataTiddler.
*** Changes to compound objects are not always saved.
*** "~</data>" is not rendered correctly (expected "</data>")
* v1.0.1 (2005-12-13)
** Features: 
*** The showData macro supports an optional "tiddlername" argument to specify the tiddler containing the data to be displayed
** Bugs fixed: 
*** A script immediately following a data section is deleted when the data is changed. (Thanks to GeoffS for reporting.)
* v1.0.0 (2005-12-12)
** initial version

!Code
***/
//{{{
//============================================================================
//============================================================================
// DataTiddlerPlugin
//============================================================================
//============================================================================

// Ensure that the DataTiddler Plugin is only installed once.
//
if (!version.extensions.DataTiddlerPlugin) {



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

// For backward compatibility with v1.2.x
//
if (!window.story) window.story=window; 
if (!TiddlyWiki.prototype.getTiddler) TiddlyWiki.prototype.getTiddler = function(title) { return t = this.tiddlers[title]; return (t != undefined && t instanceof Tiddler) ? t : null; } 

//============================================================================
// DataTiddler Class
//============================================================================

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

function DataTiddler() {
}

DataTiddler = {
 // Function to stringify a JavaScript value, producing the text for the data section content.
 // (Must match the implementation of DataTiddler.parse.)
 //
 stringify : null,
 

 // Function to parse the text for the data section content, producing a JavaScript value.
 // (Must match the implementation of DataTiddler.stringify.)
 //
 parse : null
};

// Ensure access for IE
window.DataTiddler = DataTiddler;

// ---------------------------------------------------------------------------
// Data Accessor and Mutator
// ---------------------------------------------------------------------------


// Returns the value of the given data field of the tiddler.
// When no such field is defined or its value is undefined
// the defaultValue is returned.
// 
// @param tiddler either a tiddler name or a tiddler
//
DataTiddler.getData = function(tiddler, field, defaultValue) {
 var t = (typeof tiddler == "string") ? store.getTiddler(tiddler) : tiddler;
 if (!(t instanceof Tiddler)) {
 throw "Tiddler expected. Got "+tiddler;
 }

 return DataTiddler.getTiddlerDataValue(t, field, defaultValue);
}


// Sets the value of the given data field of the tiddler to
// the value. When the value is equal to the defaultValue
// no value is set (and the field is removed)
//
// Changing data of a tiddler will not trigger notifications.
// 
// @param tiddler either a tiddler name or a tiddler
//
DataTiddler.setData = function(tiddler, field, value, defaultValue) {
 var t = (typeof tiddler == "string") ? store.getTiddler(tiddler) : tiddler;
 if (!(t instanceof Tiddler)) {
 throw "Tiddler expected. Got "+tiddler+ "("+t+")";
 }

 DataTiddler.setTiddlerDataValue(t, field, value, defaultValue);
}


// Returns the data object of the tiddler, with a property for every field.
//
// The properties of the returned data object may only be read and
// not be modified. To modify the data use DataTiddler.setData(...) 
// or the corresponding Tiddler method.
//
// If no data section is defined a new (empty) object is returned.
//
// @param tiddler either a tiddler name or a Tiddler
//
DataTiddler.getDataObject = function(tiddler) {
 var t = (typeof tiddler == "string") ? store.getTiddler(tiddler) : tiddler;
 if (!(t instanceof Tiddler)) {
 throw "Tiddler expected. Got "+tiddler;
 }

 return DataTiddler.getTiddlerDataObject(t);
}

// Returns the text of the content of the data section of the tiddler.
//
// When no data section is defined for the tiddler null is returned 
//
// @param tiddler either a tiddler name or a Tiddler
// @return [may be null]
//
DataTiddler.getDataText = function(tiddler) {
 var t = (typeof tiddler == "string") ? store.getTiddler(tiddler) : tiddler;
 if (!(t instanceof Tiddler)) {
 throw "Tiddler expected. Got "+tiddler;
 }

 return DataTiddler.readDataSectionText(t);
}


// ---------------------------------------------------------------------------
// Internal helper methods (must not be used by code from outside this plugin)
// ---------------------------------------------------------------------------

// Internal.
//
// The original JSONError is not very user friendly, 
// especially it does not define a toString() method
// Therefore we extend it here.
//
DataTiddler.extendJSONError = function(ex) {
 if (ex.name == 'JSONError') {
 ex.toString = function() {
 return ex.name + ": "+ex.message+" ("+ex.text+")";
 }
 }
 return ex;
}

// Internal.
//
// @param t a Tiddler
//
DataTiddler.getTiddlerDataObject = function(t) {
 if (t.dataObject == undefined) {
 var data = DataTiddler.readData(t);
 t.dataObject = (data) ? data : {};
 }
 
 return t.dataObject;
}


// Internal.
//
// @param tiddler a Tiddler
//
DataTiddler.getTiddlerDataValue = function(tiddler, field, defaultValue) {
 var value = DataTiddler.getTiddlerDataObject(tiddler)[field];
 return (value == undefined) ? defaultValue : value;
}


// Internal.
//
// @param tiddler a Tiddler
//
DataTiddler.setTiddlerDataValue = function(tiddler, field, value, defaultValue) {
 var data = DataTiddler.getTiddlerDataObject(tiddler);
 var oldValue = data[field];
 
 if (value == defaultValue) {
 if (oldValue != undefined) {
 delete data[field];
 DataTiddler.save(tiddler);
 }
 return;
 }
 data[field] = value;
 DataTiddler.save(tiddler);
}

// Internal.
//
// Reads the data section from the tiddler's content and returns its text
// (as a String).
//
// Returns null when no data is defined.
//
// @param tiddler a Tiddler
// @return [may be null]
//
DataTiddler.readDataSectionText = function(tiddler) {
 var matches = DataTiddler.getDataTiddlerMatches(tiddler);
 if (matches == null || !matches[2]) {
 return null;
 }
 return matches[2];
}

// Internal.
//
// Reads the data section from the tiddler's content and returns it
// (as an internalized object).
//
// Returns null when no data is defined.
//
// @param tiddler a Tiddler
// @return [may be null]
//
DataTiddler.readData = function(tiddler) {
 var text = DataTiddler.readDataSectionText(tiddler);
 try {
 return text ? DataTiddler.parse(text) : null;
 } catch(ex) {
 throw DataTiddler.extendJSONError(ex);
 }
}

// Internal.
// 
// Returns the serialized text of the data of the given tiddler, as it
// should be stored in the data section.
//
// @param tiddler a Tiddler
//
DataTiddler.getDataTextOfTiddler = function(tiddler) {
 var data = DataTiddler.getTiddlerDataObject(tiddler);
 return DataTiddler.stringify(data);
}


// Internal.
// 
DataTiddler.indexOfNonEscapedText = function(s, subString, startIndex) {
 var index = s.indexOf(subString, startIndex);
 while ((index > 0) && (s[index-1] == '~')) { 
 index = s.indexOf(subString, index+1);
 }
 return index;
}

// Internal.
//
DataTiddler.getDataSectionInfo = function(text) {
 // Special care must be taken to handle "<data>" and "</data>" texts inside
 // a data section. 
 // Also take care not to use an escaped <data> (i.e. "~<data>") as the start 
 // of a data section. (Same for </data>)

 // NOTE: we are explicitly searching for a data section that contains a JSON
 // string, i.e. framed with braces. This way we are little bit more robust in
 // case the tiddler contains unescaped texts "<data>" or "</data>". This must
 // be changed when using a different stringifier.

 var startTagText = "<data>{";
 var endTagText = "}</data>";

 var startPos = 0;

 // Find the first not escaped "<data>".
 var startDataTagIndex = DataTiddler.indexOfNonEscapedText(text, startTagText, 0);
 if (startDataTagIndex < 0) {
 return null;
 }

 // Find the *last* not escaped "</data>".
 var endDataTagIndex = text.indexOf(endTagText, startDataTagIndex);
 if (endDataTagIndex < 0) {
 return null;
 }
 var nextEndDataTagIndex;
 while ((nextEndDataTagIndex = text.indexOf(endTagText, endDataTagIndex+1)) >= 0) {
 endDataTagIndex = nextEndDataTagIndex;
 };

 return {
 prefixEnd: startDataTagIndex, 
 dataStart: startDataTagIndex+(startTagText.length)-1, 
 dataEnd: endDataTagIndex, 
 suffixStart: endDataTagIndex+(endTagText.length)
 };
}

// Internal.
// 
// Returns the "matches" of a content of a DataTiddler on the
// "data" regular expression. Return null when no data is defined
// in the tiddler content.
//
// Group 1: text before data section (prefix)
// Group 2: content of data section
// Group 3: text behind data section (suffix)
//
// @param tiddler a Tiddler
// @return [may be null] null when the tiddler contains no data section, otherwise see above.
//
DataTiddler.getDataTiddlerMatches = function(tiddler) {
 var text = tiddler.text;
 var info = DataTiddler.getDataSectionInfo(text);
 if (!info) {
 return null;
 }

 var prefix = text.substr(0,info.prefixEnd);
 var data = text.substr(info.dataStart, info.dataEnd-info.dataStart+1);
 var suffix = text.substr(info.suffixStart);
 
 return [text, prefix, data, suffix];
}


// Internal.
//
// Saves the data in a <data> block of the given tiddler (as a minor change). 
//
// The "chkAutoSave" and "chkForceMinorUpdate" options are respected. 
// I.e. the TiddlyWiki *file* is only saved when AutoSave is on.
//
// Notifications are not send. 
//
// This method should only be called when the data really has changed. 
//
// @param tiddler
// the tiddler to be saved.
//
DataTiddler.save = function(tiddler) {

 var matches = DataTiddler.getDataTiddlerMatches(tiddler);

 var prefix;
 var suffix;
 if (matches == null) {
 prefix = tiddler.text;
 suffix = "";
 } else {
 prefix = matches[1];
 suffix = matches[3];
 }

 var dataText = DataTiddler.getDataTextOfTiddler(tiddler);
 var newText = 
 (dataText != null) 
 ? prefix + "<data>" + dataText + "</data>" + suffix
 : prefix + suffix;
 if (newText != tiddler.text) {
 // make the change in the tiddlers text
 
 // ... see DataTiddler.MyTiddlerChangedFunction
 tiddler.isDataTiddlerChange = true;
 
 // ... do the action change
 tiddler.set(
 tiddler.title,
 newText,
 config.options.txtUserName, 
 config.options.chkForceMinorUpdate? undefined : new Date(),
 tiddler.tags);

 // ... see DataTiddler.MyTiddlerChangedFunction
 delete tiddler.isDataTiddlerChange;

 // Mark the store as dirty.
 store.dirty = true;
 
 // AutoSave if option is selected
 if(config.options.chkAutoSave) {
 saveChanges();
 }
 }
}

// Internal.
//
DataTiddler.MyTiddlerChangedFunction = function() {
 // Remove the data object from the tiddler when the tiddler is changed
 // by code other than DataTiddler code. 
 //
 // This is necessary since the data object is just a "cached version" 
 // of the data defined in the data section of the tiddler and the 
 // "external" change may have changed the content of the data section.
 // Thus we are not sure if the data object reflects the data section 
 // contents. 
 // 
 // By deleting the data object we ensure that the data object is 
 // reconstructed the next time it is needed, with the data defined by
 // the data section in the tiddler's text.
 
 // To indicate that a change is a "DataTiddler change" a temporary
 // property "isDataTiddlerChange" is added to the tiddler.
 if (this.dataObject && !this.isDataTiddlerChange) {
 delete this.dataObject;
 }
 
 // call the original code.
 DataTiddler.originalTiddlerChangedFunction.apply(this, arguments);
}


//============================================================================
// Formatters
//============================================================================

// This formatter ensures that "~<data>" is rendered as "<data>". This is used to 
// escape the "<data>" of a data section, just in case someone really wants to use
// "<data>" as a text in a tiddler and not start a data section.
//
// Same for </data>.
//
config.formatters.push( {
 name: "data-escape",
 match: "~<\\/?data>",

 handler: function(w) {
 w.outputText(w.output,w.matchStart + 1,w.nextMatch);
 }
} )


// This formatter ensures that <data>...</data> sections are not rendered.
//
config.formatters.push( {
 name: "data",
 match: "<data>",

 handler: function(w) {
 var info = DataTiddler.getDataSectionInfo(w.source);
 if (info && info.prefixEnd == w.matchStart) {
 w.nextMatch = info.suffixStart;
 } else {
 w.outputText(w.output,w.matchStart,w.nextMatch);
 }
 }
} )


//============================================================================
// Tiddler Class Extension
//============================================================================

// "Hijack" the changed method ---------------------------------------------------

DataTiddler.originalTiddlerChangedFunction = Tiddler.prototype.changed;
Tiddler.prototype.changed = DataTiddler.MyTiddlerChangedFunction;

// Define accessor methods -------------------------------------------------------

// Returns the value of the given data field of the tiddler. When no such field 
// is defined or its value is undefined the defaultValue is returned.
//
// When field is undefined (or null) the data object is returned. (See 
// DataTiddler.getDataObject.)
//
// @param field [may be null, undefined]
// @param defaultValue [may be null, undefined]
// @return [may be null, undefined]
//
Tiddler.prototype.data = function(field, defaultValue) {
 return (field) 
 ? DataTiddler.getTiddlerDataValue(this, field, defaultValue)
 : DataTiddler.getTiddlerDataObject(this);
}

// Sets the value of the given data field of the tiddler to the value. When the 
// value is equal to the defaultValue no value is set (and the field is removed).
//
// @param value [may be null, undefined]
// @param defaultValue [may be null, undefined]
//
Tiddler.prototype.setData = function(field, value, defaultValue) {
 DataTiddler.setTiddlerDataValue(this, field, value, defaultValue);
}


//============================================================================
// showData Macro
//============================================================================

config.macros.showData = {
 // Standard Properties
 label: "showData",
 prompt: "Display the values stored in the data section of the tiddler"
}

config.macros.showData.handler = function(place,macroName,params) {
 // --- Parsing ------------------------------------------

 var i = 0; // index running over the params
 // Parse the optional "JSON"
 var showInJSONFormat = false;
 if ((i < params.length) && params[i] == "JSON") {
 i++;
 showInJSONFormat = true;
 }
 
 var tiddlerName = story.findContainingTiddler(place).id.substr(7);
 if (i < params.length) {
 tiddlerName = params[i]
 i++;
 }

 // --- Processing ------------------------------------------
 try {
 if (showInJSONFormat) {
 this.renderDataInJSONFormat(place, tiddlerName);
 } else {
 this.renderDataAsTable(place, tiddlerName);
 }
 } catch (e) {
 this.createErrorElement(place, e);
 }
}

config.macros.showData.renderDataInJSONFormat = function(place,tiddlerName) {
 var text = DataTiddler.getDataText(tiddlerName);
 if (text) {
 createTiddlyElement(place,"pre",null,null,text);
 }
}

config.macros.showData.renderDataAsTable = function(place,tiddlerName) {
 var text = "|!Name|!Value|\n";
 var data = DataTiddler.getDataObject(tiddlerName);
 if (data) {
 for (var i in data) {
 var value = data[i];
 text += "|"+i+"|"+DataTiddler.stringify(value)+"|\n";
 }
 }
 
 wikify(text, place);
}


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

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


} // of "install only once"
//}}}



/***
!JSON Code, used to serialize the data
//(embedded in the plugin tiddler to make it selfcontained)//
***/
//{{{
/*
Copyright (c) 2005 JSON.org

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The Software shall be used for Good, not Evil.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

/*
 The global object JSON contains two methods.

 JSON.stringify(value) takes a JavaScript value and produces a JSON text.
 The value must not be cyclical.

 JSON.parse(text) takes a JSON text and produces a JavaScript value. It will
 throw a 'JSONError' exception if there is an error.
*/
var JSON = {
 copyright: '(c)2005 JSON.org',
 license: 'http://www.crockford.com/JSON/license.html',
/*
 Stringify a JavaScript value, producing a JSON text.
*/
 stringify: function (v) {
 var a = [];

/*
 Emit a string.
*/
 function e(s) {
 a[a.length] = s;
 }

/*
 Convert a value.
*/
 function g(x) {
 var c, i, l, v;

 switch (typeof x) {
 case 'object':
 if (x) {
 if (x instanceof Array) {
 e('[');
 l = a.length;
 for (i = 0; i < x.length; i += 1) {
 v = x[i];
 if (typeof v != 'undefined' &&
 typeof v != 'function') {
 if (l < a.length) {
 e(',');
 }
 g(v);
 }
 }
 e(']');
 return;
 } else if (typeof x.toString != 'undefined') {
 e('{');
 l = a.length;
 for (i in x) {
 v = x[i];
 if (x.hasOwnProperty(i) &&
 typeof v != 'undefined' &&
 typeof v != 'function') {
 if (l < a.length) {
 e(',');
 }
 g(i);
 e(':');
 g(v);
 }
 }
 return e('}');
 }
 }
 e('null');
 return;
 case 'number':
 e(isFinite(x) ? +x : 'null');
 return;
 case 'string':
 l = x.length;
 e('"');
 for (i = 0; i < l; i += 1) {
 c = x.charAt(i);
 if (c >= ' ') {
 if (c == '\\' || c == '"') {
 e('\\');
 }
 e(c);
 } else {
 switch (c) {
 case '\b':
 e('\\b');
 break;
 case '\f':
 e('\\f');
 break;
 case '\n':
 e('\\n');
 break;
 case '\r':
 e('\\r');
 break;
 case '\t':
 e('\\t');
 break;
 default:
 c = c.charCodeAt();
 e('\\u00' + Math.floor(c / 16).toString(16) +
 (c % 16).toString(16));
 }
 }
 }
 e('"');
 return;
 case 'boolean':
 e(String(x));
 return;
 default:
 e('null');
 return;
 }
 }
 g(v);
 return a.join('');
 },
/*
 Parse a JSON text, producing a JavaScript value.
*/
 parse: function (text) {
 var p = /^\s*(([,:{}\[\]])|"(\\.|[^\x00-\x1f"\\])*"|-?\d+(\.\d*)?([eE][+-]?\d+)?|true|false|null)\s*/,
 token,
 operator;

 function error(m, t) {
 throw {
 name: 'JSONError',
 message: m,
 text: t || operator || token
 };
 }

 function next(b) {
 if (b && b != operator) {
 error("Expected '" + b + "'");
 }
 if (text) {
 var t = p.exec(text);
 if (t) {
 if (t[2]) {
 token = null;
 operator = t[2];
 } else {
 operator = null;
 try {
 token = eval(t[1]);
 } catch (e) {
 error("Bad token", t[1]);
 }
 }
 text = text.substring(t[0].length);
 } else {
 error("Unrecognized token", text);
 }
 } else {
 token = operator = undefined;
 }
 }


 function val() {
 var k, o;
 switch (operator) {
 case '{':
 next('{');
 o = {};
 if (operator != '}') {
 for (;;) {
 if (operator || typeof token != 'string') {
 error("Missing key");
 }
 k = token;
 next();
 next(':');
 o[k] = val();
 if (operator != ',') {
 break;
 }
 next(',');
 }
 }
 next('}');
 return o;
 case '[':
 next('[');
 o = [];
 if (operator != ']') {
 for (;;) {
 o.push(val());
 if (operator != ',') {
 break;
 }
 next(',');
 }
 }
 next(']');
 return o;
 default:
 if (operator !== null) {
 error("Missing value");
 }
 k = token;
 next();
 return k;
 }
 }
 next();
 return val();
 }
};
//}}}
/***
!Setup the data serialization
***/
//{{{
DataTiddler.format = "JSON";
DataTiddler.stringify = JSON.stringify;
DataTiddler.parse = JSON.parse;

//}}}

Wilderness:

(1.) Heb. midhbar, denoting not a barren desert but a district or region suitable for pasturing sheep and cattle (Psa 65:12; Isa 42:11; Jer 23:10; Joe 1:19; 2:22); an uncultivated place. This word is used of the wilderness of Beersheba (Gen 21:14), on the southern border of Palestine; the wilderness of the Red Sea (Exd 13:18); of Shur (15:22), a portion of the Sinaitic peninsula; of Sin (17:1), Sinai (Lev 7:38), Moab (Deu 2:8), Judah (Jdg 1:16), Ziph, Maon, En-gedi (1Sa 23:14,24; 24:1), Jeruel and Tekoa (2Ch 20:16,20), Kadesh (Psa 29:8).
[[Welcome]]
click the down arrow
   or a charmer or a medium or a necromancer or one who inquires of the 
dead, (ESV)
/***
|!''Name:''|!''E''asily ''A''daptable ''S''ource ''E''ditor|
|''Description:''|this framework allows you to easily create commands that work on the current tiddler text selection in edit mode|
|''Version:''|0.1.0|
|''Date:''|13/01/2007|
|''Source:''|http://yann.perrin.googlepages.com/twkd.html#E.A.S.E|
|''Author:''|[[Yann Perrin|YannPerrin]]|
|''License:''|[[BSD open source license]]|
|''~CoreVersion:''|2.x|
|''Browser:''|Firefox 1.0.4+; Firefox 1.5; InternetExplorer 6.0|
***/
////Messages Definition
//{{{
config.messages.Ease = {
noselection:"nothing selected",
asktitle:"enter the new tiddler title",
exists:" already exists, please enter another title",
askForTagsLabel:"enter the new tiddler tags",
tiddlercreated:" tiddler created"
}
//}}}
////
//{{{
if (!window.TWkd) window.TWkd={context:{}};
if (!TWkd.Ease)
 TWkd.Ease = function (text,tooltip){
 this.text = text;
 this.tooltip = tooltip;
 this.modes = [];
 this.addMode = function(modeDefinition) {this.modes.push(modeDefinition);};
 this.handler = function(event,src,title) {
 TWkd.context.command = this;
 TWkd.context.selection=this.getSelection(title);
 if (this.modes.length==1) {
 this.modes[0].operation();
 }
 else {
 var popup = Popup.create(src);
 if(popup) {
 for (var i=0; i<this.modes.length; i++) {
 createTiddlyButton(createTiddlyElement(popup,"li"), this.modes[i].name, this.modes[i].tooltip, this.OperateFromButton, null, 'id'+i, null);
 }
 Popup.show(popup,false);
 event.cancelBubble = true;
 if (event.stopPropagation) event.stopPropagation();
 return false;
 }
 }
 };
 };

TWkd.Ease.prototype.OperateFromButton = function(e){
 var commandMode=this.getAttribute('Id').replace('id','');
 TWkd.context.command.modes[commandMode].operation();
};

TWkd.Ease.prototype.getTiddlerEditField = function(title,field){
 var tiddler = document.getElementById(story.idPrefix + title);
 if(tiddler != null){
 var children = tiddler.getElementsByTagName("*")
 var e = null;
 for (var t=0; t<children.length; t++){
 var c = children[t];
 if(c.tagName.toLowerCase() == "input" || c.tagName.toLowerCase() == "textarea"){
 if(!e) {e = c;}
 if(c.getAttribute("edit") == field){e = c;}
 }
 }
 if(e){return e;}
 }
} // closes getTiddlerEditField function definition
 
TWkd.Ease.prototype.getSelection = function(title,quiet) {
 var tiddlerTextArea = this.getTiddlerEditField(title,"text");
 var result = {};
 if (document.selection != null && tiddlerTextArea.selectionStart == null) {
 tiddlerTextArea.focus();
 var range = document.selection.createRange();
 var bookmark = range.getBookmark();
 var contents = tiddlerTextArea.value;
 var originalContents = contents;
 var marker = "##SELECTION_MARKER_" + Math.random() + "##";
 while(contents.indexOf(marker) != -1) {
 marker = "##SELECTION_MARKER_" + Math.random() + "##";
 }
 var selection = range.text;
 range.text = marker + range.text + marker;
 contents = tiddlerTextArea.value;
 result.start = contents.indexOf(marker);
 contents = contents.replace(marker, "");
 result.end = contents.indexOf(marker);
 tiddlerTextArea.value = originalContents;
 range.moveToBookmark(bookmark);
 range.select();
 }
 else {
 result.start=tiddlerTextArea.selectionStart;
 result.end=tiddlerTextArea.selectionEnd;
 }
 result.content=tiddlerTextArea.value.substring(result.start,result.end);
 result.source=title;
 if (!result.content&&!quiet) displayMessage(config.messages.Ease.noselection);
 return(result);
}//closes getSelection function definition

// replace selection or insert new content
TWkd.Ease.prototype.putInPlace=function(content,workplace) {
 var tiddlerText = this.getTiddlerEditField(workplace.source,"text");
 tiddlerText.value = tiddlerText.value.substring(0,workplace.start)+content+tiddlerText.value.substring(workplace.end);
}

// asking for title
TWkd.Ease.prototype.askForTitle = function(suggestion) {
 if (!suggestion)
 suggestion = "";
 var newtitle;
 while (!newtitle||store.tiddlerExists(newtitle))
 {
 if (store.tiddlerExists(newtitle))
 displayMessage(newtitle+config.messages.Ease.exists);
 newtitle = prompt(config.messages.Ease.asktitle,suggestion);
 if (newtitle==null)
 {
 displayMessage(config.messages.Ease.titlecancel);
 return(false);
 }
 }
 return(newtitle);
}//closes askForTitle function definition

// creation of a new tiddler
TWkd.Ease.prototype.newTWkdLibTiddler = function(title,content,from,askForTags){
 var tiddler = new Tiddler();
 tiddler.title = title;
 tiddler.modifier = config.options.txtUserName;
 tiddler.text = content;
 (from) ? tiddler.tags = [from] : tiddler.tags=[];
 if (askForTags)
 tiddler.tags = prompt(config.messages.Ease.askForTagsLabel,'[['+from+']]').readBracketedList();
 store.addTiddler(tiddler);
 //store.notifyAll();
 displayMessage(title+config.messages.Ease.tiddlercreated);
}

if (!TWkd.Mode)
 TWkd.Mode = function (name,tooltip,ask,operation) {
 this.name = name;
 this.tooltip = tooltip;
 this.ask = ask;
 this.operation = operation;
 };
//}}}
<html><div class="esv"><h2>1 Samuel 1</h2>
<div class="esv-text">
<p class="chapter-first"><span class="chapter-num" id="v09001001-1">1:1&nbsp;</span>There was a certain man of Ramathaim-zophim of the hill country of Ephraim whose name was Elkanah the son of Jeroham, son of Elihu, son of Tohu, son of Zuph, an Ephrathite. <span class="verse-num" id="v09001002-1">2&nbsp;</span>He had two wives. The name of the one was Hannah, and the name of the other, Peninnah. And Peninnah had children, but Hannah had no children.</p>
 <p><span class="verse-num" id="v09001003-1">3&nbsp;</span>Now this man used to go up year by year from his city to worship and to sacrifice to the <span class="small-caps">Lord</span> of hosts at Shiloh, where the two sons of Eli, Hophni and Phinehas, were priests of the <span class="small-caps">Lord</span>. <span class="verse-num" id="v09001004-1">4&nbsp;</span>On the day when Elkanah sacrificed, he would give portions to Peninnah his wife and to all her sons and daughters. <span class="verse-num" id="v09001005-1">5&nbsp;</span>But to Hannah he gave a double portion, because he loved her, though the <span class="small-caps">Lord</span> had closed her womb. <span class="verse-num" id="v09001006-1">6&nbsp;</span>And her rival used to provoke her grievously to irritate her, because the <span class="small-caps">Lord</span> had closed her womb. <span class="verse-num" id="v09001007-1">7&nbsp;</span>So it went on year by year. As often as she went up to the house of the <span class="small-caps">Lord</span>, she used to provoke her. Therefore Hannah wept and would not eat. <span class="verse-num" id="v09001008-1">8&nbsp;</span>And Elkanah, her husband, said to her, &#8220;Hannah, why do you weep? And why do you not eat? And why is your heart sad? Am I not more to you than ten sons?&#8221;</p>
 <p><span class="verse-num" id="v09001009-1">9&nbsp;</span>After they had eaten and drunk in Shiloh, Hannah rose. Now Eli the priest was sitting on the seat beside the doorpost of the temple of the <span class="small-caps">Lord</span>. <span class="verse-num" id="v09001010-1">10&nbsp;</span>She was deeply distressed and prayed to the <span class="small-caps">Lord</span> and wept bitterly. <span class="verse-num" id="v09001011-1">11&nbsp;</span>And she vowed a vow and said, &#8220;O <span class="small-caps">Lord</span> of hosts, if you will indeed look on the affliction of your servant and remember me and not forget your servant, but will give to your servant a son, then I will give him to the <span class="small-caps">Lord</span> all the days of his life, and no razor shall touch his head.&#8221;</p>
 <p><span class="verse-num" id="v09001012-1">12&nbsp;</span>As she continued praying before the <span class="small-caps">Lord</span>, Eli observed her mouth. <span class="verse-num" id="v09001013-1">13&nbsp;</span>Hannah was speaking in her heart; only her lips moved, and her voice was not heard. Therefore Eli took her to be a drunken woman. <span class="verse-num" id="v09001014-1">14&nbsp;</span>And Eli said to her, &#8220;How long will you go on being drunk? Put your wine away from you.&#8221; <span class="verse-num" id="v09001015-1">15&nbsp;</span>But Hannah answered, &#8220;No, my lord, I am a woman troubled in spirit. I have drunk neither wine nor strong drink, but I have been pouring out my soul before the <span class="small-caps">Lord</span>. <span class="verse-num" id="v09001016-1">16&nbsp;</span>Do not regard your servant as a worthless woman, for all along I have been speaking out of my great anxiety and vexation.&#8221; <span class="verse-num" id="v09001017-1">17&nbsp;</span>Then Eli answered, &#8220;Go in peace, and the God of Israel grant your petition that you have made to him.&#8221; <span class="verse-num" id="v09001018-1">18&nbsp;</span>And she said, &#8220;Let your servant find favor in your eyes.&#8221; Then the woman went her way and ate, and her face was no longer sad.</p>
 <p><span class="verse-num" id="v09001019-1">19&nbsp;</span>They rose early in the morning and worshiped before the <span class="small-caps">Lord</span>; then they went back to their house at Ramah. And Elkanah knew Hannah his wife, and the <span class="small-caps">Lord</span> remembered her. <span class="verse-num" id="v09001020-1">20&nbsp;</span>And in due time Hannah conceived and bore a son, and she called his name Samuel, for she said, &#8220;I have asked for him from the <span class="small-caps">Lord</span>.&#8221;</p>
 
<p><span class="verse-num" id="v09001021-1">21&nbsp;</span>The man Elkanah and all his house went up to offer to the <span class="small-caps">Lord</span> the yearly sacrifice and to pay his vow. <span class="verse-num" id="v09001022-1">22&nbsp;</span>But Hannah did not go up, for she said to her husband, &#8220;As soon as the child is weaned, I will bring him, so that he may appear in the presence of the <span class="small-caps">Lord</span> and dwell there forever.&#8221; <span class="verse-num" id="v09001023-1">23&nbsp;</span>Elkanah her husband said to her, &#8220;Do what seems best to you; wait until you have weaned him; only, may the <span class="small-caps">Lord</span> establish his word.&#8221; So the woman remained and nursed her son until she weaned him. <span class="verse-num" id="v09001024-1">24&nbsp;</span>And when she had weaned him, she took him up with her, along with a three-year-old bull, an ephah of flour, and a skin of wine, and she brought him to the house of the <span class="small-caps">Lord</span> at Shiloh. And the child was young. <span class="verse-num" id="v09001025-1">25&nbsp;</span>Then they slaughtered the bull, and they brought the child to Eli. <span class="verse-num" id="v09001026-1">26&nbsp;</span>And she said, &#8220;Oh, my lord! As you live, my lord, I am the woman who was standing here in your presence, praying to the <span class="small-caps">Lord</span>. <span class="verse-num" id="v09001027-1">27&nbsp;</span>For this child I prayed, and the <span class="small-caps">Lord</span> has granted me my petition that I made to him. <span class="verse-num" id="v09001028-1">28&nbsp;</span>Therefore I have lent him to the <span class="small-caps">Lord</span>. As long as he lives, he is lent to the <span class="small-caps">Lord</span>.&#8221;</p>
<p>And he worshiped the <span class="small-caps">Lord</span> there.  (<a href="http://www.esv.org" class="copyright">ESV</a>)</p>
</div>
</div></html>
<html><div class="esv"><h2>John 3:16 <small class="audio">(<a href="http://www.gnpcb.org/esv/share/audio/smil?passage=John+3%3A16">Listen</a>)</small></h2>
<div class="esv-text">
<p><span class="verse-num-woc" id="v43003016-1">16&nbsp;</span><span class="woc">&#8220;For God so loved the world, that he gave his only Son, that whoever believes in him should not perish but have eternal life.</span>  (<a href="http://www.esv.org" class="copyright">ESV</a>)</p>
</div>
</div></html>
/***
|!Name|EsvInlineMacro|
|!Created by|JeremyCowgar|
|!Source|http://www.tiddlyforge.net/pytw/#EsvInlineMacro|
|!Version|1.0.2|
!Description
Turns a scripture reference into a the scripture text in the [[English Standard Version.|http://www.esv.org]] using the ESV [[Web API|http://www.gnpcb.org/esv/share/services/api/]]. Upon referencing a scripture verse for the first time, EsvInlineMacro will access the Web API and retrieve the verse content into it's own Tiddler. A {{{<<tiddler "ESV - Verse Reference">>}}} is then inserted into the Tiddler body causing that verse content to appear. If the Tiddler exists for the reference you have entered already, EsvInlineMacro does not access the Web API, it simply includes the existing Tiddler with the verse contents.

!Examples
* {{{<<esv John 3:16>>}}}
* {{{<<esv John 3:1-18>>}}}
* {{{<<esv John 1:1-4:10>>}}}
* {{{<<esv Genesis 50:5-Exodus 1:5>>}}},
* {{{<<esv Genesis 5:5,Exodus 10:10>>}}}
* {{{<<esv Ge 5:1>>}}}

!Notes
To make the macro work you have to give this tiddler a tag of systemConfig then save and reload.

!Todos
* Cause each scripture verse Tiddler to be referenced by the Tiddler that is using it. This way I can look at "ESV - John 3:16" and see which Tiddlers use that particular scripture verse.
* Push verse request to the limit for the day (500) and see what type of error message begins to appear and code to handle.
* Add configuration options:
** key setting, currently set to "IP". This is valid and will work for up to 500 verse lookups per day, for anything more, you have to register for your own key (free).
* Test in other browsers. Currently only tested in Firefox 1.0.7 and 1.5 beta 2.
** Opera
** Internet Explorer
** Safari

!Change Log
* ''v1.0.2'': Increased performance, fix by PaulPetterson. Moved location of checking to see if the Tiddler Exists to before doing a lookup.

!Code
***/
//{{{

version.extensions.esv = {major: 1, minor: 0 , revision: 2, date: new Date(2005,11,3)};
config.macros.esv = {alertMsg: "Permission to read from ESV was denied, security permission error?"};
config.macros.esv.handler= function(place,macroName,params) {
  var verse = params.join(' ');
  var tiddlerName = "ESV - " + verse;

  if (!store.tiddlerExists(tiddlerName)) {
    var myConfig = config.macros.esv;
    var feedURL = "http://www.gnpcb.org/esv/share/get/?key=IP&action=doPassageQuery&include-headings=false" +
          "&include-footnotes=false&passage=" + verse.replace(' ', '+');
    var request;

    try { request = new XMLHttpRequest(); }
    catch (e) { request = new ActiveXObject("Msxml2.XMLHTTP"); }

    try { netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); }
    catch (e) { alert(myConfig.alertMsg); }

    request.open("GET", feedURL, false);
    request.send(null);

    var body = request.responseText;
    if (body.length > 5 && body.substring(0, 5) == "ERROR") {
      wikify("''Invalid passage:'' " + verse, place);
      return;
    }

    store.saveTiddler(tiddlerName, tiddlerName, "<html>" + body + "</html>", 
            config.options.txtUserName, null, "ESV");
  }
  wikify("<<tiddler \"" + tiddlerName + "\">>", place);
}

//}}}
/***
|!Name|EsvInlineMacro|
|!Created by|JeremyCowgar|
|!Source|http://www.tiddlyforge.net/pytw/#EsvInlineMacro|
|!Version|1.0.2|
|recent alterations|took off passage references and numbers within the text, and is now text instead of html|
!Description
Turns a scripture reference into a the scripture text in the [[English Standard Version.|http://www.esv.org]] using the ESV [[Web API|http://www.gnpcb.org/esv/share/services/api/]]. Upon referencing a scripture verse for the first time, EsvInlineMacro will access the Web API and retrieve the verse content into it's own Tiddler. A {{{<<tiddler "ESV - Verse Reference">>}}} is then inserted into the Tiddler body causing that verse content to appear. If the Tiddler exists for the reference you have entered already, EsvInlineMacro does not access the Web API, it simply includes the existing Tiddler with the verse contents.

!Examples
* {{{<<esv John 3:16>>}}}
* {{{<<esv John 3:1-18>>}}}
* {{{<<esv John 1:1-4:10>>}}}
* {{{<<esv Genesis 50:5-Exodus 1:5>>}}},
* {{{<<esv Genesis 5:5,Exodus 10:10>>}}}
* {{{<<esv Ge 5:1>>}}}

!Notes
To make the macro work you have to give this tiddler a tag of systemConfig then save and reload.

!Todos
* Cause each scripture verse Tiddler to be referenced by the Tiddler that is using it. This way I can look at "ESV - John 3:16" and see which Tiddlers use that particular scripture verse.
* Push verse request to the limit for the day (500) and see what type of error message begins to appear and code to handle.
* Add configuration options:
** key setting, currently set to "IP". This is valid and will work for up to 500 verse lookups per day, for anything more, you have to register for your own key (free).
* Test in other browsers. Currently only tested in Firefox 1.0.7 and 1.5 beta 2.
** Opera
** Internet Explorer
** Safari

!Change Log
* ''v1.0.2'': Increased performance, fix by PaulPetterson. Moved location of checking to see if the Tiddler Exists to before doing a lookup.

!Code
***/
//{{{

version.extensions.esv = {major: 1, minor: 0 , revision: 2, date: new Date(2005,11,3)};
config.macros.esv = {alertMsg: "Permission to read from ESV was denied, security permission error?"};
config.macros.esv.handler= function(place,macroName,params) {
  var verse = params.join(' ');
  var tiddlerName = verse;

   {
    var myConfig = config.macros.esv;
    var feedURL = "http://www.gnpcb.org/esv/share/get/?key=IP&action=doPassageQuery&output-format=plain-text&include-passage-horizontal-lines=false&include-headings=false&include-passage-references=false&include-first-verse-numbers=false&include-heading-horizontal-lines=false&include-verse-numbers=false" +
          "&include-footnotes=false&passage=" + verse.replace(' ', '+');
    var request;

    try { request = new XMLHttpRequest(); }
    catch (e) { request = new ActiveXObject("Msxml2.XMLHTTP"); }

    try { netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); }
    catch (e) { alert(myConfig.alertMsg); }

    request.open("GET", feedURL, false);
    request.send(null);

    var body = request.responseText;
    if (body.length > 5 && body.substring(0, 5) == "ERROR") {
      wikify("''Invalid passage:'' " + verse, place);
      return;
    }

    store.saveTiddler(tiddlerName, tiddlerName, body, 
            config.options.txtUserName, null, "ESV");
  }
  wikify("<<tiddler \"" + tiddlerName + "\">>", place);
}

//}}}
/***
|!Name|EsvLinkMacro|
|!Created by|JeremyCowgar|
|!Source|http://www.tiddlyforge.net/pytw/#EsvLinkMacro|
|!Version|1.0|
!Description
Turns a scripture reference into a link to the online ESV Bible.

!Examples
{{{<<esvlink John 3:16-18>>}}}
<<esvlink John 3:16-18>>

!Notes
To make the macro work you have to give this tiddler a tag of systemConfig then save and reload.

!Todo
* Add configuration options:
** key setting, currently set to "IP". This is valid and will work for up to 500 verse lookups per day, for anything more, you have to register for your own key (free).
* Make it popup in a "ToolTip" like window like: [[Scripturizer JS|http://fucoder.com/code/scripturizer-js/]]

!Code
***/
//{{{

esvPopUp = function(verse) {
  var id = new Date();
  window.open("http://www.gnpcb.org/esv/share/get/?key=IP&action=doQuery&include-footnotes=false&q=" 
        + verse.replace(' ', '+'), id, 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,' 
        + 'width=600,height=300');
}

version.extensions.esvlink = {major: 1, minor: 0 , revision: 0, date: new Date(2005,11,1)};
config.macros.esvlink = {};
config.macros.esvlink.handler= function(place,macroName,params) {
  var verse = params.join(' ');
  var theLink = document.createElement("a");
  theLink.className = "externalLink";
  theLink.href = "javascript:esvPopUp('" + verse + "');" 
  theLink.title = verse;
  place.appendChild(theLink);
  theLink.appendChild(document.createTextNode(verse))
}

//}}}
/***
|Location|http://visualtw.ouvaton.org/VisualTW.html|
|Version|1.0|
|Requires|~TW2.2.x|
|Browsers|Firefox 2.0.x, IE 6.0+, others|
!Description:
Edit fields as listbox.
!Demo:
On [[homepage|http://visualtw.ouvaton.org/VisualTW.html]], see [[ListBox Example]].
!Usage:
In your edit template, use the macro {{{editListbox field source rows}}}
* {{{field}}} is the field name
* {{{source}}} points to a tiddler containing the list values (one value by line, the default value line starts with +)
* {{{rows}}} defines the listbox size. If no value is defined, the control is a dropdown list.
!Installation:
import this tiddler from [[homepage|http://visualtw.ouvaton.org/VisualTW.html]] (tagged as systemConfig)
***/
//{{{
config.macros.editListbox = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		var field = params[0];
		var source = params[1];
		var rows = params[2];
		if (field) {
			var value = store.getValue(tiddler,field);
			var content=store.getValue(source,"text");
        	        lines = content ? content.split("\n") : [];
			var list = createTiddlyElement(null,"select");
			list.setAttribute("edit",field);
			if (rows) list.size=rows;
			for(var cpt = 0; cpt <lines.length; cpt++) {
				opt = document.createElement("option");
        	                var line = lines[cpt];
	                        if (line.substr(0,1)=="+"){
        	                    if (!value) opt.setAttribute("selected","true");
                	            line = line.substr(1);
                        	}    
	                        if (line == value)
					opt.setAttribute("selected","true");            
				opt.setAttribute("value",line);
				opt.appendChild(document.createTextNode(line));
				list.appendChild(opt);
			}
			place.appendChild(list);
		}		
	}
}
//}}}
/***
|Location|http://visualtw.ouvaton.org/VisualTW.html|
|Version|1.0|
|Requires|~TW2.2.x|
|Browsers|Firefox 2.0.x, IE 6.0+, others|
!Description:
Edit fields as listbox.
!Demo:
On [[homepage|http://visualtw.ouvaton.org/VisualTW.html]], see [[ListBox Example]].
!Usage:
In your edit template, use the macro {{{editListbox field source rows}}}
* {{{field}}} is the field name
* {{{source}}} points to a tiddler containing the list values (one value by line, the default value line starts with +)
* {{{rows}}} defines the listbox size. If no value is defined, the control is a dropdown list.
!Installation:
import this tiddler from [[homepage|http://visualtw.ouvaton.org/VisualTW.html]] (tagged as systemConfig)
***/
//{{{
config.macros.editListbox = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		var field = params[0];
		var source = params[1];
		var rows = params[2];
		if (field) {
			var value = store.getValue(tiddler,field);
			var content=store.getValue(source,"text");
        	        lines = content ? content.split("\n") : [];
			var list = createTiddlyElement(null,"select");
			list.setAttribute("edit",field);
			if (rows) list.size=rows;
			for(var cpt = 0; cpt <lines.length; cpt++) {
				opt = document.createElement("option");
        	                var line = lines[cpt];
	                        if (line.substr(0,1)=="+"){
        	                    if (!value) opt.setAttribute("selected","true");
                	            line = line.substr(1);
                        	}    
	                        if (line == value)
					opt.setAttribute("selected","true");            
				opt.setAttribute("value",line);
				opt.appendChild(document.createTextNode(line));
				list.appendChild(opt);
			}
			place.appendChild(list);
		}		
	}
}
//}}}
[[MptwEditTemplate]]
Mark your text with these in edit mode:
| !To get | !Type this |
| ''Bold'' | {{{''Bold''}}} |
| --Strikethrough-- | {{{--Strikethrough--}}} |
| __Underline__ | {{{__Underline__}}} (that's two underline characters) |
| //Italic// | {{{//Italic//}}} |
| Superscript: 2^^3^^=8 | {{{2^^3^^=8}}} |
| Subscript: a~~ij~~ = -a~~ji~~ | {{{a~~ij~~ = -a~~ji~~}}} |
| @@highlight@@ | {{{@@highlight@@}}} |
|@@color:green;green coloured@@|{{{@@color:green;green coloured@@}}}|

|>|!<<tips Settings Locale>>|
|!<<tips Plugin Locale>> |<<tips PopupTipsPlugin Info>>|
|!<<tips Config Locale>> |<<tips TipsConfig Info>>.<<tips locale>>|
|!<<tips Definitions Locale>>|<<tips TipsDefs Info>>.<<tips locale>>|
|>|!<<tips 'Locale_driven' Locale>>|
|!<<tips Locale Locale>> |<<option txtLocale>> <<tiddler RefreshLocale>>|
|!<<tips Examples Locale>> |<<tips Using_Alias>>|
|~|<<tips Notation Locale>>: <<tips 1 Note>>|
|~|<<tips GettingStarted Info>>|
[[Simple Clock|ExampleSimpleClock]]
[[PopupTips|ExamplePopupTips]]
[[XMLReader|ExampleXMLReader]]
The word exegesis can mean explanation, but as a technical term it means ''//"to draw the meaning out of"//'' a given text. Exegesis may be contrasted with eisegesis, which means to read one's own interpretation into a given text. In general, exegesis presumes an attempt to view the text objectively, while eisegesis implies more subjectivity.

One may encounter the terms exegesis and hermeneutics used interchangeably; however, there remains a distinction. ''An exegesis is the interpretation and understanding of a text on the basis of the text itself.'' A hermeneutic is a practical application of a certain method or theory of interpretation, often revolving around the contemporary relevance of the text in question.  @@(DP: exegisis is the end result, hermeneutics is the method)@@

Traditional exegesis requires the following: analysis of significant words in the text in regard to translation; examination of the general historical and cultural context, confirmation of the limits of the passage, and lastly, examination of the context within the text. [1]
/***
| Name:|ExtentTagButtonPlugin|
| Description:|Adds a New tiddler button in the tag drop down|
| Version:|3.0.1 ($Rev: 2263 $)|
| Date:|$Date: 2007-06-13 04:22:32 +1000 (Wed, 13 Jun 2007) $|
| Source:|http://mptw.tiddlyspot.com/#ExtendTagButtonPlugin|
| Author:|Simon Baird <simon.baird@gmail.com>|
| License|http://mptw.tiddlyspot.com/#TheBSDLicense|
***/
//{{{

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

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

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

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

//}}}

/***
|Location|http://visualtw.ouvaton.org/VisualTW.html|
|Version|1.0.0|
|Requires|~TW2.2.x|
|Browsers|Firefox 2.0.x, IE 6.0+, others|
!Description:
//create//, //edit//, //view// and //delete// commands in toolbar <<toolbar fields>>
!Demo:
On [[homepage|http://visualtw.ouvaton.org/VisualTW.html]], see [[FieldEditor example]]
!Installation:
*import this tiddler from [[homepage|http://visualtw.ouvaton.org/VisualTW.html]] (tagged as systemConfig)
*save and reload
*optionnaly : add the following css text in your StyleSheet : {{{#popup tr.fieldTableRow td {padding:1px 3px 1px 3px;}}}}
!Code
***/

//{{{

config.commands.fields.handlePopup = function(popup,title) {
	var tiddler = store.fetchTiddler(title);
	if(!tiddler)
		return;
	var fields = {};
	store.forEachField(tiddler,function(tiddler,fieldName,value) {fields[fieldName] = value;},true);
	var items = [];
	for(var t in fields) {
		var editCommand = "<<untiddledCall editFieldDialog "+escape(title)+" "+escape(t)+">>";
		var deleteCommand = "<<untiddledCall deleteField "+escape(title)+" "+escape(t)+">>";
		var renameCommand = "<<untiddledCall renameField "+escape(title)+" "+escape(t)+">>";
		items.push({field: t,value: fields[t], actions: editCommand+renameCommand+deleteCommand});
	}
	items.sort(function(a,b) {return a.field < b.field ? -1 : (a.field == b.field ? 0 : +1);});
	var createNewCommand = "<<untiddledCall createField "+escape(title)+">>";
	items.push({field : "", value : "", actions:createNewCommand });
	if(items.length > 0)
		ListView.create(popup,items,this.listViewTemplate);
	else
		createTiddlyElement(popup,"div",null,null,this.emptyText);
}

config.commands.fields.listViewTemplate = {
	columns: [
		{name: 'Field', field: 'field', title: "Field", type: 'String'},
		{name: 'Actions', field: 'actions', title: "Actions", type: 'WikiText'},
		{name: 'Value', field: 'value', title: "Value", type: 'WikiText'}
	],
	rowClasses: [
			{className: 'fieldTableRow', field: 'actions'}
	],
	buttons: [	//can't use button for selected then delete, because click on checkbox will hide the popup
	]
}

config.macros.untiddledCall = {  // when called from listview, tiddler is unset, so we need to pass tiddler as parameter
	handler : function(place,macroName,params,wikifier,paramString) {
		var macroName = params.shift();
		if (macroName) var macro = config.macros[macroName];
		var title = params.shift();
		if (title) var tiddler = store.getTiddler(unescape(title));
		if (macro) macro.handler(place,macroName,params,wikifier,paramString,tiddler);		
	}
}

config.macros.deleteField = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		if(!readOnly && params[0]) {
			fieldName = unescape(params[0]);
			var btn = createTiddlyButton(place,"delete", "delete "+fieldName,this.onClickDeleteField);
			btn.setAttribute("title",tiddler.title);
			btn.setAttribute("fieldName", fieldName);
		}
	},
	onClickDeleteField : function() {
		var title=this.getAttribute("title");
		var fieldName=this.getAttribute("fieldName");
		var tiddler = store.getTiddler(title);
		if (tiddler && fieldName && confirm("delete field " + fieldName+" from " + title +" tiddler ?")) {
			delete tiddler.fields[fieldName];	
			story.refreshTiddler(title,"ViewTemplate",true);
		}
		return false;
	}
}

config.macros.createField = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		if(!readOnly) {
			var btn = createTiddlyButton(place,"create new", "create a new field",this.onClickCreateField);
			btn.setAttribute("title",tiddler.title);
		}
	},
	onClickCreateField : function() {
		var title=this.getAttribute("title");
		var tiddler = store.getTiddler(title);
		if (tiddler) {
			var fieldName = prompt("Field name","");
			if (store.getValue(tiddler,fieldName)) {
				window.alert("This field already exists.");
			}
			else if (fieldName) {
				var v = prompt("Field value","");
				tiddler.fields[fieldName]=v;
				story.refreshTiddler(title,"ViewTemplate",true);
			}
		}
		return false;
	}
}

config.macros.editFieldDialog = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		if(!readOnly && params[0]) {
			fieldName = unescape(params[0]);
			var btn = createTiddlyButton(place,"edit", "edit this field",this.onClickEditFieldDialog);
			btn.setAttribute("title",tiddler.title);
			btn.setAttribute("fieldName", fieldName);
		}
	},
	onClickEditFieldDialog : function() {
		var title=this.getAttribute("title");
		var tiddler = store.getTiddler(title);
		var fieldName=this.getAttribute("fieldName");
		if (tiddler && fieldName) {
			var value = tiddler.fields[fieldName];
			value = value ? value : "";
			var lines = value.match(/\n/mg);
			lines = lines ? true : false;
			if (!lines || confirm("This field contains more than one line. Only the first line will be kept if you edit it here. Proceed ?")) {
				var v = prompt("Field value",value);
				tiddler.fields[fieldName]=v;
				story.refreshTiddler(title,"ViewTemplate",true);
			}
		}
		return false;
	}
}

config.macros.renameField = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		if(!readOnly && params[0]) {
			fieldName = unescape(params[0]);
			var btn = createTiddlyButton(place,"rename", "rename "+fieldName,this.onClickRenameField);
			btn.setAttribute("title",tiddler.title);
			btn.setAttribute("fieldName", fieldName);
		}
	},
	onClickRenameField : function() {
		var title=this.getAttribute("title");
		var fieldName=this.getAttribute("fieldName");
		var tiddler = store.getTiddler(title);
		if (tiddler && fieldName) {
			var newName = prompt("Rename " + fieldName + " as ?", fieldName);
			if (newName) {
				tiddler.fields[newName]=tiddler.fields[fieldName];
				delete tiddler.fields[fieldName];	
				story.refreshTiddler(title,"ViewTemplate",true);
			}
		}
		return false;
	}
}
//}}}
Use <<toolbar fields>> in toolbar to see this tiddler fields.
/***
|Location|http://visualtw.ouvaton.org/VisualTW.html|
|Version|1.0.0|
|Requires|~TW2.2.x|
|Browsers|Firefox 2.0.x, IE 6.0+, others|
!Description:
//create//, //edit//, //view// and //delete// commands in toolbar <<toolbar fields>>
!Demo:
On [[homepage|http://visualtw.ouvaton.org/VisualTW.html]], see [[FieldEditor example]]
!Installation:
*import this tiddler from [[homepage|http://visualtw.ouvaton.org/VisualTW.html]] (tagged as systemConfig)
*save and reload
*optionnaly : add the following css text in your StyleSheet : {{{#popup tr.fieldTableRow td {padding:1px 3px 1px 3px;}}}}
!Code
***/

//{{{

config.commands.fields.handlePopup = function(popup,title) {
	var tiddler = store.fetchTiddler(title);
	if(!tiddler)
		return;
	var fields = {};
	store.forEachField(tiddler,function(tiddler,fieldName,value) {fields[fieldName] = value;},true);
	var items = [];
	for(var t in fields) {
		var editCommand = "<<untiddledCall editFieldDialog "+escape(title)+" "+escape(t)+">>";
		var deleteCommand = "<<untiddledCall deleteField "+escape(title)+" "+escape(t)+">>";
		var renameCommand = "<<untiddledCall renameField "+escape(title)+" "+escape(t)+">>";
		items.push({field: t,value: fields[t], actions: editCommand+renameCommand+deleteCommand});
	}
	items.sort(function(a,b) {return a.field < b.field ? -1 : (a.field == b.field ? 0 : +1);});
	var createNewCommand = "<<untiddledCall createField "+escape(title)+">>";
	items.push({field : "", value : "", actions:createNewCommand });
	if(items.length > 0)
		ListView.create(popup,items,this.listViewTemplate);
	else
		createTiddlyElement(popup,"div",null,null,this.emptyText);
}

config.commands.fields.listViewTemplate = {
	columns: [
		{name: 'Field', field: 'field', title: "Field", type: 'String'},
		{name: 'Actions', field: 'actions', title: "Actions", type: 'WikiText'},
		{name: 'Value', field: 'value', title: "Value", type: 'WikiText'}
	],
	rowClasses: [
			{className: 'fieldTableRow', field: 'actions'}
	],
	buttons: [	//can't use button for selected then delete, because click on checkbox will hide the popup
	]
}

config.macros.untiddledCall = {  // when called from listview, tiddler is unset, so we need to pass tiddler as parameter
	handler : function(place,macroName,params,wikifier,paramString) {
		var macroName = params.shift();
		if (macroName) var macro = config.macros[macroName];
		var title = params.shift();
		if (title) var tiddler = store.getTiddler(unescape(title));
		if (macro) macro.handler(place,macroName,params,wikifier,paramString,tiddler);		
	}
}

config.macros.deleteField = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		if(!readOnly && params[0]) {
			fieldName = unescape(params[0]);
			var btn = createTiddlyButton(place,"delete", "delete "+fieldName,this.onClickDeleteField);
			btn.setAttribute("title",tiddler.title);
			btn.setAttribute("fieldName", fieldName);
		}
	},
	onClickDeleteField : function() {
		var title=this.getAttribute("title");
		var fieldName=this.getAttribute("fieldName");
		var tiddler = store.getTiddler(title);
		if (tiddler && fieldName && confirm("delete field " + fieldName+" from " + title +" tiddler ?")) {
			delete tiddler.fields[fieldName];	
			story.refreshTiddler(title,"ViewTemplate",true);
		}
		return false;
	}
}

config.macros.createField = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		if(!readOnly) {
			var btn = createTiddlyButton(place,"create new", "create a new field",this.onClickCreateField);
			btn.setAttribute("title",tiddler.title);
		}
	},
	onClickCreateField : function() {
		var title=this.getAttribute("title");
		var tiddler = store.getTiddler(title);
		if (tiddler) {
			var fieldName = prompt("Field name","");
			if (store.getValue(tiddler,fieldName)) {
				window.alert("This field already exists.");
			}
			else if (fieldName) {
				var v = prompt("Field value","");
				tiddler.fields[fieldName]=v;
				story.refreshTiddler(title,"ViewTemplate",true);
			}
		}
		return false;
	}
}

config.macros.editFieldDialog = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		if(!readOnly && params[0]) {
			fieldName = unescape(params[0]);
			var btn = createTiddlyButton(place,"edit", "edit this field",this.onClickEditFieldDialog);
			btn.setAttribute("title",tiddler.title);
			btn.setAttribute("fieldName", fieldName);
		}
	},
	onClickEditFieldDialog : function() {
		var title=this.getAttribute("title");
		var tiddler = store.getTiddler(title);
		var fieldName=this.getAttribute("fieldName");
		if (tiddler && fieldName) {
			var value = tiddler.fields[fieldName];
			value = value ? value : "";
			var lines = value.match(/\n/mg);
			lines = lines ? true : false;
			if (!lines || confirm("This field contains more than one line. Only the first line will be kept if you edit it here. Proceed ?")) {
				var v = prompt("Field value",value);
				tiddler.fields[fieldName]=v;
				story.refreshTiddler(title,"ViewTemplate",true);
			}
		}
		return false;
	}
}

config.macros.renameField = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		if(!readOnly && params[0]) {
			fieldName = unescape(params[0]);
			var btn = createTiddlyButton(place,"rename", "rename "+fieldName,this.onClickRenameField);
			btn.setAttribute("title",tiddler.title);
			btn.setAttribute("fieldName", fieldName);
		}
	},
	onClickRenameField : function() {
		var title=this.getAttribute("title");
		var fieldName=this.getAttribute("fieldName");
		var tiddler = store.getTiddler(title);
		if (tiddler && fieldName) {
			var newName = prompt("Rename " + fieldName + " as ?", fieldName);
			if (newName) {
				tiddler.fields[newName]=tiddler.fields[fieldName];
				delete tiddler.fields[fieldName];	
				story.refreshTiddler(title,"ViewTemplate",true);
			}
		}
		return false;
	}
}
//}}}
/***
<<checkForDataTiddlerPlugin>>
|''Name:''|FormTiddlerPlugin|
|''Version:''|1.0.5 (2006-02-24)|
|''Source:''|http://tiddlywiki.abego-software.de/#FormTiddlerPlugin|
|''Author:''|UdoBorkowski (ub [at] abego-software [dot] de)|
|''Licence:''|[[BSD open source license]]|
|''Macros:''|formTiddler, checkForDataTiddlerPlugin, newTiddlerWithForm|
|''Requires:''|DataTiddlerPlugin|
|''TiddlyWiki:''|1.2.38+, 2.0|
|''Browser:''|Firefox 1.0.4+; InternetExplorer 6.0|
!Description
Use form-based tiddlers to enter your tiddler data using text fields, listboxes, checkboxes etc. (All standard HTML Form input elements supported).

''Syntax:'' 
|>|{{{<<}}}''formTiddler'' //tiddlerName//{{{>>}}}|
|//tiddlerName//|The name of the FormTemplate tiddler to be used to edit the data of the tiddler containing the macro.|

|>|{{{<<}}}''newTiddlerWithForm'' //formTemplateName// //buttonLabel// [//titleExpression// [''askUser'']] {{{>>}}}|
|//formTemplateName//|The name of the tiddler that defines the form the new tiddler should use.|
|//buttonLabel//|The label of the button|
|//titleExpression//|A (quoted) JavaScript String expression that defines the title (/name) of the new tiddler.|
|''askUser''|Typically the user is not asked for the title when a title is specified (and not yet used). When ''askUser'' is given the user will be asked in any case. This may be used when the calculated title is just a suggestion that must be confirmed by the user|
|>|~~Syntax formatting: Keywords in ''bold'', optional parts in [...]. 'or' means that exactly one of the two alternatives must exist.~~|

For details and how to use the macros see the [[introduction|FormTiddler Introduction]] and the [[examples|FormTiddler Examples]].

!Revision history
* v1.0.5 (2006-02-24)
** Removed "debugger;" instruction
* v1.0.4 (2006-02-07)
** Bug: On IE no data is written to data section when field values changed (thanks to KenGirard for reporting)
* v1.0.3 (2006-02-05)
** Bug: {{{"No form template specified in <<formTiddler>>"}}} when using formTiddler macro on InternetExplorer (thanks to KenGirard for reporting)
* v1.0.2 (2006-01-06)
** Support TiddlyWiki 2.0
* v1.0.1 (2005-12-22)
** Features: 
*** Support InternetExplorer
*** Added newTiddlerWithForm Macro
* v1.0.0 (2005-12-14)
** initial version

!Code
***/
//{{{

//============================================================================
//============================================================================
// FormTiddlerPlugin
//============================================================================
//============================================================================


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

// For backward compatibility with v1.2.x
//
if (!window.story) window.story=window; 
if (!TiddlyWiki.prototype.getTiddler) TiddlyWiki.prototype.getTiddler = function(title) { return t = this.tiddlers[title]; return (t != undefined && t instanceof Tiddler) ? t : null; } 

//============================================================================
// formTiddler Macro
//============================================================================

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

config.macros.formTiddler = {
 // Standard Properties
 label: "formTiddler",
 version: {major: 1, minor: 0, revision: 4, date: new Date(2006, 2, 7)},
 prompt: "Edit tiddler data using forms",

 // Define the "setters" that set the values of INPUT elements of a given type
 // (must match the corresponding "getter")
 setter: { 
 button: function(e, value) {/*contains no data */ },
 checkbox: function(e, value) {e.checked = value;},
 file: function(e, value) {try {e.value = value;} catch(e) {/* ignore, possibly security error*/}},
 hidden: function(e, value) {e.value = value;},
 password: function(e, value) {e.value = value;},
 radio: function(e, value) {e.checked = (e.value == value);},
 reset: function(e, value) {/*contains no data */ },
 "select-one": function(e, value) {config.macros.formTiddler.setSelectOneValue(e,value);},
 "select-multiple": function(e, value) {config.macros.formTiddler.setSelectMultipleValue(e,value);},
 submit: function(e, value) {/*contains no data */},
 text: function(e, value) {e.value = value;},
 textarea: function(e, value) {e.value = value;}
 },

 // Define the "getters" that return the value of INPUT elements of a given type
 // Return undefined to not store any data.
 getter: { 
 button: function(e, value) {return undefined;},
 checkbox: function(e, value) {return e.checked;},
 file: function(e, value) {return e.value;},
 hidden: function(e, value) {return e.value;},
 password: function(e, value) {return e.value;},
 radio: function(e, value) {return e.checked ? e.value : undefined;},
 reset: function(e, value) {return undefined;},
 "select-one": function(e, value) {return config.macros.formTiddler.getSelectOneValue(e);},
 "select-multiple": function(e, value) {return config.macros.formTiddler.getSelectMultipleValue(e);},
 submit: function(e, value) {return undefined;},
 text: function(e, value) {return e.value;},
 textarea: function(e, value) {return e.value;}
 }
};


// -------------------------------------------------------------------------------
// The formTiddler Macro Handler 
// -------------------------------------------------------------------------------

config.macros.formTiddler.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
 if (!config.macros.formTiddler.checkForExtensions(place, macroName)) {
 return;
 }
 
 // --- Parsing ------------------------------------------

 var i = 0; // index running over the params

 // get the name of the form template tiddler
 var formTemplateName = undefined;
 if (i < params.length) {
 formTemplateName = params[i];
 i++;
 }

 if (!formTemplateName) {
 config.macros.formTiddler.createErrorElement(place, "No form template specified in <<" + macroName + ">>.");
 return;
 }


 // --- Processing ------------------------------------------

 // Get the form template text. 
 // (This contains the INPUT elements for the form.)
 var formTemplateTiddler = store.getTiddler(formTemplateName);
 if (!formTemplateTiddler) {
 config.macros.formTiddler.createErrorElement(place, "Form template '" + formTemplateName + "' not found.");
 return;
 }
 var templateText = formTemplateTiddler.text;
 if(!templateText) {
 // Shortcut: when template text is empty we do nothing.
 return;
 }

 // Get the name of the tiddler containing this "formTiddler" macro
 // (i.e. the tiddler, that will be edited and that contains the data)
 var tiddlerName = config.macros.formTiddler.getContainingTiddlerName(place);

 // Append a "form" element. 
 var formName = "form"+formTemplateName+"__"+tiddlerName;
 var e = document.createElement("form");
 e.setAttribute("name", formName);
 place.appendChild(e);

 // "Embed" the elements defined by the templateText (i.e. the INPUT elements) 
 // into the "form" element we just created
 wikify(templateText, e);

 // Initialize the INPUT elements.
 config.macros.formTiddler.initValuesAndHandlersInFormElements(formName, DataTiddler.getDataObject(tiddlerName));
}


// -------------------------------------------------------------------------------
// Form Data Access 
// -------------------------------------------------------------------------------

// Internal.
//
// Initialize the INPUT elements of the form with the values of their "matching"
// data fields in the tiddler. Also setup the onChange handler to ensure that
// changes in the INPUT elements are stored in the tiddler's data.
//
config.macros.formTiddler.initValuesAndHandlersInFormElements = function(formName, data) {
 // config.macros.formTiddler.trace("initValuesAndHandlersInFormElements(formName="+formName+", data="+data+")");

 // find the form
 var form = config.macros.formTiddler.findForm(formName);
 if (!form) {
 return;
 }

 try {
 var elems = form.elements;
 for (var i = 0; i < elems.length; i++) {
 var c = elems[i];
 
 var setter = config.macros.formTiddler.setter[c.type];
 if (setter) {
 var value = data[c.name];
 if (value != null) {
 setter(c, value);
 }
 c.onchange = onFormTiddlerChange;
 } else {
 config.macros.formTiddler.displayFormTiddlerError("No setter defined for INPUT element of type '"+c.type+"'. (Element '"+c.name+"' in form '"+formName+"')");
 }
 }
 } catch(e) {
 config.macros.formTiddler.displayFormTiddlerError("Error when updating elements with new formData. "+e);
 }
}


// Internal.
//
// @return [may be null]
//
config.macros.formTiddler.findForm = function(formName) {
 // We must manually iterate through the document's forms, since
 // IE does not support the "document[formName]" approach

 var forms = window.document.forms;
 for (var i = 0; i < forms.length; i++) {
 var form = forms[i];
 if (form.name == formName) {
 return form;
 }
 }

 return null;
}


// Internal.
//
config.macros.formTiddler.setSelectOneValue = function(element,value) {
 var n = element.options.length;
 for (var i = 0; i < n; i++) {
 element.options[i].selected = element.options[i].value == value;
 }
}

// Internal.
//
config.macros.formTiddler.setSelectMultipleValue = function(element,value) {
 var values = {};
 for (var i = 0; i < value.length; i++) {
 values[value[i]] = true;
 }
 
 var n = element.length;
 for (var i = 0; i < n; i++) {
 element.options[i].selected = !(!values[element.options[i].value]);
 }
}

// Internal.
//
config.macros.formTiddler.getSelectOneValue = function(element) {
 var i = element.selectedIndex;
 return (i >= 0) ? element.options[i].value : null;
}

// Internal.
//
config.macros.formTiddler.getSelectMultipleValue = function(element) {
 var values = [];
 var n = element.length;
 for (var i = 0; i < n; i++) {
 if (element.options[i].selected) {
 values.push(element.options[i].value);
 }
 }
 return values;
}



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

// Internal.
//
config.macros.formTiddler.checkForExtensions = function(place,macroName) {
 if (!version.extensions.DataTiddlerPlugin) {
 config.macros.formTiddler.createErrorElement(place, "<<" + macroName + ">> requires the DataTiddlerPlugin. (You can get it from http://tiddlywiki.abego-software.de/#DataTiddlerPlugin)");
 return false;
 }
 return true;
}

// Internal.
//
// Displays a trace message in the "TiddlyWiki" message pane.
// (used for debugging)
//
config.macros.formTiddler.trace = function(s) {
 displayMessage("Trace: "+s);
}

// Internal.
//
// Display some error message in the "TiddlyWiki" message pane.
//
config.macros.formTiddler.displayFormTiddlerError = function(s) {
 alert("FormTiddlerPlugin Error: "+s);
}

// Internal.
//
// Creates an element that holds an error message
// 
config.macros.formTiddler.createErrorElement = function(place, message) {
 return createTiddlyElement(place,"span",null,"formTiddlerError",message);
}

// Internal.
//
// Returns the name of the tiddler containing the given element.
// 
config.macros.formTiddler.getContainingTiddlerName = function(element) {
 return story.findContainingTiddler(element).id.substr(7);
}

// -------------------------------------------------------------------------------
// Event Handlers 
// -------------------------------------------------------------------------------

// This function must be called by the INPUT elements whenever their
// data changes. Typically this is done through an "onChange" handler.
//
function onFormTiddlerChange (e) {
 // config.macros.formTiddler.trace("onFormTiddlerChange "+e);

 if (!e) var e = window.event;

 var target = resolveTarget(e);
 var tiddlerName = config.macros.formTiddler.getContainingTiddlerName(target);
 var getter = config.macros.formTiddler.getter[target.type];
 if (getter) {
 var value = getter(target);
 DataTiddler.setData(tiddlerName, target.name, value);
 } else {
 config.macros.formTiddler.displayFormTiddlerError("No getter defined for INPUT element of type '"+target.type+"'. (Element '"+target.name+"' used in tiddler '"+tiddlerName+"')");
 }
}

// ensure that the function can be used in HTML event handler
window.onFormTiddlerChange = onFormTiddlerChange;


// -------------------------------------------------------------------------------
// Stylesheet Extensions (may be overridden by local StyleSheet)
// -------------------------------------------------------------------------------

setStylesheet(
 ".formTiddlerError{color: #ffffff;background-color: #880000;}",
 "formTiddler");


//============================================================================
// checkForDataTiddlerPlugin Macro
//============================================================================

config.macros.checkForDataTiddlerPlugin = {
 // Standard Properties
 label: "checkForDataTiddlerPlugin",
 version: {major: 1, minor: 0, revision: 0, date: new Date(2005, 12, 14)},
 prompt: "Check if the DataTiddlerPlugin exists"
}

config.macros.checkForDataTiddlerPlugin.handler = function(place,macroName,params) {
 config.macros.formTiddler.checkForExtensions(place, config.macros.formTiddler.label);
}



//============================================================================
// newTiddlerWithForm Macro
//============================================================================

config.macros.newTiddlerWithForm = {
 // Standard Properties
 label: "newTiddlerWithForm",
 version: {major: 1, minor: 0, revision: 1, date: new Date(2006, 1, 6)},
 prompt: "Creates a new Tiddler with a <<formTiddler ...>> macro"
}

config.macros.newTiddlerWithForm.handler = function(place,macroName,params) {
 // --- Parsing ------------------------------------------

 var i = 0; // index running over the params

 // get the name of the form template tiddler
 var formTemplateName = undefined;
 if (i < params.length) {
 formTemplateName = params[i];
 i++;
 }

 if (!formTemplateName) {
 config.macros.formTiddler.createErrorElement(place, "No form template specified in <<" + macroName + ">>.");
 return;
 }

 // get the button label
 var buttonLabel = undefined;
 if (i < params.length) {
 buttonLabel = params[i];
 i++;
 }

 if (!buttonLabel) {
 config.macros.formTiddler.createErrorElement(place, "No button label specified in <<" + macroName + ">>.");
 return;
 }

 // get the (optional) tiddlerName script and "askUser"
 var tiddlerNameScript = undefined;
 var askUser = false;
 if (i < params.length) {
 tiddlerNameScript = params[i];
 i++;

 if (i < params.length && params[i] == "askUser") {
 askUser = true;
 i++;
 }
 }

 // --- Processing ------------------------------------------

 if(!readOnly) {
 var onClick = function() {
 var tiddlerName;
 if (tiddlerNameScript) {
 try {
 tiddlerName = eval(tiddlerNameScript);
 } catch (ex) {
 }
 }
 if (!tiddlerName || askUser) {
 tiddlerName = prompt("Please specify a tiddler name.", askUser ? tiddlerName : "");
 }
 while (tiddlerName && store.getTiddler(tiddlerName)) {
 tiddlerName = prompt("A tiddler named '"+tiddlerName+"' already exists.\n\n"+"Please specify a tiddler name.", tiddlerName);
 }

 // tiddlerName is either null (user canceled) or a name that is not yet in the store.
 if (tiddlerName) {
 var body = "<<formTiddler [["+formTemplateName+"]]>>";
 var tags = [];
 store.saveTiddler(tiddlerName,tiddlerName,body,config.options.txtUserName,new Date(),tags);
 story.displayTiddler(null,tiddlerName,1);
 }
 }

 createTiddlyButton(place,buttonLabel,buttonLabel,onClick);
 }
}

//}}}


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

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

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

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

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

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

judge (judges), 
king (don't include foreign kings), 
sin (sins, sinned), 
evil, 
Spirit of God (of  the Lord), 
ark of God, 
and ephod
/***
|Name|FullScreenPlugin|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/#FullScreenPlugin|
|Version|1.1|
|Requires|~TW2.x|
!Description:
Toggle between viewing tiddlers fullscreen and normally. Very handy for when you need more viewing space.

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

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

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

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

config.commands.fullscreen =
{
            text:" ↕ ",
            tooltip:"Fullscreen mode"
};

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

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

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


Slider.prototype.lewcidStop = Slider.prototype.stop;
Slider.prototype.stop = function()
{
           this.lewcidStop();
           if (story.isEmpty() && lewcidFullScreen == true)
              config.commands.fullscreen.handler();
}
//}}}
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>>

See also MonkeyPirateTiddlyWiki.
1Sam 15:06 - this is similar to Mathew 24 ish (?) telling the Christians to get out of Jerusalem prior to the signs of its destruction (e.g. "flee to the mountains" "go down from your rooftop" "hopefully women won't be pregnant" etc...
/***
|Name|GotoPlugin|
|Source|http://www.TiddlyTools.com/#GotoPlugin|
|Version|1.4.1|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <<br>>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|view any tiddler by entering it's title - displays list of possible matches|

''View a tiddler by typing its title and pressing //enter//.''  Input just enough to uniquely match a single tiddler title and ''press //enter// to auto-complete the title for you!!''  If multiple titles match your input, a list is displayed.  You can scroll-and-click (or use arrows+enter) to select/view a tiddler, or press //escape// to close the listbox to resume typing.  When the listbox is ''//not//'' being displayed, press //escape// to clear the current text input and start over.

Note: ''At any time, you can move the focus directly to the text input field by using the ~ALT-G keyboard shortcut.''
!!!!!Examples
<<<
| //IMPORTANT NOTE:// ''As of version 1.4.0 (2007.04.25),<br>to avoid conflict with javascript reserved keywords<br>the {{{<<goto>>}}} macro has been renamed to {{{<<gotoTiddler>>}}}'' |
syntax: {{{<<gotoTiddler quiet insert inputstyle liststyle>>}}}
All parameters are optional.
* ''quiet'' prevents //automatic// display of the list as each character is typed.  To view the list when ''quiet'', use //down// or //enter//.
* ''insert'' causes the selected tiddler title to be inserted into the tiddler source currently being edited (use with EditTemplate)
* ''inputstyle'' and ''liststyle'' are CSS declarations that modify the default input and listbox styles.  Note: styles containing spaces must be surrounded by ({{{"..."}}} or {{{'...'}}}) or ({{{[[...]]}}}).
{{{<<gotoTiddler>>}}}
<<gotoTiddler>>
{{{<<gotoTiddler quiet>>}}}
<<gotoTiddler quiet>>
{{{<<goto width:20em width:20em>>}}}
<<gotoTiddler width:20em width:20em>>

You can also invoke the macro with the "insert" keyword.  When used in the [[EditTemplate]], like this:
{{{
<span macro="gotoTiddler insert"></span>
}}}
it allows you to type/select a tiddler title, and instantly insert a link to that title (e.g. {{{[[TiddlerName]]}}}) into the tiddler source being edited.
<<<
!!!!!Configuration
<<<
You can create a tiddler tagged with <<tag systemConfig>> to control the maximum height of the listbox of tiddlers/shadows/tags. //The default values are shown below://
//{{{
config.macros.gotoTiddler.listMaxSize=10;
//}}}
<<<
!!!!!Installation
<<<
import (or copy/paste) the following tiddlers into your document:
''GotoPlugin'' (tagged with <<tag systemConfig>>)
<<<
!!!!!Revisions
<<<
''2007.10.25 [1.4.1]'' performance enhancement to reduce processing overhead between keystrokes: re-wrote getItems() to cache list of tiddlers/shadows/tags and use simple case-folded text match instead of regular expression pattern to find matching tiddlers.
''2007.04.25 [1.4.0]'' renamed macro from "goto" to "gotoTiddler".  This was necessary to avoid a fatal syntax error in Opera (and other browsers) that require strict adherence to ECMAScript 1.5 standards which defines the identifier "goto" as "reserved for FUTURE USE"... *sigh*
''2007.04.21 [1.3.2]'' in html definition, removed DIV around droplist (see 1.2.6 below).  It created more layout problems then it solved. :-(
''2007.04.01 [1.3.1]'' in processItem(), ensure that correct textarea field is found by checking for edit=="text" attribute
''2007.03.30 [1.3.0]'' tweak SideBarOptions shadow to automatically add {{{<<goto>>}}} when using default sidebar content
''2007.03.30 [1.2.6]'' in html definition, added DIV around droplist to fix IE problem where list appears next to input field instead of below it.  
''2007.03.28 [1.2.5]'' in processItem(), set focus to text area before setting selection (needed for IE to get correct selection 'range')
''2007.03.28 [1.2.4]'' added prompt for 'pretty text' when inserting a link into tiddler content
''2007.03.28 [1.2.3]'' added local copy of core replaceSelection() and modified for different replace logic
''2007.03.27 [1.2.2]'' in processItem(), use story.getTiddlerField() to retrieve textarea control
''2007.03.26 [1.2.1]'' in html, use either 'onkeydown' (IE) or 'onkeypress' (Moz) event to process <esc> key sooner, to prevent <esc> from 'bubbling up' to the tiddler (which will close the current editor).
''2007.03.26 [1.2.0]'' added support for optional "insert" keyword param. When used in [[EditTemplate]], (e.g. {{{<span macro="goto insert"></span>}}}) it triggers alternative processing: instead of displaying the selected tiddler, that tiddler's title is inserted into a tiddler's textarea edit field surrounded by {{{[[...]]}}}.
''2006.05.10 [1.1.2]'' when filling listbox, set selection to 'heading' item... auto-select first tiddler title when down/enter moves focus into listbox
''2006.05.08 [1.1.1]'' added accesskey ("G") to input field html (also set when field gets focus).  Also, inputKeyHandler() skips non-printing/non-editing keys. 
''2006.05.08 [1.1.0]'' added heading to listbox for better feedback (also avoids problems with 1-line droplist)
''2006.05.07 [1.0.0]'' list matches against tiddlers/shadows/tags.  input field auto-completion... 1st enter=complete matching input (or show list)... 2nd enter=view tiddler.  optional "quiet" param controls when listbox appears.
''2006.05.06 [0.5.0]'' added handling for enter (13), escape(27), and down(40) keys.   Change 'ondblclick' to 'onclick' for list handler to view tiddlers (suggested by Florian Cauvin - prevents unintended trigger of tiddler editor).  shadow titles inserted into list instead of appended to the end.
''2006.05.05 [0.0.0]'' started
<<<
!!!!!Credits
>This feature was developed by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]]
!!!!!Code
***/
//{{{
version.extensions.gotoTiddler = {major: 1, minor: 4, revision: 1, date: new Date(2007,10,25)};

// automatically tweak shadow SideBarOptions to add "sendTiddler" toolbar command (following "editTiddler")
config.shadowTiddlers.SideBarOptions=config.shadowTiddlers.SideBarOptions.replace(/<<search>>/,"{{button{goto}}}\n<<gotoTiddler>><<search>>");

config.macros.gotoTiddler= { 
	handler:
	function(place,macroName,params) {
		var quiet=(params[0] && params[0]=="quiet"); if (quiet) params.shift();
		var insert=(params[0] && params[0]=="insert"); if (insert) params.shift();
		var instyle=params.shift(); if (!instyle) instyle="";
		var liststyle=params.shift(); if (!liststyle) liststyle="";
		var keyevent=window.event?"onkeydown":"onkeypress";
		createTiddlyElement(place,"span").innerHTML
			=this.html.replace(/%keyevent%/g,keyevent).replace(/%insert%/g,insert).replace(/%quiet%/g,quiet).replace(/%instyle%/g,instyle).replace(/%liststyle%/g,liststyle);
	},

	html:
	'<form onsubmit="return false" style="display:inline;margin:0;padding:0">\
		<input name=gotoTiddler type=text autocomplete="off" accesskey="G" style="%instyle%"\
			title="enter a tiddler title"\
			onfocus="this.select(); this.setAttribute(\'accesskey\',\'G\');"\
			%keyevent%="return config.macros.gotoTiddler.inputEscKeyHandler(event,this,this.form.list);"\
			onkeyup="return config.macros.gotoTiddler.inputKeyHandler(event,this,this.form.list,%quiet%,%insert%);">\
		<select name=list style="%liststyle%;display:none;position:absolute"\
			onchange="if (!this.selectedIndex) this.selectedIndex=1;"\
			onblur="this.style.display=\'none\';"\
			%keyevent%="return config.macros.gotoTiddler.selectKeyHandler(event,this,this.form.gotoTiddler,%insert%);"\
			onclick="return config.macros.gotoTiddler.processItem(this.value,this.form.gotoTiddler,this,%insert%);">\
		</select>\
	</form>',

	getItems:
	function(val) {
		if (!this.items.length || val.length<2) { // starting new search, refresh cached list of tiddlers/shadows/tags
			this.items=new Array();
			var tiddlers=store.getTiddlers("title","excludeLists");
			for(var t=0; t<tiddlers.length; t++) this.items.push(tiddlers[t].title);
			for (var t in config.shadowTiddlers) this.items.pushUnique(t);
			var tags=store.getTags();
			for(var t=0; t<tags.length; t++) this.items.pushUnique(tags[t][0]);
		}
		var found = [];
		var match=val.toLowerCase();
		for(var i=0; i<this.items.length; i++)
			if (this.items[i].toLowerCase().indexOf(match)!=-1) found.push(this.items[i]);
		return found;
	},
	items: [], // cached list of tiddlers/shadows/tags

	getItemSuffix:
	function(t) {
		if (store.tiddlerExists(t)) return "";  // tiddler
		if (store.isShadowTiddler(t)) return " (shadow)"; // shadow
		return " (tag)"; // tag 
	},

	keyProcessed:
	function(ev) { // utility function: exits handler and prevents browser from processing the keystroke
		ev.cancelBubble=true; // IE4+
		try{event.keyCode=0;}catch(e){}; // IE5
		if (window.event) ev.returnValue=false; // IE6
		if (ev.preventDefault) ev.preventDefault(); // moz/opera/konqueror
		if (ev.stopPropagation) ev.stopPropagation(); // all
		return false;
	},

	inputEscKeyHandler:
	function(event,here,list) {
		var key=event.keyCode;
		// escape... hide list (2nd esc=clears input)
		if (key==27) {
			if (list.style.display=="none")
				here.value=here.defaultValue;
			list.style.display="none";
			return this.keyProcessed(event);
		}
		return true; // key bubbles up
	},

	inputKeyHandler:
	function(event,here,list,quiet,insert) {
		var key=event.keyCode;
		// non-printing chars... bubble up, except: backspace=8, enter=13, space=32, down=40, delete=46
		if (key<48) switch(key) { case 8: case 13: case 32: case 40: case 46: break; default: return true; }
		// blank input... if down/enter... fall through (list all)... else, flush cache and hide list
		if (!here.value.length && !(key==40 || key==13))
			{ list.style.display="none"; return this.keyProcessed(event); }
		// find matching items...
		var found = this.getItems(here.value);
		// matched one item... enter... not *exact* match... autocomplete input field
		if (found.length==1 && quiet && key==13 && here.value!=found[0])
			{ list.style.display="none"; here.value=found[0]; return this.keyProcessed(event); }
		// no match/exact match... enter... create/show it
		if (found.length<2 && key==13)
			return this.processItem(found.length?found[0]:here.value,here,list,insert);
		// quiet/no match... hide list...
		list.style.display=(!quiet && found.length)?"block":"none";
		// no matches... key bubbles up
		if (!found.length) return true;
		// down/enter... show/move to list...
		if (key==40 || key==13)  { list.style.display="block"; list.focus(); }
		// list is showing... fill list...
		if (list.style.display!="none") {
			while (list.length > 0) list.options[0]=null; // clear list...
			found.sort();
			list.options[0]=new Option(found.length==1?this.listMatchMsg:this.listHeading.format([found.length]),"",false,false);
			for (var t=0; t<found.length; t++)  // fill list...
				list.options[t+1]=new Option(found[t]+this.getItemSuffix(found[t]),found[t],false,false);
			list.size=(found.length<this.listMaxSize?found.length:this.listMaxSize)+1; // resize list...
			list.selectedIndex=(key==40 || key==13)?1:0;
		}
		return true; // key bubbles up
	},
	listMaxSize: 10,
	listHeading: 'Found %0 matching titles:',
	listMatchMsg: 'Press enter to open tiddler...',

	selectKeyHandler:
	function(event,list,editfield,insert) {
		if (event.keyCode==27) // escape... hide list, move to edit field
			{ editfield.focus(); list.style.display="none"; return this.keyProcessed(event); }
		if (event.keyCode==13 && list.value.length) // enter... view selected item
			{ this.processItem(list.value,editfield,list,insert); return this.keyProcessed(event); }
		return true; // key bubbles up
	},

	askForText: "Enter the text to display for this link",

	processItem:
	function(title,here,list,insert) {
		if (!title.length) return; here.value=title; list.style.display='none';
		if (insert) {
			var tidElem=story.findContainingTiddler(here); if (!tidElem) { here.focus(); return false; }
			var e=story.getTiddlerField(tidElem.getAttribute("tiddler"),"text");
			if (!e||e.getAttribute("edit")!="text") return false;
			var txt=prompt(this.askForText,title); if (!txt||!txt.length) { here.focus(); return false; }
			e.focus(); // put focus on target field before setting selection
			this.replaceSelection(e,"[["+txt+"|"+title+"]]"); // insert selected tiddler as a PrettyLink
		}
		else
			story.displayTiddler(null,title); // show selected tiddler
		return false;
	},

	replaceSelection:
	function (e,text) { // copied from 2.1.3 core and then tweaked
		if (e.setSelectionRange) {
			var oldpos = e.selectionStart;
			var isRange=e.selectionEnd-e.selectionStart;
			e.value = e.value.substr(0,e.selectionStart) + text + e.value.substr(e.selectionEnd);
			e.setSelectionRange( isRange?oldpos:oldpos+text.length, oldpos+text.length);
			var linecount = e.value.split('\n').length;
			var thisline = e.value.substr(0,e.selectionStart).split('\n').length-1;
			e.scrollTop = Math.floor((thisline-e.rows/2)*e.scrollHeight/linecount);
		}
		else if (document.selection) {
			var range = document.selection.createRange();
			if (range.parentElement() == e)	{
				var isCollapsed = range.text == "";
				range.text = text;
				 if (!isCollapsed) {
					range.moveStart('character', -text.length);
					range.select();
				}
			}
		}
	}
}
//}}}
<!--{{{-->
<div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler deleteTiddler'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='editHtml text 600'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser'></span></div>
<!--}}}-->
/***
|Name|HTMLFormattingPlugin|
|Source|http://www.TiddlyTools.com/#HTMLFormattingPlugin|
|Version|2.1.5|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <<br>>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|'HTML' formatter|
|Description|embed wiki syntax formatting inside of HTML content|

The shorthand Wiki-style formatting syntax of ~TiddlyWiki is very convenient and enables most content to be reasonably well presented. However, there are times when tried-and-true HTML formatting syntax allows more more precise control of the content display.

When HTML formatting syntax is embedded within a tiddler (in between {{{<}}}{{{html>}}} and {{{<}}}{{{/html>}}} markers) TiddlyWiki passes this content to the browser for processing as 'native' HTML.  However, TiddlyWiki does not also process the HTML source content for any embedded wiki-formatting syntax it may contain.  This means that while you can use HTML formatted content, you cannot mix wiki-formatted content within the HTML formatting.
!!!!!Usage
<<<
The ~HTMLFormatting plugin allows you to freely ''mix wiki-style formatting syntax within HTML formatted content'' by extending the action of the standard TiddlyWiki formatting handler.

When a tiddler is about to be displayed, ~TiddlyWiki looks for tiddler content contained within ''<{{{html}}}>'' and ''<{{{/html}}}>'' HTML tags.  This content (if any) is passed directly to the browser's internal "rendering engine" to process as ~HTML-formatted content.  Once the HTML formatting has been processed, all the pieces of text occuring in between the HTML formatting are then processed by the ~TiddlyWiki rendering engine, one piece at a time, so that normal wiki-style formatting can be applied to the individual text pieces.
<<<
!!!!!Line breaks
<<<
One major difference between Wiki formatting and HTML formatting is how "line breaks" are processed. Wiki formatting treats all line breaks as literal content to be displayed //as-is//. However, because HTML normally ignores line breaks and actually processes them as simple "word separators" instead, many people who write HTML include extra line breaks in their documents, just to make the "source code" easier to read.

Even though you can use HTML tags within your tiddler content, the default treatment for line breaks still follows the Wiki-style rule (i.e., all new lines are displayed as-is). When adding HTML content to a tiddler (especially if you cut-and-paste it from another web page), you should take care to avoid adding extra line breaks to the text.

If removing all the extra line breaks from your HTML content would be a big hassle, you can quickly //override the default Wiki-style line break rule// so that the line breaks use the standard HTML rules instead.  Placing a ''<{{{hide linebreaks}}}>'' tag within the tiddler's HTML content changes all line breaks to spaces before rendering the content, so that the literal line breaks will be processed as simple word-breaks instead.

Note: this does //not// alter the actual tiddler content that is stored in the document, just the manner in which it is displayed. Any line breaks contained in the tiddler will still be there when you edit its content. Also, to include a literal line break when the ''<{{{hide linebreaks}}}>'' tag is present, you will need to use a ''<{{{br}}}>'' or ''<{{{p}}}>'' HTML tag instead of simply typing a line break.
<<<
!!!!!How it works
<<<
The TW core support for HTML does not let you put ANY wiki-style syntax (including TW macros) *inside* the {{{<html>...</html>}}} block.  Everything between {{{<html>}}} and {{{</html>}}} is handed to the browser for processing and that is it.  Fortunately, this plugin ADDS the ability to let you put wiki-syntax (including macros) inside the html.  It does this by first giving the tiddler source content to the browser to process the HTML, and then handling any wiki-based syntax that remains afterward.

However, not all wiki syntax can be safely passed through the browser's parser. Specifically, any TW macros inside the HTML will get 'eaten' by the browser since the macro brackets, {{{<<...>>}}} use the "<" and ">" that normally delimit the HTML/XML syntax recognized by the browser's parser.

Similarly, you can't use InlineJavascript within the HTML because the {{{<script>...</script>}}} syntax will also be consumed by the browser and there will be nothing left to process afterward.  Note: unfortunately, even though the browser removes the {{{<script>...</script>}}} sequence, it doesn't actually execute the embedded javascript code that it removes, so any scripts contained inside of <html> blocks in TW are currently being ignored. :-(

As a work-around to allow TW *macros* (but not inline scripts) to exist inside of <html> formatted blocks of content, the plugin first converts the {{{<<}}} and {{{>>}}} into "%%(" and ")%%", making them "indigestible" so they can pass unchanged through the belly of the beast (the browser's HTML parser).

After the browser has done its job, the wiki syntax sequences (including the "undigested" macros) are contained in #text nodes in the browser-generated DOM elements.  The plugin then recursively locates and processes each #text node, converts the %%( and )%% back into {{{<<}}} and {{{>>}}}, passes the result to wikify() for further rendering of the wiki-formatted syntax into a containing SPAN that replaces the previous #text node.  At the end of this process, none of the encoded %%( and )%% sequences remain in the rendered tiddler output.
<<<
!!!!!Installation
<<<
import (or copy/paste) the following tiddlers into your document:
''HTMLFormattingPlugin'' (tagged with <<tag systemConfig>>)
^^documentation and javascript for HTMLFormatting handling^^
<<<
!!!!!Revision History
<<<
''2007.06.14 [2.1.5]'' in formatter, removed call to e.normalize().  Creates an INFINITE RECURSION error in Safari!!!!
''2006.09.10 [2.1.4]'' update formatter for 2.1 compatibility (use this.lookaheadRegExp instead of temp variable)
''2006.05.28 [2.1.3]'' in wikifyTextNodes(), decode the *value* of TEXTAREA nodes, but don't wikify() its children.  (thanks to "ayj" for bug report)
''2006.02.19 [2.1.2]'' in wikifyTextNodes(), put SPAN element into tiddler DOM (replacing text node), BEFORE wikifying the text content.  This ensures that the 'place' passed to any macros is correctly defined when the macro is evaluated, so that calls to story.findContainingTiddler(place) will work as expected. (Thanks for bug report from GeoffSlocock)
''2006.02.05 [2.1.1]'' wrapped wikifier hijack in init function to eliminate globals and avoid FireFox 1.5.0.1 crash bug when referencing globals
''2005.12.01 [2.1.0]'' don't wikify #TEXT nodes inside SELECT and TEXTAREA elements
''2005.11.06 [2.0.1]'' code cleanup
''2005.10.31 [2.0.0]'' replaced hijack wikify() with hijack config.formatters["html"] and simplified recursive WikifyTextNodes() code
''2005.10.09 [1.0.2]'' combined documentation and code into a single tiddler
''2005.08.05 [1.0.1]'' moved HTML and CSS definitions into plugin code instead of using separate tiddlers
''2005.07.26 [1.0.1]'' Re-released as a plugin. Added <{{{html}}}>...</{{{nohtml}}}> and <{{{hide newlines}}}> handling
''2005.07.20 [1.0.0]'' Initial Release (as code adaptation)
<<<
!!!!!Credits
<<<
This feature was developed by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]]
<<<
!!!!!Code
***/
//{{{
version.extensions.HTMLFormatting = {major: 2, minor: 1, revision: 5, date: new Date(2007,6,14)};

// find the formatter for HTML and replace the handler
initHTMLFormatter();
function initHTMLFormatter()
{
	for (var i=0; i<config.formatters.length && config.formatters[i].name!="html"; i++);
	if (i<config.formatters.length)	config.formatters[i].handler=function(w) {
		if (!this.lookaheadRegExp)  // fixup for TW2.0.x
			this.lookaheadRegExp = new RegExp(this.lookahead,"mg");
		this.lookaheadRegExp.lastIndex = w.matchStart;
		var lookaheadMatch = this.lookaheadRegExp.exec(w.source)
		if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
			var html=lookaheadMatch[1];
			// optionally suppress wiki-style literal handling of newlines
			// strip any carriage returns added by Internet Explorer's textarea edit field
			// encode newlines as \n so Internet Explorer's HTML parser won't eat them
			// encode macro brackets (<< and >>) so HTML parser won't eat them
			if (html.indexOf('<hide linebreaks>')!=-1) html=html.replace(regexpNewLine,' ');
			html=html.replace(regexpCarriageReturn,'');
			html=html.replace(regexpNewLine,'\\n');
			html=html.replace(/<</g,'%%(').replace(/>>/g,')%%');
			// create span to hold HTML
			// parse HTML and normalize the results
			// walk node tree and call wikify() on each text node
			var e = createTiddlyElement(w.output,"span");
			e.innerHTML=html;
			// REMOVED: e.normalize();  // THIS CAUSED INFINITE RECURSION IN SAFARI
			wikifyTextNodes(e);
			// advance to next parse position
			w.nextMatch = this.lookaheadRegExp.lastIndex;
		}
	}
}

// wikify text nodes remaining after HTML content is processed (pre-order recursion)
function wikifyTextNodes(theNode)
{
	// textarea node doesn't get wikified, just decoded... 
	if (theNode.nodeName.toLowerCase()=='textarea')
		theNode.value=theNode.value.replace(/\%%\(/g,'<<').replace(/\)\%%/g,'>>').replace(regexpBackSlashEn,'\n');
	else for (var i=0;i<theNode.childNodes.length;i++) {
		var theChild=theNode.childNodes.item(i);
		if (theChild.nodeName.toLowerCase()=='option') continue;
		if (theChild.nodeName.toLowerCase()=='select') continue;
		wikifyTextNodes(theChild);
		if (theChild.nodeName=='#text') {
			var txt=theChild.nodeValue;
			// decode macro brackets and newlines
			txt=txt.replace(/\%%\(/g,'<<').replace(/\)\%%/g,'>>').replace(regexpBackSlashEn,'\n');
			// replace text node with wikified() span
			var newNode=createTiddlyElement(null,"span");
			theNode.replaceChild(newNode,theChild);
			wikify(txt,newNode);
		}
	}
}
//}}}
Essentially, hermeneutics involves cultivating the ability to understand things from somebody else's point of view, and to appreciate the cultural and social forces that may have influenced their outlook. Hermeneutics is the process of applying this understanding to interpreting the meaning of written texts and symbolic artifacts (such as art or sculpture or architecture), which may be either historic or contemporary.
/***
| Name|HideWhenPlugin|
| Description|Allows conditional inclusion/exclusion in templates|
| Version|3.0 ($Rev: 1845 $)|
| Date|$Date: 2007-03-16 15:19:22 +1000 (Fri, 16 Mar 2007) $|
| Source|http://mptw.tiddlyspot.com/#HideWhenPlugin|
| Author|Simon Baird <simon.baird@gmail.com>|
| License|http://mptw.tiddlyspot.com/#TheBSDLicense|
For use in ViewTemplate and EditTemplate. Example usage:
{{{<div macro="showWhenTagged Task">[[TaskToolbar]]</div>}}}
{{{<div macro="showWhen tiddler.modifier == 'BartSimpson'"><img src="bart.gif"/></div>}}}
***/
//{{{

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

merge(config.macros,{

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

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

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

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

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

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

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

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

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

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

});

//}}}

!taken from http://catholic-resources.org/Bible/History-Israelite&Jewish.htm#Israelite

I) HEBREW / ISRAELITE PERIOD (Second Millennium to ca. 539 BCE):

ca. 3000 - ca. 1000 BCE - EGYPTIAN ERA - the Egyptians are overlords of the Levant, a.k.a. land of Canaan, later Israel and/or Palestine:

    ca. 1800-1700 - Foundations of the People of Israel under the Patriarchs/Ancestors - God promises to give the Holy Land to the descendants of Abraham (see Genesis 12-50); the first four generations of patriarchs & matriarchs include the following main characters (see my chart of Abraham's family):
         1) ABRAHAM & Sarah (also her handmaid Hagar)
         2) Isaac & Rebekah (also Isaac's elder half-brother Ishmael, son of Hagar)
         3) Jacob = Israel (with two wives, Leah & Rachel, and two handmaids, Zilpah & Bilhah)
         4) Twelve Sons of Jacob = Twelve Tribes of Israel (Judah becomes the "Royal Tribe"; Levi the "Priestly Tribe"; Joseph; etc.)

    ca. 1700-1300 - Israelites (a.k.a. Hebrews) in Egypt (since the time of Joseph, the "dreamer"); they were welcome at first, but later endure worsening conditions and slavery (see Genesis 46-50; Exodus 1-2)

    ca. 1250 - MOSES and the Exodus - Plagues; Passover; Exodus from Egypt (possibly during reign of Pharoah Rameses II, 1279-1213); Torah/Covenant on Mount Sinai; Wandering in the Desert for 40 years (see Exodus; Leviticus; Numbers; Deuteronomy)

    ca. 1200-1030 - Joshua and the Judges - the conquest of Promised Land led by Joshua; loose confederation of the tribes of Israel (see Joshua, Judges, Ruth; see HCSB map 3); military/political leaders called "Judges," incl. Othniel, Ehud, Shagmar, Deborah, Gideon, Abimelech, Tola, Yair, Jepthah, Ibzan, Elon, Abdon, and Samson; rulers at end: Eli (priest) and Samuel (prophet).

ca. 1030-930 BCE - UNITED KINGDOM OF ISRAEL - the "Golden Age" of the Israelite Monarchy, as Egypt's power declines and before Assyria's empire rises

    ca. 1030 - twelve tribes of Israel united more closely under a monarchy; first ruler is King Saul; continual war with Philistines (see 1 Samuel; also HCSB map 4)

    ca. 1000 - conquest of the Jebusite city of Jerusalem by the army of King DAVID; Jerusalem becomes the capital of all Israel; David consolidates his rule and expands the kingdom; God promises that the House of David (his descendants) will rule over Israel forever (see 1 & 2 Samuel)

    ca. 970 - Building of the first Temple of Jerusalem by King Solomon (i.e. Solomon's Temple); centralization of Jewish worship in Jerusalem; further expansion of land and influence (see 1 Kings 1-11)

    ca. 930 - death of Solomon; struggles for the throne succession for several years; the kingdom soon divides into two parts:

922-587 BCE - DIVIDED MONARCHIES: ISRAEL & JUDAH  (see 1 & 2 Kings; 1 & 2 Chronicles; also HCSB maps 5-9), during the rise of the ASSYRIAN empire (9th-7th cent.) and later of the BABYLONIAN empire (6th cent.)

    922-721 - Northern Kingdom, called "Kingdom of Israel"; ruled by several series of corrupt kings; much political intrigue and challenges by prophets, e.g. Elijah & Elisha (see a list of all Kings of Israel - offsite)

        721 - fall of the Northern Kingdom and its capital city Samaria to the ASSYRIANS; deportation of most Israelites to places unknown; importation of foreigners into the territories of Northern Israel

    922-587 - Southern Kingdom, called "Kingdom of Judah";  ruled continuously by descendants of David: some bad, some good; some early books of the HB written during these centuries, esp. some prophetic books and royal historical annals (see a list of Kings of Judah - offsite)

        720's - religious reforms of King Hezekiah; building of Hezekiah's tunnel; successful resistance against Assyrian takeover
        620's - religious reforms of King Josiah; writing or "discovery" of book of Deuteronomy

        605 - Battle of Carchemish: BABYLONIANS (under King Nebuchadnezzar) defeat the Egyptians; territory of Judah becomes part of the Babylonian Empire
        597 - first unsuccessful revolt of Judah (under King Jehoiakim) against Babylon; ruling elite of Judah exiled to Babylon; puppet king installed
        587 - another unsuccessful revolt of Judah (under King Zedekiah) against Babylon; ends in Total Destruction of the City and Temple of Jerusalem by BABYLONIANS under King Nebuchadnezzar; many more people exiled

587-539 BCE - BABYLONIAN EXILE - most upper-class Jews (officials, priests, artisans) deported to Babylon; others flee to Egypt, etc.; much of the HB written, esp. major prophets; final compilation of the Torah (Genesis to Deuteronomy) & the Deuteronomistic History (Joshua to 2 Kings) by Judean scribes living in exile.

II) SECOND TEMPLE PERIOD (539 BCE - 70 CE):

539-332 BCE - PERSIAN ERA - some (not all!) exiled Jews return to Judea & Galilee; limited local autonomy under Persian overlords (see detailed chart)

    539 - after the Babylonian empire is conquered by the PERSIANS, King Cyrus allows all deported peoples to return to their homelands; in particular, the Jews are encouraged to rebuild the city and temple of Jerusalem

    ca. 520-515 - rebuilding of the Second Temple in Jerusalem under Zerubbabel; but not as nice or large as Solomon's Temple!
    ca. 458/445 - more exiles return to Jerusalem under the leadership of Ezra & Nehemiah; religious and political reforms (see Ezra & Nehemiah)
    other Jews remain living in various parts of the Middle East, sometimes encountering conflict with others (see e.g. Esther)

332-141 BCE - HELLENISTIC/GREEK ERA - conquest of the entire Persian Empire by a Macedonian general, Alexander the Great (HCSB map 10-11); establishment of Greek language, Hellenistic culture, religion, and government throughout the East; founding and/or reconstruction of many new Greek-style cities (e.g. anything named Alexandria, Antioch)

    323 - Alexander dies while still very young; entire empire divided among four of his generals, who fight each other for control in the "Wars of the Diadochi"; eventually two dynasties control most of the East: the Ptolemies & the Seleucids (see detailed chart)

    323-198 - Ptolemaic dynasty rulers in Egypt control Palestine (Judea, Samaria, etc.) - few historical records;

        ca. 250 - Hebrew scriptures translated into Greek in Alexandria, Egypt; new writings added (LXX; the Septuagint Bible)

    198-141 - Seleucid dynasty from Syria rules over Palestine; growing pressure on Jews to assimilate & accept Greek culture

        167 - desecration of Jerusalem Temple by Antiochus IV Epiphanes, i.e. statues of Greek gods put there, sparking a revolt by pious rural Jews led by Mattathias (an old priest) and carried on after his death by his sons, especially Judas "Maccabeus" (167-61) - eldest son, nicknamed "the hammer"
        164 - Maccabean revolt successful: most of Jerusalem retaken; "rededication" of the Jerusalem Temple (still celebrated by Jews in the Feast of Hanukkah!)
        161-142 - Jonathan (another son of Mattathias), led the continued fight against the Seleucids to gain control gradually over more of Israel

141-63 BCE - MACCABEAN ERA / Hasmonean Dynasty - another short period of Jewish independence under various Maccabean/Hasmonean rulers (see detailed chart);  Monastery of Qumran founded by Essenes; Pharisees and Sadducees become prominent; Samaria & Idumea conquered by Jews

    141-134 - Simon (last surviving son of Mattathias) gains total independence for Israel; given titles "Ethnarch" (ruler of the people) and "High Priest"; since he was not of the "Zadokite" line of high priests, some Jews ("the Essenes") dispute his high priestly authority, form a separatist movement with a monastery at Qumran, where many "Dead Sea Scrolls" were found in 1948.

    134-67 - the Hasmonean Dynasty continues ruling Israel for several more generations:

        - John Hyrcanus I (134-104) - expands Israel; conquers Samaritans & Idumeans, destroys city/temple of Samaria; "Pharisees" & "Sadducees" first appear as rival Jewish groups, with different interpretations of Jewish Laws
        - Aristobulus I (104-103) - cruel leader; imprisons and/or kills his mother and several brothers; soon dies of illness
        - Alexander Jannaeus (103-76) - surviving brother, who marries Aristobulus' widow Alexandra
        - Alexandra (76-67) - rules as queen after her second husband dies; appoints her son Hyrcanus II as high priest

    67-63 - Alexandra's sons Hyrcanus II and Aristobulus II vie for power; each appeals for Roman help to become sole ruler

63 BCE to ca. 650 CE - ROMAN ERA of domination in Israel/Palestine (see chart of Rulers in Israel in the Roman Era)

    63 BCE - Roman army under General Pompey takes over much of Middle East, incl. Israel (see HCSB, maps 12-13)

        - Hyrcanus II (63-40) - member of the Hasmonean family; remains as high priest, but not as king
        - Antipater (from Idumea) and sons Herod & Phasael - very influential politically & militarily, with Roman support

    40-4 BCE - HEROD the Great; Roman Senate names him "King" over Judea, Idumea, Perea, Samaria, Galilee

        40-37 - Herod fights to gain sole control over Israel; defeats & executes Antigonus II (who was high priest 40-37)

        37-7 - Herod consolidates his power, executes scores of enemies, and begins massive building/rebuilding projects, including cites with Roman temples (esp. Caesarea Maritimae - huge artificial harbor; Sebaste - formerly Samaria), fortresses (Masada, Herodium, Hyrcania, Machaerus, etc.), and esp. rebuilds/expands the Jerusalem Temple 

        7-4 - near the end of his reign, Herod is paranoid about losing power, so has several sons and wives executed! 

    4 BCE - 66 CE - when Herod the Great dies, his kingdom is divided between three surviving sons & one sister (see chart of Herodian Dynasty):

        4 BCE - 6 CE - Herod Archelaus rules as "Ethnarch" of Judea, Idumea, Samaria

            6-66 CE - Judea, Idumea, Samaria under direct rule of Roman Procurators (e.g. Pontius Pilate), responsible to the Governors in Syria; various political/resistance movements form (Zealots, Sicarii, etc.), with some small-scale revolts

        4 BCE - 33 CE - Herod Philip rules as "Tetrarch" of regions North-East of the Sea of Galilee

        4 BCE - 39 CE - Herod Antipas rules as "Tetrarch" of Galilee and Perea

            ca. 27-30 CE - preaching of John the Baptist and public ministry of Jesus, both mostly in Galilee and Perea
            ca. 29/30 CE - arrest, crucifixion & death of Jesus, while Pontius Pilate (26-36 CE) is Procurator of Judea

        37-44 CE - Herod Agrippa I (a grandson of Herod the Great) allowed by Romans to rule more of Palestine

        50-70's - Herod Agrippa II rules parts of Palestine, esp. in Northeast

            49-54 - "all Jews" (or only Jewish Christians?) expelled from Rome by "Edict of Claudius" (until his death)

    66-74 CE - FIRST JEWISH REVOLT / WAR against ROME; begins in Galilee and Jerusalem (recorded in Josephus' Jewish War)

        67-68 - Roman armies under General Vespasian retake Galilee, Samaria, Perea, and most of Judea; also destroy Qumran
        68-70 - pause in war because Emperor Nero dies; 3 transitional emperors; then Vespasian himself becomes emperor
        70 - Jerusalem captured by General Titus; whole city burned; destruction of the Second Temple by the ROMAN army
        73/74 - Roman conquest of last Jewish holdouts in the desert fortress of Masada, overlooking the Dead Sea
/***
|Name|HoverMenuPlugin|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/#HoverMenuPlugin|
|Version|1.11|
|Requires|~TW2.x|
!Description:
Provides a hovering menu on the edge of the screen for commonly used commands, that scrolls with the page.

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

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

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

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

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

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

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

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

!Code
***/

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

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

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

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

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

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


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

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

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

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

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

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

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

     return false;
}

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

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

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

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

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

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

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

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

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

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


click the down arrow
/***
|Name|InlineJavascriptPlugin|
|Source|http://www.TiddlyTools.com/#InlineJavascriptPlugin|
|Version|1.6.2|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|Insert Javascript executable code directly into your tiddler content.|

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

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

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

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

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

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

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

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

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

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

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

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

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

	handler: function(w) {
		var lookaheadRegExp = new RegExp(this.lookahead,"mg");
		lookaheadRegExp.lastIndex = w.matchStart;
		var lookaheadMatch = lookaheadRegExp.exec(w.source)
		if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
			if (lookaheadMatch[1]) { // load a script library
				// make script tag, set src, add to body to execute, then remove for cleanup
				var script = document.createElement("script"); script.src = lookaheadMatch[1];
				document.body.appendChild(script); document.body.removeChild(script);
			}
			if (lookaheadMatch[5]) { // there is script code
				if (lookaheadMatch[4]) // show inline script code in tiddler output
					wikify("{{{\n"+lookaheadMatch[0]+"\n}}}\n",w.output);
				if (lookaheadMatch[2]) { // create a link to an 'onclick' script
					// add a link, define click handler, save code in link (pass 'place'), set link attributes
					var link=createTiddlyElement(w.output,"a",null,"tiddlyLinkExisting",wikifyPlainText(lookaheadMatch[2]));
					link.onclick=function(){try{return(eval(this.code))}catch(e){alert(e.description?e.description:e.toString())}}
					link.code="function _out(place){"+lookaheadMatch[5].replace(/document.write\s*\(/gi,'place.innerHTML+=(')+"\n};_out(this);"
					link.setAttribute("title",lookaheadMatch[3]?lookaheadMatch[3]:"");
					link.setAttribute("href","javascript:;");
					link.style.cursor="pointer";
				}
				else { // run inline script code
					var code="function _out(place){"+lookaheadMatch[5].replace(/document.write\s*\(/gi,'place.innerHTML+=(')+"\n};_out(w.output);"
					try { var out = eval(code); } catch(e) { out = e.description?e.description:e.toString(); }
					if (out && out.length) wikify(out,w.output,w.highlightRegExp,w.tiddler);
				}
			}
			w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
		}
	}
} )
//}}}
/***
|''Name:''|~IntelliTaggerPlugin|
|''Version:''|1.0.0 (2006-04-26)|
|''Type:''|plugin|
|''Source:''|http://tiddlywiki.abego-software.de/#IntelliTaggerPlugin|
|''Author:''|Udo Borkowski (ub [at] abego-software [dot] de)|
|''Documentation:''|[[IntelliTaggerPlugin Documentation]]|
|''Source Code:''|[[IntelliTaggerPlugin SourceCode]]|
|''Licence:''|[[BSD open source license (abego Software)]]|
|''~TiddlyWiki:''|Version 2.0.8 or better|
|''Browser:''|Firefox 1.5.0.2 or better|

***/
// /%
if(!version.extensions.IntelliTaggerPlugin){if(!window.abego){window.abego={};}if(!abego.internal){abego.internal={};}abego.alertAndThrow=function(s){alert(s);throw s;};if(version.major<2){abego.alertAndThrow("Use TiddlyWiki 2.0.8 or better to run the IntelliTagger Plugin.");}version.extensions.IntelliTaggerPlugin={major:1,minor:0,revision:0,date:new Date(2006,3,26),type:"plugin",source:"http://tiddlywiki.abego-software.de/#IntelliTaggerPlugin",documentation:"[[IntelliTaggerPlugin Documentation]]",sourcecode:"[[IntelliTaggerPlugin SourceCode]]",author:"Udo Borkowski (ub [at] abego-software [dot] de)",licence:"[[BSD open source license (abego Software)]]",tiddlywiki:"Version 2.0.8 or better",browser:"Firefox 1.5.0.2 or better"};abego.isPopupOpen=function(_2){return _2&&_2.parentNode==document.body;};abego.openAsPopup=function(_3){if(_3.parentNode!=document.body){document.body.appendChild(_3);}};abego.closePopup=function(_4){if(abego.isPopupOpen(_4)){document.body.removeChild(_4);}};abego.getWindowRect=function(){return {left:findScrollX(),top:findScrollY(),height:findWindowHeight(),width:findWindowWidth()};};abego.moveElement=function(_5,_6,_7){_5.style.left=_6+"px";_5.style.top=_7+"px";};abego.centerOnWindow=function(_8){if(_8.style.position!="absolute"){throw "abego.centerOnWindow: element must have absolute position";}var _9=abego.getWindowRect();abego.moveElement(_8,_9.left+(_9.width-_8.offsetWidth)/2,_9.top+(_9.height-_8.offsetHeight)/2);};abego.isDescendantOrSelf=function(_a,e){while(e){if(_a==e){return true;}e=e.parentNode;}return false;};abego.toSet=function(_c){var _d={};for(var i=0;i<_c.length;i++){_d[_c[i]]=true;}return _d;};abego.filterStrings=function(_f,_10,_11){var _12=[];for(var i=0;i<_f.length&&(_11===undefined||_12.length<_11);i++){var s=_f[i];if(s.match(_10)){_12.push(s);}}return _12;};abego.arraysAreEqual=function(a,b){var n=a.length;if(n!=b.length){return false;}for(var i=0;i<n;i++){if(a[i]!=b[i]){return false;}}return true;};abego.moveBelowAndClip=function(_19,_1a){if(!_1a){return;}var _1b=findPosX(_1a);var _1c=findPosY(_1a);var _1d=_1a.offsetHeight;var _1e=_1b;var _1f=_1c+_1d;var _20=findWindowWidth();if(_20<_19.offsetWidth){_19.style.width=(_20-100)+"px";}var _21=_19.offsetWidth;if(_1e+_21>_20){_1e=_20-_21-30;}if(_1e<0){_1e=0;}_19.style.left=_1e+"px";_19.style.top=_1f+"px";_19.style.display="block";};abego.compareStrings=function(a,b){return (a==b)?0:(a<b)?-1:1;};abego.sortIgnoreCase=function(arr){var _25=[];var n=arr.length;for(var i=0;i<n;i++){var s=arr[i];_25.push([s.toString().toLowerCase(),s]);}_25.sort(function(a,b){return (a[0]==b[0])?0:(a[0]<b[0])?-1:1;});for(i=0;i<n;i++){arr[i]=_25[i][1];}};abego.getTiddlerField=function(_2b,_2c,_2d){var _2e=document.getElementById(_2b.idPrefix+_2c);var e=null;if(_2e!=null){var _30=_2e.getElementsByTagName("*");for(var t=0;t<_30.length;t++){var c=_30[t];if(c.tagName.toLowerCase()=="input"||c.tagName.toLowerCase()=="textarea"){if(!e){e=c;}if(c.getAttribute("edit")==_2d){e=c;}}}}return e;};abego.setRange=function(_33,_34,end){if(_33.setSelectionRange){_33.setSelectionRange(_34,end);var max=0+_33.scrollHeight;var len=_33.textLength;var top=max*_34/len,bot=max*end/len;_33.scrollTop=Math.min(top,(bot+top-_33.clientHeight)/2);}else{if(_33.createTextRange!=undefined){var _39=_33.createTextRange();_39.collapse();_39.moveEnd("character",end);_39.moveStart("character",_34);_39.select();}else{_33.select();}}};abego.internal.TagManager=function(){var _3a=null;var _3b=function(){if(_3a){return;}_3a={};store.forEachTiddler(function(_3c,_3d){for(var i=0;i<_3d.tags.length;i++){var tag=_3d.tags[i];var _40=_3a[tag];if(!_40){_40=_3a[tag]={count:0,tiddlers:{}};}_40.tiddlers[_3d.title]=true;_40.count+=1;}});};var _41=TiddlyWiki.prototype.saveTiddler;TiddlyWiki.prototype.saveTiddler=function(_42,_43,_44,_45,_46,_47){var _48=this.fetchTiddler(_42);var _49=_48?_48.tags:[];var _4a=(typeof _47=="string")?_47.readBracketedList():_47;_41.apply(this,arguments);if(!abego.arraysAreEqual(_49,_4a)){abego.internal.getTagManager().reset();}};var _4b=TiddlyWiki.prototype.removeTiddler;TiddlyWiki.prototype.removeTiddler=function(_4c){var _4d=this.fetchTiddler(_4c);var _4e=_4d&&_4d.tags.length>0;_4b.apply(this,arguments);if(_4e){abego.internal.getTagManager().reset();}};this.reset=function(){_3a=null;};this.getTiddlersWithTag=function(tag){_3b();var _50=_3a[tag];return _50?_50.tiddlers:null;};this.getAllTags=function(_51){_3b();var _52=[];for(var i in _3a){_52.push(i);}for(i=0;_51&&i<_51.length;i++){_52.pushUnique(_51[i],true);}abego.sortIgnoreCase(_52);return _52;};this.getTagInfos=function(){_3b();var _54=[];for(var _55 in _3a){_54.push([_55,_3a[_55]]);}return _54;};var _56=function(a,b){var a1=a[1];var b1=b[1];var d=b[1].count-a[1].count;return d!=0?d:abego.compareStrings(a[0].toLowerCase(),b[0].toLowerCase());};this.getSortedTagInfos=function(){_3b();var _5c=this.getTagInfos();_5c.sort(_56);return _5c;};this.getPartnerRankedTags=function(_5d){var _5e={};for(var i=0;i<_5d.length;i++){var _60=this.getTiddlersWithTag(_5d[i]);for(var _61 in _60){var _62=store.getTiddler(_61);if(!(_62 instanceof Tiddler)){continue;}for(var j=0;j<_62.tags.length;j++){var tag=_62.tags[j];var c=_5e[tag];_5e[tag]=c?c+1:1;}}}var _66=abego.toSet(_5d);var _67=[];for(var n in _5e){if(!_66[n]){_67.push(n);}}_67.sort(function(a,b){var d=_5e[b]-_5e[a];return d!=0?d:abego.compareStrings(a.toLowerCase(),b.toLowerCase());});return _67;};};abego.internal.getTagManager=function(){if(!abego.internal.gTagManager){abego.internal.gTagManager=new abego.internal.TagManager();}return abego.internal.gTagManager;};(function(){var _6c=2;var _6d=1;var _6e=30;var _6f;var _70;var _71;var _72;var _73;var _74;if(!abego.IntelliTagger){abego.IntelliTagger={};}var _75=function(){return _70;};var _76=function(tag){return _73[tag];};var _78=function(s){var i=s.lastIndexOf(" ");return (i>=0)?s.substr(0,i):"";};var _7b=function(_7c){var s=_7c.value;var len=s.length;return (len>0&&s[len-1]!=" ");};var _7f=function(_80){var s=_80.value;var len=s.length;if(len>0&&s[len-1]!=" "){_80.value+=" ";}};var _83=function(tag,_85,_86){if(_7b(_85)){_85.value=_78(_85.value);}story.setTiddlerTag(_86.title,tag,0);_7f(_85);abego.IntelliTagger.assistTagging(_85,_86);};var _87=function(n){if(_74){if(_74.length>n){return _74[n];}n-=_74.length;}return (_72&&_72.length>n)?_72[n]:null;};var _89=function(n,_8b,_8c){var _8d=_87(n);if(_8d){_83(_8d,_8b,_8c);}};var _8e=function(_8f){var pos=_8f.value.lastIndexOf(" ");var _91=(pos>=0)?_8f.value.substr(++pos,_8f.value.length):_8f.value;return new RegExp(_91.escapeRegExp(),"i");};var _92=function(_93,_94){var _95=0;for(var i=0;i<_93.length;i++){if(_94[_93[i]]){_95++;}}return _95;};var _97=function(_98,_99,_9a){var _9b=1;var c=_98[_99];for(var i=_99+1;i<_98.length;i++){if(_98[i][1].count==c){if(_98[i][0].match(_9a)){_9b++;}}else{break;}}return _9b;};var _9e=function(_9f,_a0){var _a1=abego.internal.getTagManager().getSortedTagInfos();var _a2=[];var _a3=0;for(var i=0;i<_a1.length;i++){var c=_a1[i][1].count;if(c!=_a3){if(_a0&&(_a2.length+_97(_a1,i,_9f)>_a0)){break;}_a3=c;}if(c==1){break;}var s=_a1[i][0];if(s.match(_9f)){_a2.push(s);}}return _a2;};var _a7=function(_a8,_a9){return abego.filterStrings(abego.internal.getTagManager().getAllTags(_a9),_a8);};var _aa=function(){if(!_6f){return;}var _ab=store.getTiddlerText("IntelliTaggerMainTemplate");if(!_ab){_ab="<b>Tiddler IntelliTaggerMainTemplate not found</b>";}_6f.innerHTML=_ab;applyHtmlMacros(_6f,null);refreshElements(_6f,null);};var _ac=function(e){if(!e){var e=window.event;}var tag=this.getAttribute("tag");if(_71){_71.call(this,tag,e);}return false;};var _af=function(_b0,_b1,_b2,_b3){if(!_b1){return;}var _b4=_b3?abego.toSet(_b3):{};var n=_b1.length;for(var i=0;i<n;i++){var tag=_b1[i];if(_b4[tag]){continue;}if(i>0){createTiddlyElement(_b0,"span",null,"tagSeparator"," | ");}var _b8="";var _b9=_b0;if(_b2<10){_b9=createTiddlyElement(_b0,"span",null,"numberedSuggestion");_b2++;var key=_b2<10?""+(_b2):"0";createTiddlyElement(_b9,"span",null,"suggestionNumber",key+") ");var _bb=_b2==1?"Ctrl-Space or ":"";_b8=" (Shortcut: %1Alt-%0)".format([key,_bb]);}var _bc=config.views.wikified.tag.tooltip.format([tag]);var _bd=(_76(tag)?"Remove tag '%0'%1":"Add tag '%0'%1").format([tag,_b8]);var _be="%0; Shift-Click: %1".format([_bd,_bc]);var btn=createTiddlyButton(_b9,tag,_be,_ac,_76(tag)?"currentTag":null);btn.setAttribute("tag",tag);}};var _c0=function(){if(_6f){window.scrollTo(0,ensureVisible(_6f));}if(_75()){window.scrollTo(0,ensureVisible(_75()));}};var _c1=function(e){if(!e){var e=window.event;}if(!_6f){return;}var _c3=resolveTarget(e);if(_c3==_75()){return;}if(abego.isDescendantOrSelf(_6f,_c3)){return;}abego.IntelliTagger.close();};addEvent(document,"click",_c1);var _c4=Story.prototype.gatherSaveFields;Story.prototype.gatherSaveFields=function(e,_c6){_c4.apply(this,arguments);var _c7=_c6.tags;if(_c7){_c6.tags=_c7.trim();}};var _c8=function(_c9){story.focusTiddler(_c9,"tags");var _ca=abego.getTiddlerField(story,_c9,"tags");if(_ca){var len=_ca.value.length;abego.setRange(_ca,len,len);window.scrollTo(0,ensureVisible(_ca));}};var _cc=config.macros.edit.handler;config.macros.edit.handler=function(_cd,_ce,_cf,_d0,_d1,_d2){_cc.apply(this,arguments);var _d3=_cf[0];if((_d2 instanceof Tiddler)&&_d3=="tags"){var _d4=_cd.lastChild;_d4.onfocus=function(e){abego.IntelliTagger.assistTagging(_d4,_d2);setTimeout(function(){_c8(_d2.title);},100);};_d4.onkeyup=function(e){if(!e){var e=window.event;}if(e.altKey&&!e.ctrlKey&&!e.metaKey&&(e.keyCode>=48&&e.keyCode<=57)){_89(e.keyCode==48?9:e.keyCode-49,_d4,_d2);}else{if(e.ctrlKey&&e.keyCode==32){_89(0,_d4,_d2);}}setTimeout(function(){abego.IntelliTagger.assistTagging(_d4,_d2);},100);return false;};_7f(_d4);}};var _d7=function(e){if(!e){var e=window.event;}var _d9=resolveTarget(e);var _da=_d9.getAttribute("tiddler");if(_da){story.displayTiddler(_d9,_da,"IntelliTaggerEditTagsTemplate",false);_c8(_da);}return false;};var _db=config.macros.tags.handler;config.macros.tags.handler=function(_dc,_dd,_de,_df,_e0,_e1){_db.apply(this,arguments);abego.IntelliTagger.createEditTagsButton(_e1,createTiddlyElement(_dc.lastChild,"li"));};var _e2=function(){if(_6f&&_70&&!abego.isDescendantOrSelf(document,_70)){abego.IntelliTagger.close();}};setInterval(_e2,100);abego.IntelliTagger.displayTagSuggestions=function(_e3,_e4,_e5,_e6,_e7){_72=_e3;_73=abego.toSet(_e4);_74=_e5;_70=_e6;_71=_e7;if(!_6f){_6f=createTiddlyElement(document.body,"div",null,"intelliTaggerSuggestions");_6f.style.position="absolute";}_aa();abego.openAsPopup(_6f);if(_75()){var w=_75().offsetWidth;if(_6f.offsetWidth<w){_6f.style.width=(w-2*(_6c+_6d))+"px";}abego.moveBelowAndClip(_6f,_75());}else{abego.centerOnWindow(_6f);}_c0();};abego.IntelliTagger.assistTagging=function(_e9,_ea){var _eb=_8e(_e9);var s=_e9.value;if(_7b(_e9)){s=_78(s);}var _ed=s.readBracketedList();var _ee=_ed.length>0?abego.filterStrings(abego.internal.getTagManager().getPartnerRankedTags(_ed),_eb,_6e):_9e(_eb,_6e);abego.IntelliTagger.displayTagSuggestions(_a7(_eb,_ed),_ed,_ee,_e9,function(tag,e){if(e.shiftKey){onClickTag.call(this,e);}else{_83(tag,_e9,_ea);}});};abego.IntelliTagger.close=function(){abego.closePopup(_6f);_6f=null;return false;};abego.IntelliTagger.createEditTagsButton=function(_f1,_f2,_f3,_f4,_f5,id,_f7){if(!_f3){_f3="[edit]";}if(!_f4){_f4="Edit the tags";}if(!_f5){_f5="editTags";}var _f8=createTiddlyButton(_f2,_f3,_f4,_d7,_f5,id,_f7);_f8.setAttribute("tiddler",(_f1 instanceof Tiddler)?_f1.title:String(_f1));return _f8;};config.macros.intelliTagger={label:"intelliTagger",handler:function(_f9,_fa,_fb,_fc,_fd,_fe){var _ff=_fd.parseParams("list",null,true);var _100=_ff[0]["action"];for(var i=0;_100&&i<_100.length;i++){var _102=_100[i];var _103=config.macros.intelliTagger.subhandlers[_102];if(!_103){abego.alertAndThrow("Unsupported action '%0'".format([_102]));}_103(_f9,_fa,_fb,_fc,_fd,_fe);}},subhandlers:{showTags:function(_104,_105,_106,_107,_108,_109){_af(_104,_72,_74?_74.length:0,_74);},showFavorites:function(_10a,_10b,_10c,_10d,_10e,_10f){_af(_10a,_74,0);},closeButton:function(_110,_111,_112,_113,_114,_115){var _116=createTiddlyButton(_110,"close","Close the suggestions",abego.IntelliTagger.close);},version:function(_117){var t="IntelliTagger %0.%1.%2".format([version.extensions.IntelliTaggerPlugin.major,version.extensions.IntelliTaggerPlugin.minor,version.extensions.IntelliTaggerPlugin.revision]);var e=createTiddlyElement(_117,"a");e.setAttribute("href","http://tiddlywiki.abego-software.de/#IntelliTaggerPlugin");e.innerHTML="<font color=\"black\" face=\"Arial, Helvetica, sans-serif\">"+t+"<font>";},copyright:function(_11a){var e=createTiddlyElement(_11a,"a");e.setAttribute("href","http://tiddlywiki.abego-software.de");e.innerHTML="<font color=\"black\" face=\"Arial, Helvetica, sans-serif\">&copy; 2006 <b><font color=\"red\">abego</font></b> Software<font>";}}};})();config.shadowTiddlers["IntelliTaggerStyleSheet"]="/***\n"+"!~IntelliTagger Stylesheet\n"+"***/\n"+"/*{{{*/\n"+".intelliTaggerSuggestions {\n"+"\tposition: absolute;\n"+"\twidth: 600px;\n"+"\n"+"\tpadding: 2px;\n"+"\tlist-style: none;\n"+"\tmargin: 0;\n"+"\n"+"\tbackground: #eeeeee;\n"+"\tborder: 1px solid DarkGray;\n"+"}\n"+"\n"+".intelliTaggerSuggestions .currentTag   {\n"+"\tfont-weight: bold;\n"+"}\n"+"\n"+".intelliTaggerSuggestions .suggestionNumber {\n"+"\tcolor: #808080;\n"+"}\n"+"\n"+".intelliTaggerSuggestions .numberedSuggestion{\n"+"\twhite-space: nowrap;\n"+"}\n"+"\n"+".intelliTaggerSuggestions .intelliTaggerFooter {\n"+"\tmargin-top: 4px;\n"+"\tborder-top-width: thin;\n"+"\tborder-top-style: solid;\n"+"\tborder-top-color: #999999;\n"+"}\n"+".intelliTaggerSuggestions .favorites {\n"+"\tborder-bottom-width: thin;\n"+"\tborder-bottom-style: solid;\n"+"\tborder-bottom-color: #999999;\n"+"\tpadding-bottom: 2px;\n"+"}\n"+"\n"+".intelliTaggerSuggestions .normalTags {\n"+"\tpadding-top: 2px;\n"+"}\n"+"\n"+".intelliTaggerSuggestions .intelliTaggerFooter .button {\n"+"\tfont-size: 10px;\n"+"\n"+"\tpadding-left: 0.3em;\n"+"\tpadding-right: 0.3em;\n"+"}\n"+"\n"+"/*}}}*/\n";config.shadowTiddlers["IntelliTaggerMainTemplate"]="<!--\n"+"{{{\n"+"-->\n"+"<div class=\"favorites\" macro=\"intelliTagger action: showFavorites\"></div>\n"+"<div class=\"normalTags\" macro=\"intelliTagger action: showTags\"></div>\n"+"<!-- The Footer (with the Navigation) ============================================ -->\n"+"<table class=\"intelliTaggerFooter\" border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tbody>\n"+"  <tr>\n"+"\t<td align=\"left\">\n"+"\t\t<span macro=\"intelliTagger action: closeButton\"></span>\n"+"\t</td>\n"+"\t<td align=\"right\">\n"+"\t\t<span macro=\"intelliTagger action: version\"></span>, <span macro=\"intelliTagger action: copyright \"></span>\n"+"\t</td>\n"+"  </tr>\n"+"</tbody></table>\n"+"<!--\n"+"}}}\n"+"-->\n";config.shadowTiddlers["IntelliTaggerEditTagsTemplate"]="<!--\n"+"{{{\n"+"-->\n"+"<div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler'></div>\n"+"<div class='title' macro='view title'></div>\n"+"<div class='tagged' macro='tags'></div>\n"+"<div class='viewer' macro='view text wikified'></div>\n"+"<div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler'></div>\n"+"<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser'></span></div>\n"+"<!--\n"+"}}}\n"+"-->\n";config.shadowTiddlers["BSD open source license (abego Software)"]="See [[Licence|http://tiddlywiki.abego-software.de/#%5B%5BBSD%20open%20source%20license%5D%5D]].";config.shadowTiddlers["IntelliTaggerPlugin Documentation"]="[[Documentation on abego Software website|http://tiddlywiki.abego-software.de/doc/IntelliTagger.pdf]].";config.shadowTiddlers["IntelliTaggerPlugin SourceCode"]="[[Plugin source code on abego Software website|http://tiddlywiki.abego-software.de/src/Plugin-IntelliTagger-src.js]]";setStylesheet(store.getTiddlerText("IntelliTaggerStyleSheet"),"intelliTagger");}
//%/
Isa 8:1   	Then the LORD said to me, "Take for yourself a large tablet and write on it in ordinary letters: Swift is the booty, speedy is the prey.
Isa 8:2   	"And I will take to Myself faithful witnesses for testimony, Uriah the priest and Zechariah the son of Jeberechiah."
Isa 8:3   	So I approached the prophetess, and she conceived and gave birth to a son. Then the LORD said to me, "Name him Maher-shalal-hash-baz;
Isa 8:4   	for before the boy knows how to cry out 'My father' or 'My mother,' the wealth of __Damascus__ and the spoil of Samaria will be carried away before the king of Assyria."
Isa 8:5   	Again the LORD spoke to me further, saying,
Isa 8:6   	"Inasmuch as these people have rejected the gently flowing waters of Shiloah And rejoice in Rezin and the son of Remaliah;
Isa 8:7   	"Now therefore, behold, the Lord is about to bring on them the strong and abundant waters of the Euphrates, {Even} the king of Assyria and all his glory; And it will rise up over all its channels and go over all its banks.
Isa 8:8   	"Then it will sweep on into Judah, it will overflow and pass through, It will reach even to the neck; And the spread of its wings will fill the breadth of your land, O Immanuel.
Isa 8:9   	"Be broken, O peoples, and be shattered; And give ear, all remote places of the earth. Gird yourselves, yet be shattered; Gird yourselves, yet be shattered.
Isa 8:10   	"Devise a plan, but it will be thwarted; State a proposal, but it will not stand, For God is with us."
Isa 8:11   	For thus the LORD spoke to me with mighty power and instructed me not to walk in the way of this people, saying,
Isa 8:12   	"You are not to say, '{It is} a conspiracy!' In regard to all that this people call a conspiracy, And you are not to fear what they fear or be in dread of {it.}
Isa 8:13   	"It is the LORD of hosts whom you should regard as holy. And He shall be your fear, And He shall be your dread.
Isa 8:14   	"Then He shall become a sanctuary; But to both the houses of Israel, a stone to strike and a rock to stumble over, {And} a snare and a trap for the inhabitants of Jerusalem.
Isa 8:15   	"Many will stumble over them, Then they will fall and be broken; They will even be snared and caught."
Isa 8:16   	Bind up the testimony, seal the law among my disciples.
Isa 8:17   	And I will wait for the LORD who is hiding His face from the house of Jacob; I will even look eagerly for Him.
Isa 8:18   	Behold, I and the children whom the LORD has given me are for signs and wonders in Israel from the LORD of hosts, who dwells on Mount Zion.
Isa 8:19   	When they say to you, "Consult the mediums and the spiritists who whisper and mutter," should not a people consult their God? {Should they} {consult} the dead on behalf of the living?
Isa 8:20   	To the law and to the testimony! If they do not speak according to this word, it is because they have no dawn.
Isa 8:21   	They will pass through the land hard-pressed and famished, and it will turn out that when they are hungry, they will be enraged and curse their king and their God as they face upward.
Isa 8:22   	Then they will look to the earth, and behold, distress and darkness, the gloom of anguish; and {they will be} driven away into darkness.
/%
|Name|JavascriptShell|
|Source|http://www.TiddlyTools.com/#JavascriptShell|
|Version|0.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|script|
|Requires|InlineJavascriptPlugin|
|Overrides||
|Description|TidIDE: enter and invoke javascript in a command line|
%//%

Derived from http://www.squarefree.com/shell/?ignoreReferrerFrom=shell1.4

%/<html><div class="shell"><div id="output"></div><input type=text
		onkeydown="jsshell.inputKeydown(event)"
		id="input" class="input" wrap="off" autocomplete="off"
		title="TAB=auto-complete property names, Ctrl+Up/Down=history"
		style="width:100%;height:1.2em;margin-top:.2em;border:1px solid;color:#000;background:#fff;"><span style="float:right">height: <input type="text" name="height" value="20em" size="2" style="width:3em;padding:0;margin:0;" onchange="document.getElementById('output').style.height=this.value"> <input type="button" onclick="jsshell.go('clear()')"value="clear"></span><!--
	--><div>enter a javascript expression or shell function:
	ans, load(URL), scope(obj), <!--
	--><a accesskey="M" href="javascript:jsshell.go('scope(Math); mathHelp();');">Math</a>, <!--
	--><a accesskey="P" href="javascript:jsshell.go('props(ans)')">props(obj)</a>, <!--
	--><a accesskey="B" href="javascript:jsshell.go('blink(ans)')">blink(node)</a>, <!--
	--><a href="javascript:jsshell.go('wikify(ans)')">wikify(text)</a>, <!--
	--><a href="javascript:jsshell.go('print(ans)')">print(text)</a></div></div></html><script>

var shellstyles="";
shellstyles+=".shell #output { height:20em;width:100%;white-space:normal;overflow:auto; }";
shellstyles+=".shell #output { border:1px solid #999;background:#000 !important; }";
shellstyles+=".shell #output .input { color:#fff !important; }"; // white
shellstyles+=".shell #output .error { color:#f00 !important; }"; // red
shellstyles+=".shell #output .normalOutput { color:#0c0 !important; }"; // green
shellstyles+=".shell #output .propList { color:#0c0 !important; }"; // green
shellstyles+=".shell #output .print { color:#ccc !important; }"; // gray
shellstyles+=".shell #output .tabcomplete { color:#ff0 !important; }"; // yellow
shellstyles+=".shell #output .message { color:#0ff !important; }"; // cyan
setStylesheet(shellstyles,"JavascriptShellStyles");

window.jsshell = {}; // Put our functions in the global namespace.

window.jsshell.refocus = function()
{
  jsshell._in.blur(); // Needed for Mozilla to scroll correctly.
  jsshell._in.focus();
}

window.jsshell.initTarget = function()
{
  window.print = jsshell.shellCommands.print;
}

// Unless the user is selected something, refocus the textbox.
// (requested by caillon, brendan, asa)
window.jsshell.keepFocusInTextbox = function(e) 
{
  var g = e.srcElement ? e.srcElement : e.target; // IE vs. standard
  
  while (!g.tagName)
    g = g.parentNode;
  var t = g.tagName.toUpperCase();
  if (t=="A" || t=="INPUT")
    return;
    
  if (window.getSelection) {
    // Mozilla
    if (String(window.getSelection()))
      return;
  }
  else if (document.getSelection) {
    // Opera? Netscape 4?
    if (document.getSelection())
      return;
  }
  else {
    // IE
    if ( document.selection.createRange().text )
      return;
  }
  
  jsshell.refocus();
}

//function inputKeydown(e) {
window.jsshell.inputKeydown = function(e) {
  // Use onkeydown because IE doesn't support onkeypress for arrow keys

  //alert(e.keyCode + " ^ " + e.keycode);

  if (e.shiftKey && e.keyCode == 13) { // shift-enter
    // don't do anything; allow the shift-enter to insert a line break as normal
  } else if (e.keyCode == 13) { // enter
    // execute the input on enter
    try { jsshell.go(); } catch(er) { alert(er); };
    setTimeout(function() { jsshell._in.value = ""; }, 0); // can't preventDefault on input, so clear it later
  } else if (e.keyCode == 38) { // up
    // go up in history if at top or ctrl-up
    if (e.ctrlKey || jsshell.caretInFirstLine(jsshell._in))
      jsshell.hist(true);
  } else if (e.keyCode == 40) { // down
    // go down in history if at end or ctrl-down
    if (e.ctrlKey || jsshell.caretInLastLine(jsshell._in))
      jsshell.hist(false);
  } else if (e.keyCode == 9) { // tab
    jsshell.tabcomplete();
    setTimeout(function() { jsshell.refocus(); }, 0); // refocus because tab was hit
  } else { }

  setTimeout(jsshell.recalculateInputHeight, 0);
  
  //return true;
};

window.jsshell.caretInFirstLine = function(textbox)
{
  // IE doesn't support selectionStart/selectionEnd
  if (textbox.selectionStart == undefined)
    return true;

  var firstLineBreak = textbox.value.indexOf("\n");

  return ((firstLineBreak == -1) || (textbox.selectionStart <= firstLineBreak));
}

window.jsshell.caretInLastLine = function(textbox)
{
  // IE doesn't support selectionStart/selectionEnd
  if (textbox.selectionEnd == undefined)
    return true;

  var lastLineBreak = textbox.value.lastIndexOf("\n");
  
  return (textbox.selectionEnd > lastLineBreak);
}

window.jsshell.recalculateInputHeight = function()
{
  var rows = jsshell._in.value.split(/\n/).length
    + 1 // prevent scrollbar flickering in Mozilla
    + (window.opera ? 1 : 0); // leave room for scrollbar in Opera

  if (jsshell._in.rows != rows) // without this check, it is impossible to select text in Opera 7.60 or Opera 8.0.
    jsshell._in.rows = rows;
}

window.jsshell.println = function(s, type)
{
  if((s=String(s)))
  {
    var newdiv = document.createElement("div");
    newdiv.appendChild(document.createTextNode(s));
    newdiv.className = type;
    jsshell._out.appendChild(newdiv);
    jsshell._out.scrollTop=jsshell._out.scrollHeight-jsshell._out.clientHeight; // ELS: scroll output into view
    return newdiv;
  }
}

window.jsshell.printWithRunin = function(h, s, type)
{
  var div = jsshell.println(s, type);
  var head = document.createElement("strong");
  head.appendChild(document.createTextNode(h + ": "));
  div.insertBefore(head, div.firstChild);
}

window.jsshell.shellCommands = 
{
load : function load(url)
{
  var s = document.createElement("script");
  s.type = "text/javascript";
  s.src = url;
  document.getElementsByTagName("head")[0].appendChild(s);
  jsshell.println("Loading " + url + "...", "message");
},

clear : function clear()
{
    jsshell._out.innerHTML = "";
},

wikify : function wikify(text)
{
    window.wikify(text, jsshell._out);
},

print : function print(s) { jsshell.println(s, "print"); },

// the normal function, "print", shouldn't return a value
// (suggested by brendan; later noticed it was a problem when showing others)
pr : function pr(s) 
{ 
  jsshell.shellCommands.print(s); // need to specify shellCommands so it doesn't try window.print()!
  return s;
},

props : function props(e, onePerLine)
{
  if (e === null) {
    jsshell.println("props called with null argument", "error");
    return;
  }

  if (e === undefined) {
    jsshell.println("props called with undefined argument", "error");
    return;
  }

  var ns = ["Methods", "Fields", "Unreachables"];
  var as = [[], [], []]; // array of (empty) arrays of arrays!
  var p, j, i; // loop variables, several used multiple times

  var protoLevels = 0;

  for (p = e; p; p = p.__proto__)
  {
    for (i=0; i<ns.length; ++i)
      as[i][protoLevels] = [];
    ++protoLevels;
  }

  for(var a in e)
  {
    // Shortcoming: doesn't check that VALUES are the same in object and prototype.

    var protoLevel = -1;
    try
    {
      for (p = e; p && (a in p); p = p.__proto__)
        ++protoLevel;
    }
    catch(er) { protoLevel = 0; } // "in" operator throws when param to props() is a string

    var type = 1;
    try
    {
      if ((typeof e[a]) == "function")
        type = 0;
    }
    catch (er) { type = 2; }

    as[type][protoLevel].push(a);
  }

  function times(s, n) { return n ? s + times(s, n-1) : ""; }

  for (j=0; j<protoLevels; ++j)
    for (i=0;i<ns.length;++i)
      if (as[i][j].length) 
        jsshell.printWithRunin(
          ns[i] + times(" of prototype", j), 
          (onePerLine ? "\n\n" : "") + as[i][j].sort().join(onePerLine ? "\n" : ", ") + (onePerLine ? "\n\n" : ""), 
          "propList"
        );
},

blink : function blink(node)
{
  if (!node)                     throw("blink: argument is null or undefined.");
  if (node.nodeType == null)     throw("blink: argument must be a node.");
  if (node.nodeType == 3)        throw("blink: argument must not be a text node");
  if (node.documentElement)      throw("blink: argument must not be the document object");

  function setOutline(o) { 
    return function() {
      if (node.style.outline != node.style.bogusProperty) {
        // browser supports outline (Firefox 1.1 and newer, CSS3, Opera 8).
        node.style.outline = o;
      }
      else if (node.style.MozOutline != node.style.bogusProperty) {
        // browser supports MozOutline (Firefox 1.0.x and older)
        node.style.MozOutline = o;
      }
      else {
        // browser only supports border (IE). border is a fallback because it moves things around.
        node.style.border = o;
      }
    }
  } 
  
  function focusIt(a) {
    return function() {
      a.focus(); 
    }
  }

  if (node.ownerDocument) {
    var windowToFocusNow = (node.ownerDocument.defaultView || node.ownerDocument.parentWindow); // Moz vs. IE
    if (windowToFocusNow)
      setTimeout(focusIt(windowToFocusNow.top), 0);
  }

  for(var i=1;i<7;++i)
    setTimeout(setOutline((i%2)?'3px solid red':'none'), i*100);

  setTimeout(focusIt(window), 800);
  setTimeout(focusIt(jsshell._in), 810);
},

scope : function scope(sc)
{
  if (!sc) sc = {};
  jsshell._scope = sc;
  jsshell.println("Scope is now " + sc + ".  If a variable is not found in this scope, window will also be searched.  New variables will still go on window.", "message");
},

mathHelp : function mathHelp()
{
  jsshell.printWithRunin("Math constants", "E, LN2, LN10, LOG2E, LOG10E, PI, SQRT1_2, SQRT2", "propList");
  jsshell.printWithRunin("Math methods", "abs, acos, asin, atan, atan2, ceil, cos, exp, floor, log, max, min, pow, random, round, sin, sqrt, tan", "propList");
},

ans : undefined
};


window.jsshell.hist = function(up)
{
  // histList[0] = first command entered, [1] = second, etc.
  // type something, press up --> thing typed is now in "limbo"
  // (last item in histList) and should be reachable by pressing 
  // down again.

  var L = jsshell.histList.length;

  if (L == 1)
    return;

  if (up)
  {
    if (jsshell.histPos == L-1)
    {
      // Save this entry in case the user hits the down key.
      jsshell.histList[jsshell.histPos] = jsshell._in.value;
    }

    if (jsshell.histPos > 0)
    {
      jsshell.histPos--;
      // Use a timeout to prevent up from moving cursor within new text
      // Set to nothing first for the same reason
      setTimeout(
        function() {
          jsshell._in.value = ''; 
          jsshell._in.value = jsshell.histList[jsshell.histPos];
          var caretPos = jsshell._in.value.length;
          if (jsshell._in.setSelectionRange) 
            jsshell._in.setSelectionRange(caretPos, caretPos);
        },
        0
      );
    }
  } 
  else // down
  {
    if (jsshell.histPos < L-1)
    {
      jsshell.histPos++;
      jsshell._in.value = jsshell.histList[jsshell.histPos];
    }
    else if (jsshell.histPos == L-1)
    {
      // Already on the current entry: clear but save
      if (jsshell._in.value)
      {
        jsshell.histList[jsshell.histPos] = jsshell._in.value;
        ++jsshell.histPos;
        jsshell._in.value = "";
      }
    }
  }
}

window.jsshell.tabcomplete = function()
{
  /*
   * Working backwards from s[from], find the spot
   * where this expression starts.  It will scan
   * until it hits a mismatched ( or a space,
   * but it skips over quoted strings.
   * If stopAtDot is true, stop at a '.'
   */
  function findbeginning(s, from, stopAtDot)
  {
    /*
     *  Complicated function.
     *
     *  Return true if s[i] == q BUT ONLY IF
     *  s[i-1] is not a backslash.
     */
    function equalButNotEscaped(s,i,q)
    {
      if(s.charAt(i) != q) // not equal go no further
        return false;

      if(i==0) // beginning of string
        return true;

      if(s.charAt(i-1) == '\\') // escaped?
        return false;

      return true;
    }

    var nparens = 0;
    var i;
    for(i=from; i>=0; i--)
    {
      if(s.charAt(i) == ' ')
        break;

      if(stopAtDot && s.charAt(i) == '.')
        break;
        
      if(s.charAt(i) == ')')
        nparens++;
      else if(s.charAt(i) == '(')
        nparens--;

      if(nparens < 0)
        break;

      // skip quoted strings
      if(s.charAt(i) == '\'' || s.charAt(i) == '\"')
      {
        //dump("skipping quoted chars: ");
        var quot = s.charAt(i);
        i--;
        while(i >= 0 && !equalButNotEscaped(s,i,quot)) {
          //dump(s.charAt(i));
          i--;
        }
        //dump("\n");
      }
    }
    return i;
  }

  // XXX should be used more consistently (instead of using selectionStart/selectionEnd throughout code)
  // XXX doesn't work in IE, even though it contains IE-specific code
  function getcaretpos(inp)
  {
    if(inp.selectionEnd != null)
      return inp.selectionEnd;
      
    if(inp.createTextRange)
    {
      var docrange = document.selection.createRange();
      var inprange = inp.createTextRange();
      if (inprange.setEndPoint)
      {
        inprange.setEndPoint('EndToStart', docrange);
        return inprange.text.length;
      }
    }

    return inp.value.length; // sucks, punt
  }

  function setselectionto(inp,pos)
  {
    if(inp.selectionStart) {
      inp.selectionStart = inp.selectionEnd = pos;
    }
    else if(inp.createTextRange) {
      var docrange = document.selection.createRange();
      var inprange = inp.createTextRange();
      inprange.move('character',pos);
      inprange.select();
    }
    else { // err...
    /*
      inp.select();
      if(document.getSelection())
        document.getSelection() = "";
        */
    }
  }
    // get position of cursor within the input box
    var caret = getcaretpos(jsshell._in);

    if(caret) {
      //dump("----\n");
      var dotpos, spacepos, complete, obj;
      //dump("caret pos: " + caret + "\n");
      // see if there's a dot before here
      dotpos = findbeginning(jsshell._in.value, caret-1, true);
      //dump("dot pos: " + dotpos + "\n");
      if(dotpos == -1 || jsshell._in.value.charAt(dotpos) != '.') {
        dotpos = caret;
//dump("changed dot pos: " + dotpos + "\n");
      }

      // look backwards for a non-variable-name character
      spacepos = findbeginning(jsshell._in.value, dotpos-1, false);
      //dump("space pos: " + spacepos + "\n");
      // get the object we're trying to complete on
      if(spacepos == dotpos || spacepos+1 == dotpos || dotpos == caret)
      {
        // try completing function args
        if(jsshell._in.value.charAt(dotpos) == '(' ||
 (jsshell._in.value.charAt(spacepos) == '(' && (spacepos+1) == dotpos))
        {
          var fn,fname;
  var from = (jsshell._in.value.charAt(dotpos) == '(') ? dotpos : spacepos;
          spacepos = findbeginning(jsshell._in.value, from-1, false);

          fname = jsshell._in.value.substr(spacepos+1,from-(spacepos+1));
  //dump("fname: " + fname + "\n");
          try {
            with(window)
              with(jsshell._scope)
                with(jsshell.shellCommands)
                  fn = eval(fname);
          }
          catch(er) {
            //dump('fn is not a valid object\n');
            return;
          }
          if(fn == undefined) {
             //dump('fn is undefined');
             return;
          }
          if(fn instanceof Function)
          {
            // Print function definition, including argument names, but not function body
            if(!fn.toString().match(/function .+?\(\) +\{\n +\[native code\]\n\}/))
              jsshell.println(fn.toString().match(/function .+?\(.*?\)/), "tabcomplete");
          }

          return;
        }
        else
          obj = window;
      }
      else
      {
        var objname = jsshell._in.value.substr(spacepos+1,dotpos-(spacepos+1));
        //dump("objname: |" + objname + "|\n");
        try {
          with(jsshell._scope)
            with(window)
                obj = eval(objname);
        }
        catch(er) {
          jsshell.printError(er); 
          return;
        }
        if(obj == undefined) {
          // sometimes this is tabcomplete's fault, so don't print it :(
          // e.g. completing from "print(document.getElements"
          // jsshell.println("Can't complete from null or undefined expression " + objname, "error");
          return;
        }
      }
      //dump("obj: " + obj + "\n");
      // get the thing we're trying to complete
      if(dotpos == caret)
      {
        if(spacepos+1 == dotpos || spacepos == dotpos)
        {
          // nothing to complete
          //dump("nothing to complete\n");
          return;
        }

        complete = jsshell._in.value.substr(spacepos+1,dotpos-(spacepos+1));
      }
      else {
        complete = jsshell._in.value.substr(dotpos+1,caret-(dotpos+1));
      }
      //dump("complete: " + complete + "\n");
      // ok, now look at all the props/methods of this obj
      // and find ones starting with 'complete'
      var matches = [];
      var bestmatch = null;
      for(var a in obj)
      {
        //a = a.toString();
        //XXX: making it lowercase could help some cases,
        // but screws up my general logic.
        if(a.substr(0,complete.length) == complete) {
          matches.push(a);
          ////dump("match: " + a + "\n");
          // if no best match, this is the best match
          if(bestmatch == null)
          {
            bestmatch = a;
          }
          else {
            // the best match is the longest common string
            function min(a,b){ return ((a<b)?a:b); }
            var i;
            for(i=0; i< min(bestmatch.length, a.length); i++)
            {
              if(bestmatch.charAt(i) != a.charAt(i))
                break;
            }
            bestmatch = bestmatch.substr(0,i);
            ////dump("bestmatch len: " + i + "\n");
          }
          ////dump("bestmatch: " + bestmatch + "\n");
        }
      }
      bestmatch = (bestmatch || "");
      ////dump("matches: " + matches + "\n");
      var objAndComplete = (objname || obj) + "." + bestmatch;
      //dump("matches.length: " + matches.length + ", jsshell.tooManyMatches: " + jsshell.tooManyMatches + ", objAndComplete: " + objAndComplete + "\n");
      if(matches.length > 1 && (jsshell.tooManyMatches == objAndComplete || matches.length <= 10)) {

        jsshell.printWithRunin("Matches: ", matches.join(', '), "tabcomplete");
        jsshell.tooManyMatches = null;
      }
      else if(matches.length > 10)
      {
        jsshell.println(matches.length + " matches.  Press tab again to see them all", "tabcomplete");
        jsshell.tooManyMatches = objAndComplete;
      }
      else {
        jsshell.tooManyMatches = null;
      }
      if(bestmatch != "")
      {
        var sstart;
        if(dotpos == caret) {
          sstart = spacepos+1;
        }
        else {
          sstart = dotpos+1;
        }
        jsshell._in.value = jsshell._in.value.substr(0, sstart)
                  + bestmatch
                  + jsshell._in.value.substr(caret);
        setselectionto(jsshell._in,caret + (bestmatch.length - complete.length));
      }
    }
}

window.jsshell.printQuestion = function(q)
{
  jsshell.println(q, "input");
}

window.jsshell.printAnswer = function(a)
{
  if (a !== undefined) {
    jsshell.println(a, "normalOutput");
    jsshell.shellCommands.ans = a;
  }
}

window.jsshell.printError = function(er)
{ 
  var lineNumberString;

  lastError = er; // for debugging the shell
  if (er.name)
  {
    // lineNumberString should not be "", to avoid a very wacky bug in IE 6.
    lineNumberString = (er.lineNumber != undefined) ? (" on line " + er.lineNumber + ": ") : ": ";
    jsshell.println(er.name + lineNumberString + er.message, "error"); // Because IE doesn't have error.toString.
  }
  else
    jsshell.println(er, "error"); // Because security errors in Moz /only/ have toString.
}

window.jsshell.go = function(s)
{
  jsshell._in.value = jsshell.question = s ? s : jsshell._in.value;

  if (jsshell.question == "")
    return;

  jsshell.histList[jsshell.histList.length-1] = jsshell.question;
  jsshell.histList[jsshell.histList.length] = "";
  jsshell.histPos = jsshell.histList.length - 1;
  
  // Unfortunately, this has to happen *before* the JavaScript is run, so that 
  // print() output will go in the right place.
  jsshell._in.value='';
  jsshell.recalculateInputHeight();
  jsshell.printQuestion(jsshell.question);

  if (window.closed) {
    jsshell.printError("Target window has been closed.");
    return;
  }
  
  try { ("jsshell" in window) }
  catch(er) {
    jsshell.printError("The JavaScript Shell cannot access variables in the target window.  The most likely reason is that the target window now has a different page loaded and that page has a different hostname than the original page.");
    return;
  }

  if (!("jsshell" in window))
    initTarget(); // silent

  // Evaluate Shell.question using _win's eval (this is why eval isn't in the |with|, IIRC).
//  window.location.href = "javascript:try{ jsshell.printAnswer(eval('with(jsshell._scope) with(jsshell.shellCommands) {' + jsshell.question + String.fromCharCode(10) + '}')); } catch(er) { jsshell.printError(er); }; setTimeout(jsshell.refocus, 0); void 0";
  try { 
      jsshell.printAnswer(eval(
          'with(jsshell._scope) with(jsshell.shellCommands) {' 
              + jsshell.question + String.fromCharCode(10) + 
          '}')); 
  } catch(er) { 
      jsshell.printError(er); 
  }; 
  setTimeout(jsshell.refocus, 0);
}

window.jsshell.histList = [""]; 
window.jsshell.histPos = 0; 
window.jsshell._scope = {}; 
window.jsshell.question;
window.jsshell._in;
window.jsshell._out;
window.jsshell.tooManyMatches = null;
window.jsshell.lastError = null;

jsshell._in = document.getElementById("input");
jsshell._out = document.getElementById("output");

jsshell.initTarget();

jsshell.recalculateInputHeight();
jsshell.refocus();

</script>
/***
| Name|LessBackupsPlugin|
| Description|Intelligently limit the number of backup files you create|
| Version|3.0 ($Rev: 2320 $)|
| Date|$Date: 2007-06-18 22:37:46 +1000 (Mon, 18 Jun 2007) $|
| Source|http://mptw.tiddlyspot.com/#LessBackupsPlugin|
| Author|Simon Baird|
| Email|simon.baird@gmail.com|
| License|http://mptw.tiddlyspot.com/#TheBSDLicense|
!!!Description
You end up with just backup one per year, per month, per weekday, per hour, minute, and second.  So total number won't exceed about 200 or so. Can be reduced by commenting out the seconds/minutes/hours line from modes array

!!!Notes
Works in IE and Firefox only.  Algorithm by Daniel Baird. IE code by by Saq Imtiaz.
!!!Code
***/
//{{{
window.getSpecialBackupPath = function(backupPath) {

	var MINS  = 60 * 1000;
	var HOURS = 60 * MINS;
	var DAYS  = 24 * HOURS;

	// comment out the ones you don't want
	var modes = [
//		["YYYY",  365*DAYS], // one per year for ever
//		["MMM",   31*DAYS],  // one per month
//		["ddd",   7*DAYS],   // one per weekday
//		//["d0DD",  1*DAYS],   // one per day of month
		["h0hh",  24*HOURS], // one per hour
		["m0mm",  1*HOURS],  // one per minute
//		["s0ss",  1*MINS],   // one per second
		["latest",0]         // always keep last version. (leave this).
	];

	var now = new Date();

	for (var i=0;i<modes.length;i++) {

		// the filename we will try
		var specialBackupPath = backupPath.replace(/(\.)([0-9]+\.[0-9]+)(\.html)$/,
						'$1'+now.formatString(modes[i][0]).toLowerCase()+'$3')

		// open the file

		try {
			if (config.browser.isIE) {
				var fsobject = new ActiveXObject("Scripting.FileSystemObject")
				var fileExists  = fsobject.FileExists(specialBackupPath);
				if (fileExists) {
					var fileObject = fsobject.GetFile(specialBackupPath);
					var modDate = new Date(fileObject.DateLastModified).valueOf();
				}
			}
			else {
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
				var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
				file.initWithPath(specialBackupPath);
				var fileExists = file.exists();
				if (fileExists) {
					var modDate = file.lastModifiedTime;
				}
			}
		}
		catch(e) {
			// give up
			return backupPath;
		}

		// expiry is used to tell if it's an 'old' one. Eg, if the month is June and there is a
		// June file on disk that's more than an month old then it must be stale so overwrite
		// note that "latest" should be always because the expiration period is zero (see above)
		var expiry = new Date(modDate + modes[i][1]);
		if (!fileExists || now > expiry)
			return specialBackupPath;
	}
}

// hijack the core function
window.getBackupPath_orig = window.getBackupPath;
window.getBackupPath = function(localPath) {
	return getSpecialBackupPath(getBackupPath_orig(localPath));
}

//}}}

right click, then pick "new tab" so you don't get rid of this window, 
or click the middle button if you have one
[[Blue Letter Bible|http://www.blueletterbible.org/]]
[[Bible Maps|http://biblemap.org]]
[[Net Bible|http://net.bible.org/home.php]]
*Edit this tiddler to see listboxes. 
*List values are defined in [[ListPriorities]] and [[ListStatus]].
*This example uses [[ListEditTemplate]] and [[ListViewTemplate]] templates.
<!--{{{-->
<div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler deleteTiddler'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='editListbox priority ListPriorities 3'>Priority : </div>
<div class='editor' macro='editListbox status ListStatus'>Status : </div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser'></span></div>
<!--}}}-->
Name: Blue
Background: #fff
Foreground: #000
PrimaryPale: #cdf
PrimaryLight: #57c
PrimaryMid: #114
PrimaryDark: #012
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88

Name: Green
Background: #fff
Foreground: #000
PrimaryPale: #9b9
PrimaryLight: #385
PrimaryMid: #031
PrimaryDark: #020
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88

Name: Red
Background: #fff
Foreground: #000
PrimaryPale: #fdd
PrimaryLight: #c55
PrimaryMid: #711
PrimaryDark: #500
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88

Name: Smoke
Background: #fff
Foreground: #000
PrimaryPale: #aaa
PrimaryLight: #777
PrimaryMid: #111
PrimaryDark: #000
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88

Name: Teal
Background: #fff
Foreground: #000
PrimaryPale: #B5D1DF
PrimaryLight: #618FA9
PrimaryMid: #1a3844
PrimaryDark: #000
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #f8f8f8
TertiaryLight: #bbb
TertiaryMid: #999
TertiaryDark: #888
Error: #f88
1Sa 30:1-6

Here we have, I. The descent which the Amalekites made upon Ziklag in David’s absence, and the desolations they made there. They surprised the city when it was left unguarded, plundered it, burnt it, and carried all the women and children captives, v. 1, 2. @@They intended, by this to revenge the like havoc that David had lately made of them and their country,@@ ch. 27:8. He that had made so many enemies ought not to have left his own concerns so naked and defenceless. Those that make bold with others must expect that others will make as bold with them and provide accordingly. Now observe in this, 1. @@The cruelty of Saul’s pity (as it proved) in sparing the Amalekites; if he had utterly destroyed them, as he ought to have done, these would not have been in being to do this mischief@@. 2. How David was corrected for being so forward to go with the Philistines against Israel. @@God showed him that he had better have staid at home and looked after his own business. @@When we go abroad in the way of our duty we may comfortably hope that God will take care of our families in our absence, but not otherwise. 3.@@ How wonderfully God inclined the hearts of these Amalekites to carry the women and children away captives, and not to kill them.@@ When David invaded them he put all to the sword (ch. 27:9), and no reason can be given why they did not retaliate upon this city, but that God restrained them; for he has all hearts in his hands, and says to the fury of the most cruel men, Hitherto thou shalt come, and no further. Whether they spared them to lead them in triumph, or to sell them, or to use them for slaves, God’s hand must be acknowledged, who designed to make use of the Amalekites for the correction, not for the destruction, of the house of David. 
[[Controls]]
BooksOfTheBible

<<tag EditTools>>
TheStudyProcedure

<<tag [[references]]>>
<<tag [[Templates]]>>
<<search>>
<!--{{{-->
<link rel='alternate' type='application/rss+xml' title='RSS' href='index.xml'/>
<!--}}}-->

<script type="text/javascript" src="fckeditor/
fckeditor.js"></script> 

<style type="text/css">#contentWrapper {display:none;}</style><div id="SplashScreen" style="border: 3px solid #ccc; display: block; text-align: center; width: 320px; margin: 100px auto; padding: 50px; color:#000; font-size: 28px; font-family:Tahoma; background-color:#eee;"><b>Bible Study</b> is loading<blink> ...</blink><br><br><span style="font-size: 14px; color:red;">Requires Javascript.<br>Best viewed in Firefox web browser.</span></div>
[[MonkeyPirateTiddlyWiki|http://mptw.tiddlyspot.com]] is a distribution of [[TiddlyWiki|http://www.tiddlywiki.com/]] created by Simon Baird. See [[the web site|http://mptw.tiddlyspot.com/]] for more information.
!!Upgrading ~MonkeyPirateTiddlyWiki
This "empty" ~MonkeyPirateTiddlyWiki file comes pre-installed with the core ~MonkeyPirateTiddlyWiki plugins. You can upgrade these core plugins to the latest version by doing the following:
* Click ImportTiddlers
* Click "Choose..." and select "~MptwUpgradeURL"
* Click "fetch"
* Click the checkbox in the first column heading to select all tiddlers
* Click "More actions..." and select "Import these tiddlers"
* Click "OK" to confirm you want to overwrite the tiddlers
* Save and reload
/***
|Name|MoveablePanelPlugin|
|Source|http://www.TiddlyTools.com/#MoveablePanelPlugin|
|Version|1.3.7|
|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|NestedSlidersPlugin|
|Overrides||
|Description|Add move, size, max/restore mouse event handling and fold/unfold, hover/scroll, and close/dock toolbar command items to any floating slider panel or tiddler|
!!!!!Usage
<<<
syntax: {{{<<moveablePanel nofold nohover noclose>>}}}

where ''nofold'', ''nohover'', and ''noclose'' are optional flags to suppress display of selected commands in the moveable panel "toolbar".

example: //using NestedSlidersPlugin 'floating panel' syntax//
//{{{
+++^30em^[panel]<<moveablePanel>>this is a headline for the panel
----
	this is a moveable floating panel
	with a few lines of text
	as an example for you to try...
	//note: this line is really long so you can see what happens to word wrapping when you re-size this panel//
===
//}}}
Try it: +++^30em^[panel]<<moveablePanel>>this is a headline for the panel
----
	this is a moveable floating panel
	with a few lines of text
	as an example for you to try...
	//note: this line is really long so you can see what happens to word wrapping when you re-size this panel//
===


When the mouse is just inside the edges of the tiddler/panel, the cursor will change to a "crossed-arrows" symbol, indicating that the panel is "moveable".  Grab (click-hold) the panel anywhere in the edge area and then drag the mouse to reposition the panel.

To resize the panel, hold the ''shift'' key and then grab the panel: the cursor will change to a "double-arrow" symbol.  Drag a side edge of the panel to stretch horizontally or vertically, or drag a corner of the panel to stretch in both dimensions at once.

Double-clicking anywhere in the edge area of a panel will 'maximize' it to fit the current browser window.

When the mouse is anywhere over a panel (not just near the edge), a 'toolbar menu' appears in the ''upper right corner'', with the following command items:
*fold/unfold: ''fold'' temporarily reduces the panel height to show just one line of text.  ''unfold'' restores the panel height.
*hover/scroll: when you scroll the browser window, the moveable panels scroll with it.  ''hover'' lets you keep a panel in view, while the rest of the page content moves in the window.  ''scroll'' restores the default scrolling behavior for the panel.  //Note: Due to browser limitations, this feature is not currently available when using Internet Explorer (v6 or lower)... sorry.//
*close: ''close'' hides a panel from the page display.  If you have moved/resized a panel, closing it restores its default position and size.
*dock: unlike a floating panel, a moveable //tiddler// does not "float" on the page until it has actually been moved from its default position.  When moving a tiddler, the ''close'' command is replaced with ''dock'', which restores the tiddler to its default //non-floating// location on the page.
<<<
!!!!!Installation
<<<
import (or copy/paste) the following tiddlers into your document:
''MoveablePanelPlugin'' (tagged with <<tag systemConfig>>)
Note: for compatibility, please also install the current version of ''NestedSlidersPlugin''.
<<<
!!!!!Revision History
<<<
''2007.06.10 [1.3.7]'' in handler(), mouse event handlers now use apply() to correctly invoke any previous mouse handler functions.  This allows *moveable tiddlers* to still process the TW standard handlers for mouseover/out that toggle the 'selected' class used to highlight the toolbar items when the mouse is over a tiddler.  Also, when setting up a moveable "floatingPanel", clear the existing "snap panel back to button location" mouseover/out event handlers (defined by NestedSlidersPlugin when the panels are created).  This extends the fix from v1.3.5 (see below). 
''2007.06.08 [1.3.6]'' in getPanel(), remove unneeded check for "moveable" tag.  Also, added support for "noclose" macro param, and updated documentation accordingly.
''2007.06.02 [1.3.5]'' in handler(), if floating panel has a corresponding button element (i.e., a NestedSlider), then remove onmouseover handler from that button element, to prevent automatic "snap to original location" behavior.  This allows *moveable* floating panels to maintain their placement when they have been manually re-positioned.  This change is made for compatibility with [[NestedSlidersPlugin]] use of onmouseover (see Revision History entry for version 2.0.4)
''2006.10.17 [1.3.4]'' when moving panel, adjust position for relative containing DIV
''2006.05.25 [1.3.3]'' in closePanel(), use p.button.onclick() so that normal processing (updating slider button tooltip, access key, etc.) is performed
''2006.05.11 [1.3.2]'' doc update
''2006.05.11 [1.3.1]'' re-define all functions within moveablePanel object (eliminate global window.* function definitions (and some "leaky closures" in IE)
''2006.05.11 [1.3.0]'' converted from inline javascript to true plugin
''2006.05.09 [1.2.3]'' in closePanel(), set focus to sliderpanel button (if any)
''2006.05.02 [1.2.2]'' in MoveOrSizePanel(), calculate adjustments for top and left when inside nested floating panels
''2006.04.06 [1.2.1]'' in getPanel(), allow redefinition or bypass of "moveable" tag (changed from hard-coded "tearoff")
''2006.03.29 [1.2.0]'' in getPanel(), require "tearoff" tag to enable floating tiddlers
''2006.03.13 [1.1.0]'' added handling for floating tiddlers and conditional menu display
''2006.03.06 [1.0.2]'' set move or resize cursor during mousetracking
''2006.03.05 [1.0.1]'' use "window" vs "document.body" so mousetracking in FF doesn't drop the panel when moving too quickly
''2006.03.04 [1.0.0]'' Initial public release
<<<
!!!!!Credits
<<<
This feature was developed by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]]
<<<
!!!!!Code
***/
//{{{
version.extensions.moveablePanel= {major: 1, minor: 3, revision: 7, date: new Date(2007,6,10)};
//}}}
//{{{
config.macros.moveablePanel= { 
	handler:
	function(place,macroName,params) {
		var p=this.getPanel(place); if (!p) return;
		var showfold=true; var showhover=true; var showclose=true;
		while (param=params.shift()) {
			if (param.toLowerCase()=="noclose") showclose=false;
			if (param.toLowerCase()=="nofold") showfold=false;
			if (param.toLowerCase()=="nohover") showhover=false;
		}

		// remember original panel event handlers, size, location, border
		if (!p.saved) p.saved= {
			mouseover: p.onmouseover,
			mouseout: p.onmouseout,
			dblclick: p.ondblclick,
			top: p.style.top,
			left: p.style.left,
			width: p.style.width,
			height: p.style.height,
			position: p.style.position,
			border: p.style.border
		};

		// create control menu items
		var menupos=p.className=="floatingPanel"?"float:right;":"position:absolute;right:2em;top:3em;";
		var menustyle=p.className!="floatingPanel"?'style="border:1px solid #666;background:#ccc;color:#000;padding:0px .5em;"':"";
		var html='<div style="font-size:7pt;display:none;'+menupos+'">';
		if (p.className=="floatingPanel" && showfold)
			html+='&nbsp;<a href="javascript:;" title="reduce panel size" '+menustyle
				+' onclick="return config.macros.moveablePanel.foldPanel(this,event)">fold</a> ';
		if (!config.browser.isIE && showhover)
			html+='&nbsp;<a href="javascript:;" title="keep panel in view when scrolling"'+menustyle
				+' onclick="return config.macros.moveablePanel.hoverPanel(this,event)">hover</a> ';
		if (p.className=="floatingPanel") {
			if (showclose) html+='&nbsp;<a href="javascript:;" title="close panel and reset to default size and position"'+menustyle
				+' onclick="return config.macros.moveablePanel.closePanel(this,event)">close</a>';
		} else html+='&nbsp;<a href="javascript:;" title="reset panel to default size and position"'+menustyle
				+' onclick="return config.macros.moveablePanel.closePanel(this,event)">dock</a>';
		html+='</div>';
		p.menudiv=createTiddlyElement(place,"span");
		p.menudiv.innerHTML=html;

		// init mouse handling and tooltip
		p.title="drag edge to move, shift key=stretch, double-click=max/restore";
		if (p.className!="floatingPanel") p.style.border="1px dotted transparent"; // leave space for border around tiddler
		p.onmouseover=function(event) {
			if (this.className=="floatingPanel"||this.style.position=="absolute"||this.style.position=="fixed") {
				if (this.className!="floatingPanel") this.style.border="1px dotted #999"; // show border if over floating tiddler
				this.menudiv.firstChild.style.display="inline";
			}
			if (this.saved.mouseover) return this.saved.mouseover.apply(this,arguments);
		};
		if (p.className=="floatingPanel") p.saved.mouseover=null; // discard previous mouse event handler
		p.onmouseout=function(event) {
			this.menudiv.firstChild.style.display="none";
			if (this.className!="floatingPanel") this.style.border="1px dotted transparent"; // leave space for border around tiddler
			if (this.saved.mouseout) return this.saved.mouseout.apply(this,arguments);
		};
		if (p.className=="floatingPanel") p.saved.mouseout=null; // discard previous mouse event handler
		p.ondblclick=function(event) {
			if (!config.macros.moveablePanel.maximizePanel(this,event)) return false; // processed
			return this.saved.dblclick?this.saved.dblclick.apply(this,arguments):true;
		};
		p.onmousemove=function(event) { return config.macros.moveablePanel.setCursorPanel(this,event); };
		p.onmousedown=function(event) { return config.macros.moveablePanel.moveOrSizePanel(this,event); };
		if (p.className=="floatingPanel" && p.button) // floating slider panel and button
			p.button.onmouseover=null; // prevent automatic trigger of adjustSliderPos() when mouseover on floating slider button
	},

	getPanel:
	function(place) {
		// find a floating panel
		var p=place; while (p && p.className!='floatingPanel') p=p.parentNode; if (p) return p; // floatingPanel
		// or... a containing tiddler
		p=story.findContainingTiddler(place); if (!p || !store.getTiddler(p.getAttribute("tiddler"))) return null; // not in a tiddler
		// moveable tiddler in IE have LOTS of problems... DISABLED FOR NOW...
		if (config.browser.isIE) return null;
		// otherwise return the panel/tiddler
		return p;
	},

	processed:
	function(event) {
		event.cancelBubble=true; if (event.stopPropagation) event.stopPropagation(); return false;
	},

	getClientWidth:
	function() {
		if(document.width!=undefined) return document.width;
		if(document.documentElement && document.documentElement.clientWidth) return document.documentElement.clientWidth;
		if(document.body && document.body.clientWidth) return document.body.clientWidth;
		if(window.innerWidth!=undefined) return window.innerWidth;
		return 100; // should never get here
	},

	closePanel:
	function(place,event) {
		if (!event) var event=window.event;
		var p=this.getPanel(place); if (!p) return true;
		if (p.hover) this.hoverPanel(p.hoverButton,event); 
		if (p.folded) this.foldPanel(p.foldButton,event); 
		p.maxed=false; 
		p.style.top=p.saved.top;
		p.style.left=p.saved.left;
		p.style.width=p.saved.width;
		p.style.height=p.saved.height;
		p.style.position=p.saved.position;
		if (p.button) { p.button.focus(); onClickNestedSlider({target:p.button}); } // click on slider "button" (if any) to close the panel
		return this.processed(event);
	},

	foldPanel:
	function(place,event) {
		if (!event) var event=window.event;
		var p=this.getPanel(place); if (!p) return true;
		if (!p.foldButton) p.foldButton=place;
		if (p.folded) {
			p.style.height=p.folded_savedheight;
			p.style.overflow=p.folded_savedoverflow;
		} else {
			p.folded_savedheight=p.style.height; p.style.height="1em"; 
			p.folded_savedoverflow=p.style.overflow; p.style.overflow="hidden";
		}
		p.folded=!p.folded;
		place.innerHTML=p.folded?"unfold":"fold";
		place.title=p.folded?"restore panel size":"reduce panel size";
		return this.processed(event);
	},

	hoverPanel:
	function(place,event) {
		if (config.browser.isIE) { return this.processed(event); } // 'fixed' position is not handled properly by IE :-(
		if (!event) var event=window.event;
		var p=this.getPanel(place); if (!p) return true;
		if (!p.hoverButton) p.hoverButton=place;
		if (p.hover)
			p.style.position=p.hover_savedposition;
		else
			{ p.hover_savedposition=p.style.position; p.style.position="fixed"; }
		p.hover=!p.hover;
		place.innerHTML=p.hover?"scroll":"hover";
		place.title=p.hover?"make panel move with page when scrolling":"keep panel in view when scrolling page";
		return this.processed(event);
	},

	maximizePanel:
	function(place,event) {
		if (!event) var event=window.event;
		var p=this.getPanel(place); if (!p) return true;
		var left=findPosX(p); var top=findPosY(p);
		var width=p.offsetWidth; var height=p.offsetHeight;
		var x=!config.browser.isIE?event.pageX:event.clientX;
		var y=!config.browser.isIE?event.pageY:event.clientY;
		if (x<left||x>=left+width||y<top||y>=top+height) return true; // not inside panel, let mousedown bubble through
		var edgeWidth=10; var edgeHeight=10;
		var isTop=(y-top<edgeHeight);
		var isLeft=(x-left<edgeWidth);
		var isBottom=(top+height-y<edgeHeight);
		var isRight=(left+width-x<edgeWidth);
		if (!(isTop||isLeft||isBottom||isRight))
			return true; // not near an edge... let double click bubble through
		if (p.folded) this.foldPanel(p.foldButton,event); // unfold panel first (if needed)
		if (p.maxed) {
			p.style.top=p.max_savedtop;
			p.style.left=p.max_savedleft;
			p.style.width=p.max_savedwidth;
			p.style.height=p.max_savedheight;
			p.style.position=p.max_savedposition;
		} else {
			p.max_savedwidth=p.style.width;
			p.max_savedheight=p.style.height;
			p.max_savedtop=p.style.top;
			p.max_savedleft=p.style.left;
			p.max_savedposition=p.style.position;
			// IE gets the percentage stretch wrong if floating panel is inside a table
			p.style.width=config.browser.isIE?(getClientWidth()*0.95+"px"):"95%";
			p.style.height="95%";
			p.style.top=p.style.left='1em';
			p.style.position="absolute";
		}
		p.maxed=!p.maxed;
		return this.processed(event);
	},

	setCursorPanel:
	function(place,event) {
		if (!event) var event=window.event;
		var p=this.getPanel(place); if (!p) return true;
		var left=findPosX(p); var top=findPosY(p);
		var width=p.offsetWidth; var height=p.offsetHeight;
		var x=!config.browser.isIE?event.pageX:event.clientX;
		var y=!config.browser.isIE?event.pageY:event.clientY;
		if (x<left||x>=left+width||y<top||y>=top+height) return true; // not inside panel, let mousedown bubble through
		var edgeWidth=10; var edgeHeight=10;
		var isTop=(y-top<edgeHeight);
		var isLeft=(x-left<edgeWidth);
		var isBottom=(top+height-y<edgeHeight);
		var isRight=(left+width-x<edgeWidth);
		if (!(isTop||isLeft||isBottom||isRight))
			{ p.style.cursor="auto"; if (!p.savedtitle) p.savedtitle=p.title; p.title=""; }
		else {
			p.style.cursor=!event.shiftKey?"move":((isTop?'n':(isBottom?'s':''))+(isLeft?'w':(isRight?'e':''))+'-resize');
			if (p.savedtitle) p.title=p.savedtitle;
		}
		return true; // let mouseover event bubble through
	},

	moveOrSizePanel:
	function(place,event) {
		if (!event) var event=window.event;
		var p=this.getPanel(place); if (!p) return true;
		var left=findPosX(p); var top=findPosY(p);
		var width=p.offsetWidth; var height=p.offsetHeight;
		var x=!config.browser.isIE?event.pageX:event.clientX;
		var y=!config.browser.isIE?event.pageY:event.clientY;
		if (x<left||x>=left+width||y<top||y>=top+height) return true; // not inside panel, let mousedown bubble through
		var edgeWidth=10; var edgeHeight=10;
		var isTop=(y-top<edgeHeight);
		var isLeft=(x-left<edgeWidth);
		var isBottom=(top+height-y<edgeHeight);
		var isRight=(left+width-x<edgeWidth);
		if (!(isTop||isLeft||isBottom||isRight)) return true; // not near an edge... let mousedown bubble through
	
		// when resizing, change cursor to show directional (NSEW) "drag arrows"
		var sizing=event.shiftKey; // remember this for use during mousemove tracking
		if (sizing) p.style.cursor=((isTop?'n':(isBottom?'s':''))+(isLeft?'w':(isRight?'e':''))+'-resize');
	
		var adjustLeft=0; var adjustTop=0;
		var pp=p.parentNode; while (pp && pp.style.position!='relative') pp=parent.parentNode;
		if (pp) { adjustLeft+=findPosX(pp); adjustTop+=findPosY(pp); }
		var pp=p.parentNode; while (pp && pp.className!="floatingPanel") pp=pp.parentNode;
		if (pp) { adjustLeft+=findPosX(pp); adjustTop+=findPosY(pp); }
	
		// start tracking mousemove events
		config.macros.moveablePanel.activepanel=p;
		var target=p; // if 'capture' handling not supported, track within panel only
		if (document.body.setCapture) { document.body.setCapture(); var target=document.body; } // IE
		if (window.captureEvents) { window.captureEvents(Event.MouseMove|Event.MouseUp,true); var target=window; } // moz
		if (target.onmousemove!=undefined) target.saved_mousemove=target.onmousemove;
		target.onmousemove=function(e){
			if (!e) var e=window.event;
			var p=config.macros.moveablePanel.activepanel;
			if (!p) { this.onmousemove=this.saved_mousemove?this.saved_mousemove:null; return; }
	
			// PROBLEM: p.offsetWidth and p.offsetHeight do not seem to account for padding or borders
			// WORKAROUND: subtract padding and border (in px) when calculating new panel width and height
			// TBD: get these values from p.style... convert to px as needed.
			var paddingWidth=10.6667; var paddingHeight=10.6667;
			var borderWidth=1; var borderHeight=1;
			var adjustWidth=-(paddingWidth*2+borderWidth*2);
			var adjustHeight=-(paddingHeight*2+borderHeight*2);
	
			if (p.style.position!="absolute") { // convert relative DIV to movable absolute DIV
				p.style.position="absolute";
				p.style.left=left+"px"; p.style.top=top+"px";
				p.style.width=(width+adjustWidth)+"px"; p.style.top=(height+adjustHeight)+"px";
			}
			var newX=!config.browser.isIE?e.pageX:e.clientX;
			var newY=!config.browser.isIE?e.pageY:e.clientY;
			if (sizing) { // resize panel
				// don't let panel get smaller than edge "grab" zones
				var minWidth=edgeWidth*2-adjustWidth;
				var minHeight=edgeHeight*2-adjustHeight;
				p.maxed=false; // make sure panel is not maximized
				if (p.folded) this.foldPanel(p.foldButton,e); // make sure panel is unfolded
				if (isBottom) var newHeight=height+newY-y+1;
				if (isTop) var newHeight=height-newY+y+1;
				if (isLeft) var newWidth=width-newX+x+1;
				if (isRight) var newWidth=width+newX-x+1;
				if (isLeft||isRight) p.style.width=(newWidth>minWidth?newWidth:minWidth)+adjustWidth+"px";
				if (isLeft) p.style.left=left-adjustLeft+newX-x+1+"px";
				if (isTop||isBottom) p.style.height=(newHeight>minHeight?newHeight:minHeight)+adjustHeight+"px";
				if (isTop) p.style.top=top-adjustTop+newY-y+1+"px";
			} else { // move panel
				p.style.top=top-adjustTop+newY-y+1+"px";
				p.style.left=left-adjustLeft+newX-x+1+"px";
			}
			var status=sizing?("size: "+p.style.width+","+p.style.height):("pos: "+p.style.left+","+p.style.top);
			window.status=status.replace(/(\.[0-9]+)|px/g,""); // remove decimals and "px"
			return config.macros.moveablePanel.processed(e);
		};
	
		// stop tracking mousemove events
		if (target.onmouseup!=undefined) target.saved_mouseup=target.onmouseup;
		target.onmouseup=function(e){
			if (!e) var e=window.event;
			if (this.releaseCapture) this.releaseCapture(); // IE
			if (this.releaseEvents) this.releaseEvents(Event.MouseMove|Event.MouseUp); // moz
			this.onmousemove=this.saved_mousemove?this.saved_mousemove:null;
			this.onmouseup=this.saved_mouseup?this.saved_mouseup:null;
			config.macros.moveablePanel.activepanel=null;
			window.status="";
			return config.macros.moveablePanel.processed(e);
		};
		return this.processed(event); // mousedown handled
	}
};
//}}}
<!--{{{-->
<!--- http://mptw.tiddlyspot.com/#MptwEditTemplate ($Rev: 1829 $) --->
<div class="toolbar" macro="toolbar +saveTiddler saveCloseTiddler -cancelTiddler deleteTiddler"></div>
<div macro='tiddler QuickEditToolbar'></div>
<div class="title" macro="view title"></div>
<div class="editLabel">Title</div><div class="editor" macro="edit title"></div>
<div class="editLabel">Tags</div><div class="editor" macro="edit tags"></div>
<div class="editorFooter"><span macro="message views.editor.tagPrompt"></span><span macro="tagChooser"></span></div>
<div macro="showWhenExists EditPanelTemplate">[[EditPanelTemplate]]</div>
<div class="editor" macro="edit text"></div>
<!--}}}-->
/***
| Name|MptwLayoutPlugin|
| Description|A package containing templates and css for the MonkeyPirateTiddlyWiki layout|
| Version|3.0 ($Rev: 1845 $)|
| Source|http://mptw.tiddlyspot.com/#MptwLayoutPlugin|
| Author|Simon Baird <simon.baird@gmail.com>|
| License|http://mptw.tiddlyspot.com/#TheBSDLicense|
!Notes
Presumes you have TagglyTaggingPlugin installed. To enable this you should have a PageTemplate containing {{{[[MptwPageTemplate]]}}} and similar for ViewTemplate and EditTemplate.
***/
//{{{
// used in MptwViewTemplate
config.mptwDateFormat = 'DD/MM/YY';
config.mptwJournalFormat = 'Journal DD/MM/YY';
//config.mptwDateFormat = 'MM/0DD/YY';
//config.mptwJournalFormat = 'Journal MM/0DD/YY';

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

//}}}

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

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

'MptwPageTemplate':[
 "<!--{{{-->",
 "<!-- http://mptw.tiddlyspot.com/#MptwPageTemplate ($Rev: 1829 $) -->",
 "<div class='header' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>",
 "	<div class='headerShadow'>",
 "		<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;",
 "		<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>",
 "	</div>",
 "	<div class='headerForeground'>",
 "		<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;",
 "		<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>",
 "	</div>",
 "</div>",
 "<!-- horizontal MainMenu -->",
 "<div id='topMenu' refresh='content' tiddler='MainMenu'></div>",
 "<!-- original MainMenu menu -->",
 "<!-- <div id='mainMenu' refresh='content' tiddler='MainMenu'></div> -->",
 "<div id='sidebar'>",
 "	<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>",
 "	<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>",
 "</div>",
 "<div id='displayArea'>",
 "	<div id='messageArea'></div>",
 "	<div id='tiddlerDisplay'></div>",
 "</div>",
 "<!--}}}-->"
].join("\n"),

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

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

});
//}}}
<!--{{{-->
<!-- http://mptw.tiddlyspot.com/#MptwPageTemplate ($Rev: 1829 $) -->
<div class='header' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>
	<div class='headerShadow'>
		<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
		<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
	</div>
	<div class='headerForeground'>
		<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
		<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
	</div>
</div>
<!-- horizontal MainMenu -->
<div id='topMenu' refresh='content' tiddler='MainMenu'></div>
<!-- original MainMenu menu -->
<!-- <div id='mainMenu' refresh='content' tiddler='MainMenu'></div> -->
<div id='sidebar'>
	<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
	<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
	<div id='messageArea'></div>
<div id='tiddlersBar'></div>
	<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
/*{{{*/
/* http://mptw.tiddlyspot.com/#MptwStyleSheet ($Rev: 2246 $) */

/* a contrasting background so I can see where one tiddler ends and the other begins */
body {
	background: [[ColorPalette::TertiaryLight]];
}

/* sexy colours and font for the header */
.headerForeground {
	color: [[ColorPalette::PrimaryPale]];
}
.headerShadow, .headerShadow a {
	color: [[ColorPalette::PrimaryMid]];
}

/* separate the top menu parts */
.headerForeground, .headerShadow {
	padding: 1em 1em 0;
}

.headerForeground, .headerShadow {
	font-family: 'Trebuchet MS' sans-serif;
	font-weight:bold;
}
.headerForeground .siteSubtitle {
	color: [[ColorPalette::PrimaryLight]];
}
.headerShadow .siteSubtitle {
	color: [[ColorPalette::PrimaryMid]];
}

/* make shadow go and down right instead of up and left */
.headerShadow {
	left: 1px;
	top: 1px;
}

/* prefer monospace for editing */
.editor textarea {
	font-family: 'Consolas' monospace;
	font-size: 1.2em;
        line-height: 1.4em;
}

/* sexy tiddler titles */
.title {
	font-size: 100%;
	color: [[ColorPalette::PrimaryLight]];
	font-family: 'Trebuchet MS' sans-serif;
}

/* more subtle tiddler subtitle */
.subtitle {
	padding:0px;
	margin:0px;
	padding-left:0.5em;
	font-size: 20%;
	color: [[ColorPalette::TertiaryMid]];
}
.subtitle .tiddlyLink {
	color: [[ColorPalette::TertiaryMid]];
}

/* a little bit of extra whitespace */
.viewer {
	padding-top: 0px;
	padding-bottom: 7px;
	font-size: 1.2em;
        line-height: 1.4em;
}

/* don't want any background color for headings */
h1,h2,h3,h4,h5,h6 {
	background: [[ColorPalette::Background]];
	color: [[ColorPalette::Foreground]];
}

/* give tiddlers 3d style border and explicit background */
.tiddler {
	background: [[ColorPalette::Background]];
	/*border-right: 2px [[ColorPalette::TertiaryMid]] solid;*/
	/*border-bottom: 2px [[ColorPalette::TertiaryMid]] solid;*/
	margin-bottom: 0em;
	padding-bottom: 0em;
	padding-top: 0em;
}

/* make options slider look nicer */
#sidebarOptions .sliderPanel {
	border:solid 1px [[ColorPalette::PrimaryLight]];
}

/* the borders look wrong with the body background */
#sidebar .button {
	border-style: none;
}

/* this means you can put line breaks in SidebarOptions for readability */
#sidebarOptions br {
	display:none;
}
/* undo the above in OptionsPanel */
#sidebarOptions .sliderPanel br {
	display:inline;
}

/* horizontal main menu stuff */
#displayArea {
	margin: 1em 15.7em 0em 1em; /* use the freed up space */
}
#topMenu br {
	display: none;
}
#topMenu {
	background: [[ColorPalette::PrimaryMid]];
	color:[[ColorPalette::PrimaryPale]];
}
#topMenu {
	padding:2px;
}
#topMenu .button, #topMenu .tiddlyLink, #topMenu a {
	margin-left: 0.5em;
	margin-right: 0.5em;
	padding-left: 3px;
	padding-right: 3px;
	color: [[ColorPalette::PrimaryPale]];
	font-size: 115%;
}
#topMenu .button:hover, #topMenu .tiddlyLink:hover {
	background: [[ColorPalette::PrimaryDark]];
}

/* make 2.2 act like 2.1 with the invisible buttons */
.toolbar {
	visibility:hidden;
}
.selected .toolbar {
	visibility:visible;
}

/* experimental. this is a little borked in IE7 with the button 
 * borders but worth it I think for the extra screen realestate */
.toolbar { float:right; }

/* for Tagger Plugin, thanks sb56637 */
.popup li a {
   display:inline;
}

/* make it print a little cleaner */
@media print {
	#topMenu {
		display: none ! important;
	}
	/* not sure if we need all the importants */
	.tiddler {
		border-style: none ! important;
		margin:0px ! important;
		padding:0px ! important;
		padding-bottom:2em ! important;
	}
	.tagglyTagging .button, .tagglyTagging .hidebutton {
		display: none ! important;
	}
	.headerShadow {
		visibility: hidden ! important;
	}
	.tagglyTagged .quickopentag, .tagged .quickopentag {
		border-style: none ! important;
	}
	.quickopentag a.button, .miniTag {
		display: none ! important;
	}
}
/*}}}*/
For upgrading directly from tiddlyspot. See [[ImportTiddlers]].
URL: /proxy/mptw.tiddlyspot.com/upgrade.html
For upgrading. See [[ImportTiddlers]].
URL: http://mptw.tiddlyspot.com/upgrade.html
<!--{{{-->
<!--- http://mptw.tiddlyspot.com/#MptwViewTemplate ($Rev: 2247 $) --->

<div class='toolbar'>
	<span macro="showWhenTagged systemConfig">
		<span macro="toggleTag systemConfigDisable . '[[disable|systemConfigDisable]]'"></span>
	</span>
	<span macro="showWhenTagged palette">
		<span macro="setPalette"></span>
	</span>
	<span style="padding:1em;"></span>
	<span macro='toolbar closeTiddler closeOthers +editTiddler deleteTiddler > fields syncing permalink references jump'></span> <span macro='newHere label:"new here"'></span>
	<span macro='newJournalHere {{config.mptwJournalFormat?config.mptwJournalFormat:"MM/0DD/YY"}}'></span>
</div>



<div class='titleContainer'>
	<span class='title' macro='view title'></span>
	<span macro="miniTag"></span>
</div>


<div macro="showWhenExists ViewPanelTemplate">[[ViewPanelTemplate]]</div>

<div macro="hideWhen tiddler.tags.containsAny(['css','html','pre','systemConfig']) && !tiddler.text.match('{{'+'{')">
	<div class='viewer' macro='view text wikified'></div>
</div>
<div macro="showWhen tiddler.tags.containsAny(['css','html','pre','systemConfig']) && !tiddler.text.match('{{'+'{')">
	<div class='viewer'><pre macro='view text'></pre></div>
</div>

<div macro="showWhenExists ViewDashboardTemplate">[[ViewDashboardTemplate]]</div>


<!--}}}-->
summary:


theme:


What did you notice looking at:
Who (are the key people?)

What

when

where

why

how

what did you learn from commentaries?
/***
|Name|NestedSlidersPlugin|
|Source|http://www.TiddlyTools.com/#NestedSlidersPlugin|
|Version|2.3.1|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <<br>>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|Slider.prototype.stop|
|Description|show content in nest-able 'slider' or 'floating' panels, without needing to create separate tiddlers for each panel|

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

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

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

//Note: to make slider definitions easier to read and recognize when editing a tiddler, newlines immediately following the {{{+++}}} 'start slider' or preceding the {{{===}}} 'end slider' sequence are automatically supressed so that excess whitespace is eliminated from the output.//
<<<
!!!!!Examples
<<<
simple in-line slider: 
{{{
+++
   content
===
}}}
+++
   content
===
----
use a custom label and tooltip: 
{{{
+++[label|tooltip]
   content
===
}}}
+++[label|tooltip]
   content
===
----
content automatically blockquoted: 
{{{
+++>
   content
===
}}}
+++>
   content
===
----
all options combined //(default open, cookie, heading, sized floater, transient, class, label/tooltip/key, blockquoted, deferred)//
{{{
++++(testcookie)!!!^30em^*{{big{[label=Z|click or press Alt-Z to open]}}}>...
   content
===
}}}
++++(testcookie)!!!^30em^*{{big{[label=Z|click or press Alt-Z to open]}}}>...
   content
===
----
complex nesting example:
{{{
+++[get info...=I|click for information or press Alt-I]
	put some general information here,
	plus a floating panel with more specific info:
	+++^10em^[view details...|click for details]
		put some detail here, which could in turn contain a transient panel,
		perhaps with a +++^25em^*[glossary definition]explaining technical terms===
	===
===
}}}
+++[get info...=I|click for information or press Alt-I]
	put some general information here,
	plus a floating panel with more specific info:
	+++^10em^[view details...|click for details]
		put some detail here, which could in turn contain a transient panel,
		perhaps with a +++^25em^*[glossary definition]explaining technical terms===
	===
===
<<<
!!!!!Installation
<<<
import (or copy/paste) the following tiddlers into your document:
''NestedSlidersPlugin'' (tagged with <<tag systemConfig>>)
<<<
!!!!!Revision History
<<<
''2007.07.26 - 2.3.1'' in document.onclick(), propagate return value from hijacked core click handler to consume OR bubble up click as needed.  Fixes "IE click disease", whereby nearly every mouse click causes a page transition.
''2007.07.20 - 2.3.0'' added syntax for setting panel ID (#panelID:).  This allows individual slider panels to be repositioned within tiddler content simply by giving them a unique ID and then moving them to the desired location using the {{{<<DOM move id>>}}} macro.
''2007.07.19 - 2.2.0'' added syntax for alttext and alttip (button label and tooltip to be displayed when panel is open)
''2007.07.14 - 2.1.2'' corrected use of 'transient' attribute in IE to prevent (non-recursive) infinite loop
''2007.07.12 - 2.1.0'' replaced use of "*" for 'open/close on rollover' (which didn't work too well).  "*" now indicates 'transient' panels that are automatically closed if a click occurs somewhere else in the document.  This permits use of nested sliders to create nested "pulldown menus" that automatically disappear after interaction with them has been completed.  Also, in onClickNestedSlider(), use "theTarget.sliderCookie", instead of "this.sliderCookie" to correct cookie state tracking when automatically dismissing transient panels.
''2007.06.10 - 2.0.5'' add check to ensure that window.adjustSliderPanel() is defined before calling it (prevents error on shutdown when mouse event handlers are still defined)
''2007.05.31 - 2.0.4'' add handling to invoke adjustSliderPanel() for onmouseover events on slider button and panel.  This allows the panel position to be re-synced when the button position shifts due to changes in unrelated content above it on the page.  (thanks to Harsha for bug report)
''2007.03.30 - 2.0.3'' added chkFloatingSlidersAnimate (default to FALSE), so that slider animation can be disabled independent of the overall document animation setting (avoids strange rendering and focus problems in floating panels)
''2007.03.01 - 2.0.2'' for TW2.2+, hijack Morpher.prototype.stop so that "overflow:hidden" can be reset to "overflow:visible" after animation ends
''2007.03.01 - 2.0.1'' in hijack for Slider.prototype.stop, use apply() to pass params to core function
|please see [[NestedSlidersPluginHistory]] for additional revision details|
''2005.11.03 - 1.0.0'' initial public release
<<<
!!!!!Credits
<<<
This feature was implemented by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]] with initial research and suggestions from RodneyGomes, GeoffSlocock, and PaulPetterson.
<<<
!!!!!Code
***/
//{{{
version.extensions.nestedSliders = {major: 2, minor: 3, revision: 1, date: new Date(2007,7,26)};
//}}}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// TW2.2+
// hijack Morpher animation handler 'stop' handler so overflow is visible after animation has completed
if (version.major+.1*version.minor+.01*version.revision>=2.2) {
	Morpher.prototype.coreStop = Morpher.prototype.stop;
	Morpher.prototype.stop = function()
		{ this.coreStop.apply(this,arguments); this.element.style.overflow = "visible"; }
}
//}}}
/***
| Name:|NewHerePlugin|
| Description:|Creates the new here and new journal macros|
| Version:|3.0 ($Rev: 1845 $)|
| Date:|$Date: 2007-03-16 15:19:22 +1000 (Fri, 16 Mar 2007) $|
| 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.0 ($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|
***/
//{{{

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.getName = function(newName) {
       while (store.getTiddler(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;
};

//}}}

/***
|''Name:''|OpenTiddlersMacro|
|''Description:''|Create links that open multiple tiddlers. Optionally close all other tiddlers first.|
|''Author:''|Saq Imtiaz ( lewcid@gmail.com )|
|''Source:''|http://tw.lewcid.org/#OpenTiddlersMacro|
|''Code Repository:''|http://tw.lewcid.org/svn/plugins|
|''Version:''|2.0|
|''Date:''||
|''License:''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''~CoreVersion:''|2.2.3|
!!Usage:
* {{{<<openTiddlers text:"click" tiddlers:[[TiddlerOne TiddlerTwo "Tiddler Three"]]>>}}}
** text: text for the link.
** tiddlers: titles of tiddlers to open, as a bracketed list.
* Additional optional parameters:
** {{{<<openTiddlers text:"click" tiddlers:[[TiddlerOne TiddlerTwo "Tiddler Three"]] closeAll:true keepMe:false>>}}}
*** closeAll: close all other tiddlers first
*** keepMe : close all other tiddlers, except the one containing the macro
!!Tip:
* You can use evaluated parameters to get a list of tiddlers to open from a tiddler.
** For example to open the DefaultTiddlers for a  "Home" button: <br> {{{<<openTiddlers text:"Home" tiddlers:{{store.getTiddlerText("DefaultTiddlers")}} closeAll:true>>}}} <br>  <<openTiddlers text:"Home" tiddlers:{{store.getTiddlerText("DefaultTiddlers")}} closeAll:true>>

***/
// /%
//!BEGIN-PLUGIN-CODE
config.macros.openTiddlers = 
{
	handler : function(place,macroName,params,wikifier,paramString,tiddler)
	{
		var np = paramString.parseParams("anon",null,true,false,false);
		var text = getParam(np,"text","");
		var tiddlers = getParam(np,"tiddlers","");
		if (tiddlers == ''){
			return false;
		}
		if (typeof tiddlers == 'string' ){
			tiddlers = tiddlers.readBracketedList();
		}
		var closeAll = getParam(np,"closeAll","false");
		var keepMe = getParam(np,"keepMe","false");
		var btn= createTiddlyButton(place,text,null,this.onClick,"tiddlyLinkExisting");
		btn.tiddlers = tiddlers;
		btn.tiddler = tiddler? tiddler.title: undefined;
		btn.closeAll = closeAll;
		btn.keepMe = keepMe;
	},
	onClick: function(e)
	{
		var exclude = (this.keepMe == "true")? this.tiddler : undefined;
		var tiddlers = this.tiddlers;
		if(this.closeAll == 'true'){
			story.closeAllTiddlers(exclude);
			tiddlers = (this.keepMe == "true")? tiddlers: tiddlers.reverse();
		}
		story.displayTiddlers(this,this.tiddlers);
		return(false);
	}
};
//!END-PLUGIN-CODE
// %/
[[MptwPageTemplate]]
/***
|<html><a name="Top"/></html>''Name:''|PartTiddlerPlugin|
|''Version:''|1.0.9 (2007-07-14)|
|''Source:''|http://tiddlywiki.abego-software.de/#PartTiddlerPlugin|
|''Author:''|UdoBorkowski (ub [at] abego-software [dot] de)|
|''Licence:''|[[BSD open source license]]|
|''CoreVersion:''|2.1.3|
|''Browser:''|Firefox 1.0.4+; InternetExplorer 6.0|
!Table of Content<html><a name="TOC"/></html>
* <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Description',null, event)">Description, Syntax</a></html>
* <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Applications',null, event)">Applications</a></html>
** <html><a href="javascript:;" onclick="window.scrollAnchorVisible('LongTiddler',null, event)">Refering to Paragraphs of a Longer Tiddler</a></html>
** <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Citation',null, event)">Citation Index</a></html>
** <html><a href="javascript:;" onclick="window.scrollAnchorVisible('TableCells',null, event)">Creating "multi-line" Table Cells</a></html>
** <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Tabs',null, event)">Creating Tabs</a></html>
** <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Sliders',null, event)">Using Sliders</a></html>
* <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Revisions',null, event)">Revision History</a></html>
* <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Code',null, event)">Code</a></html>
!Description<html><a name="Description"/></html>
With the {{{<part aPartName> ... </part>}}} feature you can structure your tiddler text into separate (named) parts. 
Each part can be referenced as a "normal" tiddler, using the "//tiddlerName//''/''//partName//" syntax (e.g. "About/Features").  E.g. you may create links to the parts (e.g. {{{[[Quotes/BAX95]]}}} or {{{[[Hobbies|AboutMe/Hobbies]]}}}), use it in {{{<<tiddler...>>}}} or {{{<<tabs...>>}}} macros etc.


''Syntax:'' 
|>|''<part'' //partName// [''hidden''] ''>'' //any tiddler content// ''</part>''|
|//partName//|The name of the part. You may reference a part tiddler with the combined tiddler name "//nameOfContainerTidder//''/''//partName//. <<br>>If you use a partName containing spaces you need to quote it (e.g. {{{"Major Overview"}}} or {{{[[Shortcut List]]}}}).|
|''hidden''|When defined the content of the part is not displayed in the container tiddler. But when the part is explicitly referenced (e.g. in a {{{<<tiddler...>>}}} macro or in a link) the part's content is displayed.|
|<html><i>any&nbsp;tiddler&nbsp;content</i></html>|<html>The content of the part.<br>A part can have any content that a "normal" tiddler may have, e.g. you may use all the formattings and macros defined.</html>|
|>|~~Syntax formatting: Keywords in ''bold'', optional parts in [...]. 'or' means that exactly one of the two alternatives must exist.~~|
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>

!Applications<html><a name="Applications"/></html>
!!Refering to Paragraphs of a Longer Tiddler<html><a name="LongTiddler"/></html>
Assume you have written a long description in a tiddler and now you want to refer to the content of a certain paragraph in that tiddler (e.g. some definition.) Just wrap the text with a ''part'' block, give it a nice name, create a "pretty link" (like {{{[[Discussion Groups|Introduction/DiscussionGroups]]}}}) and you are done.

Notice this complements the approach to first writing a lot of small tiddlers and combine these tiddlers to one larger tiddler in a second step (e.g. using the {{{<<tiddler...>>}}} macro). Using the ''part'' feature you can first write a "classic" (longer) text that can be read "from top to bottom" and later "reuse" parts of this text for some more "non-linear" reading.

<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>

!!Citation Index<html><a name="Citation"/></html>
Create a tiddler "Citations" that contains your "citations". 
Wrap every citation with a part and a proper name. 

''Example''
{{{
<part BAX98>Baxter, Ira D. et al: //Clone Detection Using Abstract Syntax Trees.// 
in //Proc. ICSM//, 1998.</part>

<part BEL02>Bellon, Stefan: //Vergleich von Techniken zur Erkennung duplizierten Quellcodes.// 
Thesis, Uni Stuttgart, 2002.</part>

<part DUC99>Ducasse, Stéfane et al: //A Language Independent Approach for Detecting Duplicated Code.// 
in //Proc. ICSM//, 1999.</part>
}}}

You may now "cite" them just by using a pretty link like {{{[[Citations/BAX98]]}}} or even more pretty, like this {{{[[BAX98|Citations/BAX98]]}}}.

<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>

!!Creating "multi-line" Table Cells<html><a name="TableCells"/></html>
You may have noticed that it is hard to create table cells with "multi-line" content. E.g. if you want to create a bullet list inside a table cell you cannot just write the bullet list
{{{
* Item 1
* Item 2
* Item 3
}}}
into a table cell (i.e. between the | ... | bars) because every bullet item must start in a new line but all cells of a table row must be in one line.

Using the ''part'' feature this problem can be solved. Just create a hidden part that contains the cells content and use a {{{<<tiddler >>}}} macro to include its content in the table's cell.

''Example''
{{{
|!Subject|!Items|
|subject1|<<tiddler ./Cell1>>|
|subject2|<<tiddler ./Cell2>>|

<part Cell1 hidden>
* Item 1
* Item 2
* Item 3
</part>
...
}}}

Notice that inside the {{{<<tiddler ...>>}}} macro you may refer to the "current tiddler" using the ".".

BTW: The same approach can be used to create bullet lists with items that contain more than one line.

<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>

!!Creating Tabs<html><a name="Tabs"/></html>
The build-in {{{<<tabs ...>>}}} macro requires that you defined an additional tiddler for every tab it displays. When you want to have "nested" tabs you need to define a tiddler for the "main tab" and one for every tab it contains. I.e. the definition of a set of tabs that is visually displayed at one place is distributed across multiple tiddlers.

With the ''part'' feature you can put the complete definition in one tiddler, making it easier to keep an overview and maintain the tab sets.

''Example''
The standard tabs at the sidebar are defined by the following eight tiddlers:
* SideBarTabs
* TabAll
* TabMore
* TabMoreMissing
* TabMoreOrphans
* TabMoreShadowed
* TabTags
* TabTimeline

Instead of these eight tiddlers one could define the following SideBarTabs tiddler that uses the ''part'' feature:
{{{
<<tabs txtMainTab 
    Timeline Timeline SideBarTabs/Timeline 
    All 'All tiddlers' SideBarTabs/All 
    Tags 'All tags' SideBarTabs/Tags 
    More 'More lists' SideBarTabs/More>>
<part Timeline hidden><<timeline>></part>
<part All hidden><<list all>></part>
<part Tags hidden><<allTags>></part>
<part More hidden><<tabs txtMoreTab 
    Missing 'Missing tiddlers' SideBarTabs/Missing 
    Orphans 'Orphaned tiddlers' SideBarTabs/Orphans 
    Shadowed 'Shadowed tiddlers' SideBarTabs/Shadowed>></part>
<part Missing hidden><<list missing>></part>
<part Orphans hidden><<list orphans>></part>
<part Shadowed hidden><<list shadowed>></part>
}}}

Notice that you can easily "overwrite" individual parts in separate tiddlers that have the full name of the part.

E.g. if you don't like the classic timeline tab but only want to see the 100 most recent tiddlers you could create a tiddler "~SideBarTabs/Timeline" with the following content:
{{{
<<forEachTiddler 
		sortBy 'tiddler.modified' descending 
		write '(index < 100) ? "* [["+tiddler.title+"]]\n":""'>>
}}}
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>

!!Using Sliders<html><a name="Sliders"/></html>
Very similar to the build-in {{{<<tabs ...>>}}} macro (see above) the {{{<<slider ...>>}}} macro requires that you defined an additional tiddler that holds the content "to be slid". You can avoid creating this extra tiddler by using the ''part'' feature

''Example''
In a tiddler "About" we may use the slider to show some details that are documented in the tiddler's "Details" part.
{{{
...
<<slider chkAboutDetails About/Details details "Click here to see more details">>
<part Details hidden>
To give you a better overview ...
</part>
...
}}}

Notice that putting the content of the slider into the slider's tiddler also has an extra benefit: When you decide you need to edit the content of the slider you can just doubleclick the content, the tiddler opens for editing and you can directly start editing the content (in the part section). In the "old" approach you would doubleclick the tiddler, see that the slider is using tiddler X, have to look for the tiddler X and can finally open it for editing. So using the ''part'' approach results in a much short workflow.

<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>

!Revision history<html><a name="Revisions"/></html>
* v1.0.9 (2007-07-14)
** Bugfix: Error when using the SideBarTabs example and switching between "More" and "Shadow". Thanks to cmari for reporting the issue.
* v1.0.8 (2007-06-16)
** Speeding up display of tiddlers containing multiple pard definitions. Thanks to Paco Rivière for reporting the issue.
** Support "./partName" syntax inside <<tabs ...>> macro
* v1.0.7 (2007-03-07)
** Bugfix: <<tiddler "./partName">> does not always render correctly after a refresh (e.g. like it happens when using the "Include" plugin). Thanks to Morris Gray for reporting the bug.
* v1.0.6 (2006-11-07)
** Bugfix: cannot edit tiddler when UploadPlugin by Bidix is installed. Thanks to José Luis González Castro for reporting the bug.
* v1.0.5 (2006-03-02)
** Bugfix: Example with multi-line table cells does not work in IE6. Thanks to Paulo Soares for reporting the bug.
* v1.0.4 (2006-02-28)
** Bugfix: Shadow tiddlers cannot be edited (in TW 2.0.6). Thanks to Torsten Vanek for reporting the bug.
* v1.0.3 (2006-02-26)
** Adapt code to newly introduced Tiddler.prototype.isReadOnly() function (in TW 2.0.6). Thanks to Paulo Soares for reporting the problem.
* v1.0.2 (2006-02-05)
** Also allow other macros than the "tiddler" macro use the "." in the part reference (to refer to "this" tiddler)
* v1.0.1 (2006-01-27)
** Added Table of Content for plugin documentation. Thanks to RichCarrillo for suggesting.
** Bugfix: newReminder plugin does not work when PartTiddler is installed. Thanks to PauloSoares for reporting.
* v1.0.0 (2006-01-25)
** initial version
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>

!Code<html><a name="Code"/></html>
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>
***/
//{{{
//============================================================================
//                           PartTiddlerPlugin

// Ensure that the PartTiddler Plugin is only installed once.
//
if (!version.extensions.PartTiddlerPlugin) {



version.extensions.PartTiddlerPlugin = {
    major: 1, minor: 0, revision: 9,
    date: new Date(2007, 6, 14), 
    type: 'plugin',
    source: "http://tiddlywiki.abego-software.de/#PartTiddlerPlugin"
};

if (!window.abego) window.abego = {};
if (version.major < 2) alertAndThrow("PartTiddlerPlugin requires TiddlyWiki 2.0 or newer.");

//============================================================================
// Common Helpers

// Looks for the next newline, starting at the index-th char of text. 
//
// If there are only whitespaces between index and the newline 
// the index behind the newline is returned, 
// otherwise (or when no newline is found) index is returned.
//
var skipEmptyEndOfLine = function(text, index) {
	var re = /(\n|[^\s])/g;
	re.lastIndex = index;
	var result = re.exec(text);
	return (result && text.charAt(result.index) == '\n') 
			? result.index+1
			: index;
}


//============================================================================
// Constants

var partEndOrStartTagRE = /(<\/part>)|(<part(?:\s+)((?:[^>])+)>)/mg;
var partEndTagREString = "<\\/part>";
var partEndTagString = "</part>";

//============================================================================
// Plugin Specific Helpers

// Parse the parameters inside a <part ...> tag and return the result.
//
// @return [may be null] {partName: ..., isHidden: ...}
//
var parseStartTagParams = function(paramText) {
	var params = paramText.readMacroParams();
	if (params.length == 0 || params[0].length == 0) return null;
	
	var name = params[0];
	var paramsIndex = 1;
	var hidden = false;
	if (paramsIndex < params.length) {
		hidden = params[paramsIndex] == "hidden";
		paramsIndex++;
	}
	
	return {
		partName: name, 
		isHidden: hidden
	};
}

// Returns the match to the next (end or start) part tag in the text, 
// starting the search at startIndex.
// 
// When no such tag is found null is returned, otherwise a "Match" is returned:
// [0]: full match
// [1]: matched "end" tag (or null when no end tag match)
// [2]: matched "start" tag (or null when no start tag match)
// [3]: content of start tag (or null if no start tag match)
//
var findNextPartEndOrStartTagMatch = function(text, startIndex) {
	var re = new RegExp(partEndOrStartTagRE);
	re.lastIndex = startIndex;
	var match = re.exec(text);
	return match;
}

//============================================================================
// Formatter

// Process the <part ...> ... </part> starting at (w.source, w.matchStart) for formatting.
//
// @return true if a complete part section (including the end tag) could be processed, false otherwise.
//
var handlePartSection = function(w) {
	var tagMatch = findNextPartEndOrStartTagMatch(w.source, w.matchStart);
	if (!tagMatch) return false;
	if (tagMatch.index != w.matchStart || !tagMatch[2]) return false;

	// Parse the start tag parameters
	var arguments = parseStartTagParams(tagMatch[3]);
	if (!arguments) return false;
	
	// Continue processing
	var startTagEndIndex = skipEmptyEndOfLine(w.source, tagMatch.index + tagMatch[0].length);
	var endMatch = findNextPartEndOrStartTagMatch(w.source, startTagEndIndex);
	if (endMatch && endMatch[1]) {
		if (!arguments.isHidden) {
			w.nextMatch = startTagEndIndex;
			w.subWikify(w.output,partEndTagREString);
		}
		w.nextMatch = skipEmptyEndOfLine(w.source, endMatch.index + endMatch[0].length);
		
		return true;
	}
	return false;
}

config.formatters.push( {
    name: "part",
    match: "<part\\s+[^>]+>",
	
	handler: function(w) {
		if (!handlePartSection(w)) {
			w.outputText(w.output,w.matchStart,w.matchStart+w.matchLength);
		}
	}
} )

//============================================================================
// Extend "fetchTiddler" functionality to also recognize "part"s of tiddlers 
// as tiddlers.

var currentParent = null; // used for the "." parent (e.g. in the "tiddler" macro)

// Return the match to the first <part ...> tag of the text that has the
// requrest partName.
//
// @return [may be null]
//
var findPartStartTagByName = function(text, partName) {
	var i = 0;
	
	while (true) {
		var tagMatch = findNextPartEndOrStartTagMatch(text, i);
		if (!tagMatch) return null;

		if (tagMatch[2]) {
			// Is start tag
	
			// Check the name
			var arguments = parseStartTagParams(tagMatch[3]);
			if (arguments && arguments.partName == partName) {
				return tagMatch;
			}
		}
		i = tagMatch.index+tagMatch[0].length;
	}
}

// Return the part "partName" of the given parentTiddler as a "readOnly" Tiddler 
// object, using fullName as the Tiddler's title. 
//
// All remaining properties of the new Tiddler (tags etc.) are inherited from 
// the parentTiddler.
// 
// @return [may be null]
//
var getPart = function(parentTiddler, partName, fullName) {
	var text = parentTiddler.text;
	var startTag = findPartStartTagByName(text, partName);
	if (!startTag) return null;
	
	var endIndexOfStartTag = skipEmptyEndOfLine(text, startTag.index+startTag[0].length);
	var indexOfEndTag = text.indexOf(partEndTagString, endIndexOfStartTag);

	if (indexOfEndTag >= 0) {
		var partTiddlerText = text.substring(endIndexOfStartTag,indexOfEndTag);
		var partTiddler = new Tiddler();
		partTiddler.set(
						fullName,
						partTiddlerText,
						parentTiddler.modifier,
						parentTiddler.modified,
						parentTiddler.tags,
						parentTiddler.created);
		partTiddler.abegoIsPartTiddler = true;
		return partTiddler;
	}
	
	return null;
}

// Hijack the store.fetchTiddler to recognize the "part" addresses.
//
var hijackFetchTiddler = function() {
	var oldFetchTiddler = store.fetchTiddler ;
	store.fetchTiddler = function(title) {
		var result = oldFetchTiddler.apply(this, arguments);
		if (!result && title) {
			var i = title.lastIndexOf('/');
			if (i > 0) {
				var parentName = title.substring(0, i);
				var partName = title.substring(i+1);
				var parent = (parentName == ".") 
						? store.resolveTiddler(currentParent)
						: oldFetchTiddler.apply(this, [parentName]);
				if (parent) {
					return getPart(parent, partName, parent.title+"/"+partName);
				}
			}
		}
		return result;	
	};
};

// for debugging the plugin is not loaded through the systemConfig mechanism but via a script tag. 
// At that point in the "store" is not yet defined. In that case hijackFetchTiddler through the restart function.
// Otherwise hijack now.
if (!store) {
	var oldRestartFunc = restart;
	window.restart = function() {
		hijackFetchTiddler();
		oldRestartFunc.apply(this,arguments);
	};
} else
	hijackFetchTiddler();




// The user must not edit a readOnly/partTiddler
//

config.commands.editTiddler.oldIsReadOnlyFunction = Tiddler.prototype.isReadOnly;

Tiddler.prototype.isReadOnly = function() {
	// Tiddler.isReadOnly was introduced with TW 2.0.6.
	// For older version we explicitly check the global readOnly flag
	if (config.commands.editTiddler.oldIsReadOnlyFunction) {
		if (config.commands.editTiddler.oldIsReadOnlyFunction.apply(this, arguments)) return true;
	} else {
		if (readOnly) return true;
	}

	return this.abegoIsPartTiddler;
}

config.commands.editTiddler.handler = function(event,src,title)
{
	var t = store.getTiddler(title);
	// Edit the tiddler if it either is not a tiddler (but a shadowTiddler)
	// or the tiddler is not readOnly
	if(!t || !t.abegoIsPartTiddler)
		{
		clearMessage();
		story.displayTiddler(null,title,DEFAULT_EDIT_TEMPLATE);
		story.focusTiddler(title,"text");
		return false;
		}
}

// To allow the "./partName" syntax in macros we need to hijack 
// the invokeMacro to define the "currentParent" while it is running.
// 
var oldInvokeMacro = window.invokeMacro;
function myInvokeMacro(place,macro,params,wikifier,tiddler) {
	var oldCurrentParent = currentParent;
	if (tiddler) currentParent = tiddler;
	try {
		oldInvokeMacro.apply(this, arguments);
	} finally {
		currentParent = oldCurrentParent;
	}
}
window.invokeMacro = myInvokeMacro;

// To correctly support the "./partName" syntax while refreshing we need to hijack 
// the config.refreshers.tiddlers to define the "currentParent" while it is running.
// 
(function() {
	var oldTiddlerRefresher= config.refreshers.tiddler;
	config.refreshers.tiddler = function(e,changeList) {
		var oldCurrentParent = currentParent;
		try {
			currentParent = e.getAttribute("tiddler");
			return oldTiddlerRefresher.apply(this,arguments);
		} finally {
			currentParent = oldCurrentParent;
		}
	};
})();

// Support "./partName" syntax inside <<tabs ...>> macro
(function() {
	var extendRelativeNames = function(e, title) {
		var nodes = e.getElementsByTagName("a");
		for(var i=0; i<nodes.length; i++) {
			var node = nodes[i];
			var s = node.getAttribute("content");
			if (s && s.indexOf("./") == 0)
				node.setAttribute("content",title+s.substr(1));
		}
	};
	var oldHandler = config.macros.tabs.handler;
	config.macros.tabs.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
		var result = oldHandler.apply(this,arguments);
		if (tiddler)
			extendRelativeNames(place, tiddler.title);
		return result;
	};
})();

// Scroll the anchor anchorName in the viewer of the given tiddler visible.
// When no tiddler is defined use the tiddler of the target given event is used.
window.scrollAnchorVisible = function(anchorName, tiddler, evt) {
	var tiddlerElem = null;
	if (tiddler) {
		tiddlerElem = document.getElementById(story.idPrefix + tiddler);
	}
	if (!tiddlerElem && evt) {
		var target = resolveTarget(evt);
		tiddlerElem = story.findContainingTiddler(target);
	}
	if (!tiddlerElem) return;

	var children = tiddlerElem.getElementsByTagName("a");
	for (var i = 0; i < children.length; i++) {
		var child = children[i];
		var name = child.getAttribute("name");
		if (name == anchorName) {
			var y = findPosY(child);
			window.scrollTo(0,y);
			return;
		}
	}
}

} // of "install only once"
//}}}

/***
<html><sub><a href="javascript:;" onclick="scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>

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

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

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

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

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

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

<html><sub><a href="javascript:;" onclick="scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>
***/
/***
!Metadata:
|''Name:''|PopupTipsPlugin|
|''Description:''|Display tips and alias from a pre-defineded tiddler|
|''Version:''|1.0.3|
|''Date:''|May 15, 2007|
|''Source:''|http://sourceforge.net/project/showfiles.php?group_id=150646|
|''Author:''|Bram Chen|
|''License:''|[[Creative Commons Attribution-ShareAlike 2.5 License]]|
|''~CoreVersion:''|2.2.0|
|''Browser:''|Firefox 1.5+; InternetExplorer 6.0|
!Examples
|>|!<<tips Settings>>|
|!<<tips Plugin>> |<<tips PopupTipsPlugin Info>>|
|!<<tips Config>> |<<tips TipsConfig Info>>.<<tips locale>>|
|!<<tips Definitions>>|<<tips TipsDefs Info>>.<<tips locale>>|
|>|!<<tips 'Locale_driven' Alias>>|
|!<<tips Locale>> |<<option txtLocale>> <<tiddler RefreshLocale>>|
|!<<tips Examples>> |<<tips Using_Alias>>|
|~|<<tips Notation>>: <<tips 1 Note>>|
|~|<<tips GettingStarted Info>>|
!Revision History:
|''Version''|''Date''|''Note''|
|1.0.3|May 15, 2007|Improved config.macros.tips.refreshLocale for refreshing backstage|
|1.0.2|Apr 20, 2007|<html>minor changes:<ol><li>change 'TipsLocale' to 'Locale'</li><li>change popup panel width '0.75em' to '0.5em', and left offset '4' to '8'</li></ol></html>|
|1.0.1|Mar 27, 2007|Fixed bug under IE|
|1.0.0|Mar 14, 2007|<html>Initial release:<ol><li>Modified from SaqImtiaz's InfoPlugin,<br/>merged macros def, info and note into one macro named tips.</li><li>Added features, drop-down menu and muti-definitions for locales</li></ol></html>|
!Code section:
***/
//{{{
if (!config.options.txtLocale) {
	config.options.txtLocale = config.locale ? config.locale : 'en';
	saveOptionCookie('txtLocale');
}

Popup.showTips = function(unused,slowly){
	var curr = Popup.stack[Popup.stack.length-1];
	var rootLeft = findPosX(curr.root);
	var rootTop = findPosY(curr.root);
	var rootHeight = curr.root.offsetHeight;
	var popupLeft = rootLeft + 8;
	var popupTop = rootTop + rootHeight + 4;

	var winWidth = findWindowWidth();
	var w=winWidth*0.5;
	if(curr.popup.offsetWidth > w)
		curr.popup.style.width = w + "px";
	var popupWidth = curr.popup.offsetWidth;
	if(popupLeft + popupWidth > winWidth){
		popupLeft = rootLeft - popupWidth - 8;
		popupLeft = popupLeft<0?0:popupLeft;
	}

	var winHeight = findWindowHeight();
	var h = winHeight*0.5;
	if(curr.popup.offsetHeight > h)
		curr.popup.style.height = h + "px";
	var popupHeight = curr.popup.offsetHeight;
	if(popupTop + popupHeight > winHeight){
		popupTop = rootTop - popupHeight - 4 ;
		popupTop = popupTop<0?0:popupTop;
	}

	curr.popup.style.left = popupLeft + "px";
	curr.popup.style.top = popupTop + "px";
	curr.popup.style.visibility = "visible";
	curr.popup.style.display = "block";
	curr.popup.style.overflow = "auto";
	addClass(curr.root,"highlight");
};

config.macros.tips = {
	configTiddler: "TipsConfig.",
	defTips: "TipsDefs",
	defTypes: ["Info","Note"],
	defFormats: {Info:'%0', Note:'{{help{^^%0^^}}}', Menu:'%0'},
	defStyle: "TipsStyle"
};

config.macros.tips.refreshLocale = function(){
	refreshPageTemplate('PageTemplate');
	if(!readOnly){
		removeChildren(document.getElementById("backstageButton"));
		removeChildren(document.getElementById("backstageToolbar"));
		backstage.init();
	}
	story.forEachTiddler(function(title,e){story.refreshTiddler(title,DEFAULT_VIEW_TEMPLATE,true);});
};

config.macros.tips.showTips = function(e){
	if(!e) var e = window.event;
	if(!this.tipsName) return false;
	var popup = Popup.create(this,"span","popupTips");
//	var popup = Popup.create(this,"span","tips"+this.tipsClass );
	if(this.tips) wikify(this.tips,popup);
	Popup.showTips(popup,false);
	if(e) e.cancelBubble = true;
	if(e && e.stopPropagation) e.stopPropagation();
	return false;
};

//	removeTips: Popup.remove,

config.macros.tips.handler = function(place,macroName,params,wikifier,paramString,tiddler){
	var configTiddler = this.configTiddler + (config.options.txtLocale?config.options.txtLocale:config.locale);
	if (!store.tiddlerExists(configTiddler)) configTiddler = this.configTiddler+'en';
	var tipsDefs =  store.getTiddlerSlice(configTiddler,this.defTips);
	tipsDefs = tipsDefs?tipsDefs:this.defTips;
	var tipsStyle = store.getTiddlerSlice(configTiddler,this.defStyle);
	tipsStyle = tipsStyle?tipsStyle:this.defStyle;

	var tipsFormats = store.getTiddlerSlices(configTiddler,this.defTypes);
	tipsFormats = tipsFormats?tipsFormats:this.defFormats;
	var tipsName = params[0]?params[0]:null;

	var tips = store.getTiddlerSlice(tipsDefs,tipsName);
	if (!tips){
		wikify(tipsName,place);
		return false;
	}
	var theType = params[1]?params[1]:'Alias';
	var tipsNameLocale = store.getTiddlerSlice(tipsDefs,tipsName + '_label');
	var theClass = params[2]?params[2]:theType;
	var wrapper = createTiddlyElement(place,"span",null,"tips"+theClass);
	wrapper.tips = tips;
	wrapper.tipsName = tipsNameLocale ? tipsNameLocale : tipsFormats[theType];
//	wrapper.tipsName = (params[2] == /Menu|Info/ && tipsNameLocale)?tipsNameLocale:tipsFormats[theType];
	wrapper.tipsClass = theClass;
	wrapper.onmouseover= this.showTips;
//	wrapper.onmouseout= this.removeTips;

	if (wrapper.tipsName){
		wikify(wrapper.tipsName.format([tipsName]),wrapper);
	} else{
		var aliasWrapper = createTiddlyElement(wrapper,"span",null,null);
		wikify(tips, aliasWrapper);
	}
};

config.macros.refreshLocale = {
	template: '[[%0.%1]]',
	tiddlers: ['DateFormat','GettingStarted','SideBarOptions','OptionsPanel','SideBarTabs','TabMore']
};

config.macros.refreshLocale.onClickRefresh = function(e){
	if (!e) var e = window.event;
	var locale = this.title;
	config.options.txtLocale = locale;
	saveOptionCookie('txtLocale');
	var locale_ui = 'locale.'+locale;
	locale_ui =  store.getTiddlerText(locale_ui);
	if (locale_ui)
		window.eval(locale_ui);
	config.macros.refreshLocale.tiddler(locale);
	config.macros.tips.refreshLocale();
	return false;
}

config.macros.refreshLocale.tiddler = function(locale){
	var t = 'ViewTemplate.' + locale;
	if (store.tiddlerExists(t) || store.isShadowTiddler(t))
		config.shadowTiddlers[t] = this.template.format([t,locale]);
	for (var i=0; i<this.tiddlers.length; i++){
		t = this.tiddlers[i];
		var text = store.getTiddlerText(t+'.'+locale);
		if (text)
			config.shadowTiddlers[t] = text;
	}
};

config.macros.refreshLocale.handler = function(place,macroName,params,wikifier,paramString,tiddler){
	if (params[0]) {
		for (var i=0; i<params.length ; i++){
			var tooltip = params[i]; var defTips = config.macros.tips.defTips + '.' + tooltip;
			if (store.tiddlerExists(defTips) || store.isShadowTiddler(defTips)) {
				var label = store.getTiddlerSlice(defTips,params[i].replace("-","_") + '_label');
				label = label ? label : params[i];
				var btn = createTiddlyButton(place,label,tooltip,this.onClickRefresh);
			}
		}
	} else {
		config.macros.tips.refreshLocale();
	}
};
config.shadowTiddlers[config.macros.tips.configTiddler+'en'] = "|{{bigblue{__Setting__}}}|c\n|!Name|!Tips|\n|TipsDefs:|TipsDefs.en|\n|TipsStyle:|TipsStyle|\n|Note:|{{help{^^%0^^}}}|\n|Info:|%0|\n";
config.shadowTiddlers[config.macros.tips.defTips+'.en'] = "{{{\nlocale: en\nPopupTipsPlugin: <<tiddler PopupTipsPlugin>>\nTipsConfig: <<tiddler TipsConfig.en>>\nTipsDefs: [[TipsDefs.en]] contains all of the tips definitions and it's specified in [[TipsConfig.en]].\nUsing_Alias: @@Alias@@:__Uses the tiddler slice form to define the tips__.\n1: {{bigblue{''Show a popup tips as mouse hovers.''}}}\nGettingStarted: <<tiddler GettingStarted>>\n}}}";
config.shadowTiddlers[config.macros.tips.defStyle] = '/*{{{*/\n.popupTips {position:absolute; visibility:hidden; padding:0.5em; border:2px solid [[ColorPalette::PrimaryPale]]; background:#cff; color:[[ColorPalette::Foreground]]; z-index:300; filter:alpha(opacity=90);-moz-opacity:0.9;opacity: 0.9;}\n\n.tipsNote {position:relative; border:none; background:[[ColorPalette::Background]]; color:[[ColorPalette::Error]]; cursor:help;}\n\n.tipsInfo {position:relative; background:#cff; color:[[ColorPalette::Foreground]];}\n\n.tipsMenu {position:relative; padding:0 0.1em 0 0.1em; border:1px solid [[ColorPalette::PrimaryPale]]; background:[[ColorPalette::PrimaryMid]];\n color:[[ColorPalette::Background]]; font-size: 1.2em;}\n.tipsMenu:hover {background:[[ColorPalette::PrimaryPale]]; color:[[ColorPalette::Background]]; font-weight: bold;}\n\n.bigblue {font-size: 1.2em;color:darkblue}\n.help {cursor:help;}\n/*}}}*/';
config.shadowTiddlers.StyleSheet += '\n[['+config.macros.tips.defStyle+']]';
config.shadowTiddlers["RefreshLocale"] = "<<refreshLocale en zh-Hant zh-Hans>>";
//}}}
/%
|Name|QuickEditToolbar|
|Source|http://www.TiddlyTools.com/#QuickEditToolbar|
|Version|2.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.2|
|Type|script|
|Requires|InlineJavascriptPlugin, GotoPlugin, NestedSlidersPlugin|
|Overrides||
|Description|quickly insert TiddlyWiki tiddler links or common formatting sequences directly into tiddler content|

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

The QuickEdit "macro" command can include optional "guideText" for any given macro, as an aide to entering macro parameters, by embedding placeholders or recommended default values into the macro syntax that is inserted into your tiddler content.  For built-in TW core macros, this guideText is defined in this script, below.  You can add guideText to your own plugin-defined macros by using the following javascript syntax:
	config.macros.macroName.guideText="guide text goes here";
example:
	config.macros.slider.guideText="cookie TiddlerName label tooltip"; 

%/<script>

// SET STYLESHEET (for toolbar button style)
setStylesheet(".quickEdit a { border:1px solid #999; -moz-border-radius:0; padding:0px 2px; \
	line-height:200%; font-weight:normal; }", "quickEditStyles");

setStylesheet(".quickEdit a { border:2px outset ButtonFace; -moz-appearance:button; padding:0px 3px; \
	background-color:ButtonFace; color:ButtonText !important;  line-height:200%; font-weight:normal; }", "quickEditStyles");

// SET MACRO GUIDE TEXT (for built-in core macros) (11/17 - TBD - incomplete list)
config.macros.edit.guideText="fieldname #rows";
config.macros.view.guideText="fieldname (link,wikified,date) format";
config.macros.slider.guideText="cookie TiddlerName label tooltip";
config.macros.option.guideText="(txtCookieName,chkCookieName)";
config.macros.tiddler.guideText="TiddlerName with: params...";

</script>/%

TOOLBAR DEFINITIONS BEGIN HERE...
= = = = = = = = = = = = = = = = =
%/{{hidden fine center quickEdit{<script>
	if (config.options.chkShowQuickEdit && !readOnly) place.style.display="block"; // show toolbar when enabled and not in "read only " mode
</script>/%

%/+++^20em^*{{tiddlyLink{[link|add a 'PrettyLink' to another tiddler - [[link text|TiddlerName]}}}
	{{fine smallform wrap{
	//enter/select a tiddler://
	<<gotoTiddler insert width:100%;margin:0;font-size:8pt; width:90%;font-size:8pt;>>}}}===<script>
		place.lastChild.button.title+="]]"; // because we can't use "]" directly in the slider's label/tooltip syntax
</script>/%

%/+++^*{{tiddlyLink{[macro|add a macro - <<macroName ...>>]}}}
	{{fine smallform wrap{
	<html><select onchange="config.quickEdit.setSelection(this,'\<\<'+this.value+'\>\>'); this.selectedIndex=0; return false;">
		<option value="">select a macro...</option>
	</select></html><script>
		// get alpha-sorted list of macros plus help text (if any) and load droplist
		var macros=[]; for (var m in config.macros) if (config.macros[m].handler) macros.push(m); macros.sort();
		var list=place.lastChild.firstChild;
		for (var i=0; i<macros.length; i++) { var m=macros[i];
			var help=config.macros[m].guideText; if (!help) help=""; else help=" "+help;
			list.options[list.length]=new Option(m,m+help,false,false);
			list.options[list.length-1].title="<<"+m+help+">>";
		}
	</script>}}}===/%



%/ &nbsp; <script label="&nbsp;B&nbsp;" title="''bold''">
	return config.quickEdit.wrapSelection(place,"''","''");
</script>/%

%/<script label="&nbsp;I&nbsp;" title="//italics//">
	return config.quickEdit.wrapSelection(place,"//","//");
</script>/%

%/<script label="&nbsp;U&nbsp;" title="__underline__">
	return config.quickEdit.wrapSelection(place,"__","__");
</script>/%

%/<script label="&nbsp;S&nbsp;" title="--strikethrough--">
	return config.quickEdit.wrapSelection(place,"--","--");
</script>/%


%/<script label="color" title="text color - @@color:#RGB;...@@">
	var color=prompt("Enter a CSS color name or value (use RGB or RRGGBB notation):","FC3");
	if (!color) return false; // cancelled by user
	return config.quickEdit.wrapSelection(place,"@@color:#"+color+";","@@");
</script>/%

%/ &nbsp; <script label="quote" title="indented blockquote - <<<">
	return config.quickEdit.wrapSelection(place,"\n<<<\n","\n<<<\n");
</script>/%

%/<script label="mono" title="inline monospaced text - {{{...}}}">
	return config.quickEdit.wrapSelection(place,"{{{","}}}");
</script>/%

%/<script label="pre" title="multiline monospaced text box - {{{...}}}">
	return config.quickEdit.wrapSelection(place,"\n{{{\n","\n}}}\n");
</script>/%


%/}}}/%
END OF TOOLBAR DEFINITIONS
= = = = = = = = = = = = = = = = =

%/<script>

// UTILITY FUNCTIONS (set/get edit field content and "select a file" prompting)
config.quickEdit = {
	setSelection: function(where,newtext) {
		var here=story.findContainingTiddler(where); if (!here) return false;
		var e=story.getTiddlerField(here.getAttribute("tiddler"),"text"); if (!e||e.getAttribute("edit")!="text") return false;
		e.focus(); replaceSelection(e,newtext);
		return false;
	},
	wrapSelection: function(where,before,after) {
		var here=story.findContainingTiddler(where); if (!here) return false;
		var e=story.getTiddlerField(here.getAttribute("tiddler"),"text"); if (!e||e.getAttribute("edit")!="text") return false;
		e.focus(); replaceSelection(e,before+config.quickEdit.getSelection(e)+after);
		return false;
	},
	getSelection: function(e) {
		var seltext="";
		if (e.setSelectionRange)
			seltext=e.value.substr(e.selectionStart,e.selectionEnd-e.selectionStart);
		else if (document.selection) {
			var range = document.selection.createRange();
			if (range.parentElement()==e)	seltext=range.text
		}
		return seltext;
	},
	promptForFilename: function(msg,path,file) {
		if(window.Components) { // moz
			try {
				netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
				var nsIFilePicker = window.Components.interfaces.nsIFilePicker;
				var picker = Components.classes['@mozilla.org/filepicker;1'].createInstance(nsIFilePicker);
				picker.init(window, msg, nsIFilePicker.modeOpen);
				var thispath = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
				thispath.initWithPath(path);
				picker.displayDirectory=thispath;
				picker.defaultExtension='jpg';
				picker.defaultString=file;
				picker.appendFilters(nsIFilePicker.filterAll|nsIFilePicker.filterImages);
				if (picker.show()!=nsIFilePicker.returnCancel)
					var result="file:///"+picker.file.persistentDescriptor.replace(/\\/g,'/');
			}
			catch(e) { alert('error during local file access: '+e.toString()) }
		}
		else { // IE
			try { // XP only
				var s = new ActiveXObject('UserAccounts.CommonDialog');
				s.Filter='All files|*.*|JPG files|*.jpg|GIF files|*.gif|PNG files|*.png|';
				s.FilterIndex=1; // default to JPG files;
				s.InitialDir=path;
				s.FileName=file;
				if (s.showOpen()) var result=s.FileName;
			}
			catch(e) { var result=prompt(msg,path+file); } // fallback for non-XP IE
		}
		return result;
	}
}
</script>
/***
| Name|QuickOpenTagPlugin|
| Description|Changes tag links to make it easier to open tags as tiddlers|
| Version|3.0.1 ($Rev: 2342 $)|
| Date|$Date: 2007-07-05 10:57:49 +1000 (Thu, 05 Jul 2007) $|
| 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 to <<tag PrettyTagName|RealTagName>>
		var splitTag = tag.split("|");
		var pretty = tag;
		if (splitTag.length == 2) {
			tag = splitTag[1];
			pretty = splitTag[0];
		}
		
		var sp = createTiddlyElement(place,"span",null,"quickopentag");
		createTiddlyText(createTiddlyLink(sp,tag,false),pretty);
		
		var theTag = createTiddlyButton(sp,config.quickOpenTag.dropdownChar,
                        config.views.wikified.tag.tooltip.format([tag]),onClickTag);
		theTag.setAttribute("tag",tag);
		if (excludeTiddler)
			theTag.setAttribute("tiddler",excludeTiddler);
    		return(theTag);
	},

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

	allTagsHandler: function(place,macroName,params) {
		var tags = store.getTags(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:|RenameTagsPlugin|
| Description:|Allows you to easily rename or delete tags across multiple tiddlers|
| Version:|3.0 ($Rev: 1845 $)|
| Date:|$Date: 2007-03-16 15:19:22 +1000 (Fri, 16 Mar 2007) $|
| 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) {
			if (title != newTitle) {
				var tagged = this.getTaggedTiddlers(title);
				if (tagged.length > 0) {
					// then we are renaming a tag
					if (confirm(config.renameTags.prompts.rename.format([title,newTitle,tagged.length,tagged.length>1?"s":""])))
						config.renameTags.renameTag(title,newTitle,tagged);

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

		removeTiddler_orig_renameTags: TiddlyWiki.prototype.removeTiddler,

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

	},

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

config.renameTags.init();

//}}}

/***
| Name|SaveCloseTiddlerPlugin|
| Description|Provides two extra toolbar commands, saveCloseTiddler and cancelCloseTiddler|
| Version|3.0 ($Rev: 2134 $)|
| Date|$Date: 2007-04-30 16:11:12 +1000 (Mon, 30 Apr 2007) $|
| Source|http://mptw.tiddlyspot.com/#SaveCloseTiddlerPlugin|
| Author|Simon Baird <simon.baird@gmail.com>|
| License|http://mptw.tiddlyspot.com/#TheBSDLicense|
To use these you must add them to the tool bar in your EditTemplate
***/
//{{{
merge(config.commands,{

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

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

});

//}}}

/***
| Name|SelectPalettePlugin|
| Description|Lets you easily change colour palette|
| Version|3.0 ($Rev: 1845 $)|
| Date|$Date: 2007-03-16 15:19:22 +1000 (Fri, 16 Mar 2007) $|
| Source|http://mptw.tiddlyspot.com/#SelectPalettePlugin|
| Author|Simon Baird <simon.baird@gmail.com>|
| License|http://mptw.tiddlyspot.com/#TheBSDLicense|
/***
!!Usage:
{{{<<<selectPalette>>}}}
<<selectPalette>>

!!WARNING
Will overwrite your ColorPalette tiddler.
***/

//{{{

merge(config.macros,{

	setPalette: {

		handler: function(place,macroName,params,wikifier,paramString,tiddler) {
			var paletteName = params[0] ? params[0] : tiddler.title;
			createTiddlyButton(place,"apply","Apply this palette",function(e) {
				config.macros.selectPalette.updatePalette(tiddler.title);
				return false;
			});
		}
	},

	selectPalette: {

		handler: function(place,macroName,params,wikifier,paramString,tiddler) {
			createTiddlyDropDown(place,this.onPaletteChange,this.getPalettes());
		},

		getPalettes: function() {
			var result = [
				{caption:"-palette-", name:""},
				{caption:"(Default)", name:"(default)"}
			];
			var tagged = store.getTaggedTiddlers("palette","title");
			for(var t=0; t<tagged.length; t++) {
				var caption = tagged[t].title;
				var sliceTitle = store.getTiddlerSlice(caption,"Name");
				if (sliceTitle)
					caption = sliceTitle;
				result.push({caption:sliceTitle, name:tagged[t].title});
			}
			return result;
		},

		onPaletteChange: function(e) {
			config.macros.selectPalette.updatePalette(this.value);
			return true;
		},

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

		refreshPalette: function() {
			config.macros.refreshDisplay.onClick();
		}
	}
});

config.shadowTiddlers.OptionsPanel = "<<selectPalette>>\n\n" + config.shadowTiddlers.OptionsPanel;

//}}}

/***
|Name|SetUserNamePlugin|
|Source|http://www.TiddlyTools.com/#SetUserNamePlugin|
|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|If default username is used ("YourName"), display prompt box to get new username|

!!!!!Installation
<<<
import (or copy/paste) the following tiddlers into your document:
''SetUserNamePlugin'' (tagged with <<tag systemConfig>>)

If you are using the default (shadow) EditTemplate definition, it will be updated to invoke this macro, so that whenever a user attempts to edit/create a tiddler AND the username is "YourName", they will be automatically prompted to enter a new username.  If you are using a customized EditTemplate, you will need to edit it yourself and add the following line:
{{{
<span macro='setUserName'></span>
}}}
<<<
!!!!!Revision History
<<<
''2006.12.01 [1.0.0]'' initial release - converted from SetUserName inline script
<<<
!!!!!Credits
<<<
This feature was developed by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]]
<<<
!!!!!Code
***/
//{{{
version.extensions.setUserName= {major: 1, minor: 0, revision: 0, date: new Date(2006,12,1)};

config.macros.setUserName = {
	handler: function(place,macroName,params) {
		// only prompt when needed
		if (readOnly || config.options.txtUserName!="YourName") return;
		// get new username
		var who=prompt("Please set your username",config.options.txtUserName);
		if (!who||!who.trim().length) return; // cancelled by user
		// set new username
		config.options.txtUserName=who;
		saveOptionCookie("txtUserName");
		// sync any option input fields that are showing username
		var nodes = document.getElementsByTagName("input");
		for(var t=0; t<nodes.length; t++) 
			if(nodes[t].getAttribute("option")=="txtUserName") nodes[t].value=who;
	}
}

// add trigger to default shadow EditTemplate (custom templates: add this by hand)
config.shadowTiddlers.EditTemplate+="<span macro='setUserName'></span>";
//}}}
 <html>
<sub><b>Notes:</b></sub>
<TEXTAREA name=notes rows=2
 cols=80 ></TEXTAREA>

</html>
 <html>
<TEXTAREA name=notes rows=2
 cols=80 ></TEXTAREA>

</html>
 <html>
<TEXTAREA name=notes2 rows=2
 cols=80 ></TEXTAREA>

</html>
 <html>
<TEXTAREA name=notes3 rows=2
 cols=80 ></TEXTAREA>

</html>
 <html>
<TEXTAREA name=notes4 rows=2
 cols=80 ></TEXTAREA>

</html>
 <html>
<TEXTAREA name=notes5 rows=2
 cols=80 ></TEXTAREA>

</html>
 <html>
<TEXTAREA name=notes6 rows=2
 cols=80 ></TEXTAREA>

</html>
 <html>
<TEXTAREA name=notes7 rows=2
 cols=80 ></TEXTAREA>

</html>
/%
|Name|ShowSlices|
|Source|http://www.TiddlyTools.com/#ShowSlices|
|Version|0.5.0|
|Author|Eric Shulman - ELS Design Studios|
|License|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1.3|
|Type|script|
|Requires|SliceGridPlugin, InlineJavascriptPlugin, NestedSlidersPlugin, DOMTweaksPlugin|
|Overrides||
|Description|view values for all tiddler slices|
%/<<tiddler HideTiddlerTags>>{{smallform small{<html><form><!--
	--><select name="tidlist" size=1 style="width:70%" 
		onchange="this.form.done.disabled=(this.value.length==0); var target=this.form.parentNode.nextSibling.nextSibling.nextSibling; removeChildren(target); wikify(this.value,target);">
		<option value="">select a tiddler...</option>
	</select><input type="text" name="re" style="width:23%" title="tiddler slice pattern (store.slicesRE)"
		onblur="store.slicesRE=new RegExp(this.value,'gm');"><input type="button" name="done" value="done" style="width:6%" disabled 
		onclick="var target=this.form.parentNode.nextSibling.nextSibling.nextSibling; removeChildren(target);this.disabled=true"></form></html>{{floatright small wrap{+++[view grid]#ShowSlices_gridpanel:...
		{{fine{<<sliceGrid>>}}}===}}}<script>

	// initialize form field
	var form=place.lastChild.previousSibling.firstChild;
	var re=store.slicesRE.toString();
	re=re.substring(1,re.length-3); // strip delimiters/flags from re
	form.re.value=re;

	// define slice filter (only report indicated slices)
	var filter={ Name:1, Source:1, Version:1, Author:1, License:1,
		CoreVersion:1, Type:1, Requires:1, Overrides:1, Description:1 };
	var filter=null; // show all defined slices - remove this line to use pre-defined filter

	var allslices=[]; // will be filled with names of all slices from all tiddlers
	var slicefmt='\'\'"""%0"""\'\'\n&nbsp;&nbsp;%1\n'; // indented format
	var slicefmt='| %0|%1|\n'; // table format - remove this line to use indented format
	var slicefmt='\'\'%0=\'\'%1\n'; // var=val format - remove this line to use indented format
	var tiddlers=store.getTiddlers("modified");
	for (i=tiddlers.length-1; i>=0; i--) {
		var tid=tiddlers[i];
		var slices=store.calcAllSlices(tid.title);
		var sliceout=[]; var slicecount=0;
		for (var s in filter?filter:slices) {
			sliceout.push(slicefmt.format([s,slices[s]?slices[s]:'-']));
			if (slices[s] || !filter) slicecount++;
			if (slices[s]) allslices.pushUnique(s);
		}
		if (slicecount) form.tidlist.options[form.tidlist.length]=new Option(tid.title+"("+slicecount+")","<<<\n"+sliceout.join('')+"<<<\n",false,false);
	}
	var out="{{small wrap{There are %0 slice names used in this document.  +++[view list...]>{{small{\n%1\n}}}===\n"
	return out.format([allslices.length,"#"+allslices.join('\n#')]);
</script>@@display:block;/%replace with dynamic content%/@@}}}<<DOM move ShowSlices_gridpanel>>
{{button{goto}}}
<<gotoTiddler>><<closeAll>><<permaview>><<newTiddler>><<newJournal "DD MMM YYYY">><<saveChanges>><<tiddler TspotSidebar>><<slider chkSliderOptionsPanel OptionsPanel "options »" "Change TiddlyWiki advanced options">>
World English Bible version for small group or personal use (F11 = fullscreen)
Bible Study
Use arrow to navigate through links and references. Click on links to open tiddlers.

Set macro parameters to false to hide references and/or history.

<<spider Plugins "asc" "Back to Plugins" true false noSpider>>
This tiddler has been renamed. Look at [[SpiderMenuPlugin]]
/***
|Location|http://visualtw.ouvaton.org/VisualTW.html|
|Version|1.0.0|
|CoreVersion|2.2|
|Browsers|Firefox 2.0.x, IE 6.0+, others|
!Description:
A macro to display menus which browse through tiddler's links and references
!Demo:
On [[homepage|http://visualtw.ouvaton.org/VisualTW.html]], see [[Spider menu example]]
!Installation:
*import this tiddler from [[homepage|http://visualtw.ouvaton.org/VisualTW.html]] (tagged as systemConfig)
*save and reload
!Usage
Call the spider macro with the following parameters :
#//root tiddler// (optional). Its links and references are the initial items in the menu (by default, the current tiddler)
#//sort// (optional). Can be "asc" or "desc" to order alphabetically. If none, links are ordered as they appear in tiddlers.
#//root button name// (optional). With this button, the user come back to root tiddler. By default "home".
#//display References// (optional). Default is true.
#//display History// (optional). Default is true.
#//stop tag// (optional). If a tiddler is tagged with this tag, it's displayed in references.
Example : 
 {{{
     <<spider Plugins "asc" "Back to Plugins" true false noSpider>>
}}} 
!options :
<<option txtSpiderHereTitle>> Title above spider current tiddler name (default "Here :")
<<option txtSpiderLinksTitle>> Title above spider links (default "Links :")
<<option txtSpiderReferencesTitle>> Title above spider references (default "References :")
<<option txtSpiderHistoryTitle>> Title above spider history (default "History :")
<<option txtSpiderMaxHistoryLines>> Maximum number of lines displayed in spider history (empty by default, means all lines are displayed)
!Code
***/
//{{{
config.options.txtSpiderHereTitle=config.options.txtSpiderHereTitle ? config.options.txtSpiderHereTitle : "Here :";
config.options.txtSpiderLinksTitle=config.options.txtSpiderLinksTitle ? config.options.txtSpiderLinksTitle : "Links :";
config.options.txtSpiderReferencesTitle=config.options.txtSpiderReferencesTitle ? config.options.txtSpiderReferencesTitle : "References :";
config.options.txtSpiderHistoryTitle=config.options.txtSpiderHistoryTitle ? config.options.txtSpiderHistoryTitle : "History: ";
config.options.txtSpiderMaxHistoryLines=config.options.txtSpiderMaxHistoryLines ? config.options.txtSpiderMaxHistoryLines : "";

config.macros.spider = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		var root = createTiddlyElement(place, "div");
		var source=params[0] ?params[0]:tiddler.title;
		if (source) {
			var firstCall = new config.macros.spider.display(root,source,params[1],[], (params.length>3)?(params[3]=="true"):true,(params.length>4)?(params[4]=="true"):true, (params.length>5)?params[5]:"");
			firstCall.onFollow();
			var wrapper = createTiddlyElement(place, "div");
			createTiddlyButton(wrapper,params[2]?params[2]:"home","browse to menu home",firstCall.onFollow,"spiderButton");		
		}	
	},
	display : function(place,title, order, history, displayRef, displayHistory, stopTag){
		var oDisplay = this;  //has to memorise it because "this" is different when onFollow is called from button
		oDisplay.title = title;
		oDisplay.renderMenu = function(links, divTitle, className, destHistory){
			if (links.length) {
				ldiv = createTiddlyElement(place,"div",null,className,divTitle);
				links.sort(function(a,b){return order=="asc" ? (a>b?1:-1) : (order=="desc" ? (a<b?1:-1) : 0)});
			}
			for(l=0;l<links.length;l++) {
				var wrapper = createTiddlyElement(ldiv, "div");
				createTiddlyLink(wrapper,links[l],links[l]);
				if (store.tiddlerExists(links[l])) {
					var callback = new config.macros.spider.display(place,links[l],order,destHistory, displayRef, displayHistory, stopTag);
					createTiddlyButton(wrapper,glyph("rightArrow"),"browse to "+links[l],callback.onFollow);
				}
			}	
		};
		oDisplay.onFollow = function(e){
			while (place.firstChild) place.removeChild(place.firstChild);

			var hdiv = createTiddlyElement(place,"div",null,"spiderHere",config.options.txtSpiderHereTitle);
			var wrapper = createTiddlyElement(hdiv, "div");
			createTiddlyLink(wrapper,title,title);

			var t = store.getTiddler(title);
			destHistory = displayHistory ? history.concat(oDisplay) : [];
			if (t) oDisplay.renderMenu(t.getLinks(),config.options.txtSpiderLinksTitle, "spiderLinks", destHistory );
			if(t && displayRef) {
				var refs = store.getReferringTiddlers(title);
				for (l=0, links=[]; l<refs.length; l++) if (!stopTag || !refs[l].isTagged(stopTag)) links.push(refs[l].title);
				oDisplay.renderMenu(links,config.options.txtSpiderReferencesTitle, "spiderReferences", destHistory);
			}
			if (history.length && displayHistory) {
				var hdiv = createTiddlyElement(place,"div",null,"spiderHistory",config.options.txtSpiderHistoryTitle);
				var hMax = config.options.txtSpiderMaxHistoryLines ? Math.max(history.length,config.options.txtSpiderMaxHistoryLines) : history.length;
				for(h=0;h<hMax;h++){
					var wrapper = createTiddlyElement(hdiv, "div");
					createTiddlyLink(wrapper,history[h].title,history[h].title);
					if (store.tiddlerExists(history[h].title))
						createTiddlyButton(wrapper,glyph("rightArrow"),"browse to "+history[h].title,history[h].onFollow);
				}
				var wrapper = createTiddlyElement(hdiv, "div");
				var callback = new config.macros.spider.display(place,title,order,[], displayRef, displayHistory, stopTag);
				createTiddlyButton(wrapper,"clear history","click here to clear history", callback.onFollow,"spiderButton");
			}
		}
	}
}

config.glyphs.codes.rightArrow= ["\u2192","\u25B8"];

//}}}
/***

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

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

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

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

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

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

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


var oldText = store.getTiddlerText("MarkupPreHead");
if (oldText.indexOf("SplashScreen")==-1)
   {var siteTitle = store.getTiddlerText("SiteTitle");
   var splasher='\n\n<style type="text/css">#contentWrapper {display:none;}</style><div id="SplashScreen" style="border: 3px solid #ccc; display: block; text-align: center; width: 320px; margin: 100px auto; padding: 50px; color:#000; font-size: 28px; font-family:Tahoma; background-color:#eee;"><b>'+siteTitle +'</b> is loading<blink> ...</blink><br><br><span style="font-size: 14px; color:red;">Requires Javascript.</span></div>';
   if (! store.tiddlerExists("MarkupPreHead"))
       {var myTiddler = store.createTiddler("MarkupPreHead");}
   else
      {var myTiddler = store.getTiddler("MarkupPreHead");}
      myTiddler.set(myTiddler.title,oldText+splasher,config.options.txtUserName,null,null);
      store.setDirty(true);
      var splashScreenInstall = true;
}
//}}}
[[MptwStyleSheet]]
/%
|Name|StyleTester|
|Source|http://www.TiddlyTools.com/#StyleTester|
|Version|0.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|script|
|Requires|InlineJavascriptPlugin|
|Overrides||
|Description|TidIDE: define and apply CSS "on the fly"|
%/{{smallform{<script>
var elems=document.getElementsByTagName("*");
var out='<html><form>';
out+='<select size=1 name=elems style="width:80%" ';
out+='		onchange="this.form.css.value=\'\'; if (!this.value.length) return;';
out+='		this.form.apply.disabled=false;';
out+='		this.form.done.disabled=false; this.form.css.style.display=\'block\';';
out+='		var e=document.getElementById(this.value);';
out+='		this.form.css.value=\'#%0 { %1 }\'.format([this.value,e.style.cssText]);">';
out+='<option value=\'\'>select an element ID...</option>';
for (var i=0;i<elems.length;i++) { if (elems[i].id.length) out+='<option value="%0">ID: %0</option>'.format([elems[i].id]); }
out+='</select>';
out+='<input type=button name=apply style="width:10%" value="apply" disabled onclick="setStylesheet(this.form.css.value,\'testStyles\')">';
out+='<input type=button name=done style="width:10%" disabled value="done" onclick="this.form.css.value=\'\'; this.form.css.style.display=\'none\'; this.form.elems.selectedIndex=0; this.form.apply.disabled=this.disabled=true"><br>';
out+='<textarea name=css rows=15 style="width:100%;height:15em;display:none"';
out+='		onkeyup="if (event.ctrlKey && event.keyCode==13) this.form.apply.click()"></textarea>';
out+='</form></html>';
return out;
</script>}}}
<<allTags excludeLists>>
<<tabs txtMoreTab "Tags" "All Tags" TabAllTags "Miss" "Missing tiddlers" TabMoreMissing "Orph" "Orphaned tiddlers" TabMoreOrphans "Shad" "Shadowed tiddlers" TabMoreShadowed>>
<<allTags excludeLists [a-z]>>
/***
|Name|TaggedTemplateTweak|
|Source|http://www.TiddlyTools.com/#TaggedTemplateTweak|
|Version|1.1.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <<br>>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|Story.prototype.chooseTemplateForTiddler()|
|Description|use alternative ViewTemplate/EditTemplate for tiddler's tagged with specific tag values|

The core function, "story.chooseTemplateForTiddler(title,template)" is essentially a "pass-thru" that returns the same template it was given, and is provided by the core so that plugins can customize the template selection logic to select alternative templates, based on whatever programmatic criteria is appropriate.  This tweak extends story.chooseTemplateForTiddler() so that ''whenever a tiddler is marked with a specific tag value, it can be viewed and/or edited using alternatives to the standard tiddler templates.'' 
!!!!!Usage
<<<
Each alternative template is associated with a specific tiddler tag value by using that tag value as a prefix added to the standard TiddlyWiki template titles, [[ViewTemplate]] and [[EditTemplate]].

For example, any tiddlers that are tagged with ''<<tag media>>'' will look for alternative templates named [[mediaViewTemplate]] and [[mediaEditTemplate]].  Additionally, in order to find templates that have proper WikiWord tiddler titles (e.g., [[MediaViewTemplate]] and [[MediaEditTemplate]]), the plugin will also attempt to use a capitalized form of the tag value (e.g., ''Media'') as a prefix.  //This capitalization is for comparison purposes only and will not alter the actual tag values that are stored in the tiddler.//

If no matching alternative template can be found by using //any// of the tiddler's tags (either "as-is" or capitalized), the tiddler defaults to using the appropriate standard [[ViewTemplate]] or [[EditTemplate]] definition.

''To add your own custom templates:''
>First, decide upon a suitable tag keyword to uniquely identify your custom templates and create custom view and/or edit templates using that keyword as a prefix (e.g., "KeywordViewTemplate" and "KeywordEditTemplate").  Then, simply create a tiddler and tag it with your chosen keyword... that's it!  As long as the tiddler is tagged with your keyword, it will be displayed using the corresponding alternative templates.  If you remove the tag or rename/delete the alternative templates, the tiddler will revert to using the standard viewing and editing templates.
<<<
!!!!!Examples
<<<
|Sample tiddler| tag | view template | edit template |
|[[MediaSample - QuickTime]]| <<tag media>> | [[MediaViewTemplate]] | [[MediaEditTemplate]] |
|[[MediaSample - Windows]]| <<tag media>> | [[MediaViewTemplate]] | [[MediaEditTemplate]] |
|[[CDSample]]| <<tag CD>> | [[CDViewTemplate]] | [[CDEditTemplate]] |
|<<newTiddler label:"create new task..." title:SampleTask tag:task text:"Type some text and then press DONE to view the task controls">> | <<tag task>> | [[TaskViewTemplate]] | [[EditTemplate]] |

//(note: if these samples are not present in your document, please visit// http://www.TiddlyTools.com/ //to view these sample tiddlers on-line)//
<<<
!!!!!Installation
<<<
import (or copy/paste) the following tiddlers into your document:
[[WikifyPlugin]]
<<<
!!!!!Revision History
<<<
''2007.06.23 [1.1.0]'' re-written to use automatic 'tag prefix' search instead of hard coded check for each tag.  Allows new custom tags to be used without requiring code changes to this plugin.
''2007.06.11 [1.0.0]'' initial release
<<<
!!!!!Credits
<<<
This feature was developed by Eric L Shulman / ELS Design Studios
<<<
!!!!!Code
***/
//{{{
version.extensions.taggedTemplate= {major: 1, minor: 1, revision: 0, date: new Date(2007,6,18)};
Story.prototype.taggedTemplate_chooseTemplateForTiddler = Story.prototype.chooseTemplateForTiddler
Story.prototype.chooseTemplateForTiddler = function(title,template)
{
	// get default template from core
	var template=this.taggedTemplate_chooseTemplateForTiddler.apply(this,arguments);

	// if the tiddler to be rendered doesn't exist yet, just return core result
	var tiddler=store.getTiddler(title); if (!tiddler) return template;

	// look for template whose prefix matches a tag on this tiddler
	for (t=0; t<tiddler.tags.length; t++) {
		var tag=tiddler.tags[t];
		if (store.tiddlerExists(tag+template)) { template=tag+template; break; }
		// try capitalized tag (to match WikiWord template titles)
		var cap=tag.substr(0,1).toUpperCase()+tag.substr(1);
		if (store.tiddlerExists(cap+template)) { template=cap+template; break; }
	}

	return template;
}
//}}}
/***
| Name|TagglyTaggingPlugin|
| Description|tagglyTagging macro is a replacement for the builtin tagging macro in your ViewTemplate|
| Version|3.1 ($Rev: 2341 $)|
| Date|$Date: 2007-07-05 10:02:27 +1000 (Thu, 05 Jul 2007) $|
| 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",
			sitemap:    "sitemap",
			numCols:    "cols\u00b1", // plus minus sign
			label:      "Tagged as '%0':",
			excerpts:   "excerpts",
			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",
			sitemap:  "Click to show a sitemap style list",
			commas:   "Click to show a comma separated list",
			numCols:  "Click to change number of columns",
			excerpts: "Click to show excerpts",
			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","sitemap","commas"],
			numCols:    ["1","2","3","4","5","6"],
			excerpts:   ["noexcerpts","excerpts","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(),null);
		// if value is default then remove it to save space
		return store.setValue(title,
			this.config.valuePrefix+opt,
			value == this.config.listOpts[opt][0] ? null : value);
	},

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

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

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

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

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

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

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

		var upperColsize = colSize;
		var lowerColsize = colSize;

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

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

		return output;
	},

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

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

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

	getExcerpt: function(inTiddlerTitle,title,indent) {
    if (!indent)
			indent = 1;
		if (this.getTagglyOpt(inTiddlerTitle,"excerpts") == "excerpts") {
			var t = store.getTiddler(title);
			if (t) {
				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 (this.getTagglyOpt(inTiddlerTitle,"excerpts") == "contents") {
			var t = store.getTiddler(title);
			if (t) {
				return "\n{{contents indent"+indent+"{\n" + t.text + "\n}}}";
			}
		}
		else if (this.getTagglyOpt(inTiddlerTitle,"excerpts") == "sliders") {
			var t = store.getTiddler(title);
			if (t) {
				return "<slider slide>\n{{contents{\n" + t.text + "\n}}}\n</slider>";
			}
		}
		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);
        			refreshContainer.setAttribute("title",tiddler.title);
				this.refresh(refreshContainer);
			},

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

***/
//{{{
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[1] + " "+"\u00BB",lookaheadMatch[1],this.onClickSlider,"button sliderButton");
			var panel = createTiddlyElement(w.output,"div",null,"sliderPanel");
			panel.style.display = "none";
			wikify(lookaheadMatch[2],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|TextAreaPlugin|
|Source|http://www.TiddlyTools.com/#TextAreaPlugin|
|Version|2.1.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||
|Overrides|Story.prototype.focusTiddler|
|Description|Adds extra keyboard functions to the standard textarea control in the tiddler editor|

''Control-F'' and ''control-G'' will ''"Find text"'' and ''"find text aGain"'', respectively, allowing you to copy, find, paste, findagain, paste, etc to perform "search-and-replace" actions.  The plugin also adds an ''autosize toolbar'' command and ''resizeEditor macro'' (to be placed in the EditTemplate) to permit on-the-fly adjustment of the tiddler editor text area height.

* ''autosizeEditor'' - toggles the tiddler editor textarea height between fixed-height and "automatically fit the contents".
* ''resizeEditor'' - adds 'grab handle' below textarea to stretch field height
!!!!!Configuration
<<<
enable
<<option chkTextAreaExtensions>> use control-f (find), control-g (find again) inside text area
<<option chkDisableAutoSelect>> place cursor at start of textarea instead of pre-selecting content
<<option chkResizeEditor>> modify shadow EditTemplate to add resizeable text area (and autosize command)
> Note: if you are using the default (shadow) EditTemplate, the plugin automatically updates the template to include the ''autosizeEditor'' toolbar command and ''resizeEditor'' macro.  If you have created a custom EditTemplate tiddler, you will need to manually add the ''autosizeEditor'' toolbar command and ''resizeEditor'' macro to your existing template:
{{{
<!-- add 'autosizeEditor' command to end of existing editor toolbar definition -->
<div class='toolbar' macro='toolbar ... autosizeEditor'>
}}}
and
{{{
<!-- add span with 'resizeEditor' macro anywhere in the edit template -->
<span macro='resizeEditor'></span>
}}}
<<<
!!!!!Installation
<<<
Import (or copy/paste) the following tiddlers into your document:
''TextAreaPlugin'' (tagged with <<tag systemConfig>>)
<<<
!!!!!Revision History
<<<
''2007.09.04 [2.1.4]'' in window.TextAreaResizer.prototype.create(), set initial grab handle width to auto instead of matching textarea.offsetWidth (which can be initially==0)
''2007.04.29 [2.1.3]'' in addKeyDownHandlers(), used 'findText' instead of 'find', hopefully to avoid strict ECMAScript1.5 error on certain browsers.
''2007.03.01 [2.1.2]'' use apply() to invoke hijacked core function
''2006.11.16 [2.1.0]'' restored chkDisableAutoSelect (place cursor at start of textarea instead of pre-selecting content)
''2006.11.16 [2.0.0]'' removed chkDisableEscapeKey (obsolete... use custom EditTemplate to change toolbar definition).  Rewrote focusTiddler as a HIJACK instead of just overwriting core function (permits other plugins to also hijack function).  Removed TAB character processing (now built-in as of TW2.1).  Merged code from ResizeEditorPlugin:
> ''2006.11.16 [1.3.x]'' merged with TextAreaPlugin
> ''2006.11.02 [1.3.1]'' in DragMove() and DragStop(), check for undefined properties so IE doesn't report "Not Implemented" error when property is referenced without having been previously initialized.
> ''2006.11.01 [1.3.0]'' added 'resizeEditor' MACRO for 'grab handle' stretch resizing (based on code from Jon Scully and Jason Johnston (jj@lojjic.net).  
> ''2006.11.01 [1.2.6]'' removed increaseEditor, decreaseEditor, and resizeEditor toolbar COMMAND definitions (resize by setting 'rows' property of textarea field conflicts with resize via style.height CSS attribute as set by autosize/drag).
> ''2006.11.01 [1.2.5]'' fixed 'savedkeypress' handling (was writing to savedkeyup by mistake)
> ''2006.10.28 [1.2.4]'' added '+' to 'saveTiddler' toolbar command (enables ctrl-enter keyhandling)
> ''2006.10.18 [1.2.3]'' added decreaseEditor and increaseEditor commands
> ''2006.10.18 [1.2.2]'' onkeypress handling to redirect PGUP/PGDN to window.scrollByPages() (works in FF, but not yet in IE)
> ''2006.10.18 [1.2.1]'' fixed references to default string constants (oops!)
> ''2006.10.18 [1.2.0]'' renamed 'resizeEditor' to 'autosizeEditor' and added new 'resizeEditor' toolbar command to prompt for # of rows to display
> ''2006.10.02 [1.1.1]'' show checkbox in button label (when automatic resizing is enabled)
> ''2006.10.01 [1.1.0]'' added 'onkeyup' automatic fit-to-contents handling
> ''2006.09.30 [1.0.0]'' initial release
''2006.08.01 [1.1.2]'' improved processed() utility function to handle IE5 and IE6, as well as calling preventDefault() for moz browsers.  Thanks to Bradley Meck for research and code examples.
''2006.07.09 [1.1.1]'' removed chkDisableAutoSelect
''2006.02.14 [1.1.0]'' added option for chkDisableEscapeKey (default is standard action)
''2006.01.22 [1.0.1]'' only add extra key processing for TEXTAREA elements (not other edit fields).
added option to enable/disable textarea keydown extensions (default is "standard keys" only)
''2006.01.22 [1.0.0]'' Moved from temporary "System Tweaks" tiddler into 'real' TextAreaPlugin tiddler.
<<<
!!!!!Credits
<<<
>This feature was developed by EricShulman from [[ELS Design Studios|http://www.elsdesign.com]] with 'grab handle' stretch resizing adapted from TW code by Jon Scully and TextAreaResizer() by Jason Johnston (jj@lojjic.net).
<<<
!!!!!Code
***/
//{{{
version.extensions.textAreaPlugin= {major: 2, minor: 1, revision: 4, date: new Date(2007,9,4)};
//}}}

//{{{
if (!config.options.chkTextAreaExtensions) config.options.chkTextAreaExtensions=true;
if (!config.options.chkDisableAutoSelect) config.options.chkDisableAutoSelect=true;
if (!config.options.chkResizeEditor) config.options.chkResizeEditor=true;

// automatically tweak shadow EditTemplate to add "autosizeEditor" toolbar command
if (config.options.chkResizeEditor)
	config.shadowTiddlers.EditTemplate=config.shadowTiddlers.EditTemplate.replace(/deleteTiddler/,"deleteTiddler autosizeEditor");
// automatically tweak shadow EditTemplate to add "resizeEditor" macro
if (config.options.chkResizeEditor)
	config.shadowTiddlers.EditTemplate+="<span macro='resizeEditor'></span>";

// Put focus in a specified tiddler field
Story.prototype.TextAreaExtensions_focusTiddler=Story.prototype.focusTiddler;
Story.prototype.focusTiddler = function(title,field)
{
	this.TextAreaExtensions_focusTiddler.apply(this,arguments); // first call core
	var e = this.getTiddlerField(title,field);
	if (e && config.options.chkDisableAutoSelect) {
		if (e.setSelectionRange) // FF
			e.setSelectionRange(0,0);
		else if (e.createTextRange) // IE
			{ var r=e.createTextRange(); r.collapse(true); r.select(); }
	}
	if (e && config.options.chkTextAreaExtensions) addKeyDownHandlers(e);
}
//}}}

//{{{
function addKeyDownHandlers(e)
{
	// exit if not textarea or element doesn't allow selections
	if (e.tagName.toLowerCase()!="textarea" || !e.setSelectionRange) return;

	// utility function: exits keydown handler and prevents browser from processing the keystroke
	var processed=function(ev) {
		ev.cancelBubble=true; // IE4+
		try{event.keyCode=0;}catch(e){}; // IE5
		if (window.event) ev.returnValue=false; // IE6
		if (ev.preventDefault) ev.preventDefault(); // moz/opera/konqueror
		if (ev.stopPropagation) ev.stopPropagation(); // all
		return false;
	}
	// capture keydown in edit field
	e.saved_onkeydown=e.onkeydown; // save current keydown handler (if any)
	e.onkeydown=function(ev) { if (!ev) var ev=window.event;
		var key=ev.keyCode;
		if (!key) {
			var char=event.which?event.which:event.charCode;
			if (char==102) key=70;
			if (char==103) key=71;
		}
		// process CTRL-F (find matching text) or CTRL-G (find next match)
		if (ev.ctrlKey && (key==70||key==71)) {

			// prompt for text to find
			var defFind=e.findText?e.findText:e.value.substring(e.selectionStart,e.selectionEnd);
			if (key==70||!e.findText||!e.findText.length) // ctrl-f or no saved search text
				{ var f=prompt("find:", defFind); e.focus(); if (f) e.findText=f; }
			if (!e.findText||!e.findText.length) return processed(ev); //  if no search text, exit

			// do case-insensitive match with 'wraparound'...  if not found, alert and exit 
			var newstart=e.value.toLowerCase().indexOf(e.findText.toLowerCase(),e.selectionStart+1);
			if (newstart==-1) newstart=e.value.toLowerCase().indexOf(e.findText.toLowerCase());
			if (newstart==-1) { alert("'"+e.findText+"' not found"); e.focus(); return processed(ev); }

			// set new selection, scroll it into view, and report line position in status bar
			e.setSelectionRange(newstart,newstart+e.findText.length);
			var linecount=e.value.split('\n').length;
			var thisline=e.value.substr(0,e.selectionStart).split('\n').length;
			e.scrollTop=Math.floor((thisline-1-e.rows/2)*e.scrollHeight/linecount);
			window.status="line: "+thisline+"/"+linecount;
			return processed(ev);
		}
		if (e.saved_onkeydown) // call previous keydown handler (if any)
			e.saved_onkeydown(ev);
	}
}
//}}}

// // 'autosize' toolbar command
//{{{
config.commands.autosizeEditor = {
	text: 'autosize',
	tooltip: 'adjust the editor height to fit the contents',
	text_alt: '<input type="checkbox" style="padding:0;margin:0;border:0;background:transparent;" checked>autosize',
	tooltip_alt: 'uncheck to reset the editor to the standard height',
	hideReadOnly: false,
	handler: function(event,src,title) {
		var here=story.findContainingTiddler(src); if (!here) return;
		var ta=here.getElementsByTagName('textarea'); if (!ta) return;
		for (i=0;i<ta.length;i++) { ta[i].button=src; if (!ta[i].maxed) this.start(ta[i]); else this.stop(ta[i],true); }
		return false;
	},
	start: function(e) {
		if (!e.savedkeyup) e.savedkeyup=e.onkeyup;
		if (!e.savedkeypress) e.savedkeypress=e.onkeypress;
		e.savedheight=e.style.height;
		e.style.height=e.scrollHeight-2+'px'; // NOTE "-2" adjustment...  for scrollbar top+bottom border width???
		e.onkeypress=function(ev) {
			if (!ev) var ev=window.event; var e=resolveTarget(ev);
			if (ev.keyCode==33) { // PGUP
				if (window.scrollByPages) window.scrollByPages(-1);
				return false;
			}
			if (ev.keyCode==34) { // PGDN
				if (window.scrollByPages) window.scrollByPages(1);
				return false;
			}
			if (e.savedkeypress) e.savedkeypress();
		}
		e.onkeyup=function(ev) {
			if (!ev) var ev=window.event; var e=resolveTarget(ev);
			e.style.height=e.scrollHeight-2+'px';
			if (e.savedkeyup) e.savedkeyup();
		}
		e.button.innerHTML=config.commands.autosizeEditor.text_alt;
		e.button.title=config.commands.autosizeEditor.tooltip_alt;
		e.maxed=true;
	},
	stop: function(e,resetHeight) {
		if (resetHeight) e.style.height=e.savedheight;
		e.onkeyup=e.savedkeyup;
		e.onkeypress=e.savedkeypress;
		e.button.innerHTML=config.commands.autosizeEditor.text;
		e.button.title=config.commands.autosizeEditor.tooltip;
		e.maxed=false;
	}
};
//}}}

// // grab-and-stretch handle for textareas
//{{{
config.macros.resizeEditor = {
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		var here=story.findContainingTiddler(place); if (!here) return;
		var ta=here.getElementsByTagName('textarea'); if (!ta) return;
		for (i=0;i<ta.length;i++) new window.TextAreaResizer(ta[i]);
	}
}

// TextAreaResizer script by Jason Johnston (jj@lojjic.net)
// Created August 2003.  Use freely, but give me credit.
// adds a handle below textareas that the user can drag with the mouse to resize the textarea.
// MODIFIED by ELS for cross-browser (IE) compatibility, including:
//    fixups and adjustments to CSS styles,
//    use 'old style' assignment of mouse event handlers instead of using addEventListener(),
//    use window.event if event param is null,
//    use offsetHeight instead of getComputedStyle()
//    use explicit window.* global scope declaration for functions called from event handlers

window.TextAreaResizer = function(elt) {
	this.element = elt;
	this.create();
}
window.TextAreaResizer.prototype = {
	create : function() {
		var elt = this.element;
		var thisRef = this;
		var h = this.handle = document.createElement("div");
		h.style.height = "3px"; // was 4px... looked too fat!
		h.style.overflow = "hidden"; // ELS: force IE to trim height to < 1em
		h.style.width="auto";
		h.style.backgroundColor = "#999"; // ELS: standard mid-tone (dark) gray
		h.style.cursor = "s-resize";
		h.title = "Drag to resize text box";
		h.onmousedown=function(evt){thisRef.dragStart(evt)};
		elt.parentNode.insertBefore(h, elt.nextSibling);
	},
	dragStart : function(evt) {
		if (!evt) var evt=window.event;
		this.dragStop(evt); // ELS: stop any current drag processing first
		var thisRef = this;
		this.dragStartY = evt.clientY;
		this.dragStartH = this.element.offsetHeight;
		document.savedmousemove=document.onmousemove;
		document.onmousemove=this.dragMoveHdlr=function(evt){thisRef.dragMove(evt)};
		document.savedmouseup=document.onmouseup;
		document.onmouseup=this.dragStopHdlr=function(evt){thisRef.dragStop(evt)};
	},
	dragMove : function(evt) {
		if (!evt) var evt=window.event;
		// ELS: make sure height is at least 10px
		var h=this.dragStartH+evt.clientY-this.dragStartY;
		if (h<10) h=10; this.element.style.height=h+"px";
		// ELS: match textarea width (which can change due to document scrollbars)
		this.handle.style.width=this.element.offsetWidth+"px";
		// ELS: when manually resizing, disable autoresizing (without restoring saved height)
		if (this.element.maxed!=undefined && this.element.maxed)
			config.commands.autosizeEditor.stop(this.element,false);
	},
	dragStop : function(evt) {
		if (!evt) var evt=window.event;
		document.onmousemove=(document.savedmousemove!=undefined)?document.savedmousemove:null;
		document.onmousemove=(document.savedmouseup!=undefined)?document.savedmouseup:null;
	},
	destroy : function() {
		var elt = this.element;
		elt.parentNode.removeChild(this.handle);
		elt.style.height = "";
	}
};
//}}}
 <html>
<sub><b>Notes:</b></sub>
<TEXTAREA name=notes10 rows=7
 cols=80 ></TEXTAREA>

</html>
#Book
##Orientation
###locate the book on a TimeLine of the other books of the bible
###Identify the general __location__ of where the events happened
###Identify the author and what his "story" was
###Identify any other books written by the author, and written about the same subject or time period
#Chapters
##Observation - have people read through the chapters out loud, then review looking for:
###''who'' - mark the first instance of each character in bold (paper: box-around) when they appear in that chapter
###@@what@@ - highlight things that seem especially important 
###__where__ - underline first instance of places (paper: green or underline) (see maps under references above)
###//when// - italicize important time indicators (paper: red or slanted box)
###[[why]] - write your own notes (WikiWords (CamelCase))to comment on something you've found to be important, or just make an existing word into a [[link]] to start a specific note about it.  You can also click "new here" to write a note about the whole verse.
####Interpretation (Exegesis)
####Application (Hermeneutics)
###@@bgcolor(#ff6600):How@@ did a certain thing happen (if important)"background color">orange
###__''Key Words''__ should be bolded and underlined (paper: double boxed)  (see book summaries to find key words)
###to mark large passages, e.g. someone is talking, or for "changes of scene", select the passage and using the wikibar select "paragraph">"quote">"by block"
### for the @@color(#cc0000):Key Verse@@ in each chapter @@color(#cc0000):make letters be red@@ by choosing "color">"text color" then selecting the shade you'd like
###for {{{scripture referencing scripture you could use "text">"monospaced"}}} but you can't do any other formatting within the block

##Summarize - when you're done the chapter, write down what you think the chapter key verse, theme, and write your own summary (in your own words)
#Book
##look at all the chapter themes and summaries and write down what you think the theme is for the whole book
##how do you think the theme for this book fits into the entire bible?
<<tiddler HideTiddlerTags>><script>
	// remove any existing 'tracframe' ID so that IFRAME is single-instance only...
	var f=document.getElementById('tracframe'); if (f) f.parentNode.removeChild(f);
</script><html><div style="white-space:nowrap;text-align:center;"><form target="tracframe"
	style="display:inline;text-align:left;margin:0;padding:0"
	action="http://trac.tiddlywiki.org/tiddlywiki/report/1"><!--
--><span style="white-space:nowrap;float:left;"><!--
--><!--
--><input type="button" value="<" title="back" 
	style="font-size:8pt;width:2em"
	onclick="try{window.frames['tracframe'].history.go(-1)}catch(e){window.history.go(-1)}; document.getElementById('tracframe').style.display='block'; this.form.done.disabled=false;" ><!--
--><input type="button" value=">" title="forward" 
	style="font-size:8pt;width:2em"
	onclick="try{window.frames['tracframe'].history.go(+1)}catch(e){window.history.go(+1)}; document.getElementById('tracframe').style.display='block'; this.form.done.disabled=false;"><!--
--><input type="button" value="+" title="refresh" 
	style="font-size:8pt;width:2em"
	onclick="try{window.frames['tracframe'].location.reload()}catch(e){}; document.getElementById('tracframe').style.display='block'; this.form.done.disabled=false;"><!--
--><input type="button" value="x" title="stop" 
	style="font-size:8pt;width:2em"
	onclick="window.stop()"><!--
-->&nbsp;&nbsp;&nbsp;&nbsp;<!--
--><select size="1" name=sort style="font-size:8pt;"
	title="view tickets by..." 
	onchange="if (this.selectedIndex==0) {this.selectedIndex=1; return; } document.getElementById('tracframe').style.display='block'; this.form.done.disabled=false; this.form.submit();"><!--
-->	<option value="">view by...<!--
-->	<option value="ticket" SELECTED>ticket #<!--
-->	<option value="summary">summary<!--
-->	<option value="component">component<!--
-->	<option value="version">version<!--
-->	<option value="milestone">milestone<!--
-->	<option value="type">type<!--
-->	<option value="owner">owner<!--
-->	<option value="create date">created<!--
--></select><select size="1" name=asc style="font-size:8pt;"
	title="sort order..."
	onchange="document.getElementById('tracframe').style.display='block'; this.form.done.disabled=false; this.form.submit();"><!--
-->	<option value="1">ascending<!--
-->	<option value="0" SELECTED>descending<!--
--></select><!--
--><input type="submit" value="get report"
	title="get ticket report using current settings"
	onclick="document.getElementById('tracframe').style.display='block'; this.form.done.disabled=false;"
	style="font-size:8pt;"><!--
--><!--
--></span><span style="float:right"><!--
--><!--
--><input type="button" value="open" title="open report in a separate window" 
	style="font-size:8pt;"
	onclick="var url='http://trac.tiddlywiki.org/tiddlywiki/report/1?sort='+this.form.sort.value+'&asc=0'; window.open(url)"><!--
--><input type="button" name="done" value="done" title="hide ticket display" disabled 
	style="font-size:8pt;" 
	onclick="window.stop(); document.getElementById('tracframe').style.display='none';  this.disabled=true;"><!--
--><!--
--></span><!--
--><!--
--><input type="text" name=search value=""
	title="enter text to search for...
	onfocus="this.select()"
	style="font-size:8pt;width:10em;"
	onkeypress="if (event.keyCode==13) { this.form.searchbutton.click();return false}"><!--
--><input type="button" name="searchbutton" value="search" 
	title="find text in tickets and/or changeset logs"
	style="font-size:8pt;"
	onclick="var url='http://trac.tiddlywiki.org/tiddlywiki/search?ticket=on&changeset=on&wiki=off&q='; window.frames['tracframe'].location=url+this.form.search.value; document.getElementById('tracframe').style.display='block';"><!--
--><!--
--></div></form><iframe name="tracframe" id="tracframe" src="" style="display:none;background:#eee;width:100%;height:30em;"></iframe><!--
--></html>
/%
|Name|TidIDECommand|
|Source|http://www.TiddlyTools.com/#TidIDECommand|
|Version|2.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|script|
|Requires|TidIDEPlugin, NestedSlidersPlugin, MoveablePanelPlugin, TextAreaPlugin, TiddlerTweakerPlugin, InlineJavascriptPlugin, QuickEditToolbar, CloseSlider, JavascriptShell, CompareTiddlers|
|Overrides||
|Description|command link invokes TidIDE editor for current tiddler|

Usage (in ViewTemplate):
	<span class='toolbar' macro='tiddler TidIDECommand'></span>
OR embedded directly in tiddler content:
	<<tiddler TidIDECommand>>

%/+++^70%^[TidIDE|Edit this tiddler using the TiddlyWiki Integrated Development Environment].../%
	%/<<moveablePanel nofold nohover noclose>>/%
	%/{{toolbar{<<tiddler QuickEditToolbar>><<tiddler CloseSlider>>}}}/%
	%/{{fine smallform{<<tidIDE system JavascriptShell CompareTiddlers TiddlerTweaker +edit:here>><<resizeEditor>>}}}/%
%/===
<!--{{{-->
<!--
|Name|TidIDEEditTemplate|
|Source|http://www.TiddlyTools.com/#TidIDEEditTemplate|
|Version||
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <<br>>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|template|
|Requires||
|Overrides||
|Description|alternative for EditTemplate, used with TidIDEStylesheet|
-->
<div class='toolbar' macro='toolbar -cancelTiddler'></div>
<div class='title' macro='view title'></div>
<div class='viewer' macro='tidIDE system +edit:here'></div>
<span macro='resizeEditor'></span><span macro='setUserName'></span>
<span 
<!--}}}-->
/%
Usage: <<tiddler TidIDEPanel with: ID>>

where 'ID' is any unique text, and is used to differentiate multiple instances of TidIDE that may be displayed simultaneously

%/{{smallform left fine{<<tidIDE id:$1 +system +JavascriptShell CompareTiddlers ShowSlices TicketTracker edit>>}}}
/***
|Name|TidIDEPlugin|
|Source|http://www.TiddlyTools.com/#TidIDEPlugin|
|Version|1.7.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|TiddlyWiki Integrated Development Environment - tools for authors and plugin writers|

~TidIDE (//prounounced "Tie Dyed"//) - ''Tid''dlyWiki ''I''ntegrated ''D''evelopment ''E''nvironment - tools for ~TiddlyWiki authors and editors.  

Provides a full-featured tiddler editor with key-by-key ''LIVE PREVIEW'' of //formatted// tiddler content!!  Also includes a diagnostic macro to help you debug your TiddlyWiki problems by letting you view the internal DOM (Document Object Model) tree structure for any specific part of the TiddlyWiki document.
!!!!!Configuration
<<<
Automatically freeze preview updates when a tiddler takes more than <<option txtTidIDEAutoFreeze>> milliseconds to render.
<<<
!!!!!Usage/Example
<<<
{{{<<tidIDE id:example edit:GettingStarted>>}}}
{{smallform{<<tidIDE id:example edit:GettingStarted>>}}}
!!!!!parameters:
* ''id'' - assign a unique ID to this instance of TidIDE.  (default id=current tiddler title or "" if not in a tiddler)
* ''edit'' includes tiddler editor/previewer.
**''edit:here'' automatically sets the editor to show the current tiddler contents (if in a tiddler)
**''edit:tiddlertitle'' automatically sets the editor to show the specified tiddler contents
* use ''{{{[[label|tiddlertitle]]}}}'' to include 'custom panels' (and corresponding labelled checkboxes to toggle their display)
* all parameters are optional.  The default panel is "edit:here".
* panel parameters preceded by a "+" are displayed by default.  If only one panel specified in the parameters, it is automatically displayed, even if the "+" is omitted.
!!!!!using the editor
The editor includes a droplist of all tiddlers in the document, sorted alpha-numerically by tiddler title.  Shadow tiddlers that have not been customized are added to the end of this list and marked with "(shadow)".  Next to the droplist are several buttons:
* ''view'' opens the tiddler in the normal ~TiddlyWiki display area
* ''add'' prompts for a new tiddler title and begins a new editing session
* ''remove'' deletes an existing tiddler (note: shadow tiddlers cannot be removed)
* ''save'' saves changes to the tiddler currently being edited
* ''save as'' saves changes using a new tiddler title
If a tiddlername was not specified in the macro, select a tiddler from the droplist (or press ''add'') to begin editing.  Once a tiddler has been loaded into the editor, you can change it's content, enter or select tags.

Normally, when you save changes to a tiddler, the created/modified dates and tiddler author are automatically updated.  However, it is sometimes useful to make small changes to a tiddler without automatically updating the date/author information.  Select the ''minor edits'' checkbox to prevent those values from being //automatically// changed.  In addition, this enables the date/author edit fields which allows you to //manually// 'back date' a tiddler or change the author to another name.  When the tiddler is saved, the date/author values shown in the edit fields will be used.
!!!!!using the previewer
The ''preview'' checkbox adds a display area that shows you what your tiddler changes will look like, //before// committing to those changes.

By default, this preview display is automatically rendered each time a key is typed into the tiddler content edit field.  As soon as changes are entered, they will be instantly visible within the preview display.  Unfortunately, the partial tiddler source definitions that occur //during// editing may somtimes cause rendering problems, and some exceptionally complex tiddlers make take an unusually long amount of time to completely render their content.   In such cases, key-by-key display updates are undesirable or impractical.

When ''preview'' is selected, you can also select ''freeze'' to suspend automatic key-by-key preview display updates.  The preview display will not be re-rendered again until you press the ''refresh'' button, or clear the 'freeze' checkbox, or switch to editing a different tiddler.  The editor automatically freezes the preview display whenever the //rendering time// exceeds a pre-determined time limit (see configuration section), specified in milliseconds.  Note: the ''actual elapsed time'' used to process and render any given tiddler is reported in the browser's status bar area whenever that tiddler is previewed.

The previewer also can display a ''DOM viewer'' and an ''HTML viewer'' that are also updated with each keystroke.  These text-based displays can be helpful while attempting to correct or enhance the formatting of tiddler content, especially when complex combinations of wiki-syntax produce unexpected or undesired results.
!!!!! ~DOMViewer macro
syntax: {{{<<DOMViewer rows:nn indent:xxxx inline path elementID|tiddlertitle>>}}}

Whenever TiddlyWiki renders a given tiddler, it creates a 'tree' of DOM (Document Object Model) elements that represent the information that is displayed by the browser.  You can use the ''DOMViewer'' macro to examine the internal DOM elements that are produced by TiddlyWiki's formatter (the 'wikifier'), or elements directly produced by embedded macros that create custom formatted output.  This can be particularly helpful when trying to fine tune the layout and appearance of your tiddler content.

DOMViewer creates a textarea control and reports the DOM tree for the current 'insertion point' where the DOMViewer macro is being placed.  ''inline'' flag uses TiddlyWiki rendering instead of textarea control. ''path'' shows the relative location of each child element in the DOM tree, using subscript notation, ''[elementID or tiddlertitle]'' displays DOM elements starting from the node with the specified ID.  If that ID is not found in the DOM tree, the macro attempts to open a tiddler with that title and then displays the "tiddler"+title DOM elements that were rendered.
<<<
!!!!!Installation
<<<
import (or copy/paste) the following tiddlers into your document:
''TidIDEPlugin'' (tagged with <<tag systemConfig>>)
^^documentation and javascript for macro handling^^
<<<
!!!!!Revision History
<<<
''2007.09.09 [1.7.0]'' split systemInfo into separate plugin (see [[SystemInfoPlugin]])
|please see [[TidIDEPluginHistory]] for additional revision details|
''2006.04.15 [0.5.0]'' Initial ALPHA release. Converted from inline script.
<<<
!!!!!Credits
<<<
This feature was developed by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]].
<<<
!!!!!Code
***/
// // version info
//{{{
version.extensions.tidIDE = {major: 1, minor: 7, revision: 0, date: new Date(2006,9,9)};
//}}}

// //  macro definition
//{{{
config.macros.tidIDE = {
	versionMsg: "TidIDE v%0.%1.%2: ",
	datetimefmt: "0MM/0DD/YYYY 0hh:0mm",
	titleMsg: "Please enter a new tiddler title",
	isShadowMsg: "'%0' is a shadow tiddler and cannot be removed.",
	renderMsg: "rendering preview...",
	timeoutMsg: " (> %0ms)",
	freezeMsg: " - preview is frozen.  Press [refresh] to re-display.",
	evalMsg: "Warning!!\n\nThis action will process '%0' as a systemConfig (plugin) tiddler, and may produce unexpected results!\n\nAre you sure you want to proceed?",
	toolsDef: "<html><a href='javascript:config.macros.tidIDE.set(\"%0\",\"%1\");'>edit %1...</a></html>",
	editorLabel: "TiddlerEditor",
};
config.macros.tidIDE.handler= function(place,macroName,params) {
	var here=story.findContainingTiddler(place);
	var selectors="";
	var panels="";
	var showsys=false;
	var title="";
	var id=""; if (here) id=here.getAttribute("tiddler").replace(/ /g,"_");
	var p=params.shift();
	if (!p) p="edit:here"; // default to editor if no params
	var openpanels=[];
	var panelcount=0;
	while (p) {
		var defOpen=(p.substr(0,1)=="+"); if (defOpen) p=p.substr(1);
		if (p.substr(0,3)=="id:")
			{ id=p.substr(3); }
		else if (p.substr(0,4)=="edit") {
			panelcount++;
			defOpen=defOpen || (!params[0] && panelcount==1); // if only one panel to show, default to open
			var toolname=this.editorLabel;
			if (p.indexOf('|')!=-1) toolname=p.substr(0,p.indexOf('|'));
			selectors+=this.html.editorchk.replace(/%toolname%/mg,toolname);
			selectors=selectors.replace(/%showpanel%/mg,defOpen?"CHECKED":"");
			panels+=this.html.editorpanel;
			// editor panel setup...
			panels=panels.replace(/%showpanel%/mg,defOpen?"block":"none");
			panels=panels.replace(/%maxrows%/mg,config.options.txtMaxEditRows);
			panels=panels.replace(/%disabled%/mg,readOnly?"DISABLED":"");
			panels=panels.replace(/%readonlychk%/mg,readOnly?"CHECKED":"");
			panels=panels.replace(/%minoredits%/mg,config.options.chkForceMinorUpdate&&!readOnly?"":"DISABLED");
			panels=panels.replace(/%minorchk%/mg,config.options.chkForceMinorUpdate?"CHECKED":"");
			var tiddlers=store.getTiddlers("title"); var tiddlerlist=""; 
			for (var t=0; t<tiddlers.length; t++)
				tiddlerlist+='<option value="'+tiddlers[t].title+'">'+tiddlers[t].title+'</option>';
			for (var t in config.shadowTiddlers)
				if (!store.tiddlerExists(t)) tiddlerlist+="<option value='"+t+"'>"+t+" (shadow)</option>";
			panels=panels.replace(/%tiddlerlist%/mg,tiddlerlist);
			var tags = store.getTags(); var taglist="";
			for (var t=0; t<tags.length; t++)
				taglist+="<option value='"+tags[t][0]+"'>"+tags[t][0]+"</option>";
			panels=panels.replace(/%taglist%/mg,taglist);
			if (p.substr(0,5)=="edit:") { 
				title=p.substr(5); 
				if (here && title=="here") title=here.id.substr(7);
			}
		}
		else {
			panelcount++;
			defOpen=defOpen || (!params[0] && panelcount==1); // if only one panel to show, default to open
			var toolid=toolname=p;
			if (p.indexOf('|')!=-1)
				{ toolname=p.substr(0,p.indexOf('|')); toolid=p.substr(p.indexOf('|')+1); }
			selectors+=this.html.toolschk.replace(/%toolid%/mg,toolid).replace(/%toolname%/mg,toolname);
			selectors=selectors.replace(/%showpanel%/mg,defOpen?"CHECKED":"");
			panels+=this.html.toolspanel.replace(/%toolid%/mg,toolid);
			panels=panels.replace(/%showpanel%/mg,defOpen?"block":"none");
			if (defOpen) openpanels.push(toolid);
		}
		p=params.shift(); // next param
	}
	var html=this.html.framework;
	if (panelcount<2)
		html=html.replace(/%version%/mg,'').replace(/%selector%/mg,''); // omit header/selectors if just one panel to display
	else {
		html=html.replace(/%version%/mg,
			this.versionMsg.format([version.extensions.tidIDE.major,version.extensions.tidIDE.minor,version.extensions.tidIDE.revision]));
		html=html.replace(/%selector%/mg,selectors+"<hr style='margin:0;padding:0'>");
	}
	html=html.replace(/%panels%/mg,panels);
	html=html.replace(/%id%/mg,id);
	var newIDE=createTiddlyElement(place,"span");
	newIDE.innerHTML=html;
	if (title.length) this.set(id,title);  // pre-load tiddler editor (if needed)
	if (openpanels.length) for (i=0;i<openpanels.length;i++) { config.macros.tidIDE.loadPanel(id,openpanels[i]); }
	// see [[TextAreaPlugin]] for extended ctrl-F/G (search/search again)and TAB handler definitions
	var elems=newIDE.getElementsByTagName("textarea");
	for (var i=0;i<elems.length;i++) { 
		if (window.addKeyDownHandlers!=undefined) window.addKeyDownHandlers(elems[i]);
	}
}
//}}}

// // CUSTOM PANEL FUNCTIONS 
//{{{
config.macros.tidIDE.loadPanel=function(id,toolid) {
	var place=document.getElementById(id+"_"+toolid+"_panel"); if (!place) return;
	var t=store.getTiddlerText(toolid,"");
	place.innerHTML=""; 
	if (t) wikify(t,place); else place.innerHTML=this.toolsDef.format([id,toolid]);
}
//}}}

// // EDITOR PANEL FUNCTIONS
//{{{
config.macros.tidIDE.set=function(id,title) {
	var place=document.getElementById(id+"_editorpanel"); if (!place) return;
	var f=document.getElementById(id+"_editorform");
	var p=document.getElementById(id+"_preview");
	if (f.dirty && !confirm(config.commands.cancelTiddler.warning.format([f.current]))) return;
	// reset to form defaults
	f.dirty=false;
	f.current="";
	f.created.value=f.created.defaultValue;
	f.modified.value=f.modified.defaultValue;
	f.author.value=f.author.defaultValue;
	f.content.value=f.content.defaultValue;
	f.tags.value=f.tags.defaultValue;
	f.size.value=f.size.defaultValue;
	f.freeze.checked=false;
	f.domview.value="";
	f.htmlview.value="";
	f.status.value="";
	p.innerHTML="";
	if (!title.length) return;
	f.current=title;
	// values for new/shadow tiddlers
	var cdate=new Date();
	var mdate=new Date();
	var modifier=config.options.txtUserName;
	var text=config.views.editor.defaultText.format([title]);
	var tags="";
	// adjust values for shadow tiddlers
	if (store.isShadowTiddler(title))
		{ modifier=config.views.wikified.shadowModifier; text=store.getTiddlerText(title) }
	// get values for specified tiddler (if it exists)
	var t=store.getTiddler(title);
	if (t)	{ var cdate=t.created; var mdate=t.modified; var modifier=t.modifier; var text=t.text; var tags=t.getTags(); }
	if (!t && !store.isShadowTiddler(title)) f.tiddlers.options[f.tiddlers.options.length]=new Option(title,title,false,true); // add item to list
	f.tiddlers.value=title; // select current title (just in case it wasn't already selected)
	f.created.value=cdate.formatString(this.datetimefmt);
	f.modified.value=mdate.formatString(this.datetimefmt);
	f.author.value=modifier;
	f.content.value=text;
	f.tags.value=tags;
	f.minoredits.checked=config.options.chkForceMinorUpdate&&!readOnly;
	f.size.value=f.content.value.length+" bytes";
	if (f.preview.checked) { p.style.display="block"; this.render(id); }
}

config.macros.tidIDE.add=function(id) {
	var place=document.getElementById(id+"_editorpanel"); if (!place) return;
	var f=document.getElementById(id+"_editorform");
	var p=document.getElementById(id+"_preview");
	if (f.dirty && !confirm(config.commands.cancelTiddler.warning.format([f.current]))) return;
	var title=prompt(this.titleMsg,config.macros.newTiddler.title);
	while (title && store.tiddlerExists(title) && !confirm(config.messages.overwriteWarning.format([title])))
		title=prompt(this.titleMsg,config.macros.newTiddler.title);
	if (!title || !title.trim().length) return; // cancelled by user
	f.dirty=false; // suppress unneeded confirmation message
	this.set(id,title);
}

config.macros.tidIDE.remove=function(id) {
	var place=document.getElementById(id+"_editorpanel"); if (!place) return;
	var f=document.getElementById(id+"_editorform");
	var p=document.getElementById(id+"_preview");
	if (!f.current.length) return;
	if (!store.tiddlerExists(f.current) && store.isShadowTiddler(f.current)) { alert(this.isShadowMsg.format([f.current])); return; }
	if (config.options.chkConfirmDelete && !confirm(config.commands.deleteTiddler.warning.format([f.current]))) return;
	if (store.tiddlerExists(f.current)) {
		story.closeTiddler(f.current);
		store.removeTiddler(f.current);
		store.setDirty(true);
		if(config.options.chkAutoSave) saveChanges();
	}
	f.tiddlers.options[f.tiddlers.selectedIndex]=null; // remove item from list
	f.dirty=false; // suppress unneeded confirmation message
	this.set(id,""); // clear form controls
}

config.macros.tidIDE.save=function(id,saveAs) {
	var place=document.getElementById(id+"_editorpanel"); if (!place) return;
	var f=document.getElementById(id+"_editorform");
	var title=f.current;
	if (!title || !title.trim().length || saveAs) { // get a new title
		title=prompt(this.titleMsg,config.macros.newTiddler.title);
		while (title && store.tiddlerExists(title) && !confirm(config.messages.overwriteWarning.format([title])))
			title=prompt(this.titleMsg,config.macros.newTiddler.title);
		if (!title || !title.trim().length) return; // cancelled by user
		f.tiddlers.options[f.tiddlers.options.length]=new Option(title,title,false,true); // add item to list
		f.current=title;
	}
	var author=config.options.txtUserName;
	var mdate=new Date();
	var content=f.content.value;
	var tags=f.tags.value;
	var tiddler=store.saveTiddler(title,title,content,author,mdate,tags);
	if (f.minoredits.checked) {
		var author=f.author.value;
		var mdate=new Date(f.modified.value);
		var cdate=new Date(f.created.value);
		tiddler.assign(null,null,author,mdate,null,cdate);
	}
	store.setDirty(true);
	if(config.options.chkAutoSave) saveChanges();
	story.refreshTiddler(title,null,true);
	f.dirty=false;
}
//}}}

// // EDITOR PANEL: PREVIEW FUNCTIONS
//{{{
if (config.options.txtTidIDEAutoFreeze==undefined)
	config.options.txtTidIDEAutoFreeze=250; // limit (in milliseconds) for auto-freezing preview display

config.macros.tidIDE.render=function(id) {
	var place=document.getElementById(id+"_editorpanel"); if (!place) return;
	var f=document.getElementById(id+"_editorform");
	var p=document.getElementById(id+"_preview");
	var d=document.getElementById(id+"_domview");
	var h=document.getElementById(id+"_htmlview");
	p.innerHTML="";
	f.status.value=this.renderMsg;
	var start=new Date();
	wikify(f.content.value.replace(regexpCarriageReturn,''),p);
	var end=new Date();
	this.renderDOM(id);
	this.renderHTML(id);
	f.status.value=f.current+": "+(end-start+1)+"ms";
	// automatically suspend preview updates for slow rendering tiddlers
	if (end-start+1>config.options.txtTidIDEAutoFreeze) {
		f.freeze.checked=true;
		f.status.value+=this.timeoutMsg.format([config.options.txtTidIDEAutoFreeze]);
	}
	if (f.freeze.checked) f.status.value+=this.freezeMsg;
}

config.macros.tidIDE.renderDOM=function(id) {
	var place=document.getElementById(id+"_editorpanel"); if (!place) return;
	var f=document.getElementById(id+"_editorform");
	var p=document.getElementById(id+"_preview");
	var d=document.getElementById(id+"_domview");
	var h=document.getElementById(id+"_htmlview");
	p.style.height=(f.dom.checked||f.html.checked)?"10em":"25em";
	if (f.dom.checked) d.value=this.getNodeTree(p,"|  ");
	d.style.display=f.dom.checked?"inline":"none";
	d.style.width=f.html.checked?"49.5%":"100%";
	h.style.width=f.dom.checked?"49.5%":"100%";
}

config.macros.tidIDE.renderHTML=function(id) {
	var place=document.getElementById(id+"_editorpanel"); if (!place) return;
	var f=document.getElementById(id+"_editorform");
	var p=document.getElementById(id+"_preview");
	var d=document.getElementById(id+"_domview");
	var h=document.getElementById(id+"_htmlview");
	p.style.height=(f.dom.checked||f.html.checked)?"10em":"25em";
	if (f.html.checked) h.value=this.formatHTML(p.innerHTML);
	h.style.display=f.html.checked?"inline":"none";
	d.style.width=f.html.checked?"49.5%":"100%";
	h.style.width=f.dom.checked?"49.5%":"100%";
}

config.macros.tidIDE.formatHTML=function(txt) {
	if (config.browser.isIE) return txt; // BYPASS - 4/24/2006 due to IE hang problem.  Will fix later...
	var out="";
	var indent="";
	var level=0;
	for (var i=0;i<txt.length;i++) {
		var c=txt.substr(i,1);
		if (c=="<") {
			if (txt.substr(i+1,1)=="/")  indent=indent.substr(0,indent.length-2);
			out+="\n"+indent;
			if (txt.substr(i+1,1)!="/" && txt.substr(i+1,3)!="br>" && txt.substr(i+1,2)!="p>" && txt.substr(i+1,3)!="hr>")  indent+="  ";
		}
		out+=c;
		if (c=="\n")
			out+=indent;
		if (c==">" && txt.substr(i+1,1)!="<")
			out+="\n"+indent;
	}
	return out;
}

config.macros.tidIDE.getNodeTree=function(theNode,theIndent,showPath,inline,thePrefix,thePath)
{
	if (!theNode) return "";
	if (!thePrefix) thePrefix="";
	if (!thePath) thePath="";
	var mquote='"'+(inline?"{{{":"");
	var endmquote=(inline?"}}}":"")+'"';
	// generate output for this node
	var out = thePrefix;
	if (showPath && thePath.length)
		out += (inline?"//":"")+thePath.substr(1)+":"+(inline?"//":"")+"\r\n"+thePrefix;
	if (theNode.className=="DOMViewer")
		return out+'[DOMViewer]\r\n'; // avoid self-referential recursion
	out += (inline?"''":"")+theNode.nodeName.toUpperCase()+(inline?"''":"");
	if (theNode.nodeName=="#text")
		out += ' '+mquote+theNode.nodeValue.replace(/\n/g,'\\n')+endmquote;
	if (theNode.className)
		out += ' class='+mquote+theNode.className+endmquote;
	if (theNode.type)
		out += ' type='+mquote+theNode.type+endmquote;
	if (theNode.id)
		out += ' id='+mquote+theNode.id+endmquote;
	if (theNode.name)
		out += " "+theNode.name+(theNode.value?"="+mquote+theNode.value+endmquote:"");
	if (theNode.href)
		out += ' href='+mquote+theNode.href+endmquote;
	if (theNode.src)
		out += ' src='+mquote+theNode.src+endmquote;
	if (theNode.attributes && theNode.getAttribute("tiddlyLink")!=undefined)
		out += ' tiddler='+mquote+theNode.getAttribute("tiddlyLink")+endmquote;
	out += "\r\n";
	// recursively generate output for child nodes
	thePath=thePath+"."+theNode.nodeName.toLowerCase();
	thePrefix=theIndent+thePrefix;
	for (var i=0;i<theNode.childNodes.length;i++)
	{
		var thisChild=theNode.childNodes.item(i);
		var theNum=(inline?"~~":"(")+(i+1)+(inline?"~~":")");
		out += this.getNodeTree(thisChild,theIndent,showPath,inline,thePrefix,thePath+theNum);
	}
	return out;
}
//}}}

// // DOMViewer macro
//{{{
version.extensions.DOMViewer = version.extensions.tidIDE;
config.macros.DOMViewer = { };
config.macros.DOMViewer.handler = function(place,macroName,params) {
	// set default params
	var inline=false;
	var theRows=15;
	var theIndent="|  ";
	var showPath=false;
	var theTarget=place;
	// unpack options parameters
	if (params[0]=='inline') { inline=true; theIndent=">"; params.shift(); } 
	if (params[0]&&(params[0].substr(0,7)=="indent:")) { theIndent=params[0].substr(7); params.shift(); } 
	if (params[0]&&(params[0].substr(0,5)=="rows:")) { theRows=params[0].substr(5); params.shift(); } 
	if (params[0]=='path') { showPath=true; params.shift(); } 
	if (params[0]) {
		theTarget=document.getElementById(params[0]);
		if (!theTarget)
			if (store.getTiddler(params[0])!=undefined) {
				theTarget=document.getElementById("tiddler"+params[0]);
				if (!theTarget && confirm("DOMViewer asks:\n\nIs it OK to open tiddler '"+params[0]+"' now?")) { 
					story.displayTiddler(null,params[0],1,null,null,false);
					theTarget=document.getElementById("tiddler"+params[0]);
				}
			}
		params.shift();
	}
	// generate and display DOM tree
	if (inline) {
		var out=config.macros.tidIDE.getNodeTree(theTarget,theIndent,showPath,inline);
		wikify(out,place);
	}
	else {
		var out=config.macros.tidIDE.getNodeTree(theTarget,theIndent,showPath,inline);
		var css=".DOMViewer{width:100%;font-size:8pt;color:inherit;background:transparent;border:0px;}";
		setStylesheet(css,"DOMViewerPlugin");
		var theTextArea=createTiddlyElement(place,"textarea",null,"DOMViewer",out);
		theTextArea.rows=theRows;
		theTextArea.cols=60;
		theTextArea.wrap="off";
		theTextArea.theTarget=theTarget;
		theTextArea.theIndent=theIndent;
		theTextArea.showPath=showPath;
	}
}
//}}}

// // HTML DEFINITIONS
//{{{
config.macros.tidIDE.html = { };
config.macros.tidIDE.html.framework = " \
	<html> %version% <form style='display:inline;margin:0;padding:0;'>%selector%</form> %panels% </html> \
";
//}}}
//{{{
config.macros.tidIDE.html.editorchk = " \
	<input type=checkbox name=editor \
		style='display:inline;width:auto;margin:1px;' \
		title='add/delete/modify tiddlers' %showpanel% \
		onclick='document.getElementById(\"%id%_editorpanel\").style.display=this.checked?\"block\":\"none\"; \
			if (this.checked) config.macros.tidIDE.render(\"%id%\");'>%toolname% \
";
config.macros.tidIDE.html.toolschk = " \
	<input type=checkbox name=tools \
		style='display:inline;width:auto;margin:1px;' \
		title='' %showpanel% \
		onclick='document.getElementById(\"%id%_%toolid%_panel\").style.display=this.checked?\"block\":\"none\"; \
			if (this.checked) config.macros.tidIDE.loadPanel(\"%id%\",\"%toolid%\");'>%toolname% \
";
//}}}
//{{{
config.macros.tidIDE.html.toolspanel = " \
	<div id='%id%_%toolid%_panel' style='display:%showpanel%;margin:0;margin-top:0.5em'> \
	</div> \
";
//}}}
//{{{
config.macros.tidIDE.html.editorpanel = " \
	<div id='%id%_editorpanel' style='display:%showpanel%;margin:0;margin-top:0.5em'> \
	<form id='%id%_editorform' style='display:inline;margin:0;padding:0;'> \
	<!-- tiddler editor list and buttons --> \
	<select size=1 name=tiddlers style='display:inline;width:44%;'  \
		onchange='config.macros.tidIDE.set(\"%id%\",this.value); this.value=this.form.current;'> \
	<option value=''>select a tiddler...</option> \
	%tiddlerlist% \
	</select><!-- \
	--><input name=add type=button style='display:inline;width:8%' \
		value='new' title='create a new tiddler' \
		onclick='config.macros.tidIDE.add(\"%id%\")' %disabled%><!-- \
	--><input name=remove type=button style='display:inline;width:8%' \
		value='remove' title='delete this tiddler' \
		onclick='config.macros.tidIDE.remove(\"%id%\")' %disabled%><!-- \
	--><input name=save type=button style='display:inline;width:8%' \
		value='save' title='save changes to this tiddler' \
		onclick='config.macros.tidIDE.save(\"%id%\")' %disabled%><!-- \
	--><input name=saveas type=button style='display:inline;width:8%' \
		value='save as' title='save changes to a new tiddler' \
		onclick='config.macros.tidIDE.save(\"%id%\",true)' %disabled%><!-- \
	--><input name=view type=button style='display:inline;width:8%' \
		value='open' title='open this tiddler for regular viewing' \
		onclick='if (!this.form.current.length) return;	story.displayTiddler(null,this.form.current)'><!-- \
	--><input name=run type=button style='display:inline;width:8%' \
		value='run' title='evaluate this tiddler as a javascript \"systemConfig\" plugin' \
		onclick='if (!confirm(config.macros.tidIDE.evalMsg.format([this.form.current]))) return false; \
			var err=processConfig(this.form.content.value); \
			if(err)displayMessage(config.messages.customConfigError.format([err,this.form.current]));'><!-- \
	--><input name=previewbutton type=button style='display:inline;width:8%;' \
		value='preview' title='show \"live\" preview display' \
		onclick='document.getElementById(\"%id%_previewpanel\").style.display=\"block\"; \
			this.form.preview.checked=true; config.macros.tidIDE.render(\"%id%\")'><!-- \
	hidden field for preview show/hide state: \
	--><input name=preview type=checkbox style='display:none;'>\
	<!-- tiddler content edit --> \
	<div><textarea id='%id%_content' name='content' edit='text' cols=60 rows=%maxrows% \
		style='width:100%;' \
		onkeyup='var f=this.form; f.dirty=true; f.size.value=this.value.length+\" bytes\";  \
			var p=document.getElementById(\"%id%_preview\"); \
			if (f.preview.checked && !f.freeze.checked) { config.macros.tidIDE.render(\"%id%\"); }'></textarea></div> \
	<!-- tag edit and droplist --> \
	<table width='100%' style='border:0;padding:0;margin:0'><tr style='border:0;padding:0;margin:0'> \
	<td style='border:0;padding:0;margin:0'> \
		<input type=text name=tags size=60 style='width:100%;' value='' \
			onchange='this.form.dirty=true' %disabled%> \
	</td><td width='1' style='border:0;padding:0;margin:0;'> \
		<select size=1 name=taglist \
			onchange='this.form.dirty=true; this.form.tags.value+=\" \"+this.value' %disabled%> \
		<option value=''>select tags...</option> \
		%taglist% \
		</select> \
	</td></tr></table> \
	<!--  created/modified dates, author, current tiddler size --> \
	<div style='float:right;'> \
		created <input type=text name=created size=15 \
			style='display:inline;;text-align:center;padding:0;' value='' \
			onchange='this.form.dirty=true' %minoredits%> \
		modified <input type=text name=modified size=15 \
			style='display:inline;text-align:center;padding:0;' value='' \
			onchange='this.form.dirty=true;' %minoredits%> \
		by <input type=text name=author size=15 \
			style='display:inline;padding:0;' value='' \
			onfocus='this.select()' onchange='this.form.dirty=true' %minoredits%> \
		<input type=text name=size size=10 \
			style='display:inline;text-align:center;padding:0;' value='' \
			onfocus='this.blur()' onkeydown='return false' DISABLED>  \
	</div> \
	<!-- toggles: read-only, minor edit --> \
	<span style='white-space:nowrap'> \
	<input type=checkbox name=readonly \
		style='display:inline;width:auto;margin:1px;' %readonlychk% \
		title='do not allow tiddler changes to be saved' \
		onclick='readOnly=config.options.chkHttpReadOnly=this.checked;saveOptionCookie(\"chkHttpReadOnly\"); \
			var f=this.form; f.minoredits.disabled=f.tags.disabled=f.taglist.disabled=this.checked; \
			f.add.disabled=f.remove.disabled=f.save.disabled=f.saveas.disabled=this.checked; \
			f.created.disabled=f.modified.disabled=f.author.disabled=this.checked||!f.minoredits.checked;'>readonly \
	<input type=checkbox name=minoredits \
		style='display:inline;width:auto;margin:1px;' %disabled% %minorchk% \
		title='check: save datestamps/author as entered, uncheck: auto-update modified/author' \
		onclick='this.form.created.disabled=this.form.modified.disabled=this.form.author.disabled=!this.checked; \
			config.options.chkForceMinorUpdate=this.checked;saveOptionCookie(\"chkForceMinorUpdate\");'>minor edits \
	</span> \
	<!-- tiddler preview display --> \
	<div id='%id%_previewpanel' style='display:none;white-space:nowrap'> \
	<div id='%id%_preview' class='viewer' style='margin:0;margin-top:.5em;height:25em;overflow:auto;white-space:normal'> \
		&nbsp; \
	</div> \
	<!-- DOM and HTML viewers --> \
	<textarea id='%id%_domview' name=domview cols=60 rows=12 wrap=off \
		onfocus='this.select()' style='display:none;width:100%;height:16em;'></textarea><!-- \
	--><textarea id='%id%_htmlview' name=htmlview cols=60 rows=12 wrap=off \
		onfocus='this.select()' style='display:none;width:100%;height:16em;'></textarea> \
	<!-- status line, preview option checkboxes, run/refresh buttons --> \
	<table width='100%' style='border:0;padding:0;margin:0'><tr style='border:0;padding:0;margin:0'> \
	<td style='border:0;padding:0;margin:0'> \
		<input type=text '%id%_status' name=status style='padding:0;width:100%;'> \
	</td><td style='width:1%;border:0;padding:0;margin:0;text-align:right;white-space:nowrap'> \
		<input type=checkbox name=dom style='display:inline;width:auto;margin:1px;' \
			title='show Document Object Model (DOM) information' \
			onclick='config.macros.tidIDE.renderDOM(\"%id%\");'>DOM \
		<input type=checkbox name=html style='display:inline;width:auto;margin:1px;' \
			title='show rendered HTML' \
			onclick='config.macros.tidIDE.renderHTML(\"%id%\");'>HTML \
		<input type=checkbox name=freeze style='display:inline;width:auto;margin:1px;' \
			title='do not update preview display as changes are made' \
			onclick='var p=document.getElementById(\"%id%_preview\");  \
				if (this.checked) this.form.status.value+=config.macros.tidIDE.freezeMsg; \
				else config.macros.tidIDE.render(\"%id%\");'>freeze \
		<!-- COMMENTED OUT <input type=button style='display:inline;width:auto;' value='run' \
			title='evaluate this tiddler as a javascript \"systemConfig\" plugin' \
			onclick='if (!confirm(config.macros.tidIDE.evalMsg.format([this.form.current]))) return false; \
				var err=processConfig(this.form.content.value); \
				if(err)displayMessage(config.messages.customConfigError.format([err,this.form.current]));'> END COMMENT --><!-- \
		--><input type=button style='display:inline;width:auto;' value='refresh' \
			title='update preview display' \
			onclick='config.macros.tidIDE.render(\"%id%\")'><!-- \
		--><input type=button style='display:inline;width:auto;' value='hide' \
			title='hide preview display' \
			onclick='document.getElementById(\"%id%_previewpanel\").style.display=\"none\"; \
				this.form.preview.checked=false; config.macros.tidIDE.render(\"%id%\")'> \
	</td></tr></table> \
	</div> \
	</form> \
	</div> \
";
//}}}
/***
|Name|TidIDEStyleSheet|
|Source|http://www.TiddlyTools.com/#TidIDEStyleSheet|
|Version||
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <<br>>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|CSS|
|Requires||
|Overrides||
|Description|use default stylesheet with alternative TidIDE templates|
***/

[[StyleSheet]]
<<template TidIDE>>
/***
{{fr{
<<tiddler TiddlerSlicerDocumentation_fr>>}}}{{en{
<<tiddler TiddlerSlicerDocumentation_en>>}}}
/%dependencies TWkdLib %/
!Code
***/
// //version information
//{{{
version.extensions.TiddlerSlicer = { major: 1, minor: 2, revision: 0, date: new Date(2006,10,5),
 source: "http://yann.perrin.googlepages.com/twkd.html#TiddlerSlicer"
};
//}}}
// //slicing function
//{{{

slicing = function(e){
var modeandtitle=this.getAttribute('Id');
modeandtitle=modeandtitle.split('|');
var mode=modeandtitle[0];
var title=modeandtitle[1];
var selection = getSelection(title);
var newtitle=askForTitle();
if(!newtitle)
   {
   displayMessage(config.commands.slice.cancel);
   return(false);
   }
if (mode!="part"&&mode!="nestedSlider")
{
// creation of the new tiddler
newTWkdLibTiddler(newtitle,selection.content,title,config.commands.slice.askForTags);
}

// replacement of selection with a reference to the newly created tiddler
switch(mode) {
   case "nestedSlider":
   putInPlace("+++["+newtitle+"]\n"+selection.content+"\n===",selection);
   break;
   case "part":
   putInPlace("<part "+newtitle+">"+selection.content+"</part>",selection);
   break;
   case "link":
   putInPlace("[["+newtitle+"]]",selection);
   break;
   case "slider":
   putInPlace('<<slider chkSlice [['+newtitle+']] "'+newtitle+'" "'+config.commands.slice.sliderTooltip+newtitle+'">>',selection);
   break;
   default:
   putInPlace("<<tiddler [["+newtitle+"]]>>",selection);
   break;
   }
} // close slicing function definition
//}}}
// // command definition
//{{{
config.commands.slice = {
text:"8<",
tooltip:"create new microcontent from selection",
cancel:"slicing cancelled",
tiddlercreated:" tiddler created",
sliderTooltip:"content of ",
askForTags:true,
wikeditposition:3
}

config.commands.slice.handler = function(event,src,title) {
var availablesModes = ["tiddler","slider","link"];
if (version.extensions.PartTiddlerPlugin)
 availablesModes.push("part");
if (version.extensions.nestedSliders)
 availablesModes.push("nestedSlider");
var popup = Popup.create(src);
 if(popup)
 {
 for (var i=0; i<availablesModes.length; i++)
   {
   createTiddlyButton(createTiddlyElement(popup,"li"), availablesModes[i], availablesModes[i], slicing, null, availablesModes[i]+'|'+title, null);
   }
 Popup.show(popup,false);
 event.cancelBubble = true;
 if (event.stopPropagation) event.stopPropagation();
 return false;
 }
}
//}}}
// // shadow links to documentation
//{{{
config.shadowTiddlers.TiddlerSlicerDocumentation_en = "Documentation for this plugin is available [[here|" + version.extensions.TiddlerSlicer.source +"Documentation_en]]";
config.shadowTiddlers.TiddlerSlicerDocumentation_fr = "La documentation de ce plugin est disponible [[ici|" + version.extensions.TiddlerSlicer.source +"Documentation_fr]]";
//}}}
|Name|TiddlerSlicer|
|Author|YannPerrin|
|Source|http://yann.perrin.googlepages.com/twkd.html#TiddlerSlicer ([[del.icio.us|http://del.icio.us/post?url=http://yann.perrin.googlepages.com/twkd.html%23TiddlerSlicer]])|
|Version|1.2.0|
|Require|~TW2.0.7+|

!Description
The slice command allows you to create microcontent tiddlers from bigger ones.
It turns selected text into a new independent tiddler, and replace it in the original tiddler with a reference to the newly created tiddler.
.
!Installation
*import (or copy/paste in edit mode) the following tiddler in your document:<<br>>TiddlerSlicer (tag it : <<tag systemConfig>>)
*in order to see the command, you still need to install it in your EditTemplate by modifying the 'toolbar' div to look like that :
{{{
<div class='toolbar' macro='toolbar slice +saveTiddler -cancelTiddler deleteTiddler'></div>
}}}
*if you want offline access to this documentation, import (or copy/paste in edit mode) the following tiddler in your document:<<br>>TiddlerSlicerDocumentation_en
*finally, save changes and reload the document.


!Usage
''Once properly installed'' (see above), you should see a new 'slice' command when editing a tiddler.

To use it : 
*first, select the text to be extracted
*then, click on the slice command.
*select desired slice type
*enter a title for the new tiddler, click ok
*eventually enter tags for the new tiddler
and that's all.
The new tiddler has been created (if required), with the selected text as content, the chosen title, and the chosen tags (or the original tiddler title as tag). It's allready referenced in the original tiddler body, where the selected text used to be. This reference is made accordingly to the chosen mode, it may be a {{{<<tiddler>>}}}, {{{<<slider>>}}}, {{{[[link]]}}} or even {{{part}}} or {{{nestedSlider}}} if the respective additionnal plugins are installed.

!Revisions History
2006.10.05-1.2.0
>added dependency to TWkdLib to avoid code duplication in other plugins
>added code to register in the [[Wikedit]] toolbar
>changed default label to {{{8<}}}
2006.21.04-1.1.0
>added popup choice of mode
>added additionnal modes if PartTiddlerPlugin or/and NestedSlidersPlugin are installed
>added option to allow new tiddler tag entry
2006.20.04-1.0.0
>Initial Public Release
>renamed from ''~LightSaber'' to TiddlerSlicer

!Credits
Thanks to :
*[[Jeremy Ruston]] for TiddlyWiki
*[[Jacques Turbé]] for the idea
/***
|Name|TiddlerTweakerPlugin|
|Source|http://www.TiddlyTools.com/#TiddlerTweakerPlugin|
|Version|2.0.1|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <<br>>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|select multiple tiddlers and modify author, created, modified and/or tag values|

TiddlerTweaker is a tool for TiddlyWiki authors.  It allows you to select multiple tiddlers from a listbox, and then modify the author, created, modified and/or tag values of those tiddlers using a compact set of form fields.  The values you enter into the fields overwrite the existing values in all tiddlers you have selected.

!!!!!Usage
<<<
TiddlerTweaker also allows you to quickly filter specified tags from the selected tiddlers, while leaving any other tags assigned to those tiddlers unchanged.  Any tag preceded by a "+" (plus) or "-" (minus), will be added or removed from the existing tags instead of simply *replacing* the entire tag definition of each tiddler (e.g., enter "-excludeLists" to remove that tag from all selected tiddlers.

Note: Because you may be working with many tags on many tiddlers, selecting and updating all tiddlers in a document operation may take a while and FireFox might warn about an "unresponsive script"... you should give it a whole bunch of time to 'continue'... it will complete the processing... eventually.

Also, by design, TiddlerTweaker does NOT update the 'modified' date of tiddlers simply by making changes to their tags.  The tiddlers' dates are ONLY updated when the corresponding 'created' and/or 'modified' checkboxes are selected.  Be sure to SAVE YOUR DOCUMENT WHEN YOU ARE DONE tweaking tiddlers, even if the tiddler timeline tab does not show any recently modified tiddlers.

Important: ''inasmuch as TiddlerTweaker is a 'power user' tool that can perform 'batch' functions (operating on many tiddlers at once), you should always have a recent backup of your document (or "save changes" just *before* tweaking the tiddlers), just in case you "shoot yourself in the foot".''
<<<
!!!!!Examples
<<<
{{{<<tiddlerTweaker>>}}}
{{smallform{<<tiddlerTweaker>>}}}
<<<
!!!!!Installation
<<<
import (or copy/paste) the following tiddlers into your document:
TiddlerTweakerPlugin
<<<
!!!!!Revision History
<<<
''2007.08.03 [2.0.1]'' added shadow definition for [[TiddlerTweaker]] tiddler for use as parameter references with {{{<<tiddler>>, <<slider>> or <<tabs>>}}} macros.
''2007.08.03 [2.0.0]'' converted from inline script
''2006.01.01 [1.0.0]'' initial release
<<<
!!!!!Credits
<<<
This feature was developed by Eric L Shulman / ELS Design Studios
<<<
!!!!!Code
***/
//{{{
version.extensions.tiddlerTweaker= {major: 2, minor: 0, revision: 1, date: new Date(2007,9,3)};
config.shadowTiddlers.TiddlerTweaker="<<tiddlerTweaker>>";
config.macros.tiddlerTweaker = {
	html: '<form style="display:inline"><!--\
		--><table style="padding:0;margin:0;border:0;width:100%"><tr valign="top" style="padding:0;margin:0;border:0"><!--\
		--><td  style="text-align:center;white-space:nowrap;width:99%;padding:0;margin:0;border:0"><!--\
			--><font size=-2><div style="text-align:left;">select tiddlers:</div><!--\
			--></font><select multiple name=list size="8" style="width:99.99%" \
				title="use click, shift-click and/or ctrl-click to select multiple tiddler titles" \
				onclick="config.macros.tiddlerTweaker.selecttiddlers(this)" \
				onchange="config.macros.tiddlerTweaker.setfields(this)"><!--\
			--></select><br><!--\
			-->show<input type=text size=1 value="8" \
				onchange="this.form.list.size=this.value; this.form.list.multiple=(this.value>1);"><!--\
			-->by<!--\
			--><select name=sortby size=1 \
				onchange="config.macros.tiddlerTweaker.init(this.form,this.value)"><!--\
			--><option value="modified">date</option><!--\
			--><option value="title">title</option><!--\
			--><option value="size">size</option><!--\
			--></select><!--\
			--><input type="button" value="refresh" \
				onclick="config.macros.tiddlerTweaker.init(this.form,this.form.sortby.value)"<!--\
			--> <input type="button" name="stats" disabled value="totals..." \
				onclick="config.macros.tiddlerTweaker.stats(this)"><!--\
		--></td><td style="white-space:nowrap;padding:0;margin:0;border:0;width:1%"><!--\
			--><div style="text-align:left"><font size=-2>modify values</font></div><!--\
			--><table border=0 style="width:100%;padding:0;margin:0;border:0;"><tr style="padding:0;border:0;"><!--\
			--><td style="padding:1px;border:0;white-space:nowrap"><!--\
				--><input type=checkbox name=settitle unchecked \
					title="allow changes to tiddler title (rename tiddler)" \
					onclick="this.form.title.disabled=!this.checked">title<!--\
			--></td><td style="padding:1px;border:0;white-space:nowrap"><!--\
				--><input type=text name=title size=35 style="width:98%" disabled><!--\
			--></td></tr><tr style="padding:0;border:0;"><td style="padding:1px;border:0;white-space:nowrap"><!--\
				--><input type=checkbox name=setwho unchecked \
					title="allow changes to tiddler author" \
					onclick="this.form.who.disabled=!this.checked">author<!--\
			--></td><td style="padding:1px;border:0;white-space:nowrap"><!--\
				--><input type=text name=who size=35 style="width:98%" disabled><!--\
		--></td></tr><tr style="padding:0;border:0;"><td style="padding:1px;border:0;white-space:nowrap"><!--\
				--><input type=checkbox name=setcdate unchecked \
					title="allow changes to created date" \
					onclick="var f=this.form; f.cm.disabled=f.cd.disabled=f.cy.disabled=f.ch.disabled=f.cn.disabled=!this.checked"><!--\
				-->created on<!--\
			--></td><td style="padding:1px;border:0;white-space:nowrap"><!--\
				--><input type=text name=cm size=2 style="width:2em;padding:0;text-align:center" disabled><!--\
				--> / <input type=text name=cd size=2 style="width:2em;padding:0;text-align:center" disabled><!--\
				--> / <input type=text name=cy size=4 style="width:3em;padding:0;text-align:center" disabled><!--\
				--> at <input type=text name=ch size=2 style="width:2em;padding:0;text-align:center" disabled><!--\
				--> : <input type=text name=cn size=2 style="width:2em;padding:0;text-align:center" disabled><!--\
			--></td></tr><tr style="padding:0;border:0;"><td style="padding:1px;border:0;white-space:nowrap"><!--\
				--><input type=checkbox name=setmdate unchecked \
					title="allow changes to modified date" \
					onclick="var f=this.form; f.mm.disabled=f.md.disabled=f.my.disabled=f.mh.disabled=f.mn.disabled=!this.checked"><!--\
				-->modified on<!--\
			--></td><td style="padding:1px;border:0;white-space:nowrap"><!--\
				--><input type=text name=mm size=2 style="width:2em;padding:0;text-align:center" disabled><!--\
				--> / <input type=text name=md size=2 style="width:2em;padding:0;text-align:center" disabled><!--\
				--> / <input type=text name=my size=4 style="width:3em;padding:0;text-align:center" disabled><!--\
				--> at <input type=text name=mh size=2 style="width:2em;padding:0;text-align:center" disabled><!--\
				--> : <input type=text name=mn size=2 style="width:2em;padding:0;text-align:center" disabled><!--\
			--></td></tr><tr style="padding:0;border:0;"><td style="padding:1px;border:0;white-space:nowrap"><!--\
				--><input type=checkbox name=settags checked \
					title="allow changes to tiddler tags" \
					onclick="this.form.tags.disabled=!this.checked">tags<!--\
			--></td><td style="padding:1px;border:0;white-space:nowrap"><!--\
				--><input type=text name=tags size=35 value="" style="width:98%" \
					title="enter new tags or use \'+tag\' and \'-tag\' to add/remove tags from existing tags"><!--\
			--></td></tr></table><!--\
			--><div style="margin-top:.8em;text-align:center"><!--\
			--><nobr><input type=button name=display disabled style="width:32%" value="display tiddlers" \
				onclick="config.macros.tiddlerTweaker.displaytiddlers(this)"><!--\
			--> <input type=button name=del disabled style="width:32%" value="delete tiddlers" \
				onclick="config.macros.tiddlerTweaker.deltiddlers(this)"><!--\
			--> <input type=button name=set disabled style="width:32%" value="update tiddlers" \
				onclick="config.macros.tiddlerTweaker.settiddlers(this)"></nobr><!--\
			--></div><!--\
		--></td></tr></table><!--\
		--></form><span style="display:none"><!--content replaced by tiddler "stats"--></span>\
	',
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		var span=createTiddlyElement(place,"span");
		span.innerHTML=this.html;
		this.init(span.firstChild,"modified");
	},
	init: function(f,sortby) { // initialize form controls
		if (!f) return; // form might not be rendered yet...
		while (f.list.options[0]) f.list.options[0]=null; // empty current list content
		var tids=store.getTiddlers(sortby);
		if (sortby=="size")
			tids.sort(function(a,b) {return a.text.length < b.text.length ? -1 : (a.text.length == b.text.length ? 0 : +1);});
		for (i=0; i<tids.length; i++) {
			var label=tids[i].title; var value=tids[i].title;
			if (sortby=="modified") {
				label=tids[tids.length-i-1].modified.formatString("YY.0MM.0DD 0hh:0mm ")+tids[tids.length-i-1].title;
				value=tids[tids.length-i-1].title;
			}
			if (sortby=="size") label="["+tids[i].text.length+"] "+label;
			f.list.options[f.list.length]=new Option(label,value,false,false);
		}
		f.title.value=f.who.value=f.tags.value="";
		f.cm.value=f.cd.value=f.cy.value=f.ch.value=f.cn.value="";
		f.mm.value=f.md.value=f.my.value=f.mh.value=f.mn.value="";
		f.stats.disabled=f.set.disabled=f.del.disabled=f.display.disabled=true;
		f.settitle.disabled=false;
	},
	selecttiddlers: function(here) { // enable/disable tweaker fields based on number of items selected
		// count how many tiddlers are selected
		var f=here.form; var list=f.list;
		var c=0; for (i=0;i<list.length;i++) if (list.options[i].selected) c++;
		if (c>1) f.title.disabled=true;
		if (c>1) f.settitle.checked=false;
		f.set.disabled=(c==0);
		f.del.disabled=(c==0);
		f.display.disabled=(c==0);
		f.settitle.disabled=(c>1);
		f.stats.disabled=(c==0);
		var msg=(c==0)?'select tiddlers:':(c+' tiddler'+(c!=1?'s':'')+' selected');
		here.previousSibling.firstChild.innerHTML=msg;
	},
	setfields: function(here) { // set tweaker edit fields from first selected tiddler
		var f=here.form;
		if (!here.value.length) {
			f.title.value=f.who.value=f.tags.value="";
			f.cm.value=f.cd.value=f.cy.value=f.ch.value=f.cn.value="";
			f.mm.value=f.md.value=f.my.value=f.mh.value=f.mn.value="";
			return;
		}
		var tid=store.getTiddler(here.value); if (!tid) return;
		f.title.value=tid.title;
		f.who.value=tid.modifier;
		f.tags.value=tid.tags.join(' ');
		var c=tid.created; var m=tid.modified;
		f.cm.value=c.getMonth()+1;
		f.cd.value=c.getDate();
		f.cy.value=c.getFullYear();
		f.ch.value=c.getHours();
		f.cn.value=c.getMinutes();
		f.mm.value=m.getMonth()+1;
		f.md.value=m.getDate();
		f.my.value=m.getFullYear();
		f.mh.value=m.getHours();
		f.mn.value=m.getMinutes();
	},
	settiddlers: function(here) {
		var f=here.form; var list=f.list;
		var tids=[];
		for (i=0;i<list.length;i++) if (list.options[i].selected) tids.push(list.options[i].value);
		if (!tids.length) { alert("please select at least one tiddler"); return; }
		var cdate=new Date(f.cy.value,f.cm.value-1,f.cd.value,f.ch.value,f.cn.value);
		var mdate=new Date(f.my.value,f.mm.value-1,f.md.value,f.mh.value,f.mn.value);
		if (tids.length>1 && !confirm("Are you sure you want to update these tiddlers:\n\n"+tids.join(', '))) return;
		for (t=0;t<tids.length;t++) {
			var tid=store.getTiddler(tids[t]); if (!tid) continue;
			var title=!f.settitle.checked?tid.title:f.title.value;
			var who=!f.setwho.checked?tid.modifier:f.who.value;
			var tags=tid.tags
			if (f.settags.checked) { 
				var intags=f.tags.value.readBracketedList();
				var addtags=[]; var deltags=[]; var reptags=[];
				for (i=0;i<intags.length;i++) {
					if (intags[i].substr(0,1)=='+')
						addtags.push(intags[i].substr(1));
					else if (intags[i].substr(0,1)=='-')
						deltags.push(intags[i].substr(1));
					else
						reptags.push(intags[i]);
				}
				if (reptags.length)
					tags=reptags;
				if (addtags.length)
					tags=Array.concat(tags,addtags);
				if (deltags.length)
					for (i=0;i<deltags.length;i++)
						{ var pos=tags.indexOf(deltags[i]); if (pos!=-1) tags.splice(pos,1); }
			}
			if (!f.setcdate.checked) cdate=tid.created;
			if (!f.setmdate.checked) mdate=tid.modified;
			store.saveTiddler(tid.title,title,tid.text,who,mdate,tags,tid.fields);
			if (f.setcdate.checked) tid.assign(null,null,null,null,null,cdate); // set create date
		}
		this.init(f,f.sortby.value);
	},
	displaytiddlers: function(here) {
		var f=here.form; var list=f.list;
		var tids=[];
		for (i=0; i<list.length;i++) if (list.options[i].selected) tids.push(list.options[i].value);
		if (!tids.length) { alert("please select at least one tiddler"); return; }
		story.displayTiddlers(story.findContainingTiddler(f),tids)
	},
	deltiddlers: function(here) {
		var f=here.form; var list=f.list;
		var tids=[];
		for (i=0;i<list.length;i++) if (list.options[i].selected) tids.push(list.options[i].value);
		if (!tids.length) { alert("please select at least one tiddler"); return; }
		if (!confirm("Are you sure you want to delete these tiddlers:\n\n"+tids.join(', '))) return;
		for (t=0;t<tids.length;t++) {
			var tid=store.getTiddler(tids[t]); if (!tid) continue;
			if (tid.tags.contains("systemConfig"))
				if (!confirm("'"+tid.title+"' is tagged with 'systemConfig'.\n\nRemoving this tiddler may cause unexpected results.  Are you sure?"))
					continue;
			store.removeTiddler(tid.title);
		}
		this.init(f,f.sortby.value);
	},
	stats: function(here) {
		var f=here.form; var list=f.list; var tids=[]; var out=''; var tot=0;
		var target=f.nextSibling;
		for (i=0;i<list.length;i++) if (list.options[i].selected) tids.push(list.options[i].value);
		if (!tids.length) { alert("please select at least one tiddler"); return; }
		for (t=0;t<tids.length;t++) {
			var tid=store.getTiddler(tids[t]); if (!tid) continue;
			out+='[['+tid.title+']] '+tid.text.length+'\n'; tot+=tid.text.length;
		}
		var avg=tot/tids.length;
		out=tot+' bytes in '+tids.length+' selected tiddlers ('+avg+' bytes/tiddler)\n<<<\n'+out+'<<<\n';
		removeChildren(target);
		target.innerHTML="<hr><font size=-2><a href='javascript:;' style='float:right' onclick='this.parentNode.parentNode.style.display=\"none\"'>close</a></font>";
		wikify(out,target);
		target.style.display="block";
	}
};
//}}}
/***
|Location|http://visualtw.ouvaton.org/VisualTW.html|
|Version|1.0.3|
|CoreVersion|2.x|
|Browsers|Firefox 2.0.x, IE 6.0+, others|
!Description:
A bar to switch beetween tiddlers through tabs (like browser tabs bar).
!Demo:
* On [[homepage|http://visualtw.ouvaton.org/VisualTW.html]], open several tiddlers to use the tabs bar.
* See also http://groups.google.com/group/TiddlyWiki/msg/98992b8611d064ab where was posted a link to a "stand alone version" that you can use to test this plugin in any TW pages (by copying and pasting the code in the browser address bar).
!Installation:
*import this tiddler from [[homepage|http://visualtw.ouvaton.org/VisualTW.html]] (tagged as systemConfig)
*add a div named ''tiddlersBar'' in PageTemplate
*save and reload
*optionnally, adjust StyleSheetTiddlersBar
!Configuration options :
<<option chkDisableTabsBar>> Disable the tabs bar (to print, by example).
<<option chkHideTabsBarWhenSingleTab >> Automatically hide the tabs bar when only one tiddler is displayed. 
<<option txtSelectedTiddlerTabButton>> optionnal ''selected'' tab button (as in command bar). Example : editTiddler
!Code
***/
//{{{
config.options.chkDisableTabsBar = config.options.chkDisableTabsBar ? config.options.chkDisableTabsBar : false;
config.options.chkHideTabsBarWhenSingleTab  = config.options.chkHideTabsBarWhenSingleTab  ? config.options.chkHideTabsBarWhenSingleTab  : false;
config.options.txtSelectedTiddlerTabButton = config.options.txtSelectedTiddlerTabButton ? config.options.txtSelectedTiddlerTabButton : "";
config.macros.tiddlersBar = {
	tooltip : "see ",
	tooltipClose : "click here to close this tab",
	promptRename : "Enter tiddler new name",
	currentTiddler : "",
	previousState : false,
	handler: function(place,macroName,params) {
		if (config.macros.tiddlersBar.isShown())
			story.forEachTiddler(function(title,e){
				if (title==config.macros.tiddlersBar.currentTiddler){
					var d = createTiddlyElement(place,"nobr",null,"tab tabSelected");
					if (config.options.txtSelectedTiddlerTabButton && config.commands[config.options.txtSelectedTiddlerTabButton]) {
						var btn = createTiddlyButton(d, title, config.commands[config.options.txtSelectedTiddlerTabButton].tooltip ,config.macros.tiddlersBar.onSelectedTabButtonClick);
						btn.setAttribute("tiddler", title);
					}
					else
						createTiddlyText(d,title);
				}
				else {
					var d = createTiddlyElement(place,"nobr",null,"tab tabUnselected");
					var btn = createTiddlyButton(d,title,config.macros.tiddlersBar.tooltip + title,config.macros.tiddlersBar.onSelectTab);
					btn.setAttribute("tiddler", title);
				}
				var c = createTiddlyButton(d,"x",config.macros.tiddlersBar.tooltipClose,config.macros.tiddlersBar.onTabClose,"tabCloseButton");
				createTiddlyText(place," "); // to allow break line here when many tiddlers are open
				c.setAttribute("tiddler", title);
			})
	}, 
	refresh: function(place,params){
		removeChildren(place);
		config.macros.tiddlersBar.handler(place,"tiddlersBar",params);
		if (config.macros.tiddlersBar.previousState!=config.macros.tiddlersBar.isShown()) {
			story.refreshAllTiddlers();
			if (config.macros.tiddlersBar.previousState) story.forEachTiddler(function(t,e){e.style.display="";});
			config.macros.tiddlersBar.previousState = !config.macros.tiddlersBar.previousState;
		}
	},
	isShown : function(){
		if (config.options.chkDisableTabsBar) return false;
		if (!config.options.chkHideTabsBarWhenSingleTab) return true;
		var cpt=0;
		story.forEachTiddler(function(){cpt++});
		return (cpt>1);
	},
	selectNextTab : function(){  //used when the current tab is closed (to select another tab)
		var previous="";
		story.forEachTiddler(function(title){
			if (!config.macros.tiddlersBar.currentTiddler) {
				story.displayTiddler(null,title);
				return;
			}
			if (title==config.macros.tiddlersBar.currentTiddler) {
				if (previous) {
					story.displayTiddler(null,previous);
					return;
				}
				else config.macros.tiddlersBar.currentTiddler=""; 	// so next tab will be selected
			}
			else previous=title;
			});		
	},
	onSelectTab : function(e){
		var t = this.getAttribute("tiddler");
		if (t) story.displayTiddler(null,t);
		return false;
	},
	onTabClose : function(e){
		var t = this.getAttribute("tiddler");
		if (t) {
			if(story.hasChanges(t) && !readOnly) {
				if(!confirm(config.commands.cancelTiddler.warning.format([t])))
				return false;
			}
			story.closeTiddler(t);
		}
		return false;
	},
	onSelectedTabButtonClick : function(event,src,title) {
		var t = this.getAttribute("tiddler");
		if (t && config.options.txtSelectedTiddlerTabButton && config.commands[config.options.txtSelectedTiddlerTabButton])
			config.commands[config.options.txtSelectedTiddlerTabButton].handler(event, src, t);
	}
}

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

story.closeTiddler = function(title,animate,unused) {
	if (title==config.macros.tiddlersBar.currentTiddler)
		config.macros.tiddlersBar.selectNextTab();
	story.coreCloseTiddler(title,animate,unused);
	var e=document.getElementById("tiddlersBar");
	if (e) config.macros.tiddlersBar.refresh(e,null);
}

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

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

config.shadowTiddlers.StyleSheetTiddlersBar = "/*{{{*/\n" + "#tiddlersBar .button {border:0}\n" + "#tiddlersBar {padding : 1em 0.5em 0 0.5em}\n"+ "/*}}}*/";
store.addNotification("StyleSheetTiddlersBar", refreshStyles); 

//}}}
This file that you're looking at in your browser right now is a single html file called a TiddlyWiki.  For more information go to http://tiddlywiki.com/. 

The site at which this file is located is http://tiddlyspot.com/.  There you can make one of these to share with others.  If you want a place to start, though, go to the first site.
{{{
locale: en
PopupTipsPlugin: <<tiddler PopupTipsPlugin>>
TipsConfig: <<tiddler TipsConfig.en>>
TipsDefs: [[TipsDefs.en]] contains all of the tips definitions and it's specified in [[TipsConfig.en]].
Using_Alias: @@Alias@@:__Uses the tiddler slice form to define the tips__.
1: {{bigblue{''Show a popup tips as mouse hovers.''}}}
Settings: {{bigblue{__''Settings''__}}}
GettingStarted: <<tiddler GettingStarted.en>>
}}}
!Locale Strings
{{{
en_label: English
Locale_driven: {{bigblue{__''Locale Driven''__}}}
Home: <html><a style="color:#fff; border:1px solid #8cf;"href='javascript:{story.closeAllTiddlers();var defaultParams = store.getTiddlerText("DefaultTiddlers").parseParams("open",null,false);invokeParamifier(defaultParams,"onstart");}'>Home</a></html>
SiteFooter: <<tiddler {{'SiteFooter.'+config.options.txtLocale}}>>
SimpleClock: <<simpleclock 'MMM 0DD YYYY am hh12:0mm:0ss'>>
GoogleNews: +++[Google News]<<rssfeed asHtml "http://news.google.com/news?ned=us&topic=w&output=rss">>===
TiddlyWikiGroup: +++[TiddlyWiki Group]<<rssfeed asHtml "http://groups.google.com/group/TiddlyWiki/feed/atom_v1_0_msgs.xml">>===
}}}
!Menu Definitions
{{{
Descriptions_label: Descriptions
Descriptions:  <<tiddler Demo>>
TipsConfigs_label: Config
TipsConfigs: [[English|TipsConfig.en]]<br>[[Trad. Chinese|TipsConfig.zh-Hant]]<br>[[Simp. Chinese|TipsConfig.zh-Hans]]
TipsDef_label: Definitions
TipsDef: [[English|TipsDefs.en]]<br>[[Trad. Chinese|TipsDefs.zh-Hant]]<br>[[Simp. Chinese|TipsDefs.zh-Hans]]
ExtensionLists: [[Plugins|Plugins]]<br>[[JS Files|ExtList]]<br>[[Themes]]
ExtensionLists_label: Extensions
Examples: <<tiddler Examples.en>>
Examples_label: Examples
}}}
/*{{{*/
#topMenu br {display:none;}
#topMenu a, #topMenu .tiddlyLink, #topMenu .button {margin:0em; font-size:1.2em; color:[[ColorPalette::HeaderPrimaryLight]]; background:transparent; padding:0.5em 1em 0.5em 1em; border:none; border-right: 1px solid [[ColorPalette::SecondaryDark]];float:left;}
#topMenu {border-left: 1px solid [[ColorPalette::SecondaryDark]];  float:left;margin:0;}
#topMenu a:hover {color:[[ColorPalette::Background]]; background:[[ColorPalette::PrimaryDark]];}
/*}}}*/

/*{{{*/
.popupTips {position:absolute; visibility:hidden; padding:0.5em; border:2px solid [[ColorPalette::PrimaryPale]]; background:[[ColorPalette::PrimaryDark]]; color:[[ColorPalette::Foreground]]; z-index:300; filter:alpha(opacity=90);-moz-opacity:0.9;opacity: 0.9;}

.tipsNote {position:relative; border:none; background:[[ColorPalette::Background]]; color:[[ColorPalette::Error]]; cursor:help;}

.tipsInfo {position:relative; background:#cff; color:[[ColorPalette::Foreground]];}

.tipsMenu {margin:0em; font-size:1.2em; color:[[ColorPalette::HeaderPrimaryLight]]; background:transparent; padding:0.5em 1em 0.5em 1em; border:none; border-right: 1px solid [[ColorPalette::SecondaryDark]];float:left;}
.tipsMenu {border-left: 1px solid [[ColorPalette::SecondaryDark]];  float:left;margin:0;}
.tipsMenu:hover {color:[[ColorPalette::Background]]; background:[[ColorPalette::Foreground]];}
.bigblue {font-size: 1.2em;color:darkblue}
.help {cursor:help;}
/*}}}*/

/***
| Name|ToggleTagPlugin|
| Description|Makes a checkbox which toggles a tag in a tiddler|
| Version|3.0 ($Rev: 1845 $)|
| Date|$Date: 2007-03-16 15:19:22 +1000 (Fri, 16 Mar 2007) $|
| Source|http://tiddlyspot.com/mptw/#ToggleTagMacro|
| Author|Simon Baird <simon.baird@gmail.com>|
| License|http://mptw.tiddlyspot.com/#TheBSDLicense|
!Usage
{{{<<toggleTag }}}//{{{TagName TiddlerName LabelText}}}//{{{>>}}}
* TagName - the tag to be toggled, default value "checked"
* TiddlerName - the tiddler to toggle the tag in, default value the current tiddler
* LabelText - the text (gets wikified) to put next to the check box, default value is '{{{[[TagName]]}}}' or '{{{[[TagName]] [[TiddlerName]]}}}'
(If a parameter is '.' then the default will be used)

Examples:

|Code|Description|Example|h
|{{{<<toggleTag>>}}}|Toggles the default tag (checked) in this tiddler|<<toggleTag>>|
|{{{<<toggleTag TagName>>}}}|Toggles the TagName tag in this tiddler|<<toggleTag TagName>>|
|{{{<<toggleTag TagName TiddlerName>>}}}|Toggles the TagName tag in the TiddlerName tiddler|<<toggleTag TagName TiddlerName>>|
|{{{<<toggleTag TagName TiddlerName 'click me'>>}}}|Same but with custom label|<<toggleTag TagName TiddlerName 'click me'>>|
|{{{<<toggleTag . . 'click me'>>}}}|dot means use default value|<<toggleTag . . 'click me'>>|
Notes:
* If TiddlerName doesn't exist it will be silently created
* Set label to '-' to specify no label
* See also http://mgtd-alpha.tiddlyspot.com/#ToggleTag2

!Known issues
* Doesn't smoothly handle the case where you toggle a tag in a tiddler that is current open for editing

***/
//{{{

merge(config.macros,{

	toggleTag: {

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

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

//}}}

/***
Contains the stuff you need to use Tiddlyspot
Note you must also have UploadPlugin installed
***/
//{{{

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

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

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

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

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

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

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

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

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

});
//}}}
config.options.chkHttpReadOnly = false;
readOnly = false; 
| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |
| 15/11/2007 20:25:33 | YourName | [[biblestudy.html|file:///J:/Laptop%20docs%20on%202G%20Cruzer/biblestudy.html]] | [[store.cgi|http://biblestudy.tiddlyspot.com/store.cgi]] | . | [[index.html | http://biblestudy.tiddlyspot.com/index.html]] | . |
| 16/11/2007 18:08:45 | YourName | [[/|http://biblestudy.tiddlyspot.com/]] | [[store.cgi|http://biblestudy.tiddlyspot.com/store.cgi]] | . | [[index.html | http://biblestudy.tiddlyspot.com/index.html]] | . |
| 12/12/2007 14:22:24 | Dave | [[biblestudy.html|file:///C:/Users/Owner/Documents/biblestudy.html]] | [[store.cgi|http://biblestudy.tiddlyspot.com/store.cgi]] | . | [[index.html | http://biblestudy.tiddlyspot.com/index.html]] | . | failed |
| 12/12/2007 14:23:18 | Dave | [[biblestudy.html|file:///C:/Users/Owner/Documents/biblestudy.html]] | [[store.cgi|http://biblestudy.tiddlyspot.com/store.cgi]] | . | [[index.html | http://biblestudy.tiddlyspot.com/index.html]] | . | ok |
| 10/01/2008 15:15:43 | Dave | [[biblestudy.html|file:///C:/Users/Owner/Documents/biblestudy.html]] | [[store.cgi|http://biblestudy.tiddlyspot.com/store.cgi]] | . | [[index.html | http://biblestudy.tiddlyspot.com/index.html]] | . | ok |
| 10/01/2008 16:59:18 | Dave | [[biblestudy.html|file:///C:/Users/Owner/Documents/biblestudy.html]] | [[store.cgi|http://biblestudy.tiddlyspot.com/store.cgi]] | . | [[index.html | http://biblestudy.tiddlyspot.com/index.html]] | . | ok |
| 11/01/2008 12:22:37 | Dave | [[biblestudy.html|file:///C:/Users/Owner/Documents/biblestudy.html]] | [[store.cgi|http://biblestudy.tiddlyspot.com/store.cgi]] | . | [[index.html | http://biblestudy.tiddlyspot.com/index.html]] | . |
| 11/01/2008 17:20:35 | DaveAtFrontDesk | [[biblestudy.html|file:///C:/Documents%20and%20Settings/administrator/My%20Documents/My%20Downloads/biblestudy.html]] | [[store.cgi|http://biblestudy.tiddlyspot.com/store.cgi]] | . | [[index.html | http://biblestudy.tiddlyspot.com/index.html]] | . |
| 21/02/2008 14:35:56 | Dave | [[biblestudy.html|file:///C:/Users/Owner/Documents/biblestudy.html]] | [[store.cgi|http://biblestudy.tiddlyspot.com/store.cgi]] | . | [[index.html | http://biblestudy.tiddlyspot.com/index.html]] | . | failed |
| 21/02/2008 21:46:40 | Dave | [[biblestudy.html|file:///J:/Laptop%20docs%20on%202G%20Cruzer/biblestudy.html]] | [[store.cgi|http://biblestudy.tiddlyspot.com/store.cgi]] | . | [[index.html | http://biblestudy.tiddlyspot.com/index.html]] | . |
/***
|''Name:''|PasswordOptionPlugin|
|''Description:''|Extends TiddlyWiki options with non encrypted password option.|
|''Version:''|1.0.2|
|''Date:''|Apr 19, 2007|
|''Source:''|http://tiddlywiki.bidix.info/#PasswordOptionPlugin|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0 (Beta 5)|
***/
//{{{
version.extensions.PasswordOptionPlugin = {
	major: 1, minor: 0, revision: 2, 
	date: new Date("Apr 19, 2007"),
	source: 'http://tiddlywiki.bidix.info/#PasswordOptionPlugin',
	author: 'BidiX (BidiX (at) bidix (dot) info',
	license: '[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D]]',
	coreVersion: '2.2.0 (Beta 5)'
};

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

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

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

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

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

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

merge(config.optionsDesc,{
		pasPassword: "Test password"
	});
*/
//}}}

/***
|''Name:''|UploadPlugin|
|''Description:''|Save to web a TiddlyWiki|
|''Version:''|4.1.0|
|''Date:''|May 5, 2007|
|''Source:''|http://tiddlywiki.bidix.info/#UploadPlugin|
|''Documentation:''|http://tiddlywiki.bidix.info/#UploadPluginDoc|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0 (#3125)|
|''Requires:''|PasswordOptionPlugin|
***/
//{{{
version.extensions.UploadPlugin = {
	major: 4, minor: 1, revision: 0,
	date: new Date("May 5, 2007"),
	source: 'http://tiddlywiki.bidix.info/#UploadPlugin',
	author: 'BidiX (BidiX (at) bidix (dot) info',
	coreVersion: '2.2.0 (#3125)'
};

//
// Environment
//

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

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

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

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

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

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

//
// uploadOptions Macro
//

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

//
// upload functions
//

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

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

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

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

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

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

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

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

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

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

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

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

//
// Utilities
// 

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

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

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

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

//
// Initializations
//

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

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

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

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


/* don't want this for tiddlyspot sites

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

*/


//}}}


[[MptwViewTemplate]]
[[VisualTW plugins|Plugins]]
/***
|Location|http://visualtw.ouvaton.org/VisualTW.html|
|Version|1.0.1|
|Requires|~TW2.2.x|
|Browsers|Firefox 2.0.x, IE 6.0+, others|
!Description:
Wysiwyg editor for TiddlyWiki.
!Demo:
On the plugin [[homepage|http://visualtw.ouvaton.org/VisualTW.html]], see and edit [[Wysiwyg example]].
!Usage:
*use {{{editHtml}}} macro in {{{EditTemplate}}} (or other edit templates) instead of the usual {{{edit}}} macro, with optionnaly a parameter :
**{{{height}}} : define the wysiwyg editor height (by default, 500px or txtFCKheight option value).
!Installation:
#download [[FCKeditor|http://www.fckeditor.net/download]]
#unzip FCKeditor (by default, in VisualTW subfolder, such that the relative path "fckeditor/fckeditor.js" is right). __NB__: FCKeditor doesn't works properly if there are spaces in its path (like in "C:\My documents\FCKeditor". If needed, use traditionnal DOS 8.3 pathnames).
#import [[Wysiwyg plugin]] (systemConfig tagged)
#add the following text to MarkupPreHead tiddler (with the right script path) : <script type="text/javascript" src="fckeditor/fckeditor.js"></script>
#customize FCKeditorPath if needed (as in MarkupPreHead)
#optionnaly, import [[HTMLFormattingPlugin|http://www.TiddlyTools.com/#HTMLFormattingPlugin]] to embed wiki syntax in html.
!Configuration options :
<<option txtFCKeditorPath>> FCKeditor folder (absolute or relative). If blank, default value is {{{fckeditor/}}}
<<option txtFCKCustomConfigScript>> FCKeditor custom configuration script path, relative to editor (ie fckeditor/editor) or absolute. [[Example|fckeditor/editor/custom_config.js]].
<<option txtFCKToolbar>> Toolbar name ("Default", "Basic" or custom). See [[FCKeditor documentation|http://wiki.fckeditor.net/Developer%27s_Guide/Configuration/Toolbar]] for more information on custom toolbars.
<<option txtFCKheight>> FCKeditor default height (if blank = 500px);
***/

//{{{
config.options.txtFCKeditorPath = config.options.txtFCKeditorPath ? config.options.txtFCKeditorPath : "";
config.options.txtFCKCustomConfigScript = config.options.txtFCKCustomConfigScript ? config.options.txtFCKCustomConfigScript : "";
config.options.txtFCKToolbar = config.options.txtFCKToolbar ? config.options.txtFCKToolbar : "";
config.options.txtFCKheight = config.options.txtFCKheight ? config.options.txtFCKheight : "";

config.macros.editHtml = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		var field = params[0];
		var height = params[1] ? params[1] : (config.options.txtFCKheight ? config.options.txtFCKheight : "500px");
		if (field) {
			var e = createTiddlyElement(null,"div");
			var fckName = "FCKeditor"+ Math.random();
			if(tiddler.isReadOnly())
				e.setAttribute("readOnly","readOnly");
			e.setAttribute("editHtml",field);
			e.setAttribute("height",height);
			e.setAttribute("fckName",fckName);
			place.appendChild(e);
			var fck = new FCKeditor(fckName);
			fck.BasePath = config.options.txtFCKeditorPath ? config.options.txtFCKeditorPath : "fckeditor/";
			if (config.options.txtFCKCustomConfigScript) fck.Config["CustomConfigurationsPath"] = config.options.txtFCKCustomConfigScript ;
			if (config.options.txtFCKToolbar) fck.ToolbarSet = config.options.txtFCKToolbar;
			fck.Height=height;
			var re = /^<html>(.*)<\/html>$/m;
			var fieldValue=store.getValue(tiddler,field);
			var htmlValue = re.exec(fieldValue);
			var value = (htmlValue && (htmlValue.length>0)) ? htmlValue[1] : fieldValue;
			config.macros.editHtml.FCKvalues[fckName]=value;
			e.innerHTML = fck.CreateHtml();
		}
	},
        gather : function(e) {
            var name = e.getAttribute("fckName");
            var oEditor = window.FCKeditorAPI ? FCKeditorAPI.GetInstance(name) : null;
            if (oEditor) {
                        var html = oEditor.GetHTML();
			if (html!=null) 
                                    return "<html>"+html+"</html>"; 
            }	
        },
	FCKvalues : {}
}


window.FCKeditor_OnComplete= function( editorInstance ) {
        var name=editorInstance.Name;
	var value = config.macros.editHtml.FCKvalues[name];
	delete config.macros.editHtml.FCKvalues[name];
	oEditor = FCKeditorAPI.GetInstance(name);
	if (value) oEditor.SetHTML(value);
}

Story.prototype.previousGatherSaveEditHtml = Story.prototype.previousGatherSaveEditHtml ? Story.prototype.previousGatherSaveEditHtml : Story.prototype.gatherSaveFields; // to avoid looping if this line is called several times
Story.prototype.gatherSaveFields = function(e,fields){
	if(e && e.getAttribute) {
		var f = e.getAttribute("editHtml");
		if(f){
			var newVal = config.macros.editHtml.gather(e);
			if (newVal) fields[f] = newVal;
		}
		this.previousGatherSaveEditHtml(e, fields);
	}
};

//}}}
Welcome to the Bible Study TiddlyWiki tool.  I've used this type of html file (TiddlyWiki) for notes for a long time now and I've often thought that it is ([[almost]]) perfectly suited for the study of the bible seeing as the bible is incredibly self/cross referential.  With a little tweaking of all that is available for TiddlyWiki a free but powerful study tool that you can take with you, email to friends, share with a study group etc. should be possible that will open up the bible in a new way.  This is just the beginning attempts, so stay tuned.

start exploring by clicking one of the menu items above
This is just my opionion (DP), but I think that the Promised Land can be a metaphor for the soul of the Christian - getting rid of the original evil inhabitants is like our need to get rid of (completely) all our evil habits and ideas - every last one of them

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

//{{{
config.options.txtFCKeditorPath = config.options.txtFCKeditorPath ? config.options.txtFCKeditorPath : "";
config.options.txtFCKCustomConfigScript = config.options.txtFCKCustomConfigScript ? config.options.txtFCKCustomConfigScript : "";
config.options.txtFCKToolbar = config.options.txtFCKToolbar ? config.options.txtFCKToolbar : "";
config.options.txtFCKheight = config.options.txtFCKheight ? config.options.txtFCKheight : "";

config.macros.editHtml = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		var field = params[0];
		var height = params[1] ? params[1] : (config.options.txtFCKheight ? config.options.txtFCKheight : "500px");
		if (field) {
			var e = createTiddlyElement(null,"div");
			var fckName = "FCKeditor"+ Math.random();
			if(tiddler.isReadOnly())
				e.setAttribute("readOnly","readOnly");
			e.setAttribute("editHtml",field);
			e.setAttribute("height",height);
			e.setAttribute("fckName",fckName);
			place.appendChild(e);
			var fck = new FCKeditor(fckName);
			fck.BasePath = config.options.txtFCKeditorPath ? config.options.txtFCKeditorPath : "fckeditor/";
			if (config.options.txtFCKCustomConfigScript) fck.Config["CustomConfigurationsPath"] = config.options.txtFCKCustomConfigScript ;
			if (config.options.txtFCKToolbar) fck.ToolbarSet = config.options.txtFCKToolbar;
			fck.Height=height;
			var re = /^<html>(.*)<\/html>$/m;
			var fieldValue=store.getValue(tiddler,field);
			var htmlValue = re.exec(fieldValue);
			var value = (htmlValue && (htmlValue.length>0)) ? htmlValue[1] : fieldValue;
			config.macros.editHtml.FCKvalues[fckName]=value;
			e.innerHTML = fck.CreateHtml();
		}
	},
        gather : function(e) {
            var name = e.getAttribute("fckName");
            var oEditor = window.FCKeditorAPI ? FCKeditorAPI.GetInstance(name) : null;
            if (oEditor) {
                        var html = oEditor.GetHTML();
			if (html!=null) 
                                    return "<html>"+html+"</html>"; 
            }	
        },
	FCKvalues : {}
}


window.FCKeditor_OnComplete= function( editorInstance ) {
        var name=editorInstance.Name;
	var value = config.macros.editHtml.FCKvalues[name];
	delete config.macros.editHtml.FCKvalues[name];
	oEditor = FCKeditorAPI.GetInstance(name);
	if (value) oEditor.SetHTML(value);
}

Story.prototype.previousGatherSaveEditHtml = Story.prototype.previousGatherSaveEditHtml ? Story.prototype.previousGatherSaveEditHtml : Story.prototype.gatherSaveFields; // to avoid looping if this line is called several times
Story.prototype.gatherSaveFields = function(e,fields){
	if(e && e.getAttribute) {
		var f = e.getAttribute("editHtml");
		if(f){
			var newVal = config.macros.editHtml.gather(e);
			if (newVal) fields[f] = newVal;
		}
		this.previousGatherSaveEditHtml(e, fields);
	}
};

//}}}
<html><p>Edit this tiddler too see the Wysiwyg editor ([[FCKeditor|http://www.fckeditor.net/]]).</p> <p>Rich text can embed wiki syntax formatting with [[HTMLFormattingPlugin]]</p> <p><font size="2" color="#ff6600">Here</font><font color="#ff6600">, </font><font size="3" color="#ff0000" style="background-color: rgb(192, 192, 192);">you </font><font size="4" color="#ff00ff">can </font><strong><font size="5" color="#00ff00">play </font></strong><font size="4" style="background-color: rgb(0, 255, 255);">with </font><font size="3" style="background-color: rgb(255, 204, 153);">HTML </font><font size="2" color="#993300">formatting </font><sup>power.</sup></p></html>
/***
|Location|http://visualtw.ouvaton.org/VisualTW.html|
|Version|1.0.1|
|Requires|~TW2.2.x|
|Browsers|Firefox 2.0.x, IE 6.0+, others|
!Description:
Wysiwyg editor for TiddlyWiki.
!Demo:
On the plugin [[homepage|http://visualtw.ouvaton.org/VisualTW.html]], see and edit [[Wysiwyg example]].
!Usage:
*use {{{editHtml}}} macro in {{{EditTemplate}}} (or other edit templates) instead of the usual {{{edit}}} macro, with optionnaly a parameter :
**{{{height}}} : define the wysiwyg editor height (by default, 500px or txtFCKheight option value).
!Installation:
#download [[FCKeditor|http://www.fckeditor.net/download]]
#unzip FCKeditor (by default, in VisualTW subfolder, such that the relative path "fckeditor/fckeditor.js" is right). __NB__: in local mode FCKeditor doesn't display toolbar icons if there are spaces in its path (like in "C:\My documents\FCKeditor").
#import [[Wysiwyg plugin]] (systemConfig tagged)
#add the following text to MarkupPreHead tiddler (with the right script path) : <script type="text/javascript" src="fckeditor/fckeditor.js"></script>
#customize FCKeditorPath if needed (as in MarkupPreHead)
#optionnaly, import [[HTMLFormattingPlugin|http://www.TiddlyTools.com/#HTMLFormattingPlugin]] to embed wiki syntax in html.
!Configuration options :
<<option txtFCKeditorPath>> FCKeditor folder (absolute or relative). If blank, default value is {{{fckeditor/}}}
<<option txtFCKCustomConfigScript>> FCKeditor custom configuration script path, relative to editor (ie fckeditor/editor) or absolute. [[Example|fckeditor/editor/custom_config.js]].
<<option txtFCKToolbar>> Toolbar name ("Default", "Basic" or custom). See [[FCKeditor documentation|http://wiki.fckeditor.net/Developer%27s_Guide/Configuration/Toolbar]] for more information on custom toolbars.
<<option txtFCKheight>> FCKeditor default height (if blank = 500px);
***/

//{{{
config.options.txtFCKeditorPath = config.options.txtFCKeditorPath ? config.options.txtFCKeditorPath : "";
config.options.txtFCKCustomConfigScript = config.options.txtFCKCustomConfigScript ? config.options.txtFCKCustomConfigScript : "";
config.options.txtFCKToolbar = config.options.txtFCKToolbar ? config.options.txtFCKToolbar : "";
config.options.txtFCKheight = config.options.txtFCKheight ? config.options.txtFCKheight : "";

config.macros.editHtml = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		var field = params[0];
		var height = params[1] ? params[1] : (config.options.txtFCKheight ? config.options.txtFCKheight : "500px");
		if (field) {
			var e = createTiddlyElement(null,"div");
			var fckName = "FCKeditor"+ Math.random();
			if(tiddler.isReadOnly())
				e.setAttribute("readOnly","readOnly");
			e.setAttribute("editHtml",field);
			e.setAttribute("height",height);
			e.setAttribute("fckName",fckName);
			place.appendChild(e);
			var fck = new FCKeditor(fckName);
			fck.BasePath = config.options.txtFCKeditorPath ? config.options.txtFCKeditorPath : "fckeditor/";
			if (config.options.txtFCKCustomConfigScript) fck.Config["CustomConfigurationsPath"] = config.options.txtFCKCustomConfigScript ;
			if (config.options.txtFCKToolbar) fck.ToolbarSet = config.options.txtFCKToolbar;
			fck.Height=height;
			var re = /^<html>(.*)<\/html>$/m;
			var fieldValue=store.getValue(tiddler,field);
			var htmlValue = re.exec(fieldValue);
			var value = (htmlValue && (htmlValue.length>0)) ? htmlValue[1] : fieldValue;
			config.macros.editHtml.FCKvalues[fckName]=value;
			e.innerHTML = fck.CreateHtml();
		}
	},
        gather : function(e) {
            var name = e.getAttribute("fckName");
            var oEditor = window.FCKeditorAPI ? FCKeditorAPI.GetInstance(name) : null;
            if (oEditor) {
                        var html = oEditor.GetHTML();
			if (html!=null) 
                                    return "<html>"+html+"</html>"; 
            }	
        },
	FCKvalues : {}
}


window.FCKeditor_OnComplete= function( editorInstance ) {
        var name=editorInstance.Name;
	var value = config.macros.editHtml.FCKvalues[name];
	delete config.macros.editHtml.FCKvalues[name];
	oEditor = FCKeditorAPI.GetInstance(name);
	if (value) oEditor.SetHTML(value);
}

Story.prototype.previousGatherSaveEditHtml = Story.prototype.previousGatherSaveEditHtml ? Story.prototype.previousGatherSaveEditHtml : Story.prototype.gatherSaveFields; // to avoid looping if this line is called several times
Story.prototype.gatherSaveFields = function(e,fields){
	if(e && e.getAttribute) {
		var f = e.getAttribute("editHtml");
		if(f){
			var newVal = config.macros.editHtml.gather(e);
			if (newVal) fields[f] = newVal;
		}
		this.previousGatherSaveEditHtml(e, fields);
	}
};

//}}}
//{{{
config.options.txtFCKCustomConfigScript = config.options.txtFCKCustomConfigScript ? config.options.txtFCKCustomConfigScript : "custom_config.js";
config.options.txtFCKToolbar = config.options.txtFCKToolbar ? config.options.txtFCKToolbar : "Editor";
//}}}
Saul continued being King for 40 years or so, so what does this mean?
<<formTiddler ShortTextBoxTemplate1>>
What previous passage is this similar to? +++* garden of Eden: "You will surely not die!"===
/***
|''Name:''|YourSearchPlugin|
|''Version:''|2.0.2 (2006-02-13)|
|''Source:''|http://tiddlywiki.abego-software.de/#YourSearchPlugin|
|''Author:''|UdoBorkowski (ub [at] abego-software [dot] de)|
|''Licence:''|[[BSD open source license]]|
|''TiddlyWiki:''|2.0|
|''Browser:''|Firefox 1.0.4+; Firefox 1.5; InternetExplorer 6.0|
<<tiddler [[YourSearch Introduction]]>>
For more information see [[Help|YourSearch Help]].

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

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

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

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

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

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

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

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

   So David and Abishai went to the army by night. And there lay Saul 
sleeping within the encampment, with his spear stuck in the ground at his 
head, and Abner and the army lay around him. (ESV)
after all, this was before he killed Goliath, at which time he was described as a shepherd boy...see [[2Sam 17:34]]
from MH:
II. The besiegers offer them base and barbarous conditions; they will spare their lives, and take them to be their servants, upon condition that they shall put out their right eyes, v. 2. The Gileadites were content to part with their liberty and estates for the ransom of their blood; and, had the Ammonites taken them at their word(verse 1), the matter would have been so settled immediately, and the Gileadites would not have sent out for relief. //But their abject concessions make the Ammonites more insolent in their demands//, and they cannot be content to have them for their servants, but, 
1. They must __torment__ them, and put them to pain, exquisite pain, for so the thrusting out of an eye would do. 
2. They must __disable them for war__, and render them incapable, though not of labour (that would have been a loss to their lords), yet of bearing arms; for in those times they fought with shields in their left hands, which covered their left eye, so that a soldier without his right eye was in effect blind. 
3. They must put a __reproach upon all Israel, as weak and cowardly__, that would suffer the inhabitants of one of their chief cities to be thus miserably used, and not offer to rescue them.
I'd love for this to be able to treat individual words as tiddlers within bigger tiddlers (see http://tiddlywiki.com/. if you don't know what a tiddler is) but that's a discussion for another day...
	  David  spoke  to  the  men  who  stood  by  him,  saying,  "What  shall  be  done  to  the  man  who  kills  this  Philistine,  and  takes  away  the  reproach  from  Israel?  For  @@who is this uncircumcised Philistine, that he should defy the armies of the living God?"@@
copy the name of the chapter that comes before and paste it into the tags box in edit mode.  E.g. while editing 1Samuel.10, paste 1Samuel.09 in the tags.  Then look at the top of chapter 10 will be a link to chapter 9 and at the bottom of 9 is a link to 10
could this be like being born again in our time?

see numbers 11:25 this seems to be linked to prophesying
<html> <iframe width="100%" height="650" style="border-style:none;" src=" http://biblemap.org/"></iframe>

</html> 
controlled in the style sheet, see: MptwStyleSheet
{{{
> This is the relevant default definition in StyleSheetLayout (shadow
> tiddler)

> .viewer code {
>         font-size: 1.2em;
>         line-height: 1.4em;
> }

> so, to override it, you need to be at least as specific.  Thus, in your
> StyleSheet tiddler:

> .viewer code { font-size:xxxxx; }

Almost. Don't ask me why, since the text is definitely in the form:
{x3
stuff here
}x3

but the thing that worked was:
.viewer pre { font-size:xxxxx; }

Thank you very much.
}}}
//{{{
//use fullscreen plugin command by default here
config.options.txtSelectedTiddlerTabButton=config.options.txtSelectedTiddlerTabButton ? config.options.txtSelectedTiddlerTabButton:"fullscreen"; 
//}}}
/***
|!''Name:''|!easySlicer|
|''Description:''|The slice command allows you to create microcontent tiddlers from bigger ones.<<br>>It turns selected text into a new independent tiddler, and replace it in the original tiddler with a reference to the newly created tiddler.|
|''Version:''|0.1.0|
|''Date:''|13/01/2007|
|''Source:''|[[TWkd|http://yann.perrin.googlepages.com/twkd.html#easySlicer]]|
|''Author:''|[[Yann Perrin|YannPerrin]]|
|''License:''|[[BSD open source license]]|
|''~CoreVersion:''|2.x|
|''Browser:''|Firefox 1.0.4+; Firefox 1.5; InternetExplorer 6.0|
|''Requires:''|@@color:red;''E.A.S.E''@@|
***/
//{{{
config.commands.slice = new TWkd.Ease('8<','divide tiddler into parts');
config.commands.slice.addMode({
	name:'tiddler',
	tooltip:'turns selection into a new tiddler and replace it with a macro diplaying the new tiddler content',
	operation:function(){
		var newtitle=config.commands.slice.askForTitle();
		if(!newtitle) {
			displayMessage(config.messages.Ease.cancel);
			return(false);
		}
		config.commands.slice.newTWkdLibTiddler(newtitle,TWkd.context.selection.content,TWkd.context.selection.source,true);
		config.commands.slice.putInPlace("<<tiddler "+newtitle+">>",TWkd.context.selection);
	}
});
config.commands.slice.addMode({
	name:'link',
	tooltip:'turns selection into a new tiddler and replace it with a link to the new tiddler',
	operation:function(){
		var newtitle=config.commands.slice.askForTitle();
		if(!newtitle) {
			displayMessage(config.messages.Ease.cancel);
			return(false);
		}
		config.commands.slice.newTWkdLibTiddler(newtitle,TWkd.context.selection.content,TWkd.context.selection.source,true);
		config.commands.slice.putInPlace("[["+newtitle+"]]",TWkd.context.selection);
	}
});
config.commands.slice.addMode({
	name:'slider',
	tooltip:'turns selection into a new tiddler and replace it with a slider containing the new tiddler',
	sliderTooltip:'content of ',
	operation:function(){
		var newtitle=config.commands.slice.askForTitle();
		if(!newtitle) {
			displayMessage(config.messages.Ease.cancel);
			return(false);
		}
		config.commands.slice.newTWkdLibTiddler(newtitle,TWkd.context.selection.content,TWkd.context.selection.source,true);
		config.commands.slice.putInPlace('<<slider chkSlice [['+newtitle+']] "'+newtitle+'" "'+this.sliderTooltip+newtitle+'">>',TWkd.context.selection);
	}
});
if (version.extensions.nestedSliders) {
config.commands.slice.addMode({
	name:'nestedslider',
	tooltip:'turns selection into a slider',
	operation:function(){
		var newtitle=config.commands.slice.askForTitle();
		if(!newtitle) {
			displayMessage(config.messages.Ease.cancel);
			return(false);
		}
		config.commands.slice.putInPlace("+++["+newtitle+"]\n"+TWkd.context.selection.content+"\n===",TWkd.context.selection);
	}
});
}
if (version.extensions.PartTiddlerPlugin) {
config.commands.slice.addMode({
	name:'part',
	tooltip:'turns selection into a part',
	operation:function(){
		var newtitle=config.commands.slice.askForTitle();
		if(!newtitle) {
			displayMessage(config.messages.Ease.cancel);
			return(false);
		}
		config.commands.slice.putInPlace("<part "+newtitle+">"+TWkd.context.selection.content+"</part>",TWkd.context.selection);
	}
});
}
//}}}
We know that evil is not a "thing" that was created, but a "direction" of choice that a sentient being can decide.  Just as God used the four empires of Babylon, MedoPersia, Greece and Rome to punish Isreal, he can send an evil spirit to Saul if he wants to
I wonder what that would have meant to the other people there, i.e. how significant was this?

From Robert Jamieson: ''he set him up a place-that is, a pillar ( [[2Sa 18:18]] ); literally, a hand, indicating that whatever was the form of the monument, it was surmounted, according to the ancient fashion, by the figure of a hand, the symbol of power and energy. The erection of this vainglorious trophy was an additional act of disobedience. His pride had overborne his sense of duty in first raising this monument to his own honor, and then going to Gilgal to offer sacrifice to God.''

summary:


theme: Saul becomes king


What did you notice looking at:
Who

What

when

where

why

how

what did you learn from commentaries?
summary:
Samuel prepares Saul, who is then filled with the Holy Spirit (for a little while), then Saul is publicly and supernaturally picked out of the tribes, but he's reluctant



What did you notice looking at:
''Who'' (are the key players?):  Samuel, Saul, God, all the tribes

@@What@@ (was this about?)
God giving Israel what it wanted (even though it was a "demotion")

''//when//'' (how long did this take place over?)
one day plus however long it took to gather all the people of Israel

__where__ (did events range over?)
about 20 miles from Gilgal to Mizpah and Gibeah

[[why]] (did these things happen? what's the message to us?)
To illustrate how our decisions play a part in God's will, even when we go against his advice.  To set up the build-up of the kingdom and eventual let-down and national split after Solomon??


@@bgcolor(#ff9966):how@@ was God's will accomplished?
with willing participants (Samuel) and by God's Holy Spirit, and supernaturally by the lot picking the one already anointed by Samuel



theme:
God chooses a fickle king for a fickle people
for references to other verses, go to that verse chapter and make the verse into a part
asdfaslkja;sd asd asd
[[cybervillage church|http://www.cybervillagechurch.org/biblemaps.html]]
[[U of Texas|http://www.lib.utexas.edu/maps/historical/history_middle_east.html]]
[[biblestudy.org|http://www.biblestudy.org/maps/main.html]]
[[Painsley Catholic Highschool|http://www.painsley.org.uk/re/Atlas/default.htm]]
[[Historic Jesus|http://www.historicjesus.com/maps/index.html]]
see: http://groups.google.com/group/TiddlyWiki/browse_frm/thread/6e7ce5afcdf9c723/9e4f7d537f922170?lnk=gst&q=popup+tiddler&rnum=1#9e4f7d537f922170

click the down arrow
Why actually give them 7 days?  MH says:

The besieged desire, and obtain, seven days’ time to consider of this proposal, v. 3. If Nahash had not granted them this respite, __we may suppose the horror of the proposal would have made them desperate, and they would rather have died with their swords in their hands than have surrendered to such merciless enemies__: therefore Nahash, not imagining it possible that, in so short a time, they should have relief, and being very secure of the advantages he thought he had against them, in a bravado gave them seven days, __that the reproach upon Israel, for not rescuing them, might be the greater, and his triumphs the more illustrious__. But there was a providence in it, that his security might be his infatuation and ruin.
 <html>

<TEXTAREA name=notes rows=1
 cols=40 ></TEXTAREA>

</html>
''who,'' @@what's important,@@ __where__ ''//when//'' [[why is it important?]] 


|left | centered table | right|


<<<
blocked quote
<<<

{{{monospaced}}}

{{{
monoblocked
}}}

@@color:#fc3;highlight@@
/%comment%/
<<formTiddler ShortTextBoxTemplate1>>
{{{
<<formTiddler ShortTextBoxTemplate1>>
}}}
	  Now  David  fled,  and  escaped,  and  came  to  ''Samuel''  to  __Ramah__,  and  told  him  all  that  Saul  had  done  to  him.  @@He and Samuel went and lived in __Naioth__.@@
<<openTiddlers
     text:"Samuel"
     tiddlers:{{
         var key = "Samuel";
         t = store.getTiddlers();
         var m = "";
         for(var i=0; i<t.length; i++) {
             if(t[i].title.search(key) != -1) {
                 m += "'" + t[i].title + "' ";
             }
         }
     }}
     closeAll:true
     keepMe:false
 >> 
<<esv John 3:16>>
EditTools
does this mean that, though God chose Saul already, he also chose him publicly by "random" lot?
Was this really Samuel or just a demon?+++

and if it was Samuel, how many other "ghosts" are actually the Soul of the person it claims to be? +++
Wesley's Notes

28:12 Saw Samuel - The words are express, the woman saw Samuel, @@instead of the spirit whom she expected to see@@, God ordering it so for his own glory. She cried with a loud voice - Terrified and astonished, and thence easily conjectured, whom she had been talking with.

Matthew Henry's Concise Commentary

28:7-19 When we go from the plain path of duty, every thing draws us further aside, and increases our perplexity and temptation. Saul desires the woman to bring one from the dead, with whom he wished to speak; this was expressly forbidden, [[Deu 18:11]]. All real or pretended witchcraft or conjuration, is a malicious or an ignorant attempt to gain knowledge or help from some creature, when it cannot be had from the Lord in the path of duty. //''While Samuel was living, we never read of Saul's going to advise with him in any difficulties''//; it had been well for him if he had. But now he is dead, Bring me up Samuel. Many who despise and persecute God's saints and ministers when living, would be glad to have them again, when they are gone. The whole shows that it was no human fraud or trick. @@color:#AC3;Though the woman could not cause Samuel's being sent, yet Saul's inquiry might be the occasion of it@@. The woman's surprise and terror proved that it was an unusual and unexpected appearance. Saul had despised Samuel's solemn warnings in his lifetime, yet now that he hoped, as in defiance of God, to obtain some counsel and encouragement from him, might not God permit the soul of his departed prophet to appear to Saul, to confirm his former sentence, and denounce his doom? The expression, Thou and thy sons shall be with me, means no more than that they shall be in the eternal world. There appears much solemnity in God's permitting the soul of a departed prophet to come as a witness from heaven, to confirm the word he had spoken on earth.=== ===
The Bible: Approximate Dates When The Books Were Written

|BOOKS OF THE OLD TESTAMENT	||BOOKS OF THE NEW TESTAMENT|
|BOOK	|PROBABLE DATE	|BOOK	|DATE|
|Genesis	|c.1250-1200 B.C.|	Matthew|	c.40-60|
|Exodus	|c.1250-1200 B.C.	|Mark	|c.45-60|
|Leviticus	|c.1250-1200 B.C.	|Luke	|57-60|
|Numbers	|c.1250-1200 B.C.	|John	|c.40-65|
|Deuteronomy	|c.1250-1200 B.C.	|Acts	|57-62|
|Joshua|	c.1200 B.C.	|Romans	|57|
|Judges	|c.1200 B.C.	|1 Corinthians	|55|
|Ruth	|c.1000 B.C.	|2 Corinthians	|56|
|1st Samuel	|c.700 B.C.	|Galatians	|56|
|2nd Samuel	|c.700 B.C.	|Ephesians	|58|
|1st Kings	|c.600 B.C.	|Philippians	|58|
|2nd Kings	|c.600 B.C.	|Colossians	|58|
|1st Chronicles	|c.350 B.C.	|1 Thessalonians	|early 50|
|2nd Chronicles|	c.350 B.C.	|2 Thessalonians	|50-51|
|Ezra	|c.400 B.C.	|1 Timothy	|55|
|Nehemiah	|c.400 B.C.	|2 Timothy	|58|
|Tobit	|c.200 B.C.	|Titus	|57|
|Judith|	c.150 B.C.	|Philemon	|58|
|Esther|	c.300 B.C.	|Hebrews|	c.67|
|1st Maccabees	|c.100 B.C.	|James	|40's|
|2nd Maccabees	|c.125 B.C.	|1 Peter	|65|
|Job	|c.500 B.C.	|2 Peter	|61-62|
|Psalms	|c.500 B.C.	|1 John	|57-62|
|Proverbs	|c.450 B.C.	|2 John	|57-62|
|Ecclesiastes	|c.300 B.C.	|3 John	|57-62|
|Song of Songs	|c.450 B.C.	|Jude	|61-62|
|Wisdom	|c.100 B.C.	|Revelation	|68-70|
|Sirach (Ecclesiasticus)	|c.180 B.C.	|	|||
|Isaiah	|c.700 B.C.	|	|||
|Jermiah	|c.585 B.C.	|	|||
|Lamentations	|c.550 B.C.	|	|||
|Baruch	|c.550 B.C.		||||
|Ezekiel	|c.590 B.C.	|	|||
|Daniel	|c.165 B.C.		||||
|Hosea	|c.750 B.C.		||||
|Joel	|c.400 B.C.		||||
|Amos	|c.750 B.C.		||||
|Obadiah|	c.500 B.C.	|	|||
|Jonah	|c.450 B.C.		||||
|Micah	|c.740 B.C.		||||
|Nahum	|c.612 B.C.		||||
|Habakkuk	|c.600 B.C.	|	|||
|Zephaniah	|c.620 B.C.	|	|||
|Haggai	|c.520 B.C.		||||
|Zechariah	|c.520 B.C.	|	|||
|Malachi	|c.450 B.C.	|	|||

Source of dates of New Testament: John A. T. Robinson, "Redating The New Testament" 1976.

previous

<<version>>