(function(){DUMAS.registerModule("sflInline",K,D);var E,B,N,H,J=".saveForLaterLink",A,G;function I(O){return O.settings({savedForLater:false,saveText:B.saveText,savedText:B.savedText,contentType:null,contentId:null})}function C(){var O=$(this),P;P=I(O);O.setClass(P.savedForLater,"saved").find("span.sflText").text(P.savedForLater?P.savedText:P.saveText)}function M(O){var P=I(O);$("[data-contentId = "+P.contentId+"]").filter("[data-contentType = "+P.contentType+"], "+J).set("savedForLater",P.savedForLater).each(C)}function F(O){window.location="https://"+window.location.host+"/security/signon.html?URL="+encodeURIComponent(N+O+"&redirect="+encodeURIComponent(window.location.href))}function L(){return function(Q){var R,P=$(this),O;R=I(P);O="contentType="+R.contentType+"&contentIds="+R.contentId+"&saving="+!R.savedForLater;if(!G){window.location="/"}else{if(A){jQuery.post(H+O,function(S){S=$("response",S);if(S.attr("auth")==="false"){F(O)}P.parents().andSelf().filter(J).set("savedForLater",S.attr("saved")==="true");M(P);$("#numSavedForLaterItems").html(S.attr("numSaved"))})}else{F(O)}}Q.stopPropagation();Q.preventDefault();return false}}function K(O){if(O=O.SFL){E=O.listId;A=O.auth;G=O.userKnown;B={savedText:O.savedText||"Saved!",saveText:O.saveText||"Save it!"};N="/lists/ajax.html?xml=true&method=addToList&listId="+E+"&";H=N+"js=yes&"}}function D(O){O.find(".saveForLaterLink:not(.sflDone)").addClass("sflDone").each(C).find("*").andSelf().click(L())}DUMAS.initSaveForLaterTag=function(){K(this)}})();(function(C){var E={maxDisplay:350,ellipsis:"...",triggerClass:"moreBox",moreLinkClass:"moreLink",hilightClass:"hilite",addClass:"",windowTitle:"",enableModalWindow:true},A="moreBox";function B(M){var L=jQuery.extend({},E,M);C.data(this,A,L);this.each(function(){var O=C(this),Q=Math.floor(Math.random()*1000000),P=L.maxDisplay,R=P*2,N=P*3;if(O.text().length>R){if(O.text().length<N||!L.enableModalWindow){I(O,L,Q)}else{J(O,L,Q)}}});return this}function I(M,N,O){var R,S,L,Q=N.maxDisplay,P="<a href='#' class='"+N.moreLinkClass+" trigger"+O+" "+N.addClass+"'>more.</a>",U=M.html(),T=M.height();S=U.substring(0,Q);M.html(S);L=M.height();M.html(U);M.height(L);M.parent().append(P);M.css({overflow:"hidden"});C(".trigger"+O+"").bind("click.moreBoxSlider",function(){R=C(this);if(R.hasClass("opened")){M.animate({height:L},500);R.removeClass("opened")}else{M.animate({height:T},500);R.addClass("opened")}H.call(R);return false})}function J(M,N,O){var S,P,Q,L,U,T=N.maxDisplay,X=N.ellipsis,R=D(M.html()),V=N.windowTitle?N.windowTitle:M.prev().html(),W=F(R,T).firstChunk;M.html(W+X);S="<a href='#' class='"+N.moreLinkClass+" trigger"+O+" "+N.addClass+"'>more >> </a>";M.parent().append(S);P="<div class='newBox"+O+" moreBoxBody moreBoxJqm'></div>";M.parent().append(P);U=K(F(R,T).firstChunk,N)+F(R,T).secondChunk;Q="<div id='moreBoxDisplay'>"+U+"</div>";C("div.newBox"+O).html(Q+"<a href='#' class='jqmMoreBoxClose'><img src='/images/core/icons/icon-close.gif'/></a>");L=document.createElement("h1");C(L).html(V);C(L).prependTo("div.newBox"+O);C("div.newBox"+O).jqm({closeClass:"jqmMoreBoxClose",trigger:".trigger"+O,overlay:40,toTop:"true",onShow:function(Y){Y.w.css("top",DUMAS.scrollTop()+40+"px").css("left",(DUMAS.clientWidth()/2)-(Y.w.width()/2)+"px").fadeIn("normal")}})}function H(){var L=C(this);L.text()=="more."?L.text("less."):L.text("more.")}function F(V,S){var Q=new RegExp("\\w+|[^\\w<]|<(/)?(\\w+)[^>]*(/)?>|<","g"),M=/^(?:[hb]r|img)$/i,L=0,U=[],X=[],N="",P="",O="",W={},R,T;while((L<S)&&(T=Q.exec(V))){if(T[2]){P+=T[0];if(!(T[3]||M.test(T[2]))){if(T[1]){U.pop();X.pop()}else{X.push(T[0]);U.push(T[2])}}}else{L+=T[0].length;if(L<S+T[0].length){P+=T[0]}}}R=U.length;while(R--){P+="</"+U[R]+">"}R=0;while(R<X.length){N+=X[R];R++}while((L<V.length)&&(T=Q.exec(V))){L+=T[0].length;if(L>S){O+=T[0]}}W={firstChunk:P,secondChunk:N+O};return W}function K(L,M){return"<span class='"+M.hilightClass+"'>"+L+"</span>"}function D(L){return L.replace(/(?:<[\/]*br*?[\/]*><[\/]*br*?[\/]*>)/g,"<p></p>")}function G(M){var L=C.data(M,A);if(!L){L=C.extend({},E);C.data(M,A,L)}return L}C.fn.extend({moreBox:B})})(jQuery);$(function(){$("#primaryText p").moreBox({maxDisplay:395,enableModalWindow:false});$(".blurbContainer .moreLink").click(function(){var C=$(this).parent();var A=C.find("p");var B=C.parent().parent();if(C.hasClass("opened")){A.removeAttr("style");B.removeAttr("style");C.removeClass("opened");$(this).text("more.")}else{A.css("height",A.get(0).scrollHeight+"px");B.css("height",B.get(0).scrollHeight+"px");C.addClass("opened");$(this).text("less.")}})});