/* jQuery UI - v1.8.20 - 2012-04-30 * https://github.com/jquery/jquery-ui * Includes: jquery.ui.core.js * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ (function(B,A){function D(E,J){var I=E.nodeName.toLowerCase();if("area"===I){var H=E.parentNode,G=H.name,F;return !E.href||!G||H.nodeName.toLowerCase()!=="map"?!1:(F=B("img[usemap=#"+G+"]")[0],!!F&&C(F));}return(/input|select|textarea|button|object/.test(I)?!E.disabled:"a"==I?E.href||J:J)&&C(E);}function C(E){return !B(E).parents().andSelf().filter(function(){return B.curCSS(this,"visibility")==="hidden"||B.expr.filters.hidden(this);}).length;}B.ui=B.ui||{};if(B.ui.version){return ;}B.extend(B.ui,{version:"1.8.20",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}}),B.fn.extend({propAttr:B.fn.prop||B.fn.attr,_focus:B.fn.focus,focus:function(E,F){return typeof E=="number"?this.each(function(){var G=this;setTimeout(function(){B(G).focus(),F&&F.call(G);},E);}):this._focus.apply(this,arguments);},scrollParent:function(){var E;return B.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?E=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(B.curCSS(this,"position",1))&&/(auto|scroll)/.test(B.curCSS(this,"overflow",1)+B.curCSS(this,"overflow-y",1)+B.curCSS(this,"overflow-x",1));}).eq(0):E=this.parents().filter(function(){return/(auto|scroll)/.test(B.curCSS(this,"overflow",1)+B.curCSS(this,"overflow-y",1)+B.curCSS(this,"overflow-x",1));}).eq(0),/fixed/.test(this.css("position"))||!E.length?B(document):E;},zIndex:function(H){if(H!==A){return this.css("zIndex",H);}if(this.length){var G=B(this[0]),F,E;while(G.length&&G[0]!==document){F=G.css("position");if(F==="absolute"||F==="relative"||F==="fixed"){E=parseInt(G.css("zIndex"),10);if(!isNaN(E)&&E!==0){return E;}}G=G.parent();}}return 0;},disableSelection:function(){return this.bind((B.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(E){E.preventDefault();});},enableSelection:function(){return this.unbind(".ui-disableSelection");}}),B.each(["Width","Height"],function(J,I){function E(K,N,M,L){return B.each(H,function(){N-=parseFloat(B.curCSS(K,"padding"+this,!0))||0,M&&(N-=parseFloat(B.curCSS(K,"border"+this+"Width",!0))||0),L&&(N-=parseFloat(B.curCSS(K,"margin"+this,!0))||0);}),N;}var H=I==="Width"?["Left","Right"]:["Top","Bottom"],G=I.toLowerCase(),F={innerWidth:B.fn.innerWidth,innerHeight:B.fn.innerHeight,outerWidth:B.fn.outerWidth,outerHeight:B.fn.outerHeight};B.fn["inner"+I]=function(K){return K===A?F["inner"+I].call(this):this.each(function(){B(this).css(G,E(this,K)+"px");});},B.fn["outer"+I]=function(K,L){return typeof K!="number"?F["outer"+I].call(this,K):this.each(function(){B(this).css(G,E(this,K,!0,L)+"px");});};}),B.extend(B.expr[":"],{data:function(E,G,F){return !!B.data(E,F[3]);},focusable:function(E){return D(E,!isNaN(B.attr(E,"tabindex")));},tabbable:function(E){var G=B.attr(E,"tabindex"),F=isNaN(G);return(F||G>=0)&&D(E,!F);}}),B(function(){var E=document.body,F=E.appendChild(F=document.createElement("div"));F.offsetHeight,B.extend(F.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),B.support.minHeight=F.offsetHeight===100,B.support.selectstart="onselectstart" in F,E.removeChild(F).style.display="none";}),B.extend(B.ui,{plugin:{add:function(E,I,H){var G=B.ui[E].prototype;for(var F in H){G.plugins[F]=G.plugins[F]||[],G.plugins[F].push([I,H[F]]);}},call:function(F,E,I){var H=F.plugins[E];if(!H||!F.element[0].parentNode){return ;}for(var G=0;G0?!0:(E[G]=1,F=E[G]>0,E[G]=0,F);},isOverAxis:function(F,E,G){return F>E&&F0?I.left-J:Math.max(I.left-L.collisionPosition.left,I.left);},top:function(I,L){var K=B(window),J=L.collisionPosition.top+L.collisionHeight-K.height()-K.scrollTop();I.top=J>0?I.top-J:Math.max(I.top-L.collisionPosition.top,I.top);}},flip:{left:function(I,O){if(O.at[0]===F){return ;}var N=B(window),M=O.collisionPosition.left+O.collisionWidth-N.width()-N.scrollLeft(),L=O.my[0]==="left"?-O.elemWidth:O.my[0]==="right"?O.elemWidth:0,K=O.at[0]==="left"?O.targetWidth:-O.targetWidth,J=-2*O.offset[0];I.left+=O.collisionPosition.left<0?L+K+J:M>0?L+K+J:0;},top:function(I,O){if(O.at[1]===F){return ;}var N=B(window),M=O.collisionPosition.top+O.collisionHeight-N.height()-N.scrollTop(),L=O.my[1]==="top"?-O.elemHeight:O.my[1]==="bottom"?O.elemHeight:0,K=O.at[1]==="top"?O.targetHeight:-O.targetHeight,J=-2*O.offset[1];I.top+=O.collisionPosition.top<0?L+K+J:M>0?L+K+J:0;}}},B.offset.setOffset||(B.offset.setOffset=function(I,O){/static/.test(B.curCSS(I,"position"))&&(I.style.position="relative");var N=B(I),M=N.offset(),L=parseInt(B.curCSS(I,"top",!0),10)||0,K=parseInt(B.curCSS(I,"left",!0),10)||0,J={top:O.top-M.top+L,left:O.left-M.left+K};"using" in O?O.using.call(I,J):N.css(J);},B.fn.offset=function(I){var J=this[0];return !J||!J.ownerDocument?null:I?this.each(function(){B.offset.setOffset(this,I);}):C.call(this);}),function(){var I=document.getElementsByTagName("body")[0],P=document.createElement("div"),O,N,M,L,K;O=document.createElement(I?"div":"body"),M={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},I&&B.extend(M,{position:"absolute",left:"-1000px",top:"-1000px"});for(var J in M){O.style[J]=M[J];}O.appendChild(P),N=I||document.documentElement,N.insertBefore(O,N.firstChild),P.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",L=B(P).offset(function(R,Q){return Q;}).offset(),O.innerHTML="",N.removeChild(O),K=L.top+L.left+(I?2000:0),E.fractions=K>21&&K<22;}();})(jQuery); /* jQuery UI - v1.8.20 - 2012-04-30 * https://github.com/jquery/jquery-ui * Includes: jquery.ui.autocomplete.js * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ (function(B,A){var C=0;B.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 D=this,F=this.element[0].ownerDocument,E;this.isMultiLine=this.element.is("textarea"),this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(H){if(D.options.disabled||D.element.propAttr("readOnly")){return ;}E=!1;var G=B.ui.keyCode;switch(H.keyCode){case G.PAGE_UP:D._move("previousPage",H);break;case G.PAGE_DOWN:D._move("nextPage",H);break;case G.UP:D._keyEvent("previous",H);break;case G.DOWN:D._keyEvent("next",H);break;case G.ENTER:case G.NUMPAD_ENTER:D.menu.active&&(E=!0,H.preventDefault());case G.TAB:if(!D.menu.active){return ;}D.menu.select(H);break;case G.ESCAPE:D.element.val(D.term),D.close(H);break;default:clearTimeout(D.searching),D.searching=setTimeout(function(){D.term!=D.element.val()&&(D.selectedItem=null,D.search(null,H));},D.options.delay);}}).bind("keypress.autocomplete",function(G){E&&(E=!1,G.preventDefault());}).bind("focus.autocomplete",function(){if(D.options.disabled){return ;}D.selectedItem=null,D.previous=D.element.val();}).bind("blur.autocomplete",function(G){if(D.options.disabled){return ;}clearTimeout(D.searching),D.closing=setTimeout(function(){D.close(G),D._change(G);},150);}),this._initSource(),this.menu=B("").addClass("ui-autocomplete").appendTo(B(this.options.appendTo||"body",F)[0]).mousedown(function(H){var G=D.menu.element[0];B(H.target).closest(".ui-menu-item").length||setTimeout(function(){B(document).one("mousedown",function(I){I.target!==D.element[0]&&I.target!==G&&!B.ui.contains(G,I.target)&&D.close();});},1),setTimeout(function(){clearTimeout(D.closing);},13);}).menu({focus:function(G,I){var H=I.item.data("item.autocomplete");!1!==D._trigger("focus",G,{item:H})&&/^key/.test(G.originalEvent.type)&&D.element.val(H.value);},selected:function(G,J){var I=J.item.data("item.autocomplete"),H=D.previous;D.element[0]!==F.activeElement&&(D.element.focus(),D.previous=H,setTimeout(function(){D.previous=H,D.selectedItem=I;},1)),!1!==D._trigger("select",G,{item:I})&&D.element.val(I.value),D.term=D.element.val(),D.close(G),D.selectedItem=I;},blur:function(G,H){D.menu.element.is(":visible")&&D.element.val()!==D.term&&D.element.val(D.term);}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),B.fn.bgiframe&&this.menu.element.bgiframe(),D.beforeunloadHandler=function(){D.element.removeAttr("autocomplete");},B(window).bind("beforeunload",D.beforeunloadHandler);},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),B(window).unbind("beforeunload",this.beforeunloadHandler),B.Widget.prototype.destroy.call(this);},_setOption:function(D,E){B.Widget.prototype._setOption.apply(this,arguments),D==="source"&&this._initSource(),D==="appendTo"&&this.menu.element.appendTo(B(E||"body",this.element[0].ownerDocument)[0]),D==="disabled"&&E&&this.xhr&&this.xhr.abort();},_initSource:function(){var D=this,F,E;B.isArray(this.options.source)?(F=this.options.source,this.source=function(G,H){H(B.ui.autocomplete.filter(F,G.term));}):typeof this.options.source=="string"?(E=this.options.source,this.source=function(H,G){D.xhr&&D.xhr.abort(),D.xhr=B.ajax({url:E,data:H,dataType:"json",success:function(J,I){G(J);},error:function(){G([]);}});}):this.source=this.options.source;},search:function(E,D){E=E!=null?E:this.element.val(),this.term=this.element.val();if(E.length").data("item.autocomplete",E).append(B("").text(E.label)).appendTo(D);},_move:function(E,D){if(!this.menu.element.is(":visible")){this.search(null,D);return ;}if(this.menu.first()&&/^previous/.test(E)||this.menu.last()&&/^next/.test(E)){this.element.val(this.term),this.menu.deactivate();return ;}this.menu[E](D);},widget:function(){return this.menu.element;},_keyEvent:function(E,D){if(!this.isMultiLine||this.menu.element.is(":visible")){this._move(E,D),D.preventDefault();}}}),B.extend(B.ui.autocomplete,{escapeRegex:function(D){return D.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");},filter:function(D,F){var E=new RegExp(B.ui.autocomplete.escapeRegex(F),"i");return B.grep(D,function(G){return E.test(G.label||G.value||G);});}});})(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(D){B.activate(D,A(this).parent());}).mouseleave(function(){B.deactivate();});},activate:function(C,B){this.deactivate();if(this.hasScroll()){var F=B.offset().top-this.element.offset().top,E=this.element.scrollTop(),D=this.element.height();F<0?this.element.scrollTop(E+F):F>=D&&this.element.scrollTop(E+F-D+B.height());}this.active=B.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",C,{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(B){this.move("next",".ui-menu-item:first",B);},previous:function(B){this.move("prev",".ui-menu-item:last",B);},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(C,B,E){if(!this.active){this.activate(E,this.element.children(B));return ;}var D=this.active[C+"All"](".ui-menu-item").eq(0);D.length?this.activate(E,D):this.activate(E,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 E=this.active.offset().top,D=this.element.height(),C=this.element.children(".ui-menu-item").filter(function(){var F=A(this).offset().top-E-D+A(this).height();return F<10&&F>-10;});C.length||(C=this.element.children(".ui-menu-item:last")),this.activate(B,C);}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 E=this.active.offset().top,D=this.element.height(),C=this.element.children(".ui-menu-item").filter(function(){var F=A(this).offset().top-E+D-A(this).height();return F<10&&F>-10;});C.length||(C=this.element.children(".ui-menu-item:first")),this.activate(B,C);}else{this.activate(B,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"));}},hasScroll:function(){return this.element.height()