(function(a){AJS.contentHover=function(j,i,d,f,m){var b=a.extend(false,AJS.contentHover.opts,m);var h,l,c=a("#content-hover-"+i);if(!c.length){a(b.container).append(a('<div id="content-hover-'+i+'" class="ajs-content-hover"><div class="contents"></div></div>'));c=a("#content-hover-"+i);h=c.find(".contents");h.css("width",b.width+"px").mouseover(function(){clearTimeout(e.hideDelayTimer);c.unbind("mouseover")}).mouseout(function(){g()})}else{h=c.find(".contents")}var e=c[0];var k=function(){if(c.is(":visible")){return}e.showTimer=setTimeout(function(){if(!e.contentLoaded||!e.shouldShow){return}e.beingShown=true;var p=a(window),n=l.x-3,r=l.y+15;if(n+b.width+30>p.width()){c.css({right:"20px",left:"auto"})}else{c.css({left:n+"px",right:"auto"})}var o=(window.pageYOffset||document.documentElement.scrollTop)+p.height();if((r+c.height())>o){r=o-c.height()-5;c.mouseover(function(){clearTimeout(e.hideDelayTimer)}).mouseout(function(){g()})}c.css({top:r+"px"});var q=a("#content-hover-shadow").appendTo(c).show();c.fadeIn(b.fadeTime,function(){e.beingShown=false});q.css({width:h.outerWidth()+32+"px",height:h.outerHeight()+25+"px"});a(".b",q).css("width",h.outerWidth()-26+"px");a(".l, .r",q).css("height",h.outerHeight()-21+"px")},b.showDelay)};var g=function(){e.beingShown=false;e.shouldShow=false;clearTimeout(e.hideDelayTimer);clearTimeout(e.showTimer);clearTimeout(e.loadTimer);e.contentLoading=false;e.shouldLoadContent=false;e.hideDelayTimer=setTimeout(function(){c.fadeOut(b.fadeTime)},b.hideDelay)};a(j).mousemove(function(n){l={x:n.pageX,y:n.pageY};if(!e.beingShown){clearTimeout(e.showTimer)}e.shouldShow=true;if(!e.contentLoaded){if(e.contentLoading){if(e.shouldLoadContent){var o=(l.x-e.initialMousePosition.x)*(l.x-e.initialMousePosition.x)+(l.y-e.initialMousePosition.y)*(l.y-e.initialMousePosition.y);if(o>(b.mouseMoveThreshold*b.mouseMoveThreshold)){e.contentLoading=false;e.shouldLoadContent=false;clearTimeout(e.loadTimer);return}}}else{e.initialMousePosition=l;e.shouldLoadContent=true;e.contentLoading=true;e.loadTimer=setTimeout(function(){if(!e.shouldLoadContent){return}h.load(d,function(){e.contentLoaded=true;e.contentLoading=false;f.call(c,i);k()})},b.loadDelay)}}clearTimeout(e.hideDelayTimer);if(!e.beingShown){k()}}).mouseout(function(){g()});h.click(function(n){n.stopPropagation()});a("body").click(function(){e.beingShown=false;clearTimeout(e.hideDelayTimer);clearTimeout(e.showTimer);c.hide()});return c};AJS.contentHover.opts={fadeTime:100,hideDelay:500,showDelay:700,loadDelay:50,width:300,mouseMoveThreshold:10,container:"body"};AJS.toInit(function(){a("body").append(a('<div id="content-hover-shadow"><div class="tl"></div><div class="tr"></div><div class="l"></div><div class="r"></div><div class="bl"></div><div class="br"></div><div class="b"></div></div>'));a("#content-hover-shadow").hide()})})(jQuery);if(typeof AJS.followCallbacks=="undefined"){AJS.followCallbacks=[]}if(typeof AJS.favouriteCallbacks=="undefined"){AJS.favouriteCallbacks=[]}AJS.toInit(function(a){a(self).bind("hover-user.follow",function(f,d){for(var b=0,c=AJS.followCallbacks.length;b<c;b++){AJS.followCallbacks[b](d.username)}})});

