diff --git a/default_files/jquery.js b/default_files/jquery.js deleted file mode 100644 index 34ef11f8..00000000 --- a/default_files/jquery.js +++ /dev/null @@ -1,728 +0,0 @@ -(function(a){a.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var b=this,c=b.options;b.running=0;b.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"); -b.headers=b.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){c.disabled||a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){c.disabled||a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){c.disabled||a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){c.disabled||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 f=d.closest(".ui-accordion-header");b.active=f.length?f: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(g){return b._keydown(g)}).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(g){b._clickHandler.call(b,g,this);g.preventDefault()})},_createIcons:function(){var b= -this.options;if(b.icons){a("").addClass("ui-icon "+b.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(b.icons.header).toggleClass(b.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var b=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"); -this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var c=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(b.autoHeight||b.fillHeight)c.css("height","");return a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments);b=="active"&&this.activate(c);if(b=="icons"){this._destroyIcons(); -c&&this._createIcons()}if(b=="disabled")this.headers.add(this.headers.next())[c?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(b){if(!(this.options.disabled||b.altKey||b.ctrlKey)){var c=a.ui.keyCode,d=this.headers.length,f=this.headers.index(b.target),g=false;switch(b.keyCode){case c.RIGHT:case c.DOWN:g=this.headers[(f+1)%d];break;case c.LEFT:case c.UP:g=this.headers[(f-1+d)%d];break;case c.SPACE:case c.ENTER:this._clickHandler({target:b.target},b.target); -b.preventDefault()}if(g){a(b.target).attr("tabIndex",-1);a(g).attr("tabIndex",0);g.focus();return false}return true}},resize:function(){var b=this.options,c;if(b.fillSpace){if(a.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}c=this.element.parent().height();a.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){c-=a(this).outerHeight(true)});this.headers.next().each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+ -a(this).height()))}).css("overflow","auto")}else if(b.autoHeight){c=0;this.headers.next().each(function(){c=Math.max(c,a(this).height("").height())}).height(c)}return this},activate:function(b){this.options.active=b;b=this._findActive(b)[0];this._clickHandler({target:b},b);return this},_findActive:function(b){return b?typeof b==="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===false?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,c){var d=this.options; -if(!d.disabled)if(b.target){b=a(b.currentTarget||c);c=b[0]===this.active[0];d.active=d.collapsible&&c?false:this.headers.index(b);if(!(this.running||!d.collapsible&&c)){var f=this.active;h=b.next();i=this.active.next();e={options:d,newHeader:c&&d.collapsible?a([]):b,oldHeader:this.active,newContent:c&&d.collapsible?a([]):h,oldContent:i};var g=this.headers.index(this.active[0])>this.headers.index(b[0]);this.active=c?a([]):b;this._toggle(h,i,e,c,g);f.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header); -if(!c){b.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);b.next().addClass("ui-accordion-content-active")}}}else if(d.collapsible){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 i=this.active.next(), -e={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:i},h=this.active=a([]);this._toggle(h,i,e)}},_toggle:function(b,c,d,f,g){var i=this,e=i.options;i.toShow=b;i.toHide=c;i.data=d;var h=function(){if(i)return i._completed.apply(i,arguments)};i._trigger("changestart",null,i.data);i.running=c.size()===0?b.size():c.size();if(e.animated){d={};d=e.collapsible&&f?{toShow:a([]),toHide:c,complete:h,down:g,autoHeight:e.autoHeight||e.fillSpace}:{toShow:b,toHide:c,complete:h,down:g,autoHeight:e.autoHeight|| -e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=a.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=a.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;f=a.ui.accordion.animations;var j=e.duration,k=e.animated;if(k&&!f[k]&&!a.easing[k])k="slide";f[k]||(f[k]=function(l){this.slide(l,{easing:k,duration:j||700})});f[k](d)}else{if(e.collapsible&&f)b.toggle();else{c.hide();b.show()}h(true)}c.prev().attr({"aria-expanded":"false", -"aria-selected":"false",tabIndex:-1}).blur();b.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(b){this.running=b?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length)this.toHide.parent()[0].className=this.toHide.parent()[0].className;this._trigger("change",null,this.data)}}});a.extend(a.ui.accordion,{version:"1.8.17", -animations:{slide:function(b,c){b=a.extend({easing:"swing",duration:300},b,c);if(b.toHide.size())if(b.toShow.size()){var d=b.toShow.css("overflow"),f=0,g={},i={},e;c=b.toShow;e=c[0].style.width;c.width(c.parent().width()-parseFloat(c.css("paddingLeft"))-parseFloat(c.css("paddingRight"))-(parseFloat(c.css("borderLeftWidth"))||0)-(parseFloat(c.css("borderRightWidth"))||0));a.each(["height","paddingTop","paddingBottom"],function(h,j){i[j]="hide";h=(""+a.css(b.toShow[0],j)).match(/^([\d+-.]+)(.*)$/); -g[j]={value:h[1],unit:h[2]||"px"}});b.toShow.css({height:0,overflow:"hidden"}).show();b.toHide.filter(":hidden").each(b.complete).end().filter(":visible").animate(i,{step:function(h,j){if(j.prop=="height")f=j.end-j.start===0?0:(j.now-j.start)/(j.end-j.start);b.toShow[0].style[j.prop]=f*g[j.prop].value+g[j.prop].unit},duration:b.duration,easing:b.easing,complete:function(){b.autoHeight||b.toShow.css("height","");b.toShow.css({width:e,overflow:d});b.complete()}})}else b.toHide.animate({height:"hide", -paddingTop:"hide",paddingBottom:"hide"},b);else b.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},b)},bounceslide:function(b){this.slide(b,{easing:b.down?"easeOutBounce":"swing",duration:b.down?1E3:200})}}})})(xQuery); -(function(a){var b,c,d,f,g=function(){var e=a(this).find(":ui-button");setTimeout(function(){e.button("refresh")},1)},i=function(e){var h=e.name,j=e.form,k=a([]);if(h)k=j?a(j).find("[name='"+h+"']"):a("[name='"+h+"']",e.ownerDocument).filter(function(){return!this.form});return k};a.widget("ui.button",{options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",g);if(typeof this.options.disabled!== -"boolean")this.options.disabled=this.element.propAttr("disabled");this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var e=this,h=this.options,j=this.type==="checkbox"||this.type==="radio",k="ui-state-hover"+(!j?" ui-state-active":"");if(h.label===null)h.label=this.buttonElement.html();if(this.element.is(":disabled"))h.disabled=true;this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corner-all").attr("role","button").bind("mouseenter.button",function(){if(!h.disabled){a(this).addClass("ui-state-hover"); -this===b&&a(this).addClass("ui-state-active")}}).bind("mouseleave.button",function(){h.disabled||a(this).removeClass(k)}).bind("click.button",function(l){if(h.disabled){l.preventDefault();l.stopImmediatePropagation()}});this.element.bind("focus.button",function(){e.buttonElement.addClass("ui-state-focus")}).bind("blur.button",function(){e.buttonElement.removeClass("ui-state-focus")});if(j){this.element.bind("change.button",function(){f||e.refresh()});this.buttonElement.bind("mousedown.button",function(l){if(!h.disabled){f= -false;c=l.pageX;d=l.pageY}}).bind("mouseup.button",function(l){if(!h.disabled)if(c!==l.pageX||d!==l.pageY)f=true})}if(this.type==="checkbox")this.buttonElement.bind("click.button",function(){if(h.disabled||f)return false;a(this).toggleClass("ui-state-active");e.buttonElement.attr("aria-pressed",e.element[0].checked)});else if(this.type==="radio")this.buttonElement.bind("click.button",function(){if(h.disabled||f)return false;a(this).addClass("ui-state-active");e.buttonElement.attr("aria-pressed","true"); -var l=e.element[0];i(l).not(l).map(function(){return a(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")});else{this.buttonElement.bind("mousedown.button",function(){if(h.disabled)return false;a(this).addClass("ui-state-active");b=this;a(document).one("mouseup",function(){b=null})}).bind("mouseup.button",function(){if(h.disabled)return false;a(this).removeClass("ui-state-active")}).bind("keydown.button",function(l){if(h.disabled)return false;if(l.keyCode==a.ui.keyCode.SPACE|| -l.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(l){l.keyCode===a.ui.keyCode.SPACE&&a(this).click()})}this._setOption("disabled",h.disabled);this._resetButton()},_determineButtonType:function(){this.type=this.element.is(":checkbox")?"checkbox":this.element.is(":radio")?"radio":this.element.is("input")?"input":"button";if(this.type==="checkbox"||this.type=== -"radio"){var e=this.element.parents().filter(":last"),h="label[for='"+this.element.attr("id")+"']";this.buttonElement=e.find(h);if(!this.buttonElement.length){e=e.length?e.siblings():this.element.siblings();this.buttonElement=e.filter(h);if(!this.buttonElement.length)this.buttonElement=e.find(h)}this.element.addClass("ui-helper-hidden-accessible");(e=this.element.is(":checked"))&&this.buttonElement.addClass("ui-state-active");this.buttonElement.attr("aria-pressed",e)}else this.buttonElement=this.element}, -widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass("ui-button ui-widget ui-state-default ui-corner-all ui-state-hover ui-state-active 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").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(e,h){a.Widget.prototype._setOption.apply(this,arguments);if(e==="disabled")h?this.element.propAttr("disabled",true):this.element.propAttr("disabled",false);else this._resetButton()},refresh:function(){var e=this.element.is(":disabled");e!==this.options.disabled&&this._setOption("disabled",e);if(this.type==="radio")i(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")});else if(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);else{var e=this.buttonElement.removeClass("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"), -h=a("",this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(e.empty()).text(),j=this.options.icons,k=j.primary&&j.secondary,l=[];if(j.primary||j.secondary){if(this.options.text)l.push("ui-button-text-icon"+(k?"s":j.primary?"-primary":"-secondary"));j.primary&&e.prepend("");j.secondary&&e.append("");if(!this.options.text){l.push(k? -"ui-button-icons-only":"ui-button-icon-only");this.hasTitle||e.attr("title",h)}}else l.push("ui-button-text-only");e.addClass(l.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(e,h){e==="disabled"&&this.buttons.button("option",e,h);a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var e=this.element.css("direction")=== -"rtl";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(e?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(e?"ui-corner-left":"ui-corner-right").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)}})})(xQuery); -(function(a,b){function c(){return++f}function d(){return++g}var f=0,g=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
  • #{label}
  • "},_create:function(){this._tabify(true)},_setOption:function(i,e){if(i=="selected")this.options.collapsible&& -e==this.options.selected||this.select(e);else{this.options[i]=e;this._tabify()}},_tabId:function(i){return i.title&&i.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+c()},_sanitizeSelector:function(i){return i.replace(/:/g,"\\:")},_cookie:function(){var i=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+d());return a.cookie.apply(null,[i].concat(a.makeArray(arguments)))},_ui:function(i,e){return{tab:i,panel:e,index:this.anchors.index(i)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var i= -a(this);i.html(i.data("label.tabs")).removeData("label.tabs")})},_tabify:function(i){function e(p,o){p.css("display","");!a.support.opacity&&o.opacity&&p[0].style.removeAttribute("filter")}var h=this,j=this.options,k=/^#.+/;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(p,o){var v=a(o).attr("href"),x=v.split("#")[0],w;if(x&&(x===location.toString().split("#")[0]|| -(w=a("base")[0])&&x===w.href)){v=o.hash;o.href=v}if(k.test(v))h.panels=h.panels.add(h.element.find(h._sanitizeSelector(v)));else if(v&&v!=="#"){a.data(o,"href.tabs",v);a.data(o,"load.tabs",v.replace(/#.*$/,""));v=h._tabId(o);o.href="#"+v;o=h.element.find("#"+v);if(!o.length){o=a(j.panelTemplate).attr("id",v).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(h.panels[p-1]||h.list);o.data("destroy.tabs",true)}h.panels=h.panels.add(o)}else j.disabled.push(p)});if(i){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"); -this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(j.selected===b){location.hash&&this.anchors.each(function(p,o){if(o.hash==location.hash){j.selected=p;return false}});if(typeof j.selected!=="number"&&j.cookie)j.selected=parseInt(h._cookie(),10);if(typeof j.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)j.selected= -this.lis.index(this.lis.filter(".ui-tabs-selected"));j.selected=j.selected||(this.lis.length?0:-1)}else if(j.selected===null)j.selected=-1;j.selected=j.selected>=0&&this.anchors[j.selected]||j.selected<0?j.selected:0;j.disabled=a.unique(j.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(p){return h.lis.index(p)}))).sort();a.inArray(j.selected,j.disabled)!=-1&&j.disabled.splice(a.inArray(j.selected,j.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active"); -if(j.selected>=0&&this.anchors.length){h.element.find(h._sanitizeSelector(h.anchors[j.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(j.selected).addClass("ui-tabs-selected ui-state-active");h.element.queue("tabs",function(){h._trigger("show",null,h._ui(h.anchors[j.selected],h.element.find(h._sanitizeSelector(h.anchors[j.selected].hash))[0]))});this.load(j.selected)}a(window).bind("unload",function(){h.lis.add(h.anchors).unbind(".tabs");h.lis=h.anchors=h.panels=null})}else j.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")); -this.element[j.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");j.cookie&&this._cookie(j.selected,j.cookie);i=0;for(var l;l=this.lis[i];i++)a(l)[a.inArray(i,j.disabled)!=-1&&!a(l).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");j.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(j.event!=="mouseover"){var n=function(p,o){o.is(":not(.ui-state-disabled)")&&o.addClass("ui-state-"+p)},u=function(p,o){o.removeClass("ui-state-"+ -p)};this.lis.bind("mouseover.tabs",function(){n("hover",a(this))});this.lis.bind("mouseout.tabs",function(){u("hover",a(this))});this.anchors.bind("focus.tabs",function(){n("focus",a(this).closest("li"))});this.anchors.bind("blur.tabs",function(){u("focus",a(this).closest("li"))})}var r,m;if(j.fx)if(a.isArray(j.fx)){r=j.fx[0];m=j.fx[1]}else r=m=j.fx;var q=m?function(p,o){a(p).closest("li").addClass("ui-tabs-selected ui-state-active");o.hide().removeClass("ui-tabs-hide").animate(m,m.duration||"normal", -function(){e(o,m);h._trigger("show",null,h._ui(p,o[0]))})}:function(p,o){a(p).closest("li").addClass("ui-tabs-selected ui-state-active");o.removeClass("ui-tabs-hide");h._trigger("show",null,h._ui(p,o[0]))},s=r?function(p,o){o.animate(r,r.duration||"normal",function(){h.lis.removeClass("ui-tabs-selected ui-state-active");o.addClass("ui-tabs-hide");e(o,r);h.element.dequeue("tabs")})}:function(p,o){h.lis.removeClass("ui-tabs-selected ui-state-active");o.addClass("ui-tabs-hide");h.element.dequeue("tabs")}; -this.anchors.bind(j.event+".tabs",function(){var p=this,o=a(p).closest("li"),v=h.panels.filter(":not(.ui-tabs-hide)"),x=h.element.find(h._sanitizeSelector(p.hash));if(o.hasClass("ui-tabs-selected")&&!j.collapsible||o.hasClass("ui-state-disabled")||o.hasClass("ui-state-processing")||h.panels.filter(":animated").length||h._trigger("select",null,h._ui(this,x[0]))===false){this.blur();return false}j.selected=h.anchors.index(this);h.abort();if(j.collapsible)if(o.hasClass("ui-tabs-selected")){j.selected= --1;j.cookie&&h._cookie(j.selected,j.cookie);h.element.queue("tabs",function(){s(p,v)}).dequeue("tabs");this.blur();return false}else if(!v.length){j.cookie&&h._cookie(j.selected,j.cookie);h.element.queue("tabs",function(){q(p,x)});h.load(h.anchors.index(this));this.blur();return false}j.cookie&&h._cookie(j.selected,j.cookie);if(x.length){v.length&&h.element.queue("tabs",function(){s(p,v)});h.element.queue("tabs",function(){q(p,x)});h.load(h.anchors.index(this))}else throw"xQuery UI Tabs: Mismatching fragment identifier."; -a.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(i){if(typeof i=="string")i=this.anchors.index(this.anchors.filter("[href$="+i+"]"));return i},destroy:function(){var i=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e= -a.data(this,"href.tabs");if(e)this.href=e;var h=a(this).unbind(".tabs");a.each(["href","load","cache"],function(j,k){h.removeData(k+".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")});i.cookie&&this._cookie(null,i.cookie);return this},add:function(i, -e,h){if(h===b)h=this.anchors.length;var j=this,k=this.options;e=a(k.tabTemplate.replace(/#\{href\}/g,i).replace(/#\{label\}/g,e));i=!i.indexOf("#")?i.replace("#",""):this._tabId(a("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var l=j.element.find("#"+i);l.length||(l=a(k.panelTemplate).attr("id",i).data("destroy.tabs",true));l.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(h>=this.lis.length){e.appendTo(this.list);l.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[h]); -l.insertBefore(this.panels[h])}k.disabled=a.map(k.disabled,function(n){return n>=h?++n:n});this._tabify();if(this.anchors.length==1){k.selected=0;e.addClass("ui-tabs-selected ui-state-active");l.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){j._trigger("show",null,j._ui(j.anchors[0],j.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[h],this.panels[h]));return this},remove:function(i){i=this._getIndex(i);var e=this.options,h=this.lis.eq(i).remove(),j=this.panels.eq(i).remove(); -if(h.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(i+(i+1=i?--k:k});this._tabify();this._trigger("remove",null,this._ui(h.find("a")[0],j[0]));return this},enable:function(i){i=this._getIndex(i);var e=this.options;if(a.inArray(i,e.disabled)!=-1){this.lis.eq(i).removeClass("ui-state-disabled");e.disabled=a.grep(e.disabled,function(h){return h!=i});this._trigger("enable",null, -this._ui(this.anchors[i],this.panels[i]));return this}},disable:function(i){i=this._getIndex(i);var e=this.options;if(i!=e.selected){this.lis.eq(i).addClass("ui-state-disabled");e.disabled.push(i);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[i],this.panels[i]))}return this},select:function(i){i=this._getIndex(i);if(i==-1)if(this.options.collapsible&&this.options.selected!=-1)i=this.options.selected;else return this;this.anchors.eq(i).trigger(this.options.event+".tabs");return this}, -load:function(i){i=this._getIndex(i);var e=this,h=this.options,j=this.anchors.eq(i)[0],k=a.data(j,"load.tabs");this.abort();if(!k||this.element.queue("tabs").length!==0&&a.data(j,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(i).addClass("ui-state-processing");if(h.spinner){var l=a("span",j);l.data("label.tabs",l.html()).html(h.spinner)}this.xhr=a.ajax(a.extend({},h.ajaxOptions,{url:k,success:function(n,u){e.element.find(e._sanitizeSelector(j.hash)).html(n);e._cleanup();h.cache&&a.data(j, -"cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[i],e.panels[i]));try{h.ajaxOptions.success(n,u)}catch(r){}},error:function(n,u){e._cleanup();e._trigger("load",null,e._ui(e.anchors[i],e.panels[i]));try{h.ajaxOptions.error(n,u,i,j)}catch(r){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this}, -url:function(i,e){this.anchors.eq(i).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});a.extend(a.ui.tabs,{version:"1.8.17"});a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(i,e){var h=this,j=this.options,k=h._rotate||(h._rotate=function(l){clearTimeout(h.rotation);h.rotation=setTimeout(function(){var n=j.selected;h.select(++n').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), -top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= -this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=f.handles||(!a(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne", -nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var g=this.handles.split(",");this.handles={};for(var i=0;i');/sw|se|ne|nw/.test(e)&&h.css({zIndex:++f.zIndex});"se"==e&&h.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[e]=".ui-resizable-"+e;this.element.append(h)}}this._renderAxis=function(j){j=j||this.element;for(var k in this.handles){if(this.handles[k].constructor== -String)this.handles[k]=a(this.handles[k],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var l=a(this.handles[k],this.element),n=0;n=/sw|ne|nw|se|n|s/.test(k)?l.outerHeight():l.outerWidth();l=["padding",/ne|nw|n/.test(k)?"Top":/se|sw|s/.test(k)?"Bottom":/^e$/.test(k)?"Right":"Left"].join("");j.css(l,n);this._proportionallyResize()}a(this.handles[k])}};this._renderAxis(this.element);this._handles=a(".ui-resizable-handle",this.element).disableSelection(); -this._handles.mouseover(function(){if(!d.resizing){if(this.className)var j=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);d.axis=j&&j[1]?j[1]:"se"}});if(f.autoHide){this._handles.hide();a(this.element).addClass("ui-resizable-autohide").hover(function(){if(!f.disabled){a(this).removeClass("ui-resizable-autohide");d._handles.show()}},function(){if(!f.disabled)if(!d.resizing){a(this).addClass("ui-resizable-autohide");d._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy(); -var d=function(g){a(g).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){d(this.element);var f=this.element;f.after(this.originalElement.css({position:f.css("position"),width:f.outerWidth(),height:f.outerHeight(),top:f.css("top"),left:f.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);d(this.originalElement);return this},_mouseCapture:function(d){var f= -false;for(var g in this.handles)if(a(this.handles[g])[0]==d.target)f=true;return!this.options.disabled&&f},_mouseStart:function(d){var f=this.options,g=this.element.position(),i=this.element;this.resizing=true;this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()};if(i.is(".ui-draggable")||/absolute/.test(i.css("position")))i.css({position:"absolute",top:g.top,left:g.left});a.browser.opera&&/relative/.test(i.css("position"))&&i.css({position:"relative",top:"auto",left:"auto"}); -this._renderProxy();g=b(this.helper.css("left"));var e=b(this.helper.css("top"));if(f.containment){g+=a(f.containment).scrollLeft()||0;e+=a(f.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:g,top:e};this.size=this._helper?{width:i.outerWidth(),height:i.outerHeight()}:{width:i.width(),height:i.height()};this.originalSize=this._helper?{width:i.outerWidth(),height:i.outerHeight()}:{width:i.width(),height:i.height()};this.originalPosition={left:g,top:e};this.sizeDiff= -{width:i.outerWidth()-i.width(),height:i.outerHeight()-i.height()};this.originalMousePosition={left:d.pageX,top:d.pageY};this.aspectRatio=typeof f.aspectRatio=="number"?f.aspectRatio:this.originalSize.width/this.originalSize.height||1;f=a(".ui-resizable-"+this.axis).css("cursor");a("body").css("cursor",f=="auto"?this.axis+"-resize":f);i.addClass("ui-resizable-resizing");this._propagate("start",d);return true},_mouseDrag:function(d){var f=this.helper,g=this.originalMousePosition,i=this._change[this.axis]; -if(!i)return false;g=i.apply(this,[d,d.pageX-g.left||0,d.pageY-g.top||0]);this._updateVirtualBoundaries(d.shiftKey);if(this._aspectRatio||d.shiftKey)g=this._updateRatio(g,d);g=this._respectSize(g,d);this._propagate("resize",d);f.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(g);this._trigger("resize",d,this.ui());return false}, -_mouseStop:function(d){this.resizing=false;var f=this.options;if(this._helper){var g=this._proportionallyResizeElements,i=g.length&&/textarea/i.test(g[0].nodeName);g=i&&a.ui.hasScroll(g[0],"left")?0:this.sizeDiff.height;i=i?0:this.sizeDiff.width;i={width:this.helper.width()-i,height:this.helper.height()-g};g=parseInt(this.element.css("left"),10)+(this.position.left-this.originalPosition.left)||null;var e=parseInt(this.element.css("top"),10)+(this.position.top-this.originalPosition.top)||null;f.animate|| -this.element.css(a.extend(i,{top:e,left:g}));this.helper.height(this.size.height);this.helper.width(this.size.width);this._helper&&!f.animate&&this._proportionallyResize()}a("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",d);this._helper&&this.helper.remove();return false},_updateVirtualBoundaries:function(d){var f=this.options,g,i,e;f={minWidth:c(f.minWidth)?f.minWidth:0,maxWidth:c(f.maxWidth)?f.maxWidth:Infinity,minHeight:c(f.minHeight)?f.minHeight: -0,maxHeight:c(f.maxHeight)?f.maxHeight:Infinity};if(this._aspectRatio||d){d=f.minHeight*this.aspectRatio;i=f.minWidth/this.aspectRatio;g=f.maxHeight*this.aspectRatio;e=f.maxWidth/this.aspectRatio;if(d>f.minWidth)f.minWidth=d;if(i>f.minHeight)f.minHeight=i;if(gd.width,j=c(d.height)&&f.minHeight&&f.minHeight>d.height;if(h)d.width=f.minWidth;if(j)d.height=f.minHeight;if(i)d.width=f.maxWidth;if(e)d.height=f.maxHeight;var k=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,n=/sw|nw|w/.test(g);g=/nw|ne|n/.test(g);if(h&&n)d.left=k-f.minWidth;if(i&&n)d.left=k-f.maxWidth;if(j&&g)d.top=l-f.minHeight;if(e&&g)d.top=l-f.maxHeight;if((f=!d.width&&!d.height)&&!d.left&&d.top)d.top=null; -else if(f&&!d.top&&d.left)d.left=null;return d},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var d=this.helper||this.element,f=0;f');var f=a.browser.msie&&a.browser.version<7,g=f?1:0;f=f?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+ -f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-g+"px",top:this.elementOffset.top-g+"px",zIndex:++d.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(d,f){return{width:this.originalSize.width+f}},w:function(d,f){return{left:this.originalPosition.left+f,width:this.originalSize.width-f}},n:function(d,f,g){return{top:this.originalPosition.top+g,height:this.originalSize.height-g}},s:function(d,f,g){return{height:this.originalSize.height+ -g}},se:function(d,f,g){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[d,f,g]))},sw:function(d,f,g){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[d,f,g]))},ne:function(d,f,g){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[d,f,g]))},nw:function(d,f,g){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[d,f,g]))}},_propagate:function(d,f){a.ui.plugin.call(this,d,[f,this.ui()]); -d!="resize"&&this._trigger(d,f,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.17"});a.ui.plugin.add("resizable","alsoResize",{start:function(){var d=a(this).data("resizable").options,f=function(g){a(g).each(function(){var i=a(this);i.data("resizable-alsoresize",{width:parseInt(i.width(), -10),height:parseInt(i.height(),10),left:parseInt(i.css("left"),10),top:parseInt(i.css("top"),10),position:i.css("position")})})};if(typeof d.alsoResize=="object"&&!d.alsoResize.parentNode)if(d.alsoResize.length){d.alsoResize=d.alsoResize[0];f(d.alsoResize)}else a.each(d.alsoResize,function(g){f(g)});else f(d.alsoResize)},resize:function(d,f){var g=a(this).data("resizable");d=g.options;var i=g.originalSize,e=g.originalPosition,h={height:g.size.height-i.height||0,width:g.size.width-i.width||0,top:g.position.top- -e.top||0,left:g.position.left-e.left||0},j=function(k,l){a(k).each(function(){var n=a(this),u=a(this).data("resizable-alsoresize"),r={},m=l&&l.length?l:n.parents(f.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(m,function(q,s){if((q=(u[s]||0)+(h[s]||0))&&q>=0)r[s]=q||null});if(a.browser.opera&&/relative/.test(n.css("position"))){g._revertToRelativePosition=true;n.css({position:"absolute",top:"auto",left:"auto"})}n.css(r)})};typeof d.alsoResize=="object"&&!d.alsoResize.nodeType? -a.each(d.alsoResize,function(k,l){j(k,l)}):j(d.alsoResize)},stop:function(){var d=a(this).data("resizable"),f=d.options,g=function(i){a(i).each(function(){var e=a(this);e.css({position:e.data("resizable-alsoresize").position})})};if(d._revertToRelativePosition){d._revertToRelativePosition=false;typeof f.alsoResize=="object"&&!f.alsoResize.nodeType?a.each(f.alsoResize,function(i){g(i)}):g(f.alsoResize)}a(this).removeData("resizable-alsoresize")}});a.ui.plugin.add("resizable","animate",{stop:function(d){var f= -a(this).data("resizable"),g=f.options,i=f._proportionallyResizeElements,e=i.length&&/textarea/i.test(i[0].nodeName),h=e&&a.ui.hasScroll(i[0],"left")?0:f.sizeDiff.height;e={width:f.size.width-(e?0:f.sizeDiff.width),height:f.size.height-h};h=parseInt(f.element.css("left"),10)+(f.position.left-f.originalPosition.left)||null;var j=parseInt(f.element.css("top"),10)+(f.position.top-f.originalPosition.top)||null;f.element.animate(a.extend(e,j&&h?{top:j,left:h}:{}),{duration:g.animateDuration,easing:g.animateEasing, -step:function(){var k={width:parseInt(f.element.css("width"),10),height:parseInt(f.element.css("height"),10),top:parseInt(f.element.css("top"),10),left:parseInt(f.element.css("left"),10)};i&&i.length&&a(i[0]).css({width:k.width,height:k.height});f._updateCache(k);f._propagate("resize",d)}})}});a.ui.plugin.add("resizable","containment",{start:function(){var d=a(this).data("resizable"),f=d.element,g=d.options.containment;if(f=g instanceof a?g.get(0):/parent/.test(g)?f.parent().get(0):g){d.containerElement= -a(f);if(/document/.test(g)||g==document){d.containerOffset={left:0,top:0};d.containerPosition={left:0,top:0};d.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight}}else{var i=a(f),e=[];a(["Top","Right","Left","Bottom"]).each(function(k,l){e[k]=b(i.css("padding"+l))});d.containerOffset=i.offset();d.containerPosition=i.position();d.containerSize={height:i.innerHeight()-e[3],width:i.innerWidth()-e[1]};g=d.containerOffset; -var h=d.containerSize.height,j=d.containerSize.width;j=a.ui.hasScroll(f,"left")?f.scrollWidth:j;h=a.ui.hasScroll(f)?f.scrollHeight:h;d.parentData={element:f,left:g.left,top:g.top,width:j,height:h}}}},resize:function(d){var f=a(this).data("resizable"),g=f.options,i=f.containerOffset,e=f.position;d=f._aspectRatio||d.shiftKey;var h={top:0,left:0},j=f.containerElement;if(j[0]!=document&&/static/.test(j.css("position")))h=i;if(e.left<(f._helper?i.left:0)){f.size.width+=f._helper?f.position.left-i.left: -f.position.left-h.left;if(d)f.size.height=f.size.width/g.aspectRatio;f.position.left=g.helper?i.left:0}if(e.top<(f._helper?i.top:0)){f.size.height+=f._helper?f.position.top-i.top:f.position.top;if(d)f.size.width=f.size.height*g.aspectRatio;f.position.top=f._helper?i.top:0}f.offset.left=f.parentData.left+f.position.left;f.offset.top=f.parentData.top+f.position.top;g=Math.abs((f._helper?f.offset.left-h.left:f.offset.left-h.left)+f.sizeDiff.width);i=Math.abs((f._helper?f.offset.top-h.top:f.offset.top- -i.top)+f.sizeDiff.height);e=f.containerElement.get(0)==f.element.parent().get(0);h=/relative|absolute/.test(f.containerElement.css("position"));if(e&&h)g-=f.parentData.left;if(g+f.size.width>=f.parentData.width){f.size.width=f.parentData.width-g;if(d)f.size.height=f.size.width/f.aspectRatio}if(i+f.size.height>=f.parentData.height){f.size.height=f.parentData.height-i;if(d)f.size.width=f.size.height*f.aspectRatio}},stop:function(){var d=a(this).data("resizable"),f=d.options,g=d.containerOffset,i=d.containerPosition, -e=d.containerElement,h=a(d.helper),j=h.offset(),k=h.outerWidth()-d.sizeDiff.width;h=h.outerHeight()-d.sizeDiff.height;d._helper&&!f.animate&&/relative/.test(e.css("position"))&&a(this).css({left:j.left-i.left-g.left,width:k,height:h});d._helper&&!f.animate&&/static/.test(e.css("position"))&&a(this).css({left:j.left-i.left-g.left,width:k,height:h})}});a.ui.plugin.add("resizable","ghost",{start:function(){var d=a(this).data("resizable"),f=d.options,g=d.size;d.ghost=d.originalElement.clone();d.ghost.css({opacity:0.25, -display:"block",position:"relative",height:g.height,width:g.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof f.ghost=="string"?f.ghost:"");d.ghost.appendTo(d.helper)},resize:function(){var d=a(this).data("resizable");d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(){var d=a(this).data("resizable");d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}});a.ui.plugin.add("resizable","grid",{resize:function(){var d= -a(this).data("resizable"),f=d.options,g=d.size,i=d.originalSize,e=d.originalPosition,h=d.axis;f.grid=typeof f.grid=="number"?[f.grid,f.grid]:f.grid;var j=Math.round((g.width-i.width)/(f.grid[0]||1))*(f.grid[0]||1);f=Math.round((g.height-i.height)/(f.grid[1]||1))*(f.grid[1]||1);if(/^(se|s|e)$/.test(h)){d.size.width=i.width+j;d.size.height=i.height+f}else if(/^(ne)$/.test(h)){d.size.width=i.width+j;d.size.height=i.height+f;d.position.top=e.top-f}else{if(/^(sw)$/.test(h)){d.size.width=i.width+j;d.size.height= -i.height+f}else{d.size.width=i.width+j;d.size.height=i.height+f;d.position.top=e.top-f}d.position.left=e.left-j}}});var b=function(d){return parseInt(d,10)||0},c=function(d){return!isNaN(parseInt(d,10))}})(xQuery); -(function(a,b){var c={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},d={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},f=a.attrFn||{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true,click:true};a.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false, -position:{my:"center",at:"center",collision:"fit",using:function(g){var i=a(this).css(g).offset().top;i<0&&a(this).css("top",g.top-i)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var g=this,i=g.options,e=i.title||" ",h=a.ui.dialog.getTitleId(g.element),j=(g.uiDialog=a("
    ")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+ -i.dialogClass).css({zIndex:i.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(n){if(i.closeOnEscape&&!n.isDefaultPrevented()&&n.keyCode&&n.keyCode===a.ui.keyCode.ESCAPE){g.close(n);n.preventDefault()}}).attr({role:"dialog","aria-labelledby":h}).mousedown(function(n){g.moveToTop(false,n)});g.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(j);var k=(g.uiDialogTitlebar=a("
    ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(j), -l=a('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){l.addClass("ui-state-hover")},function(){l.removeClass("ui-state-hover")}).focus(function(){l.addClass("ui-state-focus")}).blur(function(){l.removeClass("ui-state-focus")}).click(function(n){g.close(n);return false}).appendTo(k);(g.uiDialogTitlebarCloseText=a("")).addClass("ui-icon ui-icon-closethick").text(i.closeText).appendTo(l);a("").addClass("ui-dialog-title").attr("id", -h).html(e).prependTo(k);if(a.isFunction(i.beforeclose)&&!a.isFunction(i.beforeClose))i.beforeClose=i.beforeclose;k.find("*").add(k).disableSelection();i.draggable&&a.fn.draggable&&g._makeDraggable();i.resizable&&a.fn.resizable&&g._makeResizable();g._createButtons(i.buttons);g._isOpen=false;a.fn.bgiframe&&j.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){this.overlay&&this.overlay.destroy();this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"); -this.uiDialog.remove();this.originalTitle&&this.element.attr("title",this.originalTitle);return this},widget:function(){return this.uiDialog},close:function(g){var i=this,e,h;if(false!==i._trigger("beforeClose",g)){i.overlay&&i.overlay.destroy();i.uiDialog.unbind("keypress.ui-dialog");i._isOpen=false;if(i.options.hide)i.uiDialog.hide(i.options.hide,function(){i._trigger("close",g)});else{i.uiDialog.hide();i._trigger("close",g)}a.ui.dialog.overlay.resize();if(i.options.modal){e=0;a(".ui-dialog").each(function(){if(this!== -i.uiDialog[0]){h=a(this).css("z-index");isNaN(h)||(e=Math.max(e,h))}});a.ui.dialog.maxZ=e}return i}},isOpen:function(){return this._isOpen},moveToTop:function(g,i){var e=this.options;if(e.modal&&!g||!e.stack&&!e.modal)return this._trigger("focus",i);if(e.zIndex>a.ui.dialog.maxZ)a.ui.dialog.maxZ=e.zIndex;if(this.overlay){a.ui.dialog.maxZ+=1;this.overlay.$el.css("z-index",a.ui.dialog.overlay.maxZ=a.ui.dialog.maxZ)}g={scrollTop:this.element.scrollTop(),scrollLeft:this.element.scrollLeft()};a.ui.dialog.maxZ+= -1;this.uiDialog.css("z-index",a.ui.dialog.maxZ);this.element.attr(g);this._trigger("focus",i);return this},open:function(){if(!this._isOpen){var g=this.options,i=this.uiDialog;this.overlay=g.modal?new a.ui.dialog.overlay(this):null;this._size();this._position(g.position);i.show(g.show);this.moveToTop(true);g.modal&&i.bind("keydown.ui-dialog",function(e){if(e.keyCode===a.ui.keyCode.TAB){var h=a(":tabbable",this),j=h.filter(":first");h=h.filter(":last");if(e.target===h[0]&&!e.shiftKey){j.focus(1);return false}else if(e.target=== -j[0]&&e.shiftKey){h.focus(1);return false}}});a(this.element.find(":tabbable").get().concat(i.find(".ui-dialog-buttonpane :tabbable").get().concat(i.get()))).eq(0).focus();this._isOpen=true;this._trigger("open");return this}},_createButtons:function(g){var i=this,e=false,h=a("
    ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),j=a("
    ").addClass("ui-dialog-buttonset").appendTo(h);i.uiDialog.find(".ui-dialog-buttonpane").remove();typeof g==="object"&&g!==null&& -a.each(g,function(){return!(e=true)});if(e){a.each(g,function(k,l){l=a.isFunction(l)?{click:l,text:k}:l;var n=a('').click(function(){l.click.apply(i.element[0],arguments)}).appendTo(j);a.each(l,function(u,r){if(u!=="click")u in f?n[u](r):n.attr(u,r)});a.fn.button&&n.button()});h.appendTo(i.uiDialog)}},_makeDraggable:function(){function g(k){return{position:k.position,offset:k.offset}}var i=this,e=i.options,h=a(document),j;i.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close", -handle:".ui-dialog-titlebar",containment:"document",start:function(k,l){j=e.height==="auto"?"auto":a(this).height();a(this).height(a(this).height()).addClass("ui-dialog-dragging");i._trigger("dragStart",k,g(l))},drag:function(k,l){i._trigger("drag",k,g(l))},stop:function(k,l){e.position=[l.position.left-h.scrollLeft(),l.position.top-h.scrollTop()];a(this).removeClass("ui-dialog-dragging").height(j);i._trigger("dragStop",k,g(l));a.ui.dialog.overlay.resize()}})},_makeResizable:function(g){function i(k){return{originalPosition:k.originalPosition, -originalSize:k.originalSize,position:k.position,size:k.size}}g=g===b?this.options.resizable:g;var e=this,h=e.options,j=e.uiDialog.css("position");g=typeof g==="string"?g:"n,e,s,w,se,sw,ne,nw";e.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:e.element,maxWidth:h.maxWidth,maxHeight:h.maxHeight,minWidth:h.minWidth,minHeight:e._minHeight(),handles:g,start:function(k,l){a(this).addClass("ui-dialog-resizing");e._trigger("resizeStart",k,i(l))},resize:function(k,l){e._trigger("resize", -k,i(l))},stop:function(k,l){a(this).removeClass("ui-dialog-resizing");h.height=a(this).height();h.width=a(this).width();e._trigger("resizeStop",k,i(l));a.ui.dialog.overlay.resize()}}).css("position",j).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var g=this.options;return g.height==="auto"?g.minHeight:Math.min(g.minHeight,g.height)},_position:function(g){var i=[],e=[0,0],h;if(g){if(typeof g==="string"||typeof g==="object"&&"0"in g){i=g.split?g.split(" "): -[g[0],g[1]];if(i.length===1)i[1]=i[0];a.each(["left","top"],function(j,k){if(+i[j]===i[j]){e[j]=i[j];i[j]=k}});g={my:i.join(" "),at:i.join(" "),offset:e.join(" ")}}g=a.extend({},a.ui.dialog.prototype.options.position,g)}else g=a.ui.dialog.prototype.options.position;(h=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},g));h||this.uiDialog.hide()},_setOptions:function(g){var i=this,e={},h=false;a.each(g,function(j,k){i._setOption(j,k); -if(j in c)h=true;if(j in d)e[j]=k});h&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",e)},_setOption:function(g,i){var e=this.uiDialog;switch(g){case "beforeclose":g="beforeClose";break;case "buttons":this._createButtons(i);break;case "closeText":this.uiDialogTitlebarCloseText.text(""+i);break;case "dialogClass":e.removeClass(this.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+i);break;case "disabled":i?e.addClass("ui-dialog-disabled"): -e.removeClass("ui-dialog-disabled");break;case "draggable":var h=e.is(":data(draggable)");h&&!i&&e.draggable("destroy");!h&&i&&this._makeDraggable();break;case "position":this._position(i);break;case "resizable":(h=e.is(":data(resizable)"))&&!i&&e.resizable("destroy");h&&typeof i==="string"&&e.resizable("option","handles",i);!h&&i!==false&&this._makeResizable(i);break;case "title":a(".ui-dialog-title",this.uiDialogTitlebar).html(""+(i||" "));break}a.Widget.prototype._setOption.apply(this,arguments)}, -_size:function(){var g=this.options,i,e,h=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(g.minWidth>g.width)g.width=g.minWidth;i=this.uiDialog.css({height:"auto",width:g.width}).height();e=Math.max(0,g.minHeight-i);if(g.height==="auto")if(a.support.minHeight)this.element.css({minHeight:e,height:"auto"});else{this.uiDialog.show();g=this.element.css("height","auto").height();h||this.uiDialog.hide();this.element.height(Math.max(g,e))}else this.element.height(Math.max(g.height- -i,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});a.extend(a.ui.dialog,{version:"1.8.17",uuid:0,maxZ:0,getTitleId:function(g){g=g.attr("id");if(!g){this.uuid+=1;g=this.uuid}return"ui-dialog-title-"+g},overlay:function(g){this.$el=a.ui.dialog.overlay.create(g)}});a.extend(a.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(g){return g+".dialog-overlay"}).join(" "), -create:function(g){if(this.instances.length===0){setTimeout(function(){a.ui.dialog.overlay.instances.length&&a(document).bind(a.ui.dialog.overlay.events,function(e){if(a(e.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});a.fn.bgiframe&&i.bgiframe();this.instances.push(i);return i},destroy:function(g){var i=a.inArray(g,this.instances);i!=-1&&this.oldInstances.push(this.instances.splice(i,1)[0]);this.instances.length===0&&a([document,window]).unbind(".dialog-overlay");g.remove();var e=0;a.each(this.instances,function(){e=Math.max(e,this.css("z-index"))});this.maxZ=e},height:function(){var g,i;if(a.browser.msie&& -a.browser.version<7){g=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);i=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return g=9)&&!c.button)return this._mouseUp(c);if(this._mouseStarted){this._mouseDrag(c);return c.preventDefault()}if(this._mouseDistanceMet(c)&&this._mouseDelayMet(c))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,c)!==false)?this._mouseDrag(c):this._mouseUp(c);return!this._mouseStarted},_mouseUp:function(c){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted= -false;c.target==this._mouseDownEvent.target&&a.data(c.target,this.widgetName+".preventClickEvent",true);this._mouseStop(c)}return false},_mouseDistanceMet:function(c){return Math.max(Math.abs(this._mouseDownEvent.pageX-c.pageX),Math.abs(this._mouseDownEvent.pageY-c.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(xQuery); -(function(a){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== -"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(b){var c= -this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(b);if(!this.handle)return false;if(c.iframeFix)a(c.iframeFix===true?"iframe":c.iframeFix).each(function(){a('
    ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(a(this).offset()).appendTo("body")});return true},_mouseStart:function(b){var c=this.options; -this.helper=this._createHelper(b);this._cacheHelperProportions();if(a.ui.ddmanager)a.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}); -this.originalPosition=this.position=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt);c.containment&&this._setContainment();if(this._trigger("start",b)===false){this._clear();return false}this._cacheHelperProportions();a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(b,true);a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b);return true}, -_mouseDrag:function(b,c){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!c){c=this._uiHash();if(this._trigger("drag",b,c)===false){this._mouseUp({});return false}this.position=c.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";a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);return false},_mouseStop:function(b){var c= -false;if(a.ui.ddmanager&&!this.options.dropBehaviour)c=a.ui.ddmanager.drop(this,b);if(this.dropped){c=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===true||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var d=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration, -10),function(){d._trigger("stop",b)!==false&&d._clear()})}else this._trigger("stop",b)!==false&&this._clear();return false},_mouseUp:function(b){this.options.iframeFix===true&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b);return a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(b){var c=!this.options.handle|| -!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==b.target)c=true});return c},_createHelper:function(b){var c=this.options;b=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;b.parents("body").length||b.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo);b[0]!=this.element[0]&&!/(fixed|absolute)/.test(b.css("position"))&& -b.css("position","absolute");return b},_adjustOffsetFromHelper:function(b){if(typeof b=="string")b=b.split(" ");if(a.isArray(b))b={left:+b[0],top:+b[1]||0};if("left"in b)this.offset.click.left=b.left+this.margins.left;if("right"in b)this.offset.click.left=this.helperProportions.width-b.right+this.margins.left;if("top"in b)this.offset.click.top=b.top+this.margins.top;if("bottom"in b)this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent= -this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"), -10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"), -10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;if(b.containment=="parent")b.containment=this.helper[0].parentNode;if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top, -(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){b=a(b.containment);var c=b[0];if(c){b.offset();var d=a(c).css("overflow")!= -"hidden";this.containment=[(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0),(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0),(d?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-this.margins.right,(d?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-this.margins.bottom];this.relative_container=b}}else if(b.containment.constructor==Array)this.containment=b.containment},_convertPositionTo:function(b,c){if(!c)c=this.position;b=b=="absolute"?1:-1;var d=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(d[0].tagName);return{top:c.top+ -this.offset.relative.top*b+this.offset.parent.top*b-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:d.scrollTop())*b),left:c.left+this.offset.relative.left*b+this.offset.parent.left*b-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:d.scrollLeft())*b)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&& -!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(d[0].tagName),g=b.pageX,i=b.pageY;if(this.originalPosition){var e;if(this.containment){if(this.relative_container){e=this.relative_container.offset();e=[this.containment[0]+e.left,this.containment[1]+e.top,this.containment[2]+e.left,this.containment[3]+e.top]}else e=this.containment;if(b.pageX-this.offset.click.lefte[2])g=e[2]+this.offset.click.left;if(b.pageY-this.offset.click.top>e[3])i=e[3]+this.offset.click.top}if(c.grid){i=c.grid[1]?this.originalPageY+Math.round((i-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;i=e?!(i-this.offset.click.tope[3])?i:!(i-this.offset.click.tope[2])?g:!(g-this.offset.click.left=0;k--){var l=d.snapElements[k].left,n=l+d.snapElements[k].width,u=d.snapElements[k].top,r=u+d.snapElements[k].height;if(l-g=k&&i<=l||e>=k&&e<=l||il)&&(f>=h&&f<=j||g>=h&&g<=j||fj); -default:return false}};a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var d=a.ui.ddmanager.droppables[b.options.scope]||[],f=c?c.type:null,g=(b.currentItem||b.element).find(":data(droppable)").andSelf(),i=0;a:for(;i=0)&&c(f,!i)}});a(function(){var f=document.body,g=f.appendChild(g=document.createElement("div"));a.extend(g.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=g.offsetHeight===100;a.support.selectstart="onselectstart"in g;f.removeChild(g).style.display="none"});a.extend(a.ui,{plugin:{add:function(f,g,i){f=a.ui[f].prototype;for(var e in i){f.plugins[e]=f.plugins[e]||[];f.plugins[e].push([g,i[e]])}},call:function(f,g,i){if((g=f.plugins[g])&& -f.element[0].parentNode)for(var e=0;e0)return true;f[g]=1;i=f[g]>0;f[g]=0;return i},isOverAxis:function(f,g,i){return f>g&&f *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){var b=this.options;this.containerCache={};this.element.addClass("ui-sortable"); -this.refresh();this.floating=this.items.length?b.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled");this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--)this.items[b].item.removeData(this.widgetName+"-item");return this},_setOption:function(b,c){if(b==="disabled"){this.options[b]=c; -this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")}else a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){var d=this;if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(b);var f=null,g=this;a(b.target).parents().each(function(){if(a.data(this,d.widgetName+"-item")==g){f=a(this);return false}});if(a.data(b.target,d.widgetName+"-item")==g)f=a(b.target);if(!f)return false;if(this.options.handle&& -!c){var i=false;a(this.options.handle,f).find("*").andSelf().each(function(){if(this==b.target)i=true});if(!i)return false}this.currentItem=f;this._removeCurrentsFromItems();return true},_mouseStart:function(b,c,d){c=this.options;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;c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]}; -this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();c.containment&&this._setContainment();if(c.cursor){if(a("body").css("cursor"))this._storedCursor=a("body").css("cursor");a("body").css("cursor",c.cursor)}if(c.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",c.opacity)}if(c.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",c.zIndex)}if(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(d=this.containers.length-1;d>=0;d--)this.containers[d]._trigger("activate",b,this._uiHash(this));if(a.ui.ddmanager)a.ui.ddmanager.current=this;a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(b); -return true},_mouseDrag:function(b){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var c=this.options,d=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY=0;c--){d=this.items[c];var f=d.item[0],g=this._intersectsWithPointer(d);if(g)if(f!=this.currentItem[0]&&this.placeholder[g==1?"next":"prev"]()[0]!=f&&!a.ui.contains(this.placeholder[0],f)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0], -f):true)){this.direction=g==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(d))this._rearrange(b,d);else break;this._trigger("change",b,this._uiHash());break}}this._contactContainers(b);a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);this._trigger("sort",b,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(b,c){if(b){a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this;c=d.placeholder.offset(); -d.reverting=true;a(this.helper).animate({left:c.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:c.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return false}},cancel:function(){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 b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate",null,this._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,this._uiHash(this));this.containers[b].containerCache.over=0}}}if(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:false,reverting:false,_noFinalSort:null});this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(b){var c=this._getItemsAsxQuery(b&&b.connected),d=[];b=b||{};a(c).each(function(){var f=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);if(f)d.push((b.key||f[1]+"[]")+"="+(b.key&&b.expression?f[1]:f[2]))});!d.length&&b.key&&d.push(b.key+"=");return d.join("&")}, -toArray:function(b){var c=this._getItemsAsxQuery(b&&b.connected),d=[];b=b||{};c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")});return d},_intersectsWith:function(b){var c=this.positionAbs.left,d=c+this.helperProportions.width,f=this.positionAbs.top,g=f+this.helperProportions.height,i=b.left,e=i+b.width,h=b.top,j=h+b.height,k=this.offset.click.top,l=this.offset.click.left;k=f+k>h&&f+ki&&c+lb[this.floating?"width":"height"]?k:i0?"down":"up")},_getDragHorizontalDirection:function(){var b=this.positionAbs.left-this.lastPositionAbs.left;return b!=0&&(b>0?"right":"left")},refresh:function(b){this._refreshItems(b);this.refreshPositions();return this},_connectWith:function(){var b=this.options;return b.connectWith.constructor==String?[b.connectWith]:b.connectWith},_getItemsAsxQuery:function(b){var c=[],d=[],f=this._connectWith(); -if(f&&b)for(b=f.length-1;b>=0;b--)for(var g=a(f[b]),i=g.length-1;i>=0;i--){var e=a.data(g[i],this.widgetName);if(e&&e!=this&&!e.options.disabled)d.push([a.isFunction(e.options.items)?e.options.items.call(e.element):a(e.options.items,e.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),e])}d.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(b=d.length-1;b>=0;b--)d[b][0].each(function(){c.push(this)});return a(c)},_removeCurrentsFromItems:function(){for(var b=this.currentItem.find(":data("+this.widgetName+"-item)"),c=0;c=0;g--)for(var i=a(f[g]),e=i.length-1;e>=0;e--){var h=a.data(i[e],this.widgetName);if(h&&h!=this&&!h.options.disabled){d.push([a.isFunction(h.options.items)?h.options.items.call(h.element[0],b,{item:this.currentItem}):a(h.options.items,h.element),h]);this.containers.push(h)}}for(g=d.length-1;g>=0;g--){b=d[g][1];f=d[g][0];e=0;for(i=f.length;e=0;c--){var d=this.items[c];if(!(d.instance!=this.currentContainer&&this.currentContainer&&d.item[0]!=this.currentItem[0])){var f=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;if(!b){d.width=f.outerWidth();d.height=f.outerHeight()}f=f.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(c=this.containers.length-1;c>=0;c--){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 f=d.placeholder;d.placeholder={element:function(){var g= -a(document.createElement(c.currentItem[0].nodeName)).addClass(f||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!f)g.style.visibility="hidden";return g},update:function(g,i){if(!(f&&!d.forcePlaceholderSize)){i.height()||i.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10));i.width()||i.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){for(var c=null,d=null,f=this.containers.length-1;f>=0;f--)if(!a.ui.contains(this.currentItem[0],this.containers[f].element[0]))if(this._intersectsWith(this.containers[f].containerCache)){if(!(c&&a.ui.contains(this.containers[f].element[0],c.element[0]))){c=this.containers[f];d=f}}else if(this.containers[f].containerCache.over){this.containers[f]._trigger("out", -b,this._uiHash(this));this.containers[f].containerCache.over=0}if(c)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]){c=1E4;f=null;for(var g=this.positionAbs[this.containers[d].floating?"left":"top"],i=this.items.length-1;i>=0;i--)if(a.ui.contains(this.containers[d].element[0],this.items[i].item[0])){var e=this.items[i][this.containers[d].floating?"left":"top"];if(Math.abs(e- -g)this.containment[2])g=this.containment[2]+this.offset.click.left;if(b.pageY-this.offset.click.top>this.containment[3])i=this.containment[3]+this.offset.click.top}if(c.grid){i=this.originalPageY+Math.round((i- -this.originalPageY)/c.grid[1])*c.grid[1];i=this.containment?!(i-this.offset.click.topthis.containment[3])?i:!(i-this.offset.click.topthis.containment[2])?g:!(g-this.offset.click.left=0;f--)if(a.ui.contains(this.containers[f].element[0],this.currentItem[0])&&!c){d.push(function(g){return function(i){g._trigger("receive",i,this._uiHash(this))}}.call(this,this.containers[f]));d.push(function(g){return function(i){g._trigger("update",i,this._uiHash(this))}}.call(this,this.containers[f]))}}for(f=this.containers.length-1;f>=0;f--){c||d.push(function(g){return function(i){g._trigger("deactivate",i,this._uiHash(this))}}.call(this, -this.containers[f]));if(this.containers[f].containerCache.over){d.push(function(g){return function(i){g._trigger("out",i,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);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop", -b,this._uiHash());for(f=0;f").appendTo(a);xQuery.ui.ncbiautocomplete._globalOptionsList.optionsList=xQuery("
      ").appendTo(xQuery(xQuery.ui.ncbiautocomplete._globalOptionsList.optionsBox));xQuery.ui.ncbiautocomplete._globalOptionsList.optionsActions= -xQuery("
      ").appendTo(xQuery(xQuery.ui.ncbiautocomplete._globalOptionsList.optionsBox));xQuery.ui.ncbiautocomplete._globalOptionsList.prefLink=xQuery("Preferences").appendTo(xQuery(xQuery.ui.ncbiautocomplete._globalOptionsList.optionsActions));xQuery.ui.ncbiautocomplete._globalOptionsList.turnOffLink=xQuery("Turn off").appendTo(xQuery(xQuery.ui.ncbiautocomplete._globalOptionsList.optionsActions)); -xQuery.ui.ncbiautocomplete._globalOptionsList.isIE6=xQuery.browser.msie&&parseInt(xQuery.browser.version,10)<7;if(xQuery.ui.ncbiautocomplete._globalOptionsList.isIE6)xQuery.ui.ncbiautocomplete._globalOptionsList.optionsBox.iframe=xQuery("").appendTo(document.body)}this._gol=xQuery.ui.ncbiautocomplete._globalOptionsList},_positionOptionsBox:function(){if(this._gol.activeElement){var a= -xQuery(this.element),b=xQuery(this._gol.activeElement);a=a.attr("id")||a[0];b=b.attr("id")||b[0];a!==b&&this._hideOptions()}var c=this;if(this._gol.activeElement!==this.element){b=this.options.prefUrl!==null?"block":"none";a=this.options.disableUrl!==null?"block":"none";var d=b==="block"||a==="block"?"block":"none";xQuery(this._gol.prefLink).css("display",b).attr("href",this.options.prefUrl).unbind("click").click(function(){c._prefLinkClick()});xQuery(this._gol.turnOffLink).css("display",a).unbind("click").click(function(j){c.turnOff(); -j.preventDefault()});xQuery(this._gol.optionsActions).css("display",d);xQuery(this._gol.optionsActions).children(":nth-child(2)").addClass("ui-ncbiautocomplete-link-pref-right")}else this._gol.activeElement=this.element;d=this.element;var f=xQuery(this._gol.optionsBox),g=false;if(d.parent().hasClass("jig-ncbiclearbutton-wrap")){d=d.parent();g=true;f.addClass("ui-ncbiautocomplete-holder-clearfix")}else f.removeClass("ui-ncbiautocomplete-holder-clearfix");b=d.outerWidth();a=d.outerHeight();d=d.offset(); -var i,e,h;if(xQuery.browser.msie)h=e=i=0;else{i=parseInt(f.css("borderLeftWidth"),10);e=parseInt(f.css("borderRightWidth"),10);h=g?0:-1}f.css("top",d.top+a+(g?-1:-2)+"px").css("left",d.left+"px").width(b-i-e+h+"px");g=parseInt(this.options.zIndex,10);f.css("zIndex",g);f=xQuery(this._gol.optionsList);f[0].onscroll=function(){};f.scrollTop(0);f[0].onscroll=function(){c.sgData.hasScrolled=true};if(this._gol.isIE6){f=xQuery(this._gol.optionsBox.iframe);f.css("top",d.top+a+"px").css("left",d.left+"px").width(b- -i-e+h+"px");f.css("zIndex",g-1)}},_isActive:false,_focused:function(){this._gol.activeElement!==this.element&&this._hideOptions();this._setActivedescendant();this._positionOptionsBox();if(this.options.isEnabled){this._isActive=true;this._hasBeenEscaped=false}this.options.minLength===0&&this.options.localData&&this._keyUp({})},_lastEnteredTerm:null,_isCached:false,_hasBeenEscaped:false,_lastKeyPressDwnUpScroll:new Date,_lastFoundMatch:null,_findMatchInCache:function(a){this._lastFoundMatch=null;if(typeof this._localCache[this.options.dictionary]=== -"undefined")return false;var b="l"+(this.options.maxListLimit||"n");if(typeof this._localCache[this.options.dictionary][b]==="undefined")return false;for(var c=0;a.length>1||c<10;){a=a.substr(0,a.length-1);var d=this._localCache[this.options.dictionary][b][a];if(d)if(d.isCompleteList){this._lastFoundMatch=a;return true}else break;c++}return false},_cloneMatchObject:function(a){var b={};b.matchedText=a.matchedText.toString();b.matches=a.matches?a.matches.slice():[];b.isCompleteList=a.isCompleteList=== -true;return b},_timerTriggerEnterEvent:null,_clearTriggerEnterEvent:function(){this._timerTriggerEnterEvent=null},_triggerEnterEvent:function(){var a=this;if(!this._timerTriggerEnterEvent){this._timerTriggerEnterEvent=window.setTimeout(function(){a._clearTriggerEnterEvent()},50);this.element.trigger("ncbiautocompleteenter",this.sgData);this.element.trigger("ncbiautocompletechange",this.sgData);this._sgSend()}},_triggerTabEvent:function(){this.element.trigger("ncbiautocompletetab",this.sgData);this.element.trigger("ncbiautocompletechange", -this.sgData);this._sgSend()},_keyPress:function(a,b){var c=false,d=this;if(a.keyCode===this._keys.enter||a.keyCode===this._keys.tab){var f=a.keyCode===this._keys.enter,g=false;if(this._isActive&&this.isOptionsBoxOpen())if(this._currIndex===this.options.maxListLimit&&xQuery("li:eq("+this._currIndex+")",this._gol.optionsList).hasClass("ui-ncbiautocomplete-show-more")){this._hideOptions(true);this._gotoShowAll()}else if(this.sgData.optionSelected===xQuery(this.element).val()){g=f;if(!this._timerTriggerEnterEvent){this.sgData.selectionAction= -f?"enter":"tab";this.element.attr("valueId",this.element.attr("_optValue")||null);if(f)this._triggerEnterEvent();else{this._sentTab||this._triggerTabEvent();this._sentTab=true;window.setTimeout(function(){d._sentTab=false},10)}}this._hideOptions(true);if(f){a.stopPropagation();a.preventDefault();return false}}else a.keyCode===this._keys.tab&&this._hideOptions(true);else if(a.keyCode===this._keys.tab)if(!this._tabCalled){this._hideOptions(true);this._tabCalled=true;window.setTimeout(function(){d._tabCalled= -false},10)}if(f&&!g){this._hideOptions(true);this._triggerEnterEvent()}}else if(xQuery(this.element).val().length===0&&!this.options.localData)this._hideOptions(true);else if(a.keyCode===this._keys.up){c=true;this._scrollUpDownRateLimiter(-1)}else if(a.keyCode===this._keys.down&&!a.shiftKey){if(xQuery(this.element).val().length>=this.options.minLength&&!this.isOptionsBoxOpen()){this._reopenOptions=true;c=false;return}this._reopenOptions=false;c=true;this._scrollUpDownRateLimiter(1)}if(!this._lastKeyAction|| -b===this._lastKeyAction){this._lastKeyAction=b;this._prevWasArrow=this._usedArrow;this._usedArrow=c}},_scrollUpDownRateLimiter:function(a){if(!(new Date-this._lastKeyPressDwnUpScroll<90)){this._moveSelection(a);this._lastKeyPressDwnUpScroll=new Date}},_checkArrowSelection:function(a){if(this._prevWasArrow&&a.keyCode!==this._keys.down&&a.keyCode!==this._keys.up&&a.keyCode!==this._keys.tab&&a.keyCode!==this._keys.enter&&this._isActive&&this.isOptionsBoxOpen()){this.sgData.selectionAction="arrows";typeof ncbi!== -"undefined"&&ncbi.sg&&ncbi.sg.ping&&ncbi.sg.ping(this.sgData,false);this._usedArrow=this._prevWasArrow=false}},_keyUp:function(a){if(!(!this.options.isEnabled||this._hasBeenEscaped)){this._checkArrowSelection(a);var b=xQuery(this.element).val().toLowerCase().replace(/^\s+/,"").replace(/\s+$/," "),c="l"+(this.options.maxListLimit||"n");if(!((a.keyCode===this._keys.up||a.keyCode===this._keys.down||a.keyCode===this._keys.enter)&&!this._reopenOptions))if(a.keyCode===this._keys.tab&&this._isOptionsBoxFocused){this._isActive= -this._isOptionsBoxFocused=false;a.type!=="keyup"&&this._hideOptions(true)}else if(a.keyCode===this._keys.escape){this._isActive=this._isOptionsBoxFocused=false;this._hasBeenEscaped=true;this._hideOptions(true)}else if(!(this._lastEnteredTerm===b||a.keyCode===this._keys.shift))if(this._localCache[this.options.dictionary]&&this._localCache[this.options.dictionary][c]&&this._localCache[this.options.dictionary][c][b]){this._isActive=true;this._resetValueId(b);this._lastEnteredTerm=b;this._displayOptions(this._localCache[this.options.dictionary][c][b])}else if(this._isCached&& -this._findMatchInCache(b)){this._isActive=true;this._localCache[this.options.dictionary][c][b]=this._cloneMatchObject(this._localCache[this.options.dictionary][c][this._lastFoundMatch]);this._resetValueId(b);this._lastEnteredTerm=b;this._filteredCache(b)}else if(b.length>=this.options.minLength&&this.options.localData){if(!this._localCache||!this._localCache[this.options.dictionary]||!this._localCache[this.options.dictionary][c]||!this._localCache[this.options.dictionary][c]["*_*_local_*_*"])this._putInCache({matchedText:"*_*_local_*_*", -matches:this.options.localData.slice(),isCompleteList:true},"*_*_local_*_*");this._isActive=true;this._localCache[this.options.dictionary][c][b]=this._cloneMatchObject(this._localCache[this.options.dictionary][c]["*_*_local_*_*"]);this._resetValueId(b);this._lastEnteredTerm=b;this._filteredCache(b)}else if(b.length>=this.options.minLength&&this.options.webserviceUrl){if(!this._isActive){this._isActive=true;this._focused()}if(this._lastEnteredTerm!==b){this._resetValueId(b);this._lastEnteredTerm=b; -this._fecthOptions(b)}}else{this._resetValueId(b);this._hideOptions()}}},_resetValueId:function(a){this._lastEnteredTerm&&this._lastEnteredTerm.toLowerCase()===a||this._lastTextInTextbox&&this._lastTextInTextbox.toLowerCase()===a||this.element.attr("valueId",null)},_changeFired:function(){this._lastEnteredTerm!==this.element.val()&&this._resetValueId()},_webSerivcePath:null,_setWebServicePath:function(){var a=this.options.webserviceUrl;if(a){var b="";if(this.options.isCrossDomain)this._webSerivcePath= -"http://www.ncbi.nlm.nih.gov/portal/utils/autocomp.fcgi";else{if(!this.options.isUrlRelative){b=window.location.protocol+"//"+window.location.host;if(a.charAt(0)!=="/")a="/"+a}this._webSerivcePath=b+a}}},_fecthOptions:function(a){this._activeRequest!==null&&this._activeRequest.abort();var b=this,c=this.options.responseFormat==="old"?"text":"json",d={dict:this.options.dictionary};d[this.options.queryParameter]=a;if(this.options.isCrossDomain){this._addGlobalListener("NSuggest_CreateData");xQuery.ajax({url:this._webSerivcePath, -dataType:"script",data:d,cache:true})}else this._activeRequest=xQuery.get(this._webSerivcePath,d,function(f,g){b._handleResponse(f,g)},c)},_validSeverCall:function(a){var b=false,c;if(this.options.isCrossDomain){typeof console!=="undefined"&&console.warn&&console.warn("Can not do this test with cross domain calls");return false}else if(this.options.dictionary.length>0){var d=this.options.responseFormat==="old"?"text":"json";c={dict:this.options.dictionary};c[this.options.queryParameter]=a;c=xQuery.ajax({url:this._webSerivcePath, -data:c,async:false,dataTypeString:d});if(c.status===200){c=c.responseText;b="NSuggest_CreateData_test"+(new Date).getTime();this._addGlobalListener(b,true);c=eval(c.replace("NSuggest_CreateData",b));window[b]=null;b=this._isValidCheck(a,c.matches)}}return b},_handleResponse:function(a,b){this._activeRequest=null;if(b==="success")if(this.options.responseProcessor)this._customFormat(a);else this.options.responseFormat==="old"?this._oldFormat(a):this._displayOptions(a);else this.turnOff()},_addGlobalListener:function(a, -b){var c=this;window[a]=function(d,f,g){d={matchedText:d,matches:f,isCompleteList:g===1};if(b)return d;else c._displayOptions(d)}},_oldFormat:function(a){if(a.indexOf("_dictionary_error")!==-1)this.turnOff(true);else if(xQuery.trim(a).indexOf("NSuggest_CreateData")!==-1){this._addGlobalListener("NSuggest_CreateData_new");eval(a.replace("NSuggest_CreateData","NSuggest_CreateData_new"))}else this._hideOptions()},_localCache:{},_putInCache:function(a,b){if(!this.options.disableCache){var c="l"+(this.options.maxListLimit|| -"n");this._localCache[this.options.dictionary]||(this._localCache[this.options.dictionary]={});this._localCache[this.options.dictionary][c]||(this._localCache[this.options.dictionary][c]={});this._localCache[this.options.dictionary][c][b||this._lastEnteredTerm]||(this._localCache[this.options.dictionary][c][b||this._lastEnteredTerm]=a)}},_setActivedescendant:function(){var a=this.element.attr("id");if(!a){a=xQuery.ui.jig._generateId("ncbiautocomplete");this.element.attr("id",a)}xQuery(this._gol.optionsBox).find("ul:eq(0)").attr("aria-activedescendant", -a)},_displayOptions:function(a){this._setActivedescendant();this._putInCache(a);var b=a.matchedText,c=a.matches||[];if(b!==this._lastEnteredTerm){a.isCompleteList=true;this._filteredCache(this._lastEnteredTerm,a)}else{this.sgData.userTyped=this._lastEnteredTerm;this.sgData.optionsCount=c;this._positionOptionsBox();var d=this;if(b==="_dictionary_error")this.turnOff(true);else{this._isCached=a.isCompleteList;b=a.previousFormat;if(!b){var f=this.options.maxListLimit;b=0;var g;if(f===null||c.length<= -f)g=c.length;else{g=f;b=c.length-g}f=(this._lastEnteredTerm||"").replace(/([\^\$\\\?\(\)\[\]\*\+\{\}\|\/\.\,])/g,"\\$1");var i=new RegExp("("+f+")","i");f=new Array(c.length);var e=this.options.hasRelatedMatches;for(g=g-1;g>=0;g--){var h=c[g],j="",k=h.indexOf("@");if(k!==-1){j='valueId="'+h.substr(k+1)+'"';h=h.substr(0,k);e=true}f[g]="
    • "+h.replace(i,"$1").replace(/\\"/g,'"')+"
    • "}b>0&&f.push(""); -b=f.join("");if(f.length===0||!e&&b.indexOf("")===-1){this._hideOptions();return}a.previousFormat=b}c=xQuery(this._gol.optionsBox);a=xQuery(this._gol.optionsList);a.scrollTop(0);a.html(b);if(c.css("display")!=="block"&&this._isActive){c.css("display","block");if(this._gol.isIE6){b=xQuery(this._gol.optionsBox.iframe).css("display","block");b.height(b.height()+xQuery(this._gol.optionsActions).height())}}else this._isActive||this._hideOptions();b=xQuery(".ui-ncbiautocomplete-options li");f=(b.eq(0).outerHeight()|| -20)*b.length;b.closest(".ui-ncbiautocomplete-holder").height(f).css("min-height",f+"px");b.closest(".ui-ncbiautocomplete-options").height(f).css("overflow-y","hidden");b=c.width();xQuery("li",a).hover(function(){d._addHightlightMouse(this)},function(){d._removeHighlight("mouse")}).click(function(){d._optionClicked(this);return false});xQuery(a).mouseleave(function(){d._removeHighlight("mouse");d._resetCurrentIndex()});this._resetCurrentIndex();c=xQuery("li",c);b=xQuery(this._gol.optionsBox).width(); -var l=xQuery.browser.msie&&!this._gol.isIE6||xQuery.browser.safari||xQuery.browser.opera;f=c.eq(0);parseFloat(f.css("padding-left"));e=f.html();f.html("MMMMMMMMM.");i=f.children("span:first").width()/10;f.html("");f.children("span:first").width();f.html(e);var n=a.width(),u=Math.floor(b/i);c.each(function(){var r=xQuery(this);r.css("white-space","nowrap");var m=r.html();r.attr("fullText",m).attr("acValue",m.replace(/<\/?span>/gi,""));if(r.width()/r.attr("acValue").length< -9)if(l)r.attr("partialText",r.html()).attr("isIEExpand",true).css("width",n-28+"px");else{var q=m.toLowerCase().indexOf(""),s=m.toLowerCase().indexOf(""),p=function(w){var y=false;if(w>=q&&w=s&&w":"")+"…";r.html(F);if(F===D){if(r.height()!==x&&typeof z!=="undefined")F=z;r.attr("partialText", -F).css("white-space","nowrap")}else if(r.height()===x){y=F.toString()+"";z=Math.floor((w.cutLoc+E)/2);o(z,w.cutLoc,E,F,y)}else{E=Math.floor((parseInt(w.cutLoc,10)+parseInt(y,10))/2);o(E,y,w.cutLoc,F,z)}};r.css("white-space","normal").css("width",n-22+"px");var v=r.height();r.html(".");var x=r.height();r.html(m);v>x&&o(u,0,m.length)}});a.scrollTop(0);this._removeHighlight("mouse");this._hideOptionsIfOffPage()}}},_filteredCache:function(a,b){var c=true,d="l"+(this.options.maxListLimit||"n");if(a=== -null)c=false;else{if(b){b=b;if(typeof this._localCache[this.options.dictionary]==="undefined")this._localCache[this.options.dictionary]={};else if(typeof this._localCache[this.options.dictionary][d]==="undefined")this._localCache[this.options.dictionary][d]={}}else b=this._localCache[this.options.dictionary][d][a];b.matchedText=a;var f=this.options.minLength===0&&a.length===0;if(!this.options.hasRelatedMatches){c=a.replace(/([\^\$\\\?\(\)\[\]\*\+\{\}\|\/\.\,])/g,"\\$1");c=new RegExp(c,"ig");for(var g= -b.matches.join("!!!~~~!!!").split("!!!~~~!!!"),i=g.length-1;i>=0;i--)!f&&g[i].match(c)===null&&g.splice(i,1);b.matches=g;this._localCache[this.options.dictionary][d][a]=b;c=g.length>0}}c?this._displayOptions(this._localCache[this.options.dictionary][d][a]):this._hideOptions()},_removeHighlight:function(a){if(!(a==="mouse"&&new Date-this._lastKeyPressDwnUpScroll<100)){var b=this;xQuery("li",this._gol.optionsList).removeClass("ui-ncbiautocomplete-options-high").each(function(){b._collapseOption(this)})}}, -_addHightlightMouse:function(a){if(new Date-this._lastKeyPressDwnUpScroll>100){this._resetCurrentIndex();this._currIndex=xQuery(a).prevAll("li").length;this._addHightlight(a)}},_addHightlight:function(a){this._removeHighlight();xQuery(a).addClass("ui-ncbiautocomplete-options-high");var b=this;this._expandTimer&&window.clearTimeout(this._expandTimer);this._expandTimer=window.setTimeout(function(){b._expandOption(a)},this.options.expandPauseTime)},_expandOption:function(a){if(xQuery(a).hasClass("ui-ncbiautocomplete-options-high")){a= -xQuery(a).attr("isExpanded",true);var b=a.attr("fullText");if(a.html()!==b||a.attr("isIEExpand")){a.html(b).css("text-overflow","").css("white-space","normal").css("-o-text-overflow","");this._scrollIntoView()}}},_collapseOption:function(a){a=xQuery(a);a.attr("isIEExpand")?a.css("text-overflow","ellipsis").css("white-space","nowrap").css("-o-text-overflow","ellipsis"):a.css("white-space","nowrap").html(a.attr("partialText"))},_optionClicked:function(a){a=xQuery(a);if(a.hasClass("ui-ncbiautocomplete-show-more"))this._gotoShowAll(); -else{var b=this._cleanUpSelectionText(a);a=a.attr("valueId")||null;this.sgData.optionSelected=b;this.sgData.optionIndex=this._currIndex;this.sgData.valueId=a;this.sgData.selectionAction="click";this._sgSend();b=xQuery(this.element).val(b);b.attr("valueid",a);b.trigger("ncbiautocompleteoptionclick",this.sgData);b.trigger("ncbiautocompletechange",this.sgData)}this._isOptionsBoxFocused=false;this._hideOptions()},isOptionsBoxOpen:function(){return xQuery(this._gol.optionsBox).css("display")==="block"}, -_hideOptions:function(a){this._gol.activeElement=null;if(!(this._isOptionsBoxFocused&&!a)){var b=xQuery(this._gol.optionsBox);a&&xQuery(this._gol.optionsBox).css("display","none");b.attr("aria-activedescendant")===this.element.attr("id")&&b.attr("aria-activedescendant","");this._gol.isIE6&&xQuery(this._gol.optionsBox.iframe).css("display","none");this._resetCurrentIndex();this._isActive=false;this._lastEnteredTerm=null;b=xQuery(this._gol.optionsBox);var c=xQuery(this._gol.optionsList);b.css("display", -"none");c.html("");this._lastTextInTextbox=b=this.element.val();if(this.options.requireValidation&&b.length>0&&this.options.isEnabled&&(!this.element.is(":focus")||a))this._trigger((b.length=b)this._currIndex=this._currIndex===-2?b-1:-1;if(this._currIndex!==-1){b=xQuery("li:eq("+ -this._currIndex+")",this._gol.optionsList);this._addHightlight(b);if(this._currIndex===this.options.maxListLimit){this.sgData.optionSelected="";this.sgData.valueId=""}else{a=this._cleanUpSelectionText(b);c=b.attr("valueId")||null;this.sgData.optionSelected=a;this.sgData.valueId=c}}else{this.sgData.optionSelected="";this.sgData.valueId=""}this.element.attr("_optValue",c);this.element.attr("valueId",c);this._setTextCursorToEnd(a);this._scrollIntoView();this.sgData.optionIndex=this._currIndex}}},_scrollIntoView:function(){var a= -xQuery("li:eq("+this._currIndex+")",this._gol.optionsList);if(a.length!==0){var b=xQuery(this._gol.optionsList),c=b.height(),d=b.scrollTop(),f=a[0].offsetTop;a=a.height();if(f-c+a>d){d=xQuery("li:eq("+(this._currIndex+1)+")",this._gol.optionsList);b.scrollTop((d.length===1?d[0].offsetTop:f+a+10)-c)}else f0){b=xQuery.ui.jig._getFncFromStr(a);typeof b==="function"?b():xQuery.get(a)}}}, -_prefLinkClick:function(){typeof ncbi!=="undefined"&&ncbi.sg&&ncbi.sg.ping&&ncbi.sg.ping(this.element[0],"autocompleteprefclick","dictionary="+this.options.dictionary)},_checkClickEvent:function(a){if(this._isActive)if(xQuery(this.element)[0]!=a.target){this._isActive=this._isOptionsBoxFocused=false;this._hideOptions()}},_sgSend:function(){typeof ncbi!=="undefined"&&typeof ncbi.sg!=="undefined"&&typeof ncbi.sg.ping!=="undefined"&&ncbi.sg.ping(this.sgData,false)},getSgData:function(){return this.sgData}, -_gotoShowAll:function(){var a=xQuery(this.element),b=a.val();a.trigger("ncbiautocompleteshowall",{value:b,dictionary:this.options.dictionary})},_hideOptionsIfOffPage:function(){if(this.options.maxListLimit){var a=this,b=xQuery(".ui-ncbiautocomplete-options li"),c=b.eq(0).outerHeight()||20,d=xQuery(this._gol.optionsBox),f=xQuery(window).height(),g=d.position().top,i=g+d.outerHeight()-(document.body.scrollTop||document.documentElement.scrollTop||window.pageYOffset||0);if(b.last().hasClass("ui-ncbiautocomplete-show-more")){var e= -g+"-"+f+"-"+i;if(!this.choppedDetails)this.choppedDetails={};var h=this.choppedDetails[e],j=0,k=function(){i=g+d.outerHeight()-(document.body.scrollTop||document.documentElement.scrollTop||window.pageYOffset||0);if(i>f){b=xQuery(".ui-ncbiautocomplete-options li");var n=b.length-2;if(n>=0){b.eq(n).remove();sz=c*(b.length-1);b.closest(".ui-ncbiautocomplete-holder").height(sz).css("min-height",sz+"px");b.closest(".ui-ncbiautocomplete-options").height(sz).css("overflow-y","hidden");j++;k()}}else a.choppedDetails[e].count= -j};if(h){var l=h.count;if(l>0){h=2*h.length-l-b.length-2;b.filter(":lt("+(b.length-1)+")").filter(":gt("+h+")").remove();b=xQuery(".ui-ncbiautocomplete-options li");sz=c*b.length;b.closest(".ui-ncbiautocomplete-holder").height(sz).css("min-height",sz+"px");b.closest(".ui-ncbiautocomplete-options").height(sz).css("overflow-y","hidden")}j=l}else this.choppedDetails[e]={count:0,length:b.length};k()}else{l=Math.floor((f-g)/c)*c;h=b.length*c;if(l>h)l=h;b.closest(".ui-ncbiautocomplete-holder").height(l).css("min-height", -l+"px");b.closest(".ui-ncbiautocomplete-options").height(l).css("overflow-y","auto")}}},isValid:function(){return this.isInDictionary(this.element.val())},isInDictionary:function(a){var b=false;if(a&&a.length>=this.options.minLength&&this.options.dictionary&&this.options.dictionary.length>0&&this.options.isEnabled){var c=false,d="l"+(this.options.maxListLimit||"n"),f=a.toLowerCase();if(this._localCache[this.options.dictionary]&&this._localCache[this.options.dictionary][d]){d=this._localCache[this.options.dictionary][d]; -c=true;if(d[f])b=this._isValidCheck(f,d[f].matches);else for(var g in d)if(b=this._isValidCheck(f,d[g].matches))break}if(!b&&!c)b=this._validSeverCall(a)}return b},_isValidCheck:function(a,b){var c=false;if(b){c=xQuery.inArray(a.toLowerCase(),b)>-1;if(!c){var d=new RegExp("(^|@)("+a.toLowerCase()+")(@|$)","i");xQuery.each(b,function(f,g){if(g.match(d)){c=true;return false}})}}return c},_customFormat:function(a){if(typeof this.options.responseProcessor==="string")this.options.responseProcessor=xQuery.ui.jig._getFncFromStr(this.options.responseProcessor); -this._displayOptions({matchedText:this._lastEnteredTerm,matches:this.options.responseProcessor.call(this,a),isCompleteList:0})}});xQuery.ui.ncbiautocomplete._globalOptionsList=null; -xQuery.widget("ui.ncbiaccordion",xQuery.ui.accordion,{orgCreate:xQuery.ui.accordion.prototype._create,_create:function(){this.options.header=":header";this.element.hasClass("jig-accordion")&&typeof console!=="undefined"&&console.warn&&console.warn("The classname widget identifier jig-accordion has been depreciated, please change it to jig-ncbiaccordion");this.orgCreate()}}); -(function(a){a.widget("ui.ncbidialog",a.ui.dialog,{options:{autoOpen:false,draggable:false,isTitleVisible:true,open:null,openEvent:"click",resizable:false,destSelector:null,stdOKCancel:false,stdOKText:"OK",stdCancelText:"Cancel"},_create:function(){if(this.element[0].tagName.toLowerCase()!=="div"){this.isTrigger=true;this._triggerNode=this.element}else this.isTrigger=false;if(this.isTrigger)this._ajaxable=this._ajaxable(this._triggerNode);var b=this.isTrigger?this.getDialogNode():this.element;this.element= -b;if(this.isTrigger){var c=this;this._triggerNode[this.options.openEvent](function(f){f.preventDefault();a(f.target);c._ajaxable&&c._getContent();c.element.dialog("open")})}if(!b.data("jigncbidialogcreated")){var d=this.element.attr("title");if(d)this.element.data("title",d);else d=this.element.data("title");if(b.length===0)a.ui.jig._isConsole("error")&&console.error('ncbidialog: No matching dialog node found with selector "'+this.options.destSelector+'".');else{this._parseCallbacks();this._overrideEvents(); -b.dialog(this.options);this.options.isTitleVisible||b.prev(".ui-dialog-titlebar").addClass("ui-helper-hidden-accessible").css("position","absolute");this._renderButtonMarkup();this._doStdOKCancel();if(d){c=this;this.element.bind("dialogopen",function(){c.element.dialog("option","title",d)})}b.data("jigncbidialogcreated",true)}}},getStdOKButton:function(){var b=null;if(this.options.stdOKCancel)b=this._dialogNode.find("div.ui-dialog-buttonpane button.ui-ncbibutton-submit");return b},_doStdOKCancel:function(){if(this.options.stdOKCancel){var b= -xQuery('
      '),c=xQuery('"),d=xQuery('");c.ncbibutton({color:"blue"});d.ncbibutton();var f=this;d.click(function(){f._triggerNode.ncbidialog("close");xQuery(this).trigger("ncbidialogcancelclick")});c.click(function(){xQuery(this).trigger("ncbidialogokclick")});b.append(c);b.append(d); -this.element.append(b)}},_overrideEvents:function(){for(var b=this,c=this.isTrigger?this._triggerNode:this.element,d=["dialogopen","dialogbeforeclose","dialogfocus","dialogdragstart","dialogdrag","dialogdragstop","dialogresizestart","dialogresize","dialogresizestop","dialogclose"],f=0;f');this._doButtonHover()}},_doButtonHover:function(){this._jigButtons.hover(function(){var b=a(this);b.hasClass("ui-state-hover")?b.removeClass("ui-state-hover"):b.addClass("ui-state-hover")})},_ajaxable:function(b){this._href=a.trim(b.attr("href"));b=this._href.replace(window.location.href,"");return b.search(/^#/)===-1&&b!==""?true:false},close:function(){return this.element.dialog.apply(this.element, -["close"])},open:function(){return this.element.dialog.apply(this.element,["open"])},isOpen:function(){return this.element.dialog.apply(this.element,["isOpen"])},widget:function(){return this.element.dialog.apply(this.element,["widget"])},moveToTop:function(){this.getDialogNode().dialog("moveToTop")},option:function(){for(var b=["option"],c=0;c0){xQuery("#"+this.allTab.attr("href").substr(1)).hide();xQuery(this.element.children("ul")[0]).find("a").each(function(){xQuery(this).data("ncbitab-origHref",xQuery(this).prop("href"))})}this.orgCreate();if(isAllTab){xQuery(this.element.find(".ui-tabs-nav > li")[this.options.selected]).find("a")[0]== -this.allTab[0]&&this._doAllTab();this.allTab.on({click:function(){a._doAllTab()},focus:function(){a._doAllTab()},keypress:function(){a._doAllTab()}})}this._addRolesAndInitTabIndex();a=this;xQuery(this.element.children("ul")[0]).find("a").not(a.allTab).bind("click.ncbitabs",function(){a.element.removeClass("ui-tabs-all-selected");a.element.find(".ui-tabs-panel").removeClass("ui-tabs-panel-internal")})},destroy:function(){xQuery(this.element.children("ul")[0]).find("a").removeData("ncbitab-origHref"); -xQuery(this.element).find(".ui-tabs-panel").removeClass("ui-tabs-panel-internal");xQuery(this.element).removeClass("ui-tabs-all-selected");xQuery(this.element.children("ul")[0]).find("a").unbind("click.ncbitabs");xQuery.ui.tabs.prototype.destroy.apply(this,arguments);this._removeRolesAndTabIndex()},_doAllTab:function(){var a=this;a.element.addClass("ui-tabs-all-selected");a.element.find(".ui-tabs-panel").each(function(){var b=xQuery(this);if(xQuery.trim(b.html())===""||!a.options.cache){var c=a.element.find(".ui-tabs-nav a[href=#"+ -b.attr("id")+"]").data("ncbitab-origHref");c.search(/#.+$/)==-1&&xQuery.get(c,function(d){b.html(d)})}b.not(":last-child").addClass("ui-tabs-panel-internal");b.removeClass("ui-tabs-hide")})},getAllTab:function(){ret=null;this.element.children("ul").find("a").each(function(){var a=xQuery(this);if(a.text().toLowerCase()==="all")ret=a});ret||(ret=this.element.find("a.ui-ncbitabs-all"));return ret},_tabify:function(a){this.orgTabify(a);var b=this;this.element.find("ul.ui-tabs-nav a").on("keydown click", -function(c){xQuery(c.target).focus();c=c.keyCode;var d=xQuery.ui.keyCode,f=function(i,e){i=xQuery(i);nDom=i[0];nDom.tabIndex=0;nDom.focus();e&&xQuery(e).each(function(){if(this!==nDom)this.tabIndex=-1})};if(c===d.RIGHT){var g=b.select(b.getNextTabIndex())[0];f(g,b.anchors)}if(c===d.LEFT){g=b.select(b.getPreviousTabIndex())[0];f(g,b.anchors)}})},_addRolesAndInitTabIndex:function(){var a=function(c,d){var f=c.attr("role");f&&c.data("ncbitab-origRole",f);c.attr("role",d)},b=this.element.children("ul").siblings("div").each(function(){a(xQuery(this), -"tabpanel")}).end();a(b,"tablist");b.children("li").each(function(){a(xQuery(this),"presentation")}).find("a").each(function(c){a(xQuery(this),"tab");this.tabIndex=c>0?-1:0})},_removeRolesAndTabIndex:function(){var a=function(c){var d=c.data("ncbitab-origRole");d?c.attr("role",d):c.removeAttr("role")},b=this.element.children("ul").siblings("div").each(function(){a(xQuery(this))}).end();a(b);b.children("li").each(function(){a(xQuery(this))}).find("a").each(function(){a(xQuery(this));xQuery(this).removeAttr("tabIndex")})}, -select:function(a){this.orgSelect.apply(this,[a]);return this.anchors.eq(a)},getCurrentTabIndex:function(){var a=null;this.element.find("ul.ui-tabs-nav").children("li").each(function(b){if(xQuery(this).hasClass("ui-tabs-selected")){a=b;return false}});return a},getNextTabIndex:function(){var a=this.anchors,b=this.getCurrentTabIndex();return b===a.length-1?0:b+1},getPreviousTabIndex:function(){var a=this.anchors,b=this.getCurrentTabIndex();return b===0?a.length-1:b-1}}); -xQuery.widget("ui.ncbigrid",{options:{isScrollable:false,height:"10em",hortScrollbarEnabled:false,width:null,isPageable:false,currentPage:1,isPageToolbarHideable:true,pageSize:10,isSortable:false,columnTypes:[],sortFunctions:[],isPresorted:false,sortColumn:-1,sortColumnDir:1,sortRowIndex:0,titleAscending:"sort ascending",titleDescending:"sort descending",ariaLabelAscending:"activate to sort column ascending",ariaLabelDescending:"activate to sort column descending",regExp:false,checkboxToolbarEnabled:false, -filterToolbarEnabled:false,filterToolbarIsCaseInsensitive:null,filterToolbarColumnIndex:null,filterToolbarIsInverse:null,isLoadingMessageShown:true,loadingText:"Loading",collapseRowsEnabled:false,addCommas:false},_init:function(){},_create:function(){this._isStartPageOne=this.options.currentPage===1;this._wrapTable();this._addBasicStyles();this._checkIfCSSIsScrollable();this._attachLoadingMessageListener();if(this.options.isScrollable||this.options.isSortable||this.options.isPageable||this.options.checkboxToolbarEnabled|| -this.options.filterToolbarEnabled)this._addAriaRolesAndStates();this._addRowClickWatcher();this.options.isScrollable&&this._createScrollable();if(this.options.isPageable||this.options.isPagable){this.options.isPageable=true;this._createPageGrid()}if(this.options.isSortable){this._createSortGrid();this.updateAriaTH()}else this._enableCollapseTbodyRows();this.options.checkboxToolbarEnabled&&this._createCheckboxSelectors();this.options.filterToolbarEnabled&&this._createFilterBarControl();this._addRowHoverEvent(); -this._addContentsAdjustmentEvent();this._adjustContents()},destroy:function(){xQuery.Widget.prototype.destroy.apply(this,arguments);this.options.isScrollable&&this._destroyScrollable();if(this.options.isPageable||this.options.isPagable)this._destroyPageGrid();this._destroyRowHoverEvent()},_addBasicStyles:function(){this.element.addClass("ui-ncbigrid").attr("cellpadding","0").attr("cellspacing","0")},_checkIfCSSIsScrollable:function(){if(this.element.hasClass("jig-ncbigrid-scroll"))this.options.isScrollable= -true},_wrapTable:function(){var a=this.element.parent().parent();if(!a.hasClass("ui-ncbigrid-outer-div")){this.element.wrap('
      ');a=this.element.parent().parent()}this.element.find("caption").length>0&&a.addClass("caption-exists");var b=this.options.width;b&&a.css("width",b)},_addRowHoverEvent:function(){xQuery(this.element).on("mouseenter","tbody > tr",function(){var a=xQuery(this);a.hasClass("ignoreHoverHighlight")|| -a.addClass("ui-ncbigrid-row-hover")}).on("mouseleave","tbody > tr",function(){xQuery(this).removeClass("ui-ncbigrid-row-hover")})},_destroyRowHoverEvent:function(){xQuery(this.element).off("mouseenter mouseleave","tr")},_addContentsAdjustmentEvent:function(){var a=this;this.element.on("ncbigridupdated",function(){a._adjustContents()})},_getNumCommaIndices:function(){var a=this.options.columnTypes;if(!a)return[];for(var b=[],c=0;c thead th")}},_addScrollClasses:function(){var a=this.element, -b=a.parent().addClass("ui-ncbigrid-scroll");this.parts.scrollWrapper=b;if(xQuery.browser.webkit){var c=navigator.userAgent;c.indexOf("AppleWebKit")>0&&c.indexOf("Chrome")==-1&&a.addClass("safari")}this.options.hortScrollbarEnabled&&b.addClass("ui-ncbigrid-hort-scroll")},_removeScrollClasses:function(){this.element.removeClass("ui-ncbigrid").removeClass("safari").parent().removeClass("ui-ncbigrid-scroll")},_copyCaptionHeader:function(){var a=this.element,b=a.parent();b.parent();var c=a.find("caption").clone(); -a=a.find("> thead").clone();c=xQuery("
      ").append("
      ").find("table").append(c).append(a).end();c.insertBefore(b);b=c.find("caption");b.wrapInner("
      ");this.parts.captionDiv=b.find("div");this.parts.headerWrapper=c;this.parts.headerThs=c.find("thead th")},_setWidthHeight:function(){this.options.height!==null&&this.parts.scrollWrapper.height(this.options.height)}, -_setWidths:function(){function a(j){xQuery(this).width(h[j])}var b=this.parts,c=b.table,d=b.ths,f=b.scrollWrapper,g=b.headerWrapper;b=b.headerThs;var i=xQuery.browser.msie;if(!this.options.hortScrollbarEnabled&&c.data("isMinSet")!==true&&this.element.is(":visible")){var e=c.outerWidth();if(c.width()>f.width()){f.css("min-width",e+16);c.data("isMinSet",true)}}var h=[];d.each(function(){var j=0;if(xQuery(this).is(":visible"))j=xQuery(this).width()+0;h.push(j)});d=c.height()>f.height()?16:0;i=this.options.isSortable&& -i&&parseInt(xQuery.browser.version,10)<8?d:0;c.parent().parent().find("table.ui-ncbigrid-header").width(c.width()+2-i);c=f.width()-d;g.width(c);this.parts.captionDiv&&this.parts.captionDiv.width(c);b.each(a)},_handleScroll:function(a,b,c){function d(){g._handleScroll(a,b,true)}var f=a.scrollLeft;b.scrollLeft=f;this.parts.captionDiv&&this.parts.captionDiv.css("margin-left",f+"px");var g=this;if(!c){window.setTimeout(d,1);window.setTimeout(d,5)}},_registerScrollableListeners:function(){var a=this;this._windowResize= -function(){a._setWidths()};xQuery(window).resize(this._windowResize);var b=this.element.parent().parent().find(".ui-ncbigrid-header-wrapper")[0];this.element.parent().scroll(function(){a._handleScroll(this,b)});this.element.bind("ncbigridupdated",function(){a._setWidths()});this.element.bind("resetScroll",function(){a._resetScrollToTop()})},_resetScrollToTop:function(){this.parts.scrollWrapper.scrollTop(0)},_createPageGrid:function(){this._createPageBars();this._addPagingEvents();this._gotoPage(this.options.currentPage)}, -_destroyPageGrid:function(){if(this._pageBars){this._removePagingEvents();this._removePageBars()}},_pagingControlsHTML:'
      Items 1 - 10 of 10
      ', -_createPageBars:function(){this._pageToolBar_top=xQuery(this._pagingControlsHTML).addClass("ui-ncbigrid-paged-toolbar-top");this._pageToolBar_bottom=xQuery(this._pagingControlsHTML).addClass("ui-ncbigrid-paged-toolbar-bottom");var a=this.element,b=a.parent().parent();b.prepend(this._pageToolBar_top);b.append(this._pageToolBar_bottom);b.children(".ui-ncbigrid-paged-toolbar-top").children(".ui-ncbigrid-paged-countItems").attr("id",xQuery.ui.jig._generateId("ui-ncbigrid-paged-countItems"));a.attr("aria-describedby", -this._pageToolBar_top.children(".ui-ncbigrid-paged-countItems").attr("id"));this._pageBars=this._pageToolBar_top.add(this._pageToolBar_bottom);this._pageBars.find(":input").each(function(c,d){xQuery(d).attr("id",xQuery.ui.jig._generateId("ui-ncbigrid-paged-current-page")).prev().attr("for",xQuery(d).attr("id"))})},_removePageBars:function(){this._pageToolBar_top.remove();this._pageToolBar_top=null;this._pageToolBar_bottom.remove();this._pageBars=this._pageToolBar_bottom=null;this.element.removeAttr("aria-describedby")}, -_addPagingEvents:function(){var a=this,b=this._pageBars.find("a.ui-ncbigrid-paged-pageControl-first"),c=this._pageBars.find("a.ui-ncbigrid-paged-pageControl-previous"),d=this._pageBars.find("a.ui-ncbigrid-paged-pageControl-next"),f=this._pageBars.find("a.ui-ncbigrid-paged-pageControl-last"),g=this._pageBars.find("input");b.click(function(i){a.gotoFirstPage();i.preventDefault()});c.click(function(i){a.gotoPrevPage();i.preventDefault()});d.click(function(i){a.gotoNextPage();i.preventDefault()});f.click(function(i){a.gotoLastPage(); -i.preventDefault()});g.keypress(function(i){if(i.keyCode===13){a.gotoPage(this.value.replace(/,/g,""));i.preventDefault()}})},_removePagingEvents:function(){this._pageBars.find("a").unbind("click").end().find("input").unbind("keypress")},_showHidePageToolbar:function(){if(this._pageBars)if(this.options.isPageToolbarHideable)parseInt(this.getRowCount())<=parseInt(this.options.pageSize)?this._pageBars.hide():this._pageBars.show()},_setPage:function(){this.element.trigger("resetScroll");this.element.trigger("pagechanged"); -var a=this._getCurrentPage(),b=this.getMaxPage();this._showHidePageToolbar();this._updateRows(a,b);this._updateButtons(a,b);this._updatePagingText(a,b);this._updateGoto(a,b);this._updateItemRange(a,b);this._pageBars.find(".ui-ncbigrid-paged-pageControl").attr({"aria-valuemin":"1","aria-controls":this.element.attr("id"),"aria-valuemax":b,"aria-valuenow":a});this._notifyGridUpdated()},_updateRows:function(a){var b=this.options.pageSize,c=this.getRowCount();a=(a-1)*b;var d=a+b;b=this.element.find("> tbody > tr:not(.ncbigrid-row-filtered)"); -var f=this.element.find("> tbody").length>1,g=0;if(f&&a>0)g=b.filter(":lt("+a+")").filter(":has(th)").length;var i="";if(d0)i+=":gt("+(a-1+g)+")";c=b;if(i.length>0){b.not(".ui-ncbigrid-rowHidden").addClass("ui-ncbigrid-rowHidden");c=b.filter(i)}c.removeClass("ui-ncbigrid-rowHidden");if(f){a=c.filter(":has(th)").length;if(a>0){b=0;for(c=c.last().next();bc)b=c;if(c==0)a=0;if(this.options.addCommas){c=this._getCommaSeparatedValue(""+c);a=this._getCommaSeparatedValue(""+a);b=this._getCommaSeparatedValue(""+b)}var d=this._pageBars.find("div.ui-ncbigrid-paged-countItems");d.find("span.ui-ncbigrid-paged-startRow").html(a); -d.find("span.ui-ncbigrid-paged-endRow").html(b);d.find("span.ui-ncbigrid-paged-totalRows").html(c)},_getCurrentPage:function(){return this.options.currentPage},getCurrentPage:function(){return this._getCurrentPage()},getMaxPage:function(){return Math.ceil(this.getRowCount()/this.options.pageSize)},getRowCount:function(){return xQuery(this.element).find("> tbody > tr:not(.ncbigrid-row-filtered):not(:has(> th))").length},getHeaderRowCount:function(){return xQuery(this.element).find("tbody > tr:has(th)").length}, -gotoFirstPage:function(){this._gotoPage(1)},gotoLastPage:function(){this._gotoPage(this.getMaxPage())},gotoNextPage:function(){this._gotoPage(this._getCurrentPage()+1)},gotoPrevPage:function(){this._gotoPage(this._getCurrentPage()-1)},gotoPage:function(a){this._gotoPage(parseInt(a,10))},_gotoPage:function(a){if(isNaN(a)||a<1)a=1;else if(a>this.getMaxPage()){a=this.getMaxPage();if(a<1)a=1}this.options.currentPage=a;this._pagingSelectAllQuestions&&this._pagingSelectAllQuestions.hide();this._setPage()}, -_createSortGrid:function(){var a=this.options.sortColumn;if(this.options.sortColumn!==-1){a=a-1;this.options.sortColumn=a!==-1?a:0}this._indexGrid();this._addSortEvents();this._setSortHeaders();this._checkInitialState();this._notifyGridUpdated()},_destroySortGrid:function(){},reindex:function(){for(var a=0;a tbody"); -if(b.length===0)this._isIndexed=false;else for(var c=0;c tr"),l=0,n=k.length;if(n===0)a._isIndexed=false;else{a._isIndexed= -true;g()}})(b[c],c)},_presort:function(a,b){function c(h){var j=g.options.sortFunctions[h-2];j||(j=g.element.find("> thead th:eq("+(h-2)+")").data("sortfunc"));if(j)if(typeof j==="function")return j;else if(j.indexOf("fnc:")===0){j=j.substr(4,j.length).split(".");for(var k=window[j[0]],l=1;l thead th:eq("+a+")").data("columntype"));return b||"str"},getColumnType:function(a){return this._getColumnType(a-1)},getRowValues:function(a){if(typeof a==="number")a=this.element.find("tbody tr:eq("+ -a+")");var b=[];a=a[0].getElementsByTagName("td");for(var c=a.length,d=0;d0?parseFloat(a):Number.POSITIVE_INFINITY;case "int":return a!==undefined&&a.length>0?parseInt(a,10):Number.POSITIVE_INFINITY;case "numberComma":case "numComma":a=(a||"").replace(/[, ]/g,"");return a.length>0?parseFloat(a):Number.POSITIVE_INFINITY;case "date":return new Date(a);case "str-insensitive":return a.toLowerCase();case "str":default:if(typeof c==="function")return c(a);else if(c.indexOf("fnc:")===0){c=c.substr(4,c.length).split(".");for(var d=window[c[0]],f=1;f thead tr:eq("+this.options.sortRowIndex+") th");this.element.bind("ncbigridcontentchanged",function(){b.reindex()});var d="";c.each(a);c=c;if(this.parts&&this.parts.headerThs){this.parts.headerThs.each(a);c=c.add(this.parts.headerThs)}c.find("a").click(function(f){b._sort(xQuery(this).data("index"));f.preventDefault()})},sort:function(a,b){this._sort(a-1,b)},_sort:function(a,b){if(this._isIndexed){this.options.isPageable&&this.element.trigger("resetCheckboxes");var c=b;if(b===undefined)c=this.options.sortColumn!==a?1:-1*this.options.sortColumnDir;this.options.sortColumn=a;this.options.sortColumnDir= -c;this.element.trigger("ncbigridshowloadingbar");this._setSortHeaders();this._waitForCache()}},_setSortHeaders:function(){var a=this.element.find("> thead tr:eq("+this.options.sortRowIndex+") th"),b=null;if(this.parts&&this.parts.headerThs)b=this.parts.headerThs;a.add(b).removeClass("sortAsc sortDsc").addClass("sortNone").find("a").attr("title",this.options.titleAscending);var c=this.options.sortColumn;if(this.options.sortColumn!==-1){var d=this.options.sortColumnDir===1?"sortAsc":"sortDsc",f=this.options.sortColumnDir=== -1?this.options.titleDescending:this.options.titleAscending;a.eq(c).addClass(d).removeClass("sortNone").find("a").attr("title",f);b&&b.eq(c).addClass(d).removeClass("sortNone").find("a").attr("title",f)}this.options.isSortable&&this.updateAriaTH()},_waitForCache:function(){for(var a=this,b=this.options.sortColumn,c=this.element.find("tbody"),d=0;d"),g=c.length;if(g>0)for(var i=0;i=0;i--){c=d[a[i]][1];f.append(c)}b.replaceWith(f);this.element.trigger("ncbigridhideloadingbar");if(this.options.isPageable)if(this._isStartPageOne)this.gotoFirstPage(); -else{this._gotoPage(this.options.currentPage);this._isStartPageOne=true}this.element.trigger("ncbigridcolumnsorted",[this.options.sortColumn+1,this.options.sortColumnDir])},_checkInitialState:function(){!this.options.isPresorted&&this.options.sortColumn!==-1&&this._sort(this.options.sortColumn,this.options.sortColumnDir)},_checkboxControlsHTML:'
      \t\t\t\t\t\t\t\t\t\t\t\tAll\t\t\t\t\t\tNone\t\t\t\t\t\t\t\t\t\t\t\t0
      ', -_pagingSelectAllQuestionHTML:'
      All 10 items on this page are selected. Select all rows in table Cancel
      ',_createCheckboxSelectors:function(){this._createCheckboxBar();this._addCheckboxEvents();this._updateCount()},_createCheckboxBar:function(){this._checkboxToolBar_top= -xQuery(this._checkboxControlsHTML).addClass("ui-ncbigrid-checkbox-toolbar-top");this._checkboxToolBar_bottom=xQuery(this._checkboxControlsHTML).addClass("ui-ncbigrid-checkbox-toolbar-bottom");var a=this.element.parent().parent();a.prepend(this._checkboxToolBar_top);if(this.options.isPageable){this._checkboxToolBar_bottom.insertBefore(this._pageToolBar_bottom);this._addSelectAllQuestionToolbar()}else a.append(this._checkboxToolBar_bottom);a.find(".ui-ncbigrid-checkbox-toolbar").attr("aria-controls", -this.element.attr("id"));this._chekboxBars=this._checkboxToolBar_top.add(this._checkboxToolBar_bottom)},_addCheckboxEvents:function(){var a=this;this._chekboxBars.find("a.ui-ncbigrid-select-all").click(function(b){a.checkAll();a._askSelectAllQuestion();b.preventDefault()});this._chekboxBars.find("a.ui-ncbigrid-select-none").click(function(b){a.uncheckAll();a._askSelectAllQuestion(true);b.preventDefault()});xQuery(this.element).on("click","tbody",function(b){a._rowClicked(b)});this.element.bind("resetCheckboxes", -function(){a.uncheckAll()});this._addSelectAllQuestionToolbarEvents()},_addSelectAllQuestionToolbar:function(){if(this.options.checkboxToolbarEnabled){this._pagingSelectAllQuestion_top=xQuery(this._pagingSelectAllQuestionHTML).addClass("ui-ncbigrid-select-question-header");this._pagingSelectAllQuestion_bottom=xQuery(this._pagingSelectAllQuestionHTML).addClass("ui-ncbigrid-select-question-footer");this._pagingSelectAllQuestion_top.insertAfter(this._pageToolBar_top);this._pagingSelectAllQuestion_bottom.insertAfter(this._pageToolBar_bottom); -this._pagingSelectAllQuestions=this._pagingSelectAllQuestion_top.add(this._pagingSelectAllQuestion_bottom);this._pagingSelectAllQuestions.find(".ui-ncbigrid-select-question-all").attr("aria-controls",this.element.attr("id"))}},_addSelectAllQuestionToolbarEvents:function(){if(this.options.checkboxToolbarEnabled){var a=this;this._pagingSelectAllQuestions.find("a.ui-ncbigrid-select-question-all").click(function(b){a[a._askAllSelectionMode](true);a._pagingSelectAllQuestions.hide();b.preventDefault()}); -this._pagingSelectAllQuestions.find("a.ui-ncbigrid-select-question-cancel").click(function(b){a._pagingSelectAllQuestions.hide();b.preventDefault()});this.element.bind("ncbigridpagechanged checkboxrowclicked",function(){a._pagingSelectAllQuestions&&a._pagingSelectAllQuestions.hide()})}},_askSelectAllQuestion:function(a){this._askAllSelectionMode=a?"uncheckAll":"checkAll";if(this.options.isPageable)if(parseInt(this.getRowCount())>=parseInt(this.options.pageSize)){this._pagingSelectAllQuestions.show(); -this._updateSelectPageCount(a)}else this._pagingSelectAllQuestions.hide()},_updateSelectPageCount:function(a){var b=this.element.find("> tbody > tr > td > input[type=checkbox]:visible").length;this._pagingSelectAllQuestions.find(".ui-ncbigrid-select-row-count").html(b);this._pagingSelectAllQuestions.find(".selectText1").html(a?"deselected":"selected");this._pagingSelectAllQuestions.find(".selectText2").html(a?"Deselect":"Select")},_updateCount:function(){var a=this.element.find("tbody input[type=checkbox]"); -a=a.length>0?a.filter(":checked").length:this.element.find("tbody tr.ui-ncbigrid-row-selected").length;this._chekboxBars.find("span.ui-ncbigrid-selected-text").html(a)},_checkHelper:function(a,b){if(b){b=xQuery(this.element).find("> tbody > tr:not(.ncbigrid-row-filtered) > td > input[type=checkbox]");this._trigger(a?"checkall":"uncheckall",null,[a]);this._checkAllState=a}else b=a&&this.options.isPageable?this.element.find("> tbody > tr > td > input[type=checkbox]:visible"):this.element.find("> tbody > tr > td > input[type=checkbox]"); -b.attr("checked",a);b=b.length===0?this.element.find("tbody tr").data("row-selected",a):b.closest("tr");a?b.addClass("ui-ncbigrid-row-selected"):b.removeClass("ui-ncbigrid-row-selected");this._updateCount()},checkAll:function(a){this._checkHelper(true,a);this._trigger("selectallclicked",null,[{acrossAllPages:a}])},uncheckAll:function(a){this._checkHelper(false,a);this._trigger("selectnoneclicked",null,[{acrossAllPages:a}])},_rowClicked:function(a){var b=xQuery(a.target||a.srcElement);a=null;if(b.is("input[type=checkbox]")){a= -b;var c=a.is(":checked")}else if(!b.is("a")){a=b.closest("tr").find("input[type=checkbox]");c=!a.is(":checked");a.attr("checked",c)}b=b.closest("tr");if(a&&a.length===0){c=!b.data("row-selected");b.data("row-selected",c)}c?b.addClass("ui-ncbigrid-row-selected"):b.removeClass("ui-ncbigrid-row-selected");this.element.trigger("checkboxrowclicked");this._updateCount()},_filterBarControlsHTML:'
      \t\t\t\t\t\t\t\t\t\t\t\t\t\t
      ', -_createFilterBarControl:function(){this._createFilterBar();this._addFilterEvents()},_createFilterBar:function(){this._filterToolBar=xQuery(this._filterBarControlsHTML);var a=this.element.parent().parent();a.prepend(this._filterToolBar).children(".ui-ncbigrid-filter-toolbar").attr("aria-controls",this.element.attr("id"));a.addClass("filterToolbar-exists");var b=xQuery.ui.jig._generateId("gridFilter");a.children(".ui-ncbigrid-filter-toolbar").children(":input").attr("id",b).prev().attr("for",b)},_addFilterEvents:function(){var a= -this;this._filterToolBar.find("input[type=text]").keyup(function(b){a._filterGrid(b,this)})},_filterGrid:function(a,b){if(!this._lastRunFilter)this._lastRunFilter="";a=b.value;b=this.options.filterToolbarIsCaseInsensitive||null;var c=this.options.filterToolbarColumnIndex||null,d=this.options.filterToolbarIsInverse||null;this._lastRunFilter.length>0&&a.indexOf(this._lastRunFilter)!==0&&this.removeFilterRows();this._lastRunFilter=a;if(this._lastRunFilter.length>0){var f=false;if(this.options.regExp)try{a= -RegExp(a.replace(/(^\/)|(\/$)/g,""))}catch(g){f=true}f||this.filterRows(a,b,c,d)}},_custFilterCnt:0,filterRows:function(a,b,c,d){function f(){r.options.isPageable&&r._gotoPage(0);r.element.trigger("ncbigridfilterapplied",[a,b,c,g,i]).trigger("ncbigridhideloadingbar");r._notifyGridUpdated()}if(!(typeof a=="undefined"||a.length===0)){this.element.trigger("ncbigridshowloadingbar");if(!xQuery.isArray(a)){orgTxt=a;a=[[a,b,c,d]]}d=i=xQuery("tbody tr:not(.ncbigrid-row-filtered)",this.element);for(var g, -i,e=0;e0)n="-regexp";else if(b)n="-insensitive";i=k!==null?i.find("td"+h+":"+l+"contains"+n+"("+j+")").parent():i.filter(":"+l+"contains"+n+"("+j+")"); -if(u)xQuery.ui.jig[u]=null}var r=this;if(d){g=d.not(i);var m=g.length,q=0;(function(){for(;q0){if(typeof d==="undefined")d= -true;var e="",h="";if(d||f){e=":not(";h=")"}var j=d="",k=null;if(typeof a==="function"){d="-functionTest";var l=this._custFilterCnt;this._custFilterCnt=l+1;k="filter_temp_"+l;j=xQuery.ui.jig[k]=a;a="xQuery.ui.jig."+k}else if(a.constructor&&a.constructor.toString().indexOf("RegExp")>0)d="-regexp";else if(b)d="-insensitive";f=f?"not-":"";if(typeof c!="undefined"&&c!==null){e="tbody tr[isfiltered='true'] td:nth-child("+c+")"+e+":"+f+"contains"+d+"("+a+")"+h;i=this.element.find(e).parent()}else{e="tbody tr[isfiltered='true']"+ -e+":contains"+d+"("+a+")"+h;i=this.element.find(e)}}else i=this.element.find("tr.ncbigrid-row-filtered");var n=this;if(i!==null){var u=i.length,r=0;(function(){for(;rtr>*:nth-child("+a+")").removeClass("ui-ncbigrid-column-hidden");this._setColumnHiddenData(a,false); -this.element.trigger("showColumn",[a]);this._notifyGridUpdated()},hideColumn:function(a){var b=this.element;if(this.options.isScrollable)b=b.add(this.parts.headerWrapper.find(">table"));b.children().find(">tr>*:nth-child("+a+")").addClass("ui-ncbigrid-column-hidden");this._setColumnHiddenData(a,true);this.element.trigger("hideColumn",[a]);this._notifyGridUpdated()},_setColumnHiddenData:function(a,b){var c=this.element.data("dataHiddenCols");c||(c=[]);c[a]=b;this.element.data("dataHiddenCols",c)}, -getHiddenShownColumns:function(){var a=[],b=[],c=this.element.data("dataHiddenCols");if(c)for(var d in c)c[d]?a.push(d):b.push(d);return{hidden:a,shown:b}},_attachLoadingMessageListener:function(){var a=this;this.element.bind("ncbigridshowloadingbar",function(){a._showLoadingMessage()}).bind("ncbigridhideloadingbar",function(){a._hideLoadingMessage()})},_showLoadingMessage:function(){if(this.options.isLoadingMessageShown){if(!this.isPopperAttached){this.element.parent().parent().ncbipopper({triggerPosition:"top center", -destPosition:"top center",hasArrow:false,closeEvent:"custom",openEvent:"custom",openAnimation:"none",closeAnimation:"none",destText:this.options.loadingText,isDestElementCloseClick:false,isDocumentElementCloseClick:false,isEscapeKeyClose:false,isTriggerElementCloseClick:false});this.isPopperAttached=true}this.element.parent().parent().ncbipopper("open")}},_hideLoadingMessage:function(){this.options.isLoadingMessageShown&&this.element.parent().parent().ncbipopper("close")},_addRowClickWatcher:function(){var a= -this;xQuery(this.element).on("click","tbody",function(b){b=xQuery(b.srcElement||b.target).closest("td");if(b.length===1){var c=b.closest("tr");a.element.trigger("ncbigridrowclick",[{row:c,cell:b,rowIndex:c[0].rowIndex,cellIndex:b[0].cellIndex}])}})},_notifyGridUpdated:function(){this.element.trigger("ncbigridupdated")},_notifyGridContentChanged:function(){this.element.trigger("ncbigridcontentchanged")},addHTMLRowData:function(a,b,c,d){var f=this.getRowCount(),g="";if(typeof b=="undefined")g=":last-child"; -else{if(b>f)b=f;else if(b<0){b=1;c="before"}g=":nth-child("+b+")"}b=d!==undefined?":eq("+d+")":"";if(f===0)xQuery("tbody"+b+g,this.element).append(a);else c&&c.toLowerCase()==="before"?xQuery("tbody"+b+" tr"+g,this.element).before(a):xQuery("tbody"+b+" tr"+g,this.element).after(a);this.options.isPageable?this._gotoPage(this.options.currentPage):this._notifyGridUpdated();this._notifyGridContentChanged()},_deleteRowHelper:function(a,b){b=b!==undefined?":eq("+b+")":"";a?this.element.find("tbody"+b+" tr"+ -a).remove():this.element.find("tbody"+b).empty()},deleteAllRows:function(){this._deleteRowHelper();this.options.isPageable&&this._gotoPage(0);this._notifyGridUpdated();this._notifyGridContentChanged()},deleteRow:function(a,b){if(typeof a!="undefined"){a=xQuery.isArray(a)?a.sort():[a];for(var c=a.length-1;c>=0;c--)this._deleteRowHelper(":nth-child("+a[c]+")",b);this.options.isPageable&&this._gotoPage(this.options.currentPage);this._notifyGridUpdated();this._notifyGridContentChanged()}},getCellData:function(a, -b,c){if(!(typeof a=="undefined"||typeof b=="undefined")){a=xQuery("tbody"+(c!==undefined?":eq("+c+")":"")+" tr:nth-child("+a+") td:nth-child("+b+")",this.element);if(a.length==0)return null;return this._getCellValue(a,b)}},getColumnCount:function(a){a=a===false?":visible":"";a=xQuery(this.element).find("tbody tr:not(.ui-ncbigrid-rowHidden):eq(0) td"+a).length;if(a===0)a=xQuery(this.element).find("> thead tr:last th").length;return a},getColumnData:function(a,b){if(typeof a==="undefined")return null; -else if(xQuery.isArray(a)){for(var c=[],d=0;dthis.getColumnCount())c.push(null);c.push(this._getColumnDataHelper(a[d]),b)}return c}else{if(a<=0||a>this.getColumnCount())return null;return this._getColumnDataHelper(a,b)}},_getColumnDataHelper:function(a,b){var c=[],d=this,f=this._getColumnType(a-1);if(f==="str"||!f)f="str-sensitive";xQuery("tbody"+(b!==undefined?":eq("+b+")":"")+" tr td:nth-child("+a+")",this.element).each(function(g,i){c.push(d._csColumnTypeConversion(i, -f,true))});if(c.length!==0)return c},getRowData:function(a,b){if(typeof a!=="undefined")if(xQuery.isArray(a)){for(var c=[],d=0;d0){i="-regexp";d=""}typeof c!="undefined"?xQuery("tbody tr td"+(":nth-child("+c+")")+":"+d+"contains"+i+"("+a+")",this.element).each(function(e,h){e=xQuery(h).parent();h="ui-ncbigrid-high";if(f)h=e.hasClass("ui-ncbigrid-row-even")?"ui-ncbigrid-row-even-high-IE6":"ui-ncbigrid-row-odd-high-IE6"; -e.addClass(h);xQuery.inArray(e,g)===-1&&g.push(e)}):xQuery("tbody tr:"+d+"contains"+i+"("+a+")",this.element).each(function(e,h){e=xQuery(h);h="ui-ncbigrid-high";if(f)h=e.hasClass("ui-ncbigrid-row-even")?"ui-ncbigrid-row-even-high-IE6":"ui-ncbigrid-row-odd-high-IE6";e.addClass(h);g.push(e)});this.element.trigger("ncbigridhighlightapplied",[a,b,c,g]).trigger("ncbigridhideloadingbar");return{highlightedRows:g}}},removeHighlightRows:function(a,b,c,d){var f=xQuery.browser.msie&&parseFloat(xQuery.browser.version)< -7;if(typeof a!="undefined"&&a.length>0){var g=[],i=b?"-insensitive":"";d=d?"not-":"";if(a.constructor&&a.constructor.toString().indexOf("RegExp")>0){i="-regexp";d=""}typeof c!="undefined"?xQuery("tbody tr td"+(":nth-child("+c+")")+":"+d+"contains"+i+"("+a+")",this.element).each(function(e,h){e=xQuery(h).parent().removeClass("ui-ncbigrid-high");f&&e.removeClass("ui-ncbigrid-row-odd-high-IE6").removeClass("ui-ncbigrid-row-even-high-IE6");xQuery.inArray(e,g)===-1&&g.push(e)}):xQuery("tbody tr:"+d+"contains"+ -i+"("+a+")",this.element).each(function(e,h){e=xQuery(h).removeClass("ui-ncbigrid-high");f&&e.removeClass("ui-ncbigrid-row-odd-high-IE6").removeClass("ui-ncbigrid-row-even-high-IE6");g.push(e)})}else{xQuery(".ui-ncbigrid-high",this.element).removeClass("ui-ncbigrid-high");f&&xQuery(".ui-ncbigrid-row-odd-high-IE6, .ui-ncbigrid-row-even-high-IE6",this.element).removeClass("ui-ncbigrid-row-odd-high-IE6").removeClass("ui-ncbigrid-row-even-high-IE6")}this.element.trigger("ncbigridhighlightremoved",[a, -b,c])},setCellData:function(a,b,c,d){xQuery("tbody"+(d!==undefined?":eq("+d+")":"")+" tr:nth-child("+a+") td:nth-child("+b+")",this.element).text(c);this.element.trigger("ncbigridcellchange",[a,b,this.getCellData(a,b)]);this._notifyGridUpdated();this._notifyGridContentChanged()},setRowData:function(a,b,c){xQuery("tbody"+(c!==undefined?":eq("+c+")":"")+" tr:nth-child("+a+") td",this.element).each(function(d,f){xQuery(f).text(b[d])});this.element.trigger("ncbigridrowchange",[a,this.getRowData(a,c)]); -this._notifyGridUpdated();this._notifyGridContentChanged()},_enableCollapseTbodyRows:function(a){if(this.options.collapseRowsEnabled){a||(a=xQuery(this.element).find("tbody tr:has(th)"));var b=this;xQuery(a).each(function(){xQuery(this).addClass("ui-ncbigrid-collapsable").find("th").eq(0).prepend('').find("span").click(function(c){c.stopPropagation();b._collapseTbodyRows(this.parentNode.parentNode)}).end().end().not(".ignoreCollapse").click(function(){b._collapseTbodyRows(this.parentNode)})})}}, -_collapseTbodyRows:function(a){xQuery(a).find("th span.collapsableTbodyIcon").toggleClass("ui-icon-plus-minus-big").toggleClass("ui-icon-plus-minus-big-open").end().siblings().toggleClass("collapsed")}});xQuery.extend(xQuery.expr[":"],{"contains-insensitive":function(a,b,c){return(a.textContent||a.innerText||"").toLowerCase().indexOf((c[3]||"").toLowerCase())>=0}}); -xQuery.extend(xQuery.expr[":"],{"contains-regexp":function(a,b,c){a=xQuery.trim(a.textContent||a.innerText||"");c=c[3];b=c.match(/\/([gi]+)$/);b=b!==null?b[1]:"";c=c.replace(/\/[gi]?$/,"").replace(/^\//,"");return a.match(new RegExp(c,b))!==null}});xQuery.extend(xQuery.expr[":"],{"contains-functionTest":function(a,b,c){a=a.textContent||a.innerText||"";return xQuery.ui.jig._getFncFromStr(c[3])(a)}}); -xQuery.extend(xQuery.expr[":"],{"not-contains":function(a,b,c){return(a.textContent||a.innerText||"").indexOf(c[3]||"")===-1}});xQuery.extend(xQuery.expr[":"],{"not-contains-insensitive":function(a,b,c){return(a.textContent||a.innerText||"").toLowerCase().indexOf((c[3]||"").toLowerCase())===-1}}); -(function(){var a=xQuery.ui.ncbigrid.prototype.options;a.webservice=null;a.webserviceParams=null;a.isServersideLoad=false;a.isServersidePaging=false;a.isServersidePagingCached=false;a.isServersideSort=false;a.maxRowCount=null;a.columnNames=null;a.webserviceReturnsJSON=false;a.columns=null;a.record=null;a.groupField=null;a.localJSON=null;var b=xQuery.ui.ncbigrid.prototype._create,c=xQuery.ui.ncbigrid.prototype.sortDefaults,d=xQuery.ui.ncbigrid.prototype._killActiveSort,f=xQuery.ui.ncbigrid.prototype._sort, -g=xQuery.ui.ncbigrid.prototype._indexGrid,i=xQuery.ui.ncbigrid.prototype._waitForCache,e=xQuery.ui.ncbigrid.prototype.filterRows,h=xQuery.ui.ncbigrid.prototype.removeFilterRows,j=xQuery.ui.ncbigrid.prototype._updateRows,k=xQuery.ui.ncbigrid.prototype.getMaxPage,l=xQuery.ui.ncbigrid.prototype._updateCount,n=xQuery.ui.ncbigrid.prototype._gotoPage,u=xQuery.ui.ncbigrid.prototype.checkAll,r=xQuery.ui.ncbigrid.prototype.uncheckAll;xQuery.widget("ui.ncbiservergrid",xQuery.ui.ncbigrid,{_loadCreateCallback:false, -_create:function(){this._checkForTemplating();if(this.options.maxRowCount)this.options.maxRowCount=parseInt(this.options.maxRowCount);if(this.options.isServersidePaging){this.options.isPageable=true;if(this.options.isServersideLoad&&!this.options.maxRowCount&&this.options.currentPage>1)this.options.maxRowCount=this.options.currentPage*this.options.pageSize}if(this.options.isServersideSort)this._isIndexed=this.options.isSortable=true;if(this.options.localJSON!==null){this._loadCreateCallback=true; -this._processData(this.options.localJSON,"success",{})}else if(this.options.isServersideLoad&&!this.options.isServersidePaging){this._loadCreateCallback=true;this._fetchData()}else b.apply(this,arguments)},_checkForTemplating:function(){if(this.options.columns){this.options.isServersideLoad=true;this._createHeaders()}},_createHeaders:function(){var m=xQuery(""),q=xQuery(""),s=this.options.columns;this._numColHead=s.length;for(var p=0;p").html(o.header).data("columntype",v).appendTo(q)}m.append(q);this.element.append(m)},_processTemplating:function(m,q){function s(){for(var O=0;O"],C="__DEFAULT__",G=0;G"+B+"");if(z!==null&&z===N)C=B}M.push("");if(!D[C]){D[C]=[];I++;F.push(C)}D[C].push(M.join(""));Q++}K= -F.sort();if(Q>=P)if(I==1){M="";for(var U in D)M=D[U].join("");p._wrapUpProcessing("success",M)}else{for(O=0;O"+U+"";M+=D[U].join("")+"";p.element.append(M)}p._wrapUpProcessing("multipleTBodies",null)}else window.setTimeout(function(){s()},0)}var p=this,o=this.options.record,v=this.options.columns,x=this._numColHead,w=q==="xml",y=q==="json";if(w)var E=m.getElementsByTagName(o);else if(y){q=o.split(/\./); -E=m;for(m=0;m").appendTo(this.element);q.html(m);q= -this.getHiddenShownColumns();m=q.hidden;q=q.shown;for(var s=0;s0&&q.push(x)}q=q.join("&")}return q},_setPageInit:function(){this.element.trigger("resetScroll");var m=this._getCurrentPage(),q=this.getMaxPage();this._showHidePageToolbar();this._updateButtons(m,q);this._updatePagingText(m,q);this._updateGoto(m,q);this._updateItemRange(m,q); -this._pageBars.find(".ui-ncbigrid-paged-pageControl").attr({"aria-valuemin":"1","aria-controls":this.element.attr("id"),"aria-valuemax":q,"aria-valuenow":m})}})})(); -(function(a){a.widget("ui.ncbielastictextarea",{styles:{copy:["paddingTop","paddingRight","paddingBottom","paddingLeft","fontSize","lineHeight","fontFamily","width","fontWeight"]},_create:function(){function b(h,j){curratedHeight=Math.floor(parseInt(h,10))+3;d.height()!=curratedHeight&&d.css({height:curratedHeight+"px",overflow:j})}function c(h){var j=d.val().replace(/&/g,"&").replace(/ /g," ").replace(/<|>/g,">").replace(/\n/g,"
      "),k=f.html();if(j+" "!=k||h=="force"){f.html(j+ -" ");if(Math.abs(f.height()+g-d.height())>3){h=f.height()+g;if(h>=e)b(e,"auto");else h<=i?b(i,"hidden"):b(h,"hidden")}}}var d=this.element;if(d.attr("type")!="textarea"&&d.get(0).nodeName.toLowerCase()!="textarea")return false;this.elastic_uid=a.ui.jig._generateId("ncbielastictextarea");d.css("word-wrap","break-word");var f=a("
      ").css({position:"absolute",display:"none","word-wrap":"break-word"}).attr("id",this.elastic_uid),g=parseInt(d.css("line-height"),10)||parseInt(d.css("font-size"), -"10"),i=parseInt(d.css("height"),10)||g*3,e=parseInt(d.css("max-height"),10)||Number.MAX_VALUE;if(e<0)e=Number.MAX_VALUE;f.appendTo(d.parent());a(this.styles.copy).each(function(){f.css(this.toString(),d.css(this.toString()))});a(window).bind("resize."+this.elastic_uid,function(){f.css("width",d.width()+"px");c("force")});d.css({overflow:"hidden"});f.css("width",d.width()+"px");d.bind("keyup."+this.elastic_uid,function(){c()});d.bind("input."+this.elastic_uid+" paste."+this.elastic_uid,function(){setTimeout(c, -250)});c()},destroy:function(){this.element.unbind("."+this.elastic_uid);a("#"+this.elastic_uid).remove();this.element.css({"word-wrap":"",overflow:"",height:""});a(window).unbind("resize."+this.elastic_uid);a.Widget.prototype.destroy.apply(this,arguments)}});a.ui.ncbielastictextarea.prototype.options={};a.ui.ncbielastictextarea.prototype.version="1.2"})(xQuery); -(function(a){a.widget("ui.ncbilinkedselects",{_selectEls:[],_localMap:null,options:{firstPopulatedFromDs:true,localData:null,localDataCallback:null,initialSelected:null,selects:null,webservice:null,loadingSpinner:true,loadingText:"Loading...",loadingImage:xQuery.ui.jig._baseURL+"/img/loading.gif"},_create:function(){if(this.options.localData)this._localMap=eval(this.options.localData);else this._initResponseCache();this._selectEls=this.getSelects();this._prepareSelects();this._setEvents();this.options.firstPopulatedFromDs&& -this._populateFirstSelect();this.options.initialSelected&&this._selectInitialOptions()},_selectInitialOptions:function(){var b=this.options.initialSelected.split(","),c=this,d=function(){for(var f=a(this),g,i=0;i'+f+"");else for(var g in f)this._appendToSelect(this.element,'")}else this._getAndAppendFromWebService(this.element,{})},_getFirstOptionsFromLocalDs:function(){var b=[];if(this.options.localDataCallback)b= -this.options.localDataCallback.apply(this,[this._localMap]);else for(var c=0;c').insertAfter(c).css({left:d.left, -top:d.top,width:f,height:g});c.append('
      ');xQuery('
      '+this.options.loadingText+"
      ").css("line-height",g+"px").appendTo(c);b.attr("size")>1&&c.css("text-align","center");return c},_removeLoadingIndicator:function(b){b.remove()},queryLocalService:function(b){function c(f){for(var g in f){var i=f[g];for(var e in i)if(i[e]==b[0]){if(b.length==1){f=f[parseInt(g)+ -1];for(g=0;g"+i+"")}else{var h,j;for(var k in i){h=k;j=i[k]}e=b?' id="'+this._getOptionId(b,j)+'"':"";this._appendToSelect(d,'")}}},_isArrayOfStrings:function(b){return typeof b[0]==="string"},_isLastSelect:function(b){els=this._selectEls;return b===els[els.length-1].name?true:false},_isFirstSelect:function(b){els=this._selectEls;return b===els[0].name?true:false},_getNextSelect:function(b){for(var c= -0;ca");if(this.options.allowMultipleSelections)for(var b=0;ba").attr("tabindex","-1"),b=this.element.find(this._liSelector+".selected>a");if(b.length>0)b=b.eq(0);else{var c=0;for(b=a.eq(0);b.is("."+this.styles.itemSkip+" a")&&ca").removeAttr("tabindex")},_addEvents:function(){this._setUpKeyListener(); -this._setUpClickEvents();this._setUpFocusEvents();this._setUpHoverEvents()},_destroyEvents:function(){this._destroyKeyListener();this._destroyClickEvents();this._destroyFocusEvents();this._destroyHoverEvents()},_setUpKeyListener:function(){if(!this._menuKeyListener){var a=this;this._menuKeyListener=function(b){if(a.element.is(":visible"))if(a._keyPressDetected(b.keyCode)){b.preventDefault();a.options.stopPropagationCheck&&b.stopPropagation()}};xQuery(document).keydown(this._menuKeyListener)}},_destroyKeyListener:function(){if(this._menuKeyListener){xQuery(window).unbind("keydown", -this._menuKeyListener);this._menuKeyListener=null}},_setUpClickEvents:function(){var a=this;this._ulClickEvent=function(b){var c=b.srcElement||b.target;if(c){a.options.disableSelect||a._makeSelection(xQuery(c),"click");a.options.stopPropagationCheck&&b.stopPropagation();a.options.preventDefaultCheck&&xQuery(c).siblings("ul").length===1&&b.preventDefault()}};this.element.on("click.ncbibasicmenu",this._ulClickEvent)},_destroyClickEvents:function(){this.element.off("click",this._ulClickEvent)},_setUpFocusEvents:function(){var a= -this;this._focusFnc=function(){a._menuFocused(this)};this._blurFnc=function(){a._menuBlured(this)};this.element.find(this._liSelector+">a").on("blur",this._blurFnc).on("focus",this._focusFnc)},_destroyFocusEvents:function(){this.element.find(this._liSelector+">a").off("blur",this._blurFnc).off("focus",this._focusFnc)},focus:function(){this._menuFocused(null)},_menuFocused:function(a){this._lastAnchor=a;this._isFocused=true},_menuBlured:function(a){if(this._lastAnchor==a)this._isFocused=false},removeFocus:function(){this._menuBlured()}, -_setUpHoverEvents:function(){var a=this;this._mouseEnterFnc=function(b){b=xQuery(b.target).closest("li");!b.hasClass(a.styles.itemNoHilite)&&!b.hasClass(a.styles.itemSkip)&&b.addClass("hover")};this.mouseLeaveFnc=function(){xQuery(this).removeClass("hover")};this.element.on("mouseenter","li",this._mouseEnterFnc).on("mouseleave","li",this.mouseLeaveFnc)},_destroyHoverEvents:function(){this.element.off("mouseenter",this._mouseEnterFnc).off("mouseleave",this.mouseLeaveFnc);this.mouseLeaveFnc=this._mouseEnterFnc= -null},_makeSelection:function(a,b){var c=a.parent("li");if(c.length===1){var d=c.hasClass("selected");this.options.allowMultipleSelections||this._removeAllSelections();if(!c.hasClass(this.styles.itemSkip)){c.hasClass(this.styles.itemNoHilite)||c[d?"removeClass":"addClass"]("selected");var f=d?"unselected":"selected";b!=="menunav"&&this._trigger(f,"x",[a,c,b]);if(b==="click"||b==="load")this.selectedOption=this.element.find(this._liSelector+".selected").index();else d||c.find(">a").focus()}}this._setTabIndex()}, -_keys:{up:38,down:40,left:37,right:39,enter:13,escape:27,tab:9},_keyPressDetected:function(a){var b=this._keys,c=false;if(this._isFocused&&this.element.has(this._liSelector+">a:focus"))switch(a){case b.up:this._upDownPressed(-1);c=true;break;case b.down:this._upDownPressed(1);c=true;break;case b.left:this._leftRightPressed(-1);c=true;break;case b.right:this._leftRightPressed(1);c=true;break;case b.enter:this._enterSelected();c=false;break;case b.escape:this._escapeTyped();c=false;break;case b.tab:this._trigger("tab"); -default:c=false}return c},_upDownPressed:function(a){this.isVert?this._moveSelection(a):this._trigger(a===1?"actiondown":"actionup","x",this.focusedElement())},_leftRightPressed:function(a){this.isVert?this._trigger(a===1?"actionright":"actionleft","x",this.focusedElement()):this._moveSelection(a)},focusedElement:function(){return this.selectedOption!==-1?this.element.find(this._liSelector).eq(this.selectedOption):this.element.find(this._liSelector+":has(>a:focus)")},moveSelection:function(a){this._moveSelection(a)}, -_getNextIndex:function(a,b,c){a=a+b;if(a<0)a=c-1;else if(a>c-1)a=0;return a},_moveSelection:function(a){for(var b=this.element.find(this._liSelector+">a"),c=this._getNextIndex(this.selectedOption,a,b.length);b.eq(c).closest("li").hasClass(this.styles.itemSkip);)c=this._getNextIndex(c,a,b.length);this.selectedOption=c;this._makeSelection(b.eq(c),"keyboard")},removeAllSelections:function(){this.selectedOption=-1;this._removeAllSelections();this._setTabIndex()},_removeAllSelections:function(){this.element.find(this._liSelector).removeClass("selected")}, -_enterSelected:function(){this._trigger("enter")},_escapeTyped:function(){this._trigger("escape","x",this.focusedElement())},_addAria:function(){var a=this.element.parents('[role="menubar"]'),b=this.element.find(this._liSelector),c=b.find(">a");this.element.attr("role",a.length===0?"menubar":"menu");b.attr("role","presentation");c.attr("role","menuitem")},_destroyAria:function(){var a=this.element.find(this._liSelector),b=a.find(">a");this.element.removeAttr("role");a.removeAttr("role");b.removeAttr("role")}, -selectFirstItem:function(){this.selectedOption=0;this._moveSelection(0)}}); -xQuery.widget("ui.ncbimenu",{options:{isSubMenuLimited:false,delayTimeout:500,useHoverEvents:true},_create:function(){this._addClasses();this._addAria();this._createMenus();this._addListeners();this._addEvents();this._addAjaxEvents()},rescan:function(){this._destroyListeners();this._destroyEvents();this._addAria();this._createMenus();this._addListeners();this._addEvents()},destroy:function(){this._destroyEvents();this._destroyClasses();this._destroyAria();this._destroyListeners();this._destroyMenus()}, -_addClasses:function(){this.element.addClass("ui-ncbimenu")},_destroyClasses:function(){this.element.removeClass("ui-ncbimenu")},_addAria:function(){this.element.attr("role","menubar").find("li").filter(":has(ul)").find("a").attr("aria-haspopup","true").end().find("ul").attr("aria-hidden","true")},_destroyAria:function(){this.element.removeAttr("role").find("li").removeAttr("role").filter(":has(ul)").find("a").removeAttr("aria-haspopup").removeAttr("role").end().find("ul").removeAttr("aria-hidden").removeAttr("role")}, -_createMenus:function(){this.element.ncbibasicmenu({orientation:"horizontal"});var a=this.element.find(">li:has(>ul)");a.find(">a").addClass("expandDown");a.find(">ul").ncbibasicmenu({nested:true});if(!this.options.isSubMenuLimited){a.find(">ul ul").ncbibasicmenu({nested:true});a.find(">ul ul").parent().find(">a").addClass("expandRight")}},_destroyMenus:function(){this.element.removeClass("jig-ncbimenu cf ui-ncbibasicmenu orientation_hort").find("ul").andSelf().show().ncbibasicmenu("destroy")},_addEvents:function(){var a= -this;this._windowClickFnc=function(c){c=c.target||c.srcElement;a.element[0]===c||a.element.find(c).length===1||a.closeSub(a.element.find("ul"))};xQuery(window).on("click",this._windowClickFnc);this._unselectEverythingFnc=function(){a._unselectEverything()};this.element.find("li").not(":has(ul)").find("a").on("click",this._unselectEverythingFnc);this._blurFnc=function(){a._checkFocus()};this.element.on("blur","a",this._blurFnc);if(this.options.useHoverEvents){var b={timeout:this.options.delayTimeout, -over:function(){if(a._isActive){var c=xQuery(this),d=c.parent();if(d.has("ul").length===0){d=d.siblings("li.selected").removeClass("selected");a.closeSub(d);c.focus()}else d.hasClass("selected")||c.focus().click()}},out:function(){}};this.element.find(">li:not(:has(ul))>a,li:has(ul)>a").hoverIntent(b)}},_destroyEvents:function(){xQuery(window).off("click",this._windowClickFnc);this._windowClickFnc=null;this.element.off("blur","a",this._blurFnc);this._blurFnc=null;this.element.find(">li:not(:has(ul))>a,li:has(ul)>a").unbind("mouseover mouseoff"); -this.element.find("li").not(":has(ul)").find("a").off("click",this._unselectEverythingFnc)},_addAjaxEvents:function(){if(this.element.find(">li:has(a.expandDown)").not(":has(ul)").length>0){var a=this;this._ajaxEnterFnc=function(){a._loadAjaxContent()};this.element.on("mouseenter",this._ajaxEnterFnc)}},_loadAjaxContent:function(){var a=this;this.element.off("mouseenter",this._ajaxEnterFnc);this._ajaxEnterFnc=null;var b=this.element.find("a.expandDown"),c=b.eq(0).prop("href").split("#");xQuery("
      ").load(c[0], -function(){a._handleAjaxLoadCallback(this,b)})},_handleAjaxLoadCallback:function(a,b){var c=xQuery(a);b.each(function(){var d=xQuery(this),f=d.prop("href").split("#")[1];f=c.find("#"+f);if(f[0].tagName.toLowerCase()==="li")f=f.find(">ul");d.parent().append(f)});this._createMenus();this._addEvents()},_checkFocus:function(){function a(){b.element.find("a:focus").length===0&&b._unselectEverything()}var b=this;window.setTimeout(a,10)},_addListeners:function(){var a=this;this.element.find(">ul").andSelf().on("ncbibasicmenuunselected", -function(b,c,d,f){f==="click"&&a.closeSub(d)}).on("ncbibasicmenuselected",function(b,c,d,f){if(f==="click")a.openSub(d);else{b=d.siblings().find("ul:visible");if(b.length>0){b.each(function(){a.closeSub(xQuery(this))});d.parent("ul").hasClass("ui-ncbimenu")&&a.openSub(d)}}}).on("ncbibasicmenuactiondown ncbibasicmenuactionright",function(b,c){c=xQuery(c);var d=c.find(">ul");if(c.hasClass("selected"))d.length===1&&d.not(":visible")&&a.openSub(c);else c.find(">a").click();d.length===1&&window.setTimeout(function(){d.ncbibasicmenu("selectFirstItem")}, -10)}).on("ncbibasicmenuactionup ncbibasicmenuactionleft ncbibasicmenuescape",function(b,c){c=xQuery(c);b=c.find(">ul");if(b.length>0&&b.is(":visible"))a.closeSub(xQuery(c));else{c=c.parent("ul").parent("li");c.find(">a").focus();a.closeSub(c)}})},_destroyListeners:function(){this.element.find("ul").andSelf().off("ncbibasicmenuunselected").off("ncbibasicmenuselected")},openSub:function(a){var b=a.find(">ul");if(b.length===1){this._isActive=true;var c=a.parent().find("li:has(ul:visible)");c.length> -0&&this.closeSub(c);if(a.parent().hasClass("orientation_hort")){c="left bottom";var d="fit flip"}else{c="right center";d="flip fit"}b.show().position({of:a,my:"left top",at:c,collision:d}).attr("aria-hidden","false")}},closeSub:function(a){(a.is("li")?a.find("ul"):a).find("ul").andSelf().not(".ui-ncbimenu").hide().attr("aria-hidden","true").end().ncbibasicmenu("removeAllSelections").find("li.selected").removeClass("selected")},_unselectEverything:function(){this.closeSub(this.element.find("ul:visible").andSelf()); -this._isActive=false}});(function(){xQuery.widget("ui.ncbilocalnav",xQuery.ui.ncbimenu,{_create:function(){this.options.isSubMenuLimited=true;xQuery.ui.ncbimenu.prototype._create.apply(this,arguments)},_addClasses:function(){this.element.addClass("ui-ncbilocalnav");xQuery.ui.ncbimenu.prototype._addClasses.apply(this,arguments)},_destroyClasses:function(){this.element.removeClass("ui-ncbilocalnav");xQuery.ui.ncbimenu.prototype._destroyClasses.apply(this,arguments)}})})();document.times=0; -xQuery.widget("ui.ncbipopper",{destTextCallbackCalledCount:0,options:{openMethod:"",openEvent:"mouseover",openAnimation:"slideDown",openAnimationTime:290,closeMethod:"",closeEvent:"mouseout",closeAnimation:"slideUp",closeAnimationTime:150,isEscapeKeyClose:true,isSourceElementCloseClick:false,isTriggerElementCloseClick:true,isTargetElementCloseClick:false,isDestElementCloseClick:false,isDocumentCloseClick:true,addCloseButton:false,adjustFit:"autoAdjust",delayTimeout:300,sourcePosition:"",destPosition:"top left", -sourceSelector:"",destSelector:"",targetPosition:"",triggerPosition:"bottom right",sourceText:null,destText:null,multipleHandlesSelector:"",openAtTarget:false,hasArrow:false,arrowDirection:"left",groupName:null,width:null,height:null,cssClass:null,excludeBasicCssStyles:false,wrapElement:false,loadingText:"loading...",showLoadingMessage:true,isDestTextCacheable:true,resizable:false,openAtMousePosition:false},_create:function(){this._setUpDestElem();this._addEventHandlers();this._addEscapeListener(); -this._addDocumentClickListener();this._addResizeListener();this._addCloseButton();this._addSharingDetails();this._addPopperHover();this.addTriggerAria()},updateTriggers:function(){this._addEventHandlers();this._addDocumentClickListener();this.addTriggerAria()},destroy:function(){xQuery.Widget.prototype.destroy.apply(this,arguments);var a=this.isPopperShared();this._destroyDestAria();this._destroyTriggerAria();this._removeSharingDetails();this._destroyCloseButton(a);this._destroyResizeListener();this._destroyDocumentClickListener(); -this._destroyEscapeListener();this._removeEventHandlers();this._destroyDestElem(a)},getDestElement:function(a){var b=this.destElem;if(!this.origDestElem)this.origDestElem=b;if(b){if(a&&this._isWaitingToBeAddedToDom){a=xQuery("div.grid");a=a.length===1?a:xQuery(document.body);b.appendTo(a);this._isWaitingToBeAddedToDom=true;this._getActualText(b)}}else{b=this.options.destSelector||this.options.sourceSelector||this.element.prop("hash");a=this.options.destText||this.options.sourceText;if(b){b=xQuery(b); -if(b.length===0)b=this._createTextHolder()}else if(a)b=this._createTextHolder();else throw"The popper can not find the popper element or text to display";if(this.options.wrapElement){if(!b.parent().hasClass("ui-ncbipopper-wrapper")){b.wrap('
      ');b.show()}if(!this.origDestElem)this.origDestElem=b;b=b.parent()}this.destElem=b;this._addDestAria()}if(!this.origDestElem)this.origDestElem=this.destElem;return b},_createTextHolder:function(){var a=xQuery('
      '); -this._isWaitingToBeAddedToDom=true;return a},_getActualText:function(a){if(!this.isFunctionResultCached){var b=this.options.destText||this.options.sourceText,c=this._getFunction(b);if(typeof c==="function")b=this._getText(c);a.css("display","none").attr("generated","true").find(".ui-ncbipopper-content").html(b)}},_getFunction:function(a){var b=null;if(xQuery.ui.jig&&xQuery.ui.jig._getFncFromStr)b=xQuery.ui.jig._getFncFromStr(a);else if(typeof a==="function")b=a;return b},getDestTextCallbackCalledCount:function(){return this.destTextCallbackCalledCount}, -_getText:function(a){if(!(this.options.isDestTextCacheable&&this.getTextCalled||this.callbackInProgress)){this.getTextCalled=true;a||(a=this._getFunction(this.options.destText||this.options.sourceText));var b=this;this.callbackInProgress=true;a=a.call(this.element[0],function(c){b._setHTML(c);b.destTextCallbackCalledCount++;b.callbackInProgress=false})||this.options.loadingText;if(a!==this.options.loadingText)this.isFunctionResultCached=this.options.isDestTextCacheable;return a}},reloadContent:function(){var a= -this._getText(),b=this.getDestElement().find(".ui-ncbipopper-content");b&&b.html(a);return this.element},_setHTML:function(a){var b=this.getDestElement().find(".ui-ncbipopper-content");if(b){b.html(a);this.isFunctionResultCached=this.options.isDestTextCacheable;!this.options.showLoadingMessage&&!this.isPopperDisplayed&&this._openAnimation()}},_setUpDestElem:function(){var a=this.getDestElement().addClass("ui-ncbipopper-wrapper");this.options.excludeBasicCssStyles||a.addClass("ui-ncbipopper-basic"); -this.options.resizable&&a.resizable();var b=this.options.cssClass;b&&a.addClass(b);this.options.width!==null&&a.width(this.options.width);this.options.height!==null&&a.height(this.options.height);this._resetElementPosition(a);a.removeClass("offscreen_noflow").hide();a.data("isOpen",false)},_setArrowDirection:function(){if(this.options.hasArrow){var a=this.options.arrowDirection;this._arrow&&this._arrow.removeClass("ui-ncbipopper-arrow-top ui-ncbipopper-arrow-bottom ui-ncbipopper-arrow-left ui-ncbipopper-arrow-right").addClass("ui-ncbipopper-arrow-"+ -a)}},_setUpArrow:function(a,b,c){if(this.options.hasArrow){var d=this.options.arrowDirection;if(this._arrow)this._arrow.removeClass("ui-ncbipopper-arrow-top ui-ncbipopper-arrow-bottom ui-ncbipopper-arrow-left ui-ncbipopper-arrow-right").addClass("ui-ncbipopper-arrow-"+d);else this._arrow=xQuery('
       
      ').appendTo(document.body);a=this._getPositionSettings(a,"arrow",c);this._arrow.show().position({my:a.dest,of:this._activeTrigger|| -a.triggerElement||this.element,at:a.trigger,offset:a.offset,collision:"none"});if(b||this._arrowOverlapsPopper())this._arrow.hide()}},_destroyDestElem:function(a){a||this.getDestElement().removeClass("ui-ncbipopper-wrapper ui-ncbipopper-basic ui-ncbipopper-wrapper-relative-parent").attr("style","").show();this.options.wrapElement&&this.origDestElem.unwrap();this.destElem=null},_addEventHandlers:function(){var a=this,b=this.element,c=this.options.multipleHandlesSelector;if(c&&c.length>0)b=b.add(c); -var d=this.options.openMethod||this.options.openEvent,f=this.options.closeMethod||this.options.closeEvent;if(d===f&&f==="click"){this._openFunction=function(g){a._toggle(g,g.currentTarget);g.preventDefault()};b.on("click",this._openFunction)}else{c={timeout:this.options.delayTimeout};if(d==="mouseover")c.over=function(g){a._isOverTrigger=true;a.open(g,this)};else{c.over=function(){a._isOverTrigger=true};this._openFunction=function(g){if(d==="click")if(a.option.isTriggerElementCloseClick){a._toggle(g, -this);g.preventDefault()}else{a.isOpen(this)||g.preventDefault();a.open(g,this)}else a.open(g,this)};b.on(d,this._openFunction)}if(f==="mouseout")c.out=function(){a._isOverTrigger=false;a.isOpen(this)&&!a._isOverPopper&&a.close()};else{c.out=function(){};this._closeFunction=function(g){a.close();f==="click"&&g.preventDefault()};b.on(f,this._closeFunction)}if(d==="mouseover"||f==="mouseout")b.hoverIntent(c);if(this.options.isTriggerElementCloseClick&&f!=="click"&&d!=="click"){this._closeFunction2= -function(g){a.isOpen(b)&&a.close();g.preventDefault()};b.on("click",this._closeFunction2)}}if(this.options.isDestElementCloseClick){this._closeFunctionPopper=function(g){a.isOpen(b)&&a.close();g.preventDefault()};this.getDestElement().on("click",this._closeFunctionPopper)}},_removeEventHandlers:function(){var a=this.element,b=this.getDestElement(),c=this.options.multipleHandlesSelector;if(c&&c.length>0)a=a.add(c);a.off("mouseover mouseout");if(this._openFunction){a.off(this.options.openMethod||this.options.openEvent, -this._openFunction);this._openFunction=null}if(this._closeFunction){a.off(this.options.closeMethod||this.options.closeEvent,this._closeFunction);this._closeFunction=null}if(this._closeFunction2){a.off("click",this._closeFunction2);this._closeFunction2=null}if(this._closeFunctionPopper){b.off("click",this._closeFunctionPopper);this._closeFunctionPopper=null}},_toggle:function(a,b){this.isOpen(b)?this.close():this.open(a,b);a&&a.preventDefault&&a.preventDefault();return this.element},_arrowOverlapsPopper:function(){var a= -this.getDestElement(),b=Math.floor(a.position().top),c=Math.floor(a.position().left),d=Math.floor(c+a.outerWidth());a=Math.floor(b+a.height());var f=this._arrow,g=Math.floor(f.position().top),i=Math.floor(f.position().left);Math.floor(i+f.width());var e=Math.floor(g+f.height());c=i>c&&ic&&i+f.css("width")b&&gb&&e+f.css("height")n&&d.css({"max-height":n- -45+"px",overflow:"auto"});xQuery(window).trigger("resize")}var c=this,d=this.getDestElement().data("isOpening",this.element).stop(true,true),f=this._arrow,g=this.options.openAnimation,i=function(){c._trigger("opencomplete");c.getDestElement().data("isOpening",null);xQuery.browser.msie&&parseInt(xQuery.browser.version,10)<=7&&c._positionPopper(a,false,true);b()},e=function(l){f.fadeTo(0,0);window.setTimeout(function(){f.stop(true,true).show();c._arrowOverlapsPopper()||f.css("opacity",1)},l)};if(g=== -"none"||this.isOpen()){d.show();f&&e(0);i()}else{var h=this.options.openAnimationTime;if(f){var j=0;if(f==="top")j=0;else if(f==="bottom")j=h;else{j=parseInt(f.css("top"),10)-parseInt(d.css("top"),10);var k=d.height()||j;j=j/k*h;if(j>h)j=h}e(j)}d[g](h,i)}},open:function(a,b){if(!b)b=this.element;if(this.options.openAtTarget){if(this._activeTrigger!==b){this.getDestElement().hide();this.getDestElement().data("isOpen",false)}this._activeTrigger=b}else this._activeTrigger=this.element;b=this.getDestElement(); -var c=b.data("isOpening");if(c&&c[0]!==this.element[0])(b.data("closeFnc")||function(){})(true);this._handleSharedPoppersOpen();this._handleGroupsOpen();b.data("isOpening",this.element);this._setUpArrow(a,true,true);xQuery.browser.msie&&this._positionPopper(a,true,true);this._setParentsZIndex(11);this._positionPopper(a,true,true);this._trigger("open");this.options.destText&&!this.options.showLoadingMessage&&!this.isFunctionResultCached||this._openAnimation(a);this._setAriaState(true);this.getDestElement().data("isOpen", -true);return this.element},_handleGroupsOpen:function(){var a=this.options.groupName;if(a){this.closeGroup(a);xQuery.ui.ncbipopper.openGroups[a]=this.element}},_closeAnimation:function(a){var b=this,c=function(){b._setParentsZIndex(1);b._trigger("closecomplete")},d=this.getDestElement().data("isOpening");if(d&&this.element[0]!=d[0])c();else{d=this.getDestElement().stop(true,true);var f=this.options.closeAnimation;if(f==="none"||a){d.hide();this._resetElementPosition(d);c()}else{var g=d;d[f](this.options.closeAnimationTime, -function(){b._resetElementPosition(g);c()})}}a=this.getDestElement().data("popperTriggers");for(f=0;fx").attr("generated","true").prependTo(a);b.ncbibutton({color:"blue"})}if(b){var c=this;this._closeButtonFunction=function(d){c.close();d.preventDefault()};b.on("click",this._closeButtonFunction)}}},_destroyCloseButton:function(a){this._closeButtonFunction&&this.getDestElement().find(".ui-ncbipopper-close-button, .ncbipopper-close-button").off("click", -this._closeButtonFunction).filter(function(){return!a}).filter(".ui-ncbipopper-close-button-generated").ncbibutton("destroy").remove()},isPopperShared:function(){return(this.getDestElement().data("popperTriggers")||[]).length>1},_addSharingDetails:function(){var a=this.getDestElement(),b=a.data("popperTriggers")||[];b.push(this.element);a.data("popperTriggers",b)},_removeSharingDetails:function(){for(var a=this.getDestElement(),b=a.data("popperTriggers"),c=this.element[0],d=0;d1?a&&a.length&&b&&b.length&&b[0]===a[0]:true;return this.getDestElement().data("isOpen")&&a?true:false},_setParentsZIndex:function(a){if(xQuery.browser.msie&&parseInt(xQuery.browser.version,10)<=7){var b=this.getDestElement().parents(),c=0;if(b.length>1){b.each(function(f){if(xQuery(this).css("position")=== -"relative"){c=f===0?0:f+1;return false}});b=b.eq(c);var d=b.css("position");b.data("orgPosition")||b.data("orgPosition",d);if(d==="static"||d==="relative"){d=a===1?b.data("orgPosition"):"relative";b.css({position:d,"z-index":a})}}}},addTriggerAria:function(a){var b=a;if(!a){b=this.element;if((a=this.options.multipleHandlesSelector)&&a.length>0)b=b.add(a)}b.attr("role","button").attr("aria-expanded",false).attr("aria-haspopup",true)},_destroyTriggerAria:function(){var a=this.element,b=this.options.multipleHandlesSelector; -if(b&&b.length>0)a=a.add(b);a.removeAttr("role aria-expanded aria-haspopup")},_addDestAria:function(){this.getDestElement().attr("aria-live","assertive").attr("aria-hidden",true).addClass("ui-helper-reset")},_destroyDestAria:function(){this.getDestElement().removeAttr("aria-live aria-hidden").removeClass("ui-helper-reset")},_setAriaState:function(a,b,c){b=b?b:this.element;c=c?c:this.getDestElement();b.attr("aria-expanded",a);c.attr("aria-hidden",!a)}});xQuery.ui.ncbipopper.openGroups={}; -xQuery.ui.ncbipopper.globalEvents={isGlobalEscapeRegistered:false,isGlobalClickRegistered:false,isGlobalResizeRegistered:false}; -(function(a){a.widget("ui.ncbislideshow",{options:{fadeSpeed:500,slideInterval:4E3,currentSlide:1,height:"117px",width:"410px",randomStart:false},_create:function(){this.element.addClass("ui-ncbislideshow").children("ul").addClass("ui-ncbislideshow-slides");this.options.slideCount=this.element.find("ul.ui-ncbislideshow-slides > li").length;this.options.randomStart&&this._setRandomStart();this.element.append(this._generateSkipList());this.element.find("ul.ui-ncbislideshow-slides").height(this.options.height).width(this.options.width); -this.element.find(".ui-ncbislideshow-skip li a:eq("+this.options.currentSlide+")").addClass("active");this.element.find(".ui-ncbislideshow-slides li").hide();this.element.find(".ui-ncbislideshow-slides li:nth-child("+this.options.currentSlide+")").show();this.startAnimation()},_setRandomStart:function(){this.element.ncbislideshow("option","currentSlide",Math.floor(Math.random()*this.options.slideCount+1))},startAnimation:function(){var b=this;this.element.find("span.ui-icon").addClass("ui-icon-pause").removeClass("ui-icon-play").attr("title", -"click to pause");this.options.animTimeout=setTimeout(function(){b._rotateSlides()},this.options.slideInterval)},stopAnimation:function(){this.element.find("span.ui-icon").addClass("ui-icon-play").removeClass("ui-icon-pause").attr("title","click to play");clearTimeout(this.options.animTimeout);delete this.options.animTimeout},_rotateSlides:function(){this._advanceSlide();this.startAnimation()},_advanceSlide:function(){var b=this.options,c=this.element;if(b.currentSlide>=this.options.slideCount)b.currentSlide= -1;else b.currentSlide++;c.find(".ui-ncbislideshow-slides li:visible").fadeOut(b.fadeSpeed);c.find(".ui-ncbislideshow-slides li:nth-child("+b.currentSlide+")").fadeIn(b.fadeSpeed);c.find(".ui-ncbislideshow-skip > li > a").removeClass("active");c.find(".ui-ncbislideshow-skip li a:eq("+b.currentSlide+")").addClass("active")},skiptoSlide:function(){var b=this.options,c=this.element;c.find(".ui-ncbislideshow-slides li:visible").fadeOut(b.fadeSpeed);c.find(".ui-ncbislideshow-slides li:nth-child("+b.currentSlide+ -")").fadeIn(b.fadeSpeed);c.find(".ui-ncbislideshow-skip > li > a").removeClass("active");c.find(".ui-ncbislideshow-skip li a:eq("+b.currentSlide+")").addClass("active");if(this.options.animTimeout){this.stopAnimation();this.startAnimation()}},_generateSkipList:function(){var b=this,c=this.options,d=a("").attr("href","#").attr("tabindex","-1").append(a("").attr("title","click to pause").addClass("ui-icon ui-icon-pause")).bind("click",function(g){c.animTimeout?b.stopAnimation():b.startAnimation(); -g.preventDefault()}),f=a("
        ").width(c.width).addClass("ui-ncbislideshow-skip").append(a("
      • ").addClass("ui-ncbislideshow-playPause").append(d));this.element.find("ul.ui-ncbislideshow-slides > li").each(function(g){var i=g+1;g=a(""+i+"").attr("href","#").attr("tabindex","-1").bind("click",function(e){if(b.options.currentSlide!==i){b.options.currentSlide=i;b.skiptoSlide();e.preventDefault()}});f.append(a("
      • ").append(g))});return f},destroy:function(){this.element.find(".ui-ncbislideshow-slides li").show(); -this.stopAnimation();this.element.children(".ui-ncbislideshow-skip").remove();this.element.removeClass("ui-ncbislideshow").children("ul").removeClass("ui-ncbislideshow-slides");a.Widget.prototype.destroy.apply(this,arguments)}});a.ui.ncbislideshow.prototype.version="2.0"})(xQuery); -(function(a){a.widget("ui.ncbitoggler",{styles:{ariaWrapper:"ui-ncbitoggler-live",groupMasterReplaceNode:"span.ui-ncbitoggler-group-replace-txt",groupMasterStateClose:"ui-ncbitoggler-group-master-to-close",groupMasterStateOpen:"ui-ncbitoggler-group-master-to-open",master:"ui-ncbitoggler",masterOpen:"ui-ncbitoggler-open",target:"ui-ncbitoggler-slave",targetOpen:"ui-ncbitoggler-slave-open",icon:"ui-icon-triangle-1-e",iconOpen:"ui-icon-triangle-1-s",iconPlusMinusBig:"ui-icon-plus-minus-big",iconPlusMinusBigOpen:"ui-icon-plus-minus-big-open", -iconArrowStop:"ui-icon-arrowthickstop-1-s",iconArrowStopOpen:"ui-icon-arrowthickstop-1-n"},options:{animation:"slide",closedAppendText:"",cookieNamePrefix:"jig-tog-rem-",indicator:"small-arrow",initOpen:false,isIcon:true,liveRegions:true,openedAppendText:"",remember:false,speed:50,targets:""},_cachedTargetData:{},_create:function(){this._setOption("disabled",false);this.appendTextNode=this.initTargetsClass=this.iconSpan=this.startOpen=this.rememberCookie=this.remember=this.cookieName=this.addedHref= -null;var b=this.element,c=b[0],d=this.styles,f=this,g=this.options.isIcon;b.data("isOpen",false);b.addClass("ui-widget ui-ncbitoggler");g||b.addClass("ui-ncbitoggler-no-icon");var i=b.attr("href");!i?(this.addedHref=true):(this.addedHref=false);this._validate(i);b.children("span.ui-ncbitoggler-master-text").length===0&&b.contents().filter(function(){return this.nodeType===3}).each(function(){var e=a(this);xQuery.trim(this.nodeValue).length>0&&e.wrap('')}); -if(this.options.openedAppendText!==""||this.options.closedAppendText!==""){this.appendTextNode=b.children("span.ui-ncbitoggler-appended-text");if(this.appendTextNode.length===0)if(!this.initOpen){this.appendTextNode=a(''+this.options.closedAppendText+"");b.find(".ui-ncbitoggler-master-text").after(this.appendTextNode)}}if(this.remember=this.options.remember||false){i=this.element.attr("id");if(!i){window.console&&console.error&&console.error("ncbitoggler: master node "+ -c+" must have a unique id attribute when remembering state");return}this.cookieName=this.options.cookieNamePrefix+i;this.rememberCookie=a.cookie(this.cookieName)}if(this.startOpen=this.rememberCookie?this.rememberCookie==="open"?true:false:b.hasClass("jig-ncbitoggler-open")||b.hasClass(d.masterOpen)||this.options.initOpen?true:false){this.element.data("isOpen",true);b.removeClass(this.styles.master);b.addClass(d.masterOpen);this._targetsOpen=true}else{this.element.data("isOpen",false);b.removeClass(this.styles.masterOpen); -b.addClass(d.master)}g&&this._initMasterIcon();this.targets=this._getTargets();this.targets.addClass("ui-ncbitoggler").removeClass("ui-ncbitoggler-disabled ui-state-disabled");if(this.startOpen){this.targets.removeClass(d.target);this.targets.addClass(d.targetOpen);this.initTargetsClass=d.targetOpen}else{this.targets.removeClass(d.targetOpen);this.targets.addClass(d.target);this.initTargetsClass=d.target}this._initAria();this._doGrouping();b.click(function(e){f.toggle(e,f)});this._saveReferences()}, -_getGroupMaster:function(){for(var b=this.styles,c=this.element[0].className.split(/\s+/),d=0;d0&&g.text(c.options.groupMasterCloseReplaceText); -c.element[0]===i&&b.removeClass(d.groupMasterStateOpen).addClass(d.groupMasterStateClose)}else{c.close();g.length>0&&g.text(c.options.groupMasterOpenReplaceText);c.element[0]===i&&b.removeClass(d.groupMasterStateClose).addClass(d.groupMasterStateOpen)}})}},_initAria:function(){var b=this.startOpen;this.element.attr({role:"button","aria-expanded":b});this.options.liveRegions&&this.targets.each(function(){var c=a(this);c.find("table").length===0&&!c.parent("div").hasClass("ui-helper-reset")&&c.wrap('
        '); -c.attr("aria-hidden",b?"false":"true")})},_validate:function(b){var c=this.element,d=["a"],f=c[0].tagName.toLowerCase();if(a.inArray(f,d)===-1)throw new Error("ncbitoggler: master node must be one of the following elements: "+d.toString());b||c.attr("href","#")},_initMasterIcon:function(){var b=this.element,c=this.styles;if(this.options.indicator=="plus-minus-big"){this.iconOpenClass=c.iconPlusMinusBigOpen;this.iconCloseClass=c.iconPlusMinusBig}else if(this.options.indicator=="arrow-stop"){this.iconOpenClass= -c.iconArrowStopOpen;this.iconCloseClass=c.iconArrowStop}else{this.iconOpenClass=c.iconOpen;this.iconCloseClass=c.icon}this.iconSpan=b.find("span.ui-icon");if(this.iconSpan.length===0){this.iconSpan=a('');this.startOpen?this.iconSpan.addClass(this.iconOpenClass):this.iconSpan.addClass(this.iconCloseClass);b.append(this.iconSpan)}else if(this.startOpen){this.iconSpan.removeClass(this.iconCloseClass);this.iconSpan.addClass(this.iconOpenClass)}},getSlaves:function(){return this._targets}, -getTargets:function(){return this.getSlaves()},_getTargets:function(){var b=this.element,c=b.attr("toggles")||b.attr("data-ncbitoggler-toggles");if(c)xQuery.ui.jig._isConsole("warn")&&console.warn('The attributes "toggles" and "data-ncbitoggler-toggles" are deprecated. Please use the "targets" attribute instead (see documentation).');else c=this.options.targets;if(c&&typeof c=="object"){c=c;b="";for(var d in c)b+=d+", ";b=b.replace(/,\s$/,"");d=a(b)}else if(c){d=a(c);if(d.length===0){this.isSibling= -false;d=c.split(/ +/);c="";for(b=0;b0){b.parent(":header").parent().css("zoom","1");this.isSibling=true;d=b.parent(":header").css("zoom","1").next()}else{this.isSibling=true;d=b.next()}return this._targets=this._normalizeTargets(d)},_normalizeTargets:function(b){var c=[];b.each(function(){var d=this,f=a(this);if(f.hasClass("ui-helper-reset"))d=f.children().get(0);c.push(d)});return ret=a(c)},_getCachedTargetData:function(b){return this._cachedTargetData[b]}, -_cacheTargetData:function(b,c){this._cachedTargetData[b]=c},_openAjaxTarget:function(b,c){var d=this,f=this._getCachedTargetData(b);f?a(b).html(f):a.get(c,function(g){d._cacheTargetData(b,g);a(b).html(g)})},_openTargets:function(){if(!(this._targetsOpening||this._targetsClosing||this._targetOpen)){this._targetsOpening=true;var b=this.targets,c=this.styles;b.removeClass(c.target).addClass(c.targetOpen).attr("aria-hidden","false");var d=this.options.targets;if(typeof d=="object"){var f=this;for(targetSel in d)(function(g){f._openAjaxTarget(g, -d[g])})(targetSel)}c=this.options.openedAppendText;c!==""&&this.appendTextNode.html(c);b.css("display","");this._targetsOpening=false;this._targetsOpen=true}},_closeTargets:function(){if(!(this._targetsOpening||this._targetsClosing||!this._targetsOpen)){this._targetsClosing=true;var b=this.targets,c=this.styles;b.removeClass(c.targetOpen).addClass(c.target).attr("aria-hidden","true");c=this.options.closedAppendText;c!==""&&this.appendTextNode.html(c);b.css("display","");this._targetsOpen=this._targetsClosing= -false}},_fixHasLayout:function(b){window.setTimeout(function(){b.targets.addClass("foo").removeClass("foo")},1)},open:function(b){var c=this.element,d=this;if(!c.hasClass(this.styles.master))return c;this.updateState("open");if(this.options.animation==="slide")this.targets.slideToggle(this.options.speed,function(){d._openTargets();a.browser.msie&&d._fixHasLayout(d);c.data("isOpen",true);c.trigger("ncbitoggleropen");b&&b()});else{this._openTargets();a.browser.msie&&d._fixHasLayout(d);c.data("isOpen", -true);c.trigger("ncbitoggleropen");b&&b()}this._updateReferences("open");return c},close:function(b){var c=this.element,d=this;if(!c.hasClass(this.styles.masterOpen))return c;this.updateState("closed");if(this.options.animation==="slide")this.targets.slideToggle(this.options.speed,function(){d._closeTargets();c.trigger("ncbitogglerclosed").trigger("ncbitogglerclose");c.data("isOpen",false);b&&b()});else{this._closeTargets();c.data("isOpen",false);c.trigger("ncbitogglerclosed");b&&b()}this._updateReferences("closed"); -return c},toggle:function(b,c,d){var f=arguments.length;if(f===0||f===1){c=this;if(f===1)d=arguments[0]}else b.preventDefault();this.element.hasClass(this.styles.master)?c.open(d):c.close(d)},updateState:function(b){var c=this.element;b||(b=c.hasClass(styles.master)?"open":"closed");var d=this.styles.master,f=this.styles.masterOpen,g=this.iconCloseClass,i=this.iconOpenClass;if(b=="closed"){d=this.styles.masterOpen;f=this.styles.master;g=this.iconOpenClass;i=this.iconCloseClass}c.removeClass(d).addClass(f).attr("aria-expanded", -b=="closed"?"false":"true");this.options.isIcon&&this.iconSpan.removeClass(g).addClass(i);this.remember&&a.cookie(this.cookieName,b)},_removeHandlers:function(){this.element.unbind("click")},destroy:function(){a.Widget.prototype.destroy.apply(this,arguments);var b=this.element,c=this.styles;b.removeClass(c.master+" "+c.masterOpen+" ui-state-disabled ui-widget ui-ncbitoggler-disabled").removeAttr("role").removeAttr("aria-expanded");this.targets.removeClass("ui-ncbitoggler ui-ncbitoggler-slave ui-ncbitoggler-slave-open ui-state-disabled ui-ncbitoggler-disabled"); -this.targets.removeAttr("aria-hidden");if(this.options.isIcon){c=b.find("span.ui-icon")[0];b[0].removeChild(c)}this.targets.each(function(){var f=xQuery(this),g=f.parent("div.ui-helper-reset");if(g.length>0){f.insertBefore(g);g.remove()}});c=b.find("span.ui-ncbitoggler-master-text");var d=c.html();c.remove();b.html(d);this._removeHandlers();return this},disable:function(){a.Widget.prototype.disable.apply(this,arguments);this._removeHandlers();this.targets.addClass("ui-ncbitoggler-disabled ui-state-disabled"); -return this},enable:function(){a.Widget.prototype.enable.apply(this,arguments);this.targets.removeClass("ui-ncbitoggler-disabled ui-state-disabled");var b=this;this.element.click(function(c){b.toggle(c,b)});return this},_saveReferences:function(){var b=this;this._targets.each(function(){typeof a(this).data("ncbitoggler-masters")==="undefined"&&a(this).data("ncbitoggler-masters",[]);a(this).data("ncbitoggler-masters").push(b.element)})},_updateReferences:function(b){var c=this;a.each(this._targets.data("ncbitoggler-masters"), -function(){c.element!=this&&a(this).ncbitoggler("updateState",b)})}})})(xQuery); -(function(a){a.widget("ui.ncbitree_base",{options:{expanded:"",speed:120,remember:false},_create:function(){this.widgetId=this.element.prop("id")||xQuery.ui.jig._generateId("ncbitree");this.list=this.element.eq(0);this.list[0].nodeName=="UL"&&this._treeify();this.isLoaded=true},_treeify:function(){var b=this.list,c=this,d=this.options;b.attr({role:"tree"}).addClass("ui-widget");b.find("a:eq(0)").attr("tabindex","0");b.find("a:gt(0)").attr("tabindex","-1");var f=this.widgetId;b.find("ul").filter(function(){return xQuery(this).data("treeid")!== -f}).attr({role:"group"}).addClass("tree-group-collapsed").data("treeid",f);b.find("li").filter(function(){return xQuery(this).data("treeid")!==f}).attr({role:"treeitem"}).data("treeid",f).filter(":has(ul)").attr("aria-expanded","false");b.find("li:has(ul)").find(">a").wrap('').each(function(){var i=xQuery(this);i.attr("href")==="#"&&i.click(function(e){e.preventDefault();c._toggle(i.parent())})});if(!this.isLoaded){b.bind("expand.treeEvents",function(i){c._expand(i.target); -c._trigger("expand",i)}).bind("collapse.treeEvents",function(i){c._collapse(i.target);c._trigger("collapse",i)}).bind("toggle.treeEvents",function(i){c._toggle(i.target)}).bind("traverseDown.treeEvents",function(i){var e=a(i.target);e.length||(e=b.find("a[tabindex=0]"));e.length||(e=a(i.target));i=e.closest("li");if(i.is("[aria-expanded=true]"))i.find("ul[role=group]").find("a").eq(0).focus();else i.next().length?i.next().find("a").eq(0).focus():i.parents("li").next().find("a").eq(0).focus()}).bind("traverseUp.treeEvents", -function(i){var e=a(i.target);e.length||(e=b.find("a[tabindex=0]"));e.length||(e=a(i.target));i=e.closest("li");if(i.prev().length)i.prev().is("[aria-expanded=true]")?i.prev().find("li:visible:last a").eq(0).focus():i.prev().find("a").eq(0).focus();else i.parents("li:eq(0)").find("a").eq(0).focus()});b.bind("focus.treeEvents",function(i){b.find("[tabindex=0]").attr("tabindex","-1").removeClass("ui-state-focus");a(i.target).attr("tabindex","0").addClass("ui-state-focus")}).bind("click.treeEvents", -function(i){var e=a(i.target);if(e.is("span.tree-parent")){e.trigger("toggle");e.eq(0).focus();i.preventDefault()}}).bind("keydown.treeEvents",function(i){var e=a(i.target);if(i.keyCode==37||i.keyCode==38||i.keyCode==39||i.keyCode==40){i.keyCode==37&&e.closest("li").is("[aria-expanded=true]")&&e.closest("span.tree-parent").trigger("collapse");i.keyCode==39&&e.closest("li").is("[aria-expanded=false]")&&e.closest("span.tree-parent").trigger("expand");i.keyCode==38&&e.trigger("traverseUp");i.keyCode== -40&&e.trigger("traverseDown");return false}else if((i.keyCode==13||i.keyCode==32)&&e.closest("li").is("li[role=treeitem]")){e.closest("span.tree-parent").trigger("toggle");return false}});var g=b.attr("id");if(g&&a.cookie("ncbitree")&&a.parseJSON(a.cookie("ncbitree"))[g]){d=a.parseJSON(a.cookie("ncbitree"))[g];c._load_state(d)}else b.find(d.expanded).find(">span").each(function(){c._expand(this)})}b.find("li[role=treeitem] > a, li[role=treeitem] > span").filter(function(){return xQuery(this).data("treeid")!== -f}).addClass("ui-state-default").data("treeid",f).bind("mouseenter.treeEvents",function(){a(this).addClass("ui-state-hover")}).bind("mouseleave.treeEvents",function(){a(this).removeClass("ui-state-hover")})},_expand:function(b){var c=this.options,d=this,f=this.list,g=b?a(b):f.find("a[tabindex=0]");g.addClass("ui-state-active").removeClass("ui-state-default");g.siblings("ul").hide().removeClass("tree-group-collapsed").slideDown(c.speed,function(){a(this).removeAttr("style");g.parent().attr("aria-expanded", -"true").addClass("tree-expanded");c.remember&&d._save_state()})},_collapse:function(b){var c=this.options,d=this,f=this.list,g=b?a(b):f.find("a[tabindex=0]");g.removeClass("ui-state-active").addClass("ui-state-default");g.siblings("ul").slideUp(c.speed,function(){g.parent().attr("aria-expanded","false").removeClass("tree-expanded");a(this).addClass("tree-group-collapsed").removeAttr("style");c.remember&&d._save_state()})},_toggle:function(b){var c=this.list;b=b?a(b):c.find("a[tabindex=0]");b.parent().is("[aria-expanded=false]")? -b.trigger("expand"):b.trigger("collapse")},expand:function(b,c){var d=this.list;if(c){ancestor_spans=d.find(b).parentsUntil("[role=tree]").find(">span");ancestor_spans.each(function(){a(this).trigger("expand")})}d.find(b).find(">span").trigger("expand");this._trigger("expanded",null)},collapse:function(b){this.list.find(b).find(">span").trigger("collapse")},destroy:function(){a.Widget.prototype.destroy.apply(this,arguments);var b=this.list;b.removeAttr("role").removeClass("ui-widget");b.find("a").removeAttr("tabindex").removeClass("ui-state-focus ui-state-default ui-state-hover ui-state-active"); -b.find("ul").removeAttr("role").removeClass("tree-group-collapsed");b.find("li").removeAttr("role").removeClass("tree-expanded");b.find("li:has(ul)").removeAttr("aria-expanded").find(">a").removeClass("tree-parent");b.find('span[class*="tree-parent"]>a').unwrap();b.find(this.options.expanded).removeAttr("aria-expanded");b.unbind(".treeEvents")},_load_state:function(b){var c=this,d=this.list;state=b.split("");d.find("li[aria-expanded]").each(function(f){state[f]==1?a(this).find(">span").each(function(){c._expand(this)}): -a(this).find(">span").each(function(){c._collapse(this)})})},_save_state:function(){var b=this.list,c=b.attr("id");if(c){state_data={};if(a.cookie("ncbitree"))state_data=a.parseJSON(a.cookie("ncbitree"));var d="";b.find("li[aria-expanded]").each(function(){d+=a(this).attr("aria-expanded")=="true"?"1":"0"});state_data[c]=d;data=JSON.stringify(state_data);a.cookie("ncbitree",data,{path:"/"})}}});a.ui.ncbitree_base.prototype.version="0.2"})(xQuery); -(function(a){a.widget("ui.ncbitree",a.ui.ncbitree_base,{options:{expanded:""},_create:function(){a.ui.ncbitree_base.prototype._create.call(this);this.list.addClass("jig-tree")},destroy:function(){this.list.removeClass("jig-tree");a.ui.ncbitree_base.prototype.destroy.call(this)},_getParentLis:function(){return this.list.find("li").has("ul")},expandAll:function(){this.expand(this._getParentLis())},collapseAll:function(){this.collapse(this._getParentLis())},refresh:function(){this._treeify()}});a.ui.ncbitree.prototype.version= -"0.1"})(xQuery); -xQuery.widget("ui.ncbismoothscroll",{options:{duration:1E3,easing:true,easingFunction:"",exclude:".ncbismoothscrollexclude",topHref:"#top",removeTopHash:true},_create:function(){this.element.prop("id")==""&&this.element.attr("id",xQuery.ui.jig._generateId(this.widgetName));this._determineScrollableElement();this._smoothScroll()},destroy:function(){this._removeSmoothScroll()},_smoothScroll:function(){if("onhashchange"in window&&(document.documentMode===undefined||document.documentMode>7)){var a="linear"; -if(this.options.easing)if(this.options.easingFunction==""){typeof xQuery.easing.easeOutExpo!=="function"&&xQuery.extend(xQuery.easing,{easeOutExpo:function(b,c,d,f,g){return c==g?d+f:f*(-Math.pow(2,-10*c/g)+1)+d}});a="easeOutExpo"}else a=this.options.easingFunction;if(!xQuery.ui.ncbismoothscroll.globalEvents.isHashChangeRegistered){xQuery(window).on("hashchange.ncbismoothscroll",{scrollParent:xQuery(this.element),triggeredByLink:false,easing:a},function(b){b.data.scrollParent.data("ncbismoothscroll").scroll(b)}); -xQuery.ui.ncbismoothscroll.globalEvents.isHashChangeRegistered=true}this.element.find('a[href^="#"]').not(this.options.exclude).on("click.ncbismoothscroll",{scrollParent:xQuery(this.element),triggeredByLink:true,easing:a},function(b){b.data.scrollParent.data("ncbismoothscroll").scroll(b)})}},_removeSmoothScroll:function(){xQuery(window).off("hashchange.ncbismoothscroll");this.element.find("a").not(this.options.exclude).off("click.ncbismoothscroll")},scroll:function(a){a.preventDefault();var b=a.data.triggeredByLink? -xQuery(a.target).attr("href"):window.location.hash,c=b==a.data.scrollParent.ncbismoothscroll("option","topHref")||b==""||b=="#"?0:xQuery(b.replace(".","\\.")).offset().top;if(xQuery(xQuery.ui.ncbismoothscroll.globalEvents.scrollableElement).scrollTop()!==c){a.data.scrollParent.trigger("ncbismoothscrollbeforescroll");xQuery(xQuery.ui.ncbismoothscroll.globalEvents.scrollableElement).stop().animate({scrollTop:c},a.data.scrollParent.ncbismoothscroll("option","duration"),a.data.easing,function(){a.data.scrollParent.trigger("ncbismoothscrollafterscroll"); -if(a.data.triggeredByLink)if(c==0&&a.data.scrollParent.ncbismoothscroll("option","removeTopHash")&&window.history&&window.history.pushState)window.history.pushState("","",window.location.pathname);else window.location.hash=b})}},_scrollableElement:function(){for(var a=0,b=arguments.length;a0)return c;else{d.scrollTop(1);var f=d.scrollTop()>0;d.scrollTop(0);if(f)return c}}return[]},_determineScrollableElement:function(){if(xQuery.ui.ncbismoothscroll.globalEvents.scrollableElement== -"")xQuery.ui.ncbismoothscroll.globalEvents.scrollableElement=this._scrollableElement("html","body")}});xQuery.ui.ncbismoothscroll.globalEvents={isHashChangeRegistered:false,scrollableElement:""}; -(function(){xQuery.widget("ui.ncbilinksmenu",xQuery.ui.ncbipopper,{options:{openEvent:"click",closeEvent:"click",closeOnSelect:true,openAnimation:"none",cssClass:"ui-ncbilinksmenu",ignoreSettingOutterWidth:true,excludeBasicCssStyles:true,wrapElement:true,preventDefault:""},_create:function(){this._checkHrefForWebService();this._setPopperOptions();xQuery.ui.ncbipopper.prototype._create.apply(this,arguments);this._addMenuAria();this._addOpenEvents()},destroy:function(){this._destroyMenuAria();this._destroyMenu(); -this._destroyOpenEvents();xQuery.ui.ncbipopper.prototype.destroy.apply(this,arguments)},_checkHrefForWebService:function(){if(!this.options.webservice&&!this.options.destSelector&&!this.options.localJSON)this.options.webservice=this.element.attr("href")},_setPopperOptions:function(){var a=this.options;if(a.loadingMessage)a.showLoadingMessage=true;if(!a.width)a.width="200px";if(this.options.webservice||this.options.localJSON)this.options.destText="
        • "+ -this.options.loadingText+"
        "},open:function(){this._setTriggerId();if(this.isLoaded)this.getDestElement().find("ul").eq(0).ncbibasicmenu("removeAllSelections").ncbibasicmenu("focus");else{var a=this;if(this.options.webservice){var b=this.options.webservice,c=this.options.webserviceMenuSelector;if(!c)if(b.indexOf("#")!==-1)c=b.match(/#.+/)[0];xQuery.get(b,function(d){if(typeof d==="string"){var f=d;if(c)f=xQuery("
        ").html(d).find(c);a.getDestElement().empty().html(f);a._createMenu()}else a._loadContentJSON(d)}).error(function(){a.getDestElement().find("ul.linksmenu-ul").replaceWith("
        • Error Loading Data
        "); -a._logError();window.setTimeout(function(){a.close()},4E3)})}else if(this.options.localJSON){b=this.options.localJSON;if(typeof b==="function")b=b();this._loadContentJSON(b)}else this._createMenu()}xQuery.ui.ncbipopper.prototype.open.apply(this,arguments)},_addMenuAria:function(){this.element.wrap("").attr("role","menuitem").parent().attr("role","menubar")},_destroyMenuAria:function(){this.element.unwrap().removeAttr("role")},_createMenu:function(){this.isLoaded=true;var a=this.getDestElement().find("ul").eq(0); -if(!a.hasClass("ui-ncbibasicmenu")){a.ncbibasicmenu({stopPropagationCheck:false,normalizeSubsToOneLevel:true,disableSelect:true});var b=this,c=function(d){var f=a.closest(".ui-ncbilinksmenu").data("attachedTo"),g=xQuery.ui.jig.getElementWidgets(f,"ncbilinksmenu")[0];g||(g=b);if(g.isOpen()){d.type!="ncbibasicmenuescape"&&g.options.closeOnSelect&&g.close();a.not(xQuery(d.target)).find("li.selected").not(xQuery(d.target).closest("li")).removeClass("selected");d.type!="ncbibasicmenuescape"&&g.options.closeOnSelect&& -f.focus()}};this._selectedFnc=c;a.on("ncbibasicmenuescape",c);a.on("click","a",c)}},_destroyMenu:function(){var a=this.getDestElement().find("ul").eq(0);a.ncbibasicmenu("destroy");a.ncbibasicmenu("focus").off("ncbibasicmenuescape",this._selectedFnc).off("ncbibasicmenuenter",this._selectedFnc).off("click",this._selectedFnc);this._selectedFnc=null},_loadContentJSON:function(a){function b(g,i){var e=g.text,h=g.href||"#",j=g.target||"",k=g.click||"";if(typeof k=="string"&&k!=""){eval("clicktmp = "+k); -k=clicktmp}var l=g.rel||"";if(j)j=' target="'+j+'"';if(l)l=' rel="'+l+'"';g=xQuery("
      • ");e=xQuery(""+e+"");if(k)try{e.click(function(u){k.call(this,u,d);u.preventDefault&&xQuery(this).is(d.options.preventDefault)&&u.preventDefault()})}catch(n){typeof console!=="undefined"&&console.error&&console.error(n)}g.append(e);i.append(g)}function c(g,i){for(var e=0;e").attr("role","heading");j=xQuery(""+ -j+"");k.append(j);if(h=h.links){j=xQuery("
          ");c(h,j);k.append(j)}i.append(k)}else b(h,i)}}typeof a==="function"&&a.apply(this);var d=this,f=xQuery("
            ");(a=a.links)&&c(a,f);this._contentFetched=true;this.isFunctionResultCached=this.options.isDestTextCacheable;this.getDestElement().empty().append(f);this._createMenu();this._trigger("jsonmenuloaded")},_logError:function(){if(typeof ncbi!=="undefined"&&ncbi.sg&&ncbi.sg.ping){var a={jsevent:"ncbilinksmenu_error"},b=this.element, -c=b.attr("id")||null,d=b.attr("href")||null;b=b.text()||null;var f=this.options.webservice;if(c)a.id=c;if(d)a.href=d;if(b)a.text=b;if(f)a.webservice=f;ncbi.sg.ping(a)}},_setTriggerId:function(){var a=this.element.attr("id");a&&this.getDestElement().data("triggerId","#"+a).attr("data-jigtriggerid","#"+a).data("trigger",this.element)},_pingDetails:function(a,b,c){typeof ncbi!=="undefined"&&ncbi.sg&&ncbi.sg.ping&&ncbi.sg.ping(b,a.originalEvent,c,{})},_addOpenEvents:function(){var a=this;this._keyDownFnc= -function(b){b=b.keyCode;if(b===38||b===40)a.open()};this.element.on("keydown",this._keyDownFnc)},_destroyOpenEvents:function(){this.element.off("keydown",this._keyDownFnc);this._keyDownFnc=null}})})(); -xQuery.widget("ui.ncbiclearbutton",{_create:function(){this._createButton();this._attachInputEvents();this._attachButtonEvents();this._boxShadow();this._showIfValue()},_wrapHTML:'
            ',_buttonHTML:'Clear input',_createButton:function(){this.clearButton=xQuery(this._buttonHTML);this.wrapperElement=xQuery(this._wrapHTML);this.element.wrap(this.wrapperElement);this.element.after(this.clearButton)}, -clearText:function(){this.element.val("");this._trigger("elementcleared")},_showButton:function(){this.clearButton.css("visibility","visible")},_hideButton:function(){this.clearButton.css("visibility","hidden")},_boxShadow:function(){var a=this;this.element.focus(function(){a.element.parent().addClass("box-shadow")});this.element.blur(function(){a.element.parent().removeClass("box-shadow")})},_showIfValue:function(){this.element.val()!=""?this._showButton():this._hideButton()},_attachInputEvents:function(){var a= -this;this.element.bind("keyup change",function(){a._showIfValue()}).bind("paste",function(){window.setTimeout(function(){a._showIfValue()},10)})},_pingData:function(){typeof ncbi!=="undefined"&&ncbi.sg&&ncbi.sg.ping({jsevent:"ncbiclearbutton",prevValue:this.element.val()})},_attachButtonEvents:function(){var a=this;this.clearButton.click(function(b){a.clearText();a._hideButton();a.element.focus();b.preventDefault()})}}); -xQuery.widget("ui.ncbiplaceholder",{options:{},_label:null,_create:function(){if(!xQuery.ui.ncbiplaceholder.hasPlaceholderSupport()){var a=this.element.attr("type");a=="hidden"||a=="button"||a=="submit"||a=="radio"||a=="checkbox"||a=="image"||a=="reset"||this._doFakeLabel()}},destroy:function(){this._removeFakeLabel()},_setLabelPosition:function(a){var b=a.element.offset(),c=a.element.outerWidth(),d=a.element.outerHeight(),f=parseInt(a.element.css("borderTopWidth"),0),g=parseInt(a.element.css("borderLeftWidth"), -0);a.element.offsetParent().position();a._label&&a._label.offset&&a._label.offset({top:b.top+f,left:b.left+g}).css({width:c,height:d})},_doFakeLabel:function(){var a=this;this.element.closest(".ui-dialog:hidden, .ui-ncbipopper-basic:hidden, .ui-tabs-panel:hidden").length>0&&xQuery(document).on("ncbitabsshow tabsshow ncbidialogopen ncbipopperopencomplete",function(){a._setLabelPosition(a)});this._fakeLabel(this)},_fakeLabel:function(a){var b=a.element.attr("placeholder").replace(//,"");this._label= -xQuery('").insertAfter(a.element);this._setLabelPosition(a);xQuery(["paddingTop","paddingRight","paddingBottom","paddingLeft","fontSize","lineHeight","fontFamily","width","fontWeight"]).each(function(){a._label.css(a.toString(),a.element.css(a.toString()))});a.element.val().length!==0&&a._label.hide();a._label.on("click",function(){a.element.focus()});a.element.on("focus.ncbiplaceholder",function(){a._label.hide()});a.element.on("blur.ncbiplaceholder", -function(){a.element.val().length===0&&a._label.show()})},_removeFakeLabel:function(){this._label.remove();this.element.off("blur.ncbiplaceholder");this.element.off("focus.ncbiplaceholder")},value:function(){return this.element.val()},hasValue:function(){return this.element.val().length!==0}});xQuery.ui.ncbiplaceholder.hasPlaceholderSupport=function(){var a=document.createElement("input"),b="placeholder"in a;a=null;xQuery.ui.ncbiplaceholder.hasPlaceholderSupport=function(){return b};return b}; -xQuery.widget("ui.ncbiexpander",{options:{openDelay:200,delayTimeout:400,animationSpeed:200,minHeight:"55px",auto:true},_create:function(){this._wrapperInner();this._setHeightAndClass();if(this.isExpandable){this._addNavigator();this._setArrowDirection("closed");this._hookUpEvents()}},destroy:function(){var a=this.element,b=a.find("div.ui-ncbiexpander"),c=b.html();b.remove();a.html(c);this.options.auto==true?a.find("ui-expander-arrow-bar").remove():a.find("ui-expander-controllink").remove()},_wrapperInner:function(){this._wrapper= -this.element.wrapInner("
            ").find(".expanderWrapper")},_setHeightAndClass:function(){this._wrapper.addClass("ui-ncbiexpander").height(this.options.minHeight);(this.isExpandable=this._wrapper[0].scrollHeight>this._wrapper.height())||this._wrapper.addClass("ui-ncbiexpander-simple").height("auto")},_hookUpEvents:function(){var a=this,b;if(this.isExpandable){var c=a._wrapper[0].scrollHeight;if(this.options.auto==true){b={interval:this.options.openDelay,timeout:this.options.delayTimeout, -over:function(){a._isOpen=true;a._wrapper.stop().animate({height:c},a.options.animationSpeed,function(){a._setArrowDirection("open")})},out:function(){a._isOpen=false;a._wrapper.stop().animate({height:a.options.minHeight},a.options.animationSpeed,function(){a._setArrowDirection("closed")})}};this.element.hoverIntent(b);this.element.mouseenter(function(){a._setIconBarStyle(true)}).mouseleave(function(){a._isOpen||a._setIconBarStyle(false)})}else a._attachControlLinkEvents(a,c)}},_attachControlLinkEvents:function(a, -b){this.link=xQuery(this.element).find(".ui-expander-moreless");xQuery(this.link).on("click",function(c){c.preventDefault();if(a._isOpen==false){a._isOpen=true;a._wrapper.stop().animate({height:b},a.options.animationSpeed);xQuery(this).text("...less").removeClass("ui-expander-more").addClass("ui-expander-less")}else{a._isOpen=false;a._wrapper.stop().animate({height:a.options.minHeight},a.options.animationSpeed);xQuery(this).text("...more").removeClass("ui-expander-less").addClass("ui-expander-more")}})}, -_addNavigator:function(){this.options.auto==false&&this.isExpandable?this._addControlLink():this._addArrow()},_addControlLink:function(){this._isOpen=false;this._iconBar=xQuery('...more').appendTo(this.element)},_addArrow:function(){this._iconBar=xQuery('
            ').appendTo(this.element)}, -_setArrowDirection:function(a){var b=a==="open"?"closed":"open";this._iconBar.find("div.bar").addClass(a).removeClass(b);this._setIconBarStyle(a==="open")},_setIconBarStyle:function(a){this._iconBar[a?"addClass":"removeClass"]("ui-expander-arrow-bar-active")}}); -xQuery.widget("ui.ncbiselect",{_create:function(){this._buildSelect()},update:function(){this._buildSelect(true)},_buildSelect:function(a){this._setDefaults();this._makeList(a);a||this._setUpKeyListeners();this._setUpClickListeners();this._addFocusListener();this._addMultiSelectListener();this._scrollSelectionIntoView();this.element.hide()},_setDefaults:function(){this.isMultiple=this.element.prop("multiple")},_makeList:function(){var a=this,b=xQuery("
              ");this.activeOption= --1;this.selectedOptions=[];var c=this.element[0].selectedIndex;this.element.find("option").each(function(d){var f=xQuery(this),g=f.is(":selected");if(g){a.activeOption=d;a.selectedOptions.push(d)}b.append("
            • "+f.text()+"
            • ")});this._ul?this._ul.replaceWith(b):this.element.after(b);this._ul=b;this.selectItems=b.find("li")},_addFocusListener:function(){var a=this;this.isFocused= -false;this.selectItems.find("a").focus(function(){a.isFocused=true;a.lastFocused=this}).blur(function(){if(this===a.lastFocused)a.isFocused=false})},_addMultiSelectListener:function(){function a(){b.update()}var b=this;this.element.bind("ncbilinkedselectspopulated",a)},_setUpKeyListeners:function(){if(!this._menukeylistener){var a=this;this._menukeylistener=function(b){a.isFocused&&a._moveMenuOption(b.keyCode,b)&&b.preventDefault()};xQuery(document).keydown(this._menukeylistener)}},_destroyKeyListeners:function(){if(this._menukeylistener){xQuery(document).unbind("keydown", -this._menukeylistener);this.activeOption=null}},_keys:{up:38,down:40,enter:13,space:32},destroy:function(){this._ul.remove();this.element.show()},_moveMenuOption:function(a,b){var c=b.ctrlKey||b.metaKey;b=b.shiftKey;var d=false;d=this._keys;switch(a){case d.up:this._moveSelection(-1,c,b);d=true;break;case d.down:this._moveSelection(1,c,b);d=true;break;case d.enter:d=false;break;case d.space:this._spaceClicked(c,b);d=true;break;default:d=false}return d},_moveSelection:function(a,b,c){var d=this.selectItems.find("a"); -if(this.activeOption===undefined||this.activeOption===null)this.activeOption=-1;else if(!this.isMultiple||!b&&!c||c&&this._previousIsCtrl)this._removePreviousSelection();var f=this.activeOption;this.activeOption+=a;a=d.length;if(this.activeOption<0)this.activeOption=0;else if(this.activeOption>=a)this.activeOption=a-1;a=this.activeOption;if(b)this._focusOption(a);else{if(this._previousIsCtrl&&c){this.selectedOptions.push(f);this.selectOption(f)}this.selectedOptions.push(a);this.selectOption(a)}this._previousIsCtrl= -b;this.previousShift=undefined},_spaceClicked:function(a,b){!this.isMultiple||b||(this.selectedOptions.length>1&&a||!this.element.find("option").eq(this.activeOption).prop("selected")?this._selectOptionClick(this.activeOption,{ctrlKey:true,shiftKey:false}):this._selectOptionClick(this.activeOption,{ctrlKey:false,shiftKey:false}))},_setUpClickListeners:function(){var a=this,b=this.selectItems.find("a");xQuery.browser.msie&&parseInt(xQuery.browser.version,10)<=7&&b.mousedown(function(){xQuery(this).removeAttr("href")}).mouseup(function(){xQuery(this).attr("href", -"#");this.blur();this.focus();return false});b.click(function(c){var d=xQuery(this).data("selindex");a._selectOptionClick(d,c);c.preventDefault()})},_selectOptionClick:function(a,b){if(this.isMultiple){var c=b.shiftKey;if(b.ctrlKey||b.metaKey){this.previousShift=undefined;if(this.element.find("option").eq(a).prop("selected")){this.unselectOption(a);return}}else if(c){if(this.activeOption!==-1){if(this.previousShift!==undefined){this.activeOption=this.previousShift;this._removePreviousSelection()}else this.previousShift= -this.activeOption;b=this.activeOption>a?this.activeOption:a;for(a=this.activeOption0){for(a=0;a'+ -this.options.gotoLinkText+""}if(this.options.gotoTopLink){c+='"}c+="
              ";a.not(this.options.headingExclude).addClass("ui-helper-clearfix").before(c)},_makeTopOfPageTOC:function(a,b,c){a=this._buildLis(a,this.options.tocTagName,true);b=this.options.smoothScroll? -" jig-ncbismoothscroll":"";var d=this.options.smoothScroll?" data-jigconfig=\"topHref: '"+this.options.gotoTopLinkHref+"'\"":"",f=this.options.tocTagName;xQuery("<"+f+' id="'+this.getTocId()+'" class="jig-ncbiinpagenav-toc-container'+b+'"'+d+">"+a+"").prependTo(c)},_makeGotoPoppers:function(a,b,c,d){b=this.getPopMenuId();a=this._buildLis(a,"ul",false);c=xQuery('
                "+a+"
              ").appendTo(c);a=this.element.find(".jig-ncbiinpagenav-goto-heading");d=a.eq(0);a=a.filter(":gt(0)"); -var f=this;d.ncbilinksmenu({destSelector:"#"+b,multipleHandlesSelector:a,openAtTarget:true,triggerPosition:"bottom left"}).bind("ncbilinksmenuopen",function(){f._inPageNavMenuOpen()}).bind("ncbilinksmenuclose",function(){f._inPageNavMenuClose()});this._firstAnchor=d;typeof ncbi!=="undefined"&&ncbi.sg&&ncbi.sg.scanLinks(c[0].getElementsByTagName("a"))},_buildLis:function(a,b,c){var d=xQuery.map(this.options.allHeadingLevels,function(u){return u.toLowerCase()}),f=this.options.headingLevel?this.options.headingLevel.toLowerCase(): -d[0],g=this.options.headingExclude,i=d.indexOf(f),e="",h=this.options.addNumbers;if(h)var j=[1];for(var k=0;ki&&k>0)for(;i
            • ";i+=1;h&&j.push(1)}else if(l==i&&k>0){e+="
            • ";if(h)j[j.length-1]+=1}else if(l0){for(;i>l;){e+="
            • ";i-=1;h&&j.pop()}if(h)j[j.length-1]+=1;e+="
            • "}else e+=k==0?"
            • ":"
            • ";e+=''+n.clone().find(this.options.inHeadingExclude).remove().end().text()+"";if(this.options.addNumbers&&!n.is(this.options.headingExclude)){i=xQuery.map(j,function(u){return""+u}).join(".");puncMark=this.options.puncMark;n.html(''+i+""+puncMark+" "+n.html())}i=l;if(k==a.length-1){for(;i>0;){e+="
            • ";i-=1}e+=""}}}return e},_inPageNav:function(){var a= -this.options.allHeadingLevels,b=this.options.headingLevel?this.options.headingLevel.toLowerCase():a[0];b=a.indexOf(b);a=this.element.find(a.slice(b).join(", "));b=this.element;var c=b.length?b:xQuery(document.body),d=this.options.smoothScroll?' class="jig-ncbismoothscroll" data-jigconfig="topHref: \''+this.options.gotoTopLinkHref+"'\"":"";if(this.options.gotoTopLink||this.options.gotoPoppers)this._makeGotoDiv(a,d);this.options.gotoPoppers&&this._makeGotoPoppers(a,b,c,d);this.options.topOfPageTOC&& -this._makeTopOfPageTOC(a,b,c)},getTocId:function(){typeof this.element.data("tocId")=="undefined"&&this.element.data("tocId",xQuery.ui.jig._generateId(this.widgetName));return this.element.data("tocId")},getPopMenuId:function(){typeof this.element.data("popMenuId")=="undefined"&&this.element.data("popMenuId",xQuery.ui.jig._generateId(this.widgetName));return this.element.data("popMenuId")},_removeGoto:function(){xQuery(".jig-ncbiinpagenav-goto-container").add("#"+this.getPopMenuId()).remove()},_removeTOC:function(){xQuery("jig-ncbiinpagenav-toc-container").add("#"+ -this.getTocId()).remove()},_inPageNavMenuResetCurrent:function(){var a=xQuery(this._firstAnchor).ncbilinksmenu("getDestElement");a=xQuery(a.data("attached-to")).parents(".jig-ncbiinpagenav");xQuery("#"+a.data("ncbiinpagenav").getPopMenuId()).find("a").show().end().find("."+a.ncbiinpagenav("option","currentHeadingClass")).remove()},_inPageNavMenuOpen:function(){var a=xQuery(this._firstAnchor).ncbilinksmenu("getDestElement"),b=xQuery(a.data("attached-to"));a=b.parents(".jig-ncbiinpagenav");b=b.parents(".jig-ncbiinpagenav-goto-container").next().text(); -var c=a.data("ncbiinpagenav").getPopMenuId();b=xQuery("#"+c).find('a:contains("'+b+'")');a=a.ncbiinpagenav("option","currentHeadingClass");this._inPageNavMenuResetCurrent();a=xQuery("").addClass(a).text(b.text());b.hide().before(a);this._addScrollListener()},_inPageNavMenuClose:function(){this._removeScrollListener();this._inPageNavMenuResetCurrent()},_scrollIntoView:function(){var a=0,b=null,c=window.location.hash.replace(".","\\.");if(c){var d=function(){var g=f.position().top;if(b!=g){window.scrollTo(0, -g);b=g}else{a++;a200&&a._firstAnchor.ncbilinksmenu("close")};xQuery(window).on("scroll",this._windowScrollFnc)},_removeScrollListener:function(){xQuery(window).off("scroll",this._windowScrollFnc);this._windowScrollFnc= -null}}); -xQuery.widget("ui.ncbispinbox",{options:{},_wrapper:null,_create:function(){if(this.element.attr("type")!="number")return false;this._convert()},destroy:function(){this._revert()},_convert:function(){if(!this._numberSupported()){var a=this;this.element.addClass("ui-ncbispinbox");this._wrapper=xQuery('').insertAfter(this.element);this.element.on("keydown.ncbi-spinbox-change",function(b){switch(b.keyCode){case 38:a.stepUp();break;case 40:a.stepDown();break; -default:return true}return false});this.element.on("blur.ncbi-spinbox-valid",function(){a._validate()});xQuery('').appendTo(this._wrapper).click(function(){a.stepUp()});xQuery('').appendTo(this._wrapper).click(function(){a.stepDown()})}},_revert:function(){if(!this._numberSupported()){this._wrapper.remove();this.element.off(".ncbi-spinbox-valid");this.element.off(".ncbi-spinbox-change")}},_numberSupported:function(){var a= -document.createElement("input");a.setAttribute("type","number");return a.type!=="text"},_stepValue:function(a){return typeof a!="undefined"&&a!=null?parseFloat(a):this.element.attr("step")?parseFloat(this.element.attr("step")):1},_validate:function(a){a=typeof a!="undefined"?a:parseFloat(this.element.val());if(isNaN(a)){this.element.val("");return false}var b=parseFloat(this.element.attr("min"));if(isNaN(b))b=0;else if(ac){this.element.val(c);return false}c=parseFloat(this.element.attr("step"));if(isNaN(c))c=1;var d=(a-b)%parseFloat(c);if(d>0){a=(Math.round(d/c)+Math.floor((a-b)/c))*c+b;this.element.val(a);return false}this.element.val(a);return true},stepUp:function(a){this._validate(this.valueAsNumber()+this._stepValue(a))},stepDown:function(a){this._validate(this.valueAsNumber()-this._stepValue(a))},valueAsNumber:function(){this._validate();var a=this.element.val();if(a=="")a=0;return parseFloat(a)}}); -xQuery.widget("ui.ncbiformvalidator",{options:{tags:"input, select",updateTitle:true},_create:function(){this._supportsHTML5Validation()||this._addValidator()},destroy:function(){_removeEvents()},_supportsHTML5Validation:function(){return typeof document.createElement("input").checkValidity=="function"},_addValidator:function(){var a=this;this.element.on("submit.ncbi-formvalidator",function(){var b=true;a.element.find(a.options.tags).each(function(){var c=xQuery(this),d=a._isInvalidField(c.attr("required"), -c.attr("type"),c.val(),c.attr("pattern"));a.options.updateTitle&&c.attr("title",d);d&&c.addClass("ui-ncbiformvalidator-error");if(d&&b){c.focus();c.ncbipopper({destText:d,openEvent:"none",closeEvent:"none",triggerPosition:"bottom center",destPosition:"top center",hasArrow:true,adjustFit:"autoAdjust",arrowDirection:"top",openAnimation:"none",closeAnimation:"none"});c.ncbipopper("open");xQuery(window).one("click",function(){c.ncbipopper("close")});b=false}});return b});this.element.find(this.options.tags).on("blur.ncbi-formvalidator", -function(){var b=xQuery(this);b.val();b.attr("type");var c=a._isInvalidField(b.attr("required"),b.attr("type"),b.val(),b.attr("pattern"));if(c){b.addClass("ui-ncbiformvalidator-error");a.options.updateTitle&&b.attr("title",c)}else{b.removeClass("ui-ncbiformvalidator-error");a.options.updateTitle&&b.attr("title","")}})},_isInvalidField:function(a,b,c,d){if(c!=null){if(c.length===0)if(!a||b=="submit"||b=="button"||b=="image")return null;else if(a)return"Please fill out this field";if(b=="email"&&!this._validatePattern(/((([a-zA-Z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-zA-Z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?/, -c))return"Please enter an e-mail address";if(b=="phone"&&!this._validatePattern(/([\+][0-9]{1,3}([ \.\-])?)?([\(]{1}[0-9]{3}[\)])?([0-9A-Z \.\-]{1,32})((x|ext|extension)?[0-9]{1,4}?)/,c))return"Please enter a phone number";if(b=="url"&&!this._validatePattern(/(https?|ftp):\/\/(((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?/, -c))return"Please enter a URL";if(b=="number"&&!this._validatePattern(/-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?/,c))return"Please enter a number";if(d&&!this._validatePattern(new RegExp(d),c))return"Invalid value";return null}},_validatePattern:function(a,b){if(!a)return true;return a.test(b)},_removeEvents:function(){this.element.off(".ncbi-formvalidator");this.element.find(this.options.tags).off(".ncbi-formvalidator")}}); -(function(){xQuery.widget("ui.ncbihelppopper",{options:{fullHelpUrl:null,isInline:false,destSelector:"",destText:null},_create:function(){this._createAndAppendLink();this._setPopperOptions();this._callAndModifyPopper()},_bulletHtml:'',_helpLinkHtml:'Help',_createAndAppendLink:function(){this.bulletSpan=xQuery(this._bulletHtml);this.helpLink=xQuery(this._helpLinkHtml);this.options.destSelector&&this.helpLink.attr("href", -this.options.destSelector);this.element.append(this.bulletSpan);this.element.append(this.helpLink)},_setPopperOptions:function(){var a=this.options;a.hasArrow=true;a.openEvent="click";a.closeEvent="click";a.openAnimation="none";a.closeAnimation="none";a.addCloseButton=true;a.cssClass="ui-ncbihelppopper";a.wrapElement=true;a.openAtTarget=true;if(a.isInline==true&&!a.destText){a.destPosition="top center";a.triggerPosition="bottom center";a.arrowDirection="top";if(!a.width)a.width="auto"}else{a.destPosition= -"center left";a.triggerPosition="center right";a.arrowDirection="left";if(!a.width)a.width="200px"}},_callAndModifyPopper:function(){var a=this.element.find("a.ui-ncbihelppopper-helplink");this.popper=a;var b=this.options;a.ncbipopper(b);a=a.ncbipopper("getDestElement");b.isInline==true&&!b.destText?a.addClass("ui-ncbihelppopper-inline"):a.addClass("shadow");a=a.find("div").first();a.addClass("ui-ncbihelppopper-inner");a=a.find(">:last-child");b.fullHelpLink?a.addClass("ui-ncbihelppopper-last"):a.css("margin-bottom", -"0");this._appendFullHelpLinkToPopper()},_appendFullHelpLinkToPopper:function(){if(this.options.fullHelpLink){var a="";this.popper.ncbipopper("getDestElement",true).append(a)}}})})(); -xQuery.widget("ui.ncbihelpwindow",{options:{status:false,toolbar:false,location:false,menubar:false,personalbar:false,resizable:true,scrollbars:true,height:700,width:600,windowName:null},_init:function(){},_create:function(){this._addClickEvent()},_addClickEvent:function(){var a=this;this.element.click(function(b){if(a._openWindow())return true;else{b.preventDefault();return false}})},_openWindow:function(){var a=this.options,b=this.element.prop("href"),c=xQuery(window).width(),d=xQuery(window).height(); -d=Math.floor((d-a.height)/2);c=Math.floor((c-a.width)/2);c="status="+(a.status?"yes":"no")+", toolbar="+(a.toolbar?"yes":"no")+", location="+(a.location?"yes":"no")+", menubar="+(a.menubar?"yes":"no")+", personalbar="+(a.personalbar?"yes":"no")+", resizable="+(a.resizable?"yes":"no")+", scrollbars="+(a.scrollbars?"yes":"no")+", height="+a.height+", width="+a.width+", top="+d+", left="+c+",screenX="+d+",screenY="+c;a=a.windowName||this.element.attr("target")||"_blank";a=a.replace(/\s/,"_");this.winPop&& -!this.winPop.closed&&this.winPop.focus();this.winPop=b=window.open(b,a,c);b=b===null||typeof b==="undefined";this._callStat(b);this._trigger("opened");return b},_callStat:function(a){typeof ncbi!=="undefined"&&ncbi.sg&&ncbi.sg.ping&&ncbi.sg.ping(this.element[0],"ncbihelpwindow","isBlocked="+a)}}); -xQuery.widget("ui.ncbiautofocus",{_create:function(){var a,b;if(xQuery.ui.ncbiautofocus.registeredElement){a="More than one element is registered for ncbiautofocus\n\tAlready Registered: \t"+this._outerHTML(xQuery.ui.ncbiautofocus.registeredElement)+"\n\tTrying to Register: \t\t"+this._outerHTML(this.element);if(typeof console!=="undefined"){b=console.error?"error":"log";console[b](a)}else throw a;}else{xQuery.ui.ncbiautofocus.registeredElement=this.element;this._addKeyDownEvent()}},_outerHTML:function(a){return xQuery("
              ").append(a.clone()).html()}, -destroy:function(){this._removeKeyDownEvent()},_doFocus:function(){var a=this.element,b=a[0],c=a.val().length;if(b.createTextRange){a=b.createTextRange();a.moveStart("character",c);a.collapse();a.select()}else if(b.setSelectionRange){a.focus();b.setSelectionRange(c,c)}else a.focus()},_addKeyDownEvent:function(){var a=this;this._interceptKeydown=function(b){var c=b.srcElement||b.target,d=b.keyCode||b.which,f=b.keyCode==86&&(b.ctrlKey||b.metaKey);if((!(b.ctrlKey||b.altKey||b.metaKey)||f)&&(d>=48&&d<= -90||d>=96&&d<=111)&&xQuery(c).not(":input,a").length===1)a._doFocus(b)};this._interceptPaste=function(b){xQuery(b.srcElement||b.target).not(":input, a").length===1&&a._doFocus(b)};xQuery(document).on("keydown",this._interceptKeydown);xQuery(document).on("paste beforepaste",this._interceptPaste)},_removeKeyDownEvent:function(){this._documentKeydown&&xQuery(document).off("keydown",this._interceptKeydown)}});xQuery.ui.ncbiautofocus.registeredElement=null; -(function(){xQuery.widget("ui.ncbisetswitch",{options:{webservice:null,destSelector:null,localJSON:null,manageCollectionsUrl:null,createCollectionUrl:null,defaultActive:false},_create:function(){this._wrapElem();this._createStar();this._createArrow();this._attachLinksMenu();this._createActionListItem();this._positionActionListItem();this._attachLinkEvent();this._addToggleStarClick()},_wrapElem:function(){this.wrapper=this.element.wrap("
              ").parent()},_unwrapElem:function(){this.element.unwrap()}, -_createStar:function(){this.element.prepend("");this.element.addClass("ui-ncbisetswitch-hasStar");this.options.defaultActive===true&&this.element.find(".star").addClass("active")},_destroyStar:function(){this.element.find(".star").remove();this.element.removeClass("ui-ncbisetswitch-hasStar")},_createArrow:function(){this.downButton=xQuery("View more options").insertAfter(this.element); -this.downButton.prev().hasClass("ltd-hover")&&this.downButton.addClass("ltd-hover")},_destroyArrow:function(){this.downButton.remove()},_attachLinksMenu:function(){this.wrapper.ncbilinksmenu({webservice:this.options.webservice,openAnimationTime:150,destSelector:this.options.destSelector,localJSON:this.options.localJSON,triggerPosition:"bottom left",wrapElement:true,ignoreDefaultTrigger:true,closeOnSelect:false});var a=this.wrapper.ncbilinksmenu("getDestElement");a.addClass("ui-ncbisetswitch-popper"); -a.find(">ul:first-child").addClass("ui-ncbisetswitch-options")},_destroyLinksMenu:function(){var a=this.wrapper.ncbilinksmenu("getDestElement");a.removeClass("ui-ncbisetswitch-popper");a.find(">ul:first-child").removeClass("ui-ncbisetswitch-options");this.wrapper.ncbilinksmenu("destroy")},_hideList:function(){this.options.destSelector&&xQuery(this.options.destSelector).hide()},_hideAccessible:function(){var a=this.element.prev("a.ui-helper-hidden-accessible");a.prev("p.ui-helper-hidden-accessible").remove(); -a.remove()},destroy:function(){this._destroyLinksMenu();this._unwrapElem();this._destroyStar();this._destroyArrow();this._destroyActionListItem();this._detachLinkEvent();this._removeToggleStarClick();this._hideList();this._hideAccessible()},_createActionListItem:function(){xQuery.ui.ncbisetswitch._globalActionsList={};var a=this.wrapper.ncbilinksmenu("getDestElement").children(":first");a={actionList:xQuery("
                ").appendTo(a.parent())};a.createCollection=xQuery("
              • Create collection...
              • ").appendTo(a.actionList); -a.managecollections=xQuery("
              • Manage collections...
              • ").appendTo(a.actionList);this._gol=a},_destroyActionListItem:function(){this._gol.actionList.remove()},_positionActionListItem:function(){if(this._gol.activeElement!==this.element){var a=this.options.manageCollectionsUrl!==null?"block":"none",b=this.options.createCollectionUrl!==null?"block":"none",c=a==="block"||b==="block"?"block":"none";xQuery(this._gol.createCollection).css("display", -b).children("a:first").attr("href",this.options.createCollectionUrl);xQuery(this._gol.managecollections).css("display",a).children("a:first").attr("href",this.options.manageCollectionsUrl);xQuery(this._gol.actionsItem).css("display",c)}else this._gol.activeElement=this.element},_addToggleStarClick:function(){var a=this;this._makingMainSelectionClickFunc=function(){a._makingMainSelection()};this.element.on("mousedown keydown",this._makingMainSelectionClickFunc);this._downButtonKeydownFunc=function(b){(b|| -window.event).keyCode===40&&a.downButton.mousedown().click()};this._downButtonMousedownFunc=function(b){a._arrowClickedSelection(b,this)};this.downButton.keydown(this._keydownFunc).on("mousedown",this._mousedownFunc);this._toggleStarSubClickFunc=function(b){a._toggleStarSub(b,b.target)};this._setswitchOptionsMousedownFunc=function(){var b=xQuery(this);a._makingSubSelection(b,b.parent())};this.wrapper.ncbilinksmenu("getDestElement").find(".ui-ncbisetswitch-options a").on("mousedown keydown",this._setswitchOptionsMousedownFunc); -typeof ncbi!=="undefined"&&ncbi.sg&&ncbi.sg.scanLinks([this.downButton[0],this.element[0]])},_removeToggleStarClick:function(){this.element.unbind("mousedown",this._makingMainSelectionClickFunc).unbind("keydown",this._makingMainSelectionClickFunc);this.downButton.unbind("keydown",this._keydownFunc).unbind("mousedown",this._mousedownFunc);this.wrapper.find(".ui-ncbisetswitch-options a").unbind("mousedown",this._setswitchOptionsMousedownFunc).unbind("keydown",this._setswitchOptionsMousedownFunc)},_arrowClickedSelection:function(a, -b){a=this.wrapper.ncbilinksmenu("getDestElement").is(":visible")?"closed":"opened";xQuery(b).prop("ref","jigwidget=ncbisetswitch&item=downarrowclicked&action="+a)},_makingMainSelection:function(){this.element.prop("ref","jigwidget=ncbisetswitch&item=mainlink&action="+(this.element.find("span.star").hasClass("active")?"unselected":"selected"))},_makingSubSelection:function(a,b){b=b.hasClass("starred")?"unselected":"selected";a.prop("ref","jigwidget=ncbisetswitch&item=sublink&action="+b)},_attachLinkEvent:function(){this._linkEventFunc= -function(a){a.preventDefault();a.stopPropagation()};this.element.click(this._linkEventFunc)},_detachLinkEvent:function(){this.element.unbind("click",this._linkEventFunc)}})})(); -xQuery.widget("ui.ncbihistogram",{options:{data:null,barWidth:5,barSpacing:1,useLogScale:false,selected:null,sortData:true,isNumeric:true,convertYYYYMMtoYYYY:true,textDefault:"",textSelected:"Selected",textTooltip:" {label} - {count} items",destSelector:null,enableZeroCountSelection:false},_create:function(){this._addClasses();this._setUpData();this._createTooltip();this._setupPositionScroll();this._addEvents();this._setBarWidths()},_addClasses:function(){this.element.addClass("ui-ncbihistogram")}, -_formatDataFromHTMLSource:function(a){var b=xQuery(a),c=b.find("li");if(c.length===0){console.warn("Could not locate any lis for the ncbihistogram. destSelector: "+a);return[]}var d={},f=this.options.convertYYYYMMtoYYYY;c.each(function(){var i=this.getAttribute("value");i=f&&i!==null&&i.toString().length>4?i.toString().substr(0,4):i;var e=d[i],h=parseInt(this.innerHTML,10);if(e===undefined)d[i]=h;else d[i]+=h});a=[];for(var g in d)a.push({textlabel:parseInt(g,10),count:d[g]});b.remove();return a}, -_makeLists:function(){var a=this.options.data,b=this.options.destSelector;if(b)a=this._formatDataFromHTMLSource(b);if(a.length===0)if(typeof console!=="undefined"){console.warn("There is no data set for ncbihistogram. Length is zero.");console.info(this.element);this.element.hide();return false}var c=function(p){p+="";var o=p.split(".");p=o[0];o=o.length>1?"."+o[1]:"";for(var v=/(\d+)(\d{3})/;v.test(p);)p=p.replace(v,"$1,$2");return p+o},d=this.element.find(".ui-ncbihistogram-display-area").height(), -f=this.options.useLogScale,g=this.options.selected,i=this.options.isNumeric,e=0,h=this.options.textTooltip,j=null;j=this.options.sortData?xQuery.merge([],a).sort(function(p,o){return p.textlabel===o.textlabel?0:p.textlabel>o.textlabel?1:-1}):a;var k=false,l=function(p,o,v){if(p===null)p=o-1;for(p=p+1;p<=o;p++){if(p%10===0||!k)n(Math.floor(p/10)*10);r(p,p===o?v:0)}},n=function(p){k&&u();m.push("
              • "+p+"

                  ");k=true},u=function(){m.push("
              • ")},r=function(p,o){e++;var v=null;v=f?o=== -0?0:Math.ceil(d*Math.log(o)/Math.log(q)):Math.ceil(d*o/q);if(o>0&&v<3)v=3;var x=d-v;o=c(o.toString());var w=' title="'+h.replace(/\{label\}/gi,p).replace(/\{count\}/gi,o)+'"';m.push('
              • Year "+p+" - "+o+" items
              • ")},m=[],q=j[0].count;xQuery.map(j,function(p){if(q"+m.join("")+""},_makeArrows:function(){var a=this;this._controlBar=xQuery('
                ');this._arrow_right=xQuery("
                ").addClass("ui-ncbihistogram-right").html("Scroll right...").appendTo(this._controlBar).click(function(){a.moveRight()});this._arrow_left=xQuery("
                ").addClass("ui-ncbihistogram-left").html("Scroll left...").appendTo(this._controlBar).click(function(){a.moveLeft()}); -this._text_hint=xQuery("
                ").addClass("ui-ncbihistogram-text").html(this.options.textDefault).appendTo(this._controlBar);this._controlBar.appendTo(this.element);this._setText()},_createElements:function(){xQuery('
                ').appendTo(this.element).html(this._makeLists());this._makeArrows()},_setUpData:function(){if(this.options.data||this.options.destSelector)this._createElements();else if(typeof console!=="undefined"&&console.error){console.error("No data source set for ncbihistogram"); -console.info(this.element)}},_setupPositionScroll:function(){if(xQuery.ui.jig.hasOnloadFired)this._positionScroll();else{var a=this;xQuery(window).load(function(){a._positionScroll()})}},_positionScroll:function(){var a=this.element.find(".ui-ncbihistogram-display-area"),b=this.element.find("ol").eq(0);b=b.width()>a.width()?b.outerWidth():0;var c=this._getSelectedYear();if(c.length===1){b=a.offset().left;var d=c.offset().left;a.prop("scrollLeft");c=a.width();b=d-b;b=b<0?-b+c/2:b-c/2}a.scrollLeft(b); -this._enableDisableArrows(a.scrollLeft())},moveLeft:function(){this.moveScroll(-1)},moveRight:function(){this.moveScroll(1)},moveScroll:function(a){var b=this.element.find(".ui-ncbihistogram-display-area"),c=b.width(),d=this.element.find("ol").width(),f=Math.ceil(d/3);if(c>=d)return false;if(f<100)f=100;else if(f>c)f=c;d=b.scrollLeft()+a*f;if(d<0)d=0;if(typeof ncbi!=="undefined"&&ncbi.sg)ncbi.sg.ping({jsevent:"histogramScroll",direction:a===1?"right":"left",startPosition:b.scrollLeft(),endPosition:d, -scrollDist:f,wrapWidth:c});b.animate({scrollLeft:d+"px"},300);this._enableDisableArrows(d)},_enableDisableArrows:function(a){var b=this.element.find(".ui-ncbihistogram-display-area").width(),c=this.element.find("ol").eq(0).width();b=a+b>=c-1?"addClass":"removeClass";this._arrow_left[a===0?"addClass":"removeClass"]("ui-ncbihistogram-left-disabled");this._arrow_right[b]("ui-ncbihistogram-right-disabled")},_addEvents:function(){var a=this;this.element.on("mouseleave",function(){a._hideTooltips()}).on("mouseover", -function(b){a._positionTooltip(b)}).find(this.options.isNumeric?"ol ol li":"li").on("click",function(b){a._makeSelection(b,this)})},_makeSelection:function(a,b){var c=xQuery(b).find("a");a.preventDefault();var d,f=c.data("label")||c.attr("data-label"),g=c.data("count")||c.attr("data-count");if(parseInt(g,10)===0)this._zeroNotify(f);else{c.toggleClass("selected");d=c.hasClass("selected")?"selectionmade":"selectionremoved";f=c.data("label")||c.attr("data-label");g=c.data("count")||c.attr("data-count"); -b&&b.tagName==="LI"&&typeof ncbi!=="undefined"&&ncbi.sg&&ncbi.sg.ping(c[0],a,"click",{histogramclick:true,barLabel:f,barCount:g,triggerAction:d});this._trigger(d,null,[{value:f,count:g}]);this._trigger("change",null,[{value:d==="selectionmade"?f:null,count:d==="selectionmade"?g:null}]);this._undoSelections(c[0]);this._setText()}},_undoSelections:function(a){this._getSelectedYear().not(a).removeClass("selected")},_getSelectedYear:function(){return this.element.find("a.selected")},getSelectedValue:function(){var a= -this._getSelectedYear();if(a.length===0)return null;else{var b=a.data("label")||a.attr("data-label");a=a.data("count")||a.attr("data-count");return{value:b,count:a}}},setSelectedValue:function(a){var b=false;this.element.find("li a").each(function(){var c=xQuery(this);if(c.data("label")==a){b=true;c.click();return false}});if(b){this.element.find(".ui-ncbihistogram-display-area").scrollLeft(0);this._positionScroll()}},_setText:function(a){var b=this._getSelectedYear(),c=this.options.textDefault;if(a)c= -a;else if(b.length>0)c=this.options.textSelected+" "+b.prop("title");this._text_hint.html(c)},_setBarWidths:function(){var a=this.element.find(".ui-ncbihistogram-display-area"),b=this.element.find("div>ol"),c=a.width();if(c>b.width()){var d=b.find("a");a=Math.floor(a.width()/d.length*2)/2;d.css({width:a-1+"px","margin-right":"1px"}).last().css("margin-right","0px");d=Math.ceil(c-a*d.length-1)/2;b.width(c-1).css("padding-left",d+"px")}},_createTooltip:function(){var a=xQuery(".grid").eq(0);if(a.length=== -0)a=xQuery(document.body);this._tooltip_total=xQuery('
                ').appendTo(a)},_positionTooltip:function(a){a=xQuery(a.target||a.srcElement);a=a.length===1&&a[0].nodeName==="LI"?a.find("a"):a;if(a.length===1&&this._tooltip_total){var b=a.data("count"),c=a.data("label");if(c===undefined)this._tooltip_total.hide();else try{this._tooltip_total.show().html(c+": "+b).position({my:"right top",of:a.parent(),at:"left top",collision:"fit"})}catch(d){this._tooltip_total.hide()}}}, -_hideTooltips:function(){this._tooltip_total.hide().html("")},_zeroNotify:function(a){var b=this;this._setText("No items found for "+a.toString());this._text_hint.stop().delay(1E3).fadeOut(300,function(){b._setText()}).fadeIn(300)}}); -xQuery.widget("ui.ncbiexternallink",{options:{pop:"fit"},_otherElems:null,_create:function(){this._createMessage();this._setPopper();this._addDynamicLinkHandler()},_reALL:/^(.{3,5}:)?\/\/(([^/]+).)?(apple|facebook|google|twitter|youtube)\.com/i,_addDynamicLinkHandler:function(){var a=this;xQuery("body").on("mouseover","a[href]",function(b){b=xQuery(b.currentTarget);if(a._reALL.test(b[0].href)&&!b.is(a._otherElems))if(!b.data("ncbipopper")){a._createPopper(b,"",a._popperContent);a._setTarget(b);b.trigger("mouseover")}})}, -_findLinks:function(a){var b=this._reALL;return a.find("a[href]").filter(function(){return b.test(this.href)})},_disclaimerHTML:'
                External link. Please review our privacy policy.
                ',_createMessage:function(){var a=xQuery("div.grid").eq(0);if(a.length===0)a=xQuery(document.body).eq(0);this._popperContent=xQuery(this._disclaimerHTML).appendTo(a)},_setTarget:function(a){a.each(function(){if(!this.target)this.target="_blank"})}, -_createPopper:function(a,b,c){var d="top",f="bottom center",g="top center";if(this.options.pop==="top"){d="bottom";f="top center";g="bottom center"}else if(this.options.pop==="fit"){d="left";g=f="middle auto"}else if(this.options.pop==="fitTop"){d="left";g=f="auto center"}a.ncbipopper({multipleHandlesSelector:b,openAtTarget:true,destSelector:c,isDestElementCloseClick:false,openAnimation:"none",closeAnimation:"none",isTriggerElementCloseClick:false,triggerPosition:f,destPosition:g,hasArrow:true,arrowDirection:d})}, -_setPopper:function(){var a=this._findLinks(xQuery("body")),b=this._firstElem=a.eq(0),c=a.slice(1);this._otherElems=c;this._createPopper(b,c,this._popperContent);this._setTarget(a);if(typeof ncbi!=="undefined"&&ncbi.sg&&ncbi.sg.scanLinks){a=this._popperContent.find("a")[0];ncbi.sg.scanLinks(a)}},destroy:function(){this._firstElem.ncbipopper("destroy");this._popperContent.remove()}}); -xQuery.widget("ui.ncbiactivevalidation",{options:{destElement:null,delay:400,validationFunction:null,validatingMsg:null,errorBorder:true},_create:function(){this._addEvents();this._addClasses();this.element.val().length>0&&this.runCheck(true)},runCheck:function(a){this._removeTimer();if(this.element.val().length===0)this.displayMessage(null,"");else if(this.lastValue!==this.element.val()){var b=this.options.validatingMsg;b?this.displayMessage("checking",b):this.displayMessage(null,"");a?this._callValidation(): -this._setTimer()}},_removeTimer:function(){this._validationTimer&&window.clearTimeout(this._validationTimer)},_setTimer:function(){var a=this;this._validationTimer=window.setTimeout(function(){a._callValidation()},this.options.delay)},_callValidation:function(){this.lastValue=this.element.val();if(this.lastValue.length===0)this.displayMessage(null,"");else{var a=this.options.validationFunction;if(a){if(typeof a==="string"){a=xQuery.ui.jig._getFncFromStr(a);var b=this;if(!a){this.count=a=(this.count|| -0)+1;if(a>100){console.warn("Validation Function not find "+this.options.validationFunction);a=function(){this.displayMessage(null,"")}}else{window.setTimeout(function(){b._callValidation()},100);return}}this.options.validationFunction=a}a.call(this)}else console.error("Validation Function not set for ncbiactivevalidation")}},_keyUp:function(){this.runCheck()},_paste:function(){this.runCheck()},_blur:function(){this.runCheck(true)},_addEvents:function(){var a=this;this._keyupFnc=function(){a._keyUp()}; -this._pasteFnc=function(){a._paste()};this._blurFnc=function(){a._blur()};this.element.on("keyup",this._keyupFnc).on("paste",this._pasteFnc).on("blur",this._blurFnc)},_addClasses:function(){var a=this.options.destElement,b=xQuery(a);a||console.error("destElement is not set for ncbiactivevalidation");b.addClass("ncbiactivevalidation_msg")},_removeClasses:function(){outElem.removeClass("ncbiactivevalidation_msg");this._lastTypeClass&&outElem.removeClass(this._lastTypeClass)},_removeEvents:function(){this.element.off("keyup", -this._keyupFnc).off("paste",this._pasteFnc).off("blur",this._blurFnc)},destroy:function(){this._removeTimer();this._removeEvents();this._removeClasses()},displayMessage:function(a,b){this._trigger("result","x",{type:a,message:b});var c=xQuery(this.options.destElement),d=a&&a.length>0?"ncbiactivevalidation_msg_"+a:null;c.html(b);d&&c.addClass(d);this._lastTypeClass&&this._lastTypeClass!==d&&c.removeClass(this._lastTypeClass);this._lastTypeClass=d;this._last=a;if(this.options.errorBorder)if(a=="valid")this.element.removeClass("ncbiactivevalidation_el_error"); -else a=="error"&&this.element.addClass("ncbiactivevalidation_el_error")},getValidationStatus:function(){return this._last||null}}); -(function(a,b){function c(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass= -"ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su", -"Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10", -minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false,disabled:false};a.extend(this._defaults,this.regional[""]);this.dpDiv=d(a('
                '))}function d(e){return e.bind("mouseout", -function(h){h=a(h.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");h.length&&h.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(h){h=a(h.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");if(!(a.datepicker._isDisabledDatepicker(i.inline?e.parent()[0]:i.input[0])||!h.length)){h.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"); -h.addClass("ui-state-hover");h.hasClass("ui-datepicker-prev")&&h.addClass("ui-datepicker-prev-hover");h.hasClass("ui-datepicker-next")&&h.addClass("ui-datepicker-next-hover")}})}function f(e,h){a.extend(e,h);for(var j in h)if(h[j]==null||h[j]==b)e[j]=h[j];return e}a.extend(a.ui,{datepicker:{version:"1.8.17"}});var g=(new Date).getTime(),i;a.extend(c.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv}, -setDefaults:function(e){f(this._defaults,e||{});return this},_attachDatepicker:function(e,h){var j=null;for(var k in this._defaults){var l=e.getAttribute("date:"+k);if(l){j=j||{};try{j[k]=eval(l)}catch(n){j[k]=l}}}k=e.nodeName.toLowerCase();l=k=="div"||k=="span";if(!e.id){this.uuid+=1;e.id="dp"+this.uuid}var u=this._newInst(a(e),l);u.settings=a.extend({},h||{},j||{});if(k=="input")this._connectDatepicker(e,u);else l&&this._inlineDatepicker(e,u)},_newInst:function(e,h){return{id:e[0].id.replace(/([^A-Za-z0-9_-])/g, -"\\\\$1"),input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:h,dpDiv:!h?this.dpDiv:d(a('
                '))}},_connectDatepicker:function(e,h){var j=a(e);h.append=a([]);h.trigger=a([]);if(!j.hasClass(this.markerClassName)){this._attachments(j,h);j.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker", -function(k,l,n){h.settings[l]=n}).bind("getData.datepicker",function(k,l){return this._get(h,l)});this._autoSize(h);a.data(e,"datepicker",h);h.settings.disabled&&this._disableDatepicker(e)}},_attachments:function(e,h){var j=this._get(h,"appendText"),k=this._get(h,"isRTL");h.append&&h.append.remove();if(j){h.append=a(''+j+"");e[k?"before":"after"](h.append)}e.unbind("focus",this._showDatepicker);h.trigger&&h.trigger.remove();j=this._get(h,"showOn");if(j== -"focus"||j=="both")e.focus(this._showDatepicker);if(j=="button"||j=="both"){j=this._get(h,"buttonText");var l=this._get(h,"buttonImage");h.trigger=a(this._get(h,"buttonImageOnly")?a("").addClass(this._triggerClass).attr({src:l,alt:j,title:j}):a('').addClass(this._triggerClass).html(l==""?j:a("").attr({src:l,alt:j,title:j})));e[k?"before":"after"](h.trigger);h.trigger.click(function(){a.datepicker._datepickerShowing&&a.datepicker._lastInput==e[0]?a.datepicker._hideDatepicker(): -a.datepicker._showDatepicker(e[0]);return false})}},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var h=new Date(2009,11,20),j=this._get(e,"dateFormat");if(j.match(/[DM]/)){var k=function(l){for(var n=0,u=0,r=0;rn){n=l[r].length;u=r}return u};h.setMonth(k(this._get(e,j.match(/MM/)?"monthNames":"monthNamesShort")));h.setDate(k(this._get(e,j.match(/DD/)?"dayNames":"dayNamesShort"))+20-h.getDay())}e.input.attr("size",this._formatDate(e,h).length)}},_inlineDatepicker:function(e, -h){var j=a(e);if(!j.hasClass(this.markerClassName)){j.addClass(this.markerClassName).append(h.dpDiv).bind("setData.datepicker",function(k,l,n){h.settings[l]=n}).bind("getData.datepicker",function(k,l){return this._get(h,l)});a.data(e,"datepicker",h);this._setDate(h,this._getDefaultDate(h),true);this._updateDatepicker(h);this._updateAlternate(h);h.settings.disabled&&this._disableDatepicker(e);h.dpDiv.css("display","block")}},_dialogDatepicker:function(e,h,j,k,l){e=this._dialogInst;if(!e){this.uuid+= -1;this._dialogInput=a('');this._dialogInput.keydown(this._doKeyDown);a("body").append(this._dialogInput);e=this._dialogInst=this._newInst(this._dialogInput,false);e.settings={};a.data(this._dialogInput[0],"datepicker",e)}f(e.settings,k||{});h=h&&h.constructor==Date?this._formatDate(e,h):h;this._dialogInput.val(h);this._pos=l?l.length?l:[l.pageX,l.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/ -2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");e.settings.onSelect=j;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);a.blockUI&&a.blockUI(this.dpDiv);a.data(this._dialogInput[0],"datepicker",e);return this},_destroyDatepicker:function(e){var h= -a(e),j=a.data(e,"datepicker");if(h.hasClass(this.markerClassName)){var k=e.nodeName.toLowerCase();a.removeData(e,"datepicker");if(k=="input"){j.append.remove();j.trigger.remove();h.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(k=="div"||k=="span")h.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(e){var h=a(e),j=a.data(e,"datepicker");if(h.hasClass(this.markerClassName)){var k= -e.nodeName.toLowerCase();if(k=="input"){e.disabled=false;j.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(k=="div"||k=="span"){h=h.children("."+this._inlineClass);h.children().removeClass("ui-state-disabled");h.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=a.map(this._disabledInputs,function(l){return l==e?null:l})}},_disableDatepicker:function(e){var h=a(e),j=a.data(e, -"datepicker");if(h.hasClass(this.markerClassName)){var k=e.nodeName.toLowerCase();if(k=="input"){e.disabled=true;j.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(k=="div"||k=="span"){h=h.children("."+this._inlineClass);h.children().addClass("ui-state-disabled");h.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=a.map(this._disabledInputs,function(l){return l== -e?null:l});this._disabledInputs[this._disabledInputs.length]=e}},_isDisabledDatepicker:function(e){if(!e)return false;for(var h=0;h-1}},_doKeyUp:function(e){e=a.datepicker._getInst(e.target);if(e.input.val()!=e.lastVal)try{if(a.datepicker.parseDate(a.datepicker._get(e,"dateFormat"),e.input?e.input.val():null,a.datepicker._getFormatConfig(e))){a.datepicker._setDateFromField(e);a.datepicker._updateAlternate(e);a.datepicker._updateDatepicker(e)}}catch(h){a.datepicker.log(h)}return true},_showDatepicker:function(e){e=e.target||e;if(e.nodeName.toLowerCase()!="input")e=a("input", -e.parentNode)[0];if(!(a.datepicker._isDisabledDatepicker(e)||a.datepicker._lastInput==e)){var h=a.datepicker._getInst(e);if(a.datepicker._curInst&&a.datepicker._curInst!=h){a.datepicker._curInst.dpDiv.stop(true,true);h&&a.datepicker._datepickerShowing&&a.datepicker._hideDatepicker(a.datepicker._curInst.input[0])}var j=a.datepicker._get(h,"beforeShow");j=j?j.apply(e,[e,h]):{};if(j!==false){f(h.settings,j);h.lastVal=null;a.datepicker._lastInput=e;a.datepicker._setDateFromField(h);if(a.datepicker._inDialog)e.value= -"";if(!a.datepicker._pos){a.datepicker._pos=a.datepicker._findPos(e);a.datepicker._pos[1]+=e.offsetHeight}var k=false;a(e).parents().each(function(){k|=a(this).css("position")=="fixed";return!k});if(k&&a.browser.opera){a.datepicker._pos[0]-=document.documentElement.scrollLeft;a.datepicker._pos[1]-=document.documentElement.scrollTop}j={left:a.datepicker._pos[0],top:a.datepicker._pos[1]};a.datepicker._pos=null;h.dpDiv.empty();h.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});a.datepicker._updateDatepicker(h); -j=a.datepicker._checkOffset(h,j,k);h.dpDiv.css({position:a.datepicker._inDialog&&a.blockUI?"static":k?"fixed":"absolute",display:"none",left:j.left+"px",top:j.top+"px"});if(!h.inline){j=a.datepicker._get(h,"showAnim");var l=a.datepicker._get(h,"duration"),n=function(){var u=h.dpDiv.find("iframe.ui-datepicker-cover");if(u.length){var r=a.datepicker._getBorders(h.dpDiv);u.css({left:-r[0],top:-r[1],width:h.dpDiv.outerWidth(),height:h.dpDiv.outerHeight()})}};h.dpDiv.zIndex(a(e).zIndex()+1);a.datepicker._datepickerShowing= -true;a.effects&&a.effects[j]?h.dpDiv.show(j,a.datepicker._get(h,"showOptions"),l,n):h.dpDiv[j||"show"](j?l:null,n);if(!j||!l)n();h.input.is(":visible")&&!h.input.is(":disabled")&&h.input.focus();a.datepicker._curInst=h}}}},_updateDatepicker:function(e){this.maxRows=4;var h=a.datepicker._getBorders(e.dpDiv);i=e;e.dpDiv.empty().append(this._generateHTML(e));var j=e.dpDiv.find("iframe.ui-datepicker-cover");j.length&&j.css({left:-h[0],top:-h[1],width:e.dpDiv.outerWidth(),height:e.dpDiv.outerHeight()}); -e.dpDiv.find("."+this._dayOverClass+" a").mouseover();h=this._getNumberOfMonths(e);j=h[1];e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");j>1&&e.dpDiv.addClass("ui-datepicker-multi-"+j).css("width",17*j+"em");e.dpDiv[(h[0]!=1||h[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");e==a.datepicker._curInst&&a.datepicker._datepickerShowing&&e.input&&e.input.is(":visible")&& -!e.input.is(":disabled")&&e.input[0]!=document.activeElement&&e.input.focus();if(e.yearshtml){var k=e.yearshtml;setTimeout(function(){k===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml);k=e.yearshtml=null},0)}},_getBorders:function(e){var h=function(j){return{thin:1,medium:2,thick:3}[j]||j};return[parseFloat(h(e.css("border-left-width"))),parseFloat(h(e.css("border-top-width")))]},_checkOffset:function(e,h,j){var k=e.dpDiv.outerWidth(),l=e.dpDiv.outerHeight(), -n=e.input?e.input.outerWidth():0,u=e.input?e.input.outerHeight():0,r=document.documentElement.clientWidth+a(document).scrollLeft(),m=document.documentElement.clientHeight+a(document).scrollTop();h.left-=this._get(e,"isRTL")?k-n:0;h.left-=j&&h.left==e.input.offset().left?a(document).scrollLeft():0;h.top-=j&&h.top==e.input.offset().top+u?a(document).scrollTop():0;h.left-=Math.min(h.left,h.left+k>r&&r>k?Math.abs(h.left+k-r):0);h.top-=Math.min(h.top,h.top+l>m&&m>l?Math.abs(l+u):0);return h},_findPos:function(e){for(var h= -this._get(this._getInst(e),"isRTL");e&&(e.type=="hidden"||e.nodeType!=1||a.expr.filters.hidden(e));)e=e[h?"previousSibling":"nextSibling"];e=a(e).offset();return[e.left,e.top]},_hideDatepicker:function(e){var h=this._curInst;if(!(!h||e&&h!=a.data(e,"datepicker")))if(this._datepickerShowing){e=this._get(h,"showAnim");var j=this._get(h,"duration"),k=this,l=function(){a.datepicker._tidyDialog(h);k._curInst=null};a.effects&&a.effects[e]?h.dpDiv.hide(e,a.datepicker._get(h,"showOptions"),j,l):h.dpDiv[e== -"slideDown"?"slideUp":e=="fadeIn"?"fadeOut":"hide"](e?j:null,l);e||l();this._datepickerShowing=false;if(e=this._get(h,"onClose"))e.apply(h.input?h.input[0]:null,[h.input?h.input.val():"",h]);this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(a.blockUI){a.unblockUI();a("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(a.datepicker._curInst){e= -a(e.target);var h=a.datepicker._getInst(e[0]);if(e[0].id!=a.datepicker._mainDivId&&e.parents("#"+a.datepicker._mainDivId).length==0&&!e.hasClass(a.datepicker.markerClassName)&&!e.hasClass(a.datepicker._triggerClass)&&a.datepicker._datepickerShowing&&!(a.datepicker._inDialog&&a.blockUI)||e.hasClass(a.datepicker.markerClassName)&&a.datepicker._curInst!=h)a.datepicker._hideDatepicker()}},_adjustDate:function(e,h,j){e=a(e);var k=this._getInst(e[0]);if(!this._isDisabledDatepicker(e[0])){this._adjustInstDate(k, -h+(j=="M"?this._get(k,"showCurrentAtPos"):0),j);this._updateDatepicker(k)}},_gotoToday:function(e){e=a(e);var h=this._getInst(e[0]);if(this._get(h,"gotoCurrent")&&h.currentDay){h.selectedDay=h.currentDay;h.drawMonth=h.selectedMonth=h.currentMonth;h.drawYear=h.selectedYear=h.currentYear}else{var j=new Date;h.selectedDay=j.getDate();h.drawMonth=h.selectedMonth=j.getMonth();h.drawYear=h.selectedYear=j.getFullYear()}this._notifyChange(h);this._adjustDate(e)},_selectMonthYear:function(e,h,j){e=a(e);var k= -this._getInst(e[0]);k["selected"+(j=="M"?"Month":"Year")]=k["draw"+(j=="M"?"Month":"Year")]=parseInt(h.options[h.selectedIndex].value,10);this._notifyChange(k);this._adjustDate(e)},_selectDay:function(e,h,j,k){var l=a(e);if(!(a(k).hasClass(this._unselectableClass)||this._isDisabledDatepicker(l[0]))){l=this._getInst(l[0]);l.selectedDay=l.currentDay=a("a",k).html();l.selectedMonth=l.currentMonth=h;l.selectedYear=l.currentYear=j;this._selectDate(e,this._formatDate(l,l.currentDay,l.currentMonth,l.currentYear))}}, -_clearDate:function(e){e=a(e);this._getInst(e[0]);this._selectDate(e,"")},_selectDate:function(e,h){e=this._getInst(a(e)[0]);h=h!=null?h:this._formatDate(e);e.input&&e.input.val(h);this._updateAlternate(e);var j=this._get(e,"onSelect");if(j)j.apply(e.input?e.input[0]:null,[h,e]);else e.input&&e.input.trigger("change");if(e.inline)this._updateDatepicker(e);else{this._hideDatepicker();this._lastInput=e.input[0];typeof e.input[0]!="object"&&e.input.focus();this._lastInput=null}},_updateAlternate:function(e){var h= -this._get(e,"altField");if(h){var j=this._get(e,"altFormat")||this._get(e,"dateFormat"),k=this._getDate(e),l=this.formatDate(j,k,this._getFormatConfig(e));a(h).each(function(){a(this).val(l)})}},noWeekends:function(e){e=e.getDay();return[e>0&&e<6,""]},iso8601Week:function(e){e=new Date(e.getTime());e.setDate(e.getDate()+4-(e.getDay()||7));var h=e.getTime();e.setMonth(0);e.setDate(1);return Math.floor(Math.round((h-e)/864E5)/7)+1},parseDate:function(e,h,j){if(e==null||h==null)throw"Invalid arguments"; -h=typeof h=="object"?h.toString():h+"";if(h=="")return null;var k=(j?j.shortYearCutoff:null)||this._defaults.shortYearCutoff;k=typeof k!="string"?k:(new Date).getFullYear()%100+parseInt(k,10);for(var l=(j?j.dayNamesShort:null)||this._defaults.dayNamesShort,n=(j?j.dayNames:null)||this._defaults.dayNames,u=(j?j.monthNamesShort:null)||this._defaults.monthNamesShort,r=(j?j.monthNames:null)||this._defaults.monthNames,m=j=-1,q=-1,s=-1,p=false,o=function(z){(z=E+1-1){m=1;q=s;do{k=this._getDaysInMonth(j,m-1);if(q<=k)break;m++;q-=k}while(1)}D=this._daylightSavingAdjust(new Date(j,m-1,q));if(D.getFullYear()!=j||D.getMonth()+1!=m||D.getDate()!=q)throw"Invalid date";return D},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(e,h,j){if(!h)return"";var k=(j?j.dayNamesShort:null)||this._defaults.dayNamesShort,l=(j?j.dayNames:null)||this._defaults.dayNames,n=(j?j.monthNamesShort:null)||this._defaults.monthNamesShort;j=(j?j.monthNames: -null)||this._defaults.monthNames;var u=function(o){(o=p+1 -12?e.getHours()+2:0);return e},_setDate:function(e,h,j){var k=!h,l=e.selectedMonth,n=e.selectedYear;h=this._restrictMinMax(e,this._determineDate(e,h,new Date));e.selectedDay=e.currentDay=h.getDate();e.drawMonth=e.selectedMonth=e.currentMonth=h.getMonth();e.drawYear=e.selectedYear=e.currentYear=h.getFullYear();if((l!=e.selectedMonth||n!=e.selectedYear)&&!j)this._notifyChange(e);this._adjustInstDate(e);if(e.input)e.input.val(k?"":this._formatDate(e))},_getDate:function(e){return!e.currentYear||e.input&& -e.input.val()==""?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay))},_generateHTML:function(e){var h=new Date;h=this._daylightSavingAdjust(new Date(h.getFullYear(),h.getMonth(),h.getDate()));var j=this._get(e,"isRTL"),k=this._get(e,"showButtonPanel"),l=this._get(e,"hideIfNoPrevNext"),n=this._get(e,"navigationAsDateFormat"),u=this._getNumberOfMonths(e),r=this._get(e,"showCurrentAtPos"),m=this._get(e,"stepMonths"),q=u[0]!=1||u[1]!=1,s=this._daylightSavingAdjust(!e.currentDay? -new Date(9999,9,9):new Date(e.currentYear,e.currentMonth,e.currentDay)),p=this._getMinMaxDate(e,"min"),o=this._getMinMaxDate(e,"max");r=e.drawMonth-r;var v=e.drawYear;if(r<0){r+=12;v--}if(o){var x=this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-u[0]*u[1]+1,o.getDate()));for(x=p&&xx;){r--;if(r<0){r=11;v--}}}e.drawMonth=r;e.drawYear=v;x=this._get(e,"prevText");x=!n?x:this.formatDate(x,this._daylightSavingAdjust(new Date(v,r-m,1)),this._getFormatConfig(e)); -x=this._canAdjustMonth(e,-1,v,r)?''+x+"":l?"":''+x+"";var w=this._get(e,"nextText");w=!n?w:this.formatDate(w,this._daylightSavingAdjust(new Date(v, -r+m,1)),this._getFormatConfig(e));l=this._canAdjustMonth(e,+1,v,r)?''+w+"":l?"":''+w+"";m=this._get(e,"currentText");w=this._get(e,"gotoCurrent")&& -e.currentDay?s:h;m=!n?m:this.formatDate(m,w,this._getFormatConfig(e));n=!e.inline?'":"";k=k?'
                '+(j?n:"")+(this._isInRange(e,w)?'":"")+(j?"":n)+"
                ":"";n=parseInt(this._get(e,"firstDay"),10);n=isNaN(n)?0:n;m=this._get(e,"showWeek");w=this._get(e,"dayNames");this._get(e,"dayNamesShort");var y=this._get(e,"dayNamesMin"),E=this._get(e,"monthNames"),D=this._get(e,"monthNamesShort"),z=this._get(e,"beforeShowDay"),F=this._get(e,"showOtherMonths"),Q=this._get(e,"selectOtherMonths");this._get(e,"calculateWeek");for(var P=this._getDefaultDate(e),J="",I=0;I1)switch(K){case 0:G+=" ui-datepicker-group-first";C=" ui-corner-"+(j?"right":"left");break;case u[1]-1:G+=" ui-datepicker-group-last";C=" ui-corner-"+(j?"left":"right");break;default:G+=" ui-datepicker-group-middle";C="";break}G+='">'}G+='
                '+(/all|left/.test(C)&& -I==0?j?l:x:"")+(/all|right/.test(C)&&I==0?j?x:l:"")+this._generateMonthYearHeader(e,r,v,p,o,I>0||K>0,E,D)+'
                ';var B=m?'":"";for(C=0;C<7;C++){var A=(C+n)%7;B+="=5?' class="ui-datepicker-week-end"':"")+'>'+y[A]+""}G+=B+"";B=this._getDaysInMonth(v,r);if(v==e.selectedYear&&r==e.selectedMonth)e.selectedDay=Math.min(e.selectedDay, -B);C=(this._getFirstDayOfMonth(v,r)-n+7)%7;B=Math.ceil((C+B)/7);this.maxRows=B=q?this.maxRows>B?this.maxRows:B:B;A=this._daylightSavingAdjust(new Date(v,r,1-C));for(var S=0;S";var R=!m?"":'";for(C=0;C<7;C++){var L=z?z.apply(e.input?e.input[0]:null,[A]):[true,""],N=A.getMonth()!=r,H=N&&!Q||!L[0]||p&&Ao;R+='";A.setDate(A.getDate()+1);A=this._daylightSavingAdjust(A)}G+=R+""}r++;if(r>11){r=0;v++}G+="
                '+this._get(e,"weekHeader")+"
                '+this._get(e,"calculateWeek")(A)+""+(N&&!F?" ":H?''+ -A.getDate()+"":''+A.getDate()+"")+"
                "+(q?"
                "+(u[0]>0&&K==u[1]-1?'
                ':""):"");O+=G}J+=O}J+=k+(a.browser.msie&&parseInt(a.browser.version,10)<7&&!e.inline?'': -"");e._keyEvent=false;return J},_generateMonthYearHeader:function(e,h,j,k,l,n,u,r){var m=this._get(e,"changeMonth"),q=this._get(e,"changeYear"),s=this._get(e,"showMonthAfterYear"),p='
                ',o="";if(n||!m)o+=''+u[h]+"";else{u=k&&k.getFullYear()==j;var v=l&&l.getFullYear()==j;o+='"}s||(p+=o+(n||!(m&&q)?" ":""));if(!e.yearshtml){e.yearshtml="";if(n||!q)p+=''+j+"";else{r=this._get(e,"yearRange").split(":");var w=(new Date).getFullYear();u=function(y){y=y.match(/c[+-].*/)?j+parseInt(y.substring(1),10):y.match(/[+-].*/)?w+parseInt(y,10):parseInt(y,10);return isNaN(y)?w:y};h=u(r[0]);r=Math.max(h,u(r[1]||""));h=k?Math.max(h, -k.getFullYear()):h;r=l?Math.min(r,l.getFullYear()):r;for(e.yearshtml+='";p+=e.yearshtml;e.yearshtml=null}}p+=this._get(e,"yearSuffix");if(s)p+=(n||!(m&&q)?" ":"")+o;p+="
                ";return p},_adjustInstDate:function(e,h,j){var k=e.drawYear+(j=="Y"?h:0),l=e.drawMonth+ -(j=="M"?h:0);h=Math.min(e.selectedDay,this._getDaysInMonth(k,l))+(j=="D"?h:0);k=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(k,l,h)));e.selectedDay=k.getDate();e.drawMonth=e.selectedMonth=k.getMonth();e.drawYear=e.selectedYear=k.getFullYear();if(j=="M"||j=="Y")this._notifyChange(e)},_restrictMinMax:function(e,h){var j=this._getMinMaxDate(e,"min");e=this._getMinMaxDate(e,"max");h=j&&he?e:h},_notifyChange:function(e){var h=this._get(e,"onChangeMonthYear");if(h)h.apply(e.input? -e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){e=this._get(e,"numberOfMonths");return e==null?[1,1]:typeof e=="number"?[1,e]:e},_getMinMaxDate:function(e,h){return this._determineDate(e,this._get(e,h+"Date"),null)},_getDaysInMonth:function(e,h){return 32-this._daylightSavingAdjust(new Date(e,h,32)).getDate()},_getFirstDayOfMonth:function(e,h){return(new Date(e,h,1)).getDay()},_canAdjustMonth:function(e,h,j,k){var l=this._getNumberOfMonths(e);j=this._daylightSavingAdjust(new Date(j, -k+(h<0?h:l[0]*l[1]),1));h<0&&j.setDate(this._getDaysInMonth(j.getFullYear(),j.getMonth()));return this._isInRange(e,j)},_isInRange:function(e,h){var j=this._getMinMaxDate(e,"min");e=this._getMinMaxDate(e,"max");return(!j||h.getTime()>=j.getTime())&&(!e||h.getTime()<=e.getTime())},_getFormatConfig:function(e){var h=this._get(e,"shortYearCutoff");h=typeof h!="string"?h:(new Date).getFullYear()%100+parseInt(h,10);return{shortYearCutoff:h,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e, -"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,h,j,k){if(!h){e.currentDay=e.selectedDay;e.currentMonth=e.selectedMonth;e.currentYear=e.selectedYear}h=h?typeof h=="object"?h:this._daylightSavingAdjust(new Date(k,j,h)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),h,this._getFormatConfig(e))}});a.fn.datepicker=function(e){if(!this.length)return this; -if(!a.datepicker.initialized){a(document).mousedown(a.datepicker._checkExternalClick).find("body").append(a.datepicker.dpDiv);a.datepicker.initialized=true}var h=Array.prototype.slice.call(arguments,1);if(typeof e=="string"&&(e=="isDisabled"||e=="getDate"||e=="widget"))return a.datepicker["_"+e+"Datepicker"].apply(a.datepicker,[this[0]].concat(h));if(e=="option"&&arguments.length==2&&typeof arguments[1]=="string")return a.datepicker["_"+e+"Datepicker"].apply(a.datepicker,[this[0]].concat(h));return this.each(function(){typeof e== -"string"?a.datepicker["_"+e+"Datepicker"].apply(a.datepicker,[this].concat(h)):a.datepicker._attachDatepicker(this,e)})};a.datepicker=new c;a.datepicker.initialized=false;a.datepicker.uuid=(new Date).getTime();a.datepicker.version="1.8.17";window["DP_xQuery_"+g]=a})(xQuery); -(function(a){a.widget("ui.ncbidatepicker",{_create:function(){var b=["beforeShow","beforeShowDay","onChangeMonthYear","onClose","onSelect"],c=this.options;for(var d in c)if(a.inArray(d,b)!==-1)this.options[d]=a.ui.jig._getFncFromStr(this.options[d],this);this.element.datepicker(this.options)},show:function(){for(var b=[],c=0;c
              ").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(c.range==="min"||c.range==="max"?" ui-slider-range-"+c.range:""))}for(var i=d.length;i"); -this.handles=d.add(a(g.join("")).appendTo(b.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(e){e.preventDefault()}).hover(function(){c.disabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){if(c.disabled)a(this).blur();else{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(e){a(this).data("index.ui-slider-handle", -e)});this.handles.keydown(function(e){var h=true,j=a(this).data("index.ui-slider-handle"),k,l,n;if(!b.options.disabled){switch(e.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:h=false;if(!b._keySliding){b._keySliding=true;a(this).addClass("ui-state-active");k=b._start(e,j);if(k===false)return}break}n=b.options.step;k=b.options.values&&b.options.values.length? -(l=b.values(j)):(l=b.value());switch(e.keyCode){case a.ui.keyCode.HOME:l=b._valueMin();break;case a.ui.keyCode.END:l=b._valueMax();break;case a.ui.keyCode.PAGE_UP:l=b._trimAlignValue(k+(b._valueMax()-b._valueMin())/5);break;case a.ui.keyCode.PAGE_DOWN:l=b._trimAlignValue(k-(b._valueMax()-b._valueMin())/5);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(k===b._valueMax())return;l=b._trimAlignValue(k+n);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(k===b._valueMin())return;l=b._trimAlignValue(k- -n);break}b._slide(e,j,l);return h}}).keyup(function(e){var h=a(this).data("index.ui-slider-handle");if(b._keySliding){b._keySliding=false;b._stop(e,h);b._change(e,h);a(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy(); -return this},_mouseCapture:function(b){var c=this.options,d,f,g,i,e;if(c.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();d=this._normValueFromMouse({x:b.pageX,y:b.pageY});f=this._valueMax()-this._valueMin()+1;i=this;this.handles.each(function(h){var j=Math.abs(d-i.values(h));if(f>j){f=j;g=a(this);e=h}});if(c.range===true&&this.values(1)===c.min){e+=1;g=a(this.handles[e])}if(this._start(b,e)===false)return false; -this._mouseSliding=true;i._handleIndex=e;g.addClass("ui-state-active").focus();c=g.offset();this._clickOffset=!a(b.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:b.pageX-c.left-g.width()/2,top:b.pageY-c.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,e,d);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(b){var c= -this._normValueFromMouse({x:b.pageX,y:b.pageY});this._slide(b,this._handleIndex,c);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(b){var c;if(this.orientation==="horizontal"){c= -this.elementSize.width;b=b.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{c=this.elementSize.height;b=b.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}c=b/c;if(c>1)c=1;if(c<0)c=0;if(this.orientation==="vertical")c=1-c;b=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+c*b)},_start:function(b,c){var d={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){d.value=this.values(c); -d.values=this.values()}return this._trigger("start",b,d)},_slide:function(b,c,d){var f;if(this.options.values&&this.options.values.length){f=this.values(c?0:1);if(this.options.values.length===2&&this.options.range===true&&(c===0&&d>f||c===1&&d1){this.options.values[b]=this._trimAlignValue(c);this._refreshValue();this._change(null,b)}else if(arguments.length)if(a.isArray(arguments[0])){d=this.options.values;f=arguments[0];for(g=0;g=this._valueMax())return this._valueMax();var c=this.options.step>0?this.options.step:1,d=(b-this._valueMin())%c;b=b-d;if(Math.abs(d)*2>=c)b+=d>0?c:-c;return parseFloat(b.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,f=!this._animateOff?c.animate:false,g,i={},e,h,j,k;if(this.options.values&&this.options.values.length)this.handles.each(function(l){g=(d.values(l)-d._valueMin())/(d._valueMax()-d._valueMin())*100;i[d.orientation==="horizontal"?"left":"bottom"]=g+"%";a(this).stop(1,1)[f?"animate":"css"](i,c.animate);if(d.options.range===true)if(d.orientation==="horizontal"){if(l===0)d.range.stop(1,1)[f?"animate":"css"]({left:g+"%"},c.animate);if(l===1)d.range[f?"animate":"css"]({width:g- -e+"%"},{queue:false,duration:c.animate})}else{if(l===0)d.range.stop(1,1)[f?"animate":"css"]({bottom:g+"%"},c.animate);if(l===1)d.range[f?"animate":"css"]({height:g-e+"%"},{queue:false,duration:c.animate})}e=g});else{h=this.value();j=this._valueMin();k=this._valueMax();g=k!==j?(h-j)/(k-j)*100:0;i[d.orientation==="horizontal"?"left":"bottom"]=g+"%";this.handle.stop(1,1)[f?"animate":"css"](i,c.animate);if(b==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[f?"animate":"css"]({width:g+"%"}, -c.animate);if(b==="max"&&this.orientation==="horizontal")this.range[f?"animate":"css"]({width:100-g+"%"},{queue:false,duration:c.animate});if(b==="min"&&this.orientation==="vertical")this.range.stop(1,1)[f?"animate":"css"]({height:g+"%"},c.animate);if(b==="max"&&this.orientation==="vertical")this.range[f?"animate":"css"]({height:100-g+"%"},{queue:false,duration:c.animate})}}});a.extend(a.ui.slider,{version:"1.8.17"})})(xQuery);xQuery.widget("ui.ncbislider",{options:{},_create:function(){},destroy:function(){}});