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+"<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.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,"<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.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,""):""}function FRModal(n){var e=this,f={modalId:"",modalClass:"",emitter:null,contentHeader:$("<h3>This is a modal!<\/h3>"),contentBody:$("<p>There is no content...<\/p>"),contentFooter:$('<button class="btn btn-gray-light" data-dismiss="modal">Close<\/button>'),hasClose:!1,hasHeader:!0,hasBody:!0,hasFooter:!0,backdrop:"static",show:!0,keyboard:!1,onshown:function(){},onshow:function(){},onhide:function(){},onhidden:function(){}},t,i,r,u;n=$.extend({},f,n);t=$('<div class="modal simple hide fade" tabindex="-1" data-focus-on="input:first" />');t.addClass(n.modalClass);t.attr("id",n.modalId);n.hasClose&&t.append('<div class="close"><a class="close" data-dismiss="modal" href="#">&times;<\/a><\/div>');n.hasHeader&&(i=$("<div/>"),i.addClass("modal-header"),i.append(n.contentHeader),t.append(i));n.hasBody&&(r=$("<div/>"),r.addClass("modal-body"),r.append(n.contentBody),t.append(r));n.hasFooter&&(u=$("<div/>"),u.addClass("modal-footer"),u.append(n.contentFooter),t.append(u));t.on("show",function(){n.onshow()});t.on("shown",function(){n.onshown()});t.on("hide",function(){n.onhide()});t.on("hidden",function(){n.onhidden()});t.on("click","button",function(){var n=$(this).data("action");n&&$(document).trigger(n)});return t.modal({keyboard:n.keyboard,show:n.show,backdrop:n.backdrop}),t}var FRAlert=function(){var n=this;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")});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('<i class="fr-icon-v2-info-circled"><\/i>');t.show()};FRAlert.prototype.success=function(n){var t=this;t.init(n);t.alert.addClass("success");t.alert.find(".icon").html('<i class="fr-icon-v2-ok-circle"><\/i>');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('<i class="fr-icon-v2-attention-circled"><\/i>');t.show()};FRAlert.prototype.error=function(n){var t=this;t.init(n);t.alert.addClass("error");t.alert.find(".icon").html('<i class="fr-icon-v2-cancel-circle"><\/i>');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(){e||$(".ibar .loading").show()}function h(){e||$(".ibar .loading").hide()}function u(){e=!0;$(".ibar .loading").show();$(".ibar .loading").html('<i class="fr-icon-v2-attention-circled"><\/i>')}function o(){}function n(n,e){if(FRConfiguration.Environment=="Development"&&(f.push(e),o(n,e)),n=="log"&&console.log(e),n=="basic"){var s=new FRAlert;s.basic(e)}n=="success"&&(t&&t.destroy(),t=new FRAlert,t.success(e));n=="warning"&&(u(),i&&i.destroy(),i=new FRAlert,i.warning(e));n=="error"&&(u(),r&&r.destroy(),r=new FRAlert,r.error(e))}function c(){console.log("FRLog | This is the full stack...");for(var n=0;n<f.length;n++)console.log(f[n])}var f=[],e=!1,t,i,r;return $(document).ajaxSend(function(){s()}),$(document).ajaxStop(function(){h()}),$(document).ajaxError(function(n,t,i,r){r=="abort"||r=="Abort"||u()}),{print:c,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){FRConfiguration.Environment=="Development"&&(console.log(t),n("basic",t))}}}(),function(){window.d=FRLog.debug}();FRError.prototype=new 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});}else if(r=="timeout"||r=="Timeout")throw new FRError({name:"Connection Error",message:"Timeout"});else r=="abort"||r=="Abort"||FRConfiguration.Environment=="Development"});window.onerror=function(){return FRConfiguration.Environment=="Development"?!1:FRConfiguration.Environment=="Test"?!1:FRConfiguration.Environment=="Live"?!0:void 0};FRSafe=function(){return{boolean:function(n){return n=="True"?!0:!1}}}();$.extend({getFrontiersApi:function(n,t){return getFrontiersApi(n,t)},getHTML:function(n,t){return jQuery.get(n,undefined,t,"html")},getText:function(n,t){return jQuery.get(n,undefined,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.msie&&parseInt($.browser.version,10)<10&&window.XDomainRequest?(document.location.protocol=="http:"&&(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(){return},i.ontimeout=function(){return},i.onprogress=function(){return},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")?!0:(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 this.attr(n)!==undefined};$.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=t.substring(0,n),t.indexOf(" ")>0?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+"&nbsp;&hellip;":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+"&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)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=$('<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()})});$.extend({FRModal:function(n){return new FRModal(n)}});$(document).ready(function(){$(document).on("click",".frModal",function(){var n=new FRModal({emitter:$(this)})})});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!"))}$(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||(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;t<n.length;t++)if(i=n[t].string,r=n[t].prop,this.versionSearchString=n[t].versionSearch||n[t].identity,i){if(i.indexOf(n[t].subString)!=-1)return n[t].identity}else if(r)return n[t].identity},searchVersion:function(n){var t=n.indexOf(this.versionSearchString);if(t!=-1)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=function(){function n(n,t,i){var r=new Date,u;r.setDate(r.getDate()+i);u=JSON.stringify(t)+(i==null?"":"; expires="+r.toUTCString());document.cookie=n+"="+u}function t(n){var t=document.cookie,i=t.indexOf(" "+n+"="),r;return i==-1&&(i=t.indexOf(n+"=")),i==-1?t=null:(i=t.indexOf("=",i)+1,r=t.indexOf(";",i),r==-1&&(r=t.length),t=t.substring(i,r)),t}function i(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("; ")}}return{set:n,get:t,getAll:i}}(),FRBase64=function(){function t(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(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;t<n.length;)i=n.charCodeAt(t),i<128?(r+=String.fromCharCode(i),t++):i>191&&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<i.length;)s=i.charCodeAt(e++),r=i.charCodeAt(e++),u=i.charCodeAt(e++),c=s>>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<t.length;)l=n.indexOf(t.charAt(u++)),e=n.indexOf(t.charAt(u++)),f=n.indexOf(t.charAt(u++)),o=n.indexOf(t.charAt(u++)),s=l<<2|e>>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 i(r)}}}()