}},$.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) {(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,"<").replace(/>/g,">").replace(/&/g,"&").replace(/\n/g,"<br/>");d.html(f+" ");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);
+(function (window, undefined) { })(this);
// WCF.js
(function (window, undefined) { })(this);
(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) {"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);
+(function (window, undefined) { })(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);
+(function (window, undefined) { })(this);
// WCF.ColorPicker.js
-(function (window, undefined) {"use strict";WCF.ColorPicker=Class.extend({_bar:null,_barActive:false,_barSelector:null,_dialog:null,_didInit:false,_elementID:"",_gradient:null,_gradientActive:false,_gradientSelector:null,_hex:null,_hsv:{},_newColor:null,_oldColor:null,_rgba:{},_rgbaRegExp:null,init:function(a){this._elementID="";this._hsv={h:0,s:100,v:100};this._position={};var b=$(a);if(!b.length){console.debug("[WCF.ColorPicker] Selector does not match any element, aborting.");return}b.click($.proxy(this._open,this))},_open:function(c){if(!this._didInit){this._initColorPicker();this._didInit=true}var a=$(c.currentTarget);this._elementID=a.wcfIdentify();this._parseColor(a);var b=this.hsvToRgb(this._hsv.h,this._hsv.s,this._hsv.v);this._oldColor.css({backgroundColor:"rgba("+b.r+", "+b.g+", "+b.b+", "+(this._rgba.a.val()/100)+")"});this._dialog.wcfDialog({title:WCF.Language.get("wcf.style.colorPicker")});this._hex.focus()},_parseColor:function(b){if(b.data("hsv")&&b.data("rgb")){var d=b.data("hsv");for(var a in d){this._hsv[a]=d[a]}this._updateValues(b.data("rgb"),true,true);this._rgba.a.val(parseInt(b.data("alpha")))}else{if(this._rgbaRegExp===null){this._rgbaRegExp=new RegExp("^rgba\\((\\d{1,3}), ?(\\d{1,3}), ?(\\d{1,3}), ?(1|1\\.00?|0|0?\\.[0-9]{1,2})\\)$")}this._rgbaRegExp.exec(b.data("color"));var c=RegExp.$4;if(c.indexOf(".")===0){c="0"+c}c*=100;this._updateValues({r:RegExp.$1,g:RegExp.$2,b:RegExp.$3,a:Math.round(c)},true,true)}},_initColorPicker:function(){this._dialog=$('<div id="colorPickerContainer" />').hide().appendTo(document.body);this._gradient=$('<div id="colorPickerGradient" />').appendTo(this._dialog);this._gradientSelector=$('<span id="colorPickerGradientSelector"><span></span></span>').appendTo(this._gradient);this._bar=$('<div id="colorPickerBar" />').appendTo(this._dialog);this._barSelector=$('<span id="colorPickerBarSelector" />').appendTo(this._bar);this._gradient.mousedown($.proxy(this._mouseDownGradient,this));this._bar.mousedown($.proxy(this._mouseDownBar,this));var a=this;$(document).mouseup(function(b){if(a._barActive){a._barActive=false;a._mouseBar(b)}else{if(a._gradientActive){a._gradientActive=false;a._mouseGradient(b)}}}).mousemove(function(b){if(a._barActive){a._mouseBar(b)}else{if(a._gradientActive){a._mouseGradient(b)}}});this._initColorPickerForm()},_initColorPickerForm:function(){var c=$('<div id="colorPickerForm" />').appendTo(this._dialog);$("<small>"+WCF.Language.get("wcf.style.colorPicker.new")+"</small>").appendTo(c);var d=$('<ul class="colors" />').appendTo(c);this._newColor=$('<li class="new"><span /></li>').appendTo(d).children("span");this._oldColor=$('<li class="old"><span /></li>').appendTo(d).children("span");$("<small>"+WCF.Language.get("wcf.style.colorPicker.current")+"</small>").appendTo(c);var a=$('<ul class="rgba" />').appendTo(c);this._createInputElement("r","R",0,255).appendTo(a);this._createInputElement("g","G",0,255).appendTo(a);this._createInputElement("b","B",0,255).appendTo(a);this._createInputElement("a","a",0,100).appendTo(a);var e=$('<ul class="hex"><li><label><span>#</span></label></li></ul>').appendTo(c);this._hex=$('<input type="text" maxlength="6" />').appendTo(e.find("label"));this._rgba.r.blur($.proxy(this._blurRgba,this)).keyup($.proxy(this._keyUpRGBA,this));this._rgba.g.blur($.proxy(this._blurRgba,this)).keyup($.proxy(this._keyUpRGBA,this));this._rgba.b.blur($.proxy(this._blurRgba,this)).keyup($.proxy(this._keyUpRGBA,this));this._rgba.a.blur($.proxy(this._blurRgba,this)).keyup($.proxy(this._keyUpRGBA,this));this._hex.blur($.proxy(this._blurHex,this)).keyup($.proxy(this._keyUpHex,this));var f=$('<div class="formSubmit" />').appendTo(this._dialog);$('<button class="buttonPrimary">'+WCF.Language.get("wcf.style.colorPicker.button.apply")+"</button>").appendTo(f).click($.proxy(this._submit,this));var b=this;this._hex.on("paste",function(){b._hex.attr("maxlength","7");setTimeout(function(){var g=b._hex.val();if(g.substring(0,1)=="#"){g=g.substr(1)}if(g.length>6){g=g.substring(0,6)}b._hex.attr("maxlength","6").val(g)},50)});c.find("input").focus(function(){this.select()})},_keyUpRGBA:function(a){if(a.which==13){this._blurRgba();this._submit()}},_keyUpHex:function(a){if(a.which==13){this._blurHex();this._submit()}},_submit:function(){var d=this.hsvToRgb(this._hsv.h,this._hsv.s,this._hsv.v);var c={};for(var b in this._hsv){c[b]=this._hsv[b]}var a=$("#"+this._elementID);a.data("hsv",c).css({backgroundColor:"rgba("+d.r+", "+d.g+", "+d.b+", "+(this._rgba.a.val()/100)+")"}).data("alpha",parseInt(this._rgba.a.val()));a.data("rgb",{r:this._rgba.r.val(),g:this._rgba.g.val(),b:this._rgba.b.val()});$("#"+a.data("store")).val("rgba("+this._rgba.r.val()+", "+this._rgba.g.val()+", "+this._rgba.b.val()+", "+(this._rgba.a.val()/100)+")").trigger("change");this._dialog.wcfDialog("close")},_createInputElement:function(f,c,e,b){var d=$('<li class="'+f+'" />');var a=$("<label />").appendTo(d);$("<span>"+c+"</span>").appendTo(a);this._rgba[f]=$('<input type="number" value="0" min="'+e+'" max="'+b+'" step="1" />').appendTo(a);return d},_mouseDownGradient:function(a){this._gradientActive=true;this._mouseGradient(a)},_mouseGradient:function(b){var c=this._gradient.getOffsets("offset");var a=Math.max(Math.min(b.pageX-c.left,255),0);var d=Math.max(Math.min(b.pageY-c.top,255),0);this._hsv.s=Math.max(0,Math.min(1,a/255))*100;this._hsv.v=Math.max(0,Math.min(1,(255-d)/255))*100;this._updateValues(null)},_mouseDownBar:function(a){this._barActive=true;this._mouseBar(a)},_mouseBar:function(a){var b=this._bar.getOffsets("offset");var c=Math.max(Math.min(a.pageY-b.top,255),0);this._barSelector.css({top:c+"px"});this._hsv.h=Math.max(0,Math.min(359,Math.round((255-c)/255*360)));this._updateValues(null)},_blurRgba:function(){for(var a in this._rgba){var b=parseInt(this._rgba[a].val())||0;if(a==="a"){this._rgba[a].val(Math.max(0,Math.min(100,b)))}else{this._rgba[a].val(Math.max(0,Math.min(255,b)))}}this._updateValues({r:this._rgba.r.val(),g:this._rgba.g.val(),b:this._rgba.b.val()},true,true)},_blurHex:function(){var a=this.hexToRgb(this._hex.val());if(a!==Number.NaN){this._updateValues(a,true,true)}},_updateValues:function(c,e,a){e=(e===true)?true:false;a=(a===true)?true:false;if(c===null){c=this.hsvToRgb(this._hsv.h,this._hsv.s,this._hsv.v);if(this._rgba.a.val()==0){c.a=100}}if(c.a===undefined){c.a=this._rgba.a.val()}for(var b in c){this._rgba[b].val(c[b])}this._hex.val(this.rgbToHex(c.r,c.g,c.b));if(e||a){var g=this.rgbToHsv(c.r,c.g,c.b);if(e){this._hsv.h=g.h}if(a){this._hsv.s=g.s;this._hsv.v=g.v}}var h=Math.max(0,Math.min(255,255-(this._hsv.h/360)*255));this._barSelector.css({top:h+"px"});var d=Math.max(0,Math.min(255,(this._hsv.s/100)*255));var h=Math.max(0,Math.min(255,255-((this._hsv.v/100)*255)));this._gradientSelector.css({left:(d-6)+"px",top:(h-6)+"px"});this._newColor.css({backgroundColor:"rgba("+c.r+", "+c.g+", "+c.b+", "+(c.a/100)+")"});var f=this.hsvToRgb(this._hsv.h,100,100);this._gradient.css({backgroundColor:"rgb("+f.r+", "+f.g+", "+f.b+")"})},hsvToRgb:function(d,j,g){var b={r:0,g:0,b:0};var i,a,f,e,c;i=Math.floor(d/60);a=d/60-i;j/=100;g/=100;f=g*(1-j);e=g*(1-j*a);c=g*(1-j*(1-a));if(j==0){b.r=b.g=b.b=g}else{switch(i){case 1:b.r=e;b.g=g;b.b=f;break;case 2:b.r=f;b.g=g;b.b=c;break;case 3:b.r=f;b.g=e;b.b=g;break;case 4:b.r=c;b.g=f;b.b=g;break;case 5:b.r=g;b.g=f;b.b=e;break;case 0:case 6:b.r=g;b.g=c;b.b=f;break}}return{r:Math.round(b.r*255),g:Math.round(b.g*255),b:Math.round(b.b*255)}},rgbToHsv:function(a,f,i){var j,e,c;var d,k,h;a/=255;f/=255;i/=255;d=Math.max(Math.max(a,f),i);k=Math.min(Math.min(a,f),i);h=d-k;j=0;if(d!==k){switch(d){case a:j=60*(0+(f-i)/h);break;case f:j=60*(2+(i-a)/h);break;case i:j=60*(4+(a-f)/h);break}if(j<0){j+=360}}if(d===0){e=0}else{e=h/d}c=d;return{h:Math.round(j),s:Math.round(e*100),v:Math.round(c*100)}},hexToRgb:function(a){if(/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(a)){a=a.split("");if(a[0]==="#"){a.shift()}if(a.length===3){return{r:parseInt(a[0]+""+a[0],16),g:parseInt(a[1]+""+a[1],16),b:parseInt(a[2]+""+a[2],16)}}else{return{r:parseInt(a[0]+""+a[1],16),g:parseInt(a[2]+""+a[3],16),b:parseInt(a[4]+""+a[5],16)}}}return Number.NaN},rgbToHex:function(d,c,a){return("0123456789ABCDEF".charAt((d-d%16)/16)+""+"0123456789ABCDEF".charAt(d%16))+""+("0123456789ABCDEF".charAt((c-c%16)/16)+""+"0123456789ABCDEF".charAt(c%16))+""+("0123456789ABCDEF".charAt((a-a%16)/16)+""+"0123456789ABCDEF".charAt(a%16))}}); })(this);
+(function (window, undefined) { })(this);
// WCF.Comment.js
-(function (window, undefined) {"use strict";WCF.Comment={};WCF.Comment.Handler=Class.extend({_commentAdd:null,_commentButtonList:{},_comments:{},_container:null,_containerID:"",_displayedComments:0,_loadNextComments:null,_loadNextResponses:{},_proxy:null,_responses:{},_userAvatar:"",_commentData:{},_guestDialog:null,init:function(a,b){this._commentAdd=null;this._commentButtonList={};this._comments={};this._containerID=a;this._displayedComments=0;this._loadNextComments=null;this._loadNextResponses={};this._responses={};this._userAvatar=b;this._container=$("#"+$.wcfEscapeID(this._containerID));if(!this._container.length){console.debug("[WCF.Comment.Handler] Unable to find container identified by '"+this._containerID+"'")}this._proxy=new WCF.Action.Proxy({failure:$.proxy(this._failure,this),success:$.proxy(this._success,this)});this._initComments();this._initResponses();if(this._container.data("canAdd")){this._initAddComment()}WCF.DOMNodeInsertedHandler.execute();WCF.DOMNodeInsertedHandler.addCallback("WCF.Comment.Handler",$.proxy(this._domNodeInserted,this));WCF.System.ObjectStore.add("WCF.Comment.Handler",this)},_handleLoadNextComments:function(){if(this._displayedComments<this._container.data("comments")){if(this._loadNextComments===null){this._loadNextComments=$('<li class="commentLoadNext"><button class="small">'+WCF.Language.get("wcf.comment.more")+"</button></li>").appendTo(this._container);this._loadNextComments.children("button").click($.proxy(this._loadComments,this))}this._loadNextComments.children("button").enable()}else{if(this._loadNextComments!==null){this._loadNextComments.remove()}}},_handleLoadNextResponses:function(a){var b=this._comments[a];b.data("displayedResponses",b.find("ul.commentResponseList > li").length);if(b.data("displayedResponses")<b.data("responses")){if(this._loadNextResponses[a]===undefined){var d=b.data("responses")-b.data("displayedResponses");this._loadNextResponses[a]=$('<li class="jsCommentLoadNextResponses"><a>'+WCF.Language.get("wcf.comment.response.more",{count:d})+"</a></li>").appendTo(this._commentButtonList[a]);this._loadNextResponses[a].children("a").data("commentID",a).click($.proxy(this._loadResponses,this));this._commentButtonList[a].parent().show()}}else{if(this._loadNextResponses[a]!==undefined){var c=this._loadNextResponses[a].next();this._loadNextResponses[a].remove();if(c.length){c.trigger("click")}}}},_loadComments:function(){this._loadNextComments.children("button").disable();this._proxy.setOption("data",{actionName:"loadComments",className:"wcf\\data\\comment\\CommentAction",parameters:{data:{objectID:this._container.data("objectID"),objectTypeID:this._container.data("objectTypeID"),lastCommentTime:this._container.data("lastCommentTime")}}});this._proxy.sendRequest()},_loadResponses:function(a){this._loadResponsesExecute($(a.currentTarget).disable().data("commentID"),false)},_loadResponsesExecute:function(a,b){this._proxy.setOption("data",{actionName:"loadResponses",className:"wcf\\data\\comment\\response\\CommentResponseAction",parameters:{data:{commentID:a,lastResponseTime:this._comments[a].data("lastResponseTime"),loadAllResponses:(b?1:0)}}});this._proxy.sendRequest()},_domNodeInserted:function(){this._initComments();this._initResponses()},_initComments:function(){var a=this;var b=false;this._container.find(".jsComment").each(function(e,h){var f=$(h).removeClass("jsComment");var c=f.data("commentID");a._comments[c]=f;var d=f.find("ul.commentResponseList");if(!d.length){d=f.find(".commentContent")}var g=$('<div class="commentOptionContainer" />').hide().insertAfter(d);a._commentButtonList[c]=$("<ul />").appendTo(g);a._handleLoadNextResponses(c);a._initComment(c,f);a._displayedComments++;b=true});if(b){this._handleLoadNextComments()}},_initComment:function(a,d){if(this._container.data("canAdd")){this._initAddResponse(a,d)}if(d.data("canEdit")){var b=$('<li><a href="#" class="jsTooltip" title="'+WCF.Language.get("wcf.global.button.edit")+'"><span class="icon icon16 icon-pencil" /> <span class="invisible">'+WCF.Language.get("wcf.global.button.edit")+"</span></a></li>");b.data("commentID",a).appendTo(d.find("ul.commentOptions:eq(0)")).click($.proxy(this._prepareEdit,this))}if(d.data("canDelete")){var c=$('<li><a href="#" class="jsTooltip" title="'+WCF.Language.get("wcf.global.button.delete")+'"><span class="icon icon16 icon-remove" /> <span class="invisible">'+WCF.Language.get("wcf.global.button.delete")+"</span></a></li>");c.data("commentID",a).appendTo(d.find("ul.commentOptions:eq(0)")).click($.proxy(this._delete,this))}},_initResponses:function(){var a=this;this._container.find(".jsCommentResponse").each(function(d,c){var b=$(c).removeClass("jsCommentResponse");var e=b.data("responseID");a._responses[e]=b;a._initResponse(e,b)})},_initResponse:function(a,c){if(c.data("canEdit")){var d=$('<li><a href="#" class="jsTooltip" title="'+WCF.Language.get("wcf.global.button.edit")+'"><span class="icon icon16 icon-pencil" /> <span class="invisible">'+WCF.Language.get("wcf.global.button.edit")+"</span></a></li>");var b=this;d.data("responseID",a).appendTo(c.find("ul.commentOptions:eq(0)")).click(function(f){b._prepareEdit(f,true)})}if(c.data("canDelete")){var e=$('<li><a href="#" class="jsTooltip" title="'+WCF.Language.get("wcf.global.button.delete")+'"><span class="icon icon16 icon-remove" /> <span class="invisible">'+WCF.Language.get("wcf.global.button.delete")+"</span></a></li>");var b=this;e.data("responseID",a).appendTo(c.find("ul.commentOptions:eq(0)")).click(function(f){b._delete(f,true)})}},_initAddComment:function(){this._commentAdd=$('<li class="box32 jsCommentAdd"><span class="framed">'+this._userAvatar+"</span><div /></li>").prependTo(this._container);var a=this._commentAdd.children("div");var b=$('<textarea placeholder="'+WCF.Language.get("wcf.comment.add")+'" maxlength="65535" class="long" />').appendTo(a).flexible();$('<button class="small">'+WCF.Language.get("wcf.global.button.submit")+"</button>").click($.proxy(this._save,this)).appendTo(a);b.keyup($.proxy(this._keyUp,this))},_initAddResponse:function(d,g){var c=$('<li class="jsCommentShowAddResponse"><a>'+WCF.Language.get("wcf.comment.button.response.add")+"</a></li>").data("commentID",d).click($.proxy(this._showAddResponse,this)).appendTo(this._commentButtonList[d]);var e=$('<div class="box32 commentResponseAdd jsCommentResponseAdd"><span class="framed">'+this._userAvatar+"</span><div /></div>").hide();e.appendTo(this._commentButtonList[d].parent().show());var a=e.children("div");var f=$('<textarea placeholder="'+WCF.Language.get("wcf.comment.response.add")+'" maxlength="65535" class="long" />').data("commentID",d).appendTo(a).flexible();$('<button class="small">'+WCF.Language.get("wcf.global.button.submit")+"</button>").click($.proxy(function(h){this._save(h,true)},this)).appendTo(a);var b=this;f.keyup(function(h){b._keyUp(h,true)});g.data("responsePlaceholder",c).data("responseInput",e)},_prepareEdit:function(c,a){c.preventDefault();var d=$(c.currentTarget);var b={objectID:this._container.data("objectID"),objectTypeID:this._container.data("objectTypeID")};if(a===true){b.responseID=d.data("responseID")}else{b.commentID=d.data("commentID")}this._proxy.setOption("data",{actionName:"prepareEdit",className:"wcf\\data\\comment\\CommentAction",parameters:{data:b}});this._proxy.sendRequest()},_showAddResponse:function(c){var b=$(c.currentTarget);var a=b.data("commentID");if(b.prev().hasClass("jsCommentLoadNextResponses")){this._loadResponsesExecute(a,true);b.parent().children(".button").disable()}b.remove();var d=this._comments[a].data("responseInput").show();d.find("textarea").focus();d.parents(".commentOptionContainer").addClass("jsAddResponseActive")},_keyUp:function(b,a){if(b.which===$.ui.keyCode.ESCAPE){$(b.currentTarget).val("").trigger("blur",b).trigger("updateHeight");return}else{if(b.which===$.ui.keyCode.ENTER&&b.ctrlKey){this._save(null,a,$(b.currentTarget));return false}}},_save:function(f,b,c){var g=(f===null)?c:$(f.currentTarget).parent().children("textarea");g.next("small.innerError").remove();var e=$.trim(g.val());if(e==""){return}var a="addComment";var d={message:e,objectID:this._container.data("objectID"),objectTypeID:this._container.data("objectTypeID")};if(b===true){a="addResponse";d.commentID=g.data("commentID")}if(!WCF.User.userID){this._commentData=d;this._proxy.setOption("data",{actionName:"getGuestDialog",className:"wcf\\data\\comment\\CommentAction",parameters:{data:{message:e,objectID:this._container.data("objectID"),objectTypeID:this._container.data("objectTypeID")}}});this._proxy.sendRequest()}else{new WCF.Action.Proxy({autoSend:true,data:{actionName:a,className:"wcf\\data\\comment\\CommentAction",parameters:{data:d}},success:$.proxy(this._success,this),failure:(function(i,h,k,j){if(i.returnValues&&i.returnValues.fieldName){if(i.returnValues.fieldName==="text"&&i.returnValues.errorType){$('<small class="innerError">'+i.returnValues.errorType+"</small>").insertAfter(g);return false}}this._failure(i,h,k,j)}).bind(this)})}},_delete:function(b,a){b.preventDefault();WCF.System.Confirmation.show(WCF.Language.get("wcf.comment.delete.confirmMessage"),$.proxy(function(d){if(d==="confirm"){var c={objectID:this._container.data("objectID"),objectTypeID:this._container.data("objectTypeID")};if(a!==true){c.commentID=$(b.currentTarget).data("commentID")}else{c.responseID=$(b.currentTarget).data("responseID")}this._proxy.setOption("data",{actionName:"remove",className:"wcf\\data\\comment\\CommentAction",parameters:{data:c}});this._proxy.sendRequest()}},this))},_failure:function(b,a,d,c){if(!WCF.User.userID&&this._guestDialog){this._guestDialog.find('input[type="submit"]').enable()}return true},_success:function(d,e,b){switch(d.actionName){case"addComment":if(d.returnValues.guestDialog){this._createGuestDialog(d.returnValues.guestDialog,d.returnValues.useCaptcha)}else{this._commentAdd.find("textarea").val("").blur().trigger("updateHeight");$(d.returnValues.template).insertAfter(this._commentAdd).wcfFadeIn();if(!WCF.User.userID){this._guestDialog.wcfDialog("close")}}break;case"addResponse":if(d.returnValues.guestDialog){this._createGuestDialog(d.returnValues.guestDialog,d.returnValues.useCaptcha)}else{var c=this._comments[d.returnValues.commentID];c.find(".jsCommentResponseAdd textarea").val("").blur().trigger("updateHeight");var a=c.find("ul.commentResponseList");if(!a.length){a=$('<ul class="commentResponseList" />').insertBefore(c.find(".commentOptionContainer"))}$(d.returnValues.template).appendTo(a).wcfFadeIn();if(!WCF.User.userID){this._guestDialog.wcfDialog("close")}}break;case"edit":this._update(d);break;case"loadComments":this._insertComments(d);break;case"loadResponses":this._insertResponses(d);break;case"prepareEdit":this._edit(d);break;case"remove":this._remove(d);break;case"getGuestDialog":this._createGuestDialog(d.returnValues.template,d.returnValues.useCaptcha);break}WCF.DOMNodeInsertedHandler.execute()},_insertComments:function(a){$(a.returnValues.template).insertBefore(this._loadNextComments);this._container.data("lastCommentTime",a.returnValues.lastCommentTime)},_insertResponses:function(b){var a=this._comments[b.returnValues.commentID];$(b.returnValues.template).appendTo(a.find("ul.commentResponseList"));a.data("lastResponseTime",b.returnValues.lastResponseTime);this._handleLoadNextResponses(b.returnValues.commentID)},_remove:function(d){if(d.returnValues.commentID){this._comments[d.returnValues.commentID].remove();delete this._comments[d.returnValues.commentID]}else{var a=this._responses[d.returnValues.responseID];var c=this._comments[a.parents("li.comment:eq(0)").data("commentID")];c.data("responses",parseInt(c.data("responses"))-1);var b=a.parent();a.remove();if(!b.children().length){b.empty()}delete this._responses[d.returnValues.responseID]}},_edit:function(b){var a;if(b.returnValues.commentID){a=this._comments[b.returnValues.commentID].find(".commentContent:eq(0) .userMessage:eq(0)")}else{a=this._responses[b.returnValues.responseID].find(".commentContent:eq(0) .userMessage:eq(0)")}a.html($.proxy(function(e,d){var f=$('<textarea class="long" maxlength="65535" />').val(b.returnValues.message);f.data("__html",d).keyup($.proxy(this._keyUpEdit,this));if(b.returnValues.commentID){f.data("commentID",b.returnValues.commentID)}else{f.data("responseID",b.returnValues.responseID)}return f},this));var c=a.children("textarea");$('<button class="small">'+WCF.Language.get("wcf.global.button.submit")+"</button>").insertAfter(c).click($.proxy(this._saveEdit,this));c.focus().flexible();a.parent().find(".containerHeadline:eq(0)").hide();a.parent().find(".buttonGroupNavigation:eq(0)").hide()},_update:function(a){var b;if(a.returnValues.commentID){b=this._comments[a.returnValues.commentID].find(".commentContent:eq(0) .userMessage:eq(0) > textarea")}else{b=this._responses[a.returnValues.responseID].find(".commentContent:eq(0) .userMessage:eq(0) > textarea")}b.data("__html",a.returnValues.message);this._cancelEdit(b)},_createGuestDialog:function(b,a){var c=!!this._guestDialog;if(!this._guestDialog){this._guestDialog=$('<div id="commentAddGuestDialog" />').hide().appendTo(document.body)}this._guestDialog.html(b);this._guestDialog.data("useCaptcha",a);this._guestDialog.find('input[type="submit"]').click($.proxy(this._submit,this));this._guestDialog.find('input[type="text"]').keydown($.proxy(this._keyDown,this));this._guestDialog.wcfDialog({title:WCF.Language.get("wcf.comment.guestDialog.title")})},_keyDown:function(a){if(a.which===$.ui.keyCode.ENTER){this._submit()}},_submit:function(b){var c={actionName:this._commentData.commentID?"addResponse":"addComment",className:"wcf\\data\\comment\\CommentAction"};var a=this._commentData;a.username=this._guestDialog.find('input[name="username"]').val();c.parameters={data:a};c=$.extend(WCF.System.Captcha.getData("commentAdd"),c);this._proxy.setOption("data",c);this._proxy.sendRequest()},_keyUpEdit:function(a){if(a.which===$.ui.keyCode.ESCAPE){this._cancelEdit($(a.currentTarget));return}else{if(a.which===$.ui.keyCode.ENTER&&a.ctrlKey){this._saveEdit(a);return false}}},_saveEdit:function(c){var d=$(c.currentTarget);if(d.is("button")){d.prev("small.innerError").remove();d=d.prev("textarea")}var b=$.trim(d.val());if(b===""){return}var a={message:b,objectID:this._container.data("objectID"),objectTypeID:this._container.data("objectTypeID")};if(d.data("commentID")){a.commentID=d.data("commentID")}else{a.responseID=d.data("responseID")}new WCF.Action.Proxy({autoSend:true,data:{actionName:"edit",className:"wcf\\data\\comment\\CommentAction",parameters:{data:a}},success:$.proxy(this._success,this),failure:(function(f,e,h,g){if(f.returnValues&&f.returnValues.fieldName){if(f.returnValues.fieldName==="text"&&f.returnValues.errorType){$('<small class="innerError">'+f.returnValues.errorType+"</small>").insertAfter(d);return false}}this._failure(f,e,h,g)}).bind(this)})},_cancelEdit:function(a){a.parent().prev(".containerHeadline:eq(0)").show();a.parent().next(".buttonGroupNavigation:eq(0)").show();a.parent().html(a.data("__html"))}});WCF.Comment.Like=WCF.Like.extend({_getContainers:function(){return $(".commentList > li.comment")},_getObjectID:function(a){return this._containers[a].data("commentID")},_buildWidget:function(b,a,d,c,e){this._containers[b].find(".containerHeadline:eq(0) > h3").append(c);if(this._canLike){a.appendTo(this._containers[b].find(".commentOptions:eq(0)"));d.appendTo(this._containers[b].find(".commentOptions:eq(0)"))}},_getWidgetContainer:function(a){},_addWidget:function(a,b){}});WCF.Comment.Response={};WCF.Comment.Response.Like=WCF.Like.extend({_addWidget:function(a,b){},_buildWidget:function(b,a,d,c,e){this._containers[b].find(".containerHeadline:eq(0) > h3").append(c);if(this._canLike){a.appendTo(this._containers[b].find(".commentOptions:eq(0)"));d.appendTo(this._containers[b].find(".commentOptions:eq(0)"))}},_getContainers:function(){return $(".commentResponseList > li.commentResponse")},_getObjectID:function(a){return this._containers[a].data("responseID")},_getWidgetContainer:function(a){}}); })(this);
+(function (window, undefined) { })(this);
// WCF.ImageViewer.js
-(function (window, undefined) {"use strict";WCF.ImageViewer=Class.extend({_triggerElement:null,init:function(){this._triggerElement=$('<span class="wcfImageViewerTriggerElement" />').data("disableSlideshow",true).hide().appendTo(document.body);this._triggerElement.wcfImageViewer({enableSlideshow:0,imageSelector:".jsImageViewerEnabled",staticViewer:true});WCF.DOMNodeInsertedHandler.addCallback("WCF.ImageViewer",$.proxy(this._domNodeInserted,this));WCF.DOMNodeInsertedHandler.execute()},_domNodeInserted:function(){this._initImageSizeCheck();this._rebuildImageViewer()},_rebuildImageViewer:function(){var a=$("a.jsImageViewer");if(a.length){a.removeClass("jsImageViewer").addClass("jsImageViewerEnabled").click($.proxy(this._click,this))}},_click:function(a){a.preventDefault();a.stopPropagation();this._triggerElement.wcfImageViewer("open",null,$(a.currentTarget).wcfIdentify())},_initImageSizeCheck:function(){$(".jsResizeImage").each($.proxy(function(a,b){if(b.complete){this._checkImageSize({currentTarget:b})}},this));$(".jsResizeImage").on("load",$.proxy(this._checkImageSize,this))},_checkImageSize:function(c){var b=$(c.currentTarget);if(!b.is(":visible")){b.off("load");return}b.removeClass("jsResizeImage");if(b.closest(".messageSignature").length){return}var d=new Image();d.src=b.attr("src");var a=b.closest("div.messageText, div.messageTextPreview").width();if(a<d.width){if(!b.parents("a").length){b.wrap('<a href="'+b.attr("src")+'" class="jsImageViewerEnabled embeddedImageLink" />');b.parent().click($.proxy(this._click,this))}}}});$.widget("ui.wcfImageViewer",{_active:-1,_activeImage:null,_container:null,_didInit:false,_disableSlideshow:false,_eventNamespace:"",_images:[],_isMobile:false,_isOpen:false,_items:-1,_maxDimensions:{height:0,width:0},_proxy:null,_slideshowEnabled:false,_thumbnailContainerWidth:0,_thumbnailMarginRight:0,_thumbnailOffset:0,_thumbnailWidth:0,_timer:null,_ui:{buttonNext:null,buttonPrevious:null,header:null,image:null,imageContainer:null,imageList:null,slideshow:{container:null,enlarge:null,next:null,previous:null,toggle:null}},options:{shiftBy:5,enableSlideshow:1,speed:5,className:"",imageSelector:"",staticViewer:false},_create:function(){this._active=-1;this._activeImage=null;this._container=null;this._didInit=false;this._disableSlideshow=(this.element.data("disableSlideshow"));this._eventNamespace=this.element.wcfIdentify();this._images=[];this._isMobile=false;this._isOpen=false;this._items=-1;this._maxDimensions={height:document.documentElement.clientHeight,width:document.documentElement.clientWidth};this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)});this._slideshowEnabled=false;this._thumbnailContainerWidth=0;this._thumbnailMarginRight=0;this._thumbnailOffset=0;this._thumbnaiLWidth=0;this._timer=null;this._ui={};this.element.click($.proxy(this.open,this))},open:function(b,c){if(b){b.preventDefault()}if(this._isOpen){return false}if(this.options.staticViewer){var a=this._getStaticImages();this._initUI();this._createThumbnails(a,true);this._render(true,undefined,c);this._isOpen=true;WCF.System.DisableScrolling.disable();WCF.System.DisableZoom.disable();if($.browser.touch){setTimeout($.proxy(function(){if(this._isMobile&&!this._container.hasClass("maximized")){this._toggleView()}},this),500)}}else{if(this._images.length===0){this._loadNextImages(true)}else{this._render(false,this.element.data("targetImageID"));if(this._items>1&&this._slideshowEnabled){this.startSlideshow()}this._isOpen=true;WCF.System.DisableScrolling.disable();WCF.System.DisableZoom.disable()}}this._bindListener();return true},close:function(a){if(a){a.preventDefault()}if(!this._isOpen){return false}this._container.removeClass("open");if(this._timer!==null){this._timer.stop()}this._unbindListener();this._isOpen=false;WCF.System.DisableScrolling.enable();WCF.System.DisableZoom.enable();return true},startSlideshow:function(){if(this._disableSlideshow||this._slideshowEnabled){return false}if(this._timer===null){this._timer=new WCF.PeriodicalExecuter($.proxy(function(){var a=this._active+1;if(a==this._items){a=0}this.showImage(a)},this),this.options.speed*1000)}else{this._timer.resume()}this._slideshowEnabled=true;this._ui.slideshow.toggle.children("span").removeClass("icon-play").addClass("icon-pause");return true},stopSlideshow:function(a){if(!this._slideshowEnabled){return false}this._timer.stop();if(a){this._ui.slideshow.toggle.children("span").removeClass("icon-pause").addClass("icon-play")}this._slideshowEnabled=false;return true},_bindListener:function(){$(document).on("keydown."+this._eventNamespace,$.proxy(this._keyDown,this));$(window).on("resize."+this._eventNamespace,$.proxy(this._renderImage,this))},_unbindListener:function(){$(document).off("keydown."+this._eventNamespace);$(window).off("resize."+this._eventNamespace)},_keyDown:function(b){switch(b.which){case $.ui.keyCode.ESCAPE:this.close();break;case $.ui.keyCode.LEFT:this._previousImage();break;case $.ui.keyCode.RIGHT:this._nextImage();break;case $.ui.keyCode.UP:if(!this._container.hasClass("maximized")){this._toggleView()}break;case $.ui.keyCode.DOWN:if(this._container.hasClass("maximized")){this._toggleView()}break;case $.ui.keyCode.ENTER:var a=this._ui.header.find("> div > h1 > a");if(a.length==1){window.location=a.prop("href")}else{this._ui.slideshow.full.trigger("click")}break;case 80:this._ui.slideshow.toggle.trigger("click");break;default:return true;break}return false},_render:function(f,b,e){this._container.addClass("open");var c=null;if(f){c=this._ui.imageList.children("li:eq(0)");this._thumbnailMarginRight=parseInt(c.css("marginRight").replace(/px$/,""))||0;this._thumbnailWidth=c.outerWidth(true);this._thumbnailContainerWidth=this._ui.imageList.parent().innerWidth();if(this._items>1&&this.options.enableSlideshow&&!b&&!e){this.startSlideshow()}}if(b){this._ui.imageList.children("li").each($.proxy(function(i,j){var h=$(j);if(h.data("objectID")==b){h.trigger("click");this.moveToImage(h.data("index"));return false}},this))}else{if(e!==null){var g=0;$(this.options.imageSelector).each(function(h,i){if($(i).wcfIdentify()==e){g=h;return false}});var a=this._ui.imageList.children("li:eq("+g+")");if(this._active!==-1){var d=false;if(this._active!=a.data("index")){d=true}if(this._ui.images[this._activeImage].prop("src")!=this._images[this._active].image.url){d=true}if(d){this._active=-1}}a.trigger("click");this.moveToImage(a.data("index"))}else{if(c!==null){c.trigger("click")}}}this._toggleButtons();this._preload()},_preload:function(){if(this._images.length<this._items){var a=this._images.length*this._thumbnailWidth;if(a-this._thumbnailOffset<this._thumbnailContainerWidth){this._loadNextImages(false)}}},_showImage:function(a){this.showImage($(a.currentTarget).data("index"),true)},showImage:function(e,c){if(this._active==e){return false}this.stopSlideshow(c||false);if(this._active!=-1){this._images[this._active].listItem.removeClass("active")}this._active=e;var b=this._images[e];this._ui.imageList.children("li").removeClass("active");b.listItem.addClass("active");var g=this._ui.imageContainer.getDimensions("inner");var i=(this._activeImage?0:1);if(this._activeImage!==null){this._ui.images[this._activeImage].removeClass("active")}this._activeImage=i;var a=this._active;this._ui.imageContainer.addClass("loading");this._ui.images[i].off("load").prop("src","data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==");this._ui.images[i].on("load",$.proxy(function(){this._imageOnLoad(a,i)},this));this._renderImage(i,b,g);if(!this.options.staticViewer){var f=this._ui.header.find("> div > a").prop("href",b.user.link).prop("title",b.user.username);f.children("img").prop("src",b.user.avatarURL)}var h=WCF.String.escapeHTML(b.image.title);if(b.image.link){h='<a href="'+b.image.link+'">'+h+"</a>"}this._ui.header.find("> div > h1").html(h);if(!this.options.staticViewer){var d=(b.series&&b.series.title?WCF.String.escapeHTML(b.series.title):"");if(b.series.link){d='<a href="'+b.series.link+'">'+d+"</a>"}this._ui.header.find("> div > h2").html(d)}this._ui.header.find("> div > h3").text(WCF.Language.get("wcf.imageViewer.seriesIndex").replace(/{x}/,b.listItem.data("index")+1).replace(/{y}/,this._items));this._ui.slideshow.full.data("link",(b.image.fullURL?b.image.fullURL:b.image.url));this.moveToImage(b.listItem.data("index"));this._toggleButtons();return true},_imageOnLoad:function(b,a){if(b!=this._active){return}this._ui.imageContainer.removeClass("loading");this._ui.images[a].addClass("active");if(this.options.staticViewer){this._renderImage(a,null)}this.startSlideshow()},_renderImage:function(d,a,i){var e=true;if(!a){d=this._activeImage;a=this._images[this._active];i={height:$(window).height()-(this._container.hasClass("maximized")||this._container.hasClass("wcfImageViewerMobile")?0:200),width:this._ui.imageContainer.innerWidth()};e=false}i.height-=22;i.width-=20;var f=this._ui.images[d];if(f.prop("src")!==a.image.url){f.prop("src",a.image.url)}if(e&&f[0].complete){f.trigger("load")}if(this.options.staticViewer&&!a.image.height&&f[0].complete){f.css({height:"auto",width:"auto"});a.image.height=f[0].height;a.image.width=f[0].width}var g=a.image.height;var b=a.image.width;var h=0;if(g>i.height){h=i.height/g;g=i.height;b=Math.floor(b*h)}if(b>i.width){h=i.width/b;b=i.width;g=Math.floor(g*h)}var c=Math.floor((i.width-b)/2);this._ui.images[d].css({height:g+"px",left:(c+10)+"px",marginTop:(Math.round(g/2)*-1)+"px",width:b+"px"})},_initUI:function(){if(this._didInit){return false}this._didInit=true;this._container=$('<div class="wcfImageViewer'+(this.options.staticViewer?" wcfImageViewerStatic":"")+'" />').appendTo(document.body);var c=$("<div><img /><img /></div>").appendTo(this._container);var g=$('<footer><span class="wcfImageViewerButtonPrevious icon icon-double-angle-left" /><div><ul /></div><span class="wcfImageViewerButtonNext icon icon-double-angle-right" /></footer>').appendTo(this._container);var e=$("<ul />").appendTo(c);var d=$('<li class="wcfImageViewerSlideshowButtonPrevious"><span class="icon icon48 icon-angle-left" /></li>').appendTo(e);var f=$('<li class="wcfImageViewerSlideshowButtonToggle pointer"><span class="icon icon48 icon-play" /></li>').appendTo(e);var b=$('<li class="wcfImageViewerSlideshowButtonNext"><span class="icon icon48 icon-angle-right" /></li>').appendTo(e);var h=$('<li class="wcfImageViewerSlideshowButtonEnlarge pointer jsTooltip" title="'+WCF.Language.get("wcf.imageViewer.button.enlarge")+'"><span class="icon icon48 icon-resize-full" /></li>').appendTo(e);var a=$('<li class="wcfImageViewerSlideshowButtonFull pointer jsTooltip" title="'+WCF.Language.get("wcf.imageViewer.button.full")+'"><span class="icon icon48 icon-external-link" /></li>').appendTo(e);this._ui={buttonNext:g.children("span.wcfImageViewerButtonNext"),buttonPrevious:g.children("span.wcfImageViewerButtonPrevious"),header:$("<header><div"+(this.options.staticViewer?">":' class="box64"><a class="framed jsTooltip"><img /></a>')+"<h1 /><h2 /><h3 /></div></header>").appendTo(this._container),imageContainer:c,images:[c.children("img:eq(0)").on("webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd",function(){$(this).removeClass("animateTransformation")}),c.children("img:eq(1)").on("webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd",function(){$(this).removeClass("animateTransformation")})],imageList:g.find("> div > ul"),slideshow:{container:e,enlarge:h,full:a,next:b,previous:d,toggle:f}};this._ui.buttonNext.click($.proxy(this._next,this));this._ui.buttonPrevious.click($.proxy(this._previous,this));b.click($.proxy(this._nextImage,this));d.click($.proxy(this._previousImage,this));h.click($.proxy(this._toggleView,this));f.click($.proxy(function(){if(this._items<2){return}if(this._slideshowEnabled){this.stopSlideshow(true)}else{this._disableSlideshow=false;this.startSlideshow()}},this));a.click(function(i){window.location=$(i.currentTarget).data("link")});$('<span class="wcfImageViewerButtonClose icon icon48 icon-remove pointer jsTooltip" title="'+WCF.Language.get("wcf.global.button.close")+'" />').appendTo(this._ui.header).click($.proxy(this.close,this));if(!$.browser.mobile){c.click((function(i){if(i.target===c[0]){this.close()}}).bind(this))}WCF.DOMNodeInsertedHandler.execute();enquire.register("screen and (max-width: 800px)",{match:$.proxy(this._enableMobileView,this),unmatch:$.proxy(this._disableMobileView,this)});return true},_enableMobileView:function(){this._container.addClass("wcfImageViewerMobile");var a=this;this._ui.imageContainer.swipe({swipeLeft:function(b){if(a._container.hasClass("maximized")){a._nextImage(b)}},swipeRight:function(b){if(a._container.hasClass("maximized")){a._previousImage(b)}},tap:function(c,b){switch(b.tagName){case"DIV":case"IMG":a._toggleView();break}}});this._isMobile=true},_disableMobileView:function(){this._container.removeClass("wcfImageViewerMobile");this._ui.imageContainer.swipe("destroy");this._isMobile=false},_toggleView:function(){this._ui.images[this._activeImage].addClass("animateTransformation");this._container.toggleClass("maximized");this._ui.slideshow.enlarge.toggleClass("active").children("span").toggleClass("icon-resize-full").toggleClass("icon-resize-small");this._renderImage(null,undefined,null)},_next:function(c,b){if(this._ui.buttonNext.hasClass("pointer")){if(b==undefined){this.stopSlideshow(true)}var a=Math.max((this._items*this._thumbnailWidth)-this._thumbnailContainerWidth-this._thumbnailMarginRight,0);this._thumbnailOffset=Math.min(this._thumbnailOffset+(this._thumbnailWidth*(b?b:this.options.shiftBy)),a);this._ui.imageList.css("marginLeft",(this._thumbnailOffset*-1))}this._preload();this._toggleButtons()},_previous:function(b,a){if(this._ui.buttonPrevious.hasClass("pointer")){if(a==undefined){this.stopSlideshow(true)}this._thumbnailOffset=Math.max(this._thumbnailOffset-(this._thumbnailWidth*(a?a:this.options.shiftBy)),0);this._ui.imageList.css("marginLeft",(this._thumbnailOffset*-1))}this._toggleButtons()},_nextImage:function(a){if(this._ui.slideshow.next.hasClass("pointer")){this._disableSlideshow=true;this.stopSlideshow(true);this.showImage(this._active+1);if(a){a.preventDefault();a.stopPropagation()}}},_previousImage:function(a){if(this._ui.slideshow.previous.hasClass("pointer")){this._disableSlideshow=true;this.stopSlideshow(true);this.showImage(this._active-1);if(a){a.preventDefault();a.stopPropagation()}}},moveToImage:function(b){var f=(b-3)*this._thumbnailWidth;var d=f+(this._thumbnailWidth*5);var e=this._thumbnailOffset;var a=this._thumbnailOffset+this._thumbnailContainerWidth;var g=false;if(f<e||d>a){g=true}if(g){var c=0;if(f<e){while(f<e){c++;e-=this._thumbnailWidth}this._previous(null,c)}else{while(d>a){c++;a+=this._thumbnailWidth}this._next(null,c)}}},_toggleButtons:function(){if(this._thumbnailOffset>0){this._ui.buttonPrevious.addClass("pointer")}else{this._ui.buttonPrevious.removeClass("pointer")}var a=(this._images.length*this._thumbnailWidth)-this._thumbnailContainerWidth-this._thumbnailMarginRight;if(this._thumbnailOffset>=a){this._ui.buttonNext.removeClass("pointer")}else{this._ui.buttonNext.addClass("pointer")}if(this._active>0){this._ui.slideshow.previous.addClass("pointer")}else{this._ui.slideshow.previous.removeClass("pointer")}if(this._active+1<this._images.length){this._ui.slideshow.next.addClass("pointer")}else{this._ui.slideshow.next.removeClass("pointer")}if(this._items<2){this._ui.slideshow.toggle.removeClass("pointer")}else{this._ui.slideshow.toggle.addClass("pointer")}},_createThumbnails:function(a){if(this.options.staticViewer){this._images=[];this._ui.imageList.empty()}for(var g=0,f=a.length;g<f;g++){var e=a[g];var d=$('<li class="loading pointer"><img src="'+e.thumbnail.url+'" /></li>').appendTo(this._ui.imageList);d.data("index",this._images.length).data("objectID",e.objectID).click($.proxy(this._showImage,this));var c=d.children("img");if(c.get(0).complete){d.removeClass("loading");if(this.options.staticViewer){this._fixThumbnailDimensions(c)}}else{var b=this;c.on("load",function(){var h=$(this);h.parent().removeClass("loading");if(b.options.staticViewer){b._fixThumbnailDimensions(h)}})}e.listItem=d;this._images.push(e)}},_fixThumbnailDimensions:function(e){var c=new Image();c.src=e.prop("src");var b=c.height;var a=c.width;if(b==a){b=a=80}else{if(b<a){var d=80/a;a=80;b*=d}else{var d=80/b;b=80;a*=d}}e.css({height:b+"px",width:a+"px"})},_loadNextImages:function(a){this._proxy.setOption("data",{actionName:"loadNextImages",className:this.options.className,interfaceName:"wcf\\data\\IImageViewerAction",objectIDs:[this.element.data("objectID")],parameters:{maximumHeight:this._maxDimensions.height,maximumWidth:this._maxDimensions.width,offset:this._images.length,targetImageID:(a&&this.element.data("targetImageID")?this.element.data("targetImageID"):0)}});this._proxy.setOption("showLoadingOverlay",false);this._proxy.sendRequest()},_getStaticImages:function(){var a=[];$(this.options.imageSelector).each(function(c,d){var b=$(d);var e=b.children("img");if(!e.length){e=b.parentsUntil(".formAttachmentList").last().find(".attachmentTinyThumbnail")}a.push({image:{fullURL:b.prop("href"),link:"",title:b.prop("title"),url:b.prop("href"),},series:null,thumbnail:{url:e.prop("src")},user:null})});this._items=a.length;return a},_success:function(c,e,b){if(c.returnValues.items){this._items=c.returnValues.items}var a=this._initUI();this._createThumbnails(c.returnValues.images);var d=(c.returnValues.targetImageID?c.returnValues.targetImageID:0);this._render(a,d);if(!this._isOpen){this._isOpen=true;WCF.System.DisableScrolling.disable();WCF.System.DisableZoom.disable()}}}); })(this);
+(function (window, undefined) { })(this);
// WCF.Label.js
(function (window, undefined) {"use strict";WCF.Label={};WCF.Label.ACPList=Class.extend({_labelInput:null,_labelList:[],init:function(){this._labelInput=$("#label").keydown($.proxy(this._keyPressed,this)).keyup($.proxy(this._keyPressed,this)).blur($.proxy(this._keyPressed,this));if($.browser.mozilla&&$.browser.touch){this._labelInput.on("input",$.proxy(this._keyPressed,this))}$("#labelList").find('input[type="radio"]').each($.proxy(function(b,a){var c=$(a);if(c.prop("value")!=="custom"){this._labelList.push($(c.next("span")))}},this))},_keyPressed:function(){var a=this._labelInput.prop("value");if(a===""){a=WCF.Language.get("wcf.acp.label.defaultValue")}for(var c=0,b=this._labelList.length;c<b;c++){this._labelList[c].text(a)}}});WCF.Label.ACPList.Connect=Class.extend({init:function(){var a=$("#connect .structuredList li");if(!a.length){return}a.each($.proxy(function(b,c){$(c).find('input[type="checkbox"]').click($.proxy(this._click,this))},this))},_click:function(c){var a=$(c.currentTarget);if(a.is(":checked")){a=a.parents("li");var b=a.data("depth");while(true){a=a.next();if(!a.length){return true}if(a.data("depth")<=b){return true}a.find('input[type="checkbox"]').prop("checked","checked")}}}});WCF.Label.Chooser=Class.extend({_container:null,_groups:{},_showWithoutSelection:false,init:function(f,b,e,h){this._container=null;this._groups={};this._showWithoutSelection=(h===true);this._initContainers(b);if($.getLength(f)){for(var a in f){var d=this._groups[a];if(d){WCF.Dropdown.getDropdownMenu(d.wcfIdentify()).find("> ul > li:not(.dropdownDivider)").each($.proxy(function(k,j){var i=$(j);var l=i.data("labelID")||0;if(l&&f[a]==l){this._selectLabel(i,true)}},this))}}}for(var c in this._containers){var g=this._containers[c];if(g.data("labelID")===undefined){g.data("labelID",0)}}this._container=$(b);if(e){$(e).click($.proxy(this._submit,this))}else{if(this._container.is("form")){this._container.submit($.proxy(this._submit,this))}}},_initContainers:function(a){$(a).find(".labelChooser").each($.proxy(function(d,i){var f=$(i);var b=f.data("groupID");if(!this._groups[b]){var e=f.wcfIdentify();var c=WCF.Dropdown.getDropdownMenu(e);if(c===null){WCF.Dropdown.initDropdown(f.find(".dropdownToggle"));c=WCF.Dropdown.getDropdownMenu(e)}var h=c;if(c.getTagName()=="div"&&c.children(".scrollableDropdownMenu").length){h=$("<ul />").appendTo(c);c=c.children(".scrollableDropdownMenu")}this._groups[b]=f;c.children("li").data("groupID",b).click($.proxy(this._click,this));if(!f.data("forceSelection")||this._showWithoutSelection){$('<li class="dropdownDivider" />').appendTo(h)}if(this._showWithoutSelection){$('<li data-label-id="-1"><span><span class="badge label">'+WCF.Language.get("wcf.label.withoutSelection")+"</span></span></li>").data("groupID",b).appendTo(h).click($.proxy(this._click,this))}if(!f.data("forceSelection")){var g=$('<li data-label-id="0"><span><span class="badge label">'+WCF.Language.get("wcf.label.none")+"</span></span></li>").data("groupID",b).appendTo(h);g.click($.proxy(this._click,this))}}},this))},_click:function(a){this._selectLabel($(a.currentTarget),false)},_selectLabel:function(a,c){var b=this._groups[a.data("groupID")];if(c&&b.data("labelID")!==undefined){return}if(a.data("labelID")){b.data("labelID",a.data("labelID"))}else{b.data("labelID",0)}a=a.find("span > span");b.find(".dropdownToggle > span").removeClass().addClass(a.attr("class")).text(a.text())},_submit:function(){var b=this._container.find(".formSubmit");b.find('input[type="hidden"]').each(function(e,d){var f=$(d);if(f.attr("name").indexOf("labelIDs[")===0){f.remove()}});for(var a in this._groups){var c=this._groups[a];if(c.data("labelID")){$('<input type="hidden" name="labelIDs['+a+']" value="'+c.data("labelID")+'" />').appendTo(b)}}}}); })(this);