function FRError(n){var t=this;return t.name="Generic Error",t.message="Unknown",n&&typeof n=="string"&&(this.message=n),n&&typeof n=="object"&&(n.name&&(t.name=n.name),n.Name&&(t.name=n.Name),n.message&&(t.message=n.message),n.Message&&(t.message=n.Message),FRConfiguration.Environment=="Development"&&((n.ExceptionType||n.StackTrace)&&(t.message=t.message+"
"),n.ExceptionType&&(t.message=t.message+n.ExceptionType+" "),n.StackTrace&&(t.message=t.message+n.StackTrace+" "),(n.className||n.methodName)&&(t.message=t.message+"
"),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&&parseInt($.browser.version,10)<10&&window.XDomainRequest){var i=new window.XDomainRequest;i.open("get",n),i.onload=function(){t(eval("json = "+i.responseText))},i.onerror=function(){return},i.ontimeout=function(){return},i.onprogress=function(){return},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(n!=null)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||n==0)&&(n=n+".0"),n}function return2br(n){return n.replace(/(\r\n|[\r\n])/g,"
")}function Create2DArray(n){for(var i=[],t=0;t]/g,function(n){return n==="<"?"<":">"})}function formatTextContent(n){var t=n.replace(/\n/g,"
"),i;return t=htmlEntities(t),i=$("
").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$1'),r=/(^|[^\/])(www\.[\S]+(\b|$))/gim,t=t.replace(r,'$1$2'),u=/(\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)/gim,t=t.replace(u,'$1')}function removeHTMLTags(n){var t=/(<([^>]+)>)/ig;return n!=""?n.replace(t,""):""}function removeWhiteSpaces(n){return n!=""?n.replace(/ /gi,"").replace(/\/n/g,""):""}function showUserImage(n){FRSocialActivity.showUserImage(n)}function hideUserImage(n){FRSocialActivity.hideUserImage(n)}function showAllUsersFeedActivityPopup(n,t,i){FRSocialActivity.showAllUsersFeedActivityPopup(n,t,i)}function hideAllUsersFeedActivityPopup(n,t,i){FRSocialActivity.hideAllUsersFeedActivityPopup(n,t,i)}function AddComments(n){FRSocialActivity.comment.add(n)}function EditComments(n,t){FRSocialActivity.comment.edit(n,t)}function DeleteComments(n,t){FRSocialActivity.comment.deleteComment(n,t)}function inherits(n,t){function i(){}i.prototype=t.prototype,n.superClass_=t.prototype,n.prototype=new i,n.prototype.constructor=n}function MarkerLabel_(n,t){this.marker_=n,this.handCursorURL_=n.handCursorURL,this.labelDiv_=document.createElement("div"),this.labelDiv_.style.cssText="position: absolute; overflow: hidden;",this.eventDiv_=document.createElement("div"),this.eventDiv_.style.cssText=this.labelDiv_.style.cssText,this.eventDiv_.setAttribute("onselectstart","return false;"),this.eventDiv_.setAttribute("ondragstart","return false;"),this.crossDiv_=MarkerLabel_.getSharedCross(t)}function MarkerWithLabel(n){n=n||{},n.labelContent=n.labelContent||"",n.labelAnchor=n.labelAnchor||new google.maps.Point(0,0),n.labelClass=n.labelClass||"markerLabels",n.labelStyle=n.labelStyle||{},n.labelInBackground=n.labelInBackground||!1,typeof n.labelVisible=="undefined"&&(n.labelVisible=!0),typeof n.raiseOnDrag=="undefined"&&(n.raiseOnDrag=!0),typeof n.clickable=="undefined"&&(n.clickable=!0),typeof n.draggable=="undefined"&&(n.draggable=!1),typeof n.optimized=="undefined"&&(n.optimized=!1),n.crossImage=n.crossImage||"http"+(document.location.protocol==="https:"?"s":"")+"://maps.gstatic.com/intl/en_us/mapfiles/drag_cross_67_16.png",n.handCursor=n.handCursor||"http"+(document.location.protocol==="https:"?"s":"")+"://maps.gstatic.com/intl/en_us/mapfiles/closedhand_8_8.cur",n.optimized=!1,this.label=new MarkerLabel_(this,n.crossImage,n.handCursor),google.maps.Marker.apply(this,arguments)}var FRAlert=function(){var n=this,t=['
  • ','×','
    ','
    ',"
  • "].join("");n.alert=$(t);n.alert.on("click",".close",function(){n.destroy(),$(document).trigger("afterClose.alert")});return n},FRLog,FRSafe,FRTemplate;FRAlert.prototype.init=function(n){var t=this;n&&(typeof n=="string"&&t.alert.find(".content").html(n),typeof n=="object"&&t.alert.find(".content").html(JSON.stringify(n))),n&&n.content&&t.alert.find(".content").html(n.content),n&&n.type&&t.alert.addClass(n.type)},FRAlert.prototype.show=function(){var n=this;n.alert.css({top:"-100px"}),$("#alerts").prepend(n.alert),n.alert.animate({top:0},"slow")},FRAlert.prototype.destroy=function(){var n=this;n.alert.remove()},FRAlert.prototype.basic=function(n){var t=this;t.init(n),t.alert.find(".icon").html(''),t.show()},FRAlert.prototype.success=function(n){var t=this;t.init(n),t.alert.addClass("success"),t.alert.find(".icon").html(''),t.show(),t.alert.delay(6e3).fadeOut(500,function(){$(this).remove()})},FRAlert.prototype.warning=function(n){var t=this;t.init(n),t.alert.addClass("warning"),t.alert.find(".icon").html(''),t.show()},FRAlert.prototype.error=function(n){var t=this;t.init(n),t.alert.addClass("error"),t.alert.find(".icon").html(''),t.show()},$(document).ready(function(){$(document).on("alert.success",function(n,t){var i=new FRAlert;i.success(t)});$(document).on("alert.error",function(n,t){var i=new FRAlert;i.error(t)});$(document).on("alert.basic",function(n,t){var i=new FRAlert;i.basic(t)});$(document).on("alert.warning",function(n,t){var i=new FRAlert;i.warning(t)})}),FRLog=function(){function s(){f||$(".ibar .loading").show()}function h(){f||$(".ibar .loading").hide()}function e(){f=!0,$(".ibar .loading").show(),$(".ibar .loading").html('')}function o(){}function n(n,f){if(FRConfiguration.Environment=="Development"&&(u.push(f),o(n,f)),n=="log"&&console.log(f),n=="basic"){var s=new FRAlert;s.basic(f)}n=="success"&&(t&&t.destroy(),t=new FRAlert,t.success(f)),n=="warning"&&(e(),i&&i.destroy(),i=new FRAlert,i.warning(f)),n=="error"&&(e(),r&&r.destroy(),r=new FRAlert,r.error(f))}function c(){console.log("FRLog | This is the full stack...");for(var n=0;n0?t.replace(/\W*\s(\S)*$/,"..."):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+" …":i},FRTemplate=function(){function i(i,r){if(!n||!n.length)return"";var u=t(i),f=_.template(u);return f(r)}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(n,t){return i(n,t)}}}(),$(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,i,t,f;if(!$(this).hasClass("is-ui")){if(r=$(this),n=r.children("span"),n.text(n.data("original-title")),u=n.html(),i=n.html().length,i>0)while(parseInt(n.height())>parseInt(r.css("height")))i--,t=u.substr(0,i-1),t=t.substr(0,t.lastIndexOf(" ")),f=t+" …",n.html(f),n.tooltip({placement:"bottom",template:'
    '});$(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)while(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=$(['
    ','
    ','
    ','
    Please wait...
    ',"
    ","
    "].join("")),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()})}),$(function(){var n=BrowserDetect.init();if(n.browser=="Explorer"){$("body").addClass("ie");$(document).on("ui.refresh",function(){$("input[type='text']:disabled, textarea:disabled").each(function(){var n=$(this);n.removeAttr("disabled"),n.prop("readonly",!0)}),$("input, textarea").each(function(){var n=$(this),t;(n.val()==""||n.val()==null)&&(t=n.attr("placeholder"),n.val(t)),n.attr("placeholder")!=""&&$(this).val()==$(this).attr("placeholder")&&n.addClass("hasPlaceholder"),$("input, textarea").focus(function(){$(this).attr("placeholder")!=""&&$(this).val()==$(this).attr("placeholder")&&$(this).val("").removeClass("hasPlaceholder")}).blur(function(){$(this).attr("placeholder")!=""&&($(this).val()==""||$(this).val()==$(this).attr("placeholder"))&&$(this).val($(this).attr("placeholder")).addClass("hasPlaceholder")}),$("form").submit(function(){$(this).find(".hasPlaceholder").each(function(){$(this).val("")})})})})}});var FRTracking=function(){function n(n,t,i,r,u){if(window._gaq){r!="undefined"&&u!="undefined"?window._gaq.push(["_trackEvent",n,t,i,r,u]):window._gaq.push(["_trackEvent",n,t,i]);return}if(window.ga){window.ga("send","event",n,t,i);return}d({category:n,action:t,opt_label:i,opt_value:r,opt_noninteraction:u}),FRLog.warning("Google Analytics is not active on this page!")}$(document).on("click","a[data-tracking]",function(){var t=$(this).data("tracking");n(t.category,t.action,t.label)});var t=function(n,t,i,r){ga.hasOwnProperty("loaded")&&ga.loaded===!0?ga("send","event",n,t,i,{hitCallback:function(){document.location=r}}):document.location=r};return{event:n,trackOutboundLink:t}}(),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;t127&&t<2048?(i+=String.fromCharCode(t>>6|192),i+=String.fromCharCode(t&63|128)):(i+=String.fromCharCode(t>>12|224),i+=String.fromCharCode(t>>6&63|128),i+=String.fromCharCode(t&63|128));return i}function i(n){for(var r="",t=0,i=c1=c2=0;t191&&i<224?(c2=n.charCodeAt(t+1),r+=String.fromCharCode((i&31)<<6|c2&63),t+=2):(c2=n.charCodeAt(t+1),c3=n.charCodeAt(t+2),r+=String.fromCharCode((i&15)<<12|(c2&63)<<6|c3&63),t+=3);return r}var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return{encode:function(i){var o="",s,r,u,c,l,h,f,e=0;for(i=t(i);e>2,l=(s&3)<<4|r>>4,h=(r&15)<<2|u>>6,f=u&63,isNaN(r)?h=f=64:isNaN(u)&&(f=64),o=o+n.charAt(c)+n.charAt(l)+n.charAt(h)+n.charAt(f);return o},decode:function(t){var r="",s,h,c,l,e,f,o,u=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");u>4,h=(e&15)<<4|f>>2,c=(f&3)<<6|o,r=r+String.fromCharCode(s),f!=64&&(r=r+String.fromCharCode(h)),o!=64&&(r=r+String.fromCharCode(c));return r=i(r)}}}(),FRSocialActivity=function(){var u=$(".page-container"),i=u.find(".right-container"),n=u.find(".social-feed"),o=getTimeNow(),s=getTimezoneOffsetInHours(),r=window.FRConfiguration.FrontiersNetworkingAPIUrl,f=window.FRConfiguration.SharepointWebsiteUrl.replace("http://",""),t=function(){function w(){$(document).on("focus",".setfocus",function(){$(this).removeClass("grey_70").addClass("grey_90"),this.value==this.defaultValue&&(this.value=""),this.value!=this.defaultValue&&this.select()});$(document).on("blur",".setfocus",function(){$.trim(this.value).length||($(this).removeClass("grey_90").addClass("grey_70"),this.value=this.defaultValue?this.defaultValue:"")});$(document).click(function(i){var r=i.target?$(i.target):$(i.srcElement),u,f,o;r.parents().andSelf().is(".bubbleInfo,.fontnormal trigger")?(f=$("table.popup").filter(function(){return $(this).css("display")==="block"}),f.length>1&&(o=$("table.popup").filter(function(){return $(this).css("display")==="block"&&$(this).css("opacity")==1}),o.css("display","none"))):(u=$("table.popup"),t&&clearTimeout(t),t=setTimeout(function(){t=null,u.animate({top:"-="+a+"px",opacity:0},l,"swing",function(){e=!1,u.css("display","none")})},200),setTimeout(function(){u.css("filter")!="none"&&u.css("opacity")>0&&u.css({opacity:"0",filter:"alpha(opacity = 0)",top:"17px"})},300)),(r.is(n.find("a.showComment"))||r.is(n.find("a.showComment span"))||r.is(n.find("a.btmArrow span")))&&(r.parents("div.commentsWrapper").children("div.moreComments").css("display")=="none"?(r.is("a.showComment span.float_right")?r.removeClass("downArrow").addClass("upArrow"):r.parents("a.showComment").children("span.float_right").removeClass("downArrow").addClass("upArrow"),r.parents("div.CommentsHolder").children("div.commentBox:last").children("div.wrapper").children("div.content").children("ul.toolbar").children("li.float_right").html("")):(r.is("a.showComment span.float_right")?r.removeClass("upArrow").addClass("downArrow"):r.parents("a.showComment").children("span.float_right").removeClass("upArrow").addClass("downArrow"),r.parent().is("a.btmArrow")?(r.parents("div.CommentsHolder").children("div.commentsWrapper").find("a.showComment span.float_right").removeClass("upArrow").addClass("downArrow"),r.parents("div.CommentsHolder").children("div.commentsWrapper").children("div.moreComments").toggle("slow"),r.parents("div.CommentsHolder").children("div.commentsWrapper").children("div.commentBox").children("div.float_left").children("a.showComment").focus(),r.parents("div.CommentsHolder").children("div.commentBox:last").children("div.wrapper").children("div.content").children("ul.toolbar").children("li.float_right").html("")):(r.is("a.showComment span.float_right")?r.removeClass("upArrow").addClass("downArrow"):r.parents("a.showComment").children("span.float_right").removeClass("upArrow").addClass("downArrow"),r.parents("div.CommentsHolder").children("div.commentBox:last").children("div.wrapper").children("div.content").children("ul.toolbar").children("li.float_right").html(""))),r.parents("div.commentsWrapper").children("div.moreComments").toggle("slow"),r.parents("div.CommentsHolder").children("div.commentsWrapper").children("div.commentBox").children("div.float_left").children("a.showComment").focus())})}function b(){var n={timeNow:o,itemId:window.FRSocial.itemId,ownerId:window.FRSocial.ownerId,currentHostName:f,entityId:window.FRSocial.entityId,itemTypeId:window.FRSocial.itemTypeId,ownerNwDbId:window.FRSocial.ownerNWDBId,timeOffset:s,conTemplateNetworkFeedKeyText:r,cookies:FRBase64.encode(FRCookie.getAll([FRConfiguration.FrontiersCookieRememberMe,FRConfiguration.FrontiersCookie]))},t;$.browser&&$.browser.msie&&parseInt($.browser.version)<=8?$.ajax({type:"POST",dataType:"json",traditional:!0,data:JSON.stringify(n),url:"/proxy/Network/GetEntityActivity"}).done(function(n){y(n)}):(t=$.browser&&$.browser.msie&&parseInt($.browser.version)==9?n:JSON.stringify(n),$.ajaxCrossDomain({type:"POST",data:t,url:window.FRConfiguration.FrontiersNetworkingAPIUrl+"/Network/GetEntityActivity",success:function(n){y(n)}}))}function y(t){var r=$.parseJSON(t);if(r&&r.length){i.find(".frontiers-network").show(),n.html(r[0]);var u=0,f=0,e=0;parseInt(r[1])>0&&(u=parseInt(r[1])),parseInt(r[2])>0&&(f=parseInt(r[2])),parseInt(r[3])>0&&(e=parseInt(r[3])),i.find(".frontiers-network .button-likes .final-counts").text(u),i.find(".frontiers-network .button-comments .final-counts").text(f),i.find(".frontiers-network .button-shares .final-counts").text(e),r[4]=="1"&&(i.find(".frontiers-network .like").text("Liked").addClass("liked").removeClass("like"),i.find(".frontiers-network .button-likes button").off("click")),$("#divmc_"+window.FRSocial.entityId+"_"+window.FRSocial.itemId).children().size()>0&&$("a.showComment").parents("div.CommentsHolder").children("div.commentBox:last").children("div.wrapper").children("div.content").children("ul.toolbar").children("li.float_right").html(""),k(),n.find("textarea").addClass("frUIResizeTextArea comment-textarea").removeClass("w605 h15a fs11"),$(document).trigger("ui.refresh")}}function k(){if($("div.bubbleInfo").length>0){var n=300;$("div.bubbleInfo").each(function(){$(this).css("zIndex",n),n-=1})}}function d(n,i,r){var f,u;return h?!1:(h=!0,a=10,l=250,nt=200,v=27,t=null,c=!1,e=!1,f=n+"_"+i+"_"+r,$("#pAllUsers_"+f).text().indexOf(",...")!=-1)?(u=$("#tblAllUsers_"+f).css("opacity",0),t&&clearTimeout(t),c||e)?!1:(c=!0,u.css({top:v,left:2,display:"block"}).animate({top:"-="+a+"px",opacity:1},l,"swing",function(){c=!1,e=!0}),setTimeout(function(){u.css("filter")!="none"&&u.css("opacity")<1&&u.css({opacity:"1",filter:"alpha(opacity = 100)",top:"17px"}),h=!1},300),!1):(h=!1,!1)}function g(n,i,r){var u=$("#tblAllUsers_"+n+"_"+i+"_"+r);return t&&clearTimeout(t),t=setTimeout(function(){t=null,u.animate({top:"-="+a+"px",opacity:0},l,"swing",function(){e=!1,u.css("display","none")})},200),setTimeout(function(){u.css("filter")!="none"&&u.css("opacity")>0&&u.css({opacity:"0",filter:"alpha(opacity = 0)",top:"17px"})},300),!1}function p(){if($(".modal.login-modal").length){$(".modal.login-modal").modal("show");return}var n=window.FRConfiguration.SharepointWebsiteUrl+"/Login.aspx?returnurl="+document.location.href,t=$(['"].join(""));u.append(t),u.find(".modal.login-modal").modal("show")}function tt(n,t){switch(parseInt(n)){case 14:switch(parseInt(t)){case 3:r="ART_SUBJL";break;case 6:r="ART_ACCEPT";break;case 35:r="PUB_EV_ABS";break;case 8:r="ART_PUBLSH";break;case 39:r="ART_PAPEND";break;default:r="ART_SUBJL"}break;case 12:r="RT_LAUNCH"}return r}var l,e,a,v,nt,c,t,h=!1,r="";return $(function(){if(typeof window.FRSocial=="undefined"||window.FRSocial.itemId<=0){!n||!n.length;return}tt(window.FRSocial.itemId,window.FRSocial.subItemId),w(),b()}),{showLoginPopUp:p,showAllUsersFeedActivityPopup:d,hideAllUsersFeedActivityPopup:g,getFeedTemplateKeyText:function(){return r}}}(),h=function(){function u(){i.find(".frontiers-network .like").on("click",function(){ga("send","event","AP_Action","button","like-article"),window.FRSocial.loginUserId==0?t.showLoginPopUp():($(this).text("Liked").addClass("liked").removeClass("like"),i.find(".frontiers-network .button-likes button").off("click"),e())})}function e(){var n={itemId:window.FRSocial.itemId,itemTypeId:window.FRSocial.itemTypeId,ownerId:window.FRSocial.ownerId,ownerNwDbId:window.FRSocial.ownerNWDBId,entityId:window.FRSocial.entityId,conTemplateNetworkFeedKeyText:t.getFeedTemplateKeyText(),isFollowing:!1,iskeywordFollowing:!1,isJournalFollowing:!1,cookies:[FRConfiguration.FrontiersCookieRememberMe,FRConfiguration.FrontiersCookie]};$.ajaxCrossDomain({type:"POST",url:r+"/Network/SaveLikeActivity",data:n,success:function(){var n=i.find(".frontiers-network .button-likes .final-counts"),t=parseInt(n.text())+1;n.text(t),o()}})}function o(){var n={itemId:window.FRSocial.itemId,ownerId:window.FRSocial.ownerId,ownerNwDbId:window.FRSocial.ownerNWDBId,entityId:window.FRSocial.entityId,conTemplateNetworkFeedKeyText:t.getFeedTemplateKeyText(),url:f,cookies:[FRConfiguration.FrontiersCookieRememberMe,FRConfiguration.FrontiersCookie]};$.ajaxCrossDomain({url:r+"/Network/GetLikeActivity",type:"POST",data:n,success:function(n){var t=$.parseJSON(n);t&&t.length&&s(t)}})}function s(t){if(t&&t.length&&t[1]!=null&&t[2]!=null){var i="divActivityBox_"+window.FRSocial.entityId+"_"+window.FRSocial.itemId+"_1",r="divActivityBox_"+window.FRSocial.entityId+"_"+window.FRSocial.itemId+"_3";$("#"+i).length?($("#"+i+" p").html(t[1]),$("#"+i+" table").html($(t[2]).html())):$("#"+r).length?$("#"+r).after('

    '+t[1]+"

    "+t[2]+"
    "):n.prepend('

    '+t[1]+"

    "+t[2]+"
    ")}}$(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_"+t+" #divCommentTemp a.fontnormal").first().remove(),u=c($("#div_"+t+" #divCommentTemp").html()),$("#div_"+t+" #divCommentTemp").remove();var f=$("#div_"+t+" .toolbar a.btmArrow").length?1:0,e=$("#div_"+t+" p:last").text(),o=$(['
    ',' ",'
    ','',"Add","","
    ","
    "].join(""));$("#div_"+t).html(o),$(document).trigger("ui.refresh"),$("#txtUpdate_"+r+"_"+t).focus()}function d(n,i){var u=i.split("_"),f,e;$("#div_"+i).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[3]+"
    "+t[2]))}})}function y(n){if(parseInt(window.FRSocial.loginUserId)==0){t.showLoginPopUp();return}if($(n).parent().prev().length)$(n).parent().prev().show();else{var i='
    ';$(n).parent().before(i)}$(n).addClass("comment-text-focus")}function v(n){$(n).parent().prev().hide(),$(n).removeClass("comment-text-focus")}function c(n){return a(n.replace(//gi,"\n"))}function a(n){for(var i=new RegExp("]*>(.*?)","i"),t;i.test(n);)t=i.exec(n),t!=null&&t.length>1&&(n=n.replace(i,t[1]));return n}function l(n,t,i,r,u,f,e){var o=4e3,s;return n.length>o||r.length>o?(s=n.length>o?n.length:r.length,f=f+s+" characters here.",rt(f,e)):n==""&&t==""&&i==""&&r==""&&u==""?!1:!0}function rt(n,t){var i=$(".modal.login-modal"),r;if(i.length){i.find(".modal-header h4").text(t),i.find(".modal-body p").text(n),i.modal("show");return}r=$(['"].join("")),u.append(r),u.find(".modal.login-modal").modal("show")}var e=$(['','',""].join(""));return $(function(){tt()}),{showUserImage:y,hideUserImage:v,addComment:nt,editComment:g,updateComment:k,deleteComment:d}}(),c=function(){function e(){i.find(".frontiers-network .button-shares .share").on("click",function(){h(this)})}function h(n){if(parseInt(window.FRSocial.loginUserId)==0)return t.showLoginPopUp(),!1;if($(n).checkDuplicateEvent())return!1;var i={entityId:window.FRSocial.entityId,itemId:window.FRSocial.itemId,ownerId:window.FRSocial.ownerId,url:f,ownerNWDBId:window.FRSocial.ownerNWDBId,userActivityFeedId:0,itemTypeId:window.FRSocial.itemTypeId,timeOffset:s,timeNow:o,postedDate:o,isFollowing:!1,isKeywordFollowing:!1,isJournalFollowing:!1,cookies:[FRConfiguration.FrontiersCookieRememberMe,FRConfiguration.FrontiersCookie]};$.ajaxCrossDomain({type:"POST",url:r+"/Network/GetFeedDetails",data:i,success:function(t){var i=$.parseJSON(t);if(i||i.length){c(i),$(n).checkDuplicateEvent("clear");return}}})}function c(n){var w=window.FRSocial.entityId+"_"+window.FRSocial.ownerId+"_"+window.FRSocial.itemId+"_0",c="",p="",y="",e="",o="",r=$('
    '),d=['
    ','
    ','',"
    ",'',"
    "].join(""),b=['
    ','","
    "].join(""),k=['
    ','',"
    "].join(""),h=$("
    "),i,t,a,s,f;if($('').click(function(){l()}).appendTo(h),$('').appendTo(h),r.append(d).append(b).append(k),i=r.find("#divSharePopupContent"),t=$("
    "),t.html(n[0]),a=t.find("div.imgWrap").html(),a!=undefined&&a!=""&&(c=t.find("div.imgWrap").html().replace(/Thumb_50/g,"Thumb_32").replace(/default_profile_50/g,"default_profile_32")),y=t.find("div.contentWrap div.wrapper").html(),t.find("#divImgContent_"+w).length&&(e='
    '+t.find("#divImgContent_"+w).html()+"
    "),t.html(""),r.find("#imgUser").attr({src:window.FRSocial.sanPath+"Profile Library/"+window.FRSocial.loginUserId+"/Thumb_32.jpg?date="+new Date,onerror:"this.src='/Images/Frontiers/Common/Profile/default_profile_32.jpg';"}),o=e==""?['

    ',"Original post:

    ",'
    ','
    '+c+"
    ",'
    ',p+y+"
    ","
    ",'
    ',"
    "].join(""):['

    ',"Original post:

    ",'
    ','
    ',c+"
    ",'
    ',p+y+"
    ",e+"
    ",'
    ',"
    "].join(""),i.append(o),i.find("div.content").parent().find("div.imgHolder").length?i.find("div.content").removeClass("w465").addClass("w320"):i.find("div.content").removeClass("w465").addClass("w455"),i.find("div.content").find("p").removeClass("w515"),i.find("div.content").find("div.w100pc").find("p").addClass("wAuto"),i.find("#divImgContent").find("div.imgHolder").addClass("ml8"),u.find("#txtSharePopupComment").val(""),s=$(".modal.share-modal"),s.length){s.modal("show");return}f=$(['"].join("")),f.find(".modal-body").append(r),f.find(".modal-footer").append(h),u.append(f),u.find(".modal.share-modal").modal("show"),$(document).trigger("ui.refresh"),$(".modal.share-modal").find(".shareTxt textarea").focus(),v()}function l(){var u=escape(return2br($.trim($("#divCommunitySharePopup #txtSharePopupComment").val()))),f,n,e,o;u=u==""?"||":u,f=window.FRSocial.entityId+"_"+window.FRSocial.ownerId+"_"+window.FRSocial.itemId+"_0",n="",$("#divCommunitySharePopup #divSharePopupContent #divAct_"+f+" div.float_left").length&&(n=$("#divCommunitySharePopup #divSharePopupContent #divAct_"+f+" div.float_left").html()),$("#divCommunitySharePopup #divSharePopupContent #divImgContent").length&&(n=n+'
    '+$("#divCommunitySharePopup #divImgContent").html()+"
    "),e=w(),n=escape(n),o={entityId:window.FRSocial.entityId,itemId:window.FRSocial.itemId,currentItemTypeId:1,ownerId:window.FRSocial.ownerId,shareText:u,activityText:n,imageUrl:"",privacyDetails:e,conTemplateNetworkFeedKeyText:t.getFeedTemplateKeyText(),ownerNwDbId:window.FRSocial.ownerNWDBId,feedInfoText:null,cookies:[FRConfiguration.FrontiersCookieRememberMe,FRConfiguration.FrontiersCookie]},$.ajaxCrossDomain({type:"POST",url:r+"/Network/SaveShare",data:o,success:function(){var n=i.find(".frontiers-network .button-shares .final-counts"),t=parseInt(n.text())+1;n.text(t),a()}})}function a(){var i={entityId:window.FRSocial.entityId,itemId:window.FRSocial.itemId,itemTypeId:window.FRSocial.itemTypeId,ownerId:window.FRSocial.ownerId,userActivityFeedId:0,conTemplateNetworkFeedKeyText:t.getFeedTemplateKeyText(),url:f,ownerNwDbId:window.FRSocial.ownerNWDBId,createdBy:0,cookies:[FRConfiguration.FrontiersCookieRememberMe,FRConfiguration.FrontiersCookie]};$.ajaxCrossDomain({type:"POST",url:r+"/Network/GetShareActivity",data:i,success:function(t){var i=$.parseJSON(t),r;i&&i.length&&i[1]!=null&&i[2]!=null&&(r="divActivityBox_"+window.FRSocial.entityId+"_"+window.FRSocial.itemId+"_3",$("#"+r).length?($("#"+r+" p").html(i[1]),$("#"+r+" table").html($(i[2]).html())):n.prepend('

    '+i[1]+"

    "+i[2]+"
    "))}})}function v(){var n=$("#slctCommunityCommonPrivacy");if(!n.hasClass("is-pretty")){n.select2({placeholder:"Add lists or people to share this with.",width:"element",multiple:!0,id:function(n){return n.value+":"+n.key},ajax:{url:r+"/Network/GetOptionsList",dataType:"jsonp",type:"POST",xhrFields:{withCredentials:!0},data:function(n){return{tag:n.leftTrim(),loginUserId:window.FRSocial.loginUserId}},results:function(n){var o=$.parseJSON(n).d,i=$.parseJSON(o),e=$.map(i,function(n,t){var i=n.value.split("_");if(i[1]=="ROLE"&&(parseInt(i[0])>0||parseInt(i[0])==-3||parseInt(i[0])==-7))return t}),r,u,f;return e&&e.length&&(r=e[0],r>0&&(console.log("firstListIndex : "+r),i.splice(r,0,{key:"----------------",value:"0",disabled:!0}))),u=$.map(i,function(n,t){if(n.value.indexOf("_USER")>=0)return t}),u&&u.length&&(f=u[0],f>0&&(console.log("indexUser : "+f),i.splice(f,0,{key:"----------------",value:"0",disabled:!0}))),{results:i}}},formatResult:function(n){var i="",t,r,u;if(n.value=="0")i=$('
    ');else{if(r=n.value.split("_"),r[1]=="USER"){u=$("",{alt:"img",width:"32px",height:"32px",src:window.FRConfiguration.SANVirtualPath+"/Profile Library/"+r[0]+"/Thumb_24.jpg"});u.on("error",function(){this.src="/Images/Frontiers/Common/Profile/default-profile-24.jpg"});t=$('
    '),t.append(u)}i=t&&t.length?t.add('
    '+n.key+"
    "):$('
    '+n.key+"
    ")}return i},formatResultCssClass:function(n){var t="",i=n.value.split("_");return n.value=="0"?t="thinlineWrapper":i[1]=="ROLE"&&(parseInt(i[0])>0||i[0]!="-1"&&i[0]!="-3")&&(t="text-indent"),n.value.indexOf("_USER")>=0&&(t+="thumbnailWrapper"),t},formatSelection:function(n){var t=n.key=="Public"?"green-choice":"orange-choice";return''+n.key+""},formatNoMatches:function(n){return"No search results found for "+n},escapeMarkup:function(n){return n}}),n.select2("data",{key:"Public",value:"0_PUBLIC",locked:!0});n.on("change",function(t){var i=y(n,t);n.select2("data",i),p()});n.addClass("is-pretty")}}function y(n,t){var i=n.select2("data"),r,u,f,e;return i.length||(i={key:"Public",value:"0_PUBLIC",locked:!0}),t.added&&(t.added.value=="0_PUBLIC"?i={key:"Public",value:"0_PUBLIC",locked:!0}:(r=$(i).map(function(){if(this.value!="0_PUBLIC")return this}),r.length&&(i=r)),t.added.value=="-3_ROLE"?(u=$(i).map(function(){var n=this.value.split("_");if(n[1]!="ROLE"||n[0]=="-3")return this}),u.length&&(i=u)):(f=t.added.value.split("_"),f[1]=="ROLE"&&f[0]!="-3"&&(e=$(i).map(function(){if(this.value!="-3_ROLE")return this}),e.length&&(i=e)))),i}function p(){$("#divCommunityCommonPrivacy .select2-choices span[data-class]").each(function(){var n=$(this).data("class");$(this).parent().parent().addClass(n)})}function w(){var n=[],t=[],r=[],u=[],f=[],e=$("#slctCommunityCommonPrivacy").select2("data"),i;return $(e).each(function(i,r){var u=r.value.split("_");switch(u[1]){case"USER":t.push(u[0]);break;case"ROLE":n.push(u[0].replace("-1","1").replace("-7","7").replace("-3","0"))}}),i=t+"|"+n+"|"+r+"|"+u+"|"+f}$(function(){e()})}();return{showUserImage:e.showUserImage,hideUserImage:e.hideUserImage,showAllUsersFeedActivityPopup:t.showAllUsersFeedActivityPopup,hideAllUsersFeedActivityPopup:t.hideAllUsersFeedActivityPopup,comment:{add:e.addComment,edit:e.editComment,update:e.updateComment,deleteComment:e.deleteComment}}}();inherits(MarkerLabel_,google.maps.OverlayView),MarkerLabel_.getSharedCross=function(n){var t;return typeof MarkerLabel_.getSharedCross.crossDiv=="undefined"&&(t=document.createElement("img"),t.style.cssText="position: absolute; z-index: 1000002; display: none;",t.style.marginLeft="-8px",t.style.marginTop="-9px",t.src=n,MarkerLabel_.getSharedCross.crossDiv=t),MarkerLabel_.getSharedCross.crossDiv},MarkerLabel_.prototype.onAdd=function(){var n=this,r=!1,t=!1,o,s,h,f,i,c,l,u=20,a="url("+this.handCursorURL_+")",e=function(n){n.preventDefault&&n.preventDefault(),n.cancelBubble=!0,n.stopPropagation&&n.stopPropagation()},v=function(){n.marker_.setAnimation(null)};this.getPanes().overlayImage.appendChild(this.labelDiv_),this.getPanes().overlayMouseTarget.appendChild(this.eventDiv_),typeof MarkerLabel_.getSharedCross.processed=="undefined"&&(this.getPanes().overlayImage.appendChild(this.crossDiv_),MarkerLabel_.getSharedCross.processed=!0),this.listeners_=[google.maps.event.addDomListener(this.eventDiv_,"mouseover",function(t){(n.marker_.getDraggable()||n.marker_.getClickable())&&(this.style.cursor="pointer",google.maps.event.trigger(n.marker_,"mouseover",t))}),google.maps.event.addDomListener(this.eventDiv_,"mouseout",function(i){(n.marker_.getDraggable()||n.marker_.getClickable())&&!t&&(this.style.cursor=n.marker_.getCursor(),google.maps.event.trigger(n.marker_,"mouseout",i))}),google.maps.event.addDomListener(this.eventDiv_,"mousedown",function(i){t=!1,n.marker_.getDraggable()&&(r=!0,this.style.cursor=a),(n.marker_.getDraggable()||n.marker_.getClickable())&&(google.maps.event.trigger(n.marker_,"mousedown",i),e(i))}),google.maps.event.addDomListener(document,"mouseup",function(e){var s;if(r&&(r=!1,n.eventDiv_.style.cursor="pointer",google.maps.event.trigger(n.marker_,"mouseup",e)),t){if(i){s=n.getProjection().fromLatLngToDivPixel(n.marker_.getPosition()),s.y+=u,n.marker_.setPosition(n.getProjection().fromDivPixelToLatLng(s));try{n.marker_.setAnimation(google.maps.Animation.BOUNCE),setTimeout(v,1406)}catch(h){}}n.crossDiv_.style.display="none",n.marker_.setZIndex(o),f=!0,t=!1,e.latLng=n.marker_.getPosition(),google.maps.event.trigger(n.marker_,"dragend",e)}}),google.maps.event.addListener(n.marker_.getMap(),"mousemove",function(f){var e;r&&(t?(f.latLng=new google.maps.LatLng(f.latLng.lat()-s,f.latLng.lng()-h),e=n.getProjection().fromLatLngToDivPixel(f.latLng),i&&(n.crossDiv_.style.left=e.x+"px",n.crossDiv_.style.top=e.y+"px",n.crossDiv_.style.display="",e.y-=u),n.marker_.setPosition(n.getProjection().fromDivPixelToLatLng(e)),i&&(n.eventDiv_.style.top=e.y+u+"px"),google.maps.event.trigger(n.marker_,"drag",f)):(s=f.latLng.lat()-n.marker_.getPosition().lat(),h=f.latLng.lng()-n.marker_.getPosition().lng(),o=n.marker_.getZIndex(),c=n.marker_.getPosition(),l=n.marker_.getMap().getCenter(),i=n.marker_.get("raiseOnDrag"),t=!0,n.marker_.setZIndex(1e6),f.latLng=n.marker_.getPosition(),google.maps.event.trigger(n.marker_,"dragstart",f)))}),google.maps.event.addDomListener(document,"keydown",function(r){t&&r.keyCode===27&&(i=!1,n.marker_.setPosition(c),n.marker_.getMap().setCenter(l),google.maps.event.trigger(document,"mouseup",r))}),google.maps.event.addDomListener(this.eventDiv_,"click",function(t){(n.marker_.getDraggable()||n.marker_.getClickable())&&(f?f=!1:(google.maps.event.trigger(n.marker_,"click",t),e(t)))}),google.maps.event.addDomListener(this.eventDiv_,"dblclick",function(t){(n.marker_.getDraggable()||n.marker_.getClickable())&&(google.maps.event.trigger(n.marker_,"dblclick",t),e(t))}),google.maps.event.addListener(this.marker_,"dragstart",function(){t||(i=this.get("raiseOnDrag"))}),google.maps.event.addListener(this.marker_,"drag",function(){t||i&&(n.setPosition(u),n.labelDiv_.style.zIndex=1e6+(this.get("labelInBackground")?-1:1))}),google.maps.event.addListener(this.marker_,"dragend",function(){t||i&&n.setPosition(0)}),google.maps.event.addListener(this.marker_,"position_changed",function(){n.setPosition()}),google.maps.event.addListener(this.marker_,"zindex_changed",function(){n.setZIndex()}),google.maps.event.addListener(this.marker_,"visible_changed",function(){n.setVisible()}),google.maps.event.addListener(this.marker_,"labelvisible_changed",function(){n.setVisible()}),google.maps.event.addListener(this.marker_,"title_changed",function(){n.setTitle()}),google.maps.event.addListener(this.marker_,"labelcontent_changed",function(){n.setContent()}),google.maps.event.addListener(this.marker_,"labelanchor_changed",function(){n.setAnchor()}),google.maps.event.addListener(this.marker_,"labelclass_changed",function(){n.setStyles()}),google.maps.event.addListener(this.marker_,"labelstyle_changed",function(){n.setStyles()})]},MarkerLabel_.prototype.onRemove=function(){var n;for(this.labelDiv_.parentNode.removeChild(this.labelDiv_),this.eventDiv_.parentNode.removeChild(this.eventDiv_),n=0;n