@@ -1 +1,2881 @@
1−var ns_pos=(typeof window.pageYOffset!="undefined");var khtml=((navigator.userAgent).indexOf("KHTML")>=0?true:false);var opera=((navigator.userAgent).indexOf("Opera")>=0?true:false);var ie=(typeof document.all!="undefined"&&!opera);var ie7=(!ns_pos&&navigator.userAgent.indexOf("MSIE 7")!=-1);var ie8=(!ns_pos&&navigator.userAgent.indexOf("MSIE 8")!=-1);var slidy_started=false;if(ie&&!ie8){document.write("<iframe id='historyFrame' src='javascript:\"<html></html>\"' height='1' width='1' style='position:absolute;left:-800px'></iframe>")}if(typeof beforePrint!="undefined"){window.onbeforeprint=beforePrint;window.onafterprint=afterPrint}if(ie){setTimeout(ieSlidyInit,100)}else{if(document.addEventListener){document.addEventListener("DOMContentLoaded",startup,false)}}function ieSlidyInit(){if(document.readyState=="complete"||document.readyState=="loaded"){startup()}else{setTimeout(ieSlidyInit,100)}}setTimeout(hideSlides,50);function hideSlides(){if(document.body){document.body.style.visibility="hidden"}else{setTimeout(hideSlides,50)}}var slidenum=0;var slides;var slideNumElement;var notes;var backgrounds;var toolbar;var title;var lastShown=null;var eos=null;var toc=null;var outline=null;var selectedTextLen;var viewAll=0;var wantToolbar=1;var mouseClickEnabled=true;var scrollhack=0;var key_wanted=false;var helpAnchor;var helpPage="http://www.w3.org/Talks/Tools/Slidy/help.html";var helpText="Navigate with mouse click, space bar, Cursor Left/Right, or Pg Up and Pg Dn. Use S and B to change font size.";var sizeIndex=0;var sizeAdjustment=0;var sizes=new Array("10pt","12pt","14pt","16pt","18pt","20pt","22pt","24pt","26pt","28pt","30pt","32pt");var okayForIncremental=incrementalElementList();var lastWidth=0;var lastHeight=0;var objects;var lang="en";var strings_es={slide:"pág.","help?":"Ayuda","contents?":"Índice","table of contents":"tabla de contenidos","Table of Contents":"Tabla de Contenidos","restart presentation":"Reiniciar presentación","restart?":"Inicio"};strings_es[helpText]="Utilice el ratón, barra espaciadora, teclas Izda/Dcha, o Re pág y Av pág. Use S y B para cambiar el tamaño de fuente.";var strings_ca={slide:"pàg..","help?":"Ajuda","contents?":"Índex","table of contents":"taula de continguts","Table of Contents":"Taula de Continguts","restart presentation":"Reiniciar presentació","restart?":"Inici"};strings_ca[helpText]="Utilitzi el ratolí, barra espaiadora, tecles Esq./Dta. o Re pàg y Av pàg. Usi S i B per canviar grandària de font.";var strings_nl={slide:"pagina","help?":"Help?","contents?":"Inhoud?","table of contents":"inhoudsopgave","Table of Contents":"Inhoudsopgave","restart presentation":"herstart presentatie","restart?":"Herstart?"};strings_nl[helpText]="Navigeer d.m.v. het muis, spatiebar, Links/Rechts toetsen, of PgUp en PgDn. Gebruik S en B om de karaktergrootte te veranderen.";var strings_de={slide:"Seite","help?":"Hilfe","contents?":"Übersicht","table of contents":"Inhaltsverzeichnis","Table of Contents":"Inhaltsverzeichnis","restart presentation":"Präsentation neu starten","restart?":"Neustart"};strings_de[helpText]="Benutzen Sie die Maus, Leerschlag, die Cursortasten links/rechts oder Page up/Page Down zum Wechseln der Seiten und S und B für die Schriftgrösse.";var strings_pl={slide:"slajd","help?":"pomoc?","contents?":"spis treści?","table of contents":"spis treści","Table of Contents":"Spis Treści","restart presentation":"Restartuj prezentację","restart?":"restart?"};strings_pl[helpText]="Zmieniaj slajdy klikając myszą, naciskając spację, strzałki lewo/prawolub PgUp / PgDn. Użyj klawiszy S i B, aby zmienić rozmiar czczionki.";var strings_fr={slide:"page","help?":"Aide","contents?":"Index","table of contents":"table des matières","Table of Contents":"Table des matières","restart presentation":"Recommencer l'exposé","restart?":"Début"};strings_fr[helpText]="Naviguez avec la souris, la barre d'espace, les flèches gauche/droite ou les touches Pg Up, Pg Dn. Utilisez les touches S et B pour modifier la taille de la police.";var strings_hu={slide:"oldal","help?":"segítség","contents?":"tartalom","table of contents":"tartalomjegyzék","Table of Contents":"Tartalomjegyzék","restart presentation":"bemutató újraindítása","restart?":"újraindítás"};strings_hu[helpText]="Az oldalak közti lépkedéshez kattintson az egérrel, vagy használja a szóköz, a bal, vagy a jobb nyíl, illetve a Page Down, Page Up billentyűket. Az S és a B billentyűkkel változtathatja a szöveg méretét.";var strings_it={slide:"pag.","help?":"Aiuto","contents?":"Indice","table of contents":"indice","Table of Contents":"Indice","restart presentation":"Ricominciare la presentazione","restart?":"Inizio"};strings_it[helpText]="Navigare con mouse, barra spazio, frecce sinistra/destra o PgUp e PgDn. Usare S e B per cambiare la dimensione dei caratteri.";var strings_el={slide:"σελίδα","help?":"βοήθεια;","contents?":"περιεχόμενα;","table of contents":"πίνακας περιεχομένων","Table of Contents":"Πίνακας Περιεχομένων","restart presentation":"επανεκκίνηση παρουσίασης","restart?":"επανεκκίνηση;"};strings_el[helpText]="Πλοηγηθείτε με το κλίκ του ποντικιού, το space, τα βέλη αριστερά/δεξιά, ή Page Up και Page Down. Χρησιμοποιήστε τα πλήκτρα S και B για να αλλάξετε το μέγεθος της γραμματοσειράς.";var strings_ja={slide:"スライド","help?":"ヘルプ","contents?":"目次","table of contents":"目次を表示","Table of Contents":"目次","restart presentation":"最初から再生","restart?":"最初から"};strings_ja[helpText]="マウス左クリック ・ スペース ・ 左右キー または Page Up ・ Page Downで操作, S ・ Bでフォントサイズ変更";var strings_zh={slide:"幻灯片","help?":"帮助?","contents?":"内容?","table of contents":"目录","Table of Contents":"目录","restart presentation":"重新启动展示","restart?":"重新启动?"};strings_zh[helpText]="用鼠标点击, 空格条, 左右箭头, Pg Up 和 Pg Dn 导航. 用 S, B 改变字体大小.";var strings_ru={slide:"слайд","help?":"помощь?","contents?":"содержание?","table of contents":"оглавление","Table of Contents":"Оглавление","restart presentation":"перезапустить презентацию","restart?":"перезапуск?"};strings_ru[helpText]="Перемещайтесь кликая мышкой, используя клавишу пробел, стрелкивлево/вправо или Pg Up и Pg Dn. Клавиши S и B меняют размер шрифта.";var strings_sv={slide:"sida","help?":"hjälp","contents?":"innehåll","table of contents":"innehållsförteckning","Table of Contents":"Innehållsförteckning","restart presentation":"visa presentationen från början","restart?":"börja om"};strings_sv[helpText]="Bläddra med ett klick med vänstra musknappen, mellanslagstangenten, vänster- och högerpiltangenterna eller tangenterna Pg Up, Pg Dn. Använd tangenterna S och B för att ändra textens storlek.";var localize={es:strings_es,ca:strings_ca,nl:strings_nl,de:strings_de,pl:strings_pl,fr:strings_fr,hu:strings_hu,it:strings_it,el:strings_el,jp:strings_ja,zh:strings_zh,ru:strings_ru,sv:strings_sv};function startup(){if(slidy_started){alert("already started");return}slidy_started=true;lang=document.body.parentNode.getAttribute("lang");if(!lang){lang=document.body.parentNode.getAttribute("xml:lang")}if(!lang){lang="en"}document.body.style.visibility="visible";title=document.title;toolbar=addToolbar();wrapImplicitSlides();slides=collectSlides();notes=collectNotes();objects=document.body.getElementsByTagName("object");backgrounds=collectBackgrounds();patchAnchors();slidenum=findSlideNumber(location.href);window.offscreenbuffering=true;sizeAdjustment=findSizeAdjust();hideImageToolbar();initOutliner();if(slides.length>0){var slide=slides[slidenum];slide.style.position="absolute";if(slidenum>0){setVisibilityAllIncremental("visible");lastShown=previousIncrementalItem(null);setEosStatus(true)}else{lastShown=null;setVisibilityAllIncremental("hidden");setEosStatus(!nextIncrementalItem(lastShown))}setLocation()}toc=tableOfContents();hideTableOfContents();document.onclick=mouseButtonClick;document.onmouseup=mouseButtonUp;document.onkeydown=keyDown;if(opera){document.onkeypress=keyPress}window.onresize=resized;window.onscroll=scrolled;window.onunload=unloaded;singleSlideView();setLocation();resized();if(ie7){setTimeout("ieHack()",100)}showToolbar();setInterval("checkLocation()",200)}String.prototype.localize=function(){if(this==""){return this}var s,lookup=localize[lang];if(lookup){s=lookup[this];if(s){return s}}var lg=lang.split("-");if(lg.length>1){lookup=localize[lg[0]];if(lookup){s=lookup[this];if(s){return s}}}return this};function hideImageToolbar(){if(!ns_pos){var images=document.getElementsByTagName("IMG");for(var i=0;i<images.length;++i){images[i].setAttribute("galleryimg","no")}}}function ieHack(){window.resizeBy(0,-1);window.resizeBy(0,1)}function unloaded(e){}function reload(e){if(!e){var e=window.event}hideBackgrounds();setTimeout("document.reload();",100);stopPropagation(e);e.cancel=true;e.returnValue=false;return false}function isKHTML(){var agent=navigator.userAgent;return(agent.indexOf("KHTML")>=0?true:false)}function resized(){var width=0;if(typeof(window.innerWidth)=="number"){width=window.innerWidth}else{if(document.documentElement&&document.documentElement.clientWidth){width=document.documentElement.clientWidth}else{if(document.body&&document.body.clientWidth){width=document.body.clientWidth}}}var height=0;if(typeof(window.innerHeight)=="number"){height=window.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){height=document.documentElement.clientHeight}else{if(document.body&&document.body.clientHeight){height=document.body.clientHeight}}}if(height&&(width/height>1.05*1024/768)){width=height*1024/768}if(width!=lastWidth||height!=lastHeight){if(width>=1100){sizeIndex=5}else{if(width>=1000){sizeIndex=4}else{if(width>=800){sizeIndex=3}else{if(width>=600){sizeIndex=2}else{if(width){sizeIndex=0}}}}}if(0<=sizeIndex+sizeAdjustment&&sizeIndex+sizeAdjustment<sizes.length){sizeIndex=sizeIndex+sizeAdjustment}adjustObjectDimensions(width,height);document.body.style.fontSize=sizes[sizeIndex];lastWidth=width;lastHeight=height;var slide=slides[slidenum];hideSlide(slide);showSlide(slide);refreshToolbar(200)}}function scrolled(){if(toolbar&&!ns_pos&&!ie7){hackoffset=scrollXOffset();toolbar.style.display="none";if(scrollhack==0&&!viewAll){setTimeout(showToolbar,1000);scrollhack=1}}}function refreshToolbar(interval){if(!ns_pos&&!ie7){hideToolbar();setTimeout(showToolbar,interval)}}function showToolbar(){if(wantToolbar){if(!ns_pos){var xoffset=scrollXOffset();toolbar.style.left=xoffset;toolbar.style.right=xoffset;toolbar.style.bottom=0}toolbar.style.display="block";toolbar.style.visibility="visible"}scrollhack=0;try{if(!opera){helpAnchor.focus()}}catch(e){}}function hideToolbar(){toolbar.style.display="none";toolbar.style.visibility="hidden";window.focus()}function toggleToolbar(){if(!viewAll){if(toolbar.style.display=="none"){toolbar.style.display="block";toolbar.style.visibility="visible";wantToolbar=1}else{toolbar.style.display="none";toolbar.style.visibility="hidden";wantToolbar=0}}}function scrollXOffset(){if(window.pageXOffset){return self.pageXOffset}if(document.documentElement&&document.documentElement.scrollLeft){return document.documentElement.scrollLeft}if(document.body){return document.body.scrollLeft}return 0}function scrollYOffset(){if(window.pageYOffset){return self.pageYOffset}if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollTop}if(document.body){return document.body.scrollTop}return 0}function optimizeFontSize(){var slide=slides[slidenum];var dh=slide.scrollHeight;var wh=getWindowHeight();var u=100*dh/wh;alert("window utilization = "+u+"% (doc "+dh+" win "+wh+")")}function getDocHeight(doc){if(!doc){doc=document}if(doc&&doc.body&&doc.body.offsetHeight){return doc.body.offsetHeight}if(doc&&doc.body&&doc.body.scrollHeight){return doc.body.scrollHeight}alert("couldn't determine document height")}function getWindowHeight(){if(typeof(window.innerHeight)=="number"){return window.innerHeight}if(document.documentElement&&document.documentElement.clientHeight){return document.documentElement.clientHeight}if(document.body&&document.body.clientHeight){return document.body.clientHeight}}function documentHeight(){var sh,oh;sh=document.body.scrollHeight;oh=document.body.offsetHeight;if(sh&&oh){return(sh>oh?sh:oh)}return 0}function smaller(){if(sizeIndex>0){--sizeIndex}toolbar.style.display="none";document.body.style.fontSize=sizes[sizeIndex];var slide=slides[slidenum];hideSlide(slide);showSlide(slide);setTimeout(showToolbar,300)}function bigger(){if(sizeIndex<sizes.length-1){++sizeIndex}toolbar.style.display="none";document.body.style.fontSize=sizes[sizeIndex];var slide=slides[slidenum];hideSlide(slide);showSlide(slide);setTimeout(showToolbar,300)}function adjustObjectDimensions(width,height){for(var i=0;i<objects.length;i++){var obj=objects[i];var mimeType=obj.getAttribute("type");if(mimeType=="image/svg+xml"||mimeType=="application/x-shockwave-flash"){if(!obj.initialWidth){obj.initialWidth=obj.getAttribute("width")}if(!obj.initialHeight){obj.initialHeight=obj.getAttribute("height")}if(obj.initialWidth&&obj.initialWidth.charAt(obj.initialWidth.length-1)=="%"){var w=parseInt(obj.initialWidth.slice(0,obj.initialWidth.length-1));var newW=width*(w/100);obj.setAttribute("width",newW)}if(obj.initialHeight&&obj.initialHeight.charAt(obj.initialHeight.length-1)=="%"){var h=parseInt(obj.initialHeight.slice(0,obj.initialHeight.length-1));var newH=height*(h/100);obj.setAttribute("height",newH)}}}}function cancel(event){if(event){event.cancel=true;event.returnValue=false;if(event.preventDefault){event.preventDefault()}}return false}function keyDown(event){var key;if(!event){var event=window.event}key_wanted=false;if(window.event){key=window.event.keyCode}else{if(event.which){key=event.which}else{return true}}if(!key){return true}if(event.ctrlKey||event.altKey||event.metaKey){return true}if(isShownToc()&&key!=9&&key!=16&&key!=38&&key!=40){hideTableOfContents();if(key==27||key==84||key==67){return cancel(event)}}key_wanted=true;if(key==34){if(viewAll){return true}nextSlide(false);return cancel(event)}else{if(key==33){if(viewAll){return true}previousSlide(false);return cancel(event)}else{if(key==32){nextSlide(true);return cancel(event)}else{if(key==37){previousSlide(!event.shiftKey);return cancel(event)}else{if(key==36){firstSlide();return cancel(event)}else{if(key==35){lastSlide();return cancel(event)}else{if(key==39){nextSlide(!event.shiftKey);return cancel(event)}else{if(key==13){if(outline){if(outline.visible){fold(outline)}else{unfold(outline)}return cancel(event)}}else{if(key==188){smaller();return cancel(event)}else{if(key==190){bigger();return cancel(event)}else{if(key==189||key==109){smaller();return cancel(event)}else{if(key==187||key==191||key==107){bigger();return cancel(event)}else{if(key==83){smaller();return cancel(event)}else{if(key==66){bigger();return cancel(event)}else{if(key==90){lastSlide();return cancel(event)}else{if(key==70){toggleToolbar();return cancel(event)}else{if(key==65){toggleView();return cancel(event)}else{if(key==75){mouseClickEnabled=!mouseClickEnabled;alert((mouseClickEnabled?"enabled":"disabled")+" mouse click advance");return cancel(event)}else{if(key==84||key==67){if(toc){showTableOfContents()}return cancel(event)}else{if(key==72){window.location=helpPage;return cancel(event)}}}}}}}}}}}}}}}}}}}}key_wanted=false;return true}function keyPress(event){if(!event){event=window.event}return key_wanted?cancel(event):true}function mouseButtonUp(e){selectedTextLen=getSelectedText().length}function mouseButtonClick(e){var rightclick=false;var leftclick=false;var middleclick=false;var target;if(!e){var e=window.event}if(e.target){target=e.target}else{if(e.srcElement){target=e.srcElement}}if(target.nodeType==3){target=target.parentNode}if(e.which){leftclick=(e.which==1);middleclick=(e.which==2);rightclick=(e.which==3)}else{if(e.button){if(e.button==4){middleclick=true}rightclick=(e.button==2)}else{leftclick=true}}if(selectedTextLen>0){stopPropagation(e);e.cancel=true;e.returnValue=false;return false}hideTableOfContents();if(mouseClickEnabled&&leftclick&&target.nodeName!="EMBED"&&target.nodeName!="OBJECT"&&target.nodeName!="VIDEO"&&target.nodeName!="INPUT"&&target.nodeName!="TEXTAREA"&&target.nodeName!="SELECT"&&target.nodeName!="OPTION"){nextSlide(true);stopPropagation(e);e.cancel=true;e.returnValue=false}}function previousSlide(incremental){if(!viewAll){var slide;if((incremental||slidenum==0)&&lastShown!=null){lastShown=hidePreviousItem(lastShown);setEosStatus(false)}else{if(slidenum>0){slide=slides[slidenum];hideSlide(slide);slidenum=slidenum-1;slide=slides[slidenum];setVisibilityAllIncremental("visible");lastShown=previousIncrementalItem(null);setEosStatus(true);showSlide(slide)}}setLocation();if(!ns_pos){refreshToolbar(200)}}}function nextSlide(incremental){if(!viewAll){var slide,last=lastShown;if(incremental||slidenum==slides.length-1){lastShown=revealNextItem(lastShown)}if((!incremental||lastShown==null)&&slidenum<slides.length-1){slide=slides[slidenum];hideSlide(slide);slidenum=slidenum+1;slide=slides[slidenum];lastShown=null;setVisibilityAllIncremental("hidden");showSlide(slide)}else{if(!lastShown){if(last&&incremental){lastShown=last}}}setLocation();setEosStatus(!nextIncrementalItem(lastShown));if(!ns_pos){refreshToolbar(200)}}}function firstSlide(){if(!viewAll){var slide;if(slidenum!=0){slide=slides[slidenum];hideSlide(slide);slidenum=0;slide=slides[slidenum];lastShown=null;setVisibilityAllIncremental("hidden");showSlide(slide)}setEosStatus(!nextIncrementalItem(lastShown));setLocation()}}function lastSlide(){if(!viewAll){var slide;lastShown=null;if(lastShown==null&&slidenum<slides.length-1){slide=slides[slidenum];hideSlide(slide);slidenum=slides.length-1;slide=slides[slidenum];setVisibilityAllIncremental("visible");lastShown=previousIncrementalItem(null);showSlide(slide)}else{setVisibilityAllIncremental("visible");lastShown=previousIncrementalItem(null)}setEosStatus(true);setLocation()}}function gotoSlide(num){var slide=slides[slidenum];hideSlide(slide);slidenum=num;slide=slides[slidenum];lastShown=null;setVisibilityAllIncremental("hidden");setEosStatus(!nextIncrementalItem(lastShown));document.title=title+" ("+(slidenum+1)+")";showSlide(slide);showSlideNumber()}function setEosStatus(state){if(eos){eos.style.color=(state?"rgb(240,240,240)":"red")}}function showSlide(slide){syncBackground(slide);window.scrollTo(0,0);slide.style.visibility="visible";slide.style.display="block"}function hideSlide(slide){slide.style.visibility="hidden";slide.style.display="none"}function beforePrint(){showAllSlides();hideToolbar()}function afterPrint(){if(!viewAll){singleSlideView();showToolbar()}}function printSlides(){beforePrint();window.print();afterPrint()}function toggleView(){if(viewAll){singleSlideView();showToolbar();viewAll=0}else{showAllSlides();hideToolbar();viewAll=1}}function showAllSlides(){var slide;for(var i=0;i<slides.length;++i){slide=slides[i];slide.style.position="relative";slide.style.borderTopStyle="solid";slide.style.borderTopWidth="thin";slide.style.borderTopColor="black";try{if(i==0){slide.style.pageBreakBefore="avoid"}else{slide.style.pageBreakBefore="always"}}catch(e){}setVisibilityAllIncremental("visible");showSlide(slide)}var note;for(var i=0;i<notes.length;++i){showSlide(notes[i])}hideBackgrounds()}function singleSlideView(){var slide;for(var i=0;i<slides.length;++i){slide=slides[i];slide.style.position="absolute";if(i==slidenum){slide.style.borderStyle="none";showSlide(slide)}else{slide.style.borderStyle="none";hideSlide(slide)}}setVisibilityAllIncremental("visible");lastShown=previousIncrementalItem(null);var note;for(var i=0;i<notes.length;++i){hideSlide(notes[i])}}function hasToken(str,token){if(str){var pattern=/\w+/g;var result=str.match(pattern);for(var i=0;i<result.length;i++){if(result[i]==token){return true}}}return false}function getClassList(element){if(typeof element.className!="undefined"){return element.className}var clsname=(ns_pos||ie8)?"class":"className";return element.getAttribute(clsname)}function hasClass(element,name){var regexp=new RegExp("(^| )"+name+"W*");if(typeof element.className!="undefined"){return regexp.test(element.className)}var clsname=(ns_pos||ie8)?"class":"className";return regexp.test(element.getAttribute(clsname))}function removeClass(element,name){var regexp=new RegExp("(^| )"+name+"W*");var clsval="";if(typeof element.className!="undefined"){clsval=element.className;if(clsval){clsval=clsval.replace(regexp,"");element.className=clsval}}else{var clsname=(ns_pos||ie8)?"class":"className";clsval=element.getAttribute(clsname);if(clsval){clsval=clsval.replace(regexp,"");element.setAttribute(clsname,clsval)}}}function addClass(element,name){if(!hasClass(element,name)){if(typeof element.className!="undefined"){element.className+=" "+name}else{var clsname=(ns_pos||ie8)?"class":"className";var clsval=element.getAttribute(clsname);clsval=clsval?clsval+" "+name:name;element.setAttribute(clsname,clsval)}}}function wrapImplicitSlides(){var i,heading,node,next,div;var headings=document.getElementsByTagName("h1");if(!headings){return}for(i=0;i<headings.length;++i){heading=headings[i];if(heading.parentNode!=document.body){continue}node=heading.nextSibling;div=document.createElement("div");addClass(div,"slide");document.body.replaceChild(div,heading);div.appendChild(heading);while(node){if(node.nodeType==1&&(node.nodeName=="H1"||node.nodeName=="h1"||node.nodeName=="DIV"||node.nodeName=="div")){break}next=node.nextSibling;node=document.body.removeChild(node);div.appendChild(node);node=next}}}function collectSlides(){var slides=new Array();var divs=document.body.getElementsByTagName("div");for(var i=0;i<divs.length;++i){div=divs.item(i);if(hasClass(div,"slide")){slides[slides.length]=div;div.style.display="none";div.style.visibility="hidden";var node1=document.createElement("br");div.appendChild(node1);var node2=document.createElement("br");div.appendChild(node2)}else{if(hasClass(div,"background")){div.style.display="block"}}}return slides}function collectNotes(){var notes=new Array();var divs=document.body.getElementsByTagName("div");for(var i=0;i<divs.length;++i){div=divs.item(i);if(hasClass(div,"handout")){notes[notes.length]=div;div.style.display="none";div.style.visibility="hidden"}}return notes}function collectBackgrounds(){var backgrounds=new Array();var divs=document.body.getElementsByTagName("div");for(var i=0;i<divs.length;++i){div=divs.item(i);if(hasClass(div,"background")){backgrounds[backgrounds.length]=div;if(getClassList(div)!="background"){div.style.display="none";div.style.visibility="hidden"}}}return backgrounds}function syncBackground(slide){var background;var bgColor;if(slide.currentStyle){bgColor=slide.currentStyle.backgroundColor}else{if(document.defaultView){var styles=document.defaultView.getComputedStyle(slide,null);if(styles){bgColor=styles.getPropertyValue("background-color")}else{bgColor="transparent"}}else{bgColor=="transparent"}}if(bgColor=="transparent"){var slideClass=getClassList(slide);for(var i=0;i<backgrounds.length;i++){background=backgrounds[i];var bgClass=getClassList(background);if(matchingBackground(slideClass,bgClass)){background.style.display="block";background.style.visibility="visible"}else{background.style.display="none";background.style.visibility="hidden"}}}else{hideBackgrounds()}}function hideBackgrounds(){for(var i=0;i<backgrounds.length;i++){background=backgrounds[i];background.style.display="none";background.style.visibility="hidden"}}function matchingBackground(slideClass,bgClass){if(bgClass=="background"){return true}var pattern=/\w+/g;var result=slideClass.match(pattern);for(var i=0;i<result.length;i++){if(hasToken(bgClass,result[i])){return true}}return false}function nextNode(root,node){if(node==null){return root.firstChild}if(node.firstChild){return node.firstChild}if(node.nextSibling){return node.nextSibling}for(;;){node=node.parentNode;if(!node||node==root){break}if(node&&node.nextSibling){return node.nextSibling}}return null}function previousNode(root,node){if(node==null){node=root.lastChild;if(node){while(node.lastChild){node=node.lastChild}}return node}if(node.previousSibling){node=node.previousSibling;while(node.lastChild){node=node.lastChild}return node}if(node.parentNode!=root){return node.parentNode}return null}function incrementalElementList(){var inclist=new Array();inclist.P=true;inclist.PRE=true;inclist.LI=true;inclist.BLOCKQUOTE=true;inclist.DT=true;inclist.DD=true;inclist.H2=true;inclist.H3=true;inclist.H4=true;inclist.H5=true;inclist.H6=true;inclist.SPAN=true;inclist.ADDRESS=true;inclist.TABLE=true;inclist.TR=true;inclist.TH=true;inclist.TD=true;inclist.IMG=true;inclist.OBJECT=true;return inclist}function nextIncrementalItem(node){var slide=slides[slidenum];for(;;){node=nextNode(slide,node);if(node==null||node.parentNode==null){break}if(node.nodeType==1){if(node.nodeName=="BR"){continue}if(hasClass(node,"incremental")&&okayForIncremental[node.nodeName]){return node}if(hasClass(node.parentNode,"incremental")&&!hasClass(node,"non-incremental")){return node}}}return node}function previousIncrementalItem(node){var slide=slides[slidenum];for(;;){node=previousNode(slide,node);if(node==null||node.parentNode==null){break}if(node.nodeType==1){if(node.nodeName=="BR"){continue}if(hasClass(node,"incremental")&&okayForIncremental[node.nodeName]){return node}if(hasClass(node.parentNode,"incremental")&&!hasClass(node,"non-incremental")){return node}}}return node}function setVisibilityAllIncremental(value){var node=nextIncrementalItem(null);while(node){node.style.visibility=value;node=nextIncrementalItem(node)}}function revealNextItem(node){node=nextIncrementalItem(node);if(node&&node.nodeType==1){node.style.visibility="visible"}return node}function hidePreviousItem(node){if(node&&node.nodeType==1){node.style.visibility="hidden"}return previousIncrementalItem(node)}function patchAnchors(){var anchors=document.body.getElementsByTagName("a");for(var i=0;i<anchors.length;++i){anchors[i].onclick=clickedAnchor}}function clickedAnchor(e){if(!e){var e=window.event}if(pageAddress(this.href)==pageAddress(location.href)){var newslidenum=findSlideNumber(this.href);if(newslidenum!=slidenum){slide=slides[slidenum];hideSlide(slide);slidenum=newslidenum;slide=slides[slidenum];showSlide(slide);setLocation()}}else{if(this.target==null){location.href=this.href}}this.blur();stopPropagation(e)}function pageAddress(uri){var i=uri.indexOf("#");if(i<0){i=uri.indexOf("%23")}if(i<0){return uri}return uri.substr(0,i)}function showSlideNumber(){slideNumElement.innerHTML="slide".localize()+" "+(slidenum+1)+"/"+slides.length}function checkLocation(){var hash=location.hash;if(slidenum>0&&(hash==""||hash=="#")){gotoSlide(0)}else{if(hash.length>2&&hash!="#("+(slidenum+1)+")"){var num=parseInt(location.hash.substr(2));if(!isNaN(num)){gotoSlide(num-1)}}}}function setLocation(){var uri=pageAddress(location.href);var hash="#("+(slidenum+1)+")";if(slidenum>=0){uri=uri+hash}if(ie&&!ie8){pushHash(hash)}if(uri!=location.href){location.href=uri}if(khtml){hash="("+(slidenum+1)+")"}if(!ie&&location.hash!=hash&&location.hash!=""){location.hash=hash}document.title=title+" ("+(slidenum+1)+")";showSlideNumber()}function onFrameLoaded(hash){location.hash=hash;var uri=pageAddress(location.href);location.href=uri+hash}function pushHash(hash){if(hash==""){hash="#(1)"}window.location.hash=hash;var doc=document.getElementById("historyFrame").contentWindow.document;doc.open("javascript:'<html></html>'");doc.write('<html><head><script type="text/javascript">parent.onFrameLoaded(\''+(hash)+"');<\/script></head><body>hello mum</body></html>");doc.close()}function findSlideNumber(uri){var i=uri.indexOf("#");if(i<0){return 0}var anchor=unescape(uri.substr(i+1));var target=document.getElementById(anchor);if(!target){var re=/\((\d)+\)/;if(anchor.match(re)){var num=parseInt(anchor.substring(1,anchor.length-1));if(num>slides.length){num=1}if(--num<0){num=0}return num}re=/\[(\d)+\]/;if(anchor.match(re)){var num=parseInt(anchor.substring(1,anchor.length-1));if(num>slides.length){num=1}if(--num<0){num=0}return num}return 0}while(true){if(target.nodeName.toLowerCase()=="div"&&hasClass(target,"slide")){break}target=target.parentNode;if(!target){return 0}}for(i=0;i<slides.length;++i){if(slides[i]==target){return i}}return 0}function slideName(index){var name=null;var slide=slides[index];var heading=findHeading(slide);if(heading){name=extractText(heading)}if(!name){name=title+"("+(index+1)+")"}name.replace(/\&/g,"&");name.replace(/\</g,"<");name.replace(/\>/g,">");return name}function findHeading(node){if(!node||node.nodeType!=1){return null}if(node.nodeName=="H1"||node.nodeName=="h1"){return node}var child=node.firstChild;while(child){node=findHeading(child);if(node){return node}child=child.nextSibling}return null}function extractText(node){if(!node){return""}if(node.nodeType==3){return node.nodeValue}if(node.nodeType==1){node=node.firstChild;var text="";while(node){text=text+extractText(node);node=node.nextSibling}return text}return""}function findCopyright(){var name,content;var meta=document.getElementsByTagName("meta");for(var i=0;i<meta.length;++i){name=meta[i].getAttribute("name");content=meta[i].getAttribute("content");if(name=="copyright"){return content}}return null}function findSizeAdjust(){var name,content,offset;var meta=document.getElementsByTagName("meta");for(var i=0;i<meta.length;++i){name=meta[i].getAttribute("name");content=meta[i].getAttribute("content");if(name=="font-size-adjustment"){return 1*content}}return 1}function addToolbar(){var slideCounter,page;var toolbar=createElement("div");toolbar.setAttribute("class","toolbar");if(ns_pos){var right=document.createElement("div");right.setAttribute("style","float: right; text-align: right");slideCounter=document.createElement("div");slideCounter.innerHTML="slide".localize()+" n/m";right.appendChild(slideCounter);toolbar.appendChild(right);var left=document.createElement("div");left.setAttribute("style","text-align: left");eos=document.createElement("span");eos.innerHTML="* ";left.appendChild(eos);var help=document.createElement("a");help.setAttribute("href",helpPage);help.setAttribute("title",helpText.localize());help.innerHTML="help?".localize();left.appendChild(help);helpAnchor=help;var gap1=document.createTextNode(" ");left.appendChild(gap1);var contents=document.createElement("a");contents.setAttribute("href","javascript:toggleTableOfContents()");contents.setAttribute("title","table of contents".localize());contents.innerHTML="contents?".localize();left.appendChild(contents);var gap2=document.createTextNode(" ");left.appendChild(gap2);var start=document.createElement("a");start.setAttribute("href","javascript:firstSlide()");start.setAttribute("title","restart presentation".localize());start.innerHTML="restart?".localize();left.appendChild(start);var copyright=findCopyright();if(copyright){var span=document.createElement("span");span.innerHTML=copyright;span.style.color="black";span.style.marginLeft="4em";left.appendChild(span)}toolbar.appendChild(left)}else{toolbar.style.position=(ie7?"fixed":"absolute");toolbar.style.zIndex="200";toolbar.style.width="99.9%";toolbar.style.height="1.2em";toolbar.style.top="auto";toolbar.style.bottom="0";toolbar.style.left="0";toolbar.style.right="0";toolbar.style.textAlign="left";toolbar.style.fontSize="60%";toolbar.style.color="red";toolbar.borderWidth=0;toolbar.className="toolbar";toolbar.style.background="rgb(240,240,240)";var sp=document.createElement("span");sp.innerHTML=" * ";toolbar.appendChild(sp);eos=sp;var help=document.createElement("a");help.setAttribute("href",helpPage);help.setAttribute("title",helpText.localize());help.innerHTML="help?".localize();toolbar.appendChild(help);helpAnchor=help;var gap1=document.createTextNode(" ");toolbar.appendChild(gap1);var contents=document.createElement("a");contents.setAttribute("href","javascript:toggleTableOfContents()");contents.setAttribute("title","table of contents".localize());contents.innerHTML="contents?".localize();toolbar.appendChild(contents);var gap2=document.createTextNode(" ");toolbar.appendChild(gap2);var start=document.createElement("a");start.setAttribute("href","javascript:firstSlide()");start.setAttribute("title","restart presentation".localize());start.innerHTML="restart?".localize();toolbar.appendChild(start);var copyright=findCopyright();if(copyright){var span=document.createElement("span");span.innerHTML=copyright;span.style.color="black";span.style.marginLeft="2em";toolbar.appendChild(span)}slideCounter=document.createElement("div");slideCounter.style.position="absolute";slideCounter.style.width="auto";slideCounter.style.height="1.2em";slideCounter.style.top="auto";slideCounter.style.bottom=0;slideCounter.style.right="0";slideCounter.style.textAlign="right";slideCounter.style.color="red";slideCounter.style.background="rgb(240,240,240)";slideCounter.innerHTML="slide".localize()+" n/m";toolbar.appendChild(slideCounter)}toolbar.onclick=stopPropagation;document.body.appendChild(toolbar);slideNumElement=slideCounter;setEosStatus(false);return toolbar}function isShownToc(){if(toc&&toc.style.visible=="visible"){return true}return false}function showTableOfContents(){if(toc){if(toc.style.visibility!="visible"){toc.style.visibility="visible";toc.style.display="block";toc.focus();if(ie7&&slidenum==0){setTimeout("ieHack()",100)}}else{hideTableOfContents()}}}function hideTableOfContents(){if(toc&&toc.style.visibility!="hidden"){toc.style.visibility="hidden";toc.style.display="none";try{if(!opera){helpAnchor.focus()}}catch(e){}}}function toggleTableOfContents(){if(toc){if(toc.style.visible!="visible"){showTableOfContents()}else{hideTableOfContents()}}}function gotoEntry(e){var target;if(!e){var e=window.event}if(e.target){target=e.target}else{if(e.srcElement){target=e.srcElement}}if(target.nodeType==3){target=target.parentNode}if(target&&target.nodeType==1){var uri=target.getAttribute("href");if(uri){var slide=slides[slidenum];hideSlide(slide);slidenum=findSlideNumber(uri);slide=slides[slidenum];lastShown=null;setLocation();setVisibilityAllIncremental("hidden");setEosStatus(!nextIncrementalItem(lastShown));showSlide(slide);try{if(!opera){helpAnchor.focus()}}catch(e){}}}hideTableOfContents(e);if(ie7){ieHack()}stopPropagation(e);return cancel(e)}function gotoTocEntry(event){var key;if(!event){var event=window.event}if(window.event){key=window.event.keyCode}else{if(event.which){key=event.which}else{return true}}if(!key){return true}if(event.ctrlKey||event.altKey){return true}if(key==13){var uri=this.getAttribute("href");if(uri){var slide=slides[slidenum];hideSlide(slide);slidenum=findSlideNumber(uri);slide=slides[slidenum];lastShown=null;setLocation();setVisibilityAllIncremental("hidden");setEosStatus(!nextIncrementalItem(lastShown));showSlide(slide);try{if(!opera){helpAnchor.focus()}}catch(e){}}hideTableOfContents();if(ie7){ieHack()}return cancel(event)}if(key==40&&this.next){this.next.focus();return cancel(event)}if(key==38&&this.previous){this.previous.focus();return cancel(event)}return true}function isTitleSlide(slide){return hasClass(slide,"title")}function tableOfContents(){var toc=document.createElement("div");addClass(toc,"toc");var heading=document.createElement("div");addClass(heading,"toc-heading");heading.innerHTML="Table of Contents".localize();heading.style.textAlign="center";heading.style.width="100%";heading.style.margin="0";heading.style.marginBottom="1em";heading.style.borderBottomStyle="solid";heading.style.borderBottomColor="rgb(180,180,180)";heading.style.borderBottomWidth="1px";toc.appendChild(heading);var previous=null;for(var i=0;i<slides.length;++i){var title=hasClass(slides[i],"title");var num=document.createTextNode((i+1)+". ");toc.appendChild(num);var a=document.createElement("a");a.setAttribute("href","#("+(i+1)+")");if(title){addClass(a,"titleslide")}var name=document.createTextNode(slideName(i));a.appendChild(name);a.onclick=gotoEntry;a.onkeydown=gotoTocEntry;a.previous=previous;if(previous){previous.next=a}toc.appendChild(a);if(i==0){toc.first=a}if(i<slides.length-1){var br=document.createElement("br");toc.appendChild(br)}previous=a}toc.focus=function(){if(this.first){this.first.focus()}};toc.onmouseup=mouseButtonUp;toc.onclick=function(e){e||(e=window.event);if(selectedTextLen<=0){hideTableOfContents()}stopPropagation(e);if(e.cancel!=undefined){e.cancel=true}if(e.returnValue!=undefined){e.returnValue=false}return false};toc.style.position="absolute";toc.style.zIndex="300";toc.style.width="60%";toc.style.maxWidth="30em";toc.style.height="30em";toc.style.overflow="auto";toc.style.top="auto";toc.style.right="auto";toc.style.left="4em";toc.style.bottom="4em";toc.style.padding="1em";toc.style.background="rgb(240,240,240)";toc.style.borderStyle="solid";toc.style.borderWidth="2px";toc.style.fontSize="60%";document.body.insertBefore(toc,document.body.firstChild);return toc}function replaceByNonBreakingSpace(str){for(var i=0;i<str.length;++i){str[i]=160}}function initOutliner(){var items=document.getElementsByTagName("LI");for(var i=0;i<items.length;++i){var target=items[i];if(!hasClass(target.parentNode,"outline")){continue}target.onclick=outlineClick;if(!ns_pos){target.onmouseover=hoverOutline;target.onmouseout=unhoverOutline}if(foldable(target)){target.foldable=true;target.onfocus=function(){outline=this};target.onblur=function(){outline=null};if(!target.getAttribute("tabindex")){target.setAttribute("tabindex","0")}if(hasClass(target,"expand")){unfold(target)}else{fold(target)}}else{addClass(target,"nofold");target.visible=true;target.foldable=false}}}function foldable(item){if(!item||item.nodeType!=1){return false}var node=item.firstChild;while(node){if(node.nodeType==1&&isBlock(node)){return true}node=node.nextSibling}return false}function fold(item){if(item){removeClass(item,"unfolded");addClass(item,"folded")}var node=item?item.firstChild:null;while(node){if(node.nodeType==1&&isBlock(node)){node.display=getElementStyle(node,"display","display");node.style.display="none";node.style.visibility="hidden"}node=node.nextSibling}item.visible=false}function unfold(item){if(item){addClass(item,"unfolded");removeClass(item,"folded")}var node=item?item.firstChild:null;while(node){if(node.nodeType==1&&isBlock(node)){node.style.display=(node.display?node.display:"block");node.style.visibility="visible"}node=node.nextSibling}item.visible=true}function outlineClick(e){var rightclick=false;var target;if(!e){var e=window.event}if(e.target){target=e.target}else{if(e.srcElement){target=e.srcElement}}if(target.nodeType==3){target=target.parentNode}while(target&&target.visible==undefined){target=target.parentNode}if(!target){return true}if(e.which){rightclick=(e.which==3)}else{if(e.button){rightclick=(e.button==2)}}if(!rightclick&&target.visible!=undefined){if(target.foldable){if(target.visible){fold(target)}else{unfold(target)}}stopPropagation(e);e.cancel=true;e.returnValue=false}return false}function hoverOutline(e){var target;if(!e){var e=window.event}if(e.target){target=e.target}else{if(e.srcElement){target=e.srcElement}}if(target.nodeType==3){target=target.parentNode}while(target&&target.visible==undefined){target=target.parentNode}if(target&&target.foldable){target.style.cursor="pointer"}return true}function unhoverOutline(e){var target;if(!e){var e=window.event}if(e.target){target=e.target}else{if(e.srcElement){target=e.srcElement}}if(target.nodeType==3){target=target.parentNode}while(target&&target.visible==undefined){target=target.parentNode}if(target){target.style.cursor="default"}return true}function stopPropagation(e){if(window.event){window.event.cancelBubble=true}else{if(e){e.cancelBubble=true;e.stopPropagation()}}}function isBlock(elem){var tag=elem.nodeName;return tag=="OL"||tag=="UL"||tag=="P"||tag=="LI"||tag=="TABLE"||tag=="PRE"||tag=="H1"||tag=="H2"||tag=="H3"||tag=="H4"||tag=="H5"||tag=="H6"||tag=="BLOCKQUOTE"||tag=="ADDRESS"}function getElementStyle(elem,IEStyleProp,CSSStyleProp){if(elem.currentStyle){return elem.currentStyle[IEStyleProp]}else{if(window.getComputedStyle){var compStyle=window.getComputedStyle(elem,"");return compStyle.getPropertyValue(CSSStyleProp)}}return""}function createElement(element){if(typeof document.createElementNS!="undefined"){return document.createElementNS("http://www.w3.org/1999/xhtml",element)}if(typeof document.createElement!="undefined"){return document.createElement(element)}return false}function getElementsByTagName(name){if(typeof document.getElementsByTagNameNS!="undefined"){return document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml",name)}if(typeof document.getElementsByTagName!="undefined"){return document.getElementsByTagName(name)}return null}function getSelectedText(){try{if(window.getSelection){return window.getSelection().toString()}if(document.getSelection){return document.getSelection().toString()}if(document.selection){return document.selection.createRange().text}}catch(e){return""}return""};
1+/* slidy.js
3+ Copyright (c) 2005-2010 W3C (MIT, ERCIM, Keio), All Rights Reserved.
4+ W3C liability, trademark, document use and software licensing
7+ http://www.w3.org/Consortium/Legal/copyright-documents
8+ http://www.w3.org/Consortium/Legal/copyright-software
10+ Defines single name "w3c_slidy" in global namespace
11+ Adds event handlers without trampling on any others
14+// the slidy object implementation
16+ // classify which kind of browser we're running under
17+ ns_pos: (typeof window.pageYOffset!='undefined'),
18+ khtml: ((navigator.userAgent).indexOf("KHTML") >= 0 ? true : false),
19+ opera: ((navigator.userAgent).indexOf("Opera") >= 0 ? true : false),
20+ ipad: ((navigator.userAgent).indexOf("iPad") >= 0 ? true : false),
21+ iphone: ((navigator.userAgent).indexOf("iPhone") >= 0 ? true : false),
22+ ie: (typeof document.all != "undefined" && !this.opera),
23+ ie6: (!this.ns_pos && navigator.userAgent.indexOf("MSIE 6") != -1),
24+ ie7: (!this.ns_pos && navigator.userAgent.indexOf("MSIE 7") != -1),
25+ ie8: (!this.ns_pos && navigator.userAgent.indexOf("MSIE 8") != -1),
26+ ie9: (!this.ns_pos && navigator.userAgent.indexOf("MSIE 9") != -1),
27+ keyboardless: (this.ipad || this.iphone),
29+ // are we running as XHTML? (doesn't work on Opera)
30+ is_xhtml: /xml/.test(document.contentType),
32+ slide_number: 0, // integer slide count: 0, 1, 2, ...
33+ slide_number_element: null, // element containing slide number
34+ slides: [], // set to array of slide div's
35+ notes: [], // set to array of handout div's
36+ backgrounds: [], // set to array of background div's
37+ toolbar: null, // element containing toolbar
38+ title: null, // document title
39+ last_shown: null, // last incrementally shown item
40+ eos: null, // span element for end of slide indicator
41+ toc: null, // table of contents
42+ outline: null, // outline element with the focus
43+ selected_text_len: 0, // length of drag selection on document
44+ view_all: 0, // 1 to view all slides + handouts
45+ want_toolbar: true, // user preference to show/hide toolbar
46+ mouse_click_enabled: true, // enables left click for next slide
47+ scroll_hack: 0, // IE work around for position: fixed
48+ disable_slide_click: false, // used by clicked anchors
50+ lang: "en", // updated to language specified by html file
52+ help_anchor: null, // used for keyboard focus hack in showToolbar()
53+ help_page: "http://www.w3.org/Talks/Tools/Slidy2/help/help.html",
54+ help_text: "Navigate with mouse click, space bar, Cursor Left/Right, " +
55+ "or Pg Up and Pg Dn. Use S and B to change font size.",
59+ sizes: new Array("10pt", "12pt", "14pt", "16pt", "18pt", "20pt",
60+ "22pt", "24pt", "26pt", "28pt", "30pt", "32pt"),
62+ // needed for efficient resizing
67+ // Needed for cross browser support for relative width/height on
68+ // object elements. The work around is to save width/height attributes
69+ // and then to recompute absolute width/height dimensions on resizing
72+ // attach initialiation event handlers
73+ set_up: function () {
74+ var init = function() { w3c_slidy.init(); };
75+ if (typeof window.addEventListener != "undefined")
76+ window.addEventListener("load", init, false);
78+ window.attachEvent("onload", init);
81+ hide_slides: function () {
82+ if (document.body && !w3c_slidy.initialized)
83+ document.body.style.visibility = "hidden";
85+ setTimeout(w3c_slidy.hide_slides, 50);
88+ // hack to persuade IE to compute correct document height
89+ // as needed for simulating fixed positioning of toolbar
90+ ie_hack: function () {
91+ window.resizeBy(0,-1);
92+ window.resizeBy(0, 1);
96+ //alert("slidy starting test 10");
97+ document.body.style.visibility = "visible";
98+ this.init_localization();
100+ this.wrap_implicit_slides();
101+ this.collect_slides();
102+ this.collect_notes();
103+ this.collect_backgrounds();
104+ this.objects = document.body.getElementsByTagName("object");
105+ this.patch_anchors();
106+ this.slide_number = this.find_slide_number(location.href);
107+ window.offscreenbuffering = true;
108+ this.size_adjustment = this.find_size_adjust();
109+ this.time_left = this.find_duration();
110+ this.hide_image_toolbar(); // suppress IE image toolbar popup
111+ this.init_outliner(); // activate fold/unfold support
112+ this.title = document.title;
114+ // work around for opera bug
115+ this.is_xhtml = (document.body.tagName == "BODY" ? false : true);
117+ if (this.slides.length > 0)
119+ var slide = this.slides[this.slide_number];
121+ if (this.slide_number > 0)
123+ this.set_visibility_all_incremental("visible");
124+ this.last_shown = this.previous_incremental_item(null);
125+ this.set_eos_status(true);
129+ this.last_shown = null;
130+ this.set_visibility_all_incremental("hidden");
131+ this.set_eos_status(!this.next_incremental_item(this.last_shown));
134+ this.set_location();
135+ this.add_class(this.slides[0], "first-slide");
136+ w3c_slidy.show_slide(slide);
139+ this.toc = this.table_of_contents();
141+ this.add_initial_prompt();
143+ // bind event handlers without interfering with custom page scripts
144+ // Tap events behave too weirdly to support clicks reliably on
145+ // iPhone and iPad, so exclude these from click handler
147+ if (!this.keyboardless)
148+ this.add_listener(document.body, "click", this.mouse_button_click);
150+ this.add_listener(document, "keydown", this.key_down);
151+ this.add_listener(document, "keypress", this.key_press);
152+ this.add_listener(window, "resize", this.resized);
153+ this.add_listener(window, "scroll", this.scrolled);
154+ this.add_listener(window, "unload", this.unloaded);
156+ // this seems to be a debugging hack
157+ //if (!document.body.onclick)
158+ // document.body.onclick = function () { };
160+ this.single_slide_view();
162+ //this.set_location();
167+ setTimeout(w3c_slidy.ie_hack, 100);
169+ this.show_toolbar();
171+ // for back button detection
172+ setInterval(function () { w3c_slidy.check_location(); }, 200);
173+ w3c_slidy.initialized = true;
176+ // create div element with links to each slide
177+ table_of_contents: function () {
178+ var toc = this.create_element("div");
179+ this.add_class(toc, "slidy_toc hidden");
180+ //toc.setAttribute("tabindex", "0");
182+ var heading = this.create_element("div");
183+ this.add_class(heading, "toc-heading");
184+ heading.innerHTML = this.localize("Table of Contents");
186+ toc.appendChild(heading);
187+ var previous = null;
189+ for (var i = 0; i < this.slides.length; ++i)
191+ var title = this.has_class(this.slides[i], "title");
192+ var num = document.createTextNode((i + 1) + ". ");
194+ toc.appendChild(num);
196+ var a = this.create_element("a");
197+ a.setAttribute("href", "#(" + (i+1) + ")");
200+ this.add_class(a, "titleslide");
202+ var name = document.createTextNode(this.slide_name(i));
203+ a.appendChild(name);
204+ a.onclick = w3c_slidy.toc_click;
205+ a.onkeydown = w3c_slidy.toc_key_down;
206+ a.previous = previous;
216+ if (i < this.slides.length - 1)
218+ var br = this.create_element("br");
219+ toc.appendChild(br);
225+ toc.focus = function () {
230+ toc.onmouseup = w3c_slidy.mouse_button_up;
232+ toc.onclick = function (e) {
233+ e||(e=window.event);
235+ if (w3c_slidy.selected_text_len <= 0)
236+ w3c_slidy.hide_table_of_contents(true);
238+ w3c_slidy.stop_propagation(e);
240+ if (e.cancel != undefined)
243+ if (e.returnValue != undefined)
244+ e.returnValue = false;
249+ document.body.insertBefore(toc, document.body.firstChild);
253+ is_shown_toc: function () {
254+ return !w3c_slidy.has_class(w3c_slidy.toc, "hidden");
257+ show_table_of_contents: function () {
258+ w3c_slidy.remove_class(w3c_slidy.toc, "hidden");
259+ var toc = w3c_slidy.toc;
262+ if (w3c_slidy.ie7 && w3c_slidy.slide_number == 0)
263+ setTimeout(w3c_slidy.ie_hack, 100);
266+ hide_table_of_contents: function (focus) {
267+ w3c_slidy.add_class(w3c_slidy.toc, "hidden");
269+ if (focus && !w3c_slidy.opera)
270+ w3c_slidy.help_anchor.focus();
273+ toggle_table_of_contents: function () {
274+ if (w3c_slidy.is_shown_toc())
275+ w3c_slidy.hide_table_of_contents(true);
277+ w3c_slidy.show_table_of_contents();
280+ // called on clicking toc entry
281+ toc_click: function (e) {
285+ var target = w3c_slidy.get_target(e);
287+ if (target && target.nodeType == 1)
289+ var uri = target.getAttribute("href");
293+ //alert("going to " + uri);
294+ var slide = w3c_slidy.slides[w3c_slidy.slide_number];
295+ w3c_slidy.hide_slide(slide);
296+ w3c_slidy.slide_number = w3c_slidy.find_slide_number(uri);
297+ slide = w3c_slidy.slides[w3c_slidy.slide_number];
298+ w3c_slidy.last_shown = null;
299+ w3c_slidy.set_location();
300+ w3c_slidy.set_visibility_all_incremental("hidden");
301+ w3c_slidy.set_eos_status(!w3c_slidy.next_incremental_item(w3c_slidy.last_shown));
302+ w3c_slidy.show_slide(slide);
307+ if (!w3c_slidy.opera)
308+ w3c_slidy.help_anchor.focus();
316+ w3c_slidy.hide_table_of_contents(true);
317+ if (w3c_slidy.ie7) w3c_slidy.ie_hack();
318+ w3c_slidy.stop_propagation(e);
319+ return w3c_slidy.cancel(e);
322+ // called onkeydown for toc entry
323+ toc_key_down: function (event) {
327+ var event = window.event;
329+ // kludge around NS/IE differences
331+ key = window.event.keyCode;
332+ else if (event.which)
335+ return true; // Yikes! unknown browser
337+ // ignore event if key value is zero
338+ // as for alt on Opera and Konqueror
342+ // check for concurrent control/command/alt key
343+ // but are these only present on mouse events?
345+ if (event.ctrlKey || event.altKey)
350+ var uri = this.getAttribute("href");
354+ //alert("going to " + uri);
355+ var slide = w3c_slidy.slides[w3c_slidy.slide_number];
356+ w3c_slidy.hide_slide(slide);
357+ w3c_slidy.slide_number = w3c_slidy.find_slide_number(uri);
358+ slide = w3c_slidy.slides[w3c_slidy.slide_number];
359+ w3c_slidy.last_shown = null;
360+ w3c_slidy.set_location();
361+ w3c_slidy.set_visibility_all_incremental("hidden");
362+ w3c_slidy.set_eos_status(!w3c_slidy.next_incremental_item(w3c_slidy.last_shown));
363+ w3c_slidy.show_slide(slide);
368+ if (!w3c_slidy.opera)
369+ w3c_slidy.help_anchor.focus();
376+ w3c_slidy.hide_table_of_contents(true);
379+ w3c_slidy.ie_hack();
381+ return w3c_slidy.cancel(event);
384+ if (key == 40 && this.next)
387+ return w3c_slidy.cancel(event);
390+ if (key == 38 && this.previous)
392+ this.previous.focus();
393+ return w3c_slidy.cancel(event);
401+ before_print: function () {
402+ this.show_all_slides();
403+ this.hide_toolbar();
404+ alert("before print");
408+ after_print: function () {
411+ this.single_slide_view();
412+ this.show_toolbar();
414+ alert("after print");
418+ print_slides: function () {
419+ this.before_print();
424+ // ### OBSOLETE ?? ###
425+ toggle_view: function () {
428+ this.single_slide_view();
429+ this.show_toolbar();
434+ this.show_all_slides();
435+ this.hide_toolbar();
440+ // prepare for printing ### OBSOLETE ###
441+ show_all_slides: function () {
442+ this.remove_class(document.body, "single_slide");
443+ this.set_visibility_all_incremental("visible");
446+ // restore after printing ### OBSOLETE ###
447+ single_slide_view: function () {
448+ this.add_class(document.body, "single_slide");
449+ this.set_visibility_all_incremental("visible");
450+ this.last_shown = this.previous_incremental_item(null);
453+ // suppress IE's image toolbar pop up
454+ hide_image_toolbar: function () {
457+ var images = document.getElementsByTagName("IMG");
459+ for (var i = 0; i < images.length; ++i)
460+ images[i].setAttribute("galleryimg", "no");
464+ unloaded: function (e) {
465+ //alert("unloaded");
468+ // Safari and Konqueror don't yet support getComputedStyle()
469+ // and they always reload page when location.href is updated
470+ is_KHTML: function () {
471+ var agent = navigator.userAgent;
472+ return (agent.indexOf("KHTML") >= 0 ? true : false);
475+ // find slide name from first h1 element
476+ // default to document title + slide number
477+ slide_name: function (index) {
479+ var slide = this.slides[index];
481+ var heading = this.find_heading(slide);
484+ name = this.extract_text(heading);
487+ name = this.title + "(" + (index + 1) + ")";
489+ name.replace(/\&/g, "&");
490+ name.replace(/\</g, "<");
491+ name.replace(/\>/g, ">");
496+ // find first h1 element in DOM tree
497+ find_heading: function (node) {
498+ if (!node || node.nodeType != 1)
501+ if (node.nodeName == "H1" || node.nodeName == "h1")
504+ var child = node.firstChild;
508+ node = this.find_heading(child);
513+ child = child.nextSibling;
519+ // recursively extract text from DOM tree
520+ extract_text: function (node) {
525+ if (node.nodeType == 3)
526+ return node.nodeValue;
529+ if (node.nodeType == 1)
531+ node = node.firstChild;
536+ text = text + this.extract_text(node);
537+ node = node.nextSibling;
546+ // find copyright text from meta element
547+ find_copyright: function () {
549+ var meta = document.getElementsByTagName("meta");
551+ for (var i = 0; i < meta.length; ++i)
553+ name = meta[i].getAttribute("name");
554+ content = meta[i].getAttribute("content");
556+ if (name == "copyright")
563+ find_size_adjust: function () {
564+ var name, content, offset;
565+ var meta = document.getElementsByTagName("meta");
567+ for (var i = 0; i < meta.length; ++i)
569+ name = meta[i].getAttribute("name");
570+ content = meta[i].getAttribute("content");
572+ if (name == "font-size-adjustment")
579+ // <meta name="duration" content="20" /> for 20 minutes
580+ find_duration: function () {
581+ var name, content, offset;
582+ var meta = document.getElementsByTagName("meta");
584+ for (var i = 0; i < meta.length; ++i)
586+ name = meta[i].getAttribute("name");
587+ content = meta[i].getAttribute("content");
589+ if (name == "duration")
590+ return 60000 * content;
596+ replace_by_non_breaking_space: function (str) {
597+ for (var i = 0; i < str.length; ++i)
601+ // ### CHECK ME ### is use of "li" okay for text/html?
602+ // for XHTML do we also need to specify namespace?
603+ init_outliner: function () {
604+ var items = document.getElementsByTagName("li");
606+ for (var i = 0; i < items.length; ++i)
608+ var target = items[i];
610+ if (!this.has_class(target.parentNode, "outline"))
613+ target.onclick = this.outline_click;
614+/* ### more work needed for IE6
617+ target.onmouseover = this.hover_outline;
618+ target.onmouseout = this.unhover_outline;
621+ if (this.foldable(target))
623+ target.foldable = true;
624+ target.onfocus = function () {w3c_slidy.outline = this;};
625+ target.onblur = function () {w3c_slidy.outline = null;};
627+ if (!target.getAttribute("tabindex"))
628+ target.setAttribute("tabindex", "0");
630+ if (this.has_class(target, "expand"))
631+ this.unfold(target);
637+ this.add_class(target, "nofold");
638+ target.visible = true;
639+ target.foldable = false;
644+ foldable: function (item) {
645+ if (!item || item.nodeType != 1)
648+ var node = item.firstChild;
652+ if (node.nodeType == 1 && this.is_block(node))
655+ node = node.nextSibling;
661+ // ### CHECK ME ### switch to add/remove "hidden" class
662+ fold: function (item) {
665+ this.remove_class(item, "unfolded");
666+ this.add_class(item, "folded");
669+ var node = item ? item.firstChild : null;
673+ if (node.nodeType == 1 && this.is_block(node)) // element
675+ w3c_slidy.add_class(node, "hidden");
678+ node = node.nextSibling;
681+ item.visible = false;
684+ // ### CHECK ME ### switch to add/remove "hidden" class
685+ unfold: function (item) {
688+ this.add_class(item, "unfolded");
689+ this.remove_class(item, "folded");
692+ var node = item ? item.firstChild : null;
696+ if (node.nodeType == 1 && this.is_block(node)) // element
698+ w3c_slidy.remove_class(node, "hidden");
701+ node = node.nextSibling;
704+ item.visible = true;
707+ outline_click: function (e) {
711+ var rightclick = false;
712+ var target = w3c_slidy.get_target(e);
714+ while (target && target.visible == undefined)
715+ target = target.parentNode;
721+ rightclick = (e.which == 3);
723+ rightclick = (e.button == 2);
725+ if (!rightclick && target.visible != undefined)
727+ if (target.foldable)
730+ w3c_slidy.fold(target);
732+ w3c_slidy.unfold(target);
735+ w3c_slidy.stop_propagation(e);
737+ e.returnValue = false;
743+ add_initial_prompt: function () {
744+ var prompt = this.create_element("div");
745+ prompt.setAttribute("class", "initial_prompt");
747+ var p1 = this.create_element("p");
748+ prompt.appendChild(p1);
749+ p1.setAttribute("class", "help");
751+ if (this.keyboardless)
752+ p1.innerHTML = "Tap footer to move to next slide";
754+ p1.innerHTML = "Space or Right Arrow to move to next " +
755+ "slide, click help below for more details";
757+ this.add_listener(prompt, "click", function (e) {
758+ document.body.removeChild(prompt);
759+ w3c_slidy.stop_propagation(e);
761+ if (e.cancel != undefined)
764+ if (e.returnValue != undefined)
765+ e.returnValue = false;
770+ document.body.appendChild(prompt);
771+ this.initial_prompt = prompt;
772+ setTimeout(function() {document.body.removeChild(prompt);}, 5000);
775+ add_toolbar: function () {
778+ this.toolbar = this.create_element("div");
779+ this.toolbar.setAttribute("class", "toolbar");
781+ // a reasonably behaved browser
782+ if (this.ns_pos || !this.ie6)
784+ var right = this.create_element("div");
785+ right.setAttribute("style", "float: right; text-align: right");
787+ counter = this.create_element("span")
788+ counter.innerHTML = this.localize("slide") + " n/m";
789+ right.appendChild(counter);
790+ this.toolbar.appendChild(right);
792+ var left = this.create_element("div");
793+ left.setAttribute("style", "text-align: left");
795+ // global end of slide indicator
796+ this.eos = this.create_element("span");
797+ this.eos.innerHTML = "* ";
798+ left.appendChild(this.eos);
800+ var help = this.create_element("a");
801+ help.setAttribute("href", this.help_page);
802+ help.setAttribute("title", this.localize(this.help_text));
803+ help.innerHTML = this.localize("help?");
804+ left.appendChild(help);
805+ this.help_anchor = help; // save for focus hack
807+ var gap1 = document.createTextNode(" ");
808+ left.appendChild(gap1);
810+ var contents = this.create_element("a");
811+ contents.setAttribute("href", "javascript:w3c_slidy.toggle_table_of_contents()");
812+ contents.setAttribute("title", this.localize("table of contents"));
813+ contents.innerHTML = this.localize("contents?");
814+ left.appendChild(contents);
816+ var gap2 = document.createTextNode(" ");
817+ left.appendChild(gap2);
819+ var copyright = this.find_copyright();
823+ var span = this.create_element("span");
824+ span.className = "copyright";
825+ span.innerHTML = copyright;
826+ left.appendChild(span);
829+ this.toolbar.setAttribute("tabindex", "0");
830+ this.toolbar.appendChild(left);
832+ else // IE6 so need to work around its poor CSS support
834+ this.toolbar.style.position = (this.ie7 ? "fixed" : "absolute");
835+ this.toolbar.style.zIndex = "200";
836+ this.toolbar.style.width = "99.9%";
837+ this.toolbar.style.height = "1.2em";
838+ this.toolbar.style.top = "auto";
839+ this.toolbar.style.bottom = "0";
840+ this.toolbar.style.left = "0";
841+ this.toolbar.style.right = "0";
842+ this.toolbar.style.textAlign = "left";
843+ this.toolbar.style.fontSize = "60%";
844+ this.toolbar.style.color = "red";
845+ this.toolbar.borderWidth = 0;
846+ this.toolbar.className = "toolbar";
847+ this.toolbar.style.background = "rgb(240,240,240)";
849+ // would like to have help text left aligned
850+ // and page counter right aligned, floating
851+ // div's don't work, so instead use nested
852+ // absolutely positioned div's.
854+ var sp = this.create_element("span");
855+ sp.innerHTML = " * ";
856+ this.toolbar.appendChild(sp);
857+ this.eos = sp; // end of slide indicator
859+ var help = this.create_element("a");
860+ help.setAttribute("href", this.help_page);
861+ help.setAttribute("title", this.localize(this.help_text));
862+ help.innerHTML = this.localize("help?");
863+ this.toolbar.appendChild(help);
864+ this.help_anchor = help; // save for focus hack
866+ var gap1 = document.createTextNode(" ");
867+ this.toolbar.appendChild(gap1);
869+ var contents = this.create_element("a");
870+ contents.setAttribute("href", "javascript:toggleTableOfContents()");
871+ contents.setAttribute("title", this.localize("table of contents".localize));
872+ contents.innerHTML = this.localize("contents?");
873+ this.toolbar.appendChild(contents);
875+ var gap2 = document.createTextNode(" ");
876+ this.toolbar.appendChild(gap2);
878+ var copyright = this.find_copyright();
882+ var span = this.create_element("span");
883+ span.innerHTML = copyright;
884+ span.style.color = "black";
885+ span.style.marginLeft = "0.5em";
886+ this.toolbar.appendChild(span);
889+ counter = this.create_element("div")
890+ counter.style.position = "absolute";
891+ counter.style.width = "auto"; //"20%";
892+ counter.style.height = "1.2em";
893+ counter.style.top = "auto";
894+ counter.style.bottom = 0;
895+ counter.style.right = "0";
896+ counter.style.textAlign = "right";
897+ counter.style.color = "red";
898+ counter.style.background = "rgb(240,240,240)";
900+ counter.innerHTML = this.localize("slide") + " n/m";
901+ this.toolbar.appendChild(counter);
904+ // ensure that click isn't passed through to the page
905+ this.toolbar.onclick =
910+ var target = e.target;
912+ if (!target && e.srcElement)
913+ target = e.srcElement;
915+ // work around Safari bug
916+ if (target && target.nodeType == 3)
917+ target = target.parentNode;
919+ w3c_slidy.stop_propagation(e);
921+ if (target && target.nodeName.toLowerCase() != "a")
922+ w3c_slidy.mouse_button_click(e);
925+ this.slide_number_element = counter;
926+ this.set_eos_status(false);
927+ document.body.appendChild(this.toolbar);
930+ // wysiwyg editors make it hard to use div elements
931+ // e.g. amaya loses the div when you copy and paste
932+ // this function wraps div elements around implicit
933+ // slides which start with an h1 element and continue
934+ // up to the next heading or div element
935+ wrap_implicit_slides: function () {
936+ var i, heading, node, next, div;
937+ var headings = document.getElementsByTagName("h1");
942+ for (i = 0; i < headings.length; ++i)
944+ heading = headings[i];
946+ if (heading.parentNode != document.body)
949+ node = heading.nextSibling;
951+ div = document.createElement("div");
952+ this.add_class(div, "slide");
953+ document.body.replaceChild(div, heading);
954+ div.appendChild(heading);
958+ if (node.nodeType == 1 && // an element
959+ (node.nodeName == "H1" ||
960+ node.nodeName == "h1" ||
961+ node.nodeName == "DIV" ||
962+ node.nodeName == "div"))
965+ next = node.nextSibling;
966+ node = document.body.removeChild(node);
967+ div.appendChild(node);
973+// return new array of all slides
974+ collect_slides: function () {
975+ var slides = new Array();
976+ var divs = document.body.getElementsByTagName("div");
978+ for (var i = 0; i < divs.length; ++i)
982+ if (this.has_class(div, "slide"))
984+ // add slide to collection
985+ slides[slides.length] = div;
987+ // hide each slide as it is found
988+ this.add_class(div, "hidden");
990+ // add dummy <br/> at end for scrolling hack
991+ var node1 = document.createElement("br");
992+ div.appendChild(node1);
993+ var node2 = document.createElement("br");
994+ div.appendChild(node2);
996+ else if (this.has_class(div, "background"))
997+ { // work around for Firefox SVG reload bug
998+ // which otherwise replaces 1st SVG graphic with 2nd
999+ div.style.display = "block";
1003+ this.slides = slides;
1006+ // return new array of all <div class="handout">
1007+ collect_notes: function () {
1008+ var notes = new Array();
1009+ var divs = document.body.getElementsByTagName("div");
1011+ for (var i = 0; i < divs.length; ++i)
1013+ div = divs.item(i);
1015+ if (this.has_class(div, "handout"))
1017+ // add note to collection
1018+ notes[notes.length] = div;
1021+ this.add_class(div, "hidden");
1025+ this.notes = notes;
1028+ // return new array of all <div class="background">
1029+ // including named backgrounds e.g. class="background titlepage"
1030+ collect_backgrounds: function () {
1031+ var backgrounds = new Array();
1032+ var divs = document.body.getElementsByTagName("div");
1034+ for (var i = 0; i < divs.length; ++i)
1036+ div = divs.item(i);
1038+ if (this.has_class(div, "background"))
1040+ // add background to collection
1041+ backgrounds[backgrounds.length] = div;
1044+ this.add_class(div, "hidden");
1048+ this.backgrounds = backgrounds;
1051+ // set click handlers on all anchors
1052+ patch_anchors: function () {
1053+ var self = w3c_slidy;
1054+ var handler = function (event) {
1055+ // compare this.href with location.href
1056+ // for link to another slide in this doc
1058+ if (self.page_address(this.href) == self.page_address(location.href))
1060+ // yes, so find new slide number
1061+ var newslidenum = self.find_slide_number(this.href);
1063+ if (newslidenum != self.slide_number)
1065+ var slide = self.slides[self.slide_number];
1066+ self.hide_slide(slide);
1067+ self.slide_number = newslidenum;
1068+ slide = self.slides[self.slide_number];
1069+ self.show_slide(slide);
1070+ self.set_location();
1074+ w3c_slidy.stop_propagation(event);
1076+// else if (this.target == null)
1077+// location.href = this.href;
1080+ self.disable_slide_click = true;
1083+ var anchors = document.body.getElementsByTagName("a");
1085+ for (var i = 0; i < anchors.length; ++i)
1087+ if (window.addEventListener)
1088+ anchors[i].addEventListener("click", handler, false);
1090+ anchors[i].attachEvent("onclick", handler);
1094+ // ### CHECK ME ### see which functions are invoked via setTimeout
1095+ // either directly or indirectly for use of w3c_slidy vs this
1096+ show_slide_number: function () {
1097+ var timer = w3c_slidy.get_timer();
1098+ w3c_slidy.slide_number_element.innerHTML = timer + w3c_slidy.localize("slide") + " " +
1099+ (w3c_slidy.slide_number + 1) + "/" + w3c_slidy.slides.length;
1102+ // every 200mS check if the location has been changed as a
1103+ // result of the user activating the Back button/menu item
1104+ // doesn't work for Opera < 9.5
1105+ check_location: function () {
1106+ var hash = location.hash;
1108+ if (w3c_slidy.slide_number > 0 && (hash == "" || hash == "#"))
1109+ w3c_slidy.goto_slide(0);
1110+ else if (hash.length > 2 && hash != "#("+(w3c_slidy.slide_number+1)+")")
1112+ var num = parseInt(location.hash.substr(2));
1115+ w3c_slidy.goto_slide(num-1);
1118+ if (w3c_slidy.time_left && w3c_slidy.slide_number > 0)
1120+ w3c_slidy.show_slide_number();
1122+ if (w3c_slidy.time_left > 0)
1123+ w3c_slidy.time_left -= 200;
1127+ get_timer: function () {
1129+ if (w3c_slidy.time_left)
1132+ secs = Math.floor(w3c_slidy.time_left/1000);
1133+ mins = Math.floor(secs / 60);
1135+ timer = (mins ? mins+"m" : "") + secs + "s ";
1141+ // this doesn't push location onto history stack for IE
1142+ // for which a hidden iframe hack is needed: load page into
1143+ // the iframe with script that set's parent's location.hash
1144+ // but that won't work for standalone use unless we can
1145+ // create the page dynamically via a javascript: URL
1146+ set_location: function () {
1147+ var uri = w3c_slidy.page_address(location.href);
1148+ var hash = "#(" + (w3c_slidy.slide_number+1) + ")";
1150+ if (w3c_slidy.slide_number >= 0)
1153+ if (w3c_slidy.ie && (w3c_slidy.ie6 || w3c_slidy.ie7))
1154+ w3c_slidy.push_hash(hash);
1156+ if (uri != location.href) // && !khtml
1157+ location.href = uri;
1160+ hash = "(" + (w3c_slidy.slide_number+1) + ")";
1162+ if (!this.ie && location.hash != hash && location.hash != "")
1163+ location.hash = hash;
1165+ document.title = w3c_slidy.title + " (" + (w3c_slidy.slide_number+1) + ")";
1166+ w3c_slidy.show_slide_number();
1169+ page_address: function (uri) {
1170+ var i = uri.indexOf("#");
1173+ i = uri.indexOf("%23");
1175+ // check if anchor is entire page
1180+ return uri.substr(0, i);
1183+ // only used for IE6 and IE7
1184+ on_frame_loaded: function (hash) {
1185+ location.hash = hash;
1186+ var uri = w3c_slidy.page_address(location.href);
1187+ location.href = uri + hash;
1190+ // history hack with thanks to Bertrand Le Roy
1191+ push_hash: function (hash) {
1192+ if (hash == "") hash = "#(1)";
1193+ window.location.hash = hash;
1195+ var doc = document.getElementById("historyFrame").contentWindow.document;
1196+ doc.open("javascript:'<html></html>'");
1197+ doc.write("<html><head><script type=\"text/javascript\">window.parent.w3c_slidy.on_frame_loaded('"+
1198+ (hash) + "');</script></head><body>hello mum</body></html>");
1202+ // find current slide based upon location
1203+ // first find target anchor and then look
1204+ // for associated div element enclosing it
1205+ // finally map that to slide number
1206+ find_slide_number: function (uri) {
1207+ // first get anchor from page location
1209+ var i = uri.indexOf("#");
1211+ // check if anchor is entire page
1215+ var anchor = unescape(uri.substr(i+1));
1217+ // now use anchor as XML ID to find target
1218+ var target = document.getElementById(anchor);
1222+ // does anchor look like "(2)" for slide 2 ??
1223+ // where first slide is (1)
1224+ var re = /\((\d)+\)/;
1226+ if (anchor.match(re))
1228+ var num = parseInt(anchor.substring(1, anchor.length-1));
1230+ if (num > this.slides.length)
1239+ // accept [2] for backwards compatibility
1242+ if (anchor.match(re))
1244+ var num = parseInt(anchor.substring(1, anchor.length-1));
1246+ if (num > this.slides.length)
1255+ // oh dear unknown anchor
1259+ // search for enclosing slide
1263+ // browser coerces html elements to uppercase!
1264+ if (target.nodeName.toLowerCase() == "div" &&
1265+ this.has_class(target, "slide"))
1267+ // found the slide element
1271+ // otherwise try parent element if any
1273+ target = target.parentNode;
1277+ return 0; // no luck!
1281+ for (i = 0; i < slides.length; ++i)
1283+ if (slides[i] == target)
1284+ return i; // success
1287+ // oh dear still no luck
1291+ previous_slide: function (incremental) {
1292+ if (!w3c_slidy.view_all)
1296+ if ((incremental || w3c_slidy.slide_number == 0) && w3c_slidy.last_shown != null)
1298+ w3c_slidy.last_shown = w3c_slidy.hide_previous_item(w3c_slidy.last_shown);
1299+ w3c_slidy.set_eos_status(false);
1301+ else if (w3c_slidy.slide_number > 0)
1303+ slide = w3c_slidy.slides[w3c_slidy.slide_number];
1304+ w3c_slidy.hide_slide(slide);
1306+ w3c_slidy.slide_number = w3c_slidy.slide_number - 1;
1307+ slide = w3c_slidy.slides[w3c_slidy.slide_number];
1308+ w3c_slidy.set_visibility_all_incremental("visible");
1309+ w3c_slidy.last_shown = w3c_slidy.previous_incremental_item(null);
1310+ w3c_slidy.set_eos_status(true);
1311+ w3c_slidy.show_slide(slide);
1314+ w3c_slidy.set_location();
1316+ if (!w3c_slidy.ns_pos)
1317+ w3c_slidy.refresh_toolbar(200);
1321+ next_slide: function (incremental) {
1322+ if (!w3c_slidy.view_all)
1324+ var slide, last = w3c_slidy.last_shown;
1326+ if (incremental || w3c_slidy.slide_number == w3c_slidy.slides.length - 1)
1327+ w3c_slidy.last_shown = w3c_slidy.reveal_next_item(w3c_slidy.last_shown);
1329+ if ((!incremental || w3c_slidy.last_shown == null) &&
1330+ w3c_slidy.slide_number < w3c_slidy.slides.length - 1)
1332+ slide = w3c_slidy.slides[w3c_slidy.slide_number];
1333+ w3c_slidy.hide_slide(slide);
1335+ w3c_slidy.slide_number = w3c_slidy.slide_number + 1;
1336+ slide = w3c_slidy.slides[w3c_slidy.slide_number];
1337+ w3c_slidy.last_shown = null;
1338+ w3c_slidy.set_visibility_all_incremental("hidden");
1339+ w3c_slidy.show_slide(slide);
1341+ else if (!w3c_slidy.last_shown)
1343+ if (last && incremental)
1344+ w3c_slidy.last_shown = last;
1347+ w3c_slidy.set_location();
1349+ w3c_slidy.set_eos_status(!w3c_slidy.next_incremental_item(w3c_slidy.last_shown));
1351+ if (!w3c_slidy.ns_pos)
1352+ w3c_slidy.refresh_toolbar(200);
1356+ // to first slide with nothing revealed
1357+ // i.e. state at start of presentation
1358+ first_slide: function () {
1359+ if (!w3c_slidy.view_all)
1363+ if (w3c_slidy.slide_number != 0)
1365+ slide = w3c_slidy.slides[w3c_slidy.slide_number];
1366+ w3c_slidy.hide_slide(slide);
1368+ w3c_slidy.slide_number = 0;
1369+ slide = w3c_slidy.slides[w3c_slidy.slide_number];
1370+ w3c_slidy.last_shown = null;
1371+ w3c_slidy.set_visibility_all_incremental("hidden");
1372+ w3c_slidy.show_slide(slide);
1375+ w3c_slidy.set_eos_status(
1376+ !w3c_slidy.next_incremental_item(w3c_slidy.last_shown));
1377+ w3c_slidy.set_location();
1381+ // goto last slide with everything revealed
1382+ // i.e. state at end of presentation
1383+ last_slide: function () {
1384+ if (!w3c_slidy.view_all)
1388+ w3c_slidy.last_shown = null; //revealNextItem(lastShown);
1390+ if (w3c_slidy.last_shown == null &&
1391+ w3c_slidy.slide_number < w3c_slidy.slides.length - 1)
1393+ slide = w3c_slidy.slides[w3c_slidy.slide_number];
1394+ w3c_slidy.hide_slide(slide);
1395+ w3c_slidy.slide_number = w3c_slidy.slides.length - 1;
1396+ slide = w3c_slidy.slides[w3c_slidy.slide_number];
1397+ w3c_slidy.set_visibility_all_incremental("visible");
1398+ w3c_slidy.last_shown = w3c_slidy.previous_incremental_item(null);
1400+ w3c_slidy.show_slide(slide);
1404+ w3c_slidy.set_visibility_all_incremental("visible");
1405+ w3c_slidy.last_shown = w3c_slidy.previous_incremental_item(null);
1408+ w3c_slidy.set_eos_status(true);
1409+ w3c_slidy.set_location();
1414+ // ### check this and consider add/remove class
1415+ set_eos_status: function (state) {
1417+ this.eos.style.color = (state ? "rgb(240,240,240)" : "red");
1420+ // first slide is 0
1421+ goto_slide: function (num) {
1422+ //alert("going to slide " + (num+1));
1423+ var slide = w3c_slidy.slides[w3c_slidy.slide_number];
1424+ w3c_slidy.hide_slide(slide);
1425+ w3c_slidy.slide_number = num;
1426+ slide = w3c_slidy.slides[w3c_slidy.slide_number];
1427+ w3c_slidy.last_shown = null;
1428+ w3c_slidy.set_visibility_all_incremental("hidden");
1429+ w3c_slidy.set_eos_status(!w3c_slidy.next_incremental_item(w3c_slidy.last_shown));
1430+ document.title = w3c_slidy.title + " (" + (w3c_slidy.slide_number+1) + ")";
1431+ w3c_slidy.show_slide(slide);
1432+ w3c_slidy.show_slide_number();
1436+ show_slide: function (slide) {
1437+ this.sync_background(slide);
1438+ window.scrollTo(0,0);
1439+ this.remove_class(slide, "hidden");
1442+ hide_slide: function (slide) {
1443+ this.add_class(slide, "hidden");
1446+ // show just the backgrounds pertinent to this slide
1447+ // when slide background-color is transparent
1448+ // this should now work with rgba color values
1449+ sync_background: function (slide) {
1453+ if (slide.currentStyle)
1454+ bgColor = slide.currentStyle["backgroundColor"];
1455+ else if (document.defaultView)
1457+ var styles = document.defaultView.getComputedStyle(slide,null);
1460+ bgColor = styles.getPropertyValue("background-color");
1461+ else // broken implementation probably due Safari or Konqueror
1463+ //alert("defective implementation of getComputedStyle()");
1464+ bgColor = "transparent";
1468+ bgColor == "transparent";
1470+ if (bgColor == "transparent" ||
1471+ bgColor.indexOf("rgba") >= 0 ||
1472+ bgColor.indexOf("opacity") >= 0)
1474+ var slideClass = this.get_class_list(slide);
1476+ for (var i = 0; i < this.backgrounds.length; i++)
1478+ background = this.backgrounds[i];
1480+ var bgClass = this.get_class_list(background);
1482+ if (this.matching_background(slideClass, bgClass))
1483+ this.remove_class(background, "hidden");
1485+ this.add_class(background, "hidden");
1488+ else // forcibly hide all backgrounds
1489+ this.hide_backgrounds();
1492+ hide_backgrounds: function () {
1493+ for (var i = 0; i < this.backgrounds.length; i++)
1495+ background = this.backgrounds[i];
1496+ this.add_class(background, "hidden");
1500+ // compare classes for slide and background
1501+ matching_background: function (slideClass, bgClass) {
1502+ var i, count, pattern, result;
1504+ // define pattern as regular expression
1507+ // check background class names
1508+ result = bgClass.match(pattern);
1510+ for (i = count = 0; i < result.length; i++)
1512+ if (result[i] == "hidden")
1515+ if (result[i] == "background")
1521+ if (count == 0) // default match
1524+ // check for matches and place result in array
1525+ result = slideClass.match(pattern);
1527+ // now check if desired name is present for background
1528+ for (i = count = 0; i < result.length; i++)
1530+ if (result[i] == "hidden")
1533+ if (this.has_token(bgClass, result[i]))
1540+ resized: function () {
1543+ if ( typeof( window.innerWidth ) == 'number' )
1544+ width = window.innerWidth; // Non IE browser
1545+ else if (document.documentElement && document.documentElement.clientWidth)
1546+ width = document.documentElement.clientWidth; // IE6
1547+ else if (document.body && document.body.clientWidth)
1548+ width = document.body.clientWidth; // IE4
1552+ if ( typeof( window.innerHeight ) == 'number' )
1553+ height = window.innerHeight; // Non IE browser
1554+ else if (document.documentElement && document.documentElement.clientHeight)
1555+ height = document.documentElement.clientHeight; // IE6
1556+ else if (document.body && document.body.clientHeight)
1557+ height = document.body.clientHeight; // IE4
1559+ if (height && (width/height > 1.05*1024/768))
1561+ width = height * 1024.0/768;
1564+ // IE fires onresize even when only font size is changed!
1565+ // so we do a check to avoid blocking < and > actions
1566+ if (width != w3c_slidy.last_width || height != w3c_slidy.last_height)
1569+ w3c_slidy.size_index = 5; // 4
1570+ else if (width >= 1000)
1571+ w3c_slidy.size_index = 4; // 3
1572+ else if (width >= 800)
1573+ w3c_slidy.size_index = 3; // 2
1574+ else if (width >= 600)
1575+ w3c_slidy.size_index = 2; // 1
1577+ w3c_slidy.size_index = 0;
1579+ // add in font size adjustment from meta element e.g.
1580+ // <meta name="font-size-adjustment" content="-2" />
1581+ // useful when slides have too much content ;-)
1583+ if (0 <= w3c_slidy.size_index + w3c_slidy.size_adjustment &&
1584+ w3c_slidy.size_index + w3c_slidy.size_adjustment < w3c_slidy.sizes.length)
1585+ w3c_slidy.size_index = w3c_slidy.size_index + w3c_slidy.size_adjustment;
1587+ // enables cross browser use of relative width/height
1588+ // on object elements for use with SVG and Flash media
1589+ w3c_slidy.adjust_object_dimensions(width, height);
1591+ if (document.body.style.fontSize != w3c_slidy.sizes[w3c_slidy.size_index])
1593+ document.body.style.fontSize = w3c_slidy.sizes[w3c_slidy.size_index];
1596+ w3c_slidy.last_width = width;
1597+ w3c_slidy.last_height = height;
1599+ // force reflow to work around Mozilla bug
1600+ if (w3c_slidy.ns_pos)
1602+ var slide = w3c_slidy.slides[w3c_slidy.slide_number];
1603+ w3c_slidy.hide_slide(slide);
1604+ w3c_slidy.show_slide(slide);
1607+ // force correct positioning of toolbar
1608+ w3c_slidy.refresh_toolbar(200);
1612+ scrolled: function () {
1613+ if (w3c_slidy.toolbar && !w3c_slidy.ns_pos && !w3c_slidy.ie7)
1615+ w3c_slidy.hack_offset = w3c_slidy.scroll_x_offset();
1617+ w3c_slidy.toolbar.style.display = "none";
1619+ // make it reappear later
1620+ if (w3c_slidy.scrollhack == 0 && !w3c_slidy.view_all)
1622+ setTimeout(function () {w3c_slidy.show_toolbar(); }, 1000);
1623+ w3c_slidy.scrollhack = 1;
1628+ hide_toolbar: function () {
1629+ w3c_slidy.add_class(w3c_slidy.toolbar, "hidden");
1633+ // used to ensure IE refreshes toolbar in correct position
1634+ refresh_toolbar: function (interval) {
1635+ if (!w3c_slidy.ns_pos && !w3c_slidy.ie7)
1637+ w3c_slidy.hide_toolbar();
1638+ setTimeout(function () {w3c_slidy.show_toolbar(); }, interval);
1642+ // restores toolbar after short delay
1643+ show_toolbar: function () {
1644+ if (w3c_slidy.want_toolbar)
1646+ w3c_slidy.toolbar.style.display = "block";
1648+ if (!w3c_slidy.ns_pos)
1650+ // adjust position to allow for scrolling
1651+ var xoffset = w3c_slidy.scroll_x_offset();
1652+ w3c_slidy.toolbar.style.left = xoffset;
1653+ w3c_slidy.toolbar.style.right = xoffset;
1655+ // determine vertical scroll offset
1656+ //var yoffset = scrollYOffset();
1658+ // bottom is doc height - window height - scroll offset
1659+ //var bottom = documentHeight() - lastHeight - yoffset
1661+ //if (yoffset > 0 || documentHeight() > lastHeight)
1662+ // bottom += 16; // allow for height of scrollbar
1664+ w3c_slidy.toolbar.style.bottom = 0; //bottom;
1667+ w3c_slidy.remove_class(w3c_slidy.toolbar, "hidden");
1670+ w3c_slidy.scrollhack = 0;
1673+ // set the keyboard focus to the help link on the
1674+ // toolbar to ensure that document has the focus
1675+ // IE doesn't always work with window.focus()
1676+ // and this hack has benefit of Enter for help
1680+ if (!w3c_slidy.opera)
1681+ w3c_slidy.help_anchor.focus();
1688+// invoked via F key
1689+ toggle_toolbar: function () {
1690+ if (!w3c_slidy.view_all)
1692+ if (w3c_slidy.has_class(w3c_slidy.toolbar, "hidden"))
1694+ w3c_slidy.remove_class(w3c_slidy.toolbar, "hidden")
1695+ w3c_slidy.want_toolbar = 1;
1699+ w3c_slidy.add_class(w3c_slidy.toolbar, "hidden")
1700+ w3c_slidy.want_toolbar = 0;
1705+ scroll_x_offset: function () {
1706+ if (window.pageXOffset)
1707+ return self.pageXOffset;
1709+ if (document.documentElement &&
1710+ document.documentElement.scrollLeft)
1711+ return document.documentElement.scrollLeft;
1714+ return document.body.scrollLeft;
1719+ scroll_y_offset: function () {
1720+ if (window.pageYOffset)
1721+ return self.pageYOffset;
1723+ if (document.documentElement &&
1724+ document.documentElement.scrollTop)
1725+ return document.documentElement.scrollTop;
1728+ return document.body.scrollTop;
1733+ // looking for a way to determine height of slide content
1734+ // the slide itself is set to the height of the window
1735+ optimize_font_size: function () {
1736+ var slide = w3c_slidy.slides[w3c_slidy.slide_number];
1738+ //var dh = documentHeight(); //getDocHeight(document);
1739+ var dh = slide.scrollHeight;
1740+ var wh = getWindowHeight();
1741+ var u = 100 * dh / wh;
1743+ alert("window utilization = " + u + "% (doc "
1744+ + dh + " win " + wh + ")");
1747+ // from document object
1748+ get_doc_height: function (doc) {
1752+ if (doc && doc.body && doc.body.offsetHeight)
1753+ return doc.body.offsetHeight; // ns/gecko syntax
1755+ if (doc && doc.body && doc.body.scrollHeight)
1756+ return doc.body.scrollHeight;
1758+ alert("couldn't determine document height");
1761+ get_window_height: function () {
1762+ if ( typeof( window.innerHeight ) == 'number' )
1763+ return window.innerHeight; // Non IE browser
1765+ if (document.documentElement && document.documentElement.clientHeight)
1766+ return document.documentElement.clientHeight; // IE6
1768+ if (document.body && document.body.clientHeight)
1769+ return document.body.clientHeight; // IE4
1772+ document_height: function () {
1775+ sh = document.body.scrollHeight;
1776+ oh = document.body.offsetHeight;
1780+ return (sh > oh ? sh : oh);
1787+ smaller: function () {
1788+ if (w3c_slidy.size_index > 0)
1790+ --w3c_slidy.size_index;
1793+ w3c_slidy.toolbar.style.display = "none";
1794+ document.body.style.fontSize = w3c_slidy.sizes[w3c_slidy.size_index];
1795+ var slide = w3c_slidy.slides[w3c_slidy.slide_number];
1796+ w3c_slidy.hide_slide(slide);
1797+ w3c_slidy.show_slide(slide);
1798+ setTimeout(function () {w3c_slidy.show_toolbar(); }, 50);
1801+ bigger: function () {
1802+ if (w3c_slidy.size_index < w3c_slidy.sizes.length - 1)
1804+ ++w3c_slidy.size_index;
1807+ w3c_slidy.toolbar.style.display = "none";
1808+ document.body.style.fontSize = w3c_slidy.sizes[w3c_slidy.size_index];
1809+ var slide = w3c_slidy.slides[w3c_slidy.slide_number];
1810+ w3c_slidy.hide_slide(slide);
1811+ w3c_slidy.show_slide(slide);
1812+ setTimeout(function () {w3c_slidy.show_toolbar(); }, 50);
1815+ // enables cross browser use of relative width/height
1816+ // on object elements for use with SVG and Flash media
1817+ // with thanks to Ivan Herman for the suggestion
1818+ adjust_object_dimensions: function (width, height) {
1819+ for( var i = 0; i < w3c_slidy.objects.length; i++ )
1821+ var obj = this.objects[i];
1822+ var mimeType = obj.getAttribute("type");
1824+ if (mimeType == "image/svg+xml" || mimeType == "application/x-shockwave-flash")
1826+ if ( !obj.initialWidth )
1827+ obj.initialWidth = obj.getAttribute("width");
1829+ if ( !obj.initialHeight )
1830+ obj.initialHeight = obj.getAttribute("height");
1832+ if ( obj.initialWidth && obj.initialWidth.charAt(obj.initialWidth.length-1) == "%" )
1834+ var w = parseInt(obj.initialWidth.slice(0, obj.initialWidth.length-1));
1835+ var newW = width * (w/100.0);
1836+ obj.setAttribute("width",newW);
1839+ if ( obj.initialHeight &&
1840+ obj.initialHeight.charAt(obj.initialHeight.length-1) == "%" )
1842+ var h = parseInt(obj.initialHeight.slice(0, obj.initialHeight.length-1));
1843+ var newH = height * (h/100.0);
1844+ obj.setAttribute("height", newH);
1850+ // needed for Opera to inhibit default behavior
1851+ // since Opera delivers keyPress even if keyDown
1853+ key_press: function (event) {
1855+ event = window.event;
1857+ if (!w3c_slidy.key_wanted)
1858+ return w3c_slidy.cancel(event);
1863+ // See e.g. http://www.quirksmode.org/js/events/keys.html for keycodes
1864+ key_down: function (event) {
1865+ var key, target, tag;
1867+ w3c_slidy.key_wanted = true;
1870+ event = window.event;
1872+ // kludge around NS/IE differences
1875+ key = window.event.keyCode;
1876+ target = window.event.srcElement;
1878+ else if (event.which)
1881+ target = event.target;
1884+ return true; // Yikes! unknown browser
1886+ // ignore event if key value is zero
1887+ // as for alt on Opera and Konqueror
1891+ // avoid interfering with keystroke
1892+ // behavior for non-slidy chrome elements
1893+ if (!w3c_slidy.slidy_chrome(target) &&
1894+ w3c_slidy.special_element(target))
1897+ // check for concurrent control/command/alt key
1898+ // but are these only present on mouse events?
1900+ if (event.ctrlKey || event.altKey || event.metaKey)
1903+ // dismiss table of contents if visible
1904+ if (w3c_slidy.is_shown_toc() && key != 9 && key != 16 && key != 38 && key != 40)
1906+ w3c_slidy.hide_table_of_contents(true);
1908+ if (key == 27 || key == 84 || key == 67)
1909+ return w3c_slidy.cancel(event);
1912+ if (key == 34) // Page Down
1914+ if (w3c_slidy.view_all)
1917+ w3c_slidy.next_slide(false);
1918+ return w3c_slidy.cancel(event);
1920+ else if (key == 33) // Page Up
1922+ if (w3c_slidy.view_all)
1925+ w3c_slidy.previous_slide(false);
1926+ return w3c_slidy.cancel(event);
1928+ else if (key == 32) // space bar
1930+ w3c_slidy.next_slide(true);
1931+ return w3c_slidy.cancel(event);
1933+ else if (key == 37) // Left arrow
1935+ w3c_slidy.previous_slide(!event.shiftKey);
1936+ return w3c_slidy.cancel(event);
1938+ else if (key == 36) // Home
1940+ w3c_slidy.first_slide();
1941+ return w3c_slidy.cancel(event);
1943+ else if (key == 35) // End
1945+ w3c_slidy.last_slide();
1946+ return w3c_slidy.cancel(event);
1948+ else if (key == 39) // Right arrow
1950+ w3c_slidy.next_slide(!event.shiftKey);
1951+ return w3c_slidy.cancel(event);
1953+ else if (key == 13) // Enter
1955+ if (w3c_slidy.outline)
1957+ if (w3c_slidy.outline.visible)
1958+ w3c_slidy.fold(w3c_slidy.outline);
1960+ w3c_slidy.unfold(w3c_slidy.outline);
1962+ return w3c_slidy.cancel(event);
1965+ else if (key == 188) // < for smaller fonts
1967+ w3c_slidy.smaller();
1968+ return w3c_slidy.cancel(event);
1970+ else if (key == 190) // > for larger fonts
1972+ w3c_slidy.bigger();
1973+ return w3c_slidy.cancel(event);
1975+ else if (key == 189 || key == 109) // - for smaller fonts
1977+ w3c_slidy.smaller();
1978+ return w3c_slidy.cancel(event);
1980+ else if (key == 187 || key == 191 || key == 107) // = + for larger fonts
1982+ w3c_slidy.bigger();
1983+ return w3c_slidy.cancel(event);
1985+ else if (key == 83) // S for smaller fonts
1987+ w3c_slidy.smaller();
1988+ return w3c_slidy.cancel(event);
1990+ else if (key == 66) // B for larger fonts
1992+ w3c_slidy.bigger();
1993+ return w3c_slidy.cancel(event);
1995+ else if (key == 90) // Z for last slide
1997+ w3c_slidy.last_slide();
1998+ return w3c_slidy.cancel(event);
2000+ else if (key == 70) // F for toggle toolbar
2002+ w3c_slidy.toggle_toolbar();
2003+ return w3c_slidy.cancel(event);
2005+ else if (key == 65) // A for toggle view single/all slides
2007+ w3c_slidy.toggle_view();
2008+ return w3c_slidy.cancel(event);
2010+ else if (key == 75) // toggle action of left click for next page
2012+ w3c_slidy.mouse_click_enabled = !w3c_slidy.mouse_click_enabled;
2013+ var alert_msg = (w3c_slidy.mouse_click_enabled ?
2014+ "enabled" : "disabled") + " mouse click advance";
2016+ alert(w3c_slidy.localize(alert_msg));
2017+ return w3c_slidy.cancel(event);
2019+ else if (key == 84 || key == 67) // T or C for table of contents
2022+ w3c_slidy.toggle_table_of_contents();
2024+ return w3c_slidy.cancel(event);
2026+ else if (key == 72) // H for help
2028+ window.location = w3c_slidy.help_page;
2029+ return w3c_slidy.cancel(event);
2031+ //else alert("key code is "+ key);
2036+ // safe for both text/html and application/xhtml+xml
2037+ create_element: function (name) {
2038+ if (this.xhtml && (typeof document.createElementNS != 'undefined'))
2039+ return document.createElementNS("http://www.w3.org/1999/xhtml", name)
2041+ return document.createElement(name);
2044+ get_element_style: function (elem, IEStyleProp, CSSStyleProp) {
2045+ if (elem.currentStyle)
2047+ return elem.currentStyle[IEStyleProp];
2049+ else if (window.getComputedStyle)
2051+ var compStyle = window.getComputedStyle(elem, "");
2052+ return compStyle.getPropertyValue(CSSStyleProp);
2057+ // the string str is a whitespace separated list of tokens
2058+ // test if str contains a particular token, e.g. "slide"
2059+ has_token: function (str, token) {
2062+ // define pattern as regular expression
2063+ var pattern = /\w+/g;
2065+ // check for matches
2066+ // place result in array
2067+ var result = str.match(pattern);
2069+ // now check if desired token is present
2070+ for (var i = 0; i < result.length; i++)
2072+ if (result[i] == token)
2080+ get_class_list: function (element) {
2081+ if (typeof element.className != 'undefined')
2082+ return element.className;
2084+ return element.getAttribute("class");
2087+ has_class: function (element, name) {
2088+ if (element.nodeType != 1)
2091+ var regexp = new RegExp("(^| )" + name + "\W*");
2093+ if (typeof element.className != 'undefined')
2094+ return regexp.test(element.className);
2096+ return regexp.test(element.getAttribute("class"));
2099+ remove_class: function (element, name) {
2100+ var regexp = new RegExp("(^| )" + name + "\W*");
2103+ if (typeof element.className != 'undefined')
2105+ clsval = element.className;
2109+ clsval = clsval.replace(regexp, "");
2110+ element.className = clsval;
2115+ clsval = element.getAttribute("class");
2119+ clsval = clsval.replace(regexp, "");
2120+ element.setAttribute("class", clsval);
2125+ add_class: function (element, name) {
2126+ if (!this.has_class(element, name))
2128+ if (typeof element.className != 'undefined')
2129+ element.className += " " + name;
2132+ var clsval = element.getAttribute("class");
2133+ clsval = clsval ? clsval + " " + name : name;
2134+ element.setAttribute("class", clsval);
2139+ // HTML elements that can be used with class="incremental"
2140+ // note that you can also put the class on containers like
2141+ // up, ol, dl, and div to make their contents appear
2142+ // incrementally. Upper case is used since this is what
2143+ // browsers report for HTML node names (text/html).
2144+ incremental_elements: null,
2145+ okay_for_incremental: function (name) {
2146+ if (!this.incremental_elements)
2148+ var inclist = new Array();
2149+ inclist["p"] = true;
2150+ inclist["pre"] = true;
2151+ inclist["li"] = true;
2152+ inclist["blockquote"] = true;
2153+ inclist["dt"] = true;
2154+ inclist["dd"] = true;
2155+ inclist["h2"] = true;
2156+ inclist["h3"] = true;
2157+ inclist["h4"] = true;
2158+ inclist["h5"] = true;
2159+ inclist["h6"] = true;
2160+ inclist["span"] = true;
2161+ inclist["address"] = true;
2162+ inclist["table"] = true;
2163+ inclist["tr"] = true;
2164+ inclist["th"] = true;
2165+ inclist["td"] = true;
2166+ inclist["img"] = true;
2167+ inclist["object"] = true;
2168+ this.incremental_elements = inclist;
2170+ return this.incremental_elements[name.toLowerCase()];
2173+ next_incremental_item: function (node) {
2174+ var br = this.is_xhtml ? "br" : "BR";
2175+ var slide = w3c_slidy.slides[w3c_slidy.slide_number];
2179+ node = w3c_slidy.next_node(slide, node);
2181+ if (node == null || node.parentNode == null)
2184+ if (node.nodeType == 1) // ELEMENT
2186+ if (node.nodeName == br)
2189+ if (w3c_slidy.has_class(node, "incremental")
2190+ && w3c_slidy.okay_for_incremental(node.nodeName))
2193+ if (w3c_slidy.has_class(node.parentNode, "incremental")
2194+ && !w3c_slidy.has_class(node, "non-incremental"))
2202+ previous_incremental_item: function (node) {
2203+ var br = this.is_xhtml ? "br" : "BR";
2204+ var slide = w3c_slidy.slides[w3c_slidy.slide_number];
2208+ node = w3c_slidy.previous_node(slide, node);
2210+ if (node == null || node.parentNode == null)
2213+ if (node.nodeType == 1)
2215+ if (node.nodeName == br)
2218+ if (w3c_slidy.has_class(node, "incremental")
2219+ && w3c_slidy.okay_for_incremental(node.nodeName))
2222+ if (w3c_slidy.has_class(node.parentNode, "incremental")
2223+ && !w3c_slidy.has_class(node, "non-incremental"))
2231+ // set visibility for all elements on current slide with
2232+ // a parent element with attribute class="incremental"
2233+ set_visibility_all_incremental: function (value) {
2234+ var node = this.next_incremental_item(null);
2236+ if (value == "hidden")
2240+ w3c_slidy.add_class(node, "invisible");
2241+ node = w3c_slidy.next_incremental_item(node);
2244+ else // value == "visible"
2248+ w3c_slidy.remove_class(node, "invisible");
2249+ node = w3c_slidy.next_incremental_item(node);
2254+ // reveal the next hidden item on the slide
2255+ // node is null or the node that was last revealed
2256+ reveal_next_item: function (node) {
2257+ node = w3c_slidy.next_incremental_item(node);
2259+ if (node && node.nodeType == 1) // an element
2260+ w3c_slidy.remove_class(node, "invisible");
2265+ // exact inverse of revealNextItem(node)
2266+ hide_previous_item: function (node) {
2267+ if (node && node.nodeType == 1) // an element
2268+ w3c_slidy.add_class(node, "invisible");
2270+ return this.previous_incremental_item(node);
2273+ // left to right traversal of root's content
2274+ next_node: function (root, node) {
2276+ return root.firstChild;
2278+ if (node.firstChild)
2279+ return node.firstChild;
2281+ if (node.nextSibling)
2282+ return node.nextSibling;
2286+ node = node.parentNode;
2288+ if (!node || node == root)
2291+ if (node && node.nextSibling)
2292+ return node.nextSibling;
2298+ // right to left traversal of root's content
2299+ previous_node: function (root, node) {
2302+ node = root.lastChild;
2306+ while (node.lastChild)
2307+ node = node.lastChild;
2313+ if (node.previousSibling)
2315+ node = node.previousSibling;
2317+ while (node.lastChild)
2318+ node = node.lastChild;
2323+ if (node.parentNode != root)
2324+ return node.parentNode;
2329+ previous_sibling_element: function (el) {
2330+ el = el.previousSibling;
2332+ while (el && el.nodeType != 1)
2333+ el = el.previousSibling;
2338+ next_sibling_element: function (el) {
2339+ el = el.nextSibling;
2341+ while (el && el.nodeType != 1)
2342+ el = el.nextSibling;
2347+ first_child_element: function (el) {
2350+ for (node = el.firstChild; node; node = node.nextSibling)
2352+ if (node.nodeType == 1)
2359+ first_tag: function (element, tag) {
2362+ if (!this.is_xhtml)
2363+ tag = tag.toUpperCase();
2365+ for (node = element.firstChild; node; node = node.nextSibling)
2367+ if (node.nodeType == 1 && node.nodeName == tag)
2374+ hide_selection: function () {
2375+ if (window.getSelection) // Firefox, Chromium, Safari, Opera
2377+ var selection = window.getSelection();
2379+ if (selection.rangeCount > 0)
2381+ var range = selection.getRangeAt(0);
2382+ range.collapse (false);
2385+ else // Internet Explorer
2387+ var textRange = document.selection.createRange ();
2388+ textRange.collapse (false);
2392+ get_selected_text: function () {
2395+ if (window.getSelection)
2396+ return window.getSelection().toString();
2398+ if (document.getSelection)
2399+ return document.getSelection().toString();
2401+ if (document.selection)
2402+ return document.selection.createRange().text;
2411+ // make note of length of selected text
2412+ // as this evaluates to zero in click event
2413+ mouse_button_up: function (e) {
2414+ w3c_slidy.selected_text_len = w3c_slidy.get_selected_text().length;
2417+ // right mouse button click is reserved for context menus
2418+ // it is more reliable to detect rightclick than leftclick
2419+ mouse_button_click: function (e) {
2420+ var rightclick = false;
2421+ var leftclick = false;
2422+ var middleclick = false;
2426+ var e = window.event;
2430+ else if (e.srcElement)
2431+ target = e.srcElement;
2433+ // work around Safari bug
2434+ if (target.nodeType == 3)
2435+ target = target.parentNode;
2437+ if (e.which) // all browsers except IE
2439+ leftclick = (e.which == 1);
2440+ middleclick = (e.which == 2);
2441+ rightclick = (e.which == 3);
2445+ // Konqueror gives 1 for left, 4 for middle
2446+ // IE6 gives 0 for left and not 1 as I expected
2449+ middleclick = true;
2451+ // all browsers agree on 2 for right button
2452+ rightclick = (e.button == 2);
2457+ if (w3c_slidy.selected_text_len > 0)
2459+ w3c_slidy.stop_propagation(e);
2461+ e.returnValue = false;
2465+ // dismiss table of contents
2466+ w3c_slidy.hide_table_of_contents(false);
2468+ // check if target is something that probably want's clicks
2469+ // e.g. a, embed, object, input, textarea, select, option
2470+ var tag = target.nodeName.toLowerCase();
2472+ if (w3c_slidy.mouse_click_enabled && leftclick &&
2473+ !w3c_slidy.special_element(target) &&
2476+ w3c_slidy.next_slide(true);
2477+ w3c_slidy.stop_propagation(e);
2479+ e.returnValue = false;
2486+ special_element: function (e) {
2487+ var tag = e.nodeName.toLowerCase();
2489+ return e.onkeydown ||
2497+ tag == "textarea" ||
2502+ slidy_chrome: function (el) {
2505+ if (el == w3c_slidy.toc ||
2506+ el == w3c_slidy.toolbar ||
2507+ w3c_slidy.has_class(el, "outline"))
2510+ el = el.parentNode;
2516+ get_key: function (e)
2520+ // kludge around NS/IE differences
2521+ if (typeof window.event != "undefined")
2522+ key = window.event.keyCode;
2529+ get_target: function (e) {
2537+ else if (e.srcElement)
2538+ target = e.srcElement;
2540+ if (target.nodeType != 1)
2541+ target = target.parentNode;
2546+ // does display property provide correct defaults?
2547+ is_block: function (elem) {
2548+ var tag = elem.nodeName.toLowerCase();
2550+ return tag == "ol" || tag == "ul" || tag == "p" ||
2551+ tag == "li" || tag == "table" || tag == "pre" ||
2552+ tag == "h1" || tag == "h2" || tag == "h3" ||
2553+ tag == "h4" || tag == "h5" || tag == "h6" ||
2554+ tag == "blockquote" || tag == "address";
2557+ add_listener: function (element, event, handler) {
2558+ if (window.addEventListener)
2559+ element.addEventListener(event, handler, false);
2561+ element.attachEvent("on"+event, handler);
2564+ // used to prevent event propagation from field controls
2565+ stop_propagation: function (event) {
2566+ event = event ? event : window.event;
2567+ event.cancelBubble = true; // for IE
2569+ if (event.stopPropagation)
2570+ event.stopPropagation();
2575+ cancel: function (event) {
2578+ event.cancel = true;
2579+ event.returnValue = false;
2581+ if (event.preventDefault)
2582+ event.preventDefault();
2585+ w3c_slidy.key_wanted = false;
2589+// for each language define an associative array
2590+// and also the help text which is longer
2595+ "contents?":"Índice",
2596+ "table of contents":"tabla de contenidos",
2597+ "Table of Contents":"Tabla de Contenidos",
2598+ "restart presentation":"Reiniciar presentación",
2599+ "restart?":"Inicio"
2602+ "Utilice el ratón, barra espaciadora, teclas Izda/Dcha, " +
2603+ "o Re pág y Av pág. Use S y B para cambiar el tamaño de fuente.",
2608+ "contents?":"Índex",
2609+ "table of contents":"taula de continguts",
2610+ "Table of Contents":"Taula de Continguts",
2611+ "restart presentation":"Reiniciar presentació",
2615+ "Utilitzi el ratolí, barra espaiadora, tecles Esq./Dta. " +
2616+ "o Re pàg y Av pàg. Usi S i B per canviar grandària de font.",
2620+ "help?":"nápověda",
2621+ "contents?":"obsah",
2622+ "table of contents":"obsah prezentace",
2623+ "Table of Contents":"Obsah prezentace",
2624+ "restart presentation":"znovu spustit prezentaci",
2625+ "restart?":"restart"
2628+ "Prezentaci můžete procházet pomocí kliknutí myši, mezerníku, " +
2629+ "šipek vlevo a vpravo nebo kláves PageUp a PageDown. Písmo se " +
2630+ "dá zvětšit a zmenšit pomocí kláves B a S.",
2635+ "contents?":"Inhoud?",
2636+ "table of contents":"inhoudsopgave",
2637+ "Table of Contents":"Inhoudsopgave",
2638+ "restart presentation":"herstart presentatie",
2639+ "restart?":"Herstart?"
2642+ "Navigeer d.m.v. het muis, spatiebar, Links/Rechts toetsen, " +
2643+ "of PgUp en PgDn. Gebruik S en B om de karaktergrootte te veranderen.",
2648+ "contents?":"Übersicht",
2649+ "table of contents":"Inhaltsverzeichnis",
2650+ "Table of Contents":"Inhaltsverzeichnis",
2651+ "restart presentation":"Präsentation neu starten",
2652+ "restart?":"Neustart"
2655+ "Benutzen Sie die Maus, Leerschlag, die Cursortasten links/rechts oder " +
2656+ "Page up/Page Down zum Wechseln der Seiten und S und B für die Schriftgrösse.",
2661+ "contents?":"spis treści?",
2662+ "table of contents":"spis treści",
2663+ "Table of Contents":"Spis Treści",
2664+ "restart presentation":"Restartuj prezentację",
2665+ "restart?":"restart?"
2668+ "Zmieniaj slajdy klikając myszą, naciskając spację, strzałki lewo/prawo" +
2669+ "lub PgUp / PgDn. Użyj klawiszy S i B, aby zmienić rozmiar czczionki.",
2674+ "contents?":"Index",
2675+ "table of contents":"table des matières",
2676+ "Table of Contents":"Table des matières",
2677+ "restart presentation":"Recommencer l'exposé",
2681+ "Naviguez avec la souris, la barre d'espace, les flèches " +
2682+ "gauche/droite ou les touches Pg Up, Pg Dn. Utilisez " +
2683+ "les touches S et B pour modifier la taille de la police.",
2687+ "help?":"segítség",
2688+ "contents?":"tartalom",
2689+ "table of contents":"tartalomjegyzék",
2690+ "Table of Contents":"Tartalomjegyzék",
2691+ "restart presentation":"bemutató újraindítása",
2692+ "restart?":"újraindítás"
2695+ "Az oldalak közti lépkedéshez kattintson az egérrel, vagy " +
2696+ "használja a szóköz, a bal, vagy a jobb nyíl, illetve a Page Down, " +
2697+ "Page Up billentyűket. Az S és a B billentyűkkel változtathatja " +
2698+ "a szöveg méretét.",
2703+ "contents?":"Indice",
2704+ "table of contents":"indice",
2705+ "Table of Contents":"Indice",
2706+ "restart presentation":"Ricominciare la presentazione",
2707+ "restart?":"Inizio"
2710+ "Navigare con mouse, barra spazio, frecce sinistra/destra o " +
2711+ "PgUp e PgDn. Usare S e B per cambiare la dimensione dei caratteri.",
2715+ "help?":"βοήθεια;",
2716+ "contents?":"περιεχόμενα;",
2717+ "table of contents":"πίνακας περιεχομένων",
2718+ "Table of Contents":"Πίνακας Περιεχομένων",
2719+ "restart presentation":"επανεκκίνηση παρουσίασης",
2720+ "restart?":"επανεκκίνηση;"
2723+ "Πλοηγηθείτε με το κλίκ του ποντικιού, το space, τα βέλη αριστερά/δεξιά, " +
2724+ "ή Page Up και Page Down. Χρησιμοποιήστε τα πλήκτρα S και B για να αλλάξετε " +
2725+ "το μέγεθος της γραμματοσειράς.",
2731+ "table of contents":"目次を表示",
2732+ "Table of Contents":"目次",
2733+ "restart presentation":"最初から再生",
2737+ "マウス左クリック ・ スペース ・ 左右キー " +
2738+ "または Page Up ・ Page Downで操作, S ・ Bでフォントサイズ変更",
2744+ "table of contents":"目录",
2745+ "Table of Contents":"目录",
2746+ "restart presentation":"重新启动展示",
2750+ "用鼠标点击, 空格条, 左右箭头, Pg Up 和 Pg Dn 导航. " +
2756+ "contents?":"содержание?",
2757+ "table of contents":"оглавление",
2758+ "Table of Contents":"Оглавление",
2759+ "restart presentation":"перезапустить презентацию",
2760+ "restart?":"перезапуск?"
2763+ "Перемещайтесь кликая мышкой, используя клавишу пробел, стрелки" +
2764+ "влево/вправо или Pg Up и Pg Dn. Клавиши S и B меняют размер шрифта.",
2769+ "contents?":"innehåll",
2770+ "table of contents":"innehållsförteckning",
2771+ "Table of Contents":"Innehållsförteckning",
2772+ "restart presentation":"visa presentationen från början",
2773+ "restart?":"börja om"
2776+ "Bläddra med ett klick med vänstra musknappen, mellanslagstangenten, " +
2777+ "vänster- och högerpiltangenterna eller tangenterna Pg Up, Pg Dn. " +
2778+ "Använd tangenterna S och B för att ändra textens storlek.",
2782+ localize: function (src) {
2786+ // try full language code, e.g. en-US
2787+ var s, lookup = w3c_slidy.strings[w3c_slidy.lang];
2797+ // strip country code suffix, e.g.
2798+ // try en if undefined for en-US
2799+ var lg = w3c_slidy.lang.split("-");
2803+ lookup = w3c_slidy.strings[lg[0]];
2814+ // otherwise string as is
2818+ init_localization: function () {
2819+ var i18n = w3c_slidy;
2820+ var help_text = w3c_slidy.help_text;
2822+ // each such language array is declared in the localize array
2823+ // this is used as in w3c_slidy.localize("foo");
2825+ "es":this.strings_es,
2826+ "ca":this.strings_ca,
2827+ "cs":this.strings_cs,
2828+ "nl":this.strings_nl,
2829+ "de":this.strings_de,
2830+ "pl":this.strings_pl,
2831+ "fr":this.strings_fr,
2832+ "hu":this.strings_hu,
2833+ "it":this.strings_it,
2834+ "el":this.strings_el,
2835+ "jp":this.strings_ja,
2836+ "zh":this.strings_zh,
2837+ "ru":this.strings_ru,
2838+ "sv":this.strings_sv
2841+ i18n.strings_es[help_text] = i18n.help_es;
2842+ i18n.strings_ca[help_text] = i18n.help_ca;
2843+ i18n.strings_cs[help_text] = i18n.help_cs;
2844+ i18n.strings_nl[help_text] = i18n.help_nl;
2845+ i18n.strings_de[help_text] = i18n.help_de;
2846+ i18n.strings_pl[help_text] = i18n.help_pl;
2847+ i18n.strings_fr[help_text] = i18n.help_fr;
2848+ i18n.strings_hu[help_text] = i18n.help_hu;
2849+ i18n.strings_it[help_text] = i18n.help_it;
2850+ i18n.strings_el[help_text] = i18n.help_el;
2851+ i18n.strings_ja[help_text] = i18n.help_ja;
2852+ i18n.strings_zh[help_text] = i18n.help_zh;
2853+ i18n.strings_ru[help_text] = i18n.help_ru;
2854+ i18n.strings_sv[help_text] = i18n.help_sv;
2856+ w3c_slidy.lang = document.body.parentNode.getAttribute("lang");
2858+ if (!w3c_slidy.lang)
2859+ w3c_slidy.lang = document.body.parentNode.getAttribute("xml:lang");
2861+ if (!w3c_slidy.lang)
2862+ w3c_slidy.lang = "en";
2866+// hack for back button behavior
2867+if (w3c_slidy.ie6 || w3c_slidy.ie7)
2869+ document.write("<iframe id='historyFrame' " +
2870+ "src='javascript:\"<html"+"></"+"html>\"' " +
2871+ "height='1' width='1' " +
2872+ "style='position:absolute;left:-800px'></iframe>");
2875+// attach event listeners for initialization
2878+// hide the slides as soon as body element is available
2879+// to reduce annoying screen mess before the onload event
2880+setTimeout(w3c_slidy.hide_slides, 50);