-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathheader.html
67 lines (59 loc) · 30.5 KB
/
header.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
Sugarcane 1.1 is based on:
TiddlyWiki 1.2.39 by Jeremy Ruston, (jeremy [at] osmosoft [dot] com)
Published under a BSD open source license
Copyright (c) Osmosoft Limited 2005
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 the Osmosoft Limited 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>
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8">
<title>Sugarcane</title>
<script type="text/javascript">
function $(A){if(typeof A=="string"){return document.getElementById(A)}else{return A}}function clone(A){var B={};for(property in A){B[property]=A[property]}return B}function insertElement(A,D,F,C,E){var B=document.createElement(D);if(F){B.id=F}if(C){B.className=C}if(E){insertText(B,E)}if(A){A.appendChild(B)}return B}function insertText(A,B){return A.appendChild(document.createTextNode(B))}function removeChildren(A){while(A.hasChildNodes()){A.removeChild(A.firstChild)}}function setPageElement(C,B,A){if(place=$(C)){removeChildren(place);if(tale.has(B)){new Wikifier(place,tale.get(B).text)}else{new Wikifier(place,A)}}}function addStyle(B){if(document.createStyleSheet){document.getElementsByTagName("head")[0].insertAdjacentHTML("beforeEnd"," <style>"+B+"</style>")}else{var A=document.createElement("style");A.type="text/css";A.appendChild(document.createTextNode(B));document.getElementsByTagName("head")[0].appendChild(A)}}function throwError(A,B){new Wikifier(A,"'' @@ "+B+" @@ ''")}Math.easeInOut=function(A){return(1-((Math.cos(A*Math.PI)+1)/2))};String.prototype.readMacroParams=function(){var C=new RegExp("(?:\\s*)(?:(?:\"([^\"]*)\")|(?:'([^']*)')|(?:\\[\\[([^\\]]*)\\]\\])|([^\"'\\s]\\S*))","mg");var B=[];do{var A=C.exec(this);if(A){if(A[1]){B.push(A[1])}else{if(A[2]){B.push(A[2])}else{if(A[3]){B.push(A[3])}else{if(A[4]){B.push(A[4])}}}}}}while(A);return B};String.prototype.readBracketedList=function(){var B="\\[\\[([^\\]]+)\\]\\]";var A="[^\\s$]+";var E="(?:"+B+")|("+A+")";var D=new RegExp(E,"mg");var F=[];do{var C=D.exec(this);if(C){if(C[1]){F.push(C[1])}else{if(C[2]){F.push(C[2])}}}}while(C);return(F)};String.prototype.trim=function(){return this.replace(/^\s\s*/,"").replace(/\s\s*$/,"")};Array.prototype.indexOf||(Array.prototype.indexOf=function(B,D){D=(D==null)?0:D;var A=this.length;for(var C=D;C<A;C++){if(this[C]==B){return C}}return -1});function fade(F,C){var H;var E=F.cloneNode(true);var G=(C.fade=="in")?1:-1;F.parentNode.replaceChild(E,F);if(C.fade=="in"){H=0;E.style.visibility="visible"}else{H=1}B(E,H);var A=window.setInterval(D,25);function D(){H+=0.05*G;B(E,Math.easeInOut(H));if(((G==1)&&(H>=1))||((G==-1)&&(H<=0))){F.style.visibility=(C.fade=="in")?"visible":"hidden";E.parentNode.replaceChild(F,E);delete E;window.clearInterval(A);if(C.onComplete){C.onComplete()}}}function B(J,I){var K=Math.floor(I*100);J.style.zoom=1;J.style.filter="alpha(opacity="+K+")";J.style.opacity=I}}function scrollWindowTo(E){var D=window.scrollY?window.scrollY:document.body.scrollTop;var G=J(E);var C=Math.abs(D-G);var B=0;var I=(D>G)?-1:1;var F=window.setInterval(H,25);function H(){B+=0.1;window.scrollTo(0,D+I*(C*Math.easeInOut(B)));if(B>=1){window.clearInterval(F)}}function J(N){var O=A(N);var P=O+N.offsetHeight;var K=window.scrollY?window.scrollY:document.body.scrollTop;var L=window.innerHeight?window.innerHeight:document.body.clientHeight;var M=K+L;if(O<K){return O}else{if(P>M){if(N.offsetHeight<L){return(O-(L-N.offsetHeight)+20)}else{return O}}else{return O}}}function A(K){var L=0;while(K.offsetParent){L+=K.offsetTop;K=K.offsetParent}return L}}function History(){this.history=[{passage:null,variables:{},hash:null}]}History.prototype.init=function(){var A=this;if(!this.restore()){this.display("Start",null)}this.hash=window.location.hash;this.interval=window.setInterval(function(){A.watchHash.apply(A)},250)};History.prototype.display=function(D,B,A){var C=tale.get(D);this.history.unshift({passage:C,variables:clone(this.history[0].variables)});this.history[0].hash=this.save();var E=C.render();if(A!="offscreen"){removeChildren($("passages"));$("passages").appendChild(E);if(A!="quietly"){fade(E,{fade:"in"})}}if((A=="quietly")||(A=="offscreen")){E.style.visibility="visible"}if(A!="offscreen"){document.title=tale.title;this.hash=this.save();if(C.title!="Start"){document.title+=": "+C.title;window.location.hash=this.hash}window.scroll(0,0)}return E};History.prototype.restart=function(){window.location.hash=""};History.prototype.save=function(C){var A="";for(var B=this.history.length-1;B>=0;B--){if((this.history[B].passage)&&(this.history[B].passage.id)){A+=this.history[B].passage.id.toString(36)+"."}}return"#"+A.substr(0,A.length-1)};History.prototype.restore=function(){try{if((window.location.hash=="")||(window.location.hash=="#")){return false}var A=window.location.hash.replace("#","").split(".");var C=[];for(var B=0;B<A.length;B++){var F=parseInt(A[B],36);if(!tale.has(F)){return false}var E=(B==A.length-1)?"":"offscreen";C.unshift(this.display(F,null,E))}return true}catch(D){return false}};History.prototype.watchHash=function(){if(window.location.hash!=this.hash){if((window.location.hash!="")&&(window.location.hash!="#")){this.history=[{passage:null,variables:{}}];removeChildren($("passages"));$("passages").style.visibility="hidden";if(!this.restore()){alert("The passage you had previously visited could not be found.")}$("passages").style.visibility="visible"}else{window.location.reload()}this.hash=window.location.hash}};var version={major:2,minor:0,revision:0,date:new Date("July 30, 2007"),extensions:{}};var tale,state;var macros={};function main(){tale=new Tale();document.title=tale.title;setPageElement("storyTitle","StoryTitle","Untitled Story");if(tale.has("StoryAuthor")){$("titleSeparator").innerHTML="<br />";setPageElement("storyAuthor","StoryAuthor","")}if(tale.has("StoryMenu")){$("storyMenu").style.display="block";setPageElement("storyMenu","StoryMenu","")}for(macro in macros){if(typeof macro.init=="function"){macro.init()}}var styles=tale.lookup("tags","stylesheet");for(var i=0;i<styles.length;i++){addStyle(styles[i].text)}var scripts=tale.lookup("tags","script");for(var i=0;i<scripts.length;i++){try{eval(scripts[i].text)}catch(e){alert("There is a technical problem with this story ("+scripts[i].title+": "+e.message+"). You may be able to continue reading, but all parts of the story may not work properly.")}}state=new History();state.init()}Interface={init:function(){main();$("snapback").onclick=Interface.showSnapback;$("restart").onclick=Interface.restart;$("share").onclick=Interface.showShare},restart:function(){if(confirm("Are you sure you want to restart this story?")){state.restart()}},showShare:function(A){Interface.hideAllMenus();Interface.showMenu(A,$("shareMenu"))},showSnapback:function(A){Interface.hideAllMenus();Interface.buildSnapback();Interface.showMenu(A,$("snapbackMenu"))},buildSnapback:function(){var C=false;removeChildren($("snapbackMenu"));for(var A=state.history.length-1;A>=0;A--){if(state.history[A].passage&&state.history[A].passage.tags.indexOf("bookmark")!=-1){var B=document.createElement("div");B.hash=state.history[A].hash;B.onclick=function(){window.location.hash=this.hash};B.innerHTML=state.history[A].passage.excerpt();$("snapbackMenu").appendChild(B);C=true}}if(!C){var B=document.createElement("div");B.innerHTML="<i>No passages available</i>";$("snapbackMenu").appendChild(B)}},hideAllMenus:function(){$("shareMenu").style.display="none";$("snapbackMenu").style.display="none"},showMenu:function(B,A){if(!B){B=window.event}var C={x:0,y:0};if(B.pageX||B.pageY){C.x=B.pageX;C.y=B.pageY}else{if(B.clientX||B.clientY){C.x=B.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;C.y=B.clientY+document.body.scrollTop+document.documentElement.scrollTop}}A.style.top=C.y+"px";A.style.left=C.x+"px";A.style.display="block";document.onclick=Interface.hideAllMenus;B.cancelBubble=true;if(B.stopPropagation){B.stopPropagation()}}};window.onload=Interface.init;version.extensions.backMacro={major:1,minor:0,revision:0};macros.back={handler:function(A,B,E){var D="";if(E[0]){for(var C=0;C<state.history.length;C++){if(state.history[C].passage.title==E[0]){D=state.history[C].hash;break}else{D=state.history[1].hash}}}if(D==""){throwError(A,"can't find passage \""+E[0]+'" in history');return }el=document.createElement("a");el.className="back";el.href=D;el.innerHTML="<b>«</b> Back";A.appendChild(el)}};version.extensions.displayMacro={major:1,minor:0,revision:0};macros.display={handler:function(A,B,C){new Wikifier(A,tale.get(C[0]).text)}};version.extensions.actionsMacro={major:1,minor:1,revision:0};macros.actions={handler:function(A,F,G){var E=insertElement(A,"ul");for(var B=0;B<G.length;B++){if(state.history[0].variables["actions clicked"][G[B]]){continue}var D=insertElement(E,"li");var C=Wikifier.createInternalLink(D,G[B]);insertText(C,G[B]);C.onclick=function(){state.history[0].variables["actions clicked"][this.id]=true;state.display(this.id,C)}}}};version.extensions.printMacro={major:1,minor:1,revision:0};macros.print={handler:function(place,macroName,params,parser){try{var output=eval(parser.fullArgs());if(output){new Wikifier(place,output.toString())}}catch(e){throwError(place,"bad expression: "+e.message)}}};version.extensions.setMacro={major:1,minor:1,revision:0};macros.set={handler:function(A,B,C,D){macros.set.run(D.fullArgs())},run:function(expression){try{return eval(Wikifier.parse(expression))}catch(e){throwError(place,"bad expression: "+e.message)}}};version.extensions.ifMacros={major:1,minor:0,revision:0};macros["if"]={handler:function(place,macroName,params,parser){var condition=parser.fullArgs();var srcOffset=parser.source.indexOf(">>",parser.matchStart)+2;var src=parser.source.slice(srcOffset);var endPos=-1;var trueClause="";var falseClause="";for(var i=0,nesting=1,currentClause=true;i<src.length;i++){if(src.substr(i,9)=="<<endif>>"){nesting--;if(nesting==0){endPos=srcOffset+i+9;break}}if((src.substr(i,8)=="<<else>>")&&(nesting==1)){currentClause="false";i+=8}if(src.substr(i,5)=="<<if "){nesting++}if(currentClause==true){trueClause+=src.charAt(i)}else{falseClause+=src.charAt(i)}}try{if(eval(condition)){new Wikifier(place,trueClause.trim())}else{new Wikifier(place,falseClause.trim())}if(endPos!=-1){parser.nextMatch=endPos}else{throwError(place,"can't find matching endif")}}catch(e){throwError(place,"bad condition: "+e.message)}}};macros["else"]=macros.endif={handler:function(){}};version.extensions.rememberMacro={major:1,minor:1,revision:0};macros.remember={handler:function(place,macroName,params,parser){var statement=parser.fullArgs();var expire=new Date();var variable,value;macros.set.run(statement);var variableSigil=Wikifier.parse("$");variableSigil=variableSigil.replace("[","\\[");variableSigil=variableSigil.replace("]","\\]");variable=statement.match(new RegExp(variableSigil+"(\\w+)","i"))[1];value=eval(Wikifier.parse("$"+variable));switch(typeof value){case"string":value='"'+value.replace(/"/g,'\\"')+'"';break;case"number":case"boolean":break;default:throwError(place,"can't remember $"+variable+" ("+(typeof value)+")");return }expire.setYear(expire.getFullYear()+1);document.cookie=macros.remember.prefix+variable+"="+value+"; expires="+expire.toGMTString()},init:function(){if(tale.has("StoryTitle")){macros.remember.prefix=tale.get("StoryTitle").text+"_"}else{macros.remember.prefix="__jonah_"}var cookies=document.cookie.split(";");for(var i=0;i<cookies.length;i++){var bits=cookies[i].split("=");if(bits[0].trim().indexOf(this.prefix)==0){var statement=cookies[i].replace(this.prefix,"$");eval(Wikifier.parse(statement))}}}};version.extensions.SilentlyMacro={major:1,minor:0,revision:0};macros.silently={handler:function(G,E,F,B){var H=insertElement(null,"div");var J=B.source.indexOf(">>",B.matchStart)+2;var A=B.source.slice(J);var D=-1;var C="";for(var I=0;I<A.length;I++){if(A.substr(I,15)=="<<endsilently>>"){D=J+I+15}else{C+=A.charAt(I)}}if(D!=-1){new Wikifier(H,C);B.nextMatch=D}else{throwError(G,"can't find matching endsilently")}delete H}};macros.endsilently={handler:function(){}};version.extensions.choiceMacro={major:1,minor:0,revision:0};macros.choice={handler:function(A,B,C){Wikifier.createInternalLink(A,C[0])}};function Passage(C,B,A){this.title=C;if(B){this.id=A;this.initialText=this.text=Passage.unescapeLineBreaks(B.firstChild?B.firstChild.nodeValue:"");this.tags=B.getAttribute("tags");if(typeof this.tags=="string"){this.tags=this.tags.readBracketedList()}else{this.tags=[]}}else{this.initialText=this.text="@@This passage does not exist.@@";this.tags=[]}}Passage.prototype.render=function(){var B=insertElement(null,"div","passage"+this.title,"passage");B.style.visibility="hidden";insertElement(B,"div","","header");var A=insertElement(B,"div","","content");new Wikifier(A,this.text);insertElement(B,"div","","footer");return B};Passage.prototype.reset=function(){this.text=this.initialText};Passage.prototype.excerpt=function(){var B=this.text.replace(/<<.*?>>/g,"");B=B.replace(/!.*?\n/g,"");B=B.replace(/[\[\]\/]/g,"");var A=B.match(/(.*?\s.*?\s.*?\s.*?\s.*?\s.*?\s.*?)\s/);return A[1]+"..."};Passage.unescapeLineBreaks=function(A){if(A&&A!=""){return A.replace(/\\n/mg,"\n").replace(/\\/mg,"\\").replace(/\r/mg,"")}else{return""}};function Tale(){this.passages={};if(document.normalize){document.normalize()}var A=$("storeArea").childNodes;for(var B=0;B<A.length;B++){var C=A[B];if(C.getAttribute&&(tiddlerTitle=C.getAttribute("tiddler"))){this.passages[tiddlerTitle]=new Passage(tiddlerTitle,C,B)}}this.title="Sugarcane";if(this.passages.StoryTitle){this.title=this.passages.StoryTitle.text}}Tale.prototype.has=function(A){if(typeof A=="string"){return(this.passages[A]!=null)}else{for(i in this.passages){if(this.passages[i].id==A){return true}}return false}};Tale.prototype.get=function(A){if(typeof A=="string"){return this.passages[A]||new Passage(A)}else{for(i in this.passages){if(this.passages[i].id==A){return this.passages[i]}}}};Tale.prototype.lookup=function(H,G,A){var D=[];for(var C in this.passages){var F=this.passages[C];var E=false;for(var B=0;B<F[H].length;B++){if(F[H][B]==G){D.push(F)}}}if(!A){A="title"}D.sort(function(J,I){if(J[A]==I[A]){return(0)}else{return(J[A]<I[A])?-1:+1}});return D};Tale.prototype.reset=function(){for(i in this.passages){this.passages[i].reset()}};function Wikifier(A,B){this.source=B;this.output=A;this.nextMatch=0;this.assembleFormatterMatches(Wikifier.formatters);this.subWikify(this.output)}Wikifier.prototype.assembleFormatterMatches=function(A){this.formatters=[];var B=[];for(var C=0;C<A.length;C++){B.push("("+A[C].match+")");this.formatters.push(A[C])}this.formatterRegExp=new RegExp(B.join("|"),"mg")};Wikifier.prototype.subWikify=function(C,B){var A=this.output;this.output=C;var F=B?new RegExp("("+B+")","mg"):null;do{this.formatterRegExp.lastIndex=this.nextMatch;if(F){F.lastIndex=this.nextMatch}var G=this.formatterRegExp.exec(this.source);var E=F?F.exec(this.source):null;if(E&&(!G||E.index<=G.index)){if(E.index>this.nextMatch){this.outputText(this.output,this.nextMatch,E.index)}this.matchStart=E.index;this.matchLength=E[1].length;this.matchText=E[1];this.nextMatch=E.index+E[1].length;this.output=A;return }else{if(G){if(G.index>this.nextMatch){this.outputText(this.output,this.nextMatch,G.index)}this.matchStart=G.index;this.matchLength=G[0].length;this.matchText=G[0];this.nextMatch=this.formatterRegExp.lastIndex;var H=-1;for(var D=1;D<G.length;D++){if(G[D]){matchingFormatter=D-1}}if(matchingFormatter!=-1){this.formatters[matchingFormatter].handler(this)}}}}while(E||G);if(this.nextMatch<this.source.length){this.outputText(this.output,this.nextMatch,this.source.length);this.nextMatch=this.source.length}this.output=A};Wikifier.prototype.outputText=function(A,C,B){insertText(A,this.source.substring(C,B))};Wikifier.prototype.fullArgs=function(){var B=this.source.indexOf(" ",this.matchStart);var A=this.source.indexOf(">>",this.matchStart);return Wikifier.parse(this.source.slice(B,A))};Wikifier.parse=function(B){var A=B.replace(/\$/g,"state.history[0].variables.");A=A.replace(/\beq\b/gi," == ");A=A.replace(/\bneq\b/gi," != ");A=A.replace(/\bgt\b/gi," > ");A=A.replace(/\beq\b/gi," == ");A=A.replace(/\bneq\b/gi," != ");A=A.replace(/\bgt\b/gi," > ");A=A.replace(/\bgte\b/gi," >= ");A=A.replace(/\blt\b/gi," < ");A=A.replace(/\blte\b/gi," <= ");A=A.replace(/\band\b/gi," && ");A=A.replace(/\bor\b/gi," || ");A=A.replace(/\bnot\b/gi," ! ");return A};Wikifier.formatHelpers={charFormatHelper:function(A){var B=insertElement(A.output,this.element);A.subWikify(B,this.terminator)},inlineCssHelper:function(F){var H=[];var A="(?:("+Wikifier.textPrimitives.anyLetter+"+)\\(([^\\)\\|\\n]+)(?:\\):))|(?:("+Wikifier.textPrimitives.anyLetter+"+):([^;\\|\\n]+);)";var B=new RegExp(A,"mg");var C=false;do{B.lastIndex=F.nextMatch;var D=B.exec(F.source);var E=D&&D.index==F.nextMatch;if(E){var I,G;C=true;if(D[1]){I=D[1].unDash();G=D[2]}else{I=D[3].unDash();G=D[4]}switch(I){case"bgcolor":I="backgroundColor";break}H.push({style:I,value:G});F.nextMatch=D.index+D[0].length}}while(E);return H},monospacedByLineHelper:function(A){var B=new RegExp(this.lookahead,"mg");B.lastIndex=A.matchStart;var C=B.exec(A.source);if(C&&C.index==A.matchStart){var E=C[1];if(navigator.userAgent.indexOf("msie")!=-1&&navigator.userAgent.indexOf("opera")==-1){E=E.replace(/\n/g,"\r")}var D=insertElement(A.output,"pre",null,null,E);A.nextMatch=C.index+C[0].length}}};Wikifier.formatters=[{name:"table",match:"^\\|(?:[^\\n]*)\\|(?:[fhc]?)$",lookahead:"^\\|([^\\n]*)\\|([fhc]?)$",rowTerminator:"\\|(?:[fhc]?)$\\n?",cellPattern:"(?:\\|([^\\n\\|]*)\\|)|(\\|[fhc]?$\\n?)",cellTerminator:"(?:\\x20*)\\|",rowTypes:{c:"caption",h:"thead","":"tbody",f:"tfoot"},handler:function(H){var J=insertElement(H.output,"table");H.nextMatch=H.matchStart;var C=new RegExp(this.lookahead,"mg");var D=null,A;var K,E;var I=[];var G=0;do{C.lastIndex=H.nextMatch;var F=C.exec(H.source);var B=F&&F.index==H.nextMatch;if(B){A=F[2];if(A!=D){K=insertElement(J,this.rowTypes[A])}D=A;if(D=="c"){if(G==0){K.setAttribute("align","top")}else{K.setAttribute("align","bottom")}H.nextMatch=H.nextMatch+1;H.subWikify(K,this.rowTerminator)}else{E=insertElement(K,"tr");this.rowHandler(H,E,I)}G++}}while(B)},rowHandler:function(G,D,K){var A=0;var I=1;var C=new RegExp(this.cellPattern,"mg");do{C.lastIndex=G.nextMatch;var E=C.exec(G.source);matched=E&&E.index==G.nextMatch;if(matched){if(E[1]=="~"){var J=K[A];if(J){J.rowCount++;J.element.setAttribute("rowSpan",J.rowCount);J.element.setAttribute("rowspan",J.rowCount);J.element.valign="center"}G.nextMatch=E.index+E[0].length-1}else{if(E[1]==">"){I++;G.nextMatch=E.index+E[0].length-1}else{if(E[2]){G.nextMatch=E.index+E[0].length;break}else{var B=false,F=false;G.nextMatch++;var M=Wikifier.formatHelpers.inlineCssHelper(G);while(G.source.substr(G.nextMatch,1)==" "){B=true;G.nextMatch++}var H;if(G.source.substr(G.nextMatch,1)=="!"){H=insertElement(D,"th");G.nextMatch++}else{H=insertElement(D,"td")}K[A]={rowCount:1,element:H};lastColCount=1;lastColElement=H;if(I>1){H.setAttribute("colSpan",I);H.setAttribute("colspan",I);I=1}for(var L=0;L<M.length;L++){H.style[M[L].style]=M[L].value}G.subWikify(H,this.cellTerminator);if(G.matchText.substr(G.matchText.length-2,1)==" "){F=true}if(B&&F){H.align="center"}else{if(B){H.align="right"}else{if(F){H.align="left"}}}G.nextMatch=G.nextMatch-1}}}A++}}while(matched)}},{name:"rule",match:"^----$\\n?",handler:function(A){insertElement(A.output,"hr")}},{name:"emdash",match:"--",handler:function(A){var B=insertElement(A.output,"span");B.innerHTML="—"}},{name:"heading",match:"^!{1,5}",terminator:"\\n",handler:function(A){var B=insertElement(A.output,"h"+A.matchLength);A.subWikify(B,this.terminator)}},{name:"monospacedByLine",match:"^\\{\\{\\{\\n",lookahead:"^\\{\\{\\{\\n((?:^[^\\n]*\\n)+?)(^\\}\\}\\}$\\n?)",handler:Wikifier.formatHelpers.monospacedByLineHelper},{name:"monospacedByLineForPlugin",match:"^//\\{\\{\\{\\n",lookahead:"^//\\{\\{\\{\\n\\n*((?:^[^\\n]*\\n)+?)(\\n*^//\\}\\}\\}$\\n?)",handler:Wikifier.formatHelpers.monospacedByLineHelper},{name:"wikifyCommentForPlugin",match:"^/\\*\\*\\*\\n",terminator:"^\\*\\*\\*/\\n",handler:function(A){A.subWikify(A.output,this.terminator)}},{name:"quoteByBlock",match:"^<<<\\n",terminator:"^<<<\\n",handler:function(A){var B=insertElement(A.output,"blockquote");A.subWikify(B,this.terminator)}},{name:"quoteByLine",match:"^>+",terminator:"\\n",element:"blockquote",handler:function(C){var E=new RegExp(this.match,"mg");var D=[C.output];var H=0;var B=C.matchLength;var G;do{if(B>H){for(G=H;G<B;G++){D.push(insertElement(D[D.length-1],this.element))}}else{if(B<H){for(G=H;G>B;G--){D.pop()}}}H=B;C.subWikify(D[D.length-1],this.terminator);insertElement(D[D.length-1],"br");E.lastIndex=C.nextMatch;var F=E.exec(C.source);var A=F&&F.index==C.nextMatch;if(A){B=F[0].length;C.nextMatch+=F[0].length}}while(A)}},{name:"list",match:"^(?:(?:\\*+)|(?:#+))",lookahead:"^(?:(\\*+)|(#+))",terminator:"\\n",outerElement:"ul",itemElement:"li",handler:function(I){var B=new RegExp(this.lookahead,"mg");I.nextMatch=I.matchStart;var E=[I.output];var J=null,C;var G=0,D;var K;do{B.lastIndex=I.nextMatch;var F=B.exec(I.source);var A=F&&F.index==I.nextMatch;if(A){if(F[1]){C="ul"}if(F[2]){C="ol"}D=F[0].length;I.nextMatch+=F[0].length;if(D>G){for(K=G;K<D;K++){E.push(insertElement(E[E.length-1],C))}}else{if(D<G){for(K=G;K>D;K--){E.pop()}}else{if(D==G&&C!=J){E.pop();E.push(insertElement(E[E.length-1],C))}}}G=D;J=C;var H=insertElement(E[E.length-1],"li");I.subWikify(H,this.terminator)}}while(A)}},{name:"prettyLink",match:"\\[\\[",lookahead:"\\[\\[([^\\|\\]]*?)(?:(\\]\\])|(\\|(.*?)\\]\\]))",terminator:"\\|",handler:function(A){var B=new RegExp(this.lookahead,"mg");B.lastIndex=A.matchStart;var C=B.exec(A.source);if(C&&C.index==A.matchStart&&C[2]){var D=Wikifier.createInternalLink(A.output,C[1]);A.outputText(D,A.nextMatch,A.nextMatch+C[1].length);A.nextMatch+=C[1].length+2}else{if(C&&C.index==A.matchStart&&C[3]){var E;if(tale.has(C[4])){E=Wikifier.createInternalLink(A.output,C[4])}else{E=Wikifier.createExternalLink(A.output,C[4])}A.outputText(E,A.nextMatch,A.nextMatch+C[1].length);A.nextMatch=C.index+C[0].length}}}},{name:"urlLink",match:"(?:http|https|mailto|ftp):[^\\s'\"]+(?:/|\\b)",handler:function(A){var B=Wikifier.createExternalLink(A.output,A.matchText);A.outputText(B,A.matchStart,A.nextMatch)}},{name:"image",match:"\\[(?:[<]{0,1})(?:[>]{0,1})[Ii][Mm][Gg]\\[",lookahead:"\\[([<]{0,1})([>]{0,1})[Ii][Mm][Gg]\\[(?:([^\\|\\]]+)\\|)?([^\\[\\]\\|]+)\\](?:\\[([^\\]]*)\\]?)?(\\])",handler:function(A){var C=new RegExp(this.lookahead,"mg");C.lastIndex=A.matchStart;var D=C.exec(A.source);if(D&&D.index==A.matchStart){var E=A.output;if(D[5]){if(tale.has(D[5])){E=Wikifier.createInternalLink(A.output,D[5])}else{E=Wikifier.createExternalLink(A.output,D[5])}}var B=insertElement(E,"img");if(D[1]){B.align="left"}else{if(D[2]){B.align="right"}}if(D[3]){B.title=D[3]}B.src=D[4];A.nextMatch=D.index+D[0].length}}},{name:"macro",match:"<<",lookahead:"<<([^>\\s]+)(?:\\s*)([^>]*)>>",handler:function(A){var B=new RegExp(this.lookahead,"mg");B.lastIndex=A.matchStart;var C=B.exec(A.source);if(C&&C.index==A.matchStart&&C[1]){var F=C[2].readMacroParams();A.nextMatch=C.index+C[0].length;try{var D=macros[C[1]];if(D&&D.handler){D.handler(A.output,C[1],F,A)}else{insertElement(A.output,"span",null,"marked","macro not found: "+C[1])}}catch(E){throwError(A.output,"Error executing macro "+C[1]+": "+E.toString())}}}},{name:"html",match:"<[Hh][Tt][Mm][Ll]>",lookahead:"<[Hh][Tt][Mm][Ll]>((?:.|\\n)*?)</[Hh][Tt][Mm][Ll]>",handler:function(A){var B=new RegExp(this.lookahead,"mg");B.lastIndex=A.matchStart;var C=B.exec(A.source);if(C&&C.index==A.matchStart){var D=insertElement(A.output,"span");D.innerHTML=C[1];A.nextMatch=C.index+C[0].length}}},{name:"commentByBlock",match:"/%",lookahead:"/%((?:.|\\n)*?)%/",handler:function(A){var B=new RegExp(this.lookahead,"mg");B.lastIndex=A.matchStart;var C=B.exec(A.source);if(C&&C.index==A.matchStart){A.nextMatch=C.index+C[0].length}}},{name:"boldByChar",match:"''",terminator:"''",element:"strong",handler:Wikifier.formatHelpers.charFormatHelper},{name:"strikeByChar",match:"==",terminator:"==",element:"strike",handler:Wikifier.formatHelpers.charFormatHelper},{name:"underlineByChar",match:"__",terminator:"__",element:"u",handler:Wikifier.formatHelpers.charFormatHelper},{name:"italicByChar",match:"//",terminator:"//",element:"em",handler:Wikifier.formatHelpers.charFormatHelper},{name:"subscriptByChar",match:"~~",terminator:"~~",element:"sub",handler:Wikifier.formatHelpers.charFormatHelper},{name:"superscriptByChar",match:"\\^\\^",terminator:"\\^\\^",element:"sup",handler:Wikifier.formatHelpers.charFormatHelper},{name:"monospacedByChar",match:"\\{\\{\\{",lookahead:"\\{\\{\\{((?:.|\\n)*?)\\}\\}\\}",handler:function(A){var B=new RegExp(this.lookahead,"mg");B.lastIndex=A.matchStart;var C=B.exec(A.source);if(C&&C.index==A.matchStart){var D=insertElement(A.output,"code",null,null,C[1]);A.nextMatch=C.index+C[0].length}}},{name:"styleByChar",match:"@@",terminator:"@@",lookahead:"(?:([^\\(@]+)\\(([^\\)]+)(?:\\):))|(?:([^:@]+):([^;]+);)",handler:function(A){var D=insertElement(A.output,"span",null,null,null);var C=Wikifier.formatHelpers.inlineCssHelper(A);if(C.length==0){D.className="marked"}else{for(var B=0;B<C.length;B++){D.style[C[B].style]=C[B].value}}A.subWikify(D,this.terminator)}},{name:"lineBreak",match:"\\n",handler:function(A){insertElement(A.output,"br")}}];Wikifier.textPrimitives={anyDigit:"[0-9]",anyNumberChar:"[0-9\\.E]",urlPattern:"(?:http|https|mailto|ftp):[^\\s'\"]+(?:/|\\b)"};Wikifier.createInternalLink=function(A,C){var B=insertElement(A,"a",C);B.href="javascript:void(0)";if(tale.has(C)){B.className="internalLink"}else{B.className="brokenLink"}B.onclick=function(){state.display(C,B)};if(A){A.appendChild(B)}return B};Wikifier.createExternalLink=function(A,B){var C=insertElement(A,"a");C.href=B;C.className="externalLink";C.target="_blank";if(A){A.appendChild(C)}return C};if(!((new RegExp("[\u0150\u0170]","g")).test("\u0150"))){Wikifier.textPrimitives.upperLetter="[A-Z\u00c0-\u00de]";Wikifier.textPrimitives.lowerLetter="[a-z\u00df-\u00ff_0-9\\-]";Wikifier.textPrimitives.anyLetter="[A-Za-z\u00c0-\u00de\u00df-\u00ff_0-9\\-]"}else{Wikifier.textPrimitives.upperLetter="[A-Z\u00c0-\u00de\u0150\u0170]";Wikifier.textPrimitives.lowerLetter="[a-z\u00df-\u00ff_0-9\\-\u0151\u0171]";Wikifier.textPrimitives.anyLetter="[A-Za-z\u00c0-\u00de\u00df-\u00ff_0-9\\-\u0150\u0170\u0151\u0171]"};
</script>
<style type="text/css">
body{background-color:#000;color:#fff;font-family:Verdana,sans-serif;font-size:62.5%;margin:4em 15% 5% 5em;}#sidebar{position:fixed;top:4.2em;left:7.5em;width:12em;list-style:none;margin:0;padding:0 1em 0 0;font:bold 1.1em Verdana,sans-serif;}#sidebar li{color:#333;text-align:right;background-repeat:no-repeat;margin-bottom:1em;}#sidebar li:hover{color:#fff;cursor:pointer;}#sidebar li a{color:#333;}#sidebar li a:hover{color:#fff;text-decoration:none;}#sidebar #title{color:#999;font-size:150%;cursor:auto;}#sidebar #title a{color:#999;}#sidebar #title a:hover{color:#fff;}#sidebar #storyAuthor{font-size:50%;}#sidebar #storyMenu{display:none;line-height:2.5em;margin-bottom:.5em;}#sidebar #title:hover{color:#999;}#sidebar #credits{padding-top:2em;font-weight:normal;font-size:80%;cursor:auto;}#sidebar #credits:hover{color:#333;}#sidebar #credits a{text-decoration:none;}.menu{position:absolute;display:none;background-color:#343434;color:#fff;opacity:.9;border:1px solid #fff;text-align:left;font:1.1em Verdana;line-height:2em;}.menu div{padding:0 .4em;}.menu div:hover{cursor:pointer;background-color:#fff;color:#343434;}#passages{margin-left:18.2em;border-left:1px solid #333;padding-left:1.5em;}.passage{font-size:1.2em;line-height:175%;margin-bottom:2em;text-align:left;}.passage ul{padding-top:1.3em;text-align:center;}.passage li{display:inline;margin-right:6em;}a.internalLink,a.externalLink,a.back{color:#4d6ad8;font-weight:bold;text-decoration:none;}a.internalLink:hover,a.externalLink:hover,a.back:hover{color:#8ea6ff;text-decoration:underline;}a.brokenLink{background-color:red;text-decoration:none;color:#000;}.marked{background-color:red;color:#000;margin-right:12px;padding:3px;}.passage ul{margin-left:.5em;padding-left:1.5em;}.passage ol{margin-left:.5em;padding-left:1.5em;}.passage table{border-collapse:collapse;font-size:100%;margin:.8em 1.0em;}.passage th,.passage td,.passage tr,.passage caption{padding:3px;}.passage hr{height:1px;}#storeArea{display:none;}
</style>
</head>
<body>
<ul id="sidebar">
<li id="title"><span id="storyTitle"></span><span id="titleSeparator"></span><span id="storyAuthor"></span></li>
<li id="storyMenu"></li>
<li id="snapback">Rewind</li>
<li id="restart">Restart</li>
<li id="share">Share</li>
<li id="credits">
This story was created with <a href="http://gimcrackd.com/etc/src/">Twee</a> and is powered by <a href="http://tiddlywiki.com/">TiddlyWiki</a>.
</li>
</ul>
<div id="snapbackMenu" class="menu"></div>
<div id="shareMenu" class="menu">
<div onclick="javascript:location.href='http://digg.com/submit?phase=2%20&title='+tale.get('StoryTitle').text+'&url='+location.href">Digg</div>
<div onclick="javascript:location.href='http://del.icio.us/post?title='+tale.get('StoryTitle').text+'&url='+location.href">Delicious</div>
<div onclick="javascript:location.href='http://facebook.com/share.php?t='+tale.get('StoryTitle').text+'&u='+location.href">Facebook</div>
<div onclick="javascript:location.href='http://stumbleupon.com/submit?title='+tale.get('StoryTitle').text+'&url='+location.href">StumbleUpon</div>
<div onclick="javascript:location.href='http://furl.net/storeIt.jsp?t='+tale.get('StoryTitle').text+'&u='+location.href">Furl</div>
</div>
<div id="passages"></div>
<div id="storeArea">