3 // $Id: slides.js 4931 2005-06-21 15:45:53Z kosek $
5 // Copyright (C) 2002 Norman Walsh
7 // You are free to use, modify and distribute this software without limitation.
8 // This software is provided "AS IS," without a warranty of any kind.
10 // This script assumes that the Netscape 'ua.js' module has also been loaded.
12 function newPage(filename, overlay) {
13 divs = document.getElementsByTagName("div");
19 var xid = xdiv.getAttribute("id");
21 var mytoc = window.top.frames[0];
22 if (mytoc.lastUnderlined) {
23 mytoc.lastUnderlined.style.textDecoration = "none";
26 var tdiv = xbGetElementById(xid, mytoc);
29 var ta = tdiv.getElementsByTagName("a").item(0);
30 ta.style.textDecoration = "underline";
31 mytoc.lastUnderlined = ta;
42 function navigate (evt) {
45 if (navigator.org == 'microsoft' || navigator.family == 'opera') {
46 kc = window.event.keyCode;
47 } else if (navigator.family == 'gecko') {
56 var forward = (kc == 110) || (kc == 78) || (kc == 32)
57 || (kc == 10) || (kc == 13) || (kc == 34)
59 /* n, N, SPACE, ENTER, RETURN, PAGE UP, RIGHT ARROW */
60 var backward = (kc == 112) || (kc == 80) || (kc == 8)
61 || (kc == 33) || (kc == 37);
62 /* p, P, BACKSPACE, PAGE DOWN, LEFT ARROW */
63 var up = (kc == 117) || (kc == 85) || (kc == 38);
65 var home = (kc == 104) || (kc == 72) || (kc == 36);
67 var toc = (kc == 116) || (kc == 84);
69 /* previously included META (kc == 244) */
71 var links = document.getElementsByTagName("link");
76 for (count = 0; count < links.length; count++) {
77 if (home && (links[count].getAttribute("rel") == 'top')) {
78 target = links[count].getAttribute("href");
80 if (toc && (links[count].getAttribute("rel") == 'contents')) {
81 target = links[count].getAttribute("href");
83 if (up && (links[count].getAttribute("rel") == 'up')) {
84 target = links[count].getAttribute("href");
86 if (forward && (links[count].getAttribute("rel") == 'next')) {
87 target = links[count].getAttribute("href");
89 if (backward && (links[count].getAttribute("rel") == 'previous')) {
90 target = links[count].getAttribute("href");
95 if (window.top.frames[1]) {
96 window.top.frames[1].location = target;
98 window.location = target;
105 function toggletoc (img, width, hidegraphic, showgraphic) {
106 var fsc = top.GetElementsByTagName('frameset');
110 if (fs.cols == "0,*") {
111 fs.cols = width + ",*";
112 img.src = hidegraphic;
115 img.src = showgraphic;