\n!!Practice parameter from the American Academy of Neurology: Outcome in comatose survivors after CPR, 2006. [[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=AbstractPlus&list_uids=16864809&query_hl=1&itool=pubmed_docsum]]\n<html>\n<img src="http://d.gitelman.googlepages.com/comapredictor.gif" alt="Figure 1 from article" width="75%">\n</html>\nFigure adapted from Wijdicks et al., 2006. As noted in the original * indicates that the test may not be available in a timely manner. NSE = neuron specific enolase. FPR = false positive rate. An low FPR indicates a poor outcome with a high degree of certainty. Numbers in parentheses are 95% confidence intervals. Refer to the original article before making decisions that affect patient care.\n
!Welcome to your ''tiddlyspot.com'' ~TiddlyWiki!\n''[[tiddlyspot.com|http://tiddlyspot.com]]'' gives you an instant [[TiddlyWiki|http://tiddlywiki.com]] hosted on our ''tiddlyspot.com'' servers.\n\nWant to work online? No problem, you can go to your ''tiddlyspot.com'' URL (which is http://brainz.tiddlyspot.com/ ) and start editing. Click "save to web" and your changes are saved directly to your ''tiddlyspot.com'' home -- no messing about with local files or ftp.\n\nWant to work offline? No problem, your ''tiddlyspot.com'' ~TiddlyWiki is a real, fully functioning ~TiddlyWiki that you can save onto your hard drive or USB stick. Use the link below to save to your local computer. As you make changes, use the "save to disk" button to save to your local file. Whenever you're ready to sync up again, just click "save to web".\n\n!To save online\nEnter the upload password provided when you created your ~TiddlyWiki. Then click the "save to web" button below (or in the right side column) to save your ~TiddlyWiki.\nUpload Password: <<option pasUploadPassword>>\n<<upload http://brainz.tiddlyspot.com/store.cgi index.html . . brainz>>\n\n!To save offline\nTo take this ~TiddlyWiki offline, click [[Download|http://tiddlyspot.com/?action=download&site=brainz]]. Save the file locally then open it in your browser.\n\n\n!Learn more about ~TiddlyWiki\nFind out more about ~TiddlyWiki at [[TiddlyWiki.com|http://tiddlywiki.com]]. Also visit [[TiddlyWiki Guides|http://tiddlywikiguides.org]] for documentation on learning and using ~TiddlyWiki.\n\nThe [[TiddlyWiki mailing list|http://groups.google.com/group/TiddlyWiki]] is an excellent place to ask questions and get help.\n\n!Enjoy!\nWe hope you like using your ''tiddlyspot.com'' ~TiddlyWiki. Please email [[feedback@tiddlyspot.com|mailto:feedback@tiddlyspot.com]] with any comments.\n\n----
\n!Mania\nMania can occur with antibiotic treatment but is very rare. Most commonly associated are clarithromycin, isoniazid, ofloxocin, ciprofloxacin, metronidazole, cotrimoxazole and erythromycin. However, none of these agents showed any statistical association with mania, and even the most frequently associated had no more than 1-2 dozen cases in reports from the FDA and WHO. Amoxicillin had 1 report. [[Pubmed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=Abstract&list_uids=11799346&query_hl=2&itool=pubmed_docsum]]\n\n!Dystonic reactions\n(Drugs with dystonic reaction listed in adverse effects in Clinical Pharmacology (Copyright Gold Standard). Interestingly, several antihistamines and anticholinergic drugs, which are used to treat dystonic reactions, can cause them as well, e.g., benadryl.\n\n| Amphotericin B | Dimenhydrinate | Meclizine | Perphenazine | Thiethylperazine |\n| Baclofen | Droperidol | Meperidine | Phenytoin | Thioridazine |\n| Benadryl | Fluoxetine | Mesoridazine | Pimozide | Thiothixene |\n| Buspirone | Fluphenazine | Methylphenidate | Prochlorperazine | Thorazine |\n| Carbidopa | Fosphenytoin | Metoclopramide | Promethazine | Trifluoperazine |\n| Cetirizine | Gabapentin | Olanzapine | Propofol | Zisprasidone |\n| Chlorpromazine | Granisetron | Ondansetron | Quinine | |\n| Clozapine | Hydroxyzine | Pemoline | Rasagiline | | |\n| Dextromethorphan | Levodopa | Penicillamine | Risperidone |\n| Diazoxide | Loxapine | Pergolide | Selegiline |\n\nThe following drugs have been associated with oculogyric crises:\n<<<\nneuroleptics, amantadine, benzodiazepines, carbamazepine, chloroquine, cisplatin, diazoxide, influenza vaccine, levodopa, lithium, metoclopramide, nifedipine, pemoline, phencyclidine, reserpine, tricyclics,\n<<<\n\n!!Drug combinations associated with dystonia\n*Bragonier R. Bartle D. ~Langton-Hewer S. Acute dystonia in a 14-yr old following propofol and fentanyl anaesthesia. British Journal of Anaesthesia. 84(6):828-9, 2000 Jun. \n\n*Khan ZH. Dystonic movements following thalamonal and alfentanil induction--a case report. Middle East Journal of Anesthesiology. 14(4):281-6, 1998.\n\n*Dehring DJ. Gupta B. Peruzzi WT. Postoperative opisthotonus and torticollis after fentanyl, enflurane, and nitrous oxide. Canadian Journal of Anaesthesia. 38(7):919-25, 1991.\n\n*Stemp LI. Taswell C. Spastic torticollis during general anesthesia: case report and review of receptor mechanisms. Anesthesiology. 75(2):365-6, 1991.\n \n*Mets B. Acute dystonia after alfentanil in untreated Parkinson's disease. Anesthesia & Analgesia. 72(4):557-8, 1991. \n
\nControversial. Depends on cause of hemorrhage, ongoing risks of hemorrhage and risk of stroke.\n<<<\nWani, M, Nga, E. Should a patient with primary intracerebral haemorrhage receive antiplatelet or anticoagulant therapy? [Clinical review Evidence based case report]. 2005. 33(7514): 439-442. [[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=abstractplus&list_uids=16110073&query_hl=22&itool=pubmed_docsum]]\n<<<\n\n
/***\n|''Name:''|ArchivedTimeline|\n|''Version:''|0.3.1 (Feb 04, 2006)|\n|''Source:''|https://sourceforge.net/projects/ptw/|\n|''Author:''|BramChen|\n|''Type:''|Macro|\n!Description\nTimeline archived monthly.\n!Syntax/Examples\n>{{{<<timeline [modified | created]>>}}}\n\n!Known issues/Todos\n* \n\n!Instructions\n\n!Notes\n* \n\n!Revision history\n* v0.3.1 (04 Feb 2006)\n** JSLint checked\n* v0.3.0 (Feb 04, 2006)\n** Fixed several missing variable declarations\n* v0.2.0 (Dec 26, 2005)\n** changed for the new feature of Macro timeline of TW 2.0.0 beta 6\n* v0.1.0 (Nov 3, 2005)\n** Initial release.\n\n!Code\n***/\n//{{{\nversion.extensions.archivedTimeline = {major: 0, minor: 3, revision: 1,\n date: new Date("Feb 04, 2006"),\n name: "ArchivedTimeline",\n type: "Macro",\n author: "BramChen",\n source: "http://sourceforge.net/project/showfiles.php?group_id=150646"\n};\n\nconfig.macros.archivedTimeline = {\n tooltips: "Archives sorted by ",\n msg : "The param of macro timeline should be 'created' or 'modified'",\n dateFormat: "YYYY0MM0DD"\n};\nconfig.macros.timeline = config.macros.archivedTimeline;\n\nconfig.macros.timeline.handler = function(place,macroName,params) {\n var field = params[0] ? params[0] : "modified";\n if (field != "modified" && field != "created") {\n displayMessage(config.macros.timeline.msg);\n return;\n }\n place.appendChild(document.createTextNode(this.tooltips + field));\n var tiddlers = store.reverseLookup("tags","excludeLists",false,field);\n var lastMonth = ""; var lastDay = ""; var theText = "----\sn"; var i = 0;\n var cookie; var archives;\n for (var t=tiddlers.length-1; t>=0; t--) {\n var tiddler = tiddlers[t];\n var theField = (field == "created") ? tiddler.created : tiddler.modified;\n var theMonth = theField.convertToYYYYMMDDHHMM().substr(0,6);\n var theDay = theField.convertToYYYYMMDDHHMM().substr(0,8); \n if(theMonth != lastMonth) {\n if (lastMonth === "") {\n lastMonth = theMonth;\n }\n else {\n place.appendChild(document.createElement("hr")); \n cookie = 'chktimeline'+(i++);\n archives = this.formatString(this.dateFormat, lastMonth);\n this.slider(place,cookie,theText,archives,this.tooltips + archives); \n lastMonth = theMonth; theText = "----\sn"; \n }\n }\n if(theDay != lastDay){\n theText += theField.formatString(this.dateFormat) + '\sn';\n lastDay = theDay; \n }\n theText += '* [[' + tiddler.title + ']]\sn'; \n }\n place.appendChild(document.createElement("hr"));\n cookie = 'chktimeline'+(i++);\n archives = this.formatString(this.dateFormat, lastMonth);\n this.slider(place,cookie,theText,archives,this.tooltips + archives); \n place.appendChild(document.createElement("hr"));\n};\n\nconfig.macros.timeline.onClickSlider = config.macros.slider.onClickSlider;\n\nconfig.macros.timeline.slider = function(place,cookie,text,id,tooltips)\n{\n var btn = createTiddlyButton(place,id,tooltips,this.onClickSlider); \n var panel = createTiddlyElement(place,"div",null,"timelineSliderPanel",null);\n panel.setAttribute("cookie",cookie);\n panel.style.display = config.options[cookie] ? "block" : "none";\n if(text){\n wikify(text,panel);\n }\n};\n\nconfig.macros.timeline.formatString = function(template, yyyymm)\n{\n var dateString = new Date(yyyymm.substr(0,4)+'/'+yyyymm.substr(4,2)+'/01');\n template = template.replace(/DDD|0DD|DD|hh|mm|ss/g,'');\n return dateString.formatString(template);\n};\n//}}}
Injury can follow a variety of cardiac and non-cardiac surgeries.\n\nhttp://bja.oxfordjournals.org/cgi/content/abstract/79/4/440.\n\nliver transplant\nhttp://neurology.org/cgi/content/abstract/61/9/1174\n\n
Anatomy of the [[brachial plexus|http://depts.washington.edu/anesth/regional/brachialplexusanatomy.html]]\n\n[[Wikipedia|http://en.wikipedia.org]] also has a [[page|http://en.wikipedia.org/wiki/Brachial_plexus]] on the brachial plexus.
\n[[AAN Practice Parameter 2006]]\n\n[[Prognosis in non-traumatic coma: Levy et al. 1981]]\n\n
\nSeizure-like movements can be seen with hypotension and anoxia. There is a large childhood literature on this in relation to breath-holding. It can also be seen in adults with hypotension. Stephenson and colleagues have published numerous articles on this topic.\n\nStephenson J, Breningstall G, Steer C, Kirkpatrick M, Horrocks I, Nechay A, Zuberi S. Anoxic-epileptic seizures: home video recordings of epileptic seizures induced by syncopes. Epileptic Disord. 2004 Mar;6(1):15-9. [[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=abstractplus&list_uids=15075063&query_hl=6&itool=pubmed_docsum]]\n\nSome authors have found a high rate of cardiovascular diagnoses in patients with medication unresponsive epilepsy.\n<<<\nZaidi A, Clough P, Cooper P, Scheepers B, Fitzpatrick AP. Misdiagnosis of epilepsy: many seizure-like attacks have a cardiovascular cause. J Am Coll Card. 36(1)181-184. [[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=abstractplus&list_uids=10898432&query_hl=13&itool=pubmed_docsum]], [[FullText|http://dx.doi.org/10.1016/S0735-1097(00)00700-2]]\n<<<\n\nUse of serum prolactin in the diagnosis of epilepsy. EBM from the AAN.\n<<<\nChen DK, So YT, Fisher RS, Therapeutics and Technology Assessment Subcommittee of the American Academy of Neurology. Use of serum prolactin in diagnosing epileptic seizures: report of the Therapeutics and Technology Assessment Subcommittee of the American Academy of Neurology. Neurology. 2005. 65(5):668-75. [[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=abstractplus&list_uids=16157897&query_hl=15&itool=pubmed_docsum]]\n<<<\n\n
TiddlyBrainzWiki
Onset can be delayed for 5-14 days. Thus only a possibility if continued intake was occurring.\n\nhttp://medind.nic.in/maa/t04/i1/maat04i1p25.pdf\n\nVictor M, Adams RD. The effects of alcohol on the nervous\nsystem. Proc Assoc Res Nerv Ment Dis 1953;32:526-9.\n\nBrown CG. The alcohol withdrawal syndrome. Ann Emerg\nMed 1982;276:20-4.\n
[[Changes in brain volume|http://content.karger.com/ProdukteDB/produkte.asp?Aktion=ShowAbstract&ProduktNr=223854&Ausgabe=227268&ArtikelNr=45903]] with Dialysis Dysequilibrium Syndrome. \n
<div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler deleteTiddler'></div>\n<div class='title' macro='view title'></div>\n<div class='editor' macro='edit title'></div>\n<div class='editor' macro='edit text'></div>\n<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser'></span></div>
Fasciculations occur with lower motor neuron disease. They are seen with disorders of the anterior horn cell or root compression. \n\nAlthough fasciculations are most ominously associated with amyotropohic lateral sclerosis (ALS), they can also be benign. Benign fasciculations are more commonly seen in males and tend to occur in the calves and thighs. If seen in the arms they should occur in the same location or muscle fascicle rather than randomly throughout the muscle as in ALS. Benign fasciculations should also not be associated with weakness or atrophy. Benign fasciculations tend to increase with age and have a familial component.\n\nElectrophysiologic testing shows a normal motor unit pattern in benign fasciculations, but more complex, longer duration and higher amplitude discharges with malignant fasciculations. ^^Hammerstad J. Strength & Reflexes. In: Goetz C. ed. Textbook of Clinical Neurology. 2nd Ed. Elsevier, 2003.^^
To get started with this blank TiddlyWiki, you'll need to modify the following tiddlers:\n* SiteTitle & SiteSubtitle: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)\n* MainMenu: The menu (usually on the left)\n* DefaultTiddlers: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened\nYou'll also need to enter your username for signing your edits: <<option txtUserName>>
\nThis information taken from the [[CDC|http://www.bt.cdc.gov/masstrauma/gscale.asp]], which has a nicely formatted [[pdf|http://www.bt.cdc.gov/masstrauma/pdf/glasgow-coma-scale.pdf]].\n\n!Glasgow Coma Scale\n*Eye Opening Response\n**Spontaneous--open with blinking at baseline 4 points\n**To verbal stimuli, command, speech 3 points\n**To pain only (not applied to face) 2 points\n**No response 1 point \n*Verbal Response\n**Oriented 5 points\n**Confused conversation, but able to answer questions 4 points\n**Inappropriate words 3 points\n**Incomprehensible speech 2 points\n**No response 1 point \n*Motor Response\n**Obeys commands for movement 6 points\n**Purposeful movement to painful stimulus 5 points\n**Withdraws in response to pain 4 points\n**Flexion in response to pain (decorticate posturing) 3 points\n**Extension response in response to pain (decerebrate posturing) 2 points\n**No response 1 point \n\n''Categorization:''\n*Coma: No eye opening, no ability to follow commands, no word verbalizations (3-8)\n*Head Injury Classification:\n**Severe Head Injury: GCS score of 8 or less\n**Moderate Head Injury: GCS score of 9 to 12\n**Mild Head Injury: GCS score of 13 to 15\n ^^(Adapted from: Advanced Trauma Life Support: Course for Physicians, American College of Surgeons, 1993).^^\n\nThe CDC site mentions important limitations in the reproducibility and predictive value of the GCS. Thus one should be careful about making definitive prognostic statements using just this scale alone.\n\n''References''\nTeasdale G, Jennett B. Assessment of coma and impaired consciousness. A practical scale. Lancet. 1974 Jul 13;2(7872):81-4. [[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=Abstract&list_uids=4136544&query_hl=2&itool=pubmed_docsum]]\n\nTeasdale G, Jennett B. Assessment and prognosis of coma after head injury. Acta Neurochir (Wien). 1976;34(1-4):45-55. [[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=Abstract&list_uids=961490&query_hl=1&itool=pubmed_docsum]]\n\nTeasdale G, ~Kril-Jones R, van der Sande J. Observer variability in assessing impaired consciousness and coma. J Neurol Neurosurg Psychiatry 1978; 41(7):603-610. [[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=Abstract&list_uids=690637&query_hl=4&itool=pubmed_DocSum]]\n\nRowley G, Fielding K. Reliability and accuracy of the Glasgow Coma Scale with experienced and inexperienced users. Lancet 1991. 337(8740):535-8.[[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=Abstract&list_uids=1671900&query_hl=6&itool=pubmed_DocSum]]\n\nWaxman K, Sundine MJ, Young RF. Is early prediction of outcome in severe head injury possible? Arch Surg 1991; 126(10):1237-1242. [[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=Abstract&list_uids=1929824&query_hl=7&itool=pubmed_docsum]]\n\nEisenberg HM. Outcome after head injury: Part I: general Considerations, in Becker DP, Povlishock JR (eds): Central Nervous System Trauma Status Report, 1985. Washington, DC: U.S. Government Printing Office, 1988:271-280.\n\n
// Ensure the Plugin is only installed once.\n//\nif (!version.extensions.IntelliTaggerPlugin) {\n\n// Ensure the global abego namespace is set up.\nif (!window.abego) window.abego = {};\nif (!abego.internal) abego.internal = {};\n\n// Opens an alert with the given string and throws an exception \n// with the same string after the alert is closed.\n//\nabego.alertAndThrow = function(s) {\n alert(s);\n throw s;\n};\n\nif (version.major < 2) {\n abego.alertAndThrow("Use TiddlyWiki 2.0.8 or better to run the IntelliTagger Plugin.");\n}\n\nversion.extensions.IntelliTaggerPlugin = {\n major: 1, minor: 0, revision: 0,\n date: new Date(2006, 3, 26),\n type: 'plugin',\n source: "http://tiddlywiki.abego-software.de/#IntelliTaggerPlugin",\n documentation: "[[IntelliTaggerPlugin Documentation]]",\n sourcecode: "[[IntelliTaggerPlugin SourceCode]]",\n author: "Udo Borkowski (ub [at] abego-software [dot] de)",\n licence: "[[BSD open source license (abego Software)]]",\n tiddlywiki: "Version 2.0.8 or better",\n browser: "Firefox 1.5.0.2 or better"\n};\n\n// ========================================================================\n// Utilities ==============================================================\n// ========================================================================\n\n// ========================================================================\n// Popup \n// \n// A Popup is an HTML element floating on top of the main HTML page. \n// \n// The HTML element (typically a "div" element) is added as a direct child \n// of the document.body.\n//\n// A Popup element should respect the following style conventions:\n//\n// position = "absolute"; // required.\n// left = aDimension; // required. E.g. "10px"\n// // When not defined the Popup is not displayed.\n// top = aDimension; // required. E.g. "10px"\n// // When not defined the Popup is not displayed.\n// background = aColor; // optional. E.g. "white"\n// // When not defined the Popup is transparent.\n// border = aBorderSpec; // optional. E.g. "1px solid DarkGray"\n// width = aDimension; // optional. E.g. "200px"\n// // When not defined the width is calculated \n// // automatically.\n// height = aDimension; // optional. E.g. "200px"\n// // When not defined the height is calculated \n// // automatically.\n// ========================================================================\n\n\n\n// Returns true iff the given element is "opened as a popup", \n// i.e. a direct child of the document.body.\n//\n// @param element [may be null/undefined] \n// an HTML element\n//\nabego.isPopupOpen = function(element) {\n return element && element.parentNode == document.body;\n};\n\n// Opens the given element as a popup.\n// \n// @param element \n// an HTML element\n//\nabego.openAsPopup = function(element) {\n if (element.parentNode != document.body)\n document.body.appendChild(element);\n};\n\n\n// Closes the given popup.\n// Does nothing when the element is not a popup or not open.\n//\n// @param element [may be null/undefined] \n// an HTML element\n//\nabego.closePopup = function(element) {\n if (abego.isPopupOpen(element)) \n document.body.removeChild(element);\n};\n\n// Returns the rectangle of the (browser) window\n//\n// @return {left,top,height,width}\n// \nabego.getWindowRect = function() {\n return {\n left: findScrollX(),\n top: findScrollY(),\n height: findWindowHeight(),\n width: findWindowWidth()\n };\n};\n\n// Moves the given element to the given position (in pixel).\n//\nabego.moveElement = function(element, left, top) {\n element.style.left = left + "px";\n element.style.top = top + "px";\n};\n\n// Centers the given element on the window.\n//\n// The element must have absolute position\n// \nabego.centerOnWindow = function(element) {\n if (element.style.position != "absolute") \n throw "abego.centerOnWindow: element must have absolute position"; \n \n var winRect = abego.getWindowRect();\n\n abego.moveElement(\n element,\n winRect.left + (winRect.width - element.offsetWidth) / 2,\n winRect.top + (winRect.height - element.offsetHeight) / 2);\n};\n\n// Returns true if e is either self or a descendant (child, grandchild,...) of self.\n//\n// @param self DOM:Element\n// @param e DOM:Element [may be null]\n//\nabego.isDescendantOrSelf = function(self, e) {\n while (e) {\n if (self == e) return true;\n e = e.parentNode;\n }\n return false;\n};\n\n// Returns a set containing the items of the array. \n// \n// It is an object that has a property for every item of the array.\n// The name of the property is the "toString" representation of \n// the item. The value of the property is "true".\n//\n// Duplicate items are removed.\n//\nabego.toSet = function(array) {\n var result = {};\n for (var i = 0; i < array.length; i++)\n result[array[i]] = true;\n return result;\n};\n\n// Returns an array with all strings from strings that match the filterRE.\n//\n// @param maxCount [optional] if defined at most maxCount strings are returned.\nabego.filterStrings = function(strings, filterRE, maxCount) {\n var result =[];\n for (var i = 0; i < strings.length && (maxCount === undefined || result.length < maxCount); i++) {\n var s = strings[i];\n if (s.match(filterRE)) \n result.push(s);\n }\n return result;\n};\n\nabego.arraysAreEqual = function(a,b) {\n var n = a.length;\n if (n != b.length) \n return false;\n for (var i = 0; i < n; i++) \n if (a[i] != b[i])\n return false;\n return true;\n};\n\n// Adjusts the element's position to appear below the anchorElement, \n// and ensures the element fits into the window.\n//\nabego.moveBelowAndClip = function(element, anchorElement) {\n if (!anchorElement) \n return;\n \n // Position the result below the anchor and resize it if necessary.\n var anchorLeft = findPosX(anchorElement);\n var anchorTop = findPosY(anchorElement);\n var anchorHeight = anchorElement.offsetHeight;\n var elementLeft = anchorLeft;\n var elementTop = anchorTop + anchorHeight;\n\n // Make sure the result is not wider than the window\n var winWidth = findWindowWidth();\n if (winWidth < element.offsetWidth) {\n element.style.width = (winWidth - 100)+"px";\n }\n\n // Ensure that the left and right of the result are not\n // clipped by the window. Move it to the left or right, if necessary. \n var elementWidth = element.offsetWidth;\n if(elementLeft + elementWidth > winWidth)\n elementLeft = winWidth - elementWidth-30;\n if (elementLeft < 0) \n elementLeft = 0;\n \n // Do the actual moving\n element.style.left = elementLeft + "px";\n element.style.top = elementTop + "px";\n element.style.display = "block";\n};\n\nabego.compareStrings = function(a, b) {\n return (a == b) ? 0 : (a < b) ? -1 : 1;\n};\n\n// Sorts the given array alphabetically, ignoring the case.\n//\nabego.sortIgnoreCase = function(arr) {\n var result =[];\n \n // To avoid toLowerCase to be called twice for every comparison\n // we convert the strings once and sort the lowercase.\n // After sorting we replace them with the cased ones.\n //\n // Benchmarks have shown that this is significantly faster \n // than the ad hoc solution, even for small arrays \n // (like 5 Strings (10 chars each))\n \n var n = arr.length;\n for (var i = 0; i < n; i++) {\n var s = arr[i];\n result.push([s.toString().toLowerCase(),s]);\n }\n result.sort(function(a,b) {\n return (a[0] == b[0]) ? 0 : (a[0] < b[0]) ? -1 : 1;\n });\n \n for (i = 0; i < n; i++) \n arr[i] = result[i][1];\n};\n\n// Returns the specified field (input or textarea element), otherwise the first edit field it finds \n// or null if it found no edit field at all\n//\nabego.getTiddlerField = function(story,title,field) {\n var tiddler = document.getElementById(story.idPrefix + title);\n var e = null;\n if (tiddler != null) {\n var children = tiddler.getElementsByTagName("*");\n for (var t=0; t<children.length; t++) {\n var c = children[t];\n if(c.tagName.toLowerCase() == "input" || c.tagName.toLowerCase() == "textarea") {\n if(!e)\n e = c;\n if(c.getAttribute("edit") == field)\n e = c;\n // break; // adding this break would not be 100% compatible to <= TW 2.0.9. when a \n }\n }\n }\n return e;\n};\n\nabego.setRange = function(element, start, end) {\n// adapted from TaskMacroPlugin by LukeBlanshard. \n// http://labwiki.sourceforge.net/#CopyrightAndLicense.\n if (element.setSelectionRange) { // Mozilla\n element.setSelectionRange(start, end);\n // Damn mozilla doesn't scroll to visible. Approximate.\n var max = 0.0 + element.scrollHeight;\n var len = element.textLength;\n var top = max*start/len, bot = max*end/len;\n element.scrollTop = Math.min(top, (bot+top-element.clientHeight)/2);\n } else if (element.createTextRange != undefined) { // IE\n var range = element.createTextRange();\n range.collapse();\n range.moveEnd("character", end);\n range.moveStart("character", start);\n range.select();\n } else // Other? Too bad, just select the whole thing.\n element.select();\n};\n \n \n// TiddlerSet: an object with one property per tiddler in the set. \n// The name of the property corresponds to the tiddler name, \n// the value is "not false" (e.g. true or a non-zero number).\n//\n// TagMap<X>: an object that maps a tag to an object of type X (access through properties)\n//\nabego.internal.TagManager = function() {\n var tagReferences = null; // TagMap<{count: natural, tiddlers: TiddlerSet}>\n\n var ensureTagsAreLoaded = function() {\n if (tagReferences)\n return;\n \n tagReferences = {};\n store.forEachTiddler(function(title,tiddler) {\n for(var i=0; i<tiddler.tags.length; i++) {\n var tag = tiddler.tags[i];\n var refedBy = tagReferences[tag];\n if (!refedBy) {\n refedBy = tagReferences[tag] = {count:0, tiddlers: {}};\n }\n refedBy.tiddlers[tiddler.title] = true;\n refedBy.count += 1;\n }\n });\n };\n \n // When any tags are changed reset the TagManager.\n // \n var oldTiddlyWikiSaveTiddler = TiddlyWiki.prototype.saveTiddler;\n TiddlyWiki.prototype.saveTiddler = function(title,newTitle,newBody,modifier,modified,tags) {\n var tiddler = this.fetchTiddler(title);\n var oldTags = tiddler ? tiddler.tags : [];\n var newTags = (typeof tags == "string") ? tags.readBracketedList() : tags;\n\n oldTiddlyWikiSaveTiddler.apply(this, arguments);\n \n if (!abego.arraysAreEqual(oldTags, newTags))\n abego.internal.getTagManager().reset();\n };\n\n // When a tiddler is removed that had tags reset the TagManager.\n //\n var oldTiddlyWikiRemoveTiddler = TiddlyWiki.prototype.removeTiddler;\n TiddlyWiki.prototype.removeTiddler = function(title) {\n var tiddler = this.fetchTiddler(title);\n var resetTagManager = tiddler && tiddler.tags.length > 0;\n \n oldTiddlyWikiRemoveTiddler.apply(this, arguments);\n \n if (resetTagManager) \n abego.internal.getTagManager().reset();\n };\n\n // Resets the TagManager, thus ensures that cached tagging \n // information is discarded and the most recent tag state is used.\n // \n this.reset = function () {\n tagReferences = null;\n };\n \n \n // Returns a TiddlerSet with all tiddlers that have the given tag, \n // or null when the tag is not used in any tiddler.\n //\n // @return [may be null]\n //\n this.getTiddlersWithTag = function(tag) {\n ensureTagsAreLoaded();\n\n var tagInfo = tagReferences[tag];\n return tagInfo ? tagInfo.tiddlers : null;\n };\n \n // Returns an array with the names of all tags defined \n // plus the (optional) extraTags. \n //\n // The tags are sorted alphabetically (caseinsensitive).\n //\n // @params [optional] an array of tags to be added to the list\n //\n //\n this.getAllTags = function(extraTags) {\n ensureTagsAreLoaded();\n \n var result =[];\n for (var i in tagReferences) \n result.push(i);\n \n for (i = 0; extraTags && i < extraTags.length; i++) \n result.pushUnique(extraTags[i], true);\n \n abego.sortIgnoreCase(result);\n \n return result;\n };\n \n // An array with two items per tag\n // result[i][0] : the tag name\n // result[i][1] : TiddlerSet, with tiddlers that are tagged with that tag\n // \n this.getTagInfos = function() {\n ensureTagsAreLoaded();\n \n var result = [];\n for (var tiddler in tagReferences) {\n result.push([tiddler, tagReferences[tiddler]]);\n }\n return result;\n };\n \n var compareTiddlerCountAndTagName = function(a,b) {\n var a1 = a[1];\n var b1 = b[1];\n var d = b[1].count - a[1].count;\n return d != 0 ? d : abego.compareStrings(a[0].toLowerCase(), b[0].toLowerCase());\n };\n \n this.getSortedTagInfos = function() {\n ensureTagsAreLoaded();\n\n var result = this.getTagInfos();\n \n result.sort(compareTiddlerCountAndTagName);\n \n return result;\n };\n \n // @return an array of the tags that "partner" the activeTags,\n // sorted by the number of conjoint occurances.\n //\n this.getPartnerRankedTags = function(activeTags) {\n var partnerTagCounts = {};\n for (var i = 0; i < activeTags.length; i++) {\n var tiddlersWithTag = this.getTiddlersWithTag(activeTags[i]);\n for (var name in tiddlersWithTag) {\n var tiddler = store.getTiddler(name);\n // It may happen that a tiddler is "gone" in the meantime\n if (!(tiddler instanceof Tiddler)) \n continue;\n \n for(var j=0; j<tiddler.tags.length; j++) {\n var tag = tiddler.tags[j];\n var c = partnerTagCounts[tag];\n partnerTagCounts[tag] = c ? c+1 : 1;\n }\n }\n }\n var currentTagSet = abego.toSet(activeTags);\n var result = [];\n for (var n in partnerTagCounts) {\n if (!currentTagSet[n])\n result.push(n);\n }\n // Sort the tags by their partner tag count, then alphabetically\n result.sort(function (a,b) {\n var d = partnerTagCounts[b] - partnerTagCounts[a];\n return d != 0 ? d : abego.compareStrings(a.toLowerCase(), b.toLowerCase());\n });\n\n return result;\n };\n}; // of abego.internal.TagManager\n\nabego.internal.getTagManager = function() {\n if (!abego.internal.gTagManager) abego.internal.gTagManager = new abego.internal.TagManager();\n return abego.internal.gTagManager;\n};\n\n// ========================================================================\n// IntelliTagger ==========================================================\n// ========================================================================\n\n\n(function(){\n var PADDING = 2;\n var BORDERWIDTH = 1;\n var MAX_FAVORITE_TAGS = 30;\n\n var fSuggestionPopup; // DOM:Element\n var fAnchorElement; // DOM:Element\n var fOnTagSelected; // function(e) {...}\n var fSuggestedTags; // [Tag]\n var fActiveTagSet; // TagSet\n var fFavoriteTags; // array of Tags, [optional]\n \n if (!abego.IntelliTagger) abego.IntelliTagger = {};\n\n var getAnchorElement = function() {\n return fAnchorElement;\n };\n \n var isCurrentTag = function(tag) {\n return fActiveTagSet[tag];\n };\n \n var removeLastWord = function(s) {\n var i = s.lastIndexOf(" ");\n return (i >= 0) ? s.substr(0,i) : "";\n };\n \n var lastWordIsFilter = function(inputField) {\n var s = inputField.value;\n var len = s.length; \n return (len > 0 && s[len-1] != ' ');\n };\n\n var ensureFieldEndsWithSpace = function(field) {\n var s = field.value;\n var len = s.length;\n if (len > 0 && s[len-1] != ' ') {\n field.value += ' ';\n }\n };\n \n var updateTag = function(tag, inputField, tiddler) {\n if (lastWordIsFilter(inputField)) \n inputField.value = removeLastWord(inputField.value);\n \n story.setTiddlerTag (tiddler.title,tag,0);\n ensureFieldEndsWithSpace(inputField);\n \n abego.IntelliTagger.assistTagging(inputField, tiddler);\n };\n \n // returns the n-th suggestion, first counting the favorites, then the normal suggestions\n //\n // @param n zero-based.\n // @return [may be null]\n var getNthSuggestion = function(n) {\n if (fFavoriteTags) {\n if (fFavoriteTags.length > n)\n return fFavoriteTags[n];\n \n n -= fFavoriteTags.length;\n }\n \n return (fSuggestedTags && fSuggestedTags.length > n)\n ? fSuggestedTags[n] \n : null;\n };\n\n var useNthSuggestion = function(n, inputField, tiddler) {\n var suggestion = getNthSuggestion(n);\n if (suggestion)\n updateTag(suggestion, inputField, tiddler);\n };\n\n\n var getFilter = function(inputField) {\n var pos = inputField.value.lastIndexOf(" ");\n var filter = (pos >= 0) ? inputField.value.substr(++pos,inputField.value.length) : inputField.value;\n return new RegExp(filter.escapeRegExp(),"i");\n };\n\n\n var countExpectedTags = function(tags, expectedTagsAsProperties) {\n var result = 0;\n for (var i = 0; i<tags.length;i++) \n if (expectedTagsAsProperties[tags[i]])\n result++;\n return result;\n };\n \n // Returns the number tags that have the same count of tiddlers\n // as the index-th tagInfo. \n // \n // The index-th tag is included in the returned number.\n // \n // @param sortedTagInfo Array of TagInfos, sorted by count of tiddlers.\n //\n var getNumberOfTagsWithSameCount = function(sortedTagInfos, index, filterRE) {\n var result = 1;\n var c = sortedTagInfos[index];\n for (var i = index+1; i < sortedTagInfos.length; i++) \n if (sortedTagInfos[i][1].count == c) {\n if (sortedTagInfos[i][0].match(filterRE))\n result++;\n } else\n break;\n return result;\n };\n \n var getInitialTagSuggestions = function(filterRE, maxCount) {\n var tagInfos = abego.internal.getTagManager().getSortedTagInfos();\n var result =[];\n var lastCount = 0;\n for (var i = 0; i < tagInfos.length; i++) {\n var c = tagInfos[i][1].count;\n \n // Stop adding tags to the result if not all tags with that count of tiddlers would fit into the result.\n if (c != lastCount) {\n if (maxCount && (result.length + getNumberOfTagsWithSameCount(tagInfos, i, filterRE) > maxCount)) \n break;\n lastCount = c;\n }\n // Don't add tags that are only used in one tiddler.\n if (c == 1) \n break;\n var s = tagInfos[i][0];\n if (s.match(filterRE))\n result.push(s);\n }\n return result;\n };\n \n var getAllFilteredTags = function(filterRE, extraTags) {\n return abego.filterStrings(\n abego.internal.getTagManager().getAllTags(extraTags),\n filterRE);\n };\n\n // Refreshes the tagSuggestions window\n //\n var refreshPopup = function() {\n if (!fSuggestionPopup) \n return;\n \n // Load the template for the YourSearchResult\n var html = store.getTiddlerText("IntelliTaggerMainTemplate");\n if (!html) \n html = "<b>Tiddler IntelliTaggerMainTemplate not found</b>";\n fSuggestionPopup.innerHTML = html;\n \n // Expand the template macros etc.\n applyHtmlMacros(fSuggestionPopup,null);\n refreshElements(fSuggestionPopup,null);\n };\n \n var onTagClicked = function(e) { \n if (!e) var e = window.event;\n var tag = this.getAttribute("tag");\n if (fOnTagSelected)\n fOnTagSelected.call(this,tag, e);\n \n return false;\n };\n \n var appendTags = function(place, tags, suggestionIndex, excludeTags) {\n if (!tags)\n return;\n \n var excludeTagSet = excludeTags ? abego.toSet(excludeTags) : {};\n var n = tags.length;\n for (var i = 0; i < n; i++) {\n var tag = tags[i];\n if (excludeTagSet[tag])\n continue;\n \n if (i > 0) \n createTiddlyElement(place,"span",null,"tagSeparator", " | ");\n \n var shortcutText = "";\n var placeForButton = place;\n if (suggestionIndex < 10) {\n // create a wrapping span that ensures the number and the text are not linebreaked.\n placeForButton = createTiddlyElement(place,"span",null,"numberedSuggestion");\n \n suggestionIndex++;\n var key = suggestionIndex < 10 ? ""+(suggestionIndex) : "0";\n createTiddlyElement(placeForButton,"span",null,"suggestionNumber", key+") ");\n var fastKeyText = suggestionIndex == 1 ? "Ctrl-Space or " : "";\n shortcutText = " (Shortcut: %1Alt-%0)".format([key, fastKeyText]);\n }\n\n var shiftClickToolTip = config.views.wikified.tag.tooltip.format([tag]);\n var normalClickToolTip = (isCurrentTag(tag) ? "Remove tag '%0'%1" : "Add tag '%0'%1").format([tag,shortcutText]);\n var tooltip = "%0; Shift-Click: %1".format([normalClickToolTip, shiftClickToolTip]);\n var btn = createTiddlyButton(\n placeForButton,\n tag,\n tooltip, \n onTagClicked, \n isCurrentTag(tag) ? "currentTag" : null);\n btn.setAttribute("tag",tag);\n }\n };\n \n var scrollVisible = function() {\n // Scroll the window to make the fSuggestionPopup page (and the anchorElement) visible.\n if (fSuggestionPopup) window.scrollTo(0,ensureVisible(fSuggestionPopup));\n if (getAnchorElement()) window.scrollTo(0,ensureVisible(getAnchorElement()));\n };\n\n // Close the suggestions window when the user clicks on the document\n // (and not into the getAnchorElement or in the suggestions window)\n //\n var onDocumentClick = function(e) {\n if (!e) var e = window.event;\n if (!fSuggestionPopup) \n return;\n \n var target = resolveTarget(e);\n if (target == getAnchorElement()) return; \n if (abego.isDescendantOrSelf(fSuggestionPopup, target)) return; \n \n abego.IntelliTagger.close();\n };\n addEvent(document,"click",onDocumentClick);\n \n // We added a space to the tags edit field. To avoid that the \n // tiddler is marked as "changed" just because of that we trim\n // the field value\n //\n var oldGatherSaveFields = Story.prototype.gatherSaveFields;\n Story.prototype.gatherSaveFields = function(e,fields) {\n oldGatherSaveFields.apply(this, arguments);\n var tags = fields.tags;\n if (tags) \n fields.tags = tags.trim();\n };\n \n\n var focusTagsField = function(title) {\n story.focusTiddler(title,"tags");\n var tags = abego.getTiddlerField(story, title, "tags");\n if (tags) {\n var len = tags.value.length;\n abego.setRange(tags, len, len);\n window.scrollTo(0,ensureVisible(tags));\n }\n };\n \n\n // Attach the assistTagging to the "tags" edit field.\n //\n var oldEditHandler = config.macros.edit.handler;\n config.macros.edit.handler = function(place,macroName,params,wikifier,paramString,tiddler) {\n oldEditHandler.apply(this, arguments);\n var field = params[0];\n if((tiddler instanceof Tiddler) && field == "tags") {\n // Just added the "edit tags" field. \n // Attach it to the "Tag Suggestions" feature.\n var inputField = place.lastChild;\n inputField.onfocus = function(e) {\n abego.IntelliTagger.assistTagging(inputField, tiddler);\n setTimeout(\n function() {\n focusTagsField(tiddler.title);\n }, 100);\n\n };\n inputField.onkeyup = function(e) {\n if (!e) var e = window.event;\n if (e.altKey && !e.ctrlKey && !e.metaKey && (e.keyCode >= 48 && e.keyCode <= 57)) {\n useNthSuggestion(e.keyCode == 48 ? 9 : e.keyCode-49, inputField, tiddler);\n } else if (e.ctrlKey && e.keyCode == 32) {\n useNthSuggestion(0, inputField, tiddler);\n }\n \n setTimeout(\n function() {\n abego.IntelliTagger.assistTagging(inputField, tiddler);\n }, 100);\n return false;\n };\n \n // ensure that the tags text ends with a space \n // (otherwise the last word is used as a filter when the field gets the focus)\n ensureFieldEndsWithSpace(inputField);\n }\n };\n \n var onEditTags = function(e) {\n if (!e) var e = window.event;\n var target = resolveTarget(e);\n \n var title = target.getAttribute("tiddler");\n if (title) {\n story.displayTiddler(target,title,"IntelliTaggerEditTagsTemplate", false);\n focusTagsField(title);\n }\n return false;\n };\n \n // Add an "[edit]" button to the "tags" field that is displayed with the tiddler in the ViewTemplate.\n // Pressing the button allows editing the tags only, with the text still being displayed in wikified form.\n //\n var oldTagsHandler = config.macros.tags.handler;\n config.macros.tags.handler = function(place,macroName,params,wikifier,paramString,tiddler) {\n oldTagsHandler.apply(this, arguments);\n\n abego.IntelliTagger.createEditTagsButton(tiddler, createTiddlyElement(place.lastChild,"li"));\n };\n \n // close the Suggestion Window when the tiddler is no longer edited\n // (i.e. the tag edit inputfield is gone.)\n // \n // (Note: we must poll this condition since onblur on the input field \n // cannot be used since every click into the suggestion window results\n // in a lost focus/blur)\n //\n var closeIfAnchorElementIsHidden = function() {\n if (fSuggestionPopup && fAnchorElement && !abego.isDescendantOrSelf(document, fAnchorElement)) \n abego.IntelliTagger.close();\n };\n setInterval(closeIfAnchorElementIsHidden, 100);\n \n//----------------------------------------------------------------------------\n// The public API\n//----------------------------------------------------------------------------\n \n // @param suggestedTags \n // array of strings representing the tags to be suggested.\n //\n // @param activeTags \n // array of strings representing the tags currently "active".\n //\n // @param favoriteTags [optional] \n // a subset of the suggested tags that are "favorites". \n // I.e. They should be presented first etc.\n //\n // @param anchorElement [optional]\n // when defined the suggestions are displayed "close" to the anchorElement. \n // The page is scrolled to make the anchorElement visible.\n // When the anchorElement is not defined the suggestions are displayed in the\n // center of the window.\n //\n // @param onTagSelected [optional]\n // function(tag, e) to be called when a tag is selected.\n //\n abego.IntelliTagger.displayTagSuggestions = function(suggestedTags, activeTags, favoriteTags, anchorElement, onTagSelected) {\n fSuggestedTags = suggestedTags;\n fActiveTagSet = abego.toSet(activeTags);\n fFavoriteTags = favoriteTags;\n fAnchorElement = anchorElement;\n fOnTagSelected = onTagSelected;\n \n if (!fSuggestionPopup) {\n fSuggestionPopup = createTiddlyElement(document.body,"div",null,"intelliTaggerSuggestions");\n fSuggestionPopup.style.position = "absolute";\n }\n \n refreshPopup();\n abego.openAsPopup(fSuggestionPopup);\n \n if (getAnchorElement()) {\n var w = getAnchorElement().offsetWidth;\n if (fSuggestionPopup.offsetWidth < w) {\n fSuggestionPopup.style.width = (w-2*(PADDING+BORDERWIDTH)) + "px";\n }\n abego.moveBelowAndClip(fSuggestionPopup, getAnchorElement());\n } else {\n abego.centerOnWindow(fSuggestionPopup);\n }\n\n scrollVisible();\n };\n \n // Shows the Tag Suggestion Popup for the given tiddler, below the specified inputField.\n //\n abego.IntelliTagger.assistTagging = function(inputField, tiddler) {\n var filterRE = getFilter(inputField);\n var s = inputField.value;\n if (lastWordIsFilter(inputField)) \n s = removeLastWord(s);\n var activeTags = s.readBracketedList();\n var favoriteTags = activeTags.length > 0 \n ? abego.filterStrings(abego.internal.getTagManager().getPartnerRankedTags(activeTags), filterRE, MAX_FAVORITE_TAGS)\n : getInitialTagSuggestions(filterRE, MAX_FAVORITE_TAGS);\n abego.IntelliTagger.displayTagSuggestions(\n getAllFilteredTags(filterRE,activeTags), \n activeTags,\n favoriteTags, \n inputField,\n function(tag, e) {\n if (e.shiftKey) {\n onClickTag.call(this,e);\n } else\n updateTag(tag, inputField, tiddler);\n });\n };\n \n // Closes the Tag Suggestions Popup\n //\n abego.IntelliTagger.close = function() {\n abego.closePopup(fSuggestionPopup);\n fSuggestionPopup = null;\n return false;\n };\n\n // Creates an TiddlyButton at the given place to edit the tags of the given tiddler.\n //\n abego.IntelliTagger.createEditTagsButton = function(tiddler, place, text, tooltip, className, id, accessKey) {\n if (!text) text = "[edit]";\n if (!tooltip) tooltip = "Edit the tags";\n if (!className) className = "editTags";\n \n var editButton = createTiddlyButton(place,text,tooltip, onEditTags, className, id, accessKey);\n editButton.setAttribute("tiddler", (tiddler instanceof Tiddler) ? tiddler.title : String(tiddler));\n \n return editButton;\n };\n\n \n//----------------------------------------------------------------------------\n// Macros\n//----------------------------------------------------------------------------\n\n// ====Macro intelliTagger ================================================\n\n config.macros.intelliTagger = {\n // Standard Properties\n label: "intelliTagger",\n\n handler : function(place,macroName,params,wikifier,paramString,tiddler) {\n var namesAndValues = paramString.parseParams("list",null, true);\n var actions = namesAndValues[0]["action"];\n for (var i = 0; actions && i < actions.length; i++) {\n var actionName = actions[i];\n var action = config.macros.intelliTagger.subhandlers[actionName];\n \n if (!action) \n abego.alertAndThrow("Unsupported action '%0'".format([actionName]));\n \n action(place,macroName,params,wikifier,paramString,tiddler);\n }\n },\n \n subhandlers: {\n \n showTags : function(place,macroName,params,wikifier,paramString,tiddler) {\n appendTags(place, fSuggestedTags, fFavoriteTags ? fFavoriteTags.length : 0, fFavoriteTags);\n },\n \n showFavorites : function(place,macroName,params,wikifier,paramString,tiddler) {\n appendTags(place, fFavoriteTags, 0);\n },\n \n closeButton : function(place,macroName,params,wikifier,paramString,tiddler) {\n var button = createTiddlyButton(place, "close", "Close the suggestions", abego.IntelliTagger.close);\n },\n\n version : function(place) {\n var t = "IntelliTagger %0.%1.%2".format(\n [version.extensions.IntelliTaggerPlugin.major, \n version.extensions.IntelliTaggerPlugin.minor, \n version.extensions.IntelliTaggerPlugin.revision]);\n var e = createTiddlyElement(place, "a");\n e.setAttribute("href", "http://tiddlywiki.abego-software.de/#IntelliTaggerPlugin");\n e.innerHTML = '<font color="black" face="Arial, Helvetica, sans-serif">'+t+'<font>';\n },\n\n copyright : function(place) {\n var e = createTiddlyElement(place, "a");\n e.setAttribute("href", "http://tiddlywiki.abego-software.de");\n e.innerHTML = '<font color="black" face="Arial, Helvetica, sans-serif">&copy; 2006 <b><font color="red">abego</font></b> Software<font>';\n }\n }\n };\n \n})();\n\n\nconfig.shadowTiddlers["IntelliTaggerStyleSheet"] = \n "/***\sn"+\n "!~IntelliTagger Stylesheet\sn"+\n "***/\sn"+\n "/*{{{*/\sn"+\n ".intelliTaggerSuggestions {\sn"+\n "\stposition: absolute;\sn"+\n "\stwidth: 600px;\sn"+\n "\sn"+\n "\stpadding: 2px;\sn"+\n "\stlist-style: none;\sn"+\n "\stmargin: 0;\sn"+\n "\sn"+\n "\stbackground: #eeeeee;\sn"+\n "\stborder: 1px solid DarkGray;\sn"+\n "}\sn"+\n "\sn"+\n ".intelliTaggerSuggestions .currentTag {\sn"+\n "\stfont-weight: bold;\sn"+\n "}\sn"+\n "\sn"+\n ".intelliTaggerSuggestions .suggestionNumber {\sn"+\n "\stcolor: #808080;\sn"+\n "}\sn"+\n "\sn"+\n ".intelliTaggerSuggestions .numberedSuggestion{\sn"+\n "\stwhite-space: nowrap;\sn"+\n "}\sn"+\n "\sn"+\n ".intelliTaggerSuggestions .intelliTaggerFooter {\sn"+\n "\stmargin-top: 4px;\sn"+\n "\stborder-top-width: thin;\sn"+\n "\stborder-top-style: solid;\sn"+\n "\stborder-top-color: #999999;\sn"+\n "}\sn"+\n ".intelliTaggerSuggestions .favorites {\sn"+\n "\stborder-bottom-width: thin;\sn"+\n "\stborder-bottom-style: solid;\sn"+\n "\stborder-bottom-color: #999999;\sn"+\n "\stpadding-bottom: 2px;\sn"+\n "}\sn"+\n "\sn"+\n ".intelliTaggerSuggestions .normalTags {\sn"+\n "\stpadding-top: 2px;\sn"+\n "}\sn"+\n "\sn"+\n ".intelliTaggerSuggestions .intelliTaggerFooter .button {\sn"+\n "\stfont-size: 10px;\sn"+\n "\sn"+\n "\stpadding-left: 0.3em;\sn"+\n "\stpadding-right: 0.3em;\sn"+\n "}\sn"+\n "\sn"+\n "/*}}}*/\sn";\n \nconfig.shadowTiddlers["IntelliTaggerMainTemplate"] = \n "<!--\sn"+\n "{{{\sn"+\n "-->\sn"+\n "<div class=\s"favorites\s" macro=\s"intelliTagger action: showFavorites\s"></div>\sn"+\n "<div class=\s"normalTags\s" macro=\s"intelliTagger action: showTags\s"></div>\sn"+\n "<!-- The Footer (with the Navigation) ============================================ -->\sn"+\n "<table class=\s"intelliTaggerFooter\s" border=\s"0\s" width=\s"100%\s" cellspacing=\s"0\s" cellpadding=\s"0\s"><tbody>\sn"+\n " <tr>\sn"+\n "\st<td align=\s"left\s">\sn"+\n "\st\st<span macro=\s"intelliTagger action: closeButton\s"></span>\sn"+\n "\st</td>\sn"+\n "\st<td align=\s"right\s">\sn"+\n "\st\st<span macro=\s"intelliTagger action: version\s"></span>, <span macro=\s"intelliTagger action: copyright \s"></span>\sn"+\n "\st</td>\sn"+\n " </tr>\sn"+\n "</tbody></table>\sn"+\n "<!--\sn"+\n "}}}\sn"+\n "-->\sn";\n \nconfig.shadowTiddlers["IntelliTaggerEditTagsTemplate"] = \n "<!--\sn"+\n "{{{\sn"+\n "-->\sn"+\n "<div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler'></div>\sn"+\n "<div class='title' macro='view title'></div>\sn"+\n "<div class='tagged' macro='tags'></div>\sn"+\n "<div class='viewer' macro='view text wikified'></div>\sn"+\n "<div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler'></div>\sn"+\n "<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser'></span></div>\sn"+\n "<!--\sn"+\n "}}}\sn"+\n "-->\sn"; \n \nconfig.shadowTiddlers["BSD open source license (abego Software)"] = "See [[Licence|http://tiddlywiki.abego-software.de/#%5B%5BBSD%20open%20source%20license%5D%5D]].";\nconfig.shadowTiddlers["IntelliTaggerPlugin Documentation"] = "[[Documentation on abego Software website|http://tiddlywiki.abego-software.de/doc/IntelliTagger.pdf]].";\nconfig.shadowTiddlers["IntelliTaggerPlugin SourceCode"] = "[[Plugin source code on abego Software website|http://tiddlywiki.abego-software.de/src/Plugin-IntelliTagger-src.js]]";\n \nsetStylesheet(store.getTiddlerText("IntelliTaggerStyleSheet"),"intelliTagger");\n\n} // of single install\n\n// Used Globals (for JSLint) ==============\n// ... JavaScript Core\n/*global alert, document, setTimeout, setInterval */\n// ... TiddlyWiki Core\n/*global Story, Tiddler, TiddlyWiki, addEvent, applyHtmlMacros, createTiddlyButton, createTiddlyElement, ensureVisible, findPosX, findPosY, findScrollX, findScrollY, findWindowHeight, findWindowWidth, onClickTag, refreshElements, resolveTarget, story */\n
// General Options for all Brainz TiddlyWiki\nconfig.options.chkHttpReadOnly = false;\nconfig.numRssItems = 5; // Number of items in the RSS feed\nconfig.options.txtMaxEditRows = 44;\nconfig.macros.newJournal.label = "today";\nconfig.macros.archivedTimeline.dateFormat = "DD MMM YYYY";\n
Image of the lumbar plexus\n<html>\n<img src="http://l.yimg.com/us.yimg.com/i/edu/ref/ga/l/822.gif" width=500 height=400>\n</html>\n\n...and [[text|http://yahooligans.yahoo.com/reference/gray/subjects/subject?id=212]] from Gray's anatomy on Yahooligans.\n\n
<html>\n<img src="http://d.gitelman.googlepages.com/langpicturemark.jpg" alt="Pretty colored brain picture. ©2006 D. Gitelman" width=90>\n</html>\n\nTiddlyBrainzWiki\n^^[[Download TiddlyBrainzWiki|http://brainz.tiddlyspot.com]]^^\n----\n\n#[[Adverse Drug Reactions]]\n#[[Anticoagulation after Hemorrhage]]\n#[[Brachial Plexus]]\n#[[Brachial Plexopathy]]\n#[[Coma Prognosis]]\n#[[Convulsive Syncope]]\n#[[Dialysis Dysequilibrium]]\n#[[Delirium Tremens]]\n#[[Fasciculations]]\n#[[Glasgow Coma Scale]]\n#[[Lumbar Plexus]]\n#[[NIH Stroke Scale]]\n#[[Ophthalmoplegia]]\n#[[Paraneoplastic Disease]]\n#[[Post Traumatic Seizure Prophylaxis]]\n#[[Progressive Multifocal Leukoencephalopathy]]\n#[[Substance Abuse]]\n#[[Toxic Ophthalmoplegia]]\n#[[Wernicke's Encephalopathy]]\n----\n[[Google Scholar|http://scholar.google.com]]\n[[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?DB=pubmed]]\n\n----\n[[TiddlyWiki|http://www.tiddlywiki.com/]]\n[[TiddlyTagWiki|http://www.digitaldimsum.co.uk/]]\n[[TiddlyTools|http://www.tiddlytools.com/]]\n[[TiddlyWikiTips|http://tiddlywikitips.com/]]\n[[TiddlyWikiTutorial|http://www.blogjones.com/TiddlyWikiTutorial.html]]\n[[zRenard-TiddlyWiki|http://www.zrenard.com/tiddlywiki/tiddlywiki.html#HelloTips%20ListTips]]\n[[ZenGardenCSS|http://www.csszengarden.com/]]\n\n\n[[TiddlySpot Home|http://www.tiddlyspot.com]]\n\nGettingStarted\nAboutTiddlySpot\n\n----\n^^[[edit MainMenu|MainMenu]]^^\n^^[[Control Panel|http://brainz.tiddlyspot.com/controlpanel.cgi]]^^
\n''[[PDF|http://www.ninds.nih.gov/doctors/NIH_Stroke_Scale.pdf]] from the NIH Stroke Center Trials registry.''\n\n
\n*Internuclear ophthalmoplegia (INO): Lesion of Medial Longitudinal Fasiculus\n**Ipsilateral eye: incomplete adduction. Can also see slowing of adduction saccades.\n**Contralateral eye: abduction nystagmus.\n**Example of a left INO.\n***A) Normal mid-position gaze.\n***B) Normal eye movements to the left.\n***C) With right gaze there is contralateal abduction nystagmus, and ipsilateral adduction failure.\n***D) Convergence is normal.\n^^Image from Dr. Randall Light at Texas A&M University^^\n<html>\n<img src="http://medicine.tamu.edu/neuro/16.gif" alt"Figure illustrating left INO from Dr. Randall Light at Texas A&M University" width=30% height=30%>\n</html>\n\n**[[Videos|http://library.med.utah.edu/NOVEL/tmp/full_view.php?content_id=8453&title=Internuclear%20Ophthalmoplegia%20(2%20examples)&css=Moran]] demonstrating patients with INO, from Dr. Kathleen Digre, University of Utah School of Medicine & Dr. Daniel Jacobson. [[WMV format|http://ecclesvideo.med.utah.edu/NOVEL/Digre/1-8_CD.wmv]] Other formats at the site.\n\n\n*Causes of Ophthalmoplegias: (Partial list)\nDegenerative disease: Progressive Supranuclear Palsy.\nNutirtional: Thiamine (B1), Vitamin E\nBotulinum toxin\nDiabetes Mellitus\nlow magnesium\nParaneoplastic\nCarcinomatosis\nMultiple sclerosis\nMyasthenia gravis (should spare pupil)\n Lambert Eaton (should not involve III, IV, VI)\nSLE\nVasculitis\nPAN\n\nDrug: anticholinergics, narcotic, benzodiazepine, dilantin, carbampazepine, cyclosporin, FK506\nCPOE / KSS
Some references regarding paraneoplastic cerebellar degeneration and treatment\n\nKeime-Guibert F; Graus F; Fleury A; Rene R; Honnorat J; Broet P; Delattre JY. Treatment of paraneoplastic neurological syndromes with antineuronal antibodies (Anti-Hu, anti-Yo) with a combination of immunoglobulins, cyclophosphamide, and methylprednisolone. J Neurol Neurosurg Psychiatry.;68(4):479-82.\n\nJ. W. de Beukelaar and P. A. S. Smitt. Managing Paraneoplastic Neurological Disorders. Oncologist, March 1, 2006; 11(3): 292 - 305.\n\nS. Vernino, B. P. O'Neill, R. S. Marks, J. R. O'Fallon, and D. W. Kimmel. Immunomodulatory treatment trial for paraneoplastic neurological disorders. Neuro-oncol, 2004; 6(1): 55 - 62.\n\nR. B. Darnell and J. B. Posner. Paraneoplastic Syndromes Involving the Nervous System. N. Engl. J. Med., 349(16): 1543 - 1554.\n\nS. Shams'ili, J. Grefkens, B. de Leeuw, M. van den Bent, H. Hooijkaas, B. van der Holt, C. Vecht, and P. Sillevis Smitt. Paraneoplastic cerebellar degeneration associated with antineuronal antibodies: analysis of 50 patients. Brain,2003; 126(6): 1409 - 1418. \n\n
This is a controversial issue but current approach is not to give AED prophylaxis beyond 1 week.\n\nAs noted by Vincent and Berre, Crit Care Med, 2005, prophylaxis beyond the first week after trauma does not prevent the long-term occurrence of seizures. [[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=Abstract&list_uids=15942361&query_hl=17&itool=pubmed_docsum]]\n\nThe Cochrane Database of Systematic Reviews gives the following stats in the [[article|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=Abstract&list_uids=11687070&query_hl=21&itool=pubmed_docsum]] "Anti-epileptic drugs for preventing seizures following acute traumatic brain injury" Schierhout & Roberts, 2001.\n\nMain results: We identified 10 eligible randomised controlled trials, including 2036 participants, but data was unavailable for four unpublished trials, representing 631 participants and they were excluded. For the remaining six trials, the pooled relative risk (RR) for early seizure prevention was 0.34 (95%CI 0.21, 0.54); based on this estimate, for every 100 patients treated, 10 would be kept seizure free in the first week. Seizure control in the acute phase was not accompanied by a reduction in mortality (RR = 1.15; 95%CI 0.89, 1.51), a reduction in death and neurological disability (RR = 1.49; 95%CI 1.06, 2.08 for carbamazepine and RR = 0.96; 95%CI 0.72, 1.26 for phenytoin) or a reduction in late seizures (pooled RR = 1.28; 95%CI 0.90, 1.81). The pooled relative risk for skin rashes was 1.57 (95%CI 0.57, 39.88).\n\nSome other references:\n<<<\nTemkin NR, Dikmen SS, Wilensky AJ, et al: A randomized, double-blind study of phenytoin for the prevention of post-traumatic seizures. N Engl J Med 1990; 323:497–502 [[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=Abstract&list_uids=2115976&query_hl=8&itool=pubmed_docsum]]\n<<<\n<<<\nThe Brain Trauma Foundation. The American Association of Neurological Surgeons. The Joint Section on Neurotrauma and Critical Care. Role of antiseizure prophylaxis following head injury. J Neurotrauma 2000; 17:549–553 [[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=Abstract&list_uids=10937902&query_hl=6&itool=pubmed_DocSum]]\n<<<\n<<<\nChang BS, Lowenstein DH: Practice parameter: Antiepileptic drug prophylaxis in severe traumatic brain injury. Report of the Quality Standards Subcommittee of the American Academy of Neurology. Neurology 2003; 60:10–16 [[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?CMD=search&DB=pubmed]]\n<<<\n<<<\nBeghi E: Overview of studies to prevent posttraumatic epilepsy. Epilepsia 2003; 44(Suppl 10):21–26 [[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=Abstract&list_uids=14511391&query_hl=14&itool=pubmed_docsum]]\n<<<
\n!!Prognosis in non-traumatic coma: Levy et al., 1981.\nLevy DE, Bates D, Caronna JJ, Cartlidge NE, ~Knill-Jones RP, Lapinski RH, Singer BH, Shaw DA, Plum F. Prognosis in nontraumatic coma. Ann Intern Med. 1981 Mar;94(3):293-301. [[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&list_uids=7224376&dopt=Abstract]]\n\nTable taken from article bvy Levy et al. No assurance is given regarding the accuracy of this table, which has not been checked. Patient care should not be based on this table. Please refer to the original literature for full information.\n|bgcolor(#dddddd): Time After Admission (d) |bgcolor(#dddddd): Level of Consciousness |>|>|>|>|bgcolor(#dddddd): Best 1-Year Recovery |\n|~|~| !No Recovery | !Vegetative State | !Severe Disability | !Moderate Disability | !Good Recovery |\n| 0 | Coma (500) | 61 | 12 | 11 | 4 | 12 |\n|>|>|>|>|>|>|bgcolor(#eeeeee):|\n| 1 | Coma (292) | 65 | 15 | 8 | 2 | 10 |\n| 1 | Vegetative (37) | ... | 35 | 27 | 16 | 22 |\n| 1 | Conscious (58) | ... | ... | 44 | 16 | 40 |\n||>|>|>|>|>|>|bgcolor(#eeeeee):|\n| 3 | Coma (124) | 61 | 25 | 6 | 1 | 6 |\n| 3 | Vegetative (40) | ... | 56 | 27 | 7 | 10 |\n| 3 | Conscious (97) | ... | ... | 34 | 18 | 48 |\n|>|>|>|>|>|>|bgcolor(#eeeeee):|\n| 7 | Coma (38) | 42 | 42 | 10 | 3 | 3 |\n| 7 | Vegetative (41) | ... | 61 | 32 | 5 | 2 |\n| 7 | Conscious (100) | ... | ... | 26 | 18 | 56 |\n|>|>|>|>|>|>|bgcolor(#eeeeee):|\n| 14 | Coma (12) | 25 | 67 | 8 | 0 | 0 |\n| 14 | Vegetative (36) | ... | 64 | 33 | 0 | 3 |\n| 14 | Conscious (101) | ... | ... | 28 | 19 | 53 |\n^^*Coma: eyes do not open or open only in response to pain, motor response of withdrawal or poorer, and verbal response no better than incomprehensible sounds.^^\n^^*Vegetative: eyes open in response to noise or spontaneously. Otherwise like coma.^^\n^^*Conscious: localizing motor responses, obeys commands or produces comprehensible words, regardless of eye opening.^^\n
Article by Hurley et al. showing some imaging.\n<<<\nHurley A, Ernst T, Khalili K, Del Valle L, Simone IL, Taber KH. Identification of ~HIV-Associated Progressive Multifocal Leukoencephalopathy: Magnetic Resonance Imaging and Spectroscopy\nJ Neuropsychiatry Clin Neurosci, 15(1): 1 - 6. [[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=retrieve&db=pubmed&list_uids=12556565&dopt=Abstract]]\n<<<\nDiscussion of brain lesions seen with AIDS, with differential diagnosis and description that PML shows focal white matter lesions without mass effect or contrast enhancement. \n<<<\nAmmassari A, Cingolani A, Pezzotti P, De Luca DA, Murri R, Giancola ML, Larocca LM, Antinori A. ~AIDS-related focal brain lesions in the era of highly active antiretroviral therapy. Neurology. 2000. 55(8):1194-200. [[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=retrieve&db=pubmed&list_uids=11071499&dopt=Abstract]]\n<<<\n \nArticle by R. Bakshi on neuroimaging findings in HIV and ~AIDS-related illnesses, and a [[link|http://www.bioscience.org/2004/v9/af/1256/figures.htm]] to just the images.\n<<<\nBakshi R. Neuroimaging of HIV and AIDS related illnesses: a review. Frontiers in Bioscience. 2004. 1(9):632-46. [[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=Abstract&list_uids=14766397&query_hl=15&itool=pubmed_DocSum]]\n<<<\n\nThe [[MedPix|http://rad.usuhs.mil/medpix/medpix.html?mode=default#top]] database has a very large number of peer-reviewed images and case descriptions, although sometimes searching for particular cases can be frustrating. Nevertheless, it is an outstanding resource. \n\nHere are three cases of [[ PML-1|http://rad.usuhs.mil/medpix/master.php3?mode=single&recnum=1484&th=-1#top ]], [[PML-2| http://rad.usuhs.mil/medpix/master.php3?mode=pt&pt_id=2029&hx=yes&&ddx=1&dx=yes#history]] and a case with gross pathology [[PML-3|http://rad.usuhs.mil/medpix/master.php3?mode=single&recnum=983&th=-1#top]]\n\n
/***\n| Name:|RenameTagsPlugin|\n| Purpose:|Allows you to easily rename tags|\n| Creator:|SimonBaird|\n| Source:|http://simonbaird.com/mptw/#RenameTagsPlugin|\n| Version:|1.0.1 (5-Mar-06)|\n\n!Description\nIf you rename a tiddler/tag that is tagging other tiddlers this plugin will ask you if you want to rename the tag in each tiddler where it is used. This is essential if you use tags and ever want to rename them. To use it, open the tag you want to rename as a tiddler (it's the last option in the tag popup menu), edit it, rename it and click done. You will asked if you want to rename the tag. Click OK to rename the tag in the tiddlers that use it. Click Cancel to not rename the tag.\n\n!Example\nTry renaming [[Plugins]] or [[CSS]] on this site.\n\n!History\n* 1.0.1 (5-Mar-06) - Added feature to allow renaming of tags without side-effect of creating a tiddler\n* 1.0.0 (5-Mar-06) - First working version\n\n!Code\n***/\n//{{{\n\nversion.extensions.RenameTagsPlugin = {\n major: 1, minor: 0, revision: 0,\n date: new Date(2006,3,5),\n source: "http://simonbaird.com/mptw/#RenameTagsPlugin"\n};\n\nconfig.macros.RenameTagsPlugin = {};\nconfig.macros.RenameTagsPlugin.prompt = "Rename the tag '%0' to '%1' in %2 tidder%3?";\n\n// these are very useful, perhaps they should be in the core\nif (!store.addTag) {\n store.addTag = function(title,tag) {\n var t=this.getTiddler(title); if (!t || !t.tags) return;\n t.tags.push(tag);\n };\n};\n\nif (!store.removeTag) {\n store.removeTag = function(title,tag) {\n var t=this.getTiddler(title); if (!t || !t.tags) return;\n if (t.tags.find(tag)!=null) t.tags.splice(t.tags.find(tag),1);\n };\n};\n\nstore.saveTiddler_orig_tagrename = store.saveTiddler;\nstore.saveTiddler = function(title,newTitle,newBody,modifier,modified,tags) {\n if (title != newTitle && this.getTaggedTiddlers(title).length > 0) {\n // then we are renaming a tag\n var tagged = this.getTaggedTiddlers(title);\n if (confirm(config.macros.RenameTagsPlugin.prompt.format([title,newTitle,tagged.length,tagged.length>1?"s":""]))) {\n for (var i=0;i<tagged.length;i++) {\n store.removeTag(tagged[i].title,title);\n store.addTag(tagged[i].title,newTitle);\n // if tiddler is visible refresh it to show updated tag\n story.refreshTiddler(tagged[i].title,false,true);\n }\n }\n if (!this.tiddlerExists(title) && newBody == "") {\n // dont create unwanted tiddler\n return null;\n }\n }\n return this.saveTiddler_orig_tagrename(title,newTitle,newBody,modifier,modified,tags);\n}\n\n//}}}\n\n
/***\n|Name:|SectionMacro|\n|Version:|0.9|\n|Author:|Jack|\n|Type:|Macro|\n\n!Description\nAllows you to create collapsable sections just like the slider macro but without needing to create new tiddlers for these sections.\n!Usage\n{{{<<section Title Tiddler Text goes here... }}}\n{{{and can be multi- line. >>}}}\n\n<<section Title\nTiddler Text goes here... \nand can be multi- line. >>\n\n!Revision History\n**Original by Jack 0.9\n!Code\n***/\n\n//{{{\nversion.extensions.section = {\n major: 0, minor: 9, revision: 0,\n date: new Date("Apr 27, 2006"),\n source: "http://cawoodm.googlepages.com/jtw.html#Plugins%20SectionMacro"\n};\n\nconfig.macros.section = {count:0};\nconfig.macros.section.handler = function(place,macroName,params,wikifier,paramString,tiddler) {\n this.slider(place,"section~" + this.count++,paramString.substr(params[0].length+1),params[0], "tooltip");\n};\n\nconfig.macros.section.slider = function(place,cookie,text,id,tooltips) {\n var btn = createTiddlyButton(place,id,tooltips,config.macros.slider.onClickSlider); \n var panel = createTiddlyElement(place,"div",null,"timelineSliderPanel",null);\n panel.setAttribute("cookie",cookie);\n panel.style.display = config.options[cookie] ? "block" : "none";\n if(text) wikify(text,panel);\n};\n//}}}
<<search>><<closeAll>><<permaview>><<newTiddler>><<newJournal 'DD MMM YYYY'>><<saveChanges>><<upload http://brainz.tiddlyspot.com/store.cgi index.html . . brainz>><<slider chkSliderOptionsPanel OptionsPanel 'options »' 'Change TiddlyWiki advanced options'>>
a reusable non-linear personal Neurology web notebook
Brainz Tiddlywiki
/***\n!Sections in this Tiddler:\n*Generic rules\n**Links styles\n**Link Exceptions\n*Header\n*Main menu\n*Sidebar\n**Sidebar options\n**Sidebar tabs\n*Message area\n*Popup\n*Tabs\n*Tiddler display\n**Viewer\n**Editor\n*Misc. rules\n!Generic Rules /%==============================================%/\n***/\n/*{{{*/\nbody {\n font-size: .75em;\n font-family: arial,helvetica;\n position: relative;\n margin: 0;\n padding: 0;\n}\n\nh1,h2,h3,h4,h5 {\n font-weight: bold;\n text-decoration: none;\n padding-left: 0.4em;\n}\n\nh1 {font-size: 1.35em;}\nh2 {font-size: 1.25em;}\nh3 {font-size: 1.1em;}\nh4 {font-size: 1em;}\nh5 {font-size: .9em;}\n\nhr {\n height: 1px;\n}\n\na{\n text-decoration: none;\n}\n\nol { list-style-type: decimal }\nol ol { list-style-type: lower-alpha }\nol ol ol { list-style-type: lower-roman }\nol ol ol ol { list-style-type: decimal }\nol ol ol ol ol { list-style-type: lower-alpha }\nol ol ol ol ol ol { list-style-type: lower-roman }\nol ol ol ol ol ol ol { list-style-type: decimal }\n/*}}}*/\n/***\n''General Link Styles'' /%-----------------------------------------------------------------------------%/\n***/\n/*{{{*/\n.externalLink {\n text-decoration: underline;\n}\n\n.tiddlyLinkExisting {\n font-weight: bold;\n}\n\n.tiddlyLinkNonExisting {\n font-style: italic;\n}\n\n/* the 'a' is required for IE, otherwise it renders the whole tiddler a bold */\na.tiddlyLinkNonExisting.shadow {\n font-weight: bold;\n}\n/*}}}*/\n/***\n''Exceptions to common link styles'' /%------------------------------------------------------------------%/\n***/\n/*{{{*/\n\n#mainMenu .tiddlyLinkExisting, \n#mainMenu .tiddlyLinkNonExisting,\n#sidebarTabs .tiddlyLinkExisting,\n#sidebarTabs .tiddlyLinkNonExisting{\n font-weight: normal;\n font-style: normal;\n}\n\n/*}}}*/\n/***\n!Header /%==================================================%/\n***/\n/*{{{*/\n\n.header {\n position: relative;\n}\n\n.header a:hover {\n background: transparent;\n}\n\n.headerShadow {\n position: relative;\n padding: 4.5em 0em 1em 1em;\n left: -1px;\n top: -1px;\n}\n\n.headerForeground {\n position: absolute;\n padding: 4.5em 0em 1em 1em;\n left: 0px;\n top: 0px;\n}\n\n.siteTitle {\n font-size: 3em;\n}\n\n.siteSubtitle {\n font-size: 1.2em;\n}\n\n/*}}}*/\n/***\n!Main menu /%==================================================%/\n***/\n/*{{{*/\n#mainMenu {\n position: absolute;\n left: 0;\n width: 14em;\n text-align: left;\n line-height: 1.6em;\n padding: 1.0em 0.5em 0.5em 0.5em;\n font-size: 0.9em;\n}\n\n/*}}}*/\n/***\n!Sidebar rules /%==================================================%/\n***/\n/*{{{*/\n#sidebar {\n position: absolute;\n right: 3px;\n width: 16em;\n font-size: .9em;\n}\n/*}}}*/\n/***\n''Sidebar options'' /%----------------------------------------------------------------------------------%/\n***/\n/*{{{*/\n#sidebarOptions {\n padding-top: 0.3em;\n}\n\n#sidebarOptions a {\n margin: 0em 0.2em;\n padding: 0.2em 0.3em;\n display: block;\n}\n\n#sidebarOptions input {\n margin: 0.4em 0.5em;\n}\n\n#sidebarOptions .sliderPanel {\n margin-left: 1em;\n padding: 0.5em;\n font-size: .85em;\n}\n\n#sidebarOptions .sliderPanel a {\n font-weight: bold;\n display: inline;\n padding: 0;\n}\n\n#sidebarOptions .sliderPanel input {\n margin: 0 0 .3em 0;\n}\n/*}}}*/\n/***\n''Sidebar tabs'' /%-------------------------------------------------------------------------------------%/\n***/\n/*{{{*/\n\n#sidebarTabs .tabContents {\n width: 15em;\n overflow: hidden;\n}\n\n/*}}}*/\n/***\n!Message area /%==================================================%/\n***/\n/*{{{*/\n#messageArea {\nposition:absolute; top:0; right:0; margin: 0.5em; padding: 0.5em;\n}\n\n*[id='messageArea'] {\nposition:fixed !important; z-index:99;}\n\n.messageToolbar {\ndisplay: block;\ntext-align: right;\n}\n\n#messageArea a{\n text-decoration: underline;\n}\n/*}}}*/\n/***\n!Popup /%==================================================%/\n***/\n/*{{{*/\n.popup {\n font-size: .9em;\n padding: 0.2em;\n list-style: none;\n margin: 0;\n}\n\n.popup hr {\n display: block;\n height: 1px;\n width: auto;\n padding: 0;\n margin: 0.2em 0em;\n}\n\n.popup li.disabled {\n padding: 0.2em;\n}\n\n.popup li a{\n display: block;\n padding: 0.2em;\n}\n/*}}}*/\n/***\n!Tabs /%==================================================%/\n***/\n/*{{{*/\n.tabset {\n padding: 1em 0em 0em 0.5em;\n}\n\n.tab {\n margin: 0em 0em 0em 0.25em;\n padding: 2px;\n}\n\n.tabContents {\n padding: 0.5em;\n}\n\n.tabContents ul, .tabContents ol {\n margin: 0;\n padding: 0;\n}\n\n.txtMainTab .tabContents li {\n list-style: none;\n}\n\n.tabContents li.listLink {\n margin-left: .75em;\n}\n/*}}}*/\n/***\n!Tiddler display rules /%==================================================%/\n***/\n/*{{{*/\n#displayArea {\n margin: 1em 17em 0em 14em;\n}\n\n\n.toolbar {\n text-align: right;\n font-size: .9em;\n visibility: hidden;\n}\n\n.selected .toolbar {\n visibility: visible;\n}\n\n.tiddler {\n padding: 1em 1em 0em 1em;\n}\n\n.missing .viewer,.missing .title {\n font-style: italic;\n}\n\n.title {\n font-size: 1.6em;\n font-weight: bold;\n}\n\n.missing .subtitle {\n display: none;\n}\n\n.subtitle {\n font-size: 1.1em;\n}\n\n/* I'm not a fan of how button looks in tiddlers... */\n.tiddler .button {\n padding: 0.2em 0.4em;\n}\n\n.tagging {\nmargin: 0.5em 0.5em 0.5em 0;\nfloat: left;\ndisplay: none;\n}\n\n.isTag .tagging {\ndisplay: block;\n}\n\n.tagged {\nmargin: 0.5em;\nfloat: right;\n}\n\n.tagging, .tagged {\nfont-size: 0.9em;\npadding: 0.25em;\n}\n\n.tagging ul, .tagged ul {\nlist-style: none;margin: 0.25em;\npadding: 0;\n}\n\n.tagClear {\nclear: both;\n}\n\n.footer {\n font-size: .9em;\n}\n\n.footer li {\ndisplay: inline;\n}\n/***\n''The viewer is where the tiddler content is displayed'' /%------------------------------------------------%/\n***/\n/*{{{*/\n* html .viewer pre {\n width: 99%;\n padding: 0 0 1em 0;\n}\n\n.viewer {\n line-height: 1.4em;\n padding-top: 0.5em;\n}\n\n.viewer .button {\n margin: 0em 0.25em;\n padding: 0em 0.25em;\n}\n\n.viewer blockquote {\n line-height: 1.5em;\n padding-left: 0.8em;\n margin-left: 2.5em;\n}\n\n.viewer ul, .viewer ol{\n margin-left: 0.5em;\n padding-left: 1.5em;\n}\n\n.viewer table {\n border-collapse: collapse;\n margin: 0.8em 1.0em;\n}\n\n.viewer th, .viewer td, .viewer tr,.viewer caption{\n padding: 3px;\n}\n\n.viewer pre {\n padding: 0.5em;\n margin-left: 0.5em;\n font-size: 1.2em;\n line-height: 1.4em;\n overflow: auto;\n}\n\n.viewer code {\n font-size: 1.2em;\n line-height: 1.4em;\n}\n/*}}}*/\n/***\n''The editor replaces the viewer in the tiddler'' /%------------------------------------------------%/\n***/\n/*{{{*/\n.editor {\nfont-size: 1.1em;\n}\n\n.editor input, .editor textarea {\n display: block;\n width: 100%;\n font: inherit;\n}\n\n.editorFooter {\n padding: 0.25em 0em;\n font-size: .9em;\n}\n\n.editorFooter .button {\npadding-top: 0px; padding-bottom: 0px;}\n\n.fieldsetFix {border: 0;\npadding: 0;\nmargin: 1px 0px 1px 0px;\n}\n/*}}}*/\n/***\n!Misc rules /%==================================================%/\n***/\n/*{{{*/\n.sparkline {\n line-height: 1em;\n}\n\n.sparktick {\n outline: 0;\n}\n\n.zoomer {\n font-size: 1.1em;\n position: absolute;\n padding: 1em;\n}\n\n.cascade {\n font-size: 1.1em;\n position: absolute;\n overflow: hidden;\n}\n/*}}}*/
\nReferences:\n\nBrust JC. Neurologic complications of substance abuse. J Acquir Immune Defic Syndr. 2002 Oct 1;31 Suppl 2:S29-34. [[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=AbstractPlus&list_uids=12394780&query_hl=5&itool=pubmed_DocSum]]\n\nNg SKC, Hauser WA, Brust JC, Susser M. Alcohol consumption and withdrawal in new-onset seizures. N Engl J Med 1988;319:666–73. [[Pubmed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=AbstractPlus&list_uids=3412384&query_hl=8&itool=pubmed_docsum]]\n\n
<<timeline>>
This [[TiddlyWiki|http://www.tiddlywiki.com/]] is an educational experiment. I hope it will enhance both my own education and my teaching of [[Neurology Residents]] and [[Medical Students]]. On the other hand it could turn out to be just another [[distraction|http://www.add.org/]] in my life. Time will tell.\n\nThis site does not contain information or references to individual patients. However, because postings are invariably related to medical discussions, diagnoses will be mentioned that are shared by many patients that I have been privileged to take care of over the years.\n\n//Disclaimer: The information posted on this site should not be used as a primary reference for treating patients. It is meant to serve as a repository of references and tidbits of information. Descriptions of various medical conditions, tests, etc. are not intended to be comprehensive, and the information is not reviewed for the accuracy of my transcription. [[PubMed|http://www.ncbi.nih.gov/entrez/query.fcgi]] references are provided for the original source material. In all cases, the original sources and not this site should be the references used for treating patients.//\n\nHappy TiddlySurfing\nDarren Gitelman, MD\n^^d-gitelmanATnorthwesternDOTedu^^\n\n^^Note to copyright holders: The links on this site were found using [[Google Scholar|http://scholar.google.com/]], [[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?DB=pubmed]] or some other publicly available web resource. If you feel I've linked to your resource in error please let me know. -drg^^
\nPartial and complete ophthalmoplegia has been reported in association with a number of drugs although the occurrence is rare.\n\nAnticonvulsants including phenytoin ([[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=Abstract&list_uids=824568&query_hl=27&itool=pubmed_DocSum]], [[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=Abstract&list_uids=6695267&query_hl=28&itool=pubmed_docsum]], [[PubMed||http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&list_uids=2939108&dopt=Citation]], [[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=Abstract&list_uids=15472437&query_hl=24&itool=pubmed_docsum]]), and carbamazepine ([[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&list_uids=2194703&dopt=Citation]]) are well known to produce ophthalmoplegia.\n\nOther medications producing ophthalmoplegia include amitriptyline ([[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=Abstract&list_uids=7114819&query_hl=34&itool=pubmed_docsum]]), intravenous anesthesia with propofol, fentanyl and atracurium ([[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=Abstract&list_uids=8017599&query_hl=2&itool=pubmed_docsum]])), and immunosuppressants such as cyclosporine ([[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=Abstract&list_uids=9780114&query_hl=21&itool=pubmed_docsum]]) and ~FK506 ([[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=Abstract&list_uids=15090580&query_hl=22&itool=pubmed_docsum]]). In the case of intravenous anesthesia, ophthalmoplegia was not related to the dose of propofol suggesting that the effect may have been related to the use of fentanyl. \n\nCyclosporine and ~FK506 have also been associated with complete ophthalmoplegia and bilateral intranuclear ophthalmoplegia (INO) respectively. In the former report, cyclosporine was discontinued and thiamine started with resolution of the ophthalmoplegia although optic atrophy persisted. However, there was no evidence that thiamine contributed to the resolution of the ophthalmoplegia. \n\nIn the case of ~FK506 bilateral INO was linked to a rise in serum ~FK506 concentration, and promptly resolved when the drug was discontinued.\n\nUnilateral ([[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=Abstract&list_uids=3740812&query_hl=30&itool=pubmed_docsum]]) and bilateral ([[PubMed| http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=Abstract&list_uids=6830474&query_hl=31&itool=pubmed_DocSum]]) INO's have been seen with narcotic overdose and have been reversed by the administration of naloxone. Because ophthalmoplegia is see with Wernicke's encephalopathy, and the patient of ~El-Mallakh (1986, [[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=Abstract&list_uids=3740812&query_hl=30&itool=pubmed_docsum]]) had a history of alcohol abuse, he suggested there may be some association with thiamine metabolism, but this has not been shown. Furthermore the patient reported by Rizzo & Corbett showed reversal of symptoms with just naloxone alone ([[PubMed|http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=Abstract&list_uids=6830474&query_hl=31&itool=pubmed_DocSum]]). \n\n
| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |\n| 27/12/2006 18:56:25 | drg | [[/|http://brainz.tiddlyspot.com/]] | [[store.cgi|http://tiddlyspot.com/brainz/store.cgi]] | . | index.html | . |\n| 27/12/2006 18:57:59 | drg | [[/|http://brainz.tiddlyspot.com/]] | [[store.cgi|http://tiddlyspot.com/brainz/store.cgi]] | . | index.html | . |\n| 27/12/2006 18:58:29 | drg | [[/|http://brainz.tiddlyspot.com/]] | [[store.cgi|http://brainz.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 27/12/2006 18:59:33 | drg | [[/|http://brainz.tiddlyspot.com/]] | [[store.cgi|http://brainz.tiddlyspot.com/store.cgi]] | . | index.html | . |
/***\n<<tiddler UploadPluginDoc>>\n!Code\n***/\n//{{{\nversion.extensions.UploadPlugin = {\n major: 3, minor: 3, revision: 3, \n date: new Date(2006,6,30),\n type: 'macro',\n source: 'http://tiddlywiki.bidix.info/#UploadPlugin',\n docs: 'http://tiddlywiki.bidix.info/#UploadPluginDoc'\n};\n//}}}\n\n////+++!![config.lib.file]\n\n//{{{\nif (!config.lib) config.lib = {};\nif (!config.lib.file) config.lib.file= {\n author: 'BidiX',\n version: {major: 0, minor: 1, revision: 0}, \n date: new Date(2006,3,9)\n};\nconfig.lib.file.dirname = function (filePath) {\n var lastpos;\n if ((lastpos = filePath.lastIndexOf("/")) != -1) {\n return filePath.substring(0, lastpos);\n } else {\n return filePath.substring(0, filePath.lastIndexOf("\s\s"));\n }\n};\nconfig.lib.file.basename = function (filePath) {\n var lastpos;\n if ((lastpos = filePath.lastIndexOf("#")) != -1) \n filePath = filePath.substring(0, lastpos);\n if ((lastpos = filePath.lastIndexOf("/")) != -1) {\n return filePath.substring(lastpos + 1);\n } else\n return filePath.substring(filePath.lastIndexOf("\s\s")+1);\n};\nwindow.basename = function() {return "@@deprecated@@";};\n//}}}\n////===\n\n////+++!![config.lib.log]\n\n//{{{\nif (!config.lib) config.lib = {};\nif (!config.lib.log) config.lib.log= {\n author: 'BidiX',\n version: {major: 0, minor: 1, revision: 0}, \n date: new Date(2006,3,9)\n};\nconfig.lib.Log = function(tiddlerTitle, logHeader) {\n if (version.major < 2)\n this.tiddler = store.tiddlers[tiddlerTitle];\n else\n this.tiddler = store.getTiddler(tiddlerTitle);\n if (!this.tiddler) {\n this.tiddler = new Tiddler();\n this.tiddler.title = tiddlerTitle;\n this.tiddler.text = "| !date | !user | !location |" + logHeader;\n this.tiddler.created = new Date();\n this.tiddler.modifier = config.options.txtUserName;\n this.tiddler.modified = new Date();\n if (version.major < 2)\n store.tiddlers[tiddlerTitle] = this.tiddler;\n else\n store.addTiddler(this.tiddler);\n }\n return this;\n};\n\nconfig.lib.Log.prototype.newLine = function (line) {\n var now = new Date();\n var newText = "| ";\n newText += now.getDate()+"/"+(now.getMonth()+1)+"/"+now.getFullYear() + " ";\n newText += now.getHours()+":"+now.getMinutes()+":"+now.getSeconds()+" | ";\n newText += config.options.txtUserName + " | ";\n var location = document.location.toString();\n var filename = config.lib.file.basename(location);\n if (!filename) filename = '/';\n newText += "[["+filename+"|"+location + "]] |";\n this.tiddler.text = this.tiddler.text + "\sn" + newText;\n this.addToLine(line);\n};\n\nconfig.lib.Log.prototype.addToLine = function (text) {\n this.tiddler.text = this.tiddler.text + text;\n this.tiddler.modifier = config.options.txtUserName;\n this.tiddler.modified = new Date();\n if (version.major < 2)\n store.tiddlers[this.tiddler.tittle] = this.tiddler;\n else {\n store.addTiddler(this.tiddler);\n story.refreshTiddler(this.tiddler.title);\n store.notify(this.tiddler.title, true);\n }\n if (version.major < 2)\n store.notifyAll(); \n};\n//}}}\n////===\n\n////+++!![config.lib.options]\n\n//{{{\nif (!config.lib) config.lib = {};\nif (!config.lib.options) config.lib.options = {\n author: 'BidiX',\n version: {major: 0, minor: 1, revision: 0}, \n date: new Date(2006,3,9)\n};\n\nconfig.lib.options.init = function (name, defaultValue) {\n if (!config.options[name]) {\n config.options[name] = defaultValue;\n saveOptionCookie(name);\n }\n};\n//}}}\n////===\n\n////+++!![PasswordTweak]\n\n//{{{\nversion.extensions.PasswordTweak = {\n major: 1, minor: 0, revision: 2, date: new Date(2006,3,11),\n type: 'tweak',\n source: 'http://tiddlywiki.bidix.info/#PasswordTweak'\n};\n//}}}\n/***\n!!config.macros.option\n***/\n//{{{\nconfig.macros.option.passwordCheckboxLabel = "Save this password on this computer";\nconfig.macros.option.passwordType = "password"; // password | text\n\nconfig.macros.option.onChangeOption = function(e)\n{\n var opt = this.getAttribute("option");\n var elementType,valueField;\n if(opt) {\n switch(opt.substr(0,3)) {\n case "txt":\n elementType = "input";\n valueField = "value";\n break;\n case "pas":\n elementType = "input";\n valueField = "value";\n break;\n case "chk":\n elementType = "input";\n valueField = "checked";\n break;\n }\n config.options[opt] = this[valueField];\n saveOptionCookie(opt);\n var nodes = document.getElementsByTagName(elementType);\n for(var t=0; t<nodes.length; t++) {\n var optNode = nodes[t].getAttribute("option");\n if (opt == optNode) \n nodes[t][valueField] = this[valueField];\n }\n }\n return(true);\n};\n\nconfig.macros.option.handler = function(place,macroName,params)\n{\n var opt = params[0];\n var size = 15;\n if (params[1])\n size = params[1];\n if(config.options[opt] === undefined) {\n return;}\n var c;\n switch(opt.substr(0,3)) {\n case "txt":\n c = document.createElement("input");\n c.onkeyup = this.onChangeOption;\n c.setAttribute ("option",opt);\n c.size = size;\n c.value = config.options[opt];\n place.appendChild(c);\n break;\n case "pas":\n // input password\n c = document.createElement ("input");\n c.setAttribute("type",config.macros.option.passwordType);\n c.onkeyup = this.onChangeOption;\n c.setAttribute("option",opt);\n c.size = size;\n c.value = config.options[opt];\n place.appendChild(c);\n // checkbox link with this password "save this password on this computer"\n c = document.createElement("input");\n c.setAttribute("type","checkbox");\n c.onclick = this.onChangeOption;\n c.setAttribute("option","chk"+opt);\n place.appendChild(c);\n c.checked = config.options["chk"+opt];\n // text savePasswordCheckboxLabel\n place.appendChild(document.createTextNode(config.macros.option.passwordCheckboxLabel));\n break;\n case "chk":\n c = document.createElement("input");\n c.setAttribute("type","checkbox");\n c.onclick = this.onChangeOption;\n c.setAttribute("option",opt);\n place.appendChild(c);\n c.checked = config.options[opt];\n break;\n }\n};\n//}}}\n/***\n!! Option cookie stuff\n***/\n//{{{\nwindow.loadOptionsCookie_orig_PasswordTweak = window.loadOptionsCookie;\nwindow.loadOptionsCookie = function()\n{\n var cookies = document.cookie.split(";");\n for(var c=0; c<cookies.length; c++) {\n var p = cookies[c].indexOf("=");\n if(p != -1) {\n var name = cookies[c].substr(0,p).trim();\n var value = cookies[c].substr(p+1).trim();\n switch(name.substr(0,3)) {\n case "txt":\n config.options[name] = unescape(value);\n break;\n case "pas":\n config.options[name] = unescape(value);\n break;\n case "chk":\n config.options[name] = value == "true";\n break;\n }\n }\n }\n};\n\nwindow.saveOptionCookie_orig_PasswordTweak = window.saveOptionCookie;\nwindow.saveOptionCookie = function(name)\n{\n var c = name + "=";\n switch(name.substr(0,3)) {\n case "txt":\n c += escape(config.options[name].toString());\n break;\n case "chk":\n c += config.options[name] ? "true" : "false";\n // is there an option link with this chk ?\n if (config.options[name.substr(3)]) {\n saveOptionCookie(name.substr(3));\n }\n break;\n case "pas":\n if (config.options["chk"+name]) {\n c += escape(config.options[name].toString());\n } else {\n c += "";\n }\n break;\n }\n c += "; expires=Fri, 1 Jan 2038 12:00:00 UTC; path=/";\n document.cookie = c;\n};\n//}}}\n/***\n!! Initializations\n***/\n//{{{\n// define config.options.pasPassword\nif (!config.options.pasPassword) {\n config.options.pasPassword = 'defaultPassword';\n window.saveOptionCookie('pasPassword');\n}\n// since loadCookies is first called befor password definition\n// we need to reload cookies\nwindow.loadOptionsCookie();\n//}}}\n////===\n\n////+++!![config.macros.upload]\n\n//{{{\nconfig.macros.upload = {\n accessKey: "U",\n formName: "UploadPlugin",\n contentType: "text/html;charset=UTF-8",\n defaultStoreScript: "store.php"\n};\n\n// only this two configs need to be translated\nconfig.macros.upload.messages = {\n aboutToUpload: "About to upload TiddlyWiki to %0",\n errorDownloading: "Error downloading",\n errorUploadingContent: "Error uploading content",\n fileNotFound: "file to upload not found",\n fileNotUploaded: "File %0 NOT uploaded",\n mainFileUploaded: "Main TiddlyWiki file uploaded to %0",\n urlParamMissing: "url param missing",\n rssFileNotUploaded: "RssFile %0 NOT uploaded",\n rssFileUploaded: "Rss File uploaded to %0"\n};\n\nconfig.macros.upload.label = {\n promptOption: "Save and Upload this TiddlyWiki with UploadOptions",\n promptParamMacro: "Save and Upload this TiddlyWiki in %0",\n saveLabel: "save to web", \n saveToDisk: "save to disk",\n uploadLabel: "upload" \n};\n\nconfig.macros.upload.handler = function(place,macroName,params){\n // parameters initialization\n var storeUrl = params[0];\n var toFilename = params[1];\n var backupDir = params[2];\n var uploadDir = params[3];\n var username = params[4];\n var password; // for security reason no password as macro parameter\n var label;\n if (document.location.toString().substr(0,4) == "http")\n label = this.label.saveLabel;\n else\n label = this.label.uploadLabel;\n var prompt;\n if (storeUrl) {\n prompt = this.label.promptParamMacro.toString().format([this.dirname(storeUrl)]);\n }\n else {\n prompt = this.label.promptOption;\n }\n createTiddlyButton(place, label, prompt, \n function () {\n config.macros.upload.upload(storeUrl, toFilename, uploadDir, backupDir, username, password); \n return false;}, \n null, null, this.accessKey);\n};\nconfig.macros.upload.UploadLog = function() {\n return new config.lib.Log('UploadLog', " !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |" );\n};\nconfig.macros.upload.UploadLog.prototype = config.lib.Log.prototype;\nconfig.macros.upload.UploadLog.prototype.startUpload = function(storeUrl, toFilename, uploadDir, backupDir) {\n var line = " [[" + config.lib.file.basename(storeUrl) + "|" + storeUrl + "]] | ";\n line += uploadDir + " | " + toFilename + " | " + backupDir + " |";\n this.newLine(line);\n};\nconfig.macros.upload.UploadLog.prototype.endUpload = function() {\n this.addToLine(" Ok |");\n};\nconfig.macros.upload.basename = config.lib.file.basename;\nconfig.macros.upload.dirname = config.lib.file.dirname;\nconfig.macros.upload.upload = function(storeUrl, toFilename, uploadDir, backupDir, username, password)\n{\n // parameters initialization\n storeUrl = (storeUrl ? storeUrl : config.options.txtUploadStoreUrl);\n toFilename = (toFilename ? toFilename : config.options.txtUploadFilename);\n backupDir = (backupDir ? backupDir : config.options.txtUploadBackupDir);\n uploadDir = (uploadDir ? uploadDir : config.options.txtUploadDir);\n username = (username ? username : config.options.txtUploadUserName);\n password = config.options.pasUploadPassword; // for security reason no password as macro parameter\n if (storeUrl === '') {\n config.macros.upload.defaultStoreScript;\n }\n if (config.lib.file.dirname(storeUrl) === '') {\n storeUrl = config.lib.file.dirname(document.location.toString())+'/'+storeUrl;\n }\n if (toFilename === '') {\n toFilename = config.lib.file.basename(document.location.toString());\n }\n\n clearMessage();\n // only for forcing the message to display\n if (version.major < 2)\n store.notifyAll();\n if (!storeUrl) {\n alert(config.macros.upload.messages.urlParamMissing);\n return;\n }\n \n var log = new this.UploadLog();\n log.startUpload(storeUrl, toFilename, uploadDir, backupDir);\n if (document.location.toString().substr(0,5) == "file:") {\n saveChanges();\n }\n displayMessage(config.macros.upload.messages.aboutToUpload.format([this.dirname(storeUrl)]), this.dirname(storeUrl));\n this.uploadChanges(storeUrl, toFilename, uploadDir, backupDir, username, password);\n if(config.options.chkGenerateAnRssFeed) {\n //var rssContent = convertUnicodeToUTF8(generateRss());\n var rssContent = generateRss();\n var rssPath = toFilename.substr(0,toFilename.lastIndexOf(".")) + ".xml";\n this.uploadContent(rssContent, storeUrl, rssPath, uploadDir, '', username, password, \n function (responseText) {\n if (responseText.substring(0,1) != '0') {\n displayMessage(config.macros.upload.messages.rssFileNotUploaded.format([rssPath]));\n }\n else {\n if (uploadDir) {\n rssPath = uploadDir + "/" + config.macros.upload.basename(rssPath);\n } else {\n rssPath = config.macros.upload.basename(rssPath);\n }\n displayMessage(config.macros.upload.messages.rssFileUploaded.format(\n [config.macros.upload.dirname(storeUrl)+"/"+rssPath]), config.macros.upload.dirname(storeUrl)+"/"+rssPath);\n }\n // for debugging store.php uncomment last line\n //DEBUG alert(responseText);\n });\n }\n return;\n};\n\nconfig.macros.upload.uploadChanges = function(storeUrl, toFilename, uploadDir, backupDir, \n username, password) {\n var original;\n if (document.location.toString().substr(0,4) == "http") {\n original = this.download(storeUrl, toFilename, uploadDir, backupDir, username, password);\n return;\n }\n else {\n // standard way : Local file\n \n original = loadFile(getLocalPath(document.location.toString()));\n if(window.Components) {\n // it's a mozilla browser\n try {\n netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");\n var converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]\n .createInstance(Components.interfaces.nsIScriptableUnicodeConverter);\n converter.charset = "UTF-8";\n original = converter.ConvertToUnicode(original);\n }\n catch(e) {\n }\n }\n }\n //DEBUG alert(original);\n this.uploadChangesFrom(original, storeUrl, toFilename, uploadDir, backupDir, \n username, password);\n};\n\nconfig.macros.upload.uploadChangesFrom = function(original, storeUrl, toFilename, uploadDir, backupDir, \n username, password) {\n var startSaveArea = '<div id="' + 'storeArea">'; // Split up into two so that indexOf() of this source doesn't find it\n var endSaveArea = '</d' + 'iv>';\n // Locate the storeArea div's\n var posOpeningDiv = original.indexOf(startSaveArea);\n var posClosingDiv = original.lastIndexOf(endSaveArea);\n if((posOpeningDiv == -1) || (posClosingDiv == -1))\n {\n alert(config.messages.invalidFileError.format([document.location.toString()]));\n return;\n }\n var revised = original.substr(0,posOpeningDiv + startSaveArea.length) + \n allTiddlersAsHtml() + "\sn\st\st" +\n original.substr(posClosingDiv);\n var newSiteTitle;\n if(version.major < 2){\n newSiteTitle = (getElementText("siteTitle") + " - " + getElementText("siteSubtitle")).htmlEncode();\n } else {\n newSiteTitle = (wikifyPlain ("SiteTitle") + " - " + wikifyPlain ("SiteSubtitle")).htmlEncode();\n }\n revised = revised.replace(new RegExp("<title>[^<]*</title>", "im"),"<title>"+ newSiteTitle +"</title>");\n var response = this.uploadContent(revised, storeUrl, toFilename, uploadDir, backupDir, \n username, password, function (responseText) {\n if (responseText.substring(0,1) != '0') {\n alert(responseText);\n displayMessage(config.macros.upload.messages.fileNotUploaded.format([getLocalPath(document.location.toString())]));\n }\n else {\n if (uploadDir !== '') {\n toFilename = uploadDir + "/" + config.macros.upload.basename(toFilename);\n } else {\n toFilename = config.macros.upload.basename(toFilename);\n }\n displayMessage(config.macros.upload.messages.mainFileUploaded.format(\n [config.macros.upload.dirname(storeUrl)+"/"+toFilename]), config.macros.upload.dirname(storeUrl)+"/"+toFilename);\n var log = new config.macros.upload.UploadLog();\n log.endUpload();\n store.setDirty(false);\n }\n // for debugging store.php uncomment last line\n //DEBUG alert(responseText);\n }\n );\n};\n\nconfig.macros.upload.uploadContent = function(content, storeUrl, toFilename, uploadDir, backupDir, \n username, password, callbackFn) {\n var boundary = "---------------------------"+"AaB03x"; \n var request;\n try {\n request = new XMLHttpRequest();\n } \n catch (e) { \n request = new ActiveXObject("Msxml2.XMLHTTP"); \n }\n if (window.netscape){\n try {\n if (document.location.toString().substr(0,4) != "http") {\n netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');}\n }\n catch (e) { }\n } \n //DEBUG alert("user["+config.options.txtUploadUserName+"] password[" + config.options.pasUploadPassword + "]");\n // compose headers data\n var sheader = "";\n sheader += "--" + boundary + "\sr\snContent-disposition: form-data; name=\s"";\n sheader += config.macros.upload.formName +"\s"\sr\sn\sr\sn";\n sheader += "backupDir="+backupDir\n +";user=" + username \n +";password=" + password\n +";uploaddir=" + uploadDir\n + ";;\sr\sn"; \n sheader += "\sr\sn" + "--" + boundary + "\sr\sn";\n sheader += "Content-disposition: form-data; name=\s"userfile\s"; filename=\s""+toFilename+"\s"\sr\sn";\n sheader += "Content-Type: " + config.macros.upload.contentType + "\sr\sn";\n sheader += "Content-Length: " + content.length + "\sr\sn\sr\sn";\n // compose trailer data\n var strailer = new String();\n strailer = "\sr\sn--" + boundary + "--\sr\sn";\n var data;\n data = sheader + content + strailer;\n //request.open("POST", storeUrl, true, username, password);\n request.open("POST", storeUrl, true);\n request.onreadystatechange = function () {\n if (request.readyState == 4) {\n if (request.status == 200)\n callbackFn(request.responseText);\n else\n alert(config.macros.upload.messages.errorUploadingContent);\n }\n };\n request.setRequestHeader("Content-Length",data.length);\n request.setRequestHeader("Content-Type","multipart/form-data; boundary="+boundary);\n request.send(data); \n};\n\n\nconfig.macros.upload.download = function(uploadUrl, uploadToFilename, uploadDir, uploadBackupDir, \n username, password) {\n var request;\n try {\n request = new XMLHttpRequest();\n } \n catch (e) { \n request = new ActiveXObject("Msxml2.XMLHTTP"); \n }\n try {\n if (uploadUrl.substr(0,4) == "http") {\n netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");\n }\n else {\n netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");\n }\n } catch (e) { }\n //request.open("GET", document.location.toString(), true, username, password);\n request.open("GET", document.location.toString(), true);\n request.onreadystatechange = function () {\n if (request.readyState == 4) {\n if(request.status == 200) {\n config.macros.upload.uploadChangesFrom(request.responseText, uploadUrl, \n uploadToFilename, uploadDir, uploadBackupDir, username, password);\n }\n else\n alert(config.macros.upload.messages.errorDownloading.format(\n [document.location.toString()]));\n }\n };\n request.send(null);\n};\n\n//}}}\n////===\n\n////+++!![Initializations]\n\n//{{{\nconfig.lib.options.init('txtUploadStoreUrl','store.php');\nconfig.lib.options.init('txtUploadFilename','');\nconfig.lib.options.init('txtUploadDir','');\nconfig.lib.options.init('txtUploadBackupDir','');\nconfig.lib.options.init('txtUploadUserName',config.options.txtUserName);\nconfig.lib.options.init('pasUploadPassword','');\nconfig.shadowTiddlers.UploadPluginDoc = "[[Full Documentation|http://tiddlywiki.bidix.info/l#UploadPluginDoc ]]\sn"; \n\n\n//}}}\n////===\n\n////+++!![Core Hijacking]\n\n//{{{\nconfig.macros.saveChanges.label_orig_UploadPlugin = config.macros.saveChanges.label;\nconfig.macros.saveChanges.label = config.macros.upload.label.saveToDisk;\n\nconfig.macros.saveChanges.handler_orig_UploadPlugin = config.macros.saveChanges.handler;\n\nconfig.macros.saveChanges.handler = function(place)\n{\n if ((!readOnly) && (document.location.toString().substr(0,4) != "http"))\n createTiddlyButton(place,this.label,this.prompt,this.onClick,null,null,this.accessKey);\n}\n\n//}}}\n////===
\n\nBrain MRI showing abnormal mammillary body signal in a patient with Wernicke's encephalopathy.\n\n<html>\n<img src="http://d.gitelman.googlepages.com/Baek_BoneMarrowTransp_2005_License.jpg" alt="Abnormal signal in mammillary bodies in Wernicke's encephalopathy." width=70% height=70%>\n</html>\n\nMagnetic resonance imaging of brain shows (a) increased signal in mamillary bodies in FLAIR image. (b) T1-weighted image with contrast enhancement of mammilary bodies. ^^Reprinted by permission from Macmillan Publishers Ltd: Bone Marrow Transplantation. Baek et al. 35:829-830, copyright 2005^^\n\n