comparison jssst2011/ui/default_utf/slides.js @ 7:f542388881a9 default tip

added slides beta
author Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
date Sun, 25 Sep 2011 03:42:16 +0900
parents
children
comparison
equal deleted inserted replaced
6:bd7d39a4e57f 7:f542388881a9
1 // S5 1.3beta7 (18-Apr-2007) advanced version by C. Effenberger
2 // Please see http://s5.netzgesta.de/ for more information
3 // based on S5 v1.2a1 slides.js -- released into the Public Domain
4 // Please see http://www.meyerweb.com/eric/tools/s5/credits.html for information
5 // about all the wonderful and talented contributors to this code!
6 // audio extension: soundmanager2 is NOT Public Domain
7 // Please see http://www.schillmania.com/projects/soundmanager2/ for information
8
9 var undef;
10 var slideCSS = '';
11 var snum = 0;
12 var smax = 1;
13 var incpos = 0;
14 var number = undef;
15 var firstTime = 1;
16 var s5mode = true;
17 var helpmode = false;
18 var defaultView = 'slideshow'; //outline
19 var controlVis = 'visible';
20
21 // scalable images extension
22 var empx = 0;
23 var images = new Array();
24 var canvas = new Array();
25 var medias = new Array();
26 var piecharts = new Array();
27 var barcharts = new Array();
28 var linecharts = new Array();
29 // scalable images extension
30
31 // transition extension
32 var tranSitions = false;
33 var fadeModus = false;
34 var fadeDuration = 500;
35 var incrDuration = 250;
36 var opac = 1;
37 var cid = '';
38 var nid = '';
39 var tid = '';
40 var jl = '';
41 // transition extension
42
43 // autoplay extension
44 var autoMatic = false;
45 var playLoop = false;
46 var playPause = false;
47 var autoRun = false;
48 var playDelay = 5000;
49 var remainDer = 0;
50 var incrDelay = 0;
51 // autoplay extension
52
53 // audio extension
54 var sound = new Array();
55 var audioSupport = false;
56 var audioVolume = 100;
57 var audioError = false;
58 var swfUnloaded = true;
59 var bgSoundItem = 9999;
60 var curSoundID = -1;
61 // audio extension
62
63 // panel extension
64 var highLight = "rgb(255, 204, 0)";
65 // panel extension
66
67 // canvas chart extension
68 var canvasSupport = false;
69 var ChartData = new Array();
70 var colorSlice = new Array();
71 var font = document.createElement("img");
72 font.setAttribute("src", "ui/graphic_support/numeric.png");
73 signs = {
74 '0': {sx: 0, sy: 0, sw: 48, sh: 64},
75 '1': {sx: 48, sy: 0, sw: 48, sh: 64},
76 '2': {sx: 96, sy: 0, sw: 48, sh: 64},
77 '3': {sx: 144, sy: 0, sw: 48, sh: 64},
78 '4': {sx: 192, sy: 0, sw: 48, sh: 64},
79 '5': {sx: 240, sy: 0, sw: 48, sh: 64},
80 '6': {sx: 288, sy: 0, sw: 48, sh: 64},
81 '7': {sx: 336, sy: 0, sw: 48, sh: 64},
82 '8': {sx: 384, sy: 0, sw: 48, sh: 64},
83 '9': {sx: 432, sy: 0, sw: 48, sh: 64},
84 '%': {sx: 480, sy: 0, sw: 48, sh: 64},
85 '.': {sx: 528, sy: 0, sw: 24, sh: 64}
86 };
87 var colorNames= new Array();
88 colorNames["black"]="#000000"; colorNames["maroon"]="#800000";
89 colorNames["green"]="#008000"; colorNames["olive"]="#808000";
90 colorNames["navy"]="#000080"; colorNames["purple"]="#800080";
91 colorNames["teal"]="#008080"; colorNames["gray"]="#808080";
92 colorNames["silver"]="#C0C0C0"; colorNames["red"]="#FF0000";
93 colorNames["lime"]="#00FF00"; colorNames["yellow"]="#FFFF00";
94 colorNames["blue"]="#0000FF"; colorNames["fuchsia"]="#FF00FF";
95 colorNames["aqua"]="#00FFFF"; colorNames["white"]="#FFFFFF";
96 colorNames["aliceblue"]="#F0F8FF"; colorNames["antiquewhite"]="#FAEBD7";
97 colorNames["aquamarine"]="#7FFFD4"; colorNames["azure"]="#F0FFFF";
98 colorNames["beige"]="#F5F5DC"; colorNames["blueviolet"]="#8A2BE2";
99 colorNames["brown"]="#A52A2A"; colorNames["burlywood"]="#DEB887";
100 colorNames["cadetblue"]="#5F9EA0"; colorNames["chartreuse"]="#7FFF00";
101 colorNames["chocolate"]="#D2691E"; colorNames["coral"]="#FF7F50";
102 colorNames["cornflowerblue"]="#6495ED"; colorNames["cornsilk"]="#FFF8DC";
103 colorNames["crimson"]="#DC143C"; colorNames["darkblue"]="#00008B";
104 colorNames["darkcyan"]="#008B8B"; colorNames["darkgoldenrod"]="#B8860B";
105 colorNames["darkgray"]="#A9A9A9"; colorNames["darkgreen"]="#006400";
106 colorNames["darkkhaki"]="#BDB76B"; colorNames["darkmagenta"]="#8B008B";
107 colorNames["darkolivegreen"]="#556B2F"; colorNames["darkorange"]="#FF8C00";
108 colorNames["darkorchid"]="#9932CC"; colorNames["darkred"]="#8B0000";
109 colorNames["darksalmon"]="#E9967A"; colorNames["darkseagreen"]="#8FBC8F";
110 colorNames["darkslateblue"]="#483D8B"; colorNames["darkslategray"]="#2F4F4F";
111 colorNames["darkturquoise"]="#00CED1"; colorNames["darkviolet"]="#9400D3";
112 colorNames["deeppink"]="#FF1493"; colorNames["deepskyblue"]="#00BFFF";
113 colorNames["dimgray"]="#696969"; colorNames["dodgerblue"]="#1E90FF";
114 colorNames["firebrick"]="#B22222"; colorNames["floralwhite"]="#FFFAF0";
115 colorNames["forestgreen"]="#228B22"; colorNames["gainsboro"]="#DCDCDC";
116 colorNames["ghostwhite"]="#F8F8FF"; colorNames["gold"]="#FFD700";
117 colorNames["goldenrod"]="#DAA520"; colorNames["greenyellow"]="#ADFF2F";
118 colorNames["honeydew"]="#F0FFF0"; colorNames["hotpink"]="#FF69B4";
119 colorNames["indianred"]="#CD5C5C"; colorNames["indigo"]="#4B0082";
120 colorNames["ivory"]="#FFFFF0"; colorNames["khaki"]="#F0E68C";
121 colorNames["lavender"]="#E6E6FA"; colorNames["lavenderblush"]="#FFF0F5";
122 colorNames["lawngreen"]="#7CFC00"; colorNames["lemonchiffon"]="#FFFACD";
123 colorNames["lightblue"]="#ADD8E6"; colorNames["lightcoral"]="#F08080";
124 colorNames["lightcyan"]="#E0FFFF"; colorNames["lightgoldenrodyellow"]="#FAFAD2";
125 colorNames["lightgreen"]="#90EE90"; colorNames["lightgrey"]="#D3D3D3";
126 colorNames["lightpink"]="#FFB6C1"; colorNames["lightsalmon"]="#FFA07A";
127 colorNames["lightseagreen"]="#20B2AA"; colorNames["lightskyblue"]="#87CEFA";
128 colorNames["lightslategray"]="#778899"; colorNames["lightsteelblue"]="#B0C4DE";
129 colorNames["lightyellow"]="#FFFFE0"; colorNames["limegreen"]="#32CD32";
130 colorNames["linen"]="#FAF0E6"; colorNames["mediumaquamarine"]="#66CDAA";
131 colorNames["mediumblue"]="#0000CD"; colorNames["mediumorchid"]="#BA55D3";
132 colorNames["ediumpurple"]="#9370D"; colorNames["mediumseagreen"]="#3CB371";
133 colorNames["mediumslateblue"]="#7B68EE"; colorNames["mediumspringgreen"]="#00FA9A";
134 colorNames["mediumturquoise"]="#48D1CC"; colorNames["mediumvioletred"]="#C71585";
135 colorNames["midnightblue"]="#191970"; colorNames["mintcream"]="#F5FFFA";
136 colorNames["mistyrose"]="#FFE4E1"; colorNames["moccasin"]="#FFE4B5";
137 colorNames["navajowhite"]="#FFDEAD"; colorNames["oldlace"]="#FDF5E6";
138 colorNames["olivedrab"]="#6B8E23"; colorNames["orange"]="#FFA500";
139 colorNames["orangered"]="#FF4500"; colorNames["orchid"]="#DA70D6";
140 colorNames["palegoldenrod"]="#EEE8AA"; colorNames["palegreen"]="#98FB98";
141 colorNames["paleturquoise"]="#AFEEEE"; colorNames["palevioletred"]="#DB7093";
142 colorNames["papayawhip"]="#FFEFD5"; colorNames["peachpuff"]="#FFDAB9";
143 colorNames["peru"]="#CD853F"; colorNames["pink"]="#FFC0CB";
144 colorNames["plum"]="#DDA0DD"; colorNames["powderblue"]="#B0E0E6";
145 colorNames["rosybrown"]="#BC8F8F"; colorNames["royalblue"]="#4169E1";
146 colorNames["saddlebrown"]="#8B4513"; colorNames["salmon"]="#FA8072";
147 colorNames["sandybrown"]="#F4A460"; colorNames["seagreen"]="#2E8B57";
148 colorNames["seashell"]="#FFF5EE"; colorNames["sienna"]="#A0522D";
149 colorNames["skyblue"]="#87CEEB"; colorNames["slateblue"]="#6A5ACD";
150 colorNames["slategray"]="#708090"; colorNames["snow"]="#FFFAFA";
151 colorNames["springgreen"]="#00FF7F"; colorNames["steelblue"]="#4682B4";
152 colorNames["tan"]="#D2B48C"; colorNames["thistle"]="#D8BFD8";
153 colorNames["tomato"]="#FF6347"; colorNames["turquoise"]="#40E0D0";
154 colorNames["violet"]="#EE82EE"; colorNames["wheat"]="#F5DEB3";
155 colorNames["whitesmoke"]="#F5F5F5"; colorNames["yellowgreen"]="#9ACD32";
156 var canvas_bgcolor = "";
157 var canvas_width = 200;
158 var canvas_height = 200;
159 var canvas_noshade = 0;
160 var canvas_nofill = 0;
161 var canvas_noshadow = 0;
162 var canvas_htmltext = 0;
163 var canvas_imgtext = 0;
164 var canvas_notext = 0;
165 // canvas chart extension
166
167 var s5NotesWindow;
168 var s5NotesWindowLoaded = false;
169 var previousSlide = 0;
170 var presentationStart = new Date();
171 var slideStart = new Date();
172
173 var countdown = {
174 timer: 0,
175 state: 'pause',
176 start: new Date(),
177 end: 0,
178 remaining: 0
179 };
180
181 var isIE = navigator.appName == 'Microsoft Internet Explorer' && navigator.userAgent.indexOf('Opera') < 1 ? 1 : 0;
182 if(isIE) var notIE7 = parseInt(navigator.appVersion) < 7 ? 1 : 0;
183 var isOp = navigator.userAgent.indexOf('Opera') > -1 ? 1 : 0;
184 var isGe = navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('Safari') < 1 ? 1 : 0;
185 var isS2 = navigator.userAgent.indexOf('Safari') >= 2 ? 1 : 0;
186
187 function hasClass(object, className) {
188 if (!object.className) return false;
189 return (object.className.search('(^|\\s)' + className + '(\\s|$)') != -1);
190 }
191
192 function hasValue(object, value) {
193 if (!object) return false;
194 return (object.search('(^|\\s)' + value + '(\\s|$)') != -1);
195 }
196
197 function removeClass(object,className) {
198 if (!object || !hasClass(object,className)) return;
199 object.className = object.className.replace(new RegExp('(^|\\s)'+className+'(\\s|$)'), RegExp.$1+RegExp.$2);
200 }
201
202 function addClass(object,className) {
203 if (!object || hasClass(object, className)) return;
204 if (object.className) {
205 object.className += ' '+className;
206 } else {
207 object.className = className;
208 }
209 }
210
211 function changeClass(object,className) {
212 if (!object) return;
213 object.firstChild.className = className;
214 }
215
216 function GetElementsWithClassName(elementName,className) {
217 var allElements = document.getElementsByTagName(elementName);
218 var elemColl = new Array();
219 for (var i = 0; i< allElements.length; i++) {
220 if (hasClass(allElements[i], className)) {
221 elemColl[elemColl.length] = allElements[i];
222 }
223 }
224 return elemColl;
225 }
226
227 function isParentOrSelf(element, id) {
228 if (element == null || element.nodeName=='BODY') return false;
229 else if (element.id == id) return true;
230 else return isParentOrSelf(element.parentNode, id);
231 }
232
233 function nodeValue(node) {
234 var result = "";
235 if (node.nodeType == 1) {
236 var children = node.childNodes;
237 for (var i = 0; i < children.length; ++i) {
238 result += nodeValue(children[i]);
239 }
240 }
241 else if (node.nodeType == 3) {
242 result = node.nodeValue;
243 }
244 return(result);
245 }
246
247 function slideLabel() {
248 var slideColl = GetElementsWithClassName('*','slide');
249 var list = document.getElementById('jumplist');
250 smax = slideColl.length;
251 for (var n = 0; n < smax; n++) {
252 var obj = slideColl[n];
253 var did = 'slide' + n.toString();
254 obj.setAttribute('id',did);
255 var otext = '';
256 var menu = obj.firstChild;
257 if (!menu) continue; // to cope with empty slides
258 while (menu && menu.nodeType == 3) {
259 menu = menu.nextSibling;
260 }
261 if (!menu) continue; // to cope with slides with only text nodes
262 var menunodes = menu.childNodes;
263 for (var o = 0; o < menunodes.length; o++) {
264 otext += nodeValue(menunodes[o]);
265 }
266 list.options[list.length] = new Option(n + ' : ' + otext, n);
267 }
268 }
269
270 function currentSlide() {
271 var cs, at, fd, ss;
272 if (document.getElementById) {
273 cs = document.getElementById('currentSlide');
274 } else {
275 cs = document.currentSlide;
276 }
277 fd = fadeModus?"F":"&ndash;";
278 ss = audioSupport?"S":"&ndash;";
279 at = (autoMatic?(playPause?"||":(playLoop?"&gt;0":"&gt;|")):"&ndash;&ndash;");
280 cs.innerHTML = '<div id="plink" nowrap="nowrap">' +
281 '<span id="csFade">[' + fd + ss + ']<\/span>&nbsp;' +
282 '<span id="csHere"><strong>' + snum + '<\/strong><\/span>' +
283 '<span id="csSep">\/<\/span>' +
284 '<span id="csTotal">' + (smax-1) + '<\/span>&nbsp;' +
285 '<span id="csAuto">[' + at + ']<\/span>' +
286 '<\/div>';
287
288 if (snum == 0) {
289 cs.style.visibility = 'hidden';
290 } else {
291 cs.style.visibility = 'visible';
292 }
293 }
294
295 function go(step) {
296 if (document.getElementById('slideProj').disabled || step == 0) return;
297 jl = document.getElementById('jumplist');
298 cid = 'slide' + snum;
299 var ce = document.getElementById(cid);
300 if (incrementals[snum].length > 0) {
301 for (var i = 0; i < incrementals[snum].length; i++) {
302 removeClass(incrementals[snum][i], 'current');
303 removeClass(incrementals[snum][i], 'incremental');
304 }
305 }
306 if (step != 'j') {
307 snum += step;
308 lmax = smax - 1;
309 if (snum > lmax) snum = lmax;
310 if (snum < 0) snum = 0;
311 }else {
312 snum = parseInt(jl.value);
313 }
314 nid = 'slide' + snum;
315 var ne = document.getElementById(nid);
316 if (!ne) {
317 ne = document.getElementById('slide0');
318 nid = 'slide0';
319 snum = 0;
320 }
321 if (step < 0) {
322 incpos = incrementals[snum].length
323 }else {
324 incpos = 0;
325 }
326 if (incrementals[snum].length > 0 && incpos == 0) {
327 for (var i = 0; i < incrementals[snum].length; i++) {
328 if (hasClass(incrementals[snum][i], 'current')) {
329 incpos = i + 1;
330 }else {
331 addClass(incrementals[snum][i], 'incremental');
332 }
333 }
334 }
335 if (incrementals[snum].length > 0 && incpos > 0) {
336 addClass(incrementals[snum][incpos - 1], 'current');
337 }
338 var guru = document.getElementById('guru');
339 if(guru && snum==0) {
340 guru.style.visibility = 'visible';
341 }else if(guru && snum>0) {
342 guru.style.visibility = 'hidden';
343 }
344 if(tranSitions && s5mode && fadeModus) {
345 if(curSoundID != getSoundID(nid)) {
346 if(curSoundID == bgSoundItem && !sound[getSoundID(nid)]) {
347 }else {fadeoutSound(curSoundID,true); } // audio support
348 }
349 changeOpac(0,nid);
350 changeOpac(100,cid);
351 ce.style.visibility = 'visible';
352 shiftOpacity(cid,fadeDuration);
353 window.setTimeout("changeSlides()",fadeDuration);
354 }else {
355 if(curSoundID != getSoundID(nid)) {
356 if(curSoundID == bgSoundItem && !sound[getSoundID(nid)]) {
357 }else {stopSound(curSoundID); } // audio support
358 }
359 ce.style.visibility = 'hidden';
360 if (isOp) location.hash = nid;
361 ne.style.visibility = 'visible';
362 finishSlides();
363 }
364 }
365
366 function changeSlides() {
367 if(nid != cid) changeOpac(100,cid);
368 document.getElementById(cid).style.visibility = 'hidden';
369 document.getElementById(nid).style.visibility = 'visible';
370 if (isOp) location.hash = nid;
371 shiftOpacity(nid,fadeDuration);
372 window.setTimeout("finishSlides()",fadeDuration);
373 }
374
375 function finishSlides() {
376 jl.selectedIndex = snum;
377 currentSlide();
378 loadNote();
379 permaLink();
380 number = undef;
381 if(sound[getSoundID(nid)]) {
382 playSound(nid); // audio support
383 }else if(sound[bgSoundItem] && curSoundID != bgSoundItem) {
384 playSound(bgSoundItem); // audio support
385 }
386 }
387
388 function goTo(target) {
389 if (target >= smax || target == snum) return;
390 go(target - snum);
391 }
392
393 function subgo(step) {
394 if (step > 0) {
395 removeClass(incrementals[snum][incpos - 1],'current');
396 removeClass(incrementals[snum][incpos], 'incremental');
397 if(tranSitions && s5mode && fadeModus) {
398 if(!incrementals[snum][incpos].id) {
399 var tmp = new Date(); tid = "inc" + String(tmp.getTime());
400 incrementals[snum][incpos].id = tid;
401 }else {
402 tid = incrementals[snum][incpos].id;
403 }
404 if(typeof(incrementals[snum][incpos].src) != "undefined" || incrementals[snum][incpos].getContext) {
405 changeOpac(0,tid);
406 addClass(incrementals[snum][incpos],'current');
407 shiftOpacity(tid,incrDuration);
408 setTimeout("nextInc()",incrDuration);
409 }else {
410 addClass(incrementals[snum][incpos],'current');
411 nextInc();
412 }
413 }else {
414 addClass(incrementals[snum][incpos],'current');
415 nextInc();
416 }
417 } else {
418 incpos--;
419 removeClass(incrementals[snum][incpos],'current');
420 addClass(incrementals[snum][incpos], 'incremental');
421 addClass(incrementals[snum][incpos - 1],'current');
422 loadNote();
423 }
424 }
425
426 function nextInc() {
427 incpos++;
428 loadNote();
429 }
430
431 function toggle() {
432 var slideColl = GetElementsWithClassName('*','slide');
433 var slides = document.getElementById('slideProj');
434 var outline = document.getElementById('outlineStyle');
435 var guru = document.getElementById('guru');
436 if (!slides.disabled) {
437 stopPlay();
438 if(audioSupport && !swfUnloaded) stopAllSounds();
439 slides.disabled = true;
440 outline.disabled = false;
441 s5mode = false;
442 fontSize(1,'em');
443 for (var n = 0; n < smax; n++) {
444 var slide = slideColl[n];
445 slide.style.visibility = 'visible';
446 }
447 if(guru) guru.style.visibility = 'hidden';
448 } else {
449 slides.disabled = false;
450 outline.disabled = true;
451 s5mode = true;
452 fontScale();
453 for (var n = 0; n < smax; n++) {
454 var slide = slideColl[n];
455 slide.style.visibility = 'hidden';
456 }
457 slideColl[snum].style.visibility = 'visible';
458 if(guru && snum==0) guru.style.visibility = 'visible';
459 }
460 }
461
462 function showHide(action) {
463 var obj = GetElementsWithClassName('*','hideme')[0];
464 switch (action) {
465 case 's':
466 obj.style.visibility = 'visible';
467 break;
468 case 'h':
469 obj.style.visibility = 'hidden';
470 break;
471 case 'k':
472 if (obj.style.visibility != 'visible') {
473 obj.style.visibility = 'visible';
474 } else {
475 obj.style.visibility = 'hidden';
476 }
477 break;
478 }
479 }
480
481 function keys(key) {
482 if (!key) {
483 key = event;
484 key.which = key.keyCode;
485 }
486 if (helpmode) {
487 dumpHelpReq();
488 return;
489 }
490 if (key.which == 84 && !isOp) {
491 toggle();
492 return;
493 }
494 if (s5mode) {
495 if (autoMatic) {
496 switch (key.which) {
497 case 70: // f/ading on/off
498 switchFade();
499 break;
500 case 83: // s/ound on/off
501 toggleSounds();
502 break;
503 case 67: // c
504 showHide('k');
505 break;
506 case 65: // a/utoplay on/off
507 stopPlay();
508 break;
509 case 76: // l/ooping on/off
510 switchLoop();
511 break;
512 case 80: // p/ause
513 case 32: // spacebar
514 pausePlay();
515 break;
516 }
517 }else {
518 switch (key.which) {
519 case 8: // backspace = HELP
520 createHelpReq();
521 break;
522 case 10: // return
523 case 13: // enter
524 if (window.event && isParentOrSelf(window.event.srcElement, 'controls')) return;
525 if (key.target && isParentOrSelf(key.target, 'controls')) return;
526 if(number != undef) {
527 goTo(number);
528 break;
529 }
530 case 32: // spacebar
531 case 34: // page down
532 case 39: // rightkey
533 case 40: // downkey
534 if(number != undef) {
535 go(number);
536 } else if (!incrementals[snum] || incpos >= incrementals[snum].length) {
537 go(1);
538 } else {
539 subgo(1);
540 }
541 break;
542 case 33: // page up
543 case 37: // leftkey
544 case 38: // upkey
545 if(number != undef) {
546 go(-1 * number);
547 } else if (!incrementals[snum] || incpos <= 0) {
548 go(-1);
549 } else {
550 subgo(-1);
551 }
552 break;
553 case 65: // a/utoplay
554 startPlay();
555 break;
556 case 72: // h
557 case 36: // home
558 goTo(0);
559 break;
560 case 69: // e
561 case 35: // end
562 goTo(smax-1);
563 break;
564 case 70: // f/ade transitions on/off
565 switchFade();
566 break;
567 case 76: // l/ooping on/off
568 switchLoop();
569 break;
570 case 83: // s/ound support on/off
571 toggleSounds();
572 break;
573 case 27: // escape
574 case 81: // q
575 if(!isOp) byby();
576 break;
577 case 67: // c
578 showHide('k');
579 break;
580 case 78: // n
581 createNotesWindow();
582 break;
583 }
584 if (key.which < 48 || key.which > 57) {
585 number = undef;
586 } else {
587 if (window.event && isParentOrSelf(window.event.srcElement, 'controls')) return;
588 if (key.target && isParentOrSelf(key.target, 'controls')) return;
589 number = (((number != undef) ? number : 0) * 10) + (key.which - 48);
590 }
591 }
592 }
593 return false;
594 }
595
596 function clicker(e) {
597 number = undef;
598 var target;
599 if (window.event) {
600 target = window.event.srcElement;
601 e = window.event;
602 } else {
603 target = e.target;
604 }
605 if (target.href != null || hasValue(target.rel, 'external') || isParentOrSelf(target, 'controls') || isParentOrSelf(target,'embed') || isParentOrSelf(target,'object')) return true;
606 if (!helpmode) {
607 if (!e.which || e.which == 1) {
608 if (!incrementals[snum] || incpos >= incrementals[snum].length) {
609 go(1);
610 } else {
611 subgo(1);
612 }
613 }
614 } else {
615 dumpHelpReq();
616 }
617 }
618
619 function findSlide(hash) {
620 var target = null;
621 var slides = GetElementsWithClassName('*','slide');
622 for (var i = 0; i < slides.length; i++) {
623 var targetSlide = slides[i];
624 if ( (targetSlide.name && targetSlide.name == hash)
625 || (targetSlide.id && targetSlide.id == hash) ) {
626 target = targetSlide;
627 break;
628 }
629 }
630 while(target != null && target.nodeName != 'BODY') {
631 if (hasClass(target, 'slide')) {
632 return parseInt(target.id.slice(5));
633 }
634 target = target.parentNode;
635 }
636 return null;
637 }
638
639 function slideJump() {
640 if (window.location.hash == null) return;
641 var sregex = /^#slide(\d+)$/;
642 var matches = sregex.exec(window.location.hash);
643 var dest = null;
644 if (matches != null) {
645 dest = parseInt(matches[1]);
646 } else {
647 dest = findSlide(window.location.hash.slice(1));
648 }
649 if (dest != null)
650 go(dest - snum);
651 }
652
653 function fixLinks() {
654 var thisUri = window.location.href;
655 thisUri = thisUri.slice(0, thisUri.length - window.location.hash.length);
656 var aelements = document.getElementsByTagName('A');
657 for (var i = 0; i < aelements.length; i++) {
658 var a = aelements[i].href;
659 var slideID = a.match('\#slide[0-9]{1,2}');
660 if ((slideID) && (slideID[0].slice(0,1) == '#')) {
661 var dest = findSlide(slideID[0].slice(1));
662 if (dest != null) {
663 if (aelements[i].addEventListener) {
664 aelements[i].addEventListener("click", new Function("e",
665 "if (document.getElementById('slideProj').disabled) return;" +
666 "go("+dest+" - snum); " +
667 "if (e.preventDefault) e.preventDefault();"), true);
668 } else if (aelements[i].attachEvent) {
669 aelements[i].attachEvent("onclick", new Function("",
670 "if (document.getElementById('slideProj').disabled) return;" +
671 "go("+dest+" - snum); " +
672 "event.returnValue = false;"));
673 }
674 }
675 }
676 }
677 }
678
679 function externalLinks() {
680 if (!document.getElementsByTagName) return;
681 var anchors = document.getElementsByTagName('a');
682 for (var i=0; i<anchors.length; i++) {
683 var anchor = anchors[i];
684 if (anchor.getAttribute('href') && hasValue(anchor.rel, 'external')) {
685 anchor.target = '_blank';
686 addClass(anchor,'external');
687 }
688 }
689 }
690
691 function permaLink() {
692 document.getElementById('plink').href = window.location.pathname + '#slide' + snum;
693 }
694
695 function createControls() {
696 var controlsDiv = document.getElementById("controls");
697 if (!controlsDiv) return;
698 var hider = ' onmouseover="showHide(\'s\');" onmouseout="showHide(\'h\');"';
699 var hideDiv, hideList = '';
700 if (controlVis == 'hidden') {
701 hideDiv = hider;
702 } else {
703 hideList = hider;
704 }
705 if(isOp) {
706 var str = '';
707 }else {
708 var str = '<a accesskey="t" id="sheet" title="toggle CSS" href="javascript:toggle();">&plusmn;<\/a>';
709 }
710 if(isIE) {
711 var tmp = "move around&xA0;until the color&xA0;change to red!";
712 }else if(isS2) {
713 var tmp = "move around\r\nuntil the color\r\nchange to red!";
714 }else {
715 var tmp = "move around until color change to red!";
716 }
717 if(isIE) {
718 controlsDiv.innerHTML = str + '<form action="#" id="controlForm"' + hideDiv + '>' +
719 '<div id="navLinks" title="press [backspace] for keyboard help!" style="background-image: none;">' +
720 '<a accesskey="n" id="show-notes" title="show Notes" href="javascript:createNotesWindow();">i<\/a>' +
721 '<a accesskey="t" id="toggle" title="toggle CSS" href="javascript:toggle();">&plusmn;<\/a>' +
722 '<a accesskey="h" id="zero" title="goto Start Slide" href="javascript:goTo(0);">|&lt;<\/a>' +
723 '<a accesskey="y" id="prev" title="previous Slide" href="javascript:go(-1);">&lt;<\/a>' +
724 '<a accesskey="x" id="next" title="next Slide" href="javascript:go(1);">&gt;<\/a>' +
725 '<a accesskey="e" id="last" title="goto Last Slide" href="javascript:goTo(smax-1);">&gt;|<\/a>' +
726 '<br \/><div class="subLinks" id="autoLinks" style="margin-left:0.25em;">' +
727 '<a accesskey="a" id="auto" title="Auto Play" href="javascript:togglePlay();">&gt;<\/a>&nbsp;' +
728 '<a style="font-weight: bold;" accesskey="p" id="pause" title="Pausing" href="javascript:pausePlay();">||<\/a>&nbsp;' +
729 '<a style="font-weight: bold;" accesskey="l" id="loop" title="Looping" href="javascript:switchLoop();">&infin;<\/a>&nbsp;&nbsp;' +
730 '<a title="5 Sec. Delay" href="javascript:setDelay(5);">5<\/a>&middot;' +
731 '<a title="10 Sec. Delay" href="javascript:setDelay(10);">10<\/a>&middot;' +
732 '<a title="15 Sec. Delay" href="javascript:setDelay(15);">15<\/a>&middot;' +
733 '<a title="30 Sec. Delay" href="javascript:setDelay(30);">30<\/a>&middot;' +
734 '<a title="60 Sec. Delay" href="javascript:setDelay(60);">60<\/a>' +
735 '<\/div><select id="jumplist" style="position: absolute; left: -9999px;"><\/select><\/div><\/form>';
736 }else {
737 controlsDiv.innerHTML = str +
738 '<form action="#" id="controlForm"' + hideDiv + '>' +
739 '<div id="navLinks" title="press [backspace] or double click this area for keyboard help!" ondblclick="createHelpReq();">' +
740 '<a accesskey="q" id="exit" title="exit Show" href="javascript:byby();">&times;<\/a>' +
741 '<a accesskey="n" id="show-notes" title="show Notes" href="javascript:createNotesWindow();">&#x274f;<\/a>' +
742 '<a accesskey="t" id="toggle" title="toggle CSS" href="javascript:toggle();">&plusmn;<\/a>' +
743 '<a accesskey="h" id="zero" title="goto Start Slide" href="javascript:goTo(0);">|&lt;<\/a>' +
744 '<a accesskey="y" id="prev" title="previous Slide" href="javascript:go(-1);">&lt;<\/a>' +
745 '<a accesskey="x" id="next" title="next Slide" href="javascript:go(1);">&gt;<\/a>' +
746 '<a accesskey="e" id="last" title="goto Last Slide" href="javascript:goTo(smax-1);">&gt;|<\/a>' +
747 '<a id="list" style="cursor:wait;" title="' + tmp + '">&Xi;<\/a>' +
748 '<select id="jumplist" title="select named Slide" onchange="go(\'j\');"><\/select>' +
749 '<br \/><div class="subLinks" id="fadeLinks">' +
750 '<a style="font-weight: bold;" accesskey="f" id="fade" title="Transions" href="javascript:switchFade();">&#x25a8;<\/a>&nbsp;' +
751 '<\/div><div class="subLinks" id="audioLinks" style="margin-left:0.25em;">' +
752 '<a accesskey="s" id="audio" title="Sound" href="javascript:toggleSounds();">&#x266b;<\/a>&nbsp;' +
753 '<a id="volume" style="cursor:wait;" title="' + tmp + '">&#x25e2;<\/a>' +
754 '<select id="volumelist" title="select Volume" onchange="setVolume();"><option value="100">100</option>' +
755 '<option value="90">90</option><option value="80">80</option>' +
756 '<option value="70">70</option><option value="60">60</option>' +
757 '<option value="50">50</option><option value="40">40</option>' +
758 '<option value="30">30</option><option value="20">20</option>' +
759 '<option value="10">10</option><option value="0">0</option>' +
760 '<\/select>' +
761 '<\/div><div class="subLinks" id="autoLinks" style="margin-left:0.25em;">' +
762 '<a accesskey="a" id="auto" title="Auto Play" href="javascript:togglePlay();">&#x25b6;<\/a>&nbsp;' +
763 '<a style="font-weight: bold;" accesskey="p" id="pause" title="Pausing" href="javascript:pausePlay();">||<\/a>&nbsp;' +
764 '<a style="font-weight: bold;" accesskey="l" id="loop" title="Looping" href="javascript:switchLoop();">&infin;<\/a>&nbsp;&nbsp;' +
765 '<a title="5 Sec. Delay" href="javascript:setDelay(5);">5<\/a>&middot;' +
766 '<a title="10 Sec. Delay" href="javascript:setDelay(10);">10<\/a>&middot;' +
767 '<a title="15 Sec. Delay" href="javascript:setDelay(15);">15<\/a>&middot;' +
768 '<a title="30 Sec. Delay" href="javascript:setDelay(30);">30<\/a>&middot;' +
769 '<a title="60 Sec. Delay" href="javascript:setDelay(60);">60<\/a>' +
770 '<\/div><\/div><\/form>';
771 }
772 if (controlVis == 'hidden') {
773 var hidden = document.getElementById('navLinks');
774 } else {
775 var hidden = document.getElementById('jumplist');
776 }
777 addClass(hidden,'hideme');
778 }
779
780 function fontScale() { // causes layout problems in FireFox that get fixed if browser's Reload is used; same may be true of other Gecko-based browsers
781 if (!s5mode && !isOp) return false;
782 var hScreen = screen.width; var vScreen = screen.height;
783 var vWindow = window.outerHeight; var hWindow = window.outerWidth;
784 if (isOp && s5mode && defaultView=='slideshow' && ((hScreen != hWindow) || (vScreen != vWindow))) {
785 toggle();
786 return false;
787 }
788 if (isOp && !s5mode && ((hScreen != hWindow) || (vScreen != vWindow))) return false;
789 if (isOp && !s5mode && (hScreen == hWindow) && (vScreen == vWindow)) toggle();
790 var vScale = 48; // both yield 16 (the usual browser default) at 1024x768
791 var hScale = 64; // perhaps should auto-calculate based on theme's declared value?
792 if (window.innerHeight) {
793 var vSize = window.innerHeight;
794 var hSize = window.innerWidth;
795 } else if (document.documentElement.clientHeight) {
796 var vSize = document.documentElement.clientHeight;
797 var hSize = document.documentElement.clientWidth;
798 } else if (document.body.clientHeight) {
799 var vSize = document.body.clientHeight;
800 var hSize = document.body.clientWidth;
801 } else {
802 var vSize = 700; // assuming 1024x768, minus chrome and such equals 8:5
803 var hSize = 1024; // these do not account for kiosk mode or Opera Show
804 }
805 var newSize = Math.min(Math.round(vSize/vScale),Math.round(hSize/hScale));
806 extendImgSizes(newSize); // scalable images extension
807 extendCanSizes(newSize); // scalable canvas extension
808 extendObjSizes(newSize); // scalable object extension
809 fontSize(newSize,"px");
810 if(!isS2 || firstTime==0) {
811 generateCanvas(); // dynamic canvas extension
812 }
813 if (isGe) { // hack to counter incremental reflow bugs
814 var obj = document.getElementsByTagName('body')[0];
815 obj.style.visibility = 'hidden';
816 obj.style.display = 'none';
817 obj.style.display = 'block';
818 obj.style.visibility = 'visible';
819 changeOpac(100,'slide' + snum);
820 shiftOpacity('slide' + snum,10);
821 window.setTimeout("fixReflow()",10);
822 }else {
823 setListPos(); // invisible select extension
824 }
825 }
826
827 function fixReflow() {
828 shiftOpacity('slide' + snum,10);
829 window.setTimeout("finishReflow()",10);
830 }
831 function finishReflow() {
832 setListPos(); // invisible select extension
833 }
834
835 function fontSize(val,fmt) {
836 var value = val + fmt;
837 if (!(s5ss = document.getElementById('s5ss'))) {
838 if (!document.createStyleSheet) {
839 document.getElementsByTagName('head')[0].appendChild(s5ss = document.createElement('style'));
840 s5ss.setAttribute('media','screen, projection');
841 s5ss.setAttribute('id','s5ss');
842 } else {
843 document.createStyleSheet();
844 document.s5ss = document.styleSheets[document.styleSheets.length - 1];
845 }
846 }
847 if (!(document.s5ss && document.s5ss.addRule)) {
848 while (s5ss.lastChild) s5ss.removeChild(s5ss.lastChild);
849 s5ss.appendChild(document.createTextNode('html {font-size: ' + value + ' !important;}'));
850 } else {
851 document.s5ss.addRule('html','font-size: ' + value + ' !important;');
852 }
853 }
854
855 function windowChange() {
856 fontScale();
857 }
858
859 function notOperaFix() {
860 slideCSS = document.getElementById('slideProj').href;
861 var slides = document.getElementById('slideProj');
862 var outline = document.getElementById('outlineStyle');
863 slides.setAttribute('media','screen');
864 outline.disabled = true;
865 if (isGe) {
866 slides.setAttribute('href','null'); // Gecko fix
867 slides.setAttribute('href',slideCSS); // Gecko fix
868 }
869 if ((isIE && notIE7) && document.styleSheets && document.styleSheets[0]) {
870 document.styleSheets[0].addRule('img', 'behavior: url(ui/graphic_support/iepngfix.htc)');
871 document.styleSheets[0].addRule('div', 'behavior: url(ui/graphic_support/iepngfix.htc)');
872 document.styleSheets[0].addRule('.slide', 'behavior: url(ui/graphic_support/iepngfix.htc)');
873 }
874 }
875
876 function getIncrementals(obj) {
877 var incrementals = new Array();
878 if (!obj)
879 return incrementals;
880 var children = obj.childNodes;
881 for (var i = 0; i < children.length; i++) {
882 var child = children[i];
883 if (hasClass(child, 'incremental')) {
884 if (child.nodeName == 'OL' || child.nodeName == 'UL') {
885 removeClass(child, 'incremental');
886 for (var j = 0; j < child.childNodes.length; j++) {
887 if (child.childNodes[j].nodeType == 1) {
888 addClass(child.childNodes[j], 'incremental');
889 }
890 }
891 } else {
892 incrementals[incrementals.length] = child;
893 removeClass(child,'incremental');
894 }
895 }
896 if (hasClass(child, 'show-first')) {
897 if (child.nodeName == 'OL' || child.nodeName == 'UL') {
898 removeClass(child, 'show-first');
899 if (child.childNodes[isGe].nodeType == 1) {
900 removeClass(child.childNodes[isGe], 'incremental');
901 }
902 } else {
903 incrementals[incrementals.length] = child;
904 }
905 }
906 incrementals = incrementals.concat(getIncrementals(child));
907 }
908 return incrementals;
909 }
910
911 function createIncrementals() {
912 var incrementals = new Array();
913 for (var i = 0; i < smax; i++) {
914 incrementals[i] = getIncrementals(document.getElementById('slide'+i));
915 }
916 return incrementals;
917 }
918
919 function trap(e) {
920 if (!e) {
921 e = event;
922 e.which = e.keyCode;
923 }
924 try {
925 modifierKey = e.ctrlKey || e.altKey || e.metaKey;
926 }
927 catch(e) {
928 modifierKey = false;
929 }
930 return modifierKey || e.which == 0;
931 }
932
933 // notes extension
934 function noteLabel() { // Gives notes id's to match parent slides
935 var notes = GetElementsWithClassName('div','notes');
936 for (var i = 0; i < notes.length; i++) {
937 var note = notes[i];
938 var id = 'note' + note.parentNode.id.substring(5);
939 note.setAttribute('id',id);
940 }
941 resetElapsedSlide();
942 resetRemainingTime();
943 window.setInterval('updateElaspedTime()', 1000);
944 }
945
946 function createNotesWindow() { // creates a window for our notes
947 if (!s5NotesWindow || s5NotesWindow.closed) { // Create the window if it doesn't exist
948 s5NotesWindowLoaded = false;
949 // Note: Safari has a tendency to ignore window options preferring to default to the settings of the parent window, grr.
950 s5NotesWindow = window.open('ui/s5-notes.html', 's5NotesWindow', 'top=0,left=0');
951 }
952 if (s5NotesWindowLoaded) { // Load the current note if the Note HTML has loaded
953 loadNote();
954 } else { // Keep trying...
955 window.setTimeout('createNotesWindow()', 50);
956 }
957 }
958
959 function loadNote() {
960 // Loads a note into the note window
961 var notes = nextNotes = '<em class="disclaimer">There are no notes for this slide.</em>';
962 if (document.getElementById('note' + snum)) {
963 notes = document.getElementById('note' + snum).innerHTML;
964 }
965 if (document.getElementById('note' + (snum + 1))) {
966 nextNotes = document.getElementById('note' + (snum + 1)).innerHTML;
967 }
968
969 var jl = document.getElementById('jumplist');
970 var slideTitle = jl.options[jl.selectedIndex].text.replace(/^\d+\s+:\s+/, '') + ((jl.selectedIndex) ? ' (' + jl.selectedIndex + '/' + (smax - 1) + ')' : '');
971 if (incrementals[snum].length > 0) {
972 slideTitle += ' <small>[' + incpos + '/' + incrementals[snum].length + ']</small>';
973 }
974 if (jl.selectedIndex < smax - 1) {
975 var nextTitle = jl.options[jl.selectedIndex + 1].text.replace(/^\d+\s+:\s+/, '') + ((jl.selectedIndex + 1) ? ' (' + (jl.selectedIndex + 1) + '/' + (smax - 1) + ')' : '');
976 } else {
977 var nextTitle = '[end of slide show]';
978 }
979
980 if (s5NotesWindow && !s5NotesWindow.closed && s5NotesWindow.document) {
981 s5NotesWindow.document.getElementById('slide').innerHTML = slideTitle;
982 s5NotesWindow.document.getElementById('notes').innerHTML = notes;
983 s5NotesWindow.document.getElementById('next').innerHTML = nextTitle;
984 s5NotesWindow.document.getElementById('nextnotes').innerHTML = nextNotes;
985 }
986 resetElapsedSlide();
987 }
988
989 function minimizeTimer(id) {
990 var obj = s5NotesWindow.document.getElementById(id);
991 if (hasClass(obj,'collapsed')) {
992 removeClass(obj,'collapsed');
993 } else {
994 addClass(obj,'collapsed');
995 }
996 }
997
998 function resetElapsedTime() {
999 presentationStart = new Date();
1000 slideStart = new Date();
1001 updateElaspedTime();
1002 }
1003
1004 function resetElapsedSlide() {
1005 if (snum != previousSlide) {
1006 slideStart = new Date();
1007 previousSlide = snum;
1008 updateElaspedTime();
1009 }
1010 }
1011
1012 function updateElaspedTime() {
1013 if (!s5NotesWindowLoaded || !s5NotesWindow || s5NotesWindow.closed) return;
1014 var now = new Date();
1015 var ep = s5NotesWindow.document.getElementById('elapsed-presentation');
1016 var es = s5NotesWindow.document.getElementById('elapsed-slide');
1017 ep.innerHTML = formatTime(now.valueOf() - presentationStart.valueOf());
1018 es.innerHTML = formatTime(now.valueOf() - slideStart.valueOf());
1019 }
1020
1021 function resetRemainingTime() {
1022 if (!s5NotesWindowLoaded || !s5NotesWindow || s5NotesWindow.closed) return;
1023 var startField = s5NotesWindow.document.getElementById('startFrom');
1024 startFrom = readTime(startField.value);
1025 countdown.remaining = startFrom * 60000; // convert to msecs
1026 countdown.start = new Date().valueOf();
1027 countdown.end = countdown.start + countdown.remaining;
1028 var tl = s5NotesWindow.document.getElementById('timeLeft');
1029 var timeLeft = formatTime(countdown.remaining);
1030 tl.innerHTML = timeLeft;
1031 }
1032
1033 function updateRemainingTime() {
1034 if (!s5NotesWindowLoaded || !s5NotesWindow || s5NotesWindow.closed) return;
1035 var tl = s5NotesWindow.document.getElementById('timeLeft');
1036 var now = new Date();
1037 if (countdown.state == 'run') {
1038 countdown.remaining = countdown.end - now;
1039 }
1040 tl.style.color = '';
1041 tl.style.backgroundColor = '';
1042 if (countdown.remaining >= 0) {
1043 var timeLeft = formatTime(countdown.remaining);
1044 removeClass(tl,'overtime');
1045 if (countdown.remaining < 300000) {
1046 tl.style.color = 'rgb(' + (255-Math.round(countdown.remaining/2000)) + ',0,0)';
1047 tl.style.backgroundColor = 'rgb(255,255,' + (Math.round(countdown.remaining/2000)) + ')';
1048 }
1049 } else {
1050 var timeLeft = '-' + formatTime(-countdown.remaining);
1051 addClass(tl,'overtime');
1052 }
1053 tl.innerHTML = timeLeft;
1054 }
1055
1056 function toggleRemainingTime() {
1057 if (countdown.state == 'pause') countdown.state = 'run'; else countdown.state = 'pause';
1058 if (countdown.state == 'pause') {
1059 window.clearInterval(countdown.timer);
1060 }
1061 if (countdown.state == 'run') {
1062 countdown.start = new Date().valueOf();
1063 countdown.end = countdown.start + countdown.remaining;
1064 countdown.timer = window.setInterval('updateRemainingTime()', 1000);
1065 }
1066 }
1067
1068 function alterRemainingTime(amt) {
1069 var change = amt * 60000; // convert to msecs
1070 countdown.end += change;
1071 countdown.remaining += change;
1072 updateRemainingTime();
1073 }
1074
1075 function formatTime(msecs) {
1076 var time = new Date(msecs);
1077
1078 var hrs = time.getUTCHours() + ((time.getUTCDate() -1) * 24); // I doubt anyone will spend more than 24 hours on a presentation or single slide but just in case...
1079 hrs = (hrs < 10) ? '0'+hrs : hrs;
1080 if (hrs == 'NaN' || isNaN(hrs)) hrs = '--';
1081
1082 var min = time.getUTCMinutes();
1083 min = (min < 10) ? '0'+min : min;
1084 if (min == 'NaN' || isNaN(min)) min = '--';
1085
1086 var sec = time.getUTCSeconds();
1087 sec = (sec < 10) ? '0'+sec : sec;
1088 if (sec == 'NaN' || isNaN(sec)) sec = '--';
1089
1090 return hrs + ':' + min + ':' + sec;
1091 }
1092
1093 function readTime(val) {
1094 var sregex = /:/;
1095 var matches = sregex.exec(val);
1096 if (matches == null) {
1097 return val;
1098 } else {
1099 var times = val.split(':');
1100 var hours = parseInt(times[0]);
1101 var mins = parseInt(times[1]);
1102 var total = (hours * 60) + mins;
1103 return total;
1104 }
1105 }
1106 // notes extension
1107
1108 // startup process
1109 function createSlideShow() {
1110 defaultCheck();
1111 if(!isIE) createDetector(); // (degrade IE) scalable images extension
1112 if(opac!=0 || isIE) { // &&!isIE (degrade IE)
1113 tranSitions = false;
1114 fadeModus = false;
1115 }
1116 if(tranSitions && document.getElementById && document.createElement){
1117 createProgress();
1118 var nop=document.getElementById('StartupControl');
1119 nop.onload = dumpProgress;
1120 }else {
1121 startup();
1122 showAll();
1123 setListPos(true); // invisible select extension
1124 panelSetup();
1125 audioSetup(); // audio extension
1126 if(isS2 && firstTime>=1) {
1127 generateCanvas(); // dynamic canvas extension
1128 } firstTime = 0;
1129 }
1130 }
1131
1132 function defaultCheck() {
1133 var allMetas = document.getElementsByTagName('meta');
1134 for (var i = 0; i< allMetas.length; i++) {
1135 if (allMetas[i].name == 'defaultView') {
1136 defaultView = allMetas[i].content;
1137 }
1138 if (allMetas[i].name == 'controlVis') {
1139 controlVis = allMetas[i].content;
1140 }
1141 if (allMetas[i].name == 'tranSitions') {
1142 tranSitions = (allMetas[i].content == "true") ? true : false;
1143 fadeModus = (tranSitions == true) ? true : false;
1144 }
1145 if (allMetas[i].name == 'fadeDuration') {
1146 var tmp = parseInt(allMetas[i].content);
1147 fadeDuration = Math.max(200,Math.min(tmp,2000));
1148 }
1149 if (allMetas[i].name == 'incrDuration') {
1150 var tmp = parseInt(allMetas[i].content);
1151 incrDuration = Math.max(50,Math.min(tmp,500));
1152 }
1153 if (allMetas[i].name == 'autoMatic') {
1154 autoMatic = (allMetas[i].content == "true") ? true : false;
1155 }
1156 if (allMetas[i].name == 'playLoop') {
1157 playLoop = (allMetas[i].content == "true") ? true : false;
1158 }
1159 if (allMetas[i].name == 'playDelay') {
1160 var tmp = parseInt(allMetas[i].content);
1161 playDelay = Math.max(5,Math.min(tmp,90))*1000;
1162 playDelay = (fadeModus == true) ? (playDelay+(2*fadeDuration)) : playDelay;
1163 }
1164 if (allMetas[i].name == 'audioSupport') {
1165 audioSupport = (allMetas[i].content == "true") ? true : false;
1166 }
1167 if (allMetas[i].name == 'audioVolume') {
1168 var tmp = parseInt(allMetas[i].content);
1169 audioVolume = Math.max(0,Math.min(tmp,100));
1170 }
1171 if (allMetas[i].name == 'audioError') {
1172 audioError = (allMetas[i].content == "true") ? true : false;
1173 }
1174 }
1175 }
1176
1177 function createProgress() {
1178 var obj = document.getElementsByTagName("body")[0].firstChild;
1179 var pg = document.createElement('div');
1180 pg.id = "StartupProgress";
1181 pg.style.position = 'absolute';
1182 pg.style.left = 0 + 'px';
1183 pg.style.top = 0 + 'px';
1184 pg.style.width = 100 + '%';
1185 pg.style.height = 100 + '%';
1186 pg.style.margin = 0 + 'px';
1187 pg.style.padding = 0 + 'px';
1188 if (isIE) {
1189 pg.style.filter = "alpha(opacity=100)";
1190 }else {
1191 pg.style.opacity = 1.0;
1192 }
1193 pg.style.zIndex = 9999;
1194 pg.style.backgroundColor="rgb(255, 255, 255)";
1195 pg.style.textAlign = "center";
1196 pg.style.verticalAlign = "middle";
1197 pg.style.backgroundPosition="center center";
1198 pg.style.backgroundRepeat="no-repeat";
1199 pg.style.backgroundImage="url(ui/graphic_support/progress.gif)";
1200 document.getElementsByTagName("body")[0].insertBefore(pg,obj);
1201
1202 var im = document.createElement('img');
1203 im.id = "StartupControl";
1204 im.src = "ui/graphic_support/blank.gif?" + new Date().valueOf();
1205 document.getElementsByTagName("body")[0].appendChild(im);
1206 }
1207
1208 function startup() {
1209 createControls(); // hallvord
1210 slideLabel();
1211 incrementals = createIncrementals();
1212 noteLabel(); // [SI:060104] must follow slideLabel()
1213 loadNote();
1214 fixLinks();
1215 externalLinks();
1216 fontScale();
1217 if (!isOp) {
1218 notOperaFix();
1219 }else if(isOp) {
1220 document.getElementById('exit').style.visibility = 'hidden';
1221 document.getElementById('toggle').style.visibility = 'hidden';
1222 document.getElementById('list').style.visibility = 'hidden';
1223 document.getElementById('jumplist').style.visibility = 'hidden';
1224 document.getElementById('audioLinks').style.display = 'none';
1225 }
1226 slideJump();
1227 if (defaultView == 'outline') toggle();
1228 document.onkeyup = keys;
1229 document.onkeypress = trap;
1230 document.onclick = clicker;
1231 }
1232
1233 function preloadImgages() {
1234 var temp = '';
1235 var objects = document.getElementsByTagName('img');
1236 for (var i=0; i < objects.length; i++) {
1237 if(objects[i].src != '') {
1238 temp = new Image();
1239 temp.src = objects[i].src;
1240 }
1241 }
1242 }
1243
1244 function showAll() {
1245 var obj1 = GetElementsWithClassName('div','presentation')[0];
1246 if(!obj1) var obj1 = GetElementsWithClassName('ol','presentation')[0];
1247 var obj2 = GetElementsWithClassName('div','layout')[0];
1248 if(!obj1){}else {obj1.style.display = 'block'};
1249 if(!obj2){}else {obj2.style.display = 'block'};
1250 }
1251
1252 function dumpProgress() {
1253 document.body.removeChild(document.getElementById('StartupControl'));
1254 startup();
1255 preloadImgages();
1256 showAll();
1257 createSoundManagerScript();
1258 shiftOpacity('StartupProgress',1000);
1259 window.setTimeout("removeProgress()",1000);
1260 }
1261
1262 function removeProgress() {
1263 document.body.removeChild(document.getElementById('StartupProgress'));
1264 setListPos(true); // invisible select extension
1265 panelSetup();
1266 audioSetup(); // audio extension
1267 if(isS2 && firstTime>=1) {
1268 generateCanvas(); // dynamic canvas extension
1269 } firstTime = 0;
1270 }
1271 function panelSetup() {
1272 if(playPause) document.getElementById('pause').style.color=highLight;
1273 if(playLoop) document.getElementById('loop').style.color=highLight;
1274 if(audioSupport && !isIE && !isOp) document.getElementById('audio').style.color=highLight;
1275 if(fadeModus && !isIE) document.getElementById('fade').style.color=highLight;
1276 if(autoMatic) {
1277 document.getElementById('auto').style.color=highLight;
1278 startPlay();
1279 }
1280 if(audioVolume && !isIE && !isOp) {
1281 var idx = 0;
1282 if(audioVolume >= 95 && audioVolume <= 100) {idx = 0;}
1283 else if(audioVolume >= 85 && audioVolume < 95) {idx = 1;}
1284 else if(audioVolume >= 75 && audioVolume < 85) {idx = 2;}
1285 else if(audioVolume >= 65 && audioVolume < 75) {idx = 3;}
1286 else if(audioVolume >= 55 && audioVolume < 65) {idx = 4;}
1287 else if(audioVolume >= 45 && audioVolume < 55) {idx = 5;}
1288 else if(audioVolume >= 35 && audioVolume < 45) {idx = 6;}
1289 else if(audioVolume >= 25 && audioVolume < 35) {idx = 7;}
1290 else if(audioVolume >= 15 && audioVolume < 25) {idx = 8;}
1291 else if(audioVolume >= 5 && audioVolume < 15) {idx = 9;}
1292 else {idx = 10;}
1293 document.getElementById('volumelist').selectedIndex = idx;
1294 }
1295 }
1296 // startup process
1297
1298 // shutdown process
1299 function byby() {
1300 stopPlay();
1301 if(tranSitions && fadeModus && s5mode && !isOp) {
1302 fadeoutSound(curSoundID,true); // audio support
1303 var pg = document.createElement('div');
1304 pg.id = "GoodBy";
1305 pg.style.position = 'absolute';
1306 pg.style.left = 0 + 'px';
1307 pg.style.top = 0 + 'px';
1308 pg.style.width = 100 + '%';
1309 pg.style.height = 100 + '%';
1310 pg.style.margin = 0 + 'px';
1311 pg.style.padding = 0 + 'px';
1312 if (isIE) {
1313 pg.style.filter = "alpha(opacity=0)";
1314 }else {
1315 pg.style.opacity = 0.0;
1316 }
1317 pg.style.zIndex = 9999;
1318 pg.style.backgroundColor="rgb(255, 255, 255)";
1319 pg.style.textAlign = "center";
1320 pg.style.verticalAlign = "middle";
1321 pg.style.backgroundPosition="center center";
1322 pg.style.backgroundRepeat="no-repeat";
1323 pg.style.backgroundImage="url(ui/graphic_support/finish.gif)";
1324 document.getElementsByTagName("body")[0].appendChild(pg);
1325 shiftOpacity('GoodBy',1000);
1326 window.setTimeout("history.back()",1000);
1327 }else {
1328 stopSound(curSoundID);
1329 history.back();
1330 }
1331 }
1332 // shutdown process
1333
1334 // scalable images extension
1335 function createDetector() {
1336 var em = document.createElement('div');
1337 em.id='EMSizeControl'; em.style.position="absolute"; em.style.left="-999px";
1338 em.style.width="1em"; em.style.height="1em"; em.style.opacity=0.0;
1339 document.getElementsByTagName("body")[0].appendChild(em);
1340 var nop=document.getElementById('EMSizeControl');
1341 if(!nop||findPosX(nop)!=-999) {}else {
1342 opac=document.getElementById('EMSizeControl').style.opacity;
1343 empx=document.getElementById('EMSizeControl').offsetHeight;
1344 document.body.removeChild(document.getElementById('EMSizeControl'));
1345 var objects = document.getElementsByTagName('img');
1346 var j = 0; var i = 0; var k = 0; var d; var obj;
1347 for (i=0; i < objects.length; i++) {
1348 if(objects[i].className.match(/^scale/i)) {
1349 images[j] = objects[i];
1350 ++j;
1351 }
1352 }
1353 var objects = document.getElementsByTagName('canvas'); j = 0;
1354 for (i=0; i < objects.length; i++) {
1355 if(objects[i].className.match(/^scale/i)) {
1356 canvas[objects[i].id] = objects[i];
1357 if(j==0) {
1358 if(objects[i].getContext) {
1359 canvasSupport = true;
1360 }
1361 ++j;
1362 }
1363 }
1364 }
1365 if(canvasSupport!=true) {
1366 for (d in canvas) {
1367 canvas[d].setAttribute("width",1);
1368 canvas[d].setAttribute("height",1);
1369 }
1370 }
1371 var objects = document.getElementsByTagName('table');
1372 j = 0; k = 0; l = 0; var w; var h; var tmp; var cnt;
1373 for (i=0; i < objects.length; i++) {
1374 if(objects[i].className.match(/^piechart/i)) {
1375 tmp = objects[i].id;
1376 cnt = tmp.split("_");
1377 obj = cnt[0] + "_canvas";
1378 if(canvas[obj]) {
1379 w = canvas[obj].getAttribute("width");
1380 h = canvas[obj].getAttribute("height");
1381 if(w>0&&h>0) {
1382 piecharts[j] = objects[i];
1383 em = piecharts[j].getAttribute("summary");
1384 if(em != "") em = "," + em;
1385 piecharts[j].setAttribute("summary", w + "," + h + em);
1386 ++j;
1387 }
1388 }
1389 }
1390 if(objects[i].className.match(/^barchart/i)) {
1391 tmp = objects[i].id;
1392 cnt = tmp.split("_");
1393 obj = cnt[0] + "_canvas";
1394 if(canvas[obj]) {
1395 w = canvas[obj].getAttribute("width");
1396 h = canvas[obj].getAttribute("height");
1397 if(w>0&&h>0) {
1398 barcharts[k] = objects[i];
1399 em = barcharts[k].getAttribute("summary");
1400 if(em != "") em = "," + em;
1401 barcharts[k].setAttribute("summary", w + "," + h + em);
1402 ++k;
1403 }
1404 }
1405 }
1406 if(objects[i].className.match(/^linechart/i)) {
1407 tmp = objects[i].id;
1408 cnt = tmp.split("_");
1409 obj = cnt[0] + "_canvas";
1410 if(canvas[obj]) {
1411 w = canvas[obj].getAttribute("width");
1412 h = canvas[obj].getAttribute("height");
1413 if(w>0&&h>0) {
1414 linecharts[l] = objects[i];
1415 em = linecharts[l].getAttribute("summary");
1416 if(em != "") em = "," + em;
1417 linecharts[l].setAttribute("summary", w + "," + h + em);
1418 ++l;
1419 }
1420 }
1421 }
1422 }
1423 objects = document.getElementsByTagName('object'); j = 0; i = 0;
1424 for (i=0; i < objects.length; i++) {
1425 if(objects[i].className.match(/^scale/i)) {
1426 medias[j] = objects[i]; ++j;
1427 if(!isIE) {
1428 if(objects[i].getAttributeNode("classid")) objects[i].removeAttributeNode(objects[i].getAttributeNode("classid"));
1429 if(objects[i].getAttributeNode("codebase")) objects[i].removeAttributeNode(objects[i].getAttributeNode("codebase"));
1430 }
1431 }
1432 }
1433 }
1434 }
1435 function extendImgSizes(f) {
1436 if(empx>0) {
1437 var q = (f/empx); var w = 0; var h = 0;
1438 for(var i=0; i < images.length; i++) {
1439 w=images[i].getAttribute("width",0);
1440 h=images[i].getAttribute("height",0);
1441 if(w>0&&h>0) {
1442 images[i].style.width=Math.floor(w*q)+"px";
1443 images[i].style.height=Math.floor(h*q)+"px";
1444 }
1445 }
1446 }
1447 }
1448
1449 function extendCanSizes(f) {
1450 if(empx>0 && canvasSupport) {
1451 var q = (f/empx); var w = 0; var h = 0; var tmp = ""; var cnt; var obj;
1452 for(var i=0; i < piecharts.length; i++) {
1453 if(piecharts[i].getAttribute("summary")) {
1454 tmp = piecharts[i].getAttribute("summary");
1455 cnt = tmp.split(",");
1456 if(cnt[0].match(/^[1-9][0-9]+/)) w = parseInt(cnt[0]);
1457 if(cnt[1].match(/^[1-9][0-9]+/)) h = parseInt(cnt[1]);
1458 if(w>0&&h>0) {
1459 tmp = piecharts[i].id;
1460 cnt = tmp.split("_");
1461 obj = cnt[0] + "_canvas";
1462 canvas[obj].setAttribute("width",Math.floor(w*q));
1463 canvas[obj].setAttribute("height",Math.floor(h*q));
1464 canvas[obj].style.width=Math.floor(w*q)+"px";
1465 canvas[obj].style.height=Math.floor(h*q)+"px";
1466 }
1467 }
1468 }
1469 for(var i=0; i < barcharts.length; i++) {
1470 if(barcharts[i].getAttribute("summary")) {
1471 tmp = barcharts[i].getAttribute("summary");
1472 cnt = tmp.split(",");
1473 if(cnt[0].match(/^[1-9][0-9]+/)) w = parseInt(cnt[0]);
1474 if(cnt[1].match(/^[1-9][0-9]+/)) h = parseInt(cnt[1]);
1475 if(w>0&&h>0) {
1476 tmp = barcharts[i].id;
1477 cnt = tmp.split("_");
1478 obj = cnt[0] + "_canvas";
1479 canvas[obj].setAttribute("width",Math.floor(w*q));
1480 canvas[obj].setAttribute("height",Math.floor(h*q));
1481 canvas[obj].style.width=Math.floor(w*q)+"px";
1482 canvas[obj].style.height=Math.floor(h*q)+"px";
1483 }
1484 }
1485 }
1486 for(var i=0; i < linecharts.length; i++) {
1487 if(linecharts[i].getAttribute("summary")) {
1488 tmp = linecharts[i].getAttribute("summary");
1489 cnt = tmp.split(",");
1490 if(cnt[0].match(/^[1-9][0-9]+/)) w = parseInt(cnt[0]);
1491 if(cnt[1].match(/^[1-9][0-9]+/)) h = parseInt(cnt[1]);
1492 if(w>0&&h>0) {
1493 tmp = linecharts[i].id;
1494 cnt = tmp.split("_");
1495 obj = cnt[0] + "_canvas";
1496 canvas[obj].setAttribute("width",Math.floor(w*q));
1497 canvas[obj].setAttribute("height",Math.floor(h*q));
1498 canvas[obj].style.width=Math.floor(w*q)+"px";
1499 canvas[obj].style.height=Math.floor(h*q)+"px";
1500 }
1501 }
1502 }
1503 }
1504 }
1505 function extendObjSizes(f) {
1506 if(empx>0) {
1507 var q = (f/empx); var w = 0; var h = 0;
1508 for(var i=0; i < medias.length; i++) {
1509 w=medias[i].getAttribute("width",0);
1510 h=medias[i].getAttribute("height",0);
1511 if(w>0&&h>0) {
1512 medias[i].style.width=Math.floor(w*q)+"px";
1513 medias[i].style.height=Math.floor(h*q)+"px";
1514 }
1515 }
1516 }
1517 }
1518 function findPosX(obj) {
1519 var posLeft = 0;
1520 while (obj.offsetParent) {
1521 posLeft += obj.offsetLeft;
1522 obj = obj.offsetParent;
1523 }
1524 return posLeft;
1525 }
1526 function findPosY(obj) {
1527 var posTop = 0;
1528 while (obj.offsetParent) {
1529 posTop += obj.offsetTop;
1530 obj = obj.offsetParent;
1531 }
1532 return posTop;
1533 }
1534 // scalable images extension
1535
1536 // canvas chart extension
1537 function deg2rad(degrees) {
1538 return Math.PI *degrees/180;
1539 }
1540 function rad2deg(radians) {
1541 return 180.0 *radians/Math.PI;
1542 }
1543 function circle_point_x(radians, diameter) {
1544 var x = Math.cos(radians)*(diameter/2);
1545 return x;
1546 }
1547 function circle_point_y(radians, diameter) {
1548 var y = Math.sin(radians)*(diameter/2);
1549 return y;
1550 }
1551 function roundTo(val,dig) {
1552 var num = val;
1553 if (val > 8191 && val < 10485) {
1554 val = val-5000;
1555 num = Math.round(val*Math.pow(10,dig))/Math.pow(10,dig);
1556 num = num+5000;
1557 } else {
1558 num = Math.round(val*Math.pow(10,dig))/Math.pow(10,dig);
1559 }
1560 return num;
1561 }
1562 function searchColor(value) {
1563 for (var dat in colorNames) {
1564 if(dat==value) return colorNames[dat];
1565 }
1566 return false;
1567 }
1568 function scanColor(value) {
1569 if(value.match(/^#[0-9a-f][0-9a-f][0-9a-f]$/i)) {
1570 var val1 = value.substr(1,1).toLowerCase();
1571 var val2 = value.substr(2,1).toLowerCase();
1572 var val3 = value.substr(3,1).toLowerCase();
1573 value = '#' + val1 + val1 + val2 + val2 + val3 + val3;
1574 }
1575 if(!value.match(/^#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]$/i)) {
1576 var tmp = searchColor(value.toLowerCase());
1577 if(!tmp) {}else{value = tmp;}
1578 }
1579 if(!value.match(/^#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]$/i)) {
1580 value = '#000000';
1581 }
1582 return value.toLowerCase();
1583 }
1584 function hex2rgb(val,trans) {
1585 if(val.length==7) {
1586 var tp1 = Math.max(0,Math.min(parseInt(val.substr(1,2),16),255));
1587 var tp2 = Math.max(0,Math.min(parseInt(val.substr(3,2),16),255));
1588 var tp3 = Math.max(0,Math.min(parseInt(val.substr(5,2),16),255));
1589 return 'rgba(' + tp1 + ',' + tp2 + ',' + tp3 + ',' + trans + ')';
1590 }
1591 }
1592 function trim(str) {
1593 return (str.replace(/\s+$/,"").replace(/^\s+/,""));
1594 }
1595 function roundedRect(ctx,x,y,width,height,radius){
1596 ctx.beginPath();
1597 ctx.moveTo(x,y+radius);
1598 ctx.lineTo(x,y+height-radius);
1599 ctx.quadraticCurveTo(x,y+height,x+radius,y+height);
1600 ctx.lineTo(x+width-radius,y+height);
1601 ctx.quadraticCurveTo(x+width,y+height,x+width,y+height-radius);
1602 ctx.lineTo(x+width,y+radius);
1603 ctx.quadraticCurveTo(x+width,y,x+width-radius,y);
1604 ctx.lineTo(x+radius,y);
1605 ctx.quadraticCurveTo(x,y,x,y+radius);
1606 ctx.closePath();
1607 }
1608 function drawString(ctx, text, fc, tx, ty) {
1609 var xp = 0; var c = "";
1610 ctx.beginPath();
1611 for (var i = 0; i < text.length; i++) {
1612 c = text[i];
1613 ctx.drawImage(font, signs[c].sx, signs[c].sy, signs[c].sw, signs[c].sh, tx+xp, ty, signs[c].sw*fc, signs[c].sh*fc);
1614 xp += (signs[c].sw*fc);
1615 }
1616 ctx.closePath();
1617 }
1618 function strokeString(ctx, txt, col, fh, tx, ty) {
1619 var fw = fh*0.666666; var lw = fh*0.125;
1620 var ls = lw/2; var cr = lw; var xp = 0;
1621 ctx.lineCap = "round"; ctx.lineJoin = "round"
1622 ctx.lineWidth = lw; ctx.strokeStyle = col;
1623 for (var i = 0; i < txt.length; i++) {
1624 strokeSymbol(ctx, txt[i], ls, tx+xp, ty, fw, fh);
1625 xp += (txt[i]!="."?fw+cr:(fw/2)+cr);
1626 }
1627 }
1628 function strokeSymbol(ctx, symbol, fc, cx, cy, cw, ch) {
1629 ctx.beginPath();
1630 switch (symbol) {
1631 case "0":
1632 ctx.moveTo(cx+fc,cy+(ch*0.333333));
1633 ctx.arc(cx+(cw/2),cy+(cw/2),(cw/2)-fc,deg2rad(180),0, false);
1634 ctx.arc(cx+(cw/2),(cy+ch)-(cw/2),(cw/2)-fc,0,deg2rad(180), false);
1635 ctx.closePath();
1636 break;
1637 case "1":
1638 ctx.moveTo(cx+(cw*0.1)+fc,cy+ch-fc);
1639 ctx.lineTo(cx+cw-fc,cy+ch-fc);
1640 ctx.moveTo(cx+(cw*0.666666),cy+ch-fc);
1641 ctx.lineTo(cx+(cw*0.666666),cy+fc);
1642 ctx.lineTo(cx+(cw*0.25),cy+(ch*0.25));
1643 break;
1644 case "2":
1645 ctx.moveTo(cx+cw-fc,cy+(ch*0.8));
1646 ctx.lineTo(cx+cw-fc,cy+ch-fc);
1647 ctx.lineTo(cx+fc,cy+ch-fc);
1648 ctx.arc(cx+(cw/2),cy+(cw*0.425),(cw*0.425)-fc,deg2rad(45),deg2rad(-180), true);
1649 break;
1650 case "3":
1651 ctx.moveTo(cx+(cw*0.1)+fc,cy+fc);
1652 ctx.lineTo(cx+(cw*0.9)-fc,cy+fc);
1653 ctx.arc(cx+(cw/2),cy+ch-(cw*0.5),(cw*0.5)-fc,deg2rad(-90),deg2rad(180), false);
1654 break;
1655 case "4":
1656 ctx.moveTo(cx+(cw*0.75),cy+ch-fc);
1657 ctx.lineTo(cx+(cw*0.75),cy+fc);
1658 ctx.moveTo(cx+cw-fc,cy+(ch*0.666666));
1659 ctx.lineTo(cx+fc,cy+(ch*0.666666));
1660 ctx.lineTo(cx+(cw*0.75),cy+fc);
1661 ctx.moveTo(cx+cw-fc,cy+ch-fc);
1662 ctx.lineTo(cx+(cw*0.5),cy+ch-fc);
1663 break;
1664 case "5":
1665 ctx.moveTo(cx+(cw*0.9)-fc,cy+fc);
1666 ctx.lineTo(cx+(cw*0.1)+fc,cy+fc);
1667 ctx.lineTo(cx+(cw*0.1)+fc,cy+(ch*0.333333));
1668 ctx.arc(cx+(cw/2),cy+ch-(cw*0.5),(cw*0.5)-fc,deg2rad(-80),deg2rad(180), false);
1669 break;
1670 case "6":
1671 ctx.moveTo(cx+fc,cy+ch-(cw*0.5)-fc);
1672 ctx.arc(cx+(cw/2),cy+ch-(cw*0.5),(cw*0.5)-fc,deg2rad(-180),deg2rad(180), false);
1673 ctx.bezierCurveTo(cx+fc,cy+fc,cx+fc,cy+fc,cx+(cw*0.9)-fc,cy+fc);
1674 ctx.moveTo(cx+(cw*0.9)-fc,cy+fc);
1675 break;
1676 case "7":
1677 ctx.moveTo(cx+(cw*0.5),cy+ch-fc);
1678 ctx.lineTo(cx+cw-fc,cy+fc);
1679 ctx.lineTo(cx+(cw*0.1)+fc,cy+fc);
1680 ctx.lineTo(cx+(cw*0.1)+fc,cy+(ch*0.25)-fc);
1681 break;
1682 case "8":
1683 ctx.moveTo(cx+(cw*0.92)-fc,cy+(cw*0.59));
1684 ctx.arc(cx+(cw/2),cy+(cw*0.45),(cw*0.45)-fc,deg2rad(25),deg2rad(-205), true);
1685 ctx.arc(cx+(cw/2),cy+ch-(cw*0.5),(cw*0.5)-fc,deg2rad(-135),deg2rad(-45), true);
1686 ctx.closePath();
1687 ctx.moveTo(cx+(cw*0.79),cy+(ch*0.47));
1688 ctx.lineTo(cx+(cw*0.21),cy+(ch*0.47));
1689 break;
1690 case "9":
1691 ctx.moveTo(cx+cw-fc,cy+(cw*0.5));
1692 ctx.arc(cx+(cw/2),cy+(cw*0.5),(cw*0.5)-fc,deg2rad(0),deg2rad(360), false);
1693 ctx.bezierCurveTo(cx+cw-fc,cy+ch-fc,cx+cw-fc,cy+ch-fc,cx+(cw*0.1)+fc,cy+ch-fc);
1694 break;
1695 case "%":
1696 ctx.moveTo(cx+fc,cy+(ch*0.75));
1697 ctx.lineTo(cx+cw-fc,cy+(ch*0.25));
1698 ctx.moveTo(cx+(cw*0.505),cy+(cw*0.3));
1699 ctx.arc(cx+(cw*0.3),cy+(cw*0.3),(cw*0.3)-fc,deg2rad(0),deg2rad(360), false);
1700 ctx.moveTo(cx+(cw*0.905),cy+ch-(cw*0.3));
1701 ctx.arc(cx+(cw*0.7),cy+ch-(cw*0.3),(cw*0.3)-fc,deg2rad(0),deg2rad(360), false);
1702 break;
1703 case ".":
1704 ctx.moveTo(cx+(cw*0.25),cy+ch-fc-fc);
1705 ctx.arc(cx+(cw*0.25),cy+ch-fc-fc,fc,deg2rad(0),deg2rad(360), false);
1706 ctx.closePath();
1707 break;
1708 default:
1709 break;
1710 }
1711 ctx.stroke();
1712 }
1713 function drawBar(ctx,x,y,width,height,color,value,textdiv){
1714 var rw = width/2; var rh = rw/2;
1715 height = Math.max(height,rw);
1716 var dh = Math.max(height-(2*rh),0.1); var S2L;
1717 var xx = rw/8; var yy = rh/4;
1718 var yo = rh/2; y = y - yy;
1719 if(canvas_noshadow <= 0 && canvas_noshade <= 0) {
1720 ctx.save();
1721 S2L = ctx.createRadialGradient(x+rw+rh,y+height-rw+yy+rh,0,x+rw,y+height-rw+yy,rw);
1722 S2L.addColorStop(0, 'rgba(0,0,0,0.5)');
1723 S2L.addColorStop(0.7, 'rgba(0,0,0,0.25)');
1724 S2L.addColorStop(0.9, 'rgba(0,0,0,0.1)');
1725 S2L.addColorStop(1, 'rgba(0,0,0,0)');
1726 ctx.fillStyle = S2L;
1727 ctx.scale(1,0.5);
1728 ctx.translate(xx,y+height+yy);
1729 if(isOp){
1730 ctx.fillRect(x,y+yy+height-width,width,width);
1731 }else {
1732 ctx.arc(x+rw,y+yy+height-width,width,0,deg2rad(360), false);
1733 ctx.fill();
1734 }
1735 ctx.restore();
1736 }else if(canvas_noshadow <= 0 && canvas_noshade >= 1) {
1737 ctx.fillStyle = 'rgba(0,0,0,0.2)';
1738 ctx.fillRect(x+yo,y+rh+yo+yo,width,dh);
1739 }
1740
1741 if(canvas_noshade <= 0) {
1742 ctx.beginPath();
1743 ctx.moveTo(x,y+rh);
1744 ctx.lineTo(x,y+rh+dh);
1745 ctx.bezierCurveTo(x,y+height,x+width,y+height,x+width,y+rh+dh)
1746 ctx.lineTo(x+width,y+rh);
1747 ctx.bezierCurveTo(x+width,y,x,y,x,y+rh)
1748 ctx.closePath();
1749 ctx.fillStyle = color;
1750 ctx.fill();
1751 S2L = ctx.createLinearGradient(x,y+(height/2),x+width,y+(height/2));
1752 S2L.addColorStop(0, 'rgba(255,255,255,0.75)');
1753 S2L.addColorStop(0.2, 'rgba(255,255,255,0)');
1754 S2L.addColorStop(0.3, 'rgba(0,0,0,0)');
1755 S2L.addColorStop(0.5, 'rgba(0,0,0,0.1)');
1756 S2L.addColorStop(0.9, 'rgba(0,0,0,0.35)');
1757 S2L.addColorStop(1, 'rgba(0,0,0,0.3)');
1758 ctx.beginPath();
1759 ctx.moveTo(x,y+rh);
1760 ctx.lineTo(x,y+rh+dh);
1761 ctx.bezierCurveTo(x,y+height,x+width,y+height,x+width,y+rh+dh)
1762 ctx.lineTo(x+width,y+rh);
1763 ctx.bezierCurveTo(x+width,y,x,y,x,y+rh)
1764 ctx.closePath();
1765 ctx.fillStyle = S2L;
1766 ctx.fill();
1767 ctx.beginPath();
1768 ctx.moveTo(x+width,y+rh);
1769 ctx.bezierCurveTo(x+width,y,x,y,x,y+rh)
1770 ctx.bezierCurveTo(x,y+(rh*2),x+width,y+(rh*2),x+width,y+rh)
1771 ctx.closePath();
1772 ctx.fillStyle = color;
1773 ctx.fill();
1774 S2L = ctx.createLinearGradient(x+rw-(width*0.15),y-2,x+rw+(width*0.15),y+(2.1*rh));
1775 S2L.addColorStop(0, 'rgba(255,255,255,0.9)');
1776 S2L.addColorStop(0.5, 'rgba(255,255,255,0)');
1777 S2L.addColorStop(0.6, 'rgba(0,0,0,0)');
1778 S2L.addColorStop(1, 'rgba(0,0,0,0.3)');
1779 ctx.beginPath();
1780 ctx.moveTo(x+width,y+rh);
1781 ctx.bezierCurveTo(x+width,y,x,y,x,y+rh)
1782 ctx.bezierCurveTo(x,y+(rh*2),x+width,y+(rh*2),x+width,y+rh)
1783 ctx.closePath();
1784 ctx.fillStyle = S2L;
1785 ctx.fill();
1786 S2L = ctx.createLinearGradient(x+rw-(width*0.15),y-2,x+rw+(width*0.15),y+(2.1*rh));
1787 S2L.addColorStop(0, 'rgba(255,255,255,0.9)');
1788 S2L.addColorStop(0.5, 'rgba(255,255,255,0)');
1789 S2L.addColorStop(0.6, 'rgba(0,0,0,0)');
1790 S2L.addColorStop(1, 'rgba(0,0,0,0.1)');
1791 ctx.beginPath();
1792 ctx.moveTo(x+width,y+rh);
1793 ctx.bezierCurveTo(x+width,y,x,y,x,y+rh)
1794 ctx.bezierCurveTo(x,y+(rh*2),x+width,y+(rh*2),x+width,y+rh)
1795 ctx.closePath();
1796 ctx.strokeStyle = S2L;
1797 ctx.stroke();
1798 }else {
1799 ctx.fillStyle = color;
1800 ctx.fillRect(x,y+rh+yo,width,dh);
1801 }
1802 ctx.lineCap = "butt";
1803 ctx.lineWidth = 1;
1804 ctx.fillStyle = 'rgba(255,255,255,0.5)';
1805 var bw = width; var bh = bw/4;
1806 var th = roundTo(bh*0.75,0); var tf = bh/80;
1807 var c; var w;
1808 if(canvas_notext <= 0) {
1809 if(canvas_htmltext <= 0) {
1810 w = '"' + per + '"';
1811 if(w.indexOf(".")!=-1) {
1812 c = w.length+0.5;
1813 w = parseFloat(c-2)*parseFloat(48*tf);
1814 bw = parseFloat(c-1)*parseFloat(48*tf);
1815 }else {
1816 c = w.length;
1817 w = parseFloat(c-1)*parseFloat(48*tf);
1818 bw = parseFloat(c)*parseFloat(48*tf);
1819 }
1820 roundedRect(ctx,x+(width/2)-(bw/2),y,bw,bh,bh/4);
1821 ctx.fill();
1822 if(canvas_imgtext <= 0) {
1823 strokeString(ctx, value + "%","rgba(48,48,48,1)", th, x+(width/2)-(w/2), y+((bh-th)/2));
1824 }else {
1825 drawString(ctx, value + "%", tf, x+(width/2)-(w/2), y+((bh-th)/2.2));
1826 }
1827 }else {
1828 var bh = bw/3; var th = roundTo(bh*0.75,0);
1829 roundedRect(ctx,x,y,bw,bh,bh/4);
1830 ctx.fill();
1831 var obj = document.createElement('div');
1832 obj.style.position = "absolute";
1833 obj.style.overflow = "hidden";
1834 obj.style.textAlign = "center";
1835 obj.style.width = bw + "px";
1836 obj.style.left = x + "px";
1837 obj.style.top = y+((bh-th)/2.2) + "px";
1838 obj.appendChild(document.createTextNode(per + "%"));
1839 textdiv.appendChild(obj);
1840 }
1841
1842 }
1843 }
1844 function drawLine(ctx,x,y,width,height,dist,array,factor,color,fill){
1845 if(fill <= 0){
1846 var style = hex2rgb(color,0.5);
1847 ctx.lineJoin = "miter";
1848 ctx.beginPath();
1849 ctx.moveTo(x,y+height);
1850 for (var i = 0; i < array.length; i++) {
1851 ctx.lineTo(x+(i*dist),y+height-(array[i]*factor));
1852 }
1853 ctx.lineTo(x+width,y+height);
1854 ctx.lineTo(x,y+height);
1855 ctx.closePath();
1856 ctx.fillStyle = style;
1857 ctx.fill();
1858 }
1859 ctx.lineJoin = "round";
1860 ctx.beginPath();
1861 ctx.moveTo(x,y+height-(array[0]*factor));
1862 for (var i = 0; i < array.length; i++) {
1863 ctx.lineTo(x+(i*dist),y+height-(array[i]*factor));
1864 }
1865 ctx.strokeStyle = color;
1866 ctx.stroke();
1867 }
1868 function setDataURL(cid) {
1869 if(cid.toDataURL) {
1870 var obj = document.getElementById(cid.id + "_link");
1871 if(obj) {
1872 obj.setAttribute("title", "To Data URL");
1873 obj.setAttribute("target", "_blank");
1874 obj.setAttribute("href", cid.toDataURL());
1875 }
1876 }
1877 }
1878 function get_input(dataobj,canvasobj,linechart) {
1879 var table = document.getElementById(dataobj);
1880 var canvas = document.getElementById(canvasobj);
1881 var row; var clm; var cnt = 0; var val = 0; var nme = ""; var col = "";
1882 if(canvas.getContext) {
1883 canvas_width = parseInt(canvas.style.width);
1884 canvas_height = parseInt(canvas.style.height);
1885 if(canvas_width >= 16 && canvas_height >= 16) {
1886 var tmp = table.getAttribute("summary");
1887 canvas_noshade = 0; canvas_noshadow = 0;
1888 canvas_notext = 0; canvas_imgtext = 0;
1889 canvas_htmltext = 0; canvas_nofill = 0;
1890 if(tmp.search(/noshadow/) != -1) canvas_noshadow = 1;
1891 if(tmp.search(/noshade/) != -1) canvas_noshade = 1;
1892 if(tmp.search(/nofill/) != -1) canvas_nofill = 1;
1893 if(tmp.search(/notext/) != -1) canvas_notext = 1;
1894 if(tmp.search(/htmltext/) != -1) canvas_htmltext = 1;
1895 if(tmp.search(/imgtext/) != -1) canvas_imgtext = 1;
1896 if(table.getAttribute("bgcolor")) {
1897 canvas_bgcolor = scanColor(table.getAttribute("bgcolor"));
1898 }
1899 ChartData = new Array(); colorSlice = new Array();
1900 if(table.getElementsByTagName("tr")[0].getElementsByTagName("th")[0]) cnt = 1;
1901 for(var r = cnt; r < table.getElementsByTagName("tr").length; r++) {
1902 row = table.getElementsByTagName("tr")[r];
1903 clm = row.getElementsByTagName("td").length;
1904 if(row.getElementsByTagName("td")[0].getAttribute("bgcolor")) {
1905 col = scanColor(row.getElementsByTagName("td")[0].getAttribute("bgcolor")); val = 0;
1906 nme = trim(row.getElementsByTagName("td")[1].innerHTML.replace(/<[^>]+>/g,""));
1907 if(!linechart) {
1908 if(clm > 3) {
1909 for(var z = 2; z < clm; z++) {
1910 val += parseFloat(row.getElementsByTagName("td")[z].innerHTML.replace(/<[^>]+>/g,""));
1911 }
1912 }else {
1913 val = parseFloat(row.getElementsByTagName("td")[2].innerHTML.replace(/<[^>]+>/g,""));
1914 }
1915 if(!isNaN(val) && val > 0 && nme != '') {
1916 colorSlice[r-cnt] = col; ChartData[nme] = Math.abs(val);
1917 }else {
1918 break;
1919 }
1920 }else {
1921 val = 0; i = 0;
1922 if(clm > 3 && nme != '') {
1923 ChartData[r-cnt] = new Array();
1924 colorSlice[r-cnt] = col;
1925 for(var z = 2; z < clm; z++) {
1926 val = Math.abs(parseFloat(row.getElementsByTagName("td")[z].innerHTML.replace(/<[^>]+>/g,"")));
1927 if(!isNaN(val) && val >= 0) {
1928 ChartData[r-cnt][i] = val; i++;
1929 }else {
1930 ChartData[r-cnt][i] = 0; i++;
1931 }
1932 }
1933 }else {
1934 break;
1935 }
1936 }
1937 }else {
1938 break;
1939 }
1940 }
1941 }
1942 }
1943 }
1944 function setPieChart(canvasobj,textobj) {
1945 var cd = (Math.min(canvas_width,canvas_height)/110)*100;
1946 var cp = cd*0.1; var cr = cd/2;
1947 var sr = cr*0.93; var cw = cd+cp; var ch = cw;
1948 var cx = (cd/2)+(cp/2); var cy = cx; var ct = 0;
1949 for (var data in ChartData) {
1950 ct += ChartData[data];
1951 }
1952 var poc = ct/100;
1953 var canvas = document.getElementById(canvasobj);
1954 if(canvas_htmltext >= 1) {
1955 if(document.getElementById(textobj)) {
1956 canvas.parentNode.removeChild(canvas.parentNode.lastChild);
1957 }
1958 }
1959 if(canvas.getContext) {
1960 var ctx = canvas.getContext('2d');
1961 if(canvas_bgcolor != "") {
1962 ctx.fillStyle = canvas_bgcolor;
1963 ctx.fillRect(0,0,cw,ch);
1964 }else {
1965 ctx.clearRect(0,0,cw,ch);
1966 }
1967 if(canvas_noshadow <= 0) {
1968 if(!isOp) {
1969 ctx.beginPath();
1970 var B2B = ctx.createRadialGradient(cx+(cr*0.1),cy+(cr*0.1),cr,cx+(cr*0.1),cy+(cr*0.1),sr*0.9);
1971 B2B.addColorStop(0, 'rgba(0,0,0,0)');
1972 B2B.addColorStop(1, 'rgba(0,0,0,0.5)');
1973 ctx.arc(cx+(cr*0.1),cy+(cr*0.1),cr,0,deg2rad(360), false);
1974 ctx.closePath();
1975 ctx.fillStyle = B2B;
1976 ctx.fill();
1977 }else {
1978 var B2B = ctx.createRadialGradient(cx+(cr*0.1),cy+(cr*0.1),0,cx+(cr*0.1),cy+(cr*0.1),cr);
1979 B2B.addColorStop(0, 'rgba(0,0,0,0.5)');
1980 B2B.addColorStop(0.87, 'rgba(0,0,0,0.5)');
1981 B2B.addColorStop(1, 'rgba(0,0,0,0)');
1982 ctx.fillStyle = B2B;
1983 ctx.fillRect(0,0,cw,ch);
1984 }
1985 }
1986 var val = 0; var deg = 0; var idx = 0; var data;
1987 for (data in ChartData) {
1988 val = ChartData[data]; sdeg = deg;
1989 deg += (val/ct)*deg2rad(360); edeg = deg;
1990 ctx.beginPath();
1991 ctx.moveTo(cx,cy);
1992 ctx.arc(cx,cy,cr,sdeg,edeg, false);
1993 ctx.lineTo(cx,cy);
1994 ctx.closePath();
1995 ctx.fillStyle = colorSlice[(idx++)];
1996 ctx.fill();
1997 }
1998 if(canvas_noshade <= 0) {
1999 ctx.beginPath();
2000 var W2T = ctx.createLinearGradient(cp*2,cp*2,cx,cy);
2001 W2T.addColorStop(0, 'rgba(255,255,255,0.8)');
2002 W2T.addColorStop(1, 'rgba(255,255,255,0)');
2003 ctx.moveTo(cx,cy);
2004 ctx.arc(cx,cy,sr,deg2rad(135),deg2rad(315), false);
2005 ctx.closePath();
2006 ctx.fillStyle = W2T;
2007 ctx.fill();
2008 ctx.beginPath();
2009 var T2B = ctx.createLinearGradient(cx,cy,cw-(cp*2),ch-(cp*2));
2010 T2B.addColorStop(0, 'rgba(0,0,0,0)');
2011 T2B.addColorStop(1, 'rgba(0,0,0,0.5)');
2012 ctx.moveTo(cx,cy);
2013 ctx.arc(cx,cy,sr,deg2rad(-45),deg2rad(135), false);
2014 ctx.closePath();
2015 ctx.fillStyle = T2B;
2016 ctx.fill();
2017 ctx.beginPath();
2018 var B2T = ctx.createLinearGradient(cx,cy,cw-(cp*1.9),ch-(cp*1.9));
2019 B2T.addColorStop(0, 'rgba(0,0,0,0)');
2020 B2T.addColorStop(1, 'rgba(0,0,0,0.6)');
2021 ctx.lineWidth = cr*0.07;
2022 ctx.lineCap = "round";
2023 ctx.moveTo(cx,cy);
2024 ctx.arc(cx,cy,cr*0.965,deg2rad(-45),deg2rad(135), false);
2025 ctx.closePath();
2026 ctx.strokeStyle = B2T;
2027 ctx.stroke();
2028 ctx.beginPath();
2029 var T2W = ctx.createLinearGradient(cx,cy,(cp*1.9),(cp*1.9));
2030 T2W.addColorStop(0, 'rgba(255,255,255,0)');
2031 T2W.addColorStop(1, 'rgba(255,255,255,0.6)');
2032 ctx.lineWidth = cr*0.07;
2033 ctx.lineCap = "round";
2034 ctx.moveTo(cx,cy);
2035 ctx.arc(cx,cy,cr*0.965,deg2rad(135),deg2rad(315), false);
2036 ctx.closePath();
2037 ctx.strokeStyle = T2W;
2038 ctx.stroke();
2039 }
2040 ctx.lineCap = "butt";
2041 ctx.lineWidth = 1;
2042 ctx.fillStyle = 'rgba(255,255,255,0.5)';
2043 var mpos = 0; var per = 0; var gx = 0;
2044 var gy = 0; var tx = 0; var ty = 0;
2045 var obj = ""; var w = 0; var c = 0;
2046 var bw = cr*0.45; var bh = cr*0.125;
2047 var th = roundTo(bh*0.75,0); var tf = bh/80;
2048 if(canvas_notext <= 0) {
2049 if(canvas_htmltext >= 1) {
2050 bw = (cr*0.365);
2051 canvas.parentNode.style.position = "relative";
2052 if(!document.getElementById(textobj)) {
2053 obj = document.createElement('div');
2054 obj.id = textobj;
2055 obj.style.color = "rgb(0,0,0)";
2056 obj.style.fontFamily = "Arial,sans-serif";
2057 obj.style.fontSize = th + "px";
2058 obj.style.zIndex = 11;
2059 canvas.parentNode.appendChild(obj);
2060 }
2061 var textdiv = document.getElementById(obj.id);
2062 }
2063 for (data in ChartData) {
2064 val = ChartData[data];
2065 sdeg = deg; mpos = deg+(((val/2)/ct)*deg2rad(360));
2066 deg += (val/ct)*deg2rad(360); edeg = deg;
2067 per = roundTo(val/poc,2);
2068 gx = circle_point_x(mpos, cd);
2069 gy = circle_point_y(mpos, cd);
2070 tx = parseFloat((cx+(2*Math.floor(cx + gx)))/3);
2071 ty = (cy+(2*Math.floor(cy + gy)))/3;
2072 if(canvas_htmltext <= 0) {
2073 w = '"' + per + '"';
2074 if(w.indexOf(".")!=-1) {
2075 c = w.length+0.5;
2076 w = parseFloat(c-2)*parseFloat(48*tf);
2077 bw = parseFloat(c-1)*parseFloat(48*tf);
2078 }else {
2079 c = w.length;
2080 w = parseFloat(c-1)*parseFloat(48*tf);
2081 bw = parseFloat(c)*parseFloat(48*tf);
2082 }
2083 roundedRect(ctx,(tx-(bw/2)),ty-(bh/2),bw,bh,bh/4);
2084 ctx.fill();
2085 if(canvas_imgtext >= 1) {
2086 drawString(ctx, per + "%", tf, tx-(w/2), ty-(th/1.8));
2087 }else {
2088 strokeString(ctx, per + "%","rgba(48,48,48,1)", th, tx-(w/2), ty-(th/2));
2089 }
2090 }else {
2091 roundedRect(ctx,(tx-(bw/2)),ty-(bh/2),bw,bh,bh/4);
2092 ctx.fill();
2093 obj = document.createElement('div');
2094 obj.style.position = "absolute";
2095 obj.style.overflow = "hidden";
2096 obj.style.textAlign = "center";
2097 obj.style.width = bw + "px";
2098 obj.style.left = (tx-(bw/2)) + "px";
2099 obj.style.top = ty-(th/1.8) + "px";
2100 obj.appendChild(document.createTextNode(per + "%"));
2101 textdiv.appendChild(obj);
2102 }
2103 }
2104 }
2105 }
2106 }
2107 function setBarChart(canvasobj,textobj) {
2108 var iw = canvas_width*0.9; var ih = canvas_height*0.9;
2109 var pw = canvas_width*0.05; var ph = canvas_height*0.05;
2110 var cm = 0; var ct = 0;
2111 for (var data in ChartData) {
2112 cm = Math.max(cm,ChartData[data]);
2113 ct += ChartData[data];
2114 }
2115 var hf = ih/cm; var bs = colorSlice.length;
2116 var bw = iw/(bs*1.1); var poc = ct/100;
2117 var th = roundTo((bw/3)*0.75,0);
2118 var canvas = document.getElementById(canvasobj);
2119 if(canvas.getContext) {
2120 var ctx = canvas.getContext('2d');
2121 if(canvas_bgcolor != "") {
2122 ctx.fillStyle = canvas_bgcolor;
2123 ctx.fillRect(0,0,canvas_width,canvas_height);
2124 }else {
2125 ctx.clearRect(0,0,canvas_width,canvas_height);
2126 }
2127 if(canvas_htmltext >= 1) {
2128 if(document.getElementById(textobj)) {
2129 canvas.parentNode.removeChild(canvas.parentNode.lastChild);
2130 }
2131 canvas.parentNode.style.position = "relative";
2132 if(!document.getElementById(textobj)) {
2133 var obj = document.createElement('div');
2134 obj.id = textobj;
2135 obj.style.color = "rgb(0,0,0)";
2136 obj.style.fontFamily = "Arial,sans-serif";
2137 obj.style.fontSize = th + "px";
2138 obj.style.zIndex = 11;
2139 canvas.parentNode.appendChild(obj);
2140 }
2141 var textdiv = document.getElementById(obj.id);
2142 }
2143 var cc = ""; var bh = 0; var idx = 0; var t = 0; per = 0;
2144 for (var data in ChartData) {
2145 per = roundTo(ChartData[data]/poc,2);
2146 bh = ChartData[data]*hf;
2147 drawBar(ctx,pw+(t*(bw*1.1)),ph+ih-bh,bw,bh,colorSlice[(idx++)],per,textdiv);
2148 t++;
2149 }
2150 }
2151 }
2152 function setLineChart(canvasobj,textobj) {
2153 var iw = canvas_width*0.9;
2154 var ih = canvas_height*0.9;
2155 var pw = canvas_width*0.05;
2156 var ph = canvas_height*0.05;
2157 var cm = 0;
2158 for (var i = 0; i < ChartData.length; i++) {
2159 for (var j = 0; j < ChartData[i].length; j++) {
2160 cm = Math.max(cm,ChartData[i][j]);
2161 }
2162 }
2163 var hf = (ih*0.95)/cm; var bw = iw;
2164 var dw = iw/(ChartData[0].length-1)
2165 var dh = ih/(ChartData[0].length-1)
2166 var ps = Math.min(pw,ph); lw = ps/4;
2167 var B2T;
2168 var canvas = document.getElementById(canvasobj);
2169 if(canvas.getContext) {
2170 var ctx = canvas.getContext('2d');
2171 if(canvas_bgcolor != "") {
2172 ctx.fillStyle = canvas_bgcolor;
2173 ctx.fillRect(0,0,canvas_width,canvas_height);
2174 }else {
2175 ctx.clearRect(0,0,canvas_width,canvas_height);
2176 }
2177 if(canvas_noshadow <= 0) {
2178 B2T = ctx.createLinearGradient(pw+ps,ph+ih+1,pw+ps+ps,ph+ih+1);
2179 B2T.addColorStop(0, 'rgba(0,0,0,0.0)');
2180 B2T.addColorStop(1, 'rgba(0,0,0,0.5)');
2181 ctx.fillStyle = B2T;
2182 ctx.beginPath();
2183 ctx.moveTo(pw+ps,ph+ih);
2184 ctx.lineTo(pw+ps,ph+ih+ps);
2185 ctx.lineTo(pw+ps+ps,ph+ih);
2186 ctx.closePath();
2187 ctx.fill();
2188 B2T = ctx.createLinearGradient(pw+ps+ps,ph+ih,pw+ps+ps,ph+ih+ps);
2189 B2T.addColorStop(0, 'rgba(0,0,0,0.5)');
2190 B2T.addColorStop(1, 'rgba(0,0,0,0.0)');
2191 ctx.fillStyle = B2T;
2192 ctx.beginPath();
2193 ctx.moveTo(pw+ps+ps,ph+ih);
2194 ctx.lineTo(pw+iw,ph+ih);
2195 ctx.lineTo(pw+ps+iw,ph+ih+ps);
2196 ctx.lineTo(pw+ps,ph+ih+ps);
2197 ctx.closePath();
2198 ctx.fill();
2199 var B2T = ctx.createLinearGradient(pw+iw+1,ph+ps,pw+iw+1,ph+ps+ps);
2200 B2T.addColorStop(0, 'rgba(0,0,0,0.0)');
2201 B2T.addColorStop(1, 'rgba(0,0,0,0.35)');
2202 ctx.fillStyle = B2T;
2203 ctx.beginPath();
2204 ctx.moveTo(pw+iw,ph+ps);
2205 ctx.lineTo(pw+iw,ph+ps+ps);
2206 ctx.lineTo(pw+iw+ps,ph+ps);
2207 ctx.closePath();
2208 ctx.fill();
2209 B2T = ctx.createLinearGradient(pw+iw,ph+ps+ps,pw+iw+ps,ph+ps+ps);
2210 B2T.addColorStop(0, 'rgba(0,0,0,0.35)');
2211 B2T.addColorStop(1, 'rgba(0,0,0,0.0)');
2212 ctx.fillStyle = B2T;
2213 ctx.beginPath();
2214 ctx.moveTo(pw+iw,ph+ps+ps);
2215 ctx.lineTo(pw+iw,ph+ih);
2216 ctx.lineTo(pw+iw+ps,ph+ih+ps);
2217 ctx.lineTo(pw+iw+ps,ph+ps);
2218 ctx.closePath();
2219 ctx.fill();
2220 }
2221 ctx.lineCap = "butt";
2222 ctx.lineWidth = lw/2;
2223 ctx.strokeStyle = "rgba(255,255,255,0.25)";
2224 if(canvas_nofill <= 0) {
2225 ctx.fillStyle = "rgba(240,240,240,0.8)";
2226 ctx.strokeStyle = "rgba(255,255,255,1)";
2227 ctx.fillRect(pw,ph,iw,ih);
2228 }
2229 for (var i = 0; i < ChartData[0].length-1; i++) {
2230 ctx.beginPath();
2231 ctx.moveTo(pw+(i*dw),ph);
2232 ctx.lineTo(pw+(i*dw),ph+ih);
2233 ctx.stroke();
2234 }
2235 for (var i = 1; i < ChartData[0].length; i++) {
2236 ctx.beginPath();
2237 ctx.moveTo(pw,ph+(i*dh));
2238 ctx.lineTo(pw+iw,ph+(i*dh));
2239 ctx.stroke();
2240 }
2241 ctx.lineWidth = lw;
2242 var cc = ""; var bh = 0; var idx = 0; var t = 0;
2243 for (var i = 0; i < ChartData.length; i++) {
2244 for (var j = 0; j < ChartData[i].length; j++) {
2245 t = Math.max(t,ChartData[i][j]);
2246 }
2247 bh = t*hf; cc = colorSlice[(idx++)];
2248 drawLine(ctx,pw,ph+ih-bh,bw,bh,dw,ChartData[i],hf,cc,canvas_nofill);
2249 }
2250 ctx.beginPath();
2251 ctx.moveTo(pw,ph);
2252 ctx.lineTo(pw,ph+ih);
2253 ctx.lineTo(pw+iw+(lw/2),ph+ih);
2254 ctx.strokeStyle = "rgba(48,48,48,1)";
2255 ctx.stroke();
2256 ctx.lineWidth = lw/2;
2257 B2T = ctx.createLinearGradient(pw,ph+ih,pw,ph+ih+ps);
2258 B2T.addColorStop(0, 'rgba(0,0,0,1)');
2259 B2T.addColorStop(0.5, 'rgba(0,0,0,1)');
2260 B2T.addColorStop(1, 'rgba(0,0,0,0)');
2261 ctx.strokeStyle = B2T;
2262 for (var i = 0; i < ChartData[0].length; i++) {
2263 ctx.beginPath();
2264 ctx.moveTo(pw+(i*dw),ph+ih);
2265 ctx.lineTo(pw+(i*dw),ph+ih+ps);
2266 ctx.stroke();
2267 }
2268 B2T = ctx.createLinearGradient(pw-ps,ph,pw,ph);
2269 B2T.addColorStop(0, 'rgba(0,0,0,0)');
2270 B2T.addColorStop(0.5, 'rgba(0,0,0,1)');
2271 B2T.addColorStop(1, 'rgba(0,0,0,1)');
2272 ctx.strokeStyle = B2T;
2273 for (var i = 1; i < ChartData[0].length; i++) {
2274 ctx.beginPath();
2275 ctx.moveTo(pw-ps,ph+(i*dh));
2276 ctx.lineTo(pw,ph+(i*dh));
2277 ctx.stroke();
2278 }
2279 }
2280 }
2281 function generateCanvas() {
2282 if(canvasSupport) {
2283 var canvasID; var tdataID; var textID;
2284 var tmp; var dat; var i; var j;
2285 for(i=0; i < piecharts.length; i++) {
2286 tmp = piecharts[i].id.split("_");
2287 tdataID = piecharts[i].id;
2288 canvasID = tmp[0] + "_canvas";
2289 textID = tmp[0] + "_text";
2290 if(document.getElementById(tdataID)) {
2291 get_input(tdataID,canvasID);
2292 if(colorSlice.length > 0) {
2293 j = 0; dat = ""; for(dat in ChartData) {j++; }
2294 if(j > 0 && j == colorSlice.length) {
2295 setPieChart(canvasID,textID);
2296 }
2297 }
2298 }
2299 }
2300 for(i=0; i < barcharts.length; i++) {
2301 tmp = barcharts[i].id.split("_");
2302 tdataID = barcharts[i].id;
2303 canvasID = tmp[0] + "_canvas";
2304 textID = tmp[0] + "_text";
2305 if(document.getElementById(tdataID)) {
2306 get_input(tdataID,canvasID);
2307 if(colorSlice.length > 0) {
2308 j = 0; dat = ""; for(dat in ChartData) {j++; }
2309 if(j > 0 && j == colorSlice.length) {
2310 setBarChart(canvasID,textID);
2311 }
2312 }
2313 }
2314 }
2315 for(i=0; i < linecharts.length; i++) {
2316 tmp = linecharts[i].id.split("_");
2317 tdataID = linecharts[i].id;
2318 canvasID = tmp[0] + "_canvas";
2319 textID = tmp[0] + "_text";
2320 if(document.getElementById(tdataID)) {
2321 get_input(tdataID,canvasID,true);
2322 if(colorSlice.length > 0) {
2323 if(ChartData.length == colorSlice.length) {
2324 setLineChart(canvasID,textID);
2325 }
2326 }
2327 }
2328 }
2329 }
2330 }
2331 // canvas chart extension
2332
2333 // invisible select extension
2334 function setListPos(opt) {
2335 if(!isIE) { //(degrade IE)
2336 var ref = document.getElementById('list');
2337 var x = findPosX(ref); var y = findPosY(ref);
2338 var obj = document.getElementById('jumplist');
2339 obj.style.position = 'fixed'; obj.style.left = x + 'px'; obj.style.top = y + 'px';
2340 var vol = document.getElementById('volumelist');
2341 ref = document.getElementById('volume');
2342 x = findPosX(ref); y = findPosY(ref);
2343 vol.style.position = 'fixed'; vol.style.left = x + 'px'; vol.style.top = y + 'px';
2344 var pnl = document.getElementById('navLinks');
2345 }
2346 if(opt) {
2347 if (isIE) {
2348 //(degrade IE)
2349 //obj.style.filter = "alpha(opacity=0)";
2350 //vol.style.filter = "alpha(opacity=0)";
2351 //pnl.style.filter = "alpha(opacity=90)";
2352 }else {
2353 obj.style.opacity = 0.0;
2354 vol.style.opacity = 0.0;
2355 pnl.style.opacity = 0.9;
2356 }
2357 if(!isOp && !isIE) {
2358 vol.onmouseover = function () { document.getElementById('volume').style.color="rgb(255, 0, 0)"; return false; }
2359 vol.onmouseout = function () { document.getElementById('volume').style.color=""; return false; }
2360 obj.onmouseover = function () { document.getElementById('list').style.color="rgb(255, 0, 0)"; return false; }
2361 obj.onmouseout = function () { document.getElementById('list').style.color=""; return false; }
2362 }
2363 }
2364 }
2365 // invisible select extension
2366
2367 // transition extension
2368 function switchFade() {
2369 if(tranSitions && s5mode && fadeModus) {
2370 fadeModus = false;
2371 playDelay = playDelay-(2*fadeDuration);
2372 document.getElementById('fade').style.color="";
2373 }else if(tranSitions && s5mode && !fadeModus) {
2374 fadeModus = true;
2375 playDelay = playDelay+(2*fadeDuration);
2376 document.getElementById('fade').style.color=highLight;
2377 }
2378 currentSlide();
2379 }
2380 function opacity(ids, opacStart, opacEnd, millisec) {
2381 var speed = Math.round(millisec / 100);
2382 var timer = 0;
2383 if(opacStart > opacEnd) {
2384 for(var i = opacStart; i >= opacEnd; i--) {
2385 window.setTimeout("changeOpac(" + i + ",'" + ids + "')",(timer * speed));
2386 timer++;
2387 }
2388 } else if(opacStart < opacEnd) {
2389 for(var i = opacStart; i <= opacEnd; i++) {
2390 window.setTimeout("changeOpac(" + i + ",'" + ids + "')",(timer * speed));
2391 timer++;
2392 }
2393 }
2394 }
2395 function changeOpac(opacity, ids) {
2396 var obj = document.getElementById(ids);
2397 if (isIE) {
2398 obj.style.filter = "alpha(opacity=" + opacity + ")";
2399 } else {
2400 obj.style.opacity = (opacity / 100);
2401 }
2402 }
2403 function shiftOpacity(ids, millisec) {
2404 if(document.getElementById(ids).style.opacity != '') {
2405 var currentOpac = document.getElementById(ids).style.opacity * 100;
2406 } else {
2407 var currentOpac = 0;
2408 }
2409 if(currentOpac == 0) {
2410 opacity(ids, currentOpac, 100, millisec);
2411 } else if(currentOpac > 0) {
2412 opacity(ids, currentOpac, 0, millisec);
2413 }
2414 }
2415 // transition extension
2416
2417 // autoplay extension
2418 function autoPlay() {
2419 if (s5mode && autoMatic && !playPause) {
2420 if ((snum >= (smax-1)) && playLoop) {
2421 goTo(0);
2422 autoRun = setTimeout('autoPlay();',playDelay);
2423 }else if ((snum >= (smax-1)) && !playLoop) {
2424 stopPlay();
2425 }else {
2426 if (!incrementals[snum] || incpos >= incrementals[snum].length) {
2427 go(1);
2428 if (incrementals[snum].length >0) {
2429 clearTimeout(autoRun); autoRun = null;
2430 incrDelay = parseInt(playDelay/(incrementals[snum].length+1));
2431 remainDer = parseInt(playDelay-(incrDelay*incrementals[snum].length));
2432 autoRun = setTimeout('autoPlayIncr()',incrDelay);
2433 }
2434 } else {
2435 clearTimeout(autoRun); autoRun = null;
2436 incrDelay = incrDuration;
2437 remainDer = parseInt(playDelay-(incrementals[snum].length*incrDuration));
2438 autoRun = setTimeout('autoPlayIncr()',incrDelay);
2439 }
2440 autoRun = setTimeout('autoPlay();',playDelay);
2441 }
2442 }
2443 }
2444 function autoPlayIncr() {
2445 if (incpos < incrementals[snum].length) {
2446 subgo(1);
2447 autoRun = setTimeout('autoPlayIncr();',incrDelay);
2448 }else {
2449 autoRun = setTimeout('nop();',remainDer);
2450 }
2451 }
2452 function nop() {
2453 // no operation dummy
2454 }
2455 function togglePlay() {
2456 if (autoRun && s5mode) {
2457 stopPlay();
2458 }else if (!autoRun && s5mode) {
2459 startPlay();
2460 }
2461 }
2462 function stopPlay() {
2463 if (autoRun && s5mode) {
2464 clearTimeout(autoRun); autoRun = null;
2465 autoMatic = false; playPause = false;
2466 document.getElementById('auto').style.color="";
2467 document.getElementById('pause').style.color="";
2468 currentSlide();
2469 }
2470 }
2471 function startPlay() {
2472 if (!autoRun && s5mode) {
2473 playPause = false; autoMatic = true;
2474 document.getElementById('pause').style.color="";
2475 document.getElementById('auto').style.color=highLight;
2476 autoRun = setTimeout('autoPlay();',playDelay);
2477 currentSlide();
2478 }
2479 }
2480 function pausePlay() {
2481 if (s5mode && autoMatic) {
2482 if (playPause) {
2483 playPause = false; autoRun = setTimeout('autoPlay();',playDelay);
2484 document.getElementById('pause').style.color="";
2485 }else {
2486 if (autoRun){
2487 clearTimeout(autoRun); autoRun = null; playPause = true;
2488 document.getElementById('pause').style.color=highLight;
2489 }
2490 }
2491 currentSlide();
2492 }
2493 }
2494 function switchLoop() {
2495 if(s5mode) {
2496 if (playLoop) {
2497 playLoop = false; document.getElementById('loop').style.color="";
2498 }else {
2499 playLoop = true; document.getElementById('loop').style.color=highLight;
2500 }
2501 }
2502 currentSlide();
2503 }
2504 function setDelay(val) {
2505 if(s5mode) {
2506 var delay = Math.max(5,Math.min(val,300));
2507 playDelay = (fadeModus == true) ? ((delay*1000)+(2*fadeDuration)) : (delay*1000);
2508 }
2509 }
2510 // autoplay extension
2511
2512 // audio extension
2513 function createSoundManagerScript() {
2514 if(typeof soundManager=="undefined") {
2515 onerrorSM2();
2516 }else {
2517 var script=document.createElement('SCRIPT');
2518 var tx=document.createTextNode("soundManager.createMovie();");
2519 script.appendChild(tx);
2520 document.getElementsByTagName("body")[0].appendChild(script);
2521 }
2522 }
2523 //soundManager.onload = function() {
2524 function onloadSM2() {
2525 if(!isIE) { //(degrade IE)
2526 swfUnloaded = false;
2527 preloadSounds();
2528 }
2529 }
2530 //soundManager.onerror = function() {
2531 function onerrorSM2() {
2532 if(typeof soundManager!="undefined") {
2533 soundManager.destruct;
2534 delete soundManager;
2535 }
2536 audioSupport = false; swfUnloaded = true;
2537 if(audioError && !isIE && !isOp) {
2538 var dv = document.createElement('div'); dv.id = "guru";
2539 var d2=document.createElement('div'); dv.appendChild(d2);
2540 var tx=document.createTextNode('Guru Meditation - SoundManager failed to load/initialize!');
2541 d2.appendChild(tx); document.getElementById('slide0').appendChild(dv);
2542 }
2543 }
2544 function audioSetup() {
2545 if(sound[0]) {
2546 playSound(0);
2547 }else if(sound[bgSoundItem] && !sound[0]) {
2548 playSound(bgSoundItem);
2549 }
2550 }
2551 function fadeoutSound(ids, option) {
2552 if(curSoundID >= 0 && !swfUnloaded) {
2553 if(isNaN(ids)) {
2554 if(ids == "bgSound") {
2555 var cnum = parseInt(bgSoundItem);
2556 }else {
2557 for (var i = 0; i < (sound.length-1); i++) {
2558 if(sound[i] && ids == sound[i]["id"]) {
2559 var cnum = i;
2560 break;
2561 }
2562 }
2563 }
2564 }else {
2565 var cnum = ids;
2566 ids = sound[cnum]["id"];
2567 }
2568 var vol = getMaxVolume(sound[cnum]["volume"]);
2569 var millisec = fadeDuration;
2570 var speed = Math.round(millisec / vol);
2571 var timer = 0;
2572 for(var i = vol; i > 0; i--) {
2573 setTimeout("fadeout(" + i + ",'" + ids + "')",(timer * speed));
2574 timer++;
2575 }
2576 if(option) setTimeout("stopSound('"+ids+"')",millisec);
2577 }
2578 }
2579 function fadeout(volume, id) {
2580 soundManager.setVolume(id,volume);
2581 }
2582 function stopSound(ids) {
2583 var sid;
2584 if(isNaN(ids)) {
2585 sid = ids;
2586 }else if(sound[ids]) {
2587 sid = sound[ids]["id"];
2588 }
2589 if(sid!='' && curSoundID >= 0) {
2590 soundManager.stop(sid);
2591 curSoundID = -1;
2592 }
2593 }
2594 function toggleSounds() {
2595 if(audioSupport && !swfUnloaded) {
2596 stopAllSounds();
2597 }else if (!audioSupport && !swfUnloaded) {
2598 allowSounds();
2599 }
2600 }
2601 function allowSounds() {
2602 if(!swfUnloaded) {
2603 audioSupport = true;
2604 document.getElementById('audio').style.color=highLight;
2605 currentSlide();
2606 }
2607 }
2608 function stopAllSounds() {
2609 if(curSoundID >= 0) {
2610 stopSound(curSoundID);
2611 }else {
2612 soundManager.stopAll();
2613 curSoundID = -1;
2614 }
2615 audioSupport = false;
2616 document.getElementById('audio').style.color="";
2617 currentSlide();
2618 }
2619 function playSound(id) {
2620 if(audioSupport && !swfUnloaded) {
2621 var url, sid, vol, lps, cnum;
2622 if(isNaN(id)) {
2623 sid = id;
2624 if(sid == "bgSound") {
2625 cnum = parseInt(bgSoundItem);
2626 }else {
2627 cnum = getSoundID(id);
2628 }
2629 }else {
2630 cnum = parseInt(id);
2631 if(sound[cnum]) sid = sound[cnum]["id"];
2632 }
2633 if(sound[cnum] && sound[cnum]["url"]!='' && sid!=''){
2634 url = sound[cnum]["url"];
2635 vol = (sound[cnum]["volume"]!='')?getMaxVolume(sound[cnum]["volume"]):getMaxVolume(100);
2636 lps = (sound[cnum]["loops"])?true:false;
2637 if(lps) {
2638 soundManager.play(sid,{volume:vol,onplay:function(){curSoundID=cnum;},onfinish:function(){soundManager.play(sid,{volume:getMaxVolume(sound[cnum]["volume"])});}});
2639 }else {
2640 soundManager.play(sid,{volume:vol,onplay:function(){curSoundID=cnum;},onfinish:function(){curSoundID=-1;}});
2641 }
2642 }
2643 }
2644 }
2645 function getSoundID(str) {
2646 for (var i = 0; i < (sound.length-1); i++) {
2647 if(sound[i] && str == sound[i]["id"]) {
2648 var id = i;
2649 break;
2650 }
2651 }
2652 return id;
2653 }
2654 function setVolume() {
2655 var vol = document.getElementById('volumelist');
2656 if(audioSupport && !swfUnloaded) {
2657 audioVolume = parseInt(vol.value);
2658 if(curSoundID >= 0) {
2659 if(sound[curSoundID]) {
2660 var sid = sound[curSoundID]["id"];
2661 var vid = getMaxVolume(sound[curSoundID]["volume"]);
2662 soundManager.setVolume(sid,vid);
2663 }
2664 }
2665 }
2666 }
2667 function getMaxVolume(value) {
2668 if(audioVolume>0) {var factor = audioVolume/100;}else {var factor = 0;}
2669 return Math.max(0,Math.min(parseInt(value*factor),audioVolume));
2670 }
2671 function preloadSounds() {
2672 var temp = ''; var parm = ''; var t = ''; var cl = '';
2673 var objects = document.getElementsByTagName('object');
2674 for (var i=0; i < objects.length; i++) {
2675 if(objects[i].type.toLowerCase() == 'audio/mp3' && objects[i].data != '') {
2676 objects[i].width = 0; objects[i].height = 0;
2677 if(objects[i].parentNode.tagName == 'DIV') {
2678 cl = objects[i].parentNode.className.toLowerCase();
2679 if(cl == 'presentation' || cl == 'slide') {
2680 if(cl == 'presentation') {
2681 t = parseInt(bgSoundItem);
2682 }else {
2683 t = parseInt(objects[i].parentNode.id.slice(5, objects[i].parentNode.id.length));
2684 }
2685 sound[t] = new Object();
2686 if(t < bgSoundItem) {
2687 sound[t]["id"] = objects[i].parentNode.id;
2688 }else {
2689 sound[t]["id"] = "bgSound";
2690 }
2691 sound[t]["url"] = objects[i].data;
2692 sound[t]["volume"] = 100; sound[t]["loops"] = false;
2693 if(objects[i].archive != '') {
2694 parm = objects[i].archive.toLowerCase().split(',');
2695 for (var j=0; j < parm.length; j++) {
2696 if(parm[j] == 'loop') sound[t]["loops"] = true;
2697 if(parm[j].search(/^volume/) != -1) {
2698 var tmp = parm[j].split(':');
2699 sound[t]["volume"] = parseInt(tmp[1]);
2700 }
2701 }
2702 }
2703 soundManager.createSound(sound[t]["id"],sound[t]["url"]);
2704 }
2705 }
2706 }
2707 }
2708 }
2709 // audio extension
2710
2711 // help extension
2712 function createHelpReq() {
2713 if(!document.getElementById("HelpReq")) {
2714 var obj = document.getElementsByTagName("body")[0].firstChild;
2715 var pg = document.createElement('div');
2716 pg.id = "HelpReq";
2717 if (pg.addEventListener) {
2718 pg.addEventListener("onclick",dumpHelpReq,false);
2719 } else if (pg.attachEvent) {
2720 pg.attachEvent("onclick",dumpHelpReq);
2721 }
2722 pg.style.position = 'absolute';
2723 pg.style.left = 0 + 'px';
2724 pg.style.top = 0 + 'px';
2725 pg.style.width = 100 + '%';
2726 pg.style.height = 100 + '%';
2727 pg.style.margin = 0 + 'px';
2728 pg.style.padding = 0 + 'px';
2729 if (isIE) {
2730 pg.style.filter = "alpha(opacity=90)";
2731 }else {
2732 pg.style.opacity = 0.9;
2733 }
2734 pg.style.zIndex = 9999;
2735 pg.style.backgroundColor="rgb(64,64,64)";
2736 pg.style.textAlign = "center";
2737 pg.style.verticalAlign = "middle";
2738 pg.style.backgroundPosition="center center";
2739 pg.style.backgroundRepeat="no-repeat";
2740 pg.style.backgroundImage="url(ui/graphic_support/help.jpg)";
2741 document.getElementsByTagName("body")[0].insertBefore(pg,obj);
2742 if(document.getElementById("HelpReq")) {
2743 helpmode = true;
2744 }
2745 }
2746 }
2747 function dumpHelpReq() {
2748 if(document.getElementById("HelpReq")) {
2749 document.body.removeChild(document.getElementById('HelpReq'));
2750 helpmode = false;
2751 }
2752 }
2753 // help extension
2754
2755 //DEBUG
2756 function ConsoleLog(value) {
2757 if(window.console) {
2758 window.console.log(value);
2759 }
2760 }
2761 //DEBUG
2762
2763 document.write('<style type="text/css" media="screen" id="blockStyle">.presentation, .layout {display: none; }</style>');
2764
2765 if(!isIE && !isOp) {
2766 document.write('<script type="text/javascript" src="ui/audio_support/soundmanager2.js"></script>');
2767 if(typeof soundManager!="undefined") {
2768 var allMetas = document.getElementsByTagName('meta');
2769 for (var i = 0; i< allMetas.length; i++) {
2770 if (allMetas[i].name == 'audioDebug') {
2771 var audioDebug = (allMetas[i].content == "true") ? true : false;
2772 soundManager.defaultOptions.debugMode = audioDebug;
2773 }
2774 }
2775 }
2776 }
2777
2778 window.onload = createSlideShow;
2779 window.onresize = function(){setTimeout('windowChange()',5);}