function FRError(n){var t=this;return t.name="Generic Error",t.message="Unknown",n&&"string"==typeof n&&(this.message=n),n&&"object"==typeof n&&(n.name&&(t.name=n.name),n.Name&&(t.name=n.Name),n.message&&(t.message=n.message),n.Message&&(t.message=n.Message),"Development"==FRConfiguration.Environment&&((n.ExceptionType||n.StackTrace)&&(t.message=t.message+"<br>"),n.ExceptionType&&(t.message=t.message+n.ExceptionType+" "),n.StackTrace&&(t.message=t.message+n.StackTrace+" "),(n.className||n.methodName)&&(t.message=t.message+"<br>"),n.className&&(t.message=t.message+n.className+" "),n.methodName&&(t.message=t.message+n.methodName+" "))),FRLog.error(t.name+": "+t.message),t}function getFrontiersApi(n,t){if($.browser&&$.browser.msie&&10>parseInt($.browser.version,10)&&window.XDomainRequest){var i=new window.XDomainRequest;i.open("get",n);i.onload=function(){t(eval("json = "+i.responseText))};i.onerror=function(){};i.ontimeout=function(){};i.onprogress=function(){};setTimeout(function(){i.send()},0)}else $.getJSON(n,function(n){t(n)})}function ucfirst(n){return n.charAt(0).toUpperCase()+n.slice(1)}function killWhiteSpace(n){return n.replace(/\s/g,"")}function getProfileUrl(n,t){return siteUrl+"/Community/WhosWhoActivity.aspx?sname="+t+"&UID="+n}function showLoadingStatus(n,t){n?$("#"+t).show():$("#"+t).hide()}function getTrimmedFullName(n){if(null!=n)return n.length>40&&(n=n.substring(0,39)+"..."),n}function getTimeNow(){var n=new Date;return n.getMonth()+1+"/"+n.getDate()+"/"+n.getFullYear()+" "+n.getHours()+":"+n.getMinutes()+":"+n.getSeconds()}function getTimezoneOffsetInHours(){var n=-((new Date).getTimezoneOffset()/60);return(n%1==0||0==n)&&(n+=".0"),n}function return2br(n){return n.replace(/(\r\n|[\r\n])/g,"<br/>")}function Create2DArray(n){for(var i=[],t=0;t<n;t++)i[t]=[];return i}function StringBuilder(){this._array=[];this._index=0;this.append.apply(this,arguments)}function htmlEntities(n){return n.replace(/[<>]/g,function(n){return"<"===n?"&lt;":"&gt;"})}function formatTextContent(n){var t=n.replace(/\n/g,"<br/>");return t=htmlEntities(t),$("<div/>").html(t).text()}function getQueryString(n){var i=window.location.search.substring(1),r,t,u;if(!i||!i.length)return"";for(r=i.split("&"),t=0;t<r.length;t++)if(u=r[t].split("="),u[0]==n)return u[1]}function getHashTag(n){var r=window.location.hash.substring(1),i,t;if(!r||!r.length)return"";for(i=r.split("/"),t=0;t<i.length;t++)if(i[t]==n)return i[t+1]}function makeLinks(n){var t,i,r,u;return i=/(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim,t=n.replace(i,'<a href="$1" target="_blank">$1<\/a>'),r=/(^|[^\/])(www\.[\S]+(\b|$))/gim,t=t.replace(r,'$1<a href="http://$2" target="_blank">$2<\/a>'),u=/(\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)/gim,t=t.replace(u,'<a href="mailto:$1">$1<\/a>')}function removeHTMLTags(n){return""!=n?n.replace(/(<([^>]+)>)/ig,""):""}function removeWhiteSpaces(n){return""!=n?n.replace(/&nbsp;/gi,"").replace(/\/n/g,""):""}var FRAlert=function(){var n=this;return n.alert=$('<li class="alert"><a class="close bypassSecurityPopup" href="javascript:void(0)">×<\/a><div class="icon"><\/div><div class="content"><\/div><\/li>'),n.alert.on("click",".close",function(){n.destroy();$(document).trigger("afterClose.alert")}),n},FRLog,FRSafe,FRTemplate,FRNetworkUserFollow;FRAlert.prototype.init=function(n){n&&("string"==typeof n&&this.alert.find(".content").html(n),"object"==typeof n&&this.alert.find(".content").html(JSON.stringify(n)));n&&n.content&&this.alert.find(".content").html(n.content);n&&n.type&&this.alert.addClass(n.type)};FRAlert.prototype.show=function(){this.alert.css({top:"-100px"});$("#alerts").prepend(this.alert);this.alert.animate({top:0},"slow")};FRAlert.prototype.destroy=function(){this.alert.remove()};FRAlert.prototype.basic=function(n){this.init(n);this.alert.find(".icon").html('<i class="fr-icon-v2-info-circled"><\/i>');this.show()};FRAlert.prototype.success=function(n){this.init(n);this.alert.addClass("success");this.alert.find(".icon").html('<i class="fr-icon-v2-ok-circle"><\/i>');this.show();this.alert.delay(6e3).fadeOut(500,function(){$(this).remove()})};FRAlert.prototype.warning=function(n){this.init(n);this.alert.addClass("warning");this.alert.find(".icon").html('<i class="fr-icon-v2-attention-circled"><\/i>');this.show()};FRAlert.prototype.error=function(n){this.init(n);this.alert.addClass("error");this.alert.find(".icon").html('<i class="fr-icon-v2-cancel-circle"><\/i>');this.show()};$(document).ready(function(){$(document).on("alert.success",function(n,t){(new FRAlert).success(t)});$(document).on("alert.error",function(n,t){(new FRAlert).error(t)});$(document).on("alert.basic",function(n,t){(new FRAlert).basic(t)});$(document).on("alert.warning",function(n,t){(new FRAlert).warning(t)})});FRLog=function(){function t(){e=!0;$(".ibar .loading").show();$(".ibar .loading").html('<i class="fr-icon-v2-attention-circled"><\/i>')}function o(){}function n(n,e){"Development"==FRConfiguration.Environment&&(f.push(e),o(n,e));"log"==n&&console.log(e);"basic"==n&&(new FRAlert).basic(e);"success"==n&&(i&&i.destroy(),(i=new FRAlert).success(e));"warning"==n&&(t(),r&&r.destroy(),(r=new FRAlert).warning(e));"error"==n&&(t(),u&&u.destroy(),(u=new FRAlert).error(e))}var i,r,u,f=[],e=!1;return $(document).ajaxSend(function(){e||$(".ibar .loading").show()}),$(document).ajaxStop(function(){e||$(".ibar .loading").hide()}),$(document).ajaxError(function(n,i,r,u){"abort"==u||"Abort"==u||t()}),{print:function(){console.log("FRLog | This is the full stack...");for(var n=0;n<f.length;n++)console.log(f[n])},notify:o,basic:function(t){n("basic",t)},success:function(t){n("success",t)},warning:function(t){n("warning",t)},error:function(t){n("error",t)},debug:function(t){"Development"==FRConfiguration.Environment&&(console.log(t),n("basic",t))}}}();window.d=FRLog.debug;FRError.prototype=Error();FRError.prototype.constructor=FRError;$(document).ajaxError(function(n,t,i,r){if(t&&t.responseText){var u=$.parseJSON(t.responseText);throw new FRError({name:"Server Error",message:u.Message,ExceptionType:u.ExceptionType,StackTrace:u.StackTrace});}if("timeout"==r||"Timeout"==r)throw new FRError({name:"Connection Error",message:"Timeout"});"abort"==r||"Abort"==r||FRConfiguration.Environment});window.onerror=function(){return"Development"!=FRConfiguration.Environment&&"Test"!=FRConfiguration.Environment&&("Live"==FRConfiguration.Environment||void 0)};FRSafe={boolean:function(n){return"True"==n}};$.extend({getFrontiersApi:function(n,t){return getFrontiersApi(n,t)},getHTML:function(n,t){return jQuery.get(n,void 0,t,"html")},getText:function(n,t){return jQuery.get(n,void 0,t,"text")}});$.extend({ajaxCrossDomain:function(n){var t=$.extend({url:"",data:{},type:"GET",success:function(){}},n),r,i;t.data&&t.data.cookies&&$.isArray(t.data.cookies)&&t.data.cookies.length&&(r=FRCookie.getAll(t.data.cookies),t.data.cookies=FRBase64.encode(r));$.browser&&$.browser.msie&&10>parseInt($.browser.version,10)&&window.XDomainRequest?("http:"==document.location.protocol&&(t.url=t.url.replace("https:","http:")),i=new window.XDomainRequest,i.open(t.type,t.url),i.onload=function(){i.responseText&&i.responseText.length&&t.success(eval("json = "+i.responseText))},i.onerror=function(){},i.ontimeout=function(){},i.onprogress=function(){},setTimeout(function(){i.send(JSON.stringify(t.data))},0)):$.ajax({dataType:"json",url:t.url,data:t.data,type:t.type}).done(function(n){t.success(n)})}}),function(n){var t={check:function(){var n=this.first();return!!n.data("disabled")||(n.data("disabled",!0),!1)},clear:function(){return this.data("disabled",!1)}};n.fn.checkDuplicateEvent=function(n){return t[n]?t[n].apply(this):t.check.apply(this)}}(jQuery);StringBuilder.prototype.append=function(){for(var n=0;n<arguments.length;n++)this._array[this._index]=arguments[n],this._index++};StringBuilder.prototype.toString=function(){return this._array.join("")};$.fn.justtext=function(){return $(this).clone().children().remove().end().text()};$.fn.hasAttr=function(n){return void 0!==this.attr(n)};$.fn.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)};String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)};String.prototype.leftTrim=function(){return this.replace(/^\s+/,"")};String.prototype.truncate=function(n){var t=this.toString();return t?(t.length<=n||((t=t.substring(0,n)).indexOf(" ")>0?t=t.replace(/\W*\s(\S)*$/,"..."):t+="..."),t):""};String.prototype.truncateKeywords=function(n,t){var r=this.length>n,i=r?this.substr(0,n-1):this;return i=t&&r?i.substr(0,i.lastIndexOf(" ")):i,r?i+"&nbsp;&hellip;":i};FRTemplate=function(){function t(t){return n.map(function(){if(this.id==t)return $(this).html()}).get(0)}var n=$("#divTemplates").children();return{get:function(n){return t(n)},bind:function(i,r){return function(i,r){if(!n||!n.length)return"";var u=t(i);return _.template(u)(r)}(i,r)}}}();$(document).ready(function(){$(document).on("ui.refresh",function(){$("select:not(select[multiple]).pretty").each(function(){$(this).hasClass("is-pretty")||($(this).select2({placeholder:"Select",width:"element"}),$(this).addClass("is-pretty"),$(this).css("display","none"))});$(".frUIMouse").each(function(){$(this).hasClass("is-ui")||($(this).mouseover(function(){$(this).addClass("open")}),$(this).mouseout(function(){$(this).removeClass("open")}),$(this).addClass("is-ui"))});$(".frUIAccordion").each(function(){var n=$(this);n.hasClass("is-ui")||(n.children(".header").click(function(){n.children(".content").toggleClass("hide");n.children(".content").hasClass("hide")?(n.children(".header").find("i").removeClass("rounded-arrow-down"),n.children(".header").find("i").addClass("rounded-arrow-right")):(n.children(".header").find("i").removeClass("rounded-arrow-right"),n.children(".header").find("i").addClass("rounded-arrow-down"))}),$(this).addClass("is-ui"))});$(".frUIToolTip").each(function(){$(this).hasClass("is-ui")||($(this).tooltip(),$(this).addClass("is-ui"))});$(".frUIResizeTextArea").each(function(){$(this).hasClass("is-ui")||($(this).autosize(),$(this).addClass("is-ui animated-resize"))});$(".frUIFitString").each(function(){if(!$(this).hasClass("is-ui")){var t=$(this),i=t.height(),n=t.children("span");for($(this).data("frUIFitString",$(n).text());$(n).outerHeight()>i;)$(n).text(function(n,t){return t.replace(/\W*\s(\S)*$/,"...")});$(this).addClass("is-ui")}});$(".frUIFitStringWithTooltip").each(function(){var r,n,u,t,i,f;if(!$(this).hasClass("is-ui")){if(r=$(this),n=r.children("span"),n.text(n.data("original-title")),u=n.html(),t=n.html().length,t>0)for(;parseInt(n.height())>parseInt(r.css("height"));)t--,i=u.substr(0,t-1),f=(i=i.substr(0,i.lastIndexOf(" ")))+"&nbsp;&hellip;",n.html(f),n.tooltip({placement:"bottom",template:'<div class="tooltip"><div class="tooltip-arrow"><\/div><div class="tooltip-inner keywordTooltip"><\/div><\/div>'});$(this).addClass("is-ui")}});$(".input-prepend input, .input-append input").each(function(){$(this).hasClass("is-ui")||($(this).focus(function(){$(this).parent().find(".add-on").addClass("selected")}),$(this).blur(function(){$(this).parent().find(".add-on").removeClass("selected")}),$(this).addClass("is-ui"))})})});$(document).ready(function(){$(document).on("string.refresh",function(){$(".frUIStringFit").each(function(){var i,n,r,t,u;if(!$(this).hasClass("is-ui")){if(i=$(this),n=i.children("span"),$(this).data("frUIStringFit",$(n).html()),r=$(n).html(),t=$(n).html().length,t>0)for(;parseInt($(n).height())>parseInt(i.css("height"));)t--,u=r.truncateKeywords(t,!0),$(n).html(u);$(this).addClass("is-ui")}})})});$.fn.extend({frUIToggle:function(){return $(this).toggleClass("hide"),$(this)}});$.fn.extend({frUIToggleActivityBoxFromBelow:function(){var t=$("#activityBoxAnimationEnd"),n;return $(this).hasClass("hide")?($("div.element.review.activityBox").addClass("hide"),$(this).css({x:"0px",y:"400px",scale:.1,opacity:.4}),$(this).removeClass("hide"),$(this).transition({x:"0px",y:"0px",scale:1,opacity:1},800,"ease"),n=t.offset().top-36-($(window).height()-$(this).outerHeight(!1))/2+$(window).height()/1e3*75,$(window).height()<$(this).outerHeight(!1)+72&&(n=t.offset().top-82),$("html, body").animate({scrollTop:n},800)):$(this).addClass("hide"),$(this)}});$(document).ajaxComplete(function(){$(document).trigger("ui.refresh")});$(document).ready(function(){$(document).on("ui.lock",function(){var t=$("body"),n;t.find("#overlay").length||(n=$('<div id="overlay"><div class="loading"><div class="icon"><span class="fr-icon-v2-spin1 animate-spin"><\/span><\/div><div class="caption"><span>Please wait...<\/span><\/div><\/div><\/div>'),t.prepend(n),setTimeout(function(){n.parent().length&&(n.remove(),FRLog.warning("An error occoured. If the problem persists, please contact the Frontiers support."))},6e4))});$(document).on("ui.unlock",function(){$("body").find("#overlay").remove()})});var FRTracking=function(){function n(n,t,i,r,u){window._gaq||window.ga||(d({category:n,action:t,opt_label:i,opt_value:r,opt_noninteraction:u}),FRLog.warning("Google Analytics is not active on this page!"))}return $(document).on("click","a[data-tracking]",function(){var t=$(this).data("tracking");n(t.category,t.action,t.label)}),{event:n,trackOutboundLink:function(n,t,i,r){ga.hasOwnProperty("loaded")&&!0===ga.loaded||(document.location=r)}}}(),BrowserDetect={init:function(){return this.browser=this.searchString(this.dataBrowser)||"An unknown browser",this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version",this.OS=this.searchString(this.dataOS)||"an unknown OS",this},searchString:function(n){for(var i,r,t=0;t<n.length;t++)if(i=n[t].string,r=n[t].prop,this.versionSearchString=n[t].versionSearch||n[t].identity,i){if(-1!=i.indexOf(n[t].subString))return n[t].identity}else if(r)return n[t].identity},searchVersion:function(n){var t=n.indexOf(this.versionSearchString);if(-1!=t)return parseFloat(n.substring(t+this.versionSearchString.length+1))},dataBrowser:[{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari",versionSearch:"Version"},{prop:window.opera,identity:"Opera",versionSearch:"Version"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.userAgent,subString:"iPhone",identity:"iPhone/iPod"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]},FRCookie={set:function(n,t,i){var r=new Date,u;r.setDate(r.getDate()+i);u=JSON.stringify(t)+(null==i?"":"; expires="+r.toUTCString());document.cookie=n+"="+u},get:function(n){var t=document.cookie,i=t.indexOf(" "+n+"="),r;return(-1==i&&(i=t.indexOf(n+"=")),-1==i)?t=null:(i=t.indexOf("=",i)+1,r=t.indexOf(";",i),-1==r&&(r=t.length),t=t.substring(i,r)),t},getAll:function(n){if(n&&n.length){var t=[];return $(n).each(function(n,i){var r=FRCookie.get(i);r&&r.length&&t.push(i+"="+r)}),t.join("; ")}}},FRBase64=function(){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return{encode:function(t){var e,i,r,h,c,o,u,s="",f=0;for(t=function(n){var i,r,t;for(n=n.replace(/\r\n/g,"\n"),i="",r=0;r<n.length;r++)t=n.charCodeAt(r),t<128?i+=String.fromCharCode(t):t>127&&t<2048?(i+=String.fromCharCode(t>>6|192),i+=String.fromCharCode(63&t|128)):(i+=String.fromCharCode(t>>12|224),i+=String.fromCharCode(t>>6&63|128),i+=String.fromCharCode(63&t|128));return i}(t);f<t.length;)e=t.charCodeAt(f++),i=t.charCodeAt(f++),r=t.charCodeAt(f++),h=e>>2,c=(3&e)<<4|i>>4,o=(15&i)<<2|r>>6,u=63&r,isNaN(i)?o=u=64:isNaN(r)&&(u=64),s=s+n.charAt(h)+n.charAt(c)+n.charAt(o)+n.charAt(u);return s},decode:function(t){var o,s,h,c,f,r,e,u="",i=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");i<t.length;)c=n.indexOf(t.charAt(i++)),f=n.indexOf(t.charAt(i++)),r=n.indexOf(t.charAt(i++)),e=n.indexOf(t.charAt(i++)),o=c<<2|f>>4,s=(15&f)<<4|r>>2,h=(3&r)<<6|e,u+=String.fromCharCode(o),64!=r&&(u+=String.fromCharCode(s)),64!=e&&(u+=String.fromCharCode(h));return function(n){for(var r="",t=0,i=c1=c2=0;t<n.length;)(i=n.charCodeAt(t))<128?(r+=String.fromCharCode(i),t++):i>191&&i<224?(r+=String.fromCharCode((31&i)<<6|63&(c2=n.charCodeAt(t+1))),t+=2):(r+=String.fromCharCode((15&i)<<12|(63&(c2=n.charCodeAt(t+1)))<<6|63&(c3=n.charCodeAt(t+2))),t+=3);return r}(u)}}}();$(document).ready(function(){var n;!function(){if("IntersectionObserver"in window){n=document.querySelectorAll(".lazy");var t,i=new IntersectionObserver(function(n){n.forEach(function(n){if(n.isIntersecting){var t=n.target;t.src=t.dataset.src;t.classList.remove("lazy");i.unobserve(t)}})},{root:document.querySelector("#lazy-container"),rootMargin:"700px 0px 500px 0px"});n.forEach(function(n){i.observe(n)})}else{function r(){t&&clearTimeout(t);t=setTimeout(function(){var t=$(window).scrollTop();n.each(function(){var i=$(this),r;i.offset().top<window.innerHeight+t+500&&(r=i.attr("data-src"),i.attr("src",r),i.removeClass("lazy"),n=$(".lazy"))});0==n.length&&($(document).off("scroll"),$(window).off("resize"))},20)}n=$(".lazy");$(document).on("scroll",r);$(window).on("resize",r)}}()});FRNetworkUserFollow=function(){function l(t,u){var f,e;if(null!=t&&0==t.LoggedInUserID){r();return}if(null!=t&&null!=t.FollowList&&t.FollowList.length>0){if(f=n.find(".teaser-follow button").map(function(){if($(this).data("userId")==t.FollowList[0].UserId)return this}),t.FollowList[0].IsBlockingMe||t.FollowList[0].IsBlocked){f.addClass("btn-follow-grey").removeClass("btn-follow-orange editorial-board-widget-follow").text("Following");i();return}e={userId:t.FollowList[0].UserId};$.ajax({url:"/proxy/Follow/UnFollow",type:"POST",data:e,success:function(){f.addClass("btn-follow-orange").removeClass("btn-follow-grey").text("Follow");f.checkDuplicateEvent("clear")},error:function(){f.addClass("btn-follow-grey").removeClass("btn-follow-orange editorial-board-widget-follow").text("Following");f.checkDuplicateEvent("clear")}})}else u.addClass("btn-follow-grey").removeClass("btn-follow-orange editorial-board-widget-follow").text("Following"),s()}function a(t,u){var f,e;if(null!=t&&0==t.LoggedInUserID){r();return}if(null!=t&&null!=t.FollowList&&t.FollowList.length>0){if(f=n.find(".teaser-follow button").map(function(){if($(this).data("userId")==t.FollowList[0].UserId)return this}),t.FollowList[0].IsBlocked){f.addClass("btn-follow-orange").removeClass("btn-follow-grey").text("Follow");i();return}if(t.FollowList[0].IsBlockingMe){f.addClass("btn-follow-orange").removeClass("btn-follow-grey").text("Follow");h();return}e={userId:t.FollowList[0].UserId};$.ajax({url:"/proxy/Follow/Follow",type:"POST",data:e,success:function(){f.addClass("btn-follow-grey").removeClass("btn-follow-orange editorial-board-widget-follow").text("Following");f.checkDuplicateEvent("clear")},error:function(){f.addClass("btn-follow-orange").removeClass("btn-follow-grey").text("Follow");f.checkDuplicateEvent("clear")}})}else u.addClass("btn-follow-orange").removeClass("btn-follow-grey").text("Follow"),i()}function o(n,t,r,u){$.ajax({url:"/proxy/Follow/FollowStatus",data:{userId:n},type:"POST",traditional:!0,dataType:"json",success:function(n){return u(n,t)},error:function(){var n,u;n=r;u=t;"follow"==n?(u.addClass("btn-follow-orange editorial-board-widget-follow").removeClass("btn-follow-grey").text("Follow"),i()):"unfollow"==n&&(u.addClass("btn-follow-grey").removeClass("btn-follow-orange editorial-board-follow editorial-board-widget-follow").text("Following"),s())}})}function s(){throw new FRError({className:"FRNetworkUserFollow",methodName:"Follow",message:"Failed to UnFollow"});}function i(){throw new FRError({className:"FRNetworkUserFollow",methodName:"Follow",message:"Failed to Follow"});}function r(){if($(".modal.login-modal").length){$(".modal.login-modal").modal("show");return}var t=$(['<div class="modal login-modal fade" data-backdrop="static">','<div class="modal-dialog">','<div class="modal-content">','<div class="modal-header">','<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;<\/span><\/button>',"<h4>Login Required<\/h4>","<\/div>",'<div class="modal-body">',"<p>This action requires you to be registered with Frontiers and logged in. To register or login click <a href="+(window.FRConfiguration.SharepointWebsiteUrl+"/Login.aspx?returnurl=")+document.location.href+">here.<\/a> <\/p>","<\/div>",'<div class="modal-footer">','<button type="button" class="btn btn-flat btn-close btn-new-orange" data-dismiss="modal">Close<\/button>',"<\/div>","<\/div>","<\/div>","<\/div>"].join(""));n.append(t);n.find(".modal.login-modal").modal("show")}function h(){$.FRModal({modalClass:"popup-block",contentHeader:$("<h3>Network<\/h3>"),contentBody:$("<p> This person cannot be followed. <\/p>")})}function u(t){"True"!=t?(n.find(".btn-journal-follow").removeClass("following"),n.find(".btn-journal-follow").html('Follow<span class="hidden-sm hidden-xs"> on Loop<\/span>'),n.find(".btn-journal-follow").checkDuplicateEvent("clear")):(n.find(".btn-journal-follow").text("Following"),n.find(".btn-journal-follow").addClass("following"),n.find(".btn-journal-follow").checkDuplicateEvent("clear"))}function f(t){"True"!=t?(n.find(".btn-journal-follow").text("Following"),n.find(".btn-journal-follow").addClass("following"),n.find(".btn-journal-follow").checkDuplicateEvent("clear")):(n.find(".btn-journal-follow").removeClass("following").removeClass("btn-loop-unfollow"),n.find(".btn-journal-follow").html('Follow<span class="hidden-sm hidden-xs"> on Loop<\/span>'),n.find(".btn-journal-follow").checkDuplicateEvent("clear"))}function t(n){"Follow on Loop"==n?function(){throw new FRError({className:"FRNetworkUserFollowJournal",methodName:"Follow",message:"Failed to Follow Journal"});}():"Following"==n&&function(){throw new FRError({className:"FRNetworkUserFollowJournal",methodName:"Follow",message:"Failed to UnFollow Journal"});}()}var c,e,n=$(".page-container");return $(function(){n.on("click",".follow-button",function(){var t,i,n=$(this);if(n.hasClass("follow-editor-overview"),0==window.FRSocial.loginUserId)return r(),!1;if(n.hasClass("btn-unfollow")||n.hasClass("btn-follow-grey")){if(n.checkDuplicateEvent())return;""===window.location.hash&&n.removeClass("editorial-board-widget-unfollow").addClass("editorial-board-widget-follow").text("Follow");"#editorial-board"===window.location.hash&&n.removeClass("editorial-board-unfollow").addClass("editorial-board-follow").text("Follow");n.removeClass("btn-follow-grey btn-unfollow").addClass("btn-follow-orange").text("Follow");t=n;o(t.data("userId"),t,"unfollow",l)}else if(n.hasClass("btn-follow-blockingme"))h();else if(n.hasClass("btn-follow-orange")){if(n.checkDuplicateEvent())return;n.addClass("btn-follow-grey").removeClass("btn-follow-orange editorial-board-follow").text("Following");i=n;o(i.data("userId"),i,"follow",a)}else if(n.hasClass("btn-follow-blocked"))return});n.on("mouseenter",".btn-follow-grey",function(){var n=$(this);""===window.location.hash&&n.addClass("editorial-board-widget-unfollow").text("Unfollow");"#editorial-board"===window.location.hash&&n.addClass("editorial-board-unfollow").text("Unfollow");n.addClass("btn-unfollow").removeClass("btn-follow-grey editorial-board-widget-follow editorial-board-follow").text("Unfollow")});n.on("mouseleave",".btn-unfollow",function(){$(this).addClass("btn-follow-grey").removeClass("btn-follow-orange btn-unfollow editorial-board-unfollow editorial-board-widget-unfollow ").text("Following")});n.on("click",".btn-journal-follow",function(){if(0==window.FRSocial.loginUserId)return r(),!1;var c,e,l,o,a,s,v,h,i,y=$(this);if(n.find(".btn-journal-follow").hasClass("following")){if(y.checkDuplicateEvent())return;"journal"==window.FRJournalDetails.JournalType?(c=i={journalId:window.FRJournalDetails.JournalId},e=n.find(".btn-journal-follow").text(),f("True"),$.ajax({url:"/proxy/follow/unfollowjournal",type:"POST",data:c,success:function(n){"True"!=n&&(f(n),t(e))},error:function(){t(e)}})):(l=i={sectionId:window.FRJournalDetails.SectionId},o=n.find(".btn-journal-follow").text(),f("True"),$.ajax({url:"/proxy/follow/unfollowsection",type:"POST",data:l,success:function(n){"True"!=n&&(f(n),t(o))},error:function(){t(o)}}))}else{if(y.checkDuplicateEvent())return;"journal"==window.FRJournalDetails.JournalType?(a=i={journalId:window.FRJournalDetails.JournalId},s=n.find(".btn-journal-follow").text(),u("True"),$.ajax({url:"/proxy/follow/followjournal",type:"POST",data:a,success:function(n){"True"!=n&&(u(n),t(s))},error:function(){t(s)}})):(v=i={sectionId:window.FRJournalDetails.SectionId},h=n.find(".btn-journal-follow").text(),u("True"),$.ajax({url:"/proxy/follow/followsection",type:"POST",data:v,success:function(n){"True"!=n&&(u(n),t(h))},error:function(){t(h)}}))}});n.on("mouseenter",".btn-journal-follow.following",function(){$(this).text("Unfollow").addClass("btn-loop-unfollow")});n.on("mouseleave",".btn-journal-follow.following",function(){$(this).text("Following").removeClass("btn-loop-unfollow editorial-board-widget-unfollow")})}),void 0===$.fn.checkDuplicateEvent&&(c=jQuery,e={check:function(){var n=this.first();return!!n.data("disabled")||(n.data("disabled",!0),!1)},clear:function(){return this.data("disabled",!1)}},c.fn.checkDuplicateEvent=function(n){return e[n]?e[n].apply(this):e.check.apply(this)}),{fillUserFollow:function(){if(0==window.FRSocial.loginUserId)n.find(".teaser-follow button").map(function(){$(this).data("userId")>0&&$(this).addClass("btn-follow-orange").text("Follow").removeClass("follow-hide")});else{var t,i={userId:(t=[],n.find(".follow-button[data-user-id]").each(function(n,i){t.push(parseInt($(i).data("userId")))}),_.uniq(t))};$.ajax({url:"/proxy/Follow/FollowStatus",data:i,type:"POST",traditional:!0,dataType:"json",success:function(t){var i;i=t;null!=i&&(0==i.LoggedInUserID&&n.find(".teaser-follow button").map(function(){$(this).data("userId")>0&&$(this).addClass("btn-follow-orange").text("Follow").removeClass("follow-hide")}),i.FollowList&&i.FollowList.length&&$(i.FollowList).each(function(t,i){if(i.UserId>0){var r=n.find(".follow").find(".follow-button[data-user-id="+i.UserId+"]");i.IsFollowButtonVisible?(i.IsBlocked?r.addClass("btn-follow-blocked").removeClass("btn-follow-orange").text("Blocked"):i.IsFollowing?r.text("Following").addClass("btn-follow-grey").removeClass("btn-follow-orange editorial-board-widget-follow"):i.IsBlockingMe?r.addClass("btn-follow-blockingme btn-follow-orange").text("Follow"):r.text("Follow").addClass("btn-follow-orange"),r.removeAttr("data-user-id").removeClass("follow-hide")):r.removeAttr("data-user-id")}}))}})}},fillJournalFollow:function(){if(0==window.FRSocial.loginUserId)n.find(".btn-journal-follow").removeClass("loop-hide"),n.find(".btn-journal-follow").html('Follow<span class="hidden-sm hidden-xs"> on Loop<\/span>');else{var t;t="journal"==window.FRJournalDetails.JournalType?{journalId:window.FRJournalDetails.JournalId}:{journalId:window.FRJournalDetails.SectionId};$.ajax({url:"/proxy/Follow/followjournalstatus",data:t,type:"POST",traditional:!0,dataType:"json",success:function(t){var i;i=t;0!=i?(n.find(".btn-journal-follow").html("Following"),n.find(".btn-journal-follow").addClass("following")):n.find(".btn-journal-follow").html('Follow<span class="hidden-sm hidden-xs"> on Loop<\/span>');n.find(".btn-journal-follow").removeClass("loop-hide")}})}}}}()