(function(e,t){var n=function(e,t,n){var r;return function(){function u(){n||e.apply(s,o);r=null}var s=this,o=arguments;r?clearTimeout(r):n&&e.apply(s,o);r=setTimeout(u,t||100)}};jQuery.fn[t]=function(e){return e?this.bind("resize",n(e)):this.trigger(t)}})(jQuery,"smartresize");$(document).ready(function(){function n(n,r){var i=n.attr("alt");if(i.replace(" ","").length==0)return;if(typeof r==null||typeof r=="undefined"){t++;r=t}else t=r;var s=n.offset(),o=s.top+n.height()/2,u=$('<span id="annotation-'+r+'" class="annotation">'+i+"</span>");n.data("annotation-id",r);e.annotations.append(u);u.css("top",o-u.height()/2)}function r(e){if(e.length==0)return;var t=e.offset().top+e.height()/2,n=e.data("annotation-id"),r=$("#annotation-"+n);r.css("top",t-r.height()/2)}function i(e){var t=e.data("annotation-id");if(typeof t=="undefined")return;$("#annotation-"+t).remove()}var e={},t=0;e.window=$(window),e.body=$("body"),e.main=$("#main"),e.page=$("#page"),e.pageContainer=$("#page-container");e.body.append('<div class="surround">                     <div class="top">&nbsp;</div>                     <div class="bottom">&nbsp;</div>                     <div class="right">&nbsp;</div>                     <div class="left">&nbsp;</div>                   </div>                   <div id="annotations"><div id="annotations-inner"></div></div>');e.surround=e.body.children(".surround");e.annotations=e.body.children("#annotations-inner");e.window.smartresize(function(){e.surround.height(0);e.surround.height(Math.max(e.body.get(0).scrollHeight,e.window.height(),e.body.height(),e.page.height(),e.pageContainer.height()+parseInt(e.pageContainer.css("margin-top"))+40));e.window.width()<1020?e.body.addClass("under_1020"):e.body.removeClass("under_1020")}).trigger("resize");e.body.find(".gridItem").hover(function(){$(this).toggleClass("hover")});var s=function(){var e,t=3,n=document.createElement("div"),r=n.getElementsByTagName("i");while(n.innerHTML="<!--[if gt IE "+ ++t+"]><i></i><![endif]-->",r[0]);return t>4?t:e}();s&&s<8&&$(".gridItem").length>0&&$(".gridItem a img").after('<span style="display:inline-block;"></span>');document.body.addEventListener&&document.body.addEventListener("DOMNodeRemoved",function(e){var t=e.target;if(t.nodeType==1&&t.tagName=="IMG"||$(t).find("img")){var n=t.tagName=="IMG"?$(t):$(t).find("img");n.length>0&&i(n)}});e.window.load(function(){e.main.find("img").each(function(e){var t=$(this);t.parents("#sidebar, object, video").length==0&&n(t,e)})});if(typeof navigator=="object"&&navigator.userAgent.indexOf("Sandvox")>-1){$(document).bind("DOMNodeInserted",function(e){var t=e.target;$(t).is(".article")&&$(t).find("img")&&$("#annotations-inner").empty();if(t.nodeType==1&&t.tagName=="IMG"||$(t).is(".pagelet")&&$(t).find("img")||$(t).children("img").length>0){var i=t.tagName=="IMG"?$(t):$(t).find("img");if(i.parents("#sidebar, object, video").length>0)return;if(i.length>0){n(i);i.bind("resize",function(){r(i)})}}});window.setInterval(function(){e.main.find("img").each(function(e){r($(this))})},5e3)}});