Ajout : doc/
[tool/hledger.git] / doc / hledger.fr.slidy.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
4 <head>
5 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
6 <meta name="copyright" content="© 2014 (CC) BY Julien Moutinho &amp;lt;julm+hledger@autogeree.net&amp;gt;" />
7 <meta name="generator" content="AsciiDoc 8.6.9 / slidy2 backend 1.0.3" />
8 <meta name="font-size-adjustment" content="-3" />
9 <title>Informatiser une comptabilité avec confiance</title>
10 <style type="text/css">
11 /* Shared CSS for AsciiDoc xhtml11 and html5 backends */
12
13 /* Default font. */
14 body {
15 font-family: Georgia,serif;
16 }
17
18 /* Title font. */
19 h1, h2, h3, h4, h5, h6,
20 div.title, caption.title,
21 thead, p.table.header,
22 #toctitle,
23 #author, #revnumber, #revdate, #revremark,
24 #footer {
25 font-family: Arial,Helvetica,sans-serif;
26 }
27
28 body {
29 margin: 1em 5% 1em 5%;
30 }
31
32 a {
33 color: blue;
34 text-decoration: underline;
35 }
36 a:visited {
37 color: fuchsia;
38 }
39
40 em {
41 font-style: italic;
42 color: navy;
43 }
44
45 strong {
46 font-weight: bold;
47 color: #083194;
48 }
49
50 h1, h2, h3, h4, h5, h6 {
51 color: #527bbd;
52 margin-top: 1.2em;
53 margin-bottom: 0.5em;
54 line-height: 1.3;
55 }
56
57 h1, h2, h3 {
58 border-bottom: 2px solid silver;
59 }
60 h2 {
61 padding-top: 0.5em;
62 }
63 h3 {
64 float: left;
65 }
66 h3 + * {
67 clear: left;
68 }
69 h5 {
70 font-size: 1.0em;
71 }
72
73 div.sectionbody {
74 margin-left: 0;
75 }
76
77 hr {
78 border: 1px solid silver;
79 }
80
81 p {
82 margin-top: 0.5em;
83 margin-bottom: 0.5em;
84 }
85
86 ul, ol, li > p {
87 margin-top: 0;
88 }
89 ul > li { color: #aaa; }
90 ul > li > * { color: black; }
91
92 .monospaced, code, pre {
93 font-family: "Courier New", Courier, monospace;
94 font-size: inherit;
95 color: navy;
96 padding: 0;
97 margin: 0;
98 }
99 pre {
100 white-space: pre-wrap;
101 }
102
103 #author {
104 color: #527bbd;
105 font-weight: bold;
106 font-size: 1.1em;
107 }
108 #email {
109 }
110 #revnumber, #revdate, #revremark {
111 }
112
113 #footer {
114 font-size: small;
115 border-top: 2px solid silver;
116 padding-top: 0.5em;
117 margin-top: 4.0em;
118 }
119 #footer-text {
120 float: left;
121 padding-bottom: 0.5em;
122 }
123 #footer-badges {
124 float: right;
125 padding-bottom: 0.5em;
126 }
127
128 #preamble {
129 margin-top: 1.5em;
130 margin-bottom: 1.5em;
131 }
132 div.imageblock, div.exampleblock, div.verseblock,
133 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
134 div.admonitionblock {
135 margin-top: 1.0em;
136 margin-bottom: 1.5em;
137 }
138 div.admonitionblock {
139 margin-top: 2.0em;
140 margin-bottom: 2.0em;
141 margin-right: 10%;
142 color: #606060;
143 }
144
145 div.content { /* Block element content. */
146 padding: 0;
147 }
148
149 /* Block element titles. */
150 div.title, caption.title {
151 color: #527bbd;
152 font-weight: bold;
153 text-align: left;
154 margin-top: 1.0em;
155 margin-bottom: 0.5em;
156 }
157 div.title + * {
158 margin-top: 0;
159 }
160
161 td div.title:first-child {
162 margin-top: 0.0em;
163 }
164 div.content div.title:first-child {
165 margin-top: 0.0em;
166 }
167 div.content + div.title {
168 margin-top: 0.0em;
169 }
170
171 div.sidebarblock > div.content {
172 background: #ffffee;
173 border: 1px solid #dddddd;
174 border-left: 4px solid #f0f0f0;
175 padding: 0.5em;
176 }
177
178 div.listingblock > div.content {
179 border: 1px solid #dddddd;
180 border-left: 5px solid #f0f0f0;
181 background: #f8f8f8;
182 padding: 0.5em;
183 }
184
185 div.quoteblock, div.verseblock {
186 padding-left: 1.0em;
187 margin-left: 1.0em;
188 margin-right: 10%;
189 border-left: 5px solid #f0f0f0;
190 color: #888;
191 }
192
193 div.quoteblock > div.attribution {
194 padding-top: 0.5em;
195 text-align: right;
196 }
197
198 div.verseblock > pre.content {
199 font-family: inherit;
200 font-size: inherit;
201 }
202 div.verseblock > div.attribution {
203 padding-top: 0.75em;
204 text-align: left;
205 }
206 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
207 div.verseblock + div.attribution {
208 text-align: left;
209 }
210
211 div.admonitionblock .icon {
212 vertical-align: top;
213 font-size: 1.1em;
214 font-weight: bold;
215 text-decoration: underline;
216 color: #527bbd;
217 padding-right: 0.5em;
218 }
219 div.admonitionblock td.content {
220 padding-left: 0.5em;
221 border-left: 3px solid #dddddd;
222 }
223
224 div.exampleblock > div.content {
225 border-left: 3px solid #dddddd;
226 padding-left: 0.5em;
227 }
228
229 div.imageblock div.content { padding-left: 0; }
230 span.image img { border-style: none; vertical-align: text-bottom; }
231 a.image:visited { color: white; }
232
233 dl {
234 margin-top: 0.8em;
235 margin-bottom: 0.8em;
236 }
237 dt {
238 margin-top: 0.5em;
239 margin-bottom: 0;
240 font-style: normal;
241 color: navy;
242 }
243 dd > *:first-child {
244 margin-top: 0.1em;
245 }
246
247 ul, ol {
248 list-style-position: outside;
249 }
250 ol.arabic {
251 list-style-type: decimal;
252 }
253 ol.loweralpha {
254 list-style-type: lower-alpha;
255 }
256 ol.upperalpha {
257 list-style-type: upper-alpha;
258 }
259 ol.lowerroman {
260 list-style-type: lower-roman;
261 }
262 ol.upperroman {
263 list-style-type: upper-roman;
264 }
265
266 div.compact ul, div.compact ol,
267 div.compact p, div.compact p,
268 div.compact div, div.compact div {
269 margin-top: 0.1em;
270 margin-bottom: 0.1em;
271 }
272
273 tfoot {
274 font-weight: bold;
275 }
276 td > div.verse {
277 white-space: pre;
278 }
279
280 div.hdlist {
281 margin-top: 0.8em;
282 margin-bottom: 0.8em;
283 }
284 div.hdlist tr {
285 padding-bottom: 15px;
286 }
287 dt.hdlist1.strong, td.hdlist1.strong {
288 font-weight: bold;
289 }
290 td.hdlist1 {
291 vertical-align: top;
292 font-style: normal;
293 padding-right: 0.8em;
294 color: navy;
295 }
296 td.hdlist2 {
297 vertical-align: top;
298 }
299 div.hdlist.compact tr {
300 margin: 0;
301 padding-bottom: 0;
302 }
303
304 .comment {
305 background: yellow;
306 }
307
308 .footnote, .footnoteref {
309 font-size: 0.8em;
310 }
311
312 span.footnote, span.footnoteref {
313 vertical-align: super;
314 }
315
316 #footnotes {
317 margin: 20px 0 20px 0;
318 padding: 7px 0 0 0;
319 }
320
321 #footnotes div.footnote {
322 margin: 0 0 5px 0;
323 }
324
325 #footnotes hr {
326 border: none;
327 border-top: 1px solid silver;
328 height: 1px;
329 text-align: left;
330 margin-left: 0;
331 width: 20%;
332 min-width: 100px;
333 }
334
335 div.colist td {
336 padding-right: 0.5em;
337 padding-bottom: 0.3em;
338 vertical-align: top;
339 }
340 div.colist td img {
341 margin-top: 0.3em;
342 }
343
344 @media print {
345 #footer-badges { display: none; }
346 }
347
348 #toc {
349 margin-bottom: 2.5em;
350 }
351
352 #toctitle {
353 color: #527bbd;
354 font-size: 1.1em;
355 font-weight: bold;
356 margin-top: 1.0em;
357 margin-bottom: 0.1em;
358 }
359
360 div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
361 margin-top: 0;
362 margin-bottom: 0;
363 }
364 div.toclevel2 {
365 margin-left: 2em;
366 font-size: 0.9em;
367 }
368 div.toclevel3 {
369 margin-left: 4em;
370 font-size: 0.9em;
371 }
372 div.toclevel4 {
373 margin-left: 6em;
374 font-size: 0.9em;
375 }
376
377 span.aqua { color: aqua; }
378 span.black { color: black; }
379 span.blue { color: blue; }
380 span.fuchsia { color: fuchsia; }
381 span.gray { color: gray; }
382 span.green { color: green; }
383 span.lime { color: lime; }
384 span.maroon { color: maroon; }
385 span.navy { color: navy; }
386 span.olive { color: olive; }
387 span.purple { color: purple; }
388 span.red { color: red; }
389 span.silver { color: silver; }
390 span.teal { color: teal; }
391 span.white { color: white; }
392 span.yellow { color: yellow; }
393
394 span.aqua-background { background: aqua; }
395 span.black-background { background: black; }
396 span.blue-background { background: blue; }
397 span.fuchsia-background { background: fuchsia; }
398 span.gray-background { background: gray; }
399 span.green-background { background: green; }
400 span.lime-background { background: lime; }
401 span.maroon-background { background: maroon; }
402 span.navy-background { background: navy; }
403 span.olive-background { background: olive; }
404 span.purple-background { background: purple; }
405 span.red-background { background: red; }
406 span.silver-background { background: silver; }
407 span.teal-background { background: teal; }
408 span.white-background { background: white; }
409 span.yellow-background { background: yellow; }
410
411 span.big { font-size: 2em; }
412 span.small { font-size: 0.6em; }
413
414 span.underline { text-decoration: underline; }
415 span.overline { text-decoration: overline; }
416 span.line-through { text-decoration: line-through; }
417
418 div.unbreakable { page-break-inside: avoid; }
419
420
421 /*
422 * xhtml11 specific
423 *
424 * */
425
426 div.tableblock {
427 margin-top: 1.0em;
428 margin-bottom: 1.5em;
429 }
430 div.tableblock > table {
431 border: 3px solid #527bbd;
432 }
433 thead, p.table.header {
434 font-weight: bold;
435 color: #527bbd;
436 }
437 p.table {
438 margin-top: 0;
439 }
440 /* Because the table frame attribute is overriden by CSS in most browsers. */
441 div.tableblock > table[frame="void"] {
442 border-style: none;
443 }
444 div.tableblock > table[frame="hsides"] {
445 border-left-style: none;
446 border-right-style: none;
447 }
448 div.tableblock > table[frame="vsides"] {
449 border-top-style: none;
450 border-bottom-style: none;
451 }
452
453
454 /*
455 * html5 specific
456 *
457 * */
458
459 table.tableblock {
460 margin-top: 1.0em;
461 margin-bottom: 1.5em;
462 }
463 thead, p.tableblock.header {
464 font-weight: bold;
465 color: #527bbd;
466 }
467 p.tableblock {
468 margin-top: 0;
469 }
470 table.tableblock {
471 border-width: 3px;
472 border-spacing: 0px;
473 border-style: solid;
474 border-color: #527bbd;
475 border-collapse: collapse;
476 }
477 th.tableblock, td.tableblock {
478 border-width: 1px;
479 padding: 4px;
480 border-style: solid;
481 border-color: #527bbd;
482 }
483
484 table.tableblock.frame-topbot {
485 border-left-style: hidden;
486 border-right-style: hidden;
487 }
488 table.tableblock.frame-sides {
489 border-top-style: hidden;
490 border-bottom-style: hidden;
491 }
492 table.tableblock.frame-none {
493 border-style: hidden;
494 }
495
496 th.tableblock.halign-left, td.tableblock.halign-left {
497 text-align: left;
498 }
499 th.tableblock.halign-center, td.tableblock.halign-center {
500 text-align: center;
501 }
502 th.tableblock.halign-right, td.tableblock.halign-right {
503 text-align: right;
504 }
505
506 th.tableblock.valign-top, td.tableblock.valign-top {
507 vertical-align: top;
508 }
509 th.tableblock.valign-middle, td.tableblock.valign-middle {
510 vertical-align: middle;
511 }
512 th.tableblock.valign-bottom, td.tableblock.valign-bottom {
513 vertical-align: bottom;
514 }
515
516
517 /*
518 * manpage specific
519 *
520 * */
521
522 body.manpage h1 {
523 padding-top: 0.5em;
524 padding-bottom: 0.5em;
525 border-top: 2px solid silver;
526 border-bottom: 2px solid silver;
527 }
528 body.manpage h2 {
529 border-style: none;
530 }
531 body.manpage div.sectionbody {
532 margin-left: 3em;
533 }
534
535 @media print {
536 body.manpage div#toc { display: none; }
537 }
538 </style>
539 <style type="text/css">
540 /* slidy.css
541
542 Copyright (c) 2005-2010 W3C (MIT, ERCIM, Keio), All Rights Reserved.
543 W3C liability, trademark, document use and software licensing
544 rules apply, see:
545
546 http://www.w3.org/Consortium/Legal/copyright-documents
547 http://www.w3.org/Consortium/Legal/copyright-software
548 */
549
550 /*
551 SJR: 2010-09-29: Modified for AsciiDoc slidy backend.
552 Mostly just commented out stuff that is handled by AsciiDoc's CSS files.
553 */
554
555 body
556 {
557 margin: 0 0 0 0;
558 padding: 0 0 0 0;
559 width: 100%;
560 height: 100%;
561 color: black;
562 background-color: white;
563 /*
564 font-family: "Gill Sans MT", "Gill Sans", GillSans, sans-serif;
565 */
566 font-size: 14pt;
567 }
568
569 div.toolbar {
570 position: fixed; z-index: 200;
571 top: auto; bottom: 0; left: 0; right: 0;
572 height: 1.2em; text-align: right;
573 padding-left: 1em;
574 padding-right: 1em;
575 font-size: 60%;
576 color: red;
577 background-color: rgb(240,240,240);
578 border-top: solid 1px rgb(180,180,180);
579 }
580
581 div.toolbar span.copyright {
582 color: black;
583 margin-left: 0.5em;
584 }
585
586 div.initial_prompt {
587 position: absolute;
588 z-index: 1000;
589 bottom: 1.2em;
590 width: 90%;
591 background-color: rgb(200,200,200);
592 opacity: 0.35;
593 cursor: pointer;
594 }
595
596 div.initial_prompt p.help {
597 text-align: center;
598 }
599
600 div.initial_prompt p.close {
601 text-align: right;
602 font-style: italic;
603 }
604
605 div.slidy_toc {
606 position: absolute;
607 z-index: 300;
608 width: 60%;
609 max-width: 30em;
610 height: 30em;
611 overflow: auto;
612 top: auto;
613 right: auto;
614 left: 4em;
615 bottom: 4em;
616 padding: 1em;
617 background: rgb(240,240,240);
618 border-style: solid;
619 border-width: 2px;
620 font-size: 60%;
621 }
622
623 div.slidy_toc .toc_heading {
624 text-align: center;
625 width: 100%;
626 margin: 0;
627 margin-bottom: 1em;
628 border-bottom-style: solid;
629 border-bottom-color: rgb(180,180,180);
630 border-bottom-width: 1px;
631 }
632
633 div.slide {
634 z-index: 20;
635 margin: 0 0 0 0;
636 padding-top: 0;
637 padding-bottom: 0;
638 padding-left: 20px;
639 padding-right: 20px;
640 border-width: 0;
641 clear: both;
642 top: 0;
643 bottom: 0;
644 left: 0;
645 right: 0;
646 line-height: 120%;
647 background-color: transparent;
648 }
649
650 div.background {
651 display: none;
652 }
653
654 div.handout {
655 margin-left: 20px;
656 margin-right: 20px;
657 }
658
659 div.slide.titlepage {
660 text-align: center;
661 }
662
663 div.slide.titlepage.h1 {
664 padding-top: 10%;
665 }
666
667 div.slide h1 {
668 padding-left: 0;
669 padding-right: 20pt;
670 padding-top: 4pt;
671 padding-bottom: 4pt;
672 margin-top: 0;
673 margin-left: 0;
674 margin-right: 60pt;
675 margin-bottom: 0.5em;
676 display: block;
677 font-size: 160%;
678 line-height: 1.2em;
679 background: transparent;
680 }
681
682 div.toc {
683 position: absolute;
684 top: auto;
685 bottom: 4em;
686 left: 4em;
687 right: auto;
688 width: 60%;
689 max-width: 30em;
690 height: 30em;
691 border: solid thin black;
692 padding: 1em;
693 background: rgb(240,240,240);
694 color: black;
695 z-index: 300;
696 overflow: auto;
697 display: block;
698 visibility: visible;
699 }
700
701 div.toc-heading {
702 width: 100%;
703 border-bottom: solid 1px rgb(180,180,180);
704 margin-bottom: 1em;
705 text-align: center;
706 }
707
708 /*
709 pre {
710 font-size: 80%;
711 font-weight: bold;
712 line-height: 120%;
713 padding-top: 0.2em;
714 padding-bottom: 0.2em;
715 padding-left: 1em;
716 padding-right: 1em;
717 border-style: solid;
718 border-left-width: 1em;
719 border-top-width: thin;
720 border-right-width: thin;
721 border-bottom-width: thin;
722 border-color: #95ABD0;
723 color: #00428C;
724 background-color: #E4E5E7;
725 }
726 */
727
728 /*
729 li pre { margin-left: 0; }
730
731 blockquote { font-style: italic }
732
733 img { background-color: transparent }
734
735 p.copyright { font-size: smaller }
736 */
737
738 .center { text-align: center }
739 .footnote { font-size: smaller; margin-left: 2em; }
740
741 /*
742 a img { border-width: 0; border-style: none }
743 */
744
745 a:visited { color: navy }
746 a:link { color: navy }
747 a:hover { color: red; text-decoration: underline }
748 a:active { color: red; text-decoration: underline }
749
750 a {text-decoration: none}
751 .navbar a:link {color: white}
752 .navbar a:visited {color: yellow}
753 .navbar a:active {color: red}
754 .navbar a:hover {color: red}
755
756 /*
757 ul { list-style-type: square; }
758 ul ul { list-style-type: disc; }
759 ul ul ul { list-style-type: circle; }
760 ul ul ul ul { list-style-type: disc; }
761 li { margin-left: 0.5em; margin-top: 0.5em; }
762 li li { font-size: 85%; font-style: italic }
763 li li li { font-size: 85%; font-style: normal }
764 */
765
766 div dt
767 {
768 margin-left: 0;
769 margin-top: 1em;
770 margin-bottom: 0.5em;
771 font-weight: bold;
772 }
773 div dd
774 {
775 margin-left: 2em;
776 margin-bottom: 0.5em;
777 }
778
779
780 /*
781 p,pre,ul,ol,blockquote,h2,h3,h4,h5,h6,dl,table {
782 margin-left: 1em;
783 margin-right: 1em;
784 }
785 */
786
787 p.subhead { font-weight: bold; margin-top: 2em; }
788
789 .smaller { font-size: smaller }
790 .bigger { font-size: 130% }
791
792 /*
793 td,th { padding: 0.2em }
794 */
795
796 ul {
797 margin: 0.5em 1.5em 0.5em 1.5em;
798 padding: 0;
799 }
800
801 ol {
802 margin: 0.5em 1.5em 0.5em 1.5em;
803 padding: 0;
804 }
805
806 ul { list-style-type: square; }
807 ul ul { list-style-type: disc; }
808 ul ul ul { list-style-type: circle; }
809 ul ul ul ul { list-style-type: disc; }
810
811 /*
812 ul li {
813 list-style: square;
814 margin: 0.1em 0em 0.6em 0;
815 padding: 0 0 0 0;
816 line-height: 140%;
817 }
818
819 ol li {
820 margin: 0.1em 0em 0.6em 1.5em;
821 padding: 0 0 0 0px;
822 line-height: 140%;
823 list-style-type: decimal;
824 }
825
826 li ul li {
827 font-size: 85%;
828 font-style: italic;
829 list-style-type: disc;
830 background: transparent;
831 padding: 0 0 0 0;
832 }
833 li li ul li {
834 font-size: 85%;
835 font-style: normal;
836 list-style-type: circle;
837 background: transparent;
838 padding: 0 0 0 0;
839 }
840 li li li ul li {
841 list-style-type: disc;
842 background: transparent;
843 padding: 0 0 0 0;
844 }
845
846 li ol li {
847 list-style-type: decimal;
848 }
849
850
851 li li ol li {
852 list-style-type: decimal;
853 }
854 */
855
856 /*
857 setting class="outline" on ol or ul makes it behave as an
858 ouline list where blocklevel content in li elements is
859 hidden by default and can be expanded or collapsed with
860 mouse click. Set class="expand" on li to override default
861 */
862
863 ol.outline li:hover { cursor: pointer }
864 ol.outline li.nofold:hover { cursor: default }
865
866 ul.outline li:hover { cursor: pointer }
867 ul.outline li.nofold:hover { cursor: default }
868
869 ol.outline { list-style:decimal; }
870 ol.outline ol { list-style-type:lower-alpha }
871
872 ol.outline li.nofold {
873 padding: 0 0 0 20px;
874 background: transparent url(../graphics/nofold-dim.gif) no-repeat 0px 0.5em;
875 }
876 ol.outline li.unfolded {
877 padding: 0 0 0 20px;
878 background: transparent url(../graphics/fold-dim.gif) no-repeat 0px 0.5em;
879 }
880 ol.outline li.folded {
881 padding: 0 0 0 20px;
882 background: transparent url(../graphics/unfold-dim.gif) no-repeat 0px 0.5em;
883 }
884 ol.outline li.unfolded:hover {
885 padding: 0 0 0 20px;
886 background: transparent url(../graphics/fold.gif) no-repeat 0px 0.5em;
887 }
888 ol.outline li.folded:hover {
889 padding: 0 0 0 20px;
890 background: transparent url(../graphics/unfold.gif) no-repeat 0px 0.5em;
891 }
892
893 ul.outline li.nofold {
894 padding: 0 0 0 20px;
895 background: transparent url(../graphics/nofold-dim.gif) no-repeat 0px 0.5em;
896 }
897 ul.outline li.unfolded {
898 padding: 0 0 0 20px;
899 background: transparent url(../graphics/fold-dim.gif) no-repeat 0px 0.5em;
900 }
901 ul.outline li.folded {
902 padding: 0 0 0 20px;
903 background: transparent url(../graphics/unfold-dim.gif) no-repeat 0px 0.5em;
904 }
905 ul.outline li.unfolded:hover {
906 padding: 0 0 0 20px;
907 background: transparent url(../graphics/fold.gif) no-repeat 0px 0.5em;
908 }
909 ul.outline li.folded:hover {
910 padding: 0 0 0 20px;
911 background: transparent url(../graphics/unfold.gif) no-repeat 0px 0.5em;
912 }
913
914 /* for slides with class "title" in table of contents */
915 a.titleslide { font-weight: bold; font-style: italic }
916
917 /*
918 hide images for work around for save as bug
919 where browsers fail to save images used by CSS
920 */
921 img.hidden { display: none; visibility: hidden }
922 div.initial_prompt { display: none; visibility: hidden }
923
924 div.slide {
925 visibility: visible;
926 position: inherit;
927 }
928 div.handout {
929 border-top-style: solid;
930 border-top-width: thin;
931 border-top-color: black;
932 }
933
934 @media screen {
935 .hidden { display: none; visibility: visible }
936
937 div.slide.hidden { display: block; visibility: visible }
938 div.handout.hidden { display: block; visibility: visible }
939 div.background { display: none; visibility: hidden }
940 body.single_slide div.initial_prompt { display: block; visibility: visible }
941 body.single_slide div.background { display: block; visibility: visible }
942 body.single_slide div.background.hidden { display: none; visibility: hidden }
943 body.single_slide .invisible { visibility: hidden }
944 body.single_slide .hidden { display: none; visibility: hidden }
945 body.single_slide div.slide { position: absolute }
946 body.single_slide div.handout { display: none; visibility: hidden }
947 }
948
949 @media print {
950 .hidden { display: block; visibility: visible }
951
952 /*
953 div.slide pre { font-size: 60%; padding-left: 0.5em; }
954 */
955 div.toolbar { display: none; visibility: hidden; }
956 div.slidy_toc { display: none; visibility: hidden; }
957 div.background { display: none; visibility: hidden; }
958 div.slide { page-break-before: always }
959 /* :first-child isn't reliable for print media */
960 div.slide.first-slide { page-break-before: avoid }
961 }
962
963
964 /* SJR: AsciiDoc slidy backend tweaks */
965
966 ol, ul {
967 margin: 0.8em 1.5em 0.8em 1.8em;
968 }
969 li > ul, li > ol {
970 margin-top: 0.5em;
971 }
972
973 .outline > li.folded,
974 .outline > li.unfolded {
975 color: #527bbd;
976 }
977 ul > li{ color: #aaa; }
978 ul > li > *, ol > li > * { color: black; }
979
980 li {
981 margin-top: 0.5em;
982 margin-bottom: 0.5em;
983 }
984
985 /* jmi hack */
986 @media screen {
987 body.single_slide .invisible { opacity: 0.15; visibility: visible; }
988 /*img.invisible { opacity: 0.1; visibility: visible; } */
989 img.invisible { visibility: hidden !important }
990 }
991 a {text-decoration: underline;}
992 </style>
993 <style type="text/css" title="slidy_color_set_none">
994 /* empty color set styles */
995 </style>
996 <style type="text/css" title="slidy_color_set_yellow">
997 /* rainbow color styles */
998 body { background-color: #ffffaa;}
999 a:link, a:visited, a:hover, a:active { color: blue; text-decoration: underline }
1000 a:hover { color: red; text-decoration: underline }
1001 div.slide { color: black;}
1002 div.slide h1,h2,h3,h4,h5,h6 { color: orange;}
1003 em { color: green;}
1004 tt { color: green;}
1005 div.sidebarblock, div.literalblock, div.listingblock, div.exampleblock, div.title { color: red;}
1006 div.quoteblock, div.verseblock { color: black; }
1007 div.admonitionblock { color: red;}
1008 </style>
1009 <style type="text/css" title="slidy_color_set_green">
1010 /* blue color styles */
1011 body { background-color: #449900;}
1012 a:link, a:visited, a:hover, a:active { color: fuchsia; text-decoration: underline }
1013 a:hover { color: red; text-decoration: underline }
1014 div.slide { color: yellow;}
1015 div.slide h1,h2,h3,h4,h5,h6 { color: lime;}
1016 em { color: orange;}
1017 tt { color: orange;}
1018 div.sidebarblock, div.literalblock, div.listingblock, div.exampleblock, div.title { color: #44ff00;}
1019 div.quoteblock, div.verseblock { color: black; }
1020 div.admonitionblock { color: #88ff55;}
1021 </style>
1022 <style type="text/css" title="slidy_color_set_blue">
1023 /* blue color styles */
1024 body { background-color: navy;}
1025 a:link, a:visited, a:hover, a:active { color: yellow; text-decoration: underline }
1026 a:hover { color: red; text-decoration: underline }
1027 div.slide { background-color: navy; color: aqua;}
1028 div.slide h1,h2,h3,h4,h5,h6 { color: aqua;}
1029 em { color: blue;}
1030 tt { color: blue;}
1031 div.sidebarblock, div.literalblock, div.listingblock, div.exampleblock, div.title { color: teal;}
1032 div.admonitionblock { color: teal;}
1033 </style>
1034 <style type="text/css" title="slidy_color_set_black">
1035 /* black color set styles */
1036 body { background-color: black !important; }
1037 a:link, a:visited, a:hover, a:active { color: gray; text-decoration: underline }
1038 a:hover { color: red; text-decoration: underline }
1039 div.slide { color: silver !important; }
1040 span, caption, th { color: silver !important; }
1041 div.slide h1,h2,h3,h4,h5,h6 { color: white;}
1042 em, strong { color: #999999;}
1043 tt { color: blue;}
1044 div.sidebarblock, div.literalblock, div.listingblock, div.exampleblock, div.title { color: black; }
1045 div.admonitionblock, div.quoteblock, div.verseblock { color: white; }
1046 div.cover.slide, div.cover.slide h1 { background-color: black; }
1047 </style>
1048 <style type="text/css">
1049 html body {
1050 color:#343434;
1051 font-family:serif;
1052 font-size:10px;
1053 margin:0 0;
1054 padding:0 0 0 0;
1055 }
1056 /* titres */
1057 h1, h2, h3, h4, h5, h6 {
1058 font-family: serif;
1059 }
1060 div.slide h1 {
1061 margin: 0 0 0 0 !important;
1062 }
1063 #revnumber {
1064 font-family: serif;
1065 font-size:inherit;
1066 font-weight:bold;
1067 }
1068 /* sections */
1069 .article {
1070 }
1071 .article > .sect1,
1072 .article > .sect2,
1073 .article > .sect3 {
1074 -moz-box-sizing:border-box;
1075 -webkit-box-sizing:border-box;
1076 box-sizing:border-box;
1077 clear:both;
1078 display:table;
1079 float:left;
1080 margin:0 auto 0 auto;
1081 padding:0 1em 0 1em;
1082 width:100%;
1083 }
1084 .article > .sect1:last-child {
1085 margin-bottom:2ex;
1086 }
1087 .article > .sect1 * {
1088 clear:both;
1089 }
1090 .article > .refnamediv > *,
1091 .article > .sect1 > *,
1092 .article > .refsynopsisdiv > * {
1093 }
1094 .article > .sect1 > .sect2 > * {
1095 margin-left:1em;
1096 }
1097 .article > .sect1 > .sect2 > .sect3 > * {
1098 margin-left:2em;
1099 }
1100 /* text */
1101 a:empty {
1102 margin:0 0 0 0;
1103 padding:0 0 0 0;
1104 }
1105 .article em {
1106 color:#000080;
1107 }
1108 .article .emphasis {
1109 text-decoration:underline;
1110 }
1111 .article p {
1112 margin:0 0 0 0;
1113 max-width:34em;
1114 padding:1ex 0 0 0;
1115 text-align:justify;
1116 }
1117 .article h2 + p {
1118 margin-top:0;
1119 padding-top:0.25ex;
1120 }
1121 .article h3 + p,
1122 .article h3 + p[title] {
1123 margin-top:0;
1124 padding-top:0;
1125 }
1126 /* citations */
1127 .article code,
1128 .article code.literal {
1129 background-color:#EEEEEE;
1130 color:inherit !important;
1131 font-family:monospace,Courier;
1132 white-space:pre;
1133 font-size:90%;
1134 }
1135 .article pre {
1136 /*background-color: #ffffff;*/
1137 font-family:monospace,Courier;
1138 line-height:1.3; /* TODO: 1.2 ? */
1139 color: #000000;
1140 font-family: monospace;
1141 line-height: 1.13;
1142 overflow: auto;
1143 white-space: pre;
1144 }
1145 .article pre.literallayout {
1146 border-left:1ex solid navy;
1147 margin-left:0;
1148 padding-left:1ex;
1149 }
1150 .article .screen {
1151 border-width:0px 0px 0px 5px;
1152 color:black;
1153 display:inline-block;
1154 margin:0.5ex 0 0.5ex 0;
1155 }
1156 .article .programlisting {
1157 color:black;
1158 margin-left:2em;
1159 margin-right:2em;
1160 }
1161 .article .listitem > .simpara {
1162 display:inline;
1163 margin-bottom:0;
1164 }
1165 /* titles */
1166 .article > .sect1 > h2 {
1167 border-bottom:2px solid black;
1168 /*box-shadow:0px 1px 00px #888888;*/
1169 color:green;
1170 font-family:monospace,Arial,sans-serif;
1171 font-size:120%;
1172 /*font-variant:small-caps;*/
1173 line-height:1.2;
1174 margin:1ex 0 0.5ex 0;
1175 padding:0 0 0.5ex 0;
1176 }
1177 .article > .refnamediv > h2,
1178 .article > .refsynopsisdiv > h2 {
1179 font-variant:small-caps;
1180 }
1181 .article > .sect1 > .sect2 > h3 {
1182 color:DarkGreen;
1183 font-family:monospace,Arial,sans-serif;
1184 font-size:100%;
1185 padding:1.5ex 0 0.5ex 0;
1186 margin:0 0 0 0;
1187 }
1188 .article > .sect1 > h2 + .sect2 > h3 {
1189 padding-top:0;
1190 }
1191 .article > .sect1 > .sect2 > h3:before,
1192 .article .toc .sect2:before {
1193 color:black;
1194 content:"► ";
1195 font-family:monospace,Arial,sans-serif;
1196 float:left;
1197 }
1198 .article > .sect1 > .sect2 > .sect3 > h4 {
1199 color:DarkGreen;
1200 font-family:monospace,Arial,sans-serif;
1201 font-size:100%;
1202 padding:1em 0 0 0;
1203 margin:0 0 0 0;
1204 }
1205 .article > .sect1 > .sect2 > .sect3 > h4:before,
1206 .article .toc .sect3:before {
1207 color:black;
1208 content:"►► ";
1209 font-family:monospace,Arial,sans-serif;
1210 float:left;
1211 }
1212 .article li.listitem > p.simpara:first-child {
1213 margin-top:0;
1214 }
1215 .article p .formalpara-title {
1216 /* XXX: there is a docbook-xsl bug here:
1217 * https://lists.oasis-open.org/archives/docbook-apps/201107/msg00003.html
1218 */
1219 color:black;
1220 font-weight:bold;
1221 line-height:1.4;
1222 margin:0 0 0 0;
1223 padding:0 0 0 0;
1224 text-align:left;
1225 }
1226 .article p[title] {
1227 margin:1ex 0 0 0;
1228 max-width:none;
1229 padding:0 0 0 0;
1230 }
1231 .article span.citerefentry > span.articletitle {
1232 white-space:nowrap;
1233 }
1234 /* lists */
1235 .article .hdlist p {
1236 padding:0 0 0 0;
1237 }
1238 .article .hdlist td.hdlist1 {
1239 text-align:right;
1240 vertical-align:top;
1241 }
1242 .article .hdlist td.hdlist1,
1243 .article .hdlist td.hdlist1 {
1244 text-align:right;
1245 }
1246 .article .hdlist td.hdlist2 {
1247 text-align:left;
1248 padding:0 0 0 0;
1249 vertical-align:middle;
1250 }
1251 .article .hdlist td.hdlist2 > .listingblock {
1252 margin-top: 0;
1253 }
1254 .article .hdlist.math td.hdlist1,
1255 .article .hdlist.math td.hdlist2 {
1256 vertical-align:middle !important;
1257 }
1258 .article .calloutlist p {
1259 padding:0 0 0 0;
1260 }
1261 .article .calloutlist td {
1262 padding:0 0 0 0;
1263 }
1264 .article .calloutlist td p {
1265 }
1266 .article .calloutlist td:first-child {
1267 padding-right:1em;
1268 }
1269 .article .calloutlist td:first-child p {
1270 text-align:right;
1271 }
1272 .article .itemizedlist,
1273 .article .orderedlist {
1274 padding:0 0 0 0;
1275 margin:0 0 0 0;
1276 }
1277 .article .itemizedlist ul,
1278 .article .orderedlist ol {
1279 padding:0 0 0 0;
1280 margin:0 0 0 1.5em;
1281 list-style-position:outside;
1282 }
1283 .article .itemizedlist ul li,
1284 .article .orderedlist ol li {
1285 margin:0 0 0 0;
1286 max-width:51em;
1287 padding:0 0 0 0;
1288 }
1289 .article .dlist {
1290 padding:0 0 0 0;
1291 margin:0 0 0 0;
1292 }
1293 .article .dlist dl {
1294 list-style-position:outside;
1295 margin:0 0 0 0;
1296 padding:0.5ex 0 0 0;
1297 }
1298 .article .dlist dl dt {
1299 margin:0 0 0 0;
1300 padding-left:1px;
1301 }
1302 .article .dlist dl dd {
1303 border-left:1px dotted black;
1304 margin:0.5ex 0 0.5ex 0.9ex;
1305 max-width:51em;
1306 padding-left:1.1ex;
1307 text-align:justify;
1308 }
1309 .article .dlist dl dd > p:first-child {
1310 padding-top:0;
1311 }
1312 .article .dlist dl dd > p:last-child {
1313 padding-bottom:0;
1314 }
1315 .article .dlist dt:before,
1316 .article .toc dt:before {
1317 color:black;
1318 content:"▪ ";
1319 font-family:monospace,Arial,sans-serif;
1320 float:left;
1321 }
1322 .article h2 + .itemizedlist ul,
1323 .article h2 + .orderedlist ol,
1324 .article h2 + .dlist dl {
1325 padding-top:0;
1326 }
1327 /* fhs */
1328 .article a[href^="#fhs:"] {
1329 white-space:pre;
1330 }
1331 .article .toc a[href^="#fhs:"] {
1332 white-space:normal;
1333 }
1334 /* sidebar */
1335 .article .sidebar {
1336 -moz-box-sizing:border-box;
1337 -webkit-box-sizing:border-box;
1338 background:none repeat scroll 0 0 #FFFFEE;
1339 border:1px solid #C0C0C0;
1340 box-sizing:border-box;
1341 clear:both;
1342 float:left;
1343 height:96%;
1344 left:0;
1345 margin:1em 0 0 1em;
1346 overflow:auto;
1347 padding:1ex 1em 1ex 1em;
1348 position:fixed;
1349 top:0;
1350 width:30em;
1351 }
1352 .article .sidebar .refnamediv {
1353 margin:0 0 1ex 0;
1354 }
1355 .article .sidebar .refnamediv h2 {
1356 border-bottom:2px solid black;
1357 color:green;
1358 font-family:monospace,Arial,sans-serif;
1359 font-size:120%;
1360 font-variant:small-caps;
1361 border-bottom:0 solid black;
1362 margin:0 0 0.5ex 0;
1363 padding:0 0 0 0;
1364 }
1365 .article .sidebar .refnamediv p {
1366 margin:0 0 0 0;
1367 padding:0 0 0 0;
1368 text-align:justify;
1369 }
1370 /* location */
1371 .article .location {
1372 margin:0 0 0 0;
1373 }
1374 .article .location .location-title {
1375 display:inline-block;
1376 }
1377 .article .location .location-path {
1378 display:inline-block;
1379 margin-left:1em;
1380 margin-bottom:0.5ex;
1381 }
1382 .article .location .location-path a {
1383 display:inline-block;
1384 }
1385 .article .location .location-path .dir {
1386 color:blue;
1387 font-weight:bold;
1388 }
1389 .article .location .location-path .dir .slash {
1390 color:black;
1391 }
1392 .article .location .location-path .file {
1393 font-weight:bold;
1394 }
1395 /* language */
1396 .article .language {
1397 margin:0 0 0 0;
1398 }
1399 .article .language .language-title {
1400 display:inline-block;
1401 }
1402 .article .language .language-list {
1403 display:inline-block;
1404 font-weight:bold;
1405 margin-left:1em;
1406 }
1407 .article .language .language-list .lang-available {
1408 color:blue;
1409 }
1410 .article .language .language-list .lang-current {
1411 color:black;
1412 }
1413 /* toc */
1414 .article .toc {
1415 }
1416 .article .toc dl {
1417 clear:left;
1418 margin-left:0;
1419 padding-left:0;
1420 }
1421 .article .toc dl dd {
1422 border-left:1px dotted #333;
1423 margin-bottom:1px;
1424 margin-left:0.1ex;
1425 padding-left:1.9ex;
1426 }
1427 .article .toc dl dt span.refsynopsisdiv {
1428 }
1429 .article .toc .sect1:before {
1430 color:black;
1431 content:"§ ";
1432 font-family:monospace,Arial,sans-serif;
1433 float:left;
1434 }
1435 .article .toc .toc-title,
1436 .article .language .language-title,
1437 .article .location .location-title {
1438 border-bottom:0 solid black;
1439 color:green;
1440 font-size:120%;
1441 font-variant:small-caps;
1442 font-weight:bold;
1443 margin-bottom:0.5ex;
1444 }
1445 div.slidy_toc,
1446 body > div.slidy_toc,
1447 .article div.slidy_toc {
1448 background: none repeat scroll 0 0 #F0F0F0;
1449 border-style: solid;
1450 border-width: 2px;
1451 font-size: 100%;
1452 height: 80%;
1453 left: auto !important;
1454 bottom: auto !important;
1455 right: 0 !important;
1456 max-width: none !important;
1457 width: 50% !important;
1458 overflow: auto;
1459 padding: 1em;
1460 position: absolute;
1461 top: 0;
1462 z-index: 300;
1463 }
1464 .article div.toc-heading {
1465 border-bottom: 1px solid #B4B4B4;
1466 font-weight: bold;
1467 margin-bottom: 1em;
1468 text-align: center;
1469 width: 100%;
1470 }
1471 /* incremental preview */
1472 body.single_slide .invisible {
1473 opacity: 0.15;
1474 visibility: visible;
1475 }
1476 img.invisible {
1477 visibility: hidden !important;
1478 }
1479 /* image */
1480 .imageblock img {
1481 border:1px solid black;
1482 display:block;
1483 margin:0 auto 0 auto;
1484 }
1485 /* splash */
1486 div.hledgersplash > div.imageblock {
1487 /*border:black solid 1px;*/
1488 left:-50%;
1489 position:relative;
1490 }
1491 /* vim syntax */
1492 pre .Error { color: #8080ff; background-color: #ffffff; }
1493 pre .PreProc { color: #ff6060; text-decoration: underline; font-weight: bold; }
1494 pre .Special { color: #8080ff; font-weight: bold; }
1495 pre .Constant { color: #ff40ff; text-decoration: none; }
1496 pre .Statement { color: #B8860B; font-weight: bold; }
1497 pre .Identifier { color: #ffff00; text-decoration: underline; }
1498 pre .Comment { color: #4169e1; font-weight: bold; }
1499 /* vim syntax: hledger */
1500 pre .hledgerNumberOdd { color: #0000ff; background-color: #e5e5e5; font-weight: bold; }
1501 pre .hledgerPostingAmountOdd { color: #eead0e; background-color: #e5e5e5; font-weight: bold; }
1502 pre .hledgerAccountSeparatorOdd { color: #eead0e; background-color: #e5e5e5; font-weight: bold; }
1503 pre .hledgerPostingAccountOdd { color: #4d4d4d; background-color: #e5e5e5; }
1504 pre .hledgerNumber { color: #0000ff; background-color: #90ee90; font-weight: bold; }
1505 pre .hledgerPostingAmount { color: #eead0e; background-color: #90ee90; font-weight: bold; }
1506 pre .hledgerAccountSeparator { color: #eead0e; background-color: #90ee90; font-weight: bold; }
1507 pre .hledgerPostingAccount { color: #4d4d4d; background-color: #90ee90; }
1508 pre .hledgerTagValue { color: #ff0000; }
1509 pre .hledgerTag { color: #ffa500; font-weight: bold; }
1510 pre .hledgerTransactionComment { color: #4169e1; font-weight: bold; }
1511 pre .hledgerTransaction { font-weight: bold; }
1512 pre .hledgerTransactionDate { background-color: #eedd82; font-weight: bold; }
1513 pre .hledgerDirective { font-weight: bold; }
1514 pre .hledgerInclude { font-weight: bold; }
1515 pre .hledgerComment { color: #4169e1; font-weight: bold; }
1516 </style>
1517 <script type="text/javascript">
1518 /*<![CDATA[*/
1519 /* slidy.js
1520
1521 Copyright (c) 2005-2010 W3C (MIT, ERCIM, Keio), All Rights Reserved.
1522 W3C liability, trademark, document use and software licensing
1523 rules apply, see:
1524
1525 http://www.w3.org/Consortium/Legal/copyright-documents
1526 http://www.w3.org/Consortium/Legal/copyright-software
1527
1528 Defines single name "w3c_slidy" in global namespace
1529 Adds event handlers without trampling on any others
1530
1531 JMI: Dynamic features added
1532 */
1533
1534 // the slidy object implementation
1535 var w3c_slidy = {
1536 // classify which kind of browser we're running under
1537 ns_pos: (typeof window.pageYOffset!='undefined'),
1538 khtml: ((navigator.userAgent).indexOf("KHTML") >= 0 ? true : false),
1539 opera: ((navigator.userAgent).indexOf("Opera") >= 0 ? true : false),
1540 ipad: ((navigator.userAgent).indexOf("iPad") >= 0 ? true : false),
1541 iphone: ((navigator.userAgent).indexOf("iPhone") >= 0 ? true : false),
1542 ie: (typeof document.all != "undefined" && !this.opera),
1543 ie6: (!this.ns_pos && navigator.userAgent.indexOf("MSIE 6") != -1),
1544 ie7: (!this.ns_pos && navigator.userAgent.indexOf("MSIE 7") != -1),
1545 ie8: (!this.ns_pos && navigator.userAgent.indexOf("MSIE 8") != -1),
1546 ie9: (!this.ns_pos && navigator.userAgent.indexOf("MSIE 9") != -1),
1547 keyboardless: (this.ipad || this.iphone),
1548
1549 // are we running as XHTML? (doesn't work on Opera)
1550 is_xhtml: /xml/.test(document.contentType),
1551
1552 slide_number: 0, // integer slide count: 0, 1, 2, ...
1553 slide_number_element: null, // element containing slide number
1554 slides: [], // set to array of slide div's
1555 notes: [], // set to array of handout div's
1556 backgrounds: [], // set to array of background div's
1557 toolbar: null, // element containing toolbar
1558 title: null, // document title
1559 last_shown: null, // last incrementally shown item
1560 eos: null, // span element for end of slide indicator
1561 toc: null, // table of contents
1562 outline: null, // outline element with the focus
1563 selected_text_len: 0, // length of drag selection on document
1564 view_all: 0, // 1 to view all slides + handouts
1565 want_toolbar: true, // user preference to show/hide toolbar
1566 mouse_click_enabled: true, // enables left click for next slide
1567 scroll_hack: 0, // IE work around for position: fixed
1568 disable_slide_click: false, // used by clicked anchors
1569
1570 lang: "en", // updated to language specified by html file
1571
1572 help_anchor: null, // used for keyboard focus hack in showToolbar()
1573 help_page: "http://www.w3.org/Talks/Tools/Slidy2/help/help.html",
1574 help_text: "Navigate with mouse click, space bar, Cursor Left/Right, " +
1575 "or Pg Up and Pg Dn. Use S and B to change font size.",
1576 // jmi
1577 help_keymap:
1578 "PGDN\t: nextSlide\n" +
1579 "PGUP\t: previousSlide\n" +
1580 "HOME\t: firstSlide\n" +
1581 "END \t: lastSlide\n" +
1582 "SPACE\t: nextContent\n" +
1583 "-> \t: nextContent\n" +
1584 "<- \t: previousContent\n" +
1585 "A \t: toggleAllSlides\n" +
1586 "F \t: toggleFooter\n" +
1587 "K \t: toggleMouseClick\n" +
1588 "I \t: toggleIncremental\n" +
1589 "L \t: toggleColorSet\n" +
1590 "T, C\t: tableOfContents\n" +
1591 "B \t: biggerFontSize\n" +
1592 "S \t: smallerFontSize\n" +
1593 "M \t: key mapping\n",
1594
1595 size_index: 0,
1596 size_adjustment: 0,
1597 sizes: new Array("10pt", "12pt", "14pt", "16pt", "18pt", "20pt",
1598 "22pt", "24pt", "26pt", "28pt", "30pt", "32pt"),
1599
1600 // needed for efficient resizing
1601 last_width: 0,
1602 last_height: 0,
1603
1604
1605 // Needed for cross browser support for relative width/height on
1606 // object elements. The work around is to save width/height attributes
1607 // and then to recompute absolute width/height dimensions on resizing
1608 objects: [],
1609
1610 //jmi
1611 incremental_display: true,
1612
1613 // attach initialiation event handlers
1614 set_up: function () {
1615 var init = function() { w3c_slidy.init(); };
1616 if (typeof window.addEventListener != "undefined")
1617 window.addEventListener("load", init, false);
1618 else
1619 window.attachEvent("onload", init);
1620 },
1621
1622 hide_slides: function () {
1623 if (document.body && !w3c_slidy.initialized)
1624 document.body.style.visibility = "hidden";
1625 else
1626 setTimeout(w3c_slidy.hide_slides, 50);
1627 },
1628
1629 // hack to persuade IE to compute correct document height
1630 // as needed for simulating fixed positioning of toolbar
1631 ie_hack: function () {
1632 window.resizeBy(0,-1);
1633 window.resizeBy(0, 1);
1634 },
1635
1636 init: function () {
1637 //alert("slidy starting test 10");
1638 document.body.style.visibility = "visible";
1639 this.init_localization();
1640 this.add_toolbar();
1641 this.wrap_implicit_slides();
1642 this.collect_slides();
1643 this.collect_notes();
1644 this.collect_backgrounds();
1645 this.objects = document.body.getElementsByTagName("object");
1646 this.patch_anchors();
1647 this.slide_number = this.find_slide_number(location.href);
1648 window.offscreenbuffering = true;
1649 this.size_adjustment = this.find_size_adjust();
1650 this.time_left = this.find_duration();
1651 this.hide_image_toolbar(); // suppress IE image toolbar popup
1652 this.init_outliner(); // activate fold/unfold support
1653 this.title = document.title;
1654 // jmi
1655 this.color_sets = new Array();
1656 this.init_color_sets();
1657
1658 // work around for opera bug
1659 this.is_xhtml = (document.body.tagName == "BODY" ? false : true);
1660
1661 if (this.slides.length > 0)
1662 {
1663 var slide = this.slides[this.slide_number];
1664
1665 if (this.slide_number > 0)
1666 {
1667 this.set_visibility_all_incremental("visible");
1668 this.last_shown = this.previous_incremental_item(null);
1669 this.set_eos_status(true);
1670 }
1671 else
1672 {
1673 this.last_shown = null;
1674 this.set_visibility_all_incremental("hidden");
1675 this.set_eos_status(!this.next_incremental_item(this.last_shown));
1676 }
1677
1678 this.set_location();
1679 this.add_class(this.slides[0], "first-slide");
1680 w3c_slidy.show_slide(slide);
1681 }
1682
1683 this.toc = this.table_of_contents();
1684
1685 this.add_initial_prompt();
1686
1687 // bind event handlers without interfering with custom page scripts
1688 // Tap events behave too weirdly to support clicks reliably on
1689 // iPhone and iPad, so exclude these from click handler
1690
1691 if (!this.keyboardless)
1692 this.add_listener(document.body, "click", this.mouse_button_click);
1693
1694 this.add_listener(document, "keydown", this.key_down);
1695 this.add_listener(document, "keypress", this.key_press);
1696 this.add_listener(window, "resize", this.resized);
1697 this.add_listener(window, "scroll", this.scrolled);
1698 this.add_listener(window, "unload", this.unloaded);
1699
1700 // this seems to be a debugging hack
1701 //if (!document.body.onclick)
1702 // document.body.onclick = function () { };
1703
1704 this.single_slide_view();
1705
1706 //this.set_location();
1707
1708 this.resized();
1709
1710 if (this.ie7)
1711 setTimeout(w3c_slidy.ie_hack, 100);
1712
1713 this.show_toolbar();
1714
1715 // for back button detection
1716 setInterval(function () { w3c_slidy.check_location(); }, 200);
1717 w3c_slidy.initialized = true;
1718 },
1719
1720 // create div element with links to each slide
1721 table_of_contents: function () {
1722 var toc = this.create_element("div");
1723 this.add_class(toc, "slidy_toc hidden");
1724 //toc.setAttribute("tabindex", "0");
1725
1726 var heading = this.create_element("div");
1727 this.add_class(heading, "toc-heading");
1728 heading.innerHTML = this.localize("Table of Contents");
1729
1730 toc.appendChild(heading);
1731 var previous = null;
1732
1733 for (var i = 0; i < this.slides.length; ++i)
1734 {
1735 var title = this.has_class(this.slides[i], "title");
1736 var num = document.createTextNode((i + 1) + ". ");
1737
1738 toc.appendChild(num);
1739
1740 var a = this.create_element("a");
1741 a.setAttribute("href", "#(" + (i+1) + ")");
1742
1743 if (title)
1744 this.add_class(a, "titleslide");
1745
1746 var name = document.createTextNode(this.slide_name(i));
1747 a.appendChild(name);
1748 a.onclick = w3c_slidy.toc_click;
1749 a.onkeydown = w3c_slidy.toc_key_down;
1750 a.previous = previous;
1751
1752 if (previous)
1753 previous.next = a;
1754
1755 toc.appendChild(a);
1756
1757 if (i == 0)
1758 toc.first = a;
1759
1760 if (i < this.slides.length - 1)
1761 {
1762 var br = this.create_element("br");
1763 toc.appendChild(br);
1764 }
1765
1766 previous = a;
1767 }
1768
1769 toc.focus = function () {
1770 if (this.first)
1771 this.first.focus();
1772 }
1773
1774 toc.onmouseup = w3c_slidy.mouse_button_up;
1775
1776 toc.onclick = function (e) {
1777 e||(e=window.event);
1778
1779 if (w3c_slidy.selected_text_len <= 0)
1780 w3c_slidy.hide_table_of_contents(true);
1781
1782 w3c_slidy.stop_propagation(e);
1783
1784 if (e.cancel != undefined)
1785 e.cancel = true;
1786
1787 if (e.returnValue != undefined)
1788 e.returnValue = false;
1789
1790 return false;
1791 };
1792
1793 document.body.insertBefore(toc, document.body.firstChild);
1794 return toc;
1795 },
1796
1797 is_shown_toc: function () {
1798 return !w3c_slidy.has_class(w3c_slidy.toc, "hidden");
1799 },
1800
1801 show_table_of_contents: function () {
1802 w3c_slidy.remove_class(w3c_slidy.toc, "hidden");
1803 var toc = w3c_slidy.toc;
1804 toc.focus();
1805
1806 if (w3c_slidy.ie7 && w3c_slidy.slide_number == 0)
1807 setTimeout(w3c_slidy.ie_hack, 100);
1808 },
1809
1810 hide_table_of_contents: function (focus) {
1811 w3c_slidy.add_class(w3c_slidy.toc, "hidden");
1812
1813 if (focus && !w3c_slidy.opera)
1814 w3c_slidy.help_anchor.focus();
1815 },
1816
1817 toggle_table_of_contents: function () {
1818 if (w3c_slidy.is_shown_toc())
1819 w3c_slidy.hide_table_of_contents(true);
1820 else
1821 w3c_slidy.show_table_of_contents();
1822 },
1823
1824 // called on clicking toc entry
1825 toc_click: function (e) {
1826 if (!e)
1827 e = window.event;
1828
1829 var target = w3c_slidy.get_target(e);
1830
1831 if (target && target.nodeType == 1)
1832 {
1833 var uri = target.getAttribute("href");
1834
1835 if (uri)
1836 {
1837 //alert("going to " + uri);
1838 var slide = w3c_slidy.slides[w3c_slidy.slide_number];
1839 w3c_slidy.hide_slide(slide);
1840 w3c_slidy.slide_number = w3c_slidy.find_slide_number(uri);
1841 slide = w3c_slidy.slides[w3c_slidy.slide_number];
1842 w3c_slidy.last_shown = null;
1843 w3c_slidy.set_location();
1844 w3c_slidy.set_visibility_all_incremental("hidden");
1845 w3c_slidy.set_eos_status(!w3c_slidy.next_incremental_item(w3c_slidy.last_shown));
1846 w3c_slidy.show_slide(slide);
1847 //target.focus();
1848
1849 try
1850 {
1851 if (!w3c_slidy.opera)
1852 w3c_slidy.help_anchor.focus();
1853 }
1854 catch (e)
1855 {
1856 }
1857 }
1858 }
1859
1860 w3c_slidy.hide_table_of_contents(true);
1861 if (w3c_slidy.ie7) w3c_slidy.ie_hack();
1862 w3c_slidy.stop_propagation(e);
1863 return w3c_slidy.cancel(e);
1864 },
1865
1866 // called onkeydown for toc entry
1867 toc_key_down: function (event) {
1868 var key;
1869
1870 if (!event)
1871 var event = window.event;
1872
1873 // kludge around NS/IE differences
1874 if (window.event)
1875 key = window.event.keyCode;
1876 else if (event.which)
1877 key = event.which;
1878 else
1879 return true; // Yikes! unknown browser
1880
1881 // ignore event if key value is zero
1882 // as for alt on Opera and Konqueror
1883 if (!key)
1884 return true;
1885
1886 // check for concurrent control/command/alt key
1887 // but are these only present on mouse events?
1888
1889 if (event.ctrlKey || event.altKey)
1890 return true;
1891
1892 if (key == 13)
1893 {
1894 var uri = this.getAttribute("href");
1895
1896 if (uri)
1897 {
1898 //alert("going to " + uri);
1899 var slide = w3c_slidy.slides[w3c_slidy.slide_number];
1900 w3c_slidy.hide_slide(slide);
1901 w3c_slidy.slide_number = w3c_slidy.find_slide_number(uri);
1902 slide = w3c_slidy.slides[w3c_slidy.slide_number];
1903 w3c_slidy.last_shown = null;
1904 w3c_slidy.set_location();
1905 w3c_slidy.set_visibility_all_incremental("hidden");
1906 w3c_slidy.set_eos_status(!w3c_slidy.next_incremental_item(w3c_slidy.last_shown));
1907 w3c_slidy.show_slide(slide);
1908 //target.focus();
1909
1910 try
1911 {
1912 if (!w3c_slidy.opera)
1913 w3c_slidy.help_anchor.focus();
1914 }
1915 catch (e)
1916 {
1917 }
1918 }
1919
1920 w3c_slidy.hide_table_of_contents(true);
1921
1922 if (self.ie7)
1923 w3c_slidy.ie_hack();
1924
1925 return w3c_slidy.cancel(event);
1926 }
1927
1928 if (key == 40 && this.next)
1929 {
1930 this.next.focus();
1931 return w3c_slidy.cancel(event);
1932 }
1933
1934 if (key == 38 && this.previous)
1935 {
1936 this.previous.focus();
1937 return w3c_slidy.cancel(event);
1938 }
1939
1940 return true;
1941 },
1942
1943
1944 // ### OBSOLETE ###
1945 before_print: function () {
1946 this.show_all_slides();
1947 this.hide_toolbar();
1948 alert("before print");
1949 },
1950
1951 // ### OBSOLETE ###
1952 after_print: function () {
1953 if (!this.view_all)
1954 {
1955 this.single_slide_view();
1956 this.show_toolbar();
1957 }
1958 alert("after print");
1959 },
1960
1961 // ### OBSOLETE ###
1962 print_slides: function () {
1963 this.before_print();
1964 window.print();
1965 this.after_print();
1966 },
1967
1968 // ### OBSOLETE ?? ###
1969 toggle_view: function () {
1970 if (this.view_all)
1971 {
1972 this.single_slide_view();
1973 this.show_toolbar();
1974 this.view_all = 0;
1975 }
1976 else
1977 {
1978 this.show_all_slides();
1979 this.hide_toolbar();
1980 this.view_all = 1;
1981 }
1982 },
1983
1984 // prepare for printing ### OBSOLETE ###
1985 show_all_slides: function () {
1986 this.remove_class(document.body, "single_slide");
1987 this.set_visibility_all_incremental("visible");
1988 },
1989
1990 // restore after printing ### OBSOLETE ###
1991 single_slide_view: function () {
1992 this.add_class(document.body, "single_slide");
1993 this.set_visibility_all_incremental("visible");
1994 this.last_shown = this.previous_incremental_item(null);
1995 },
1996
1997 // suppress IE's image toolbar pop up
1998 hide_image_toolbar: function () {
1999 if (!this.ns_pos)
2000 {
2001 var images = document.getElementsByTagName("IMG");
2002
2003 for (var i = 0; i < images.length; ++i)
2004 images[i].setAttribute("galleryimg", "no");
2005 }
2006 },
2007
2008 unloaded: function (e) {
2009 //alert("unloaded");
2010 },
2011
2012 // Safari and Konqueror don't yet support getComputedStyle()
2013 // and they always reload page when location.href is updated
2014 is_KHTML: function () {
2015 var agent = navigator.userAgent;
2016 return (agent.indexOf("KHTML") >= 0 ? true : false);
2017 },
2018
2019 // find slide name from first h1 element
2020 // default to document title + slide number
2021 slide_name: function (index) {
2022 var name = null;
2023 var slide = this.slides[index];
2024
2025 var heading = this.find_heading(slide);
2026
2027 if (heading)
2028 name = this.extract_text(heading);
2029
2030 if (!name)
2031 name = this.title + "(" + (index + 1) + ")";
2032
2033 name.replace(/\&/g, "&amp;");
2034 name.replace(/\</g, "&lt;");
2035 name.replace(/\>/g, "&gt;");
2036
2037 return name;
2038 },
2039
2040 // find first h1 element in DOM tree
2041 find_heading: function (node) {
2042 if (!node || node.nodeType != 1)
2043 return null;
2044
2045 if (node.nodeName == "H1" || node.nodeName == "h1")
2046 return node;
2047
2048 var child = node.firstChild;
2049
2050 while (child)
2051 {
2052 node = this.find_heading(child);
2053
2054 if (node)
2055 return node;
2056
2057 child = child.nextSibling;
2058 }
2059
2060 return null;
2061 },
2062
2063 // recursively extract text from DOM tree
2064 extract_text: function (node) {
2065 if (!node)
2066 return "";
2067
2068 // text nodes
2069 if (node.nodeType == 3)
2070 return node.nodeValue;
2071
2072 // elements
2073 if (node.nodeType == 1)
2074 {
2075 node = node.firstChild;
2076 var text = "";
2077
2078 while (node)
2079 {
2080 text = text + this.extract_text(node);
2081 node = node.nextSibling;
2082 }
2083
2084 return text;
2085 }
2086
2087 return "";
2088 },
2089
2090 // find copyright text from meta element
2091 find_copyright: function () {
2092 var name, content;
2093 var meta = document.getElementsByTagName("meta");
2094
2095 for (var i = 0; i < meta.length; ++i)
2096 {
2097 name = meta[i].getAttribute("name");
2098 content = meta[i].getAttribute("content");
2099
2100 if (name == "copyright")
2101 return content;
2102 }
2103
2104 return null;
2105 },
2106
2107 find_size_adjust: function () {
2108 var name, content, offset;
2109 var meta = document.getElementsByTagName("meta");
2110
2111 for (var i = 0; i < meta.length; ++i)
2112 {
2113 name = meta[i].getAttribute("name");
2114 content = meta[i].getAttribute("content");
2115
2116 if (name == "font-size-adjustment")
2117 return 1 * content;
2118 }
2119
2120 return 1;
2121 },
2122
2123 // <meta name="duration" content="20" /> for 20 minutes
2124 find_duration: function () {
2125 var name, content, offset;
2126 var meta = document.getElementsByTagName("meta");
2127
2128 for (var i = 0; i < meta.length; ++i)
2129 {
2130 name = meta[i].getAttribute("name");
2131 content = meta[i].getAttribute("content");
2132
2133 if (name == "duration")
2134 return 60000 * content;
2135 }
2136
2137 return null;
2138 },
2139
2140 replace_by_non_breaking_space: function (str) {
2141 for (var i = 0; i < str.length; ++i)
2142 str[i] = 160;
2143 },
2144
2145 // ### CHECK ME ### is use of "li" okay for text/html?
2146 // for XHTML do we also need to specify namespace?
2147 init_outliner: function () {
2148 var items = document.getElementsByTagName("li");
2149
2150 for (var i = 0; i < items.length; ++i)
2151 {
2152 var target = items[i];
2153
2154 if (!this.has_class(target.parentNode, "outline"))
2155 continue;
2156
2157 target.onclick = this.outline_click;
2158 /* ### more work needed for IE6
2159 if (!this.ns_pos)
2160 {
2161 target.onmouseover = this.hover_outline;
2162 target.onmouseout = this.unhover_outline;
2163 }
2164 */
2165 if (this.foldable(target))
2166 {
2167 target.foldable = true;
2168 target.onfocus = function () {w3c_slidy.outline = this;};
2169 target.onblur = function () {w3c_slidy.outline = null;};
2170
2171 if (!target.getAttribute("tabindex"))
2172 target.setAttribute("tabindex", "0");
2173
2174 if (this.has_class(target, "expand"))
2175 this.unfold(target);
2176 else
2177 this.fold(target);
2178 }
2179 else
2180 {
2181 this.add_class(target, "nofold");
2182 target.visible = true;
2183 target.foldable = false;
2184 }
2185 }
2186 },
2187
2188 foldable: function (item) {
2189 if (!item || item.nodeType != 1)
2190 return false;
2191
2192 var node = item.firstChild;
2193
2194 while (node)
2195 {
2196 if (node.nodeType == 1 && this.is_block(node))
2197 return true;
2198
2199 node = node.nextSibling;
2200 }
2201
2202 return false;
2203 },
2204
2205 // ### CHECK ME ### switch to add/remove "hidden" class
2206 fold: function (item) {
2207 if (item)
2208 {
2209 this.remove_class(item, "unfolded");
2210 this.add_class(item, "folded");
2211 }
2212
2213 var node = item ? item.firstChild : null;
2214
2215 while (node)
2216 {
2217 if (node.nodeType == 1 && this.is_block(node)) // element
2218 {
2219 w3c_slidy.add_class(node, "hidden");
2220 }
2221
2222 node = node.nextSibling;
2223 }
2224
2225 item.visible = false;
2226 },
2227
2228 // ### CHECK ME ### switch to add/remove "hidden" class
2229 unfold: function (item) {
2230 if (item)
2231 {
2232 this.add_class(item, "unfolded");
2233 this.remove_class(item, "folded");
2234 }
2235
2236 var node = item ? item.firstChild : null;
2237
2238 while (node)
2239 {
2240 if (node.nodeType == 1 && this.is_block(node)) // element
2241 {
2242 w3c_slidy.remove_class(node, "hidden");
2243 }
2244
2245 node = node.nextSibling;
2246 }
2247
2248 item.visible = true;
2249 },
2250
2251 outline_click: function (e) {
2252 if (!e)
2253 e = window.event;
2254
2255 var rightclick = false;
2256 var target = w3c_slidy.get_target(e);
2257
2258 while (target && target.visible == undefined)
2259 target = target.parentNode;
2260
2261 if (!target)
2262 return true;
2263
2264 if (e.which)
2265 rightclick = (e.which == 3);
2266 else if (e.button)
2267 rightclick = (e.button == 2);
2268
2269 if (!rightclick && target.visible != undefined)
2270 {
2271 if (target.foldable)
2272 {
2273 if (target.visible)
2274 w3c_slidy.fold(target);
2275 else
2276 w3c_slidy.unfold(target);
2277 }
2278
2279 w3c_slidy.stop_propagation(e);
2280 e.cancel = true;
2281 e.returnValue = false;
2282 }
2283
2284 return false;
2285 },
2286
2287 add_initial_prompt: function () {
2288 var prompt = this.create_element("div");
2289 prompt.setAttribute("class", "initial_prompt");
2290
2291 var p1 = this.create_element("p");
2292 prompt.appendChild(p1);
2293 p1.setAttribute("class", "help");
2294
2295 if (this.keyboardless)
2296 p1.innerHTML = "Tap footer to move to next slide";
2297 else
2298 p1.innerHTML = "Space or Right Arrow to move to next " +
2299 "slide, M to see keys mapping, click help below for more details";
2300
2301 this.add_listener(prompt, "click", function (e) {
2302 document.body.removeChild(prompt);
2303 w3c_slidy.stop_propagation(e);
2304
2305 if (e.cancel != undefined)
2306 e.cancel = true;
2307
2308 if (e.returnValue != undefined)
2309 e.returnValue = false;
2310
2311 return false;
2312 });
2313
2314 document.body.appendChild(prompt);
2315 this.initial_prompt = prompt;
2316 setTimeout(function() {document.body.removeChild(prompt);}, 5000);
2317 },
2318
2319 add_toolbar: function () {
2320 var counter, page;
2321
2322 this.toolbar = this.create_element("div");
2323 this.toolbar.setAttribute("class", "toolbar");
2324
2325 // a reasonably behaved browser
2326 if (this.ns_pos || !this.ie6)
2327 {
2328 var right = this.create_element("div");
2329 right.setAttribute("style", "float: right; text-align: right");
2330
2331 counter = this.create_element("span")
2332 counter.innerHTML = this.localize("slide") + " n/m";
2333 right.appendChild(counter);
2334 this.toolbar.appendChild(right);
2335
2336 var left = this.create_element("div");
2337 left.setAttribute("style", "text-align: left");
2338
2339 // global end of slide indicator
2340 this.eos = this.create_element("span");
2341 this.eos.innerHTML = "* ";
2342 left.appendChild(this.eos);
2343
2344 var help = this.create_element("a");
2345 help.setAttribute("href", this.help_page);
2346 help.setAttribute("title", this.localize(this.help_text));
2347 help.innerHTML = this.localize("help?");
2348 left.appendChild(help);
2349 this.help_anchor = help; // save for focus hack
2350
2351 var gap1 = document.createTextNode(" ");
2352 left.appendChild(gap1);
2353
2354 var contents = this.create_element("a");
2355 contents.setAttribute("href", "javascript:w3c_slidy.toggle_table_of_contents()");
2356 contents.setAttribute("title", this.localize("table of contents"));
2357 contents.innerHTML = this.localize("contents?");
2358 left.appendChild(contents);
2359
2360 var gap2 = document.createTextNode(" ");
2361 left.appendChild(gap2);
2362
2363 var copyright = this.find_copyright();
2364
2365 if (copyright)
2366 {
2367 var span = this.create_element("span");
2368 span.className = "copyright";
2369 span.innerHTML = copyright;
2370 left.appendChild(span);
2371 }
2372
2373 this.toolbar.setAttribute("tabindex", "0");
2374 this.toolbar.appendChild(left);
2375 }
2376 else // IE6 so need to work around its poor CSS support
2377 {
2378 this.toolbar.style.position = (this.ie7 ? "fixed" : "absolute");
2379 this.toolbar.style.zIndex = "200";
2380 this.toolbar.style.width = "99.9%";
2381 this.toolbar.style.height = "1.2em";
2382 this.toolbar.style.top = "auto";
2383 this.toolbar.style.bottom = "0";
2384 this.toolbar.style.left = "0";
2385 this.toolbar.style.right = "0";
2386 this.toolbar.style.textAlign = "left";
2387 this.toolbar.style.fontSize = "60%";
2388 this.toolbar.style.color = "red";
2389 this.toolbar.borderWidth = 0;
2390 this.toolbar.className = "toolbar";
2391 this.toolbar.style.background = "rgb(240,240,240)";
2392
2393 // would like to have help text left aligned
2394 // and page counter right aligned, floating
2395 // div's don't work, so instead use nested
2396 // absolutely positioned div's.
2397
2398 var sp = this.create_element("span");
2399 sp.innerHTML = "&nbsp;&nbsp;*&nbsp;";
2400 this.toolbar.appendChild(sp);
2401 this.eos = sp; // end of slide indicator
2402
2403 var help = this.create_element("a");
2404 help.setAttribute("href", this.help_page);
2405 help.setAttribute("title", this.localize(this.help_text));
2406 help.innerHTML = this.localize("help?");
2407 this.toolbar.appendChild(help);
2408 this.help_anchor = help; // save for focus hack
2409
2410 var gap1 = document.createTextNode(" ");
2411 this.toolbar.appendChild(gap1);
2412
2413 var contents = this.create_element("a");
2414 contents.setAttribute("href", "javascript:toggleTableOfContents()");
2415 contents.setAttribute("title", this.localize("table of contents".localize));
2416 contents.innerHTML = this.localize("contents?");
2417 this.toolbar.appendChild(contents);
2418
2419 var gap2 = document.createTextNode(" ");
2420 this.toolbar.appendChild(gap2);
2421
2422 var copyright = this.find_copyright();
2423
2424 if (copyright)
2425 {
2426 var span = this.create_element("span");
2427 span.innerHTML = copyright;
2428 span.style.color = "black";
2429 span.style.marginLeft = "0.5em";
2430 this.toolbar.appendChild(span);
2431 }
2432
2433 counter = this.create_element("div")
2434 counter.style.position = "absolute";
2435 counter.style.width = "auto"; //"20%";
2436 counter.style.height = "1.2em";
2437 counter.style.top = "auto";
2438 counter.style.bottom = 0;
2439 counter.style.right = "0";
2440 counter.style.textAlign = "right";
2441 counter.style.color = "red";
2442 counter.style.background = "rgb(240,240,240)";
2443
2444 counter.innerHTML = this.localize("slide") + " n/m";
2445 this.toolbar.appendChild(counter);
2446 }
2447
2448 // ensure that click isn't passed through to the page
2449 this.toolbar.onclick =
2450 function (e) {
2451 if (!e)
2452 e = window.event;
2453
2454 var target = e.target;
2455
2456 if (!target && e.srcElement)
2457 target = e.srcElement;
2458
2459 // work around Safari bug
2460 if (target && target.nodeType == 3)
2461 target = target.parentNode;
2462
2463 w3c_slidy.stop_propagation(e);
2464
2465 if (target && target.nodeName.toLowerCase() != "a")
2466 w3c_slidy.mouse_button_click(e);
2467 };
2468
2469 this.slide_number_element = counter;
2470 this.set_eos_status(false);
2471 document.body.appendChild(this.toolbar);
2472 },
2473
2474 // wysiwyg editors make it hard to use div elements
2475 // e.g. amaya loses the div when you copy and paste
2476 // this function wraps div elements around implicit
2477 // slides which start with an h1 element and continue
2478 // up to the next heading or div element
2479 wrap_implicit_slides: function () {
2480 var i, heading, node, next, div;
2481 var headings = document.getElementsByTagName("h1");
2482
2483 if (!headings)
2484 return;
2485
2486 for (i = 0; i < headings.length; ++i)
2487 {
2488 heading = headings[i];
2489
2490 if (heading.parentNode != document.body)
2491 continue;
2492
2493 node = heading.nextSibling;
2494
2495 div = document.createElement("div");
2496 this.add_class(div, "slide");
2497 document.body.replaceChild(div, heading);
2498 div.appendChild(heading);
2499
2500 while (node)
2501 {
2502 if (node.nodeType == 1 && // an element
2503 (node.nodeName == "H1" ||
2504 node.nodeName == "h1" ||
2505 node.nodeName == "DIV" ||
2506 node.nodeName == "div"))
2507 break;
2508
2509 next = node.nextSibling;
2510 node = document.body.removeChild(node);
2511 div.appendChild(node);
2512 node = next;
2513 }
2514 }
2515 },
2516
2517 // return new array of all slides
2518 collect_slides: function () {
2519 var slides = new Array();
2520 var divs = document.body.getElementsByTagName("div");
2521
2522 for (var i = 0; i < divs.length; ++i)
2523 {
2524 div = divs.item(i);
2525
2526 if (this.has_class(div, "slide"))
2527 {
2528 // add slide to collection
2529 slides[slides.length] = div;
2530
2531 // hide each slide as it is found
2532 this.add_class(div, "hidden");
2533
2534 // add dummy <br/> at end for scrolling hack
2535 var node1 = document.createElement("br");
2536 div.appendChild(node1);
2537 var node2 = document.createElement("br");
2538 div.appendChild(node2);
2539 }
2540 else if (this.has_class(div, "background"))
2541 { // work around for Firefox SVG reload bug
2542 // which otherwise replaces 1st SVG graphic with 2nd
2543 div.style.display = "block";
2544 }
2545 }
2546
2547 this.slides = slides;
2548 },
2549
2550 // return new array of all <div class="handout">
2551 collect_notes: function () {
2552 var notes = new Array();
2553 var divs = document.body.getElementsByTagName("div");
2554
2555 for (var i = 0; i < divs.length; ++i)
2556 {
2557 div = divs.item(i);
2558
2559 if (this.has_class(div, "handout"))
2560 {
2561 // add note to collection
2562 notes[notes.length] = div;
2563
2564 // and hide it
2565 this.add_class(div, "hidden");
2566 }
2567 }
2568
2569 this.notes = notes;
2570 },
2571
2572 // return new array of all <div class="background">
2573 // including named backgrounds e.g. class="background titlepage"
2574 collect_backgrounds: function () {
2575 var backgrounds = new Array();
2576 var divs = document.body.getElementsByTagName("div");
2577
2578 for (var i = 0; i < divs.length; ++i)
2579 {
2580 div = divs.item(i);
2581
2582 if (this.has_class(div, "background"))
2583 {
2584 // add background to collection
2585 backgrounds[backgrounds.length] = div;
2586
2587 // and hide it
2588 this.add_class(div, "hidden");
2589 }
2590 }
2591
2592 this.backgrounds = backgrounds;
2593 },
2594
2595 // set click handlers on all anchors
2596 patch_anchors: function () {
2597 var self = w3c_slidy;
2598 var handler = function (event) {
2599 // compare this.href with location.href
2600 // for link to another slide in this doc
2601
2602 if (self.page_address(this.href) == self.page_address(location.href))
2603 {
2604 // yes, so find new slide number
2605 var newslidenum = self.find_slide_number(this.href);
2606
2607 if (newslidenum != self.slide_number)
2608 {
2609 var slide = self.slides[self.slide_number];
2610 self.hide_slide(slide);
2611 self.slide_number = newslidenum;
2612 slide = self.slides[self.slide_number];
2613 self.show_slide(slide);
2614 self.set_location();
2615 }
2616 }
2617 else
2618 w3c_slidy.stop_propagation(event);
2619
2620 // else if (this.target == null)
2621 // location.href = this.href;
2622
2623 this.blur();
2624 self.disable_slide_click = true;
2625 };
2626
2627 var anchors = document.body.getElementsByTagName("a");
2628
2629 for (var i = 0; i < anchors.length; ++i)
2630 {
2631 if (window.addEventListener)
2632 anchors[i].addEventListener("click", handler, false);
2633 else
2634 anchors[i].attachEvent("onclick", handler);
2635 }
2636 },
2637
2638 // ### CHECK ME ### see which functions are invoked via setTimeout
2639 // either directly or indirectly for use of w3c_slidy vs this
2640 show_slide_number: function () {
2641 var timer = w3c_slidy.get_timer();
2642 w3c_slidy.slide_number_element.innerHTML = timer + w3c_slidy.localize("slide") + " " +
2643 (w3c_slidy.slide_number + 1) + "/" + w3c_slidy.slides.length;
2644 },
2645
2646 // every 200mS check if the location has been changed as a
2647 // result of the user activating the Back button/menu item
2648 // doesn't work for Opera < 9.5
2649 check_location: function () {
2650 var hash = location.hash;
2651
2652 if (w3c_slidy.slide_number > 0 && (hash == "" || hash == "#"))
2653 w3c_slidy.goto_slide(0);
2654 else if (hash.length > 2 && hash != "#("+(w3c_slidy.slide_number+1)+")")
2655 {
2656 var num = parseInt(location.hash.substr(2));
2657
2658 if (!isNaN(num))
2659 w3c_slidy.goto_slide(num-1);
2660 }
2661
2662 if (w3c_slidy.time_left && w3c_slidy.slide_number > 0)
2663 {
2664 w3c_slidy.show_slide_number();
2665
2666 if (w3c_slidy.time_left > 0)
2667 w3c_slidy.time_left -= 200;
2668 }
2669 },
2670
2671 get_timer: function () {
2672 var timer = "";
2673 if (w3c_slidy.time_left)
2674 {
2675 var mins, secs;
2676 secs = Math.floor(w3c_slidy.time_left/1000);
2677 mins = Math.floor(secs / 60);
2678 secs = secs % 60;
2679 timer = (mins ? mins+"m" : "") + secs + "s ";
2680 }
2681
2682 return timer;
2683 },
2684
2685 // this doesn't push location onto history stack for IE
2686 // for which a hidden iframe hack is needed: load page into
2687 // the iframe with script that set's parent's location.hash
2688 // but that won't work for standalone use unless we can
2689 // create the page dynamically via a javascript: URL
2690 set_location: function () {
2691 var uri = w3c_slidy.page_address(location.href);
2692 var hash = "#(" + (w3c_slidy.slide_number+1) + ")";
2693
2694 if (w3c_slidy.slide_number >= 0)
2695 uri = uri + hash;
2696
2697 if (w3c_slidy.ie && !w3c_slidy.ie8)
2698 w3c_slidy.push_hash(hash);
2699
2700 if (uri != location.href) // && !khtml
2701 location.href = uri;
2702
2703 if (this.khtml)
2704 hash = "(" + (w3c_slidy.slide_number+1) + ")";
2705
2706 if (!this.ie && location.hash != hash && location.hash != "")
2707 location.hash = hash;
2708
2709 document.title = w3c_slidy.title + " (" + (w3c_slidy.slide_number+1) + ")";
2710 w3c_slidy.show_slide_number();
2711 },
2712
2713 page_address: function (uri) {
2714 var i = uri.indexOf("#");
2715
2716 if (i < 0)
2717 i = uri.indexOf("%23");
2718
2719 // check if anchor is entire page
2720
2721 if (i < 0)
2722 return uri; // yes
2723
2724 return uri.substr(0, i);
2725 },
2726
2727 // only used for IE6 and IE7
2728 on_frame_loaded: function (hash) {
2729 location.hash = hash;
2730 var uri = w3c_slidy.page_address(location.href);
2731 location.href = uri + hash;
2732 },
2733
2734 // history hack with thanks to Bertrand Le Roy
2735 push_hash: function (hash) {
2736 if (hash == "") hash = "#(1)";
2737 window.location.hash = hash;
2738
2739 var doc = document.getElementById("historyFrame").contentWindow.document;
2740 },
2741
2742 // find current slide based upon location
2743 // first find target anchor and then look
2744 // for associated div element enclosing it
2745 // finally map that to slide number
2746 find_slide_number: function (uri) {
2747 // first get anchor from page location
2748
2749 var i = uri.indexOf("#");
2750
2751 // check if anchor is entire page
2752 if (i < 0)
2753 return 0; // yes
2754
2755 var anchor = unescape(uri.substr(i+1));
2756
2757 // now use anchor as XML ID to find target
2758 var target = document.getElementById(anchor);
2759
2760 if (!target)
2761 {
2762 // does anchor look like "(2)" for slide 2 ??
2763 // where first slide is (1)
2764 var re = /\((\d)+\)/;
2765
2766 if (anchor.match(re))
2767 {
2768 var num = parseInt(anchor.substring(1, anchor.length-1));
2769
2770 if (num > this.slides.length)
2771 num = 1;
2772
2773 if (--num < 0)
2774 num = 0;
2775
2776 return num;
2777 }
2778
2779 // accept [2] for backwards compatibility
2780 re = /\[(\d)+\]/;
2781
2782 if (anchor.match(re))
2783 {
2784 var num = parseInt(anchor.substring(1, anchor.length-1));
2785
2786 if (num > this.slides.length)
2787 num = 1;
2788
2789 if (--num < 0)
2790 num = 0;
2791
2792 return num;
2793 }
2794
2795 // oh dear unknown anchor
2796 return 0;
2797 }
2798
2799 // search for enclosing slide
2800
2801 while (true)
2802 {
2803 // browser coerces html elements to uppercase!
2804 if (target.nodeName.toLowerCase() == "div" &&
2805 this.has_class(target, "slide"))
2806 {
2807 // found the slide element
2808 break;
2809 }
2810
2811 // otherwise try parent element if any
2812
2813 target = target.parentNode;
2814
2815 if (!target)
2816 {
2817 return 0; // no luck!
2818 }
2819 };
2820
2821 for (i = 0; i < slides.length; ++i)
2822 {
2823 if (slides[i] == target)
2824 return i; // success
2825 }
2826
2827 // oh dear still no luck
2828 return 0;
2829 },
2830
2831 previous_slide: function (incremental) {
2832 if (!w3c_slidy.view_all)
2833 {
2834 var slide;
2835
2836 //jmi
2837 if (!w3c_slidy.incremental_display) {incremental = false;}
2838
2839 if ((incremental || w3c_slidy.slide_number == 0) && w3c_slidy.last_shown != null)
2840 {
2841 w3c_slidy.last_shown = w3c_slidy.hide_previous_item(w3c_slidy.last_shown);
2842 w3c_slidy.set_eos_status(false);
2843 }
2844 else if (w3c_slidy.slide_number > 0)
2845 {
2846 slide = w3c_slidy.slides[w3c_slidy.slide_number];
2847 w3c_slidy.hide_slide(slide);
2848
2849 w3c_slidy.slide_number = w3c_slidy.slide_number - 1;
2850 slide = w3c_slidy.slides[w3c_slidy.slide_number];
2851 w3c_slidy.set_visibility_all_incremental("visible");
2852 w3c_slidy.last_shown = w3c_slidy.previous_incremental_item(null);
2853 w3c_slidy.set_eos_status(true);
2854 w3c_slidy.show_slide(slide);
2855 }
2856
2857 w3c_slidy.set_location();
2858
2859 if (!w3c_slidy.ns_pos)
2860 w3c_slidy.refresh_toolbar(200);
2861 }
2862 },
2863
2864 next_slide: function (incremental) {
2865 if (!w3c_slidy.view_all)
2866 {
2867 var slide, last = w3c_slidy.last_shown;
2868 //jmi
2869 if (!w3c_slidy.incremental_display) {incremental = false;}
2870
2871 if (incremental || w3c_slidy.slide_number == w3c_slidy.slides.length - 1)
2872 w3c_slidy.last_shown = w3c_slidy.reveal_next_item(w3c_slidy.last_shown);
2873
2874 if ((!incremental || w3c_slidy.last_shown == null) &&
2875 w3c_slidy.slide_number < w3c_slidy.slides.length - 1)
2876 {
2877 slide = w3c_slidy.slides[w3c_slidy.slide_number];
2878 w3c_slidy.hide_slide(slide);
2879
2880 w3c_slidy.slide_number = w3c_slidy.slide_number + 1;
2881 slide = w3c_slidy.slides[w3c_slidy.slide_number];
2882 w3c_slidy.last_shown = null;
2883 w3c_slidy.set_visibility_all_incremental("hidden");
2884 w3c_slidy.show_slide(slide);
2885 }
2886 else if (!w3c_slidy.last_shown)
2887 {
2888 if (last && incremental)
2889 w3c_slidy.last_shown = last;
2890 }
2891
2892 w3c_slidy.set_location();
2893
2894 w3c_slidy.set_eos_status(!w3c_slidy.next_incremental_item(w3c_slidy.last_shown));
2895
2896 if (!w3c_slidy.ns_pos)
2897 w3c_slidy.refresh_toolbar(200);
2898 }
2899 },
2900
2901 // to first slide with nothing revealed
2902 // i.e. state at start of presentation
2903 first_slide: function () {
2904 if (!w3c_slidy.view_all)
2905 {
2906 var slide;
2907
2908 if (w3c_slidy.slide_number != 0)
2909 {
2910 slide = w3c_slidy.slides[w3c_slidy.slide_number];
2911 w3c_slidy.hide_slide(slide);
2912
2913 w3c_slidy.slide_number = 0;
2914 slide = w3c_slidy.slides[w3c_slidy.slide_number];
2915 w3c_slidy.last_shown = null;
2916 w3c_slidy.set_visibility_all_incremental("hidden");
2917 w3c_slidy.show_slide(slide);
2918 }
2919
2920 w3c_slidy.set_eos_status(
2921 !w3c_slidy.next_incremental_item(w3c_slidy.last_shown));
2922 w3c_slidy.set_location();
2923 }
2924 },
2925
2926 // goto last slide with everything revealed
2927 // i.e. state at end of presentation
2928 last_slide: function () {
2929 if (!w3c_slidy.view_all)
2930 {
2931 var slide;
2932
2933 w3c_slidy.last_shown = null; //revealNextItem(lastShown);
2934
2935 if (w3c_slidy.last_shown == null &&
2936 w3c_slidy.slide_number < w3c_slidy.slides.length - 1)
2937 {
2938 slide = w3c_slidy.slides[w3c_slidy.slide_number];
2939 w3c_slidy.hide_slide(slide);
2940 w3c_slidy.slide_number = w3c_slidy.slides.length - 1;
2941 slide = w3c_slidy.slides[w3c_slidy.slide_number];
2942 w3c_slidy.set_visibility_all_incremental("visible");
2943 w3c_slidy.last_shown = w3c_slidy.previous_incremental_item(null);
2944
2945 w3c_slidy.show_slide(slide);
2946 }
2947 else
2948 {
2949 w3c_slidy.set_visibility_all_incremental("visible");
2950 w3c_slidy.last_shown = w3c_slidy.previous_incremental_item(null);
2951 }
2952
2953 w3c_slidy.set_eos_status(true);
2954 w3c_slidy.set_location();
2955 }
2956 },
2957
2958
2959 // ### check this and consider add/remove class
2960 set_eos_status: function (state) {
2961 if (this.eos)
2962 this.eos.style.color = (state ? "rgb(240,240,240)" : "red");
2963 },
2964
2965 // first slide is 0
2966 goto_slide: function (num) {
2967 //alert("going to slide " + (num+1));
2968 var slide = w3c_slidy.slides[w3c_slidy.slide_number];
2969 w3c_slidy.hide_slide(slide);
2970 w3c_slidy.slide_number = num;
2971 slide = w3c_slidy.slides[w3c_slidy.slide_number];
2972 w3c_slidy.last_shown = null;
2973 w3c_slidy.set_visibility_all_incremental("hidden");
2974 w3c_slidy.set_eos_status(!w3c_slidy.next_incremental_item(w3c_slidy.last_shown));
2975 document.title = w3c_slidy.title + " (" + (w3c_slidy.slide_number+1) + ")";
2976 w3c_slidy.show_slide(slide);
2977 w3c_slidy.show_slide_number();
2978 },
2979
2980
2981 show_slide: function (slide) {
2982 this.sync_background(slide);
2983 window.scrollTo(0,0);
2984 this.remove_class(slide, "hidden");
2985 },
2986
2987 hide_slide: function (slide) {
2988 this.add_class(slide, "hidden");
2989 },
2990
2991 // show just the backgrounds pertinent to this slide
2992 // when slide background-color is transparent
2993 // this should now work with rgba color values
2994 sync_background: function (slide) {
2995 var background;
2996 var bgColor;
2997
2998 if (slide.currentStyle)
2999 bgColor = slide.currentStyle["backgroundColor"];
3000 else if (document.defaultView)
3001 {
3002 var styles = document.defaultView.getComputedStyle(slide,null);
3003
3004 if (styles)
3005 bgColor = styles.getPropertyValue("background-color");
3006 else // broken implementation probably due Safari or Konqueror
3007 {
3008 //alert("defective implementation of getComputedStyle()");
3009 bgColor = "transparent";
3010 }
3011 }
3012 else
3013 bgColor == "transparent";
3014
3015 if (bgColor == "transparent" ||
3016 bgColor.indexOf("rgba") >= 0 ||
3017 bgColor.indexOf("opacity") >= 0)
3018 {
3019 var slideClass = this.get_class_list(slide);
3020
3021 for (var i = 0; i < this.backgrounds.length; i++)
3022 {
3023 background = this.backgrounds[i];
3024
3025 var bgClass = this.get_class_list(background);
3026
3027 if (this.matching_background(slideClass, bgClass))
3028 this.remove_class(background, "hidden");
3029 else
3030 this.add_class(background, "hidden");
3031 }
3032 }
3033 else // forcibly hide all backgrounds
3034 this.hide_backgrounds();
3035 },
3036
3037 hide_backgrounds: function () {
3038 for (var i = 0; i < this.backgrounds.length; i++)
3039 {
3040 background = this.backgrounds[i];
3041 this.add_class(background, "hidden");
3042 }
3043 },
3044
3045 // compare classes for slide and background
3046 matching_background: function (slideClass, bgClass) {
3047 var i, count, pattern, result;
3048
3049 // define pattern as regular expression
3050 pattern = /\w+/g;
3051
3052 // check background class names
3053 result = bgClass.match(pattern);
3054
3055 for (i = count = 0; i < result.length; i++)
3056 {
3057 if (result[i] == "hidden")
3058 continue;
3059
3060 if (result[i] == "background")
3061 continue;
3062
3063 ++count;
3064 }
3065
3066 if (count == 0) // default match
3067 return true;
3068
3069 // check for matches and place result in array
3070 result = slideClass.match(pattern);
3071
3072 // now check if desired name is present for background
3073 for (i = count = 0; i < result.length; i++)
3074 {
3075 if (result[i] == "hidden")
3076 continue;
3077
3078 if (this.has_token(bgClass, result[i]))
3079 return true;
3080 }
3081
3082 return false;
3083 },
3084
3085 resized: function () {
3086 var width = 0;
3087
3088 if ( typeof( window.innerWidth ) == 'number' )
3089 width = window.innerWidth; // Non IE browser
3090 else if (document.documentElement && document.documentElement.clientWidth)
3091 width = document.documentElement.clientWidth; // IE6
3092 else if (document.body && document.body.clientWidth)
3093 width = document.body.clientWidth; // IE4
3094
3095 var height = 0;
3096
3097 if ( typeof( window.innerHeight ) == 'number' )
3098 height = window.innerHeight; // Non IE browser
3099 else if (document.documentElement && document.documentElement.clientHeight)
3100 height = document.documentElement.clientHeight; // IE6
3101 else if (document.body && document.body.clientHeight)
3102 height = document.body.clientHeight; // IE4
3103
3104 if (height && (width/height > 1.05*1024/768))
3105 {
3106 width = height * 1024.0/768;
3107 }
3108
3109 // IE fires onresize even when only font size is changed!
3110 // so we do a check to avoid blocking < and > actions
3111 if (width != w3c_slidy.last_width || height != w3c_slidy.last_height)
3112 {
3113 if (width >= 1100)
3114 w3c_slidy.size_index = 5; // 4
3115 else if (width >= 1000)
3116 w3c_slidy.size_index = 4; // 3
3117 else if (width >= 800)
3118 w3c_slidy.size_index = 3; // 2
3119 else if (width >= 600)
3120 w3c_slidy.size_index = 2; // 1
3121 else if (width)
3122 w3c_slidy.size_index = 0;
3123
3124 // add in font size adjustment from meta element e.g.
3125 // <meta name="font-size-adjustment" content="-2" />
3126 // useful when slides have too much content ;-)
3127
3128 if (0 <= w3c_slidy.size_index + w3c_slidy.size_adjustment &&
3129 w3c_slidy.size_index + w3c_slidy.size_adjustment < w3c_slidy.sizes.length)
3130 w3c_slidy.size_index = w3c_slidy.size_index + w3c_slidy.size_adjustment;
3131
3132 // enables cross browser use of relative width/height
3133 // on object elements for use with SVG and Flash media
3134 w3c_slidy.adjust_object_dimensions(width, height);
3135
3136 if (document.body.style.fontSize != w3c_slidy.sizes[w3c_slidy.size_index])
3137 {
3138 document.body.style.fontSize = w3c_slidy.sizes[w3c_slidy.size_index];
3139 }
3140
3141 w3c_slidy.last_width = width;
3142 w3c_slidy.last_height = height;
3143
3144 // force reflow to work around Mozilla bug
3145 if (w3c_slidy.ns_pos)
3146 {
3147 var slide = w3c_slidy.slides[w3c_slidy.slide_number];
3148 w3c_slidy.hide_slide(slide);
3149 w3c_slidy.show_slide(slide);
3150 }
3151
3152 // force correct positioning of toolbar
3153 w3c_slidy.refresh_toolbar(200);
3154 }
3155 },
3156
3157 scrolled: function () {
3158 if (w3c_slidy.toolbar && !w3c_slidy.ns_pos && !w3c_slidy.ie7)
3159 {
3160 w3c_slidy.hack_offset = w3c_slidy.scroll_x_offset();
3161 // hide toolbar
3162 w3c_slidy.toolbar.style.display = "none";
3163
3164 // make it reappear later
3165 if (w3c_slidy.scrollhack == 0 && !w3c_slidy.view_all)
3166 {
3167 setTimeout(function () {w3c_slidy.show_toolbar(); }, 1000);
3168 w3c_slidy.scrollhack = 1;
3169 }
3170 }
3171 },
3172
3173 hide_toolbar: function () {
3174 w3c_slidy.add_class(w3c_slidy.toolbar, "hidden");
3175 window.focus();
3176 },
3177
3178 // used to ensure IE refreshes toolbar in correct position
3179 refresh_toolbar: function (interval) {
3180 if (!w3c_slidy.ns_pos && !w3c_slidy.ie7)
3181 {
3182 w3c_slidy.hide_toolbar();
3183 setTimeout(function () {w3c_slidy.show_toolbar(); }, interval);
3184 }
3185 },
3186
3187 // restores toolbar after short delay
3188 show_toolbar: function () {
3189 if (w3c_slidy.want_toolbar)
3190 {
3191 w3c_slidy.toolbar.style.display = "block";
3192
3193 if (!w3c_slidy.ns_pos)
3194 {
3195 // adjust position to allow for scrolling
3196 var xoffset = w3c_slidy.scroll_x_offset();
3197 w3c_slidy.toolbar.style.left = xoffset;
3198 w3c_slidy.toolbar.style.right = xoffset;
3199
3200 // determine vertical scroll offset
3201 //var yoffset = scrollYOffset();
3202
3203 // bottom is doc height - window height - scroll offset
3204 //var bottom = documentHeight() - lastHeight - yoffset
3205
3206 //if (yoffset > 0 || documentHeight() > lastHeight)
3207 // bottom += 16; // allow for height of scrollbar
3208
3209 w3c_slidy.toolbar.style.bottom = 0; //bottom;
3210 }
3211
3212 w3c_slidy.remove_class(w3c_slidy.toolbar, "hidden");
3213 }
3214
3215 w3c_slidy.scrollhack = 0;
3216
3217
3218 // set the keyboard focus to the help link on the
3219 // toolbar to ensure that document has the focus
3220 // IE doesn't always work with window.focus()
3221 // and this hack has benefit of Enter for help
3222
3223 try
3224 {
3225 if (!w3c_slidy.opera)
3226 w3c_slidy.help_anchor.focus();
3227 }
3228 catch (e)
3229 {
3230 }
3231 },
3232
3233 // invoked via F key
3234 toggle_toolbar: function () {
3235 if (!w3c_slidy.view_all)
3236 {
3237 if (w3c_slidy.has_class(w3c_slidy.toolbar, "hidden"))
3238 {
3239 w3c_slidy.remove_class(w3c_slidy.toolbar, "hidden")
3240 w3c_slidy.want_toolbar = 1;
3241 }
3242 else
3243 {
3244 w3c_slidy.add_class(w3c_slidy.toolbar, "hidden")
3245 w3c_slidy.want_toolbar = 0;
3246 }
3247 }
3248 },
3249
3250 scroll_x_offset: function () {
3251 if (window.pageXOffset)
3252 return self.pageXOffset;
3253
3254 if (document.documentElement &&
3255 document.documentElement.scrollLeft)
3256 return document.documentElement.scrollLeft;
3257
3258 if (document.body)
3259 return document.body.scrollLeft;
3260
3261 return 0;
3262 },
3263
3264 scroll_y_offset: function () {
3265 if (window.pageYOffset)
3266 return self.pageYOffset;
3267
3268 if (document.documentElement &&
3269 document.documentElement.scrollTop)
3270 return document.documentElement.scrollTop;
3271
3272 if (document.body)
3273 return document.body.scrollTop;
3274
3275 return 0;
3276 },
3277
3278 // looking for a way to determine height of slide content
3279 // the slide itself is set to the height of the window
3280 optimize_font_size: function () {
3281 var slide = w3c_slidy.slides[w3c_slidy.slide_number];
3282
3283 //var dh = documentHeight(); //getDocHeight(document);
3284 var dh = slide.scrollHeight;
3285 var wh = getWindowHeight();
3286 var u = 100 * dh / wh;
3287
3288 alert("window utilization = " + u + "% (doc "
3289 + dh + " win " + wh + ")");
3290 },
3291
3292 // from document object
3293 get_doc_height: function (doc) {
3294 if (!doc)
3295 doc = document;
3296
3297 if (doc && doc.body && doc.body.offsetHeight)
3298 return doc.body.offsetHeight; // ns/gecko syntax
3299
3300 if (doc && doc.body && doc.body.scrollHeight)
3301 return doc.body.scrollHeight;
3302
3303 alert("couldn't determine document height");
3304 },
3305
3306 get_window_height: function () {
3307 if ( typeof( window.innerHeight ) == 'number' )
3308 return window.innerHeight; // Non IE browser
3309
3310 if (document.documentElement && document.documentElement.clientHeight)
3311 return document.documentElement.clientHeight; // IE6
3312
3313 if (document.body && document.body.clientHeight)
3314 return document.body.clientHeight; // IE4
3315 },
3316
3317 document_height: function () {
3318 var sh, oh;
3319
3320 sh = document.body.scrollHeight;
3321 oh = document.body.offsetHeight;
3322
3323 if (sh && oh)
3324 {
3325 return (sh > oh ? sh : oh);
3326 }
3327
3328 // no idea!
3329 return 0;
3330 },
3331
3332 smaller: function () {
3333 if (w3c_slidy.size_index > 0)
3334 {
3335 --w3c_slidy.size_index;
3336 }
3337
3338 w3c_slidy.toolbar.style.display = "none";
3339 document.body.style.fontSize = w3c_slidy.sizes[w3c_slidy.size_index];
3340 var slide = w3c_slidy.slides[w3c_slidy.slide_number];
3341 w3c_slidy.hide_slide(slide);
3342 w3c_slidy.show_slide(slide);
3343 setTimeout(function () {w3c_slidy.show_toolbar(); }, 50);
3344 },
3345
3346 bigger: function () {
3347 if (w3c_slidy.size_index < w3c_slidy.sizes.length - 1)
3348 {
3349 ++w3c_slidy.size_index;
3350 }
3351
3352 w3c_slidy.toolbar.style.display = "none";
3353 document.body.style.fontSize = w3c_slidy.sizes[w3c_slidy.size_index];
3354 var slide = w3c_slidy.slides[w3c_slidy.slide_number];
3355 w3c_slidy.hide_slide(slide);
3356 w3c_slidy.show_slide(slide);
3357 setTimeout(function () {w3c_slidy.show_toolbar(); }, 50);
3358 },
3359
3360 // enables cross browser use of relative width/height
3361 // on object elements for use with SVG and Flash media
3362 // with thanks to Ivan Herman for the suggestion
3363 adjust_object_dimensions: function (width, height) {
3364 for( var i = 0; i < w3c_slidy.objects.length; i++ )
3365 {
3366 var obj = this.objects[i];
3367 var mimeType = obj.getAttribute("type");
3368
3369 if (mimeType == "image/svg+xml" || mimeType == "application/x-shockwave-flash")
3370 {
3371 if ( !obj.initialWidth )
3372 obj.initialWidth = obj.getAttribute("width");
3373
3374 if ( !obj.initialHeight )
3375 obj.initialHeight = obj.getAttribute("height");
3376
3377 if ( obj.initialWidth && obj.initialWidth.charAt(obj.initialWidth.length-1) == "%" )
3378 {
3379 var w = parseInt(obj.initialWidth.slice(0, obj.initialWidth.length-1));
3380 var newW = width * (w/100.0);
3381 obj.setAttribute("width",newW);
3382 }
3383
3384 if ( obj.initialHeight &&
3385 obj.initialHeight.charAt(obj.initialHeight.length-1) == "%" )
3386 {
3387 var h = parseInt(obj.initialHeight.slice(0, obj.initialHeight.length-1));
3388 var newH = height * (h/100.0);
3389 obj.setAttribute("height", newH);
3390 }
3391 }
3392 }
3393 },
3394
3395 // needed for Opera to inhibit default behavior
3396 // since Opera delivers keyPress even if keyDown
3397 // was cancelled
3398 key_press: function (event) {
3399 if (!event)
3400 event = window.event;
3401
3402 if (!w3c_slidy.key_wanted)
3403 return w3c_slidy.cancel(event);
3404
3405 return true;
3406 },
3407
3408 // See e.g. http://www.quirksmode.org/js/events/keys.html for keycodes
3409 key_down: function (event) {
3410 var key, target, tag;
3411
3412 w3c_slidy.key_wanted = true;
3413
3414 if (!event)
3415 event = window.event;
3416
3417 // kludge around NS/IE differences
3418 if (window.event)
3419 {
3420 key = window.event.keyCode;
3421 target = window.event.srcElement;
3422 }
3423 else if (event.which)
3424 {
3425 key = event.which;
3426 target = event.target;
3427 }
3428 else
3429 return true; // Yikes! unknown browser
3430
3431 // ignore event if key value is zero
3432 // as for alt on Opera and Konqueror
3433 if (!key)
3434 return true;
3435
3436 // avoid interfering with keystroke
3437 // behavior for non-slidy chrome elements
3438 if (!w3c_slidy.slidy_chrome(target) &&
3439 w3c_slidy.special_element(target))
3440 return true;
3441
3442 // check for concurrent control/command/alt key
3443 // but are these only present on mouse events?
3444
3445 if (event.ctrlKey || event.altKey || event.metaKey)
3446 return true;
3447
3448 // dismiss table of contents if visible
3449 if (w3c_slidy.is_shown_toc() && key != 9 && key != 16 && key != 38 && key != 40)
3450 {
3451 w3c_slidy.hide_table_of_contents(true);
3452
3453 if (key == 27 || key == 84 || key == 67)
3454 return w3c_slidy.cancel(event);
3455 }
3456
3457 if (key == 34) // Page Down
3458 {
3459 if (w3c_slidy.view_all)
3460 return true;
3461
3462 w3c_slidy.next_slide(false);
3463 return w3c_slidy.cancel(event);
3464 }
3465 else if (key == 33) // Page Up
3466 {
3467 if (w3c_slidy.view_all)
3468 return true;
3469
3470 w3c_slidy.previous_slide(false);
3471 return w3c_slidy.cancel(event);
3472 }
3473 else if (key == 32) // space bar
3474 {
3475 w3c_slidy.next_slide(true);
3476 return w3c_slidy.cancel(event);
3477 }
3478 else if (key == 37) // Left arrow
3479 {
3480 w3c_slidy.previous_slide(!event.shiftKey);
3481 return w3c_slidy.cancel(event);
3482 }
3483 else if (key == 36) // Home
3484 {
3485 w3c_slidy.first_slide();
3486 return w3c_slidy.cancel(event);
3487 }
3488 else if (key == 35) // End
3489 {
3490 w3c_slidy.last_slide();
3491 return w3c_slidy.cancel(event);
3492 }
3493 else if (key == 39) // Right arrow
3494 {
3495 w3c_slidy.next_slide(!event.shiftKey);
3496 return w3c_slidy.cancel(event);
3497 }
3498 else if (key == 13) // Enter
3499 {
3500 if (w3c_slidy.outline)
3501 {
3502 if (w3c_slidy.outline.visible)
3503 w3c_slidy.fold(w3c_slidy.outline);
3504 else
3505 w3c_slidy.unfold(w3c_slidy.outline);
3506
3507 return w3c_slidy.cancel(event);
3508 }
3509 }
3510 else if (key == 188) // < for smaller fonts
3511 {
3512 w3c_slidy.smaller();
3513 return w3c_slidy.cancel(event);
3514 }
3515 else if (key == 190) // > for larger fonts
3516 {
3517 w3c_slidy.bigger();
3518 return w3c_slidy.cancel(event);
3519 }
3520 else if (key == 189 || key == 109) // - for smaller fonts
3521 {
3522 w3c_slidy.smaller();
3523 return w3c_slidy.cancel(event);
3524 }
3525 else if (key == 187 || key == 191 || key == 107) // = + for larger fonts
3526 {
3527 w3c_slidy.bigger();
3528 return w3c_slidy.cancel(event);
3529 }
3530 else if (key == 83) // S for smaller fonts
3531 {
3532 w3c_slidy.smaller();
3533 return w3c_slidy.cancel(event);
3534 }
3535 else if (key == 66) // B for larger fonts
3536 {
3537 w3c_slidy.bigger();
3538 return w3c_slidy.cancel(event);
3539 }
3540 else if (key == 90) // Z for last slide
3541 {
3542 w3c_slidy.last_slide();
3543 return w3c_slidy.cancel(event);
3544 }
3545 else if (key == 70) // F for toggle toolbar
3546 {
3547 w3c_slidy.toggle_toolbar();
3548 return w3c_slidy.cancel(event);
3549 }
3550 else if (key == 65) // A for toggle view single/all slides
3551 {
3552 w3c_slidy.toggle_view();
3553 return w3c_slidy.cancel(event);
3554 }
3555 else if (key == 75) // toggle action of left click for next page
3556 {
3557 w3c_slidy.mouse_click_enabled = !w3c_slidy.mouse_click_enabled;
3558 var alert_msg = (w3c_slidy.mouse_click_enabled ?
3559 "enabled" : "disabled") + " mouse click advance";
3560
3561 alert(w3c_slidy.localize(alert_msg));
3562 return w3c_slidy.cancel(event);
3563 }
3564 else if (key == 84 || key == 67) // T or C for table of contents
3565 {
3566 if (w3c_slidy.toc)
3567 w3c_slidy.toggle_table_of_contents();
3568
3569 return w3c_slidy.cancel(event);
3570 }
3571 else if (key == 72) // H for help
3572 {
3573 window.location = w3c_slidy.help_page;
3574 return w3c_slidy.cancel(event);
3575 }
3576 //jmi
3577 else if (key == 73) // I to toggle incremental display
3578 {
3579 var slide = w3c_slidy.slides[w3c_slidy.slide_number];
3580 w3c_slidy.hide_slide(slide);
3581 if (w3c_slidy.incremental_display) { w3c_slidy.set_visibility_all_incremental("visible"); }
3582 w3c_slidy.incremental_display = !w3c_slidy.incremental_display ;
3583 w3c_slidy.last_shown = null ;
3584 w3c_slidy.set_visibility_all_incremental("hidden");
3585 //this.set_eos_status(true);
3586 w3c_slidy.show_slide(slide);
3587 return w3c_slidy.cancel(event);
3588 }
3589 else if (key == 76) // L to toggle color-set
3590 {
3591 w3c_slidy.toggle_color_set();
3592 return w3c_slidy.cancel(event);
3593 }
3594 else if (key == 77) // display help_keymap
3595 {
3596 alert(w3c_slidy.help_keymap);
3597 return w3c_slidy.cancel(event);
3598 }
3599 //jmi end
3600 //else alert("key code is "+ key);
3601 return true;
3602 },
3603
3604 // safe for both text/html and application/xhtml+xml
3605 create_element: function (name) {
3606 if (this.xhtml && (typeof document.createElementNS != 'undefined'))
3607 return document.createElementNS("http://www.w3.org/1999/xhtml", name)
3608
3609 return document.createElement(name);
3610 },
3611
3612 get_element_style: function (elem, IEStyleProp, CSSStyleProp) {
3613 if (elem.currentStyle)
3614 {
3615 return elem.currentStyle[IEStyleProp];
3616 }
3617 else if (window.getComputedStyle)
3618 {
3619 var compStyle = window.getComputedStyle(elem, "");
3620 return compStyle.getPropertyValue(CSSStyleProp);
3621 }
3622 return "";
3623 },
3624
3625 // the string str is a whitespace separated list of tokens
3626 // test if str contains a particular token, e.g. "slide"
3627 has_token: function (str, token) {
3628 if (str)
3629 {
3630 // define pattern as regular expression
3631 var pattern = /\w+/g;
3632
3633 // check for matches
3634 // place result in array
3635 var result = str.match(pattern);
3636
3637 // now check if desired token is present
3638 for (var i = 0; i < result.length; i++)
3639 {
3640 if (result[i] == token)
3641 return true;
3642 }
3643 }
3644
3645 return false;
3646 },
3647
3648 get_class_list: function (element) {
3649 if (typeof element.className != 'undefined')
3650 return element.className;
3651
3652 return element.getAttribute("class");
3653 },
3654
3655 has_class: function (element, name) {
3656 if (element.nodeType != 1)
3657 return false;
3658
3659 var regexp = new RegExp("(^| )" + name + "\W*");
3660
3661 if (typeof element.className != 'undefined')
3662 return regexp.test(element.className);
3663
3664 return regexp.test(element.getAttribute("class"));
3665 },
3666
3667 remove_class: function (element, name) {
3668 var regexp = new RegExp("(^| )" + name + "\W*");
3669 var clsval = "";
3670
3671 if (typeof element.className != 'undefined')
3672 {
3673 clsval = element.className;
3674
3675 if (clsval)
3676 {
3677 clsval = clsval.replace(regexp, "");
3678 element.className = clsval;
3679 }
3680 }
3681 else
3682 {
3683 clsval = element.getAttribute("class");
3684
3685 if (clsval)
3686 {
3687 clsval = clsval.replace(regexp, "");
3688 element.setAttribute("class", clsval);
3689 }
3690 }
3691 },
3692
3693 add_class: function (element, name) {
3694 if (!this.has_class(element, name))
3695 {
3696 if (typeof element.className != 'undefined')
3697 element.className += " " + name;
3698 else
3699 {
3700 var clsval = element.getAttribute("class");
3701 clsval = clsval ? clsval + " " + name : name;
3702 element.setAttribute("class", clsval);
3703 }
3704 }
3705 },
3706
3707 // HTML elements that can be used with class="incremental"
3708 // note that you can also put the class on containers like
3709 // up, ol, dl, and div to make their contents appear
3710 // incrementally. Upper case is used since this is what
3711 // browsers report for HTML node names (text/html).
3712 incremental_elements: null,
3713 okay_for_incremental: function (name) {
3714 if (!this.incremental_elements)
3715 {
3716 var inclist = new Array();
3717 inclist["p"] = true;
3718 inclist["pre"] = true;
3719 inclist["li"] = true;
3720 inclist["blockquote"] = true;
3721 inclist["dt"] = true;
3722 inclist["dd"] = true;
3723 inclist["h2"] = true;
3724 inclist["h3"] = true;
3725 inclist["h4"] = true;
3726 inclist["h5"] = true;
3727 inclist["h6"] = true;
3728 inclist["span"] = true;
3729 inclist["address"] = true;
3730 inclist["table"] = true;
3731 inclist["tr"] = true;
3732 inclist["th"] = true;
3733 inclist["td"] = true;
3734 inclist["img"] = true;
3735 inclist["object"] = true;
3736 this.incremental_elements = inclist;
3737 }
3738 return this.incremental_elements[name.toLowerCase()];
3739 },
3740
3741 next_incremental_item: function (node) {
3742 var br = this.is_xhtml ? "br" : "BR";
3743 var slide = w3c_slidy.slides[w3c_slidy.slide_number];
3744
3745 for (;;)
3746 {
3747 node = w3c_slidy.next_node(slide, node);
3748
3749 if (node == null || node.parentNode == null)
3750 break;
3751
3752 if (node.nodeType == 1) // ELEMENT
3753 {
3754 if (node.nodeName == br)
3755 continue;
3756
3757 if (w3c_slidy.has_class(node, "incremental")
3758 && w3c_slidy.okay_for_incremental(node.nodeName))
3759 return node;
3760
3761 if (w3c_slidy.has_class(node.parentNode, "incremental")
3762 && !w3c_slidy.has_class(node, "non-incremental"))
3763 return node;
3764 }
3765 }
3766
3767 return node;
3768 },
3769
3770 previous_incremental_item: function (node) {
3771 var br = this.is_xhtml ? "br" : "BR";
3772 var slide = w3c_slidy.slides[w3c_slidy.slide_number];
3773
3774 for (;;)
3775 {
3776 node = w3c_slidy.previous_node(slide, node);
3777
3778 if (node == null || node.parentNode == null)
3779 break;
3780
3781 if (node.nodeType == 1)
3782 {
3783 if (node.nodeName == br)
3784 continue;
3785
3786 if (w3c_slidy.has_class(node, "incremental")
3787 && w3c_slidy.okay_for_incremental(node.nodeName))
3788 return node;
3789
3790 if (w3c_slidy.has_class(node.parentNode, "incremental")
3791 && !w3c_slidy.has_class(node, "non-incremental"))
3792 return node;
3793 }
3794 }
3795
3796 return node;
3797 },
3798
3799 // set visibility for all elements on current slide with
3800 // a parent element with attribute class="incremental"
3801 set_visibility_all_incremental: function (value) {
3802 var node = this.next_incremental_item(null);
3803
3804 //jmi
3805 if (!w3c_slidy.incremental_display) {value = "visible";}
3806
3807 if (value == "hidden")
3808 {
3809 while (node)
3810 {
3811 w3c_slidy.add_class(node, "invisible");
3812 node = w3c_slidy.next_incremental_item(node);
3813 }
3814 }
3815 else // value == "visible"
3816 {
3817 while (node)
3818 {
3819 w3c_slidy.remove_class(node, "invisible");
3820 node = w3c_slidy.next_incremental_item(node);
3821 }
3822 }
3823 },
3824
3825 // reveal the next hidden item on the slide
3826 // node is null or the node that was last revealed
3827 reveal_next_item: function (node) {
3828 node = w3c_slidy.next_incremental_item(node);
3829
3830 if (node && node.nodeType == 1) // an element
3831 w3c_slidy.remove_class(node, "invisible");
3832
3833 return node;
3834 },
3835
3836 // exact inverse of revealNextItem(node)
3837 hide_previous_item: function (node) {
3838 if (node && node.nodeType == 1) // an element
3839 w3c_slidy.add_class(node, "invisible");
3840
3841 return this.previous_incremental_item(node);
3842 },
3843
3844 // left to right traversal of root's content
3845 next_node: function (root, node) {
3846 if (node == null)
3847 return root.firstChild;
3848
3849 if (node.firstChild)
3850 return node.firstChild;
3851
3852 if (node.nextSibling)
3853 return node.nextSibling;
3854
3855 for (;;)
3856 {
3857 node = node.parentNode;
3858
3859 if (!node || node == root)
3860 break;
3861
3862 if (node && node.nextSibling)
3863 return node.nextSibling;
3864 }
3865
3866 return null;
3867 },
3868
3869 // right to left traversal of root's content
3870 previous_node: function (root, node) {
3871 if (node == null)
3872 {
3873 node = root.lastChild;
3874
3875 if (node)
3876 {
3877 while (node.lastChild)
3878 node = node.lastChild;
3879 }
3880
3881 return node;
3882 }
3883
3884 if (node.previousSibling)
3885 {
3886 node = node.previousSibling;
3887
3888 while (node.lastChild)
3889 node = node.lastChild;
3890
3891 return node;
3892 }
3893
3894 if (node.parentNode != root)
3895 return node.parentNode;
3896
3897 return null;
3898 },
3899
3900 previous_sibling_element: function (el) {
3901 el = el.previousSibling;
3902
3903 while (el && el.nodeType != 1)
3904 el = el.previousSibling;
3905
3906 return el;
3907 },
3908
3909 next_sibling_element: function (el) {
3910 el = el.nextSibling;
3911
3912 while (el && el.nodeType != 1)
3913 el = el.nextSibling;
3914
3915 return el;
3916 },
3917
3918 first_child_element: function (el) {
3919 var node;
3920
3921 for (node = el.firstChild; node; node = node.nextSibling)
3922 {
3923 if (node.nodeType == 1)
3924 break;
3925 }
3926
3927 return node;
3928 },
3929
3930 first_tag: function (element, tag) {
3931 var node;
3932
3933 if (!this.is_xhtml)
3934 tag = tag.toUpperCase();
3935
3936 for (node = element.firstChild; node; node = node.nextSibling)
3937 {
3938 if (node.nodeType == 1 && node.nodeName == tag)
3939 break;
3940 }
3941
3942 return node;
3943 },
3944
3945 hide_selection: function () {
3946 if (window.getSelection) // Firefox, Chromium, Safari, Opera
3947 {
3948 var selection = window.getSelection();
3949
3950 if (selection.rangeCount > 0)
3951 {
3952 var range = selection.getRangeAt(0);
3953 range.collapse (false);
3954 }
3955 }
3956 else // Internet Explorer
3957 {
3958 var textRange = document.selection.createRange ();
3959 textRange.collapse (false);
3960 }
3961 },
3962
3963 get_selected_text: function () {
3964 try
3965 {
3966 if (window.getSelection)
3967 return window.getSelection().toString();
3968
3969 if (document.getSelection)
3970 return document.getSelection().toString();
3971
3972 if (document.selection)
3973 return document.selection.createRange().text;
3974 }
3975 catch (e)
3976 {
3977 }
3978
3979 return "";
3980 },
3981
3982 // make note of length of selected text
3983 // as this evaluates to zero in click event
3984 mouse_button_up: function (e) {
3985 w3c_slidy.selected_text_len = w3c_slidy.get_selected_text().length;
3986 },
3987
3988 // right mouse button click is reserved for context menus
3989 // it is more reliable to detect rightclick than leftclick
3990 mouse_button_click: function (e) {
3991 var rightclick = false;
3992 var leftclick = false;
3993 var middleclick = false;
3994 var target;
3995
3996 if (!e)
3997 var e = window.event;
3998
3999 if (e.target)
4000 target = e.target;
4001 else if (e.srcElement)
4002 target = e.srcElement;
4003
4004 // work around Safari bug
4005 if (target.nodeType == 3)
4006 target = target.parentNode;
4007
4008 if (e.which) // all browsers except IE
4009 {
4010 leftclick = (e.which == 1);
4011 middleclick = (e.which == 2);
4012 rightclick = (e.which == 3);
4013 }
4014 else if (e.button)
4015 {
4016 // Konqueror gives 1 for left, 4 for middle
4017 // IE6 gives 0 for left and not 1 as I expected
4018
4019 if (e.button == 4)
4020 middleclick = true;
4021
4022 // all browsers agree on 2 for right button
4023 rightclick = (e.button == 2);
4024 }
4025 else
4026 leftclick = true;
4027
4028 if (w3c_slidy.selected_text_len > 0)
4029 {
4030 w3c_slidy.stop_propagation(e);
4031 e.cancel = true;
4032 e.returnValue = false;
4033 return false;
4034 }
4035
4036 // dismiss table of contents
4037 w3c_slidy.hide_table_of_contents(false);
4038
4039 // check if target is something that probably want's clicks
4040 // e.g. a, embed, object, input, textarea, select, option
4041 var tag = target.nodeName.toLowerCase();
4042
4043 if (w3c_slidy.mouse_click_enabled && leftclick &&
4044 !w3c_slidy.special_element(target) &&
4045 !target.onclick)
4046 {
4047 w3c_slidy.next_slide(true);
4048 w3c_slidy.stop_propagation(e);
4049 e.cancel = true;
4050 e.returnValue = false;
4051 return false;
4052 }
4053
4054 return true;
4055 },
4056
4057 special_element: function (e) {
4058 var tag = e.nodeName.toLowerCase();
4059
4060 return e.onkeydown ||
4061 e.onclick ||
4062 tag == "a" ||
4063 tag == "embed" ||
4064 tag == "object" ||
4065 tag == "video" ||
4066 tag == "audio" ||
4067 tag == "input" ||
4068 tag == "textarea" ||
4069 tag == "select" ||
4070 tag == "option";
4071 },
4072
4073 slidy_chrome: function (el) {
4074 while (el)
4075 {
4076 if (el == w3c_slidy.toc ||
4077 el == w3c_slidy.toolbar ||
4078 w3c_slidy.has_class(el, "outline"))
4079 return true;
4080
4081 el = el.parentNode;
4082 }
4083
4084 return false;
4085 },
4086
4087 get_key: function (e)
4088 {
4089 var key;
4090
4091 // kludge around NS/IE differences
4092 if (typeof window.event != "undefined")
4093 key = window.event.keyCode;
4094 else if (e.which)
4095 key = e.which;
4096
4097 return key;
4098 },
4099
4100 get_target: function (e) {
4101 var target;
4102
4103 if (!e)
4104 e = window.event;
4105
4106 if (e.target)
4107 target = e.target;
4108 else if (e.srcElement)
4109 target = e.srcElement;
4110
4111 if (target.nodeType != 1)
4112 target = target.parentNode;
4113
4114 return target;
4115 },
4116
4117 // does display property provide correct defaults?
4118 is_block: function (elem) {
4119 var tag = elem.nodeName.toLowerCase();
4120
4121 return tag == "ol" || tag == "ul" || tag == "p" ||
4122 tag == "li" || tag == "table" || tag == "pre" ||
4123 tag == "h1" || tag == "h2" || tag == "h3" ||
4124 tag == "h4" || tag == "h5" || tag == "h6" ||
4125 tag == "blockquote" || tag == "address";
4126 },
4127
4128 add_listener: function (element, event, handler) {
4129 if (window.addEventListener)
4130 element.addEventListener(event, handler, false);
4131 else
4132 element.attachEvent("on"+event, handler);
4133 },
4134
4135 // used to prevent event propagation from field controls
4136 stop_propagation: function (event) {
4137 event = event ? event : window.event;
4138 event.cancelBubble = true; // for IE
4139
4140 if (event.stopPropagation)
4141 event.stopPropagation();
4142