(function(n){n.hoverInfoPanel=function(t,i){var e={},r=this,u,f;r.settings={};u=n(t);r.init=function(){r.settings=n.extend({},e,i);u.find(".hoverinfo > img").one("load",function(){f(n(this),500)}).each(function(){this.complete&&f(n(this),0)});var t=u.find(".hoverinfo");t.hover(function(){n(".hoverinfo_infopanel",this).stop(!0,!0).animate({"margin-top":0},"fast",function(){n(this).addClass("hoverinfo_infopanel_hovered")})},function(){n(".hoverinfo_infopanel",this).stop(!0,!0).animate({"margin-top":n(".hoverinfo_infopanel",this).outerHeight(!0)-n(".hoverinfo_infopanel .hoverinfo_title",this).outerHeight(!0)-0+"px"},"fast",function(){n(this).removeClass("hoverinfo_infopanel_hovered")})});t.click(function(t){n(".hoverinfo_infopanel",this).hasClass("hoverinfo_infopanel_hovered")||t.preventDefault()})};r.applyColours=function(){var t=["hoverinfo_orange","hoverinfo_green","hoverinfo_blue","hoverinfo_red","hoverinfo_purple","hoverinfo_yellow","hoverinfo_teal","hoverinfo_navy"];n("section .hoverinfo_infopanel.hoverinfo_infopanel_autocolour").each(function(){var i=t.shift();n(this).addClass(i);t.push(i)})};f=function(t,i){t.fadeIn(i);var r=n(">.hoverinfo_infopanel",t.parent());r.wrap('<div class="infopanel_container" />');r.css("display","block");r.css({"margin-top":r.outerHeight(!0)-n(".hoverinfo_title",r).outerHeight(!0)-0+"px"})};r.init();r.applyColours()};n.fn.hoverInfoPanel=function(t){return this.each(function(){if(undefined==n(this).data("hoverPanelInfo")){var i=new n.hoverInfoPanel(this,t);n(this).data("hoverPanelInfo",i)}})}})(jQuery)