;(function($){$.ui=$.ui||{};$.extend($.ui,{plugin:{add:function(module,option,set){var proto=$.ui[module].prototype;for(var i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]]);}},call:function(instance,name,args){var set=instance.plugins[name];if(!set){return;} for(var i=0;i').addClass(name).css({position:'absolute',top:'-5000px',left:'-5000px',display:'block'}).appendTo('body');$.ui.cssCache[name]=!!((!(/auto|default/).test(tmp.css('cursor'))||(/^[1-9]/).test(tmp.css('height'))||(/^[1-9]/).test(tmp.css('width'))||!(/none/).test(tmp.css('backgroundImage'))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(tmp.css('backgroundColor'))));try{$('body').get(0).removeChild(tmp.get(0));}catch(e){} return $.ui.cssCache[name];},disableSelection:function(e){e.unselectable="on";e.onselectstart=function(){return false;};if(e.style){e.style.MozUserSelect="none";}},enableSelection:function(e){e.unselectable="off";e.onselectstart=function(){return true;};if(e.style){e.style.MozUserSelect="";}},hasScroll:function(e,a){var scroll=/top/.test(a||"top")?'scrollTop':'scrollLeft',has=false;if(e[scroll]>0)return true;e[scroll]=1;has=e[scroll]>0?true:false;e[scroll]=0;return has;}});var _remove=$.fn.remove;$.fn.remove=function(){$("*",this).add(this).trigger("remove");return _remove.apply(this,arguments);};function getter(namespace,plugin,method){var methods=$[namespace][plugin].getter||[];methods=(typeof methods=="string"?methods.split(/,?\s+/):methods);return($.inArray(method,methods)!=-1);};var widgetPrototype={init:function(){},destroy:function(){},getData:function(e,key){return this.options[key];},setData:function(e,key,value){this.options[key]=value;},enable:function(){this.setData(null,'disabled',false);},disable:function(){this.setData(null,'disabled',true);}};$.widget=function(name,prototype){var namespace=name.split(".")[0];name=name.split(".")[1];$.fn[name]=function(options,data){var isMethodCall=(typeof options=='string'),args=arguments;if(isMethodCall&&getter(namespace,name,options)){var instance=$.data(this[0],name);return(instance?instance[options](data):undefined);} return this.each(function(){var instance=$.data(this,name);if(!instance){$.data(this,name,new $[namespace][name](this,options));}else if(isMethodCall){instance[options].apply(instance,$.makeArray(args).slice(1));}});};$[namespace][name]=function(element,options){var self=this;this.options=$.extend({},$[namespace][name].defaults,options);this.element=$(element).bind('setData.'+name,function(e,key,value){return self.setData(e,key,value);}).bind('getData.'+name,function(e,key){return self.getData(e,key);}).bind('remove',function(){return self.destroy();});this.init();};$[namespace][name].prototype=$.extend({},widgetPrototype,prototype);};$.widget("ui.mouse",{init:function(){var self=this;this.element.bind('mousedown.mouse',function(){return self.click.apply(self,arguments);}).bind('mouseup.mouse',function(){(self.timer&&clearInterval(self.timer));}).bind('click.mouse',function(){if(self.initialized){self.initialized=false;return false;}});if($.browser.msie){this.unselectable=this.element.attr('unselectable');this.element.attr('unselectable','on');}},destroy:function(){this.element.unbind('.mouse').removeData("mouse");($.browser.msie&&this.element.attr('unselectable',this.unselectable));},trigger:function(){return this.click.apply(this,arguments);},click:function(e){if(e.which!=1||$.inArray(e.target.nodeName.toLowerCase(),this.options.dragPrevention||[])!=-1||(this.options.condition&&!this.options.condition.apply(this.options.executor||this,[e,this.element]))){return true;} var self=this;this.initialized=false;var initialize=function(){self._MP={left:e.pageX,top:e.pageY};$(document).bind('mouseup.mouse',function(){return self.stop.apply(self,arguments);});$(document).bind('mousemove.mouse',function(){return self.drag.apply(self,arguments);});if(!self.initalized&&Math.abs(self._MP.left-e.pageX)>=self.options.distance||Math.abs(self._MP.top-e.pageY)>=self.options.distance){(self.options.start&&self.options.start.call(self.options.executor||self,e,self.element));(self.options.drag&&self.options.drag.call(self.options.executor||self,e,this.element));self.initialized=true;}};if(this.options.delay){if(this.timer){clearInterval(this.timer);} this.timer=setTimeout(initialize,this.options.delay);}else{initialize();} return false;},stop:function(e){if(!this.initialized){return $(document).unbind('mouseup.mouse').unbind('mousemove.mouse');} (this.options.stop&&this.options.stop.call(this.options.executor||this,e,this.element));$(document).unbind('mouseup.mouse').unbind('mousemove.mouse');return false;},drag:function(e){var o=this.options;if($.browser.msie&&!e.button){return this.stop.call(this,e);} if(!this.initialized&&(Math.abs(this._MP.left-e.pageX)>=o.distance||Math.abs(this._MP.top-e.pageY)>=o.distance)){(o.start&&o.start.call(o.executor||this,e,this.element));this.initialized=true;}else{if(!this.initialized){return false;}} (o.drag&&o.drag.call(this.options.executor||this,e,this.element));return false;}});})(jQuery);;(function($){$.widget("ui.draggable",{init:function(){var o=this.options;this.element.mouse({executor:this,delay:o.delay,distance:o.distance,dragPrevention:o.cancel,start:this.start,stop:this.stop,drag:this.drag,condition:function(e){var handle=!this.options.handle||!$(this.options.handle,this.element).length?true:false;if(!handle)$(this.options.handle,this.element).each(function(){if(this==e.target)handle=true;});return!(e.target.className.indexOf("ui-resizable-handle")!=-1||this.options.disabled)&&handle;}});if(o.helper=='original'&&!(/(relative|absolute|fixed)/).test(this.element.css('position'))) this.element.css('position','relative');},start:function(e){var o=this.options;if($.ui.ddmanager)$.ui.ddmanager.current=this;this.helper=$.isFunction(o.helper)?$(o.helper.apply(this.element[0],[e])):(o.helper=='clone'?this.element.clone():this.element);if(!this.helper.parents('body').length)this.helper.appendTo((o.appendTo=='parent'?this.element[0].parentNode:o.appendTo));if(!this.helper.css("position")||this.helper.css("position")=="static")this.helper.css("position","absolute");this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)};this.cssPosition=this.helper.css("position");this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top};this.offsetParent=this.helper.offsetParent();var po=this.offsetParent.offset();this.offset.parent={top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};var p=this.element.position();this.offset.relative=this.cssPosition=="relative"?{top:p.top-(parseInt(this.helper.css("top"),10)||0)+this.offsetParent[0].scrollTop,left:p.left-(parseInt(this.helper.css("left"),10)||0)+this.offsetParent[0].scrollLeft}:{top:0,left:0};this.originalPosition=this.generatePosition(e);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(o.cursorAt){if(o.cursorAt.left!=undefined)this.offset.click.left=o.cursorAt.left;if(o.cursorAt.right!=undefined)this.offset.click.left=this.helperProportions.width-o.cursorAt.right;if(o.cursorAt.top!=undefined)this.offset.click.top=o.cursorAt.top;if(o.cursorAt.bottom!=undefined)this.offset.click.top=this.helperProportions.height-o.cursorAt.bottom;} if(o.containment){if(o.containment=='parent')o.containment=this.helper[0].parentNode;if(o.containment=='document')this.containment=[0,0,$(document).width(),($(document).height()||document.body.parentNode.scrollHeight)];if(!(/^(document|window|parent)$/).test(o.containment)){var ce=$(o.containment)[0];var co=$(o.containment).offset();this.containment=[co.left+(parseInt($(ce).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left,co.top+(parseInt($(ce).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top,co.left+Math.max(ce.scrollWidth,ce.offsetWidth)-(parseInt($(ce).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),co.top+Math.max(ce.scrollHeight,ce.offsetHeight)-(parseInt($(ce).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)];}} this.propagate("start",e);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if($.ui.ddmanager&&!o.dropBehaviour)$.ui.ddmanager.prepareOffsets(this,e);return false;},convertPositionTo:function(d,pos){if(!pos)pos=this.position;var mod=d=="absolute"?1:-1;return{top:(pos.top +this.offset.relative.top*mod +this.offset.parent.top*mod -(this.cssPosition=="fixed"?0:this.offsetParent[0].scrollTop)*mod +this.margins.top*mod),left:(pos.left +this.offset.relative.left*mod +this.offset.parent.left*mod -(this.cssPosition=="fixed"?0:this.offsetParent[0].scrollLeft)*mod +this.margins.left*mod)};},generatePosition:function(e){var o=this.options;var position={top:(e.pageY -this.offset.click.top -this.offset.relative.top -this.offset.parent.top +(this.cssPosition=="fixed"?0:this.offsetParent[0].scrollTop)),left:(e.pageX -this.offset.click.left -this.offset.relative.left -this.offset.parent.left +(this.cssPosition=="fixed"?0:this.offsetParent[0].scrollLeft))};if(!this.originalPosition)return position;if(this.containment){if(position.leftthis.containment[2])position.left=this.containment[2];if(position.top>this.containment[3])position.top=this.containment[3];} if(o.grid){var top=this.originalPosition.top+Math.round((position.top-this.originalPosition.top)/o.grid[1])*o.grid[1];position.top=this.containment?(!(topthis.containment[3])?top:(!(topthis.containment[2])?left:(!(left').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css($(this).offset()).appendTo("body");});},stop:function(e,ui){$("div.DragDropIframeFix").each(function(){this.parentNode.removeChild(this);});}});$.ui.plugin.add("draggable","scroll",{start:function(e,ui){var o=ui.options;var i=$(this).data("draggable");o.scrollSensitivity=o.scrollSensitivity||20;o.scrollSpeed=o.scrollSpeed||20;i.overflowY=function(el){do{if(/auto|scroll/.test(el.css('overflow'))||(/auto|scroll/).test(el.css('overflow-y')))return el;el=el.parent();}while(el[0].parentNode);return $(document);}(this);i.overflowX=function(el){do{if(/auto|scroll/.test(el.css('overflow'))||(/auto|scroll/).test(el.css('overflow-x')))return el;el=el.parent();}while(el[0].parentNode);return $(document);}(this);if(i.overflowY[0]!=document&&i.overflowY[0].tagName!='HTML')i.overflowYOffset=i.overflowY.offset();if(i.overflowX[0]!=document&&i.overflowX[0].tagName!='HTML')i.overflowXOffset=i.overflowX.offset();},drag:function(e,ui){var o=ui.options;var i=$(this).data("draggable");if(i.overflowY[0]!=document&&i.overflowY[0].tagName!='HTML'){if((i.overflowYOffset.top+i.overflowY[0].offsetHeight)-e.pageY=0;i--){var l=inst.snapElements[i].left,r=l+inst.snapElements[i].width,t=inst.snapElements[i].top,b=t+inst.snapElements[i].height;if(!((l-dt&&y1b)||(x2>l&&x1r)))return false;if(y2-(draggable.helperProportions.height/2)>t&&y1b)return 2;if(x2>l&&x1r)return 2;break;case'intersect':return(l=t&&y1<=b)||(y2>=t&&y2<=b)||(y1b))&&((x1>=l&&x1<=r)||(x2>=l&&x2<=r)||(x1r));break;default:return false;break;}};$.ui.ddmanager={current:null,droppables:[],prepareOffsets:function(t,e){var m=$.ui.ddmanager.droppables;var type=e?e.type:null;for(var i=0;i').css({position:el.css('position'),width:el.outerWidth(),height:el.outerHeight(),top:el.css('top'),left:el.css('left')}));var oel=this.element;this.element=this.element.parent();this.element.css({marginLeft:oel.css("marginLeft"),marginTop:oel.css("marginTop"),marginRight:oel.css("marginRight"),marginBottom:oel.css("marginBottom")});oel.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});if($.browser.safari&&o.preventDefault)oel.css('resize','none');o.proportionallyResize=oel.css({position:'static',zoom:1,display:'block'});this.element.css({margin:oel.css('margin')});this._proportionallyResize();} if(!o.handles)o.handles=!$('.ui-resizable-handle',this.element).length?"e,s,se":{n:'.ui-resizable-n',e:'.ui-resizable-e',s:'.ui-resizable-s',w:'.ui-resizable-w',se:'.ui-resizable-se',sw:'.ui-resizable-sw',ne:'.ui-resizable-ne',nw:'.ui-resizable-nw'};if(o.handles.constructor==String){o.zIndex=o.zIndex||1000;if(o.handles=='all')o.handles='n,e,s,w,se,sw,ne,nw';var n=o.handles.split(",");o.handles={};var insertionsDefault={handle:'position: absolute; display: none; overflow:hidden;',n:'top: 0pt; width:100%;',e:'right: 0pt; height:100%;',s:'bottom: 0pt; width:100%;',w:'left: 0pt; height:100%;',se:'bottom: 0pt; right: 0px;',sw:'bottom: 0pt; left: 0px;',ne:'top: 0pt; right: 0px;',nw:'top: 0pt; left: 0px;'};for(var i=0;i'].join('')).css(applyZIndex);o.handles[handle]='.ui-resizable-'+handle;this.element.append(axis.css(loadDefault?allDefTheme:{}).css(o.knobHandles?allKnobTheme:{}).addClass(o.knobHandles?'ui-resizable-knob-handle':'').addClass(o.knobHandles));} if(o.knobHandles)this.element.addClass('ui-resizable-knob').css(!$.ui.css('ui-resizable-knob')?{}:{});} this._renderAxis=function(target){target=target||this.element;for(var i in o.handles){if(o.handles[i].constructor==String) o.handles[i]=$(o.handles[i],this.element).show();if(o.transparent) o.handles[i].css({opacity:0});if(this.element.is('.ui-wrapper')&&o._nodeName.match(/textarea|input|select|button/i)){var axis=$(o.handles[i],this.element),padWrapper=0;padWrapper=/sw|ne|nw|se|n|s/.test(i)?axis.outerHeight():axis.outerWidth();var padPos=['padding',/ne|nw|n/.test(i)?'Top':/se|sw|s/.test(i)?'Bottom':/^e$/.test(i)?'Right':'Left'].join("");if(!o.transparent) target.css(padPos,padWrapper);this._proportionallyResize();} if(!$(o.handles[i]).length)continue;}};this._renderAxis(this.element);o._handles=$('.ui-resizable-handle',self.element);if(o.disableSelection) o._handles.each(function(i,e){$.ui.disableSelection(e);});o._handles.mouseover(function(){if(!o.resizing){if(this.className) var axis=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);self.axis=o.axis=axis&&axis[1]?axis[1]:'se';}});if(o.autohide){o._handles.hide();$(self.element).addClass("ui-resizable-autohide").hover(function(){$(this).removeClass("ui-resizable-autohide");o._handles.show();},function(){if(!o.resizing){$(this).addClass("ui-resizable-autohide");o._handles.hide();}});} this.element.mouse({executor:this,delay:0,distance:0,dragPrevention:['input','textarea','button','select','option'],start:this.start,stop:this.stop,drag:this.drag,condition:function(e){if(this.disabled)return false;for(var i in this.options.handles){if($(this.options.handles[i])[0]==e.target)return true;} return false;}});},plugins:{},ui:function(){return{instance:this,axis:this.options.axis,options:this.options};},propagate:function(n,e){$.ui.plugin.call(this,n,[e,this.ui()]);this.element.triggerHandler(n=="resize"?n:["resize",n].join(""),[e,this.ui()],this.options[n]);},destroy:function(){var el=this.element,wrapped=el.children(".ui-resizable").get(0),_destroy=function(exp){$(exp).removeClass("ui-resizable ui-resizable-disabled").mouse("destroy").removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove();};_destroy(el);if(el.is('.ui-wrapper')&&wrapped){el.parent().append($(wrapped).css({position:el.css('position'),width:el.outerWidth(),height:el.outerHeight(),top:el.css('top'),left:el.css('left')})).end().remove();_destroy(wrapped);}},enable:function(){this.element.removeClass("ui-resizable-disabled");this.disabled=false;},disable:function(){this.element.addClass("ui-resizable-disabled");this.disabled=true;},start:function(e){var o=this.options,iniPos=this.element.position(),el=this.element,num=function(v){return parseInt(v,10)||0;},ie6=$.browser.msie&&$.browser.version<7;o.resizing=true;o.documentScroll={top:$(document).scrollTop(),left:$(document).scrollLeft()};if(el.is('.ui-draggable')||(/absolute/).test(el.css('position'))){var sOffset=$.browser.msie&&!o.containment&&(/absolute/).test(el.css('position'))&&!(/relative/).test(el.parent().css('position'));var dscrollt=sOffset?o.documentScroll.top:0,dscrolll=sOffset?o.documentScroll.left:0;el.css({position:'absolute',top:(iniPos.top+dscrollt),left:(iniPos.left+dscrolll)});} if(/relative/.test(el.css('position'))&&$.browser.opera) el.css({position:'relative',top:'auto',left:'auto'});this._renderProxy();var curleft=num(this.helper.css('left')),curtop=num(this.helper.css('top'));this.offset=this.helper.offset();this.position={left:curleft,top:curtop};this.size=o.proxy||ie6?{width:el.outerWidth(),height:el.outerHeight()}:{width:el.width(),height:el.height()};this.originalSize=o.proxy||ie6?{width:el.outerWidth(),height:el.outerHeight()}:{width:el.width(),height:el.height()};this.originalPosition={left:curleft,top:curtop};this.sizeDiff={width:el.outerWidth()-el.width(),height:el.outerHeight()-el.height()};this.originalMousePosition={left:e.pageX,top:e.pageY};o.aspectRatio=(typeof o.aspectRatio=='number')?o.aspectRatio:((this.originalSize.height/this.originalSize.width)||1);if(o.preserveCursor) $('body').css('cursor',this.axis+'-resize');this.propagate("start",e);return false;},stop:function(e){this.options.resizing=false;var o=this.options,num=function(v){return parseInt(v,10)||0;},self=this;if(o.proxy){var pr=o.proportionallyResize,ista=pr&&(/textarea/i).test(pr.get(0).nodeName),soffseth=ista&&$.ui.hasScroll(pr.get(0),'left')?0:self.sizeDiff.height,soffsetw=ista?0:self.sizeDiff.width;var s={width:(self.size.width-soffsetw),height:(self.size.height-soffseth)},left=(parseInt(self.element.css('left'),10)+(self.position.left-self.originalPosition.left))||null,top=(parseInt(self.element.css('top'),10)+(self.position.top-self.originalPosition.top))||null;if(!o.animate) this.element.css($.extend(s,{top:top,left:left}));if(o.proxy&&!o.animate)this._proportionallyResize();this.helper.remove();} if(o.preserveCursor) $('body').css('cursor','auto');this.propagate("stop",e);return false;},drag:function(e){var el=this.helper,o=this.options,props={},self=this,smp=this.originalMousePosition,a=this.axis;var dx=(e.pageX-smp.left)||0,dy=(e.pageY-smp.top)||0;var trigger=this._change[a];if(!trigger)return false;var data=trigger.apply(this,[e,dx,dy]),ie6=$.browser.msie&&$.browser.version<7,csdif=this.sizeDiff;if(o._aspectRatio||e.shiftKey) data=this._updateRatio(data,e);data=this._respectSize(data,e);this.propagate("resize",e);el.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!o.proxy&&o.proportionallyResize) this._proportionallyResize();this._updateCache(data);return false;},_updateCache:function(data){var o=this.options;this.offset=this.helper.offset();if(data.left)this.position.left=data.left;if(data.top)this.position.top=data.top;if(data.height)this.size.height=data.height;if(data.width)this.size.width=data.width;},_updateRatio:function(data,e){var o=this.options,cpos=this.position,csize=this.size,a=this.axis;if(data.height)data.width=(csize.height/o.aspectRatio);else if(data.width)data.height=(csize.width*o.aspectRatio);if(a=='sw'){data.left=cpos.left+(csize.width-data.width);data.top=null;} if(a=='nw'){data.top=cpos.top+(csize.height-data.height);data.left=cpos.left+(csize.width-data.width);} return data;},_respectSize:function(data,e){var el=this.helper,o=this.options,pRatio=o._aspectRatio||e.shiftKey,a=this.axis,ismaxw=data.width&&o.maxWidth&&o.maxWidthdata.width,isminh=data.height&&o.minHeight&&o.minHeight>data.height;if(isminw)data.width=o.minWidth;if(isminh)data.height=o.minHeight;if(ismaxw)data.width=o.maxWidth;if(ismaxh)data.height=o.maxHeight;var dw=this.originalPosition.left+this.originalSize.width,dh=this.position.top+this.size.height;var cw=/sw|nw|w/.test(a),ch=/nw|ne|n/.test(a);if(isminw&&cw)data.left=dw-o.minWidth;if(ismaxw&&cw)data.left=dw-o.maxWidth;if(isminh&&ch)data.top=dh-o.minHeight;if(ismaxh&&ch)data.top=dh-o.maxHeight;var isNotwh=!data.width&&!data.height;if(isNotwh&&!data.left&&data.top)data.top=null;else if(isNotwh&&!data.top&&data.left)data.left=null;return data;},_proportionallyResize:function(){var o=this.options;if(!o.proportionallyResize)return;var prel=o.proportionallyResize,el=this.helper||this.element;if(!o.borderDif){var b=[prel.css('borderTopWidth'),prel.css('borderRightWidth'),prel.css('borderBottomWidth'),prel.css('borderLeftWidth')],p=[prel.css('paddingTop'),prel.css('paddingRight'),prel.css('paddingBottom'),prel.css('paddingLeft')];o.borderDif=$.map(b,function(v,i){var border=parseInt(v,10)||0,padding=parseInt(p[i],10)||0;return border+padding;});} prel.css({height:(el.height()-o.borderDif[0]-o.borderDif[2])+"px",width:(el.width()-o.borderDif[1]-o.borderDif[3])+"px"});},_renderProxy:function(){var el=this.element,o=this.options;this.elementOffset=el.offset();if(o.proxy){this.helper=this.helper||$('
');var ie6=$.browser.msie&&$.browser.version<7,ie6offset=(ie6?1:0),pxyoffset=(ie6?2:-1);this.helper.addClass(o.proxy).css({width:el.outerWidth()+pxyoffset,height:el.outerHeight()+pxyoffset,position:'absolute',left:this.elementOffset.left-ie6offset+'px',top:this.elementOffset.top-ie6offset+'px',zIndex:++o.zIndex});this.helper.appendTo("body");if(o.disableSelection) $.ui.disableSelection(this.helper.get(0));}else{this.helper=el;}},_change:{e:function(e,dx,dy){return{width:this.originalSize.width+dx};},w:function(e,dx,dy){var o=this.options,cs=this.originalSize,sp=this.originalPosition;return{left:sp.left+dx,width:cs.width-dx};},n:function(e,dx,dy){var o=this.options,cs=this.originalSize,sp=this.originalPosition;return{top:sp.top+dy,height:cs.height-dy};},s:function(e,dx,dy){return{height:this.originalSize.height+dy};},se:function(e,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,dx,dy]));},sw:function(e,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,dx,dy]));},ne:function(e,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,dx,dy]));},nw:function(e,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,dx,dy]));}}});$.extend($.ui.resizable,{defaults:{preventDefault:true,transparent:false,minWidth:10,minHeight:10,aspectRatio:false,disableSelection:true,preserveCursor:true,autohide:false,knobHandles:false}});$.ui.plugin.add("resizable","containment",{start:function(e,ui){var o=ui.options,self=ui.instance,el=self.element;var oc=o.containment,ce=(oc instanceof $)?oc.get(0):(/parent/.test(oc))?el.parent().get(0):oc;if(!ce)return;if(/document/.test(oc)||oc==document){self.containerOffset={left:0,top:0};self.parentData={element:$(document),left:0,top:0,width:$(document).width(),height:$(document).height()||document.body.parentNode.scrollHeight};} else{self.containerOffset=$(ce).offset();self.containerSize={height:$(ce).innerHeight(),width:$(ce).innerWidth()};var co=self.containerOffset,ch=self.containerSize.height,cw=self.containerSize.width,width=($.ui.hasScroll(ce,"left")?ce.scrollWidth:cw),height=($.ui.hasScroll(ce)?ce.scrollHeight:ch);self.parentData={element:ce,left:co.left,top:co.top,width:width,height:height};}},resize:function(e,ui){var o=ui.options,self=ui.instance,ps=self.containerSize,co=self.containerOffset,cs=self.size,cp=self.position,pRatio=o._aspectRatio||e.shiftKey;if(cp.left<(o.proxy?co.left:0)){self.size.width=self.size.width+(o.proxy?(self.position.left-co.left):self.position.left);if(pRatio)self.size.height=self.size.width*o.aspectRatio;self.position.left=o.proxy?co.left:0;} if(cp.top<(o.proxy?co.top:0)){self.size.height=self.size.height+(o.proxy?(self.position.top-co.top):self.position.top);if(pRatio)self.size.width=self.size.height/o.aspectRatio;self.position.top=o.proxy?co.top:0;} var woset=(o.proxy?self.offset.left-co.left:self.position.left)+self.sizeDiff.width,hoset=(o.proxy?self.offset.top-co.top:self.position.top)+self.sizeDiff.height;if(woset+self.size.width>=self.parentData.width){self.size.width=self.parentData.width-woset;if(pRatio)self.size.height=self.size.width*o.aspectRatio;} if(hoset+self.size.height>=self.parentData.height){self.size.height=self.parentData.height-hoset;if(pRatio)self.size.width=self.size.height/o.aspectRatio;}}});$.ui.plugin.add("resizable","grid",{resize:function(e,ui){var o=ui.options,self=ui.instance,cs=self.size,os=self.originalSize,op=self.originalPosition,a=self.axis,ratio=o._aspectRatio||e.shiftKey;o.grid=typeof o.grid=="number"?[o.grid,o.grid]:o.grid;var ox=Math.round((cs.width-os.width)/o.grid[0])*o.grid[0],oy=Math.round((cs.height-os.height)/o.grid[1])*o.grid[1];if(/^(se|s|e)$/.test(a)){self.size.width=os.width+ox;self.size.height=os.height+oy;} else if(/^(ne)$/.test(a)){self.size.width=os.width+ox;self.size.height=os.height+oy;self.position.top=op.top-oy;} else if(/^(sw)$/.test(a)){self.size.width=os.width+ox;self.size.height=os.height+oy;self.position.left=op.left-ox;} else{self.size.width=os.width+ox;self.size.height=os.height+oy;self.position.top=op.top-oy;self.position.left=op.left-ox;}}});$.ui.plugin.add("resizable","animate",{stop:function(e,ui){var o=ui.options,self=ui.instance;var pr=o.proportionallyResize,ista=pr&&(/textarea/i).test(pr.get(0).nodeName),soffseth=ista&&$.ui.hasScroll(pr.get(0),'left')?0:self.sizeDiff.height,soffsetw=ista?0:self.sizeDiff.width;var style={width:(self.size.width-soffsetw),height:(self.size.height-soffseth)},left=(parseInt(self.element.css('left'),10)+(self.position.left-self.originalPosition.left))||null,top=(parseInt(self.element.css('top'),10)+(self.position.top-self.originalPosition.top))||null;self.element.animate($.extend(style,top&&left?{top:top,left:left}:{}),{duration:o.animateDuration||"slow",easing:o.animateEasing||"swing",step:function(){var data={width:parseInt(self.element.css('width'),10),height:parseInt(self.element.css('height'),10),top:parseInt(self.element.css('top'),10),left:parseInt(self.element.css('left'),10)};if(pr)pr.css({width:data.width,height:data.height});self._updateCache(data);self.propagate("animate",e);}});}});$.ui.plugin.add("resizable","ghost",{start:function(e,ui){var o=ui.options,self=ui.instance,pr=o.proportionallyResize,cs=self.size;if(!pr)self.ghost=self.element.clone();else self.ghost=pr.clone();self.ghost.css({opacity:.25,display:'block',position:'relative',height:cs.height,width:cs.width,margin:0,left:0,top:0}).addClass('ui-resizable-ghost').addClass(typeof o.ghost=='string'?o.ghost:'');self.ghost.appendTo(self.helper);},resize:function(e,ui){var o=ui.options,self=ui.instance,pr=o.proportionallyResize;if(self.ghost)self.ghost.css({position:'relative',height:self.size.height,width:self.size.width});},stop:function(e,ui){var o=ui.options,self=ui.instance,pr=o.proportionallyResize;if(self.ghost&&self.helper)self.helper.get(0).removeChild(self.ghost.get(0));}});$.ui.plugin.add("resizable","alsoResize",{start:function(e,ui){var o=ui.options,self=ui.instance,_store=function(exp){$(exp).each(function(){$(this).data("resizable-alsoresize-start",{width:parseInt($(this).css('width'),10),height:parseInt($(this).css('height'),10),left:parseInt($(this).css('left'),10),top:parseInt($(this).css('top'),10)});});};if(typeof(o.alsoResize)=='object'){$.each(o.alsoResize,function(exp,c){_store(exp);});}else{_store(o.alsoResize);}},resize:function(e,ui){var o=ui.options,self=ui.instance,os=self.originalSize,op=self.originalPosition;var delta={height:(self.size.height-os.height)||0,width:(self.size.width-os.width)||0,top:(self.position.top-op.top)||0,left:(self.position.left-op.left)||0},_alsoResize=function(exp,c){$(exp).each(function(){var start=$(this).data("resizable-alsoresize-start"),style={},css=c&&c.length?c:['width','height','top','left'];$.each(css||['width','height','top','left'],function(i,prop){style[prop]=(start[prop]+delta[prop])||null});$(this).css(style);});};if(typeof(o.alsoResize)=='object'){$.each(o.alsoResize,function(exp,c){_alsoResize(exp,c);});}else{_alsoResize(o.alsoResize);}},stop:function(e,ui){$(this).removeData("resizable-alsoresize-start");}});})(jQuery);;(function($){$.widget("ui.selectable",{init:function(){var instance=this;this.element.addClass("ui-selectable");this.element.bind("setData.selectable",function(event,key,value){instance.options[key]=value;}).bind("getData.selectable",function(event,key){return instance.options[key];});this.dragged=false;var selectees;this.refresh=function(){selectees=$(instance.options.filter,instance.element[0]);selectees.each(function(){var $this=$(this);var pos=$this.offset();$.data(this,"selectable-item",{element:this,$element:$this,left:pos.left,top:pos.top,right:pos.left+$this.width(),bottom:pos.top+$this.height(),startselected:false,selected:$this.hasClass('ui-selected'),selecting:$this.hasClass('ui-selecting'),unselecting:$this.hasClass('ui-unselecting')});});};this.refresh();this.selectees=selectees.addClass("ui-selectee");this.element.mouse({executor:this,appendTo:'body',delay:0,distance:0,dragPrevention:['input','textarea','button','select','option'],start:this.start,stop:this.stop,drag:this.drag,condition:function(e){var isSelectee=false;$(e.target).parents().andSelf().each(function(){if($.data(this,"selectable-item"))isSelectee=true;});return this.options.keyboard?!isSelectee:true;}});this.helper=$(document.createElement('div')).css({border:'1px dotted black'});},toggle:function(){if(this.disabled){this.enable();}else{this.disable();}},destroy:function(){this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable").mouse("destroy");},enable:function(){this.element.removeClass("ui-selectable-disabled");this.disabled=false;},disable:function(){this.element.addClass("ui-selectable-disabled");this.disabled=true;},start:function(ev,element){this.opos=[ev.pageX,ev.pageY];if(this.disabled) return;var options=this.options;this.selectees=$(options.filter,element);this.element.triggerHandler("selectablestart",[ev,{"selectable":element,"options":options}],options.start);$('body').append(this.helper);this.helper.css({"z-index":100,"position":"absolute","left":ev.clientX,"top":ev.clientY,"width":0,"height":0});if(options.autoRefresh){this.refresh();} this.selectees.filter('.ui-selected').each(function(){var selectee=$.data(this,"selectable-item");selectee.startselected=true;if(!ev.ctrlKey){selectee.$element.removeClass('ui-selected');selectee.selected=false;selectee.$element.addClass('ui-unselecting');selectee.unselecting=true;$(this.element).triggerHandler("selectableunselecting",[ev,{selectable:element,unselecting:selectee.element,options:options}],options.unselecting);}});},drag:function(ev,element){this.dragged=true;if(this.disabled) return;var options=this.options;var x1=this.opos[0],y1=this.opos[1],x2=ev.pageX,y2=ev.pageY;if(x1>x2){var tmp=x2;x2=x1;x1=tmp;} if(y1>y2){var tmp=y2;y2=y1;y1=tmp;} this.helper.css({left:x1,top:y1,width:x2-x1,height:y2-y1});this.selectees.each(function(){var selectee=$.data(this,"selectable-item");if(!selectee||selectee.element==element) return;var hit=false;if(options.tolerance=='touch'){hit=(!(selectee.left>x2||selectee.righty2||selectee.bottomx1&&selectee.righty1&&selectee.bottomt&&y1+this.clickOffset.topl&&x1+this.clickOffset.leftt&&y1+this.clickOffset.topl&&x1+this.clickOffset.leftl&&x1+this.clickOffset.leftl+item.width/2&&x1+this.clickOffset.leftt&&y1+this.clickOffset.topt+item.height/2&&y1+this.clickOffset.topl&&x1r)return 1;}else{if(y2>t&&y1b)return 2;}} return false;},inEmptyZone:function(container){if(!$(container.options.items,container.element).length){return container.options.dropOnEmpty?true:false;};var last=$(container.options.items,container.element).not('.ui-sortable-helper');last=$(last[last.length-1]);var top=last.offset()[this.floating?'left':'top']+last[0][this.floating?'offsetWidth':'offsetHeight'];return(this.position.absolute[this.floating?'left':'top']>top);},refresh:function(){this.refreshItems();this.refreshPositions();},refreshItems:function(){this.items=[];this.containers=[this];var items=this.items;var queries=[$(this.options.items,this.element)];if(this.options.connectWith){for(var i=this.options.connectWith.length-1;i>=0;i--){var cur=$(this.options.connectWith[i]);for(var j=cur.length-1;j>=0;j--){var inst=$.data(cur[j],'sortable');if(inst&&!inst.options.disabled){queries.push($(inst.options.items,inst.element));this.containers.push(inst);}};};} for(var i=queries.length-1;i>=0;i--){queries[i].each(function(){$.data(this,'sortable-item',true);items.push({item:$(this),width:0,height:0,left:0,top:0});});};},refreshPositions:function(fast){for(var i=this.items.length-1;i>=0;i--){var t=this.items[i].item;if(!fast)this.items[i].width=(this.options.toleranceElement?$(this.options.toleranceElement,t):t).outerWidth();if(!fast)this.items[i].height=(this.options.toleranceElement?$(this.options.toleranceElement,t):t).outerHeight();var p=(this.options.toleranceElement?$(this.options.toleranceElement,t):t).offset();this.items[i].left=p.left;this.items[i].top=p.top;};for(var i=this.containers.length-1;i>=0;i--){var p=this.containers[i].element.offset();this.containers[i].containerCache.left=p.left;this.containers[i].containerCache.top=p.top;this.containers[i].containerCache.width=this.containers[i].element.outerWidth();this.containers[i].containerCache.height=this.containers[i].element.outerHeight();};},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable").mouse("destroy");for(var i=this.items.length-1;i>=0;i--) this.items[i].item.removeData("sortable-item");},createPlaceholder:function(that){(that||this).placeholderElement=this.options.placeholderElement?$(this.options.placeholderElement,(that||this).currentItem):(that||this).currentItem;(that||this).placeholder=$('
').addClass(this.options.placeholder).appendTo('body').css({position:'absolute'}).css((that||this).placeholderElement.offset()).css({width:(that||this).placeholderElement.outerWidth(),height:(that||this).placeholderElement.outerHeight()});},contactContainers:function(e){for(var i=this.containers.length-1;i>=0;i--){if(this.intersectsWith(this.containers[i].containerCache)){if(!this.containers[i].containerCache.over){if(this.currentContainer!=this.containers[i]){var dist=10000;var itemWithLeastDistance=null;var base=this.position.absolute[this.containers[i].floating?'left':'top'];for(var j=this.items.length-1;j>=0;j--){if(!contains(this.containers[i].element[0],this.items[j].item[0]))continue;var cur=this.items[j][this.containers[i].floating?'left':'top'];if(Math.abs(cur-base)=0;i--){this.containers[i].propagate("activate",e,this);} if($.ui.ddmanager)$.ui.ddmanager.current=this;if($.ui.ddmanager&&!o.dropBehaviour)$.ui.ddmanager.prepareOffsets(this,e);this.dragging=true;return false;},stop:function(e){this.propagate("stop",e);if(this.position.dom!=this.currentItem.prev()[0])this.propagate("update",e);if(!contains(this.element[0],this.currentItem[0])){this.propagate("remove",e);for(var i=this.containers.length-1;i>=0;i--){if(contains(this.containers[i].element[0],this.currentItem[0])){this.containers[i].propagate("update",e,this);this.containers[i].propagate("receive",e,this);}};};for(var i=this.containers.length-1;i>=0;i--){this.containers[i].propagate("deactivate",e,this);if(this.containers[i].containerCache.over){this.containers[i].propagate("out",e,this);this.containers[i].containerCache.over=0;}} if($.ui.ddmanager&&!this.options.dropBehaviour)$.ui.ddmanager.drop(this,e);this.dragging=false;if(this.cancelHelperRemoval)return false;$(this.currentItem).css('visibility','');if(this.placeholder)this.placeholder.remove();this.helper.remove();return false;},drag:function(e){this.position.current={top:e.pageY-this.offset.top,left:e.pageX-this.offset.left};this.position.absolute={left:e.pageX-this.clickOffset.left,top:e.pageY-this.clickOffset.top};for(var i=this.items.length-1;i>=0;i--){var intersection=this.intersectsWithEdge(this.items[i]);if(!intersection)continue;if(this.items[i].item[0]!=this.currentItem[0]&&this.currentItem[intersection==1?"next":"prev"]()[0]!=this.items[i].item[0]&&!contains(this.currentItem[0],this.items[i].item[0])&&(this.options.type=='semi-dynamic'?!contains(this.element[0],this.items[i].item[0]):true)){this.direction=intersection==1?"down":"up";this.rearrange(e,this.items[i]);this.propagate("change",e);break;}} this.contactContainers(e);if($.ui.ddmanager)$.ui.ddmanager.drag(this,e);this.propagate("sort",e);this.helper.css({left:this.position.current.left+'px',top:this.position.current.top+'px'});return false;},rearrange:function(e,i,a){a?a.append(this.currentItem):i.item[this.direction=='down'?'before':'after'](this.currentItem);this.refreshPositions(true);if(this.placeholderElement)this.placeholder.css(this.placeholderElement.offset());if(this.placeholderElement&&this.placeholderElement.is(":visible"))this.placeholder.css({width:this.placeholderElement.outerWidth(),height:this.placeholderElement.outerHeight()});}});$.extend($.ui.sortable,{getter:"serialize toArray",defaults:{items:'> *',zIndex:1000}});$.ui.plugin.add("sortable","cursor",{start:function(e,ui){var t=$('body');if(t.css("cursor"))ui.options._cursor=t.css("cursor");t.css("cursor",ui.options.cursor);},stop:function(e,ui){if(ui.options._cursor)$('body').css("cursor",ui.options._cursor);}});$.ui.plugin.add("sortable","zIndex",{start:function(e,ui){var t=ui.helper;if(t.css("zIndex"))ui.options._zIndex=t.css("zIndex");t.css('zIndex',ui.options.zIndex);},stop:function(e,ui){if(ui.options._zIndex)$(ui.helper).css('zIndex',ui.options._zIndex);}});$.ui.plugin.add("sortable","opacity",{start:function(e,ui){var t=ui.helper;if(t.css("opacity"))ui.options._opacity=t.css("opacity");t.css('opacity',ui.options.opacity);},stop:function(e,ui){if(ui.options._opacity)$(ui.helper).css('opacity',ui.options._opacity);}});$.ui.plugin.add("sortable","revert",{stop:function(e,ui){var self=ui.instance;self.cancelHelperRemoval=true;var cur=self.currentItem.offset();var op=self.helper.offsetParent().offset();if(ui.instance.options.zIndex)ui.helper.css('zIndex',ui.instance.options.zIndex);if(ui.instance.placeholder)ui.instance.placeholder.animate({opacity:'hide'},parseInt(ui.options.revert,10)||500);ui.helper.animate({left:cur.left-op.left-self.margins.left,top:cur.top-op.top-self.margins.top},parseInt(ui.options.revert,10)||500,function(){self.currentItem.css('visibility','visible');window.setTimeout(function(){if(self.placeholder)self.placeholder.remove();self.helper.remove();if(ui.options._zIndex)ui.helper.css('zIndex',ui.options._zIndex);},50);});}});$.ui.plugin.add("sortable","containment",{start:function(e,ui){var o=ui.options;if((o.containment.left!=undefined||o.containment.constructor==Array)&&!o._containment)return;if(!o._containment)o._containment=o.containment;if(o._containment=='parent')o._containment=this[0].parentNode;if(o._containment=='sortable')o._containment=this[0];if(o._containment=='document'){o.containment=[0,0,$(document).width(),($(document).height()||document.body.parentNode.scrollHeight)];}else{var ce=$(o._containment);var co=ce.offset();o.containment=[co.left,co.top,co.left+(ce.outerWidth()||ce[0].scrollWidth),co.top+(ce.outerHeight()||ce[0].scrollHeight)];}},sort:function(e,ui){var o=ui.options;var h=ui.helper;var c=o.containment;var self=ui.instance;var borderLeft=(parseInt(self.offsetParent.css("borderLeftWidth"),10)||0);var borderRight=(parseInt(self.offsetParent.css("borderRightWidth"),10)||0);var borderTop=(parseInt(self.offsetParent.css("borderTopWidth"),10)||0);var borderBottom=(parseInt(self.offsetParent.css("borderBottomWidth"),10)||0);if(c.constructor==Array){if((self.position.absolute.left=0)self.position.current.left=c[2]-self.offsets.parent.left-self.helperProportions.width-self.margins.left-borderLeft-borderRight;if(self.position.absolute.top-c[3]+self.helperProportions.height>=0)self.position.current.top=c[3]-self.offsets.parent.top-self.helperProportions.height-self.margins.top-borderTop-borderBottom;}else{if((ui.position.left=0)self.position.current.left=self.offsetParent.innerWidth()-self.helperProportions.width-c.right-borderLeft-borderRight;if(ui.position.top-self.offsetParent.innerHeight()+self.helperProportions.height+c.bottom+borderTop+borderBottom>=0)self.position.current.top=self.offsetParent.innerHeight()-self.helperProportions.height-c.bottom-borderTop-borderBottom;}}});$.ui.plugin.add("sortable","axis",{sort:function(e,ui){var o=ui.options;if(o.constraint)o.axis=o.constraint;o.axis=='x'?ui.instance.position.current.top=ui.instance.originalPosition.top:ui.instance.position.current.left=ui.instance.originalPosition.left;}});$.ui.plugin.add("sortable","scroll",{start:function(e,ui){var o=ui.options;o.scrollSensitivity=o.scrollSensitivity||20;o.scrollSpeed=o.scrollSpeed||20;ui.instance.overflowY=function(el){do{if((/auto|scroll/).test(el.css('overflow'))||(/auto|scroll/).test(el.css('overflow-y')))return el;el=el.parent();}while(el[0].parentNode);return $(document);}(this);ui.instance.overflowX=function(el){do{if((/auto|scroll/).test(el.css('overflow'))||(/auto|scroll/).test(el.css('overflow-x')))return el;el=el.parent();}while(el[0].parentNode);return $(document);}(this);if(ui.instance.overflowY[0]!=document&&ui.instance.overflowY[0].tagName!='HTML')ui.instance.overflowYstart=ui.instance.overflowY[0].scrollTop;if(ui.instance.overflowX[0]!=document&&ui.instance.overflowX[0].tagName!='HTML')ui.instance.overflowXstart=ui.instance.overflowX[0].scrollLeft;},sort:function(e,ui){var o=ui.options;var i=ui.instance;if(i.overflowY[0]!=document&&i.overflowY[0].tagName!='HTML'){if(i.overflowY[0].offsetHeight-(ui.position.top-i.overflowY[0].scrollTop+i.clickOffset.top)").insertBefore(options.headers);$("").appendTo(options.headers);options.headers.addClass("ui-accordion-header").attr("tabindex","0");} var maxHeight;if(options.fillSpace){maxHeight=this.element.parent().height();options.headers.each(function(){maxHeight-=$(this).outerHeight();});var maxPadding=0;options.headers.next().each(function(){maxPadding=Math.max(maxPadding,$(this).innerHeight()-$(this).height());}).height(maxHeight-maxPadding);}else if(options.autoHeight){maxHeight=0;options.headers.next().each(function(){maxHeight=Math.max(maxHeight,$(this).outerHeight());}).height(maxHeight);} options.headers.not(options.active||"").next().hide();options.active.parent().andSelf().addClass(options.selectedClass);if(options.event){this.element.bind((options.event)+".accordion",clickHandler);}},activate:function(index){clickHandler.call(this.element[0],{target:findActive(this.options.headers,index)[0]});},destroy:function(){this.options.headers.next().css("display","");if(this.options.fillSpace||this.options.autoHeight){this.options.headers.next().css("height","");} $.removeData(this.element[0],"accordion");this.element.removeClass("ui-accordion").unbind(".accordion");}});function scopeCallback(callback,scope){return function(){return callback.apply(scope,arguments);};};function completed(cancel){if(!$.data(this,"accordion")){return;} var instance=$.data(this,"accordion");var options=instance.options;options.running=cancel?0:--options.running;if(options.running){return;} if(options.clearStyle){options.toShow.add(options.toHide).css({height:"",overflow:""});} $(this).triggerHandler("accordionchange",[options.data],options.change);} function toggle(toShow,toHide,data,clickedActive,down){var options=$.data(this,"accordion").options;options.toShow=toShow;options.toHide=toHide;options.data=data;var complete=scopeCallback(completed,this);options.running=toHide.size()===0?toShow.size():toHide.size();if(options.animated){if(!options.alwaysOpen&&clickedActive){$.ui.accordion.animations[options.animated]({toShow:jQuery([]),toHide:toHide,complete:complete,down:down,autoHeight:options.autoHeight});}else{$.ui.accordion.animations[options.animated]({toShow:toShow,toHide:toHide,complete:complete,down:down,autoHeight:options.autoHeight});}}else{if(!options.alwaysOpen&&clickedActive){toShow.toggle();}else{toHide.hide();toShow.show();} complete(true);}} function clickHandler(event){var options=$.data(this,"accordion").options;if(options.disabled){return false;} if(!event.target&&!options.alwaysOpen){options.active.parent().andSelf().toggleClass(options.selectedClass);var toHide=options.active.next(),data={instance:this,options:options,newHeader:jQuery([]),oldHeader:options.active,newContent:jQuery([]),oldContent:toHide},toShow=(options.active=$([]));toggle.call(this,toShow,toHide,data);return false;} var clicked=$(event.target);if(clicked.parents(options.header).length){while(!clicked.is(options.header)){clicked=clicked.parent();}} var clickedActive=clicked[0]==options.active[0];if(options.running||(options.alwaysOpen&&clickedActive)){return false;} if(!clicked.is(options.header)){return;} options.active.parent().andSelf().toggleClass(options.selectedClass);if(!clickedActive){clicked.parent().andSelf().addClass(options.selectedClass);} var toShow=clicked.next(),toHide=options.active.next(),data={instance:this,options:options,newHeader:clicked,oldHeader:options.active,newContent:toShow,oldContent:toHide},down=options.headers.index(options.active[0])>options.headers.index(clicked[0]);options.active=clickedActive?$([]):clicked;toggle.call(this,toShow,toHide,data,clickedActive,down);return false;};function findActive(headers,selector){return selector!=undefined?typeof selector=="number"?headers.filter(":eq("+selector+")"):headers.not(headers.not(selector)):selector===false?$([]):headers.filter(":eq(0)");} $.extend($.ui.accordion,{defaults:{selectedClass:"selected",alwaysOpen:true,animated:'slide',event:"click",header:"a",autoHeight:true,running:0,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase();}},animations:{slide:function(options,additions){options=$.extend({easing:"swing",duration:300},options,additions);if(!options.toHide.size()){options.toShow.animate({height:"show"},options);return;} var hideHeight=options.toHide.height(),showHeight=options.toShow.height(),difference=showHeight/hideHeight;options.toShow.css({height:0,overflow:'hidden'}).show();options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate({height:"hide"},{step:function(now){var current=(hideHeight-now)*difference;if($.browser.msie||$.browser.opera){current=Math.ceil(current);} options.toShow.height(current);},duration:options.duration,easing:options.easing,complete:function(){if(!options.autoHeight){options.toShow.css("height","auto");} options.complete();}});},bounceslide:function(options){this.slide(options,{easing:options.down?"bounceout":"swing",duration:options.down?1000:200});},easeslide:function(options){this.slide(options,{easing:"easeinout",duration:700});}}});$.fn.activate=function(index){return this.accordion("activate",index);};})(jQuery);;(function($){var setDataSwitch={"dragStart":"start.draggable","drag":"drag.draggable","dragStop":"stop.draggable","maxHeight":"maxHeight.resizable","minHeight":"minHeight.resizable","maxWidth":"maxWidth.resizable","minWidth":"minWidth.resizable","resizeStart":"start.resizable","resize":"drag.resizable","resizeStop":"stop.resizable"};$.widget("ui.dialog",{init:function(){var self=this;var options=this.options;var uiDialogContent=$(this.element).addClass('ui-dialog-content');if(!uiDialogContent.parent().length){uiDialogContent.appendTo('body');} uiDialogContent.wrap(document.createElement('div')).wrap(document.createElement('div'));var uiDialogContainer=uiDialogContent.parent().addClass('ui-dialog-container').css({position:'relative'});var uiDialog=this.uiDialog=uiDialogContainer.parent().hide().addClass('ui-dialog').css({position:'absolute',width:options.width,height:options.height,overflow:'hidden'});var classNames=uiDialogContent.attr('className').split(' ');$.each(classNames,function(i,className){if(className!='ui-dialog-content') uiDialog.addClass(className);});if($.fn.resizable){uiDialog.append('
').append('
').append('
').append('
').append('
').append('
').append('
').append('
');uiDialog.resizable({maxWidth:options.maxWidth,maxHeight:options.maxHeight,minWidth:options.minWidth,minHeight:options.minHeight,start:options.resizeStart,resize:options.resize,stop:function(e,ui){options.resizeStop&&options.resizeStop.apply(this,arguments);$.ui.dialog.overlay.resize();}});if(!options.resizable) uiDialog.resizable('disable');} uiDialogContainer.prepend('
');var uiDialogTitlebar=$('.ui-dialog-titlebar',uiDialogContainer);this.uiDialogTitlebar=uiDialogTitlebar;var title=(options.title)?options.title:(uiDialogContent.attr('title'))?uiDialogContent.attr('title'):'';uiDialogTitlebar.append(''+title+'');uiDialogTitlebar.append('X');this.uiDialogTitlebarClose=$('.ui-dialog-titlebar-close',uiDialogTitlebar).hover(function(){$(this).addClass('ui-dialog-titlebar-close-hover');},function(){$(this).removeClass('ui-dialog-titlebar-close-hover');}).mousedown(function(ev){ev.stopPropagation();}).click(function(){self.close();return false;});uiDialog.attr('tabindex',-1).css('outline',0).keydown(function(ev){if(options.closeOnEscape){var ESC=27;ev.keyCode&&ev.keyCode==ESC&&self.close();}});var hasButtons=false;$.each(options.buttons,function(){return!(hasButtons=true);});if(hasButtons){var uiDialogButtonPane=$('
').appendTo(uiDialog);$.each(options.buttons,function(name,fn){$(document.createElement('button')).text(name).click(function(){fn.apply(self.element,arguments)}).appendTo(uiDialogButtonPane);});} if($.fn.draggable){uiDialog.draggable({handle:'.ui-dialog-titlebar',start:function(e,ui){self.activate();options.dragStart&&options.dragStart.apply(this,arguments);},drag:options.drag,stop:function(e,ui){options.dragStop&&options.dragStop.apply(this,arguments);$.ui.dialog.overlay.resize();}});if(!options.draggable) uiDialog.draggable('disable')} uiDialog.mousedown(function(){self.activate();});uiDialogTitlebar.click(function(){self.activate();});options.bgiframe&&$.fn.bgiframe&&uiDialog.bgiframe();if(options.autoOpen){this.open();};},setData:function(event,key,value){setDataSwitch[key]&&this.uiDialog.data(setDataSwitch[key],value);switch(key){case"draggable":this.uiDialog.draggable(value?'enable':'disable');break;case"height":this.uiDialog.height(value);break;case"position":this.position(value);break;case"resizable":this.uiDialog.resizable(value?'enable':'disable');break;case"title":$(".ui-dialog-title",this.uiDialogTitlebar).text(value);break;case"width":this.uiDialog.width(value);break;} this.options[key]=value;},position:function(pos){var wnd=$(window),doc=$(document),minTop=top=doc.scrollTop(),left=doc.scrollLeft();if($.inArray(pos,['center','top','right','bottom','left'])>=0){pos=[pos=='right'||pos=='left'?pos:'center',pos=='top'||pos=='bottom'?pos:'middle'];} if(pos.constructor!=Array){pos==['center','middle']} if(pos[0].constructor==Number){left+=pos[0];}else{switch(pos[0]){case'left':left+=0;break;case'right':left+=(wnd.width())-(this.uiDialog.width());break;case'center':default:left+=(wnd.width()/2)-(this.uiDialog.width()/2);}} if(pos[1].constructor==Number){top+=pos[1];}else{switch(pos[1]){case'top':top+=0;break;case'bottom':top+=(wnd.height())-(this.uiDialog.height());break;case'middle':default:top+=(wnd.height()/2)-(this.uiDialog.height()/2);}} top=topmaxZ;}else{allow=true;}} return allow;});$(document).bind('keydown.dialog-overlay',function(e){var ESC=27;e.keyCode&&e.keyCode==ESC&&dialog.close();});$(window).bind('resize.dialog-overlay',$.ui.dialog.overlay.resize);} var $el=$('
').appendTo(document.body).addClass('ui-dialog-overlay').css($.extend({borderWidth:0,margin:0,padding:0,position:'absolute',top:0,left:0,width:this.width(),height:this.height()},dialog.options.overlay));dialog.options.bgiframe&&$.fn.bgiframe&&$el.bgiframe();this.instances.push($el);return $el;},destroy:function($el){this.instances.splice($.inArray(this.instances,$el),1);if(this.instances.length===0){$('a, :input').add([document,window]).unbind('.dialog-overlay');} $el.remove();},height:function(){if($.browser.msie&&$.browser.version<7){var scrollHeight=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var offsetHeight=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(scrollHeight").addClass("ui-slider-handle").appendTo(self.element);if(this.id) handle.attr("id",this.id);return handle[0];});} $(this.handle).mouse({executor:this,delay:this.options.delay,distance:this.options.distance,dragPrevention:this.options.prevention?this.options.prevention.toLowerCase().split(','):['input','textarea','button','select','option'],start:this.start,stop:this.stop,drag:this.drag,condition:function(e,handle){if(!this.disabled){if(this.currentHandle)this.blur(this.currentHandle);this.focus(handle,1);return!this.disabled;}}}).wrap('').parent().bind('focus',function(e){self.focus(this.firstChild);}).bind('blur',function(e){self.blur(this.firstChild);}).bind('keydown',function(e){if(/(37|38|39|40)/.test(e.keyCode)){self.moveTo({x:/(37|39)/.test(e.keyCode)?(e.keyCode==37?'-':'+')+'='+self.oneStep(1):null,y:/(38|40)/.test(e.keyCode)?(e.keyCode==38?'-':'+')+'='+self.oneStep(2):null},this.firstChild);}});this.actualSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.element.bind('mousedown.slider',function(e){self.click.apply(self,[e]);self.currentHandle.data("mouse").trigger(e);self.firstValue=self.firstValue+1;});$.each(this.options.handles||[],function(index,handle){self.moveTo(handle.start,index,true);});if(!isNaN(this.options.startValue)) this.moveTo(this.options.startValue,0,true);this.previousHandle=$(this.handle[0]);if(this.handle.length==2&&this.options.range)this.createRange();},setData:function(event,key,value){this.options[key]=value;if(/min|max|steps/.test(key)){this.initBoundaries();}},initBoundaries:function(){var element=this.element[0];var o=this.options;$.extend(o,{axis:o.axis||(element.offsetWidth
').addClass('ui-slider-range').css({position:'absolute'}).appendTo(this.element);this.updateRange();},updateRange:function(){var prop=this.options.axis=="vertical"?"top":"left";var size=this.options.axis=="vertical"?"height":"width";this.rangeElement.css(prop,parseInt($(this.handle[0]).css(prop),10)+this.handleSize(0,this.options.axis=="vertical"?2:1)/2);this.rangeElement.css(size,parseInt($(this.handle[1]).css(prop),10)-parseInt($(this.handle[0]).css(prop),10));},getRange:function(){return this.rangeElement?this.convertValue(parseInt(this.rangeElement.css(this.options.axis=="vertical"?"height":"width"),10)):null;},ui:function(e){return{instance:this,options:this.options,handle:this.currentHandle,value:this.options.axis!="both"||!this.options.axis?Math.round(this.value(null,this.options.axis=="vertical"?2:1)):{x:Math.round(this.value(null,1)),y:Math.round(this.value(null,2))},range:this.getRange()};},propagate:function(n,e){$.ui.plugin.call(this,n,[e,this.ui()]);this.element.triggerHandler(n=="slide"?n:"slide"+n,[e,this.ui()],this.options[n]);},destroy:function(){this.element.removeClass("ui-slider ui-slider-disabled").removeData("slider").unbind(".slider");this.handle.mouse("destroy");this.generated&&this.generated.remove();},enable:function(){this.element.removeClass("ui-slider-disabled");this.disabled=false;},disable:function(){this.element.addClass("ui-slider-disabled");this.disabled=true;},focus:function(handle,hard){this.currentHandle=$(handle).addClass('ui-slider-handle-active');if(hard) this.currentHandle.parent()[0].focus();},blur:function(handle){$(handle).removeClass('ui-slider-handle-active');if(this.currentHandle&&this.currentHandle[0]==handle){this.previousHandle=this.currentHandle;this.currentHandle=null;};},value:function(handle,axis){if(this.handle.length==1)this.currentHandle=this.handle;if(!axis)axis=this.options.axis=="vertical"?2:1;var value=((parseInt($(handle!=undefined&&handle!==null?this.handle[handle]||handle:this.currentHandle).css(axis==1?"left":"top"),10)/(this.actualSize[axis==1?"width":"height"]-this.handleSize(handle,axis)))*this.options.realMax[axis==1?"x":"y"])+this.options.min[axis==1?"x":"y"];var o=this.options;if(o.stepping[axis==1?"x":"y"]){value=Math.round(value/o.stepping[axis==1?"x":"y"])*o.stepping[axis==1?"x":"y"];} return value;},convertValue:function(value,axis){if(!axis)axis=this.options.axis=="vertical"?2:1;return this.options.min[axis==1?"x":"y"]+(value/(this.actualSize[axis==1?"width":"height"]-this.handleSize(null,axis)))*this.options.realMax[axis==1?"x":"y"];},translateValue:function(value,axis){if(!axis)axis=this.options.axis=="vertical"?2:1;return((value-this.options.min[axis==1?"x":"y"])/this.options.realMax[axis==1?"x":"y"])*(this.actualSize[axis==1?"width":"height"]-this.handleSize(null,axis));},handleSize:function(handle,axis){if(!axis)axis=this.options.axis=="vertical"?2:1;return $(handle!=undefined&&handle!==null?this.handle[handle]:this.currentHandle)[0][axis==1?"offsetWidth":"offsetHeight"];},click:function(e){var pointer=[e.pageX,e.pageY];var clickedHandle=false;this.handle.each(function(){if(this==e.target) clickedHandle=true;});if(clickedHandle||this.disabled||!(this.currentHandle||this.previousHandle)) return;if(!this.currentHandle&&this.previousHandle) this.focus(this.previousHandle,true);this.offset=this.element.offset();this.moveTo({y:this.convertValue(e.pageY-this.offset.top-this.currentHandle.outerHeight()/2),x:this.convertValue(e.pageX-this.offset.left-this.currentHandle.outerWidth()/2)},null,!this.options.distance);},start:function(e,handle){var o=this.options;if(!this.currentHandle) this.focus(this.previousHandle,true);this.offset=this.element.offset();this.handleOffset=this.currentHandle.offset();this.clickOffset={top:e.pageY-this.handleOffset.top,left:e.pageX-this.handleOffset.left};this.firstValue=this.value();this.propagate('start',e);return false;},stop:function(e){this.propagate('stop',e);if(this.firstValue!=this.value()) this.propagate('change',e);this.focus(this.currentHandle,true);return false;},oneStep:function(axis){if(!axis)axis=this.options.axis=="vertical"?2:1;return this.options.stepping[axis==1?"x":"y"]?this.options.stepping[axis==1?"x":"y"]:(this.options.realMax[axis==1?"x":"y"]/this.actualSize[axis==1?"width":"height"])*5;},translateRange:function(value,axis){if(this.rangeElement){if(this.currentHandle[0]==this.handle[0]&&value>=this.translateValue(this.value(1),axis)) value=this.translateValue(this.value(1,axis)-this.oneStep(axis),axis);if(this.currentHandle[0]==this.handle[1]&&value<=this.translateValue(this.value(0),axis)) value=this.translateValue(this.value(0,axis)+this.oneStep(axis));} if(this.options.handles){var handle=this.options.handles[this.handleIndex()];if(valuethis.translateValue(handle.max,axis)){value=this.translateValue(handle.max,axis);}} return value;},handleIndex:function(){return this.handle.index(this.currentHandle[0])},translateLimits:function(value,axis){if(!axis)axis=this.options.axis=="vertical"?2:1;if(value>=this.actualSize[axis==1?"width":"height"]-this.handleSize(null,axis)) value=this.actualSize[axis==1?"width":"height"]-this.handleSize(null,axis);if(value<=0) value=0;return value;},drag:function(e,handle){var o=this.options;var position={top:e.pageY-this.offset.top-this.clickOffset.top,left:e.pageX-this.offset.left-this.clickOffset.left};if(!this.currentHandle)this.focus(this.previousHandle,true);position.left=this.translateLimits(position.left,1);position.top=this.translateLimits(position.top,2);if(o.stepping.x){var value=this.convertValue(position.left,1);value=Math.round(value/o.stepping.x)*o.stepping.x;position.left=this.translateValue(value,1);} if(o.stepping.y){var value=this.convertValue(position.top,2);value=Math.round(value/o.stepping.y)*o.stepping.y;position.top=this.translateValue(value,2);} position.left=this.translateRange(position.left,1);position.top=this.translateRange(position.top,2);if(o.axis!="vertical")this.currentHandle.css({left:position.left});if(o.axis!="horizontal")this.currentHandle.css({top:position.top});if(this.rangeElement) this.updateRange();this.propagate('slide',e);return false;},moveTo:function(value,handle,noPropagation){var o=this.options;if(handle==undefined&&!this.currentHandle&&this.handle.length!=1) return false;if(handle==undefined&&!this.currentHandle) handle=0;if(handle!=undefined) this.currentHandle=this.previousHandle=$(this.handle[handle]||handle);if(value.x!==undefined&&value.y!==undefined){var x=value.x;var y=value.y;}else{var x=value,y=value;} if(x&&x.constructor!=Number){var me=/^\-\=/.test(x),pe=/^\+\=/.test(x);if(me){x=this.value(null,1)-parseInt(x.replace('-=',''),10);}else if(pe){x=this.value(null,1)+parseInt(x.replace('+=',''),10);}} if(y&&y.constructor!=Number){var me=/^\-\=/.test(y),pe=/^\+\=/.test(y);if(me){y=this.value(null,2)-parseInt(y.replace('-=',''),10);}else if(pe){y=this.value(null,2)+parseInt(y.replace('+=',''),10);}} if(o.axis!="vertical"&&x){if(o.stepping.x)x=Math.round(x/o.stepping.x)*o.stepping.x;x=this.translateValue(x,1);x=this.translateLimits(x,1);x=this.translateRange(x,1);this.currentHandle.css({left:x});} if(o.axis!="horizontal"&&y){if(o.stepping.y)y=Math.round(y/o.stepping.y)*o.stepping.y;y=this.translateValue(y,2);y=this.translateLimits(y,2);y=this.translateRange(y,2);this.currentHandle.css({top:y});} if(this.rangeElement) this.updateRange();if(!noPropagation){this.propagate('start',null);this.propagate('stop',null);this.propagate('change',null);this.propagate("slide",null);}}});$.ui.slider.getter="value";$.ui.slider.defaults={handle:".ui-slider-handle",distance:1};})(jQuery);;(function($){$.widget("ui.tabs",{init:function(){var self=this;this.options.event+='.tabs';$(this.element).bind('setData.tabs',function(event,key,value){if((/^selected/).test(key)) self.select(value);else{self.options[key]=value;self.tabify();}}).bind('getData.tabs',function(event,key){return self.options[key];});this.tabify(true);},length:function(){return this.$tabs.length;},tabId:function(a){return a.title&&a.title.replace(/\s/g,'_').replace(/[^A-Za-z0-9\-_:\.]/g,'')||this.options.idPrefix+$.data(a);},ui:function(tab,panel){return{instance:this,options:this.options,tab:tab,panel:panel};},tabify:function(init){this.$lis=$('li:has(a[href])',this.element);this.$tabs=this.$lis.map(function(){return $('a',this)[0];});this.$panels=$([]);var self=this,o=this.options;this.$tabs.each(function(i,a){if(a.hash&&a.hash.replace('#','')) self.$panels=self.$panels.add(a.hash);else if($(a).attr('href')!='#'){$.data(a,'href.tabs',a.href);$.data(a,'load.tabs',a.href);var id=self.tabId(a);a.href='#'+id;var $panel=$('#'+id);if(!$panel.length){$panel=$(o.panelTemplate).attr('id',id).addClass(o.panelClass).insertAfter(self.$panels[i-1]||self.element);$panel.data('destroy.tabs',true);} self.$panels=self.$panels.add($panel);} else o.disabled.push(i+1);});if(init){$(this.element).hasClass(o.navClass)||$(this.element).addClass(o.navClass);this.$panels.each(function(){var $this=$(this);$this.hasClass(o.panelClass)||$this.addClass(o.panelClass);});this.$tabs.each(function(i,a){if(location.hash){if(a.hash==location.hash){o.selected=i;if($.browser.msie||$.browser.opera){var $toShow=$(location.hash),toShowId=$toShow.attr('id');$toShow.attr('id','');setTimeout(function(){$toShow.attr('id',toShowId);},500);} scrollTo(0,0);return false;}}else if(o.cookie){var index=parseInt($.cookie('ui-tabs'+$.data(self.element)),10);if(index&&self.$tabs[index]){o.selected=index;return false;}}else if(self.$lis.eq(i).hasClass(o.selectedClass)){o.selected=i;return false;}});this.$panels.addClass(o.hideClass);this.$lis.removeClass(o.selectedClass);if(o.selected!==null){this.$panels.eq(o.selected).show().removeClass(o.hideClass);this.$lis.eq(o.selected).addClass(o.selectedClass);var onShow=function(){$(self.element).triggerHandler('tabsshow',[self.ui(self.$tabs[o.selected],self.$panels[o.selected])],o.show);};if($.data(this.$tabs[o.selected],'load.tabs')) this.load(o.selected,onShow);else onShow();} o.disabled=$.unique(o.disabled.concat($.map(this.$lis.filter('.'+o.disabledClass),function(n,i){return self.$lis.index(n);}))).sort();$(window).bind('unload',function(){self.$tabs.unbind('.tabs');self.$lis=self.$tabs=self.$panels=null;});} for(var i=0,li;li=this.$lis[i];i++) $(li)[$.inArray(i,o.disabled)!=-1&&!$(li).hasClass(o.selectedClass)?'addClass':'removeClass'](o.disabledClass);if(o.cache===false) this.$tabs.removeData('cache.tabs');var hideFx,showFx,baseFx={'min-width':0,duration:1},baseDuration='normal';if(o.fx&&o.fx.constructor==Array) hideFx=o.fx[0]||baseFx,showFx=o.fx[1]||baseFx;else hideFx=showFx=o.fx||baseFx;var resetCSS={display:'',overflow:'',height:''};if(!$.browser.msie) resetCSS.opacity='';function hideTab(clicked,$hide,$show){$hide.animate(hideFx,hideFx.duration||baseDuration,function(){$hide.addClass(o.hideClass).css(resetCSS);if($.browser.msie&&hideFx.opacity) $hide[0].style.filter='';if($show) showTab(clicked,$show,$hide);});} function showTab(clicked,$show,$hide){if(showFx===baseFx) $show.css('display','block');$show.animate(showFx,showFx.duration||baseDuration,function(){$show.removeClass(o.hideClass).css(resetCSS);if($.browser.msie&&showFx.opacity) $show[0].style.filter='';$(self.element).triggerHandler('tabsshow',[self.ui(clicked,$show[0])],o.show);});} function switchTab(clicked,$li,$hide,$show){$li.addClass(o.selectedClass).siblings().removeClass(o.selectedClass);hideTab(clicked,$hide,$show);} this.$tabs.unbind('.tabs').bind(o.event,function(){var $li=$(this).parents('li:eq(0)'),$hide=self.$panels.filter(':visible'),$show=$(this.hash);if(($li.hasClass(o.selectedClass)&&!o.unselect)||$li.hasClass(o.disabledClass)||$(this).hasClass(o.loadingClass)||$(self.element).triggerHandler('tabsselect',[self.ui(this,$show[0])],o.select)===false){this.blur();return false;} self.options.selected=self.$tabs.index(this);if(o.unselect){if($li.hasClass(o.selectedClass)){self.options.selected=null;$li.removeClass(o.selectedClass);self.$panels.stop();hideTab(this,$hide);this.blur();return false;}else if(!$hide.length){self.$panels.stop();var a=this;self.load(self.$tabs.index(this),function(){$li.addClass(o.selectedClass).addClass(o.unselectClass);showTab(a,$show);});this.blur();return false;}} if(o.cookie) $.cookie('ui-tabs'+$.data(self.element),self.options.selected,o.cookie);self.$panels.stop();if($show.length){var a=this;self.load(self.$tabs.index(this),$hide.length?function(){switchTab(a,$li,$hide,$show);}:function(){$li.addClass(o.selectedClass);showTab(a,$show);});}else throw'jQuery UI Tabs: Mismatching fragment identifier.';if($.browser.msie) this.blur();return false;});if(!(/^click/).test(o.event)) this.$tabs.bind('click.tabs',function(){return false;});},add:function(url,label,index){if(index==undefined) index=this.$tabs.length;var o=this.options;var $li=$(o.tabTemplate.replace(/#\{href\}/,url).replace(/#\{label\}/,label));$li.data('destroy.tabs',true);var id=url.indexOf('#')==0?url.replace('#',''):this.tabId($('a:first-child',$li)[0]);var $panel=$('#'+id);if(!$panel.length){$panel=$(o.panelTemplate).attr('id',id).addClass(o.panelClass).addClass(o.hideClass);$panel.data('destroy.tabs',true);} if(index>=this.$lis.length){$li.appendTo(this.element);$panel.appendTo(this.element[0].parentNode);}else{$li.insertBefore(this.$lis[index]);$panel.insertBefore(this.$panels[index]);} o.disabled=$.map(o.disabled,function(n,i){return n>=index?++n:n});this.tabify();if(this.$tabs.length==1){$li.addClass(o.selectedClass);$panel.removeClass(o.hideClass);var href=$.data(this.$tabs[0],'load.tabs');if(href) this.load(index,href);} $(this.element).triggerHandler('tabsadd',[this.ui(this.$tabs[index],this.$panels[index])],o.add);},remove:function(index){var o=this.options,$li=this.$lis.eq(index).remove(),$panel=this.$panels.eq(index).remove();if($li.hasClass(o.selectedClass)&&this.$tabs.length>1) this.select(index+(index+1=index?--n:n});this.tabify();$(this.element).triggerHandler('tabsremove',[this.ui($li.find('a')[0],$panel[0])],o.remove);},enable:function(index){var o=this.options;if($.inArray(index,o.disabled)==-1) return;var $li=this.$lis.eq(index).removeClass(o.disabledClass);if($.browser.safari){$li.css('display','inline-block');setTimeout(function(){$li.css('display','block');},0);} o.disabled=$.grep(o.disabled,function(n,i){return n!=index;});$(this.element).triggerHandler('tabsenable',[this.ui(this.$tabs[index],this.$panels[index])],o.enable);},disable:function(index){var self=this,o=this.options;if(index!=o.selected){this.$lis.eq(index).addClass(o.disabledClass);o.disabled.push(index);o.disabled.sort();$(this.element).triggerHandler('tabsdisable',[this.ui(this.$tabs[index],this.$panels[index])],o.disable);}},select:function(index){if(typeof index=='string') index=this.$tabs.index(this.$tabs.filter('[href$='+index+']')[0]);this.$tabs.eq(index).trigger(this.options.event);},load:function(index,callback){var self=this,o=this.options,$a=this.$tabs.eq(index),a=$a[0],bypassCache=callback==undefined||callback===false,url=$a.data('load.tabs');callback=callback||function(){};if(!url||($.data(a,'cache.tabs')&&!bypassCache)){callback();return;} if(o.spinner){var $span=$('span',a);$span.data('label.tabs',$span.html()).html(''+o.spinner+'');} var finish=function(){self.$tabs.filter('.'+o.loadingClass).each(function(){$(this).removeClass(o.loadingClass);if(o.spinner){var $span=$('span',this);$span.html($span.data('label.tabs')).removeData('label.tabs');}});self.xhr=null;};var ajaxOptions=$.extend({},o.ajaxOptions,{url:url,success:function(r,s){$(a.hash).html(r);finish();if(o.cache) $.data(a,'cache.tabs',true);$(self.element).triggerHandler('tabsload',[self.ui(self.$tabs[index],self.$panels[index])],o.load);o.ajaxOptions.success&&o.ajaxOptions.success(r,s);callback();}});if(this.xhr){this.xhr.abort();finish();} $a.addClass(o.loadingClass);setTimeout(function(){self.xhr=$.ajax(ajaxOptions);},0);},url:function(index,url){this.$tabs.eq(index).removeData('cache.tabs').data('load.tabs',url);},destroy:function(){var o=this.options;$(this.element).unbind('.tabs').removeClass(o.navClass).removeData('tabs');this.$tabs.each(function(){var href=$.data(this,'href.tabs');if(href) this.href=href;var $this=$(this).unbind('.tabs');$.each(['href','load','cache'],function(i,prefix){$this.removeData(prefix+'.tabs');});});this.$lis.add(this.$panels).each(function(){if($.data(this,'destroy.tabs')) $(this).remove();else $(this).removeClass([o.selectedClass,o.unselectClass,o.disabledClass,o.panelClass,o.hideClass].join(' '));});}});$.ui.tabs.defaults={selected:0,unselect:false,event:'click',disabled:[],cookie:null,spinner:'Loading…',cache:false,idPrefix:'ui-tabs-',ajaxOptions:{},fx:null,tabTemplate:'
  • #{label}
  • ',panelTemplate:'
    ',navClass:'ui-tabs-nav',selectedClass:'ui-tabs-selected',unselectClass:'ui-tabs-unselect',disabledClass:'ui-tabs-disabled',panelClass:'ui-tabs-panel',hideClass:'ui-tabs-hide',loadingClass:'ui-tabs-loading'};$.ui.tabs.getter="length";$.extend($.ui.tabs.prototype,{rotation:null,rotate:function(ms,continuing){continuing=continuing||false;var self=this,t=this.options.selected;function start(){self.rotation=setInterval(function(){t=++t
    ');} $.extend(Datepicker.prototype,{markerClassName:'hasDatepicker',log:function(){if(this.debug) console.log.apply('',arguments);},_register:function(inst){var id=this._nextId++;this._inst[id]=inst;return id;},_getInst:function(id){return this._inst[id]||id;},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this;},_attachDatepicker:function(target,settings){var inlineSettings=null;for(attrName in this._defaults){var attrValue=target.getAttribute('date:'+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue);}catch(err){inlineSettings[attrName]=attrValue;}}} var nodeName=target.nodeName.toLowerCase();var instSettings=(inlineSettings?$.extend(settings||{},inlineSettings||{}):settings);if(nodeName=='input'){var inst=(inst&&!inlineSettings?inst:new DatepickerInstance(instSettings,false));this._connectDatepicker(target,inst);}else if(nodeName=='div'||nodeName=='span'){var inst=new DatepickerInstance(instSettings,true);this._inlineDatepicker(target,inst);}},_destroyDatepicker:function(target){var nodeName=target.nodeName.toLowerCase();var calId=target._calId;target._calId=null;var $target=$(target);if(nodeName=='input'){$target.siblings('.datepicker_append').replaceWith('').end().siblings('.datepicker_trigger').replaceWith('').end().removeClass(this.markerClassName).unbind('focus',this._showDatepicker).unbind('keydown',this._doKeyDown).unbind('keypress',this._doKeyPress);var wrapper=$target.parents('.datepicker_wrap');if(wrapper) wrapper.replaceWith(wrapper.html());}else if(nodeName=='div'||nodeName=='span') $target.removeClass(this.markerClassName).empty();if($('input[_calId='+calId+']').length==0) this._inst[calId]=null;},_enableDatepicker:function(target){target.disabled=false;$(target).siblings('button.datepicker_trigger').each(function(){this.disabled=false;}).end().siblings('img.datepicker_trigger').css({opacity:'1.0',cursor:''});this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value);});},_disableDatepicker:function(target){target.disabled=true;$(target).siblings('button.datepicker_trigger').each(function(){this.disabled=true;}).end().siblings('img.datepicker_trigger').css({opacity:'0.5',cursor:'default'});this._disabledInputs=$.map($.datepicker._disabledInputs,function(value){return(value==target?null:value);});this._disabledInputs[$.datepicker._disabledInputs.length]=target;},_isDisabledDatepicker:function(target){if(!target) return false;for(var i=0;i-1);},_connectDatepicker:function(target,inst){var input=$(target);if(input.is('.'+this.markerClassName)) return;var appendText=inst._get('appendText');var isRTL=inst._get('isRTL');if(appendText){if(isRTL) input.before(''+appendText);else input.after(''+appendText);} var showOn=inst._get('showOn');if(showOn=='focus'||showOn=='both') input.focus(this._showDatepicker);if(showOn=='button'||showOn=='both'){input.wrap('');var buttonText=inst._get('buttonText');var buttonImage=inst._get('buttonImage');var trigger=$(inst._get('buttonImageOnly')?$('').addClass('datepicker_trigger').attr({src:buttonImage,alt:buttonText,title:buttonText}):$('