Updating minified JavaScript files
authorwoltlab.com <woltlab@woltlab.com>
Tue, 21 Apr 2015 00:41:46 +0000 (02:41 +0200)
committerwoltlab.com <woltlab@woltlab.com>
Tue, 21 Apr 2015 00:41:46 +0000 (02:41 +0200)
wcfsetup/install/files/js/WCF.Combined.min.js

index 581733a357abd857d9ef22998d84fae8059cf579..b9be9f67e3038f53f661f6e24a5ae33d33ad0403 100755 (executable)
 }},$.datepicker._setTimeDatepicker=function(e,t,i){var s=this._getInst(e);if(s){var a=this._get(s,"timepicker");if(a){this._setDateFromField(s);var n;t&&("string"==typeof t?(a._parseTime(t,i),n=new Date,n.setHours(a.hour,a.minute,a.second,a.millisec),n.setMicroseconds(a.microsec)):(n=new Date(t.getTime()),n.setMicroseconds(t.getMicroseconds())),"Invalid Date"==""+n&&(n=void 0),this._setTime(s,n))}}},$.datepicker._base_setDateDatepicker=$.datepicker._setDateDatepicker,$.datepicker._setDateDatepicker=function(e,t){var i=this._getInst(e),s=t;if(i){"string"==typeof t&&(s=new Date(t),s.getTime()||(this._base_setDateDatepicker.apply(this,arguments),s=$(e).datepicker("getDate")));var a,n=this._get(i,"timepicker");s instanceof Date?(a=new Date(s.getTime()),a.setMicroseconds(s.getMicroseconds())):a=s,n&&a&&(n.support.timezone||null!==n._defaults.timezone||(n.timezone=-1*a.getTimezoneOffset()),s=$.timepicker.timezoneAdjust(s,n.timezone),a=$.timepicker.timezoneAdjust(a,n.timezone)),this._updateDatepicker(i),this._base_setDateDatepicker.apply(this,arguments),this._setTimeDatepicker(e,a,!0)}},$.datepicker._base_getDateDatepicker=$.datepicker._getDateDatepicker,$.datepicker._getDateDatepicker=function(e,t){var i=this._getInst(e);if(i){var s=this._get(i,"timepicker");if(s){void 0===i.lastVal&&this._setDateFromField(i,t);var a=this._getDate(i);return a&&s._parseTime($(e).val(),s.timeOnly)&&(a.setHours(s.hour,s.minute,s.second,s.millisec),a.setMicroseconds(s.microsec),null!=s.timezone&&(s.support.timezone||null!==s._defaults.timezone||(s.timezone=-1*a.getTimezoneOffset()),a=$.timepicker.timezoneAdjust(a,s.timezone))),a}return this._base_getDateDatepicker(e,t)}},$.datepicker._base_parseDate=$.datepicker.parseDate,$.datepicker.parseDate=function(e,t,i){var s;try{s=this._base_parseDate(e,t,i)}catch(a){if(!(a.indexOf(":")>=0))throw a;s=this._base_parseDate(e,t.substring(0,t.length-(a.length-a.indexOf(":")-2)),i),$.timepicker.log("Error parsing the date string: "+a+"\ndate string = "+t+"\ndate format = "+e)}return s},$.datepicker._base_formatDate=$.datepicker._formatDate,$.datepicker._formatDate=function(e){var t=this._get(e,"timepicker");return t?(t._updateDateTime(e),t.$input.val()):this._base_formatDate(e)},$.datepicker._base_optionDatepicker=$.datepicker._optionDatepicker,$.datepicker._optionDatepicker=function(e,t,i){var s,a=this._getInst(e);if(!a)return null;var n=this._get(a,"timepicker");if(n){var r,l=null,o=null,c=null,u=n._defaults.evnts,m={};if("string"==typeof t){if("minDate"===t||"minDateTime"===t)l=i;else if("maxDate"===t||"maxDateTime"===t)o=i;else if("onSelect"===t)c=i;else if(u.hasOwnProperty(t)){if(i===void 0)return u[t];m[t]=i,s={}}}else if("object"==typeof t){t.minDate?l=t.minDate:t.minDateTime?l=t.minDateTime:t.maxDate?o=t.maxDate:t.maxDateTime&&(o=t.maxDateTime);for(r in u)u.hasOwnProperty(r)&&t[r]&&(m[r]=t[r])}for(r in m)m.hasOwnProperty(r)&&(u[r]=m[r],s||(s=$.extend({},t)),delete s[r]);if(s&&isEmptyObject(s))return;l?(l=0===l?new Date:new Date(l),n._defaults.minDate=l,n._defaults.minDateTime=l):o?(o=0===o?new Date:new Date(o),n._defaults.maxDate=o,n._defaults.maxDateTime=o):c&&(n._defaults.onSelect=c)}return void 0===i?this._base_optionDatepicker.call($.datepicker,e,t):this._base_optionDatepicker.call($.datepicker,e,s||t,i)};var isEmptyObject=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0},extendRemove=function(e,t){$.extend(e,t);for(var i in t)(null===t[i]||void 0===t[i])&&(e[i]=t[i]);return e},detectSupport=function(e){var t=e.replace(/'.*?'/g,"").toLowerCase(),i=function(e,t){return-1!==e.indexOf(t)?!0:!1};return{hour:i(t,"h"),minute:i(t,"m"),second:i(t,"s"),millisec:i(t,"l"),microsec:i(t,"c"),timezone:i(t,"z"),ampm:i(t,"t")&&i(e,"h"),iso8601:i(e,"Z")}},convert24to12=function(e){return e%=12,0===e&&(e=12),e+""},computeEffectiveSetting=function(e,t){return e&&e[t]?e[t]:$.timepicker._defaults[t]},splitDateTime=function(e,t){var i=computeEffectiveSetting(t,"separator"),s=computeEffectiveSetting(t,"timeFormat"),a=s.split(i),n=a.length,r=e.split(i),l=r.length;return l>1?{dateString:r.splice(0,l-n).join(i),timeString:r.splice(0,n).join(i)}:{dateString:e,timeString:""}},parseDateTimeInternal=function(e,t,i,s,a){var n,r,l;if(r=splitDateTime(i,a),n=$.datepicker._base_parseDate(e,r.dateString,s),""===r.timeString)return{date:n};if(l=$.datepicker.parseTime(t,r.timeString,a),!l)throw"Wrong time format";return{date:n,timeObj:l}},selectLocalTimezone=function(e,t){if(e&&e.timezone_select){var i=t||new Date;e.timezone_select.val(-i.getTimezoneOffset())}};$.timepicker=new Timepicker,$.timepicker.timezoneOffsetString=function(e,t){if(isNaN(e)||e>840||-720>e)return e;var i=e,s=i%60,a=(i-s)/60,n=t?":":"",r=(i>=0?"+":"-")+("0"+Math.abs(a)).slice(-2)+n+("0"+Math.abs(s)).slice(-2);return"+00:00"===r?"Z":r},$.timepicker.timezoneOffsetNumber=function(e){var t=(""+e).replace(":","");return"Z"===t.toUpperCase()?0:/^(\-|\+)\d{4}$/.test(t)?("-"===t.substr(0,1)?-1:1)*(60*parseInt(t.substr(1,2),10)+parseInt(t.substr(3,2),10)):e},$.timepicker.timezoneAdjust=function(e,t){var i=$.timepicker.timezoneOffsetNumber(t);return isNaN(i)||e.setMinutes(e.getMinutes()+-e.getTimezoneOffset()-i),e},$.timepicker.timeRange=function(e,t,i){return $.timepicker.handleRange("timepicker",e,t,i)},$.timepicker.datetimeRange=function(e,t,i){$.timepicker.handleRange("datetimepicker",e,t,i)},$.timepicker.dateRange=function(e,t,i){$.timepicker.handleRange("datepicker",e,t,i)},$.timepicker.handleRange=function(e,t,i,s){function a(a,n){var r=t[e]("getDate"),l=i[e]("getDate"),o=a[e]("getDate");if(null!==r){var c=new Date(r.getTime()),u=new Date(r.getTime());c.setMilliseconds(c.getMilliseconds()+s.minInterval),u.setMilliseconds(u.getMilliseconds()+s.maxInterval),s.minInterval>0&&c>l?i[e]("setDate",c):s.maxInterval>0&&l>u?i[e]("setDate",u):r>l&&n[e]("setDate",o)}}function n(t,i,a){if(t.val()){var n=t[e].call(t,"getDate");null!==n&&s.minInterval>0&&("minDate"===a&&n.setMilliseconds(n.getMilliseconds()+s.minInterval),"maxDate"===a&&n.setMilliseconds(n.getMilliseconds()-s.minInterval)),n.getTime&&i[e].call(i,"option",a,n)}}s=$.extend({},{minInterval:0,maxInterval:0,start:{},end:{}},s);var r=!1;return"timepicker"===e&&(r=!0,e="datetimepicker"),$.fn[e].call(t,$.extend({timeOnly:r,onClose:function(){a($(this),i)},onSelect:function(){n($(this),i,"minDate")}},s,s.start)),$.fn[e].call(i,$.extend({timeOnly:r,onClose:function(){a($(this),t)},onSelect:function(){n($(this),t,"maxDate")}},s,s.end)),a(t,i),n(t,i,"minDate"),n(i,t,"maxDate"),$([t.get(0),i.get(0)])},$.timepicker.log=function(e){window.console&&window.console.log(e)},$.timepicker._util={_extendRemove:extendRemove,_isEmptyObject:isEmptyObject,_convert24to12:convert24to12,_detectSupport:detectSupport,_selectLocalTimezone:selectLocalTimezone,_computeEffectiveSetting:computeEffectiveSetting,_splitDateTime:splitDateTime,_parseDateTimeInternal:parseDateTimeInternal},Date.prototype.getMicroseconds||(Date.prototype.microseconds=0,Date.prototype.getMicroseconds=function(){return this.microseconds},Date.prototype.setMicroseconds=function(e){return this.setMilliseconds(this.getMilliseconds()+Math.floor(e/1e3)),this.microseconds=e%1e3,this}),$.timepicker.version="1.4.5"}})(jQuery); })(this);
 
 // WCF.Assets.js
