var phpbb={alertTime:100};!function(t){"use strict";var e,a=9,n=13,r=27,i=t("#darkenwrapper"),o=null;phpbb.isTouch=window&&void 0!==window.ontouchstart,t.ajaxPrefilter(function(t){t.crossDomain&&(t.contents.script=!1)}),phpbb.loadingIndicator=function(){return e||(e=t("
",{id:"loading_indicator",class:"loading_indicator"})).appendTo("#page-footer"),e.is(":visible")||(e.fadeIn(phpbb.alertTime),phpbb.clearLoadingTimeout(),o=setTimeout(function(){phpbb.showTimeoutMessage()},6e4)),e},phpbb.showTimeoutMessage=function(){var a=t("#phpbb_alert");e.is(":visible")&&phpbb.alert(a.attr("data-l-err"),a.attr("data-l-timeout-processing-req"))},phpbb.clearLoadingTimeout=function(){null!==o&&(clearTimeout(o),o=null)},phpbb.closeDarkenWrapper=function(e){o=setTimeout(function(){t("#darkenwrapper").trigger("click")},e)},phpbb.alert=function(e,a){var i=t("#phpbb_alert");return i.find(".alert_title").html(e),i.find(".alert_text").html(a),t(document).on("keydown.phpbb.alert",function(t){t.keyCode!==n&&t.keyCode!==r||(phpbb.alert.close(i,!0),t.preventDefault(),t.stopPropagation())}),phpbb.alert.open(i),i},phpbb.alert.open=function(t){i.is(":visible")||i.fadeIn(phpbb.alertTime),e&&e.is(":visible")?e.fadeOut(phpbb.alertTime,function(){i.append(t),t.fadeIn(phpbb.alertTime)}):i.is(":visible")?(i.append(t),t.fadeIn(phpbb.alertTime)):(i.append(t),t.show(),i.fadeIn(phpbb.alertTime)),t.on("click",function(t){t.stopPropagation()}),i.one("click",function(e){phpbb.alert.close(t,!0),e.preventDefault(),e.stopPropagation()}),t.find(".alert_close").one("click",function(e){phpbb.alert.close(t,!0),e.preventDefault()})},phpbb.alert.close=function(e,a){(a?i:e).fadeOut(phpbb.alertTime,function(){e.hide()}),e.find(".alert_close").off("click"),t(document).off("keydown.phpbb.alert")},phpbb.confirm=function(e,a,i){var o=t("#phpbb_confirm");return o.find(".alert_text").html(e),i=void 0===i||i,t(document).on("keydown.phpbb.alert",function(e){if(e.keyCode===n||e.keyCode===r){var a=e.keyCode===n?"confirm":"cancel";t('input[name="'+a+'"]').trigger("click"),e.preventDefault(),e.stopPropagation()}}),o.find('input[type="button"]').one("click.phpbb.confirmbox",function(t){var e="confirm"===this.name;a(e),o.find('input[type="button"]').off("click.phpbb.confirmbox"),phpbb.alert.close(o,i||!e),t.preventDefault(),t.stopPropagation()}),phpbb.alert.open(o),o},phpbb.parseQuerystring=function(t){var e,a,n={};for(t=t.split("&"),e=0;e0?r=n:"string"==typeof a&&a.length>0?r=a:"string"==typeof(r=i.attr("data-ajax-error-text-"+e))&&r.length||(r=i.attr("data-ajax-error-text")),phpbb.alert(i.attr("data-ajax-error-title"),r)}function C(a){var n;phpbb.clearLoadingTimeout(),void 0===a.S_CONFIRM_ACTION?(void 0!==a.MESSAGE_TITLE?n=phpbb.alert(a.MESSAGE_TITLE,a.MESSAGE_TEXT):(i.fadeOut(phpbb.alertTime),e&&e.fadeOut(phpbb.alertTime)),"function"==typeof phpbb.ajaxCallbacks[l]&&phpbb.ajaxCallbacks[l].call(f,a),a.REFRESH_DATA&&("function"==typeof s?s=s(a.REFRESH_DATA.url):"boolean"!=typeof s&&(s=!1),o=setTimeout(function(){s&&(window.location=a.REFRESH_DATA.url),i.fadeOut(phpbb.alertTime,function(){void 0!==n&&n.hide()})},1e3*a.REFRESH_DATA.time))):phpbb.confirm(a.MESSAGE_BODY,function(e){e&&(phpbb.loadingIndicator(),b=t("").serialize(),t.ajax({url:a.S_CONFIRM_ACTION,type:"POST",data:b+"&confirm="+a.YES_VALUE+"&"+t("form","#phpbb_confirm").serialize(),success:C,error:y}))},!1)}}),c&&r.find("input:submit").click(function(){var e=t(this);e.parents("form:first").find("input:submit[data-clicked]").removeAttr("data-clicked"),e.attr("data-clicked","true")}),this},phpbb.search={cache:{data:[]},tpl:[],container:[]},phpbb.search.cache.get=function(t){return!!this.data[t]&&this.data[t]},phpbb.search.cache.set=function(t,e,a){this.data[t]||(this.data[t]={results:[]}),this.data[t][e]=a},phpbb.search.cache.setResults=function(t,e,a){this.data[t].results[e]=a},phpbb.search.cleanKeyword=function(e){return t.trim(e).toLowerCase()},phpbb.search.getKeyword=function(t,e,a){if(a){var n=phpbb.search.getKeywordLine(t);e=e.split("\n").splice(n,1)}return phpbb.search.cleanKeyword(e)},phpbb.search.getKeywordLine=function(t){var e=t.get(0).selectionStart;return t.val().substr(0,e).split("\n").length-1},phpbb.search.setValue=function(t,e,a){if(a){var n=phpbb.search.getKeywordLine(t),r=t.val().split("\n");r[n]=e,e=r.join("\n")}t.val(e)},phpbb.search.setValueOnClick=function(t,e,a,n){a.click(function(){phpbb.search.setValue(t,e.result,t.attr("data-multiline")),n.hide()})},phpbb.search.filter=function(e,a,n){var r=t(this),i=void 0!==r.attr("data-name")?r.attr("data-name"):r.attr("name"),o=parseInt(r.attr("data-min-length"),10),s=r.attr("data-results"),l=phpbb.search.getKeyword(r,e[i],r.attr("data-multiline")),p=phpbb.search.cache.get(s),c=!0;e[i]=l,p.timeout&&clearTimeout(p.timeout);var d=setTimeout(function(){if(o>l.length)c=!1;else if(p.lastSearch)if(p.lastSearch===l)c=!1;else{if(p.results[l]){var t={keyword:l,results:p.results[l]};phpbb.search.handleResponse(t,r,!0),c=!1}0===l.indexOf(p.lastSearch)&&0===p.results[p.lastSearch].length&&(phpbb.search.cache.set(s,"lastSearch",l),phpbb.search.cache.setResults(s,l,[]),c=!1)}c&&n.call(this)},350);return phpbb.search.cache.set(s,"timeout",d),!1},phpbb.search.handleResponse=function(e,a,n,r){if("object"==typeof e){var i=a.attr("data-results"),o=t(i);this.cache.get(i).callback?r=this.cache.get(i).callback:"function"==typeof r&&this.cache.set(i,"callback",r),n||this.cache.setResults(i,e.keyword,e.results),this.cache.set(i,"lastSearch",e.keyword),this.showResults(e.results,a,o,r)}},phpbb.search.showResults=function(e,a,n,r){var i=t(".search-results",n);if(this.clearResults(i),e.length){var o,s,l=n.attr("id");this.tpl[l]||(o=t(".search-result-tpl",n),this.tpl[l]=o.clone().removeClass("search-result-tpl"),o.remove()),o=this.tpl[l],t.each(e,function(t,e){(s=o.clone()).find(".search-result").html(e.display),"function"==typeof r&&r.call(this,a,e,s,n),s.appendTo(i).show()}),n.show()}else n.hide()},phpbb.search.clearResults=function(t){t.children(":not(.search-result-tpl)").remove()},t("#phpbb").click(function(){var e=t(this);e.is(".live-search")||e.parents().is(".live-search")||t(".live-search").hide()}),phpbb.history={},phpbb.history.isSupported=function(t){return!("undefined"==typeof history||void 0===history[t])},phpbb.history.alterUrl=function(t,e,a,n){var r=t+"State";e&&phpbb.history.isSupported(r)&&(a||(a=document.title),n||(n=null),history[r](n,a,e))},phpbb.history.replaceUrl=function(t,e,a){phpbb.history.alterUrl("replace",t,e,a)},phpbb.history.pushUrl=function(t,e,a){phpbb.history.alterUrl("push",t,e,a)},phpbb.timezoneSwitchDate=function(e){var a=t("#timezone_copy"),n=t("#timezone"),r=t("#tz_date"),i=t("#tz_select_date_suggest");0===a.length?n.clone().attr("id","timezone_copy").css("display","none").attr("name","tz_copy").insertAfter("#timezone"):n.html(a.html()),""!==r.val()&&n.children("optgroup").remove(':not([data-tz-value="'+r.val()+'"])'),r.val()===i.attr("data-suggested-tz")?i.css("display","none"):i.css("display","inline");var o=n.children('optgroup[data-tz-value="'+r.val()+'"]').children("option");if(1===o.length&&(o.prop("selected",!0),e=!0),void 0!==e&&!e){var s=n.find("optgroup option");s.filter(":selected").length<=0&&s.filter(":first").prop("selected",!0)}},phpbb.timezoneEnableDateSelection=function(){t("#tz_select_date").css("display","block")},phpbb.timezonePreselectSelect=function(e){var a=(new Date).getTimezoneOffset(),n="-";a<0&&(n="+",a=-a);var r,i=a%60,o=(a-i)/60,s="UTC"+n+(o=o<10?"0"+o.toString():o.toString())+":"+(i=i<10?"0"+i.toString():i.toString()),l=s.length,p=t("option","#tz_date"),c=t("#tz_select_date_suggest");for(r=0;ri?a(i):l>s+5&&a(Math.min(i,l)))}}phpbb.isTouch||(arguments.length>1&&(n=t.extend(n,a)),e.on("focus change keyup",function(){t(this).each(function(){r(this)})}).change(),t(window).resize(function(){e.each(function(){t(this).hasClass("auto-resized")&&r(this)})}))},phpbb.inBBCodeTag=function(t,e,a){var n,r,i,o=t.selectionStart,s=-1,l=-1;if("number"!=typeof o)return!1;for(i=t.value.toLowerCase(),n=0;n=p&&(r=i.lastIndexOf(e[n],o-p),l=Math.max(l,r))}if(-1===l)return!1;if(o>0)for(n=0;n=0){var l=r[s].length;n=n.substring(o+l),r[s].lastIndexOf(i)!==l&&(o=n.indexOf(i))>=0&&(n=n.substr(o+1))}return n}(!0),c=""+/^\s*/g.exec(p);c.length>0&&(l("\n"+c),t.preventDefault())}})},phpbb.showDragNDrop=function(e){e&&(t("body").on("dragenter dragover",function(){t(e).addClass("drag-n-drop")}).on("dragleave dragout dragend drop",function(){t(e).removeClass("drag-n-drop")}),t(e).on("dragenter dragover",function(){t(e).addClass("drag-n-drop-highlight")}).on("dragleave dragout dragend drop",function(){t(e).removeClass("drag-n-drop-highlight")}))},phpbb.dropdownHandles=".dropdown-container.dropdown-visible .dropdown-toggle",phpbb.dropdownVisibleContainers=".dropdown-container.dropdown-visible",phpbb.toggleDropdown=function(){var e,a=t(this),n=a.data("dropdown-options"),r=n.parent,i=r.hasClass("dropdown-visible");if(!i){t(phpbb.dropdownHandles).each(phpbb.toggleDropdown),e=n.direction;var o=n.verticalDirection,s=a.offset();if("auto"===e&&(e=(t(window).width()-a.outerWidth(!0))/2>s.left?"right":"left"),r.toggleClass(n.leftClass,"left"===e).toggleClass(n.rightClass,"right"===e),"auto"===o){var l=t(window).height();o=s.top-t(window).scrollTop()<.7*l?"down":"up"}r.toggleClass(n.upClass,"up"===o).toggleClass(n.downClass,"down"===o)}if(n.dropdown.toggle(),r.toggleClass(n.visibleClass,!i).toggleClass("dropdown-visible",!i),!i){var p=t(window).width();n.dropdown.find(".dropdown-contents").each(function(){var e=t(this);e.css({marginLeft:0,left:0,marginRight:0,maxWidth:p-4+"px"});var a=e.offset().left,n=e.outerWidth(!0);a<2?e.css("left",2-a+"px"):a+n+2>p&&e.css("margin-left",p-a-n-2+"px"),e.toggleClass("dropdown-nonscroll",this.scrollHeight===e.innerHeight())});var c=r.offset().left-4;if("left"===e){if(n.dropdown.css("margin-left","-"+c+"px"),n.dropdown.hasClass("dropdown-extended")){var d,h=c+r.outerWidth();n.dropdown.find(".dropdown-contents").each(function(){d=parseInt(t(this).outerWidth(),10),t(this).css({marginLeft:0,left:0})});var b=Math.min(d,h)+"px";n.dropdown.css({width:b,marginLeft:-b})}}else n.dropdown.css("margin-right","-"+(p+c)+"px")}if(arguments.length>0)try{var u=arguments[0];u.preventDefault(),u.stopPropagation()}catch(t){}return!1},phpbb.toggleSubmenu=function(e){t(this).siblings(".dropdown-submenu").toggle(),e.preventDefault()},phpbb.registerDropdown=function(e,a,n){var r={parent:e.parent(),direction:"auto",verticalDirection:"auto",visibleClass:"visible",leftClass:"dropdown-left",rightClass:"dropdown-right",upClass:"dropdown-up",downClass:"dropdown-down"};n&&(r=t.extend(r,n)),r.dropdown=a,r.parent.addClass("dropdown-container"),e.addClass("dropdown-toggle"),e.data("dropdown-options",r),e.click(phpbb.toggleDropdown),t(".dropdown-toggle-submenu",r.parent).click(phpbb.toggleSubmenu)},phpbb.colorPalette=function(t,e,a){var n,r,i,o=new Array(6),s="",l="";for(o[0]="00",o[1]="40",o[2]="80",o[3]="BF",o[4]="FF",l+='',n=0;n<5;n++){for("h"===t&&(l+=""),r=0;r<5;r++){for("v"===t&&(l+="
"),i=0;i<5;i++)l+='| ',l+=" | ";"v"===t&&(l+="
")}"h"===t&&(l+="")}return l+="
"},phpbb.registerPalette=function(e){var a=e.attr("data-orientation"),n=e.attr("data-height"),r=e.attr("data-width"),i=e.attr("data-target"),o=e.attr("data-bbcode");e.html(phpbb.colorPalette(a,r,n)),t("#color_palette_toggle").click(function(t){e.toggle(),t.preventDefault()}),t(e).on("click","a",function(e){var a=t(this).attr("data-color");o?bbfontstyle("[color=#"+a+"]","[/color]"):t(i).val(a),e.preventDefault()})},phpbb.toggleDisplay=function(e,a,n){n||(n="block");var r=t("#"+e),i=r.css("display");a||(a=""===i||i===n?-1:1),r.css("display",1===a?n:"none")},phpbb.toggleSelectSettings=function(e){e.children().each(function(){var e=t(this);t(e.data("toggle-setting")).toggle(e.is(":selected")),e.is(":selected")?t(e.data("toggle-setting")+" input").prop("disabled",!1):t(e.data("toggle-setting")+" input").prop("disabled",!0)})},phpbb.getFunctionByName=function(t){for(var e=t.split("."),a=e.pop(),n=window,r=0;r