// ***************************
// js.compressed/jquery/jquery-ui-1.8.14.custom.min.js
// ***************************
/*!
 * jQuery UI 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI
 */
/*
 * Modified for vBulletin. Added the following:
 * - ability to show/hide the Dialog 'X' button via 'showCloseButton' option.
 * - ability to show/hide the Dialog title bar via 'showTitleBar' option.
 * - ability to skip (designated by 'ui-tabs-skip' class) the first <ul> or <ol> that the Tabs plugin uses by default when tabifying content.
 */
(function(a,b){function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;if(!b.href||!g||f.nodeName.toLowerCase()!=="map"){return false}h=a("img[usemap=#"+g+"]")[0];return!!h&&d(h)}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.ui=a.ui||{};if(a.ui.version){return}a.extend(a.ui,{version:"1.8.14",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});a.fn.extend({_focus:a.fn.focus,focus:function(b,c){return typeof b==="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus();if(c){c.call(d)}},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;if(a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))){b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}else{b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}return/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b){return this.css("zIndex",c)}if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0){return f}}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});a.each(["Width","Height"],function(c,d){function h(b,c,d,f){a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,true))||0;if(d){c-=parseFloat(a.curCSS(b,"border"+this+"Width",true))||0}if(f){c-=parseFloat(a.curCSS(b,"margin"+this,true))||0}});return c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){if(c===b){return g["inner"+d].call(this)}return this.each(function(){a(this).css(f,h(this,c)+"px")})};a.fn["outer"+d]=function(b,c){if(typeof b!=="number"){return g["outer"+d].call(this,b)}return this.each(function(){a(this).css(f,h(this,b,true,c)+"px")})}});a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}});a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=c.offsetHeight===100;a.support.selectstart="onselectstart"in c;b.removeChild(c).style.display="none"});a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d){e.plugins[f]=e.plugins[f]||[];e.plugins[f].push([c,d[f]])}},call:function(a,b,c){var d=a.plugins[b];if(!d||!a.element[0].parentNode){return}for(var e=0;e<d.length;e++){if(a.options[d[e][0]]){d[e][1].apply(a.element,c)}}}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(b,c){if(a(b).css("overflow")==="hidden"){return false}var d=c&&c==="left"?"scrollLeft":"scrollTop",e=false;if(b[d]>0){return true}b[d]=1;e=b[d]>0;b[d]=0;return e},isOverAxis:function(a,b,c){return a>b&&a<b+c},isOver:function(b,c,d,e,f,g){return a.ui.isOverAxis(b,d,f)&&a.ui.isOverAxis(c,e,g)}})})(jQuery);(function(a,b){if(a.cleanData){var c=a.cleanData;a.cleanData=function(b){for(var d=0,e;(e=b[d])!=null;d++){a(e).triggerHandler("remove")}c(b)}}else{var d=a.fn.remove;a.fn.remove=function(b,c){return this.each(function(){if(!c){if(!b||a.filter(b,[this]).length){a("*",this).add([this]).each(function(){a(this).triggerHandler("remove")})}}return d.call(a(this),b,c)})}}a.widget=function(b,c,d){var e=b.split(".")[0],f;b=b.split(".")[1];f=e+"-"+b;if(!d){d=c;c=a.Widget}a.expr[":"][f]=function(c){return!!a.data(c,b)};a[e]=a[e]||{};a[e][b]=function(a,b){if(arguments.length){this._createWidget(a,b)}};var g=new c;g.options=a.extend(true,{},g.options);a[e][b].prototype=a.extend(true,g,{namespace:e,widgetName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBaseClass:f},d);a.widget.bridge(b,a[e][b])};a.widget.bridge=function(c,d){a.fn[c]=function(e){var f=typeof e==="string",g=Array.prototype.slice.call(arguments,1),h=this;e=!f&&g.length?a.extend.apply(null,[true,e].concat(g)):e;if(f&&e.charAt(0)==="_"){return h}if(f){this.each(function(){var d=a.data(this,c),f=d&&a.isFunction(d[e])?d[e].apply(d,g):d;if(f!==d&&f!==b){h=f;return false}})}else{this.each(function(){var b=a.data(this,c);if(b){b.option(e||{})._init()}else{a.data(this,c,new d(e,this))}})}return h}};a.Widget=function(a,b){if(arguments.length){this._createWidget(a,b)}};a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(b,c){a.data(c,this.widgetName,this);this.element=a(c);this.options=a.extend(true,{},this.options,this._getCreateOptions(),b);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+"ui-state-disabled")},widget:function(){return this.element},option:function(c,d){var e=c;if(arguments.length===0){return a.extend({},this.options)}if(typeof c==="string"){if(d===b){return this.options[c]}e={};e[c]=d}this._setOptions(e);return this},_setOptions:function(b){var c=this;a.each(b,function(a,b){c._setOption(a,b)});return this},_setOption:function(a,b){this.options[a]=b;if(a==="disabled"){this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",b)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(b,c,d){var e=this.options[b];c=a.Event(c);c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase();d=d||{};if(c.originalEvent){for(var f=a.event.props.length,g;f;){g=a.event.props[--f];c[g]=c.originalEvent[g]}}this.element.trigger(c,d);return!(a.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);(function(a,b){var c=false;a(document).mousedown(function(a){c=false});a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(a){return b._mouseDown(a)}).bind("click."+this.widgetName,function(c){if(true===a.data(c.target,b.widgetName+".preventClickEvent")){a.removeData(c.target,b.widgetName+".preventClickEvent");c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(b){if(c){return}this._mouseStarted&&this._mouseUp(b);this._mouseDownEvent=b;var d=this,e=b.which==1,f=typeof this.options.cancel=="string"?a(b.target).closest(this.options.cancel).length:false;if(!e||f||!this._mouseCapture(b)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){d.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=this._mouseStart(b)!==false;if(!this._mouseStarted){b.preventDefault();return true}}if(true===a.data(b.target,this.widgetName+".preventClickEvent")){a.removeData(b.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(a){return d._mouseMove(a)};this._mouseUpDelegate=function(a){return d._mouseUp(a)};a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);b.preventDefault();c=true;return true},_mouseMove:function(b){if(a.browser.msie&&!(document.documentMode>=9)&&!b.button){return this._mouseUp(b)}if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==false;this._mouseStarted?this._mouseDrag(b):this._mouseUp(b)}return!this._mouseStarted},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(b.target==this._mouseDownEvent.target){a.data(b.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(b)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return true}})})(jQuery);(function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f=a.fn.position,g=a.fn.offset;a.fn.position=function(b){if(!b||!b.of){return f.apply(this,arguments)}b=a.extend({},b);var g=a(b.of),h=g[0],i=(b.collision||"flip").split(" "),j=b.offset?b.offset.split(" "):[0,0],k,l,m;if(h.nodeType===9){k=g.width();l=g.height();m={top:0,left:0}}else if(h.setTimeout){k=g.width();l=g.height();m={top:g.scrollTop(),left:g.scrollLeft()}}else if(h.preventDefault){b.at="left top";k=l=0;m={top:b.of.pageY,left:b.of.pageX}}else{k=g.outerWidth();l=g.outerHeight();m=g.offset()}a.each(["my","at"],function(){var a=(b[this]||"").split(" ");if(a.length===1){a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]}a[0]=c.test(a[0])?a[0]:e;a[1]=d.test(a[1])?a[1]:e;b[this]=a});if(i.length===1){i[1]=i[0]}j[0]=parseInt(j[0],10)||0;if(j.length===1){j[1]=j[0]}j[1]=parseInt(j[1],10)||0;if(b.at[0]==="right"){m.left+=k}else if(b.at[0]===e){m.left+=k/2}if(b.at[1]==="bottom"){m.top+=l}else if(b.at[1]===e){m.top+=l/2}m.left+=j[0];m.top+=j[1];return this.each(function(){var c=a(this),d=c.outerWidth(),f=c.outerHeight(),g=parseInt(a.curCSS(this,"marginLeft",true))||0,h=parseInt(a.curCSS(this,"marginTop",true))||0,n=d+g+(parseInt(a.curCSS(this,"marginRight",true))||0),o=f+h+(parseInt(a.curCSS(this,"marginBottom",true))||0),p=a.extend({},m),q;if(b.my[0]==="right"){p.left-=d}else if(b.my[0]===e){p.left-=d/2}if(b.my[1]==="bottom"){p.top-=f}else if(b.my[1]===e){p.top-=f/2}p.left=Math.round(p.left);p.top=Math.round(p.top);q={left:p.left-g,top:p.top-h};a.each(["left","top"],function(c,e){if(a.ui.position[i[c]]){a.ui.position[i[c]][e](p,{targetWidth:k,targetHeight:l,elemWidth:d,elemHeight:f,collisionPosition:q,collisionWidth:n,collisionHeight:o,offset:j,my:b.my,at:b.at})}});if(a.fn.bgiframe){c.bgiframe()}c.offset(a.extend(p,{using:b.using}))})};a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]===e){return}var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0},top:function(b,c){if(c.at[1]===e){return}var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}};if(!a.offset.setOffset){a.offset.setOffset=function(b,c){if(/static/.test(a.curCSS(b,"position"))){b.style.position="relative"}var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",true),10)||0,g=parseInt(a.curCSS(b,"left",true),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};if("using"in c){c.using.call(b,h)}else{d.css(h)}};a.fn.offset=function(b){var c=this[0];if(!c||!c.ownerDocument){return null}if(b){return this.each(function(){a.offset.setOffset(this,b)})}return g.call(this)}}})(jQuery);(function(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(!this.element.data("draggable"))return;this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable"+" ui-draggable-dragging"+" ui-draggable-disabled");this._mouseDestroy();return this},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(b);if(!this.handle)return false;a(c.iframeFix===true?"iframe":c.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")});return true},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b);this._cacheHelperProportions();if(a.ui.ddmanager)a.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt);if(c.containment)this._setContainment();if(this._trigger("start",b)===false){this._clear();return false}this._cacheHelperProportions();if(a.ui.ddmanager&&!c.dropBehaviour)a.ui.ddmanager.prepareOffsets(this,b);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(b,true);if(a.ui.ddmanager)a.ui.ddmanager.dragStart(this,b);return true},_mouseDrag:function(b,c){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!c){var d=this._uiHash();if(this._trigger("drag",b,d)===false){this._mouseUp({});return false}this.position=d.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";if(a.ui.ddmanager)a.ui.ddmanager.drag(this,b);return false},_mouseStop:function(b){var c=false;if(a.ui.ddmanager&&!this.options.dropBehaviour)c=a.ui.ddmanager.drop(this,b);if(this.dropped){c=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===true||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var d=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(d._trigger("stop",b)!==false){d._clear()}})}else{if(this._trigger("stop",b)!==false){this._clear()}}return false},_mouseUp:function(b){if(this.options.iframeFix===true){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}if(a.ui.ddmanager)a.ui.ddmanager.dragStop(this,b);return a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp({})}else{this._clear()}return this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==b.target)c=true});return c},_createHelper:function(b){var c=this.options;var d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;if(!d.parents("body").length)d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo);if(d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position")))d.css("position","absolute");return d},_adjustOffsetFromHelper:function(b){if(typeof b=="string"){b=b.split(" ")}if(a.isArray(b)){b={left:+b[0],top:+b[1]||0}}if("left"in b){this.offset.click.left=b.left+this.margins.left}if("right"in b){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if("top"in b){this.offset.click.top=b.top+this.margins.top}if("bottom"in b){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;if(b.containment=="parent")b.containment=this.helper[0].parentNode;if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){var c=a(b.containment);var d=c[0];if(!d)return;var e=c.offset();var f=a(d).css("overflow")!="hidden";this.containment=[(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=c}else if(b.containment.constructor==Array){this.containment=b.containment}},_convertPositionTo:function(b,c){if(!c)c=this.position;var d=b=="absolute"?1:-1;var e=this.options,f=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName);var f=b.pageX;var g=b.pageY;if(this.originalPosition){var h;if(this.containment){if(this.relative_container){var i=this.relative_container.offset();h=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else{h=this.containment}if(b.pageX-this.offset.click.left<h[0])f=h[0]+this.offset.click.left;if(b.pageY-this.offset.click.top<h[1])g=h[1]+this.offset.click.top;if(b.pageX-this.offset.click.left>h[2])f=h[2]+this.offset.click.left;if(b.pageY-this.offset.click.top>h[3])g=h[3]+this.offset.click.top}if(c.grid){var j=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;g=h?!(j-this.offset.click.top<h[1]||j-this.offset.click.top>h[3])?j:!(j-this.offset.click.top<h[1])?j-c.grid[1]:j+c.grid[1]:j;var k=c.grid[0]?this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0]:this.originalPageX;f=h?!(k-this.offset.click.left<h[0]||k-this.offset.click.left>h[2])?k:!(k-this.offset.click.left<h[0])?k-c.grid[0]:k+c.grid[0]:k}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval)this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(b,c,d){d=d||this._uiHash();a.ui.plugin.call(this,b,[c,d]);if(b=="drag")this.positionAbs=this._convertPositionTo("absolute");return a.Widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(a){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});a.extend(a.ui.draggable,{version:"1.8.14"});a.ui.plugin.add("draggable","connectToSortable",{start:function(b,c){var d=a(this).data("draggable"),e=d.options,f=a.extend({},c,{item:d.element});d.sortables=[];a(e.connectToSortable).each(function(){var c=a.data(this,"sortable");if(c&&!c.options.disabled){d.sortables.push({instance:c,shouldRevert:c.options.revert});c.refreshPositions();c._trigger("activate",b,f)}})},stop:function(b,c){var d=a(this).data("draggable"),e=a.extend({},c,{item:d.element});a.each(d.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;d.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(b);this.instance.options.helper=this.instance.options._helper;if(d.options.helper=="original")this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",b,e)}})},drag:function(b,c){var d=a(this).data("draggable"),e=this;var f=function(b){var c=this.offset.click.top,d=this.offset.click.left;var e=this.positionAbs.top,f=this.positionAbs.left;var g=b.height,h=b.width;var i=b.top,j=b.left;return a.ui.isOver(e+c,f+d,i,j,g,h)};a.each(d.sortables,function(f){this.instance.positionAbs=d.positionAbs;this.instance.helperProportions=d.helperProportions;this.instance.offset.click=d.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=a(e).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return c.helper[0]};b.target=this.instance.currentItem[0];this.instance._mouseCapture(b,true);this.instance._mouseStart(b,true,true);this.instance.offset.click.top=d.offset.click.top;this.instance.offset.click.left=d.offset.click.left;this.instance.offset.parent.left-=d.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=d.offset.parent.top-this.instance.offset.parent.top;d._trigger("toSortable",b);d.dropped=this.instance.element;d.currentItem=d.element;this.instance.fromOutside=d}if(this.instance.currentItem)this.instance._mouseDrag(b)}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",b,this.instance._uiHash(this.instance));this.instance._mouseStop(b,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder)this.instance.placeholder.remove();d._trigger("fromSortable",b);d.dropped=false}}})}});a.ui.plugin.add("draggable","cursor",{start:function(b,c){var d=a("body"),e=a(this).data("draggable").options;if(d.css("cursor"))e._cursor=d.css("cursor");d.css("cursor",e.cursor)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._cursor)a("body").css("cursor",d._cursor)}});a.ui.plugin.add("draggable","opacity",{start:function(b,c){var d=a(c.helper),e=a(this).data("draggable").options;if(d.css("opacity"))e._opacity=d.css("opacity");d.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._opacity)a(c.helper).css("opacity",d._opacity)}});a.ui.plugin.add("draggable","scroll",{start:function(b,c){var d=a(this).data("draggable");if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML")d.overflowOffset=d.scrollParent.offset()},drag:function(b,c){var d=a(this).data("draggable"),e=d.options,f=false;if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"){if(!e.axis||e.axis!="x"){if(d.overflowOffset.top+d.scrollParent[0].offsetHeight-b.pageY<e.scrollSensitivity)d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop+e.scrollSpeed;else if(b.pageY-d.overflowOffset.top<e.scrollSensitivity)d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop-e.scrollSpeed}if(!e.axis||e.axis!="y"){if(d.overflowOffset.left+d.scrollParent[0].offsetWidth-b.pageX<e.scrollSensitivity)d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft+e.scrollSpeed;else if(b.pageX-d.overflowOffset.left<e.scrollSensitivity)d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft-e.scrollSpeed}}else{if(!e.axis||e.axis!="x"){if(b.pageY-a(document).scrollTop()<e.scrollSensitivity)f=a(document).scrollTop(a(document).scrollTop()-e.scrollSpeed);else if(a(window).height()-(b.pageY-a(document).scrollTop())<e.scrollSensitivity)f=a(document).scrollTop(a(document).scrollTop()+e.scrollSpeed)}if(!e.axis||e.axis!="y"){if(b.pageX-a(document).scrollLeft()<e.scrollSensitivity)f=a(document).scrollLeft(a(document).scrollLeft()-e.scrollSpeed);else if(a(window).width()-(b.pageX-a(document).scrollLeft())<e.scrollSensitivity)f=a(document).scrollLeft(a(document).scrollLeft()+e.scrollSpeed)}}if(f!==false&&a.ui.ddmanager&&!e.dropBehaviour)a.ui.ddmanager.prepareOffsets(d,b)}});a.ui.plugin.add("draggable","snap",{start:function(b,c){var d=a(this).data("draggable"),e=d.options;d.snapElements=[];a(e.snap.constructor!=String?e.snap.items||":data(draggable)":e.snap).each(function(){var b=a(this);var c=b.offset();if(this!=d.element[0])d.snapElements.push({item:this,width:b.outerWidth(),height:b.outerHeight(),top:c.top,left:c.left})})},drag:function(b,c){var d=a(this).data("draggable"),e=d.options;var f=e.snapTolerance;var g=c.offset.left,h=g+d.helperProportions.width,i=c.offset.top,j=i+d.helperProportions.height;for(var k=d.snapElements.length-1;k>=0;k--){var l=d.snapElements[k].left,m=l+d.snapElements[k].width,n=d.snapElements[k].top,o=n+d.snapElements[k].height;if(!(l-f<g&&g<m+f&&n-f<i&&i<o+f||l-f<g&&g<m+f&&n-f<j&&j<o+f||l-f<h&&h<m+f&&n-f<i&&i<o+f||l-f<h&&h<m+f&&n-f<j&&j<o+f)){if(d.snapElements[k].snapping)d.options.snap.release&&d.options.snap.release.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item}));d.snapElements[k].snapping=false;continue}if(e.snapMode!="inner"){var p=Math.abs(n-j)<=f;var q=Math.abs(o-i)<=f;var r=Math.abs(l-h)<=f;var s=Math.abs(m-g)<=f;if(p)c.position.top=d._convertPositionTo("relative",{top:n-d.helperProportions.height,left:0}).top-d.margins.top;if(q)c.position.top=d._convertPositionTo("relative",{top:o,left:0}).top-d.margins.top;if(r)c.position.left=d._convertPositionTo("relative",{top:0,left:l-d.helperProportions.width}).left-d.margins.left;if(s)c.position.left=d._convertPositionTo("relative",{top:0,left:m}).left-d.margins.left}var t=p||q||r||s;if(e.snapMode!="outer"){var p=Math.abs(n-i)<=f;var q=Math.abs(o-j)<=f;var r=Math.abs(l-g)<=f;var s=Math.abs(m-h)<=f;if(p)c.position.top=d._convertPositionTo("relative",{top:n,left:0}).top-d.margins.top;if(q)c.position.top=d._convertPositionTo("relative",{top:o-d.helperProportions.height,left:0}).top-d.margins.top;if(r)c.position.left=d._convertPositionTo("relative",{top:0,left:l}).left-d.margins.left;if(s)c.position.left=d._convertPositionTo("relative",{top:0,left:m-d.helperProportions.width}).left-d.margins.left}if(!d.snapElements[k].snapping&&(p||q||r||s||t))d.options.snap.snap&&d.options.snap.snap.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item}));d.snapElements[k].snapping=p||q||r||s||t}}});a.ui.plugin.add("draggable","stack",{start:function(b,c){var d=a(this).data("draggable").options;var e=a.makeArray(a(d.stack)).sort(function(b,c){return(parseInt(a(b).css("zIndex"),10)||0)-(parseInt(a(c).css("zIndex"),10)||0)});if(!e.length){return}var f=parseInt(e[0].style.zIndex)||0;a(e).each(function(a){this.style.zIndex=f+a});this[0].style.zIndex=f+e.length}});a.ui.plugin.add("draggable","zIndex",{start:function(b,c){var d=a(c.helper),e=a(this).data("draggable").options;if(d.css("zIndex"))e._zIndex=d.css("zIndex");d.css("zIndex",e.zIndex)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._zIndex)a(c.helper).css("zIndex",d._zIndex)}})})(jQuery);(function(a,b){a.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"},_create:function(){var b=this.options,c=b.accept;this.isover=0;this.isout=1;this.accept=a.isFunction(c)?c:function(a){return a.is(c)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};a.ui.ddmanager.droppables[b.scope]=a.ui.ddmanager.droppables[b.scope]||[];a.ui.ddmanager.droppables[b.scope].push(this);b.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){var b=a.ui.ddmanager.droppables[this.options.scope];for(var c=0;c<b.length;c++)if(b[c]==this)b.splice(c,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(b,c){if(b=="accept"){this.accept=a.isFunction(c)?c:function(a){return a.is(c)}}a.Widget.prototype._setOption.apply(this,arguments)},_activate:function(b){var c=a.ui.ddmanager.current;if(this.options.activeClass)this.element.addClass(this.options.activeClass);c&&this._trigger("activate",b,this.ui(c))},_deactivate:function(b){var c=a.ui.ddmanager.current;if(this.options.activeClass)this.element.removeClass(this.options.activeClass);c&&this._trigger("deactivate",b,this.ui(c))},_over:function(b){var c=a.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return;if(this.accept.call(this.element[0],c.currentItem||c.element)){if(this.options.hoverClass)this.element.addClass(this.options.hoverClass);this._trigger("over",b,this.ui(c))}},_out:function(b){var c=a.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return;if(this.accept.call(this.element[0],c.currentItem||c.element)){if(this.options.hoverClass)this.element.removeClass(this.options.hoverClass);this._trigger("out",b,this.ui(c))}},_drop:function(b,c){var d=c||a.ui.ddmanager.current;if(!d||(d.currentItem||d.element)[0]==this.element[0])return false;var e=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var b=a.data(this,"droppable");if(b.options.greedy&&!b.options.disabled&&b.options.scope==d.options.scope&&b.accept.call(b.element[0],d.currentItem||d.element)&&a.ui.intersect(d,a.extend(b,{offset:b.element.offset()}),b.options.tolerance)){e=true;return false}});if(e)return false;if(this.accept.call(this.element[0],d.currentItem||d.element)){if(this.options.activeClass)this.element.removeClass(this.options.activeClass);if(this.options.hoverClass)this.element.removeClass(this.options.hoverClass);this._trigger("drop",b,this.ui(d));return this.element}return false},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}});a.extend(a.ui.droppable,{version:"1.8.14"});a.ui.intersect=function(b,c,d){if(!c.offset)return false;var e=(b.positionAbs||b.position.absolute).left,f=e+b.helperProportions.width,g=(b.positionAbs||b.position.absolute).top,h=g+b.helperProportions.height;var i=c.offset.left,j=i+c.proportions.width,k=c.offset.top,l=k+c.proportions.height;switch(d){case"fit":return i<=e&&f<=j&&k<=g&&h<=l;break;case"intersect":return i<e+b.helperProportions.width/2&&f-b.helperProportions.width/2<j&&k<g+b.helperProportions.height/2&&h-b.helperProportions.height/2<l;break;case"pointer":var m=(b.positionAbs||b.position.absolute).left+(b.clickOffset||b.offset.click).left,n=(b.positionAbs||b.position.absolute).top+(b.clickOffset||b.offset.click).top,o=a.ui.isOver(n,m,k,i,c.proportions.height,c.proportions.width);return o;break;case"touch":return(g>=k&&g<=l||h>=k&&h<=l||g<k&&h>l)&&(e>=i&&e<=j||f>=i&&f<=j||e<i&&f>j);break;default:return false;break}};a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var d=a.ui.ddmanager.droppables[b.options.scope]||[];var e=c?c.type:null;var f=(b.currentItem||b.element).find(":data(droppable)").andSelf();a:for(var g=0;g<d.length;g++){if(d[g].options.disabled||b&&!d[g].accept.call(d[g].element[0],b.currentItem||b.element))continue;for(var h=0;h<f.length;h++){if(f[h]==d[g].element[0]){d[g].proportions.height=0;continue a}}d[g].visible=d[g].element.css("display")!="none";if(!d[g].visible)continue;if(e=="mousedown")d[g]._activate.call(d[g],c);d[g].offset=d[g].element.offset();d[g].proportions={width:d[g].element[0].offsetWidth,height:d[g].element[0].offsetHeight}}},drop:function(b,c){var d=false;a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){if(!this.options)return;if(!this.options.disabled&&this.visible&&a.ui.intersect(b,this,this.options.tolerance))d=d||this._drop.call(this,c);if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],b.currentItem||b.element)){this.isout=1;this.isover=0;this._deactivate.call(this,c)}});return d},dragStart:function(b,c){b.element.parentsUntil("body").bind("scroll.droppable",function(){if(!b.options.refreshPositions)a.ui.ddmanager.prepareOffsets(b,c)})},drag:function(b,c){if(b.options.refreshPositions)a.ui.ddmanager.prepareOffsets(b,c);a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible)return;var d=a.ui.intersect(b,this,this.options.tolerance);var e=!d&&this.isover==1?"isout":d&&this.isover==0?"isover":null;if(!e)return;var f;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");if(g.length){f=a.data(g[0],"droppable");f.greedyChild=e=="isover"?1:0}}if(f&&e=="isover"){f["isover"]=0;f["isout"]=1;f._out.call(f,c)}this[e]=1;this[e=="isout"?"isover":"isout"]=0;this[e=="isover"?"_over":"_out"].call(this,c);if(f&&e=="isout"){f["isout"]=0;f["isover"]=1;f._over.call(f,c)}})},dragStop:function(b,c){b.element.parentsUntil("body").unbind("scroll.droppable");if(!b.options.refreshPositions)a.ui.ddmanager.prepareOffsets(b,c)}}})(jQuery);(function(a,b){a.widget("ui.resizable",a.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var b=this,c=this.options;this.element.addClass("ui-resizable");a.extend(this,{_aspectRatio:!!c.aspectRatio,aspectRatio:c.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:c.helper||c.ghost||c.animate?c.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){if(/relative/.test(this.element.css("position"))&&a.browser.opera)this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wrap(a('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=c.handles||(!a(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var d=this.handles.split(",");this.handles={};for(var e=0;e<d.length;e++){var f=a.trim(d[e]),g="ui-resizable-"+f;var h=a('<div class="ui-resizable-handle '+g+'"></div>');if(/sw|se|ne|nw/.test(f))h.css({zIndex:++c.zIndex});if("se"==f){h.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[f]=".ui-resizable-"+f;this.element.append(h)}}this._renderAxis=function(b){b=b||this.element;for(var c in this.handles){if(this.handles[c].constructor==String)this.handles[c]=a(this.handles[c],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var d=a(this.handles[c],this.element),e=0;e=/sw|ne|nw|se|n|s/.test(c)?d.outerHeight():d.outerWidth();var f=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join("");b.css(f,e);this._proportionallyResize()}if(!a(this.handles[c]).length)continue}};this._renderAxis(this.element);this._handles=a(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!b.resizing){if(this.className)var a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=a&&a[1]?a[1]:"se"}});if(c.autoHide){this._handles.hide();a(this.element).addClass("ui-resizable-autohide").hover(function(){if(c.disabled)return;a(this).removeClass("ui-resizable-autohide");b._handles.show()},function(){if(c.disabled)return;if(!b.resizing){a(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(b){a(b).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var c=this.element;c.after(this.originalElement.css({position:c.css("position"),width:c.outerWidth(),height:c.outerHeight(),top:c.css("top"),left:c.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var c=false;for(var d in this.handles){if(a(this.handles[d])[0]==b.target){c=true}}return!this.options.disabled&&c},_mouseStart:function(b){var d=this.options,e=this.element.position(),f=this.element;this.resizing=true;this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()};if(f.is(".ui-draggable")||/absolute/.test(f.css("position"))){f.css({position:"absolute",top:e.top,left:e.left})}if(a.browser.opera&&/relative/.test(f.css("position")))f.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();var g=c(this.helper.css("left")),h=c(this.helper.css("top"));if(d.containment){g+=a(d.containment).scrollLeft()||0;h+=a(d.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:g,top:h};this.size=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()};this.originalSize=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()};this.originalPosition={left:g,top:h};this.sizeDiff={width:f.outerWidth()-f.width(),height:f.outerHeight()-f.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof d.aspectRatio=="number"?d.aspectRatio:this.originalSize.width/this.originalSize.height||1;var i=a(".ui-resizable-"+this.axis).css("cursor");a("body").css("cursor",i=="auto"?this.axis+"-resize":i);f.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var c=this.helper,d=this.options,e={},f=this,g=this.originalMousePosition,h=this.axis;var i=b.pageX-g.left||0,j=b.pageY-g.top||0;var k=this._change[h];if(!k)return false;var l=k.apply(this,[b,i,j]),m=a.browser.msie&&a.browser.version<7,n=this.sizeDiff;this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)l=this._updateRatio(l,b);l=this._respectSize(l,b);this._propagate("resize",b);c.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length)this._proportionallyResize();this._updateCache(l);this._trigger("resize",b,this.ui());return false},_mouseStop:function(b){this.resizing=false;var c=this.options,d=this;if(this._helper){var e=this._proportionallyResizeElements,f=e.length&&/textarea/i.test(e[0].nodeName),g=f&&a.ui.hasScroll(e[0],"left")?0:d.sizeDiff.height,h=f?0:d.sizeDiff.width;var i={width:d.helper.width()-h,height:d.helper.height()-g},j=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,k=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;if(!c.animate)this.element.css(a.extend(i,{top:k,left:j}));d.helper.height(d.size.height);d.helper.width(d.size.width);if(this._helper&&!c.animate)this._proportionallyResize()}a("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",b);if(this._helper)this.helper.remove();return false},_updateVirtualBoundaries:function(a){var b=this.options,c,e,f,g,h;h={minWidth:d(b.minWidth)?b.minWidth:0,maxWidth:d(b.maxWidth)?b.maxWidth:Infinity,minHeight:d(b.minHeight)?b.minHeight:0,maxHeight:d(b.maxHeight)?b.maxHeight:Infinity};if(this._aspectRatio||a){c=h.minHeight*this.aspectRatio;f=h.minWidth/this.aspectRatio;e=h.maxHeight*this.aspectRatio;g=h.maxWidth/this.aspectRatio;if(c>h.minWidth)h.minWidth=c;if(f>h.minHeight)h.minHeight=f;if(e<h.maxWidth)h.maxWidth=e;if(g<h.maxHeight)h.maxHeight=g}this._vBoundaries=h},_updateCache:function(a){var b=this.options;this.offset=this.helper.offset();if(d(a.left))this.position.left=a.left;if(d(a.top))this.position.top=a.top;if(d(a.height))this.size.height=a.height;if(d(a.width))this.size.width=a.width},_updateRatio:function(a,b){var c=this.options,e=this.position,f=this.size,g=this.axis;if(d(a.height))a.width=a.height*this.aspectRatio;else if(d(a.width))a.height=a.width/this.aspectRatio;if(g=="sw"){a.left=e.left+(f.width-a.width);a.top=null}if(g=="nw"){a.top=e.top+(f.height-a.height);a.left=e.left+(f.width-a.width)}return a},_respectSize:function(a,b){var c=this.helper,e=this._vBoundaries,f=this._aspectRatio||b.shiftKey,g=this.axis,h=d(a.width)&&e.maxWidth&&e.maxWidth<a.width,i=d(a.height)&&e.maxHeight&&e.maxHeight<a.height,j=d(a.width)&&e.minWidth&&e.minWidth>a.width,k=d(a.height)&&e.minHeight&&e.minHeight>a.height;if(j)a.width=e.minWidth;if(k)a.height=e.minHeight;if(h)a.width=e.maxWidth;if(i)a.height=e.maxHeight;var l=this.originalPosition.left+this.originalSize.width,m=this.position.top+this.size.height;var n=/sw|nw|w/.test(g),o=/nw|ne|n/.test(g);if(j&&n)a.left=l-e.minWidth;if(h&&n)a.left=l-e.maxWidth;if(k&&o)a.top=m-e.minHeight;if(i&&o)a.top=m-e.maxHeight;var p=!a.width&&!a.height;if(p&&!a.left&&a.top)a.top=null;else if(p&&!a.top&&a.left)a.left=null;return a},_proportionallyResize:function(){var b=this.options;if(!this._proportionallyResizeElements.length)return;var c=this.helper||this.element;for(var d=0;d<this._proportionallyResizeElements.length;d++){var e=this._proportionallyResizeElements[d];if(!this.borderDif){var f=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],g=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];this.borderDif=a.map(f,function(a,b){var c=parseInt(a,10)||0,d=parseInt(g[b],10)||0;return c+d})}if(a.browser.msie&&!!(a(c).is(":hidden")||a(c).parents(":hidden").length))continue;e.css({height:c.height()-this.borderDif[0]-this.borderDif[2]||0,width:c.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var b=this.element,c=this.options;this.elementOffset=b.offset();if(this._helper){this.helper=this.helper||a('<div style="overflow:hidden;"></div>');var d=a.browser.msie&&a.browser.version<7,e=d?1:0,f=d?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++c.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(a,b,c){return{width:this.originalSize.width+b}},w:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{left:f.left+b,width:e.width-b}},n:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{top:f.top+c,height:e.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},sw:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,d]))},ne:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},nw:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,d]))}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]);b!="resize"&&this._trigger(b,c,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});a.extend(a.ui.resizable,{version:"1.8.14"});a.ui.plugin.add("resizable","alsoResize",{start:function(b,c){var d=a(this).data("resizable"),e=d.options;var f=function(b){a(b).each(function(){var b=a(this);b.data("resizable-alsoresize",{width:parseInt(b.width(),10),height:parseInt(b.height(),10),left:parseInt(b.css("left"),10),top:parseInt(b.css("top"),10),position:b.css("position")})})};if(typeof e.alsoResize=="object"&&!e.alsoResize.parentNode){if(e.alsoResize.length){e.alsoResize=e.alsoResize[0];f(e.alsoResize)}else{a.each(e.alsoResize,function(a){f(a)})}}else{f(e.alsoResize)}},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.originalSize,g=d.originalPosition;var h={height:d.size.height-f.height||0,width:d.size.width-f.width||0,top:d.position.top-g.top||0,left:d.position.left-g.left||0},i=function(b,e){a(b).each(function(){var b=a(this),f=a(this).data("resizable-alsoresize"),g={},i=e&&e.length?e:b.parents(c.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(i,function(a,b){var c=(f[b]||0)+(h[b]||0);if(c&&c>=0)g[b]=c||null});if(a.browser.opera&&/relative/.test(b.css("position"))){d._revertToRelativePosition=true;b.css({position:"absolute",top:"auto",left:"auto"})}b.css(g)})};if(typeof e.alsoResize=="object"&&!e.alsoResize.nodeType){a.each(e.alsoResize,function(a,b){i(a,b)})}else{i(e.alsoResize)}},stop:function(b,c){var d=a(this).data("resizable"),e=d.options;var f=function(b){a(b).each(function(){var b=a(this);b.css({position:b.data("resizable-alsoresize").position})})};if(d._revertToRelativePosition){d._revertToRelativePosition=false;if(typeof e.alsoResize=="object"&&!e.alsoResize.nodeType){a.each(e.alsoResize,function(a){f(a)})}else{f(e.alsoResize)}}a(this).removeData("resizable-alsoresize")}});a.ui.plugin.add("resizable","animate",{stop:function(b,c){var d=a(this).data("resizable"),e=d.options;var f=d._proportionallyResizeElements,g=f.length&&/textarea/i.test(f[0].nodeName),h=g&&a.ui.hasScroll(f[0],"left")?0:d.sizeDiff.height,i=g?0:d.sizeDiff.width;var j={width:d.size.width-i,height:d.size.height-h},k=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,l=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;d.element.animate(a.extend(j,l&&k?{top:l,left:k}:{}),{duration:e.animateDuration,easing:e.animateEasing,step:function(){var c={width:parseInt(d.element.css("width"),10),height:parseInt(d.element.css("height"),10),top:parseInt(d.element.css("top"),10),left:parseInt(d.element.css("left"),10)};if(f&&f.length)a(f[0]).css({width:c.width,height:c.height});d._updateCache(c);d._propagate("resize",b)}})}});a.ui.plugin.add("resizable","containment",{start:function(b,d){var e=a(this).data("resizable"),f=e.options,g=e.element;var h=f.containment,i=h instanceof a?h.get(0):/parent/.test(h)?g.parent().get(0):h;if(!i)return;e.containerElement=a(i);if(/document/.test(h)||h==document){e.containerOffset={left:0,top:0};e.containerPosition={left:0,top:0};e.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight}}else{var j=a(i),k=[];a(["Top","Right","Left","Bottom"]).each(function(a,b){k[a]=c(j.css("padding"+b))});e.containerOffset=j.offset();e.containerPosition=j.position();e.containerSize={height:j.innerHeight()-k[3],width:j.innerWidth()-k[1]};var l=e.containerOffset,m=e.containerSize.height,n=e.containerSize.width,o=a.ui.hasScroll(i,"left")?i.scrollWidth:n,p=a.ui.hasScroll(i)?i.scrollHeight:m;e.parentData={element:i,left:l.left,top:l.top,width:o,height:p}}},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.containerSize,g=d.containerOffset,h=d.size,i=d.position,j=d._aspectRatio||b.shiftKey,k={top:0,left:0},l=d.containerElement;if(l[0]!=document&&/static/.test(l.css("position")))k=g;if(i.left<(d._helper?g.left:0)){d.size.width=d.size.width+(d._helper?d.position.left-g.left:d.position.left-k.left);if(j)d.size.height=d.size.width/e.aspectRatio;d.position.left=e.helper?g.left:0}if(i.top<(d._helper?g.top:0)){d.size.height=d.size.height+(d._helper?d.position.top-g.top:d.position.top);if(j)d.size.width=d.size.height*e.aspectRatio;d.position.top=d._helper?g.top:0}d.offset.left=d.parentData.left+d.position.left;d.offset.top=d.parentData.top+d.position.top;var m=Math.abs((d._helper?d.offset.left-k.left:d.offset.left-k.left)+d.sizeDiff.width),n=Math.abs((d._helper?d.offset.top-k.top:d.offset.top-g.top)+d.sizeDiff.height);var o=d.containerElement.get(0)==d.element.parent().get(0),p=/relative|absolute/.test(d.containerElement.css("position"));if(o&&p)m-=d.parentData.left;if(m+d.size.width>=d.parentData.width){d.size.width=d.parentData.width-m;if(j)d.size.height=d.size.width/d.aspectRatio}if(n+d.size.height>=d.parentData.height){d.size.height=d.parentData.height-n;if(j)d.size.width=d.size.height*d.aspectRatio}},stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.position,g=d.containerOffset,h=d.containerPosition,i=d.containerElement;var j=a(d.helper),k=j.offset(),l=j.outerWidth()-d.sizeDiff.width,m=j.outerHeight()-d.sizeDiff.height;if(d._helper&&!e.animate&&/relative/.test(i.css("position")))a(this).css({left:k.left-h.left-g.left,width:l,height:m});if(d._helper&&!e.animate&&/static/.test(i.css("position")))a(this).css({left:k.left-h.left-g.left,width:l,height:m})}});a.ui.plugin.add("resizable","ghost",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size;d.ghost=d.originalElement.clone();d.ghost.css({opacity:.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof e.ghost=="string"?e.ghost:"");d.ghost.appendTo(d.helper)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options;if(d.ghost)d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(b,c){var d=a(this).data("resizable"),e=d.options;if(d.ghost&&d.helper)d.helper.get(0).removeChild(d.ghost.get(0))}});a.ui.plugin.add("resizable","grid",{resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size,g=d.originalSize,h=d.originalPosition,i=d.axis,j=e._aspectRatio||b.shiftKey;e.grid=typeof e.grid=="number"?[e.grid,e.grid]:e.grid;var k=Math.round((f.width-g.width)/(e.grid[0]||1))*(e.grid[0]||1),l=Math.round((f.height-g.height)/(e.grid[1]||1))*(e.grid[1]||1);if(/^(se|s|e)$/.test(i)){d.size.width=g.width+k;d.size.height=g.height+l}else if(/^(ne)$/.test(i)){d.size.width=g.width+k;d.size.height=g.height+l;d.position.top=h.top-l}else if(/^(sw)$/.test(i)){d.size.width=g.width+k;d.size.height=g.height+l;d.position.left=h.left-k}else{d.size.width=g.width+k;d.size.height=g.height+l;d.position.top=h.top-l;d.position.left=h.left-k}}});var c=function(a){return parseInt(a,10)||0};var d=function(a){return!isNaN(parseInt(a,10))}})(jQuery);(function(a,b){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var b=this;this.element.addClass("ui-selectable");this.dragged=false;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]);c.each(function(){var b=a(this);var c=b.offset();a.data(this,"selectable-item",{element:this,$element:b,left:c.left,top:c.top,right:c.left+b.outerWidth(),bottom:c.top+b.outerHeight(),startselected:false,selected:b.hasClass("ui-selected"),selecting:b.hasClass("ui-selecting"),unselecting:b.hasClass("ui-unselecting")})})};this.refresh();this.selectees=c.addClass("ui-selectee");this._mouseInit();this.helper=a("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(b){var c=this;this.opos=[b.pageX,b.pageY];if(this.options.disabled)return;var d=this.options;this.selectees=a(d.filter,this.element[0]);this._trigger("start",b);a(d.appendTo).append(this.helper);this.helper.css({left:b.clientX,top:b.clientY,width:0,height:0});if(d.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var d=a.data(this,"selectable-item");d.startselected=true;if(!b.metaKey){d.$element.removeClass("ui-selected");d.selected=false;d.$element.addClass("ui-unselecting");d.unselecting=true;c._trigger("unselecting",b,{unselecting:d.element})}});a(b.target).parents().andSelf().each(function(){var d=a.data(this,"selectable-item");if(d){var e=!b.metaKey||!d.$element.hasClass("ui-selected");d.$element.removeClass(e?"ui-unselecting":"ui-selected").addClass(e?"ui-selecting":"ui-unselecting");d.unselecting=!e;d.selecting=e;d.selected=e;if(e){c._trigger("selecting",b,{selecting:d.element})}else{c._trigger("unselecting",b,{unselecting:d.element})}return false}})},_mouseDrag:function(b){var c=this;this.dragged=true;if(this.options.disabled)return;var d=this.options;var e=this.opos[0],f=this.opos[1],g=b.pageX,h=b.pageY;if(e>g){var i=g;g=e;e=i}if(f>h){var i=h;h=f;f=i}this.helper.css({left:e,top:f,width:g-e,height:h-f});this.selectees.each(function(){var i=a.data(this,"selectable-item");if(!i||i.element==c.element[0])return;var j=false;if(d.tolerance=="touch"){j=!(i.left>g||i.right<e||i.top>h||i.bottom<f)}else if(d.tolerance=="fit"){j=i.left>e&&i.right<g&&i.top>f&&i.bottom<h}if(j){if(i.selected){i.$element.removeClass("ui-selected");i.selected=false}if(i.unselecting){i.$element.removeClass("ui-unselecting");i.unselecting=false}if(!i.selecting){i.$element.addClass("ui-selecting");i.selecting=true;c._trigger("selecting",b,{selecting:i.element})}}else{if(i.selecting){if(b.metaKey&&i.startselected){i.$element.removeClass("ui-selecting");i.selecting=false;i.$element.addClass("ui-selected");i.selected=true}else{i.$element.removeClass("ui-selecting");i.selecting=false;if(i.startselected){i.$element.addClass("ui-unselecting");i.unselecting=true}c._trigger("unselecting",b,{unselecting:i.element})}}if(i.selected){if(!b.metaKey&&!i.startselected){i.$element.removeClass("ui-selected");i.selected=false;i.$element.addClass("ui-unselecting");i.unselecting=true;c._trigger("unselecting",b,{unselecting:i.element})}}}});return false},_mouseStop:function(b){var c=this;this.dragged=false;var d=this.options;a(".ui-unselecting",this.element[0]).each(function(){var d=a.data(this,"selectable-item");d.$element.removeClass("ui-unselecting");d.unselecting=false;d.startselected=false;c._trigger("unselected",b,{unselected:d.element})});a(".ui-selecting",this.element[0]).each(function(){var d=a.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected");d.selecting=false;d.selected=true;d.startselected=true;c._trigger("selected",b,{selected:d.element})});this._trigger("stop",b);this.helper.remove();return false}});a.extend(a.ui.selectable,{version:"1.8.14"})})(jQuery);(function(a,b){a.widget("ui.sortable",a.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var a=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(b,c){if(b==="disabled"){this.options[b]=c;this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")}else{a.Widget.prototype._setOption.apply(this,arguments)}},_mouseCapture:function(b,c){if(this.reverting){return false}if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(b);var d=null,e=this,f=a(b.target).parents().each(function(){if(a.data(this,"sortable-item")==e){d=a(this);return false}});if(a.data(b.target,"sortable-item")==e)d=a(b.target);if(!d)return false;if(this.options.handle&&!c){var g=false;a(this.options.handle,d).find("*").andSelf().each(function(){if(this==b.target)g=true});if(!g)return false}this.currentItem=d;this._removeCurrentsFromItems();return true},_mouseStart:function(b,c,d){var e=this.options,f=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(b);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(e.containment)this._setContainment();if(e.cursor){if(a("body").css("cursor"))this._storedCursor=a("body").css("cursor");a("body").css("cursor",e.cursor)}if(e.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",e.opacity)}if(e.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",e.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",b,this._uiHash());if(!this._preserveHelperProportions)this._cacheHelperProportions();if(!d){for(var g=this.containers.length-1;g>=0;g--){this.containers[g]._trigger("activate",b,f._uiHash(this))}}if(a.ui.ddmanager)a.ui.ddmanager.current=this;if(a.ui.ddmanager&&!e.dropBehaviour)a.ui.ddmanager.prepareOffsets(this,b);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(b);return true},_mouseDrag:function(b){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){var c=this.options,d=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY<c.scrollSensitivity)this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop+c.scrollSpeed;else if(b.pageY-this.overflowOffset.top<c.scrollSensitivity)this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop-c.scrollSpeed;if(this.overflowOffset.left+this.scrollParent[0].offsetWidth-b.pageX<c.scrollSensitivity)this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft+c.scrollSpeed;else if(b.pageX-this.overflowOffset.left<c.scrollSensitivity)this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft-c.scrollSpeed}else{if(b.pageY-a(document).scrollTop()<c.scrollSensitivity)d=a(document).scrollTop(a(document).scrollTop()-c.scrollSpeed);else if(a(window).height()-(b.pageY-a(document).scrollTop())<c.scrollSensitivity)d=a(document).scrollTop(a(document).scrollTop()+c.scrollSpeed);if(b.pageX-a(document).scrollLeft()<c.scrollSensitivity)d=a(document).scrollLeft(a(document).scrollLeft()-c.scrollSpeed);else if(a(window).width()-(b.pageX-a(document).scrollLeft())<c.scrollSensitivity)d=a(document).scrollLeft(a(document).scrollLeft()+c.scrollSpeed)}if(d!==false&&a.ui.ddmanager&&!c.dropBehaviour)a.ui.ddmanager.prepareOffsets(this,b)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(var e=this.items.length-1;e>=0;e--){var f=this.items[e],g=f.item[0],h=this._intersectsWithPointer(f);if(!h)continue;if(g!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=g&&!a.ui.contains(this.placeholder[0],g)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],g):true)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f)){this._rearrange(b,f)}else{break}this._trigger("change",b,this._uiHash());break}}this._contactContainers(b);if(a.ui.ddmanager)a.ui.ddmanager.drag(this,b);this._trigger("sort",b,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(b,c){if(!b)return;if(a.ui.ddmanager&&!this.options.dropBehaviour)a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this;var e=d.placeholder.offset();d.reverting=true;a(this.helper).animate({left:e.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else{this._clear(b,c)}return false},cancel:function(){var b=this;if(this.dragging){this._mouseUp({target:null});if(this.options.helper=="original")this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");else this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--){this.containers[c]._trigger("deactivate",null,b._uiHash(this));if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",null,b._uiHash(this));this.containers[c].containerCache.over=0}}}if(this.placeholder){if(this.placeholder[0].parentNode)this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode)this.helper.remove();a.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){a(this.domPosition.prev).after(this.currentItem)}else{a(this.domPosition.parent).prepend(this.currentItem)}}return this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected);var d=[];b=b||{};a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);if(c)d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))});if(!d.length&&b.key){d.push(b.key+"=")}return d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected);var d=[];b=b||{};c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")});return d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height;var f=a.left,g=f+a.width,h=a.top,i=h+a.height;var j=this.offset.click.top,k=this.offset.click.left;var l=d+j>h&&d+j<i&&b+k>f&&b+k<g;if(this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]){return l}else{return f<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<g&&h<d+this.helperProportions.height/2&&e-this.helperProportions.height/2<i}},_intersectsWithPointer:function(b){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top,b.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left,b.width),e=c&&d,f=this._getDragVerticalDirection(),g=this._getDragHorizontalDirection();if(!e)return false;return this.floating?g&&g=="right"||f=="down"?2:1:f&&(f=="down"?2:1)},_intersectsWithSides:function(b){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top+b.height/2,b.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left+b.width/2,b.width),e=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();if(this.floating&&f){return f=="right"&&d||f=="left"&&!d}else{return e&&(e=="down"&&c||e=="up"&&!c)}},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){var c=this;var d=[];var e=[];var f=this._connectWith();if(f&&b){for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],"sortable");if(j&&j!=this&&!j.options.disabled){e.push([a.isFunction(j.options.items)?j.options.items.call(j.element):a(j.options.items,j.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),j])}}}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var g=e.length-1;g>=0;g--){e[g][0].each(function(){d.push(this)})}return a(d)},_removeCurrentsFromItems:function(){var a=this.currentItem.find(":data(sortable-item)");for(var b=0;b<this.items.length;b++){for(var c=0;c<a.length;c++){if(a[c]==this.items[b].item[0])this.items.splice(b,1)}}},_refreshItems:function(b){this.items=[];this.containers=[this];var c=this.items;var d=this;var e=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]];var f=this._connectWith();if(f){for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],"sortable");if(j&&j!=this&&!j.options.disabled){e.push([a.isFunction(j.options.items)?j.options.items.call(j.element[0],b,{item:this.currentItem}):a(j.options.items,j.element),j]);this.containers.push(j)}}}}for(var g=e.length-1;g>=0;g--){var k=e[g][1];var l=e[g][0];for(var i=0,m=l.length;i<m;i++){var n=a(l[i]);n.data("sortable-item",k);c.push({item:n,instance:k,width:0,height:0,left:0,top:0})}}},refreshPositions:function(b){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()}for(var c=this.items.length-1;c>=0;c--){var d=this.items[c];if(d.instance!=this.currentContainer&&this.currentContainer&&d.item[0]!=this.currentItem[0])continue;var e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;if(!b){d.width=e.outerWidth();d.height=e.outerHeight()}var f=e.offset();d.left=f.left;d.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var c=this.containers.length-1;c>=0;c--){var f=this.containers[c].element.offset();this.containers[c].containerCache.left=f.left;this.containers[c].containerCache.top=f.top;this.containers[c].containerCache.width=this.containers[c].element.outerWidth();this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}}return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var b=a(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)b.style.visibility="hidden";return b},update:function(a,b){if(e&&!d.forcePlaceholderSize)return;if(!b.height()){b.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10))}if(!b.width()){b.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem));c.currentItem.after(c.placeholder);d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){var c=null,d=null;for(var e=this.containers.length-1;e>=0;e--){if(a.ui.contains(this.currentItem[0],this.containers[e].element[0]))continue;if(this._intersectsWith(this.containers[e].containerCache)){if(c&&a.ui.contains(this.containers[e].element[0],c.element[0]))continue;c=this.containers[e];d=e}else{if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",b,this._uiHash(this));this.containers[e].containerCache.over=0}}}if(!c)return;if(this.containers.length===1){this.containers[d]._trigger("over",b,this._uiHash(this));this.containers[d].containerCache.over=1}else if(this.currentContainer!=this.containers[d]){var f=1e4;var g=null;var h=this.positionAbs[this.containers[d].floating?"left":"top"];for(var i=this.items.length-1;i>=0;i--){if(!a.ui.contains(this.containers[d].element[0],this.items[i].item[0]))continue;var j=this.items[i][this.containers[d].floating?"left":"top"];if(Math.abs(j-h)<f){f=Math.abs(j-h);g=this.items[i]}}if(!g&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[d];g?this._rearrange(b,g,null,true):this._rearrange(b,null,this.containers[d].element,true);this._trigger("change",b,this._uiHash());this.containers[d]._trigger("change",b,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[d]._trigger("over",b,this._uiHash(this));this.containers[d].containerCache.over=1}},_createHelper:function(b){var c=this.options;var d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b,this.currentItem])):c.helper=="clone"?this.currentItem.clone():this.currentItem;if(!d.parents("body").length)a(c.appendTo!="parent"?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0]);if(d[0]==this.currentItem[0])this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")};if(d[0].style.width==""||c.forceHelperSize)d.width(this.currentItem.width());if(d[0].style.height==""||c.forceHelperSize)d.height(this.currentItem.height());return d},_adjustOffsetFromHelper:function(b){if(typeof b=="string"){b=b.split(" ")}if(a.isArray(b)){b={left:+b[0],top:+b[1]||0}}if("left"in b){this.offset.click.left=b.left+this.margins.left}if("right"in b){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if("top"in b){this.offset.click.top=b.top+this.margins.top}if("bottom"in b){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;if(b.containment=="parent")b.containment=this.helper[0].parentNode;if(b.containment=="document"||b.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)){var c=a(b.containment)[0];var d=a(b.containment).offset();var e=a(c).css("overflow")!="hidden";this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(e?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(e?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(b,c){if(!c)c=this.position;var d=b=="absolute"?1:-1;var e=this.options,f=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var f=b.pageX;var g=b.pageY;if(this.originalPosition){if(this.containment){if(b.pageX-this.offset.click.left<this.containment[0])f=this.containment[0]+this.offset.click.left;if(b.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+this.offset.click.top;if(b.pageX-this.offset.click.left>this.containment[2])f=this.containment[2]+this.offset.click.left;if(b.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(c.grid){var h=this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1];g=this.containment?!(h-this.offset.click.top<this.containment[1]||h-this.offset.click.top>this.containment[3])?h:!(h-this.offset.click.top<this.containment[1])?h-c.grid[1]:h+c.grid[1]:h;var i=this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0];f=this.containment?!(i-this.offset.click.left<this.containment[0]||i-this.offset.click.left>this.containment[2])?i:!(i-this.offset.click.left<this.containment[0])?i-c.grid[0]:i+c.grid[0]:i}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_rearrange:function(a,b,c,d){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?b.item[0]:b.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var e=this,f=this.counter;window.setTimeout(function(){if(f==e.counter)e.refreshPositions(!d)},0)},_clear:function(b,c){this.reverting=false;var d=[],e=this;if(!this._noFinalSort&&this.currentItem.parent().length)this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var f in this._storedCSS){if(this._storedCSS[f]=="auto"||this._storedCSS[f]=="static")this._storedCSS[f]=""}this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}if(this.fromOutside&&!c)d.push(function(a){this._trigger("receive",a,this._uiHash(this.fromOutside))});if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!c)d.push(function(a){this._trigger("update",a,this._uiHash())});if(!a.ui.contains(this.element[0],this.currentItem[0])){if(!c)d.push(function(a){this._trigger("remove",a,this._uiHash())});for(var f=this.containers.length-1;f>=0;f--){if(a.ui.contains(this.containers[f].element[0],this.currentItem[0])&&!c){d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.containers[f]));d.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.containers[f]))}}}for(var f=this.containers.length-1;f>=0;f--){if(!c)d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[f]));if(this.containers[f].containerCache.over){d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[f]));this.containers[f].containerCache.over=0}}if(this._storedCursor)a("body").css("cursor",this._storedCursor);if(this._storedOpacity)this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",b,this._uiHash());for(var f=0;f<d.length;f++){d[f].call(this,b)}this._trigger("stop",b,this._uiHash())}return false}if(!c)this._trigger("beforeStop",b,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.helper[0]!=this.currentItem[0])this.helper.remove();this.helper=null;if(!c){for(var f=0;f<d.length;f++){d[f].call(this,b)}this._trigger("stop",b,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){if(a.Widget.prototype._trigger.apply(this,arguments)===false){this.cancel()}},_uiHash:function(b){var c=b||this;return{helper:c.helper,placeholder:c.placeholder||a([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:b?b.element:null}}});a.extend(a.ui.sortable,{version:"1.8.14"})})(jQuery);(function(a,b){a.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var b=this,c=b.options;b.running=0;b.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix");b.headers=b.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){if(c.disabled){return}a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){if(c.disabled){return}a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){if(c.disabled){return}a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){if(c.disabled){return}a(this).removeClass("ui-state-focus")});b.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(c.navigation){var d=b.element.find("a").filter(c.navigationFilter).eq(0);if(d.length){var e=d.closest(".ui-accordion-header");if(e.length){b.active=e}else{b.active=d.closest(".ui-accordion-content").prev()}}}b.active=b._findActive(b.active||c.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");b.active.next().addClass("ui-accordion-content-active");b._createIcons();b.resize();b.element.attr("role","tablist");b.headers.attr("role","tab").bind("keydown.accordion",function(a){return b._keydown(a)}).next().attr("role","tabpanel");b.headers.not(b.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide();if(!b.active.length){b.headers.eq(0).attr("tabIndex",0)}else{b.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0})}if(!a.browser.safari){b.headers.find("a").attr("tabIndex",-1)}if(c.event){b.headers.bind(c.event.split(" ").join(".accordion ")+".accordion",function(a){b._clickHandler.call(b,a,this);a.preventDefault()})}},_createIcons:function(){var b=this.options;if(b.icons){a("<span></span>").addClass("ui-icon "+b.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(b.icons.header).toggleClass(b.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var b=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex");this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var c=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(b.autoHeight||b.fillHeight){c.css("height","")}return a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments);if(b=="active"){this.activate(c)}if(b=="icons"){this._destroyIcons();if(c){this._createIcons()}}if(b=="disabled"){this.headers.add(this.headers.next())[c?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")}},_keydown:function(b){if(this.options.disabled||b.altKey||b.ctrlKey){return}var c=a.ui.keyCode,d=this.headers.length,e=this.headers.index(b.target),f=false;switch(b.keyCode){case c.RIGHT:case c.DOWN:f=this.headers[(e+1)%d];break;case c.LEFT:case c.UP:f=this.headers[(e-1+d)%d];break;case c.SPACE:case c.ENTER:this._clickHandler({target:b.target},b.target);b.preventDefault()}if(f){a(b.target).attr("tabIndex",-1);a(f).attr("tabIndex",0);f.focus();return false}return true},resize:function(){var b=this.options,c;if(b.fillSpace){if(a.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}c=this.element.parent().height();if(a.browser.msie){this.element.parent().css("overflow",d)}this.headers.each(function(){c-=a(this).outerHeight(true)});this.headers.next().each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+a(this).height()))}).css("overflow","auto")}else if(b.autoHeight){c=0;this.headers.next().each(function(){c=Math.max(c,a(this).height("").height())}).height(c)}return this},activate:function(a){this.options.active=a;var b=this._findActive(a)[0];this._clickHandler({target:b},b);return this},_findActive:function(b){return b?typeof b==="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===false?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,c){var d=this.options;if(d.disabled){return}if(!b.target){if(!d.collapsible){return}this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var e=this.active.next(),f={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:e},g=this.active=a([]);this._toggle(g,e,f);return}var h=a(b.currentTarget||c),i=h[0]===this.active[0];d.active=d.collapsible&&i?false:this.headers.index(h);if(this.running||!d.collapsible&&i){return}var j=this.active,g=h.next(),e=this.active.next(),f={options:d,newHeader:i&&d.collapsible?a([]):h,oldHeader:this.active,newContent:i&&d.collapsible?a([]):g,oldContent:e},k=this.headers.index(this.active[0])>this.headers.index(h[0]);this.active=i?a([]):h;this._toggle(g,e,f,i,k);j.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);if(!i){h.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);h.next().addClass("ui-accordion-content-active")}return},_toggle:function(b,c,d,e,f){var g=this,h=g.options;g.toShow=b;g.toHide=c;g.data=d;var i=function(){if(!g){return}return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data);g.running=c.size()===0?b.size():c.size();if(h.animated){var j={};if(h.collapsible&&e){j={toShow:a([]),toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace}}else{j={toShow:b,toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace}}if(!h.proxied){h.proxied=h.animated}if(!h.proxiedDuration){h.proxiedDuration=h.duration}h.animated=a.isFunction(h.proxied)?h.proxied(j):h.proxied;h.duration=a.isFunction(h.proxiedDuration)?h.proxiedDuration(j):h.proxiedDuration;var k=a.ui.accordion.animations,l=h.duration,m=h.animated;if(m&&!k[m]&&!a.easing[m]){m="slide"}if(!k[m]){k[m]=function(a){this.slide(a,{easing:m,duration:l||700})}}k[m](j)}else{if(h.collapsible&&e){b.toggle()}else{c.hide();b.show()}i(true)}c.prev().attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).blur();b.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(this.running){return}if(this.options.clearStyle){this.toShow.add(this.toHide).css({height:"",overflow:""})}this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length){this.toHide.parent()[0].className=this.toHide.parent()[0].className}this._trigger("change",null,this.data)}});a.extend(a.ui.accordion,{version:"1.8.14",animations:{slide:function(b,c){b=a.extend({easing:"swing",duration:300},b,c);if(!b.toHide.size()){b.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},b);return}if(!b.toShow.size()){b.toHide.animate({height:"hide",paddingTop:"hide",paddingBottom:"hide"},b);return}var d=b.toShow.css("overflow"),e=0,f={},g={},h=["height","paddingTop","paddingBottom"],i;var j=b.toShow;i=j[0].style.width;j.width(parseInt(j.parent().width(),10)-parseInt(j.css("paddingLeft"),10)-parseInt(j.css("paddingRight"),10)-(parseInt(j.css("borderLeftWidth"),10)||0)-(parseInt(j.css("borderRightWidth"),10)||0));a.each(h,function(c,d){g[d]="hide";var e=(""+a.css(b.toShow[0],d)).match(/^([\d+-.]+)(.*)$/);f[d]={value:e[1],unit:e[2]||"px"}});b.toShow.css({height:0,overflow:"hidden"}).show();b.toHide.filter(":hidden").each(b.complete).end().filter(":visible").animate(g,{step:function(a,c){if(c.prop=="height"){e=c.end-c.start===0?0:(c.now-c.start)/(c.end-c.start)}b.toShow[0].style[c.prop]=e*f[c.prop].value+f[c.prop].unit},duration:b.duration,easing:b.easing,complete:function(){if(!b.autoHeight){b.toShow.css("height","")}b.toShow.css({width:i,overflow:d});b.complete()}})},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1e3:200})}}})})(jQuery);(function(a,b){var c=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var b=this,c=this.element[0].ownerDocument,d;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(b.options.disabled||b.element.attr("readonly")){return}d=false;var e=a.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:b._move("previousPage",c);break;case e.PAGE_DOWN:b._move("nextPage",c);break;case e.UP:b._move("previous",c);c.preventDefault();break;case e.DOWN:b._move("next",c);c.preventDefault();break;case e.ENTER:case e.NUMPAD_ENTER:if(b.menu.active){d=true;c.preventDefault()};case e.TAB:if(!b.menu.active){return}b.menu.select(c);break;case e.ESCAPE:b.element.val(b.term);b.close(c);break;default:clearTimeout(b.searching);b.searching=setTimeout(function(){if(b.term!=b.element.val()){b.selectedItem=null;b.search(null,c)}},b.options.delay);break}}).bind("keypress.autocomplete",function(a){if(d){d=false;a.preventDefault()}}).bind("focus.autocomplete",function(){if(b.options.disabled){return}b.selectedItem=null;b.previous=b.element.val()}).bind("blur.autocomplete",function(a){if(b.options.disabled){return}clearTimeout(b.searching);b.closing=setTimeout(function(){b.close(a);b._change(a)},150)});this._initSource();this.response=function(){return b._response.apply(b,arguments)};this.menu=a("<ul></ul>").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",c)[0]).mousedown(function(c){var d=b.menu.element[0];if(!a(c.target).closest(".ui-menu-item").length){setTimeout(function(){a(document).one("mousedown",function(c){if(c.target!==b.element[0]&&c.target!==d&&!a.ui.contains(d,c.target)){b.close()}})},1)}setTimeout(function(){clearTimeout(b.closing)},13)}).menu({focus:function(a,c){var d=c.item.data("item.autocomplete");if(false!==b._trigger("focus",a,{item:d})){if(/^key/.test(a.originalEvent.type)){b.element.val(d.value)}}},selected:function(a,d){var e=d.item.data("item.autocomplete"),f=b.previous;if(b.element[0]!==c.activeElement){b.element.focus();b.previous=f;setTimeout(function(){b.previous=f;b.selectedItem=e},1)}if(false!==b._trigger("select",a,{item:e})){b.element.val(e.value)}b.term=b.element.val();b.close(a);b.selectedItem=e},blur:function(a,c){if(b.menu.element.is(":visible")&&b.element.val()!==b.term){b.element.val(b.term)}}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");if(a.fn.bgiframe){this.menu.element.bgiframe()}},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments);if(b==="source"){this._initSource()}if(b==="appendTo"){this.menu.element.appendTo(a(c||"body",this.element[0].ownerDocument)[0])}if(b==="disabled"&&c&&this.xhr){this.xhr.abort()}},_initSource:function(){var b=this,d,e;if(a.isArray(this.options.source)){d=this.options.source;this.source=function(b,c){c(a.ui.autocomplete.filter(d,b.term))}}else if(typeof this.options.source==="string"){e=this.options.source;this.source=function(d,f){if(b.xhr){b.xhr.abort()}b.xhr=a.ajax({url:e,data:d,dataType:"json",autocompleteRequest:++c,success:function(a,b){if(this.autocompleteRequest===c){f(a)}},error:function(){if(this.autocompleteRequest===c){f([])}}})}}else{this.source=this.options.source}},search:function(a,b){a=a!=null?a:this.element.val();this.term=this.element.val();if(a.length<this.options.minLength){return this.close(b)}clearTimeout(this.closing);if(this._trigger("search",b)===false){return}return this._search(a)},_search:function(a){this.pending++;this.element.addClass("ui-autocomplete-loading");this.source({term:a},this.response)},_response:function(a){if(!this.options.disabled&&a&&a.length){a=this._normalize(a);this._suggest(a);this._trigger("open")}else{this.close()}this.pending--;if(!this.pending){this.element.removeClass("ui-autocomplete-loading")}},close:function(a){clearTimeout(this.closing);if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.deactivate();this._trigger("close",a)}},_change:function(a){if(this.previous!==this.element.val()){this._trigger("change",a,{item:this.selectedItem})}},_normalize:function(b){if(b.length&&b[0].label&&b[0].value){return b}return a.map(b,function(b){if(typeof b==="string"){return{label:b,value:b}}return a.extend({label:b.label||b.value,value:b.value||b.label},b)})},_suggest:function(b){var c=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(c,b);this.menu.deactivate();this.menu.refresh();c.show();this._resizeMenu();c.position(a.extend({of:this.element},this.options.position));if(this.options.autoFocus){this.menu.next(new a.Event("mouseover"))}},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth(),this.element.outerWidth()))},_renderMenu:function(b,c){var d=this;a.each(c,function(a,c){d._renderItem(b,c)})},_renderItem:function(b,c){return a("<li></li>").data("item.autocomplete",c).append(a("<a></a>").text(c.label)).appendTo(b)},_move:function(a,b){if(!this.menu.element.is(":visible")){this.search(null,b);return}if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate();return}this.menu[a](b)},widget:function(){return this.menu.element}});a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})})(jQuery);(function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){if(!a(c.target).closest(".ui-menu-item a").length){return}c.preventDefault();b.select(c)});this.refresh()},refresh:function(){var b=this;var c=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");c.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(c){b.activate(c,a(this).parent())}).mouseleave(function(){b.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();if(c<0){this.element.scrollTop(d+c)}else if(c>=e){this.element.scrollTop(d+c-e+b.height())}}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",a,{item:b})},deactivate:function(){if(!this.active){return}this.active.children("a").removeClass("ui-state-hover").removeAttr("id");this._trigger("blur");this.active=null},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,c){if(!this.active){this.activate(c,this.element.children(b));return}var d=this.active[a+"All"](".ui-menu-item").eq(0);if(d.length){this.activate(c,d)}else{this.activate(c,this.element.children(b))}},nextPage:function(b){if(this.hasScroll()){if(!this.active||this.last()){this.activate(b,this.element.children(".ui-menu-item:first"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c-d+a(this).height();return b<10&&b>-10});if(!e.length){e=this.element.children(".ui-menu-item:last")}this.activate(b,e)}else{this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))}},previousPage:function(b){if(this.hasScroll()){if(!this.active||this.first()){this.activate(b,this.element.children(".ui-menu-item:last"));return}var c=this.active.offset().top,d=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c+d-a(this).height();return b<10&&b>-10});if(!result.length){result=this.element.children(".ui-menu-item:first")}this.activate(b,result)}else{this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))}},hasScroll:function(){return this.element.height()<this.element[a.fn.prop?"prop":"attr"]("scrollHeight")},select:function(a){this._trigger("selected",a,{item:this.active})}})})(jQuery);(function(a,b){var c,d,e,f,g="ui-button ui-widget ui-state-default ui-corner-all",h="ui-state-hover ui-state-active ",i="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",j=function(){var b=a(this).find(":ui-button");setTimeout(function(){b.button("refresh")},1)},k=function(b){var c=b.name,d=b.form,e=a([]);if(c){if(d){e=a(d).find("[name='"+c+"']")}else{e=a("[name='"+c+"']",b.ownerDocument).filter(function(){return!this.form})}}return e};a.widget("ui.button",{options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",j);if(typeof this.options.disabled!=="boolean"){this.options.disabled=this.element.attr("disabled")}this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var b=this,h=this.options,i=this.type==="checkbox"||this.type==="radio",l="ui-state-hover"+(!i?" ui-state-active":""),m="ui-state-focus";if(h.label===null){h.label=this.buttonElement.html()}if(this.element.is(":disabled")){h.disabled=true}this.buttonElement.addClass(g).attr("role","button").bind("mouseenter.button",function(){if(h.disabled){return}a(this).addClass("ui-state-hover");if(this===c){a(this).addClass("ui-state-active")}}).bind("mouseleave.button",function(){if(h.disabled){return}a(this).removeClass(l)}).bind("click.button",function(a){if(h.disabled){a.preventDefault();a.stopImmediatePropagation()}});this.element.bind("focus.button",function(){b.buttonElement.addClass(m)}).bind("blur.button",function(){b.buttonElement.removeClass(m)});if(i){this.element.bind("change.button",function(){if(f){return}b.refresh()});this.buttonElement.bind("mousedown.button",function(a){if(h.disabled){return}f=false;d=a.pageX;e=a.pageY}).bind("mouseup.button",function(a){if(h.disabled){return}if(d!==a.pageX||e!==a.pageY){f=true}})}if(this.type==="checkbox"){this.buttonElement.bind("click.button",function(){if(h.disabled||f){return false}a(this).toggleClass("ui-state-active");b.buttonElement.attr("aria-pressed",b.element[0].checked)})}else if(this.type==="radio"){this.buttonElement.bind("click.button",function(){if(h.disabled||f){return false}a(this).addClass("ui-state-active");b.buttonElement.attr("aria-pressed",true);var c=b.element[0];k(c).not(c).map(function(){return a(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed",false)})}else{this.buttonElement.bind("mousedown.button",function(){if(h.disabled){return false}a(this).addClass("ui-state-active");c=this;a(document).one("mouseup",function(){c=null})}).bind("mouseup.button",function(){if(h.disabled){return false}a(this).removeClass("ui-state-active")}).bind("keydown.button",function(b){if(h.disabled){return false}if(b.keyCode==a.ui.keyCode.SPACE||b.keyCode==a.ui.keyCode.ENTER){a(this).addClass("ui-state-active")}}).bind("keyup.button",function(){a(this).removeClass("ui-state-active")});if(this.buttonElement.is("a")){this.buttonElement.keyup(function(b){if(b.keyCode===a.ui.keyCode.SPACE){a(this).click()}})}}this._setOption("disabled",h.disabled);this._resetButton()},_determineButtonType:function(){if(this.element.is(":checkbox")){this.type="checkbox"}else if(this.element.is(":radio")){this.type="radio"}else if(this.element.is("input")){this.type="input"}else{this.type="button"}if(this.type==="checkbox"||this.type==="radio"){var a=this.element.parents().filter(":last"),b="label[for="+this.element.attr("id")+"]";this.buttonElement=a.find(b);if(!this.buttonElement.length){a=a.length?a.siblings():this.element.siblings();this.buttonElement=a.filter(b);if(!this.buttonElement.length){this.buttonElement=a.find(b)}}this.element.addClass("ui-helper-hidden-accessible");var c=this.element.is(":checked");if(c){this.buttonElement.addClass("ui-state-active")}this.buttonElement.attr("aria-pressed",c)}else{this.buttonElement=this.element}},widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass(g+" "+h+" "+i).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());if(!this.hasTitle){this.buttonElement.removeAttr("title")}a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments);if(b==="disabled"){if(c){this.element.attr("disabled",true)}else{this.element.removeAttr("disabled")}return}this._resetButton()},refresh:function(){var b=this.element.is(":disabled");if(b!==this.options.disabled){this._setOption("disabled",b)}if(this.type==="radio"){k(this.element[0]).each(function(){if(a(this).is(":checked")){a(this).button("widget").addClass("ui-state-active").attr("aria-pressed",true)}else{a(this).button("widget").removeClass("ui-state-active").attr("aria-pressed",false)}})}else if(this.type==="checkbox"){if(this.element.is(":checked")){this.buttonElement.addClass("ui-state-active").attr("aria-pressed",true)}else{this.buttonElement.removeClass("ui-state-active").attr("aria-pressed",false)}}},_resetButton:function(){if(this.type==="input"){if(this.options.label){this.element.val(this.options.label)}return}var b=this.buttonElement.removeClass(i),c=a("<span></span>").addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary,f=[];if(d.primary||d.secondary){if(this.options.text){f.push("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary"))}if(d.primary){b.prepend("<span class='ui-button-icon-primary ui-icon "+d.primary+"'></span>")}if(d.secondary){b.append("<span class='ui-button-icon-secondary ui-icon "+d.secondary+"'></span>")}if(!this.options.text){f.push(e?"ui-button-icons-only":"ui-button-icon-only");if(!this.hasTitle){b.attr("title",c)}}}else{f.push("ui-button-text-only")}b.addClass(f.join(" "))}});a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){if(b==="disabled"){this.buttons.button("option",b,c)}a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var b=this.element.css("direction")==="ltr";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(b?"ui-corner-left":"ui-corner-right").end().filter(":last").addClass(b?"ui-corner-right":"ui-corner-left").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");a.Widget.prototype.destroy.call(this)}})})(jQuery);(function(a,b){var c="ui-dialog "+"ui-widget "+"ui-widget-content "+"ui-corner-all ",d={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},e={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},f=a.attrFn||{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true,click:true};a.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",showCloseButton:true,showTitleBar:true,dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",collision:"fit",using:function(b){var c=a(this).css(b).offset().top;if(c<0){a(this).css("top",b.top-c)}}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string"){this.originalTitle=""}this.options.title=this.options.title||this.originalTitle;var b=this,d=b.options,e=d.title||"&#160;",f=a.ui.dialog.getTitleId(b.element),g=(b.uiDialog=a("<div></div>")).appendTo(document.body).hide().addClass(c+d.dialogClass).css({zIndex:d.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(c){if(d.closeOnEscape&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE){b.close(c);c.preventDefault()}}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(a){b.moveToTop(false,a)}),h=b.element.show().removeAttr("title").addClass("ui-dialog-content "+"ui-widget-content").appendTo(g),i=(b.uiDialogTitlebar=a("<div></div>")).addClass("ui-dialog-titlebar "+"ui-widget-header "+"ui-corner-all "+(!d.showTitleBar?" ui-helper-hidden":" ui-helper-clearfix")).prependTo(g),j=a('<a href="#"></a>').addClass("ui-dialog-titlebar-close "+"ui-corner-all"+(!d.showCloseButton?" ui-helper-hidden":"")).attr("role","button").hover(function(){j.addClass("ui-state-hover")},function(){j.removeClass("ui-state-hover")}).focus(function(){j.addClass("ui-state-focus")}).blur(function(){j.removeClass("ui-state-focus")}).click(function(a){b.close(a);return false}).appendTo(i),k=(b.uiDialogTitlebarCloseText=a("<span></span>")).addClass("ui-icon "+"ui-icon-closethick").text(d.closeText).appendTo(j),l=a("<span></span>").addClass("ui-dialog-title").attr("id",f).html(e).prependTo(i);if(a.isFunction(d.beforeclose)&&!a.isFunction(d.beforeClose)){d.beforeClose=d.beforeclose}i.find("*").add(i).disableSelection();if(d.draggable&&a.fn.draggable){b._makeDraggable()}if(d.resizable&&a.fn.resizable){b._makeResizable()}b._createButtons(d.buttons);b._isOpen=false;if(a.fn.bgiframe){g.bgiframe()}},_init:function(){if(this.options.autoOpen){this.open()}},destroy:function(){var a=this;if(a.overlay){a.overlay.destroy()}a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");a.uiDialog.remove();if(a.originalTitle){a.element.attr("title",a.originalTitle)}return a},widget:function(){return this.uiDialog},close:function(b){var c=this,d,e;if(false===c._trigger("beforeClose",b)){return}if(c.overlay){c.overlay.destroy()}c.uiDialog.unbind("keypress.ui-dialog");c._isOpen=false;if(c.options.hide){c.uiDialog.hide(c.options.hide,function(){c._trigger("close",b)})}else{c.uiDialog.hide();c._trigger("close",b)}a.ui.dialog.overlay.resize();if(c.options.modal){d=0;a(".ui-dialog").each(function(){if(this!==c.uiDialog[0]){e=a(this).css("z-index");if(!isNaN(e)){d=Math.max(d,e)}}});a.ui.dialog.maxZ=d}return c},isOpen:function(){return this._isOpen},moveToTop:function(b,c){var d=this,e=d.options,f;if(e.modal&&!b||!e.stack&&!e.modal){return d._trigger("focus",c)}if(e.zIndex>a.ui.dialog.maxZ){a.ui.dialog.maxZ=e.zIndex}if(d.overlay){a.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",a.ui.dialog.overlay.maxZ=a.ui.dialog.maxZ)}f={scrollTop:d.element.attr("scrollTop"),scrollLeft:d.element.attr("scrollLeft")};a.ui.dialog.maxZ+=1;d.uiDialog.css("z-index",a.ui.dialog.maxZ);d.element.attr(f);d._trigger("focus",c);return d},open:function(){if(this._isOpen){return}var b=this,c=b.options,d=b.uiDialog;b.overlay=c.modal?new a.ui.dialog.overlay(b):null;b._size();b._position(c.position);d.show(c.show);b.moveToTop(true);if(c.modal){d.bind("keypress.ui-dialog",function(b){if(b.keyCode!==a.ui.keyCode.TAB){return}var c=a(":tabbable",this),d=c.filter(":first"),e=c.filter(":last");if(b.target===e[0]&&!b.shiftKey){d.focus(1);return false}else if(b.target===d[0]&&b.shiftKey){e.focus(1);return false}})}a(b.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();b._isOpen=true;b._trigger("open");return b},_createButtons:function(b){var c=this,d=false,e=a("<div></div>").addClass("ui-dialog-buttonpane "+"ui-widget-content "+"ui-helper-clearfix"),g=a("<div></div>").addClass("ui-dialog-buttonset").appendTo(e);c.uiDialog.find(".ui-dialog-buttonpane").remove();if(typeof b==="object"&&b!==null){a.each(b,function(){return!(d=true)})}if(d){a.each(b,function(b,d){d=a.isFunction(d)?{click:d,text:b}:d;var e=a('<button type="button"></button>').click(function(){d.click.apply(c.element[0],arguments)}).appendTo(g);a.each(d,function(a,b){if(a==="click"){return}if(a in f){e[a](b)}else{e.attr(a,b)}});if(a.fn.button){e.button()}});e.appendTo(c.uiDialog)}},_makeDraggable:function(){function f(a){return{position:a.position,offset:a.offset}}var b=this,c=b.options,d=a(document),e;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(d,g){e=c.height==="auto"?"auto":a(this).height();a(this).height(a(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",d,f(g))},drag:function(a,c){b._trigger("drag",a,f(c))},stop:function(g,h){c.position=[h.position.left-d.scrollLeft(),h.position.top-d.scrollTop()];a(this).removeClass("ui-dialog-dragging").height(e);b._trigger("dragStop",g,f(h));a.ui.dialog.overlay.resize()}})},_makeResizable:function(c){function h(a){return{originalPosition:a.originalPosition,originalSize:a.originalSize,position:a.position,size:a.size}}c=c===b?this.options.resizable:c;var d=this,e=d.options,f=d.uiDialog.css("position"),g=typeof c==="string"?c:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:g,start:function(b,c){a(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",b,h(c))},resize:function(a,b){d._trigger("resize",a,h(b))},stop:function(b,c){a(this).removeClass("ui-dialog-resizing");e.height=a(this).height();e.width=a(this).width();d._trigger("resizeStop",b,h(c));a.ui.dialog.overlay.resize()}}).css("position",f).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;if(a.height==="auto"){return a.minHeight}else{return Math.min(a.minHeight,a.height)}},_position:function(b){var c=[],d=[0,0],e;if(b){if(typeof b==="string"||typeof b==="object"&&"0"in b){c=b.split?b.split(" "):[b[0],b[1]];if(c.length===1){c[1]=c[0]}a.each(["left","top"],function(a,b){if(+c[a]===c[a]){d[a]=c[a];c[a]=b}});b={my:c.join(" "),at:c.join(" "),offset:d.join(" ")}}b=a.extend({},a.ui.dialog.prototype.options.position,b)}else{b=a.ui.dialog.prototype.options.position}e=this.uiDialog.is(":visible");if(!e){this.uiDialog.show()}this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},b));if(!e){this.uiDialog.hide()}},_setOptions:function(b){var c=this,f={},g=false;a.each(b,function(a,b){c._setOption(a,b);if(a in d){g=true}if(a in e){f[a]=b}});if(g){this._size()}if(this.uiDialog.is(":data(resizable)")){this.uiDialog.resizable("option",f)}},_setOption:function(b,d){var e=this,f=e.uiDialog;switch(b){case"beforeclose":b="beforeClose";break;case"buttons":e._createButtons(d);break;case"closeText":e.uiDialogTitlebarCloseText.text(""+d);break;case"showCloseButton":e.uiDialogTitlebar.find(".ui-dialog-titlebar-close")[d?"removeClass":"addClass"]("ui-helper-hidden");break;case"showTitleBar":if(d){e.uiDialogTitlebar.removeClass("ui-helper-hidden").addClass("ui-helper-clearfix")}else{e.uiDialogTitlebar.addClass("ui-helper-hidden").removeClass("ui-helper-clearfix")}break;case"dialogClass":f.removeClass(e.options.dialogClass).addClass(c+d);break;case"disabled":if(d){f.addClass("ui-dialog-disabled")}else{f.removeClass("ui-dialog-disabled")}break;case"draggable":var g=f.is(":data(draggable)");if(g&&!d){f.draggable("destroy")}if(!g&&d){e._makeDraggable()}break;case"position":e._position(d);break;case"resizable":var h=f.is(":data(resizable)");if(h&&!d){f.resizable("destroy")}if(h&&typeof d==="string"){f.resizable("option","handles",d)}if(!h&&d!==false){e._makeResizable(d)}break;case"title":a(".ui-dialog-title",e.uiDialogTitlebar).html(""+(d||"&#160;"));break}a.Widget.prototype._setOption.apply(e,arguments)},_size:function(){var b=this.options,c,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(b.minWidth>b.width){b.width=b.minWidth}c=this.uiDialog.css({height:"auto",width:b.width}).height();d=Math.max(0,b.minHeight-c);if(b.height==="auto"){if(a.support.minHeight){this.element.css({minHeight:d,height:"auto"})}else{this.uiDialog.show();var f=this.element.css("height","auto").height();if(!e){this.uiDialog.hide()}this.element.height(Math.max(f,d))}}else{this.element.height(Math.max(b.height-c,0))}if(this.uiDialog.is(":data(resizable)")){this.uiDialog.resizable("option","minHeight",this._minHeight())}}});a.extend(a.ui.dialog,{version:"1.8.14",uuid:0,maxZ:0,getTitleId:function(a){var b=a.attr("id");if(!b){this.uuid+=1;b=this.uuid}return"ui-dialog-title-"+b},overlay:function(b){this.$el=a.ui.dialog.overlay.create(b)}});a.extend(a.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(b){if(this.instances.length===0){setTimeout(function(){if(a.ui.dialog.overlay.instances.length){a(document).bind(a.ui.dialog.overlay.events,function(b){if(a(b.target).zIndex()<a.ui.dialog.overlay.maxZ){return false}})}},1);a(document).bind("keydown.dialog-overlay",function(c){if(b.options.closeOnEscape&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE){b.close(c);c.preventDefault()}});a(window).bind("resize.dialog-overlay",a.ui.dialog.overlay.resize)}var c=(this.oldInstances.pop()||a("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});if(a.fn.bgiframe){c.bgiframe()}this.instances.push(c);return c},destroy:function(b){var c=a.inArray(b,this.instances);if(c!=-1){this.oldInstances.push(this.instances.splice(c,1)[0])}if(this.instances.length===0){a([document,window]).unbind(".dialog-overlay")}b.remove();var d=0;a.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){var b,c;if(a.browser.msie&&a.browser.version<7){b=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(b<c){return a(window).height()+"px"}else{return b+"px"}}else{return a(document).height()+"px"}},width:function(){var b,c;if(a.browser.msie){b=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);c=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(b<c){return a(window).width()+"px"}else{return b+"px"}}else{return a(document).width()+"px"}},resize:function(){var b=a([]);a.each(a.ui.dialog.overlay.instances,function(){b=b.add(this)});b.css({width:0,height:0}).css({width:a.ui.dialog.overlay.width(),height:a.ui.dialog.overlay.height()})}});a.extend(a.ui.dialog.overlay.prototype,{destroy:function(){a.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);(function(a,b){var c=5;a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var b=this,d=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",g=d.values&&d.values.length||1,h=[];this._keySliding=false;this._mouseSliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider"+" ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(d.disabled?" ui-slider-disabled ui-disabled":""));this.range=a([]);if(d.range){if(d.range===true){if(!d.values){d.values=[this._valueMin(),this._valueMin()]}if(d.values.length&&d.values.length!==2){d.values=[d.values[0],d.values[0]]}}this.range=a("<div></div>").appendTo(this.element).addClass("ui-slider-range"+" ui-widget-header"+(d.range==="min"||d.range==="max"?" ui-slider-range-"+d.range:""))}for(var i=e.length;i<g;i+=1){h.push(f)}this.handles=e.add(a(h.join("")).appendTo(b.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(a){a.preventDefault()}).hover(function(){if(!d.disabled){a(this).addClass("ui-state-hover")}},function(){a(this).removeClass("ui-state-hover")}).focus(function(){if(!d.disabled){a(".ui-slider .ui-state-focus").removeClass("ui-state-focus");a(this).addClass("ui-state-focus")}else{a(this).blur()}}).blur(function(){a(this).removeClass("ui-state-focus")});this.handles.each(function(b){a(this).data("index.ui-slider-handle",b)});this.handles.keydown(function(d){var e=true,f=a(this).data("index.ui-slider-handle"),g,h,i,j;if(b.options.disabled){return}switch(d.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:e=false;if(!b._keySliding){b._keySliding=true;a(this).addClass("ui-state-active");g=b._start(d,f);if(g===false){return}}break}j=b.options.step;if(b.options.values&&b.options.values.length){h=i=b.values(f)}else{h=i=b.value()}switch(d.keyCode){case a.ui.keyCode.HOME:i=b._valueMin();break;case a.ui.keyCode.END:i=b._valueMax();break;case a.ui.keyCode.PAGE_UP:i=b._trimAlignValue(h+(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.PAGE_DOWN:i=b._trimAlignValue(h-(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(h===b._valueMax()){return}i=b._trimAlignValue(h+j);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(h===b._valueMin()){return}i=b._trimAlignValue(h-j);break}b._slide(d,f,i);return e}).keyup(function(c){var d=a(this).data("index.ui-slider-handle");if(b._keySliding){b._keySliding=false;b._stop(c,d);b._change(c,d);a(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider"+" ui-slider-horizontal"+" ui-slider-vertical"+" ui-slider-disabled"+" ui-widget"+" ui-widget-content"+" ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();return this},_mouseCapture:function(b){var c=this.options,d,e,f,g,h,i,j,k,l;if(c.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();d={x:b.pageX,y:b.pageY};e=this._normValueFromMouse(d);f=this._valueMax()-this._valueMin()+1;h=this;this.handles.each(function(b){var c=Math.abs(e-h.values(b));if(f>c){f=c;g=a(this);i=b}});if(c.range===true&&this.values(1)===c.min){i+=1;g=a(this.handles[i])}j=this._start(b,i);if(j===false){return false}this._mouseSliding=true;h._handleIndex=i;g.addClass("ui-state-active").focus();k=g.offset();l=!a(b.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=l?{left:0,top:0}:{left:b.pageX-k.left-g.width()/2,top:b.pageY-k.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)};if(!this.handles.hasClass("ui-state-hover")){this._slide(b,i,e)}this._animateOff=true;return true},_mouseStart:function(a){return true},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);this._slide(a,this._handleIndex,c);return false},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._handleIndex=null;this._clickOffset=null;this._animateOff=false;return false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;if(this.orientation==="horizontal"){b=this.elementSize.width;c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{b=this.elementSize.height;c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}d=c/b;if(d>1){d=1}if(d<0){d=0}if(this.orientation==="vertical"){d=1-d}e=this._valueMax()-this._valueMin();f=this._valueMin()+d*e;return this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}return this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;if(this.options.values&&this.options.values.length){d=this.values(b?0:1);if(this.options.values.length===2&&this.options.range===true&&(b===0&&c>d||b===1&&c<d)){c=d}if(c!==this.values(b)){e=this.values();e[b]=c;f=this._trigger("slide",a,{handle:this.handles[b],value:c,values:e});d=this.values(b?0:1);if(f!==false){this.values(b,c,true)}}}else{if(c!==this.value()){f=this._trigger("slide",a,{handle:this.handles[b],value:c});if(f!==false){this.value(c)}}}},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("change",a,c)}},value:function(a){if(arguments.length){this.options.value=this._trimAlignValue(a);this._refreshValue();this._change(null,0);return}return this._value()},values:function(b,c){var d,e,f;if(arguments.length>1){this.options.values[b]=this._trimAlignValue(c);this._refreshValue();this._change(null,b);return}if(arguments.length){if(a.isArray(arguments[0])){d=this.options.values;e=arguments[0];for(f=0;f<d.length;f+=1){d[f]=this._trimAlignValue(e[f]);this._change(null,f)}this._refreshValue()}else{if(this.options.values&&this.options.values.length){return this._values(b)}else{return this.value()}}}else{return this._values()}},_setOption:function(b,c){var d,e=0;if(a.isArray(this.options.values)){e=this.options.values.length}a.Widget.prototype._setOption.apply(this,arguments);switch(b){case"disabled":if(c){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled");this.element.addClass("ui-disabled")}else{this.handles.removeAttr("disabled");this.element.removeClass("ui-disabled")}break;case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case"value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case"values":this._animateOff=true;this._refreshValue();for(d=0;d<e;d+=1){this._change(null,d)}this._animateOff=false;break}},_value:function(){var a=this.options.value;a=this._trimAlignValue(a);return a},_values:function(a){var b,c,d;if(arguments.length){b=this.options.values[a];b=this._trimAlignValue(b);return b}else{c=this.options.values.slice();for(d=0;d<c.length;d+=1){c[d]=this._trimAlignValue(c[d])}return c}},_trimAlignValue:function(a){if(a<=this._valueMin()){return this._valueMin()}if(a>=this._valueMax()){return this._valueMax()}var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b;alignValue=a-c;if(Math.abs(c)*2>=b){alignValue+=c>0?b:-b}return parseFloat(alignValue.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,c=this.options,d=this,e=!this._animateOff?c.animate:false,f,g={},h,i,j,k;if(this.options.values&&this.options.values.length){this.handles.each(function(b,i){f=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100;g[d.orientation==="horizontal"?"left":"bottom"]=f+"%";a(this).stop(1,1)[e?"animate":"css"](g,c.animate);if(d.options.range===true){if(d.orientation==="horizontal"){if(b===0){d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate)}if(b===1){d.range[e?"animate":"css"]({width:f-h+"%"},{queue:false,duration:c.animate})}}else{if(b===0){d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate)}if(b===1){d.range[e?"animate":"css"]({height:f-h+"%"},{queue:false,duration:c.animate})}}}h=f})}else{i=this.value();j=this._valueMin();k=this._valueMax();f=k!==j?(i-j)/(k-j)*100:0;g[d.orientation==="horizontal"?"left":"bottom"]=f+"%";this.handle.stop(1,1)[e?"animate":"css"](g,c.animate);if(b==="min"&&this.orientation==="horizontal"){this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate)}if(b==="max"&&this.orientation==="horizontal"){this.range[e?"animate":"css"]({width:100-f+"%"},{queue:false,duration:c.animate})}if(b==="min"&&this.orientation==="vertical"){this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate)}if(b==="max"&&this.orientation==="vertical"){this.range[e?"animate":"css"]({height:100-f+"%"},{queue:false,duration:c.animate})}}}});a.extend(a.ui.slider,{version:"1.8.14"})})(jQuery);(function(a,b){function e(){return++c}function f(){return++d}var c=0,d=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading&#8230;</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(true)},_setOption:function(a,b){if(a=="selected"){if(this.options.collapsible&&b==this.options.selected){return}this.select(b)}else{this.options[a]=b;this._tabify()}},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+f());return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(a,b){return{tab:a,panel:b,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function m(b,c){b.css("display","");if(!a.support.opacity&&c.opacity){b[0].style.removeAttribute("filter")}}var d=this,e=this.options,f=/^#.+/;this.list=this.element.find("ol:not(.ui-tabs-skip),ul:not(.ui-tabs-skip)").eq(0);this.lis=a(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return a("a",this)[0]});this.panels=a([]);this.anchors.each(function(b,c){var g=a(c).attr("href");var h=g.split("#")[0],i;if(h&&(h===location.toString().split("#")[0]||(i=a("base")[0])&&h===i.href)){g=c.hash;c.href=g}if(f.test(g)){d.panels=d.panels.add(d.element.find(d._sanitizeSelector(g)))}else if(g&&g!=="#"){a.data(c,"href.tabs",g);a.data(c,"load.tabs",g.replace(/#.*$/,""));var j=d._tabId(c);c.href="#"+j;var k=d.element.find("#"+j);if(!k.length){k=a(e.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(d.panels[b-1]||d.list);k.data("destroy.tabs",true)}d.panels=d.panels.add(k)}else{e.disabled.push(b)}});if(c){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(e.selected===b){if(location.hash){this.anchors.each(function(a,b){if(b.hash==location.hash){e.selected=a;return false}})}if(typeof e.selected!=="number"&&e.cookie){e.selected=parseInt(d._cookie(),10)}if(typeof e.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length){e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}e.selected=e.selected||(this.lis.length?0:-1)}else if(e.selected===null){e.selected=-1}e.selected=e.selected>=0&&this.anchors[e.selected]||e.selected<0?e.selected:0;e.disabled=a.unique(e.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(a,b){return d.lis.index(a)}))).sort();if(a.inArray(e.selected,e.disabled)!=-1){e.disabled.splice(a.inArray(e.selected,e.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(e.selected>=0&&this.anchors.length){d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(e.selected).addClass("ui-tabs-selected ui-state-active");d.element.queue("tabs",function(){d._trigger("show",null,d._ui(d.anchors[e.selected],d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash))[0]))});this.load(e.selected)}a(window).bind("unload",function(){d.lis.add(d.anchors).unbind(".tabs");d.lis=d.anchors=d.panels=null})}else{e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[e.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(e.cookie){this._cookie(e.selected,e.cookie)}for(var g=0,h;h=this.lis[g];g++){a(h)[a.inArray(g,e.disabled)!=-1&&!a(h).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(e.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(e.event!=="mouseover"){var i=function(a,b){if(b.is(":not(.ui-state-disabled)")){b.addClass("ui-state-"+a)}};var j=function(a,b){b.removeClass("ui-state-"+a)};this.lis.bind("mouseover.tabs",function(){i("hover",a(this))});this.lis.bind("mouseout.tabs",function(){j("hover",a(this))});this.anchors.bind("focus.tabs",function(){i("focus",a(this).closest("li"))});this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var k,l;if(e.fx){if(a.isArray(e.fx)){k=e.fx[0];l=e.fx[1]}else{k=l=e.fx}}var n=l?function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active");c.hide().removeClass("ui-tabs-hide").animate(l,l.duration||"normal",function(){m(c,l);d._trigger("show",null,d._ui(b,c[0]))})}:function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active");c.removeClass("ui-tabs-hide");d._trigger("show",null,d._ui(b,c[0]))};var o=k?function(a,b){b.animate(k,k.duration||"normal",function(){d.lis.removeClass("ui-tabs-selected ui-state-active");b.addClass("ui-tabs-hide");m(b,k);d.element.dequeue("tabs")})}:function(a,b,c){d.lis.removeClass("ui-tabs-selected ui-state-active");b.addClass("ui-tabs-hide");d.element.dequeue("tabs")};this.anchors.bind(e.event+".tabs",function(){var b=this,c=a(b).closest("li"),f=d.panels.filter(":not(.ui-tabs-hide)"),g=d.element.find(d._sanitizeSelector(b.hash));if(c.hasClass("ui-tabs-selected")&&!e.collapsible||c.hasClass("ui-state-disabled")||c.hasClass("ui-state-processing")||d.panels.filter(":animated").length||d._trigger("select",null,d._ui(this,g[0]))===false){this.blur();return false}e.selected=d.anchors.index(this);d.abort();if(e.collapsible){if(c.hasClass("ui-tabs-selected")){e.selected=-1;if(e.cookie){d._cookie(e.selected,e.cookie)}d.element.queue("tabs",function(){o(b,f)}).dequeue("tabs");this.blur();return false}else if(!f.length){if(e.cookie){d._cookie(e.selected,e.cookie)}d.element.queue("tabs",function(){n(b,g)});d.load(d.anchors.index(this));this.blur();return false}}if(e.cookie){d._cookie(e.selected,e.cookie)}if(g.length){if(f.length){d.element.queue("tabs",function(){o(b,f)})}d.element.queue("tabs",function(){n(b,g)});d.load(d.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(a.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(a){if(typeof a=="string"){a=this.anchors.index(this.anchors.filter("[href$="+a+"]"))}return a},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var b=a.data(this,"href.tabs");if(b){this.href=b}var c=a(this).unbind(".tabs");a.each(["href","load","cache"],function(a,b){c.removeData(b+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if(a.data(this,"destroy.tabs")){a(this).remove()}else{a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}});if(b.cookie){this._cookie(null,b.cookie)}return this},add:function(c,d,e){if(e===b){e=this.anchors.length}var f=this,g=this.options,h=a(g.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,d)),i=!c.indexOf("#")?c.replace("#",""):this._tabId(a("a",h)[0]);h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=f.element.find("#"+i);if(!j.length){j=a(g.panelTemplate).attr("id",i).data("destroy.tabs",true)}j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(e>=this.lis.length){h.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{h.insertBefore(this.lis[e]);j.insertBefore(this.panels[e])}g.disabled=a.map(g.disabled,function(a,b){return a>=e?++a:a});this._tabify();if(this.anchors.length==1){g.selected=0;h.addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){f._trigger("show",null,f._ui(f.anchors[0],f.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[e],this.panels[e]));return this},remove:function(b){b=this._getIndex(b);var c=this.options,d=this.lis.eq(b).remove(),e=this.panels.eq(b).remove();if(d.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(b+(b+1<this.anchors.length?1:-1))}c.disabled=a.map(a.grep(c.disabled,function(a,c){return a!=b}),function(a,c){return a>=b?--a:a});this._tabify();this._trigger("remove",null,this._ui(d.find("a")[0],e[0]));return this},enable:function(b){b=this._getIndex(b);var c=this.options;if(a.inArray(b,c.disabled)==-1){return}this.lis.eq(b).removeClass("ui-state-disabled");c.disabled=a.grep(c.disabled,function(a,c){return a!=b});this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]));return this},disable:function(a){a=this._getIndex(a);var b=this,c=this.options;if(a!=c.selected){this.lis.eq(a).addClass("ui-state-disabled");c.disabled.push(a);c.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a]))}return this},select:function(a){a=this._getIndex(a);if(a==-1){if(this.options.collapsible&&this.options.selected!=-1){a=this.options.selected}else{return this}}this.anchors.eq(a).trigger(this.options.event+".tabs");return this},load:function(b){b=this._getIndex(b);var c=this,d=this.options,e=this.anchors.eq(b)[0],f=a.data(e,"load.tabs");this.abort();if(!f||this.element.queue("tabs").length!==0&&a.data(e,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(b).addClass("ui-state-processing");if(d.spinner){var g=a("span",e);g.data("label.tabs",g.html()).html(d.spinner)}this.xhr=a.ajax(a.extend({},d.ajaxOptions,{url:f,success:function(f,g){c.element.find(c._sanitizeSelector(e.hash)).html(f);c._cleanup();if(d.cache){a.data(e,"cache.tabs",true)}c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.success(f,g)}catch(h){}},error:function(a,f,g){c._cleanup();c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.error(a,f,b,e)}catch(g){}}}));c.element.dequeue("tabs");return this},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},url:function(a,b){this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",b);return this},length:function(){return this.anchors.length}});a.extend(a.ui.tabs,{version:"1.8.14"});a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(a,b){var c=this,d=this.options;var e=c._rotate||(c._rotate=function(b){clearTimeout(c.rotation);c.rotation=setTimeout(function(){var a=d.selected;c.select(++a<c.anchors.length?a:0)},a);if(b){b.stopPropagation()}});var f=c._unrotate||(c._unrotate=!b?function(a){if(a.clientX){c.rotate(null)}}:function(a){t=d.selected;e()});if(a){this.element.bind("tabsshow",e);this.anchors.bind(d.event+".tabs",f);e()}else{clearTimeout(c.rotation);this.element.unbind("tabsshow",e);this.anchors.unbind(d.event+".tabs",f);delete this._rotate;delete this._unrotate}return this}})})(jQuery);(function($,undefined){function Datepicker(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false};$.extend(this._defaults,this.regional[""]);this.dpDiv=bindHover($('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function bindHover(a){var b="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return a.bind("mouseout",function(a){var c=$(a.target).closest(b);if(!c.length){return}c.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(c){var d=$(c.target).closest(b);if($.datepicker._isDisabledDatepicker(instActive.inline?a.parent()[0]:instActive.input[0])||!d.length){return}d.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");d.addClass("ui-state-hover");if(d.hasClass("ui-datepicker-prev"))d.addClass("ui-datepicker-prev-hover");if(d.hasClass("ui-datepicker-next"))d.addClass("ui-datepicker-next-hover")})}function extendRemove(a,b){$.extend(a,b);for(var c in b)if(b[c]==null||b[c]==undefined)a[c]=b[c];return a}function isArray(a){return a&&($.browser.safari&&typeof a=="object"&&a.length||a.constructor&&a.constructor.toString().match(/\Array\(\)/))}$.extend($.ui,{datepicker:{version:"1.8.14"}});var PROP_NAME="datepicker";var dpuuid=(new Date).getTime();var instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){if(this.debug)console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){extendRemove(this._defaults,a||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var inline=nodeName=="div"||nodeName=="span";if(!target.id){this.uuid+=1;target.id="dp"+this.uuid}var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=="input"){this._connectDatepicker(target,inst)}else if(inline){this._inlineDatepicker(target,inst)}},_newInst:function(a,b){var c=a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:c,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(a,b){var c=$(a);b.append=$([]);b.trigger=$([]);if(c.hasClass(this.markerClassName))return;this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)});this._autoSize(b);$.data(a,PROP_NAME,b)},_attachments:function(a,b){var c=this._get(b,"appendText");var d=this._get(b,"isRTL");if(b.append)b.append.remove();if(c){b.append=$('<span class="'+this._appendClass+'">'+c+"</span>");a[d?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);if(b.trigger)b.trigger.remove();var e=this._get(b,"showOn");if(e=="focus"||e=="both")a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText");var g=this._get(b,"buttonImage");b.trigger=$(this._get(b,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:g,alt:f,title:f}):$('<button type="button"></button>').addClass(this._triggerClass).html(g==""?f:$("<img/>").attr({src:g,alt:f,title:f})));a[d?"before":"after"](b.trigger);b.trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0])$.datepicker._hideDatepicker();else $.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,12-1,20);var c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0;var c=0;for(var d=0;d<a.length;d++){if(a[d].length>b){b=a[d].length;c=d}}return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=$(a);if(c.hasClass(this.markerClassName))return;c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)});$.data(a,PROP_NAME,b);this._setDate(b,this._getDefaultDate(b),true);this._updateDatepicker(b);this._updateAlternate(b);b.dpDiv.show()},_dialogDatepicker:function(a,b,c,d,e){var f=this._dialogInst;if(!f){this.uuid+=1;var g="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+g+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);f=this._dialogInst=this._newInst(this._dialogInput,false);f.settings={};$.data(this._dialogInput[0],PROP_NAME,f)}extendRemove(f.settings,d||{});b=b&&b.constructor==Date?this._formatDate(f,b):b;this._dialogInput.val(b);this._pos=e?e.length?e:[e.pageX,e.pageY]:null;if(!this._pos){var h=document.documentElement.clientWidth;var i=document.documentElement.clientHeight;var j=document.documentElement.scrollLeft||document.body.scrollLeft;var k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");f.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI)$.blockUI(this.dpDiv);$.data(this._dialogInput[0],PROP_NAME,f);return this},_destroyDatepicker:function(a){var b=$(a);var c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName)){return}var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME);if(d=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(d=="div"||d=="span")b.removeClass(this.markerClassName).empty()},_enableDatepicker:function(a){var b=$(a);var c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName)){return}var d=a.nodeName.toLowerCase();if(d=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().removeClass("ui-state-disabled");e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b})},_disableDatepicker:function(a){var b=$(a);var c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName)){return}var d=a.nodeName.toLowerCase();if(d=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().addClass("ui-state-disabled");e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b});this._disabledInputs[this._disabledInputs.length]=a},_isDisabledDatepicker:function(a){if(!a){return false}for(var b=0;b<this._disabledInputs.length;b++){if(this._disabledInputs[b]==a)return true}return false},_getInst:function(a){try{return $.data(a,PROP_NAME)}catch(b){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(a,b,c){var d=this._getInst(a);if(arguments.length==2&&typeof b=="string"){return b=="defaults"?$.extend({},$.datepicker._defaults):d?b=="all"?$.extend({},d.settings):this._get(d,b):null}var e=b||{};if(typeof b=="string"){e={};e[b]=c}if(d){if(this._curInst==d){this._hideDatepicker()}var f=this._getDateDatepicker(a,true);var g=this._getMinMaxDate(d,"min");var h=this._getMinMaxDate(d,"max");extendRemove(d.settings,e);if(g!==null&&e["dateFormat"]!==undefined&&e["minDate"]===undefined)d.settings.minDate=this._formatDate(d,g);if(h!==null&&e["dateFormat"]!==undefined&&e["maxDate"]===undefined)d.settings.maxDate=this._formatDate(d,h);this._attachments($(a),d);this._autoSize(d);this._setDate(d,f);this._updateAlternate(d);this._updateDatepicker(d)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){var b=this._getInst(a);if(b){this._updateDatepicker(b)}},_setDateDatepicker:function(a,b){var c=this._getInst(a);if(c){this._setDate(c,b);this._updateDatepicker(c);this._updateAlternate(c)}},_getDateDatepicker:function(a,b){var c=this._getInst(a);if(c&&!c.inline)this._setDateFromField(c,b);return c?this._getDate(c):null},_doKeyDown:function(a){var b=$.datepicker._getInst(a.target);var c=true;var d=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=true;if($.datepicker._datepickerShowing)switch(a.keyCode){case 9:$.datepicker._hideDatepicker();c=false;break;case 13:var e=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",b.dpDiv);if(e[0])$.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,e[0]);else $.datepicker._hideDatepicker();return false;break;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 34:$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 35:if(a.ctrlKey||a.metaKey)$.datepicker._clearDate(a.target);c=a.ctrlKey||a.metaKey;break;case 36:if(a.ctrlKey||a.metaKey)$.datepicker._gotoToday(a.target);c=a.ctrlKey||a.metaKey;break;case 37:if(a.ctrlKey||a.metaKey)$.datepicker._adjustDate(a.target,d?+1:-1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 38:if(a.ctrlKey||a.metaKey)$.datepicker._adjustDate(a.target,-7,"D");c=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||a.metaKey)$.datepicker._adjustDate(a.target,d?-1:+1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 40:if(a.ctrlKey||a.metaKey)$.datepicker._adjustDate(a.target,+7,"D");c=a.ctrlKey||a.metaKey;break;default:c=false}else if(a.keyCode==36&&a.ctrlKey)$.datepicker._showDatepicker(this);else{c=false}if(c){a.preventDefault();a.stopPropagation()}},_doKeyPress:function(a){var b=$.datepicker._getInst(a.target);if($.datepicker._get(b,"constrainInput")){var c=$.datepicker._possibleChars($.datepicker._get(b,"dateFormat"));var d=String.fromCharCode(a.charCode==undefined?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||d<" "||!c||c.indexOf(d)>-1}},_doKeyUp:function(a){var b=$.datepicker._getInst(a.target);if(b.input.val()!=b.lastVal){try{var c=$.datepicker.parseDate($.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,$.datepicker._getFormatConfig(b));if(c){$.datepicker._setDateFromField(b);$.datepicker._updateAlternate(b);$.datepicker._updateDatepicker(b)}}catch(a){$.datepicker.log(a)}}return true},_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=$("input",a.parentNode)[0];if($.datepicker._isDisabledDatepicker(a)||$.datepicker._lastInput==a)return;var b=$.datepicker._getInst(a);if($.datepicker._curInst&&$.datepicker._curInst!=b){if($.datepicker._datepickerShowing){$.datepicker._triggerOnClose($.datepicker._curInst)}$.datepicker._curInst.dpDiv.stop(true,true)}var c=$.datepicker._get(b,"beforeShow");extendRemove(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;$.datepicker._lastInput=a;$.datepicker._setDateFromField(b);if($.datepicker._inDialog)a.value="";if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(a);$.datepicker._pos[1]+=a.offsetHeight}var d=false;$(a).parents().each(function(){d|=$(this).css("position")=="fixed";return!d});if(d&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}var e={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(b);e=$.datepicker._checkOffset(b,e,d);b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":d?"fixed":"absolute",display:"none",left:e.left+"px",top:e.top+"px"});if(!b.inline){var f=$.datepicker._get(b,"showAnim");var g=$.datepicker._get(b,"duration");var h=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(!!a.length){var c=$.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex($(a).zIndex()+1);$.datepicker._datepickerShowing=true;if($.effects&&$.effects[f])b.dpDiv.show(f,$.datepicker._get(b,"showOptions"),g,h);else b.dpDiv[f||"show"](f?g:null,h);if(!f||!g)h();if(b.input.is(":visible")&&!b.input.is(":disabled"))b.input.focus();$.datepicker._curInst=b}},_updateDatepicker:function(a){var b=this;b.maxRows=4;var c=$.datepicker._getBorders(a.dpDiv);instActive=a;a.dpDiv.empty().append(this._generateHTML(a));var d=a.dpDiv.find("iframe.ui-datepicker-cover");if(!!d.length){d.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()})}a.dpDiv.find("."+this._dayOverClass+" a").mouseover();var e=this._getNumberOfMonths(a);var f=e[1];var g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");if(f>1)a.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",g*f+"em");a.dpDiv[(e[0]!=1||e[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(a==$.datepicker._curInst&&$.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement)a.input.focus();if(a.yearshtml){var h=a.yearshtml;setTimeout(function(){if(h===a.yearshtml&&a.yearshtml){a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml)}h=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var d=a.dpDiv.outerWidth();var e=a.dpDiv.outerHeight();var f=a.input?a.input.outerWidth():0;var g=a.input?a.input.outerHeight():0;var h=document.documentElement.clientWidth+$(document).scrollLeft();var i=document.documentElement.clientHeight+$(document).scrollTop();b.left-=this._get(a,"isRTL")?d-f:0;b.left-=c&&b.left==a.input.offset().left?$(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+g?$(document).scrollTop():0;b.left-=Math.min(b.left,b.left+d>h&&h>d?Math.abs(b.left+d-h):0);b.top-=Math.min(b.top,b.top+e>i&&i>e?Math.abs(e+g):0);return b},_findPos:function(a){var b=this._getInst(a);var c=this._get(b,"isRTL");while(a&&(a.type=="hidden"||a.nodeType!=1||$.expr.filters.hidden(a))){a=a[c?"previousSibling":"nextSibling"]}var d=$(a).offset();return[d.left,d.top]},_triggerOnClose:function(a){var b=this._get(a,"onClose");if(b)b.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a])},_hideDatepicker:function(a){var b=this._curInst;if(!b||a&&b!=$.data(a,PROP_NAME))return;if(this._datepickerShowing){var c=this._get(b,"showAnim");var d=this._get(b,"duration");var e=function(){$.datepicker._tidyDialog(b);this._curInst=null};if($.effects&&$.effects[c])b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,e);else b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,e);if(!c)e();$.datepicker._triggerOnClose(b);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!$.datepicker._curInst)return;var b=$(a.target);if(b[0].id!=$.datepicker._mainDivId&&b.parents("#"+$.datepicker._mainDivId).length==0&&!b.hasClass($.datepicker.markerClassName)&&!b.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI))$.datepicker._hideDatepicker()},_adjustDate:function(a,b,c){var d=$(a);var e=this._getInst(d[0]);if(this._isDisabledDatepicker(d[0])){return}this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c);this._updateDatepicker(e)},_gotoToday:function(a){var b=$(a);var c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay){c.selectedDay=c.currentDay;c.drawMonth=c.selectedMonth=c.currentMonth;c.drawYear=c.selectedYear=c.currentYear}else{var d=new Date;c.selectedDay=d.getDate();c.drawMonth=c.selectedMonth=d.getMonth();c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c);this._adjustDate(b)},_selectMonthYear:function(a,b,c){var d=$(a);var e=this._getInst(d[0]);e._selectingMonthYear=false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(d)},_clickMonthYear:function(a){var b=$(a);var c=this._getInst(b[0]);if(c.input&&c._selectingMonthYear){setTimeout(function(){c.input.focus()},0)}c._selectingMonthYear=!c._selectingMonthYear},_selectDay:function(a,b,c,d){var e=$(a);if($(d).hasClass(this._unselectableClass)||this._isDisabledDatepicker(e[0])){return}var f=this._getInst(e[0]);f.selectedDay=f.currentDay=$("a",d).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))},_clearDate:function(a){var b=$(a);var c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a);var d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d);if(d.input)d.input.val(b);this._updateAlternate(d);var e=this._get(d,"onSelect");if(e)e.apply(d.input?d.input[0]:null,[b,d]);else if(d.input)d.input.trigger("change");if(d.inline)this._updateDatepicker(d);else{this._hideDatepicker();this._lastInput=d.input[0];if(typeof d.input[0]!="object")d.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat");var d=this._getDate(a);var e=this.formatDate(c,d,this._getFormatConfig(a));$(b).each(function(){$(this).val(e)})}},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();b.setMonth(0);b.setDate(1);return Math.floor(Math.round((c-b)/864e5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort;var f=(c?c.dayNames:null)||this._defaults.dayNames;var g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;var h=(c?c.monthNames:null)||this._defaults.monthNames;var i=-1;var j=-1;var k=-1;var l=-1;var m=false;var n=function(b){var c=s+1<a.length&&a.charAt(s+1)==b;if(c)s++;return c};var o=function(a){var c=n(a);var d=a=="@"?14:a=="!"?20:a=="y"&&c?4:a=="o"?3:2;var e=new RegExp("^\\d{1,"+d+"}");var f=b.substring(r).match(e);if(!f)throw"Missing number at position "+r;r+=f[0].length;return parseInt(f[0],10)};var p=function(a,c,d){var e=$.map(n(a)?d:c,function(a,b){return[[b,a]]}).sort(function(a,b){return-(a[1].length-b[1].length)});var f=-1;$.each(e,function(a,c){var d=c[1];if(b.substr(r,d.length).toLowerCase()==d.toLowerCase()){f=c[0];r+=d.length;return false}});if(f!=-1)return f+1;else throw"Unknown name at position "+r};var q=function(){if(b.charAt(r)!=a.charAt(s))throw"Unexpected literal at position "+r;r++};var r=0;for(var s=0;s<a.length;s++){if(m)if(a.charAt(s)=="'"&&!n("'"))m=false;else q();else switch(a.charAt(s)){case"d":k=o("d");break;case"D":p("D",e,f);break;case"o":l=o("o");break;case"m":j=o("m");break;case"M":j=p("M",g,h);break;case"y":i=o("y");break;case"@":var t=new Date(o("@"));i=t.getFullYear();j=t.getMonth()+1;k=t.getDate();break;case"!":var t=new Date((o("!")-this._ticksTo1970)/1e4);i=t.getFullYear();j=t.getMonth()+1;k=t.getDate();break;case"'":if(n("'"))q();else m=true;break;default:q()}}if(r<b.length){throw"Extra/unparsed characters found in date: "+b.substring(r)}if(i==-1)i=(new Date).getFullYear();else if(i<100)i+=(new Date).getFullYear()-(new Date).getFullYear()%100+(i<=d?0:-100);if(l>-1){j=1;k=l;do{var u=this._getDaysInMonth(i,j-1);if(k<=u)break;j++;k-=u}while(true)}var t=this._daylightSavingAdjust(new Date(i,j-1,k));if(t.getFullYear()!=i||t.getMonth()+1!=j||t.getDate()!=k)throw"Invalid date";return t},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:((1970-1)*365+Math.floor(1970/4)-Math.floor(1970/100)+Math.floor(1970/400))*24*60*60*1e7,formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort;var e=(c?c.dayNames:null)||this._defaults.dayNames;var f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;var g=(c?c.monthNames:null)||this._defaults.monthNames;var h=function(b){var c=m+1<a.length&&a.charAt(m+1)==b;if(c)m++;return c};var i=function(a,b,c){var d=""+b;if(h(a))while(d.length<c)d="0"+d;return d};var j=function(a,b,c,d){return h(a)?d[b]:c[b]};var k="";var l=false;if(b)for(var m=0;m<a.length;m++){if(l)if(a.charAt(m)=="'"&&!h("'"))l=false;else k+=a.charAt(m);else switch(a.charAt(m)){case"d":k+=i("d",b.getDate(),2);break;case"D":k+=j("D",b.getDay(),d,e);break;case"o":k+=i("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864e5),3);break;case"m":k+=i("m",b.getMonth()+1,2);break;case"M":k+=j("M",b.getMonth(),f,g);break;case"y":k+=h("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case"@":k+=b.getTime();break;case"!":k+=b.getTime()*1e4+this._ticksTo1970;break;case"'":if(h("'"))k+="'";else l=true;break;default:k+=a.charAt(m)}}return k},_possibleChars:function(a){var b="";var c=false;var d=function(b){var c=e+1<a.length&&a.charAt(e+1)==b;if(c)e++;return c};for(var e=0;e<a.length;e++)if(c)if(a.charAt(e)=="'"&&!d("'"))c=false;else b+=a.charAt(e);else switch(a.charAt(e)){case"d":case"m":case"y":case"@":b+="0123456789";break;case"D":case"M":return null;case"'":if(d("'"))b+="'";else c=true;break;default:b+=a.charAt(e)}return b},_get:function(a,b){return a.settings[b]!==undefined?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()==a.lastVal){return}var c=this._get(a,"dateFormat");var d=a.lastVal=a.input?a.input.val():null;var e,f;e=f=this._getDefaultDate(a);var g=this._getFormatConfig(a);try{e=this.parseDate(c,d,g)||f}catch(h){this.log(h);d=b?"":d}a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();a.currentDay=d?e.getDate():0;a.currentMonth=d?e.getMonth():0;a.currentYear=d?e.getFullYear():0;this._adjustInstDate(a)},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var d=function(a){var b=new Date;b.setDate(b.getDate()+a);return b};var e=function(b){try{return $.datepicker.parseDate($.datepicker._get(a,"dateFormat"),b,$.datepicker._getFormatConfig(a))}catch(c){}var d=(b.toLowerCase().match(/^c/)?$.datepicker._getDate(a):null)||new Date;var e=d.getFullYear();var f=d.getMonth();var g=d.getDate();var h=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var i=h.exec(b);while(i){switch(i[2]||"d"){case"d":case"D":g+=parseInt(i[1],10);break;case"w":case"W":g+=parseInt(i[1],10)*7;break;case"m":case"M":f+=parseInt(i[1],10);g=Math.min(g,$.datepicker._getDaysInMonth(e,f));break;case"y":case"Y":e+=parseInt(i[1],10);g=Math.min(g,$.datepicker._getDaysInMonth(e,f));break}i=h.exec(b)}return new Date(e,f,g)};var f=b==null||b===""?c:typeof b=="string"?e(b):typeof b=="number"?isNaN(b)?c:d(b):new Date(b.getTime());f=f&&f.toString()=="Invalid Date"?c:f;if(f){f.setHours(0);f.setMinutes(0);f.setSeconds(0);f.setMilliseconds(0)}return this._daylightSavingAdjust(f)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(a.getHours()>12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var d=!b;var e=a.selectedMonth;var f=a.selectedYear;var g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth();a.drawYear=a.selectedYear=a.currentYear=g.getFullYear();if((e!=a.selectedMonth||f!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input){a.input.val(d?"":this._formatDate(a))}},_getDate:function(a){var b=!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL");var d=this._get(a,"showButtonPanel");var e=this._get(a,"hideIfNoPrevNext");var f=this._get(a,"navigationAsDateFormat");var g=this._getNumberOfMonths(a);var h=this._get(a,"showCurrentAtPos");var i=this._get(a,"stepMonths");var j=g[0]!=1||g[1]!=1;var k=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay));var l=this._getMinMaxDate(a,"min");var m=this._getMinMaxDate(a,"max");var n=a.drawMonth-h;var o=a.drawYear;if(n<0){n+=12;o--}if(m){var p=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-g[0]*g[1]+1,m.getDate()));p=l&&p<l?l:p;while(this._daylightSavingAdjust(new Date(o,n,1))>p){n--;if(n<0){n=11;o--}}}a.drawMonth=n;a.drawYear=o;var q=this._get(a,"prevText");q=!f?q:this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a));var r=this._canAdjustMonth(a,-1,o,n)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+a.id+"', -"+i+", 'M');\""+' title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>":e?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>";var s=this._get(a,"nextText");s=!f?s:this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a));var t=this._canAdjustMonth(a,+1,o,n)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+a.id+"', +"+i+", 'M');\""+' title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>":e?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>";var u=this._get(a,"currentText");var v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;u=!f?u:this.formatDate(u,v,this._getFormatConfig(a));var w=!a.inline?'<a class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+dpuuid+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</a>":"";var x=d?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?w:"")+(this._isInRange(a,v)?'<a class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._gotoToday('#"+a.id+"');\""+">"+u+"</a>":"")+(c?"":w)+"</div>":"";var y=parseInt(this._get(a,"firstDay"),10);y=isNaN(y)?0:y;var z=this._get(a,"showWeek");var A=this._get(a,"dayNames");var B=this._get(a,"dayNamesShort");var C=this._get(a,"dayNamesMin");var D=this._get(a,"monthNames");var E=this._get(a,"monthNamesShort");var F=this._get(a,"beforeShowDay");var G=this._get(a,"showOtherMonths");var H=this._get(a,"selectOtherMonths");var I=this._get(a,"calculateWeek")||this.iso8601Week;var J=this._getDefaultDate(a);var K="";for(var L=0;L<g[0];L++){var M="";this.maxRows=4;for(var N=0;N<g[1];N++){var O=this._daylightSavingAdjust(new Date(o,n,a.selectedDay));var P=" ui-corner-all";var Q="";if(j){Q+='<div class="ui-datepicker-group';if(g[1]>1)switch(N){case 0:Q+=" ui-datepicker-group-first";P=" ui-corner-"+(c?"right":"left");break;case g[1]-1:Q+=" ui-datepicker-group-last";P=" ui-corner-"+(c?"left":"right");break;default:Q+=" ui-datepicker-group-middle";P="";break}Q+='">'}Q+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+P+'">'+(/all|left/.test(P)&&L==0?c?t:r:"")+(/all|right/.test(P)&&L==0?c?r:t:"")+this._generateMonthYearHeader(a,n,o,l,m,L>0||N>0,D,E)+'</div><table class="ui-datepicker-calendar"><thead>'+"<tr>";var R=z?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="<th"+((S+y+6)%7>=5?' class="ui-datepicker-week-end"':"")+">"+'<span title="'+A[T]+'">'+C[T]+"</span></th>"}Q+=R+"</tr></thead><tbody>";var U=this._getDaysInMonth(o,n);if(o==a.selectedYear&&n==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,U);var V=(this._getFirstDayOfMonth(o,n)-y+7)%7;var W=Math.ceil((V+U)/7);var X=j?this.maxRows>W?this.maxRows:W:W;this.maxRows=X;var Y=this._daylightSavingAdjust(new Date(o,n,1-V));for(var Z=0;Z<X;Z++){Q+="<tr>";var _=!z?"":'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(Y)+"</td>";for(var S=0;S<7;S++){var ab=F?F.apply(a.input?a.input[0]:null,[Y]):[true,""];var bb=Y.getMonth()!=n;var cb=bb&&!H||!ab[0]||l&&Y<l||m&&Y>m;_+='<td class="'+((S+y+6)%7>=5?" ui-datepicker-week-end":"")+(bb?" ui-datepicker-other-month":"")+(Y.getTime()==O.getTime()&&n==a.selectedMonth&&a._keyEvent||J.getTime()==Y.getTime()&&J.getTime()==O.getTime()?" "+this._dayOverClass:"")+(cb?" "+this._unselectableClass+" ui-state-disabled":"")+(bb&&!G?"":" "+ab[1]+(Y.getTime()==k.getTime()?" "+this._currentClass:"")+(Y.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!bb||G)&&ab[2]?' title="'+ab[2]+'"':"")+(cb?"":' onclick="DP_jQuery_'+dpuuid+".datepicker._selectDay('#"+a.id+"',"+Y.getMonth()+","+Y.getFullYear()+', this);return false;"')+">"+(bb&&!G?"&#xa0;":cb?'<span class="ui-state-default">'+Y.getDate()+"</span>":'<a class="ui-state-default'+(Y.getTime()==b.getTime()?" ui-state-highlight":"")+(Y.getTime()==k.getTime()?" ui-state-active":"")+(bb?" ui-priority-secondary":"")+'" href="#">'+Y.getDate()+"</a>")+"</td>";Y.setDate(Y.getDate()+1);Y=this._daylightSavingAdjust(Y)}Q+=_+"</tr>"}n++;if(n>11){n=0;o++}Q+="</tbody></table>"+(j?"</div>"+(g[0]>0&&N==g[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");M+=Q}K+=M}K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");a._keyEvent=false;return K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth");var j=this._get(a,"changeYear");var k=this._get(a,"showMonthAfterYear");var l='<div class="ui-datepicker-title">';var m="";if(f||!i)m+='<span class="ui-datepicker-month">'+g[b]+"</span>";else{var n=d&&d.getFullYear()==c;var o=e&&e.getFullYear()==c;m+='<select class="ui-datepicker-month" '+'onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" "+'onclick="DP_jQuery_'+dpuuid+".datepicker._clickMonthYear('#"+a.id+"');\""+">";for(var p=0;p<12;p++){if((!n||p>=d.getMonth())&&(!o||p<=e.getMonth()))m+='<option value="'+p+'"'+(p==b?' selected="selected"':"")+">"+h[p]+"</option>"}m+="</select>"}if(!k)l+=m+(f||!(i&&j)?"&#xa0;":"");if(!a.yearshtml){a.yearshtml="";if(f||!j)l+='<span class="ui-datepicker-year">'+c+"</span>";else{var q=this._get(a,"yearRange").split(":");var r=(new Date).getFullYear();var s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b};var t=s(q[0]);var u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t;u=e?Math.min(u,e.getFullYear()):u;a.yearshtml+='<select class="ui-datepicker-year" '+'onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" "+'onclick="DP_jQuery_'+dpuuid+".datepicker._clickMonthYear('#"+a.id+"');\""+">";for(;t<=u;t++){a.yearshtml+='<option value="'+t+'"'+(t==c?' selected="selected"':"")+">"+t+"</option>"}a.yearshtml+="</select>";l+=a.yearshtml;a.yearshtml=null}}l+=this._get(a,"yearSuffix");if(k)l+=(f||!(i&&j)?"&#xa0;":"")+m;l+="</div>";return l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0);var e=a.drawMonth+(c=="M"?b:0);var f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0);var g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate();a.drawMonth=a.selectedMonth=g.getMonth();a.drawYear=a.selectedYear=g.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");var d=this._getMinMaxDate(a,"max");var e=c&&b<c?c:b;e=d&&e>d?d:e;return e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a);var f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));if(b<0)f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth()));return this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");var d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}});$.fn.datepicker=function(a){if(!this.length){return this}if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv);$.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));return this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)})};$.datepicker=new Datepicker;$.datepicker.initialized=false;$.datepicker.uuid=(new Date).getTime();$.datepicker.version="1.8.14";window["DP_jQuery_"+dpuuid]=$})(jQuery);(function(a,b){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=a("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");this.valueDiv.remove();a.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===b){return this._value()}this._setOption("value",a);return this},_setOption:function(b,c){if(b==="value"){this.options.value=c;this._refreshValue();if(this._value()===this.options.max){this._trigger("complete")}}a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number"){a=0}return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var a=this.value();var b=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(b.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});a.extend(a.ui.progressbar,{version:"1.8.14"})})(jQuery);jQuery.effects||function(a,b){function c(b){var c;if(b&&b.constructor==Array&&b.length==3)return b;if(c=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];if(c=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))return[parseFloat(c[1])*2.55,parseFloat(c[2])*2.55,parseFloat(c[3])*2.55];if(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];if(c=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b))return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];if(c=/rgba\(0, 0, 0, 0\)/.exec(b))return e["transparent"];return e[a.trim(b).toLowerCase()]}function d(b,d){var e;do{e=a.curCSS(b,d);if(e!=""&&e!="transparent"||a.nodeName(b,"body"))break;d="backgroundColor"}while(b=b.parentNode);return c(e)}function h(){var a=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,b={},c,d;if(a&&a.length&&a[0]&&a[a[0]]){var e=a.length;while(e--){c=a[e];if(typeof a[c]=="string"){d=c.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()});b[d]=a[c]}}}else{for(c in a){if(typeof a[c]==="string"){b[c]=a[c]}}}return b}function i(b){var c,d;for(c in b){d=b[c];if(d==null||a.isFunction(d)||c in g||/scrollbar/.test(c)||!/color/i.test(c)&&isNaN(parseFloat(d))){delete b[c]}}return b}function j(a,b){var c={_:0},d;for(d in b){if(a[d]!=b[d]){c[d]=b[d]}}return c}function k(b,c,d,e){if(typeof b=="object"){e=c;d=null;c=b;b=c.effect}if(a.isFunction(c)){e=c;d=null;c={}}if(typeof c=="number"||a.fx.speeds[c]){e=d;d=c;c={}}if(a.isFunction(d)){e=d;d=null}c=c||{};d=d||c.duration;d=a.fx.off?0:typeof d=="number"?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default;e=e||c.complete;return[b,c,d,e]}function l(b){if(!b||typeof b==="number"||a.fx.speeds[b]){return true}if(typeof b==="string"&&!a.effects[b]){return true}return false}a.effects={};a.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(b,e){a.fx.step[e]=function(a){if(!a.colorInit){a.start=d(a.elem,e);a.end=c(a.end);a.colorInit=true}a.elem.style[e]="rgb("+Math.max(Math.min(parseInt(a.pos*(a.end[0]-a.start[0])+a.start[0],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[1]-a.start[1])+a.start[1],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[2]-a.start[2])+a.start[2],10),255),0)+")"}});var e={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};var f=["add","remove","toggle"],g={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(b,c,d,e){if(a.isFunction(d)){e=d;d=null}return this.queue(function(){var g=a(this),k=g.attr("style")||" ",l=i(h.call(this)),m,n=g.attr("class");a.each(f,function(a,c){if(b[c]){g[c+"Class"](b[c])}});m=i(h.call(this));g.attr("class",n);g.animate(j(l,m),{queue:false,duration:c,easing:d,complete:function(){a.each(f,function(a,c){if(b[c]){g[c+"Class"](b[c])}});if(typeof g.attr("style")=="object"){g.attr("style").cssText="";g.attr("style").cssText=k}else{g.attr("style",k)}if(e){e.apply(this,arguments)}a.dequeue(this)}})})};a.fn.extend({_addClass:a.fn.addClass,addClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{add:b},c,d,e]):this._addClass(b)},_removeClass:a.fn.removeClass,removeClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{remove:b},c,d,e]):this._removeClass(b)},_toggleClass:a.fn.toggleClass,toggleClass:function(c,d,e,f,g){if(typeof d=="boolean"||d===b){if(!e){return this._toggleClass(c,d)}else{return a.effects.animateClass.apply(this,[d?{add:c}:{remove:c},e,f,g])}}else{return a.effects.animateClass.apply(this,[{toggle:c},d,e,f])}},switchClass:function(b,c,d,e,f){return a.effects.animateClass.apply(this,[{add:c,remove:b},d,e,f])}});a.extend(a.effects,{version:"1.8.14",save:function(a,b){for(var c=0;c<b.length;c++){if(b[c]!==null)a.data("ec.storage."+b[c],a[0].style[b[c]])}},restore:function(a,b){for(var c=0;c<b.length;c++){if(b[c]!==null)a.css(b[c],a.data("ec.storage."+b[c]))}},setMode:function(a,b){if(b=="toggle")b=a.is(":hidden")?"show":"hide";return b},getBaseline:function(a,b){var c,d;switch(a[0]){case"top":c=0;break;case"middle":c=.5;break;case"bottom":c=1;break;default:c=a[0]/b.height}switch(a[1]){case"left":d=0;break;case"center":d=.5;break;case"right":d=1;break;default:d=a[1]/b.width}return{x:d,y:c}},createWrapper:function(b){if(b.parent().is(".ui-effects-wrapper")){return b.parent()}var c={width:b.outerWidth(true),height:b.outerHeight(true),"float":b.css("float")},d=a("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});b.wrap(d);d=b.parent();if(b.css("position")=="static"){d.css({position:"relative"});b.css({position:"relative"})}else{a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")});a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d);if(isNaN(parseInt(c[d],10))){c[d]="auto"}});b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return d.css(c).show()},removeWrapper:function(a){if(a.parent().is(".ui-effects-wrapper"))return a.parent().replaceWith(a);return a},setTransition:function(b,c,d,e){e=e||{};a.each(c,function(a,c){unit=b.cssUnit(c);if(unit[0]>0)e[c]=unit[0]*d+unit[1]});return e}});a.fn.extend({effect:function(b,c,d,e){var f=k.apply(this,arguments),g={options:f[1],duration:f[2],callback:f[3]},h=g.options.mode,i=a.effects[b];if(a.fx.off||!i){if(h){return this[h](g.duration,g.callback)}else{return this.each(function(){if(g.callback){g.callback.call(this)}})}}return i.call(this,g)},_show:a.fn.show,show:function(a){if(l(a)){return this._show.apply(this,arguments)}else{var b=k.apply(this,arguments);b[1].mode="show";return this.effect.apply(this,b)}},_hide:a.fn.hide,hide:function(a){if(l(a)){return this._hide.apply(this,arguments)}else{var b=k.apply(this,arguments);b[1].mode="hide";return this.effect.apply(this,b)}},__toggle:a.fn.toggle,toggle:function(b){if(l(b)||typeof b==="boolean"||a.isFunction(b)){return this.__toggle.apply(this,arguments)}else{var c=k.apply(this,arguments);c[1].mode="toggle";return this.effect.apply(this,c)}},cssUnit:function(b){var c=this.css(b),d=[];a.each(["em","px","%","pt"],function(a,b){if(c.indexOf(b)>0)d=[parseFloat(c),b]});return d}});a.easing.jswing=a.easing.swing;a.extend(a.easing,{def:"easeOutQuad",swing:function(b,c,d,e,f){return a.easing[a.easing.def](b,c,d,e,f)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b+c;return-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b+c;return d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b*b+c;return d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){if(b==0)return c;if(b==e)return c+d;if((b/=e/2)<1)return d/2*Math.pow(2,10*(b-1))+c;return d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){if((b/=e/2)<1)return-d/2*(Math.sqrt(1-b*b)-1)+c;return d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158;var g=0;var h=d;if(b==0)return c;if((b/=e)==1)return c+d;if(!g)g=e*.3;if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g))+c},easeOutElastic:function(a,b,c,d,e){var f=1.70158;var g=0;var h=d;if(b==0)return c;if((b/=e)==1)return c+d;if(!g)g=e*.3;if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*b)*Math.sin((b*e-f)*2*Math.PI/g)+d+c},easeInOutElastic:function(a,b,c,d,e){var f=1.70158;var g=0;var h=d;if(b==0)return c;if((b/=e/2)==2)return c+d;if(!g)g=e*.3*1.5;if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);if(b<1)return-.5*h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)+c;return h*Math.pow(2,-10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)*.5+d+c},easeInBack:function(a,c,d,e,f,g){if(g==b)g=1.70158;return e*(c/=f)*c*((g+1)*c-g)+d},easeOutBack:function(a,c,d,e,f,g){if(g==b)g=1.70158;return e*((c=c/f-1)*c*((g+1)*c+g)+1)+d},easeInOutBack:function(a,c,d,e,f,g){if(g==b)g=1.70158;if((c/=f/2)<1)return e/2*c*c*(((g*=1.525)+1)*c-g)+d;return e/2*((c-=2)*c*(((g*=1.525)+1)*c+g)+2)+d},easeInBounce:function(b,c,d,e,f){return e-a.easing.easeOutBounce(b,f-c,0,e,f)+d},easeOutBounce:function(a,b,c,d,e){if((b/=e)<1/2.75){return d*7.5625*b*b+c}else if(b<2/2.75){return d*(7.5625*(b-=1.5/2.75)*b+.75)+c}else if(b<2.5/2.75){return d*(7.5625*(b-=2.25/2.75)*b+.9375)+c}else{return d*(7.5625*(b-=2.625/2.75)*b+.984375)+c}},easeInOutBounce:function(b,c,d,e,f){if(c<f/2)return a.easing.easeInBounce(b,c*2,0,e,f)*.5+d;return a.easing.easeOutBounce(b,c*2-f,0,e,f)*.5+e*.5+d}})}(jQuery);(function(a,b){a.effects.blind=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"];var e=a.effects.setMode(c,b.options.mode||"hide");var f=b.options.direction||"vertical";a.effects.save(c,d);c.show();var g=a.effects.createWrapper(c).css({overflow:"hidden"});var h=f=="vertical"?"height":"width";var i=f=="vertical"?g.height():g.width();if(e=="show")g.css(h,0);var j={};j[h]=e=="show"?i:0;g.animate(j,b.duration,b.options.easing,function(){if(e=="hide")c.hide();a.effects.restore(c,d);a.effects.removeWrapper(c);if(b.callback)b.callback.apply(c[0],arguments);c.dequeue()})})}})(jQuery);(function(a,b){a.effects.bounce=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"];var e=a.effects.setMode(c,b.options.mode||"effect");var f=b.options.direction||"up";var g=b.options.distance||20;var h=b.options.times||5;var i=b.duration||250;if(/show|hide/.test(e))d.push("opacity");a.effects.save(c,d);c.show();a.effects.createWrapper(c);var j=f=="up"||f=="down"?"top":"left";var k=f=="up"||f=="left"?"pos":"neg";var g=b.options.distance||(j=="top"?c.outerHeight({margin:true})/3:c.outerWidth({margin:true})/3);if(e=="show")c.css("opacity",0).css(j,k=="pos"?-g:g);if(e=="hide")g=g/(h*2);if(e!="hide")h--;if(e=="show"){var l={opacity:1};l[j]=(k=="pos"?"+=":"-=")+g;c.animate(l,i/2,b.options.easing);g=g/2;h--}for(var m=0;m<h;m++){var n={},p={};n[j]=(k=="pos"?"-=":"+=")+g;p[j]=(k=="pos"?"+=":"-=")+g;c.animate(n,i/2,b.options.easing).animate(p,i/2,b.options.easing);g=e=="hide"?g*2:g/2}if(e=="hide"){var l={opacity:0};l[j]=(k=="pos"?"-=":"+=")+g;c.animate(l,i/2,b.options.easing,function(){c.hide();a.effects.restore(c,d);a.effects.removeWrapper(c);if(b.callback)b.callback.apply(this,arguments)})}else{var n={},p={};n[j]=(k=="pos"?"-=":"+=")+g;p[j]=(k=="pos"?"+=":"-=")+g;c.animate(n,i/2,b.options.easing).animate(p,i/2,b.options.easing,function(){a.effects.restore(c,d);a.effects.removeWrapper(c);if(b.callback)b.callback.apply(this,arguments)})}c.queue("fx",function(){c.dequeue()});c.dequeue()})}})(jQuery);(function(a,b){a.effects.clip=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","height","width"];var e=a.effects.setMode(c,b.options.mode||"hide");var f=b.options.direction||"vertical";a.effects.save(c,d);c.show();var g=a.effects.createWrapper(c).css({overflow:"hidden"});var h=c[0].tagName=="IMG"?g:c;var i={size:f=="vertical"?"height":"width",position:f=="vertical"?"top":"left"};var j=f=="vertical"?h.height():h.width();if(e=="show"){h.css(i.size,0);h.css(i.position,j/2)}var k={};k[i.size]=e=="show"?j:0;k[i.position]=e=="show"?0:j/2;h.animate(k,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(e=="hide")c.hide();a.effects.restore(c,d);a.effects.removeWrapper(c);if(b.callback)b.callback.apply(c[0],arguments);c.dequeue()}})})}})(jQuery);(function(a,b){a.effects.drop=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","opacity"];var e=a.effects.setMode(c,b.options.mode||"hide");var f=b.options.direction||"left";a.effects.save(c,d);c.show();a.effects.createWrapper(c);var g=f=="up"||f=="down"?"top":"left";var h=f=="up"||f=="left"?"pos":"neg";var i=b.options.distance||(g=="top"?c.outerHeight({margin:true})/2:c.outerWidth({margin:true})/2);if(e=="show")c.css("opacity",0).css(g,h=="pos"?-i:i);var j={opacity:e=="show"?1:0};j[g]=(e=="show"?h=="pos"?"+=":"-=":h=="pos"?"-=":"+=")+i;c.animate(j,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(e=="hide")c.hide();a.effects.restore(c,d);a.effects.removeWrapper(c);if(b.callback)b.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);(function(a,b){a.effects.explode=function(b){return this.queue(function(){var c=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3;var d=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3;b.options.mode=b.options.mode=="toggle"?a(this).is(":visible")?"hide":"show":b.options.mode;var e=a(this).show().css("visibility","hidden");var f=e.offset();f.top-=parseInt(e.css("marginTop"),10)||0;f.left-=parseInt(e.css("marginLeft"),10)||0;var g=e.outerWidth(true);var h=e.outerHeight(true);for(var i=0;i<c;i++){for(var j=0;j<d;j++){e.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-j*(g/d),top:-i*(h/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/d,height:h/c,left:f.left+j*(g/d)+(b.options.mode=="show"?(j-Math.floor(d/2))*(g/d):0),top:f.top+i*(h/c)+(b.options.mode=="show"?(i-Math.floor(c/2))*(h/c):0),opacity:b.options.mode=="show"?0:1}).animate({left:f.left+j*(g/d)+(b.options.mode=="show"?0:(j-Math.floor(d/2))*(g/d)),top:f.top+i*(h/c)+(b.options.mode=="show"?0:(i-Math.floor(c/2))*(h/c)),opacity:b.options.mode=="show"?1:0},b.duration||500)}}setTimeout(function(){b.options.mode=="show"?e.css({visibility:"visible"}):e.css({visibility:"visible"}).hide();if(b.callback)b.callback.apply(e[0]);e.dequeue();a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);(function(a,b){a.effects.fade=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){b.callback&&b.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);(function(a,b){a.effects.fold=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"];var e=a.effects.setMode(c,b.options.mode||"hide");var f=b.options.size||15;var g=!!b.options.horizFirst;var h=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(c,d);c.show();var i=a.effects.createWrapper(c).css({overflow:"hidden"});var j=e=="show"!=g;var k=j?["width","height"]:["height","width"];var l=j?[i.width(),i.height()]:[i.height(),i.width()];var m=/([0-9]+)%/.exec(f);if(m)f=parseInt(m[1],10)/100*l[e=="hide"?0:1];if(e=="show")i.css(g?{height:0,width:f}:{height:f,width:0});var n={},p={};n[k[0]]=e=="show"?l[0]:f;p[k[1]]=e=="show"?l[1]:0;i.animate(n,h,b.options.easing).animate(p,h,b.options.easing,function(){if(e=="hide")c.hide();a.effects.restore(c,d);a.effects.removeWrapper(c);if(b.callback)b.callback.apply(c[0],arguments);c.dequeue()})})}})(jQuery);(function(a,b){a.effects.highlight=function(b){return this.queue(function(){var c=a(this),d=["backgroundImage","backgroundColor","opacity"],e=a.effects.setMode(c,b.options.mode||"show"),f={backgroundColor:c.css("backgroundColor")};if(e=="hide"){f.opacity=0}a.effects.save(c,d);c.show().css({backgroundImage:"none",backgroundColor:b.options.color||"#ffff99"}).animate(f,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide();a.effects.restore(c,d);e=="show"&&!a.support.opacity&&this.style.removeAttribute("filter");b.callback&&b.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);(function(a,b){a.effects.pulsate=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"show");times=(b.options.times||5)*2-1;duration=b.duration?b.duration/2:a.fx.speeds._default/2,isVisible=c.is(":visible"),animateTo=0;if(!isVisible){c.css("opacity",0).show();animateTo=1}if(d=="hide"&&isVisible||d=="show"&&!isVisible){times--}for(var e=0;e<times;e++){c.animate({opacity:animateTo},duration,b.options.easing);animateTo=(animateTo+1)%2}c.animate({opacity:animateTo},duration,b.options.easing,function(){if(animateTo==0){c.hide()}b.callback&&b.callback.apply(this,arguments)});c.queue("fx",function(){c.dequeue()}).dequeue()})}})(jQuery);(function(a,b){a.effects.puff=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide"),e=parseInt(b.options.percent,10)||150,f=e/100,g={height:c.height(),width:c.width()};a.extend(b.options,{fade:true,mode:d,percent:d=="hide"?e:100,from:d=="hide"?g:{height:g.height*f,width:g.width*f}});c.effect("scale",b.options,b.duration,b.callback);c.dequeue()})};a.effects.scale=function(b){return this.queue(function(){var c=a(this);var d=a.extend(true,{},b.options);var e=a.effects.setMode(c,b.options.mode||"effect");var f=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:e=="hide"?0:100);var g=b.options.direction||"both";var h=b.options.origin;if(e!="effect"){d.origin=h||["middle","center"];d.restore=true}var i={height:c.height(),width:c.width()};c.from=b.options.from||(e=="show"?{height:0,width:0}:i);var j={y:g!="horizontal"?f/100:1,x:g!="vertical"?f/100:1};c.to={height:i.height*j.y,width:i.width*j.x};if(b.options.fade){if(e=="show"){c.from.opacity=0;c.to.opacity=1}if(e=="hide"){c.from.opacity=1;c.to.opacity=0}}d.from=c.from;d.to=c.to;d.mode=e;c.effect("size",d,b.duration,b.callback);c.dequeue()})};a.effects.size=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","width","height","overflow","opacity"];var e=["position","top","bottom","left","right","overflow","opacity"];var f=["width","height","overflow"];var g=["fontSize"];var h=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"];var i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"];var j=a.effects.setMode(c,b.options.mode||"effect");var k=b.options.restore||false;var l=b.options.scale||"both";var m=b.options.origin;var n={height:c.height(),width:c.width()};c.from=b.options.from||n;c.to=b.options.to||n;if(m){var p=a.effects.getBaseline(m,n);c.from.top=(n.height-c.from.height)*p.y;c.from.left=(n.width-c.from.width)*p.x;c.to.top=(n.height-c.to.height)*p.y;c.to.left=(n.width-c.to.width)*p.x}var q={from:{y:c.from.height/n.height,x:c.from.width/n.width},to:{y:c.to.height/n.height,x:c.to.width/n.width}};if(l=="box"||l=="both"){if(q.from.y!=q.to.y){d=d.concat(h);c.from=a.effects.setTransition(c,h,q.from.y,c.from);c.to=a.effects.setTransition(c,h,q.to.y,c.to)}if(q.from.x!=q.to.x){d=d.concat(i);c.from=a.effects.setTransition(c,i,q.from.x,c.from);c.to=a.effects.setTransition(c,i,q.to.x,c.to)}}if(l=="content"||l=="both"){if(q.from.y!=q.to.y){d=d.concat(g);c.from=a.effects.setTransition(c,g,q.from.y,c.from);c.to=a.effects.setTransition(c,g,q.to.y,c.to)}}a.effects.save(c,k?d:e);c.show();a.effects.createWrapper(c);c.css("overflow","hidden").css(c.from);if(l=="content"||l=="both"){h=h.concat(["marginTop","marginBottom"]).concat(g);i=i.concat(["marginLeft","marginRight"]);f=d.concat(h).concat(i);c.find("*[width]").each(function(){child=a(this);if(k)a.effects.save(child,f);var c={height:child.height(),width:child.width()};child.from={height:c.height*q.from.y,width:c.width*q.from.x};child.to={height:c.height*q.to.y,width:c.width*q.to.x};if(q.from.y!=q.to.y){child.from=a.effects.setTransition(child,h,q.from.y,child.from);child.to=a.effects.setTransition(child,h,q.to.y,child.to)}if(q.from.x!=q.to.x){child.from=a.effects.setTransition(child,i,q.from.x,child.from);child.to=a.effects.setTransition(child,i,q.to.x,child.to)}child.css(child.from);child.animate(child.to,b.duration,b.options.easing,function(){if(k)a.effects.restore(child,f)})})}c.animate(c.to,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(c.to.opacity===0){c.css("opacity",c.from.opacity)}if(j=="hide")c.hide();a.effects.restore(c,k?d:e);a.effects.removeWrapper(c);if(b.callback)b.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);(function(a,b){a.effects.shake=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"];var e=a.effects.setMode(c,b.options.mode||"effect");var f=b.options.direction||"left";var g=b.options.distance||20;var h=b.options.times||3;var i=b.duration||b.options.duration||140;a.effects.save(c,d);c.show();a.effects.createWrapper(c);var j=f=="up"||f=="down"?"top":"left";var k=f=="up"||f=="left"?"pos":"neg";var l={},m={},n={};l[j]=(k=="pos"?"-=":"+=")+g;m[j]=(k=="pos"?"+=":"-=")+g*2;n[j]=(k=="pos"?"-=":"+=")+g*2;c.animate(l,i,b.options.easing);for(var p=1;p<h;p++){c.animate(m,i,b.options.easing).animate(n,i,b.options.easing)}c.animate(m,i,b.options.easing).animate(l,i/2,b.options.easing,function(){a.effects.restore(c,d);a.effects.removeWrapper(c);if(b.callback)b.callback.apply(this,arguments)});c.queue("fx",function(){c.dequeue()});c.dequeue()})}})(jQuery);(function(a,b){a.effects.slide=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"];var e=a.effects.setMode(c,b.options.mode||"show");var f=b.options.direction||"left";a.effects.save(c,d);c.show();a.effects.createWrapper(c).css({overflow:"hidden"});var g=f=="up"||f=="down"?"top":"left";var h=f=="up"||f=="left"?"pos":"neg";var i=b.options.distance||(g=="top"?c.outerHeight({margin:true}):c.outerWidth({margin:true}));if(e=="show")c.css(g,h=="pos"?isNaN(i)?"-"+i:-i:i);var j={};j[g]=(e=="show"?h=="pos"?"+=":"-=":h=="pos"?"-=":"+=")+i;c.animate(j,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(e=="hide")c.hide();a.effects.restore(c,d);a.effects.removeWrapper(c);if(b.callback)b.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);(function(a,b){a.effects.transfer=function(b){return this.queue(function(){var c=a(this),d=a(b.options.to),e=d.offset(),f={top:e.top,left:e.left,height:d.innerHeight(),width:d.innerWidth()},g=c.offset(),h=a('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(b.options.className).css({top:g.top,left:g.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(f,b.duration,b.options.easing,function(){h.remove();b.callback&&b.callback.apply(c[0],arguments);c.dequeue()})})}})(jQuery);

// ***************************
// js.compressed/jquery/jquery.cookie.min.js
// ***************************
/*jshint eqnull:true */
/*!
 * jQuery Cookie Plugin v1.2
 * https://github.com/carhartl/jquery-cookie
 *
 * Copyright 2011, Klaus Hartl
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.opensource.org/licenses/GPL-2.0
 */
(function(a,b,c){function e(a){return a}function f(a){return decodeURIComponent(a.replace(d," "))}var d=/\+/g;var g=a.cookie=function(d,h,i){if(h!==c){i=a.extend({},g.defaults,i);if(h===null){i.expires=-1}if(typeof i.expires==="number"){var j=i.expires,k=i.expires=new Date;k.setDate(k.getDate()+j)}h=g.json?JSON.stringify(h):String(h);return b.cookie=[encodeURIComponent(d),"=",g.raw?h:encodeURIComponent(h),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}var l=g.raw?e:f;var m=b.cookie.split("; ");for(var n=0,o;o=m[n]&&m[n].split("=");n++){if(l(o.shift())===d){var p=l(o.join("="));return g.json?JSON.parse(p):p}}return null};g.defaults={};a.removeCookie=function(b,c){if(a.cookie(b)!==null){a.cookie(b,null,c);return true}return false}})(jQuery,document);

// ***************************
// js.compressed/responsive.js
// ***************************
var Responsive={bodyWidth:0,scrollToFixedBreakPoint:480};var $Rx=Responsive;$(function(){$(".blogAdminActive").click(function(A){$(this).parent().toggleClass("expanded")});Modernizr.addTest("firefox",function(){return !!navigator.userAgent.match(/firefox/i)});Modernizr.addTest("opera",function(){return !!navigator.userAgent.match(/opera/i)})});Responsive.DocReady={load:function(){$("#searchForm").addClass("desktopSearch");$Rx.ChannelTabBar.initMainMenu();$Rx.MediaQueries.setResizeEvent();$Rx.MediaQueries.handleResizeEvent();$Rx.ListToSelect.registerChangeEvents();$Rx.Footer.registerChangeEvents();$Rx.Profile.clonePrivateMessageButton();$Rx.ChannelContent.cloneNewTopicButton();$Rx.SocialGroups.cloneButtons();$Rx.Profile.cloneButtons();$Rx.SearchResultsToolbar.createMobileView();$Rx.Debug.wrap();$Rx.ConversationContent.checkForSignature();$Rx.Touch.override();setTimeout($Rx.ListToSelect.registerSyncMenuEvents,100)}};$(document).ready(function(){$Rx.DocReady.load()});Responsive.Touch={override:function(){var B="touch";if($("html").hasClass(B)){var F="no-touch";var E=navigator.userAgent.toLowerCase();var A="Firefox".toLowerCase();var D=E.indexOf(A);var G="Windows NT 6.1".toLowerCase();var C=E.indexOf(G);if(D!==-1&&C!==-1){$("html").removeClass(B).addClass(F)}}}};Responsive.Modal={init:function(){if($(".sgIconUploader").length){var B=["ui-dialog","ui-widget","ui-widget-content","ui-corner-all","ui-draggable","ui-resizable"];var A="body div."+B.join(".");if(!$(A).hasClass("rx-modal")){$(A).addClass("rx-modal")}}setTimeout(this.setRadioState,100)},setRadioState:function(){$("input:radio[name=sgIconToggle]:visible:first").click()}};Responsive.Debug={wrap:function(){var B="debug-information";var A="debug-information-wrapper";if($("#"+B).length&&!$("#"+A).length){$("#"+B).wrap('<div id="'+A+'" />')}}};Responsive.ListToSelect={handleSelectChangeHome:function(){var C=$("div.activity-stream-widget > .widget-header > .module-title.h-left > select").get(0);var B=C.selectedIndex;var A="div.activity-stream-widget > .widget-header > .module-title.h-left > ul [href="+C.options[B].value+"]";$Rx.ListToSelect.selectTab(A)},handleSelectChangeProfileSubscriptions:function(){var C=$(".subscriptionsContainer > .subscribeTabs > div.widget-tabs-nav > select").get(0);var B=C.selectedIndex;var A=".subscriptionsContainer > .subscribeTabs > ul.widget-tabs-nav [href="+C.options[B].value+"]";$Rx.ListToSelect.selectTab(A)},handleSelectChangeForum:function(){var C=$("div.channel-content-widget > .widget-content > .channel-conversation-list-wrapper > .widget-tabs-nav > select").get(0);var B=C.selectedIndex;var A="div.channel-content-widget > .widget-content > .channel-conversation-list-wrapper > .widget-tabs-nav > ul.ui-tabs-nav [href="+C.options[B].value+"]";$Rx.ListToSelect.selectTab(A)},handleSelectChangeForumElse:function(){var C=$("div.channel-content-widget > .widget-header > .module-title.h-left > select").get(0);var B=C.selectedIndex;var A="div.channel-content-widget > .widget-header > .module-title.h-left > ul [href="+C.options[B].value+"]";$Rx.ListToSelect.selectTab(A)},handleSelectChangeBlog:function(){var C=$("div.blog-channel-content-widget > .widget-content > .channel-conversation-list-wrapper > select").get(0);var B=C.selectedIndex;var A="div.blog-channel-content-widget > .widget-content > .channel-conversation-list-wrapper > .widget-tabs-nav > ul.ui-tabs-nav [href="+C.options[B].value+"]";$Rx.ListToSelect.selectTab(A)},handleSelectChangeBlogElse:function(){var C=$("div.blog-channel-content-widget > .widget-header > .module-title.h-left > select").get(0);var B=C.selectedIndex;var A="div.blog-channel-content-widget > .widget-header > .module-title.h-left > ul [href="+C.options[B].value+"]";$Rx.ListToSelect.selectTab(A)},handleSelectChangeBlogNewEntry:function(){var C=$("div.blog-channel-content-widget > .channel-conversation-list-wrapper > .widget-tabs-nav > select").get(0);var B=C.selectedIndex;var A="div.blog-channel-content-widget > .channel-conversation-list-wrapper > .widget-tabs-nav > ul [href="+C.options[B].value+"]";$Rx.ListToSelect.selectTab(A)},handleSelectChangeProfile:function(){var C=$("div.profile-widget > .widget-content > .profile-container > .widget-tabs > .widget-tabs-nav > select").get(0);var B=C.selectedIndex;var A="div.profile-widget > .widget-content > .profile-container > .widget-tabs > ul [href="+C.options[B].value+"]";$Rx.ListToSelect.selectTab(A)},selectTab:function(A){$(A).click()},registerChangeEvents:function(){this.registerSelectChangeHome();this.registerSelectChangeForum();this.registerSelectChangeForumElse();this.registerSelectChangeBlog();this.registerSelectChangeBlogElse();this.registerSelectChangeBlogNewEntry();this.registerSelectChangeProfile();this.registerSelectChangeProfileSubscriptions()},registerSelectChangeHome:function(){$("div.activity-stream-widget > .widget-header > .module-title.h-left > select").on("change",this.handleSelectChangeHome)},registerSelectChangeForum:function(){$("div.channel-content-widget > .widget-content > .channel-conversation-list-wrapper > .widget-tabs-nav > select").on("change",this.handleSelectChangeForum)},registerSelectChangeForumElse:function(){$("div.channel-content-widget > .widget-header > .module-title.h-left > select").on("change",this.handleSelectChangeForumElse)},registerSelectChangeBlog:function(){$("div.blog-channel-content-widget > .widget-content > .channel-conversation-list-wrapper > select").on("change",this.handleSelectChangeBlog)},registerSelectChangeBlogElse:function(){$("div.blog-channel-content-widget > .widget-header > .module-title.h-left > select").on("change",this.handleSelectChangeBlogElse)},registerSelectChangeBlogNewEntry:function(){$("div.blog-channel-content-widget > .channel-conversation-list-wrapper > .widget-tabs-nav > select").on("change",this.handleSelectChangeBlogNewEntry)},registerSelectChangeProfile:function(){$("div.profile-widget> .widget-content > .profile-container > .widget-tabs > .widget-tabs-nav > select").on("change",this.handleSelectChangeProfile)},registerSelectChangeProfileSubscriptions:function(){$(".subscriptionsContainer > .subscribeTabs > div.widget-tabs-nav > select").on("change",this.handleSelectChangeProfileSubscriptions)},tabSelected:function(B){if(B.length){var A=B.closest(".ui-tabs-nav").parent().find("select");A.find('option[value="'+B[0].hash+'"]').prop("selected",true)}},registerSyncMenuEvents:function(){$(".ui-tabs").on("tabsshow",function(A,B){$Rx.ListToSelect.tabSelected($(B.tab))});$(".ui-tabs .ui-tabs-nav li.ui-tabs-selected a").each(function(){$Rx.ListToSelect.tabSelected($(this))})}};Responsive.Facade={addFacadeControlToToolbar:function(I,F,D,J){var C=$(I);var A=$(F);var B=$(D);if(C.length&&!A.length&&B.length){var G=B[0];var H=$(G).clone();if(J){for(var E=0;E<J;E++){this.addClickEvent(H,existingButtonSet,J[E])}}else{this.addClickEvent(H,G)}C.append(H)}},addClickEvent:function(C,B,A){if(A){C.find(A).on("click",function(){B.find(A).click()})}else{C.on("click",function(){B.click()})}},addNewConversationToolbarToDOM:function(A,C){var D=A+" .conversation-toolbar-wrapper .conversation-toolbar."+C;if(!$($(D)).length){var B='<div class="conversation-toolbar '+C+'"><ul class="toolset-left"><li></li></ul></div>';$(A+" .conversation-toolbar-wrapper").prepend(B)}}};Responsive.Profile={styleSidebarContent:function(){$(".profile-info-item").removeClass()},clonePrivateMessageButton:function(){var C=".conversation-toolbar > ul > li > a.pm_button";var B=".profile_sidebar_content > .profileContainer";var A=".profile_sidebar_content > .profileContainer > div.pm-button-container > a.pm-button";if($(C).length){if($(B).length){if(!$(A).length){var E=$(C).clone();var D=$("<div class='pm-button-container'></div>").append(E);$(B).append(D)}}}},cloneButtons:function(){this.cloneTabButtons("subscription");this.cloneTabButtons("subscriber")},cloneTabButtons:function(D){var F="#"+D+"sTab";var E=D+"s-totalcount";var A=$(F+" .conversation-toolbar .toolset-left .back-button");var C=$(F+" .conversation-toolbar");var B=$(F+" .conversation-toolbar.rx-facade-back-to-profile");if(A.length&&!B.length){C.addClass("rx-desktop");$Rx.Facade.addNewConversationToolbarToDOM(F,"rx-facade-"+D+"-count");$Rx.Facade.addFacadeControlToToolbar(F+" .conversation-toolbar.rx-facade-"+D+"-count ul.toolset-left li",F+" .conversation-toolbar.rx-facade-"+D+"-count ul.toolset-left li ."+E,F+" .conversation-toolbar .toolset-left ."+E);$Rx.Facade.addNewConversationToolbarToDOM(F,"rx-facade-back-to-profile");$Rx.Facade.addFacadeControlToToolbar(F+" .conversation-toolbar.rx-facade-back-to-profile ul.toolset-left li",F+" .conversation-toolbar.rx-facade-back-to-profile ul.toolset-left li .back-button",F+" .conversation-toolbar .toolset-left .back-button");$Rx.Facade.addFacadeControlToToolbar(F+" .conversation-toolbar.rx-facade-"+D+"-count ul.toolset-left li",F+" .conversation-toolbar.rx-facade-back-to-profile ul.toolset-left li .rx-ignore",F+" .conversation-toolbar .toolset-left .rx-ignore")}}};Responsive.ChannelContent={cloneNewTopicButton:function(){var C="#activity-stream-tab .conversation-toolbar .toolset-left button.new-conversation-btn";var B=".channel-content-widget .channel-controls";var A=".channel-content-widget .channel-controls > button.new-conversation-btn";if($(C).length==0){C="#article-tab .conversation-toolbar .toolset-left button.new-conversation-btn"}if($(C).length){if($(B).length){if(!$(A).length){var D=$(C).clone();D.attr("id","rx-facade-new-conversation-btn");D.on("click",function(){$(C).click()});$(B).append(D)}}}}};Responsive.SocialGroups={cloneButtons:function(){if($(".groups-tab .conversation-toolbar .toolset-left div.button-set").length){$Rx.Facade.addNewConversationToolbarToDOM(".groups-tab","rx-facade-show-groups");$Rx.Facade.addFacadeControlToToolbar(".groups-tab .conversation-toolbar.rx-facade-show-groups ul.toolset-left li",".groups-tab .conversation-toolbar.rx-facade-show-groups ul.toolset-left li div.button-set",".groups-tab .conversation-toolbar .toolset-left div.button-set",["button.showAll","button.showMy"]);$Rx.Facade.addNewConversationToolbarToDOM(".groups-tab","rx-facade-create-groups");$Rx.Facade.addFacadeControlToToolbar(".groups-tab .conversation-toolbar.rx-facade-create-groups ul.toolset-left li",".groups-tab .conversation-toolbar.rx-facade-create-groups ul.toolset-left li button.add-sg",".groups-tab .conversation-toolbar .toolset-left button.add-sg")}}};Responsive.SearchResultsToolbar={selector:".search-results-widget .conversation-toolbar",createMobileView:function(){var A=$Rx.SearchResultsToolbar.selector;var C=A+".desktop";var B=$(A);B.addClass("desktop");if($(C).find(".toolbar-pagenav").length){$("<div>").addClass("conversation-toolbar mobile-search-results").insertAfter(B);this.copyElementsToMobileSearchResultsToolbar()}},copyElementsToMobileSearchResultsToolbar:function(){var B=$Rx.SearchResultsToolbar.selector;var E=B+".desktop";var F=B+".mobile-search-results";var D=$(E);var C=$(F);var A=D.find(".toolset-right").clone(true,true);C.append(A)}};Responsive.Search={cloneTagsLink:function(){if(!$("#rx-tags-column").length){var C=$(".form-row-tags");var A=$(".form-row-tags > .field_column");var D=$(".tag-editor-wrapper > span.add-tag-link");var B=D.clone();B.on("click",function(){$(".tag-editor-wrapper > span.add-tag-link").click()});A.css("display","block");D.css("display","none");C.append("<div id='rx-tags-column' class='field_column'></div>");B.appendTo($("#rx-tags-column"))}}};Responsive.Footer={menuItemCount:0,menuItemCountLimit:5,handleSelectChange:function(){var C=$("li.rx-list-to-select > select").get(0);var B=C.selectedIndex;var A=C.options[B].value;if(A!==""){window.location=A}},registerChangeEvents:function(){this.setMenuItemCount();this.setMenuClasses();this.registerSelectChange()},setMenuClasses:function(){if($Rx.Footer.menuItemCount>$Rx.Footer.menuItemCountLimit){$("#footer-tabbar > ul.h-right").addClass("rx-menu-limit-exceeded");$("#footer-tabbar > ul.h-left > li.rx-list-to-select").addClass("rx-menu-limit-exceeded")}else{$("#footer-tabbar > ul.h-right").addClass("rx-menu-limit-ok");$("#footer-tabbar > ul.h-left > li.rx-list-to-select").addClass("rx-menu-limit-ok")}},setMenuItemCount:function(){$Rx.Footer.menuItemCount=$("#footer-tabbar > ul.h-right > li").length},registerSelectChange:function(){$("li.rx-list-to-select > select").on("change",this.handleSelectChange)}};Responsive.MediaQueries={init:function(){$Rx.bodyWidth=$("#vb-page-body").width()},setResizeEvent:function(){var A=this.handleResizeEvent;$(window).resize(function(){A()})},handleResizeEvent:function(){if($("#vb-page-body").width()!=$Rx.bodyWidth){$Rx.bodyWidth=$("#vb-page-body").width();if(Modernizr.mq("only screen and (max-width: 479px)")){window.vBulletin.scrollToFixed();$(".private-message-widget-layout .section-0").insertAfter(".private-message-widget-layout .section-1")}if(Modernizr.mq("only screen and (min-width: 480px)")){$(".private-message-widget-layout .section-1").insertAfter(".private-message-widget-layout .section-0")}if(Modernizr.mq("only screen and (max-width: 599px)")){$("#pmFloatingBarContent .toolset.h-left").detach().prependTo("#privateMessageContainer").addClass("h-clearfix")}if(Modernizr.mq("only screen and (min-width: 600px)")){$("#privateMessageContainer .toolset.h-left").detach().prependTo("#pmFloatingBarContent").removeClass("h-clearfix")}if(Modernizr.mq("only screen and (max-width: 990px)")){var A=$Rx.ConversationToolbar.selector;if($(A).length&&$(A+".mobile-search").length===0){$Rx.ConversationToolbar.createMobileView()}}if(Modernizr.mq("only screen and (max-width: 767px)")){if(!$Rx.ChannelTabBar.isMobileMenu){$Rx.ChannelTabBar.showMobileSearchForm()}$Rx.ChannelTabBar.create();$("#mobile-main-menu").css("display","block");$Rx.Search.cloneTagsLink();$Rx.Profile.styleSidebarContent()}if(Modernizr.mq("only screen and (min-width: 768px)")){if($Rx.ChannelTabBar.isMobileMenu){$Rx.ChannelTabBar.showDesktopSearchForm()}$("#mobile-main-menu").css("display","none")}if(Modernizr.mq("only screen and (max-width: 479px)")){$Rx.Debug.wrap()}}}};Responsive.ChannelTabBar={sectionItemsSelector:"#channel-tabbar ul li.section-item",initMainMenu:function(){$("#mobile-main-menu").each(function(){$(this).find(".main-menu-control-sections").on("click",function(){$Rx.ChannelTabBar.toggle("sections")});$(this).find(".mobile-search span").on("click",function(){$Rx.ChannelTabBar.toggle("search")})})},isMobileMenu:false,getMobileSearchForm:function(){var B=$("form.desktopSearch").attr("action");var A='<form method="get" class="h-right mobile mobileSearch" action="'+B+'" id="searchForm"><fieldset><div class="search-inputs"><input type="text" autocomplete="off" class="textbox search-term" placeholder="Search..." id="q" name="q"></div></fieldset></form>';return A},showMobileSearchForm:function(){var C=$("form.mobileSearch");var B=$("form.desktopSearch");var A=$("form.mobileSearch input.search-term");var D=$("form.desktopSearch input.search-term");if(C.length){C.attr("id","searchForm");A.attr("id","q")}if(B.length){B.attr("id","searchFormDesktop");D.attr("id","qDesktop")}this.showCollapsed();$Rx.ChannelTabBar.isMobileMenu=true},showDesktopSearchForm:function(){var C=$("form.mobileSearch");var B=$("form.desktopSearch");var A=$("form.mobileSearch input.search-term");var D=$("form.desktopSearch input.search-term");if(C.length){C.attr("id","searchFormMobile");A.attr("id","qMobile")}if(B.length){B.attr("id","searchForm");D.attr("id","q")}this.showExpanded();$Rx.ChannelTabBar.isMobileMenu=false},create:function(){if(!$("form.mobileSearch").length){var A=this.getMobileSearchForm();$("#mobile-main-menu-search").append(A);this.showMobileSearchForm();$($Rx.ChannelTabBar.sectionItemsSelector).each(function(){var B=$(this).find("a").attr("href");$(this).click(function(){window.location=B})})}},toggle:function(F){if(F==="search"){var D=$("#mobile-main-menu-search");var E=$("#mobile-main-menu-sections");if(D.css("display")==="none"){E.css("display","none");D.css("display","inline-block")}else{var G=$("#mobile-main-menu-search input");var C=$(G[0]).val();if(C!==""){var A=$("#mobile-main-menu-search form");A[0].submit()}else{D.css("display","none");E.css("display","inline-block")}}}else{if(F==="sections"){var B=$($Rx.ChannelTabBar.sectionItemsSelector);if(B.length){if(B.eq(0).css("display")==="none"){this.showExpanded()}else{this.showCollapsed()}}}}},showExpanded:function(){$($Rx.ChannelTabBar.sectionItemsSelector).css("display","block");this.removeCollapsedClass()},showCollapsed:function(){$($Rx.ChannelTabBar.sectionItemsSelector).css("display","none");this.addCollapsedClass()},removeCollapsedClass:function(){$("#mobile-main-menu-sections div.main-menu-control-sections").removeClass("collapsed");$("#mobile-main-menu-sections div.main-menu-control-sections .sections-menu-icon span.icon").removeClass("collapsed");$("#mobile-main-menu-sections div.main-menu-control-sections .sections-icon .icon").removeClass("collapsed");$("#mobile-main-menu-sections div.main-menu-control-sections .sections-title").removeClass("collapsed")},addCollapsedClass:function(){$("#mobile-main-menu-sections div.main-menu-control-sections").addClass("collapsed");$("#mobile-main-menu-sections div.main-menu-control-sections .sections-menu-icon .icon").addClass("collapsed");$("#mobile-main-menu-sections div.main-menu-control-sections .sections-icon .icon").addClass("collapsed");$("#mobile-main-menu-sections div.main-menu-control-sections .sections-title").addClass("collapsed")}};Responsive.ConversationContent={checkForSignature:function(){$(".conversation-content .videoscontainer").each(function(){if(!$(this).siblings("div.post-signature").length){$(this).addClass("no-signature")}})}};Responsive.ConversationToolbar={selector:".conversation-view > .conversation-toolbar-wrapper > .conversation-toolbar",createMobileView:function(){var A=$Rx.ConversationToolbar.selector;var B=A+".desktop";var C=$(A);C.addClass("desktop");if($(B).find("button.post-reply-btn").length){$("<div>").addClass("conversation-toolbar mobile-search").insertAfter(C);this.copyElementsToMobileSearchToolbar()}},copyElementsToMobileSearchToolbar:function(){var D=$Rx.ConversationToolbar.selector;var B=D+".desktop";var J=D+".mobile-search";var F=$(B);var A=$(J);A.css("display","none");var E=F.find("button.post-reply-btn").clone(true,true).removeAttr("id");var I=$("<ul>").addClass("toolset-left");var H=$("<li>");H.append(E);I.append(H);A.append(I);var C=$("<ul>").addClass("toolset-right");var G=F.find("li.toolbar-search").clone(true,true);G.find("button").removeAttr("id");C.append(G);A.append(C)}};
/*
 * jQuery throttle / debounce - v1.1 - 3/7/2010
 * http://benalman.com/projects/jquery-throttle-debounce-plugin/
 *
 * Copyright (c) 2010 "Cowboy" Ben Alman
 * Dual licensed under the MIT and GPL licenses.
 * http://benalman.com/about/license/
 */
(function(B,C){var $=B.jQuery||B.Cowboy||(B.Cowboy={}),A;$.throttle=A=function(E,F,J,I){var H,D=0;if(typeof F!=="boolean"){I=J;J=F;F=C}function G(){var O=this,M=+new Date()-D,N=arguments;function L(){D=+new Date();J.apply(O,N)}function K(){H=C}if(I&&!H){L()}H&&clearTimeout(H);if(I===C&&M>E){L()}else{if(F!==true){H=setTimeout(I?K:L,I===C?E-M:E)}}}if($.guid){G.guid=J.guid=J.guid||$.guid++}return G};$.debounce=function(D,E,F){return F===C?A(D,E,false):A(D,F,E!==false)}})(this);var prevDate=0;var testResizeFrequency=function(){var A=new Date();var B=A.getTime();if(prevDate>0){console.log(B-prevDate)}prevDate=B};var checkBrowserSize=function(){if($(window).width()<768){$("body").addClass("l-small")}else{$("body").removeClass("l-small")}checkColumnWidth()};var checkColumnWidth=function(){var A=$(".l-row");if(A.length<1){return }A.reverse().each(function(){var D=$(this);if(D.width()>=768){return true}var B=D.find("> .l-col__flex-1, > .l-col__flex-2, > .l-col__flex-3, > .l-col__flex-4, > .l-col__flex-5, > .l-col__flex-6"),C=false;D.removeClass("l-small");B.reverse().each(function(){if(this.offsetWidth<this.scrollWidth){C=true;return false}});if(C){D.addClass("l-small")}})};$(document).ready(function(){$(window).on("resize",$.debounce(300,checkBrowserSize));checkBrowserSize()});;

// ***************************
// js.compressed/vbcache.js
// ***************************
window.vBulletin=window.vBulletin||{};window.vBulletin.cache=function(){var H="vbcache-";var M="-timestamp";var B;var I;var D="global";var E;var N={global:{bucketProvider:function(){},latestChange:0,preCache:[]}};function G(){var P="__vbcachetest__";var Q=P;if(B!==undefined){return B}try{F(P,Q);K(P);B=true}catch(O){B=false}return B}function A(){if(I===undefined){I=(window.JSON!=null)}return I}function C(){if(!G()){return }var S=N[D];var O=[];for(var T in E){storedVal=E[T];if(storedVal&&T.indexOf(D)===0&&T.indexOf(M)<0){var V=T.substr(D.length);var Q=J(V);var U=L(Q);U=parseInt(U);if(U<N[D].latestChange){K(V);N[D].preCache.push(V)}else{O.push(V)}}}for(var P=N[D].preCache.length-1;P>=0;--P){for(var R=0;R<O.length;R++){if(N[D].preCache[P]==O[R]){N[D].preCache.splice(P,1);break}}}}function J(O){return O+M}function L(O){return E[D+O]}function F(P,Q){if(JSON.stringify(E)=="{}"){var O=localStorage.getItem(H);E=O?JSON.parse(O):{}}E[D+P]=Q;localStorage.removeItem(H);localStorage.setItem(H,JSON.stringify(E))}function K(O){if(!A()){return null}delete E[D+O];localStorage.setItem(H,JSON.stringify(E))}return{set:function(U,T){if(!G()){return }if(typeof T!=="string"){if(!A()){return }try{T=JSON.stringify(T)}catch(S){return }}try{F(U,T)}catch(S){if(S.name==="QUOTA_EXCEEDED_ERR"||S.name==="NS_ERROR_DOM_QUOTA_REACHED"){var V=[];var P;for(var W in E){storedVal=E[W];if(storedVal&&W.indexOf(D)===0&&W.indexOf(M)<0){var X=W.substr(D.length);var O=J(X);var R=L(O);R=parseInt(R);V.push({key:X,size:(L(X)||"").length,timestamp:R})}}V.sort(function(Z,Y){return(Y.timestamp-Z.timestamp)});var Q=(T||"").length;while(V.length&&Q>0){P=V.pop();K(P.key);K(J(P.key));Q-=P.size}try{F(U,T)}catch(S){return }}else{return }}F(J(U),window.pageData.current_server_datetime)},get:function(P){if(!G()){return null}C();var Q=N[D];var O=J(P);var T=L(O);var R=L(P);if(R==null){R=Q.bucketProvider(P,N[D].preCache)}if(!R||!A()){return R}try{return JSON.parse(R)}catch(S){return R}},remove:function(O){if(!G()){return null}K(O);K(J(O))},supported:function(){return G()},flush:function(){if(!G()){return }for(var P=localStorage.length-1;P>=0;--P){var O=localStorage.key(P);if(O.indexOf(H+D)===0){localStorage.removeItem(O)}}},initBucket:function(S,O,Q,R){N[S]={latestChange:O,bucketProvider:R,preCache:Q};D=S;var P=localStorage.getItem(H);if(P!==null){E=JSON.parse(P)}else{E={}}C()},setBucket:function(O){D=O}}}();;

// ***************************
// js.compressed/jquery/jquery.elastic-1.6.11.custom.min.js
// ***************************
/**
*	@name							Elastic
*	@descripton						Elastic is jQuery plugin that grow and shrink your textareas automatically
*	@version						1.6.11
*	@requires						jQuery 1.2.6+
*
*	@author							Jan Jarfalk
*	@author-email					jan.jarfalk@unwrongest.com
*	@author-website					http://www.unwrongest.com
*
*	@licence						MIT License - http://www.opensource.org/licenses/mit-license.php
*/
/*
*  Modified for vBulletin:
*  - Replace twin DOM node instead of adding a new one for every elastic textarea
*  - Added namespace to events bound by the plugin to the textarea to allow us to programmatically trigger events specific to this plugin
*  - Added checking for CSS box-sizing in determining the actual height and width of the textarea
*/
(function(e){jQuery.fn.extend({elastic:function(){var t=["paddingTop","paddingRight","paddingBottom","paddingLeft","fontSize","lineHeight","fontFamily","width","fontWeight","border-top-width","border-right-width","border-bottom-width","border-left-width","borderTopStyle","borderTopColor","borderRightStyle","borderRightColor","borderBottomStyle","borderBottomColor","borderLeftStyle","borderLeftColor"];return this.each(function(){function a(){var e=n().width;if(i.width()!==e){i.css({width:e+"px"});l(true)}}function f(e,t){var i=parseInt(e,10);if(n().height!==i){r.css({height:i+"px",overflow:t})}}function l(e){var t=r.val().replace(/&/g,"&").replace(/ {2}/g," ").replace(/<|>/g,">").replace(/\n/g,"<br />");var s=i.html().replace(/<br>/ig,"<br />");if(e||t+" "!==s){i.html(t+" ");if(Math.abs(i.height()+lineHeight-n().height)>3){var o=i.height()+lineHeight;if(o>=maxheight){f(maxheight,"auto")}else if(o<=minheight){f(minheight,"hidden")}else{f(o,"hidden")}}}}if(this.type!=="textarea"){return false}var n=function(){return s=="border-box"?{height:r.outerHeight(),width:r.outerWidth()}:s=="padding-box"?{height:r.innerHeight(),width:r.innerWidth()}:{height:r.height(),width:r.width()}};var r=jQuery(this),i=jQuery("<div />").css({position:"absolute",display:"none","word-wrap":"break-word","white-space":"pre-wrap"}).addClass("elastic-twin-div"),s=r.css("box-sizing")||r.css("-moz-box-sizing")||r.css("-webkit-box-sizing")||"content-box";lineHeight=parseInt(r.css("line-height"),10)||parseInt(r.css("font-size"),"10"),minheight=n().height||lineHeight*3,maxheight=parseInt(r.css("max-height"),10)||Number.MAX_VALUE,goalheight=0;if(maxheight<0){maxheight=Number.MAX_VALUE}var o=e("> .elastic-twin-div",r.parent());if(o.length==1){o.replaceWith(i)}else{i.appendTo(r.parent())}var u=t.length;while(u--){i.css(t[u].toString(),r.css(t[u].toString()))}r.css({overflow:"hidden"});r.bind("keyup.elastic change.elastic cut.elastic paste.elastic",function(){l()});e(window).bind("resize.elastic",a);r.bind("resize.elastic focus.elastic",a);r.bind("update.elastic",l);r.bind("blur.elastic",function(){if(i.height()<maxheight){if(i.height()>minheight){r.height(i.height())}else{r.height(minheight)}}});r.bind("input.elastic paste.elastic",function(e){setTimeout(l,250)});l()})}})})(jQuery);

// ***************************
// js.compressed/jquery/jquery.form.min.js
// ***************************
/*!
 * jQuery Form Plugin
 * version: 2.85 (23-SEP-2011)
 * @requires jQuery v1.3.2 or later
 *
 * Examples and documentation at: http://malsup.com/jquery/form/
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */
(function(a){function b(){if(!a.fn.ajaxSubmit.debug)return;var b="[jquery.form] "+Array.prototype.join.call(arguments,"");if(window.console&&window.console.log){window.console.log(b)}else if(window.opera&&window.opera.postError){window.opera.postError(b)}}a.fn.ajaxSubmit=function(c){function t(e){function w(a){var b=a.contentWindow?a.contentWindow.document:a.contentDocument?a.contentDocument:a.document;return b}function x(){function h(){try{var a=w(n).readyState;b("state = "+a);if(a.toLowerCase()=="uninitialized")setTimeout(h,50)}catch(c){b("Server abort: ",c," (",c.name,")");C(v);s&&clearTimeout(s);s=undefined}}var c=g.attr("target"),e=g.attr("action");f.setAttribute("target",l);if(!d){f.setAttribute("method","POST")}if(e!=j.url){f.setAttribute("action",j.url)}if(!j.skipEncodingOverride&&(!d||/post/i.test(d))){g.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"})}if(j.timeout){s=setTimeout(function(){r=true;C(u)},j.timeout)}var i=[];try{if(j.extraData){for(var k in j.extraData){i.push(a('<input type="hidden" name="'+k+'" />').attr("value",j.extraData[k]).appendTo(f)[0])}}if(!j.iframeTarget){m.appendTo("body");n.attachEvent?n.attachEvent("onload",C):n.addEventListener("load",C,false)}setTimeout(h,15);f.submit()}finally{f.setAttribute("action",e);if(c){f.setAttribute("target",c)}else{g.removeAttr("target")}a(i).remove()}}function C(c){if(o.aborted||B){return}try{z=w(n)}catch(d){b("cannot access response document: ",d);c=v}if(c===u&&o){o.abort("timeout");return}else if(c==v&&o){o.abort("server abort");return}if(!z||z.location.href==j.iframeSrc){if(!r)return}n.detachEvent?n.detachEvent("onload",C):n.removeEventListener("load",C,false);var e="success",f;try{if(r){throw"timeout"}var g=j.dataType=="xml"||z.XMLDocument||a.isXMLDoc(z);b("isXml="+g);if(!g&&window.opera&&(z.body==null||z.body.innerHTML=="")){if(--A){b("requeing onLoad callback, DOM not available");setTimeout(C,250);return}}var h=z.body?z.body:z.documentElement;o.responseText=h?h.innerHTML:null;o.responseXML=z.XMLDocument?z.XMLDocument:z;if(g)j.dataType="xml";o.getResponseHeader=function(a){var b={"content-type":j.dataType};return b[a]};if(h){o.status=Number(h.getAttribute("status"))||o.status;o.statusText=h.getAttribute("statusText")||o.statusText}var i=(j.dataType||"").toLowerCase();var l=/(json|script|text)/.test(i);if(l||j.textarea){var p=z.getElementsByTagName("textarea")[0];if(p){o.responseText=p.value;o.status=Number(p.getAttribute("status"))||o.status;o.statusText=p.getAttribute("statusText")||o.statusText}else if(l){var q=z.getElementsByTagName("pre")[0];var t=z.getElementsByTagName("body")[0];if(q){o.responseText=q.textContent?q.textContent:q.innerText}else if(t){o.responseText=t.textContent?t.textContent:t.innerText}}}else if(i=="xml"&&!o.responseXML&&o.responseText!=null){o.responseXML=D(o.responseText)}try{y=F(o,i,j)}catch(c){e="parsererror";o.error=f=c||e}}catch(c){b("error caught: ",c);e="error";o.error=f=c||e}if(o.aborted){b("upload aborted");e=null}if(o.status){e=o.status>=200&&o.status<300||o.status===304?"success":"error"}if(e==="success"){j.success&&j.success.call(j.context,y,"success",o);k&&a.event.trigger("ajaxSuccess",[o,j])}else if(e){if(f==undefined)f=o.statusText;j.error&&j.error.call(j.context,o,e,f);k&&a.event.trigger("ajaxError",[o,j,f])}k&&a.event.trigger("ajaxComplete",[o,j]);if(k&&!--a.active){a.event.trigger("ajaxStop")}j.complete&&j.complete.call(j.context,o,e);B=true;if(j.timeout)clearTimeout(s);setTimeout(function(){if(!j.iframeTarget)m.remove();o.responseXML=null},100)}var f=g[0],h,i,j,k,l,m,n,o,p,q,r,s;var t=!!a.fn.prop;if(e){if(t){for(i=0;i<e.length;i++){h=a(f[e[i].name]);h.prop("disabled",false)}}else{for(i=0;i<e.length;i++){h=a(f[e[i].name]);h.removeAttr("disabled")}}}if(a(":input[name=submit],:input[id=submit]",f).length){alert('Error: Form elements must not have name or id of "submit".');return}j=a.extend(true,{},a.ajaxSettings,c);j.context=j.context||j;l="jqFormIO"+(new Date).getTime();if(j.iframeTarget){m=a(j.iframeTarget);q=m.attr("name");if(q==null)m.attr("name",l);else l=q}else{m=a('<iframe name="'+l+'" src="'+j.iframeSrc+'" />');m.css({position:"absolute",top:"-1000px",left:"-1000px"})}n=m[0];o={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(c){var d=c==="timeout"?"timeout":"aborted";b("aborting upload... "+d);this.aborted=1;m.attr("src",j.iframeSrc);o.error=d;j.error&&j.error.call(j.context,o,d,c);k&&a.event.trigger("ajaxError",[o,j,d]);j.complete&&j.complete.call(j.context,o,d)}};k=j.global;if(k&&!(a.active++)){a.event.trigger("ajaxStart")}if(k){a.event.trigger("ajaxSend",[o,j])}if(j.beforeSend&&j.beforeSend.call(j.context,o,j)===false){if(j.global){a.active--}return}if(o.aborted){return}p=f.clk;if(p){q=p.name;if(q&&!p.disabled){j.extraData=j.extraData||{};j.extraData[q]=p.value;if(p.type=="image"){j.extraData[q+".x"]=f.clk_x;j.extraData[q+".y"]=f.clk_y}}}var u=1;var v=2;if(j.forceSync){x()}else{setTimeout(x,10)}var y,z,A=50,B;var D=a.parseXML||function(a,b){if(window.ActiveXObject){b=new ActiveXObject("Microsoft.XMLDOM");b.async="false";b.loadXML(a)}else{b=(new DOMParser).parseFromString(a,"text/xml")}return b&&b.documentElement&&b.documentElement.nodeName!="parsererror"?b:null};var E=a.parseJSON||function(a){return window["eval"]("("+a+")")};var F=function(b,c,d){var e=b.getResponseHeader("content-type")||"",f=c==="xml"||!c&&e.indexOf("xml")>=0,g=f?b.responseXML:b.responseText;if(f&&g.documentElement.nodeName==="parsererror"){a.error&&a.error("parsererror")}if(d&&d.dataFilter){g=d.dataFilter(g,c)}if(typeof g==="string"){if(c==="json"||!c&&e.indexOf("json")>=0){g=E(g)}else if(c==="script"||!c&&e.indexOf("javascript")>=0){a.globalEval(g)}}return g}}if(!this.length){b("ajaxSubmit: skipping submit process - no element selected");return this}var d,e,f,g=this;if(typeof c=="function"){c={success:c}}d=this.attr("method");e=this.attr("action");f=typeof e==="string"?a.trim(e):"";f=f||window.location.href||"";if(f){f=(f.match(/^([^#]+)/)||[])[1]}c=a.extend(true,{url:f,success:a.ajaxSettings.success,type:d||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},c);var h={};this.trigger("form-pre-serialize",[this,c,h]);if(h.veto){b("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(c.beforeSerialize&&c.beforeSerialize(this,c)===false){b("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var i,j,k=this.formToArray(c.semantic);if(c.data){c.extraData=c.data;for(i in c.data){if(a.isArray(c.data[i])){for(var l in c.data[i]){k.push({name:i,value:c.data[i][l]})}}else{j=c.data[i];j=a.isFunction(j)?j():j;k.push({name:i,value:j})}}}if(c.beforeSubmit&&c.beforeSubmit(k,this,c)===false){b("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[k,this,c,h]);if(h.veto){b("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var m=a.param(k);if(c.type.toUpperCase()=="GET"){c.url+=(c.url.indexOf("?")>=0?"&":"?")+m;c.data=null}else{c.data=m}var n=[];if(c.resetForm){n.push(function(){g.resetForm()})}if(c.clearForm){n.push(function(){g.clearForm()})}if(!c.dataType&&c.target){var o=c.success||function(){};n.push(function(b){var d=c.replaceTarget?"replaceWith":"html";a(c.target)[d](b).each(o,arguments)})}else if(c.success){n.push(c.success)}c.success=function(a,b,d){var e=c.context||c;for(var f=0,h=n.length;f<h;f++){n[f].apply(e,[a,b,d||g,g])}};var p=a("input:file",this).length>0;var q="multipart/form-data";var r=g.attr("enctype")==q||g.attr("encoding")==q;if(c.iframe!==false&&(p||c.iframe||r)){if(c.closeKeepAlive){a.get(c.closeKeepAlive,function(){t(k)})}else{t(k)}}else{if(a.browser.msie&&d=="get"&&typeof c.type==="undefined"){var s=g[0].getAttribute("method");if(typeof s==="string")c.type=s}a.ajax(c)}this.trigger("form-submit-notify",[this,c]);return this};a.fn.ajaxForm=function(c){if(this.length===0){var d={s:this.selector,c:this.context};if(!a.isReady&&d.s){b("DOM not ready, queuing ajaxForm");a(function(){a(d.s,d.c).ajaxForm(c)});return this}b("terminating; zero elements found by selector"+(a.isReady?"":" (DOM not ready)"));return this}return this.ajaxFormUnbind().bind("submit.form-plugin",function(b){if(!b.isDefaultPrevented()){b.preventDefault();a(this).ajaxSubmit(c)}}).bind("click.form-plugin",function(b){var c=b.target;var d=a(c);if(!d.is(":submit,input:image")){var e=d.closest(":submit");if(e.length==0){return}c=e[0]}var f=this;f.clk=c;if(c.type=="image"){if(b.offsetX!=undefined){f.clk_x=b.offsetX;f.clk_y=b.offsetY}else if(typeof a.fn.offset=="function"){var g=d.offset();f.clk_x=b.pageX-g.left;f.clk_y=b.pageY-g.top}else{f.clk_x=b.pageX-c.offsetLeft;f.clk_y=b.pageY-c.offsetTop}}setTimeout(function(){f.clk=f.clk_x=f.clk_y=null},100)})};a.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};a.fn.formToArray=function(b){var c=[];if(this.length===0){return c}var d=this[0];var e=b?d.getElementsByTagName("*"):d.elements;if(!e){return c}var f,g,h,i,j,k,l;for(f=0,k=e.length;f<k;f++){j=e[f];h=j.name;if(!h){continue}if(b&&d.clk&&j.type=="image"){if(!j.disabled&&d.clk==j){c.push({name:h,value:a(j).val()});c.push({name:h+".x",value:d.clk_x},{name:h+".y",value:d.clk_y})}continue}i=a.fieldValue(j,true);if(i&&i.constructor==Array){for(g=0,l=i.length;g<l;g++){c.push({name:h,value:i[g]})}}else if(i!==null&&typeof i!="undefined"){c.push({name:h,value:i})}}if(!b&&d.clk){var m=a(d.clk),n=m[0];h=n.name;if(h&&!n.disabled&&n.type=="image"){c.push({name:h,value:m.val()});c.push({name:h+".x",value:d.clk_x},{name:h+".y",value:d.clk_y})}}return c};a.fn.formSerialize=function(b){return a.param(this.formToArray(b))};a.fn.fieldSerialize=function(b){var c=[];this.each(function(){var d=this.name;if(!d){return}var e=a.fieldValue(this,b);if(e&&e.constructor==Array){for(var f=0,g=e.length;f<g;f++){c.push({name:d,value:e[f]})}}else if(e!==null&&typeof e!="undefined"){c.push({name:this.name,value:e})}});return a.param(c)};a.fn.fieldValue=function(b){for(var c=[],d=0,e=this.length;d<e;d++){var f=this[d];var g=a.fieldValue(f,b);if(g===null||typeof g=="undefined"||g.constructor==Array&&!g.length){continue}g.constructor==Array?a.merge(c,g):c.push(g)}return c};a.fieldValue=function(b,c){var d=b.name,e=b.type,f=b.tagName.toLowerCase();if(c===undefined){c=true}if(c&&(!d||b.disabled||e=="reset"||e=="button"||(e=="checkbox"||e=="radio")&&!b.checked||(e=="submit"||e=="image")&&b.form&&b.form.clk!=b||f=="select"&&b.selectedIndex==-1)){return null}if(f=="select"){var g=b.selectedIndex;if(g<0){return null}var h=[],i=b.options;var j=e=="select-one";var k=j?g+1:i.length;for(var l=j?g:0;l<k;l++){var m=i[l];if(m.selected){var n=m.value;if(!n){n=m.attributes&&m.attributes["value"]&&!m.attributes["value"].specified?m.text:m.value}if(j){return n}h.push(n)}}return h}return a(b).val()};a.fn.clearForm=function(){return this.each(function(){a("input,select,textarea",this).clearFields()})};a.fn.clearFields=a.fn.clearInputs=function(){var a=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var b=this.type,c=this.tagName.toLowerCase();if(a.test(b)||c=="textarea"){this.value=""}else if(b=="checkbox"||b=="radio"){this.checked=false}else if(c=="select"){this.selectedIndex=-1}})};a.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||typeof this.reset=="object"&&!this.reset.nodeType){this.reset()}})};a.fn.enable=function(a){if(a===undefined){a=true}return this.each(function(){this.disabled=!a})};a.fn.selected=function(b){if(b===undefined){b=true}return this.each(function(){var c=this.type;if(c=="checkbox"||c=="radio"){this.checked=b}else if(this.tagName.toLowerCase()=="option"){var d=a(this).parent("select");if(b&&d[0]&&d[0].type=="select-one"){d.find("option").selected(false)}this.selected=b}})};a.fn.ajaxSubmit.debug=false;})(jQuery);

// ***************************
// js.compressed/global.js
// ***************************
(function($){if(typeof window.console!="object"){window.console={}}var names=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];for(var i=0;i<names.length;i++){if(typeof window.console[names[i]]!="function"&&typeof window.console[names[i]]!="object"){window.console[names[i]]=function(){}}}if(!Object.keys){Object.keys=(function(){var hasOwnProperty=Object.prototype.hasOwnProperty,hasDontEnumBug=!({toString:null}).propertyIsEnumerable("toString"),dontEnums=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],dontEnumsLength=dontEnums.length;return function(obj){if(typeof obj!=="object"&&typeof obj!=="function"||obj===null){throw new TypeError("Object.keys called on non-object")}var result=[];for(var prop in obj){if(hasOwnProperty.call(obj,prop)){result.push(prop)}}if(hasDontEnumBug){for(var i=0;i<dontEnumsLength;i++){if(hasOwnProperty.call(obj,dontEnums[i])){result.push(dontEnums[i])}}}return result}})()}$.ajaxPrefilter("script",function(options){options.cache=true});$.ajaxPrefilter(function(options,originalOptions,jqXHR){if(typeof (options.data)=="undefined"){options.data="securitytoken="+pageData.securitytoken}else{if(typeof FormData!=="undefined"&&options.data instanceof FormData){options.data.append("securitytoken",pageData.securitytoken)}else{var addToken=true;var data=options.data.split("&");$.each(data,function(index,value){if(value.match(/^securitytoken=/)){addToken=false;return false}});if(addToken){options.data+="&securitytoken="+pageData.securitytoken}}}});$.ajaxPrefilter(function(options,originalOptions,jqXHR){(function(){var ajaxBaseurl=vBulletin.getAjaxBaseurl();if((originalOptions.url.indexOf(ajaxBaseurl)==0&&originalOptions.url.substr(ajaxBaseurl.length).indexOf("/ajax/render/")==0)||(originalOptions&&originalOptions.data&&originalOptions.data.isAjaxTemplateRender)){var origSuccessCallback=options.success;options.success=function(){console.log("Intercept AJAX template render calls: Start (URL: {0})".format(options.url));var response=arguments[0];if(!response||typeof response!="object"||$.isEmptyObject(response)){if(typeof origSuccessCallback=="function"){return origSuccessCallback.apply(this,arguments)}return false}if(originalOptions.data&&originalOptions.data.isAjaxTemplateRenderWithData){arguments[0]=response}else{arguments[0]=response.template}var cssLinks=response.css_links;if(!cssLinks||cssLinks.length==0){console.log("Intercept AJAX template render calls: No CSS");if(typeof origSuccessCallback=="function"){console.log("Intercept AJAX template render calls: Calling original success handler");return origSuccessCallback.apply(this,arguments)}}else{console.log("Intercept AJAX template render calls: Has CSS");var cssFromDBPattern=/sheet=([^&]+)&/,sampleLink=cssLinks.pop(),isCSSFromDB=(sampleLink.match(cssFromDBPattern)!=null);cssLinks.push(sampleLink);var getSheetsFromLink=function(link){var matches=link.match(cssFromDBPattern);var links={};if(matches&&matches[1]){$.each(matches[1].split(","),function(idx,el){links[el]=link})}else{links[link.replace(/^.*\//g,"")]=link}return links};var currSheets={};$("head link[rel=stylesheet]").each(function(){$.extend(currSheets,getSheetsFromLink($(this).attr("href")))});var newSheets={};$.each(cssLinks,function(idx,el){$.extend(newSheets,getSheetsFromLink(el))});var addSheets=[];$.each(newSheets,function(idx,el){if(idx&&typeof currSheets[idx]=="undefined"){if(isCSSFromDB){addSheets.push(idx)}else{addSheets.push(el)}}});if(addSheets.length==0){console.log("Intercept AJAX template render calls: Needed CSS is already on the page");if(typeof origSuccessCallback=="function"){console.log("Intercept AJAX template render calls: Calling original success handler");return origSuccessCallback.apply(this,arguments)}}else{var newLinks=[];if(isCSSFromDB){console.log("Intercept AJAX template render calls: found DB CSS");newLinks.push(sampleLink.replace(/sheet=[^&]+&/,"sheet="+addSheets.join(",")+"&"))}else{console.log("Intercept AJAX template render calls: found FS CSS");newLinks=addSheets}var thisCopy=this,argumentsCopy=arguments;console.log("Intercept AJAX template render calls: Fetching CSS: {0}".format(newLinks.join(", ")));var loadCSS=function(links){if(links.length==0){console.log("Intercept AJAX template render calls: Done. Calling original callback.");window.setTimeout(function(){if(typeof origSuccessCallback=="function"){return origSuccessCallback.apply(thisCopy,argumentsCopy)}},50);return }var newLinkUn=$("<div />").append(links.shift()).text();console.log("Intercept AJAX template render calls: Fetching CSS file: {0}".format(newLinkUn));$.get(newLinkUn,{cache:true},function(css){$("head").append($("<link />",{rel:"stylesheet",type:"text/css",href:newLinkUn}))}).then(function(){console.log("Intercept AJAX template render calls: Fetched CSS file: {0}".format(newLinkUn));if($(".js-debug-css-template-list").length>0){var addedSheets=getSheetsFromLink(newLinkUn),$ol=$("<ol />");$.each(addedSheets,function(idx,val){if(isCSSFromDB){$ol.append($("<li />").append(idx))}else{$ol.append($("<li />").append(val))}});var $templateList=$(".js-debug-css-template-list").append($("<li />").append(vBulletin.phrase.get("added_via_ajax_call")+":").append($ol));var $b=$templateList.prev("b");$b.text(parseInt($b.text(),10)+1)}loadCSS(links)},function(){console.warn("Intercept AJAX template render calls: Failed to fetch CSS file: {0}".format(newLinkUn));loadCSS(links)})};loadCSS(newLinks)}}}}})()});String.prototype.format=function(){var s=this,i=arguments.length;while(i--){s=s.replace(new RegExp("\\{"+i+"\\}","gm"),arguments[i])}return s};jQuery.fn.reverse=[].reverse;window.vBulletin=window.vBulletin||{};vBulletin.cookie=vBulletin.cookie||{};vBulletin.cookie.convertBbarrayCookie=function(cookie,dir){cookie=cookie||"";dir=dir||"get";if(dir=="set"){cookie=cookie.replace(/"/g,".");cookie=cookie.replace(/:/g,"-");cookie=cookie.replace(/;/g,"_")}else{cookie=cookie.replace(/\./g,'"');cookie=cookie.replace(/-/g,":");cookie=cookie.replace(/_/g,";")}return cookie};vBulletin.cookie.fetchBbarrayCookie=function(cookiename,id){if(typeof vBulletin.cookie.bbarraycookiecache=="undefined"){vBulletin.cookie.bbarraycookiecache={}}var cookie=$.cookie(pageData.cookie_prefix+cookiename);if(cookie!=""&&!vBulletin.cookie.bbarraycookiecache[cookiename]){try{vBulletin.cookie.bbarraycookiecache[cookiename]=$.parseJSON(vBulletin.cookie.convertBbarrayCookie(cookie))}catch(e){vBulletin.cookie.bbarraycookiecache[cookiename]=null}}if(vBulletin.cookie.bbarraycookiecache[cookiename]){return vBulletin.cookie.bbarraycookiecache[cookiename][id]?vBulletin.cookie.bbarraycookiecache[cookiename][id]:null}else{return null}};vBulletin.cookie.setBbarrayCookie=function(cookiename,id,value,permanent){if(typeof vBulletin.cookie.bbarraycookiecache=="undefined"){vBulletin.cookie.bbarraycookiecache={}}var cookie=$.cookie(pageData.cookie_prefix+cookiename);if(cookie!=""&&!vBulletin.cookie.bbarraycookiecache[cookiename]){try{vBulletin.cookie.bbarraycookiecache[cookiename]=$.parseJSON(vBulletin.cookie.convertBbarrayCookie(cookie))}catch(e){vBulletin.cookie.bbarraycookiecache[cookiename]=null}}if(!vBulletin.cookie.bbarraycookiecache[cookiename]){vBulletin.cookie.bbarraycookiecache[cookiename]={}}vBulletin.cookie.bbarraycookiecache[cookiename][id]=value;var cookieoptions={path:pageData.cookie_path,domain:pageData.cookie_domain};if(permanent){cookieoptions.expires=365}$.cookie(pageData.cookie_prefix+cookiename,vBulletin.cookie.convertBbarrayCookie(JSON.stringify(vBulletin.cookie.bbarraycookiecache[cookiename]),"set"),cookieoptions)};vBulletin.cookie.unsetBbarrayCookie=function(cookiename,id){if(typeof vBulletin.cookie.bbarraycookiecache=="undefined"){vBulletin.cookie.bbarraycookiecache={}}var cookie=$.cookie(pageData.cookie_prefix+cookiename);if(cookie!=""&&!vBulletin.cookie.bbarraycookiecache[cookiename]){try{vBulletin.cookie.bbarraycookiecache[cookiename]=$.parseJSON(vBulletin.cookie.convertBbarrayCookie(cookie))}catch(e){vBulletin.cookie.bbarraycookiecache[cookiename]=null}}if(!vBulletin.cookie.bbarraycookiecache[cookiename]||!vBulletin.cookie.bbarraycookiecache[cookiename][id]){return }delete vBulletin.cookie.bbarraycookiecache[cookiename][id];var cookieoptions={path:pageData.cookie_path,domain:pageData.cookie_domain};$.cookie(pageData.cookie_prefix+cookiename,vBulletin.cookie.convertBbarrayCookie(JSON.stringify(vBulletin.cookie.bbarraycookiecache[cookiename]),"set"),cookieoptions)};(function preInit(){(function(){$("#main-navbar .secondary-nav").removeClass("h-disabled");$("#idLoginIframe").on("load",function(e){try{var $iframe=$(this),$iframeContent=$iframe.contents().find("html")[0],h=$iframeContent.scrollHeight;if(h>0){$iframe.height(h);$iframe.parent().height(h)}}catch(err){}});$("#main-navbar .username-container").on("click",function(e){var $container=$(this),$subList=$("> ul",$container);if($container.hasClass("h-disabled")||$container.closest(".secondary-nav").hasClass("h-disabled")){return false}if($container.hasClass("username-container-active")){e.stopPropagation();try{e.target.parentNode.click()}catch(err){}$subList.slideUp("fast");$container.removeClass("username-container-active");return $subList.hasClass("submenu")}var $iframe=$("#idLoginIframe");$iframe.closest("ul").show();$iframe.trigger("load");$iframe.closest("ul").hide();$container.addClass("username-container-active");$subList.css("top",$container.outerHeight()).slideDown("fast");return false});$("body").on("click",function(e){if($(e.target).closest(".username-container").size()==0){$(".username-container > ul").slideUp("fast");$(".username-container").removeClass("username-container-active")}})})();$(".ui-tabs .ui-tabs-nav > li").addClass("ui-state-disabled");$(".announcement-tabs .ui-tabs-nav > li").removeClass("ui-state-disabled")})();window.vBulletin.getAjaxBaseurl=function(){if(pageData.baseurl.indexOf("http://")==0){return pageData.baseurl.substring(5)}else{if(pageData.baseurl.indexOf("https://")==0){return pageData.baseurl.substring(6)}else{return pageData.baseurl}}};window.vBulletin.normalizeAjaxUrl=function(urlToNormalize){if(urlToNormalize.indexOf("http://")==0){return urlToNormalize.substring(5)}else{if(urlToNormalize.indexOf("https://")==0){return urlToNormalize.substring(6)}else{return urlToNormalize}}};window.vBulletin.pageHasSelectors=function(selectors){if($.isArray(selectors)&&selectors.length>0&&$.trim(selectors.toString())!=""){var found=false;$.each(selectors,function(index,value){if($(value).length>0){found=true;return false}});return found}return true};window.vBulletin.areJsonObjectsEqual=function(a,b){var check=function(a,b){for(var attr in a){if(a.hasOwnProperty(attr)&&b.hasOwnProperty(attr)){var attrA=a[attr],attrB=b[attr];if(attrA!=attrB){if(attrA instanceof Array&&attrB instanceof Array){if($(attrA).not(attrB).length>0||$(attrB).not(attrA).length>0){return false}else{continue}}else{return false}switch(attrA.constructor){case Object:if(!window.vBulletin.areJsonObjectsEqual(attrA,attrB)){return false}break;case Function:if(attrA.toString()!=attrB.toString()){return false}break;default:return false}}}else{return false}}return true};return(Object.keys(a).length==Object.keys(b).length)?check(a,b):false};window.vBulletin.ajaxSetup=(function(){var initialized=false;return{init:function(){if(initialized){return }initialized=true;$.ajaxSetup({contentType:"application/x-www-form-urlencoded; charset=UTF-8"})}}})();window.vBulletin.ajaxSetup.init();window.vBulletin.ajaxProfile=(function(){var ajaxRequests=[],initialized=false,enabled=true,canDisplay=false;return{init:function(){if(initialized){return }initialized=true;$(function(){if($("#debug-information").length==0){enabled=false}$("<ol />").attr("id","debug-ajax-request-list").hide().css({height:"150px",overflow:"auto",padding:"4px",border:"1px solid #CCC",background:"#EEE","margin-top":"2px","margin-bottom":"4px"}).appendTo($("#debug-information #debug-ajax-request-count").closest("li"));$("#debug-information #debug-ajax-request-count").css("cursor","pointer").on("click",function(){$("#debug-ajax-request-list").toggle()});canDisplay=true});$.ajaxPrefilter(function(options,originalOptions,jqXHR){if(!enabled){return }ajaxRequests.push({displayed:false,url:options.url,relUrl:""});if(canDisplay){$("#debug-information #debug-ajax-request-count").text(ajaxRequests.length);$.each(ajaxRequests,function(){if(!this.displayed){this.displayed=true;this.relUrl=this.url.indexOf(pageData.baseurl)==0?this.url.substring(pageData.baseurl.length):this.url;$("#debug-ajax-request-list").append($("<li />").text(this.relUrl))}})}})}}})();window.vBulletin.ajaxProfile.init();window.vBulletin.loadingIndicator=(function(){var calledCount=0,initialized=false,timeoutId=false,ajaxToSuppressCount=0,ajaxSuppressedCount=0;return{init:function(){if(initialized){return }$(".js-loading-indicator").ajaxStart(function(){window.vBulletin.loadingIndicator.show("ajaxStart")});$(".js-loading-indicator").ajaxStop(function(){window.vBulletin.loadingIndicator.hide("ajaxStop")});initialized=true},show:function(source){if(ajaxToSuppressCount>0&&source=="ajaxStart"){--ajaxToSuppressCount;++ajaxSuppressedCount;console.log("vBulletin.loadingIndicator.show ajax indicator suppressed");return }++calledCount;console.log("vBulletin.loadingIndicator.show Counter: "+calledCount+" Source: "+(source||"Unspecified"));if(calledCount>0){timeoutId=window.setTimeout(function(){if(timeoutId){$(".js-loading-indicator").show();timeoutId=false}},1000)}},hide:function(source){if(ajaxSuppressedCount>0&&source=="ajaxStop"){--ajaxSuppressedCount;console.log("vBulletin.loadingIndicator.hide ajax indicator suppressed");return }--calledCount;calledCount=calledCount<0?0:calledCount;if(!source){calledCount=0}console.log("vBulletin.loadingIndicator.hide Counter: "+calledCount+" Source: "+(source||"Unspecified"));if(calledCount<1){if(timeoutId){window.clearTimeout(timeoutId);timeoutId=false}$(".js-loading-indicator").hide()}},suppressNextAjaxIndicator:function(){++ajaxToSuppressCount}}})();window.vBulletin.phrase=window.vBulletin.phrase||{};window.vBulletin.phrase.precache=window.vBulletin.phrase.precache||[];window.vBulletin.phrase.cache=window.vBulletin.phrase.cache||{};window.vBulletin.phrase.uncachable=window.vBulletin.phrase.uncachable||[];window.vBulletin.phrase.render=function(args){var str=args[0];for(var i=1;i<args.length;++i){str=str.replace(new RegExp("%"+i+"\\$s","gm"),args[i])}return str};window.vBulletin.phrase.remoteGet=function(key,precache){precache.push(key);var toCache=[];var ret=key;$.each(precache,function(i,element){if($.inArray(element,toCache)===-1&&element!=""){toCache.push(element)}});if(toCache.length>0){vBulletin.loadingIndicator.suppressNextAjaxIndicator();$.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/phrase/fetch",async:false,data:({phrases:toCache}),type:"POST",dataType:"json",success:function(result){if(result){if(typeof (result[key])!="undefined"){ret=result[key]}window.vBulletin.cache.setBucket("phrases"+pageData.languageid);$.each(result,function(phraseKey,phraseText){window.vBulletin.cache.set(phraseKey,phraseText)});precache.length=0}else{console.warn("Unexpected result when fetching phrases")}},error:function(xhr,statusText,error){console.warn("Error when fetching phrases: {0}".format(error))}})}return ret};window.vBulletin=window.vBulletin||{};window.vBulletin.phrase=window.vBulletin.phrase||{};window.vBulletin.phrase.precache=window.vBulletin.phrase.precache||[];window.vBulletin.phrase.precache=$.merge(window.vBulletin.phrase.precache,["admin","admin_auth","all_changes_made_will_be_lost_would_you_like_to_continue","april","attach_link","attach_video","august","cancel","cancel_edit","close","compare_versions","conversation","december","done","edit_conversation","email_addresses_must_match","error","error_fetching_online_users_x","error_loading_ckeditor_script","error_loading_editor","error_loading_post","error_posting_comment_code_x","error_saving_vote","error_x","existing_reply_will_be_deleted","february","flag_a_post","follow","follow_error","following","following_pending","following_remove","friday_min","go_to_first_new_post","hour","inlinemod_auth_login_failed","inlinemod_auth_login_first","inlinemod_auth_password_empty","invalid_data","invalid_data_requested","invalid_email_address","invalid_request","invalid_server_response_please_try_again","invalid_special_channel_subscribe_request","invalid_user_permissions","invalid_username_specified","invalid_username_specified_maxlength_x","invalid_username_specified_minlength_x","invalid_query_definition_x","january","join","joined","join_error","july","june","leave","loading","logged_out_while_editing_post","login","login_success_admin_auth","march","may","minute","moderator","monday_min","new_posts","no","no_create_permissions","no_icon","no_leave_channel_permission","no_one_voted","no_permission","no_update_permissions","no_valid_tags_found","not_logged_no_permission","november","now","october","onbeforeunload_message_while_editing_post","password_must_be_at_least_four_chars","passwords_must_match","people_who_liked","physically_remove_blog","physically_remove_comment","physically_remove_media","physically_remove_reply","physically_remove_topic","physically_remove_visitorMessage","please_enter_a_username","please_enter_a_valid_url_and_click_attach","please_enter_link_url","please_enter_video_url","please_enter_your_comment","please_enter_your_email_address","please_enter_your_reason_why_you_want_to_flag_this_post","please_provide_search_string","please_select_a_day","please_select_a_month","please_select_a_year","post_comment","post_history","posttype_blog","posttype_comment","posttype_media","posttype_reply","posttype_topic","posttype_visitorMessage","preview","saturday_min","search","see_less","see_more","select_option_and_click_delete_button_blog","select_option_and_click_delete_button_comment","select_option_and_click_delete_button_media","select_option_and_click_delete_button_reply","select_option_and_click_delete_button_topic","select_option_and_click_delete_button_visitorMessage","send_report","september","share_post_link_help","soft_delete_blog","soft_delete_comment","soft_delete_media","soft_delete_notes_blog","soft_delete_notes_comment","soft_delete_notes_media","soft_delete_notes_reply","soft_delete_notes_topic","soft_delete_notes_visitorMessage","soft_delete_reply","soft_delete_topic","soft_delete_visitorMessage","sunday_min","thanks_for_signing_up_log_in","the_report_has_been_sent","time","tuesday_min","thursday_min","unable_to_check_admin_permissions","unexpected_error","unfollow_error","unsubscribe","unsubscribe_overlay_error","unvote_cap","user_name_x_already_in_use_choose_different_name","vote_a_post","vote_cap","wednesday_min","xs_avatar","yes","you_have_a_pending_edit_unsaved"]);window.vBulletin.cache.initBucket("phrases"+pageData.languageid,pageData.phrasedate,window.vBulletin.phrase.precache,window.vBulletin.phrase.remoteGet);window.vBulletin.phrase.get=function(){if(arguments.length<1){console.log("vBulletin.phrase.get() called with no parameters");return""}if(typeof arguments[0]=="object"){arguments=arguments[0]}window.vBulletin.cache.setBucket("phrases"+pageData.languageid);var phrase=window.vBulletin.cache.get(arguments[0]);arguments[0]=phrase;return window.vBulletin.phrase.render(arguments)};window.vBulletin.getScrollbarWidth=function(){if($("body").data("scrollbar-width")){return $("body").data("scrollbar-width")}var $outer=$('<div style="width:50px;height:50px;overflow:auto;position:absolute;top:-99999px;"><div /></div>').appendTo("body"),$inner=$outer.children(),width=$inner.innerWidth()-$inner.height(99).innerWidth();$outer.remove();$("body").data("scrollbar-width",width);return width};window.vBulletin.options=window.vBulletin.options||{};window.vBulletin.options.precache=window.vBulletin.options.precache||[];window.vBulletin.options.remoteGet=function(key,precache){var toCache=[key];$.each(precache,function(i,element){if($.inArray(element,toCache)===-1){toCache.push(element)}});var ret=null;$.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/options/fetchValues",async:false,data:({options:toCache}),type:"POST",dataType:"json",success:function(result){if(result){vBulletin.cache.setBucket("options");$.each(result,function(optionName,optionValue){if(optionName==key){ret=optionValue}vBulletin.cache.set(optionName,optionValue)});precache.length=0}else{console.warn("Unexpected result when fetching options")}},error:function(xhr,statusText,error){console.warn("Error when fetching options: {0}".format(error))}});return ret};window.vBulletin=window.vBulletin||{};window.vBulletin.options=window.vBulletin.options||{};window.vBulletin.options.precache=window.vBulletin.options.precache||[];window.vBulletin.options.precache=$.merge(window.vBulletin.options.precache,["crontab","bbtitle","markinglimit","threadpreview"]);vBulletin.cache.initBucket("options",window.pageData.optionsdate,window.vBulletin.options.precache,window.vBulletin.options.remoteGet);window.vBulletin.options.get=function(optionName){window.vBulletin.cache.setBucket("options");return window.vBulletin.cache.get(optionName)};window.vBulletin.openAuthDialog=function(callback,title,callbackClickNo,onLoginCallback){title=title||"inlinemod_auth";callbackClickNo=callbackClickNo||function(){};var $authDialog=openConfirmDialog({title:vBulletin.phrase.get(title),message:vBulletin.phrase.get("loading")+"...",width:500,dialogClass:"inlinemod-auth-dialog loading",buttonLabel:{yesLabel:vBulletin.phrase.get("login"),noLabel:vBulletin.phrase.get("cancel")},primaryButton:"yes",onClickYesWithAjax:true,onClickYes:function(){var $authForm=$authDialog.find(".inlinemod-auth-form"),password=$(".js-inlineauth_password").val(),username=$(".js-inlineauth_username").val(),$errorBox=$(".error-msg-box");$errorBox.text("").addClass("h-hide");$.ajax({url:vBulletin.normalizeAjaxUrl($authForm.attr("action")),data:{password:password,username:username},type:"POST",dataType:"json",success:function(result){if(result.error){$errorBox.text(vBulletin.phrase.get(result.error)).removeClass("h-hide")}else{$authDialog.dialog("close");$authDialog.dialog("close");if(typeof (onLoginCallback)=="function"){onLoginCallback()}return callback()}},error:function(xhr,statusText,error){console.log("/auth/inlinemodLogin failed, error: "+error);openAlertDialog({title:vBulletin.phrase.get(title),message:xhr.status,iconType:"error"})}})},onClickNo:callbackClickNo});$.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/render/inlinemod_auth",type:"POST",dataType:"json",success:function(result){console.log("/ajax/render/inlinemod_auth");if(result&&!result.errors){$(".inlinemod-auth-dialog").removeClass("loading");$(".dialog-content .message",$authDialog).html(result);$authDialog.dialog("option","position","center");$('[name="password"]',$authDialog).on("keydown",function(e){if(e.which==13){e.preventDefault();$("#btnConfirmDialogYes",$authDialog).click()}});$("input",$authDialog).first().focus()}else{console.log("/ajax/render/inlinemod_auth successful, but response was not valid");openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("invalid_server_response_please_try_again"),iconType:"error",onAfterClose:function(){$authDialog.dialog("close")}})}},error:function(xhr,statusText,error){console.log("/ajax/render/inlinemod_auth failed, error: "+error);openAlertDialog({title:vBulletin.phrase.get(title),message:vBulletin.phrase.get("error_loading_delete_form_x",xhr.status),iconType:"error",onAfterClose:function(){$authDialog.dialog("close")}})}})};window.vBulletin.assertUserHasAdminPermission=function(adminPermission,context,successCallback,onLoginCallback){if($(context).data("in-progress")){return false}$("body").css("cursor","wait");var caller=arguments.callee.caller;$(context).data("in-progress",true);$.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/user/currentUserHasAdminPermission",data:({adminPermission:adminPermission}),type:"POST",dataType:"json",complete:function(){$("body").css("cursor","auto");$(context).data("in-progress",null)},success:function(result){console.log("ajax/api/user/currentUserHasAdminPermission result:"+JSON.stringify(result));if(result===true){successCallback()}else{if(result&&result.errors&&result.errors.length>0){if(result.errors[0]=="auth_required"){window.vBulletin.openAuthDialog(function(){caller.apply(context)},"admin_auth",function(){},onLoginCallback);return }openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("nopermission_loggedout"),iconType:"error",onAfterClose:function(){$("#config-dialog").dialog("close");window.location.reload()}});$("#config-dialog .loader").hide()}else{openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("unable_to_check_admin_permissions"),iconType:"error",onAfterClose:function(){$("#config-dialog").dialog("close");window.location.reload()}});$("#config-dialog .loader").hide()}}},error:function(xhr,statusText,error){console.log("ajax/api/user/currentUserHasAdminPermission error: "+error);openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("unable_to_check_admin_permissions"),iconType:"error",onAfterClose:function(){$("#config-dialog").dialog("close");window.location.reload()}});$("#config-dialog .loader").hide()}})};vBulletin.selectTabByIndex=function(selectedTabIndex){var $self=this instanceof $?this:$(this);if($self.length&&selectedTabIndex>-1&&$self.hasClass("ui-tabs")){$self.data("noPushState",true).tabs("select",selectedTabIndex).data("noPushState",null).find(".ui-tabs-nav li").removeClass("ui-state-focus").eq(selectedTabIndex).addClass("ui-state-focus").find("a").focus()}};vBulletin.tabify=function(tabParams){var $self=this instanceof $?this:$(this);if($self.length){var defaultOptions={tabOptions:{},tabHistory:null,allowHistory:false,tabParamAsQueryString:true,hash:"",getTabIndexByHash:function(){return -1}};tabParams=$.extend({},defaultOptions,tabParams);if(tabParams.tabHistory instanceof vBulletin.history.instance&&tabParams.tabHistory.isEnabled()){$self.on("tabscreate",function(event,ui){var qs=vBulletin.parseQueryString(location.search,["_"]),qsLen=Object.keys(qs).length,selectedTab=vBulletin.getSelectedTabHashOrPath($self,tabParams.tabParamAsQueryString),state=tabParams.tabHistory.getState();if(((tabParams.tabParamAsQueryString&&qsLen>1&&typeof qs.tab!="undefined")||(!tabParams.tabParamAsQueryString&&qsLen>0))&&(!state||$.isEmptyObject(state.data))){var objState={from:"tabs",tab:selectedTab};tabParams.tabHistory.setDefaultState(objState,document.title,location.href)}tabParams.tabHistory.setStateChange(function(e){var state=tabParams.tabHistory.getState();if(state.data.from=="tabs"){tabParams.tabHistory.log(state.data,state.title,state.url);var selectedTabIndex=tabParams.getTabIndexByHash(state.data.tab),qs=vBulletin.parseQueryString(state.url,["tab","_"]);if($self.tabs("option","selected")!=selectedTabIndex){vBulletin.selectTabByIndex.call($self,selectedTabIndex);if(!$.isEmptyObject(qs)){$(window).trigger("statechange.filter",["tabs",qs])}}else{if(!$.isEmptyObject(qs)){$(window).trigger("statechange.filter",["tabs",qs])}else{var $context,$tabPanel,$defaultCheckedFilters;if(state.data.tab){$tabPanel=tabParams.tabParamAsQueryString?$(state.data.tab):$('.ui-tabs .ui-tabs-panel[data-url-path="'+state.data.tab+'"]')}$context=($tabPanel&&$tabPanel.length&&$tabPanel)||$($self.closest(".canvas-widget").data("widget-default-tab"));$defaultCheckedFilters=$(".toolbar-filter-overlay .filter-options .js-default-checked",$context);if($defaultCheckedFilters.length){$defaultCheckedFilters.prop("checked",true).first().data("bypass-filter-display",true).trigger("change",[true]).data("bypass-filter-display",null);$(".filtered-by",$context).addClass("h-hide").find(".filter-text-wrapper").empty()}else{$(".conversation-toolbar .js-default-checked",$context).first().trigger("click",[true])}}}}},"tabs");if(typeof tabParams.tabOptions.create=="function"){tabParams.tabOptions.create.call($self[0],event,ui)}})}if(tabParams.allowHistory&&tabParams.tabHistory instanceof vBulletin.history.instance){$self.on("tabsselect",function(event,ui){if(typeof tabParams.tabOptions.select=="function"&&tabParams.tabOptions.select.call(this,event,ui)===false){return false}var url,tab=tabParams.tabParamAsQueryString?ui.tab.hash:$(ui.tab).data("url-path"),tabPaths=tabParams.tabParamAsQueryString?undefined:$self.find(".ui-tabs-nav > li > a").map(function(){return $(this).data("url-path")}).get();if(!tabParams.tabHistory.isEnabled()){url=vBulletin.makeFilterUrlFromSelectedFilters(ui.panel,tab.replace("#",""),tabParams.tabParamAsQueryString,tabPaths,tabParams.hash);location.href=url;return false}if(!$self.data("noPushState")){var objState={from:"tabs",tab:tab};url=vBulletin.makeFilterUrlFromSelectedFilters(ui.panel,tab.replace("#",""),tabParams.tabParamAsQueryString,tabPaths);tabParams.tabHistory.pushState(objState,document.title,url)}else{$self.data("noPushState",null)}})}$self.tabs(tabParams.tabOptions)}return $self};vBulletin.getSelectedTabHashOrPath=function($tabContainer,tabParamAsQueryString){var selectedTab;if(tabParamAsQueryString){selectedTab=$tabContainer.find(".ui-tabs-nav > .ui-tabs-selected > a").prop("hash")}else{selectedTab=$tabContainer.find(".ui-tabs-nav > .ui-tabs-selected > a").data("url-path")}return selectedTab||""};vBulletin.parseUrl=function(url){var a=document.createElement("a"),pathname;a.href=url||"/";pathname=a.pathname;if(pathname.indexOf("/")!=0){pathname="/"+pathname}return{protocol:a.protocol,hostname:a.hostname,port:a.port,pathname:pathname,search:a.search,hash:a.hash}};vBulletin.makeHistoryUrl=function(currentUrl,pageNumber,tabParams,filterParams,hash){var url=vBulletin.makePaginatedUrl(currentUrl,pageNumber);url=vBulletin.makeTabUrl(url,tabParams.tab,tabParams.tabParamAsQueryString);url=vBulletin.makeFilterUrl(url,filterParams.filterName,filterParams.filterValue,filterParams.context,hash);return url};vBulletin.makeTabUrl=function(url,tab,tabParamAsQueryString,hash,tabParamName){if(url){var parsedUrl=vBulletin.parseUrl(url),re;if(tabParamAsQueryString){tabParamName=tabParamName||"tab";re=new RegExp("([?+|&+])"+tabParamName+"=\\w+[-\\w]*","i");if(parsedUrl.search.match(re)){url=parsedUrl.pathname+parsedUrl.search.replace(re,"$1{0}={1}".format(tabParamName,tab))}else{if(parsedUrl.search){url="{0}{1}&{2}={3}".format(parsedUrl.pathname,parsedUrl.search,tabParamName,tab)}else{url="{0}?{1}={2}".format(parsedUrl.pathname,tabParamName,tab)}}}else{var pathname=parsedUrl.pathname.replace(/\/$/,""),nodes=pathname.split("/");re="\\/"+nodes[nodes.length-(pathname.match(/\/page([0-9]+)/)?2:1)]+"$";url=parsedUrl.pathname.replace(new RegExp(re),"/"+tab)+parsedUrl.search}}else{url="/"}if(hash){url+="#"+hash}return url};vBulletin.makePaginatedUrl=function(url,pageNumber){if(url){var m=url.match(/\/page[0-9]+/);if(m){if(pageNumber>1){url=url.replace(m[0],"/page"+pageNumber)}else{url=url.replace(m[0],"")}}else{if(pageNumber>1){if(url.match(/\?/)){url=url.replace(/\?/,"/page"+pageNumber+"?")}else{if(url.match(/\#/)){url=url.replace(/\#.*/,"/page"+pageNumber)}else{url+="/page"+pageNumber}}}}}return url};vBulletin.makeFilterUrl=function(url,filterName,filterValue,context,hash,removeFilter){removeFilter=removeFilter||false;url=url||location.href;var $filteredBy=$(".filtered-by",context),parsedUrl=vBulletin.parseUrl(url),s=parsedUrl.search;var $filterButton=$(".js-button-filter.js-default-checked.js-checked",context);if($filterButton.data("filter-name")==filterName&&$filterButton.data("filter-value")==filterValue){removeFilter=true}if(!removeFilter&&(($filteredBy.data("clicked")&&$('.toolbar-filter-overlay input[name="{0}"][value="{1}"]'.format(filterName,filterValue),context).hasClass("js-default-checked"))||($('.toolbar-search-form input[name="{0}"]'.format(filterName),context).length&&!filterValue))){removeFilter=true;$filteredBy.data("clicked",null)}url=parsedUrl.pathname;if(s&&s.length>1){if(s.match(new RegExp(filterName+"=","i"))){var params=vBulletin.parseQueryString(s);if(!$.isEmptyObject(params)){var qs="";$.each(params,function(i,value){if(!removeFilter||i!=filterName){qs+="{0}={1}&".format(i,(i==filterName?filterValue:value))}});if(qs){url+="?"+qs.substring(0,qs.length-1)}}}else{if(!removeFilter){url+=s+"&{0}={1}".format(filterName,encodeURIComponent(filterValue))}else{url+=s}}}else{if(!removeFilter){url+="?{0}={1}".format(filterName,encodeURIComponent(filterValue))}}if(hash){url+="#"+hash}return url};vBulletin.getSelectedFilters=function($form,radioFiltersOnly){var filters={};if(!radioFiltersOnly){var formData=$form.serializeArray();$.each(formData,function(index,field){if(field.name!="securitytoken"){if(field.name.slice(-2)=="[]"){var fields=field.name.split("[]");filters[fields[0]]=filters[fields[0]]||[];filters[fields[0]].push(field.value)}else{filters[field.name]=field.value}}})}else{var $filteredByText=$form.parent().find(".filtered-by .filter-text").filter(":visible");$form.find(":input:radio:checked").each(function(index,field){var $field=$(field);if(($field.hasClass("js-default-checked")||$field.data("bypass-filter-display")==1)&&($filteredByText.length==0||$filteredByText.filter('[data-filter-name={0}][data-filter-value="{1}"]').length==0)){return true}if(field.name.slice(-2)=="[]"){var fields=field.name.split("[]");filters[fields[0]]=filters[fields[0]]||[];filters[fields[0]].push(field.value)}else{filters[field.name]=field.value}})}return filters};vBulletin.makeFilterUrlFromSelectedFilters=function(context,tabId,tabParamAsQueryString,tabPaths,hash){var qs,url=location.pathname.replace(/\/$/,"").replace(/\/page[0-9]+/,""),$filterForm=$(".toolbar-filter-overlay",context),selectedFilters=vBulletin.getSelectedFilters($filterForm,true),pagenum=$(".pagenav-form .js-pagenum",context).val()||1,searchKeyword=$(".toolbar-search-form .js-filter-search",context).val()||"",$canvasWidget=$(context).closest(".canvas-widget"),allowHistory=$(".conversation-toolbar-wrapper",context).length?($(".conversation-toolbar-wrapper",context).data("allow-history")=="1"):($(context).data("allow-history")=="1"),filterHistory=new vBulletin.history.instance(allowHistory),defaultTabId=$canvasWidget.data("widget-default-tab")||$canvasWidget.find(".ui-tabs-nav > li:first-child a").attr("href");if($.isEmptyObject(selectedFilters)){$(".conversation-toolbar .js-button-filters",context).each(function(){var $selectedFilter=$(".js-button-filter.js-checked:not(.js-default-checked)",this);if($selectedFilter.length){selectedFilters[$selectedFilter.data("filter-name")]=$selectedFilter.data("filter-name")}})}if(!tabParamAsQueryString){var re=new RegExp("\\/("+tabPaths.join("|")+")/?$"),matches=url.match(re);if(matches){url=url.replace(new RegExp(matches[0]),"/"+tabId)}else{url+="/"+tabId}}if(pagenum>1&&filterHistory.isEnabled()){url+="/page"+pagenum}if(tabParamAsQueryString&&tabId&&defaultTabId!=("#"+tabId)){selectedFilters.tab=tabId;if(!filterHistory.isEnabled()){url+="?tab="+tabId}}if(!filterHistory.isEnabled()){return url+(hash?"#"+hash:"")}if(searchKeyword){selectedFilters.q=searchKeyword}qs=$.param(selectedFilters);return url+(qs?"?"+qs:"")+(hash?"#"+hash:"")};vBulletin.parseQueryString=function(url,exclude){var qs={},qm;if(url&&url.length>1){qm=url.indexOf("?");exclude=(exclude instanceof Array)?exclude:[];if(qm!=-1){var segments=url.substring(qm+1).split("&");$.each(segments,function(i,value){var q=value.split("=");if(exclude.length==0||($.inArray(q[0],exclude)==-1)){qs[q[0]]=decodeURIComponent((q[1]||"")).replace(/\+/g," ")}})}}return qs};vBulletin.pagination=function(userOptions){var options={context:document,onPageChanged:null,tabParamAsQueryString:true,allowHistory:false};if(userOptions&&typeof userOptions=="object"){$.extend(options,userOptions)}var url,$pageNavForm=$(".pagenav-controls .pagenav-form",options.context),defaultPageNumber=Number($(".defaultpage",$pageNavForm).val())||Number($(".js-pagenum",$pageNavForm).val())||1,paginationHistory=new vBulletin.history.instance(options.allowHistory);$pageNavForm.data("object-instance",this);if(paginationHistory.isEnabled()){var qs=vBulletin.parseQueryString(location.search,["_"]),m=location.pathname.match(/\/page([0-9]+)/),state=paginationHistory.getState();if(m&&Number(m[1])>1&&$.isEmptyObject(qs)&&(!state||$.isEmptyObject(state.data))){url=vBulletin.makePaginatedUrl(location.href,defaultPageNumber);var objState={from:"pagination",page:defaultPageNumber,tab:options.tabParamAsQueryString?"#"+$pageNavForm.closest(".ui-tabs-panel").attr("id"):vBulletin.getSelectedTabHashOrPath($pageNavForm.closest(".ui-tabs"),false)};paginationHistory.setDefaultState(objState,document.title,url)}paginationHistory.setStateChange(function(e){var state=paginationHistory.getState();if(state.data.from=="pagination"){paginationHistory.log(state.data,state.title,state.url);if(location.search){var qs=vBulletin.parseQueryString(location.search,["_"]);if(!$.isEmptyObject(qs)||qs.tab=="groups-tab"){delete qs.tab;$(window).trigger("statechange.filter",["pagination",qs]);return }}var $tabPanel,context,filterInstance,$tabs,$tabsAnchor;if(state.data.tab){$tabPanel=options.tabParamAsQueryString?$(state.data.tab):$('.ui-tabs .ui-tabs-panel[data-url-path="'+state.data.tab+'"]')}context=($tabPanel&&$tabPanel.length&&$tabPanel)||options.context;filterInstance=$(".conversation-toolbar .filter-wrapper",context).data("object-instance");if(filterInstance){filterInstance.resetFilters(true)}if(state.data.tab){$tabs=$tabPanel.closest(".ui-tabs");$tabAnchor=options.tabParamAsQueryString?$tabs.find('.ui-tabs-nav > li > a[href*="{0}"]'.format(state.data.tab)):$tabs.find('.ui-tabs-nav > li > a[data-url-path="'+state.data.tab+'"]');if(!$tabAnchor.parent().hasClass("ui-tabs-selected")){var selectedTabIndex=$tabAnchor.parent().index();vBulletin.selectTabByIndex.call($tabs,selectedTabIndex);return }}var $form=$(".pagenav-controls .pagenav-form",context);var paginationInstance=$form.data("object-instance");if(paginationInstance&&typeof paginationInstance.getOption=="function"&&typeof paginationInstance.getOption("onPageChanged")=="function"){var p=state.data.page||defaultPageNumber;paginationInstance.getOption("onPageChanged").apply($form.get(0),[p,false,!location.search,location.search])}}},"pagination")}function getTotalPages(){return parseInt(($(".pagetotal",this).html()||"").replace(/[^\d]+/g,""),10)||1}function updatePageNavigation(pageNumber,bypassFilter){var pageTotal=getTotalPages.apply(this),$next=$(".arrow[rel=next]",this),$prev=$(".arrow[rel=prev]",this);if(pageNumber<1){pageNumber=1}else{if(pageNumber>pageTotal){pageNumber=pageTotal}}$(".js-pagenum",this).val(pageNumber);if(pageNumber==pageTotal){$next.addClass("h-disabled").removeAttr("href")}else{$next.removeClass("h-disabled").attr("href",vBulletin.makePaginatedUrl(location.href,pageNumber+1))}if(pageNumber==1){$prev.addClass("h-disabled").removeAttr("href")}else{$prev.removeClass("h-disabled").attr("href",vBulletin.makePaginatedUrl(location.href,pageNumber-1))}if(typeof options.onPageChanged=="function"){options.onPageChanged.apply(this,[pageNumber,bypassFilter])}if(pageTotal>1&&paginationHistory.isEnabled()&&!bypassFilter){var state=paginationHistory.getState();if(!state||!state.data||!state.data.from||$.inArray(state.data.from,["filter_blogs","filter_groups"]==-1)){if(pageNumber==1){url=$(".arrow[rel=next]",this).attr("href")}else{url=$(".arrow[rel=prev]",this).attr("href")}if(url){url=vBulletin.makePaginatedUrl(url,pageNumber);var objState={from:"pagination",page:pageNumber,tab:options.tabParamAsQueryString?"#"+$(this).closest(".ui-tabs-panel").attr("id"):vBulletin.getSelectedTabHashOrPath($(this).closest(".ui-tabs"),false)};paginationHistory.pushState(objState,document.title,url)}}}}function updateResultId(resultId){var cleanId=parseInt(resultId);if(cleanId&&typeof cleanId==="number"){$("input[name=result-id]",$pageNavForm).val(cleanId)}}function hideDisplaySeeMore(hide){$("a.see-all-btn",this).closest(".pagenav-controls")[hide?"addClass":"removeClass"]("h-hide")}$(".arrow",$pageNavForm).off("click").on("click",function(ev){var $arrow=$(this),objForm=this.form||$arrow.closest("form").get(0);if(!$arrow.hasClass("h-disabled")){var pageNumber=parseInt($(".js-pagenum",objForm).val())+(($arrow.attr("rel")=="next")?1:-1);if(!paginationHistory.isEnabled()&&options.allowHistory){if(!this.href||this.hash==this.href){this.href=vBulletin.makePaginatedUrl(location.href,pageNumber)}return true}updatePageNavigation.apply(objForm,[pageNumber,false])}return false});function attachClickEventPageNavButtons(){$(".pagenav .button",options.context).off("click").on("click",function(ev){if(paginationHistory.isEnabled()){var $button=$(this),pageNumber=$button.data("page"),form=$(".pagenav-form",options.context).get(0);updatePageNavigation.apply(form,[pageNumber,false]);return false}return true}).each(function(){this.href=vBulletin.makePaginatedUrl(location.href,parseInt($(this).data("page")))})}attachClickEventPageNavButtons();$(".js-pagenum",$pageNavForm).off("keypress").on("keypress",function(ev){if(ev.keyCode==13){ev.preventDefault();var pageNumber=parseInt($(this).val(),10);var totalPages=getTotalPages.apply(this.form);if(pageNumber>totalPages){pageNumber=totalPages}if(pageNumber<1){pageNumber=1}if(paginationHistory.isEnabled()){updatePageNavigation.apply(this.form,[pageNumber,false])}else{if(options.allowHistory){location.href=vBulletin.makePaginatedUrl(location.href,pageNumber)}else{updatePageNavigation.apply(this.form,[pageNumber,false])}}}});$(".js-pagenum",$pageNavForm).off("click").on("click",function(ev){$(this).select()});this.updatePageInfo=function(pageInfo,bypassFilter){if(pageInfo&&typeof pageInfo=="object"){var totalPages=pageInfo.totalpages||1,$pageNavForm=$(".pagenav-controls .pagenav-form",options.context);$(".pagetotal",$pageNavForm).text(totalPages);if(typeof pageInfo.showseemore!="undefined"){if(pageInfo.showseemore){hideDisplaySeeMore.apply($pageNavForm,[false])}else{hideDisplaySeeMore.apply($pageNavForm,[true])}}pageInfo.perpage=vBulletin.conversation.POSTS_PER_PAGE;if(bypassFilter&&$(".pagenav-container",options.context).length>0){$.get(pageData.baseurl+"/ajax/render/pagenav",{pagenav:pageInfo},function(result){if(result){$(".pagenav-container",options.context).replaceWith(result.template);attachClickEventPageNavButtons()}},"json")}updatePageNavigation.apply($pageNavForm.get(0),[pageInfo.pagenumber,bypassFilter])}};this.updateResultId=function(resultId){updateResultId(resultId)};this.setOption=function(option,value){options[option]=value};this.getOption=function(option){return options[option]}};vBulletin.conversation=vBulletin.conversation||{};vBulletin.conversation.toggleCommentBox=function(){var container=$(this).closest(".js-comment-entry__parent").find(".js-comment-entry");container.slideToggle("fast",function(){var $commentBox=$(this).find(".js-comment-entry__textbox");if($commentBox.is(":visible")){$commentBox.focus()}});container.find(".js-comment-entry__cancel").off("click").on("click",function(e){container.slideToggle();return false});return false};vBulletin.conversation.postComment=function(e,onCommentPosted){var self=this;var $commentBox=$(self).closest(".js-comment-entry").find(".js-comment-entry__textbox");var commentText=$.trim($commentBox.val());console.log(commentText);if(!commentText||($commentBox.hasClass("placeholder")&&commentText==$commentBox.attr("placeholder"))){openAlertDialog({title:vBulletin.phrase.get("post_comment"),message:vBulletin.phrase.get("please_enter_your_comment"),iconType:"warning",onAfterClose:function(){$commentBox.focus()}});return false}$("body").css("cursor","wait");$(self).blur();var $post=$(self).closest(".js-comment-entry__parent"),isBlogComment=$(self).closest(".js-comment-entry--blog").length==1?1:0,isArticleComment=$(self).closest(".js-comment-entry--article").length==1?1:0;$.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/post-comment",data:({text:commentText,parentid:$post.attr("data-node-id"),postindex:$post.find(".js-post__content .b-post__count").text().replace("#",""),view:$post.parent().hasClass("stream-view")?"stream":"thread",redirecturl:$commentBox.hasClass(".reload-on-post")?1:0,isblogcomment:isBlogComment,isarticlecomment:isArticleComment,humanverify:{input:$(self).closest(".js-comment-entry").find('[name="humanverify[input]"]').val(),hash:$(self).closest(".js-comment-entry").find('[name="humanverify[hash]"]').val()},recaptcha_challenge_field:$(self).closest(".js-comment-entry").find('[name="recaptcha_challenge_field"]').val(),recaptcha_response_field:$(self).closest(".js-comment-entry").find('[name="recaptcha_response_field"]').val()}),type:"POST",dataType:"json",complete:function(xhr,statusText){console.log("post-comment complete.");$("body").css("cursor","auto");vBulletin.hv.reset()},success:function(result,statusText,xhr){console.log("post-comment successful! result:"+JSON.stringify(result));if(result){if(!result.error){if(typeof onCommentPosted=="function"){onCommentPosted.apply(self,[result])}if(!isBlogComment&&!isArticleComment){$(self).closest(".js-comment-entry").slideToggle()}var currentthreadid=$post.attr("data-node-id");if(pageData.threadmarking=="0"||pageData.userid=="0"){vBulletin.cookie.setBbarrayCookie("discussion_view",currentthreadid,Math.round(new Date().getTime()/1000))}else{$.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/node/markRead",data:{nodeid:currentthreadid},type:"POST",dataType:"json",complete:function(){},success:function(result){if(result&&!result.error){console.log("Topic "+currentthreadid+" is marked read successfully!")}else{console.log("Topic "+currentthreadid+" is marked read failed: "+result.error)}},error:function(xhr,statusText,error){console.log("Topic "+currentthreadid+" is marked read failed:"+error)}})}}else{openAlertDialog({title:vBulletin.phrase.get("conversation"),message:vBulletin.phrase.get("error_x",result.error),iconType:"warning"})}}else{openAlertDialog({title:vBulletin.phrase.get("conversation"),message:vBulletin.phrase.get("invalid_server_response_please_try_again"),iconType:"error"})}},error:function(xhr,statusText,error){console.log("post-comment failed! error:"+error);openAlertDialog({title:vBulletin.phrase.get("conversation"),message:vBulletin.phrase.get("error_posting_comment_code_x",xhr.status),iconType:"error"})}})};vBulletin.conversation.showIp=function(e){var $self=$(this),ip=$(this).data("post-ip"),host=$(this).data("post-host");openAlertDialog({title:vBulletin.phrase.get("ip_info"),message:vBulletin.phrase.get("ip_address_is")+": "+ip+"<br />"+vBulletin.phrase.get("host_name_is")+': <span class="ip-host-name loading">...</span>',iconType:"none"});vBulletin.AJAX({url:vBulletin.getAjaxBaseurl()+"/ajax/api/node/getHostName",data:{ip:ip},success:function(result,statusText,xhr){$(".ip-host-name").removeClass("loading").html(result)}});return false};vBulletin.conversation.showPostHistory=function(e){var $self=$(this);var nodeid=$(this).closest(".js-post").attr("data-node-id");var $compareDialog=openConfirmDialog({title:vBulletin.phrase.get("post_history"),message:vBulletin.phrase.get("loading")+"...",width:800,dialogClass:"post-history-dialog dialog-container dialog-box loading",buttonLabel:{yesLabel:vBulletin.phrase.get("compare_versions"),noLabel:vBulletin.phrase.get("cancel")},onAfterClose:function(){if(this.id=="btnConfirmDialogYes"){var $compareForm=$compareDialog.find(".post-history-form");var postData={oldpost:$compareForm.find("input:radio[name=old]:checked").val()||1,newpost:$compareForm.find("input:radio[name=new]:checked").val()||1,nodeid:nodeid};$("#btnConfirmDialogYes").hide();var $comparisonDialog=openConfirmDialog({title:vBulletin.phrase.get("post_history"),message:vBulletin.phrase.get("loading")+"...",width:800,dialogClass:"post-history-comparison-dialog dialog-container dialog-box loading",buttonLabel:{yesLabel:vBulletin.phrase.get("compare_versions"),noLabel:vBulletin.phrase.get("close")},onAfterClose:function(){$("#btnConfirmDialogYes").show()}});postForm($comparisonDialog,"post_history_form",postData)}}});postForm($compareDialog,"post_history_form",{nodeid:nodeid});function postForm(dialog,template,data){$.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/render/"+template,data:data,type:"POST",dataType:"json",success:function(result){console.log("/ajax/render/"+template);if(result&&!result.errors){dialog.removeClass("loading").find(".dialog-content .message").html(result).find("[placeholder]").placeholder().end().end().dialog("option","position","center")}else{console.log("/ajax/render/"+template+" successful, but response was not valid: "+JSON.stringify(result));openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("invalid_server_response_please_try_again"),iconType:"error",onAfterClose:function(){dialog.dialog("close")}})}},error:function(xhr,statusText,error){console.log("/ajax/render/"+template+" failed, error: "+error);openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_loading_delete_form_x",xhr.status),iconType:"error",onAfterClose:function(){dialog.dialog("close")}})}})}};vBulletin.conversation.flagPost=function(e){var $self=$(this),nodeid=$(this).closest(".js-post").attr("data-node-id");openPromptDialog({title:vBulletin.phrase.get("flag_a_post"),message:vBulletin.phrase.get("please_enter_your_reason_why_you_want_to_flag_this_post"),buttonLabel:{okLabel:vBulletin.phrase.get("send_report"),cancelLabel:vBulletin.phrase.get("cancel")},multiline:true,validation:{type:"string"},onClickOK:function(reason){$("body").css("cursor","wait");$.ajax({url:vBulletin.getAjaxBaseurl()+"/report/report",type:"post",data:{reason:reason,reportnodeid:nodeid},dataType:"json",success:function(response){if(response){if(response.error){console.log("/report/report failed, error: "+JSON.stringify(response.error));var msg;if(response.error.length>1){msg=vBulletin.phrase.get(response.error)}else{msg=vBulletin.phrase.get(response.error[0])}openAlertDialog({title:vBulletin.phrase.get("flag_a_post"),message:msg,iconType:"error"})}else{openAlertDialog({title:vBulletin.phrase.get("flag_a_post"),message:vBulletin.phrase.get("the_report_has_been_sent"),iconType:"",onAfterClose:function(){$("#prompt-dialog").dialog("close")}})}}},error:function(xhr,statusText,error){console.log("/report/report failed, error: "+error);openAlertDialog({title:vBulletin.phrase.get("flag_a_post"),message:vBulletin.phrase.get("unable_to_contact_server_please_try_again"),iconType:"error",onAfterClose:function(){$("#prompt-dialog").dialog("close")}})},complete:function(){$("body").css("cursor","default")}})}});return false};vBulletin.conversation.editPost=function(e,filterInstance){var self=$(this),conversationType,view,$conversationList=self.closest(".conversation-list");if(self.closest(".js-comments").length>0){conversationType="comment"}var $editForm=$(".edit-conversation-container form",$conversationList);if($editForm.length>0){openAlertDialog({title:vBulletin.phrase.get("edit_conversation"),message:vBulletin.phrase.get("you_have_a_pending_edit_unsaved"),iconType:"warning",onAfterClose:function(){vBulletin.animateScrollTop($editForm.closest(".js-post").offset().top,{duration:"slow"})}});return }if(filterInstance&&filterInstance.isFilterSelected("conversations_on")){filterInstance.toggleNewConversations(false)}window.vBulletin.loadingIndicator.show();e.preventDefault();var nodeid=self.parent().attr("data-node-id"),container=(conversationType=="comment")?self.closest(".js-comment"):self.closest(".js-post__content-wrapper");if($conversationList.hasClass("thread-view")){view="thread"}else{if($conversationList.hasClass("full-activity-view")){view="full-activity-stream"}else{if($conversationList.hasClass("activity-view")){view="activity-stream"}else{view="stream"}}}conversationType=conversationType||container.attr("data-node-type")||"";var index,postCount=$(".b-post__count",container).text()||"1";if(conversationType=="comment"&&(view=="thread"||$conversationList.closest(".blog-conversation-content-widget").length==1)){index=Number(postCount.replace("#",""))}else{index=Number(postCount.replace("#",""))-1}var saveEditCallback=function(response,statusText,xhr,$form){if(response&&response.error){window.vBulletin.loadingIndicator.hide();$form.find(".action-buttons .button").prop("disabled",false);if($.isArray(response.error)){switch(response.error[0]){case"toomanyimages":var msg=vBulletin.phrase.get("toomanyimages",response.error[1],response.error[2]);break;default:$.each(response.error,function(index,value){response.error[index]=vBulletin.phrase.get(value)});var msg=response.error.join("<br />")}}else{var msg=vBulletin.phrase.get(response.error)}openAlertDialog({title:vBulletin.phrase.get("edit_conversation"),message:msg,iconType:"error"});return }var contentType=$(".edit-conversation-container form",container).data("content-type");var ret=vBulletin.triggerHandler.apply($form.get(0),["afterSave",$(document),response]);if(ret===false){$("body").trigger(contentType+"_editform_onunload",[container]);window.vBulletin.loadingIndicator.hide();return }$form.closest(".conversation-reply-slideout").addClass("h-hide");var page=pageData;page["posts-perpage"]=vBulletin.conversation.POSTS_PER_PAGE;if(view=="thread"){page["comments-perpage"]=vBulletin.conversation.COMMENTS_PER_PAGE}var xhr=$.post(vBulletin.getAjaxBaseurl()+"/create-content/loadnode",{nodeid:nodeid,view:view,index:index,page:page,type:conversationType,isAjaxTemplateRender:true},function(data){if(data.error){openAlertDialog({title:vBulletin.phrase.get("conversation"),message:vBulletin.phrase.get(data.error),iconType:"error"})}else{var prevChannelId=$form.closest(".js-content-entry").data("current-channelid"),newChannelId=$form.find('input[name="parentid"]:checked').val(),$updatedItem=$(data);if(prevChannelId>0&&newChannelId>0&&(prevChannelId!=newChannelId)){window.location.reload(true);return }$("body").trigger(contentType+"_editform_onunload",[container]);if(filterInstance&&filterInstance.isFilterSelected("conversations_on")){filterInstance.toggleNewConversations(true)}self.closest(".js-post").replaceWith($updatedItem);$("body").trigger(contentType+"_newcontent_onload",[$updatedItem]);var nodeId=$updatedItem.attr("data-node-id");if($updatedItem.hasClass("js-conversation-starter")){var updatedTitle=$(".b-post__title",$updatedItem).first().text();document.title=updatedTitle+" - "+vBulletin.options.get("bbtitle");$(".page-title-widget .widget-header .module-title").text(updatedTitle)}$(".js-select-box",$updatedItem).selectBox();vBulletin.animateScrollTop($updatedItem.offset().top,{duration:"slow"})}},"json").error(function(){openAlertDialog({title:vBulletin.phrase.get("conversation"),message:vBulletin.phrase.get("error_loading_post"),iconType:"error"})}).complete(function(){window.vBulletin.loadingIndicator.hide()})};$.post(vBulletin.getAjaxBaseurl()+"/create-content/loadeditor",{nodeid:nodeid,type:conversationType,view:view,isAjaxTemplateRender:true},function(template){if(template.error){openAlertDialog({title:vBulletin.phrase.get("edit_conversation"),message:vBulletin.phrase.get(template.error),iconType:"error"})}else{var activateEditModeCallback=function(){if(typeof vBulletin.upload=="undefined"||typeof vBulletin.tagEditor=="undefined"||typeof vBulletin.contentEntryBox.init=="undefined"){vBulletin.ckeditor.loadScripts("",{},activateEditModeCallback);return }container.addClass("b-post--edit");container.find(".js-post__content").first().addClass("b-post__content--edit");container.find(".b-post__footer").first().addClass("b-post__footer--edit");$container=container.find(".edit-conversation-container").first();container.closest(".js-album-detail").find(".list-item-header").addClass("h-hide").end().find(".conversation-body").addClass("h-hide").end().find(".profile-media-uploadphotos").addClass("h-hide-imp").end().find(".photo-preview").addClass("h-hide").end();vBulletin.contentEntryBox.init();vBulletin.contentEntryBox.setDefaultTab($container.find(".js-content-entry").first());$container.show();console.log($container);window.vBulletin.loadingIndicator.hide();var $attachList=$container.find(".js-attach-list");vBulletin.upload.initializePhotoUpload(container);var $tagEditorBox=$(".js-post[data-node-id={0}] .tag-editor-container .tag-input".format(nodeid));if($tagEditorBox.length>0&&typeof vBulletin.tagEditor!="undefined"){var tagEditor=new vBulletin.tagEditor.instance($tagEditorBox.selector)}if($attachList.data("attach-count")>0){$container.find(".b-toolbar__item").filter(function(){return $(this).data("panel")=="b-content-entry-panel__content--attachment"}).click()}$(".js-datepicker",$container).not(".hasDatePicker").datetimepicker({showOn:"both",buttonImage:pageData.baseurl+"/images/calendar-blue.png",buttonImageOnly:true,ampm:true})};console.log("Edit mode: Adding Content Entry UI to DOM (contains parsed post text in the .js-editor-parsed-text element)");$(".edit-conversation-container",container).first().hide().html(template);var contentType=$(".edit-conversation-container form",container).data("content-type");$(window).off("beforeunload.editPost").on("beforeunload.editPost",function(){return vBulletin.phrase.get("onbeforeunload_message_while_editing_post")});$("body").trigger(contentType+"_editform_onload",[container,activateEditModeCallback]);$(".edit-conversation-container input[placeholder], .edit-conversation-container textarea[placeholder]",container).placeholder();$("form",container).ajaxForm({dataType:"json",success:saveEditCallback,beforeSerialize:function($form){console.log("ajaxForm beforeSerialize (vBulletin.conversation.editPost)");$form.trigger("beforeSave");var ret=$("body").triggerHandler(contentType+"_editform_onbeforeserialize",[$form]);return(ret===false)?false:true},beforeSubmit:function(formData,form,options){var ret=vBulletin.contentEntryBox.validateForm.apply(form,[options]);if(ret===false){return false}$(window).off("beforeunload.editPost");window.vBulletin.loadingIndicator.show();return true},complete:function(){console.log("ajaxForm complete (vBulletin.conversation.editPost)")}})}},"json").error(function(xhr,textStatus,errorThrown){openAlertDialog({title:vBulletin.phrase.get("edit_conversation"),message:"HTTP {0} - {1}".format(xhr.status,errorThrown),iconType:"error"})}).complete(function(xhr,textStatus,errorThrown){window.vBulletin.loadingIndicator.hide()})};vBulletin.conversation.votePost=function(e){var nodeid=$(this).closest(".js-post").attr("data-node-id");$(".js-post[data-node-id="+nodeid+"] .js-post-control__vote").addClass("h-disabled");$("body").css("cursor","wait");if(!$(this).hasClass("voted")){$.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/reputation/vote",type:"post",data:{nodeid:nodeid},dataType:"json",success:function(response){if(response){if(response.errors){openAlertDialog({title:vBulletin.phrase.get("error_saving_vote"),message:vBulletin.phrase.get(response.errors[0]),iconType:"error"});$(".list-item[data-node-id="+nodeid+"] .js-post-control__vote").removeClass("h-disabled")}else{$(".js-post[data-node-id="+response.nodeid+"] .votecount").html(response.votes);$(".js-post[data-node-id="+nodeid+"] .js-post-control__vote").addClass("voted").removeClass("h-disabled").find(".b-post-control__label").text(vBulletin.phrase.get("unvote_cap")).end()}}},complete:function(){$("body").css("cursor","default")}})}else{$.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/reputation/unvote",type:"post",data:{nodeid:nodeid},dataType:"json",success:function(response){if(response){if(response.errors){openAlertDialog({title:vBulletin.phrase.get("error_saving_vote"),message:vBulletin.phrase.get(response.errors[0]),iconType:"error"});$(".js-post[data-node-id="+nodeid+"] .js-post-control__vote").removeClass("h-disabled")}else{$(".js-post[data-node-id="+response.nodeid+"] .votecount").html(response.votes);$(".js-post[data-node-id="+nodeid+"] .js-post-control__vote").removeClass("voted").removeClass("h-disabled").find(".b-post-control__label").text(vBulletin.phrase.get("vote_cap")).end()}}},complete:function(){$("body").css("cursor","default")}})}};vBulletin.conversation.showWhoVoted=function(e){var self=$(this);if($(this).hasClass("novotepopup")){return }var nodeid=self.closest(".js-post").attr("data-node-id");self.qtip({content:{title:{text:vBulletin.phrase.get("people_who_liked"),button:true},text:vBulletin.phrase.get("loading")+"...",ajax:{url:vBulletin.getAjaxBaseurl()+"/ajax/api/reputation/fetchWhovoted",type:"POST",data:{nodeid:nodeid},dataType:"json",once:false,success:function(data,status){if(data.errors){this.set("content.text",data.errors[0][0])}else{if(data.length<1){this.set("content.text",vBulletin.phrase.get("no_one_voted"))}else{var html="<ul>";for(x in data){var profileurl=pageData.baseurl+data[x].profileurl,avatarurl;if(!data[x].avatarurl){avatarurl=pageData.baseurl_core+"/image.php?u="+data[x].userid+"&type=profile"}else{avatarurl=pageData.baseurl_core+"/"+data[x].avatarurl}var img=$("<img>").attr("src",avatarurl).attr("alt",data[x].username),avatar=$("<a>").attr("href",profileurl).addClass("avatar"),username=$("<a>").attr("href",profileurl).addClass("username").html(data[x].musername),li=$("<li>"),usertitle=$("<div>").addClass("usertitle").html(data[x].usertitle);avatar.append(img);li.append(avatar);li.append(username);li.append(usertitle);html+=$("<div>").append(li).html()}html+="</ul>";this.set("content.text",html)}}},error:function(jqXHR,textStatus,errorThrown){this.set("content.text","failed to load.")}}},position:{my:"left top",at:"right top",viewport:$(window)},show:{event:"click"},hide:{event:"unfocus",fixed:true},style:{classes:"ui-tooltip-shadow ui-tooltip-light ui-tooltip-whovoted"}});self.qtip("api").show()};vBulletin.conversation.processPostContent=function($conversationList){$conversationList.css("border-bottom","").filter(".stream-view.activity-view").find(".list-item-poll form.poll").each(function(index,form){if($(this).is(":visible")&&$(".view-less-ctrl",this).hasClass("h-hide")){vBulletin.conversation.limitVisiblePollOptionsInAPost(this,3)}})};vBulletin.conversation.limitVisiblePollOptionsInAPost=function($pollForm,maxLines){if(typeof maxLines=="undefined"){maxLines=3}var lineCount=0,$pollOptionItems=$("ul.poll li",$pollForm),lh=parseInt($pollOptionItems.css("line-height"),10);$pollOptionItems.each(function(index){$(this).removeClass("h-hide");var h=$(this).height();lineCount+=h/lh;if(lineCount>maxLines){$(this).addClass("h-hide")}else{$(this).css("display","")}});if(lineCount>3){$(".view-more-ctrl",$pollForm).removeClass("h-hide").next(".action-buttons").addClass("h-hide").next(".view-less-ctrl").addClass("h-hide")}else{$(".view-more-ctrl",$pollForm).addClass("h-hide").next(".action-buttons").removeClass("h-hide").next(".view-less-ctrl").addClass("h-hide")}};vBulletin.conversation.bindEditFormEventHandlers=function(contentType){contentType=(contentType)?contentType.toLowerCase():"";if($.inArray(contentType,["text","gallery","video","poll","link","comment"])!=-1||contentType=="all"){var initializeEditor=function($container,activateEditModeCallback){if(typeof activateEditModeCallback=="function"){console.log("Edit mode: initializeEditor");var $bareEditor=$container.find(".js-editor");if($bareEditor.length>0){vBulletin.ckeditor.initEditor($bareEditor,{success:function(ckeditorId){if(typeof activateEditModeCallback=="function"){activateEditModeCallback();vBulletin.contentEntryBox.afterPanelChange($container);vBulletin.ckeditor.initEditorComponents($container);var editor=this;window.setTimeout(function(){console.log("Edit mode: Adding post data to CKEditor (vBulletin.conversation.bindEditFormEventHandlers)");editor.setData($bareEditor.prev(".js-editor-parsed-text").html());editor.focus()},0)}},error:function(ckeditorId){if(typeof activateEditModeCallback=="function"){activateEditModeCallback()}$bareEditor.prop("disabled",false).removeClass("ckeditor-load-on-focus").closest(".js-content-entry").addClass("b-content-entry--no-ckeditor")},hideLoadingDialog:false})}else{if(typeof activateEditModeCallback=="function"){activateEditModeCallback();$bareEditor.focus()}}}};var destroyEditor=function($container){var $bareEditor=$container.find(".js-editor");if($bareEditor.length>0){var editorId=$bareEditor.attr("id");if(vBulletin.ckeditor.editorExists(editorId)){vBulletin.ckeditor.destroyEditor(editorId)}}$bareEditor.closest("form").remove()};var bindCommentEditFormEventHandlers=function(){$("body").off("comment_editform_onload").on("comment_editform_onload",function(e,$container,activateEditModeCallback){if(typeof activateEditModeCallback=="function"){activateEditModeCallback();$(".js-editor",$container).focus().filter(".autogrow").elastic().off("blur.elastic")}}).off("comment_editform_onunload").on("comment_editform_onunload",function(e,$container){})};var bindTextEditFormEventHandlers=function(){$("body").off("text_editform_onload").on("text_editform_onload",function(e,$container,activateEditModeCallback){initializeEditor($container,activateEditModeCallback)}).off("text_editform_onunload").on("text_editform_onunload",function(e,$container){destroyEditor($container)}).off("text_newcontent_onload").on("text_newcontent_onload",function(e,$container){if($container.closest(".conversation-list.stream-view.activity-view").length>0){vBulletin.truncatePostContent($container)}})};var bindPollEditFormEventHandlers=function(){$("body").off("poll_editform_onload").on("poll_editform_onload",function(e,$container,activateEditModeCallback){initializeEditor($container,activateEditModeCallback)}).off("poll_editform_onunload").on("poll_editform_onunload",function(e,$container){destroyEditor($container)}).off("poll_newcontent_onload").on("poll_newcontent_onload",function(e,$container){if($container.closest(".conversation-list.stream-view.activity-view").length>0){vBulletin.truncatePostContent($container);vBulletin.conversation.limitVisiblePollOptionsInAPost($("form.poll",$container),3)}})};var bindGalleryEditFormEventHandlers=function(){$("body").off("gallery_editform_onload").on("gallery_editform_onload",function(e,$container,activateEditModeCallback){$('.b-toolbar__item[data-panel="b-content-entry-panel__content--gallery"]',$container).trigger("click");initializeEditor($container,function(){if(typeof activateEditModeCallback=="function"){activateEditModeCallback()}vBulletin.upload.initializePhotoUpload($container)})}).off("gallery_editform_onunload").on("gallery_editform_onunload",function(e,$container){destroyEditor($container)}).off("gallery_editform_onbeforeserialize").on("gallery_editform_onbeforeserialize",function(e,$form){$form.find(".caption-box").each(function(){var $input=$(this);if($input.hasClass("placeholder")&&$input.val()==$input.attr("placeholder")){$input.val("")}});return true}).off("gallery_newcontent_onload").on("gallery_newcontent_onload",function(e,$container){if($container.closest(".conversation-list.stream-view.activity-view").length>0){vBulletin.truncatePostContent($container)}})};var bindVideoEditFormEventHandlers=function(){$("body").off("video_editform_onload").on("video_editform_onload",function(e,$container,activateEditModeCallback){$('.b-toolbar__item[data-panel="b-content-entry-panel__content--video"]',$container).trigger("click");initializeEditor($container,function(){if(typeof activateEditModeCallback=="function"){activateEditModeCallback()}attachLinkContainerEvents($(".b-content-entry-panel__content--video",$container),"video")});$(".js-attach-button",$container).on("click",function(e){e.preventDefault();var self=$(this),$panel=self.closest(".b-content-entry-panel__content--video"),$urlBox=$(".b-link-input__url",$panel),url=$.trim($urlBox.val());if(!url){openAlertDialog({title:vBulletin.phrase.get("attach_video"),message:vBulletin.phrase.get("please_enter_video_url"),iconType:"warning",onAfterClose:function(){$urlBox.focus()}});return false}self.prop("disabled",true);$(".js-button-group .b-button",$panel).prop("disabled",true);$("body").css("cursor","wait");$.post(vBulletin.getAjaxBaseurl()+"/link/getlinkdata",{url:url,isAjaxTemplateRender:true},function(data){if(data.error){openAlertDialog({title:vBulletin.phrase.get("attach_video"),message:vBulletin.phrase.get(data.error),iconType:"warning",onAfterClose:function(){$urlBox.focus()}})}else{$template=$(data);$panel.find(".js-panel-content").append($template);attachLinkContainerEvents($panel,"video");$template.fadeIn("slow",function(){$urlBox.val("");$(".b-link-input",$panel).addClass("h-hide")});var $form=$container.closest("form");if($template.find("js-video-url")){$form.data("content-type","video")}else{$form.data("content-type","link")}}},"json").error(function(xhr,statusText,errorThrown){openAlertDialog({title:vBulletin.phrase.get("attach_video"),message:"HTTP {0} - {1}".format(xhr.status,errorThrown),iconType:"error"})}).complete(function(){$("body").css("cursor","default");self.prop("disabled",false);$(".js-button-group .b-button",$panel).prop("disabled",false)})})}).off("video_editform_onunload").on("video_editform_onunload",function(e,$container){destroyEditor($container)}).off("video_newcontent_onload").on("video_newcontent_onload",function(e,$container){if($container.closest(".conversation-list.stream-view.activity-view").length>0){vBulletin.truncatePostContent($container)}})};var bindLinkEditFormEventHandlers=function(){$("body").off("link_editform_onload").on("link_editform_onload",function(e,$container,activateEditModeCallback){$('.b-toolbar__item[data-panel="b-content-entry-panel__content--link"]',$container).trigger("click");initializeEditor($container,function(){if(typeof activateEditModeCallback=="function"){activateEditModeCallback()}attachLinkContainerEvents($(".b-content-entry-panel__content--link",$container),"link")});$(".js-attach-button",$container).on("click",function(e){e.preventDefault();var self=$(this),$panel=self.closest(".b-content-entry-panel__content--link"),$urlBox=$(".b-link-input__url",$panel),url=$.trim($urlBox.val());if(!url){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("please_enter_a_valid_url_and_click_attach"),iconType:"warning",onAfterClose:function(){$urlBox.focus()}});return false}if(!url.match(/^https?:\/\//)){url="http://"+url;$urlBox.val(url)}self.prop("disabled",true);$(".js-button-group .b-button",$panel).prop("disabled",true);$("body").css("cursor","wait");$.post(vBulletin.getAjaxBaseurl()+"/link/getlinkdata",{url:url,isAjaxTemplateRender:true},function(data){if(data.error){openAlertDialog({title:vBulletin.phrase.get("attach_link"),message:vBulletin.phrase.get(data.error),iconType:"warning",onAfterClose:function(){$urlBox.focus()}})}else{var $template=$(data);$template.find("img").error(function(){$(this).closest("li").remove()});$panel.find(".js-panel-content").append($template);attachLinkContainerEvents($panel,"link");$template.fadeIn("slow",function(){$urlBox.val("");$(".b-link-input",$panel).addClass("h-hide")});var $form=$container.closest("form");if($template.find("js-video-url")){$form.data("content-type","video")}else{$form.data("content-type","link")}}},"json").error(function(xhr,statusText,errorThrown){openAlertDialog({title:vBulletin.phrase.get("attach_link"),message:"HTTP {0} - {1}".format(xhr.status,errorThrown),iconType:"error"})}).complete(function(){$("body").css("cursor","default");self.prop("disabled",false);$(".js-button-group .b-button",$panel).prop("disabled",false)})})}).off("link_editform_onunload").on("link_editform_onunload",function(e,$container){destroyEditor($container)}).off("link_newcontent_onload").on("link_newcontent_onload",function(e,$container){if($container.closest(".conversation-list.stream-view.activity-view").length>0){vBulletin.truncatePostContent($container)}}).off("link_savepost_success").on("link_savepost_success",function(e,$container){$(".b-link-input",$container).removeClass("h-hide-imp")})};var attachLinkContainerEvents=function($panel,contentType){$(".b-link-content__urlinfo .js-link-edit",$panel).on("click",function(e){e.preventDefault();var $parent=$(this).parent().parent();$parent.addClass("b-link-content__urlinfo-meta--edit-mode");$(".js-link-textbox",$parent).val($.trim($(".b-link-content__urlinfo-text",$parent).text())).trigger("focus");$(".js-link-save",$parent).on("click",function(e){e.preventDefault();$(".b-link-content__urlinfo-text",$parent).text($(".js-link-textbox",$parent).val());$parent.removeClass("b-link-content__urlinfo-meta--edit-mode")})});$(".js-link-remove",$panel).on("click",function(e){e.preventDefault();$(this).closest(".b-content-entry-panel__content").find(".b-link-input").removeClass("h-hide");$(this).closest(".js-panel-content").empty();$(".b-link-input",$panel).removeClass("h-hide")});if(contentType=="link"){$(".js-link-preview-checkbox",$panel).off("click").on("click",function(){$(".b-link-content__thumbnail",$panel)[this.checked?"addClass":"removeClass"]("h-hide")});var thumbnailCount=$(".b-link-thumbnail-list__item",$panel).length;$(".b-link-thumbnail-list",$panel).jcarousel({scroll:1,wrap:null,size:thumbnailCount,rtl:$("html").attr("dir")=="rtl",buttonNextCallback:function(carousel,button,enabled){if(enabled){$(".b-thumbnail-nav .b-thumbnail-nav__next-arrow",$panel).removeClass("b-icon__arrow-right-m--disabled").addClass("b-icon__arrow-right-m--default")}else{$(".b-thumbnail-nav .b-thumbnail-nav__next-arrow",$panel).addClass("b-icon__arrow-right-m--disabled").removeClass("b-icon__arrow-right-m--default")}},buttonPrevCallback:function(carousel,button,enabled){if(enabled){$(".b-thumbnail-nav .b-thumbnail-nav__prev-arrow",$panel).removeClass("b-icon__arrow-left-m--disabled").addClass("b-icon__arrow-left-m--default")}else{$(".b-thumbnail-nav .b-thumbnail-nav__prev-arrow",$panel).addClass("b-icon__arrow-left-m--disabled").removeClass("b-icon__arrow-left-m--default")}},initCallback:function(carousel,state){if(state=="init"&&thumbnailCount>0){$(".b-thumbnail-nav .b-thumbnail-nav__counter",$panel).html("1/"+thumbnailCount);$(".b-thumbnail-nav .b-thumbnail-nav__prev-arrow",$panel).off("click").on("click",function(){if(!$(this).hasClass("b-icon__arrow-left-m--disabled")){$(".jcarousel-container .jcarousel-prev",$panel).trigger("click")}});$(".b-thumbnail-nav .b-thumbnail-nav__next-arrow",$panel).off("click").on("click",function(){if(!$(this).hasClass("b-icon__arrow-right-m--disabled")){$(".jcarousel-container .jcarousel-next",$panel).trigger("click")}})}},itemVisibleInCallback:function(carousel,item,index,state){if(state=="init"){return false}$(".b-thumbnail-nav .b-thumbnail-nav__counter",$panel).html(index+"/"+thumbnailCount);$('input[type="radio"]',item).prop("checked",true)},itemFallbackDimension:90})}};switch(contentType){case"text":bindTextEditFormEventHandlers();break;case"comment":bindCommentEditFormEventHandlers();break;case"poll":bindPollEditFormEventHandlers();break;case"gallery":bindGalleryEditFormEventHandlers();break;case"video":bindVideoEditFormEventHandlers();break;case"link":bindLinkEditFormEventHandlers();break;case"all":bindTextEditFormEventHandlers();bindCommentEditFormEventHandlers();bindPollEditFormEventHandlers();bindGalleryEditFormEventHandlers();bindVideoEditFormEventHandlers();bindLinkEditFormEventHandlers();break}}};vBulletin.isScrolledIntoView=function(elem,elemRelativePos){var isPlainObject=false;if($.isPlainObject(elemRelativePos)&&(elemRelativePos).toString()=="[object Object]"){isPlainObject=true;elemRelativePos.top=0;elemRelativePos.bottom=0}elem=(elem instanceof $)?elem:$(elem);if(elem.length==0){return false}var docViewTop=$(window).scrollTop(),docViewBottom=docViewTop+$(window).height(),elemTop=elem.offset().top,elemBottom=elemTop+elem.outerHeight(),elemRelativeTop=elemTop-docViewTop,elemRelativeBottom=docViewBottom-elemBottom;if(isPlainObject){elemRelativePos.top=elemRelativeTop;elemRelativePos.bottom=elemRelativeBottom}return(elemRelativeTop>=0&&elemRelativeBottom>=0)};vBulletin.scrollToFixed=function(userOptions){var self=this,options={element:$(),fixedAt:"top",limit:0,triggerOnload:true,zIndex:99},namespace=("scrollToFixed"+Math.random()).replace(".","");function init(userOptions){options=$.extend({},options,userOptions);if(options.element){options.element=(options.element instanceof $)?options.element:$(options.element);if(options.element.length>0){if($.inArray(options.fixedAt,["top","bottom"])){options.fixedAt="top"}var $el=options.element,fixedClass="scrolltofixed",origLayout={width:$el.width(),offset:$el.offset(),"margin-top":parseInt($el.css("margin-top"),10),"margin-bottom":parseInt($el.css("margin-bottom"),10),cssPosition:$el.css("position"),coordinates:{left:$el.css("left"),top:$el.css("top"),right:$el.css("right"),bottom:$el.css("bottom")}};if(typeof $Rx!=="undefined"){var scrollToFixedBreakPoint=($Rx&&$Rx.scrollToFixedBreakPoint)?$Rx.scrollToFixedBreakPoint:0;var $filler=$("<div />");if($("#vb-page-body").width()>scrollToFixedBreakPoint){$filler.addClass("scrolltofixed-filler").hide().insertAfter($el)}}$el.data("origOffsetTop",origLayout.offset.top);$el.css("z-index",options.zIndex);$el.data("object-instance",self);var $w=$(window).off("scroll."+namespace).on("scroll."+namespace,function(){if($el.is(":hidden")){return }var scrollTop=$(this).scrollTop();if(options.limit>0&&scrollTop>options.limit&&$el.hasClass(fixedClass)){$el.removeClass(fixedClass).css({position:"absolute",left:"auto",right:"auto",top:"auto",bottom:"auto",width:origLayout.width})}else{if((options.limit>0&&scrollTop<options.limit&&scrollTop>origLayout.offset.top&&!$el.hasClass(fixedClass))||(options.limit<=0&&scrollTop>origLayout.offset.top&&!$el.hasClass(fixedClass))){$filler.css({display:$el.css("display"),width:$el.outerWidth(true),height:$el.outerHeight(true),"float":$el.css("float")});if($("#vb-page-body").width()>scrollToFixedBreakPoint){$el.addClass(fixedClass).width(origLayout.width).css({left:origLayout.offset.left,right:"auto",width:origLayout.width,top:(options.fixedAt=="top")?0:"auto",bottom:(options.fixedAt=="bottom")?0:"auto",position:""})}var margin=origLayout["margin-"+options.fixedAt];if(margin){var props={};props[options.fixedAt]=-margin+"px";$el.animate(props,"fast")}}else{if(scrollTop<=origLayout.offset.top&&$el.hasClass(fixedClass)){$filler.hide();$el.removeClass(fixedClass).css({position:"",width:"",left:"",top:"",right:"",bottom:""})}}}}).off("resize."+namespace).on("resize."+namespace,function(){$el.removeClass(fixedClass).width("auto").css({position:"",left:""});origLayout.width=$el.width();origLayout.offset=$el.offset();$(this).trigger("scroll."+namespace)});if(options.triggerOnload){$w.trigger("scroll."+namespace)}}}}this.updateLimit=function(limit){if(!isNaN(Number(limit))){options.limit=limit;$(window).trigger("scroll."+namespace)}};this.addLimit=function(limitToAdd){if(!isNaN(Number(limitToAdd))){options.limit+=limitToAdd;$(window).trigger("scroll."+namespace)}};this.reset=function(options){init(options)};init(userOptions)};vBulletin.scrollToAnchor=function(hash){var $anchor=$(hash);console.log("vBulletin.scrollToAnchor() hash: {0}, found: {1}".format(hash,$anchor.length));if($anchor.length>0){var offsetTop=$anchor.show().offset().top-2;$anchor.hide();var $root=$("html,body"),floatingTopBar=$(".scrolltofixed-floating.scrolltofixed-top"),starter=false;if(floatingTopBar.length>0){if($(".list-container .list-item:first a.anchor"+hash).length==1){if(floatingTopBar.hasClass("scrolltofixed")){floatingTopBar.removeClass("scrolltofixed")}offsetTop=floatingTopBar.offset().top;starter=true}else{if(floatingTopBar.hasClass("scrolltofixed")){offsetTop-=floatingTopBar.outerHeight()}}}$root.animate({scrollTop:offsetTop},1000,function(){if(!starter){var offsetTop=$anchor.show().offset().top;$anchor.hide();var floatingTopBar=$(".scrolltofixed-floating.scrolltofixed-top.scrolltofixed");offsetTop-=(floatingTopBar.length>0)?floatingTopBar.outerHeight():0;$root.animate({scrollTop:offsetTop},"slow")}$("a.anchor").show()});return false}$("a.anchor").show();return true};if(location.hash){vBulletin.scrollToAnchor(location.hash)}vBulletin.animateScrollTop=function(offsetTop,animationOptions){console.log("vBulletin.animateScrollTop({0})".format(offsetTop));var $floatingTopBar=$(".scrolltofixed-floating.scrolltofixed-top");if($floatingTopBar.length>0){var offsetTopFloatingBar=$floatingTopBar.data("origOffsetTop")||$floatingTopBar.offset().top;if(!$floatingTopBar.hasClass("scrolltofixed")&&offsetTopFloatingBar<offsetTop){offsetTop-=$floatingTopBar.outerHeight(true)}if(offsetTopFloatingBar<offsetTop){offsetTop-=$floatingTopBar.outerHeight()}}$("html, body").animate({scrollTop:offsetTop},animationOptions)};vBulletin.truncatePostContent=function($context){$context=($context instanceof $)?$context:$($context);if($context.selector==""){$context=$("body")}$(".poll-desc.ellipsis, .message-body.ellipsis",$context).each(function(){var $content=$(this);truncatedHeight=$content.height();$content.removeClass("ellipsis");var actualHeight=$content.height();$content.addClass("ellipsis");if(actualHeight>truncatedHeight){$content.closest(".list-item-body").find(".post-links").removeClass("hide-see-link").find(".see-link").off("click").on("click",function(){var $self=$(this);if($self.hasClass("more")){$content.removeClass("ellipsis")}else{$content.addClass("ellipsis")}$self.toggleClass("more less");var currentText=$self.text();$self.text($self.data("toggle-text")).data("toggle-text",currentText);return false})}});$(".list-item .see-link.more").each(function($e){var container=$(this).closest(".list-item"),contentBlock=$(container).find(".post-content.restore");if(contentBlock.length>0){var full=false,loaded=false,defaultText=$(this).text(),fullText="",preview=$(contentBlock).html(),linkShowmore=this;$(this).on("click",function(){nodeid=$(container).attr("data-node-id");if(full){$(linkShowmore).text(defaultText);$(contentBlock).html(preview);full=false}else{if(loaded){$(linkShowmore).text(vBulletin.phrase.get("see_less"));full=true;$(contentBlock).html(fullText)}else{if(!loaded&&nodeid){$.ajax({url:vBulletin.getAjaxBaseurl()+"/activity/fetchText",data:{nodeid:nodeid},dataType:"json",complete:function(){},success:function(result){if(result&&!result.error&&result.nodeText){fullText=result.nodeText;if(fullText.length<=preview.length){$(linkShowmore).addClass("ui-helper-hidden");postLink=$(linkShowmore).closest(".post-links").html().replace("<span>|</span>","");$(linkShowmore).closest(".post-links").html(postLink)}else{$(contentBlock).html(result.nodeText);$(linkShowmore).text(vBulletin.phrase.get("see_less"));console.log("loaded content for node "+nodeid);full=true;loaded=true;return false}}},error:function(xhr,statusText,errorThrown){console.log("Attempt to load text for node "+nodeid+" failed:"+errorThrown)}})}}}return false})}})};vBulletin.markreadcheck=function(){if((parseInt(pageData.threadmarking)>0)&&(parseInt(pageData.userid)>0)){return }var lastvisit=$.cookie(pageData.cookie_prefix+"lastvisit");if(parseInt(pageData.userid)>0&&(!lastvisit||pageData.lastvisit>lastvisit)){lastvisit=pageData.lastvisit}var timenow=Math.round(new Date().getTime()/1000),markinglimittime=timenow-vBulletin.options.get("markinglimit")*86400;$(".forum-item").each(function(){var lastcontent=parseInt($(this).attr("data-lastcontent")),channelview=0;if(lastcontent<=lastvisit){$(this).removeClass("new");return }channelview=vBulletin.cookie.fetchBbarrayCookie("channel_view",$(this).attr("data-channel-id"));channelview=channelview?parseInt(channelview):0;$(this).toggleClass("new",(lastcontent>channelview))});$(".subforum-item").each(function(){var lastcontent=parseInt($(this).attr("data-lastcontent")),channelview=0;if(lastcontent<=lastvisit){$(this).removeClass("new").find(".icon").removeClass("new");return }channelview=vBulletin.cookie.fetchBbarrayCookie("channel_view",$(this).attr("data-channel-id"));channelview=channelview?parseInt(channelview):0;$(this).toggleClass("new",(lastcontent>channelview)).find(".icon").toggleClass("new",(lastcontent>channelview))});$(".topic-item").each(function(){var lastcontent=parseInt($(this).attr("data-lastcontent")),topicview=0,channelview=0,checkview=0;if(pageData.userid=="0"){if(lastcontent<=lastvisit){$(this).addClass("read");return }channelview=vBulletin.cookie.fetchBbarrayCookie("channel_view",$(this).attr("data-channel-id"));channelview=channelview?parseInt(channelview):0;topicview=vBulletin.cookie.fetchBbarrayCookie("discussion_view",$(this).attr("data-node-id"));topicview=topicview?parseInt(topicview):0;checkview=Math.max(channelview,topicview)}else{checkview=$(this).attr("data-readtime")?parseInt($(this).attr("data-readtime")):0;channelview=$(this).attr("data-channelreadtime")?parseInt($(this).attr("data-channelreadtime")):0;checkview=Math.max(checkview,channelview,markinglimittime)}if(lastcontent<=checkview||$(this).hasClass("redirect")){$(this).addClass("read")}else{if($(this).find(".topic-wrapper .go-to-first-unread").length==0){var topicUrl=$(this).find(".topic-wrapper .topic-title").attr("href");if(typeof (topicUrl)!="undefined"){topicUrl+=(topicUrl.indexOf("?")==-1?"?":"&amp;")+"goto=newpost";$("<a />").addClass("go-to-first-unread").attr("href",topicUrl).attr("title",vBulletin.phrase.get("go_to_first_new_post")).html("&nbsp;").prependTo($(this).find(".topic-wrapper"));$(this).find(".vb-icon-topic-status").attr("title",vBulletin.phrase.get("new_posts"))}}}})};vBulletin.markchannelsread=function(channelid,callbacks,sender){channelids=[];if(parseInt(channelid)){vBulletin.setChannelRead(channelid,callbacks)}else{if(pageData.channelid&&parseInt(pageData.channelid)&&parseInt(pageData.threadmarking)>0&&parseInt(pageData.userid)>0){vBulletin.setChannelRead(pageData.channelid,callbacks)}else{channels=$(sender).closest(".widget-content").find(".forum-list-container .forum-item");subchannels=$(sender).closest(".widget-content").find(".forum-list-container .subforum-item");result=false;var addChannelIds=function(index,channel){var channelid=parseInt($(channel).attr("data-channel-id"),10);if(channelid){channelids.push(channelid)}};$.each(channels,addChannelIds);$.each(subchannels,addChannelIds)}}$.each(channelids,function(index,channelid){if(index>=channelids.length-1){vBulletin.setChannelRead(channelid,callbacks)}else{vBulletin.setChannelRead(channelid,[])}})};vBulletin.setChannelRead=function(channelid,callbacks){var timenow=Math.round(new Date().getTime()/1000);if(pageData.threadmarking=="0"||!parseInt(pageData.userid)){if(channelid==0){$.cookie(pageData.cookie_prefix+"lastvisit",timenow)}else{var channelviews;try{channelviews=$.parseJSON(vBulletin.cookie.convertBbarrayCookie($.cookie(pageData.cookie_prefix+"channel_view")))||{}}catch(e){channelviews={}}channelviews[channelid]=timenow;var cookieoptions={path:pageData.cookie_path,domain:pageData.cookie_domain};cookieoptions.expires=365;$.cookie(pageData.cookie_prefix+"channel_view",vBulletin.cookie.convertBbarrayCookie(JSON.stringify(channelviews),"set"),cookieoptions)}if(callbacks.success&&typeof callbacks.success=="function"){callbacks.success()}}else{$.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/node/markChannelsRead",data:{nodeid:channelid},type:"POST",dataType:"json",complete:function(){},success:function(result){if(result&&!result.error){console.log("Channel "+channelid+" is marked read successfully!")}if(callbacks.success&&typeof callbacks.success=="function"){callbacks.success(result)}else{console.log("Channel "+channelid+" is marked read failed: "+result.error)}},error:function(xhr,statusText,errorThrown){console.log("Channel "+channelid+" is marked read failed:"+error);openAlertDialog({title:vBulletin.phrase.get("forum"),message:"HTTP {0} - {1}".format(xhr.status,errorThrown),iconType:"error"})}})}return true};vBulletin.ckeditor=vBulletin.ckeditor||{};window.CKEDITOR_BASEPATH=pageData.baseurl+"/js/ckeditor/";vBulletin.ckeditor.requiredScriptsLoaded=false;vBulletin.ckeditor.requiredScriptsLoadFailed=false;vBulletin.ckeditor.requiredScriptLoadingStarted=false;vBulletin.ckeditor.checkEnvironment=function(){var agent=navigator.userAgent.toLowerCase();var opera=window.opera;var env={ie:eval("/*@cc_on!@*/false"),opera:(!!opera&&opera.version),webkit:(agent.indexOf(" applewebkit/")>-1),air:(agent.indexOf(" adobeair/")>-1),mac:(agent.indexOf("macintosh")>-1),quirks:(document.compatMode=="BackCompat"),mobile:(agent.indexOf("mobile")>-1),iOS:/(ipad|iphone|ipod)/.test(agent)};env.gecko=(navigator.product=="Gecko"&&!env.webkit&&!env.opera);if(env.webkit){if(agent.indexOf("chrome")>-1){env.chrome=true}else{env.safari=true}}var version=0;if(env.ie){if(env.quirks||!document.documentMode){version=parseFloat(agent.match(/msie (\d+)/)[1])}else{version=document.documentMode}env.ie9Compat=version==9;env.ie8Compat=version==8;env.ie7Compat=version==7;env.ie6Compat=version<7||env.quirks}if(env.gecko){var geckoRelease=agent.match(/rv:([\d\.]+)/);if(geckoRelease){geckoRelease=geckoRelease[1].split(".");version=geckoRelease[0]*10000+(geckoRelease[1]||0)*100+(geckoRelease[2]||0)*1}}if(env.opera){version=parseFloat(opera.version())}if(env.air){version=parseFloat(agent.match(/ adobeair\/(\d+)/)[1])}if(env.webkit){version=parseFloat(agent.match(/ applewebkit\/(\d+)/)[1])}env.version=version;env.isCompatible=!env.mobile&&((env.ie&&version>6)||(env.gecko&&version>=10801)||(env.opera&&version>=9.5)||(env.air&&version>=1)||(env.webkit&&version>=522)||false);return env.isCompatible};vBulletin.ckeditor.fireCallbacks=function(editorId,options,status,context){if(status=="error"&&typeof options.error=="function"){options.error(editorId)}if(status=="success"&&typeof options.success=="function"){options.success.apply(context,[editorId,context])}if(typeof options.complete=="function"){options.complete(editorId)}};vBulletin.ckeditor.initEditor=function(editorId,options){options=options||{};editorId=vBulletin.ckeditor.verifyEditorId(editorId);console.log("Ckeditor: initEditor({0})".format(editorId));if(!vBulletin.ckeditor.checkEnvironment()){$("#"+editorId).closest(".b-content-entry").find("li[data-panel=b-content-entry-panel__content--toggle-editor]").addClass("h-hide");vBulletin.ckeditor.fireCallbacks(editorId,options,"error");return }if(vBulletin.ckeditor.requiredScriptsLoaded){vBulletin.ckeditor.doInitEditor(editorId,options)}else{vBulletin.ckeditor.loadScripts(editorId,options)}};vBulletin.ckeditor.loadScripts=function(editorId,options,jsloaded){if(vBulletin.ckeditor.requiredScriptLoadingStarted){console.warn("Ckeditor: Trying to load required scripts more than once.");return }vBulletin.ckeditor.requiredScriptLoadingStarted=true;options=options||{};editorId=editorId||"";if(typeof (options.hideLoadingDialog)!=="undefined"&&!options.hideLoadingDialog){vBulletin.ckeditor.showLoadingDialog(editorId)}var fetchScriptError=function(){if(options.showError||!vBulletin.ckeditor.requiredScriptsLoadFailed){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_loading_ckeditor_script"),iconType:"warning"})}vBulletin.loadingIndicator.hide();vBulletin.ckeditor.requiredScriptsLoadFailed=true;vBulletin.ckeditor.fireCallbacks(editorId,options,"error")};var onCkeditorScriptLoad=function(){if(!vBulletin.ckeditor.requiredScriptsLoadFailed){if(typeof jsloaded=="function"){jsloaded()}if(typeof vBulletin.ckeditor.doInitEditor=="function"&&window.CKEDITOR){vBulletin.ckeditor.requiredScriptsLoaded=true;vBulletin.ckeditor.doInitEditor(editorId,options)}else{setTimeout(onCkeditorScriptLoad,10)}}else{vBulletin.ckeditor.fireCallbacks(editorId,options,"error");if(!options.hideLoadingDialog){vBulletin.ckeditor.hideLoadingDialog(editorId)}}};if(typeof vBulletin.ckeditor.doInitEditor!="function"&&!window.CKEDITOR){vBulletin.AJAX({url:vBulletin.getAjaxBaseurl()+"/ajax/render/ckeditor_javascript",success:function(result){var scripts=[];var src_regex=/src="([^"]+)"/g;while(match=src_regex.exec(result)){scripts.push(match[1])}var fetchScript=function(){if(scripts.length>0){console.log("Ckeditor: Calling getScript for: {0}".format(scripts[0]));$.getScript(scripts[0],function(script,textStatus,jqXHR){if(textStatus!="success"){console.warn("Ckeditor: Error loading "+scripts[0]);fetchScriptError();return false}console.log("Ckeditor: Script loaded: "+scripts[0]);scripts.splice(0,1);fetchScript()}).fail(function(jqXHR,errorType,exception){console.warn("Ckeditor: Error loading script: "+errorType+" Exception: "+exception);fetchScriptError()})}else{onCkeditorScriptLoad()}};fetchScript()},error_phrase:"error_fetching_dialog"})}else{onCkeditorScriptLoad()}};vBulletin.ckeditor.editorExists=function(editorId){return false};vBulletin.ckeditor.isEditorEmpty=function(editorId){return true};vBulletin.ckeditor.resetEditor=function(editorId){return false};vBulletin.ckeditor.getEditorContent=function(editorId){editorId=vBulletin.ckeditor.verifyEditorId(editorId);if(!editorId){return false}if(vBulletin.ckeditor.editorExists(editorId)){var ckEditor=vBulletin.ckeditor.getEditor(editorId);if(ckEditor&&ckEditor.getData){return $.trim(ckEditor.getData())}else{return false}}else{return $.trim($("#"+editorId).val())}};vBulletin.ckeditor.focusEditor=function(editorId){editorId=vBulletin.ckeditor.verifyEditorId(editorId);if(!editorId){return }if(vBulletin.ckeditor.editorExists(editorId)){var ckEditor=vBulletin.ckeditor.getEditor(editorId);if(ckEditor){ckEditor.focus()}}else{$("#"+editorId).focus()}};vBulletin.ckeditor.loadingDialogStack={};vBulletin.ckeditor.showLoadingDialog=function(editorId){if((typeof vBulletin.ckeditor.loadingDialogStack[editorId]!="undefined")&&vBulletin.ckeditor.loadingDialogStack[editorId]){return }vBulletin.ckeditor.loadingDialogStack[editorId]=true;var $domElement=$("#"+editorId);if($domElement.length>0&&$domElement.is(":visible")){$domElement.prop("disabled",true)}window.vBulletin.loadingIndicator.show("vBulletin.ckeditor.showLoadingDialog editorId: "+editorId)};vBulletin.ckeditor.hideLoadingDialog=function(editorId){if((typeof vBulletin.ckeditor.loadingDialogStack[editorId]=="undefined")||!vBulletin.ckeditor.loadingDialogStack[editorId]){return }vBulletin.ckeditor.loadingDialogStack[editorId]=false;$("#"+editorId).prop("disabled",false);window.vBulletin.loadingIndicator.hide("vBulletin.ckeditor.hideLoadingDialog editorId: "+editorId)};vBulletin.ckeditor.generatedIdCounter=0;vBulletin.ckeditor.verifyEditorId=function(editorId){editorId=editorId||"";if(typeof editorId=="string"){return editorId}else{var $el=editorId instanceof $?editorId:$(editorId);if(!$el.attr("id")){++vBulletin.ckeditor.generatedIdCounter;$el.attr("id",("vb-cke-instance-"+vBulletin.ckeditor.generatedIdCounter))}return $el.attr("id")}};vBulletin.ckeditor.initEditorComponents=function(context,ckeditorOnly){context=context||document;$(function(){$(".js-ckeditor-init-on-focus",context).off("focus").on("focus",function(){vBulletin.ckeditor.initEditor($(this))});$(".js-ckeditor-init-on-page-load",context).each(function(){vBulletin.ckeditor.initEditor($(this))});if(ckeditorOnly){return }(function(){var getIconUrl=function(iconId){return $(".js-content-entry-post-icons option",context).filter(function(){return($(this).val()==iconId)}).data("icon-url")};var getIconElement=function(iconId){if(iconId==0){return $("<span />").html(vBulletin.phrase.get("no_icon")).get(0)}var iconUrl=getIconUrl(iconId);if(iconUrl){return $("<img />").attr("src",iconUrl).attr("alt","").get(0)}else{return""}};$(".js-content-entry-post-icons",context).selectBox().change(function(){var iconId=$(this).val();$(".js-content-entry-post-icons.selectBox-dropdown .selectBox-label",context).html(getIconElement(iconId))});$(".js-content-entry-post-icons-selectBox-dropdown-menu li a",context).each(function(){var iconId=$(this).attr("rel");$(this).html(getIconElement(iconId))});$(".js-content-entry-post-icons",context).trigger("change")})();$(".js-content-entry-prefixes",context).selectBox();var elementsToHide=[];$(".js-select-box",context).each(function(){var $select=$(this),$el;if($select.is(":hidden")){$el=$select.closest(".h-hide");elementsToHide.push($el);$el.removeClass("h-hide")}$select.selectBox()});$.each(elementsToHide,function(idx,$el){$el.addClass("h-hide")})})};vBulletin.ckeditor.initEditorComponents(document);$(".js-focus-on-page-load").first().focus();vBulletin.errorAlert=function(title,message){console.log(title,message);openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get(vBulletin.phrase.get(message)),iconType:"error"})};vBulletin.makeErrorAlertCallback=function(title,message){return(function(){vBulletin.errorAlert(title,message)})};vBulletin.AJAX=function(ajaxOptions){var defaultOptions={type:"post",dataType:"json",title_phrase:"error",error_phrase:"error",element:null};$.extend(defaultOptions,ajaxOptions);if(!defaultOptions.error){defaultOptions.error=vBulletin.makeErrorAlertCallback(defaultOptions.title_phrase,defaultOptions.error_phrase)}defaultOptions.success=function(response){if(!response){vBulletin.errorAlert(defaultOptions.title_phrase,"invalid_server_response_please_try_again")}else{if(response&&response.errors){var error=response.errors;if($.isArray(error)&&error.length>0){error=error[0]}if(error=="inlinemodauth_required"){return vBulletin.inlinemod.openAuthDialog(defaultOptions.element)}vBulletin.errorAlert(defaultOptions.title_phrase,["error_x",vBulletin.phrase.get(error)]);if(response.wasNotArray){arguments[0]=arguments[0][0]}return false}else{if(ajaxOptions.success){ajaxOptions.success.apply(this,arguments)}}}};$.ajax(defaultOptions)};vBulletin.ajaxForm=function(ajaxOptions){var defaultOptions={dataType:"json",title_phrase:"error",error_phrase:"error",element:null,complete:function(){$(".button[type=submit]",this).prop("disabled",false)},beforeSerialize:function($form){$(".placeholder",$form).each(function(){var $input=$(this);if($input.val()==$input.attr("placeholder")){$input.val("")}})},beforeSubmit:function(formData,form,options){$(".button[type=submit]",this).prop("disabled",true);return true}};$.extend(defaultOptions,ajaxOptions);if(!defaultOptions.error){defaultOptions.error=vBulletin.makeErrorAlertCallback(defaultOptions.title_phrase,defaultOptions.error_phrase)}defaultOptions.success=function(response){if(response&&response.errors){var error=response.errors;if($.isArray(error)&&error.length>0){error=error[0]}if(error=="inlinemodauth_required"){return vBulletin.inlinemod.openAuthDialog(defaultOptions.element)}vBulletin.errorAlert(defaultOptions.title_phrase,["error_x",vBulletin.phrase.get(error)]);if(response.wasNotArray){arguments[0]=arguments[0][0]}return false}else{if(ajaxOptions.success){ajaxOptions.success.apply(this,arguments)}}};this.ajaxForm(defaultOptions)};window.openAlertDialog=function(params){var $alertDialog=$("#alert-dialog");params=params||{};if(!$alertDialog.data("created")){$alertDialog.dialog({autoOpen:false,modal:true,resizable:false,closeOnEscape:false,showCloseButton:false,dialogClass:"dialog-container alert-dialog-container dialog-box",create:function(){$alertDialog.data("created",true)}})}$alertDialog.dialog("option","width",params.width||500);$alertDialog.dialog("option","title",params.title||"Alert");var $dialogContent=$alertDialog.find(".dialog-content");var $message=$dialogContent.find(".message");var $icon=$dialogContent.find(".icon");var $okButton=$("#btnAlertDialogOK");if(params.maxHeight){$dialogContent.css({"max-height":params.maxHeight,overflow:"auto"})}else{$dialogContent.css({"max-height":"",overflow:""})}if(params.message){$message.html(params.message)}$icon.removeClass(function(index,css){return(css.match(/\S+-icon\b/g)||[]).join(" ")});params.buttonLabel=params.buttonLabel||"OK";$okButton.html(params.buttonLabel);$alertDialog.off("dialogopen").on("dialogopen",function(){$okButton.off("click").on("click",function(){if(typeof params.onBeforeClose=="function"){params.onBeforeClose.apply(this)}$alertDialog.dialog("close")}).focus()});$alertDialog.off("dialogclose").on("dialogclose",function(){if(typeof params.onAfterClose=="function"){params.onAfterClose.apply($okButton)}});switch(params.iconType){case"warning":$icon.addClass("warning-icon vb-icon vb-icon-warning");$icon.show();break;case"error":$icon.addClass("error-icon vb-icon vb-icon-error");$icon.show();break;default:$icon.addClass("no-icon").hide()}$alertDialog.dialog("open");return $alertDialog};window.openConfirmDialog=function(params){params=params||{};var $confirmDialog=$("#confirm-dialog");if(!$confirmDialog.data("created")){$confirmDialog.dialog({autoOpen:false,modal:true,resizable:false,closeOnEscape:false,showCloseButton:false,create:function(){$confirmDialog.data("created",true)}})}$confirmDialog.dialog("option","title",params.title||"Confirmation");var $dialogContent=$confirmDialog.find(".dialog-content");var $message=$dialogContent.find(".message");var $icon=$dialogContent.find(".icon");if(params.message){$message.html(params.message.replace("\n","<br />"))}$confirmDialog.dialog("option","width",(params.width?params.width:500));$confirmDialog.dialog("option","dialogClass","dialog-container confirm-dialog-container dialog-box "+(params.dialogClass||""));$icon.removeClass(function(index,css){return(css.match(/\S+-icon\b/g)||[]).join(" ")});params.buttonLabel=params.buttonLabel||{};params.buttonLabel.yesLabel=params.buttonLabel.yesLabel||vBulletin.phrase.get("yes");params.buttonLabel.noLabel=params.buttonLabel.noLabel||vBulletin.phrase.get("no");var yesButton=$("#btnConfirmDialogYes").html(params.buttonLabel.yesLabel);var noButton=$("#btnConfirmDialogNo").html(params.buttonLabel.noLabel);if(params.primaryButton=="yes"){yesButton.addClass("primary").removeClass("secondary");noButton.addClass("secondary").removeClass("primary")}else{noButton.addClass("primary").removeClass("secondary");yesButton.addClass("secondary").removeClass("primary")}var btn;$confirmDialog.off("dialogopen").on("dialogopen",function(){var yesButton=$("#btnConfirmDialogYes").off("click").on("click",function(){btn=this;var retYes,retClose;if(typeof params.onClickYes=="function"){retYes=params.onClickYes.apply(this);if(typeof params.onClickYesWithAjax!="undefined"&&params.onClickYesWithAjax){return false}}if(retYes===false){return false}if(typeof params.onBeforeClose=="function"){retClose=params.onBeforeClose.apply(this);if(typeof params.onBeforeCloseWithAjax!="undefined"&&params.onBeforeCloseWithAjax){return false}}if(retClose===false){return false}$confirmDialog.dialog("close")});if(params.defaultFocus=="yes"){yesButton.focus()}var noButton=$("#btnConfirmDialogNo").off("click").on("click",function(){btn=this;if(typeof params.onClickNo=="function"){params.onClickNo.apply(this)}if(typeof params.onBeforeClose=="function"){params.onBeforeClose.apply(this)}$confirmDialog.dialog("close")});if(params.defaultFocus!="yes"){noButton.focus()}});$confirmDialog.off("dialogclose").on("dialogclose",function(e,ui){if(typeof params.onAfterClose=="function"){params.onAfterClose.apply(btn)}});switch(params.iconType){case"warning":$icon.addClass("warning-icon vb-icon vb-icon-warning");$icon.show();break;case"question":$icon.addClass("question-icon");$icon.show();break;default:$icon.addClass("no-icon").hide()}$confirmDialog.dialog("open");return $confirmDialog};window.openPromptDialog=function(params){var $promptDialog=$("#prompt-dialog");if(!$promptDialog.data("created")){$promptDialog.dialog({autoOpen:false,modal:true,resizable:false,closeOnEscape:false,showCloseButton:false,width:500,dialogClass:"dialog-container prompt-dialog-container dialog-box",create:function(){$promptDialog.data("created",true)}})}params=params||{};$promptDialog.dialog("option","title",params.title||"Prompt");var $dialogContent=$promptDialog.find(".dialog-content"),$message=$dialogContent.find(".message"),$input;if(params.message){$message.html(params.message)}var inputVal=params.initialValue||"";if(!params.multiline){$input=$promptDialog.find("input.input-box").val(inputVal).removeClass("h-hide");$input.next().addClass("h-hide");if(Number(params.maxlength)){$input.attr("maxlength",Number(params.maxlength))}else{$input.removeAttr("maxlength")}$dialogContent.addClass("table");$dialogContent.find("> div").addClass("td")}else{$input=$promptDialog.find("textarea.input-box").val(inputVal).removeClass("h-hide");$input.prev().addClass("h-hide");$dialogContent.removeClass("table");$dialogContent.find("> .td").removeClass("td")}params.buttonLabel=params.buttonLabel||{};params.buttonLabel.okLabel=params.buttonLabel.okLabel||"OK";params.buttonLabel.cancelLabel=params.buttonLabel.cancelLabel||"Cancel";var okButton=$("#btnPromptDialogOK").html(params.buttonLabel.okLabel),cancelButton=$("#btnPromptDialogCancel").html(params.buttonLabel.cancelLabel),btn;$promptDialog.off("dialogopen").on("dialogopen",function(){var okButton=$("#btnPromptDialogOK").off("click").on("click",function(){btn=this;var inputValue=$.trim($input.val()),retClose,retYes;if(params.validation&&typeof params.validation=="object"){if(params.validation.override&&typeof params.validation.custom=="function"){if(!params.validation.custom.apply(this,[$input])){return false}}else{switch(params.validation.type){case"number":inputValue=Number(inputValue);if(isNaN(inputValue)){if(params.validation.showError){openAlertDialog({title:$promptDialog.dialog("option","title"),message:"Input must be a number.",iconType:"warning",onAfterClose:function(){$input.trigger("select").trigger("focus")}})}else{$input.trigger("select").trigger("focus")}return false}if(params.validation.range&&typeof params.validation.range=="object"){if(inputValue<params.validation.range.min||inputValue>params.validation.range.max){if(params.validation.showError){openAlertDialog({title:$promptDialog.dialog("option","title"),message:"Input must be within "+params.validation.range.min+" - "+params.validation.range.max+" only.",iconType:"warning",onAfterClose:function(){$input.trigger("select").trigger("focus")}})}else{$input.trigger("select").trigger("focus")}return false}}break;case"string":default:if(!inputValue){if(params.validation.showError){openAlertDialog({title:$promptDialog.dialog("option","title"),message:"Input required.",iconType:"warning",onAfterClose:function(){$input.trigger("select").trigger("focus")}})}else{$input.trigger("select").trigger("focus")}return false}else{if(params.multiline&&inputValue.length>params.maxlength){if(params.validation.showError){openAlertDialog({title:$promptDialog.dialog("option","title"),message:"Input too long. Maximum allowed is "+params.maxlength+" characters.",iconType:"warning",onAfterClose:function(){$input.trigger("select").trigger("focus")}})}else{$input.trigger("select").trigger("focus")}return false}}}if(params.validation.set&&$.isArray(params.validation.set)&&params.validation.set.length>0){if($.inArray(inputValue,params.validation.set)==-1){if(params.validation.showError){openAlertDialog({title:$promptDialog.dialog("option","title"),message:"Input must be one of these: "+params.validation.set.join(", ")+".",iconType:"warning",onAfterClose:function(){$input.trigger("select").trigger("focus")}})}else{$input.trigger("select").trigger("focus")}return false}}if(typeof params.validation.custom=="function"){if(!params.validation.custom.apply(this,[$input])){return false}}}}if(typeof params.onClickOK=="function"){retYes=params.onClickOK.apply(this,[inputValue]);if(typeof params.onClickOKWithAjax!="undefined"&&params.onClickOKWithAjax){return false}}if(retYes===false){return false}if(typeof params.onBeforeClose=="function"){retClose=params.onBeforeClose.apply(this);if(typeof params.onBeforeCloseWithAjax!="undefined"&&params.onBeforeCloseWithAjax){return false}}if(retClose===false){return false}$promptDialog.dialog("close")}).trigger("focus");var cancelButton=$("#btnPromptDialogCancel").off("click").on("click",function(){btn=this;if(typeof params.onClickCancel=="function"){params.onClickCancel.apply(this)}if(typeof params.onBeforeClose=="function"){params.onBeforeClose.apply(this)}$promptDialog.dialog("close")})});$promptDialog.off("dialogclose").on("dialogclose",function(){if(typeof params.onAfterClose=="function"){params.onAfterClose.apply(btn);$input.val("")}});$promptDialog.dialog("open");$input.trigger("focus");return $promptDialog};window.openLoadingDialog=function(){console.warn("Function openLoadingDialog is deprecated.");window.vBulletin.loadingIndicator.show("openLoadingDialog")};window.closeLoadingDialog=function(){console.warn("Function closeLoadingDialog is deprecated.");window.vBulletin.loadingIndicator.hide("closeLoadingDialog")};window.bindFormReset=function(formSelector){return $(formSelector).on("reset",function(e,callback){if(typeof callback=="function"){callback()}})};setTimeout(function(){if(!$.support.selectstart){$.fn.extend({disableSelection:function(){return this.each(function(){$(this).css({"-moz-user-select":"-moz-none","-webkit-user-select":"none","-khtml-user-select":"none","-o-user-select":"none","user-select":"none"})})},enableSelection:function(){return this.each(function(){$(this).css({"-moz-user-select":"","-webkit-user-select":"","-khtml-user-select":"","-o-user-select":"","user-select":""})})}})}function initPage(){window.vBulletin.loadingIndicator.init();var loadSiteBuilderStyle=function(){$.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/render/stylesheet_block",data:{"cssFiles[]":["sitebuilder-after.css"]},type:"POST",dataType:"json",success:function(response){$("head").append(response)}})};$(document).off("click","a.animate-scroll").on("click","a.animate-scroll",function(){var check=vBulletin.scrollToAnchor(this.hash);if(check){window.location.href=this.href}return false});var splitButtonClickHandler=function(e){$(this).closest(".split-button").toggleClass("open").find(".submenu").toggleClass("h-hide");$("body").off("click.buttonset").on("click.buttonset",function(e){if($(e.target).closest(".split-button").length==0){$(".split-button").removeClass("open").find(".submenu").addClass("h-hide");$("body").off("click.buttonset")}})};$(".split-button .button-text").button().closest(".button-set").find(".button-icon").button({text:false,icons:{primary:"vb-icon vb-icon-triangle-down-wide"}}).on("click",splitButtonClickHandler).closest(".button-set").buttonset().filter(".one-click").find(".button-text").on("click",splitButtonClickHandler);$(document).off("click",".canvas-widget .toggle-button").on("click",".canvas-widget .toggle-button",function(e,noAnimation){var $btn=$(this),$canvasWidget=$btn.closest(".canvas-widget");if($btn.hasClass("expand")){if(noAnimation){$(".widget-content",$canvasWidget).show()}else{$(".widget-content",$canvasWidget).slideDown("slow")}$canvasWidget.removeClass("collapsed")}else{if(noAnimation){$(".widget-content",$canvasWidget).hide()}else{$(".widget-content",$canvasWidget).slideUp("slow")}$canvasWidget.addClass("collapsed")}$btn.toggleClass("collapse expand");var currentTooltip=$btn.attr("title");$btn.attr("title",$btn.data("toggle-title")).data("toggle-title",currentTooltip);return false});$(".conversation-toolbar-wrapper form.toolbar-filter-overlay").trigger("reset");var nativePlaceholderSupported=!!("placeholder" in document.createElement("input"));if(!nativePlaceholderSupported){var $placeholderFields=$("input[placeholder], textarea[placeholder]");$placeholderFields.filter(":focus").addClass("js-temp-focus").blur();$placeholderFields.placeholder();var setFocusBack=function(removeFocusClass){var $focusedField=$placeholderFields.filter(".js-temp-focus").focus();if(removeFocusClass){$focusedField.removeClass("js-temp-focus")}};$(window).on("load.placeholder_temp",function(){setFocusBack(true);$(window).off("load.placeholder_temp")});setFocusBack()}if($("textarea.autogrow").length>0){$("textarea.autogrow").elastic().off("blur.elastic")}$(".edit-switch-container .switch-control").on("mousedown",function(e){var $self=$(this);if($self.closest("li").hasClass("h-disabled")||$self.closest("ul").hasClass("h-disabled")){return true}if($self.hasClass("on")){$.removeCookie(pageData.sb_state_cookie,{path:pageData.cookie_path,domain:pageData.cookie_domain});$("#main-navbar .main-nav").hide();$self.removeClass("on");return true}loadSiteBuilderStyle();if($("#main-navbar .main-nav li").length>0){$("#main-navbar .main-nav").show();$self.addClass("on");$.cookie(pageData.sb_state_cookie,"1",{path:pageData.cookie_path,domain:pageData.cookie_domain});return true}loadSitebuilderMarkup(true);return true});$("select.custom-dropdown").selectBox();$(document).off("keypress",".js-button").on("keypress",".js-button",function(e){if(e.which==32||e.which==13){if(e.target&&e.target.nodeName&&(e.target.nodeName+"").toLowerCase()=="label"&&$(e.target).find("input").length==1){$(e.target).find("input").trigger("click")}else{$(this).trigger("click")}e.preventDefault()}});$(document).off("keypress",".js-link").on("keypress",".js-link",function(e){if(e.which==13){$(this).trigger("click");e.preventDefault()}});$(".js-debug-collapse-list").next("ol, ul").hide();$(document).off("click",".js-debug-collapse-list").on("click",".js-debug-collapse-list",function(e){$(this).next("ol, ul").toggle()});$(document).off("click",".js-toggle-slider").on("click",".js-toggle-slider",function(){var $this=$(this);if($this.is(".b-toggle-slider--yes")){$this.removeClass("b-toggle-slider--yes").addClass("b-toggle-slider--no");$this.find(".b-toggle-slider__radio--no").prop("checked",true);$this.data("value","0")}else{$this.removeClass("b-toggle-slider--no").addClass("b-toggle-slider--yes");$this.find(".b-toggle-slider__radio--yes").prop("checked",true);$this.data("value","1")}var $matches=$(".js-toggle-slider, .js-toggle-slider__dependent"),thisIdx=$matches.index($this),showElements=false;$matches.each(function(idx,el){if(idx==thisIdx){showElements=true}else{if(showElements==true){var $this=$(this);if($this.is(".js-toggle-slider__dependent")){$this.toggleClass("h-hide")}else{showElements=false;return false}}}});$this.trigger("change",$this.data("value"));return false});$(".js-select-box").selectBox();$(".mainmenu li:has(.submenu)").on("click",function(e){$(".submenu",this).show();return false}).hover(function(){},function(e){$(".submenu",this).hide()});$(".mainmenu.textControls li").on("click",function(e){if($(".tagCtrl",this).length==0){$("#tag-dialog").hide()}});$(".mainmenu .submenu li a").on("click",function(e){$(this).closest(".submenu").hide()});$(".channel-content-widget .new-conversation-btn").off("click").on("click",function(){window.location.href=pageData.baseurl+"/new-content/"+pageData.channelid});$(".pagenav-form").submit(function(){if(Number(this.page.value)>0){location.href=this.action+"&p="+this.page.value}return false}).trigger("reset");$(".toolbar-pagenav").off("keydown",".toolbar-pagenav input").on("keydown",".toolbar-pagenav input",function(e){var key=e.which;if(!e.shiftKey&&!e.altKey&&!e.ctrlKey&&((key>=48&&key<=57)||(key>=96&&key<=105)||key==8||key==9||key==13||key==35||key==36||key==37||key==39||key==46||key==45)){return true}return false});$(document).off("click",".js-post__manage").on("click",".js-post__manage",function(){if(typeof vBulletin.inlinemod=="undefined"){var scriptUrl=vBulletin.getAjaxBaseurl()+"/js/inlinemod.js?v="+pageData.simpleversion,that=this;$.getScript(scriptUrl,function(){vBulletin.inlinemod.manage_deleted_form.apply(that)}).error(function(){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_loading_inlinemod_script"),iconType:"warning"})})}else{vBulletin.inlinemod.manage_deleted_form.apply(this)}});$(document).off("click",".js-post__show-hide").on("click",".js-post__show-hide",function(){var $self=$(this),origText=$self.text(),toggleText=$self.data("toggle-text");if($self.hasClass("js-post__show-hide--show")){$self.closest(".js-post").addClass("b-post--show-deleted-content");$self.html(toggleText).data("toggle-text",origText).removeClass("js-post__show-hide--show")}else{$self.closest(".js-post").removeClass("b-post--show-deleted-content");$self.html(toggleText).data("toggle-text",origText).addClass("js-post__show-hide--show")}});$(document).off("click","a.video-frame").on("click","a.video-frame",function(e){e.preventDefault();var data={code:this.getAttribute("data-vcode"),provider:this.getAttribute("data-vprovider")};if(this.getAttribute("data-height")){data.height=this.getAttribute("data-height")}if(this.getAttribute("data-width")){data.width=this.getAttribute("data-width")}var videocontainer=$(this);$.get(vBulletin.getAjaxBaseurl()+"/ajax/render/bbcode_video",data,function(template){if(template){videocontainer.replaceWith(template)}},"json")});vBulletin.markreadcheck();$(document).off("click","a.markchannelsread, a.navbar_mark_channels_read").on("click","a.markchannelsread, a.navbar_mark_channels_read",function(){vBulletin.markchannelsread(0,{success:function(){location.reload()},failed:function(){openAlertDialog({title:vBulletin.phrase.get("forum"),message:"Mark Channels Read failed: {0}".format(result),iconType:"error"})}},$(this));return false})}function replaceSecurityToken(){window.clearTimeout(securitytoken_timeout);if(pageData.securitytoken!="guest"){var securitytoken_timeout=window.setTimeout(replaceSecurityToken,3600000);$.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/replace-securitytoken",data:{securitytoken:pageData.securitytoken},type:"POST",dataType:"json",success:function(result){if(result&&!result.error){var securitytoken_errors=0;doReplaceSecurityToken(result.newtoken)}else{console.log("/ajax/replace-securitytoken, error: "+error);if(++securitytoken_errors==3){doReplaceSecurityToken("guest")}}},error:function(xhr,statusText,error){console.log("/ajax/replace-securitytoken, error: "+error);if(++securitytoken_errors==3){doReplaceSecurityToken("guest")}}})}}function doReplaceSecurityToken(newtoken){if(newtoken==""){return }$("form").each(function(){var frm=$(this);if(typeof (this.method)!="undefined"&&this.method.toLowerCase()=="post"){if(frm.find('input[name="securitytoken"]').length){frm.find('input[name="securitytoken"]').val(newtoken)}else{frm.append('<input type="hidden" name="securitytoken" value="'+newtoken+'" />')}}});pageData.securitytoken=newtoken;console.log("Securitytoken updated")}function afterInit(){if(typeof (pageData.adminAction)!="undefined"){vBulletin.assertUserHasAdminPermission("canusesitebuilder",self,function(){},function(){window.location.reload()})}if(vBulletin.options.get("crontab")){if(pageData.nextcron<=pageData.current_server_datetime){vBulletin.loadingIndicator.suppressNextAjaxIndicator();$.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/cron/run",type:"POST",dataType:"json",success:function(result){if(result&&result.errors){console.warn("Cron error: "+vBulletin.phrase.get(result.errors[0][0]))}console.log("Cron run successfully.")},error:function(xhr,statusText,error){console.warn("Error when running cron: {0}".format(error))}})}else{}}}function loadSitebuilderMarkup(noLoadingDialog){$("body").css("cursor","wait");if(!noLoadingDialog){window.vBulletin.loadingIndicator.show()}$.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/activate-sitebuilder",data:({pageid:pageData.pageid,nodeid:pageData.nodeid,userid:pageData.userid}),type:"POST",dataType:"json",cache:false,complete:function(){console.log("activate-sitebuilder complete.");$("body").css("cursor","auto");if(!noLoadingDialog){window.vBulletin.loadingIndicator.hide()}},success:function(result){console.log("activate-sitebuilder successful! result:"+JSON.stringify(result));if(result&&result.menu&&result.template){$(".edit-switch-container .switch-control").addClass("on");$("#main-navbar .main-nav").hide().html(result.menu);$("#sitebuilder-wrapper").prepend(result.template);$("#main-navbar .main-nav").show();$.cookie(pageData.sb_state_cookie,"1",{path:pageData.cookie_path,domain:pageData.cookie_domain})}else{console.log("activating sitebuilder failed!");openAlertDialog({title:"Error",message:"Error activating SiteBuilder.<br /><br />Please try again.",iconType:"error"})}},error:function(xhr,statusText,error){console.log("activating sitebuilder failed! error:"+error);openAlertDialog({title:"Error",message:"Error activating SiteBuilder. (Error code {0})<br /><br />Please try again.".format(xhr.status),iconType:"error"})}})}initPage();$("#searchPopupControl").on("click",function(e){if($(this).hasClass("open")){$(this).removeClass("open");$("#searchPopupContent").hide()}else{$(this).addClass("open");$("#searchPopupContent").show()}});$("html").on("click",function(e){if($(e.target).closest("#searchForm").size()==0&&$("#searchPopupControl").hasClass("open")){$("#searchPopupControl").removeClass("open");$("#searchPopupContent").hide()}});$("#btnAdvSearch").off("click").on("click",function(e){e.preventDefault();$(this).data("clicked2submit",1);var $searchForm=$("#searchForm");$('<input type="hidden" name="AdvSearch" value="1" />').appendTo($searchForm);$searchForm.submit()});$("#searchForm").off("submit.searchform").on("submit.searchform",function(e){var searchJSON={},searchFields_keywords=$("#q");if($.trim(searchFields_keywords.val()).length>0){searchJSON.keywords=$.trim(searchFields_keywords.val())}else{if(!$("#btnAdvSearch").data("clicked2submit")){openAlertDialog({title:vBulletin.phrase.get("search"),message:vBulletin.phrase.get("please_provide_search_string"),iconType:"warning",onAfterClose:function(){$("#searchForm #q").focus()}});e.stopPropagation();return false}}var container=$(this).find("#searchPopupContent"),searchFields_title_only=container.find(".searchFields_title_only");if(searchFields_title_only.size()>0&&searchFields_title_only.prop("checked")){searchJSON.title_only=1}var searchFields_author=container.find(".searchFields_author");if(searchFields_author.size()>0&&searchFields_author.prop("checked")){searchJSON.author=[searchFields_author.val()]}var searchFields_channel=container.find(".searchFields_channel");if(searchFields_channel.size()>0&&searchFields_channel.prop("checked")){searchJSON.channel=[searchFields_channel.val()]}container.find("input[name=searchJSON]").val(JSON.stringify(searchJSON));return true});$(".history-backbutton").off("click").on("click",function(e){history.back()});$(".popupControl[popup-body]").off("click").on("click",function(e){var popupBodyClass=$(this).attr("popup-body");if(!popupBodyClass){return false}var popupBody=$(this).parent().find("."+popupBodyClass);if(!popupBody){return false}$(popupBody).toggleClass("h-hide")});var np_notices_displayed;if(!(np_notices_displayed=$.cookie(pageData.cookie_prefix+"np_notices_displayed"))){np_notices_displayed=new Array()}if(!(np_notices_displayed instanceof Array)){np_notices_displayed=new Array(np_notices_displayed)}$('ul.notices li[data-notice-persistent="0"]').each(function(index){np_notices_displayed.push($(this).attr("data-notice-id"))});if(np_notices_displayed.length>0){$.cookie(pageData.cookie_prefix+"np_notices_displayed",np_notices_displayed,{path:pageData.cookie_path,domain:pageData.cookie_domain})}else{$.cookie(pageData.cookie_prefix+"np_notices_displayed",null,{path:pageData.cookie_path,domain:pageData.cookie_domain})}$("ul.notices > li > .close").off("click").on("click",function(e){var noticeli=$(this).closest("li"),noticeid=noticeli.attr("data-notice-id");$("body").css("cursor","wait");$.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/notice/dismiss",data:{noticeid:noticeid},type:"POST",dataType:"json",complete:function(){$("body").css("cursor","auto")},success:function(result){if(result&&!result.error){console.log("Notice dismissed successfully!");noticeli.hide("slow",function(){if($(this).parent().find(">li:visible").length==0){$(this).parent().addClass("h-hide")}})}},error:function(xhr,statusText,error){console.log("Notice dismissed failed! error:"+error);openAlertDialog({title:"Error",message:"Error dismissing the notice.",iconType:"error"})}})});$("#frmActivateuser").ajaxForm({dataType:"json",beforeSubmit:function(formData,form,options){var error="",focusfield="";if($.trim($(".username",form).val())==""){error=vBulletin.phrase.get("please_enter_a_username");focusfield=".username"}else{if($.trim($(".activateid",form).val())==""){error=vBulletin.phrase.get("requiredfieldmissing",vBulletin.phrase.get("activation_code"));focusfield=".activateid"}}if(error){openAlertDialog({title:vBulletin.phrase.get("error"),message:error,iconType:"warning",onAfterClose:function(){$(focusfield,form).focus()}});return false}return true},success:function(response,statusText,xhr,$form){if(response&&response.response&&response.response.errors){var errors=[];for(var x in response.response.errors){if(response.response.errors[x][0]!="exception_trace"&&response.response.errors[x][0]!="errormsg"){errors.push(vBulletin.phrase.get(response.response.errors[x]))}}openAlertDialog({title:vBulletin.phrase.get("error"),message:errors.join("<br />"),iconType:"warning",onAfterClose:function(){vBulletin.hv.reset(true)}})}else{var messagephraseparams=response.response.msg_params;messagephraseparams.unshift(response.response.msg);openAlertDialog({title:vBulletin.phrase.get("activate_your_account"),message:vBulletin.phrase.get.apply(vBulletin.phrase,messagephraseparams),onAfterClose:function(){window.location.href=pageData.baseurl}})}}});$("#frmActivateemail").ajaxForm({dataType:"json",beforeSubmit:function(formData,form,options){var error="",focusfield="";if($.trim($(".email",form).val())==""){error=vBulletin.phrase.get("please_enter_your_email_address")}else{if(!isValidEmailAddress($(".email",form).val())){error=vBulletin.phrase.get("invalid_email_address")}}if(error){openAlertDialog({title:vBulletin.phrase.get("error"),message:error,iconType:"warning",onAfterClose:function(){$(focusfield,form).focus()}});return false}return true},success:function(response,statusText,xhr,$form){if(response&&response.response&&response.response.errors){var errors=[];for(var x in response.response.errors){if(response.response.errors[x][0]!="exception_trace"&&response.response.errors[x][0]!="errormsg"){errors.push(vBulletin.phrase.get(response.response.errors[x]))}}openAlertDialog({title:vBulletin.phrase.get("error"),message:errors.join("<br />"),iconType:"warning",onAfterClose:function(){vBulletin.hv.reset(true)}})}else{var messagephraseparams=response.response.msg_params;messagephraseparams.unshift(response.response.msg);openAlertDialog({title:vBulletin.phrase.get("email_activation_codes"),message:vBulletin.phrase.get.apply(vBulletin.phrase,messagephraseparams),onAfterClose:function(){window.location.href=pageData.baseurl}})}}});var styleid=$.cookie(pageData.cookie_prefix+"userstyleid");if(styleid){$(".stylechooser").val(styleid)}$(".stylechooser").change(function(){var styleid=$("option:selected",$(this)).val(),expiredate=new Date();expiredate.setDate(expiredate.getDate()+365);$.cookie(pageData.cookie_prefix+"userstyleid",styleid,{path:pageData.cookie_path,domain:pageData.cookie_domain,expires:expiredate});window.location.reload()});var languageid=$.cookie(pageData.cookie_prefix+"languageid");if(languageid){$(".languagechooser").val(languageid)}$(".languagechooser").change(function(){var languageid=$("option:selected",$(this)).val(),expiredate=new Date();expiredate.setDate(expiredate.getDate()+365);$.cookie(pageData.cookie_prefix+"languageid",languageid,{path:pageData.cookie_path,domain:pageData.cookie_domain,expires:expiredate});window.location.reload()});$("a.navbar_profile").on("click",function(){if(pageData.userid=="0"){$("#lnkLoginSignupMenu").click();return false}});doReplaceSecurityToken(pageData.securitytoken);var securitytoken_timeout=window.setTimeout(replaceSecurityToken,3600000),securitytoken_errors=0;if(!vBulletin.ckeditor.checkEnvironment()){$(".b-content-entry").find("li[data-panel=b-content-entry-panel__content--toggle-editor]").addClass("h-hide")}setTimeout(afterInit,5)},1);vBulletin.getQueryString=function(a){if(a==""){return{}}var b={};for(var i=0;i<a.length;++i){var p=a[i].split("=");if(p.length!=2){continue}b[p[0]]=decodeURIComponent(p[1].replace(/\+/g," "))}return b};vBulletin.triggerHandler=function(eventName,$parent,extraParams){if(!$parent||$parent.length==0){$parent=$(document)}else{if(!($parent instanceof $)){$parent=$($parent)}}extraParams=extraParams||[];var event=$.Event(eventName);event.target=this instanceof $?this.get(0):this;return $parent.triggerHandler(event,extraParams)}})(jQuery);function JShtmlEncode(B){var A="";if(B&&typeof B!=="undefined"&&B.length>0){A=$("<div/>").text(B).html()}A=String(A).replace(/"/g,"&quot;");return A}function showPhotoDialog(A){$("#gallery_dialog"+A).dialog()}function displayPositionedPopup(E){if(E.dialog){E.dialog=$(E.dialog)}if(!E.dialog||E.dialog.size()==0){E.dialog=$("<div />").html('<h3><label class="h-left">'+E.title+'</label><label class="h-right btnClose">x</label><div class="h-clear"></div></h3><div class="content"></div><div class="arrow"><div class="arrowOver"></div></div>').addClass("custom-dialog").css("z-index",1100).appendTo(document.body);if(E.className){E.dialog.addClass(E.className)}if(E.width){E.dialog.css("width",E.width)}if(typeof E.id=="string"){E.dialog.prop("id",E.id)}E.dialog.find(".btnClose").on("click",function(){E.dialog.fadeOut();return false})}if(E.content){if(typeof E.content=="string"){E.dialog.find(".content").html(E.content);if(typeof E.loaded=="function"){E.loaded(E)}E.dialog.show()}else{if(typeof E.content=="function"){E.dialog.find(".content").html('<span class="text">Loading...</span><span class="loading-icon"><img width="16" height="16" alt="" src="'+pageData.baseurl+'/images/ajax-loader.gif"></span>');E.dialog.show();window.setTimeout(function(){E.content(E)},1)}}}var A=$("#wrapper").offset(),D=$("#wrapper").outerWidth(),N=$(E.target).offset(),K=$(E.target).outerWidth(),I=$(E.target).outerHeight(),F=E.dialog.outerWidth(),M=E.dialog.find(".arrow"),H=M.outerWidth(),L=M.outerHeight(),C=F-M.position().left-H,B=N.left+(K/2)-F+C+(H/2)-2;if(B<A.left){var G=parseInt(M.css("right"));M.css("left",G);C=G+H;B=N.left+(K/2)-C+(H/2)-2}var J=N.top+I+L;E.dialog.css({left:B,top:J});if(typeof E.ready=="function"){E.ready(E)}}function closePhotoDialog(A){$("#gallery_dialog"+A).close()}function isValidEmailAddress(B){var A=new RegExp(/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/i);return A.test(B)}function str_repeat(D,C){var B="";for(var A=0;A<C;A++){B=B.concat(D)}return B}function showStatusMessage(A,F){var C=$(".conversation-status-message.notice"),E;if(C.length>0){var B=C.filter("."+F);if(B.length==1){C=B}else{if((E=C.filter(".h-hide")).length==1){C=E}else{C=C.first().clone().removeClass().addClass("conversation-status-message notice").appendTo(".conversation-status-messages")}}C=(B.length==1?B:C).show();if(!vBulletin.isScrolledIntoView(C)){var D=C.offset().top-10;C.hide();$("html,body").animate({scrollTop:D},"slow",function(){C.find("span").html(A).end().addClass(F+" show-x").fadeIn("slow","linear")})}else{if(C.hasClass("h-hide")){C.hide().removeClass("h-hide").addClass(F+" show-x").find("span").html(A).end().fadeIn(800,"linear")}else{C.fadeOut("slow","linear",function(){C.find("span").html(A).end().addClass(F+" show-x").fadeIn("slow","linear")})}}}}window.vBulletin.htmlEntities=function(A){return String(A).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'"'/g,"&quot;")};window.vBulletin.htmlEntities_decode=function(A){return String(A).replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"')};window.vBulletin.loadedIds=window.vBulletin.loadedIds||[];window.vBulletin.isAlreadyLoaded=function(A){if($.inArray(A,window.vBulletin.loadedIds)!=-1){return true}window.vBulletin.loadedIds.push(A)};;

// ***************************
// js.compressed/jquery/jquery.history.min.js
// ***************************
/**
 * History.js jQuery Adapter and History.js Core
 * @author Benjamin Arthur Lupton <contact@balupton.com>
 * @copyright 2010-2011 Benjamin Arthur Lupton <contact@balupton.com>
 * @license New BSD License <http://creativecommons.org/licenses/BSD/>
 *
 * ============ NOTE: This version contains patch from https://github.com/christanto/history.js/commit/b78af84fc2b6b5da573e5ee0bd72f4213e36bb18 ============
 */	
(function(b,d){"use strict";var a=b.History=b.History||{},c=b.jQuery;if(typeof a.Adapter!=="undefined"){throw new Error("History.js Adapter has already been loaded...")}a.Adapter={bind:function(e,f,g){c(e).bind(f,g)},trigger:function(f,g,e){c(f).trigger(g,e)},extractEventData:function(g,h,f){var e=(h&&h.originalEvent&&h.originalEvent[g])||(f&&f[g])||d;return e},onDomLoad:function(e){c(e)}};if(typeof a.init!=="undefined"){a.init()}})(window);(function(g,a){"use strict";var d=g.console||a,i=g.document,l=g.navigator,k=g.sessionStorage||false,c=g.setTimeout,j=g.clearTimeout,e=g.setInterval,n=g.clearInterval,m=g.JSON,h=g.alert,b=g.History=g.History||{},f=g.history;m.stringify=m.stringify||m.encode;m.parse=m.parse||m.decode;if(typeof b.init!=="undefined"){throw new Error("History.js Core has already been loaded...")}b.init=function(){if(typeof b.Adapter==="undefined"){return false}if(typeof b.initCore!=="undefined"){b.initCore()}if(typeof b.initHtml4!=="undefined"){b.initHtml4()}return true};b.initCore=function(){if(typeof b.initCore.initialized!=="undefined"){return false}else{b.initCore.initialized=true}b.options=b.options||{};b.options.hashChangeInterval=b.options.hashChangeInterval||100;b.options.safariPollInterval=b.options.safariPollInterval||500;b.options.doubleCheckInterval=b.options.doubleCheckInterval||500;b.options.storeInterval=b.options.storeInterval||1000;b.options.busyDelay=b.options.busyDelay||250;b.options.debug=b.options.debug||false;b.options.initialTitle=b.options.initialTitle||i.title;b.options.transformHash=b.options.transformHash||true;b.intervalList=[];b.clearAllIntervals=function(){var r,q=b.intervalList;if(typeof q!=="undefined"&&q!==null){for(r=0;r<q.length;r++){n(q[r])}b.intervalList=null}};b.debug=function(){if((b.options.debug||false)){b.log.apply(b,arguments)}};b.log=function(){var w=!(typeof d==="undefined"||typeof d.log==="undefined"||typeof d.log.apply==="undefined"),r=i.getElementById("log"),v,u,x,s,q;if(w){s=Array.prototype.slice.call(arguments);v=s.shift();if(typeof d.debug!=="undefined"){d.debug.apply(d,[v,s])}else{d.log.apply(d,[v,s])}}else{v=("\n"+arguments[0]+"\n")}for(u=1,x=arguments.length;u<x;++u){q=arguments[u];if(typeof q==="object"&&typeof m!=="undefined"){try{q=m.stringify(q)}catch(t){}}v+="\n"+q+"\n"}if(r){r.value+=v+"\n-----\n";r.scrollTop=r.scrollHeight-r.clientHeight}else{if(!w){h(v)}}return true};b.getInternetExplorerMajorVersion=function(){var q=b.getInternetExplorerMajorVersion.cached=(typeof b.getInternetExplorerMajorVersion.cached!=="undefined")?b.getInternetExplorerMajorVersion.cached:(function(){var r=3,t=i.createElement("div"),s=t.getElementsByTagName("i");while((t.innerHTML="<!--[if gt IE "+(++r)+"]><i></i><![endif]-->")&&s[0]){}return(r>4)?r:false})();return q};b.isInternetExplorer=function(){var q=b.isInternetExplorer.cached=(typeof b.isInternetExplorer.cached!=="undefined")?b.isInternetExplorer.cached:Boolean(b.getInternetExplorerMajorVersion());return q};b.emulated={pushState:!Boolean(g.history&&g.history.pushState&&g.history.replaceState&&!((/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i).test(l.userAgent)||(/AppleWebKit\/5([0-2]|3[0-2])/i).test(l.userAgent))),hashChange:Boolean(!(("onhashchange" in g)||("onhashchange" in i))||(b.isInternetExplorer()&&b.getInternetExplorerMajorVersion()<8))};b.enabled=!b.emulated.pushState;b.bugs={setHash:Boolean(!b.emulated.pushState&&l.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(l.userAgent)),safariPoll:Boolean(!b.emulated.pushState&&l.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(l.userAgent)),ieDoubleCheck:Boolean(b.isInternetExplorer()&&b.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(b.isInternetExplorer()&&b.getInternetExplorerMajorVersion()<7)};b.isEmptyObject=function(r){for(var q in r){return false}return true};b.cloneObject=function(s){var r,q;if(s){r=m.stringify(s);q=m.parse(r)}else{q={}}return q};b.getRootUrl=function(){var q=i.location.protocol+"//"+(i.location.hostname||i.location.host);if(i.location.port||false){q+=":"+i.location.port}q+="/";return q};b.getBaseHref=function(){var q=i.getElementsByTagName("base"),s=null,r="";if(q.length===1){s=q[0];r=s.href.replace(/[^\/]+$/,"")}r=r.replace(/\/+$/,"");if(r){r+="/"}return r};b.getBaseUrl=function(){var q=b.getBaseHref()||b.getBasePageUrl()||b.getRootUrl();return q};b.getPageUrl=function(){var q=b.getState(false,false),s=(q||{}).url||i.location.href,r;r=s.replace(/\/+$/,"").replace(/[^\/]+$/,function(v,u,t){return(/\./).test(v)?v:v+"/"});return r};b.getBasePageUrl=function(){var q=i.location.href.replace(/[#\?].*/,"").replace(/[^\/]+$/,function(t,s,r){return(/[^\/]$/).test(t)?"":t}).replace(/\/+$/,"")+"/";return q};b.getFullUrl=function(r,t){var q=r,s=r.substring(0,1);t=(typeof t==="undefined")?true:t;if(/[a-z]+\:\/\//.test(r)){}else{if(s==="/"){q=b.getRootUrl()+r.replace(/^\/+/,"")}else{if(s==="#"){q=b.getPageUrl().replace(/#.*/,"")+r}else{if(s==="?"){q=b.getPageUrl().replace(/[\?#].*/,"")+r}else{if(t){q=b.getBaseUrl()+r.replace(/^(\.\/)+/,"")}else{q=b.getBasePageUrl()+r.replace(/^(\.\/)+/,"")}}}}}return q.replace(/\#$/,"")};b.getShortUrl=function(s){var r=s,t=b.getBaseUrl(),q=b.getRootUrl();if(b.emulated.pushState){r=r.replace(t,"")}r=r.replace(q,"/");if(b.isTraditionalAnchor(r)){r="./"+r}r=r.replace(/^(\.\/)+/g,"./").replace(/\#$/,"");return r};b.store={};b.idToState=b.idToState||{};b.stateToId=b.stateToId||{};b.urlToId=b.urlToId||{};b.storedStates=b.storedStates||[];b.savedStates=b.savedStates||[];b.normalizeStore=function(){b.store.idToState=b.store.idToState||{};b.store.urlToId=b.store.urlToId||{};b.store.stateToId=b.store.stateToId||{}};b.getState=function(s,r){if(typeof s==="undefined"){s=true}if(typeof r==="undefined"){r=true}var q=b.getLastSavedState();if(!q&&r){q=b.createStateObject()}if(s){q=b.cloneObject(q);q.url=q.cleanUrl||q.url}return q};b.getIdByState=function(q){var s=b.extractId(q.url),r;if(!s){r=b.getStateString(q);if(typeof b.stateToId[r]!=="undefined"){s=b.stateToId[r]}else{if(typeof b.store.stateToId[r]!=="undefined"){s=b.store.stateToId[r]}else{while(true){s=(new Date()).getTime()+String(Math.random()).replace(/\D/g,"");if(typeof b.idToState[s]==="undefined"&&typeof b.store.idToState[s]==="undefined"){break}}b.stateToId[r]=s;b.idToState[s]=q}}}return s};b.normalizeState=function(r){var s,q;if(!r||(typeof r!=="object")){r={}}if(typeof r.normalized!=="undefined"){return r}if(!r.data||(typeof r.data!=="object")){r.data={}}s={};s.normalized=true;s.title=r.title||"";s.url=b.getFullUrl(b.unescapeString(r.url||i.location.href));s.hash=b.getShortUrl(s.url);s.data=b.cloneObject(r.data);s.id=b.getIdByState(s);s.cleanUrl=s.url.replace(/\??\&_suid.*/,"");s.url=s.cleanUrl;q=!b.isEmptyObject(s.data);if(s.title||q){s.hash=b.getShortUrl(s.url).replace(/\??\&_suid.*/,"");if(!/\?/.test(s.hash)){s.hash+="?"}s.hash+="&_suid="+s.id}s.hashedUrl=b.getFullUrl(s.hash);if((b.emulated.pushState||b.bugs.safariPoll)&&b.hasUrlDuplicate(s)){s.url=s.hashedUrl}return s};b.createStateObject=function(s,t,r){var q={data:s,title:t,url:r};q=b.normalizeState(q);return q};b.getStateById=function(r){r=String(r);var q=b.idToState[r]||b.store.idToState[r]||a;return q};b.getStateString=function(r){var q,s,t;q=b.normalizeState(r);s={data:q.data,title:r.title,url:r.url};t=m.stringify(s);return t};b.getStateId=function(r){var q,s;q=b.normalizeState(r);s=q.id;return s};b.getHashByState=function(r){var q,s;q=b.normalizeState(r);s=q.hash;return s};b.extractId=function(s){var t,r,q;r=/(.*)\&_suid=([0-9]+)$/.exec(s);q=r?(r[1]||s):s;t=r?String(r[2]||""):"";return t||false};b.isTraditionalAnchor=function(r){var q=!(/[\/\?\.]/.test(r));return q};b.extractState=function(t,s){var q=null,u,r;s=s||false;u=b.extractId(t);if(u){q=b.getStateById(u)}if(!q){r=b.getFullUrl(t);u=b.getIdByUrl(r)||false;if(u){q=b.getStateById(u)}if(!q&&s&&!b.isTraditionalAnchor(t)){q=b.createStateObject(null,null,r)}}return q};b.getIdByUrl=function(q){var r=b.urlToId[q]||b.store.urlToId[q]||a;return r};b.getLastSavedState=function(){return b.savedStates[b.savedStates.length-1]||a};b.getLastStoredState=function(){return b.storedStates[b.storedStates.length-1]||a};b.hasUrlDuplicate=function(s){var r=false,q;q=b.extractState(s.url);r=q&&q.id!==s.id;return r};b.storeState=function(q){b.urlToId[q.url]=q.id;b.storedStates.push(b.cloneObject(q));return q};b.isLastSavedState=function(t){var s=false,r,q,u;if(b.savedStates.length){r=t.id;q=b.getLastSavedState();u=q.id;s=(r===u)}return s};b.saveState=function(q){if(b.isLastSavedState(q)){return false}b.savedStates.push(b.cloneObject(q));return true};b.getStateByIndex=function(r){var q=null;if(typeof r==="undefined"){q=b.savedStates[b.savedStates.length-1]}else{if(r<0){q=b.savedStates[b.savedStates.length+r]}else{q=b.savedStates[r]}}return q};b.getHash=function(){var q=b.unescapeHash(i.location.hash);return q};b.unescapeString=function(s){var q=s,r;while(true){r=g.unescape(q);if(r===q){break}q=r}return q};b.unescapeHash=function(r){var q=b.normalizeHash(r);q=b.unescapeString(q);return q};b.normalizeHash=function(r){var q=r.replace(/[^#]*#/,"").replace(/#.*/,"");return q};b.setHash=function(u,r){var q,s,t;if(r!==false&&b.busy()){b.pushQueue({scope:b,callback:b.setHash,args:arguments,queue:r});return false}q=b.escapeHash(u);b.busy(true);s=b.extractState(u,true);if(s&&!b.emulated.pushState){b.pushState(s.data,s.title,s.url,false)}else{if(i.location.hash!==q){if(b.bugs.setHash){t=b.getPageUrl();b.pushState(null,null,t+"#"+q,false)}else{i.location.hash=q}}}return b};b.escapeHash=function(r){var q=b.normalizeHash(r);q=g.escape(q);if(!b.bugs.hashEscape){q=q.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")}return q};b.getHashByUrl=function(q){var r=String(q).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");r=b.unescapeHash(r);return r};b.setTitle=function(s){var t=s.title,r;if(!t){r=b.getStateByIndex(0);if(r&&r.url===s.url){t=r.title||b.options.initialTitle}}try{i.getElementsByTagName("title")[0].innerHTML=t.replace("<","&lt;").replace(">","&gt;").replace(" & "," &amp; ")}catch(q){}i.title=t;return b};b.queues=[];b.busy=function(r){if(typeof r!=="undefined"){b.busy.flag=r}else{if(typeof b.busy.flag==="undefined"){b.busy.flag=false}}if(!b.busy.flag){j(b.busy.timeout);var q=function(){var t,s,u;if(b.busy.flag){return}for(t=b.queues.length-1;t>=0;--t){s=b.queues[t];if(s.length===0){continue}u=s.shift();b.fireQueueItem(u);b.busy.timeout=c(q,b.options.busyDelay)}};b.busy.timeout=c(q,b.options.busyDelay)}return b.busy.flag};b.busy.flag=false;b.fireQueueItem=function(q){return q.callback.apply(q.scope||b,q.args||[])};b.pushQueue=function(q){b.queues[q.queue||0]=b.queues[q.queue||0]||[];b.queues[q.queue||0].push(q);return b};b.queue=function(r,q){if(typeof r==="function"){r={callback:r}}if(typeof q!=="undefined"){r.queue=q}if(b.busy()){b.pushQueue(r)}else{b.fireQueueItem(r)}return b};b.clearQueue=function(){b.busy.flag=false;b.queues=[];return b};b.stateChanged=false;b.doubleChecker=false;b.doubleCheckComplete=function(){b.stateChanged=true;b.doubleCheckClear();return b};b.doubleCheckClear=function(){if(b.doubleChecker){j(b.doubleChecker);b.doubleChecker=false}return b};b.doubleCheck=function(q){b.stateChanged=false;b.doubleCheckClear();if(b.bugs.ieDoubleCheck){b.doubleChecker=c(function(){b.doubleCheckClear();if(!b.stateChanged){q()}return true},b.options.doubleCheckInterval)}return b};b.safariStatePoll=function(){var r=b.extractState(i.location.href),q;if(!b.isLastSavedState(r)){q=r}else{return}if(!q){q=b.createStateObject()}b.Adapter.trigger(g,"popstate");return b};b.back=function(q){if(q!==false&&b.busy()){b.pushQueue({scope:b,callback:b.back,args:arguments,queue:q});return false}b.busy(true);b.doubleCheck(function(){b.back(false)});f.go(-1);return true};b.forward=function(q){if(q!==false&&b.busy()){b.pushQueue({scope:b,callback:b.forward,args:arguments,queue:q});return false}b.busy(true);b.doubleCheck(function(){b.forward(false)});f.go(1);return true};b.go=function(r,q){var s;if(r>0){for(s=1;s<=r;++s){b.forward(q)}}else{if(r<0){for(s=-1;s>=r;--s){b.back(q)}}else{throw new Error("History.go: History.go requires a positive or negative integer passed.")}}return b};if(b.emulated.pushState){var p=function(){};b.pushState=b.pushState||p;b.replaceState=b.replaceState||p}else{b.onPopState=function(t,q){var v=false,u=false,s,r;b.doubleCheckComplete();s=b.getHash();if(s){r=b.extractState(s||i.location.href,true);if(b.options.transformHash&&r){b.replaceState(r.data,r.title,r.url,false)}else{b.Adapter.trigger(g,"anchorchange");b.busy(false)}b.expectedStateId=false;return false}v=b.Adapter.extractEventData("state",t,q)||false;if(v){u=b.getStateById(v)}else{if(b.expectedStateId){u=b.getStateById(b.expectedStateId)}else{u=b.extractState(i.location.href)}}if(!u){u=b.createStateObject(null,null,i.location.href)}b.expectedStateId=false;if(b.isLastSavedState(u)){b.busy(false);return false}b.storeState(u);b.saveState(u);b.setTitle(u);b.Adapter.trigger(g,"statechange");b.busy(false);return true};b.Adapter.bind(g,"popstate",b.onPopState);b.pushState=function(s,u,r,q){if(b.getHashByUrl(r)&&b.emulated.pushState){throw new Error("History.js does not support states with fragment-identifiers (hashes/anchors).")}if(q!==false&&b.busy()){b.pushQueue({scope:b,callback:b.pushState,args:arguments,queue:q});return false}b.busy(true);var t=b.createStateObject(s,u,r);if(b.isLastSavedState(t)){b.busy(false)}else{b.storeState(t);b.expectedStateId=t.id;f.pushState(t.id,t.title,t.url);b.Adapter.trigger(g,"popstate")}return true};b.replaceState=function(s,u,r,q){if(b.getHashByUrl(r)&&b.emulated.pushState){throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).")}if(q!==false&&b.busy()){b.pushQueue({scope:b,callback:b.replaceState,args:arguments,queue:q});return false}b.busy(true);var t=b.createStateObject(s,u,r);if(b.isLastSavedState(t)){b.busy(false)}else{b.storeState(t);b.expectedStateId=t.id;f.replaceState(t.id,t.title,t.url);b.Adapter.trigger(g,"popstate")}return true}}if(k){try{b.store=m.parse(k.getItem("History.store"))||{}}catch(o){b.store={}}b.normalizeStore()}else{b.store={};b.normalizeStore()}b.Adapter.bind(g,"beforeunload",b.clearAllIntervals);b.Adapter.bind(g,"unload",b.clearAllIntervals);b.saveState(b.storeState(b.extractState(i.location.href,true)));if(k){b.onUnload=function(){var q,s;try{q=m.parse(k.getItem("History.store"))||{}}catch(r){q={}}q.idToState=q.idToState||{};q.urlToId=q.urlToId||{};q.stateToId=q.stateToId||{};for(s in b.idToState){if(!b.idToState.hasOwnProperty(s)){continue}q.idToState[s]=b.idToState[s]}for(s in b.urlToId){if(!b.urlToId.hasOwnProperty(s)){continue}q.urlToId[s]=b.urlToId[s]}for(s in b.stateToId){if(!b.stateToId.hasOwnProperty(s)){continue}q.stateToId[s]=b.stateToId[s]}b.store=q;b.normalizeStore();k.setItem("History.store",m.stringify(q))};b.intervalList.push(e(b.onUnload,b.options.storeInterval));b.Adapter.bind(g,"beforeunload",b.onUnload);b.Adapter.bind(g,"unload",b.onUnload)}if(!b.emulated.pushState){if(b.bugs.safariPoll){b.intervalList.push(e(b.safariStatePoll,b.options.safariPollInterval))}if(l.vendor==="Apple Computer, Inc."||(l.appCodeName||"")==="Mozilla"){b.Adapter.bind(g,"hashchange",function(){b.Adapter.trigger(g,"popstate")});if(b.getHash()){b.Adapter.onDomLoad(function(){b.Adapter.trigger(g,"hashchange")})}}}};b.init()})(window);;

// ***************************
// js.compressed/jquery/jquery.selectBox.min.js
// ***************************
/*
 *  jQuery selectBox - A cosmetic, styleable replacement for SELECT elements
 *
 *  Copyright 2012 Cory LaViska for A Beautiful Site, LLC.
 *
 *  https://github.com/claviska/jquery-selectBox
 *
 *  Licensed under both the MIT license and the GNU GPLv2 (same as jQuery: http://jquery.org/license)
 *
 *  Note: Modified for vBulletin
 */
if(jQuery){(function(A){A.extend(A.fn,{selectBox:function(K,b){var C,Z="",N=navigator.platform.match(/mac/i);var S=function(k,e){var q;if(navigator.userAgent.match(/iPad|iPhone|Android|IEMobile|BlackBerry/i)){return false}if(k.tagName.toLowerCase()!=="select"){return false}k=A(k);if(k.data("selectBox-control")){return false}if(k.is(":hidden")&&(!e||!e.allowHidden)){return false}var d=A('<a class="selectBox" />'),i=k.attr("multiple")||parseInt(k.attr("size"))>1;var c=e||{};d.addClass(k.attr("class")).attr("title",k.attr("title")||"").attr("tabindex",parseInt(k.attr("tabindex"))).css("display","inline-block").bind("focus.selectBox",function(){if(this!==document.activeElement&&document.body!==document.activeElement){A(document.activeElement).blur()}if(d.hasClass("selectBox-active")){return }d.addClass("selectBox-active");k.trigger("focus")}).bind("blur.selectBox",function(){if(!d.hasClass("selectBox-active")){return }d.removeClass("selectBox-active");k.trigger("blur")});if(!A(window).data("selectBox-bindings")){A(window).data("selectBox-bindings",true).bind("scroll.selectBox",H).bind("resize.selectBox",H)}if(k.attr("disabled")){d.addClass("selectBox-disabled")}k.bind("click.selectBox",function(r){d.focus();r.preventDefault()});if(i){q=M(k,"inline");d.append(q).data("selectBox-options",q).addClass("selectBox-inline selectBox-menuShowing").bind("keydown.selectBox",function(r){O(k,r)}).bind("keypress.selectBox",function(r){D(k,r)}).bind("mousedown.selectBox",function(r){if(A(r.target).is("A.selectBox-inline")){r.preventDefault()}if(!d.hasClass("selectBox-focus")){d.focus()}}).insertAfter(k);d.width(k.css("fontSize",d.css("fontSize")).outerWidth());if(!k[0].style.height){var p=k.attr("size")?parseInt(k.attr("size")):5;var f=d.clone().removeAttr("id").css({position:"absolute",top:"-9999em"}).show().appendTo("body");f.find(".selectBox-options").html("<li><a>\u00A0</a></li>");var n=parseInt(f.find(".selectBox-options A:first").html("&nbsp;").outerHeight());f.remove();d.height(n*p)}I(d)}else{var j=A('<span class="selectBox-label" />'),m=A('<span class="selectBox-arrow" />');j.attr("class",B(k)).text(Q(k));q=M(k,"dropdown");q.appendTo("BODY");d.data("selectBox-options",q).addClass("selectBox-dropdown").append(j).append(m).bind("mousedown.selectBox",function(r){if(d.hasClass("selectBox-menuShowing")){H()}else{r.stopPropagation();q.data("selectBox-down-at-x",r.screenX).data("selectBox-down-at-y",r.screenY);R(k)}}).bind("keydown.selectBox",function(r){O(k,r)}).bind("keypress.selectBox",function(r){D(k,r)}).bind("open.selectBox",function(s,r){if(r&&r._selectBox===true){return }R(k)}).bind("close.selectBox",function(s,r){if(r&&r._selectBox===true){return }H()}).insertAfter(k);d.width(k.css("fontSize",d.css("fontSize")).width())-parseInt(d.css("border-left-width"),10)-parseInt(d.css("border-right-width"),10);var h=d.width()-m.outerWidth()-parseInt(j.css("paddingLeft"))-parseInt(j.css("paddingRight"));j.width(h);I(d)}var g=A(".selectBox-label",d);var o=parseInt(g.css("paddingLeft"))-4+parseInt(g.css("paddingRight"));var l=d.width()+o;if(l<=d.parent().innerWidth()){d.width(l);g.width(g.width()+o)}k.addClass("selectBox").data("selectBox-control",d).data("selectBox-settings",c).hide()};var M=function(c,h){var e;var d=function(i,j){i.children("OPTION, OPTGROUP").each(function(){if(A(this).is("OPTION")){if(A(this).length>0){G(A(this),j)}else{j.append("<li>\u00A0</li>")}}else{var k=A('<li class="selectBox-optgroup" />');k.text(A(this).attr("label"));j.append(k);j=d(A(this),j)}});return j};switch(h){case"inline":e=A('<ul class="selectBox-options" />');e=d(c,e);e.find("A").bind("mouseover.selectBox",function(i){X(c,A(this).parent())}).bind("mouseout.selectBox",function(i){a(c,A(this).parent())}).bind("mousedown.selectBox",function(i){i.preventDefault();if(!c.selectBox("control").hasClass("selectBox-active")){c.selectBox("control").focus()}}).bind("mouseup.selectBox",function(i){H();W(c,A(this).parent(),i)});I(e);return e;case"dropdown":e=A('<ul class="selectBox-dropdown-menu selectBox-options" />');e=d(c,e);e.data("selectBox-select",c).css("display","none").appendTo("BODY").find("A").bind("mousedown.selectBox",function(i){i.preventDefault();if(i.screenX===e.data("selectBox-down-at-x")&&i.screenY===e.data("selectBox-down-at-y")){e.removeData("selectBox-down-at-x").removeData("selectBox-down-at-y");H()}}).bind("mouseup.selectBox",function(i){if(i.screenX===e.data("selectBox-down-at-x")&&i.screenY===e.data("selectBox-down-at-y")){return }else{e.removeData("selectBox-down-at-x").removeData("selectBox-down-at-y")}W(c,A(this).parent());H()}).bind("mouseover.selectBox",function(i){X(c,A(this).parent())}).bind("mouseout.selectBox",function(i){a(c,A(this).parent())});var g=c.attr("class")||"";if(g!==""){g=g.split(" ");for(var f in g){e.addClass(g[f]+"-selectBox-dropdown-menu")}}I(e);return e}};var B=function(c){var d=A(c).find("OPTION:selected");return("selectBox-label "+(d.attr("class")||"")).replace(/\s+$/,"")};var Q=function(c){var d=A(c).find("OPTION:selected");return d.text()||"\u00A0"};var U=function(c){c=A(c);var d=c.data("selectBox-control");if(!d){return }d.find(".selectBox-label").attr("class",B(c)).text(Q(c))};var Y=function(c){c=A(c);var e=c.data("selectBox-control");if(!e){return }var d=e.data("selectBox-options")||A();d.remove();e.remove();c.removeClass("selectBox").removeData("selectBox-control").data("selectBox-control",null).removeData("selectBox-settings").data("selectBox-settings",null).show()};var L=function(c){c=A(c);c.selectBox("options",c.html())};var R=function(d){d=A(d);var i=d.data("selectBox-control")||A(),g=d.data("selectBox-settings")||{},e=i.data("selectBox-options")||A();if(i.hasClass("selectBox-disabled")){return false}H();var f=parseInt(i.css("borderBottomWidth"))||0;e.width(i.innerWidth()).css({top:i.offset().top+i.outerHeight()-f,left:i.offset().left});if(d.triggerHandler("beforeopen")){return false}var h=function(){d.triggerHandler("open",{_selectBox:true});if(!T(e)){e.css("top",parseFloat(e.css("top"))-(i.outerHeight()+e.outerHeight()))}};switch(g.menuTransition){case"fade":e.fadeIn(g.menuSpeed,h);break;case"slide":e.slideDown(g.menuSpeed,h);break;default:e.show(g.menuSpeed,h);break}if(!g.menuSpeed){h()}var c=e.find(".selectBox-selected:first");E(d,c,true);X(d,c);i.addClass("selectBox-menuShowing");A(document).bind("mousedown.selectBox",function(j){if(A(j.target).parents().andSelf().hasClass("selectBox-options")){return }H()})};var H=function(){if(A(".selectBox-dropdown-menu:visible").length===0){return }A(document).unbind("mousedown.selectBox");A(".selectBox-dropdown-menu").each(function(){var d=A(this),c=d.data("selectBox-select")||A(),g=c.data("selectBox-control")||A(),e=c.data("selectBox-settings")||{};if(c.triggerHandler("beforeclose")){return false}var f=function(){c.triggerHandler("close",{_selectBox:true})};switch(e.menuTransition){case"fade":d.fadeOut(e.menuSpeed,f);break;case"slide":d.slideUp(e.menuSpeed,f);break;default:d.hide(e.menuSpeed,f);break}if(!e.menuSpeed){f()}g.removeClass("selectBox-menuShowing")})};var W=function(d,c,j){d=A(d);c=A(c);var k=d.data("selectBox-control")||A(),h=d.data("selectBox-settings")||{};if(k.hasClass("selectBox-disabled")){return false}if(c.length===0||c.hasClass("selectBox-disabled")){return false}if(d.attr("multiple")){if(j.shiftKey&&k.data("selectBox-last-selected")){c.toggleClass("selectBox-selected");var e;if(c.index()>k.data("selectBox-last-selected").index()){e=c.siblings().slice(k.data("selectBox-last-selected").index(),c.index())}else{e=c.siblings().slice(c.index(),k.data("selectBox-last-selected").index())}e=e.not(".selectBox-optgroup, .selectBox-disabled");if(c.hasClass("selectBox-selected")){e.addClass("selectBox-selected")}else{e.removeClass("selectBox-selected")}}else{if((N&&j.metaKey)||(!N&&j.ctrlKey)){c.toggleClass("selectBox-selected")}else{c.siblings().removeClass("selectBox-selected");c.addClass("selectBox-selected")}}}else{c.siblings().removeClass("selectBox-selected");c.addClass("selectBox-selected")}if(k.hasClass("selectBox-dropdown")){k.find(".selectBox-label").text(c.text())}var f=0,g=[];if(d.attr("multiple")){k.find(".selectBox-selected A").each(function(){g[f++]=A(this).attr("rel")})}else{g=c.find("A").attr("rel")}k.data("selectBox-last-selected",c);if(d.val()!==g){d.val(g);U(d);d.trigger("change")}return true};var X=function(d,c){d=A(d);c=A(c);var f=d.data("selectBox-control")||A(),e=f.data("selectBox-options")||A();e.find(".selectBox-hover").removeClass("selectBox-hover");c.addClass("selectBox-hover")};var a=function(d,c){d=A(d);c=A(c);var f=d.data("selectBox-control")||A(),e=f.data("selectBox-options")||A();e.find(".selectBox-hover").removeClass("selectBox-hover")};var E=function(e,d,c){if(!d||d.length===0){return }e=A(e);var j=e.data("selectBox-control")||A(),g=j.data("selectBox-options")||A(),h=j.hasClass("selectBox-dropdown")?g:g.parent(),i=parseInt(d.offset().top-h.position().top),f=parseInt(i+d.outerHeight());if(c){h.scrollTop(d.offset().top-h.offset().top+h.scrollTop()-(h.height()/2))}else{if(i<0){h.scrollTop(d.offset().top-h.offset().top+h.scrollTop())}if(f>h.height()){h.scrollTop((d.offset().top+d.outerHeight())-h.offset().top+h.scrollTop()-h.height())}}};var O=function(k,c){k=A(k);var g=k.data("selectBox-control")||A(),l=g.data("selectBox-options")||A(),e=k.data("selectBox-settings")||{},f=0,h=0;if(g.hasClass("selectBox-disabled")){return }switch(c.keyCode){case 8:c.preventDefault();Z="";break;case 9:case 27:H();a(k);break;case 13:if(g.hasClass("selectBox-menuShowing")){W(k,l.find("LI.selectBox-hover:first"),c);if(g.hasClass("selectBox-dropdown")){H()}}else{R(k)}break;case 38:case 37:c.preventDefault();if(g.hasClass("selectBox-menuShowing")){var d=l.find(".selectBox-hover").prev("LI");f=l.find("LI:not(.selectBox-optgroup)").length;h=0;while(d.length===0||d.hasClass("selectBox-disabled")||d.hasClass("selectBox-optgroup")){d=d.prev("LI");if(d.length===0){if(e.loopOptions){d=l.find("LI:last")}else{d=l.find("LI:first")}}if(++h>=f){break}}X(k,d);W(k,d,c);E(k,d)}else{R(k)}break;case 40:case 39:c.preventDefault();if(g.hasClass("selectBox-menuShowing")){var j=l.find(".selectBox-hover").next("LI");f=l.find("LI:not(.selectBox-optgroup)").length;h=0;while(j.length===0||j.hasClass("selectBox-disabled")||j.hasClass("selectBox-optgroup")){j=j.next("LI");if(j.length===0){if(e.loopOptions){j=l.find("LI:first")}else{j=l.find("LI:last")}}if(++h>=f){break}}X(k,j);W(k,j,c);E(k,j)}else{R(k)}break}};var D=function(c,e){c=A(c);var f=c.data("selectBox-control")||A(),d=f.data("selectBox-options")||A();if(f.hasClass("selectBox-disabled")){return }switch(e.keyCode){case 9:case 27:case 13:case 38:case 37:case 40:case 39:break;default:if(!f.hasClass("selectBox-menuShowing")){R(c)}e.preventDefault();clearTimeout(C);Z+=String.fromCharCode(e.charCode||e.keyCode);d.find("A").each(function(){if(A(this).text().substr(0,Z.length).toLowerCase()===Z.toLowerCase()){X(c,A(this).parent());E(c,A(this).parent());return false}});C=setTimeout(function(){Z=""},1000);break}};var P=function(c){c=A(c);c.attr("disabled",false);var d=c.data("selectBox-control");if(!d){return }d.removeClass("selectBox-disabled")};var J=function(c){c=A(c);c.attr("disabled",true);var d=c.data("selectBox-control");if(!d){return }d.addClass("selectBox-disabled")};var F=function(c,f){c=A(c);c.val(f);f=c.val();var g=c.data("selectBox-control");if(!g){return }var e=c.data("selectBox-settings")||{},d=g.data("selectBox-options")||A();U(c);d.find(".selectBox-selected").removeClass("selectBox-selected");d.find("A").each(function(){if(typeof (f)==="object"){for(var h=0;h<f.length;h++){if(A(this).attr("rel")==f[h]){A(this).parent().addClass("selectBox-selected")}}}else{if(A(this).attr("rel")==f){A(this).parent().addClass("selectBox-selected")}}});if(e.change){e.change.call(c)}};var V=function(l,m){l=A(l);var f=l.data("selectBox-control")||A(),d=l.data("selectBox-settings")||{};switch(typeof (b)){case"string":l.html(b);break;case"object":l.html("");for(var g in b){if(b[g]===null){continue}if(typeof (b[g])==="object"){var c=A('<optgroup label="'+g+'" />');for(var e in b[g]){c.append('<option value="'+e+'">'+b[g][e]+"</option>")}l.append(c)}else{var h=A('<option value="'+g+'">'+b[g]+"</option>");l.append(h)}}break}if(!f){return }f.data("selectBox-options").remove();var k=f.hasClass("selectBox-dropdown")?"dropdown":"inline";m=M(l,k);f.data("selectBox-options",m);switch(k){case"inline":f.append(m);break;case"dropdown":U(l);A("BODY").append(m);break}};var I=function(c){A(c).css("MozUserSelect","none").bind("selectstart",function(d){d.preventDefault()})};var G=function(e,f){var c=A("<li />"),d=A("<a />");c.addClass(e.attr("class"));c.data(e.data());d.attr("rel",e.val()).text(e.text());c.append(d);if(e.attr("disabled")){c.addClass("selectBox-disabled")}if(e.attr("selected")){c.addClass("selectBox-selected")}f.append(c)};var T=function(e){var i=A(window).scrollTop();var g=i+A(window).height();var c=e.offset().top;var d=c+e.outerHeight();var h=c-i;var f=g-d;return(h>=0&&f>=0)};switch(K){case"control":return A(this).data("selectBox-control");case"settings":if(!b){return A(this).data("selectBox-settings")}A(this).each(function(){A(this).data("selectBox-settings",A.extend(true,A(this).data("selectBox-settings"),b))});break;case"options":if(b===undefined){return A(this).data("selectBox-control").data("selectBox-options")}A(this).each(function(){V(this,b)});break;case"value":if(b===undefined){return A(this).val()}A(this).each(function(){F(this,b)});break;case"refresh":A(this).each(function(){L(this)});break;case"enable":A(this).each(function(){P(this)});break;case"disable":A(this).each(function(){J(this)});break;case"destroy":A(this).each(function(){Y(this)});break;default:A(this).each(function(){S(this,K)});break}return A(this)}})})(jQuery)};;

// ***************************
// js.compressed/jquery/jquery.placeholder.min.js
// ***************************
/*
* Placeholder plugin for jQuery
* ---
* Copyright 2010, Daniel Stocks (http://webcloud.se)
* Released under the MIT, BSD, and GPL Licenses.
*/

(function(e){function t(t){this.input=t;if(t.attr("type")=="password"){this.handlePassword()}e(t[0].form).submit(function(){if(t.hasClass("placeholder")&&t[0].value==t.attr("placeholder")){t[0].value=""}})}t.prototype={show:function(e){if(this.input[0].value===""||e&&this.valueIsPlaceholder()){if(this.isPassword){try{this.input[0].setAttribute("type","text")}catch(t){this.input.before(this.fakePassword.show()).hide()}}this.input.addClass("placeholder");this.input[0].value=this.input.attr("placeholder")}},hide:function(){if(this.valueIsPlaceholder()&&this.input.hasClass("placeholder")){this.input.removeClass("placeholder");this.input[0].value="";if(this.isPassword){try{this.input[0].setAttribute("type","password")}catch(e){}this.input.show();this.input[0].focus()}}},valueIsPlaceholder:function(){return this.input[0].value==this.input.attr("placeholder")},handlePassword:function(){var t=this.input;t.attr("realType","password");this.isPassword=true;if(e.browser.msie&&t[0].outerHTML){var n=e(t[0].outerHTML.replace(/type=(['"])?password\1/gi,"type=$1text$1"));this.fakePassword=n.val(t.attr("placeholder")).addClass("placeholder").focus(function(){t.trigger("focus");e(this).hide()});e(t[0].form).submit(function(){n.remove();t.show()})}}};var n=!!("placeholder"in document.createElement("input"));e.fn.placeholder=function(){return n?this:this.each(function(){var n=e(this);var r=new t(n);r.show(true);n.focus(function(){r.hide()});n.blur(function(){r.show(false)});if(e.browser.msie){e(window).load(function(){if(n.val()){n.removeClass("placeholder")}r.show(true)});n.focus(function(){if(this.value==""){var e=this.createTextRange();e.collapse(true);e.moveStart("character",0);e.select()}})}})};if(!n){var r=e.fn.val;e.fn.val=function(n){if(n==null){var i=e(this);if(i.hasClass("placeholder")){var s=i.attr("placeholder"),o=i.attr("value");if(s&&s==o){var u=new t(i);u.hide();var a=r.call(this);u.show(true);return a}}return r.call(this)}else{return r.call(this,n)}}}})(jQuery);

// ***************************
// js.compressed/jquery/jquery.jcarousel.custom.min.js
// ***************************
/*!
 * jCarousel - Riding carousels with jQuery
 *   http://sorgalla.com/jcarousel/
 *
 * Copyright (c) 2006 Jan Sorgalla (http://sorgalla.com)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Built on top of the jQuery library
 *   http://jquery.com
 *
 * Inspired by the "Carousel Component" by Bill Scott
 *   http://billwscott.com/carousel/
 *
 *   Modified for vBulletin:
 *   - added destroy method
 *   - changed reset method by adding a flag to call setup method
 *   - added check for undefined instance in the main jcarousel function
 */
(function(c){var d={vertical:false,rtl:false,start:1,offset:1,size:null,scroll:3,visible:null,animation:"normal",easing:"swing",auto:0,wrap:null,initCallback:null,setupCallback:null,reloadCallback:null,itemLoadCallback:null,itemFirstInCallback:null,itemFirstOutCallback:null,itemLastInCallback:null,itemLastOutCallback:null,itemVisibleInCallback:null,itemVisibleOutCallback:null,animationStepCallback:null,buttonNextHTML:"<div></div>",buttonPrevHTML:"<div></div>",buttonNextEvent:"click",buttonPrevEvent:"click",buttonNextCallback:null,buttonPrevCallback:null,itemFallbackDimension:null},b=false;c(window).bind("load.jcarousel",function(){b=true});c.jcarousel=function(l,g){this.options=c.extend({},d,g||{});this.locked=false;this.autoStopped=false;this.container=null;this.clip=null;this.list=null;this.buttonNext=null;this.buttonPrev=null;this.buttonNextState=null;this.buttonPrevState=null;if(!g||g.rtl===undefined){this.options.rtl=(c(l).attr("dir")||c("html").attr("dir")||"").toLowerCase()=="rtl"}this.wh=!this.options.vertical?"width":"height";this.lt=!this.options.vertical?(this.options.rtl?"right":"left"):"top";var q="",n=l.className.split(" ");for(var k=0;k<n.length;k++){if(n[k].indexOf("jcarousel-skin")!=-1){c(l).removeClass(n[k]);q=n[k];break}}if(l.nodeName.toUpperCase()=="UL"||l.nodeName.toUpperCase()=="OL"){this.list=c(l);this.clip=this.list.parents(".jcarousel-clip");this.container=this.list.parents(".jcarousel-container")}else{this.container=c(l);this.list=this.container.find("ul,ol").eq(0);this.clip=this.container.find(".jcarousel-clip")}if(this.clip.size()===0){this.clip=this.list.wrap("<div></div>").parent()}if(this.container.size()===0){this.container=this.clip.wrap("<div></div>").parent()}if(q!==""&&this.container.parent()[0].className.indexOf("jcarousel-skin")==-1){this.container.wrap('<div class=" '+q+'"></div>')}this.buttonPrev=c(".jcarousel-prev",this.container);if(this.buttonPrev.size()===0&&this.options.buttonPrevHTML!==null){this.buttonPrev=c(this.options.buttonPrevHTML).appendTo(this.container)}this.buttonPrev.addClass(this.className("jcarousel-prev"));this.buttonNext=c(".jcarousel-next",this.container);if(this.buttonNext.size()===0&&this.options.buttonNextHTML!==null){this.buttonNext=c(this.options.buttonNextHTML).appendTo(this.container)}this.buttonNext.addClass(this.className("jcarousel-next"));this.clip.addClass(this.className("jcarousel-clip")).css({position:"relative"});this.list.addClass(this.className("jcarousel-list")).css({overflow:"hidden",position:"relative",top:0,margin:0,padding:0}).css((this.options.rtl?"right":"left"),0);this.container.addClass(this.className("jcarousel-container")).css({position:"relative"});if(!this.options.vertical&&this.options.rtl){this.container.addClass("jcarousel-direction-rtl").attr("dir","rtl")}var m=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null;var p=this.list.children("li");var r=this;if(p.size()>0){var f=0,h=this.options.offset;p.each(function(){r.format(this,h++);f+=r.dimension(this,m)});this.list.css(this.wh,(f+100)+"px");if(!g||g.size===undefined){this.options.size=p.size()}}this.container.css("display","block");this.buttonNext.css("display","block");this.buttonPrev.css("display","block");this.funcNext=function(){r.next()};this.funcPrev=function(){r.prev()};this.funcResize=function(){if(r.resizeTimer){clearTimeout(r.resizeTimer)}r.resizeTimer=setTimeout(function(){r.reload()},100)};if(this.options.initCallback!==null){this.options.initCallback(this,"init")}if(!b&&c.browser.safari){this.buttons(false,false);c(window).bind("load.jcarousel",function(){r.setup()})}else{this.setup()}};var a=c.jcarousel;a.fn=a.prototype={jcarousel:"0.2.8"};a.fn.extend=a.extend=c.extend;a.fn.extend({setup:function(){this.first=null;this.last=null;this.prevFirst=null;this.prevLast=null;this.animating=false;this.timer=null;this.resizeTimer=null;this.tail=null;this.inTail=false;if(this.locked){return}this.list.css(this.lt,this.pos(this.options.offset)+"px");var e=this.pos(this.options.start,true);this.prevFirst=this.prevLast=null;this.animate(e,false);c(window).unbind("resize.jcarousel",this.funcResize).bind("resize.jcarousel",this.funcResize);if(this.options.setupCallback!==null){this.options.setupCallback(this)}},reset:function(e){this.list.empty();this.list.css(this.lt,"0px");this.list.css(this.wh,"10px");if(this.options.initCallback!==null){this.options.initCallback(this,"reset")}if(e){this.setup()}},reload:function(){if(this.tail!==null&&this.inTail){this.list.css(this.lt,a.intval(this.list.css(this.lt))+this.tail)}this.tail=null;this.inTail=false;if(this.options.reloadCallback!==null){this.options.reloadCallback(this)}if(this.options.visible!==null){var g=this;var h=Math.ceil(this.clipping()/this.options.visible),f=0,e=0;this.list.children("li").each(function(j){f+=g.dimension(this,h);if(j+1<g.first){e=f}});this.list.css(this.wh,f+"px");this.list.css(this.lt,-e+"px")}this.scroll(this.first,false)},lock:function(){this.locked=true;this.buttons()},unlock:function(){this.locked=false;this.buttons()},size:function(e){if(e!==undefined){this.options.size=e;if(!this.locked){this.buttons()}}return this.options.size},has:function(g,h){if(h===undefined||!h){h=g}if(this.options.size!==null&&h>this.options.size){h=this.options.size}for(var f=g;f<=h;f++){var k=this.get(f);if(!k.length||k.hasClass("jcarousel-item-placeholder")){return false}}return true},get:function(e){return c(">.jcarousel-item-"+e,this.list)},add:function(l,q){var m=this.get(l),h=0,g=c(q);if(m.length===0){var p,k=a.intval(l);m=this.create(l);while(true){p=this.get(--k);if(k<=0||p.length){if(k<=0){this.list.prepend(m)}else{p.after(m)}break}}}else{h=this.dimension(m)}if(g.get(0).nodeName.toUpperCase()=="LI"){m.replaceWith(g);m=g}else{m.empty().append(q)}this.format(m.removeClass(this.className("jcarousel-item-placeholder")),l);var o=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null;var f=this.dimension(m,o)-h;if(l>0&&l<this.first){this.list.css(this.lt,a.intval(this.list.css(this.lt))-f+"px")}this.list.css(this.wh,a.intval(this.list.css(this.wh))+f+"px");return m},remove:function(f){var g=this.get(f);if(!g.length||(f>=this.first&&f<=this.last)){return}var h=this.dimension(g);if(f<this.first){this.list.css(this.lt,a.intval(this.list.css(this.lt))+h+"px")}g.remove();this.list.css(this.wh,a.intval(this.list.css(this.wh))-h+"px")},next:function(){if(this.tail!==null&&!this.inTail){this.scrollTail(false)}else{this.scroll(((this.options.wrap=="both"||this.options.wrap=="last")&&this.options.size!==null&&this.last==this.options.size)?1:this.first+this.options.scroll)}},prev:function(){if(this.tail!==null&&this.inTail){this.scrollTail(true)}else{this.scroll(((this.options.wrap=="both"||this.options.wrap=="first")&&this.options.size!==null&&this.first==1)?this.options.size:this.first-this.options.scroll)}},scrollTail:function(e){if(this.locked||this.animating||!this.tail){return}this.pauseAuto();var f=a.intval(this.list.css(this.lt));f=!e?f-this.tail:f+this.tail;this.inTail=!e;this.prevFirst=this.first;this.prevLast=this.last;this.animate(f)},scroll:function(f,e){if(this.locked||this.animating){return}this.pauseAuto();this.animate(this.pos(f),e)},pos:function(C,k){var n=a.intval(this.list[0].style[this.lt]);if(this.locked||this.animating){return n}if(this.options.wrap!="circular"){C=C<1?1:(this.options.size&&C>this.options.size?this.options.size:C)}var z=this.first>C;var E=this.options.wrap!="circular"&&this.first<=1?1:this.first;var H=z?this.get(E):this.get(this.last);var B=z?E:E-1;var F=null,A=0,w=false,G=0,D;while(z?--B>=C:++B<C){F=this.get(B);w=!F.length;if(F.length===0){F=this.create(B).addClass(this.className("jcarousel-item-placeholder"));H[z?"before":"after"](F);if(this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(B<=0||B>this.options.size)){D=this.get(this.index(B));if(D.length){F=this.add(B,D.clone(true))}}}H=F;G=this.dimension(F);if(w){A+=G}if(this.first!==null&&(this.options.wrap=="circular"||(B>=1&&(this.options.size===null||B<=this.options.size)))){n=z?n+G:n-G}}var s=this.clipping(),u=[],h=0,t=0;H=this.get(C-1);B=C;while(++h){F=this.get(B);w=!F.length;if(F.length===0){F=this.create(B).addClass(this.className("jcarousel-item-placeholder"));if(H.length===0){this.list.prepend(F)}else{H[z?"before":"after"](F)}if(this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(B<=0||B>this.options.size)){D=this.get(this.index(B));if(D.length){F=this.add(B,D.clone(true))}}}H=F;G=this.dimension(F);if(G===0){throw new Error("jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...")}if(this.options.wrap!="circular"&&this.options.size!==null&&B>this.options.size){u.push(F)}else{if(w){A+=G}}t+=G;if(t>=s){break}B++}for(var r=0;r<u.length;r++){u[r].remove()}if(A>0){this.list.css(this.wh,this.dimension(this.list)+A+"px");if(z){n-=A;this.list.css(this.lt,a.intval(this.list.css(this.lt))-A+"px")}}var q=C+h-1;if(this.options.wrap!="circular"&&this.options.size&&q>this.options.size){q=this.options.size}if(B>q){h=0;B=q;t=0;while(++h){F=this.get(B--);if(!F.length){break}t+=this.dimension(F);if(t>=s){break}}}var o=q-h+1;if(this.options.wrap!="circular"&&o<1){o=1}if(this.inTail&&z){n+=this.tail;this.inTail=false}this.tail=null;if(this.options.wrap!="circular"&&q==this.options.size&&(q-h+1)>=1){var y=a.intval(this.get(q).css(!this.options.vertical?"marginRight":"marginBottom"));if((t-y)>s){this.tail=t-s-y}}if(k&&C===this.options.size&&this.tail){n-=this.tail;this.inTail=true}while(C-->o){n+=this.dimension(this.get(C))}this.prevFirst=this.first;this.prevLast=this.last;this.first=o;this.last=q;return n},animate:function(i,e){if(this.locked||this.animating){return}this.animating=true;var f=this;var g=function(){f.animating=false;if(i===0){f.list.css(f.lt,0)}if(!f.autoStopped&&(f.options.wrap=="circular"||f.options.wrap=="both"||f.options.wrap=="last"||f.options.size===null||f.last<f.options.size||(f.last==f.options.size&&f.tail!==null&&!f.inTail))){f.startAuto()}f.buttons();f.notify("onAfterAnimation");if(f.options.wrap=="circular"&&f.options.size!==null){for(var k=f.prevFirst;k<=f.prevLast;k++){if(k!==null&&!(k>=f.first&&k<=f.last)&&(k<1||k>f.options.size)){f.remove(k)}}}};this.notify("onBeforeAnimation");if(!this.options.animation||e===false){this.list.css(this.lt,i+"px");g()}else{var j=!this.options.vertical?(this.options.rtl?{right:i}:{left:i}):{top:i};var h={duration:this.options.animation,easing:this.options.easing,complete:g};if(c.isFunction(this.options.animationStepCallback)){h.step=this.options.animationStepCallback}this.list.animate(j,h)}},startAuto:function(f){if(f!==undefined){this.options.auto=f}if(this.options.auto===0){return this.stopAuto()}if(this.timer!==null){return}this.autoStopped=false;var e=this;this.timer=window.setTimeout(function(){e.next()},this.options.auto*1000)},stopAuto:function(){this.pauseAuto();this.autoStopped=true},pauseAuto:function(){if(this.timer===null){return}window.clearTimeout(this.timer);this.timer=null},buttons:function(g,f){if(g==null){g=!this.locked&&this.options.size!==0&&((this.options.wrap&&this.options.wrap!="first")||this.options.size===null||this.last<this.options.size);if(!this.locked&&(!this.options.wrap||this.options.wrap=="first")&&this.options.size!==null&&this.last>=this.options.size){g=this.tail!==null&&!this.inTail}}if(f==null){f=!this.locked&&this.options.size!==0&&((this.options.wrap&&this.options.wrap!="last")||this.first>1);if(!this.locked&&(!this.options.wrap||this.options.wrap=="last")&&this.options.size!==null&&this.first==1){f=this.tail!==null&&this.inTail}}var e=this;if(this.buttonNext.size()>0){this.buttonNext.unbind(this.options.buttonNextEvent+".jcarousel",this.funcNext);if(g){this.buttonNext.bind(this.options.buttonNextEvent+".jcarousel",this.funcNext)}this.buttonNext[g?"removeClass":"addClass"](this.className("jcarousel-next-disabled")).attr("disabled",g?false:true);if(this.options.buttonNextCallback!==null&&this.buttonNext.data("jcarouselstate")!=g){this.buttonNext.each(function(){e.options.buttonNextCallback(e,this,g)}).data("jcarouselstate",g)}}else{if(this.options.buttonNextCallback!==null&&this.buttonNextState!=g){this.options.buttonNextCallback(e,null,g)}}if(this.buttonPrev.size()>0){this.buttonPrev.unbind(this.options.buttonPrevEvent+".jcarousel",this.funcPrev);if(f){this.buttonPrev.bind(this.options.buttonPrevEvent+".jcarousel",this.funcPrev)}this.buttonPrev[f?"removeClass":"addClass"](this.className("jcarousel-prev-disabled")).attr("disabled",f?false:true);if(this.options.buttonPrevCallback!==null&&this.buttonPrev.data("jcarouselstate")!=f){this.buttonPrev.each(function(){e.options.buttonPrevCallback(e,this,f)}).data("jcarouselstate",f)}}else{if(this.options.buttonPrevCallback!==null&&this.buttonPrevState!=f){this.options.buttonPrevCallback(e,null,f)}}this.buttonNextState=g;this.buttonPrevState=f},notify:function(e){var f=this.prevFirst===null?"init":(this.prevFirst<this.first?"next":"prev");this.callback("itemLoadCallback",e,f);if(this.prevFirst!==this.first){this.callback("itemFirstInCallback",e,f,this.first);this.callback("itemFirstOutCallback",e,f,this.prevFirst)}if(this.prevLast!==this.last){this.callback("itemLastInCallback",e,f,this.last);this.callback("itemLastOutCallback",e,f,this.prevLast)}this.callback("itemVisibleInCallback",e,f,this.first,this.last,this.prevFirst,this.prevLast);this.callback("itemVisibleOutCallback",e,f,this.prevFirst,this.prevLast,this.first,this.last)},callback:function(j,m,e,k,h,g,f){if(this.options[j]==null||(typeof this.options[j]!="object"&&m!="onAfterAnimation")){return}var n=typeof this.options[j]=="object"?this.options[j][m]:this.options[j];if(!c.isFunction(n)){return}var o=this;if(k===undefined){n(o,e,m)}else{if(h===undefined){this.get(k).each(function(){n(o,this,k,e,m)})}else{var p=function(q){o.get(q).each(function(){n(o,this,q,e,m)})};for(var l=k;l<=h;l++){if(l!==null&&!(l>=g&&l<=f)){p(l)}}}}},create:function(e){return this.format("<li></li>",e)},destroy:function(){this.reset();c(window).unbind(".jcarousel");this.list.removeData("jcarousel");this.container.removeData("jcarousel");this.buttonNext.removeData("jcarouselstate").remove();this.buttonPrev.removeData("jcarouselstate").remove();return this},format:function(k,h){k=c(k);var g=k.get(0).className.split(" ");for(var f=0;f<g.length;f++){if(g[f].indexOf("jcarousel-")!=-1){k.removeClass(g[f])}}k.addClass(this.className("jcarousel-item")).addClass(this.className("jcarousel-item-"+h)).css({"float":(this.options.rtl?"right":"left"),"list-style":"none"}).attr("jcarouselindex",h);return k},className:function(e){return e+" "+e+(!this.options.vertical?"-horizontal":"-vertical")},dimension:function(h,i){var g=c(h);if(i==null){return !this.options.vertical?(g.outerWidth(true)||a.intval(this.options.itemFallbackDimension)):(g.outerHeight(true)||a.intval(this.options.itemFallbackDimension))}else{var f=!this.options.vertical?i-a.intval(g.css("marginLeft"))-a.intval(g.css("marginRight")):i-a.intval(g.css("marginTop"))-a.intval(g.css("marginBottom"));c(g).css(this.wh,f+"px");return this.dimension(g)}},clipping:function(){return !this.options.vertical?this.clip[0].offsetWidth-a.intval(this.clip.css("borderLeftWidth"))-a.intval(this.clip.css("borderRightWidth")):this.clip[0].offsetHeight-a.intval(this.clip.css("borderTopWidth"))-a.intval(this.clip.css("borderBottomWidth"))},index:function(e,f){if(f==null){f=this.options.size}return Math.round((((e-1)/f)-Math.floor((e-1)/f))*f)+1}});a.extend({defaults:function(e){return c.extend(d,e||{})},intval:function(e){e=parseInt(e,10);return isNaN(e)?0:e},windowLoaded:function(){b=true}});c.fn.jcarousel=function(g){if(typeof g=="string"){var e=c(this).data("jcarousel"),f=Array.prototype.slice.call(arguments,1);if(typeof e!="undefined"){return e[g].apply(e,f)}return this}else{return this.each(function(){var h=c(this).data("jcarousel");if(h){if(g){c.extend(h.options,g)}h.reload()}else{c(this).data("jcarousel",new a(this,g))}})}}})(jQuery);
;

// ***************************
// js.compressed/history.js
// ***************************
(function(C){var B=window.History,A=B&&!!B.enabled;window.vBulletin=window.vBulletin||{};window.vBulletin.history=window.vBulletin.history||{};B.options.transformHash=false;vBulletin.history.instance=function(F){var E=true,D=!!F&&A;this.isEnabled=function(){return D};this.setDefaultState=function(I,J,G){if(D){E=false;var H=vBulletin.parseUrl(G);G=decodeURI(H.pathname)+decodeURIComponent(H.search);B.replaceState(I,J,G);E=true}};this.setStateChange=function(I,G){if(D){var H="statechange"+(G?"."+G:"");B.Adapter.bind(window,H,function(J){if(E){I.apply(this,C.makeArray(arguments))}})}};this.pushState=function(I,J,G){if(D){E=false;var H=vBulletin.parseUrl(G);G=decodeURI(H.pathname)+decodeURIComponent(H.search);B.pushState(I,J,G);E=true}};this.getState=function(){if(D){return B.getState()}};this.log=function(){if(D){B.log.call(window,arguments)}};if(D){if(!C(window).data("hashchange.history")){B.Adapter.bind(window,"hashchange.history",function(L){var H=location.hash,I,K;if(E&&H){K=H.match(/#post(\d+)/);if(K&&(Number(K[1])+"")===K[1]&&Number(K[1])>1&&C(H).length==0&&C(".conversation-content-widget").length){var J=vBulletin.parseUrl(location.href),G=[J.pathname,J.search,(J.search?"&":"?"),"p=",K[1],K[0]];location.replace(G.join(""))}else{setTimeout(function(){history.back()},0);I=vBulletin.scrollToAnchor(H);if(I){window.scrollTo(0,0)}}}})}C(window).data("hashchange.history",true)}return this}})(jQuery);;

// ***************************
// js.compressed/autocomplete.js
// ***************************
window.vBulletin=window.vBulletin||{};window.vBulletin.phrase=window.vBulletin.phrase||{};window.vBulletin.phrase.precache=window.vBulletin.phrase.precache||[];window.vBulletin.phrase.precache=$.merge(window.vBulletin.phrase.precache,[]);var vBulletin_Autocomplete=function(T,a){var B=$(T),Y=a.apiClass||null,K=a.apiFunction||"getAutocomplete",c=a.delay||500,b=a.minLength||3,X=a.maxItems||false,F=B.attr("name")||"autocompleteElements",I=a.containerClass||"entry-field",J=a.placeholderText,M=[],A=B.parent(".autocomplete-container"),e=A.find(".autocompleteHelper"),Z=false,R=false,P=B.siblings(".autocomplete-box"),H=a.beforeAdd||false,G=a.afterAdd||false,E=a.beforeDelete||false,C=a.afterDelete||false,N=this,W=a.editorContext||null,V=function(){if(A.length==0){B.wrap('<div class="autocomplete-container" />');A=B.parent(".autocomplete-container");A.addClass(I).on("mousedown",function(k){var i=this;setTimeout(function(){var l=$(".autocompleteHelper:visible",i);if(l.length>0){l[0].focus()}},10);return false})}if(P.length==0){P=$("<div />").addClass("autocomplete-box").insertBefore(B)}if(e.length==0){e=$('<input type="text" name="autocompleteHelper" />').addClass("autocompleteHelper b-form-input__input--hide-clear-button").attr("placeholder",function(){return J?J:null}).attr("maxlength",function(){return B.attr("maxlength")?B.attr("maxlength"):null}).insertAfter(P)}e.attr("tabindex",B.attr("tabindex")||0);e.off("keydown").on("keydown",function(k){if(k.which==13){var i=$(k.target).val();if(i.length>=b){Q(i,true,k)}}});e.off("blur").on("blur",function(i){Z=window.setTimeout(function(){if(!R){var k=e.val();if(k.length>=b){Q(k,true,i)}}R=false;Z=false},200)});e.off("focus").on("focus",function(i){R=Z?true:false;return false});var g=["font-family","font-size","font-weight","font-style","color","line-height","height"];var h;for(h=0;h<g.length;++h){A.css(g[h],B.css(g[h]))}var f='<input type="hidden" name="'+F+'"';if(B.attr("id")){f+=' id="'+B.attr("id")+'"'}if(B.attr("class")){f+=' class="'+B.attr("class")+'"'}if(B.attr("data-value")){var j=B.attr("data-value").split(",")}f+=" />";B.replaceWith(f);B=A.find('[name="'+F+'"]');e.autocomplete({delay:c,minLength:b,search:function(i,k){console.log("searching for "+this.value)},source:function(i,k){console.log("getting source for "+i.term);vBulletin.AJAX({url:vBulletin.getAjaxBaseurl()+"/ajax/api/"+Y+"/"+K,data:({searchStr:i.term}),success:function(m){console.log("got source for "+i.term+":");if(m&&$.isArray(m.suggestions)){var l=[];$.each(m.suggestions,function(n,o){if(W&&W.type=="tags"){l.push({label:o.title,value:pageData.userid})}else{l.push({label:o.title,value:o.value})}});k(l)}else{console.log("/ajax/api/"+Y+"/"+K+" successful, but response was not an array");openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("invalid_server_response_please_try_again"),iconType:"error"})}},error_phrase:"error_getting_suggestions"})},select:function(k,i){N.addElement(i.item.label,i.item.value);e.val("");k.preventDefault()},focus:function(k,i){e.val(i.item.label);k.preventDefault()}});P.delegate(".element-x","click",function(n){var l=$(this).closest(".autocomplete");var k=l.find(".element-text").text().toLowerCase();var i=[];var m=false;$(M).each(function(o,p){if(p.label.toLowerCase()==k){m=p}else{i.push(p)}});if(typeof E=="function"){if(!E.call(this,m.label,m.data)){return false}}M=i;l.remove();d();if(typeof C=="function"){C.call(this,m.label,m.data)}});A.off("click").on("click",function(i){if(!$(i.target).hasClass("ui-autocomplete-input")){$(".ui-autocomplete-input",$(this)).focus()}return false});if(j){U.call(this,j)}},L=function(j,i){if(j==""){return false}if(typeof H=="function"){if(!H.call(this,j,i)){return false}}var h=true;$(M).each(function(l,m){if(m.label==j){h=false}});if(!h){return false}if(X){if(M.length>=X){return false}}var k=$("<div />").addClass("element-x vb-icon vb-icon-x-blue").text("X");var f=$("<div />").addClass("element-text").text(j);var g=$("<div />").addClass("autocomplete").append(f).append(k).appendTo(P);M.push({label:j,value:i});d();if(typeof G=="function"){G.call(this,j,i)}P.show();return true},U=function(h){var f=h.length,g;for(g=0;g<f;++g){L(h[g])}},S=function(f){O();U(f)},O=function(){P.html("");e.val("");M=[];d()},d=function(){var f=[];$(M).each(function(g,h){f.push(h.label)});B.val(f.join(","))},D=function(){return b},Q=function(h,f,g){if(W){switch(W.type){case"tags":W.context.addTag(h);break;default:break}}else{N.addElement(h,h);e.val("")}if(typeof f!=="undefined"&&typeof g!=="undefined"){g.preventDefault();return false}};V.call(this);this.addElement=function(g,f){return L.call(this,g,f)};this.addElements=function(f){U.call(this,f)};this.setElements=function(f){S.call(this,f)};this.getElements=function(){return M};this.getLabels=function(){var f=[];$(M).each(function(g,h){f.push(h.label)});return f};this.getValues=function(){var f=[];$(M).each(function(g,h){f.push(h.value)});return f};this.getInputField=function(){return e};this.clearElements=function(){return O.call(this)};this.countElements=function(){return $(M).length};this.getMinLength=function(){return D()}};;

// ***************************
// js.compressed/poll.js
// ***************************
window.vBulletin=window.vBulletin||{};window.vBulletin.phrase=window.vBulletin.phrase||{};window.vBulletin.phrase.precache=window.vBulletin.phrase.precache||[];window.vBulletin.phrase.precache=$.merge(window.vBulletin.phrase.precache,["vote_failed","vote_now","votes"]);window.vBulletin.options=window.vBulletin.options||{};window.vBulletin.options.precache=window.vBulletin.options.precache||[];window.vBulletin.options.precache=$.merge(window.vBulletin.options.precache,["maxpolloptions"]);(function(A){A(document).ready(function(){function E(I){var H=window.vBulletin.options.get("maxpolloptions"),G=(H>3)?3:H;I.off("click",".js-poll__view-results").on("click",".js-poll__view-results",function(L){L.preventDefault();var K=A(this).attr("data-nodeid"),J=A(this).closest("form");A.get(vBulletin.getAjaxBaseurl()+"/poll/get",{nodeid:K},function(M){B(J,M)},"json")});I.off("click",".js-poll__back-to-poll").on("click",".js-poll__back-to-poll",function(K){K.preventDefault();var J=A(this).closest(".js-poll__parent");J.find("div.pollresults").addClass("h-hide");J.find("form.poll").show()});I.off("click",".b-poll-fieldset__add-more").on("click",".b-poll-fieldset__add-more",function(L){var M=A(this),K=M.prev(".b-poll-fieldset__poll-answers"),J=K.find("li").first().clone(true);J.find(".b-form-input__input").val("").attr("name","polloptions[new][]");J.find(".js-remove-button").prop("disabled",false);J.appendTo(K).find(".b-form-input__input").focus();if(K.find("li").length==H){M.addClass("h-hide")}K.find(".js-remove-button").prop("disabled",false);return false});I.off("click",".b-poll-fieldset__poll-answers .js-remove-button").on("click",".b-poll-fieldset__poll-answers .js-remove-button",function(){var K=A(this),J=K.closest(".b-poll-fieldset__poll-answers");K.closest("li").remove();J.next(".b-poll-fieldset__add-more").removeClass("h-hide");if(J.find("li").length==1){J.find(".js-remove-button").prop("disabled",true)}return false});I.off("click",".js-poll-timeout").on("click",".js-poll-timeout",function(K){var J=A(this).closest(".b-poll-fieldset__poll-options").next(".b-poll-fieldset__datepicker-container");if(this.checked){J.removeClass("h-hide")}else{J.addClass("h-hide").find(".b-datepicker__input").val("")}});I.off("submit.formpoll","form.poll").on("submit.formpoll","form.poll",function(M){M.preventDefault();var J=A(this);var L=J.find('[name="polloptionid"]:checked').val();var K=[];J.find('[name="polloptionids[]"]:checked').each(function(){K.push(A(this).val())});A.post(vBulletin.normalizeAjaxUrl(J.attr("action")),{polloptionid:L,"polloptionids[]":K},function(O){if(O==false){openAlertDialog({title:vBulletin.phrase.get("vote_now"),message:vBulletin.phrase.get("vote_failed"),iconType:"warning"})}else{B(J,O);var N=J.parent();A("div.pollresults",N).find(".js-poll__back-to-poll").remove()}},"json")});A(document).off("click",".pollresults-data .voter-icon").on("click",".pollresults-data .voter-icon",function(){var J=A(this);if(J.find(".voters").is(":visible")){return false}A(".pollresults-data tr td.pollvoter-cell .voter-icon .voters").hide();var M=J.attr("data-node-id");var L=J.attr("data-polloption-id");var K=J.closest("form");A.get(vBulletin.getAjaxBaseurl()+"/poll/get-voters",{nodeid:M,polloptionid:L},function(N){if(N){if(!N.error){C(K,N,L,J)}else{D({message:N.error,type:"error"},J)}}else{D({message:"Error retrieving voters.",type:"error"},J)}},"json")});A(document).off("click",".pollresults-data .voter-icon .voters").on("click",".pollresults-data .voter-icon .voters",function(){e.stopPropagation();return true});if(A(".polloptioncontainer.new",I).length>0){for(var F=0;F<G-1;F++){A("a#addanswer",I).click()}if(G==H){A("a#addanswer",I).hide()}}}vBulletin.conversation.bindEditFormEventHandlers("poll");function D(H,G){var I=G.find(".voters");if(H.message){var F=A("<span />").addClass(H.type).text(H.message);I.html(F)}else{I.html(H.voters)}I.fadeIn("slow");A("body").on("click.voterpopup",function(J){if(A(J.target).closest(".voter-icon").length==0){I.hide();A("body").off("click.voterpopup")}})}function C(F,H,K,I){var M=false;if(H.options){B(F,H);var J=H.options[K];if(J){M=true;if(!A.isEmptyObject(J.votersinfo)){var L=[];for(var G in J.votersinfo){L.push('<a href="{0}">{1}</a>'.format(pageData.baseurl+J.votersinfo[G].profileUrl,J.votersinfo[G].username))}D({voters:L.join(", ")},I)}else{D({message:"No one has voted for this option yet. Be the first one to vote.",type:"note"},I)}}}if(!M){D({message:"Error retrieving voters.",type:"error"},I)}}function B(G,K){var F=G.parent();var H=K.options;for(var I in H){var J=A(".pollresults-option-"+H[I].polloptionid);J.find(".title").html(JShtmlEncode(H[I].title));J.find(".bar-container .bar").css("width",H[I].percentage+"%");J.find(".percentage").html(H[I].percentage+"%");J.find(".votes span").html(H[I].votes);if(H[I].votes>1){J.find(".votes label").html(vBulletin.phrase.get("votes"))}}A(".pollresults .pollvote-count span",F).html(K.poll_votes);if(K.poll_votes>1){A(".pollresults .pollvote-count label",F).html(vBulletin.phrase.get("votes"))}G.hide();A("div.pollresults",F).removeClass("h-hide")}E(A(document))})})(jQuery);;

// ***************************
// js.compressed/vbSlideshow.js
// ***************************
window.vBulletin=window.vBulletin||{};window.vBulletin.phrase=window.vBulletin.phrase||{};window.vBulletin.phrase.precache=window.vBulletin.phrase.precache||[];window.vBulletin.phrase.precache=$.merge(window.vBulletin.phrase.precache,["gallery_slideshow","no_photos_found_or_post_deleted"]);(function(A){window.vBulletin=window.vBulletin||{};vBulletin.gallery=vBulletin.gallery||{};A(document).ready(function(){var F=5,B=A("#slideshow-dialog"),G=0;A(document).off("click",".b-gallery-thumbnail-list__item").on("click",".b-gallery-thumbnail-list__item",function(){var M=A(this);if(M.closest("#preview-overlay").length==1){return false}var H=M.attr("data-channelid"),K=M.closest(".photoPreviewBox"),J=M.attr("src");if(typeof (J)==="undefined"){J=M.attr("href")}G=(K.length>0)?K.index():M.index();A(document).off("click","#slideshow-dialog .close-btn").on("click","#slideshow-dialog .close-btn",function(){B.dialog("close")});A(document).off("click",".thumbnails .image-wrapper").on("click",".thumbnails .image-wrapper",function(P,O){if(typeof O=="undefined"){O=true}A(".thumbnails .image-wrapper",B).addClass("dimmed");A(this).removeClass("dimmed");var N=Number(A(this).parent().attr("jcarouselindex"));B.data("thumbclick",true);vBulletin.gallery.slideshow.jcarousel("scroll",N,O);B.removeData("thumbclick")});B.dialog({autoOpen:false,resizable:false,closeOnEscape:true,showTitleBar:false,modal:true,width:550,height:A("html.firefox.no-touch").length?524:520,dialogClass:"slideshow-dialog",open:function(){A(".ui-widget-overlay").bind("click",function(){B.dialog("close")})},close:function(O,N){if(vBulletin.gallery.thumbnails){vBulletin.gallery.thumbnails.jcarousel("destroy")}if(vBulletin.gallery.slideshow){vBulletin.gallery.slideshow.jcarousel("destroy")}}});var I=B.find(".slideshow-wrapper .slideshow-list");if(I.length==0){I=B.find(".slideshow-wrapper").append(A("<ul />").addClass("slideshow-list"))}B.dialog("open");window.vBulletin.loadingIndicator.show();var L=M.closest(".js-slideshow__gallery-node").attr("data-node-id")||M.closest(".js-slideshow__gallery-node").attr("data-nodeid")||M.closest(".js-post-sm").attr("data-nodeid");vBulletin.gallery.slideshow=I.jcarousel({wrap:null,animation:"slow",easing:"swing",scroll:1,rtl:A("html").attr("dir")=="rtl",initCallback:function(S,R){if(R=="init"){var P=M.closest(".b-content-entry-panel__content--gallery").find(".js-photo-postdata input");if(P.length>0){var U={photos:[]};P.filter('[name="filedataid[]"]').each(function(){var V={title:JShtmlEncode(P.filter('[name="title_'+this.value+'"]').val()),url:pageData.baseurl+"/filedata/fetch?filedataid="+this.value,thumb:pageData.baseurl+"/filedata/fetch?thumb=1&filedataid="+this.value};U.photos.push(V)});setTimeout(function(){E(U,S)},10)}else{var Q={nodeid:L};if(vBulletin.media&&vBulletin.media.MEDIA_USERID){Q.userid=vBulletin.media.MEDIA_USERID}if(H){Q.channelid=H}var N=parseInt(A(".albumSlideShowPageNo").val());if(!isNaN(N)){Q.pageno=N}var O=parseInt(A(".albumSlideShowPerPage").val());if(!isNaN(O)){Q.perpage=O}var T=A(".media-tab .media-filter-overlay .filter-options input:checked").val();if(T){Q.dateFilter=T}if(!isNaN(G)){Q.startIndex=G}A.get(vBulletin.getAjaxBaseurl()+"/filedata/gallery",Q,function(V){if(!V&&J){V={photos:[{title:"",url:J,thumb:""}]}}E(V,S)},"json").complete(function(){window.vBulletin.loadingIndicator.hide()})}}},itemVisibleInCallback:{onBeforeAnimation:function(T,R,Q,S){if(S=="init"){return false}var U=B.data("image-data");if(U){var N=U.photos.length;if(Q>0){while(Q>N){Q-=N}}else{while(Q<=0){Q+=N}}var P="";if(U.photos[Q-1].links){P+='<div class="links">'+U.photos[Q-1].links+"</div>"}if(U.photos[Q-1].title){P+='<div class="title">'+U.photos[Q-1].title+"</div>"}if(P.length>0){B.find(".caption").html(P)}else{B.find(".caption").hide()}if(!B.data("thumbclick")){var O=vBulletin.gallery.thumbnails.data("visible-range")||{first:1,last:F};if(Q<O.first||Q>O.last){vBulletin.gallery.thumbnails.jcarousel("scroll",Q,true)}A("#slideshow-dialog .thumbnails .image-wrapper").addClass("dimmed");vBulletin.gallery.thumbnails.jcarousel("get",Q).find(".image-wrapper").removeClass("dimmed")}}}}});return false});function E(L,K){if(!L||!L.photos){openAlertDialog({title:vBulletin.phrase.get("gallery_slideshow"),message:vBulletin.phrase.get("no_photos_found_or_post_deleted"),iconType:"warning"});return }B.data("image-data",L);D(K,L,B);var H="";if(L.photos[0].links){H+='<div class="links">'+L.photos[0].links+"</div>"}if(L.photos[0].title){H+='<div class="title">'+L.photos[0].title+"</div>"}if(H.length>0){B.find(".caption").html(H)}else{B.find(".caption").hide()}if(L.photos.length>1){vBulletin.gallery.thumbnails.jcarousel("get",1).find(".image-wrapper").removeClass("dimmed")}var J=G;var I=parseInt(A(".albumSlideShowPerPage").val());if(!isNaN(I)){J=G%I}if(J>0){A(".thumbnails .image-wrapper",B).eq(J).trigger("click",[false])}window.vBulletin.loadingIndicator.hide()}function D(I,K,H){I.size(K.photos.length);if(K.photos.length>1){A("#slideshow-dialog .thumbnails").show();C(K)}else{A("#slideshow-dialog .thumbnails").hide();H.dialog("option","height","auto")}var J=I.first||1;A.each(K.photos,function(M,L){I.add(J+M,'<div class="image-wrapper"><img src="{0}" alt="{1}" class="image" /></div>'.format(L.url,L.title))})}function C(I){var H=A("#slideshow-dialog .thumbnails .thumbnail-list");if(H.length==0){H=A("#slideshow-dialog .thumbnails").append(A("<ul />").addClass("thumbnail-list"))}vBulletin.gallery.thumbnails=H.jcarousel({wrap:null,animation:"fast",easing:"swing",scroll:F,rtl:A("html").attr("dir")=="rtl",size:I.photos.length,initCallback:function(K,J){if(J=="init"){K.size(I.photos.length);A.each(I.photos,function(N,M){var L=(K.first||1)+N;if(K.has(L)){return true}if(L>I.photos.length){return false}var O=A("<img />").addClass("thumbnail").on("load",function(){}).attr({src:M.thumb,alt:""}).appendTo(A("<div />").addClass("image-wrapper dimmed"));K.add(L,O.parent().get(0))});if(K.size()<F){K.buttonNext.hide();K.buttonPrev.hide()}}},itemVisibleInCallback:{onBeforeAnimation:function(M,K,J,L){A("#slideshow-dialog .thumbnails").data("visible-range",{first:M.first,last:M.last})}}}).disableSelection()}})})(jQuery);;

// ***************************
// js.compressed/conversation_filter.js
// ***************************
window.vBulletin=window.vBulletin||{};window.vBulletin.phrase=window.vBulletin.phrase||{};window.vBulletin.phrase.precache=window.vBulletin.phrase.precache||[];window.vBulletin.phrase.precache=$.merge(window.vBulletin.phrase.precache,["invalid_request","invalid_search_syntax","invalid_server_response_please_try_again","unknown_error"]);(function(A){vBulletin.conversation=vBulletin.conversation||{};vBulletin.conversation.filter=function(K){var N=this;var E=null;var F=0;var J=false;var C=false;var I="conversation_filter";var O={context:document,autoCheck:false,checkInterval:15000,scrollToTop:null,customFilter:null,onContentLoad:null,closeOverlayOnScroll:true,pagination:null,allowHistory:false,tabParamAsQueryString:true,hash:""};if(K&&typeof K=="object"){A.extend(O,K)}var B=new vBulletin.history.instance(O.allowHistory);function H(){A(".toolbar-filter-overlay input[type=radio]",O.context).off("change."+I).on("change."+I,function(X,W,b){var R,U,S=A(this),d=A(this.form);if(!B.isEnabled()&&O.allowHistory){R=vBulletin.makePaginatedUrl(location.href,1);location.href=vBulletin.makeFilterUrl(R,this.name,this.value,O.context,O.hash);return true}J=true;O.customFilter=null;if(!S.data("bypass-filter-display")){M(this)}U=S.closest(".conversation-toolbar-wrapper");if(A(".conversation-toolbar-wrapper",O.context).length>1){$toolbarWrappers.filter("."+(U.hasClass("top")?"bottom":"top")).find("input[name={0}][value={1}]".format(this.name,this.value)).prop("checked",true)}if(this.value=="conversations_on"){O.autoCheck=true;C=true;F=1}else{clearTimeout(F);C=(this.name=="filter_show")}A(".new-conversations-strip",O.context).hide();N.updatePageNumber(b||1);var T=A('.filtered-by .filter-text[data-filter-name="q"]',O.context);if(T.length){var Q=N.getSelectedFilters(d);Q.q=T.data("filter-value");N.setOption("customFilter",Q);N.forceApplyFilters()}else{N.applyFilters(false)}if(B.isEnabled()&&!W){var V=N.getSelectedFilters(d),c=this.name,P=this.value,a=A(".filtered-by",U),Z={from:"filter",page:1,tab:O.tabParamAsQueryString?"#"+U.closest(".ui-tabs-panel").attr("id"):vBulletin.getSelectedTabHashOrPath(U.closest(".ui-tabs"),false),filters:V,filtervalue:P,filtername:c};if(!a.data("reset")){R=vBulletin.makePaginatedUrl(location.href,1);R=vBulletin.makeFilterUrl(R,c,P,O.context)}else{R=location.pathname.replace(/\/page[0-9]+/,"");if(O.tabParamAsQueryString){var Y=vBulletin.parseQueryString(location.search);if(Y.tab){R+="?tab="+Y.tab}else{if(Y.view){R+="?view="+Y.view}}}}B.pushState(Z,document.title,R);a.data("reset",null)}});A(".new-conversations-strip",O.context).off("click."+I).on("click."+I,function(){A(this).hide();C=true;N.updatePageNumber(1);N.applyFilters(false,true)});A(".toolbar-filter",O.context).off("click."+I).on("click."+I,function(U,T,R){var S=A(this).closest(".conversation-toolbar-wrapper");var Q=(S.hasClass("bottom"))?"bottom":"top";if(typeof T=="undefined"){T="slow"}var V=A(".filter-wrapper",this).toggleClass("selected");A(".arrow .vb-icon",this).toggleClass("vb-icon-triangle-down-wide vb-icon-triangle-up-wide");A(".toolbar-filter-overlay",S).slideToggle(T,function(){var W=I+Q;if(A(this).is(":visible")){A("body").off("click."+W).on("click."+W,function(c){var a=".conversation-toolbar-wrapper."+Q;if(A(c.target).closest(".toolbar-filter-overlay").length==0&&A(c.target).closest(".toolbar-filter").length==0){A("body").off("click."+W);A(window).off("scroll."+W);var b=(A(c.target).closest(".toolbar-filter").length>0)?"fast":"slow";A(".conversation-toolbar-wrapper.{0} .conversation-toolbar .toolbar-filter".format(Q),O.context).triggerHandler("click."+I,[b])}});var Y=true;if(R!="scroll"){var X=A(".filtered-by",O.context);if(X.length==0||X.is(":hidden")){X=this}var Z={};Y=vBulletin.isScrolledIntoView(X,Z);if(!Y){A("html,body").animate({scrollTop:"+="+Math.abs(Z.bottom)},"fast",function(){setTimeout(function(){if(O.closeOverlayOnScroll){A(window).off("scroll."+W).on("scroll."+W,function(){A(".conversation-toolbar-wrapper.{0} .conversation-toolbar .toolbar-filter".format(Q),O.context).triggerHandler("click."+I,[0,"scroll"])})}},50)})}}if(Y){if(O.closeOverlayOnScroll){A(window).off("scroll."+W).on("scroll."+W,function(){A(".conversation-toolbar-wrapper.{0} .conversation-toolbar .toolbar-filter".format(Q),O.context).triggerHandler("click."+I,[0,"scroll"])})}}}else{A("body").off("click."+W);A(window).off("scroll."+W)}});if(S.hasClass("bottom")&&A(".arrow .vb-icon",this).hasClass("vb-icon-triangle-up-wide")){var P=A(".conversation-toolbar-wrapper.bottom .toolbar-filter-overlay",O.context);A("html, body").animate({scrollTop:P.offset().top+P.innerHeight()},500)}});A(".filtered-by",O.context).off("click."+I,".x").on("click."+I,".x",function(){var T=A(this),Q=T.closest(".filtered-by"),W=T.closest(".filter-text"),S=W.data("filter-name"),V=A(),R;Q.data("clicked",true);if(!B.isEnabled()&&O.allowHistory){var P;if(W.data("filter-type")=="text"&&W.data("filter-js-selector")){P=vBulletin.makePaginatedUrl(location.href,1);location.href=vBulletin.makeFilterUrl(P,"q","",O.context,O.hash,true)}else{P=vBulletin.makePaginatedUrl(location.href,1);location.href=vBulletin.makeFilterUrl(P,S,W.data("filter-value"),O.context,O.hash,true)}return false}V=A(".toolbar-filter-overlay .filter-options input[name={0}]".format(S),O.context).prop("checked",false).filter(".js-default-checked");N.updatePageNumber(1);if(W.data("filter-type")=="text"&&W.data("filter-js-selector")){A(W.data("filter-js-selector")).val("");R=N.getSelectedFilters(A("form.toolbar-filter-overlay",O.context));delete R[S];N.setOption("customFilter",R)}W.remove();var U=Q.find(".filter-text").length;if(U==0){Q.addClass("h-hide");Q.data("reset",true)}else{if(U==1){Q.find(".clear-all").addClass("h-hide")}}if(V.length==1){V.data("bypass-filter-display",true);V.trigger("click."+I);V.data("bypass-filter-display",null)}else{if(R){var P=vBulletin.makePaginatedUrl(location.href,1);P=vBulletin.makeFilterUrl(P,"q","",O.context);B.pushState({from:"filter",page:1,tab:O.tabParamAsQueryString?"#"+T.closest(".ui-tabs-panel").attr("id"):vBulletin.getSelectedTabHashOrPath(T.closest(".ui-tabs"),false),filters:R},document.title,P)}N.forceApplyFilters();if(R){N.setOption("customFilter",null)}}});A(".filtered-by",O.context).off("click."+I,".clear-all").on("click."+I,".clear-all",function(){var P=A(this).closest(".conversation-toolbar-wrapper");A(this).data("clicked",true);N.setOption("customFilter",null);N.resetFilters(false,false,P);return false});A(".conversation-toolbar .filter-wrapper",O.context).data("object-instance",N);A(".conversation-showmore",O.context).click(function(){var P=parseInt(A('form.toolbar-filter-overlay input[name="pagenum"]',O.context).val());C=false;N.updatePageNumber(P+1);N.applyFilters(false,true,true)});A(".conversation-toolbar .toolbar-search-form",O.context).off("submit.filtersearch").on("submit.filtersearch",function(){var P="q";$searchBox=A(this.elements[P]),searchKeyword=A.trim($searchBox.val()),$conversationToolbar=A(this).closest(".conversation-toolbar-wrapper"),Q;$searchBox.val(searchKeyword);if(!B.isEnabled()&&O.allowHistory){Q=vBulletin.makePaginatedUrl(location.href,1);location.href=vBulletin.makeFilterUrl(Q,P,searchKeyword,$conversationToolbar);return false}var T=O.tabParamAsQueryString?"#"+A(this).closest(".ui-tabs-panel").attr("id"):vBulletin.getSelectedTabHashOrPath(A(this).closest(".ui-tabs"),false);if(searchKeyword){var S=N.getSelectedFilters($conversationToolbar.find(".toolbar-filter-overlay")),U={};U[P]=searchKeyword;A.extend(S,U);N.setOption("customFilter",S);N.forceApplyFilters();N.displayCustomFilterText(this.elements[P]);if(B.isEnabled()){Q=vBulletin.makePaginatedUrl(location.href,1);Q=vBulletin.makeFilterUrl(Q,P,searchKeyword,$conversationToolbar);B.pushState({from:"filter",page:1,tab:T,filters:S},document.title,Q)}}else{var R=$conversationToolbar.find('.filter-text[data-filter-name="{0}"]'.format(P));if(R.length){var S=N.getSelectedFilters($conversationToolbar.find(".toolbar-filter-overlay"));N.setOption("customFilter",S);A(".x",R).trigger("click");if(B.isEnabled()){var Q=vBulletin.makePaginatedUrl(location.href,1);Q=vBulletin.makeFilterUrl(Q,P,searchKeyword,$conversationToolbar);B.pushState({from:"filter",page:1,tab:T,filters:S},document.title,Q)}}}return false})}function M(P,Q){vBulletin.conversation.displaySelectedFilterText(P,Q,O.context)}H();this.isFilterSelected=function(P){return A('.toolbar-filter-overlay input[value="'+P+'"]',O.context).is(":checked")};this.getSelectedFilters=function(P){return vBulletin.getSelectedFilters(P,false)};this.resetFilterForms=function(P){if(!P||(P instanceof A&&!P.length)){P=O.context}A(".toolbar-filter-overlay .js-default-checked",P).prop("checked",true);A(".toolbar-search-form .js-filter-search",P).val("").filter(".placeholder").focus().blur()};A(".toolbar-filter-overlay, .toolbar-search-form",O.context).trigger("reset");if(B.isEnabled()){var D=B.getState();if(!D||A.isEmptyObject(D.data)){var G=A(O.context).hasClass("ui-tabs-panel")?A(O.context).attr("id"):A(".conversation-toolbar-wrapper",O.context).closest(".ui-tabs-panel").attr("id"),L={from:"filter",page:Number(A(".pagenav-form .defaultpage",O.context).val())||1,tab:vBulletin.getSelectedTabHashOrPath(A(O.context).closest(".ui-tabs"),O.tabParamAsQueryString),filters:N.getSelectedFilters(A("form.toolbar-filter-overlay",O.context))};B.setDefaultState(L,document.title,location.href)}B.setStateChange(function(X,c,Y){var P=B.getState();if(P.data.from=="filter"||c=="pagination"||c=="tabs"){B.log(P.data,P.title,P.url);var S,Q;if(P.data.tab){S=O.tabParamAsQueryString?A(P.data.tab):A('.ui-tabs .ui-tabs-panel[data-url-path="'+P.data.tab+'"]')}Q=(S&&S.length&&S)||O.context;if(c=="pagination"){if(Y){var a=A(".filtered-by",Q),R=A(".toolbar-filter-overlay .filter-options-list",Q),b=false;A(".filter-text",a).filter('[data-filter-name!="q"]').remove();A(".clear-all",a).addClass("h-hide");R.find(".js-default-checked").prop("checked",true);A.each(Y,function(e,f){var d=A('input[name="{0}"][value="{1}"]'.format(e,f),R);if(d.length){d.prop("checked",true).trigger("change",[true,P.data.page]);b=true}});if(!b){R.first().data("bypass-filter-display",true).trigger("change",[true,P.data.page]).data("bypass-filter-display",null);a.addClass("h-hide")}}}else{var W=A(Q).closest(".ui-tabs"),T=O.tabParamAsQueryString?W.find('.ui-tabs-nav > li > a[href*="{0}"]'.format(P.data.tab)):W.find('.ui-tabs-nav > li > a[data-url-path="'+P.data.tab+'"]');if(!T.parent().hasClass("ui-tabs-selected")){var V=T.parent().index();vBulletin.selectTabByIndex.call(W,V)}else{var U=N.getSelectedFilters(A(".toolbar-filter-overlay",Q)),Z=A(".conversation-toolbar .filter-wrapper",Q).data("object-instance")||N;if(!vBulletin.areJsonObjectsEqual(U,P.data.filters)){Z.setOption("context",Q);Z.updatePageNumber(P.data.page);Z.applyHistoryFilters(P.data)}}}}},"filter")}this.displayCustomFilterText=function(P,Q){M(P,(Q||A(P).val()))};this.isHistoryEnabled=function(){return B.isEnabled()};this.resetFilters=function(U,Q,T){if(!T||(T instanceof A&&!T.length)){T=O.context}var S=A(".filtered-by",T).addClass("h-hide"),R=location.pathname.replace(/\/page[0-9]+/,"");if(O.tabParamAsQueryString){var P=vBulletin.parseQueryString(location.search);if(P.tab){R+="?tab="+P.tab}else{if(P.view){R+="?view="+P.view}}}A(".clear-all",S).addClass("h-hide");A(".filter-text",S).remove();N.resetFilterForms(T);if(!U){if(B.isEnabled()){S.data("reset",true);N.updatePageNumber(1);var V=N.getSelectedFilters(A("form.toolbar-filter-overlay",T));if(Q){var W=A(".toolbar-search-form .js-filter-search",T).val("");delete V[W.attr("name")];N.setOption("customFilter",V)}N.forceApplyFilters();L={from:"filter",page:1,tab:O.tabParamAsQueryString?"#"+S.closest(".ui-tabs-panel").attr("id"):vBulletin.getSelectedTabHashOrPath(S.closest(".ui-tabs"),false),filters:V};B.pushState(L,document.title,R)}else{if(O.allowHistory){location.href=R}}}return N};this.applyHistoryFilters=function(R){if(R&&R.filters&&!A.isEmptyObject(R.filters)){var S=O.tabParamAsQueryString?A(R.tab):A('.ui-tabs .ui-tabs-panel[data-url-path="'+R.tab+'"]'),U=A(".toolbar-filter-overlay",S);if(typeof (N.lastFilters)!="undefined"){delete N.lastFilters}N.resetFilters(true,false,S);A.each(R.filters,function(V,X){var W=A('[name="'+V+'"]',U);if(W.attr("type")=="hidden"){W.val(X)}else{if(W.attr("type")=="radio"&&X!=R.filtervalue){W.filter('[value="'+X+'"]').prop("checked",true)}}});var Q=vBulletin.parseQueryString(location.href),T=true,P=function(){A(".toolbar-search-form .js-filter-search",S).val("").filter(".placeholder").focus().blur()};if(!A.isEmptyObject(Q)){A.each(Q,function(W,X){var V=A('.filter-options-list input[name="{0}"][value="{1}"]'.format(W,X),U);if(V.length){if(R.filtername==W&&R.filtervalue==X){T=false;V.prop("checked",true).trigger("change",[true])}else{M(V.get(0))}}else{V=A('.toolbar-search-form .search-container input[name="{0}"]'.format(W),S);if(V.length&&X){M(V.get(0),X);V.val(X)}else{P()}}})}else{P()}if(T){N.setOption("customFilter",R.filters);N.forceApplyFilters();N.setOption("customFilter",null)}}return N};this.forceApplyFilters=function(){if(typeof (N.lastFilters)!="undefined"){delete N.lastFilters}C=true;N.applyFilters(false,true);return N};this.applyFilters=function(S,U,P,T){var W=A(".toolbar-filter-overlay",O.context);if(U){clearTimeout(F)}var Q={filters:(!O.customFilter)?N.getSelectedFilters(W):O.customFilter,isAjaxTemplateRender:true,isAjaxTemplateRenderWithData:true};if(A.isEmptyObject(Q.filters)){return N}if(S){Q.filters["checkSince"]=E;Q.filters["pagenum"]=1}if(!T){var R=W.find('input[name="result-id"]').val(0);if(R.length){Q.filters["result-id"]=0}}else{C=true}if(typeof (this.lastFilters)!="undefined"&&vBulletin.areJsonObjectsEqual(this.lastFilters.filters,Q.filters)&&!S){return N}this.lastFilters=Q;A(".conversation-toolbar-wrapper",O.context).addClass("h-disabled");A(".conversation-empty",O.context).addClass("h-invisible");if(S){window.vBulletin.loadingIndicator.suppressNextAjaxIndicator()}var X=vBulletin.normalizeAjaxUrl(W.attr("action"))||(vBulletin.getAjaxBaseurl()+"/activity/get");var V=W.closest(".conversation-toolbar-wrapper").find('form.pagenav-form input[name="article_display_columns"]');if(V.length==1){Q.article_display_columns=V.val()}A.ajax({type:"post",url:X,data:(Q),dataType:"json",success:function(Y){A(".conversation-empty",O.context).addClass("h-hide");if(!Y||Y.error||Y.errors){console.log(X+" failed. result:"+JSON.stringify(Y));A(".conversation-list",O.context).addClass("h-hide");var a="unknown_error";if(!Y){a="invalid_server_response_please_try_again"}else{if(Y.error){a=Y.error}else{if(Y.errors){a=Y.errors[0][0]}}}a=vBulletin.phrase.get(a);A(".conversation-empty",O.context).html((a||"").replace(/<br\s*\/*>/g," ")).removeClass("h-hide h-invisible");return }if(S){if(!J&&Y.total>0&&!A("body").hasClass("edit-mode")){A(".new-conversations-strip span",O.context).html(Y.total);A(".new-conversations-strip",O.context).fadeIn("slow")}if(A(".conversation-list li.list-item",O.context).length==0){A(".conversation-empty",O.context).removeClass("h-hide")}}else{A(".new-conversations-strip",O.context).hide();if(((Y.total_with_sticky>0)||(Y.total>0))&&Y.template){if(Y.resultId){var b=A('input[name="result-id"]',W).val(Y.resultId);if(b.length&&this.lastFilters){this.lastFilters.filters["result-id"]=Y.resultId}if(O.pagination){O.pagination.updateResultId(Y.resultId)}}if(P){A(".conversation-list",O.context).append(Y.template)}else{A(".conversation-empty",O.context).addClass("h-hide");A(".conversation-list",O.context).html(Y.template).removeClass("h-hide")}if((Q.filters["maxpages"]&&Q.filters["pagenum"]>=Q.filters["maxpages"])||(Y.pageinfo&&(Q.filters["pagenum"]>=Y.pageinfo.totalpages||Y.pageinfo.showseemore===false))){A(".conversation-showmore",O.context).addClass("h-hide")}else{A(".conversation-showmore",O.context).removeClass("h-hide")}}else{if(!P){A(".conversation-empty",O.context).removeClass("h-hide");A(".conversation-list",O.context).addClass("h-hide").empty()}}if(Y.total_with_sticky==0){A(".conversation-showmore",O.context).addClass("h-hide")}if(C&&O.scrollToTop){var Z=(O.scrollToTop instanceof A)?O.scrollToTop:A(O.scrollToTop);if(Z.length>0){A("body,html").animate({scrollTop:Z.offset().top},"slow")}}E=Y.lastDate;if(typeof O.onContentLoad=="function"){O.onContentLoad.apply(A(".conversation-list",O.context).get(0),[Y])}if(Y.pageinfo){N.updatePageNumber(Y.pageinfo.pagenumber||1);if(O.pagination&&typeof O.pagination.updatePageInfo=="function"){O.pagination.setOption("context",O.context);O.pagination.updatePageInfo(Y.pageinfo,true)}}if(vBulletin.inlinemod&&typeof vBulletin.inlinemod.init=="function"&&A(".moderationmenu_container",O.context).length>0){vBulletin.inlinemod.init(O.context)}}if(J){J=false}},error:function(a,Z,Y){console.log(X+" failed. error:"+Y);if(Y!=""){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("unable_to_contact_server_please_try_again"),iconType:"error"})}},complete:function(){A(".conversation-toolbar-wrapper",O.context).removeClass("h-disabled");A(".conversation-empty",O.context).removeClass("h-invisible");if(!J&&O.autoCheck&&F){F=setTimeout(N.checkNewConversations,O.checkInterval)}}});return N};this.updatePageNumber=function(P){P=Number(P);if(P>0){A('form.toolbar-filter-overlay input[name="pagenum"]',O.context).val(P)}return N};this.checkNewConversations=function(){if(!A("body").hasClass("edit-mode")){console.log("Checking for new activity since "+E);N.applyFilters(true)}return N};this.toggleNewConversations=function(P){if(P){O.autoCheck=true;F=setTimeout(N.checkNewConversations,O.checkInterval)}else{O.autoCheck=false;clearTimeout(F)}return N};this.hideFilterOverlay=function(){A(".conversation-toolbar-wrapper .toolbar-filter-overlay",O.context).filter(":visible").each(function(){A(this).prev(".conversation-toolbar").find(".toolbar-filter").triggerHandler("click."+I,[0])});return N};this.getOption=function(P){return O[P]};this.setOption=function(P,Q){O[P]=Q;return N};if(O.autoCheck){E=pageData.current_server_datetime;F=setTimeout(N.checkNewConversations,O.checkInterval)}};vBulletin.conversation.displaySelectedFilterText=function(J,K,C){var L=A(J);if(L.data("bypass-filter-display")==1){return }C=C||L.closest(".conversation-toolbar-wrapper");var G=A(".filtered-by",C).removeClass("h-hide").find(".filter-text-wrapper").show(),B=A(".filter-text[data-filter-name={0}]".format(J.name),G),M='<div class="filter-text" data-filter-name="{0}" data-filter-value="{1}"><span title="{2}">{3}</span><span class="x vb-icon vb-icon-x-blue"></span></div>',E,F,I;if(J.type=="radio"){F=L.next("span").text();E=A(M.format(J.name,vBulletin.htmlEntities(J.value),L.closest(".filter-options").prev(".filter-header").html()+" - "+F,((J.name=="filter_new_topics"||J.name=="filter_depth"||(J.value.indexOf("_all")!=-1&&J.value!="time_all"))?(L.closest("li").find(".filter-header").html()||"")+" - ":"")+F))}else{if(J.type=="text"){K="&quot;"+JShtmlEncode(K)+"&quot;";E=A(M.format(J.name,vBulletin.htmlEntities(J.value),L.data("filter-name")+": "+K,K)).data("filter-type","text");I=L.attr("class").match(/js-.*/);if(I){E.data("filter-js-selector","."+I[0])}}}if(B.length>0){B.replaceWith(E)}else{var D=[],H=false;A(".toolbar-filter-overlay > ul > li",C).each(function(){D.push(A("input:first",this).attr("name"))});A(".filter-text",G).each(function(){var N=A(this);if(A.inArray(J.name,D)<A.inArray(N.attr("data-filter-name"),D)){N.before(E);H=true;return false}});if(!H){G.append(E)}if(A(".filter-text",G).length>1){G.next(".clear-all").removeClass("h-hide")}}}})(jQuery);;

// ***************************
// js.compressed/channel_conversation.js
// ***************************
window.vBulletin=window.vBulletin||{};window.vBulletin.phrase=window.vBulletin.phrase||{};window.vBulletin.phrase.precache=window.vBulletin.phrase.precache||[];window.vBulletin.phrase.precache=$.merge(window.vBulletin.phrase.precache,[]);window.vBulletin.options=window.vBulletin.options||{};window.vBulletin.options.precache=window.vBulletin.options.precache||[];window.vBulletin.options.precache=$.merge(window.vBulletin.options.precache,[]);(function(A){var B=[".forum-channel-content-widget",".blog-channel-content-widget",".sg-channel-content-widget"];if(!vBulletin.pageHasSelectors(B)){return false}A(document).ready(function(){vBulletin.conversation=vBulletin.conversation||{};var F=A(".channel-content-widget .channel-conversation-list-wrapper");var I=A("#activity-stream-tab",F);if(I.length==0){I=A("#article-tab",F)}var N=A("#recommended-tab",F);var O=A("#subscribed-tab",F);var f=A("#topic-tab",F);var J=A("#media-tab",F);var P=A(".conversation-list",I);var i=A(".conversation-list",N);var a=A(".conversation-list",O);var g=A(".conversation-list",f);var X=A(".conversation-list",F);var L,h,U,b,C;var e,c,V,E;var M,Z,W,Y;var d,G,R=true;var K=F.find(".widget-tabs-nav .ui-tabs-nav > li"),T=K.filter(".ui-tabs-selected"),S=T.index(),k,D=K.parent().data("allow-history")=="1",H=new vBulletin.history.instance(D);if(S==-1){S=0;T=K.first()}k=T.find("> a").attr("href");var Q=function(l){var m=(F.offset().top+(F.outerHeight()-parseFloat(F.css("border-bottom-width")))-l.height());console.log(m);return m};var j=function(l){l=l||k;return K.filter('li:has(a[href*="'+l+'"])').first().index()};K.removeClass("ui-state-disabled");vBulletin.tabify.call(F,{tabHistory:H,getTabIndexByHash:j,allowHistory:D,tabParamAsQueryString:true,hash:F.find(".js-module-top-anchor").attr("id"),tabOptions:{selected:S,select:function(n,o){if(W){W.hideFilterOverlay()}if(U){U.hideFilterOverlay()}if(V){V.hideFilterOverlay()}var m=F.find(".widget-tabs-panel .ui-tabs-panel:visible");var l=m.find(".list-item-body-wrapper.edit-post .edit-conversation-container");if(l.length>0){openAlertDialog({title:vBulletin.phrase.get("edit_conversation"),message:vBulletin.phrase.get("you_have_a_pending_edit_unsaved"),iconType:"warning",onAfterClose:function(){vBulletin.animateScrollTop(l.closest(".list-item").offset().top,{duration:"slow"})}});return false}},show:function(n,p){if(p.tab.hash=="#activity-stream-tab"||p.tab.hash=="#article-tab"){if(U){U.toggleNewConversations(false)}if(!W){M=A(".conversation-toolbar-wrapper.scrolltofixed-floating",I);Z=new vBulletin.scrollToFixed({element:M,limit:Q(M)});G=new vBulletin.pagination({context:I,allowHistory:D,onPageChanged:function(q,r){W.updatePageNumber(q);if(!r){W.applyFilters(false,true,false,true)}}});W=new vBulletin.conversation.filter({context:I,autoCheck:A(".toolbar-filter-overlay input[type=radio][value=conversations_on]",I).is(":checked"),scrollToTop:F,pagination:G,allowHistory:D,onContentLoad:function(){Z.updateLimit(Q(M));vBulletin.truncatePostContent(P);vBulletin.conversation.processPostContent(P)}});if(k==p.tab.hash){vBulletin.truncatePostContent(P);vBulletin.conversation.processPostContent(P);W.lastFilters={filters:W.getSelectedFilters(A(".toolbar-filter-overlay",I))}}}else{W.setOption("context",I);G.setOption("context",I);if(typeof W.lastFilters!="undefined"&&A(".conversation-empty:not(.h-hide)",p.panel).length>0){delete W.lastFilters}}W.applyFilters(false,true)}else{if(p.tab.hash=="#subscribed-tab"){if(W){W.toggleNewConversations(false)}if(U){U.toggleNewConversations(false)}if(!V){e=A(".conversation-toolbar-wrapper.scrolltofixed-floating",O);c=new vBulletin.scrollToFixed({element:e,limit:Q(e)});V=new vBulletin.conversation.filter({context:O,scrollToTop:F,allowHistory:D,onContentLoad:function(){c.updateLimit(Q(e));vBulletin.truncatePostContent(a);vBulletin.conversation.processPostContent(a)}});if(k==p.tab.hash){vBulletin.truncatePostContent(a);vBulletin.conversation.processPostContent(a);V.lastFilters={filters:V.getSelectedFilters(A(".toolbar-filter-overlay",O))}}}else{V.setOption("context",O);if(typeof V.lastFilters!="undefined"&&A(".conversation-empty:not(.h-hide)",p.panel).length>0){delete V.lastFilters}}V.applyFilters(false)}else{if(p.tab.hash=="#topic-tab"){if(W){W.toggleNewConversations(false)}if(!U){L=A(".conversation-toolbar-wrapper.scrolltofixed-floating",f);h=new vBulletin.scrollToFixed({element:L,limit:Q(L)});d=new vBulletin.pagination({context:f,allowHistory:D,onPageChanged:function(q,r){U.updatePageNumber(q);if(!r){U.applyFilters(false,true,false,true)}}});U=new vBulletin.conversation.filter({context:f,autoCheck:A(".toolbar-filter-overlay input[type=radio][value=conversations_on]",f).is(":checked"),scrollToTop:F,pagination:d,allowHistory:D,onContentLoad:function(){h.updateLimit(Q(L));vBulletin.markreadcheck()}});if(k==p.tab.hash){U.lastFilters={filters:U.getSelectedFilters(A(".toolbar-filter-overlay",f))}}}else{U.setOption("context",f);d.setOption("context",f);if(typeof U.lastFilters!="undefined"&&A(".conversation-empty:not(.h-hide)",p.panel).length>0){delete U.lastFilters}}U.applyFilters(false,true)}else{if(p.tab.hash=="#media-tab"){if(W){W.toggleNewConversations(false)}if(U){U.toggleNewConversations(false)}if(!b){b=A(".conversation-toolbar-wrapper.scrolltofixed-floating",J);C=new vBulletin.scrollToFixed({element:b,limit:Q(b)});var m=new vBulletin.history.instance(D);if(m.isEnabled()){var o=m.getState();if(!o||A.isEmptyObject(o.data)){var l={from:"filter",page:1,tab:p.tab.hash,filters:vBulletin.getSelectedFilters(A("form.toolbar-filter-overlay",p.panel))};m.setDefaultState(l,document.title,location.href)}m.setStateChange(function(t,u,r){var s=m.getState();if(s.data.from=="filter"){m.log(s.data,s.title,s.url);if(p.tab.hash!=s.data.tab){vBulletin.selectTabByIndex.call(A(p.tab).closest(".ui-tabs-nav"),p.index)}else{var q=A('.media-filter-overlay input[name="filter_time"][value="{0}"]'.format(s.data.filters.filter_time),p.panel).prop("checked",true);if(q.hasClass("js-default-checked")&&q.prop("defaultChecked")){A(".filtered-by .x",p.panel).trigger("click")}else{q.trigger("change",[true])}}}},"filter")}if(k==p.tab.hash){R=false}}else{R=true}if(R&&A("#profileMediaDetailContainer .album-detail",p.panel).length==0){if(!E){E=vBulletin.media.calculatePhotosPerPage(vBulletin.media.TARGET_PHOTOS_PERPAGE)}loadGalleryById({nodeid:-2,channelid:pageData.channelid,pageno:1,dateFilter:A(".filter-options input[name=filter_time]:checked",p.panel).val()||"time_lastweek",perpage:E},true,0,{complete:function(){A(".profile-toolbar .media-toolbar-filter",J).removeClass("h-hide");C.updateLimit(Q(b))}})}}}}}}}});X.off("click",".list-item-poll .view-more-ctrl").on("click",".view-more-ctrl",function(m){var l=A(this).closest("form.poll");var n=l.find("ul.poll");A(this).addClass("h-hide");n.css("max-height","none").find("li.h-hide").slideDown(100,function(){l.find(".action-buttons").removeClass("h-hide").next(".view-less-ctrl").removeClass("h-hide");vBulletin.animateScrollTop(l.offset().top,{duration:"fast"})});return false});X.off("click",".list-item-poll .view-less-ctrl").on("click",".view-less-ctrl",function(m){var l=A(this).closest("form.poll");vBulletin.conversation.limitVisiblePollOptionsInAPost(l,3);l.find("ul.poll").css("max-height","").find("li.h-hide").slideUp(100);return false});X.off("click",".js-post__history").on("click",".js-post__history",vBulletin.conversation.showPostHistory);X.off("click",".js-post-control__ip-address").on("click",".js-post-control__ip-address",vBulletin.conversation.showIp);X.off("click",".js-post-control__edit").on("click",".js-post-control__edit",function(l){vBulletin.conversation.editPost.apply(this,[l,W])});X.off("click",".js-post-control__vote").on("click",".js-post-control__vote",function(l){if(A(l.target).closest(".bubble-flyout").length==1){vBulletin.conversation.showWhoVoted.apply(l.target,[l])}else{vBulletin.conversation.votePost.apply(this,[l])}return false});X.off("click",".js-post-control__flag").on("click",".js-post-control__flag",vBulletin.conversation.flagPost);X.off("click",".js-post-control__comment").on("click",".js-post-control__comment",vBulletin.conversation.toggleCommentBox);X.off("click",".js-comment-entry__post").on("click",".js-comment-entry__post",function(l){vBulletin.conversation.postComment.apply(this,[l,function(){W.updatePageNumber(1).applyFilters(false,true)}])});vBulletin.conversation.bindEditFormEventHandlers("all")})})(jQuery);;

// ***************************
// js.compressed/link.js
// ***************************
window.vBulletin=window.vBulletin||{};window.vBulletin.phrase=window.vBulletin.phrase||{};window.vBulletin.phrase.precache=window.vBulletin.phrase.precache||[];window.vBulletin.phrase.precache=$.merge(window.vBulletin.phrase.precache,["attach_link","please_enter_link_url"]);(function(A){A(document).ready(function(){vBulletin.conversation.bindEditFormEventHandlers("link");A(".b-content-entry .b-content-entry-panel__content--link").each(function(){A("body").trigger("link_editform_onload",[A(this)])})})})(jQuery);;

// ***************************
// js.compressed/media.js
// ***************************
window.vBulletin=window.vBulletin||{};window.vBulletin.phrase=window.vBulletin.phrase||{};window.vBulletin.phrase.precache=window.vBulletin.phrase.precache||[];window.vBulletin.phrase.precache=$.merge(window.vBulletin.phrase.precache,["saving"]);window.vBulletin.options=window.vBulletin.options||{};window.vBulletin.options.precache=window.vBulletin.options.precache||[];window.vBulletin.options.precache=$.merge(window.vBulletin.options.precache,["postminchars","commentminchars"]);var galleryData={mediaTypeFilter:false,currentMediaPage:Number($("#mediaCurrentPage").val())||1,currentGalleryPage:1,currentNodeId:0,currentUserId:0,profileMediaDetailContainer:false,currentDateFilter:"time_lastmonth"};var $mediaTab=$("#media-tab"),allowHistory,filterHistory,hash;window.vBulletin.media=window.vBulletin.media||{};(function(A){var B=["#media-tab"];if(!vBulletin.pageHasSelectors(B)){return false}window.vBulletin.media.calculatePhotosPerPage=function(D){D=D||50;var C=A("#profileMediaDetailContainer").is(":visible");if(!C){A("#profileMediaDetailContainer").removeClass("h-hide")}var E=Math.floor(A("#profileMediaDetailContainer").width()/128);if(!C){A("#profileMediaDetailContainer").addClass("h-hide")}return(D%E==0||D<=E)?D:D-(D%E)};A(document).ready(function(){A(document).off("click","#mediaList .albumLink").on("click","#mediaList .albumLink",loadGallery);var C=false;$mediaTab.off("click",".profile-media-createvideo, .profile-media-upload").on("click",".profile-media-createvideo, .profile-media-upload",function(E){var D=A(this).hasClass("profile-media-upload")?"gallery":"video";if(!C){C=A(E.target).closest(".ui-widget-content").find(".profileMediaEditContainer").dialog({modal:true,autoOpen:false,width:800,title:vBulletin.phrase.get("profile_media"),resizable:false,closeOnEscape:false,showCloseButton:false,dialogClass:"l-small dialog-container dialog-box edit-media-upload-dialog js-profile-media",close:function(){A(document).data("gallery-container",null)}});vBulletin.upload.initializePhotoUpload(C)}C.off("dialogopen").on("dialogopen",function(F,G){C.find('.b-toolbar__item[data-panel="b-content-entry-panel__content--{0}"]:not(.b-toolbar__item--active)'.format(D)).trigger("click");vBulletin.ckeditor.initEditorComponents(C);A(document).data("gallery-container",A(this).find(".b-content-entry-panel__content--"+D))}).dialog("open")});$mediaTab.off("click","#profileMediaDetailContainer .more-gallery").on("click","#profileMediaDetailContainer .more-gallery",getMorePhotos);$mediaTab.off("click",".profile-media-backbtn").on("click",".profile-media-backbtn",function(E){A("#profileMediaDetailContainer").addClass("h-hide");A("#mediaPreviousPage").closest(".pagenav-controls-container").removeClass("h-hide");A("#profileMediaContainer").removeClass("h-hide");A(".media-tab .profile-toolbar .toolset-left > li").addClass("h-hide").has(".profile-media-upload, .profile-media-createvideo").removeClass("h-hide");galleryData.currentDateFilter=A(this).closest(".conversation-toolbar-wrapper").find(".toolbar-filter-overlay input[name=filter_time]:checked").val();A(".profile-toolbar .media-toolbar-filter").addClass("h-hide");A(this).closest(".conversation-toolbar-wrapper").find(".filtered-by").addClass("h-hide").find(".filter-text-wrapper").empty();var D={totalpages:Number(A("#mediaList").data("totalpages")),totalcount:Number(A("#mediaList").data("totalcount")),currentpage:galleryData.currentMediaPage};setPagination(D)});$mediaTab.off("change","#mediaCurrentPage").on("change","#mediaCurrentPage",goMediaPage);$mediaTab.off("click","#mediaPreviousPage, #mediaNextPage").on("click","#mediaPreviousPage, #mediaNextPage",goMediaPage);galleryData.profileMediaDetailContainer=A("#profileMediaDetailContainer").clone();A(document).off("afterSave",".js-album-detail .js-post__content-wrapper .js-content-entry form").on("afterSave",".js-album-detail .js-post__content-wrapper .js-content-entry form",function(E,D){loadGalleryById(galleryData.currentFilter);return false});A(document).off("afterCancel",".js-album-detail .js-post__content-wrapper .js-content-entry form").on("afterCancel",".js-album-detail .js-post__content-wrapper .js-content-entry form",function(D){loadMediaPage(galleryData.currentMediaPage);return true});A(document).off("afterSave",".js-profile-media .js-content-entry form").on("afterSave",".js-profile-media  .js-content-entry form",function(G,F){var I=A(".b-toolbar__item--active",this).data("panel");if(I=="b-content-entry-panel__content--gallery"){var D=A("#mediaList"),H=Number(D.data("totalpages")),J=Number(D.data("totalcount")),E=(J%vBulletin.media.ALBUMS_PERPAGE)==0?H+1:H;if(F.alert){openAlertDialog({title:vBulletin.phrase.get("media"),message:vBulletin.phrase.get(F.alert),iconType:"alert"})}loadMediaPage(E)}else{loadMediaPage(1)}return false});if($mediaTab.length){allowHistory=$mediaTab.find(".conversation-toolbar-wrapper").data("allow-history")=="1";filterHistory=new vBulletin.history.instance(allowHistory);hash=$mediaTab.closest(".canvas-widget").find(".js-module-top-anchor").attr("id");$mediaTab.off("click",".media-toolbar-filter").on("click",".media-toolbar-filter",function(D){A(".filter-wrapper",this).toggleClass("selected");A(".arrow .vb-icon",this).toggleClass("vb-icon-triangle-down-wide vb-icon-triangle-up-wide");A(D.target).closest(".conversation-toolbar-wrapper").find(".toolbar-filter-overlay").slideToggle("slow",function(){var E="media_filter";if(A(this).is(":visible")){A("body").off("click."+E).on("click."+E,function(H){if(A(H.target).closest(".toolbar-filter-overlay").length==0&&A(H.target).closest(".toolbar-filter").length==0){A("body").off("click."+E);A(".media-toolbar-filter").trigger("click")}});var G={};var F=vBulletin.isScrolledIntoView(this,G);if(!F){A("html,body").animate({scrollTop:"+="+Math.abs(G.bottom)},"fast")}}else{A("body").off("click."+E)}})});A("form.media-filter-overlay",$mediaTab).trigger("reset");$mediaTab.off("change",".media-filter-overlay input[type=radio]").on("change",".media-filter-overlay input[type=radio]",function(K,I){var E;if(!filterHistory.isEnabled()&&allowHistory){E=vBulletin.makePaginatedUrl(location.href,1);location.href=vBulletin.makeFilterUrl(E,this.name,this.value,H,hash);return true}galleryData.currentDateFilter=this.value;var F=fetchMediaFilter(A(K.target));var H=A(".media-tab");if(H.data("perpage")){F.perpage=H.data("perpage")}loadGalleryById(F,true,0,H.data("callbacks"));if(!A(this).data("bypass-filter-display")){vBulletin.conversation.displaySelectedFilterText(this,this.value)}if(filterHistory.isEnabled()&&!I){var J=vBulletin.getSelectedFilters(A("form.toolbar-filter-overlay",H)),N=this.name,D=this.value,M=A(".conversation-toolbar-wrapper .filtered-by",H),G=H.data("url-path")?H.data("url-path"):"#"+H.attr("id"),L={from:"filter",page:1,tab:G,filters:J,filtervalue:D,filtername:N};if(!M.data("reset")){E=vBulletin.makePaginatedUrl(location.href,1);E=vBulletin.makeFilterUrl(E,N,D,H)}else{E=location.pathname.replace(/\/page[0-9]+/,"")}filterHistory.pushState(L,document.title,E);M.data("reset",null)}});$mediaTab.off("click",".filtered-by .x").on("click",".filtered-by .x",function(F){var D=A(this).closest(".filtered-by"),H=A(this).closest(".filter-text"),E=H.data("filter-name");if(!filterHistory.isEnabled()&&allowHistory){location.href=vBulletin.makeFilterUrl(location.href,E,H.data("filter-value"),$mediaTab,hash);return false}$defaultSelectedFilter=A(".toolbar-filter-overlay .filter-options input[name={0}]".format(E),$mediaTab).prop("checked",false).filter(".js-default-checked");H.remove();var G=D.find(".filter-text").length;if(G==0){D.addClass("h-hide");D.data("reset",true)}else{if(G==1){D.find(".clear-all").addClass("h-hide")}}if($defaultSelectedFilter.length==1){$defaultSelectedFilter.data("bypass-filter-display",true);$defaultSelectedFilter.trigger("click");$defaultSelectedFilter.data("bypass-filter-display",null)}})}})})(jQuery);doMediaFilters=function(A){$(".profMediaFilterRow").removeClass("filterSelected");$(A.target).addClass("filterSelected");if($(A.target).hasClass("profMediaFilterAllTypes")){galleryData.mediaTypeFilter=false}else{if($(A.target).hasClass("profMediaFilterGallery")){galleryData.mediaTypeFilter="gallery"}else{if($(A.target).hasClass("profMediaFilterVideo")){galleryData.mediaTypeFilter="video"}}}loadMediaPage(1)};loadMediaPage=function(A){$("body").css("cursor","wait");var B=$(".js-profile-media-container",$mediaTab);$.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/render/profile_media_content",data:({userid:B.data("user-id"),pageno:A,perpage:B.data("perpage")}),dataType:"json",success:function(C){if(C.errors){openAlertDialog({title:vBulletin.phrase.get("profile_media"),message:vBulletin.phrase.get(C.errors[0][0]),iconType:"error"});console.log("/ajax/render/profile_media_content failed, error: "+JSON.stringify(C))}else{console.log("/ajax/render/profile_media_content successful");$("#mediacontent").html(C);$("#profileMediaDetailContainer").empty();$("#mediacontent").removeClass("h-hide");$("#profileMediaContainer").removeClass("h-hide");$(".media-tab .profile-toolbar .toolset-left > li").addClass("h-hide").has(".profile-media-upload, .profile-media-createvideo").removeClass("h-hide");$("#mediaPreviousPage").closest("pagenav-controls").removeClass("h-hide");$("#profileMediaDetailContainer").addClass("h-hide");$("#profileMediaContainer").removeClass("h-hide");galleryData.currentMediaPage=A;var D={totalpages:Number($("#mediaList").data("totalpages")),totalcount:Number($("#mediaList").data("totalcount")),currentpage:A};setPagination(D);if(!vBulletin.isScrolledIntoView($("#profileTabs .profile-tabs-nav"))){$("html,body").animate({scrollTop:$("#profileTabs .profile-tabs-nav").offset().top},"slow")}}},error:function(E,D,C){console.log("/ajax/render/profile_media_content failed, error: "+C);console.log("response:"+E.responseText);console.log("status:"+D);console.log("code:"+E.status);openAlertDialog({title:vBulletin.phrase.get("profile_media"),message:vBulletin.phrase.get("unable_to_contact_server_please_try_again"),iconType:"error"})},complete:function(){$("body").css("cursor","auto")}})};goMediaPage=function(C){var B=this.id;if($("#profileMediaDetailContainer").is(":visible")){gotoGalleryPage(C);return false}if(B=="mediaCurrentPage"){var D=parseInt($("#mediaCurrentPage").val());if(D>0&&D<=parseInt($("#mediaPageCount").html())){loadMediaPage(D);pushHistoryState(D)}else{$("#mediaCurrentPage").val(galleryData.currentMediaPage)}}else{if(B=="mediaPreviousPage"){if(galleryData.currentMediaPage>1){var A=galleryData.currentMediaPage-1;loadMediaPage(A);pushHistoryState(A)}else{$("#mediaPreviousPage").addClass("h-disabled")}}else{if(B=="mediaNextPage"){if(galleryData.currentMediaPage<parseInt($("#mediaPageCount").html())){var A=galleryData.currentMediaPage+1;loadMediaPage(A);pushHistoryState(A)}else{$("#mediaNextPage").addClass("h-disabled")}}}}return false};var pushHistoryState=function(A){var C=vBulletin.makePaginatedUrl(location.href,A);if(filterHistory.isEnabled()){var B={from:"media_filter",page:A||1,tab:$mediaTab.data("url-path")?$mediaTab.data("url-path"):"#"+$mediaTab.attr("id")};filterHistory.pushState(B,document.title,C)}else{if(allowHistory){location.href=C}}};vBulletin.media.setHistoryStateChange=function(A){if(A){allowHistory=$mediaTab.find(".conversation-toolbar-wrapper").data("allow-history")=="1";filterHistory=new vBulletin.history.instance(allowHistory)}if(filterHistory.isEnabled()){filterHistory.setStateChange(function(F){var E=filterHistory.getState();if(E.data.from=="media_filter"){filterHistory.log(E.data,E.title,E.url);var B=$mediaTab.closest(".ui-tabs"),C=B.find(".ui-tabs-nav > li").filter('li:has(a[href*="#{0}"])'.format($mediaTab.attr("id")));if(C.hasClass("ui-tabs-selected")){loadMediaPage(E.data.page)}else{var D=C.index();vBulletin.selectTabByIndex.call(B,D)}}},"media_filter")}};gotoGalleryPage=function(C){if(!galleryData.currentNodeId&&!galleryData.currentUserId){return false}var A=C.target.id;if(A=="mediaCurrentPage"){targetPage=parseInt($("#mediaCurrentPage").val());if(targetPage>0&&targetPage<=parseInt($("#mediaPageCount").html())){var B={nodeid:galleryData.currentNodeId,userid:galleryData.currentUserId,pageno:targetPage,perpage:vBulletin.media.calculatePhotosPerPage(vBulletin.media.TARGET_PHOTOS_PERPAGE),datefilter:galleryData.currentDateFilter};loadGalleryById(B)}else{$("#mediaCurrentPage").val(galleryData.currentGalleryPage)}}else{if(A=="mediaPreviousPage"){if(galleryData.currentGalleryPage>1){var B={nodeid:galleryData.currentNodeId,userid:galleryData.currentUserId,pageno:galleryData.currentGalleryPage-1,perpage:vBulletin.media.calculatePhotosPerPage(vBulletin.media.TARGET_PHOTOS_PERPAGE),datefilter:galleryData.currentDateFilter};loadGalleryById(B)}else{$("#mediaPreviousPage ").addClass("h-disabled")}}else{if(A=="mediaNextPage"){if(galleryData.currentGalleryPage<parseInt($("#mediaPageCount").html())){var B={nodeid:galleryData.currentNodeId,userid:galleryData.currentUserId,pageno:galleryData.currentGalleryPage+1,perpage:vBulletin.media.calculatePhotosPerPage(vBulletin.media.TARGET_PHOTOS_PERPAGE),datefilter:galleryData.currentDateFilter};loadGalleryById(B)}else{$("#mediaNextPage").addClass("h-disabled")}}}}return false};setPagination=function(A){var B=$(".media-tab .pagenav-controls-container")[(A.totalpages>1)?"removeClass":"addClass"]("h-hide");if(B.is(":visible")){$("#mediaPreviousPage")[(A.currentpage<=1)?"addClass":"removeClass"]("h-disabled");$("#mediaNextPage")[(A.currentpage>=A.totalpages)?"addClass":"removeClass"]("h-disabled");$("#mediaCurrentPage").val(A.currentpage);$("#mediaPageCount").text(A.totalpages)}};loadGalleryById=function(B,E,F,H){var C=$("#profileMediaDetailContainer"),D={nodeid:galleryData.currentNodeId,userid:galleryData.currentUserId,channelid:0,pageno:1,dateFilter:galleryData.currentDateFilter,albumid:0};B=$.extend({},D,B);if(!isNaN(B.nodeid)){$("body").css("cursor","wait");var I;if(B.nodeid==-1){I="profile_media_videolist"}else{I="profile_textphotodetail"}if(C.closest(".media-tab").length==0){$(".media-tab").append(galleryData.profileMediaDetailContainer)}$("#profileMediaContainer").closest(".tab").find("li.list-item-gallery").remove();var A=vBulletin.getAjaxBaseurl()+"/ajax/render/"+I;var G={nodeid:B.nodeid,userid:B.userid,channelid:B.channelid,pageno:B.pageno,albumid:B.albumid,viewMore:F};if(B.dateFilter){G.dateFilter=B.dateFilter}if(B.perpage){G.perpage=B.perpage}$.ajax({url:A,type:"GET",data:G,dataType:"json",success:function(J){if(J.errors){openAlertDialog({title:vBulletin.phrase.get("profile_media"),message:vBulletin.phrase.get(J.errors[0][0]),iconType:"error"});if(H&&typeof H.error=="function"){H.error()}}else{galleryData.currentNodeId=B.nodeid;galleryData.currentUserId=B.userid;galleryData.currentGalleryPage=B.pageno;if(F){$(".album-detail .photo-preview").append(J);$(".more-gallery",C)[(galleryData.currentGalleryPage<$(".album-detail").data("totalpages"))?"removeClass":"addClass"]("h-hide-imp")}else{C.html(J);C.addClass("list-item").attr("data-nodeid",B.nodeid);$("#profileMediaContainer").addClass("h-hide");$(".media-tab .profile-toolbar .toolset-left > li").removeClass("h-hide").has(".profile-media-upload, .profile-media-createvideo").addClass("h-hide");C.removeClass("h-hide");$("#mediaPreviousPage").closest(".pagenav-controls-container").addClass("h-hide");$(".profile-media-uploadphotos",C).click(loadPhotoUploader);if(B.perpage){$(".media-tab").data("perpage",B.perpage).data("callbacks",H)}}}if(B.nodeid==-1){var K={totalpages:Number($(".media-video-list",C).data("totalpages")),totalcount:Number($(".media-video-list",C).data("totalcount")),currentpage:galleryData.currentGalleryPage};setPagination(K)}if(!E){}$(".profile-toolbar .media-toolbar-filter").removeClass("h-hide");if(H&&typeof H.success=="function"){H.success()}},error:function(L,K,J){console.log("/ajax/render/{0} failed, error: {1}".format(I,J));openAlertDialog({title:vBulletin.phrase.get("profile_media"),message:vBulletin.phrase.get("unable_to_contact_server_please_try_again"),iconType:"error"});if(H&&typeof H.error=="function"){H.error()}},complete:function(){$("body").css("cursor","auto");if(H&&typeof H.complete=="function"){H.complete()}}})}};loadPhotoUploader=function(C){$(document).data("gallery-container",$(this).closest(".album-detail"));var A=vBulletin.upload.getUploadedPhotosDlg(false);var B=A.data("nodeid");if(!B||isNaN(parseInt(B))){return }$.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/render/media_addphotos?nodeid="+B,dataType:"json",success:function(D){if(D.errors){openAlertDialog({title:vBulletin.phrase.get("profile_media"),message:vBulletin.phrase.get(D.errors[0][0]),iconType:"warning",onAfterClose:function(){A.dialog("close")}})}else{A.html(D);vBulletin.upload.initializePhotoUpload(A.parent());A.find(".js-save-button").off("click").on("click",saveGalleryPhotos);A.find(".js-cancel-button").off("click").on("click",function(E){A.dialog("close")});vBulletin.upload.relocateLastInRowClass(A.find(".photo-item-wrapper"));if($(".photo-display .photo-item-wrapper:not(.h-hide)",A).length>0){vBulletin.upload.changeButtonText($(".b-button--upload .js-upload-label",A),vBulletin.phrase.get("upload_more"));$(".js-save-button",A).show()}else{$(".js-save-button",A).hide()}A.dialog("open");vBulletin.upload.adjustPhotoDialogForScrollbar(A)}},error:function(F,E,D){console.log("/ajax/render/media_addphotos failed, error: "+D);openAlertDialog({title:vBulletin.phrase.get("profile_media"),message:vBulletin.phrase.get("unable_to_contact_server_please_try_again"),iconType:"error",onAfterClose:function(){A.dialog("close")}})}})};loadGallery=function(B){var A=fetchMediaFilter($(this));A.pageno=1;A.perpage=vBulletin.media.calculatePhotosPerPage(vBulletin.media.TARGET_PHOTOS_PERPAGE);galleryData.currentDateFilter=$(this).closest(".js-profile-media-container").find(".toolbar-filter-overlay input[name=filter_time]:checked").val();galleryData.currentFilter=A;loadGalleryById(A)};getMorePhotos=function(D){var C=$(".media-tab").data("perpage");var B=$(".media-tab").data("callbacks");var A=fetchMediaFilter($(this));A.pageno=galleryData.currentGalleryPage+1;if(C){A.perpage=C}loadGalleryById(A,false,1,B)};saveGalleryPhotos=function(D){var C=$(D.target).closest(".profile-media-photoupload-dialog"),A=$(D.target).closest("form");if(A.length>0){$(D.target).closest(".photo-display-container").find(".photo-item-wrapper:not(.h-hide)").each(function(E,G){var F=parseInt($(G).find(".filedataid").val());if(!isNaN(F)){A.append('<input type="hidden" name="filedataid[]" value="'+F+'"/>');$('<input type="hidden" name="title_'+F+'" />').val($(G).find("textarea").val()).appendTo(A)}});var B=$("button",A).prop("disabled",true);$.ajax({url:A.attr("action"),data:A.serializeArray(),type:"post",success:function(E){if(E.errors){if(typeof (E.errors[0])=="undefined"){openAlertDialog({title:vBulletin.phrase.get("media"),message:vBulletin.phrase.get(E.errors),iconType:"error"})}else{openAlertDialog({title:vBulletin.phrase.get("media"),message:vBulletin.phrase.get(E.errors[0]),iconType:"error"})}}else{C.dialog("close");loadMediaPage(galleryData.currentMediaPage)}},error:function(G,F,E){console.log(A.attr("action")+" failed, error: "+E);openAlertDialog({title:vBulletin.phrase.get("profile_media"),message:vBulletin.phrase.get("invalid_server_response_please_try_again"),iconType:"error"})},complete:function(){B.prop("disabled",false)}})}else{C.dialog("close")}};fetchMediaFilter=function(A){var C;if($("#profileMediaContainer").is(":visible")){C=$("#profileMediaContainer")}else{if($("#profileMediaDetailContainer").is(":visible")){C=$("#profileMediaDetailContainer")}}var B={nodeid:parseInt(A.data("nodeid"),10)||parseInt(C.attr("data-nodeid"),10),userid:parseInt(C.data("userid"),10),channelid:parseInt(C.data("channelid"),10),dateFilter:galleryData.currentDateFilter,albumid:parseInt(A.data("albumid"),10)};if(isNaN(B.channelid)){B.channelid=0}if(isNaN(B.nodeid)){B.nodeid=0}if(B.nodeid>0){B.userid=0}else{if(isNaN(B.userid)){B.userid=0}}if(isNaN(B.albumid)){B.albumid=0}return B};;

// ***************************
// js.compressed/sb_activity.js
// ***************************
window.vBulletin=window.vBulletin||{};window.vBulletin.phrase=window.vBulletin.phrase||{};window.vBulletin.phrase.precache=window.vBulletin.phrase.precache||[];window.vBulletin.phrase.precache=$.merge(window.vBulletin.phrase.precache,["blog_memberblogLabel","edit_conversation","forum","you_have_a_pending_edit_unsaved"]);(function(A){var B=[".forum-activity-stream-widget",".bloghome-widget",".search-widget"];if(!vBulletin.pageHasSelectors(B)){return false}A(document).ready(function(){vBulletin.conversation=vBulletin.conversation||{};var O=vBulletin.conversation.$activityStreamWidget=A(".activity-stream-widget"),D=vBulletin.conversation.$activityStreamTab=A("#activity-stream-tab");if(D.length==0){D=vBulletin.conversation.$activityStreamTab=A("#article-tab")}var J=vBulletin.conversation.$subscribedTab=A("#subscribed-tab"),K=vBulletin.conversation.$activityStreamList=A(".conversation-list",D),V=vBulletin.conversation.$subscribedList=A(".conversation-list",J),Y,Z,S,F,I,e,H,c,U,T=A(".conversation-list",O),R,a;if(O.hasClass("forum-activity-stream-widget")||O.hasClass("bloghome-widget")){var G=O.find(".widget-tabs-nav .ui-tabs-nav > li"),Q=G.filter(".ui-tabs-selected"),P=Q.index(),d,X={},M=G.parent().data("allow-history")=="1",C=new vBulletin.history.instance(M),L=O.find(".js-module-top-anchor").attr("id");if(P==-1){P=0;Q=G.first()}d=Q.find("> a").attr("href");var N=function(f){var g=(O.offset().top+(O.outerHeight()-parseFloat(O.css("border-bottom-width")))-f.height());return g};var b=function(f){f=f||d;return G.filter('li:has(a[href*="'+f+'"])').first().index()};G.removeClass("ui-state-disabled");vBulletin.tabify.call(O,{tabHistory:C,getTabIndexByHash:b,allowHistory:M,tabParamAsQueryString:true,hash:L,tabOptions:{selected:P,select:function(h,i){if(U){U.hideFilterOverlay()}if(S){S.hideFilterOverlay()}var g=O.find(".widget-tabs-panel .ui-tabs-panel:visible");var f=g.find(".list-item-body-wrapper.edit-post .edit-conversation-container");if(f.length>0){openAlertDialog({title:vBulletin.phrase.get("edit_conversation"),message:vBulletin.phrase.get("you_have_a_pending_edit_unsaved"),iconType:"warning",onAfterClose:function(){vBulletin.animateScrollTop(f.closest(".list-item").offset().top,{duration:"slow"})}});return false}},show:function(j,l){var i=l.panel.id,f=A(this);if(typeof X[i]=="undefined"){X[i]=A(".conversation-toolbar-wrapper",l.panel).data("allow-history")=="1"}if(l.tab.hash=="#memberblog-tab"){if(!I){I=function(){var n=A(".toolbar-pagenav",l.panel);if(n.length>0){new vBulletin.pagination({context:l.panel,allowHistory:X[i],onPageChanged:function(p,o){if(!o){var q=A(".js-button-filter.js-checked",l.panel).data("filter-value");F(p,q,false,true)}}})}}}if(!F){F=function(s,u,o,r){s=s||1;u=u||"show_all";A(".js-button-filters .js-button-filter",l.panel).removeClass("js-checked").filter('[data-filter-value="{0}"]'.format(u)).addClass("js-checked");var n=vBulletin.makePaginatedUrl(location.href,s);if(!o){if(e.isEnabled()){n=vBulletin.makeFilterUrl(n,"filter_blogs",u,l.panel);var q=e.getState(),t={from:"filter_blogs",page:s,tab:l.tab.hash,filters:{filter_blogs:u}};e[(q&&q.data&&q.data.from&&q.data.from!="filter_blogs")?"setDefaultState":"pushState"](t,document.title,n)}else{if(X[i]){n=vBulletin.makeFilterUrl(n,"filter_blogs",u,l.panel,L);location.href=n;return false}}}var p={tab:l.tab.hash.replace("#",""),filter_blogs:u=="show_all"?undefined:u};vBulletin.AJAX({url:vBulletin.getAjaxBaseurl()+"/ajax/render/blogmember_tab",data:{from:s,my:u,noToolbar:r,page:p,blogChannelId:f.data("blog-channel-id")},error_phrase:"unable_to_contact_server_please_try_again",success:function(y){var w=A(y);if(w.filter(".conversation-toolbar-wrapper").length){A(l.panel).html(y);I()}else{A(".blogmember-list",l.panel).hide().replaceWith(w).show();var v=w.data("pagination");if(v&&typeof v=="object"&&!A.isEmptyObject(v)){A(".pagenav-form .js-pagenum",l.panel).val(v.currentpage);A(".pagenav-form .pagetotal",l.panel).text(v.totalpages);var x=A(".pagenav-form .arrow",l.panel);if(v.prevurl){x.filter("[rel=prev]").removeClass("h-disabled").attr("href",v.prevurl.replace(/&amp;/g,"&"))}else{x.filter("[rel=prev]").addClass("h-disabled").removeAttr("href")}if(v.nexturl){x.filter("[rel=next]").removeClass("h-disabled").attr("href",v.nexturl.replace(/&amp;/g,"&"))}else{x.filter("[rel=next]").addClass("h-disabled").removeAttr("href")}}A(".conversation-toolbar-wrapper",l.panel).removeClass("h-hide")}}})};A(l.panel).on("click",".js-button-filter",function(p,n){var o=A(this).data("filter-value");F(1,o,n,true)})}if(!e){e=vBulletin.history.instance(X[i]);if(e.isEnabled()){var k=e.getState();if(!k||A.isEmptyObject(k.data)){var g={from:"filter_blogs",page:Number(A(".pagenav-form .defaultpage",l.panel).val())||1,tab:l.tab.hash,filters:{filter_blogs:A(".js-button-filter.js-checked",l.panel).data("filter-value")}};e.setDefaultState(g,document.title,location.href)}e.setStateChange(function(r){var q=e.getState();if(q.data.from=="filter_blogs"){e.log(q.data,q.title,q.url);var n=f.tabs("option","selected"),o=f.find(".ui-tabs-nav > li").eq(n).find("a").attr("href");if(o!=q.data.tab){var p=A(l.tab).closest(".ui-tabs-nav").find("> li").filter('li:has(a[href*="{0}"])'.format(q.data.tab)).index();vBulletin.selectTabByIndex.call(f,p)}else{F(q.data.page,q.data.filters.filter_blogs,true,true)}}},"filter")}}if(d==l.tab.hash){I()}if(U){U.toggleNewConversations(false)}if(S){S.toggleNewConversations(false)}var h=A(".conversation-list",l.panel);if(!h.hasClass("dataLoaded")){if(d==l.tab.hash&&!a){a=true;return false}A(".conversation-empty",l.panel).addClass("h-hide");F()}return }else{if(l.tab.hash=="#activity-stream-tab"||l.tab.hash=="#article-tab"){if(S){S.toggleNewConversations(false)}if(!U){H=A(".conversation-toolbar-wrapper.scrolltofixed-floating",D);c=false;U=vBulletin.conversation.activityStreamFilter=new vBulletin.conversation.filter({context:D,autoCheck:A(".toolbar-filter-overlay input[type=radio][value=conversations_on]",O).is(":checked"),scrollToTop:O,allowHistory:X[i],onContentLoad:function(){if(!c){c=new vBulletin.scrollToFixed({element:H,limit:N(H)})}c.updateLimit(N(H));vBulletin.truncatePostContent(K);vBulletin.conversation.processPostContent(K)}});if(d==l.tab.hash){vBulletin.truncatePostContent(K);vBulletin.conversation.processPostContent(K);U.lastFilters={filters:U.getSelectedFilters(A(".toolbar-filter-overlay",D))}}}else{U.setOption("context",D);if(typeof U.lastFilters!="undefined"&&A(".conversation-empty:not(.h-hide)",l.panel).length>0){delete U.lastFilters}}U.applyFilters(false,true)}else{if(l.tab.hash=="#subscribed-tab"){if(U){U.toggleNewConversations(false)}if(!S){Y=A(".conversation-toolbar-wrapper.scrolltofixed-floating",J);Z=new vBulletin.scrollToFixed({element:Y,limit:N(Y)});S=vBulletin.conversation.subscribedFilter=new vBulletin.conversation.filter({context:J,scrollToTop:O,allowHistory:X[i],onContentLoad:function(){Z.updateLimit(N(Y));vBulletin.truncatePostContent(V);vBulletin.conversation.processPostContent(V)}});if(d==l.tab.hash){vBulletin.truncatePostContent(V);vBulletin.conversation.processPostContent(V);S.lastFilters={filters:S.getSelectedFilters(A(".toolbar-filter-overlay",J))}}}else{S.setOption("context",J);if(typeof S.lastFilters!="undefined"&&A(".conversation-empty:not(.h-hide)",l.panel).length>0){delete S.lastFilters}}S.applyFilters(false,true)}else{if(l.tab.hash=="#forum-tab"){if(U){U.toggleNewConversations(false)}if(S){S.toggleNewConversations(false)}var m=A(l.panel);if(m.hasClass("dataLoaded")){if(d==l.tab.hash){vBulletin.markreadcheck()}return false}else{if(d==l.tab.hash&&!R){R=true;return false}}A(".conversation-empty",l.panel).addClass("h-hide");A.post(vBulletin.getAjaxBaseurl()+"/ajax/render/display_Forums_tab",function(n){m.html(n).addClass(function(){var o=A(".conversation-empty",this);if(o.length==0){return"dataLoaded"}else{o.removeClass("h-hide");return""}})},"json").error(function(p,o,n){console.log("/ajax/render/display_Forums_tab failed. Error: "+n);openAlertDialog({title:vBulletin.phrase.get("forum"),message:vBulletin.phrase.get("unable_to_contact_server_please_try_again"),iconType:"error"})}).complete(function(){vBulletin.markreadcheck()})}}}}}}});var E=0;O.find(".ui-tabs-nav li").each(function(){E+=A(this).width()});var W=O.find(".ui-tabs-nav").width();if(E>W){O.find(".widget-tabs-nav, .module-title").height(O.find(".ui-tabs-nav").height())}}vBulletin.truncatePostContent(".search-widget");O.off("click",".list-item-poll .view-more-ctrl").on("click",".list-item-poll .view-more-ctrl",function(g){var f=A(this).closest("form.poll");var h=f.find("ul.poll");A(this).addClass("h-hide");h.css("max-height","none").find("li.h-hide").slideDown(100,function(){f.find(".action-buttons").removeClass("h-hide").next(".view-less-ctrl").removeClass("h-hide");vBulletin.animateScrollTop(f.offset().top,{duration:"fast"})});return false});O.off("click",".list-item-poll .view-less-ctrl").on("click",".list-item-poll .view-less-ctrl",function(g){var f=A(this).closest("form.poll");vBulletin.conversation.limitVisiblePollOptionsInAPost(f,3);f.find("ul.poll").css("max-height","").find("li.h-hide").slideUp(100);return false});T.off("click",".js-post-control__edit").on("click",".js-post-control__edit",function(f){vBulletin.conversation.editPost.apply(this,[f,U])});T.off("click",".js-post__history").on("click",".js-post__history",vBulletin.conversation.showPostHistory);T.off("click",".js-post-control__ip-address").on("click",".js-post-control__ip-address",vBulletin.conversation.showIp);T.off("click",".js-post-control__vote").on("click",".js-post-control__vote",function(f){if(A(f.target).closest(".bubble-flyout").length==1){vBulletin.conversation.showWhoVoted.apply(f.target,[f])}else{vBulletin.conversation.votePost.apply(this,[f])}return false});T.off("click",".js-post-control__flag").on("click",".js-post-control__flag",vBulletin.conversation.flagPost);T.off("click",".js-post-control__comment").on("click",".js-post-control__comment",vBulletin.conversation.toggleCommentBox);T.off("click",".js-comment-entry__post").on("click",".js-comment-entry__post",function(f){vBulletin.conversation.postComment.apply(this,[f,function(){U.updatePageNumber(1).applyFilters(false,true)}])});vBulletin.conversation.bindEditFormEventHandlers("all")})})(jQuery);;

// ***************************
// js.compressed/hv.js
// ***************************
(function(A){window.vBulletin=window.vBulletin||{};vBulletin.hv=vBulletin.hv||{};vBulletin.hv.reset=function(B){var C;if($(".humanverify.humanverify_image").length>0){$(".humanverify.humanverify_image .refresh_imagereg").click();C=$(".humanverify.humanverify_image .imageregt")}else{if($(".humanverify.humanverify_recaptcha").length>0&&Recaptcha&&typeof Recaptcha.reload=="function"){Recaptcha.reload()}else{if($(".humanverify.humanverify_question").length>0){$.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/render/humanverify",data:{action:"register"},type:"post",dataType:"json",success:function(D){$(".humanverify.humanverify_question").replaceWith(D);if(B){$(".humanverify.humanverify_question .answer").focus()}}});C=$(".humanverify.humanverify_question .answer")}}}if(B&&C&&C.length>0){C.focus()}};vBulletin.hv.imagereg=vBulletin.hv.imagereg||{};vBulletin.hv.imagereg.init=function(B){if(typeof B=="undefined"||B.length==0){B=$(document)}$(".humanverify_image",B).each(function(){var C=$(this);$(".refresh_imagereg",C).off("click").on("click",C,vBulletin.hv.imagereg.fetch_image);$(".imagereg",C).off("click").on("click",C,vBulletin.hv.imagereg.fetch_image);$(".refresh_imagereg",C).removeClass("h-hide")})};vBulletin.hv.imagereg.fetch_image=function(C){var B=C.data;$(".progress_imagereg",B).removeClass("h-hide");$.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/hv/generateToken",type:"post",dataType:"json",success:function(D){if(!D.errors){var E=D.hash;$("input.hash",B).val(E);$(".imagereg",B).attr("src",pageData.baseurl+"/hv/image?hash="+E);$(".imageregt",B).val("")}},complete:function(){$(".progress_imagereg",B).addClass("h-hide")}});return false};vBulletin.hv.initHvForPostAction=function(B){if(!pageData.showhv_post||B.closest(".edit-post").length>0){return }$(".content-entry-box .humanverify").remove();$.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/render/humanverify",type:"POST",data:({action:"post"}),dataType:"json",success:function(C){console.log("/ajax/render/humanverify");if(C&&!C.errors){$(".content_entry_box_buttons",B).before(C);if($(".humanverify.humanverify_image",B).length>0){vBulletin.hv.imagereg.init(B)}}else{console.log("/ajax/render/humanverify successful, but response was not valid: "+JSON.stringify(C));openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("invalid_server_response_please_try_again"),iconType:"error"})}},error:function(E,D,C){console.log("/ajax/render/humanverify failed, error: "+C);openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_loading_delete_form_x",E.status),iconType:"error"})}})};$(document).ready(function(){vBulletin.hv.imagereg.init();if(typeof (window.vBulletin.hv_script)!="undefined"&&typeof (window.vBulletin.delayedInit)!="undefined"&&window.vBulletin.delayedInit){$.getScript(window.vBulletin.hv_script,function(){reloadRecaptcha()})}})})(jQuery);;

