(function(n){n.fn.setLITooltip=function(t){return this.each(function(){var l={direction:0,animate:"swing",time:150,hideTimer:50,distance:10,hideDelayTimer:null,beingShown:!1,shown:!1,trigger:".trigger",info:".popup"},i=n.extend(l,t),h=n(i.trigger,this),f=n(i.info,this).css("opacity",0),c=n(f).attr("direction");c!=undefined&&(i=n.extend(i,{direction:c}));var u=n(h).position(),s=n.extend({},{height:n(h).outerHeight(!0),width:n(h).outerWidth(!0)}),e=n.extend({},{height:n(f).outerHeight(!0),width:n(f).outerWidth(!0)}),o={top:u.top-e.height,left:u.left-(e.width-s.width)/2},r=n.extend({},{top:"-="+i.distance+"px"});i.direction==1?(r=n.extend({},{top:"+="+i.distance+"px"}),o={top:u.top+s.height,left:u.left-e.width/2}):i.direction==2?(r=n.extend({},{left:"-="+i.distance+"px"}),o={top:u.top-e.height/2,left:u.left-e.width-s.width}):i.direction==3&&(r=n.extend({},{left:"+="+i.distance+"px"}),o={top:u.top-e.height/2,left:u.left+s.width}),n([h.get(0),f.get(0)]).mouseover(function(){if(i.hideDelayTimer&&clearTimeout(i.hideDelayTimer),!i.beingShown&&!i.shown)return i.beingShown=!1,i.shown=!0,r=n.extend(r,{opacity:1}),f.css(o),f.css({display:"block"}).animate(r,i.time,i.animate),!1}).mouseout(function(){return i.hideDelayTimer&&clearTimeout(i.hideDelayTimer),i.hideDelayTimer=setTimeout(function(){r=n.extend(r,{opacity:0}),i.hideDelayTimer=null,f.animate(r,i.time,i.animate,function(){i.shown=!1,f.css("display","none")})},i.hideTimer),!1})})}})(jQuery)