window.vBulletin=window.vBulletin||{};window.vBulletin.phrase=window.vBulletin.phrase||{};window.vBulletin.phrase.precache=window.vBulletin.phrase.precache||[];window.vBulletin.phrase.precache=$.merge(window.vBulletin.phrase.precache,[]);window.vBulletin.Help={};(function(A){A(document).ready(function(){A(".faqSearchControl").on("click",function(E){E.preventDefault();$this=A(this);if($this.hasClass("option-less")){A(".faqSearchControl.option-more").removeClass("h-hide");A(".faqSearchFields").addClass("h-hide")}if($this.hasClass("option-more")){$this.addClass("h-hide");A(".faqSearchFields").removeClass("h-hide")}});window.vBulletin.Help.show=function(E){$faqAnswer=A(".faq-content .faq-answer");A(".faq-group-title",$faqAnswer).html(E.title);A(".faq-group-body",$faqAnswer).html(E.text);A(".faq-groups .faq-link.selected").removeClass("selected");A(".faq-groups .faq-link").each(function(){var F=A(this);if(F.data("group")==E.faqparent&&F.data("item")==E.faqname){F.addClass("selected")}});window.vBulletin.Help.highlight($faqAnswer)};window.vBulletin.Help.highlight=function(E){var F=A("#faqsearchquery").data("highlight");if(F){A(F.split(",")).each(function(H,G){A(".faq-group-body",E).highlight(G)})}};A(".help-widget").off("click",".faq-link").on("click",".faq-link",function(F){F.preventDefault();var G=A(this).data("group");var E=A(this).data("item");window.location.hash=A(this).data("path");if(window.vBulletin["Help"][G]&&window.vBulletin["Help"][G][E]){window.vBulletin.Help.show(window.vBulletin["Help"][G][E]);return }vBulletin.AJAX({url:vBulletin.getAjaxBaseurl()+"/ajax/api/help/getAnswers",data:{group:G},success:function(H,I,J){if(H.answers){window.vBulletin["Help"][G]=H.answers;if(window.vBulletin["Help"][G][E]){window.vBulletin.Help.show(window.vBulletin["Help"][G][E])}else{console.log("can't load help for "+G+"/"+E)}}else{console.log("can't load help for "+G)}}})});var B={heightStyle:"content",create:function(E,F){A(this).parent().css("height","auto")}};A(".faqs ul.acc").accordion(B);if(window.location.hash){var C=window.location.hash.substr(1);var D=A(C.split("/")).each(function(E,G){if(G.match(/^\w*$/)){var F=A(".faq-groups").first().find("."+G);var H=F.parent().prevAll().length;F.closest("ul.faq-group-body").accordion("option","active",H);if(F.hasClass("faq-link")){F.click()}}})}window.vBulletin.Help.highlight(A(".faq-content .faq-answer"))})})(jQuery);