-(function (window, undefined) { })(this);
+(function (window, undefined) {(function(){var d=false,c=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){};Class.extend=function(j){function a(){if(!d&&this.init){this.init.apply(this,arguments)}}var i=this.prototype;d=true;var h=new this;d=false;for(var b in j){h[b]=typeof j[b]=="function"&&typeof i[b]=="function"&&c.test(j[b])?function(f,e){return function(){var k=this._super;this._super=i[f];var g=e.apply(this,arguments);this._super=k;return g}}(b,j[b]):j[b]}a.prototype=h;a.prototype.constructor=a;a.extend=arguments.callee;return a}})();
+/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license */
+window.matchMedia||(window.matchMedia=function(){var c=window.styleMedia||window.media;if(!c){var a=document.createElement("style"),d=document.getElementsByTagName("script")[0],b=null;a.type="text/css";a.id="matchmediajs-test";d.parentNode.insertBefore(a,d);b="getComputedStyle" in window&&window.getComputedStyle(a,null)||a.currentStyle;c={matchMedium:function(f){var g="@media "+f+"{ #matchmediajs-test { width: 1px; } }";if(a.styleSheet){a.styleSheet.cssText=g}else{a.textContent=g}return b.width==="1px"}}}return function(e){return{matches:c.matchMedium(e||"all"),media:e||"all"}}}());
+/*! matchMedia() polyfill addListener/removeListener extension. Author & copyright (c) 2012: Scott Jehl. Dual MIT/BSD license */
+(function(){if(window.matchMedia&&window.matchMedia("all").addListener){return false}var f=window.matchMedia,b=f("only all").matches,g=false,d=0,a=[],c=function(e){clearTimeout(d);d=setTimeout(function(){for(var j=0,p=a.length;j<p;j++){var l=a[j].mql,k=a[j].listeners||[],m=f(l.media).matches;if(m!==l.matches){l.matches=m;for(var i=0,h=k.length;i<h;i++){k[i].call(window,l)}}}},30)};window.matchMedia=function(i){var j=f(i),h=[],e=0;j.addListener=function(k){if(!b){return}if(!g){g=true;window.addEventListener("resize",c,true)}if(e===0){e=a.push({mql:j,listeners:h})}h.push(k)};j.removeListener=function(l){for(var k=0,m=h.length;k<m;k++){if(h[k]===l){h.splice(k,1)}}};return j}})();
+/*!
+ * enquire.js v2.1.0 - Awesome Media Queries in JavaScript
+ * Copyright (c) 2013 Nick Williams - http://wicky.nillia.ms/enquire.js
+ * License: MIT (http://www.opensource.org/licenses/mit-license.php)
+ */
+(function(b,a,d){var c=a.matchMedia;"undefined"!=typeof module&&module.exports?module.exports=d(c):"function"==typeof define&&define.amd?define(function(){return a[b]=d(c)}):a[b]=d(c)})("enquire",this,function(b){function a(k,j){var o,m=0,l=k.length;for(m;l>m&&(o=j(k[m],m),o!==!1);m++){}}function h(e){return"[object Array]"===Object.prototype.toString.apply(e)}function f(e){return"function"==typeof e}function c(e){this.options=e,!e.deferSetup&&this.setup()}function g(j,l){this.query=j,this.isUnconditional=l,this.handlers=[],this.mql=b(j);var k=this;this.listener=function(e){k.mql=e,k.assess()},this.mql.addListener(this.listener)}function d(){if(!b){throw Error("matchMedia not present, legacy browsers require a polyfill")}this.queries={},this.browserIsIncapable=!b("only all").matches}return c.prototype={setup:function(){this.options.setup&&this.options.setup(),this.initialised=!0},on:function(){!this.initialised&&this.setup(),this.options.match&&this.options.match()},off:function(){this.options.unmatch&&this.options.unmatch()},destroy:function(){this.options.destroy?this.options.destroy():this.off()},equals:function(e){return this.options===e||this.options.match===e}},g.prototype={addHandler:function(j){var e=new c(j);this.handlers.push(e),this.matches()&&e.on()},removeHandler:function(e){var i=this.handlers;a(i,function(j,k){return j.equals(e)?(j.destroy(),!i.splice(k,1)):void 0})},matches:function(){return this.mql.matches||this.isUnconditional},clear:function(){a(this.handlers,function(e){e.destroy()}),this.mql.removeListener(this.listener),this.handlers.length=0},assess:function(){var e=this.matches()?"on":"off";a(this.handlers,function(j){j[e]()})}},d.prototype={register:function(i,k,l){var j=this.queries,e=l&&this.browserIsIncapable;return j[i]||(j[i]=new g(i,e)),f(k)&&(k={match:k}),h(k)||(k=[k]),a(k,function(m){j[i].addHandler(m)}),this},unregister:function(j,e){var k=this.queries[j];return k&&(e?k.removeHandler(e):(k.clear(),delete this.queries[j])),this}},new d});
+/*! head.load - v1.0.3 */
+(function(S,L){function I(){}function K(d,b){if(d){typeof d=="object"&&(d=[].slice.call(d));for(var a=0,c=d.length;a<c;a++){b.call(d,d[a],a)}}}function C(c,a){var b=Object.prototype.toString.call(a).slice(8,-1);return a!==L&&a!==null&&b===c}function M(a){return C("Function",a)}function ag(a){return C("Array",a)}function P(d){var b=d.split("/"),a=b[b.length-1],c=a.indexOf("?");return c!==-1?a.substring(0,c):a}function Z(a){(a=a||I,a._done)||(a(),a._done=1)}function E(h,b,c,a){var d=typeof h=="object"?h:{test:h,success:!b?!1:ag(b)?b:[b],failure:!c?!1:ag(c)?c:[c],callback:a||I},g=!!d.test;return g&&!!d.success?(d.success.push(d.callback),W.load.apply(null,d.success)):g||!d.failure?a():(d.failure.push(d.callback),W.load.apply(null,d.failure)),W}function J(d){var b={},a,c;if(typeof d=="object"){for(a in d){!d[a]||(b={name:a,url:d[a]})}}else{b={name:P(d),url:d}}return(c=ae[b.name],c&&c.url===b.url)?c:(ae[b.name]=b,b)}function H(b){b=b||ae;for(var a in b){if(b.hasOwnProperty(a)&&b[a].state!==T){return !1}}return !0}function q(a){a.state=B;K(a.onpreload,function(b){b.call()})}function R(a){a.state===L&&(a.state=V,a.onpreload=[],F({url:a.url,type:"cache"},function(){q(a)}))}function A(){var d=arguments,a=d[d.length-1],b=[].slice.call(d,1),c=b[0];return(M(a)||(a=null),ag(d[0]))?(d[0].push(a),W.load.apply(null,d[0]),W):(c?(K(b,function(e){M(e)||!e||R(J(e))}),af(J(d[0]),M(c)?c:function(){W.load.apply(null,b)})):af(J(d[0])),W)}function D(){var c=arguments,a=c[c.length-1],b={};return(M(a)||(a=null),ag(c[0]))?(c[0].push(a),W.load.apply(null,c[0]),W):(K(c,function(d){d!==a&&(d=J(d),b[d.name]=d)}),K(c,function(d){d!==a&&(d=J(d),af(d,function(){H(b)&&Z(a)}))}),W)}function af(b,a){if(a=a||I,b.state===T){a();return}if(b.state===aa){W.ready(b.name,a);return}if(b.state===V){b.onpreload.push(function(){af(b,a)});return}b.state=aa;F(b,function(){b.state=T;a();K(X[b.name],function(c){Z(c)});Q&&H()&&K(X.ALL,function(c){Z(c)})})}function j(b){b=b||"";var a=b.split("?")[0].split(".");return a[a.length-1].toLowerCase()}function F(c,b){function l(e){e=e||S.event;a.onload=a.onreadystatechange=a.onerror=null;b()}function n(e){e=e||S.event;(e.type==="load"||/loaded|complete/.test(a.readyState)&&(!N.documentMode||N.documentMode<9))&&(S.clearTimeout(c.errorTimeout),S.clearTimeout(c.cssTimeout),a.onload=a.onreadystatechange=a.onerror=null,b())}function g(){if(c.state!==T&&c.cssRetries<=20){for(var e=0,h=N.styleSheets.length;e<h;e++){if(N.styleSheets[e].href===a.href){n({type:"load"});return}}c.cssRetries++;c.cssTimeout=S.setTimeout(g,250)}}var a,d,k;b=b||I;d=j(c.url);d==="css"?(a=N.createElement("link"),a.type="text/"+(c.type||"css"),a.rel="stylesheet",a.href=c.url,c.cssRetries=0,c.cssTimeout=S.setTimeout(g,500)):(a=N.createElement("script"),a.type="text/"+(c.type||"javascript"),a.src=c.url);a.onload=a.onreadystatechange=n;a.onerror=l;a.async=!1;a.defer=!1;c.errorTimeout=S.setTimeout(function(){l({type:"timeout"})},7000);k=N.head||N.getElementsByTagName("head")[0];k.insertBefore(a,k.lastChild)}function x(){for(var b,a=N.getElementsByTagName("script"),d=0,c=a.length;d<c;d++){if(b=a[d].getAttribute("data-headjs-load"),!!b){W.load(b);return}}}function z(f,b){var a,d,c;return f===N?(Q?Z(b):ad.push(b),W):(M(f)&&(b=f,f="ALL"),ag(f))?(a={},K(f,function(e){a[e]=ae[e];W.ready(e,function(){H(a)&&Z(b)})}),W):typeof f!="string"||!M(b)?W:(d=ae[f],d&&d.state===T||f==="ALL"&&H()&&Q)?(Z(b),W):(c=X[f],c?c.push(b):c=X[f]=[b],W)}function ab(){if(!N.body){S.clearTimeout(W.readyTimeout);W.readyTimeout=S.setTimeout(ab,50);return}Q||(Q=!0,x(),K(ad,function(a){Z(a)}))}function U(){N.addEventListener?(N.removeEventListener("DOMContentLoaded",U,!1),ab()):N.readyState==="complete"&&(N.detachEvent("onreadystatechange",U),ab())}var N=S.document,ad=[],X={},ae={},G="async" in N.createElement("script")||"MozAppearance" in N.documentElement.style||S.opera,Q,Y=S.head_conf&&S.head_conf.head||"head",W=S[Y]=S[Y]||function(){W.ready.apply(null,arguments)},V=1,B=2,aa=3,T=4,O;if(N.readyState==="complete"){ab()}else{if(N.addEventListener){N.addEventListener("DOMContentLoaded",U,!1),S.addEventListener("load",ab,!1)}else{N.attachEvent("onreadystatechange",U);S.attachEvent("onload",ab);O=!1;try{O=!S.frameElement&&N.documentElement}catch(ac){}O&&O.doScroll&&function m(){if(!Q){try{O.doScroll("left")}catch(a){S.clearTimeout(W.readyTimeout);W.readyTimeout=S.setTimeout(m,50);return}ab()}}()}}W.load=W.js=G?D:A;W.test=E;W.ready=z;W.ready(N,function(){H()&&K(X.ALL,function(a){Z(a)});W.feature&&W.feature("domloaded",!0)})})(window);!function(){var e=function(e){function t(e){if(e.paused||e.ended||w){return !1}try{l.clearRect(0,0,s,h),l.drawImage(e,0,0,s,h)}catch(o){}p=setTimeout(t,O.duration,e),L.setIcon(c)}function o(e){var t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(t,function(e,t,o,n){return t+t+o+o+n+n});var o=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return o?{r:parseInt(o[1],16),g:parseInt(o[2],16),b:parseInt(o[3],16)}:!1}function n(e,t){var o,n={};for(o in e){n[o]=e[o]}for(o in t){n[o]=t[o]}return n}function i(){return document.hidden||document.msHidden||document.webkitHidden||document.mozHidden}e=e?e:{};var r,a,h,s,c,l,f,d,u,y,g,w,m,x,p,b={bgColor:"#d00",textColor:"#fff",fontFamily:"sans-serif",fontStyle:"bold",type:"circle",position:"down",animation:"slide",elementId:!1};m={},m.ff="undefined"!=typeof InstallTrigger,m.chrome=!!window.chrome,m.opera=!!window.opera||navigator.userAgent.indexOf("Opera")>=0,m.ie=
+/*@cc_on!@*/
+!1,m.safari=Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0,m.supported=m.chrome||m.ff||m.opera;var v=[];g=function(){},d=w=!1;var C=function(){r=n(b,e),r.bgColor=o(r.bgColor),r.textColor=o(r.textColor),r.position=r.position.toLowerCase(),r.animation=O.types[""+r.animation]?r.animation:b.animation;var t=r.position.indexOf("up")>-1,i=r.position.indexOf("left")>-1;if(t||i){for(var d=0;d<O.types[""+r.animation].length;d++){var u=O.types[""+r.animation][d];t&&(u.y=u.y<0.6?u.y-0.4:u.y-2*u.y+(1-u.w)),i&&(u.x=u.x<0.6?u.x-0.4:u.x-2*u.x+(1-u.h)),O.types[""+r.animation][d]=u}}r.type=I[""+r.type]?r.type:b.type;try{a=L.getIcon(),c=document.createElement("canvas"),f=document.createElement("img"),a.hasAttribute("href")?(f.setAttribute("src",a.getAttribute("href")),f.onload=function(){h=f.height>0?f.height:32,s=f.width>0?f.width:32,c.height=h,c.width=s,l=c.getContext("2d"),M.ready()}):(f.setAttribute("src",""),h=32,s=32,f.height=h,f.width=s,c.height=h,c.width=s,l=c.getContext("2d"),M.ready())}catch(y){throw"Error initializing favico. Message: "+y.message}},M={};M.ready=function(){d=!0,M.reset(),g()},M.reset=function(){d&&(v=[],u=!1,l.clearRect(0,0,s,h),l.drawImage(f,0,0,s,h),L.setIcon(c),window.clearTimeout(x),window.clearTimeout(p))},M.start=function(){if(d&&!y){var e=function(){u=v[0],y=!1,v.length>0&&(v.shift(),M.start())};if(v.length>0){y=!0;var t=function(){["type","animation","bgColor","textColor","fontFamily","fontStyle"].forEach(function(e){e in v[0].options&&(r[e]=v[0].options[e])}),O.run(v[0].options,function(){e()},!1)};u?O.run(u.options,function(){t()},!0):t()}}};var I={},E=function(e){return e.n="number"==typeof e.n?Math.abs(0|e.n):e.n,e.x=s*e.x,e.y=h*e.y,e.w=s*e.w,e.h=h*e.h,e.len=(""+e.n).length,e};I.circle=function(e){e=E(e);var t=!1;2===e.len?(e.x=e.x-0.4*e.w,e.w=1.4*e.w,t=!0):e.len>=3&&(e.x=e.x-0.65*e.w,e.w=1.65*e.w,t=!0),l.clearRect(0,0,s,h),l.drawImage(f,0,0,s,h),l.beginPath(),l.font=r.fontStyle+" "+Math.floor(e.h*(e.n>99?0.85:1))+"px "+r.fontFamily,l.textAlign="center",t?(l.moveTo(e.x+e.w/2,e.y),l.lineTo(e.x+e.w-e.h/2,e.y),l.quadraticCurveTo(e.x+e.w,e.y,e.x+e.w,e.y+e.h/2),l.lineTo(e.x+e.w,e.y+e.h-e.h/2),l.quadraticCurveTo(e.x+e.w,e.y+e.h,e.x+e.w-e.h/2,e.y+e.h),l.lineTo(e.x+e.h/2,e.y+e.h),l.quadraticCurveTo(e.x,e.y+e.h,e.x,e.y+e.h-e.h/2),l.lineTo(e.x,e.y+e.h/2),l.quadraticCurveTo(e.x,e.y,e.x+e.h/2,e.y)):l.arc(e.x+e.w/2,e.y+e.h/2,e.h/2,0,2*Math.PI),l.fillStyle="rgba("+r.bgColor.r+","+r.bgColor.g+","+r.bgColor.b+","+e.o+")",l.fill(),l.closePath(),l.beginPath(),l.stroke(),l.fillStyle="rgba("+r.textColor.r+","+r.textColor.g+","+r.textColor.b+","+e.o+")","number"==typeof e.n&&e.n>999?l.fillText((e.n>9999?9:Math.floor(e.n/1000))+"k+",Math.floor(e.x+e.w/2),Math.floor(e.y+e.h-0.2*e.h)):l.fillText(e.n,Math.floor(e.x+e.w/2),Math.floor(e.y+e.h-0.15*e.h)),l.closePath()},I.rectangle=function(e){e=E(e);var t=!1;2===e.len?(e.x=e.x-0.4*e.w,e.w=1.4*e.w,t=!0):e.len>=3&&(e.x=e.x-0.65*e.w,e.w=1.65*e.w,t=!0),l.clearRect(0,0,s,h),l.drawImage(f,0,0,s,h),l.beginPath(),l.font=r.fontStyle+" "+Math.floor(e.h*(e.n>99?0.9:1))+"px "+r.fontFamily,l.textAlign="center",l.fillStyle="rgba("+r.bgColor.r+","+r.bgColor.g+","+r.bgColor.b+","+e.o+")",l.fillRect(e.x,e.y,e.w,e.h),l.fillStyle="rgba("+r.textColor.r+","+r.textColor.g+","+r.textColor.b+","+e.o+")","number"==typeof e.n&&e.n>999?l.fillText((e.n>9999?9:Math.floor(e.n/1000))+"k+",Math.floor(e.x+e.w/2),Math.floor(e.y+e.h-0.2*e.h)):l.fillText(e.n,Math.floor(e.x+e.w/2),Math.floor(e.y+e.h-0.15*e.h)),l.closePath()};var T=function(e,t){t=("string"==typeof t?{animation:t}:t)||{},g=function(){try{if("number"==typeof e?e>0:""!==e){var n={type:"badge",options:{n:e}};if("animation" in t&&O.types[""+t.animation]&&(n.options.animation=""+t.animation),"type" in t&&I[""+t.type]&&(n.options.type=""+t.type),["bgColor","textColor"].forEach(function(e){e in t&&(n.options[e]=o(t[e]))}),["fontStyle","fontFamily"].forEach(function(e){e in t&&(n.options[e]=t[e])}),v.push(n),v.length>100){throw"Too many badges requests in queue."}M.start()}else{M.reset()}}catch(i){throw"Error setting badge. Message: "+i.message}},d&&g()},A=function(e){g=function(){try{var t=e.width,o=e.height,n=document.createElement("img"),i=o/h>t/s?t/s:o/h;n.setAttribute("src",e.getAttribute("src")),n.height=o/i,n.width=t/i,l.clearRect(0,0,s,h),l.drawImage(n,0,0,s,h),L.setIcon(c)}catch(r){throw"Error setting image. Message: "+r.message}},d&&g()},U=function(e){g=function(){try{if("stop"===e){return w=!0,M.reset(),w=!1,void 0}e.addEventListener("play",function(){t(this)},!1)}catch(o){throw"Error setting video. Message: "+o.message}},d&&g()},R=function(e){if(window.URL&&window.URL.createObjectURL||(window.URL=window.URL||{},window.URL.createObjectURL=function(e){return e}),m.supported){var o=!1;navigator.getUserMedia=navigator.getUserMedia||navigator.oGetUserMedia||navigator.msGetUserMedia||navigator.mozGetUserMedia||navigator.webkitGetUserMedia,g=function(){try{if("stop"===e){return w=!0,M.reset(),w=!1,void 0}o=document.createElement("video"),o.width=s,o.height=h,navigator.getUserMedia({video:!0,audio:!1},function(e){o.src=URL.createObjectURL(e),o.play(),t(o)},function(){})}catch(n){throw"Error setting webcam. Message: "+n.message}},d&&g()}},L={};L.getIcon=function(){var e=!1,t="",o=function(){for(var e=document.getElementsByTagName("head")[0].getElementsByTagName("link"),t=e.length,o=t-1;o>=0;o--){if(/(^|\s)icon(\s|$)/i.test(e[o].getAttribute("rel"))){return e[o]}}return !1};if(r.elementId?(e=document.getElementById(r.elementId),e.setAttribute("href",e.getAttribute("src"))):(e=o(),e===!1&&(e=document.createElement("link"),e.setAttribute("rel","icon"),document.getElementsByTagName("head")[0].appendChild(e))),t=r.elementId?e.src:e.href,"data:"!==t.substr(0,5)&&-1===t.indexOf(document.location.hostname)){throw new Error("Error setting favicon. Favicon image is on different domain (Icon: "+t+", Domain: "+document.location.hostname+")")}return e.setAttribute("type","image/png"),e},L.setIcon=function(e){var t=e.toDataURL("image/png");if(r.elementId){document.getElementById(r.elementId).setAttribute("src",t)}else{if(m.ff||m.opera){var o=a;a=document.createElement("link"),m.opera&&a.setAttribute("rel","icon"),a.setAttribute("rel","icon"),a.setAttribute("type","image/png"),document.getElementsByTagName("head")[0].appendChild(a),a.setAttribute("href",t),o.parentNode&&o.parentNode.removeChild(o)}else{a.setAttribute("href",t)}}};var O={};return O.duration=40,O.types={},O.types.fade=[{x:0.4,y:0.4,w:0.6,h:0.6,o:0},{x:0.4,y:0.4,w:0.6,h:0.6,o:0.1},{x:0.4,y:0.4,w:0.6,h:0.6,o:0.2},{x:0.4,y:0.4,w:0.6,h:0.6,o:0.3},{x:0.4,y:0.4,w:0.6,h:0.6,o:0.4},{x:0.4,y:0.4,w:0.6,h:0.6,o:0.5},{x:0.4,y:0.4,w:0.6,h:0.6,o:0.6},{x:0.4,y:0.4,w:0.6,h:0.6,o:0.7},{x:0.4,y:0.4,w:0.6,h:0.6,o:0.8},{x:0.4,y:0.4,w:0.6,h:0.6,o:0.9},{x:0.4,y:0.4,w:0.6,h:0.6,o:1}],O.types.none=[{x:0.4,y:0.4,w:0.6,h:0.6,o:1}],O.types.pop=[{x:1,y:1,w:0,h:0,o:1},{x:0.9,y:0.9,w:0.1,h:0.1,o:1},{x:0.8,y:0.8,w:0.2,h:0.2,o:1},{x:0.7,y:0.7,w:0.3,h:0.3,o:1},{x:0.6,y:0.6,w:0.4,h:0.4,o:1},{x:0.5,y:0.5,w:0.5,h:0.5,o:1},{x:0.4,y:0.4,w:0.6,h:0.6,o:1}],O.types.popFade=[{x:0.75,y:0.75,w:0,h:0,o:0},{x:0.65,y:0.65,w:0.1,h:0.1,o:0.2},{x:0.6,y:0.6,w:0.2,h:0.2,o:0.4},{x:0.55,y:0.55,w:0.3,h:0.3,o:0.6},{x:0.5,y:0.5,w:0.4,h:0.4,o:0.8},{x:0.45,y:0.45,w:0.5,h:0.5,o:0.9},{x:0.4,y:0.4,w:0.6,h:0.6,o:1}],O.types.slide=[{x:0.4,y:1,w:0.6,h:0.6,o:1},{x:0.4,y:0.9,w:0.6,h:0.6,o:1},{x:0.4,y:0.9,w:0.6,h:0.6,o:1},{x:0.4,y:0.8,w:0.6,h:0.6,o:1},{x:0.4,y:0.7,w:0.6,h:0.6,o:1},{x:0.4,y:0.6,w:0.6,h:0.6,o:1},{x:0.4,y:0.5,w:0.6,h:0.6,o:1},{x:0.4,y:0.4,w:0.6,h:0.6,o:1}],O.run=function(e,t,o,a){var h=O.types[i()?"none":r.animation];return a=o===!0?"undefined"!=typeof a?a:h.length-1:"undefined"!=typeof a?a:0,t=t?t:function(){},a<h.length&&a>=0?(I[r.type](n(e,h[a])),x=setTimeout(function(){o?a-=1:a+=1,O.run(e,t,o,a)},O.duration),L.setIcon(c),void 0):(t(),void 0)},C(),{badge:T,video:U,image:A,webcam:R,reset:M.reset,browser:{supported:m.supported}}};"undefined"!=typeof define&&define.amd?define([],function(){return e}):"undefined"!=typeof module&&module.exports?module.exports=e:this.Favico=e}();(function(b){if(typeof define==="function"&&define.amd&&define.amd.jQuery){define(["jquery"],b)}else{b(jQuery)}}(function(ac){var S="left",T="right",ad="up",G="down",af="in",E="out",V="none",L="auto",W="swipe",K="pinch",R="tap",Y="doubletap",ag="longtap",F="hold",M="horizontal",J="vertical",Z="all",O=10,ab="start",X="move",aa="end",Q="cancel",ah="ontouchstart" in window,I=window.navigator.msPointerEnabled&&!window.navigator.pointerEnabled,ae=window.navigator.pointerEnabled||window.navigator.msPointerEnabled,P="TouchSwipe";var U={fingers:1,threshold:75,cancelThreshold:null,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,longTapThreshold:500,doubleTapThreshold:200,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,doubleTap:null,longTap:null,hold:null,triggerOnTouchEnd:true,triggerOnTouchLeave:false,allowPageScroll:"auto",fallbackToMouseEvents:true,excludedElements:"label, button, input, select, textarea, a, .noSwipe"};ac.fn.swipe=function(a){var b=ac(this),c=b.data(P);if(c&&typeof a==="string"){if(c[a]){return c[a].apply(this,Array.prototype.slice.call(arguments,1))}else{ac.error("Method "+a+" does not exist on jQuery.swipe")}}else{if(!c&&(typeof a==="object"||!a)){return H.apply(this,arguments)}}return b};ac.fn.swipe.defaults=U;ac.fn.swipe.phases={PHASE_START:ab,PHASE_MOVE:X,PHASE_END:aa,PHASE_CANCEL:Q};ac.fn.swipe.directions={LEFT:S,RIGHT:T,UP:ad,DOWN:G,IN:af,OUT:E};ac.fn.swipe.pageScroll={NONE:V,HORIZONTAL:M,VERTICAL:J,AUTO:L};ac.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,ALL:Z};function H(a){if(a&&(a.allowPageScroll===undefined&&(a.swipe!==undefined||a.swipeStatus!==undefined))){a.allowPageScroll=V}if(a.click!==undefined&&a.tap===undefined){a.tap=a.click}if(!a){a={}}a=ac.extend({},ac.fn.swipe.defaults,a);return this.each(function(){var b=ac(this);var c=b.data(P);if(!c){c=new N(this,a);b.data(P,c)}})}function N(bR,C){var u=(ah||ae||!C.fallbackToMouseEvents),s=u?(ae?(I?"MSPointerDown":"pointerdown"):"touchstart"):"mousedown",w=u?(ae?(I?"MSPointerMove":"pointermove"):"touchmove"):"mousemove",g=u?(ae?(I?"MSPointerUp":"pointerup"):"touchend"):"mouseup",i=u?null:"mouseleave",bI=(ae?(I?"MSPointerCancel":"pointercancel"):"touchcancel");var bf=0,bw=null,bk=0,bU=0,bm=0,x=1,aw=0,bC=0,p=null;var bu=ac(bR);var b="start";var e=0;var bv=null;var h=0,bT=0,bQ=0,bi=0,o=0;var bp=null,bg=null;try{bu.bind(s,by);bu.bind(bI,bM)}catch(bb){ac.error("events not supported "+s+","+bI+" on jQuery.swipe")}this.enable=function(){bu.bind(s,by);bu.bind(bI,bM);return bu};this.disable=function(){bB();return bu};this.destroy=function(){bB();bu.data(P,null);return bu};this.option=function(ai,aj){if(C[ai]!==undefined){if(aj===undefined){return C[ai]}else{C[ai]=aj}}else{ac.error("Option "+ai+" does not exist on jQuery.swipe.options")}return null};function by(aj){if(bK()){return}if(ac(aj.target).closest(C.excludedElements,bu).length>0){return}var ai=aj.originalEvent?aj.originalEvent:aj;var ak,al=ah?ai.touches[0]:ai;b=ab;if(ah){e=ai.touches.length}else{aj.preventDefault()}bf=0;bw=null;bC=null;bk=0;bU=0;bm=0;x=1;aw=0;bv=bc();p=bl();j();if(!ah||(e===C.fingers||C.fingers===Z)||bo()){bd(0,al);h=au();if(e==2){bd(1,ai.touches[1]);bU=bm=D(bv[0].start,bv[1].start)}if(C.swipeStatus||C.pinchStatus){ak=n(ai,b)}}else{ak=false}if(ak===false){b=Q;n(ai,b);return ak}else{if(C.hold){bg=setTimeout(ac.proxy(function(){bu.trigger("hold",[ai.target]);if(C.hold){ak=C.hold.call(bu,ai,ai.target)}},this),C.longTapThreshold)}ay(true)}return null}function bS(al){var ai=al.originalEvent?al.originalEvent:al;if(b===aa||b===Q||a0()){return}var am,an=ah?ai.touches[0]:ai;var ak=bE(an);bT=au();if(ah){e=ai.touches.length}if(C.hold){clearTimeout(bg)}b=X;if(e==2){if(bU==0){bd(1,ai.touches[1]);bU=bm=D(bv[0].start,bv[1].start)}else{bE(ai.touches[1]);bm=D(bv[0].end,bv[1].end);bC=av(bv[0].end,bv[1].end)}x=bO(bU,bm);aw=Math.abs(bU-bm)}if((e===C.fingers||C.fingers===Z)||!ah||bo()){bw=bA(ak.start,ak.end);ba(al,bw);bf=bt(ak.start,ak.end);bk=bz();bD(bw,bf);if(C.swipeStatus||C.pinchStatus){am=n(ai,b)}if(!C.triggerOnTouchEnd||C.triggerOnTouchLeave){var ao=true;if(C.triggerOnTouchLeave){var aj=bn(this);ao=B(ak.end,aj)}if(!C.triggerOnTouchEnd&&ao){b=bJ(X)}else{if(C.triggerOnTouchLeave&&!ao){b=bJ(aa)}}if(b==Q||b==aa){n(ai,b)}}}else{b=Q;n(ai,b)}if(am===false){b=Q;n(ai,b)}}function q(aj){var ai=aj.originalEvent;if(ah){if(ai.touches.length>0){A();return true}}if(a0()){e=bi}bT=au();bk=bz();if(m()||!az()){b=Q;n(ai,b)}else{if(C.triggerOnTouchEnd||(C.triggerOnTouchEnd==false&&b===X)){aj.preventDefault();b=aa;n(ai,b)}else{if(!C.triggerOnTouchEnd&&bP()){b=aa;bG(ai,b,R)}else{if(b===X){b=Q;n(ai,b)}}}}ay(false);return null}function bM(){e=0;bT=0;h=0;bU=0;bm=0;x=1;j();ay(false)}function r(aj){var ai=aj.originalEvent;if(C.triggerOnTouchLeave){b=bJ(aa);n(ai,b)}}function bB(){bu.unbind(s,by);bu.unbind(bI,bM);bu.unbind(w,bS);bu.unbind(g,q);if(i){bu.unbind(i,r)}ay(false)}function bJ(ai){var aj=ai;var ak=bL();var al=az();var am=m();if(!ak||am){aj=Q}else{if(al&&ai==X&&(!C.triggerOnTouchEnd||C.triggerOnTouchLeave)){aj=aa}else{if(!al&&ai==aa&&C.triggerOnTouchLeave){aj=Q}}}return aj}function n(ai,ak){var aj=undefined;if(t()||f()){aj=bG(ai,ak,W)}else{if((l()||bo())&&aj!==false){aj=bG(ai,ak,K)}}if(bF()&&aj!==false){aj=bG(ai,ak,Y)}else{if(ax()&&aj!==false){aj=bG(ai,ak,ag)}else{if(be()&&aj!==false){aj=bG(ai,ak,R)}}}if(ak===Q){bM(ai)}if(ak===aa){if(ah){if(ai.touches.length==0){bM(ai)}}else{bM(ai)}}return aj}function bG(ai,al,aj){var ak=undefined;if(aj==W){bu.trigger("swipeStatus",[al,bw||null,bf||0,bk||0,e,bv]);if(C.swipeStatus){ak=C.swipeStatus.call(bu,ai,al,bw||null,bf||0,bk||0,e,bv);if(ak===false){return false}}if(al==aa&&bq()){bu.trigger("swipe",[bw,bf,bk,e,bv]);if(C.swipe){ak=C.swipe.call(bu,ai,bw,bf,bk,e,bv);if(ak===false){return false}}switch(bw){case S:bu.trigger("swipeLeft",[bw,bf,bk,e,bv]);if(C.swipeLeft){ak=C.swipeLeft.call(bu,ai,bw,bf,bk,e,bv)}break;case T:bu.trigger("swipeRight",[bw,bf,bk,e,bv]);if(C.swipeRight){ak=C.swipeRight.call(bu,ai,bw,bf,bk,e,bv)}break;case ad:bu.trigger("swipeUp",[bw,bf,bk,e,bv]);if(C.swipeUp){ak=C.swipeUp.call(bu,ai,bw,bf,bk,e,bv)}break;case G:bu.trigger("swipeDown",[bw,bf,bk,e,bv]);if(C.swipeDown){ak=C.swipeDown.call(bu,ai,bw,bf,bk,e,bv)}break}}}if(aj==K){bu.trigger("pinchStatus",[al,bC||null,aw||0,bk||0,e,x,bv]);if(C.pinchStatus){ak=C.pinchStatus.call(bu,ai,al,bC||null,aw||0,bk||0,e,x,bv);if(ak===false){return false}}if(al==aa&&bN()){switch(bC){case af:bu.trigger("pinchIn",[bC||null,aw||0,bk||0,e,x,bv]);if(C.pinchIn){ak=C.pinchIn.call(bu,ai,bC||null,aw||0,bk||0,e,x,bv)}break;case E:bu.trigger("pinchOut",[bC||null,aw||0,bk||0,e,x,bv]);if(C.pinchOut){ak=C.pinchOut.call(bu,ai,bC||null,aw||0,bk||0,e,x,bv)}break}}}if(aj==R){if(al===Q||al===aa){clearTimeout(bp);clearTimeout(bg);if(c()&&!v()){o=au();bp=setTimeout(ac.proxy(function(){o=null;bu.trigger("tap",[ai.target]);if(C.tap){ak=C.tap.call(bu,ai,ai.target)}},this),C.doubleTapThreshold)}else{o=null;bu.trigger("tap",[ai.target]);if(C.tap){ak=C.tap.call(bu,ai,ai.target)}}}}else{if(aj==Y){if(al===Q||al===aa){clearTimeout(bp);o=null;bu.trigger("doubletap",[ai.target]);if(C.doubleTap){ak=C.doubleTap.call(bu,ai,ai.target)}}}else{if(aj==ag){if(al===Q||al===aa){clearTimeout(bp);o=null;bu.trigger("longtap",[ai.target]);if(C.longTap){ak=C.longTap.call(bu,ai,ai.target)}}}}}return ak}function az(){var ai=true;if(C.threshold!==null){ai=bf>=C.threshold}return ai}function m(){var ai=false;if(C.cancelThreshold!==null&&bw!==null){ai=(bs(bw)-bf)>=C.cancelThreshold}return ai}function bh(){if(C.pinchThreshold!==null){return aw>=C.pinchThreshold}return true}function bL(){var ai;if(C.maxTimeThreshold){if(bk>=C.maxTimeThreshold){ai=false}else{ai=true}}else{ai=true}return ai}function ba(ak,aj){if(C.allowPageScroll===V||bo()){ak.preventDefault()}else{var ai=C.allowPageScroll===L;switch(aj){case S:if((C.swipeLeft&&ai)||(!ai&&C.allowPageScroll!=M)){ak.preventDefault()}break;case T:if((C.swipeRight&&ai)||(!ai&&C.allowPageScroll!=M)){ak.preventDefault()}break;case ad:if((C.swipeUp&&ai)||(!ai&&C.allowPageScroll!=J)){ak.preventDefault()}break;case G:if((C.swipeDown&&ai)||(!ai&&C.allowPageScroll!=J)){ak.preventDefault()}break}}}function bN(){var aj=bx();var ak=d();var ai=bh();return aj&&ak&&ai}function bo(){return !!(C.pinchStatus||C.pinchIn||C.pinchOut)}function l(){return !!(bN()&&bo())}function bq(){var ak=bL();var ai=az();var al=bx();var an=d();var am=m();var aj=!am&&an&&al&&ai&&ak;return aj}function f(){return !!(C.swipe||C.swipeStatus||C.swipeLeft||C.swipeRight||C.swipeUp||C.swipeDown)}function t(){return !!(bq()&&f())}function bx(){return((e===C.fingers||C.fingers===Z)||!ah)}function d(){return bv[0].end.x!==0}function bP(){return !!(C.tap)}function c(){return !!(C.doubleTap)}function br(){return !!(C.longTap)}function k(){if(o==null){return false}var ai=au();return(c()&&((ai-o)<=C.doubleTapThreshold))}function v(){return k()}function y(){return((e===1||!ah)&&(isNaN(bf)||bf<C.threshold))}function a(){return((bk>C.longTapThreshold)&&(bf<O))}function be(){return !!(y()&&bP())}function bF(){return !!(k()&&c())}function ax(){return !!(a()&&br())}function A(){bQ=au();bi=event.touches.length+1}function j(){bQ=0;bi=0}function a0(){var aj=false;if(bQ){var ai=au()-bQ;if(ai<=C.fingerReleaseThreshold){aj=true}}return aj}function bK(){return !!(bu.data(P+"_intouch")===true)}function ay(ai){if(ai===true){bu.bind(w,bS);bu.bind(g,q);if(i){bu.bind(i,r)}}else{bu.unbind(w,bS,false);bu.unbind(g,q,false);if(i){bu.unbind(i,r,false)}}bu.data(P+"_intouch",ai===true)}function bd(aj,ak){var ai=ak.identifier!==undefined?ak.identifier:0;bv[aj].identifier=ai;bv[aj].start.x=bv[aj].end.x=ak.pageX||ak.clientX;bv[aj].start.y=bv[aj].end.y=ak.pageY||ak.clientY;return bv[aj]}function bE(ak){var ai=ak.identifier!==undefined?ak.identifier:0;var aj=bj(ai);aj.end.x=ak.pageX||ak.clientX;aj.end.y=ak.pageY||ak.clientY;return aj}function bj(ai){for(var aj=0;aj<bv.length;aj++){if(bv[aj].identifier==ai){return bv[aj]}}}function bc(){var aj=[];for(var ai=0;ai<=5;ai++){aj.push({start:{x:0,y:0},end:{x:0,y:0},identifier:0})}return aj}function bD(aj,ai){ai=Math.max(ai,bs(aj));p[aj].distance=ai}function bs(ai){if(p[ai]){return p[ai].distance}return undefined}function bl(){var ai={};ai[S]=z(S);ai[T]=z(T);ai[ad]=z(ad);ai[G]=z(G);return ai}function z(ai){return{direction:ai,distance:0}}function bz(){return bT-h}function D(ai,aj){var ak=Math.abs(ai.x-aj.x);var al=Math.abs(ai.y-aj.y);return Math.round(Math.sqrt(ak*ak+al*al))}function bO(ak,aj){var ai=(aj/ak)*1;return ai.toFixed(2)}function av(){if(x<1){return E}else{return af}}function bt(ai,aj){return Math.round(Math.sqrt(Math.pow(aj.x-ai.x,2)+Math.pow(aj.y-ai.y,2)))}function bH(ak,am){var an=ak.x-am.x;var ai=am.y-ak.y;var al=Math.atan2(ai,an);var aj=Math.round(al*180/Math.PI);if(aj<0){aj=360-Math.abs(aj)}return aj}function bA(aj,ak){var ai=bH(aj,ak);if((ai<=45)&&(ai>=0)){return S}else{if((ai<=360)&&(ai>=315)){return S}else{if((ai>=135)&&(ai<=225)){return T}else{if((ai>45)&&(ai<135)){return G}else{return ad}}}}}function au(){var ai=new Date();return ai.getTime()}function bn(ak){ak=ac(ak);var ai=ak.offset();var aj={left:ai.left,right:ai.left+ak.outerWidth(),top:ai.top,bottom:ai.top+ak.outerHeight()};return aj}function B(aj,ai){return(aj.x>ai.left&&aj.x<ai.right&&aj.y>ai.top&&aj.y<ai.bottom)}}}));(function(b){(jQuery.browser=jQuery.browser||{}).mobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(b)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(b.substr(0,4))})(navigator.userAgent||navigator.vendor||window.opera);(function(b){var a={init:function(){var c=["paddingTop","paddingRight","paddingBottom","paddingLeft","fontSize","lineHeight","fontFamily","width","fontWeight","border-top-width","border-right-width","border-bottom-width","border-left-width","-moz-box-sizing","-webkit-box-sizing","box-sizing"];return this.each(function(){function k(){for(var f=0;f<c.length;f++){d.css(c[f],g.css(c[f]))}}function q(){var f=g.val().replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/&/g,"&").replace(/\n/g,"<br/>");d.html(f+"&nbsp;");m()}function m(){var l=d.height();var h="hidden";var f=w?l+t+e:l+t;if(f>j){f=j;h="auto"}else{if(f<p){f=p}}if(g.height()!==f){g.css({overflow:h,height:f+"px"})}}if(this.type!=="textarea"){return false}var g=b(this).css({resize:"none",overflow:"hidden"});var d=b("<div></div>").css({position:"absolute",display:"none","word-wrap":"break-word","white-space":"pre-wrap","border-style":"solid"}).appendTo(document.body);k();var w=g.css("box-sizing")=="border-box"||g.css("-moz-box-sizing")=="border-box"||g.css("-webkit-box-sizing")=="border-box";var e=parseInt(g.css("border-top-width"))+parseInt(g.css("padding-top"))+parseInt(g.css("padding-bottom"))+parseInt(g.css("border-bottom-width"));var v=parseInt(g.css("height"),10);var t=parseInt(g.css("line-height"),10)||parseInt(g.css("font-size"),10);var p=t*2>v?t*2:v;var j=parseInt(g.css("max-height"),10)>-1?parseInt(g.css("max-height"),10):Number.MAX_VALUE;g.bind("keyup change cut paste",function(){q()});b(window).bind("resize",function(){var f=parseInt(g.width(),10);if(d.width()!==f){d.css({width:f+"px"});q()}});g.bind("blur",function(){m()});g.bind("updateHeight",function(){k();q()});b(function(){q()})})}};b.fn.flexible=function(c){if(a[c]){return a[c].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof c==="object"||!c){return a.init.apply(this,arguments)}else{b.error("Method "+c+" does not exist on jQuery.flexible")}}}})(jQuery);
+/*! perfect-scrollbar - v0.5.8
+* http://noraesae.github.com/perfect-scrollbar/
+* Copyright (c) 2014 Hyunje Alex Jun; Licensed MIT */
+(function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?a(require("jquery")):a(jQuery)})(function(d){function b(h){return"string"==typeof h?parseInt(h,10):~~h}var f={wheelSpeed:1,wheelPropagation:!1,swipePropagation:!0,minScrollbarLength:null,maxScrollbarLength:null,useBothWheelAxes:!1,useKeyboard:!0,suppressScrollX:!1,suppressScrollY:!1,scrollXMarginOffset:0,scrollYMarginOffset:0,includePadding:!1},g=0,c=function(){var h=g++;return function(e){var i=".perfect-scrollbar-"+h;return e===void 0?i:e+i}},a="WebkitAppearance" in document.documentElement.style;d.fn.perfectScrollbar=function(h,e){return this.each(function(){function aS(m,p){var q=m+p,k=aq-ac;aK=0>q?0:q>k?k:q;var j=b(aK*(l-aq)/(aq-ac));ah.scrollTop(j)}function aD(m,p){var q=m+p,k=ap-aI;o=0>q?0:q>k?k:q;var j=b(o*(ar-ap)/(ap-aI));ah.scrollLeft(j)}function aQ(j){return ae.minScrollbarLength&&(j=Math.max(j,ae.minScrollbarLength)),ae.maxScrollbarLength&&(j=Math.min(j,ae.maxScrollbarLength)),j}function aC(){var k={width:al};k.left=at?ah.scrollLeft()+ap-ar:ah.scrollLeft(),ag?k.bottom=aT-ah.scrollTop():k.top=ad+ah.scrollTop(),am.css(k);var j={top:ah.scrollTop(),height:au};i?j.right=at?ar-ah.scrollLeft()-r-ak.outerWidth():r-ah.scrollLeft():j.left=at?ah.scrollLeft()+2*ap-ar-aw-ak.outerWidth():aw+ah.scrollLeft(),an.css(j),t.css({left:o,width:aI-ax}),ak.css({top:aK,height:ac-aF})}function aP(){ah.removeClass("ps-active-x"),ah.removeClass("ps-active-y"),ap=ae.includePadding?ah.innerWidth():ah.width(),aq=ae.includePadding?ah.innerHeight():ah.height(),ar=ah.prop("scrollWidth"),l=ah.prop("scrollHeight"),!ae.suppressScrollX&&ar>ap+ae.scrollXMarginOffset?(n=!0,al=ap-ao,aI=aQ(b(al*ap/ar)),o=b(ah.scrollLeft()*(al-aI)/(ar-ap))):(n=!1,aI=0,o=0,ah.scrollLeft(0)),!ae.suppressScrollY&&l>aq+ae.scrollYMarginOffset?(af=!0,au=aq-aN,ac=aQ(b(au*aq/l)),aK=b(ah.scrollTop()*(au-ac)/(l-aq))):(af=!1,ac=0,aK=0,ah.scrollTop(0)),o>=al-aI&&(o=al-aI),aK>=au-ac&&(aK=au-ac),aC(),n&&ah.addClass("ps-active-x"),af&&ah.addClass("ps-active-y")}function aG(){var j,m,p=function(q){aD(j,q.pageX-m),aP(),q.stopPropagation(),q.preventDefault()},k=function(){am.removeClass("in-scrolling"),d(aE).unbind(aj("mousemove"),p)};t.bind(aj("mousedown"),function(q){m=q.pageX,j=t.position().left,am.addClass("in-scrolling"),d(aE).bind(aj("mousemove"),p),d(aE).one(aj("mouseup"),k),q.stopPropagation(),q.preventDefault()}),j=m=null}function aO(){var j,m,p=function(q){aS(j,q.pageY-m),aP(),q.stopPropagation(),q.preventDefault()},k=function(){an.removeClass("in-scrolling"),d(aE).unbind(aj("mousemove"),p)};ak.bind(aj("mousedown"),function(q){m=q.pageY,j=ak.position().top,an.addClass("in-scrolling"),d(aE).bind(aj("mousemove"),p),d(aE).one(aj("mouseup"),k),q.stopPropagation(),q.preventDefault()}),j=m=null}function aB(k,j){var m=ah.scrollTop();if(0===k){if(!af){return !1}if(0===m&&j>0||m>=l-aq&&0>j){return !ae.wheelPropagation}}var p=ah.scrollLeft();if(0===j){if(!n){return !1}if(0===p&&0>k||p>=ar-ap&&k>0){return !ae.wheelPropagation}}return !0}function aM(p,k){var q=ah.scrollTop(),s=ah.scrollLeft(),m=Math.abs(p),j=Math.abs(k);if(j>m){if(0>k&&q===l-aq||k>0&&0===q){return !ae.swipePropagation}}else{if(m>j&&(0>p&&s===ar-ap||p>0&&0===s)){return !ae.swipePropagation}}return !0}function aR(){function k(q){var p=q.originalEvent.deltaX,s=-1*q.originalEvent.deltaY;return(p===void 0||s===void 0)&&(p=-1*q.originalEvent.wheelDeltaX/6,s=q.originalEvent.wheelDeltaY/6),q.originalEvent.deltaMode&&1===q.originalEvent.deltaMode&&(p*=10,s*=10),p!==p&&s!==s&&(p=0,s=q.originalEvent.wheelDelta),[p,s]}function j(q){if(a||!(ah.find("select:focus").length>0)){var u=k(q),s=u[0],p=u[1];m=!1,ae.useBothWheelAxes?af&&!n?(p?ah.scrollTop(ah.scrollTop()-p*ae.wheelSpeed):ah.scrollTop(ah.scrollTop()+s*ae.wheelSpeed),m=!0):n&&!af&&(s?ah.scrollLeft(ah.scrollLeft()+s*ae.wheelSpeed):ah.scrollLeft(ah.scrollLeft()-p*ae.wheelSpeed),m=!0):(ah.scrollTop(ah.scrollTop()-p*ae.wheelSpeed),ah.scrollLeft(ah.scrollLeft()+s*ae.wheelSpeed)),aP(),m=m||aB(s,p),m&&(q.stopPropagation(),q.preventDefault())}}var m=!1;window.onwheel!==void 0?ah.bind(aj("wheel"),j):window.onmousewheel!==void 0&&ah.bind(aj("mousewheel"),j)}function aL(){var j=!1;ah.bind(aj("mouseenter"),function(){j=!0}),ah.bind(aj("mouseleave"),function(){j=!1});var k=!1;d(aE).bind(aj("keydown"),function(s){if((!s.isDefaultPrevented||!s.isDefaultPrevented())&&j){for(var q=document.activeElement?document.activeElement:aE.activeElement;q.shadowRoot;){q=q.shadowRoot.activeElement}if(!d(q).is(":input,[contenteditable]")){var m=0,p=0;switch(s.which){case 37:m=-30;break;case 38:p=30;break;case 39:m=30;break;case 40:p=-30;break;case 33:p=90;break;case 32:case 34:p=-90;break;case 35:p=s.ctrlKey?-l:-aq;break;case 36:p=s.ctrlKey?ah.scrollTop():aq;break;default:return}ah.scrollTop(ah.scrollTop()-p),ah.scrollLeft(ah.scrollLeft()+m),k=aB(m,p),k&&s.preventDefault()}}})}function aA(){function j(k){k.stopPropagation()}ak.bind(aj("click"),j),an.bind(aj("click"),function(p){var q=b(ac/2),s=p.pageY-an.offset().top-q,m=aq-ac,k=s/m;0>k?k=0:k>1&&(k=1),ah.scrollTop((l-aq)*k)}),t.bind(aj("click"),j),am.bind(aj("click"),function(p){var q=b(aI/2),s=p.pageX-am.offset().left-q,m=ap-aI,k=s/m;0>k?k=0:k>1&&(k=1),ah.scrollLeft((ar-ap)*k)})}function aH(){function m(){var u=window.getSelection?window.getSelection():document.getSlection?document.getSlection():{rangeCount:0};return 0===u.rangeCount?null:u.getRangeAt(0).commonAncestorContainer}function q(){p||(p=setInterval(function(){return az()?(ah.scrollTop(ah.scrollTop()+j.top),ah.scrollLeft(ah.scrollLeft()+j.left),aP(),void 0):(clearInterval(p),void 0)},50))}function s(){p&&(clearInterval(p),p=null),am.removeClass("in-scrolling"),an.removeClass("in-scrolling")}var p=null,j={top:0,left:0},k=!1;d(aE).bind(aj("selectionchange"),function(){d.contains(ah[0],m())?k=!0:(k=!1,s())}),d(window).bind(aj("mouseup"),function(){k&&(k=!1,s())}),d(window).bind(aj("mousemove"),function(x){if(k){var v={x:x.pageX,y:x.pageY},w=ah.offset(),u={left:w.left,right:w.left+ah.outerWidth(),top:w.top,bottom:w.top+ah.outerHeight()};v.x<u.left+3?(j.left=-5,am.addClass("in-scrolling")):v.x>u.right-3?(j.left=5,am.addClass("in-scrolling")):j.left=0,v.y<u.top+3?(j.top=5>u.top+3-v.y?-5:-20,an.addClass("in-scrolling")):v.y>u.bottom-3?(j.top=5>v.y-u.bottom+3?5:20,an.addClass("in-scrolling")):j.top=0,0===j.top&&0===j.left?s():q()}})}function aa(H,m){function q(s,p){ah.scrollTop(ah.scrollTop()-p),ah.scrollLeft(ah.scrollLeft()-s),aP()}function j(){z=!0}function x(){z=!1}function y(p){return p.originalEvent.targetTouches?p.originalEvent.targetTouches[0]:p.originalEvent}function D(s){var p=s.originalEvent;return p.targetTouches&&1===p.targetTouches.length?!0:p.pointerType&&"mouse"!==p.pointerType&&p.pointerType!==p.MSPOINTER_TYPE_MOUSE?!0:!1}function I(s){if(D(s)){E=!0;var p=y(s);k.pageX=p.pageX,k.pageY=p.pageY,A=(new Date).getTime(),null!==C&&clearInterval(C),s.stopPropagation()}}function B(J){if(!z&&E&&D(J)){var u=y(J),K={pageX:u.pageX,pageY:u.pageY},w=K.pageX-k.pageX,p=K.pageY-k.pageY;q(w,p),k=K;var v=(new Date).getTime(),L=v-A;L>0&&(F.x=w/L,F.y=p/L,A=v),aM(w,p)&&(J.stopPropagation(),J.preventDefault())}}function G(){!z&&E&&(E=!1,clearInterval(C),C=setInterval(function(){return az()?0.01>Math.abs(F.x)&&0.01>Math.abs(F.y)?(clearInterval(C),void 0):(q(30*F.x,30*F.y),F.x*=0.8,F.y*=0.8,void 0):(clearInterval(C),void 0)},10))}var k={},A=0,F={},C=null,z=!1,E=!1;H&&(d(window).bind(aj("touchstart"),j),d(window).bind(aj("touchend"),x),ah.bind(aj("touchstart"),I),ah.bind(aj("touchmove"),B),ah.bind(aj("touchend"),G)),m&&(window.PointerEvent?(d(window).bind(aj("pointerdown"),j),d(window).bind(aj("pointerup"),x),ah.bind(aj("pointerdown"),I),ah.bind(aj("pointermove"),B),ah.bind(aj("pointerup"),G)):window.MSPointerEvent&&(d(window).bind(aj("MSPointerDown"),j),d(window).bind(aj("MSPointerUp"),x),ah.bind(aj("MSPointerDown"),I),ah.bind(aj("MSPointerMove"),B),ah.bind(aj("MSPointerUp"),G)))}function ay(){ah.bind(aj("scroll"),function(){aP()})}function ai(){ah.unbind(aj()),d(window).unbind(aj()),d(aE).unbind(aj()),ah.data("perfect-scrollbar",null),ah.data("perfect-scrollbar-update",null),ah.data("perfect-scrollbar-destroy",null),t.remove(),ak.remove(),am.remove(),an.remove(),ah=am=an=t=ak=n=af=ap=aq=ar=l=aI=o=aT=ag=ad=ac=aK=r=i=aw=at=aj=null}function ab(){aP(),ay(),aG(),aO(),aA(),aH(),aR(),(av||aJ)&&aa(av,aJ),ae.useKeyboard&&aL(),ah.data("perfect-scrollbar",ah),ah.data("perfect-scrollbar-update",aP),ah.data("perfect-scrollbar-destroy",ai)}var ae=d.extend(!0,{},f),ah=d(this),az=function(){return !!ah};if("object"==typeof h?d.extend(!0,ae,h):e=h,"update"===e){return ah.data("perfect-scrollbar-update")&&ah.data("perfect-scrollbar-update")(),ah}if("destroy"===e){return ah.data("perfect-scrollbar-destroy")&&ah.data("perfect-scrollbar-destroy")(),ah}if(ah.data("perfect-scrollbar")){return ah.data("perfect-scrollbar")}ah.addClass("ps-container");var ap,aq,ar,l,n,aI,o,al,af,ac,aK,au,at="rtl"===ah.css("direction"),aj=c(),aE=this.ownerDocument||document,am=d("<div class='ps-scrollbar-x-rail'>").appendTo(ah),t=d("<div class='ps-scrollbar-x'>").appendTo(am),aT=b(am.css("bottom")),ag=aT===aT,ad=ag?null:b(am.css("top")),ax=b(am.css("borderLeftWidth"))+b(am.css("borderRightWidth")),ao=b(am.css("marginLeft"))+b(am.css("marginRight")),an=d("<div class='ps-scrollbar-y-rail'>").appendTo(ah),ak=d("<div class='ps-scrollbar-y'>").appendTo(an),r=b(an.css("right")),i=r===r,aw=i?null:b(an.css("left")),aF=b(an.css("borderTopWidth"))+b(an.css("borderBottomWidth")),aN=b(an.css("marginTop"))+b(an.css("marginBottom")),av="ontouchstart" in window||window.DocumentTouch&&document instanceof window.DocumentTouch,aJ=null!==window.navigator.msMaxTouchPoints;return ab(),ah})}}); })(this);
 
 // WCF.js
 (function (window, undefined) {"use strict";(function(){var c=jQuery.fn.data;jQuery.fn.data=function(f,h){if(f){switch(typeof f){case"object":for(var g in f){if(g.match(/ID$/)){var e=f[g];delete f[g];g=g.replace(/ID$/,"-id");f[g]=e}}arguments[0]=f;break;case"string":if(f.match(/ID$/)){arguments[0]=f.replace(/ID$/,"-id")}break}}var d=c.apply(this,arguments);if(f===undefined){for(var g in d){if(g.match(/Id$/)){d[g.replace(/Id$/,"ID")]=d[g];delete d[g]}}}return d};if(!window.console){window.console={}}var b=["log","info","warn","exception","assert","dir","dirxml","trace","group","groupEnd","groupCollapsed","profile","profileEnd","count","clear","time","timeEnd","timeStamp","table","error"];for(var a=0;a<b.length;a++){if(typeof(console[b[a]])==="undefined"){console[b[a]]=function(){}}}if(typeof(console.debug)==="undefined"){console.debug=function(d){console.log(d)}}})();String.prototype.hashCode=function(){var a;var b=0;if(this.length){for(var d=0,c=this.length;d<c;d++){a=this.charCodeAt(d);b=((b<<5)-b)+a;b=b&b}}return b};window.shuffle=function(d){var c=d.length,b,a;while(0!==c){a=Math.floor(Math.random()*c);c-=1;b=d[c];d[c]=d[a];d[a]=b}return this};(function(){var d=navigator.userAgent.toLowerCase();var c=/(chrome)[ \/]([\w.]+)/.exec(d)||/(webkit)[ \/]([\w.]+)/.exec(d)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(d)||/(msie) ([\w.]+)/.exec(d)||d.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(d)||[];var a={browser:c[1]||"",version:c[2]||"0"};var b={};if(a.browser){b[a.browser]=true;b.version=a.version}if(b.chrome){b.webkit=true}else{if(b.webkit){b.safari=true}}jQuery.browser=jQuery.browser||{};jQuery.browser=$.extend(jQuery.browser,b);jQuery.browser.touch=(!!("ontouchstart" in window)||(!!("msMaxTouchPoints" in window.navigator)&&window.navigator.msMaxTouchPoints>0));jQuery.browser.smartphone=($("html").css("caption-side")=="bottom");if(jQuery.browser.mozilla&&d.match(/trident/)){jQuery.browser.mozilla=false;jQuery.browser.msie=true}jQuery.browser.iOS=/\((ipad|iphone|ipod);/.test(d);if(jQuery.browser.iOS){$("html").addClass("iOS")}jQuery.browser.android=(d.indexOf("android")!==-1);jQuery.browser.editor="redactor";jQuery.browser.ckeditor=false;jQuery.browser.redactor=true})();window.WCF={};$.extend(true,{removeArrayValue:function(b,a){return $.grep(b,function(d,c){return a!==d})},wcfEscapeID:function(a){return a.replace(/(:|\.)/g,"\\$1")},wcfIsset:function(a){return !!$("#"+$.wcfEscapeID(a)).length},getLength:function(a){var c=0;for(var b in a){if(a.hasOwnProperty(b)){c++}}return c}});$.fn.extend({getTagName:function(){return(this.length)?this.get(0).tagName.toLowerCase():""},getDimensions:function(c){var b={};var d={};var a=false;if(this.is(":hidden")){b=WCF.getInlineCSS(this);a=true;this.css({display:"block",visibility:"hidden"})}switch(c){case"inner":d={height:this.innerHeight(),width:this.innerWidth()};break;case"outer":d={height:this.outerHeight(),width:this.outerWidth()};break;default:d={height:this.height(),width:this.width()};break}if(a){WCF.revertInlineCSS(this,b,["display","visibility"])}return d},getOffsets:function(c){var b={};var d={};var a=false;if(this.is(":hidden")){b=WCF.getInlineCSS(this);a=true;this.css({display:"block",visibility:"hidden"})}switch(c){case"offset":d=this.offset();break;case"position":default:d=this.position();break}if(a){WCF.revertInlineCSS(this,b,["display","visibility"])}return d},makePositioned:function(a,b){if(a!="absolute"&&a!="fixed"){a="absolute"}var c=this.getOffsets("position");this.css({position:a,left:c.left,margin:0,top:c.top});if(b){this.remove().appentTo("body")}return this},disable:function(){return this.attr("disabled","disabled")},enable:function(){return this.removeAttr("disabled")},wcfIdentify:function(){if(!this.attr("id")){this.attr("id",WCF.getRandomID())}return this.attr("id")},getCaret:function(){if(this.is("input")){if(this.attr("type")!="text"&&this.attr("type")!="password"){return -1}}else{if(!this.is("textarea")){return -1}}var c=0;var b=this.get(0);if(document.selection){this.focus();var a=document.selection.createRange();a.moveStart("character",-this.val().length);c=a.text.length}else{if(b.selectionStart||b.selectionStart=="0"){c=parseInt(b.selectionStart)}}return c},setCaret:function(b){if(this.is("input")){if(this.attr("type")!="text"&&this.attr("type")!="password"){return false}}else{if(!this.is("textarea")){return false}}var c=this.get(0);this.focus();if(document.selection){var a=document.selection.createRange();a.moveStart("character",b);a.moveEnd("character",0);a.select()}else{if(c.selectionStart||c.selectionStart=="0"){c.selectionStart=b;c.selectionEnd=b}}return true},wcfDropIn:function(b,c,a){if(!b){b="up"}if(!a||!parseInt(a)){a=200}return this.show(WCF.getEffect(this,"drop"),{direction:b},a,c)},wcfDropOut:function(b,c,a){if(!b){b="down"}if(!a||!parseInt(a)){a=200}return this.hide(WCF.getEffect(this,"drop"),{direction:b},a,c)},wcfBlindIn:function(b,c,a){if(!b){b="vertical"}if(!a||!parseInt(a)){a=200}return this.show(WCF.getEffect(this,"blind"),{direction:b},a,c)},wcfBlindOut:function(b,c,a){if(!b){b="vertical"}if(!a||!parseInt(a)){a=200}return this.hide(WCF.getEffect(this,"blind"),{direction:b},a,c)},wcfHighlight:function(a,b){return this.effect("highlight",a,600,b)},wcfFadeIn:function(b,a){if(!a||!parseInt(a)){a=200}return this.show(WCF.getEffect(this,"fade"),{},a,b)},wcfFadeOut:function(b,a){if(!a||!parseInt(a)){a=200}return this.hide(WCF.getEffect(this,"fade"),{},a,b)},cssAsNumber:function(b){if(this.length){var a=this.css(b);if(a!==undefined){return parseInt(a.replace(/px$/,""))}}return 0}});$.extend(WCF,{activeDialogs:0,_idCounter:0,getRandomID:function(){var a="";do{a="wcf"+this._idCounter++}while($.wcfIsset(a));return a},inArray:function(b,a){return($.inArray(b,a)!=-1)},getEffect:function(a,b){if(a.is("tr")){return"highlight"}return b},getInlineCSS:function(b){var c={};var a=b.attr("style");if(!a){return{}}a=a.split(";");for(var f=0,d=a.length;f<d;f++){var e=$.trim(a[f]);if(e==""){continue}e=e.split(":");c[$.trim(e[0])]=$.trim(e[1])}return c},revertInlineCSS:function(a,c,e){for(var f=0,d=e.length;f<d;f++){var b=e[f];if(c[b]){a.css(b,c[b])}else{a.css(b,"")}}},getUUID:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(d){var b=Math.random()*16|0,a=d=="x"?b:(b&3|8);return a.toString(16)})},base64toBlob:function(h,g,a){g=g||"";a=a||512;var c=atob(h);var b=[];for(var j=0;j<c.length;j+=a){var f=c.slice(j,j+a);var d=new Array(f.length);for(var i=0;i<f.length;i++){d[i]=f.charCodeAt(i)}var e=new Uint8Array(d);b.push(e)}return new Blob(b,{type:g})},convertLegacyURL:function(a){if(URL_LEGACY_MODE){return a}return a.replace(/^index\.php\/(.*?)\/\?/,function(d,c){var e=c.split(/([A-Z][a-z0-9]+)/);var b="";for(var h=0,f=e.length;h<f;h++){var g=e[h].trim();if(g.length){if(b.length){b+="-"}b+=g.toLowerCase()}}return"index.php?"+b+"/&"})}});WCF.Browser={_isChrome:null,isChrome:function(){if(this._isChrome===null){this._isChrome=false;if(/chrom(e|ium)/.test(navigator.userAgent.toLowerCase())){this._isChrome=true}}return this._isChrome}};WCF.Dropdown={_callbacks:{},_didInit:false,_dropdowns:{},_menuContainer:null,_menus:{},init:function(){if(this._menuContainer===null){this._menuContainer=$('<div id="dropdownMenuContainer" />').appendTo(document.body)}var a=this;$(".dropdownToggle:not(.jsDropdownEnabled)").each(function(b,c){a.initDropdown($(c),false)});if(!this._didInit){this._didInit=true;WCF.CloseOverlayHandler.addCallback("WCF.Dropdown",$.proxy(this._closeAll,this));WCF.DOMNodeInsertedHandler.addCallback("WCF.Dropdown",$.proxy(this.init,this));$(document).on("scroll",$.proxy(this._scroll,this))}},_dialogScroll:function(b){var a=$(b.currentTarget);a.find(".dropdown.dropdownOpen").each(function(d,f){var i=$(f);var e=i.wcfIdentify();var g=i.offset();var c=a.offset();var h=$(f).height()/2;if(g.top+h<=c.top){WCF.Dropdown.toggleDropdown(e)}else{if(g.top>=c.top+a.height()){WCF.Dropdown.toggleDropdown(e)}else{if(g.left<=c.left){WCF.Dropdown.toggleDropdown(e)}else{if(g.left>=c.left+a.width()){WCF.Dropdown.toggleDropdown(e)}else{WCF.Dropdown.setAlignmentByID(i.wcfIdentify())}}}}})},_scroll:function(b){for(var a in this._dropdowns){var c=this._dropdowns[a];if(c.data("isOverlayDropdownButton")&&c.hasClass("dropdownOpen")){this.setAlignmentByID(a)}}},initDropdown:function(b,d){if(b.hasClass("jsDropdownEnabled")||b.data("target")){return}var e=b.parents(".dropdown");if(!e.length){console.debug("[WCF.Dropdown] Invalid dropdown passed, button '"+b.wcfIdentify()+"' does not have a parent with .dropdown, aborting.");return}var a=b.next(".dropdownMenu");if(!a.length){console.debug("[WCF.Dropdown] Invalid dropdown passed, dropdown '"+e.wcfIdentify()+"' does not have a dropdown menu, aborting.");return}a.detach().appendTo(this._menuContainer);var c=e.wcfIdentify();if(!this._dropdowns[c]){b.addClass("jsDropdownEnabled").click($.proxy(this._toggle,this));this._dropdowns[c]=e;this._menus[c]=a;if(!c.match(/^wcf\d+$/)){a.attr("data-source",c)}}b.data("target",c);if(d){b.trigger("click")}},removeDropdown:function(a){if(this._menus[a]){$(this._menus[a]).remove();delete this._menus[a];delete this._dropdowns[a]}},initDropdownFragment:function(c,a){var b=c.wcfIdentify();if(this._dropdowns[b]){console.debug("[WCF.Dropdown] Cannot register dropdown identified by '"+b+"' as a fragement.");return}this._dropdowns[b]=c;this._menus[b]=a.detach().appendTo(this._menuContainer)},registerCallback:function(a,b){if(!$.isFunction(b)){console.debug("[WCF.Dropdown] Callback for '"+a+"' is invalid");return false}if(!this._callbacks[a]){this._callbacks[a]=[]}this._callbacks[a].push(b)},_toggle:function(g,e){var b=(g===null)?e:$(g.currentTarget).data("target");var a=this._dropdowns[b];if(a&&a.data("isOverlayDropdownButton")===undefined){var d=a.parents(".dialogContent");a.data("isOverlayDropdownButton",d.length>0);if(d.length){d.on("scroll",this._dialogScroll)}}for(var f in this._dropdowns){var h=this._dropdowns[f];var c=this._menus[f];if(h.hasClass("dropdownOpen")){h.removeClass("dropdownOpen");c.removeClass("dropdownOpen");this._notifyCallbacks(f,"close")}else{if(f===b&&c[0].children.length>0){h.addClass("dropdownOpen");c.addClass("dropdownOpen");this._notifyCallbacks(f,"open");this.setAlignment(h,c)}}}WCF.Dropdown.Interactive.Handler.closeAll();if(g!==null){g.stopPropagation();return false}},toggleDropdown:function(a){this._toggle(null,a)},getDropdown:function(a){if(this._dropdowns[a]){return this._dropdowns[a]}return null},getDropdownMenu:function(a){if(this._menus[a]){return this._menus[a]}return null},setAlignmentByID:function(a){var c=this.getDropdown(a);if(c===null){console.debug("[WCF.Dropdown] Unable to find dropdown identified by '"+a+"'")}var b=this.getDropdownMenu(a);if(b===null){console.debug("[WCF.Dropdown] Unable to find dropdown menu identified by '"+a+"'")}this.setAlignment(c,b)},setAlignment:function(t,u){if(!u.data("isInitialized")){u.data("isInitialized",true).css({left:0,top:0})}var p=t.getDimensions("outer");var g=t.getOffsets("offset");var s=u.getDimensions("outer");var i=$(window).width();var d=t.find(".dropdownToggle");if(d.hasClass("dropdownCaptionTextarea")){p=d.getDimensions("outer")}var f="left";if((g.left+s.width)>i){f="right"}var j="auto";var l="auto";if(f==="left"){u.removeClass("dropdownArrowRight");j=g.left}else{u.addClass("dropdownArrowRight");l=(i-(g.left+p.width))}if(WCF.Language.get("wcf.global.pageDirection")=="rtl"){var r=j;var n=l;if(j=="auto"){u.removeClass("dropdownArrowRight")}else{l=i-(g.left+p.width);j="auto";if(l+s.width>i){j=r;l=n;u.addClass("dropdownArrowRight")}}}if(j=="auto"){l+="px"}else{j+="px"}var q=true;if(u.hasClass("dropdownOpen")){q=false;u.removeClass("dropdownOpen")}var m="auto";var v=g.top+p.height+7;if($.browser.smartphone){var f="bottom";var c=false;var e=$(window).height();var h=v+s.height;if(h>e){var b=g.top+10-s.height;if(b>=0){f="top"}else{c=true;var a=Math.abs(b);var o=Math.abs(h-e);if(o<=a){f="bottom"}else{f="top"}}}if(f=="top"){m=$(window).height()-g.top+10;v="auto";if(c){v=0;u.children("ul.scrollableDropdownMenu").css("max-height",m)}u.addClass("dropdownArrowBottom")}else{if(c){m=0;var k=u.children("ul.scrollableDropdownMenu");k.css("max-height",Math.min(k.css("max-height").replace(/px$/,""),e-v))}u.removeClass("dropdownArrowBottom")}}else{if(v+s.height>$(window).height()+$(document).scrollTop()){m=$(window).height()-g.top+10;v="auto";u.addClass("dropdownArrowBottom")}else{u.removeClass("dropdownArrowBottom")}}if(!q){u.addClass("dropdownOpen")}u.css({bottom:m,left:j,right:l,top:v})},_closeAll:function(){for(var a in this._dropdowns){var b=this._dropdowns[a];if(b.hasClass("dropdownOpen")){b.removeClass("dropdownOpen");this._menus[a].removeClass("dropdownOpen");this._notifyCallbacks(a,"close")}}},close:function(a){if(!this._dropdowns[a]){return}this._dropdowns[a].removeClass("dropdownOpen");this._menus[a].removeClass("dropdownOpen")},_notifyCallbacks:function(a,b){if(!this._callbacks[a]){return}for(var d=0,c=this._callbacks[a].length;d<c;d++){this._callbacks[a][d](a,b)}},destroy:function(a){if(this._dropdowns[a]===undefined){return false}this.close(a);this._menus[a].remove();delete this._menus[a];delete this._dropdowns[a]}};WCF.Dropdown.Interactive={};WCF.Dropdown.Interactive.Handler={_dropdownContainer:null,_dropdownMenus:{},create:function(d,b,a){if(this._dropdownContainer===null){this._dropdownContainer=$('<div class="dropdownMenuContainer" />').appendTo(document.body);WCF.CloseOverlayHandler.addCallback("WCF.Dropdown.Interactive.Handler",$.proxy(this.closeAll,this))}var c=new WCF.Dropdown.Interactive.Instance(this._dropdownContainer,d,b,a);this._dropdownMenus[b]=c;return c},open:function(a){if(this._dropdownMenus[a]){this._dropdownMenus[a].open();return true}return false},close:function(a){if(this._dropdownMenus[a]){this._dropdownMenus[a].close();return true}return false},closeAll:function(){$.each(this._dropdownMenus,function(b,a){a.close()})}};WCF.Dropdown.Interactive.Instance=Class.extend({_container:null,_itemList:null,_linkList:null,_options:{},_pointer:null,_triggerElement:null,init:function(e,d,c,b){this._options=b||{};this._triggerElement=d;var f=null;if(b.staticDropdown===true){this._container=this._triggerElement.find(".interactiveDropdownStatic:eq(0)").data("source",c).click(function(g){g.stopPropagation()})}else{this._container=$('<div class="interactiveDropdown" data-source="'+c+'" />').click(function(g){g.stopPropagation()});var a=$('<div class="interactiveDropdownHeader" />').appendTo(this._container);$('<span class="interactiveDropdownTitle">'+b.title+"</span>").appendTo(a);this._linkList=$('<ul class="interactiveDropdownLinks"></ul>').appendTo(a);f=$('<div class="interactiveDropdownItemsContainer" />').appendTo(this._container);this._itemList=$('<ul class="interactiveDropdownItems" />').appendTo(f);$('<a href="'+b.showAllLink+'" class="interactiveDropdownShowAll">'+WCF.Language.get("wcf.user.panel.showAll")+"</a>").appendTo(this._container)}this._pointer=$('<span class="pointer"><span /></span>').appendTo(this._container);if(!$.browser.mobile&&f!==null){f.perfectScrollbar({suppressScrollX:true})}this._container.appendTo(e)},getContainer:function(){return this._container},getItemList:function(){return this._itemList},getLinkList:function(){return this._linkList},open:function(){WCF.Dropdown._closeAll();this._container.addClass("open");this.render()},close:function(){this._container.removeClass("open")},toggle:function(){if(this._container.hasClass("open")){this.close();return false}else{WCF.Dropdown.Interactive.Handler.closeAll();this.open();return true}},resetItems:function(){this._itemList.empty();this.close()},render:function(){var a=WCF.Language.get("wcf.global.pageDirection");if($("html").css("caption-side")==="bottom"){this._renderMobile(a)}else{this._renderDesktop(a)}},rebuildScrollbar:function(){if(!$.browser.mobile){var a=this._itemList.parent();a.perfectScrollbar("destroy");a.perfectScrollbar({suppressScrollX:true})}},_renderMobile:function(b){var d=this._triggerElement.getDimensions("outer");var c=Math.floor(d.width/2);var e=this._triggerElement.getOffsets("offset");var a=Math.floor(this._pointer.outerWidth()/2);this._container.css({top:e.top+d.height+"px"});this._pointer.css({left:(e.left+c)-a+"px"})},_renderDesktop:function(b){var e=this._triggerElement.getDimensions("outer");var f=this._triggerElement.getOffsets("offset");var d=this._container.getDimensions();var g=$(window).width();var c=null;var a=null;if(b==="ltr"){c=this._getPositionLeft(f,d,g);if(!c.result){a=this._getPositionRight(f,d,e,g);if(a.result){c=null}else{a=null}}}else{a=this._getPositionRight(f,d,e,g);if(!a.result){c=this._getPositionLeft(f,d,g);if(c.result){a=null}else{c=null}}}if(a===null){this._container.css({left:c.left+"px",top:f.top+e.height+"px"});this._pointer.css({left:(this._options.pointerOffset?this._options.pointerOffset:"4px")})}else{this._container.css({right:a.right+"px",top:f.top+e.height+"px"});this._pointer.css({right:(this._options.pointerOffset?this._options.pointerOffset:"4px")})}},_getPositionLeft:function(d,e,b){var c=d.left;var a=d.left+e.width;return{left:c,result:(a<b)}},_getPositionRight:function(e,f,b,c){var d=(e.left+b.width)-f.width;var a=c-(e.left+b.width);return{result:(d>0),right:a}}});WCF.Clipboard={_actionProxy:null,_actionObjects:{},_containers:null,_containerData:{},_hasMarkedItems:false,_markedObjectIDs:{},_page:"",_pageObjectID:0,_proxy:null,_trackedElements:{},init:function(d,b,e,c){this._page=d;this._actionObjects=e||{};this._hasMarkedItems=(b>0);this._pageObjectID=parseInt(c)||0;this._actionProxy=new WCF.Action.Proxy({success:$.proxy(this._actionSuccess,this),url:"index.php/ClipboardProxy/?t="+SECURITY_TOKEN+SID_ARG_2ND});this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this),url:"index.php/Clipboard/?t="+SECURITY_TOKEN+SID_ARG_2ND});this._containers=$(".jsClipboardContainer").each($.proxy(function(g,f){this._initContainer(f)},this));if(this._hasMarkedItems&&this._containers.length){this._loadMarkedItems()}var a=this;WCF.DOMNodeInsertedHandler.addCallback("WCF.Clipboard",function(){a._containers=$(".jsClipboardContainer").each($.proxy(function(g,f){a._initContainer(f)},a))})},_loadMarkedItems:function(){new WCF.Action.Proxy({autoSend:true,data:{containerData:this._containerData,pageClassName:this._page,pageObjectID:this._pageObjectID},success:$.proxy(this._loadMarkedItemsSuccess,this),url:"index.php/ClipboardLoadMarkedItems/?t="+SECURITY_TOKEN+SID_ARG_2ND})},reload:function(){if(this._containers===null){return}this._loadMarkedItems()},_loadMarkedItemsSuccess:function(d,f,c){this._resetMarkings();for(var a in d.markedItems){if(!this._markedObjectIDs[a]){this._markedObjectIDs[a]=[]}var b=d.markedItems[a];for(var e in b){this._markedObjectIDs[a].push(b[e])}this._containers.each($.proxy(function(h,g){var i=$(g);if(i.data("type")!=a){return true}i.find("input.jsClipboardItem").each($.proxy(function(l,k){var j=$(k);if(WCF.inArray(j.data("objectID"),this._markedObjectIDs[a])){j.prop("checked",true);j.parents(".jsClipboardObject").addClass("jsMarked")}},this));i.find("input.jsClipboardMarkAll").each(function(l,k){var j=true;i.find("input.jsClipboardItem").each(function(n,o){var m=$(o);if(!m.prop("checked")){j=false}});if(j){$(k).prop("checked",true)}})},this))}this._success(d,f,c)},_resetMarkings:function(){this._containers.each($.proxy(function(b,a){var c=$(a);this._markedObjectIDs[c.data("type")]=[];c.find("input.jsClipboardItem, input.jsClipboardMarkAll").prop("checked",false);c.find(".jsClipboardObject").removeClass("jsMarked")},this))},_initContainer:function(a){var c=$(a);var b=c.wcfIdentify();if(!this._trackedElements[b]){c.find(".jsClipboardMarkAll").data("hasContainer",b).click($.proxy(this._markAll,this));this._markedObjectIDs[c.data("type")]=[];this._containerData[c.data("type")]={};$.each(c.data(),$.proxy(function(d,e){if(d.match(/^type(.+)/)){this._containerData[c.data("type")][WCF.String.lcfirst(d.replace(/^type/,""))]=e}},this));this._trackedElements[b]=[]}c.find("input.jsClipboardItem").each($.proxy(function(f,e){var g=$(e);var d=g.wcfIdentify();if(!WCF.inArray(d,this._trackedElements[b])){this._trackedElements[b].push(d);g.data("hasContainer",b).click($.proxy(this._click,this))}},this))},_click:function(f){var b=$(f.target);var e=b.data("objectID");var h=(b.prop("checked"))?true:false;var d=[e];if(b.data("hasContainer")){var g=$("#"+b.data("hasContainer"));var a=g.data("type")}else{var a=b.data("type")}if(h){this._markedObjectIDs[a].push(e);b.parents(".jsClipboardObject").addClass("jsMarked")}else{this._markedObjectIDs[a]=$.removeArrayValue(this._markedObjectIDs[a],e);b.parents(".jsClipboardObject").removeClass("jsMarked")}if(b.data("hasContainer")){var c=true;g.find("input.jsClipboardItem").each(function(j,i){var k=$(i);if(!k.prop("checked")){c=false}});g.find(".jsClipboardMarkAll").each(function(i,j){if(c){$(j).prop("checked",true)}else{$(j).prop("checked",false)}})}this._saveState(a,d,h)},_markAll:function(d){var b=$(d.target);var c=[];var f=true;if(b.is("input")){f=b.prop("checked")}if(b.data("hasContainer")){var e=$("#"+b.data("hasContainer"));var a=e.data("type")}else{var a=b.data("type")}if(b.data("hasContainer")){e.find("input.jsClipboardItem").each($.proxy(function(h,g){var j=$(g);var i=j.data("objectID");if(f){if(!j.prop("checked")){j.prop("checked",true);this._markedObjectIDs[a].push(i);c.push(i)}}else{if(j.prop("checked")){j.prop("checked",false);this._markedObjectIDs[a]=$.removeArrayValue(this._markedObjectIDs[a],i);c.push(i)}}},this));if(f){e.find(".jsClipboardObject").addClass("jsMarked")}else{e.find(".jsClipboardObject").removeClass("jsMarked")}}this._saveState(a,c,f)},_saveState:function(b,c,a){this._proxy.setOption("data",{action:(a)?"mark":"unmark",containerData:this._containerData,objectIDs:c,pageClassName:this._page,pageObjectID:this._pageObjectID,type:b});this._proxy.sendRequest()},_success:function(data,textStatus,jqXHR){var $containers={};$(".jsClipboardEditor").each(function(index,container){var $container=$(container);var $types=eval($container.data("types"));for(var $i=0,$length=$types.length;$i<$length;$i++){var $typeName=$types[$i];$containers[$typeName]=$container}var $containerID=$container.wcfIdentify();WCF.CloseOverlayHandler.removeCallback($containerID);$container.empty()});if(!data.items){return}for(var $typeName in data.items){if(!$containers[$typeName]){continue}var $container=$containers[$typeName];var $list=$container.children("ul");if($list.length==0){$list=$("<ul />").appendTo($container)}var $editor=data.items[$typeName];var $label=$('<li class="dropdown"><span class="dropdownToggle button">'+$editor.label+"</span></li>").appendTo($list);var $itemList=$('<ol class="dropdownMenu"></ol>').appendTo($label);for(var $itemIndex in $editor.items){var $item=$editor.items[$itemIndex];var $listItem=$("<li><span>"+$item.label+"</span></li>").appendTo($itemList);$listItem.data("container",$container);$listItem.data("objectType",$typeName);$listItem.data("actionName",$item.actionName).data("parameters",$item.parameters);$listItem.data("internalData",$item.internalData).data("url",$item.url).data("type",$typeName);$listItem.click($.proxy(this._executeAction,this))}$('<li class="dropdownDivider" />').appendTo($itemList);var $foo=$typeName;$("<li><span>"+WCF.Language.get("wcf.clipboard.item.unmarkAll")+"</span></li>").data("typeName",$typeName).appendTo($itemList).click($.proxy(function(event){var $typeName=$(event.currentTarget).data("typeName");this._proxy.setOption("data",{action:"unmarkAll",type:$typeName});this._proxy.setOption("success",$.proxy(function(data,textStatus,jqXHR){this._containers.each($.proxy(function(index,container){var $container=$(container);if($container.data("type")==$typeName){$container.find(".jsClipboardMarkAll, .jsClipboardItem").prop("checked",false);$container.find(".jsClipboardObject").removeClass("jsMarked");return false}},this));this._success(data,textStatus,jqXHR);this._proxy.setOption("success",$.proxy(this._success,this));this._loadMarkedItems()},this));this._proxy.sendRequest()},this));WCF.Dropdown.initDropdown($label.children(".dropdownToggle"),false)}},_closeLists:function(){$(".jsClipboardEditor ul").removeClass("dropdownOpen")},_executeAction:function(f){var d=$(f.currentTarget);var e=d.data("url");if(e){window.location.href=e}var a=true;if(d.data("parameters").className&&d.data("parameters").actionName){if(d.data("parameters").actionName==="unmarkAll"||d.data("parameters").objectIDs){var c=d.data("internalData")["confirmMessage"];if(c){var b=d.data("internalData")["template"];if(b){b=$(b)}WCF.System.Confirmation.show(c,$.proxy(function(h){if(h==="confirm"){var g={};if(b&&b.length){$("#wcfSystemConfirmationContent").find("input, select, textarea").each(function(j,k){var i=$(k);g[i.prop("name")]=i.val()})}this._executeAJAXActions(d,g)}},this),"",b)}else{this._executeAJAXActions(d,{})}}}else{var c=d.data("internalData")["confirmMessage"];if(c){a=false;WCF.System.Confirmation.show(c,function(g){if(g==="confirm"){d.data("container").trigger("clipboardAction",[d.data("type"),d.data("actionName"),d.data("parameters")])}})}}if(a){d.data("container").trigger("clipboardAction",[d.data("type"),d.data("actionName"),d.data("parameters")])}},_executeAJAXActions:function(d,e){e=e||{};var a=[];if(d.data("parameters").actionName!=="unmarkAll"){$.each(d.data("parameters").objectIDs,function(g,h){a.push(parseInt(h))})}var b={data:e,containerData:this._containerData[d.data("type")]};var f=d.data("internalData")["parameters"];if(f!==undefined){for(var c in f){b[c]=f[c]}}new WCF.Action.Proxy({autoSend:true,data:{actionName:d.data("parameters").actionName,className:d.data("parameters").className,objectIDs:a,parameters:b},success:$.proxy(function(g){if(d.data("parameters").actionName!=="unmarkAll"){d.data("container").trigger("clipboardActionResponse",[g,d.data("type"),d.data("actionName"),d.data("parameters")])}this._loadMarkedItems()},this)});if(this._actionObjects[d.data("objectType")]&&this._actionObjects[d.data("objectType")][d.data("parameters").actionName]){this._actionObjects[d.data("objectType")][d.data("parameters").actionName].triggerEffect(a)}},sendRequest:function(b){var a=$(b);this._actionProxy.setOption("data",{parameters:a.data("parameters"),typeName:a.data("type")});this._actionProxy.sendRequest()}};WCF.PeriodicalExecuter=Class.extend({_callback:null,_delay:0,_intervalID:null,_isExecuting:false,init:function(b,a){if(!$.isFunction(b)){console.debug("[WCF.PeriodicalExecuter] Given callback is invalid, aborting.");return}this._callback=b;this._interval=a;this.resume()},_execute:function(){if(!this._isExecuting){try{this._isExecuting=true;this._callback(this);this._isExecuting=false}catch(a){this._isExecuting=false;throw a}}},stop:function(){if(!this._intervalID){return}clearInterval(this._intervalID)},resume:function(){if(this._intervalID){this.stop()}this._intervalID=setInterval($.proxy(this._execute,this),this._interval)}});WCF.LoadingOverlayHandler={_activeRequests:0,_loadingOverlay:null,_pending:null,show:function(){if(this._loadingOverlay===null){this._loadingOverlay=$('<div class="spinner"><span class="icon icon48 icon-spinner" /> <span>'+WCF.Language.get("wcf.global.loading")+"</span></div>").appendTo($("body"));var b=this._loadingOverlay.outerWidth();if(b<70){b=70}this._loadingOverlay.css({marginLeft:Math.ceil(-1*b/2),width:b}).hide()}this._activeRequests++;if(this._activeRequests==1){if(this._pending===null){var a=this;this._pending=new WCF.PeriodicalExecuter(function(c){if(a._activeRequests){a._loadingOverlay.stop(true,true).fadeIn(100)}c.stop();a._pending=null},250)}}},hide:function(){this._activeRequests--;if(this._activeRequests==0){if(this._pending!==null){this._pending.stop();this._pending=null}this._loadingOverlay.stop(true,true).fadeOut(100)}},updateIcon:function(b,c){var a=(c===undefined||c?"addClass":"removeClass");b.find(".icon")[a]("icon-spinner");if(b.hasClass("icon")){b[a]("icon-spinner")}}};WCF.Action={};WCF.Action.Proxy=Class.extend({_showLoadingOverlayOnce:false,_suppressErrors:false,_lastRequest:null,init:function(b){this.options=$.extend(true,{autoSend:false,data:{},dataType:"json",after:null,init:null,jsonp:"callback",async:true,failure:null,showLoadingOverlay:true,success:null,suppressErrors:false,type:"POST",url:"index.php/AJAXProxy/?t="+SECURITY_TOKEN+SID_ARG_2ND,aborted:null,autoAbortPrevious:false},b);this.options.url=WCF.convertLegacyURL(this.options.url);this.confirmationDialog=null;this.loading=null;this._showLoadingOverlayOnce=false;this._suppressErrors=(this.options.suppressErrors===true);if(this.options.autoSend){this.sendRequest()}var a=this;$(window).on("beforeunload",function(){a._suppressErrors=true})},sendRequest:function(a){this._init();if(a||this.options.autoAbortPrevious){this.abortPrevious()}this._lastRequest=$.ajax({data:this.options.data,dataType:this.options.dataType,jsonp:this.options.jsonp,async:this.options.async,type:this.options.type,url:this.options.url,success:$.proxy(this._success,this),error:$.proxy(this._failure,this)});return this._lastRequest},abortPrevious:function(){if(this._lastRequest!==null){this._lastRequest.abort();this._lastRequest=null;if(this.options.showLoadingOverlay||this._showLoadingOverlayOnce){WCF.LoadingOverlayHandler.hide()}}},showLoadingOverlayOnce:function(){this._showLoadingOverlayOnce=true},suppressErrors:function(){this._suppressErrors=true},_init:function(){if($.isFunction(this.options.init)){this.options.init(this)}if(this.options.showLoadingOverlay||this._showLoadingOverlayOnce){WCF.LoadingOverlayHandler.show()}},_failure:function(d,i,h){if(i=="abort"){if($.isFunction(this.options.aborted)){this.options.aborted(d)}return}try{var c=$.parseJSON(d.responseText);var f=true;if($.isFunction(this.options.failure)){f=this.options.failure(c,d,i,h)}if(!this._suppressErrors&&f!==false){var a="";if(c.stacktrace){a="<br /><p>Stacktrace:</p><p>"+c.stacktrace+"</p>"}else{if(c.exceptionID){a="<br /><p>Exception ID: <code>"+c.exceptionID+"</code></p>"}}$('<div class="ajaxDebugMessage"><p>'+c.message+"</p>"+a+"</div>").wcfDialog({title:WCF.Language.get("wcf.global.error.title")})}}catch(g){var f=true;if($.isFunction(this.options.failure)){f=this.options.failure(null,d,i,h)}if(!this._suppressErrors&&f!==false){var b=(i==="timeout")?WCF.Language.get("wcf.global.error.timeout"):d.responseText;if(b&&b!="undefined"){$('<div class="ajaxDebugMessage"><p>'+b+"</p></div>").wcfDialog({title:WCF.Language.get("wcf.global.error.title")})}}}this._after()},_success:function(b,c,a){if($.isFunction(this.options.success)){if(b&&b.returnValues&&b.returnValues.template!==undefined){b.returnValues.template=$.trim(b.returnValues.template)}this.options.success(b,c,a)}this._after()},_after:function(){this._lastRequest=null;if($.isFunction(this.options.after)){this.options.after()}if(this.options.showLoadingOverlay||this._showLoadingOverlayOnce){WCF.LoadingOverlayHandler.hide();if(this._showLoadingOverlayOnce){this._showLoadingOverlayOnce=false}}WCF.DOMNodeInsertedHandler.execute();$("a[href*=#]").each(function(c,e){var b=$(e);if(b.prop("href").indexOf("AJAXProxy")!=-1){var d=b.prop("href").substr(b.prop("href").indexOf("#"));var a=document.location.toString().replace(/#.*/,"");b.prop("href",a+d)}})},setOption:function(a,b){this.options[a]=b}});WCF.Action.SimpleProxy=Class.extend({init:function(a,b){this.options=$.extend(true,{action:"",className:"",elements:null,eventName:"click"},a);this.callbacks=$.extend(true,{after:null,failure:null,init:null,success:null},b);if(!this.options.elements){return}this.proxy=new WCF.Action.Proxy(this.callbacks);this.options.elements.each($.proxy(function(c,d){$(d).bind(this.options.eventName,$.proxy(this._handleEvent,this))},this))},_handleEvent:function(a){this.proxy.setOption("data",{actionName:this.options.action,className:this.options.className,objectIDs:[$(a.target).data("objectID")]});this.proxy.sendRequest()}});WCF.Action.Delete=Class.extend({_buttonSelector:"",_className:"",_containerSelector:"",_containers:[],init:function(c,a,b){this._containerSelector=a;this._className=c;this._buttonSelector=(b)?b:".jsDeleteButton";this.proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)});this._initElements();WCF.DOMNodeInsertedHandler.addCallback("WCF.Action.Delete"+this._className.hashCode(),$.proxy(this._initElements,this))},_initElements:function(){$(this._containerSelector).each((function(b,a){var d=$(a);var c=d.wcfIdentify();if(!WCF.inArray(c,this._containers)){var e=d.find(this._buttonSelector);if(e.length){this._containers.push(c);e.click($.proxy(this._click,this))}}}).bind(this))},_click:function(b){var a=$(b.currentTarget);b.preventDefault();if(a.data("confirmMessage")){WCF.System.Confirmation.show(a.data("confirmMessage"),$.proxy(this._execute,this),{target:a})}else{WCF.LoadingOverlayHandler.updateIcon(a);this._sendRequest(a)}},_didTriggerEffect:function(a){},_execute:function(b,a){if(b==="cancel"){return}WCF.LoadingOverlayHandler.updateIcon(a.target);this._sendRequest(a.target)},_sendRequest:function(a){this.proxy.setOption("data",{actionName:"delete",className:this._className,interfaceName:"wcf\\data\\IDeleteAction",objectIDs:[$(a).data("objectID")]});this.proxy.sendRequest()},_success:function(b,c,a){this.triggerEffect(b.objectIDs)},triggerEffect:function(d){for(var a in this._containers){var e=$("#"+this._containers[a]);var c=e.find(this._buttonSelector);if(WCF.inArray(c.data("objectID"),d)){var b=this;e.wcfBlindOut("up",function(){var f=$(this).remove();b._containers.splice(b._containers.indexOf(f.wcfIdentify()),1);b._didTriggerEffect(f);if(c.data("eventName")){WCF.System.Event.fireEvent("com.woltlab.wcf.action.delete",c.data("eventName"),{button:c,container:f})}})}}}});WCF.Action.NestedDelete=WCF.Action.Delete.extend({triggerEffect:function(c){for(var a in this._containers){var d=$("#"+this._containers[a]);if(WCF.inArray(d.find(this._buttonSelector).data("objectID"),c)){if(d.has("ol").has("li").length){if(d.is(":only-child")){d.parent().replaceWith(d.find("> ol"))}else{d.replaceWith(d.find("> ol > li"))}this._containers.splice(this._containers.indexOf(d.wcfIdentify()),1);this._didTriggerEffect(d)}else{var b=this;d.wcfBlindOut("up",function(){$(this).remove();b._containers.splice(b._containers.indexOf($(this).wcfIdentify()),1);b._didTriggerEffect($(this))})}}}}});WCF.Action.Toggle=Class.extend({_buttonSelector:".jsToggleButton",_className:"",_containerSelector:"",_containers:[],init:function(d,a,c){this._containerSelector=a;this._className=d;this._buttonSelector=(c)?c:".jsToggleButton";this._containers=[];var b={success:$.proxy(this._success,this)};this.proxy=new WCF.Action.Proxy(b);this._initElements();WCF.DOMNodeInsertedHandler.addCallback("WCF.Action.Toggle"+this._className.hashCode(),$.proxy(this._initElements,this))},_initElements:function(){$(this._containerSelector).each($.proxy(function(b,a){var d=$(a);var c=d.wcfIdentify();if(!WCF.inArray(c,this._containers)){this._containers.push(c);d.find(this._buttonSelector).click($.proxy(this._click,this))}},this))},_click:function(b){var a=$(b.currentTarget);b.preventDefault();if(a.data("confirmMessage")){WCF.System.Confirmation.show(a.data("confirmMessage"),$.proxy(this._execute,this),{target:a})}else{WCF.LoadingOverlayHandler.updateIcon(a);this._sendRequest(a)}},_execute:function(b,a){if(b==="cancel"){return}WCF.LoadingOverlayHandler.updateIcon(a.target);this._sendRequest(a.target)},_sendRequest:function(a){this.proxy.setOption("data",{actionName:"toggle",className:this._className,interfaceName:"wcf\\data\\IToggleAction",objectIDs:[$(a).data("objectID")]});this.proxy.sendRequest()},_success:function(b,c,a){this.triggerEffect(b.objectIDs)},triggerEffect:function(b){for(var a in this._containers){var d=$("#"+this._containers[a]);var c=d.find(this._buttonSelector);if(WCF.inArray(c.data("objectID"),b)){d.wcfHighlight();this._toggleButton(d,c)}}},_toggleButton:function(c,b){var a="";WCF.LoadingOverlayHandler.updateIcon(b,false);if(b.hasClass("icon-check-empty")){b.removeClass("icon-check-empty").addClass("icon-check");a=(b.data("disableTitle")?b.data("disableTitle"):WCF.Language.get("wcf.global.button.disable"));b.attr("title",a)}else{b.removeClass("icon-check").addClass("icon-check-empty");a=(b.data("enableTitle")?b.data("enableTitle"):WCF.Language.get("wcf.global.button.enable"));b.attr("title",a)}c.toggleClass("disabled")}});WCF.Action.Scroll=Class.extend({_callback:null,_reference:null,_target:null,_threshold:0,init:function(b,d,a,c){this._threshold=parseInt(b);if(this._threshold===0){console.debug("[WCF.Action.Scroll] Given threshold is invalid, aborting.");return}if($.isFunction(d)){this._callback=d}if(this._callback===null){console.debug("[WCF.Action.Scroll] Given callback is invalid, aborting.");return}this._reference=$((a)?a:window);this._target=$((c)?c:document);this.start();this._scroll()},_scroll:function(){var a=this._target.height();var b=this._reference.scrollTop();var c=this._reference.height();if((a-(c+b))<this._threshold){this._callback(this)}},start:function(){this._reference.on("scroll",$.proxy(this._scroll,this))},stop:function(){this._reference.off("scroll")}});WCF.Date={};WCF.Date.Picker={_dateFormat:"yy-mm-dd",_timeFormat:"g:ia",init:function(){var a=$.timepicker.log;$.timepicker.log=function(b){if(b.indexOf("Error parsing the date/time string: Unexpected literal at position")==-1&&b.indexOf("Error parsing the date/time string: Unknown name at position")==-1){a(b)}};this._convertDateFormat();this._initDatePicker();WCF.DOMNodeInsertedHandler.addCallback("WCF.Date.Picker",$.proxy(this._initDatePicker,this))},_convertDateFormat:function(){var a={a:"tt",A:"TT",g:"h",G:"H",h:"hh",H:"HH",i:"mm",s:"ss",u:"l",d:"dd",D:"D",j:"d",l:"DD",z:"o",S:"",F:"MM",m:"mm",M:"M",n:"m",o:"yy",Y:"yy",y:"y",U:"@"};this._dateFormat=WCF.Language.get("wcf.date.dateFormat").replace(/([^dDjlzSFmMnoYyU\\]*(?:\\.[^dDjlzSFmMnoYyU\\]*)*)([dDjlzSFmMnoYyU])/g,function(c,f,e,g,b){for(var d in a){if(e==d){e=a[d]}}return f+e});this._timeFormat=WCF.Language.get("wcf.date.timeFormat").replace(/([^aAgGhHisu\\]*(?:\\.[^aAgGhHisu\\]*)*)([aAgGhHisu])/g,function(c,f,e,g,b){for(var d in a){if(e==d){e=a[d]}}return f+e})},_initDatePicker:function(){$("input[type=date]:not(.jsDatePicker), input[type=datetime]:not(.jsDatePicker)").each($.proxy(function(g,j){var i=$(j);var d=i.prop("name");var m=i.val();var b=i.attr("type")=="datetime";i.prop("type","text").addClass("jsDatePicker");if(i.data("placeholder")){i.attr("placeholder",i.data("placeholder"))}i.removeAttr("name");i.before('<input type="hidden" id="'+i.wcfIdentify()+'DatePicker" name="'+d+'" value="'+m+'" />');var f=i.attr("max")?new Date(i.attr("max").replace(" ","T")):null;var n=i.attr("min")?new Date(i.attr("min").replace(" ","T")):null;var c={altField:"#"+i.wcfIdentify()+"DatePicker",altFormat:"yy-mm-dd",beforeShow:function(q,p){setTimeout(function(){p.dpDiv.position({my:"left top",at:"left bottom",collision:"none",of:q})},1)},changeMonth:true,changeYear:true,dateFormat:this._dateFormat,dayNames:WCF.Language.get("__days"),dayNamesMin:WCF.Language.get("__daysShort"),dayNamesShort:WCF.Language.get("__daysShort"),firstDay:parseInt(WCF.Language.get("wcf.date.firstDayOfTheWeek"))||0,isRTL:WCF.Language.get("wcf.global.pageDirection")=="rtl",maxDate:f,minDate:n,monthNames:WCF.Language.get("__months"),monthNamesShort:WCF.Language.get("__monthsShort"),showButtonPanel:false,onClose:function(q,p){if(q==""){$(p.settings.altField).val(q)}},showOtherMonths:true,yearRange:(i.hasClass("birthday")?"-100:+0":"1900:2038")};if(b){if(/[0-9]{2}:[0-9]{2}:[0-9]{2}$/.test(m)){m=m.replace(/:[0-9]{2}$/,"");i.val(m)}m=m.replace(" ","T");if(i.data("timeOnly")){var e=m.split(":");var a=new Date();a.setHours(e[0]);a.setMinutes(e[1]);a.setSeconds(0);m=a.toString()}if(i.data("ignoreTimezone")){var l=new Date(m).getTimezoneOffset();var o=(l>0)?"-":"+";l=Math.abs(l);var h=(Math.floor(l/60)).toString();var k=(l%60).toString();o+=(h.length==2)?h:"0"+h;o+=":";o+=(k.length==2)?k:"0"+k;m=m.replace(/[+-][0-9]{2}:[0-9]{2}$/,o)}c=$.extend(c,{altFieldTimeOnly:false,altTimeFormat:"HH:mm",controlType:"select",hourText:WCF.Language.get("wcf.date.hour"),minuteText:WCF.Language.get("wcf.date.minute"),showTime:false,timeFormat:this._timeFormat,timeOnly:i.data("timeOnly")?true:false,yearRange:(i.hasClass("birthday")?"-100:+0":"1900:2038")})}if(b){i.datetimepicker(c)}else{i.datepicker(c)}if(m){m=new Date(m);if(!b){m.setMinutes(m.getMinutes()+m.getTimezoneOffset())}i.datepicker("setDate",m)}i.datepicker("widget").hide();if(i.data("timeOnly")){i.datepicker("widget").addClass("timeOnlyPicker")}},this))}};WCF.Date.Util={gmdate:function(a){var b=(a)?a:new Date();return Math.round(Date.UTC(b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDay(),b.getUTCHours(),b.getUTCMinutes(),b.getUTCSeconds())/1000)},getTimezoneDate:function(b,c){var d=new Date(b);var a=d.getTimezoneOffset()*60000;return new Date((b+a+c))}};WCF.Date.Time=Class.extend({_date:0,_elements:null,_offset:null,_timestamp:0,init:function(){this._elements=$("time.datetime");this._offset=null;this._timestamp=0;this._refresh();new WCF.PeriodicalExecuter($.proxy(this._refresh,this),60000);WCF.DOMNodeInsertedHandler.addCallback("WCF.Date.Time",$.proxy(this._domNodeInserted,this))},_domNodeInserted:function(){this._elements=$("time.datetime");this._refresh()},_refresh:function(){this._date=new Date();this._timestamp=(this._date.getTime()-this._date.getMilliseconds())/1000;if(this._offset===null){this._offset=this._timestamp-TIME_NOW}this._elements.each($.proxy(this._refreshElement,this))},_refreshElement:function(i,f){var n=$(f);if(!n.attr("title")){n.attr("title",n.text())}var d=n.data("timestamp")+this._offset;var b=n.data("date");var c=n.data("time");var o=n.data("offset");if(n.data("isFutureDate")){return}if(d>=this._timestamp||this._timestamp<(d+60)){n.text(WCF.Language.get("wcf.date.relative.now"))}else{if(this._timestamp<(d+3540)){var m=Math.max(Math.round((this._timestamp-d)/60),1);n.text(WCF.Language.get("wcf.date.relative.minutes",{minutes:m}))}else{if(this._timestamp<(d+86400)){var k=Math.round((this._timestamp-d)/3600);n.text(WCF.Language.get("wcf.date.relative.hours",{hours:k}))}else{if(this._timestamp<(d+518400)){var j=new Date(this._date.getFullYear(),this._date.getMonth(),this._date.getDate());var l=Math.ceil((j/1000-d)/86400);var g=WCF.Date.Util.getTimezoneDate((d*1000),o*1000);var h=g.getDay();var e=WCF.Language.get("__days")[h];n.text(WCF.Language.get("wcf.date.relative.pastDays",{days:l,day:e,time:c}))}else{var a=WCF.Language.get("wcf.date.shortDateTimeFormat");n.text(a.replace(/\%date\%/,b).replace(/\%time\%/,c))}}}}}});WCF.Dictionary=Class.extend({_variables:{},init:function(){this._variables={}},add:function(a,b){this._variables[a]=b},addObject:function(a){for(var b in a){this.add(b,a[b])}},addDictionary:function(a){a.each($.proxy(function(b){this.add(b.key,b.value)},this))},get:function(a){if(this.isset(a)){return this._variables[a]}return null},isset:function(a){return this._variables.hasOwnProperty(a)},remove:function(a){delete this._variables[a]},each:function(d){if(!$.isFunction(d)){return}for(var c in this._variables){var a=this._variables[c];var b={key:c,value:a};d(b)}},count:function(){return $.getLength(this._variables)},isEmpty:function(){return !this.count()}});WCF.Language={_variables:new WCF.Dictionary(),add:function(a,b){this._variables.add(a,b)},addObject:function(a){this._variables.addObject(a)},get:function(a,b){if(b==null){var b={}}var c=this._variables.get(a);if(c===null){return a}else{if(typeof c==="string"){this.add(a,new WCF.Template(c));return this.get(a,b)}else{if(typeof c.fetch==="function"){c=c.fetch(b)}}}return c}};WCF.MultipleLanguageInput=Class.extend({_availableLanguages:{},_button:null,_didInit:false,_element:null,_insertedDataAfterInit:false,_isEnabled:false,_forceSelection:false,_languageID:0,_list:null,_values:null,init:function(c,b,d,f){this._button=null;this._element=$("#"+$.wcfEscapeID(c));this._forceSelection=b;this._values=d;this._availableLanguages=f;if($.getLength(this._values)){for(var e in this._values){this._values[e]=WCF.String.unescapeHTML(this._values[e])}}this._languageID=LANGUAGE_ID;if(this._element.length==0){console.debug("[WCF.MultipleLanguageInput] element id '"+c+"' is unknown");return}var a=($.getLength(this._values)>0)?true:false;this._insertedDataAfterInit=a;this._prepareElement(a);this._element.parents("form").submit($.proxy(this._submit,this));this._didInit=true},_prepareElement:function(a){this._element.wrap('<div class="dropdown preInput" />');var c=this._element.parent();this._button=$('<p class="button dropdownToggle"><span>'+WCF.Language.get("wcf.global.button.disabledI18n")+"</span></p>").prependTo(c);this._list=$('<ul class="dropdownMenu"></ul>').insertAfter(this._button);if(this._button.nextAll("textarea").length){this._button.addClass("dropdownCaptionTextarea")}else{this._button.addClass("dropdownCaption")}for(var b in this._availableLanguages){$("<li><span>"+this._availableLanguages[b]+"</span></li>").data("languageID",b).click($.proxy(this._changeLanguage,this)).appendTo(this._list)}if(!this._forceSelection){$('<li class="dropdownDivider" />').appendTo(this._list);$("<li><span>"+WCF.Language.get("wcf.global.button.disabledI18n")+"</span></li>").click($.proxy(this._disable,this)).appendTo(this._list)}WCF.Dropdown.initDropdown(this._button,a);if(a||this._forceSelection){this._isEnabled=true;this._list.children("li").each($.proxy(function(d,f){var e=$(f);if(e.data("languageID")==this._languageID){e.trigger("click")}},this))}WCF.Dropdown.registerCallback(c.wcfIdentify(),$.proxy(this._handleAction,this))},_handleAction:function(a,b){if(b==="open"){this._enable()}else{this._closeSelection()}},_enable:function(a){if(!this._isEnabled){var b=(this._button.is("p"))?this._button.children("span:eq(0)"):this._button;b.addClass("active");this._isEnabled=true}if(this._list.is(":visible")){this._showSelection()}},_showSelection:function(){if(this._isEnabled){this._list.children("li").each($.proxy(function(b,d){var c=$(d);var a=c.data("languageID");if(a){if(this._values[a]&&this._values[a]!=""){c.removeClass("missingValue")}else{c.addClass("missingValue")}}},this))}},_closeSelection:function(){this._disable()},_changeLanguage:function(a){var b=$(a.currentTarget);this._insertedDataAfterInit=true;if(this._didInit){this._values[this._languageID]=this._element.val()}this._languageID=b.data("languageID");if(this._values[this._languageID]){this._element.val(this._values[this._languageID])}else{this._element.val("")}this._list.children("li").removeClass("active");b.addClass("active");this._button.children("span").addClass("active").text(this._availableLanguages[this._languageID]);if(this._didInit){this._element.blur().focus()}},_disable:function(a){if(a===undefined&&this._insertedDataAfterInit){a=null}if(this._forceSelection||!this._list||a===null){return}this._button.children("span").removeClass("active").text(WCF.Language.get("wcf.global.button.disabledI18n"));if(this._values[LANGUAGE_ID]){this._element.val(this._values[LANGUAGE_ID])}else{this._element.val()}if(a){this._list.children("li").removeClass("active");$(a.currentTarget).addClass("active")}this._element.blur().focus();this._insertedDataAfterInit=false;this._isEnabled=false;this._values={}},_submit:function(){if(!this._isEnabled){return 3735928559}if(this._languageID){this._values[this._languageID]=this._element.val()}var b=$(this._element.parents("form")[0]);var c=this._element.wcfIdentify();for(var a in this._availableLanguages){if(this._values[a]===undefined){this._values[a]=""}$('<input type="hidden" name="'+c+"_i18n["+a+']" value="'+WCF.String.escapeHTML(this._values[a])+'" />').appendTo(b)}this._element.removeAttr("name")}});WCF.Number={round:function(b,a){a=Math.pow(10,(a||0));return Math.round(b*a)/a}};WCF.String={addThousandsSeparator:function(a){return String(a).replace(/(^-?\d{1,3}|\d{3})(?=(?:\d{3})+(?:$|\.))/g,"$1"+WCF.Language.get("wcf.global.thousandsSeparator"))},escapeHTML:function(a){return String(a).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},escapeRegExp:function(a){return String(a).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")},formatNumeric:function(b,a){b=String(WCF.Number.round(b,a||2));var c=b.split(".");b=this.addThousandsSeparator(c[0]);if(c.length>1){b+=WCF.Language.get("wcf.global.decimalPoint")+c[1]}b=b.replace("-","\u2212");return b},lcfirst:function(a){return String(a).substring(0,1).toLowerCase()+a.substring(1)},ucfirst:function(a){return String(a).substring(0,1).toUpperCase()+a.substring(1)},unescapeHTML:function(a){return String(a).replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">")}};WCF.TabMenu={_containers:{},_didInit:false,init:function(){var d=$(".tabMenuContainer:not(.staticTabMenuContainer)");var c=this;d.each(function(f,e){var h=$(e);var g=h.wcfIdentify();if(c._containers[g]){return true}if(h.data("store")&&!$("#"+h.data("store")).length){$('<input type="hidden" name="'+h.data("store")+'" value="" id="'+h.data("store")+'" />').appendTo(h.parents("form").find(".formSubmit"))}c._containers[g]=h;h.wcfTabs({active:false,activate:function(j,i){var l=$(i.newPanel);var k=l.closest(".tabMenuContainer");var m=k;while(true){if(m.data("isParent")===undefined){break}if(m.data("isParent")){if(m.data("store")){$("#"+m.data("store")).val(l.attr("id"))}break}else{m=m.data("parent")}}if(WCF.TabMenu._didInit){if(l.data("inTabMenu")==undefined){l.data("inTabMenu",(l.parents(".dialogContainer").length))}if(!l.data("inTabMenu")){if(window.history){window.history.pushState(null,document.title,window.location.toString().replace(/#.+$/,"")+"#"+l.attr("id"))}else{location.hash="#"+l.attr("id")}}}}});h.data("isParent",(h.children(".tabMenuContainer, .tabMenuContent").length>0)).data("parent",false);if(!h.data("isParent")){if(h.parent().hasClass("tabMenuContainer")){h.data("parent",h.parent())}}});if(!this._didInit){this._selectActiveTab();$(window).bind("hashchange",$.proxy(this.selectTabs,this));if(!this._selectErroneousTab()){this.selectTabs()}if($.browser.mozilla&&location.hash){var a=$(location.hash);if(a.length&&a.hasClass("tabMenuContent")){var b=a.offset();window.scrollTo(b.left,b.top)}}}this._didInit=true},reload:function(){this._containers={};this.init()},_selectErroneousTab:function(){var d=false;for(var a in this._containers){var c=this._containers[a];if(c.find(".formError").length){d=true;if(!c.data("isParent")){while(true){if(c.data("parent")===false){break}c=c.data("parent").wcfTabs("selectTab",c.wcfIdentify())}return true}}}if(d){for(var a in this._containers){var c=this._containers[a];var b=c.find(".formError:eq(0)");if(b.length){c.wcfTabs("selectTab",b.parents(".tabMenuContent").wcfIdentify());while(true){if(c.data("parent")===false){break}c=c.data("parent").wcfTabs("selectTab",c.wcfIdentify())}return true}}}return false},_selectActiveTab:function(){for(var b in this._containers){var e=this._containers[b];if(e.data("active")){var a=e.data("active");var d=null;if(/-/.test(a)){var c=a.split("-");a=c[0];d=c[1]}e.find(".tabMenuContent").each(function(h,g){var f=$(g);if(f.wcfIdentify()==a){e.wcfTabs("select",h);if(d!==null){if(f.hasClass("tabMenuContainer")){f.wcfTabs("selectTab",e.data("active"))}else{e.wcfTabs("selectTab",e.data("active"))}}return false}})}}},selectTabs:function(){if(location.hash){var a=location.hash.substr(1);var b=$("#"+$.wcfEscapeID(a));if(b.length===1&&b.hasClass("ui-tabs-panel")){b=b.parent(".ui-tabs");if(b.length){b.wcfTabs("selectTab",a);if(b.hasClass("ui-tabs-panel")){a=b.wcfIdentify();b=b.parent(".ui-tabs");if(b.length){b.wcfTabs("selectTab",a)}}return true}}}return false}};WCF.Template=Class.extend({init:function(d){var f=new WCF.Dictionary();var a=0;d=d.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/(\r\n|\n|\r)/g,"\\n");d=d.replace(/\{literal\}(.*?)\{\/literal\}/g,$.proxy(function(e){var i="@@@@@@@@@@@"+Math.random()+"@@@@@@@@@@@";f.add(i,e.replace(/\{\/?literal\}/g,""));return i},this));d=d.replace(/\{\*.*?\*\}/g,"");var c=function(q){var l=q.split("");var i={};var k=true;var s="";var o="";var m=false;var n=false;var j=false;for(var p=0,e=l.length;p<e;p++){var r=l[p];if(k&&r!="="&&r!=" "){s+=r}else{if(k&&r=="="){k=false;n=false;m=false;j=false}else{if(!k&&!n&&!m&&r==" "){k=true;i[s]=o;o=s=""}else{if(!k&&n&&!j&&r=="'"){n=false;o+=r}else{if(!k&&!n&&!m&&r=="'"){n=true;o+=r}else{if(!k&&m&&!j&&r=='"'){m=false;o+=r}else{if(!k&&!n&&!m&&r=='"'){m=true;o+=r}else{if(!k&&(m||n)&&!j&&r=="\\"){j=true;o+=r}else{if(!k){j=false;o+=r}}}}}}}}}}i[s]=o;if(m||n||j){throw new Error('Syntax error in parameterList: "'+q+'"')}return i};var h=function(e){return e.replace(/\\n/g,"\n").replace(/\\\\/g,"\\").replace(/\\'/g,"'")};d=d.replace(/\{(\$[^\}]+?)\}/g,function(e,i){i=h(i.replace(/\$([^.\[\(\)\]\s]+)/g,"(v['$1'])"));return"' + WCF.String.escapeHTML("+i+") + '"}).replace(/\{#(\$[^\}]+?)\}/g,function(e,i){i=h(i.replace(/\$([^.\[\(\)\]\s]+)/g,"(v['$1'])"));return"' + WCF.String.formatNumeric("+i+") + '"}).replace(/\{@(\$[^\}]+?)\}/g,function(e,i){i=h(i.replace(/\$([^.\[\(\)\]\s]+)/g,"(v['$1'])"));return"' + "+i+" + '"}).replace(/\{lang\}(.+?)\{\/lang\}/g,function(e,i){return"' + WCF.Language.get('"+i+"', v) + '"}).replace(/\{include (.+?)\}/g,function(e,j){j=j.replace(/\\\\/g,"\\").replace(/\\'/g,"'");var i=c(j);if(typeof i.file==="undefined"){throw new Error("Missing file attribute in include-tag")}i.file=i.file.replace(/\$([^.\[\(\)\]\s]+)/g,"(v.$1)");return"' + "+i.file+".fetch(v) + '"}).replace(/\{if (.+?)\}/g,function(e,i){i=h(i.replace(/\$([^.\[\(\)\]\s]+)/g,"(v['$1'])"));return"';\nif ("+i+") {\n      $output += '"}).replace(/\{else ?if (.+?)\}/g,function(e,i){i=h(i.replace(/\$([^.\[\(\)\]\s]+)/g,"(v['$1'])"));return"';\n}\nelse if ("+i+") {\n        $output += '"}).replace(/\{implode (.+?)\}/g,function(e,j){a++;j=j.replace(/\\\\/g,"\\").replace(/\\'/g,"'");var i=c(j);if(typeof i.from==="undefined"){throw new Error("Missing from attribute in implode-tag")}if(typeof i.item==="undefined"){throw new Error("Missing item attribute in implode-tag")}if(typeof i.glue==="undefined"){i.glue="', '"}i.from=i.from.replace(/\$([^.\[\(\)\]\s]+)/g,"(v.$1)");return"';\nvar $implode_"+a+" = false;\nfor ($implodeKey_"+a+" in "+i.from+") {\n        v["+i.item+"] = "+i.from+"[$implodeKey_"+a+"];\n"+(typeof i.key!=="undefined"?"         v["+i.key+"] = $implodeKey_"+a+";\n":"")+"      if ($implode_"+a+") $output += "+i.glue+";\n    $implode_"+a+" = true;\n        $output += '"}).replace(/\{foreach (.+?)\}/g,function(e,j){a++;j=j.replace(/\\\\/g,"\\").replace(/\\'/g,"'");var i=c(j);if(typeof i.from==="undefined"){throw new Error("Missing from attribute in foreach-tag")}if(typeof i.item==="undefined"){throw new Error("Missing item attribute in foreach-tag")}i.from=i.from.replace(/\$([^.\[\(\)\]\s]+)/g,"(v.$1)");return"';\n$foreach_"+a+" = false;\nfor ($foreachKey_"+a+" in "+i.from+") {\n  $foreach_"+a+" = true;\n        break;\n}\nif ($foreach_"+a+") {\n      for ($foreachKey_"+a+" in "+i.from+") {\n               v["+i.item+"] = "+i.from+"[$foreachKey_"+a+"];\n"+(typeof i.key!=="undefined"?"         v["+i.key+"] = $foreachKey_"+a+";\n":"")+"              $output += '"}).replace(/\{foreachelse\}/g,"';\n        }\n}\nelse {\n  {\n             $output += '").replace(/\{\/foreach\}/g,"';\n   }\n}\n$output += '").replace(/\{else\}/g,"';\n}\nelse {\n       $output += '").replace(/\{\/(if|implode)\}/g,"';\n}\n$output += '");for(var b in WCF.Template.callbacks){d=WCF.Template.callbacks[b](d)}d=d.replace("{ldelim}","{").replace("{rdelim}","}");f.each(function(e){d=d.replace(e.key,e.value)});d="$output += '"+d+"';";try{this.fetch=new Function("v","v = window.$.extend({}, v, { __wcf: window.WCF, __window: window }); var $output = ''; "+d+" return $output;")}catch(g){console.debug("var $output = ''; "+d+" return $output;");throw g}},fetch:function(a){}});WCF.Template.callbacks=[];WCF.ToggleOptions=Class.extend({_element:null,_showItems:[],_hideItems:[],_callback:null,init:function(c,a,b,d){this._element=$("#"+c);this._showItems=a;this._hideItems=b;if(d!==undefined){this._callback=d}this._element.click($.proxy(this._toggle,this));this._toggle()},_toggle:function(){if(!this._element.prop("checked")){return}for(var c=0,b=this._showItems.length;c<b;c++){var a=this._showItems[c];$("#"+a).show()}for(var c=0,b=this._hideItems.length;c<b;c++){var a=this._hideItems[c];$("#"+a).hide()}if(this._callback!==null){this._callback()}}});WCF.Collapsible={};WCF.Collapsible.Simple={init:function(){$(".jsCollapsible").each($.proxy(function(a,b){this._initButton(b)},this))},_initButton:function(a){var c=$(a);var b=c.data("isOpen");if(!b){$("#"+c.data("collapsibleContainer")).hide()}c.click($.proxy(this._toggle,this))},_toggle:function(b){var d=$(b.currentTarget);var c=d.data("isOpen");var a=$("#"+$.wcfEscapeID(d.data("collapsibleContainer")));if(c){a.stop().wcfBlindOut("vertical",$.proxy(function(){this._toggleImage(d)},this));c=false}else{a.stop().wcfBlindIn("vertical",$.proxy(function(){this._toggleImage(d)},this));c=true}d.data("isOpen",c);b.stopPropagation();return false},_toggleImage:function(b){var a=b.find("span.icon");if(b.data("isOpen")){a.removeClass("icon-chevron-right").addClass("icon-chevron-down")}else{a.removeClass("icon-chevron-down").addClass("icon-chevron-right")}}};WCF.Collapsible.Remote=Class.extend({_className:"",_containers:{},_containerData:{},_proxy:null,init:function(a){this._className=a;this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)});this._init();WCF.DOMNodeInsertedHandler.addCallback("WCF.Collapsible.Remote",$.proxy(this._init,this))},_init:function(a){this._getContainers().each($.proxy(function(c,b){var e=$(b);var d=e.wcfIdentify();if(this._containers[d]===undefined){this._containers[d]=e;this._initContainer(d)}},this))},_initContainer:function(b){var a=this._getTarget(b);var c=this._getButtonContainer(b);var d=this._createButton(b,c);this._containerData[b]={button:d,buttonContainer:c,isOpen:this._containers[b].data("isOpen"),target:a};if(!this._containers[b].data("isOpen")){$("#"+b).addClass("jsCollapsed")}},_getContainers:function(){},_getTarget:function(a){},_getButtonContainer:function(a){},_createButton:function(a,b){var d=this._containers[a].data("isOpen");var c=$('<span class="collapsibleButton jsTooltip pointer icon icon16 icon-'+(d?"chevron-down":"chevron-right")+'" title="'+WCF.Language.get("wcf.global.button.collapsible")+'">').prependTo(b);c.data("containerID",a).click($.proxy(this._toggleContainer,this));return c},_toggleContainer:function(d){var f=$(d.currentTarget);var b=f.data("containerID");var e=this._containerData[b].isOpen;var a=(e)?"open":"close";var c=(e)?"close":"open";this._proxy.setOption("data",{actionName:"loadContainer",className:this._className,interfaceName:"wcf\\data\\ILoadableContainerAction",objectIDs:[this._getObjectID(b)],parameters:$.extend(true,{containerID:b,currentState:a,newState:c},this._getAdditionalParameters(b))});this._proxy.sendRequest();$("#"+b).toggleClass("jsCollapsed")},_exchangeIcon:function(b,a){a=a||"spinner";b.removeClass("icon-chevron-down icon-chevron-right icon-spinner").addClass("icon-"+a)},_getObjectID:function(a){return $("#"+a).data("objectID")},_getAdditionalParameters:function(a){return{}},_updateContent:function(a,b,c){this._containerData[a].target.html(b)},_success:function(d,e,c){if(!d.returnValues.containerID){return}var a=d.returnValues.containerID;if(!this._containers[a]){return}this._containerData[a].isOpen=(d.returnValues.isOpen)?true:false;var b=(d.returnValues.isOpen)?"open":"close";this._updateContent(a,$.trim(d.returnValues.content),b);this._exchangeIcon(this._containerData[a].button,(d.returnValues.isOpen?"chevron-down":"chevron-right"))}});WCF.Collapsible.SimpleRemote=WCF.Collapsible.Remote.extend({init:function(a){this._super(a);this._proxy=new WCF.Action.Proxy({showLoadingOverlay:false})},_initContainer:function(a){this._super(a);if(!this._containerData[a].isOpen){this._containerData[a].target.hide();this._exchangeIcon(this._containerData[a].button,"chevron-right")}},_toggleContainer:function(d){var f=$(d.currentTarget);var b=f.data("containerID");var e=this._containerData[b].isOpen;var a=(e)?"open":"close";var c=(e)?"close":"open";this._proxy.setOption("data",{actionName:"toggleContainer",className:this._className,interfaceName:"wcf\\data\\IToggleContainerAction",objectIDs:[this._getObjectID(b)],parameters:$.extend(true,{containerID:b,currentState:a,newState:c},this._getAdditionalParameters(b))});this._proxy.sendRequest();this._exchangeIcon(this._containerData[b].button,(c==="open"?"chevron-down":"chevron-right"));if(c==="open"){this._containerData[b].target.show()}else{this._containerData[b].target.hide()}$("#"+b).toggleClass("jsCollapsed");this._containerData[b].isOpen=(c==="open"?true:false)}});WCF.Collapsible.Sidebar=Class.extend({_button:null,_buttonHeight:0,_isOpen:false,_mainContainer:null,_proxy:null,_sidebar:null,_sidebarHeight:0,_sidebarName:"",_sidebarOffset:0,_userPanelHeight:0,init:function(){this._sidebar=$(".sidebar:eq(0)");if(!this._sidebar.length){console.debug("[WCF.Collapsible.Sidebar] Could not find sidebar, aborting.");return}this._isOpen=(this._sidebar.data("isOpen"))?true:false;this._sidebarName=this._sidebar.data("sidebarName");this._mainContainer=$("#main");this._sidebarHeight=this._sidebar.height();this._sidebarOffset=this._sidebar.getOffsets("offset").top;this._userPanelHeight=$("#topMenu").outerHeight();this._button=$('<a class="collapsibleButton jsTooltip" title="'+WCF.Language.get("wcf.global.button.collapsible")+'" />').prependTo(this._sidebar);this._button.wrap("<span />");this._button.click($.proxy(this._click,this));this._buttonHeight=this._button.outerHeight();WCF.DOMNodeInsertedHandler.execute();this._proxy=new WCF.Action.Proxy({showLoadingOverlay:false,url:"index.php/AJAXInvoke/?t="+SECURITY_TOKEN+SID_ARG_2ND});$(document).scroll($.proxy(this._scroll,this)).resize($.proxy(this._scroll,this));this._renderSidebar();this._scroll();var a=$(window);this._sidebar.on("webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd",function(){a.trigger("resize")})},_click:function(){this._isOpen=(this._isOpen)?false:true;this._proxy.setOption("data",{actionName:"toggle",className:"wcf\\system\\user\\collapsible\\content\\UserCollapsibleSidebarHandler",isOpen:(this._isOpen?1:0),sidebarName:this._sidebarName});this._proxy.sendRequest();this._renderSidebar()},_scroll:function(){var e=$(window);var b=e.scrollTop();var a=Math.max(b-this._sidebarOffset,0);var c=Math.min(this._mainContainer.height(),(e.height()+b)-this._sidebarOffset);var f=0;if(c===a){f=this._sidebarOffset+this._sidebarHeight}else{f=a+((c-a)/2);var d=Math.max(Math.min(a-this._userPanelHeight,this._userPanelHeight),0);if(d>0){f+=(d/2)}}if((c-a-this._userPanelHeight)<this._buttonHeight){f=f-this._buttonHeight}else{f=Math.max(f-(this._buttonHeight/2),0)}this._button.css({top:f+"px"})},_renderSidebar:function(){if(this._isOpen){$(".sidebarOrientationLeft, .sidebarOrientationRight").removeClass("sidebarCollapsed")}else{$(".sidebarOrientationLeft, .sidebarOrientationRight").addClass("sidebarCollapsed")}this._scroll();if($.browser.msie&&$.browser.version.indexOf("9")===0){$(window).trigger("resize")}}});WCF.User={userID:0,username:"",init:function(a,b){this.userID=a;this.username=b}};WCF.Effect={};WCF.Effect.Scroll=Class.extend({scrollTo:function(c,a,b){if(!c.length){return true}var d=c.getOffsets("offset").top;var f=$(document).height();var e=$(window).height();if(d>f-e){d=f-e;if(d<0){d=0}}if(b===true){$("html,body").scrollTop(d)}else{$("html,body").animate({scrollTop:d},400,function(h,i,g,k,j){return -k*((i=i/j-1)*i*i*i-1)+g})}return false}});WCF.Effect.SmoothScroll=WCF.Effect.Scroll.extend({init:function(){var a=this;$(document).on("click","a[href$=#top],a[href$=#bottom]",function(){var b=$(this.hash);a.scrollTo(b,true);return false})}});WCF.Effect.BalloonTooltip=Class.extend({_didInit:false,_tooltip:null,_viewportDimensions:{},init:function(){if(jQuery.browser.mobile){return}if(!this._didInit){this._tooltip=$('<div id="balloonTooltip" class="balloonTooltip"><span id="balloonTooltipText"></span><span class="pointer"><span></span></span></div>').appendTo($("body")).hide();this._updateViewportDimensions();$(window).resize($.proxy(this._updateViewportDimensions,this));WCF.DOMNodeInsertedHandler.addCallback("WCF.Effect.BalloonTooltip",$.proxy(this.init,this));this._didInit=true}$(".jsTooltip").each($.proxy(this._initTooltip,this))},_updateViewportDimensions:function(){this._viewportDimensions=$(document).getDimensions()},_initTooltip:function(b,c){var a=$(c);if(a.hasClass("jsTooltip")){a.removeClass("jsTooltip");var d=a.attr("title");if(d!==""){a.data("tooltip",d);a.removeAttr("title");a.hover($.proxy(this._mouseEnterHandler,this),$.proxy(this._mouseLeaveHandler,this));a.click($.proxy(this._mouseLeaveHandler,this))}}},_mouseEnterHandler:function(c){var e,d;var o=$(c.currentTarget);var k=o.attr("title");if(k&&k!==""){o.data("tooltip",k);o.removeAttr("title")}this._tooltip.css({top:"0px",left:"0px"});if(!o.data("tooltip")){this._tooltip.hide();return}this._tooltip.children("span:eq(0)").text(o.data("tooltip"));var m=this._tooltip.find(".pointer");this._tooltip.show();var b=m.outerWidth();this._tooltip.hide();var f=o.getOffsets("offset");var l=o.getDimensions("outer");var n=this._tooltip.getDimensions("outer");var a=this._tooltip.getDimensions("inner");var i=f.left+Math.ceil(l.width/2);var j=Math.ceil(n.width/2);var h="center";if((i-j)<5){h="left"}else{if((this._viewportDimensions.width-5)<(i+j)){h="right"}}if(f.top+l.height+n.height-$(document).scrollTop()<$(window).height()){e=f.top+l.height+7;this._tooltip.removeClass("inverse");m.css("top",-5)}else{e=f.top-n.height-7;this._tooltip.addClass("inverse");m.css("top",n.height)}var g=(WCF.Language.get("wcf.global.pageDirection")=="rtl"?"right":"left");switch(h){case"center":d=Math.round(f.left-j+(l.width/2));m.css(g,(a.width/2-b/2)+"px");break;case"left":d=f.left;if(g==="right"){m.css(g,(a.width-b-5)+"px")}else{m.css(g,"5px")}break;case"right":d=f.left+l.width-n.width;if(g==="right"){m.css(g,"5px")}else{m.css(g,(a.width-b-5)+"px")}break}this._tooltip.css({top:e+"px",left:d+"px"});this._tooltip.wcfFadeIn()},_mouseLeaveHandler:function(a){this._tooltip.stop().hide().css({opacity:1})}});WCF.CloseOverlayHandler={_callbacks:new WCF.Dictionary(),_isListening:false,addCallback:function(a,b){this._bindListener();if(this._callbacks.isset(a)){console.debug("[WCF.CloseOverlayHandler] identifier '"+a+"' is already bound to a callback");return false}this._callbacks.add(a,b)},removeCallback:function(a){if(this._callbacks.isset(a)){this._callbacks.remove(a)}},forceExecution:function(){this._executeCallbacks()},_bindListener:function(){if(this._isListening){return}$(document.body).click($.proxy(this._executeCallbacks,this));this._isListening=true},_executeCallbacks:function(a){this._callbacks.each(function(b){b.value()})}};WCF.DOMNodeInsertedHandler={_callbacks:[],_isExecuting:false,addCallback:function(a,b){this._callbacks.push(b)},_executeCallbacks:function(){if(this._isExecuting){return}this._isExecuting=true;for(var b=0,a=this._callbacks.length;b<a;b++){this._callbacks[b]()}this._isExecuting=false},execute:function(){this._executeCallbacks()}};WCF.DOMNodeRemovedHandler={_callbacks:new WCF.Dictionary(),_isExecuting:false,_isListening:false,addCallback:function(a,b){this._bindListener();if(this._callbacks.isset(a)){console.debug("[WCF.DOMNodeRemovedHandler] identifier '"+a+"' is already bound to a callback");return false}this._callbacks.add(a,b)},removeCallback:function(a){if(this._callbacks.isset(a)){this._callbacks.remove(a)}},_bindListener:function(){if(this._isListening){return}if(window.MutationObserver){var a=new MutationObserver((function(b){var c=false;b.forEach((function(d){if(d.removedNodes.length){c=true}}).bind(this));if(c){this._executeCallbacks({})}}).bind(this));a.observe(document.body,{childList:true,subtree:true})}else{$(document).bind("DOMNodeRemoved",$.proxy(this._executeCallbacks,this))}this._isListening=true},_executeCallbacks:function(a){if(this._isExecuting){return}this._isExecuting=true;this._callbacks.each(function(b){b.value(a)});this._isExecuting=false}};WCF.Option={};WCF.Option.Handler=Class.extend({init:function(){this._initOptions();WCF.DOMNodeInsertedHandler.addCallback("WCF.Option.Handler",$.proxy(this._initOptions,this))},_initOptions:function(){$(".jsEnablesOptions").each($.proxy(this._initOption,this))},_initOption:function(a,b){this._change(b);$(b).change($.proxy(this._handleChange,this))},_handleChange:function(a){this._change($(a.target))},_change:function(option){option=$(option);var $disableOptions=eval(option.data("disableOptions"));var $enableOptions=eval(option.data("enableOptions"));switch(option.getTagName()){case"input":switch(option.attr("type")){case"checkbox":this._execute(option.prop("checked"),$disableOptions,$enableOptions);break;case"radio":if(option.prop("checked")){this._execute(true,$disableOptions,$enableOptions)}break}break;case"select":var $value=option.val();var $disableOptions=$enableOptions=[];if(option.data("disableOptions").length>0){for(var $index in option.data("disableOptions")){var $item=option.data("disableOptions")[$index];if($item.value==$value){$disableOptions.push($item.option)}}}if(option.data("enableOptions").length>0){for(var $index in option.data("enableOptions")){var $item=option.data("enableOptions")[$index];if($item.value==$value){$enableOptions.push($item.option)}}}this._execute(true,$disableOptions,$enableOptions);break}},_execute:function(e,f,d){if(f.length>0){for(var g=0,b=f.length;g<b;g++){var a=f[g];if($.wcfIsset(a)){this._enableOption(a,!e)}else{var c=$("."+a+"Input");if(c.length){this._enableOptions(c.children("dd").find("input, select, textarea"),!e)}}}}if(d.length>0){for(var g=0,b=d.length;g<b;g++){var a=d[g];if($.wcfIsset(a)){this._enableOption(a,e)}else{var c=$("."+a+"Input");if(c.length){this._enableOptions(c.children("dd").find("input, select, textarea"),e)}}}}},_enableOption:function(b,a){this._enableOptionElement($("#"+$.wcfEscapeID(b)),a)},_enableOptionElement:function(c,b){c=$(c);var a=c.getTagName();if(a=="select"||(a=="input"&&(c.attr("type")=="checkbox"||c.attr("type")=="file"||c.attr("type")=="radio"))){if(b){c.enable()}else{c.disable()}}else{if(b){c.removeAttr("readonly")}else{c.attr("readonly",true)}}if(b){c.closest("dl").removeClass("disabled")}else{c.closest("dl").addClass("disabled")}},_enableOptions:function(a,b){for(var d=0,c=a.length;d<c;d++){this._enableOptionElement(a[d],b)}}});WCF.PageVisibilityHandler={_callbacks:new WCF.Dictionary(),_isListening:false,_hiddenFieldName:"",addCallback:function(a,b){this._bindListener();if(this._callbacks.isset(a)){console.debug("[WCF.PageVisibilityHandler] identifier '"+a+"' is already bound to a callback");return false}this._callbacks.add(a,b)},removeCallback:function(a){if(this._callbacks.isset(a)){this._callbacks.remove(a)}},_bindListener:function(){if(this._isListening){return}var a=null;if(typeof document.hidden!=="undefined"){this._hiddenFieldName="hidden";a="visibilitychange"}else{if(typeof document.mozHidden!=="undefined"){this._hiddenFieldName="mozHidden";a="mozvisibilitychange"}else{if(typeof document.msHidden!=="undefined"){this._hiddenFieldName="msHidden";a="msvisibilitychange"}else{if(typeof document.webkitHidden!=="undefined"){this._hiddenFieldName="webkitHidden";a="webkitvisibilitychange"}}}}if(a===null){console.debug("[WCF.PageVisibilityHandler] This browser does not support the page visibility API.")}else{$(document).on(a,$.proxy(this._executeCallbacks,this))}this._isListening=true},_executeCallbacks:function(b){if(this._isExecuting){return}this._isExecuting=true;var a=document[this._hiddenFieldName];this._callbacks.each(function(c){c.value(a)});this._isExecuting=false}};WCF.Table={};WCF.Table.EmptyTableHandler=Class.extend({_options:{},_rowClassName:"",init:function(b,c,a){this._rowClassName=c;this._tableContainer=b;this._options=$.extend(true,{emptyMessage:null,messageType:"info",refreshPage:false,updatePageNumber:false},a||{});WCF.DOMNodeRemovedHandler.addCallback("WCF.Table.EmptyTableHandler."+c,$.proxy(this._remove,this))},_remove:function(e){var d=$(e.target);if(d.hasClass(this._rowClassName)){var c=d.parents("tbody:eq(0)");if(c.children("tr").length==1){if(this._options.emptyMessage){this._tableContainer.replaceWith($("<p />").addClass(this._options.messageType).text(this._options.emptyMessage))}else{if(this._options.refreshPage){if(this._options.updatePageNumber){var a=window.location.href.match(/(\?|&)pageNo=(\d+)/g);if(a){var b=a[a.length-1].match(/\d+/g);if(this._options.updatePageNumber>0){b++}else{b--}window.location=window.location.href.replace(a[a.length-1],a[a.length-1][0]+"pageNo="+b)}}else{window.location.reload()}}else{this._tableContainer.remove()}}}}}});WCF.Search={};WCF.Search.Base=Class.extend({_callback:null,_caretAt:-1,_className:"",_commaSeperated:false,_delay:0,_excludedSearchValues:[],_itemCount:0,_itemIndex:-1,_list:null,_oldSearchString:[],_proxy:null,_searchInput:null,_triggerLength:3,_timer:null,init:function(b,e,a,c,d){if(e!==null&&e!==undefined&&!$.isFunction(e)){console.debug("[WCF.Search.Base] The given callback is invalid, aborting.");return}this._callback=(e)?e:null;this._caretAt=-1;this._delay=0;this._excludedSearchValues=[];if(a){this._excludedSearchValues=a}this._searchInput=$(b);if(!this._searchInput.length){console.debug("[WCF.Search.Base] Selector '"+b+"' for search input is invalid, aborting.");return}this._searchInput.keydown($.proxy(this._keyDown,this)).keyup($.proxy(this._keyUp,this)).wrap('<span class="dropdown" />');if($.browser.mozilla&&$.browser.touch){this._searchInput.on("input",$.proxy(this._keyUp,this))}this._list=$('<ul class="dropdownMenu" />').insertAfter(this._searchInput);this._commaSeperated=(c)?true:false;this._oldSearchString=[];this._itemCount=0;this._itemIndex=-1;this._proxy=new WCF.Action.Proxy({showLoadingOverlay:(d!==true?false:true),success:$.proxy(this._success,this),autoAbortPrevious:true});if(this._searchInput.is("input")){this._searchInput.attr("autocomplete","off")}this._searchInput.blur($.proxy(this._blur,this));WCF.Dropdown.initDropdownFragment(this._searchInput.parent(),this._list)},_blur:function(){var a=this;new WCF.PeriodicalExecuter(function(b){if(a._list.is(":visible")){a._clearList(false)}b.stop()},250)},_keyDown:function(a){if(a.which===$.ui.keyCode.ENTER){var b=this._searchInput.parents(".dropdown");if(b.data("disableAutoFocus")){if(this._itemIndex!==-1){a.preventDefault()}}else{if(b.data("preventSubmit")||this._itemIndex!==-1){a.preventDefault()}}}},_keyUp:function(d){switch(d.which){case 37:case 39:return;break;case 38:this._selectPreviousItem();return;break;case 40:this._selectNextItem();return;break;case 13:return this._selectElement(d);break}var b=this._getSearchString(d);if(b===""){this._clearList(false)}else{if(b.length>=this._triggerLength){var c={data:{excludedSearchValues:this._excludedSearchValues,searchString:b}};if(this._delay){if(this._timer!==null){this._timer.stop()}var a=this;this._timer=new WCF.PeriodicalExecuter(function(){a._queryServer(c);a._timer.stop();a._timer=null},this._delay)}else{this._queryServer(c)}}else{this._clearList(false)}}},_queryServer:function(a){this._searchInput.parents(".searchBar").addClass("loading");this._proxy.setOption("data",{actionName:"getSearchResultList",className:this._className,interfaceName:"wcf\\data\\ISearchAction",parameters:this._getParameters(a)});this._proxy.sendRequest()},setDelay:function(a){this._delay=a},_selectNextItem:function(){if(this._itemCount===0){return}this._itemIndex++;if(this._itemIndex===this._itemCount){this._itemIndex=0}this._highlightSelectedElement()},_selectPreviousItem:function(){if(this._itemCount===0){return}this._itemIndex--;if(this._itemIndex===-1){this._itemIndex=this._itemCount-1}this._highlightSelectedElement()},_highlightSelectedElement:function(){this._list.find("li").removeClass("dropdownNavigationItem");this._list.find("li:eq("+this._itemIndex+")").addClass("dropdownNavigationItem")},_selectElement:function(a){if(this._itemCount===0){return true}this._list.find("li.dropdownNavigationItem").trigger("click");return false},_getSearchString:function(d){var a=$.trim(this._searchInput.val());if(this._commaSeperated){var c=d.keyCode||d.which;if(c==$.ui.keyCode.COMMA){return""}var b=a.split(",");var e=b.length;for(var g=0;g<e;g++){b[g]=$.trim(b[g])}for(var g=0;g<e;g++){var f=b[g];if(this._oldSearchString[g]){if(f!=this._oldSearchString[g]){a=f;this._caretAt=g;break}}else{a=f;break}}this._oldSearchString=b}return a},_getParameters:function(a){return a},_success:function(d,f,c){this._clearList(false);this._searchInput.parents(".searchBar").removeClass("loading");if($.getLength(d.returnValues)){for(var e in d.returnValues){var a=d.returnValues[e];this._createListItem(a)}}else{if(!this._handleEmptyResult()){return}}WCF.CloseOverlayHandler.addCallback("WCF.Search.Base",$.proxy(function(){this._clearList()},this));var b=this._searchInput.parents(".dropdown").wcfIdentify();if(!WCF.Dropdown.getDropdownMenu(b).hasClass("dropdownOpen")){WCF.Dropdown.toggleDropdown(b)}this._itemIndex=-1;if(!WCF.Dropdown.getDropdown(b).data("disableAutoFocus")){this._selectNextItem()}},_handleEmptyResult:function(){return false},_createListItem:function(b){var a=$("<li><span>"+WCF.String.escapeHTML(b.label)+"</span></li>").appendTo(this._list);a.data("objectID",b.objectID).data("label",b.label).click($.proxy(this._executeCallback,this));this._itemCount++;return a},_executeCallback:function(d){var a=false;var c=$(d.currentTarget);if(this._commaSeperated){var b=c.data("label");this._oldSearchString[this._caretAt]=b;this._searchInput.val(this._oldSearchString.join(", "));if($.browser.webkit){this._searchInput.css({display:"block"})}var e=this._searchInput.val().toLowerCase().indexOf(b.toLowerCase())+b.length;this._searchInput.focus().setCaret(e)}else{if(this._callback===null){this._searchInput.val(c.data("label"))}else{a=(this._callback(c.data())===true)?true:false}}this._clearList(a)},_clearList:function(a){if(a&&!this._commaSeperated){this._searchInput.val("")}WCF.Dropdown.getDropdown(this._searchInput.parents(".dropdown").wcfIdentify()).removeClass("dropdownOpen");WCF.Dropdown.getDropdownMenu(this._searchInput.parents(".dropdown").wcfIdentify()).removeClass("dropdownOpen");this._list.end().empty();WCF.CloseOverlayHandler.removeCallback("WCF.Search.Base");this._itemCount=0;this._itemIndex=-1},addExcludedSearchValue:function(a){if(!WCF.inArray(a,this._excludedSearchValues)){this._excludedSearchValues.push(a)}},removeExcludedSearchValue:function(b){var a=$.inArray(b,this._excludedSearchValues);if(a!=-1){this._excludedSearchValues.splice(a,1)}}});WCF.Search.User=WCF.Search.Base.extend({_className:"wcf\\data\\user\\UserAction",_includeUserGroups:false,init:function(c,e,a,b,d){this._includeUserGroups=a;this._super(c,e,b,d)},_getParameters:function(a){a.data.includeUserGroups=this._includeUserGroups?1:0;return a},_createListItem:function(e){var d=this._super(e);var b=null;if(e.icon){b=$(e.icon)}else{if(this._includeUserGroups&&e.type==="group"){b=$('<span class="icon icon16 icon-group" />')}}if(b){var a=d.find("span").detach();var c=$("<div />").addClass("box16").appendTo(d);c.append(b);c.append($("<div />").append(a))}d.data("type",e.type);return d}});WCF.System={};WCF.System.Dependency={};WCF.System.Dependency.Manager={_callbacks:{},_loaded:[],_setupCallbacks:{},register:function(a,b){if(!$.isFunction(b)){console.debug("[WCF.System.Dependency.Manager] Callback for identifier '"+a+"' is invalid, aborting.");return}if(WCF.inArray(a,this._loaded)){setTimeout(function(){b()},1)}else{if(!this._callbacks[a]){this._callbacks[a]=[]}this._callbacks[a].push(b)}},setup:function(a,b){if(!$.isFunction(b)){console.debug("[WCF.System.Dependency.Manager] Setup callback for identifier '"+a+"' is invalid, aborting.");return}if(!this._setupCallbacks[a]){this._setupCallbacks[a]=[]}this._setupCallbacks[a].push(b)},invoke:function(a){if(this._setupCallbacks[a]){for(var c=0,b=this._setupCallbacks[a].length;c<b;c++){this._setupCallbacks[a][c]()}delete this._setupCallbacks[a]}this._loaded.push(a);if(this._callbacks[a]){for(var c=0,b=this._callbacks[a].length;c<b;c++){this._callbacks[a][c]()}delete this._callbacks[a]}}};WCF.System.FlexibleMenu={_containers:{},_containerIDs:[],_dropdowns:{},_dropdownMenus:{},_hasHiddenItems:{},_isWorking:false,_menuItems:{},init:function(){this.registerMenu("mainMenu");this.registerMenu($(".navigationHeader:eq(0)").wcfIdentify());this._registerTabMenus();$(window).resize($.proxy(this.rebuildAll,this));WCF.DOMNodeInsertedHandler.addCallback("WCF.System.FlexibleMenu",$.proxy(this._registerTabMenus,this))},_registerTabMenus:function(){$(".tabMenuContainer:not(.jsFlexibleMenuEnabled), .messageTabMenu:not(.jsFlexibleMenuEnabled)").each(function(a,b){var c=$(b).addClass("jsFlexibleMenuEnabled").children("nav");if(c.length&&c.find("> ul:eq(0) > li").length){WCF.System.FlexibleMenu.registerMenu(c.wcfIdentify())}})},registerMenu:function(a){var b=$("#"+a);if(!b.length){console.debug("[WCF.System.FlexibleMenu] Unable to find container identified by '"+a+"', aborting.");return}this._containerIDs.push(a);this._containers[a]=b;this._menuItems[a]=b.find("> ul:eq(0) > li");this._dropdowns[a]=$('<li class="dropdown jsFlexibleMenuDropdown"><a class="icon icon16 icon-list" /></li>').data("containerID",a).click($.proxy(this._click,this));this._dropdownMenus[a]=$('<ul class="dropdownMenu" />').appendTo(this._dropdowns[a]);this._hasHiddenItems[a]=false;this.rebuild(a);WCF.Dropdown.initDropdown(this._dropdowns[a].children("a"))},rebuildAll:function(){if(this._isWorking){return}this._isWorking=true;for(var b=0,a=this._containerIDs.length;b<a;b++){this.rebuild(this._containerIDs[b])}this._isWorking=false},rebuild:function(j){if(!this._containers[j]){console.debug("[WCF.System.FlexibleMenu] Cannot rebuild unknown container identified by '"+j+"'");return}var l=this._containers[j];var f=this._menuItems[j].hide();var a=f.filter(".active, .ui-state-active").show();if(!this._hasHiddenItems[j]){this._dropdowns[j].appendTo(l.children("ul:eq(0)"))}var g=this._dropdowns[j].outerWidth(true);var e=l.parent();var b=e.innerWidth();b-=e.cssAsNumber("padding-left")+e.cssAsNumber("padding-right");b-=l.cssAsNumber("margin-left")+l.cssAsNumber("margin-right");b-=l.cssAsNumber("padding-left")+l.cssAsNumber("padding-right");b-=l.children("ul:eq(0)").cssAsNumber("padding-left")+l.children("ul:eq(0)").cssAsNumber("padding-right");b-=a.outerWidth(true);this._hasHiddenItems[j]=false;for(var i=0;i<f.length;i++){var h=$(f[i]);if(h.hasClass("active")||h.hasClass("ui-state-active")){continue}var c=h.outerWidth(true);if(b-c>0){b-=c;h.show()}else{if(b<g){var d=h.prev();if(d.hasClass("active")||d.hasClass("ui-state-active")){d.prev().hide()}else{d.hide()}}this._hasHiddenItems[j]=true;break}}if(this._hasHiddenItems[j]){this._dropdownMenus[j].empty();var k=this;f.each($.proxy(function(m,n){if($(n).is(":visible")){return true}$("<li>"+$(n).html()+"</li>").data("index",m).appendTo(this._dropdownMenus[j]).click(function(p){var o=$(f[$(p.currentTarget).data("index")]);if(o[0].tagName==="A"){o.trigger("click")}else{if(o[0].tagName==="LI"){o.find("a").trigger("click")}}if(o.parent().hasClass("ui-tabs-nav")){p.preventDefault()}setTimeout(function(){k.rebuild(j)},50)})},this))}else{this._dropdowns[j].detach()}}};WCF.System.Mobile={};WCF.System.Mobile.UX={_enabled:false,_main:null,_sidebar:null,init:function(){this._enabled=false;this._main=$("#main");this._sidebar=this._main.find("> div > div > .sidebar");if($.browser.touch){$("html").addClass("touch")}enquire.register("screen and (max-width: 800px)",{match:$.proxy(this._enable,this),unmatch:$.proxy(this._disable,this),setup:$.proxy(this._setup,this),deferSetup:true});if($.browser.msie&&this._sidebar.width()>305){this._sidebar.css("display","none").css("display","")}},_setup:function(){this._initSidebarToggleButtons();this._initSearchBar();this._initButtonGroupNavigation();WCF.CloseOverlayHandler.addCallback("WCF.System.Mobile.UX",$.proxy(this._closeMenus,this));WCF.DOMNodeInsertedHandler.addCallback("WCF.System.Mobile.UX",$.proxy(this._initButtonGroupNavigation,this))},_enable:function(){this._enabled=true;if($.browser.msie){this._sidebar.css("display","none").css("display","")}},_disable:function(){this._enabled=false;if($.browser.msie){this._sidebar.css("display","none").css("display","")}},_initSidebarToggleButtons:function(){var c=this._main.hasClass("sidebarOrientationLeft");var b=this._main.hasClass("sidebarOrientationRight");if(c||b){var d="wcf.global.sidebar.show"+(c?"Left":"Right")+"Sidebar";if(d===WCF.Language.get(d)||WCF.Language.get(d)===""){d='<span class="icon icon16 icon-double-angle-'+(c?"left":"right")+'" />'}var e="wcf.global.sidebar.hide"+(c?"Left":"Right")+"Sidebar";if(e===WCF.Language.get(e)||WCF.Language.get(e)===""){e='<span class="icon icon16 icon-double-angle-'+(c?"right":"left")+'" />'}var a=this;$('<span class="button small mobileSidebarToggleButton">'+d+"</span>").appendTo($(".content")).click(function(){a._main.addClass("mobileShowSidebar")});$('<span class="button small mobileSidebarToggleButton">'+e+"</span>").appendTo($(".sidebar")).click(function(){a._main.removeClass("mobileShowSidebar")})}},_initSearchBar:function(){var b=$(".searchBar:eq(0)");var a=this;b.click(function(){if(a._enabled){b.addClass("searchBarOpen")}});this._main.click(function(){b.removeClass("searchBarOpen")})},_initButtonGroupNavigation:function(){$(".buttonGroupNavigation:not(.jsMobileButtonGroupNavigation)").each(function(b,a){var d=$(a).addClass("jsMobileButtonGroupNavigation");var c=$('<a class="dropdownLabel"><span class="icon icon24 icon-list" /></a>').prependTo(d);c.click(function(){c.next().toggleClass("open");return false})})},_closeMenus:function(){$(".jsMobileButtonGroupNavigation > ul.open").removeClass("open")}};WCF.System.ObjectStore={_objects:{},add:function(a,b){if(this._objects[a]===undefined){this._objects[a]=[]}this._objects[a].push(b)},invoke:function(a,c){if(this._objects[a]){for(var b=0;b<this._objects[a].length;b++){c(this._objects[a][b])}}}};WCF.System.Captcha={_captchas:{},addCallback:function(a,b){if(!$.isFunction(b)){console.debug("[WCF.System.Captcha] Given callback is no function");return}this._captchas[a]=b},getData:function(a){if(this._captchas[a]===undefined){console.debug('[WCF.System.Captcha] Unknow captcha id "'+a+'"');return}return this._captchas[a]()},removeCallback:function(a){delete this._captchas[a]}};WCF.System.Page={};WCF.System.Page.Multiple=Class.extend({_cache:{},_options:{},_pageNo:1,_pages:0,_previousPageNo:0,init:function(a){this._options=$.extend({container:null,pagination:null,loadItems:null},a);this._cache={};this._pageNo=1;this._pages=0;this._previousPageNo=0;if(this._pagination.data("pages")){this._pagination.wcfPages({maxPage:this._pagination.data("pages")}).on("wcfpagesswitched",$.proxy(this._showPage,this))}},_showPage:function(a,b){if(b&&b.activePage){if(!b.template){this._previousPageNo=this._pageNo}this._pageNo=b.activePage}if(this._cache[this._pageNo]||(b&&b.template)){this._cache[this._previousPageNo]=this._list.children().detach();if(b&&b.template){this._list.html(b.template)}else{this._list.append(this._cache[this._pageNo])}}else{this._options.loadItems()}},showPage:function(a,b){this._showPage(null,{activePage:a,template:b})},getPageNo:function(){return this._pageNo}});WCF.System.Notification=Class.extend({_callback:null,_cssClassNames:"",_message:"",_overlay:null,_timer:null,init:function(a,b){this._cssClassNames=b||"success";this._message=a||WCF.Language.get("wcf.global.success");this._overlay=$("#systemNotification");this._timer=null;if(!this._overlay.length){this._overlay=$('<div id="systemNotification"><p></p></div>').hide().appendTo(document.body);this._overlay.children("p").click((function(){this._hide()}).bind(this))}},show:function(d,b,a,c){b=parseInt(b);if(!b){b=2000}if(d&&$.isFunction(d)){this._callback=d}this._overlay.children("p").html((a||this._message));this._overlay.children("p").removeClass().addClass((c||this._cssClassNames));this._timer=new WCF.PeriodicalExecuter($.proxy(this._hide,this),b);this._overlay.wcfFadeIn(undefined,300)},_hide:function(a){a=(a)?a:this._timer;if(this._callback!==null){this._callback()}this._overlay.wcfFadeOut(undefined,300);a.stop();a=null}});WCF.System.Confirmation={_callback:null,_dialog:null,_parameters:null,_visible:false,_confirmationButton:null,show:function(c,e,b,a){if(this._visible){console.debug("[WCF.System.Confirmation] Confirmation dialog is already open, refusing action.");return}if(!$.isFunction(e)){console.debug("[WCF.System.Confirmation] Given callback is invalid, aborting.");return}this._callback=e;this._parameters=b;var d=true;if(this._dialog===null){this._createDialog();d=false}this._dialog.find("#wcfSystemConfirmationContent").empty().hide();if(a&&a.length){a.appendTo(this._dialog.find("#wcfSystemConfirmationContent").show())}this._dialog.find("p").text(c);this._dialog.wcfDialog({onClose:$.proxy(this._close,this),onShow:$.proxy(this._show,this),title:WCF.Language.get("wcf.global.confirmation.title")});if(d){this._dialog.wcfDialog("render")}this._confirmationButton.focus();this._visible=true},_createDialog:function(){this._dialog=$('<div id="wcfSystemConfirmation" class="systemConfirmation"><p /><div id="wcfSystemConfirmationContent" /></div>').hide().appendTo(document.body);var a=$('<div class="formSubmit" />').appendTo(this._dialog);this._confirmationButton=$('<button class="buttonPrimary">'+WCF.Language.get("wcf.global.confirmation.confirm")+"</button>").data("action","confirm").click($.proxy(this._click,this)).appendTo(a);$("<button>"+WCF.Language.get("wcf.global.confirmation.cancel")+"</button>").data("action","cancel").click($.proxy(this._click,this)).appendTo(a)},_click:function(a){this._notify($(a.currentTarget).data("action"))},_close:function(){if(this._visible){this._notify("cancel")}},_notify:function(a){this._visible=false;this._dialog.wcfDialog("close");this._confirmationButton.blur();this._callback(a,this._parameters)},_show:function(){this._dialog.find("button.buttonPrimary").blur().focus()}};WCF.System.DisableScrolling={_depth:0,_oldOverflow:null,disable:function(){if($.browser.touch){return}if(this._depth===0){this._oldOverflow=$(document.body).css("overflow");$(document.body).css("overflow","hidden")}this._depth++},enable:function(){if(this._depth===0){return}this._depth--;if(this._depth===0){$(document.body).css("overflow",this._oldOverflow)}}};WCF.System.DisableZoom={_depth:0,_oldViewportSettings:null,disable:function(){if(this._depth===0){var a=$("meta[name=viewport]");this._oldViewportSettings=a.attr("content");a.attr("content",this._oldViewportSettings+",maximum-scale=1")}this._depth++},enable:function(){if(this._depth===0){return}this._depth--;if(this._depth===0){$("meta[name=viewport]").attr("content",this._oldViewportSettings)}}};WCF.System.Fullscreen={enterFullscreen:function(a){if(a.requestFullscreen){a.requestFullscreen()}else{if(a.msRequestFullscreen){a.msRequestFullscreen()}else{if(a.mozRequestFullScreen){a.mozRequestFullScreen()}else{if(a.webkitRequestFullscreen){a.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}}}}},toggleFullscreen:function(a){if(this.getFullscreenElement()===null){this.enterFullscreen(a)}else{this.exitFullscreen()}},getFullscreenElement:function(){if(document.fullscreenElement){return document.fullscreenElement}else{if(document.mozFullScreenElement){return document.mozFullScreenElement}else{if(document.webkitFullscreenElement){return document.webkitFullscreenElement}else{if(document.msFullscreenElement){return document.msFullscreenElement}}}}return null},exitFullscreen:function(){if(document.exitFullscreen){document.exitFullscreen()}else{if(document.msExitFullscreen){document.msExitFullscreen()}else{if(document.mozCancelFullScreen){document.mozCancelFullScreen()}else{if(document.webkitExitFullscreen){document.webkitExitFullscreen()}}}}},isSupported:function(){if(document.documentElement.requestFullscreen||document.documentElement.msRequestFullscreen||document.documentElement.mozRequestFullScreen||document.documentElement.webkitRequestFullscreen){return true}return false}};WCF.System.PageNavigation={_button:null,_description:null,_dialog:null,_elementID:"",_elements:{},_pageNo:null,init:function(a,c){var b=$(a);if(!b.length){return}c=c||null;if(c!==null&&!$.isFunction(c)){console.debug("[WCF.System.PageNavigation] Callback for selector '"+a+"' is invalid, aborting.");return}this._initElements(b,c)},_initElements:function(b,c){var a=this;b.each(function(e,f){var d=$(f);var g=d.wcfIdentify();if(a._elements[g]===undefined){a._elements[g]=d;d.find("li.jumpTo").data("elementID",g).click($.proxy(a._click,a))}}).data("callback",c)},_click:function(b){this._elementID=$(b.currentTarget).data("elementID");if(this._dialog===null){this._dialog=$('<div id="pageNavigationOverlay" />').hide().appendTo(document.body);var c=$("<fieldset><legend>"+WCF.Language.get("wcf.global.page.jumpTo")+"</legend></fieldset>").appendTo(this._dialog);$('<dl><dt><label for="jsPageNavigationPageNo">'+WCF.Language.get("wcf.global.page.jumpTo")+"</label></dt><dd></dd></dl>").appendTo(c);this._pageNo=$('<input type="number" id="jsPageNavigationPageNo" value="1" min="1" max="1" class="tiny" />').keyup($.proxy(this._keyUp,this)).appendTo(c.find("dd"));this._description=$("<small></small>").insertAfter(this._pageNo);var a=$('<div class="formSubmit" />').appendTo(this._dialog);this._button=$('<button class="buttonPrimary">'+WCF.Language.get("wcf.global.button.submit")+"</button>").click($.proxy(this._submit,this)).appendTo(a)}this._button.enable();this._description.html(WCF.Language.get("wcf.global.page.jumpTo.description").replace(/#pages#/,this._elements[this._elementID].data("pages")));this._pageNo.val(this._elements[this._elementID].data("pages")).attr("max",this._elements[this._elementID].data("pages"));this._dialog.wcfDialog({title:WCF.Language.get("wcf.global.page.pageNavigation")})},_keyUp:function(b){if(b.which==$.ui.keyCode.ENTER&&!this._button.prop("disabled")){this._submit();return}var a=parseInt(this._pageNo.val())||0;if(a<1||a>this._pageNo.attr("max")){this._button.disable()}else{this._button.enable()}},_submit:function(){var b=this._elements[this._elementID];if(b.data("callback")===null){var a=b.data("link").replace(/pageNo=%d/,"pageNo="+this._pageNo.val());window.location=a}else{b.data("callback")(this._pageNo.val());this._dialog.wcfDialog("close")}}};WCF.System.KeepAlive=Class.extend({init:function(a){new WCF.PeriodicalExecuter(function(b){new WCF.Action.Proxy({autoSend:true,data:{actionName:"keepAlive",className:"wcf\\data\\session\\SessionAction"},failure:function(){b.stop()},showLoadingOverlay:false,success:function(c){WCF.System.PushNotification.executeCallbacks(c)},suppressErrors:true})},(a*1000))}});WCF.System.PushNotification={_callbacks:{},addCallback:function(a,b){if(this._callbacks[a]===undefined){this._callbacks[a]=[]}this._callbacks[a].push(b)},executeCallbacks:function(b){for(var a in b.returnValues){if(this._callbacks[a]!==undefined){for(var c=0;c<this._callbacks[a].length;c++){this._callbacks[a][c](b.returnValues[a])}}}}};WCF.System.Event={_listeners:{},addListener:function(b,d,c){if(typeof this._listeners[b]==="undefined"){this._listeners[b]={}}if(typeof this._listeners[b][d]==="undefined"){this._listeners[b][d]=[]}var a=WCF.getUUID();this._listeners[b][d].push({callback:c,uuid:a});return a},removeListener:function(a,c,b){if(this._listeners[a]&&this._listeners[a][c]){for(var d=0;d<this._listeners[a][c].length;d++){if(this._listeners[a][c][d].uuid==b){this._listeners[a][c].splice(d,1);return true}}}return false},removeAllListeners:function(a,b){if(this._listeners[a]&&this._listeners[a][b]){delete this._listeners[a][b];return true}return false},fireEvent:function(a,c,b){b=b||{};if(this._listeners[a]&&this._listeners[a][c]){for(var d=0;d<this._listeners[a][c].length;d++){this._listeners[a][c][d].callback(b)}}}};WCF.System.Worker=Class.extend({_aborted:false,_actionName:"",_callback:null,_className:"",_dialog:null,_proxy:null,_title:"",init:function(a,b,d,c,e){this._aborted=false;this._actionName=a;this._callback=e||null;this._className=b;this._dialog=null;this._proxy=new WCF.Action.Proxy({autoSend:true,data:{actionName:this._actionName,className:this._className,parameters:c||{}},showLoadingOverlay:false,success:$.proxy(this._success,this)});this._title=d},_success:function(c){if(this._dialog===null){this._dialog=$("<div />").hide().appendTo(document.body);this._dialog.wcfDialog({closeConfirmMessage:WCF.Language.get("wcf.worker.abort.confirmMessage"),closeViaModal:false,onClose:$.proxy(function(){this._aborted=true;this._proxy.abortPrevious();window.location.reload()},this),title:this._title})}if(this._aborted){return}if(c.returnValues.template){this._dialog.html(c.returnValues.template)}this._dialog.find("progress").attr("value",c.returnValues.progress).text(c.returnValues.progress+"%").next("span").text(c.returnValues.progress+"%");if(c.returnValues.progress<100){var b=c.returnValues.parameters||{};b.loopCount=c.returnValues.loopCount;this._proxy.setOption("data",{actionName:this._actionName,className:this._className,parameters:b});this._proxy.sendRequest()}else{if(this._callback!==null){this._callback(this,c)}else{this._dialog.find(".fa-spinner").removeClass("fa-spinner").addClass("fa-check green");this._dialog.find(".boxHeadline h1").text(WCF.Language.get("wcf.global.worker.completed"));var a=$('<div class="formSubmit" />').appendTo(this._dialog);$('<button class="buttonPrimary">'+WCF.Language.get("wcf.global.button.next")+"</button>").appendTo(a).focus().click(function(){if(c.returnValues.redirectURL){window.location=c.returnValues.redirectURL}else{window.location.reload()}});this._dialog.wcfDialog("render")}}}});WCF.InlineEditor=Class.extend({_callbacks:[],_dropdowns:{},_elements:{},_notification:null,_options:[],_proxy:null,_triggerElements:{},_updateData:[],init:function(d){var c=$(d);if(!c.length){return}this._setOptions();var b="";for(var f=0,e=this._options.length;f<e;f++){if(this._options[f].isQuickOption){b=this._options[f].optionName;break}}var a=this;c.each(function(i,j){var h=$(j);var k=h.wcfIdentify();var g=a._getTriggerElement(h);if(g===null||g.length!==1){return}g.click($.proxy(a._show,a)).data("elementID",k);if(b){g.disableSelection().data("optionName",b).dblclick($.proxy(a._click,a))}a._elements[k]=h});this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)});WCF.CloseOverlayHandler.addCallback("WCF.InlineEditor",$.proxy(this._closeAll,this));this._notification=new WCF.System.Notification(WCF.Language.get("wcf.global.success"),"success")},_closeAll:function(){for(var a in this._elements){this._hide(a)}},_setOptions:function(){this._options=[]},registerCallback:function(a){if($.isFunction(a)){this._callbacks.push(a)}},_getTriggerElement:function(a){return null},_show:function(b){b.preventDefault();var g=$(b.currentTarget).data("elementID");var h=null;if(!this._dropdowns[g]){this._triggerElements[g]=h=this._getTriggerElement(this._elements[g]).addClass("dropdownToggle").wrap('<span class="dropdown" />');this._dropdowns[g]=$('<ul class="dropdownMenu" />').insertAfter(h)}this._dropdowns[g].empty();var c=false;var d="";for(var k=0,i=this._options.length;k<i;k++){var a=this._options[k];if(a.optionName==="divider"){if(d!==""&&d!=="divider"){$('<li class="dropdownDivider" />').appendTo(this._dropdowns[g]);d=a.optionName}}else{if(this._validate(g,a.optionName)||this._validateCallbacks(g,a.optionName)){var f=$("<li><span>"+a.label+"</span></li>").appendTo(this._dropdowns[g]);f.data("elementID",g).data("optionName",a.optionName).data("isQuickOption",(a.isQuickOption?true:false)).click($.proxy(this._click,this));c=true;d=a.optionName}}}if(c){var l=this._dropdowns[g].children().last();if(l.hasClass("dropdownDivider")){l.remove()}var j=null;var e=0;this._dropdowns[g].children().each(function(m,o){var n=$(o);if(!n.hasClass("dropdownDivider")){if(n.data("isQuickOption")){j=n}else{e++}}});if(!e){j.trigger("click");if(this._triggerElements[g]){WCF.Dropdown.close(this._triggerElements[g].parents(".dropdown").wcfIdentify())}return false}}if(h!==null){WCF.Dropdown.initDropdown(h,true)}return false},_validate:function(a,b){return false},_validateCallbacks:function(a,b){var c=this._callbacks.length;if(c){for(var d=0;d<c;d++){if(this._callbacks[d].validate(this._elements[a],b)){return true}}}return false},_success:function(b,d,a){var c=this._updateData.length;if(!c){return}this._updateState(b);this._updateData=[]},_updateState:function(a){},_click:function(c){var b=$(c.currentTarget);var d=b.data("elementID");var a=b.data("optionName");if(!this._execute(d,a)){this._executeCallback(d,a)}this._hide(d)},_execute:function(a,b){return false},_executeCallback:function(a,b){var c=this._callbacks.length;if(c){for(var d=0;d<c;d++){if(this._callbacks[d].execute(this._elements[a],b)){return true}}}return false},_hide:function(a){if(this._dropdowns[a]){this._dropdowns[a].empty().removeClass("dropdownOpen")}}});WCF.Upload=Class.extend({_name:"__files[]",_buttonSelector:null,_fileListSelector:null,_fileUpload:null,_className:"",_iframe:null,_internalFileID:0,_options:{},_uploadMatrix:[],_supportsAJAXUpload:true,_overlay:null,init:function(c,e,d,b){this._buttonSelector=c;this._fileListSelector=e;this._className=d;this._internalFileID=0;this._options=$.extend(true,{action:"upload",multiple:false,url:"index.php/AJAXUpload/?t="+SECURITY_TOKEN+SID_ARG_2ND},b||{});this._options.url=WCF.convertLegacyURL(this._options.url);var a=new XMLHttpRequest();this._supportsAJAXUpload=(a&&("upload" in a)&&("onprogress" in a.upload));this._createButton()},_createButton:function(){if(this._supportsAJAXUpload){this._fileUpload=$('<input type="file" name="'+this._name+'" '+(this._options.multiple?'multiple="true" ':"")+"/>");this._fileUpload.change($.proxy(this._upload,this));var a=$('<p class="button uploadButton"><span>'+WCF.Language.get("wcf.global.button.upload")+"</span></p>");a.prepend(this._fileUpload)}else{var a=$('<p class="button uploadFallbackButton"><span>'+WCF.Language.get("wcf.global.button.upload")+"</span></p>");a.click($.proxy(this._showOverlay,this))}this._insertButton(a)},_insertButton:function(a){this._buttonSelector.append(a)},_removeButton:function(){var a=".uploadButton";if(!this._supportsAJAXUpload){a=".uploadFallbackButton"}this._buttonSelector.find(a).remove()},_upload:function(c,e,b){var j=null;var a=[];if(e){a.push(e)}else{if(b){var g="";switch(b.type){case"image/png":g=".png";break;case"image/jpeg":g=".jpg";break;case"image/gif":g=".gif";break}a.push({name:"pasted-from-clipboard"+g})}else{a=this._fileUpload.prop("files")}}if(a.length){var m=new FormData();j=this._createUploadMatrix(a);if(!this._uploadMatrix[j].length){return null}for(var i=0,f=a.length;i<f;i++){if(this._uploadMatrix[j][i]){var h=this._uploadMatrix[j][i].data("internalFileID");if(b){m.append("__files["+h+"]",b,a[i].name)}else{m.append("__files["+h+"]",a[i])}}}m.append("actionName",this._options.action);m.append("className",this._className);var d=this._getParameters();for(var l in d){m.append("parameters["+l+"]",d[l])}var k=this;$.ajax({type:"POST",url:this._options.url,enctype:"multipart/form-data",data:m,contentType:false,processData:false,success:function(o,p,n){k._success(j,o)},error:$.proxy(this._error,this),xhr:function(){var n=$.ajaxSettings.xhr();if(n){n.upload.addEventListener("progress",function(o){k._progress(j,o)},false)}return n}})}return j},_createUploadMatrix:function(b){if(b.length){var c=this._uploadMatrix.length;this._uploadMatrix[c]=[];for(var f=0,d=b.length;f<d;f++){var a=b[f];var e=this._initFile(a);if(!e.hasClass("uploadFailed")){e.data("filename",a.name).data("internalFileID",this._internalFileID++);this._uploadMatrix[c][f]=e}}return c}return null},_success:function(b,a){},_error:function(a,c,b){},_progress:function(c,a){var b=Math.round(a.loaded*100/a.total);for(var d in this._uploadMatrix[c]){this._uploadMatrix[c][d].find("progress").attr("value",b)}},_getParameters:function(){return{}},_initFile:function(a){return $("<li>"+a.name+" ("+a.size+')<progress max="100" /></li>').appendTo(this._fileListSelector)},_showOverlay:function(){if(this._iframe===null){this._iframe=$('<iframe name="__fileUploadIFrame" />').hide().appendTo(document.body)}if(!this._overlay){this._overlay=$('<div><form enctype="multipart/form-data" method="post" action="'+this._options.url+'" target="__fileUploadIFrame" /></div>').hide().appendTo(document.body);var a=this._overlay.find("form");$('<dl class="wide"><dd><input type="file" id="__fileUpload" name="'+this._name+'" '+(this._options.multiple?'multiple="true" ':"")+"/></dd></dl>").appendTo(a);$('<div class="formSubmit"><input type="submit" value="Upload" accesskey="s" /></div></form>').appendTo(a);$('<input type="hidden" name="isFallback" value="1" />').appendTo(a);$('<input type="hidden" name="actionName" value="'+this._options.action+'" />').appendTo(a);$('<input type="hidden" name="className" value="'+this._className+'" />').appendTo(a);var b=this._getParameters();for(var c in b){$('<input type="hidden" name="'+c+'" value="'+b[c]+'" />').appendTo(a)}a.submit($.proxy(function(){var d={name:this._getFilename(),size:""};var f=this._createUploadMatrix([d]);var e=this;this._iframe.data("loading",true).off("load").load(function(){e._evaluateResponse(f)});this._overlay.wcfDialog("close")},this))}this._overlay.wcfDialog({title:WCF.Language.get("wcf.global.button.upload")})},_evaluateResponse:function(b){var a=$.parseJSON(this._iframe.contents().find("pre").html());this._success(b,a)},_getFilename:function(){return $("#__fileUpload").val().split("\\").pop()}});WCF.Upload.Parallel=WCF.Upload.extend({init:function(b,d,c,a){a=$.extend(true,a||{},{multiple:true});this._super(b,d,c,a)},_upload:function(){var b=this._fileUpload.prop("files");for(var h=0,e=b.length;h<e;h++){var a=b[h];var c=new FormData();var g=this._createUploadMatrix(a);if(!this._uploadMatrix[g].length){continue}c.append("__files["+g+"]",a);c.append("actionName",this._options.action);c.append("className",this._className);var d=this._getParameters();for(var f in d){c.append("parameters["+f+"]",d[f])}this._sendRequest(g,c)}},_sendRequest:function(c,b){var a=this;$.ajax({type:"POST",url:this._options.url,enctype:"multipart/form-data",data:b,contentType:false,processData:false,success:function(e,f,d){a._success(c,e)},error:$.proxy(this._error,this),xhr:function(){var d=$.ajaxSettings.xhr();if(d){d.upload.addEventListener("progress",function(e){a._progress(c,e)},false)}return d}})},_createUploadMatrix:function(a){var b=this._initFile(a);if(!b.hasClass("uploadFailed")){b.data("filename",a.name).data("internalFileID",this._internalFileID);this._uploadMatrix[this._internalFileID++]=b;return this._internalFileID-1}return null},_success:function(b,a){},_progress:function(b,a){var c=Math.round(a.loaded*100/a.total);this._uploadMatrix[b].find("progress").attr("value",c)},_showOverlay:function(){if(this._iframe===null){this._iframe=$('<iframe name="__fileUploadIFrame" />').hide().appendTo(document.body)}if(!this._overlay){this._overlay=$('<div><form enctype="multipart/form-data" method="post" action="'+this._options.url+'" target="__fileUploadIFrame" /></div>').hide().appendTo(document.body);var a=this._overlay.find("form");$('<dl class="wide"><dd><input type="file" id="__fileUpload" name="'+this._name+'" '+(this._options.multiple?'multiple="true" ':"")+"/></dd></dl>").appendTo(a);$('<div class="formSubmit"><input type="submit" value="Upload" accesskey="s" /></div></form>').appendTo(a);$('<input type="hidden" name="isFallback" value="1" />').appendTo(a);$('<input type="hidden" name="actionName" value="'+this._options.action+'" />').appendTo(a);$('<input type="hidden" name="className" value="'+this._className+'" />').appendTo(a);var b=this._getParameters();for(var c in b){$('<input type="hidden" name="'+c+'" value="'+b[c]+'" />').appendTo(a)}a.submit($.proxy(function(){var d={name:this._getFilename(),size:""};var f=this._createUploadMatrix(d);var e=this;this._iframe.data("loading",true).off("load").load(function(){e._evaluateResponse(f)});this._overlay.wcfDialog("close")},this))}this._overlay.wcfDialog({title:WCF.Language.get("wcf.global.button.upload")})},_evaluateResponse:function(b){var a=$.parseJSON(this._iframe.contents().find("pre").html());this._success(b,a)}});WCF.Sortable={};WCF.Sortable.List=Class.extend({_additionalParameters:{},_className:"",_containerID:"",_container:null,_notification:null,_offset:0,_options:{},_proxy:null,_structure:{},init:function(a,f,g,d,e,c){this._additionalParameters=c||{};this._containerID=$.wcfEscapeID(a);this._container=$("#"+this._containerID);this._className=f;this._offset=(g)?g:0;this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)});this._structure={};this._options=$.extend(true,{axis:"y",connectWith:"#"+this._containerID+" .sortableList",disableNesting:"sortableNoNesting",doNotClear:true,errorClass:"sortableInvalidTarget",forcePlaceholderSize:true,helper:"clone",items:"li:not(.sortableNoSorting)",opacity:0.6,placeholder:"sortablePlaceholder",tolerance:"pointer",toleranceElement:"> span"},d||{});if(e){$("#"+this._containerID+" .sortableList").sortable(this._options)}else{$("#"+this._containerID+" > .sortableList").nestedSortable(this._options)}if(this._className){var b=this._container.find(".formSubmit");if(!b.length){b=this._container.next(".formSubmit");if(!b.length){console.debug("[WCF.Sortable.Simple] Unable to find form submit for saving, aborting.");return}}b.children('button[data-type="submit"]').click($.proxy(this._submit,this))}},_submit:function(){this._structure={};this._container.find(".sortableList").each($.proxy(function(c,e){var b=$(e);var d=b.data("objectID");if(d!==undefined){b.children(this._options.items).each($.proxy(function(f,h){var g=$(h).data("objectID");if(!this._structure[d]){this._structure[d]=[]}this._structure[d].push(g)},this))}},this));var a=$.extend(true,{data:{offset:this._offset,structure:this._structure}},this._additionalParameters);this._proxy.setOption("data",{actionName:"updatePosition",className:this._className,interfaceName:"wcf\\data\\ISortableAction",parameters:a});this._proxy.sendRequest()},_success:function(b,c,a){if(this._notification===null){this._notification=new WCF.System.Notification(WCF.Language.get("wcf.global.success.edit"))}this._notification.show()}});WCF.Popover=Class.extend({_activeElementID:"",_cancelPopover:false,_data:{},_defaultDimensions:{height:150,width:450},_defaultOrientation:{x:"right",y:"top"},_delay:{show:800,hide:500},_hoverElement:false,_hoverElementID:"",_hoverPopover:false,_margin:20,_peOut:null,_peOverElement:null,_popover:null,_popoverContent:null,_popoverOffset:10,_selector:"",init:function(a){if($.browser.mobile){return}this._activeElementID="";this._cancelPopover=false;this._data={};this._defaultDimensions={height:150,width:450};this._defaultOrientation={x:(WCF.Language.get("wcf.global.pageDirection")==="rtl"?"left":"right"),y:"top"};this._delay={show:800,hide:500};this._hoverElement=false;this._hoverElementID="";this._hoverPopover=false;this._margin=20;this._peOut=null;this._peOverElement=null;this._popoverOffset=10;this._selector=a;this._popover=$('<div class="popover"><span class="icon icon48 icon-spinner"></span><div class="popoverContent"></div></div>').hide().appendTo(document.body);this._popoverContent=this._popover.children(".popoverContent:eq(0)");this._popover.hover($.proxy(this._overPopover,this),$.proxy(this._out,this));this._initContainers();WCF.DOMNodeInsertedHandler.addCallback("WCF.Popover."+a,$.proxy(this._initContainers,this));$(window).on("beforeunload",(function(){this._cancelPopover=true;this._hide(true)}).bind(this))},_initContainers:function(){if($.browser.mobile){return}var a=$(this._selector);if(!a.length){return}a.each($.proxy(function(c,d){var b=$(d);var e=b.wcfIdentify();if(!this._data[e]){this._data[e]={content:null,isLoading:false};b.hover($.proxy(this._overElement,this),$.proxy(this._out,this));if(b.is("a")&&b.attr("href")){b.click((function(){this._hide(true)}).bind(this))}}},this))},_overElement:function(a){if(this._cancelPopover){return}if(this._peOverElement!==null){this._peOverElement.stop()}var b=$(a.currentTarget).wcfIdentify();this._hoverElementID=b;this._peOverElement=new WCF.PeriodicalExecuter($.proxy(function(c){c.stop();if(this._hoverElementID===b){this._activeElementID=b;this._prepare()}},this),this._delay.show);this._hoverElement=true;this._hoverPopover=false},_prepare:function(){if(this._cancelPopover){return}if(this._peOut!==null){this._peOut.stop()}if(this._popover.is(":visible")){this._hide(true)}if(!this._data[this._activeElementID].loading&&this._data[this._activeElementID].content){this._popoverContent.html(this._data[this._activeElementID].content);WCF.DOMNodeInsertedHandler.execute()}else{this._data[this._activeElementID].loading=true}var a=this._popover.show().getDimensions();if(this._data[this._activeElementID].loading){a={height:Math.max(a.height,this._defaultDimensions.height),width:Math.max(a.width,this._defaultDimensions.width)}}else{a=this._fixElementDimensions(this._popover,a)}this._popover.hide();var b=this._getOrientation(a.height,a.width);this._popover.css(this._getCSS(b.x,b.y));this._popover.removeClass("bottom left right top").addClass(b.x).addClass(b.y);this._show()},_show:function(){if(this._cancelPopover){return}this._popover.stop().show().css({opacity:1}).wcfFadeIn();if(this._data[this._activeElementID].loading){this._popover.children("span").show();this._loadContent()}else{this._popover.children("span").hide();this._popoverContent.css({opacity:1})}},_loadContent:function(){},_insertContent:function(a,e,c){this._data[a]={content:e,loading:false};if(this._activeElementID===a){if(c){var d=this._popoverContent.getDimensions();this._popoverContent.css({height:"auto",width:"auto"});this._popoverContent.html(this._data[a].content);var f=this._popoverContent.getDimensions();this._popoverContent.html("").css({height:d.height+"px",width:d.width+"px"});var b=this;this._popoverContent.animate({height:f.height+"px",width:f.width+"px"},300,function(){b._popover.children("span").hide();b._popoverContent.html(b._data[a].content).css({opacity:0}).animate({opacity:1},200);WCF.DOMNodeInsertedHandler.execute()})}else{this._popover.children("span").hide();this._popoverContent.html(this._data[a].content);WCF.DOMNodeInsertedHandler.execute()}}},_hide:function(b){var a=this;this._popoverContent.stop();this._popover.stop();if(b){a._popover.css({opacity:0}).hide();a._popoverContent.empty().css({height:"auto",opacity:0,width:"auto"})}else{this._popover.wcfFadeOut(function(){a._popoverContent.empty().css({height:"auto",opacity:0,width:"auto"});a._popover.hide()})}},_overPopover:function(){if(this._peOut!==null){this._peOut.stop()}this._hoverElement=false;this._hoverPopover=true},_out:function(a){if(this._cancelPopover){return}this._hoverElementID="";this._hoverElement=false;this._hoverPopover=false;this._peOut=new WCF.PeriodicalExecuter($.proxy(function(b){b.stop();if(!this._hoverElement&&!this._hoverPopover){this._hide(false)}},this),this._delay.hide)},_getOrientation:function(i,a){var h=$("#"+this._activeElementID);var g=h.getOffsets("offset");var f=h.getDimensions();var b=$(document).getDimensions();var e=(this._defaultOrientation.x==="left")?"left":"right";var d=(this._defaultOrientation.y==="bottom")?"bottom":"top";var c=this._evaluateOrientation(e,d,g,f,b,i,a);if(c.flawed){e=(e==="left")?"right":"left";c=this._evaluateOrientation(e,d,g,f,b,i,a);if(c.flawed){e=(e==="right")?"left":"right";d=(d==="bottom")?"top":"bottom";c=this._evaluateOrientation(e,d,g,f,b,i,a);if(c.flawed){e=(e==="left")?"right":"left";c=this._evaluateOrientation(e,d,g,f,b,i,a);if(c.flawed){e=(this._defaultOrientationX==="left")?"left":"right";d=(this._defaultOrientationY==="bottom")?"bottom":"top"}}}}return{x:e,y:d}},_evaluateOrientation:function(g,f,b,h,j,i,a){var d=0,e=0;switch(g){case"left":e=b.left-a;break;case"right":e=j.width-(b.left+a);break}switch(f){case"bottom":d=j.height-(b.top+h.height+this._popoverOffset+i);break;case"top":d=b.top-(i-this._popoverOffset);break}var c=false;if(d<this._margin||e<this._margin){c=true}return{flawed:c,x:e,y:d}},_getCSS:function(d,c){var g={bottom:"auto",left:"auto",right:"auto",top:"auto"};var b=$("#"+this._activeElementID);var e=b.getOffsets("offset");var f=this._fixElementDimensions(b,b.getDimensions());var a=$(window).getDimensions();switch(d){case"left":g.right=a.width-(e.left+f.width);break;case"right":g.left=e.left;break}switch(c){case"bottom":g.top=e.top+(f.height+this._popoverOffset);break;case"top":g.bottom=a.height-(e.top-this._popoverOffset);break}return g},_fixElementDimensions:function(a,b){var c=a.parent().getDimensions();if(c.height<b.height){b.height=c.height}if(c.width<b.width){b.width=c.width}return b}});WCF.EditableItemList=Class.extend({_allowCustomInput:false,_className:"",_data:{},_form:null,_itemList:null,_objectID:0,_objectTypeID:0,_search:null,_searchInput:null,init:function(c,a){this._itemList=$(c);this._searchInput=$(a);this._data={};if(!this._itemList.length||!this._searchInput.length){console.debug("[WCF.EditableItemList] Item list and/or search input do not exist, aborting.");return}this._objectID=this._getObjectID();this._objectTypeID=this._getObjectTypeID();this._itemList.find(".jsEditableItem").click($.proxy(this._click,this));if(!this._itemList.children("ul").length){$("<ul />").appendTo(this._itemList)}this._itemList=this._itemList.children("ul");this._form=this._itemList.parents("form").submit($.proxy(this._submit,this));if(this._allowCustomInput){var b=this;this._searchInput.keydown($.proxy(this._keyDown,this)).keypress($.proxy(this._keyPress,this)).on("paste",function(){setTimeout(function(){b._onPaste()},100)})}this._searchInput.parents(".dropdown").data("preventSubmit",true)},_keyDown:function(a){if(a===null){return this._keyPress(null)}return true},_keyPress:function(b){if(b===null||b.charCode===44||b.charCode===$.ui.keyCode.ENTER||($.browser.mozilla&&b.keyCode===$.ui.keyCode.ENTER)){if(b!==null&&b.charCode===$.ui.keyCode.ENTER&&this._search){if(this._search._itemIndex!==-1){return false}}var a=$.trim(this._searchInput.val());if(b&&b.charCode===44){a=a.substring(0,this._searchInput.getCaret())}if(a===""){return true}this.addItem({objectID:0,label:a});if(b&&b.charCode===44){this._searchInput.val($.trim(this._searchInput.val().substr(this._searchInput.getCaret())))}else{this._searchInput.val("")}if(b!==null){b.stopPropagation()}return false}return true},_onPaste:function(){var b=$.trim(this._searchInput.val());b=b.split(",");for(var d=0,c=b.length;d<c;d++){var a=$.trim(b[d]);if(a===""){continue}this.addItem({objectID:0,label:a})}this._searchInput.val("")},load:function(a){},_click:function(d){var b=$(d.currentTarget);var c=b.data("objectID");var a=b.data("label");if(this._search){this._search.removeExcludedSearchValue(a)}this._removeItem(c,a);b.remove();d.stopPropagation();return false},_getObjectID:function(){return 0},_getObjectTypeID:function(){return 0},addItem:function(b){if(this._data[b.objectID]){if(!(b.objectID===0&&this._allowCustomInput)){return true}}var a=$('<li class="badge">'+WCF.String.escapeHTML(b.label)+"</li>").data("objectID",b.objectID).data("label",b.label).appendTo(this._itemList);a.click($.proxy(this._click,this));if(this._search){this._search.addExcludedSearchValue(b.label)}this._addItem(b.objectID,b.label);return true},clearList:function(){this._itemList.children("li").each($.proxy(function(b,c){var a=$(c);if(this._search){this._search.removeExcludedSearchValue(a.data("label"))}a.remove();this._removeItem(a.data("objectID"),a.data("label"))},this))},_submit:function(){this._keyDown(null)},_addItem:function(b,a){this._data[b]=a},_removeItem:function(b,a){delete this._data[b]},getSearchInput:function(){return this._searchInput}});WCF.Sitemap=Class.extend({_cache:[],_dialog:null,_didInit:false,_proxy:null,init:function(){$("#sitemap").click($.proxy(this._click,this));this._cache=[];this._dialog=null;this._didInit=false;this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)})},_click:function(a){a.preventDefault();if(this._dialog===null){this._dialog=$('<div id="sitemapDialog" />').appendTo(document.body);this._proxy.setOption("data",{actionName:"getSitemap",className:"wcf\\data\\sitemap\\SitemapAction"});this._proxy.sendRequest()}else{this._dialog.wcfDialog("open");$(document).trigger("resize")}},_success:function(b,c,a){if(this._didInit){this._cache.push(b.returnValues.sitemapName);this._dialog.find("#sitemap_"+b.returnValues.sitemapName).html(b.returnValues.template);this._dialog.wcfDialog("render")}else{this._cache.push(b.returnValues.sitemapName);this._dialog.html(b.returnValues.template);this._dialog.find(".sitemapNavigation").click($.proxy(this._navigate,this));this._dialog.find(".tabMenuContainer").wcfTabs("select","sitemap_"+b.returnValues.sitemapName);this._dialog.wcfDialog({title:WCF.Language.get("wcf.page.sitemap")});this._didInit=true}$(document).trigger("resize")},_navigate:function(a){var b=$(a.currentTarget).data("sitemapName");if(WCF.inArray(b,this._cache)){this._dialog.find(".tabMenuContainer").wcfTabs("select","sitemap_"+b);this._dialog.wcfDialog("render")}else{this._proxy.setOption("data",{actionName:"getSitemap",className:"wcf\\data\\sitemap\\SitemapAction",parameters:{sitemapName:b}});this._proxy.sendRequest()}}});WCF.Language.Chooser=Class.extend({_callback:null,_dropdown:null,_input:null,init:function(m,h,g,b,l,f){var n=$("#"+m);if(n.length!=1){console.debug("[WCF.Language.Chooser] Invalid container id '"+m+"' given");return}this._input=$("#"+h);if(!this._input.length){this._input=$('<input type="hidden" name="'+h+'" value="'+g+'" />').appendTo(n)}if(l!==undefined){if(!$.isFunction(l)){console.debug("[WCF.Language.Chooser] Given callback is invalid");return}this._callback=l}this._dropdown=$('<div class="dropdown" id="'+m+'-languageChooser" />').appendTo(n);$('<div class="dropdownToggle boxFlag box24" data-toggle="'+m+'-languageChooser"></div>').appendTo(this._dropdown);var c=$('<ul class="dropdownMenu" />').appendTo(this._dropdown);for(var a in b){var j=b[a];var i=$('<li class="boxFlag"><a class="box24"><div class="framed"><img src="'+j.iconPath+'" alt="" class="iconFlag" /></div> <div><h3>'+j.languageName+"</h3></div></a></li>").appendTo(c);i.data("languageID",a).click($.proxy(this._click,this));if(a==g){var d=$(""+i.html());var k=d.children().detach();this._dropdown.children(".dropdownToggle").empty().append(k)}}if(f){$('<li class="dropdownDivider" />').appendTo(c);var i=$("<li><a>"+WCF.Language.get("wcf.global.language.noSelection")+"</a></li>").data("languageID",0).click($.proxy(this._click,this)).appendTo(c);if(g===0){this._dropdown.children(".dropdownToggle").empty().append(i.html())}}else{if(g===0){var e=$('<div><span class="icon icon24 fa-question" /></div> <div><h3>'+WCF.Language.get("wcf.global.language.noSelection")+"</h3></div>");this._dropdown.children(".dropdownToggle").empty().append(e)}}WCF.Dropdown.destroy(m+"-languageChooser");WCF.Dropdown.init()},_click:function(e){var d=$(e.currentTarget);var c=d.data("languageID");this._input.val(c);var b=$(""+d.html());var a=(c===0)?b:b.children().detach();this._dropdown.children(".dropdownToggle").empty().append(a);if(this._callback!==null){this._callback(d)}}});WCF.Style={};WCF.Style.Chooser=Class.extend({_dialog:null,_proxy:null,init:function(){$('<li class="styleChooser"><a href="#">'+WCF.Language.get("wcf.style.changeStyle")+"</a></li>").appendTo($("#footerNavigation > ul.navigationItems")).click($.proxy(this._showDialog,this));this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)})},_showDialog:function(a){if(a!==null){a.preventDefault()}if(this._dialog===null){this._dialog=$('<div id="styleChooser" />').hide().appendTo(document.body);this._loadDialog()}else{this._dialog.wcfDialog({title:WCF.Language.get("wcf.style.changeStyle")})}},_loadDialog:function(){this._proxy.setOption("data",{actionName:"getStyleChooser",className:"wcf\\data\\style\\StyleAction"});this._proxy.sendRequest()},_success:function(b,c,a){if(b.actionName==="changeStyle"){window.location.reload();return}this._dialog.html(b.returnValues.template);this._dialog.find("li").addClass("pointer").click($.proxy(this._click,this));this._showDialog(null)},_click:function(a){this._proxy.setOption("data",{actionName:"changeStyle",className:"wcf\\data\\style\\StyleAction",objectIDs:[$(a.currentTarget).data("styleID")]});this._proxy.sendRequest()}});WCF.UserPanel=Class.extend({_container:null,_didLoad:false,_link:null,_noItems:"",_revertOnEmpty:true,init:function(a){this._container=$("#"+a);this._didLoad=false;this._revertOnEmpty=true;if(this._container.length!=1){console.debug("[WCF.UserPanel] Unable to find container identfied by '"+a+"', aborting.");return}this._convert()},_convert:function(){this._container.addClass("dropdown");this._link=this._container.children("a").remove();var b=$('<a href="'+this._link.attr("href")+'" class="dropdownToggle">'+this._link.html()+"</a>").appendTo(this._container).click($.proxy(this._click,this));var a=$('<ul class="dropdownMenu" />').appendTo(this._container);$('<li class="jsDropdownPlaceholder"><span>'+WCF.Language.get("wcf.global.loading")+"</span></li>").appendTo(a);this._addDefaultItems(a);this._container.dblclick($.proxy(function(){window.location=this._link.attr("href");return false},this));WCF.Dropdown.initDropdown(b,false)},_addDefaultItems:function(a){},_addDivider:function(a){$('<li class="dropdownDivider" />').appendTo(a)},_click:function(a){a.preventDefault();if(this._didLoad){return}new WCF.Action.Proxy({autoSend:true,data:this._getParameters(),success:$.proxy(this._success,this)});this._didLoad=true},_getParameters:function(){return{}},_success:function(c,d,b){var a=WCF.Dropdown.getDropdownMenu(this._container.wcfIdentify());a.children(".jsDropdownPlaceholder").remove();if(c.returnValues&&c.returnValues.template){$(""+c.returnValues.template).prependTo(a);this._updateBadge(c.returnValues.totalCount);this._after(a)}else{$("<li><span>"+WCF.Language.get(this._noItems)+"</span></li>").prependTo(a);this._updateBadge(0)}},_updateBadge:function(a){a=parseInt(a)||0;if(a){var b=this._container.find(".badge");if(!b.length){b=$('<span class="badge badgeInverse" />').appendTo(this._container.children(".dropdownToggle"));b.before(" ")}b.html(a)}else{this._container.find(".badge").remove()}},_after:function(a){}});$.widget("ui.wcfDialog",{_closeButton:null,_container:null,_content:null,_overlay:null,_title:null,_titlebar:null,_isOpen:false,options:{autoOpen:true,closable:true,closeButtonLabel:null,closeConfirmMessage:null,closeViaModal:true,hideTitle:false,modal:true,title:"",zIndex:400,onClose:null,onShow:null},_createWidget:function(a,b){if($(b).getTagName()==="script"){console.debug("[ui.wcfDialog] Ignored script tag");this.element=false;return null}$.Widget.prototype._createWidget.apply(this,arguments)},_init:function(){if(this.options.autoOpen){this.open()}$(window).resize($.proxy(this._resize,this))},_create:function(){if(this.options.closeButtonLabel===null){this.options.closeButtonLabel=WCF.Language.get("wcf.global.button.close")}this._container=$('<div class="dialogContainer" />').hide().css({zIndex:this.options.zIndex}).appendTo(document.body);this._titlebar=$('<header class="dialogTitlebar" />').hide().appendTo(this._container);this._title=$('<span class="dialogTitle" />').hide().appendTo(this._titlebar);this._closeButton=$('<a class="dialogCloseButton jsTooltip" title="'+this.options.closeButtonLabel+'"><span /></a>').click($.proxy(this.close,this)).hide().appendTo(this._titlebar);this._content=$('<div class="dialogContent" />').appendTo(this._container);this._setOption("title",this.options.title);this._setOption("closable",this.options.closable);var a=this.element.detach();this._content.html(a);if(this.options.modal){this._overlay=$("#jsWcfDialogOverlay");if(!this._overlay.length){this._overlay=$('<div id="jsWcfDialogOverlay" class="dialogOverlay" />').css({height:"100%",zIndex:399}).hide().appendTo(document.body)}if(this.options.closable&&this.options.closeViaModal){this._overlay.click($.proxy(this.close,this));$(document).keyup($.proxy(function(b){if(b.keyCode&&b.keyCode===$.ui.keyCode.ESCAPE){this.close();b.preventDefault()}},this))}}WCF.DOMNodeInsertedHandler.execute()},_setOption:function(a,b){this.options[a]=b;if(a=="hideTitle"||a=="title"){if(!this.options.hideTitle&&this.options.title!=""){this._title.html(this.options.title).show()}else{this._title.html("")}}else{if(a=="closable"||a=="closeButtonLabel"){if(this.options.closable){this._closeButton.attr("title",this.options.closeButtonLabel).show().find("span").html(this.options.closeButtonLabel);WCF.DOMNodeInsertedHandler.execute()}else{this._closeButton.hide()}}}if((!this.options.hideTitle&&this.options.title!="")||this.options.closable){this._titlebar.show()}else{this._titlebar.hide()}return this},open:function(){if(this.element===false){return}if(this.isOpen()){return}if(this._overlay!==null){WCF.activeDialogs++;if(WCF.activeDialogs===1){this._overlay.show()}}this.render();this._isOpen=true;this._content.find(".jsDialogAutoFocus:visible:first").focus()},isOpen:function(){return this._isOpen},close:function(a){if(!this.isOpen()){return}if(this.options.closeConfirmMessage){WCF.System.Confirmation.show(this.options.closeConfirmMessage,$.proxy(function(b){if(b==="confirm"){this._close()}},this))}else{this._close()}if(a!==undefined){a.preventDefault()}},_close:function(){this._isOpen=false;this._container.wcfFadeOut();if(this._container.data("wcfDialogScrollOffset")){window.scrollTo(0,this._container.data("wcfDialogScrollOffset"))}if(this._overlay!==null){WCF.activeDialogs--;if(WCF.activeDialogs===0){this._overlay.hide()}}if(this.options.onClose!==null){this.options.onClose()}},_resize:function(){if(this.isOpen()){this.render()}},render:function(){if(!this._container.is(":visible")&&this._container.css("top")==="0px"){this._container.data("wcfDialogScrollOffset",$(window).scrollTop());window.scrollTo(0,0)}this._container.show();this._content.children().show();this._content.css({height:"auto",width:"auto"});this._container.stop();this._content.stop();this._container.show().css("opacity",1);var e=0;if(this._content.find(".formSubmit").length){e=this._content.find(".formSubmit").outerHeight();this._content.addClass("dialogForm").css({marginBottom:e+"px"})}else{this._content.removeClass("dialogForm").css({marginBottom:"0px"})}var b=$(window).getDimensions();if(b.width*0.9>800){this._container.css("maxWidth","800px")}var h=this._container.getDimensions("outer");var d=this._content.getDimensions();var e=h.height-d.height;var g=b.height-e-120;this._content.css({maxHeight:g+"px"});this._determineOverflow();h=this._container.getDimensions("outer");var f=Math.round((b.width-h.width)/2);var a=Math.round((b.height-h.height)/2);var c=Math.round((b.height/100)*20);if(c<a){a=c}this._container.css({left:f+"px",top:a+"px"});this._content.css({height:"auto",width:"auto"});if(!this.isOpen()){this._container.hide();this._container.wcfFadeIn($.proxy(function(){if(this.options.onShow!==null){this.options.onShow()}},this))}},_determineOverflow:function(){var b=$(window).getDimensions();var c=this._content.css("maxHeight");this._content.css("maxHeight","none");var e=this._container.getDimensions("outer");var d="visible";if((b.height*0.8<e.height)||(b.width*0.8<e.width)){d="auto"}this._content.css("overflow",d);this._content.css("maxHeight",c);if(d==="visible"){var a=0;this._content.children().each(function(f,g){a+=$(g).outerHeight()});if(this._content.height()<a){d="auto";this._content.css("overflow","auto")}}if($.browser.mozilla&&!$.browser.mobile){if(d==="auto"){this._content.children("div").css("margin-bottom",this._content.css("padding-bottom"))}else{this._content.children("div").css("margin-bottom",false)}}},_getContentDimensions:function(a){var b=this._content.getDimensions();if(a&&b.height>a){b.height=a}return b}});$.widget("ui.wcfSlideshow",{_buttonList:null,_count:0,_index:0,_itemList:null,_items:null,_timer:null,_width:0,options:{cycle:true,cycleInterval:5,itemGap:50,},_create:function(){this._itemList=this.element.children("ul");this._items=this._itemList.children("li");this._count=this._items.length;this._index=0;if(this._count>1){this._initSlideshow()}},_initSlideshow:function(){var b=$(this._items.get(0)).outerHeight();this._items.addClass("slideshowItem");this._width=this.element.css("height",b).innerWidth();this._itemList.addClass("slideshowItemList").css("left",0);this._items.each($.proxy(function(d,e){$(e).show().css({height:b,left:((this._width+this.options.itemGap)*d),width:this._width})},this));this.element.css({height:b,width:this._width}).hover($.proxy(this._hoverIn,this),$.proxy(this._hoverOut,this));this._buttonList=$('<ul class="slideshowButtonList" />').appendTo(this.element);for(var c=0;c<this._count;c++){var a=$('<li><a><span class="icon icon16 icon-circle" /></a></li>').data("index",c).click($.proxy(this._click,this)).appendTo(this._buttonList);if(c==0){a.find(".icon").addClass("active")}}this._resetTimer();$(window).resize($.proxy(this._resize,this))},rebuildHeight:function(){var a=$(this._items.get(0)).css("height","auto");var b=a.outerHeight();this._items.css("height",b+"px");this.element.css("height",b+"px")},_resize:function(){this._width=this.element.css("width","auto").innerWidth();this._items.each($.proxy(function(a,b){$(b).css({left:((this._width+this.options.itemGap)*a),width:this._width})},this));this._index--;this.moveTo(null)},_hoverIn:function(){if(this._timer!==null){this._timer.stop()}},_hoverOut:function(){this._resetTimer()},_resetTimer:function(){if(!this.options.cycle){return}if(this._timer!==null){this._timer.stop()}var a=this;this._timer=new WCF.PeriodicalExecuter(function(){a.moveTo(null)},this.options.cycleInterval*1000)},_click:function(a){this.moveTo($(a.currentTarget).data("index"));this._resetTimer()},moveTo:function(a){this._index=(a===null)?this._index+1:a;if(this._index==this._count){this._index=0}$(this._buttonList.find(".icon").removeClass("active").get(this._index)).addClass("active");this._itemList.css("left",this._index*(this._width+this.options.itemGap)*-1);this._trigger("moveTo",null,{index:this._index})},getItem:function(a){if(this._items[a]){return this._items[a]}return null}});$.widget("ui.wcfTabs",$.ui.tabs,{_sanitizeSelector:function(a){return a.replace(/([:\.])/g,"\\$1")},select:function(a){if(!$.isNumeric(a)){this.panels.each(function(c,b){if($(b).wcfIdentify()===a){a=c;return false}});if(!$.isNumeric(a)){console.debug("[ui.wcfTabs] Unable to find panel identified by '"+a+"', aborting.");return}}this._setOption("active",a)},selectTab:function(a){a="#"+a;this.anchors.each(function(c,b){var d=$(b);if(d.prop("hash")===a){d.trigger("click");return false}})},getCurrentIndex:function(){return this.lis.index(this.lis.filter(".ui-tabs-selected"))},hasAnchor:function(b,a){var c=false;this.anchors.each(function(e,d){var g=$(d).attr("href");if(/#.+/.test(g)){var f=g.split("#",2);if(a){f=f[1].split("-",2)}if(f[1]===b){c=true;return false}}});return c},revertToDefault:function(){var a=this.element.data("active");if(!a||a===""){a=0}this.select(a)},_processTabs:function(){var a=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist");this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1});this.anchors=this.tabs.map(function(){return $("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1});this.panels=$();this.anchors.each(function(f,e){var b,c,d=$(e).uniqueId().attr("id"),g=$(e).closest("li"),h=g.attr("aria-controls");b=e.hash;c=a.element.find(a._sanitizeSelector(b));if(c.length){a.panels=a.panels.add(c)}if(h){g.data("ui-tabs-aria-controls",h)}g.attr({"aria-controls":b.substring(1),"aria-labelledby":d});c.attr("aria-labelledby",d)});this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},load:function(a,b){return}});$.widget("ui.wcfPages",{SHOW_LINKS:11,SHOW_SUB_LINKS:20,options:{activePage:1,maxPage:1,nextPage:null,previousPage:null},_create:function(){if(this.options.nextPage===null){this.options.nextPage=WCF.Language.get("wcf.global.page.next")}if(this.options.previousPage===null){this.options.previousPage=WCF.Language.get("wcf.global.page.previous")}this.element.addClass("pageNavigation");this._render()},destroy:function(){$.Widget.prototype.destroy.apply(this,arguments);this.element.children().remove()},_render:function(){if(!this.options.disabled&&this.options.maxPage>1){var g=false;if(this.element.hasClass("hidden")){this.element.removeClass("hidden")}this.element.show();this.element.children().remove();var o=$("<ul />");this.element.append(o);var n=$('<li class="button skip" />');o.append(n);if(this.options.activePage>1){var d=$("<a"+((this.options.previousPage!=null)?(' title="'+this.options.previousPage+'"'):(""))+"></a>");n.append(d);this._bindSwitchPage(d,this.options.activePage-1);var l=$('<span class="icon icon16 icon-double-angle-left" />');d.append(l)}else{var l=$('<span class="icon icon16 icon-double-angle-left" />');n.append(l);n.addClass("disabled").removeClass("button");l.addClass("disabled")}o.append(this._renderLink(1));var a=this.SHOW_LINKS-4;var e=this.options.activePage-2;if(e<0){e=0}var i=this.options.maxPage-(this.options.activePage+1);if(i<0){i=0}if(this.options.activePage>1&&this.options.activePage<this.options.maxPage){a--}var k=a/2;var c=this.options.activePage;var j=this.options.activePage;if(c<1){c=1}if(j<1){j=1}if(j>this.options.maxPage-1){j=this.options.maxPage-1}if(e>=k){c-=k}else{c-=e;j+=k-e}if(i>=k){j+=k}else{j+=i;c-=k-i}j=Math.ceil(j);c=Math.ceil(c);if(c<1){c=1}if(j>this.options.maxPage){j=this.options.maxPage}if(c>1){if(c-1<2){o.append(this._renderLink(2))}else{$('<li class="button jumpTo"><a title="'+WCF.Language.get("wcf.global.page.jumpTo")+'" class="jsTooltip">...</a></li>').appendTo(o);g=true}}for(var m=c+1;m<j;m++){o.append(this._renderLink(m))}if(j<this.options.maxPage){if(this.options.maxPage-j<2){o.append(this._renderLink(this.options.maxPage-1))}else{$('<li class="button jumpTo"><a title="'+WCF.Language.get("wcf.global.page.jumpTo")+'" class="jsTooltip">...</a></li>').appendTo(o);g=true}}o.append(this._renderLink(this.options.maxPage));var h=$('<li class="button skip" />');o.append(h);if(this.options.activePage<this.options.maxPage){var f=$("<a"+((this.options.nextPage!=null)?(' title="'+this.options.nextPage+'"'):(""))+"></a>");h.append(f);this._bindSwitchPage(f,this.options.activePage+1);var b=$('<span class="icon icon16 icon-double-angle-right" />');f.append(b)}else{var b=$('<span class="icon icon16 icon-double-angle-right" />');h.append(b);h.addClass("disabled").removeClass("button");b.addClass("disabled")}if(g){o.data("pages",this.options.maxPage);WCF.System.PageNavigation.init("#"+o.wcfIdentify(),$.proxy(function(p){this.switchPage(p)},this))}}else{this.element.hide()}},_renderLink:function(d,a){var e=$('<li class="button"></li>');if(a!=undefined&&a){e.addClass("break")}if(d!=this.options.activePage){var b=$("<a>"+WCF.String.addThousandsSeparator(d)+"</a>");e.append(b);this._bindSwitchPage(b,d)}else{e.addClass("active");var c=$("<span>"+WCF.String.addThousandsSeparator(d)+'</span><span class="invisible">'+WCF.Language.get("wcf.page.pagePosition",{pageNo:d,pages:this.options.maxPage})+"</span>");e.append(c)}return e},_bindSwitchPage:function(a,b){var c=this;a.click(function(){c.switchPage(b)})},switchPage:function(a){this._setOption("activePage",a)},_setOption:function(b,c){if(b=="activePage"){if(c!=this.options[b]&&c>0&&c<=this.options.maxPage){var a=this._trigger("shouldSwitch",undefined,{nextPage:c});if(a||a!==undefined){this.options[b]=c;this._render();this._trigger("switched",undefined,{activePage:c})}else{this._trigger("notSwitched",undefined,{activePage:c})}}}else{this.options[b]=c;if(b=="disabled"){if(c){this.element.children().remove()}else{this._render()}}else{if(b=="maxPage"){this._render()}}}return this},_startInput:function(b){var a=$(b.currentTarget);if(!a.is("a")){a=a.parent("a")}a.hide();var c=a.parent("li").children("input").css("display","block").val("");c.focus()},_stopInput:function(b){var c=$(b.currentTarget);c.css("display","none");var a=c.parent("li");if(a!=undefined&&a!=null){a.children("a").show()}},_handleInput:function(b){var a=($.browser.msie&&$.browser.version=="7.0");if(b.type!="keyup"||a){if(!a||((b.which==13||b.which==27)&&b.type=="keyup")){if(b.which==13){this.switchPage(parseInt($(b.currentTarget).val()))}if(b.which==13||b.which==27){this._stopInput(b);b.stopPropagation()}}}}});WCF.Category={};WCF.Category.NestedList=Class.extend({_categories:{},init:function(){var a=this;$(".jsCategory").each(function(c,d){var b=$(d).data("parentCategoryID",null).change($.proxy(a._updateSelection,a));a._categories[b.val()]=b;var e=[];b.parents("li").find(".jsChildCategory").each(function(h,g){var f=$(g).data("parentCategoryID",b.val()).change($.proxy(a._updateSelection,a));a._categories[f.val()]=f;e.push(f.val());if(f.is(":checked")){b.prop("checked","checked")}});b.data("childCategoryIDs",e)})},_updateSelection:function(b){var a=$(b.currentTarget);var f=a.data("parentCategoryID");if(a.is(":checked")){if(f!==null){this._categories[f].prop("checked","checked")}}else{if(f===null){var e=a.data("childCategoryIDs");for(var d=0,c=e.length;d<c;d++){this._categories[e[d]].prop("checked",false)}}}}});WCF.Category.FlexibleCategoryList=Class.extend({_list:null,_categories:{},init:function(a){this._list=$("#"+a);this._buildStructure();if(this._list.children("li").length<2){this._list.addClass("flexibleCategoryListDisabled");return}if($.browser.chrome){this._resize();$(window).resize(this._resize.bind(this))}},_buildStructure:function(){var a=this;this._list.find(".jsCategory").each(function(d,f){var c=$(f).change(a._updateSelection.bind(a));var e=parseInt(c.val());var b=[];c.parents("li:eq(0)").find(".jsChildCategory").each(function(h,k){var g=$(k);g.data("parentCategory",c).change(a._updateSelection.bind(a));var i=parseInt(g.val());b.push(g);var l=[];g.parents("li:eq(0)").find(".jsSubChildCategory").each(function(m,j){var n=$(j);n.data("parentCategory",g).change(a._updateSelection.bind(a));l.push(n)});a._categories[i]=l});a._categories[e]=b})},_resize:function(){var a=-1;var b=0;var c=this._list.children("li");c.each(function(g,h){if(a===-1||g+1===c.length||c[g+1].offsetLeft!=a){var e=$(h);var f=e.outerHeight(true);var d=e.position();b=Math.max(b,d.top+f);a=h.offsetLeft}});this._list.css("max-height",b+"px")},_updateSelection:function(a){var g=$(a.currentTarget);var e=parseInt(g.val());var d=g.data("parentCategory");if(g.is(":checked")){if(d){d.prop("checked","checked");d=d.data("parentCategory");if(d){d.prop("checked","checked")}}}else{if(this._categories[e]){for(var k=0,h=this._categories[e].length;k<h;k++){var i=this._categories[e][k];i.prop("checked",false);var f=parseInt(i.val());if(this._categories[f]){for(var j=0,b=this._categories[f].length;j<b;j++){this._categories[f][j].prop("checked",false)}}}}if(d){var c=parseInt(d.val());for(var k=0,h=this._categories[c].length;k<h;k++){if(this._categories[c][k].prop("checked")){return}}d=d.data("parentCategory");if(d){c=parseInt(d.val());for(var k=0,h=this._categories[c].length;k<h;k++){if(this._categories[c][k].prop("checked")){return}}}}}}});WCF.Condition={};WCF.Condition.PageControllerDependence=Class.extend({_pageControllerSelection:null,_supportedPageObjectTypeIDs:[],init:function(a,b){this._supportedPageObjectTypeIDs=b;this._pageControllerSelection=$("#pageControllers").change($.proxy(this._checkVisibility,this));this._pageControllerContainer=this._pageControllerSelection.parents("dl:eq(0)");this._fieldset=this._pageControllerContainer.parent("fieldset");this._nextFieldset=this._fieldset.next("fieldset");if(this._nextFieldset){this._nextFieldset.data("margin-top",this._nextFieldset.css("margin-top"))}this._input=$("#"+a);this._inputContainer=this._input.parents("dl:eq(0)");this._checkVisibility()},_checkVisibility:function(){var b=this._pageControllerSelection.val()||[];var a=true;if(b.length){for(var d=0,c=b.length;d<c;d++){if(this._supportedPageObjectTypeIDs.indexOf(parseInt(b[d]))==-1){a=false;break}}}else{a=false}if(a){this._inputContainer.show();this._input.enable();this._fieldset.show();if(this._nextFieldset){this._nextFieldset.css("margin-top",this._nextFieldset.data("margin-top"))}}else{this._inputContainer.hide();this._input.disable();if(!this._fieldset.children("dl:visible").length){this._fieldset.hide();if(this._nextFieldset){this._nextFieldset.css("margin-top",0)}}}}});WCF.Notice={};WCF.Notice.Dismiss=Class.extend({_notices:{},_proxy:null,init:function(){this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)});var a=$(".jsDismissNoticeButton").click($.proxy(this._click,this));a.each($.proxy(function(b,c){this._notices[$(c).data("objectID")]=$(c).parent()},this))},_click:function(a){this._proxy.setOption("data",{actionName:"dismiss",className:"wcf\\data\\notice\\NoticeAction",objectIDs:[$(a.currentTarget).data("objectID")]});this._proxy.sendRequest()},_success:function(b,c,a){this._notices[b.returnValues.noticeID].wcfFadeOut()}});function wcfEval(expression){return eval(expression)}; })(this);
@@ -67,7 +85,7 @@
 (function (window, undefined) {"use strict";WCF.Like=Class.extend({_allowForOwnContent:false,_canLike:false,_containers:{},_containerData:{},_enableDislikes:true,_isBusy:false,_likeDetails:{},_proxy:null,_showSummary:true,init:function(a,c,f,e){this._canLike=a;this._enableDislikes=c;this._isBusy=false;this._likeDetails={};this._showSummary=f;this._allowForOwnContent=e;var d=this._getContainers();this._initContainers(d);this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)});var g=new Date();var b=g.toString().hashCode+g.getUTCMilliseconds();WCF.DOMNodeInsertedHandler.addCallback("WCF.Like"+b,$.proxy(this._domNodeInserted,this))},_domNodeInserted:function(){var a=this._getContainers();this._initContainers(a)},_initContainers:function(containers){var $createdWidgets=false;containers.each($.proxy(function(index,container){var $container=$(container);var $containerID=$container.wcfIdentify();if(!this._containers[$containerID]){this._containers[$containerID]=$container;this._containerData[$containerID]={likeButton:null,badge:null,dislikeButton:null,likes:$container.data("like-likes"),dislikes:$container.data("like-dislikes"),objectType:$container.data("objectType"),objectID:this._getObjectID($containerID),users:eval($container.data("like-users")),liked:$container.data("like-liked")};this._createWidget($containerID);$createdWidgets=true}},this));if($createdWidgets){new WCF.PeriodicalExecuter(function(pe){pe.stop();WCF.DOMNodeInsertedHandler.execute()},250)}},_getContainers:function(){},_getWidgetContainer:function(a){},_getObjectID:function(a){},_addWidget:function(a,b){var c=this._getWidgetContainer(a);b.appendTo(c)},_buildWidget:function(b,a,d,c,e){var f=$('<aside class="likesWidget"><ul></ul></aside>');if(this._canLike){a.appendTo(f.find("ul"));d.appendTo(f.find("ul"))}c.appendTo(f);this._addWidget(b,f)},_createWidget:function(b){var e=$('<li class="wcfLikeButton"><a href="#" title="'+WCF.Language.get("wcf.like.button.like")+'" class="jsTooltip"><span class="icon icon16 icon-thumbs-up-alt" /> <span class="invisible">'+WCF.Language.get("wcf.like.button.like")+"</span></a></li>");var c=$('<li class="wcfDislikeButton"><a href="#" title="'+WCF.Language.get("wcf.like.button.dislike")+'" class="jsTooltip"><span class="icon icon16 icon-thumbs-down-alt" /> <span class="invisible">'+WCF.Language.get("wcf.like.button.dislike")+"</span></a></li>");if(!this._enableDislikes){c.hide()}if(!this._allowForOwnContent&&(WCF.User.userID==this._containers[b].data("userID"))){e=$("");c=$("")}var d=$('<a class="badge jsTooltip likesBadge" />').data("containerID",b).click($.proxy(this._showLikeDetails,this));var a=null;if(this._showSummary){a=$('<p class="likesSummary"><span class="pointer" /></p>');a.children("span").data("containerID",b).click($.proxy(this._showLikeDetails,this))}this._buildWidget(b,e,c,d,a);this._containerData[b].likeButton=e;this._containerData[b].dislikeButton=c;this._containerData[b].badge=d;this._containerData[b].summary=a;e.data("containerID",b).data("type","like").click($.proxy(this._click,this));c.data("containerID",b).data("type","dislike").click($.proxy(this._click,this));this._setActiveState(e,c,this._containerData[b].liked);this._updateBadge(b);if(this._showSummary){this._updateSummary(b)}},_showLikeDetails:function(c,a){var b=(c===null)?a:$(c.currentTarget).data("containerID");if(this._likeDetails[b]===undefined){this._likeDetails[b]=new WCF.User.List("wcf\\data\\like\\LikeAction",WCF.Language.get("wcf.like.details"),{data:{containerID:b,objectID:this._containerData[b].objectID,objectType:this._containerData[b].objectType}})}this._likeDetails[b].open()},_click:function(a){a.preventDefault();var b=$(a.currentTarget);if(b===null){console.debug("[WCF.Like] Unable to find target button, aborting.");return}this._sendRequest(b.data("containerID"),b.data("type"))},_sendRequest:function(a,b){if(this._isBusy){return}this._isBusy=true;this._proxy.setOption("data",{actionName:b,className:"wcf\\data\\like\\LikeAction",parameters:{data:{containerID:a,objectID:this._containerData[a].objectID,objectType:this._containerData[a].objectType}}});this._proxy.sendRequest()},_success:function(d,g,b){var a=d.returnValues.containerID;if(!this._containers[a]){return}switch(d.actionName){case"dislike":case"like":this._containerData[a].likes=parseInt(d.returnValues.likes);this._containerData[a].dislikes=parseInt(d.returnValues.dislikes);this._containerData[a].users=d.returnValues.users;$.each(this._containerData[a].users,function(i,h){h.username=WCF.String.escapeHTML(h.username)});this._updateBadge(a);if(this._showSummary){this._updateSummary(a)}var f=this._containerData[a].likeButton;var e=this._containerData[a].dislikeButton;var c=0;if(d.returnValues.isLiked){c=1}else{if(d.returnValues.isDisliked){c=-1}}this._setActiveState(f,e,c);if(this._likeDetails[a]!==undefined){delete this._likeDetails[a]}this._isBusy=false;break}},_updateBadge:function(a){if(!this._containerData[a].likes&&!this._containerData[a].dislikes){this._containerData[a].badge.hide()}else{this._containerData[a].badge.show();var c=this._containerData[a].likes-this._containerData[a].dislikes;var d=this._containerData[a].badge;d.removeClass("green red");if(c>0){d.text("+"+WCF.String.formatNumeric(c));d.addClass("green")}else{if(c<0){d.text(WCF.String.formatNumeric(c));d.addClass("red")}else{d.text("\u00B10")}}var e=this._containerData[a].likes;var b=this._containerData[a].dislikes;d.data("tooltip",WCF.Language.get("wcf.like.tooltip",{likes:e,dislikes:b}))}},_updateSummary:function(a){if(!this._containerData[a].likes){this._containerData[a].summary.hide()}else{this._containerData[a].summary.show();var d=this._containerData[a].users;var c=[];for(var b in d){c.push(d[b].username)}var e=this._containerData[a].likes-c.length;this._containerData[a].summary.children("span").html(WCF.Language.get("wcf.like.summary",{users:c,others:e}))}},_setActiveState:function(a,b,c){a.removeClass("active");b.removeClass("active");if(c==1){a.addClass("active")}else{if(c==-1){b.addClass("active")}}}}); })(this);
 
 // WCF.ACL.js
-(function (window, undefined) { })(this);
+(function (window, undefined) {"use strict";WCF.ACL={};WCF.ACL.List=Class.extend({_categoryName:"",_container:null,_containerElements:{},_objectID:0,_objectTypeID:null,_options:{},_proxy:null,_search:null,_values:{group:{},user:{}},init:function(g,i,d,b,c,j){this._objectID=b||0;this._objectTypeID=i;this._categoryName=d;if(c===undefined){c=true}this._values={group:{},user:{}};this._proxy=new WCF.Action.Proxy({showLoadingOverlay:false,success:$.proxy(this._success,this)});this._container=$(g).hide().addClass("aclContainer");var f=this._container.children("dd");var a=$('<ul class="aclList container" />').appendTo(f);var k=$('<input type="text" class="long" placeholder="'+WCF.Language.get("wcf.acl.search."+(!c?"user.":"")+"description")+'" />').appendTo(f);var e=$('<ul class="aclPermissionList container" />').hide().appendTo(f);this._containerElements={aclList:a,denyAll:null,grantAll:null,permissionList:e,searchInput:k};this._search=new WCF.Search.User(k,$.proxy(this.addObject,this),c);var l=this._container.parents("form:eq(0)");l.submit($.proxy(this.submit,this));var h=l.find("input[type=reset]:eq(0)");if(h.length){h.click($.proxy(this._reset,this))}if(j){this._success(j)}else{this._loadACL()}},_reset:function(){this._values={group:{},user:{}};this._containerElements.aclList.empty();this._containerElements.searchInput.val("");this._containerElements.permissionList.hide().find("input[type=checkbox]").prop("checked",false)},_loadACL:function(){this._proxy.setOption("data",{actionName:"loadAll",className:"wcf\\data\\acl\\option\\ACLOptionAction",parameters:{categoryName:this._categoryName,objectID:this._objectID,objectTypeID:this._objectTypeID}});this._proxy.sendRequest()},addObject:function(b){var a=this._createListItem(b.objectID,b.label,b.type);this._savePermissions();this._containerElements.aclList.children("li").removeClass("active");a.addClass("active");this._search.addExcludedSearchValue(b.label);this._containerElements.permissionList.find("input[type=checkbox]").prop("checked",false);this._containerElements.searchInput.val("");this._containerElements.permissionList.show();WCF.DOMNodeInsertedHandler.execute()},_createListItem:function(d,a,c){var b=$('<li><span class="icon icon16 icon-'+(c==="group"?"group":"user")+'" /> <span>'+a+"</span></li>").appendTo(this._containerElements.aclList);b.data("objectID",d).data("type",c).data("label",a).click($.proxy(this._click,this));$('<span class="icon icon16 icon-remove jsTooltip pointer" title="'+WCF.Language.get("wcf.global.button.delete")+'" />').click($.proxy(this._removeItem,this)).appendTo(b);return b},_removeItem:function(d){var b=$(d.currentTarget).parent();var a=b.data("type");var c=b.data("objectID");this._search.removeExcludedSearchValue(b.data("label"));b.remove();if(this._values[a][c]){delete this._values[a][c]}this._selectFirstEntry()},_selectFirstEntry:function(){var a=this._containerElements.aclList.children("li:eq(0)");if(a.length){this._select(a,false)}else{this._reset()}},_success:function(g,f,l){if(!$.getLength(g.returnValues.options)){return}var i=0;var n={};for(var h in g.returnValues.options){var a=g.returnValues.options[h];var j=$("<li><span>"+a.label+"</span></li>").data("optionID",h).data("optionName",a.optionName);var d=$('<input type="checkbox" id="grant'+h+'" />').appendTo(j).wrap('<label for="grant'+h+'" class="jsTooltip" title="'+WCF.Language.get("wcf.acl.option.grant")+'" />');var b=$('<input type="checkbox" id="deny'+h+'" />').appendTo(j).wrap('<label for="deny'+h+'" class="jsTooltip" title="'+WCF.Language.get("wcf.acl.option.deny")+'" />');d.data("type","grant").data("optionID",h).change($.proxy(this._change,this));b.data("type","deny").data("optionID",h).change($.proxy(this._change,this));if(!n[a.categoryName]){n[a.categoryName]=[]}if(a.categoryName===""){j.appendTo(this._containerElements.permissionList)}else{n[a.categoryName].push(j)}i++}if(i>1){var j=$('<li class="aclFullAccess"><span>'+WCF.Language.get("wcf.acl.option.fullAccess")+"</span></li>").prependTo(this._containerElements.permissionList);this._containerElements.grantAll=$('<input type="checkbox" id="grantAll_'+this._container.attr("id")+'" />').appendTo(j).wrap('<label class="jsTooltip" title="'+WCF.Language.get("wcf.acl.option.grant")+'" />');this._containerElements.denyAll=$('<input type="checkbox" id="denyAll_'+this._container.attr("id")+'" />').appendTo(j).wrap('<label class="jsTooltip" title="'+WCF.Language.get("wcf.acl.option.deny")+'" />');this._containerElements.grantAll.data("type","grant").change($.proxy(this._changeAll,this));this._containerElements.denyAll.data("type","deny").change($.proxy(this._changeAll,this))}if($.getLength(n)){for(var e in n){var c=n[e];if(g.returnValues.categories[e]){$('<li class="aclCategory">'+g.returnValues.categories[e]+"</li>").appendTo(this._containerElements.permissionList)}for(var m=0,k=c.length;m<k;m++){c[m].appendTo(this._containerElements.permissionList)}}}this._parseData(g,"group");this._parseData(g,"user");this._container.show();this._selectFirstEntry()},_parseData:function(c,a){if(!$.getLength(c.returnValues[a].option)){return}for(var b in c.returnValues[a].label){this._createListItem(b,c.returnValues[a].label[b],a);this._search.addExcludedSearchValue(c.returnValues[a].label[b])}this._values[a]=c.returnValues[a].option;WCF.DOMNodeInsertedHandler.execute()},_click:function(b){var a=$(b.currentTarget);if(a.hasClass("active")){return}this._select(a,true)},_select:function(b,a){if(a){this._savePermissions()}this._containerElements.aclList.children("li").removeClass("active");b.addClass("active");this._setupPermissions(b.data("type"),b.data("objectID"))},_change:function(d){var c=$(d.currentTarget);var b=c.data("optionID");var a=c.data("type");if(c.is(":checked")){if(a==="deny"){$("#grant"+b).prop("checked",false);if(this._containerElements.grantAll!==null){this._containerElements.grantAll.prop("checked",false)}}else{$("#deny"+b).prop("checked",false);if(this._containerElements.denyAll!==null){this._containerElements.denyAll.prop("checked",false)}}}else{if(a==="deny"&&this._containerElements.denyAll!==null){this._containerElements.denyAll.prop("checked",false)}else{if(a==="grant"&&this._containerElements.grantAll!==null){this._containerElements.grantAll.prop("checked",false)}}}var e=true;this._containerElements.permissionList.find("input[type=checkbox]").each($.proxy(function(g,h){var f=$(h);if(f.data("type")===a&&f.attr("id")!==a+"All_"+this._container.attr("id")){if(!f.is(":checked")){e=false;return false}}},this));if(a=="deny"){if(this._containerElements.denyAll!==null){if(e){this._containerElements.denyAll.prop("checked",true)}else{this._containerElements.denyAll.prop("checked",false)}}}else{if(this._containerElements.grantAll!==null){if(e){this._containerElements.grantAll.prop("checked",true)}else{this._containerElements.grantAll.prop("checked",false)}}}},_changeAll:function(c){var b=$(c.currentTarget);var a=b.data("type");if(b.is(":checked")){if(a==="deny"){this._containerElements.grantAll.prop("checked",false);this._containerElements.permissionList.find("input[type=checkbox]").each($.proxy(function(e,f){var d=$(f);if(d.data("type")==="deny"&&d.attr("id")!=="denyAll_"+this._container.attr("id")){d.prop("checked",true).trigger("change")}},this))}else{this._containerElements.denyAll.prop("checked",false);this._containerElements.permissionList.find("input[type=checkbox]").each($.proxy(function(e,f){var d=$(f);if(d.data("type")==="grant"&&d.attr("id")!=="grantAll_"+this._container.attr("id")){d.prop("checked",true).trigger("change")}},this))}}else{if(a==="deny"){this._containerElements.grantAll.prop("checked",false);this._containerElements.permissionList.find("input[type=checkbox]").each($.proxy(function(e,f){var d=$(f);if(d.data("type")==="deny"&&d.attr("id")!=="denyAll_"+this._container.attr("id")){d.prop("checked",false).trigger("change")}},this))}else{this._containerElements.denyAll.prop("checked",false);this._containerElements.permissionList.find("input[type=checkbox]").each($.proxy(function(e,f){var d=$(f);if(d.data("type")==="grant"&&d.attr("id")!=="grantAll_"+this._container.attr("id")){d.prop("checked",false).trigger("change")}},this))}}},_setupPermissions:function(b,c){this._containerElements.permissionList.find("input[type='checkbox']").prop("checked",false);if(this._values[b]&&this._values[b][c]){for(var a in this._values[b][c]){if(this._values[b][c][a]==1){$("#grant"+a).prop("checked",true).trigger("change")}else{$("#deny"+a).prop("checked",true).trigger("change")}}}this._containerElements.permissionList.show()},_savePermissions:function(){var b=this._containerElements.aclList.find("li.active");if(!b.length){return}var c=b.data("objectID");var a=b.data("type");this._values[a][c]={};this._containerElements.permissionList.find("input[type='checkbox']").each((function(d,h){var g=$(h);if(g.attr("id")!="grantAll_"+this._container.attr("id")&&g.attr("id")!="denyAll_"+this._container.attr("id")){var f=(g.data("type")==="deny")?0:1;var e=g.data("optionID");if(g.is(":checked")){this._values[a][c][e]=f;g.prop("checked",false)}else{if(this._values[a]&&this._values[a][c]&&this._values[a][c][e]&&this._values[a][c][e]==f){delete this._values[a][c][e]}}}}).bind(this))},submit:function(a){this._savePermissions();this._save("group");this._save("user")},_save:function(a){if($.getLength(this._values[a])){var b=this._container.parents("form:eq(0)");for(var e in this._values[a]){var d=this._values[a][e];for(var c in d){$('<input type="hidden" name="aclValues['+a+"]["+e+"]["+c+']" value="'+d[c]+'" />').appendTo(b)}}}}}); })(this);
 
 // WCF.Attachment.js
 (function (window, undefined) {"use strict";WCF.Attachment={};WCF.Attachment.Upload=WCF.Upload.extend({_autoInsert:[],_insertAllButton:null,_objectType:"",_objectID:0,_tmpHash:"",_parentObjectID:0,_wysiwygContainerID:"",init:function(c,g,a,h,d,e,f,b){this._super(c,g,"wcf\\data\\attachment\\AttachmentAction",{multiple:true,maxUploads:f});this._autoInsert=[];this._objectType=a;this._objectID=parseInt(h);this._tmpHash=d;this._parentObjectID=parseInt(e);this._wysiwygContainerID=b;this._buttonSelector.children("p.button").click($.proxy(this._validateLimit,this));this._fileListSelector.find(".jsButtonInsertAttachment").click($.proxy(this._insert,this));this._fileListSelector.find(".jsButtonAttachmentInsertThumbnail").click($.proxy(this._insert,this));this._fileListSelector.find(".jsButtonAttachmentInsertFull").click($.proxy(this._insert,this));WCF.System.Event.addListener("com.woltlab.wcf.action.delete","attachment_"+this._wysiwygContainerID,$.proxy(this._removeLimitError,this));this._makeSortable();this._insertAllButton=$('<p class="button jsButtonAttachmentInsertAll">'+WCF.Language.get("wcf.attachment.insertAll")+"</p>").hide().appendTo(this._buttonSelector);this._insertAllButton.click($.proxy(this._insertAll,this));if(this._fileListSelector.children("li:not(.uploadFailed)").length){this._insertAllButton.show()}if(this._wysiwygContainerID){WCF.System.Event.addListener("com.woltlab.wcf.messageOptionsInline","submit_"+this._wysiwygContainerID,$.proxy(this._submitInline,this));WCF.System.Event.addListener("com.woltlab.wcf.messageOptionsInline","prepareExtended_"+this._wysiwygContainerID,$.proxy(this._prepareExtended,this));WCF.System.Event.addListener("com.woltlab.wcf.redactor","reset",$.proxy(this._reset,this));WCF.System.Event.addListener("com.woltlab.wcf.redactor","upload_"+this._wysiwygContainerID,$.proxy(this._editorUpload,this));WCF.System.Event.addListener("com.woltlab.wcf.redactor","getImageAttachments_"+this._wysiwygContainerID,$.proxy(this._getImageAttachments,this))}},_editorUpload:function(b){var a;this._fileListSelector.closest(".messageTabMenu").messageTabMenu("showTab","attachments",true);if(b.file){a=this._upload(undefined,b.file)}else{a=this._upload(undefined,undefined,b.blob)}this._autoInsert.push(a);b.uploadID=a},_getImageAttachments:function(a){this._fileListSelector.children("li").each(function(b,d){var c=$(d);if(c.children("img.attachmentTinyThumbnail").length){a.imageAttachments[parseInt(c.data("objectID"))]={height:parseInt(c.data("height")),width:parseInt(c.data("width"))}}})},_submitInline:function(a){if(this._tmpHash){a.tmpHash=this._tmpHash}},_prepareExtended:function(a){if(!this._objectID&&this._tmpHash&&this._fileListSelector.children("li:not(.uploadFailed)").length){a.tmpHash=this._tmpHash}},_reset:function(){this._fileListSelector.hide().empty();this._insertAllButton.hide();this._validateLimit()},_validateLimit:function(){var c=this._buttonSelector.next("small.innerError");var a=this._options.maxUploads-this._fileListSelector.children("li:not(.uploadFailed)").length;var d=(this._fileUpload)?this._fileUpload.prop("files").length:0;if(a<=0||a<d){var b=(a<=0)?WCF.Language.get("wcf.attachment.upload.error.reachedLimit"):WCF.Language.get("wcf.attachment.upload.error.reachedRemainingLimit").replace(/#remaining#/,a);if(!c.length){c=$('<small class="innerError" />').insertAfter(this._buttonSelector)}c.html(b);return false}c.remove();return true},_removeLimitError:function(b){var a=this._fileListSelector.children("li");if(!a.filter(":not(.uploadFailed)").length){this._insertAllButton.hide()}if(!a.length){setTimeout((function(){this._fileListSelector.wcfBlindOut()}).bind(this),250)}if(this._wysiwygContainerID){$("#"+this._wysiwygContainerID).redactor("wbbcode.removeAttachment",b.button.data("objectID"))}},_upload:function(c,b,a){var d=undefined;if(this._validateLimit()){d=this._super(c,b,a)}if(this._fileUpload){this._removeButton();this._createButton()}return d},_createUploadMatrix:function(a){this._fileListSelector.children("li.uploadFailed").remove();return this._super(a)},_getParameters:function(){return{objectType:this._objectType,objectID:this._objectID,tmpHash:this._tmpHash,parentObjectID:this._parentObjectID}},_initFile:function(a){var b=$('<li class="box64"><span class="icon icon48 icon-spinner" /><div><div><p>'+a.name+'</p><small><progress max="100"></progress></small></div><ul></ul></div></li>').data("filename",a.name);this._fileListSelector.append(b);this._fileListSelector.show();if(this._buttonSelector.data("maxSize")<a.size){b.find("progress").remove();b.children(".icon-spinner").removeClass("icon-spinner").addClass("icon-ban-circle");b.find("div > div").append($('<small class="innerError">'+WCF.Language.get("wcf.attachment.upload.error.tooLarge")+"</small>"));b.addClass("uploadFailed")}return b},_success:function(b,d){for(var l in this._uploadMatrix[b]){var i=this._uploadMatrix[b][l];i.find("progress").remove();var j=i.data("filename");var m=i.data("internalFileID");if(d.returnValues&&d.returnValues.attachments[m]){if(d.returnValues.attachments[m].tinyURL){i.children(".icon-spinner").replaceWith($('<img src="'+d.returnValues.attachments[m]["tinyURL"]+'" alt="" class="attachmentTinyThumbnail" />'));i.data("height",d.returnValues.attachments[m].height);i.data("width",d.returnValues.attachments[m].width)}else{i.children(".icon-spinner").removeClass("icon-spinner").addClass("icon-paper-clip")}var f=$('<a href=""></a>');f.text(j).attr("href",d.returnValues.attachments[m]["url"]);if(d.returnValues.attachments[m]["isImage"]!=0){f.addClass("jsImageViewer").attr("title",j)}i.find("p").empty().append(f);i.find("small").append(d.returnValues.attachments[m]["formattedFilesize"]);var a=i.find("ul").addClass("buttonGroup");var h=$('<li><span class="button small jsDeleteButton" data-object-id="'+d.returnValues.attachments[m]["attachmentID"]+'" data-confirm-message="'+WCF.Language.get("wcf.attachment.delete.sure")+'" data-event-name="attachment_'+this._wysiwygContainerID+'">'+WCF.Language.get("wcf.global.button.delete")+"</span></li>");a.append(h);i.data("objectID",d.returnValues.attachments[m].attachmentID);if(this._wysiwygContainerID){if(d.returnValues.attachments[m].tinyURL){var k=$('<li><span class="button small jsButtonAttachmentInsertThumbnail" data-object-id="'+d.returnValues.attachments[m].attachmentID+'">'+WCF.Language.get("wcf.attachment.insertThumbnail")+"</span></li>").appendTo(a);var g=$('<li><span class="button small jsButtonAttachmentInsertFull" data-object-id="'+d.returnValues.attachments[m].attachmentID+'">'+WCF.Language.get("wcf.attachment.insertFull")+"</span></li>").appendTo(a);k.children("span.button").click($.proxy(this._insert,this));g.children("span.button").click($.proxy(this._insert,this))}else{var c=$('<li><span class="button small jsButtonAttachmentInsertPlain" data-object-id="'+d.returnValues.attachments[m].attachmentID+'">'+WCF.Language.get("wcf.attachment.insert")+"</span></li>");c.appendTo(a).children("span.button").click($.proxy(this._insert,this))}}}else{i.children(".icon-spinner").removeClass("icon-spinner").addClass("icon-ban-circle");var e="";if(d.returnValues&&d.returnValues.errors[m]){e=d.returnValues.errors[m]["errorType"]}else{e="uploadFailed"}i.find("div > div").append($('<small class="innerError">'+WCF.Language.get("wcf.attachment.upload.error."+e)+"</small>"));i.addClass("uploadFailed")}i.css("display","block");if(WCF.inArray(b,this._autoInsert)){this._autoInsert.splice(this._autoInsert.indexOf(b),1);if(!i.hasClass("uploadFailed")){WCF.System.Event.fireEvent("com.woltlab.wcf.attachment","autoInsert_"+this._wysiwygContainerID,{attachment:"[attach="+d.returnValues.attachments[m].attachmentID+"][/attach]",uploadID:b})}}}this._makeSortable();if(this._fileListSelector.children("li:not(.uploadFailed)").length){this._insertAllButton.show()}else{this._insertAllButton.hide()}WCF.DOMNodeInsertedHandler.execute()},_insert:function(d,c){var b=(d===null)?c:$(d.currentTarget).data("objectID");var a=(d!==null)?$(d.currentTarget).hasClass("jsButtonAttachmentInsertFull"):false;if($.browser.redactor){$("#"+this._wysiwygContainerID).redactor("wbbcode.insertAttachment",b,a)}},_insertAll:function(){this._fileListSelector.children("li:not(.uploadFailed)").each($.proxy(function(a,b){this._insert(null,$(b).data("objectID"))},this))},_error:function(a){this._fileListSelector.find("li").each(function(b,d){var c=$(d);if(c.children(".icon-spinner").length){c.addClass("uploadFailed").children(".icon-spinner").removeClass("icon-spinner").addClass("icon-ban-circle");c.find("div > div").append($('<small class="innerError">'+(a.responseJSON&&a.responseJSON.message?a.responseJSON.message:WCF.Language.get("wcf.attachment.upload.error.uploadFailed"))+"</small>"))}})},_makeSortable:function(){var b=this._fileListSelector.children("li:not(.uploadFailed)");if(!b.length){return}b.addClass("sortableAttachment").children("img").addClass("sortableNode");if(!this._fileListSelector.hasClass("sortableList")){this._fileListSelector.addClass("sortableList");var a=this;new WCF.Sortable.List(this._fileListSelector.parent().wcfIdentify(),"",0,{axis:false,items:"li.sortableAttachment",toleranceElement:null,update:function(d,e){var c=[];a._fileListSelector.children("li:not(.uploadFailed)").each(function(f,g){c.push($(g).data("objectID"))});if(c.length){new WCF.Action.Proxy({autoSend:true,data:{actionName:"updatePosition",className:"wcf\\data\\attachment\\AttachmentAction",parameters:{attachmentIDs:c,objectID:a._objectID,objectType:a._objectType,tmpHash:a._tmpHash}}})}}},true)}}}); })(this);