
var titleToNote = {
 // Define which elements should be affected:
 elements : ['a', 'img'],
 setup : function(){
 if(!document.getElementById || !document.createElement) return;
   // create note
   var div = document.createElement("div");
   div.setAttribute("id", "titletooltip");
   document.getElementsByTagName("body")[0].appendChild(div);
   document.getElementById("titletooltip").style.display = "none";
   // attach events
   for(j=0;j<titleToNote.elements.length;j++){
     for(i=0;i<document.getElementsByTagName(titleToNote.elements[j]).length;i++){
       var el = document.getElementsByTagName(titleToNote.elements[j])[i];
       if(el.getAttribute("title") && el.getAttribute("title") != ""){
         el.onmouseover = titleToNote.showNote;
         el.onmouseout = titleToNote.hideNote;
       }
     }
   }
 },
 showNote : function()
 {
   document.getElementById("titletooltip").innerHTML = this.getAttribute("title");
   this.setAttribute("title", "");
   document.getElementById("titletooltip").style.display = "block";
 },
 hideNote : function()
 {
   this.setAttribute("title", document.getElementById("titletooltip").innerHTML);
   document.getElementById("titletooltip").style.display = "none";
   document.getElementById("titletooltip").innerHTML = "";
 }
}
//Onload Handling 
var oldonload=window.onload;if(typeof window.onload!='function'){
window.onload=titleToNote.setup;
}else{window.onload=function(){oldonload();
titleToNote.setup();}}
/* setup faster by deleting these lines and adding <script type="text/javascript">titleToNote.setup();</script>before the closing body tag in your HTML */
