")}}$(function(){u()})}(),e=function(){function tt(){n.find(".write-area").on("focus",function(){$(".profile-thumbnail").show(),n.find(".write-area").css("width","603px;")});n.find(".write-area").on("blur",function(){$(".profile-thumbnail").hide(),n.find(".write-area").css("width","653px;")});i.on("click",".frontiers-network .comment",function(){ga("send","event","AP_Action","button","comment-article");var i=$("#txtComment");i&&i.length!=0&&(window.FRSocial.loginUserId==0?t.showLoginPopUp():($("html, body").animate({scrollTop:i.offset().top-100},500),n.find("#txtComment").focus()))});$(document).on("click","a.show-comment ,li.bottom-arrow ",function(){$(".comments-holder .more-comment-box").hasClass("hide")?($(".comments-holder .more-comment-box").show(),$(".comments-holder .more-comment-box").removeClass("hide"),$(".bottom-arrow a").show(),$(".comments-holder .show-comment span").removeClass("down-arrow"),$(".comments-holder .show-comment span").addClass("up-arrow")):($(".comments-holder .more-comment-box").addClass("hide"),$(".comments-holder .more-comment-box").hide(),$(".bottom-arrow a").hide(),$(".comments-holder .show-comment span").removeClass("up-arrow"),$(".comments-holder .show-comment span").addClass("down-arrow"))})}function nt(){var f;if(parseInt(window.FRSocial.loginUserId)==0)return t.showLoginPopUp(),!1;if(n.find("#txtComment").val()=="Write a comment...")return!1;var e=encodeURIComponent(return2br($.trim(n.find("#txtComment").val()))),o="Comments must be less than 4,000 characters. You have entered ",s="Comment text too long",c=$.trim(n.find("#txtComment").val());if(!l(c,"","","","",o,s))return!1;n.find("#txtComment").val("Write a comment...").trigger("autosize.resize"),f={entityId:window.FRSocial.entityId,itemId:window.FRSocial.itemId,itemTypeId:window.FRSocial.itemTypeId,conTemplateNetworkFeedKeyText:t.getFeedTemplateKeyText(),ownerNwDbId:window.FRSocial.ownerNWDBId,commentId:0,commentText:e,parentCommentId:0,commentLevel:1,action:0,cookies:[FRConfiguration.FrontiersCookieRememberMe,FRConfiguration.FrontiersCookie]},$.ajaxCrossDomain({type:"POST",url:r+"/Network/AddEditDeleteComment",data:f,success:function(n){var t=i.find(".frontiers-network .button-comments .final-counts"),r=parseInt(t.text())+1;t.text(r),h(n,1)}})}function g(n,t){var i=n.id.split("_"),r=i[1]+"_"+i[2]+"_"+i[3]+"_"+i[4],u;$("#div_"+t).append('
"),$("#div_"+i+" #divCommentTemp a.fontnormal").first().remove(),f=c($("#div_"+i+" #divCommentTemp").html()),$("#div_"+i+" #divCommentTemp").remove(),e={entityId:window.FRSocial.entityId,itemId:window.FRSocial.itemId,itemTypeId:window.FRSocial.itemTypeId,conTemplateNetworkFeedKeyText:t.getFeedTemplateKeyText(),ownerNwDbId:u[1],commentId:u[0],commentText:f,parentCommentId:0,commentLevel:1,action:1,cookies:[FRConfiguration.FrontiersCookieRememberMe,FRConfiguration.FrontiersCookie]},$.ajaxCrossDomain({type:"POST",url:r+"/Network/AddEditDeleteComment",data:e,success:function(n){h(n,3)}})}function k(i,u,f){var c=f.split("_"),o=i.id.split("_"),s=o[1]+"_"+o[2]+"_"+o[3]+"_"+o[4],a;if($.trim($(" #txtUpdate_"+s+"_"+f).val()).length){var v=encodeURIComponent(return2br($.trim($(" #txtUpdate_"+s+"_"+f).val()))),y=$.trim($(" #txtUpdate_"+s+"_"+f).val()),p="Comments must be less than 4,000 characters. You have entered ",w="Comment text too long",b=[FRConfiguration.FrontiersCookieRememberMe,FRConfiguration.FrontiersCookie];l(y,"","","","",p,w)&&($("#btnUpdatecom_"+s).hide(),a={entityId:window.FRSocial.entityId,itemId:window.FRSocial.itemId,itemTypeId:window.FRSocial.itemTypeId,conTemplateNetworkFeedKeyText:t.getFeedTemplateKeyText(),ownerNwDbId:c[1],commentId:c[0],commentText:v,parentCommentId:0,commentLevel:1,action:2,cookies:b},$.ajaxCrossDomain({type:"POST",url:r+"/Network/AddEditDeleteComment",data:a,success:function(t){h(t,2),n.find("#txtComment").val("Write a comment...").trigger("autosize.resize")}}))}}function h(n,t){var i={entityId:window.FRSocial.entityId,ownerId:window.FRSocial.ownerId,itemId:window.FRSocial.itemId,userActivityFeedId:0,commentId:n,url:f,ownerNwDbId:window.FRSocial.ownerNWDBId,itemTypeId:window.FRSocial.itemTypeId,timeOffset:s,timeNow:o,cookies:[FRConfiguration.FrontiersCookieRememberMe,FRConfiguration.FrontiersCookie]};$.ajaxCrossDomain({type:"POST",url:r+"/Network/GetNewComment",data:i,success:function(i){var r=$.parseJSON(i);r&&r.length&&(t==1?it(r):t==2?b(r,n):t==3&&w(r,n),p())}})}function it(n){var i="divCommentHolder_"+n[0],t,r;$("#"+i).length?($("#"+i).append(n[1]),t=$("div.CommentsHolder"),t.find("a.btmArrow").length&&(t.find("a.btmArrow").remove(),t.find("div.commentBox:last ul li:last").append(e))):(r="divAddComment_"+n[0],$("#"+r).before('
'+n[1]+"
"))}function b(n,t){var i=$("div.CommentsHolder");i.find("#divmc_"+window.FRSocial.entityId+"_"+window.FRSocial.itemId+" div.commentBox").length&&!i.find("div.commentBox:last ul li:last a.btmArrow").length?(i.find("#div_"+t+"_"+window.FRSocial.ownerNWDBId).html($(n[1]).html()),i.find("div.commentBox:last ul li:last").append(e)):i.find("#div_"+t+"_"+window.FRSocial.ownerNWDBId).html($(n[1]).html())}function w(n,t){var i=$("div.CommentsHolder");i.find("#div_"+t+"_"+window.FRSocial.ownerNWDBId+" a.btmArrow").length?(i.find("#div_"+t+"_"+window.FRSocial.ownerNWDBId+" a.btmArrow").remove(),i.find("#div_"+t+"_"+window.FRSocial.ownerNWDBId).html($(n[1]).html()),i.find("div.commentBox:last ul li:last").append(e)):i.find("#div_"+t+"_"+window.FRSocial.ownerNWDBId).html($(n[1]).html())}function p(){var n={entityId:window.FRSocial.entityId,itemTypeId:window.FRSocial.itemTypeId,ownerId:window.FRSocial.ownerId,userActivityFeedId:0,conTemplateNetworkFeedKeyText:t.getFeedTemplateKeyText(),url:f,ownerNwDbId:window.FRSocial.ownerNWDBId,createdBy:0,itemId:window.FRSocial.itemId,cookies:[FRConfiguration.FrontiersCookieRememberMe,FRConfiguration.FrontiersCookie]};$.ajaxCrossDomain({type:"POST",url:r+"/Network/GetCommentActivity",data:n,success:function(n){var t=$.parseJSON(n),i;t&&t.length&&t[1]!=null&&t[2]!=null&&(i="#divCommentHolder_"+t[0],$(i+" div.bubbleInfo p").length?($(i+" div.bubbleInfo p").html(t[1]),$(i+" div.bubbleInfo table").html($(t[2]).html())):$("#divActivityBox_"+window.FRSocial.entityId+"_"+window.FRSocial.itemId+"_2").html('
'+t[1]+"
"+t[2]+"