function tnbBodyClicked(e) { // Hide the search category dropdown if it is open jQuery('#endecasearch .categorylist').hide(); // Clear the breadcrumb cookie if a link was clicked var elm = e.target || e.srcElement; if (jQuery(elm).get(0).nodeName.toLowerCase() == 'a') tnbEraseCookie('breadcrumb'); return false; } function tnbAppendBreadcrumb(e, nid) { var bc = tnbReadCookie('breadcrumb'); if (!bc || bc.length <= 0) bc = []; else bc = bc.split(','); for (var idx=0; idx'); var horizbubble = jQuery('
'); var vertbubble = jQuery('
'); function getMousePos(e) { var posx = 0; var posy = 0; if (!e) var e = window.event; if (e.pageX || e.pageY) { posx = e.pageX; posy = e.pageY; } else if (e.clientX || e.clientY) { posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; } return { x: posx, y: posy }; } jQuery('.has-horiztooltip-bubble').each(function() { var t = jQuery(this); var tip = jQuery('.tooltip-bubble-text', t).html(); if (!tip || tip.length <= 0) return true; function showTooltip(e) { jQuery('.body', horizbubble).html(tip); horizbubble.appendTo(jQuery('body').get(0)); var w = horizbubble.width(); var h = horizbubble.height(); var top = (t.offset().top + (t.height()) + 13); var indicatortop = -14; horizbubble.css( { left: (t.offset().left + (t.width() / 2) - (w / 2)) + 'px', top: top + 'px' } ).appendTo(jQuery('body').get(0)); jQuery('.indicator', horizbubble).css( { left: ((w / 2) - 15) + 'px', top: indicatortop + 'px' } ); } function hideTooltip(e) { horizbubble.remove(); } if (this.addEventListener) { this.addEventListener ("mouseover",showTooltip,false); this.addEventListener ("mouseout",hideTooltip,false); } else if (this.attachEvent) { this.attachEvent ("onmouseover",showTooltip); this.attachEvent ("onmouseout",hideTooltip); } else { this.onmouseover = showTooltip; this.onmouseout = hideTooltip; } }); jQuery('.has-verttooltip-bubble').each(function() { var t = jQuery(this); var tip = jQuery('.tooltip-bubble-text', t).html(); var follow = jQuery(this).hasClass('bubble-follow-mouse') ? true : false; if (!tip || tip.length <= 0) return true; function showTooltip(e) { jQuery('.body', vertbubble).html(tip); vertbubble.appendTo(jQuery('body').get(0)); var w = vertbubble.width(); var h = vertbubble.height(); var top = (t.offset().top + (55/*t.height() / 2*/) - (h / 2)); var windowtop = jQuery(window).scrollTop(); var windowbottom = jQuery(window).height() + windowtop; if (top + h > windowbottom) top = windowbottom - h; if (top < windowtop) top = windowtop; vertbubble.css( { left: (t.offset().left - w - 15) + 'px', top: top + 'px' } ); if (!follow) { var indicatortop = parseInt(t.offset().top - top + 55 - 20); if (indicatortop > h - 65) indicatortop = h - 65; if (indicatortop < 5) indicatortop = 5; jQuery('.indicator', vertbubble).css( { top: indicatortop + 'px' } ); } else { jQuery('.indicator', vertbubble).hide(); } } function hideTooltip(e) { vertbubble.remove(); } function moveTooltip(e) { var pos = getMousePos(e); var x = Math.floor(pos.x - vertbubble.width() - 30); var y = Math.floor(pos.y - vertbubble.height() / 2); var windowtop = jQuery(window).scrollTop(); var windowbottom = jQuery(window).height() + windowtop; if (pos.x < jQuery(window).width() / 2) x = Math.floor(pos.x + 30); if (y + vertbubble.height() > windowbottom) y = windowbottom - vertbubble.height(); if (y < windowtop) y = windowtop; vertbubble.css( { left: x + 'px', top: y + 'px' } ); } if (this.addEventListener) { this.addEventListener ("mouseover",showTooltip,false); this.addEventListener ("mouseout",hideTooltip,false); if (follow) this.addEventListener ("mousemove",moveTooltip,false); } else if (this.attachEvent) { this.attachEvent ("onmouseover",showTooltip); this.attachEvent ("onmouseout",hideTooltip); if (follow) this.attachEvent ("onmousemove",moveTooltip); } else { this.onmouseover = showTooltip; this.onmouseout = hideTooltip; if (follow) this.onmousemove = moveTooltip; } }); jQuery('.tooltip[title]').each(function() { var t = jQuery(this); var tiptitle = t.attr('title'); if (!tiptitle || tiptitle.length <= 0) return true; t.removeAttr('title'); function moveTooltip(e) { var pos = getMousePos(e); var w = tooltip.width(); var h = tooltip.height(); tooltip.css( { left: Math.floor(pos.x) + 'px', top: (pos.y + 25) + 'px' } ).appendTo(jQuery('body').get(0)); } function showTooltip(e) { tooltip.text(tiptitle); tooltip.appendTo(jQuery('body').get(0)); moveTooltip(e); } function hideTooltip(e) { tooltip.remove(); } if (this.addEventListener) { this.addEventListener ("mouseover",showTooltip,false); this.addEventListener ("mouseout",hideTooltip,false); this.addEventListener ("mousemove",moveTooltip,false); } else if (this.attachEvent) { this.attachEvent ("onmouseover",showTooltip); this.attachEvent ("onmouseout",hideTooltip); this.attachEvent ("onmousemove",moveTooltip); } else { this.onmouseover = showTooltip; this.onmouseout = hideTooltip; this.onmousemove = moveTooltip; } }); });