var htmltooltip={tipclass:"htmltooltip",fadeeffect:[true,500],anchors:[],tooltips:[],positiontip:function($,tipindex,e){var anchor=this.anchors[tipindex];var tooltip=this.tooltips[tipindex];var scrollLeft=window.pageXOffset?window.pageXOffset:this.iebody.scrollLeft;var scrollTop=window.pageYOffset?window.pageYOffset:this.iebody.scrollTop;var docwidth=(window.innerWidth)?window.innerWidth-15:htmltooltip.iebody.clientWidth-15;var docheight=(window.innerHeight)?window.innerHeight-18:htmltooltip.iebody.clientHeight-15;var tipx=anchor.dimensions.offsetx+anchor.dimensions.w+5;var tipy=anchor.dimensions.offsety+anchor.dimensions.h;tipx=(tipx+tooltip.dimensions.w-scrollLeft>docwidth)?tipx-tooltip.dimensions.w:tipx;tipy=(tipy+tooltip.dimensions.h-scrollTop>docheight)?tipy-tooltip.dimensions.h-anchor.dimensions.h:tipy;$(tooltip).css({left:tipx,top:tipy})},showtip:function($,tipindex,e){var tooltip=this.tooltips[tipindex];if(this.fadeeffect[0]){$(tooltip).hide().fadeIn(this.fadeeffect[1])}else{$(tooltip).show()}},hidetip:function($,tipindex,e){var tooltip=this.tooltips[tipindex];if(this.fadeeffect[0]){$(tooltip).fadeOut(this.fadeeffect[1])}else{$(tooltip).hide()}},updateanchordimensions:function($){var $anchors=$('*[@rel="'+htmltooltip.tipclass+'"]');$anchors.each(function(index){this.dimensions={w:this.offsetWidth,h:this.offsetHeight,offsetx:$(this).offset().left,offsety:$(this).offset().top}})},render:function(){jQuery(document).ready(function($){htmltooltip.iebody=(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;var $anchors=$('*[@rel="'+htmltooltip.tipclass+'"]');var $tooltips=$('div[@class="'+htmltooltip.tipclass+'"]');$anchors.each(function(index){this.dimensions={w:this.offsetWidth,h:this.offsetHeight,offsetx:$(this).offset().left,offsety:$(this).offset().top};this.tippos=index+" pos";var tooltip=$tooltips.eq(index).get(0);if(tooltip==null){return }tooltip.dimensions={w:tooltip.offsetWidth,h:tooltip.offsetHeight};$(tooltip).remove().appendTo("body");htmltooltip.tooltips.push(tooltip);htmltooltip.anchors.push(this);var $anchor=$(this);$anchor.hover(function(e){htmltooltip.positiontip($,parseInt(this.tippos),e);htmltooltip.showtip($,parseInt(this.tippos),e)},function(e){htmltooltip.hidetip($,parseInt(this.tippos),e)});$(window).bind("resize",function(){htmltooltip.updateanchordimensions($)})})})}};htmltooltip.render();
