/************************************************************************************************************
(C) www.dhtmlgoodies.com, March 2005

This is a script by Stefan Born(http://home.arcor.de/xbo/title-to-note/) featured at www.dhtmlgoodies.com.
You will find this and a lot of other scripts at our website.	

Terms of use:
You are free to use this script as long as the copyright message is kept intact. However, you may not
redistribute, sell or repost it without our permission.

Thank you!

www.dhtmlgoodies.com
Alf Magne Kalleland

************************************************************************************************************/


function abrepop(mypage, myname, w, h, scroll,stat,tool,loca,menu,dir,resi) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',status='+stat+',toolbar='+tool+',location='+loca+',menubar='+menu+',directories='+dir+',resizable='+rese+'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus();
}
}

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", "title2note");
   document.getElementsByTagName("body")[0].appendChild(div);
   document.getElementById("title2note").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("title2note").innerHTML = this.getAttribute("title");
   this.setAttribute("title", "");
   document.getElementById("title2note").style.display = "block";
 },
 hideNote : function()
 {
   this.setAttribute("title", document.getElementById("title2note").innerHTML);
   document.getElementById("title2note").innerHTML = "";
   document.getElementById("title2note").style.display = "none";
 }
}
 /* End Title To Note */
 
//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 */
