Updating minified JavaScript files
authorwoltlab.com <woltlab@woltlab.com>
Mon, 28 Apr 2014 13:46:06 +0000 (15:46 +0200)
committerwoltlab.com <woltlab@woltlab.com>
Mon, 28 Apr 2014 13:46:06 +0000 (15:46 +0200)
wcfsetup/install/files/js/WCF.min.js

index 782ce66e1d39e0b30df01f7525bf42460e0ef232..713c0a3638fd9a18224c92cfc6226024e1c16fe1 100755 (executable)
@@ -10,4 +10,4 @@ window.matchMedia||(window.matchMedia=function(){var c=window.styleMedia||window
  */
 (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);String.prototype.hashCode=function(){var a;var b=0;if(this.length){for(var d=0,c=this.length;d<c;d++){a=this.charCodeAt(d);b=((b<<5)-b)+a;b=b&b}}return b};function shuffle(d){var c=d.length,b,a;while(0!==c){a=Math.floor(Math.random()*c);c-=1;b=d[c];d[c]=d[a];d[a]=b}return this}(function(){var c=navigator.userAgent.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(c)||/(webkit)[ \/]([\w.]+)/.exec(c)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(c)||/(msie) ([\w.]+)/.exec(c)||c.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(c)||[];var a={browser:b[1]||"",version:b[2]||"0"};browser={};if(a.browser){browser[a.browser]=true;browser.version=a.version}if(browser.chrome){browser.webkit=true}else{if(browser.webkit){browser.safari=true}}jQuery.browser=browser;jQuery.browser.touch=(!!("ontouchstart" in window)||(!!("msMaxTouchPoints" in window.navigator)&&window.navigator.msMaxTouchPoints>0));jQuery.browser.smartphone=($("html").css("caption-side")=="bottom");jQuery.browser.editor="redactor";jQuery.browser.ckeditor=false;jQuery.browser.redactor=true;if(jQuery.browser.mozilla&&c.match(/trident/)){jQuery.browser.mozilla=false;jQuery.browser.msie=true}})();(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);var WCF={};$.extend(true,{removeArrayValue:function(b,a){return $.grep(b,function(d,c){return a!==d})},wcfEscapeID:function(a){return a.replace(/(:|\.)/g,"\\$1")},wcfIsset:function(a){return !!$("#"+$.wcfEscapeID(a)).length},getLength:function(a){var c=0;for(var b in a){if(a.hasOwnProperty(b)){c++}}return c}});$.fn.extend({getTagName:function(){return(this.length)?this.get(0).tagName.toLowerCase():""},getDimensions:function(b){var c=css={};var a=false;if(this.is(":hidden")){css=WCF.getInlineCSS(this);a=true;this.css({display:"block",visibility:"hidden"})}switch(b){case"inner":c={height:this.innerHeight(),width:this.innerWidth()};break;case"outer":c={height:this.outerHeight(),width:this.outerWidth()};break;default:c={height:this.height(),width:this.width()};break}if(a){WCF.revertInlineCSS(this,css,["display","visibility"])}return c},getOffsets:function(b){var c=css={};var a=false;if(this.is(":hidden")){css=WCF.getInlineCSS(this);a=true;this.css({display:"block",visibility:"hidden"})}switch(b){case"offset":c=this.offset();break;case"position":default:c=this.position();break}if(a){WCF.revertInlineCSS(this,css,["display","visibility"])}return c},makePositioned:function(a,b){if(a!="absolute"&&a!="fixed"){a="absolute"}var c=this.getOffsets("position");this.css({position:a,left:c.left,margin:0,top:c.top});if(b){this.remove().appentTo("body")}return this},disable:function(){return this.attr("disabled","disabled")},enable:function(){return this.removeAttr("disabled")},wcfIdentify:function(){if(!this.attr("id")){this.attr("id",WCF.getRandomID())}return this.attr("id")},getCaret:function(){if(this.is("input")){if(this.attr("type")!="text"&&this.attr("type")!="password"){return -1}}else{if(!this.is("textarea")){return -1}}var c=0;var b=this.get(0);if(document.selection){this.focus();var a=document.selection.createRange();a.moveStart("character",-this.val().length);c=a.text.length}else{if(b.selectionStart||b.selectionStart=="0"){c=parseInt(b.selectionStart)}}return c},setCaret:function(b){if(this.is("input")){if(this.attr("type")!="text"&&this.attr("type")!="password"){return false}}else{if(!this.is("textarea")){return false}}var c=this.get(0);this.focus();if(document.selection){var a=document.selection.createRange();a.moveStart("character",b);a.moveEnd("character",0);a.select()}else{if(c.selectionStart||c.selectionStart=="0"){c.selectionStart=b;c.selectionEnd=b}}return true},wcfDropIn:function(b,c,a){if(!b){b="up"}if(!a||!parseInt(a)){a=200}return this.show(WCF.getEffect(this,"drop"),{direction:b},a,c)},wcfDropOut:function(b,c,a){if(!b){b="down"}if(!a||!parseInt(a)){a=200}return this.hide(WCF.getEffect(this,"drop"),{direction:b},a,c)},wcfBlindIn:function(b,c,a){if(!b){b="vertical"}if(!a||!parseInt(a)){a=200}return this.show(WCF.getEffect(this,"blind"),{direction:b},a,c)},wcfBlindOut:function(b,c,a){if(!b){b="vertical"}if(!a||!parseInt(a)){a=200}return this.hide(WCF.getEffect(this,"blind"),{direction:b},a,c)},wcfHighlight:function(a,b){return this.effect("highlight",a,600,b)},wcfFadeIn:function(b,a){if(!a||!parseInt(a)){a=200}return this.show(WCF.getEffect(this,"fade"),{},a,b)},wcfFadeOut:function(b,a){if(!a||!parseInt(a)){a=200}return this.hide(WCF.getEffect(this,"fade"),{},a,b)}});$.extend(WCF,{activeDialogs:0,_idCounter:0,getRandomID:function(){var a="";do{a="wcf"+this._idCounter++}while($.wcfIsset(a));return a},inArray:function(b,a){return($.inArray(b,a)!=-1)},getEffect:function(a,b){if(a.is("tr")){return"highlight"}return b},getInlineCSS:function(b){var c={};var a=b.attr("style");if(!a){return{}}a=a.split(";");for(var f=0,d=a.length;f<d;f++){var e=$.trim(a[f]);if(e==""){continue}e=e.split(":");c[$.trim(e[0])]=$.trim(e[1])}return c},revertInlineCSS:function(a,c,e){for(var f=0,d=e.length;f<d;f++){var b=e[f];if(c[b]){a.css(b,c[b])}else{a.css(b,"")}}}});WCF.Browser={_isChrome:null,isChrome:function(){if(this._isChrome===null){this._isChrome=false;if(/chrom(e|ium)/.test(navigator.userAgent.toLowerCase())){this._isChrome=true}}return this._isChrome}};WCF.Dropdown={_callbacks:{},_didInit:false,_dropdowns:{},_menuContainer:null,_menus:{},init:function(){if(this._menuContainer===null){this._menuContainer=$('<div id="dropdownMenuContainer" />').appendTo(document.body)}var a=this;$(".dropdownToggle:not(.jsDropdownEnabled)").each(function(b,c){a.initDropdown($(c),false)});if(!this._didInit){this._didInit=true;WCF.CloseOverlayHandler.addCallback("WCF.Dropdown",$.proxy(this._closeAll,this));WCF.DOMNodeInsertedHandler.addCallback("WCF.Dropdown",$.proxy(this.init,this));$(document).on("scroll",$.proxy(this._scroll,this))}},_dialogScroll:function(b){var a=$(b.currentTarget);a.find(".dropdown.dropdownOpen").each(function(d,f){var i=$(f);var e=i.wcfIdentify();var g=i.offset();var c=a.offset();var h=$(f).height()/2;if(g.top+h<=c.top){WCF.Dropdown.toggleDropdown(e)}else{if(g.top>=c.top+a.height()){WCF.Dropdown.toggleDropdown(e)}else{if(g.left<=c.left){WCF.Dropdown.toggleDropdown(e)}else{if(g.left>=c.left+a.width()){WCF.Dropdown.toggleDropdown(e)}else{WCF.Dropdown.setAlignmentByID(i.wcfIdentify())}}}}})},_scroll:function(b){for(var a in this._dropdowns){var c=this._dropdowns[a];if(c.data("isOverlayDropdownButton")&&c.hasClass("dropdownOpen")){this.setAlignmentByID(a)}}},initDropdown:function(b,d){if(b.hasClass("jsDropdownEnabled")||b.data("target")){return}var e=b.parents(".dropdown");if(!e.length){console.debug("[WCF.Dropdown] Invalid dropdown passed, button '"+b.wcfIdentify()+"' does not have a parent with .dropdown, aborting.");return}var a=b.next(".dropdownMenu");if(!a.length){console.debug("[WCF.Dropdown] Invalid dropdown passed, dropdown '"+e.wcfIdentify()+"' does not have a dropdown menu, aborting.");return}a.detach().appendTo(this._menuContainer);var c=e.wcfIdentify();if(!this._dropdowns[c]){b.addClass("jsDropdownEnabled").click($.proxy(this._toggle,this));this._dropdowns[c]=e;this._menus[c]=a}b.data("target",c);if(d){b.trigger("click")}},removeDropdown:function(a){if(this._menus[a]){$(this._menus[a]).remove();delete this._menus[a];delete this._dropdowns[a]}},initDropdownFragment:function(c,a){var b=c.wcfIdentify();if(this._dropdowns[b]){console.debug("[WCF.Dropdown] Cannot register dropdown identified by '"+b+"' as a fragement.");return}this._dropdowns[b]=c;this._menus[b]=a.detach().appendTo(this._menuContainer)},registerCallback:function(a,b){if(!$.isFunction(b)){console.debug("[WCF.Dropdown] Callback for '"+a+"' is invalid");return false}if(!this._callbacks[a]){this._callbacks[a]=[]}this._callbacks[a].push(b)},_toggle:function(g,e){var b=(g===null)?e:$(g.currentTarget).data("target");var a=this._dropdowns[b];if(a&&a.data("isOverlayDropdownButton")===undefined){var d=a.parents(".dialogContent");a.data("isOverlayDropdownButton",d.length>0);if(d.length){d.on("scroll",this._dialogScroll)}}for(var f in this._dropdowns){var h=this._dropdowns[f];var c=this._menus[f];if(h.hasClass("dropdownOpen")){h.removeClass("dropdownOpen");c.removeClass("dropdownOpen");this._notifyCallbacks(f,"close")}else{if(f===b){h.addClass("dropdownOpen");c.addClass("dropdownOpen");this._notifyCallbacks(f,"open");this.setAlignment(h,c)}}}if(g!==null){g.stopPropagation();return false}},toggleDropdown:function(a){this._toggle(null,a)},getDropdown:function(a){if(this._dropdowns[a]){return this._dropdowns[a]}return null},getDropdownMenu:function(a){if(this._menus[a]){return this._menus[a]}return null},setAlignmentByID:function(a){var c=this.getDropdown(a);if(c===null){console.debug("[WCF.Dropdown] Unable to find dropdown identified by '"+a+"'")}var b=this.getDropdownMenu(a);if(b===null){console.debug("[WCF.Dropdown] Unable to find dropdown menu identified by '"+a+"'")}this.setAlignment(c,b)},setAlignment:function(o,f){if(!f.data("isInitialized")){f.data("isInitialized",true).css({left:0,top:0})}var c=o.getDimensions("outer");var j=o.getOffsets("offset");var k=f.getDimensions("outer");var d=$(window).width();var a=o.find(".dropdownToggle");if(a.hasClass("dropdownCaptionTextarea")){c=a.getDimensions("outer")}var h="left";if((j.left+k.width)>d){h="right"}var b="auto";var n="auto";if(h==="left"){f.removeClass("dropdownArrowRight");b=j.left}else{f.addClass("dropdownArrowRight");n=(d-(j.left+c.width))}if(WCF.Language.get("wcf.global.pageDirection")=="rtl"){var l=b;var g=n;if(b=="auto"){f.removeClass("dropdownArrowRight")}else{n=d-(j.left+c.width);b="auto";if(n+k.width>d){b=l;n=g;f.addClass("dropdownArrowRight")}}}if(b=="auto"){n+="px"}else{b+="px"}var m=true;if(f.hasClass("dropdownOpen")){m=false;f.removeClass("dropdownOpen")}var i="auto";var e=j.top+c.height+7;if(e+k.height>$(window).height()+$(document).scrollTop()){i=$(window).height()-j.top+10;e="auto";f.addClass("dropdownArrowBottom")}else{f.removeClass("dropdownArrowBottom")}if(!m){f.addClass("dropdownOpen")}f.css({bottom:i,left:b,right:n,top:e})},_closeAll:function(){for(var a in this._dropdowns){var b=this._dropdowns[a];if(b.hasClass("dropdownOpen")){b.removeClass("dropdownOpen");this._menus[a].removeClass("dropdownOpen");this._notifyCallbacks(a,"close")}}},close:function(a){if(!this._dropdowns[a]){return}this._dropdowns[a].removeClass("dropdownMenu");this._menus[a].removeClass("dropdownMenu")},_notifyCallbacks:function(a,b){if(!this._callbacks[a]){return}for(var d=0,c=this._callbacks[a].length;d<c;d++){this._callbacks[a][d](a,b)}}};WCF.Clipboard={_actionProxy:null,_actionObjects:{},_containers:null,_containerData:{},_hasMarkedItems:false,_markedObjectIDs:{},_page:"",_pageObjectID:0,_proxy:null,_trackedElements:{},init:function(d,b,e,c){this._page=d;this._actionObjects=e||{};this._hasMarkedItems=(b>0);this._pageObjectID=parseInt(c)||0;this._actionProxy=new WCF.Action.Proxy({success:$.proxy(this._actionSuccess,this),url:"index.php/ClipboardProxy/?t="+SECURITY_TOKEN+SID_ARG_2ND});this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this),url:"index.php/Clipboard/?t="+SECURITY_TOKEN+SID_ARG_2ND});this._containers=$(".jsClipboardContainer").each($.proxy(function(g,f){this._initContainer(f)},this));if(this._hasMarkedItems&&this._containers.length){this._loadMarkedItems()}var a=this;WCF.DOMNodeInsertedHandler.addCallback("WCF.Clipboard",function(){a._containers=$(".jsClipboardContainer").each($.proxy(function(g,f){a._initContainer(f)},a))})},_loadMarkedItems:function(){new WCF.Action.Proxy({autoSend:true,data:{containerData:this._containerData,pageClassName:this._page,pageObjectID:this._pageObjectID},success:$.proxy(this._loadMarkedItemsSuccess,this),url:"index.php/ClipboardLoadMarkedItems/?t="+SECURITY_TOKEN+SID_ARG_2ND})},reload:function(){if(this._containers===null){return}this._loadMarkedItems()},_loadMarkedItemsSuccess:function(d,f,c){this._resetMarkings();for(var a in d.markedItems){if(!this._markedObjectIDs[a]){this._markedObjectIDs[a]=[]}var b=d.markedItems[a];for(var e in b){this._markedObjectIDs[a].push(b[e])}this._containers.each($.proxy(function(h,g){var i=$(g);if(i.data("type")!=a){return true}i.find("input.jsClipboardItem").each($.proxy(function(l,k){var j=$(k);if(WCF.inArray(j.data("objectID"),this._markedObjectIDs[a])){j.prop("checked",true);j.parents(".jsClipboardObject").addClass("jsMarked")}},this));i.find("input.jsClipboardMarkAll").each(function(l,k){var j=true;i.find("input.jsClipboardItem").each(function(n,o){var m=$(o);if(!m.prop("checked")){j=false}});if(j){$(k).prop("checked",true)}})},this))}this._success(d,f,c)},_resetMarkings:function(){this._containers.each($.proxy(function(b,a){var c=$(a);this._markedObjectIDs[c.data("type")]=[];c.find("input.jsClipboardItem, input.jsClipboardMarkAll").prop("checked",false);c.find(".jsClipboardObject").removeClass("jsMarked")},this))},_initContainer:function(a){var c=$(a);var b=c.wcfIdentify();if(!this._trackedElements[b]){c.find(".jsClipboardMarkAll").data("hasContainer",b).click($.proxy(this._markAll,this));this._markedObjectIDs[c.data("type")]=[];this._containerData[c.data("type")]={};$.each(c.data(),$.proxy(function(d,e){if(d.match(/^type(.+)/)){this._containerData[c.data("type")][WCF.String.lcfirst(d.replace(/^type/,""))]=e}},this));this._trackedElements[b]=[]}c.find("input.jsClipboardItem").each($.proxy(function(f,e){var g=$(e);var d=g.wcfIdentify();if(!WCF.inArray(d,this._trackedElements[b])){this._trackedElements[b].push(d);g.data("hasContainer",b).click($.proxy(this._click,this))}},this))},_click:function(f){var b=$(f.target);var e=b.data("objectID");var h=(b.prop("checked"))?true:false;var d=[e];if(b.data("hasContainer")){var g=$("#"+b.data("hasContainer"));var a=g.data("type")}else{var a=b.data("type")}if(h){this._markedObjectIDs[a].push(e);b.parents(".jsClipboardObject").addClass("jsMarked")}else{this._markedObjectIDs[a]=$.removeArrayValue(this._markedObjectIDs[a],e);b.parents(".jsClipboardObject").removeClass("jsMarked")}if(b.data("hasContainer")){var c=true;g.find("input.jsClipboardItem").each(function(j,i){var k=$(i);if(!k.prop("checked")){c=false}});g.find(".jsClipboardMarkAll").each(function(i,j){if(c){$(j).prop("checked",true)}else{$(j).prop("checked",false)}})}this._saveState(a,d,h)},_markAll:function(d){var b=$(d.target);var c=[];var f=true;if(b.is("input")){f=b.prop("checked")}if(b.data("hasContainer")){var e=$("#"+b.data("hasContainer"));var a=e.data("type")}else{var a=b.data("type")}if(b.data("hasContainer")){e.find("input.jsClipboardItem").each($.proxy(function(h,g){var j=$(g);var i=j.data("objectID");if(f){if(!j.prop("checked")){j.prop("checked",true);this._markedObjectIDs[a].push(i);c.push(i)}}else{if(j.prop("checked")){j.prop("checked",false);this._markedObjectIDs[a]=$.removeArrayValue(this._markedObjectIDs[a],i);c.push(i)}}},this));if(f){e.find(".jsClipboardObject").addClass("jsMarked")}else{e.find(".jsClipboardObject").removeClass("jsMarked")}}this._saveState(a,c,f)},_saveState:function(b,c,a){this._proxy.setOption("data",{action:(a)?"mark":"unmark",containerData:this._containerData,objectIDs:c,pageClassName:this._page,pageObjectID:this._pageObjectID,type:b});this._proxy.sendRequest()},_success:function(data,textStatus,jqXHR){var $containers={};$(".jsClipboardEditor").each(function(index,container){var $container=$(container);var $types=eval($container.data("types"));for(var $i=0,$length=$types.length;$i<$length;$i++){var $typeName=$types[$i];$containers[$typeName]=$container}var $containerID=$container.wcfIdentify();WCF.CloseOverlayHandler.removeCallback($containerID);$container.empty()});if(!data.items){return}for(var $typeName in data.items){if(!$containers[$typeName]){continue}var $container=$containers[$typeName];var $list=$container.children("ul");if($list.length==0){$list=$("<ul />").appendTo($container)}var $editor=data.items[$typeName];var $label=$('<li class="dropdown"><span class="dropdownToggle button">'+$editor.label+"</span></li>").appendTo($list);var $itemList=$('<ol class="dropdownMenu"></ol>').appendTo($label);for(var $itemIndex in $editor.items){var $item=$editor.items[$itemIndex];var $listItem=$("<li><span>"+$item.label+"</span></li>").appendTo($itemList);$listItem.data("container",$container);$listItem.data("objectType",$typeName);$listItem.data("actionName",$item.actionName).data("parameters",$item.parameters);$listItem.data("internalData",$item.internalData).data("url",$item.url).data("type",$typeName);$listItem.click($.proxy(this._executeAction,this))}$('<li class="dropdownDivider" />').appendTo($itemList);$("<li><span>"+WCF.Language.get("wcf.clipboard.item.unmarkAll")+"</span></li>").appendTo($itemList).click($.proxy(function(){this._proxy.setOption("data",{action:"unmarkAll",type:$typeName});this._proxy.setOption("success",$.proxy(function(data,textStatus,jqXHR){this._containers.each($.proxy(function(index,container){var $container=$(container);if($container.data("type")==$typeName){$container.find(".jsClipboardMarkAll, .jsClipboardItem").prop("checked",false);$container.find(".jsClipboardObject").removeClass("jsMarked");return false}},this));this._success(data,textStatus,jqXHR);this._proxy.setOption("success",$.proxy(this._success,this))},this));this._proxy.sendRequest()},this));WCF.Dropdown.initDropdown($label.children(".dropdownToggle"),false)}},_closeLists:function(){$(".jsClipboardEditor ul").removeClass("dropdownOpen")},_executeAction:function(e){var c=$(e.currentTarget);var d=c.data("url");if(d){window.location.href=d}if(c.data("parameters").className&&c.data("parameters").actionName){if(c.data("parameters").actionName==="unmarkAll"||c.data("parameters").objectIDs){var b=c.data("internalData")["confirmMessage"];if(b){var a=c.data("internalData")["template"];if(a){a=$(a)}WCF.System.Confirmation.show(b,$.proxy(function(g){if(g==="confirm"){var f={};if(a&&a.length){$("#wcfSystemConfirmationContent").find("input, select, textarea").each(function(i,j){var h=$(j);f[h.prop("name")]=h.val()})}this._executeAJAXActions(c,f)}},this),"",a)}else{this._executeAJAXActions(c,{})}}}c.data("container").trigger("clipboardAction",[c.data("type"),c.data("actionName"),c.data("parameters")])},_executeAJAXActions:function(d,e){e=e||{};var a=[];if(d.data("parameters").actionName!=="unmarkAll"){$.each(d.data("parameters").objectIDs,function(g,h){a.push(parseInt(h))})}var b={data:e,containerData:this._containerData[d.data("type")]};var f=d.data("internalData")["parameters"];if(f!==undefined){for(var c in f){b[c]=f[c]}}new WCF.Action.Proxy({autoSend:true,data:{actionName:d.data("parameters").actionName,className:d.data("parameters").className,objectIDs:a,parameters:b},success:$.proxy(function(g){if(d.data("parameters").actionName!=="unmarkAll"){d.data("container").trigger("clipboardActionResponse",[g,d.data("type"),d.data("actionName"),d.data("parameters")])}this._loadMarkedItems()},this)});if(this._actionObjects[d.data("objectType")]&&this._actionObjects[d.data("objectType")][d.data("parameters").actionName]){this._actionObjects[d.data("objectType")][d.data("parameters").actionName].triggerEffect(a)}},sendRequest:function(b){var a=$(b);this._actionProxy.setOption("data",{parameters:a.data("parameters"),typeName:a.data("type")});this._actionProxy.sendRequest()}};WCF.PeriodicalExecuter=Class.extend({_callback:null,_delay:0,_intervalID:null,_isExecuting:false,init:function(b,a){if(!$.isFunction(b)){console.debug("[WCF.PeriodicalExecuter] Given callback is invalid, aborting.");return}this._callback=b;this._interval=a;this.resume()},_execute:function(){if(!this._isExecuting){try{this._isExecuting=true;this._callback(this);this._isExecuting=false}catch(a){this._isExecuting=false;throw a}}},stop:function(){if(!this._intervalID){return}clearInterval(this._intervalID)},resume:function(){if(this._intervalID){this.stop()}this._intervalID=setInterval($.proxy(this._execute,this),this._interval)}});WCF.LoadingOverlayHandler={_activeRequests:0,_loadingOverlay:null,_pending:null,show:function(){if(this._loadingOverlay===null){this._loadingOverlay=$('<div class="spinner"><span class="icon icon48 icon-spinner" /> <span>'+WCF.Language.get("wcf.global.loading")+"</span></div>").appendTo($("body"));var b=this._loadingOverlay.outerWidth();if(b<70){b=70}this._loadingOverlay.css({marginLeft:Math.ceil(-1*b/2),width:b}).hide()}this._activeRequests++;if(this._activeRequests==1){if(this._pending===null){var a=this;this._pending=new WCF.PeriodicalExecuter(function(c){if(a._activeRequests){a._loadingOverlay.stop(true,true).fadeIn(100)}c.stop();a._pending=null},250)}}},hide:function(){this._activeRequests--;if(this._activeRequests==0){if(this._pending!==null){this._pending.stop();this._pending=null}this._loadingOverlay.stop(true,true).fadeOut(100)}},updateIcon:function(b,c){var a=(c===undefined||c?"addClass":"removeClass");b.find(".icon")[a]("icon-spinner");if(b.hasClass("icon")){b[a]("icon-spinner")}}};WCF.Action={};WCF.Action.Proxy=Class.extend({_showLoadingOverlayOnce:false,_suppressErrors:false,_lastRequest:null,init:function(b){this.options=$.extend(true,{autoSend:false,data:{},dataType:"json",after:null,init:null,jsonp:"callback",async:true,failure:null,showLoadingOverlay:true,success:null,suppressErrors:false,type:"POST",url:"index.php/AJAXProxy/?t="+SECURITY_TOKEN+SID_ARG_2ND,aborted:null,autoAbortPrevious:false},b);this.confirmationDialog=null;this.loading=null;this._showLoadingOverlayOnce=false;this._suppressErrors=(this.options.suppressErrors===true);if(this.options.autoSend){this.sendRequest()}var a=this;$(window).on("beforeunload",function(){a._suppressErrors=true})},sendRequest:function(a){this._init();if(a||this.options.autoAbortPrevious){this.abortPrevious()}this._lastRequest=$.ajax({data:this.options.data,dataType:this.options.dataType,jsonp:this.options.jsonp,async:this.options.async,type:this.options.type,url:this.options.url,success:$.proxy(this._success,this),error:$.proxy(this._failure,this)});return this._lastRequest},abortPrevious:function(){if(this._lastRequest!==null){this._lastRequest.abort();this._lastRequest=null}},showLoadingOverlayOnce:function(){this._showLoadingOverlayOnce=true},suppressErrors:function(){this._suppressErrors=true},_init:function(){if($.isFunction(this.options.init)){this.options.init(this)}if(this.options.showLoadingOverlay||this._showLoadingOverlayOnce){WCF.LoadingOverlayHandler.show()}},_failure:function(d,i,h){if(i=="abort"){if($.isFunction(this.options.aborted)){this.options.aborted(d)}return}try{var c=$.parseJSON(d.responseText);var f=true;if($.isFunction(this.options.failure)){f=this.options.failure(c,d,i,h)}if(!this._suppressErrors&&f!==false){var a="";if(c.stacktrace){a="<br /><p>Stacktrace:</p><p>"+c.stacktrace+"</p>"}else{if(c.exceptionID){a="<br /><p>Exception ID: <code>"+c.exceptionID+"</code></p>"}}$('<div class="ajaxDebugMessage"><p>'+c.message+"</p>"+a+"</div>").wcfDialog({title:WCF.Language.get("wcf.global.error.title")})}}catch(g){var f=true;if($.isFunction(this.options.failure)){f=this.options.failure(null,d,i,h)}if(!this._suppressErrors&&f!==false){var b=(i==="timeout")?WCF.Language.get("wcf.global.error.timeout"):d.responseText;if(b&&b!="undefined"){$('<div class="ajaxDebugMessage"><p>'+b+"</p></div>").wcfDialog({title:WCF.Language.get("wcf.global.error.title")})}}}this._after()},_success:function(b,c,a){if($.isFunction(this.options.success)){if(b&&b.returnValues&&b.returnValues.template!==undefined){b.returnValues.template=$.trim(b.returnValues.template)}this.options.success(b,c,a)}this._after()},_after:function(){this._lastRequest=null;if($.isFunction(this.options.after)){this.options.after()}if(this.options.showLoadingOverlay||this._showLoadingOverlayOnce){WCF.LoadingOverlayHandler.hide();if(this._showLoadingOverlayOnce){this._showLoadingOverlayOnce=false}}WCF.DOMNodeInsertedHandler.execute();$("a[href*=#]").each(function(c,e){var b=$(e);if(b.prop("href").indexOf("AJAXProxy")!=-1){var d=b.prop("href").substr(b.prop("href").indexOf("#"));var a=document.location.toString().replace(/#.*/,"");b.prop("href",a+d)}})},setOption:function(a,b){this.options[a]=b}});WCF.Action.SimpleProxy=Class.extend({init:function(a,b){this.options=$.extend(true,{action:"",className:"",elements:null,eventName:"click"},a);this.callbacks=$.extend(true,{after:null,failure:null,init:null,success:null},b);if(!this.options.elements){return}this.proxy=new WCF.Action.Proxy(this.callbacks);this.options.elements.each($.proxy(function(c,d){$(d).bind(this.options.eventName,$.proxy(this._handleEvent,this))},this))},_handleEvent:function(a){this.proxy.setOption("data",{actionName:this.options.action,className:this.options.className,objectIDs:[$(a.target).data("objectID")]});this.proxy.sendRequest()}});WCF.Action.Delete=Class.extend({_buttonSelector:"",_className:"",_containerSelector:"",_containers:[],init:function(c,a,b){this._containerSelector=a;this._className=c;this._buttonSelector=(b)?b:".jsDeleteButton";this.proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)});this._initElements();WCF.DOMNodeInsertedHandler.addCallback("WCF.Action.Delete"+this._className.hashCode(),$.proxy(this._initElements,this))},_initElements:function(){var a=this;$(this._containerSelector).each(function(c,b){var e=$(b);var d=e.wcfIdentify();if(!WCF.inArray(d,a._containers)){a._containers.push(d);e.find(a._buttonSelector).click($.proxy(a._click,a))}})},_click:function(b){var a=$(b.currentTarget);b.preventDefault();if(a.data("confirmMessage")){WCF.System.Confirmation.show(a.data("confirmMessage"),$.proxy(this._execute,this),{target:a})}else{WCF.LoadingOverlayHandler.updateIcon(a);this._sendRequest(a)}},_didTriggerEffect:function(a){},_execute:function(b,a){if(b==="cancel"){return}WCF.LoadingOverlayHandler.updateIcon(a.target);this._sendRequest(a.target)},_sendRequest:function(a){this.proxy.setOption("data",{actionName:"delete",className:this._className,interfaceName:"wcf\\data\\IDeleteAction",objectIDs:[$(a).data("objectID")]});this.proxy.sendRequest()},_success:function(b,c,a){this.triggerEffect(b.objectIDs)},triggerEffect:function(c){for(var a in this._containers){var d=$("#"+this._containers[a]);if(WCF.inArray(d.find(this._buttonSelector).data("objectID"),c)){var b=this;d.wcfBlindOut("up",function(){$(this).remove();b._containers.splice(b._containers.indexOf($(this).wcfIdentify()),1);b._didTriggerEffect($(this))})}}}});WCF.Action.NestedDelete=WCF.Action.Delete.extend({triggerEffect:function(c){for(var a in this._containers){var d=$("#"+this._containers[a]);if(WCF.inArray(d.find(this._buttonSelector).data("objectID"),c)){if(d.has("ol").has("li").length){if(d.is(":only-child")){d.parent().replaceWith(d.find("> ol"))}else{d.replaceWith(d.find("> ol > li"))}this._containers.splice(this._containers.indexOf(d.wcfIdentify()),1);this._didTriggerEffect(d)}else{var b=this;d.wcfBlindOut("up",function(){$(this).remove();b._containers.splice(b._containers.indexOf($(this).wcfIdentify()),1);b._didTriggerEffect($(this))})}}}}});WCF.Action.Toggle=Class.extend({_buttonSelector:".jsToggleButton",_className:"",_containerSelector:"",_containers:[],init:function(d,a,c){this._containerSelector=a;this._className=d;this._buttonSelector=(c)?c:".jsToggleButton";this._containers=[];var b={success:$.proxy(this._success,this)};this.proxy=new WCF.Action.Proxy(b);this._initElements();WCF.DOMNodeInsertedHandler.addCallback("WCF.Action.Toggle"+this._className.hashCode(),$.proxy(this._initElements,this))},_initElements:function(){$(this._containerSelector).each($.proxy(function(b,a){var d=$(a);var c=d.wcfIdentify();if(!WCF.inArray(c,this._containers)){this._containers.push(c);d.find(this._buttonSelector).click($.proxy(this._click,this))}},this))},_click:function(b){var a=$(b.currentTarget);b.preventDefault();if(a.data("confirmMessage")){WCF.System.Confirmation.show(a.data("confirmMessage"),$.proxy(this._execute,this),{target:a})}else{WCF.LoadingOverlayHandler.updateIcon(a);this._sendRequest(a)}},_execute:function(b,a){if(b==="cancel"){return}WCF.LoadingOverlayHandler.updateIcon(a.target);this._sendRequest(a.target)},_sendRequest:function(a){this.proxy.setOption("data",{actionName:"toggle",className:this._className,interfaceName:"wcf\\data\\IToggleAction",objectIDs:[$(a).data("objectID")]});this.proxy.sendRequest()},_success:function(b,c,a){this.triggerEffect(b.objectIDs)},triggerEffect:function(b){for(var a in this._containers){var d=$("#"+this._containers[a]);var c=d.find(this._buttonSelector);if(WCF.inArray(c.data("objectID"),b)){d.wcfHighlight();this._toggleButton(d,c)}}},_toggleButton:function(b,a){WCF.LoadingOverlayHandler.updateIcon(a,false);if(a.hasClass("icon-check-empty")){a.removeClass("icon-check-empty").addClass("icon-check");$newTitle=(a.data("disableTitle")?a.data("disableTitle"):WCF.Language.get("wcf.global.button.disable"));a.attr("title",$newTitle)}else{a.removeClass("icon-check").addClass("icon-check-empty");$newTitle=(a.data("enableTitle")?a.data("enableTitle"):WCF.Language.get("wcf.global.button.enable"));a.attr("title",$newTitle)}b.toggleClass("disabled")}});WCF.Action.Scroll=Class.extend({_callback:null,_reference:null,_target:null,_threshold:0,init:function(b,d,a,c){this._threshold=parseInt(b);if(this._threshold===0){console.debug("[WCF.Action.Scroll] Given threshold is invalid, aborting.");return}if($.isFunction(d)){this._callback=d}if(this._callback===null){console.debug("[WCF.Action.Scroll] Given callback is invalid, aborting.");return}this._reference=$((a)?a:window);this._target=$((c)?c:document);this.start();this._scroll()},_scroll:function(){var a=this._target.height();var b=this._reference.scrollTop();var c=this._reference.height();if((a-(c+b))<this._threshold){this._callback(this)}},start:function(){this._reference.on("scroll",$.proxy(this._scroll,this))},stop:function(){this._reference.off("scroll")}});WCF.Date={};WCF.Date.Picker={_dateFormat:"yy-mm-dd",_timeFormat:"g:ia",init:function(){var a=$.timepicker.log;$.timepicker.log=function(b){if(b.indexOf("Error parsing the date/time string: Unexpected literal at position")==-1&&b.indexOf("Error parsing the date/time string: Unknown name at position")==-1){a(b)}};this._convertDateFormat();this._initDatePicker();WCF.DOMNodeInsertedHandler.addCallback("WCF.Date.Picker",$.proxy(this._initDatePicker,this))},_convertDateFormat:function(){var a={a:"tt",A:"TT",g:"h",G:"H",h:"hh",H:"HH",i:"mm",s:"ss",u:"l",d:"dd",D:"D",j:"d",l:"DD",z:"o",S:"",F:"MM",m:"mm",M:"M",n:"m",o:"yy",Y:"yy",y:"y",U:"@"};this._dateFormat=WCF.Language.get("wcf.date.dateFormat").replace(/([^dDjlzSFmMnoYyU\\]*(?:\\.[^dDjlzSFmMnoYyU\\]*)*)([dDjlzSFmMnoYyU])/g,function(c,f,e,g,b){for(var d in a){if(e==d){e=a[d]}}return f+e});this._timeFormat=WCF.Language.get("wcf.date.timeFormat").replace(/([^aAgGhHisu\\]*(?:\\.[^aAgGhHisu\\]*)*)([aAgGhHisu])/g,function(c,f,e,g,b){for(var d in a){if(e==d){e=a[d]}}return f+e})},_initDatePicker:function(){$("input[type=date]:not(.jsDatePicker), input[type=datetime]:not(.jsDatePicker)").each($.proxy(function(d,g){var f=$(g);var b=f.prop("name");var j=f.val();var a=f.attr("type")=="datetime";f.prop("type","text").addClass("jsDatePicker");if(f.data("placeholder")){f.attr("placeholder",f.data("placeholder"))}f.removeAttr("name");f.before('<input type="hidden" id="'+f.wcfIdentify()+'DatePicker" name="'+b+'" value="'+j+'" />');var c=f.attr("max")?new Date(f.attr("max").replace(" ","T")):null;var k=f.attr("min")?new Date(f.attr("min").replace(" ","T")):null;$options={altField:"#"+f.wcfIdentify()+"DatePicker",altFormat:"yy-mm-dd",beforeShow:function(n,m){setTimeout(function(){m.dpDiv.position({my:"left top",at:"left bottom",collision:"none",of:n})},1)},changeMonth:true,changeYear:true,dateFormat:this._dateFormat,dayNames:WCF.Language.get("__days"),dayNamesMin:WCF.Language.get("__daysShort"),dayNamesShort:WCF.Language.get("__daysShort"),firstDay:parseInt(WCF.Language.get("wcf.date.firstDayOfTheWeek"))||0,isRTL:WCF.Language.get("wcf.global.pageDirection")=="rtl",maxDate:c,minDate:k,monthNames:WCF.Language.get("__months"),monthNamesShort:WCF.Language.get("__monthsShort"),showButtonPanel:false,onClose:function(n,m){if(n==""){$(m.settings.altField).val(n)}},showOtherMonths:true,yearRange:(f.hasClass("birthday")?"-100:+0":"1900:2038")};if(a){if(/[0-9]{2}:[0-9]{2}:[0-9]{2}$/.test(j)){j=j.replace(/:[0-9]{2}$/,"");f.val(j)}j=j.replace(" ","T");if(f.data("ignoreTimezone")){var i=new Date().getTimezoneOffset();var l=(i>0)?"-":"+";i=Math.abs(i);var e=(Math.floor(i/60)).toString();var h=(i%60).toString();l+=(e.length==2)?e:"0"+e;l+=":";l+=(h.length==2)?h:"0"+h;j=j.replace(/[+-][0-9]{2}:[0-9]{2}$/,l)}$options=$.extend($options,{altFieldTimeOnly:false,altTimeFormat:"HH:mm",controlType:"select",hourText:WCF.Language.get("wcf.date.hour"),minuteText:WCF.Language.get("wcf.date.minute"),showTime:false,timeFormat:this._timeFormat,yearRange:(f.hasClass("birthday")?"-100:+0":"1900:2038")})}if(a){f.datetimepicker($options)}else{f.datepicker($options)}if(j){if(!a){j=new Date(j);j.setMinutes(j.getMinutes()+j.getTimezoneOffset())}f.datepicker("setDate",j)}f.datepicker("widget").hide()},this))}};WCF.Date.Util={gmdate:function(a){var b=(a)?a:new Date();return Math.round(Date.UTC(b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDay(),b.getUTCHours(),b.getUTCMinutes(),b.getUTCSeconds())/1000)},getTimezoneDate:function(b,c){var d=new Date(b);var a=d.getTimezoneOffset()*60000;return new Date((b+a+c))}};WCF.Date.Time=Class.extend({_date:0,_elements:null,_offset:null,_timestamp:0,init:function(){this._elements=$("time.datetime");this._offset=null;this._timestamp=0;this._refresh();new WCF.PeriodicalExecuter($.proxy(this._refresh,this),60000);WCF.DOMNodeInsertedHandler.addCallback("WCF.Date.Time",$.proxy(this._domNodeInserted,this))},_domNodeInserted:function(){this._elements=$("time.datetime");this._refresh()},_refresh:function(){this._date=new Date();this._timestamp=(this._date.getTime()-this._date.getMilliseconds())/1000;if(this._offset===null){this._offset=this._timestamp-TIME_NOW}this._elements.each($.proxy(this._refreshElement,this))},_refreshElement:function(i,f){var n=$(f);if(!n.attr("title")){n.attr("title",n.text())}var d=n.data("timestamp")+this._offset;var b=n.data("date");var c=n.data("time");var o=n.data("offset");if(n.data("isFutureDate")){return}if(d>=this._timestamp||this._timestamp<(d+60)){n.text(WCF.Language.get("wcf.date.relative.now"))}else{if(this._timestamp<(d+3540)){var m=Math.max(Math.round((this._timestamp-d)/60),1);n.text(WCF.Language.get("wcf.date.relative.minutes",{minutes:m}))}else{if(this._timestamp<(d+86400)){var k=Math.round((this._timestamp-d)/3600);n.text(WCF.Language.get("wcf.date.relative.hours",{hours:k}))}else{if(this._timestamp<(d+518400)){var j=new Date(this._date.getFullYear(),this._date.getMonth(),this._date.getDate());var l=Math.ceil((j/1000-d)/86400);var g=WCF.Date.Util.getTimezoneDate((d*1000),o*1000);var h=g.getDay();var e=WCF.Language.get("__days")[h];n.text(WCF.Language.get("wcf.date.relative.pastDays",{days:l,day:e,time:c}))}else{var a=WCF.Language.get("wcf.date.shortDateTimeFormat");n.text(a.replace(/\%date\%/,b).replace(/\%time\%/,c))}}}}}});WCF.Dictionary=Class.extend({_variables:{},init:function(){this._variables={}},add:function(a,b){this._variables[a]=b},addObject:function(a){for(var b in a){this.add(b,a[b])}},addDictionary:function(a){a.each($.proxy(function(b){this.add(b.key,b.value)},this))},get:function(a){if(this.isset(a)){return this._variables[a]}return null},isset:function(a){return this._variables.hasOwnProperty(a)},remove:function(a){delete this._variables[a]},each:function(d){if(!$.isFunction(d)){return}for(var c in this._variables){var a=this._variables[c];var b={key:c,value:a};d(b)}},count:function(){return $.getLength(this._variables)},isEmpty:function(){return !this.count()}});WCF.Language={_variables:new WCF.Dictionary(),add:function(a,b){this._variables.add(a,b)},addObject:function(a){this._variables.addObject(a)},get:function(a,b){if(b==null){var b={}}var c=this._variables.get(a);if(c===null){return a}else{if(typeof c==="string"){this.add(a,new WCF.Template(c));return this.get(a,b)}else{if(typeof c.fetch==="function"){c=c.fetch(b)}}}return c}};WCF.MultipleLanguageInput=Class.extend({_availableLanguages:{},_button:null,_didInit:false,_element:null,_insertedDataAfterInit:false,_isEnabled:false,_forceSelection:false,_languageID:0,_list:null,_values:null,init:function(c,b,d,f){this._button=null;this._element=$("#"+$.wcfEscapeID(c));this._forceSelection=b;this._values=d;this._availableLanguages=f;if($.getLength(this._values)){for(var e in this._values){this._values[e]=WCF.String.unescapeHTML(this._values[e])}}this._languageID=LANGUAGE_ID;if(this._element.length==0){console.debug("[WCF.MultipleLanguageInput] element id '"+c+"' is unknown");return}var a=($.getLength(this._values)>0)?true:false;this._insertedDataAfterInit=a;this._prepareElement(a);this._element.parents("form").submit($.proxy(this._submit,this));this._didInit=true},_prepareElement:function(a){this._element.wrap('<div class="dropdown preInput" />');var c=this._element.parent();this._button=$('<p class="button dropdownToggle"><span>'+WCF.Language.get("wcf.global.button.disabledI18n")+"</span></p>").prependTo(c);this._list=$('<ul class="dropdownMenu"></ul>').insertAfter(this._button);if(this._button.nextAll("textarea").length){this._button.addClass("dropdownCaptionTextarea")}else{this._button.addClass("dropdownCaption")}for(var b in this._availableLanguages){$("<li><span>"+this._availableLanguages[b]+"</span></li>").data("languageID",b).click($.proxy(this._changeLanguage,this)).appendTo(this._list)}if(!this._forceSelection){$('<li class="dropdownDivider" />').appendTo(this._list);$("<li><span>"+WCF.Language.get("wcf.global.button.disabledI18n")+"</span></li>").click($.proxy(this._disable,this)).appendTo(this._list)}WCF.Dropdown.initDropdown(this._button,a);if(a||this._forceSelection){this._isEnabled=true;this._list.children("li").each($.proxy(function(d,f){var e=$(f);if(e.data("languageID")==this._languageID){e.trigger("click")}},this))}WCF.Dropdown.registerCallback(c.wcfIdentify(),$.proxy(this._handleAction,this))},_handleAction:function(a,b){if(b==="open"){this._enable()}else{this._closeSelection()}},_enable:function(a){if(!this._isEnabled){var b=(this._button.is("p"))?this._button.children("span:eq(0)"):this._button;b.addClass("active");this._isEnabled=true}if(this._list.is(":visible")){this._showSelection()}},_showSelection:function(){if(this._isEnabled){this._list.children("li").each($.proxy(function(b,d){var c=$(d);var a=c.data("languageID");if(a){if(this._values[a]&&this._values[a]!=""){c.removeClass("missingValue")}else{c.addClass("missingValue")}}},this))}},_closeSelection:function(){this._disable()},_changeLanguage:function(a){var b=$(a.currentTarget);this._insertedDataAfterInit=true;if(this._didInit){this._values[this._languageID]=this._element.val()}this._languageID=b.data("languageID");if(this._values[this._languageID]){this._element.val(this._values[this._languageID])}else{this._element.val("")}this._list.children("li").removeClass("active");b.addClass("active");this._button.children("span").addClass("active").text(this._availableLanguages[this._languageID]);if(this._didInit){this._element.blur().focus()}},_disable:function(a){if(a===undefined&&this._insertedDataAfterInit){a=null}if(this._forceSelection||!this._list||a===null){return}this._button.children("span").removeClass("active").text(WCF.Language.get("wcf.global.button.disabledI18n"));if(this._values[LANGUAGE_ID]){this._element.val(this._values[LANGUAGE_ID])}else{this._element.val()}if(a){this._list.children("li").removeClass("active");$(a.currentTarget).addClass("active")}this._element.blur().focus();this._insertedDataAfterInit=false;this._isEnabled=false;this._values={}},_submit:function(){if(!this._isEnabled){return 3735928559}if(this._languageID){this._values[this._languageID]=this._element.val()}var b=$(this._element.parents("form")[0]);var c=this._element.wcfIdentify();for(var a in this._availableLanguages){if(this._values[a]===undefined){this._values[a]=""}$('<input type="hidden" name="'+c+"_i18n["+a+']" value="'+WCF.String.escapeHTML(this._values[a])+'" />').appendTo(b)}this._element.removeAttr("name")}});WCF.Number={round:function(b,a){a=Math.pow(10,(a||0));return Math.round(b*a)/a}};WCF.String={addThousandsSeparator:function(a){return String(a).replace(/(^-?\d{1,3}|\d{3})(?=(?:\d{3})+(?:$|\.))/g,"$1"+WCF.Language.get("wcf.global.thousandsSeparator"))},escapeHTML:function(a){return String(a).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},escapeRegExp:function(a){return String(a).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")},formatNumeric:function(b,a){b=String(WCF.Number.round(b,a||2));numberParts=b.split(".");b=this.addThousandsSeparator(numberParts[0]);if(numberParts.length>1){b+=WCF.Language.get("wcf.global.decimalPoint")+numberParts[1]}b=b.replace("-","\u2212");return b},lcfirst:function(a){return String(a).substring(0,1).toLowerCase()+a.substring(1)},ucfirst:function(a){return String(a).substring(0,1).toUpperCase()+a.substring(1)},unescapeHTML:function(a){return String(a).replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">")}};WCF.TabMenu={_containers:{},_didInit:false,init:function(){var d=$(".tabMenuContainer:not(.staticTabMenuContainer)");var c=this;d.each(function(f,e){var h=$(e);var g=h.wcfIdentify();if(c._containers[g]){return true}if(h.data("store")&&!$("#"+h.data("store")).length){$('<input type="hidden" name="'+h.data("store")+'" value="" id="'+h.data("store")+'" />').appendTo(h.parents("form").find(".formSubmit"))}c._containers[g]=h;h.wcfTabs({active:false,activate:function(j,i){var l=$(i.newPanel);var k=l.closest(".tabMenuContainer");var m=k;while(true){if(m.data("isParent")===undefined){break}if(m.data("isParent")){if(m.data("store")){$("#"+m.data("store")).val(l.attr("id"))}break}else{m=m.data("parent")}}if(WCF.TabMenu._didInit){if(l.data("inTabMenu")==undefined){l.data("inTabMenu",(l.parents(".dialogContainer").length))}if(!l.data("inTabMenu")){if(window.history){window.history.pushState(null,document.title,window.location.toString().replace(/#.+$/,"")+"#"+l.attr("id"))}else{location.hash="#"+l.attr("id")}}}}});h.data("isParent",(h.children(".tabMenuContainer, .tabMenuContent").length>0)).data("parent",false);if(!h.data("isParent")){if(h.parent().hasClass("tabMenuContainer")){h.data("parent",h.parent())}}});if(!this._didInit){this._selectActiveTab();$(window).bind("hashchange",$.proxy(this.selectTabs,this));if(!this._selectErroneousTab()){this.selectTabs()}if($.browser.mozilla&&location.hash){var a=$(location.hash);if(a.length&&a.hasClass("tabMenuContent")){var b=a.offset();window.scrollTo(b.left,b.top)}}}this._didInit=true},reload:function(){this._containers={};this.init()},_selectErroneousTab:function(){var d=false;for(var a in this._containers){var c=this._containers[a];if(c.find(".formError").length){d=true;if(!c.data("isParent")){while(true){if(c.data("parent")===false){break}c=c.data("parent").wcfTabs("selectTab",c.wcfIdentify())}return true}}}if(d){for(var a in this._containers){var c=this._containers[a];var b=c.find(".formError:eq(0)");if(b.length){c.wcfTabs("selectTab",b.parents(".tabMenuContent").wcfIdentify());while(true){if(c.data("parent")===false){break}c=c.data("parent").wcfTabs("selectTab",c.wcfIdentify())}return true}}}return false},_selectActiveTab:function(){for(var b in this._containers){var e=this._containers[b];if(e.data("active")){var a=e.data("active");var d=null;if(/-/.test(a)){var c=a.split("-");a=c[0];d=c[1]}e.find(".tabMenuContent").each(function(h,g){var f=$(g);if(f.wcfIdentify()==a){e.wcfTabs("select",h);if(d!==null){if(f.hasClass("tabMenuContainer")){f.wcfTabs("selectTab",e.data("active"))}else{e.wcfTabs("selectTab",e.data("active"))}}return false}})}}},selectTabs:function(){if(location.hash){var a=location.hash.substr(1);var b=$("#"+$.wcfEscapeID(a));if(b.length===1&&b.hasClass("ui-tabs-panel")){b=b.parent(".ui-tabs");if(b.length){b.wcfTabs("selectTab",a);if(b.hasClass("ui-tabs-panel")){a=b.wcfIdentify();b=b.parent(".ui-tabs");if(b.length){b.wcfTabs("selectTab",a)}}return true}}}return false}};WCF.Template=Class.extend({init:function(d){var f=new WCF.Dictionary();var a=0;d=d.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/(\r\n|\n|\r)/g,"\\n");d=d.replace(/\{literal\}(.*?)\{\/literal\}/g,$.proxy(function(e){var i="@@@@@@@@@@@"+Math.random()+"@@@@@@@@@@@";f.add(i,e.replace(/\{\/?literal\}/g,""));return i},this));d=d.replace(/\{\*.*?\*\}/g,"");var c=function(q){var l=q.split("");var i={};var k=true;var s="";var o="";var m=false;var n=false;var j=false;for(var p=0,e=l.length;p<e;p++){var r=l[p];if(k&&r!="="&&r!=" "){s+=r}else{if(k&&r=="="){k=false;n=false;m=false;j=false}else{if(!k&&!n&&!m&&r==" "){k=true;i[s]=o;o=s=""}else{if(!k&&n&&!j&&r=="'"){n=false;o+=r}else{if(!k&&!n&&!m&&r=="'"){n=true;o+=r}else{if(!k&&m&&!j&&r=='"'){m=false;o+=r}else{if(!k&&!n&&!m&&r=='"'){m=true;o+=r}else{if(!k&&(m||n)&&!j&&r=="\\"){j=true;o+=r}else{if(!k){j=false;o+=r}}}}}}}}}}i[s]=o;if(m||n||j){throw new Error('Syntax error in parameterList: "'+q+'"')}return i};var h=function(e){return e.replace(/\\n/g,"\n").replace(/\\\\/g,"\\").replace(/\\'/g,"'")};d=d.replace(/\{(\$[^\}]+?)\}/g,function(e,i){i=h(i.replace(/\$([^.\[\s]+)/g,"(v['$1'])"));return"' + WCF.String.escapeHTML("+i+") + '"}).replace(/\{#(\$[^\}]+?)\}/g,function(e,i){i=h(i.replace(/\$([^.\[\s]+)/g,"(v['$1'])"));return"' + WCF.String.formatNumeric("+i+") + '"}).replace(/\{@(\$[^\}]+?)\}/g,function(e,i){i=h(i.replace(/\$([^.\[\s]+)/g,"(v['$1'])"));return"' + "+i+" + '"}).replace(/{lang}(.+?){\/lang}/g,function(e,i){return"' + WCF.Language.get('"+h(i)+"') + '"}).replace(/\{if (.+?)\}/g,function(e,i){i=h(i.replace(/\$([^.\[\s]+)/g,"(v['$1'])"));return"';\nif ("+i+") {\n     $output += '"}).replace(/\{else ?if (.+?)\}/g,function(e,i){i=h(i.replace(/\$([^.\[\s]+)/g,"(v['$1'])"));return"';\n}\nelse if ("+i+") {\n      $output += '"}).replace(/\{implode (.+?)\}/g,function(e,j){a++;j=j.replace(/\\\\/g,"\\").replace(/\\'/g,"'");var i=c(j);if(typeof i.from==="undefined"){throw new Error("Missing from attribute in implode-tag")}if(typeof i.item==="undefined"){throw new Error("Missing item attribute in implode-tag")}if(typeof i.glue==="undefined"){i.glue="', '"}i.from=i.from.replace(/\$([^.\[\s]+)/g,"(v.$1)");return"';\nvar $implode_"+a+" = false;\nfor ($implodeKey_"+a+" in "+i.from+") {\n      v["+i.item+"] = "+i.from+"[$implodeKey_"+a+"];\n"+(typeof i.key!=="undefined"?"         v["+i.key+"] = $implodeKey_"+a+";\n":"")+"      if ($implode_"+a+") $output += "+i.glue+";\n    $implode_"+a+" = true;\n        $output += '"}).replace(/\{foreach (.+?)\}/g,function(e,j){a++;j=j.replace(/\\\\/g,"\\").replace(/\\'/g,"'");var i=c(j);if(typeof i.from==="undefined"){throw new Error("Missing from attribute in foreach-tag")}if(typeof i.item==="undefined"){throw new Error("Missing item attribute in foreach-tag")}i.from=i.from.replace(/\$([^.\[\s]+)/g,"(v.$1)");return"';\n$foreach_"+a+" = false;\nfor ($foreachKey_"+a+" in "+i.from+") {\n        $foreach_"+a+" = true;\n        break;\n}\nif ($foreach_"+a+") {\n      for ($foreachKey_"+a+" in "+i.from+") {\n               v["+i.item+"] = "+i.from+"[$foreachKey_"+a+"];\n"+(typeof i.key!=="undefined"?"         v["+i.key+"] = $foreachKey_"+a+";\n":"")+"              $output += '"}).replace(/\{foreachelse\}/g,"';\n        }\n}\nelse {\n  {\n             $output += '").replace(/\{\/foreach\}/g,"';\n   }\n}\n$output += '").replace(/\{else\}/g,"';\n}\nelse {\n       $output += '").replace(/\{\/(if|implode)\}/g,"';\n}\n$output += '");for(var b in WCF.Template.callbacks){d=WCF.Template.callbacks[b](d)}d=d.replace("{ldelim}","{").replace("{rdelim}","}");f.each(function(e){d=d.replace(e.key,e.value)});d="$output += '"+d+"';";try{this.fetch=new Function("v","if (typeof v != 'object') { v = {}; } v.__window = window; v.__wcf = window.WCF; var $output = ''; "+d+" return $output;")}catch(g){console.debug("var $output = ''; "+d+" return $output;");throw g}},fetch:function(a){}});WCF.Template.callbacks=[];WCF.ToggleOptions=Class.extend({_element:null,_showItems:[],_hideItems:[],_callback:null,init:function(c,a,b,d){this._element=$("#"+c);this._showItems=a;this._hideItems=b;if(d!==undefined){this._callback=d}this._element.click($.proxy(this._toggle,this));this._toggle()},_toggle:function(){if(!this._element.prop("checked")){return}for(var c=0,b=this._showItems.length;c<b;c++){var a=this._showItems[c];$("#"+a).show()}for(var c=0,b=this._hideItems.length;c<b;c++){var a=this._hideItems[c];$("#"+a).hide()}if(this._callback!==null){this._callback()}}});WCF.Collapsible={};WCF.Collapsible.Simple={init:function(){$(".jsCollapsible").each($.proxy(function(a,b){this._initButton(b)},this))},_initButton:function(a){var c=$(a);var b=c.data("isOpen");if(!b){$("#"+c.data("collapsibleContainer")).hide()}c.click($.proxy(this._toggle,this))},_toggle:function(b){var d=$(b.currentTarget);var c=d.data("isOpen");var a=$("#"+$.wcfEscapeID(d.data("collapsibleContainer")));if(c){a.stop().wcfBlindOut("vertical",$.proxy(function(){this._toggleImage(d)},this));c=false}else{a.stop().wcfBlindIn("vertical",$.proxy(function(){this._toggleImage(d)},this));c=true}d.data("isOpen",c);b.stopPropagation();return false},_toggleImage:function(b){var a=b.find("span.icon");if(b.data("isOpen")){a.removeClass("icon-chevron-right").addClass("icon-chevron-down")}else{a.removeClass("icon-chevron-down").addClass("icon-chevron-right")}}};WCF.Collapsible.Remote=Class.extend({_className:"",_containers:{},_containerData:{},_proxy:null,init:function(a){this._className=a;this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)});this._init();WCF.DOMNodeInsertedHandler.addCallback("WCF.Collapsible.Remote",$.proxy(this._init,this))},_init:function(a){this._getContainers().each($.proxy(function(c,b){var e=$(b);var d=e.wcfIdentify();if(this._containers[d]===undefined){this._containers[d]=e;this._initContainer(d)}},this))},_initContainer:function(b){var a=this._getTarget(b);var c=this._getButtonContainer(b);var d=this._createButton(b,c);this._containerData[b]={button:d,buttonContainer:c,isOpen:this._containers[b].data("isOpen"),target:a};if(!this._containers[b].data("isOpen")){$("#"+b).addClass("jsCollapsed")}},_getContainers:function(){},_getTarget:function(a){},_getButtonContainer:function(a){},_createButton:function(a,b){var d=this._containers[a].data("isOpen");var c=$('<span class="collapsibleButton jsTooltip pointer icon icon16 icon-'+(d?"chevron-down":"chevron-right")+'" title="'+WCF.Language.get("wcf.global.button.collapsible")+'">').prependTo(b);c.data("containerID",a).click($.proxy(this._toggleContainer,this));return c},_toggleContainer:function(d){var f=$(d.currentTarget);var b=f.data("containerID");var e=this._containerData[b].isOpen;var a=(e)?"open":"close";var c=(e)?"close":"open";this._proxy.setOption("data",{actionName:"loadContainer",className:this._className,interfaceName:"wcf\\data\\ILoadableContainerAction",objectIDs:[this._getObjectID(b)],parameters:$.extend(true,{containerID:b,currentState:a,newState:c},this._getAdditionalParameters(b))});this._proxy.sendRequest();$("#"+b).toggleClass("jsCollapsed")},_exchangeIcon:function(b,a){a=a||"spinner";b.removeClass("icon-chevron-down icon-chevron-right icon-spinner").addClass("icon-"+a)},_getObjectID:function(a){return $("#"+a).data("objectID")},_getAdditionalParameters:function(a){return{}},_updateContent:function(a,b,c){this._containerData[a].target.html(b)},_success:function(d,e,c){if(!d.returnValues.containerID){return}var a=d.returnValues.containerID;if(!this._containers[a]){return}this._containerData[a].isOpen=(d.returnValues.isOpen)?true:false;var b=(d.returnValues.isOpen)?"open":"close";this._updateContent(a,$.trim(d.returnValues.content),b);this._exchangeIcon(this._containerData[a].button,(d.returnValues.isOpen?"chevron-down":"chevron-right"))}});WCF.Collapsible.SimpleRemote=WCF.Collapsible.Remote.extend({init:function(a){this._super(a);this._proxy=new WCF.Action.Proxy({showLoadingOverlay:false})},_initContainer:function(a){this._super(a);if(!this._containerData[a].isOpen){this._containerData[a].target.hide();this._exchangeIcon(this._containerData[a].button,"chevron-right")}},_toggleContainer:function(d){var f=$(d.currentTarget);var b=f.data("containerID");var e=this._containerData[b].isOpen;var a=(e)?"open":"close";var c=(e)?"close":"open";this._proxy.setOption("data",{actionName:"toggleContainer",className:this._className,interfaceName:"wcf\\data\\IToggleContainerAction",objectIDs:[this._getObjectID(b)],parameters:$.extend(true,{containerID:b,currentState:a,newState:c},this._getAdditionalParameters(b))});this._proxy.sendRequest();this._exchangeIcon(this._containerData[b].button,(c==="open"?"chevron-down":"chevron-right"));if(c==="open"){this._containerData[b].target.show()}else{this._containerData[b].target.hide()}$("#"+b).toggleClass("jsCollapsed");this._containerData[b].isOpen=(c==="open"?true:false)}});WCF.Collapsible.Sidebar=Class.extend({_button:null,_buttonHeight:0,_isOpen:false,_mainContainer:null,_proxy:null,_sidebar:null,_sidebarHeight:0,_sidebarName:"",_sidebarOffset:0,_userPanelHeight:0,init:function(){this._sidebar=$(".sidebar:eq(0)");if(!this._sidebar.length){console.debug("[WCF.Collapsible.Sidebar] Could not find sidebar, aborting.");return}this._isOpen=(this._sidebar.data("isOpen"))?true:false;this._sidebarName=this._sidebar.data("sidebarName");this._mainContainer=$("#main");this._sidebarHeight=this._sidebar.height();this._sidebarOffset=this._sidebar.getOffsets("offset").top;this._userPanelHeight=$("#topMenu").outerHeight();this._button=$('<a class="collapsibleButton jsTooltip" title="'+WCF.Language.get("wcf.global.button.collapsible")+'" />').prependTo(this._sidebar);this._button.wrap("<span />");this._button.click($.proxy(this._click,this));this._buttonHeight=this._button.outerHeight();WCF.DOMNodeInsertedHandler.execute();this._proxy=new WCF.Action.Proxy({showLoadingOverlay:false,url:"index.php/AJAXInvoke/?t="+SECURITY_TOKEN+SID_ARG_2ND});$(document).scroll($.proxy(this._scroll,this)).resize($.proxy(this._scroll,this));this._renderSidebar();this._scroll();var a=$(window);this._sidebar.on("webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd",function(){a.trigger("resize")})},_click:function(){this._isOpen=(this._isOpen)?false:true;this._proxy.setOption("data",{actionName:"toggle",className:"wcf\\system\\user\\collapsible\\content\\UserCollapsibleSidebarHandler",isOpen:(this._isOpen?1:0),sidebarName:this._sidebarName});this._proxy.sendRequest();this._renderSidebar()},_scroll:function(){var e=$(window);var b=e.scrollTop();var a=Math.max(b-this._sidebarOffset,0);var c=Math.min(this._mainContainer.height(),(e.height()+b)-this._sidebarOffset);var f=0;if(c===a){f=this._sidebarOffset+this._sidebarHeight}else{f=a+((c-a)/2);var d=Math.max(Math.min(a-this._userPanelHeight,this._userPanelHeight),0);if(d>0){f+=(d/2)}}if((c-a-this._userPanelHeight)<this._buttonHeight){f=f-this._buttonHeight}else{f=Math.max(f-(this._buttonHeight/2),0)}this._button.css({top:f+"px"})},_renderSidebar:function(){if(this._isOpen){$(".sidebarOrientationLeft, .sidebarOrientationRight").removeClass("sidebarCollapsed")}else{$(".sidebarOrientationLeft, .sidebarOrientationRight").addClass("sidebarCollapsed")}this._scroll();if($.browser.msie&&$.browser.version.indexOf("9")===0){$(window).trigger("resize")}}});WCF.User={userID:0,username:"",init:function(a,b){this.userID=a;this.username=b}};WCF.Effect={};WCF.Effect.Scroll=Class.extend({scrollTo:function(c,a,b){if(!c.length){return true}var d=c.getOffsets("offset").top;var f=$(document).height();var e=$(window).height();if(d>f-e){d=f-e;if(d<0){d=0}}if(b===true){$("html,body").scrollTop(d)}else{$("html,body").animate({scrollTop:d},400,function(h,i,g,k,j){return -k*((i=i/j-1)*i*i*i-1)+g})}return false}});WCF.Effect.SmoothScroll=WCF.Effect.Scroll.extend({init:function(){var a=this;$(document).on("click","a[href$=#top],a[href$=#bottom]",function(){var b=$(this.hash);a.scrollTo(b,true);return false})}});WCF.Effect.BalloonTooltip=Class.extend({_didInit:false,_tooltip:null,_viewportDimensions:{},init:function(){if(jQuery.browser.mobile){return}if(!this._didInit){this._tooltip=$('<div id="balloonTooltip" class="balloonTooltip"><span id="balloonTooltipText"></span><span class="pointer"><span></span></span></div>').appendTo($("body")).hide();this._updateViewportDimensions();$(window).resize($.proxy(this._updateViewportDimensions,this));WCF.DOMNodeInsertedHandler.addCallback("WCF.Effect.BalloonTooltip",$.proxy(this.init,this));this._didInit=true}$(".jsTooltip").each($.proxy(this._initTooltip,this))},_updateViewportDimensions:function(){this._viewportDimensions=$(document).getDimensions()},_initTooltip:function(b,c){var a=$(c);if(a.hasClass("jsTooltip")){a.removeClass("jsTooltip");var d=a.attr("title");if(d!==""){a.data("tooltip",d);a.removeAttr("title");a.hover($.proxy(this._mouseEnterHandler,this),$.proxy(this._mouseLeaveHandler,this));a.click($.proxy(this._mouseLeaveHandler,this))}}},_mouseEnterHandler:function(c){var n=$(c.currentTarget);var j=n.attr("title");if(j&&j!==""){n.data("tooltip",j);n.removeAttr("title")}this._tooltip.css({top:"0px",left:"0px"});if(!n.data("tooltip")){this._tooltip.hide();return}this._tooltip.children("span:eq(0)").text(n.data("tooltip"));var l=this._tooltip.find(".pointer");this._tooltip.show();var b=l.outerWidth();this._tooltip.hide();var f=n.getOffsets("offset");var k=n.getDimensions("outer");var m=this._tooltip.getDimensions("outer");var a=this._tooltip.getDimensions("inner");var h=f.left+Math.ceil(k.width/2);var i=Math.ceil(m.width/2);var g="center";if((h-i)<5){g="left"}else{if((this._viewportDimensions.width-5)<(h+i)){g="right"}}if(f.top+k.height+m.height-$(document).scrollTop()<$(window).height()){var e=f.top+k.height+7;this._tooltip.removeClass("inverse");l.css("top",-5)}else{var e=f.top-m.height-7;this._tooltip.addClass("inverse");l.css("top",m.height)}switch(g){case"center":var d=Math.round(f.left-i+(k.width/2));l.css({left:(a.width/2-b/2)+"px"});break;case"left":var d=f.left;l.css({left:"5px"});break;case"right":var d=f.left+k.width-m.width;l.css({left:(a.width-b-5)+"px"});break}this._tooltip.css({top:e+"px",left:d+"px"});this._tooltip.wcfFadeIn()},_mouseLeaveHandler:function(a){this._tooltip.stop().hide().css({opacity:1})}});WCF.CloseOverlayHandler={_callbacks:new WCF.Dictionary(),_isListening:false,addCallback:function(a,b){this._bindListener();if(this._callbacks.isset(a)){console.debug("[WCF.CloseOverlayHandler] identifier '"+a+"' is already bound to a callback");return false}this._callbacks.add(a,b)},removeCallback:function(a){if(this._callbacks.isset(a)){this._callbacks.remove(a)}},_bindListener:function(){if(this._isListening){return}$("body").click($.proxy(this._executeCallbacks,this));this._isListening=true},_executeCallbacks:function(a){this._callbacks.each(function(b){b.value()})}};WCF.DOMNodeInsertedHandler={_callbacks:[],_isExecuting:false,addCallback:function(a,b){this._callbacks.push(b)},_executeCallbacks:function(){if(this._isExecuting){return}this._isExecuting=true;for(var b=0,a=this._callbacks.length;b<a;b++){this._callbacks[b]()}this._isExecuting=false},execute:function(){this._executeCallbacks()}};WCF.DOMNodeRemovedHandler={_callbacks:new WCF.Dictionary(),_isExecuting:false,_isListening:false,addCallback:function(a,b){this._bindListener();if(this._callbacks.isset(a)){console.debug("[WCF.DOMNodeRemovedHandler] identifier '"+a+"' is already bound to a callback");return false}this._callbacks.add(a,b)},removeCallback:function(a){if(this._callbacks.isset(a)){this._callbacks.remove(a)}},_bindListener:function(){if(this._isListening){return}$(document).bind("DOMNodeRemoved",$.proxy(this._executeCallbacks,this));this._isListening=true},_executeCallbacks:function(a){if(this._isExecuting){return}this._isExecuting=true;this._callbacks.each(function(b){b.value(a)});this._isExecuting=false}};WCF.PageVisibilityHandler={_callbacks:new WCF.Dictionary(),_isListening:false,_hiddenFieldName:"",addCallback:function(a,b){this._bindListener();if(this._callbacks.isset(a)){console.debug("[WCF.PageVisibilityHandler] identifier '"+a+"' is already bound to a callback");return false}this._callbacks.add(a,b)},removeCallback:function(a){if(this._callbacks.isset(a)){this._callbacks.remove(a)}},_bindListener:function(){if(this._isListening){return}var a=null;if(typeof document.hidden!=="undefined"){this._hiddenFieldName="hidden";a="visibilitychange"}else{if(typeof document.mozHidden!=="undefined"){this._hiddenFieldName="mozHidden";a="mozvisibilitychange"}else{if(typeof document.msHidden!=="undefined"){this._hiddenFieldName="msHidden";a="msvisibilitychange"}else{if(typeof document.webkitHidden!=="undefined"){this._hiddenFieldName="webkitHidden";a="webkitvisibilitychange"}}}}if(a===null){console.debug("[WCF.PageVisibilityHandler] This browser does not support the page visibility API.")}else{$(document).on(a,$.proxy(this._executeCallbacks,this))}this._isListening=true},_executeCallbacks:function(b){if(this._isExecuting){return}this._isExecuting=true;var a=document[this._hiddenFieldName];this._callbacks.each(function(c){c.value(a)});this._isExecuting=false}};WCF.Table={};WCF.Table.EmptyTableHandler=Class.extend({_options:{},_rowClassName:"",init:function(b,c,a){this._rowClassName=c;this._tableContainer=b;this._options=$.extend(true,{emptyMessage:null,messageType:"info",refreshPage:false,updatePageNumber:false},a||{});WCF.DOMNodeRemovedHandler.addCallback("WCF.Table.EmptyTableHandler."+c,$.proxy(this._remove,this))},_remove:function(e){var d=$(e.target);if(d.hasClass(this._rowClassName)){var c=d.parents("tbody:eq(0)");if(c.children("tr").length==1){if(this._options.emptyMessage){this._tableContainer.replaceWith($("<p />").addClass(this._options.messageType).text(this._options.emptyMessage))}else{if(this._options.refreshPage){if(this._options.updatePageNumber){var a=window.location.href.match(/(\?|&)pageNo=(\d+)/g);if(a){var b=a[a.length-1].match(/\d+/g);if(this._options.updatePageNumber>0){b++}else{b--}window.location=window.location.href.replace(a[a.length-1],a[a.length-1][0]+"pageNo="+b)}}else{window.location.reload()}}else{this._tableContainer.remove()}}}}}});WCF.Search={};WCF.Search.Base=Class.extend({_callback:null,_className:"",_commaSeperated:false,_delay:0,_excludedSearchValues:[],_itemCount:0,_itemIndex:-1,_list:null,_oldSearchString:[],_proxy:null,_searchInput:null,_triggerLength:3,_timer:null,init:function(b,e,a,c,d){if(e!==null&&e!==undefined&&!$.isFunction(e)){console.debug("[WCF.Search.Base] The given callback is invalid, aborting.");return}this._callback=(e)?e:null;this._delay=0;this._excludedSearchValues=[];if(a){this._excludedSearchValues=a}this._searchInput=$(b);if(!this._searchInput.length){console.debug("[WCF.Search.Base] Selector '"+b+"' for search input is invalid, aborting.");return}this._searchInput.keydown($.proxy(this._keyDown,this)).keyup($.proxy(this._keyUp,this)).wrap('<span class="dropdown" />');if($.browser.mozilla&&$.browser.touch){this._searchInput.on("input",$.proxy(this._keyUp,this))}this._list=$('<ul class="dropdownMenu" />').insertAfter(this._searchInput);this._commaSeperated=(c)?true:false;this._oldSearchString=[];this._itemCount=0;this._itemIndex=-1;this._proxy=new WCF.Action.Proxy({showLoadingOverlay:(d!==true?false:true),success:$.proxy(this._success,this),autoAbortPrevious:true});if(this._searchInput.is("input")){this._searchInput.attr("autocomplete","off")}this._searchInput.blur($.proxy(this._blur,this));WCF.Dropdown.initDropdownFragment(this._searchInput.parent(),this._list)},_blur:function(){var a=this;new WCF.PeriodicalExecuter(function(b){if(a._list.is(":visible")){a._clearList(false)}b.stop()},250)},_keyDown:function(a){if(a.which===$.ui.keyCode.ENTER){var b=this._searchInput.parents(".dropdown");if(b.data("disableAutoFocus")){if(this._itemIndex!==-1){a.preventDefault()}}else{if(b.data("preventSubmit")||this._itemIndex!==-1){a.preventDefault()}}}},_keyUp:function(d){switch(d.which){case 37:case 39:return;break;case 38:this._selectPreviousItem();return;break;case 40:this._selectNextItem();return;break;case 13:return this._selectElement(d);break}var b=this._getSearchString(d);if(b===""){this._clearList(true)}else{if(b.length>=this._triggerLength){var c={data:{excludedSearchValues:this._excludedSearchValues,searchString:b}};if(this._delay){if(this._timer!==null){this._timer.stop()}var a=this;this._timer=new WCF.PeriodicalExecuter(function(){a._queryServer(c);a._timer.stop();a._timer=null},this._delay)}else{this._queryServer(c)}}else{this._clearList(false)}}},_queryServer:function(a){this._searchInput.parents(".searchBar").addClass("loading");this._proxy.setOption("data",{actionName:"getSearchResultList",className:this._className,interfaceName:"wcf\\data\\ISearchAction",parameters:this._getParameters(a)});this._proxy.sendRequest()},setDelay:function(a){this._delay=a},_selectNextItem:function(){if(this._itemCount===0){return}this._itemIndex++;if(this._itemIndex===this._itemCount){this._itemIndex=0}this._highlightSelectedElement()},_selectPreviousItem:function(){if(this._itemCount===0){return}this._itemIndex--;if(this._itemIndex===-1){this._itemIndex=this._itemCount-1}this._highlightSelectedElement()},_highlightSelectedElement:function(){this._list.find("li").removeClass("dropdownNavigationItem");this._list.find("li:eq("+this._itemIndex+")").addClass("dropdownNavigationItem")},_selectElement:function(a){if(this._itemCount===0){return true}this._list.find("li.dropdownNavigationItem").trigger("click");return false},_getSearchString:function(d){var a=$.trim(this._searchInput.val());if(this._commaSeperated){var c=d.keyCode||d.which;if(c==$.ui.keyCode.COMMA){return""}var b=a.split(",");var e=b.length;for(var g=0;g<e;g++){b[g]=$.trim(b[g])}for(var g=0;g<e;g++){var f=b[g];if(this._oldSearchString[g]){if(f!=this._oldSearchString[g]){a=f;break}}else{a=f;break}}this._oldSearchString=b}return a},_getParameters:function(a){return a},_success:function(d,f,c){this._clearList(false);this._searchInput.parents(".searchBar").removeClass("loading");if($.getLength(d.returnValues)){for(var e in d.returnValues){var a=d.returnValues[e];this._createListItem(a)}}else{if(!this._handleEmptyResult()){return}}WCF.CloseOverlayHandler.addCallback("WCF.Search.Base",$.proxy(function(){this._clearList()},this));var b=this._searchInput.parents(".dropdown").wcfIdentify();if(!WCF.Dropdown.getDropdownMenu(b).hasClass("dropdownOpen")){WCF.Dropdown.toggleDropdown(b)}this._itemIndex=-1;if(!WCF.Dropdown.getDropdown(b).data("disableAutoFocus")){this._selectNextItem()}},_handleEmptyResult:function(){return false},_createListItem:function(b){var a=$("<li><span>"+WCF.String.escapeHTML(b.label)+"</span></li>").appendTo(this._list);a.data("objectID",b.objectID).data("label",b.label).click($.proxy(this._executeCallback,this));this._itemCount++;return a},_executeCallback:function(d){var a=false;var c=$(d.currentTarget);if(this._commaSeperated){var b=c.data("label");for(var h=0,f=this._oldSearchString.length;h<f;h++){var g=this._oldSearchString[h];if(b.toLowerCase().indexOf(g.toLowerCase())===0){this._oldSearchString[h]=b;this._searchInput.val(this._oldSearchString.join(", "));if($.browser.webkit){this._searchInput.css({display:"block"})}var e=this._searchInput.val().toLowerCase().indexOf(b.toLowerCase())+b.length;this._searchInput.focus().setCaret(e);break}}}else{if(this._callback===null){this._searchInput.val(c.data("label"))}else{a=(this._callback(c.data())===true)?true:false}}this._clearList(a)},_clearList:function(a){if(a&&!this._commaSeperated){this._searchInput.val("")}WCF.Dropdown.getDropdown(this._searchInput.parents(".dropdown").wcfIdentify()).removeClass("dropdownOpen");WCF.Dropdown.getDropdownMenu(this._searchInput.parents(".dropdown").wcfIdentify()).removeClass("dropdownOpen");this._list.end().empty();WCF.CloseOverlayHandler.removeCallback("WCF.Search.Base");this._itemCount=0;this._itemIndex=-1},addExcludedSearchValue:function(a){if(!WCF.inArray(a,this._excludedSearchValues)){this._excludedSearchValues.push(a)}},removeExcludedSearchValue:function(b){var a=$.inArray(b,this._excludedSearchValues);if(a!=-1){this._excludedSearchValues.splice(a,1)}}});WCF.Search.User=WCF.Search.Base.extend({_className:"wcf\\data\\user\\UserAction",_includeUserGroups:false,init:function(c,e,a,b,d){this._includeUserGroups=a;this._super(c,e,b,d)},_getParameters:function(a){a.data.includeUserGroups=this._includeUserGroups?1:0;return a},_createListItem:function(e){var d=this._super(e);var b=null;if(e.icon){b=$(e.icon)}else{if(this._includeUserGroups&&e.type==="group"){b=$('<span class="icon icon16 icon-group" />')}}if(b){var a=d.find("span").detach();var c=$("<div />").addClass("box16").appendTo(d);c.append(b);c.append($("<div />").append(a))}d.data("type",e.type);return d}});WCF.System={};WCF.System.Dependency={};WCF.System.Dependency.Manager={_callbacks:{},_loaded:[],_setupCallbacks:{},register:function(a,b){if(!$.isFunction(b)){console.debug("[WCF.System.Dependency.Manager] Callback for identifier '"+a+"' is invalid, aborting.");return}if(WCF.inArray(a,this._loaded)){setTimeout(function(){b()},1)}else{if(!this._callbacks[a]){this._callbacks[a]=[]}this._callbacks[a].push(b)}},setup:function(a,b){if(!$.isFunction(b)){console.debug("[WCF.System.Dependency.Manager] Setup callback for identifier '"+a+"' is invalid, aborting.");return}if(!this._setupCallbacks[a]){this._setupCallbacks[a]=[]}this._setupCallbacks[a].push(b)},invoke:function(a){if(this._setupCallbacks[a]){for(var c=0,b=this._setupCallbacks[a].length;c<b;c++){this._setupCallbacks[a][c]()}delete this._setupCallbacks[a]}this._loaded.push(a);if(this._callbacks[a]){for(var c=0,b=this._callbacks[a].length;c<b;c++){this._callbacks[a][c]()}delete this._callbacks[a]}}};WCF.System.FlexibleMenu={_containers:{},_containerIDs:[],_dropdowns:{},_dropdownMenus:{},_hasHiddenItems:{},_isWorking:false,_menuItems:{},init:function(){this.registerMenu("mainMenu");this.registerMenu($(".navigationHeader:eq(0)").wcfIdentify());this._registerTabMenus();$(window).resize($.proxy(this.rebuildAll,this));WCF.DOMNodeInsertedHandler.addCallback("WCF.System.FlexibleMenu",$.proxy(this._registerTabMenus,this))},_registerTabMenus:function(){$(".tabMenuContainer:not(.jsFlexibleMenuEnabled)").each(function(a,b){var c=$(b).children("nav");if(c.length&&c.find("> ul:eq(0) > li").length){WCF.System.FlexibleMenu.registerMenu(c.wcfIdentify())}})},registerMenu:function(a){var b=$("#"+a);if(!b.length){console.debug("[WCF.System.FlexibleMenu] Unable to find container identified by '"+a+"', aborting.");return}this._containerIDs.push(a);this._containers[a]=b;this._menuItems[a]=b.find("> ul:eq(0) > li");this._dropdowns[a]=$('<li class="dropdown"><a class="icon icon16 icon-list" /></li>').data("containerID",a).click($.proxy(this._click,this));this._dropdownMenus[a]=$('<ul class="dropdownMenu" />').appendTo(this._dropdowns[a]);this._hasHiddenItems[a]=false;this.rebuild(a);WCF.Dropdown.initDropdown(this._dropdowns[a].children("a"))},rebuildAll:function(){if(this._isWorking){return}this._isWorking=true;for(var b=0,a=this._containerIDs.length;b<a;b++){this.rebuild(this._containerIDs[b])}this._isWorking=false},rebuild:function(i){if(!this._containers[i]){console.debug("[WCF.System.FlexibleMenu] Cannot rebuild unknown container identified by '"+i+"'");return}var c=false;var j=this._containers[i];var b=0;var d=this._menuItems[i].filter(":visible");for(var h=0,e=d.length;h<e;h++){b+=$(d[h]).outerWidth(true)}if(!this._hasHiddenItems[i]){this._dropdowns[i].appendTo(j.children("ul:eq(0)"))}var f=this._dropdowns[i].outerWidth(true);if(!this._hasHiddenItems[i]){this._dropdowns[i].detach()}var a=j.parent().innerWidth();a-=parseInt(j.parent().css("padding-left").replace(/px$/,""))+parseInt(j.parent().css("padding-right").replace(/px$/,""));a-=parseInt(j.css("margin-left").replace(/px$/,""))+parseInt(j.css("margin-right").replace(/px$/,""));a-=parseInt(j.css("padding-left").replace(/px$/,""))+parseInt(j.css("padding-right").replace(/px$/,""));a-=parseInt(j.children("ul:eq(0)").css("padding-left").replace(/px$/,""))+parseInt(j.children("ul:eq(0)").css("padding-right").replace(/px$/,""));if(b>a||(this._hasHiddenItems[i]&&(b>a-f))){var d=d.filter(":not(.active):not(.ui-state-active):visible");a-=f;for(var h=(d.length-1);h>=0;h--){if(b>a){var g=$(d[h]);b-=g.outerWidth(true);g.hide();c=true;this._hasHiddenItems[i]=true}else{break}}if(this._hasHiddenItems[i]){this._dropdowns[i].appendTo(j.children("ul:eq(0)"))}}else{if(this._hasHiddenItems[i]&&b<a){var k=this._menuItems[i].filter(":not(:visible)");a-=f;for(var h=0,e=k.length;h<e;h++){var g=$(k[h]);b+=g.outerWidth();if(h+1==e){a+=f}if(b<a){g.css("display","");c=true}else{break}}if(c){this._hasHiddenItems[i]=(this._menuItems[i].filter(":not(:visible)").length>0);if(!this._hasHiddenItems[i]){this._dropdowns[i].detach()}}}}if(c){this._dropdownMenus[i].empty();this._menuItems[i].filter(":not(:visible)").each($.proxy(function(l,m){$("<li>"+$(m).html()+"</li>").appendTo(this._dropdownMenus[i])},this))}}};WCF.System.Mobile={};WCF.System.Mobile.UX={_enabled:false,_main:null,_sidebar:null,init:function(){this._enabled=false;this._main=$("#main");this._sidebar=this._main.find("> div > div > .sidebar");if($.browser.touch){$("html").addClass("touch")}enquire.register("screen and (max-width: 800px)",{match:$.proxy(this._enable,this),unmatch:$.proxy(this._disable,this),setup:$.proxy(this._setup,this),deferSetup:true});if($.browser.msie&&this._sidebar.width()>305){this._sidebar.css("display","none").css("display","")}},_setup:function(){this._initSidebarToggleButtons();this._initSearchBar();this._initButtonGroupNavigation();WCF.CloseOverlayHandler.addCallback("WCF.System.Mobile.UX",$.proxy(this._closeMenus,this));WCF.DOMNodeInsertedHandler.addCallback("WCF.System.Mobile.UX",$.proxy(this._initButtonGroupNavigation,this))},_enable:function(){this._enabled=true;if($.browser.msie){this._sidebar.css("display","none").css("display","")}},_disable:function(){this._enabled=false;if($.browser.msie){this._sidebar.css("display","none").css("display","")}},_initSidebarToggleButtons:function(){var c=this._main.hasClass("sidebarOrientationLeft");var b=this._main.hasClass("sidebarOrientationRight");if(c||b){var d="wcf.global.sidebar.show"+(c?"Left":"Right")+"Sidebar";if(d===WCF.Language.get(d)||WCF.Language.get(d)===""){d='<span class="icon icon16 icon-double-angle-'+(c?"left":"right")+'" />'}var e="wcf.global.sidebar.hide"+(c?"Left":"Right")+"Sidebar";if(e===WCF.Language.get(e)||WCF.Language.get(e)===""){e='<span class="icon icon16 icon-double-angle-'+(c?"right":"left")+'" />'}var a=this;$('<span class="button small mobileSidebarToggleButton">'+d+"</span>").appendTo($(".content")).click(function(){a._main.addClass("mobileShowSidebar")});$('<span class="button small mobileSidebarToggleButton">'+e+"</span>").appendTo($(".sidebar")).click(function(){a._main.removeClass("mobileShowSidebar")})}},_initSearchBar:function(){var b=$(".searchBar:eq(0)");var a=this;b.click(function(){if(a._enabled){b.addClass("searchBarOpen")}});this._main.click(function(){b.removeClass("searchBarOpen")})},_initButtonGroupNavigation:function(){$(".buttonGroupNavigation:not(.jsMobileButtonGroupNavigation)").each(function(b,a){var d=$(a).addClass("jsMobileButtonGroupNavigation");var c=$('<a class="dropdownLabel"><span class="icon icon24 icon-list" /></a>').prependTo(d);c.click(function(){c.next().toggleClass("open");return false})})},_closeMenus:function(){$(".jsMobileButtonGroupNavigation > ul.open").removeClass("open")}};WCF.System.Notification=Class.extend({_callback:null,_cssClassNames:"",_message:"",_overlay:null,init:function(a,b){this._cssClassNames=b||"success";this._message=a||WCF.Language.get("wcf.global.success");this._overlay=$("#systemNotification");if(!this._overlay.length){this._overlay=$('<div id="systemNotification"><p></p></div>').hide().appendTo(document.body)}},show:function(d,b,a,c){b=parseInt(b);if(!b){b=2000}if(d&&$.isFunction(d)){this._callback=d}this._overlay.children("p").html((a||this._message));this._overlay.children("p").removeClass().addClass((c||this._cssClassNames));new WCF.PeriodicalExecuter($.proxy(this._hide,this),b);this._overlay.wcfFadeIn(undefined,300)},_hide:function(a){if(this._callback!==null){this._callback()}this._overlay.wcfFadeOut(undefined,300);a.stop()}});WCF.System.Confirmation={_callback:null,_dialog:null,_parameters:null,_visible:false,_confirmationButton:null,show:function(c,e,b,a){if(this._visible){console.debug("[WCF.System.Confirmation] Confirmation dialog is already open, refusing action.");return}if(!$.isFunction(e)){console.debug("[WCF.System.Confirmation] Given callback is invalid, aborting.");return}this._callback=e;this._parameters=b;var d=true;if(this._dialog===null){this._createDialog();d=false}this._dialog.find("#wcfSystemConfirmationContent").empty().hide();if(a&&a.length){a.appendTo(this._dialog.find("#wcfSystemConfirmationContent").show())}this._dialog.find("p").text(c);this._dialog.wcfDialog({onClose:$.proxy(this._close,this),onShow:$.proxy(this._show,this),title:WCF.Language.get("wcf.global.confirmation.title")});if(d){this._dialog.wcfDialog("render")}this._confirmationButton.focus();this._visible=true},_createDialog:function(){this._dialog=$('<div id="wcfSystemConfirmation" class="systemConfirmation"><p /><div id="wcfSystemConfirmationContent" /></div>').hide().appendTo(document.body);var a=$('<div class="formSubmit" />').appendTo(this._dialog);this._confirmationButton=$('<button class="buttonPrimary">'+WCF.Language.get("wcf.global.confirmation.confirm")+"</button>").data("action","confirm").click($.proxy(this._click,this)).appendTo(a);$("<button>"+WCF.Language.get("wcf.global.confirmation.cancel")+"</button>").data("action","cancel").click($.proxy(this._click,this)).appendTo(a)},_click:function(a){this._notify($(a.currentTarget).data("action"))},_close:function(){if(this._visible){this._notify("cancel")}},_notify:function(a){this._visible=false;this._dialog.wcfDialog("close");this._callback(a,this._parameters)},_show:function(){this._dialog.find("button.buttonPrimary").blur().focus()}};WCF.System.DisableScrolling={_depth:0,_oldOverflow:null,disable:function(){if($.browser.touch){return}if(this._depth===0){this._oldOverflow=$(document.body).css("overflow");$(document.body).css("overflow","hidden")}this._depth++},enable:function(){if(this._depth===0){return}this._depth--;if(this._depth===0){$(document.body).css("overflow",this._oldOverflow)}}};WCF.System.PageNavigation={_button:null,_description:null,_dialog:null,_elementID:"",_elements:{},_pageNo:null,init:function(a,c){var b=$(a);if(!b.length){return}c=c||null;if(c!==null&&!$.isFunction(c)){console.debug("[WCF.System.PageNavigation] Callback for selector '"+a+"' is invalid, aborting.");return}this._initElements(b,c)},_initElements:function(b,c){var a=this;b.each(function(e,f){var d=$(f);var g=d.wcfIdentify();if(a._elements[g]===undefined){a._elements[g]=d;d.find("li.jumpTo").data("elementID",g).click($.proxy(a._click,a))}}).data("callback",c)},_click:function(b){this._elementID=$(b.currentTarget).data("elementID");if(this._dialog===null){this._dialog=$('<div id="pageNavigationOverlay" />').hide().appendTo(document.body);var c=$("<fieldset><legend>"+WCF.Language.get("wcf.global.page.jumpTo")+"</legend></fieldset>").appendTo(this._dialog);$('<dl><dt><label for="jsPageNavigationPageNo">'+WCF.Language.get("wcf.global.page.jumpTo")+"</label></dt><dd></dd></dl>").appendTo(c);this._pageNo=$('<input type="number" id="jsPageNavigationPageNo" value="1" min="1" max="1" class="tiny" />').keyup($.proxy(this._keyUp,this)).appendTo(c.find("dd"));this._description=$("<small></small>").insertAfter(this._pageNo);var a=$('<div class="formSubmit" />').appendTo(this._dialog);this._button=$('<button class="buttonPrimary">'+WCF.Language.get("wcf.global.button.submit")+"</button>").click($.proxy(this._submit,this)).appendTo(a)}this._button.enable();this._description.html(WCF.Language.get("wcf.global.page.jumpTo.description").replace(/#pages#/,this._elements[this._elementID].data("pages")));this._pageNo.val(this._elements[this._elementID].data("pages")).attr("max",this._elements[this._elementID].data("pages"));this._dialog.wcfDialog({title:WCF.Language.get("wcf.global.page.pageNavigation")})},_keyUp:function(b){if(b.which==$.ui.keyCode.ENTER&&!this._button.prop("disabled")){this._submit();return}var a=parseInt(this._pageNo.val())||0;if(a<1||a>this._pageNo.attr("max")){this._button.disable()}else{this._button.enable()}},_submit:function(){var b=this._elements[this._elementID];if(b.data("callback")===null){var a=b.data("link").replace(/pageNo=%d/,"pageNo="+this._pageNo.val());window.location=a}else{b.data("callback")(this._pageNo.val());this._dialog.wcfDialog("close")}}};WCF.System.KeepAlive=Class.extend({init:function(a){new WCF.PeriodicalExecuter(function(b){new WCF.Action.Proxy({autoSend:true,data:{actionName:"keepAlive",className:"wcf\\data\\session\\SessionAction"},failure:function(){b.stop()},showLoadingOverlay:false,suppressErrors:true})},(a*1000))}});WCF.InlineEditor=Class.extend({_callbacks:[],_dropdowns:{},_elements:{},_notification:null,_options:[],_proxy:null,_updateData:[],init:function(d){var c=$(d);if(!c.length){return}this._setOptions();var b="";for(var f=0,e=this._options.length;f<e;f++){if(this._options[f].isQuickOption){b=this._options[f].optionName;break}}var a=this;c.each(function(i,j){var h=$(j);var k=h.wcfIdentify();var g=a._getTriggerElement(h);if(g===null||g.length!==1){return}g.click($.proxy(a._show,a)).data("elementID",k);if(b){g.disableSelection().data("optionName",b).dblclick($.proxy(a._click,a))}a._elements[k]=h});this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)});WCF.CloseOverlayHandler.addCallback("WCF.InlineEditor",$.proxy(this._closeAll,this));this._notification=new WCF.System.Notification(WCF.Language.get("wcf.global.success"),"success")},_closeAll:function(){for(var a in this._elements){this._hide(a)}},_setOptions:function(){this._options=[]},registerCallback:function(a){if($.isFunction(a)){this._callbacks.push(a)}},_getTriggerElement:function(a){return null},_show:function(b){var g=$(b.currentTarget).data("elementID");var h=null;if(!this._dropdowns[g]){h=this._getTriggerElement(this._elements[g]).addClass("dropdownToggle").wrap('<span class="dropdown" />');this._dropdowns[g]=$('<ul class="dropdownMenu" />').insertAfter(h)}this._dropdowns[g].empty();var c=false;var d="";for(var k=0,i=this._options.length;k<i;k++){var a=this._options[k];if(a.optionName==="divider"){if(d!==""&&d!=="divider"){$('<li class="dropdownDivider" />').appendTo(this._dropdowns[g]);d=a.optionName}}else{if(this._validate(g,a.optionName)||this._validateCallbacks(g,a.optionName)){var f=$("<li><span>"+a.label+"</span></li>").appendTo(this._dropdowns[g]);f.data("elementID",g).data("optionName",a.optionName).data("isQuickOption",(a.isQuickOption?true:false)).click($.proxy(this._click,this));c=true;d=a.optionName}}}if(c){var l=this._dropdowns[g].children().last();if(l.hasClass("dropdownDivider")){l.remove()}var j=null;var e=0;this._dropdowns[g].children().each(function(m,o){var n=$(o);if(!n.hasClass("dropdownDivider")){if(n.data("isQuickOption")){j=n}else{e++}}});if(!e){j.trigger("click");if(h!==null){WCF.Dropdown.close(h.parents(".dropdown").wcfIdentify())}return false}}if(h!==null){WCF.Dropdown.initDropdown(h,true)}return false},_validate:function(a,b){return false},_validateCallbacks:function(a,b){var c=this._callbacks.length;if(c){for(var d=0;d<c;d++){if(this._callbacks[d].validate(this._elements[a],b)){return true}}}return false},_success:function(b,d,a){var c=this._updateData.length;if(!c){return}this._updateState(b);this._updateData=[]},_updateState:function(a){},_click:function(c){var b=$(c.currentTarget);var d=b.data("elementID");var a=b.data("optionName");if(!this._execute(d,a)){this._executeCallback(d,a)}this._hide(d)},_execute:function(a,b){return false},_executeCallback:function(a,b){var c=this._callbacks.length;if(c){for(var d=0;d<c;d++){if(this._callbacks[d].execute(this._elements[a],b)){return true}}}return false},_hide:function(a){if(this._dropdowns[a]){this._dropdowns[a].empty().removeClass("dropdownOpen")}}});WCF.Upload=Class.extend({_name:"__files[]",_buttonSelector:null,_fileListSelector:null,_fileUpload:null,_className:"",_iframe:null,_internalFileID:0,_options:{},_uploadMatrix:[],_supportsAJAXUpload:true,_overlay:null,init:function(c,e,d,b){this._buttonSelector=c;this._fileListSelector=e;this._className=d;this._internalFileID=0;this._options=$.extend(true,{action:"upload",multiple:false,url:"index.php/AJAXUpload/?t="+SECURITY_TOKEN+SID_ARG_2ND},b||{});var a=new XMLHttpRequest();this._supportsAJAXUpload=(a&&("upload" in a)&&("onprogress" in a.upload));this._createButton()},_createButton:function(){if(this._supportsAJAXUpload){this._fileUpload=$('<input type="file" name="'+this._name+'" '+(this._options.multiple?'multiple="true" ':"")+"/>");this._fileUpload.change($.proxy(this._upload,this));var a=$('<p class="button uploadButton"><span>'+WCF.Language.get("wcf.global.button.upload")+"</span></p>");a.prepend(this._fileUpload)}else{var a=$('<p class="button uploadFallbackButton"><span>'+WCF.Language.get("wcf.global.button.upload")+"</span></p>");a.click($.proxy(this._showOverlay,this))}this._insertButton(a)},_insertButton:function(a){this._buttonSelector.append(a)},_removeButton:function(){var a=".uploadButton";if(!this._supportsAJAXUpload){a=".uploadFallbackButton"}this._buttonSelector.find(a).remove()},_upload:function(){var a=this._fileUpload.prop("files");if(a.length){var i=new FormData();var f=this._createUploadMatrix(a);if(!this._uploadMatrix[f].length){return}for(var d=0,c=a.length;d<c;d++){if(this._uploadMatrix[f][d]){var e=this._uploadMatrix[f][d].data("internalFileID");i.append("__files["+e+"]",a[d])}}i.append("actionName",this._options.action);i.append("className",this._className);var b=this._getParameters();for(var h in b){i.append("parameters["+h+"]",b[h])}var g=this;$.ajax({type:"POST",url:this._options.url,enctype:"multipart/form-data",data:i,contentType:false,processData:false,success:function(k,l,j){g._success(f,k)},error:$.proxy(this._error,this),xhr:function(){var j=$.ajaxSettings.xhr();if(j){j.upload.addEventListener("progress",function(k){g._progress(f,k)},false)}return j}})}},_createUploadMatrix:function(b){if(b.length){var c=this._uploadMatrix.length;this._uploadMatrix[c]=[];for(var f=0,d=b.length;f<d;f++){var a=b[f];var e=this._initFile(a);if(!e.hasClass("uploadFailed")){e.data("filename",a.name).data("internalFileID",this._internalFileID++);this._uploadMatrix[c][f]=e}}return c}return null},_success:function(b,a){},_error:function(a,c,b){},_progress:function(c,a){var b=Math.round(a.loaded*100/a.total);for(var d in this._uploadMatrix[c]){this._uploadMatrix[c][d].find("progress").attr("value",b)}},_getParameters:function(){return{}},_initFile:function(a){return $("<li>"+a.name+" ("+a.size+')<progress max="100" /></li>').appendTo(this._fileListSelector)},_showOverlay:function(){if(this._iframe===null){this._iframe=$('<iframe name="__fileUploadIFrame" />').hide().appendTo(document.body)}if(!this._overlay){this._overlay=$('<div><form enctype="multipart/form-data" method="post" action="'+this._options.url+'" target="__fileUploadIFrame" /></div>').hide().appendTo(document.body);var a=this._overlay.find("form");$('<dl class="wide"><dd><input type="file" id="__fileUpload" name="'+this._name+'" '+(this._options.multiple?'multiple="true" ':"")+"/></dd></dl>").appendTo(a);$('<div class="formSubmit"><input type="submit" value="Upload" accesskey="s" /></div></form>').appendTo(a);$('<input type="hidden" name="isFallback" value="1" />').appendTo(a);$('<input type="hidden" name="actionName" value="'+this._options.action+'" />').appendTo(a);$('<input type="hidden" name="className" value="'+this._className+'" />').appendTo(a);var b=this._getParameters();for(var c in b){$('<input type="hidden" name="'+c+'" value="'+b[c]+'" />').appendTo(a)}a.submit($.proxy(function(){var d={name:this._getFilename(),size:""};var f=this._createUploadMatrix([d]);var e=this;this._iframe.data("loading",true).off("load").load(function(){e._evaluateResponse(f)});this._overlay.wcfDialog("close")},this))}this._overlay.wcfDialog({title:WCF.Language.get("wcf.global.button.upload")})},_evaluateResponse:function(b){var a=$.parseJSON(this._iframe.contents().find("pre").html());this._success(b,a)},_getFilename:function(){return $("#__fileUpload").val().split("\\").pop()}});WCF.Upload.Parallel=WCF.Upload.extend({init:function(b,d,c,a){a=$.extend(true,a||{},{multiple:true});this._super(b,d,c,a)},_upload:function(){var b=this._fileUpload.prop("files");for(var h=0,e=b.length;h<e;h++){var a=b[h];var c=new FormData();var g=this._createUploadMatrix(a);if(!this._uploadMatrix[g].length){continue}c.append("__files["+g+"]",a);c.append("actionName",this._options.action);c.append("className",this._className);var d=this._getParameters();for(var f in d){c.append("parameters["+f+"]",d[f])}this._sendRequest(g,c)}},_sendRequest:function(c,b){var a=this;$.ajax({type:"POST",url:this._options.url,enctype:"multipart/form-data",data:b,contentType:false,processData:false,success:function(e,f,d){a._success(c,e)},error:$.proxy(this._error,this),xhr:function(){var d=$.ajaxSettings.xhr();if(d){d.upload.addEventListener("progress",function(e){a._progress(c,e)},false)}return d}})},_createUploadMatrix:function(a){var b=this._initFile(a);if(!b.hasClass("uploadFailed")){b.data("filename",a.name).data("internalFileID",this._internalFileID);this._uploadMatrix[this._internalFileID++]=b;return this._internalFileID-1}return null},_success:function(b,a){},_progress:function(b,a){var c=Math.round(a.loaded*100/a.total);this._uploadMatrix[b].find("progress").attr("value",c)},_showOverlay:function(){if(this._iframe===null){this._iframe=$('<iframe name="__fileUploadIFrame" />').hide().appendTo(document.body)}if(!this._overlay){this._overlay=$('<div><form enctype="multipart/form-data" method="post" action="'+this._options.url+'" target="__fileUploadIFrame" /></div>').hide().appendTo(document.body);var a=this._overlay.find("form");$('<dl class="wide"><dd><input type="file" id="__fileUpload" name="'+this._name+'" '+(this._options.multiple?'multiple="true" ':"")+"/></dd></dl>").appendTo(a);$('<div class="formSubmit"><input type="submit" value="Upload" accesskey="s" /></div></form>').appendTo(a);$('<input type="hidden" name="isFallback" value="1" />').appendTo(a);$('<input type="hidden" name="actionName" value="'+this._options.action+'" />').appendTo(a);$('<input type="hidden" name="className" value="'+this._className+'" />').appendTo(a);var b=this._getParameters();for(var c in b){$('<input type="hidden" name="'+c+'" value="'+b[c]+'" />').appendTo(a)}a.submit($.proxy(function(){var d={name:this._getFilename(),size:""};var f=this._createUploadMatrix(d);var e=this;this._iframe.data("loading",true).off("load").load(function(){e._evaluateResponse(f)});this._overlay.wcfDialog("close")},this))}this._overlay.wcfDialog({title:WCF.Language.get("wcf.global.button.upload")})},_evaluateResponse:function(b){var a=$.parseJSON(this._iframe.contents().find("pre").html());this._success(b,a)}});WCF.Sortable={};WCF.Sortable.List=Class.extend({_additionalParameters:{},_className:"",_containerID:"",_container:null,_notification:null,_offset:0,_options:{},_proxy:null,_structure:{},init:function(a,f,g,d,e,c){this._additionalParameters=c||{};this._containerID=$.wcfEscapeID(a);this._container=$("#"+this._containerID);this._className=f;this._offset=(g)?g:0;this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)});this._structure={};this._options=$.extend(true,{axis:"y",connectWith:"#"+this._containerID+" .sortableList",disableNesting:"sortableNoNesting",doNotClear:true,errorClass:"sortableInvalidTarget",forcePlaceholderSize:true,helper:"clone",items:"li:not(.sortableNoSorting)",opacity:0.6,placeholder:"sortablePlaceholder",tolerance:"pointer",toleranceElement:"> span"},d||{});if(e){$("#"+this._containerID+" .sortableList").sortable(this._options)}else{$("#"+this._containerID+" > .sortableList").nestedSortable(this._options)}if(this._className){var b=this._container.find(".formSubmit");if(!b.length){b=this._container.next(".formSubmit");if(!b.length){console.debug("[WCF.Sortable.Simple] Unable to find form submit for saving, aborting.");return}}b.children('button[data-type="submit"]').click($.proxy(this._submit,this))}},_submit:function(){this._structure={};this._container.find(".sortableList").each($.proxy(function(c,e){var b=$(e);var d=b.data("objectID");if(d!==undefined){b.children(this._options.items).each($.proxy(function(f,h){var g=$(h).data("objectID");if(!this._structure[d]){this._structure[d]=[]}this._structure[d].push(g)},this))}},this));var a=$.extend(true,{data:{offset:this._offset,structure:this._structure}},this._additionalParameters);this._proxy.setOption("data",{actionName:"updatePosition",className:this._className,interfaceName:"wcf\\data\\ISortableAction",parameters:a});this._proxy.sendRequest()},_success:function(b,c,a){if(this._notification===null){this._notification=new WCF.System.Notification(WCF.Language.get("wcf.global.success.edit"))}this._notification.show()}});WCF.Popover=Class.extend({_activeElementID:"",_cancelPopover:false,_data:{},_defaultDimensions:{height:150,width:450},_defaultOrientation:{x:"right",y:"top"},_delay:{show:800,hide:500},_hoverElement:false,_hoverElementID:"",_hoverPopover:false,_margin:20,_peOut:null,_peOverElement:null,_popover:null,_popoverContent:null,_popoverOffset:10,_selector:"",init:function(a){if($.browser.mobile){return}this._activeElementID="";this._cancelPopover=false;this._data={};this._defaultDimensions={height:150,width:450};this._defaultOrientation={x:"right",y:"top"};this._delay={show:800,hide:500};this._hoverElement=false;this._hoverElementID="";this._hoverPopover=false;this._margin=20;this._peOut=null;this._peOverElement=null;this._popoverOffset=10;this._selector=a;this._popover=$('<div class="popover"><span class="icon icon48 icon-spinner"></span><div class="popoverContent"></div></div>').hide().appendTo(document.body);this._popoverContent=this._popover.children(".popoverContent:eq(0)");this._popover.hover($.proxy(this._overPopover,this),$.proxy(this._out,this));this._initContainers();WCF.DOMNodeInsertedHandler.addCallback("WCF.Popover."+a,$.proxy(this._initContainers,this))},_initContainers:function(){if($.browser.mobile){return}var a=$(this._selector);if(!a.length){return}a.each($.proxy(function(c,d){var b=$(d);var e=b.wcfIdentify();if(!this._data[e]){this._data[e]={content:null,isLoading:false};b.hover($.proxy(this._overElement,this),$.proxy(this._out,this));if(b.is("a")&&b.attr("href")){b.click($.proxy(this._cancel,this))}}},this))},_cancel:function(a){this._cancelPopover=true;this._hide(true)},_overElement:function(a){if(this._cancelPopover){return}if(this._peOverElement!==null){this._peOverElement.stop()}var b=$(a.currentTarget).wcfIdentify();this._hoverElementID=b;this._peOverElement=new WCF.PeriodicalExecuter($.proxy(function(c){c.stop();if(this._hoverElementID===b){this._activeElementID=b;this._prepare()}},this),this._delay.show);this._hoverElement=true;this._hoverPopover=false},_prepare:function(){if(this._cancelPopover){return}if(this._peOut!==null){this._peOut.stop()}if(this._popover.is(":visible")){this._hide(true)}if(!this._data[this._activeElementID].loading&&this._data[this._activeElementID].content){this._popoverContent.html(this._data[this._activeElementID].content);WCF.DOMNodeInsertedHandler.execute()}else{this._data[this._activeElementID].loading=true}var a=this._popover.show().getDimensions();if(this._data[this._activeElementID].loading){a={height:Math.max(a.height,this._defaultDimensions.height),width:Math.max(a.width,this._defaultDimensions.width)}}else{a=this._fixElementDimensions(this._popover,a)}this._popover.hide();var b=this._getOrientation(a.height,a.width);this._popover.css(this._getCSS(b.x,b.y));this._popover.removeClass("bottom left right top").addClass(b.x).addClass(b.y);this._show()},_show:function(){if(this._cancelPopover){return}this._popover.stop().show().css({opacity:1}).wcfFadeIn();if(this._data[this._activeElementID].loading){this._popover.children("span").show();this._loadContent()}else{this._popover.children("span").hide();this._popoverContent.css({opacity:1})}},_loadContent:function(){},_insertContent:function(a,e,c){this._data[a]={content:e,loading:false};if(this._activeElementID===a){if(c){var d=this._popoverContent.getDimensions();this._popoverContent.css({height:"auto",width:"auto"});this._popoverContent.html(this._data[a].content);var f=this._popoverContent.getDimensions();this._popoverContent.html("").css({height:d.height+"px",width:d.width+"px"});var b=this;this._popoverContent.animate({height:f.height+"px",width:f.width+"px"},300,function(){b._popover.children("span").hide();b._popoverContent.html(b._data[a].content).css({opacity:0}).animate({opacity:1},200);WCF.DOMNodeInsertedHandler.execute()})}else{this._popover.children("span").hide();this._popoverContent.html(this._data[a].content);WCF.DOMNodeInsertedHandler.execute()}}},_hide:function(b){var a=this;this._popoverContent.stop();this._popover.stop();if(b){a._popover.css({opacity:0}).hide();a._popoverContent.empty().css({height:"auto",opacity:0,width:"auto"})}else{this._popover.wcfFadeOut(function(){a._popoverContent.empty().css({height:"auto",opacity:0,width:"auto"});a._popover.hide()})}},_overPopover:function(){if(this._peOut!==null){this._peOut.stop()}this._hoverElement=false;this._hoverPopover=true},_out:function(a){if(this._cancelPopover){return}this._hoverElementID="";this._hoverElement=false;this._hoverPopover=false;this._peOut=new WCF.PeriodicalExecuter($.proxy(function(b){b.stop();if(!this._hoverElement&&!this._hoverPopover){this._hide(false)}},this),this._delay.hide)},_getOrientation:function(i,a){var h=$("#"+this._activeElementID);var g=h.getOffsets("offset");var f=h.getDimensions();var b=$(document).getDimensions();var e=(this._defaultOrientation.x==="left")?"left":"right";var d=(this._defaultOrientation.y==="bottom")?"bottom":"top";var c=this._evaluateOrientation(e,d,g,f,b,i,a);if(c.flawed){e=(e==="left")?"right":"left";c=this._evaluateOrientation(e,d,g,f,b,i,a);if(c.flawed){e=(e==="right")?"left":"right";d=(d==="bottom")?"top":"bottom";c=this._evaluateOrientation(e,d,g,f,b,i,a);if(c.flawed){e=(e==="left")?"right":"left";c=this._evaluateOrientation(e,d,g,f,b,i,a);if(c.flawed){e=(this._defaultOrientationX==="left")?"left":"right";d=(this._defaultOrientationY==="bottom")?"bottom":"top"}}}}return{x:e,y:d}},_evaluateOrientation:function(g,f,b,h,j,i,a){var d=0,e=0;switch(g){case"left":e=b.left-a;break;case"right":e=j.width-(b.left+a);break}switch(f){case"bottom":d=j.height-(b.top+h.height+this._popoverOffset+i);break;case"top":d=b.top-(i-this._popoverOffset);break}var c=false;if(d<this._margin||e<this._margin){c=true}return{flawed:c,x:e,y:d}},_getCSS:function(d,c){var g={bottom:"auto",left:"auto",right:"auto",top:"auto"};var b=$("#"+this._activeElementID);var e=b.getOffsets("offset");var f=this._fixElementDimensions(b,b.getDimensions());var a=$(window).getDimensions();switch(d){case"left":g.right=a.width-(e.left+f.width);break;case"right":g.left=e.left;break}switch(c){case"bottom":g.top=e.top+(f.height+this._popoverOffset);break;case"top":g.bottom=a.height-(e.top-this._popoverOffset);break}return g},_fixElementDimensions:function(a,b){var c=a.parent().getDimensions();if(c.height<b.height){b.height=c.height}if(c.width<b.width){b.width=c.width}return b}});WCF.EditableItemList=Class.extend({_allowCustomInput:false,_className:"",_data:{},_form:null,_itemList:null,_objectID:0,_objectTypeID:0,_search:null,_searchInput:null,init:function(c,a){this._itemList=$(c);this._searchInput=$(a);this._data={};if(!this._itemList.length||!this._searchInput.length){console.debug("[WCF.EditableItemList] Item list and/or search input do not exist, aborting.");return}this._objectID=this._getObjectID();this._objectTypeID=this._getObjectTypeID();this._itemList.find(".jsEditableItem").click($.proxy(this._click,this));if(!this._itemList.children("ul").length){$("<ul />").appendTo(this._itemList)}this._itemList=this._itemList.children("ul");this._form=this._itemList.parents("form").submit($.proxy(this._submit,this));if(this._allowCustomInput){var b=this;this._searchInput.keydown($.proxy(this._keyDown,this)).on("paste",function(){setTimeout(function(){b._onPaste()},100)})}this._searchInput.parents(".dropdown").data("preventSubmit",true)},_keyDown:function(b){if(b===null||b.which===188||b.which===$.ui.keyCode.ENTER){if(b!==null&&b.which===$.ui.keyCode.ENTER&&this._search){if(this._search._itemIndex!==-1){return false}}var a=$.trim(this._searchInput.val());if(b&&b.which===188){a=a.substring(0,this._searchInput.getCaret())}if(a===""){return true}this.addItem({objectID:0,label:a});if(b&&b.which===188){this._searchInput.val($.trim(this._searchInput.val().substr(this._searchInput.getCaret())))}else{this._searchInput.val("")}if(b!==null){b.stopPropagation()}return false}return true},_onPaste:function(){var b=$.trim(this._searchInput.val());b=b.split(",");for(var d=0,c=b.length;d<c;d++){var a=$.trim(b[d]);if(a===""){continue}this.addItem({objectID:0,label:a})}this._searchInput.val("")},load:function(a){},_click:function(d){var b=$(d.currentTarget);var c=b.data("objectID");var a=b.data("label");if(this._search){this._search.removeExcludedSearchValue(a)}this._removeItem(c,a);b.remove();d.stopPropagation();return false},_getObjectID:function(){return 0},_getObjectTypeID:function(){return 0},addItem:function(b){if(this._data[b.objectID]){if(!(b.objectID===0&&this._allowCustomInput)){return true}}var a=$('<li class="badge">'+WCF.String.escapeHTML(b.label)+"</li>").data("objectID",b.objectID).data("label",b.label).appendTo(this._itemList);a.click($.proxy(this._click,this));if(this._search){this._search.addExcludedSearchValue(b.label)}this._addItem(b.objectID,b.label);return true},clearList:function(){this._itemList.children("li").each($.proxy(function(b,c){var a=$(c);if(this._search){this._search.removeExcludedSearchValue(a.data("label"))}a.remove();this._removeItem(a.data("objectID"),a.data("label"))},this))},_submit:function(){this._keyDown(null)},_addItem:function(b,a){this._data[b]=a},_removeItem:function(b,a){delete this._data[b]},getSearchInput:function(){return this._searchInput}});WCF.Sitemap=Class.extend({_cache:[],_dialog:null,_didInit:false,_proxy:null,init:function(){$("#sitemap").click($.proxy(this._click,this));this._cache=[];this._dialog=null;this._didInit=false;this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)})},_click:function(){if(this._dialog===null){this._dialog=$('<div id="sitemapDialog" />').appendTo(document.body);this._proxy.setOption("data",{actionName:"getSitemap",className:"wcf\\data\\sitemap\\SitemapAction"});this._proxy.sendRequest()}else{this._dialog.wcfDialog("open")}},_success:function(b,c,a){if(this._didInit){this._cache.push(b.returnValues.sitemapName);this._dialog.find("#sitemap_"+b.returnValues.sitemapName).html(b.returnValues.template);this._dialog.wcfDialog("render")}else{this._cache.push(b.returnValues.sitemapName);this._dialog.html(b.returnValues.template);this._dialog.find(".sitemapNavigation").click($.proxy(this._navigate,this));this._dialog.find(".tabMenuContainer").wcfTabs("select","sitemap_"+b.returnValues.sitemapName);this._dialog.wcfDialog({title:WCF.Language.get("wcf.page.sitemap")});this._didInit=true}},_navigate:function(a){var b=$(a.currentTarget).data("sitemapName");if(WCF.inArray(b,this._cache)){this._dialog.find(".tabMenuContainer").wcfTabs("select","sitemap_"+b);this._dialog.wcfDialog("render")}else{this._proxy.setOption("data",{actionName:"getSitemap",className:"wcf\\data\\sitemap\\SitemapAction",parameters:{sitemapName:b}});this._proxy.sendRequest()}}});WCF.Language.Chooser=Class.extend({_callback:null,_dropdown:null,_input:null,init:function(l,g,f,b,k,e){var m=$("#"+l);if(m.length!=1){console.debug("[WCF.Language.Chooser] Invalid container id '"+l+"' given");return}this._input=$("#"+g);if(!this._input.length){this._input=$('<input type="hidden" name="'+g+'" value="'+f+'" />').appendTo(m)}if(k!==undefined){if(!$.isFunction(k)){console.debug("[WCF.Language.Chooser] Given callback is invalid");return}this._callback=k}this._dropdown=$('<div class="dropdown" id="'+l+'-languageChooser" />').appendTo(m);$('<div class="dropdownToggle boxFlag box24" data-toggle="'+l+'-languageChooser"></div>').appendTo(this._dropdown);var c=$('<ul class="dropdownMenu" />').appendTo(this._dropdown);for(var a in b){var i=b[a];var h=$('<li class="boxFlag"><a class="box24"><div class="framed"><img src="'+i.iconPath+'" alt="" class="iconFlag" /></div> <div><h3>'+i.languageName+"</h3></div></a></li>").appendTo(c);h.data("languageID",a).click($.proxy(this._click,this));if(a==f){var d=$(""+h.html());var j=d.children().detach();this._dropdown.children(".dropdownToggle").empty().append(j)}}if(e){$('<li class="dropdownDivider" />').appendTo(c);var h=$("<li><a>"+WCF.Language.get("wcf.global.language.noSelection")+"</a></li>").data("languageID",0).click($.proxy(this._click,this)).appendTo(c);if(f===0){this._dropdown.children(".dropdownToggle").empty().append(h.html())}}WCF.Dropdown.init()},_click:function(e){var d=$(e.currentTarget);var c=d.data("languageID");this._input.val(c);var b=$(""+d.html());var a=(c===0)?b:b.children().detach();this._dropdown.children(".dropdownToggle").empty().append(a);if(this._callback!==null){this._callback(d)}}});WCF.Style={};WCF.Style.Chooser=Class.extend({_dialog:null,_proxy:null,init:function(){$('<li class="styleChooser"><a>'+WCF.Language.get("wcf.style.changeStyle")+"</a></li>").appendTo($("#footerNavigation > ul.navigationItems")).click($.proxy(this._showDialog,this));this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)})},_showDialog:function(){if(this._dialog===null){this._dialog=$('<div id="styleChooser" />').hide().appendTo(document.body);this._loadDialog()}else{this._dialog.wcfDialog({title:WCF.Language.get("wcf.style.changeStyle")})}},_loadDialog:function(){this._proxy.setOption("data",{actionName:"getStyleChooser",className:"wcf\\data\\style\\StyleAction"});this._proxy.sendRequest()},_success:function(b,c,a){if(b.actionName==="changeStyle"){window.location.reload();return}this._dialog.html(b.returnValues.template);this._dialog.find("li").addClass("pointer").click($.proxy(this._click,this));this._showDialog()},_click:function(a){this._proxy.setOption("data",{actionName:"changeStyle",className:"wcf\\data\\style\\StyleAction",objectIDs:[$(a.currentTarget).data("styleID")]});this._proxy.sendRequest()}});WCF.UserPanel=Class.extend({_container:null,_didLoad:false,_link:null,_noItems:"",_revertOnEmpty:true,init:function(a){this._container=$("#"+a);this._didLoad=false;this._revertOnEmpty=true;if(this._container.length!=1){console.debug("[WCF.UserPanel] Unable to find container identfied by '"+a+"', aborting.");return}this._convert()},_convert:function(){this._container.addClass("dropdown");this._link=this._container.children("a").remove();var b=$('<a class="dropdownToggle">'+this._link.html()+"</a>").appendTo(this._container).click($.proxy(this._click,this));var a=$('<ul class="dropdownMenu" />').appendTo(this._container);$('<li class="jsDropdownPlaceholder"><span>'+WCF.Language.get("wcf.global.loading")+"</span></li>").appendTo(a);this._addDefaultItems(a);this._container.dblclick($.proxy(function(){window.location=this._link.attr("href");return false},this));WCF.Dropdown.initDropdown(b,false)},_addDefaultItems:function(a){},_addDivider:function(a){$('<li class="dropdownDivider" />').appendTo(a)},_click:function(){if(this._didLoad){return}new WCF.Action.Proxy({autoSend:true,data:this._getParameters(),success:$.proxy(this._success,this)});this._didLoad=true},_getParameters:function(){return{}},_success:function(c,e,b){var a=WCF.Dropdown.getDropdownMenu(this._container.wcfIdentify());a.children(".jsDropdownPlaceholder").remove();if(c.returnValues&&c.returnValues.template){$(""+c.returnValues.template).prependTo(a);var d=this._container.find(".badge");if(!d.length){d=$('<span class="badge badgeInverse" />').appendTo(this._container.children(".dropdownToggle"));d.before(" ")}d.html(c.returnValues.totalCount);this._after(a)}else{$("<li><span>"+WCF.Language.get(this._noItems)+"</span></li>").prependTo(a);this._container.find(".badge").remove()}},_after:function(a){}});$.widget("ui.wcfDialog",{_closeButton:null,_container:null,_content:null,_overlay:null,_title:null,_titlebar:null,_isOpen:false,options:{autoOpen:true,closable:true,closeButtonLabel:null,closeConfirmMessage:null,closeViaModal:true,hideTitle:false,modal:true,title:"",zIndex:400,onClose:null,onShow:null},_createWidget:function(a,b){if($(b).getTagName()==="script"){console.debug("[ui.wcfDialog] Ignored script tag");this.element=false;return null}$.Widget.prototype._createWidget.apply(this,arguments)},_init:function(){if(this.options.autoOpen){this.open()}$(window).resize($.proxy(this._resize,this))},_create:function(){if(this.options.closeButtonLabel===null){this.options.closeButtonLabel=WCF.Language.get("wcf.global.button.close")}this._container=$('<div class="dialogContainer" />').hide().css({zIndex:this.options.zIndex}).appendTo(document.body);this._titlebar=$('<header class="dialogTitlebar" />').hide().appendTo(this._container);this._title=$('<span class="dialogTitle" />').hide().appendTo(this._titlebar);this._closeButton=$('<a class="dialogCloseButton jsTooltip" title="'+this.options.closeButtonLabel+'"><span /></a>').click($.proxy(this.close,this)).hide().appendTo(this._titlebar);this._content=$('<div class="dialogContent" />').appendTo(this._container);this._setOption("title",this.options.title);this._setOption("closable",this.options.closable);var a=this.element.detach();this._content.html(a);if(this.options.modal){this._overlay=$("#jsWcfDialogOverlay");if(!this._overlay.length){this._overlay=$('<div id="jsWcfDialogOverlay" class="dialogOverlay" />').css({height:"100%",zIndex:399}).hide().appendTo(document.body)}if(this.options.closable&&this.options.closeViaModal){this._overlay.click($.proxy(this.close,this));$(document).keyup($.proxy(function(b){if(b.keyCode&&b.keyCode===$.ui.keyCode.ESCAPE){this.close();b.preventDefault()}},this))}}WCF.DOMNodeInsertedHandler.execute()},_setOption:function(a,b){this.options[a]=b;if(a=="hideTitle"||a=="title"){if(!this.options.hideTitle&&this.options.title!=""){this._title.html(this.options.title).show()}else{this._title.html("")}}else{if(a=="closable"||a=="closeButtonLabel"){if(this.options.closable){this._closeButton.attr("title",this.options.closeButtonLabel).show().find("span").html(this.options.closeButtonLabel);WCF.DOMNodeInsertedHandler.execute()}else{this._closeButton.hide()}}}if((!this.options.hideTitle&&this.options.title!="")||this.options.closable){this._titlebar.show()}else{this._titlebar.hide()}return this},open:function(){if(this.element===false){return}if(this.isOpen()){return}if(this._overlay!==null){WCF.activeDialogs++;if(WCF.activeDialogs===1){this._overlay.show()}}this.render();this._isOpen=true},isOpen:function(){return this._isOpen},close:function(a){if(!this.isOpen()){return}if(this.options.closeConfirmMessage){WCF.System.Confirmation.show(this.options.closeConfirmMessage,$.proxy(function(b){if(b==="confirm"){this._close()}},this))}else{this._close()}if(a!==undefined){a.preventDefault()}},_close:function(){this._isOpen=false;this._container.wcfFadeOut();if(this._overlay!==null){WCF.activeDialogs--;if(WCF.activeDialogs===0){this._overlay.hide()}}if(this.options.onClose!==null){this.options.onClose()}},_resize:function(){if(this.isOpen()){this.render()}},render:function(){if(!this._container.is(":visible")&&this._container.css("top")==="0px"){window.scrollTo(0,0)}this._container.show();this._content.children().show();this._content.css({height:"auto",width:"auto"});this._container.stop();this._content.stop();this._container.show().css("opacity",1);var e=0;if(this._content.find(".formSubmit").length){e=this._content.find(".formSubmit").outerHeight();this._content.addClass("dialogForm").css({marginBottom:e+"px"})}else{this._content.removeClass("dialogForm").css({marginBottom:"0px"})}var b=$(window).getDimensions();if(b.width*0.9>800){this._container.css("maxWidth","800px")}var h=this._container.getDimensions("outer");var d=this._content.getDimensions();var e=h.height-d.height;var g=b.height-e-120;this._content.css({maxHeight:g+"px"});this._determineOverflow();h=this._container.getDimensions("outer");var f=Math.round((b.width-h.width)/2);var a=Math.round((b.height-h.height)/2);var c=Math.round((b.height/100)*20);if(c<a){a=c}this._container.css({left:f+"px",top:a+"px"});this._content.css({height:"auto",width:"auto"});if(!this.isOpen()){this._container.hide();this._container.wcfFadeIn($.proxy(function(){if(this.options.onShow!==null){this.options.onShow()}},this))}},_determineOverflow:function(){var b=$(window).getDimensions();var c=this._content.css("maxHeight");this._content.css("maxHeight","none");var e=this._container.getDimensions("outer");var d="visible";if((b.height*0.8<e.height)||(b.width*0.8<e.width)){d="auto"}this._content.css("overflow",d);this._content.css("maxHeight",c);if(d==="visible"){var a=0;this._content.children().each(function(f,g){a+=$(g).outerHeight()});if(this._content.height()<a){this._content.css("overflow","auto")}}},_getContentDimensions:function(a){var b=this._content.getDimensions();if(a&&b.height>a){b.height=a}return b}});$.widget("ui.wcfSlideshow",{_buttonList:null,_count:0,_index:0,_itemList:null,_items:null,_timer:null,_width:0,options:{cycle:true,cycleInterval:5,itemGap:50,},_create:function(){this._itemList=this.element.children("ul");this._items=this._itemList.children("li");this._count=this._items.length;this._index=0;if(this._count>1){this._initSlideshow()}},_initSlideshow:function(){var b=$(this._items.get(0)).outerHeight();this._items.addClass("slideshowItem");this._width=this.element.css("height",b).innerWidth();this._itemList.addClass("slideshowItemList").css("left",0);this._items.each($.proxy(function(d,e){$(e).show().css({height:b,left:((this._width+this.options.itemGap)*d),width:this._width})},this));this.element.css({height:b,width:this._width}).hover($.proxy(this._hoverIn,this),$.proxy(this._hoverOut,this));this._buttonList=$('<ul class="slideshowButtonList" />').appendTo(this.element);for(var c=0;c<this._count;c++){var a=$('<li><a><span class="icon icon16 icon-circle" /></a></li>').data("index",c).click($.proxy(this._click,this)).appendTo(this._buttonList);if(c==0){a.find(".icon").addClass("active")}}this._resetTimer();$(window).resize($.proxy(this._resize,this))},_resize:function(){this._width=this.element.css("width","auto").innerWidth();this._items.each($.proxy(function(a,b){$(b).css({left:((this._width+this.options.itemGap)*a),width:this._width})},this));this._index--;this.moveTo(null)},_hoverIn:function(){if(this._timer!==null){this._timer.stop()}},_hoverOut:function(){this._resetTimer()},_resetTimer:function(){if(!this.options.cycle){return}if(this._timer!==null){this._timer.stop()}var a=this;this._timer=new WCF.PeriodicalExecuter(function(){a.moveTo(null)},this.options.cycleInterval*1000)},_click:function(a){this.moveTo($(a.currentTarget).data("index"));this._resetTimer()},moveTo:function(a){this._index=(a===null)?this._index+1:a;if(this._index==this._count){this._index=0}$(this._buttonList.find(".icon").removeClass("active").get(this._index)).addClass("active");this._itemList.css("left",this._index*(this._width+this.options.itemGap)*-1);this._trigger("moveTo",null,{index:this._index})},getItem:function(a){if(this._items[a]){return this._items[a]}return null}});$.widget("ui.wcfTabs",$.ui.tabs,{_sanitizeSelector:function(a){return a.replace(/([:\.])/g,"\\$1")},select:function(a){if(!$.isNumeric(a)){this.panels.each(function(c,b){if($(b).wcfIdentify()===a){a=c;return false}});if(!$.isNumeric(a)){console.debug("[ui.wcfTabs] Unable to find panel identified by '"+a+"', aborting.");return}}this._setOption("active",a)},selectTab:function(a){a="#"+a;this.anchors.each(function(c,b){var d=$(b);if(d.prop("hash")===a){d.trigger("click");return false}})},getCurrentIndex:function(){return this.lis.index(this.lis.filter(".ui-tabs-selected"))},hasAnchor:function(b,a){var c=false;this.anchors.each(function(e,d){var g=$(d).attr("href");if(/#.+/.test(g)){var f=g.split("#",2);if(a){f=f[1].split("-",2)}if(f[1]===b){c=true;return false}}});return c},revertToDefault:function(){var a=this.element.data("active");if(!a||a===""){a=0}this.select(a)},_processTabs:function(){var a=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist");this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1});this.anchors=this.tabs.map(function(){return $("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1});this.panels=$();this.anchors.each(function(f,e){var b,c,d=$(e).uniqueId().attr("id"),g=$(e).closest("li"),h=g.attr("aria-controls");b=e.hash;c=a.element.find(a._sanitizeSelector(b));if(c.length){a.panels=a.panels.add(c)}if(h){g.data("ui-tabs-aria-controls",h)}g.attr({"aria-controls":b.substring(1),"aria-labelledby":d});c.attr("aria-labelledby",d)});this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},load:function(a,b){return}});$.widget("ui.wcfPages",{SHOW_LINKS:11,SHOW_SUB_LINKS:20,options:{activePage:1,maxPage:1,nextPage:null,previousPage:null},_create:function(){if(this.options.nextPage===null){this.options.nextPage=WCF.Language.get("wcf.global.page.next")}if(this.options.previousPage===null){this.options.previousPage=WCF.Language.get("wcf.global.page.previous")}this.element.addClass("pageNavigation");this._render()},destroy:function(){$.Widget.prototype.destroy.apply(this,arguments);this.element.children().remove()},_render:function(){if(!this.options.disabled&&this.options.maxPage>1){var g=false;if(this.element.hasClass("hidden")){this.element.removeClass("hidden")}this.element.show();this.element.children().remove();var o=$("<ul />");this.element.append(o);var n=$('<li class="button skip" />');o.append(n);if(this.options.activePage>1){var d=$("<a"+((this.options.previousPage!=null)?(' title="'+this.options.previousPage+'"'):(""))+"></a>");n.append(d);this._bindSwitchPage(d,this.options.activePage-1);var l=$('<span class="icon icon16 icon-double-angle-left" />');d.append(l)}else{var l=$('<span class="icon icon16 icon-double-angle-left" />');n.append(l);n.addClass("disabled").removeClass("button");l.addClass("disabled")}o.append(this._renderLink(1));var a=this.SHOW_LINKS-4;var e=this.options.activePage-2;if(e<0){e=0}var i=this.options.maxPage-(this.options.activePage+1);if(i<0){i=0}if(this.options.activePage>1&&this.options.activePage<this.options.maxPage){a--}var k=a/2;var c=this.options.activePage;var j=this.options.activePage;if(c<1){c=1}if(j<1){j=1}if(j>this.options.maxPage-1){j=this.options.maxPage-1}if(e>=k){c-=k}else{c-=e;j+=k-e}if(i>=k){j+=k}else{j+=i;c-=k-i}j=Math.ceil(j);c=Math.ceil(c);if(c<1){c=1}if(j>this.options.maxPage){j=this.options.maxPage}if(c>1){if(c-1<2){o.append(this._renderLink(2))}else{$('<li class="button jumpTo"><a title="'+WCF.Language.get("wcf.global.page.jumpTo")+'" class="jsTooltip">...</a></li>').appendTo(o);g=true}}for(var m=c+1;m<j;m++){o.append(this._renderLink(m))}if(j<this.options.maxPage){if(this.options.maxPage-j<2){o.append(this._renderLink(this.options.maxPage-1))}else{$('<li class="button jumpTo"><a title="'+WCF.Language.get("wcf.global.page.jumpTo")+'" class="jsTooltip">...</a></li>').appendTo(o);g=true}}o.append(this._renderLink(this.options.maxPage));var h=$('<li class="button skip" />');o.append(h);if(this.options.activePage<this.options.maxPage){var f=$("<a"+((this.options.nextPage!=null)?(' title="'+this.options.nextPage+'"'):(""))+"></a>");h.append(f);this._bindSwitchPage(f,this.options.activePage+1);var b=$('<span class="icon icon16 icon-double-angle-right" />');f.append(b)}else{var b=$('<span class="icon icon16 icon-double-angle-right" />');h.append(b);h.addClass("disabled").removeClass("button");b.addClass("disabled")}if(g){o.data("pages",this.options.maxPage);WCF.System.PageNavigation.init("#"+o.wcfIdentify(),$.proxy(function(p){this.switchPage(p)},this))}}else{this.element.hide()}},_renderLink:function(d,a){var e=$('<li class="button"></li>');if(a!=undefined&&a){e.addClass("break")}if(d!=this.options.activePage){var b=$("<a>"+WCF.String.addThousandsSeparator(d)+"</a>");e.append(b);this._bindSwitchPage(b,d)}else{e.addClass("active");var c=$("<span>"+WCF.String.addThousandsSeparator(d)+"</span>");e.append(c)}return e},_bindSwitchPage:function(a,b){var c=this;a.click(function(){c.switchPage(b)})},switchPage:function(a){this._setOption("activePage",a)},_setOption:function(b,c){if(b=="activePage"){if(c!=this.options[b]&&c>0&&c<=this.options.maxPage){var a=this._trigger("shouldSwitch",undefined,{nextPage:c});if(a||a!==undefined){this.options[b]=c;this._render();this._trigger("switched",undefined,{activePage:c})}else{this._trigger("notSwitched",undefined,{activePage:c})}}}else{this.options[b]=c;if(b=="disabled"){if(c){this.element.children().remove()}else{this._render()}}else{if(b=="maxPage"){this._render()}}}return this},_startInput:function(b){var a=$(b.currentTarget);if(!a.is("a")){a=a.parent("a")}a.hide();var c=a.parent("li").children("input").css("display","block").val("");c.focus()},_stopInput:function(b){var c=$(b.currentTarget);c.css("display","none");var a=c.parent("li");if(a!=undefined&&a!=null){a.children("a").show()}},_handleInput:function(b){var a=($.browser.msie&&$.browser.version=="7.0");if(b.type!="keyup"||a){if(!a||((b.which==13||b.which==27)&&b.type=="keyup")){if(b.which==13){this.switchPage(parseInt($(b.currentTarget).val()))}if(b.which==13||b.which==27){this._stopInput(b);b.stopPropagation()}}}}});WCF.Category={};WCF.Category.NestedList=Class.extend({_categories:{},init:function(){var a=this;$(".jsCategory").each(function(c,d){var b=$(d).data("parentCategoryID",null).change($.proxy(a._updateSelection,a));a._categories[b.val()]=b;var e=[];b.parents("li").find(".jsChildCategory").each(function(h,g){var f=$(g).data("parentCategoryID",b.val()).change($.proxy(a._updateSelection,a));a._categories[f.val()]=f;e.push(f.val());if(f.is(":checked")){b.prop("checked","checked")}});b.data("childCategoryIDs",e)})},_updateSelection:function(b){var a=$(b.currentTarget);var f=a.data("parentCategoryID");if(a.is(":checked")){if(f!==null){this._categories[f].prop("checked","checked")}}else{if(f===null){var e=a.data("childCategoryIDs");for(var d=0,c=e.length;d<c;d++){this._categories[e[d]].prop("checked",false)}}}}});function wcfEval(expression){return eval(expression)};
\ No newline at end of file
+(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);String.prototype.hashCode=function(){var a;var b=0;if(this.length){for(var d=0,c=this.length;d<c;d++){a=this.charCodeAt(d);b=((b<<5)-b)+a;b=b&b}}return b};function shuffle(d){var c=d.length,b,a;while(0!==c){a=Math.floor(Math.random()*c);c-=1;b=d[c];d[c]=d[a];d[a]=b}return this}(function(){var c=navigator.userAgent.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(c)||/(webkit)[ \/]([\w.]+)/.exec(c)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(c)||/(msie) ([\w.]+)/.exec(c)||c.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(c)||[];var a={browser:b[1]||"",version:b[2]||"0"};browser={};if(a.browser){browser[a.browser]=true;browser.version=a.version}if(browser.chrome){browser.webkit=true}else{if(browser.webkit){browser.safari=true}}jQuery.browser=browser;jQuery.browser.touch=(!!("ontouchstart" in window)||(!!("msMaxTouchPoints" in window.navigator)&&window.navigator.msMaxTouchPoints>0));jQuery.browser.smartphone=($("html").css("caption-side")=="bottom");jQuery.browser.editor="redactor";jQuery.browser.ckeditor=false;jQuery.browser.redactor=true;if(jQuery.browser.mozilla&&c.match(/trident/)){jQuery.browser.mozilla=false;jQuery.browser.msie=true}})();(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);var WCF={};$.extend(true,{removeArrayValue:function(b,a){return $.grep(b,function(d,c){return a!==d})},wcfEscapeID:function(a){return a.replace(/(:|\.)/g,"\\$1")},wcfIsset:function(a){return !!$("#"+$.wcfEscapeID(a)).length},getLength:function(a){var c=0;for(var b in a){if(a.hasOwnProperty(b)){c++}}return c}});$.fn.extend({getTagName:function(){return(this.length)?this.get(0).tagName.toLowerCase():""},getDimensions:function(b){var c=css={};var a=false;if(this.is(":hidden")){css=WCF.getInlineCSS(this);a=true;this.css({display:"block",visibility:"hidden"})}switch(b){case"inner":c={height:this.innerHeight(),width:this.innerWidth()};break;case"outer":c={height:this.outerHeight(),width:this.outerWidth()};break;default:c={height:this.height(),width:this.width()};break}if(a){WCF.revertInlineCSS(this,css,["display","visibility"])}return c},getOffsets:function(b){var c=css={};var a=false;if(this.is(":hidden")){css=WCF.getInlineCSS(this);a=true;this.css({display:"block",visibility:"hidden"})}switch(b){case"offset":c=this.offset();break;case"position":default:c=this.position();break}if(a){WCF.revertInlineCSS(this,css,["display","visibility"])}return c},makePositioned:function(a,b){if(a!="absolute"&&a!="fixed"){a="absolute"}var c=this.getOffsets("position");this.css({position:a,left:c.left,margin:0,top:c.top});if(b){this.remove().appentTo("body")}return this},disable:function(){return this.attr("disabled","disabled")},enable:function(){return this.removeAttr("disabled")},wcfIdentify:function(){if(!this.attr("id")){this.attr("id",WCF.getRandomID())}return this.attr("id")},getCaret:function(){if(this.is("input")){if(this.attr("type")!="text"&&this.attr("type")!="password"){return -1}}else{if(!this.is("textarea")){return -1}}var c=0;var b=this.get(0);if(document.selection){this.focus();var a=document.selection.createRange();a.moveStart("character",-this.val().length);c=a.text.length}else{if(b.selectionStart||b.selectionStart=="0"){c=parseInt(b.selectionStart)}}return c},setCaret:function(b){if(this.is("input")){if(this.attr("type")!="text"&&this.attr("type")!="password"){return false}}else{if(!this.is("textarea")){return false}}var c=this.get(0);this.focus();if(document.selection){var a=document.selection.createRange();a.moveStart("character",b);a.moveEnd("character",0);a.select()}else{if(c.selectionStart||c.selectionStart=="0"){c.selectionStart=b;c.selectionEnd=b}}return true},wcfDropIn:function(b,c,a){if(!b){b="up"}if(!a||!parseInt(a)){a=200}return this.show(WCF.getEffect(this,"drop"),{direction:b},a,c)},wcfDropOut:function(b,c,a){if(!b){b="down"}if(!a||!parseInt(a)){a=200}return this.hide(WCF.getEffect(this,"drop"),{direction:b},a,c)},wcfBlindIn:function(b,c,a){if(!b){b="vertical"}if(!a||!parseInt(a)){a=200}return this.show(WCF.getEffect(this,"blind"),{direction:b},a,c)},wcfBlindOut:function(b,c,a){if(!b){b="vertical"}if(!a||!parseInt(a)){a=200}return this.hide(WCF.getEffect(this,"blind"),{direction:b},a,c)},wcfHighlight:function(a,b){return this.effect("highlight",a,600,b)},wcfFadeIn:function(b,a){if(!a||!parseInt(a)){a=200}return this.show(WCF.getEffect(this,"fade"),{},a,b)},wcfFadeOut:function(b,a){if(!a||!parseInt(a)){a=200}return this.hide(WCF.getEffect(this,"fade"),{},a,b)}});$.extend(WCF,{activeDialogs:0,_idCounter:0,getRandomID:function(){var a="";do{a="wcf"+this._idCounter++}while($.wcfIsset(a));return a},inArray:function(b,a){return($.inArray(b,a)!=-1)},getEffect:function(a,b){if(a.is("tr")){return"highlight"}return b},getInlineCSS:function(b){var c={};var a=b.attr("style");if(!a){return{}}a=a.split(";");for(var f=0,d=a.length;f<d;f++){var e=$.trim(a[f]);if(e==""){continue}e=e.split(":");c[$.trim(e[0])]=$.trim(e[1])}return c},revertInlineCSS:function(a,c,e){for(var f=0,d=e.length;f<d;f++){var b=e[f];if(c[b]){a.css(b,c[b])}else{a.css(b,"")}}}});WCF.Browser={_isChrome:null,isChrome:function(){if(this._isChrome===null){this._isChrome=false;if(/chrom(e|ium)/.test(navigator.userAgent.toLowerCase())){this._isChrome=true}}return this._isChrome}};WCF.Dropdown={_callbacks:{},_didInit:false,_dropdowns:{},_menuContainer:null,_menus:{},init:function(){if(this._menuContainer===null){this._menuContainer=$('<div id="dropdownMenuContainer" />').appendTo(document.body)}var a=this;$(".dropdownToggle:not(.jsDropdownEnabled)").each(function(b,c){a.initDropdown($(c),false)});if(!this._didInit){this._didInit=true;WCF.CloseOverlayHandler.addCallback("WCF.Dropdown",$.proxy(this._closeAll,this));WCF.DOMNodeInsertedHandler.addCallback("WCF.Dropdown",$.proxy(this.init,this));$(document).on("scroll",$.proxy(this._scroll,this))}},_dialogScroll:function(b){var a=$(b.currentTarget);a.find(".dropdown.dropdownOpen").each(function(d,f){var i=$(f);var e=i.wcfIdentify();var g=i.offset();var c=a.offset();var h=$(f).height()/2;if(g.top+h<=c.top){WCF.Dropdown.toggleDropdown(e)}else{if(g.top>=c.top+a.height()){WCF.Dropdown.toggleDropdown(e)}else{if(g.left<=c.left){WCF.Dropdown.toggleDropdown(e)}else{if(g.left>=c.left+a.width()){WCF.Dropdown.toggleDropdown(e)}else{WCF.Dropdown.setAlignmentByID(i.wcfIdentify())}}}}})},_scroll:function(b){for(var a in this._dropdowns){var c=this._dropdowns[a];if(c.data("isOverlayDropdownButton")&&c.hasClass("dropdownOpen")){this.setAlignmentByID(a)}}},initDropdown:function(b,d){if(b.hasClass("jsDropdownEnabled")||b.data("target")){return}var e=b.parents(".dropdown");if(!e.length){console.debug("[WCF.Dropdown] Invalid dropdown passed, button '"+b.wcfIdentify()+"' does not have a parent with .dropdown, aborting.");return}var a=b.next(".dropdownMenu");if(!a.length){console.debug("[WCF.Dropdown] Invalid dropdown passed, dropdown '"+e.wcfIdentify()+"' does not have a dropdown menu, aborting.");return}a.detach().appendTo(this._menuContainer);var c=e.wcfIdentify();if(!this._dropdowns[c]){b.addClass("jsDropdownEnabled").click($.proxy(this._toggle,this));this._dropdowns[c]=e;this._menus[c]=a}b.data("target",c);if(d){b.trigger("click")}},removeDropdown:function(a){if(this._menus[a]){$(this._menus[a]).remove();delete this._menus[a];delete this._dropdowns[a]}},initDropdownFragment:function(c,a){var b=c.wcfIdentify();if(this._dropdowns[b]){console.debug("[WCF.Dropdown] Cannot register dropdown identified by '"+b+"' as a fragement.");return}this._dropdowns[b]=c;this._menus[b]=a.detach().appendTo(this._menuContainer)},registerCallback:function(a,b){if(!$.isFunction(b)){console.debug("[WCF.Dropdown] Callback for '"+a+"' is invalid");return false}if(!this._callbacks[a]){this._callbacks[a]=[]}this._callbacks[a].push(b)},_toggle:function(g,e){var b=(g===null)?e:$(g.currentTarget).data("target");var a=this._dropdowns[b];if(a&&a.data("isOverlayDropdownButton")===undefined){var d=a.parents(".dialogContent");a.data("isOverlayDropdownButton",d.length>0);if(d.length){d.on("scroll",this._dialogScroll)}}for(var f in this._dropdowns){var h=this._dropdowns[f];var c=this._menus[f];if(h.hasClass("dropdownOpen")){h.removeClass("dropdownOpen");c.removeClass("dropdownOpen");this._notifyCallbacks(f,"close")}else{if(f===b){h.addClass("dropdownOpen");c.addClass("dropdownOpen");this._notifyCallbacks(f,"open");this.setAlignment(h,c)}}}if(g!==null){g.stopPropagation();return false}},toggleDropdown:function(a){this._toggle(null,a)},getDropdown:function(a){if(this._dropdowns[a]){return this._dropdowns[a]}return null},getDropdownMenu:function(a){if(this._menus[a]){return this._menus[a]}return null},setAlignmentByID:function(a){var c=this.getDropdown(a);if(c===null){console.debug("[WCF.Dropdown] Unable to find dropdown identified by '"+a+"'")}var b=this.getDropdownMenu(a);if(b===null){console.debug("[WCF.Dropdown] Unable to find dropdown menu identified by '"+a+"'")}this.setAlignment(c,b)},setAlignment:function(o,f){if(!f.data("isInitialized")){f.data("isInitialized",true).css({left:0,top:0})}var c=o.getDimensions("outer");var j=o.getOffsets("offset");var k=f.getDimensions("outer");var d=$(window).width();var a=o.find(".dropdownToggle");if(a.hasClass("dropdownCaptionTextarea")){c=a.getDimensions("outer")}var h="left";if((j.left+k.width)>d){h="right"}var b="auto";var n="auto";if(h==="left"){f.removeClass("dropdownArrowRight");b=j.left}else{f.addClass("dropdownArrowRight");n=(d-(j.left+c.width))}if(WCF.Language.get("wcf.global.pageDirection")=="rtl"){var l=b;var g=n;if(b=="auto"){f.removeClass("dropdownArrowRight")}else{n=d-(j.left+c.width);b="auto";if(n+k.width>d){b=l;n=g;f.addClass("dropdownArrowRight")}}}if(b=="auto"){n+="px"}else{b+="px"}var m=true;if(f.hasClass("dropdownOpen")){m=false;f.removeClass("dropdownOpen")}var i="auto";var e=j.top+c.height+7;if(e+k.height>$(window).height()+$(document).scrollTop()){i=$(window).height()-j.top+10;e="auto";f.addClass("dropdownArrowBottom")}else{f.removeClass("dropdownArrowBottom")}if(!m){f.addClass("dropdownOpen")}f.css({bottom:i,left:b,right:n,top:e})},_closeAll:function(){for(var a in this._dropdowns){var b=this._dropdowns[a];if(b.hasClass("dropdownOpen")){b.removeClass("dropdownOpen");this._menus[a].removeClass("dropdownOpen");this._notifyCallbacks(a,"close")}}},close:function(a){if(!this._dropdowns[a]){return}this._dropdowns[a].removeClass("dropdownMenu");this._menus[a].removeClass("dropdownMenu")},_notifyCallbacks:function(a,b){if(!this._callbacks[a]){return}for(var d=0,c=this._callbacks[a].length;d<c;d++){this._callbacks[a][d](a,b)}}};WCF.Clipboard={_actionProxy:null,_actionObjects:{},_containers:null,_containerData:{},_hasMarkedItems:false,_markedObjectIDs:{},_page:"",_pageObjectID:0,_proxy:null,_trackedElements:{},init:function(d,b,e,c){this._page=d;this._actionObjects=e||{};this._hasMarkedItems=(b>0);this._pageObjectID=parseInt(c)||0;this._actionProxy=new WCF.Action.Proxy({success:$.proxy(this._actionSuccess,this),url:"index.php/ClipboardProxy/?t="+SECURITY_TOKEN+SID_ARG_2ND});this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this),url:"index.php/Clipboard/?t="+SECURITY_TOKEN+SID_ARG_2ND});this._containers=$(".jsClipboardContainer").each($.proxy(function(g,f){this._initContainer(f)},this));if(this._hasMarkedItems&&this._containers.length){this._loadMarkedItems()}var a=this;WCF.DOMNodeInsertedHandler.addCallback("WCF.Clipboard",function(){a._containers=$(".jsClipboardContainer").each($.proxy(function(g,f){a._initContainer(f)},a))})},_loadMarkedItems:function(){new WCF.Action.Proxy({autoSend:true,data:{containerData:this._containerData,pageClassName:this._page,pageObjectID:this._pageObjectID},success:$.proxy(this._loadMarkedItemsSuccess,this),url:"index.php/ClipboardLoadMarkedItems/?t="+SECURITY_TOKEN+SID_ARG_2ND})},reload:function(){if(this._containers===null){return}this._loadMarkedItems()},_loadMarkedItemsSuccess:function(d,f,c){this._resetMarkings();for(var a in d.markedItems){if(!this._markedObjectIDs[a]){this._markedObjectIDs[a]=[]}var b=d.markedItems[a];for(var e in b){this._markedObjectIDs[a].push(b[e])}this._containers.each($.proxy(function(h,g){var i=$(g);if(i.data("type")!=a){return true}i.find("input.jsClipboardItem").each($.proxy(function(l,k){var j=$(k);if(WCF.inArray(j.data("objectID"),this._markedObjectIDs[a])){j.prop("checked",true);j.parents(".jsClipboardObject").addClass("jsMarked")}},this));i.find("input.jsClipboardMarkAll").each(function(l,k){var j=true;i.find("input.jsClipboardItem").each(function(n,o){var m=$(o);if(!m.prop("checked")){j=false}});if(j){$(k).prop("checked",true)}})},this))}this._success(d,f,c)},_resetMarkings:function(){this._containers.each($.proxy(function(b,a){var c=$(a);this._markedObjectIDs[c.data("type")]=[];c.find("input.jsClipboardItem, input.jsClipboardMarkAll").prop("checked",false);c.find(".jsClipboardObject").removeClass("jsMarked")},this))},_initContainer:function(a){var c=$(a);var b=c.wcfIdentify();if(!this._trackedElements[b]){c.find(".jsClipboardMarkAll").data("hasContainer",b).click($.proxy(this._markAll,this));this._markedObjectIDs[c.data("type")]=[];this._containerData[c.data("type")]={};$.each(c.data(),$.proxy(function(d,e){if(d.match(/^type(.+)/)){this._containerData[c.data("type")][WCF.String.lcfirst(d.replace(/^type/,""))]=e}},this));this._trackedElements[b]=[]}c.find("input.jsClipboardItem").each($.proxy(function(f,e){var g=$(e);var d=g.wcfIdentify();if(!WCF.inArray(d,this._trackedElements[b])){this._trackedElements[b].push(d);g.data("hasContainer",b).click($.proxy(this._click,this))}},this))},_click:function(f){var b=$(f.target);var e=b.data("objectID");var h=(b.prop("checked"))?true:false;var d=[e];if(b.data("hasContainer")){var g=$("#"+b.data("hasContainer"));var a=g.data("type")}else{var a=b.data("type")}if(h){this._markedObjectIDs[a].push(e);b.parents(".jsClipboardObject").addClass("jsMarked")}else{this._markedObjectIDs[a]=$.removeArrayValue(this._markedObjectIDs[a],e);b.parents(".jsClipboardObject").removeClass("jsMarked")}if(b.data("hasContainer")){var c=true;g.find("input.jsClipboardItem").each(function(j,i){var k=$(i);if(!k.prop("checked")){c=false}});g.find(".jsClipboardMarkAll").each(function(i,j){if(c){$(j).prop("checked",true)}else{$(j).prop("checked",false)}})}this._saveState(a,d,h)},_markAll:function(d){var b=$(d.target);var c=[];var f=true;if(b.is("input")){f=b.prop("checked")}if(b.data("hasContainer")){var e=$("#"+b.data("hasContainer"));var a=e.data("type")}else{var a=b.data("type")}if(b.data("hasContainer")){e.find("input.jsClipboardItem").each($.proxy(function(h,g){var j=$(g);var i=j.data("objectID");if(f){if(!j.prop("checked")){j.prop("checked",true);this._markedObjectIDs[a].push(i);c.push(i)}}else{if(j.prop("checked")){j.prop("checked",false);this._markedObjectIDs[a]=$.removeArrayValue(this._markedObjectIDs[a],i);c.push(i)}}},this));if(f){e.find(".jsClipboardObject").addClass("jsMarked")}else{e.find(".jsClipboardObject").removeClass("jsMarked")}}this._saveState(a,c,f)},_saveState:function(b,c,a){this._proxy.setOption("data",{action:(a)?"mark":"unmark",containerData:this._containerData,objectIDs:c,pageClassName:this._page,pageObjectID:this._pageObjectID,type:b});this._proxy.sendRequest()},_success:function(data,textStatus,jqXHR){var $containers={};$(".jsClipboardEditor").each(function(index,container){var $container=$(container);var $types=eval($container.data("types"));for(var $i=0,$length=$types.length;$i<$length;$i++){var $typeName=$types[$i];$containers[$typeName]=$container}var $containerID=$container.wcfIdentify();WCF.CloseOverlayHandler.removeCallback($containerID);$container.empty()});if(!data.items){return}for(var $typeName in data.items){if(!$containers[$typeName]){continue}var $container=$containers[$typeName];var $list=$container.children("ul");if($list.length==0){$list=$("<ul />").appendTo($container)}var $editor=data.items[$typeName];var $label=$('<li class="dropdown"><span class="dropdownToggle button">'+$editor.label+"</span></li>").appendTo($list);var $itemList=$('<ol class="dropdownMenu"></ol>').appendTo($label);for(var $itemIndex in $editor.items){var $item=$editor.items[$itemIndex];var $listItem=$("<li><span>"+$item.label+"</span></li>").appendTo($itemList);$listItem.data("container",$container);$listItem.data("objectType",$typeName);$listItem.data("actionName",$item.actionName).data("parameters",$item.parameters);$listItem.data("internalData",$item.internalData).data("url",$item.url).data("type",$typeName);$listItem.click($.proxy(this._executeAction,this))}$('<li class="dropdownDivider" />').appendTo($itemList);$("<li><span>"+WCF.Language.get("wcf.clipboard.item.unmarkAll")+"</span></li>").appendTo($itemList).click($.proxy(function(){this._proxy.setOption("data",{action:"unmarkAll",type:$typeName});this._proxy.setOption("success",$.proxy(function(data,textStatus,jqXHR){this._containers.each($.proxy(function(index,container){var $container=$(container);if($container.data("type")==$typeName){$container.find(".jsClipboardMarkAll, .jsClipboardItem").prop("checked",false);$container.find(".jsClipboardObject").removeClass("jsMarked");return false}},this));this._success(data,textStatus,jqXHR);this._proxy.setOption("success",$.proxy(this._success,this))},this));this._proxy.sendRequest()},this));WCF.Dropdown.initDropdown($label.children(".dropdownToggle"),false)}},_closeLists:function(){$(".jsClipboardEditor ul").removeClass("dropdownOpen")},_executeAction:function(e){var c=$(e.currentTarget);var d=c.data("url");if(d){window.location.href=d}if(c.data("parameters").className&&c.data("parameters").actionName){if(c.data("parameters").actionName==="unmarkAll"||c.data("parameters").objectIDs){var b=c.data("internalData")["confirmMessage"];if(b){var a=c.data("internalData")["template"];if(a){a=$(a)}WCF.System.Confirmation.show(b,$.proxy(function(g){if(g==="confirm"){var f={};if(a&&a.length){$("#wcfSystemConfirmationContent").find("input, select, textarea").each(function(i,j){var h=$(j);f[h.prop("name")]=h.val()})}this._executeAJAXActions(c,f)}},this),"",a)}else{this._executeAJAXActions(c,{})}}}c.data("container").trigger("clipboardAction",[c.data("type"),c.data("actionName"),c.data("parameters")])},_executeAJAXActions:function(d,e){e=e||{};var a=[];if(d.data("parameters").actionName!=="unmarkAll"){$.each(d.data("parameters").objectIDs,function(g,h){a.push(parseInt(h))})}var b={data:e,containerData:this._containerData[d.data("type")]};var f=d.data("internalData")["parameters"];if(f!==undefined){for(var c in f){b[c]=f[c]}}new WCF.Action.Proxy({autoSend:true,data:{actionName:d.data("parameters").actionName,className:d.data("parameters").className,objectIDs:a,parameters:b},success:$.proxy(function(g){if(d.data("parameters").actionName!=="unmarkAll"){d.data("container").trigger("clipboardActionResponse",[g,d.data("type"),d.data("actionName"),d.data("parameters")])}this._loadMarkedItems()},this)});if(this._actionObjects[d.data("objectType")]&&this._actionObjects[d.data("objectType")][d.data("parameters").actionName]){this._actionObjects[d.data("objectType")][d.data("parameters").actionName].triggerEffect(a)}},sendRequest:function(b){var a=$(b);this._actionProxy.setOption("data",{parameters:a.data("parameters"),typeName:a.data("type")});this._actionProxy.sendRequest()}};WCF.PeriodicalExecuter=Class.extend({_callback:null,_delay:0,_intervalID:null,_isExecuting:false,init:function(b,a){if(!$.isFunction(b)){console.debug("[WCF.PeriodicalExecuter] Given callback is invalid, aborting.");return}this._callback=b;this._interval=a;this.resume()},_execute:function(){if(!this._isExecuting){try{this._isExecuting=true;this._callback(this);this._isExecuting=false}catch(a){this._isExecuting=false;throw a}}},stop:function(){if(!this._intervalID){return}clearInterval(this._intervalID)},resume:function(){if(this._intervalID){this.stop()}this._intervalID=setInterval($.proxy(this._execute,this),this._interval)}});WCF.LoadingOverlayHandler={_activeRequests:0,_loadingOverlay:null,_pending:null,show:function(){if(this._loadingOverlay===null){this._loadingOverlay=$('<div class="spinner"><span class="icon icon48 icon-spinner" /> <span>'+WCF.Language.get("wcf.global.loading")+"</span></div>").appendTo($("body"));var b=this._loadingOverlay.outerWidth();if(b<70){b=70}this._loadingOverlay.css({marginLeft:Math.ceil(-1*b/2),width:b}).hide()}this._activeRequests++;if(this._activeRequests==1){if(this._pending===null){var a=this;this._pending=new WCF.PeriodicalExecuter(function(c){if(a._activeRequests){a._loadingOverlay.stop(true,true).fadeIn(100)}c.stop();a._pending=null},250)}}},hide:function(){this._activeRequests--;if(this._activeRequests==0){if(this._pending!==null){this._pending.stop();this._pending=null}this._loadingOverlay.stop(true,true).fadeOut(100)}},updateIcon:function(b,c){var a=(c===undefined||c?"addClass":"removeClass");b.find(".icon")[a]("icon-spinner");if(b.hasClass("icon")){b[a]("icon-spinner")}}};WCF.Action={};WCF.Action.Proxy=Class.extend({_showLoadingOverlayOnce:false,_suppressErrors:false,_lastRequest:null,init:function(b){this.options=$.extend(true,{autoSend:false,data:{},dataType:"json",after:null,init:null,jsonp:"callback",async:true,failure:null,showLoadingOverlay:true,success:null,suppressErrors:false,type:"POST",url:"index.php/AJAXProxy/?t="+SECURITY_TOKEN+SID_ARG_2ND,aborted:null,autoAbortPrevious:false},b);this.confirmationDialog=null;this.loading=null;this._showLoadingOverlayOnce=false;this._suppressErrors=(this.options.suppressErrors===true);if(this.options.autoSend){this.sendRequest()}var a=this;$(window).on("beforeunload",function(){a._suppressErrors=true})},sendRequest:function(a){this._init();if(a||this.options.autoAbortPrevious){this.abortPrevious()}this._lastRequest=$.ajax({data:this.options.data,dataType:this.options.dataType,jsonp:this.options.jsonp,async:this.options.async,type:this.options.type,url:this.options.url,success:$.proxy(this._success,this),error:$.proxy(this._failure,this)});return this._lastRequest},abortPrevious:function(){if(this._lastRequest!==null){this._lastRequest.abort();this._lastRequest=null}},showLoadingOverlayOnce:function(){this._showLoadingOverlayOnce=true},suppressErrors:function(){this._suppressErrors=true},_init:function(){if($.isFunction(this.options.init)){this.options.init(this)}if(this.options.showLoadingOverlay||this._showLoadingOverlayOnce){WCF.LoadingOverlayHandler.show()}},_failure:function(d,i,h){if(i=="abort"){if($.isFunction(this.options.aborted)){this.options.aborted(d)}return}try{var c=$.parseJSON(d.responseText);var f=true;if($.isFunction(this.options.failure)){f=this.options.failure(c,d,i,h)}if(!this._suppressErrors&&f!==false){var a="";if(c.stacktrace){a="<br /><p>Stacktrace:</p><p>"+c.stacktrace+"</p>"}else{if(c.exceptionID){a="<br /><p>Exception ID: <code>"+c.exceptionID+"</code></p>"}}$('<div class="ajaxDebugMessage"><p>'+c.message+"</p>"+a+"</div>").wcfDialog({title:WCF.Language.get("wcf.global.error.title")})}}catch(g){var f=true;if($.isFunction(this.options.failure)){f=this.options.failure(null,d,i,h)}if(!this._suppressErrors&&f!==false){var b=(i==="timeout")?WCF.Language.get("wcf.global.error.timeout"):d.responseText;if(b&&b!="undefined"){$('<div class="ajaxDebugMessage"><p>'+b+"</p></div>").wcfDialog({title:WCF.Language.get("wcf.global.error.title")})}}}this._after()},_success:function(b,c,a){if($.isFunction(this.options.success)){if(b&&b.returnValues&&b.returnValues.template!==undefined){b.returnValues.template=$.trim(b.returnValues.template)}this.options.success(b,c,a)}this._after()},_after:function(){this._lastRequest=null;if($.isFunction(this.options.after)){this.options.after()}if(this.options.showLoadingOverlay||this._showLoadingOverlayOnce){WCF.LoadingOverlayHandler.hide();if(this._showLoadingOverlayOnce){this._showLoadingOverlayOnce=false}}WCF.DOMNodeInsertedHandler.execute();$("a[href*=#]").each(function(c,e){var b=$(e);if(b.prop("href").indexOf("AJAXProxy")!=-1){var d=b.prop("href").substr(b.prop("href").indexOf("#"));var a=document.location.toString().replace(/#.*/,"");b.prop("href",a+d)}})},setOption:function(a,b){this.options[a]=b}});WCF.Action.SimpleProxy=Class.extend({init:function(a,b){this.options=$.extend(true,{action:"",className:"",elements:null,eventName:"click"},a);this.callbacks=$.extend(true,{after:null,failure:null,init:null,success:null},b);if(!this.options.elements){return}this.proxy=new WCF.Action.Proxy(this.callbacks);this.options.elements.each($.proxy(function(c,d){$(d).bind(this.options.eventName,$.proxy(this._handleEvent,this))},this))},_handleEvent:function(a){this.proxy.setOption("data",{actionName:this.options.action,className:this.options.className,objectIDs:[$(a.target).data("objectID")]});this.proxy.sendRequest()}});WCF.Action.Delete=Class.extend({_buttonSelector:"",_className:"",_containerSelector:"",_containers:[],init:function(c,a,b){this._containerSelector=a;this._className=c;this._buttonSelector=(b)?b:".jsDeleteButton";this.proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)});this._initElements();WCF.DOMNodeInsertedHandler.addCallback("WCF.Action.Delete"+this._className.hashCode(),$.proxy(this._initElements,this))},_initElements:function(){var a=this;$(this._containerSelector).each(function(c,b){var e=$(b);var d=e.wcfIdentify();if(!WCF.inArray(d,a._containers)){a._containers.push(d);e.find(a._buttonSelector).click($.proxy(a._click,a))}})},_click:function(b){var a=$(b.currentTarget);b.preventDefault();if(a.data("confirmMessage")){WCF.System.Confirmation.show(a.data("confirmMessage"),$.proxy(this._execute,this),{target:a})}else{WCF.LoadingOverlayHandler.updateIcon(a);this._sendRequest(a)}},_didTriggerEffect:function(a){},_execute:function(b,a){if(b==="cancel"){return}WCF.LoadingOverlayHandler.updateIcon(a.target);this._sendRequest(a.target)},_sendRequest:function(a){this.proxy.setOption("data",{actionName:"delete",className:this._className,interfaceName:"wcf\\data\\IDeleteAction",objectIDs:[$(a).data("objectID")]});this.proxy.sendRequest()},_success:function(b,c,a){this.triggerEffect(b.objectIDs)},triggerEffect:function(c){for(var a in this._containers){var d=$("#"+this._containers[a]);if(WCF.inArray(d.find(this._buttonSelector).data("objectID"),c)){var b=this;d.wcfBlindOut("up",function(){$(this).remove();b._containers.splice(b._containers.indexOf($(this).wcfIdentify()),1);b._didTriggerEffect($(this))})}}}});WCF.Action.NestedDelete=WCF.Action.Delete.extend({triggerEffect:function(c){for(var a in this._containers){var d=$("#"+this._containers[a]);if(WCF.inArray(d.find(this._buttonSelector).data("objectID"),c)){if(d.has("ol").has("li").length){if(d.is(":only-child")){d.parent().replaceWith(d.find("> ol"))}else{d.replaceWith(d.find("> ol > li"))}this._containers.splice(this._containers.indexOf(d.wcfIdentify()),1);this._didTriggerEffect(d)}else{var b=this;d.wcfBlindOut("up",function(){$(this).remove();b._containers.splice(b._containers.indexOf($(this).wcfIdentify()),1);b._didTriggerEffect($(this))})}}}}});WCF.Action.Toggle=Class.extend({_buttonSelector:".jsToggleButton",_className:"",_containerSelector:"",_containers:[],init:function(d,a,c){this._containerSelector=a;this._className=d;this._buttonSelector=(c)?c:".jsToggleButton";this._containers=[];var b={success:$.proxy(this._success,this)};this.proxy=new WCF.Action.Proxy(b);this._initElements();WCF.DOMNodeInsertedHandler.addCallback("WCF.Action.Toggle"+this._className.hashCode(),$.proxy(this._initElements,this))},_initElements:function(){$(this._containerSelector).each($.proxy(function(b,a){var d=$(a);var c=d.wcfIdentify();if(!WCF.inArray(c,this._containers)){this._containers.push(c);d.find(this._buttonSelector).click($.proxy(this._click,this))}},this))},_click:function(b){var a=$(b.currentTarget);b.preventDefault();if(a.data("confirmMessage")){WCF.System.Confirmation.show(a.data("confirmMessage"),$.proxy(this._execute,this),{target:a})}else{WCF.LoadingOverlayHandler.updateIcon(a);this._sendRequest(a)}},_execute:function(b,a){if(b==="cancel"){return}WCF.LoadingOverlayHandler.updateIcon(a.target);this._sendRequest(a.target)},_sendRequest:function(a){this.proxy.setOption("data",{actionName:"toggle",className:this._className,interfaceName:"wcf\\data\\IToggleAction",objectIDs:[$(a).data("objectID")]});this.proxy.sendRequest()},_success:function(b,c,a){this.triggerEffect(b.objectIDs)},triggerEffect:function(b){for(var a in this._containers){var d=$("#"+this._containers[a]);var c=d.find(this._buttonSelector);if(WCF.inArray(c.data("objectID"),b)){d.wcfHighlight();this._toggleButton(d,c)}}},_toggleButton:function(b,a){WCF.LoadingOverlayHandler.updateIcon(a,false);if(a.hasClass("icon-check-empty")){a.removeClass("icon-check-empty").addClass("icon-check");$newTitle=(a.data("disableTitle")?a.data("disableTitle"):WCF.Language.get("wcf.global.button.disable"));a.attr("title",$newTitle)}else{a.removeClass("icon-check").addClass("icon-check-empty");$newTitle=(a.data("enableTitle")?a.data("enableTitle"):WCF.Language.get("wcf.global.button.enable"));a.attr("title",$newTitle)}b.toggleClass("disabled")}});WCF.Action.Scroll=Class.extend({_callback:null,_reference:null,_target:null,_threshold:0,init:function(b,d,a,c){this._threshold=parseInt(b);if(this._threshold===0){console.debug("[WCF.Action.Scroll] Given threshold is invalid, aborting.");return}if($.isFunction(d)){this._callback=d}if(this._callback===null){console.debug("[WCF.Action.Scroll] Given callback is invalid, aborting.");return}this._reference=$((a)?a:window);this._target=$((c)?c:document);this.start();this._scroll()},_scroll:function(){var a=this._target.height();var b=this._reference.scrollTop();var c=this._reference.height();if((a-(c+b))<this._threshold){this._callback(this)}},start:function(){this._reference.on("scroll",$.proxy(this._scroll,this))},stop:function(){this._reference.off("scroll")}});WCF.Date={};WCF.Date.Picker={_dateFormat:"yy-mm-dd",_timeFormat:"g:ia",init:function(){var a=$.timepicker.log;$.timepicker.log=function(b){if(b.indexOf("Error parsing the date/time string: Unexpected literal at position")==-1&&b.indexOf("Error parsing the date/time string: Unknown name at position")==-1){a(b)}};this._convertDateFormat();this._initDatePicker();WCF.DOMNodeInsertedHandler.addCallback("WCF.Date.Picker",$.proxy(this._initDatePicker,this))},_convertDateFormat:function(){var a={a:"tt",A:"TT",g:"h",G:"H",h:"hh",H:"HH",i:"mm",s:"ss",u:"l",d:"dd",D:"D",j:"d",l:"DD",z:"o",S:"",F:"MM",m:"mm",M:"M",n:"m",o:"yy",Y:"yy",y:"y",U:"@"};this._dateFormat=WCF.Language.get("wcf.date.dateFormat").replace(/([^dDjlzSFmMnoYyU\\]*(?:\\.[^dDjlzSFmMnoYyU\\]*)*)([dDjlzSFmMnoYyU])/g,function(c,f,e,g,b){for(var d in a){if(e==d){e=a[d]}}return f+e});this._timeFormat=WCF.Language.get("wcf.date.timeFormat").replace(/([^aAgGhHisu\\]*(?:\\.[^aAgGhHisu\\]*)*)([aAgGhHisu])/g,function(c,f,e,g,b){for(var d in a){if(e==d){e=a[d]}}return f+e})},_initDatePicker:function(){$("input[type=date]:not(.jsDatePicker), input[type=datetime]:not(.jsDatePicker)").each($.proxy(function(d,g){var f=$(g);var b=f.prop("name");var j=f.val();var a=f.attr("type")=="datetime";f.prop("type","text").addClass("jsDatePicker");if(f.data("placeholder")){f.attr("placeholder",f.data("placeholder"))}f.removeAttr("name");f.before('<input type="hidden" id="'+f.wcfIdentify()+'DatePicker" name="'+b+'" value="'+j+'" />');var c=f.attr("max")?new Date(f.attr("max").replace(" ","T")):null;var k=f.attr("min")?new Date(f.attr("min").replace(" ","T")):null;$options={altField:"#"+f.wcfIdentify()+"DatePicker",altFormat:"yy-mm-dd",beforeShow:function(n,m){setTimeout(function(){m.dpDiv.position({my:"left top",at:"left bottom",collision:"none",of:n})},1)},changeMonth:true,changeYear:true,dateFormat:this._dateFormat,dayNames:WCF.Language.get("__days"),dayNamesMin:WCF.Language.get("__daysShort"),dayNamesShort:WCF.Language.get("__daysShort"),firstDay:parseInt(WCF.Language.get("wcf.date.firstDayOfTheWeek"))||0,isRTL:WCF.Language.get("wcf.global.pageDirection")=="rtl",maxDate:c,minDate:k,monthNames:WCF.Language.get("__months"),monthNamesShort:WCF.Language.get("__monthsShort"),showButtonPanel:false,onClose:function(n,m){if(n==""){$(m.settings.altField).val(n)}},showOtherMonths:true,yearRange:(f.hasClass("birthday")?"-100:+0":"1900:2038")};if(a){if(/[0-9]{2}:[0-9]{2}:[0-9]{2}$/.test(j)){j=j.replace(/:[0-9]{2}$/,"");f.val(j)}j=j.replace(" ","T");if(f.data("ignoreTimezone")){var i=new Date().getTimezoneOffset();var l=(i>0)?"-":"+";i=Math.abs(i);var e=(Math.floor(i/60)).toString();var h=(i%60).toString();l+=(e.length==2)?e:"0"+e;l+=":";l+=(h.length==2)?h:"0"+h;j=j.replace(/[+-][0-9]{2}:[0-9]{2}$/,l)}$options=$.extend($options,{altFieldTimeOnly:false,altTimeFormat:"HH:mm",controlType:"select",hourText:WCF.Language.get("wcf.date.hour"),minuteText:WCF.Language.get("wcf.date.minute"),showTime:false,timeFormat:this._timeFormat,yearRange:(f.hasClass("birthday")?"-100:+0":"1900:2038")})}if(a){f.datetimepicker($options)}else{f.datepicker($options)}if(j){if(!a){j=new Date(j);j.setMinutes(j.getMinutes()+j.getTimezoneOffset())}f.datepicker("setDate",j)}f.datepicker("widget").hide()},this))}};WCF.Date.Util={gmdate:function(a){var b=(a)?a:new Date();return Math.round(Date.UTC(b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDay(),b.getUTCHours(),b.getUTCMinutes(),b.getUTCSeconds())/1000)},getTimezoneDate:function(b,c){var d=new Date(b);var a=d.getTimezoneOffset()*60000;return new Date((b+a+c))}};WCF.Date.Time=Class.extend({_date:0,_elements:null,_offset:null,_timestamp:0,init:function(){this._elements=$("time.datetime");this._offset=null;this._timestamp=0;this._refresh();new WCF.PeriodicalExecuter($.proxy(this._refresh,this),60000);WCF.DOMNodeInsertedHandler.addCallback("WCF.Date.Time",$.proxy(this._domNodeInserted,this))},_domNodeInserted:function(){this._elements=$("time.datetime");this._refresh()},_refresh:function(){this._date=new Date();this._timestamp=(this._date.getTime()-this._date.getMilliseconds())/1000;if(this._offset===null){this._offset=this._timestamp-TIME_NOW}this._elements.each($.proxy(this._refreshElement,this))},_refreshElement:function(i,f){var n=$(f);if(!n.attr("title")){n.attr("title",n.text())}var d=n.data("timestamp")+this._offset;var b=n.data("date");var c=n.data("time");var o=n.data("offset");if(n.data("isFutureDate")){return}if(d>=this._timestamp||this._timestamp<(d+60)){n.text(WCF.Language.get("wcf.date.relative.now"))}else{if(this._timestamp<(d+3540)){var m=Math.max(Math.round((this._timestamp-d)/60),1);n.text(WCF.Language.get("wcf.date.relative.minutes",{minutes:m}))}else{if(this._timestamp<(d+86400)){var k=Math.round((this._timestamp-d)/3600);n.text(WCF.Language.get("wcf.date.relative.hours",{hours:k}))}else{if(this._timestamp<(d+518400)){var j=new Date(this._date.getFullYear(),this._date.getMonth(),this._date.getDate());var l=Math.ceil((j/1000-d)/86400);var g=WCF.Date.Util.getTimezoneDate((d*1000),o*1000);var h=g.getDay();var e=WCF.Language.get("__days")[h];n.text(WCF.Language.get("wcf.date.relative.pastDays",{days:l,day:e,time:c}))}else{var a=WCF.Language.get("wcf.date.shortDateTimeFormat");n.text(a.replace(/\%date\%/,b).replace(/\%time\%/,c))}}}}}});WCF.Dictionary=Class.extend({_variables:{},init:function(){this._variables={}},add:function(a,b){this._variables[a]=b},addObject:function(a){for(var b in a){this.add(b,a[b])}},addDictionary:function(a){a.each($.proxy(function(b){this.add(b.key,b.value)},this))},get:function(a){if(this.isset(a)){return this._variables[a]}return null},isset:function(a){return this._variables.hasOwnProperty(a)},remove:function(a){delete this._variables[a]},each:function(d){if(!$.isFunction(d)){return}for(var c in this._variables){var a=this._variables[c];var b={key:c,value:a};d(b)}},count:function(){return $.getLength(this._variables)},isEmpty:function(){return !this.count()}});WCF.Language={_variables:new WCF.Dictionary(),add:function(a,b){this._variables.add(a,b)},addObject:function(a){this._variables.addObject(a)},get:function(a,b){if(b==null){var b={}}var c=this._variables.get(a);if(c===null){return a}else{if(typeof c==="string"){this.add(a,new WCF.Template(c));return this.get(a,b)}else{if(typeof c.fetch==="function"){c=c.fetch(b)}}}return c}};WCF.MultipleLanguageInput=Class.extend({_availableLanguages:{},_button:null,_didInit:false,_element:null,_insertedDataAfterInit:false,_isEnabled:false,_forceSelection:false,_languageID:0,_list:null,_values:null,init:function(c,b,d,f){this._button=null;this._element=$("#"+$.wcfEscapeID(c));this._forceSelection=b;this._values=d;this._availableLanguages=f;if($.getLength(this._values)){for(var e in this._values){this._values[e]=WCF.String.unescapeHTML(this._values[e])}}this._languageID=LANGUAGE_ID;if(this._element.length==0){console.debug("[WCF.MultipleLanguageInput] element id '"+c+"' is unknown");return}var a=($.getLength(this._values)>0)?true:false;this._insertedDataAfterInit=a;this._prepareElement(a);this._element.parents("form").submit($.proxy(this._submit,this));this._didInit=true},_prepareElement:function(a){this._element.wrap('<div class="dropdown preInput" />');var c=this._element.parent();this._button=$('<p class="button dropdownToggle"><span>'+WCF.Language.get("wcf.global.button.disabledI18n")+"</span></p>").prependTo(c);this._list=$('<ul class="dropdownMenu"></ul>').insertAfter(this._button);if(this._button.nextAll("textarea").length){this._button.addClass("dropdownCaptionTextarea")}else{this._button.addClass("dropdownCaption")}for(var b in this._availableLanguages){$("<li><span>"+this._availableLanguages[b]+"</span></li>").data("languageID",b).click($.proxy(this._changeLanguage,this)).appendTo(this._list)}if(!this._forceSelection){$('<li class="dropdownDivider" />').appendTo(this._list);$("<li><span>"+WCF.Language.get("wcf.global.button.disabledI18n")+"</span></li>").click($.proxy(this._disable,this)).appendTo(this._list)}WCF.Dropdown.initDropdown(this._button,a);if(a||this._forceSelection){this._isEnabled=true;this._list.children("li").each($.proxy(function(d,f){var e=$(f);if(e.data("languageID")==this._languageID){e.trigger("click")}},this))}WCF.Dropdown.registerCallback(c.wcfIdentify(),$.proxy(this._handleAction,this))},_handleAction:function(a,b){if(b==="open"){this._enable()}else{this._closeSelection()}},_enable:function(a){if(!this._isEnabled){var b=(this._button.is("p"))?this._button.children("span:eq(0)"):this._button;b.addClass("active");this._isEnabled=true}if(this._list.is(":visible")){this._showSelection()}},_showSelection:function(){if(this._isEnabled){this._list.children("li").each($.proxy(function(b,d){var c=$(d);var a=c.data("languageID");if(a){if(this._values[a]&&this._values[a]!=""){c.removeClass("missingValue")}else{c.addClass("missingValue")}}},this))}},_closeSelection:function(){this._disable()},_changeLanguage:function(a){var b=$(a.currentTarget);this._insertedDataAfterInit=true;if(this._didInit){this._values[this._languageID]=this._element.val()}this._languageID=b.data("languageID");if(this._values[this._languageID]){this._element.val(this._values[this._languageID])}else{this._element.val("")}this._list.children("li").removeClass("active");b.addClass("active");this._button.children("span").addClass("active").text(this._availableLanguages[this._languageID]);if(this._didInit){this._element.blur().focus()}},_disable:function(a){if(a===undefined&&this._insertedDataAfterInit){a=null}if(this._forceSelection||!this._list||a===null){return}this._button.children("span").removeClass("active").text(WCF.Language.get("wcf.global.button.disabledI18n"));if(this._values[LANGUAGE_ID]){this._element.val(this._values[LANGUAGE_ID])}else{this._element.val()}if(a){this._list.children("li").removeClass("active");$(a.currentTarget).addClass("active")}this._element.blur().focus();this._insertedDataAfterInit=false;this._isEnabled=false;this._values={}},_submit:function(){if(!this._isEnabled){return 3735928559}if(this._languageID){this._values[this._languageID]=this._element.val()}var b=$(this._element.parents("form")[0]);var c=this._element.wcfIdentify();for(var a in this._availableLanguages){if(this._values[a]===undefined){this._values[a]=""}$('<input type="hidden" name="'+c+"_i18n["+a+']" value="'+WCF.String.escapeHTML(this._values[a])+'" />').appendTo(b)}this._element.removeAttr("name")}});WCF.Number={round:function(b,a){a=Math.pow(10,(a||0));return Math.round(b*a)/a}};WCF.String={addThousandsSeparator:function(a){return String(a).replace(/(^-?\d{1,3}|\d{3})(?=(?:\d{3})+(?:$|\.))/g,"$1"+WCF.Language.get("wcf.global.thousandsSeparator"))},escapeHTML:function(a){return String(a).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},escapeRegExp:function(a){return String(a).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")},formatNumeric:function(b,a){b=String(WCF.Number.round(b,a||2));numberParts=b.split(".");b=this.addThousandsSeparator(numberParts[0]);if(numberParts.length>1){b+=WCF.Language.get("wcf.global.decimalPoint")+numberParts[1]}b=b.replace("-","\u2212");return b},lcfirst:function(a){return String(a).substring(0,1).toLowerCase()+a.substring(1)},ucfirst:function(a){return String(a).substring(0,1).toUpperCase()+a.substring(1)},unescapeHTML:function(a){return String(a).replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">")}};WCF.TabMenu={_containers:{},_didInit:false,init:function(){var d=$(".tabMenuContainer:not(.staticTabMenuContainer)");var c=this;d.each(function(f,e){var h=$(e);var g=h.wcfIdentify();if(c._containers[g]){return true}if(h.data("store")&&!$("#"+h.data("store")).length){$('<input type="hidden" name="'+h.data("store")+'" value="" id="'+h.data("store")+'" />').appendTo(h.parents("form").find(".formSubmit"))}c._containers[g]=h;h.wcfTabs({active:false,activate:function(j,i){var l=$(i.newPanel);var k=l.closest(".tabMenuContainer");var m=k;while(true){if(m.data("isParent")===undefined){break}if(m.data("isParent")){if(m.data("store")){$("#"+m.data("store")).val(l.attr("id"))}break}else{m=m.data("parent")}}if(WCF.TabMenu._didInit){if(l.data("inTabMenu")==undefined){l.data("inTabMenu",(l.parents(".dialogContainer").length))}if(!l.data("inTabMenu")){if(window.history){window.history.pushState(null,document.title,window.location.toString().replace(/#.+$/,"")+"#"+l.attr("id"))}else{location.hash="#"+l.attr("id")}}}}});h.data("isParent",(h.children(".tabMenuContainer, .tabMenuContent").length>0)).data("parent",false);if(!h.data("isParent")){if(h.parent().hasClass("tabMenuContainer")){h.data("parent",h.parent())}}});if(!this._didInit){this._selectActiveTab();$(window).bind("hashchange",$.proxy(this.selectTabs,this));if(!this._selectErroneousTab()){this.selectTabs()}if($.browser.mozilla&&location.hash){var a=$(location.hash);if(a.length&&a.hasClass("tabMenuContent")){var b=a.offset();window.scrollTo(b.left,b.top)}}}this._didInit=true},reload:function(){this._containers={};this.init()},_selectErroneousTab:function(){var d=false;for(var a in this._containers){var c=this._containers[a];if(c.find(".formError").length){d=true;if(!c.data("isParent")){while(true){if(c.data("parent")===false){break}c=c.data("parent").wcfTabs("selectTab",c.wcfIdentify())}return true}}}if(d){for(var a in this._containers){var c=this._containers[a];var b=c.find(".formError:eq(0)");if(b.length){c.wcfTabs("selectTab",b.parents(".tabMenuContent").wcfIdentify());while(true){if(c.data("parent")===false){break}c=c.data("parent").wcfTabs("selectTab",c.wcfIdentify())}return true}}}return false},_selectActiveTab:function(){for(var b in this._containers){var e=this._containers[b];if(e.data("active")){var a=e.data("active");var d=null;if(/-/.test(a)){var c=a.split("-");a=c[0];d=c[1]}e.find(".tabMenuContent").each(function(h,g){var f=$(g);if(f.wcfIdentify()==a){e.wcfTabs("select",h);if(d!==null){if(f.hasClass("tabMenuContainer")){f.wcfTabs("selectTab",e.data("active"))}else{e.wcfTabs("selectTab",e.data("active"))}}return false}})}}},selectTabs:function(){if(location.hash){var a=location.hash.substr(1);var b=$("#"+$.wcfEscapeID(a));if(b.length===1&&b.hasClass("ui-tabs-panel")){b=b.parent(".ui-tabs");if(b.length){b.wcfTabs("selectTab",a);if(b.hasClass("ui-tabs-panel")){a=b.wcfIdentify();b=b.parent(".ui-tabs");if(b.length){b.wcfTabs("selectTab",a)}}return true}}}return false}};WCF.Template=Class.extend({init:function(d){var f=new WCF.Dictionary();var a=0;d=d.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/(\r\n|\n|\r)/g,"\\n");d=d.replace(/\{literal\}(.*?)\{\/literal\}/g,$.proxy(function(e){var i="@@@@@@@@@@@"+Math.random()+"@@@@@@@@@@@";f.add(i,e.replace(/\{\/?literal\}/g,""));return i},this));d=d.replace(/\{\*.*?\*\}/g,"");var c=function(q){var l=q.split("");var i={};var k=true;var s="";var o="";var m=false;var n=false;var j=false;for(var p=0,e=l.length;p<e;p++){var r=l[p];if(k&&r!="="&&r!=" "){s+=r}else{if(k&&r=="="){k=false;n=false;m=false;j=false}else{if(!k&&!n&&!m&&r==" "){k=true;i[s]=o;o=s=""}else{if(!k&&n&&!j&&r=="'"){n=false;o+=r}else{if(!k&&!n&&!m&&r=="'"){n=true;o+=r}else{if(!k&&m&&!j&&r=='"'){m=false;o+=r}else{if(!k&&!n&&!m&&r=='"'){m=true;o+=r}else{if(!k&&(m||n)&&!j&&r=="\\"){j=true;o+=r}else{if(!k){j=false;o+=r}}}}}}}}}}i[s]=o;if(m||n||j){throw new Error('Syntax error in parameterList: "'+q+'"')}return i};var h=function(e){return e.replace(/\\n/g,"\n").replace(/\\\\/g,"\\").replace(/\\'/g,"'")};d=d.replace(/\{(\$[^\}]+?)\}/g,function(e,i){i=h(i.replace(/\$([^.\[\s]+)/g,"(v['$1'])"));return"' + WCF.String.escapeHTML("+i+") + '"}).replace(/\{#(\$[^\}]+?)\}/g,function(e,i){i=h(i.replace(/\$([^.\[\s]+)/g,"(v['$1'])"));return"' + WCF.String.formatNumeric("+i+") + '"}).replace(/\{@(\$[^\}]+?)\}/g,function(e,i){i=h(i.replace(/\$([^.\[\s]+)/g,"(v['$1'])"));return"' + "+i+" + '"}).replace(/{lang}(.+?){\/lang}/g,function(e,i){return"' + WCF.Language.get('"+h(i)+"') + '"}).replace(/\{if (.+?)\}/g,function(e,i){i=h(i.replace(/\$([^.\[\s]+)/g,"(v['$1'])"));return"';\nif ("+i+") {\n     $output += '"}).replace(/\{else ?if (.+?)\}/g,function(e,i){i=h(i.replace(/\$([^.\[\s]+)/g,"(v['$1'])"));return"';\n}\nelse if ("+i+") {\n      $output += '"}).replace(/\{implode (.+?)\}/g,function(e,j){a++;j=j.replace(/\\\\/g,"\\").replace(/\\'/g,"'");var i=c(j);if(typeof i.from==="undefined"){throw new Error("Missing from attribute in implode-tag")}if(typeof i.item==="undefined"){throw new Error("Missing item attribute in implode-tag")}if(typeof i.glue==="undefined"){i.glue="', '"}i.from=i.from.replace(/\$([^.\[\s]+)/g,"(v.$1)");return"';\nvar $implode_"+a+" = false;\nfor ($implodeKey_"+a+" in "+i.from+") {\n      v["+i.item+"] = "+i.from+"[$implodeKey_"+a+"];\n"+(typeof i.key!=="undefined"?"         v["+i.key+"] = $implodeKey_"+a+";\n":"")+"      if ($implode_"+a+") $output += "+i.glue+";\n    $implode_"+a+" = true;\n        $output += '"}).replace(/\{foreach (.+?)\}/g,function(e,j){a++;j=j.replace(/\\\\/g,"\\").replace(/\\'/g,"'");var i=c(j);if(typeof i.from==="undefined"){throw new Error("Missing from attribute in foreach-tag")}if(typeof i.item==="undefined"){throw new Error("Missing item attribute in foreach-tag")}i.from=i.from.replace(/\$([^.\[\s]+)/g,"(v.$1)");return"';\n$foreach_"+a+" = false;\nfor ($foreachKey_"+a+" in "+i.from+") {\n        $foreach_"+a+" = true;\n        break;\n}\nif ($foreach_"+a+") {\n      for ($foreachKey_"+a+" in "+i.from+") {\n               v["+i.item+"] = "+i.from+"[$foreachKey_"+a+"];\n"+(typeof i.key!=="undefined"?"         v["+i.key+"] = $foreachKey_"+a+";\n":"")+"              $output += '"}).replace(/\{foreachelse\}/g,"';\n        }\n}\nelse {\n  {\n             $output += '").replace(/\{\/foreach\}/g,"';\n   }\n}\n$output += '").replace(/\{else\}/g,"';\n}\nelse {\n       $output += '").replace(/\{\/(if|implode)\}/g,"';\n}\n$output += '");for(var b in WCF.Template.callbacks){d=WCF.Template.callbacks[b](d)}d=d.replace("{ldelim}","{").replace("{rdelim}","}");f.each(function(e){d=d.replace(e.key,e.value)});d="$output += '"+d+"';";try{this.fetch=new Function("v","if (typeof v != 'object') { v = {}; } v.__window = window; v.__wcf = window.WCF; var $output = ''; "+d+" return $output;")}catch(g){console.debug("var $output = ''; "+d+" return $output;");throw g}},fetch:function(a){}});WCF.Template.callbacks=[];WCF.ToggleOptions=Class.extend({_element:null,_showItems:[],_hideItems:[],_callback:null,init:function(c,a,b,d){this._element=$("#"+c);this._showItems=a;this._hideItems=b;if(d!==undefined){this._callback=d}this._element.click($.proxy(this._toggle,this));this._toggle()},_toggle:function(){if(!this._element.prop("checked")){return}for(var c=0,b=this._showItems.length;c<b;c++){var a=this._showItems[c];$("#"+a).show()}for(var c=0,b=this._hideItems.length;c<b;c++){var a=this._hideItems[c];$("#"+a).hide()}if(this._callback!==null){this._callback()}}});WCF.Collapsible={};WCF.Collapsible.Simple={init:function(){$(".jsCollapsible").each($.proxy(function(a,b){this._initButton(b)},this))},_initButton:function(a){var c=$(a);var b=c.data("isOpen");if(!b){$("#"+c.data("collapsibleContainer")).hide()}c.click($.proxy(this._toggle,this))},_toggle:function(b){var d=$(b.currentTarget);var c=d.data("isOpen");var a=$("#"+$.wcfEscapeID(d.data("collapsibleContainer")));if(c){a.stop().wcfBlindOut("vertical",$.proxy(function(){this._toggleImage(d)},this));c=false}else{a.stop().wcfBlindIn("vertical",$.proxy(function(){this._toggleImage(d)},this));c=true}d.data("isOpen",c);b.stopPropagation();return false},_toggleImage:function(b){var a=b.find("span.icon");if(b.data("isOpen")){a.removeClass("icon-chevron-right").addClass("icon-chevron-down")}else{a.removeClass("icon-chevron-down").addClass("icon-chevron-right")}}};WCF.Collapsible.Remote=Class.extend({_className:"",_containers:{},_containerData:{},_proxy:null,init:function(a){this._className=a;this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)});this._init();WCF.DOMNodeInsertedHandler.addCallback("WCF.Collapsible.Remote",$.proxy(this._init,this))},_init:function(a){this._getContainers().each($.proxy(function(c,b){var e=$(b);var d=e.wcfIdentify();if(this._containers[d]===undefined){this._containers[d]=e;this._initContainer(d)}},this))},_initContainer:function(b){var a=this._getTarget(b);var c=this._getButtonContainer(b);var d=this._createButton(b,c);this._containerData[b]={button:d,buttonContainer:c,isOpen:this._containers[b].data("isOpen"),target:a};if(!this._containers[b].data("isOpen")){$("#"+b).addClass("jsCollapsed")}},_getContainers:function(){},_getTarget:function(a){},_getButtonContainer:function(a){},_createButton:function(a,b){var d=this._containers[a].data("isOpen");var c=$('<span class="collapsibleButton jsTooltip pointer icon icon16 icon-'+(d?"chevron-down":"chevron-right")+'" title="'+WCF.Language.get("wcf.global.button.collapsible")+'">').prependTo(b);c.data("containerID",a).click($.proxy(this._toggleContainer,this));return c},_toggleContainer:function(d){var f=$(d.currentTarget);var b=f.data("containerID");var e=this._containerData[b].isOpen;var a=(e)?"open":"close";var c=(e)?"close":"open";this._proxy.setOption("data",{actionName:"loadContainer",className:this._className,interfaceName:"wcf\\data\\ILoadableContainerAction",objectIDs:[this._getObjectID(b)],parameters:$.extend(true,{containerID:b,currentState:a,newState:c},this._getAdditionalParameters(b))});this._proxy.sendRequest();$("#"+b).toggleClass("jsCollapsed")},_exchangeIcon:function(b,a){a=a||"spinner";b.removeClass("icon-chevron-down icon-chevron-right icon-spinner").addClass("icon-"+a)},_getObjectID:function(a){return $("#"+a).data("objectID")},_getAdditionalParameters:function(a){return{}},_updateContent:function(a,b,c){this._containerData[a].target.html(b)},_success:function(d,e,c){if(!d.returnValues.containerID){return}var a=d.returnValues.containerID;if(!this._containers[a]){return}this._containerData[a].isOpen=(d.returnValues.isOpen)?true:false;var b=(d.returnValues.isOpen)?"open":"close";this._updateContent(a,$.trim(d.returnValues.content),b);this._exchangeIcon(this._containerData[a].button,(d.returnValues.isOpen?"chevron-down":"chevron-right"))}});WCF.Collapsible.SimpleRemote=WCF.Collapsible.Remote.extend({init:function(a){this._super(a);this._proxy=new WCF.Action.Proxy({showLoadingOverlay:false})},_initContainer:function(a){this._super(a);if(!this._containerData[a].isOpen){this._containerData[a].target.hide();this._exchangeIcon(this._containerData[a].button,"chevron-right")}},_toggleContainer:function(d){var f=$(d.currentTarget);var b=f.data("containerID");var e=this._containerData[b].isOpen;var a=(e)?"open":"close";var c=(e)?"close":"open";this._proxy.setOption("data",{actionName:"toggleContainer",className:this._className,interfaceName:"wcf\\data\\IToggleContainerAction",objectIDs:[this._getObjectID(b)],parameters:$.extend(true,{containerID:b,currentState:a,newState:c},this._getAdditionalParameters(b))});this._proxy.sendRequest();this._exchangeIcon(this._containerData[b].button,(c==="open"?"chevron-down":"chevron-right"));if(c==="open"){this._containerData[b].target.show()}else{this._containerData[b].target.hide()}$("#"+b).toggleClass("jsCollapsed");this._containerData[b].isOpen=(c==="open"?true:false)}});WCF.Collapsible.Sidebar=Class.extend({_button:null,_buttonHeight:0,_isOpen:false,_mainContainer:null,_proxy:null,_sidebar:null,_sidebarHeight:0,_sidebarName:"",_sidebarOffset:0,_userPanelHeight:0,init:function(){this._sidebar=$(".sidebar:eq(0)");if(!this._sidebar.length){console.debug("[WCF.Collapsible.Sidebar] Could not find sidebar, aborting.");return}this._isOpen=(this._sidebar.data("isOpen"))?true:false;this._sidebarName=this._sidebar.data("sidebarName");this._mainContainer=$("#main");this._sidebarHeight=this._sidebar.height();this._sidebarOffset=this._sidebar.getOffsets("offset").top;this._userPanelHeight=$("#topMenu").outerHeight();this._button=$('<a class="collapsibleButton jsTooltip" title="'+WCF.Language.get("wcf.global.button.collapsible")+'" />').prependTo(this._sidebar);this._button.wrap("<span />");this._button.click($.proxy(this._click,this));this._buttonHeight=this._button.outerHeight();WCF.DOMNodeInsertedHandler.execute();this._proxy=new WCF.Action.Proxy({showLoadingOverlay:false,url:"index.php/AJAXInvoke/?t="+SECURITY_TOKEN+SID_ARG_2ND});$(document).scroll($.proxy(this._scroll,this)).resize($.proxy(this._scroll,this));this._renderSidebar();this._scroll();var a=$(window);this._sidebar.on("webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd",function(){a.trigger("resize")})},_click:function(){this._isOpen=(this._isOpen)?false:true;this._proxy.setOption("data",{actionName:"toggle",className:"wcf\\system\\user\\collapsible\\content\\UserCollapsibleSidebarHandler",isOpen:(this._isOpen?1:0),sidebarName:this._sidebarName});this._proxy.sendRequest();this._renderSidebar()},_scroll:function(){var e=$(window);var b=e.scrollTop();var a=Math.max(b-this._sidebarOffset,0);var c=Math.min(this._mainContainer.height(),(e.height()+b)-this._sidebarOffset);var f=0;if(c===a){f=this._sidebarOffset+this._sidebarHeight}else{f=a+((c-a)/2);var d=Math.max(Math.min(a-this._userPanelHeight,this._userPanelHeight),0);if(d>0){f+=(d/2)}}if((c-a-this._userPanelHeight)<this._buttonHeight){f=f-this._buttonHeight}else{f=Math.max(f-(this._buttonHeight/2),0)}this._button.css({top:f+"px"})},_renderSidebar:function(){if(this._isOpen){$(".sidebarOrientationLeft, .sidebarOrientationRight").removeClass("sidebarCollapsed")}else{$(".sidebarOrientationLeft, .sidebarOrientationRight").addClass("sidebarCollapsed")}this._scroll();if($.browser.msie&&$.browser.version.indexOf("9")===0){$(window).trigger("resize")}}});WCF.User={userID:0,username:"",init:function(a,b){this.userID=a;this.username=b}};WCF.Effect={};WCF.Effect.Scroll=Class.extend({scrollTo:function(c,a,b){if(!c.length){return true}var d=c.getOffsets("offset").top;var f=$(document).height();var e=$(window).height();if(d>f-e){d=f-e;if(d<0){d=0}}if(b===true){$("html,body").scrollTop(d)}else{$("html,body").animate({scrollTop:d},400,function(h,i,g,k,j){return -k*((i=i/j-1)*i*i*i-1)+g})}return false}});WCF.Effect.SmoothScroll=WCF.Effect.Scroll.extend({init:function(){var a=this;$(document).on("click","a[href$=#top],a[href$=#bottom]",function(){var b=$(this.hash);a.scrollTo(b,true);return false})}});WCF.Effect.BalloonTooltip=Class.extend({_didInit:false,_tooltip:null,_viewportDimensions:{},init:function(){if(jQuery.browser.mobile){return}if(!this._didInit){this._tooltip=$('<div id="balloonTooltip" class="balloonTooltip"><span id="balloonTooltipText"></span><span class="pointer"><span></span></span></div>').appendTo($("body")).hide();this._updateViewportDimensions();$(window).resize($.proxy(this._updateViewportDimensions,this));WCF.DOMNodeInsertedHandler.addCallback("WCF.Effect.BalloonTooltip",$.proxy(this.init,this));this._didInit=true}$(".jsTooltip").each($.proxy(this._initTooltip,this))},_updateViewportDimensions:function(){this._viewportDimensions=$(document).getDimensions()},_initTooltip:function(b,c){var a=$(c);if(a.hasClass("jsTooltip")){a.removeClass("jsTooltip");var d=a.attr("title");if(d!==""){a.data("tooltip",d);a.removeAttr("title");a.hover($.proxy(this._mouseEnterHandler,this),$.proxy(this._mouseLeaveHandler,this));a.click($.proxy(this._mouseLeaveHandler,this))}}},_mouseEnterHandler:function(c){var n=$(c.currentTarget);var j=n.attr("title");if(j&&j!==""){n.data("tooltip",j);n.removeAttr("title")}this._tooltip.css({top:"0px",left:"0px"});if(!n.data("tooltip")){this._tooltip.hide();return}this._tooltip.children("span:eq(0)").text(n.data("tooltip"));var l=this._tooltip.find(".pointer");this._tooltip.show();var b=l.outerWidth();this._tooltip.hide();var f=n.getOffsets("offset");var k=n.getDimensions("outer");var m=this._tooltip.getDimensions("outer");var a=this._tooltip.getDimensions("inner");var h=f.left+Math.ceil(k.width/2);var i=Math.ceil(m.width/2);var g="center";if((h-i)<5){g="left"}else{if((this._viewportDimensions.width-5)<(h+i)){g="right"}}if(f.top+k.height+m.height-$(document).scrollTop()<$(window).height()){var e=f.top+k.height+7;this._tooltip.removeClass("inverse");l.css("top",-5)}else{var e=f.top-m.height-7;this._tooltip.addClass("inverse");l.css("top",m.height)}switch(g){case"center":var d=Math.round(f.left-i+(k.width/2));l.css({left:(a.width/2-b/2)+"px"});break;case"left":var d=f.left;l.css({left:"5px"});break;case"right":var d=f.left+k.width-m.width;l.css({left:(a.width-b-5)+"px"});break}this._tooltip.css({top:e+"px",left:d+"px"});this._tooltip.wcfFadeIn()},_mouseLeaveHandler:function(a){this._tooltip.stop().hide().css({opacity:1})}});WCF.CloseOverlayHandler={_callbacks:new WCF.Dictionary(),_isListening:false,addCallback:function(a,b){this._bindListener();if(this._callbacks.isset(a)){console.debug("[WCF.CloseOverlayHandler] identifier '"+a+"' is already bound to a callback");return false}this._callbacks.add(a,b)},removeCallback:function(a){if(this._callbacks.isset(a)){this._callbacks.remove(a)}},_bindListener:function(){if(this._isListening){return}$("body").click($.proxy(this._executeCallbacks,this));this._isListening=true},_executeCallbacks:function(a){this._callbacks.each(function(b){b.value()})}};WCF.DOMNodeInsertedHandler={_callbacks:[],_isExecuting:false,addCallback:function(a,b){this._callbacks.push(b)},_executeCallbacks:function(){if(this._isExecuting){return}this._isExecuting=true;for(var b=0,a=this._callbacks.length;b<a;b++){this._callbacks[b]()}this._isExecuting=false},execute:function(){this._executeCallbacks()}};WCF.DOMNodeRemovedHandler={_callbacks:new WCF.Dictionary(),_isExecuting:false,_isListening:false,addCallback:function(a,b){this._bindListener();if(this._callbacks.isset(a)){console.debug("[WCF.DOMNodeRemovedHandler] identifier '"+a+"' is already bound to a callback");return false}this._callbacks.add(a,b)},removeCallback:function(a){if(this._callbacks.isset(a)){this._callbacks.remove(a)}},_bindListener:function(){if(this._isListening){return}$(document).bind("DOMNodeRemoved",$.proxy(this._executeCallbacks,this));this._isListening=true},_executeCallbacks:function(a){if(this._isExecuting){return}this._isExecuting=true;this._callbacks.each(function(b){b.value(a)});this._isExecuting=false}};WCF.PageVisibilityHandler={_callbacks:new WCF.Dictionary(),_isListening:false,_hiddenFieldName:"",addCallback:function(a,b){this._bindListener();if(this._callbacks.isset(a)){console.debug("[WCF.PageVisibilityHandler] identifier '"+a+"' is already bound to a callback");return false}this._callbacks.add(a,b)},removeCallback:function(a){if(this._callbacks.isset(a)){this._callbacks.remove(a)}},_bindListener:function(){if(this._isListening){return}var a=null;if(typeof document.hidden!=="undefined"){this._hiddenFieldName="hidden";a="visibilitychange"}else{if(typeof document.mozHidden!=="undefined"){this._hiddenFieldName="mozHidden";a="mozvisibilitychange"}else{if(typeof document.msHidden!=="undefined"){this._hiddenFieldName="msHidden";a="msvisibilitychange"}else{if(typeof document.webkitHidden!=="undefined"){this._hiddenFieldName="webkitHidden";a="webkitvisibilitychange"}}}}if(a===null){console.debug("[WCF.PageVisibilityHandler] This browser does not support the page visibility API.")}else{$(document).on(a,$.proxy(this._executeCallbacks,this))}this._isListening=true},_executeCallbacks:function(b){if(this._isExecuting){return}this._isExecuting=true;var a=document[this._hiddenFieldName];this._callbacks.each(function(c){c.value(a)});this._isExecuting=false}};WCF.Table={};WCF.Table.EmptyTableHandler=Class.extend({_options:{},_rowClassName:"",init:function(b,c,a){this._rowClassName=c;this._tableContainer=b;this._options=$.extend(true,{emptyMessage:null,messageType:"info",refreshPage:false,updatePageNumber:false},a||{});WCF.DOMNodeRemovedHandler.addCallback("WCF.Table.EmptyTableHandler."+c,$.proxy(this._remove,this))},_remove:function(e){var d=$(e.target);if(d.hasClass(this._rowClassName)){var c=d.parents("tbody:eq(0)");if(c.children("tr").length==1){if(this._options.emptyMessage){this._tableContainer.replaceWith($("<p />").addClass(this._options.messageType).text(this._options.emptyMessage))}else{if(this._options.refreshPage){if(this._options.updatePageNumber){var a=window.location.href.match(/(\?|&)pageNo=(\d+)/g);if(a){var b=a[a.length-1].match(/\d+/g);if(this._options.updatePageNumber>0){b++}else{b--}window.location=window.location.href.replace(a[a.length-1],a[a.length-1][0]+"pageNo="+b)}}else{window.location.reload()}}else{this._tableContainer.remove()}}}}}});WCF.Search={};WCF.Search.Base=Class.extend({_callback:null,_className:"",_commaSeperated:false,_delay:0,_excludedSearchValues:[],_itemCount:0,_itemIndex:-1,_list:null,_oldSearchString:[],_proxy:null,_searchInput:null,_triggerLength:3,_timer:null,init:function(b,e,a,c,d){if(e!==null&&e!==undefined&&!$.isFunction(e)){console.debug("[WCF.Search.Base] The given callback is invalid, aborting.");return}this._callback=(e)?e:null;this._delay=0;this._excludedSearchValues=[];if(a){this._excludedSearchValues=a}this._searchInput=$(b);if(!this._searchInput.length){console.debug("[WCF.Search.Base] Selector '"+b+"' for search input is invalid, aborting.");return}this._searchInput.keydown($.proxy(this._keyDown,this)).keyup($.proxy(this._keyUp,this)).wrap('<span class="dropdown" />');if($.browser.mozilla&&$.browser.touch){this._searchInput.on("input",$.proxy(this._keyUp,this))}this._list=$('<ul class="dropdownMenu" />').insertAfter(this._searchInput);this._commaSeperated=(c)?true:false;this._oldSearchString=[];this._itemCount=0;this._itemIndex=-1;this._proxy=new WCF.Action.Proxy({showLoadingOverlay:(d!==true?false:true),success:$.proxy(this._success,this),autoAbortPrevious:true});if(this._searchInput.is("input")){this._searchInput.attr("autocomplete","off")}this._searchInput.blur($.proxy(this._blur,this));WCF.Dropdown.initDropdownFragment(this._searchInput.parent(),this._list)},_blur:function(){var a=this;new WCF.PeriodicalExecuter(function(b){if(a._list.is(":visible")){a._clearList(false)}b.stop()},250)},_keyDown:function(a){if(a.which===$.ui.keyCode.ENTER){var b=this._searchInput.parents(".dropdown");if(b.data("disableAutoFocus")){if(this._itemIndex!==-1){a.preventDefault()}}else{if(b.data("preventSubmit")||this._itemIndex!==-1){a.preventDefault()}}}},_keyUp:function(d){switch(d.which){case 37:case 39:return;break;case 38:this._selectPreviousItem();return;break;case 40:this._selectNextItem();return;break;case 13:return this._selectElement(d);break}var b=this._getSearchString(d);if(b===""){this._clearList(true)}else{if(b.length>=this._triggerLength){var c={data:{excludedSearchValues:this._excludedSearchValues,searchString:b}};if(this._delay){if(this._timer!==null){this._timer.stop()}var a=this;this._timer=new WCF.PeriodicalExecuter(function(){a._queryServer(c);a._timer.stop();a._timer=null},this._delay)}else{this._queryServer(c)}}else{this._clearList(false)}}},_queryServer:function(a){this._searchInput.parents(".searchBar").addClass("loading");this._proxy.setOption("data",{actionName:"getSearchResultList",className:this._className,interfaceName:"wcf\\data\\ISearchAction",parameters:this._getParameters(a)});this._proxy.sendRequest()},setDelay:function(a){this._delay=a},_selectNextItem:function(){if(this._itemCount===0){return}this._itemIndex++;if(this._itemIndex===this._itemCount){this._itemIndex=0}this._highlightSelectedElement()},_selectPreviousItem:function(){if(this._itemCount===0){return}this._itemIndex--;if(this._itemIndex===-1){this._itemIndex=this._itemCount-1}this._highlightSelectedElement()},_highlightSelectedElement:function(){this._list.find("li").removeClass("dropdownNavigationItem");this._list.find("li:eq("+this._itemIndex+")").addClass("dropdownNavigationItem")},_selectElement:function(a){if(this._itemCount===0){return true}this._list.find("li.dropdownNavigationItem").trigger("click");return false},_getSearchString:function(d){var a=$.trim(this._searchInput.val());if(this._commaSeperated){var c=d.keyCode||d.which;if(c==$.ui.keyCode.COMMA){return""}var b=a.split(",");var e=b.length;for(var g=0;g<e;g++){b[g]=$.trim(b[g])}for(var g=0;g<e;g++){var f=b[g];if(this._oldSearchString[g]){if(f!=this._oldSearchString[g]){a=f;break}}else{a=f;break}}this._oldSearchString=b}return a},_getParameters:function(a){return a},_success:function(d,f,c){this._clearList(false);this._searchInput.parents(".searchBar").removeClass("loading");if($.getLength(d.returnValues)){for(var e in d.returnValues){var a=d.returnValues[e];this._createListItem(a)}}else{if(!this._handleEmptyResult()){return}}WCF.CloseOverlayHandler.addCallback("WCF.Search.Base",$.proxy(function(){this._clearList()},this));var b=this._searchInput.parents(".dropdown").wcfIdentify();if(!WCF.Dropdown.getDropdownMenu(b).hasClass("dropdownOpen")){WCF.Dropdown.toggleDropdown(b)}this._itemIndex=-1;if(!WCF.Dropdown.getDropdown(b).data("disableAutoFocus")){this._selectNextItem()}},_handleEmptyResult:function(){return false},_createListItem:function(b){var a=$("<li><span>"+WCF.String.escapeHTML(b.label)+"</span></li>").appendTo(this._list);a.data("objectID",b.objectID).data("label",b.label).click($.proxy(this._executeCallback,this));this._itemCount++;return a},_executeCallback:function(d){var a=false;var c=$(d.currentTarget);if(this._commaSeperated){var b=c.data("label");for(var h=0,f=this._oldSearchString.length;h<f;h++){var g=this._oldSearchString[h];if(b.toLowerCase().indexOf(g.toLowerCase())===0){this._oldSearchString[h]=b;this._searchInput.val(this._oldSearchString.join(", "));if($.browser.webkit){this._searchInput.css({display:"block"})}var e=this._searchInput.val().toLowerCase().indexOf(b.toLowerCase())+b.length;this._searchInput.focus().setCaret(e);break}}}else{if(this._callback===null){this._searchInput.val(c.data("label"))}else{a=(this._callback(c.data())===true)?true:false}}this._clearList(a)},_clearList:function(a){if(a&&!this._commaSeperated){this._searchInput.val("")}WCF.Dropdown.getDropdown(this._searchInput.parents(".dropdown").wcfIdentify()).removeClass("dropdownOpen");WCF.Dropdown.getDropdownMenu(this._searchInput.parents(".dropdown").wcfIdentify()).removeClass("dropdownOpen");this._list.end().empty();WCF.CloseOverlayHandler.removeCallback("WCF.Search.Base");this._itemCount=0;this._itemIndex=-1},addExcludedSearchValue:function(a){if(!WCF.inArray(a,this._excludedSearchValues)){this._excludedSearchValues.push(a)}},removeExcludedSearchValue:function(b){var a=$.inArray(b,this._excludedSearchValues);if(a!=-1){this._excludedSearchValues.splice(a,1)}}});WCF.Search.User=WCF.Search.Base.extend({_className:"wcf\\data\\user\\UserAction",_includeUserGroups:false,init:function(c,e,a,b,d){this._includeUserGroups=a;this._super(c,e,b,d)},_getParameters:function(a){a.data.includeUserGroups=this._includeUserGroups?1:0;return a},_createListItem:function(e){var d=this._super(e);var b=null;if(e.icon){b=$(e.icon)}else{if(this._includeUserGroups&&e.type==="group"){b=$('<span class="icon icon16 icon-group" />')}}if(b){var a=d.find("span").detach();var c=$("<div />").addClass("box16").appendTo(d);c.append(b);c.append($("<div />").append(a))}d.data("type",e.type);return d}});WCF.System={};WCF.System.Dependency={};WCF.System.Dependency.Manager={_callbacks:{},_loaded:[],_setupCallbacks:{},register:function(a,b){if(!$.isFunction(b)){console.debug("[WCF.System.Dependency.Manager] Callback for identifier '"+a+"' is invalid, aborting.");return}if(WCF.inArray(a,this._loaded)){setTimeout(function(){b()},1)}else{if(!this._callbacks[a]){this._callbacks[a]=[]}this._callbacks[a].push(b)}},setup:function(a,b){if(!$.isFunction(b)){console.debug("[WCF.System.Dependency.Manager] Setup callback for identifier '"+a+"' is invalid, aborting.");return}if(!this._setupCallbacks[a]){this._setupCallbacks[a]=[]}this._setupCallbacks[a].push(b)},invoke:function(a){if(this._setupCallbacks[a]){for(var c=0,b=this._setupCallbacks[a].length;c<b;c++){this._setupCallbacks[a][c]()}delete this._setupCallbacks[a]}this._loaded.push(a);if(this._callbacks[a]){for(var c=0,b=this._callbacks[a].length;c<b;c++){this._callbacks[a][c]()}delete this._callbacks[a]}}};WCF.System.FlexibleMenu={_containers:{},_containerIDs:[],_dropdowns:{},_dropdownMenus:{},_hasHiddenItems:{},_isWorking:false,_menuItems:{},init:function(){this.registerMenu("mainMenu");this.registerMenu($(".navigationHeader:eq(0)").wcfIdentify());this._registerTabMenus();$(window).resize($.proxy(this.rebuildAll,this));WCF.DOMNodeInsertedHandler.addCallback("WCF.System.FlexibleMenu",$.proxy(this._registerTabMenus,this))},_registerTabMenus:function(){$(".tabMenuContainer:not(.jsFlexibleMenuEnabled)").each(function(a,b){var c=$(b).children("nav");if(c.length&&c.find("> ul:eq(0) > li").length){WCF.System.FlexibleMenu.registerMenu(c.wcfIdentify())}})},registerMenu:function(a){var b=$("#"+a);if(!b.length){console.debug("[WCF.System.FlexibleMenu] Unable to find container identified by '"+a+"', aborting.");return}this._containerIDs.push(a);this._containers[a]=b;this._menuItems[a]=b.find("> ul:eq(0) > li");this._dropdowns[a]=$('<li class="dropdown"><a class="icon icon16 icon-list" /></li>').data("containerID",a).click($.proxy(this._click,this));this._dropdownMenus[a]=$('<ul class="dropdownMenu" />').appendTo(this._dropdowns[a]);this._hasHiddenItems[a]=false;this.rebuild(a);WCF.Dropdown.initDropdown(this._dropdowns[a].children("a"))},rebuildAll:function(){if(this._isWorking){return}this._isWorking=true;for(var b=0,a=this._containerIDs.length;b<a;b++){this.rebuild(this._containerIDs[b])}this._isWorking=false},rebuild:function(i){if(!this._containers[i]){console.debug("[WCF.System.FlexibleMenu] Cannot rebuild unknown container identified by '"+i+"'");return}var c=false;var j=this._containers[i];var b=0;var d=this._menuItems[i].filter(":visible");for(var h=0,e=d.length;h<e;h++){b+=$(d[h]).outerWidth(true)}if(!this._hasHiddenItems[i]){this._dropdowns[i].appendTo(j.children("ul:eq(0)"))}var f=this._dropdowns[i].outerWidth(true);if(!this._hasHiddenItems[i]){this._dropdowns[i].detach()}var a=j.parent().innerWidth();a-=parseInt(j.parent().css("padding-left").replace(/px$/,""))+parseInt(j.parent().css("padding-right").replace(/px$/,""));a-=parseInt(j.css("margin-left").replace(/px$/,""))+parseInt(j.css("margin-right").replace(/px$/,""));a-=parseInt(j.css("padding-left").replace(/px$/,""))+parseInt(j.css("padding-right").replace(/px$/,""));a-=parseInt(j.children("ul:eq(0)").css("padding-left").replace(/px$/,""))+parseInt(j.children("ul:eq(0)").css("padding-right").replace(/px$/,""));if(b>a||(this._hasHiddenItems[i]&&(b>a-f))){var d=d.filter(":not(.active):not(.ui-state-active):visible");a-=f;for(var h=(d.length-1);h>=0;h--){if(b>a){var g=$(d[h]);b-=g.outerWidth(true);g.hide();c=true;this._hasHiddenItems[i]=true}else{break}}if(this._hasHiddenItems[i]){this._dropdowns[i].appendTo(j.children("ul:eq(0)"))}}else{if(this._hasHiddenItems[i]&&b<a){var k=this._menuItems[i].filter(":not(:visible)");a-=f;for(var h=0,e=k.length;h<e;h++){var g=$(k[h]);b+=g.outerWidth();if(h+1==e){a+=f}if(b<a){g.css("display","");c=true}else{break}}if(c){this._hasHiddenItems[i]=(this._menuItems[i].filter(":not(:visible)").length>0);if(!this._hasHiddenItems[i]){this._dropdowns[i].detach()}}}}if(c){this._dropdownMenus[i].empty();this._menuItems[i].filter(":not(:visible)").each($.proxy(function(l,m){$("<li>"+$(m).html()+"</li>").appendTo(this._dropdownMenus[i])},this))}}};WCF.System.Mobile={};WCF.System.Mobile.UX={_enabled:false,_main:null,_sidebar:null,init:function(){this._enabled=false;this._main=$("#main");this._sidebar=this._main.find("> div > div > .sidebar");if($.browser.touch){$("html").addClass("touch")}enquire.register("screen and (max-width: 800px)",{match:$.proxy(this._enable,this),unmatch:$.proxy(this._disable,this),setup:$.proxy(this._setup,this),deferSetup:true});if($.browser.msie&&this._sidebar.width()>305){this._sidebar.css("display","none").css("display","")}},_setup:function(){this._initSidebarToggleButtons();this._initSearchBar();this._initButtonGroupNavigation();WCF.CloseOverlayHandler.addCallback("WCF.System.Mobile.UX",$.proxy(this._closeMenus,this));WCF.DOMNodeInsertedHandler.addCallback("WCF.System.Mobile.UX",$.proxy(this._initButtonGroupNavigation,this))},_enable:function(){this._enabled=true;if($.browser.msie){this._sidebar.css("display","none").css("display","")}},_disable:function(){this._enabled=false;if($.browser.msie){this._sidebar.css("display","none").css("display","")}},_initSidebarToggleButtons:function(){var c=this._main.hasClass("sidebarOrientationLeft");var b=this._main.hasClass("sidebarOrientationRight");if(c||b){var d="wcf.global.sidebar.show"+(c?"Left":"Right")+"Sidebar";if(d===WCF.Language.get(d)||WCF.Language.get(d)===""){d='<span class="icon icon16 icon-double-angle-'+(c?"left":"right")+'" />'}var e="wcf.global.sidebar.hide"+(c?"Left":"Right")+"Sidebar";if(e===WCF.Language.get(e)||WCF.Language.get(e)===""){e='<span class="icon icon16 icon-double-angle-'+(c?"right":"left")+'" />'}var a=this;$('<span class="button small mobileSidebarToggleButton">'+d+"</span>").appendTo($(".content")).click(function(){a._main.addClass("mobileShowSidebar")});$('<span class="button small mobileSidebarToggleButton">'+e+"</span>").appendTo($(".sidebar")).click(function(){a._main.removeClass("mobileShowSidebar")})}},_initSearchBar:function(){var b=$(".searchBar:eq(0)");var a=this;b.click(function(){if(a._enabled){b.addClass("searchBarOpen")}});this._main.click(function(){b.removeClass("searchBarOpen")})},_initButtonGroupNavigation:function(){$(".buttonGroupNavigation:not(.jsMobileButtonGroupNavigation)").each(function(b,a){var d=$(a).addClass("jsMobileButtonGroupNavigation");var c=$('<a class="dropdownLabel"><span class="icon icon24 icon-list" /></a>').prependTo(d);c.click(function(){c.next().toggleClass("open");return false})})},_closeMenus:function(){$(".jsMobileButtonGroupNavigation > ul.open").removeClass("open")}};WCF.System.Page.Multiple=Class.extend({_cache:{},_options:{},_pageNo:1,_pages:0,init:function(a){this._options=$.extend({container:null,pagination:null,loadItems:null},a)},_showPage:function(a,b){if(b&&b.activePage){if(!b.template){this._previousPageNo=this._pageNo}this._pageNo=b.activePage}if(this._cache[this._pageNo]||(b&&b.template)){this._cache[this._previousPageNo]=this._list.children().detach();if(b&&b.template){this._list.html(b.template)}else{this._list.append(this._cache[this._pageNo])}}else{this._loadItems()}},showPage:function(a,b){this._showPage(null,{activePage:a,template:b})}});WCF.System.Notification=Class.extend({_callback:null,_cssClassNames:"",_message:"",_overlay:null,init:function(a,b){this._cssClassNames=b||"success";this._message=a||WCF.Language.get("wcf.global.success");this._overlay=$("#systemNotification");if(!this._overlay.length){this._overlay=$('<div id="systemNotification"><p></p></div>').hide().appendTo(document.body)}},show:function(d,b,a,c){b=parseInt(b);if(!b){b=2000}if(d&&$.isFunction(d)){this._callback=d}this._overlay.children("p").html((a||this._message));this._overlay.children("p").removeClass().addClass((c||this._cssClassNames));new WCF.PeriodicalExecuter($.proxy(this._hide,this),b);this._overlay.wcfFadeIn(undefined,300)},_hide:function(a){if(this._callback!==null){this._callback()}this._overlay.wcfFadeOut(undefined,300);a.stop()}});WCF.System.Confirmation={_callback:null,_dialog:null,_parameters:null,_visible:false,_confirmationButton:null,show:function(c,e,b,a){if(this._visible){console.debug("[WCF.System.Confirmation] Confirmation dialog is already open, refusing action.");return}if(!$.isFunction(e)){console.debug("[WCF.System.Confirmation] Given callback is invalid, aborting.");return}this._callback=e;this._parameters=b;var d=true;if(this._dialog===null){this._createDialog();d=false}this._dialog.find("#wcfSystemConfirmationContent").empty().hide();if(a&&a.length){a.appendTo(this._dialog.find("#wcfSystemConfirmationContent").show())}this._dialog.find("p").text(c);this._dialog.wcfDialog({onClose:$.proxy(this._close,this),onShow:$.proxy(this._show,this),title:WCF.Language.get("wcf.global.confirmation.title")});if(d){this._dialog.wcfDialog("render")}this._confirmationButton.focus();this._visible=true},_createDialog:function(){this._dialog=$('<div id="wcfSystemConfirmation" class="systemConfirmation"><p /><div id="wcfSystemConfirmationContent" /></div>').hide().appendTo(document.body);var a=$('<div class="formSubmit" />').appendTo(this._dialog);this._confirmationButton=$('<button class="buttonPrimary">'+WCF.Language.get("wcf.global.confirmation.confirm")+"</button>").data("action","confirm").click($.proxy(this._click,this)).appendTo(a);$("<button>"+WCF.Language.get("wcf.global.confirmation.cancel")+"</button>").data("action","cancel").click($.proxy(this._click,this)).appendTo(a)},_click:function(a){this._notify($(a.currentTarget).data("action"))},_close:function(){if(this._visible){this._notify("cancel")}},_notify:function(a){this._visible=false;this._dialog.wcfDialog("close");this._callback(a,this._parameters)},_show:function(){this._dialog.find("button.buttonPrimary").blur().focus()}};WCF.System.DisableScrolling={_depth:0,_oldOverflow:null,disable:function(){if($.browser.touch){return}if(this._depth===0){this._oldOverflow=$(document.body).css("overflow");$(document.body).css("overflow","hidden")}this._depth++},enable:function(){if(this._depth===0){return}this._depth--;if(this._depth===0){$(document.body).css("overflow",this._oldOverflow)}}};WCF.System.PageNavigation={_button:null,_description:null,_dialog:null,_elementID:"",_elements:{},_pageNo:null,init:function(a,c){var b=$(a);if(!b.length){return}c=c||null;if(c!==null&&!$.isFunction(c)){console.debug("[WCF.System.PageNavigation] Callback for selector '"+a+"' is invalid, aborting.");return}this._initElements(b,c)},_initElements:function(b,c){var a=this;b.each(function(e,f){var d=$(f);var g=d.wcfIdentify();if(a._elements[g]===undefined){a._elements[g]=d;d.find("li.jumpTo").data("elementID",g).click($.proxy(a._click,a))}}).data("callback",c)},_click:function(b){this._elementID=$(b.currentTarget).data("elementID");if(this._dialog===null){this._dialog=$('<div id="pageNavigationOverlay" />').hide().appendTo(document.body);var c=$("<fieldset><legend>"+WCF.Language.get("wcf.global.page.jumpTo")+"</legend></fieldset>").appendTo(this._dialog);$('<dl><dt><label for="jsPageNavigationPageNo">'+WCF.Language.get("wcf.global.page.jumpTo")+"</label></dt><dd></dd></dl>").appendTo(c);this._pageNo=$('<input type="number" id="jsPageNavigationPageNo" value="1" min="1" max="1" class="tiny" />').keyup($.proxy(this._keyUp,this)).appendTo(c.find("dd"));this._description=$("<small></small>").insertAfter(this._pageNo);var a=$('<div class="formSubmit" />').appendTo(this._dialog);this._button=$('<button class="buttonPrimary">'+WCF.Language.get("wcf.global.button.submit")+"</button>").click($.proxy(this._submit,this)).appendTo(a)}this._button.enable();this._description.html(WCF.Language.get("wcf.global.page.jumpTo.description").replace(/#pages#/,this._elements[this._elementID].data("pages")));this._pageNo.val(this._elements[this._elementID].data("pages")).attr("max",this._elements[this._elementID].data("pages"));this._dialog.wcfDialog({title:WCF.Language.get("wcf.global.page.pageNavigation")})},_keyUp:function(b){if(b.which==$.ui.keyCode.ENTER&&!this._button.prop("disabled")){this._submit();return}var a=parseInt(this._pageNo.val())||0;if(a<1||a>this._pageNo.attr("max")){this._button.disable()}else{this._button.enable()}},_submit:function(){var b=this._elements[this._elementID];if(b.data("callback")===null){var a=b.data("link").replace(/pageNo=%d/,"pageNo="+this._pageNo.val());window.location=a}else{b.data("callback")(this._pageNo.val());this._dialog.wcfDialog("close")}}};WCF.System.KeepAlive=Class.extend({init:function(a){new WCF.PeriodicalExecuter(function(b){new WCF.Action.Proxy({autoSend:true,data:{actionName:"keepAlive",className:"wcf\\data\\session\\SessionAction"},failure:function(){b.stop()},showLoadingOverlay:false,suppressErrors:true})},(a*1000))}});WCF.InlineEditor=Class.extend({_callbacks:[],_dropdowns:{},_elements:{},_notification:null,_options:[],_proxy:null,_updateData:[],init:function(d){var c=$(d);if(!c.length){return}this._setOptions();var b="";for(var f=0,e=this._options.length;f<e;f++){if(this._options[f].isQuickOption){b=this._options[f].optionName;break}}var a=this;c.each(function(i,j){var h=$(j);var k=h.wcfIdentify();var g=a._getTriggerElement(h);if(g===null||g.length!==1){return}g.click($.proxy(a._show,a)).data("elementID",k);if(b){g.disableSelection().data("optionName",b).dblclick($.proxy(a._click,a))}a._elements[k]=h});this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)});WCF.CloseOverlayHandler.addCallback("WCF.InlineEditor",$.proxy(this._closeAll,this));this._notification=new WCF.System.Notification(WCF.Language.get("wcf.global.success"),"success")},_closeAll:function(){for(var a in this._elements){this._hide(a)}},_setOptions:function(){this._options=[]},registerCallback:function(a){if($.isFunction(a)){this._callbacks.push(a)}},_getTriggerElement:function(a){return null},_show:function(b){var g=$(b.currentTarget).data("elementID");var h=null;if(!this._dropdowns[g]){h=this._getTriggerElement(this._elements[g]).addClass("dropdownToggle").wrap('<span class="dropdown" />');this._dropdowns[g]=$('<ul class="dropdownMenu" />').insertAfter(h)}this._dropdowns[g].empty();var c=false;var d="";for(var k=0,i=this._options.length;k<i;k++){var a=this._options[k];if(a.optionName==="divider"){if(d!==""&&d!=="divider"){$('<li class="dropdownDivider" />').appendTo(this._dropdowns[g]);d=a.optionName}}else{if(this._validate(g,a.optionName)||this._validateCallbacks(g,a.optionName)){var f=$("<li><span>"+a.label+"</span></li>").appendTo(this._dropdowns[g]);f.data("elementID",g).data("optionName",a.optionName).data("isQuickOption",(a.isQuickOption?true:false)).click($.proxy(this._click,this));c=true;d=a.optionName}}}if(c){var l=this._dropdowns[g].children().last();if(l.hasClass("dropdownDivider")){l.remove()}var j=null;var e=0;this._dropdowns[g].children().each(function(m,o){var n=$(o);if(!n.hasClass("dropdownDivider")){if(n.data("isQuickOption")){j=n}else{e++}}});if(!e){j.trigger("click");if(h!==null){WCF.Dropdown.close(h.parents(".dropdown").wcfIdentify())}return false}}if(h!==null){WCF.Dropdown.initDropdown(h,true)}return false},_validate:function(a,b){return false},_validateCallbacks:function(a,b){var c=this._callbacks.length;if(c){for(var d=0;d<c;d++){if(this._callbacks[d].validate(this._elements[a],b)){return true}}}return false},_success:function(b,d,a){var c=this._updateData.length;if(!c){return}this._updateState(b);this._updateData=[]},_updateState:function(a){},_click:function(c){var b=$(c.currentTarget);var d=b.data("elementID");var a=b.data("optionName");if(!this._execute(d,a)){this._executeCallback(d,a)}this._hide(d)},_execute:function(a,b){return false},_executeCallback:function(a,b){var c=this._callbacks.length;if(c){for(var d=0;d<c;d++){if(this._callbacks[d].execute(this._elements[a],b)){return true}}}return false},_hide:function(a){if(this._dropdowns[a]){this._dropdowns[a].empty().removeClass("dropdownOpen")}}});WCF.Upload=Class.extend({_name:"__files[]",_buttonSelector:null,_fileListSelector:null,_fileUpload:null,_className:"",_iframe:null,_internalFileID:0,_options:{},_uploadMatrix:[],_supportsAJAXUpload:true,_overlay:null,init:function(c,e,d,b){this._buttonSelector=c;this._fileListSelector=e;this._className=d;this._internalFileID=0;this._options=$.extend(true,{action:"upload",multiple:false,url:"index.php/AJAXUpload/?t="+SECURITY_TOKEN+SID_ARG_2ND},b||{});var a=new XMLHttpRequest();this._supportsAJAXUpload=(a&&("upload" in a)&&("onprogress" in a.upload));this._createButton()},_createButton:function(){if(this._supportsAJAXUpload){this._fileUpload=$('<input type="file" name="'+this._name+'" '+(this._options.multiple?'multiple="true" ':"")+"/>");this._fileUpload.change($.proxy(this._upload,this));var a=$('<p class="button uploadButton"><span>'+WCF.Language.get("wcf.global.button.upload")+"</span></p>");a.prepend(this._fileUpload)}else{var a=$('<p class="button uploadFallbackButton"><span>'+WCF.Language.get("wcf.global.button.upload")+"</span></p>");a.click($.proxy(this._showOverlay,this))}this._insertButton(a)},_insertButton:function(a){this._buttonSelector.append(a)},_removeButton:function(){var a=".uploadButton";if(!this._supportsAJAXUpload){a=".uploadFallbackButton"}this._buttonSelector.find(a).remove()},_upload:function(){var a=this._fileUpload.prop("files");if(a.length){var i=new FormData();var f=this._createUploadMatrix(a);if(!this._uploadMatrix[f].length){return}for(var d=0,c=a.length;d<c;d++){if(this._uploadMatrix[f][d]){var e=this._uploadMatrix[f][d].data("internalFileID");i.append("__files["+e+"]",a[d])}}i.append("actionName",this._options.action);i.append("className",this._className);var b=this._getParameters();for(var h in b){i.append("parameters["+h+"]",b[h])}var g=this;$.ajax({type:"POST",url:this._options.url,enctype:"multipart/form-data",data:i,contentType:false,processData:false,success:function(k,l,j){g._success(f,k)},error:$.proxy(this._error,this),xhr:function(){var j=$.ajaxSettings.xhr();if(j){j.upload.addEventListener("progress",function(k){g._progress(f,k)},false)}return j}})}},_createUploadMatrix:function(b){if(b.length){var c=this._uploadMatrix.length;this._uploadMatrix[c]=[];for(var f=0,d=b.length;f<d;f++){var a=b[f];var e=this._initFile(a);if(!e.hasClass("uploadFailed")){e.data("filename",a.name).data("internalFileID",this._internalFileID++);this._uploadMatrix[c][f]=e}}return c}return null},_success:function(b,a){},_error:function(a,c,b){},_progress:function(c,a){var b=Math.round(a.loaded*100/a.total);for(var d in this._uploadMatrix[c]){this._uploadMatrix[c][d].find("progress").attr("value",b)}},_getParameters:function(){return{}},_initFile:function(a){return $("<li>"+a.name+" ("+a.size+')<progress max="100" /></li>').appendTo(this._fileListSelector)},_showOverlay:function(){if(this._iframe===null){this._iframe=$('<iframe name="__fileUploadIFrame" />').hide().appendTo(document.body)}if(!this._overlay){this._overlay=$('<div><form enctype="multipart/form-data" method="post" action="'+this._options.url+'" target="__fileUploadIFrame" /></div>').hide().appendTo(document.body);var a=this._overlay.find("form");$('<dl class="wide"><dd><input type="file" id="__fileUpload" name="'+this._name+'" '+(this._options.multiple?'multiple="true" ':"")+"/></dd></dl>").appendTo(a);$('<div class="formSubmit"><input type="submit" value="Upload" accesskey="s" /></div></form>').appendTo(a);$('<input type="hidden" name="isFallback" value="1" />').appendTo(a);$('<input type="hidden" name="actionName" value="'+this._options.action+'" />').appendTo(a);$('<input type="hidden" name="className" value="'+this._className+'" />').appendTo(a);var b=this._getParameters();for(var c in b){$('<input type="hidden" name="'+c+'" value="'+b[c]+'" />').appendTo(a)}a.submit($.proxy(function(){var d={name:this._getFilename(),size:""};var f=this._createUploadMatrix([d]);var e=this;this._iframe.data("loading",true).off("load").load(function(){e._evaluateResponse(f)});this._overlay.wcfDialog("close")},this))}this._overlay.wcfDialog({title:WCF.Language.get("wcf.global.button.upload")})},_evaluateResponse:function(b){var a=$.parseJSON(this._iframe.contents().find("pre").html());this._success(b,a)},_getFilename:function(){return $("#__fileUpload").val().split("\\").pop()}});WCF.Upload.Parallel=WCF.Upload.extend({init:function(b,d,c,a){a=$.extend(true,a||{},{multiple:true});this._super(b,d,c,a)},_upload:function(){var b=this._fileUpload.prop("files");for(var h=0,e=b.length;h<e;h++){var a=b[h];var c=new FormData();var g=this._createUploadMatrix(a);if(!this._uploadMatrix[g].length){continue}c.append("__files["+g+"]",a);c.append("actionName",this._options.action);c.append("className",this._className);var d=this._getParameters();for(var f in d){c.append("parameters["+f+"]",d[f])}this._sendRequest(g,c)}},_sendRequest:function(c,b){var a=this;$.ajax({type:"POST",url:this._options.url,enctype:"multipart/form-data",data:b,contentType:false,processData:false,success:function(e,f,d){a._success(c,e)},error:$.proxy(this._error,this),xhr:function(){var d=$.ajaxSettings.xhr();if(d){d.upload.addEventListener("progress",function(e){a._progress(c,e)},false)}return d}})},_createUploadMatrix:function(a){var b=this._initFile(a);if(!b.hasClass("uploadFailed")){b.data("filename",a.name).data("internalFileID",this._internalFileID);this._uploadMatrix[this._internalFileID++]=b;return this._internalFileID-1}return null},_success:function(b,a){},_progress:function(b,a){var c=Math.round(a.loaded*100/a.total);this._uploadMatrix[b].find("progress").attr("value",c)},_showOverlay:function(){if(this._iframe===null){this._iframe=$('<iframe name="__fileUploadIFrame" />').hide().appendTo(document.body)}if(!this._overlay){this._overlay=$('<div><form enctype="multipart/form-data" method="post" action="'+this._options.url+'" target="__fileUploadIFrame" /></div>').hide().appendTo(document.body);var a=this._overlay.find("form");$('<dl class="wide"><dd><input type="file" id="__fileUpload" name="'+this._name+'" '+(this._options.multiple?'multiple="true" ':"")+"/></dd></dl>").appendTo(a);$('<div class="formSubmit"><input type="submit" value="Upload" accesskey="s" /></div></form>').appendTo(a);$('<input type="hidden" name="isFallback" value="1" />').appendTo(a);$('<input type="hidden" name="actionName" value="'+this._options.action+'" />').appendTo(a);$('<input type="hidden" name="className" value="'+this._className+'" />').appendTo(a);var b=this._getParameters();for(var c in b){$('<input type="hidden" name="'+c+'" value="'+b[c]+'" />').appendTo(a)}a.submit($.proxy(function(){var d={name:this._getFilename(),size:""};var f=this._createUploadMatrix(d);var e=this;this._iframe.data("loading",true).off("load").load(function(){e._evaluateResponse(f)});this._overlay.wcfDialog("close")},this))}this._overlay.wcfDialog({title:WCF.Language.get("wcf.global.button.upload")})},_evaluateResponse:function(b){var a=$.parseJSON(this._iframe.contents().find("pre").html());this._success(b,a)}});WCF.Sortable={};WCF.Sortable.List=Class.extend({_additionalParameters:{},_className:"",_containerID:"",_container:null,_notification:null,_offset:0,_options:{},_proxy:null,_structure:{},init:function(a,f,g,d,e,c){this._additionalParameters=c||{};this._containerID=$.wcfEscapeID(a);this._container=$("#"+this._containerID);this._className=f;this._offset=(g)?g:0;this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)});this._structure={};this._options=$.extend(true,{axis:"y",connectWith:"#"+this._containerID+" .sortableList",disableNesting:"sortableNoNesting",doNotClear:true,errorClass:"sortableInvalidTarget",forcePlaceholderSize:true,helper:"clone",items:"li:not(.sortableNoSorting)",opacity:0.6,placeholder:"sortablePlaceholder",tolerance:"pointer",toleranceElement:"> span"},d||{});if(e){$("#"+this._containerID+" .sortableList").sortable(this._options)}else{$("#"+this._containerID+" > .sortableList").nestedSortable(this._options)}if(this._className){var b=this._container.find(".formSubmit");if(!b.length){b=this._container.next(".formSubmit");if(!b.length){console.debug("[WCF.Sortable.Simple] Unable to find form submit for saving, aborting.");return}}b.children('button[data-type="submit"]').click($.proxy(this._submit,this))}},_submit:function(){this._structure={};this._container.find(".sortableList").each($.proxy(function(c,e){var b=$(e);var d=b.data("objectID");if(d!==undefined){b.children(this._options.items).each($.proxy(function(f,h){var g=$(h).data("objectID");if(!this._structure[d]){this._structure[d]=[]}this._structure[d].push(g)},this))}},this));var a=$.extend(true,{data:{offset:this._offset,structure:this._structure}},this._additionalParameters);this._proxy.setOption("data",{actionName:"updatePosition",className:this._className,interfaceName:"wcf\\data\\ISortableAction",parameters:a});this._proxy.sendRequest()},_success:function(b,c,a){if(this._notification===null){this._notification=new WCF.System.Notification(WCF.Language.get("wcf.global.success.edit"))}this._notification.show()}});WCF.Popover=Class.extend({_activeElementID:"",_cancelPopover:false,_data:{},_defaultDimensions:{height:150,width:450},_defaultOrientation:{x:"right",y:"top"},_delay:{show:800,hide:500},_hoverElement:false,_hoverElementID:"",_hoverPopover:false,_margin:20,_peOut:null,_peOverElement:null,_popover:null,_popoverContent:null,_popoverOffset:10,_selector:"",init:function(a){if($.browser.mobile){return}this._activeElementID="";this._cancelPopover=false;this._data={};this._defaultDimensions={height:150,width:450};this._defaultOrientation={x:"right",y:"top"};this._delay={show:800,hide:500};this._hoverElement=false;this._hoverElementID="";this._hoverPopover=false;this._margin=20;this._peOut=null;this._peOverElement=null;this._popoverOffset=10;this._selector=a;this._popover=$('<div class="popover"><span class="icon icon48 icon-spinner"></span><div class="popoverContent"></div></div>').hide().appendTo(document.body);this._popoverContent=this._popover.children(".popoverContent:eq(0)");this._popover.hover($.proxy(this._overPopover,this),$.proxy(this._out,this));this._initContainers();WCF.DOMNodeInsertedHandler.addCallback("WCF.Popover."+a,$.proxy(this._initContainers,this))},_initContainers:function(){if($.browser.mobile){return}var a=$(this._selector);if(!a.length){return}a.each($.proxy(function(c,d){var b=$(d);var e=b.wcfIdentify();if(!this._data[e]){this._data[e]={content:null,isLoading:false};b.hover($.proxy(this._overElement,this),$.proxy(this._out,this));if(b.is("a")&&b.attr("href")){b.click($.proxy(this._cancel,this))}}},this))},_cancel:function(a){this._cancelPopover=true;this._hide(true)},_overElement:function(a){if(this._cancelPopover){return}if(this._peOverElement!==null){this._peOverElement.stop()}var b=$(a.currentTarget).wcfIdentify();this._hoverElementID=b;this._peOverElement=new WCF.PeriodicalExecuter($.proxy(function(c){c.stop();if(this._hoverElementID===b){this._activeElementID=b;this._prepare()}},this),this._delay.show);this._hoverElement=true;this._hoverPopover=false},_prepare:function(){if(this._cancelPopover){return}if(this._peOut!==null){this._peOut.stop()}if(this._popover.is(":visible")){this._hide(true)}if(!this._data[this._activeElementID].loading&&this._data[this._activeElementID].content){this._popoverContent.html(this._data[this._activeElementID].content);WCF.DOMNodeInsertedHandler.execute()}else{this._data[this._activeElementID].loading=true}var a=this._popover.show().getDimensions();if(this._data[this._activeElementID].loading){a={height:Math.max(a.height,this._defaultDimensions.height),width:Math.max(a.width,this._defaultDimensions.width)}}else{a=this._fixElementDimensions(this._popover,a)}this._popover.hide();var b=this._getOrientation(a.height,a.width);this._popover.css(this._getCSS(b.x,b.y));this._popover.removeClass("bottom left right top").addClass(b.x).addClass(b.y);this._show()},_show:function(){if(this._cancelPopover){return}this._popover.stop().show().css({opacity:1}).wcfFadeIn();if(this._data[this._activeElementID].loading){this._popover.children("span").show();this._loadContent()}else{this._popover.children("span").hide();this._popoverContent.css({opacity:1})}},_loadContent:function(){},_insertContent:function(a,e,c){this._data[a]={content:e,loading:false};if(this._activeElementID===a){if(c){var d=this._popoverContent.getDimensions();this._popoverContent.css({height:"auto",width:"auto"});this._popoverContent.html(this._data[a].content);var f=this._popoverContent.getDimensions();this._popoverContent.html("").css({height:d.height+"px",width:d.width+"px"});var b=this;this._popoverContent.animate({height:f.height+"px",width:f.width+"px"},300,function(){b._popover.children("span").hide();b._popoverContent.html(b._data[a].content).css({opacity:0}).animate({opacity:1},200);WCF.DOMNodeInsertedHandler.execute()})}else{this._popover.children("span").hide();this._popoverContent.html(this._data[a].content);WCF.DOMNodeInsertedHandler.execute()}}},_hide:function(b){var a=this;this._popoverContent.stop();this._popover.stop();if(b){a._popover.css({opacity:0}).hide();a._popoverContent.empty().css({height:"auto",opacity:0,width:"auto"})}else{this._popover.wcfFadeOut(function(){a._popoverContent.empty().css({height:"auto",opacity:0,width:"auto"});a._popover.hide()})}},_overPopover:function(){if(this._peOut!==null){this._peOut.stop()}this._hoverElement=false;this._hoverPopover=true},_out:function(a){if(this._cancelPopover){return}this._hoverElementID="";this._hoverElement=false;this._hoverPopover=false;this._peOut=new WCF.PeriodicalExecuter($.proxy(function(b){b.stop();if(!this._hoverElement&&!this._hoverPopover){this._hide(false)}},this),this._delay.hide)},_getOrientation:function(i,a){var h=$("#"+this._activeElementID);var g=h.getOffsets("offset");var f=h.getDimensions();var b=$(document).getDimensions();var e=(this._defaultOrientation.x==="left")?"left":"right";var d=(this._defaultOrientation.y==="bottom")?"bottom":"top";var c=this._evaluateOrientation(e,d,g,f,b,i,a);if(c.flawed){e=(e==="left")?"right":"left";c=this._evaluateOrientation(e,d,g,f,b,i,a);if(c.flawed){e=(e==="right")?"left":"right";d=(d==="bottom")?"top":"bottom";c=this._evaluateOrientation(e,d,g,f,b,i,a);if(c.flawed){e=(e==="left")?"right":"left";c=this._evaluateOrientation(e,d,g,f,b,i,a);if(c.flawed){e=(this._defaultOrientationX==="left")?"left":"right";d=(this._defaultOrientationY==="bottom")?"bottom":"top"}}}}return{x:e,y:d}},_evaluateOrientation:function(g,f,b,h,j,i,a){var d=0,e=0;switch(g){case"left":e=b.left-a;break;case"right":e=j.width-(b.left+a);break}switch(f){case"bottom":d=j.height-(b.top+h.height+this._popoverOffset+i);break;case"top":d=b.top-(i-this._popoverOffset);break}var c=false;if(d<this._margin||e<this._margin){c=true}return{flawed:c,x:e,y:d}},_getCSS:function(d,c){var g={bottom:"auto",left:"auto",right:"auto",top:"auto"};var b=$("#"+this._activeElementID);var e=b.getOffsets("offset");var f=this._fixElementDimensions(b,b.getDimensions());var a=$(window).getDimensions();switch(d){case"left":g.right=a.width-(e.left+f.width);break;case"right":g.left=e.left;break}switch(c){case"bottom":g.top=e.top+(f.height+this._popoverOffset);break;case"top":g.bottom=a.height-(e.top-this._popoverOffset);break}return g},_fixElementDimensions:function(a,b){var c=a.parent().getDimensions();if(c.height<b.height){b.height=c.height}if(c.width<b.width){b.width=c.width}return b}});WCF.EditableItemList=Class.extend({_allowCustomInput:false,_className:"",_data:{},_form:null,_itemList:null,_objectID:0,_objectTypeID:0,_search:null,_searchInput:null,init:function(c,a){this._itemList=$(c);this._searchInput=$(a);this._data={};if(!this._itemList.length||!this._searchInput.length){console.debug("[WCF.EditableItemList] Item list and/or search input do not exist, aborting.");return}this._objectID=this._getObjectID();this._objectTypeID=this._getObjectTypeID();this._itemList.find(".jsEditableItem").click($.proxy(this._click,this));if(!this._itemList.children("ul").length){$("<ul />").appendTo(this._itemList)}this._itemList=this._itemList.children("ul");this._form=this._itemList.parents("form").submit($.proxy(this._submit,this));if(this._allowCustomInput){var b=this;this._searchInput.keydown($.proxy(this._keyDown,this)).on("paste",function(){setTimeout(function(){b._onPaste()},100)})}this._searchInput.parents(".dropdown").data("preventSubmit",true)},_keyDown:function(b){if(b===null||b.which===188||b.which===$.ui.keyCode.ENTER){if(b!==null&&b.which===$.ui.keyCode.ENTER&&this._search){if(this._search._itemIndex!==-1){return false}}var a=$.trim(this._searchInput.val());if(b&&b.which===188){a=a.substring(0,this._searchInput.getCaret())}if(a===""){return true}this.addItem({objectID:0,label:a});if(b&&b.which===188){this._searchInput.val($.trim(this._searchInput.val().substr(this._searchInput.getCaret())))}else{this._searchInput.val("")}if(b!==null){b.stopPropagation()}return false}return true},_onPaste:function(){var b=$.trim(this._searchInput.val());b=b.split(",");for(var d=0,c=b.length;d<c;d++){var a=$.trim(b[d]);if(a===""){continue}this.addItem({objectID:0,label:a})}this._searchInput.val("")},load:function(a){},_click:function(d){var b=$(d.currentTarget);var c=b.data("objectID");var a=b.data("label");if(this._search){this._search.removeExcludedSearchValue(a)}this._removeItem(c,a);b.remove();d.stopPropagation();return false},_getObjectID:function(){return 0},_getObjectTypeID:function(){return 0},addItem:function(b){if(this._data[b.objectID]){if(!(b.objectID===0&&this._allowCustomInput)){return true}}var a=$('<li class="badge">'+WCF.String.escapeHTML(b.label)+"</li>").data("objectID",b.objectID).data("label",b.label).appendTo(this._itemList);a.click($.proxy(this._click,this));if(this._search){this._search.addExcludedSearchValue(b.label)}this._addItem(b.objectID,b.label);return true},clearList:function(){this._itemList.children("li").each($.proxy(function(b,c){var a=$(c);if(this._search){this._search.removeExcludedSearchValue(a.data("label"))}a.remove();this._removeItem(a.data("objectID"),a.data("label"))},this))},_submit:function(){this._keyDown(null)},_addItem:function(b,a){this._data[b]=a},_removeItem:function(b,a){delete this._data[b]},getSearchInput:function(){return this._searchInput}});WCF.Sitemap=Class.extend({_cache:[],_dialog:null,_didInit:false,_proxy:null,init:function(){$("#sitemap").click($.proxy(this._click,this));this._cache=[];this._dialog=null;this._didInit=false;this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)})},_click:function(){if(this._dialog===null){this._dialog=$('<div id="sitemapDialog" />').appendTo(document.body);this._proxy.setOption("data",{actionName:"getSitemap",className:"wcf\\data\\sitemap\\SitemapAction"});this._proxy.sendRequest()}else{this._dialog.wcfDialog("open")}},_success:function(b,c,a){if(this._didInit){this._cache.push(b.returnValues.sitemapName);this._dialog.find("#sitemap_"+b.returnValues.sitemapName).html(b.returnValues.template);this._dialog.wcfDialog("render")}else{this._cache.push(b.returnValues.sitemapName);this._dialog.html(b.returnValues.template);this._dialog.find(".sitemapNavigation").click($.proxy(this._navigate,this));this._dialog.find(".tabMenuContainer").wcfTabs("select","sitemap_"+b.returnValues.sitemapName);this._dialog.wcfDialog({title:WCF.Language.get("wcf.page.sitemap")});this._didInit=true}},_navigate:function(a){var b=$(a.currentTarget).data("sitemapName");if(WCF.inArray(b,this._cache)){this._dialog.find(".tabMenuContainer").wcfTabs("select","sitemap_"+b);this._dialog.wcfDialog("render")}else{this._proxy.setOption("data",{actionName:"getSitemap",className:"wcf\\data\\sitemap\\SitemapAction",parameters:{sitemapName:b}});this._proxy.sendRequest()}}});WCF.Language.Chooser=Class.extend({_callback:null,_dropdown:null,_input:null,init:function(l,g,f,b,k,e){var m=$("#"+l);if(m.length!=1){console.debug("[WCF.Language.Chooser] Invalid container id '"+l+"' given");return}this._input=$("#"+g);if(!this._input.length){this._input=$('<input type="hidden" name="'+g+'" value="'+f+'" />').appendTo(m)}if(k!==undefined){if(!$.isFunction(k)){console.debug("[WCF.Language.Chooser] Given callback is invalid");return}this._callback=k}this._dropdown=$('<div class="dropdown" id="'+l+'-languageChooser" />').appendTo(m);$('<div class="dropdownToggle boxFlag box24" data-toggle="'+l+'-languageChooser"></div>').appendTo(this._dropdown);var c=$('<ul class="dropdownMenu" />').appendTo(this._dropdown);for(var a in b){var i=b[a];var h=$('<li class="boxFlag"><a class="box24"><div class="framed"><img src="'+i.iconPath+'" alt="" class="iconFlag" /></div> <div><h3>'+i.languageName+"</h3></div></a></li>").appendTo(c);h.data("languageID",a).click($.proxy(this._click,this));if(a==f){var d=$(""+h.html());var j=d.children().detach();this._dropdown.children(".dropdownToggle").empty().append(j)}}if(e){$('<li class="dropdownDivider" />').appendTo(c);var h=$("<li><a>"+WCF.Language.get("wcf.global.language.noSelection")+"</a></li>").data("languageID",0).click($.proxy(this._click,this)).appendTo(c);if(f===0){this._dropdown.children(".dropdownToggle").empty().append(h.html())}}WCF.Dropdown.init()},_click:function(e){var d=$(e.currentTarget);var c=d.data("languageID");this._input.val(c);var b=$(""+d.html());var a=(c===0)?b:b.children().detach();this._dropdown.children(".dropdownToggle").empty().append(a);if(this._callback!==null){this._callback(d)}}});WCF.Style={};WCF.Style.Chooser=Class.extend({_dialog:null,_proxy:null,init:function(){$('<li class="styleChooser"><a>'+WCF.Language.get("wcf.style.changeStyle")+"</a></li>").appendTo($("#footerNavigation > ul.navigationItems")).click($.proxy(this._showDialog,this));this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)})},_showDialog:function(){if(this._dialog===null){this._dialog=$('<div id="styleChooser" />').hide().appendTo(document.body);this._loadDialog()}else{this._dialog.wcfDialog({title:WCF.Language.get("wcf.style.changeStyle")})}},_loadDialog:function(){this._proxy.setOption("data",{actionName:"getStyleChooser",className:"wcf\\data\\style\\StyleAction"});this._proxy.sendRequest()},_success:function(b,c,a){if(b.actionName==="changeStyle"){window.location.reload();return}this._dialog.html(b.returnValues.template);this._dialog.find("li").addClass("pointer").click($.proxy(this._click,this));this._showDialog()},_click:function(a){this._proxy.setOption("data",{actionName:"changeStyle",className:"wcf\\data\\style\\StyleAction",objectIDs:[$(a.currentTarget).data("styleID")]});this._proxy.sendRequest()}});WCF.UserPanel=Class.extend({_container:null,_didLoad:false,_link:null,_noItems:"",_revertOnEmpty:true,init:function(a){this._container=$("#"+a);this._didLoad=false;this._revertOnEmpty=true;if(this._container.length!=1){console.debug("[WCF.UserPanel] Unable to find container identfied by '"+a+"', aborting.");return}this._convert()},_convert:function(){this._container.addClass("dropdown");this._link=this._container.children("a").remove();var b=$('<a class="dropdownToggle">'+this._link.html()+"</a>").appendTo(this._container).click($.proxy(this._click,this));var a=$('<ul class="dropdownMenu" />').appendTo(this._container);$('<li class="jsDropdownPlaceholder"><span>'+WCF.Language.get("wcf.global.loading")+"</span></li>").appendTo(a);this._addDefaultItems(a);this._container.dblclick($.proxy(function(){window.location=this._link.attr("href");return false},this));WCF.Dropdown.initDropdown(b,false)},_addDefaultItems:function(a){},_addDivider:function(a){$('<li class="dropdownDivider" />').appendTo(a)},_click:function(){if(this._didLoad){return}new WCF.Action.Proxy({autoSend:true,data:this._getParameters(),success:$.proxy(this._success,this)});this._didLoad=true},_getParameters:function(){return{}},_success:function(c,e,b){var a=WCF.Dropdown.getDropdownMenu(this._container.wcfIdentify());a.children(".jsDropdownPlaceholder").remove();if(c.returnValues&&c.returnValues.template){$(""+c.returnValues.template).prependTo(a);var d=this._container.find(".badge");if(!d.length){d=$('<span class="badge badgeInverse" />').appendTo(this._container.children(".dropdownToggle"));d.before(" ")}d.html(c.returnValues.totalCount);this._after(a)}else{$("<li><span>"+WCF.Language.get(this._noItems)+"</span></li>").prependTo(a);this._container.find(".badge").remove()}},_after:function(a){}});$.widget("ui.wcfDialog",{_closeButton:null,_container:null,_content:null,_overlay:null,_title:null,_titlebar:null,_isOpen:false,options:{autoOpen:true,closable:true,closeButtonLabel:null,closeConfirmMessage:null,closeViaModal:true,hideTitle:false,modal:true,title:"",zIndex:400,onClose:null,onShow:null},_createWidget:function(a,b){if($(b).getTagName()==="script"){console.debug("[ui.wcfDialog] Ignored script tag");this.element=false;return null}$.Widget.prototype._createWidget.apply(this,arguments)},_init:function(){if(this.options.autoOpen){this.open()}$(window).resize($.proxy(this._resize,this))},_create:function(){if(this.options.closeButtonLabel===null){this.options.closeButtonLabel=WCF.Language.get("wcf.global.button.close")}this._container=$('<div class="dialogContainer" />').hide().css({zIndex:this.options.zIndex}).appendTo(document.body);this._titlebar=$('<header class="dialogTitlebar" />').hide().appendTo(this._container);this._title=$('<span class="dialogTitle" />').hide().appendTo(this._titlebar);this._closeButton=$('<a class="dialogCloseButton jsTooltip" title="'+this.options.closeButtonLabel+'"><span /></a>').click($.proxy(this.close,this)).hide().appendTo(this._titlebar);this._content=$('<div class="dialogContent" />').appendTo(this._container);this._setOption("title",this.options.title);this._setOption("closable",this.options.closable);var a=this.element.detach();this._content.html(a);if(this.options.modal){this._overlay=$("#jsWcfDialogOverlay");if(!this._overlay.length){this._overlay=$('<div id="jsWcfDialogOverlay" class="dialogOverlay" />').css({height:"100%",zIndex:399}).hide().appendTo(document.body)}if(this.options.closable&&this.options.closeViaModal){this._overlay.click($.proxy(this.close,this));$(document).keyup($.proxy(function(b){if(b.keyCode&&b.keyCode===$.ui.keyCode.ESCAPE){this.close();b.preventDefault()}},this))}}WCF.DOMNodeInsertedHandler.execute()},_setOption:function(a,b){this.options[a]=b;if(a=="hideTitle"||a=="title"){if(!this.options.hideTitle&&this.options.title!=""){this._title.html(this.options.title).show()}else{this._title.html("")}}else{if(a=="closable"||a=="closeButtonLabel"){if(this.options.closable){this._closeButton.attr("title",this.options.closeButtonLabel).show().find("span").html(this.options.closeButtonLabel);WCF.DOMNodeInsertedHandler.execute()}else{this._closeButton.hide()}}}if((!this.options.hideTitle&&this.options.title!="")||this.options.closable){this._titlebar.show()}else{this._titlebar.hide()}return this},open:function(){if(this.element===false){return}if(this.isOpen()){return}if(this._overlay!==null){WCF.activeDialogs++;if(WCF.activeDialogs===1){this._overlay.show()}}this.render();this._isOpen=true},isOpen:function(){return this._isOpen},close:function(a){if(!this.isOpen()){return}if(this.options.closeConfirmMessage){WCF.System.Confirmation.show(this.options.closeConfirmMessage,$.proxy(function(b){if(b==="confirm"){this._close()}},this))}else{this._close()}if(a!==undefined){a.preventDefault()}},_close:function(){this._isOpen=false;this._container.wcfFadeOut();if(this._overlay!==null){WCF.activeDialogs--;if(WCF.activeDialogs===0){this._overlay.hide()}}if(this.options.onClose!==null){this.options.onClose()}},_resize:function(){if(this.isOpen()){this.render()}},render:function(){if(!this._container.is(":visible")&&this._container.css("top")==="0px"){window.scrollTo(0,0)}this._container.show();this._content.children().show();this._content.css({height:"auto",width:"auto"});this._container.stop();this._content.stop();this._container.show().css("opacity",1);var e=0;if(this._content.find(".formSubmit").length){e=this._content.find(".formSubmit").outerHeight();this._content.addClass("dialogForm").css({marginBottom:e+"px"})}else{this._content.removeClass("dialogForm").css({marginBottom:"0px"})}var b=$(window).getDimensions();if(b.width*0.9>800){this._container.css("maxWidth","800px")}var h=this._container.getDimensions("outer");var d=this._content.getDimensions();var e=h.height-d.height;var g=b.height-e-120;this._content.css({maxHeight:g+"px"});this._determineOverflow();h=this._container.getDimensions("outer");var f=Math.round((b.width-h.width)/2);var a=Math.round((b.height-h.height)/2);var c=Math.round((b.height/100)*20);if(c<a){a=c}this._container.css({left:f+"px",top:a+"px"});this._content.css({height:"auto",width:"auto"});if(!this.isOpen()){this._container.hide();this._container.wcfFadeIn($.proxy(function(){if(this.options.onShow!==null){this.options.onShow()}},this))}},_determineOverflow:function(){var b=$(window).getDimensions();var c=this._content.css("maxHeight");this._content.css("maxHeight","none");var e=this._container.getDimensions("outer");var d="visible";if((b.height*0.8<e.height)||(b.width*0.8<e.width)){d="auto"}this._content.css("overflow",d);this._content.css("maxHeight",c);if(d==="visible"){var a=0;this._content.children().each(function(f,g){a+=$(g).outerHeight()});if(this._content.height()<a){this._content.css("overflow","auto")}}},_getContentDimensions:function(a){var b=this._content.getDimensions();if(a&&b.height>a){b.height=a}return b}});$.widget("ui.wcfSlideshow",{_buttonList:null,_count:0,_index:0,_itemList:null,_items:null,_timer:null,_width:0,options:{cycle:true,cycleInterval:5,itemGap:50,},_create:function(){this._itemList=this.element.children("ul");this._items=this._itemList.children("li");this._count=this._items.length;this._index=0;if(this._count>1){this._initSlideshow()}},_initSlideshow:function(){var b=$(this._items.get(0)).outerHeight();this._items.addClass("slideshowItem");this._width=this.element.css("height",b).innerWidth();this._itemList.addClass("slideshowItemList").css("left",0);this._items.each($.proxy(function(d,e){$(e).show().css({height:b,left:((this._width+this.options.itemGap)*d),width:this._width})},this));this.element.css({height:b,width:this._width}).hover($.proxy(this._hoverIn,this),$.proxy(this._hoverOut,this));this._buttonList=$('<ul class="slideshowButtonList" />').appendTo(this.element);for(var c=0;c<this._count;c++){var a=$('<li><a><span class="icon icon16 icon-circle" /></a></li>').data("index",c).click($.proxy(this._click,this)).appendTo(this._buttonList);if(c==0){a.find(".icon").addClass("active")}}this._resetTimer();$(window).resize($.proxy(this._resize,this))},_resize:function(){this._width=this.element.css("width","auto").innerWidth();this._items.each($.proxy(function(a,b){$(b).css({left:((this._width+this.options.itemGap)*a),width:this._width})},this));this._index--;this.moveTo(null)},_hoverIn:function(){if(this._timer!==null){this._timer.stop()}},_hoverOut:function(){this._resetTimer()},_resetTimer:function(){if(!this.options.cycle){return}if(this._timer!==null){this._timer.stop()}var a=this;this._timer=new WCF.PeriodicalExecuter(function(){a.moveTo(null)},this.options.cycleInterval*1000)},_click:function(a){this.moveTo($(a.currentTarget).data("index"));this._resetTimer()},moveTo:function(a){this._index=(a===null)?this._index+1:a;if(this._index==this._count){this._index=0}$(this._buttonList.find(".icon").removeClass("active").get(this._index)).addClass("active");this._itemList.css("left",this._index*(this._width+this.options.itemGap)*-1);this._trigger("moveTo",null,{index:this._index})},getItem:function(a){if(this._items[a]){return this._items[a]}return null}});$.widget("ui.wcfTabs",$.ui.tabs,{_sanitizeSelector:function(a){return a.replace(/([:\.])/g,"\\$1")},select:function(a){if(!$.isNumeric(a)){this.panels.each(function(c,b){if($(b).wcfIdentify()===a){a=c;return false}});if(!$.isNumeric(a)){console.debug("[ui.wcfTabs] Unable to find panel identified by '"+a+"', aborting.");return}}this._setOption("active",a)},selectTab:function(a){a="#"+a;this.anchors.each(function(c,b){var d=$(b);if(d.prop("hash")===a){d.trigger("click");return false}})},getCurrentIndex:function(){return this.lis.index(this.lis.filter(".ui-tabs-selected"))},hasAnchor:function(b,a){var c=false;this.anchors.each(function(e,d){var g=$(d).attr("href");if(/#.+/.test(g)){var f=g.split("#",2);if(a){f=f[1].split("-",2)}if(f[1]===b){c=true;return false}}});return c},revertToDefault:function(){var a=this.element.data("active");if(!a||a===""){a=0}this.select(a)},_processTabs:function(){var a=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist");this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1});this.anchors=this.tabs.map(function(){return $("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1});this.panels=$();this.anchors.each(function(f,e){var b,c,d=$(e).uniqueId().attr("id"),g=$(e).closest("li"),h=g.attr("aria-controls");b=e.hash;c=a.element.find(a._sanitizeSelector(b));if(c.length){a.panels=a.panels.add(c)}if(h){g.data("ui-tabs-aria-controls",h)}g.attr({"aria-controls":b.substring(1),"aria-labelledby":d});c.attr("aria-labelledby",d)});this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},load:function(a,b){return}});$.widget("ui.wcfPages",{SHOW_LINKS:11,SHOW_SUB_LINKS:20,options:{activePage:1,maxPage:1,nextPage:null,previousPage:null},_create:function(){if(this.options.nextPage===null){this.options.nextPage=WCF.Language.get("wcf.global.page.next")}if(this.options.previousPage===null){this.options.previousPage=WCF.Language.get("wcf.global.page.previous")}this.element.addClass("pageNavigation");this._render()},destroy:function(){$.Widget.prototype.destroy.apply(this,arguments);this.element.children().remove()},_render:function(){if(!this.options.disabled&&this.options.maxPage>1){var g=false;if(this.element.hasClass("hidden")){this.element.removeClass("hidden")}this.element.show();this.element.children().remove();var o=$("<ul />");this.element.append(o);var n=$('<li class="button skip" />');o.append(n);if(this.options.activePage>1){var d=$("<a"+((this.options.previousPage!=null)?(' title="'+this.options.previousPage+'"'):(""))+"></a>");n.append(d);this._bindSwitchPage(d,this.options.activePage-1);var l=$('<span class="icon icon16 icon-double-angle-left" />');d.append(l)}else{var l=$('<span class="icon icon16 icon-double-angle-left" />');n.append(l);n.addClass("disabled").removeClass("button");l.addClass("disabled")}o.append(this._renderLink(1));var a=this.SHOW_LINKS-4;var e=this.options.activePage-2;if(e<0){e=0}var i=this.options.maxPage-(this.options.activePage+1);if(i<0){i=0}if(this.options.activePage>1&&this.options.activePage<this.options.maxPage){a--}var k=a/2;var c=this.options.activePage;var j=this.options.activePage;if(c<1){c=1}if(j<1){j=1}if(j>this.options.maxPage-1){j=this.options.maxPage-1}if(e>=k){c-=k}else{c-=e;j+=k-e}if(i>=k){j+=k}else{j+=i;c-=k-i}j=Math.ceil(j);c=Math.ceil(c);if(c<1){c=1}if(j>this.options.maxPage){j=this.options.maxPage}if(c>1){if(c-1<2){o.append(this._renderLink(2))}else{$('<li class="button jumpTo"><a title="'+WCF.Language.get("wcf.global.page.jumpTo")+'" class="jsTooltip">...</a></li>').appendTo(o);g=true}}for(var m=c+1;m<j;m++){o.append(this._renderLink(m))}if(j<this.options.maxPage){if(this.options.maxPage-j<2){o.append(this._renderLink(this.options.maxPage-1))}else{$('<li class="button jumpTo"><a title="'+WCF.Language.get("wcf.global.page.jumpTo")+'" class="jsTooltip">...</a></li>').appendTo(o);g=true}}o.append(this._renderLink(this.options.maxPage));var h=$('<li class="button skip" />');o.append(h);if(this.options.activePage<this.options.maxPage){var f=$("<a"+((this.options.nextPage!=null)?(' title="'+this.options.nextPage+'"'):(""))+"></a>");h.append(f);this._bindSwitchPage(f,this.options.activePage+1);var b=$('<span class="icon icon16 icon-double-angle-right" />');f.append(b)}else{var b=$('<span class="icon icon16 icon-double-angle-right" />');h.append(b);h.addClass("disabled").removeClass("button");b.addClass("disabled")}if(g){o.data("pages",this.options.maxPage);WCF.System.PageNavigation.init("#"+o.wcfIdentify(),$.proxy(function(p){this.switchPage(p)},this))}}else{this.element.hide()}},_renderLink:function(d,a){var e=$('<li class="button"></li>');if(a!=undefined&&a){e.addClass("break")}if(d!=this.options.activePage){var b=$("<a>"+WCF.String.addThousandsSeparator(d)+"</a>");e.append(b);this._bindSwitchPage(b,d)}else{e.addClass("active");var c=$("<span>"+WCF.String.addThousandsSeparator(d)+"</span>");e.append(c)}return e},_bindSwitchPage:function(a,b){var c=this;a.click(function(){c.switchPage(b)})},switchPage:function(a){this._setOption("activePage",a)},_setOption:function(b,c){if(b=="activePage"){if(c!=this.options[b]&&c>0&&c<=this.options.maxPage){var a=this._trigger("shouldSwitch",undefined,{nextPage:c});if(a||a!==undefined){this.options[b]=c;this._render();this._trigger("switched",undefined,{activePage:c})}else{this._trigger("notSwitched",undefined,{activePage:c})}}}else{this.options[b]=c;if(b=="disabled"){if(c){this.element.children().remove()}else{this._render()}}else{if(b=="maxPage"){this._render()}}}return this},_startInput:function(b){var a=$(b.currentTarget);if(!a.is("a")){a=a.parent("a")}a.hide();var c=a.parent("li").children("input").css("display","block").val("");c.focus()},_stopInput:function(b){var c=$(b.currentTarget);c.css("display","none");var a=c.parent("li");if(a!=undefined&&a!=null){a.children("a").show()}},_handleInput:function(b){var a=($.browser.msie&&$.browser.version=="7.0");if(b.type!="keyup"||a){if(!a||((b.which==13||b.which==27)&&b.type=="keyup")){if(b.which==13){this.switchPage(parseInt($(b.currentTarget).val()))}if(b.which==13||b.which==27){this._stopInput(b);b.stopPropagation()}}}}});WCF.Category={};WCF.Category.NestedList=Class.extend({_categories:{},init:function(){var a=this;$(".jsCategory").each(function(c,d){var b=$(d).data("parentCategoryID",null).change($.proxy(a._updateSelection,a));a._categories[b.val()]=b;var e=[];b.parents("li").find(".jsChildCategory").each(function(h,g){var f=$(g).data("parentCategoryID",b.val()).change($.proxy(a._updateSelection,a));a._categories[f.val()]=f;e.push(f.val());if(f.is(":checked")){b.prop("checked","checked")}});b.data("childCategoryIDs",e)})},_updateSelection:function(b){var a=$(b.currentTarget);var f=a.data("parentCategoryID");if(a.is(":checked")){if(f!==null){this._categories[f].prop("checked","checked")}}else{if(f===null){var e=a.data("childCategoryIDs");for(var d=0,c=e.length;d<c;d++){this._categories[e[d]].prop("checked",false)}}}}});function wcfEval(expression){return eval(expression)};
\ No newline at end of file