-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlec-haskell-concurrency.html
More file actions
832 lines (763 loc) · 209 KB
/
lec-haskell-concurrency.html
File metadata and controls
832 lines (763 loc) · 209 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<meta name="author" content="Martin Sulzmann" />
<title>Haskell Part 5: Concurrent programming</title>
<style type="text/css">code{white-space: pre;}</style>
<style type="text/css">
div.sourceCode { overflow-x: auto; }
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
margin: 0; padding: 0; vertical-align: baseline; border: none; }
table.sourceCode { width: 100%; line-height: 100%; }
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
td.sourceCode { padding-left: 5px; }
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
code > span.dt { color: #902000; } /* DataType */
code > span.dv { color: #40a070; } /* DecVal */
code > span.bn { color: #40a070; } /* BaseN */
code > span.fl { color: #40a070; } /* Float */
code > span.ch { color: #4070a0; } /* Char */
code > span.st { color: #4070a0; } /* String */
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
code > span.ot { color: #007020; } /* Other */
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
code > span.fu { color: #06287e; } /* Function */
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
code > span.cn { color: #880000; } /* Constant */
code > span.sc { color: #4070a0; } /* SpecialChar */
code > span.vs { color: #4070a0; } /* VerbatimString */
code > span.ss { color: #bb6688; } /* SpecialString */
code > span.im { } /* Import */
code > span.va { color: #19177c; } /* Variable */
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code > span.op { color: #666666; } /* Operator */
code > span.bu { } /* BuiltIn */
code > span.ex { } /* Extension */
code > span.pp { color: #bc7a00; } /* Preprocessor */
code > span.at { color: #7d9029; } /* Attribute */
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
</style>
<link href="data:text/css; charset=utf-8,%2F%2A%20slidy%2Ecss%0A%0A%20%20%20Copyright%20%28c%29%202005%2D2010%20W3C%20%28MIT%2C%20ERCIM%2C%20Keio%29%2C%20All%20Rights%20Reserved%2E%0A%20%20%20W3C%20liability%2C%20trademark%2C%20document%20use%20and%20software%20licensing%0A%20%20%20rules%20apply%2C%20see%3A%0A%0A%20%20%20http%3A%2F%2Fwww%2Ew3%2Eorg%2FConsortium%2FLegal%2Fcopyright%2Ddocuments%0A%20%20%20http%3A%2F%2Fwww%2Ew3%2Eorg%2FConsortium%2FLegal%2Fcopyright%2Dsoftware%0A%2A%2F%0Abody%0A%7B%0A%20%20margin%3A%200%200%200%200%3B%0A%20%20padding%3A%200%200%200%200%3B%0A%20%20width%3A%20100%25%3B%0A%20%20height%3A%20100%25%3B%0A%20%20color%3A%20black%3B%0A%20%20background%2Dcolor%3A%20white%3B%0A%20%20font%2Dfamily%3A%20%22Gill%20Sans%20MT%22%2C%20%22Gill%20Sans%22%2C%20GillSans%2C%20sans%2Dserif%3B%0A%20%20font%2Dsize%3A%2014pt%3B%0A%7D%0A%0Adiv%2Etoolbar%20%7B%0A%20%20position%3A%20fixed%3B%20z%2Dindex%3A%20200%3B%0A%20%20top%3A%20auto%3B%20bottom%3A%200%3B%20left%3A%200%3B%20right%3A%200%3B%0A%20%20height%3A%201%2E2em%3B%20text%2Dalign%3A%20right%3B%0A%20%20padding%2Dleft%3A%201em%3B%0A%20%20padding%2Dright%3A%201em%3B%20%0A%20%20font%2Dsize%3A%2060%25%3B%0A%20%20color%3A%20red%3B%0A%20%20background%2Dcolor%3A%20rgb%28240%2C240%2C240%29%3B%0A%20%20border%2Dtop%3A%20solid%201px%20rgb%28180%2C180%2C180%29%3B%0A%7D%0A%0Adiv%2Etoolbar%20span%2Ecopyright%20%7B%0A%20%20color%3A%20black%3B%0A%20%20margin%2Dleft%3A%200%2E5em%3B%0A%7D%0A%0Adiv%2Einitial%5Fprompt%20%7B%0A%20%20position%3A%20absolute%3B%0A%20%20z%2Dindex%3A%201000%3B%0A%20%20bottom%3A%201%2E2em%3B%0A%20%20width%3A%20100%25%3B%0A%20%20background%2Dcolor%3A%20rgb%28200%2C200%2C200%29%3B%0A%20%20opacity%3A%200%2E35%3B%0A%20%20background%2Dcolor%3A%20rgba%28200%2C200%2C200%2C%200%2E35%29%3B%0A%20%20cursor%3A%20pointer%3B%0A%7D%0A%0Adiv%2Einitial%5Fprompt%20p%2Ehelp%20%7B%0A%20%20text%2Dalign%3A%20center%3B%0A%7D%0A%0Adiv%2Einitial%5Fprompt%20p%2Eclose%20%7B%0A%20%20text%2Dalign%3A%20right%3B%0A%20%20font%2Dstyle%3A%20italic%3B%0A%7D%0A%0Adiv%2Eslidy%5Ftoc%20%7B%0A%20%20position%3A%20absolute%3B%0A%20%20z%2Dindex%3A%20300%3B%0A%20%20width%3A%2060%25%3B%0A%20%20max%2Dwidth%3A%2030em%3B%0A%20%20height%3A%2030em%3B%0A%20%20overflow%3A%20auto%3B%0A%20%20top%3A%20auto%3B%0A%20%20right%3A%20auto%3B%0A%20%20left%3A%204em%3B%0A%20%20bottom%3A%204em%3B%0A%20%20padding%3A%201em%3B%0A%20%20background%3A%20rgb%28240%2C240%2C240%29%3B%0A%20%20border%2Dstyle%3A%20solid%3B%0A%20%20border%2Dwidth%3A%202px%3B%0A%20%20font%2Dsize%3A%2060%25%3B%0A%7D%0A%0Adiv%2Eslidy%5Ftoc%20%2Etoc%5Fheading%20%7B%0A%20%20text%2Dalign%3A%20center%3B%0A%20%20width%3A%20100%25%3B%0A%20%20margin%3A%200%3B%0A%20%20margin%2Dbottom%3A%201em%3B%0A%20%20border%2Dbottom%2Dstyle%3A%20solid%3B%0A%20%20border%2Dbottom%2Dcolor%3A%20rgb%28180%2C180%2C180%29%3B%0A%20%20border%2Dbottom%2Dwidth%3A%201px%3B%0A%7D%0A%0Adiv%2Eslide%20%7B%0A%20%20z%2Dindex%3A%2020%3B%0A%20%20margin%3A%200%200%200%200%3B%0A%20%20padding%2Dtop%3A%200%3B%0A%20%20padding%2Dbottom%3A%200%3B%0A%20%20padding%2Dleft%3A%2020px%3B%0A%20%20padding%2Dright%3A%2020px%3B%0A%20%20border%2Dwidth%3A%200%3B%0A%20%20clear%3A%20both%3B%0A%20%20top%3A%200%3B%0A%20%20bottom%3A%200%3B%0A%20%20left%3A%200%3B%0A%20%20right%3A%200%3B%0A%20%20line%2Dheight%3A%20120%25%3B%0A%20%20background%2Dcolor%3A%20transparent%3B%0A%7D%0A%0Adiv%2Ebackground%20%7B%0A%20%20display%3A%20none%3B%0A%7D%0A%0Adiv%2Ehandout%20%7B%0A%20%20margin%2Dleft%3A%2020px%3B%0A%20%20margin%2Dright%3A%2020px%3B%0A%7D%0A%0Adiv%2Eslide%2Etitlepage%20%7B%0A%20%20text%2Dalign%3A%20center%3B%0A%7D%0A%0Adiv%2Eslide%2Etitlepage%20h1%20%7B%0A%20%20padding%2Dtop%3A%2010%25%3B%0A%20%20margin%2Dright%3A%200%3B%0A%7D%0A%0Adiv%2Eslide%20h1%20%7B%0A%20%20padding%2Dleft%3A%200%3B%0A%20%20padding%2Dright%3A%2020pt%3B%0A%20%20padding%2Dtop%3A%204pt%3B%0A%20%20padding%2Dbottom%3A%204pt%3B%0A%20%20margin%2Dtop%3A%200%3B%0A%20%20margin%2Dleft%3A%200%3B%0A%20%20margin%2Dright%3A%2060pt%3B%0A%20%20margin%2Dbottom%3A%200%2E5em%3B%0A%20%20display%3A%20block%3B%20%0A%20%20font%2Dsize%3A%20160%25%3B%0A%20%20line%2Dheight%3A%201%2E2em%3B%0A%20%20background%3A%20transparent%3B%0A%7D%0A%0A%40media%20screen%20and%20%28max%2Ddevice%2Dwidth%3A%201024px%29%0A%7B%0A%20%20div%2Eslide%20%7B%20font%2Dsize%3A%20100%25%3B%20%7D%0A%7D%0A%0A%40media%20screen%20and%20%28max%2Ddevice%2Dwidth%3A%20800px%29%0A%7B%0A%20%20div%2Eslide%20%7B%20font%2Dsize%3A%20200%25%3B%20%7D%0A%20%20div%2Eslidy%5Ftoc%20%7B%0A%20%20%20%20top%3A%201em%3B%0A%20%20%20%20left%3A%201em%3B%0A%20%20%20%20right%3A%20auto%3B%0A%20%20%20%20width%3A%2080%25%3B%0A%20%20%20%20font%2Dsize%3A%20180%25%3B%0A%20%20%7D%0A%7D%0A%0Adiv%2Etoc%2Dheading%20%7B%0A%20%20width%3A%20100%25%3B%0A%20%20border%2Dbottom%3A%20solid%201px%20rgb%28180%2C180%2C180%29%3B%0A%20%20margin%2Dbottom%3A%201em%3B%0A%20%20text%2Dalign%3A%20center%3B%0A%7D%0A%0Aimg%20%7B%0A%20%20image%2Drendering%3A%20optimize%2Dquality%3B%0A%7D%0A%0Apre%20%7B%0A%20font%2Dsize%3A%2080%25%3B%0A%20font%2Dweight%3A%20bold%3B%0A%20line%2Dheight%3A%20120%25%3B%0A%20padding%2Dtop%3A%200%2E2em%3B%0A%20padding%2Dbottom%3A%200%2E2em%3B%0A%20padding%2Dleft%3A%201em%3B%0A%20padding%2Dright%3A%201em%3B%0A%20border%2Dstyle%3A%20solid%3B%0A%20border%2Dleft%2Dwidth%3A%201em%3B%0A%20border%2Dtop%2Dwidth%3A%20thin%3B%0A%20border%2Dright%2Dwidth%3A%20thin%3B%0A%20border%2Dbottom%2Dwidth%3A%20thin%3B%0A%20border%2Dcolor%3A%20%2395ABD0%3B%0A%20color%3A%20%2300428C%3B%0A%20background%2Dcolor%3A%20%23E4E5E7%3B%0A%7D%0A%0Ali%20pre%20%7B%20margin%2Dleft%3A%200%3B%20%7D%0A%0Ablockquote%20%7B%20font%2Dstyle%3A%20italic%20%7D%0A%0Aimg%20%7B%20background%2Dcolor%3A%20transparent%20%7D%0A%0Ap%2Ecopyright%20%7B%20font%2Dsize%3A%20smaller%20%7D%0A%0A%2Ecenter%20%7B%20text%2Dalign%3A%20center%20%7D%0A%2Efootnote%20%7B%20font%2Dsize%3A%20smaller%3B%20margin%2Dleft%3A%202em%3B%20%7D%0A%0Aa%20img%20%7B%20border%2Dwidth%3A%200%3B%20border%2Dstyle%3A%20none%20%7D%0A%0Aa%3Avisited%20%7B%20color%3A%20navy%20%7D%0Aa%3Alink%20%7B%20color%3A%20navy%20%7D%0Aa%3Ahover%20%7B%20color%3A%20red%3B%20text%2Ddecoration%3A%20underline%20%7D%0Aa%3Aactive%20%7B%20color%3A%20red%3B%20text%2Ddecoration%3A%20underline%20%7D%0A%0Aa%20%7Btext%2Ddecoration%3A%20none%7D%0A%2Etoolbar%20a%3Alink%20%7Bcolor%3A%20blue%7D%0A%2Etoolbar%20a%3Avisited%20%7Bcolor%3A%20blue%7D%0A%2Etoolbar%20a%3Aactive%20%7Bcolor%3A%20red%7D%0A%2Etoolbar%20a%3Ahover%20%7Bcolor%3A%20red%7D%0A%0Aul%20%7B%20list%2Dstyle%2Dtype%3A%20square%3B%20%7D%0Aul%20ul%20%7B%20list%2Dstyle%2Dtype%3A%20disc%3B%20%7D%0Aul%20ul%20ul%20%7B%20list%2Dstyle%2Dtype%3A%20circle%3B%20%7D%0Aul%20ul%20ul%20ul%20%7B%20list%2Dstyle%2Dtype%3A%20disc%3B%20%7D%0Ali%20%7B%20margin%2Dleft%3A%200%2E5em%3B%20margin%2Dtop%3A%200%2E5em%3B%20%7D%0Ali%20li%20%7B%20font%2Dsize%3A%2085%25%3B%20font%2Dstyle%3A%20italic%20%7D%0Ali%20li%20li%20%7B%20font%2Dsize%3A%2085%25%3B%20font%2Dstyle%3A%20normal%20%7D%0A%0Adiv%20dt%0A%7B%0A%20%20margin%2Dleft%3A%200%3B%0A%20%20margin%2Dtop%3A%201em%3B%0A%20%20margin%2Dbottom%3A%200%2E5em%3B%0A%20%20font%2Dweight%3A%20bold%3B%0A%7D%0Adiv%20dd%0A%7B%0A%20%20margin%2Dleft%3A%202em%3B%0A%20%20margin%2Dbottom%3A%200%2E5em%3B%0A%7D%0A%0A%0Ap%2Cpre%2Cul%2Col%2Cblockquote%2Ch2%2Ch3%2Ch4%2Ch5%2Ch6%2Cdl%2Ctable%20%7B%0A%20%20margin%2Dleft%3A%201em%3B%0A%20%20margin%2Dright%3A%201em%3B%0A%7D%0A%0Ap%2Esubhead%20%7B%20font%2Dweight%3A%20bold%3B%20margin%2Dtop%3A%202em%3B%20%7D%0A%0A%2Esmaller%20%7B%20font%2Dsize%3A%20smaller%20%7D%0A%2Ebigger%20%7B%20font%2Dsize%3A%20130%25%20%7D%0A%0Atd%2Cth%20%7B%20padding%3A%200%2E2em%20%7D%0A%0Aul%20%7B%0A%20%20margin%3A%200%2E5em%201%2E5em%200%2E5em%201%2E5em%3B%0A%20%20padding%3A%200%3B%0A%7D%0A%0Aol%20%7B%0A%20%20margin%3A%200%2E5em%201%2E5em%200%2E5em%201%2E5em%3B%0A%20%20padding%3A%200%3B%0A%7D%0A%0Aul%20%7B%20list%2Dstyle%2Dtype%3A%20square%3B%20%7D%0Aul%20ul%20%7B%20list%2Dstyle%2Dtype%3A%20disc%3B%20%7D%0Aul%20ul%20ul%20%7B%20list%2Dstyle%2Dtype%3A%20circle%3B%20%7D%0Aul%20ul%20ul%20ul%20%7B%20list%2Dstyle%2Dtype%3A%20disc%3B%20%7D%0A%0Aul%20li%20%7B%20%0A%20%20list%2Dstyle%3A%20square%3B%0A%20%20margin%3A%200%2E1em%200em%200%2E6em%200%3B%0A%20%20padding%3A%200%200%200%200%3B%0A%20%20line%2Dheight%3A%20140%25%3B%0A%7D%0A%0Aol%20li%20%7B%20%0A%20%20margin%3A%200%2E1em%200em%200%2E6em%201%2E5em%3B%0A%20%20padding%3A%200%200%200%200px%3B%0A%20%20line%2Dheight%3A%20140%25%3B%0A%20%20list%2Dstyle%2Dtype%3A%20decimal%3B%0A%7D%0A%0Ali%20ul%20li%20%7B%20%0A%20%20font%2Dsize%3A%2085%25%3B%20%0A%20%20font%2Dstyle%3A%20italic%3B%0A%20%20list%2Dstyle%2Dtype%3A%20disc%3B%0A%20%20background%3A%20transparent%3B%0A%20%20padding%3A%200%200%200%200%3B%0A%7D%0Ali%20li%20ul%20li%20%7B%20%0A%20%20font%2Dsize%3A%2085%25%3B%20%0A%20%20font%2Dstyle%3A%20normal%3B%0A%20%20list%2Dstyle%2Dtype%3A%20circle%3B%0A%20%20background%3A%20transparent%3B%0A%20%20padding%3A%200%200%200%200%3B%0A%7D%0Ali%20li%20li%20ul%20li%20%7B%0A%20%20list%2Dstyle%2Dtype%3A%20disc%3B%0A%20%20background%3A%20transparent%3B%0A%20%20padding%3A%200%200%200%200%3B%0A%7D%0A%0Ali%20ol%20li%20%7B%0A%20%20list%2Dstyle%2Dtype%3A%20decimal%3B%0A%7D%0A%0A%0Ali%20li%20ol%20li%20%7B%0A%20%20list%2Dstyle%2Dtype%3A%20decimal%3B%0A%7D%0A%0A%2F%2A%0A%20setting%20class%3D%22outline%20on%20ol%20or%20ul%20makes%20it%20behave%20as%20an%0A%20ouline%20list%20where%20blocklevel%20content%20in%20li%20elements%20is%0A%20hidden%20by%20default%20and%20can%20be%20expanded%20or%20collapsed%20with%0A%20mouse%20click%2E%20Set%20class%3D%22expand%22%20on%20li%20to%20override%20default%0A%2A%2F%0A%0Aol%2Eoutline%20li%3Ahover%20%7B%20cursor%3A%20pointer%20%7D%0Aol%2Eoutline%20li%2Enofold%3Ahover%20%7B%20cursor%3A%20default%20%7D%0A%0Aul%2Eoutline%20li%3Ahover%20%7B%20cursor%3A%20pointer%20%7D%0Aul%2Eoutline%20li%2Enofold%3Ahover%20%7B%20cursor%3A%20default%20%7D%0A%0Aol%2Eoutline%20%7B%20list%2Dstyle%3Adecimal%3B%20%7D%0Aol%2Eoutline%20ol%20%7B%20list%2Dstyle%2Dtype%3Alower%2Dalpha%20%7D%0A%0Aol%2Eoutline%20li%2Enofold%20%7B%0A%20%20padding%3A%200%200%200%2020px%3B%0A%20%20background%3A%20transparent%20url%28%2E%2E%2Fgraphics%2Fnofold%2Ddim%2Egif%29%20no%2Drepeat%200px%200%2E5em%3B%0A%7D%0Aol%2Eoutline%20li%2Eunfolded%20%7B%0A%20%20padding%3A%200%200%200%2020px%3B%0A%20%20background%3A%20transparent%20url%28%2E%2E%2Fgraphics%2Ffold%2Ddim%2Egif%29%20no%2Drepeat%200px%200%2E5em%3B%0A%7D%0Aol%2Eoutline%20li%2Efolded%20%7B%0A%20%20padding%3A%200%200%200%2020px%3B%0A%20%20background%3A%20transparent%20url%28%2E%2E%2Fgraphics%2Funfold%2Ddim%2Egif%29%20no%2Drepeat%200px%200%2E5em%3B%0A%7D%0Aol%2Eoutline%20li%2Eunfolded%3Ahover%20%7B%0A%20%20padding%3A%200%200%200%2020px%3B%0A%20%20background%3A%20transparent%20url%28%2E%2E%2Fgraphics%2Ffold%2Egif%29%20no%2Drepeat%200px%200%2E5em%3B%0A%7D%0Aol%2Eoutline%20li%2Efolded%3Ahover%20%7B%0A%20%20padding%3A%200%200%200%2020px%3B%0A%20%20background%3A%20transparent%20url%28%2E%2E%2Fgraphics%2Funfold%2Egif%29%20no%2Drepeat%200px%200%2E5em%3B%0A%7D%0A%0Aul%2Eoutline%20li%2Enofold%20%7B%0A%20%20padding%3A%200%200%200%2020px%3B%0A%20%20background%3A%20transparent%20url%28%2E%2E%2Fgraphics%2Fnofold%2Ddim%2Egif%29%20no%2Drepeat%200px%200%2E5em%3B%0A%7D%0Aul%2Eoutline%20li%2Eunfolded%20%7B%0A%20%20padding%3A%200%200%200%2020px%3B%0A%20%20background%3A%20transparent%20url%28%2E%2E%2Fgraphics%2Ffold%2Ddim%2Egif%29%20no%2Drepeat%200px%200%2E5em%3B%0A%7D%0Aul%2Eoutline%20li%2Efolded%20%7B%0A%20%20padding%3A%200%200%200%2020px%3B%0A%20%20background%3A%20transparent%20url%28%2E%2E%2Fgraphics%2Funfold%2Ddim%2Egif%29%20no%2Drepeat%200px%200%2E5em%3B%0A%7D%0Aul%2Eoutline%20li%2Eunfolded%3Ahover%20%7B%0A%20%20padding%3A%200%200%200%2020px%3B%0A%20%20background%3A%20transparent%20url%28%2E%2E%2Fgraphics%2Ffold%2Egif%29%20no%2Drepeat%200px%200%2E5em%3B%0A%7D%0Aul%2Eoutline%20li%2Efolded%3Ahover%20%7B%0A%20%20padding%3A%200%200%200%2020px%3B%0A%20%20background%3A%20transparent%20url%28%2E%2E%2Fgraphics%2Funfold%2Egif%29%20no%2Drepeat%200px%200%2E5em%3B%0A%7D%0A%0A%2F%2A%20for%20slides%20with%20class%20%22title%22%20in%20table%20of%20contents%20%2A%2F%0Aa%2Etitleslide%20%7B%20font%2Dweight%3A%20bold%3B%20font%2Dstyle%3A%20italic%20%7D%0A%0A%2F%2A%0A%20hide%20images%20for%20work%20around%20for%20save%20as%20bug%0A%20where%20browsers%20fail%20to%20save%20images%20used%20by%20CSS%0A%2A%2F%0Aimg%2Ehidden%20%7B%20display%3A%20none%3B%20visibility%3A%20hidden%20%7D%0Adiv%2Einitial%5Fprompt%20%7B%20display%3A%20none%3B%20visibility%3A%20hidden%20%7D%0A%0A%20%20div%2Eslide%20%7B%0A%20%20%20%20%20visibility%3A%20visible%3B%0A%20%20%20%20%20position%3A%20inherit%3B%0A%20%20%7D%0A%20%20div%2Ehandout%20%7B%0A%20%20%20%20%20border%2Dtop%2Dstyle%3A%20solid%3B%0A%20%20%20%20%20border%2Dtop%2Dwidth%3A%20thin%3B%0A%20%20%20%20%20border%2Dtop%2Dcolor%3A%20black%3B%0A%20%20%7D%0A%0A%40media%20screen%20%7B%0A%20%20%2Ehidden%20%7B%20display%3A%20none%3B%20visibility%3A%20visible%20%7D%0A%0A%20%20div%2Eslide%2Ehidden%20%7B%20display%3A%20block%3B%20visibility%3A%20visible%20%7D%0A%20%20div%2Ehandout%2Ehidden%20%7B%20display%3A%20block%3B%20visibility%3A%20visible%20%7D%0A%20%20div%2Ebackground%20%7B%20display%3A%20none%3B%20visibility%3A%20hidden%20%7D%0A%20%20body%2Esingle%5Fslide%20div%2Einitial%5Fprompt%20%7B%20display%3A%20block%3B%20visibility%3A%20visible%20%7D%0A%20%20body%2Esingle%5Fslide%20div%2Ebackground%20%7B%20display%3A%20block%3B%20visibility%3A%20visible%20%7D%0A%20%20body%2Esingle%5Fslide%20div%2Ebackground%2Ehidden%20%7B%20display%3A%20none%3B%20visibility%3A%20hidden%20%7D%0A%20%20body%2Esingle%5Fslide%20%2Einvisible%20%7B%20visibility%3A%20hidden%20%7D%0A%20%20body%2Esingle%5Fslide%20%2Ehidden%20%7B%20display%3A%20none%3B%20visibility%3A%20hidden%20%7D%0A%20%20body%2Esingle%5Fslide%20div%2Eslide%20%7B%20position%3A%20absolute%20%7D%0A%20%20body%2Esingle%5Fslide%20div%2Ehandout%20%7B%20display%3A%20none%3B%20visibility%3A%20hidden%20%7D%0A%7D%0A%0A%40media%20print%20%7B%0A%20%20%2Ehidden%20%7B%20display%3A%20block%3B%20visibility%3A%20visible%20%7D%0A%0A%20%20div%2Eslide%20pre%20%7B%20font%2Dsize%3A%2060%25%3B%20padding%2Dleft%3A%200%2E5em%3B%20%7D%0A%20%20div%2Etoolbar%20%7B%20display%3A%20none%3B%20visibility%3A%20hidden%3B%20%7D%0A%20%20div%2Eslidy%5Ftoc%20%7B%20display%3A%20none%3B%20visibility%3A%20hidden%3B%20%7D%0A%20%20div%2Ebackground%20%7B%20display%3A%20none%3B%20visibility%3A%20hidden%3B%20%7D%0A%20%20div%2Eslide%20%7B%20page%2Dbreak%2Dbefore%3A%20always%20%7D%0A%20%20%2F%2A%20%3Afirst%2Dchild%20isn%27t%20reliable%20for%20print%20media%20%2A%2F%0A%20%20div%2Eslide%2Efirst%2Dslide%20%7B%20page%2Dbreak%2Dbefore%3A%20avoid%20%7D%0A%7D%0A%0A" rel="stylesheet" type="text/css" media="screen, projection, print" />
<script type="text/javascript">/*<![CDATA[*/
/*
March 19, 2004 MathHTML (c) Peter Jipsen http://www.chapman.edu/~jipsen
Released under the GNU General Public License version 2 or later.
See the GNU General Public License (at http://www.gnu.org/copyleft/gpl.html)
for more details.
*/
function convertMath(node) {// for Gecko
if (node.nodeType==1) {
var newnode =
document.createElementNS("http://www.w3.org/1998/Math/MathML",
node.nodeName.toLowerCase());
for(var i=0; i < node.attributes.length; i++)
newnode.setAttribute(node.attributes[i].nodeName,
node.attributes[i].value);
for (var i=0; i<node.childNodes.length; i++) {
var st = node.childNodes[i].nodeValue;
if (st==null || st.slice(0,1)!=" " && st.slice(0,1)!="\n")
newnode.appendChild(convertMath(node.childNodes[i]));
}
return newnode;
}
else return node;
}
function convert() {
var mmlnode = document.getElementsByTagName("math");
var st,str,node,newnode;
for (var i=0; i<mmlnode.length; i++)
if (document.createElementNS!=null)
mmlnode[i].parentNode.replaceChild(convertMath(mmlnode[i]),mmlnode[i]);
else { // convert for IE
str = "";
node = mmlnode[i];
while (node.nodeName!="/MATH") {
st = node.nodeName.toLowerCase();
if (st=="#text") str += node.nodeValue;
else {
str += (st.slice(0,1)=="/" ? "</m:"+st.slice(1) : "<m:"+st);
if (st.slice(0,1)!="/")
for(var j=0; j < node.attributes.length; j++)
if (node.attributes[j].value!="italic" &&
node.attributes[j].value!="" &&
node.attributes[j].value!="inherit" &&
node.attributes[j].value!=undefined)
str += " "+node.attributes[j].nodeName+"="+
"\""+node.attributes[j].value+"\"";
str += ">";
}
node = node.nextSibling;
node.parentNode.removeChild(node.previousSibling);
}
str += "</m:math>";
newnode = document.createElement("span");
node.parentNode.replaceChild(newnode,node);
newnode.innerHTML = str;
}
}
if (document.createElementNS==null) {
document.write("<object id=\"mathplayer\"\
classid=\"clsid:32F66A20-7614-11D4-BD11-00104BD3F987\"></object>");
document.write("<?import namespace=\"m\" implementation=\"#mathplayer\"?>");
}
if(typeof window.addEventListener != 'undefined'){
window.addEventListener('load', convert, false);
}
if(typeof window.attachEvent != 'undefined') {
window.attachEvent('onload', convert);
}
/*]]>*/
</script>
<script src="data:text/javascript; charset=utf-8,%2F%2A%20slidy%2Ejs%0A%0A%20%20%20Copyright%20%28c%29%202005%2D2013%20W3C%20%28MIT%2C%20ERCIM%2C%20Keio%29%2C%20All%20Rights%20Reserved%2E%0A%20%20%20W3C%20liability%2C%20trademark%2C%20document%20use%20and%20software%20licensing%0A%20%20%20rules%20apply%2C%20see%3A%0A%0A%20%20%20http%3A%2F%2Fwww%2Ew3%2Eorg%2FConsortium%2FLegal%2Fcopyright%2Ddocuments%0A%20%20%20http%3A%2F%2Fwww%2Ew3%2Eorg%2FConsortium%2FLegal%2Fcopyright%2Dsoftware%0A%0A%20%20%20Defines%20single%20name%20%22w3c%5Fslidy%22%20in%20global%20namespace%0A%20%20%20Adds%20event%20handlers%20without%20trampling%20on%20any%20others%0A%2A%2F%0A%0A%2F%2F%20the%20slidy%20object%20implementation%0Avar%20w3c%5Fslidy%20%3D%20%7B%0A%20%20%2F%2F%20classify%20which%20kind%20of%20browser%20we%27re%20running%20under%0A%20%20ns%5Fpos%3A%20%28typeof%20window%2EpageYOffset%21%3D%27undefined%27%29%2C%0A%20%20khtml%3A%20%28%28navigator%2EuserAgent%29%2EindexOf%28%22KHTML%22%29%20%3E%3D%200%20%3F%20true%20%3A%20false%29%2C%0A%20%20opera%3A%20%28%28navigator%2EuserAgent%29%2EindexOf%28%22Opera%22%29%20%3E%3D%200%20%3F%20true%20%3A%20false%29%2C%0A%20%20ipad%3A%20%28%28navigator%2EuserAgent%29%2EindexOf%28%22iPad%22%29%20%3E%3D%200%20%3F%20true%20%3A%20false%29%2C%0A%20%20iphone%3A%20%28%28navigator%2EuserAgent%29%2EindexOf%28%22iPhone%22%29%20%3E%3D%200%20%3F%20true%20%3A%20false%29%2C%0A%20%20android%3A%20%28%28navigator%2EuserAgent%29%2EindexOf%28%22Android%22%29%20%3E%3D%200%20%3F%20true%20%3A%20false%29%2C%0A%20%20ie%3A%20%28typeof%20document%2Eall%20%21%3D%20%22undefined%22%20%26%26%20%21this%2Eopera%29%2C%0A%20%20ie6%3A%20%28%21this%2Ens%5Fpos%20%26%26%20navigator%2EuserAgent%2EindexOf%28%22MSIE%206%22%29%20%21%3D%20%2D1%29%2C%0A%20%20ie7%3A%20%28%21this%2Ens%5Fpos%20%26%26%20navigator%2EuserAgent%2EindexOf%28%22MSIE%207%22%29%20%21%3D%20%2D1%29%2C%0A%20%20ie8%3A%20%28%21this%2Ens%5Fpos%20%26%26%20navigator%2EuserAgent%2EindexOf%28%22MSIE%208%22%29%20%21%3D%20%2D1%29%2C%0A%20%20ie9%3A%20%28%21this%2Ens%5Fpos%20%26%26%20navigator%2EuserAgent%2EindexOf%28%22MSIE%209%22%29%20%21%3D%20%2D1%29%2C%0A%0A%20%20%2F%2F%20data%20for%20swipe%20and%20double%20tap%20detection%20on%20touch%20screens%0A%20%20last%5Ftap%3A%200%2C%0A%20%20prev%5Ftap%3A%200%2C%0A%20%20start%5Fx%3A%200%2C%0A%20%20start%5Fy%3A%200%2C%0A%20%20delta%5Fx%3A%200%2C%0A%20%20delta%5Fy%3A%200%2C%0A%0A%20%20%2F%2F%20are%20we%20running%20as%20XHTML%3F%20%28doesn%27t%20work%20on%20Opera%29%0A%20%20is%5Fxhtml%3A%20%2Fxml%2F%2Etest%28document%2EcontentType%29%2C%0A%0A%20%20slide%5Fnumber%3A%200%2C%20%2F%2F%20integer%20slide%20count%3A%200%2C%201%2C%202%2C%20%2E%2E%2E%0A%20%20slide%5Fnumber%5Felement%3A%20null%2C%20%2F%2F%20element%20containing%20slide%20number%0A%20%20slides%3A%20%5B%5D%2C%20%2F%2F%20set%20to%20array%20of%20slide%20div%27s%0A%20%20notes%3A%20%5B%5D%2C%20%2F%2F%20set%20to%20array%20of%20handout%20div%27s%0A%20%20backgrounds%3A%20%5B%5D%2C%20%2F%2F%20set%20to%20array%20of%20background%20div%27s%0A%20%20observers%3A%20%5B%5D%2C%20%2F%2F%20list%20of%20observer%20functions%0A%20%20toolbar%3A%20null%2C%20%2F%2F%20element%20containing%20toolbar%0A%20%20title%3A%20null%2C%20%2F%2F%20document%20title%0A%20%20last%5Fshown%3A%20null%2C%20%2F%2F%20last%20incrementally%20shown%20item%0A%20%20eos%3A%20null%2C%20%20%2F%2F%20span%20element%20for%20end%20of%20slide%20indicator%0A%20%20toc%3A%20null%2C%20%2F%2F%20table%20of%20contents%0A%20%20outline%3A%20null%2C%20%2F%2F%20outline%20element%20with%20the%20focus%0A%20%20selected%5Ftext%5Flen%3A%200%2C%20%2F%2F%20length%20of%20drag%20selection%20on%20document%0A%20%20view%5Fall%3A%200%2C%20%20%2F%2F%201%20to%20view%20all%20slides%20%2B%20handouts%0A%20%20want%5Ftoolbar%3A%20true%2C%20%20%2F%2F%20user%20preference%20to%20show%2Fhide%20toolbar%0A%20%20mouse%5Fclick%5Fenabled%3A%20true%2C%20%2F%2F%20enables%20left%20click%20for%20next%20slide%0A%20%20scroll%5Fhack%3A%200%2C%20%2F%2F%20IE%20work%20around%20for%20position%3A%20fixed%0A%20%20disable%5Fslide%5Fclick%3A%20false%2C%20%20%2F%2F%20used%20by%20clicked%20anchors%0A%0A%20%20lang%3A%20%22en%22%2C%20%2F%2F%20updated%20to%20language%20specified%20by%20html%20file%0A%0A%20%20help%5Fanchor%3A%20null%2C%20%2F%2F%20used%20for%20keyboard%20focus%20hack%20in%20showToolbar%28%29%0A%20%20help%5Fpage%3A%20%22http%3A%2F%2Fwww%2Ew3%2Eorg%2FTalks%2FTools%2FSlidy2%2Fhelp%2Fhelp%2Ehtml%22%2C%0A%20%20help%5Ftext%3A%20%22Navigate%20with%20mouse%20click%2C%20space%20bar%2C%20Cursor%20Left%2FRight%2C%20%22%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%22or%20Pg%20Up%20and%20Pg%20Dn%2E%20Use%20S%20and%20B%20to%20change%20font%20size%2E%22%2C%0A%0A%20%20size%5Findex%3A%200%2C%0A%20%20size%5Fadjustment%3A%200%2C%0A%20%20sizes%3A%20%20new%20Array%28%2210pt%22%2C%20%2212pt%22%2C%20%2214pt%22%2C%20%2216pt%22%2C%20%2218pt%22%2C%20%2220pt%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2222pt%22%2C%20%2224pt%22%2C%20%2226pt%22%2C%20%2228pt%22%2C%20%2230pt%22%2C%20%2232pt%22%29%2C%0A%0A%20%20%2F%2F%20needed%20for%20efficient%20resizing%0A%20%20last%5Fwidth%3A%200%2C%0A%20%20last%5Fheight%3A%200%2C%0A%0A%0A%20%20%2F%2F%20Needed%20for%20cross%20browser%20support%20for%20relative%20width%2Fheight%20on%0A%20%20%2F%2F%20object%20elements%2E%20The%20work%20around%20is%20to%20save%20width%2Fheight%20attributes%0A%20%20%2F%2F%20and%20then%20to%20recompute%20absolute%20width%2Fheight%20dimensions%20on%20resizing%0A%20%20%20objects%3A%20%5B%5D%2C%0A%0A%20%20%2F%2F%20attach%20initialiation%20event%20handlers%0A%20%20set%5Fup%3A%20function%20%28%29%20%7B%0A%20%20%20%20var%20init%20%3D%20function%28%29%20%7B%20w3c%5Fslidy%2Einit%28%29%3B%20%7D%3B%0A%20%20%20%20if%20%28typeof%20window%2EaddEventListener%20%21%3D%20%22undefined%22%29%0A%20%20%20%20%20%20window%2EaddEventListener%28%22load%22%2C%20init%2C%20false%29%3B%0A%20%20%20%20else%0A%20%20%20%20%20%20window%2EattachEvent%28%22onload%22%2C%20init%29%3B%0A%20%20%7D%2C%0A%0A%20%20hide%5Fslides%3A%20function%20%28%29%20%7B%0A%20%20%20%20if%20%28document%2Ebody%20%26%26%20%21w3c%5Fslidy%2Einitialized%29%0A%20%20%20%20%20%20document%2Ebody%2Estyle%2Evisibility%20%3D%20%22hidden%22%3B%0A%20%20%20%20else%0A%20%20%20%20%20%20setTimeout%28w3c%5Fslidy%2Ehide%5Fslides%2C%2050%29%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20hack%20to%20persuade%20IE%20to%20compute%20correct%20document%20height%0A%20%20%2F%2F%20as%20needed%20for%20simulating%20fixed%20positioning%20of%20toolbar%0A%20%20ie%5Fhack%3A%20function%20%28%29%20%7B%0A%20%20%20%20window%2EresizeBy%280%2C%2D1%29%3B%0A%20%20%20%20window%2EresizeBy%280%2C%201%29%3B%0A%20%20%7D%2C%0A%0A%20%20init%3A%20function%20%28%29%20%7B%0A%20%20%20%20%2F%2Falert%28%22slidy%20starting%20test%2010%22%29%3B%0A%20%20%20%20document%2Ebody%2Estyle%2Evisibility%20%3D%20%22visible%22%3B%0A%20%20%20%20this%2Einit%5Flocalization%28%29%3B%0A%20%20%20%20this%2Eadd%5Ftoolbar%28%29%3B%0A%20%20%20%20this%2Ewrap%5Fimplicit%5Fslides%28%29%3B%0A%20%20%20%20this%2Ecollect%5Fslides%28%29%3B%0A%20%20%20%20this%2Ecollect%5Fnotes%28%29%3B%0A%20%20%20%20this%2Ecollect%5Fbackgrounds%28%29%3B%0A%20%20%20%20this%2Eobjects%20%3D%20document%2Ebody%2EgetElementsByTagName%28%22object%22%29%3B%0A%20%20%20%20this%2Epatch%5Fanchors%28%29%3B%0A%20%20%20%20this%2Eslide%5Fnumber%20%3D%20this%2Efind%5Fslide%5Fnumber%28location%2Ehref%29%3B%0A%20%20%20%20window%2Eoffscreenbuffering%20%3D%20true%3B%0A%20%20%20%20this%2Esize%5Fadjustment%20%3D%20this%2Efind%5Fsize%5Fadjust%28%29%3B%0A%20%20%20%20this%2Etime%5Fleft%20%3D%20this%2Efind%5Fduration%28%29%3B%0A%20%20%20%20this%2Ehide%5Fimage%5Ftoolbar%28%29%3B%20%20%2F%2F%20suppress%20IE%20image%20toolbar%20popup%0A%20%20%20%20this%2Einit%5Foutliner%28%29%3B%20%20%2F%2F%20activate%20fold%2Funfold%20support%0A%20%20%20%20this%2Etitle%20%3D%20document%2Etitle%3B%0A%20%20%20%20this%2Ekeyboardless%20%3D%20%28this%2Eipad%7C%7Cthis%2Eiphone%7C%7Cthis%2Eandroid%29%3B%0A%0A%20%20%20%20if%20%28this%2Ekeyboardless%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20w3c%5Fslidy%2Eremove%5Fclass%28w3c%5Fslidy%2Etoolbar%2C%20%22hidden%22%29%0A%20%20%20%20%20%20this%2Ewant%5Ftoolbar%20%3D%200%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F%2F%20work%20around%20for%20opera%20bug%0A%20%20%20%20this%2Eis%5Fxhtml%20%3D%20%28document%2Ebody%2EtagName%20%3D%3D%20%22BODY%22%20%3F%20false%20%3A%20true%29%3B%0A%0A%20%20%20%20if%20%28this%2Eslides%2Elength%20%3E%200%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20var%20slide%20%3D%20this%2Eslides%5Bthis%2Eslide%5Fnumber%5D%3B%0A%20%20%20%0A%20%20%20%20%20%20if%20%28this%2Eslide%5Fnumber%20%3E%200%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20this%2Eset%5Fvisibility%5Fall%5Fincremental%28%22visible%22%29%3B%0A%20%20%20%20%20%20%20%20this%2Elast%5Fshown%20%3D%20this%2Eprevious%5Fincremental%5Fitem%28null%29%3B%0A%20%20%20%20%20%20%20%20this%2Eset%5Feos%5Fstatus%28true%29%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20else%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20this%2Elast%5Fshown%20%3D%20null%3B%0A%20%20%20%20%20%20%20%20this%2Eset%5Fvisibility%5Fall%5Fincremental%28%22hidden%22%29%3B%0A%20%20%20%20%20%20%20%20this%2Eset%5Feos%5Fstatus%28%21this%2Enext%5Fincremental%5Fitem%28this%2Elast%5Fshown%29%29%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20this%2Eset%5Flocation%28%29%3B%0A%20%20%20%20%20%20this%2Eadd%5Fclass%28this%2Eslides%5B0%5D%2C%20%22first%2Dslide%22%29%3B%0A%20%20%20%20%20%20w3c%5Fslidy%2Eshow%5Fslide%28slide%29%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20this%2Etoc%20%3D%20this%2Etable%5Fof%5Fcontents%28%29%3B%0A%0A%20%20%20%20this%2Eadd%5Finitial%5Fprompt%28%29%3B%0A%0A%20%20%20%20%2F%2F%20bind%20event%20handlers%20without%20interfering%20with%20custom%20page%20scripts%0A%20%20%20%20%2F%2F%20Tap%20events%20behave%20too%20weirdly%20to%20support%20clicks%20reliably%20on%0A%20%20%20%20%2F%2F%20iPhone%20and%20iPad%2C%20so%20exclude%20these%20from%20click%20handler%0A%0A%20%20%20%20if%20%28%21this%2Ekeyboardless%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20this%2Eadd%5Flistener%28document%2Ebody%2C%20%22click%22%2C%20this%2Emouse%5Fbutton%5Fclick%29%3B%0A%20%20%20%20%20%20this%2Eadd%5Flistener%28document%2Ebody%2C%20%22mousedown%22%2C%20this%2Emouse%5Fbutton%5Fdown%29%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20this%2Eadd%5Flistener%28document%2C%20%22keydown%22%2C%20this%2Ekey%5Fdown%29%3B%0A%20%20%20%20this%2Eadd%5Flistener%28document%2C%20%22keypress%22%2C%20this%2Ekey%5Fpress%29%3B%0A%20%20%20%20this%2Eadd%5Flistener%28window%2C%20%22resize%22%2C%20this%2Eresized%29%3B%0A%20%20%20%20this%2Eadd%5Flistener%28window%2C%20%22scroll%22%2C%20this%2Escrolled%29%3B%0A%20%20%20%20this%2Eadd%5Flistener%28window%2C%20%22unload%22%2C%20this%2Eunloaded%29%3B%0A%0A%20%20%20%20this%2Eadd%5Flistener%28document%2C%20%22gesturechange%22%2C%20function%20%28%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20return%20false%3B%0A%20%20%20%20%7D%29%3B%0A%0A%20%20%20%20this%2Eattach%5Ftouch%5Fhanders%28this%2Eslides%29%3B%0A%0A%20%20%20%20%2F%2F%20this%20seems%20to%20be%20a%20debugging%20hack%0A%20%20%20%20%2F%2Fif%20%28%21document%2Ebody%2Eonclick%29%0A%20%20%20%20%2F%2F%20%20document%2Ebody%2Eonclick%20%3D%20function%20%28%29%20%7B%20%7D%3B%0A%0A%20%20%20%20this%2Esingle%5Fslide%5Fview%28%29%3B%0A%0A%20%20%20%20%2F%2Fthis%2Eset%5Flocation%28%29%3B%0A%0A%20%20%20%20this%2Eresized%28%29%3B%0A%0A%20%20%20%20if%20%28this%2Eie7%29%0A%20%20%20%20%20%20setTimeout%28w3c%5Fslidy%2Eie%5Fhack%2C%20100%29%3B%0A%0A%20%20%20%20this%2Eshow%5Ftoolbar%28%29%3B%0A%0A%20%20%20%20%2F%2F%20for%20back%20button%20detection%0A%20%20%20%20setInterval%28function%20%28%29%20%7B%20w3c%5Fslidy%2Echeck%5Flocation%28%29%3B%20%7D%2C%20200%29%3B%0A%20%20%20%20w3c%5Fslidy%2Einitialized%20%3D%20true%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20create%20div%20element%20with%20links%20to%20each%20slide%0A%20%20table%5Fof%5Fcontents%3A%20function%20%28%29%20%7B%0A%20%20%20%20var%20toc%20%3D%20this%2Ecreate%5Felement%28%22div%22%29%3B%0A%20%20%20%20this%2Eadd%5Fclass%28toc%2C%20%22slidy%5Ftoc%20hidden%22%29%3B%0A%20%20%20%20%2F%2Ftoc%2EsetAttribute%28%22tabindex%22%2C%20%220%22%29%3B%0A%0A%20%20%20%20var%20heading%20%3D%20this%2Ecreate%5Felement%28%22div%22%29%3B%0A%20%20%20%20this%2Eadd%5Fclass%28heading%2C%20%22toc%2Dheading%22%29%3B%0A%20%20%20%20heading%2EinnerHTML%20%3D%20this%2Elocalize%28%22Table%20of%20Contents%22%29%3B%0A%0A%20%20%20%20toc%2EappendChild%28heading%29%3B%0A%20%20%20%20var%20previous%20%3D%20null%3B%0A%0A%20%20%20%20for%20%28var%20i%20%3D%200%3B%20i%20%3C%20this%2Eslides%2Elength%3B%20%2B%2Bi%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20var%20title%20%3D%20this%2Ehas%5Fclass%28this%2Eslides%5Bi%5D%2C%20%22title%22%29%3B%0A%20%20%20%20%20%20var%20num%20%3D%20document%2EcreateTextNode%28%28i%20%2B%201%29%20%2B%20%22%2E%20%22%29%3B%0A%0A%20%20%20%20%20%20toc%2EappendChild%28num%29%3B%0A%0A%20%20%20%20%20%20var%20a%20%3D%20this%2Ecreate%5Felement%28%22a%22%29%3B%0A%20%20%20%20%20%20a%2EsetAttribute%28%22href%22%2C%20%22%23%28%22%20%2B%20%28i%2B1%29%20%2B%20%22%29%22%29%3B%0A%0A%20%20%20%20%20%20if%20%28title%29%0A%20%20%20%20%20%20%20%20this%2Eadd%5Fclass%28a%2C%20%22titleslide%22%29%3B%0A%0A%20%20%20%20%20%20var%20name%20%3D%20document%2EcreateTextNode%28this%2Eslide%5Fname%28i%29%29%3B%0A%20%20%20%20%20%20a%2EappendChild%28name%29%3B%0A%20%20%20%20%20%20a%2Eonclick%20%3D%20w3c%5Fslidy%2Etoc%5Fclick%3B%0A%20%20%20%20%20%20a%2Eonkeydown%20%3D%20w3c%5Fslidy%2Etoc%5Fkey%5Fdown%3B%0A%20%20%20%20%20%20a%2Eprevious%20%3D%20previous%3B%0A%0A%20%20%20%20%20%20if%20%28previous%29%0A%20%20%20%20%20%20%20%20previous%2Enext%20%3D%20a%3B%0A%0A%20%20%20%20%20%20toc%2EappendChild%28a%29%3B%0A%0A%20%20%20%20%20%20if%20%28i%20%3D%3D%200%29%0A%20%20%20%20%20%20%20%20toc%2Efirst%20%3D%20a%3B%0A%0A%20%20%20%20%20%20if%20%28i%20%3C%20this%2Eslides%2Elength%20%2D%201%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20var%20br%20%3D%20this%2Ecreate%5Felement%28%22br%22%29%3B%0A%20%20%20%20%20%20%20%20toc%2EappendChild%28br%29%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20previous%20%3D%20a%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20toc%2Efocus%20%3D%20function%20%28%29%20%7B%0A%20%20%20%20%20%20if%20%28this%2Efirst%29%0A%20%20%20%20%20%20%20%20this%2Efirst%2Efocus%28%29%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20toc%2Eonmouseup%20%3D%20w3c%5Fslidy%2Emouse%5Fbutton%5Fup%3B%0A%0A%20%20%20%20toc%2Eonclick%20%3D%20function%20%28e%29%20%7B%0A%20%20%20%20%20%20e%7C%7C%28e%3Dwindow%2Eevent%29%3B%0A%0A%20%20%20%20%20%20if%20%28w3c%5Fslidy%2Eselected%5Ftext%5Flen%20%3C%3D%200%29%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Ehide%5Ftable%5Fof%5Fcontents%28true%29%3B%0A%0A%20%20%20%20%20%20w3c%5Fslidy%2Estop%5Fpropagation%28e%29%3B%0A%20%20%20%20%0A%20%20%20%20%20%20if%20%28e%2Ecancel%20%21%3D%20undefined%29%0A%20%20%20%20%20%20%20%20e%2Ecancel%20%3D%20true%3B%0A%20%20%20%20%20%20%0A%20%20%20%20%20%20if%20%28e%2EreturnValue%20%21%3D%20undefined%29%0A%20%20%20%20%20%20%20%20e%2EreturnValue%20%3D%20false%3B%0A%20%20%20%20%20%20%0A%20%20%20%20%20%20return%20false%3B%0A%20%20%20%20%7D%3B%0A%0A%20%20%20%20document%2Ebody%2EinsertBefore%28toc%2C%20document%2Ebody%2EfirstChild%29%3B%0A%20%20%20%20return%20toc%3B%0A%20%20%7D%2C%0A%0A%20%20is%5Fshown%5Ftoc%3A%20function%20%28%29%20%7B%0A%20%20%20%20return%20%21w3c%5Fslidy%2Ehas%5Fclass%28w3c%5Fslidy%2Etoc%2C%20%22hidden%22%29%3B%0A%20%20%7D%2C%0A%0A%20%20show%5Ftable%5Fof%5Fcontents%3A%20function%20%28%29%20%7B%0A%20%20%20%20w3c%5Fslidy%2Eremove%5Fclass%28w3c%5Fslidy%2Etoc%2C%20%22hidden%22%29%3B%0A%20%20%20%20var%20toc%20%3D%20w3c%5Fslidy%2Etoc%3B%0A%20%20%20%20toc%2Efocus%28%29%3B%0A%0A%20%20%20%20if%20%28w3c%5Fslidy%2Eie7%20%26%26%20w3c%5Fslidy%2Eslide%5Fnumber%20%3D%3D%200%29%0A%20%20%20%20%20%20setTimeout%28w3c%5Fslidy%2Eie%5Fhack%2C%20100%29%3B%0A%20%20%7D%2C%0A%0A%20%20hide%5Ftable%5Fof%5Fcontents%3A%20function%20%28focus%29%20%7B%0A%20%20%20%20w3c%5Fslidy%2Eadd%5Fclass%28w3c%5Fslidy%2Etoc%2C%20%22hidden%22%29%3B%0A%0A%20%20%20%20if%20%28focus%20%26%26%20%21w3c%5Fslidy%2Eopera%20%26%26%0A%20%20%20%20%20%20%20%20%21w3c%5Fslidy%2Ehas%5Fclass%28w3c%5Fslidy%2Etoc%2C%20%22hidden%22%29%29%0A%20%20%20%20%20%20w3c%5Fslidy%2Eset%5Ffocus%28%29%3B%0A%20%20%7D%2C%0A%0A%20%20toggle%5Ftable%5Fof%5Fcontents%3A%20function%20%28%29%20%7B%0A%20%20%20%20if%20%28w3c%5Fslidy%2Eis%5Fshown%5Ftoc%28%29%29%0A%20%20%20%20%20%20w3c%5Fslidy%2Ehide%5Ftable%5Fof%5Fcontents%28true%29%3B%0A%20%20%20%20else%0A%20%20%20%20%20%20w3c%5Fslidy%2Eshow%5Ftable%5Fof%5Fcontents%28%29%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20called%20on%20clicking%20toc%20entry%0A%20%20toc%5Fclick%3A%20function%20%28e%29%20%7B%0A%20%20%20%20if%20%28%21e%29%0A%20%20%20%20%20%20e%20%3D%20window%2Eevent%3B%0A%0A%20%20%20%20var%20target%20%3D%20w3c%5Fslidy%2Eget%5Ftarget%28e%29%3B%0A%0A%20%20%20%20if%20%28target%20%26%26%20target%2EnodeType%20%3D%3D%201%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20var%20uri%20%3D%20target%2EgetAttribute%28%22href%22%29%3B%0A%0A%20%20%20%20%20%20if%20%28uri%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%2F%2Falert%28%22going%20to%20%22%20%2B%20uri%29%3B%0A%20%20%20%20%20%20%20%20var%20slide%20%3D%20w3c%5Fslidy%2Eslides%5Bw3c%5Fslidy%2Eslide%5Fnumber%5D%3B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Ehide%5Fslide%28slide%29%3B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eslide%5Fnumber%20%3D%20w3c%5Fslidy%2Efind%5Fslide%5Fnumber%28uri%29%3B%0A%20%20%20%20%20%20%20%20slide%20%3D%20w3c%5Fslidy%2Eslides%5Bw3c%5Fslidy%2Eslide%5Fnumber%5D%3B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Elast%5Fshown%20%3D%20null%3B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eset%5Flocation%28%29%3B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eset%5Fvisibility%5Fall%5Fincremental%28%22hidden%22%29%3B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eset%5Feos%5Fstatus%28%21w3c%5Fslidy%2Enext%5Fincremental%5Fitem%28w3c%5Fslidy%2Elast%5Fshown%29%29%3B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eshow%5Fslide%28slide%29%3B%0A%20%20%20%20%20%20%20%20%2F%2Ftarget%2Efocus%28%29%3B%0A%0A%20%20%20%20%20%20%20%20try%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20if%20%28%21w3c%5Fslidy%2Eopera%29%0A%20%20%20%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eset%5Ffocus%28%29%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20catch%20%28e%29%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%0A%20%20%20%20w3c%5Fslidy%2Ehide%5Ftable%5Fof%5Fcontents%28true%29%3B%0A%20%20%20%20if%20%28w3c%5Fslidy%2Eie7%29%20w3c%5Fslidy%2Eie%5Fhack%28%29%3B%0A%20%20%20%20w3c%5Fslidy%2Estop%5Fpropagation%28e%29%3B%0A%20%20%20%20return%20w3c%5Fslidy%2Ecancel%28e%29%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20called%20onkeydown%20for%20toc%20entry%0A%20%20toc%5Fkey%5Fdown%3A%20function%20%28event%29%20%7B%0A%20%20%20%20var%20key%3B%0A%0A%20%20%20%20if%20%28%21event%29%0A%20%20%20%20%20%20var%20event%20%3D%20window%2Eevent%3B%0A%0A%20%20%20%20%2F%2F%20kludge%20around%20NS%2FIE%20differences%20%0A%20%20%20%20if%20%28window%2Eevent%29%0A%20%20%20%20%20%20key%20%3D%20window%2Eevent%2EkeyCode%3B%0A%20%20%20%20else%20if%20%28event%2Ewhich%29%0A%20%20%20%20%20%20key%20%3D%20event%2Ewhich%3B%0A%20%20%20%20else%0A%20%20%20%20%20%20return%20true%3B%20%2F%2F%20Yikes%21%20unknown%20browser%0A%0A%20%20%20%20%2F%2F%20ignore%20event%20if%20key%20value%20is%20zero%0A%20%20%20%20%2F%2F%20as%20for%20alt%20on%20Opera%20and%20Konqueror%0A%20%20%20%20if%20%28%21key%29%0A%20%20%20%20%20%20return%20true%3B%0A%0A%20%20%20%20%2F%2F%20check%20for%20concurrent%20control%2Fcommand%2Falt%20key%0A%20%20%20%20%2F%2F%20but%20are%20these%20only%20present%20on%20mouse%20events%3F%0A%0A%20%20%20%20if%20%28event%2EctrlKey%20%7C%7C%20event%2EaltKey%29%0A%20%20%20%20%20%20return%20true%3B%0A%0A%20%20%20%20if%20%28key%20%3D%3D%2013%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20var%20uri%20%3D%20this%2EgetAttribute%28%22href%22%29%3B%0A%0A%20%20%20%20%20%20if%20%28uri%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%2F%2Falert%28%22going%20to%20%22%20%2B%20uri%29%3B%0A%20%20%20%20%20%20%20var%20slide%20%3D%20w3c%5Fslidy%2Eslides%5Bw3c%5Fslidy%2Eslide%5Fnumber%5D%3B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Ehide%5Fslide%28slide%29%3B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eslide%5Fnumber%20%3D%20w3c%5Fslidy%2Efind%5Fslide%5Fnumber%28uri%29%3B%0A%20%20%20%20%20%20%20%20slide%20%3D%20w3c%5Fslidy%2Eslides%5Bw3c%5Fslidy%2Eslide%5Fnumber%5D%3B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Elast%5Fshown%20%3D%20null%3B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eset%5Flocation%28%29%3B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eset%5Fvisibility%5Fall%5Fincremental%28%22hidden%22%29%3B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eset%5Feos%5Fstatus%28%21w3c%5Fslidy%2Enext%5Fincremental%5Fitem%28w3c%5Fslidy%2Elast%5Fshown%29%29%3B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eshow%5Fslide%28slide%29%3B%0A%20%20%20%20%20%20%20%20%2F%2Ftarget%2Efocus%28%29%3B%0A%0A%20%20%20%20%20%20%20%20try%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20if%20%28%21w3c%5Fslidy%2Eopera%29%0A%20%20%20%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eset%5Ffocus%28%29%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20catch%20%28e%29%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20w3c%5Fslidy%2Ehide%5Ftable%5Fof%5Fcontents%28true%29%3B%0A%0A%20%20%20%20%20%20if%20%28self%2Eie7%29%0A%20%20%20%20%20%20%20w3c%5Fslidy%2Eie%5Fhack%28%29%3B%0A%0A%20%20%20%20%20%20return%20w3c%5Fslidy%2Ecancel%28event%29%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20if%20%28key%20%3D%3D%2040%20%26%26%20this%2Enext%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20this%2Enext%2Efocus%28%29%3B%0A%20%20%20%20%20%20return%20w3c%5Fslidy%2Ecancel%28event%29%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20if%20%28key%20%3D%3D%2038%20%26%26%20this%2Eprevious%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20this%2Eprevious%2Efocus%28%29%3B%0A%20%20%20%20%20%20return%20w3c%5Fslidy%2Ecancel%28event%29%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20return%20true%3B%0A%20%20%7D%2C%0A%0A%20%20touchstart%3A%20function%20%28e%29%0A%20%20%7B%0A%20%20%20%20%2F%2F%20a%20double%20touch%20often%20starts%20with%20a%0A%20%20%20%20%2F%2F%20single%20touch%20due%20to%20fingers%20touching%0A%20%20%20%20%2F%2F%20down%20at%20slightly%20different%20times%0A%20%20%20%20%2F%2F%20thus%20avoid%20calling%20preventDefault%20here%0A%20%20%20%20this%2Eprev%5Ftap%20%3D%20this%2Elast%5Ftap%3B%0A%20%20%20%20this%2Elast%5Ftap%20%3D%20%28new%20Date%29%2EgetTime%28%29%3B%0A%0A%20%20%20%20var%20tap%5Fdelay%20%3D%20this%2Elast%5Ftap%20%2D%20this%2Eprev%5Ftap%3B%0A%0A%20%20%20%20if%20%28tap%5Fdelay%20%3C%3D%20200%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%2F%2F%20double%20tap%0A%20%20%20%20%7D%0A%0A%20%20%20%20var%20touch%20%3D%20e%2Etouches%5B0%5D%3B%0A%0A%20%20%20%20this%2EpageX%20%3D%20touch%2EpageX%3B%0A%20%20%20%20this%2EpageY%20%3D%20touch%2EpageY%3B%0A%20%20%20%20this%2EscreenX%20%3D%20touch%2EscreenX%3B%0A%20%20%20%20this%2EscreenY%20%3D%20touch%2EscreenY%3B%0A%20%20%20%20this%2EclientX%20%3D%20touch%2EclientX%3B%0A%20%20%20%20this%2EclientY%20%3D%20touch%2EclientY%3B%0A%0A%20%20%20%20this%2Edelta%5Fx%20%3D%20this%2Edelta%5Fy%20%3D%200%3B%0A%20%20%7D%2C%0A%0A%20%20touchmove%3A%20function%20%28e%29%0A%20%20%7B%0A%20%20%20%20%2F%2F%20override%20native%20gestures%20for%20single%20touch%0A%20%20%20%20if%20%28e%2Etouches%2Elength%20%3E%201%29%0A%20%20%20%20%20%20return%3B%0A%0A%20%20%20%20e%2EpreventDefault%28%29%3B%0A%20%20%20%20var%20touch%20%3D%20e%2Etouches%5B0%5D%3B%0A%20%20%20%20this%2Edelta%5Fx%20%3D%20touch%2EpageX%20%2D%20this%2EpageX%3B%0A%20%20%20%20this%2Edelta%5Fy%20%3D%20touch%2EpageY%20%2D%20this%2EpageY%3B%0A%20%20%7D%2C%0A%0A%20%20touchend%3A%20function%20%28e%29%0A%20%20%7B%0A%20%20%20%20%2F%2F%20default%20behavior%20for%20multi%2Dtouch%0A%20%20%20%20if%20%28e%2Etouches%2Elength%20%3E%201%29%0A%20%20%20%20%20%20return%3B%0A%0A%20%20%20%20var%20delay%20%3D%20%28new%20Date%29%2EgetTime%28%29%20%2D%20this%2Elast%5Ftap%3B%0A%20%20%20%20var%20dx%20%3D%20this%2Edelta%5Fx%3B%0A%20%20%20%20var%20dy%20%3D%20this%2Edelta%5Fy%3B%0A%20%20%20%20var%20abs%5Fdx%20%3D%20Math%2Eabs%28dx%29%3B%0A%20%20%20%20var%20abs%5Fdy%20%3D%20Math%2Eabs%28dy%29%3B%0A%0A%20%20%20%20if%20%28delay%20%3C%20500%20%26%26%20%28abs%5Fdx%20%3E%20100%20%7C%7C%20abs%5Fdy%20%3E%20100%29%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20if%20%28abs%5Fdx%20%3E%200%2E5%20%2A%20abs%5Fdy%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20e%2EpreventDefault%28%29%3B%0A%0A%20%20%20%20%20%20%20%20if%20%28dx%20%3C%200%29%0A%20%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Enext%5Fslide%28true%29%3B%0A%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eprevious%5Fslide%28true%29%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20else%20if%20%28abs%5Fdy%20%3E%202%20%2A%20abs%5Fdx%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20e%2EpreventDefault%28%29%3B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Etoggle%5Ftable%5Fof%5Fcontents%28%29%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20%23%23%23%20OBSOLETE%20%23%23%23%0A%20%20before%5Fprint%3A%20function%20%28%29%20%7B%0A%20%20%20%20this%2Eshow%5Fall%5Fslides%28%29%3B%0A%20%20%20%20this%2Ehide%5Ftoolbar%28%29%3B%0A%20%20%20%20alert%28%22before%20print%22%29%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20%23%23%23%20OBSOLETE%20%23%23%23%0A%20%20after%5Fprint%3A%20function%20%28%29%20%7B%0A%20%20%20%20if%20%28%21this%2Eview%5Fall%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20this%2Esingle%5Fslide%5Fview%28%29%3B%0A%20%20%20%20%20%20this%2Eshow%5Ftoolbar%28%29%3B%0A%20%20%20%20%7D%0A%20%20%20%20alert%28%22after%20print%22%29%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20%23%23%23%20OBSOLETE%20%23%23%23%0A%20%20print%5Fslides%3A%20function%20%28%29%20%7B%0A%20%20%20%20this%2Ebefore%5Fprint%28%29%3B%0A%20%20%20%20window%2Eprint%28%29%3B%0A%20%20%20%20this%2Eafter%5Fprint%28%29%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20%23%23%23%20OBSOLETE%20%3F%3F%20%23%23%23%0A%20%20toggle%5Fview%3A%20function%20%28%29%20%7B%0A%20%20%20%20if%20%28this%2Eview%5Fall%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20this%2Esingle%5Fslide%5Fview%28%29%3B%0A%20%20%20%20%20%20this%2Eshow%5Ftoolbar%28%29%3B%0A%20%20%20%20%20%20this%2Eview%5Fall%20%3D%200%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%0A%20%20%20%20%7B%0A%20%20%20%20%20%20this%2Eshow%5Fall%5Fslides%28%29%3B%0A%20%20%20%20%20%20this%2Ehide%5Ftoolbar%28%29%3B%0A%20%20%20%20%20%20this%2Eview%5Fall%20%3D%201%3B%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20prepare%20for%20printing%20%20%23%23%23%20OBSOLETE%20%23%23%23%0A%20%20show%5Fall%5Fslides%3A%20function%20%28%29%20%7B%0A%20%20%20%20this%2Eremove%5Fclass%28document%2Ebody%2C%20%22single%5Fslide%22%29%3B%0A%20%20%20%20this%2Eset%5Fvisibility%5Fall%5Fincremental%28%22visible%22%29%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20restore%20after%20printing%20%20%23%23%23%20OBSOLETE%20%23%23%23%0A%20%20single%5Fslide%5Fview%3A%20function%20%28%29%20%7B%0A%20%20%20%20this%2Eadd%5Fclass%28document%2Ebody%2C%20%22single%5Fslide%22%29%3B%0A%20%20%20%20this%2Eset%5Fvisibility%5Fall%5Fincremental%28%22visible%22%29%3B%0A%20%20%20%20this%2Elast%5Fshown%20%3D%20this%2Eprevious%5Fincremental%5Fitem%28null%29%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20suppress%20IE%27s%20image%20toolbar%20pop%20up%0A%20%20hide%5Fimage%5Ftoolbar%3A%20function%20%28%29%20%7B%0A%20%20%20%20if%20%28%21this%2Ens%5Fpos%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20var%20images%20%3D%20document%2EgetElementsByTagName%28%22IMG%22%29%3B%0A%0A%20%20%20%20%20%20for%20%28var%20i%20%3D%200%3B%20i%20%3C%20images%2Elength%3B%20%2B%2Bi%29%0A%20%20%20%20%20%20%20%20images%5Bi%5D%2EsetAttribute%28%22galleryimg%22%2C%20%22no%22%29%3B%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%0A%20%20unloaded%3A%20function%20%28e%29%20%7B%0A%20%20%20%20%2F%2Falert%28%22unloaded%22%29%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20Safari%20and%20Konqueror%20don%27t%20yet%20support%20getComputedStyle%28%29%0A%20%20%2F%2F%20and%20they%20always%20reload%20page%20when%20location%2Ehref%20is%20updated%0A%20%20is%5FKHTML%3A%20function%20%28%29%20%7B%0A%20%20%20%20var%20agent%20%3D%20navigator%2EuserAgent%3B%0A%20%20%20%20return%20%28agent%2EindexOf%28%22KHTML%22%29%20%3E%3D%200%20%3F%20true%20%3A%20false%29%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20find%20slide%20name%20from%20first%20h1%20element%0A%20%20%2F%2F%20default%20to%20document%20title%20%2B%20slide%20number%0A%20%20slide%5Fname%3A%20function%20%28index%29%20%7B%0A%20%20%20%20var%20name%20%3D%20null%3B%0A%20%20%20%20var%20slide%20%3D%20this%2Eslides%5Bindex%5D%3B%0A%0A%20%20%20%20var%20heading%20%3D%20this%2Efind%5Fheading%28slide%29%3B%0A%0A%20%20%20%20if%20%28heading%29%0A%20%20%20%20%20%20name%20%3D%20this%2Eextract%5Ftext%28heading%29%3B%0A%0A%20%20%20%20if%20%28%21name%29%0A%20%20%20%20%20%20name%20%3D%20this%2Etitle%20%2B%20%22%28%22%20%2B%20%28index%20%2B%201%29%20%2B%20%22%29%22%3B%0A%0A%20%20%20%20name%2Ereplace%28%2F%5C%26%2Fg%2C%20%22%26amp%3B%22%29%3B%0A%20%20%20%20name%2Ereplace%28%2F%5C%3C%2Fg%2C%20%22%26lt%3B%22%29%3B%0A%20%20%20%20name%2Ereplace%28%2F%5C%3E%2Fg%2C%20%22%26gt%3B%22%29%3B%0A%0A%20%20%20%20return%20name%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20find%20first%20h1%20element%20in%20DOM%20tree%0A%20%20find%5Fheading%3A%20function%20%28node%29%20%7B%0A%20%20%20%20if%20%28%21node%20%7C%7C%20node%2EnodeType%20%21%3D%201%29%0A%20%20%20%20%20%20return%20null%3B%0A%0A%20%20%20%20if%20%28node%2EnodeName%20%3D%3D%20%22H1%22%20%7C%7C%20node%2EnodeName%20%3D%3D%20%22h1%22%29%0A%20%20%20%20%20%20return%20node%3B%0A%0A%20%20%20%20var%20child%20%3D%20node%2EfirstChild%3B%0A%0A%20%20%20%20while%20%28child%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20node%20%3D%20this%2Efind%5Fheading%28child%29%3B%0A%0A%20%20%20%20%20%20if%20%28node%29%0A%20%20%20%20%20%20%20%20return%20node%3B%0A%0A%20%20%20%20%20%20child%20%3D%20child%2EnextSibling%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20return%20null%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20recursively%20extract%20text%20from%20DOM%20tree%0A%20%20extract%5Ftext%3A%20function%20%28node%29%20%7B%0A%20%20%20%20if%20%28%21node%29%0A%20%20%20%20%20%20return%20%22%22%3B%0A%0A%20%20%20%20%2F%2F%20text%20nodes%0A%20%20%20%20if%20%28node%2EnodeType%20%3D%3D%203%29%0A%20%20%20%20%20%20return%20node%2EnodeValue%3B%0A%0A%20%20%20%20%2F%2F%20elements%0A%20%20%20%20if%20%28node%2EnodeType%20%3D%3D%201%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20node%20%3D%20node%2EfirstChild%3B%0A%20%20%20%20%20%20var%20text%20%3D%20%22%22%3B%0A%0A%20%20%20%20%20%20while%20%28node%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20text%20%3D%20text%20%2B%20this%2Eextract%5Ftext%28node%29%3B%0A%20%20%20%20%20%20%20%20node%20%3D%20node%2EnextSibling%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20return%20text%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20return%20%22%22%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20find%20copyright%20text%20from%20meta%20element%0A%20%20find%5Fcopyright%3A%20function%20%28%29%20%7B%0A%20%20%20%20var%20name%2C%20content%3B%0A%20%20%20%20var%20meta%20%3D%20document%2EgetElementsByTagName%28%22meta%22%29%3B%0A%0A%20%20%20%20for%20%28var%20i%20%3D%200%3B%20i%20%3C%20meta%2Elength%3B%20%2B%2Bi%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20name%20%3D%20meta%5Bi%5D%2EgetAttribute%28%22name%22%29%3B%0A%20%20%20%20%20%20content%20%3D%20meta%5Bi%5D%2EgetAttribute%28%22content%22%29%3B%0A%0A%20%20%20%20%20%20if%20%28name%20%3D%3D%20%22copyright%22%29%0A%20%20%20%20%20%20%20%20return%20content%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20return%20null%3B%0A%20%20%7D%2C%0A%0A%20%20find%5Fsize%5Fadjust%3A%20function%20%28%29%20%7B%0A%20%20%20%20var%20name%2C%20content%2C%20offset%3B%0A%20%20%20%20var%20meta%20%3D%20document%2EgetElementsByTagName%28%22meta%22%29%3B%0A%0A%20%20%20%20for%20%28var%20i%20%3D%200%3B%20i%20%3C%20meta%2Elength%3B%20%2B%2Bi%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20name%20%3D%20meta%5Bi%5D%2EgetAttribute%28%22name%22%29%3B%0A%20%20%20%20%20%20content%20%3D%20meta%5Bi%5D%2EgetAttribute%28%22content%22%29%3B%0A%0A%20%20%20%20%20%20if%20%28name%20%3D%3D%20%22font%2Dsize%2Dadjustment%22%29%0A%20%20%20%20%20%20%20%20return%201%20%2A%20content%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20return%201%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20%3Cmeta%20name%3D%22duration%22%20content%3D%2220%22%20%2F%3E%20%20for%2020%20minutes%0A%20%20find%5Fduration%3A%20function%20%28%29%20%7B%0A%20%20%20%20var%20name%2C%20content%2C%20offset%3B%0A%20%20%20%20var%20meta%20%3D%20document%2EgetElementsByTagName%28%22meta%22%29%3B%0A%0A%20%20%20%20for%20%28var%20i%20%3D%200%3B%20i%20%3C%20meta%2Elength%3B%20%2B%2Bi%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20name%20%3D%20meta%5Bi%5D%2EgetAttribute%28%22name%22%29%3B%0A%20%20%20%20%20%20content%20%3D%20meta%5Bi%5D%2EgetAttribute%28%22content%22%29%3B%0A%0A%20%20%20%20%20%20if%20%28name%20%3D%3D%20%22duration%22%29%0A%20%20%20%20%20%20%20%20return%2060000%20%2A%20content%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20return%20null%3B%0A%20%20%7D%2C%0A%0A%20%20replace%5Fby%5Fnon%5Fbreaking%5Fspace%3A%20function%20%28str%29%20%7B%0A%20%20%20%20for%20%28var%20i%20%3D%200%3B%20i%20%3C%20str%2Elength%3B%20%2B%2Bi%29%0A%20%20%20%20%20%20str%5Bi%5D%20%3D%20160%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20%23%23%23%20CHECK%20ME%20%23%23%23%20is%20use%20of%20%22li%22%20okay%20for%20text%2Fhtml%3F%0A%20%20%2F%2F%20for%20XHTML%20do%20we%20also%20need%20to%20specify%20namespace%3F%0A%20%20init%5Foutliner%3A%20function%20%28%29%20%7B%0A%20%20%20%20var%20items%20%3D%20document%2EgetElementsByTagName%28%22li%22%29%3B%0A%0A%20%20%20%20for%20%28var%20i%20%3D%200%3B%20i%20%3C%20items%2Elength%3B%20%2B%2Bi%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20var%20target%20%3D%20items%5Bi%5D%3B%0A%0A%20%20%20%20%20%20if%20%28%21this%2Ehas%5Fclass%28target%2EparentNode%2C%20%22outline%22%29%29%0A%20%20%20%20%20%20%20%20continue%3B%0A%0A%20%20%20%20%20%20target%2Eonclick%20%3D%20this%2Eoutline%5Fclick%3B%0A%2F%2A%20%23%23%23%20more%20work%20needed%20for%20IE6%0A%20%20%20%20%20%20if%20%28%21this%2Ens%5Fpos%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20target%2Eonmouseover%20%3D%20this%2Ehover%5Foutline%3B%0A%20%20%20%20%20%20%20%20target%2Eonmouseout%20%3D%20this%2Eunhover%5Foutline%3B%0A%20%20%20%20%20%20%7D%0A%2A%2F%0A%20%20%20%20%20%20if%20%28this%2Efoldable%28target%29%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20target%2Efoldable%20%3D%20true%3B%0A%20%20%20%20%20%20%20%20target%2Eonfocus%20%3D%20function%20%28%29%20%7Bw3c%5Fslidy%2Eoutline%20%3D%20this%3B%7D%3B%0A%20%20%20%20%20%20%20%20target%2Eonblur%20%3D%20function%20%28%29%20%7Bw3c%5Fslidy%2Eoutline%20%3D%20null%3B%7D%3B%0A%0A%20%20%20%20%20%20%20%20if%20%28%21target%2EgetAttribute%28%22tabindex%22%29%29%0A%20%20%20%20%20%20%20%20%20%20target%2EsetAttribute%28%22tabindex%22%2C%20%220%22%29%3B%0A%0A%20%20%20%20%20%20%20%20if%20%28this%2Ehas%5Fclass%28target%2C%20%22expand%22%29%29%0A%20%20%20%20%20%20%20%20%20%20this%2Eunfold%28target%29%3B%0A%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20this%2Efold%28target%29%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20else%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20this%2Eadd%5Fclass%28target%2C%20%22nofold%22%29%3B%0A%20%20%20%20%20%20%20%20target%2Evisible%20%3D%20true%3B%0A%20%20%20%20%20%20%20%20target%2Efoldable%20%3D%20false%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%0A%20%20foldable%3A%20function%20%28item%29%20%7B%0A%20%20%20%20if%20%28%21item%20%7C%7C%20item%2EnodeType%20%21%3D%201%29%0A%20%20%20%20%20%20return%20false%3B%0A%0A%20%20%20%20var%20node%20%3D%20item%2EfirstChild%3B%0A%0A%20%20%20%20while%20%28node%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20if%20%28node%2EnodeType%20%3D%3D%201%20%26%26%20this%2Eis%5Fblock%28node%29%29%0A%20%20%20%20%20%20%20%20return%20true%3B%0A%0A%20%20%20%20%20%20node%20%3D%20node%2EnextSibling%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20return%20false%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20%23%23%23%20CHECK%20ME%20%23%23%23%20switch%20to%20add%2Fremove%20%22hidden%22%20class%0A%20%20fold%3A%20function%20%28item%29%20%7B%0A%20%20%20%20if%20%28item%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20this%2Eremove%5Fclass%28item%2C%20%22unfolded%22%29%3B%0A%20%20%20%20%20%20this%2Eadd%5Fclass%28item%2C%20%22folded%22%29%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20var%20node%20%3D%20item%20%3F%20item%2EfirstChild%20%3A%20null%3B%0A%0A%20%20%20%20while%20%28node%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20if%20%28node%2EnodeType%20%3D%3D%201%20%26%26%20this%2Eis%5Fblock%28node%29%29%20%2F%2F%20element%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eadd%5Fclass%28node%2C%20%22hidden%22%29%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20node%20%3D%20node%2EnextSibling%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20item%2Evisible%20%3D%20false%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20%23%23%23%20CHECK%20ME%20%23%23%23%20switch%20to%20add%2Fremove%20%22hidden%22%20class%0A%20%20unfold%3A%20function%20%28item%29%20%7B%0A%20%20%20%20if%20%28item%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20this%2Eadd%5Fclass%28item%2C%20%22unfolded%22%29%3B%0A%20%20%20%20%20%20this%2Eremove%5Fclass%28item%2C%20%22folded%22%29%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20var%20node%20%3D%20item%20%3F%20item%2EfirstChild%20%3A%20null%3B%0A%0A%20%20%20%20while%20%28node%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20if%20%28node%2EnodeType%20%3D%3D%201%20%26%26%20this%2Eis%5Fblock%28node%29%29%20%2F%2F%20element%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eremove%5Fclass%28node%2C%20%22hidden%22%29%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20node%20%3D%20node%2EnextSibling%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20item%2Evisible%20%3D%20true%3B%0A%20%20%7D%2C%0A%0A%20%20outline%5Fclick%3A%20function%20%28e%29%20%7B%0A%20%20%20%20if%20%28%21e%29%0A%20%20%20%20%20%20e%20%3D%20window%2Eevent%3B%0A%0A%20%20%20%20var%20rightclick%20%3D%20false%3B%0A%20%20%20%20var%20target%20%3D%20w3c%5Fslidy%2Eget%5Ftarget%28e%29%3B%0A%0A%20%20%20%20while%20%28target%20%26%26%20target%2Evisible%20%3D%3D%20undefined%29%0A%20%20%20%20%20%20target%20%3D%20target%2EparentNode%3B%0A%0A%20%20%20%20if%20%28%21target%29%0A%20%20%20%20%20%20return%20true%3B%0A%0A%20%20%20%20if%20%28e%2Ewhich%29%0A%20%20%20%20%20%20rightclick%20%3D%20%28e%2Ewhich%20%3D%3D%203%29%3B%0A%20%20%20%20else%20if%20%28e%2Ebutton%29%0A%20%20%20%20%20%20rightclick%20%3D%20%28e%2Ebutton%20%3D%3D%202%29%3B%0A%0A%20%20%20%20if%20%28%21rightclick%20%26%26%20target%2Evisible%20%21%3D%20undefined%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20if%20%28target%2Efoldable%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20if%20%28target%2Evisible%29%0A%20%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Efold%28target%29%3B%0A%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eunfold%28target%29%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20w3c%5Fslidy%2Estop%5Fpropagation%28e%29%3B%0A%20%20%20%20%20%20e%2Ecancel%20%3D%20true%3B%0A%20%20%20%20%20%20e%2EreturnValue%20%3D%20false%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20return%20false%3B%0A%20%20%7D%2C%0A%0A%20%20add%5Finitial%5Fprompt%3A%20function%20%28%29%20%7B%0A%20%20%20%20var%20prompt%20%3D%20this%2Ecreate%5Felement%28%22div%22%29%3B%0A%20%20%20%20prompt%2EsetAttribute%28%22class%22%2C%20%22initial%5Fprompt%22%29%3B%0A%0A%20%20%20%20var%20p1%20%3D%20this%2Ecreate%5Felement%28%22p%22%29%3B%0A%20%20%20%20prompt%2EappendChild%28p1%29%3B%0A%20%20%20%20p1%2EsetAttribute%28%22class%22%2C%20%22help%22%29%3B%0A%0A%20%20%20%20if%20%28this%2Ekeyboardless%29%0A%20%20%20%20%20%20p1%2EinnerHTML%20%3D%20%22swipe%20left%20to%20move%20to%20next%20slide%22%3B%0A%20%20%20%20else%0A%20%20%20%20%20%20p1%2EinnerHTML%20%3D%20%22Space%2C%20Right%20Arrow%20or%20swipe%20left%20to%20move%20to%20%22%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22next%20slide%2C%20click%20help%20below%20for%20more%20details%22%3B%0A%0A%20%20%20%20this%2Eadd%5Flistener%28prompt%2C%20%22click%22%2C%20function%20%28e%29%20%7B%0A%20%20%20%20%20%20document%2Ebody%2EremoveChild%28prompt%29%3B%0A%20%20%20%20%20%20w3c%5Fslidy%2Estop%5Fpropagation%28e%29%3B%0A%20%20%20%20%0A%20%20%20%20%20%20if%20%28e%2Ecancel%20%21%3D%20undefined%29%0A%20%20%20%20%20%20%20%20e%2Ecancel%20%3D%20true%3B%0A%20%20%20%20%20%20%0A%20%20%20%20%20%20if%20%28e%2EreturnValue%20%21%3D%20undefined%29%0A%20%20%20%20%20%20%20%20e%2EreturnValue%20%3D%20false%3B%0A%20%20%20%20%20%20%0A%20%20%20%20%20%20return%20false%3B%0A%20%20%20%20%7D%29%3B%0A%0A%20%20%20%20document%2Ebody%2EappendChild%28prompt%29%3B%0A%20%20%20%20this%2Einitial%5Fprompt%20%3D%20prompt%3B%0A%20%20%20%20setTimeout%28function%28%29%20%7Bdocument%2Ebody%2EremoveChild%28prompt%29%3B%7D%2C%205000%29%3B%0A%20%20%7D%2C%0A%0A%20%20add%5Ftoolbar%3A%20function%20%28%29%20%7B%0A%20%20%20%20var%20counter%2C%20page%3B%0A%0A%20%20%20%20%20this%2Etoolbar%20%3D%20this%2Ecreate%5Felement%28%22div%22%29%3B%0A%20%20%20%20%20this%2Etoolbar%2EsetAttribute%28%22class%22%2C%20%22toolbar%22%29%3B%0A%0A%20%20%20%20%20%2F%2F%20a%20reasonably%20behaved%20browser%0A%20%20%20%20%20if%20%28this%2Ens%5Fpos%20%7C%7C%20%21this%2Eie6%29%0A%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20var%20right%20%3D%20this%2Ecreate%5Felement%28%22div%22%29%3B%0A%20%20%20%20%20%20%20right%2EsetAttribute%28%22style%22%2C%20%22float%3A%20right%3B%20text%2Dalign%3A%20right%22%29%3B%0A%0A%20%20%20%20%20%20%20counter%20%3D%20this%2Ecreate%5Felement%28%22span%22%29%0A%20%20%20%20%20%20%20counter%2EinnerHTML%20%3D%20this%2Elocalize%28%22slide%22%29%20%2B%20%22%20n%2Fm%22%3B%0A%20%20%20%20%20%20%20right%2EappendChild%28counter%29%3B%0A%20%20%20%20%20%20%20this%2Etoolbar%2EappendChild%28right%29%3B%0A%0A%20%20%20%20%20%20%20var%20left%20%3D%20this%2Ecreate%5Felement%28%22div%22%29%3B%0A%20%20%20%20%20%20%20left%2EsetAttribute%28%22style%22%2C%20%22text%2Dalign%3A%20left%22%29%3B%0A%0A%20%20%20%20%20%20%20%2F%2F%20global%20end%20of%20slide%20indicator%0A%20%20%20%20%20%20%20this%2Eeos%20%3D%20this%2Ecreate%5Felement%28%22span%22%29%3B%0A%20%20%20%20%20%20%20this%2Eeos%2EinnerHTML%20%3D%20%22%2A%20%22%3B%0A%20%20%20%20%20%20%20left%2EappendChild%28this%2Eeos%29%3B%0A%0A%20%20%20%20%20%20%20var%20help%20%3D%20this%2Ecreate%5Felement%28%22a%22%29%3B%0A%20%20%20%20%20%20%20help%2EsetAttribute%28%22href%22%2C%20this%2Ehelp%5Fpage%29%3B%0A%20%20%20%20%20%20%20help%2EsetAttribute%28%22title%22%2C%20this%2Elocalize%28this%2Ehelp%5Ftext%29%29%3B%0A%20%20%20%20%20%20%20help%2EinnerHTML%20%3D%20this%2Elocalize%28%22help%3F%22%29%3B%0A%20%20%20%20%20%20%20left%2EappendChild%28help%29%3B%0A%20%20%20%20%20%20%20this%2Ehelp%5Fanchor%20%3D%20help%3B%20%20%2F%2F%20save%20for%20focus%20hack%0A%0A%20%20%20%20%20%20%20var%20gap1%20%3D%20document%2EcreateTextNode%28%22%20%22%29%3B%0A%20%20%20%20%20%20%20left%2EappendChild%28gap1%29%3B%0A%0A%20%20%20%20%20%20%20var%20contents%20%3D%20this%2Ecreate%5Felement%28%22a%22%29%3B%0A%20%20%20%20%20%20%20contents%2EsetAttribute%28%22href%22%2C%20%22javascript%3Aw3c%5Fslidy%2Etoggle%5Ftable%5Fof%5Fcontents%28%29%22%29%3B%0A%20%20%20%20%20%20%20contents%2EsetAttribute%28%22title%22%2C%20this%2Elocalize%28%22table%20of%20contents%22%29%29%3B%0A%20%20%20%20%20%20%20contents%2EinnerHTML%20%3D%20this%2Elocalize%28%22contents%3F%22%29%3B%0A%20%20%20%20%20%20%20left%2EappendChild%28contents%29%3B%0A%0A%20%20%20%20%20%20%20var%20gap2%20%3D%20document%2EcreateTextNode%28%22%20%22%29%3B%0A%20%20%20%20%20%20%20left%2EappendChild%28gap2%29%3B%0A%0A%20%20%20%20%20%20%20var%20copyright%20%3D%20this%2Efind%5Fcopyright%28%29%3B%0A%0A%20%20%20%20%20%20%20if%20%28copyright%29%0A%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20var%20span%20%3D%20this%2Ecreate%5Felement%28%22span%22%29%3B%0A%20%20%20%20%20%20%20%20%20span%2EclassName%20%3D%20%22copyright%22%3B%0A%20%20%20%20%20%20%20%20%20span%2EinnerHTML%20%3D%20copyright%3B%0A%20%20%20%20%20%20%20%20%20left%2EappendChild%28span%29%3B%0A%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20this%2Etoolbar%2EsetAttribute%28%22tabindex%22%2C%20%220%22%29%3B%0A%20%20%20%20%20%20%20this%2Etoolbar%2EappendChild%28left%29%3B%0A%20%20%20%20%20%7D%0A%20%20%20%20%20else%20%2F%2F%20IE6%20so%20need%20to%20work%20around%20its%20poor%20CSS%20support%0A%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20this%2Etoolbar%2Estyle%2Eposition%20%3D%20%28this%2Eie7%20%3F%20%22fixed%22%20%3A%20%22absolute%22%29%3B%0A%20%20%20%20%20%20%20this%2Etoolbar%2Estyle%2EzIndex%20%3D%20%22200%22%3B%0A%20%20%20%20%20%20%20this%2Etoolbar%2Estyle%2Ewidth%20%3D%20%2299%2E9%25%22%3B%0A%20%20%20%20%20%20%20this%2Etoolbar%2Estyle%2Eheight%20%3D%20%221%2E2em%22%3B%0A%20%20%20%20%20%20%20this%2Etoolbar%2Estyle%2Etop%20%3D%20%22auto%22%3B%0A%20%20%20%20%20%20%20this%2Etoolbar%2Estyle%2Ebottom%20%3D%20%220%22%3B%0A%20%20%20%20%20%20%20this%2Etoolbar%2Estyle%2Eleft%20%3D%20%220%22%3B%0A%20%20%20%20%20%20%20this%2Etoolbar%2Estyle%2Eright%20%3D%20%220%22%3B%0A%20%20%20%20%20%20%20this%2Etoolbar%2Estyle%2EtextAlign%20%3D%20%22left%22%3B%0A%20%20%20%20%20%20%20this%2Etoolbar%2Estyle%2EfontSize%20%3D%20%2260%25%22%3B%0A%20%20%20%20%20%20%20this%2Etoolbar%2Estyle%2Ecolor%20%3D%20%22red%22%3B%0A%20%20%20%20%20%20%20this%2Etoolbar%2EborderWidth%20%3D%200%3B%0A%20%20%20%20%20%20%20this%2Etoolbar%2EclassName%20%3D%20%22toolbar%22%3B%0A%20%20%20%20%20%20%20this%2Etoolbar%2Estyle%2Ebackground%20%3D%20%22rgb%28240%2C240%2C240%29%22%3B%0A%0A%20%20%20%20%20%20%20%2F%2F%20would%20like%20to%20have%20help%20text%20left%20aligned%0A%20%20%20%20%20%20%20%2F%2F%20and%20page%20counter%20right%20aligned%2C%20floating%0A%20%20%20%20%20%20%20%2F%2F%20div%27s%20don%27t%20work%2C%20so%20instead%20use%20nested%0A%20%20%20%20%20%20%20%2F%2F%20absolutely%20positioned%20div%27s%2E%0A%0A%20%20%20%20%20%20%20var%20sp%20%3D%20this%2Ecreate%5Felement%28%22span%22%29%3B%0A%20%20%20%20%20%20%20sp%2EinnerHTML%20%3D%20%22%26nbsp%3B%26nbsp%3B%2A%26nbsp%3B%22%3B%0A%20%20%20%20%20%20%20this%2Etoolbar%2EappendChild%28sp%29%3B%0A%20%20%20%20%20%20%20this%2Eeos%20%3D%20sp%3B%20%20%2F%2F%20end%20of%20slide%20indicator%0A%0A%20%20%20%20%20%20%20var%20help%20%3D%20this%2Ecreate%5Felement%28%22a%22%29%3B%0A%20%20%20%20%20%20%20help%2EsetAttribute%28%22href%22%2C%20this%2Ehelp%5Fpage%29%3B%0A%20%20%20%20%20%20%20help%2EsetAttribute%28%22title%22%2C%20this%2Elocalize%28this%2Ehelp%5Ftext%29%29%3B%0A%20%20%20%20%20%20%20help%2EinnerHTML%20%3D%20this%2Elocalize%28%22help%3F%22%29%3B%0A%20%20%20%20%20%20%20this%2Etoolbar%2EappendChild%28help%29%3B%0A%20%20%20%20%20%20%20this%2Ehelp%5Fanchor%20%3D%20help%3B%20%20%2F%2F%20save%20for%20focus%20hack%0A%0A%20%20%20%20%20%20%20var%20gap1%20%3D%20document%2EcreateTextNode%28%22%20%22%29%3B%0A%20%20%20%20%20%20%20this%2Etoolbar%2EappendChild%28gap1%29%3B%0A%0A%20%20%20%20%20%20%20var%20contents%20%3D%20this%2Ecreate%5Felement%28%22a%22%29%3B%0A%20%20%20%20%20%20%20contents%2EsetAttribute%28%22href%22%2C%20%22javascript%3AtoggleTableOfContents%28%29%22%29%3B%0A%20%20%20%20%20%20%20contents%2EsetAttribute%28%22title%22%2C%20this%2Elocalize%28%22table%20of%20contents%22%2Elocalize%29%29%3B%0A%20%20%20%20%20%20%20contents%2EinnerHTML%20%3D%20this%2Elocalize%28%22contents%3F%22%29%3B%0A%20%20%20%20%20%20%20this%2Etoolbar%2EappendChild%28contents%29%3B%0A%0A%20%20%20%20%20%20%20var%20gap2%20%3D%20document%2EcreateTextNode%28%22%20%22%29%3B%0A%20%20%20%20%20%20%20this%2Etoolbar%2EappendChild%28gap2%29%3B%0A%0A%20%20%20%20%20%20%20var%20copyright%20%3D%20this%2Efind%5Fcopyright%28%29%3B%0A%0A%20%20%20%20%20%20%20if%20%28copyright%29%0A%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20var%20span%20%3D%20this%2Ecreate%5Felement%28%22span%22%29%3B%0A%20%20%20%20%20%20%20%20%20span%2EinnerHTML%20%3D%20copyright%3B%0A%20%20%20%20%20%20%20%20%20span%2Estyle%2Ecolor%20%3D%20%22black%22%3B%0A%20%20%20%20%20%20%20%20%20span%2Estyle%2EmarginLeft%20%3D%20%220%2E5em%22%3B%0A%20%20%20%20%20%20%20%20%20this%2Etoolbar%2EappendChild%28span%29%3B%0A%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20counter%20%3D%20this%2Ecreate%5Felement%28%22div%22%29%0A%20%20%20%20%20%20%20counter%2Estyle%2Eposition%20%3D%20%22absolute%22%3B%0A%20%20%20%20%20%20%20counter%2Estyle%2Ewidth%20%3D%20%22auto%22%3B%20%2F%2F%2220%25%22%3B%0A%20%20%20%20%20%20%20counter%2Estyle%2Eheight%20%3D%20%221%2E2em%22%3B%0A%20%20%20%20%20%20%20counter%2Estyle%2Etop%20%3D%20%22auto%22%3B%0A%20%20%20%20%20%20%20counter%2Estyle%2Ebottom%20%3D%200%3B%0A%20%20%20%20%20%20%20counter%2Estyle%2Eright%20%3D%20%220%22%3B%0A%20%20%20%20%20%20%20counter%2Estyle%2EtextAlign%20%3D%20%22right%22%3B%0A%20%20%20%20%20%20%20counter%2Estyle%2Ecolor%20%3D%20%22red%22%3B%0A%20%20%20%20%20%20%20counter%2Estyle%2Ebackground%20%3D%20%22rgb%28240%2C240%2C240%29%22%3B%0A%0A%20%20%20%20%20%20%20counter%2EinnerHTML%20%3D%20this%2Elocalize%28%22slide%22%29%20%2B%20%22%20n%2Fm%22%3B%0A%20%20%20%20%20%20%20this%2Etoolbar%2EappendChild%28counter%29%3B%0A%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%2F%2F%20ensure%20that%20click%20isn%27t%20passed%20through%20to%20the%20page%0A%20%20%20%20%20this%2Etoolbar%2Eonclick%20%3D%0A%20%20%20%20%20%20%20%20%20function%20%28e%29%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20if%20%28%21e%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20e%20%3D%20window%2Eevent%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20var%20target%20%3D%20e%2Etarget%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20if%20%28%21target%20%26%26%20e%2EsrcElement%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20target%20%3D%20e%2EsrcElement%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20work%20around%20Safari%20bug%0A%20%20%20%20%20%20%20%20%20%20%20if%20%28target%20%26%26%20target%2EnodeType%20%3D%3D%203%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20target%20%3D%20target%2EparentNode%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Estop%5Fpropagation%28e%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20if%20%28target%20%26%26%20target%2EnodeName%2EtoLowerCase%28%29%20%21%3D%20%22a%22%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Emouse%5Fbutton%5Fclick%28e%29%3B%0A%20%20%20%20%20%20%20%20%20%7D%3B%0A%0A%20%20%20%20%20this%2Eslide%5Fnumber%5Felement%20%3D%20counter%3B%0A%20%20%20%20%20this%2Eset%5Feos%5Fstatus%28false%29%3B%0A%20%20%20%20%20document%2Ebody%2EappendChild%28this%2Etoolbar%29%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20wysiwyg%20editors%20make%20it%20hard%20to%20use%20div%20elements%0A%20%20%2F%2F%20e%2Eg%2E%20amaya%20loses%20the%20div%20when%20you%20copy%20and%20paste%0A%20%20%2F%2F%20this%20function%20wraps%20div%20elements%20around%20implicit%0A%20%20%2F%2F%20slides%20which%20start%20with%20an%20h1%20element%20and%20continue%0A%20%20%2F%2F%20up%20to%20the%20next%20heading%20or%20div%20element%0A%20%20wrap%5Fimplicit%5Fslides%3A%20function%20%28%29%20%7B%0A%20%20%20%20var%20i%2C%20heading%2C%20node%2C%20next%2C%20div%3B%0A%20%20%20%20var%20headings%20%3D%20document%2EgetElementsByTagName%28%22h1%22%29%3B%0A%0A%20%20%20%20if%20%28%21headings%29%0A%20%20%20%20%20%20return%3B%0A%0A%20%20%20%20for%20%28i%20%3D%200%3B%20i%20%3C%20headings%2Elength%3B%20%2B%2Bi%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20heading%20%3D%20headings%5Bi%5D%3B%0A%0A%20%20%20%20%20%20if%20%28heading%2EparentNode%20%21%3D%20document%2Ebody%29%0A%20%20%20%20%20%20%20%20continue%3B%0A%0A%20%20%20%20%20%20node%20%3D%20heading%2EnextSibling%3B%0A%0A%20%20%20%20%20%20div%20%3D%20document%2EcreateElement%28%22div%22%29%3B%0A%20%20%20%20%20%20this%2Eadd%5Fclass%28div%2C%20%22slide%22%29%3B%0A%20%20%20%20%20%20document%2Ebody%2EreplaceChild%28div%2C%20heading%29%3B%0A%20%20%20%20%20%20div%2EappendChild%28heading%29%3B%0A%0A%20%20%20%20%20%20while%20%28node%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20if%20%28node%2EnodeType%20%3D%3D%201%29%20%2F%2F%20an%20element%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20if%20%28node%2EnodeName%20%3D%3D%20%22H1%22%20%7C%7C%20node%2EnodeName%20%3D%3D%20%22h1%22%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20if%20%28node%2EnodeName%20%3D%3D%20%22DIV%22%20%7C%7C%20node%2EnodeName%20%3D%3D%20%22div%22%29%0A%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28this%2Ehas%5Fclass%28node%2C%20%22slide%22%29%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28this%2Ehas%5Fclass%28node%2C%20%22handout%22%29%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20next%20%3D%20node%2EnextSibling%3B%0A%20%20%20%20%20%20%20%20node%20%3D%20document%2Ebody%2EremoveChild%28node%29%3B%0A%20%20%20%20%20%20%20%20div%2EappendChild%28node%29%3B%0A%20%20%20%20%20%20%20%20node%20%3D%20next%3B%0A%20%20%20%20%20%20%7D%20%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%0A%20%20attach%5Ftouch%5Fhanders%3A%20function%28slides%29%0A%20%20%7B%0A%20%20%20%20var%20i%2C%20slide%3B%0A%0A%20%20%20%20for%20%28i%20%3D%200%3B%20i%20%3C%20slides%2Elength%3B%20%2B%2Bi%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20slide%20%3D%20slides%5Bi%5D%3B%0A%20%20%20%20%20%20this%2Eadd%5Flistener%28slide%2C%20%22touchstart%22%2C%20this%2Etouchstart%29%3B%0A%20%20%20%20%20%20this%2Eadd%5Flistener%28slide%2C%20%22touchmove%22%2C%20this%2Etouchmove%29%3B%0A%20%20%20%20%20%20this%2Eadd%5Flistener%28slide%2C%20%22touchend%22%2C%20this%2Etouchend%29%3B%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%0A%2F%2F%20return%20new%20array%20of%20all%20slides%0A%20%20collect%5Fslides%3A%20function%20%28%29%20%7B%0A%20%20%20%20var%20slides%20%3D%20new%20Array%28%29%3B%0A%20%20%20%20var%20divs%20%3D%20document%2Ebody%2EgetElementsByTagName%28%22div%22%29%3B%0A%0A%20%20%20%20for%20%28var%20i%20%3D%200%3B%20i%20%3C%20divs%2Elength%3B%20%2B%2Bi%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20div%20%3D%20divs%2Eitem%28i%29%3B%0A%0A%20%20%20%20%20%20if%20%28this%2Ehas%5Fclass%28div%2C%20%22slide%22%29%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%2F%2F%20add%20slide%20to%20collection%0A%20%20%20%20%20%20%20%20slides%5Bslides%2Elength%5D%20%3D%20div%3B%0A%0A%20%20%20%20%20%20%20%20%2F%2F%20hide%20each%20slide%20as%20it%20is%20found%0A%20%20%20%20%20%20%20%20this%2Eadd%5Fclass%28div%2C%20%22hidden%22%29%3B%0A%0A%20%20%20%20%20%20%20%20%2F%2F%20add%20dummy%20%3Cbr%2F%3E%20at%20end%20for%20scrolling%20hack%0A%20%20%20%20%20%20%20%20var%20node1%20%3D%20document%2EcreateElement%28%22br%22%29%3B%0A%20%20%20%20%20%20%20%20div%2EappendChild%28node1%29%3B%0A%20%20%20%20%20%20%20%20var%20node2%20%3D%20document%2EcreateElement%28%22br%22%29%3B%0A%20%20%20%20%20%20%20%20div%2EappendChild%28node2%29%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20else%20if%20%28this%2Ehas%5Fclass%28div%2C%20%22background%22%29%29%0A%20%20%20%20%20%20%7B%20%20%2F%2F%20work%20around%20for%20Firefox%20SVG%20reload%20bug%0A%20%20%20%20%20%20%20%20%2F%2F%20which%20otherwise%20replaces%201st%20SVG%20graphic%20with%202nd%0A%20%20%20%20%20%20%20%20div%2Estyle%2Edisplay%20%3D%20%22block%22%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%0A%20%20%20%20this%2Eslides%20%3D%20slides%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20return%20new%20array%20of%20all%20%3Cdiv%20class%3D%22handout%22%3E%0A%20%20collect%5Fnotes%3A%20function%20%28%29%20%7B%0A%20%20%20%20var%20notes%20%3D%20new%20Array%28%29%3B%0A%20%20%20%20var%20divs%20%3D%20document%2Ebody%2EgetElementsByTagName%28%22div%22%29%3B%0A%0A%20%20%20%20for%20%28var%20i%20%3D%200%3B%20i%20%3C%20divs%2Elength%3B%20%2B%2Bi%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20div%20%3D%20divs%2Eitem%28i%29%3B%0A%0A%20%20%20%20%20%20if%20%28this%2Ehas%5Fclass%28div%2C%20%22handout%22%29%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%2F%2F%20add%20note%20to%20collection%0A%20%20%20%20%20%20%20%20notes%5Bnotes%2Elength%5D%20%3D%20div%3B%0A%0A%20%20%20%20%20%20%20%20%2F%2F%20and%20hide%20it%0A%20%20%20%20%20%20%20%20this%2Eadd%5Fclass%28div%2C%20%22hidden%22%29%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%0A%20%20%20%20this%2Enotes%20%3D%20notes%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20return%20new%20array%20of%20all%20%3Cdiv%20class%3D%22background%22%3E%0A%20%20%2F%2F%20including%20named%20backgrounds%20e%2Eg%2E%20class%3D%22background%20titlepage%22%0A%20%20collect%5Fbackgrounds%3A%20function%20%28%29%20%7B%0A%20%20%20%20var%20backgrounds%20%3D%20new%20Array%28%29%3B%0A%20%20%20%20var%20divs%20%3D%20document%2Ebody%2EgetElementsByTagName%28%22div%22%29%3B%0A%0A%20%20%20%20for%20%28var%20i%20%3D%200%3B%20i%20%3C%20divs%2Elength%3B%20%2B%2Bi%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20div%20%3D%20divs%2Eitem%28i%29%3B%0A%0A%20%20%20%20%20%20if%20%28this%2Ehas%5Fclass%28div%2C%20%22background%22%29%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%2F%2F%20add%20background%20to%20collection%0A%20%20%20%20%20%20%20%20backgrounds%5Bbackgrounds%2Elength%5D%20%3D%20div%3B%0A%0A%20%20%20%20%20%20%20%20%2F%2F%20and%20hide%20it%0A%20%20%20%20%20%20%20%20this%2Eadd%5Fclass%28div%2C%20%22hidden%22%29%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%0A%20%20%20%20this%2Ebackgrounds%20%3D%20backgrounds%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20set%20click%20handlers%20on%20all%20anchors%0A%20%20patch%5Fanchors%3A%20function%20%28%29%20%7B%0A%20%20%20%20var%20self%20%3D%20w3c%5Fslidy%3B%0A%20%20%20%20var%20handler%20%3D%20function%20%28event%29%20%7B%0A%20%20%20%20%20%20%2F%2F%20compare%20this%2Ehref%20with%20location%2Ehref%0A%20%20%20%20%20%20%2F%2F%20for%20link%20to%20another%20slide%20in%20this%20doc%0A%0A%20%20%20%20%20%20if%20%28self%2Epage%5Faddress%28this%2Ehref%29%20%3D%3D%20self%2Epage%5Faddress%28location%2Ehref%29%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%2F%2F%20yes%2C%20so%20find%20new%20slide%20number%0A%20%20%20%20%20%20%20%20var%20newslidenum%20%3D%20self%2Efind%5Fslide%5Fnumber%28this%2Ehref%29%3B%0A%0A%20%20%20%20%20%20%20%20if%20%28newslidenum%20%21%3D%20self%2Eslide%5Fnumber%29%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20slide%20%3D%20self%2Eslides%5Bself%2Eslide%5Fnumber%5D%3B%0A%20%20%20%20%20%20%20%20%20%20self%2Ehide%5Fslide%28slide%29%3B%0A%20%20%20%20%20%20%20%20%20%20self%2Eslide%5Fnumber%20%3D%20newslidenum%3B%0A%20%20%20%20%20%20%20%20%20%20slide%20%3D%20self%2Eslides%5Bself%2Eslide%5Fnumber%5D%3B%0A%20%20%20%20%20%20%20%20%20%20self%2Eshow%5Fslide%28slide%29%3B%0A%20%20%20%20%20%20%20%20%20%20self%2Eset%5Flocation%28%29%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Estop%5Fpropagation%28event%29%3B%0A%0A%2F%2F%20%20%20%20%20%20else%20if%20%28this%2Etarget%20%3D%3D%20null%29%0A%2F%2F%20%20%20%20%20%20%20%20location%2Ehref%20%3D%20this%2Ehref%3B%0A%0A%20%20%20%20%20%20this%2Eblur%28%29%3B%0A%20%20%20%20%20%20self%2Edisable%5Fslide%5Fclick%20%3D%20true%3B%0A%20%20%20%20%7D%3B%0A%0A%20%20%20%20var%20anchors%20%3D%20document%2Ebody%2EgetElementsByTagName%28%22a%22%29%3B%0A%0A%20%20%20%20for%20%28var%20i%20%3D%200%3B%20i%20%3C%20anchors%2Elength%3B%20%2B%2Bi%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20if%20%28window%2EaddEventListener%29%0A%20%20%20%20%20%20%20%20anchors%5Bi%5D%2EaddEventListener%28%22click%22%2C%20handler%2C%20false%29%3B%0A%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20anchors%5Bi%5D%2EattachEvent%28%22onclick%22%2C%20handler%29%3B%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20%23%23%23%20CHECK%20ME%20%23%23%23%20see%20which%20functions%20are%20invoked%20via%20setTimeout%0A%20%20%2F%2F%20either%20directly%20or%20indirectly%20for%20use%20of%20w3c%5Fslidy%20vs%20this%0A%20%20show%5Fslide%5Fnumber%3A%20function%20%28%29%20%7B%0A%20%20%20%20var%20timer%20%3D%20w3c%5Fslidy%2Eget%5Ftimer%28%29%3B%0A%20%20%20%20w3c%5Fslidy%2Eslide%5Fnumber%5Felement%2EinnerHTML%20%3D%20timer%20%2B%20w3c%5Fslidy%2Elocalize%28%22slide%22%29%20%2B%20%22%20%22%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%28w3c%5Fslidy%2Eslide%5Fnumber%20%2B%201%29%20%2B%20%22%2F%22%20%2B%20w3c%5Fslidy%2Eslides%2Elength%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20every%20200mS%20check%20if%20the%20location%20has%20been%20changed%20as%20a%0A%20%20%2F%2F%20result%20of%20the%20user%20activating%20the%20Back%20button%2Fmenu%20item%0A%20%20%2F%2F%20doesn%27t%20work%20for%20Opera%20%3C%209%2E5%0A%20%20check%5Flocation%3A%20function%20%28%29%20%7B%0A%20%20%20%20var%20hash%20%3D%20location%2Ehash%3B%0A%0A%20%20%20%20if%20%28w3c%5Fslidy%2Eslide%5Fnumber%20%3E%200%20%26%26%20%28hash%20%3D%3D%20%22%22%20%7C%7C%20hash%20%3D%3D%20%22%23%22%29%29%0A%20%20%20%20%20%20w3c%5Fslidy%2Egoto%5Fslide%280%29%3B%0A%20%20%20%20else%20if%20%28hash%2Elength%20%3E%202%20%26%26%20hash%20%21%3D%20%22%23%28%22%2B%28w3c%5Fslidy%2Eslide%5Fnumber%2B1%29%2B%22%29%22%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20var%20num%20%3D%20parseInt%28location%2Ehash%2Esubstr%282%29%29%3B%0A%0A%20%20%20%20%20%20if%20%28%21isNaN%28num%29%29%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Egoto%5Fslide%28num%2D1%29%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20if%20%28w3c%5Fslidy%2Etime%5Fleft%20%26%26%20w3c%5Fslidy%2Eslide%5Fnumber%20%3E%200%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20w3c%5Fslidy%2Eshow%5Fslide%5Fnumber%28%29%3B%0A%0A%20%20%20%20%20%20if%20%28w3c%5Fslidy%2Etime%5Fleft%20%3E%200%29%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Etime%5Fleft%20%2D%3D%20200%3B%0A%20%20%20%20%7D%20%0A%20%20%7D%2C%0A%0A%20%20get%5Ftimer%3A%20function%20%28%29%20%7B%0A%20%20%20%20var%20timer%20%3D%20%22%22%3B%0A%20%20%20%20if%20%28w3c%5Fslidy%2Etime%5Fleft%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20var%20mins%2C%20secs%3B%0A%20%20%20%20%20%20secs%20%3D%20Math%2Efloor%28w3c%5Fslidy%2Etime%5Fleft%2F1000%29%3B%0A%20%20%20%20%20%20mins%20%3D%20Math%2Efloor%28secs%20%2F%2060%29%3B%0A%20%20%20%20%20%20secs%20%3D%20secs%20%25%2060%3B%0A%20%20%20%20%20%20timer%20%3D%20%28mins%20%3F%20mins%2B%22m%22%20%3A%20%22%22%29%20%2B%20secs%20%2B%20%22s%20%22%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20return%20timer%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20this%20doesn%27t%20push%20location%20onto%20history%20stack%20for%20IE%0A%20%20%2F%2F%20for%20which%20a%20hidden%20iframe%20hack%20is%20needed%3A%20load%20page%20into%0A%20%20%2F%2F%20the%20iframe%20with%20script%20that%20set%27s%20parent%27s%20location%2Ehash%0A%20%20%2F%2F%20but%20that%20won%27t%20work%20for%20standalone%20use%20unless%20we%20can%0A%20%20%2F%2F%20create%20the%20page%20dynamically%20via%20a%20javascript%3A%20URL%0A%20%20%2F%2F%20%23%23%23%20use%20history%2EpushState%20if%20available%0A%20%20set%5Flocation%3A%20function%20%28%29%20%7B%0A%20%20%20%20%20var%20uri%20%3D%20w3c%5Fslidy%2Epage%5Faddress%28location%2Ehref%29%3B%0A%20%20%20%20%20var%20hash%20%3D%20%22%23%28%22%20%2B%20%28w3c%5Fslidy%2Eslide%5Fnumber%2B1%29%20%2B%20%22%29%22%3B%0A%0A%20%20%20%20%20if%20%28w3c%5Fslidy%2Eslide%5Fnumber%20%3E%3D%200%29%0A%20%20%20%20%20%20%20uri%20%3D%20uri%20%2B%20hash%3B%0A%0A%20%20%20%20%20if%20%28typeof%28history%2EpushState%29%20%21%3D%20%22undefined%22%29%0A%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20document%2Etitle%20%3D%20w3c%5Fslidy%2Etitle%20%2B%20%22%20%28%22%20%2B%20%28w3c%5Fslidy%2Eslide%5Fnumber%2B1%29%20%2B%20%22%29%22%3B%0A%20%20%20%20%20%20%20history%2EpushState%280%2C%20document%2Etitle%2C%20hash%29%3B%0A%20%20%20%20%20%20%20w3c%5Fslidy%2Eshow%5Fslide%5Fnumber%28%29%3B%0A%20%20%20%20%20%20%20w3c%5Fslidy%2Enotify%5Fobservers%28%29%3B%0A%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%7D%0A%0A%20%20%20%20%20if%20%28w3c%5Fslidy%2Eie%20%26%26%20%28w3c%5Fslidy%2Eie6%20%7C%7C%20w3c%5Fslidy%2Eie7%29%29%0A%20%20%20%20%20%20%20w3c%5Fslidy%2Epush%5Fhash%28hash%29%3B%0A%0A%20%20%20%20%20if%20%28uri%20%21%3D%20location%2Ehref%29%20%2F%2F%20%26%26%20%21khtml%0A%20%20%20%20%20%20%20%20location%2Ehref%20%3D%20uri%3B%0A%0A%20%20%20%20%20if%20%28this%2Ekhtml%29%0A%20%20%20%20%20%20%20%20hash%20%3D%20%22%28%22%20%2B%20%28w3c%5Fslidy%2Eslide%5Fnumber%2B1%29%20%2B%20%22%29%22%3B%0A%0A%20%20%20%20%20if%20%28%21this%2Eie%20%26%26%20location%2Ehash%20%21%3D%20hash%20%26%26%20location%2Ehash%20%21%3D%20%22%22%29%0A%20%20%20%20%20%20%20location%2Ehash%20%3D%20hash%3B%0A%0A%20%20%20%20%20document%2Etitle%20%3D%20w3c%5Fslidy%2Etitle%20%2B%20%22%20%28%22%20%2B%20%28w3c%5Fslidy%2Eslide%5Fnumber%2B1%29%20%2B%20%22%29%22%3B%0A%20%20%20%20%20w3c%5Fslidy%2Eshow%5Fslide%5Fnumber%28%29%3B%0A%20%20%20%20%20w3c%5Fslidy%2Enotify%5Fobservers%28%29%3B%0A%20%20%7D%2C%0A%0A%20%20notify%5Fobservers%3A%20function%20%28%29%0A%20%20%7B%0A%20%20%20%20var%20slide%20%3D%20this%2Eslides%5Bthis%2Eslide%5Fnumber%5D%3B%0A%0A%20%20%20%20for%20%28var%20i%20%3D%200%3B%20i%20%3C%20this%2Eobservers%2Elength%3B%20%2B%2Bi%29%0A%20%20%20%20%20%20this%2Eobservers%5Bi%5D%28this%2Eslide%5Fnumber%2B1%2C%20this%2Efind%5Fheading%28slide%29%2EinnerText%2C%20location%2Ehref%29%3B%0A%20%20%7D%2C%0A%0A%20%20add%5Fobserver%3A%20function%20%28observer%29%0A%20%20%7B%0A%20%20%20%20for%20%28var%20i%20%3D%200%3B%20i%20%3C%20this%2Eobservers%2Elength%3B%20%2B%2Bi%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20if%20%28observer%20%3D%3D%20this%2Eobservers%5Bi%5D%29%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20this%2Eobservers%2Epush%28observer%29%3B%0A%20%20%7D%2C%0A%0A%20%20remove%5Fobserver%3A%20function%20%28o%29%0A%20%20%7B%0A%20%20%20%20for%20%28var%20i%20%3D%200%3B%20i%20%3C%20this%2Eobservers%2Elength%3B%20%2B%2Bi%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20if%20%28observer%20%3D%3D%20this%2Eobservers%5Bi%5D%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20this%2Eobservers%2Esplice%28i%2C1%29%3B%0A%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%0A%20%20page%5Faddress%3A%20function%20%28uri%29%20%7B%0A%20%20%20%20var%20i%20%3D%20uri%2EindexOf%28%22%23%22%29%3B%0A%0A%20%20%20%20if%20%28i%20%3C%200%29%0A%20%20%20%20%20%20i%20%3D%20uri%2EindexOf%28%22%2523%22%29%3B%0A%0A%20%20%20%20%2F%2F%20check%20if%20anchor%20is%20entire%20page%0A%0A%20%20%20%20if%20%28i%20%3C%200%29%0A%20%20%20%20%20%20return%20uri%3B%20%20%2F%2F%20yes%0A%0A%20%20%20%20return%20uri%2Esubstr%280%2C%20i%29%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20only%20used%20for%20IE6%20and%20IE7%0A%20%20on%5Fframe%5Floaded%3A%20function%20%28hash%29%20%7B%0A%20%20%20%20location%2Ehash%20%3D%20hash%3B%0A%20%20%20%20var%20uri%20%3D%20w3c%5Fslidy%2Epage%5Faddress%28location%2Ehref%29%3B%0A%20%20%20%20location%2Ehref%20%3D%20uri%20%2B%20hash%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20history%20hack%20with%20thanks%20to%20Bertrand%20Le%20Roy%0A%20%20push%5Fhash%3A%20function%20%28hash%29%20%7B%0A%20%20%20%20if%20%28hash%20%3D%3D%20%22%22%29%20hash%20%3D%20%22%23%281%29%22%3B%0A%20%20%20%20%20%20window%2Elocation%2Ehash%20%3D%20hash%3B%0A%0A%20%20%20%20var%20doc%20%3D%20document%2EgetElementById%28%22historyFrame%22%29%2EcontentWindow%2Edocument%3B%0A%20%20%20%20doc%2Eopen%28%22javascript%3A%27%3Chtml%3E%3C%2Fhtml%3E%27%22%29%3B%0A%20%20%20%20doc%2Ewrite%28%22%3Chtml%3E%3Chead%3E%3Cscript%20type%3D%5C%22text%2Fjavascript%5C%22%3Ewindow%2Eparent%2Ew3c%5Fslidy%2Eon%5Fframe%5Floaded%28%27%22%2B%0A%20%20%20%20%20%20%28hash%29%20%2B%20%22%27%29%3B%3C%2Fscript%3E%3C%2Fhead%3E%3Cbody%3Ehello%20mum%3C%2Fbody%3E%3C%2Fhtml%3E%22%29%3B%0A%20%20%20%20%20%20doc%2Eclose%28%29%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20find%20current%20slide%20based%20upon%20location%0A%20%20%2F%2F%20first%20find%20target%20anchor%20and%20then%20look%0A%20%20%2F%2F%20for%20associated%20div%20element%20enclosing%20it%0A%20%20%2F%2F%20finally%20map%20that%20to%20slide%20number%0A%20%20find%5Fslide%5Fnumber%3A%20function%20%28uri%29%20%7B%0A%20%20%20%20%2F%2F%20first%20get%20anchor%20from%20page%20location%0A%0A%20%20%20%20var%20i%20%3D%20uri%2EindexOf%28%22%23%22%29%3B%0A%0A%20%20%20%20%2F%2F%20check%20if%20anchor%20is%20entire%20page%0A%20%20%20%20if%20%28i%20%3C%200%29%0A%20%20%20%20%20%20return%200%3B%20%20%2F%2F%20yes%0A%0A%20%20%20%20var%20anchor%20%3D%20unescape%28uri%2Esubstr%28i%2B1%29%29%3B%0A%0A%20%20%20%20%2F%2F%20now%20use%20anchor%20as%20XML%20ID%20to%20find%20target%0A%20%20%20%20var%20target%20%3D%20document%2EgetElementById%28anchor%29%3B%0A%0A%20%20%20%20if%20%28%21target%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%2F%2F%20does%20anchor%20look%20like%20%22%282%29%22%20for%20slide%202%20%3F%3F%0A%20%20%20%20%20%20%2F%2F%20where%20first%20slide%20is%20%281%29%0A%20%20%20%20%20%20var%20re%20%3D%20%2F%5C%28%28%5Cd%29%2B%5C%29%2F%3B%0A%0A%20%20%20%20%20%20if%20%28anchor%2Ematch%28re%29%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20var%20num%20%3D%20parseInt%28anchor%2Esubstring%281%2C%20anchor%2Elength%2D1%29%29%3B%0A%0A%20%20%20%20%20%20%20%20if%20%28num%20%3E%20this%2Eslides%2Elength%29%0A%20%20%20%20%20%20%20%20%20%20num%20%3D%201%3B%0A%0A%20%20%20%20%20%20%20%20if%20%28%2D%2Dnum%20%3C%200%29%0A%20%20%20%20%20%20%20%20%20%20num%20%3D%200%3B%0A%0A%20%20%20%20%20%20%20%20return%20num%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%2F%2F%20accept%20%5B2%5D%20for%20backwards%20compatibility%0A%20%20%20%20%20%20re%20%3D%20%2F%5C%5B%28%5Cd%29%2B%5C%5D%2F%3B%0A%0A%20%20%20%20%20%20if%20%28anchor%2Ematch%28re%29%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20var%20num%20%3D%20parseInt%28anchor%2Esubstring%281%2C%20anchor%2Elength%2D1%29%29%3B%0A%0A%20%20%20%20%20%20%20%20%20if%20%28num%20%3E%20this%2Eslides%2Elength%29%0A%20%20%20%20%20%20%20%20%20%20%20%20num%20%3D%201%3B%0A%0A%20%20%20%20%20%20%20%20%20if%20%28%2D%2Dnum%20%3C%200%29%0A%20%20%20%20%20%20%20%20%20%20%20%20num%20%3D%200%3B%0A%0A%20%20%20%20%20%20%20%20%20return%20num%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%2F%2F%20oh%20dear%20unknown%20anchor%0A%20%20%20%20%20%20return%200%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F%2F%20search%20for%20enclosing%20slide%0A%0A%20%20%20%20while%20%28true%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%2F%2F%20browser%20coerces%20html%20elements%20to%20uppercase%21%0A%20%20%20%20%20%20if%20%28target%2EnodeName%2EtoLowerCase%28%29%20%3D%3D%20%22div%22%20%26%26%0A%20%20%20%20%20%20%20%20%20%20%20%20this%2Ehas%5Fclass%28target%2C%20%22slide%22%29%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%2F%2F%20found%20the%20slide%20element%0A%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%2F%2F%20otherwise%20try%20parent%20element%20if%20any%0A%0A%20%20%20%20%20%20target%20%3D%20target%2EparentNode%3B%0A%0A%20%20%20%20%20%20if%20%28%21target%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20return%200%3B%20%20%20%2F%2F%20no%20luck%21%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%0A%20%20%20%20for%20%28i%20%3D%200%3B%20i%20%3C%20slides%2Elength%3B%20%2B%2Bi%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20if%20%28slides%5Bi%5D%20%3D%3D%20target%29%0A%20%20%20%20%20%20%20%20return%20i%3B%20%20%2F%2F%20success%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F%2F%20oh%20dear%20still%20no%20luck%0A%20%20%20%20return%200%3B%0A%20%20%7D%2C%0A%0A%20%20previous%5Fslide%3A%20function%20%28incremental%29%20%7B%0A%20%20%20%20if%20%28%21w3c%5Fslidy%2Eview%5Fall%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20var%20slide%3B%0A%0A%20%20%20%20%20%20if%20%28%28incremental%20%7C%7C%20w3c%5Fslidy%2Eslide%5Fnumber%20%3D%3D%200%29%20%26%26%20w3c%5Fslidy%2Elast%5Fshown%20%21%3D%20null%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Elast%5Fshown%20%3D%20w3c%5Fslidy%2Ehide%5Fprevious%5Fitem%28w3c%5Fslidy%2Elast%5Fshown%29%3B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eset%5Feos%5Fstatus%28false%29%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20else%20if%20%28w3c%5Fslidy%2Eslide%5Fnumber%20%3E%200%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20slide%20%3D%20w3c%5Fslidy%2Eslides%5Bw3c%5Fslidy%2Eslide%5Fnumber%5D%3B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Ehide%5Fslide%28slide%29%3B%0A%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eslide%5Fnumber%20%3D%20w3c%5Fslidy%2Eslide%5Fnumber%20%2D%201%3B%0A%20%20%20%20%20%20%20%20slide%20%3D%20w3c%5Fslidy%2Eslides%5Bw3c%5Fslidy%2Eslide%5Fnumber%5D%3B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eset%5Fvisibility%5Fall%5Fincremental%28%22visible%22%29%3B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Elast%5Fshown%20%3D%20w3c%5Fslidy%2Eprevious%5Fincremental%5Fitem%28null%29%3B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eset%5Feos%5Fstatus%28true%29%3B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eshow%5Fslide%28slide%29%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20w3c%5Fslidy%2Eset%5Flocation%28%29%3B%0A%0A%20%20%20%20%20%20if%20%28%21w3c%5Fslidy%2Ens%5Fpos%29%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Erefresh%5Ftoolbar%28200%29%3B%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%0A%20%20next%5Fslide%3A%20function%20%28incremental%29%20%7B%0A%20%20%20%20if%20%28%21w3c%5Fslidy%2Eview%5Fall%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20var%20slide%2C%20last%20%3D%20w3c%5Fslidy%2Elast%5Fshown%3B%0A%0A%20%20%20%20%20%20if%20%28incremental%20%7C%7C%20w3c%5Fslidy%2Eslide%5Fnumber%20%3D%3D%20w3c%5Fslidy%2Eslides%2Elength%20%2D%201%29%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Elast%5Fshown%20%3D%20w3c%5Fslidy%2Ereveal%5Fnext%5Fitem%28w3c%5Fslidy%2Elast%5Fshown%29%3B%0A%0A%20%20%20%20%20%20if%20%28%28%21incremental%20%7C%7C%20w3c%5Fslidy%2Elast%5Fshown%20%3D%3D%20null%29%20%26%26%0A%20%20%20%20%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eslide%5Fnumber%20%3C%20w3c%5Fslidy%2Eslides%2Elength%20%2D%201%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20slide%20%3D%20w3c%5Fslidy%2Eslides%5Bw3c%5Fslidy%2Eslide%5Fnumber%5D%3B%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Ehide%5Fslide%28slide%29%3B%0A%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eslide%5Fnumber%20%3D%20w3c%5Fslidy%2Eslide%5Fnumber%20%2B%201%3B%0A%20%20%20%20%20%20%20%20%20slide%20%3D%20w3c%5Fslidy%2Eslides%5Bw3c%5Fslidy%2Eslide%5Fnumber%5D%3B%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Elast%5Fshown%20%3D%20null%3B%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eset%5Fvisibility%5Fall%5Fincremental%28%22hidden%22%29%3B%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eshow%5Fslide%28slide%29%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20else%20if%20%28%21w3c%5Fslidy%2Elast%5Fshown%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20if%20%28last%20%26%26%20incremental%29%0A%20%20%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Elast%5Fshown%20%3D%20last%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20w3c%5Fslidy%2Eset%5Flocation%28%29%3B%0A%0A%20%20%20%20%20%20w3c%5Fslidy%2Eset%5Feos%5Fstatus%28%21w3c%5Fslidy%2Enext%5Fincremental%5Fitem%28w3c%5Fslidy%2Elast%5Fshown%29%29%3B%0A%0A%20%20%20%20%20%20if%20%28%21w3c%5Fslidy%2Ens%5Fpos%29%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Erefresh%5Ftoolbar%28200%29%3B%0A%20%20%20%20%20%7D%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20to%20first%20slide%20with%20nothing%20revealed%0A%20%20%2F%2F%20i%2Ee%2E%20state%20at%20start%20of%20presentation%0A%20%20first%5Fslide%3A%20function%20%28%29%20%7B%0A%20%20%20%20%20if%20%28%21w3c%5Fslidy%2Eview%5Fall%29%0A%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20var%20slide%3B%0A%0A%20%20%20%20%20%20%20if%20%28w3c%5Fslidy%2Eslide%5Fnumber%20%21%3D%200%29%0A%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20slide%20%3D%20w3c%5Fslidy%2Eslides%5Bw3c%5Fslidy%2Eslide%5Fnumber%5D%3B%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Ehide%5Fslide%28slide%29%3B%0A%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eslide%5Fnumber%20%3D%200%3B%0A%20%20%20%20%20%20%20%20%20slide%20%3D%20w3c%5Fslidy%2Eslides%5Bw3c%5Fslidy%2Eslide%5Fnumber%5D%3B%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Elast%5Fshown%20%3D%20null%3B%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eset%5Fvisibility%5Fall%5Fincremental%28%22hidden%22%29%3B%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eshow%5Fslide%28slide%29%3B%0A%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20w3c%5Fslidy%2Eset%5Feos%5Fstatus%28%0A%20%20%20%20%20%20%20%20%20%21w3c%5Fslidy%2Enext%5Fincremental%5Fitem%28w3c%5Fslidy%2Elast%5Fshown%29%29%3B%0A%20%20%20%20%20%20%20w3c%5Fslidy%2Eset%5Flocation%28%29%3B%0A%20%20%20%20%20%7D%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20goto%20last%20slide%20with%20everything%20revealed%0A%20%20%2F%2F%20i%2Ee%2E%20state%20at%20end%20of%20presentation%0A%20%20last%5Fslide%3A%20function%20%28%29%20%7B%0A%20%20%20%20if%20%28%21w3c%5Fslidy%2Eview%5Fall%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20var%20slide%3B%0A%0A%20%20%20%20%20%20w3c%5Fslidy%2Elast%5Fshown%20%3D%20null%3B%20%2F%2FrevealNextItem%28lastShown%29%3B%0A%0A%20%20%20%20%20%20if%20%28w3c%5Fslidy%2Elast%5Fshown%20%3D%3D%20null%20%26%26%0A%20%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eslide%5Fnumber%20%3C%20w3c%5Fslidy%2Eslides%2Elength%20%2D%201%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20slide%20%3D%20w3c%5Fslidy%2Eslides%5Bw3c%5Fslidy%2Eslide%5Fnumber%5D%3B%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Ehide%5Fslide%28slide%29%3B%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eslide%5Fnumber%20%3D%20w3c%5Fslidy%2Eslides%2Elength%20%2D%201%3B%0A%20%20%20%20%20%20%20%20%20slide%20%3D%20w3c%5Fslidy%2Eslides%5Bw3c%5Fslidy%2Eslide%5Fnumber%5D%3B%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eset%5Fvisibility%5Fall%5Fincremental%28%22visible%22%29%3B%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Elast%5Fshown%20%3D%20w3c%5Fslidy%2Eprevious%5Fincremental%5Fitem%28null%29%3B%0A%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eshow%5Fslide%28slide%29%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20else%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eset%5Fvisibility%5Fall%5Fincremental%28%22visible%22%29%3B%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Elast%5Fshown%20%3D%20w3c%5Fslidy%2Eprevious%5Fincremental%5Fitem%28null%29%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20w3c%5Fslidy%2Eset%5Feos%5Fstatus%28true%29%3B%0A%20%20%20%20%20%20w3c%5Fslidy%2Eset%5Flocation%28%29%3B%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%0A%0A%20%20%2F%2F%20%23%23%23%20check%20this%20and%20consider%20add%2Fremove%20class%0A%20%20set%5Feos%5Fstatus%3A%20function%20%28state%29%20%7B%0A%20%20%20%20if%20%28this%2Eeos%29%0A%20%20%20%20%20%20this%2Eeos%2Estyle%2Ecolor%20%3D%20%28state%20%3F%20%22rgb%28240%2C240%2C240%29%22%20%3A%20%22red%22%29%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20first%20slide%20is%200%0A%20%20goto%5Fslide%3A%20function%20%28num%29%20%7B%0A%20%20%20%20%2F%2Falert%28%22going%20to%20slide%20%22%20%2B%20%28num%2B1%29%29%3B%0A%20%20%20%20var%20slide%20%3D%20w3c%5Fslidy%2Eslides%5Bw3c%5Fslidy%2Eslide%5Fnumber%5D%3B%0A%20%20%20%20w3c%5Fslidy%2Ehide%5Fslide%28slide%29%3B%0A%20%20%20%20w3c%5Fslidy%2Eslide%5Fnumber%20%3D%20num%3B%0A%20%20%20%20slide%20%3D%20w3c%5Fslidy%2Eslides%5Bw3c%5Fslidy%2Eslide%5Fnumber%5D%3B%0A%20%20%20%20w3c%5Fslidy%2Elast%5Fshown%20%3D%20null%3B%0A%20%20%20%20w3c%5Fslidy%2Eset%5Fvisibility%5Fall%5Fincremental%28%22hidden%22%29%3B%0A%20%20%20%20w3c%5Fslidy%2Eset%5Feos%5Fstatus%28%21w3c%5Fslidy%2Enext%5Fincremental%5Fitem%28w3c%5Fslidy%2Elast%5Fshown%29%29%3B%0A%20%20%20%20document%2Etitle%20%3D%20w3c%5Fslidy%2Etitle%20%2B%20%22%20%28%22%20%2B%20%28w3c%5Fslidy%2Eslide%5Fnumber%2B1%29%20%2B%20%22%29%22%3B%0A%20%20%20%20w3c%5Fslidy%2Eshow%5Fslide%28slide%29%3B%0A%20%20%20%20w3c%5Fslidy%2Eshow%5Fslide%5Fnumber%28%29%3B%0A%20%20%7D%2C%0A%0A%0A%20%20show%5Fslide%3A%20function%20%28slide%29%20%7B%0A%20%20%20%20this%2Esync%5Fbackground%28slide%29%3B%0A%20%20%20%20this%2Eremove%5Fclass%28slide%2C%20%22hidden%22%29%3B%0A%0A%20%20%20%20%2F%2F%20work%20around%20IE9%20object%20rendering%20bug%0A%20%20%20%20setTimeout%28%22window%2EscrollTo%280%2C0%29%3B%22%2C%201%29%3B%0A%20%20%7D%2C%0A%0A%20%20hide%5Fslide%3A%20function%20%28slide%29%20%7B%0A%20%20%20%20this%2Eadd%5Fclass%28slide%2C%20%22hidden%22%29%3B%0A%20%20%7D%2C%0A%0A%20%20set%5Ffocus%3A%20function%20%28element%29%0A%20%20%7B%0A%20%20%20%20if%20%28element%29%0A%20%20%20%20%20%20element%2Efocus%28%29%3B%0A%20%20%20%20else%0A%20%20%20%20%7B%0A%20%20%20%20%20%20w3c%5Fslidy%2Ehelp%5Fanchor%2Efocus%28%29%3B%0A%0A%20%20%20%20%20%20setTimeout%28function%28%29%20%7B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Ehelp%5Fanchor%2Eblur%28%29%3B%0A%20%20%20%20%20%20%7D%2C%201%29%3B%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20show%20just%20the%20backgrounds%20pertinent%20to%20this%20slide%0A%20%20%2F%2F%20when%20slide%20background%2Dcolor%20is%20transparent%0A%20%20%2F%2F%20this%20should%20now%20work%20with%20rgba%20color%20values%0A%20%20sync%5Fbackground%3A%20function%20%28slide%29%20%7B%0A%20%20%20%20var%20background%3B%0A%20%20%20%20var%20bgColor%3B%0A%0A%20%20%20%20if%20%28slide%2EcurrentStyle%29%0A%20%20%20%20%20%20bgColor%20%3D%20slide%2EcurrentStyle%5B%22backgroundColor%22%5D%3B%0A%20%20%20%20else%20if%20%28document%2EdefaultView%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20var%20styles%20%3D%20document%2EdefaultView%2EgetComputedStyle%28slide%2Cnull%29%3B%0A%0A%20%20%20%20%20%20if%20%28styles%29%0A%20%20%20%20%20%20%20%20bgColor%20%3D%20styles%2EgetPropertyValue%28%22background%2Dcolor%22%29%3B%0A%20%20%20%20%20%20else%20%2F%2F%20broken%20implementation%20probably%20due%20Safari%20or%20Konqueror%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%2F%2Falert%28%22defective%20implementation%20of%20getComputedStyle%28%29%22%29%3B%0A%20%20%20%20%20%20%20%20bgColor%20%3D%20%22transparent%22%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%20%20else%0A%20%20%20%20%20%20bgColor%20%3D%3D%20%22transparent%22%3B%0A%0A%20%20%20%20if%20%28bgColor%20%3D%3D%20%22transparent%22%20%7C%7C%0A%20%20%20%20%20%20%20%20bgColor%2EindexOf%28%22rgba%22%29%20%3E%3D%200%20%7C%7C%0A%20%20%20%20%20%20%20%20bgColor%2EindexOf%28%22opacity%22%29%20%3E%3D%200%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20var%20slideClass%20%3D%20this%2Eget%5Fclass%5Flist%28slide%29%3B%0A%0A%20%20%20%20%20%20for%20%28var%20i%20%3D%200%3B%20i%20%3C%20this%2Ebackgrounds%2Elength%3B%20i%2B%2B%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20background%20%3D%20this%2Ebackgrounds%5Bi%5D%3B%0A%0A%20%20%20%20%20%20%20%20var%20bgClass%20%3D%20this%2Eget%5Fclass%5Flist%28background%29%3B%0A%0A%20%20%20%20%20%20%20%20if%20%28this%2Ematching%5Fbackground%28slideClass%2C%20bgClass%29%29%0A%20%20%20%20%20%20%20%20%20%20this%2Eremove%5Fclass%28background%2C%20%22hidden%22%29%3B%0A%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20this%2Eadd%5Fclass%28background%2C%20%22hidden%22%29%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%20%20else%20%2F%2F%20forcibly%20hide%20all%20backgrounds%0A%20%20%20%20%20%20this%2Ehide%5Fbackgrounds%28%29%3B%0A%20%20%7D%2C%0A%0A%20%20hide%5Fbackgrounds%3A%20function%20%28%29%20%7B%0A%20%20%20%20for%20%28var%20i%20%3D%200%3B%20i%20%3C%20this%2Ebackgrounds%2Elength%3B%20i%2B%2B%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20background%20%3D%20this%2Ebackgrounds%5Bi%5D%3B%0A%20%20%20%20%20%20this%2Eadd%5Fclass%28background%2C%20%22hidden%22%29%3B%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20compare%20classes%20for%20slide%20and%20background%0A%20%20matching%5Fbackground%3A%20function%20%28slideClass%2C%20bgClass%29%20%7B%0A%20%20%20%20var%20i%2C%20count%2C%20pattern%2C%20result%3B%0A%0A%20%20%20%20%2F%2F%20define%20pattern%20as%20regular%20expression%0A%20%20%20%20pattern%20%3D%20%2F%5Cw%2B%2Fg%3B%0A%0A%20%20%20%20%2F%2F%20check%20background%20class%20names%0A%20%20%20%20result%20%3D%20bgClass%2Ematch%28pattern%29%3B%0A%0A%20%20%20%20for%20%28i%20%3D%20count%20%3D%200%3B%20i%20%3C%20result%2Elength%3B%20i%2B%2B%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20if%20%28result%5Bi%5D%20%3D%3D%20%22hidden%22%29%0A%20%20%20%20%20%20%20%20continue%3B%0A%0A%20%20%20%20%20%20if%20%28result%5Bi%5D%20%3D%3D%20%22background%22%29%0A%09continue%3B%0A%0A%20%20%20%20%20%20%2B%2Bcount%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20if%20%28count%20%3D%3D%200%29%20%20%2F%2F%20default%20match%0A%20%20%20%20%20%20return%20true%3B%0A%0A%20%20%20%20%2F%2F%20check%20for%20matches%20and%20place%20result%20in%20array%0A%20%20%20%20result%20%3D%20slideClass%2Ematch%28pattern%29%3B%0A%0A%20%20%20%20%2F%2F%20now%20check%20if%20desired%20name%20is%20present%20for%20background%0A%20%20%20%20for%20%28i%20%3D%20count%20%3D%200%3B%20i%20%3C%20result%2Elength%3B%20i%2B%2B%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20if%20%28result%5Bi%5D%20%3D%3D%20%22hidden%22%29%0A%20%20%20%20%20%20%20%20continue%3B%0A%0A%20%20%20%20%20%20if%20%28this%2Ehas%5Ftoken%28bgClass%2C%20result%5Bi%5D%29%29%0A%20%20%20%20%20%20%20%20return%20true%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20return%20false%3B%0A%20%20%7D%2C%0A%0A%20%20resized%3A%20function%20%28%29%20%7B%0A%20%20%20%20%20var%20width%20%3D%200%3B%0A%0A%20%20%20%20%20if%20%28%20typeof%28%20window%2EinnerWidth%20%29%20%3D%3D%20%27number%27%20%29%0A%20%20%20%20%20%20%20width%20%3D%20window%2EinnerWidth%3B%20%20%2F%2F%20Non%20IE%20browser%0A%20%20%20%20%20else%20if%20%28document%2EdocumentElement%20%26%26%20document%2EdocumentElement%2EclientWidth%29%0A%20%20%20%20%20%20%20width%20%3D%20document%2EdocumentElement%2EclientWidth%3B%20%20%2F%2F%20IE6%0A%20%20%20%20%20else%20if%20%28document%2Ebody%20%26%26%20document%2Ebody%2EclientWidth%29%0A%20%20%20%20%20%20%20width%20%3D%20document%2Ebody%2EclientWidth%3B%20%2F%2F%20IE4%0A%0A%20%20%20%20%20var%20height%20%3D%200%3B%0A%0A%20%20%20%20%20if%20%28%20typeof%28%20window%2EinnerHeight%20%29%20%3D%3D%20%27number%27%20%29%0A%20%20%20%20%20%20%20height%20%3D%20window%2EinnerHeight%3B%20%20%2F%2F%20Non%20IE%20browser%0A%20%20%20%20%20else%20if%20%28document%2EdocumentElement%20%26%26%20document%2EdocumentElement%2EclientHeight%29%0A%20%20%20%20%20%20%20height%20%3D%20document%2EdocumentElement%2EclientHeight%3B%20%20%2F%2F%20IE6%0A%20%20%20%20%20else%20if%20%28document%2Ebody%20%26%26%20document%2Ebody%2EclientHeight%29%0A%20%20%20%20%20%20%20height%20%3D%20document%2Ebody%2EclientHeight%3B%20%2F%2F%20IE4%0A%0A%20%20%20%20%20if%20%28height%20%26%26%20%28width%2Fheight%20%3E%201%2E05%2A1024%2F768%29%29%0A%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20width%20%3D%20height%20%2A%201024%2E0%2F768%3B%0A%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%2F%2F%20IE%20fires%20onresize%20even%20when%20only%20font%20size%20is%20changed%21%0A%20%20%20%20%20%2F%2F%20so%20we%20do%20a%20check%20to%20avoid%20blocking%20%3C%20and%20%3E%20actions%0A%20%20%20%20%20if%20%28width%20%21%3D%20w3c%5Fslidy%2Elast%5Fwidth%20%7C%7C%20height%20%21%3D%20w3c%5Fslidy%2Elast%5Fheight%29%0A%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20if%20%28width%20%3E%3D%201100%29%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Esize%5Findex%20%3D%205%3B%20%20%20%20%2F%2F%204%0A%20%20%20%20%20%20%20else%20if%20%28width%20%3E%3D%201000%29%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Esize%5Findex%20%3D%204%3B%20%20%20%20%2F%2F%203%0A%20%20%20%20%20%20%20else%20if%20%28width%20%3E%3D%20800%29%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Esize%5Findex%20%3D%203%3B%20%20%20%20%2F%2F%202%0A%20%20%20%20%20%20%20else%20if%20%28width%20%3E%3D%20600%29%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Esize%5Findex%20%3D%202%3B%20%20%20%20%2F%2F%201%0A%20%20%20%20%20%20%20else%20if%20%28width%29%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Esize%5Findex%20%3D%200%3B%0A%0A%20%20%20%20%20%20%20%2F%2F%20add%20in%20font%20size%20adjustment%20from%20meta%20element%20e%2Eg%2E%0A%20%20%20%20%20%20%20%2F%2F%20%3Cmeta%20name%3D%22font%2Dsize%2Dadjustment%22%20content%3D%22%2D2%22%20%2F%3E%0A%20%20%20%20%20%20%20%2F%2F%20useful%20when%20slides%20have%20too%20much%20content%20%3B%2D%29%0A%0A%20%20%20%20%20%20%20if%20%280%20%3C%3D%20w3c%5Fslidy%2Esize%5Findex%20%2B%20w3c%5Fslidy%2Esize%5Fadjustment%20%26%26%0A%20%20%20%20%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Esize%5Findex%20%2B%20w3c%5Fslidy%2Esize%5Fadjustment%20%3C%20w3c%5Fslidy%2Esizes%2Elength%29%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Esize%5Findex%20%3D%20w3c%5Fslidy%2Esize%5Findex%20%2B%20w3c%5Fslidy%2Esize%5Fadjustment%3B%0A%0A%20%20%20%20%20%20%20%2F%2F%20enables%20cross%20browser%20use%20of%20relative%20width%2Fheight%0A%20%20%20%20%20%20%20%2F%2F%20on%20object%20elements%20for%20use%20with%20SVG%20and%20Flash%20media%0A%20%20%20%20%20%20%20w3c%5Fslidy%2Eadjust%5Fobject%5Fdimensions%28width%2C%20height%29%3B%0A%0A%20%20%20%20%20%20%20if%20%28document%2Ebody%2Estyle%2EfontSize%20%21%3D%20w3c%5Fslidy%2Esizes%5Bw3c%5Fslidy%2Esize%5Findex%5D%29%0A%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20document%2Ebody%2Estyle%2EfontSize%20%3D%20w3c%5Fslidy%2Esizes%5Bw3c%5Fslidy%2Esize%5Findex%5D%3B%0A%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20w3c%5Fslidy%2Elast%5Fwidth%20%3D%20width%3B%0A%20%20%20%20%20%20%20w3c%5Fslidy%2Elast%5Fheight%20%3D%20height%3B%0A%0A%20%20%20%20%20%20%20%2F%2F%20force%20reflow%20to%20work%20around%20Mozilla%20bug%0A%20%20%20%20%20%20%20if%20%28w3c%5Fslidy%2Ens%5Fpos%29%0A%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20var%20slide%20%3D%20w3c%5Fslidy%2Eslides%5Bw3c%5Fslidy%2Eslide%5Fnumber%5D%3B%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Ehide%5Fslide%28slide%29%3B%0A%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eshow%5Fslide%28slide%29%3B%0A%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%2F%2F%20force%20correct%20positioning%20of%20toolbar%0A%20%20%20%20%20%20%20w3c%5Fslidy%2Erefresh%5Ftoolbar%28200%29%3B%0A%20%20%20%20%20%7D%0A%20%20%7D%2C%0A%0A%20%20scrolled%3A%20function%20%28%29%20%7B%0A%20%20%20%20if%20%28w3c%5Fslidy%2Etoolbar%20%26%26%20%21w3c%5Fslidy%2Ens%5Fpos%20%26%26%20%21w3c%5Fslidy%2Eie7%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20w3c%5Fslidy%2Ehack%5Foffset%20%3D%20w3c%5Fslidy%2Escroll%5Fx%5Foffset%28%29%3B%0A%20%20%20%20%20%20%2F%2F%20hide%20toolbar%0A%20%20%20%20%20%20w3c%5Fslidy%2Etoolbar%2Estyle%2Edisplay%20%3D%20%22none%22%3B%0A%0A%20%20%20%20%20%20%2F%2F%20make%20it%20reappear%20later%0A%20%20%20%20%20%20if%20%28w3c%5Fslidy%2Escrollhack%20%3D%3D%200%20%26%26%20%21w3c%5Fslidy%2Eview%5Fall%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20setTimeout%28function%20%28%29%20%7Bw3c%5Fslidy%2Eshow%5Ftoolbar%28%29%3B%20%7D%2C%201000%29%3B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Escrollhack%20%3D%201%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%0A%20%20hide%5Ftoolbar%3A%20function%20%28%29%20%7B%0A%20%20%20%20w3c%5Fslidy%2Eadd%5Fclass%28w3c%5Fslidy%2Etoolbar%2C%20%22hidden%22%29%3B%0A%20%20%20%20window%2Efocus%28%29%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20used%20to%20ensure%20IE%20refreshes%20toolbar%20in%20correct%20position%0A%20%20refresh%5Ftoolbar%3A%20function%20%28interval%29%20%7B%0A%20%20%20%20if%20%28%21w3c%5Fslidy%2Ens%5Fpos%20%26%26%20%21w3c%5Fslidy%2Eie7%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20w3c%5Fslidy%2Ehide%5Ftoolbar%28%29%3B%0A%20%20%20%20%20%20setTimeout%28function%20%28%29%20%7Bw3c%5Fslidy%2Eshow%5Ftoolbar%28%29%3B%7D%2C%20interval%29%3B%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20restores%20toolbar%20after%20short%20delay%0A%20%20show%5Ftoolbar%3A%20function%20%28%29%20%7B%0A%20%20%20%20if%20%28w3c%5Fslidy%2Ewant%5Ftoolbar%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20w3c%5Fslidy%2Etoolbar%2Estyle%2Edisplay%20%3D%20%22block%22%3B%0A%0A%20%20%20%20%20%20if%20%28%21w3c%5Fslidy%2Ens%5Fpos%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%2F%2F%20adjust%20position%20to%20allow%20for%20scrolling%0A%20%20%20%20%20%20%20%20var%20xoffset%20%3D%20w3c%5Fslidy%2Escroll%5Fx%5Foffset%28%29%3B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Etoolbar%2Estyle%2Eleft%20%3D%20xoffset%3B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Etoolbar%2Estyle%2Eright%20%3D%20xoffset%3B%0A%0A%20%20%20%20%20%20%20%20%2F%2F%20determine%20vertical%20scroll%20offset%0A%20%20%20%20%20%20%20%20%2F%2Fvar%20yoffset%20%3D%20scrollYOffset%28%29%3B%0A%0A%20%20%20%20%20%20%20%20%2F%2F%20bottom%20is%20doc%20height%20%2D%20window%20height%20%2D%20scroll%20offset%0A%20%20%20%20%20%20%20%20%2F%2Fvar%20bottom%20%3D%20documentHeight%28%29%20%2D%20lastHeight%20%2D%20yoffset%0A%0A%20%20%20%20%20%20%20%20%2F%2Fif%20%28yoffset%20%3E%200%20%7C%7C%20documentHeight%28%29%20%3E%20lastHeight%29%0A%20%20%20%20%20%20%20%20%2F%2F%20%20%20bottom%20%2B%3D%2016%3B%20%20%2F%2F%20allow%20for%20height%20of%20scrollbar%0A%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Etoolbar%2Estyle%2Ebottom%20%3D%200%3B%20%2F%2Fbottom%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20w3c%5Fslidy%2Eremove%5Fclass%28w3c%5Fslidy%2Etoolbar%2C%20%22hidden%22%29%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20w3c%5Fslidy%2Escrollhack%20%3D%200%3B%0A%0A%0A%20%20%20%20%2F%2F%20set%20the%20keyboard%20focus%20to%20the%20help%20link%20on%20the%0A%20%20%20%20%2F%2F%20toolbar%20to%20ensure%20that%20document%20has%20the%20focus%0A%20%20%20%20%2F%2F%20IE%20doesn%27t%20always%20work%20with%20window%2Efocus%28%29%0A%20%20%20%20%2F%2F%20and%20this%20hack%20has%20benefit%20of%20Enter%20for%20help%0A%0A%20%20%20%20try%0A%20%20%20%20%7B%0A%20%20%20%20%20%20if%20%28%21w3c%5Fslidy%2Eopera%29%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eset%5Ffocus%28%29%3B%0A%20%20%20%20%7D%0A%20%20%20%20catch%20%28e%29%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%0A%2F%2F%20invoked%20via%20F%20key%0A%20%20toggle%5Ftoolbar%3A%20function%20%28%29%20%7B%0A%20%20%20%20if%20%28%21w3c%5Fslidy%2Eview%5Fall%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20if%20%28w3c%5Fslidy%2Ehas%5Fclass%28w3c%5Fslidy%2Etoolbar%2C%20%22hidden%22%29%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eremove%5Fclass%28w3c%5Fslidy%2Etoolbar%2C%20%22hidden%22%29%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Ewant%5Ftoolbar%20%3D%201%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20else%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eadd%5Fclass%28w3c%5Fslidy%2Etoolbar%2C%20%22hidden%22%29%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Ewant%5Ftoolbar%20%3D%200%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%0A%20%20scroll%5Fx%5Foffset%3A%20function%20%28%29%20%7B%0A%20%20%20%20if%20%28window%2EpageXOffset%29%0A%20%20%20%20%20%20return%20self%2EpageXOffset%3B%0A%0A%20%20%20%20if%20%28document%2EdocumentElement%20%26%26%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20document%2EdocumentElement%2EscrollLeft%29%0A%20%20%20%20%20%20return%20document%2EdocumentElement%2EscrollLeft%3B%0A%0A%20%20%20%20if%20%28document%2Ebody%29%0A%20%20%20%20%20%20return%20document%2Ebody%2EscrollLeft%3B%0A%0A%20%20%20%20return%200%3B%0A%20%20%7D%2C%0A%0A%20%20scroll%5Fy%5Foffset%3A%20function%20%28%29%20%7B%0A%20%20%20%20if%20%28window%2EpageYOffset%29%0A%20%20%20%20%20%20return%20self%2EpageYOffset%3B%0A%0A%20%20%20%20if%20%28document%2EdocumentElement%20%26%26%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20document%2EdocumentElement%2EscrollTop%29%0A%20%20%20%20%20%20return%20document%2EdocumentElement%2EscrollTop%3B%0A%0A%20%20%20%20if%20%28document%2Ebody%29%0A%20%20%20%20%20%20return%20document%2Ebody%2EscrollTop%3B%0A%0A%20%20%20%20return%200%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20looking%20for%20a%20way%20to%20determine%20height%20of%20slide%20content%0A%20%20%2F%2F%20the%20slide%20itself%20is%20set%20to%20the%20height%20of%20the%20window%0A%20%20optimize%5Ffont%5Fsize%3A%20function%20%28%29%20%7B%0A%20%20%20%20var%20slide%20%3D%20w3c%5Fslidy%2Eslides%5Bw3c%5Fslidy%2Eslide%5Fnumber%5D%3B%0A%0A%20%20%20%20%2F%2Fvar%20dh%20%3D%20documentHeight%28%29%3B%20%2F%2FgetDocHeight%28document%29%3B%0A%20%20%20%20var%20dh%20%3D%20slide%2EscrollHeight%3B%0A%20%20%20%20var%20wh%20%3D%20getWindowHeight%28%29%3B%0A%20%20%20%20var%20u%20%3D%20100%20%2A%20dh%20%2F%20wh%3B%0A%0A%20%20%20%20alert%28%22window%20utilization%20%3D%20%22%20%2B%20u%20%2B%20%22%25%20%28doc%20%22%0A%20%20%20%20%20%20%2B%20dh%20%2B%20%22%20win%20%22%20%2B%20wh%20%2B%20%22%29%22%29%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20from%20document%20object%0A%20%20get%5Fdoc%5Fheight%3A%20function%20%28doc%29%20%7B%0A%20%20%20%20if%20%28%21doc%29%0A%20%20%20%20%20%20doc%20%3D%20document%3B%0A%0A%20%20%20%20if%20%28doc%20%26%26%20doc%2Ebody%20%26%26%20doc%2Ebody%2EoffsetHeight%29%0A%20%20%20%20%20%20return%20doc%2Ebody%2EoffsetHeight%3B%20%20%2F%2F%20ns%2Fgecko%20syntax%0A%0A%20%20%20%20if%20%28doc%20%26%26%20doc%2Ebody%20%26%26%20doc%2Ebody%2EscrollHeight%29%0A%20%20%20%20%20%20return%20doc%2Ebody%2EscrollHeight%3B%0A%0A%20%20%20%20alert%28%22couldn%27t%20determine%20document%20height%22%29%3B%0A%20%20%7D%2C%0A%0A%20%20get%5Fwindow%5Fheight%3A%20function%20%28%29%20%7B%0A%20%20%20%20if%20%28%20typeof%28%20window%2EinnerHeight%20%29%20%3D%3D%20%27number%27%20%29%0A%20%20%20%20%20%20return%20window%2EinnerHeight%3B%20%20%2F%2F%20Non%20IE%20browser%0A%0A%20%20%20%20if%20%28document%2EdocumentElement%20%26%26%20document%2EdocumentElement%2EclientHeight%29%0A%20%20%20%20%20%20return%20document%2EdocumentElement%2EclientHeight%3B%20%20%2F%2F%20IE6%0A%0A%20%20%20%20if%20%28document%2Ebody%20%26%26%20document%2Ebody%2EclientHeight%29%0A%20%20%20%20%20%20return%20document%2Ebody%2EclientHeight%3B%20%2F%2F%20IE4%0A%20%20%7D%2C%0A%0A%20%20document%5Fheight%3A%20function%20%28%29%20%7B%0A%20%20%20%20var%20sh%2C%20oh%3B%0A%0A%20%20%20%20sh%20%3D%20document%2Ebody%2EscrollHeight%3B%0A%20%20%20%20oh%20%3D%20document%2Ebody%2EoffsetHeight%3B%0A%0A%20%20%20%20if%20%28sh%20%26%26%20oh%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20return%20%28sh%20%3E%20oh%20%3F%20sh%20%3A%20oh%29%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F%2F%20no%20idea%21%0A%20%20%20%20return%200%3B%0A%20%20%7D%2C%0A%0A%20%20smaller%3A%20function%20%28%29%20%7B%0A%20%20%20%20if%20%28w3c%5Fslidy%2Esize%5Findex%20%3E%200%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%2D%2Dw3c%5Fslidy%2Esize%5Findex%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20w3c%5Fslidy%2Etoolbar%2Estyle%2Edisplay%20%3D%20%22none%22%3B%0A%20%20%20%20document%2Ebody%2Estyle%2EfontSize%20%3D%20w3c%5Fslidy%2Esizes%5Bw3c%5Fslidy%2Esize%5Findex%5D%3B%0A%20%20%20%20var%20slide%20%3D%20w3c%5Fslidy%2Eslides%5Bw3c%5Fslidy%2Eslide%5Fnumber%5D%3B%0A%20%20%20%20w3c%5Fslidy%2Ehide%5Fslide%28slide%29%3B%0A%20%20%20%20w3c%5Fslidy%2Eshow%5Fslide%28slide%29%3B%0A%20%20%20%20setTimeout%28function%20%28%29%20%7Bw3c%5Fslidy%2Eshow%5Ftoolbar%28%29%3B%20%7D%2C%2050%29%3B%0A%20%20%7D%2C%0A%0A%20%20bigger%3A%20function%20%28%29%20%7B%0A%20%20%20%20if%20%28w3c%5Fslidy%2Esize%5Findex%20%3C%20w3c%5Fslidy%2Esizes%2Elength%20%2D%201%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%2B%2Bw3c%5Fslidy%2Esize%5Findex%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20w3c%5Fslidy%2Etoolbar%2Estyle%2Edisplay%20%3D%20%22none%22%3B%0A%20%20%20%20document%2Ebody%2Estyle%2EfontSize%20%3D%20w3c%5Fslidy%2Esizes%5Bw3c%5Fslidy%2Esize%5Findex%5D%3B%0A%20%20%20%20var%20slide%20%3D%20w3c%5Fslidy%2Eslides%5Bw3c%5Fslidy%2Eslide%5Fnumber%5D%3B%0A%20%20%20%20w3c%5Fslidy%2Ehide%5Fslide%28slide%29%3B%0A%20%20%20%20w3c%5Fslidy%2Eshow%5Fslide%28slide%29%3B%0A%20%20%20%20setTimeout%28function%20%28%29%20%7Bw3c%5Fslidy%2Eshow%5Ftoolbar%28%29%3B%20%7D%2C%2050%29%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20enables%20cross%20browser%20use%20of%20relative%20width%2Fheight%0A%20%20%2F%2F%20on%20object%20elements%20for%20use%20with%20SVG%20and%20Flash%20media%0A%20%20%2F%2F%20with%20thanks%20to%20Ivan%20Herman%20for%20the%20suggestion%0A%20%20adjust%5Fobject%5Fdimensions%3A%20function%20%28width%2C%20height%29%20%7B%0A%20%20%20%20for%28%20var%20i%20%3D%200%3B%20i%20%3C%20w3c%5Fslidy%2Eobjects%2Elength%3B%20i%2B%2B%20%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20var%20obj%20%3D%20this%2Eobjects%5Bi%5D%3B%0A%20%20%20%20%20%20var%20mimeType%20%3D%20obj%2EgetAttribute%28%22type%22%29%3B%0A%0A%20%20%20%20%20%20if%20%28mimeType%20%3D%3D%20%22image%2Fsvg%2Bxml%22%20%7C%7C%20mimeType%20%3D%3D%20%22application%2Fx%2Dshockwave%2Dflash%22%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20if%20%28%20%21obj%2EinitialWidth%20%29%20%0A%20%20%20%20%20%20%20%20%20%20obj%2EinitialWidth%20%3D%20obj%2EgetAttribute%28%22width%22%29%3B%0A%0A%20%20%20%20%20%20%20%20if%20%28%20%21obj%2EinitialHeight%20%29%20%0A%20%20%20%20%20%20%20%20%20%20obj%2EinitialHeight%20%3D%20obj%2EgetAttribute%28%22height%22%29%3B%0A%0A%20%20%20%20%20%20%20%20if%20%28%20obj%2EinitialWidth%20%26%26%20obj%2EinitialWidth%2EcharAt%28obj%2EinitialWidth%2Elength%2D1%29%20%3D%3D%20%22%25%22%20%29%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20w%20%3D%20parseInt%28obj%2EinitialWidth%2Eslice%280%2C%20obj%2EinitialWidth%2Elength%2D1%29%29%3B%0A%20%20%20%20%20%20%20%20%20%20var%20newW%20%3D%20width%20%2A%20%28w%2F100%2E0%29%3B%0A%20%20%20%20%20%20%20%20%20%20obj%2EsetAttribute%28%22width%22%2CnewW%29%3B%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20if%20%28%20obj%2EinitialHeight%20%26%26%0A%20%20%20%20%20%20%20%20%20%20%20%20%20obj%2EinitialHeight%2EcharAt%28obj%2EinitialHeight%2Elength%2D1%29%20%3D%3D%20%22%25%22%20%29%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20h%20%3D%20parseInt%28obj%2EinitialHeight%2Eslice%280%2C%20obj%2EinitialHeight%2Elength%2D1%29%29%3B%0A%20%20%20%20%20%20%20%20%20%20var%20newH%20%3D%20height%20%2A%20%28h%2F100%2E0%29%3B%0A%20%20%20%20%20%20%20%20%20%20obj%2EsetAttribute%28%22height%22%2C%20newH%29%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20needed%20for%20Opera%20to%20inhibit%20default%20behavior%0A%20%20%2F%2F%20since%20Opera%20delivers%20keyPress%20even%20if%20keyDown%0A%20%20%2F%2F%20was%20cancelled%0A%20%20key%5Fpress%3A%20function%20%28event%29%20%7B%0A%20%20%20%20if%20%28%21event%29%0A%20%20%20%20%20%20event%20%3D%20window%2Eevent%3B%0A%0A%20%20%20%20if%20%28%21w3c%5Fslidy%2Ekey%5Fwanted%29%0A%20%20%20%20%20%20return%20w3c%5Fslidy%2Ecancel%28event%29%3B%0A%0A%20%20%20%20return%20true%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20%20See%20e%2Eg%2E%20http%3A%2F%2Fwww%2Equirksmode%2Eorg%2Fjs%2Fevents%2Fkeys%2Ehtml%20for%20keycodes%0A%20%20key%5Fdown%3A%20function%20%28event%29%20%7B%0A%20%20%20%20var%20key%2C%20target%2C%20tag%3B%0A%0A%20%20%20%20w3c%5Fslidy%2Ekey%5Fwanted%20%3D%20true%3B%0A%0A%20%20%20%20if%20%28%21event%29%0A%20%20%20%20%20%20event%20%3D%20window%2Eevent%3B%0A%0A%20%20%20%20%2F%2F%20kludge%20around%20NS%2FIE%20differences%20%0A%20%20%20%20if%20%28window%2Eevent%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20key%20%3D%20window%2Eevent%2EkeyCode%3B%0A%20%20%20%20%20%20target%20%3D%20window%2Eevent%2EsrcElement%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20if%20%28event%2Ewhich%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20key%20%3D%20event%2Ewhich%3B%0A%20%20%20%20%20%20target%20%3D%20event%2Etarget%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%0A%20%20%20%20%20%20return%20true%3B%20%2F%2F%20Yikes%21%20unknown%20browser%0A%0A%20%20%20%20%2F%2F%20ignore%20event%20if%20key%20value%20is%20zero%0A%20%20%20%20%2F%2F%20as%20for%20alt%20on%20Opera%20and%20Konqueror%0A%20%20%20%20if%20%28%21key%29%0A%20%20%20%20%20%20%20return%20true%3B%0A%0A%20%20%20%20%2F%2F%20avoid%20interfering%20with%20keystroke%0A%20%20%20%20%2F%2F%20behavior%20for%20non%2Dslidy%20chrome%20elements%0A%20%20%20%20if%20%28%21w3c%5Fslidy%2Eslidy%5Fchrome%28target%29%20%26%26%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Especial%5Felement%28target%29%29%0A%20%20%20%20%20%20return%20true%3B%0A%0A%20%20%20%20%2F%2F%20check%20for%20concurrent%20control%2Fcommand%2Falt%20key%0A%20%20%20%20%2F%2F%20but%20are%20these%20only%20present%20on%20mouse%20events%3F%0A%0A%20%20%20%20if%20%28event%2EctrlKey%20%7C%7C%20event%2EaltKey%20%7C%7C%20event%2EmetaKey%29%0A%20%20%20%20%20%20%20return%20true%3B%0A%0A%20%20%20%20%2F%2F%20dismiss%20table%20of%20contents%20if%20visible%0A%20%20%20%20if%20%28w3c%5Fslidy%2Eis%5Fshown%5Ftoc%28%29%20%26%26%20key%20%21%3D%209%20%26%26%20key%20%21%3D%2016%20%26%26%20key%20%21%3D%2038%20%26%26%20key%20%21%3D%2040%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20w3c%5Fslidy%2Ehide%5Ftable%5Fof%5Fcontents%28true%29%3B%0A%0A%20%20%20%20%20%20if%20%28key%20%3D%3D%2027%20%7C%7C%20key%20%3D%3D%2084%20%7C%7C%20key%20%3D%3D%2067%29%0A%20%20%20%20%20%20%20%20return%20w3c%5Fslidy%2Ecancel%28event%29%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20if%20%28key%20%3D%3D%2034%29%20%2F%2F%20Page%20Down%0A%20%20%20%20%7B%0A%20%20%20%20%20%20if%20%28w3c%5Fslidy%2Eview%5Fall%29%0A%20%20%20%20%20%20%20%20return%20true%3B%0A%0A%20%20%20%20%20%20w3c%5Fslidy%2Enext%5Fslide%28false%29%3B%0A%20%20%20%20%20%20return%20w3c%5Fslidy%2Ecancel%28event%29%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20if%20%28key%20%3D%3D%2033%29%20%2F%2F%20Page%20Up%0A%20%20%20%20%7B%0A%20%20%20%20%20%20if%20%28w3c%5Fslidy%2Eview%5Fall%29%0A%20%20%20%20%20%20%20%20return%20true%3B%0A%0A%20%20%20%20%20%20w3c%5Fslidy%2Eprevious%5Fslide%28false%29%3B%0A%20%20%20%20%20%20return%20w3c%5Fslidy%2Ecancel%28event%29%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20if%20%28key%20%3D%3D%2032%29%20%2F%2F%20space%20bar%0A%20%20%20%20%7B%0A%20%20%20%20%20%20w3c%5Fslidy%2Enext%5Fslide%28true%29%3B%0A%20%20%20%20%20%20return%20w3c%5Fslidy%2Ecancel%28event%29%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20if%20%28key%20%3D%3D%2037%29%20%2F%2F%20Left%20arrow%0A%20%20%20%20%7B%0A%20%20%20%20%20%20w3c%5Fslidy%2Eprevious%5Fslide%28%21event%2EshiftKey%29%3B%0A%20%20%20%20%20%20return%20w3c%5Fslidy%2Ecancel%28event%29%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20if%20%28key%20%3D%3D%2036%29%20%2F%2F%20Home%0A%20%20%20%20%7B%0A%20%20%20%20%20%20w3c%5Fslidy%2Efirst%5Fslide%28%29%3B%0A%20%20%20%20%20%20return%20w3c%5Fslidy%2Ecancel%28event%29%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20if%20%28key%20%3D%3D%2035%29%20%2F%2F%20End%0A%20%20%20%20%7B%0A%20%20%20%20%20%20w3c%5Fslidy%2Elast%5Fslide%28%29%3B%0A%20%20%20%20%20%20return%20w3c%5Fslidy%2Ecancel%28event%29%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20if%20%28key%20%3D%3D%2039%29%20%2F%2F%20Right%20arrow%0A%20%20%20%20%7B%0A%20%20%20%20%20%20w3c%5Fslidy%2Enext%5Fslide%28%21event%2EshiftKey%29%3B%0A%20%20%20%20%20%20return%20w3c%5Fslidy%2Ecancel%28event%29%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20if%20%28key%20%3D%3D%2013%29%20%2F%2F%20Enter%0A%20%20%20%20%7B%0A%20%20%20%20%20%20if%20%28w3c%5Fslidy%2Eoutline%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20if%20%28w3c%5Fslidy%2Eoutline%2Evisible%29%0A%20%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Efold%28w3c%5Fslidy%2Eoutline%29%3B%0A%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eunfold%28w3c%5Fslidy%2Eoutline%29%3B%0A%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20return%20w3c%5Fslidy%2Ecancel%28event%29%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%20%20else%20if%20%28key%20%3D%3D%20188%29%20%20%2F%2F%20%3C%20for%20smaller%20fonts%0A%20%20%20%20%7B%0A%20%20%20%20%20%20w3c%5Fslidy%2Esmaller%28%29%3B%0A%20%20%20%20%20%20return%20w3c%5Fslidy%2Ecancel%28event%29%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20if%20%28key%20%3D%3D%20190%29%20%20%2F%2F%20%3E%20for%20larger%20fonts%0A%20%20%20%20%7B%0A%20%20%20%20%20%20w3c%5Fslidy%2Ebigger%28%29%3B%0A%20%20%20%20%20%20return%20w3c%5Fslidy%2Ecancel%28event%29%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20if%20%28key%20%3D%3D%20189%20%7C%7C%20key%20%3D%3D%20109%29%20%20%2F%2F%20%2D%20for%20smaller%20fonts%0A%20%20%20%20%7B%0A%20%20%20%20%20%20w3c%5Fslidy%2Esmaller%28%29%3B%0A%20%20%20%20%20%20return%20w3c%5Fslidy%2Ecancel%28event%29%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20if%20%28key%20%3D%3D%20187%20%7C%7C%20key%20%3D%3D%20191%20%7C%7C%20key%20%3D%3D%20107%29%20%20%2F%2F%20%3D%20%2B%20%20for%20larger%20fonts%0A%20%20%20%20%7B%0A%20%20%20%20%20%20w3c%5Fslidy%2Ebigger%28%29%3B%0A%20%20%20%20%20%20return%20w3c%5Fslidy%2Ecancel%28event%29%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20if%20%28key%20%3D%3D%2083%29%20%20%2F%2F%20S%20for%20smaller%20fonts%0A%20%20%20%20%7B%0A%20%20%20%20%20%20w3c%5Fslidy%2Esmaller%28%29%3B%0A%20%20%20%20%20%20return%20w3c%5Fslidy%2Ecancel%28event%29%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20if%20%28key%20%3D%3D%2066%29%20%20%2F%2F%20B%20for%20larger%20fonts%0A%20%20%20%20%7B%0A%20%20%20%20%20%20w3c%5Fslidy%2Ebigger%28%29%3B%0A%20%20%20%20%20%20return%20w3c%5Fslidy%2Ecancel%28event%29%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20if%20%28key%20%3D%3D%2090%29%20%20%2F%2F%20Z%20for%20last%20slide%0A%20%20%20%20%7B%0A%20%20%20%20%20%20w3c%5Fslidy%2Elast%5Fslide%28%29%3B%0A%20%20%20%20%20%20return%20w3c%5Fslidy%2Ecancel%28event%29%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20if%20%28key%20%3D%3D%2070%29%20%20%2F%2F%20F%20for%20toggle%20toolbar%0A%20%20%20%20%7B%0A%20%20%20%20%20%20w3c%5Fslidy%2Etoggle%5Ftoolbar%28%29%3B%0A%20%20%20%20%20%20return%20w3c%5Fslidy%2Ecancel%28event%29%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20if%20%28key%20%3D%3D%2065%29%20%20%2F%2F%20A%20for%20toggle%20view%20single%2Fall%20slides%0A%20%20%20%20%7B%0A%20%20%20%20%20%20w3c%5Fslidy%2Etoggle%5Fview%28%29%3B%0A%20%20%20%20%20%20return%20w3c%5Fslidy%2Ecancel%28event%29%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20if%20%28key%20%3D%3D%2075%29%20%20%2F%2F%20toggle%20action%20of%20left%20click%20for%20next%20page%0A%20%20%20%20%7B%0A%20%20%20%20%20%20w3c%5Fslidy%2Emouse%5Fclick%5Fenabled%20%3D%20%21w3c%5Fslidy%2Emouse%5Fclick%5Fenabled%3B%0A%20%20%20%20%20%20var%20alert%5Fmsg%20%3D%20%28w3c%5Fslidy%2Emouse%5Fclick%5Fenabled%20%3F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22enabled%22%20%3A%20%22disabled%22%29%20%2B%20%20%22%20mouse%20click%20advance%22%3B%0A%0A%20%20%20%20%20%20alert%28w3c%5Fslidy%2Elocalize%28alert%5Fmsg%29%29%3B%0A%20%20%20%20%20%20return%20w3c%5Fslidy%2Ecancel%28event%29%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20if%20%28key%20%3D%3D%2084%20%7C%7C%20key%20%3D%3D%2067%29%20%20%2F%2F%20T%20or%20C%20for%20table%20of%20contents%0A%20%20%20%20%7B%0A%20%20%20%20%20%20if%20%28w3c%5Fslidy%2Etoc%29%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Etoggle%5Ftable%5Fof%5Fcontents%28%29%3B%0A%0A%20%20%20%20%20%20return%20w3c%5Fslidy%2Ecancel%28event%29%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20if%20%28key%20%3D%3D%2072%29%20%2F%2F%20H%20for%20help%0A%20%20%20%20%7B%0A%20%20%20%20%20%20window%2Elocation%20%3D%20w3c%5Fslidy%2Ehelp%5Fpage%3B%0A%20%20%20%20%20%20return%20w3c%5Fslidy%2Ecancel%28event%29%3B%0A%20%20%20%20%7D%0A%20%20%20%20%2F%2Felse%20alert%28%22key%20code%20is%20%22%2B%20key%29%3B%0A%0A%20%20%20%20return%20true%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20safe%20for%20both%20text%2Fhtml%20and%20application%2Fxhtml%2Bxml%0A%20%20create%5Felement%3A%20function%20%28name%29%20%7B%0A%20%20%20%20if%20%28this%2Exhtml%20%26%26%20%28typeof%20document%2EcreateElementNS%20%21%3D%20%27undefined%27%29%29%0A%20%20%20%20%20%20return%20document%2EcreateElementNS%28%22http%3A%2F%2Fwww%2Ew3%2Eorg%2F1999%2Fxhtml%22%2C%20name%29%0A%0A%20%20%20%20return%20document%2EcreateElement%28name%29%3B%0A%20%20%7D%2C%0A%0A%20%20get%5Felement%5Fstyle%3A%20function%20%28elem%2C%20IEStyleProp%2C%20CSSStyleProp%29%20%7B%0A%20%20%20%20if%20%28elem%2EcurrentStyle%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20return%20elem%2EcurrentStyle%5BIEStyleProp%5D%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20if%20%28window%2EgetComputedStyle%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20var%20compStyle%20%3D%20window%2EgetComputedStyle%28elem%2C%20%22%22%29%3B%0A%20%20%20%20%20%20return%20compStyle%2EgetPropertyValue%28CSSStyleProp%29%3B%0A%20%20%20%20%7D%0A%20%20%20%20return%20%22%22%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20the%20string%20str%20is%20a%20whitespace%20separated%20list%20of%20tokens%0A%20%20%2F%2F%20test%20if%20str%20contains%20a%20particular%20token%2C%20e%2Eg%2E%20%22slide%22%0A%20%20has%5Ftoken%3A%20function%20%28str%2C%20token%29%20%7B%0A%20%20%20%20if%20%28str%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%2F%2F%20define%20pattern%20as%20regular%20expression%0A%20%20%20%20%20%20var%20pattern%20%3D%20%2F%5Cw%2B%2Fg%3B%0A%0A%20%20%20%20%20%20%2F%2F%20check%20for%20matches%0A%20%20%20%20%20%20%2F%2F%20place%20result%20in%20array%0A%20%20%20%20%20%20var%20result%20%3D%20str%2Ematch%28pattern%29%3B%0A%0A%20%20%20%20%20%20%2F%2F%20now%20check%20if%20desired%20token%20is%20present%0A%20%20%20%20%20%20for%20%28var%20i%20%3D%200%3B%20i%20%3C%20result%2Elength%3B%20i%2B%2B%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20if%20%28result%5Bi%5D%20%3D%3D%20token%29%0A%20%20%20%20%20%20%20%20%20%20return%20true%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%0A%20%20%20%20return%20false%3B%0A%20%20%7D%2C%0A%0A%20%20get%5Fclass%5Flist%3A%20function%20%28element%29%20%7B%0A%20%20%20%20if%20%28typeof%20element%2EclassName%20%21%3D%20%27undefined%27%29%0A%20%20%20%20%20%20return%20element%2EclassName%3B%0A%0A%20%20%20%20return%20element%2EgetAttribute%28%22class%22%29%3B%0A%20%20%7D%2C%0A%0A%20%20has%5Fclass%3A%20function%20%28element%2C%20name%29%20%7B%0A%20%20%20%20if%20%28element%2EnodeType%20%21%3D%201%29%0A%20%20%20%20%20%20return%20false%3B%0A%0A%20%20%20%20var%20regexp%20%3D%20new%20RegExp%28%22%28%5E%7C%20%29%22%20%2B%20name%20%2B%20%22%5CW%2A%22%29%3B%0A%0A%20%20%20%20if%20%28typeof%20element%2EclassName%20%21%3D%20%27undefined%27%29%0A%20%20%20%20%20%20return%20regexp%2Etest%28element%2EclassName%29%3B%0A%0A%20%20%20%20return%20regexp%2Etest%28element%2EgetAttribute%28%22class%22%29%29%3B%0A%20%20%7D%2C%0A%0A%20%20remove%5Fclass%3A%20function%20%28element%2C%20name%29%20%7B%0A%20%20%20%20var%20regexp%20%3D%20new%20RegExp%28%22%28%5E%7C%20%29%22%20%2B%20name%20%2B%20%22%5CW%2A%22%29%3B%0A%20%20%20%20var%20clsval%20%3D%20%22%22%3B%0A%0A%20%20%20%20if%20%28typeof%20element%2EclassName%20%21%3D%20%27undefined%27%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20clsval%20%3D%20element%2EclassName%3B%0A%0A%20%20%20%20%20%20if%20%28clsval%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20clsval%20%3D%20clsval%2Ereplace%28regexp%2C%20%22%22%29%3B%0A%20%20%20%20%20%20%20%20element%2EclassName%20%3D%20clsval%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%20%20else%0A%20%20%20%20%7B%0A%20%20%20%20%20%20clsval%20%3D%20element%2EgetAttribute%28%22class%22%29%3B%0A%0A%20%20%20%20%20%20if%20%28clsval%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20clsval%20%3D%20clsval%2Ereplace%28regexp%2C%20%22%22%29%3B%0A%20%20%20%20%20%20%20%20element%2EsetAttribute%28%22class%22%2C%20clsval%29%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%0A%20%20add%5Fclass%3A%20function%20%28element%2C%20name%29%20%7B%0A%20%20%20%20if%20%28%21this%2Ehas%5Fclass%28element%2C%20name%29%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20if%20%28typeof%20element%2EclassName%20%21%3D%20%27undefined%27%29%0A%20%20%20%20%20%20%20%20element%2EclassName%20%2B%3D%20%22%20%22%20%2B%20name%3B%0A%20%20%20%20%20%20else%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20var%20clsval%20%3D%20element%2EgetAttribute%28%22class%22%29%3B%0A%20%20%20%20%20%20%20%20clsval%20%3D%20clsval%20%3F%20clsval%20%2B%20%22%20%22%20%2B%20name%20%3A%20name%3B%0A%20%20%20%20%20%20%20%20element%2EsetAttribute%28%22class%22%2C%20clsval%29%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20HTML%20elements%20that%20can%20be%20used%20with%20class%3D%22incremental%22%0A%20%20%2F%2F%20note%20that%20you%20can%20also%20put%20the%20class%20on%20containers%20like%0A%20%20%2F%2F%20up%2C%20ol%2C%20dl%2C%20and%20div%20to%20make%20their%20contents%20appear%0A%20%20%2F%2F%20incrementally%2E%20Upper%20case%20is%20used%20since%20this%20is%20what%0A%20%20%2F%2F%20browsers%20report%20for%20HTML%20node%20names%20%28text%2Fhtml%29%2E%0A%20%20incremental%5Felements%3A%20null%2C%0A%20%20okay%5Ffor%5Fincremental%3A%20function%20%28name%29%20%7B%0A%20%20%20%20if%20%28%21this%2Eincremental%5Felements%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20var%20inclist%20%3D%20new%20Array%28%29%3B%0A%20%20%20%20%20%20inclist%5B%22p%22%5D%20%3D%20true%3B%0A%20%20%20%20%20%20inclist%5B%22pre%22%5D%20%3D%20true%3B%0A%20%20%20%20%20%20inclist%5B%22li%22%5D%20%3D%20true%3B%0A%20%20%20%20%20%20inclist%5B%22blockquote%22%5D%20%3D%20true%3B%0A%20%20%20%20%20%20inclist%5B%22dt%22%5D%20%3D%20true%3B%0A%20%20%20%20%20%20inclist%5B%22dd%22%5D%20%3D%20true%3B%0A%20%20%20%20%20%20inclist%5B%22h2%22%5D%20%3D%20true%3B%0A%20%20%20%20%20%20inclist%5B%22h3%22%5D%20%3D%20true%3B%0A%20%20%20%20%20%20inclist%5B%22h4%22%5D%20%3D%20true%3B%0A%20%20%20%20%20%20inclist%5B%22h5%22%5D%20%3D%20true%3B%0A%20%20%20%20%20%20inclist%5B%22h6%22%5D%20%3D%20true%3B%0A%20%20%20%20%20%20inclist%5B%22span%22%5D%20%3D%20true%3B%0A%20%20%20%20%20%20inclist%5B%22address%22%5D%20%3D%20true%3B%0A%20%20%20%20%20%20inclist%5B%22table%22%5D%20%3D%20true%3B%0A%20%20%20%20%20%20inclist%5B%22tr%22%5D%20%3D%20true%3B%0A%20%20%20%20%20%20inclist%5B%22th%22%5D%20%3D%20true%3B%0A%20%20%20%20%20%20inclist%5B%22td%22%5D%20%3D%20true%3B%0A%20%20%20%20%20%20inclist%5B%22img%22%5D%20%3D%20true%3B%0A%20%20%20%20%20%20inclist%5B%22object%22%5D%20%3D%20true%3B%0A%20%20%20%20%20%20this%2Eincremental%5Felements%20%3D%20inclist%3B%0A%20%20%20%20%7D%0A%20%20%20%20return%20this%2Eincremental%5Felements%5Bname%2EtoLowerCase%28%29%5D%3B%0A%20%20%7D%2C%0A%0A%20%20next%5Fincremental%5Fitem%3A%20function%20%28node%29%20%7B%0A%20%20%20%20var%20br%20%3D%20this%2Eis%5Fxhtml%20%3F%20%22br%22%20%3A%20%22BR%22%3B%0A%20%20%20%20var%20slide%20%3D%20w3c%5Fslidy%2Eslides%5Bw3c%5Fslidy%2Eslide%5Fnumber%5D%3B%0A%0A%20%20%20%20for%20%28%3B%3B%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20node%20%3D%20w3c%5Fslidy%2Enext%5Fnode%28slide%2C%20node%29%3B%0A%0A%20%20%20%20%20%20if%20%28node%20%3D%3D%20null%20%7C%7C%20node%2EparentNode%20%3D%3D%20null%29%0A%20%20%20%20%20%20%20%20break%3B%0A%0A%20%20%20%20%20%20if%20%28node%2EnodeType%20%3D%3D%201%29%20%20%2F%2F%20ELEMENT%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20if%20%28node%2EnodeName%20%3D%3D%20br%29%0A%20%20%20%20%20%20%20%20%20%20continue%3B%0A%0A%20%20%20%20%20%20%20%20if%20%28w3c%5Fslidy%2Ehas%5Fclass%28node%2C%20%22incremental%22%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%26%26%20w3c%5Fslidy%2Eokay%5Ffor%5Fincremental%28node%2EnodeName%29%29%0A%20%20%20%20%20%20%20%20%20%20return%20node%3B%0A%0A%20%20%20%20%20%20%20%20if%20%28w3c%5Fslidy%2Ehas%5Fclass%28node%2EparentNode%2C%20%22incremental%22%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%26%26%20%21w3c%5Fslidy%2Ehas%5Fclass%28node%2C%20%22non%2Dincremental%22%29%29%0A%20%20%20%20%20%20%20%20%20%20return%20node%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%0A%20%20%20%20return%20node%3B%0A%20%20%7D%2C%0A%0A%20%20previous%5Fincremental%5Fitem%3A%20function%20%28node%29%20%7B%0A%20%20%20%20var%20br%20%3D%20this%2Eis%5Fxhtml%20%3F%20%22br%22%20%3A%20%22BR%22%3B%0A%20%20%20%20var%20slide%20%3D%20w3c%5Fslidy%2Eslides%5Bw3c%5Fslidy%2Eslide%5Fnumber%5D%3B%0A%0A%20%20%20%20for%20%28%3B%3B%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20node%20%3D%20w3c%5Fslidy%2Eprevious%5Fnode%28slide%2C%20node%29%3B%0A%0A%20%20%20%20%20%20if%20%28node%20%3D%3D%20null%20%7C%7C%20node%2EparentNode%20%3D%3D%20null%29%0A%20%20%20%20%20%20%20%20break%3B%0A%0A%20%20%20%20%20%20if%20%28node%2EnodeType%20%3D%3D%201%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20if%20%28node%2EnodeName%20%3D%3D%20br%29%0A%20%20%20%20%20%20%20%20%20%20continue%3B%0A%0A%20%20%20%20%20%20%20%20if%20%28w3c%5Fslidy%2Ehas%5Fclass%28node%2C%20%22incremental%22%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%26%26%20w3c%5Fslidy%2Eokay%5Ffor%5Fincremental%28node%2EnodeName%29%29%0A%20%20%20%20%20%20%20%20%20%20return%20node%3B%0A%0A%20%20%20%20%20%20%20%20if%20%28w3c%5Fslidy%2Ehas%5Fclass%28node%2EparentNode%2C%20%22incremental%22%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%26%26%20%21w3c%5Fslidy%2Ehas%5Fclass%28node%2C%20%22non%2Dincremental%22%29%29%0A%20%20%20%20%20%20%20%20%20%20return%20node%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%0A%20%20%20%20return%20node%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20set%20visibility%20for%20all%20elements%20on%20current%20slide%20with%0A%20%20%2F%2F%20a%20parent%20element%20with%20attribute%20class%3D%22incremental%22%0A%20%20set%5Fvisibility%5Fall%5Fincremental%3A%20function%20%28value%29%20%7B%0A%20%20%20%20var%20node%20%3D%20this%2Enext%5Fincremental%5Fitem%28null%29%3B%0A%0A%20%20%20%20if%20%28value%20%3D%3D%20%22hidden%22%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20while%20%28node%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eadd%5Fclass%28node%2C%20%22invisible%22%29%3B%0A%20%20%20%20%20%20%20%20node%20%3D%20w3c%5Fslidy%2Enext%5Fincremental%5Fitem%28node%29%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%20%20else%20%2F%2F%20value%20%3D%3D%20%22visible%22%0A%20%20%20%20%7B%0A%20%20%20%20%20%20while%20%28node%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20w3c%5Fslidy%2Eremove%5Fclass%28node%2C%20%22invisible%22%29%3B%0A%20%20%20%20%20%20%20%20node%20%3D%20w3c%5Fslidy%2Enext%5Fincremental%5Fitem%28node%29%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20reveal%20the%20next%20hidden%20item%20on%20the%20slide%0A%20%20%2F%2F%20node%20is%20null%20or%20the%20node%20that%20was%20last%20revealed%0A%20%20reveal%5Fnext%5Fitem%3A%20function%20%28node%29%20%7B%0A%20%20%20%20node%20%3D%20w3c%5Fslidy%2Enext%5Fincremental%5Fitem%28node%29%3B%0A%0A%20%20%20%20if%20%28node%20%26%26%20node%2EnodeType%20%3D%3D%201%29%20%20%2F%2F%20an%20element%0A%20%20%20%20%20%20w3c%5Fslidy%2Eremove%5Fclass%28node%2C%20%22invisible%22%29%3B%0A%0A%20%20%20%20return%20node%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20exact%20inverse%20of%20revealNextItem%28node%29%0A%20%20hide%5Fprevious%5Fitem%3A%20function%20%28node%29%20%7B%0A%20%20%20%20if%20%28node%20%26%26%20node%2EnodeType%20%3D%3D%201%29%20%20%2F%2F%20an%20element%0A%20%20%20%20%20%20w3c%5Fslidy%2Eadd%5Fclass%28node%2C%20%22invisible%22%29%3B%0A%0A%20%20%20%20return%20this%2Eprevious%5Fincremental%5Fitem%28node%29%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20left%20to%20right%20traversal%20of%20root%27s%20content%0A%20%20next%5Fnode%3A%20function%20%28root%2C%20node%29%20%7B%0A%20%20%20%20if%20%28node%20%3D%3D%20null%29%0A%20%20%20%20%20%20return%20root%2EfirstChild%3B%0A%0A%20%20%20%20if%20%28node%2EfirstChild%29%0A%20%20%20%20%20%20return%20node%2EfirstChild%3B%0A%0A%20%20%20%20if%20%28node%2EnextSibling%29%0A%20%20%20%20%20%20return%20node%2EnextSibling%3B%0A%0A%20%20%20%20for%20%28%3B%3B%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20node%20%3D%20node%2EparentNode%3B%0A%0A%20%20%20%20%20%20if%20%28%21node%20%7C%7C%20node%20%3D%3D%20root%29%0A%20%20%20%20%20%20%20%20break%3B%0A%0A%20%20%20%20%20%20if%20%28node%20%26%26%20node%2EnextSibling%29%0A%20%20%20%20%20%20%20%20return%20node%2EnextSibling%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20return%20null%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20right%20to%20left%20traversal%20of%20root%27s%20content%0A%20%20previous%5Fnode%3A%20function%20%28root%2C%20node%29%20%7B%0A%20%20%20%20if%20%28node%20%3D%3D%20null%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20node%20%3D%20root%2ElastChild%3B%0A%0A%20%20%20%20%20%20if%20%28node%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20while%20%28node%2ElastChild%29%0A%20%20%20%20%20%20%20%20%20%20node%20%3D%20node%2ElastChild%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20return%20node%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20if%20%28node%2EpreviousSibling%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20node%20%3D%20node%2EpreviousSibling%3B%0A%0A%20%20%20%20%20%20while%20%28node%2ElastChild%29%0A%20%20%20%20%20%20%20%20node%20%3D%20node%2ElastChild%3B%0A%0A%20%20%20%20%20%20return%20node%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20if%20%28node%2EparentNode%20%21%3D%20root%29%0A%20%20%20%20%20%20return%20node%2EparentNode%3B%0A%0A%20%20%20%20return%20null%3B%0A%20%20%7D%2C%0A%0A%20%20previous%5Fsibling%5Felement%3A%20function%20%28el%29%20%7B%0A%20%20%20%20el%20%3D%20el%2EpreviousSibling%3B%0A%0A%20%20%20%20while%20%28el%20%26%26%20el%2EnodeType%20%21%3D%201%29%0A%20%20%20%20%20%20el%20%3D%20el%2EpreviousSibling%3B%0A%0A%20%20%20%20return%20el%3B%0A%20%20%7D%2C%0A%0A%20%20next%5Fsibling%5Felement%3A%20function%20%28el%29%20%7B%0A%20%20%20%20el%20%3D%20el%2EnextSibling%3B%0A%0A%20%20%20%20while%20%28el%20%26%26%20el%2EnodeType%20%21%3D%201%29%0A%20%20%20%20%20%20el%20%3D%20el%2EnextSibling%3B%0A%0A%20%20%20%20return%20el%3B%0A%20%20%7D%2C%0A%0A%20%20first%5Fchild%5Felement%3A%20function%20%28el%29%20%7B%0A%20%20%20%20var%20node%3B%0A%0A%20%20%20%20for%20%28node%20%3D%20el%2EfirstChild%3B%20node%3B%20node%20%3D%20node%2EnextSibling%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20if%20%28node%2EnodeType%20%3D%3D%201%29%0A%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20return%20node%3B%0A%20%20%7D%2C%0A%0A%20%20first%5Ftag%3A%20function%20%28element%2C%20tag%29%20%7B%0A%20%20%20%20var%20node%3B%0A%0A%20%20%20%20if%20%28%21this%2Eis%5Fxhtml%29%0A%20%20%20%20%20%20tag%20%3D%20tag%2EtoUpperCase%28%29%3B%0A%0A%20%20%20%20for%20%28node%20%3D%20element%2EfirstChild%3B%20node%3B%20node%20%3D%20node%2EnextSibling%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20if%20%28node%2EnodeType%20%3D%3D%201%20%26%26%20node%2EnodeName%20%3D%3D%20tag%29%0A%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20return%20node%3B%0A%20%20%7D%2C%0A%0A%20%20hide%5Fselection%3A%20function%20%28%29%20%7B%0A%20%20%20%20if%20%28window%2EgetSelection%29%20%2F%2F%20Firefox%2C%20Chromium%2C%20Safari%2C%20Opera%0A%20%20%20%20%7B%0A%20%20%20%20%20%20var%20selection%20%3D%20window%2EgetSelection%28%29%3B%0A%0A%20%20%20%20%20%20if%20%28selection%2ErangeCount%20%3E%200%29%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20var%20range%20%3D%20selection%2EgetRangeAt%280%29%3B%0A%20%20%20%20%20%20%20%20range%2Ecollapse%20%28false%29%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%20%20else%20%2F%2F%20Internet%20Explorer%0A%20%20%20%20%7B%0A%20%20%20%20%20%20var%20textRange%20%3D%20document%2Eselection%2EcreateRange%20%28%29%3B%0A%20%20%20%20%20%20textRange%2Ecollapse%20%28false%29%3B%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%0A%20%20get%5Fselected%5Ftext%3A%20function%20%28%29%20%7B%0A%20%20%20%20try%0A%20%20%20%20%7B%0A%20%20%20%20%20%20if%20%28window%2EgetSelection%29%0A%20%20%20%20%20%20%20%20return%20window%2EgetSelection%28%29%2EtoString%28%29%3B%0A%0A%20%20%20%20%20%20if%20%28document%2EgetSelection%29%0A%20%20%20%20%20%20%20%20return%20document%2EgetSelection%28%29%2EtoString%28%29%3B%0A%0A%20%20%20%20%20%20if%20%28document%2Eselection%29%0A%20%20%20%20%20%20%20%20return%20document%2Eselection%2EcreateRange%28%29%2Etext%3B%0A%20%20%20%20%7D%0A%20%20%20%20catch%20%28e%29%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%0A%20%20%20%20return%20%22%22%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20make%20note%20of%20length%20of%20selected%20text%0A%20%20%2F%2F%20as%20this%20evaluates%20to%20zero%20in%20click%20event%0A%20%20mouse%5Fbutton%5Fup%3A%20function%20%28e%29%20%7B%0A%20%20%20%20w3c%5Fslidy%2Eselected%5Ftext%5Flen%20%3D%20w3c%5Fslidy%2Eget%5Fselected%5Ftext%28%29%2Elength%3B%0A%20%20%7D%2C%0A%0A%20%20mouse%5Fbutton%5Fdown%3A%20function%20%28e%29%20%7B%0A%20%20%20%20w3c%5Fslidy%2Eselected%5Ftext%5Flen%20%3D%20w3c%5Fslidy%2Eget%5Fselected%5Ftext%28%29%2Elength%3B%0A%20%20%20%20w3c%5Fslidy%2Emouse%5Fx%20%3D%20e%2EclientX%3B%0A%20%20%20%20w3c%5Fslidy%2Emouse%5Fy%20%3D%20e%2EclientY%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20right%20mouse%20button%20click%20is%20reserved%20for%20context%20menus%0A%20%20%2F%2F%20it%20is%20more%20reliable%20to%20detect%20rightclick%20than%20leftclick%0A%20%20mouse%5Fbutton%5Fclick%3A%20function%20%28e%29%20%7B%0A%20%20%20%20if%20%28%21e%29%0A%20%20%20%20%20%20var%20e%20%3D%20window%2Eevent%3B%0A%0A%20%20%20%20if%20%28Math%2Eabs%28e%2EclientX%20%2Dw3c%5Fslidy%2Emouse%5Fx%29%20%2B%0A%20%20%20%20%20%20%20%20Math%2Eabs%28e%2EclientY%20%2Dw3c%5Fslidy%2Emouse%5Fy%29%20%3E%2010%29%0A%20%20%20%20%20%20return%20true%3B%0A%0A%20%20%20%20if%20%28w3c%5Fslidy%2Eselected%5Ftext%5Flen%20%3E%200%29%0A%20%20%20%20%20%20return%20true%3B%0A%0A%20%20%20%20var%20rightclick%20%3D%20false%3B%0A%20%20%20%20var%20leftclick%20%3D%20false%3B%0A%20%20%20%20var%20middleclick%20%3D%20false%3B%0A%20%20%20%20var%20target%3B%0A%0A%20%20%20%20if%20%28%21e%29%0A%20%20%20%20%20%20var%20e%20%3D%20window%2Eevent%3B%0A%0A%20%20%20%20if%20%28e%2Etarget%29%0A%20%20%20%20%20%20target%20%3D%20e%2Etarget%3B%0A%20%20%20%20else%20if%20%28e%2EsrcElement%29%0A%20%20%20%20%20%20target%20%3D%20e%2EsrcElement%3B%0A%0A%20%20%20%20%2F%2F%20work%20around%20Safari%20bug%0A%20%20%20%20if%20%28target%2EnodeType%20%3D%3D%203%29%0A%20%20%20%20%20%20target%20%3D%20target%2EparentNode%3B%0A%0A%20%20%20%20if%20%28e%2Ewhich%29%20%2F%2F%20all%20browsers%20except%20IE%0A%20%20%20%20%7B%0A%20%20%20%20%20%20leftclick%20%3D%20%28e%2Ewhich%20%3D%3D%201%29%3B%0A%20%20%20%20%20%20middleclick%20%3D%20%28e%2Ewhich%20%3D%3D%202%29%3B%0A%20%20%20%20%20%20rightclick%20%3D%20%28e%2Ewhich%20%3D%3D%203%29%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20if%20%28e%2Ebutton%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%2F%2F%20Konqueror%20gives%201%20for%20left%2C%204%20for%20middle%0A%20%20%20%20%20%20%2F%2F%20IE6%20gives%200%20for%20left%20and%20not%201%20as%20I%20expected%0A%0A%20%20%20%20%20%20if%20%28e%2Ebutton%20%3D%3D%204%29%0A%20%20%20%20%20%20%20%20middleclick%20%3D%20true%3B%0A%0A%20%20%20%20%20%20%2F%2F%20all%20browsers%20agree%20on%202%20for%20right%20button%0A%20%20%20%20%20%20rightclick%20%3D%20%28e%2Ebutton%20%3D%3D%202%29%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%0A%20%20%20%20%20%20leftclick%20%3D%20true%3B%0A%0A%20%20%20%20if%20%28w3c%5Fslidy%2Eselected%5Ftext%5Flen%20%3E%200%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20w3c%5Fslidy%2Estop%5Fpropagation%28e%29%3B%0A%20%20%20%20%20%20e%2Ecancel%20%3D%20true%3B%0A%20%20%20%20%20%20e%2EreturnValue%20%3D%20false%3B%0A%20%20%20%20%20%20return%20false%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F%2F%20dismiss%20table%20of%20contents%0A%20%20%20%20w3c%5Fslidy%2Ehide%5Ftable%5Fof%5Fcontents%28false%29%3B%0A%0A%20%20%20%20%2F%2F%20check%20if%20target%20is%20something%20that%20probably%20want%27s%20clicks%0A%20%20%20%20%2F%2F%20e%2Eg%2E%20a%2C%20embed%2C%20object%2C%20input%2C%20textarea%2C%20select%2C%20option%0A%20%20%20%20var%20tag%20%3D%20target%2EnodeName%2EtoLowerCase%28%29%3B%0A%0A%20%20%20%20if%20%28w3c%5Fslidy%2Emouse%5Fclick%5Fenabled%20%26%26%20leftclick%20%26%26%0A%20%20%20%20%20%20%20%20%21w3c%5Fslidy%2Especial%5Felement%28target%29%20%26%26%0A%20%20%20%20%20%20%20%20%21target%2Eonclick%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20w3c%5Fslidy%2Enext%5Fslide%28true%29%3B%0A%20%20%20%20%20%20w3c%5Fslidy%2Estop%5Fpropagation%28e%29%3B%0A%20%20%20%20%20%20e%2Ecancel%20%3D%20true%3B%0A%20%20%20%20%20%20e%2EreturnValue%20%3D%20false%3B%0A%20%20%20%20%20%20return%20false%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20return%20true%3B%0A%20%20%7D%2C%0A%0A%20%20special%5Felement%3A%20function%20%28element%29%20%7B%0A%20%20%20%20if%20%28this%2Ehas%5Fclass%28element%2C%20%22non%2Dinteractive%22%29%29%0A%20%20%20%20%20%20return%20false%3B%0A%0A%20%20%20%20var%20tag%20%3D%20element%2EnodeName%2EtoLowerCase%28%29%3B%0A%0A%20%20%20%20return%20element%2Eonkeydown%20%7C%7C%0A%20%20%20%20%20%20element%2Eonclick%20%7C%7C%0A%20%20%20%20%20%20tag%20%3D%3D%20%22a%22%20%7C%7C%0A%20%20%20%20%20%20tag%20%3D%3D%20%22embed%22%20%7C%7C%0A%20%20%20%20%20%20tag%20%3D%3D%20%22object%22%20%7C%7C%0A%20%20%20%20%20%20tag%20%3D%3D%20%22video%22%20%7C%7C%0A%20%20%20%20%20%20tag%20%3D%3D%20%22audio%22%20%7C%7C%0A%20%20%20%20%20%20tag%20%3D%3D%20%22svg%22%20%7C%7C%0A%20%20%20%20%20%20tag%20%3D%3D%20%22canvas%22%20%7C%7C%0A%20%20%20%20%20%20tag%20%3D%3D%20%22input%22%20%7C%7C%0A%20%20%20%20%20%20tag%20%3D%3D%20%22textarea%22%20%7C%7C%0A%20%20%20%20%20%20tag%20%3D%3D%20%22select%22%20%7C%7C%0A%20%20%20%20%20%20tag%20%3D%3D%20%22option%22%3B%0A%20%20%7D%2C%0A%0A%20%20slidy%5Fchrome%3A%20function%20%28el%29%20%7B%0A%20%20%20%20while%20%28el%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20if%20%28el%20%3D%3D%20w3c%5Fslidy%2Etoc%20%7C%7C%0A%20%20%20%20%20%20%20%20%20%20el%20%3D%3D%20w3c%5Fslidy%2Etoolbar%20%7C%7C%0A%20%20%20%20%20%20%20%20%20%20w3c%5Fslidy%2Ehas%5Fclass%28el%2C%20%22outline%22%29%29%0A%20%20%20%20%20%20%20%20return%20true%3B%0A%0A%20%20%20%20%20%20el%20%3D%20el%2EparentNode%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20return%20false%3B%0A%20%20%7D%2C%0A%0A%20%20get%5Fkey%3A%20function%20%28e%29%0A%20%20%7B%0A%20%20%20%20var%20key%3B%0A%0A%20%20%20%20%2F%2F%20kludge%20around%20NS%2FIE%20differences%20%0A%20%20%20%20if%20%28typeof%20window%2Eevent%20%21%3D%20%22undefined%22%29%0A%20%20%20%20%20%20key%20%3D%20window%2Eevent%2EkeyCode%3B%0A%20%20%20%20else%20if%20%28e%2Ewhich%29%0A%20%20%20%20%20%20key%20%3D%20e%2Ewhich%3B%0A%0A%20%20%20%20return%20key%3B%0A%20%20%7D%2C%0A%0A%20%20get%5Ftarget%3A%20function%20%28e%29%20%7B%0A%20%20%20%20var%20target%3B%0A%0A%20%20%20%20if%20%28%21e%29%0A%20%20%20%20%20%20e%20%3D%20window%2Eevent%3B%0A%0A%20%20%20%20if%20%28e%2Etarget%29%0A%20%20%20%20%20%20target%20%3D%20e%2Etarget%3B%0A%20%20%20%20else%20if%20%28e%2EsrcElement%29%0A%20%20%20%20%20%20target%20%3D%20e%2EsrcElement%3B%0A%0A%20%20%20%20if%20%28target%2EnodeType%20%21%3D%201%29%0A%20%20%20%20%20%20target%20%3D%20target%2EparentNode%3B%0A%0A%20%20%20%20return%20target%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20does%20display%20property%20provide%20correct%20defaults%3F%0A%20%20is%5Fblock%3A%20function%20%28elem%29%20%7B%0A%20%20%20%20var%20tag%20%3D%20elem%2EnodeName%2EtoLowerCase%28%29%3B%0A%0A%20%20%20%20return%20tag%20%3D%3D%20%22ol%22%20%7C%7C%20tag%20%3D%3D%20%22ul%22%20%7C%7C%20tag%20%3D%3D%20%22p%22%20%7C%7C%20tag%20%3D%3D%20%22dl%22%20%7C%7C%0A%20%20%20%20%20%20%20%20%20%20%20tag%20%3D%3D%20%22li%22%20%7C%7C%20tag%20%3D%3D%20%22table%22%20%7C%7C%20tag%20%3D%3D%20%22pre%22%20%7C%7C%0A%20%20%20%20%20%20%20%20%20%20%20tag%20%3D%3D%20%22h1%22%20%7C%7C%20tag%20%3D%3D%20%22h2%22%20%7C%7C%20tag%20%3D%3D%20%22h3%22%20%7C%7C%0A%20%20%20%20%20%20%20%20%20%20%20tag%20%3D%3D%20%22h4%22%20%7C%7C%20tag%20%3D%3D%20%22h5%22%20%7C%7C%20tag%20%3D%3D%20%22h6%22%20%7C%7C%0A%20%20%20%20%20%20%20%20%20%20%20tag%20%3D%3D%20%22blockquote%22%20%7C%7C%20tag%20%3D%3D%20%22address%22%3B%20%0A%20%20%7D%2C%0A%0A%20%20add%5Flistener%3A%20function%20%28element%2C%20event%2C%20handler%29%20%7B%0A%20%20%20%20if%20%28window%2EaddEventListener%29%0A%20%20%20%20%20%20element%2EaddEventListener%28event%2C%20handler%2C%20false%29%3B%0A%20%20%20%20else%0A%20%20%20%20%20%20element%2EattachEvent%28%22on%22%2Bevent%2C%20handler%29%3B%0A%20%20%7D%2C%0A%0A%20%20%2F%2F%20used%20to%20prevent%20event%20propagation%20from%20field%20controls%0A%20%20stop%5Fpropagation%3A%20function%20%28event%29%20%7B%0A%20%20%20%20event%20%3D%20event%20%3F%20event%20%3A%20window%2Eevent%3B%0A%20%20%20%20event%2EcancelBubble%20%3D%20true%3B%20%20%2F%2F%20for%20IE%0A%0A%20%20%20%20if%20%28event%2EstopPropagation%29%0A%20%20%20%20%20%20event%2EstopPropagation%28%29%3B%0A%0A%20%20%20%20return%20true%3B%0A%20%20%7D%2C%0A%0A%20%20cancel%3A%20function%20%28event%29%20%7B%0A%20%20%20%20if%20%28event%29%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20event%2Ecancel%20%3D%20true%3B%0A%20%20%20%20%20%20%20event%2EreturnValue%20%3D%20false%3B%0A%0A%20%20%20%20%20%20if%20%28event%2EpreventDefault%29%0A%20%20%20%20%20%20%20%20event%2EpreventDefault%28%29%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20w3c%5Fslidy%2Ekey%5Fwanted%20%3D%20false%3B%0A%20%20%20%20return%20false%3B%0A%20%20%7D%2C%0A%0A%2F%2F%20for%20each%20language%20define%20an%20associative%20array%0A%2F%2F%20and%20also%20the%20help%20text%20which%20is%20longer%0A%0A%20%20strings%5Fes%3A%20%7B%0A%20%20%20%20%22slide%22%3A%22p%C3%A1g%2E%22%2C%0A%20%20%20%20%22help%3F%22%3A%22Ayuda%22%2C%0A%20%20%20%20%22contents%3F%22%3A%22%C3%8Dndice%22%2C%0A%20%20%20%20%22table%20of%20contents%22%3A%22tabla%20de%20contenidos%22%2C%0A%20%20%20%20%22Table%20of%20Contents%22%3A%22Tabla%20de%20Contenidos%22%2C%0A%20%20%20%20%22restart%20presentation%22%3A%22Reiniciar%20presentaci%C3%B3n%22%2C%0A%20%20%20%20%22restart%3F%22%3A%22Inicio%22%0A%20%20%7D%2C%0A%20%20help%5Fes%3A%0A%20%20%20%20%22Utilice%20el%20rat%C3%B3n%2C%20barra%20espaciadora%2C%20teclas%20Izda%2FDcha%2C%20%22%20%2B%0A%20%20%20%20%22o%20Re%20p%C3%A1g%20y%20Av%20p%C3%A1g%2E%20Use%20S%20y%20B%20para%20cambiar%20el%20tama%C3%B1o%20de%20fuente%2E%22%2C%0A%0A%20%20strings%5Fca%3A%20%7B%0A%20%20%20%20%22slide%22%3A%22p%C3%A0g%2E%2E%22%2C%0A%20%20%20%20%22help%3F%22%3A%22Ajuda%22%2C%0A%20%20%20%20%22contents%3F%22%3A%22%C3%8Dndex%22%2C%0A%20%20%20%20%22table%20of%20contents%22%3A%22taula%20de%20continguts%22%2C%0A%20%20%20%20%22Table%20of%20Contents%22%3A%22Taula%20de%20Continguts%22%2C%0A%20%20%20%20%22restart%20presentation%22%3A%22Reiniciar%20presentaci%C3%B3%22%2C%0A%20%20%20%20%22restart%3F%22%3A%22Inici%22%0A%20%20%7D%2C%0A%20%20help%5Fca%3A%0A%20%20%20%20%22Utilitzi%20el%20ratol%C3%AD%2C%20barra%20espaiadora%2C%20tecles%20Esq%2E%2FDta%2E%20%22%20%2B%0A%20%20%20%20%22o%20Re%20p%C3%A0g%20y%20Av%20p%C3%A0g%2E%20Usi%20S%20i%20B%20per%20canviar%20grand%C3%A0ria%20de%20font%2E%22%2C%0A%0A%20%20strings%5Fcs%3A%20%7B%0A%20%20%20%20%22slide%22%3A%22sn%C3%ADmek%22%2C%0A%20%20%20%20%22help%3F%22%3A%22n%C3%A1pov%C4%9Bda%22%2C%0A%20%20%20%20%22contents%3F%22%3A%22obsah%22%2C%0A%20%20%20%20%22table%20of%20contents%22%3A%22obsah%20prezentace%22%2C%0A%20%20%20%20%22Table%20of%20Contents%22%3A%22Obsah%20prezentace%22%2C%0A%20%20%20%20%22restart%20presentation%22%3A%22znovu%20spustit%20prezentaci%22%2C%0A%20%20%20%20%22restart%3F%22%3A%22restart%22%0A%20%20%7D%2C%0A%20%20help%5Fcs%3A%0A%20%20%20%20%22Prezentaci%20m%C5%AF%C5%BEete%20proch%C3%A1zet%20pomoc%C3%AD%20kliknut%C3%AD%20my%C5%A1i%2C%20mezern%C3%ADku%2C%20%22%20%2B%0A%20%20%20%20%22%C5%A1ipek%20vlevo%20a%20vpravo%20nebo%20kl%C3%A1ves%20PageUp%20a%20PageDown%2E%20P%C3%ADsmo%20se%20%22%20%2B%0A%20%20%20%20%22d%C3%A1%20zv%C4%9Bt%C5%A1it%20a%20zmen%C5%A1it%20pomoc%C3%AD%20kl%C3%A1ves%20B%20a%20S%2E%22%2C%0A%0A%20%20strings%5Fnl%3A%20%7B%0A%20%20%20%20%22slide%22%3A%22pagina%22%2C%0A%20%20%20%20%22help%3F%22%3A%22Help%3F%22%2C%0A%20%20%20%20%22contents%3F%22%3A%22Inhoud%3F%22%2C%0A%20%20%20%20%22table%20of%20contents%22%3A%22inhoudsopgave%22%2C%0A%20%20%20%20%22Table%20of%20Contents%22%3A%22Inhoudsopgave%22%2C%0A%20%20%20%20%22restart%20presentation%22%3A%22herstart%20presentatie%22%2C%0A%20%20%20%20%22restart%3F%22%3A%22Herstart%3F%22%0A%20%20%7D%2C%0A%20%20help%5Fnl%3A%0A%20%20%20%20%20%22Navigeer%20d%2Em%2Ev%2E%20het%20muis%2C%20spatiebar%2C%20Links%2FRechts%20toetsen%2C%20%22%20%2B%0A%20%20%20%20%20%22of%20PgUp%20en%20PgDn%2E%20Gebruik%20S%20en%20B%20om%20de%20karaktergrootte%20te%20veranderen%2E%22%2C%0A%0A%20%20strings%5Fde%3A%20%7B%0A%20%20%20%20%22slide%22%3A%22Seite%22%2C%0A%20%20%20%20%22help%3F%22%3A%22Hilfe%22%2C%0A%20%20%20%20%22contents%3F%22%3A%22%C3%9Cbersicht%22%2C%0A%20%20%20%20%22table%20of%20contents%22%3A%22Inhaltsverzeichnis%22%2C%0A%20%20%20%20%22Table%20of%20Contents%22%3A%22Inhaltsverzeichnis%22%2C%0A%20%20%20%20%22restart%20presentation%22%3A%22Pr%C3%A4sentation%20neu%20starten%22%2C%0A%20%20%20%20%22restart%3F%22%3A%22Neustart%22%0A%20%20%7D%2C%0A%20%20help%5Fde%3A%0A%20%20%20%20%22Benutzen%20Sie%20die%20Maus%2C%20Leerschlag%2C%20die%20Cursortasten%20links%2Frechts%20oder%20%22%20%2B%0A%20%20%20%20%22Page%20up%2FPage%20Down%20zum%20Wechseln%20der%20Seiten%20und%20S%20und%20B%20f%C3%BCr%20die%20Schriftgr%C3%B6sse%2E%22%2C%0A%0A%20%20strings%5Fpl%3A%20%7B%0A%20%20%20%20%22slide%22%3A%22slajd%22%2C%0A%20%20%20%20%22help%3F%22%3A%22pomoc%3F%22%2C%0A%20%20%20%20%22contents%3F%22%3A%22spis%20tre%C5%9Bci%3F%22%2C%0A%20%20%20%20%22table%20of%20contents%22%3A%22spis%20tre%C5%9Bci%22%2C%0A%20%20%20%20%22Table%20of%20Contents%22%3A%22Spis%20Tre%C5%9Bci%22%2C%0A%20%20%20%20%22restart%20presentation%22%3A%22Restartuj%20prezentacj%C4%99%22%2C%0A%20%20%20%20%22restart%3F%22%3A%22restart%3F%22%0A%20%20%7D%2C%0A%20%20help%5Fpl%3A%0A%20%20%20%20%22Zmieniaj%20slajdy%20klikaj%C4%85c%20mysz%C4%85%2C%20naciskaj%C4%85c%20spacj%C4%99%2C%20strza%C5%82ki%20lewo%2Fprawo%22%20%2B%0A%20%20%20%20%22lub%20PgUp%20%2F%20PgDn%2E%20U%C5%BCyj%20klawiszy%20S%20i%20B%2C%20aby%20zmieni%C4%87%20rozmiar%20czczionki%2E%22%2C%0A%0A%20%20strings%5Ffr%3A%20%7B%0A%20%20%20%20%22slide%22%3A%22page%22%2C%0A%20%20%20%20%22help%3F%22%3A%22Aide%22%2C%0A%20%20%20%20%22contents%3F%22%3A%22Index%22%2C%0A%20%20%20%20%22table%20of%20contents%22%3A%22table%20des%20mati%C3%A8res%22%2C%0A%20%20%20%20%22Table%20of%20Contents%22%3A%22Table%20des%20mati%C3%A8res%22%2C%0A%20%20%20%20%22restart%20presentation%22%3A%22Recommencer%20l%27expos%C3%A9%22%2C%0A%20%20%20%20%22restart%3F%22%3A%22D%C3%A9but%22%0A%20%20%7D%2C%0A%20%20help%5Ffr%3A%0A%20%20%20%20%22Naviguez%20avec%20la%20souris%2C%20la%20barre%20d%27espace%2C%20les%20fl%C3%A8ches%20%22%20%2B%0A%20%20%20%20%22gauche%2Fdroite%20ou%20les%20touches%20Pg%20Up%2C%20Pg%20Dn%2E%20Utilisez%20%22%20%2B%0A%20%20%20%20%22les%20touches%20S%20et%20B%20pour%20modifier%20la%20taille%20de%20la%20police%2E%22%2C%0A%0A%20%20strings%5Fhu%3A%20%7B%0A%20%20%20%20%22slide%22%3A%22oldal%22%2C%0A%20%20%20%20%22help%3F%22%3A%22seg%C3%ADts%C3%A9g%22%2C%0A%20%20%20%20%22contents%3F%22%3A%22tartalom%22%2C%0A%20%20%20%20%22table%20of%20contents%22%3A%22tartalomjegyz%C3%A9k%22%2C%0A%20%20%20%20%22Table%20of%20Contents%22%3A%22Tartalomjegyz%C3%A9k%22%2C%0A%20%20%20%20%22restart%20presentation%22%3A%22bemutat%C3%B3%20%C3%BAjraind%C3%ADt%C3%A1sa%22%2C%0A%20%20%20%20%22restart%3F%22%3A%22%C3%BAjraind%C3%ADt%C3%A1s%22%0A%20%20%7D%2C%0A%20%20help%5Fhu%3A%0A%20%20%20%20%22Az%20oldalak%20k%C3%B6zti%20l%C3%A9pked%C3%A9shez%20kattintson%20az%20eg%C3%A9rrel%2C%20vagy%20%22%20%2B%0A%20%20%20%20%22haszn%C3%A1lja%20a%20sz%C3%B3k%C3%B6z%2C%20a%20bal%2C%20vagy%20a%20jobb%20ny%C3%ADl%2C%20illetve%20a%20Page%20Down%2C%20%22%20%2B%0A%20%20%20%20%22Page%20Up%20billenty%C5%B1ket%2E%20Az%20S%20%C3%A9s%20a%20B%20billenty%C5%B1kkel%20v%C3%A1ltoztathatja%20%22%20%2B%0A%20%20%20%20%22a%20sz%C3%B6veg%20m%C3%A9ret%C3%A9t%2E%22%2C%0A%0A%20%20strings%5Fit%3A%20%7B%0A%20%20%20%20%22slide%22%3A%22pag%2E%22%2C%0A%20%20%20%20%22help%3F%22%3A%22Aiuto%22%2C%0A%20%20%20%20%22contents%3F%22%3A%22Indice%22%2C%0A%20%20%20%20%22table%20of%20contents%22%3A%22indice%22%2C%0A%20%20%20%20%22Table%20of%20Contents%22%3A%22Indice%22%2C%0A%20%20%20%20%22restart%20presentation%22%3A%22Ricominciare%20la%20presentazione%22%2C%0A%20%20%20%20%22restart%3F%22%3A%22Inizio%22%0A%20%20%7D%2C%0A%20%20help%5Fit%3A%0A%20%20%20%20%22Navigare%20con%20mouse%2C%20barra%20spazio%2C%20frecce%20sinistra%2Fdestra%20o%20%22%20%2B%0A%20%20%20%20%22PgUp%20e%20PgDn%2E%20Usare%20S%20e%20B%20per%20cambiare%20la%20dimensione%20dei%20caratteri%2E%22%2C%0A%0A%20%20strings%5Fel%3A%20%7B%0A%20%20%20%20%22slide%22%3A%22%CF%83%CE%B5%CE%BB%CE%AF%CE%B4%CE%B1%22%2C%0A%20%20%20%20%22help%3F%22%3A%22%CE%B2%CE%BF%CE%AE%CE%B8%CE%B5%CE%B9%CE%B1%3B%22%2C%0A%20%20%20%20%22contents%3F%22%3A%22%CF%80%CE%B5%CF%81%CE%B9%CE%B5%CF%87%CF%8C%CE%BC%CE%B5%CE%BD%CE%B1%3B%22%2C%0A%20%20%20%20%22table%20of%20contents%22%3A%22%CF%80%CE%AF%CE%BD%CE%B1%CE%BA%CE%B1%CF%82%20%CF%80%CE%B5%CF%81%CE%B9%CE%B5%CF%87%CE%BF%CE%BC%CE%AD%CE%BD%CF%89%CE%BD%22%2C%0A%20%20%20%20%22Table%20of%20Contents%22%3A%22%CE%A0%CE%AF%CE%BD%CE%B1%CE%BA%CE%B1%CF%82%20%CE%A0%CE%B5%CF%81%CE%B9%CE%B5%CF%87%CE%BF%CE%BC%CE%AD%CE%BD%CF%89%CE%BD%22%2C%0A%20%20%20%20%22restart%20presentation%22%3A%22%CE%B5%CF%80%CE%B1%CE%BD%CE%B5%CE%BA%CE%BA%CE%AF%CE%BD%CE%B7%CF%83%CE%B7%20%CF%80%CE%B1%CF%81%CE%BF%CF%85%CF%83%CE%AF%CE%B1%CF%83%CE%B7%CF%82%22%2C%0A%20%20%20%20%22restart%3F%22%3A%22%CE%B5%CF%80%CE%B1%CE%BD%CE%B5%CE%BA%CE%BA%CE%AF%CE%BD%CE%B7%CF%83%CE%B7%3B%22%0A%20%20%7D%2C%0A%20%20help%5Fel%3A%0A%20%20%20%20%22%CE%A0%CE%BB%CE%BF%CE%B7%CE%B3%CE%B7%CE%B8%CE%B5%CE%AF%CF%84%CE%B5%20%CE%BC%CE%B5%20%CF%84%CE%BF%20%CE%BA%CE%BB%CE%AF%CE%BA%20%CF%84%CE%BF%CF%85%20%CF%80%CE%BF%CE%BD%CF%84%CE%B9%CE%BA%CE%B9%CE%BF%CF%8D%2C%20%CF%84%CE%BF%20space%2C%20%CF%84%CE%B1%20%CE%B2%CE%AD%CE%BB%CE%B7%20%CE%B1%CF%81%CE%B9%CF%83%CF%84%CE%B5%CF%81%CE%AC%2F%CE%B4%CE%B5%CE%BE%CE%B9%CE%AC%2C%20%22%20%2B%0A%20%20%20%20%22%CE%AE%20Page%20Up%20%CE%BA%CE%B1%CE%B9%20Page%20Down%2E%20%CE%A7%CF%81%CE%B7%CF%83%CE%B9%CE%BC%CE%BF%CF%80%CE%BF%CE%B9%CE%AE%CF%83%CF%84%CE%B5%20%CF%84%CE%B1%20%CF%80%CE%BB%CE%AE%CE%BA%CF%84%CF%81%CE%B1%20S%20%CE%BA%CE%B1%CE%B9%20B%20%CE%B3%CE%B9%CE%B1%20%CE%BD%CE%B1%20%CE%B1%CE%BB%CE%BB%CE%AC%CE%BE%CE%B5%CF%84%CE%B5%20%22%20%2B%0A%20%20%20%20%22%CF%84%CE%BF%20%CE%BC%CE%AD%CE%B3%CE%B5%CE%B8%CE%BF%CF%82%20%CF%84%CE%B7%CF%82%20%CE%B3%CF%81%CE%B1%CE%BC%CE%BC%CE%B1%CF%84%CE%BF%CF%83%CE%B5%CE%B9%CF%81%CE%AC%CF%82%2E%22%2C%0A%0A%20%20strings%5Fja%3A%20%7B%0A%20%20%20%20%22slide%22%3A%22%E3%82%B9%E3%83%A9%E3%82%A4%E3%83%89%22%2C%0A%20%20%20%20%22help%3F%22%3A%22%E3%83%98%E3%83%AB%E3%83%97%22%2C%0A%20%20%20%20%22contents%3F%22%3A%22%E7%9B%AE%E6%AC%A1%22%2C%0A%20%20%20%20%22table%20of%20contents%22%3A%22%E7%9B%AE%E6%AC%A1%E3%82%92%E8%A1%A8%E7%A4%BA%22%2C%0A%20%20%20%20%22Table%20of%20Contents%22%3A%22%E7%9B%AE%E6%AC%A1%22%2C%0A%20%20%20%20%22restart%20presentation%22%3A%22%E6%9C%80%E5%88%9D%E3%81%8B%E3%82%89%E5%86%8D%E7%94%9F%22%2C%0A%20%20%20%20%22restart%3F%22%3A%22%E6%9C%80%E5%88%9D%E3%81%8B%E3%82%89%22%0A%20%20%7D%2C%0A%20%20help%5Fja%3A%0A%20%20%20%20%20%22%E3%83%9E%E3%82%A6%E3%82%B9%E5%B7%A6%E3%82%AF%E3%83%AA%E3%83%83%E3%82%AF%20%E3%83%BB%20%E3%82%B9%E3%83%9A%E3%83%BC%E3%82%B9%20%E3%83%BB%20%E5%B7%A6%E5%8F%B3%E3%82%AD%E3%83%BC%20%22%20%2B%0A%20%20%20%20%20%22%E3%81%BE%E3%81%9F%E3%81%AF%20Page%20Up%20%E3%83%BB%20Page%20Down%E3%81%A7%E6%93%8D%E4%BD%9C%EF%BC%8C%20S%20%E3%83%BB%20B%E3%81%A7%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88%E3%82%B5%E3%82%A4%E3%82%BA%E5%A4%89%E6%9B%B4%22%2C%0A%0A%20%20strings%5Fzh%3A%20%7B%0A%20%20%20%20%22slide%22%3A%22%E5%B9%BB%E7%81%AF%E7%89%87%22%2C%0A%20%20%20%20%22help%3F%22%3A%22%E5%B8%AE%E5%8A%A9%3F%22%2C%0A%20%20%20%20%22contents%3F%22%3A%22%E5%86%85%E5%AE%B9%3F%22%2C%0A%20%20%20%20%22table%20of%20contents%22%3A%22%E7%9B%AE%E5%BD%95%22%2C%0A%20%20%20%20%22Table%20of%20Contents%22%3A%22%E7%9B%AE%E5%BD%95%22%2C%0A%20%20%20%20%22restart%20presentation%22%3A%22%E9%87%8D%E6%96%B0%E5%90%AF%E5%8A%A8%E5%B1%95%E7%A4%BA%22%2C%0A%20%20%20%20%22restart%3F%22%3A%22%E9%87%8D%E6%96%B0%E5%90%AF%E5%8A%A8%3F%22%0A%20%20%7D%2C%0A%20%20help%5Fzh%3A%0A%20%20%20%20%22%E7%94%A8%E9%BC%A0%E6%A0%87%E7%82%B9%E5%87%BB%2C%20%E7%A9%BA%E6%A0%BC%E6%9D%A1%2C%20%E5%B7%A6%E5%8F%B3%E7%AE%AD%E5%A4%B4%2C%20Pg%20Up%20%E5%92%8C%20Pg%20Dn%20%E5%AF%BC%E8%88%AA%2E%20%22%20%2B%0A%20%20%20%20%22%E7%94%A8%20S%2C%20B%20%E6%94%B9%E5%8F%98%E5%AD%97%E4%BD%93%E5%A4%A7%E5%B0%8F%2E%22%2C%0A%0A%20%20strings%5Fru%3A%20%7B%0A%20%20%20%20%22slide%22%3A%22%D1%81%D0%BB%D0%B0%D0%B9%D0%B4%22%2C%0A%20%20%20%20%22help%3F%22%3A%22%D0%BF%D0%BE%D0%BC%D0%BE%D1%89%D1%8C%3F%22%2C%0A%20%20%20%20%22contents%3F%22%3A%22%D1%81%D0%BE%D0%B4%D0%B5%D1%80%D0%B6%D0%B0%D0%BD%D0%B8%D0%B5%3F%22%2C%0A%20%20%20%20%22table%20of%20contents%22%3A%22%D0%BE%D0%B3%D0%BB%D0%B0%D0%B2%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5%22%2C%0A%20%20%20%20%22Table%20of%20Contents%22%3A%22%D0%9E%D0%B3%D0%BB%D0%B0%D0%B2%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5%22%2C%0A%20%20%20%20%22restart%20presentation%22%3A%22%D0%BF%D0%B5%D1%80%D0%B5%D0%B7%D0%B0%D0%BF%D1%83%D1%81%D1%82%D0%B8%D1%82%D1%8C%20%D0%BF%D1%80%D0%B5%D0%B7%D0%B5%D0%BD%D1%82%D0%B0%D1%86%D0%B8%D1%8E%22%2C%0A%20%20%20%20%22restart%3F%22%3A%22%D0%BF%D0%B5%D1%80%D0%B5%D0%B7%D0%B0%D0%BF%D1%83%D1%81%D0%BA%3F%22%0A%20%20%7D%2C%0A%20%20help%5Fru%3A%0A%20%20%20%20%22%D0%9F%D0%B5%D1%80%D0%B5%D0%BC%D0%B5%D1%89%D0%B0%D0%B9%D1%82%D0%B5%D1%81%D1%8C%20%D0%BA%D0%BB%D0%B8%D0%BA%D0%B0%D1%8F%20%D0%BC%D1%8B%D1%88%D0%BA%D0%BE%D0%B9%2C%20%D0%B8%D1%81%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D1%83%D1%8F%20%D0%BA%D0%BB%D0%B0%D0%B2%D0%B8%D1%88%D1%83%20%D0%BF%D1%80%D0%BE%D0%B1%D0%B5%D0%BB%2C%20%D1%81%D1%82%D1%80%D0%B5%D0%BB%D0%BA%D0%B8%22%20%2B%0A%20%20%20%20%22%D0%B2%D0%BB%D0%B5%D0%B2%D0%BE%2F%D0%B2%D0%BF%D1%80%D0%B0%D0%B2%D0%BE%20%D0%B8%D0%BB%D0%B8%20Pg%20Up%20%D0%B8%20Pg%20Dn%2E%20%D0%9A%D0%BB%D0%B0%D0%B2%D0%B8%D1%88%D0%B8%20S%20%D0%B8%20B%20%D0%BC%D0%B5%D0%BD%D1%8F%D1%8E%D1%82%20%D1%80%D0%B0%D0%B7%D0%BC%D0%B5%D1%80%20%D1%88%D1%80%D0%B8%D1%84%D1%82%D0%B0%2E%22%2C%0A%0A%20%20strings%5Fsv%3A%20%7B%0A%20%20%20%20%22slide%22%3A%22sida%22%2C%0A%20%20%20%20%22help%3F%22%3A%22hj%C3%A4lp%22%2C%0A%20%20%20%20%22contents%3F%22%3A%22inneh%C3%A5ll%22%2C%0A%20%20%20%20%22table%20of%20contents%22%3A%22inneh%C3%A5llsf%C3%B6rteckning%22%2C%0A%20%20%20%20%22Table%20of%20Contents%22%3A%22Inneh%C3%A5llsf%C3%B6rteckning%22%2C%0A%20%20%20%20%22restart%20presentation%22%3A%22visa%20presentationen%20fr%C3%A5n%20b%C3%B6rjan%22%2C%0A%20%20%20%20%22restart%3F%22%3A%22b%C3%B6rja%20om%22%0A%20%20%7D%2C%0A%20%20help%5Fsv%3A%0A%20%20%20%20%22Bl%C3%A4ddra%20med%20ett%20klick%20med%20v%C3%A4nstra%20musknappen%2C%20mellanslagstangenten%2C%20%22%20%2B%0A%20%20%20%20%22v%C3%A4nster%2D%20och%20h%C3%B6gerpiltangenterna%20eller%20tangenterna%20Pg%20Up%2C%20Pg%20Dn%2E%20%22%20%2B%0A%20%20%20%20%22Anv%C3%A4nd%20tangenterna%20S%20och%20B%20f%C3%B6r%20att%20%C3%A4ndra%20textens%20storlek%2E%22%2C%0A%0A%20%20strings%3A%20%7B%20%7D%2C%0A%0A%20%20localize%3A%20function%20%28src%29%20%7B%0A%20%20%20%20if%20%28src%20%3D%3D%20%22%22%29%0A%20%20%20%20%20%20return%20src%3B%0A%0A%20%20%20%20%20%2F%2F%20try%20full%20language%20code%2C%20e%2Eg%2E%20en%2DUS%0A%20%20%20%20%20var%20s%2C%20lookup%20%3D%20w3c%5Fslidy%2Estrings%5Bw3c%5Fslidy%2Elang%5D%3B%0A%0A%20%20%20%20%20if%20%28lookup%29%0A%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20s%20%3D%20lookup%5Bsrc%5D%3B%0A%0A%20%20%20%20%20%20%20if%20%28s%29%0A%20%20%20%20%20%20%20%20return%20s%3B%0A%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%2F%2F%20strip%20country%20code%20suffix%2C%20e%2Eg%2E%0A%20%20%20%20%20%2F%2F%20try%20en%20if%20undefined%20for%20en%2DUS%0A%20%20%20%20%20var%20lg%20%3D%20w3c%5Fslidy%2Elang%2Esplit%28%22%2D%22%29%3B%0A%0A%20%20%20%20%20if%20%28lg%2Elength%20%3E%201%29%0A%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20lookup%20%3D%20w3c%5Fslidy%2Estrings%5Blg%5B0%5D%5D%3B%0A%0A%20%20%20%20%20%20%20if%20%28lookup%29%0A%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20s%20%3D%20lookup%5Bsrc%5D%3B%0A%0A%20%20%20%20%20%20%20%20%20if%20%28s%29%0A%20%20%20%20%20%20%20%20%20%20return%20s%3B%0A%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%2F%2F%20otherwise%20string%20as%20is%0A%20%20%20%20%20return%20src%3B%0A%20%20%7D%2C%0A%0A%20%20init%5Flocalization%3A%20function%20%28%29%20%7B%0A%20%20%20%20var%20i18n%20%3D%20w3c%5Fslidy%3B%0A%20%20%20%20var%20help%5Ftext%20%3D%20w3c%5Fslidy%2Ehelp%5Ftext%3B%0A%0A%20%20%20%20%2F%2F%20each%20such%20language%20array%20is%20declared%20in%20the%20localize%20array%0A%20%20%20%20%2F%2F%20this%20is%20used%20as%20in%20%20w3c%5Fslidy%2Elocalize%28%22foo%22%29%3B%0A%20%20%20%20this%2Estrings%20%3D%20%7B%0A%20%20%20%20%20%20%22es%22%3Athis%2Estrings%5Fes%2C%0A%20%20%20%20%20%20%22ca%22%3Athis%2Estrings%5Fca%2C%0A%20%20%20%20%20%20%22cs%22%3Athis%2Estrings%5Fcs%2C%0A%20%20%20%20%20%20%22nl%22%3Athis%2Estrings%5Fnl%2C%0A%20%20%20%20%20%20%22de%22%3Athis%2Estrings%5Fde%2C%0A%20%20%20%20%20%20%22pl%22%3Athis%2Estrings%5Fpl%2C%0A%20%20%20%20%20%20%22fr%22%3Athis%2Estrings%5Ffr%2C%0A%20%20%20%20%20%20%22hu%22%3Athis%2Estrings%5Fhu%2C%0A%20%20%20%20%20%20%22it%22%3Athis%2Estrings%5Fit%2C%0A%20%20%20%20%20%20%22el%22%3Athis%2Estrings%5Fel%2C%0A%20%20%20%20%20%20%22jp%22%3Athis%2Estrings%5Fja%2C%0A%20%20%20%20%20%20%22zh%22%3Athis%2Estrings%5Fzh%2C%0A%20%20%20%20%20%20%22ru%22%3Athis%2Estrings%5Fru%2C%0A%20%20%20%20%20%20%22sv%22%3Athis%2Estrings%5Fsv%0A%20%20%20%20%7D%2C%0A%0A%20%20%20%20i18n%2Estrings%5Fes%5Bhelp%5Ftext%5D%20%3D%20i18n%2Ehelp%5Fes%3B%0A%20%20%20%20i18n%2Estrings%5Fca%5Bhelp%5Ftext%5D%20%3D%20i18n%2Ehelp%5Fca%3B%0A%20%20%20%20i18n%2Estrings%5Fcs%5Bhelp%5Ftext%5D%20%3D%20i18n%2Ehelp%5Fcs%3B%0A%20%20%20%20i18n%2Estrings%5Fnl%5Bhelp%5Ftext%5D%20%3D%20i18n%2Ehelp%5Fnl%3B%0A%20%20%20%20i18n%2Estrings%5Fde%5Bhelp%5Ftext%5D%20%3D%20i18n%2Ehelp%5Fde%3B%0A%20%20%20%20i18n%2Estrings%5Fpl%5Bhelp%5Ftext%5D%20%3D%20i18n%2Ehelp%5Fpl%3B%0A%20%20%20%20i18n%2Estrings%5Ffr%5Bhelp%5Ftext%5D%20%3D%20i18n%2Ehelp%5Ffr%3B%0A%20%20%20%20i18n%2Estrings%5Fhu%5Bhelp%5Ftext%5D%20%3D%20i18n%2Ehelp%5Fhu%3B%0A%20%20%20%20i18n%2Estrings%5Fit%5Bhelp%5Ftext%5D%20%3D%20i18n%2Ehelp%5Fit%3B%0A%20%20%20%20i18n%2Estrings%5Fel%5Bhelp%5Ftext%5D%20%3D%20i18n%2Ehelp%5Fel%3B%0A%20%20%20%20i18n%2Estrings%5Fja%5Bhelp%5Ftext%5D%20%3D%20i18n%2Ehelp%5Fja%3B%0A%20%20%20%20i18n%2Estrings%5Fzh%5Bhelp%5Ftext%5D%20%3D%20i18n%2Ehelp%5Fzh%3B%0A%20%20%20%20i18n%2Estrings%5Fru%5Bhelp%5Ftext%5D%20%3D%20i18n%2Ehelp%5Fru%3B%0A%20%20%20%20i18n%2Estrings%5Fsv%5Bhelp%5Ftext%5D%20%3D%20i18n%2Ehelp%5Fsv%3B%0A%0A%20%20%20%20w3c%5Fslidy%2Elang%20%3D%20document%2Ebody%2EparentNode%2EgetAttribute%28%22lang%22%29%3B%0A%0A%20%20%20%20if%20%28%21w3c%5Fslidy%2Elang%29%0A%20%20%20%20%20%20w3c%5Fslidy%2Elang%20%3D%20document%2Ebody%2EparentNode%2EgetAttribute%28%22xml%3Alang%22%29%3B%0A%0A%20%20%20%20if%20%28%21w3c%5Fslidy%2Elang%29%0A%20%20%20%20%20%20w3c%5Fslidy%2Elang%20%3D%20%22en%22%3B%0A%20%20%7D%0A%7D%3B%0A%0A%2F%2F%20hack%20for%20back%20button%20behavior%0Aif%20%28w3c%5Fslidy%2Eie6%20%7C%7C%20w3c%5Fslidy%2Eie7%29%0A%7B%0A%20%20document%2Ewrite%28%22%3Ciframe%20id%3D%27historyFrame%27%20%22%20%2B%0A%20%20%22src%3D%27javascript%3A%5C%22%3Chtml%22%2B%22%3E%3C%2F%22%2B%22html%3E%5C%22%27%20%22%20%2B%0A%20%20%22height%3D%271%27%20width%3D%271%27%20%22%20%2B%0A%20%20%22style%3D%27position%3Aabsolute%3Bleft%3A%2D800px%27%3E%3C%2Fiframe%3E%22%29%3B%0A%7D%0A%0A%2F%2F%20attach%20event%20listeners%20for%20initialization%0Aw3c%5Fslidy%2Eset%5Fup%28%29%3B%0A%0A%2F%2F%20hide%20the%20slides%20as%20soon%20as%20body%20element%20is%20available%0A%2F%2F%20to%20reduce%20annoying%20screen%20mess%20before%20the%20onload%20event%0AsetTimeout%28w3c%5Fslidy%2Ehide%5Fslides%2C%2050%29%3B%0A%0A" charset="utf-8" type="text/javascript"></script>
</head>
<body>
<div class="slide titlepage">
<h1 class="title">Haskell Part 5: Concurrent programming</h1>
<p class="author">
Martin Sulzmann
</p>
</div>
<div id="concurrency-versus-parallelism" class="slide section level1">
<h1>Concurrency versus Parallelism</h1>
<ul>
<li><p>Mean different things</p></li>
<li>Parallelism
<ul>
<li>Speeding up a program by splitting up the problem into several tasks</li>
<li>Run tasks simultaneously on different processor cores</li>
<li>Think of parallelizing merge sort</li>
</ul></li>
<li>Concurrency
<ul>
<li>Simultaneous execution of independent (but possibly) related tasks</li>
<li>Think of an operation system (print queue, task manager, ...)</li>
<li>Of course, concurrent programs can be executed in parallel if we have enough processor cores</li>
</ul></li>
<li>Concurrent programming
<ul>
<li>Several threads of execution</li>
<li>Synchronisation and communication among threads</li>
</ul></li>
</ul>
</div>
<div id="shared-memory-vs-message-passing" class="slide section level1">
<h1>Shared-Memory vs Message-Passing</h1>
<p>Concurrently executing threads need to communicate/synchronize. How?</p>
<p>There are two principled approaches:</p>
<ul>
<li><p>shared-memory</p></li>
<li><p>message-passing</p></li>
</ul>
<p>We will take a look at both (from the Haskell point of view).</p>
</div>
<div id="common-pitfalls" class="slide section level1">
<h1>Common pitfalls</h1>
<p>Data race:</p>
<ul>
<li><p>Two concurrent writes to the same memory location, or</p></li>
<li><p>One concurrent read and one concurrent write to the same memory location.</p></li>
</ul>
<p>Deadlock:</p>
<ul>
<li>All threads are blocked.</li>
</ul>
</div>
<div id="haskell" class="slide section level1">
<h1>Haskell</h1>
<p>Haskell is great for concurrent programming</p>
<ul>
<li>Control about pure/impure functions (thread safety!)<br />
</li>
<li>Light-weight tasks ("stack-less" run-time thanks to CPS)</li>
<li>Standard concurrency abstractions
<ul>
<li>atomic-compare-and-swap</li>
<li>Locks, Semaphore</li>
<li>Channels (message passing)</li>
</ul></li>
<li>Software Transactional Memory</li>
</ul>
</div>
<div id="in-place-update-in-haskell-imperative-variables" class="slide section level1">
<h1>In-place update in Haskell (imperative variables)</h1>
<ul>
<li>Interface</li>
</ul>
<div class="sourceCode"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span class="ot">newIORef ::</span> a <span class="ot">-></span> <span class="dt">IO</span> (<span class="dt">IORef</span> a)
<span class="ot">readIORef ::</span> <span class="dt">IORef</span> a <span class="ot">-></span> <span class="dt">IO</span> a
<span class="ot">writeIORef ::</span> <span class="dt">IORef</span> a <span class="ot">-></span> a <span class="ot">-></span> <span class="dt">IO</span> ()</code></pre></div>
<ul>
<li><p><code>IORef a</code> is mutable reference to a value of type <code>a</code></p></li>
<li><p>C example</p></li>
</ul>
<div class="sourceCode"><pre class="sourceCode c"><code class="sourceCode c"> <span class="dt">int</span> x = <span class="dv">1</span>;
x = x + <span class="dv">1</span>;</code></pre></div>
<ul>
<li>Recast in Haskell</li>
</ul>
<div class="sourceCode"><pre class="sourceCode haskell"><code class="sourceCode haskell"> x <span class="ot"><-</span> newIORef (<span class="dv">1</span><span class="ot">::</span><span class="dt">Int</span>)
v <span class="ot"><-</span> readIORef x
writeIORef x (v<span class="fu">+</span><span class="dv">1</span>)</code></pre></div>
<p>Feels like three address code/assembler. But precise control about side effecting functions!</p>
</div>
<div id="concurrent-execution-of-programs" class="slide section level1">
<h1>Concurrent execution of programs</h1>
<div class="sourceCode"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span class="kw">import </span><span class="dt">Control.Concurrent</span>
<span class="kw">import </span><span class="dt">Data.IORef</span>
doWhile cmd cond <span class="fu">=</span> <span class="kw">do</span> cmd
v <span class="ot"><-</span> cond
<span class="kw">if</span> v
<span class="kw">then</span> doWhile cmd cond
<span class="kw">else</span> return ()
steps <span class="fu">=</span> <span class="dv">100</span>
check cnt <span class="fu">=</span> <span class="kw">do</span> v <span class="ot"><-</span> readIORef cnt
<span class="kw">if</span> v <span class="fu">>=</span> steps
<span class="kw">then</span> return <span class="dt">False</span>
<span class="kw">else</span> return <span class="dt">True</span>
thread cnt s <span class="fu">=</span> doWhile (<span class="kw">do</span> putStrLn s
v <span class="ot"><-</span> readIORef cnt
writeIORef cnt (v<span class="fu">+</span><span class="dv">1</span>)
threadDelay <span class="dv">1000</span>)
(check cnt)
main <span class="fu">=</span> <span class="kw">do</span> cnt <span class="ot"><-</span> newIORef <span class="dv">0</span>
forkIO <span class="fu">$</span> thread cnt <span class="st">"A"</span>
forkIO <span class="fu">$</span> thread cnt <span class="st">"B"</span>
thread cnt <span class="st">"C"</span></code></pre></div>
<ul>
<li><code>forkIO :: IO () -> IO ThreadId</code>
<ul>
<li>Creates a new thread</li>
<li>Round-robin thread scheduling by default</li>
</ul></li>
<li><code>threadDelay :: Int -> IO ()</code>
<ul>
<li>Wait n micro seconds</li>
</ul></li>
</ul>
<p>Observations:</p>
<ul>
<li><p>Non-deterministic execution</p></li>
<li><p>Data-races!</p></li>
</ul>
</div>
<div id="mutuable-shared-variables-mvar" class="slide section level1">
<h1>Mutuable shared variables (MVar)</h1>
<div class="sourceCode"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span class="ot">newEmptyMVar ::</span> <span class="dt">IO</span> (<span class="dt">MVar</span> a)
<span class="ot">newMVar ::</span> a <span class="ot">-></span> <span class="dt">IO</span> (<span class="dt">MVar</span> a)
<span class="ot">takeMVar ::</span> <span class="dt">MVar</span> a <span class="ot">-></span> <span class="dt">IO</span> a
<span class="ot">putMVar ::</span> <span class="dt">MVar</span> a <span class="ot">-></span> a <span class="ot">-></span> <span class="dt">IO</span> ()
<span class="ot">readMVar ::</span> <span class="dt">MVar</span> a <span class="ot">-></span> <span class="dt">IO</span> a</code></pre></div>
<ul>
<li><code>MVar a</code>
<ul>
<li>Either empty or contains a value of type <code>a</code></li>
</ul></li>
<li><code>takeMVar</code> blocks if empty</li>
<li><code>putMVar</code> blocks if full</li>
<li>The first waiting <code>takeMVar</code>/<code>putMVar</code> call will be unblocked (wait queue)</li>
<li><code>readMVar</code> effectively sequence of <code>takeMvar</code> and <code>putMvar</code></li>
<li>Example</li>
</ul>
<div class="sourceCode"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span class="kw">import </span><span class="dt">Control.Concurrent</span>
<span class="kw">import </span><span class="dt">Control.Concurrent.MVar</span>
doWhile cmd cond <span class="fu">=</span> <span class="kw">do</span> cmd
v <span class="ot"><-</span> cond
<span class="kw">if</span> v
<span class="kw">then</span> doWhile cmd cond
<span class="kw">else</span> return ()
steps <span class="fu">=</span> <span class="dv">100</span>
check cnt <span class="fu">=</span> <span class="kw">do</span> v <span class="ot"><-</span> readMVar cnt
<span class="kw">if</span> v <span class="fu">>=</span> steps
<span class="kw">then</span> return <span class="dt">False</span>
<span class="kw">else</span> return <span class="dt">True</span>
thread cnt s <span class="fu">=</span> doWhile (<span class="kw">do</span> putStrLn s
v <span class="ot"><-</span> takeMVar cnt
putMVar cnt (v<span class="fu">+</span><span class="dv">1</span>)
threadDelay <span class="dv">1000</span>)
(check cnt)
main <span class="fu">=</span> <span class="kw">do</span> cnt <span class="ot"><-</span> newMVar <span class="dv">0</span>
forkIO <span class="fu">$</span> thread cnt <span class="st">"A"</span>
forkIO <span class="fu">$</span> thread cnt <span class="st">"B"</span>
thread cnt <span class="st">"C"</span></code></pre></div>
<p><code>MVar</code> guarantees mutually exclusive access to the counter.</p>
</div>
<div id="message-passing-with-channels" class="slide section level1">
<h1>Message-passing with channels</h1>
<ul>
<li><p>MVar represents a one-place buffer</p></li>
<li><p>Chan = unbounded FIFO channel</p></li>
</ul>
<div class="sourceCode"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span class="ot">newChan ::</span> <span class="dt">IO</span> (<span class="dt">Chan</span> a)
<span class="ot">writeChan ::</span> <span class="dt">Chan</span> a <span class="ot">-></span> a <span class="ot">-></span> <span class="dt">IO</span> ()
<span class="ot">readChan ::</span> <span class="dt">Chan</span> a <span class="ot">-></span> <span class="dt">IO</span> a</code></pre></div>
<p>Chan is built upon MVar. See here <a href="Chan">http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Concurrent-Chan.html</a></p>
<ul>
<li>Producer/consumer example</li>
</ul>
<div class="sourceCode"><pre class="sourceCode haskell"><code class="sourceCode haskell">producer ch <span class="fu">=</span> <span class="kw">do</span>
mapM_(\x <span class="ot">-></span> <span class="kw">do</span> writeChan ch x
threadDelay <span class="dv">1000</span>)
([<span class="dv">1</span><span class="fu">..</span><span class="dv">100</span>] <span class="fu">++</span> [<span class="dv">0</span>])
consumer ch <span class="fu">=</span> <span class="kw">do</span>
v <span class="ot"><-</span> readChan ch
<span class="kw">if</span> v <span class="fu">==</span> <span class="dv">0</span>
<span class="kw">then</span> return ()
<span class="kw">else</span> <span class="kw">do</span> putStrLn (<span class="st">"Received : "</span> <span class="fu">++</span> show v)
consumer ch
mainCP <span class="fu">=</span> <span class="kw">do</span>
ch <span class="ot"><-</span> newChan
forkIO (producer ch)
consumer ch</code></pre></div>
</div>
<div id="shared-memory-vs-message-passing-landscape" class="slide section level1">
<h1>Shared-Memory vs Message-Passing (landscape)</h1>
<p>Shared-memory:</p>
<ul>
<li><p>IORefs</p></li>
<li><p>Locks (Mutex), Semaphore</p></li>
<li><p>MVar</p></li>
<li><p>...</p></li>
</ul>
<p>Message-passing:</p>
<ul>
<li><p>MVar</p></li>
<li><p>Chan</p></li>
<li><p>Channel of a fixed buffer size</p></li>
<li><p>Actors (a form of Chan, where there are multiple writers but only a single reader)</p></li>
<li><p>...</p></li>
</ul>
<p>Notice that MVar classifies as shared-memory as well as a message-passing primitve.</p>
<pre><code>-- Message-passing
receive = takeMVar
send = putMVar
-- Mutex
-- initially full MVar
lock = takeMVar
unLock = putMVar</code></pre>
</div>
<div id="building-concurrency-abstractions" class="slide section level1">
<h1>Building (concurrency) abstractions</h1>
<h2 id="barrier-with-chan">Barrier with <code>Chan</code></h2>
<div class="sourceCode"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span class="kw">type</span> <span class="dt">Barrier</span> <span class="fu">=</span> (<span class="dt">Chan</span> (), <span class="dt">Int</span>)
<span class="ot">newBarrier ::</span> <span class="dt">Int</span> <span class="ot">-></span> <span class="dt">IO</span> <span class="dt">Barrier</span>
newBarrier n <span class="fu">=</span> <span class="kw">do</span> b <span class="ot"><-</span> newChan
return (b,n)
<span class="ot">signalBarrier ::</span> <span class="dt">Barrier</span> <span class="ot">-></span> <span class="dt">IO</span> ()
signalBarrier (b,_) <span class="fu">=</span> writeChan b ()
<span class="ot">waitBarrier ::</span> <span class="dt">Barrier</span> <span class="ot">-></span> <span class="dt">IO</span> ()
waitBarrier (b,n) <span class="fu">=</span> <span class="kw">do</span> mapM (\_ <span class="ot">-></span> readChan b) [<span class="dv">1</span><span class="fu">..</span>n]
return ()</code></pre></div>
<ul>
<li>Initially, a barrier is represented by an empty channel and (fixed) quantity <math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mi>n</mi><annotation encoding="application/x-tex">n</annotation></semantics></math>.</li>
<li>Each signal writes a (void) value into the channel.</li>
<li>Wait performs <math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mi>n</mi><annotation encoding="application/x-tex">n</annotation></semantics></math> reads and therefore will block if not all signals have come through yet.</li>
</ul>
<h2 id="select-with-mvar">Select with <code>MVar</code></h2>
<p>Often we're only interested if at least one of some tasks has some finished.</p>
<div class="sourceCode"><pre class="sourceCode haskell"><code class="sourceCode haskell">select <span class="fu">=</span> <span class="kw">do</span>
m <span class="ot"><-</span> newEmptyMVar
forkIO <span class="fu">$</span> <span class="kw">do</span> task1
putMVar m <span class="st">"Task1 Done"</span>
forkIO <span class="fu">$</span> <span class="kw">do</span> task1
putMVar m <span class="st">"Task2 Done"</span>
r <span class="ot"><-</span> takeMVar m
return ()</code></pre></div>
<ul>
<li>Each tasks signals via <code>putMVar</code>.</li>
<li>The main thread waits by calling <code>takeMVar</code>.</li>
<li>Once if one of the tasks has signaled, the main thread will proceed.</li>
<li>Note that only one thread will "win" here.</li>
</ul>
<h2 id="futurespromises">Futures/promises</h2>
<p>Futures/promises are a concurrent data structures to manage (not yet completed) computatations in a non-blocking (asynchronous) fashion.</p>
<p>A future can be viewed as a placeholder for a computation that will eventually become available. The term promise is often referred to a form of future where the result can be explicitly provided by the programmer. However, in many descriptions both terms can be used interchangeably.</p>
<p>We make the following distinction.</p>
<ul>
<li><p>Futures represent not yet completed representations. Once completed, the result never changes ("read-many").</p></li>
<li><p>A promise is a form of future where the result can be explcitely provided at a designated program point. The result can only be provided once. We say, the promise has been completed. Further completion attempts have no effect ("write-once").</p></li>
</ul>
<h3 id="simple-promise-interface-with-mvar-and-exploring-the-design-space-a-bit">Simple promise interface with MVar (and exploring the design space a bit)</h3>
<pre class="hs"><code>
-- Exploring the design space of futures/promises
import Control.Concurrent
import Control.Concurrent.MVar
type Promise a = MVar a
-- | Promises represented by an MVar.
-- The promise is initially empty.
new :: IO (Promise a)
new = newEmptyMVar
-- | Retrieve promise value.
-- Blocks if value is not yet available.
-- Value is just read.
get :: Promise a -> IO a
get = readMVar
-- | Retrieve promise value via a callback function.
-- Non-blocking. Callback executed once valie is available.
onComplete :: Promise a -> (a -> IO ()) -> IO ()
onComplete p f = do forkIO $ do v <- get p
f v
return ()
-- | Complete a promise by executing a command.
-- The returned value will be assigned to the promise,
-- if the promise has not been completed yet.
-- That is, promises can be written only once.
tryComplete :: Promise a -> (IO a) -> IO ()
tryComplete p x = do forkIO $ do v <- x
putMVar p v
return ()
-- Some derived combinators
-- | Non-blocking execution of some command.
-- The (returned) value, once available, can be retrieved via a promise.
-- Commonly, this form of a promise is referred to as a future.
future :: IO a -> IO (Promise a)
future f = do p <- new
tryComplete p f
return p
-- | Complete a promise via another promise.
tryCompleteWith p f = do
onComplete f (\x -> do tryComplete p (return x)
return ())
-- | Select among the first completed promise.
first p1 p2 = do
p <- new
tryCompleteWith p p1
tryCompleteWith p p2
return p
-- | Example to illustrate the above derived combinators.
holidayBooking = do p1 <- future getQuoteUSA
p2 <- future getQuoteCH
p <- first p1 p2
onComplete p (\s -> putStrLn $ "Hooray: " ++ s)
threadDelay 10000
getQuoteUSA = do threadDelay 1000
return "USA"
getQuoteCH = do threadDelay 5000
return "CH"
-- Further extensions.
-- 1. A promise may fail (e.g. timeout).
-- Can be supported via exceptions or the Maybe data type.
--
-- 2. Our use of `forks` is rather wasteful.
-- Not so much any issue in the Haskell setting where threads are cheap.
-- In a refined design, a not yet completed promise collects all callbacks,
-- and will execute them all at once, once the promise will be completed.</code></pre>
</div>
<div id="locks-are-evil" class="slide section level1">
<h1>"Locks" are evil</h1>
<p>We will use swap as our running example to illustrate the tricky points of concurrent programming.</p>
<p>We first a version which contains a data race.</p>
<p>Then, we use "locking" primitives to fix the data race. We either achieve poor scalability or we may run into deadlocks.</p>
<p>Later, we will consider a much simpler solution using Software Transactional Memory (STM).</p>
</div>
<div id="swap-with-data-race" class="slide section level1">
<h1>Swap with data race</h1>
<div class="sourceCode"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span class="ot">swapIORef ::</span> <span class="dt">Barrier</span> <span class="ot">-></span> <span class="dt">IORef</span> a <span class="ot">-></span> <span class="dt">IORef</span> a <span class="ot">-></span> <span class="dt">IO</span> ()
swapIORef b x y <span class="fu">=</span> <span class="kw">do</span>
vx <span class="ot"><-</span> readIORef x
vy <span class="ot"><-</span> readIORef y
writeIORef x vy
writeIORef y vx
signalBarrier b</code></pre></div>
<ul>
<li><p>The swap function may be executed concurrently. Therefore, we use a barrier to signal the calling thread ones swapping is done.</p></li>
<li><p>In case of several concurrent swaps, we may potentially run into a data race.</p></li>
</ul>
<div class="sourceCode"><pre class="sourceCode haskell"><code class="sourceCode haskell">test1 <span class="fu">=</span> <span class="kw">do</span>
b <span class="ot"><-</span> newBarrier <span class="dv">2</span>
x1 <span class="ot"><-</span> newIORef (<span class="dv">1</span><span class="ot">::</span><span class="dt">Int</span>)
x2 <span class="ot"><-</span> newIORef (<span class="dv">2</span><span class="ot">::</span><span class="dt">Int</span>)
x3 <span class="ot"><-</span> newIORef (<span class="dv">3</span><span class="ot">::</span><span class="dt">Int</span>)
forkIO <span class="fu">$</span> swapIORef b x1 x2
forkIO <span class="fu">$</span> swapIORef b x2 x3
waitBarrier b</code></pre></div>
<ul>
<li>We have no guarantee that <code>readIORef</code> and <code>writeIORef</code> happen atomically. Therefore, the value stored in <code>x2</code> could be corrupted.</li>
</ul>
<h2 id="complete-source-code">Complete Source Code</h2>
<div class="sourceCode"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span class="kw">import </span><span class="dt">Control.Concurrent</span>
<span class="kw">import </span><span class="dt">Control.Concurrent.STM</span>
<span class="kw">import </span><span class="dt">Data.IORef</span>
<span class="kw">import </span><span class="dt">Data.List</span>
<span class="kw">type</span> <span class="dt">Barrier</span> <span class="fu">=</span> (<span class="dt">Chan</span> (), <span class="dt">Int</span>)
<span class="ot">newBarrier ::</span> <span class="dt">Int</span> <span class="ot">-></span> <span class="dt">IO</span> <span class="dt">Barrier</span>
newBarrier n <span class="fu">=</span> <span class="kw">do</span> b <span class="ot"><-</span> newChan
return (b,n)
<span class="ot">signalBarrier ::</span> <span class="dt">Barrier</span> <span class="ot">-></span> <span class="dt">IO</span> ()
signalBarrier (b,_) <span class="fu">=</span> writeChan b ()
<span class="ot">waitBarrier ::</span> <span class="dt">Barrier</span> <span class="ot">-></span> <span class="dt">IO</span> ()
waitBarrier (b,n) <span class="fu">=</span> <span class="kw">do</span> mapM (\_ <span class="ot">-></span> readChan b) [<span class="dv">1</span><span class="fu">..</span>n]
return ()
<span class="ot">swapIORef ::</span> <span class="dt">Barrier</span> <span class="ot">-></span> <span class="dt">IORef</span> a <span class="ot">-></span> <span class="dt">IORef</span> a <span class="ot">-></span> <span class="dt">IO</span> ()
swapIORef b x y <span class="fu">=</span> <span class="kw">do</span>
vx <span class="ot"><-</span> readIORef x
vy <span class="ot"><-</span> readIORef y
writeIORef x vy
writeIORef y vx
signalBarrier b
test1 <span class="fu">=</span> <span class="kw">do</span>
b <span class="ot"><-</span> newBarrier <span class="dv">2</span>
x1 <span class="ot"><-</span> newIORef (<span class="dv">1</span><span class="ot">::</span><span class="dt">Int</span>)
x2 <span class="ot"><-</span> newIORef (<span class="dv">2</span><span class="ot">::</span><span class="dt">Int</span>)
x3 <span class="ot"><-</span> newIORef (<span class="dv">3</span><span class="ot">::</span><span class="dt">Int</span>)
forkIO <span class="fu">$</span> swapIORef b x1 x2
forkIO <span class="fu">$</span> swapIORef b x2 x3
waitBarrier b
[v1,v2,v3] <span class="ot"><-</span> mapM (\x <span class="ot">-></span> readIORef x) [x1,x2,x3]
putStrLn <span class="fu">$</span> <span class="st">"x1 = "</span> <span class="fu">++</span> show v1
putStrLn <span class="fu">$</span> <span class="st">"x2 = "</span> <span class="fu">++</span> show v2
putStrLn <span class="fu">$</span> <span class="st">"x3 = "</span> <span class="fu">++</span> show v3
return ()</code></pre></div>
</div>
<div id="guaranteeing-mutually-exclusive-access-to-swapped-values" class="slide section level1">
<h1>Guaranteeing mutually exclusive access to swapped values</h1>
<p>The simplest solution is to impose a global lock.</p>
<p>This results in poor scalability because all concurrent swaps, even if they don't interfere, synchronize via the same global lock.</p>
<p>What about having a lock per swapped variable? Deadlocks are possible. For example, consider the concurrent execution of <code>swap x1 x2</code> and <code>swap x2 x1</code>.</p>
</div>
<div id="short-summary" class="slide section level1">
<h1>Short summary</h1>
<ul>
<li>MVar/Chan are lock-based primitives</li>
<li>The work horses of concurrent programming</li>
<li>Typical issues with locks
<ul>
<li>Forgetting to lock => data race</li>
<li>Too many locks, "global" lock => sequentializing of program execution, poor scalability</li>
<li>Finding appropriate locking order to avoid deadlocks can be tricky (recall bank transfer example from intro slides)</li>
</ul></li>
<li>Next: We take a look at "lock-free" approach to concurrent programming => Software Transactional Memory</li>
</ul>
</div>
<div id="software-transactional-memory-stm" class="slide section level1">
<h1>Software Transactional Memory (STM)</h1>
<p>Let's first recall the four rules of data base transactions</p>
<ul>
<li>Atomicity</li>
<li>Consistency</li>
<li>Isolation</li>
<li>Durability</li>
</ul>
<p>STM = data base transactions transferred to the programming language setting</p>
<p>Durability is dropped. RAM is not persistent</p>
</div>
<div id="stm-interface" class="slide section level1">
<h1>STM Interface</h1>
<div class="sourceCode"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span class="kw">data</span> <span class="dt">STM</span> a
<span class="kw">data</span> <span class="dt">TVar</span> a
<span class="ot">newTVarIO ::</span> a <span class="ot">-></span> <span class="dt">IO</span> (<span class="dt">TVar</span> a)
<span class="ot">newTVar ::</span> a <span class="ot">-></span> <span class="dt">STM</span> (<span class="dt">TVar</span> s)
<span class="ot">readTVar ::</span> <span class="dt">TVar</span> a <span class="ot">-></span> <span class="dt">STM</span> a
<span class="ot">writeTVar ::</span> <span class="dt">TVar</span> a <span class="ot">-></span> a <span class="ot">-></span> <span class="dt">STM</span> ()
<span class="ot">atomically ::</span> <span class="dt">STM</span> a <span class="ot">-></span> <span class="dt">IO</span> a
<span class="ot">retry ::</span> <span class="dt">STM</span> a
<span class="ot">orElse ::</span> <span class="dt">STM</span> a<span class="ot">-></span> <span class="dt">STM</span> a<span class="ot">-></span> <span class="dt">STM</span> a </code></pre></div>
<ul>
<li><code>TVar a</code> identifies a transactional variable which holds a value of type <code>a</code>
<ul>
<li>This is different from <code>IORef a</code>!</li>
</ul></li>
<li><code>STM</code> identifies a transactional computation
<ul>
<li>This is different from <code>IO</code>!</li>
</ul></li>
</ul>
</div>
<div id="atomic-swap-example" class="slide section level1">
<h1>Atomic swap example</h1>
<div class="sourceCode"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span class="ot">swap ::</span> <span class="dt">TVar</span> a <span class="ot">-></span> <span class="dt">TVar</span> a <span class="ot">-></span> <span class="dt">STM</span> ()
swap x y <span class="fu">=</span> <span class="kw">do</span>
vx <span class="ot"><-</span> readTVar x
vy <span class="ot"><-</span> readTVar y
writeTVar x vy
writeTVar y vx
<span class="ot">testSwap ::</span> <span class="dt">IO</span> ()
testSwap <span class="fu">=</span> <span class="kw">do</span>
x1 <span class="ot"><-</span> newTVarIO (<span class="dv">3</span><span class="ot">::</span><span class="dt">Int</span>)
x2 <span class="ot"><-</span> newTVarIO (<span class="dv">5</span><span class="ot">::</span><span class="dt">Int</span>)
atomically (swap x1 x2)</code></pre></div>
<ul>
<li><code>atomically</code> executes a STM transaction
<ul>
<li>If at the end of the transaction, none of the transaction actions are in conflict with another concurrently executed transaction, then commit the transaction actions.</li>
<li>Otherwise, we perform a rollback. That is, all of transaction actions are cancelled (i.e. are not visible to the outside) and the transaction is started again.</li>
<li>Typically, implemented via some <em>optimistic</em> concurrency protocol
<ul>
<li>If we only perform read operations, there's no point to lock variables</li>
</ul></li>
</ul></li>
<li>Point to note: Clear separation between <code>IO</code> and <code>STM</code></li>
</ul>
</div>
<div id="io-and-stm-cant-be-mixed" class="slide section level1">
<h1>IO and STM can't be mixed</h1>
<div class="sourceCode"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span class="ot">someIOSideEffect ::</span> <span class="dt">IO</span> ()
someIOSideEffect <span class="fu">=</span> <span class="kw">do</span> deleteSomeFile
fireMissile</code></pre></div>
<p>The following yields a type error</p>
<div class="sourceCode"><pre class="sourceCode haskell"><code class="sourceCode haskell">prog <span class="fu">=</span> <span class="kw">do</span> <span class="fu">...</span>
atomically someIOSideEffect
<span class="fu">...</span></code></pre></div>
<ul>
<li><code>atomically</code> expects <code>STM</code> and not <code>IO</code></li>
<li><code>STM</code> computations may only affect transactional variables</li>
<li>Fairly easy to rollback and commit actions on transactional variables</li>
<li>Pretty much impossible to rollback arbitrary <code>IO</code> actions like <code>fireMissile</code></li>
<li>Therefore, the Haskell type system <em>statically</em> prevents us from applying <code>atomically</code> on <code>IO</code> actions</li>
</ul>
</div>
<div id="bank-account---retry" class="slide section level1">
<h1>Bank account - retry</h1>
<div class="sourceCode"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span class="ot">transfer ::</span> <span class="dt">TVar</span> <span class="dt">Int</span> <span class="ot">-></span> <span class="dt">TVar</span> <span class="dt">Int</span> <span class="ot">-></span> <span class="dt">Int</span> <span class="ot">-></span> <span class="dt">IO</span> ()
transfer fromAcc toAcc amount <span class="fu">=</span>
atomically <span class="fu">$</span> <span class="kw">do</span>
f <span class="ot"><-</span> readTVar fromAcc
<span class="kw">if</span> f <span class="fu"><=</span> amount
<span class="kw">then</span> retry
<span class="kw">else</span> <span class="kw">do</span>
writeTVar fromAcc (f <span class="fu">-</span> amount)
t <span class="ot"><-</span> readTVar toAcc
writeTVar toAcc (t <span class="fu">+</span> amount)</code></pre></div>
<ul>
<li>User-controlled rollback of transaction via <code>retry</code></li>
<li>Restart only if any of the transactional variables have changed</li>
<li>Immediate restart would be pointless because we would then again perform <code>retry</code></li>
</ul>
</div>
<div id="bank-account---orelse" class="slide section level1">
<h1>Bank account - orElse</h1>
<div class="sourceCode"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span class="ot">transfer2 ::</span> <span class="dt">TVar</span> <span class="dt">Int</span> <span class="ot">-></span> <span class="dt">TVar</span> <span class="dt">Int</span> <span class="ot">-></span> <span class="dt">Int</span> <span class="ot">-></span> <span class="dt">STM</span> ()
transfer2 fromAcc toAcc amount <span class="fu">=</span>
(<span class="kw">do</span> f <span class="ot"><-</span> readTVar fromAcc
<span class="kw">if</span> f <span class="fu"><=</span> amount
<span class="kw">then</span> retry
<span class="kw">else</span> <span class="kw">do</span>
writeTVar fromAcc (f <span class="fu">-</span> amount)
t <span class="ot"><-</span> readTVar toAcc
writeTVar toAcc (t <span class="fu">+</span> amount) )
<span class="ot">`orElse`</span>
transfer2 fromAcc toAcc (amount<span class="fu">-</span><span class="dv">50</span>) </code></pre></div>
<ul>
<li>Provide alternatives via <code>orElse</code> if a transaction is retried</li>
<li>In our example, we attempt another transfer by decreasing the amount by 50</li>
</ul>
</div>
<div id="stm-summary" class="slide section level1">
<h1>STM Summary</h1>
<ul>
<li>Issues
<ul>
<li>Long running transactions may never finish</li>
<li>No communication between transactions</li>
<li>Fairness in case of rollbacks</li>
</ul></li>
<li><p>In general, concurrent programs are much easier to get right with STM than with locks</p></li>
<li>STM extensions exist for many programming languages
<ul>
<li>C, C++, Java, ...</li>
</ul></li>
<li><p>STM is particularly beautiful in Haskell thanks to the strict separation between <code>IO</code> and <code>STM</code> computations</p></li>
</ul>
</div>
<div id="atomic-compare-swap" class="slide section level1">
<h1>Atomic compare-swap</h1>
<p>Most STM implementations rely on a compare-and-swap (CAS) instruction.</p>
<p>CAS in Haskell.</p>
<div class="sourceCode"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span class="ot">casIORef ::</span> <span class="dt">Eq</span> a <span class="ot">=></span> <span class="dt">IORef</span> a <span class="ot">-></span> a <span class="ot">-></span> a <span class="ot">-></span> <span class="dt">IO</span> <span class="dt">Bool</span>
casIORef ptr old new <span class="fu">=</span>
atomicModifyIORef ptr (\ cur <span class="ot">-></span> <span class="kw">if</span> cur <span class="fu">==</span> old
<span class="kw">then</span> (new, <span class="dt">True</span>)
<span class="kw">else</span> (cur, <span class="dt">False</span>))</code></pre></div>
<p>The behavior of primitive <code>atomicModifyIORef</code> is as follows.</p>
<div class="sourceCode"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span class="ot">atomicModifyIORef ::</span> <span class="dt">IORef</span> a <span class="ot">-></span> (a <span class="ot">-></span> (a,b)) <span class="ot">-></span> <span class="dt">IO</span> b
atomicModifyIORef r f <span class="fu">=</span> <span class="kw">do</span>
a <span class="ot"><-</span> readIORef r
<span class="kw">let</span> p <span class="fu">=</span> f a
writeIORef r (fst p)
return (snd p)</code></pre></div>
<p>where we assume that the above sequence of operations are executed <em>atomically</em>.</p>
<p>CAS with STM.</p>
<div class="sourceCode"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span class="ot">casSTM ::</span> <span class="dt">Eq</span> a <span class="ot">=></span> <span class="dt">TVar</span> a <span class="ot">-></span> a <span class="ot">-></span> a <span class="ot">-></span> <span class="dt">IO</span> <span class="dt">Bool</span>
casSTM ptr old new <span class="fu">=</span>
atomically <span class="fu">$</span> <span class="kw">do</span>
cur <span class="ot"><-</span> readTVar ptr
<span class="kw">if</span> cur <span class="fu">==</span> old
<span class="kw">then</span> <span class="kw">do</span> writeTVar ptr new
return <span class="dt">True</span>
<span class="kw">else</span> return <span class="dt">False</span></code></pre></div>
</div>
<div id="exercises-concurrent-programming-with-stm" class="slide section level1">
<h1>Exercises: Concurrent Programming with STM</h1>
<h2 id="stm-based-semaphore">STM-based Semaphore</h2>
<p>The semaphore is classic concurrent data structure. Below you are given an interface to an unbounded semaphore. Your task is to provide the implementation details. Your implementation shall make use of STM</p>
<div class="sourceCode"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span class="ot">newSem ::</span> <span class="dt">Int</span> <span class="ot">-></span> <span class="dt">IO</span> <span class="dt">Sem</span>
<span class="ot">p ::</span> <span class="dt">Sem</span> <span class="ot">-></span> <span class="dt">STM</span> ()
<span class="ot">v ::</span> <span class="dt">Sem</span> <span class="ot">-></span> <span class="dt">STM</span> ()</code></pre></div>
<h2 id="dinining-philosophers">Dinining Philosophers</h2>
<p>Implement the classic concurrency example of dining philosophers with STM. You will find many solutions already on the net. Additional tasks: Does your STM solution guarantee fairness (each philosopher will eventually be able to eat). Compare STM solutions against traditional lock-based solutions.</p>
<p>Hints: Represents forks as transactional variables. For simplicity, you may consider a specific instances with three philosophers and four forks.</p>
<h2 id="sleeping-barber">Sleeping Barber</h2>
<p>This is yet another classic concurrency example.</p>
<p>The barber has one barber chair and a waiting room with a number of chairs in it. When the barber finishes cutting a customer's hair, he dismisses the customer and then goes to the waiting room to see if there are other customers waiting. If there are, he brings one of them back to the chair and cuts his hair. If there are no other customers waiting, he returns to his chair and sleeps in it.</p>
<p>Each customer, when he arrives, looks to see what the barber is doing. If the barber is sleeping, then the customer wakes him up and sits in the chair. If the barber is cutting hair, then the customer goes to the waiting room. If there is a free chair in the waiting room, the customer sits in it and waits his turn. If there is no free chair, then the customer leaves.</p>
<p>How to represent the barber and its shop? For example, the barber could be represented as a transactional variable which has several states (cutting, sleeping). In a first instance, you could ignore waiting chairs.</p>
<h3 id="appendix">Appendix</h3>
<p>You will need the following imports in your program.</p>
<pre class="hs"><code>import Control.Concurrent
import Control.Concurrent.STM
import Data.IORef
import Data.List</code></pre>
<h3 id="sample-solutions">Sample Solutions</h3>
<div class="sourceCode"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span class="kw">import </span><span class="dt">Control.Concurrent</span>
<span class="kw">import </span><span class="dt">Control.Concurrent.STM</span>
<span class="kw">import </span><span class="dt">Data.IORef</span>
<span class="kw">import </span><span class="dt">Data.List</span>
<span class="co">-- semaphore</span>
<span class="kw">type</span> <span class="dt">Sem</span> <span class="fu">=</span> <span class="dt">TVar</span> <span class="dt">Int</span>
<span class="ot">newSem ::</span> <span class="dt">Int</span> <span class="ot">-></span> <span class="dt">IO</span> <span class="dt">Sem</span>
newSem n <span class="fu">=</span> newTVarIO n
<span class="ot">p ::</span> <span class="dt">Sem</span> <span class="ot">-></span> <span class="dt">STM</span> ()
p sem <span class="fu">=</span> <span class="kw">do</span> n <span class="ot"><-</span> readTVar sem
<span class="kw">if</span> n <span class="fu">></span> <span class="dv">0</span>
<span class="kw">then</span> writeTVar sem (n<span class="fu">-</span><span class="dv">1</span>)
<span class="kw">else</span> retry
<span class="ot">v ::</span> <span class="dt">Sem</span> <span class="ot">-></span> <span class="dt">STM</span> ()
v sem <span class="fu">=</span> <span class="kw">do</span> n <span class="ot"><-</span> readTVar sem
writeTVar sem (n<span class="fu">+</span><span class="dv">1</span>)
testSem <span class="fu">=</span> <span class="kw">do</span> s <span class="ot"><-</span> newSem <span class="dv">5</span>
atomically <span class="fu">$</span> p s
atomically <span class="fu">$</span> v s
<span class="co">-- Dining philosopher:</span>
<span class="co">-- We assume that forks are unordered.</span>
<span class="ot">philo ::</span> <span class="dt">Int</span> <span class="ot">-></span> <span class="dt">TVar</span> <span class="dt">Int</span> <span class="ot">-></span> <span class="dt">Chan</span> [<span class="dt">Char</span>] <span class="ot">-></span> <span class="dt">IO</span> ()
philo no forks out <span class="fu">=</span> <span class="kw">do</span>
atomically <span class="fu">$</span> <span class="kw">do</span> v <span class="ot"><-</span> readTVar forks
<span class="kw">if</span> v <span class="fu"><=</span> <span class="dv">1</span>
<span class="kw">then</span> retry
<span class="kw">else</span> writeTVar forks (v<span class="fu">-</span><span class="dv">2</span>)
writeChan out <span class="fu">$</span> <span class="st">"Philosopher "</span> <span class="fu">++</span> show no <span class="fu">++</span> <span class="st">" is eating"</span>
threadDelay <span class="dv">1000000</span>
atomically <span class="fu">$</span> <span class="kw">do</span> v <span class="ot"><-</span> readTVar forks
writeTVar forks (v<span class="fu">+</span><span class="dv">2</span>)
philo no forks out
printOut out <span class="fu">=</span> <span class="kw">do</span>
txt <span class="ot"><-</span> readChan out
putStrLn txt
printOut out
testPhilo <span class="fu">=</span> <span class="kw">do</span>
out <span class="ot"><-</span> newChan
forks <span class="ot"><-</span> newTVarIO <span class="dv">4</span>
forkIO <span class="fu">$</span> philo <span class="dv">1</span> forks out
forkIO <span class="fu">$</span> philo <span class="dv">2</span> forks out
forkIO <span class="fu">$</span> philo <span class="dv">3</span> forks out
printOut out</code></pre></div>
</div>
</body>
</html>