(function(b){b.fn.tooltip=function(i){var a={container:undefined,img:undefined,text:undefined,width:undefined,height:undefined,follow:undefined,offset:{top:10,left:15}};b.extend(a,i);var c=b("#ttContainerDiv");if(!c.length||c.length<=0){if(typeof a.container==="string")b('<div id="ttContainerDiv" class="ui-corner-all ui-widget-content ui-widget" style="padding:1em;display:none;position:fixed"> <img src="#" id="ttImage" height="400px" width="250px" /><span id="ttText"></span></div>').appendTo(a.container);
else a.container instanceof jQuery?a.container.append('<div id="ttContainerDiv" class="ui-corner-all ui-widget-content ui-widget" style="padding:1em;display:none;position:fixed"> <img src="#" id="ttImage" height="400px" width="250px" /><span id="ttText"></span></div>'):b('<div id="ttContainerDiv" class="ui-corner-all ui-widget-content ui-widget" style="padding:1em;display:none;position:fixed"> <img src="#" id="ttImage" height="400px" width="250px" /><span id="ttText"></span></div>').appendTo("body");
c=b("#ttContainerDiv")}var e=b("#ttImage"),d=b("#ttText");this.each(function(){var f=b(this).attr("title");if(f||a.text||a.img)b(this).hover(function(g){b(this).attr("title","");c.css({width:"",height:""});if(a.img){e.attr("src",a.img);e.show();d.hide()}else{d.text(a.text?a.text:f);e.hide();d.show()}a.width&&c.width()>a.width&&c.width(a.width);a.height&&c.height()>a.height&&c.height(a.height);a.follow?b(this).mousemove(function(h){c.css({top:h.clientY+a.offset.top,left:h.clientX+a.offset.left})}):
c.css({top:g.clientY+a.offset.top,left:g.clientX+a.offset.left});c.show()},function(){a.follow&&b(this).unbind("mousemove");c.hide();d.text("");b(this).attr("title",f)})})}})(jQuery);
