var postfix='_hover'; function _hover() { this.mX = 0; this.mY = 0; this.IT = null; this.HC = null; this.over_label=false; this.over_tooltip=false; this.over_tooltip_content=false; this.outtimer=function() { var me=this; setTimeout(function() { if (!me.over_label && !me.over_tooltip && !me.over_tooltip_content) me.out(); },1000); } } _hover.prototype.move = function(e,O) { var hh=this; hh.IT=O; hh.HC = document.getElementById(O.id+postfix); var dw=screen.width, dh=screen.height; if (document.width) dw=document.width-10; else if (document.body.clientWidth) dw=document.body.clientWidth; if (O.className.indexOf('hover_move')!=-1) { if (e.pageX || e.pageY) { hh.mX=e.pageX; hh.mY=e.pageY; } else if (e.clientX || e.clientY) { hh.mX=e.clientX+document.body.scrollLeft; hh.mY=e.clientY+document.body.scrollTop; } } else { var mx=(O.className.indexOf('hover_right')==-1?1/2:1); var my=(O.className.indexOf('hover_top')==-1?1/2:0); var P=getPos(O), w=O.offsetWidth, h=O.offsetHeight; hh.mX=P[0]+mx*w; hh.mY=P[1]+my*h; } var ax=2, ay=2; //if (dwdw) hh.mX=dw-w-ax; //alert(w+" "+hh.mX+" "+ax+" "+dw); this.noout=false; if (this.HC!=undefined) if (this.HC.style!=undefined) { hh.HC.style.top = (hh.mY+ay)+'px'; hh.HC.style.left = (this.mX+ax)+'px'; } } _hover.prototype.set_fix_pos = function(e,O) { var hh=this; hh.over_label=true; if (hh.IT && hh.IT!=this) hh.out(); if (hh.IT!=this) { hh.move(e,O); } hh.HC.onmouseover=function() { hh.over_tooltip=true; } hh.HC.onmouseout=function() { hh.over_tooltip=false; hh.outtimer(); } var children=document.getElementById(O.id+postfix).childNodes; for (var cn in children) if (children[cn].nodeName=='A') { children[cn].onmouseover=function() { hh.over_tooltip_content=true; } children[cn].onmouseout=function() { hh.over_tooltip_content=false; hh.outtimer(); } } } _hover.prototype.init = function() { var hh=this; var A=document.getElementsByClassName( 'hover_move').concat(document.getElementsByClassName('hover_click')).concat(document.getElementsByClassName('hover_fix')); for (var i=0; i