var JSON,Bnet,sidebarTooltip;JSON||(JSON={}),function(){"use strict";function i(n){return n<10?"0"+n:n}function o(n){return e.lastIndex=0,e.test(n)?'"'+n.replace(e,function(n){var t=s[n];return typeof t=="string"?t:"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+n+'"'}function u(i,f){var s,l,h,a,v=n,c,e=f[i];e&&typeof e=="object"&&typeof e.toJSON=="function"&&(e=e.toJSON(i));typeof t=="function"&&(e=t.call(f,i,e));switch(typeof e){case"string":return o(e);case"number":return isFinite(e)?String(e):"null";case"boolean":case"null":return String(e);case"object":if(!e)return"null";if(n+=r,c=[],Object.prototype.toString.apply(e)==="[object Array]"){for(a=e.length,s=0;s<a;s+=1)c[s]=u(s,e)||"null";return h=c.length===0?"[]":n?"[\n"+n+c.join(",\n"+n)+"\n"+v+"]":"["+c.join(",")+"]",n=v,h}if(t&&typeof t=="object")for(a=t.length,s=0;s<a;s+=1)typeof t[s]=="string"&&(l=t[s],h=u(l,e),h&&c.push(o(l)+(n?": ":":")+h));else for(l in e)Object.prototype.hasOwnProperty.call(e,l)&&(h=u(l,e),h&&c.push(o(l)+(n?": ":":")+h));return h=c.length===0?"{}":n?"{\n"+n+c.join(",\n"+n)+"\n"+v+"}":"{"+c.join(",")+"}",n=v,h}}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+i(this.getUTCMonth()+1)+"-"+i(this.getUTCDate())+"T"+i(this.getUTCHours())+":"+i(this.getUTCMinutes())+":"+i(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var f=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,r,s={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},t;typeof JSON.stringify!="function"&&(JSON.stringify=function(i,f,e){var o;if(n="",r="",typeof e=="number")for(o=0;o<e;o+=1)r+=" ";else typeof e=="string"&&(r=e);if(t=f,f&&typeof f!="function"&&(typeof f!="object"||typeof f.length!="number"))throw new Error("JSON.stringify");return u("",{"":i})});typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){function walk(n,t){var r,u,i=n[t];if(i&&typeof i=="object")for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(u=walk(i,r),u!==undefined?i[r]=u:delete i[r]);return reviver.call(n,t,i)}var j;if(text=String(text),f.lastIndex=0,f.test(text)&&(text=text.replace(f,function(n){return"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse");})}(),function(){if(window.addEventListener){var n=!0;window.addEventListener("load",function(){setTimeout(function(){n=!1},0)},!1);window.addEventListener("popstate",function(t){n&&document.readyState==="complete"&&(t.preventDefault(),t.stopImmediatePropagation())},!1)}}();Bnet=$.extend(Bnet,{_model:null,_view:null,_controller:null,_init:function(){this._model.init();this._view.init();this._controller.init()}});jQuery(function(n){n("html").addClass("documentReady");Bnet._setup();n(document).on("newPageCreated",function(){Bnet._setMvc(!0)})});window.Hash={};Bnet.setHash=function(){window.Hash=Utility.parseHash(window.location.hash);viewModels.hash(window.Hash)};Bnet._setup=function(){Bnet.setHash();Bnet._setMvc(!1)};Bnet._setMvc=function(n){$("body").hasClass("Clans")&&(Bnet._controller=new Bnet.ClanController);Bnet._model=Bnet._model||new Bnet.Model;Bnet._controller=Bnet._controller||new Bnet.Controller;Bnet._view=Bnet._view||new Bnet.View;Bnet._init(n)};Bnet.trackPageview=function(n){var t={};typeof n!="undefined"&&(t.page=n);window.ga("send","pageview",t)};Bnet.trackEvent=function(n,t,i,r,u){var f={};typeof i!="undefined"&&(f.eventLabel=i);typeof r!="undefined"&&(f.eventValue=r);u=u||{};$.extend(f,u);window.ga("send","event",n,t,f)};Bnet.onError=Bnet.onError||function(n,t,i,r,u){try{if(typeof u!="undefined"&&u!=null){var f=window.location.pathname,e=u.stack;Bnet.trackEvent("Errors",f,e)}ServerVars.ShowErrorsInPage&&$("body").addClass("has-js-error")}catch(o){}};Bnet.Controller=function(){this.navScrollThreshold=150};Bnet.Controller.prototype.init=function(){Bnet._view.updateDimensions();$(window).on({"load resize":function(){Bnet._view.updateDimensions()}});$("body").on("click",function(n){if($("footer").hasClass("active")){if($(n.target).is("footer")||$(n.target).parents("footer").length)return;Bnet._view.toggleFooter()}else($(n.target).is("footer")||$(n.target).parents("footer").length)&&Bnet._view.toggleFooter()});this.sidebarControls();this.filterBarMobileScroll();this.navScroll()};Bnet.Controller.prototype.onUrlParsed=function(){};Bnet.Controller.prototype.filterBarMobileScroll=function(){var n=function(){var t=$(".filterBar"),n=$(".filterBarContainer"),r,i;t.length&&n.length&&(r=t.scrollLeft()+n.width(),i=t[0].scrollWidth,i>t.width()&&t.scrollLeft()>0?n.addClass("more-to-scroll-left"):n.removeClass("more-to-scroll-left"),i>r?n.addClass("more-to-scroll-right"):n.removeClass("more-to-scroll-right"))};if(Modernizr.mobile){setTimeout(function(){var t,i,r;n();t=$(".filterBar nav a.current");t.length&&(i=$(".filterBar"),i.length&&(r=i.scrollLeft()+t.position().left+t.width()/2-i.width()/2+18,$(".filterBar").animate({scrollLeft:r})))},50);$(".filterBar").on("scroll",function(){n()})}};Bnet.Controller.prototype.navScroll=function(){var n=$(window),t=this;n.on("scroll",function(){n.scrollTop()>t.navScrollThreshold?Bnet._view.navScroll(!0):Bnet._view.navScroll(!1)})};Bnet.Controller.prototype.sidebarControls=function(){$("#sidebar").customScroll();var n=!1;if(Modernizr.ietouchbrowser){$(document).on({click:function(){n||Bnet._view.sidebarOpen();n=!0}},".ietouchbrowser #sidebar");$(document).on({click:function(t){n&&($(t.target).parents("#sidebar").length||$(t.target).attr("id")==="sidebar"||(Bnet._view.sidebarClose(),n=!1))}})}else if(Modernizr.touch){$(document).on({click:function(){n||Bnet._view.sidebarOpen();n=!0}},".touch #sidebar");$(document).on({click:function(t){n&&($(t.target).parents("#sidebar").length||$(t.target).attr("id")==="sidebar"||(Bnet._view.sidebarClose(),n=!1))}})}else $(document).on({mouseenter:function(){Bnet._view.sidebarOpen()},mouseleave:function(){Bnet._view.sidebarClose()}},"#sidebar");$("#sidebar").on("scroll",function(){var n,t;if(!Bnet._view.sidebarTooltips.length)return!1;for(n=0;n<Bnet._view.sidebarTooltips.length;n++)t=Bnet._view.sidebarTooltips[n],t.isOpen&&t.positionOnScroll()});$(document).on("click","#sidebar .tab > .trigger",function(n){n.preventDefault();Bnet._view.sidebarChangeTab($(this).closest(".tab").data("index"),$(this).closest(".panel"))})};Bnet.View=function(){this.navWidth=60;this.sidebarWidth=249;this.headerHeight=null;this.minWindowWidth=1460;this.currentCSS=$("link.localCSS").map(function(){return $(this).attr("href")}).get();this.sidebarTooltips=[];this.sidebarCreateTooltips()};Bnet.View.prototype.init=function(){var n=this;this.headerHeight=$(".Nav_Top").height();n.softInit();$(document).on("ready newPageCreated",function(){n.softInit()})};Bnet.View.prototype.showMobileLeftMenu=function(){$body.hasClass("slideShowLeftNav")?$body.removeClass("slideShowLeftNav"):$body.addClass("slideShowLeftNav")};Bnet.View.prototype.showMobileRightMenu=function(){$("body").hasClass("slideShowRightNav")?$body.removeClass("slideShowRightNav"):$body.addClass("slideShowRightNav")};Bnet.View.prototype.softInit=function(){$("body").hasClass("NoSidebar")&&(this.sidebarWidth=0);this.updateDimensions()};Bnet.View.prototype.updateDimensions=function(){$("#sidebar").length&&this.updateSidebarDimensions()};Bnet.View.prototype.updateSidebarDimensions=function(){$("body").hasClass("NoSidebar")||$("body").hasClass("ClosedSidebar")?Bnet._view.sidebarWidth=0:$(window).width()<this.minWindowWidth?($("body").addClass("compact"),Bnet._view.sidebarWidth=0):($("body").removeClass("compact"),Bnet._view.sidebarWidth=249);$("#sidebarTab > div").width(Bnet._view.sidebarWidth/$("#sidebarTab > div").length)};Bnet.View.prototype.sidebarOpen=function(){$("#sidebar").addClass("opened").removeClass("closed");$("#sidebar").trigger("scroll")};Bnet.View.prototype.sidebarClose=function(){$("#sidebar").addClass("closed").removeClass("opened")};Bnet.View.prototype.sidebarScrollToTop=function(){$("#sidebar")[0].scrollTop=0};Bnet.View.prototype.sidebarHide=function(){$("#sidebar").hide(0);this.sidebarForceClose();$("body").addClass("compact")};Bnet.View.prototype.sidebarShow=function(){$("#sidebar").show(0);this.sidebarUnforceClose()};Bnet.View.prototype.sidebarForceClose=function(){$("#sidebar").addClass("closed");$("body").addClass("ClosedSidebar");this.updateSidebarDimensions()};Bnet.View.prototype.sidebarUnforceClose=function(){$("#sidebar").removeClass("closed");$("body").removeClass("ClosedSidebar");this.updateSidebarDimensions()};Bnet.View.prototype.sidebarChangeTab=function(n,t){typeof t=="undefined"&&(t=$("#sidebar"));t.find(".tab").removeClass("current");t.find(".tab").eq(n).addClass("current");$("#sidebar").customScroll("update")};Bnet.View.prototype.sidebarCreateTooltips=function(){var r=this,n=[],t,i;if($("#sidebar .tooltip").each(function(){$(this).parent().data("tooltipRef",$(this));$(this).data("tooltipParent",$(this).parent());$("#tooltips").append($(this))}),$("#tooltips .tooltip").each(function(){n.push($(this))}),n.length)for(t=0;t<n.length;t++)i=new sidebarTooltip(n[t],n[t].data("tooltipParent")),n[t].data("tooltip",i),r.sidebarTooltips.push(i)};Bnet.View.prototype.navScroll=function(n){n?$(".Sub_Nav").addClass("scrolled"):$(".Sub_Nav").removeClass("scrolled")};Bnet.View.prototype.toggleFooter=function(){$("footer").toggleClass("active")};Bnet.View.prototype.adjustSubNav=function(){var r,u;$(".nav_sub").hasClass("overflow")&&($(".nav_sub").removeClass("overflow"),$(".nav_more").remove(),$(".nav_sub .removed").removeClass("removed"));var t=0,i=0,n=$('<li class="nav_more"><a>'+Localizer.Helptext.viewmore+"<\/a><ul><\/ul><\/li>");if($(".nav_sub .preorder").before(n),r=n.outerWidth(),u=$(".nav_sub .preorder").outerWidth(),$(".nav_sub li:visible").each(function(){$(this).is(n)||$(this).is(".preorder")||(t+=$(this).outerWidth(),t>960-r-u&&(n.find("ul").append($(this).clone()),$(this).addClass("removed"),i++))}),i<=0)n.remove();else{$(".nav_sub").addClass("overflow");$(".nav_more > a").on("click",function(){(Modernizr.touch||Modernizr.ietouch)&&($(this).parent().hasClass("opened")?$(this).parent().removeClass("opened"):$(this).parent().addClass("opened"))})}};Bnet.Model=function(){};Bnet.Model.prototype.init=function(){this.checkAuth()};Bnet.Model.prototype.checkAuth=function(){viewModels.signedIn(Utility.IsAuthenticated())};sidebarTooltip=function(n,t,i){this.$el=n;this.$parent=t;this.isOpen=!1;this.opts=$.extend(i||{},{top:0,reactOnScroll:!0,onOpen:function(){},onClose:function(){}});this.position()};sidebarTooltip.prototype.position=function(){var n=this;this.$el.css({top:n.opts.top+n.$parent.offset().top})};sidebarTooltip.prototype.positionOnScroll=function(){var n=this;if(!this.opts.reactOnScroll)return!1;this.$el.css({top:n.opts.top+n.$parent.offset().top})};sidebarTooltip.prototype.open=function(){this.position();this.$el.addClass("on");this.isOpen=!0;this.opts.onOpen()};sidebarTooltip.prototype.close=function(){this.$el.removeClass("on");this.isOpen=!1;this.opts.onClose()};$(document).ready(function(){var n,i,r,t;$(".no-placeholder").on("focus",".floatingLabel input, .floatingLabel textarea",function(){$(this).closest(".floatingLabel").addClass("hideLabel")});$(".no-placeholder").on("blur",".floatingLabel input, .floatingLabel textarea",function(){$(this).val()===""&&$(this).closest(".floatingLabel").removeClass("hideLabel")});$(".no-placeholder").on("click",".floatingLabel",function(){var n=$(this);n.hasClass("hideLabel")||(n.addClass("hideLabel"),n.find("input[type='text'], textarea").get(0).focus())});$(".no-placeholder").on("click",".btn_cancel",function(){$(this).closest(".container_form").find(".hideLabel").removeClass("hideLabel")});if(!Modernizr.mobile)$(document).on("keyup",".autoGrow",function(){var i=this.scrollHeight,r=this.clientHeight,n=$(this),u=n.offset().top;if(i>r){var t=parseInt(n.css("line-height"),10),f=$(window).height(),e=u+i+5*(t?t:25);e+150>=f?(this.style.overflow="auto",n.hasClass("hasGrown")||n.height(r+5*(t?t:25)+"px")):n.height(i+5*(t?t:25)+"px");n.addClass("hasGrown")}});$("input[type=textbox], textarea").on("paste",function(){var t=$(this),i=t,n=0;if(this.hasAttribute("maxlength")){n=t.attr("data-maxlength")||t.attr("maxlength");t.removeAttr("maxlength");t.on("blur.pasteTruncate",function(t){t.stopImmediatePropagation();var r=$(this);r.val().length>n&&(r.attr("maxlength",n).prop("maxlength",n),r.val(r.val().substring(0,n-1)),Utility.alert(Localizer.fnStringReplace(Localizer.Messages.truncatedstring,{"0":n})));i.off("blur.pasteTruncate")})}});$(window).on("beforeunload",function(){$("#text_search").val("")});$(document).on("click",".externalLink",function(n){var i=!1,t,r;try{$(this.href).find("script").length&&(n.preventDefault(),n.stopImmediatePropagation(),i=!0)}catch(n){}if(!i)if($(this).find(".spoiler").length)n.preventDefault();else if(t=this.href.replace(/[\<]/gi,"%3C"),t=t.replace(/[\>]/gi,"%3E"),!t.match(bungieNetPlatform.platformSettings.internalLinkRegex)){if(typeof viewModels!="undefined"&&viewModels.loggedInUserModelIsLoaded()&&viewModels.loggedInUserModel().adultMode())return;n.preventDefault();r={"0":t};Utility.alert(Localizer.fnStringReplace(Localizer.Messages.externallinkmessage,r));$("#alert").addClass("warning")}});$(document).on("click",".spoiler",function(){$(this).hasClass("opened")?$(this).removeClass("opened"):$(this).addClass("opened")});n="";$(document).on("mouseover",".btn_quote",function(){n=window.getSelection().toString()});$(document).on("click",".bbcode a",function(t){var s,o;t.preventDefault();var f=$(this),r=f.closest(".container_textarea").find("textarea"),c=r.get(0),e=Utility.getInputSelectionPosition(c),h=n!==""?n:"",u=!1,i="";e.start>-1&&e.end>0&&e.end!==e.start&&(u=!0,i=[r.val().slice(0,e.start),"[$1]",r.val().slice(e.start)].join(""),i=[i.slice(0,e.end+4),"[$2]",i.slice(e.end+4)].join(""));f.hasClass("btn_bold")?u?(i=i.replace("[$1]","[b]"),i=i.replace("[$2]","[/b]"),r.val(i)):r.val(r.val()+" [b][/b]"):f.hasClass("btn_italic")?u?(i=i.replace("[$1]","[i]"),i=i.replace("[$2]","[/i]"),r.val(i)):r.val(r.val()+" [i][/i]"):f.hasClass("btn_underline")?u?(i=i.replace("[$1]","[u]"),i=i.replace("[$2]","[/u]"),r.val(i)):r.val(r.val()+" [u][/u]"):f.hasClass("btn_quote")?u?(i=i.replace("[$1]","[quote]"),i=i.replace("[$2]","[/quote]"),r.val(i)):h!==""?r.val(r.val()+"[quote]"+h+"[/quote]"):(s="",r.closest(".postCreation").hasClass("edit")?(o=r.closest("[data-actualParentPostId]").attr("data-actualParentPostId"),s=$("li[id="+o+"], #forumPost[data-postId="+o+"]").length?$("li[id="+o+"], #forumPost[data-postId="+o+"]").find(".post_body").first().html():""):s=r.closest(".post").find(".post_body").html(),r.val(r.val()+(r.val()!==""?" ":"")+"[quote]"+Utility.decodeHTML(Utility.bbCodesReverse(s))+"[/quote]")):f.hasClass("btn_spoiler")?u?(i=i.replace("[$1]","[spoiler]"),i=i.replace("[$2]","[/spoiler]"),r.val(i)):r.val(r.val()+" [spoiler][/spoiler]"):f.hasClass("btn_armory")?u?(i=i.replace("[$1]","[armory]"),i=i.replace("[$2]","[/armory]"),r.val(i)):r.val(r.val()+" [armory][/armory]"):f.hasClass("btn_link")?u?(i=i.replace("[$1]","[url]"),i=i.replace("[$2]","[/url]"),r.val(i)):r.val(r.val()+" [url][/url]"):f.hasClass("btn_namedlink")&&(u?(i=i.replace("[$1]","[url="+PageUrls.root+"]"),i=i.replace("[$2]","[/url]"),r.val(i)):r.val(r.val()+" [url="+PageUrls.root+"]link[/url]"));u=!1;$(".bbcode").next("textarea").focus()});$("body.Community.Tags").length&&(i=setTimeout(function(){$(".dualColList:empty").length&&$(".dualColList").append($("<li/>").text("No tags found."))},5e3));$(document).on("focus","input,textarea",function(){$.browser.msie&&$.browser.version===10&&($(this).attr("placeholder")&&$(this).data("placeholder",$(this).attr("placeholder")),$(this).val()===$(this).attr("placeholder")&&$(this).val(""))});if(!Modernizr.androidtablet&&!Modernizr.mobile||Modernizr.mobile&&Modernizr.ipad){r="onmousewheel"in window?"mousewheel":"DOMMouseScroll";t=0;$(window).on("scroll",function(){if($(this).height()>574){var n=$(window).scrollTop();n>0?t-n<0?$(".Sub_Nav").addClass("hidden"):$(".Sub_Nav").removeClass("hidden"):$(".Sub_Nav").removeClass("hidden");t=n}})}Bnet.View.prototype.adjustSubNav()});$(document).on("click focus keyup","input, textarea",function(){var n=$(this),i=this,t;t=n.parent().find(".error:visible").length?n.parent().find(".error:visible"):$(".error:visible").filter(function(){var n=$(this);if(n.data("for").length)return n.data("for").get(0)===i});t.remove();n.removeClass("has-error").closest(".has-error").removeClass("has-error")})