git.iko.soy/typeable/pandoc
on master help sign in
Modified fancy s5 test in light of asciiMathML changes.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@798 788f1e2b-df1e-0410-8736-df70ead52e1b

commit831fe2c6cf237805818959cc603f59f7a979bb62 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateThu 26 Jul 2007, 02:17 (19 years ago) parentdccc63f
1 file changed+1528−1528
tests/s5.fancy.html+1528−1528
tests/s5.fancy.html+1528−1528
@@ -8,1652 +8,1652 @@
88 /><meta name="author" content="Sam Smith"
99 /><meta name="author" content="Jen Jones"
1010 /><meta name="date" content="July 15, 2006"
11− /><!-- configuration parameters -->
12−<meta name="defaultView" content="slideshow" />
13−<meta name="controlVis" content="hidden" />
14−<style type="text/css" media="projection" id="slideProj">
15−/* Do not edit or override these styles! The system will likely break if you do. */
16−
17−div#header, div#footer, div#controls, .slide {position: absolute;}
18−html>body div#header, html>body div#footer,
19− html>body div#controls, html>body .slide {position: fixed;}
20−.handout {display: none;}
21−.layout {display: block;}
22−.slide, .hideme, .incremental {visibility: hidden;}
23−#slide0 {visibility: visible;}
11+ /><script type="text/javascript">
12+/* ASCIIMathML.js - copyright Peter Jipsen, released under the GPL
13+See http://www1.chapman.edu/~jipsen/mathml/asciimath.html/ */
2414
25−/* The following styles size, place, and layer the slide components.
26− Edit these if you want to change the overall slide layout.
27− The commented lines can be uncommented (and modified, if necessary)
28− to help you with the rearrangement process. */
15+var checkForMathML = true; // check if browser can display MathML
16+var notifyIfNoMathML = true; // display note if no MathML capability
17+var alertIfNoMathML = false; // show alert box if no MathML capability
18+var mathcolor = ""; // change it to "" (to inherit) or any other color
19+var mathfontfamily = "serif"; // change to "" to inherit (works in IE)
20+ // or another family (e.g. "arial")
21+var displaystyle = true; // puts limits above and below large operators
22+var showasciiformulaonhover = true; // helps students learn ASCIIMath
23+var decimalsign = "."; // change to "," if you like, beware of `(1,2)`!
24+var AMdelimiter1 = "`", AMescape1 = "\\\\`"; // can use other characters
25+var AMdelimiter2 = "$", AMescape2 = "\\\\\\$", AMdelimiter2regexp = "\\$";
26+var doubleblankmathdelimiter = false; // if true, x+1 is equal to `x+1`
27+ // for IE this works only in <!-- -->
28+//var separatetokens;// has been removed (email me if this is a problem)
29+var isIE = document.createElementNS==null;
2930
30−/* target = 1024x768 */
31+if (document.getElementById==null)
32+ alert("This webpage requires a recent browser such as\
33+\nMozilla/Netscape 7+ or Internet Explorer 6+MathPlayer")
3134
32−div#header, div#footer, .slide {width: 100%; top: 0; left: 0;}
33−div#header {top: 0; height: 3em; z-index: 1;}
34−div#footer {top: auto; bottom: 0; height: 2.5em; z-index: 5;}
35−.slide {top: 0; width: 92%; padding: 3.5em 4% 4%; z-index: 2; list-style: none;}
36−div#controls {left: 50%; bottom: 0; width: 50%; z-index: 100;}
37−div#controls form {position: absolute; bottom: 0; right: 0; width: 100%;
38− margin: 0;}
39−#currentSlide {position: absolute; width: 10%; left: 45%; bottom: 1em; z-index: 10;}
40−html>body #currentSlide {position: fixed;}
35+// all further global variables start with "AM"
4136
42−/*
43−div#header {background: #FCC;}
44−div#footer {background: #CCF;}
45−div#controls {background: #BBD;}
46−div#currentSlide {background: #FFC;}
47−*/
37+function AMcreateElementXHTML(t) {
38+ if (isIE) return document.createElement(t);
39+ else return document.createElementNS("http://www.w3.org/1999/xhtml",t);
40+}
4841
49−/* Following are the presentation styles -- edit away! */
42+function AMnoMathMLNote() {
43+ var nd = AMcreateElementXHTML("h3");
44+ nd.setAttribute("align","center")
45+ nd.appendChild(AMcreateElementXHTML("p"));
46+ nd.appendChild(document.createTextNode("To view the "));
47+ var an = AMcreateElementXHTML("a");
48+ an.appendChild(document.createTextNode("ASCIIMathML"));
49+ an.setAttribute("href","http://www.chapman.edu/~jipsen/asciimath.html");
50+ nd.appendChild(an);
51+ nd.appendChild(document.createTextNode(" notation use Internet Explorer 6+"));
52+ an = AMcreateElementXHTML("a");
53+ an.appendChild(document.createTextNode("MathPlayer"));
54+ an.setAttribute("href","http://www.dessci.com/en/products/mathplayer/download.htm");
55+ nd.appendChild(an);
56+ nd.appendChild(document.createTextNode(" or Netscape/Mozilla/Firefox"));
57+ nd.appendChild(AMcreateElementXHTML("p"));
58+ return nd;
59+}
5060
51−body {background: #FFF url(bodybg.gif) -16px 0 no-repeat; color: #000; font-size: 2em;}
52−:link, :visited {text-decoration: none; color: #00C;}
53−#controls :active {color: #88A !important;}
54−#controls :focus {outline: 1px dotted #227;}
55−h1, h2, h3, h4 {font-size: 100%; margin: 0; padding: 0; font-weight: inherit;}
56−ul, pre {margin: 0; line-height: 1em;}
57−html, body {margin: 0; padding: 0;}
61+function AMisMathMLavailable() {
62+ var regex = /KHTML/; /* ASCIIMathML.js - copyright Peter Jipsen, released under the GPL
63+See http://www1.chapman.edu/~jipsen/mathml/asciimath.html/ */
64+ if (navigator.appName.slice(0,8)=="Netscape")
65+ if (navigator.appVersion.slice(0,1)>="5" && !regex.test(navigator.userAgent)) return null;
66+ else return AMnoMathMLNote();
67+ else if (navigator.appName.slice(0,9)=="Microsoft")
68+ try {
69+ var ActiveX = new ActiveXObject("MathPlayer.Factory.1");
70+ return null;
71+ } catch (e) {
72+ return AMnoMathMLNote();
73+ }
74+ else return AMnoMathMLNote();
75+}
5876
59−blockquote, q {font-style: italic;}
60−blockquote {padding: 0 2em 0.5em; margin: 0 1.5em 0.5em; text-align: center; font-size: 1em;}
61−blockquote p {margin: 0;}
62−blockquote i {font-style: normal;}
63−blockquote b {display: block; margin-top: 0.5em; font-weight: normal; font-size: smaller; font-style: normal;}
64−blockquote b i {font-style: italic;}
77+// character lists for Mozilla/Netscape fonts
78+var AMcal = [0xEF35,0x212C,0xEF36,0xEF37,0x2130,0x2131,0xEF38,0x210B,0x2110,0xEF39,0xEF3A,0x2112,0x2133,0xEF3B,0xEF3C,0xEF3D,0xEF3E,0x211B,0xEF3F,0xEF40,0xEF41,0xEF42,0xEF43,0xEF44,0xEF45,0xEF46];
79+var AMfrk = [0xEF5D,0xEF5E,0x212D,0xEF5F,0xEF60,0xEF61,0xEF62,0x210C,0x2111,0xEF63,0xEF64,0xEF65,0xEF66,0xEF67,0xEF68,0xEF69,0xEF6A,0x211C,0xEF6B,0xEF6C,0xEF6D,0xEF6E,0xEF6F,0xEF70,0xEF71,0x2128];
80+var AMbbb = [0xEF8C,0xEF8D,0x2102,0xEF8E,0xEF8F,0xEF90,0xEF91,0x210D,0xEF92,0xEF93,0xEF94,0xEF95,0xEF96,0x2115,0xEF97,0x2119,0x211A,0x211D,0xEF98,0xEF99,0xEF9A,0xEF9B,0xEF9C,0xEF9D,0xEF9E,0x2124];
6581
66−kbd {font-weight: bold; font-size: 1em;}
67−sup {font-size: smaller; line-height: 1px;}
82+var CONST = 0, UNARY = 1, BINARY = 2, INFIX = 3, LEFTBRACKET = 4,
83+ RIGHTBRACKET = 5, SPACE = 6, UNDEROVER = 7, DEFINITION = 8,
84+ LEFTRIGHT = 9, TEXT = 10; // token types
6885
69−.slide code {padding: 2px 0.25em; font-weight: bold; color: #533;}
70−.slide code.bad, code del {color: red;}
71−.slide code.old {color: silver;}
72−.slide pre {padding: 0; margin: 0.25em 0 0.5em 0.5em; color: #533; font-size: 90%;}
73−.slide pre code {display: block;}
74−.slide ul {margin-left: 5%; margin-right: 7%; list-style: disc;}
75−.slide li {margin-top: 0.75em; margin-right: 0;}
76−.slide ul ul {line-height: 1;}
77−.slide ul ul li {margin: .2em; font-size: 85%; list-style: square;}
78−.slide img.leader {display: block; margin: 0 auto;}
86+var AMsqrt = {input:"sqrt", tag:"msqrt", output:"sqrt", tex:null, ttype:UNARY},
87+ AMroot = {input:"root", tag:"mroot", output:"root", tex:null, ttype:BINARY},
88+ AMfrac = {input:"frac", tag:"mfrac", output:"/", tex:null, ttype:BINARY},
89+ AMdiv = {input:"/", tag:"mfrac", output:"/", tex:null, ttype:INFIX},
90+ AMover = {input:"stackrel", tag:"mover", output:"stackrel", tex:null, ttype:BINARY},
91+ AMsub = {input:"_", tag:"msub", output:"_", tex:null, ttype:INFIX},
92+ AMsup = {input:"^", tag:"msup", output:"^", tex:null, ttype:INFIX},
93+ AMtext = {input:"text", tag:"mtext", output:"text", tex:null, ttype:TEXT},
94+ AMmbox = {input:"mbox", tag:"mtext", output:"mbox", tex:null, ttype:TEXT},
95+ AMquote = {input:"\"", tag:"mtext", output:"mbox", tex:null, ttype:TEXT};
7996
80−div#header, div#footer {background: #005; color: #AAB;
81− font-family: Verdana, Helvetica, sans-serif;}
82−div#header {background: #005 url(bodybg.gif) -16px 0 no-repeat;
83− line-height: 1px;}
84−div#footer {font-size: 0.5em; font-weight: bold; padding: 1em 0;}
85−#footer h1, #footer h2 {display: block; padding: 0 1em;}
86−#footer h2 {font-style: italic;}
97+var AMsymbols = [
98+//some greek symbols
99+{input:"alpha", tag:"mi", output:"\u03B1", tex:null, ttype:CONST},
100+{input:"beta", tag:"mi", output:"\u03B2", tex:null, ttype:CONST},
101+{input:"chi", tag:"mi", output:"\u03C7", tex:null, ttype:CONST},
102+{input:"delta", tag:"mi", output:"\u03B4", tex:null, ttype:CONST},
103+{input:"Delta", tag:"mo", output:"\u0394", tex:null, ttype:CONST},
104+{input:"epsi", tag:"mi", output:"\u03B5", tex:"epsilon", ttype:CONST},
105+{input:"varepsilon", tag:"mi", output:"\u025B", tex:null, ttype:CONST},
106+{input:"eta", tag:"mi", output:"\u03B7", tex:null, ttype:CONST},
107+{input:"gamma", tag:"mi", output:"\u03B3", tex:null, ttype:CONST},
108+{input:"Gamma", tag:"mo", output:"\u0393", tex:null, ttype:CONST},
109+{input:"iota", tag:"mi", output:"\u03B9", tex:null, ttype:CONST},
110+{input:"kappa", tag:"mi", output:"\u03BA", tex:null, ttype:CONST},
111+{input:"lambda", tag:"mi", output:"\u03BB", tex:null, ttype:CONST},
112+{input:"Lambda", tag:"mo", output:"\u039B", tex:null, ttype:CONST},
113+{input:"mu", tag:"mi", output:"\u03BC", tex:null, ttype:CONST},
114+{input:"nu", tag:"mi", output:"\u03BD", tex:null, ttype:CONST},
115+{input:"omega", tag:"mi", output:"\u03C9", tex:null, ttype:CONST},
116+{input:"Omega", tag:"mo", output:"\u03A9", tex:null, ttype:CONST},
117+{input:"phi", tag:"mi", output:"\u03C6", tex:null, ttype:CONST},
118+{input:"varphi", tag:"mi", output:"\u03D5", tex:null, ttype:CONST},
119+{input:"Phi", tag:"mo", output:"\u03A6", tex:null, ttype:CONST},
120+{input:"pi", tag:"mi", output:"\u03C0", tex:null, ttype:CONST},
121+{input:"Pi", tag:"mo", output:"\u03A0", tex:null, ttype:CONST},
122+{input:"psi", tag:"mi", output:"\u03C8", tex:null, ttype:CONST},
123+{input:"Psi", tag:"mi", output:"\u03A8", tex:null, ttype:CONST},
124+{input:"rho", tag:"mi", output:"\u03C1", tex:null, ttype:CONST},
125+{input:"sigma", tag:"mi", output:"\u03C3", tex:null, ttype:CONST},
126+{input:"Sigma", tag:"mo", output:"\u03A3", tex:null, ttype:CONST},
127+{input:"tau", tag:"mi", output:"\u03C4", tex:null, ttype:CONST},
128+{input:"theta", tag:"mi", output:"\u03B8", tex:null, ttype:CONST},
129+{input:"vartheta", tag:"mi", output:"\u03D1", tex:null, ttype:CONST},
130+{input:"Theta", tag:"mo", output:"\u0398", tex:null, ttype:CONST},
131+{input:"upsilon", tag:"mi", output:"\u03C5", tex:null, ttype:CONST},
132+{input:"xi", tag:"mi", output:"\u03BE", tex:null, ttype:CONST},
133+{input:"Xi", tag:"mo", output:"\u039E", tex:null, ttype:CONST},
134+{input:"zeta", tag:"mi", output:"\u03B6", tex:null, ttype:CONST},
87135
88−div.long {font-size: 0.75em;}
89−.slide h1 {position: absolute; top: 0.7em; left: 87px; z-index: 1;
90− margin: 0; padding: 0.3em 0 0 50px; white-space: nowrap;
91− font: bold 150%/1em Helvetica, sans-serif; text-transform: capitalize;
92− color: #DDE; background: #005;}
93−.slide h3 {font-size: 130%;}
94−h1 abbr {font-variant: small-caps;}
136+//binary operation symbols
137+{input:"*", tag:"mo", output:"\u22C5", tex:"cdot", ttype:CONST},
138+{input:"**", tag:"mo", output:"\u22C6", tex:"star", ttype:CONST},
139+{input:"//", tag:"mo", output:"/", tex:null, ttype:CONST},
140+{input:"\\\\", tag:"mo", output:"\\", tex:"backslash", ttype:CONST},
141+{input:"setminus", tag:"mo", output:"\\", tex:null, ttype:CONST},
142+{input:"xx", tag:"mo", output:"\u00D7", tex:"times", ttype:CONST},
143+{input:"-:", tag:"mo", output:"\u00F7", tex:"divide", ttype:CONST},
144+{input:"@", tag:"mo", output:"\u2218", tex:"circ", ttype:CONST},
145+{input:"o+", tag:"mo", output:"\u2295", tex:"oplus", ttype:CONST},
146+{input:"ox", tag:"mo", output:"\u2297", tex:"otimes", ttype:CONST},
147+{input:"o.", tag:"mo", output:"\u2299", tex:"odot", ttype:CONST},
148+{input:"sum", tag:"mo", output:"\u2211", tex:null, ttype:UNDEROVER},
149+{input:"prod", tag:"mo", output:"\u220F", tex:null, ttype:UNDEROVER},
150+{input:"^^", tag:"mo", output:"\u2227", tex:"wedge", ttype:CONST},
151+{input:"^^^", tag:"mo", output:"\u22C0", tex:"bigwedge", ttype:UNDEROVER},
152+{input:"vv", tag:"mo", output:"\u2228", tex:"vee", ttype:CONST},
153+{input:"vvv", tag:"mo", output:"\u22C1", tex:"bigvee", ttype:UNDEROVER},
154+{input:"nn", tag:"mo", output:"\u2229", tex:"cap", ttype:CONST},
155+{input:"nnn", tag:"mo", output:"\u22C2", tex:"bigcap", ttype:UNDEROVER},
156+{input:"uu", tag:"mo", output:"\u222A", tex:"cup", ttype:CONST},
157+{input:"uuu", tag:"mo", output:"\u22C3", tex:"bigcup", ttype:UNDEROVER},
95158
96−div#controls {position: absolute; left: 50%; bottom: 0;
97− width: 50%;
98− text-align: right; font: bold 0.9em Verdana, Helvetica, sans-serif;}
99−html>body div#controls {position: fixed; padding: 0 0 1em 0;
100− top: auto;}
101−div#controls form {position: absolute; bottom: 0; right: 0; width: 100%;
102− margin: 0; padding: 0;}
103−#controls #navLinks a {padding: 0; margin: 0 0.5em;
104− background: #005; border: none; color: #779;
105− cursor: pointer;}
106−#controls #navList {height: 1em;}
107−#controls #navList #jumplist {position: absolute; bottom: 0; right: 0; background: #DDD; color: #227;}
159+//binary relation symbols
160+{input:"!=", tag:"mo", output:"\u2260", tex:"ne", ttype:CONST},
161+{input:":=", tag:"mo", output:":=", tex:null, ttype:CONST},
162+{input:"lt", tag:"mo", output:"<", tex:null, ttype:CONST},
163+{input:"<=", tag:"mo", output:"\u2264", tex:"le", ttype:CONST},
164+{input:"lt=", tag:"mo", output:"\u2264", tex:"leq", ttype:CONST},
165+{input:">=", tag:"mo", output:"\u2265", tex:"ge", ttype:CONST},
166+{input:"geq", tag:"mo", output:"\u2265", tex:null, ttype:CONST},
167+{input:"-<", tag:"mo", output:"\u227A", tex:"prec", ttype:CONST},
168+{input:"-lt", tag:"mo", output:"\u227A", tex:null, ttype:CONST},
169+{input:">-", tag:"mo", output:"\u227B", tex:"succ", ttype:CONST},
170+{input:"-<=", tag:"mo", output:"\u2AAF", tex:"preceq", ttype:CONST},
171+{input:">-=", tag:"mo", output:"\u2AB0", tex:"succeq", ttype:CONST},
172+{input:"in", tag:"mo", output:"\u2208", tex:null, ttype:CONST},
173+{input:"!in", tag:"mo", output:"\u2209", tex:"notin", ttype:CONST},
174+{input:"sub", tag:"mo", output:"\u2282", tex:"subset", ttype:CONST},
175+{input:"sup", tag:"mo", output:"\u2283", tex:"supset", ttype:CONST},
176+{input:"sube", tag:"mo", output:"\u2286", tex:"subseteq", ttype:CONST},
177+{input:"supe", tag:"mo", output:"\u2287", tex:"supseteq", ttype:CONST},
178+{input:"-=", tag:"mo", output:"\u2261", tex:"equiv", ttype:CONST},
179+{input:"~=", tag:"mo", output:"\u2245", tex:"cong", ttype:CONST},
180+{input:"~~", tag:"mo", output:"\u2248", tex:"approx", ttype:CONST},
181+{input:"prop", tag:"mo", output:"\u221D", tex:"propto", ttype:CONST},
108182
109−#currentSlide {text-align: center; font-size: 0.5em; color: #449;}
183+//logical symbols
184+{input:"and", tag:"mtext", output:"and", tex:null, ttype:SPACE},
185+{input:"or", tag:"mtext", output:"or", tex:null, ttype:SPACE},
186+{input:"not", tag:"mo", output:"\u00AC", tex:"neg", ttype:CONST},
187+{input:"=>", tag:"mo", output:"\u21D2", tex:"implies", ttype:CONST},
188+{input:"if", tag:"mo", output:"if", tex:null, ttype:SPACE},
189+{input:"<=>", tag:"mo", output:"\u21D4", tex:"iff", ttype:CONST},
190+{input:"AA", tag:"mo", output:"\u2200", tex:"forall", ttype:CONST},
191+{input:"EE", tag:"mo", output:"\u2203", tex:"exists", ttype:CONST},
192+{input:"_|_", tag:"mo", output:"\u22A5", tex:"bot", ttype:CONST},
193+{input:"TT", tag:"mo", output:"\u22A4", tex:"top", ttype:CONST},
194+{input:"|--", tag:"mo", output:"\u22A2", tex:"vdash", ttype:CONST},
195+{input:"|==", tag:"mo", output:"\u22A8", tex:"models", ttype:CONST},
110196
111−#slide0 {padding-top: 3.5em; font-size: 90%;}
112−#slide0 h1 {position: static; margin: 1em 0 0; padding: 0;
113− font: bold 2em Helvetica, sans-serif; white-space: normal;
114− color: #000; background: transparent;}
115−#slide0 h2 {font: bold italic 1em Helvetica, sans-serif; margin: 0.25em;}
116−#slide0 h3 {margin-top: 1.5em; font-size: 1.5em;}
117−#slide0 h4 {margin-top: 0; font-size: 1em;}
197+//grouping brackets
198+{input:"(", tag:"mo", output:"(", tex:null, ttype:LEFTBRACKET},
199+{input:")", tag:"mo", output:")", tex:null, ttype:RIGHTBRACKET},
200+{input:"[", tag:"mo", output:"[", tex:null, ttype:LEFTBRACKET},
201+{input:"]", tag:"mo", output:"]", tex:null, ttype:RIGHTBRACKET},
202+{input:"{", tag:"mo", output:"{", tex:null, ttype:LEFTBRACKET},
203+{input:"}", tag:"mo", output:"}", tex:null, ttype:RIGHTBRACKET},
204+{input:"|", tag:"mo", output:"|", tex:null, ttype:LEFTRIGHT},
205+//{input:"||", tag:"mo", output:"||", tex:null, ttype:LEFTRIGHT},
206+{input:"(:", tag:"mo", output:"\u2329", tex:"langle", ttype:LEFTBRACKET},
207+{input:":)", tag:"mo", output:"\u232A", tex:"rangle", ttype:RIGHTBRACKET},
208+{input:"<<", tag:"mo", output:"\u2329", tex:null, ttype:LEFTBRACKET},
209+{input:">>", tag:"mo", output:"\u232A", tex:null, ttype:RIGHTBRACKET},
210+{input:"{:", tag:"mo", output:"{:", tex:null, ttype:LEFTBRACKET, invisible:true},
211+{input:":}", tag:"mo", output:":}", tex:null, ttype:RIGHTBRACKET, invisible:true},
118212
119−ul.urls {list-style: none; display: inline; margin: 0;}
120−.urls li {display: inline; margin: 0;}
121−.note {display: none;}
122−.external {border-bottom: 1px dotted gray;}
123−html>body .external {border-bottom: none;}
124−.external:after {content: " \274F"; font-size: smaller; color: #77B;}
213+//miscellaneous symbols
214+{input:"int", tag:"mo", output:"\u222B", tex:null, ttype:CONST},
215+{input:"dx", tag:"mi", output:"{:d x:}", tex:null, ttype:DEFINITION},
216+{input:"dy", tag:"mi", output:"{:d y:}", tex:null, ttype:DEFINITION},
217+{input:"dz", tag:"mi", output:"{:d z:}", tex:null, ttype:DEFINITION},
218+{input:"dt", tag:"mi", output:"{:d t:}", tex:null, ttype:DEFINITION},
219+{input:"oint", tag:"mo", output:"\u222E", tex:null, ttype:CONST},
220+{input:"del", tag:"mo", output:"\u2202", tex:"partial", ttype:CONST},
221+{input:"grad", tag:"mo", output:"\u2207", tex:"nabla", ttype:CONST},
222+{input:"+-", tag:"mo", output:"\u00B1", tex:"pm", ttype:CONST},
223+{input:"O/", tag:"mo", output:"\u2205", tex:"emptyset", ttype:CONST},
224+{input:"oo", tag:"mo", output:"\u221E", tex:"infty", ttype:CONST},
225+{input:"aleph", tag:"mo", output:"\u2135", tex:null, ttype:CONST},
226+{input:"...", tag:"mo", output:"...", tex:"ldots", ttype:CONST},
227+{input:":.", tag:"mo", output:"\u2234", tex:"therefore", ttype:CONST},
228+{input:"/_", tag:"mo", output:"\u2220", tex:"angle", ttype:CONST},
229+{input:"\\ ", tag:"mo", output:"\u00A0", tex:null, ttype:CONST},
230+{input:"quad", tag:"mo", output:"\u00A0\u00A0", tex:null, ttype:CONST},
231+{input:"qquad", tag:"mo", output:"\u00A0\u00A0\u00A0\u00A0", tex:null, ttype:CONST},
232+{input:"cdots", tag:"mo", output:"\u22EF", tex:null, ttype:CONST},
233+{input:"vdots", tag:"mo", output:"\u22EE", tex:null, ttype:CONST},
234+{input:"ddots", tag:"mo", output:"\u22F1", tex:null, ttype:CONST},
235+{input:"diamond", tag:"mo", output:"\u22C4", tex:null, ttype:CONST},
236+{input:"square", tag:"mo", output:"\u25A1", tex:null, ttype:CONST},
237+{input:"|__", tag:"mo", output:"\u230A", tex:"lfloor", ttype:CONST},
238+{input:"__|", tag:"mo", output:"\u230B", tex:"rfloor", ttype:CONST},
239+{input:"|~", tag:"mo", output:"\u2308", tex:"lceiling", ttype:CONST},
240+{input:"~|", tag:"mo", output:"\u2309", tex:"rceiling", ttype:CONST},
241+{input:"CC", tag:"mo", output:"\u2102", tex:null, ttype:CONST},
242+{input:"NN", tag:"mo", output:"\u2115", tex:null, ttype:CONST},
243+{input:"QQ", tag:"mo", output:"\u211A", tex:null, ttype:CONST},
244+{input:"RR", tag:"mo", output:"\u211D", tex:null, ttype:CONST},
245+{input:"ZZ", tag:"mo", output:"\u2124", tex:null, ttype:CONST},
246+{input:"f", tag:"mi", output:"f", tex:null, ttype:UNARY, func:true},
247+{input:"g", tag:"mi", output:"g", tex:null, ttype:UNARY, func:true},
125248
126−.incremental, .incremental *, .incremental *:after {color: #DDE; visibility: visible;}
127−img.incremental {visibility: hidden;}
128−.slide .current {color: #B02;}
249+//standard functions
250+{input:"lim", tag:"mo", output:"lim", tex:null, ttype:UNDEROVER},
251+{input:"Lim", tag:"mo", output:"Lim", tex:null, ttype:UNDEROVER},
252+{input:"sin", tag:"mo", output:"sin", tex:null, ttype:UNARY, func:true},
253+{input:"cos", tag:"mo", output:"cos", tex:null, ttype:UNARY, func:true},
254+{input:"tan", tag:"mo", output:"tan", tex:null, ttype:UNARY, func:true},
255+{input:"sinh", tag:"mo", output:"sinh", tex:null, ttype:UNARY, func:true},
256+{input:"cosh", tag:"mo", output:"cosh", tex:null, ttype:UNARY, func:true},
257+{input:"tanh", tag:"mo", output:"tanh", tex:null, ttype:UNARY, func:true},
258+{input:"cot", tag:"mo", output:"cot", tex:null, ttype:UNARY, func:true},
259+{input:"sec", tag:"mo", output:"sec", tex:null, ttype:UNARY, func:true},
260+{input:"csc", tag:"mo", output:"csc", tex:null, ttype:UNARY, func:true},
261+{input:"log", tag:"mo", output:"log", tex:null, ttype:UNARY, func:true},
262+{input:"ln", tag:"mo", output:"ln", tex:null, ttype:UNARY, func:true},
263+{input:"det", tag:"mo", output:"det", tex:null, ttype:UNARY, func:true},
264+{input:"dim", tag:"mo", output:"dim", tex:null, ttype:CONST},
265+{input:"mod", tag:"mo", output:"mod", tex:null, ttype:CONST},
266+{input:"gcd", tag:"mo", output:"gcd", tex:null, ttype:UNARY, func:true},
267+{input:"lcm", tag:"mo", output:"lcm", tex:null, ttype:UNARY, func:true},
268+{input:"lub", tag:"mo", output:"lub", tex:null, ttype:CONST},
269+{input:"glb", tag:"mo", output:"glb", tex:null, ttype:CONST},
270+{input:"min", tag:"mo", output:"min", tex:null, ttype:UNDEROVER},
271+{input:"max", tag:"mo", output:"max", tex:null, ttype:UNDEROVER},
129272
273+//arrows
274+{input:"uarr", tag:"mo", output:"\u2191", tex:"uparrow", ttype:CONST},
275+{input:"darr", tag:"mo", output:"\u2193", tex:"downarrow", ttype:CONST},
276+{input:"rarr", tag:"mo", output:"\u2192", tex:"rightarrow", ttype:CONST},
277+{input:"->", tag:"mo", output:"\u2192", tex:"to", ttype:CONST},
278+{input:"|->", tag:"mo", output:"\u21A6", tex:"mapsto", ttype:CONST},
279+{input:"larr", tag:"mo", output:"\u2190", tex:"leftarrow", ttype:CONST},
280+{input:"harr", tag:"mo", output:"\u2194", tex:"leftrightarrow", ttype:CONST},
281+{input:"rArr", tag:"mo", output:"\u21D2", tex:"Rightarrow", ttype:CONST},
282+{input:"lArr", tag:"mo", output:"\u21D0", tex:"Leftarrow", ttype:CONST},
283+{input:"hArr", tag:"mo", output:"\u21D4", tex:"Leftrightarrow", ttype:CONST},
130284
131−/* diagnostics
285+//commands with argument
286+AMsqrt, AMroot, AMfrac, AMdiv, AMover, AMsub, AMsup,
287+{input:"hat", tag:"mover", output:"\u005E", tex:null, ttype:UNARY, acc:true},
288+{input:"bar", tag:"mover", output:"\u00AF", tex:"overline", ttype:UNARY, acc:true},
289+{input:"vec", tag:"mover", output:"\u2192", tex:null, ttype:UNARY, acc:true},
290+{input:"dot", tag:"mover", output:".", tex:null, ttype:UNARY, acc:true},
291+{input:"ddot", tag:"mover", output:"..", tex:null, ttype:UNARY, acc:true},
292+{input:"ul", tag:"munder", output:"\u0332", tex:"underline", ttype:UNARY, acc:true},
293+AMtext, AMmbox, AMquote,
294+{input:"bb", tag:"mstyle", atname:"fontweight", atval:"bold", output:"bb", tex:null, ttype:UNARY},
295+{input:"mathbf", tag:"mstyle", atname:"fontweight", atval:"bold", output:"mathbf", tex:null, ttype:UNARY},
296+{input:"sf", tag:"mstyle", atname:"fontfamily", atval:"sans-serif", output:"sf", tex:null, ttype:UNARY},
297+{input:"mathsf", tag:"mstyle", atname:"fontfamily", atval:"sans-serif", output:"mathsf", tex:null, ttype:UNARY},
298+{input:"bbb", tag:"mstyle", atname:"mathvariant", atval:"double-struck", output:"bbb", tex:null, ttype:UNARY, codes:AMbbb},
299+{input:"mathbb", tag:"mstyle", atname:"mathvariant", atval:"double-struck", output:"mathbb", tex:null, ttype:UNARY, codes:AMbbb},
300+{input:"cc", tag:"mstyle", atname:"mathvariant", atval:"script", output:"cc", tex:null, ttype:UNARY, codes:AMcal},
301+{input:"mathcal", tag:"mstyle", atname:"mathvariant", atval:"script", output:"mathcal", tex:null, ttype:UNARY, codes:AMcal},
302+{input:"tt", tag:"mstyle", atname:"fontfamily", atval:"monospace", output:"tt", tex:null, ttype:UNARY},
303+{input:"mathtt", tag:"mstyle", atname:"fontfamily", atval:"monospace", output:"mathtt", tex:null, ttype:UNARY},
304+{input:"fr", tag:"mstyle", atname:"mathvariant", atval:"fraktur", output:"fr", tex:null, ttype:UNARY, codes:AMfrk},
305+{input:"mathfrak", tag:"mstyle", atname:"mathvariant", atval:"fraktur", output:"mathfrak", tex:null, ttype:UNARY, codes:AMfrk}
306+];
132307
133−li:after {content: " [" attr(class) "]"; color: #F88;}
134− */
135−</style>
136−<style type="text/css" media="projection" id="operaFix">
137−/* DO NOT CHANGE THESE unless you really want to break Opera Show */
138−.slide {
139− visibility: visible !important;
140− position: static !important;
141− page-break-before: always;
308+function compareNames(s1,s2) {
309+ if (s1.input > s2.input) return 1
310+ else return -1;
142311}
143−#slide0 {page-break-before: avoid;}
144−
145−</style>
146−<style type="text/css" media="screen" id="outlineStyle">
147−/* don't change this unless you want the layout stuff to show up in the outline view! */
148−
149−.layout div, #footer *, #controlForm * {display: none;}
150−#footer, #controls, #controlForm, #navLinks, #toggle {
151− display: block; visibility: visible; margin: 0; padding: 0;}
152−#toggle {float: right; padding: 0.5em;}
153−html>body #toggle {position: fixed; top: 0; right: 0;}
154−
155−/* making the outline look pretty-ish */
156−
157−#slide0 h1, #slide0 h2, #slide0 h3, #slide0 h4 {border: none; margin: 0;}
158−#slide0 h1 {padding-top: 1.5em;}
159−.slide h1 {margin: 1.5em 0 0; padding-top: 0.25em;
160− border-top: 1px solid #888; border-bottom: 1px solid #AAA;}
161−#toggle {border: 1px solid; border-width: 0 0 1px 1px; background: #FFF;}
162−
163−</style>
164−<style type="text/css" media="print" id="slidePrint">
165−/* The following rule is necessary to have all slides appear in print! DO NOT REMOVE IT! */
166−.slide, ul {page-break-inside: avoid; visibility: visible !important;}
167−h1 {page-break-after: avoid;}
168312
169−body {font-size: 12pt; background: white;}
170−* {color: black;}
171−
172−#slide0 h1 {font-size: 200%; border: none; margin: 0.5em 0 0.25em;}
173−#slide0 h3 {margin: 0; padding: 0;}
174−#slide0 h4 {margin: 0 0 0.5em; padding: 0;}
175−#slide0 {margin-bottom: 3em;}
176−
177−h1 {border-top: 2pt solid gray; border-bottom: 1px dotted silver;}
178−.extra {background: transparent !important;}
179−div.extra, pre.extra, .example {font-size: 10pt; color: #333;}
180−ul.extra a {font-weight: bold;}
181−p.example {display: none;}
182−
183−#header {display: none;}
184−#footer h1 {margin: 0; border-bottom: 1px solid; color: gray; font-style: italic;}
185−#footer h2, #controls {display: none;}
186−
187−/* The following rule keeps the layout stuff out of print. Remove at your own risk! */
188−.layout, .layout * {display: none !important;}
189−
190−</style>
191−<script type="text/javascript">
192−// S5 v1.1 slides.js -- released into the Public Domain
193−//
194−// Please see http://www.meyerweb.com/eric/tools/s5/credits.html for information
195−// about all the wonderful and talented contributors to this code!
313+var AMnames = []; //list of input symbols
196314
197−var undef;
198−var slideCSS = '';
199−var snum = 0;
200−var smax = 1;
201−var incpos = 0;
202−var number = undef;
203−var s5mode = true;
204−var defaultView = 'slideshow';
205−var controlVis = 'visible';
315+function AMinitSymbols() {
316+ var texsymbols = [], i;
317+ for (i=0; i<AMsymbols.length; i++)
318+ if (AMsymbols[i].tex)
319+ texsymbols[texsymbols.length] = {input:AMsymbols[i].tex,
320+ tag:AMsymbols[i].tag, output:AMsymbols[i].output, ttype:AMsymbols[i].ttype};
321+ AMsymbols = AMsymbols.concat(texsymbols);
322+ AMsymbols.sort(compareNames);
323+ for (i=0; i<AMsymbols.length; i++) AMnames[i] = AMsymbols[i].input;
324+}
206325
207−var isIE = navigator.appName == 'Microsoft Internet Explorer' && navigator.userAgent.indexOf('Opera') < 1 ? 1 : 0;
208−var isOp = navigator.userAgent.indexOf('Opera') > -1 ? 1 : 0;
209−var isGe = navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('Safari') < 1 ? 1 : 0;
326+var AMmathml = "http://www.w3.org/1998/Math/MathML";
210327
211−function hasClass(object, className) {
212− if (!object.className) return false;
213− return (object.className.search('(^|\\s)' + className + '(\\s|$)') != -1);
328+function AMcreateElementMathML(t) {
329+ if (isIE) return document.createElement("m:"+t);
330+ else return document.createElementNS(AMmathml,t);
214331}
215332
216−function hasValue(object, value) {
217− if (!object) return false;
218− return (object.search('(^|\\s)' + value + '(\\s|$)') != -1);
333+function AMcreateMmlNode(t,frag) {
334+// var node = AMcreateElementMathML(name);
335+ if (isIE) var node = document.createElement("m:"+t);
336+ else var node = document.createElementNS(AMmathml,t);
337+ node.appendChild(frag);
338+ return node;
219339}
220340
221−function removeClass(object,className) {
222− if (!object) return;
223− object.className = object.className.replace(new RegExp('(^|\\s)'+className+'(\\s|$)'), RegExp.$1+RegExp.$2);
341+function newcommand(oldstr,newstr) {
342+ AMsymbols = AMsymbols.concat([{input:oldstr, tag:"mo", output:newstr,
343+ tex:null, ttype:DEFINITION}]);
224344}
225345
226−function addClass(object,className) {
227− if (!object || hasClass(object, className)) return;
228− if (object.className) {
229− object.className += ' '+className;
230− } else {
231− object.className = className;
232− }
346+function AMremoveCharsAndBlanks(str,n) {
347+//remove n characters and any following blanks
348+ var st;
349+ if (str.charAt(n)=="\\" && str.charAt(n+1)!="\\" && str.charAt(n+1)!=" ")
350+ st = str.slice(n+1);
351+ else st = str.slice(n);
352+ for (var i=0; i<st.length && st.charCodeAt(i)<=32; i=i+1);
353+ return st.slice(i);
233354}
234355
235−function GetElementsWithClassName(elementName,className) {
236− var allElements = document.getElementsByTagName(elementName);
237− var elemColl = new Array();
238− for (var i = 0; i< allElements.length; i++) {
239− if (hasClass(allElements[i], className)) {
240− elemColl[elemColl.length] = allElements[i];
241− }
242− }
243− return elemColl;
244−}
245−
246−function isParentOrSelf(element, id) {
247− if (element == null || element.nodeName=='BODY') return false;
248− else if (element.id == id) return true;
249− else return isParentOrSelf(element.parentNode, id);
250−}
251−
252−function nodeValue(node) {
253− var result = "";
254− if (node.nodeType == 1) {
255− var children = node.childNodes;
256− for (var i = 0; i < children.length; ++i) {
257− result += nodeValue(children[i]);
258− }
259− }
260− else if (node.nodeType == 3) {
261− result = node.nodeValue;
262− }
263− return(result);
264−}
265−
266−function slideLabel() {
267− var slideColl = GetElementsWithClassName('*','slide');
268− var list = document.getElementById('jumplist');
269− smax = slideColl.length;
270− for (var n = 0; n < smax; n++) {
271− var obj = slideColl[n];
272−
273− var did = 'slide' + n.toString();
274− obj.setAttribute('id',did);
275− if (isOp) continue;
276−
277− var otext = '';
278− var menu = obj.firstChild;
279− if (!menu) continue; // to cope with empty slides
280− while (menu && menu.nodeType == 3) {
281− menu = menu.nextSibling;
282− }
283− if (!menu) continue; // to cope with slides with only text nodes
284−
285− var menunodes = menu.childNodes;
286− for (var o = 0; o < menunodes.length; o++) {
287− otext += nodeValue(menunodes[o]);
288− }
289− list.options[list.length] = new Option(n + ' : ' + otext, n);
290− }
291−}
292−
293−function currentSlide() {
294− var cs;
295− if (document.getElementById) {
296− cs = document.getElementById('currentSlide');
297− } else {
298− cs = document.currentSlide;
299− }
300− cs.innerHTML = '<span id="csHere">' + snum + '<\/span> ' +
301− '<span id="csSep">\/<\/span> ' +
302− '<span id="csTotal">' + (smax-1) + '<\/span>';
303− if (snum == 0) {
304− cs.style.visibility = 'hidden';
305− } else {
306− cs.style.visibility = 'visible';
307− }
308−}
309−
310−function go(step) {
311− if (document.getElementById('slideProj').disabled || step == 0) return;
312− var jl = document.getElementById('jumplist');
313− var cid = 'slide' + snum;
314− var ce = document.getElementById(cid);
315− if (incrementals[snum].length > 0) {
316− for (var i = 0; i < incrementals[snum].length; i++) {
317− removeClass(incrementals[snum][i], 'current');
318− removeClass(incrementals[snum][i], 'incremental');
319− }
320− }
321− if (step != 'j') {
322− snum += step;
323− lmax = smax - 1;
324− if (snum > lmax) snum = lmax;
325− if (snum < 0) snum = 0;
326− } else
327− snum = parseInt(jl.value);
328− var nid = 'slide' + snum;
329− var ne = document.getElementById(nid);
330− if (!ne) {
331− ne = document.getElementById('slide0');
332− snum = 0;
333− }
334− if (step < 0) {incpos = incrementals[snum].length} else {incpos = 0;}
335− if (incrementals[snum].length > 0 && incpos == 0) {
336− for (var i = 0; i < incrementals[snum].length; i++) {
337− if (hasClass(incrementals[snum][i], 'current'))
338− incpos = i + 1;
339− else
340− addClass(incrementals[snum][i], 'incremental');
341− }
342− }
343− if (incrementals[snum].length > 0 && incpos > 0)
344− addClass(incrementals[snum][incpos - 1], 'current');
345− ce.style.visibility = 'hidden';
346− ne.style.visibility = 'visible';
347− jl.selectedIndex = snum;
348− currentSlide();
349− number = 0;
356+function AMposition(arr, str, n) {
357+// return position >=n where str appears or would be inserted
358+// assumes arr is sorted
359+ if (n==0) {
360+ var h,m;
361+ n = -1;
362+ h = arr.length;
363+ while (n+1<h) {
364+ m = (n+h) >> 1;
365+ if (arr[m]<str) n = m; else h = m;
366+ }
367+ return h;
368+ } else
369+ for (var i=n; i<arr.length && arr[i]<str; i++);
370+ return i; // i=arr.length || arr[i]>=str
350371}
351372
352−function goTo(target) {
353− if (target >= smax || target == snum) return;
354− go(target - snum);
373+function AMgetSymbol(str) {
374+//return maximal initial substring of str that appears in names
375+//return null if there is none
376+ var k = 0; //new pos
377+ var j = 0; //old pos
378+ var mk; //match pos
379+ var st;
380+ var tagst;
381+ var match = "";
382+ var more = true;
383+ for (var i=1; i<=str.length && more; i++) {
384+ st = str.slice(0,i); //initial substring of length i
385+ j = k;
386+ k = AMposition(AMnames, st, j);
387+ if (k<AMnames.length && str.slice(0,AMnames[k].length)==AMnames[k]){
388+ match = AMnames[k];
389+ mk = k;
390+ i = match.length;
391+ }
392+ more = k<AMnames.length && str.slice(0,AMnames[k].length)>=AMnames[k];
393+ }
394+ AMpreviousSymbol=AMcurrentSymbol;
395+ if (match!=""){
396+ AMcurrentSymbol=AMsymbols[mk].ttype;
397+ return AMsymbols[mk];
398+ }
399+// if str[0] is a digit or - return maxsubstring of digits.digits
400+ AMcurrentSymbol=CONST;
401+ k = 1;
402+ st = str.slice(0,1);
403+ var integ = true;
404+ while ("0"<=st && st<="9" && k<=str.length) {
405+ st = str.slice(k,k+1);
406+ k++;
407+ }
408+ if (st == decimalsign) {
409+ st = str.slice(k,k+1);
410+ if ("0"<=st && st<="9") {
411+ integ = false;
412+ k++;
413+ while ("0"<=st && st<="9" && k<=str.length) {
414+ st = str.slice(k,k+1);
415+ k++;
416+ }
417+ }
418+ }
419+ if ((integ && k>1) || k>2) {
420+ st = str.slice(0,k-1);
421+ tagst = "mn";
422+ } else {
423+ k = 2;
424+ st = str.slice(0,1); //take 1 character
425+ tagst = (("A">st || st>"Z") && ("a">st || st>"z")?"mo":"mi");
426+ }
427+ if (st=="-" && AMpreviousSymbol==INFIX) {
428+ AMcurrentSymbol = INFIX; //trick "/" into recognizing "-" on second parse
429+ return {input:st, tag:tagst, output:st, ttype:UNARY, func:true};
430+ }
431+ return {input:st, tag:tagst, output:st, ttype:CONST};
355432}
356433
357−function subgo(step) {
358− if (step > 0) {
359− removeClass(incrementals[snum][incpos - 1],'current');
360− removeClass(incrementals[snum][incpos], 'incremental');
361− addClass(incrementals[snum][incpos],'current');
362− incpos++;
363− } else {
364− incpos--;
365− removeClass(incrementals[snum][incpos],'current');
366− addClass(incrementals[snum][incpos], 'incremental');
367− addClass(incrementals[snum][incpos - 1],'current');
368− }
434+function AMremoveBrackets(node) {
435+ var st;
436+ if (node.nodeName=="mrow") {
437+ st = node.firstChild.firstChild.nodeValue;
438+ if (st=="(" || st=="[" || st=="{") node.removeChild(node.firstChild);
439+ }
440+ if (node.nodeName=="mrow") {
441+ st = node.lastChild.firstChild.nodeValue;
442+ if (st==")" || st=="]" || st=="}") node.removeChild(node.lastChild);
443+ }
369444}
370445
371−function toggle() {
372− var slideColl = GetElementsWithClassName('*','slide');
373− var slides = document.getElementById('slideProj');
374− var outline = document.getElementById('outlineStyle');
375− if (!slides.disabled) {
376− slides.disabled = true;
377− outline.disabled = false;
378− s5mode = false;
379− fontSize('1em');
380− for (var n = 0; n < smax; n++) {
381− var slide = slideColl[n];
382− slide.style.visibility = 'visible';
383− }
384− } else {
385− slides.disabled = false;
386− outline.disabled = true;
387− s5mode = true;
388− fontScale();
389− for (var n = 0; n < smax; n++) {
390− var slide = slideColl[n];
391− slide.style.visibility = 'hidden';
392− }
393− slideColl[snum].style.visibility = 'visible';
394− }
395−}
446+/* ASCIIMathML.js - copyright Peter Jipsen, released under the GPL
447+See http://www1.chapman.edu/~jipsen/mathml/asciimath.html/ */
396448
397−function showHide(action) {
398− var obj = GetElementsWithClassName('*','hideme')[0];
399− switch (action) {
400− case 's': obj.style.visibility = 'visible'; break;
401− case 'h': obj.style.visibility = 'hidden'; break;
402− case 'k':
403− if (obj.style.visibility != 'visible') {
404− obj.style.visibility = 'visible';
405− } else {
406− obj.style.visibility = 'hidden';
407− }
408− break;
409− }
410−}
449+var AMnestingDepth,AMpreviousSymbol,AMcurrentSymbol;
411450
412−// 'keys' code adapted from MozPoint (http://mozpoint.mozdev.org/)
413−function keys(key) {
414− if (!key) {
415− key = event;
416− key.which = key.keyCode;
417− }
418− if (key.which == 84) {
419− toggle();
420− return;
421− }
422− if (s5mode) {
423− switch (key.which) {
424− case 10: // return
425− case 13: // enter
426− if (window.event && isParentOrSelf(window.event.srcElement, 'controls')) return;
427− if (key.target && isParentOrSelf(key.target, 'controls')) return;
428− if(number != undef) {
429− goTo(number);
430− break;
431− }
432− case 32: // spacebar
433− case 34: // page down
434− case 39: // rightkey
435− case 40: // downkey
436− if(number != undef) {
437− go(number);
438− } else if (!incrementals[snum] || incpos >= incrementals[snum].length) {
439− go(1);
440− } else {
441− subgo(1);
442− }
443− break;
444− case 33: // page up
445− case 37: // leftkey
446− case 38: // upkey
447− if(number != undef) {
448− go(-1 * number);
449− } else if (!incrementals[snum] || incpos <= 0) {
450− go(-1);
451− } else {
452− subgo(-1);
453− }
454− break;
455− case 36: // home
456− goTo(0);
457− break;
458− case 35: // end
459− goTo(smax-1);
460− break;
461− case 67: // c
462− showHide('k');
463− break;
464− }
465− if (key.which < 48 || key.which > 57) {
466− number = undef;
467− } else {
468− if (window.event && isParentOrSelf(window.event.srcElement, 'controls')) return;
469− if (key.target && isParentOrSelf(key.target, 'controls')) return;
470− number = (((number != undef) ? number : 0) * 10) + (key.which - 48);
471− }
472− }
473− return false;
474−}
475−
476−function clicker(e) {
477− number = undef;
478− var target;
479− if (window.event) {
480− target = window.event.srcElement;
481− e = window.event;
482− } else target = e.target;
483− if (target.getAttribute('href') != null || hasValue(target.rel, 'external') || isParentOrSelf(target, 'controls') || isParentOrSelf(target,'embed') || isParentOrSelf(target,'object')) return true;
484− if (!e.which || e.which == 1) {
485− if (!incrementals[snum] || incpos >= incrementals[snum].length) {
486− go(1);
487− } else {
488− subgo(1);
489− }
490− }
491−}
492−
493−function findSlide(hash) {
494− var target = null;
495− var slides = GetElementsWithClassName('*','slide');
496− for (var i = 0; i < slides.length; i++) {
497− var targetSlide = slides[i];
498− if ( (targetSlide.name && targetSlide.name == hash)
499− || (targetSlide.id && targetSlide.id == hash) ) {
500− target = targetSlide;
501− break;
502− }
503− }
504− while(target != null && target.nodeName != 'BODY') {
505− if (hasClass(target, 'slide')) {
506− return parseInt(target.id.slice(5));
507− }
508− target = target.parentNode;
509− }
510− return null;
511−}
512−
513−function slideJump() {
514− if (window.location.hash == null) return;
515− var sregex = /^#slide(\d+)$/;
516− var matches = sregex.exec(window.location.hash);
517− var dest = null;
518− if (matches != null) {
519− dest = parseInt(matches[1]);
520− } else {
521− dest = findSlide(window.location.hash.slice(1));
522− }
523− if (dest != null)
524− go(dest - snum);
525−}
526−
527−function fixLinks() {
528− var thisUri = window.location.href;
529− thisUri = thisUri.slice(0, thisUri.length - window.location.hash.length);
530− var aelements = document.getElementsByTagName('A');
531− for (var i = 0; i < aelements.length; i++) {
532− var a = aelements[i].href;
533− var slideID = a.match('\#slide[0-9]{1,2}');
534− if ((slideID) && (slideID[0].slice(0,1) == '#')) {
535− var dest = findSlide(slideID[0].slice(1));
536− if (dest != null) {
537− if (aelements[i].addEventListener) {
538− aelements[i].addEventListener("click", new Function("e",
539− "if (document.getElementById('slideProj').disabled) return;" +
540− "go("+dest+" - snum); " +
541− "if (e.preventDefault) e.preventDefault();"), true);
542− } else if (aelements[i].attachEvent) {
543− aelements[i].attachEvent("onclick", new Function("",
544− "if (document.getElementById('slideProj').disabled) return;" +
545− "go("+dest+" - snum); " +
546− "event.returnValue = false;"));
547− }
548− }
549− }
550− }
551−}
552−
553−function externalLinks() {
554− if (!document.getElementsByTagName) return;
555− var anchors = document.getElementsByTagName('a');
556− for (var i=0; i<anchors.length; i++) {
557− var anchor = anchors[i];
558− if (anchor.getAttribute('href') && hasValue(anchor.rel, 'external')) {
559− anchor.target = '_blank';
560− addClass(anchor,'external');
561− }
562− }
451+function AMparseSexpr(str) { //parses str and returns [node,tailstr]
452+ var symbol, node, result, i, st,// rightvert = false,
453+ newFrag = document.createDocumentFragment();
454+ str = AMremoveCharsAndBlanks(str,0);
455+ symbol = AMgetSymbol(str); //either a token or a bracket or empty
456+ if (symbol == null || symbol.ttype == RIGHTBRACKET && AMnestingDepth > 0) {
457+ return [null,str];
458+ }
459+ if (symbol.ttype == DEFINITION) {
460+ str = symbol.output+AMremoveCharsAndBlanks(str,symbol.input.length);
461+ symbol = AMgetSymbol(str);
462+ }
463+ switch (symbol.ttype) {
464+ case UNDEROVER:
465+ case CONST:
466+ str = AMremoveCharsAndBlanks(str,symbol.input.length);
467+ return [AMcreateMmlNode(symbol.tag, //its a constant
468+ document.createTextNode(symbol.output)),str];
469+ case LEFTBRACKET: //read (expr+)
470+ AMnestingDepth++;
471+ str = AMremoveCharsAndBlanks(str,symbol.input.length);
472+ result = AMparseExpr(str,true);
473+ AMnestingDepth--;
474+ if (typeof symbol.invisible == "boolean" && symbol.invisible)
475+ node = AMcreateMmlNode("mrow",result[0]);
476+ else {
477+ node = AMcreateMmlNode("mo",document.createTextNode(symbol.output));
478+ node = AMcreateMmlNode("mrow",node);
479+ node.appendChild(result[0]);
480+ }
481+ return [node,result[1]];
482+ case TEXT:
483+ if (symbol!=AMquote) str = AMremoveCharsAndBlanks(str,symbol.input.length);
484+ if (str.charAt(0)=="{") i=str.indexOf("}");
485+ else if (str.charAt(0)=="(") i=str.indexOf(")");
486+ else if (str.charAt(0)=="[") i=str.indexOf("]");
487+ else if (symbol==AMquote) i=str.slice(1).indexOf("\"")+1;
488+ else i = 0;
489+ if (i==-1) i = str.length;
490+ st = str.slice(1,i);
491+ if (st.charAt(0) == " ") {
492+ node = AMcreateElementMathML("mspace");
493+ node.setAttribute("width","1ex");
494+ newFrag.appendChild(node);
495+ }
496+ newFrag.appendChild(
497+ AMcreateMmlNode(symbol.tag,document.createTextNode(st)));
498+ if (st.charAt(st.length-1) == " ") {
499+ node = AMcreateElementMathML("mspace");
500+ node.setAttribute("width","1ex");
501+ newFrag.appendChild(node);
502+ }
503+ str = AMremoveCharsAndBlanks(str,i+1);
504+ return [AMcreateMmlNode("mrow",newFrag),str];
505+ case UNARY:
506+ str = AMremoveCharsAndBlanks(str,symbol.input.length);
507+ result = AMparseSexpr(str);
508+ if (result[0]==null) return [AMcreateMmlNode(symbol.tag,
509+ document.createTextNode(symbol.output)),str];
510+ if (typeof symbol.func == "boolean" && symbol.func) { // functions hack
511+ st = str.charAt(0);
512+ if (st=="^" || st=="_" || st=="/" || st=="|" || st==",") {
513+ return [AMcreateMmlNode(symbol.tag,
514+ document.createTextNode(symbol.output)),str];
515+ } else {
516+ node = AMcreateMmlNode("mrow",
517+ AMcreateMmlNode(symbol.tag,document.createTextNode(symbol.output)));
518+ node.appendChild(result[0]);
519+ return [node,result[1]];
520+ }
521+ }
522+ AMremoveBrackets(result[0]);
523+ if (symbol.input == "sqrt") { // sqrt
524+ return [AMcreateMmlNode(symbol.tag,result[0]),result[1]];
525+ } else if (typeof symbol.acc == "boolean" && symbol.acc) { // accent
526+ node = AMcreateMmlNode(symbol.tag,result[0]);
527+ node.appendChild(AMcreateMmlNode("mo",document.createTextNode(symbol.output)));
528+ return [node,result[1]];
529+ } else { // font change command
530+ if (!isIE && typeof symbol.codes != "undefined") {
531+ for (i=0; i<result[0].childNodes.length; i++)
532+ if (result[0].childNodes[i].nodeName=="mi" || result[0].nodeName=="mi") {
533+ st = (result[0].nodeName=="mi"?result[0].firstChild.nodeValue:
534+ result[0].childNodes[i].firstChild.nodeValue);
535+ var newst = [];
536+ for (var j=0; j<st.length; j++)
537+ if (st.charCodeAt(j)>64 && st.charCodeAt(j)<91) newst = newst +
538+ String.fromCharCode(symbol.codes[st.charCodeAt(j)-65]);
539+ else newst = newst + st.charAt(j);
540+ if (result[0].nodeName=="mi")
541+ result[0]=AMcreateElementMathML("mo").
542+ appendChild(document.createTextNode(newst));
543+ else result[0].replaceChild(AMcreateElementMathML("mo").
544+ appendChild(document.createTextNode(newst)),result[0].childNodes[i]);
545+ }
546+ }
547+ node = AMcreateMmlNode(symbol.tag,result[0]);
548+ node.setAttribute(symbol.atname,symbol.atval);
549+ return [node,result[1]];
550+ }
551+ case BINARY:
552+ str = AMremoveCharsAndBlanks(str,symbol.input.length);
553+ result = AMparseSexpr(str);
554+ if (result[0]==null) return [AMcreateMmlNode("mo",
555+ document.createTextNode(symbol.input)),str];
556+ AMremoveBrackets(result[0]);
557+ var result2 = AMparseSexpr(result[1]);
558+ if (result2[0]==null) return [AMcreateMmlNode("mo",
559+ document.createTextNode(symbol.input)),str];
560+ AMremoveBrackets(result2[0]);
561+ if (symbol.input=="root" || symbol.input=="stackrel")
562+ newFrag.appendChild(result2[0]);
563+ newFrag.appendChild(result[0]);
564+ if (symbol.input=="frac") newFrag.appendChild(result2[0]);
565+ return [AMcreateMmlNode(symbol.tag,newFrag),result2[1]];
566+ case INFIX:
567+ str = AMremoveCharsAndBlanks(str,symbol.input.length);
568+ return [AMcreateMmlNode("mo",document.createTextNode(symbol.output)),str];
569+ case SPACE:
570+ str = AMremoveCharsAndBlanks(str,symbol.input.length);
571+ node = AMcreateElementMathML("mspace");
572+ node.setAttribute("width","1ex");
573+ newFrag.appendChild(node);
574+ newFrag.appendChild(
575+ AMcreateMmlNode(symbol.tag,document.createTextNode(symbol.output)));
576+ node = AMcreateElementMathML("mspace");
577+ node.setAttribute("width","1ex");
578+ newFrag.appendChild(node);
579+ return [AMcreateMmlNode("mrow",newFrag),str];
580+ case LEFTRIGHT:
581+// if (rightvert) return [null,str]; else rightvert = true;
582+ AMnestingDepth++;
583+ str = AMremoveCharsAndBlanks(str,symbol.input.length);
584+ result = AMparseExpr(str,false);
585+ AMnestingDepth--;
586+ var st = "";
587+ if (result[0].lastChild!=null)
588+ st = result[0].lastChild.firstChild.nodeValue;
589+ if (st == "|") { // its an absolute value subterm
590+ node = AMcreateMmlNode("mo",document.createTextNode(symbol.output));
591+ node = AMcreateMmlNode("mrow",node);
592+ node.appendChild(result[0]);
593+ return [node,result[1]];
594+ } else { // the "|" is a \mid
595+ node = AMcreateMmlNode("mo",document.createTextNode(symbol.output));
596+ node = AMcreateMmlNode("mrow",node);
597+ return [node,str];
598+ }
599+ default:
600+//alert("default");
601+ str = AMremoveCharsAndBlanks(str,symbol.input.length);
602+ return [AMcreateMmlNode(symbol.tag, //its a constant
603+ document.createTextNode(symbol.output)),str];
604+ }
563605}
564606
565−function createControls() {
566− var controlsDiv = document.getElementById("controls");
567− if (!controlsDiv) return;
568− var hider = ' onmouseover="showHide(\'s\');" onmouseout="showHide(\'h\');"';
569− var hideDiv, hideList = '';
570− if (controlVis == 'hidden') {
571− hideDiv = hider;
572− } else {
573− hideList = hider;
574− }
575− controlsDiv.innerHTML = '<form action="#" id="controlForm"' + hideDiv + '>' +
576− '<div id="navLinks">' +
577− '<a accesskey="t" id="toggle" href="javascript:toggle();">&#216;<\/a>' +
578− '<a accesskey="z" id="prev" href="javascript:go(-1);">&laquo;<\/a>' +
579− '<a accesskey="x" id="next" href="javascript:go(1);">&raquo;<\/a>' +
580− '<div id="navList"' + hideList + '><select id="jumplist" onchange="go(\'j\');"><\/select><\/div>' +
581− '<\/div><\/form>';
582− if (controlVis == 'hidden') {
583− var hidden = document.getElementById('navLinks');
584− } else {
585− var hidden = document.getElementById('jumplist');
586− }
587− addClass(hidden,'hideme');
607+function AMparseIexpr(str) {
608+ var symbol, sym1, sym2, node, result, underover;
609+ str = AMremoveCharsAndBlanks(str,0);
610+ sym1 = AMgetSymbol(str);
611+ result = AMparseSexpr(str);
612+ node = result[0];
613+ str = result[1];
614+ symbol = AMgetSymbol(str);
615+ if (symbol.ttype == INFIX && symbol.input != "/") {
616+ str = AMremoveCharsAndBlanks(str,symbol.input.length);
617+// if (symbol.input == "/") result = AMparseIexpr(str); else ...
618+ result = AMparseSexpr(str);
619+ if (result[0] == null) // show box in place of missing argument
620+ result[0] = AMcreateMmlNode("mo",document.createTextNode("\u25A1"));
621+ else AMremoveBrackets(result[0]);
622+ str = result[1];
623+// if (symbol.input == "/") AMremoveBrackets(node);
624+ if (symbol.input == "_") {
625+ sym2 = AMgetSymbol(str);
626+ underover = (sym1.ttype == UNDEROVER);
627+ if (sym2.input == "^") {
628+ str = AMremoveCharsAndBlanks(str,sym2.input.length);
629+ var res2 = AMparseSexpr(str);
630+ AMremoveBrackets(res2[0]);
631+ str = res2[1];
632+ node = AMcreateMmlNode((underover?"munderover":"msubsup"),node);
633+ node.appendChild(result[0]);
634+ node.appendChild(res2[0]);
635+ node = AMcreateMmlNode("mrow",node); // so sum does not stretch
636+ } else {
637+ node = AMcreateMmlNode((underover?"munder":"msub"),node);
638+ node.appendChild(result[0]);
639+ }
640+ } else {
641+ node = AMcreateMmlNode(symbol.tag,node);
642+ node.appendChild(result[0]);
643+ }
644+ }
645+ return [node,str];
588646}
589647
590−function fontScale() { // causes layout problems in FireFox that get fixed if browser's Reload is used; same may be true of other Gecko-based browsers
591− if (!s5mode) return false;
592− var vScale = 22; // both yield 32 (after rounding) at 1024x768
593− var hScale = 32; // perhaps should auto-calculate based on theme's declared value?
594− if (window.innerHeight) {
595− var vSize = window.innerHeight;
596− var hSize = window.innerWidth;
597− } else if (document.documentElement.clientHeight) {
598− var vSize = document.documentElement.clientHeight;
599− var hSize = document.documentElement.clientWidth;
600− } else if (document.body.clientHeight) {
601− var vSize = document.body.clientHeight;
602− var hSize = document.body.clientWidth;
603− } else {
604− var vSize = 700; // assuming 1024x768, minus chrome and such
605− var hSize = 1024; // these do not account for kiosk mode or Opera Show
606− }
607− var newSize = Math.min(Math.round(vSize/vScale),Math.round(hSize/hScale));
608− fontSize(newSize + 'px');
609− if (isGe) { // hack to counter incremental reflow bugs
610− var obj = document.getElementsByTagName('body')[0];
611− obj.style.display = 'none';
612− obj.style.display = 'block';
613− }
648+function AMparseExpr(str,rightbracket) {
649+ var symbol, node, result, i, nodeList = [],
650+ newFrag = document.createDocumentFragment();
651+ do {
652+ str = AMremoveCharsAndBlanks(str,0);
653+ result = AMparseIexpr(str);
654+ node = result[0];
655+ str = result[1];
656+ symbol = AMgetSymbol(str);
657+ if (symbol.ttype == INFIX && symbol.input == "/") {
658+ str = AMremoveCharsAndBlanks(str,symbol.input.length);
659+ result = AMparseIexpr(str);
660+ if (result[0] == null) // show box in place of missing argument
661+ result[0] = AMcreateMmlNode("mo",document.createTextNode("\u25A1"));
662+ else AMremoveBrackets(result[0]);
663+ str = result[1];
664+ AMremoveBrackets(node);
665+ node = AMcreateMmlNode(symbol.tag,node);
666+ node.appendChild(result[0]);
667+ newFrag.appendChild(node);
668+ symbol = AMgetSymbol(str);
669+ }
670+ else if (node!=undefined) newFrag.appendChild(node);
671+ } while ((symbol.ttype != RIGHTBRACKET &&
672+ (symbol.ttype != LEFTRIGHT || rightbracket)
673+ || AMnestingDepth == 0) && symbol!=null && symbol.output!="");
674+ if (symbol.ttype == RIGHTBRACKET || symbol.ttype == LEFTRIGHT) {
675+// if (AMnestingDepth > 0) AMnestingDepth--;
676+ var len = newFrag.childNodes.length;
677+ if (len>0 && newFrag.childNodes[len-1].nodeName == "mrow" && len>1 &&
678+ newFrag.childNodes[len-2].nodeName == "mo" &&
679+ newFrag.childNodes[len-2].firstChild.nodeValue == ",") { //matrix
680+ var right = newFrag.childNodes[len-1].lastChild.firstChild.nodeValue;
681+ if (right==")" || right=="]") {
682+ var left = newFrag.childNodes[len-1].firstChild.firstChild.nodeValue;
683+ if (left=="(" && right==")" && symbol.output != "}" ||
684+ left=="[" && right=="]") {
685+ var pos = []; // positions of commas
686+ var matrix = true;
687+ var m = newFrag.childNodes.length;
688+ for (i=0; matrix && i<m; i=i+2) {
689+ pos[i] = [];
690+ node = newFrag.childNodes[i];
691+ if (matrix) matrix = node.nodeName=="mrow" &&
692+ (i==m-1 || node.nextSibling.nodeName=="mo" &&
693+ node.nextSibling.firstChild.nodeValue==",")&&
694+ node.firstChild.firstChild.nodeValue==left &&
695+ node.lastChild.firstChild.nodeValue==right;
696+ if (matrix)
697+ for (var j=0; j<node.childNodes.length; j++)
698+ if (node.childNodes[j].firstChild.nodeValue==",")
699+ pos[i][pos[i].length]=j;
700+ if (matrix && i>1) matrix = pos[i].length == pos[i-2].length;
701+ }
702+ if (matrix) {
703+ var row, frag, n, k, table = document.createDocumentFragment();
704+ for (i=0; i<m; i=i+2) {
705+ row = document.createDocumentFragment();
706+ frag = document.createDocumentFragment();
707+ node = newFrag.firstChild; // <mrow>(-,-,...,-,-)</mrow>
708+ n = node.childNodes.length;
709+ k = 0;
710+ node.removeChild(node.firstChild); //remove (
711+ for (j=1; j<n-1; j++) {
712+ if (typeof pos[i][k] != "undefined" && j==pos[i][k]){
713+ node.removeChild(node.firstChild); //remove ,
714+ row.appendChild(AMcreateMmlNode("mtd",frag));
715+ k++;
716+ } else frag.appendChild(node.firstChild);
717+ }
718+ row.appendChild(AMcreateMmlNode("mtd",frag));
719+ if (newFrag.childNodes.length>2) {
720+ newFrag.removeChild(newFrag.firstChild); //remove <mrow>)</mrow>
721+ newFrag.removeChild(newFrag.firstChild); //remove <mo>,</mo>
722+ }
723+ table.appendChild(AMcreateMmlNode("mtr",row));
724+ }
725+ node = AMcreateMmlNode("mtable",table);
726+ if (typeof symbol.invisible == "boolean" && symbol.invisible) node.setAttribute("columnalign","left");
727+ newFrag.replaceChild(node,newFrag.firstChild);
728+ }
729+ }
730+ }
731+ }
732+ str = AMremoveCharsAndBlanks(str,symbol.input.length);
733+ if (typeof symbol.invisible != "boolean" || !symbol.invisible) {
734+ node = AMcreateMmlNode("mo",document.createTextNode(symbol.output));
735+ newFrag.appendChild(node);
736+ }
737+ }
738+ return [newFrag,str];
614739}
615740
616−function fontSize(value) {
617− if (!(s5ss = document.getElementById('s5ss'))) {
618− if (!isIE) {
619− document.getElementsByTagName('head')[0].appendChild(s5ss = document.createElement('style'));
620− s5ss.setAttribute('media','screen, projection');
621− s5ss.setAttribute('id','s5ss');
622− } else {
623− document.createStyleSheet();
624− document.s5ss = document.styleSheets[document.styleSheets.length - 1];
625− }
626− }
627− if (!isIE) {
628− while (s5ss.lastChild) s5ss.removeChild(s5ss.lastChild);
629− s5ss.appendChild(document.createTextNode('body {font-size: ' + value + ' !important;}'));
630− } else {
631− document.s5ss.addRule('body','font-size: ' + value + ' !important;');
632− }
741+function AMparseMath(str) {
742+ var result, node = AMcreateElementMathML("mstyle");
743+ if (mathcolor != "") node.setAttribute("mathcolor",mathcolor);
744+ if (displaystyle) node.setAttribute("displaystyle","true");
745+ if (mathfontfamily != "") node.setAttribute("fontfamily",mathfontfamily);
746+ AMnestingDepth = 0;
747+ node.appendChild(AMparseExpr(str.replace(/^\s+/g,""),false)[0]);
748+ node = AMcreateMmlNode("math",node);
749+ if (showasciiformulaonhover) //fixed by djhsu so newline
750+ node.setAttribute("title",str.replace(/\s+/g," "));//does not show in Gecko
751+ if (mathfontfamily != "" && (isIE || mathfontfamily != "serif")) {
752+ var fnode = AMcreateElementXHTML("font");
753+ fnode.setAttribute("face",mathfontfamily);
754+ fnode.appendChild(node);
755+ return fnode;
756+ }
757+ return node;
633758}
634759
635−function notOperaFix() {
636− slideCSS = document.getElementById('slideProj').href;
637− var slides = document.getElementById('slideProj');
638− var outline = document.getElementById('outlineStyle');
639− slides.setAttribute('media','screen');
640− outline.disabled = true;
641− if (isGe) {
642− slides.setAttribute('href','null'); // Gecko fix
643− slides.setAttribute('href',slideCSS); // Gecko fix
644− }
645− if (isIE && document.styleSheets && document.styleSheets[0]) {
646− document.styleSheets[0].addRule('img', 'behavior: url(ui/default/iepngfix.htc)');
647− document.styleSheets[0].addRule('div', 'behavior: url(ui/default/iepngfix.htc)');
648− document.styleSheets[0].addRule('.slide', 'behavior: url(ui/default/iepngfix.htc)');
649− }
760+function AMstrarr2docFrag(arr, linebreaks) {
761+ var newFrag=document.createDocumentFragment();
762+ var expr = false;
763+ for (var i=0; i<arr.length; i++) {
764+ if (expr) newFrag.appendChild(AMparseMath(arr[i]));
765+ else {
766+ var arri = (linebreaks ? arr[i].split("\n\n") : [arr[i]]);
767+ newFrag.appendChild(AMcreateElementXHTML("span").
768+ appendChild(document.createTextNode(arri[0])));
769+ for (var j=1; j<arri.length; j++) {
770+ newFrag.appendChild(AMcreateElementXHTML("p"));
771+ newFrag.appendChild(AMcreateElementXHTML("span").
772+ appendChild(document.createTextNode(arri[j])));
773+ }
774+ }
775+ expr = !expr;
776+ }
777+ return newFrag;
650778}
651779
652−function getIncrementals(obj) {
653− var incrementals = new Array();
654− if (!obj)
655− return incrementals;
656− var children = obj.childNodes;
657− for (var i = 0; i < children.length; i++) {
658− var child = children[i];
659− if (hasClass(child, 'incremental')) {
660− if (child.nodeName == 'OL' || child.nodeName == 'UL') {
661− removeClass(child, 'incremental');
662− for (var j = 0; j < child.childNodes.length; j++) {
663− if (child.childNodes[j].nodeType == 1) {
664− addClass(child.childNodes[j], 'incremental');
665− }
666− }
667− } else {
668− incrementals[incrementals.length] = child;
669− removeClass(child,'incremental');
670− }
671− }
672− if (hasClass(child, 'show-first')) {
673− if (child.nodeName == 'OL' || child.nodeName == 'UL') {
674− removeClass(child, 'show-first');
675− if (child.childNodes[isGe].nodeType == 1) {
676− removeClass(child.childNodes[isGe], 'incremental');
677− }
678− } else {
679− incrementals[incrementals.length] = child;
680− }
681− }
682− incrementals = incrementals.concat(getIncrementals(child));
683− }
684− return incrementals;
780+function AMprocessNodeR(n, linebreaks) {
781+ var mtch, str, arr, frg, i;
782+ if (n.childNodes.length == 0) {
783+ if ((n.nodeType!=8 || linebreaks) &&
784+ n.parentNode.nodeName!="form" && n.parentNode.nodeName!="FORM" &&
785+ n.parentNode.nodeName!="textarea" && n.parentNode.nodeName!="TEXTAREA" &&
786+ n.parentNode.nodeName!="code" && n.parentNode.nodeName!="CODE" && /* ASCIIMathML.js - copyright Peter Jipsen, released under the GPL
787+See http://www1.chapman.edu/~jipsen/mathml/asciimath.html/ */
788+ n.parentNode.nodeName!="pre" && n.parentNode.nodeName!="PRE") {
789+ str = n.nodeValue;
790+ if (!(str == null)) {
791+ str = str.replace(/\r\n\r\n/g,"\n\n");
792+ if (doubleblankmathdelimiter) {
793+ str = str.replace(/\x20\x20\./g," "+AMdelimiter1+".");
794+ str = str.replace(/\x20\x20,/g," "+AMdelimiter1+",");
795+ str = str.replace(/\x20\x20/g," "+AMdelimiter1+" ");
796+ }
797+ str = str.replace(/\x20+/g," ");
798+ str = str.replace(/\s*\r\n/g," ");
799+ mtch = false;
800+ str = str.replace(new RegExp(AMescape2, "g"),
801+ function(st){mtch=true;return "AMescape2"});
802+ str = str.replace(new RegExp(AMescape1, "g"),
803+ function(st){mtch=true;return "AMescape1"});
804+ str = str.replace(new RegExp(AMdelimiter2regexp, "g"),AMdelimiter1);
805+ arr = str.split(AMdelimiter1);
806+ for (i=0; i<arr.length; i++)
807+ arr[i]=arr[i].replace(/AMescape2/g,AMdelimiter2).
808+ replace(/AMescape1/g,AMdelimiter1);
809+ if (arr.length>1 || mtch) {
810+ if (checkForMathML) {
811+ checkForMathML = false;
812+ var nd = AMisMathMLavailable();
813+ AMnoMathML = nd != null;
814+ if (AMnoMathML && notifyIfNoMathML)
815+ if (alertIfNoMathML)
816+ alert("To view the ASCIIMathML notation use Internet Explorer 6 +\nMathPlayer (free from www.dessci.com)\n\
817+ or Firefox/Mozilla/Netscape");
818+ else AMbody.insertBefore(nd,AMbody.childNodes[0]);
819+ }
820+ if (!AMnoMathML) {
821+ frg = AMstrarr2docFrag(arr,n.nodeType==8);
822+ var len = frg.childNodes.length;
823+ n.parentNode.replaceChild(frg,n);
824+ return len-1;
825+ } else return 0;
826+ }
827+ }
828+ } else return 0;
829+ } else if (n.nodeName!="math") {
830+ for (i=0; i<n.childNodes.length; i++)
831+ i += AMprocessNodeR(n.childNodes[i], linebreaks);
832+ }
833+ return 0;
685834}
686835
687−function createIncrementals() {
688− var incrementals = new Array();
689− for (var i = 0; i < smax; i++) {
690− incrementals[i] = getIncrementals(document.getElementById('slide'+i));
691− }
692− return incrementals;
836+function AMprocessNode(n, linebreaks, spanclassAM) {
837+ var frag,st;
838+ if (spanclassAM!=null) {
839+ frag = document.getElementsByTagName("span")
840+ for (var i=0;i<frag.length;i++)
841+ if (frag[i].className == "AM")
842+ AMprocessNodeR(frag[i],linebreaks);
843+ } else {
844+ try {
845+ st = n.innerHTML;
846+ } catch(err) {}
847+ if (st==null ||
848+ st.indexOf(AMdelimiter1)!=-1 || st.indexOf(AMdelimiter2)!=-1)
849+ AMprocessNodeR(n,linebreaks);
850+ }
851+ if (isIE) { //needed to match size and font of formula to surrounding text
852+ frag = document.getElementsByTagName('math');
853+ for (var i=0;i<frag.length;i++) frag[i].update()
854+ }
693855}
694856
695−function defaultCheck() {
696− var allMetas = document.getElementsByTagName('meta');
697− for (var i = 0; i< allMetas.length; i++) {
698− if (allMetas[i].name == 'defaultView') {
699− defaultView = allMetas[i].content;
700− }
701− if (allMetas[i].name == 'controlVis') {
702− controlVis = allMetas[i].content;
703− }
704− }
857+var AMbody;
858+var AMnoMathML = false, AMtranslated = false;
859+
860+function translate(spanclassAM) {
861+ if (!AMtranslated) { // run this only once
862+ AMtranslated = true;
863+ AMinitSymbols();
864+ AMbody = document.getElementsByTagName("body")[0];
865+ AMprocessNode(AMbody, false, spanclassAM);
866+ }
705867}
706868
707−// Key trap fix, new function body for trap()
708−function trap(e) {
709− if (!e) {
710− e = event;
711− e.which = e.keyCode;
712− }
713− try {
714− modifierKey = e.ctrlKey || e.altKey || e.metaKey;
715− }
716− catch(e) {
717− modifierKey = false;
718− }
719− return modifierKey || e.which == 0;
869+if (isIE) { // avoid adding MathPlayer info explicitly to each webpage
870+ document.write("<object id=\"mathplayer\"\
871+ classid=\"clsid:32F66A20-7614-11D4-BD11-00104BD3F987\"></object>");
872+ document.write("<?import namespace=\"m\" implementation=\"#mathplayer\"?>");
720873}
721874
722−function startup() {
723− defaultCheck();
724− if (!isOp)
725− createControls();
726− slideLabel();
727− fixLinks();
728− externalLinks();
729− fontScale();
730− if (!isOp) {
731− notOperaFix();
732− incrementals = createIncrementals();
733− slideJump();
734− if (defaultView == 'outline') {
735− toggle();
736− }
737− document.onkeyup = keys;
738− document.onkeypress = trap;
739− document.onclick = clicker;
740− }
875+// GO1.1 Generic onload by Brothercake
876+// http://www.brothercake.com/
877+//onload function (replaces the onload="translate()" in the <body> tag)
878+function generic()
879+{
880+ translate();
881+};
882+//setup onload function
883+if(typeof window.addEventListener != 'undefined')
884+{
885+ //.. gecko, safari, konqueror and standard
886+ window.addEventListener('load', generic, false);
887+}
888+else if(typeof document.addEventListener != 'undefined')
889+{
890+ //.. opera 7
891+ document.addEventListener('load', generic, false);
892+}
893+else if(typeof window.attachEvent != 'undefined')
894+{
895+ //.. win/ie
896+ window.attachEvent('onload', generic);
897+}
898+//** remove this condition to degrade older browsers
899+else
900+{
901+ //.. mac/ie5 and anything else that gets this far
902+ //if there's an existing onload function
903+ if(typeof window.onload == 'function')
904+ {
905+ //store it
906+ var existing = onload;
907+ //add new onload handler
908+ window.onload = function()
909+ {
910+ //call existing onload function
911+ existing();
912+ //call generic onload function
913+ generic();
914+ };
915+ }
916+ else
917+ {
918+ //setup onload function
919+ window.onload = generic;
920+ }
741921}
922+</script>
923+<!-- configuration parameters -->
924+<meta name="defaultView" content="slideshow" />
925+<meta name="controlVis" content="hidden" />
926+<style type="text/css" media="projection" id="slideProj">
927+/* Do not edit or override these styles! The system will likely break if you do. */
742928
743−window.onload = startup;
744−window.onresize = function(){setTimeout('fontScale()', 50);}</script>
745−<script type="text/javascript">
746−/* ASCIIMathML.js - copyright Peter Jipsen, released under the GPL
747−See http://www1.chapman.edu/~jipsen/mathml/asciimath.html/ */
748−
749−var checkForMathML = true; // check if browser can display MathML
750−var notifyIfNoMathML = true; // display note if no MathML capability
751−var alertIfNoMathML = false; // show alert box if no MathML capability
752−var mathcolor = ""; // change it to "" (to inherit) or any other color
753−var mathfontfamily = "serif"; // change to "" to inherit (works in IE)
754− // or another family (e.g. "arial")
755−var displaystyle = true; // puts limits above and below large operators
756−var showasciiformulaonhover = true; // helps students learn ASCIIMath
757−var decimalsign = "."; // change to "," if you like, beware of `(1,2)`!
758−var AMdelimiter1 = "`", AMescape1 = "\\\\`"; // can use other characters
759−var AMdelimiter2 = "$", AMescape2 = "\\\\\\$", AMdelimiter2regexp = "\\$";
760−var doubleblankmathdelimiter = false; // if true, x+1 is equal to `x+1`
761− // for IE this works only in <!-- -->
762−//var separatetokens;// has been removed (email me if this is a problem)
763−var isIE = document.createElementNS==null;
929+div#header, div#footer, div#controls, .slide {position: absolute;}
930+html>body div#header, html>body div#footer,
931+ html>body div#controls, html>body .slide {position: fixed;}
932+.handout {display: none;}
933+.layout {display: block;}
934+.slide, .hideme, .incremental {visibility: hidden;}
935+#slide0 {visibility: visible;}
764936
765−if (document.getElementById==null)
766− alert("This webpage requires a recent browser such as\
767−\nMozilla/Netscape 7+ or Internet Explorer 6+MathPlayer")
937+/* The following styles size, place, and layer the slide components.
938+ Edit these if you want to change the overall slide layout.
939+ The commented lines can be uncommented (and modified, if necessary)
940+ to help you with the rearrangement process. */
768941
769−// all further global variables start with "AM"
942+/* target = 1024x768 */
770943
771−function AMcreateElementXHTML(t) {
772− if (isIE) return document.createElement(t);
773− else return document.createElementNS("http://www.w3.org/1999/xhtml",t);
774−}
944+div#header, div#footer, .slide {width: 100%; top: 0; left: 0;}
945+div#header {top: 0; height: 3em; z-index: 1;}
946+div#footer {top: auto; bottom: 0; height: 2.5em; z-index: 5;}
947+.slide {top: 0; width: 92%; padding: 3.5em 4% 4%; z-index: 2; list-style: none;}
948+div#controls {left: 50%; bottom: 0; width: 50%; z-index: 100;}
949+div#controls form {position: absolute; bottom: 0; right: 0; width: 100%;
950+ margin: 0;}
951+#currentSlide {position: absolute; width: 10%; left: 45%; bottom: 1em; z-index: 10;}
952+html>body #currentSlide {position: fixed;}
775953
776−function AMnoMathMLNote() {
777− var nd = AMcreateElementXHTML("h3");
778− nd.setAttribute("align","center")
779− nd.appendChild(AMcreateElementXHTML("p"));
780− nd.appendChild(document.createTextNode("To view the "));
781− var an = AMcreateElementXHTML("a");
782− an.appendChild(document.createTextNode("ASCIIMathML"));
783− an.setAttribute("href","http://www.chapman.edu/~jipsen/asciimath.html");
784− nd.appendChild(an);
785− nd.appendChild(document.createTextNode(" notation use Internet Explorer 6+"));
786− an = AMcreateElementXHTML("a");
787− an.appendChild(document.createTextNode("MathPlayer"));
788− an.setAttribute("href","http://www.dessci.com/en/products/mathplayer/download.htm");
789− nd.appendChild(an);
790− nd.appendChild(document.createTextNode(" or Netscape/Mozilla/Firefox"));
791− nd.appendChild(AMcreateElementXHTML("p"));
792− return nd;
793−}
954+/*
955+div#header {background: #FCC;}
956+div#footer {background: #CCF;}
957+div#controls {background: #BBD;}
958+div#currentSlide {background: #FFC;}
959+*/
794960
795−function AMisMathMLavailable() {
796− var regex = /KHTML/; /* ASCIIMathML.js - copyright Peter Jipsen, released under the GPL
797−See http://www1.chapman.edu/~jipsen/mathml/asciimath.html/ */
798− if (navigator.appName.slice(0,8)=="Netscape")
799− if (navigator.appVersion.slice(0,1)>="5" && !regex.test(navigator.userAgent)) return null;
800− else return AMnoMathMLNote();
801− else if (navigator.appName.slice(0,9)=="Microsoft")
802− try {
803− var ActiveX = new ActiveXObject("MathPlayer.Factory.1");
804− return null;
805− } catch (e) {
806− return AMnoMathMLNote();
807− }
808− else return AMnoMathMLNote();
809−}
961+/* Following are the presentation styles -- edit away! */
810962
811−// character lists for Mozilla/Netscape fonts
812−var AMcal = [0xEF35,0x212C,0xEF36,0xEF37,0x2130,0x2131,0xEF38,0x210B,0x2110,0xEF39,0xEF3A,0x2112,0x2133,0xEF3B,0xEF3C,0xEF3D,0xEF3E,0x211B,0xEF3F,0xEF40,0xEF41,0xEF42,0xEF43,0xEF44,0xEF45,0xEF46];
813−var AMfrk = [0xEF5D,0xEF5E,0x212D,0xEF5F,0xEF60,0xEF61,0xEF62,0x210C,0x2111,0xEF63,0xEF64,0xEF65,0xEF66,0xEF67,0xEF68,0xEF69,0xEF6A,0x211C,0xEF6B,0xEF6C,0xEF6D,0xEF6E,0xEF6F,0xEF70,0xEF71,0x2128];
814−var AMbbb = [0xEF8C,0xEF8D,0x2102,0xEF8E,0xEF8F,0xEF90,0xEF91,0x210D,0xEF92,0xEF93,0xEF94,0xEF95,0xEF96,0x2115,0xEF97,0x2119,0x211A,0x211D,0xEF98,0xEF99,0xEF9A,0xEF9B,0xEF9C,0xEF9D,0xEF9E,0x2124];
963+body {background: #FFF url(bodybg.gif) -16px 0 no-repeat; color: #000; font-size: 2em;}
964+:link, :visited {text-decoration: none; color: #00C;}
965+#controls :active {color: #88A !important;}
966+#controls :focus {outline: 1px dotted #227;}
967+h1, h2, h3, h4 {font-size: 100%; margin: 0; padding: 0; font-weight: inherit;}
968+ul, pre {margin: 0; line-height: 1em;}
969+html, body {margin: 0; padding: 0;}
815970
816−var CONST = 0, UNARY = 1, BINARY = 2, INFIX = 3, LEFTBRACKET = 4,
817− RIGHTBRACKET = 5, SPACE = 6, UNDEROVER = 7, DEFINITION = 8,
818− LEFTRIGHT = 9, TEXT = 10; // token types
971+blockquote, q {font-style: italic;}
972+blockquote {padding: 0 2em 0.5em; margin: 0 1.5em 0.5em; text-align: center; font-size: 1em;}
973+blockquote p {margin: 0;}
974+blockquote i {font-style: normal;}
975+blockquote b {display: block; margin-top: 0.5em; font-weight: normal; font-size: smaller; font-style: normal;}
976+blockquote b i {font-style: italic;}
819977
820−var AMsqrt = {input:"sqrt", tag:"msqrt", output:"sqrt", tex:null, ttype:UNARY},
821− AMroot = {input:"root", tag:"mroot", output:"root", tex:null, ttype:BINARY},
822− AMfrac = {input:"frac", tag:"mfrac", output:"/", tex:null, ttype:BINARY},
823− AMdiv = {input:"/", tag:"mfrac", output:"/", tex:null, ttype:INFIX},
824− AMover = {input:"stackrel", tag:"mover", output:"stackrel", tex:null, ttype:BINARY},
825− AMsub = {input:"_", tag:"msub", output:"_", tex:null, ttype:INFIX},
826− AMsup = {input:"^", tag:"msup", output:"^", tex:null, ttype:INFIX},
827− AMtext = {input:"text", tag:"mtext", output:"text", tex:null, ttype:TEXT},
828− AMmbox = {input:"mbox", tag:"mtext", output:"mbox", tex:null, ttype:TEXT},
829− AMquote = {input:"\"", tag:"mtext", output:"mbox", tex:null, ttype:TEXT};
978+kbd {font-weight: bold; font-size: 1em;}
979+sup {font-size: smaller; line-height: 1px;}
830980
831−var AMsymbols = [
832−//some greek symbols
833−{input:"alpha", tag:"mi", output:"\u03B1", tex:null, ttype:CONST},
834−{input:"beta", tag:"mi", output:"\u03B2", tex:null, ttype:CONST},
835−{input:"chi", tag:"mi", output:"\u03C7", tex:null, ttype:CONST},
836−{input:"delta", tag:"mi", output:"\u03B4", tex:null, ttype:CONST},
837−{input:"Delta", tag:"mo", output:"\u0394", tex:null, ttype:CONST},
838−{input:"epsi", tag:"mi", output:"\u03B5", tex:"epsilon", ttype:CONST},
839−{input:"varepsilon", tag:"mi", output:"\u025B", tex:null, ttype:CONST},
840−{input:"eta", tag:"mi", output:"\u03B7", tex:null, ttype:CONST},
841−{input:"gamma", tag:"mi", output:"\u03B3", tex:null, ttype:CONST},
842−{input:"Gamma", tag:"mo", output:"\u0393", tex:null, ttype:CONST},
843−{input:"iota", tag:"mi", output:"\u03B9", tex:null, ttype:CONST},
844−{input:"kappa", tag:"mi", output:"\u03BA", tex:null, ttype:CONST},
845−{input:"lambda", tag:"mi", output:"\u03BB", tex:null, ttype:CONST},
846−{input:"Lambda", tag:"mo", output:"\u039B", tex:null, ttype:CONST},
847−{input:"mu", tag:"mi", output:"\u03BC", tex:null, ttype:CONST},
848−{input:"nu", tag:"mi", output:"\u03BD", tex:null, ttype:CONST},
849−{input:"omega", tag:"mi", output:"\u03C9", tex:null, ttype:CONST},
850−{input:"Omega", tag:"mo", output:"\u03A9", tex:null, ttype:CONST},
851−{input:"phi", tag:"mi", output:"\u03C6", tex:null, ttype:CONST},
852−{input:"varphi", tag:"mi", output:"\u03D5", tex:null, ttype:CONST},
853−{input:"Phi", tag:"mo", output:"\u03A6", tex:null, ttype:CONST},
854−{input:"pi", tag:"mi", output:"\u03C0", tex:null, ttype:CONST},
855−{input:"Pi", tag:"mo", output:"\u03A0", tex:null, ttype:CONST},
856−{input:"psi", tag:"mi", output:"\u03C8", tex:null, ttype:CONST},
857−{input:"Psi", tag:"mi", output:"\u03A8", tex:null, ttype:CONST},
858−{input:"rho", tag:"mi", output:"\u03C1", tex:null, ttype:CONST},
859−{input:"sigma", tag:"mi", output:"\u03C3", tex:null, ttype:CONST},
860−{input:"Sigma", tag:"mo", output:"\u03A3", tex:null, ttype:CONST},
861−{input:"tau", tag:"mi", output:"\u03C4", tex:null, ttype:CONST},
862−{input:"theta", tag:"mi", output:"\u03B8", tex:null, ttype:CONST},
863−{input:"vartheta", tag:"mi", output:"\u03D1", tex:null, ttype:CONST},
864−{input:"Theta", tag:"mo", output:"\u0398", tex:null, ttype:CONST},
865−{input:"upsilon", tag:"mi", output:"\u03C5", tex:null, ttype:CONST},
866−{input:"xi", tag:"mi", output:"\u03BE", tex:null, ttype:CONST},
867−{input:"Xi", tag:"mo", output:"\u039E", tex:null, ttype:CONST},
868−{input:"zeta", tag:"mi", output:"\u03B6", tex:null, ttype:CONST},
981+.slide code {padding: 2px 0.25em; font-weight: bold; color: #533;}
982+.slide code.bad, code del {color: red;}
983+.slide code.old {color: silver;}
984+.slide pre {padding: 0; margin: 0.25em 0 0.5em 0.5em; color: #533; font-size: 90%;}
985+.slide pre code {display: block;}
986+.slide ul {margin-left: 5%; margin-right: 7%; list-style: disc;}
987+.slide li {margin-top: 0.75em; margin-right: 0;}
988+.slide ul ul {line-height: 1;}
989+.slide ul ul li {margin: .2em; font-size: 85%; list-style: square;}
990+.slide img.leader {display: block; margin: 0 auto;}
869991
870−//binary operation symbols
871−{input:"*", tag:"mo", output:"\u22C5", tex:"cdot", ttype:CONST},
872−{input:"**", tag:"mo", output:"\u22C6", tex:"star", ttype:CONST},
873−{input:"//", tag:"mo", output:"/", tex:null, ttype:CONST},
874−{input:"\\\\", tag:"mo", output:"\\", tex:"backslash", ttype:CONST},
875−{input:"setminus", tag:"mo", output:"\\", tex:null, ttype:CONST},
876−{input:"xx", tag:"mo", output:"\u00D7", tex:"times", ttype:CONST},
877−{input:"-:", tag:"mo", output:"\u00F7", tex:"divide", ttype:CONST},
878−{input:"@", tag:"mo", output:"\u2218", tex:"circ", ttype:CONST},
879−{input:"o+", tag:"mo", output:"\u2295", tex:"oplus", ttype:CONST},
880−{input:"ox", tag:"mo", output:"\u2297", tex:"otimes", ttype:CONST},
881−{input:"o.", tag:"mo", output:"\u2299", tex:"odot", ttype:CONST},
882−{input:"sum", tag:"mo", output:"\u2211", tex:null, ttype:UNDEROVER},
883−{input:"prod", tag:"mo", output:"\u220F", tex:null, ttype:UNDEROVER},
884−{input:"^^", tag:"mo", output:"\u2227", tex:"wedge", ttype:CONST},
885−{input:"^^^", tag:"mo", output:"\u22C0", tex:"bigwedge", ttype:UNDEROVER},
886−{input:"vv", tag:"mo", output:"\u2228", tex:"vee", ttype:CONST},
887−{input:"vvv", tag:"mo", output:"\u22C1", tex:"bigvee", ttype:UNDEROVER},
888−{input:"nn", tag:"mo", output:"\u2229", tex:"cap", ttype:CONST},
889−{input:"nnn", tag:"mo", output:"\u22C2", tex:"bigcap", ttype:UNDEROVER},
890−{input:"uu", tag:"mo", output:"\u222A", tex:"cup", ttype:CONST},
891−{input:"uuu", tag:"mo", output:"\u22C3", tex:"bigcup", ttype:UNDEROVER},
992+div#header, div#footer {background: #005; color: #AAB;
993+ font-family: Verdana, Helvetica, sans-serif;}
994+div#header {background: #005 url(bodybg.gif) -16px 0 no-repeat;
995+ line-height: 1px;}
996+div#footer {font-size: 0.5em; font-weight: bold; padding: 1em 0;}
997+#footer h1, #footer h2 {display: block; padding: 0 1em;}
998+#footer h2 {font-style: italic;}
892999
893−//binary relation symbols
894−{input:"!=", tag:"mo", output:"\u2260", tex:"ne", ttype:CONST},
895−{input:":=", tag:"mo", output:":=", tex:null, ttype:CONST},
896−{input:"lt", tag:"mo", output:"<", tex:null, ttype:CONST},
897−{input:"<=", tag:"mo", output:"\u2264", tex:"le", ttype:CONST},
898−{input:"lt=", tag:"mo", output:"\u2264", tex:"leq", ttype:CONST},
899−{input:">=", tag:"mo", output:"\u2265", tex:"ge", ttype:CONST},
900−{input:"geq", tag:"mo", output:"\u2265", tex:null, ttype:CONST},
901−{input:"-<", tag:"mo", output:"\u227A", tex:"prec", ttype:CONST},
902−{input:"-lt", tag:"mo", output:"\u227A", tex:null, ttype:CONST},
903−{input:">-", tag:"mo", output:"\u227B", tex:"succ", ttype:CONST},
904−{input:"-<=", tag:"mo", output:"\u2AAF", tex:"preceq", ttype:CONST},
905−{input:">-=", tag:"mo", output:"\u2AB0", tex:"succeq", ttype:CONST},
906−{input:"in", tag:"mo", output:"\u2208", tex:null, ttype:CONST},
907−{input:"!in", tag:"mo", output:"\u2209", tex:"notin", ttype:CONST},
908−{input:"sub", tag:"mo", output:"\u2282", tex:"subset", ttype:CONST},
909−{input:"sup", tag:"mo", output:"\u2283", tex:"supset", ttype:CONST},
910−{input:"sube", tag:"mo", output:"\u2286", tex:"subseteq", ttype:CONST},
911−{input:"supe", tag:"mo", output:"\u2287", tex:"supseteq", ttype:CONST},
912−{input:"-=", tag:"mo", output:"\u2261", tex:"equiv", ttype:CONST},
913−{input:"~=", tag:"mo", output:"\u2245", tex:"cong", ttype:CONST},
914−{input:"~~", tag:"mo", output:"\u2248", tex:"approx", ttype:CONST},
915−{input:"prop", tag:"mo", output:"\u221D", tex:"propto", ttype:CONST},
1000+div.long {font-size: 0.75em;}
1001+.slide h1 {position: absolute; top: 0.7em; left: 87px; z-index: 1;
1002+ margin: 0; padding: 0.3em 0 0 50px; white-space: nowrap;
1003+ font: bold 150%/1em Helvetica, sans-serif; text-transform: capitalize;
1004+ color: #DDE; background: #005;}
1005+.slide h3 {font-size: 130%;}
1006+h1 abbr {font-variant: small-caps;}
9161007
917−//logical symbols
918−{input:"and", tag:"mtext", output:"and", tex:null, ttype:SPACE},
919−{input:"or", tag:"mtext", output:"or", tex:null, ttype:SPACE},
920−{input:"not", tag:"mo", output:"\u00AC", tex:"neg", ttype:CONST},
921−{input:"=>", tag:"mo", output:"\u21D2", tex:"implies", ttype:CONST},
922−{input:"if", tag:"mo", output:"if", tex:null, ttype:SPACE},
923−{input:"<=>", tag:"mo", output:"\u21D4", tex:"iff", ttype:CONST},
924−{input:"AA", tag:"mo", output:"\u2200", tex:"forall", ttype:CONST},
925−{input:"EE", tag:"mo", output:"\u2203", tex:"exists", ttype:CONST},
926−{input:"_|_", tag:"mo", output:"\u22A5", tex:"bot", ttype:CONST},
927−{input:"TT", tag:"mo", output:"\u22A4", tex:"top", ttype:CONST},
928−{input:"|--", tag:"mo", output:"\u22A2", tex:"vdash", ttype:CONST},
929−{input:"|==", tag:"mo", output:"\u22A8", tex:"models", ttype:CONST},
1008+div#controls {position: absolute; left: 50%; bottom: 0;
1009+ width: 50%;
1010+ text-align: right; font: bold 0.9em Verdana, Helvetica, sans-serif;}
1011+html>body div#controls {position: fixed; padding: 0 0 1em 0;
1012+ top: auto;}
1013+div#controls form {position: absolute; bottom: 0; right: 0; width: 100%;
1014+ margin: 0; padding: 0;}
1015+#controls #navLinks a {padding: 0; margin: 0 0.5em;
1016+ background: #005; border: none; color: #779;
1017+ cursor: pointer;}
1018+#controls #navList {height: 1em;}
1019+#controls #navList #jumplist {position: absolute; bottom: 0; right: 0; background: #DDD; color: #227;}
9301020
931−//grouping brackets
932−{input:"(", tag:"mo", output:"(", tex:null, ttype:LEFTBRACKET},
933−{input:")", tag:"mo", output:")", tex:null, ttype:RIGHTBRACKET},
934−{input:"[", tag:"mo", output:"[", tex:null, ttype:LEFTBRACKET},
935−{input:"]", tag:"mo", output:"]", tex:null, ttype:RIGHTBRACKET},
936−{input:"{", tag:"mo", output:"{", tex:null, ttype:LEFTBRACKET},
937−{input:"}", tag:"mo", output:"}", tex:null, ttype:RIGHTBRACKET},
938−{input:"|", tag:"mo", output:"|", tex:null, ttype:LEFTRIGHT},
939−//{input:"||", tag:"mo", output:"||", tex:null, ttype:LEFTRIGHT},
940−{input:"(:", tag:"mo", output:"\u2329", tex:"langle", ttype:LEFTBRACKET},
941−{input:":)", tag:"mo", output:"\u232A", tex:"rangle", ttype:RIGHTBRACKET},
942−{input:"<<", tag:"mo", output:"\u2329", tex:null, ttype:LEFTBRACKET},
943−{input:">>", tag:"mo", output:"\u232A", tex:null, ttype:RIGHTBRACKET},
944−{input:"{:", tag:"mo", output:"{:", tex:null, ttype:LEFTBRACKET, invisible:true},
945−{input:":}", tag:"mo", output:":}", tex:null, ttype:RIGHTBRACKET, invisible:true},
1021+#currentSlide {text-align: center; font-size: 0.5em; color: #449;}
9461022
947−//miscellaneous symbols
948−{input:"int", tag:"mo", output:"\u222B", tex:null, ttype:CONST},
949−{input:"dx", tag:"mi", output:"{:d x:}", tex:null, ttype:DEFINITION},
950−{input:"dy", tag:"mi", output:"{:d y:}", tex:null, ttype:DEFINITION},
951−{input:"dz", tag:"mi", output:"{:d z:}", tex:null, ttype:DEFINITION},
952−{input:"dt", tag:"mi", output:"{:d t:}", tex:null, ttype:DEFINITION},
953−{input:"oint", tag:"mo", output:"\u222E", tex:null, ttype:CONST},
954−{input:"del", tag:"mo", output:"\u2202", tex:"partial", ttype:CONST},
955−{input:"grad", tag:"mo", output:"\u2207", tex:"nabla", ttype:CONST},
956−{input:"+-", tag:"mo", output:"\u00B1", tex:"pm", ttype:CONST},
957−{input:"O/", tag:"mo", output:"\u2205", tex:"emptyset", ttype:CONST},
958−{input:"oo", tag:"mo", output:"\u221E", tex:"infty", ttype:CONST},
959−{input:"aleph", tag:"mo", output:"\u2135", tex:null, ttype:CONST},
960−{input:"...", tag:"mo", output:"...", tex:"ldots", ttype:CONST},
961−{input:":.", tag:"mo", output:"\u2234", tex:"therefore", ttype:CONST},
962−{input:"/_", tag:"mo", output:"\u2220", tex:"angle", ttype:CONST},
963−{input:"\\ ", tag:"mo", output:"\u00A0", tex:null, ttype:CONST},
964−{input:"quad", tag:"mo", output:"\u00A0\u00A0", tex:null, ttype:CONST},
965−{input:"qquad", tag:"mo", output:"\u00A0\u00A0\u00A0\u00A0", tex:null, ttype:CONST},
966−{input:"cdots", tag:"mo", output:"\u22EF", tex:null, ttype:CONST},
967−{input:"vdots", tag:"mo", output:"\u22EE", tex:null, ttype:CONST},
968−{input:"ddots", tag:"mo", output:"\u22F1", tex:null, ttype:CONST},
969−{input:"diamond", tag:"mo", output:"\u22C4", tex:null, ttype:CONST},
970−{input:"square", tag:"mo", output:"\u25A1", tex:null, ttype:CONST},
971−{input:"|__", tag:"mo", output:"\u230A", tex:"lfloor", ttype:CONST},
972−{input:"__|", tag:"mo", output:"\u230B", tex:"rfloor", ttype:CONST},
973−{input:"|~", tag:"mo", output:"\u2308", tex:"lceiling", ttype:CONST},
974−{input:"~|", tag:"mo", output:"\u2309", tex:"rceiling", ttype:CONST},
975−{input:"CC", tag:"mo", output:"\u2102", tex:null, ttype:CONST},
976−{input:"NN", tag:"mo", output:"\u2115", tex:null, ttype:CONST},
977−{input:"QQ", tag:"mo", output:"\u211A", tex:null, ttype:CONST},
978−{input:"RR", tag:"mo", output:"\u211D", tex:null, ttype:CONST},
979−{input:"ZZ", tag:"mo", output:"\u2124", tex:null, ttype:CONST},
980−{input:"f", tag:"mi", output:"f", tex:null, ttype:UNARY, func:true},
981−{input:"g", tag:"mi", output:"g", tex:null, ttype:UNARY, func:true},
1023+#slide0 {padding-top: 3.5em; font-size: 90%;}
1024+#slide0 h1 {position: static; margin: 1em 0 0; padding: 0;
1025+ font: bold 2em Helvetica, sans-serif; white-space: normal;
1026+ color: #000; background: transparent;}
1027+#slide0 h2 {font: bold italic 1em Helvetica, sans-serif; margin: 0.25em;}
1028+#slide0 h3 {margin-top: 1.5em; font-size: 1.5em;}
1029+#slide0 h4 {margin-top: 0; font-size: 1em;}
9821030
983−//standard functions
984−{input:"lim", tag:"mo", output:"lim", tex:null, ttype:UNDEROVER},
985−{input:"Lim", tag:"mo", output:"Lim", tex:null, ttype:UNDEROVER},
986−{input:"sin", tag:"mo", output:"sin", tex:null, ttype:UNARY, func:true},
987−{input:"cos", tag:"mo", output:"cos", tex:null, ttype:UNARY, func:true},
988−{input:"tan", tag:"mo", output:"tan", tex:null, ttype:UNARY, func:true},
989−{input:"sinh", tag:"mo", output:"sinh", tex:null, ttype:UNARY, func:true},
990−{input:"cosh", tag:"mo", output:"cosh", tex:null, ttype:UNARY, func:true},
991−{input:"tanh", tag:"mo", output:"tanh", tex:null, ttype:UNARY, func:true},
992−{input:"cot", tag:"mo", output:"cot", tex:null, ttype:UNARY, func:true},
993−{input:"sec", tag:"mo", output:"sec", tex:null, ttype:UNARY, func:true},
994−{input:"csc", tag:"mo", output:"csc", tex:null, ttype:UNARY, func:true},
995−{input:"log", tag:"mo", output:"log", tex:null, ttype:UNARY, func:true},
996−{input:"ln", tag:"mo", output:"ln", tex:null, ttype:UNARY, func:true},
997−{input:"det", tag:"mo", output:"det", tex:null, ttype:UNARY, func:true},
998−{input:"dim", tag:"mo", output:"dim", tex:null, ttype:CONST},
999−{input:"mod", tag:"mo", output:"mod", tex:null, ttype:CONST},
1000−{input:"gcd", tag:"mo", output:"gcd", tex:null, ttype:UNARY, func:true},
1001−{input:"lcm", tag:"mo", output:"lcm", tex:null, ttype:UNARY, func:true},
1002−{input:"lub", tag:"mo", output:"lub", tex:null, ttype:CONST},
1003−{input:"glb", tag:"mo", output:"glb", tex:null, ttype:CONST},
1004−{input:"min", tag:"mo", output:"min", tex:null, ttype:UNDEROVER},
1005−{input:"max", tag:"mo", output:"max", tex:null, ttype:UNDEROVER},
1031+ul.urls {list-style: none; display: inline; margin: 0;}
1032+.urls li {display: inline; margin: 0;}
1033+.note {display: none;}
1034+.external {border-bottom: 1px dotted gray;}
1035+html>body .external {border-bottom: none;}
1036+.external:after {content: " \274F"; font-size: smaller; color: #77B;}
10061037
1007−//arrows
1008−{input:"uarr", tag:"mo", output:"\u2191", tex:"uparrow", ttype:CONST},
1009−{input:"darr", tag:"mo", output:"\u2193", tex:"downarrow", ttype:CONST},
1010−{input:"rarr", tag:"mo", output:"\u2192", tex:"rightarrow", ttype:CONST},
1011−{input:"->", tag:"mo", output:"\u2192", tex:"to", ttype:CONST},
1012−{input:"|->", tag:"mo", output:"\u21A6", tex:"mapsto", ttype:CONST},
1013−{input:"larr", tag:"mo", output:"\u2190", tex:"leftarrow", ttype:CONST},
1014−{input:"harr", tag:"mo", output:"\u2194", tex:"leftrightarrow", ttype:CONST},
1015−{input:"rArr", tag:"mo", output:"\u21D2", tex:"Rightarrow", ttype:CONST},
1016−{input:"lArr", tag:"mo", output:"\u21D0", tex:"Leftarrow", ttype:CONST},
1017−{input:"hArr", tag:"mo", output:"\u21D4", tex:"Leftrightarrow", ttype:CONST},
1038+.incremental, .incremental *, .incremental *:after {color: #DDE; visibility: visible;}
1039+img.incremental {visibility: hidden;}
1040+.slide .current {color: #B02;}
10181041
1019−//commands with argument
1020−AMsqrt, AMroot, AMfrac, AMdiv, AMover, AMsub, AMsup,
1021−{input:"hat", tag:"mover", output:"\u005E", tex:null, ttype:UNARY, acc:true},
1022−{input:"bar", tag:"mover", output:"\u00AF", tex:"overline", ttype:UNARY, acc:true},
1023−{input:"vec", tag:"mover", output:"\u2192", tex:null, ttype:UNARY, acc:true},
1024−{input:"dot", tag:"mover", output:".", tex:null, ttype:UNARY, acc:true},
1025−{input:"ddot", tag:"mover", output:"..", tex:null, ttype:UNARY, acc:true},
1026−{input:"ul", tag:"munder", output:"\u0332", tex:"underline", ttype:UNARY, acc:true},
1027−AMtext, AMmbox, AMquote,
1028−{input:"bb", tag:"mstyle", atname:"fontweight", atval:"bold", output:"bb", tex:null, ttype:UNARY},
1029−{input:"mathbf", tag:"mstyle", atname:"fontweight", atval:"bold", output:"mathbf", tex:null, ttype:UNARY},
1030−{input:"sf", tag:"mstyle", atname:"fontfamily", atval:"sans-serif", output:"sf", tex:null, ttype:UNARY},
1031−{input:"mathsf", tag:"mstyle", atname:"fontfamily", atval:"sans-serif", output:"mathsf", tex:null, ttype:UNARY},
1032−{input:"bbb", tag:"mstyle", atname:"mathvariant", atval:"double-struck", output:"bbb", tex:null, ttype:UNARY, codes:AMbbb},
1033−{input:"mathbb", tag:"mstyle", atname:"mathvariant", atval:"double-struck", output:"mathbb", tex:null, ttype:UNARY, codes:AMbbb},
1034−{input:"cc", tag:"mstyle", atname:"mathvariant", atval:"script", output:"cc", tex:null, ttype:UNARY, codes:AMcal},
1035−{input:"mathcal", tag:"mstyle", atname:"mathvariant", atval:"script", output:"mathcal", tex:null, ttype:UNARY, codes:AMcal},
1036−{input:"tt", tag:"mstyle", atname:"fontfamily", atval:"monospace", output:"tt", tex:null, ttype:UNARY},
1037−{input:"mathtt", tag:"mstyle", atname:"fontfamily", atval:"monospace", output:"mathtt", tex:null, ttype:UNARY},
1038−{input:"fr", tag:"mstyle", atname:"mathvariant", atval:"fraktur", output:"fr", tex:null, ttype:UNARY, codes:AMfrk},
1039−{input:"mathfrak", tag:"mstyle", atname:"mathvariant", atval:"fraktur", output:"mathfrak", tex:null, ttype:UNARY, codes:AMfrk}
1040−];
10411042
1042−function compareNames(s1,s2) {
1043− if (s1.input > s2.input) return 1
1044− else return -1;
1043+/* diagnostics
1044+
1045+li:after {content: " [" attr(class) "]"; color: #F88;}
1046+ */
1047+</style>
1048+<style type="text/css" media="projection" id="operaFix">
1049+/* DO NOT CHANGE THESE unless you really want to break Opera Show */
1050+.slide {
1051+ visibility: visible !important;
1052+ position: static !important;
1053+ page-break-before: always;
10451054}
1055+#slide0 {page-break-before: avoid;}
10461056
1047−var AMnames = []; //list of input symbols
1057+</style>
1058+<style type="text/css" media="screen" id="outlineStyle">
1059+/* don't change this unless you want the layout stuff to show up in the outline view! */
10481060
1049−function AMinitSymbols() {
1050− var texsymbols = [], i;
1051− for (i=0; i<AMsymbols.length; i++)
1052− if (AMsymbols[i].tex)
1053− texsymbols[texsymbols.length] = {input:AMsymbols[i].tex,
1054− tag:AMsymbols[i].tag, output:AMsymbols[i].output, ttype:AMsymbols[i].ttype};
1055− AMsymbols = AMsymbols.concat(texsymbols);
1056− AMsymbols.sort(compareNames);
1057− for (i=0; i<AMsymbols.length; i++) AMnames[i] = AMsymbols[i].input;
1058−}
1061+.layout div, #footer *, #controlForm * {display: none;}
1062+#footer, #controls, #controlForm, #navLinks, #toggle {
1063+ display: block; visibility: visible; margin: 0; padding: 0;}
1064+#toggle {float: right; padding: 0.5em;}
1065+html>body #toggle {position: fixed; top: 0; right: 0;}
10591066
1060−var AMmathml = "http://www.w3.org/1998/Math/MathML";
1067+/* making the outline look pretty-ish */
10611068
1062−function AMcreateElementMathML(t) {
1063− if (isIE) return document.createElement("m:"+t);
1064− else return document.createElementNS(AMmathml,t);
1065−}
1069+#slide0 h1, #slide0 h2, #slide0 h3, #slide0 h4 {border: none; margin: 0;}
1070+#slide0 h1 {padding-top: 1.5em;}
1071+.slide h1 {margin: 1.5em 0 0; padding-top: 0.25em;
1072+ border-top: 1px solid #888; border-bottom: 1px solid #AAA;}
1073+#toggle {border: 1px solid; border-width: 0 0 1px 1px; background: #FFF;}
10661074
1067−function AMcreateMmlNode(t,frag) {
1068−// var node = AMcreateElementMathML(name);
1069− if (isIE) var node = document.createElement("m:"+t);
1070− else var node = document.createElementNS(AMmathml,t);
1071− node.appendChild(frag);
1072− return node;
1073−}
1075+</style>
1076+<style type="text/css" media="print" id="slidePrint">
1077+/* The following rule is necessary to have all slides appear in print! DO NOT REMOVE IT! */
1078+.slide, ul {page-break-inside: avoid; visibility: visible !important;}
1079+h1 {page-break-after: avoid;}
10741080
1075−function newcommand(oldstr,newstr) {
1076− AMsymbols = AMsymbols.concat([{input:oldstr, tag:"mo", output:newstr,
1077− tex:null, ttype:DEFINITION}]);
1078−}
1081+body {font-size: 12pt; background: white;}
1082+* {color: black;}
10791083
1080−function AMremoveCharsAndBlanks(str,n) {
1081−//remove n characters and any following blanks
1082− var st;
1083− if (str.charAt(n)=="\\" && str.charAt(n+1)!="\\" && str.charAt(n+1)!=" ")
1084− st = str.slice(n+1);
1085− else st = str.slice(n);
1086− for (var i=0; i<st.length && st.charCodeAt(i)<=32; i=i+1);
1087− return st.slice(i);
1088−}
1084+#slide0 h1 {font-size: 200%; border: none; margin: 0.5em 0 0.25em;}
1085+#slide0 h3 {margin: 0; padding: 0;}
1086+#slide0 h4 {margin: 0 0 0.5em; padding: 0;}
1087+#slide0 {margin-bottom: 3em;}
10891088
1090−function AMposition(arr, str, n) {
1091−// return position >=n where str appears or would be inserted
1092−// assumes arr is sorted
1093− if (n==0) {
1094− var h,m;
1095− n = -1;
1096− h = arr.length;
1097− while (n+1<h) {
1098− m = (n+h) >> 1;
1099− if (arr[m]<str) n = m; else h = m;
1100− }
1101− return h;
1102− } else
1103− for (var i=n; i<arr.length && arr[i]<str; i++);
1104− return i; // i=arr.length || arr[i]>=str
1089+h1 {border-top: 2pt solid gray; border-bottom: 1px dotted silver;}
1090+.extra {background: transparent !important;}
1091+div.extra, pre.extra, .example {font-size: 10pt; color: #333;}
1092+ul.extra a {font-weight: bold;}
1093+p.example {display: none;}
1094+
1095+#header {display: none;}
1096+#footer h1 {margin: 0; border-bottom: 1px solid; color: gray; font-style: italic;}
1097+#footer h2, #controls {display: none;}
1098+
1099+/* The following rule keeps the layout stuff out of print. Remove at your own risk! */
1100+.layout, .layout * {display: none !important;}
1101+
1102+</style>
1103+<script type="text/javascript">
1104+// S5 v1.1 slides.js -- released into the Public Domain
1105+//
1106+// Please see http://www.meyerweb.com/eric/tools/s5/credits.html for information
1107+// about all the wonderful and talented contributors to this code!
1108+
1109+var undef;
1110+var slideCSS = '';
1111+var snum = 0;
1112+var smax = 1;
1113+var incpos = 0;
1114+var number = undef;
1115+var s5mode = true;
1116+var defaultView = 'slideshow';
1117+var controlVis = 'visible';
1118+
1119+var isIE = navigator.appName == 'Microsoft Internet Explorer' && navigator.userAgent.indexOf('Opera') < 1 ? 1 : 0;
1120+var isOp = navigator.userAgent.indexOf('Opera') > -1 ? 1 : 0;
1121+var isGe = navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('Safari') < 1 ? 1 : 0;
1122+
1123+function hasClass(object, className) {
1124+ if (!object.className) return false;
1125+ return (object.className.search('(^|\\s)' + className + '(\\s|$)') != -1);
11051126}
11061127
1107−function AMgetSymbol(str) {
1108−//return maximal initial substring of str that appears in names
1109−//return null if there is none
1110− var k = 0; //new pos
1111− var j = 0; //old pos
1112− var mk; //match pos
1113− var st;
1114− var tagst;
1115− var match = "";
1116− var more = true;
1117− for (var i=1; i<=str.length && more; i++) {
1118− st = str.slice(0,i); //initial substring of length i
1119− j = k;
1120− k = AMposition(AMnames, st, j);
1121− if (k<AMnames.length && str.slice(0,AMnames[k].length)==AMnames[k]){
1122− match = AMnames[k];
1123− mk = k;
1124− i = match.length;
1125− }
1126− more = k<AMnames.length && str.slice(0,AMnames[k].length)>=AMnames[k];
1127− }
1128− AMpreviousSymbol=AMcurrentSymbol;
1129− if (match!=""){
1130− AMcurrentSymbol=AMsymbols[mk].ttype;
1131− return AMsymbols[mk];
1132− }
1133−// if str[0] is a digit or - return maxsubstring of digits.digits
1134− AMcurrentSymbol=CONST;
1135− k = 1;
1136− st = str.slice(0,1);
1137− var integ = true;
1138− while ("0"<=st && st<="9" && k<=str.length) {
1139− st = str.slice(k,k+1);
1140− k++;
1141− }
1142− if (st == decimalsign) {
1143− st = str.slice(k,k+1);
1144− if ("0"<=st && st<="9") {
1145− integ = false;
1146− k++;
1147− while ("0"<=st && st<="9" && k<=str.length) {
1148− st = str.slice(k,k+1);
1149− k++;
1150− }
1151− }
1152− }
1153− if ((integ && k>1) || k>2) {
1154− st = str.slice(0,k-1);
1155− tagst = "mn";
1156− } else {
1157− k = 2;
1158− st = str.slice(0,1); //take 1 character
1159− tagst = (("A">st || st>"Z") && ("a">st || st>"z")?"mo":"mi");
1160− }
1161− if (st=="-" && AMpreviousSymbol==INFIX) {
1162− AMcurrentSymbol = INFIX; //trick "/" into recognizing "-" on second parse
1163− return {input:st, tag:tagst, output:st, ttype:UNARY, func:true};
1164− }
1165− return {input:st, tag:tagst, output:st, ttype:CONST};
1128+function hasValue(object, value) {
1129+ if (!object) return false;
1130+ return (object.search('(^|\\s)' + value + '(\\s|$)') != -1);
11661131}
11671132
1168−function AMremoveBrackets(node) {
1169− var st;
1170− if (node.nodeName=="mrow") {
1171− st = node.firstChild.firstChild.nodeValue;
1172− if (st=="(" || st=="[" || st=="{") node.removeChild(node.firstChild);
1173− }
1174− if (node.nodeName=="mrow") {
1175− st = node.lastChild.firstChild.nodeValue;
1176− if (st==")" || st=="]" || st=="}") node.removeChild(node.lastChild);
1177− }
1133+function removeClass(object,className) {
1134+ if (!object) return;
1135+ object.className = object.className.replace(new RegExp('(^|\\s)'+className+'(\\s|$)'), RegExp.$1+RegExp.$2);
11781136}
11791137
1180−/* ASCIIMathML.js - copyright Peter Jipsen, released under the GPL
1181−See http://www1.chapman.edu/~jipsen/mathml/asciimath.html/ */
1138+function addClass(object,className) {
1139+ if (!object || hasClass(object, className)) return;
1140+ if (object.className) {
1141+ object.className += ' '+className;
1142+ } else {
1143+ object.className = className;
1144+ }
1145+}
11821146
1183−var AMnestingDepth,AMpreviousSymbol,AMcurrentSymbol;
1147+function GetElementsWithClassName(elementName,className) {
1148+ var allElements = document.getElementsByTagName(elementName);
1149+ var elemColl = new Array();
1150+ for (var i = 0; i< allElements.length; i++) {
1151+ if (hasClass(allElements[i], className)) {
1152+ elemColl[elemColl.length] = allElements[i];
1153+ }
1154+ }
1155+ return elemColl;
1156+}
11841157
1185−function AMparseSexpr(str) { //parses str and returns [node,tailstr]
1186− var symbol, node, result, i, st,// rightvert = false,
1187− newFrag = document.createDocumentFragment();
1188− str = AMremoveCharsAndBlanks(str,0);
1189− symbol = AMgetSymbol(str); //either a token or a bracket or empty
1190− if (symbol == null || symbol.ttype == RIGHTBRACKET && AMnestingDepth > 0) {
1191− return [null,str];
1192− }
1193− if (symbol.ttype == DEFINITION) {
1194− str = symbol.output+AMremoveCharsAndBlanks(str,symbol.input.length);
1195− symbol = AMgetSymbol(str);
1196− }
1197− switch (symbol.ttype) {
1198− case UNDEROVER:
1199− case CONST:
1200− str = AMremoveCharsAndBlanks(str,symbol.input.length);
1201− return [AMcreateMmlNode(symbol.tag, //its a constant
1202− document.createTextNode(symbol.output)),str];
1203− case LEFTBRACKET: //read (expr+)
1204− AMnestingDepth++;
1205− str = AMremoveCharsAndBlanks(str,symbol.input.length);
1206− result = AMparseExpr(str,true);
1207− AMnestingDepth--;
1208− if (typeof symbol.invisible == "boolean" && symbol.invisible)
1209− node = AMcreateMmlNode("mrow",result[0]);
1210− else {
1211− node = AMcreateMmlNode("mo",document.createTextNode(symbol.output));
1212− node = AMcreateMmlNode("mrow",node);
1213− node.appendChild(result[0]);
1214− }
1215− return [node,result[1]];
1216− case TEXT:
1217− if (symbol!=AMquote) str = AMremoveCharsAndBlanks(str,symbol.input.length);
1218− if (str.charAt(0)=="{") i=str.indexOf("}");
1219− else if (str.charAt(0)=="(") i=str.indexOf(")");
1220− else if (str.charAt(0)=="[") i=str.indexOf("]");
1221− else if (symbol==AMquote) i=str.slice(1).indexOf("\"")+1;
1222− else i = 0;
1223− if (i==-1) i = str.length;
1224− st = str.slice(1,i);
1225− if (st.charAt(0) == " ") {
1226− node = AMcreateElementMathML("mspace");
1227− node.setAttribute("width","1ex");
1228− newFrag.appendChild(node);
1229− }
1230− newFrag.appendChild(
1231− AMcreateMmlNode(symbol.tag,document.createTextNode(st)));
1232− if (st.charAt(st.length-1) == " ") {
1233− node = AMcreateElementMathML("mspace");
1234− node.setAttribute("width","1ex");
1235− newFrag.appendChild(node);
1236− }
1237− str = AMremoveCharsAndBlanks(str,i+1);
1238− return [AMcreateMmlNode("mrow",newFrag),str];
1239− case UNARY:
1240− str = AMremoveCharsAndBlanks(str,symbol.input.length);
1241− result = AMparseSexpr(str);
1242− if (result[0]==null) return [AMcreateMmlNode(symbol.tag,
1243− document.createTextNode(symbol.output)),str];
1244− if (typeof symbol.func == "boolean" && symbol.func) { // functions hack
1245− st = str.charAt(0);
1246− if (st=="^" || st=="_" || st=="/" || st=="|" || st==",") {
1247− return [AMcreateMmlNode(symbol.tag,
1248− document.createTextNode(symbol.output)),str];
1249− } else {
1250− node = AMcreateMmlNode("mrow",
1251− AMcreateMmlNode(symbol.tag,document.createTextNode(symbol.output)));
1252− node.appendChild(result[0]);
1253− return [node,result[1]];
1254− }
1255− }
1256− AMremoveBrackets(result[0]);
1257− if (symbol.input == "sqrt") { // sqrt
1258− return [AMcreateMmlNode(symbol.tag,result[0]),result[1]];
1259− } else if (typeof symbol.acc == "boolean" && symbol.acc) { // accent
1260− node = AMcreateMmlNode(symbol.tag,result[0]);
1261− node.appendChild(AMcreateMmlNode("mo",document.createTextNode(symbol.output)));
1262− return [node,result[1]];
1263− } else { // font change command
1264− if (!isIE && typeof symbol.codes != "undefined") {
1265− for (i=0; i<result[0].childNodes.length; i++)
1266− if (result[0].childNodes[i].nodeName=="mi" || result[0].nodeName=="mi") {
1267− st = (result[0].nodeName=="mi"?result[0].firstChild.nodeValue:
1268− result[0].childNodes[i].firstChild.nodeValue);
1269− var newst = [];
1270− for (var j=0; j<st.length; j++)
1271− if (st.charCodeAt(j)>64 && st.charCodeAt(j)<91) newst = newst +
1272− String.fromCharCode(symbol.codes[st.charCodeAt(j)-65]);
1273− else newst = newst + st.charAt(j);
1274− if (result[0].nodeName=="mi")
1275− result[0]=AMcreateElementMathML("mo").
1276− appendChild(document.createTextNode(newst));
1277− else result[0].replaceChild(AMcreateElementMathML("mo").
1278− appendChild(document.createTextNode(newst)),result[0].childNodes[i]);
1279− }
1280− }
1281− node = AMcreateMmlNode(symbol.tag,result[0]);
1282− node.setAttribute(symbol.atname,symbol.atval);
1283− return [node,result[1]];
1284− }
1285− case BINARY:
1286− str = AMremoveCharsAndBlanks(str,symbol.input.length);
1287− result = AMparseSexpr(str);
1288− if (result[0]==null) return [AMcreateMmlNode("mo",
1289− document.createTextNode(symbol.input)),str];
1290− AMremoveBrackets(result[0]);
1291− var result2 = AMparseSexpr(result[1]);
1292− if (result2[0]==null) return [AMcreateMmlNode("mo",
1293− document.createTextNode(symbol.input)),str];
1294− AMremoveBrackets(result2[0]);
1295− if (symbol.input=="root" || symbol.input=="stackrel")
1296− newFrag.appendChild(result2[0]);
1297− newFrag.appendChild(result[0]);
1298− if (symbol.input=="frac") newFrag.appendChild(result2[0]);
1299− return [AMcreateMmlNode(symbol.tag,newFrag),result2[1]];
1300− case INFIX:
1301− str = AMremoveCharsAndBlanks(str,symbol.input.length);
1302− return [AMcreateMmlNode("mo",document.createTextNode(symbol.output)),str];
1303− case SPACE:
1304− str = AMremoveCharsAndBlanks(str,symbol.input.length);
1305− node = AMcreateElementMathML("mspace");
1306− node.setAttribute("width","1ex");
1307− newFrag.appendChild(node);
1308− newFrag.appendChild(
1309− AMcreateMmlNode(symbol.tag,document.createTextNode(symbol.output)));
1310− node = AMcreateElementMathML("mspace");
1311− node.setAttribute("width","1ex");
1312− newFrag.appendChild(node);
1313− return [AMcreateMmlNode("mrow",newFrag),str];
1314− case LEFTRIGHT:
1315−// if (rightvert) return [null,str]; else rightvert = true;
1316− AMnestingDepth++;
1317− str = AMremoveCharsAndBlanks(str,symbol.input.length);
1318− result = AMparseExpr(str,false);
1319− AMnestingDepth--;
1320− var st = "";
1321− if (result[0].lastChild!=null)
1322− st = result[0].lastChild.firstChild.nodeValue;
1323− if (st == "|") { // its an absolute value subterm
1324− node = AMcreateMmlNode("mo",document.createTextNode(symbol.output));
1325− node = AMcreateMmlNode("mrow",node);
1326− node.appendChild(result[0]);
1327− return [node,result[1]];
1328− } else { // the "|" is a \mid
1329− node = AMcreateMmlNode("mo",document.createTextNode(symbol.output));
1330− node = AMcreateMmlNode("mrow",node);
1331− return [node,str];
1332− }
1333− default:
1334−//alert("default");
1335− str = AMremoveCharsAndBlanks(str,symbol.input.length);
1336− return [AMcreateMmlNode(symbol.tag, //its a constant
1337− document.createTextNode(symbol.output)),str];
1338− }
1158+function isParentOrSelf(element, id) {
1159+ if (element == null || element.nodeName=='BODY') return false;
1160+ else if (element.id == id) return true;
1161+ else return isParentOrSelf(element.parentNode, id);
13391162}
13401163
1341−function AMparseIexpr(str) {
1342− var symbol, sym1, sym2, node, result, underover;
1343− str = AMremoveCharsAndBlanks(str,0);
1344− sym1 = AMgetSymbol(str);
1345− result = AMparseSexpr(str);
1346− node = result[0];
1347− str = result[1];
1348− symbol = AMgetSymbol(str);
1349− if (symbol.ttype == INFIX && symbol.input != "/") {
1350− str = AMremoveCharsAndBlanks(str,symbol.input.length);
1351−// if (symbol.input == "/") result = AMparseIexpr(str); else ...
1352− result = AMparseSexpr(str);
1353− if (result[0] == null) // show box in place of missing argument
1354− result[0] = AMcreateMmlNode("mo",document.createTextNode("\u25A1"));
1355− else AMremoveBrackets(result[0]);
1356− str = result[1];
1357−// if (symbol.input == "/") AMremoveBrackets(node);
1358− if (symbol.input == "_") {
1359− sym2 = AMgetSymbol(str);
1360− underover = (sym1.ttype == UNDEROVER);
1361− if (sym2.input == "^") {
1362− str = AMremoveCharsAndBlanks(str,sym2.input.length);
1363− var res2 = AMparseSexpr(str);
1364− AMremoveBrackets(res2[0]);
1365− str = res2[1];
1366− node = AMcreateMmlNode((underover?"munderover":"msubsup"),node);
1367− node.appendChild(result[0]);
1368− node.appendChild(res2[0]);
1369− node = AMcreateMmlNode("mrow",node); // so sum does not stretch
1370− } else {
1371− node = AMcreateMmlNode((underover?"munder":"msub"),node);
1372− node.appendChild(result[0]);
1373− }
1374− } else {
1375− node = AMcreateMmlNode(symbol.tag,node);
1376− node.appendChild(result[0]);
1377− }
1378− }
1379− return [node,str];
1164+function nodeValue(node) {
1165+ var result = "";
1166+ if (node.nodeType == 1) {
1167+ var children = node.childNodes;
1168+ for (var i = 0; i < children.length; ++i) {
1169+ result += nodeValue(children[i]);
1170+ }
1171+ }
1172+ else if (node.nodeType == 3) {
1173+ result = node.nodeValue;
1174+ }
1175+ return(result);
1176+}
1177+
1178+function slideLabel() {
1179+ var slideColl = GetElementsWithClassName('*','slide');
1180+ var list = document.getElementById('jumplist');
1181+ smax = slideColl.length;
1182+ for (var n = 0; n < smax; n++) {
1183+ var obj = slideColl[n];
1184+
1185+ var did = 'slide' + n.toString();
1186+ obj.setAttribute('id',did);
1187+ if (isOp) continue;
1188+
1189+ var otext = '';
1190+ var menu = obj.firstChild;
1191+ if (!menu) continue; // to cope with empty slides
1192+ while (menu && menu.nodeType == 3) {
1193+ menu = menu.nextSibling;
1194+ }
1195+ if (!menu) continue; // to cope with slides with only text nodes
1196+
1197+ var menunodes = menu.childNodes;
1198+ for (var o = 0; o < menunodes.length; o++) {
1199+ otext += nodeValue(menunodes[o]);
1200+ }
1201+ list.options[list.length] = new Option(n + ' : ' + otext, n);
1202+ }
1203+}
1204+
1205+function currentSlide() {
1206+ var cs;
1207+ if (document.getElementById) {
1208+ cs = document.getElementById('currentSlide');
1209+ } else {
1210+ cs = document.currentSlide;
1211+ }
1212+ cs.innerHTML = '<span id="csHere">' + snum + '<\/span> ' +
1213+ '<span id="csSep">\/<\/span> ' +
1214+ '<span id="csTotal">' + (smax-1) + '<\/span>';
1215+ if (snum == 0) {
1216+ cs.style.visibility = 'hidden';
1217+ } else {
1218+ cs.style.visibility = 'visible';
1219+ }
1220+}
1221+
1222+function go(step) {
1223+ if (document.getElementById('slideProj').disabled || step == 0) return;
1224+ var jl = document.getElementById('jumplist');
1225+ var cid = 'slide' + snum;
1226+ var ce = document.getElementById(cid);
1227+ if (incrementals[snum].length > 0) {
1228+ for (var i = 0; i < incrementals[snum].length; i++) {
1229+ removeClass(incrementals[snum][i], 'current');
1230+ removeClass(incrementals[snum][i], 'incremental');
1231+ }
1232+ }
1233+ if (step != 'j') {
1234+ snum += step;
1235+ lmax = smax - 1;
1236+ if (snum > lmax) snum = lmax;
1237+ if (snum < 0) snum = 0;
1238+ } else
1239+ snum = parseInt(jl.value);
1240+ var nid = 'slide' + snum;
1241+ var ne = document.getElementById(nid);
1242+ if (!ne) {
1243+ ne = document.getElementById('slide0');
1244+ snum = 0;
1245+ }
1246+ if (step < 0) {incpos = incrementals[snum].length} else {incpos = 0;}
1247+ if (incrementals[snum].length > 0 && incpos == 0) {
1248+ for (var i = 0; i < incrementals[snum].length; i++) {
1249+ if (hasClass(incrementals[snum][i], 'current'))
1250+ incpos = i + 1;
1251+ else
1252+ addClass(incrementals[snum][i], 'incremental');
1253+ }
1254+ }
1255+ if (incrementals[snum].length > 0 && incpos > 0)
1256+ addClass(incrementals[snum][incpos - 1], 'current');
1257+ ce.style.visibility = 'hidden';
1258+ ne.style.visibility = 'visible';
1259+ jl.selectedIndex = snum;
1260+ currentSlide();
1261+ number = 0;
1262+}
1263+
1264+function goTo(target) {
1265+ if (target >= smax || target == snum) return;
1266+ go(target - snum);
1267+}
1268+
1269+function subgo(step) {
1270+ if (step > 0) {
1271+ removeClass(incrementals[snum][incpos - 1],'current');
1272+ removeClass(incrementals[snum][incpos], 'incremental');
1273+ addClass(incrementals[snum][incpos],'current');
1274+ incpos++;
1275+ } else {
1276+ incpos--;
1277+ removeClass(incrementals[snum][incpos],'current');
1278+ addClass(incrementals[snum][incpos], 'incremental');
1279+ addClass(incrementals[snum][incpos - 1],'current');
1280+ }
1281+}
1282+
1283+function toggle() {
1284+ var slideColl = GetElementsWithClassName('*','slide');
1285+ var slides = document.getElementById('slideProj');
1286+ var outline = document.getElementById('outlineStyle');
1287+ if (!slides.disabled) {
1288+ slides.disabled = true;
1289+ outline.disabled = false;
1290+ s5mode = false;
1291+ fontSize('1em');
1292+ for (var n = 0; n < smax; n++) {
1293+ var slide = slideColl[n];
1294+ slide.style.visibility = 'visible';
1295+ }
1296+ } else {
1297+ slides.disabled = false;
1298+ outline.disabled = true;
1299+ s5mode = true;
1300+ fontScale();
1301+ for (var n = 0; n < smax; n++) {
1302+ var slide = slideColl[n];
1303+ slide.style.visibility = 'hidden';
1304+ }
1305+ slideColl[snum].style.visibility = 'visible';
1306+ }
1307+}
1308+
1309+function showHide(action) {
1310+ var obj = GetElementsWithClassName('*','hideme')[0];
1311+ switch (action) {
1312+ case 's': obj.style.visibility = 'visible'; break;
1313+ case 'h': obj.style.visibility = 'hidden'; break;
1314+ case 'k':
1315+ if (obj.style.visibility != 'visible') {
1316+ obj.style.visibility = 'visible';
1317+ } else {
1318+ obj.style.visibility = 'hidden';
1319+ }
1320+ break;
1321+ }
1322+}
1323+
1324+// 'keys' code adapted from MozPoint (http://mozpoint.mozdev.org/)
1325+function keys(key) {
1326+ if (!key) {
1327+ key = event;
1328+ key.which = key.keyCode;
1329+ }
1330+ if (key.which == 84) {
1331+ toggle();
1332+ return;
1333+ }
1334+ if (s5mode) {
1335+ switch (key.which) {
1336+ case 10: // return
1337+ case 13: // enter
1338+ if (window.event && isParentOrSelf(window.event.srcElement, 'controls')) return;
1339+ if (key.target && isParentOrSelf(key.target, 'controls')) return;
1340+ if(number != undef) {
1341+ goTo(number);
1342+ break;
1343+ }
1344+ case 32: // spacebar
1345+ case 34: // page down
1346+ case 39: // rightkey
1347+ case 40: // downkey
1348+ if(number != undef) {
1349+ go(number);
1350+ } else if (!incrementals[snum] || incpos >= incrementals[snum].length) {
1351+ go(1);
1352+ } else {
1353+ subgo(1);
1354+ }
1355+ break;
1356+ case 33: // page up
1357+ case 37: // leftkey
1358+ case 38: // upkey
1359+ if(number != undef) {
1360+ go(-1 * number);
1361+ } else if (!incrementals[snum] || incpos <= 0) {
1362+ go(-1);
1363+ } else {
1364+ subgo(-1);
1365+ }
1366+ break;
1367+ case 36: // home
1368+ goTo(0);
1369+ break;
1370+ case 35: // end
1371+ goTo(smax-1);
1372+ break;
1373+ case 67: // c
1374+ showHide('k');
1375+ break;
1376+ }
1377+ if (key.which < 48 || key.which > 57) {
1378+ number = undef;
1379+ } else {
1380+ if (window.event && isParentOrSelf(window.event.srcElement, 'controls')) return;
1381+ if (key.target && isParentOrSelf(key.target, 'controls')) return;
1382+ number = (((number != undef) ? number : 0) * 10) + (key.which - 48);
1383+ }
1384+ }
1385+ return false;
13801386}
13811387
1382−function AMparseExpr(str,rightbracket) {
1383− var symbol, node, result, i, nodeList = [],
1384− newFrag = document.createDocumentFragment();
1385− do {
1386− str = AMremoveCharsAndBlanks(str,0);
1387− result = AMparseIexpr(str);
1388− node = result[0];
1389− str = result[1];
1390− symbol = AMgetSymbol(str);
1391− if (symbol.ttype == INFIX && symbol.input == "/") {
1392− str = AMremoveCharsAndBlanks(str,symbol.input.length);
1393− result = AMparseIexpr(str);
1394− if (result[0] == null) // show box in place of missing argument
1395− result[0] = AMcreateMmlNode("mo",document.createTextNode("\u25A1"));
1396− else AMremoveBrackets(result[0]);
1397− str = result[1];
1398− AMremoveBrackets(node);
1399− node = AMcreateMmlNode(symbol.tag,node);
1400− node.appendChild(result[0]);
1401− newFrag.appendChild(node);
1402− symbol = AMgetSymbol(str);
1403− }
1404− else if (node!=undefined) newFrag.appendChild(node);
1405− } while ((symbol.ttype != RIGHTBRACKET &&
1406− (symbol.ttype != LEFTRIGHT || rightbracket)
1407− || AMnestingDepth == 0) && symbol!=null && symbol.output!="");
1408− if (symbol.ttype == RIGHTBRACKET || symbol.ttype == LEFTRIGHT) {
1409−// if (AMnestingDepth > 0) AMnestingDepth--;
1410− var len = newFrag.childNodes.length;
1411− if (len>0 && newFrag.childNodes[len-1].nodeName == "mrow" && len>1 &&
1412− newFrag.childNodes[len-2].nodeName == "mo" &&
1413− newFrag.childNodes[len-2].firstChild.nodeValue == ",") { //matrix
1414− var right = newFrag.childNodes[len-1].lastChild.firstChild.nodeValue;
1415− if (right==")" || right=="]") {
1416− var left = newFrag.childNodes[len-1].firstChild.firstChild.nodeValue;
1417− if (left=="(" && right==")" && symbol.output != "}" ||
1418− left=="[" && right=="]") {
1419− var pos = []; // positions of commas
1420− var matrix = true;
1421− var m = newFrag.childNodes.length;
1422− for (i=0; matrix && i<m; i=i+2) {
1423− pos[i] = [];
1424− node = newFrag.childNodes[i];
1425− if (matrix) matrix = node.nodeName=="mrow" &&
1426− (i==m-1 || node.nextSibling.nodeName=="mo" &&
1427− node.nextSibling.firstChild.nodeValue==",")&&
1428− node.firstChild.firstChild.nodeValue==left &&
1429− node.lastChild.firstChild.nodeValue==right;
1430− if (matrix)
1431− for (var j=0; j<node.childNodes.length; j++)
1432− if (node.childNodes[j].firstChild.nodeValue==",")
1433− pos[i][pos[i].length]=j;
1434− if (matrix && i>1) matrix = pos[i].length == pos[i-2].length;
1435− }
1436− if (matrix) {
1437− var row, frag, n, k, table = document.createDocumentFragment();
1438− for (i=0; i<m; i=i+2) {
1439− row = document.createDocumentFragment();
1440− frag = document.createDocumentFragment();
1441− node = newFrag.firstChild; // <mrow>(-,-,...,-,-)</mrow>
1442− n = node.childNodes.length;
1443− k = 0;
1444− node.removeChild(node.firstChild); //remove (
1445− for (j=1; j<n-1; j++) {
1446− if (typeof pos[i][k] != "undefined" && j==pos[i][k]){
1447− node.removeChild(node.firstChild); //remove ,
1448− row.appendChild(AMcreateMmlNode("mtd",frag));
1449− k++;
1450− } else frag.appendChild(node.firstChild);
1451− }
1452− row.appendChild(AMcreateMmlNode("mtd",frag));
1453− if (newFrag.childNodes.length>2) {
1454− newFrag.removeChild(newFrag.firstChild); //remove <mrow>)</mrow>
1455− newFrag.removeChild(newFrag.firstChild); //remove <mo>,</mo>
1456− }
1457− table.appendChild(AMcreateMmlNode("mtr",row));
1458− }
1459− node = AMcreateMmlNode("mtable",table);
1460− if (typeof symbol.invisible == "boolean" && symbol.invisible) node.setAttribute("columnalign","left");
1461− newFrag.replaceChild(node,newFrag.firstChild);
1462− }
1463− }
1464− }
1465− }
1466− str = AMremoveCharsAndBlanks(str,symbol.input.length);
1467− if (typeof symbol.invisible != "boolean" || !symbol.invisible) {
1468− node = AMcreateMmlNode("mo",document.createTextNode(symbol.output));
1469− newFrag.appendChild(node);
1470− }
1471− }
1472− return [newFrag,str];
1388+function clicker(e) {
1389+ number = undef;
1390+ var target;
1391+ if (window.event) {
1392+ target = window.event.srcElement;
1393+ e = window.event;
1394+ } else target = e.target;
1395+ if (target.getAttribute('href') != null || hasValue(target.rel, 'external') || isParentOrSelf(target, 'controls') || isParentOrSelf(target,'embed') || isParentOrSelf(target,'object')) return true;
1396+ if (!e.which || e.which == 1) {
1397+ if (!incrementals[snum] || incpos >= incrementals[snum].length) {
1398+ go(1);
1399+ } else {
1400+ subgo(1);
1401+ }
1402+ }
14731403}
14741404
1475−function AMparseMath(str) {
1476− var result, node = AMcreateElementMathML("mstyle");
1477− if (mathcolor != "") node.setAttribute("mathcolor",mathcolor);
1478− if (displaystyle) node.setAttribute("displaystyle","true");
1479− if (mathfontfamily != "") node.setAttribute("fontfamily",mathfontfamily);
1480− AMnestingDepth = 0;
1481− node.appendChild(AMparseExpr(str.replace(/^\s+/g,""),false)[0]);
1482− node = AMcreateMmlNode("math",node);
1483− if (showasciiformulaonhover) //fixed by djhsu so newline
1484− node.setAttribute("title",str.replace(/\s+/g," "));//does not show in Gecko
1485− if (mathfontfamily != "" && (isIE || mathfontfamily != "serif")) {
1486− var fnode = AMcreateElementXHTML("font");
1487− fnode.setAttribute("face",mathfontfamily);
1488− fnode.appendChild(node);
1489− return fnode;
1490− }
1491− return node;
1405+function findSlide(hash) {
1406+ var target = null;
1407+ var slides = GetElementsWithClassName('*','slide');
1408+ for (var i = 0; i < slides.length; i++) {
1409+ var targetSlide = slides[i];
1410+ if ( (targetSlide.name && targetSlide.name == hash)
1411+ || (targetSlide.id && targetSlide.id == hash) ) {
1412+ target = targetSlide;
1413+ break;
1414+ }
1415+ }
1416+ while(target != null && target.nodeName != 'BODY') {
1417+ if (hasClass(target, 'slide')) {
1418+ return parseInt(target.id.slice(5));
1419+ }
1420+ target = target.parentNode;
1421+ }
1422+ return null;
14921423}
14931424
1494−function AMstrarr2docFrag(arr, linebreaks) {
1495− var newFrag=document.createDocumentFragment();
1496− var expr = false;
1497− for (var i=0; i<arr.length; i++) {
1498− if (expr) newFrag.appendChild(AMparseMath(arr[i]));
1499− else {
1500− var arri = (linebreaks ? arr[i].split("\n\n") : [arr[i]]);
1501− newFrag.appendChild(AMcreateElementXHTML("span").
1502− appendChild(document.createTextNode(arri[0])));
1503− for (var j=1; j<arri.length; j++) {
1504− newFrag.appendChild(AMcreateElementXHTML("p"));
1505− newFrag.appendChild(AMcreateElementXHTML("span").
1506− appendChild(document.createTextNode(arri[j])));
1507− }
1508− }
1509− expr = !expr;
1510− }
1511− return newFrag;
1425+function slideJump() {
1426+ if (window.location.hash == null) return;
1427+ var sregex = /^#slide(\d+)$/;
1428+ var matches = sregex.exec(window.location.hash);
1429+ var dest = null;
1430+ if (matches != null) {
1431+ dest = parseInt(matches[1]);
1432+ } else {
1433+ dest = findSlide(window.location.hash.slice(1));
1434+ }
1435+ if (dest != null)
1436+ go(dest - snum);
15121437}
15131438
1514−function AMprocessNodeR(n, linebreaks) {
1515− var mtch, str, arr, frg, i;
1516− if (n.childNodes.length == 0) {
1517− if ((n.nodeType!=8 || linebreaks) &&
1518− n.parentNode.nodeName!="form" && n.parentNode.nodeName!="FORM" &&
1519− n.parentNode.nodeName!="textarea" && n.parentNode.nodeName!="TEXTAREA" &&
1520− n.parentNode.nodeName!="code" && n.parentNode.nodeName!="CODE" && /* ASCIIMathML.js - copyright Peter Jipsen, released under the GPL
1521−See http://www1.chapman.edu/~jipsen/mathml/asciimath.html/ */
1522− n.parentNode.nodeName!="pre" && n.parentNode.nodeName!="PRE") {
1523− str = n.nodeValue;
1524− if (!(str == null)) {
1525− str = str.replace(/\r\n\r\n/g,"\n\n");
1526− if (doubleblankmathdelimiter) {
1527− str = str.replace(/\x20\x20\./g," "+AMdelimiter1+".");
1528− str = str.replace(/\x20\x20,/g," "+AMdelimiter1+",");
1529− str = str.replace(/\x20\x20/g," "+AMdelimiter1+" ");
1530− }
1531− str = str.replace(/\x20+/g," ");
1532− str = str.replace(/\s*\r\n/g," ");
1533− mtch = false;
1534− str = str.replace(new RegExp(AMescape2, "g"),
1535− function(st){mtch=true;return "AMescape2"});
1536− str = str.replace(new RegExp(AMescape1, "g"),
1537− function(st){mtch=true;return "AMescape1"});
1538− str = str.replace(new RegExp(AMdelimiter2regexp, "g"),AMdelimiter1);
1539− arr = str.split(AMdelimiter1);
1540− for (i=0; i<arr.length; i++)
1541− arr[i]=arr[i].replace(/AMescape2/g,AMdelimiter2).
1542− replace(/AMescape1/g,AMdelimiter1);
1543− if (arr.length>1 || mtch) {
1544− if (checkForMathML) {
1545− checkForMathML = false;
1546− var nd = AMisMathMLavailable();
1547− AMnoMathML = nd != null;
1548− if (AMnoMathML && notifyIfNoMathML)
1549− if (alertIfNoMathML)
1550− alert("To view the ASCIIMathML notation use Internet Explorer 6 +\nMathPlayer (free from www.dessci.com)\n\
1551− or Firefox/Mozilla/Netscape");
1552− else AMbody.insertBefore(nd,AMbody.childNodes[0]);
1553− }
1554− if (!AMnoMathML) {
1555− frg = AMstrarr2docFrag(arr,n.nodeType==8);
1556− var len = frg.childNodes.length;
1557− n.parentNode.replaceChild(frg,n);
1558− return len-1;
1559− } else return 0;
1560− }
1561− }
1562− } else return 0;
1563− } else if (n.nodeName!="math") {
1564− for (i=0; i<n.childNodes.length; i++)
1565− i += AMprocessNodeR(n.childNodes[i], linebreaks);
1566− }
1567− return 0;
1439+function fixLinks() {
1440+ var thisUri = window.location.href;
1441+ thisUri = thisUri.slice(0, thisUri.length - window.location.hash.length);
1442+ var aelements = document.getElementsByTagName('A');
1443+ for (var i = 0; i < aelements.length; i++) {
1444+ var a = aelements[i].href;
1445+ var slideID = a.match('\#slide[0-9]{1,2}');
1446+ if ((slideID) && (slideID[0].slice(0,1) == '#')) {
1447+ var dest = findSlide(slideID[0].slice(1));
1448+ if (dest != null) {
1449+ if (aelements[i].addEventListener) {
1450+ aelements[i].addEventListener("click", new Function("e",
1451+ "if (document.getElementById('slideProj').disabled) return;" +
1452+ "go("+dest+" - snum); " +
1453+ "if (e.preventDefault) e.preventDefault();"), true);
1454+ } else if (aelements[i].attachEvent) {
1455+ aelements[i].attachEvent("onclick", new Function("",
1456+ "if (document.getElementById('slideProj').disabled) return;" +
1457+ "go("+dest+" - snum); " +
1458+ "event.returnValue = false;"));
1459+ }
1460+ }
1461+ }
1462+ }
1463+}
1464+
1465+function externalLinks() {
1466+ if (!document.getElementsByTagName) return;
1467+ var anchors = document.getElementsByTagName('a');
1468+ for (var i=0; i<anchors.length; i++) {
1469+ var anchor = anchors[i];
1470+ if (anchor.getAttribute('href') && hasValue(anchor.rel, 'external')) {
1471+ anchor.target = '_blank';
1472+ addClass(anchor,'external');
1473+ }
1474+ }
15681475}
15691476
1570−function AMprocessNode(n, linebreaks, spanclassAM) {
1571− var frag,st;
1572− if (spanclassAM!=null) {
1573− frag = document.getElementsByTagName("span")
1574− for (var i=0;i<frag.length;i++)
1575− if (frag[i].className == "AM")
1576− AMprocessNodeR(frag[i],linebreaks);
1577− } else {
1578− try {
1579− st = n.innerHTML;
1580− } catch(err) {}
1581− if (st==null ||
1582− st.indexOf(AMdelimiter1)!=-1 || st.indexOf(AMdelimiter2)!=-1)
1583− AMprocessNodeR(n,linebreaks);
1584− }
1585− if (isIE) { //needed to match size and font of formula to surrounding text
1586− frag = document.getElementsByTagName('math');
1587− for (var i=0;i<frag.length;i++) frag[i].update()
1588− }
1477+function createControls() {
1478+ var controlsDiv = document.getElementById("controls");
1479+ if (!controlsDiv) return;
1480+ var hider = ' onmouseover="showHide(\'s\');" onmouseout="showHide(\'h\');"';
1481+ var hideDiv, hideList = '';
1482+ if (controlVis == 'hidden') {
1483+ hideDiv = hider;
1484+ } else {
1485+ hideList = hider;
1486+ }
1487+ controlsDiv.innerHTML = '<form action="#" id="controlForm"' + hideDiv + '>' +
1488+ '<div id="navLinks">' +
1489+ '<a accesskey="t" id="toggle" href="javascript:toggle();">&#216;<\/a>' +
1490+ '<a accesskey="z" id="prev" href="javascript:go(-1);">&laquo;<\/a>' +
1491+ '<a accesskey="x" id="next" href="javascript:go(1);">&raquo;<\/a>' +
1492+ '<div id="navList"' + hideList + '><select id="jumplist" onchange="go(\'j\');"><\/select><\/div>' +
1493+ '<\/div><\/form>';
1494+ if (controlVis == 'hidden') {
1495+ var hidden = document.getElementById('navLinks');
1496+ } else {
1497+ var hidden = document.getElementById('jumplist');
1498+ }
1499+ addClass(hidden,'hideme');
15891500}
15901501
1591−var AMbody;
1592−var AMnoMathML = false, AMtranslated = false;
1502+function fontScale() { // causes layout problems in FireFox that get fixed if browser's Reload is used; same may be true of other Gecko-based browsers
1503+ if (!s5mode) return false;
1504+ var vScale = 22; // both yield 32 (after rounding) at 1024x768
1505+ var hScale = 32; // perhaps should auto-calculate based on theme's declared value?
1506+ if (window.innerHeight) {
1507+ var vSize = window.innerHeight;
1508+ var hSize = window.innerWidth;
1509+ } else if (document.documentElement.clientHeight) {
1510+ var vSize = document.documentElement.clientHeight;
1511+ var hSize = document.documentElement.clientWidth;
1512+ } else if (document.body.clientHeight) {
1513+ var vSize = document.body.clientHeight;
1514+ var hSize = document.body.clientWidth;
1515+ } else {
1516+ var vSize = 700; // assuming 1024x768, minus chrome and such
1517+ var hSize = 1024; // these do not account for kiosk mode or Opera Show
1518+ }
1519+ var newSize = Math.min(Math.round(vSize/vScale),Math.round(hSize/hScale));
1520+ fontSize(newSize + 'px');
1521+ if (isGe) { // hack to counter incremental reflow bugs
1522+ var obj = document.getElementsByTagName('body')[0];
1523+ obj.style.display = 'none';
1524+ obj.style.display = 'block';
1525+ }
1526+}
15931527
1594−function translate(spanclassAM) {
1595− if (!AMtranslated) { // run this only once
1596− AMtranslated = true;
1597− AMinitSymbols();
1598− AMbody = document.getElementsByTagName("body")[0];
1599− AMprocessNode(AMbody, false, spanclassAM);
1600− }
1528+function fontSize(value) {
1529+ if (!(s5ss = document.getElementById('s5ss'))) {
1530+ if (!isIE) {
1531+ document.getElementsByTagName('head')[0].appendChild(s5ss = document.createElement('style'));
1532+ s5ss.setAttribute('media','screen, projection');
1533+ s5ss.setAttribute('id','s5ss');
1534+ } else {
1535+ document.createStyleSheet();
1536+ document.s5ss = document.styleSheets[document.styleSheets.length - 1];
1537+ }
1538+ }
1539+ if (!isIE) {
1540+ while (s5ss.lastChild) s5ss.removeChild(s5ss.lastChild);
1541+ s5ss.appendChild(document.createTextNode('body {font-size: ' + value + ' !important;}'));
1542+ } else {
1543+ document.s5ss.addRule('body','font-size: ' + value + ' !important;');
1544+ }
16011545}
16021546
1603−if (isIE) { // avoid adding MathPlayer info explicitly to each webpage
1604− document.write("<object id=\"mathplayer\"\
1605− classid=\"clsid:32F66A20-7614-11D4-BD11-00104BD3F987\"></object>");
1606− document.write("<?import namespace=\"m\" implementation=\"#mathplayer\"?>");
1547+function notOperaFix() {
1548+ slideCSS = document.getElementById('slideProj').href;
1549+ var slides = document.getElementById('slideProj');
1550+ var outline = document.getElementById('outlineStyle');
1551+ slides.setAttribute('media','screen');
1552+ outline.disabled = true;
1553+ if (isGe) {
1554+ slides.setAttribute('href','null'); // Gecko fix
1555+ slides.setAttribute('href',slideCSS); // Gecko fix
1556+ }
1557+ if (isIE && document.styleSheets && document.styleSheets[0]) {
1558+ document.styleSheets[0].addRule('img', 'behavior: url(ui/default/iepngfix.htc)');
1559+ document.styleSheets[0].addRule('div', 'behavior: url(ui/default/iepngfix.htc)');
1560+ document.styleSheets[0].addRule('.slide', 'behavior: url(ui/default/iepngfix.htc)');
1561+ }
16071562}
16081563
1609−// GO1.1 Generic onload by Brothercake
1610−// http://www.brothercake.com/
1611−//onload function (replaces the onload="translate()" in the <body> tag)
1612−function generic()
1613−{
1614− translate();
1615−};
1616−//setup onload function
1617−if(typeof window.addEventListener != 'undefined')
1618−{
1619− //.. gecko, safari, konqueror and standard
1620− window.addEventListener('load', generic, false);
1564+function getIncrementals(obj) {
1565+ var incrementals = new Array();
1566+ if (!obj)
1567+ return incrementals;
1568+ var children = obj.childNodes;
1569+ for (var i = 0; i < children.length; i++) {
1570+ var child = children[i];
1571+ if (hasClass(child, 'incremental')) {
1572+ if (child.nodeName == 'OL' || child.nodeName == 'UL') {
1573+ removeClass(child, 'incremental');
1574+ for (var j = 0; j < child.childNodes.length; j++) {
1575+ if (child.childNodes[j].nodeType == 1) {
1576+ addClass(child.childNodes[j], 'incremental');
1577+ }
1578+ }
1579+ } else {
1580+ incrementals[incrementals.length] = child;
1581+ removeClass(child,'incremental');
1582+ }
1583+ }
1584+ if (hasClass(child, 'show-first')) {
1585+ if (child.nodeName == 'OL' || child.nodeName == 'UL') {
1586+ removeClass(child, 'show-first');
1587+ if (child.childNodes[isGe].nodeType == 1) {
1588+ removeClass(child.childNodes[isGe], 'incremental');
1589+ }
1590+ } else {
1591+ incrementals[incrementals.length] = child;
1592+ }
1593+ }
1594+ incrementals = incrementals.concat(getIncrementals(child));
1595+ }
1596+ return incrementals;
16211597}
1622−else if(typeof document.addEventListener != 'undefined')
1623−{
1624− //.. opera 7
1625− document.addEventListener('load', generic, false);
1598+
1599+function createIncrementals() {
1600+ var incrementals = new Array();
1601+ for (var i = 0; i < smax; i++) {
1602+ incrementals[i] = getIncrementals(document.getElementById('slide'+i));
1603+ }
1604+ return incrementals;
16261605}
1627−else if(typeof window.attachEvent != 'undefined')
1628−{
1629− //.. win/ie
1630− window.attachEvent('onload', generic);
1606+
1607+function defaultCheck() {
1608+ var allMetas = document.getElementsByTagName('meta');
1609+ for (var i = 0; i< allMetas.length; i++) {
1610+ if (allMetas[i].name == 'defaultView') {
1611+ defaultView = allMetas[i].content;
1612+ }
1613+ if (allMetas[i].name == 'controlVis') {
1614+ controlVis = allMetas[i].content;
1615+ }
1616+ }
16311617}
1632−//** remove this condition to degrade older browsers
1633−else
1634−{
1635− //.. mac/ie5 and anything else that gets this far
1636− //if there's an existing onload function
1637− if(typeof window.onload == 'function')
1638− {
1639− //store it
1640− var existing = onload;
1641− //add new onload handler
1642− window.onload = function()
1643− {
1644− //call existing onload function
1645− existing();
1646− //call generic onload function
1647− generic();
1648− };
1649− }
1650− else
1651− {
1652− //setup onload function
1653− window.onload = generic;
1654− }
1618+
1619+// Key trap fix, new function body for trap()
1620+function trap(e) {
1621+ if (!e) {
1622+ e = event;
1623+ e.which = e.keyCode;
1624+ }
1625+ try {
1626+ modifierKey = e.ctrlKey || e.altKey || e.metaKey;
1627+ }
1628+ catch(e) {
1629+ modifierKey = false;
1630+ }
1631+ return modifierKey || e.which == 0;
16551632}
1656−</script>
1633+
1634+function startup() {
1635+ defaultCheck();
1636+ if (!isOp)
1637+ createControls();
1638+ slideLabel();
1639+ fixLinks();
1640+ externalLinks();
1641+ fontScale();
1642+ if (!isOp) {
1643+ notOperaFix();
1644+ incrementals = createIncrementals();
1645+ slideJump();
1646+ if (defaultView == 'outline') {
1647+ toggle();
1648+ }
1649+ document.onkeyup = keys;
1650+ document.onkeypress = trap;
1651+ document.onclick = clicker;
1652+ }
1653+}
1654+
1655+window.onload = startup;
1656+window.onresize = function(){setTimeout('fontScale()', 50);}</script>
16571657</head
16581658 ><body
16591659 ><div class="layout">