/*=======================================================================*\
|| ###################################################################### ||
|| # vBulletin 5.1.9 Patch Level 4
|| # ------------------------------------------------------------------ # ||
|| # Copyright 2000-2016 vBulletin Solutions Inc. All Rights Reserved.  # ||
|| # This file may not be redistributed in whole or significant part.   # ||
|| # ----------------- VBULLETIN IS NOT FREE SOFTWARE ----------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html   # ||
|| ###################################################################### ||
\*========================================================================*/
(function(C){if(typeof window.console!="object"){window.console={}}var D=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];for(var B=0;B<D.length;B++){if(typeof window.console[D[B]]!="function"&&typeof window.console[D[B]]!="object"){window.console[D[B]]=function(){}}}if(!Object.keys){Object.keys=(function(){var G=Object.prototype.hasOwnProperty,H=!({toString:null}).propertyIsEnumerable("toString"),F=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],E=F.length;return function(K){if(typeof K!=="object"&&typeof K!=="function"||K===null){throw new TypeError("Object.keys called on non-object")}var I=[];for(var L in K){if(G.call(K,L)){I.push(L)}}if(H){for(var J=0;J<E;J++){if(G.call(K,F[J])){I.push(F[J])}}}return I}})()}C.ajaxPrefilter("script",function(E){E.cache=true});C.ajaxPrefilter(function(E,I,G){if(typeof (E.data)=="undefined"){E.data="securitytoken="+pageData.securitytoken;if(typeof E.formData!=="undefined"){if(Array.isArray(E.formData)){E.formData.push({name:"securitytoken",value:pageData.securitytoken})}}}else{if(typeof FormData!=="undefined"&&E.data instanceof FormData){E.data.append("securitytoken",pageData.securitytoken)}else{var F=true;var H=E.data.split("&");C.each(H,function(J,K){if(K.match(/^securitytoken=/)){F=false;return false}});if(F){E.data+="&securitytoken="+pageData.securitytoken}}}});C.ajaxPrefilter(function(E,G,F){(function(){var I=vBulletin.getAjaxBaseurl();if((G.url.indexOf(I)==0&&G.url.substr(I.length).indexOf("/ajax/render/")==0)||(G&&G.data&&G.data.isAjaxTemplateRender)){var H=E.success;E.success=function(){console.log("Intercept AJAX template render calls: Start (URL: {0})".format(E.url));var O=arguments[0];if(!O||typeof O!="object"||C.isEmptyObject(O)){if(typeof H=="function"){return H.apply(this,arguments)}return false}if(G.data&&G.data.isAjaxTemplateRenderWithData){arguments[0]=O}else{arguments[0]=O.template}var T=O.css_links;if(!T||T.length==0){console.log("Intercept AJAX template render calls: No CSS");if(typeof H=="function"){console.log("Intercept AJAX template render calls: Calling original success handler");return H.apply(this,arguments)}}else{console.log("Intercept AJAX template render calls: Has CSS");var N=/sheet=([^&]+)&/,V=T.pop(),Q=(V.match(N)!=null);T.push(V);var J=function(X){var Y=X.match(N);var W={};if(Y&&Y[1]){C.each(Y[1].split(","),function(Z,a){W[a]=X})}else{W[X.replace(/^.*\//g,"")]=X}return W};var P={};C("head link[rel=stylesheet]").each(function(){C.extend(P,J(C(this).attr("href")))});var S={};C.each(T,function(W,X){C.extend(S,J(X))});var U=[];C.each(S,function(W,X){if(W&&typeof P[W]=="undefined"){if(Q){U.push(W)}else{U.push(X)}}});if(U.length==0){console.log("Intercept AJAX template render calls: Needed CSS is already on the page");if(typeof H=="function"){console.log("Intercept AJAX template render calls: Calling original success handler");return H.apply(this,arguments)}}else{var L=[];if(Q){console.log("Intercept AJAX template render calls: found DB CSS");L.push(V.replace(/sheet=[^&]+&/,"sheet="+U.join(",")+"&"))}else{console.log("Intercept AJAX template render calls: found FS CSS");L=U}var K=this,R=arguments;console.log("Intercept AJAX template render calls: Fetching CSS: {0}".format(L.join(", ")));var M=function(X){if(X.length==0){console.log("Intercept AJAX template render calls: Done. Calling original callback.");window.setTimeout(function(){if(typeof H=="function"){return H.apply(K,R)}},50);return }var W=C("<div />").append(X.shift()).text();console.log("Intercept AJAX template render calls: Fetching CSS file: {0}".format(W));C.get(W,{cache:true},function(Z){var Y=C("<link />",{rel:"stylesheet",type:"text/css",href:W}),a=C(".js-additional-css");if(a.length==1){a.before(Y)}else{C("head").append(Y)}}).then(function(){console.log("Intercept AJAX template render calls: Fetched CSS file: {0}".format(W));if(C(".js-debug-css-template-list").length>0){var Z=J(W),Y=C("<ol />");C.each(Z,function(c,d){if(Q){Y.append(C("<li />").append(c))}else{Y.append(C("<li />").append(d))}});var a=C(".js-debug-css-template-list").append(C("<li />").append(vBulletin.phrase.get("added_via_ajax_call")+":").append(Y));var b=a.prev("b");b.text(parseInt(b.text(),10)+1)}M(X)},function(){console.warn("Intercept AJAX template render calls: Failed to fetch CSS file: {0}".format(W));M(X)})};M(L)}}}}})()});String.prototype.format=function(){var F=this,E=arguments.length;while(E--){F=F.replace(new RegExp("\\{"+E+"\\}","gm"),arguments[E])}return F};jQuery.fn.reverse=[].reverse;window.vBulletin=window.vBulletin||{};vBulletin.getStackTrace=function(){var E=new Error();return E.stack};vBulletin.cookie=vBulletin.cookie||{};vBulletin.cookie.convertBbarrayCookie=function(F,E){F=F||"";E=E||"get";if(E=="set"){F=F.replace(/"/g,".");F=F.replace(/:/g,"-");F=F.replace(/;/g,"_")}else{F=F.replace(/\./g,'"');F=F.replace(/-/g,":");F=F.replace(/_/g,";")}return F};vBulletin.cookie.fetchBbarrayCookie=function(E,H){if(typeof vBulletin.cookie.bbarraycookiecache=="undefined"){vBulletin.cookie.bbarraycookiecache={}}var F=C.cookie(pageData.cookie_prefix+E);if(F!=""&&!vBulletin.cookie.bbarraycookiecache[E]){try{vBulletin.cookie.bbarraycookiecache[E]=C.parseJSON(vBulletin.cookie.convertBbarrayCookie(F))}catch(G){vBulletin.cookie.bbarraycookiecache[E]=null}}if(vBulletin.cookie.bbarraycookiecache[E]){return vBulletin.cookie.bbarraycookiecache[E][H]?vBulletin.cookie.bbarraycookiecache[E][H]:null}else{return null}};vBulletin.cookie.setBbarrayCookie=function(E,K,G,I){if(typeof vBulletin.cookie.bbarraycookiecache=="undefined"){vBulletin.cookie.bbarraycookiecache={}}var F=C.cookie(pageData.cookie_prefix+E);if(F!=""&&!vBulletin.cookie.bbarraycookiecache[E]){try{vBulletin.cookie.bbarraycookiecache[E]=C.parseJSON(vBulletin.cookie.convertBbarrayCookie(F))}catch(H){vBulletin.cookie.bbarraycookiecache[E]=null}}if(!vBulletin.cookie.bbarraycookiecache[E]){vBulletin.cookie.bbarraycookiecache[E]={}}vBulletin.cookie.bbarraycookiecache[E][K]=G;var J={path:pageData.cookie_path,domain:pageData.cookie_domain};if(I){J.expires=365}C.cookie(pageData.cookie_prefix+E,vBulletin.cookie.convertBbarrayCookie(JSON.stringify(vBulletin.cookie.bbarraycookiecache[E]),"set"),J)};vBulletin.cookie.unsetBbarrayCookie=function(E,I){if(typeof vBulletin.cookie.bbarraycookiecache=="undefined"){vBulletin.cookie.bbarraycookiecache={}}var F=C.cookie(pageData.cookie_prefix+E);if(F!=""&&!vBulletin.cookie.bbarraycookiecache[E]){try{vBulletin.cookie.bbarraycookiecache[E]=C.parseJSON(vBulletin.cookie.convertBbarrayCookie(F))}catch(G){vBulletin.cookie.bbarraycookiecache[E]=null}}if(!vBulletin.cookie.bbarraycookiecache[E]||!vBulletin.cookie.bbarraycookiecache[E][I]){return }delete vBulletin.cookie.bbarraycookiecache[E][I];var H={path:pageData.cookie_path,domain:pageData.cookie_domain};C.cookie(pageData.cookie_prefix+E,vBulletin.cookie.convertBbarrayCookie(JSON.stringify(vBulletin.cookie.bbarraycookiecache[E]),"set"),H)};(function A(){(function(){var F="b_menu__dropdown--active",I=".js-menu__username-iconcontainer",H=".js-menu__dropdown-submenu",E=function(J){C(H,J).slideUp("fast");C(I,J).addClass("expand").removeClass("collapse");J.removeClass(F)},G=function(K){var J=C(".js-menu__login-iframe");J.closest("ul").show();J.trigger("load");J.closest("ul").hide();$subList=C("> ul",K);C(I,K).addClass("collapse").removeClass("expand");K.addClass(F);C(H,K).css("top",K.outerHeight()).slideDown("fast")};C("#main-navbar .secondary-nav").removeClass("h-disabled");C(".js-menu__login-iframe").on("load",function(N){try{var M=C(this),L=M.contents().find("html")[0],J=L.scrollHeight;if(J>0){M.height(J);M.parent().height(J)}}catch(K){}});C("#main-navbar .js-menu__dropdown").on("click",function(L){var M=C(this),K=C("> ul",M);if(M.hasClass("h-disabled")||M.closest(".secondary-nav").hasClass("h-disabled")){return false}if(M.hasClass(F)){L.stopPropagation();try{L.target.parentNode.click()}catch(J){}E(M);return true}G(M);return false});C("body").on("click",function(J){if(C(J.target).closest(".js-menu__dropdown").size()==0){E(C(".js-menu__dropdown"))}})})();C(".ui-tabs .ui-tabs-nav > li").addClass("ui-state-disabled");C(".announcement-tabs .ui-tabs-nav > li").removeClass("ui-state-disabled")})();window.vBulletin.getAjaxBaseurl=function(){if(pageData.baseurl.indexOf("http://")==0){return pageData.baseurl.substring(5)}else{if(pageData.baseurl.indexOf("https://")==0){return pageData.baseurl.substring(6)}else{return pageData.baseurl}}};window.vBulletin.normalizeAjaxUrl=function(E){if(E.indexOf("http://")==0){return E.substring(5)}else{if(E.indexOf("https://")==0){return E.substring(6)}else{return E}}};window.vBulletin.runBeforeCallback=function(G,F){if(C.isArray(G)){G.unshift(F)}else{var E=G;G=function(){F.apply(this,arguments);if(typeof E=="function"){E.apply(this,arguments)}}}return G};window.vBulletin.pageHasSelectors=function(E){if(C.isArray(E)&&E.length>0&&C.trim(E.toString())!=""){var F=false;C.each(E,function(G,H){if(C(H).length>0){F=true;return false}});return F}return true};window.vBulletin.areJsonObjectsEqual=function(G,E){var F=function(J,I){for(var H in J){if(J.hasOwnProperty(H)&&I.hasOwnProperty(H)){var L=J[H],K=I[H];if(L!=K){if(L instanceof Array&&K instanceof Array){if(C(L).not(K).length>0||C(K).not(L).length>0){return false}else{continue}}else{return false}switch(L.constructor){case Object:if(!window.vBulletin.areJsonObjectsEqual(L,K)){return false}break;case Function:if(L.toString()!=K.toString()){return false}break;default:return false}}}else{return false}}return true};return(Object.keys(G).length==Object.keys(E).length)?F(G,E):false};window.vBulletin.ajaxSetup=(function(){var E=false;return{init:function(){if(E){return }E=true;C.ajaxSetup({contentType:"application/x-www-form-urlencoded; charset=UTF-8"})}}})();window.vBulletin.ajaxSetup.init();window.vBulletin.ajaxProfile=(function(){var G=[],H=false,F=true,E=false;return{init:function(){if(H){return }H=true;C(function(){if(C("#debug-information").length==0){F=false}C("<ol />").attr("id","debug-ajax-request-list").hide().css({height:"150px",overflow:"auto",padding:"4px",border:"1px solid #CCC",background:"#EEE","margin-top":"2px","margin-bottom":"4px"}).appendTo(C("#debug-information #debug-ajax-request-count").closest("li"));C("#debug-information #debug-ajax-request-count").css("cursor","pointer").on("click",function(){C("#debug-ajax-request-list").toggle()});E=true});function I(){if(E){C("#debug-information #debug-ajax-request-count").text(G.length);C.each(G,function(){if(!this.displayed){this.displayed=true;this.relUrl=this.url.indexOf(pageData.baseurl)==0?this.url.substring(pageData.baseurl.length):this.url;C("<li />").addClass("js-request-counter-"+this.requestCounter).text(this.relUrl).appendTo(C("#debug-ajax-request-list"))}var J=this.totalTimeTaken-this.networkTimeTaken;var K='{0} <span style="font-size:x-small;">({1}, <span title="Request Time: {2}ms, Processing Time: {3}ms, Total Time: {4}ms" style="text-decoration:underline;">{2}ms, {3}ms</span>){5}</span>'.format(this.relUrl,this.status,this.networkTimeTaken,J,this.totalTimeTaken,(this.errorThrown?" Error: "+this.errorThrown:""));C("#debug-ajax-request-list .js-request-counter-"+this.requestCounter).html(K)})}}C.ajaxPrefilter(function(J,M,K){if(!F){return }var L=G.length;console.log("vBulletin AJAX profile: Before request #"+L);G.push({displayed:false,url:J.url,relUrl:"",startTimeStamp:(new Date()).getTime(),endTimeStamp:0,finalTimeStamp:0,textStatus:"UNKNOWN",errorThrown:"",requestCounter:L,networkTimeTaken:0,totalTimeTaken:0});J.success=vBulletin.runBeforeCallback(J.success,function(O,P,N){G[L].endTimeStamp=(new Date()).getTime()});J.error=vBulletin.runBeforeCallback(J.error,function(N,P,O){G[L].endTimeStamp=(new Date()).getTime();G[L].errorThrown=O});J.complete=vBulletin.runBeforeCallback(J.complete,function(N,O){G[L].finalTimeStamp=(new Date()).getTime();G[L].status=O;G[L].networkTimeTaken=G[L].endTimeStamp-G[L].startTimeStamp;G[L].totalTimeTaken=G[L].finalTimeStamp-G[L].startTimeStamp;I()})})}}})();window.vBulletin.ajaxProfile.init();window.vBulletin.loadingIndicator=(function(){var J=0,I=false,H=false,F=0,E=0;function G(L){if(L){var N=C(".js-loading-indicator"),M=N.outerWidth(),K=C(window).outerWidth();if(K>0&&M>0){N.css("left",((K-M)/2))}N.show();C("body").css("cursor","wait")}else{C(".js-loading-indicator").hide();C("body").css("cursor","auto")}}return{init:function(){if(I){return }C(".js-loading-indicator").ajaxStart(function(){window.vBulletin.loadingIndicator.show("ajaxStart")});C(".js-loading-indicator").ajaxStop(function(){window.vBulletin.loadingIndicator.hide("ajaxStop")});I=true},show:function(K){if(F>0&&K=="ajaxStart"){--F;++E;console.log("vBulletin.loadingIndicator.show ajax indicator suppressed");return }++J;console.log("vBulletin.loadingIndicator.show Counter: "+J+" Source: "+(K||"Unspecified"));if(J>0){H=window.setTimeout(function(){if(H){G(true);H=false}},1000)}},hide:function(K){if(E>0&&K=="ajaxStop"){--E;console.log("vBulletin.loadingIndicator.hide ajax indicator suppressed");return }--J;J=J<0?0:J;if(!K){J=0}console.log("vBulletin.loadingIndicator.hide Counter: "+J+" Source: "+(K||"Unspecified"));if(J<1){if(H){window.clearTimeout(H);H=false}G(false)}},suppressNextAjaxIndicator:function(){++F}}})();window.vBulletin.phrase=window.vBulletin.phrase||{};window.vBulletin.phrase.precache=window.vBulletin.phrase.precache||[];window.vBulletin.phrase.cache=window.vBulletin.phrase.cache||{};window.vBulletin.phrase.uncachable=window.vBulletin.phrase.uncachable||[];window.vBulletin.phrase.render=function(E){var G=E[0];for(var F=1;F<E.length;++F){G=G.replace(new RegExp("%"+F+"\\$s","gm"),E[F])}return G};window.vBulletin.phrase.remoteGet=function(F,H){H.push(F);var G=[];var E=F;C.each(H,function(J,I){if(C.inArray(I,G)===-1&&I!=""){G.push(I)}});if(G.length>0){vBulletin.loadingIndicator.suppressNextAjaxIndicator();C.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/phrase/fetch",async:false,data:({phrases:G}),type:"POST",dataType:"json",success:function(I){if(I){if(typeof (I[F])!="undefined"){E=I[F]}window.vBulletin.cache.setBucket("phrases"+pageData.languageid);C.each(I,function(K,J){window.vBulletin.cache.set(K,J)});H.length=0}else{console.warn("Unexpected result when fetching phrases")}},error:function(K,J,I){console.warn("Error when fetching phrases: {0}".format(I))}})}return E};window.vBulletin=window.vBulletin||{};window.vBulletin.phrase=window.vBulletin.phrase||{};window.vBulletin.phrase.precache=window.vBulletin.phrase.precache||[];window.vBulletin.phrase.precache=C.merge(window.vBulletin.phrase.precache,["admin","admin_auth","all_changes_made_will_be_lost_would_you_like_to_continue","april","attach_link","attach_video","august","cancel","cancel_edit","close","compare_versions","conversation","december","done","edit_conversation","email_addresses_must_match","error","error_fetching_online_users_x","error_loading_ckeditor_script","error_loading_editor","error_loading_post","error_posting_comment_code_x","error_saving_vote","error_x","existing_reply_will_be_deleted","february","flag_a_post","follow","follow_error","following","following_pending","following_remove","friday_min","go_to_first_new_post","hour","inlinemod_auth_login_failed","inlinemod_auth_login_first","inlinemod_auth_password_empty","invalid_data","invalid_data_requested","invalid_email_address","invalid_request","invalid_server_response_please_try_again","invalid_special_channel_subscribe_request","invalid_user_permissions","invalid_username_specified","invalid_username_specified_maxlength_x","invalid_username_specified_minlength_x","invalid_query_definition_x","january","join","joined","join_error","july","june","leave","loading","logged_out_while_editing_post","login","login_success_admin_auth","march","may","minute","moderator","monday_min","new_posts","no","no_create_permissions","no_icon","no_leave_channel_permission","no_one_voted","no_permission","no_update_permissions","no_valid_tags_found","not_logged_no_permission","november","now","october","onbeforeunload_message_while_editing_post","password_must_be_at_least_four_chars","passwords_must_match","people_who_liked","physically_remove_blog","physically_remove_comment","physically_remove_media","physically_remove_reply","physically_remove_topic","physically_remove_visitorMessage","please_enter_a_username","please_enter_a_valid_url_and_click_attach","please_enter_link_url","please_enter_video_url","please_enter_your_comment","please_enter_your_email_address","please_enter_your_reason_why_you_want_to_flag_this_post","please_provide_search_string","please_select_a_day","please_select_a_month","please_select_a_year","post_comment","post_history","posttype_blog","posttype_comment","posttype_media","posttype_reply","posttype_topic","posttype_visitorMessage","preview","saturday_min","search","see_less","see_more","select_option_and_click_delete_button_blog","select_option_and_click_delete_button_comment","select_option_and_click_delete_button_media","select_option_and_click_delete_button_reply","select_option_and_click_delete_button_topic","select_option_and_click_delete_button_visitorMessage","send_report","september","share_post_link_help","soft_delete_blog","soft_delete_comment","soft_delete_media","soft_delete_notes_blog","soft_delete_notes_comment","soft_delete_notes_media","soft_delete_notes_reply","soft_delete_notes_topic","soft_delete_notes_visitorMessage","soft_delete_reply","soft_delete_topic","soft_delete_visitorMessage","sunday_min","thanks_for_signing_up_log_in","the_report_has_been_sent","time","tuesday_min","thursday_min","unable_to_check_admin_permissions","unexpected_error","unfollow_error","unsubscribe","unsubscribe_overlay_error","unvote_cap","user_name_x_already_in_use_choose_different_name","vote_a_post","vote_cap","wednesday_min","xs_avatar","yes","you_have_a_pending_edit_unsaved"]);window.vBulletin.cache.initBucket("phrases"+pageData.languageid,pageData.phrasedate,window.vBulletin.phrase.precache,window.vBulletin.phrase.remoteGet);window.vBulletin.phrase.get=function(){if(arguments.length<1){console.log("vBulletin.phrase.get() called with no parameters");return""}if(typeof arguments[0]=="object"){arguments=arguments[0]}window.vBulletin.cache.setBucket("phrases"+pageData.languageid);var E=window.vBulletin.cache.get(arguments[0]);arguments[0]=E;return window.vBulletin.phrase.render(arguments)};window.vBulletin.getScrollbarWidth=function(){if(C("body").data("scrollbar-width")){return C("body").data("scrollbar-width")}var E=C('<div style="width:50px;height:50px;overflow:auto;position:absolute;top:-99999px;"><div /></div>').appendTo("body"),G=E.children(),F=G.innerWidth()-G.height(99).innerWidth();E.remove();C("body").data("scrollbar-width",F);return F};window.vBulletin.options=window.vBulletin.options||{};window.vBulletin.options.precache=window.vBulletin.options.precache||[];window.vBulletin.options.remoteGet=function(F,H){var G=[F];C.each(H,function(J,I){if(C.inArray(I,G)===-1){G.push(I)}});var E=null;C.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/options/fetchValues",async:false,data:({options:G}),type:"POST",dataType:"json",success:function(I){if(I){vBulletin.cache.setBucket("options");C.each(I,function(J,K){if(J==F){E=K}vBulletin.cache.set(J,K)});H.length=0}else{console.warn("Unexpected result when fetching options")}},error:function(K,J,I){console.warn("Error when fetching options: {0}".format(I))}});return E};window.vBulletin=window.vBulletin||{};window.vBulletin.options=window.vBulletin.options||{};window.vBulletin.options.precache=window.vBulletin.options.precache||[];window.vBulletin.options.precache=C.merge(window.vBulletin.options.precache,["crontab","bbtitle","markinglimit","threadpreview"]);vBulletin.cache.initBucket("options",window.pageData.optionsdate,window.vBulletin.options.precache,window.vBulletin.options.remoteGet);window.vBulletin.options.get=function(E){window.vBulletin.cache.setBucket("options");return window.vBulletin.cache.get(E)};window.vBulletin.openAuthDialog=function(I,H,E,F){H=H||"inlinemod_auth";E=E||function(){};var G=openConfirmDialog({title:vBulletin.phrase.get(H),message:vBulletin.phrase.get("loading")+"...",width:500,dialogClass:"inlinemod-auth-dialog loading",buttonLabel:{yesLabel:vBulletin.phrase.get("login"),noLabel:vBulletin.phrase.get("cancel")},primaryButton:"yes",onClickYesWithAjax:true,onClickYes:function(){var K=G.find(".inlinemod-auth-form"),L=C(".js-inlineauth_password").val(),M=C(".js-inlineauth_username").val(),J=C(".error-msg-box");J.text("").addClass("h-hide");C.ajax({url:vBulletin.normalizeAjaxUrl(K.attr("action")),data:{password:L,username:M},type:"POST",dataType:"json",success:function(N){if(N.error){J.text(vBulletin.phrase.get(N.error)).removeClass("h-hide")}else{G.dialog("close");G.dialog("close");if(typeof (F)=="function"){F()}return I()}},error:function(P,O,N){console.log("/auth/inlinemodLogin failed, error: "+N);openAlertDialog({title:vBulletin.phrase.get(H),message:P.status,iconType:"error"})}})},onClickNo:E});C.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/render/inlinemod_auth",type:"POST",dataType:"json",success:function(J){console.log("/ajax/render/inlinemod_auth");if(J&&!J.errors){C(".inlinemod-auth-dialog").removeClass("loading");C(".dialog-content .message",G).html(J);G.dialog("option","position","center");C('[name="password"]',G).on("keydown",function(K){if(K.which==13){K.preventDefault();C("#btnConfirmDialogYes",G).click()}});C("input",G).first().focus()}else{console.log("/ajax/render/inlinemod_auth successful, but response was not valid");openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("invalid_server_response_please_try_again"),iconType:"error",onAfterClose:function(){G.dialog("close")}})}},error:function(L,K,J){console.log("/ajax/render/inlinemod_auth failed, error: "+J);openAlertDialog({title:vBulletin.phrase.get(H),message:vBulletin.phrase.get("error_loading_delete_form_x",L.status),iconType:"error",onAfterClose:function(){G.dialog("close")}})}})};window.vBulletin.assertUserHasAdminPermission=function(I,H,E,F){if(C(H).data("in-progress")){return false}C("body").css("cursor","wait");var G=arguments.callee.caller;C(H).data("in-progress",true);C.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/user/currentUserHasAdminPermission",data:({adminPermission:I}),type:"POST",dataType:"json",complete:function(){C("body").css("cursor","auto");C(H).data("in-progress",null)},success:function(J){console.log("ajax/api/user/currentUserHasAdminPermission result:"+JSON.stringify(J));if(J===true){E()}else{if(J&&J.errors&&J.errors.length>0){if(J.errors[0]=="auth_required"){window.vBulletin.openAuthDialog(function(){G.apply(H)},"admin_auth",function(){},F);return }openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("nopermission_loggedout"),iconType:"error",onAfterClose:function(){C("#config-dialog").dialog("close");window.location.reload()}});C("#config-dialog .loader").hide()}else{openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("unable_to_check_admin_permissions"),iconType:"error",onAfterClose:function(){C("#config-dialog").dialog("close");window.location.reload()}});C("#config-dialog .loader").hide()}}},error:function(L,K,J){console.log("ajax/api/user/currentUserHasAdminPermission error: "+J);openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("unable_to_check_admin_permissions"),iconType:"error",onAfterClose:function(){C("#config-dialog").dialog("close");window.location.reload()}});C("#config-dialog .loader").hide()}})};vBulletin.selectTabByIndex=function(E){var F=this instanceof C?this:C(this);if(F.length&&E>-1&&F.hasClass("ui-tabs")){F.data("noPushState",true).tabs("select",E).data("noPushState",null).find(".ui-tabs-nav li").removeClass("ui-state-focus").eq(E).addClass("ui-state-focus").find("a").focus()}};vBulletin.tabify=function(F){var G=this instanceof C?this:C(this);if(G.length){var E={tabOptions:{},tabHistory:null,allowHistory:false,tabParamAsQueryString:true,hash:"",getTabIndexByHash:function(){return -1}};F=C.extend({},E,F);if(F.tabHistory instanceof vBulletin.history.instance&&F.tabHistory.isEnabled()){G.on("tabscreate",function(K,M){var H=vBulletin.parseQueryString(location.search,["_"]),N=Object.keys(H).length,J=vBulletin.getSelectedTabHashOrPath(G,F.tabParamAsQueryString),L=F.tabHistory.getState();if(((F.tabParamAsQueryString&&N>1&&typeof H.tab!="undefined")||(!F.tabParamAsQueryString&&N>0))&&(!L||C.isEmptyObject(L.data))){var I={from:"tabs",tab:J};F.tabHistory.setDefaultState(I,document.title,location.href)}F.tabHistory.setStateChange(function(T){var S=F.tabHistory.getState();if(S.data.from=="tabs"){F.tabHistory.log(S.data,S.title,S.url);var Q=F.getTabIndexByHash(S.data.tab),O=vBulletin.parseQueryString(S.url,["tab","_"]);if(G.tabs("option","selected")!=Q){vBulletin.selectTabByIndex.call(G,Q);if(!C.isEmptyObject(O)){C(window).trigger("statechange.filter",["tabs",O])}}else{if(!C.isEmptyObject(O)){C(window).trigger("statechange.filter",["tabs",O])}else{var P,R,U;if(S.data.tab){R=F.tabParamAsQueryString?C(S.data.tab):C('.ui-tabs .ui-tabs-panel[data-url-path="'+S.data.tab+'"]')}P=(R&&R.length&&R)||C(G.closest(".canvas-widget").data("widget-default-tab"));U=C(".toolbar-filter-overlay .filter-options .js-default-checked",P);if(U.length){U.prop("checked",true).first().data("bypass-filter-display",true).trigger("change",[true]).data("bypass-filter-display",null);C(".filtered-by",P).addClass("h-hide").find(".filter-text-wrapper").empty()}else{C(".conversation-toolbar .js-default-checked",P).first().trigger("click",[true])}}}}},"tabs");if(typeof F.tabOptions.create=="function"){F.tabOptions.create.call(G[0],K,M)}})}if(F.allowHistory&&F.tabHistory instanceof vBulletin.history.instance){G.on("tabsselect",function(L,M){if(typeof F.tabOptions.select=="function"&&F.tabOptions.select.call(this,L,M)===false){return false}var I,J=F.tabParamAsQueryString?M.tab.hash:C(M.tab).data("url-path"),K=F.tabParamAsQueryString?undefined:G.find(".ui-tabs-nav > li > a").map(function(){return C(this).data("url-path")}).get();if(!F.tabHistory.isEnabled()){I=vBulletin.makeFilterUrlFromSelectedFilters(M.panel,J.replace("#",""),F.tabParamAsQueryString,K,F.hash);location.href=I;return false}if(!G.data("noPushState")){var H={from:"tabs",tab:J};I=vBulletin.makeFilterUrlFromSelectedFilters(M.panel,J.replace("#",""),F.tabParamAsQueryString,K);F.tabHistory.pushState(H,document.title,I)}else{G.data("noPushState",null)}})}G.tabs(F.tabOptions)}return G};vBulletin.getSelectedTabHashOrPath=function(F,G){var E;if(G){E=F.find(".ui-tabs-nav > .ui-tabs-selected > a").prop("hash")}else{E=F.find(".ui-tabs-nav > .ui-tabs-selected > a").data("url-path")}return E||""};vBulletin.parseUrl=function(F){var E=document.createElement("a"),G;E.href=F||"/";G=E.pathname;if(G.indexOf("/")!=0){G="/"+G}return{protocol:E.protocol,hostname:E.hostname,port:E.port,pathname:G,search:E.search,hash:E.hash}};vBulletin.makeHistoryUrl=function(J,E,H,F,I){var G=vBulletin.makePaginatedUrl(J,E);G=vBulletin.makeTabUrl(G,H.tab,H.tabParamAsQueryString);G=vBulletin.makeFilterUrl(G,F.filterName,F.filterValue,F.context,I);return G};vBulletin.makeTabUrl=function(F,H,L,J,I){if(F){var K=vBulletin.parseUrl(F),M;if(L){I=I||"tab";M=new RegExp("([?+|&+])"+I+"=\\w+[-\\w]*","i");if(K.search.match(M)){F=K.pathname+K.search.replace(M,"$1{0}={1}".format(I,H))}else{if(K.search){F="{0}{1}&{2}={3}".format(K.pathname,K.search,I,H)}else{F="{0}?{1}={2}".format(K.pathname,I,H)}}}else{var G=K.pathname.replace(/\/$/,""),E=G.split("/");M="\\/"+E[E.length-(G.match(/\/page([0-9]+)/)?2:1)]+"$";F=K.pathname.replace(new RegExp(M),"/"+H)+K.search}}else{F="/"}if(J){F+="#"+J}return F};vBulletin.makePaginatedUrl=function(G,F){if(G){var E=G.match(/\/page[0-9]+/);if(E){if(F>1){G=G.replace(E[0],"/page"+F)}else{G=G.replace(E[0],"")}}else{if(F>1){if(G.match(/\?/)){G=G.replace(/\?/,"/page"+F+"?")}else{if(G.match(/\#/)){G=G.replace(/\#.*/,"/page"+F)}else{G+="/page"+F}}}}}return G};vBulletin.makeFilterUrl=function(E,J,N,F,I,G){G=G||false;E=E||location.href;var O=C(".filtered-by",F),L=vBulletin.parseUrl(E),P=L.search;var K=C(".js-button-filter.js-default-checked.js-checked",F);if(K.data("filter-name")==J&&K.data("filter-value")==N){G=true}if(!G&&((O.data("clicked")&&C('.toolbar-filter-overlay input[name="{0}"][value="{1}"]'.format(J,N),F).hasClass("js-default-checked"))||(C('.toolbar-search-form input[name="{0}"]'.format(J),F).length&&!N))){G=true;O.data("clicked",null)}E=L.pathname;if(P&&P.length>1){if(P.match(new RegExp(J+"=","i"))){var H=vBulletin.parseQueryString(P);if(!C.isEmptyObject(H)){var M="";C.each(H,function(Q,R){if(!G||Q!=J){M+="{0}={1}&".format(Q,(Q==J?N:R))}});if(M){E+="?"+M.substring(0,M.length-1)}}}else{if(!G){E+=P+"&{0}={1}".format(J,encodeURIComponent(N))}else{E+=P}}}else{if(!G){E+="?{0}={1}".format(J,encodeURIComponent(N))}}if(I){E+="#"+I}return E};vBulletin.getSelectedFilters=function(E,F){var G={};if(!F){var H=E.serializeArray();C.each(H,function(K,L){if(L.name!="securitytoken"){if(L.name.slice(-2)=="[]"){var J=L.name.split("[]");G[J[0]]=G[J[0]]||[];G[J[0]].push(L.value)}else{G[L.name]=L.value}}})}else{var I=E.parent().find(".filtered-by .filter-text").filter(":visible");E.find(":input:radio:checked").each(function(K,M){var L=C(M);if((L.hasClass("js-default-checked")||L.data("bypass-filter-display")==1)&&(I.length==0||I.filter('[data-filter-name={0}][data-filter-value="{1}"]').length==0)){return true}if(M.name.slice(-2)=="[]"){var J=M.name.split("[]");G[J[0]]=G[J[0]]||[];G[J[0]].push(M.value)}else{G[M.name]=M.value}})}return G};vBulletin.makeFilterUrlFromSelectedFilters=function(I,J,S,O,L){var Q,H=location.pathname.replace(/\/$/,"").replace(/\/page[0-9]+/,""),G=C(".toolbar-filter-overlay",I),N=vBulletin.getSelectedFilters(G,true),P=C(".pagenav-form .js-pagenum",I).val()||1,K=C(".toolbar-search-form .js-filter-search",I).val()||"",U=C(I).closest(".canvas-widget"),R=C(".conversation-toolbar-wrapper",I).length?(C(".conversation-toolbar-wrapper",I).data("allow-history")=="1"):(C(I).data("allow-history")=="1"),F=new vBulletin.history.instance(R),E=U.data("widget-default-tab")||U.find(".ui-tabs-nav > li:first-child a").attr("href");if(C.isEmptyObject(N)){C(".conversation-toolbar .js-button-filters",I).each(function(){var V=C(".js-button-filter.js-checked:not(.js-default-checked)",this);if(V.length){N[V.data("filter-name")]=V.data("filter-name")}})}if(!S){var T=new RegExp("\\/("+O.join("|")+")/?$"),M=H.match(T);if(M){H=H.replace(new RegExp(M[0]),"/"+J)}else{H+="/"+J}}if(P>1&&F.isEnabled()){H+="/page"+P}if(S&&J&&E!=("#"+J)){N.tab=J;if(!F.isEnabled()){H+="?tab="+J}}if(!F.isEnabled()){return H+(L?"#"+L:"")}if(K){N.q=K}Q=C.param(N);return H+(Q?"?"+Q:"")+(L?"#"+L:"")};vBulletin.parseQueryString=function(H,F){var E={},I;if(H&&H.length>1){I=H.indexOf("?");F=(F instanceof Array)?F:[];if(I!=-1){var G=H.substring(I+1).split("&");C.each(G,function(J,L){var K=L.split("=");if(F.length==0||(C.inArray(K[0],F)==-1)){E[K[0]]=decodeURIComponent((K[1]||"")).replace(/\+/g," ")}})}}return E};vBulletin.pagination=function(K){var S={context:document,onPageChanged:null,tabParamAsQueryString:true,allowHistory:false};if(K&&typeof K=="object"){C.extend(S,K)}var G,H=C(".pagenav-controls .pagenav-form",S.context),R=Number(C(".defaultpage",H).val())||Number(C(".js-pagenum",H).val())||1,M=new vBulletin.history.instance(S.allowHistory);H.data("object-instance",this);if(M.isEnabled()){var N=vBulletin.parseQueryString(location.search,["_"]),I=location.pathname.match(/\/page([0-9]+)/),F=M.getState();if(I&&Number(I[1])>1&&C.isEmptyObject(N)&&(!F||C.isEmptyObject(F.data))){G=vBulletin.makePaginatedUrl(location.href,R);var O={from:"pagination",page:R,tab:S.tabParamAsQueryString?"#"+H.closest(".ui-tabs-panel").attr("id"):vBulletin.getSelectedTabHashOrPath(H.closest(".ui-tabs"),false)};M.setDefaultState(O,document.title,G)}M.setStateChange(function(a){var T=M.getState();if(T.data.from=="pagination"){M.log(T.data,T.title,T.url);if(location.search){var c=vBulletin.parseQueryString(location.search,["_"]);if(!C.isEmptyObject(c)||c.tab=="groups-tab"){delete c.tab;C(window).trigger("statechange.filter",["pagination",c]);return }}var X,V,d,b,Z;if(T.data.tab){X=S.tabParamAsQueryString?C(T.data.tab):C('.ui-tabs .ui-tabs-panel[data-url-path="'+T.data.tab+'"]')}V=(X&&X.length&&X)||S.context;d=C(".conversation-toolbar .filter-wrapper",V).data("object-instance");if(d){d.resetFilters(true)}if(T.data.tab){b=X.closest(".ui-tabs");$tabAnchor=S.tabParamAsQueryString?b.find('.ui-tabs-nav > li > a[href*="{0}"]'.format(T.data.tab)):b.find('.ui-tabs-nav > li > a[data-url-path="'+T.data.tab+'"]');if(!$tabAnchor.parent().hasClass("ui-tabs-selected")){var Y=$tabAnchor.parent().index();vBulletin.selectTabByIndex.call(b,Y);return }}var f=C(".pagenav-controls .pagenav-form",V);var W=f.data("object-instance");if(W&&typeof W.getOption=="function"&&typeof W.getOption("onPageChanged")=="function"){var U=T.data.page||R;W.getOption("onPageChanged").apply(f.get(0),[U,false,!location.search,location.search])}}},"pagination")}function E(){return parseInt((C(".pagetotal",this).html()||"").replace(/[^\d]+/g,""),10)||1}function L(U,Y){var X=E.apply(this),T=C(".arrow[rel=next]",this),W=C(".arrow[rel=prev]",this);if(U<1){U=1}else{if(U>X){U=X}}C(".js-pagenum",this).val(U);if(U==X){T.addClass("h-disabled").removeAttr("href")}else{T.removeClass("h-disabled").attr("href",vBulletin.makePaginatedUrl(location.href,U+1))}if(U==1){W.addClass("h-disabled").removeAttr("href")}else{W.removeClass("h-disabled").attr("href",vBulletin.makePaginatedUrl(location.href,U-1))}if(typeof S.onPageChanged=="function"){S.onPageChanged.apply(this,[U,Y])}if(X>1&&M.isEnabled()&&!Y){var Z=M.getState();if(!Z||!Z.data||!Z.data.from||C.inArray(Z.data.from,["filter_blogs","filter_groups"]==-1)){if(U==1){G=C(".arrow[rel=next]",this).attr("href")}else{G=C(".arrow[rel=prev]",this).attr("href")}if(G){G=vBulletin.makePaginatedUrl(G,U);var V={from:"pagination",page:U,tab:S.tabParamAsQueryString?"#"+C(this).closest(".ui-tabs-panel").attr("id"):vBulletin.getSelectedTabHashOrPath(C(this).closest(".ui-tabs"),false)};M.pushState(V,document.title,G)}}}}function Q(T){var U=parseInt(T);if(U&&typeof U==="number"){C("input[name=result-id]",H).val(U)}}function J(T){C("a.see-all-btn",this).closest(".pagenav-controls")[T?"addClass":"removeClass"]("h-hide")}C(".arrow",H).off("click").on("click",function(V){var U=C(this),W=this.form||U.closest("form").get(0);if(!U.hasClass("h-disabled")){var T=parseInt(C(".js-pagenum",W).val())+((U.attr("rel")=="next")?1:-1);if(!M.isEnabled()&&S.allowHistory){if(!this.href||this.hash==this.href){this.href=vBulletin.makePaginatedUrl(location.href,T)}return true}L.apply(W,[T,false])}return false});function P(){C(S.context).off("click",".pagenav .button").on("click",".pagenav .button",function(V){if(M.isEnabled()){var W=C(this),T=W.data("page"),U=C(".pagenav-form",S.context).get(0);L.apply(U,[T,false]);return false}return true}).on("mouseover",".pagenav .button",function(U){var T=C(this);if(!T.prop("href")){T.prop("href",vBulletin.makePaginatedUrl(location.href,parseInt(T.data("page"),10)))}});C(".pagenav .button",S.context).each(function(){this.href=vBulletin.makePaginatedUrl(location.href,parseInt(C(this).data("page")))})}P();C(".js-pagenum",H).off("keypress").on("keypress",function(V){if(V.keyCode==13){V.preventDefault();var T=parseInt(C(this).val(),10);var U=E.apply(this.form);if(T>U){T=U}if(T<1){T=1}if(M.isEnabled()){L.apply(this.form,[T,false])}else{if(S.allowHistory){location.href=vBulletin.makePaginatedUrl(location.href,T)}else{L.apply(this.form,[T,false])}}}});C(".js-pagenum",H).off("click").on("click",function(T){C(this).select()});this.updatePageInfo=function(U,T){if(U&&typeof U=="object"){var V=U.totalpages||1,W=C(".pagenav-controls .pagenav-form",S.context);C(".pagetotal",W).text(V);if(typeof U.showseemore!="undefined"){if(U.showseemore){J.apply(W,[false])}else{J.apply(W,[true])}}U.perpage=vBulletin.conversation.POSTS_PER_PAGE;if(T&&C(".pagenav-container",S.context).length>0){C.post(pageData.baseurl+"/ajax/render/pagenav",{pagenav:U},function(X){if(X){C(".pagenav-container",S.context).replaceWith(X.template);P()}},"json")}L.apply(W.get(0),[U.pagenumber,T])}};this.updateResultId=function(T){Q(T)};this.setOption=function(T,U){S[T]=U};this.getOption=function(T){return S[T]};this.updatePageNavigation=function(U,T,V){L.apply(U.get(0),[T,V])}};vBulletin.conversation=vBulletin.conversation||{};vBulletin.conversation.toggleCommentBox=function(){var E=C(this).closest(".js-comment-entry__parent").find(".js-comment-entry");E.slideToggle("fast",function(){var F=C(this).find(".js-comment-entry__textbox");if(F.is(":visible")){F.focus()}});E.find(".js-comment-entry__cancel").off("click").on("click",function(F){E.slideToggle();return false});return false};vBulletin.conversation.postComment=function(L,I){var G=this;var F=C(G).closest(".js-comment-entry").find(".js-comment-entry__textbox");var K=C.trim(F.val());console.log(K);if(!K||(F.hasClass("placeholder")&&K==F.attr("placeholder"))){openAlertDialog({title:vBulletin.phrase.get("post_comment"),message:vBulletin.phrase.get("please_enter_your_comment"),iconType:"warning",onAfterClose:function(){F.focus()}});return false}C("body").css("cursor","wait");C(G).blur();var E=C(G).closest(".js-comment-entry__parent"),J=C(G).closest(".js-comment-entry--blog").length==1?1:0,H=C(G).closest(".js-comment-entry--article").length==1?1:0;C.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/post-comment",data:({text:K,parentid:E.attr("data-node-id"),postindex:E.find(".js-post__content .b-post__count").text().replace("#",""),view:E.parent().hasClass("stream-view")?"stream":"thread",redirecturl:F.hasClass(".reload-on-post")?1:0,isblogcomment:J,isarticlecomment:H,humanverify:{input:C(G).closest(".js-comment-entry").find('[name="humanverify[input]"]').val(),hash:C(G).closest(".js-comment-entry").find('[name="humanverify[hash]"]').val()},recaptcha_challenge_field:C(G).closest(".js-comment-entry").find('[name="recaptcha_challenge_field"]').val(),recaptcha_response_field:C(G).closest(".js-comment-entry").find('[name="recaptcha_response_field"]').val()}),type:"POST",dataType:"json",complete:function(N,M){console.log("post-comment complete.");C("body").css("cursor","auto");vBulletin.hv.reset()},success:function(M,O,P){console.log("post-comment successful! result:"+JSON.stringify(M));if(M){if(!M.error){if(typeof I=="function"){I.apply(G,[M])}if(!J&&!H){C(G).closest(".js-comment-entry").slideToggle()}vBulletin.subscribe.updateSubscribeButton(M.topic_subscribed);var N=E.attr("data-node-id");if(pageData.threadmarking=="0"||pageData.userid=="0"){vBulletin.cookie.setBbarrayCookie("discussion_view",N,Math.round(new Date().getTime()/1000))}else{C.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/node/markRead",data:{nodeid:N},type:"POST",dataType:"json",complete:function(){},success:function(Q){if(Q&&!Q.error){console.log("Topic "+N+" is marked read successfully!")}else{console.log("Topic "+N+" is marked read failed: "+Q.error)}},error:function(S,R,Q){console.log("Topic "+N+" is marked read failed:"+Q)}})}}else{openAlertDialog({title:vBulletin.phrase.get("conversation"),message:vBulletin.phrase.get("error_x",M.error),iconType:"warning"})}}else{openAlertDialog({title:vBulletin.phrase.get("conversation"),message:vBulletin.phrase.get("invalid_server_response_please_try_again"),iconType:"error"})}},error:function(O,N,M){console.log("post-comment failed! error:"+M);openAlertDialog({title:vBulletin.phrase.get("conversation"),message:vBulletin.phrase.get("error_posting_comment_code_x",O.status),iconType:"error"})}})};vBulletin.conversation.showIp=function(F){var H=C(this),G=C(this).data("post-ip"),E=C(this).data("post-host");openAlertDialog({title:vBulletin.phrase.get("ip_info"),message:vBulletin.phrase.get("ip_address_is")+": "+G+"<br />"+vBulletin.phrase.get("host_name_is")+': <span class="ip-host-name loading">...</span>',iconType:"none"});vBulletin.AJAX({url:vBulletin.getAjaxBaseurl()+"/ajax/api/node/getHostName",data:{ip:G},success:function(I,J,K){C(".ip-host-name").removeClass("loading").html(I)}});return false};vBulletin.conversation.showPostHistory=function(H){var I=C(this);var G=C(this).closest(".js-post").attr("data-node-id");var F=openConfirmDialog({title:vBulletin.phrase.get("post_history"),message:vBulletin.phrase.get("loading")+"...",width:800,dialogClass:"post-history-dialog dialog-container dialog-box loading",buttonLabel:{yesLabel:vBulletin.phrase.get("compare_versions"),noLabel:vBulletin.phrase.get("cancel")},onAfterClose:function(){if(this.id=="btnConfirmDialogYes"){var K=F.find(".post-history-form");var J={oldpost:K.find("input:radio[name=old]:checked").val()||1,newpost:K.find("input:radio[name=new]:checked").val()||1,nodeid:G};C("#btnConfirmDialogYes").hide();var L=openConfirmDialog({title:vBulletin.phrase.get("post_history"),message:vBulletin.phrase.get("loading")+"...",width:800,dialogClass:"post-history-comparison-dialog dialog-container dialog-box loading",buttonLabel:{yesLabel:vBulletin.phrase.get("compare_versions"),noLabel:vBulletin.phrase.get("close")},onAfterClose:function(){C("#btnConfirmDialogYes").show()}});E(L,"post_history_form",J)}}});E(F,"post_history_form",{nodeid:G});function E(J,K,L){C.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/render/"+K,data:L,type:"POST",dataType:"json",success:function(M){console.log("/ajax/render/"+K);if(M&&!M.errors){J.removeClass("loading").find(".dialog-content .message").html(M).find("[placeholder]").placeholder().end().end().dialog("option","position","center")}else{console.log("/ajax/render/"+K+" successful, but response was not valid: "+JSON.stringify(M));openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("invalid_server_response_please_try_again"),iconType:"error",onAfterClose:function(){J.dialog("close")}})}},error:function(O,N,M){console.log("/ajax/render/"+K+" failed, error: "+M);openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_loading_delete_form_x",O.status),iconType:"error",onAfterClose:function(){J.dialog("close")}})}})}};vBulletin.conversation.flagPost=function(F){var G=C(this),E=C(this).closest(".js-post").attr("data-node-id");openPromptDialog({title:vBulletin.phrase.get("flag_a_post"),message:vBulletin.phrase.get("please_enter_your_reason_why_you_want_to_flag_this_post"),buttonLabel:{okLabel:vBulletin.phrase.get("send_report"),cancelLabel:vBulletin.phrase.get("cancel")},multiline:true,validation:{type:"string"},onClickOK:function(H){C("body").css("cursor","wait");C.ajax({url:vBulletin.getAjaxBaseurl()+"/report/report",type:"POST",data:{reason:H,reportnodeid:E},dataType:"json",success:function(I){if(I){if(I.error){console.log("/report/report failed, error: "+JSON.stringify(I.error));var J;if(I.error.length>1){J=vBulletin.phrase.get(I.error)}else{J=vBulletin.phrase.get(I.error[0])}openAlertDialog({title:vBulletin.phrase.get("flag_a_post"),message:J,iconType:"error"})}else{openAlertDialog({title:vBulletin.phrase.get("flag_a_post"),message:vBulletin.phrase.get("the_report_has_been_sent"),iconType:"",onAfterClose:function(){C("#prompt-dialog").dialog("close")}})}}},error:function(K,J,I){console.log("/report/report failed, error: "+I);openAlertDialog({title:vBulletin.phrase.get("flag_a_post"),message:vBulletin.phrase.get("unable_to_contact_server_please_try_again"),iconType:"error",onAfterClose:function(){C("#prompt-dialog").dialog("close")}})},complete:function(){C("body").css("cursor","default")}})}});return false};vBulletin.conversation.editPost=function(K,N){var P=C(this),G,O,L=P.closest(".conversation-list");if(P.closest(".js-comments").length>0){G="comment"}var H=C(".edit-conversation-container form",L);if(H.length>0){openAlertDialog({title:vBulletin.phrase.get("edit_conversation"),message:vBulletin.phrase.get("you_have_a_pending_edit_unsaved"),iconType:"warning",onAfterClose:function(){vBulletin.animateScrollTop(H.closest(".js-post").offset().top,{duration:"slow"})}});return }if(N&&N.isFilterSelected("conversations_on")){N.toggleNewConversations(false)}window.vBulletin.loadingIndicator.show();K.preventDefault();var F=P.parent().attr("data-node-id"),E=(G=="comment")?P.closest(".js-comment"):P.closest(".js-post__content-wrapper");if(L.hasClass("thread-view")){O="thread"}else{if(L.hasClass("full-activity-view")){O="full-activity-stream"}else{if(L.hasClass("activity-view")){O="activity-stream"}else{O="stream"}}}G=G||E.attr("data-node-type")||"";var J,M=C(".b-post__count",E).text()||"1";if(G=="comment"&&(O=="thread"||L.closest(".blog-conversation-content-widget").length==1)){J=Number(M.replace("#",""))}else{J=Number(M.replace("#",""))-1}var I=function(R,U,W,Q){if(R&&R.error){window.vBulletin.loadingIndicator.hide();Q.find(".action-buttons .button").prop("disabled",false);if(C.isArray(R.error)){switch(R.error[0]){case"toomanyimages":var V=vBulletin.phrase.get("toomanyimages",R.error[1],R.error[2]);break;default:C.each(R.error,function(Y,Z){R.error[Y]=vBulletin.phrase.get(Z)});var V=R.error.join("<br />")}}else{var V=vBulletin.phrase.get(R.error)}openAlertDialog({title:vBulletin.phrase.get("edit_conversation"),message:V,iconType:"error"});return }var X=C(".edit-conversation-container form",E).data("content-type");var S=vBulletin.triggerHandler.apply(Q.get(0),["afterSave",C(document),R]);if(S===false){C("body").trigger(X+"_editform_onunload",[E]);window.vBulletin.loadingIndicator.hide();return }Q.closest(".conversation-reply-slideout").addClass("h-hide");var T=pageData;T["posts-perpage"]=vBulletin.conversation.POSTS_PER_PAGE;if(O=="thread"){T["comments-perpage"]=vBulletin.conversation.COMMENTS_PER_PAGE}var W=C.post(vBulletin.getAjaxBaseurl()+"/create-content/loadnode",{nodeid:F,view:O,index:J,page:T,type:G,isAjaxTemplateRender:true},function(c){if(c.error){openAlertDialog({title:vBulletin.phrase.get("conversation"),message:vBulletin.phrase.get(c.error),iconType:"error"})}else{var Y=Q.closest(".js-content-entry").data("current-channelid"),a=Q.find('input[name="parentid"]:checked').val(),Z=C(c);if(Y>0&&a>0&&(Y!=a)){window.location.reload(true);return }C("body").trigger(X+"_editform_onunload",[E]);if(N&&N.isFilterSelected("conversations_on")){N.toggleNewConversations(true)}P.closest(".js-post").replaceWith(Z);C("body").trigger(X+"_newcontent_onload",[Z]);var d=Z.attr("data-node-id");if(Z.hasClass("js-conversation-starter")){var b=C(".js-post-title",Z).first().text();document.title=b+" - "+vBulletin.options.get("bbtitle");C(".page-title-widget .js-main-title").text(b)}C(".js-select-box",Z).selectBox();vBulletin.animateScrollTop(Z.offset().top,{duration:"slow"})}},"json").error(function(){openAlertDialog({title:vBulletin.phrase.get("conversation"),message:vBulletin.phrase.get("error_loading_post"),iconType:"error"})}).complete(function(){window.vBulletin.loadingIndicator.hide()})};C.post(vBulletin.getAjaxBaseurl()+"/create-content/loadeditor",{nodeid:F,type:G,view:O,isAjaxTemplateRender:true},function(Q){if(Q.error){openAlertDialog({title:vBulletin.phrase.get("edit_conversation"),message:vBulletin.phrase.get(Q.error),iconType:"error"})}else{var R=function(){if(typeof vBulletin.upload=="undefined"||typeof vBulletin.tagEditor=="undefined"||typeof vBulletin.contentEntryBox.init=="undefined"){vBulletin.ckeditor.loadScripts("",{},R);return }E.addClass("b-post--edit");E.find(".js-post__content").first().addClass("b-post__content--edit");E.find(".b-post__footer").first().addClass("b-post__footer--edit");$container=E.find(".edit-conversation-container").first();E.closest(".js-album-detail").find(".list-item-header").addClass("h-hide").end().find(".conversation-body").addClass("h-hide").end().find(".profile-media-uploadphotos").addClass("h-hide-imp").end().find(".photo-preview").addClass("h-hide").end();vBulletin.contentEntryBox.init();vBulletin.contentEntryBox.setDefaultTab($container.find(".js-content-entry").first());$container.show();console.log($container);window.vBulletin.loadingIndicator.hide();var U=$container.find(".js-attach-list");vBulletin.upload.initializePhotoUpload(E);var T=C(".js-post[data-node-id={0}] .tag-editor-container .tag-input".format(F));if(T.length>0&&typeof vBulletin.tagEditor!="undefined"){var V=new vBulletin.tagEditor.instance(T.selector)}if(U.data("attach-count")>0){$container.find(".b-toolbar__item").filter(function(){return C(this).data("panel")=="b-content-entry-panel__content--attachment"}).click()}vBulletin.contentEntryBox.afterPanelChange(E);C(".js-datepicker",$container).not(".hasDatePicker").datetimepicker({showOn:"both",buttonImage:pageData.baseurl+"/images/calendar-blue.png",buttonImageOnly:true,ampm:true})};console.log("Edit mode: Adding Content Entry UI to DOM (contains parsed post text in the .js-editor-parsed-text element)");C(".edit-conversation-container",E).first().hide().html(Q);var S=C(".edit-conversation-container form",E).data("content-type");C(window).off("beforeunload.editPost").on("beforeunload.editPost",function(){return vBulletin.phrase.get("onbeforeunload_message_while_editing_post")});C("body").trigger(S+"_editform_onload",[E,R]);C(".edit-conversation-container input[placeholder], .edit-conversation-container textarea[placeholder]",E).placeholder();C("form",E).ajaxForm({dataType:"json",success:I,beforeSerialize:function(T){console.log("ajaxForm beforeSerialize (vBulletin.conversation.editPost)");T.trigger("beforeSave");var U=C("body").triggerHandler(S+"_editform_onbeforeserialize",[T]);return(U===false)?false:true},beforeSubmit:function(W,V,U){var T=vBulletin.contentEntryBox.validateForm.apply(V,[U]);if(T===false){return false}C(window).off("beforeunload.editPost");window.vBulletin.loadingIndicator.show();return true},complete:function(){console.log("ajaxForm complete (vBulletin.conversation.editPost)")}})}},"json").error(function(R,S,Q){openAlertDialog({title:vBulletin.phrase.get("edit_conversation"),message:"HTTP {0} - {1}".format(R.status,Q),iconType:"error"})}).complete(function(R,S,Q){window.vBulletin.loadingIndicator.hide()})};vBulletin.conversation.votePost=function(F){var E=C(this).closest(".js-post").attr("data-node-id");C(".js-post[data-node-id="+E+"] .js-post-control__vote").addClass("h-disabled");C("body").css("cursor","wait");if(!C(this).hasClass("voted")){C.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/reputation/vote",type:"POST",data:{nodeid:E},dataType:"json",success:function(G){if(G){if(G.errors){openAlertDialog({title:vBulletin.phrase.get("error_saving_vote"),message:vBulletin.phrase.get(G.errors[0]),iconType:"error"});C(".list-item[data-node-id="+E+"] .js-post-control__vote").removeClass("h-disabled")}else{C(".js-post[data-node-id="+G.nodeid+"] .votecount").html(G.votes);C(".js-post[data-node-id="+E+"] .js-post-control__vote").addClass("voted").removeClass("h-disabled").find(".b-post-control__label").text(vBulletin.phrase.get("unvote_cap")).end()}}},complete:function(){C("body").css("cursor","default")}})}else{C.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/reputation/unvote",type:"POST",data:{nodeid:E},dataType:"json",success:function(G){if(G){if(G.errors){openAlertDialog({title:vBulletin.phrase.get("error_saving_vote"),message:vBulletin.phrase.get(G.errors[0]),iconType:"error"});C(".js-post[data-node-id="+E+"] .js-post-control__vote").removeClass("h-disabled")}else{C(".js-post[data-node-id="+G.nodeid+"] .votecount").html(G.votes);C(".js-post[data-node-id="+E+"] .js-post-control__vote").removeClass("voted").removeClass("h-disabled").find(".b-post-control__label").text(vBulletin.phrase.get("vote_cap")).end()}}},complete:function(){C("body").css("cursor","default")}})}};vBulletin.conversation.showWhoVoted=function(G){var E=C(this);if(C(this).hasClass("novotepopup")){return }var F=E.closest(".js-post").attr("data-node-id");E.qtip({content:{title:{text:vBulletin.phrase.get("people_who_liked"),button:true},text:vBulletin.phrase.get("loading")+"...",ajax:{url:vBulletin.getAjaxBaseurl()+"/ajax/api/reputation/fetchWhovoted",type:"POST",data:{nodeid:F},dataType:"json",once:false,success:function(K,I){if(K.errors){this.set("content.text",K.errors[0][0])}else{if(K.length<1){this.set("content.text",vBulletin.phrase.get("no_one_voted"))}else{var M="<ul>";for(x in K){var H=pageData.baseurl+K[x].profileurl,P;if(!K[x].avatarurl){P=pageData.baseurl_core+"/image.php?u="+K[x].userid+"&type=profile"}else{P=pageData.baseurl_core+"/"+K[x].avatarurl}var L=C("<img>").attr("src",P).attr("alt",K[x].username),O=C("<a>").attr("href",H).addClass("avatar"),J=C("<a>").attr("href",H).addClass("username").html(K[x].musername),Q=C("<li>"),N=C("<div>").addClass("usertitle").html(K[x].usertitle);O.append(L);Q.append(O);Q.append(J);Q.append(N);M+=C("<div>").append(Q).html()}M+="</ul>";this.set("content.text",M)}}},error:function(H,J,I){this.set("content.text","failed to load.")}}},position:{my:"left top",at:"right top",viewport:C(window)},show:{event:"click"},hide:{event:"unfocus",fixed:true},style:{classes:"ui-tooltip-shadow ui-tooltip-light ui-tooltip-whovoted"}});E.qtip("api").show()};vBulletin.conversation.processPostContent=function(E){E.css("border-bottom","").filter(".stream-view.activity-view").find(".list-item-poll form.poll").each(function(F,G){if(C(this).is(":visible")&&C(".view-less-ctrl",this).hasClass("h-hide")){vBulletin.conversation.limitVisiblePollOptionsInAPost(this,3)}})};vBulletin.conversation.limitVisiblePollOptionsInAPost=function(I,H){if(typeof H=="undefined"){H=3}var F=0,G=C("ul.poll li",I),E=parseInt(G.css("line-height"),10);G.each(function(J){C(this).removeClass("h-hide");var K=C(this).height();F+=K/E;if(F>H){C(this).addClass("h-hide")}else{C(this).css("display","")}});if(F>3){C(".view-more-ctrl",I).removeClass("h-hide").next(".action-buttons").addClass("h-hide").next(".view-less-ctrl").addClass("h-hide")}else{C(".view-more-ctrl",I).addClass("h-hide").next(".action-buttons").removeClass("h-hide").next(".view-less-ctrl").addClass("h-hide")}};vBulletin.conversation.bindEditFormEventHandlers=function(L){L=(L)?L.toLowerCase():"";if(C.inArray(L,["text","gallery","video","poll","link","comment"])!=-1||L=="all"){var G=function(Q,P){if(typeof P=="function"){console.log("Edit mode: initializeEditor");var O=Q.find(".js-editor");if(O.length>0){vBulletin.ckeditor.initEditor(O,{success:function(R){if(typeof P=="function"){P();vBulletin.contentEntryBox.afterPanelChange(Q);vBulletin.ckeditor.initEditorComponents(Q);var S=this;window.setTimeout(function(){console.log("Edit mode: Adding post data to CKEditor (vBulletin.conversation.bindEditFormEventHandlers)");S.setData(O.prev(".js-editor-parsed-text").html(),function(){var T=vBulletin.ckeditor.getEditor(R);vBulletin.ckeditor.fixTableFunctionality.call(vBulletin.ckeditor,{},T);T.focus()})},0)}},error:function(S){if(typeof P=="function"){P()}O.prop("disabled",false).removeClass("ckeditor-load-on-focus").closest(".js-content-entry").addClass("b-content-entry--no-ckeditor");var R=O.prev(".js-editor-parsed-text").html();if(R!=""){vBulletin.AJAX({url:vBulletin.getAjaxBaseurl()+"/ajax/api/editor/convertHtmlToBbcode",data:{nodeid:pageData.nodeid,data:R,allowsmilie:1,securitytoken:pageData.securitytoken},success:function(T){if(T&&T.data){O.html(T.data)}else{openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("invalid_server_response_please_try_again"),iconType:"error"})}},error_phrase:"error_converting_message"})}},hideLoadingDialog:false})}else{if(typeof P=="function"){P();O.focus()}}}};var M=function(Q){var P=Q.find(".js-editor");if(P.length>0){var O=P.attr("id");if(vBulletin.ckeditor.editorExists(O)){vBulletin.ckeditor.destroyEditor(O)}}P.closest("form").remove()};var F=function(){C("body").off("comment_editform_onload").on("comment_editform_onload",function(P,Q,O){if(typeof O=="function"){O();C(".js-editor",Q).focus().filter(".autogrow").elastic().off("blur.elastic")}}).off("comment_editform_onunload").on("comment_editform_onunload",function(O,P){})};var I=function(){C("body").off("text_editform_onload").on("text_editform_onload",function(P,Q,O){G(Q,O)}).off("text_editform_onunload").on("text_editform_onunload",function(O,P){M(P)}).off("text_newcontent_onload").on("text_newcontent_onload",function(O,P){if(P.closest(".conversation-list.stream-view.activity-view").length>0){vBulletin.truncatePostContent(P)}})};var J=function(){C("body").off("poll_editform_onload").on("poll_editform_onload",function(P,Q,O){G(Q,O)}).off("poll_editform_onunload").on("poll_editform_onunload",function(O,P){M(P)}).off("poll_newcontent_onload").on("poll_newcontent_onload",function(O,P){if(P.closest(".conversation-list.stream-view.activity-view").length>0){vBulletin.truncatePostContent(P);vBulletin.conversation.limitVisiblePollOptionsInAPost(C("form.poll",P),3)}})};var H=function(){C("body").off("gallery_editform_onload").on("gallery_editform_onload",function(P,Q,O){C('.b-toolbar__item[data-panel="b-content-entry-panel__content--gallery"]',Q).trigger("click");G(Q,function(){if(typeof O=="function"){O()}vBulletin.upload.initializePhotoUpload(Q)})}).off("gallery_editform_onunload").on("gallery_editform_onunload",function(O,P){M(P)}).off("gallery_editform_onbeforeserialize").on("gallery_editform_onbeforeserialize",function(P,O){O.find(".caption-box").each(function(){var Q=C(this);if(Q.hasClass("placeholder")&&Q.val()==Q.attr("placeholder")){Q.val("")}});return true}).off("gallery_newcontent_onload").on("gallery_newcontent_onload",function(O,P){if(P.closest(".conversation-list.stream-view.activity-view").length>0){vBulletin.truncatePostContent(P)}})};var K=function(){C("body").off("video_editform_onload").on("video_editform_onload",function(P,Q,O){C('.b-toolbar__item[data-panel="b-content-entry-panel__content--video"]',Q).trigger("click");G(Q,function(){if(typeof O=="function"){O()}N(C(".b-content-entry-panel__content--video",Q),"video")});C(".js-attach-button",Q).on("click",function(U){U.preventDefault();var R=C(this),V=R.closest(".b-content-entry-panel__content--video"),T=C(".b-link-input__url",V),S=C.trim(T.val());if(!S){openAlertDialog({title:vBulletin.phrase.get("attach_video"),message:vBulletin.phrase.get("please_enter_video_url"),iconType:"warning",onAfterClose:function(){T.focus()}});return false}R.prop("disabled",true);C(".js-button-group .b-button",V).prop("disabled",true);C("body").css("cursor","wait");C.post(vBulletin.getAjaxBaseurl()+"/link/getlinkdata",{url:S,isAjaxTemplateRender:true},function(X){if(X.error){openAlertDialog({title:vBulletin.phrase.get("attach_video"),message:vBulletin.phrase.get(X.error),iconType:"warning",onAfterClose:function(){T.focus()}})}else{$template=C(X);V.find(".js-panel-content").append($template);N(V,"video");$template.fadeIn("slow",function(){T.val("");C(".b-link-input",V).addClass("h-hide")});var W=Q.closest("form");if($template.find("js-video-url")){W.data("content-type","video")}else{W.data("content-type","link")}}},"json").error(function(Y,X,W){openAlertDialog({title:vBulletin.phrase.get("attach_video"),message:"HTTP {0} - {1}".format(Y.status,W),iconType:"error"})}).complete(function(){C("body").css("cursor","default");R.prop("disabled",false);C(".js-button-group .b-button",V).prop("disabled",false)})})}).off("video_editform_onunload").on("video_editform_onunload",function(O,P){M(P)}).off("video_newcontent_onload").on("video_newcontent_onload",function(O,P){if(P.closest(".conversation-list.stream-view.activity-view").length>0){vBulletin.truncatePostContent(P)}})};var E=function(){C("body").off("link_editform_onload").on("link_editform_onload",function(P,Q,O){C('.b-toolbar__item[data-panel="b-content-entry-panel__content--link"]',Q).trigger("click");G(Q,function(){if(typeof O=="function"){O()}N(C(".b-content-entry-panel__content--link",Q),"link")});C(".js-attach-button",Q).on("click",function(U){U.preventDefault();var R=C(this),V=R.closest(".b-content-entry-panel__content--link"),T=C(".b-link-input__url",V),S=C.trim(T.val());if(!S){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("please_enter_a_valid_url_and_click_attach"),iconType:"warning",onAfterClose:function(){T.focus()}});return false}if(!S.match(/^https?:\/\//)){S="http://"+S;T.val(S)}R.prop("disabled",true);C(".js-button-group .b-button",V).prop("disabled",true);C("body").css("cursor","wait");C.post(vBulletin.getAjaxBaseurl()+"/link/getlinkdata",{url:S,isAjaxTemplateRender:true},function(Y){if(Y.error){openAlertDialog({title:vBulletin.phrase.get("attach_link"),message:vBulletin.phrase.get(Y.error),iconType:"warning",onAfterClose:function(){T.focus()}})}else{var X=C(Y);X.find("img").error(function(){C(this).closest("li").remove()});V.find(".js-panel-content").append(X);N(V,"link");X.fadeIn("slow",function(){T.val("");C(".b-link-input",V).addClass("h-hide")});var W=Q.closest("form");if(X.find("js-video-url")){W.data("content-type","video")}else{W.data("content-type","link")}}},"json").error(function(Y,X,W){openAlertDialog({title:vBulletin.phrase.get("attach_link"),message:"HTTP {0} - {1}".format(Y.status,W),iconType:"error"})}).complete(function(){C("body").css("cursor","default");R.prop("disabled",false);C(".js-button-group .b-button",V).prop("disabled",false)})})}).off("link_editform_onunload").on("link_editform_onunload",function(O,P){M(P)}).off("link_newcontent_onload").on("link_newcontent_onload",function(O,P){if(P.closest(".conversation-list.stream-view.activity-view").length>0){vBulletin.truncatePostContent(P)}}).off("link_savepost_success").on("link_savepost_success",function(O,P){C(".b-link-input",P).removeClass("h-hide-imp")})};var N=function(P,Q){C(".b-link-content__urlinfo .js-link-edit",P).on("click",function(S){S.preventDefault();var R=C(this).parent().parent();R.addClass("b-link-content__urlinfo-meta--edit-mode");C(".js-link-textbox",R).val(C.trim(C(".b-link-content__urlinfo-text",R).text())).trigger("focus");C(".js-link-save",R).on("click",function(T){T.preventDefault();C(".b-link-content__urlinfo-text",R).text(C(".js-link-textbox",R).val());R.removeClass("b-link-content__urlinfo-meta--edit-mode")})});C(".js-link-remove",P).on("click",function(R){R.preventDefault();C(this).closest(".b-content-entry-panel__content").find(".b-link-input").removeClass("h-hide");C(this).closest(".js-panel-content").empty();C(".b-link-input",P).removeClass("h-hide")});if(Q=="link"){C(".js-link-preview-checkbox",P).off("click").on("click",function(){C(".b-link-content__thumbnail",P)[this.checked?"addClass":"removeClass"]("h-hide")});var O=C(".b-link-thumbnail-list__item",P).length;C(".b-link-thumbnail-list",P).jcarousel({scroll:1,wrap:null,size:O,rtl:C("html").attr("dir")=="rtl",buttonNextCallback:function(T,S,R){if(R){C(".b-thumbnail-nav .b-thumbnail-nav__next-arrow",P).removeClass("b-icon__arrow-right-m--disabled").addClass("b-icon__arrow-right-m--default")}else{C(".b-thumbnail-nav .b-thumbnail-nav__next-arrow",P).addClass("b-icon__arrow-right-m--disabled").removeClass("b-icon__arrow-right-m--default")}},buttonPrevCallback:function(T,S,R){if(R){C(".b-thumbnail-nav .b-thumbnail-nav__prev-arrow",P).removeClass("b-icon__arrow-left-m--disabled").addClass("b-icon__arrow-left-m--default")}else{C(".b-thumbnail-nav .b-thumbnail-nav__prev-arrow",P).addClass("b-icon__arrow-left-m--disabled").removeClass("b-icon__arrow-left-m--default")}},initCallback:function(S,R){if(R=="init"&&O>0){C(".b-thumbnail-nav .b-thumbnail-nav__counter",P).html("1/"+O);C(".b-thumbnail-nav .b-thumbnail-nav__prev-arrow",P).off("click").on("click",function(){if(!C(this).hasClass("b-icon__arrow-left-m--disabled")){C(".jcarousel-container .jcarousel-prev",P).trigger("click")}});C(".b-thumbnail-nav .b-thumbnail-nav__next-arrow",P).off("click").on("click",function(){if(!C(this).hasClass("b-icon__arrow-right-m--disabled")){C(".jcarousel-container .jcarousel-next",P).trigger("click")}})}},itemVisibleInCallback:function(U,S,R,T){if(T=="init"){return false}C(".b-thumbnail-nav .b-thumbnail-nav__counter",P).html(R+"/"+O);C('input[type="radio"]',S).prop("checked",true)},itemFallbackDimension:90})}};switch(L){case"text":I();break;case"comment":F();break;case"poll":J();break;case"gallery":H();break;case"video":K();break;case"link":E();break;case"all":I();F();J();H();K();E();break}}};vBulletin.isScrolledIntoView=function(G,L){var M=false;if(C.isPlainObject(L)&&(L).toString()=="[object Object]"){M=true;L.top=0;L.bottom=0}G=(G instanceof C)?G:C(G);if(G.length==0){return false}var E=C(window).scrollTop(),F=E+C(window).height(),J=G.offset().top,H=J+G.outerHeight(),K=J-E,I=F-H;if(M){L.top=K;L.bottom=I}return(K>=0&&I>=0)};vBulletin.scrollToFixed=function(I){var E=this,F={element:C(),fixedAt:"top",limit:0,triggerOnload:true,zIndex:99},G=("scrollToFixed"+Math.random()).replace(".","");function H(P){F=C.extend({},F,P);if(F.element){F.element=(F.element instanceof C)?F.element:C(F.element);if(F.element.length>0){if(C.inArray(F.fixedAt,["top","bottom"])){F.fixedAt="top"}var M=F.element,J="scrolltofixed",L={width:M.width(),offset:M.offset(),"margin-top":parseInt(M.css("margin-top"),10),"margin-bottom":parseInt(M.css("margin-bottom"),10),cssPosition:M.css("position"),coordinates:{left:M.css("left"),top:M.css("top"),right:M.css("right"),bottom:M.css("bottom")}};if(typeof vBulletin.Responsive!=="undefined"){var K=(vBulletin.Responsive&&vBulletin.Responsive.scrollToFixedBreakPoint)?vBulletin.Responsive.scrollToFixedBreakPoint:0;var O=C("<div />");if(C("#vb-page-body").width()>K){O.addClass("scrolltofixed-filler").hide().insertAfter(M)}}M.data("origOffsetTop",L.offset.top);M.css("z-index",F.zIndex);M.data("object-instance",E);var N=C(window).off("scroll."+G).on("scroll."+G,function(){if(M.is(":hidden")){return }var S=C(this).scrollTop();if(F.limit>0&&S>F.limit&&M.hasClass(J)){M.removeClass(J).css({position:"absolute",left:"auto",right:"auto",top:"auto",bottom:"auto",width:L.width})}else{if((F.limit>0&&S<F.limit&&S>L.offset.top&&!M.hasClass(J))||(F.limit<=0&&S>L.offset.top&&!M.hasClass(J))){O.css({display:M.css("display"),width:M.outerWidth(true),height:M.outerHeight(true),"float":M.css("float")});if(C("#vb-page-body").width()>K){M.addClass(J).width(L.width).css({left:L.offset.left,right:"auto",width:L.width,top:(F.fixedAt=="top")?0:"auto",bottom:(F.fixedAt=="bottom")?0:"auto",position:""})}var R=L["margin-"+F.fixedAt];if(R){var Q={};Q[F.fixedAt]=-R+"px";M.animate(Q,"fast")}}else{if(S<=L.offset.top&&M.hasClass(J)){O.hide();M.removeClass(J).css({position:"",width:"",left:"",top:"",right:"",bottom:""})}}}}).off("resize."+G).on("resize."+G,function(){M.removeClass(J).width("auto").css({position:"",left:""});L.width=M.width();L.offset=M.offset();C(this).trigger("scroll."+G)});if(F.triggerOnload){N.trigger("scroll."+G)}}}}this.updateLimit=function(J){if(!isNaN(Number(J))){F.limit=J;C(window).trigger("scroll."+G)}};this.addLimit=function(J){if(!isNaN(Number(J))){F.limit+=J;C(window).trigger("scroll."+G)}};this.reset=function(J){H(J)};H(I)};vBulletin.scrollToAnchor=function(I){var G=C(I);console.log("vBulletin.scrollToAnchor() hash: {0}, found: {1}".format(I,G.length));if(G.length>0){var F=G.show().offset().top-2;G.hide();var H=C("html,body"),E=C(".scrolltofixed-floating.scrolltofixed-top"),J=false;if(E.length>0){if(C(".list-container .list-item:first a.anchor"+I).length==1){if(E.hasClass("scrolltofixed")){E.removeClass("scrolltofixed")}F=E.offset().top;J=true}else{if(E.hasClass("scrolltofixed")){F-=E.outerHeight()}}}H.animate({scrollTop:F},1000,function(){if(!J){var L=G.show().offset().top;G.hide();var K=C(".scrolltofixed-floating.scrolltofixed-top.scrolltofixed");L-=(K.length>0)?K.outerHeight():0;H.animate({scrollTop:L},"slow")}C("a.anchor").show()});return false}C("a.anchor").show();return true};if(location.hash){vBulletin.scrollToAnchor(location.hash)}vBulletin.animateScrollTop=function(F,G){console.log("vBulletin.animateScrollTop({0})".format(F));var E=C(".scrolltofixed-floating.scrolltofixed-top");if(E.length>0){var H=E.data("origOffsetTop")||E.offset().top;if(!E.hasClass("scrolltofixed")&&H<F){F-=E.outerHeight(true)}if(H<F){F-=E.outerHeight()}}C("html, body").animate({scrollTop:F},G)};vBulletin.truncatePostContent=function(E){E=(E instanceof C)?E:C(E);if(E.selector==""){E=C("body")}C(".poll-desc.ellipsis, .message-body.ellipsis",E).each(function(){var F=C(this);truncatedHeight=F.height();F.removeClass("ellipsis");var G=F.height();F.addClass("ellipsis");if(G>truncatedHeight){F.closest(".list-item-body").find(".post-links").removeClass("hide-see-link").find(".see-link").off("click").on("click",function(){var I=C(this);if(I.hasClass("more")){F.removeClass("ellipsis")}else{F.addClass("ellipsis")}I.toggleClass("more less");var H=I.text();I.text(I.data("toggle-text")).data("toggle-text",H);return false})}});C(".list-item .see-link.more").each(function(F){var G=C(this).closest(".list-item"),I=C(G).find(".post-content.restore");if(I.length>0){var L=false,J=false,N=C(this).text(),H="",M=C(I).html(),K=this;C(this).on("click",function(){nodeid=C(G).attr("data-node-id");if(L){C(K).text(N);C(I).html(M);L=false}else{if(J){C(K).text(vBulletin.phrase.get("see_less"));L=true;C(I).html(H)}else{if(!J&&nodeid){C.ajax({url:vBulletin.getAjaxBaseurl()+"/activity/fetchText",type:"POST",data:{nodeid:nodeid},dataType:"json",complete:function(){},success:function(O){if(O&&!O.error&&O.nodeText){H=O.nodeText;if(H.length<=M.length){C(K).addClass("ui-helper-hidden");postLink=C(K).closest(".post-links").html().replace("<span>|</span>","");C(K).closest(".post-links").html(postLink)}else{C(I).html(O.nodeText);C(K).text(vBulletin.phrase.get("see_less"));console.log("loaded content for node "+nodeid);L=true;J=true;return false}}},error:function(Q,P,O){console.log("Attempt to load text for node "+nodeid+" failed:"+O)}})}}}return false})}})};vBulletin.markreadcheck=function(){if((parseInt(pageData.threadmarking)>0)&&(parseInt(pageData.userid)>0)){return }var E=C.cookie(pageData.cookie_prefix+"lastvisit");if(parseInt(pageData.userid)>0&&(!E||pageData.lastvisit>E)){E=pageData.lastvisit}var F=Math.round(new Date().getTime()/1000),G=F-vBulletin.options.get("markinglimit")*86400;C(".forum-item").each(function(){var I=parseInt(C(this).attr("data-lastcontent")),H=0;if(I<=E){C(this).removeClass("new");return }H=vBulletin.cookie.fetchBbarrayCookie("channel_view",C(this).attr("data-channel-id"));H=H?parseInt(H):0;C(this).toggleClass("new",(I>H))});C(".subforum-item").each(function(){var I=parseInt(C(this).attr("data-lastcontent")),H=0;if(I<=E){C(this).removeClass("new").find(".icon").removeClass("new");return }H=vBulletin.cookie.fetchBbarrayCookie("channel_view",C(this).attr("data-channel-id"));H=H?parseInt(H):0;C(this).toggleClass("new",(I>H)).find(".icon").toggleClass("new",(I>H))});C(".topic-item").each(function(){var I=parseInt(C(this).attr("data-lastcontent")),J=0,H=0,L=0;if(pageData.userid=="0"){if(I<=E){C(this).addClass("read");return }H=vBulletin.cookie.fetchBbarrayCookie("channel_view",C(this).attr("data-channel-id"));H=H?parseInt(H):0;J=vBulletin.cookie.fetchBbarrayCookie("discussion_view",C(this).attr("data-node-id"));J=J?parseInt(J):0;L=Math.max(H,J)}else{L=C(this).attr("data-readtime")?parseInt(C(this).attr("data-readtime")):0;H=C(this).attr("data-channelreadtime")?parseInt(C(this).attr("data-channelreadtime")):0;L=Math.max(L,H,G)}if(I<=L||C(this).hasClass("redirect")){C(this).addClass("read")}else{if(C(this).find(".topic-wrapper .go-to-first-unread").length==0){var K=C(this).find(".topic-wrapper .topic-title").attr("href");if(typeof (K)!="undefined"){K+=(K.indexOf("?")==-1?"?":"&amp;")+"goto=newpost";C("<a />").addClass("go-to-first-unread").attr("href",K).attr("title",vBulletin.phrase.get("go_to_first_new_post")).html("&nbsp;").prependTo(C(this).find(".topic-wrapper"));C(this).find(".vb-icon-topic-status").attr("title",vBulletin.phrase.get("new_posts"))}}}})};vBulletin.markchannelsread=function(G,H,E){channelids=[];if(parseInt(G)){vBulletin.setChannelRead(G,H)}else{if(pageData.channelid&&parseInt(pageData.channelid)&&parseInt(pageData.threadmarking)>0&&parseInt(pageData.userid)>0){vBulletin.setChannelRead(pageData.channelid,H)}else{channels=C(E).closest(".widget-content").find(".forum-list-container .forum-item");subchannels=C(E).closest(".widget-content").find(".forum-list-container .subforum-item");result=false;var F=function(I,K){var J=parseInt(C(K).attr("data-channel-id"),10);if(J){channelids.push(J)}};C.each(channels,F);C.each(subchannels,F)}}C.each(channelids,function(I,J){if(I>=channelids.length-1){vBulletin.setChannelRead(J,H)}else{vBulletin.setChannelRead(J,[])}})};vBulletin.setChannelRead=function(F,G){var H=Math.round(new Date().getTime()/1000);if(pageData.threadmarking=="0"||!parseInt(pageData.userid)){if(F==0){C.cookie(pageData.cookie_prefix+"lastvisit",H)}else{var E;try{E=C.parseJSON(vBulletin.cookie.convertBbarrayCookie(C.cookie(pageData.cookie_prefix+"channel_view")))||{}}catch(I){E={}}E[F]=H;var J={path:pageData.cookie_path,domain:pageData.cookie_domain};J.expires=365;C.cookie(pageData.cookie_prefix+"channel_view",vBulletin.cookie.convertBbarrayCookie(JSON.stringify(E),"set"),J)}if(G.success&&typeof G.success=="function"){G.success()}}else{C.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/node/markChannelsRead",data:{nodeid:F},type:"POST",dataType:"json",complete:function(){},success:function(K){if(K&&!K.error){console.log("Channel "+F+" is marked read successfully!")}if(G.success&&typeof G.success=="function"){G.success(K)}else{console.log("Channel "+F+" is marked read failed: "+K.error)}},error:function(M,L,K){console.log("Channel "+F+" is marked read failed:"+error);openAlertDialog({title:vBulletin.phrase.get("forum"),message:"HTTP {0} - {1}".format(M.status,K),iconType:"error"})}})}return true};vBulletin.ckeditor=vBulletin.ckeditor||{};window.CKEDITOR_BASEPATH=pageData.baseurl+"/js/ckeditor/";vBulletin.ckeditor.requiredScriptsLoaded=false;vBulletin.ckeditor.requiredScriptsLoadFailed=false;vBulletin.ckeditor.requiredScriptLoadingStarted=false;vBulletin.ckeditor.checkEnvironment=function(){var H=navigator.userAgent.toLowerCase();var F=window.opera;var G={ie:(H.indexOf("trident/")>-1),opera:(!!F&&F.version),webkit:(H.indexOf(" applewebkit/")>-1),air:(H.indexOf(" adobeair/")>-1),mac:(H.indexOf("macintosh")>-1),quirks:(document.compatMode=="BackCompat"&&(!document.documentMode||document.documentMode<10)),mobile:(H.indexOf("mobile")>-1),iOS:/(ipad|iphone|ipod)/.test(H)};G.gecko=(navigator.product=="Gecko"&&!G.webkit&&!G.opera&&!G.ie);if(G.webkit){if(H.indexOf("chrome")>-1){G.chrome=true}else{G.safari=true}}var E=0;if(G.ie){if(G.quirks||!document.documentMode){E=parseFloat(H.match(/msie (\d+)/)[1])}else{E=document.documentMode}G.ie9Compat=E==9;G.ie8Compat=E==8;G.ie7Compat=E==7;G.ie6Compat=E<7||G.quirks}if(G.gecko){var I=H.match(/rv:([\d\.]+)/);if(I){I=I[1].split(".");E=I[0]*10000+(I[1]||0)*100+(I[2]||0)*1}}if(G.opera){E=parseFloat(F.version())}if(G.air){E=parseFloat(H.match(/ adobeair\/(\d+)/)[1])}if(G.webkit){E=parseFloat(H.match(/ applewebkit\/(\d+)/)[1])}var J=!G.mobile&&((G.ie&&E>6)||(G.gecko&&E>=10801)||(G.opera&&E>=9.5)||(G.air&&E>=1)||(G.webkit&&E>=522)||false);return J};vBulletin.ckeditor.fireCallbacks=function(H,F,E,G){if(E=="error"&&typeof F.error=="function"){F.error(H)}if(E=="success"&&typeof F.success=="function"){F.success.apply(G,[H,G])}if(typeof F.complete=="function"){F.complete(H)}};vBulletin.ckeditor.initEditor=function(G,F){F=F||{};G=vBulletin.ckeditor.verifyEditorId(G);console.log("Ckeditor: initEditor({0})".format(G));if(!vBulletin.ckeditor.checkEnvironment()){var E=C("#"+G).closest(".js-content-entry");E.find("li[data-panel=b-content-entry-panel__content--toggle-editor]").addClass("h-hide");E.find("li[data-panel=b-content-entry-panel__content--smiley]").addClass("h-hide");E.find("form").append(C('<input type="hidden" name="nl2br" value="1" />'));vBulletin.ckeditor.fireCallbacks(G,F,"error");return }if(vBulletin.ckeditor.requiredScriptsLoaded){vBulletin.ckeditor.doInitEditor(G,F)}else{vBulletin.ckeditor.loadScripts(G,F)}};vBulletin.ckeditor.loadScripts=function(G,F,E){if(vBulletin.ckeditor.requiredScriptLoadingStarted){console.warn("Ckeditor: Trying to load required scripts more than once.");return }vBulletin.ckeditor.requiredScriptLoadingStarted=true;F=F||{};G=G||"";if(typeof (F.hideLoadingDialog)!=="undefined"&&!F.hideLoadingDialog){vBulletin.ckeditor.showLoadingDialog(G)}var I=function(){if(F.showError||!vBulletin.ckeditor.requiredScriptsLoadFailed){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_loading_ckeditor_script"),iconType:"warning"})}vBulletin.loadingIndicator.hide();vBulletin.ckeditor.requiredScriptsLoadFailed=true;vBulletin.ckeditor.fireCallbacks(G,F,"error")};var H=function(){if(!vBulletin.ckeditor.requiredScriptsLoadFailed){if(typeof E=="function"){E()}if(typeof vBulletin.ckeditor.doInitEditor=="function"&&window.CKEDITOR){vBulletin.ckeditor.requiredScriptsLoaded=true;vBulletin.ckeditor.doInitEditor(G,F)}else{setTimeout(H,10)}}else{vBulletin.ckeditor.fireCallbacks(G,F,"error");if(!F.hideLoadingDialog){vBulletin.ckeditor.hideLoadingDialog(G)}}};if(typeof vBulletin.ckeditor.doInitEditor!="function"&&!window.CKEDITOR){vBulletin.AJAX({url:vBulletin.getAjaxBaseurl()+"/ajax/render/ckeditor_javascript",success:function(K){var J=[];var L=/src="([^"]+)"/g;while(match=L.exec(K)){J.push(match[1])}var M=function(){if(J.length>0){console.log("Ckeditor: Calling getScript for: {0}".format(J[0]));C.getScript(J[0],function(N,P,O){if(P!="success"){console.warn("Ckeditor: Error loading "+J[0]);I();return false}console.log("Ckeditor: Script loaded: "+J[0]);J.splice(0,1);M()}).fail(function(O,P,N){console.warn("Ckeditor: Error loading script: "+P+" Exception: "+N);I()})}else{H()}};M()},error_phrase:"error_fetching_dialog"})}else{H()}};vBulletin.ckeditor.editorExists=function(E){return false};vBulletin.ckeditor.isEditorEmpty=function(E){return true};vBulletin.ckeditor.resetEditor=function(E){return false};vBulletin.ckeditor.getEditorContent=function(F){F=vBulletin.ckeditor.verifyEditorId(F);if(!F){return false}if(vBulletin.ckeditor.editorExists(F)){var E=vBulletin.ckeditor.getEditor(F);if(E&&E.getData){return C.trim(E.getData())}else{return false}}else{return C.trim(C("#"+F).val())}};vBulletin.ckeditor.focusEditor=function(F){F=vBulletin.ckeditor.verifyEditorId(F);if(!F){return }if(vBulletin.ckeditor.editorExists(F)){var E=vBulletin.ckeditor.getEditor(F);if(E){E.focus()}}else{C("#"+F).focus()}};vBulletin.ckeditor.loadingDialogStack={};vBulletin.ckeditor.showLoadingDialog=function(E){if((typeof vBulletin.ckeditor.loadingDialogStack[E]!="undefined")&&vBulletin.ckeditor.loadingDialogStack[E]){return }vBulletin.ckeditor.loadingDialogStack[E]=true;var F=C("#"+E);if(F.length>0&&F.is(":visible")){F.prop("disabled",true)}window.vBulletin.loadingIndicator.show("vBulletin.ckeditor.showLoadingDialog editorId: "+E)};vBulletin.ckeditor.hideLoadingDialog=function(E){if((typeof vBulletin.ckeditor.loadingDialogStack[E]=="undefined")||!vBulletin.ckeditor.loadingDialogStack[E]){return }vBulletin.ckeditor.loadingDialogStack[E]=false;C("#"+E).prop("disabled",false);window.vBulletin.loadingIndicator.hide("vBulletin.ckeditor.hideLoadingDialog editorId: "+E)};vBulletin.ckeditor.generatedIdCounter=0;vBulletin.ckeditor.verifyEditorId=function(F){F=F||"";if(typeof F=="string"){return F}else{if(typeof F=="object"&&typeof F.checkDirty!="undefined"&&typeof F.name!="undefined"){return F.name}else{var E=F instanceof C?F:C(F);if(!E.attr("id")){++vBulletin.ckeditor.generatedIdCounter;E.attr("id",("vb-cke-instance-"+vBulletin.ckeditor.generatedIdCounter))}return E.attr("id")}}};vBulletin.ckeditor.initEditorComponents=function(F,E){F=F||document;C(function(){C(".js-ckeditor-init-on-focus",F).off("focus").on("focus",function(){vBulletin.ckeditor.initEditor(C(this))});C(".js-ckeditor-init-on-page-load",F).each(function(){vBulletin.ckeditor.initEditor(C(this))});if(E){return }(function(){var I=function(J){return C(".js-content-entry-post-icons option",F).filter(function(){return(C(this).val()==J)}).data("icon-url")};var H=function(J){if(J==0){return C("<span />").html(vBulletin.phrase.get("no_icon")).get(0)}var K=I(J);if(K){return C("<img />").attr("src",K).attr("alt","").get(0)}else{return""}};C(".js-content-entry-post-icons",F).selectBox().change(function(){var J=C(this).val();C(".js-content-entry-post-icons.selectBox-dropdown .selectBox-label",F).html(H(J))});C(".js-content-entry-post-icons-selectBox-dropdown-menu li a",F).each(function(){var J=C(this).attr("rel");C(this).html(H(J))});C(".js-content-entry-post-icons",F).trigger("change")})();C(".js-content-entry-prefixes",F).selectBox();var G=[];C(".js-select-box",F).each(function(){var H=C(this),I;while(H.is(":hidden")){I=H.closest(".h-hide");if(I.length<1){break}G.push(I);I.removeClass("h-hide")}H.selectBox()});C.each(G,function(H,I){I.addClass("h-hide")})})};vBulletin.ckeditor.initEditorComponents(document);C(".js-focus-on-page-load").first().focus();vBulletin.errorAlert=function(F,E){console.log(F,E);openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get(vBulletin.phrase.get(E)),iconType:"error"})};vBulletin.makeErrorAlertCallback=function(F,E){return(function(){vBulletin.errorAlert(F,E)})};vBulletin.AJAX=function(F){var E={type:"POST",dataType:"json",title_phrase:"error",error_phrase:"error",api_error:{},element:null};C.extend(true,E,F);if(!E.url){E.url=vBulletin.getAjaxBaseurl()+E.call;E.call=""}if(!E.error){E.error=vBulletin.makeErrorAlertCallback(E.title_phrase,E.error_phrase)}E.success=function(G){if(!G){vBulletin.errorAlert(E.title_phrase,"invalid_server_response_please_try_again")}else{if(G&&(G.errors||G.error)){var H=G.errors;if(!H){H=G.error}if(C.isArray(H)&&H.length>0){var I=(C("#debug-information").length==1);if(I){console.log("ERROR:");console.dir(H);if(H[0]&&H[0][0]&&H[0][0]=="exception_trace"&&H[1]&&H[1][0]&&H[1][0]=="errormsg"&&H[0][1]&&H[1][1]){vBulletin.errorAlert(E.title_phrase,H[1][1]+'\n<textarea style="border:1px solid #999;margin-top:10px;height:120px;width:100%;">'+H[0][1]+"</textarea>");return false}}H=H[0]}if(H=="inlinemodauth_required"){return vBulletin.inlinemod.openAuthDialog(E.element)}if(E.api_error[H[0]]){return E.api_error[H[0]](E,G)}vBulletin.errorAlert(E.title_phrase,["error_x",vBulletin.phrase.get(H)]);if(G.wasNotArray){arguments[0]=arguments[0][0]}return false}else{if(F.success){F.success.apply(this,arguments)}}}};C.ajax(E)};vBulletin.ajaxForm=function(F){var E={dataType:"json",title_phrase:"error",error_phrase:"error",element:null,complete:function(){C(".button[type=submit]",this).prop("disabled",false)},beforeSerialize:function(G){C(".placeholder",G).each(function(){var H=C(this);if(H.val()==H.attr("placeholder")){H.val("")}})},beforeSubmit:function(I,H,G){C(".button[type=submit]",this).prop("disabled",true);return true}};C.extend(E,F);if(!E.error){E.error=vBulletin.makeErrorAlertCallback(E.title_phrase,E.error_phrase)}E.success=function(G){if(G&&G.errors){var H=G.errors;if(C.isArray(H)&&H.length>0){H=H[0]}if(H=="inlinemodauth_required"){return vBulletin.inlinemod.openAuthDialog(E.element)}vBulletin.errorAlert(E.title_phrase,["error_x",vBulletin.phrase.get(H)]);if(G.wasNotArray){arguments[0]=arguments[0][0]}return false}else{if(F.success){F.success.apply(this,arguments)}}};this.ajaxForm(E)};window.openAlertDialog=function(J){var I=C("#alert-dialog");J=J||{};if(!I.data("created")){I.dialog({autoOpen:false,zIndex:10100,modal:true,resizable:false,closeOnEscape:false,showCloseButton:false,dialogClass:"dialog-container alert-dialog-container dialog-box",create:function(){I.data("created",true)}})}I.dialog("option","width",J.width||500);I.dialog("option","title",J.title||"Alert");var F=I.find(".dialog-content");var G=F.find(".message");var E=F.find(".icon");var H=C("#btnAlertDialogOK");if(J.maxHeight){F.css({"max-height":J.maxHeight,overflow:"auto"})}else{F.css({"max-height":"",overflow:""})}if(J.message){G.html(J.message)}E.removeClass(function(K,L){return(L.match(/\S+-icon\b/g)||[]).join(" ")});J.buttonLabel=J.buttonLabel||"OK";H.html(J.buttonLabel);I.off("dialogopen").on("dialogopen",function(){H.off("click").on("click",function(){if(typeof J.onBeforeClose=="function"){J.onBeforeClose.apply(this)}I.dialog("close")}).focus()});I.off("dialogclose").on("dialogclose",function(){if(typeof J.onAfterClose=="function"){J.onAfterClose.apply(H)}});switch(J.iconType){case"warning":E.addClass("warning-icon vb-icon vb-icon-warning");E.show();break;case"error":E.addClass("error-icon vb-icon vb-icon-error");E.show();break;default:E.addClass("no-icon").hide()}I.dialog("open");return I};window.openConfirmDialog=function(L){L=L||{};var H=C("#confirm-dialog");if(!H.data("created")){H.dialog({autoOpen:false,modal:true,resizable:false,closeOnEscape:false,showCloseButton:false,create:function(){H.data("created",true)}})}H.dialog("option","title",L.title||"Confirmation");var G=H.find(".dialog-content");var I=G.find(".message");var F=G.find(".icon");if(L.message){I.html(L.message.replace("\n","<br />"))}H.dialog("option","width",(L.width?L.width:500));H.dialog("option","dialogClass","dialog-container confirm-dialog-container dialog-box "+(L.dialogClass||""));F.removeClass(function(M,N){return(N.match(/\S+-icon\b/g)||[]).join(" ")});L.buttonLabel=L.buttonLabel||{};L.buttonLabel.yesLabel=L.buttonLabel.yesLabel||vBulletin.phrase.get("yes");L.buttonLabel.noLabel=L.buttonLabel.noLabel||vBulletin.phrase.get("no");var K=C("#btnConfirmDialogYes").html(L.buttonLabel.yesLabel);var E=C("#btnConfirmDialogNo").html(L.buttonLabel.noLabel);if(L.primaryButton=="yes"){K.addClass("primary").removeClass("secondary");E.addClass("secondary").removeClass("primary")}else{E.addClass("primary").removeClass("secondary");K.addClass("secondary").removeClass("primary")}var J;H.off("dialogopen").on("dialogopen",function(){var N=C("#btnConfirmDialogYes").off("click").on("click",function(){J=this;var P,O;if(typeof L.onClickYes=="function"){P=L.onClickYes.apply(this);if(typeof L.onClickYesWithAjax!="undefined"&&L.onClickYesWithAjax){return false}}if(P===false){return false}if(typeof L.onBeforeClose=="function"){O=L.onBeforeClose.apply(this);if(typeof L.onBeforeCloseWithAjax!="undefined"&&L.onBeforeCloseWithAjax){return false}}if(O===false){return false}H.dialog("close")});if(L.defaultFocus=="yes"){N.focus()}var M=C("#btnConfirmDialogNo").off("click").on("click",function(){J=this;if(typeof L.onClickNo=="function"){L.onClickNo.apply(this)}if(typeof L.onBeforeClose=="function"){L.onBeforeClose.apply(this)}H.dialog("close")});if(L.defaultFocus!="yes"){M.focus()}});H.off("dialogclose").on("dialogclose",function(N,M){if(typeof L.onAfterClose=="function"){L.onAfterClose.apply(J)}});switch(L.iconType){case"warning":F.addClass("warning-icon vb-icon vb-icon-warning");F.show();break;case"question":F.addClass("question-icon");F.show();break;default:F.addClass("no-icon").hide()}H.dialog("open");return H};window.openPromptDialog=function(H){var J=C("#prompt-dialog");if(!J.data("created")){J.dialog({autoOpen:false,modal:true,resizable:false,closeOnEscape:false,showCloseButton:false,width:500,dialogClass:"dialog-container prompt-dialog-container dialog-box",create:function(){J.data("created",true)}})}H=H||{};J.dialog("option","title",H.title||"Prompt");var M=J.find(".dialog-content"),I=M.find(".message"),K;if(H.message){I.html(H.message)}var E=H.initialValue||"";if(!H.multiline){K=J.find("input.input-box").val(E).removeClass("h-hide");K.next().addClass("h-hide");if(Number(H.maxlength)){K.attr("maxlength",Number(H.maxlength))}else{K.removeAttr("maxlength")}M.addClass("table");M.find("> div").addClass("td")}else{K=J.find("textarea.input-box").val(E).removeClass("h-hide");K.prev().addClass("h-hide");M.removeClass("table");M.find("> .td").removeClass("td")}H.buttonLabel=H.buttonLabel||{};H.buttonLabel.okLabel=H.buttonLabel.okLabel||"OK";H.buttonLabel.cancelLabel=H.buttonLabel.cancelLabel||"Cancel";var L=C("#btnPromptDialogOK").html(H.buttonLabel.okLabel),G=C("#btnPromptDialogCancel").html(H.buttonLabel.cancelLabel),F;J.off("dialogopen").on("dialogopen",function(){var O=C("#btnPromptDialogOK").off("click").on("click",function(){F=this;var Q=C.trim(K.val()),P,R;if(H.validation&&typeof H.validation=="object"){if(H.validation.override&&typeof H.validation.custom=="function"){if(!H.validation.custom.apply(this,[K])){return false}}else{switch(H.validation.type){case"number":Q=Number(Q);if(isNaN(Q)){if(H.validation.showError){openAlertDialog({title:J.dialog("option","title"),message:"Input must be a number.",iconType:"warning",onAfterClose:function(){K.trigger("select").trigger("focus")}})}else{K.trigger("select").trigger("focus")}return false}if(H.validation.range&&typeof H.validation.range=="object"){if(Q<H.validation.range.min||Q>H.validation.range.max){if(H.validation.showError){openAlertDialog({title:J.dialog("option","title"),message:"Input must be within "+H.validation.range.min+" - "+H.validation.range.max+" only.",iconType:"warning",onAfterClose:function(){K.trigger("select").trigger("focus")}})}else{K.trigger("select").trigger("focus")}return false}}break;case"string":default:if(!Q){if(H.validation.showError){openAlertDialog({title:J.dialog("option","title"),message:"Input required.",iconType:"warning",onAfterClose:function(){K.trigger("select").trigger("focus")}})}else{K.trigger("select").trigger("focus")}return false}else{if(H.multiline&&Q.length>H.maxlength){if(H.validation.showError){openAlertDialog({title:J.dialog("option","title"),message:"Input too long. Maximum allowed is "+H.maxlength+" characters.",iconType:"warning",onAfterClose:function(){K.trigger("select").trigger("focus")}})}else{K.trigger("select").trigger("focus")}return false}}}if(H.validation.set&&C.isArray(H.validation.set)&&H.validation.set.length>0){if(C.inArray(Q,H.validation.set)==-1){if(H.validation.showError){openAlertDialog({title:J.dialog("option","title"),message:"Input must be one of these: "+H.validation.set.join(", ")+".",iconType:"warning",onAfterClose:function(){K.trigger("select").trigger("focus")}})}else{K.trigger("select").trigger("focus")}return false}}if(typeof H.validation.custom=="function"){if(!H.validation.custom.apply(this,[K])){return false}}}}if(typeof H.onClickOK=="function"){R=H.onClickOK.apply(this,[Q]);if(typeof H.onClickOKWithAjax!="undefined"&&H.onClickOKWithAjax){return false}}if(R===false){return false}if(typeof H.onBeforeClose=="function"){P=H.onBeforeClose.apply(this);if(typeof H.onBeforeCloseWithAjax!="undefined"&&H.onBeforeCloseWithAjax){return false}}if(P===false){return false}J.dialog("close")}).trigger("focus");var N=C("#btnPromptDialogCancel").off("click").on("click",function(){F=this;if(typeof H.onClickCancel=="function"){H.onClickCancel.apply(this)}if(typeof H.onBeforeClose=="function"){H.onBeforeClose.apply(this)}J.dialog("close")})});J.off("dialogclose").on("dialogclose",function(){if(typeof H.onAfterClose=="function"){H.onAfterClose.apply(F);K.val("")}});J.dialog("open");K.trigger("focus");return J};window.openLoadingDialog=function(){console.warn("Function openLoadingDialog is deprecated.");window.vBulletin.loadingIndicator.show("openLoadingDialog")};window.closeLoadingDialog=function(){console.warn("Function closeLoadingDialog is deprecated.");window.vBulletin.loadingIndicator.hide("closeLoadingDialog")};window.bindFormReset=function(E){return C(E).on("reset",function(F,G){if(typeof G=="function"){G()}})};window.vBulletin=window.vBulletin||{};vBulletin.sitebuilder=vBulletin.sitebuilder||{};vBulletin.sitebuilder.toggleSitebuilder=function(E){var F=C(this);if(F.closest("li").hasClass("h-disabled")||F.closest("ul").hasClass("h-disabled")){return true}if(F.hasClass("on")){C.removeCookie(pageData.sb_state_cookie,{path:pageData.cookie_path,domain:pageData.cookie_domain});C("#main-navbar .main-nav").hide();F.removeClass("on");return true}if(C("#main-navbar .main-nav li").length>0){C("#main-navbar .main-nav").show();F.addClass("on");C.cookie(pageData.sb_state_cookie,"1",{path:pageData.cookie_path,domain:pageData.cookie_domain});return true}vBulletin.sitebuilder.loadSitebuilderMarkup(true);return true};vBulletin.sitebuilder.loadSitebuilderMarkup=function(E,G){E=E||false;function F(){if(typeof G=="function"){return G()}}if(C("#sitebuilder-wrapper").is(".js-sb-loaded")){return F()}vBulletin.AJAX({url:vBulletin.getAjaxBaseurl()+"/ajax/activate-sitebuilder",data:{pageid:pageData.pageid,nodeid:pageData.nodeid,userid:pageData.userid,loadMenu:E},cache:false,isAjaxTemplateRender:true,isAjaxTemplateRenderWithData:true,success:function(H){if(H&&H.templates){if(E){C("head").append(H.templates.css);C("#main-navbar .main-nav").hide().html(H.templates.menu)}C("#sitebuilder-wrapper").prepend(H.templates.main);C("#main-navbar .main-nav").show();C(".edit-switch-container .switch-control").addClass("on");C("#sitebuilder-wrapper").addClass("js-sb-loaded");C.cookie(pageData.sb_state_cookie,"1",{path:pageData.cookie_path,domain:pageData.cookie_domain});return F()}else{console.log("activating sitebuilder failed!");openAlertDialog({title:"Error",message:"Error activating SiteBuilder.<br /><br />Please try again.",iconType:"error"})}}})};vBulletin.sitebuilder.menuClickProxy=function(){var E=this;vBulletin.sitebuilder.loadSitebuilderMarkup(false,function(){C("#main-navbar .sb-menu").off("click",vBulletin.sitebuilder.menuClickProxy);C(E).find("a").click()});return false};setTimeout(function(){if(!C.support.selectstart){C.fn.extend({disableSelection:function(){return this.each(function(){C(this).css({"-moz-user-select":"-moz-none","-webkit-user-select":"none","-khtml-user-select":"none","-o-user-select":"none","user-select":"none"})})},enableSelection:function(){return this.each(function(){C(this).css({"-moz-user-select":"","-webkit-user-select":"","-khtml-user-select":"","-o-user-select":"","user-select":""})})}})}function F(){window.vBulletin.loadingIndicator.init();C(document).off("click","a.animate-scroll").on("click","a.animate-scroll",function(){var R=vBulletin.scrollToAnchor(this.hash);if(R){window.location.href=this.href}return false});var Q=function(R){C(this).closest(".split-button").toggleClass("open").find(".submenu").toggleClass("h-hide");C("body").off("click.buttonset").on("click.buttonset",function(S){if(C(S.target).closest(".split-button").length==0){C(".split-button").removeClass("open").find(".submenu").addClass("h-hide");C("body").off("click.buttonset")}})};C(".split-button .button-text").button().closest(".button-set").find(".button-icon").button({text:false,icons:{primary:"vb-icon vb-icon-triangle-down-wide"}}).on("click",Q).closest(".button-set").buttonset().filter(".one-click").find(".button-text").on("click",Q);C(document).off("click",".canvas-widget .toggle-button").on("click",".canvas-widget .toggle-button",function(U,R){var T=C(this),V=T.closest(".canvas-widget");if(T.hasClass("expand")){if(R){C(".widget-content",V).show()}else{C(".widget-content",V).slideDown("slow")}V.removeClass("collapsed")}else{if(R){C(".widget-content",V).hide()}else{C(".widget-content",V).slideUp("slow")}V.addClass("collapsed")}T.toggleClass("collapse expand");var S=T.attr("title");T.attr("title",T.data("toggle-title")).data("toggle-title",S);return false});C(".conversation-toolbar-wrapper form.toolbar-filter-overlay").trigger("reset");var O=!!("placeholder" in document.createElement("input"));if(!O){var N=C("input[placeholder], textarea[placeholder]");N.filter(":focus").addClass("js-temp-focus").blur();N.placeholder();var P=function(S){var R=N.filter(".js-temp-focus").focus();if(S){R.removeClass("js-temp-focus")}};C(window).on("load.placeholder_temp",function(){P(true);C(window).off("load.placeholder_temp")});P()}if(C("textarea.autogrow").length>0){C("textarea.autogrow").elastic().off("blur.elastic")}C(".edit-switch-container .switch-control").on("mousedown",vBulletin.sitebuilder.toggleSitebuilder);C("#main-navbar .lnkAdminCP").removeClass("h-disabled");C("#main-navbar .sb-menu").removeClass("h-disabled").on("click",vBulletin.sitebuilder.menuClickProxy);C("select.custom-dropdown").selectBox();C(document).off("keypress",".js-button").on("keypress",".js-button",function(R){if(R.which==32||R.which==13){if(R.target&&R.target.nodeName&&(R.target.nodeName+"").toLowerCase()=="label"&&C(R.target).find("input").length==1){C(R.target).find("input").trigger("click")}else{C(this).trigger("click")}R.preventDefault()}});C(document).off("keypress",".js-link").on("keypress",".js-link",function(R){if(R.which==13){C(this).trigger("click");R.preventDefault()}});C(".js-debug-collapse-list").next("ol, ul").hide();C(document).off("click",".js-debug-collapse-list").on("click",".js-debug-collapse-list",function(R){C(this).next("ol, ul").toggle()});C(document).off("click",".js-toggle-slider").on("click",".js-toggle-slider",function(){var U=C(this);if(U.is(".b-toggle-slider--yes")){U.removeClass("b-toggle-slider--yes").addClass("b-toggle-slider--no");U.find(".b-toggle-slider__radio--no").prop("checked",true);U.data("value","0")}else{U.removeClass("b-toggle-slider--no").addClass("b-toggle-slider--yes");U.find(".b-toggle-slider__radio--yes").prop("checked",true);U.data("value","1")}var T=C(".js-toggle-slider, .js-toggle-slider__dependent"),R=T.index(U),S=false;T.each(function(V,W){if(V==R){S=true}else{if(S==true){var X=C(this);if(X.is(".js-toggle-slider__dependent")){X.toggleClass("h-hide")}else{S=false;return false}}}});U.trigger("change",U.data("value"));return false});C(".js-select-box").selectBox();C(".mainmenu li:has(.submenu)").on("click",function(R){C(".submenu",this).show();return false}).hover(function(){},function(R){C(".submenu",this).hide()});C(".mainmenu.textControls li").on("click",function(R){if(C(".tagCtrl",this).length==0){C("#tag-dialog").hide()}});C(".mainmenu .submenu li a").on("click",function(R){C(this).closest(".submenu").hide()});C(".channel-content-widget .new-conversation-btn").off("click").on("click",function(){window.location.href=pageData.baseurl+"/new-content/"+pageData.channelid});C(".pagenav-form").submit(function(){if(Number(this.page.value)>0){location.href=this.action+"&p="+this.page.value}return false}).trigger("reset");C(".toolbar-pagenav").off("keydown",".toolbar-pagenav input").on("keydown",".toolbar-pagenav input",function(S){var R=S.which;if(!S.shiftKey&&!S.altKey&&!S.ctrlKey&&((R>=48&&R<=57)||(R>=96&&R<=105)||R==8||R==9||R==13||R==35||R==36||R==37||R==39||R==46||R==45)){return true}return false});C(document).off("click",".js-post__manage").on("click",".js-post__manage",function(){if(typeof vBulletin.inlinemod=="undefined"){var S=vBulletin.getAjaxBaseurl()+"/js/inlinemod.js?v="+pageData.simpleversion,R=this;C.getScript(S,function(){vBulletin.inlinemod.manage_deleted_form.apply(R)}).error(function(){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_loading_inlinemod_script"),iconType:"warning"})})}else{vBulletin.inlinemod.manage_deleted_form.apply(this)}});C(document).off("click",".js-post__show-hide").on("click",".js-post__show-hide",function(){var T=C(this),S=T.text(),R=T.data("toggle-text");if(T.hasClass("js-post__show-hide--show")){T.closest(".js-post").addClass("b-post--show-deleted-content");T.html(R).data("toggle-text",S).removeClass("js-post__show-hide--show")}else{T.closest(".js-post").removeClass("b-post--show-deleted-content");T.html(R).data("toggle-text",S).addClass("js-post__show-hide--show")}});C(document).off("click","a.video-frame").on("click","a.video-frame",function(T){T.preventDefault();var S={code:this.getAttribute("data-vcode"),provider:this.getAttribute("data-vprovider")};if(this.getAttribute("data-height")){S.height=this.getAttribute("data-height")}if(this.getAttribute("data-width")){S.width=this.getAttribute("data-width")}var R=C(this);C.post(vBulletin.getAjaxBaseurl()+"/ajax/render/bbcode_video",S,function(U){if(U){R.replaceWith(U)}},"json")});vBulletin.markreadcheck();C(document).off("click","a.markchannelsread, a.navbar_mark_channels_read").on("click","a.markchannelsread, a.navbar_mark_channels_read",function(){vBulletin.markchannelsread(0,{success:function(){location.reload()},failed:function(){openAlertDialog({title:vBulletin.phrase.get("forum"),message:"Mark Channels Read failed: {0}".format(result),iconType:"error"})}},C(this));return false});C(".js-footer-go-to-top").off("click").on("click",function(R){R.preventDefault();C("body,html").animate({scrollTop:0},800)})}function G(){window.clearTimeout(N);if(pageData.securitytoken!="guest"){var N=window.setTimeout(G,3600000);C.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/replace-securitytoken",data:{securitytoken:pageData.securitytoken},type:"POST",dataType:"json",success:function(P){if(P&&!P.error){var O=0;L(P.newtoken)}else{console.log("/ajax/replace-securitytoken, error: "+error);if(++O==3){L("guest")}}},error:function(Q,P,O){console.log("/ajax/replace-securitytoken, error: "+O);if(++J==3){L("guest")}}})}}function L(N){if(N==""){return }C("form").each(function(){var O=C(this);if(typeof (this.method)!="undefined"&&this.method.toLowerCase()=="post"){if(O.find('input[name="securitytoken"]').length){O.find('input[name="securitytoken"]').val(N)}else{O.append('<input type="hidden" name="securitytoken" value="'+N+'" />')}}});pageData.securitytoken=N;console.log("Securitytoken updated")}function M(){if(typeof (pageData.adminAction)!="undefined"){vBulletin.assertUserHasAdminPermission("canusesitebuilder",self,function(){},function(){window.location.reload()})}if(vBulletin.options.get("crontab")){if(pageData.nextcron<=pageData.current_server_datetime){vBulletin.loadingIndicator.suppressNextAjaxIndicator();C.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/apidetach/cron/run",type:"POST",dataType:"json",success:function(N){if(N&&N.errors){console.warn("Cron error: "+vBulletin.phrase.get(N.errors[0][0]))}console.log("Cron run successfully.")},error:function(P,O,N){console.warn("Error when running cron: {0}".format(N))}})}else{}}}F();C("#searchPopupControl").on("click",function(N){if(C(this).hasClass("open")){C(this).removeClass("open");C("#searchPopupContent").hide()}else{C(this).addClass("open");C("#searchPopupContent").show()}});C("html").on("click",function(N){if(C(N.target).closest("#searchForm").size()==0&&C("#searchPopupControl").hasClass("open")){C("#searchPopupControl").removeClass("open");C("#searchPopupContent").hide()}});C("#btnAdvSearch").off("click").on("click",function(O){O.preventDefault();C(this).data("clicked2submit",1);var N=C("#searchForm");C('<input type="hidden" name="AdvSearch" value="1" />').appendTo(N);N.submit()});C("#searchForm").off("submit.searchform").on("submit.searchform",function(R){var T={},P=C("#q");if(C.trim(P.val()).length>0){T.keywords=C.trim(P.val())}else{if(!C("#btnAdvSearch").data("clicked2submit")){openAlertDialog({title:vBulletin.phrase.get("search"),message:vBulletin.phrase.get("please_provide_search_string"),iconType:"warning",onAfterClose:function(){C("#searchForm #q").focus()}});R.stopPropagation();return false}}var O=C(this).find("#searchPopupContent"),S=O.find(".searchFields_title_only");if(S.size()>0&&S.prop("checked")){T.title_only=1}var N=O.find(".searchFields_author");if(N.size()>0&&N.prop("checked")){T.author=[N.val()]}var Q=O.find(".searchFields_channel");if(Q.size()>0&&Q.prop("checked")){T.channel=[Q.val()]}O.find("input[name=searchJSON]").val(JSON.stringify(T));return true});C(".history-backbutton").off("click").on("click",function(N){history.back()});C(".popupControl[popup-body]").off("click").on("click",function(O){var P=C(this).attr("popup-body");if(!P){return false}var N=C(this).parent().find("."+P);if(!N){return false}C(N).toggleClass("h-hide")});var I;if(!(I=C.cookie(pageData.cookie_prefix+"np_notices_displayed"))){I=new Array()}if(!(I instanceof Array)){I=new Array(I)}C('ul.notices li[data-notice-persistent="0"]').each(function(N){I.push(C(this).attr("data-notice-id"))});if(I.length>0){C.cookie(pageData.cookie_prefix+"np_notices_displayed",I,{path:pageData.cookie_path,domain:pageData.cookie_domain})}else{C.cookie(pageData.cookie_prefix+"np_notices_displayed",null,{path:pageData.cookie_path,domain:pageData.cookie_domain})}C("ul.notices > li > .close").off("click").on("click",function(N){var P=C(this).closest("li"),O=P.attr("data-notice-id");C("body").css("cursor","wait");C.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/notice/dismiss",data:{noticeid:O},type:"POST",dataType:"json",complete:function(){C("body").css("cursor","auto")},success:function(Q){if(Q&&!Q.error){console.log("Notice dismissed successfully!");P.hide("slow",function(){if(C(this).parent().find(">li:visible").length==0){C(this).parent().addClass("h-hide")}})}},error:function(S,R,Q){console.log("Notice dismissed failed! error:"+Q);openAlertDialog({title:"Error",message:"Error dismissing the notice.",iconType:"error"})}})});C("#frmActivateuser").ajaxForm({dataType:"json",beforeSubmit:function(Q,P,O){var N="",R="";if(C.trim(C(".username",P).val())==""){N=vBulletin.phrase.get("please_enter_a_username");R=".username"}else{if(C.trim(C(".activateid",P).val())==""){N=vBulletin.phrase.get("requiredfieldmissing",vBulletin.phrase.get("activation_code"));R=".activateid"}}if(N){openAlertDialog({title:vBulletin.phrase.get("error"),message:N,iconType:"warning",onAfterClose:function(){C(R,P).focus()}});return false}return true},success:function(P,R,S,O){if(P&&P.response&&P.response.errors){var T=[];for(var N in P.response.errors){if(P.response.errors[N][0]!="exception_trace"&&P.response.errors[N][0]!="errormsg"){T.push(vBulletin.phrase.get(P.response.errors[N]))}}openAlertDialog({title:vBulletin.phrase.get("error"),message:T.join("<br />"),iconType:"warning",onAfterClose:function(){vBulletin.hv.reset(true)}})}else{var Q=P.response.msg_params;Q.unshift(P.response.msg);openAlertDialog({title:vBulletin.phrase.get("activate_your_account"),message:vBulletin.phrase.get.apply(vBulletin.phrase,Q),onAfterClose:function(){window.location.href=pageData.baseurl}})}}});C("#frmActivateemail").ajaxForm({dataType:"json",beforeSubmit:function(Q,P,O){var N="",R="";if(C.trim(C(".email",P).val())==""){N=vBulletin.phrase.get("please_enter_your_email_address")}else{if(!isValidEmailAddress(C(".email",P).val())){N=vBulletin.phrase.get("invalid_email_address")}}if(N){openAlertDialog({title:vBulletin.phrase.get("error"),message:N,iconType:"warning",onAfterClose:function(){C(R,P).focus()}});return false}return true},success:function(P,R,S,O){if(P&&P.response&&P.response.errors){var T=[];for(var N in P.response.errors){if(P.response.errors[N][0]!="exception_trace"&&P.response.errors[N][0]!="errormsg"){T.push(vBulletin.phrase.get(P.response.errors[N]))}}openAlertDialog({title:vBulletin.phrase.get("error"),message:T.join("<br />"),iconType:"warning",onAfterClose:function(){vBulletin.hv.reset(true)}})}else{var Q=P.response.msg_params;Q.unshift(P.response.msg);openAlertDialog({title:vBulletin.phrase.get("email_activation_codes"),message:vBulletin.phrase.get.apply(vBulletin.phrase,Q),onAfterClose:function(){window.location.href=pageData.baseurl}})}}});var K=C.cookie(pageData.cookie_prefix+"userstyleid");if(K){C(".stylechooser").val(K)}C(".stylechooser").change(function(){var N=C("option:selected",C(this)).val(),O=new Date();O.setDate(O.getDate()+365);C.cookie(pageData.cookie_prefix+"userstyleid",N,{path:pageData.cookie_path,domain:pageData.cookie_domain,expires:O});window.location.reload()});var E=C.cookie(pageData.cookie_prefix+"languageid");if(E){C(".languagechooser").val(E)}C(".languagechooser").change(function(){var N=C("option:selected",C(this)).val(),O=new Date();O.setDate(O.getDate()+365);C.cookie(pageData.cookie_prefix+"languageid",N,{path:pageData.cookie_path,domain:pageData.cookie_domain,expires:O});window.location.reload()});C("a.navbar_profile").on("click",function(){if(pageData.userid=="0"){C("#lnkLoginSignupMenu").click();return false}});L(pageData.securitytoken);var H=window.setTimeout(G,3600000),J=0;setTimeout(M,5)},1);vBulletin.getQueryString=function(F){if(F==""){return{}}var E={};for(var G=0;G<F.length;++G){var H=F[G].split("=");if(H.length!=2){continue}E[H[0]]=decodeURIComponent(H[1].replace(/\+/g," "))}return E};vBulletin.triggerHandler=function(E,G,H){if(!G||G.length==0){G=C(document)}else{if(!(G instanceof C)){G=C(G)}}H=H||[];var F=C.Event(E);F.target=this instanceof C?this.get(0):this;return G.triggerHandler(F,H)}})(jQuery);function JShtmlEncode(B){var A="";if(B&&typeof B!=="undefined"&&B.length>0){A=$("<div/>").text(B).html()}A=String(A).replace(/"/g,"&quot;");return A}function showPhotoDialog(A){$("#gallery_dialog"+A).dialog()}function displayPositionedPopup(E){if(E.dialog){E.dialog=$(E.dialog)}if(!E.dialog||E.dialog.size()==0){E.dialog=$("<div />").html('<h3><label class="h-left">'+E.title+'</label><label class="h-right btnClose">x</label><div class="h-clear"></div></h3><div class="content"></div><div class="arrow"><div class="arrowOver"></div></div>').addClass("custom-dialog").css("z-index",1100).appendTo(document.body);if(E.className){E.dialog.addClass(E.className)}if(E.width){E.dialog.css("width",E.width)}if(typeof E.id=="string"){E.dialog.prop("id",E.id)}E.dialog.find(".btnClose").on("click",function(){E.dialog.fadeOut();return false})}if(E.content){if(typeof E.content=="string"){E.dialog.find(".content").html(E.content);if(typeof E.loaded=="function"){E.loaded(E)}E.dialog.show()}else{if(typeof E.content=="function"){E.dialog.find(".content").html('<span class="text">Loading...</span><span class="loading-icon"><img width="16" height="16" alt="" src="'+pageData.baseurl+'/images/ajax-loader.gif"></span>');E.dialog.show();window.setTimeout(function(){E.content(E)},1)}}}var A=$("#wrapper").offset(),D=$("#wrapper").outerWidth(),N=$(E.target).offset(),K=$(E.target).outerWidth(),I=$(E.target).outerHeight(),F=E.dialog.outerWidth(),M=E.dialog.find(".arrow"),H=M.outerWidth(),L=M.outerHeight(),C=F-M.position().left-H,B=N.left+(K/2)-F+C+(H/2)-2;if(B<A.left){var G=parseInt(M.css("right"));M.css("left",G);C=G+H;B=N.left+(K/2)-C+(H/2)-2}var J=N.top+I+L;E.dialog.css({left:B,top:J});if(typeof E.ready=="function"){E.ready(E)}}function closePhotoDialog(A){$("#gallery_dialog"+A).close()}function isValidEmailAddress(B){var A=new RegExp(/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/i);return A.test(B)}function str_repeat(D,C){var B="";for(var A=0;A<C;A++){B=B.concat(D)}return B}function showStatusMessage(A,F){var C=$(".conversation-status-message.notice"),E;if(C.length>0){var B=C.filter("."+F);if(B.length==1){C=B}else{if((E=C.filter(".h-hide")).length==1){C=E}else{C=C.first().clone().removeClass().addClass("conversation-status-message notice").appendTo(".conversation-status-messages")}}C=(B.length==1?B:C).show();if(!vBulletin.isScrolledIntoView(C)){var D=C.offset().top-10;C.hide();$("html,body").animate({scrollTop:D},"slow",function(){C.find("span").html(A).end().addClass(F+" show-x").fadeIn("slow","linear")})}else{if(C.hasClass("h-hide")){C.hide().removeClass("h-hide").addClass(F+" show-x").find("span").html(A).end().fadeIn(800,"linear")}else{C.fadeOut("slow","linear",function(){C.find("span").html(A).end().addClass(F+" show-x").fadeIn("slow","linear")})}}}}window.vBulletin.htmlEntities=function(A){return String(A).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'"'/g,"&quot;")};window.vBulletin.htmlEntities_decode=function(A){return String(A).replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"')};window.vBulletin.loadedIds=window.vBulletin.loadedIds||[];window.vBulletin.isAlreadyLoaded=function(A){if($.inArray(A,window.vBulletin.loadedIds)!=-1){return true}window.vBulletin.loadedIds.push(A)};