var img = document.getAnonymousNodes(this)[0]; var file = this.getAttribute("fileref"); // HACK: using img.src=file 'inline' doesn't seem to work // but it does when called from a setTimeout() var f = function() { img.src = file; } setTimeout(f, 0); //Doesn't work... footnotes = document.getElementsByTagName("footnote"); footnote = null; for(i=0;i<footnotes.length;i++){ if(footnotes[i].attributes.id.value == this.attributes.linkend.value){ footnote = footnotes[i]; break; } } attr = document.createAttribute("style"); if(show){ attr.nodeValue = "display: block;z-index: 100;position: fixed;border-top: 1px solid black;background-color: #ffffe1;padding: .5em;left: 0px;bottom: 0px;font: sans-serif medium;font-weight: normal;font-style: normal;width: 100%;"; } else{ attr.nodeValue = "display: none;z-index: 100;position: fixed;border-top: 1px solid black;background-color: #ffffe1;padding: .5em;left: 0px;bottom: 0px;font: sans-serif medium;font-weight: normal;font-style: normal;width: 100%;"; } footnote.firstChild.setAttributeNode(attr);