var obj;
var tooltip = {
        
        init: function(){
                                
                obj = document.createElement('div');
                obj.setAttribute('id', 'tooltip');
                
                document.body.appendChild(obj);
                
                window.document.onmousemove = this.move;

                var ancora = document.getElementsByTagName('a');
                
                for(var j = 0; j < ancora.length; j++){
                        
                        var a = ancora[j];
                        
                        var tit_cont = '';
                        var intro_cont = '';
                        
                        for(g=0;g<a.childNodes.length;g++)
                        {
                        	if(a.childNodes[g].className == 'ti'){ tit_cont = a.childNodes[g].innerHTML;}
                        	if(a.childNodes[g].className == 'in'){ intro_cont = a.childNodes[g].innerHTML;}
                        }
                        if(tit_cont.length || intro_cont.length)
                        {
                        	texttitle = '<span class="ti">' + tit_cont + '</span>'
	                        		 + '<span class="in">' + intro_cont + '</span>';
	                        
	                        if(texttitle){
	                                
	                                a.setAttribute('sTitle', texttitle);
	                                a.removeAttribute('title');
	                                
	                                a.onmouseover = function(){
	                                        
	                                        t = this.getAttribute('sTitle');
	                                        
	                                        obj.innerHTML = '<div class="tt"><div class="tb"><div class="t">' + t + '</div></div></div>';
	                                        obj.style.display = 'block';
	                                        
	                                };// end function
	                                
	                                a.onmouseout = function(){
	                                        
	                                        obj.innerHTML = '';
	                                        obj.style.display = 'none';
	                                        
	                                };// end function
	                                
	                        }//end if
                        }
                        
                }//end for
                
        },
        
        move: function(e){
                
                e = e || window.event;
                
                if(e.pageX || e.pageY){
                        
                        x = e.pageX;
                        y = e.pageY;
                        
                }else{
                        
                        x = e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - document.documentElement.clientLeft;
                        y = e.clientY + (document.documentElement.scrollTop ||  document.body.scrollTop) -  document.documentElement.clientTop;
                        
                }//end if
                
                if(x>800) x = x-213;
                
                obj.style.left = (x+13)+'px';
                obj.style.top = (y+20)+'px';
                obj.style.position = 'absolute';
                obj.style.zIndex = 9999;
                
                return true;
                
        }
        
}