(function(a){a.fn.jHelperTip=function(d,c){var f=a.extend({},a.fn.jHelperTip.defaults,d);if(a(f.ttC).length==0){a('<div id="'+f.ttC.slice(1)+'"></div>').appendTo("body")}if(a(f.dC).length==0){a('<div id="'+f.dC.slice(1)+'"></div>').appendTo("body")}if(a(f.aC).length==0){a('<div id="'+f.aC.slice(1)+'"></div>').appendTo("body")}a(f.ttC).add(f.aC).css({position:"absolute",display:"inline"}).hide();a(f.dC).hide();var g=function(){if(f.source=="attribute"){a(f.aC).hide().empty()}else{a(f.ttC).hide().empty()}};a(".jHelperTipClose").bind("click",g);a(f.ttC).bind("mouseover",function(){a(f.ttC).show();return false});var b=function(i,h){if(f.source=="ajax"){e(h);a(f.ttC).html('<div><img src="'+f.loadingImg+'"/> '+f.loadingText+"</div>").show();a.ajax({type:f.type,url:f.url,data:f.data,success:function(j){a(f.ttC).html(j);a(".jHelperTipClose").unbind("click",g);a(".jHelperTipClose").bind("click",g)}})}else{if(f.source=="container"){a(f.ttC).show().empty();a(f.dC).clone(true).show().appendTo(f.ttC)}}if(f.source=="attribute"){a(f.aC).html(a(i).attr(f.attrName))}};var e=function(j){var i=j.pageY+f.topOff;var h=j.pageX+f.leftOff;if(f.source=="attribute"){a(f.aC).css({top:i,left:h,opacity:f.opacity}).show()}else{a(f.ttC).css({top:i,left:h,opacity:f.opacity}).show()}};if(f.trigger=="hover"){a(this).bind("mouseover",function(h){h.preventDefault();b(this,h);return false});a(this).bind("mousemove",function(h){e(h);return false});a(this).bind("mouseout",function(h){if(f.source=="attribute"){a(f.aC).hide().empty()}else{a(f.ttC).hide().empty()}return false})}else{if(f.trigger=="click"){a(this).bind("click",function(h){b(this,h);e(h);a(document).bind("click",function(i){if(f.autoClose){if(f.source=="attribute"){a(f.aC).hide().empty()}else{a(f.ttC).hide().empty()}}});return false})}}};a.fn.jHelperTip.defaults={trigger:"click",topOff:3,leftOff:10,source:"container",attrName:"",ttC:"#jHelperTipContainer",dC:"#jHelperTipDataContainer",aC:"#jHelperTipAttrContainer",opacity:1,loadingImg:"ajax-loader.gif",loadingText:"Loading...",type:"GET",autoClose:true}})(jQuery);