// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
var JST={};JST.mustache={},tm={genres:["uplifting","progressive","vocal","techno","tech","trance","bigroom","psy","j00f"],routers:{},collections:{},models:{}},function(a,b){function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;return!b.href||!g||f.nodeName.toLowerCase()!=="map"?!1:(h=a("img[usemap=#"+g+"]")[0],!!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.16",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({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;return 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):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),/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){return a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)}),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){return c===b?g["inner"+d].call(this):this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){return typeof b!="number"?g["outer"+d].call(this,b):this.each(function(){a(this).css(f,h(this,b,!0,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++)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!1;var d=c&&c==="left"?"scrollLeft":"scrollTop",e=!1;return b[d]>0?!0:(b[d]=1,e=b[d]>0,b[d]=0,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++)try{a(e).triggerHandler("remove")}catch(f){}c(b)}}else{var d=a.fn.remove;a.fn.remove=function(b,c){return this.each(function(){return c||(!b||a.filter(b,[this]).length)&&a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(b){}}),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,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){arguments.length&&this._createWidget(a,b)};var g=new c;g.options=a.extend(!0,{},g.options),a[e][b].prototype=a.extend(!0,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;return e=!f&&g.length?a.extend.apply(null,[!0,e].concat(g)):e,f&&e.charAt(0)==="_"?h:(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)return h=f,!1}):this.each(function(){var b=a.data(this,c);b?b.option(e||{})._init():a.data(this,c,new d(e,this))}),h)}},a.Widget=function(a,b){arguments.length&&this._createWidget(a,b)},a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(b,c){a.data(c,this.widgetName,this),this.element=a(c),this.options=a.extend(!0,{},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}return this._setOptions(e),this},_setOptions:function(b){var c=this;return a.each(b,function(a,b){c._setOption(a,b)}),this},_setOption:function(a,b){return this.options[a]=b,a==="disabled"&&this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",b),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_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];return this.element.trigger(c,d),!(a.isFunction(e)&&e.call(this.element[0],c,d)===!1||c.isDefaultPrevented())}}}(jQuery),function(a,b){var c=!1;a(document).mouseup(function(a){c=!1}),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(!0===a.data(c.target,b.widgetName+".preventClickEvent"))return a.removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediatePropagation(),!1}),this.started=!1},_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"&&b.target.nodeName?a(b.target).closest(this.options.cancel).length:!1;if(!e||f||!this._mouseCapture(b))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){d.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=this._mouseStart(b)!==!1;if(!this._mouseStarted)return b.preventDefault(),!0}return!0===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=!0,!0},_mouseMove:function(b){return!a.browser.msie||document.documentMode>=9||!!b.button?this._mouseStarted?(this._mouseDrag(b),b.preventDefault()):(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b)),!this._mouseStarted):this._mouseUp(b)},_mouseUp:function(b){return a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b)),!1},_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!0}})}(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;return h.nodeType===9?(k=g.width(),l=g.height(),m={top:0,left:0}):h.setTimeout?(k=g.width(),l=g.height(),m={top:g.scrollTop(),left:g.scrollLeft()}):h.preventDefault?(b.at="left top",k=l=0,m={top:b.of.pageY,left:b.of.pageX}):(k=g.outerWidth(),l=g.outerHeight(),m=g.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");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}),i.length===1&&(i[1]=i[0]),j[0]=parseInt(j[0],10)||0,j.length===1&&(j[1]=j[0]),j[1]=parseInt(j[1],10)||0,b.at[0]==="right"?m.left+=k:b.at[0]===e&&(m.left+=k/2),b.at[1]==="bottom"?m.top+=l:b.at[1]===e&&(m.top+=l/2),m.left+=j[0],m.top+=j[1],this.each(function(){var c=a(this),d=c.outerWidth(),f=c.outerHeight(),g=parseInt(a.curCSS(this,"marginLeft",!0))||0,h=parseInt(a.curCSS(this,"marginTop",!0))||0,n=d+g+(parseInt(a.curCSS(this,"marginRight",!0))||0),o=f+h+(parseInt(a.curCSS(this,"marginBottom",!0))||0),p=a.extend({},m),q;b.my[0]==="right"?p.left-=d:b.my[0]===e&&(p.left-=d/2),b.my[1]==="bottom"?p.top-=f: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){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})}),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}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];return!c||!c.ownerDocument?null:b?this.each(function(){a.offset.setOffset(this,b)}):g.call(this)})}(jQuery),function(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){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;return this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy(),this},_mouseCapture:function(b){var c=this.options;return this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(b),this.handle?(c.iframeFix&&a(c.iframeFix===!0?"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")}),!0):!1)},_mouseStart:function(b){var c=this.options;return this.helper=this._createHelper(b),this._cacheHelperProportions(),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),c.containment&&this._setContainment(),this._trigger("start",b)===!1?(this._clear(),!1):(this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.helper.addClass("ui-draggable-dragging"),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b),!0)},_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)===!1)return this._mouseUp({}),!1;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";return a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||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(){d._trigger("stop",b)!==!1&&d._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){return this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b),a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;return a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)}),c},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;return d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute"),d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"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();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()}}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;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),d=c[0];if(!d)return;var e=c.offset(),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 b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!a.ui.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,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.scrollParent:this.offsetParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,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;b.pageX-this.offset.click.left<h[0]&&(f=h[0]+this.offset.click.left),b.pageY-this.offset.click.top<h[1]&&(g=h[1]+this.offset.click.top),b.pageX-this.offset.click.left>h[2]&&(f=h[2]+this.offset.click.left),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-this.offset.click.top<h[1]?j+c.grid[1]:j-c.grid[1]:j: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-this.offset.click.left<h[0]?k+c.grid[0]:k-c.grid[0]:k: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"),this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(b,c,d){return d=d||this._uiHash(),a.ui.plugin.call(this,b,[c,d]),b=="drag"&&(this.positionAbs=this._convertPositionTo("absolute")),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.16"}),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");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(){this.instance.isOver?(this.instance.isOver=0,d.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(b),this.instance.options.helper=this.instance.options._helper,d.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",b,e))})},drag:function(b,c){var d=a(this).data("draggable"),e=this,f=function(b){var c=this.offset.click.top,d=this.offset.click.left,e=this.positionAbs.top,f=this.positionAbs.left,g=b.height,h=b.width,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,this.instance._intersectsWith(this.instance.containerCache)?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=a(e).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),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,!0),this.instance._mouseStart(b,!0,!0),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),this.instance.currentItem&&this.instance._mouseDrag(b)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",b,this.instance._uiHash(this.instance)),this.instance._mouseStop(b,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),d._trigger("fromSortable",b),d.dropped=!1)})}}),a.ui.plugin.add("draggable","cursor",{start:function(b,c){var d=a("body"),e=a(this).data("draggable").options;d.css("cursor")&&(e._cursor=d.css("cursor")),d.css("cursor",e.cursor)},stop:function(b,c){var d=a(this).data("draggable").options;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;d.css("opacity")&&(e._opacity=d.css("opacity")),d.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;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");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=!1;if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"){if(!e.axis||e.axis!="x")d.overflowOffset.top+d.scrollParent[0].offsetHeight-b.pageY<e.scrollSensitivity?d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop+e.scrollSpeed:b.pageY-d.overflowOffset.top<e.scrollSensitivity&&(d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop-e.scrollSpeed);if(!e.axis||e.axis!="y")d.overflowOffset.left+d.scrollParent[0].offsetWidth-b.pageX<e.scrollSensitivity?d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft+e.scrollSpeed: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")b.pageY-a(document).scrollTop()<e.scrollSensitivity?f=a(document).scrollTop(a(document).scrollTop()-e.scrollSpeed):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")b.pageX-a(document).scrollLeft()<e.scrollSensitivity?f=a(document).scrollLeft(a(document).scrollLeft()-e.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<e.scrollSensitivity&&(f=a(document).scrollLeft(a(document).scrollLeft()+e.scrollSpeed))}f!==!1&&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),c=b.offset();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,f=e.snapTolerance,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)){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=!1;continue}if(e.snapMode!="inner"){var p=Math.abs(n-j)<=f,q=Math.abs(o-i)<=f,r=Math.abs(l-h)<=f,s=Math.abs(m-g)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n-d.helperProportions.height,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o,left:0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l-d.helperProportions.width}).left-d.margins.left),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,q=Math.abs(o-j)<=f,r=Math.abs(l-g)<=f,s=Math.abs(m-h)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o-d.helperProportions.height,left:0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l}).left-d.margins.left),s&&(c.position.left=d._convertPositionTo("relative",{top:0,left:m-d.helperProportions.width}).left-d.margins.left)}!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,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;d.css("zIndex")&&(e._zIndex=d.css("zIndex")),d.css("zIndex",e.zIndex)},stop:function(b,c){var d=a(this).data("draggable").options;d._zIndex&&a(c.helper).css("zIndex",d._zIndex)}})}(jQuery),function(a,b){a.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,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++)b[c]==this&&b.splice(c,1);return this.element.removeClass("ui-droppable ui-droppable-disabled").removeData
("droppable").unbind(".droppable"),this},_setOption:function(b,c){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;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;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;this.accept.call(this.element[0],c.currentItem||c.element)&&(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;this.accept.call(this.element[0],c.currentItem||c.element)&&(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!1;var e=!1;return 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))return e=!0,!1}),e?!1:this.accept.call(this.element[0],d.currentItem||d.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",b,this.ui(d)),this.element):!1},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.16"}),a.ui.intersect=function(b,c,d){if(!c.offset)return!1;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,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;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;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;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);default:return!1}},a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var d=a.ui.ddmanager.droppables[b.options.scope]||[],e=c?c.type:null,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;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=!1;return a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){if(!this.options)return;!this.options.disabled&&this.visible&&a.ui.intersect(b,this,this.options.tolerance)&&(d=d||this._drop.call(this,c)),!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))}),d},dragStart:function(b,c){b.element.parents(":not(body,html)").bind("scroll.droppable",function(){b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)})},drag:function(b,c){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),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)");g.length&&(f=a.data(g[0],"droppable"),f.greedyChild=e=="isover"?1:0)}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),f&&e=="isout"&&(f.isout=0,f.isover=1,f._over.call(f,c))})},dragStop:function(b,c){b.element.parents(":not(body,html)").unbind("scroll.droppable"),b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)}}}(jQuery),function(a,b){a.widget("ui.resizable",a.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,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}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(/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=!0,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?{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"}:"e,s,se");if(this.handles.constructor==String){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,h=a('<div class="ui-resizable-handle '+g+'"></div>');/sw|se|ne|nw/.test(f)&&h.css({zIndex:++c.zIndex}),"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){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"}}),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;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()}return this.originalElement.css("resize",this.originalResizeStyle),b(this.originalElement),this},_mouseCapture:function(b){var c=!1;for(var d in this.handles)a(this.handles[d])[0]==b.target&&(c=!0);return!this.options.disabled&&c},_mouseStart:function(b){var d=this.options,e=this.element.position(),f=this.element;this.resizing=!0,this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()},(f.is(".ui-draggable")||/absolute/.test(f.css("position")))&&f.css({position:"absolute",top:e.top,left:e.left}),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"));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");return a("body").css("cursor",i=="auto"?this.axis+"-resize":i),f.addClass("ui-resizable-resizing"),this._propagate("start",b),!0},_mouseDrag:function(b){var c=this.helper,d=this.options,e={},f=this,g=this.originalMousePosition,h=this.axis,i=b.pageX-g.left||0,j=b.pageY-g.top||0,k=this._change[h];if(!k)return!1;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);return 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"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",b,this.ui()),!1},_mouseStop:function(b){this.resizing=!1;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,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;c.animate||this.element.css(a.extend(i,{top:k,left:j})),d.helper.height(d.size.height),d.helper.width(d.size.width),this._helper&&!c.animate&&this._proportionallyResize()}return a("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",b),this._helper&&this.helper.remove(),!1},_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,c>h.minWidth&&(h.minWidth=c),f>h.minHeight&&(h.minHeight=f),e<h.maxWidth&&(h.maxWidth=e),g<h.maxHeight&&(h.maxHeight=g);this._vBoundaries=h},_updateCache:function(a){var b=this.options;this.offset=this.helper.offset(),d(a.left)&&(this.position.left=a.left),d(a.top)&&(this.position.top=a.top),d(a.height)&&(this.size.height=a.height),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;return d(a.height)?a.width=a.height*this.aspectRatio:d(a.width)&&(a.height=a.width/this.aspectRatio),g=="sw"&&(a.left=e.left+(f.width-a.width),a.top=null),g=="nw"&&(a.top=e.top+(f.height-a.height),a.left=e.left+(f.width-a.width)),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;j&&(a.width=e.minWidth),k&&(a.height=e.minHeight),h&&(a.width=e.maxWidth),i&&(a.height=e.maxHeight);var l=this.originalPosition.left+this.originalSize.width,m=this.position.top+this.size.height,n=/sw|nw|w/.test(g),o=/nw|ne|n/.test(g);j&&n&&(a.left=l-e.minWidth),h&&n&&(a.left=l-e.maxWidth),k&&o&&(a.top=m-e.minHeight),i&&o&&(a.top=m-e.maxHeight);var p=!a.width&&!a.height;return p&&!a.left&&a.top?a.top=null:p&&!a.top&&a.left&&(a.left=null),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.16"}),a.ui.plugin.add("resizable","alsoResize",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,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")})})};typeof e.alsoResize=="object"&&!e.alsoResize.parentNode?e.alsoResize.length?(e.alsoResize=e.alsoResize[0],f(e.alsoResize)):a.each(e.alsoResize,function(a){f(a)}):f(e.alsoResize)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.originalSize,g=d.originalPosition,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);c&&c>=0&&(g[b]=c||null)}),a.browser.opera&&/relative/.test(b.css("position"))&&(d._revertToRelativePosition=!0,b.css({position:"absolute",top:"auto",left:"auto"})),b.css(g)})};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a,b){i(a,b)}):i(e.alsoResize)},stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=function(b){a(b).each(function(){var b=a(this);b.css({position:b.data("resizable-alsoresize").position})})};d._revertToRelativePosition&&(d._revertToRelativePosition=!1,typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a){f(a)}):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,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,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)};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,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;l[0]!=document&&/static/.test(l.css("position"))&&(k=g),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),j&&(d.size.height=d.size.width/e.aspectRatio),d.position.left=e.helper?g.left:0),i.top<(d._helper?g.top:0)&&(d.size.height=d.size.height+(d._helper?d.position.top-g.top:d.position.top),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),o=d.containerElement.get(0)==d.element.parent().get(0),p=/relative|absolute/.test(d.containerElement.css("position"));o&&p&&(m-=d.parentData.left),m+d.size.width>=d.parentData.width&&(d.size.width=d.parentData.width-m,j&&(d.size.height=d.size.width/d.aspectRatio)),n+d.size.height>=d.parentData.height&&(d.size.height=d.parentData.height-n,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,j=a(d.helper),k=j.offset(),l=j.outerWidth()-d.sizeDiff.width,m=j.outerHeight()-d.sizeDiff.height;d._helper&&!e.animate&&/relative/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m}),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;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;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);/^(se|s|e)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l):/^(ne)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l):/^(sw)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.left=h.left-k):(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},d=function(a){return!isNaN(parseInt(a,10))}}(jQuery),function(a,b){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var b=this;this.element.addClass("ui-selectable"),this.dragged=!1;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]),c.each(function(){var b=a(this),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:!1,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(){return this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable"),this._mouseDestroy(),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}),d.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var d=a.data(this,"selectable-item");d.startselected=!0,b.metaKey||(d.$element.removeClass("ui-selected"),d.selected=!1,d.$element.addClass("ui-unselecting"),d.unselecting=!0,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");return d.$element.removeClass(e?"ui-unselecting":"ui-selected").addClass(e?"ui-selecting":"ui-unselecting"),d.unselecting=!e,d.selecting=e,d.selected=e,e?c._trigger("selecting",b,{selecting:d.element}):c._trigger("unselecting",b,{unselecting:d.element}),!1}})},_mouseDrag:function(b){var c=this;this.dragged=!0;if(this.options.disabled)return;var d=this.options,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}return 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=!1;d.tolerance=="touch"?j=!(i.left>g||i.right<e||i.top>h||i.bottom<f):d.tolerance=="fit"&&(j=i.left>e&&i.right<g&&i.top>f&&i.bottom<h),j?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,c._trigger("selecting",b,{selecting:i.element}))):(i.selecting&&(b.metaKey&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),c._trigger("unselecting",b,{unselecting:i.element}))),i.selected&&!b.metaKey&&!i.startselected&&(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,c._trigger("unselecting",b,{unselecting:i.element})))}),!1},_mouseStop:function(b){var c=this;this.dragged=!1;var d=this.options;return a(".ui-unselecting",this.element[0]).each(function(){var d=a.data(this,"selectable-item");d.$element.removeClass("ui-unselecting"),d.unselecting=!1,d.startselected=!1,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=!1,d.selected=!0,d.startselected=!0,c._trigger("selected",b,{selected:d.element})}),this._trigger("stop",b),this.helper.remove(),!1}}),a.extend(a.ui.selectable,{version:"1.8.16"})}(jQuery),function(a,b){a.widget("ui.sortable",a.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,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")):!1,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){b==="disabled"?(this.options[b]=c,this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")):a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(b);var d=null,e=this,f=a(b.target).parents().each(function(){if(a.data(this,"sortable-item")==e)return d=a(this),!1});a.data(b.target,"sortable-item")==e&&(d=a(b.target));if(!d)return!1;if(this.options.handle&&!c){var g=!1;a(this.options.handle,d).find("*").andSelf().each(function(){this==b.target&&(g=!0)});if(!g)return!1}return this.currentItem=d,this._removeCurrentsFromItems(),!0},_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]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),e.containment&&this._setContainment(),e.cursor&&(a("body").css("cursor")&&(this._storedCursor=a("body").css("cursor")),a("body").css("cursor",e.cursor)),e.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",e.opacity)),e.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",e.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),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));return a.ui.ddmanager&&(a.ui.ddmanager.current=this),a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b),!0},_mouseDrag:function(b){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var c=this.options,d=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY<c.scrollSensitivity?this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop+c.scrollSpeed:b.pageY-this.overflowOffset.top<c.scrollSensitivity&&(this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop-c.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-b.pageX<c.scrollSensitivity?this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft+c.scrollSpeed:b.pageX-this.overflowOffset.left<c.scrollSensitivity&&(this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft-c.scrollSpeed)):(b.pageY-a(document).scrollTop()<c.scrollSensitivity?d=a(document).scrollTop(a(document).scrollTop()-c.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<c.scrollSensitivity&&(d=a(document).scrollTop(a(document).scrollTop()+c.scrollSpeed)),b.pageX-a(document).scrollLeft()<c.scrollSensitivity?d=a(document).scrollLeft(a(document).scrollLeft()-c.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<c.scrollSensitivity&&(d=a(document).scrollLeft(a(document).scrollLeft()+c.scrollSpeed))),d!==!1&&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):!0)){this.direction=h==1?"down":"up";if(this.options.tolerance!="pointer"&&!this._intersectsWithSides(f))break;this._rearrange(b,f),this._trigger("change",b,this._uiHash());break}}return this._contactContainers(b),a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),this._trigger("sort",b
,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(b,c){if(!b)return;a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this,e=d.placeholder.offset();d.reverting=!0,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!1},cancel:function(){var b=this;if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("deactivate",null,b._uiHash(this)),this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",null,b._uiHash(this)),this.containers[c].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))}),!d.length&&b.key&&d.push(b.key+"="),d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")}),d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l=d+j>h&&d+j<i&&b+k>f&&b+k<g;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?l: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();return e?this.floating?g&&g=="right"||f=="down"?2:1:f&&(f=="down"?2:1):!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();return this.floating&&f?f=="right"&&d||f=="left"&&!d: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){return this._refreshItems(a),this.refreshPositions(),this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){var c=this,d=[],e=[],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");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++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(b){this.items=[],this.containers=[this];var c=this.items,d=this,e=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]],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");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],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){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;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];return e||(b.style.visibility="hidden"),b},update:function(a,b){if(e&&!d.forcePlaceholderSize)return;b.height()||b.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10)),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 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,g=null,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"];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,!0):this._rearrange(b,null,this.containers[d].element,!0),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,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b,this.currentItem])):c.helper=="clone"?this.currentItem.clone():this.currentItem;return d.parents("body").length||a(c.appendTo!="parent"?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0]),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")}),(d[0].style.width==""||c.forceHelperSize)&&d.width(this.currentItem.width()),(d[0].style.height==""||c.forceHelperSize)&&d.height(this.currentItem.height()),d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"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();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()}}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;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],d=a(b.containment).offset(),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){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!a.ui.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,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.scrollParent:this.offsetParent,e=/(html|body)/i.test(d[0].tagName);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var f=b.pageX,g=b.pageY;if(this.originalPosition){this.containment&&(b.pageX-this.offset.click.left<this.containment[0]&&(f=this.containment[0]+this.offset.click.left),b.pageY-this.offset.click.top<this.containment[1]&&(g=this.containment[1]+this.offset.click.top),b.pageX-this.offset.click.left>this.containment[2]&&(f=this.containment[2]+this.offset.click.left),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-this.offset.click.top<this.containment[1]?h+c.grid[1]:h-c.grid[1]:h: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-this.offset.click.left<this.containment[0]?i+c.grid[0]:i-c.grid[0]:i: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(){f==e.counter&&e.refreshPositions(!d)},0)},_clear:function(b,c){this.reverting=!1;var d=[],e=this;!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();this.fromOutside&&!c&&d.push(function(a){this._trigger("receive",a,this._uiHash(this.fromOutside))}),(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])){c||d.push(function(a){this._trigger("remove",a,this._uiHash())});for(var f=this.containers.length-1;f>=0;f--)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--)c||d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[f])),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);this._storedCursor&&a("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;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!1}c||this._trigger("beforeStop",b,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),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())}return this.fromOutside=!1,!0},_trigger:function(){a.Widget.prototype._trigger.apply(this,arguments)===!1&&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.16"})}(jQuery),function(a,b){a.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:!0,clearStyle:!1,collapsible:!1,event:"click",fillSpace:!1,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:!1,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");e.length?b.active=e: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(),b.active.length?b.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):b.headers.eq(0).attr("tabIndex",0),a.browser.safari||b.headers.find("a").attr("tabIndex",-1),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;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");return(b.autoHeight||b.fillHeight)&&c.css("height",""),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b=="active"&&this.activate(c),b=="icons"&&(this._destroyIcons(),c&&this._createIcons()),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=!1;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()}return f?(a(b.target).attr("tabIndex",-1),a(f).attr("tabIndex",0),f.focus(),!1):!0},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(),a.browser.msie&&this.element.parent().css("overflow",d),this.headers.each(function(){c-=a(this).outerHeight(!0)}),this.headers.next().each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+a(this).height()))}).css("overflow","auto")}else 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];return this._clickHandler({target:b},b),this},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===!1?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?!1: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),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={};h.collapsible&&e?j={toShow:a([]),toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace}:j={toShow:b,toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace},h.proxied||(h.proxied=h.animated),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;m&&!k[m]&&!a.easing[m]&&(m="slide"),k[m]||(k[m]=function(a){this.slide(a,{easing:m,duration:l||700})}),k[m](j)}else h.collapsible&&e?b.toggle():(c.hide(),b.show()),i(!0);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;this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""}),this.toHide.removeClass("ui-accordion-content-active"),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.16",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,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){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(){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:!1,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.propAttr("readOnly"))return;d=!1;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:b.menu.active&&(d=!0,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(){b.term!=b.element.val()&&(b.selectedItem=null,b.search(null,c))},b.options.delay)}}).bind("keypress.autocomplete",function(a){d&&(d=!1,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];a(c.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(c){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");!1!==b._trigger("focus",a,{item:d})&&/^key/.test(a.originalEvent.type)&&b.element.val(d.value)},selected:function(a,d){var e=d.item.data("item.autocomplete"),f=b.previous;b.element[0]!==c.activeElement&&(b.element.focus(),b.previous=f,setTimeout(function(){b.previous=f,b.selectedItem=e},1)),!1!==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){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"),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),b==="source"&&this._initSource(),b==="appendTo"&&this.menu.element.appendTo(a(c||"body",this.element[0].ownerDocument)[0]),b==="disabled"&&c&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,d,e;a.isArray(this.options.source)?(d=this.options.source,this.source=function(b,c){c(a.ui.autocomplete.filter(d,b.term))}):typeof this.options.source=="string"?(e=this.options.source,this.source=function(d,f){b.xhr&&b.xhr.abort(),b.xhr=a.ajax({url:e,data:d,dataType:"json",autocompleteRequest:++c,success:function(a,b){this.autocompleteRequest===c&&f(a)},error:function(){this.autocompleteRequest===c&&f([])}})}):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)===!1)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){!this.options.disabled&&a&&a.length?(a=this._normalize(a),this._suggest(a),this._trigger("open")):this.close(),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},close:function(a){clearTimeout(this.closing),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.deactivate(),this._trigger("close",a))},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(b){return b.length&&b[0].label&&b[0].value?b:a.map(b,function(b){return typeof b=="string"?{label:b,value:b}: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)),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,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();c<0?this.element.scrollTop(d+c):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);d.length?this.activate(c,d):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});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}),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([]);return c&&(d?e=a(d).find("[name='"+c+"']"):e=a("[name='"+c+"']",b.ownerDocument).filter(function(){return!this.form})),e};a.widget("ui.button",{options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",j),typeof this.options.disabled!="boolean"&&(this.options.disabled=this.element.propAttr("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";h.label===null&&(h.label=this.buttonElement.html()),this.element.is(":disabled")&&(h.disabled=!0),this.buttonElement.addClass(g).attr("role","button").bind("mouseenter.button",function(){if(h.disabled)return;a(this).addClass("ui-state-hover"),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){h.disabled&&(a.preventDefault(),a.stopImmediatePropagation())}),this.element.bind("focus.button",function(){b.buttonElement.addClass(m)}).bind("blur.button",function(){b.buttonElement.removeClass(m)}),i&&(this.element.bind("change.button",function(){if(f)return;b.refresh()}),this.buttonElement.bind("mousedown.button",function(a){if(h.disabled)return;f=!1,d=a.pageX,e=a.pageY}).bind("mouseup.button",function(a){if(h.disabled)return;if(d!==a.pageX||e!==a.pageY)f=!0})),this.type==="checkbox"?this.buttonElement.bind("click.button",function(){if(h.disabled||f)return!1;a(this).toggleClass("ui-state-active"),b.buttonElement.attr("aria-pressed",b.element[0].checked)}):this.type==="radio"?this.buttonElement.bind("click.button",function(){if(h.disabled||f)return!1;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")}):(this.buttonElement.bind("mousedown.button",function(){if(h.disabled)return!1;a(this).addClass("ui-state-active"),c=this,a(document).one("mouseup",function(){c=null})}).bind("mouseup.button",function(){if(h.disabled)return!1;a(this).removeClass("ui-state-active")}).bind("keydown.button",function(b){if(h.disabled)return!1;(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")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(b){b.keyCode===a.ui.keyCode.SPACE&&a(this).click()})),this._setOption("disabled",h.disabled),this._resetButton()},_determineButtonType:function(){this.element.is(":checkbox")?this.type="checkbox":this.element.is(":radio")?this.type="radio":this.element.is("input")?this.type="input":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),this.buttonElement.length||(a=a.length?a.siblings():this.element.siblings(),this.buttonElement=a.filter(b),this.buttonElement.length||(this.buttonElement=a.find(b))),this.element.addClass("ui-helper-hidden-accessible");var c=this.element.is(":checked");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()),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"){c?this.element.propAttr("disabled",!0):this.element.propAttr("disabled",!1);return}this._resetButton()},refresh:function(){var b=this.element.is(":disabled");b!==this.options.disabled&&this._setOption("disabled",b),this.type==="radio"?k(this.element[0]).each(function(){a(this).is(":checked")?a(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):a(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):this.type==="checkbox"&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if(this.type==="input"){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=[];d.primary||d.secondary?(this.options.text&&f.push("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary")),d.primary&&b.prepend("<span class='ui-button-icon-primary ui-icon "+d.primary+"'></span>"),d.secondary&&b.append("<span class='ui-button-icon-secondary ui-icon "+d.secondary+"'></span>"),this.options.text||(f.push(e?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||b.attr("title",c))):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){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:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},e={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},f=a.attrFn||{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0,click:!0};a.widget("ui.dialog",{options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",collision:"fit",using:function(b){var c=a(this).css(b).offset().top;c<0&&a(this).css("top",b.top-c)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),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){d.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(a){b.moveToTop(!1,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 ui-helper-clearfix").prependTo(g),j=a('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").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){return b.close(a),!1}).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);a.isFunction(d.beforeclose)&&!a.isFunction(d.beforeClose)&&(d.beforeClose=d.beforeclose),i.find("*").add(i).disableSelection(),d.draggable&&a.fn.draggable&&b._makeDraggable(),d.resizable&&a.fn.resizable&&b._makeResizable(),b._createButtons(d.buttons),b._isOpen=!1,a.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;return 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(),a.originalTitle&&a.element.attr("title",a.originalTitle),a},widget:function(){return this.uiDialog},close:function(b){var c=this,d,e;if(!1===c._trigger("beforeClose",b))return;return c.overlay&&c.overlay.destroy(),c.uiDialog.unbind("keypress.ui-dialog"),c._isOpen=!1,c.options.hide?c.uiDialog.hide(c.options.hide,function(){c._trigger("close",b)}):(c.uiDialog.hide(),c._trigger("close",b)),a.ui.dialog.overlay.resize(),c.options.modal&&(d=0,a(".ui-dialog").each(function(){this!==c.uiDialog[0]&&(e=a(this).css("z-index"),isNaN(e)||(d=Math.max(d,e)))}),a.ui.dialog.maxZ=d),c},isOpen:function(){return this._isOpen},moveToTop:function(b,c){var d=this,e=d.options,f;return e.modal&&!b||!e.stack&&!e.modal?d._trigger("focus",c):(e.zIndex>a.ui.dialog.maxZ&&(a.ui.dialog.maxZ=e.zIndex),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.scrollTop(),scrollLeft:d.element.scrollLeft()},a.ui.dialog.maxZ+=1,d.uiDialog.css("z-index",a.ui.dialog.maxZ),d.element.attr(f),d._trigger("focus",c),d)},open:function(){if(this._isOpen)return;var b=this,c=b.options,d=b.uiDialog;return b.overlay=c.modal?new a.ui.dialog.overlay(b):null,b._size(),b._position(c.position),d.show(c.show),b.moveToTop(!0),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)return d.focus(1),!1;if(b.target===d[0]&&b.shiftKey)return e.focus(1),!1}),a(b.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus(),b._isOpen=!0,b._trigger("open"),b},_createButtons:function(b){var c=this,d=!1,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(),typeof b=="object"&&b!==null&&a.each(b,function(){return!(d=!0)}),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;a in f?e[a](b):e.attr(a,b)}),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;return a.height==="auto"?a.minHeight: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]],c.length===1&&(c[1]=c[0]),a.each(["left","top"],function(a,b){+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"),e||this.uiDialog.show(),this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},b)),e||this.uiDialog.hide()},_setOptions:function(b){var c=this,f={},g=!1;a.each(b,function(a,b){c._setOption(a,b),a in d&&(g=!0),a in e&&(f[a]=b)}),g&&this._size(),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"dialogClass":f.removeClass(e.options.dialogClass).addClass(c+d);break;case"disabled":d?f.addClass("ui-dialog-disabled"):f.removeClass("ui-dialog-disabled");break;case"draggable":var g=f.is(":data(draggable)");g&&!d&&f.draggable("destroy"),!g&&d&&e._makeDraggable();break;case"position":e._position(d);break;case"resizable":var h=f.is(":data(resizable)");h&&!d&&f.resizable("destroy"),h&&typeof d=="string"&&f.resizable("option","handles",d),!h&&d!==!1&&e._makeResizable(d);break;case"title":a(".ui-dialog-title",e.uiDialogTitlebar).html(""+(d||"&#160;"))}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}),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();e||this.uiDialog.hide(),this.element.height(Math.max(f,d))}else this.element.height(Math.max(b.height-c,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),a.extend(a.ui.dialog,{version:"1.8.16",uuid:0,maxZ:0,getTitleId:function(a){var b=a.attr("id");return b||(this.uuid+=1,b=this.uuid),"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){this.instances.length===0&&(setTimeout(function(){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!1})},1),a(document).bind("keydown.dialog-overlay",function(c){b.options.closeOnEscape&&!c.isDefaultPrevented()&&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()});return a.fn.bgiframe&&c.bgiframe(),this.instances.push(c),c},destroy:function(b){var c=a.inArray(b,this.instances);c!=-1&&this.oldInstances.push(this.instances.splice(c,1)[0]),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;return 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),b<c?a(window).height()+"px":b+"px"):a(document).height()+"px"},width:function(){var b,c;return a.browser.msie?(b=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),c=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth),b<c?a(window).width()+"px":b+"px"):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:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,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=!1,this._mouseSliding=!1,this._animateOff=!0,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([]),d.range&&(d.range===!0&&(d.values||(d.values=[this._valueMin(),this._valueMin()]),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(){d.disabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){d.disabled?a(this).blur():(a(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),a(this).addClass("ui-state-focus"))}).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=!0,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=!1;if(!b._keySliding){b._keySliding=!0,a(this).addClass("ui-state-active"),g=b._start(d,f);if(g===!1)return}}j=b.options.step,b.options.values&&b.options.values.length?h=i=b.values(f):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)}return b._slide(d,f,i),e}).keyup(function(c){var d=a(this).data("index.ui-slider-handle");b._keySliding&&(b._keySliding=!1,b._stop(c,d),b._change(c,d),a(this).removeClass("ui-state-active"))}),this._refreshValue(),this._animateOff=!1},destroy:function(){return 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(),this},_mouseCapture:function(b){var c=this.options,d,e,f,g,h,i,j,k,l;return c.disabled?!1:(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));f>c&&(f=c,g=a(this),i=b)}),c.range===!0&&this.values(1)===c.min&&(i+=1,g=a(this.handles[i])),j=this._start(b,i),j===!1?!1:(this._mouseSliding=!0,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)},this.handles.hasClass("ui-state-hover")||this._slide(b,i,e),this._animateOff=!0,!0))},_mouseStart:function(a){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);return this._slide(a,this._handleIndex,c),!1},_mouseStop:function(a){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;return this.orientation==="horizontal"?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),this.orientation==="vertical"&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e,this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};return this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),this.options.values.length===2&&this.options.range===!0&&(b===0&&c>d||b===1&&c<d)&&(c=d),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),f!==!1&&this.values(b,c,!0))):c!==this.value()&&(f=this._trigger("slide",a,{handle:this.handles[b],value:c}),f!==!1&&this.value(c))},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};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()};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)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();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()},_setOption:function(b,c){var d,e=0;a.isArray(this.options.values)&&(e=this.options.values.length),a.Widget.prototype._setOption.apply(this,arguments);switch(b){case"disabled":c?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.propAttr("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.propAttr("disabled",!1),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=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":this._animateOff=!0,this._refreshValue();for(d=0;d<e;d+=1)this._change(null,d);this._animateOff=!1}},_value:function(){var a=this.options.value;return a=this._trimAlignValue(a),a},_values:function(a){var b,c,d;if(arguments.length)return b=this.options.values[a],b=this._trimAlignValue(b),b;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,d=a-c;return Math.abs(c)*2>=b&&(d+=c>0?b:-b),parseFloat(d.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?!1:c.animate,f,g={},h,i,j,k;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),d.options.range===!0&&(d.orientation==="horizontal"?(b===0&&d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({width:f-h+"%"},{queue:!1,duration:c.animate})):(b===0&&d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate}))),h=f}):(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),b==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate),b==="max"&&this.orientation==="horizontal"&&this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,duration:c.animate}),b==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate),b==="max"&&this.orientation==="vertical"&&this.range[e?"animate":"css"]({height:100-f+"%"},{queue:!1,duration:c.animate}))}}),a.extend(a.ui.slider,{version:"1.8.16"})}(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:!1,cookie:null,collapsible:!1,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(!0)},_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",""),!a.support.opacity&&c.opacity&&b[0].style.removeAttribute("filter")}var d=this,e=this.options,f=/^#.+/;this.list=this.element.find("ol,ul").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"),h=g.split("#")[0],i;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);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",!0)),d.panels=d.panels.add(k)}else e.disabled.push(b)}),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"),e.selected===b?(location.hash&&this.anchors.each(function(a,b){if(b.hash==location.hash)return e.selected=a,!1}),typeof e.selected!="number"&&e.cookie&&(e.selected=parseInt(d._cookie(),10)),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)):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(),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"),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})):e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")),this.element[e.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible"),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");e.cache===!1&&this.anchors.removeData("cache.tabs"),this.lis.add(this.anchors).unbind(".tabs");if(e.event!=="mouseover"){var i=function(a,b){b.is(":not(.ui-state-disabled)")&&b.addClass("ui-state-"+a)},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;e.fx&&(a.isArray(e.fx)?(k=e.fx[0],l=e.fx[1]):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]))},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]))===!1)return this.blur(),!1;e.selected=d.anchors.index(this),d.abort();if(e.collapsible){if(c.hasClass("ui-tabs-selected"))return e.selected=-1,e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){o(b,f)}).dequeue("tabs"),this.blur(),!1;if(!f.length)return e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this)),this.blur(),!1}e.cookie&&d._cookie(e.selected,e.cookie);if(!g.length)throw"jQuery UI Tabs: Mismatching fragment identifier.";f.length&&d.element.queue("tabs",function(){o(b,f)}),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this)),a.browser.msie&&this.blur()}),this.anchors.bind("click.tabs",function(){return!1})},_getIndex:function(a){return typeof a=="string"&&(a=this.anchors.index(this.anchors.filter("[href$="+a+"]"))),a},destroy:function(){var b=this.options;return 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");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(){a.data(this,"destroy.tabs")?a(this).remove():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(" "))}),b.cookie&&this._cookie(null,b.cookie),this},add:function(c,d,e){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("#")?this._tabId(a("a",h)[0]):c.replace("#","");h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var j=f.element.find("#"+i);return j.length||(j=a(g.panelTemplate).attr("id",i).data("destroy.tabs",!0)),j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"),e>=this.lis.length?(h.appendTo(this.list),j.appendTo(this.list[0].parentNode)):(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(),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])),this},remove:function(b){b=this._getIndex(b);var c=this.options,d=this.lis.eq(b).remove(),e=this.panels.eq(b).remove();return 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])),this},enable:function(b){b=this._getIndex(b);var c=this.options;if(a.inArray(b,c.disabled)==-1)return;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])),this},disable:function(a){a=this._getIndex(a);var b=this,c=this.options;return 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]))),this},select:function(a){a=this._getIndex(a);if(a==-1){if(!this.options.collapsible||this.options.selected==-1)return this;a=this.options.selected}return this.anchors.eq(a).trigger(this.options.event+".tabs"),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)}return 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(),d.cache&&a.data(e,"cache.tabs",!0),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"),this},abort:function(){return this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("tabs",this.element.queue("tabs").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._cleanup(),this},url:function(a,b){return this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",b),this},length:function(){return this.anchors.length}}),a.extend(a.ui.tabs,{version:"1.8.16"}),a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(a,b){var c=this,d=this.options,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),b&&b.stopPropagation()}),f=c._unrotate||(c._unrotate=b?function(a){t=d.selected,e()}:function(a){a.clientX&&c.rotate(null)});return a?(this.element.bind("tabsshow",e),this.anchors.bind(d.event+".tabs",f),e()):(clearTimeout(c.rotation),this.element.unbind("tabsshow",e),this.anchors.unbind(d.event+".tabs",f),delete this._rotate,delete this._unrotate),this}})}(jQuery),function($,undefined){function Datepicker(){this.debug=!1,this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,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:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,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:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},$.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"),d.hasClass("ui-datepicker-prev")&&d.addClass("ui-datepicker-prev-hover"),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.16"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){return extendRemove(this._defaults,a||{}),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(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):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?bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')):this.dpDiv}},_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),b.settings.disabled&&this._disableDatepicker(a)},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");b.append&&b.append.remove(),c&&(b.append=$('<span class="'+this._appendClass+'">'+c+"</span>"),a[d?"before":"after"](b.append)),a.unbind("focus",this._showDatepicker),b.trigger&&b.trigger.remove();var e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText"),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(){return $.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0]?$.datepicker._hideDatepicker():$.datepicker._showDatepicker(a[0]),!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0,c=0;for(var d=0;d<a.length;d++)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),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block")},_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,!1),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,i=document.documentElement.clientHeight,j=document.documentElement.scrollLeft||document.body.scrollLeft,k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}return this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=c,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,f),this},_destroyDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName))return;var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME),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)):(d=="div"||d=="span")&&b.removeClass(this.markerClassName).empty()},_enableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName))return;var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).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),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName))return;var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).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!1;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return!0;return!1},_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||{};typeof b=="string"&&(e={},e[b]=c);if(d){this._curInst==d&&this._hideDatepicker();var f=this._getDateDatepicker(a,!0),g=this._getMinMaxDate(d,"min"),h=this._getMinMaxDate(d,"max");extendRemove(d.settings,e),g!==null&&e.dateFormat!==undefined&&e.minDate===undefined&&(d.settings.minDate=this._formatDate(d,g)),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);b&&this._updateDatepicker(b)},_setDateDatepicker:function(a,b){var c=this._getInst(a);c&&(this._setDate(c,b),this._updateDatepicker(c),this._updateAlternate(c))},_getDateDatepicker:function(a,b){var c=this._getInst(a);return c&&!c.inline&&this._setDateFromField(c,b),c?this._getDate(c):null},_doKeyDown:function(a){var b=$.datepicker._getInst(a.target),c=!0,d=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=!0;if($.datepicker._datepickerShowing)switch(a.keyCode){case 9:$.datepicker._hideDatepicker(),c=!1;break;case 13:var e=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",b.dpDiv);e[0]&&$.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,e[0]);var f=$.datepicker._get(b,"onSelect");if(f){var g=$.datepicker._formatDate(b);f.apply(b.input?b.input[0]:null,[g,b])}else $.datepicker._hideDatepicker();return!1;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:(a.ctrlKey||a.metaKey)&&$.datepicker._clearDate(a.target),c=a.ctrlKey||a.metaKey;break;case 36:(a.ctrlKey||a.metaKey)&&$.datepicker._gotoToday(a.target),c=a.ctrlKey||a.metaKey;break;case 37:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?1:-1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 38:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,-7,"D"),c=a.ctrlKey||a.metaKey;break;case 39:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?-1:1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 40:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,7,"D"),c=a.ctrlKey||a.metaKey;break;default:c=!1}else a.keyCode==36&&a.ctrlKey?$.datepicker._showDatepicker(this):c=!1;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")),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));c&&($.datepicker._setDateFromField(b),$.datepicker._updateAlternate(b),$.datepicker._updateDatepicker(b))}catch(a){$.datepicker.log(a)}return!0},_showDatepicker:function(a){a=a.target||a,a.nodeName.toLowerCase()!="input"&&(a=$("input",a.parentNode)[0]);if($.datepicker._isDisabledDatepicker(a)||$.datepicker._lastInput==a)return;var b=$.datepicker._getInst(a);$.datepicker._curInst&&$.datepicker._curInst!=b&&($.datepicker._datepickerShowing&&$.datepicker._triggerOnClose($.datepicker._curInst),$.datepicker._curInst.dpDiv.stop(!0,!0));var c=$.datepicker._get(b,"beforeShow"),d=c?c.apply(a,[a,b]):{};if(d===!1)return;extendRemove(b.settings,d),b.lastVal=null,$.datepicker._lastInput=a,$.datepicker._setDateFromField(b),$.datepicker._inDialog&&(a.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(a),$.datepicker._pos[1]+=a.offsetHeight);var e=!1;$(a).parents().each(function(){return e|=$(this).css("position")=="fixed",!e}),e&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var f={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),f=$.datepicker._checkOffset(b,f,e),b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":e?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"});if(!b.inline){var g=$.datepicker._get(b,"showAnim"),h=$.datepicker._get(b,"duration"),i=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=!0,$.effects&&$.effects[g]?b.dpDiv.show(g,$.datepicker._get(b,"showOptions"),h,i):b.dpDiv[g||"show"](g?h:null,i),(!g||!h)&&i(),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");!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),f=e[1],g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),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"),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(){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(),e=a.dpDiv.outerHeight(),f=a.input?a.input.outerWidth():0,g=a.input?a.input.outerHeight():0,h=document.documentElement.clientWidth+$(document).scrollLeft(),i=document.documentElement.clientHeight+$(document).scrollTop();return 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),b},_findPos:function(a){var b=this._getInst(a),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");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"),d=this._get(b,"duration"),e=function(){$.datepicker._tidyDialog(b),this._curInst=null};$.effects&&$.effects[c]?b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,e):b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,e),c||e(),$.datepicker._triggerOnClose(b),this._datepickerShowing=!1,this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!$.datepicker._curInst)return;var b=$(a.target);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),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),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),e=this._getInst(d[0]);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)},_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),c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a),d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d),d.input&&d.input.val(b),this._updateAlternate(d);var e=this._get(d,"onSelect");e?e.apply(d.input?d.input[0]:null,[b,d]):d.input&&d.input.trigger("change"),d.inline?this._updateDatepicker(d):(this._hideDatepicker(),this._lastInput=d.input[0],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"),d=this._getDate(a),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();return b.setMonth(0),b.setDate(1),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,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=function(b){var c=s+1<a.length&&a.charAt(s+1)==b;return c&&s++,c},o=function(a){var c=n(a),d=a=="@"?14:a=="!"?20:a=="y"&&c?4:a=="o"?3:2,e=new RegExp("^\\d{1,"+d+"}"),f=b.substring(r).match(e);if(!f)throw"Missing number at position "+r;return r+=f[0].length,parseInt(f[0],10)},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)}),f=-1;$.each(e,function(a,c){var d=c[1];if(b.substr(r,d.length).toLowerCase()==d.toLowerCase())return f=c[0],r+=d.length,!1});if(f!=-1)return f+1;throw"Unknown name at position "+r},q=function(){if(b.charAt(r)!=a.charAt(s))throw"Unexpected literal at position "+r;r++},r=0;for(var s=0;s<a.length;s++)if(m)a.charAt(s)=="'"&&!n("'")?m=!1: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"'":n("'")?q():m=!0;break;default:q()}if(r<b.length)throw"Extra/unparsed characters found in date: "+b.substring(r);i==-1?i=(new Date).getFullYear():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(!0)}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:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,h=function(b){var c=m+1<a.length&&a.charAt(m+1)==b;return c&&m++,c},i=function(a,b,c){var d=""+b;if(h(a))while(d.length<c)d="0"+d;return d},j=function(a,b,c,d){return h(a)?d[b]:c[b]},k="",l=!1;if(b)for(var m=0;m<a.length;m++)if(l)a.charAt(m)=="'"&&!h("'")?l=!1: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"'":h("'")?k+="'":l=!0;break;default:k+=a.charAt(m)}return k},_possibleChars:function(a){var b="",c=!1,d=function(b){var c=e+1<a.length&&a.charAt(e+1)==b;return c&&e++,c};for(var e=0;e<a.length;e++)if(c)a.charAt(e)=="'"&&!d("'")?c=!1: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"'":d("'")?b+="'":c=!0;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"),d=a.lastVal=a.input?a.input.val():null,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;return b.setDate(b.getDate()+a),b},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,e=d.getFullYear(),f=d.getMonth(),g=d.getDate(),h=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,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))}i=h.exec(b)}return new Date(e,f,g)},f=b==null||b===""?c:typeof b=="string"?e(b):typeof b=="number"?isNaN(b)?c:d(b):new Date(b.getTime());return f=f&&f.toString()=="Invalid Date"?c:f,f&&(f.setHours(0),f.setMinutes(0),f.setSeconds(0),f.setMilliseconds(0)),this._daylightSavingAdjust(f)},_daylightSavingAdjust:function(a){return a?(a.setHours(a.getHours()>12?a.getHours()+2:0),a):null},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,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(),(e!=a.selectedMonth||f!=a.selectedYear)&&!c&&this._notifyChange(a),this._adjustInstDate(a),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"),d=this._get(a,"showButtonPanel"),e=this._get(a,"hideIfNoPrevNext"),f=this._get(a,"navigationAsDateFormat"),g=this._getNumberOfMonths(a),h=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),j=g[0]!=1||g[1]!=1,k=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),l=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),n=a.drawMonth-h,o=a.drawYear;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--,n<0&&(n=11,o--)}a.drawMonth=n,a.drawYear=o;var q=this._get(a,"prevText");q=f?this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a)):q;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>",s=this._get(a,"nextText");s=f?this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a)):s;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>",u=this._get(a,"currentText"),v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;u=f?this.formatDate(u,v,this._getFormatConfig(a)):u;var w=a.inline?"":'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+dpuuid+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>",x=d?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?w:"")+(this._isInRange(a,v)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._gotoToday('#"+a.id+"');\""+">"+u+"</button>":"")+(c?"":w)+"</div>":"",y=parseInt(this._get(a,"firstDay"),10);y=isNaN(y)?0:y;var z=this._get(a,"showWeek"),A=this._get(a,"dayNames"),B=this._get(a,"dayNamesShort"),C=this._get(a,"dayNamesMin"),D=this._get(a,"monthNames"),E=this._get(a,"monthNamesShort"),F=this._get(a,"beforeShowDay"),G=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths"),I=this._get(a,"calculateWeek")||this.iso8601Week,J=this._getDefaultDate(a),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)),P=" ui-corner-all",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=""}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);o==a.selectedYear&&n==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,U));var V=(this._getFirstDayOfMonth(o,n)-y+7)%7,W=Math.ceil((V+U)/7),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 ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[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:"")+(bc?" "+this._unselectableClass+" ui-state-disabled":"")+(bb&&!G?"":" "+ba[1]+(Y.getTime()==k.getTime()?" "+this._currentClass:"")+(Y.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!bb||G)&&ba[2]?' title="'+ba[2]+'"':"")+(bc?"":' onclick="DP_jQuery_'+dpuuid+".datepicker._selectDay('#"+a.id+"',"+Y.getMonth()+","+Y.getFullYear()+', this);return false;"')+">"+(bb&&!G?"&#xa0;":bc?'<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++,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}return K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':""),a._keyEvent=!1,K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this._get(a,"showMonthAfterYear"),l='<div class="ui-datepicker-title">',m="";if(f||!i)m+='<span class="ui-datepicker-month">'+g[b]+"</span>";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" "+">";for(var p=0;p<12;p++)(!n||p>=d.getMonth())&&(!o||p<=e.getMonth())&&(m+='<option value="'+p+'"'+(p==b?' selected="selected"':"")+">"+h[p]+"</option>");m+="</select>"}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(":"),r=(new Date).getFullYear(),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},t=s(q[0]),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');\" "+">";for(;t<=u;t++)a.yearshtml+='<option value="'+t+'"'+(t==c?' selected="selected"':"")+">"+t+"</option>";a.yearshtml+="</select>",l+=a.yearshtml,a.yearshtml=null}}return l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?"&#xa0;":"")+m),l+="</div>",l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),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(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&b<c?c:b;return e=d&&e>d?d:e,e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");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),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));return b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth())),this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),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");return b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10),{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){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;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);return typeof a!="string"||a!="isDisabled"&&a!="getDate"&&a!="widget"?a=="option"&&arguments.length==2&&typeof arguments[1]=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b)):this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)}):$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b))},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.16",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){return a===b?this._value():(this._setOption("value",a),this)},_setOption:function(b,c){b==="value"&&(this.options.value=c,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;return typeof a!="number"&&(a=0),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(),b=this._percentage();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.16"})}(jQuery),jQuery.effects||function(a,b){function c(b){var c;return b&&b.constructor==Array&&b.length==3?b:(c=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))?[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)]:(c=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))?[parseFloat(c[1])*2.55,parseFloat(c[2])*2.55,parseFloat(c[3])*2.55]:(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))?[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)]:(c=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b))?[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)]:(c=/rgba\(0, 0, 0, 0\)/.exec(b))?e.transparent: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],typeof a[c]=="string"&&(d=c.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),b[d]=a[c])}else for(c in a)typeof a[c]=="string"&&(b[c]=a[c]);return b}function i(b){var c,d;for(c in b)d=b[c],(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)a[d]!=b[d]&&(c[d]=b[d]);return c}function k(b,c,d,e){typeof b=="object"&&(e=c,d=null,c=b,b=c.effect),a.isFunction(c)&&(e=c,d=null,c={});if(typeof c=="number"||a.fx.speeds[c])e=d,d=c,c={};return 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,[b,c,d,e]}function l(b){return!b||typeof b=="number"||a.fx.speeds[b]?!0:typeof b=="string"&&!a.effects[b]?!0:!1}a.effects={},a.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(b,e){a.fx.step[e]=function(a){a.colorInit||(a.start=d(a.elem,e),a.end=c(a.end),a.colorInit=!0),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]},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){return a.isFunction(d)&&(e=d,d=null),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){b[c]&&g[c+"Class"](b[c])}),m=i(h.call(this)),g.attr("class",n),g.animate(j(l,m),{queue:!1,duration:c,easing:d,complete:function(){a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),typeof g.attr("style")=="object"?(g.attr("style").cssText="",g.attr("style").cssText=k):g.attr("style",k),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){return typeof d=="boolean"||d===b?e?a.effects.animateClass.apply(this,[d?{add:c}:{remove:c},e,f,g]):this._toggleClass(c,d):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.16",save:function(a,b){for(var c=0;c<b.length;c++)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++)b[c]!==null&&a.css(b[c],a.data("ec.storage."+b[c]))},setMode:function(a,b){return b=="toggle"&&(b=a.is(":hidden")?"show":"hide"),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(!0),height:b.outerHeight(!0),"float":b.css("float")},d=a("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e=document.activeElement;return b.wrap(d),(b[0]===e||a.contains(b[0],e))&&a(e).focus(),d=b.parent(),b.css("position")=="static"?(d.css({position:"relative"}),b.css({position:"relative"})):(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),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),d.css(c).show()},removeWrapper:function(b){var c,d=document.activeElement;return b.parent().is(".ui-effects-wrapper")?(c=b.parent().replaceWith(b),(b[0]===d||a.contains(b[0],d))&&a(d).focus(),c):b},setTransition:function(b,c,d,e){return e=e||{},a.each(c,function(a,c){unit=b.cssUnit(c),unit[0]>0&&(e[c]=unit[0]*d+unit[1])}),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];return a.fx.off||!i?h?this[h](g.duration,g.callback):this.each(function(){g.callback&&g.callback.call(this)}):i.call(this,g)},_show:a.fn.show,show:function(a){if(l(a))return this._show.apply(this,arguments);var b=k.apply(this,arguments);return b[1].mode="show",this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(l(a))return this._hide.apply(this,arguments);var b=k.apply(this,arguments);return b[1].mode="hide",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);var c=k.apply(this,arguments);return c[1].mode="toggle",this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];return a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])}),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){return(b/=e/2)<1?d/2*b*b+c:-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){return(b/=e/2)<1?d/2*b*b*b+c: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){return(b/=e/2)<1?d/2*b*b*b*b+c:-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){return(b/=e/2)<1?d/2*b*b*b*b*b+c: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){return b==0?c:b==e?c+d:(b/=e/2)<1?d/2*Math.pow(2,10*(b-1))+c: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){return(b/=e/2)<1?-d/2*(Math.sqrt(1-b*b)-1)+c:d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;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,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;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,g=0,h=d;if(b==0)return c;if((b/=e/2)==2)return c+d;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);return b<1?-0.5*h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)+c: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){return g==b&&(g=1.70158),e*(c/=f)*c*((g+1)*c-g)+d},easeOutBack:function(a,c,d,e,f,g){return g==b&&(g=1.70158),e*((c=c/f-1)*c*((g+1)*c+g)+1)+d},easeInOutBack:function(a,c,d,e,f,g){return g==b&&(g=1.70158),(c/=f/2)<1?e/2*c*c*(((g*=1.525)+1)*c-g)+d: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){return(b/=e)<1/2.75?d*7.5625*b*b+c:b<2/2.75?d*(7.5625*(b-=1.5/2.75)*b+.75)+c:b<2.5/2.75?d*(7.5625*(b-=2.25/2.75)*b+.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+.984375)+c},easeInOutBounce:function(b,c,d,e,f){return c<f/2?a.easing.easeInBounce(b,c*2,0,e,f)*.5+d: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"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"vertical";a.effects.save(c,d),c.show();var g=a.effects.createWrapper(c).css({overflow:"hidden"}),h=f=="vertical"?"height":"width",i=f=="vertical"?g.height():g.width();e=="show"&&g.css(h,0);var j={};j[h]=e=="show"?i:0,g.animate(j,b.duration,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),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"],e=a.effects.setMode(c,b.options.mode||"effect"),f=b.options.direction||"up",g=b.options.distance||20,h=b.options.times||5,i=b.duration||250;/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",k=f=="up"||f=="left"?"pos":"neg",g=b.options.distance||(j=="top"?c.outerHeight({margin:!0})/3:c.outerWidth({margin:!0})/3);e=="show"&&c.css("opacity",0).css(j,k=="pos"?-g:g),e=="hide"&&(g/=h*2),e!="hide"&&h--;if(e=="show"){var l={opacity:1};l[j]=(k=="pos"?"+=":"-=")+g,c.animate(l,i/2,b.options.easing),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),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),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"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"vertical";a.effects.save(c,d),c.show();var g=a.effects.createWrapper(c).css({overflow:"hidden"}),h=c[0].tagName=="IMG"?g:c,i={size:f=="vertical"?"height":"width",position:f=="vertical"?"top":"left"},j=f=="vertical"?h.height():h.width();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:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),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"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"left";a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var g=f=="up"||f=="down"?"top":"left",h=f=="up"||f=="left"?"pos":"neg",i=b.options.distance||(g=="top"?c.outerHeight({margin:!0})/2:c.outerWidth({margin:!0})/2);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:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),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,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"),f=e.offset();f.top-=parseInt(e.css("marginTop"),10)||0,f.left-=parseInt(e.css("marginLeft"),10)||0;var g=e.outerWidth(!0),h=e.outerHeight(!0);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(),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:!1,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"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.size||15,g=!!b.options.horizFirst,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"}),j=e=="show"!=g,k=j?["width","height"]:["height","width"],l=j?[i.width(),i.height()]:[i.height(),i.width()],m=/([0-9]+)%/.exec(f);m&&(f=parseInt(m[1],10)/100*l[e=="hide"?0:1]),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(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),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")};e=="hide"&&(f.opacity=0),a.effects.save(c,d),c.show().css({backgroundImage:"none",backgroundColor:b.options.color||"#ffff99"}).animate(f,{queue:!1,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,isVisible||(c.css("opacity",0).show(),animateTo=1),(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(){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:!0,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),d=a.extend(!0,{},b.options),e=a.effects.setMode(c,b.options.mode||"effect"),f=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:e=="hide"?0:100),g=b.options.direction||"both",h=b.options.origin;e!="effect"&&(d.origin=h||["middle","center"],d.restore=!0);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},b.options.fade&&(e=="show"&&(c.from.opacity=0,c.to.opacity=1),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"],e=["position","top","bottom","left","right","overflow","opacity"],f=["width","height","overflow"],g=["fontSize"],h=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],j=a.effects.setMode(c,b.options.mode||"effect"),k=b.options.restore||!1,l=b.options.scale||"both",m=b.options.origin,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")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)),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));(l=="content"||l=="both")&&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),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},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)),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(){k&&a.effects.restore(child,f)})});c.animate(c.to,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){c.to.opacity===0&&c.css("opacity",c.from.opacity),j=="hide"&&c.hide(),a.effects.restore(c,k?d:e),a.effects.removeWrapper(c),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"],e=a.effects.setMode(c,b.options.mode||"effect"),f=b.options.direction||"left",g=b.options.distance||20,h=b.options.times||3,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",k=f=="up"||f=="left"?"pos":"neg",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),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"],e=a.effects.setMode(c,b.options.mode||"show"),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",h=f=="up"||f=="left"?"pos":"neg",i=b.options.distance||(g=="top"?c.outerHeight({margin:!0}):c.outerWidth({margin:!0}));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:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),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),function(a,b){var c;a.rails=c={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote], a[data-disable-with]",inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form",formInputClickSelector:"form input[type=submit], form input[type=image], form button[type=submit], form button:not(button[type])",disableSelector:"input[data-disable-with], button[data-disable-with], textarea[data-disable-with]",enableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled",requiredInputSelector:"input[name][required]:not([disabled]),textarea[name][required]:not([disabled])",fileInputSelector:"input:file",linkDisableSelector:"a[data-disable-with]",CSRFProtection:function(b){var c=a('meta[name="csrf-token"]').attr("content");c&&b.setRequestHeader("X-CSRF-Token",c)},fire:function(b,c,d){var e=a.Event(c);return b.trigger(e,d),e.result!==!1},confirm:function(a){return confirm(a)},ajax:function(b){return a.ajax(b)},handleRemote:function(d){var e,f,g,h=d.data("cross-domain")||null,i=d.data("type")||a.ajaxSettings&&a.ajaxSettings.dataType,j;if(c.fire(d,"ajax:before")){if(d.is("form")){e=d.attr("method"),f=d.attr("action"),g=d.serializeArray();var k=d.data("ujs:submit-button");k&&(g.push(k),d.data("ujs:submit-button",null))}else d.is(c.inputChangeSelector)?(e=d.data("method"),f=d.data("url"),g=d.serialize(),d.data("params")&&(g=g+"&"+d.data("params"))):(e=d.data("method"),f=d.attr("href"),g=d.data("params")||null);return j={type:e||"GET",data:g,dataType:i,crossDomain:h,beforeSend:function(a,e){return e.dataType===b&&a.setRequestHeader("accept","*/*;q=0.5, "+e.accepts.script),c.fire(d,"ajax:beforeSend",[a,e])},success:function(a,b,c){d.trigger("ajax:success",[a,b,c])},complete:function(a,b){d.trigger("ajax:complete",[a,b])},error:function(a,b,c){d.trigger("ajax:error",[a,b,c])}},f&&(j.url=f),c.ajax(j)}return!1},handleMethod:function(c){var d=c.attr("href"),e=c.data("method"),f=c.attr("target"),g=a("meta[name=csrf-token]").attr("content"),h=a("meta[name=csrf-param]").attr("content"),i=a('<form method="post" action="'+d+'"></form>'),j='<input name="_method" value="'+e+'" type="hidden" />';h!==b&&g!==b&&(j+='<input name="'+h+'" value="'+g+'" type="hidden" />'),f&&i.attr("target",f),i.hide().append(j).appendTo("body"),i.submit()},disableFormElements:function(b){b.find(c.disableSelector).each(function(){var b=a(this),c=b.is("button")?"html":"val";b.data("ujs:enable-with",b[c]()),b[c](b.data("disable-with")),b.prop("disabled",!0)})},enableFormElements:function(b){b.find(c.enableSelector).each(function(){var b=a(this),c=b.is("button")?"html":"val";b.data("ujs:enable-with")&&b[c](b.data("ujs:enable-with")),b.prop("disabled",!1)})},allowAction:function(a){var b=a.data("confirm"),d=!1,e;return b?(c.fire(a,"confirm")&&(d=c.confirm(b),e=c.fire(a,"confirm:complete",[d])),d&&e):!0},blankInputs:function(b,c,d){var e=a(),f,g=c||"input,textarea";return b.find(g).each(function(){f=a(this);if(d?f.val():!f.val())e=e.add(f)}),e.length?e:!1},nonBlankInputs:function(a,b){return c.blankInputs(a,b,!0)},stopEverything:function(b){return a(b.target).trigger("ujs:everythingStopped"),b.stopImmediatePropagation(),!1},callFormSubmitBindings:function(c,d){var e=c.data("events"),f=!0;return e!==b&&e.submit!==b&&a.each(e.submit,function(a,b){if(typeof b.handler=="function")return f=b.handler(d)}),f},disableElement:function(a){a.data("ujs:enable-with",a.html()),a.html(a.data("disable-with")),a.bind("click.railsDisable",function(a){return c.stopEverything(a)})},enableElement:function(a){a.data("ujs:enable-with")!==b&&(a.html(a.data("ujs:enable-with")),a.data("ujs:enable-with",!1)),a.unbind("click.railsDisable")}},a.ajaxPrefilter(function(a,b,d){a.crossDomain||c.CSRFProtection(d)}),a(document).delegate(c.linkDisableSelector,"ajax:complete",function(){c.enableElement(a(this))}),a(document).delegate(c.linkClickSelector,"click.rails",function(d){var e=a(this),f=e.data("method"),g=e.data("params");if(!c.allowAction(e))return c.stopEverything(d);e.is(c.linkDisableSelector)&&c.disableElement(e);if(e.data("remote")!==b)return(d.metaKey||d.ctrlKey)&&(!f||f==="GET")&&!g?!0:(c.handleRemote(e)===!1&&c.enableElement(e),!1);if(e.data("method"))return c.handleMethod(e),!1}),a(document).delegate(c.inputChangeSelector,"change.rails",function(b){var d=a(this);return c.allowAction(d)?(c.handleRemote(d),!1):c.stopEverything(b)}),a(document).delegate(c.formSubmitSelector,"submit.rails",function(d){var e=a(this),f=e.data("remote")!==b,g=c.blankInputs(e,c.requiredInputSelector),h=c.nonBlankInputs(e,c.fileInputSelector);if(!c.allowAction(e))return c.stopEverything(d);if(g&&e.attr("novalidate")==b&&c.fire(e,"ajax:aborted:required",[g]))return c.stopEverything(d);if(f)return h?c.fire(e,"ajax:aborted:file",[h]):!a.support.submitBubbles&&a().jquery<"1.7"&&c.callFormSubmitBindings(e,d)===!1?c.stopEverything(d):(c.handleRemote(e),!1);setTimeout(function(){c.disableFormElements(e)},13)}),a(document).delegate(c.formInputClickSelector,"click.rails",function(b){var d=a(this);if(!c.allowAction(d))return c.stopEverything(b);var e=d.attr("name"),f=e?{name:e,value:d.val()}:null;d.closest("form").data("ujs:submit-button",f)}),a(document).delegate(c.formSubmitSelector,"ajax:beforeSend.rails",function(b){this==b.target&&c.disableFormElements(a(this))}),a(document).delegate(c.formSubmitSelector,"ajax:complete.rails",function(b){this==b.target&&c.enableFormElements(a(this))})}(jQuery),function(){function A(a,b,c){if(a===b)return a!==0||1/a==1/b;if(a==null||b==null)return a===b;a._chain&&(a=a._wrapped),b._chain&&(b=b._wrapped);if(a.isEqual&&w.isFunction(a.isEqual))return a.isEqual(b);if(b.isEqual&&w.isFunction(b.isEqual))return b.isEqual(a);var d=i.call(a);if(d!=i.call(b))return!1;switch(d){case"[object String]":return a==String(b);case"[object Number]":return a!=+a?b!=+b:a==0?1/a==1/b:a==+b;case"[object Date]":case"[object Boolean]":return+a==+b;case"[object RegExp]":return a.source==b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase}if(typeof a!="object"||typeof b!="object")return!1;var e=c.length;while(e--)if(c[e]==a)return!0;c.push(a);var f=0,g=!0;if(d=="[object Array]"){f=a.length,g=f==b.length;if(g)while(f--)if(!(g=f in a==f in b&&A(a[f],b[f],c)))break}else{if("constructor"in a!="constructor"in b||a.constructor!=b.constructor)return!1;for(var h in a)if(w.has(a,h)){f++;if(!(g=w.has(b,h)&&A(a[h],b[h],c)))break}if(g){for(h in b)if(w.has(b,h)&&!(f--))break;g=!f}}return c.pop(),g}var a=this,b=a._,c={},d=Array.prototype,e=Object.prototype,f=Function.prototype,g=d.slice,h=d.unshift,i=e.toString,j=e.hasOwnProperty,k=d.forEach,l=d.map,m=d.reduce,n=d.reduceRight,o=d.filter,p=d.every,q=d.some,r=d.indexOf,s=d.lastIndexOf,t=Array.isArray,u=Object.keys,v=f.bind,w=function(a){return new E(a)};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=w),exports._=w):a._=w,w.VERSION="1.3.1";var x=w.each=w.forEach=function(a,b,d){if(a==null)return;if(k&&a.forEach===k)a.forEach(b,d);else if(a.length===+a.length){for(var e=0,f=a.length;e<f;e++)if(e in a&&b.call(d,a[e],e,a)===c)return}else for(var g in a)if(w.has(a,g)&&b.call(d,a[g],g,a)===c)return};w.map=w.collect=function(a,b,c){var d=[];return a==null?d:l&&a.map===l?a.map(b,c):(x(a,function(a,e,f){d[d.length]=b.call(c,a,e,f)}),a.length===+a.length&&(d.length=a.length),d)},w.reduce=w.foldl=w.inject=function(a,b,c,d){var e=arguments.length>2;a==null&&(a=[]);if(m&&a.reduce===m)return d&&(b=w.bind(b,d)),e?a.reduce(b,c):a.reduce(b);x(a,function(a,f,g){e?c=b.call(d,c,a,f,g):(c=a,e=!0)});if(!e)throw new TypeError("Reduce of empty array with no initial value");return c},w.reduceRight=w.foldr=function(a,b,c,d){var e=arguments.length>2;a==null&&(a=[]);if(n&&a.reduceRight===n)return d&&(b=w.bind(b,d)),e?a.reduceRight(b,c):a.reduceRight(b);var f=w.toArray(a).reverse();return d&&!e&&(b=w.bind(b,d)),e?w.reduce(f,b,c,d):w.reduce(f,b)},w.find=w.detect=function(a,b,c){var d;return y(a,function(a,e,f){if(b.call(c,a,e,f))return d=a,!0}),d},w.filter=w.select=function(a,b,c){var d=[];return a==null?d:o&&a.filter===o?a.filter(b,c):(x(a,function(a,e,f){b.call(c,a,e,f)&&(d[d.length]=a)}),d)},w.reject=function(a,b,c){var d=[];return a==null?d:(x(a,function(a,e,f){b.call(c,a,e,f)||(d[d.length]=a)}),d)},w.every=w.all=function(a,b,d){var e=!0;return a==null?e:p&&a.every===p?a.every(b,d):(x(a,function(a,f,g){if(!(e=e&&b.call(d,a,f,g)))return c}),e)};var y=w.some=w.any=function(a,b,d){b||(b=w.identity);var e=!1;return a==null?e:q&&a.some===q?a.some(b,d):(x(a,function(a,f,g){if(e||(e=b.call(d,a,f,g)))return c}),!!e)};w.include=w.contains=function(a,b){var c=!1;return a==null?c:r&&a.indexOf===r?a.indexOf(b)!=-1:(c=y(a,function(a){return a===b}),c)},w.invoke=function(a,b){var c=g.call(arguments,2);return w.map(a,function(a){return(w.isFunction(b)?b||a:a[b]).apply(a,c)})},w.pluck=function(a,b){return w.map(a,function(a){return a[b]})},w.max=function(a,b,c){if(!b&&w.isArray(a))return Math.max.apply(Math,a);if(!b&&w.isEmpty(a))return-Infinity;var d={computed:-Infinity};return x(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g>=d.computed&&(d={value:a,computed:g})}),d.value},w.min=function(a,b,c){if(!b&&w.isArray(a))return Math.min.apply(Math,a);if(!b&&w.isEmpty(a))return Infinity;var d={computed:Infinity};return x(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g<d.computed&&(d={value:a,computed:g})}),d.value},w.shuffle=function(a){var b=[],c;return x(a,function(a,d,e){d==0?b[0]=a:(c=Math.floor(Math.random()*(d+1)),b[d]=b[c],b[c]=a)}),b},w.sortBy=function(a,b,c){return w.pluck(w.map(a,function(a,d,e){return{value:a,criteria:b.call(c,a,d,e)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;return c<d?-1:c>d?1:0}),"value")},w.groupBy=function(a,b){var c={},d=w.isFunction(b)?b:function(a){return a[b]};return x(a,function(a,b){var e=d(a,b);(c[e]||(c[e]=[])).push(a)}),c},w.sortedIndex=function(a,b,c){c||(c=w.identity);var d=0,e=a.length;while(d<e){var f=d+e>>1;c(a[f])<c(b)?d=f+1:e=f}return d},w.toArray=function(a){return a?a.toArray?a.toArray():w.isArray(a)?g.call(a):w.isArguments(a)?g.call(a):w.values(a):[]},w.size=function(a){return w.toArray(a).length},w.first=w.head=function(a,b,c){return b!=null&&!c?g.call(a,0,b):a[0]},w.initial=function(a,b,c){return g.call(a,0,a.length-(b==null||c?1:b))},w.last=function(a,b,c){return b!=null&&!c?g.call(a,Math.max(a.length-b,0)):a[a.length-1]},w.rest=w.tail=function(a,b,c){return g.call(a,b==null||c?1:b)},w.compact=function(a){return w.filter(a,function(a){return!!a})},w.flatten=function(a,b){return w.reduce(a,function(a,c){return w.isArray(c)?a.concat(b?c:w.flatten(c)):(a[a.length]=c,a)},[])},w.without=function(a){return w.difference(a,g.call(arguments,1))},w.uniq=w.unique=function(a,b,c){var d=c?w.map(a,c):a,e=[];return w.reduce(d,function(c,d,f){if(0==f||(b===!0?w.last(c)!=d:!w.include(c,d)))c[c.length]=d,e[e.length]=a[f];return c},[]),e},w.union=function(){return w.uniq(w.flatten(arguments,!0))},w.intersection=w.intersect=function(a){var b=g.call(arguments,1);return w.filter(w.uniq(a),function(a){return w.every(b,function(b){return w.indexOf(b,a)>=0})})},w.difference=function(a){var b=w.flatten(g.call(arguments,1));return w.filter(a,function(a){return!w.include(b,a)})},w.zip=function(){var a=g.call(arguments),b=w.max(w.pluck(a,"length")),c=new Array(b);for(var d=0;d<b;d++)c[d]=w.pluck(a,""+d);return c},w.indexOf=function(a,b,c){if(a==null)return-1;var d,e;if(c)return d=w.sortedIndex(a,b),a[d]===b?d:-1;if(r&&a.indexOf===r)return a.indexOf(b);for(d=0,e=a.length;d<e;d++)if(d in a&&a[d]===b)return d;return-1},w.lastIndexOf=function(a,b){if(a==null)return-1;if(s&&a.lastIndexOf===s)return a.lastIndexOf(b);var c=a.length;while(c--)if(c in a&&a[c]===b)return c;return-1},w.range=function(a,b,c){arguments.length<=1&&(b=a||0,a=0),c=arguments[2]||1;var d=Math.max(Math.ceil((b-a)/c),0),e=0,f=new Array(d);while(e<d)f[e++]=a,a+=c;return f};var z=function(){};w.bind=function(b,c){var d,e;if(b.bind===v&&v)return v.apply(b,g.call(arguments,1));if(!w.isFunction(b))throw new TypeError;return e=g.call(arguments,2),d=function(){if(this instanceof d){z.prototype=b.prototype;var a=new z,f=b.apply(a,e.concat(g.call(arguments)));return Object(f)===f?f:a}return b.apply(c,e.concat(g.call(arguments)))}},w.bindAll=function(a){var b=g.call(arguments,1);return b.length==0&&(b=w.functions(a)),x(b,function(b){a[b]=w.bind(a[b],a)}),a},w.memoize=function(a,b){var c={};return b||(b=w.identity),function(){var d=b.apply(this,arguments);return w.has(c,d)?c[d]:c[d]=a.apply(this,arguments)}},w.delay=function(a,b){var c=g.call(arguments,2);return setTimeout(function(){return a.apply(a,c)},b)},w.defer=function(a){return w.delay.apply(w,[a,1].concat(g.call(arguments,1)))},w.throttle=function(a,b){var c,d,e,f,g,h=w.debounce(function(){g=f=!1},b);return function(){c=this,d=arguments;var i=function(){e=null,g&&a.apply(c,d),h()};e||(e=setTimeout(i,b)),f?g=!0:a.apply(c,d),h(),f=!0}},w.debounce=function(a,b){var c;return function(){var d=this,e=arguments,f=function(){c=null,a.apply(d,e)};clearTimeout(c),c=setTimeout(f,b)}},w.once=function(a){var b=!1,c;return function(){return b?c:(b=!0,c=a.apply(this,arguments))}},w.wrap=function(a,b){return function(){var c=[a].concat(g.call(arguments,0));return b.apply(this,c)}},w.compose=function(){var a=arguments;return function(){var b=arguments;for(var c=a.length-1;c>=0;c--)b=[a[c].apply(this,b)];return b[0]}},w.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}},w.keys=u||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[];for(var c in a)w.has(a,c)&&(b[b.length]=c);return b},w.values=function(a){return w.map(a,w.identity)},w.functions=w.methods=function(a){var b=[];for(var c in a)w.isFunction(a[c])&&b.push(c);return b.sort()},w.extend=function(a){return x(g.call(arguments,1),function(b){for(var c in b)a[c]=b[c]}),a},w.defaults=function(a){return x(g.call(arguments,1),function(b){for(var c in b)a[c]==null&&(a[c]=b[c])}),a},w.clone=function(a){return w.isObject(a)?w.isArray(a)?a.slice():w.extend({},a):a},w.tap=function(a,b){return b(a),a},w.isEqual=function(a,b){return A(a,b,[])},w.isEmpty=function(a){if(w.isArray(a)||w.isString(a))return a.length===0;for(var b in a)if(w.has(a,b))return!1;return!0},w.isElement=function(a){return!!a&&a.nodeType==1},w.isArray=t||function(a){return i.call(a)=="[object Array]"},w.isObject=function(a){return a===Object(a)},w.isArguments=function(a){return i.call(a)=="[object Arguments]"},w.isArguments(arguments)||(w.isArguments=function(a){return!!a&&!!w.has(a,"callee")}),w.isFunction=function(a){return i.call(a)=="[object Function]"},w.isString=function(a){return i.call(a)=="[object String]"},w.isNumber=function(a){return i.call(a)=="[object Number]"},w.isNaN=function(a){return a!==a},w.isBoolean=function(a){return a===!0||a===!1||i.call(a)=="[object Boolean]"},w.isDate=function(a){return i.call(a)=="[object Date]"},w.isRegExp=function(a){return i.call(a)=="[object RegExp]"},w.isNull=function(a){return a===null},w.isUndefined=function(a){return a===void 0},w.has=function(a,b){return j.call(a,b)},w.noConflict=function(){return a._=b,this},w.identity=function(a){return a},w.times=function(a,b,c){for(var d=0;d<a;d++)b.call(c,d)},w.escape=function(a){return(""+a).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")},w.mixin=function(a){x(w.functions(a),function(b){G(b,w[b]=a[b])})};var B=0;w.uniqueId=function(a){var b=B++;return a?a+b:b},w.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var C=/.^/,D=function(a){return a.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};w.template=function(a,b){var c=w.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(c.escape||C,function(a,b){return"',_.escape("+D(b)+"),'"}).replace(c.interpolate||C,function(a,b){return"',"+D(b)+",'"}).replace(c.evaluate||C,function(a,b){return"');"+D(b).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return b?e(b,w):function(a){return e.call(this,a,w)}},w.chain=function(a){return w(a).chain()};var E=function(a){this._wrapped=a};w.prototype=E.prototype;var F=function(a,b){return b?w(a).chain():a},G=function(a,b){E.prototype[a]=function(){var a=g.call(arguments);return h.call(a,this._wrapped),F(b.apply(w,a),this._chain)}};w.mixin(w),x(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=d[a];E.prototype[a]=function(){var c=this._wrapped;b.apply(c,arguments);var d=c.length;return(a=="shift"||a=="splice")&&d===0&&delete c[0],F(c,this._chain)}}),x(["concat","join","slice"],function(a){var b=d[a];E.prototype[a]=function(){return F(b.apply(this._wrapped,arguments),this._chain)}}),E.prototype.chain=function(){return this._chain=!0,this},E.prototype.value=function(){return this._wrapped}}.call(this),function(){var a=this,b=a.Backbone,c=Array.prototype.slice,d=Array.prototype.splice,e;typeof exports!="undefined"?e=exports:e=a.Backbone={},e.VERSION="0.9.1";var f=a._;!f&&typeof require!="undefined"&&(f=require("underscore"));var g=a.jQuery||a.Zepto||a.ender;e.setDomLibrary=function(a){g=a},e.noConflict=function(){return a.Backbone=b,this},e.emulateHTTP=!1,e.emulateJSON=!1,e.Events={on:function(a,b,c){var d;a=a.split(/\s+/);var e=this._callbacks||(this._callbacks={});while(d=a.shift()){var f=e[d]||(e[d]={}),g=f.tail||(f.tail=f.next={});g.callback=b,g.context=c,f.tail=g.next={}}return this},off:function(a,b,c){var d,e,f;if(!a)delete this._callbacks;else if(e=this._callbacks){a=a.split(/\s+/);while(d=a.shift()){f=e[d],delete e[d];if(!b||!f)continue;while((f=f.next)&&f.next){if(f.callback===b&&(!c||f.context===c))continue;this.on(d,f.callback,f.context)}}}return this},trigger:function(a){var b,d,e,f,g,h,i;if(!(e=this._callbacks))return this;h=e.all,(a=a.split(/\s+/)).push(null);while(b=a.shift()){h&&a.push({next:h.next,tail:h.tail,event:b});if(!(d=e[b]))continue;a.push({next:d.next,tail:d.tail})}i=c.call(arguments,1);while(d=a.pop()){f=d.tail,g=d.event?[d.event].concat(i):i;while((d=d.next)!==f)d.callback.apply(d.context||this,g)}return this}},e.Events.bind=e.Events.on,e.Events.unbind=e.Events.off,e.Model=function(a,b){var c;a||(a={}),b&&b.parse&&(a=this.parse(a));if(c=u(this,"defaults"))a=f.extend({},c,a);b&&b.collection&&(this.collection=b.collection),this.attributes={},this._escapedAttributes={},this.cid=f.uniqueId("c");if(!this.set(a,{silent:!0}))throw new Error("Can't create an invalid model");delete this._changed,this._previousAttributes=f.clone(this.attributes),this.initialize.apply(this,arguments)},f.extend(e.Model.prototype,e.Events,{idAttribute:"id",initialize:function(){},toJSON:function(){return f.clone(this.attributes)},get:function(a){return this.attributes[a]},escape:function(a){var b;if(b=this._escapedAttributes[a])return b;var c=this.attributes[a];return this._escapedAttributes[a]=f.escape(c==null?"":""+c)},has:function(a){return this.attributes[a]!=null},set:function(a,b,c){var d,g,h;f.isObject(a)||a==null?(d=a,c=b):(d={},d[a]=b),c||(c={});if(!d)return this;d instanceof e.Model&&(d=d.attributes);if(c.unset)for(g in d)d[g]=void 0;if(!this._validate(d,c))return!1;this.idAttribute in d&&(this.id=d[this.idAttribute]);var i=this.attributes,j=this._escapedAttributes,k=this._previousAttributes||{},l=this._setting;this._changed||(this._changed={}),this._setting=!0;for(g in d){h=d[g],f.isEqual(i[g],h)||delete j[g],c.unset?delete i[g]:i[g]=h,this._changing&&!f.isEqual(this._changed[g],h)&&(this.trigger("change:"+g,this,h,c),this._moreChanges=!0),delete this._changed[g];if(!f.isEqual(k[g],h)||f.has(i,g)!=f.has(k,g))this._changed[g]=h}return l||(!c.silent&&this.hasChanged()&&this.change(c),this._setting=!1),this},unset:function(a,b){return(b||(b={})).unset=!0,this.set(a,null,b)},clear:function(a){return(a||(a={})).unset=!0,this.set(f.clone(this.attributes),a)},fetch:function(a){a=a?f.clone(a):{};var b=this,c=a.success;return a.success=function(d,e,f){if(!b.set(b.parse(d,f),a))return!1;c&&c(b,d)},a.error=e.wrapError(a.error,b,a),(this.sync||e.sync).call(this,"read",this,a)},save:function(a,b,c){var d,g;f.isObject(a)||a==null?(d=a,c=b):(d={},d[a]=b),c=c?f.clone(c):{},c.wait&&(g=f.clone(this.attributes));var h=f.extend({},c,{silent:!0});if(d&&!this.set(d,c.wait?h:c))return!1;var i=this,j=c.success;c.success=function(a,b,e){var g=i.parse(a,e);c.wait&&(g=f.extend(d||{},g));if(!i.set(g,c))return!1;j?j(i,a):i.trigger("sync",i,a,c)},c.error=e.wrapError(c.error,i,c);var k=this.isNew()?"create":"update",l=(this.sync||e.sync).call(this,k,this,c);return c.wait&&this.set(g,h),l},destroy:function(a){a=a?f.clone(a):{};var b=this,c=a.success,d=function(){b.trigger("destroy",b,b.collection,a)};if(this.isNew())return d();a.success=function(e){a.wait&&d(),c?c(b,e):b.trigger("sync",b,e,a)},a.error=e.wrapError(a.error,b,a);var g=(this.sync||e.sync).call(this,"delete",this,a);return a.wait||d(),g},url:function(){var a=u(this.collection,"url")||u(this,"urlRoot")||v();return this.isNew()?a:a+(a.charAt(a.length-1)=="/"?"":"/")+encodeURIComponent(this.id)},parse:function(a,b){return a},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return this.id==null},change:function(a){if(this._changing||!this.hasChanged())return this;this._changing=!0,this._moreChanges=!0;for(var b in this._changed)this.trigger("change:"+b,this,this._changed[b],a);while(this._moreChanges)this._moreChanges=!1,this.trigger("change",this,a);return this._previousAttributes=f.clone(this.attributes),delete this._changed,this._changing=!1,this},hasChanged:function(a){return arguments.length?this._changed&&f.has(this._changed,a):!f.isEmpty(this._changed)},changedAttributes:function(a){if(!a)return this.hasChanged()?f.clone(this._changed):!1;var b,c=!1,d=this._previousAttributes;for(var e in a){if(f.isEqual(d[e],b=a[e]))continue;(c||(c={}))[e]=b}return c},previous:function(a){return!arguments.length||!this._previousAttributes?null:this._previousAttributes[a]},previousAttributes:function(){return f.clone(this._previousAttributes)},isValid:function(){return!this.validate(this.attributes)},_validate:function(a,b){if(b.silent||!this.validate)return!0;a=f.extend({},this.attributes,a);var c=this.validate(a,b);return c?(b&&b.error?b.error(this,c,b):this.trigger("error",this,c,b),!1):!0}}),e.Collection=function(a,b){b||(b={}),b.comparator&&(this.comparator=b.comparator),this._reset(),this.initialize.apply(this,arguments),a&&this.reset(a,{silent:!0,parse:b.parse})},f.extend(e.Collection.prototype,e.Events,{model:e.Model,initialize:function(){},toJSON:function(){return this.map(function(a){return a.toJSON()})},add:function(a,b){var c,e,g,h,i,j,k={},l={};b||(b={}),a=f.isArray(a)?a.slice():[a];for(c=0,g=a.length;c<g;c++){if(!(h=a[c]=this._prepareModel(a[c],b)))throw new Error("Can't add an invalid model to a collection");if(k[i=h.cid]||this._byCid[i]||(j=h.id)!=null&&(l[j]||this._byId[j]))throw new Error("Can't add the same model to a collection twice");k[i]=l[j]=h}for(c=0;c<g;c++)(h=a[c]).on("all",this._onModelEvent,this),this._byCid[h.cid]=h,h.id!=null&&(this._byId[h.id]=h);this.length+=g,e=b.at!=null?b.at:this.models.length,d.apply(this.models,[e,0].concat(a)),this.comparator&&this.sort({silent:!0});if(b.silent)return this;for(c=0,g=this.models.length;c<g;c++){if(!k[(h=this.models[c]).cid])continue;b.index=c,h.trigger("add",h,this,b)}return this},remove:function(a,b){var c,d,e,g;b||(b={}),a=f.isArray(a)?a.slice():[a];for(c=0,d=a.length;c<d;c++){g=this.getByCid(a[c])||this.get(a[c]);if(!g)continue;delete this._byId[g.id],delete this._byCid[g.cid],e=this.indexOf(g),this.models.splice(e,1),this.length--,b.silent||(b.index=e,g.trigger("remove",g,this,b)),this._removeReference(g)}return this},get:function(a){return a==null?null:this._byId[a.id!=null?a.id:a]},getByCid:function(a){return a&&this._byCid[a.cid||a]},at:function(a){return this.models[a]},sort:function(a){a||(a={});if(!this.comparator)throw new Error("Cannot sort a set without a comparator");var b=f.bind(this.comparator,this);return this.comparator.length==1?this.models=this.sortBy(b):this.models.sort(b),a.silent||this.trigger("reset",this,a),this},pluck:function(a){return f.map(this.models,function(b){return b.get(a)})},reset:function(a,b){a||(a=[]),b||(b={});for(var c=0,d=this.models.length;c<d;c++)this._removeReference(this.models[c]);return this._reset(),this.add(a,{silent:!0,parse:b.parse}),b.silent||this.trigger("reset",this,b),this},fetch:function(a){a=a?f.clone(a):{},a.parse===undefined&&(a.parse=!0);var b=this,c=a.success;return a.success=function(d,e,f){b[a.add?"add":"reset"](b.parse(d,f),a),c&&c(b,d)},a.error=e.wrapError(a.error,b,a),(this.sync||e.sync).call(this,"read",this,a)},create:function(a,b){var c=this;b=b?f.clone(b):{},a=this._prepareModel(a,b);if(!a)return!1;b.wait||c.add(a,b);var d=b.success;return b.success=function(e,f,g){b.wait&&c.add(e,b),d?d(e,f):e.trigger("sync",a,f,b)},a.save(null,b),a},parse:function(a,b){return a},chain:function(){return f(this.models).chain()},_reset:function(a){this.length=0,this.models=[],this._byId={},this._byCid={}},_prepareModel:function(a,b){if(a instanceof e.Model)a.collection||(a.collection=this);else{var c=a;b.collection=this,a=new this.model(c,b),a._validate(a.attributes,b)||(a=!1)}return a},_removeReference:function(a){this==a.collection&&delete a.collection,a.off("all",this._onModelEvent,this)},_onModelEvent:function(a,b,c,d){if((a=="add"||a=="remove")&&c!=this)return;a=="destroy"&&this.remove(b,d),b&&a==="change:"+b.idAttribute&&(delete this._byId[b.previous(b.idAttribute)],this._byId[b.id]=b),this.trigger.apply(this,arguments)}});var h=["forEach","each","map","reduce","reduceRight","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","sortBy","sortedIndex","toArray","size","first","initial","rest","last","without","indexOf","shuffle","lastIndexOf","isEmpty","groupBy"];f.each(h,function(a){e.Collection.prototype[a]=function(){return f[a].apply(f,[this.models].concat(f.toArray(arguments)))}}),e.Router=function(a){a||(a={}),a.routes&&(this.routes=a.routes),this._bindRoutes(),this.initialize.apply(this,arguments)};var i=/:\w+/g,j=/\*\w+/g,k=/[-[\]{}()+?.,\\^$|#\s]/g;f.extend(e.Router.prototype,e.Events,{initialize:function(){},route:function(a,b,c){return e.history||(e.history=new e.History),f.isRegExp(a)||(a=this._routeToRegExp(a)),c||(c=this[b]),e.history.route(a,f.bind(function(d){var f=this._extractParameters(a,d);c&&c.apply(this,f),this.trigger.apply(this,["route:"+b].concat(f)),e.history.trigger("route",this,b,f)},this)),this},navigate:function(a,b){e.history.navigate(a,b)},_bindRoutes:function(){if(!this.routes)return;var a=[];for(var b in this.routes)a.unshift([b,this.routes[b]]);for(var c=0,d=a.length;c<d;c++)this.route(a[c][0],a[c][1],this[a[c][1]])},_routeToRegExp:function(a){return a=a.replace(k,"\\$&").replace(i,"([^/]+)").replace(j,"(.*?)"),new RegExp("^"+a+"$")},_extractParameters:function(a,b){return a.exec(b).slice(1)}}),e.History=function(){this.handlers=[],f.bindAll(this,"checkUrl")};var l=/^[#\/]/,m=/msie [\w.]+/,n=!1;f.extend(e.History.prototype,e.Events,{interval:50,getFragment:function(a,b){if(a==null)if(this._hasPushState||b){a=window.location.pathname;var c=window.location.search;c&&(a+=c)}else a=window.location.hash;return a=decodeURIComponent(a),a.indexOf(this.options.root)||(a=a.substr(this.options.root.length)),a.replace(l,"")},start:function(a){if(n)throw new Error("Backbone.history has already been started"
);this.options=f.extend({},{root:"/"},this.options,a),this._wantsHashChange=this.options.hashChange!==!1,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&window.history&&window.history.pushState);var b=this.getFragment(),c=document.documentMode,d=m.exec(navigator.userAgent.toLowerCase())&&(!c||c<=7);d&&(this.iframe=g('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(b)),this._hasPushState?g(window).bind("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!d?g(window).bind("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.fragment=b,n=!0;var e=window.location,h=e.pathname==this.options.root;if(this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!h)return this.fragment=this.getFragment(null,!0),window.location.replace(this.options.root+"#"+this.fragment),!0;this._wantsPushState&&this._hasPushState&&h&&e.hash&&(this.fragment=e.hash.replace(l,""),window.history.replaceState({},document.title,e.protocol+"//"+e.host+this.options.root+this.fragment));if(!this.options.silent)return this.loadUrl()},stop:function(){g(window).unbind("popstate",this.checkUrl).unbind("hashchange",this.checkUrl),clearInterval(this._checkUrlInterval),n=!1},route:function(a,b){this.handlers.unshift({route:a,callback:b})},checkUrl:function(a){var b=this.getFragment();b==this.fragment&&this.iframe&&(b=this.getFragment(this.iframe.location.hash));if(b==this.fragment||b==decodeURIComponent(this.fragment))return!1;this.iframe&&this.navigate(b),this.loadUrl()||this.loadUrl(window.location.hash)},loadUrl:function(a){var b=this.fragment=this.getFragment(a),c=f.any(this.handlers,function(a){if(a.route.test(b))return a.callback(b),!0});return c},navigate:function(a,b){if(!n)return!1;if(!b||b===!0)b={trigger:b};var c=(a||"").replace(l,"");if(this.fragment==c||this.fragment==decodeURIComponent(c))return;this._hasPushState?(c.indexOf(this.options.root)!=0&&(c=this.options.root+c),this.fragment=c,window.history[b.replace?"replaceState":"pushState"]({},document.title,c)):this._wantsHashChange?(this.fragment=c,this._updateHash(window.location,c,b.replace),this.iframe&&c!=this.getFragment(this.iframe.location.hash)&&(b.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,c,b.replace))):window.location.assign(this.options.root+a),b.trigger&&this.loadUrl(a)},_updateHash:function(a,b,c){c?a.replace(a.toString().replace(/(javascript:|#).*$/,"")+"#"+b):a.hash=b}}),e.View=function(a){this.cid=f.uniqueId("view"),this._configure(a||{}),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()};var o=/^(\S+)\s*(.*)$/,p=["model","collection","el","id","attributes","className","tagName"];f.extend(e.View.prototype,e.Events,{tagName:"div",$:function(a){return this.$el.find(a)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this},make:function(a,b,c){var d=document.createElement(a);return b&&g(d).attr(b),c&&g(d).html(c),d},setElement:function(a,b){return this.$el=g(a),this.el=this.$el[0],b!==!1&&this.delegateEvents(),this},delegateEvents:function(a){if(!a&&!(a=u(this,"events")))return;this.undelegateEvents();for(var b in a){var c=a[b];f.isFunction(c)||(c=this[a[b]]);if(!c)throw new Error('Event "'+a[b]+'" does not exist');var d=b.match(o),e=d[1],g=d[2];c=f.bind(c,this),e+=".delegateEvents"+this.cid,g===""?this.$el.bind(e,c):this.$el.delegate(g,e,c)}},undelegateEvents:function(){this.$el.unbind(".delegateEvents"+this.cid)},_configure:function(a){this.options&&(a=f.extend({},this.options,a));for(var b=0,c=p.length;b<c;b++){var d=p[b];a[d]&&(this[d]=a[d])}this.options=a},_ensureElement:function(){if(!this.el){var a=u(this,"attributes")||{};this.id&&(a.id=this.id),this.className&&(a["class"]=this.className),this.setElement(this.make(this.tagName,a),!1)}else this.setElement(this.el,!1)}});var q=function(a,b){var c=t(this,a,b);return c.extend=this.extend,c};e.Model.extend=e.Collection.extend=e.Router.extend=e.View.extend=q;var r={create:"POST",update:"PUT","delete":"DELETE",read:"GET"};e.sync=function(a,b,c){var d=r[a],h={type:d,dataType:"json"};return c.url||(h.url=u(b,"url")||v()),!c.data&&b&&(a=="create"||a=="update")&&(h.contentType="application/json",h.data=JSON.stringify(b.toJSON())),e.emulateJSON&&(h.contentType="application/x-www-form-urlencoded",h.data=h.data?{model:h.data}:{}),e.emulateHTTP&&(d==="PUT"||d==="DELETE")&&(e.emulateJSON&&(h.data._method=d),h.type="POST",h.beforeSend=function(a){a.setRequestHeader("X-HTTP-Method-Override",d)}),h.type!=="GET"&&!e.emulateJSON&&(h.processData=!1),g.ajax(f.extend(h,c))},e.wrapError=function(a,b,c){return function(d,e){e=d===b?e:d,a?a(b,e,c):b.trigger("error",b,e,c)}};var s=function(){},t=function(a,b,c){var d;return b&&b.hasOwnProperty("constructor")?d=b.constructor:d=function(){a.apply(this,arguments)},f.extend(d,a),s.prototype=a.prototype,d.prototype=new s,b&&f.extend(d.prototype,b),c&&f.extend(d,c),d.prototype.constructor=d,d.__super__=a.prototype,d},u=function(a,b){return!a||!a[b]?null:f.isFunction(a[b])?a[b]():a[b]},v=function(){throw new Error('A "url" property or function must be specified')}}.call(this);var Handlebars={};Handlebars.VERSION="1.0.beta.5",Handlebars.helpers={},Handlebars.partials={},Handlebars.registerHelper=function(a,b,c){c&&(b.not=c),this.helpers[a]=b},Handlebars.registerPartial=function(a,b){this.partials[a]=b},Handlebars.registerHelper("helperMissing",function(a){if(arguments.length===2)return undefined;throw new Error("Could not find property '"+a+"'")});var toString=Object.prototype.toString,functionType="[object Function]";Handlebars.registerHelper("blockHelperMissing",function(a,b){var c=b.inverse||function(){},d=b.fn,e="",f=toString.call(a);f===functionType&&(a=a.call(this));if(a===!0)return d(this);if(a===!1||a==null)return c(this);if(f==="[object Array]"){if(a.length>0)for(var g=0,h=a.length;g<h;g++)e+=d(a[g]);else e=c(this);return e}return d(a)}),Handlebars.registerHelper("each",function(a,b){var c=b.fn,d=b.inverse,e="";if(a&&a.length>0)for(var f=0,g=a.length;f<g;f++)e+=c(a[f]);else e=d(this);return e}),Handlebars.registerHelper("if",function(a,b){var c=toString.call(a);return c===functionType&&(a=a.call(this)),!a||Handlebars.Utils.isEmpty(a)?b.inverse(this):b.fn(this)}),Handlebars.registerHelper("unless",function(a,b){var c=b.fn,d=b.inverse;return b.fn=d,b.inverse=c,Handlebars.helpers["if"].call(this,a,b)}),Handlebars.registerHelper("with",function(a,b){return b.fn(a)}),Handlebars.registerHelper("log",function(a){Handlebars.log(a)}),Handlebars.Exception=function(a){var b=Error.prototype.constructor.apply(this,arguments);for(var c in b)b.hasOwnProperty(c)&&(this[c]=b[c]);this.message=b.message},Handlebars.Exception.prototype=new Error,Handlebars.SafeString=function(a){this.string=a},Handlebars.SafeString.prototype.toString=function(){return this.string.toString()},function(){var a={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},b=/&(?!\w+;)|[<>"'`]/g,c=/[&<>"'`]/,d=function(b){return a[b]||"&amp;"};Handlebars.Utils={escapeExpression:function(a){return a instanceof Handlebars.SafeString?a.toString():a==null||a===!1?"":c.test(a)?a.replace(b,d):a},isEmpty:function(a){return typeof a=="undefined"?!0:a===null?!0:a===!1?!0:Object.prototype.toString.call(a)==="[object Array]"&&a.length===0?!0:!1}}}(),Handlebars.VM={template:function(a){var b={escapeExpression:Handlebars.Utils.escapeExpression,invokePartial:Handlebars.VM.invokePartial,programs:[],program:function(a,b,c){var d=this.programs[a];return c?Handlebars.VM.program(b,c):d?d:(d=this.programs[a]=Handlebars.VM.program(b),d)},programWithDepth:Handlebars.VM.programWithDepth,noop:Handlebars.VM.noop};return function(c,d){return d=d||{},a.call(b,Handlebars,c,d.helpers,d.partials,d.data)}},programWithDepth:function(a,b,c){var d=Array.prototype.slice.call(arguments,2);return function(c,e){return e=e||{},a.apply(this,[c,e.data||b].concat(d))}},program:function(a,b){return function(c,d){return d=d||{},a(c,d.data||b)}},noop:function(){return""},invokePartial:function(a,b,c,d,e,f){options={helpers:d,partials:e,data:f};if(a===undefined)throw new Handlebars.Exception("The partial "+b+" could not be found");if(a instanceof Function)return a(c,options);if(!Handlebars.compile)throw new Handlebars.Exception("The partial "+b+" could not be compiled when running in runtime-only mode");return e[b]=Handlebars.compile(a),e[b](c,options)}},Handlebars.template=Handlebars.VM.template;var Mustache=function(){var a={},b=function(){};return b.prototype={otag:"{{",ctag:"}}",pragmas:{},buffer:[],pragmas_implemented:{"IMPLICIT-ITERATOR":!0},context:{},render:function(a,b,c,d){d||(this.context=b,this.buffer=[]);if(!this.includes("",a)){if(d)return a;this.send(a);return}a=this.render_pragmas(a);var e=this.render_section(a,b,c);e===!1&&(e=this.render_tags(a,b,c,d));if(d)return e;this.sendLines(e)},send:function(a){a!==""&&this.buffer.push(a)},sendLines:function(a){if(a){var b=a.split("\n");for(var c=0;c<b.length;c++)this.send(b[c])}},render_pragmas:function(a){if(!this.includes("%",a))return a;var b=this,c=this.getCachedRegex("render_pragmas",function(a,b){return new RegExp(a+"%([\\w-]+) ?([\\w]+=[\\w]+)?"+b,"g")});return a.replace(c,function(a,c,d){if(!b.pragmas_implemented[c])throw{message:"This implementation of mustache doesn't understand the '"+c+"' pragma"};b.pragmas[c]={};if(d){var e=d.split("=");b.pragmas[c][e[0]]=e[1]}return""})},render_partial:function(a,b,c){a=this.trim(a);if(!c||c[a]===undefined)throw{message:"unknown_partial '"+a+"'"};return typeof b[a]!="object"?this.render(c[a],b,c,!0):this.render(c[a],b[a],c,!0)},render_section:function(a,b,c){if(!this.includes("#",a)&&!this.includes("^",a))return!1;var d=this,e=this.getCachedRegex("render_section",function(a,b){return new RegExp("^([\\s\\S]*?)"+a+"(\\^|\\#)\\s*(.+)\\s*"+b+"\n*([\\s\\S]*?)"+a+"\\/\\s*\\3\\s*"+b+"\\s*([\\s\\S]*)$","g")});return a.replace(e,function(a,e,f,g,h,i){var j=e?d.render_tags(e,b,c,!0):"",k=i?d.render(i,b,c,!0):"",l,m=d.find(g,b);return f==="^"?!m||d.is_array(m)&&m.length===0?l=d.render(h,b,c,!0):l="":f==="#"&&(d.is_array(m)?l=d.map(m,function(a){return d.render(h,d.create_context(a),c,!0)}).join(""):d.is_object(m)?l=d.render(h,d.create_context(m),c,!0):typeof m=="function"?l=m.call(b,h,function(a){return d.render(a,b,c,!0)}):m?l=d.render(h,b,c,!0):l=""),j+l+k})},render_tags:function(a,b,c,d){var e=this,f=function(){return e.getCachedRegex("render_tags",function(a,b){return new RegExp(a+"(=|!|>|\\{|%)?([^\\/#\\^]+?)\\1?"+b+"+","g")})},g=f(),h=function(a,d,h){switch(d){case"!":return"";case"=":return e.set_delimiters(h),g=f(),"";case">":return e.render_partial(h,b,c);case"{":return e.find(h,b);default:return e.escape(e.find(h,b))}},i=a.split("\n");for(var j=0;j<i.length;j++)i[j]=i[j].replace(g,h,this),d||this.send(i[j]);if(d)return i.join("\n")},set_delimiters:function(a){var b=a.split(" ");this.otag=this.escape_regex(b[0]),this.ctag=this.escape_regex(b[1])},escape_regex:function(a){if(!arguments.callee.sRE){var b=["/",".","*","+","?","|","(",")","[","]","{","}","\\"];arguments.callee.sRE=new RegExp("(\\"+b.join("|\\")+")","g")}return a.replace(arguments.callee.sRE,"\\$1")},find:function(a,b){function c(a){return a===!1||a===0||a}a=this.trim(a);var d;return a.match(/([a-z_]+)\./ig)?d=c(this.walk_context(a,b)):c(b[a])?d=b[a]:c(this.context[a])&&(d=this.context[a]),typeof d=="function"?d.apply(b):d!==undefined?d:""},walk_context:function(a,b){var c=a.split("."),d=b[c[0]]!=undefined?b:this.context,e=d[c.shift()];while(e!=undefined&&c.length>0)d=e,e=e[c.shift()];return typeof e=="function"?e.apply(d):e},includes:function(a,b){return b.indexOf(this.otag+a)!=-1},escape:function(a){return a=String(a===null?"":a),a.replace(/&(?!\w+;)|["'<>\\]/g,function(a){switch(a){case"&":return"&amp;";case'"':return"&quot;";case"'":return"&#39;";case"<":return"&lt;";case">":return"&gt;";default:return a}})},create_context:function(a){if(this.is_object(a))return a;var b=".";this.pragmas["IMPLICIT-ITERATOR"]&&(b=this.pragmas["IMPLICIT-ITERATOR"].iterator);var c={};return c[b]=a,c},is_object:function(a){return a&&typeof a=="object"},is_array:function(a){return Object.prototype.toString.call(a)==="[object Array]"},trim:function(a){return a.replace(/^\s*|\s*$/g,"")},map:function(a,b){if(typeof a.map=="function")return a.map(b);var c=[],d=a.length;for(var e=0;e<d;e++)c.push(b(a[e]));return c},getCachedRegex:function(b,c){var d=a[this.otag];d||(d=a[this.otag]={});var e=d[this.ctag];e||(e=d[this.ctag]={});var f=e[b];return f||(f=e[b]=c(this.otag,this.ctag)),f}},{name:"mustache.js",version:"0.4.0-dev",to_html:function(a,c,d,e){var f=new b;e&&(f.send=e),f.render(a,c||{},d);if(!e)return f.buffer.join("\n")}}}();(function(a){function c(b,c){function bO(a){return function(b){return!this._t||!this._t._a?(this._t&&this._t.sID?e._wD(h+"ignoring "+b.type+": "+this._t.sID):e._wD(h+"ignoring "+b.type),null):a.call(this,b)}}this.flashVersion=8,this.debugMode=!0,this.debugFlash=!1,this.useConsole=!0,this.consoleOnly=!1,this.waitForWindowLoad=!1,this.nullURL="about:blank",this.allowPolling=!0,this.useFastPolling=!1,this.useMovieStar=!0,this.bgColor="#ffffff",this.useHighPerformance=!1,this.flashPollingInterval=null,this.flashLoadTimeout=1e3,this.wmode=null,this.allowScriptAccess="always",this.useFlashBlock=!1,this.useHTML5Audio=!0,this.html5Test=/^(probably|maybe)$/i,this.preferFlash=!0,this.audioFormats={mp3:{type:['audio/mpeg; codecs="mp3"',"audio/mpeg","audio/mp3","audio/MPA","audio/mpa-robust"],required:!0},mp4:{related:["aac","m4a"],type:['audio/mp4; codecs="mp4a.40.2"',"audio/aac","audio/x-m4a","audio/MP4A-LATM","audio/mpeg4-generic"],required:!1},ogg:{type:["audio/ogg; codecs=vorbis"],required:!1},wav:{type:['audio/wav; codecs="1"',"audio/wav","audio/wave","audio/x-wav"],required:!1}},this.defaultOptions={autoLoad:!1,stream:!0,autoPlay:!1,loops:1,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onstop:null,onfailure:null,onfinish:null,onbeforefinish:null,onbeforefinishtime:5e3,onbeforefinishcomplete:null,onjustbeforefinish:null,onjustbeforefinishtime:200,multiShot:!0,multiShotEvents:!1,position:null,pan:0,type:null,usePolicyFile:!1,volume:100},this.flash9Options={isMovieStar:null,usePeakData:!1,useWaveformData:!1,useEQData:!1,onbufferchange:null,ondataerror:null},this.movieStarOptions={bufferTime:3,serverURL:null,onconnect:null,duration:null},this.version=null,this.versionNumber="V2.97a.20110801",this.movieURL=null,this.url=b||null,this.altURL=null,this.swfLoaded=!1,this.enabled=!1,this.o=null,this.movieID="sm2-container",this.id=c||"sm2movie",this.swfCSS={swfBox:"sm2-object-box",swfDefault:"movieContainer",swfError:"swf_error",swfTimedout:"swf_timedout",swfLoaded:"swf_loaded",swfUnblocked:"swf_unblocked",sm2Debug:"sm2_debug",highPerf:"high_performance",flashDebug:"flash_debug"},this.oMC=null,this.sounds={},this.soundIDs=[],this.muted=!1,this.debugID="soundmanager-debug",this.debugURLParam=/([#?&])debug=1/i,this.specialWmodeCase=!1,this.didFlashBlock=!1,this.filePattern=null,this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i},this.baseMimeTypes=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i,this.netStreamMimeTypes=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i,this.netStreamTypes=["aac","flv","mov","mp4","m4v","f4v","m4a","mp4v","3gp","3g2"],this.netStreamPattern=new RegExp("\\.("+this.netStreamTypes.join("|")+")(\\?.*)?$","i"),this.mimePattern=this.baseMimeTypes,this.features={buffering:!1,peakData:!1,waveformData:!1,eqData:!1,movieStar:!1},this.sandbox={type:null,types:{remote:"remote (domain-based) rules",localWithFile:"local with file access (no internet access)",localWithNetwork:"local with network (internet access only, no local access)",localTrusted:"local, trusted (local+internet access)"},description:null,noRemote:null,noLocal:null},this.hasHTML5=typeof Audio!="undefined"&&typeof (new Audio).canPlayType!="undefined",this.html5={usingFlash:null},this.flash={},this.html5Only=!1,this.ignoreFlash=!1;var d,e=this,f="soundManager",g=f+"::",h="HTML5::",i,j=navigator.userAgent,k=a,l=k.location.href.toString(),m=this.flashVersion,n=document,o,p,q=[],r=!0,s,t=!1,u=!1,v=!1,w=!1,x=!1,y,z=0,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S=["log","info","warn","error"],T=8,U,V,W,X=null,Y=null,Z,$,_,ba,bb,bc,bd,be,bf=!1,bg=!1,bh,bi,bj,bk,bl=null,bm,bn,bo,bp,bq,br,bs,bt=Array.prototype.slice,bu=!1,bv,bw,bx,by,bz,bA=j.match(/(ipad|iphone|ipod)/i),bB=j.match(/(mobile|pre\/|xoom)/i)||bA,bC=j.match(/msie/i),bD=j.match(/webkit/i),bE=j.match(/safari/i)&&!j.match(/chrome/i),bF=j.match(/opera/i),bG=!l.match(/usehtml5audio/i)&&!l.match(/sm2\-ignorebadua/i)&&bE&&j.match(/OS X 10_6_([3-7])/i),bH=typeof console!="undefined"&&typeof console.log!="undefined",bI=typeof n.hasFocus!="undefined"?n.hasFocus():null,bJ=bE&&typeof n.hasFocus=="undefined",bK=!bJ,bL=/(mp3|mp4|mpa)/i,bM=n.location?n.location.protocol.match(/http/i):null,bN=bM?"":"http:";this.useAltURL=!bM,this._global_a=null,bB&&(e.useHTML5Audio=!0,e.preferFlash=!1,bA&&(e.ignoreFlash=!0,bu=!0)),this.ok=function(){return bl?v&&!w:e.useHTML5Audio&&e.hasHTML5},this.supported=this.ok,this.getMovie=function(a){return bC?k[a]:bE?i(a)||n[a]:i(a)},this.createSound=function(a){function i(){return c=bb(c),e.sounds[h.id]=new d(h),e.soundIDs.push(h.id),e.sounds[h.id]}var b=f+".createSound(): ",c=null,g=null,h=null;return!v||!e.ok()?(bd(b+Z(v?"notOK":"notReady")),!1):(arguments.length===2&&(a={id:arguments[0],url:arguments[1]}),c=B(a),h=c,h.id.toString().charAt(0).match(/^[0-9]$/)&&e._wD(b+Z("badID",h.id),2),e._wD(b+h.id+" ("+h.url+")",1),be(h.id,!0)?(e._wD(b+h.id+" exists",1),e.sounds[h.id]):(bn(h)?(g=i(),e._wD("Loading sound "+h.id+" via HTML5"),g._setup_html5(h)):(m>8&&e.useMovieStar&&(h.isMovieStar===null&&(h.isMovieStar=h.serverURL||(h.type?h.type.match(e.netStreamPattern):!1)||h.url.match(e.netStreamPattern)?!0:!1),h.isMovieStar&&e._wD(b+"using MovieStar handling"),h.isMovieStar&&(h.usePeakData&&(y("noPeak"),h.usePeakData=!1),h.loops>1&&y("noNSLoop"))),h=bc(h,b),g=i(),m===8?e.o._createSound(h.id,h.onjustbeforefinishtime,h.loops||1,h.usePolicyFile):(e.o._createSound(h.id,h.url,h.onjustbeforefinishtime,h.usePeakData,h.useWaveformData,h.useEQData,h.isMovieStar,h.isMovieStar?h.bufferTime:!1,h.loops||1,h.serverURL,h.duration||null,h.autoPlay,!0,h.autoLoad,h.usePolicyFile),h.serverURL||(g.connected=!0,h.onconnect&&h.onconnect.apply(g))),!h.serverURL&&(h.autoLoad||h.autoPlay)&&g.load(h)),!h.serverURL&&h.autoPlay&&g.play(),g))},this.destroySound=function(a,b){if(!be(a))return!1;var c=e.sounds[a],d;c._iO={},c.stop(),c.unload();for(d=0;d<e.soundIDs.length;d++)if(e.soundIDs[d]===a){e.soundIDs.splice(d,1);break}return b||c.destruct(!0),c=null,delete e.sounds[a],!0},this.load=function(a,b){return be(a)?e.sounds[a].load(b):!1},this.unload=function(a){return be(a)?e.sounds[a].unload():!1},this.play=function(a,b){var c=f+".play(): ";return!v||!e.ok()?(bd(c+Z(v?"notOK":"notReady")),!1):be(a)?e.sounds[a].play(b):(b instanceof Object||(b={url:b}),b&&b.url?(e._wD(c+'attempting to create "'+a+'"',1),b.id=a,e.createSound(b).play()):!1)},this.start=this.play,this.setPosition=function(a,b){return be(a)?e.sounds[a].setPosition(b):!1},this.stop=function(a){return be(a)?(e._wD(f+".stop("+a+")",1),e.sounds[a].stop()):!1},this.stopAll=function(){var a;e._wD(f+".stopAll()",1);for(a in e.sounds)e.sounds.hasOwnProperty(a)&&e.sounds[a].stop()},this.pause=function(a){return be(a)?e.sounds[a].pause():!1},this.pauseAll=function(){var a;for(a=e.soundIDs.length;a--;)e.sounds[e.soundIDs[a]].pause()},this.resume=function(a){return be(a)?e.sounds[a].resume():!1},this.resumeAll=function(){var a;for(a=e.soundIDs.length;a--;)e.sounds[e.soundIDs[a]].resume()},this.togglePause=function(a){return be(a)?e.sounds[a].togglePause():!1},this.setPan=function(a,b){return be(a)?e.sounds[a].setPan(b):!1},this.setVolume=function(a,b){return be(a)?e.sounds[a].setVolume(b):!1},this.mute=function(a){var b=f+".mute(): ",c=0;typeof a!="string"&&(a=null);if(!a){e._wD(b+"Muting all sounds");for(c=e.soundIDs.length;c--;)e.sounds[e.soundIDs[c]].mute();return e.muted=!0,!0}return be(a)?(e._wD(b+'Muting "'+a+'"'),e.sounds[a].mute()):!1},this.muteAll=function(){e.mute()},this.unmute=function(a){var b=f+".unmute(): ",c;typeof a!="string"&&(a=null);if(!a){e._wD(b+"Unmuting all sounds");for(c=e.soundIDs.length;c--;)e.sounds[e.soundIDs[c]].unmute();return e.muted=!1,!0}return be(a)?(e._wD(b+'Unmuting "'+a+'"'),e.sounds[a].unmute()):!1},this.unmuteAll=function(){e.unmute()},this.toggleMute=function(a){return be(a)?e.sounds[a].toggleMute():!1},this.getMemoryUse=function(){var a=0;return e.o&&m!==8&&(a=parseInt(e.o._getMemoryUse(),10)),a},this.disable=function(a){var b;typeof a=="undefined"&&(a=!1);if(w)return!1;w=!0,y("shutdown",1);for(b=e.soundIDs.length;b--;)U(e.sounds[e.soundIDs[b]]);return A(a),bs.remove(k,"load",E),!0},this.canPlayMIME=function(a){var b;return e.hasHTML5&&(b=bo({type:a})),!bl||b?b:a?a.match(e.mimePattern)?!0:!1:null},this.canPlayURL=function(a){var b;return e.hasHTML5&&(b=bo({url:a})),!bl||b?b:a?a.match(e.filePattern)?!0:!1:null},this.canPlayLink=function(a){return typeof a.type!="undefined"&&a.type&&e.canPlayMIME(a.type)?!0:e.canPlayURL(a.href)},this.getSoundById=function(a,b){if(!a)throw new Error(f+".getSoundById(): sID is null/undefined");var c=e.sounds[a];return!c&&!b&&e._wD('"'+a+'" is an invalid sound ID.',2),c},this.onready=function(a,b){var c="onready";if(a&&a instanceof Function)return v&&e._wD(Z("queue",c)),b||(b=k),C(c,a,b),D(),!0;throw Z("needFunction",c)},this.ontimeout=function(a,b){var c="ontimeout";if(a&&a instanceof Function)return v&&e._wD(Z("queue",c)),b||(b=k),C(c,a,b),D({type:c}),!0;throw Z("needFunction",c)},this._writeDebug=function(a,b,c){var d="soundmanager-debug",f,g,h;if(!e.debugMode)return!1;typeof c!="undefined"&&c&&(a=a+" | "+(new Date).getTime());if(bH&&e.useConsole){h=S[b],typeof console[h]!="undefined"?console[h](a):console.log(a);if(e.useConsoleOnly)return!0}try{f=i(d);if(!f)return!1;g=n.createElement("div"),++z%2===0&&(g.className="sm2-alt"),typeof b=="undefined"?b=0:b=parseInt(b,10),g.appendChild(n.createTextNode(a)),b&&(b>=2&&(g.style.fontWeight="bold"),b===3&&(g.style.color="#ff3333")),f.insertBefore(g,f.firstChild)}catch(j){}return f=null,!0},this._wD=this._writeDebug,this._debug=function(){var a,b;y("currentObj",1);for(a=0,b=e.soundIDs.length;a<b;a++)e.sounds[e.soundIDs[a]]._debug()},this.reboot=function(){e._wD(f+".reboot()"),e.soundIDs.length&&e._wD("Destroying "+e.soundIDs.length+" SMSound objects...");var a,b;for(a=e.soundIDs.length;a--;)e.sounds[e.soundIDs[a]].destruct();try{bC&&(Y=e.o.innerHTML),X=e.o.parentNode.removeChild(e.o),e._wD("Flash movie removed.")}catch(c){y("badRemove",2)}Y=X=bl=null,e.enabled=M=v=bf=bg=t=u=w=e.swfLoaded=!1,e.soundIDs=e.sounds=[],e.o=null;for(a in q)if(q.hasOwnProperty(a))for(b=q[a].length;b--;)q[a][b].fired=!1;e._wD(f+": Rebooting..."),k.setTimeout(e.beginDelayedInit,20)},this.getMoviePercent=function(){return e.o&&typeof e.o.PercentLoaded!="undefined"?e.o.PercentLoaded():null},this.beginDelayedInit=function(){x=!0,L(),setTimeout(function(){return bg?!1:(O(),K(),bg=!0,!0)},20),F()},this.destruct=function(){e._wD(f+".destruct()"),e.disable(!0)},by={abort:bO(function(a){e._wD(h+"abort: "+this._t.sID)}),canplay:bO(function(a){if(this._t._html5_canplay)return!0;this._t._html5_canplay=!0,e._wD(h+"canplay: "+this._t.sID+", "+this._t.url),this._t._onbufferchange(0);var b=isNaN(this._t.position)?null:this._t.position/1e3;if(this._t.position&&this.currentTime!==b){e._wD(h+"canplay: setting position to "+b);try{this.currentTime=b}catch(c){e._wD(h+"setting position failed: "+c.message,2)}}}),load:bO(function(a){this._t.loaded||(this._t._onbufferchange(0),this._t._whileloading(this._t.bytesTotal,this._t.bytesTotal,this._t._get_html5_duration()),this._t._onload(!0))}),emptied:bO(function(a){e._wD(h+"emptied: "+this._t.sID)}),ended:bO(function(a){e._wD(h+"ended: "+this._t.sID),this._t._onfinish()}),error:bO(function(a){e._wD(h+"error: "+this.error.code),this._t._onload(!1)}),loadeddata:bO(function(a){var b=this._t,c=b.bytesTotal||1;e._wD(h+"loadeddata: "+this._t.sID),!b._loaded&&!bE&&(b.duration=b._get_html5_duration(),b._whileloading(c,c,b._get_html5_duration()),b._onload(!0))}),loadedmetadata:bO(function(a){e._wD(h+"loadedmetadata: "+this._t.sID)}),loadstart:bO(function(a){e._wD(h+"loadstart: "+this._t.sID),this._t._onbufferchange(1)}),play:bO(function(a){e._wD(h+"play: "+this._t.sID+", "+this._t.url),this._t._onbufferchange(0)}),playing:bO(function(a){e._wD(h+"playing: "+this._t.sID+", "+this._t.url),this._t._onbufferchange(0)}),progress:bO(function(a){if(this._t.loaded)return!1;var b,c,d,f=0,g=a.type==="progress",i=a.target.buffered,j=a.loaded||0,k=a.total||1;if(i&&i.length){for(b=i.length;b--;)f=i.end(b)-i.start(b);j=f/a.target.duration;if(g&&i.length>1){d=[],c=i.length;for(b=0;b<c;b++)d.push(a.target.buffered.start(b)+"-"+a.target.buffered.end(b));e._wD(h+"progress: timeRanges: "+d.join(", "))}g&&!isNaN(j)&&e._wD(h+"progress: "+this._t.sID+": "+Math.floor(j*100)+"% loaded")}isNaN(j)||(this._t._onbufferchange(0),this._t._whileloading(j,k,this._t._get_html5_duration()),j&&k&&j===k&&by.load.call(this,a))}),ratechange:bO(function(a){e._wD(h+"ratechange: "+this._t.sID)}),suspend:bO(function(a){e._wD(h+"suspend: "+this._t.sID),by.progress.call(this,a)}),stalled:bO(function(a){e._wD(h+"stalled: "+this._t.sID)}),timeupdate:bO(function(a){this._t._onTimer()}),waiting:bO(function(a){e._wD(h+"waiting: "+this._t.sID),this._t._onbufferchange(1)})},d=function(a){var b=this,c,d,f;this.sID=a.id,this.url=a.url,this.options=B(a),this.instanceOptions=this.options,this._iO=this.instanceOptions,this.pan=this.options.pan,this.volume=this.options.volume,this._lastURL=null,this.isHTML5=!1,this._a=null,this.id3={},this._debug=function(){if(e.debugMode){var a=null,c=[],d,f,g=64;for(a in b.options)b.options[a]!==null&&(b.options[a]instanceof Function?(d=b.options[a].toString(),d=d.replace(/\s\s+/g," "),f=d.indexOf("{"),c.push(" "+a+": {"+d.substr(f+1,Math.min(Math.max(d.indexOf("\n")-1,g),g)).replace(/\n/g,"")+"... }")):c.push(" "+a+": "+b.options[a]));e._wD("SMSound() merged options: {\n"+c.join(", \n")+"\n}")}},this._debug(),this.load=function(a){var c=null;typeof a!="undefined"?(b._iO=B(a,b.options),b.instanceOptions=b._iO):(a=b.options,b._iO=a,b.instanceOptions=b._iO,b._lastURL&&b._lastURL!==b.url&&(y("manURL"),b._iO.url=b.url,b.url=null)),b._iO.url||(b._iO.url=b.url),e._wD("SMSound.load(): "+b._iO.url,1);if(b._iO.url===b.url&&b.readyState!==0&&b.readyState!==2)return y("onURL",1),b;b._lastURL=b.url,b.loaded=!1,b.readyState=1,b.playState=0;if(bn(b._iO))c=b._setup_html5(b._iO),c._called_load?e._wD(h+"ignoring request to load again: "+b.sID):(e._wD(h+"load: "+b.sID),b._html5_canplay=!1,c.load(),c._called_load=!0,b._iO.autoPlay&&b.play());else try{b.isHTML5=!1,b._iO=bc(bb(b._iO)),m===8?e.o._load(b.sID,b._iO.url,b._iO.stream,b._iO.autoPlay,b._iO.whileloading?1:0,b._iO.loops||1,b._iO.usePolicyFile):e.o._load(b.sID,b._iO.url,b._iO.stream?!0:!1,b._iO.autoPlay?!0:!1,b._iO.loops||1,b._iO.autoLoad?!0:!1,b._iO.usePolicyFile)}catch(d){y("smError",2),s("onload",!1),P({type:"SMSOUND_LOAD_JS_EXCEPTION",fatal:!0})}return b},this.unload=function(){return b.readyState!==0&&(e._wD('SMSound.unload(): "'+b.sID+'"'),b.isHTML5?(d(),b._a&&(b._a.pause(),b._a.src="")):m===8?e.o._unload(b.sID,e.nullURL):e.o._unload(b.sID),c()),b},this.destruct=function(a){e._wD('SMSound.destruct(): "'+b.sID+'"'),b.isHTML5?(d(),b._a&&(b._a.pause(),b._a.src="",bu||b._remove_html5_events(),b._a._t=null,b._a=null)):(b._iO.onfailure=null,e.o._destroySound(b.sID)),a||e.destroySound(b.sID,!0)},this.play=function(a,c){var d="SMSound.play(): ",g,h;c=c===undefined?!0:c,a||(a={}),b._iO=B(a,b._iO),b._iO=B(b._iO,b.options),b.instanceOptions=b._iO;if(b._iO.serverURL&&!b.connected)return b.getAutoPlay()||(e._wD(d+" Netstream not connected yet - setting autoPlay"),b.setAutoPlay(!0)),b;bn(b._iO)&&(b._setup_html5(b._iO),f());if(b.playState===1&&!b.paused){g=b._iO.multiShot;if(!g)return e._wD(d+'"'+b.sID+'" already playing (one-shot)',1),b;e._wD(d+'"'+b.sID+'" already playing (multi-shot)',1)}if(!b.loaded)if(b.readyState===0)e._wD(d+'Attempting to load "'+b.sID+'"',1),b.isHTML5||(b._iO.autoPlay=!0),b.load(b._iO);else{if(b.readyState===2)return e._wD(d+'Could not load "'+b.sID+'" - exiting',2),b;e._wD(d+'"'+b.sID+'" is loading - attempting to play..',1)}else e._wD(d+'"'+b.sID+'"');return!b.isHTML5&&m===9&&b.position>0&&b.position===b.duration&&(e._wD(d+'"'+b.sID+'": Sound at end, resetting to position:0'),b._iO.position=0),b.paused&&b.position&&b.position>0?(e._wD(d+'"'+b.sID+'" is resuming from paused state',1),b.resume()):(e._wD(d+'"'+b.sID+'" is starting to play'),b.playState=1,b.paused=!1,(!b.instanceCount||b._iO.multiShotEvents||!b.isHTML5&&m>8&&!b.getAutoPlay())&&b.instanceCount++,b.position=typeof b._iO.position!="undefined"&&!isNaN(b._iO.position)?b._iO.position:0,b.isHTML5||(b._iO=bc(bb(b._iO))),b._iO.onplay&&c&&(b._iO.onplay.apply(b),b._onplay_called=!0),b.setVolume(b._iO.volume,!0),b.setPan(b._iO.pan,!0),b.isHTML5?(f(),h=b._setup_html5(),b.setPosition(b._iO.position),h.play()):e.o._start(b.sID,b._iO.loops||1,m===9?b._iO.position:b._iO.position/1e3)),b},this.start=this.play,this.stop=function(a){return b.playState===1&&(b._onbufferchange(0),b.resetOnPosition(0),b.isHTML5||(b.playState=0),b.paused=!1,b._iO.onstop&&b._iO.onstop.apply(b),b.isHTML5?b._a&&(b.setPosition(0),b._a.pause(),b.playState=0,b._onTimer(),d(),b.unload()):(e.o._stop(b.sID,a),b._iO.serverURL&&b.unload()),b.instanceCount=0,b._iO={}),b},this.setAutoPlay=function(a){e._wD("sound "+b.sID+" turned autoplay "+(a?"on":"off")),b._iO.autoPlay=a,b.isHTML5||(e.o._setAutoPlay(b.sID,a),a&&!b.instanceCount&&b.readyState===1&&(b.instanceCount++,e._wD("sound "+b.sID+" incremented instance count to "+b.instanceCount)))},this.getAutoPlay=function(){return b._iO.autoPlay},this.setPosition=function(a){a===undefined&&(a=0);var c,d,f,g=b.isHTML5?Math.max(a,0):Math.min(b.duration||b._iO.duration,Math.max(a,0));c=b.position,b.position=g,f=b.position/1e3,b.resetOnPosition(b.position),b._iO.position=g;if(!b.isHTML5)d=m===9?b.position:f,b.readyState&&b.readyState!==2&&e.o._setPosition(b.sID,d,b.paused||!b.playState);else if(b._a)if(b._html5_canplay){if(b._a.currentTime!==f){e._wD("setPosition("+f+"): setting position");try{b._a.currentTime=f,(b.playState===0||b.paused)&&b._a.pause()}catch(h){e._wD("setPosition("+f+"): setting position failed: "+h.message,2)}}}else e._wD("setPosition("+f+"): delaying, sound not ready");return b.isHTML5&&b.paused&&b._onTimer(!0),b},this.pause=function(a){return b.paused||b.playState===0&&b.readyState!==1?b:(e._wD("SMSound.pause()"),b.paused=!0,b.isHTML5?(b._setup_html5().pause(),d()):(a||a===undefined)&&e.o._pause(b.sID),b._iO.onpause&&b._iO.onpause.apply(b),b)},this.resume=function(){return b.paused?(e._wD("SMSound.resume()"),b.paused=!1,b.playState=1,b.isHTML5?(b._setup_html5().play(),f()):(b._iO.isMovieStar&&b.setPosition(b.position),e.o._pause(b.sID)),!b._onplay_called&&b._iO.onplay?(b._iO.onplay.apply(b),b._onplay_called=!0):b._iO.onresume&&b._iO.onresume.apply(b),b):b},this.togglePause=function(){return e._wD("SMSound.togglePause()"),b.playState===0?(b.play({position:m===9&&!b.isHTML5?b.position:b.position/1e3}),b):(b.paused?b.resume():b.pause(),b)},this.setPan=function(a,c){return typeof a=="undefined"&&(a=0),typeof c=="undefined"&&(c=!1),b.isHTML5||e.o._setPan(b.sID,a),b._iO.pan=a,c||(b.pan=a,b.options.pan=a),b},this.setVolume=function(a,c){return typeof a=="undefined"&&(a=100),typeof c=="undefined"&&(c=!1),b.isHTML5?b._a&&(b._a.volume=Math.max(0,Math.min(1,a/100))):e.o._setVolume(b.sID,e.muted&&!b.muted||b.muted?0:a),b._iO.volume=a,c||(b.volume=a,b.options.volume=a),b},this.mute=function(){return b.muted=!0,b.isHTML5?b._a&&(b._a.muted=!0):e.o._setVolume(b.sID,0),b},this.unmute=function(){b.muted=!1;var a=typeof b._iO.volume!="undefined";return b.isHTML5?b._a&&(b._a.muted=!1):e.o._setVolume(b.sID,a?b._iO.volume:b.options.volume),b},this.toggleMute=function(){return b.muted?b.unmute():b.mute()},this.onposition=function(a,c,d){return b._onPositionItems.push({position:a,method:c,scope:typeof d!="undefined"?d:b,fired:!1}),b},this.processOnPosition=function(){var a,c,d=b._onPositionItems.length;if(!d||!b.playState||b._onPositionFired>=d)return!1;for(a=d;a--;)c=b._onPositionItems[a],!c.fired&&b.position>=c.position&&(c.method.apply(c.scope,[c.position]),c.fired=!0,e._onPositionFired++);return!0},this.resetOnPosition=function(a){var c,d,f=b.
_onPositionItems.length;if(!f)return!1;for(c=f;c--;)d=b._onPositionItems[c],d.fired&&a<=d.position&&(d.fired=!1,e._onPositionFired--);return!0},f=function(){b.isHTML5&&bj(b)},d=function(){b.isHTML5&&bk(b)},c=function(){b._onPositionItems=[],b._onPositionFired=0,b._hasTimer=null,b._onplay_called=!1,b._a=null,b._html5_canplay=!1,b.bytesLoaded=null,b.bytesTotal=null,b.position=null,b.duration=b._iO&&b._iO.duration?b._iO.duration:null,b.durationEstimate=null,b.failures=0,b.loaded=!1,b.playState=0,b.paused=!1,b.readyState=0,b.muted=!1,b.didBeforeFinish=!1,b.didJustBeforeFinish=!1,b.isBuffering=!1,b.instanceOptions={},b.instanceCount=0,b.peakData={left:0,right:0},b.waveformData={left:[],right:[]},b.eqData=[],b.eqData.left=[],b.eqData.right=[]},c(),this._onTimer=function(a){var c,d={};if(b._hasTimer||a)return b._a&&(a||(b.playState>0||b.readyState===1)&&!b.paused)?(b.duration=b._get_html5_duration(),b.durationEstimate=b.duration,c=b._a.currentTime?b._a.currentTime*1e3:0,b._whileplaying(c,d,d,d,d),!0):(e._wD('_onTimer: Warn for "'+b.sID+'": '+(b._a?"":"Could not find element. ")+(b.playState===0?"playState bad, 0?":"playState = "+b.playState+", OK")),!1)},this._get_html5_duration=function(){var a=b._a?b._a.duration*1e3:b._iO?b._iO.duration:undefined,c=a&&!isNaN(a)&&a!==Infinity?a:b._iO?b._iO.duration:null;return c},this._setup_html5=function(a){var d=B(b._iO,a),f=decodeURI,g=bu?e._global_a:b._a,h=f(d.url),i=g&&g._t?g._t.instanceOptions:null;if(g){if(g._t&&i.url===d.url&&(!b._lastURL||b._lastURL===i.url))return g;e._wD("setting new URL on existing object: "+h+(b._lastURL?", old URL: "+b._lastURL:"")),bu&&g._t&&g._t.playState&&d.url!==i.url&&g._t.stop(),c(),g.src=d.url,b.url=d.url,b._lastURL=d.url,g._called_load=!1}else e._wD("creating HTML5 Audio() element with URL: "+h),g=new Audio(d.url),g._called_load=!1,bu&&(e._global_a=g);return b.isHTML5=!0,b._a=g,g._t=b,b._add_html5_events(),g.loop=d.loops>1?"loop":"",d.autoLoad||d.autoPlay?(g.autobuffer="auto",g.preload="auto",b.load(),g._called_load=!0):(g.autobuffer=!1,g.preload="none"),g.loop=d.loops>1?"loop":"",g},this._add_html5_events=function(){function c(a,c,d){return b._a?b._a.addEventListener(a,c,d||!1):null}if(b._a._added_events)return!1;var a;e._wD(h+"adding event listeners: "+b.sID),b._a._added_events=!0;for(a in by)by.hasOwnProperty(a)&&c(a,by[a]);return!0},this._remove_html5_events=function(){function c(a,c,d){return b._a?b._a.removeEventListener(a,c,d||!1):null}var a;e._wD(h+"removing event listeners: "+b.sID),b._a._added_events=!1;for(a in by)by.hasOwnProperty(a)&&c(a,by[a])},this._onload=function(a){var c="SMSound._onload(): ",d=a?!0:!1;return e._wD(c+'"'+b.sID+'"'+(d?" loaded.":" failed to load? - "+b.url),d?1:2),!d&&!b.isHTML5&&(e.sandbox.noRemote===!0&&e._wD(c+Z("noNet"),1),e.sandbox.noLocal===!0&&e._wD(c+Z("noLocal"),1)),b.loaded=d,b.readyState=d?3:2,b._onbufferchange(0),b._iO.onload&&b._iO.onload.apply(b,[d]),!0},this._onbufferchange=function(a){var c="SMSound._onbufferchange()";return b.playState===0?!1:a&&b.isBuffering||!a&&!b.isBuffering?!1:(b.isBuffering=a===1,b._iO.onbufferchange&&(e._wD(c+": "+a),b._iO.onbufferchange.apply(b)),!0)},this._onfailure=function(a,c,d){b.failures++,e._wD('SMSound._onfailure(): "'+b.sID+'" count '+b.failures),b._iO.onfailure&&b.failures===1?b._iO.onfailure(b,a,c,d):e._wD("SMSound._onfailure(): ignoring")},this._onbeforefinish=function(){b.didBeforeFinish||(b.didBeforeFinish=!0,b._iO.onbeforefinish&&(e._wD('SMSound._onbeforefinish(): "'+b.sID+'"'),b._iO.onbeforefinish.apply(b)))},this._onjustbeforefinish=function(a){b.didJustBeforeFinish||(b.didJustBeforeFinish=!0,b._iO.onjustbeforefinish&&(e._wD('SMSound._onjustbeforefinish(): "'+b.sID+'"'),b._iO.onjustbeforefinish.apply(b)))},this._onfinish=function(){var a=b._iO.onfinish;b._onbufferchange(0),b.resetOnPosition(0),b._iO.onbeforefinishcomplete&&b._iO.onbeforefinishcomplete.apply(b),b.didBeforeFinish=!1,b.didJustBeforeFinish=!1,b.instanceCount&&(b.instanceCount--,b.instanceCount||(b.playState=0,b.paused=!1,b.instanceCount=0,b.instanceOptions={},b._iO={},d()),(!b.instanceCount||b._iO.multiShotEvents)&&a&&(e._wD('SMSound._onfinish(): "'+b.sID+'"'),a.apply(b)))},this._whileloading=function(a,c,d,e){b.bytesLoaded=a,b.bytesTotal=c,b.duration=Math.floor(d),b.bufferLength=e,b._iO.isMovieStar?(b.durationEstimate=b.duration,b.readyState!==3&&b._iO.whileloading&&b._iO.whileloading.apply(b)):(b._iO.duration?b.durationEstimate=b.duration>b._iO.duration?b.duration:b._iO.duration:b.durationEstimate=parseInt(b.bytesTotal/b.bytesLoaded*b.duration,10),b.durationEstimate===undefined&&(b.durationEstimate=b.duration),b.readyState!==3&&b._iO.whileloading&&b._iO.whileloading.apply(b))},this._whileplaying=function(a,c,d,f,g){if(isNaN(a)||a===null)return!1;b.position=a,b.processOnPosition();if(!b.isHTML5&&m>8){b._iO.usePeakData&&typeof c!="undefined"&&c&&(b.peakData={left:c.leftPeak,right:c.rightPeak}),b._iO.useWaveformData&&typeof d!="undefined"&&d&&(b.waveformData={left:d.split(","),right:f.split(",")});if(b._iO.useEQData&&typeof g!="undefined"&&g&&g.leftEQ){var h=g.leftEQ.split(",");b.eqData=h,b.eqData.left=h,typeof g.rightEQ!="undefined"&&g.rightEQ&&(b.eqData.right=g.rightEQ.split(","))}}return b.playState===1&&(!b.isHTML5&&e.flashVersion===8&&!b.position&&b.isBuffering&&b._onbufferchange(0),b._iO.whileplaying&&b._iO.whileplaying.apply(b),(b.loaded||!b.loaded&&b._iO.isMovieStar)&&b._iO.onbeforefinish&&b._iO.onbeforefinishtime&&!b.didBeforeFinish&&b.duration-b.position<=b._iO.onbeforefinishtime&&b._onbeforefinish()),!0},this._onid3=function(a,c){e._wD('SMSound._onid3(): "'+this.sID+'" ID3 data received.');var d=[],f,g;for(f=0,g=a.length;f<g;f++)d[a[f]]=c[f];b.id3=B(b.id3,d),b._iO.onid3&&b._iO.onid3.apply(b)},this._onconnect=function(a){var c="SMSound._onconnect(): ";a=a===1,e._wD(c+'"'+b.sID+'"'+(a?" connected.":" failed to connect? - "+b.url),a?1:2),b.connected=a,a&&(b.failures=0,be(b.sID)&&(b.getAutoPlay()?b.play(undefined,b.getAutoPlay()):b._iO.autoLoad&&b.load()),b._iO.onconnect&&b._iO.onconnect.apply(b,[a]))},this._ondataerror=function(a){b.playState>0&&(e._wD("SMSound._ondataerror(): "+a),b._iO.ondataerror&&b._iO.ondataerror.apply(b))}},N=function(){return n.body||n._docElement||n.getElementsByTagName("div")[0]},i=function(a){return n.getElementById(a)},B=function(a,b){var c={},d,f,g;for(d in a)a.hasOwnProperty(d)&&(c[d]=a[d]);f=typeof b=="undefined"?e.defaultOptions:b;for(g in f)f.hasOwnProperty(g)&&typeof c[g]=="undefined"&&(c[g]=f[g]);return c},bs=function(){function c(b){var c=bt.call(b),d=c.length;return a?(c[1]="on"+c[1],d>3&&c.pop()):d===3&&c.push(!1),c}function d(c,d){var e=c.shift(),f=[b[d]];a?e[f](c[0],c[1]):e[f].apply(e,c)}function e(){d(c(arguments),"add")}function f(){d(c(arguments),"remove")}var a=k.attachEvent,b={add:a?"attachEvent":"addEventListener",remove:a?"detachEvent":"removeEventListener"};return{add:e,remove:f}}(),bn=function(a){return!a.serverURL&&(a.type?bo({type:a.type}):bo({url:a.url})||e.html5Only)},bo=function(a){function j(a){return e.preferFlash&&bv&&!e.ignoreFlash&&typeof e.flash[a]!="undefined"&&e.flash[a]}if(!e.useHTML5Audio||!e.hasHTML5)return!1;var b=a.url||null,c=a.type||null,d=e.audioFormats,f,g,h,i;if(c&&e.html5[c]!=="undefined")return e.html5[c]&&!j(c);if(!bp){bp=[];for(i in d)d.hasOwnProperty(i)&&(bp.push(i),d[i].related&&(bp=bp.concat(d[i].related)));bp=new RegExp("\\.("+bp.join("|")+")(\\?.*)?$","i")}h=b?b.toLowerCase().match(bp):null;if(!h||!h.length){if(!c)return!1;g=c.indexOf(";"),h=(g!==-1?c.substr(0,g):c).substr(6)}else h=h[1];return h&&typeof e.html5[h]!="undefined"?e.html5[h]&&!j(h):(c="audio/"+h,f=e.html5.canPlayType({type:c}),e.html5[h]=f,f&&e.html5[c]&&!j(c))},br=function(){function g(b){var c,d,f,g=!1;if(!a||typeof a.canPlayType!="function")return!1;if(b instanceof Array){for(d=0,f=b.length;d<f&&!g;d++)if(e.html5[b[d]]||a.canPlayType(b[d]).match(e.html5Test))g=!0,e.html5[b[d]]=!0,e.flash[b[d]]=!!(e.preferFlash&&bv&&b[d].match(bL));return g}return c=a&&typeof a.canPlayType=="function"?a.canPlayType(b):!1,!!c&&!!c.match(e.html5Test)}if(!e.useHTML5Audio||typeof Audio=="undefined")return!1;var a=typeof Audio!="undefined"?bF?new Audio(null):new Audio:null,b,c={},d,f;d=e.audioFormats;for(b in d)if(d.hasOwnProperty(b)){c[b]=g(d[b].type),c["audio/"+b]=c[b],e.preferFlash&&!e.ignoreFlash&&b.match(bL)?e.flash[b]=!0:e.flash[b]=!1;if(d[b]&&d[b].related)for(f=d[b].related.length;f--;)c["audio/"+d[b].related[f]]=c[b],e.html5[d[b].related[f]]=c[b],e.flash[d[b].related[f]]=c[b]}return c.canPlayType=a?g:null,e.html5=B(e.html5,c),!0},J={notReady:"Not loaded yet - wait for soundManager.onload()/onready()",notOK:"Audio support is not available.",domError:g+"createMovie(): appendChild/innerHTML call failed. DOM not ready or other error.",spcWmode:g+"createMovie(): Removing wmode, preventing known SWF loading issue(s)",swf404:f+": Verify that %s is a valid path.",tryDebug:"Try "+f+".debugFlash = true for more security details (output goes to SWF.)",checkSWF:"See SWF output for more debug info.",localFail:f+": Non-HTTP page ("+n.location.protocol+" URL?) Review Flash player security settings for this special case:\nhttp://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html\nMay need to add/allow path, eg. c:/sm2/ or /users/me/sm2/",waitFocus:f+": Special case: Waiting for focus-related event..",waitImpatient:f+": Getting impatient, still waiting for Flash%s...",waitForever:f+": Waiting indefinitely for Flash (will recover if unblocked)...",needFunction:f+": Function object expected for %s",badID:'Warning: Sound ID "%s" should be a string, starting with a non-numeric character',noMS:"MovieStar mode not enabled. Exiting.",currentObj:"--- "+f+"._debug(): Current sound objects ---",waitEI:g+"initMovie(): Waiting for ExternalInterface call from Flash..",waitOnload:f+": Waiting for window.onload()",docLoaded:f+": Document already loaded",onload:g+"initComplete(): calling soundManager.onload()",onloadOK:f+".onload() complete",init:g+"init()",didInit:g+"init(): Already called?",flashJS:f+": Attempting to call Flash from JS..",noPolling:f+": Polling (whileloading()/whileplaying() support) is disabled.",secNote:"Flash security note: Network/internet URLs will not load due to security restrictions. Access can be configured via Flash Player Global Security Settings Page: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html",badRemove:"Warning: Failed to remove flash movie.",noPeak:"Warning: peakData features unsupported for movieStar formats",shutdown:f+".disable(): Shutting down",queue:f+": Queueing %s handler",smFail:f+": Failed to initialise.",smError:"SMSound.load(): Exception: JS-Flash communication failed, or JS error.",fbTimeout:"No flash response, applying ."+e.swfCSS.swfTimedout+" CSS..",fbLoaded:"Flash loaded",fbHandler:g+"flashBlockHandler()",manURL:"SMSound.load(): Using manually-assigned URL",onURL:f+".load(): current URL already assigned.",badFV:f+'.flashVersion must be 8 or 9. "%s" is invalid. Reverting to %s.',as2loop:"Note: Setting stream:false so looping can work (flash 8 limitation)",noNSLoop:"Note: Looping not implemented for MovieStar formats",needfl9:"Note: Switching to flash 9, required for MP4 formats.",mfTimeout:"Setting flashLoadTimeout = 0 (infinite) for off-screen, mobile flash case",mfOn:"mobileFlash::enabling on-screen flash repositioning",policy:"Enabling usePolicyFile for data access"},Z=function(){var a=bt.call(arguments),b=a.shift(),c=J&&J[b]?J[b]:"",d,e;if(c&&a&&a.length)for(d=0,e=a.length;d<e;d++)c=c.replace("%s",a[d]);return c},bb=function(a){return m===8&&a.loops>1&&a.stream&&(y("as2loop"),a.stream=!1),a},bc=function(a,b){return a&&!a.usePolicyFile&&(a.onid3||a.usePeakData||a.useWaveformData||a.useEQData)&&(e._wD((b||"")+Z("policy")),a.usePolicyFile=!0),a},bd=function(a){typeof console!="undefined"&&typeof console.warn!="undefined"?console.warn(a):e._wD(a)},o=function(){return!1},U=function(a){var b;for(b in a)a.hasOwnProperty(b)&&typeof a[b]=="function"&&(a[b]=o);b=null},V=function(a){typeof a=="undefined"&&(a=!1);if(w||a)y("smFail",2),e.disable(a)},W=function(a){var b=null;if(a)if(a.match(/\.swf(\?.*)?$/i)){b=a.substr(a.toLowerCase().lastIndexOf(".swf?")+4);if(b)return a}else a.lastIndexOf("/")!==a.length-1&&(a+="/");return(a&&a.lastIndexOf("/")!==-1?a.substr(0,a.lastIndexOf("/")+1):"./")+e.movieURL},H=function(){m!==8&&m!==9&&(e._wD(Z("badFV",m,T)),e.flashVersion=T);var a=e.debugMode||e.debugFlash?"_debug.swf":".swf";e.useHTML5Audio&&!e.html5Only&&e.audioFormats.mp4.required&&e.flashVersion<9&&(e._wD(Z("needfl9")),e.flashVersion=9),m=e.flashVersion,e.version=e.versionNumber+(e.html5Only?" (HTML5-only mode)":m===9?" (AS3/Flash 9)":" (AS2/Flash 8)"),m>8&&(e.defaultOptions=B(e.defaultOptions,e.flash9Options),e.features.buffering=!0),m>8&&e.useMovieStar?(e.defaultOptions=B(e.defaultOptions,e.movieStarOptions),e.filePatterns.flash9=new RegExp("\\.(mp3|"+e.netStreamTypes.join("|")+")(\\?.*)?$","i"),e.mimePattern=e.netStreamMimeTypes,e.features.movieStar=!0):(e.useMovieStar=!1,e.features.movieStar=!1),e.filePattern=e.filePatterns[m!==8?"flash9":"flash8"],e.movieURL=(m===8?"soundmanager2.swf":"soundmanager2_flash9.swf").replace(".swf",a),e.features.peakData=e.features.waveformData=e.features.eqData=m>8},Q=function(a,b){if(!e.o||!e.allowPolling)return!1;e.o._setPolling(a,b)},R=function(){e.debugURLParam.test(l)&&(e.debugMode=!0);if(i(e.debugID))return!1;var a,b,c,d,f;if(e.debugMode&&!i(e.debugID)&&(!bH||!e.useConsole||e.useConsole&&bH&&!e.consoleOnly)){a=n.createElement("div"),a.id=e.debugID+"-toggle",d={position:"fixed",bottom:"0px",right:"0px",width:"1.2em",height:"1.2em",lineHeight:"1.2em",margin:"2px",textAlign:"center",border:"1px solid #999",cursor:"pointer",background:"#fff",color:"#333",zIndex:10001},a.appendChild(n.createTextNode("-")),a.onclick=ba,a.title="Toggle SM2 debug console",j.match(/msie 6/i)&&(a.style.position="absolute",a.style.cursor="hand");for(f in d)d.hasOwnProperty(f)&&(a.style[f]=d[f]);b=n.createElement("div"),b.id=e.debugID,b.style.display=e.debugMode?"block":"none";if(e.debugMode&&!i(a.id)){try{c=N(),c.appendChild(a)}catch(g){throw new Error(Z("domError")+" \n"+g.toString())}c.appendChild(b)}}c=null},be=this.getSoundById,y=function(a,b){return a?e._wD(Z(a),b):""},l.indexOf("sm2-debug=alert")+1&&e.debugMode&&(e._wD=function(b){a.alert(b)}),ba=function(){var a=i(e.debugID),b=i(e.debugID+"-toggle");if(!a)return!1;r?(b.innerHTML="+",a.style.display="none"):(b.innerHTML="-",a.style.display="block"),r=!r},s=function(a,b,c){if(typeof sm2Debugger!="undefined")try{sm2Debugger.handleEvent(a,b,c)}catch(d){}return!0},_=function(){var a=[];return e.debugMode&&a.push(e.swfCSS.sm2Debug),e.debugFlash&&a.push(e.swfCSS.flashDebug),e.useHighPerformance&&a.push(e.swfCSS.highPerf),a.join(" ")},$=function(){var a=Z("fbHandler"),b=e.getMoviePercent(),c=e.swfCSS,d={type:"FLASHBLOCK"};if(e.html5Only)return!1;e.ok()?(e.didFlashBlock&&e._wD(a+": Unblocked"),e.oMC&&(e.oMC.className=[_(),c.swfDefault,c.swfLoaded+(e.didFlashBlock?" "+c.swfUnblocked:"")].join(" "))):(bl&&(e.oMC.className=_()+" "+c.swfDefault+" "+(b===null?c.swfTimedout:c.swfError),e._wD(a+": "+Z("fbTimeout")+(b?" ("+Z("fbLoaded")+")":""))),e.didFlashBlock=!0,D({type:"ontimeout",ignoreInit:!0,error:d}),P(d))},C=function(a,b,c){typeof q[a]=="undefined"&&(q[a]=[]),q[a].push({method:b,scope:c||null,fired:!1})},D=function(a){a||(a={type:"onready"});if(!v&&a&&!a.ignoreInit)return!1;if(a.type==="ontimeout"&&e.ok())return!1;var b={success:a&&a.ignoreInit?e.ok():!w},c=a&&a.type?q[a.type]||[]:[],d=[],g,h,i=[b],j=bl&&e.useFlashBlock&&!e.ok();a.error&&(i[0].error=a.error);for(g=0,h=c.length;g<h;g++)c[g].fired!==!0&&d.push(c[g]);if(d.length){e._wD(f+": Firing "+d.length+" "+a.type+"() item"+(d.length===1?"":"s"));for(g=0,h=d.length;g<h;g++)d[g].scope?d[g].method.apply(d[g].scope,i):d[g].method.apply(this,i),j||(d[g].fired=!0)}return!0},E=function(){k.setTimeout(function(){e.useFlashBlock&&$(),D(),e.onload instanceof Function&&(y("onload",1),e.onload.apply(k),y("onloadOK",1)),e.waitForWindowLoad&&bs.add(k,"load",E)},1)},bw=function(){if(bv!==undefined)return bv;var a=!1,b=navigator,c=b.plugins,d,e,f,g=k.ActiveXObject;if(c&&c.length)e="application/x-shockwave-flash",f=b.mimeTypes,f&&f[e]&&f[e].enabledPlugin&&f[e].enabledPlugin.description&&(a=!0);else if(typeof g!="undefined"){try{d=new g("ShockwaveFlash.ShockwaveFlash")}catch(h){}a=!!d}return bv=a,a},bm=function(){var a,b,c=j.match(/iphone os (1|2|3_0|3_1)/i)?!0:!1;if(c)return e.hasHTML5=!1,e.html5Only=!0,e.oMC&&(e.oMC.style.display="none"),!1;if(!e.useHTML5Audio)return!0;if(!e.html5||!e.html5.canPlayType)return e._wD("SoundManager: No HTML5 Audio() support detected."),e.hasHTML5=!1,!0;e.hasHTML5=!0;if(bG){e._wD(g+"Note: Buggy HTML5 Audio in Safari on this OS X release, see https://bugs.webkit.org/show_bug.cgi?id=32159 - "+(bv?"will use flash fallback for MP3/MP4, if available":" would use flash fallback for MP3/MP4, but none detected."),1);if(bw())return!0}for(b in e.audioFormats)e.audioFormats.hasOwnProperty(b)&&(e.audioFormats[b].required&&!e.html5.canPlayType(e.audioFormats[b].type)||e.flash[b]||e.flash[e.audioFormats[b].type])&&(a=!0);return e.ignoreFlash&&(a=!1),e.html5Only=e.hasHTML5&&e.useHTML5Audio&&!a,!e.html5Only},bj=function(a){a._hasTimer||(a._hasTimer=!0)},bk=function(a){a._hasTimer&&(a._hasTimer=!1)},P=function(a){a=typeof a!="undefined"?a:{},e.onerror instanceof Function&&e.onerror.apply(k,[{type:typeof a.type!="undefined"?a.type:null}]),typeof a.fatal!="undefined"&&a.fatal&&e.disable()},bx=function(){if(!bG||!bw())return!1;var a=e.audioFormats,b,c;for(c in a)if(a.hasOwnProperty(c))if(c==="mp3"||c==="mp4"){e._wD(f+": Using flash fallback for "+c+" format"),e.html5[c]=!1;if(a[c]&&a[c].related)for(b=a[c].related.length;b--;)e.html5[a[c].related[b]]=!1}},this._setSandboxType=function(a){var b=e.sandbox;b.type=a,b.description=b.types[typeof b.types[a]!="undefined"?a:"unknown"],e._wD("Flash security sandbox type: "+b.type),b.type==="localWithFile"?(b.noRemote=!0,b.noLocal=!1,y("secNote",2)):b.type==="localWithNetwork"?(b.noRemote=!1,b.noLocal=!0):b.type==="localTrusted"&&(b.noRemote=!1,b.noLocal=!1)},this._externalInterfaceOK=function(a){if(e.swfLoaded)return!1;var b=(new Date).getTime();e._wD(g+"externalInterfaceOK()"+(a?" (~"+(b-a)+" ms)":"")),s("swf",!0),s("flashtojs",!0),e.swfLoaded=!0,bJ=!1,bG&&bx(),bC?setTimeout(p,100):p()},O=function(a,b){function c(){e._wD("-- SoundManager 2 "+e.version+(!e.html5Only&&e.useHTML5Audio?e.hasHTML5?" + HTML5 audio":", no HTML5 audio support":"")+(e.html5Only?"":(e.useMovieStar?", MovieStar mode":"")+(e.useHighPerformance?", high performance mode, ":", ")+((e.flashPollingInterval?"custom ("+e.flashPollingInterval+"ms)":e.useFastPolling?"fast":"normal")+" polling")+(e.wmode?", wmode: "+e.wmode:"")+(e.debugFlash?", flash debug mode":"")+(e.useFlashBlock?", flashBlock mode":""))+" --",1)}function C(a,b){return'<param name="'+a+'" value="'+b+'" />'}if(t&&u)return!1;if(e.html5Only)return H(),c(),e.oMC=i(e.movieID),p(),t=!0,u=!0,!1;var d=b||e.url,f=e.altURL||d,h="JS/Flash audio component (SoundManager 2)",k,l,m=N(),o,q,r,s=_(),v,w,x,z="auto",A=null,B=n.getElementsByTagName("html")[0];A=B&&B.dir&&B.dir.match(/rtl/i),a=typeof a=="undefined"?e.id:a,H(),e.url=W(bM?d:f),b=e.url,e.wmode=!e.wmode&&e.useHighPerformance&&!e.useMovieStar?"transparent":e.wmode,e.wmode!==null&&(j.match(/msie 8/i)||!bC&&!e.useHighPerformance)&&navigator.platform.match(/win32|win64/i)&&(e.specialWmodeCase=!0,y("spcWmode"),e.wmode=null),k={name:a,id:a,src:b,width:z,height:z,quality:"high",allowScriptAccess:e.allowScriptAccess,bgcolor:e.bgColor,pluginspage:bN+"//www.macromedia.com/go/getflashplayer",title:h,type:"application/x-shockwave-flash",wmode:e.wmode,hasPriority:"true"},e.debugFlash&&(k.FlashVars="debug=1"),e.wmode||delete k.wmode;if(bC)l=n.createElement("div"),q=['<object id="'+a+'" data="'+b+'" type="'+k.type+'" title="'+k.title+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="'+bN+'//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="'+k.width+'" height="'+k.height+'">',C("movie",b),C("AllowScriptAccess",e.allowScriptAccess),C("quality",k.quality),e.wmode?C("wmode",e.wmode):"",C("bgcolor",e.bgColor),C("hasPriority","true"),e.debugFlash?C("FlashVars",k.FlashVars):"","</object>"].join("");else{l=n.createElement("embed");for(o in k)k.hasOwnProperty(o)&&l.setAttribute(o,k[o])}R(),s=_(),m=N();if(m){e.oMC=i(e.movieID)||n.createElement("div");if(!e.oMC.id){e.oMC.id=e.movieID,e.oMC.className=e.swfCSS.swfDefault+" "+s,v=null,r=null,e.useFlashBlock||(e.useHighPerformance?v={position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"hidden"}:(v={position:"absolute",width:"6px",height:"6px",top:"-9999px",left:"-9999px"},A&&(v.left=Math.abs(parseInt(v.left,10))+"px"))),bD&&(e.oMC.style.zIndex=1e4);if(!e.debugFlash)for(w in v)v.hasOwnProperty(w)&&(e.oMC.style[w]=v[w]);try{bC||e.oMC.appendChild(l),m.appendChild(e.oMC),bC&&(r=e.oMC.appendChild(n.createElement("div")),r.className=e.swfCSS.swfBox,r.innerHTML=q),u=!0}catch(D){throw new Error(Z("domError")+" \n"+D.toString())}}else x=e.oMC.className,e.oMC.className=(x?x+" ":e.swfCSS.swfDefault)+(s?" "+s:""),e.oMC.appendChild(l),bC&&(r=e.oMC.appendChild(n.createElement("div")),r.className=e.swfCSS.swfBox,r.innerHTML=q),u=!0}return t=!0,c(),e._wD(g+"createMovie(): Trying to load "+b+(!bM&&e.altURL?" (alternate URL)":""),1),!0},K=function(){return e.html5Only?(O(),!1):e.o?!1:(e.o=e.getMovie(e.id),e.o||(X?(bC?e.oMC.innerHTML=Y:e.oMC.appendChild(X),X=null,t=!0):O(e.id,e.url),e.o=e.getMovie(e.id)),e.o&&y("waitEI"),e.oninitmovie instanceof Function&&setTimeout(e.oninitmovie,1),!0)},F=function(){setTimeout(G,1e3)},G=function(){if(bf)return!1;bf=!0,bs.remove(k,"load",F);if(bJ&&!bI)return y("waitFocus"),!1;var a;v||(a=e.getMoviePercent(),e._wD(Z("waitImpatient",a===100?" (SWF loaded)":a>0?" (SWF "+a+"% loaded)":""))),setTimeout(function(){a=e.getMoviePercent(),v||(e._wD(f+": No Flash response within expected time.\nLikely causes: "+(a===0?"Loading "+e.movieURL+" may have failed (and/or Flash "+m+"+ not present?), ":"")+"Flash blocked or JS-Flash security error."+(e.debugFlash?" "+Z("checkSWF"):""),2),!bM&&a&&(y("localFail",2),e.debugFlash||y("tryDebug",2)),a===0&&e._wD(Z("swf404",e.url)),s("flashtojs",!1,": Timed out"+bM?" (Check flash security or flash blockers)":" (No plugin/missing SWF?)")),!v&&bK&&(a===null?e.useFlashBlock||e.flashLoadTimeout===0?(e.useFlashBlock&&$(),y("waitForever")):V(!0):e.flashLoadTimeout===0?y("waitForever"):V(!0))},e.flashLoadTimeout)},I=function(){function a(){bs.remove(k,"focus",I),bs.remove(k,"load",I)}return bI||!bJ?(a(),!0):(bK=!0,bI=!0,e._wD(g+"handleFocus()"),bE&&bJ&&bs.remove(k,"mousemove",I),bf=!1,a(),!0)},A=function(a){if(v)return!1;if(e.html5Only)return e._wD("-- SoundManager 2: loaded --"),v=!0,E(),s("onload",!0),!0;var b=e.useFlashBlock&&e.flashLoadTimeout&&!e.getMoviePercent(),c;return b||(v=!0,w&&(c={type:!bv&&bl?"NO_FLASH":"INIT_TIMEOUT"})),e._wD("-- SoundManager 2 "+(w?"failed to load":"loaded")+" ("+(w?"security/load error":"OK")+") --",1),w||a?(e.useFlashBlock&&e.oMC&&(e.oMC.className=_()+" "+(e.getMoviePercent()===null?e.swfCSS.swfTimedout:e.swfCSS.swfError)),D({type:"ontimeout",error:c}),s("onload",!1),P(c),!1):(s("onload",!0),bs.add(k,"unload",o),e.waitForWindowLoad&&!x?(y("waitOnload"),bs.add(k,"load",E),!1):(e.waitForWindowLoad&&x&&y("docLoaded"),E(),!0))},bz=function(){var a,b=[];if(e.useHTML5Audio&&e.hasHTML5){for(a in e.audioFormats)e.audioFormats.hasOwnProperty(a)&&b.push(a+": "+e.html5[a]+(!e.html5[a]&&bv&&e.flash[a]?" (using flash)":e.preferFlash&&e.flash[a]&&bv?" (preferring flash)":e.html5[a]?"":" ("+(e.audioFormats[a].required?"required, ":"")+"and no flash support)"));e._wD("-- SoundManager 2: HTML5 support tests ("+e.html5Test+"): "+b.join(", ")+" --",1)}},p=function(){function a(){bs.remove(k,"load",e.beginDelayedInit)}y("init");if(v)return y("didInit"),!1;if(e.html5Only)return v||(a(),e.enabled=!0,A()),!0;K();try{y("flashJS"),e.o._externalInterfaceTest(!1),e.allowPolling?Q(!0,e.flashPollingInterval||(e.useFastPolling?10:50)):y("noPolling",1),e.debugMode||e.o._disableDebug(),e.enabled=!0,s("jstoflash",!0)}catch(b){return e._wD("js/flash exception: "+b.toString()),s("jstoflash",!1),P({type:"JS_TO_FLASH_EXCEPTION",fatal:!0}),V(!0),A(),!1}return A(),a(),!0},L=function(){return M?!1:(M=!0,R(),function(){var a="sm2-usehtml5audio=",b=l.toLowerCase(),c=null,d="sm2-preferflash=",f=null,g=typeof console!="undefined"&&typeof console.log!="undefined";b.indexOf(a)!==-1&&(c=b.charAt(b.indexOf(a)+a.length)==="1",g&&console.log((c?"Enabling ":"Disabling ")+"useHTML5Audio via URL parameter"),e.useHTML5Audio=c),b.indexOf(d)!==-1&&(f=b.charAt(b.indexOf(d)+d.length)==="1",g&&console.log((f?"Enabling ":"Disabling ")+"preferFlash via URL parameter"),e.preferFlash=f)}(),!bv&&e.hasHTML5&&(e._wD("SoundManager: No Flash detected"+(e.useHTML5Audio?". Trying HTML5-only mode.":", enabling HTML5.")),e.useHTML5Audio=!0,e.preferFlash=!1),br(),e.html5.usingFlash=bm(),bl=e.html5.usingFlash,bz(),!bv&&bl&&(e._wD("SoundManager: Fatal error: Flash is needed to play some required formats, but is not available."),e.flashLoadTimeout=1),n.removeEventListener&&n.removeEventListener("DOMContentLoaded",L,!1),K(),!0)},bq=function(){return n.readyState==="complete"&&(L(),n.detachEvent("onreadystatechange",bq)),!0},bw(),bs.add(k,"focus",I),bs.add(k,"load",I),bs.add(k,"load",F),bE&&bJ&&bs.add(k,"mousemove",I),n.addEventListener?n.addEventListener("DOMContentLoaded",L,!1):n.attachEvent?n.attachEvent("onreadystatechange",bq):(s("onload",!1),P({type:"NO_DOM2_EVENTS",fatal:!0})),n.readyState==="complete"&&setTimeout(L,100)}var b=null;if(typeof SM2_DEFER=="undefined"||!SM2_DEFER)b=new c;a.SoundManager=c,a.soundManager=b})(window),soundManager.flashVersion=9,soundManager.preferFlash=!0,soundManager.useHighPerformance=!0,soundManager.wmode="transparent",soundManager.debugMode=!0,soundManager.debugMode=!1,soundManager.url="/swf",function(a){a.fn.tipsy=function(b){return b=a.extend({},a.fn.tipsy.defaults,b),this.each(function(){var c=a.fn.tipsy.elementOptions(this,b);a(this).hover(function(){a.data(this,"cancel.twipsy",!0);var b=a.data(this,"active.twipsy");b||(b=a('<div class="twipsy above"><div class="twipsy-arrow"></div><div class="twipsy-inner"/></div>'),b.css({position:"absolute",zIndex:1e5}),a.data(this,"active.twipsy",b)),(a(this).attr("title")||typeof a(this).attr("original-title")!="string")&&a(this).attr("original-title",a(this).attr("title")||"").removeAttr("title");var d;typeof c.title=="string"?d=a(this).attr(c.title=="title"?"original-title":c.title):typeof c.title=="function"&&(d=c.title.call(this)),b.find(".twipsy-inner")[c.html?"html":"text"](d||c.fallback);var e=a.extend({},a(this).offset(),{width:this.offsetWidth,height:this.offsetHeight});b.get(0).className="twipsy",b.remove().css({top:0,left:0,visibility:"hidden",display:"block"}).appendTo(document.body);var f=b[0].offsetWidth,g=b[0].offsetHeight,h=typeof c.gravity=="function"?c.gravity.call(this):c.gravity;switch(h.charAt(0)){case"n":b.css({top:e.top+e.height,left:e.left+e.width/2-f/2}).addClass("twipsy-north");break;case"s":b.css({top:e.top-g,left:e.left+e.width/2-f/2}).addClass("above");break;case"e":b.css({top:e.top+e.height/2-g/2,left:e.left-f}).addClass("twipsy-east");break;case"w":b.css({top:e.top+e.height/2-g/2,left:e.left+e.width}).addClass("twipsy-west")}c.fade?b.css({opacity:0,display:"block",visibility:"visible"}).animate({opacity:.8}):b.css({visibility:"visible"})},function(){a.data(this,"cancel.twipsy",!1);var b=this;setTimeout(function(){if(a.data(this,"cancel.twipsy"))return;var d=a.data(b,"active.twipsy");c.fade?d.stop().fadeOut(function(){a(this).remove()}):d.remove()},100)})})},a.fn.tipsy.elementOptions=function(b,c){return a.metadata?a.extend({},c,a(b).metadata()):c},a.fn.tipsy.defaults={fade:!1,fallback:"",gravity:"s",html:!1,title:"title"},a.fn.tipsy.autoNS=function(){return a(this).offset().top>a(document).scrollTop()+a(window).height()/2?"s":"n"},a.fn.tipsy.autoWE=function(){return a(this).offset().left>a(document).scrollLeft()+a(window).width()/2?"e":"w"}}(jQuery),!function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype={constructor:c,close:function(b){function f(){e.remove(),e.trigger("closed")}var c=a(this),d=c.attr("data-target"),e;d||(d=c.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),e=a(d),e.trigger("close"),b&&b.preventDefault(),e.length||(e=c.hasClass("alert")?c:c.parent()),e.removeClass("in"),a.support.transition&&e.hasClass("fade")?e.on(a.support.transition.end,f):f()}},a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("alert");e||d.data("alert",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.alert.Constructor=c,a(function(){a("body").on("click.alert.data-api",b,c.prototype.close)})}(window.jQuery),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.Source=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.urlRoot="/sources",c.prototype.initialize=function(a){a==null&&(a={})},c}(Backbone.Model)}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.Artist=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.initialize=function(){},c}(Backbone.Model)}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.Favorite=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.url="/favorites",c}(Backbone.Model)}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.HomeModel=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.urlRoot="/",c.prototype.initialize=function(a){return a==null&&(a={}),this.fetched=!1,this.bind("change:mixes",function(a){return tm.collections.mixes.reset(a.get("mixes"))}),this.bind("change:picks",function(a){return tm.collections.picks.reset(a.get("picks"))})},c.prototype.fetch=function(a){return a==null&&(a={}),this.fetched&&_.isFunction(a.success)?a.success():(this.fetched=!0,c.__super__.fetch.call(this,a))},c.prototype.setup=function(a){return this.fetched=!0,this.set(a)},c}(Backbone.Model)}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.Listen=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.urlRoot="/listens",c.prototype.finish=function(){return this.save({finished_at:new Date})},c}(Backbone.Model)}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};tm.em||(tm.em=_.extend({},Backbone.Events)),window.Mix=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.urlRoot="/mixes",c.prototype.initialize=function(){return tm.em.on("tm:player:play",this.play,this),tm.em.on("tm:player:finish",this.finish,this)},c.prototype.finish=function(){return this.set({listen_state:"finished"})},c.prototype.play=function(){return this.set({listen_state:"started"})},c.prototype.before=function(){var a;return(a=this.collection)!=null?a.before(this):void 0},c.prototype.after=function(){var a;return(a=this.collection)!=null?a.after(this):void 0},c}(Backbone.Model),Mix.find=function(a,b){var c;if(tm.collections.mixes)return c=tm.collections.mixes.get(a),c?b(c):(c=new Mix,c.id=a,c.fetch({success:function(a){return b(a)}}))}}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.Podcast=function(a){function c(){c.__super__
.constructor.apply(this,arguments)}return b(c,a),c.prototype.urlRoot="/podcasts",c.prototype.initialize=function(a){return a==null&&(a={}),this.mixes=new Mixes},c.prototype.parse=function(a){return a.mixes&&(this.mixes.reset(a.mixes),this.mixes.url="/podcasts/"+this.id+"/mixes",delete a.mixes),a},c}(Source)}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.Search=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.urlRoot="/searches",c.prototype.defaults={genres:["uplifting","progressive","vocal","techno","tech","trance","bigroom","psy","j00f"],page:1},c.prototype.initialize=function(a){a==null&&(a={})},c.prototype.addGenre=function(a){var b;return b=this.get("genres"),b.push(a),this.save({genres:b})},c.prototype.removeGenre=function(a){var b;return b=this.get("genres"),this.save({genres:_.without(b,a)})},c.prototype.toggleGenre=function(a,b){return b?this.addGenre(a):this.removeGenre(a)},c.prototype.selectGenre=function(a){return this.save({genres:[a]})},c.prototype.showGenre=function(a,b){return this.save({genres:[a]},{success:b})},c.prototype.clear=function(){return this.save(this.defaults)},c.prototype.parse=function(a){return this.mixes.reset(a.mixes),delete a.mixes,a},c.prototype.toJSON=function(){var a;return a=_.clone(this.attributes),delete a.mixes,{search:a}},c}(Backbone.Model)}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.Video=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.urlRoot="/videos",c.prototype.initialize=function(a){a==null&&(a={})},c}(Backbone.Model)}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.Cached=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.fetch=function(a){return a==null&&(a={}),this.fetched&&_.isFunction(a.success)?a.success():(this.fetched=!0,c.__super__.fetch.call(this,a))},c}(Backbone.Collection)}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.Artists=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.page=1,c.prototype.model=Artist,c.prototype.url="/artists",c}(Cached)}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.Listens=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.url="/listens",c.prototype.model=Listen,c.prototype.initialize=function(a){return tm.em.bind("tm:player:play",this.createListen,this),tm.em.on("tm:player:finish",this.finishMix,this)},c.prototype.createListen=function(a){var b,c;return c={id:a.id,title:a.get("title")},b=this.create({mix_id:a.id,mix:c},{at:0}),a.listen=b},c.prototype.finishMix=function(a){if(a!=null?a.listen:void 0)return a.listen.finish()},c}(Backbone.Collection)}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.Mixes=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.page=1,c.prototype.per_page=50,c.prototype.model=Mix,c.prototype.url="/mixes",c.prototype.initialize=function(a){var b=this;a==null&&(a={});if(a.search)return this.search=a.search,this.search.mixes=this,this.search.bind("change",function(){return b.page=1})},c.prototype.nextPage=function(a){var b=this;if(!this.fetching)return this.fetching=!0,this.fetch({add:!0,data:{page:++this.page},success:function(c,d){b.fetching=!1,a(arguments);if(d.length<b.per_page)return c.trigger("last-page")}})},c.prototype.after=function(a){var b;b=this.indexOf(a);if(b===-1)return;return b+=1,b>=this.size()&&(b=0),this.at(b)},c.prototype.before=function(a){var b;b=this.indexOf(a);if(b===-1)return;return b-=1,b<0&&(b=this.size()-1),this.at(b)},c}(Backbone.Collection)}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.Podcasts=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.url="/podcasts",c.prototype.model=Podcast,c}(Cached)}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.Videos=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.url="/videos",c.prototype.page=1,c.prototype.per_page=12,c.prototype.model=Video,c.prototype.nextPage=function(a){var b=this;if(!this.fetching)return this.fetching=!0,this.fetch({add:!0,data:{page:++this.page},success:function(c,d){b.fetching=!1,a(arguments);if(d.length<b.per_page)return c.trigger("last-page")}})},c.prototype.after=function(a){var b;b=this.indexOf(a);if(b===-1)return;return b+=1,b>=this.size()&&(b=0),this.at(b)},c.prototype.before=function(a){var b;b=this.indexOf(a);if(b===-1)return;return b-=1,b<0&&(b=this.size()-1),this.at(b)},c}(Backbone.Collection)}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b=Object.prototype.hasOwnProperty,c=function(a,c){function e(){this.constructor=a}for(var d in c)b.call(c,d)&&(a[d]=c[d]);return e.prototype=c.prototype,a.prototype=new e,a.__super__=c.prototype,a};window.BaseMixView=function(b){function d(){this.setMix=a(this.setMix,this),this.navigate=a(this.navigate,this),this.play=a(this.play,this),d.__super__.constructor.apply(this,arguments)}return c(d,b),d.prototype.play=function(a){return tm.player.playMix(this.mix),a.preventDefault(),a.stopPropagation()},d.prototype.navigate=function(a){return tm.app.navigateEvent(a)},d.prototype.setMix=function(a){return this.mix=a,this.mix.view=this,this.mix.bind("play",this.render,this)},d}(Backbone.View)}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b=Object.prototype.hasOwnProperty,c=function(a,c){function e(){this.constructor=a}for(var d in c)b.call(c,d)&&(a[d]=c[d]);return e.prototype=c.prototype,a.prototype=new e,a.__super__=c.prototype,a};window.TranceView=function(b){function d(){this.setPlaying=a(this.setPlaying,this),this.setPlayingId=a(this.setPlayingId,this),this.navigate=a(this.navigate,this),this.play=a(this.play,this),this.mouseleave=a(this.mouseleave,this),this.mouseenter=a(this.mouseenter,this),d.__super__.constructor.apply(this,arguments)}return c(d,b),d.prototype.events=function(){return{"click .play":"play","click .show":"navigate","click .navigate":"navigate","mouseenter .mix":"mouseenter","mouseleave .mix":"mouseleave"}},d.prototype.mouseenter=function(a){return this.$(a.currentTarget).addClass("hover")},d.prototype.mouseleave=function(a){return this.$(a.currentTarget).removeClass("hover")},d.prototype.play=function(a){var b,c,d=this;return a.preventDefault(),a.stopPropagation(),b=$(a.currentTarget),c=b.data("id"),this.setPlayingId(c),Mix.find(c,function(a){return tm.player.playMix(a)})},d.prototype.navigate=function(a){return tm.app.navigateEvent(a)},d.prototype.setPlayingId=function(a){return $(".playing").removeClass("playing"),$(".mix[data-id="+a+"]").addClass("playing").removeClass("new").addClass("started"),$("#mix-page[data-id="+a+"]").addClass("playing")},d.prototype.highlightPlaying=function(){if(!_.isUndefined(tm.player.mix))return this.setPlayingId(tm.player.mix.id)},d.prototype.setPlaying=function(a){if(!a)return;return this.setPlayingId(a.id)},d}(Backbone.View)}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.MixView=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.className="mix",c.prototype.initialize=function(a){return a==null&&(a={}),this.template=HandlebarsTemplates["templates/mixes/mix"],this.setMix(a.mix)},c.prototype.render=function(){return $(this.el).html(this.template(this.mix.toJSON())),$(this.el).data("id",this.mix.id),$(this.el).addClass(this.mix.get("listen_state")),tm.player.playingMix(this.mix)&&$(this.el).addClass("playing"),this},c}(BaseMixView)}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.ArtistPageView=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.id="artist-page-view",c.prototype.initialize=function(a){return this.template=HandlebarsTemplates["templates/artists/show"]},c.prototype.render=function(){return $(this.el).html(this.template(this.toJSON())),this},c.prototype.setArtist=function(a){return this.artist=a,this.render()},c.prototype.toJSON=function(){return this.artist.toJSON()},c}(TranceView)}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.ArtistsPageView=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.id="artists-page-view",c.prototype.events={"click table a":"navigate"},c.prototype.initialize=function(){return this.template=HandlebarsTemplates["templates/artists/index"],this.artists=this.options.artists,this.artists.bind("reset",this.render,this)},c.prototype.render=function(){return $(this.el).html(this.template(this.toJSON())),this},c.prototype.toJSON=function(){return{artists:this.artists.toJSON()}},c.prototype.navigate=function(a){return this.options.router.navigateEvent(a)},c}(Backbone.View)}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.GenreFilterView=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.events={"click a[data-genre]":"click","click a.clear":"clear"},c.prototype.initialize=function(a){return a==null&&(a={}),this.template=HandlebarsTemplates["templates/home/genres"],this.search=a.search,this.search.bind("change",this.render,this)},c.prototype.render=function(){return $(this.el).html(this.template(this.context())),this},c.prototype.click=function(a){var b,c;return b=$(a.currentTarget),c=b.data("genre"),tm.app.navigateEventMouseSpinner(a),tm.models.search.showGenre(c),!1},c.prototype.clear=function(a){return this.search.clear(),tm.app.navigateEventMouseSpinner(a),!1},c.prototype.context=function(){var a,b,c,d,e,f,g,h,i;f=[],a=this.search.get("genres"),i=tm.genres;for(g=0,h=i.length;g<h;g++)d=i[g],e={name:d,active:""},_.include(a,d)&&(e.active="active"),f.push(e);return b=_.all(f,function(a){return a.active==="active"}),c=b?"":"active",{genres:f,search_id:this.search.id,clear_active:c}},c}(Backbone.View)}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b=Object.prototype.hasOwnProperty,c=function(a,c){function e(){this.constructor=a}for(var d in c)b.call(c,d)&&(a[d]=c[d]);return e.prototype=c.prototype,a.prototype=new e,a.__super__=c.prototype,a};window.HomeView=function(b){function d(){this.load=a(this.load,this),this.render=a(this.render,this),d.__super__.constructor.apply(this,arguments)}return c(d,b),d.prototype.id="home-page",d.prototype.className="HomeView",d.prototype.fetched=!1,d.prototype.events={"click #load":"load"},d.prototype.initialize=function(a){var b=this;return a==null&&(a={}),this.template=HandlebarsTemplates["templates/home/index"],this.home=a.home,this.mixes=tm.collections.mixes,this.picks=tm.collections.picks,tm.em.on("tm:window_snapped_bottom",function(){if($(b.el).is(":visible"))return b.load()}),this.initializeSubViews()},d.prototype.initializeSubViews=function(){return $(this.el).html(this.template()),this.genreFilterView=new GenreFilterView({el:this.$("#genres"),search:tm.models.search}),this.mixesView=new MixesView({el:this.$("#mixes .mixes"),mixes:this.mixes}),this.staffView=new MixesView({el:this.$("#staff .mixes"),mixes:this.picks}),this.loadmore=new Loadmore(this),this.loadmore.collection=tm.collections.mixes},d.prototype.render=function(){return this.genreFilterView.render(),this.mixesView.render(),this.staffView.render(),this},d.prototype.load=function(a){return this.loadmore.load(a),!1},d}(Backbone.View)}.call(this),function(){var a,b,c=Object.prototype.hasOwnProperty,d=function(a,b){function e(){this.constructor=a}for(var d in b)c.call(b,d)&&(a[d]=b[d]);return e.prototype=b.prototype,a.prototype=new e,a.__super__=b.prototype,a};window.ListensMenuView=function(b){function c(){c.__super__.constructor.apply(this,arguments)}return d(c,b),c.prototype.className="ListensMenuView",c.prototype.initialize=function(a){return this.listens=a.listens,this.listens.bind("add",this.addListen,this),this.listens.bind("reset",this.render,this)},c.prototype.render=function(){var b=this;return $(this.el).empty(),this.listens.each(function(c){var d;return d=new a({model:c}),$(b.el).append(d.render().el)}),this},c.prototype.addListen=function(b){var c;c=new a({model:b}),$(this.el).prepend(c.render().el);if(this.$(".ListensMenuItemView").length>20)return this.$(".ListensMenuItemView").last().remove()},c}(Backbone.View),a=function(a){function b(){b.__super__.constructor.apply(this,arguments)}return d(b,a),b.prototype.tagName="li",b.prototype.className="ListensMenuItemView",b.prototype.events={"click a":"navigate"},b.prototype.initialize=function(a){return this.template=HandlebarsTemplates["templates/listens/menu_item"],this.model.bind("change",this.render,this)},b.prototype.render=function(){return this.model.get("mix")?$(this.el).html(this.template(this.context())):$(this.el).empty(),this},b.prototype.context=function(){return{id:this.model.get("mix").id,title:this.model.get("mix").title,thumb:this.model.get("mix").thumb}},b.prototype.navigate=function(a){return tm.app.navigateEvent(a),!1},b}(Backbone.View),b=function(a){function b(){b.__super__.constructor.apply(this,arguments)}return d(b,a),b.prototype.events={"click a":"navigate"},b.prototype.render=function(){return $(this.el).html('<li class="divider"></li><li><a href="/listens">more listens</a>'),this},b.prototype.navigate=function(a){return tm.app.navigateEvent(a),!1},b}(Backbone.View)}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b=Object.prototype.hasOwnProperty,c=function(a,c){function e(){this.constructor=a}for(var d in c)b.call(c,d)&&(a[d]=c[d]);return e.prototype=c.prototype,a.prototype=new e,a.__super__=c.prototype,a};window.ListensView=function(b){function d(){this.addListen=a(this.addListen,this),this.render=a(this.render,this),d.__super__.constructor.apply(this,arguments)}return c(d,b),d.prototype.id="listens-page",d.prototype.className="ListensView",d.prototype.initialize=function(a){return a==null&&(a={}),this.template=HandlebarsTemplates["templates/listens/index"],this.trTemplate=HandlebarsTemplates["templates/listens/tr"],this.listens=a.listens,this.listens.bind("reset",this.render,this),this.listens.bind("add",this.addListen)},d.prototype.render=function(){return $(this.el).html(this.template(this.context())),this.highlightPlaying(),this},d.prototype.addListen=function(a){var b=this;return a.bind("change:mix",function(){var c;return a.unbind("change:mix"),b.denormalizeListen(a),c=$(b.trTemplate(a.get("mix"))),b.$(".mixes").prepend(c.hide().fadeIn()),b.highlightPlaying()})},d.prototype.context=function(){return this.listens.each(this.denormalizeListen),{listens:this.listens.toJSON()}},d.prototype.shortContext=function(){var a,b;this.listens.each(this.denormalizeListen),b=[];for(a=0;a<=10;a++)b.push(this.listens.at(a).toJSON());return{listens:b}},d.prototype.denormalizeListen=function(a){var b;if(a.has("mix"))return b=a.get("mix"),b.started_at=a.get("started_at"),b.finished_at=a.get("finished_at")},d}(TranceView)}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.MixPageView=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.id="mix-page",c.prototype.className="MixPageView",c.prototype.events={"click .play":"play","click .navigate":"navigate","click #next":"next","click #prev":"prev"},c.prototype.initialize=function(a){return this.template=HandlebarsTemplates["templates/mixes/show"],tm.em.on("tm:player:play",this.onPlayerPlay,this)},c.prototype.render=function(){return $(this.el).html(this.template(this.mix.toJSON())),this.togglePlayingClass(),this.toggleBeforeAfter(),this},c.prototype.play=function(a){return tm.player.playMix(this.mix),!1},c.prototype.setMix=function(a){if(!a)return;return this.mix=a,$(this.el).attr("data-id",a.id),this.render()},c.prototype.togglePlayingClass=function(){return $(this.el).toggleClass("playing",tm.player.playingMix(this.mix))},c.prototype.toggleBeforeAfter=function(){return this.$("#prev").toggle(!!this.mix.before()),this.$("#next").toggle(!!this.mix.after())},c.prototype.onPlayerPlay=function(a){if(this.mix&&this.mix.id===a.id)return $(this.el).addClass("playing")},c.prototype.navigate=function(a){return tm.app.navigateEvent(a)},c.prototype.next=function(a){var b;return b=this.mix.after(),tm.app.navigate("/mixes/"+b.id,!0),!1},c.prototype.prev=function(a){var b;return b=this.mix.before(),tm.app.navigate("/mixes/"+b.id,!0),!1},c}(Backbone.View)}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b=Object.prototype.hasOwnProperty,c=function(a,c){function e(){this.constructor=a}for(var d in c)b.call(c,d)&&(a[d]=c[d]);return e.prototype=c.prototype,a.prototype=new e,a.__super__=c.prototype,a};window.MixesView=function(b){function d(){this.addMix=a(this.addMix,this),this.setMixes=a(this.setMixes,this),this.render=a(this.render,this),d.__super__.constructor.apply(this,arguments)}return c(d,b),d.prototype.stache="templates/mixes/mixes",d.prototype.subView=MixView,d.prototype.initialize=function(a){return a==null&&(a={}),this.template=HandlebarsTemplates[this.stache],this.setMixes(a.mixes)},d.prototype.render=function(){return $(this.el).html(this.template({mixes:this.mixes.toJSON()})),this.setPlaying(tm.player.mix),this},d.prototype.setMixes=function(a){return this.mixes=a,this.mixes.bind("add",this.addMix),this.mixes.bind("reset",this.render)},d.prototype.addMix=function(a){return $(this.el).append((new this.subView({mix:a})).render().el)},d}(TranceView)}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b=Object.prototype.hasOwnProperty,c=function(a,c){function e(){this.constructor=a}for(var d in c)b.call(c,d)&&(a[d]=c[d]);return e.prototype=c.prototype,a.prototype=new e,a.__super__=c.prototype,a};window.PlayerPlayPauseView=function(b){function d(){this.handleClick=a(this.handleClick,this),d.__super__.constructor.apply(this,arguments)}return c(d,b),d.prototype.events={"click a":"handleClick"},d.prototype.initialize=function(a){return this.template=HandlebarsTemplates["templates/player/play_pause"],this.player=a.player,this.player.bind("play",this.play,this),this.player.bind("resume",this.play,this),this.player.bind("stop",this.pause,this),this.player.bind("pause",this.pause,this),this.player.bind("finish",this.finish,this)},d.prototype.render=function(){return $(this.el).html(this.template())},d.prototype.play=function(){return this.toggleButton(!1)},d.prototype.pause=function(){return this.toggleButton(!0)},d.prototype.finish=function(){return this.toggleButton(!0)},d.prototype.handleClick=function(a){return a.preventDefault(),this.player.togglePlaying()},d.prototype.toggleButton=function(a){return this.$("a.play").toggle(a),this.$("a.pause").toggle(!a)},d}(Backbone.View)}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.PlayerMixView=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.events={click:"show"},c.prototype.initialize=function(a){return a==null&&(a={}),this.player=a.player,this.template=HandlebarsTemplates["templates/player/mix"]},c.prototype.render=function(){return this.player.mix&&$(this.el).html(this.template(this.player.mix.toJSON())),this},c.prototype.setMix=function(a){return this.mix=a},c.prototype.show=function(a){return tm.app.navigate("/mixes/"+this.mix.id,!0),!1},c}(Backbone.View)}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.PlayerProgressBarView=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.events={"mouseup   .progress-container":"mouseup","mousedown .progress-container":"mousedown","mousemove .progress-container":"mousemove"},c.prototype.initialize=function(a){return a==null&&(a={}),this.player=a.player,this.template=HandlebarsTemplates["templates/player/progress_bar"]},c.prototype.setMix=function(a){return this.mix=a},c.prototype.mouseup=function(a){var b;return b=this.getX(a),this.scrubbed(b),this.scrubbing=!1},c.prototype.mousedown=function(a){return a.preventDefault(),this.scrubbing=!0},c.prototype.mousemove=function(a){var b;return a.preventDefault(),b=this.getX(a),this.scrubbed(b)},c.prototype.scrubbed=function(a){if(this.scrubbing)return this.player.setPosition(a/this.width*this.duration)},c.prototype.render=function(){return this.player.mix&&$(this.el).html(this.template(this.player.mix.toJSON())),this.grabElements()},c.prototype.grabElements=function(){var a;return a=this.$(".progress-bar"),this.loading=a.find(".loading"),this.progress=a.find(".progress"),this.width=a.width(),this.$current=this.progress.find(".current")},c.prototype.renderUpdate=function(){return this.progress.css({width:this.progressed*this.width}),this.loading.css({width:this.loaded*this.width}),this.$current.text(Helpers.formated_hms(this.current))},c.prototype.update=function(a){return this.duration=a.durationEstimate,this.current=a.position,this.progressed=a.position/a.durationEstimate,this.loaded=a.bytesLoaded/a.bytesTotal,this.renderUpdate()},c.prototype.getX=function(a){return a.pageX-$(a.currentTarget).offset().left},c}(Backbone.View)}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.PlayerView=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.initialize=function(a){return a==null&&(a={}),this.player=a.player,this.mixView=new PlayerMixView({el:this.$("#current_mix"),player:this.player}),this.progressView=new PlayerProgressBarView({el:this.$("#progress_bar"),player:this.player}),this.playPauseView=new PlayerPlayPauseView({el:this.$("#controls"),player:this.player}),this.volumeView=new PlayerVolumeView({el:$("#volume"),player:this.player}),this.volumeView.render()},c.prototype.render=function(){return this.mixView.render(),this.volumeView.render(),this.progressView.render(),this.playPauseView.render(),$(this.el).hide().fadeIn()},c.prototype.setMix=function(a){return this.mix=a,this.mixView.setMix(a),this.progressView.setMix(a),this.render()},c.prototype.whileplaying=function(a){return this.progressView.update(a)},c}(Backbone.View)}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b=Object.prototype.hasOwnProperty,c=function(a,c){function e(){this.constructor=a}for(var d in c)b.call(c,d)&&(a[d]=c[d]);return e.prototype=c.prototype,a.prototype=new e,a.__super__=c.prototype,a};window.PlayerVolumeView=function(b){function d(){this.slide=a(this.slide,this),this.sliderConfig=a(this.sliderConfig,this),this.render=a(this.render,this),d.__super__.constructor.apply(this,arguments)}return c(d,b),d.prototype.events={"hover .box":"hover","click img":"click"},d.prototype.initialize=function(a){return this.player=a.player},d.prototype.render=function(){return this.$(".slider").slider(this.sliderConfig())},d.prototype.sliderConfig=function(){return{min:0,max:100,value:this.volume(),range:"min",slide:this.slide,orientation:"vertical"}},d.prototype.click=function(a){return $(this.el).toggleClass("hover")},d.prototype.hover=function(a){},d.prototype.slide=function(a,b){return this.player.setVolume(b.value)},d.prototype.volume=function(){return this.player.volume},d}(Backbone.View)}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b=Object.prototype.hasOwnProperty,c=function(a,c){function e(){this.constructor=a}for(var d in c)b.call(c,d)&&(a[d]=c[d]);return e.prototype=c.prototype,a.prototype=new e,a.__super__=c.prototype,a};window.PodcastsPageView=function(b){function d(){this.render=a(this.render,this),d.__super__.constructor.apply(this,arguments)}return c(d,b),d.prototype.id="podcasts-page",d.prototype.className="PodcastsPageView",d.prototype.events={"click .navigate":"navigate"},d.prototype.initialize=function(a){return a==null&&(a={}),this.template=HandlebarsTemplates["templates/podcasts/index"],this.podcasts=a.podcasts,this.podcasts.bind("reset",this.render),this.podcasts.bind("change",this.render)},d.prototype.render=function(){return $(this.el).html(this.template({podcasts:this.podcasts.toJSON()})),this},d.prototype.navigate=function(a){return tm.app.navigateEvent(a)},d}(Backbone.View)}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b=Object.prototype.hasOwnProperty,c=function(a,c){function e(){this.constructor=a}for(var d in c)b.call(c,d)&&(a[d]=c[d]);return e.prototype=c.prototype,a.prototype=new e,a.__super__=c.prototype,a};window.PodcastPageView=function(b){function d(){this.load=a(this.load,this),this.render=a(this.render,this),d.__super__.constructor.apply(this,arguments)}return c(d,b),d.prototype.events=function(){return _.extend(d.__super__.events.call(this),{"click #loadmore":"load"})},d.prototype.initialize=function(a){return a==null&&(a={}),this.template=HandlebarsTemplates["templates/podcasts/show"],this.loadmore=new Loadmore(this)},d.prototype.render=function(){return $(this.el).html(this.template(this.context())),this.setPlaying(tm.player.mix)},d.prototype.setPodcast=function(a){var b=this;return this.podcast=a,this.podcast.mixes.page=0,this.podcast.mixes.bind("reset",function(){return b.render()},this),this.render(),this.loadmore.collection=this.podcast.mixes},d.prototype.context=function(){var a;return a=this.podcast.toJSON(),a.mixes=this.podcast.mixes.toJSON(),a},d.prototype.load=function(a){return this.loadmore.load(a,this.render),!1},d}(TranceView)}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b=Object.prototype.hasOwnProperty,c=function(a,c){function e(){this.constructor=a}for(var d in c)b.call(c,d)&&(a[d]=c[d]);return e.prototype=c.prototype,a.prototype=new e,a.__super__=c.prototype,a};window.VideoPageView=function(b){function d(){this.render=a(this.render,this),d.__super__.constructor.apply(this,arguments)}return c(d,b),d.prototype.id="video-page",d.prototype.className="VideoPageView",d.prototype.events={"click .stop-video":"stopVideo","click .prev":"prev","click .next":"next"},d.prototype.initialize=function(a){return a==null&&(a={}),this.template=HandlebarsTemplates["templates/videos/show"],this.youtubeTemplate=HandlebarsTemplates["templates/videos/large_youtube"]},d.prototype.render=function(){return $(this.el).html(this.template(this.video.toJSON())),this},d.prototype.setVideo=function(a){return this.video=a,this.render()},d.prototype.stopVideo=function(a){return this.$("iframe").remove(),$(this.el).hide(),tm.app.navigate("/videos"),tm.em.trigger("tm:stoped-video"),!1},d.prototype.prev=function(a){var b;return b=this.video.collection.before(this.video),tm.app.navigate("/videos/"+b.id,!0),!1},d.prototype.next=function(a){var b;return b=this.video.collection.after(this.video),tm.app.navigate("/videos/"+b.id,!0),!1},d}(Backbone.View)}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b=Object.prototype.hasOwnProperty,c=function(a,c){function e(){this.constructor=a}for(var d in c)b.call(c,d)&&(a[d]=c[d]);return e.prototype=c.prototype,a.prototype=new e,a.__super__=c.prototype,a};window.VideosView=function(b){function e(){this.render=a(this.render,this),e.__super__.constructor.apply(this,arguments)}var d;return c(e,b),e.prototype.id="videos-page",e.prototype.className="VideosView",e.prototype.events={"click .navigate, .play":"navigate","mouseenter .play":"hover","mouseleave .play":"hover"},e.prototype.initialize=function(a){return a==null&&(a={}),this.template=HandlebarsTemplates["templates/videos/index"],this.videos=a.videos,this.videos.on("reset",this.render,this),tm.em.on("tm:reflow",this.tileVideoLayout,this)},e.prototype.setThings=function(){return this.receivedLastPage=!0},e.prototype.render=function(){return $(this.el).html(this.template(this.context())),this},e.prototype.context=function(){return{videos:this.videos.toJSON()}},e.prototype.tileVideoLayout=function(){var a,b,c,e,f,g,h,i,j,k,l,m,n;if(!$(this.el).is(":visible"))return;b=3,c=[];for(f=0;0<=b?f<b:f>b;0<=b?f++:f--)c.push(0);k=this.$(".video");for(m=0,n=k.length;m<n;m++)j=k[m],a=$(j),e=a.outerHeight(),l=a.outerWidth(),g=d(c),i=c[g],h=g*(l+20),a.css({left:h,top:i}),c[g]+=e+20;return this},e.prototype.navigate=function(a){return tm.app.navigateEvent(a),!1},e.prototype.hover=function(a){var b;return b=$(a.currentTarget),b.toggleClass("hover"),b.find(".playbutton").length===0&&b.append('<img class="playbutton" src="/assets/red_play_large.png"/>'),b.find(".playbutton").toggle(b.hasClass("hover"))},d=function(a){var b,c,d,e;c=a[0],d=0;for(b=1,e=a.length;1<=e?b<e:b>e;1<=e?b++:b--)c>a[b]&&(c=a[b],d=b);return d},e}(Backbone.View)}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b=Object.prototype.hasOwnProperty,c=function(a,c){function e(){this.constructor=a}for(var d in c)b.call(c,d)&&(a[d]=c[d]);return e.prototype=c.prototype,a.prototype=new e,a.__super__=c.prototype,a};tm.em||(tm.em=_.extend({},Backbone.Events)),window.Player=function(b){function d(b){this.setup=a(this.setup,this),this.setupAndPlay=a(this.setupAndPlay,this),this.togglePlaying=a(this.togglePlaying,this);var c=this;this.view=new PlayerView({el:b,player:this}),this.bind("all",function(a){return tm.em.trigger("tm:player:"+a,c.mix)}),this.bind("finish",function(){return c.finished=!0}),this.bind("play",function(){return c.finished=!1}),this.events={play:function(){return c.trigger("play")},stop:function(){return c.trigger("stop")},pause:function(){return c.trigger("pause")},resume:function(){return c.trigger("resume")},finish:function(){return c.trigger("finish")},whileloading:function(){if(c.mix.paused)return c.update_playing()},whileplaying:function(){return c.view.whileplaying(c.sound)}}}return c(d,b),d.prototype.volume=100,d.prototype.playMix=function(a){return this.setMix(a)&&this.play()},d.prototype.setMix=function(a){return a?this.mix&&this.mix.id===a.id?!1:(this.mix=a,this.view.setMix(a),this.setup()):!1},d.prototype.setPosition=function(a){if(this
.finished)return this.setupAndPlay();if(this.sound)return this.sound.setPosition(a)},d.prototype.setUrl=function(a){return this.sound&&this.sound.destruct(),this.sound=soundManager.createSound({id:"current_mix",url:a,autoLoad:!1,onplay:this.events.play,onstop:this.events.stop,onpause:this.events.pause,onresume:this.events.resume,onfinish:this.events.finish,onbufferchange:this.events.bufferchange,whileloading:this.events.whileloading,whileplaying:this.events.whileplaying,volume:this.volume}),this.sound},d.prototype.setVolume=function(a){this.volume=a;if(this.sound)return this.sound.setVolume(a)},d.prototype.playing=function(){return this.sound&&this.sound.playState===1},d.prototype.paused=function(){return this.sound&&this.sound.paused},d.prototype.playingMix=function(a){return this.mix?this.mix.id===a.id:!1},d.prototype.loading=function(){return this.sound&&this.sound.readyState===1},d.prototype.play=function(){return this.sound&&this.sound.play()},d.prototype.pause=function(){return this.sound&&this.sound.pause()},d.prototype.stop=function(){return this.sound&&this.sound.stop()},d.prototype.resume=function(){return this.sound&&this.sound.resume()},d.prototype.togglePlaying=function(){return!this.sound&&this.mix||this.finished?this.setupAndPlay():this.paused()?this.resume():this.pause()},d.prototype.setupAndPlay=function(){return this.setup(),this.play()},d.prototype.setup=function(){return this.setUrl(this.mix.get("download_url")),tm.em.trigger("tm:mix:loaded",this.mix)},d}(Backbone.View)}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b=Object.prototype.hasOwnProperty,c=function(a,c){function e(){this.constructor=a}for(var d in c)b.call(c,d)&&(a[d]=c[d]);return e.prototype=c.prototype,a.prototype=new e,a.__super__=c.prototype,a};window.AppRouter=function(b){function d(){this.showFullScreenPage=a(this.showFullScreenPage,this),this.showPage=a(this.showPage,this),this.beginPage=a(this.beginPage,this),d.__super__.constructor.apply(this,arguments)}return c(d,b),d.prototype.initialize=function(){return tm.routers.home=new HomeRouter({app:this}),tm.routers.artists=new ArtistsRouter({app:this}),tm.routers.mixes=new MixesRouter({app:this}),tm.routers.podcasts=new PodcastsRouter({app:this}),tm.routers.videos=new VideosRouter({app:this}),tm.routers.listens=new ListensRouter({app:this}),this.body=$("#body"),this.loader=$("#loader"),this.footer=$("#footer"),this.spinnyDo=$("#spinnyDo"),this.bindApplicationEvents(),tm.player=new Player($("#player")),tm.setupErrorHandlers(),tm.plugins()},d.prototype.bindApplicationEvents=function(){var a=this;return tm.em.on("tm:em:ajax:complete",function(){return $("#spinnyDo").hide()}),$("#logo, .navigate").click(function(b){return a.navigateEvent(b)}),window.onbeforeunload=function(){if(tm.player.playing())return"You are playing music, really leave this page?"},$(window).scroll(function(){var a,b;b=$(window).scrollTop(),a=$(document).height()-$(window).height();if(b>=a)return tm.em.trigger("tm:window_snapped_bottom")})},d.prototype.beginPage=function(){return this.fetching=!0,this.body.find("> div").hide(),this.footer.hide(),this.loader.show()},d.prototype.showPage=function(a){return this.fetching=!1,this.loader.hide(),this.footer.show(),this.body.find(a.el).length===0&&this.body.append(a.el),$(a.el).show(),tm.em.trigger("tm:reflow")},d.prototype.showFullScreenPage=function(a){var b;return this.fetching=!1,this.loader.hide(),this.footer.show(),b=$("body"),b.find(a.el).length===0&&b.prepend(a.el),$(a.el).show()},d.prototype.navigateEvent=function(a){var b;return a.preventDefault(),a.stopPropagation(),b=$(a.currentTarget).attr("href"),this.navigate(b,!0),!1},d.prototype.navigateEventMouseSpinner=function(a){var b;return a.preventDefault(),a.stopPropagation(),b=$(a.currentTarget).attr("href"),this.spinnyDo.show().css({top:a.clientY+20,left:a.clientX}),this.navigate(b,!1),!1},d}(Backbone.Router)}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.ArtistsRouter=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.routes={"artists/:id":"artist",artists:"artists"},c.prototype.initialize=function(a){return this.app=a.app,this.collections={},this.collections.artists=new Artists,this.pages={},this.pages.artist=new ArtistPageView,this.pages.artists=new ArtistsPageView({artists:this.collections.artists,router:this})},c.prototype.artist=function(a){var b,c=this;return this.app.beginPage(),b=this.collections.artists.get(a),_.isUndefined(b)&&(b=new Artist({id:a}),this.collections.artists.add(b)),b.fetch({success:function(){return c.pages.artist.setArtist(b),c.app.showPage(c.pages.artist)},errors:function(){return console.log(arguments)}})},c.prototype.artists=function(){var a=this;return this.app.beginPage(),this.collections.artists.fetch({success:function(){return a.app.showPage(a.pages.artists)}})},c.prototype.navigateEvent=function(a){return a.preventDefault(),this.app.navigateEvent(a)},c}(Backbone.Router)}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b=Object.prototype.hasOwnProperty,c=function(a,c){function e(){this.constructor=a}for(var d in c)b.call(c,d)&&(a[d]=c[d]);return e.prototype=c.prototype,a.prototype=new e,a.__super__=c.prototype,a};window.HomeRouter=function(b){function d(){this.genre=a(this.genre,this),this.home=a(this.home,this),d.__super__.constructor.apply(this,arguments)}return c(d,b),d.prototype.routes={"genres/:genre/mixes":"genre","":"home"},d.prototype.initialize=function(a){return this.app=a.app,this.pages={},this.pages.home=new HomeView({mixes:tm.collections.mixes,home:tm.models.home}),this.homeHasRendered=!1},d.prototype.home=function(){var a=this;return this.app.beginPage(),tm.models.home.fetch({success:function(){return a.app.showPage(a.pages.home.render()),a.homeHasRendered=!0}})},d.prototype.genre=function(a){var b=this;return this.app.beginPage(),this.homeHasRendered?tm.models.search.showGenre(a,function(){return b.app.showPage(b.pages.home.render())}):tm.models.home.fetch({success:function(){return b.app.showPage(b.pages.home.render()),b.homeHasRendered=!0}})},d}(Backbone.Router)}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.ListensRouter=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.routes={listens:"listens"},c.prototype.initialize=function(a){return this.app=a.app,this.collections={},this.collections.listens=tm.collections.listens,$("#listens").length!==0&&this.collections.listens.fetch(),this.pages={},this.pages.listens=new ListensView({listens:this.collections.listens,router:this}),this.views={},this.views.listensMenu=new ListensMenuView({el:$("#listens"),listens:this.collections.listens})},c.prototype.listens=function(){var a=this;return this.app.beginPage(),this.collections.listens.fetch({success:function(){return a.app.showPage(a.pages.listens)}})},c.prototype.navigateEvent=function(a){return a.preventDefault(),this.app.navigateEvent(a)},c}(Backbone.Router)}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.MixesRouter=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.routes={"mixes/:id":"mix"},c.prototype.initialize=function(a){return this.app=a.app,this.pages={},this.pages.mix=new MixPageView},c.prototype.mix=function(a){var b=this;return this.app.beginPage(),Mix.find(a,function(a){return b.pages.mix.setMix(a),b.app.showPage(b.pages.mix)})},c.prototype.navigateEvent=function(a){return a.preventDefault(),this.app.navigateEvent(a)},c}(Backbone.Router)}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.PodcastsRouter=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.routes={"podcasts/:id":"podcast",podcasts:"podcasts"},c.prototype.initialize=function(a){return this.app=a.app,this.collections={},this.collections.podcasts=new Podcasts,this.pages={},this.pages.podcast=new PodcastPageView,this.pages.podcasts=new PodcastsPageView({podcasts:this.collections.podcasts,router:this})},c.prototype.podcast=function(a){var b,c=this;return this.app.beginPage(),b=this.collections.podcasts.get(a),_.isUndefined(b)&&(b=new Podcast({id:a})),b.fetch({success:function(){return c.pages.podcast.setPodcast(b),c.app.showPage(c.pages.podcast)},errors:function(){return console.log(arguments)}})},c.prototype.podcasts=function(){var a=this;return this.app.beginPage(),this.collections.podcasts.fetch({success:function(){return a.app.showPage(a.pages.podcasts)}})},c.prototype.navigateEvent=function(a){return a.preventDefault(),this.app.navigateEvent(a)},c}(Backbone.Router)}.call(this),function(){var a=Object.prototype.hasOwnProperty,b=function(b,c){function e(){this.constructor=b}for(var d in c)a.call(c,d)&&(b[d]=c[d]);return e.prototype=c.prototype,b.prototype=new e,b.__super__=c.prototype,b};window.VideosRouter=function(a){function c(){c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.routes={"videos/:id":"video",videos:"videos"},c.prototype.initialize=function(a){var b=this;return this.app=a.app,this.collections={},this.collections.videos=new Videos,this.pages={},this.pages.videos=new VideosView({videos:this.collections.videos,router:this}),this.pages.video=new VideoPageView({router:this}),tm.em.on("tm:stoped-video",function(){return b.watchingvideo=!1})},c.prototype.video=function(a){var b=this;return $(this.pages.videos.el).is(":visible")?this.watchVideo(a):this.collections.videos.fetch({success:function(){return b.app.showPage(b.pages.videos),b.watchVideo(a)}})},c.prototype.watchVideo=function(a){var b;return this.watchingVideo=!0,b=this.collections.videos.get(a),this.pages.video.setVideo(b),this.app.showFullScreenPage(this.pages.video)},c.prototype.videos=function(){var a=this;return this.isWatchingVideo()&&this.pages.video.stopVideo(),this.app.beginPage(),this.collections.videos.fetch({success:function(){return a.app.showPage(a.pages.videos),a.pages.video.stopVideo()}})},c.prototype.navigateEvent=function(a){return a.preventDefault(),this.app.navigateEvent(a)},c.prototype.isWatchingVideo=function(){return this.watchingVideo},c}(Backbone.Router)}.call(this),function(){tm.models.home=new HomeModel,tm.models.search=new Search,tm.collections.listens=new Listens,tm.collections.picks=new Mixes,tm.collections.mixes=new Mixes({search:tm.models.search}),$(document).ready(function(){return tm.app=new AppRouter,Backbone.history.start({pushState:!0})})}.call(this),function(){window.Helpers={hms:function(a){var b,c,d;return b=parseInt(a/36e5,10),c=parseInt(a%36e5/6e4,10),d=parseInt(a%36e5%6e4/1e3,10),d<10&&(d="0"+d),c<10&&(c="0"+c),b<10&&(b="0"+b),[b,c,d]},formated_hms:function(a){var b,c,d,e;return e=this.hms(a),b=e[0],c=e[1],d=e[2],b!=="00"?""+b+":"+c+":"+d:""+c+":"+d}}}.call(this),function(){return this.HandlebarsTemplates||(this.HandlebarsTemplates={}),this.HandlebarsTemplates["templates/artists/index"]=Handlebars.template(function(a,b,c,d,e){function o(a,b){var d="",e;return d+='\n        <tr class="artist" id="artist_',e=c.id||a.id,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"id",{hash:{}})),d+=m(e)+'">\n          <td class="art">\n            <img src="',e=c.thumb||a.thumb,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"thumb",{hash:{}})),d+=m(e)+'" alt=',e=c.name||a.name,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"name",{hash:{}})),d+=m(e)+'/>\n          </td>\n          <td class="name">\n            <a href="/artists/',e=c.id||a.id,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"id",{hash:{}})),d+=m(e)+'" class="navigate">',e=c.name||a.name,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"name",{hash:{}})),d+=m(e)+"</a>\n          </td>\n        </tr>\n      ",d}c=c||a.helpers;var f="",g,h,i=this,j="function",k=c.helperMissing,l=void 0,m=this.escapeExpression,n=c.blockHelperMissing;f+='<div class="page-header">\n  <h1>Artists</h1>\n</div>\n<div class="page-body row">\n  <div class="span16 columns">\n    <table class="bordered-table zebra-striped">\n      <thead>\n        <tr>\n          <th></td>\n          <th>name</th>\n        </tr>\n      </thead>\n      <tbody>\n      ',g=c.artists||b.artists,h=i.program(1,o,e),h.hash={},h.fn=h,h.inverse=i.noop,typeof g===j?g=g.call(b,h):g=n.call(b,g,h);if(g||g===0)f+=g;return f+="\n      </tbody>\n    </table>\n  </div>\n</div>\n",f}),HandlebarsTemplates["templates/artists/index"]}.call(this),function(){return this.HandlebarsTemplates||(this.HandlebarsTemplates={}),this.HandlebarsTemplates["templates/artists/show"]=Handlebars.template(function(a,b,c,d,e){function p(a,b){var d="",e;return d+="\n      <dt>",e=c.label||a.label,typeof e===k?e=e.call(a,{hash:{}}):e===m&&(e=l.call(a,"label",{hash:{}})),d+=n(e)+'</dt>\n      <dd><a href="',e=c.url||a.url,typeof e===k?e=e.call(a,{hash:{}}):e===m&&(e=l.call(a,"url",{hash:{}})),d+=n(e)+'" target="_blank">',e=c.text||a.text,typeof e===k?e=e.call(a,{hash:{}}):e===m&&(e=l.call(a,"text",{hash:{}})),d+=n(e)+"</a></dd>\n    ",d}function q(a,b){var d="",e;d+='\n      <div class="bio">\n        <h5>bio</h5>\n        ',e=c.bio||a.bio,typeof e===k?e=e.call(a,{hash:{}}):e===m&&(e=l.call(a,"bio",{hash:{}}));if(e||e===0)d+=e;return d+="\n      </div>\n    ",d}c=c||a.helpers,d=d||a.partials;var f="",g,h,i,j=this,k="function",l=c.helperMissing,m=void 0,n=this.escapeExpression,o=c.blockHelperMissing;f+='<div class="page-header">\n  <h1>',g=c.name||b.name,typeof g===k?g=g.call(b,{hash:{}}):g===m&&(g=l.call(b,"name",{hash:{}})),f+=n(g)+'</h1>\n</div>\n<div class="page-body row">\n  <div class="span4 columns">\n    <div class="photo">\n      <img src="',g=c.photo||b.photo,typeof g===k?g=g.call(b,{hash:{}}):g===m&&(g=l.call(b,"photo",{hash:{}})),f+=n(g)+'" alt="',g=c.name||b.name,typeof g===k?g=g.call(b,{hash:{}}):g===m&&(g=l.call(b,"name",{hash:{}})),f+=n(g)+'" width="100%"/>\n    </div>\n    <dl class="fields links">\n    ',g=c.links||b.links,i=j.program(1,p,e),i.hash={},i.fn=i,i.inverse=j.noop,typeof g===k?g=g.call(b,i):g=o.call(b,g,i);if(g||g===0)f+=g;f+='\n    </dl>\n  </div>\n  <div class="span12 columns">\n\n    ',g=c.bio||b.bio,h=c["if"],i=j.program(3,q,e),i.hash={},i.fn=i,i.inverse=j.noop,g=h.call(b,g,i);if(g||g===0)f+=g;f+="\n\n    ",g=b,g=j.invokePartial(d.mixes,"mixes",g,c,d);if(g||g===0)f+=g;return f+="\n  </div>\n</div>\n",f}),HandlebarsTemplates["templates/artists/show"]}.call(this),function(){return this.HandlebarsTemplates||(this.HandlebarsTemplates={}),this.HandlebarsTemplates["templates/home/genres"]=Handlebars.template(function(a,b,c,d,e){function o(a,b){var d="",e;return d+='\n  <li class="genre">\n    <a href="/genres/',e=c.name||a.name,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"name",{hash:{}})),d+=m(e)+'/mixes" class="link ',e=c.active||a.active,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"active",{hash:{}})),d+=m(e)+'" data-genre="',e=c.name||a.name,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"name",{hash:{}})),d+=m(e)+'">\n      <span class="genre ',e=c.name||a.name,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"name",{hash:{}})),d+=m(e)+'">',e=c.name||a.name,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"name",{hash:{}})),d+=m(e)+"</span>\n    </a>\n  </li>\n",d}c=c||a.helpers;var f="",g,h,i=this,j="function",k=c.helperMissing,l=void 0,m=this.escapeExpression,n=c.blockHelperMissing;f+='<li class="genre">\n  <a href="/" class="clear active link">\n    <span class="genre clear_active">all</span>\n  </a>\n</li>\n',g=c.genres||b.genres,h=i.program(1,o,e),h.hash={},h.fn=h,h.inverse=i.noop,typeof g===j?g=g.call(b,h):g=n.call(b,g,h);if(g||g===0)f+=g;return f+="\n\n",f}),HandlebarsTemplates["templates/home/genres"]}.call(this),function(){return this.HandlebarsTemplates||(this.HandlebarsTemplates={}),this.HandlebarsTemplates["templates/home/index"]=Handlebars.template(function(a,b,c,d,e){c=c||a.helpers;var f=this;return'<div class="page-header">\n  <h1>Latest Trance Mixes</h1>\n</div>\n\n<div class="page-body">\n  <div class="row">\n    <div class="span10 columns">\n      <ul id="genres"></ul>\n    </div>\n  </div>\n\n  <div class="row">\n    <div class="span10 columns">\n      <div id="mixes">\n        <strong>latest</strong>\n        <div class="mixes"> </div>\n      </div>\n      <div id="loading" style="text-align: center; display: none">\n        <a href="#" class=\'btn disabled\'>loading more mixes...</a>\n      </div>\n      <div id="loadmore" style="text-align: center">\n        <a href="#" id="load" class=\'btn\'>load more</a>\n      </div>\n    </div>\n\n    <div class="span6 columns">\n      <div id="staff" class="well">\n        <strong>staff picks</strong>\n        <div class="mixes"></div>\n      </div>\n    </div>\n  </div>\n</div>\n'}),HandlebarsTemplates["templates/home/index"]}.call(this),function(){return this.HandlebarsTemplates||(this.HandlebarsTemplates={}),this.HandlebarsTemplates["templates/listens/index"]=Handlebars.template(function(a,b,c,d,e){function o(a,b){var d="",e;d+="\n  ",e=c.mix||a.mix,h=i.program(2,p,b),h.hash={},h.fn=h,h.inverse=i.noop,typeof e===j?e=e.call(a,h):e=n.call(a,e,h);if(e||e===0)d+=e;return d+="\n",d}function p(a,b){var e="",f;e+='\n    <div class="mix ',f=c.listen_state||a.listen_state,typeof f===j?f=f.call(a,{hash:{}}):f===l&&(f=k.call(a,"listen_state",{hash:{}})),e+=m(f)+'" data-id="',f=c.id||a.id,typeof f===j?f=f.call(a,{hash:{}}):f===l&&(f=k.call(a,"id",{hash:{}})),e+=m(f)+'">\n      ',f=a,f=i.invokePartial(d.mix,"mix",f,c,d);if(f||f===0)e+=f;return e+="\n      ",f=c.started_at||a.started_at,typeof f===j?f=f.call(a,{hash:{}}):f===l&&(f=k.call(a,"started_at",{hash:{}})),e+=m(f)+"\n      ",f=c.finished_at||a.finished_at,typeof f===j?f=f.call(a,{hash:{}}):f===l&&(f=k.call(a,"finished_at",{hash:{}})),e+=m(f)+"\n    </div>\n  ",e}c=c||a.helpers,d=d||a.partials;var f="",g,h,i=this,j="function",k=c.helperMissing,l=void 0,m=this.escapeExpression,n=c.blockHelperMissing;f+='<div class="page-header">\n  <h1>Your most recent listens</h1>\n</div>\n\n<div class="mixes">\n',g=c.listens||b.listens,h=i.program(1,o,e),h.hash={},h.fn=h,h.inverse=i.noop,typeof g===j?g=g.call(b,h):g=n.call(b,g,h);if(g||g===0)f+=g;return f+="\n</div>\n",f}),HandlebarsTemplates["templates/listens/index"]}.call(this),function(){return this.HandlebarsTemplates||(this.HandlebarsTemplates={}),this.HandlebarsTemplates["templates/listens/menu"]=Handlebars.template(function(a,b,c,d,e){function o(a,b){var d="",e;d+="\n  ",e=c.mix||a.mix,h=i.program(2,p,b),h.hash={},h.fn=h,h.inverse=i.noop,typeof e===j?e=e.call(a,h):e=n.call(a,e,h);if(e||e===0)d+=e;return d+="\n",d}function p(a,b){var d="",e;return d+='\n    <li>\n      <a href="/mixes/',e=c.id||a.id,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"id",{hash:{}})),d+=m(e)+'" class="navigate">\n        ',e=c.title||a.title,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"title",{hash:{}})),d+=m(e)+"\n      </a>\n    </li>\n  ",d}c=c||a.helpers;var f="",g,h,i=this,j="function",k=c.helperMissing,l=void 0,m=this.escapeExpression,n=c.blockHelperMissing;g=c.listens||b.listens,h=i.program(1,o,e),h.hash={},h.fn=h,h.inverse=i.noop,typeof g===j?g=g.call(b,h):g=n.call(b,g,h);if(g||g===0)f+=g;return f+="\n",f}),HandlebarsTemplates["templates/listens/menu"]}.call(this),function(){return this.HandlebarsTemplates||(this.HandlebarsTemplates={}),this.HandlebarsTemplates["templates/listens/menu_item"]=Handlebars.template(function(a,b,c,d,e){c=c||a.helpers;var f="",g,h=this,i="function",j=c.helperMissing,k=void 0,l=this.escapeExpression;return f+='<a href="/mixes/',g=c.id||b.id,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"id",{hash:{}})),f+=l(g)+'" class="navigate listen">\n  <img src="',g=c.thumb||b.thumb,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"thumb",{hash:{}})),f+=l(g)+'" class="thumb"/>\n  <div class="title">',g=c.title||b.title,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"title",{hash:{}})),f+=l(g)+"</div>\n</a>\n",f}),HandlebarsTemplates["templates/listens/menu_item"]}.call(this),function(){return this.HandlebarsTemplates||(this.HandlebarsTemplates={}),this.HandlebarsTemplates["templates/listens/tr"]=Handlebars.template(function(a,b,c,d,e){c=c||a.helpers,d=d||a.partials;var f="",g,h=this,i="function",j=c.helperMissing,k=void 0,l=this.escapeExpression;f+='<tr class="mix ',g=c.listen_state||b.listen_state,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"listen_state",{hash:{}})),f+=l(g)+'" data-id="',g=c.id||b.id,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"id",{hash:{}})),f+=l(g)+'">\n  ',g=b,g=h.invokePartial(d.mix_tr,"mix_tr",g,c,d);if(g||g===0)f+=g;return f+="\n  <td>",g=c.started_at||b.started_at,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"started_at",{hash:{}})),f+=l(g)+"</td>\n  <td>",g=c.finished_at||b.finished_at,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"finished_at",{hash:{}})),f+=l(g)+"</td>\n</tr>\n",f}),HandlebarsTemplates["templates/listens/tr"]}.call(this),function(){Handlebars.registerPartial("mix",Handlebars.template(function(a,b,c,d,e){c=c||a.helpers;var f="",g,h=this,i="function",j=c.helperMissing,k=void 0,l=this.escapeExpression;return f+='<img src="',g=c.thumb||b.thumb,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"thumb",{hash:{}})),f+=l(g)+'" alt="',g=c.title||b.title,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"title",{hash:{}})),f+=l(g)+'" class="art"/>\n\n<a href="#play" data-id="',g=c.id||b.id,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"id",{hash:{}})),f+=l(g)+'" class="play">play</a>\n\n<div class="title">\n  <a href="/mixes/',g=c.id||b.id,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"id",{hash:{}})),f+=l(g)+'" class="navigate">',g=c.title||b.title,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"title",{hash:{}})),f+=l(g)+'</a>\n</div>\n\n<div class="meta">\n  <span class="duration">',g=c.duration||b.duration,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"duration",{hash:{}})),f+=l(g)+'</span>\n  of\n  <span class="genre ',g=c.genre||b.genre,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"genre",{hash:{}})),f+=l(g)+'">\n    <a href="/genres/',g=c.genre||b.genre,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"genre",{hash:{}})),f+=l(g)+'/mixes">',g=c.genre||b.genre,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"genre",{hash:{}})),f+=l(g)+'</a>\n  </span>\n  by\n  <span class="artist">',g=c.artist||b.artist,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"artist",{hash:{}})),f+=l(g)+"</span>\n</div>\n",f}))}.call(this),function(){Handlebars.registerPartial("mix_tr",Handlebars.template(function(a,b,c,d,e){c=c||a.helpers;var f="",g,h=this,i="function",j=c.helperMissing,k=void 0,l=this.escapeExpression;return f+='<td class="art">\n  <a href="#play" data-id="',g=c.id||b.id,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"id",{hash:{}})),f+=l(g)+'" class="play">play</a>\n  <img src="',g=c.thumb||b.thumb,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"thumb",{hash:{}})),f+=l(g)+'" alt="',g=c.title||b.title,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"title",{hash:{}})),f+=l(g)+'"/>\n</td>\n<td class="title" title="',g=c.title_text||b.title_text,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"title_text",{hash:{}})),f+=l(g)+'">\n  <a href="/mixes/',g=c.id||b.id,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"id",{hash:{}})),f+=l(g)+'" data-id="',g=c.id||b.id,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"id",{hash:{}})),f+=l(g)+'" class="show">',g=c.title||b.title,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"title",{hash:{}})),f+=l(g)+'</a>\n  <span class="duration">',g=c.duration||b.duration,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"duration",{hash:{}})),f+=l(g)+'</span>\n  of <span class="genre ',g=c.genre||b.genre,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"genre",{hash:{}})),f+=l(g)+'"><a href="/genres/',g=c.genre||b.genre,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"genre",{hash:{}})),f+=l(g)+'/mixes" class="navigate">',g=c.genre||b.genre,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"genre",{hash:{}})),f+=l(g)+"</a></span>\n</td>\n",f}))}.call(this),function(){Handlebars.registerPartial("mixes",Handlebars.template(function(a,b,c,d,e){function o(a,b){var e="",f;e+='\n    <div class=" mix ',f=c.listen_state||a.listen_state,typeof f===j?f=f.call(a,{hash:{}}):f===l&&(f=k.call(a,"listen_state",{hash:{}})),e+=m(f)+'" data-id="',f=c.id||a.id,typeof f===j?f=f.call(a,{hash:{}}):f===l&&(f=k.call(a,"id",{hash:{}})),e+=m(f)+'">\n      ',f=a,f=i.invokePartial(d.mix,"mix",f,c,d);if(f||f===0)e+=f;return e+="\n    </div>\n  ",e}function p(a,b){return"\n    <div>\n      <span>sorry no mixes to show you :(</span>\n    </div>\n  "}c=c||a.helpers,d=d||a.partials;var f="",g,h,i=this,j="function",k=c.helperMissing,l=void 0,m=this.escapeExpression,n=c.blockHelperMissing;f+='<div class="mixes">\n  <h5>mixes</h5>\n  ',g=c.mixes||b.mixes,h=i.program(1,o,e),h.hash={},h.fn=h,h.inverse=i.noop,typeof g===j?g=g.call(b,h):g=n.call(b,g,h);if(g||g===0)f+=g;f+="\n  ",g=c.mixes||b.mixes,h=i.noop,h.hash={},h.fn=h,h.inverse=i.program(3,p,e),typeof g===j?g=g.call(b,h):g=n.call(b,g,h);if(g||g===0)f+=g;return f+='\n  <div id="loading" style="text-align: center; display: none">\n    <a href="#" class=\'btn disabled\'>loading more mixes...</a>\n  </div>\n  <div id="loadmore" style="text-align: center">\n    <a href="#" id="load" class=\'btn\'>load more</a>\n  </div>\n</div>\n',f}))}.call(this),function(){return this.HandlebarsTemplates||(this.HandlebarsTemplates={}),this.HandlebarsTemplates["templates/mixes/mix"]=Handlebars.template(function(a,b,c,d,e){c=c||a.helpers,d=d||a.partials;var f="",g,h=this;g=b,g=h.invokePartial(d.mix,"mix",g,c,d);if(g||g===0)f+=g;return f+="\n",f}),HandlebarsTemplates["templates/mixes/mix"]}.call(this),function(){return this.HandlebarsTemplates||(this.HandlebarsTemplates={}),this.HandlebarsTemplates["templates/mixes/mixes"]=Handlebars.template(function(a,b,c,d,e){function o(a,b){var e="",f;e+='\n  <div class="mix ',f=c.listen_state||a.listen_state,typeof f===j?f=f.call(a,{hash:{}}):f===l&&(f=k.call(a,"listen_state",{hash:{}})),e+=m(f)+'" data-id="',f=c.id||a.id,typeof f===j?f=f.call(a,{hash:{}}):f===l&&(f=k.call(a,"id",{hash:{}})),e+=m(f)+'">\n    ',f=a,f=i.invokePartial(d.mix,"mix",f,c,d);if(f||f===0)e+=f;return e+="\n  </div>\n",e}function p(a,b){return"\n  <div>\n    <span>sorry no mixes to show you :-(</span>\n  </div>\n"}c=c||a.helpers,d=d||a.partials;var f="",g,h,i=this,j="function",k=c.helperMissing,l=void 0,m=this.escapeExpression,n=c.blockHelperMissing;g=c.mixes||b.mixes,h=i.program(1,o,e),h.hash={},h.fn=h,h.inverse=i.noop,typeof g===j?g=g.call(b,h):g=n.call(b,g,h);if(g||g===0)f+=g;f+="\n",g=c.mixes||b.mixes,h=i.noop,h.hash={},h.fn=h,h.inverse=i.program(3,p,e),typeof g===j?g=g.call(b,h):g=n.call(b,g,h);if(g||g===0)f+=g;return f+="\n",f}),HandlebarsTemplates["templates/mixes/mixes"]}.call(this),function(){return this.HandlebarsTemplates||(this.HandlebarsTemplates={}),this.HandlebarsTemplates["templates/mixes/show"]=Handlebars.template(function(a,b,c,d,e){function o(a,b){var d="",e;return d+='\n        <a href="/artists/',e=c.id||a.id,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"id",{hash:{}})),d+=m(e)+'" class="navigate">',e=c.name||a.name,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"name",{hash:{}})),d+=m(e)+"</a>\n      ",d}function p(a,b){var d="",e;return d+="\n        ",e=c.artist||a.artist,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"artist",{hash:{}})),d+=m(e)+"\n      ",d}c=c||a.helpers;var f="",g,h,i=this,j="function",k=c.helperMissing,l=void 0,m=this.escapeExpression,n=c.blockHelperMissing;f+='<div class="page-header">\n  <h1>\n    <span class="title">',g=c.title||b.title,typeof g===j?g=g.call(b,{hash:{}}):g===l&&(g=k.call(b,"title",{hash:{}})),f+=m(g)+'</span>\n    <span class="pagination" style="font-size: 12px; float:right; margin: 0">\n      <ul>\n        <li class="prev">\n          <a href="#" id="prev">&larr; Previous</a>\n        </li>\n        <li class="next">\n          <a href="#" id="next">Next &rarr;</a>\n        </li>\n      </ul>\n    </span>\n  </h1>\n  <h1 style="line-height: 32px; padding: 5px;" class="well">\n    <a href="#" class="play" style="vertical-align: middle">Play</a>\n    <img src="',g=c.waveform||b.waveform,typeof g===j?g=g.call(b,{hash:{}}):g===l&&(g=k.call(b,"waveform",{hash:{}})),f+=m(g)+'" class="waveform" style="vertical-align: middle;"/>\n  </h1>\n</div>\n<div class="row">\n  <div class="span16 columns">\n  </div>\n</div>\n<div class="row">\n  <div class="span4 columns">\n    <div class="art">\n      ',g=c.art_image||b.art_image,typeof g===j?g=g.call(b,{hash:{}}):g===l&&(g=k.call(b,"art_image",{hash:{}}));if(g||g===0)f+=g;f+='\n    </div>\n  </div>\n  <div class="span12 columns">\n    <dl class="fields">\n      <dt>listens</dt>\n      <dd>',g=c.listens||b.listens,typeof g===j?g=g.call(b,{hash:{}}):g===l&&(g=k.call(b,"listens",{hash:{}}));if(g||g===0)f+=g;f+="</dd>\n      <dt>duration</dt>\n      <dd>",g=c.duration||b.duration,typeof g===j?g=g.call(b,{hash:{}}):g===l&&(g=k.call(b,"duration",{hash:{}})),f+=m(g)+"</dd>\n      <dt>released</dt>\n      <dd>",g=c.published||b.published,typeof g===j?g=g.call(b,{hash:{}}):g===l&&(g=k.call(b,"published",{hash:{}})),f+=m(g)+' </dd>\n      <dt>genre</dt>\n      <dd><span class="genre ',g=c.genre||b.genre,typeof g===j?g=g.call(b,{hash:{}}):g===l&&(g=k.call(b,"genre",{hash:{}})),f+=m(g)+'">',g=c.genre||b.genre,typeof g===j?g=g.call(b,{hash:{}}):g===l&&(g=k.call(b,"genre",{hash:{}})),f+=m(g)+'</span></dd>\n    </dl>\n    <dl class="fields">\n      <dt>artist</dt>\n      <dd>\n      ',g=c.artists||b.artists,h=i.program(1,o,e),h.hash={},h.fn=h,h.inverse=i.noop,typeof g===j?g=g.call(b,h):g=n.call(b,g,h);if(g||g===0)f+=g;f+="\n      ",g=c.artists||b.artists,h=i.noop,h.hash={},h.fn=h,h.inverse=i.program(3,p,e),typeof g===j?g=g.call(b,h):g=n.call(b,g,h);if(g||g===0)f+=g;f+="\n      </dd>\n      <dt>",g=c.source_type||b.source_type,typeof g===j?g=g.call(b,{hash:{}}):g===l&&(g=k.call(b,"source_type",{hash:{}})),f+=m(g)+"</dt>\n      <dd>",g=c.source_link||b.source_link,typeof g===j?g=g.call(b,{hash:{}}):g===l&&(g=k.call(b,"source_link",{hash:{}}));if(g||g===0)f+=g;f+="</dd>\n      <dt>download</dt>\n      <dd>",g=c.download_link||b.download_link,typeof g===j?g=g.call(b,{hash:{}}):g===l&&(g=k.call(b,"download_link",{hash:{}}));if(g||g===0)f+=g;f+='</dd>\n    </dl>\n\n    <br style="clear: both"/>\n\n    <div class="summary">\n      ',g=c.summary||b.summary,typeof g===j?g=g.call(b,{hash:{}}):g===l&&(g=k.call(b,"summary",{hash:{}}));if(g||g===0)f+=g;return f+="\n    </div>\n  </div>\n</div>\n",f}),HandlebarsTemplates["templates/mixes/show"]}.call(this),function(){return this.HandlebarsTemplates||(this.HandlebarsTemplates={}),this.HandlebarsTemplates["templates/player/mix"]=Handlebars.template(function(a,b,c,d,e){c=c||a.helpers;var f="",g,h=this,i="function",j=c.helperMissing,k=void 0,l=this.escapeExpression;f+='<div id="',g=c.id||b.id,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"id",{hash:{}})),f+=l(g)+'" class="mix">\n  ',g=c.art_image||b.art_image,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"art_image",{hash:{}}));if(g||g===0)f+=g;return f+='\n  <div class="artist">',g=c.artist||b.artist,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"artist",{hash:{}})),f+=l(g)+'</div>\n  <div class="title">',g=c.title||b.title,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"title",{hash:{}})),f+=l(g)+'</div>\n  <div class="meta">\n    <span class="duration">',g=c.duration||b.duration,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"duration",{hash:{}})),f+=l(g)+'</span>\n    <span class="genre">of ',g=c.genre||b.genre,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"genre",{hash:{}})),f+=l(g)+"</span>\n  </div>\n</div>\n",f}),HandlebarsTemplates["templates/player/mix"]}.call(this),function(
){return this.HandlebarsTemplates||(this.HandlebarsTemplates={}),this.HandlebarsTemplates["templates/player/play_pause"]=Handlebars.template(function(a,b,c,d,e){c=c||a.helpers;var f=this;return'<div id="play_pause">\n  <a href="#" class="play">play</a>\n  <a href="#" class="pause" style="display: none">pause</a>\n</div>\n'}),HandlebarsTemplates["templates/player/play_pause"]}.call(this),function(){return this.HandlebarsTemplates||(this.HandlebarsTemplates={}),this.HandlebarsTemplates["templates/player/progress_bar"]=Handlebars.template(function(a,b,c,d,e){c=c||a.helpers;var f="",g,h=this,i="function",j=c.helperMissing,k=void 0,l=this.escapeExpression;return f+='<div class="progress-container">\n  <div class="waveform">\n    <img src="',g=c.waveform||b.waveform,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"waveform",{hash:{}})),f+=l(g)+'" alt="waveform"/>\n  </div>\n  <div class="progress-bar">\n    <div class="loading"></div>\n    <div class="progress">\n      <div class="current">0:00</div>\n    </div>\n  </div>\n</div>\n',f}),HandlebarsTemplates["templates/player/progress_bar"]}.call(this),function(){return this.HandlebarsTemplates||(this.HandlebarsTemplates={}),this.HandlebarsTemplates["templates/podcasts/index"]=Handlebars.template(function(a,b,c,d,e){function o(a,b){var d="",e;return d+='\n      <li class="podcast" id="podcast_',e=c.id||a.id,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"id",{hash:{}})),d+=m(e)+'" title="',e=c.title_text||a.title_text,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"title_text",{hash:{}})),d+=m(e)+'">\n        <a href="/podcasts/',e=c.id||a.id,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"id",{hash:{}})),d+=m(e)+'" class="navigate">\n          <img src="',e=c.image||a.image,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"image",{hash:{}})),d+=m(e)+'" alt="',e=c.name||a.name,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"name",{hash:{}})),d+=m(e)+'"/>\n          <div class="panel">\n            <span class="genre ',e=c.genre||a.genre,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"genre",{hash:{}})),d+=m(e)+'">',e=c.genre||a.genre,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"genre",{hash:{}})),d+=m(e)+'</span>\n            <span class="count">',e=c.mixes_count||a.mixes_count,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"mixes_count",{hash:{}})),d+=m(e)+"</span>\n          </div>\n        </a>\n      </li>\n    ",d}c=c||a.helpers;var f="",g,h,i=this,j="function",k=c.helperMissing,l=void 0,m=this.escapeExpression,n=c.blockHelperMissing;f+='<div class="page-header">\n  <h1>Trance Podcasts</h1>\n</div>\n<div class="page-body row">\n  <div class="span16">\n    <ul class="media-grid">\n    ',g=c.podcasts||b.podcasts,h=i.program(1,o,e),h.hash={},h.fn=h,h.inverse=i.noop,typeof g===j?g=g.call(b,h):g=n.call(b,g,h);if(g||g===0)f+=g;return f+="\n    </ul>\n  </div>\n</div>\n",f}),HandlebarsTemplates["templates/podcasts/index"]}.call(this),function(){return this.HandlebarsTemplates||(this.HandlebarsTemplates={}),this.HandlebarsTemplates["templates/podcasts/show"]=Handlebars.template(function(a,b,c,d,e){function o(a,b){var d="",e;return d+='\n          <a href="/artists/',e=c.id||a.id,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"id",{hash:{}})),d+=m(e)+'" class="navigate">',e=c.name||a.name,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"name",{hash:{}})),d+=m(e)+"</a>\n        ",d}function p(a,b){var d="",e;return d+="\n          ",e=c.artist||a.artist,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"artist",{hash:{}})),d+=m(e)+"\n        ",d}c=c||a.helpers,d=d||a.partials;var f="",g,h,i=this,j="function",k=c.helperMissing,l=void 0,m=this.escapeExpression,n=c.blockHelperMissing;f+='<div class="page-header">\n  <h1>\n    ',g=c.name||b.name,typeof g===j?g=g.call(b,{hash:{}}):g===l&&(g=k.call(b,"name",{hash:{}})),f+=m(g)+'\n  </h1>\n</div>\n\n<div class="row">\n\n  <div class="span12 columns">\n    <div class="summary">\n      ',g=c.summary||b.summary,typeof g===j?g=g.call(b,{hash:{}}):g===l&&(g=k.call(b,"summary",{hash:{}}));if(g||g===0)f+=g;f+='\n    </div>\n    <br style="clear: both"/>\n    <dl class="fields links">\n      <dt>artist</dt>\n      <dd>\n        ',g=c.artists||b.artists,h=i.program(1,o,e),h.hash={},h.fn=h,h.inverse=i.noop,typeof g===j?g=g.call(b,h):g=n.call(b,g,h);if(g||g===0)f+=g;f+="\n        ",g=c.artists||b.artists,h=i.noop,h.hash={},h.fn=h,h.inverse=i.program(3,p,e),typeof g===j?g=g.call(b,h):g=n.call(b,g,h);if(g||g===0)f+=g;f+='\n      </dd>\n      <dt>website</dt>\n      <dd><a href="',g=c.website||b.website,typeof g===j?g=g.call(b,{hash:{}}):g===l&&(g=k.call(b,"website",{hash:{}})),f+=m(g)+'" target="_blank">',g=c.website||b.website,typeof g===j?g=g.call(b,{hash:{}}):g===l&&(g=k.call(b,"website",{hash:{}})),f+=m(g)+'</a></dd>\n      <dt>subscribe</dt>\n      <dd><a href="',g=c.source_url||b.source_url,typeof g===j?g=g.call(b,{hash:{}}):g===l&&(g=k.call(b,"source_url",{hash:{}})),f+=m(g)+'" target="_blank">',g=c.source_url||b.source_url,typeof g===j?g=g.call(b,{hash:{}}):g===l&&(g=k.call(b,"source_url",{hash:{}})),f+=m(g)+'</a></dd>\n    </dl>\n\n    <br style="clear: both"/>\n\n    ',g=b,g=i.invokePartial(d.mixes,"mixes",g,c,d);if(g||g===0)f+=g;f+='\n  </div>\n\n  <div class="span4 columns">\n    <div class="art">\n      ',g=c.art_image||b.art_image,typeof g===j?g=g.call(b,{hash:{}}):g===l&&(g=k.call(b,"art_image",{hash:{}}));if(g||g===0)f+=g;return f+="\n    </div>\n  </div>\n\n</div>\n",f}),HandlebarsTemplates["templates/podcasts/show"]}.call(this),function(){return this.HandlebarsTemplates||(this.HandlebarsTemplates={}),this.HandlebarsTemplates["templates/videos/index"]=Handlebars.template(function(a,b,c,d,e){function o(a,b){var d="",e;return d+='\n    <div id="video-',e=c.id||a.id,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"id",{hash:{}})),d+=m(e)+'" class="video">\n      <div class="pad">\n        <div class="preview">\n          <a href="/videos/',e=c.id||a.id,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"id",{hash:{}})),d+=m(e)+'" class="play" data-id="',e=c.id||a.id,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"id",{hash:{}})),d+=m(e)+'">\n            <img src="',e=c.full||a.full,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"full",{hash:{}})),d+=m(e)+'" alt="',e=c.title||a.title,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"title",{hash:{}})),d+=m(e)+'" width="288" height="216"/>\n          </a>\n        </div>\n        <div class="info">\n          <h2><a href="/videos/',e=c.id||a.id,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"id",{hash:{}})),d+=m(e)+'" class="navigate">',e=c.title||a.title,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"title",{hash:{}})),d+=m(e)+"</a></h2>\n          <h3>",e=c.artist||a.artist,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"artist",{hash:{}})),d+=m(e)+'</h3>\n          <p><a href="',e=c.link||a.link,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"link",{hash:{}})),d+=m(e)+'" target="_blank">',e=c.link||a.link,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"link",{hash:{}})),d+=m(e)+'</a></p>\n          <p><span class="genre ',e=c.genre||a.genre,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"genre",{hash:{}})),d+=m(e)+'">',e=c.genre||a.genre,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"genre",{hash:{}})),d+=m(e)+"</span></p>\n          <p>posted ",e=c.published||a.published,typeof e===j?e=e.call(a,{hash:{}}):e===l&&(e=k.call(a,"published",{hash:{}})),d+=m(e)+"</p>\n        </div>\n      </div>\n    </div>\n    ",d}c=c||a.helpers;var f="",g,h,i=this,j="function",k=c.helperMissing,l=void 0,m=this.escapeExpression,n=c.blockHelperMissing;f+='<div class="page-header">\n  <h1>Trance Videos</h1>\n</div>\n<div class="page-body">\n  <div id="videos">\n    ',g=c.videos||b.videos,h=i.program(1,o,e),h.hash={},h.fn=h,h.inverse=i.noop,typeof g===j?g=g.call(b,h):g=n.call(b,g,h);if(g||g===0)f+=g;return f+="\n  </div>\n</div>\n",f}),HandlebarsTemplates["templates/videos/index"]}.call(this),function(){return this.HandlebarsTemplates||(this.HandlebarsTemplates={}),this.HandlebarsTemplates["templates/videos/show"]=Handlebars.template(function(a,b,c,d,e){c=c||a.helpers;var f="",g,h=this,i="function",j=c.helperMissing,k=void 0,l=this.escapeExpression;return f+='<img class="logo" width="246" height="20" src="/assets/logo.png"/>\n\n<div class="header">\n  <a href="#close" class="btn danger stop-video">Close</a>\n  <h1>',g=c.title||b.title,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"title",{hash:{}})),f+=l(g)+" <small>",g=c.artist||b.artist,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"artist",{hash:{}})),f+=l(g)+'</small></h1>\n</div>\n<div class="page-body">\n  <div id="video-',g=c.id||b.id,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"id",{hash:{}})),f+=l(g)+'" class="video big-video row">\n    <div class="span16 columns">\n      <iframe class="youtube-player" type="text/html" width="855" height="480" src="http://www.youtube.com/embed/',g=c.youtube_id||b.youtube_id,typeof g===i?g=g.call(b,{hash:{}}):g===k&&(g=j.call(b,"youtube_id",{hash:{}})),f+=l(g)+'?autoplay=1" frameborder="0">\n      </iframe>\n\n      <a href="#next" class="btn primary next">Next</a>\n      <a href="#prev" class="btn primary prev">Prev</a>\n    </div>\n  </div>\n</div>\n',f}),HandlebarsTemplates["templates/videos/show"]}.call(this),function(){tm.setupErrorHandlers=function(){var a,b,c,d,e,f,g;return $(document).ajaxSend(function(){return tm.em.trigger("tm:em:ajax:send",arguments)}),$(document).ajaxComplete(function(){return tm.em.trigger("tm:em:ajax:complete",arguments)}),$(document).ajaxError(function(b,c,d,g){f(c)&&a();if(e(c))return $("#error-message span").text("The server could not be contacted :-<  Please refresh your browser and try again."),$("#error-message").slideDown(),$("#loader").hide()}),f=function(a){return a.status===401},d=function(a){var b;return 500<=(b=a.status)&&b<=600},e=function(a){return a.status===0},a=function(){if(b())return;return $("#sign-up-plead").show(),$("#no").click(function(){return c(),$("#sign-up-plead").hide()})},b=function(){var a,b,c,d,e,f,g;b=document.cookie.split(";");try{for(e=0,f=b.length;e<f;e++){a=b[e],g=a.split("="),c=g[0],d=g[1];if(c.trim()==="seen-plead")return!0}return!1}catch(h){return!1}},c=function(){var a,b;return a=new Date,a.setTime(a.getTime()+g()),b="expires="+a.toGMTString(),document.cookie="seen-plead=true; "+b},g=function(){return 1728e5}}}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};window.Loadmore=function(){function b(b){this.finishLoading=a(this.finishLoading,this),this.startLoading=a(this.startLoading,this),this.load=a(this.load,this),this.view=b}return b.prototype.load=function(a,b){var c=this;return _.isUndefined(a)||a.preventDefault(),this.callback=b,this.collection.size()===5&&this.collection.reset([],{silent:!0}),this.startLoading(),this.collection.nextPage(this.finishLoading),this.collection.on("last-page",function(){return c.view.$("#loadmore").hide()}),this.collection.on("reset",function(){return c.view.$("#loadmore").show()})},b.prototype.startLoading=function(){return this.view.$("#loading").show(),this.view.$("#loadmore").hide()},b.prototype.finishLoading=function(){this.view.$("#loading").hide(),this.view.$("#loadmore").show();if(_.isFunction(this.callback))return this.callback()},b}()}.call(this),$(document).ready(function(){$("body").bind("click",function(a){$("ul.menu-dropdown").hide(),$("a.menu").parent("li").removeClass("open").children("ul.menu-dropdown").hide()}),$("a.menu").click(function(a){var b=$(this),c=b.parent("li"),d=b.siblings("ul.menu-dropdown"),e=c.siblings("li");return c.hasClass("open")?(c.removeClass("open"),d.hide()):(c.addClass("open"),d.show()),e.children("ul.menu-dropdown").hide(),e.removeClass("open"),!1})}),function(){$(document).ready(function(){return $("#show-passwords").click(function(){return $(this).parent().parent().hide(),$("#password-fields").fadeIn(),!1})})}.call(this),function(){tm.alert=function(){return $(".alert-message").alert()},tm.admin=function(){var a;return $("#admin-show").click(function(){var b;return b=window.location.pathname,$(this).attr("href",a(b)),$(this).attr("target","_blank")}),$("#admin-edit").click(function(){var b;return b=window.location.pathname,$(this).attr("href",a(b)+"/edit"),$(this).attr("target","_blank")}),a=function(a){var b,c,d;return d=a.split("/")[1],c=a.split("/")[2],b=function(){switch(d){case"mixes":return"/admin/mix";case"podcasts":return"/admin/podcast";case"artists":return"/admin/artist";case"videos":return"/admin/video";default:return"/admin"}}(),c&&(b+="/"+c),b}},tm.plugins=function(){return this.alert(),this.admin()}}.call(this);
