OSDN Git Service

FIX:ページをスクロールしている状態での動作を修正。
authorreine <reine@users.sourceforge.jp>
Sun, 27 May 2012 15:36:32 +0000 (00:36 +0900)
committerreine <reine@users.sourceforge.jp>
Sun, 27 May 2012 15:37:33 +0000 (00:37 +0900)
skins/default/nicetitle.js

index c8f073f..3ad5f4a 100644 (file)
-// from http://www.kryogenix.org
-// by Scott Andrew - http://scottandrew.com
-// add an eventlistener to browsers that can do it somehow.
-function addEvent(obj, evType, fn)
-       {
-       if (obj.addEventListener)
-               {
-               obj.addEventListener(evType, fn, false);
-               return true;
-               }
-       else if (obj.attachEvent)
-               {
-               var r = obj.attachEvent('on'+evType, fn);
-               return r;
-               }
-       else
-               {
-               return false;
-               }
-       }
-
-function floatImages()
-       {
-       // adapted from http://www.dithered.com/javascript/browser_detect/
-       //**************************************************************//
-       // sniff user agent
-       var userAgent = navigator.userAgent.toLowerCase();
-
-       // if Mozilla 1.4 then quit
-       if ((userAgent.indexOf('gecko') != -1) && (userAgent.indexOf('gecko/') + 14 == userAgent.length) && (parseFloat(userAgent.substring(userAgent.indexOf('rv:') + 3)) == '1.4')) return;
-
-       // if Opera then quit
-       if (document.all && window.Event) return;
-       //**************************************************************//
-
-       // check this browser can cope with what we want to do
-       if (!document.getElementById) return;
-       var blogDiv = document.getElementById('blog');
-       if (!blogDiv) return;
-       if (!blogDiv.offsetWidth) return;
-
-       blogDiv.className = (blogDiv.offsetWidth >= 500) ? "float-images" : "block-images";
-       }
-
-// Blockquote citations
-
-// Simon Willison's work:
-// http://simon.incutio.com/archive/2002/12/20/#blockquoteCitations
-
-// Also Dunstan Orchard's work:
-// http://1976design.com/blog/archive/2003/11/10/updates/
-function blockquoteCite()
-       {
-       if (!document.createElementNS)
-               {
-               document.createElementNS = function(ns, elt)
-                       {
-                       return document.createElement(elt);
-                       }
-               }
-       quotes = document.getElementsByTagName('blockquote');
-       for (i = 0; i < quotes.length; i++)
-               {
-               var cite = quotes[i].getAttribute('cite');
-               // value of cite attribute should only contain URI, not any other
-               if ((cite) && (cite != ''))
-                       {
-                       newlink = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
-                       newlink.setAttribute('href', cite);
-                       newlink.className = 'cite-link';
-                       newlink.appendChild(document.createTextNode(cite));
-                       newdiv = document.createElementNS('http://www.w3.org/1999/xhtml', 'cite');
-                       newdiv.className = 'blockquote-cite';
-                       newdiv.appendChild(document.createTextNode('Source: '));
-                       newdiv.appendChild(newlink);
-                       quotes[i].appendChild(newdiv);
-                       quotes[i].removeAttribute('cite');
-                       }
-               }
-       }
-
-// Ins and Del tags citations
-function insdelCite()
-       {
-       if (!document.createElementNS)
-               {
-               document.createElementNS = function(ns, elt)
-                       {
-                       return document.createElement(elt);
-                       }
-               }
-       var insdel = new Array(2);
-       insdel[0] = document.getElementsByTagName('ins');
-       insdel[1] = document.getElementsByTagName('del');
-       for (var i=0; i<insdel.length; i++)
-               {
-               if (insdel[i])
-                       {
-                       for (var id=0; id<insdel[i].length; id++)
-                               {
-                               var isdl = insdel[i][id].getAttribute('cite');
-                               if ((isdl) && (isdl != ""))
-                                       {
-                                       idlink = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
-                                       idlink.setAttribute('href', isdl);
-                                       idlink.className = 'cite-link ' + (i == 0 ? 'ins-cite' : 'del-cite');
-                                       idlink.setAttribute('title','citation of ' + (i == 0 ? 'added' : 'deleted') + ' text');
-                                       idlink.appendChild(document.createTextNode('#'));
-                                       insdel[i][id].appendChild(idlink);
-                                       insdel[i][id].removeAttribute('cite');
-                                       }
-                               }
-                       }
-               }
-       }
-
-// Force IE not to show alternate text as tooltip
-function noAltTooltip()
-       {
-       images = document.getElementsByTagName('img');
-       for (var i = 0; i < images.length; i++)
-               {
-               var title = images[i].getAttribute('title');
-               var alt = images[i].getAttribute('alt');
-               if ((document.all) && (alt) && (!title))
-                       {
-                       images[i].setAttribute('title', '');
-                       }
-               }
-       }
-
-// Nice Titles
-
-// original code by Stuart Langridge 2003-11
-// with additions to the code by other good people
-// http://www.kryogenix.org/code/browser/nicetitle/
-// thank you, sir
-
-// modified by Peter Janes 2003-03-25
-// http://peterjanes.ca/blog/archives/2003/03/25/nicetitles-for-ins-and-del
-// added in ins and del tags
-
-// modified by Dunstan Orchard 2003-11-18
-// http://1976design.com/blog/
-// added in accesskey information
-// tried ever-so-hard, but couldn't work out how to do what Ethan did
-
-// final genius touch by by Ethan Marcotte 2003-11-18
-// http://www.sidesh0w.com/
-// worked out how to delay showing the popups to make them more like the browser's own
-
-// set the namespace
-var XHTMLNS = 'http://www.w3.org/1999/xhtml';
-var CURRENT_NICE_TITLE;
-
-// browser sniff
-var browser = new Browser();
-
-// determine browser and version.
-function Browser()
-       {
-       var ua, s, i;
-
-       this.isIE = false;
-       this.isNS = false;
-       this.version = null;
-
-       ua = navigator.userAgent;
-
-       s = 'MSIE';
-       if ((i = ua.indexOf(s)) >= 0)
-               {
-               this.isIE = true;
-               this.version = parseFloat(ua.substr(i + s.length));
-               return;
-               }
-
-       s = 'Netscape6/';
-       if ((i = ua.indexOf(s)) >= 0)
-               {
-               this.isNS = true;
-               this.version = parseFloat(ua.substr(i + s.length));
-               return;
-               }
-
-       // treat any other 'Gecko' browser as NS 6.1.
-       s = 'Gecko';
-       if ((i = ua.indexOf(s)) >= 0)
-               {
-               this.isNS = true;
-               this.version = 6.1;
-               return;
-               }
-       }
-
-// 2003-11-19 sidesh0w
-// set delay vars to emulate normal hover delay
-var delay;
-var interval = 0.60;
-
-// this function runs on window load
-// it runs through all the links on the page as starts listening for actions
-function makeNiceTitles()
-       {
-       if (!document.createElement || !document.getElementsByTagName) return;
-       if (!document.createElementNS)
-               {
-               document.createElementNS = function(ns, elt)
-                       {
-                       return document.createElement(elt);
-                       }
-               }
-
-       // do regular links
-       if (!document.links)
-               {
-               document.links = document.getElementsByTagName('a');
-               }
-       for (var ti=0; ti<document.links.length; ti++)
-               {
-               var lnk = document.links[ti];
-               // * I added specific class names here..
-               if (lnk.title)
-                       {
-                       lnk.setAttribute('nicetitle', lnk.title);
-                       lnk.removeAttribute('title');
-                       addEvent(lnk, 'mouseover', showNiceTitle);
-                       addEvent(lnk, 'mousemove', moveNiceTitle);
-                       addEvent(lnk, 'mouseout', hideNiceTitle);
-                       addEvent(lnk, 'focus', showNiceTitle);
-                       addEvent(lnk, 'blur', hideNiceTitle);
-                       }
-               }
-
-       // 2003-03-25 Peter Janes
-       // do ins and del tags
-       var tags = new Array(2);
-       tags[0] = document.getElementsByTagName('ins');
-       tags[1] = document.getElementsByTagName('del');
-       for (var tt=0; tt<tags.length; tt++)
-               {
-               if (tags[tt])
-                       {
-                       for (var ti=0; ti<tags[tt].length; ti++)
-                               {
-                               var tag = tags[tt][ti];
-                               if (tag.dateTime)
-                                       {
-                                       var strDate = tag.dateTime;
-                                       // HTML/ISO8601 date: yyyy-mm-ddThh:mm:ssTZD (Z, -hh:mm, +hh:mm)
-                                       var month = strDate.substring(5,7);
-                                       var day = strDate.substring(8,10);
-                                       if (month[0] == '0')
-                                               {
-                                               month = month[1];
-                                               }
-                                       if (day[0] == '0')
-                                               {
-                                               day = day[1];
-                                               }
-                                       var dtIns = new Date(strDate.substring(0,4), month-1, day, strDate.substring(11,13), strDate.substring(14,16), strDate.substring(17,19));
-                                       tag.setAttribute('nicetitle', (tt == 0 ? 'Added' : 'Deleted') + ' on ' + dtIns.toString());
-                                       addEvent(tag, 'mouseover', showNiceTitle);
-                                       addEvent(tag, 'mousemove', moveNiceTitle);
-                                       addEvent(tag, 'mouseout', hideNiceTitle);
-                                       addEvent(tag, 'focus', showNiceTitle);
-                                       addEvent(tag, 'blur', hideNiceTitle);
-                                       }
-                               }
-                       }
-               }
-       }
-
-function findPosition(oLink)
-       {
-       if (oLink.offsetParent)
-               {
-               for (var posX = 0, posY = 0; oLink.offsetParent; oLink = oLink.offsetParent)
-                       {
-                       posX += oLink.offsetLeft;
-                       posY += oLink.offsetTop;
-                       }
-               return [posX, posY];
-               }
-       else
-               {
-               return [oLink.x, oLink.y];
-               }
-       }
-
-function getParent(el, pTagName)
-       {
-       if (el == null)
-               {
-               return null;
-               }
-       // gecko bug, supposed to be uppercase
-       else if (el.nodeType == 1 && el.tagName.toLowerCase() == pTagName.toLowerCase())
-               {
-               return el;
-               }
-       else
-               {
-               return getParent(el.parentNode, pTagName);
-               }
-       }
-
-// 2003-11-19 sidesh0w
-// trailerpark wrapper function
-function showDelay()
-       {
-       if (CURRENT_NICE_TITLE)
-               {
-               CURRENT_NICE_TITLE.style.display = '';
-               }
-       }
-
-// build and show the nice titles
-function showNiceTitle(e)
-       {
-       if (CURRENT_NICE_TITLE) hideNiceTitle(CURRENT_NICE_TITLE);
-       if (!document.getElementsByTagName) return;
-
-       if (window.event && window.event.srcElement)
-               {
-               lnk = window.event.srcElement
-               }
-       else if (e && e.target)
-               {
-               lnk = e.target
-               }
-       if (!lnk) return;
-
-       // lnk is a textnode or an elementnode that's not ins/del
-       if (lnk.nodeType == 3 || (lnk.nodeType == 1 && lnk.tagName.toLowerCase() != 'ins' && lnk.tagName.toLowerCase() != 'del'))
-               {
-               // ascend parents until we hit a link
-               lnk = getParent(lnk, 'a');
-               }
-
-        nicetitle = lnk.getAttribute('nicetitle');
-
-       var d = document.createElementNS(XHTMLNS, 'div');
-       d.className = 'nicetitle';
-       var dc = document.createElementNS(XHTMLNS, 'div');
-       dc.className = 'nicetitle-content';
-       d.appendChild(dc);
-       tnt = document.createTextNode(nicetitle);
-       pat = document.createElementNS(XHTMLNS, 'p');
-       pat.className = 'titletext';
-       pat.appendChild(tnt);
-
-       // 2003-11-18 Dunstan Orchard
-       // added in accesskey info
-       if (lnk.accessKey)
-               {
-               axs = document.createTextNode(' [' + lnk.accessKey + ']');
-               axsk = document.createElementNS(XHTMLNS, 'span');
-               axsk.className = 'accesskey';
-               axsk.appendChild(axs);
-               pat.appendChild(axsk);
-               }
-       dc.appendChild(pat);
-
-       if (lnk.href)
-               {
-               tnd = document.createTextNode(lnk.href);
-               pad = document.createElementNS(XHTMLNS, 'p');
-               pad.className = 'destination';
-               pad.appendChild(tnd);
-               dc.appendChild(pad);
-               }
-
-       STD_WIDTH = 300;
-
-       if (lnk.href)
-               {
-               h = lnk.href.length;
-               }
-       else
-               {
-               h = nicetitle.length;
-               }
-
-       if (nicetitle.length)
-               {
-               t = nicetitle.length;
-               }
-
-       h_pixels = h*6;
-       t_pixels = t*10;
-
-       if (t_pixels > STD_WIDTH)
-               {
-               w = t_pixels;
-               }
-       else if ((STD_WIDTH > t_pixels) && (t_pixels > h_pixels))
-               {
-               w = t_pixels;
-               }
-       else if ((STD_WIDTH > h_pixels) && (h_pixels > t_pixels))
-               {
-               w = h_pixels;
-               }
-       else
-               {
-               w = STD_WIDTH;
-               }
-
-       d.style.width = w + 'px';
-       d.style.display = 'none';
-
-       document.getElementsByTagName('body')[0].appendChild(d);
-
-       CURRENT_NICE_TITLE = d;
-
-       moveNiceTitle(e);
-
-       delay = setTimeout("showDelay()", interval * 1000);
-       }
-
-function moveNiceTitle(e)
-       {
-       if (!document.getElementsByTagName) return;
-       if (!CURRENT_NICE_TITLE) return;
-
-       if (document.all)
-               {
-               X = document.body.scrollLeft + window.event.clientX;
-               }
-       else if (document.layers || document.getElementById)
-               {
-               X = e.pageX;
-               }
-       w_title = Number(CURRENT_NICE_TITLE.style.width.replace(/^(\d+).*$/, '$1'));
-       if (w_title + X > (window.innerWidth - 20))
-               {
-               X = window.innerWidth - w_title - 20;
-               }
-
-       if (document.all)
-               {
-               Y = document.body.scrollTop + window.event.clientY;
-               }
-       else if (document.layers || document.getElementById)
-               {
-               Y = e.pageY;
-               }
-       if (Y > (window.innerHeight - 60))
-               {
-               Y = Y - 25 - 60;
-               }
-       
-       CURRENT_NICE_TITLE.style.left = X + 'px';
-       CURRENT_NICE_TITLE.style.top = (Y + 25) + 'px';
-       }
-
-function hideNiceTitle(e)
-       {
-       // 2003-11-19 sidesh0w
-       // clearTimeout
-       if (delay) clearTimeout(delay);
-       if (!document.getElementsByTagName) return;
-       if (CURRENT_NICE_TITLE)
-               {
-               document.getElementsByTagName('body')[0].removeChild(CURRENT_NICE_TITLE);
-               CURRENT_NICE_TITLE = null;
-               }
-       }
-
-addEvent(window, "load", floatImages);
-addEvent(window, "resize", floatImages);
-addEvent(window, "load", blockquoteCite);
-addEvent(window, "load", insdelCite);
-addEvent(window, "load", noAltTooltip);
-addEvent(window, "load", makeNiceTitles);
-
-// I'm very poor in JavaScript. Please correct me if I'm wrong.
+// from http://www.kryogenix.org\r
+// by Scott Andrew - http://scottandrew.com\r
+// add an eventlistener to browsers that can do it somehow.\r
+function addEvent(obj, evType, fn)\r
+       {\r
+       if (obj.addEventListener)\r
+               {\r
+               obj.addEventListener(evType, fn, false);\r
+               return true;\r
+               }\r
+       else if (obj.attachEvent)\r
+               {\r
+               var r = obj.attachEvent('on'+evType, fn);\r
+               return r;\r
+               }\r
+       else\r
+               {\r
+               return false;\r
+               }\r
+       }\r
+\r
+function floatImages()\r
+       {\r
+       // adapted from http://www.dithered.com/javascript/browser_detect/\r
+       //**************************************************************//\r
+       // sniff user agent\r
+       var userAgent = navigator.userAgent.toLowerCase();\r
+\r
+       // if Mozilla 1.4 then quit\r
+       if ((userAgent.indexOf('gecko') != -1) && (userAgent.indexOf('gecko/') + 14 == userAgent.length) && (parseFloat(userAgent.substring(userAgent.indexOf('rv:') + 3)) == '1.4')) return;\r
+\r
+       // if Opera then quit\r
+       if (document.all && window.Event) return;\r
+       //**************************************************************//\r
+\r
+       // check this browser can cope with what we want to do\r
+       if (!document.getElementById) return;\r
+       var blogDiv = document.getElementById('blog');\r
+       if (!blogDiv) return;\r
+       if (!blogDiv.offsetWidth) return;\r
+\r
+       blogDiv.className = (blogDiv.offsetWidth >= 500) ? "float-images" : "block-images";\r
+       }\r
+\r
+// Blockquote citations\r
+\r
+// Simon Willison's work:\r
+// http://simon.incutio.com/archive/2002/12/20/#blockquoteCitations\r
+\r
+// Also Dunstan Orchard's work:\r
+// http://1976design.com/blog/archive/2003/11/10/updates/\r
+function blockquoteCite()\r
+       {\r
+       if (!document.createElementNS)\r
+               {\r
+               document.createElementNS = function(ns, elt)\r
+                       {\r
+                       return document.createElement(elt);\r
+                       }\r
+               }\r
+       quotes = document.getElementsByTagName('blockquote');\r
+       for (i = 0; i < quotes.length; i++)\r
+               {\r
+               var cite = quotes[i].getAttribute('cite');\r
+               // value of cite attribute should only contain URI, not any other\r
+               if ((cite) && (cite != ''))\r
+                       {\r
+                       newlink = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');\r
+                       newlink.setAttribute('href', cite);\r
+                       newlink.className = 'cite-link';\r
+                       newlink.appendChild(document.createTextNode(cite));\r
+                       newdiv = document.createElementNS('http://www.w3.org/1999/xhtml', 'cite');\r
+                       newdiv.className = 'blockquote-cite';\r
+                       newdiv.appendChild(document.createTextNode('Source: '));\r
+                       newdiv.appendChild(newlink);\r
+                       quotes[i].appendChild(newdiv);\r
+                       quotes[i].removeAttribute('cite');\r
+                       }\r
+               }\r
+       }\r
+\r
+// Ins and Del tags citations\r
+function insdelCite()\r
+       {\r
+       if (!document.createElementNS)\r
+               {\r
+               document.createElementNS = function(ns, elt)\r
+                       {\r
+                       return document.createElement(elt);\r
+                       }\r
+               }\r
+       var insdel = new Array(2);\r
+       insdel[0] = document.getElementsByTagName('ins');\r
+       insdel[1] = document.getElementsByTagName('del');\r
+       for (var i=0; i<insdel.length; i++)\r
+               {\r
+               if (insdel[i])\r
+                       {\r
+                       for (var id=0; id<insdel[i].length; id++)\r
+                               {\r
+                               var isdl = insdel[i][id].getAttribute('cite');\r
+                               if ((isdl) && (isdl != ""))\r
+                                       {\r
+                                       idlink = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');\r
+                                       idlink.setAttribute('href', isdl);\r
+                                       idlink.className = 'cite-link ' + (i == 0 ? 'ins-cite' : 'del-cite');\r
+                                       idlink.setAttribute('title','citation of ' + (i == 0 ? 'added' : 'deleted') + ' text');\r
+                                       idlink.appendChild(document.createTextNode('#'));\r
+                                       insdel[i][id].appendChild(idlink);\r
+                                       insdel[i][id].removeAttribute('cite');\r
+                                       }\r
+                               }\r
+                       }\r
+               }\r
+       }\r
+\r
+// Force IE not to show alternate text as tooltip\r
+function noAltTooltip()\r
+       {\r
+       images = document.getElementsByTagName('img');\r
+       for (var i = 0; i < images.length; i++)\r
+               {\r
+               var title = images[i].getAttribute('title');\r
+               var alt = images[i].getAttribute('alt');\r
+               if ((document.all) && (alt) && (!title))\r
+                       {\r
+                       images[i].setAttribute('title', '');\r
+                       }\r
+               }\r
+       }\r
+\r
+// Nice Titles\r
+\r
+// original code by Stuart Langridge 2003-11\r
+// with additions to the code by other good people\r
+// http://www.kryogenix.org/code/browser/nicetitle/\r
+// thank you, sir\r
+\r
+// modified by Peter Janes 2003-03-25\r
+// http://peterjanes.ca/blog/archives/2003/03/25/nicetitles-for-ins-and-del\r
+// added in ins and del tags\r
+\r
+// modified by Dunstan Orchard 2003-11-18\r
+// http://1976design.com/blog/\r
+// added in accesskey information\r
+// tried ever-so-hard, but couldn't work out how to do what Ethan did\r
+\r
+// final genius touch by by Ethan Marcotte 2003-11-18\r
+// http://www.sidesh0w.com/\r
+// worked out how to delay showing the popups to make them more like the browser's own\r
+\r
+// set the namespace\r
+var XHTMLNS = 'http://www.w3.org/1999/xhtml';\r
+var CURRENT_NICE_TITLE;\r
+\r
+// browser sniff\r
+var browser = new Browser();\r
+\r
+// determine browser and version.\r
+function Browser()\r
+       {\r
+       var ua, s, i;\r
+\r
+       this.isIE = false;\r
+       this.isNS = false;\r
+       this.version = null;\r
+\r
+       ua = navigator.userAgent;\r
+\r
+       s = 'MSIE';\r
+       if ((i = ua.indexOf(s)) >= 0)\r
+               {\r
+               this.isIE = true;\r
+               this.version = parseFloat(ua.substr(i + s.length));\r
+               return;\r
+               }\r
+\r
+       s = 'Netscape6/';\r
+       if ((i = ua.indexOf(s)) >= 0)\r
+               {\r
+               this.isNS = true;\r
+               this.version = parseFloat(ua.substr(i + s.length));\r
+               return;\r
+               }\r
+\r
+       // treat any other 'Gecko' browser as NS 6.1.\r
+       s = 'Gecko';\r
+       if ((i = ua.indexOf(s)) >= 0)\r
+               {\r
+               this.isNS = true;\r
+               this.version = 6.1;\r
+               return;\r
+               }\r
+       }\r
+\r
+// 2003-11-19 sidesh0w\r
+// set delay vars to emulate normal hover delay\r
+var delay;\r
+var interval = 0.60;\r
+\r
+// this function runs on window load\r
+// it runs through all the links on the page as starts listening for actions\r
+function makeNiceTitles()\r
+       {\r
+       if (!document.createElement || !document.getElementsByTagName) return;\r
+       if (!document.createElementNS)\r
+               {\r
+               document.createElementNS = function(ns, elt)\r
+                       {\r
+                       return document.createElement(elt);\r
+                       }\r
+               }\r
+\r
+       // do regular links\r
+       if (!document.links)\r
+               {\r
+               document.links = document.getElementsByTagName('a');\r
+               }\r
+       for (var ti=0; ti<document.links.length; ti++)\r
+               {\r
+               var lnk = document.links[ti];\r
+               // * I added specific class names here..\r
+               if (lnk.title)\r
+                       {\r
+                       lnk.setAttribute('nicetitle', lnk.title);\r
+                       lnk.removeAttribute('title');\r
+                       addEvent(lnk, 'mouseover', showNiceTitle);\r
+                       addEvent(lnk, 'mousemove', moveNiceTitle);\r
+                       addEvent(lnk, 'mouseout', hideNiceTitle);\r
+                       addEvent(lnk, 'focus', showNiceTitle);\r
+                       addEvent(lnk, 'blur', hideNiceTitle);\r
+                       }\r
+               }\r
+\r
+       // 2003-03-25 Peter Janes\r
+       // do ins and del tags\r
+       var tags = new Array(2);\r
+       tags[0] = document.getElementsByTagName('ins');\r
+       tags[1] = document.getElementsByTagName('del');\r
+       for (var tt=0; tt<tags.length; tt++)\r
+               {\r
+               if (tags[tt])\r
+                       {\r
+                       for (var ti=0; ti<tags[tt].length; ti++)\r
+                               {\r
+                               var tag = tags[tt][ti];\r
+                               if (tag.dateTime)\r
+                                       {\r
+                                       var strDate = tag.dateTime;\r
+                                       // HTML/ISO8601 date: yyyy-mm-ddThh:mm:ssTZD (Z, -hh:mm, +hh:mm)\r
+                                       var month = strDate.substring(5,7);\r
+                                       var day = strDate.substring(8,10);\r
+                                       if (month[0] == '0')\r
+                                               {\r
+                                               month = month[1];\r
+                                               }\r
+                                       if (day[0] == '0')\r
+                                               {\r
+                                               day = day[1];\r
+                                               }\r
+                                       var dtIns = new Date(strDate.substring(0,4), month-1, day, strDate.substring(11,13), strDate.substring(14,16), strDate.substring(17,19));\r
+                                       tag.setAttribute('nicetitle', (tt == 0 ? 'Added' : 'Deleted') + ' on ' + dtIns.toString());\r
+                                       addEvent(tag, 'mouseover', showNiceTitle);\r
+                                       addEvent(tag, 'mousemove', moveNiceTitle);\r
+                                       addEvent(tag, 'mouseout', hideNiceTitle);\r
+                                       addEvent(tag, 'focus', showNiceTitle);\r
+                                       addEvent(tag, 'blur', hideNiceTitle);\r
+                                       }\r
+                               }\r
+                       }\r
+               }\r
+       }\r
+\r
+function findPosition(oLink)\r
+       {\r
+       if (oLink.offsetParent)\r
+               {\r
+               for (var posX = 0, posY = 0; oLink.offsetParent; oLink = oLink.offsetParent)\r
+                       {\r
+                       posX += oLink.offsetLeft;\r
+                       posY += oLink.offsetTop;\r
+                       }\r
+               return [posX, posY];\r
+               }\r
+       else\r
+               {\r
+               return [oLink.x, oLink.y];\r
+               }\r
+       }\r
+\r
+function getParent(el, pTagName)\r
+       {\r
+       if (el == null)\r
+               {\r
+               return null;\r
+               }\r
+       // gecko bug, supposed to be uppercase\r
+       else if (el.nodeType == 1 && el.tagName.toLowerCase() == pTagName.toLowerCase())\r
+               {\r
+               return el;\r
+               }\r
+       else\r
+               {\r
+               return getParent(el.parentNode, pTagName);\r
+               }\r
+       }\r
+\r
+// 2003-11-19 sidesh0w\r
+// trailerpark wrapper function\r
+function showDelay()\r
+       {\r
+       if (CURRENT_NICE_TITLE)\r
+               {\r
+               CURRENT_NICE_TITLE.style.display = '';\r
+               }\r
+       }\r
+\r
+// build and show the nice titles\r
+function showNiceTitle(e)\r
+       {\r
+       if (CURRENT_NICE_TITLE) hideNiceTitle(CURRENT_NICE_TITLE);\r
+       if (!document.getElementsByTagName) return;\r
+\r
+       if (window.event && window.event.srcElement)\r
+               {\r
+               lnk = window.event.srcElement\r
+               }\r
+       else if (e && e.target)\r
+               {\r
+               lnk = e.target\r
+               }\r
+       if (!lnk) return;\r
+\r
+       // lnk is a textnode or an elementnode that's not ins/del\r
+       if (lnk.nodeType == 3 || (lnk.nodeType == 1 && lnk.tagName.toLowerCase() != 'ins' && lnk.tagName.toLowerCase() != 'del'))\r
+               {\r
+               // ascend parents until we hit a link\r
+               lnk = getParent(lnk, 'a');\r
+               }\r
+\r
+        nicetitle = lnk.getAttribute('nicetitle');\r
+\r
+       var d = document.createElementNS(XHTMLNS, 'div');\r
+       d.className = 'nicetitle';\r
+       var dc = document.createElementNS(XHTMLNS, 'div');\r
+       dc.className = 'nicetitle-content';\r
+       d.appendChild(dc);\r
+       tnt = document.createTextNode(nicetitle);\r
+       pat = document.createElementNS(XHTMLNS, 'p');\r
+       pat.className = 'titletext';\r
+       pat.appendChild(tnt);\r
+\r
+       // 2003-11-18 Dunstan Orchard\r
+       // added in accesskey info\r
+       if (lnk.accessKey)\r
+               {\r
+               axs = document.createTextNode(' [' + lnk.accessKey + ']');\r
+               axsk = document.createElementNS(XHTMLNS, 'span');\r
+               axsk.className = 'accesskey';\r
+               axsk.appendChild(axs);\r
+               pat.appendChild(axsk);\r
+               }\r
+       dc.appendChild(pat);\r
+\r
+       if (lnk.href)\r
+               {\r
+               tnd = document.createTextNode(lnk.href);\r
+               pad = document.createElementNS(XHTMLNS, 'p');\r
+               pad.className = 'destination';\r
+               pad.appendChild(tnd);\r
+               dc.appendChild(pad);\r
+               }\r
+\r
+       STD_WIDTH = 300;\r
+\r
+       if (lnk.href)\r
+               {\r
+               h = lnk.href.length;\r
+               }\r
+       else\r
+               {\r
+               h = nicetitle.length;\r
+               }\r
+\r
+       if (nicetitle.length)\r
+               {\r
+               t = nicetitle.length;\r
+               }\r
+\r
+       h_pixels = h*6;\r
+       t_pixels = t*10;\r
+\r
+       if (t_pixels > STD_WIDTH)\r
+               {\r
+               w = t_pixels;\r
+               }\r
+       else if ((STD_WIDTH > t_pixels) && (t_pixels > h_pixels))\r
+               {\r
+               w = t_pixels;\r
+               }\r
+       else if ((STD_WIDTH > h_pixels) && (h_pixels > t_pixels))\r
+               {\r
+               w = h_pixels;\r
+               }\r
+       else\r
+               {\r
+               w = STD_WIDTH;\r
+               }\r
+\r
+       d.style.width = w + 'px';\r
+       d.style.display = 'none';\r
+\r
+       document.getElementsByTagName('body')[0].appendChild(d);\r
+\r
+       CURRENT_NICE_TITLE = d;\r
+\r
+       moveNiceTitle(e);\r
+\r
+       delay = setTimeout("showDelay()", interval * 1000);\r
+       }\r
+\r
+function moveNiceTitle(e)\r
+       {\r
+       if (!document.getElementsByTagName) return;\r
+       if (!CURRENT_NICE_TITLE) return;\r
+\r
+       if (document.all)\r
+               {\r
+               X = document.body.scrollLeft + window.event.clientX;\r
+               }\r
+       else if (document.layers || document.getElementById)\r
+               {\r
+               X = e.pageX;\r
+               }\r
+       w_title = Number(CURRENT_NICE_TITLE.style.width.replace(/^(\d+).*$/, '$1'));\r
+       if (w_title + X > (window.innerWidth + (document.documentElement.scrollLeft || window.pageXOffset) - 20))\r
+               {\r
+               X = (window.innerWidth + (document.documentElement.scrollLeft || window.pageXOffset) - 20) - w_title;\r
+               }\r
+\r
+       if (document.all)\r
+               {\r
+               Y = document.body.scrollTop + window.event.clientY;\r
+               }\r
+       else if (document.layers || document.getElementById)\r
+               {\r
+               Y = e.pageY;\r
+               }\r
+       if (Y > (window.innerHeight + (document.documentElement.scrollTop || window.pageYOffset) - 60))\r
+               {\r
+               Y = Y - 25 - 60;\r
+               }\r
+       \r
+       CURRENT_NICE_TITLE.style.left = X + 'px';\r
+       CURRENT_NICE_TITLE.style.top = (Y + 25) + 'px';\r
+       }\r
+\r
+function hideNiceTitle(e)\r
+       {\r
+       // 2003-11-19 sidesh0w\r
+       // clearTimeout\r
+       if (delay) clearTimeout(delay);\r
+       if (!document.getElementsByTagName) return;\r
+       if (CURRENT_NICE_TITLE)\r
+               {\r
+               document.getElementsByTagName('body')[0].removeChild(CURRENT_NICE_TITLE);\r
+               CURRENT_NICE_TITLE = null;\r
+               }\r
+       }\r
+\r
+addEvent(window, "load", floatImages);\r
+addEvent(window, "resize", floatImages);\r
+addEvent(window, "load", blockquoteCite);\r
+addEvent(window, "load", insdelCite);\r
+addEvent(window, "load", noAltTooltip);\r
+addEvent(window, "load", makeNiceTitles);\r
+\r
+// I'm very poor in JavaScript. Please correct me if I'm wrong.\r