/*
 * jQuery UI 1.7.2
 *
 * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI
 */
jQuery.ui || (function (c) {
  var i = c.fn.remove,
    d = c.browser.mozilla && (parseFloat(c.browser.version) < 1.9);
  c.ui = {
      version: "1.7.2",
      plugin: {
        add: function (k, l, n) {
          var m = c.ui[k].prototype;
          for (var j in n) {
            m.plugins[j] = m.plugins[j] || [];
            m.plugins[j].push([l, n[j]])
          }
        },
        call: function (j, l, k) {
          var n = j.plugins[l];
          if (!n || !j.element[0].parentNode) {
            return
          }
          for (var m = 0; m < n.length; m++) {
            if (j.options[n[m][0]]) {
              n[m][1].apply(j.element, k)
            }
          }
        }
      },
      contains: function (k, j) {
        return document.compareDocumentPosition ? k.compareDocumentPosition(j) & 16 : k !== j && k.contains(j)
      },
      hasScroll: function (m, k) {
        if (c(m).css("overflow") == "hidden") {
          return false
        }
        var j = (k && k == "left") ? "scrollLeft" : "scrollTop",
          l = false;
        if (m[j] > 0) {
            return true
          }
        m[j] = 1;
        l = (m[j] > 0);
        m[j] = 0;
        return l
      },
      isOverAxis: function (k, j, l) {
        return (k > j) && (k < (j + l))
      },
      isOver: function (o, k, n, m, j, l) {
        return c.ui.isOverAxis(o, n, j) && c.ui.isOverAxis(k, m, l)
      },
      keyCode: {
        BACKSPACE: 8,
        CAPS_LOCK: 20,
        COMMA: 188,
        CONTROL: 17,
        DELETE: 46,
        DOWN: 40,
        END: 35,
        ENTER: 13,
        ESCAPE: 27,
        HOME: 36,
        INSERT: 45,
        LEFT: 37,
        NUMPAD_ADD: 107,
        NUMPAD_DECIMAL: 110,
        NUMPAD_DIVIDE: 111,
        NUMPAD_ENTER: 108,
        NUMPAD_MULTIPLY: 106,
        NUMPAD_SUBTRACT: 109,
        PAGE_DOWN: 34,
        PAGE_UP: 33,
        PERIOD: 190,
        RIGHT: 39,
        SHIFT: 16,
        SPACE: 32,
        TAB: 9,
        UP: 38
      }
    };
  if (d) {
      var f = c.attr,
        e = c.fn.removeAttr,
        h = "http://www.w3.org/2005/07/aaa",
        a = /^aria-/,
        b = /^wairole:/;
      c.attr = function (k, j, l) {
          var m = l !== undefined;
          return (j == "role" ? (m ? f.call(this, k, j, "wairole:" + l) : (f.apply(this, arguments) || "").replace(b, "")) : (a.test(j) ? (m ? k.setAttributeNS(h, j.replace(a, "aaa:"), l) : f.call(this, k, j.replace(a, "aaa:"))) : f.apply(this, arguments)))
        };
      c.fn.removeAttr = function (j) {
          return (a.test(j) ? this.each(function () {
            this.removeAttributeNS(h, j.replace(a, ""))
          }) : e.call(this, j))
        }
    }
  c.fn.extend({
      remove: function () {
        c("*", this).add(this).each(function () {
          c(this).triggerHandler("remove")
        });
        return i.apply(this, arguments)
      },
      enableSelection: function () {
        return this.attr("unselectable", "off").css("MozUserSelect", "").unbind("selectstart.ui")
      },
      disableSelection: function () {
        return this.attr("unselectable", "on").css("MozUserSelect", "none").bind("selectstart.ui", function () {
          return false
        })
      },
      scrollParent: function () {
        var j;
        if ((c.browser.msie && (/(static|relative)/).test(this.css("position"))) || (/absolute/).test(this.css("position"))) {
          j = this.parents().filter(function () {
            return (/(relative|absolute|fixed)/).test(c.curCSS(this, "position", 1)) && (/(auto|scroll)/).test(c.curCSS(this, "overflow", 1) + c.curCSS(this, "overflow-y", 1) + c.curCSS(this, "overflow-x", 1))
          }).eq(0)
        } else {
          j = this.parents().filter(function () {
            return (/(auto|scroll)/).test(c.curCSS(this, "overflow", 1) + c.curCSS(this, "overflow-y", 1) + c.curCSS(this, "overflow-x", 1))
          }).eq(0)
        }
        return (/fixed/).test(this.css("position")) || !j.length ? c(document) : j
      }
    });
  c.extend(c.expr[":"], {
      data: function (l, k, j) {
        return !!c.data(l, j[3])
      },
      focusable: function (k) {
        var l = k.nodeName.toLowerCase(),
          j = c.attr(k, "tabindex");
        return (/input|select|textarea|button|object/.test(l) ? !k.disabled : "a" == l || "area" == l ? k.href || !isNaN(j) : !isNaN(j)) && !c(k)["area" == l ? "parents" : "closest"](":hidden").length
      },
      tabbable: function (k) {
        var j = c.attr(k, "tabindex");
        return (isNaN(j) || j >= 0) && c(k).is(":focusable")
      }
    });

  function g(m, n, o, l) {
      function k(q) {
        var p = c[m][n][q] || [];
        return (typeof p == "string" ? p.split(/,?\s+/) : p)
      }
      var j = k("getter");
      if (l.length == 1 && typeof l[0] == "string") {
        j = j.concat(k("getterSetter"))
      }
      return (c.inArray(o, j) != -1)
    }
  c.widget = function (k, j) {
      var l = k.split(".")[0];
      k = k.split(".")[1];
      c.fn[k] = function (p) {
        var n = (typeof p == "string"),
          o = Array.prototype.slice.call(arguments, 1);
        if (n && p.substring(0, 1) == "_") {
            return this
          }
        if (n && g(l, k, p, o)) {
            var m = c.data(this[0], k);
            return (m ? m[p].apply(m, o) : undefined)
          }
        return this.each(function () {
            var q = c.data(this, k);
            (!q && !n && c.data(this, k, new c[l][k](this, p))._init());
            (q && n && c.isFunction(q[p]) && q[p].apply(q, o))
          })
      };
      c[l] = c[l] || {};
      c[l][k] = function (o, n) {
        var m = this;
        this.namespace = l;
        this.widgetName = k;
        this.widgetEventPrefix = c[l][k].eventPrefix || k;
        this.widgetBaseClass = l + "-" + k;
        this.options = c.extend({}, c.widget.defaults, c[l][k].defaults, c.metadata && c.metadata.get(o)[k], n);
        this.element = c(o).bind("setData." + k, function (q, p, r) {
          if (q.target == o) {
            return m._setData(p, r)
          }
        }).bind("getData." + k, function (q, p) {
          if (q.target == o) {
            return m._getData(p)
          }
        }).bind("remove", function () {
          return m.destroy()
        })
      };
      c[l][k].prototype = c.extend({}, c.widget.prototype, j);
      c[l][k].getterSetter = "option"
    };
  c.widget.prototype = {
      _init: function () {},
      destroy: function () {
        this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass + "-disabled " + this.namespace + "-state-disabled").removeAttr("aria-disabled")
      },
      option: function (l, m) {
        var k = l,
          j = this;
        if (typeof l == "string") {
            if (m === undefined) {
              return this._getData(l)
            }
            k = {};
            k[l] = m
          }
        c.each(k, function (n, o) {
            j._setData(n, o)
          })
      },
      _getData: function (j) {
        return this.options[j]
      },
      _setData: function (j, k) {
        this.options[j] = k;
        if (j == "disabled") {
          this.element[k ? "addClass" : "removeClass"](this.widgetBaseClass + "-disabled " + this.namespace + "-state-disabled").attr("aria-disabled", k)
        }
      },
      enable: function () {
        this._setData("disabled", false)
      },
      disable: function () {
        this._setData("disabled", true)
      },
      _trigger: function (l, m, n) {
        var p = this.options[l],
          j = (l == this.widgetEventPrefix ? l : this.widgetEventPrefix + l);
        m = c.Event(m);
        m.type = j;
        if (m.originalEvent) {
            for (var k = c.event.props.length, o; k;) {
              o = c.event.props[--k];
              m[o] = m.originalEvent[o]
            }
          }
        this.element.trigger(m, n);
        return !(c.isFunction(p) && p.call(this.element[0], m, n) === false || m.isDefaultPrevented())
      }
    };
  c.widget.defaults = {
      disabled: false
    };
  c.ui.mouse = {
      _mouseInit: function () {
        var j = this;
        this.element.bind("mousedown." + this.widgetName, function (k) {
          return j._mouseDown(k)
        }).bind("click." + this.widgetName, function (k) {
          if (j._preventClickEvent) {
            j._preventClickEvent = false;
            k.stopImmediatePropagation();
            return false
          }
        });
        if (c.browser.msie) {
          this._mouseUnselectable = this.element.attr("unselectable");
          this.element.attr("unselectable", "on")
        }
        this.started = false
      },
      _mouseDestroy: function () {
        this.element.unbind("." + this.widgetName);
        (c.browser.msie && this.element.attr("unselectable", this._mouseUnselectable))
      },
      _mouseDown: function (l) {
        l.originalEvent = l.originalEvent || {};
        if (l.originalEvent.mouseHandled) {
          return
        }(this._mouseStarted && this._mouseUp(l));
        this._mouseDownEvent = l;
        var k = this,
          m = (l.which == 1),
          j = (typeof this.options.cancel == "string" ? c(l.target).parents().add(l.target).filter(this.options.cancel).length : false);
        if (!m || j || !this._mouseCapture(l)) {
            return true
          }
        this.mouseDelayMet = !this.options.delay;
        if (!this.mouseDelayMet) {
            this._mouseDelayTimer = setTimeout(function () {
              k.mouseDelayMet = true
            }, this.options.delay)
          }
        if (this._mouseDistanceMet(l) && this._mouseDelayMet(l)) {
            this._mouseStarted = (this._mouseStart(l) !== false);
            if (!this._mouseStarted) {
              l.preventDefault();
              return true
            }
          }
        this._mouseMoveDelegate = function (n) {
            return k._mouseMove(n)
          };
        this._mouseUpDelegate = function (n) {
            return k._mouseUp(n)
          };
        c(document).bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate);
          (c.browser.safari || l.preventDefault());
        l.originalEvent.mouseHandled = true;
        return true
      },
      _mouseMove: function (j) {
        if (c.browser.msie && !j.button) {
          return this._mouseUp(j)
        }
        if (this._mouseStarted) {
          this._mouseDrag(j);
          return j.preventDefault()
        }
        if (this._mouseDistanceMet(j) && this._mouseDelayMet(j)) {
          this._mouseStarted = (this._mouseStart(this._mouseDownEvent, j) !== false);
          (this._mouseStarted ? this._mouseDrag(j) : this._mouseUp(j))
        }
        return !this._mouseStarted
      },
      _mouseUp: function (j) {
        c(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate);
        if (this._mouseStarted) {
          this._mouseStarted = false;
          this._preventClickEvent = (j.target == this._mouseDownEvent.target);
          this._mouseStop(j)
        }
        return false
      },
      _mouseDistanceMet: function (j) {
        return (Math.max(Math.abs(this._mouseDownEvent.pageX - j.pageX), Math.abs(this._mouseDownEvent.pageY - j.pageY)) >= this.options.distance)
      },
      _mouseDelayMet: function (j) {
        return this.mouseDelayMet
      },
      _mouseStart: function (j) {},
      _mouseDrag: function (j) {},
      _mouseStop: function (j) {},
      _mouseCapture: function (j) {
        return true
      }
    };
  c.ui.mouse.defaults = {
      cancel: null,
      distance: 1,
      delay: 0
    }
})(jQuery);;
/*
 * jQuery UI Tabs 1.7.2
 *
 * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Tabs
 *
 * Depends:
 *	ui.core.js
 */
(function (a) {
  a.widget("ui.tabs", {
    _init: function () {
      if (this.options.deselectable !== undefined) {
        this.options.collapsible = this.options.deselectable
      }
      this._tabify(true)
    },
    _setData: function (b, c) {
      if (b == "selected") {
        if (this.options.collapsible && c == this.options.selected) {
          return
        }
        this.select(c)
      } else {
        this.options[b] = c;
        if (b == "deselectable") {
          this.options.collapsible = c
        }
        this._tabify()
      }
    },
    _tabId: function (b) {
      /* return b.title && b.title.replace(/\s/g, "_").replace(/[^A-Za-z0-9\-_:\.]/g, "") || this.options.idPrefix + a.data(b) */
      return b.title && b.title.replace(/\s/g, "_").replace(/[^A-Za-z0-9\-_:\.]/g, "") || this.options.idPrefix + (++tabId)
    },
    _sanitizeSelector: function (b) {
      return b.replace(/:/g, "\\:")
    },
    _cookie: function () {
      var b = this.cookie || (this.cookie = this.options.cookie.name || "ui-tabs-" + a.data(this.list[0]));
      return a.cookie.apply(null, [b].concat(a.makeArray(arguments)))
    },
    _ui: function (c, b) {
      return {
        tab: c,
        panel: b,
        index: this.anchors.index(c)
      }
    },
    _cleanup: function () {
      this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function () {
        var b = a(this);
        b.html(b.data("label.tabs")).removeData("label.tabs")
      })
    },
    _tabify: function (n) {
      this.list = this.element.children("ul:first");
      this.lis = a("li:has(a[href])", this.list);
      this.anchors = this.lis.map(function () {
        return a("a", this)[0]
      });
      this.panels = a([]);
      var p = this,
        d = this.options;
      var c = /^#.+/;
      this.anchors.each(function (r, o) {
          var q = a(o).attr("href");
          var s = q.split("#")[0],
            u;
          if (s && (s === location.toString().split("#")[0] || (u = a("base")[0]) && s === u.href)) {
              q = o.hash;
              o.href = q
            }
          if (c.test(q)) {
              p.panels = p.panels.add(p._sanitizeSelector(q))
            } else {
              if (q != "#") {
                a.data(o, "href.tabs", q);
                a.data(o, "load.tabs", q.replace(/#.*$/, ""));
                var w = p._tabId(o);
                o.href = "#" + w;
                var v = a("#" + w);
                if (!v.length) {
                  v = a(d.panelTemplate).attr("id", w).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(p.panels[r - 1] || p.list);
                  v.data("destroy.tabs", true)
                }
                p.panels = p.panels.add(v)
              } else {
                d.disabled.push(r)
              }
            }
        });
      if (n) {
          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 (d.selected === undefined) {
            if (location.hash) {
              this.anchors.each(function (q, o) {
                if (o.hash == location.hash) {
                  d.selected = q;
                  return false
                }
              })
            }
            if (typeof d.selected != "number" && d.cookie) {
              d.selected = parseInt(p._cookie(), 10)
            }
            if (typeof d.selected != "number" && this.lis.filter(".ui-tabs-selected").length) {
              d.selected = this.lis.index(this.lis.filter(".ui-tabs-selected"))
            }
            d.selected = d.selected || 0
          } else {
            if (d.selected === null) {
              d.selected = -1
            }
          }
          d.selected = ((d.selected >= 0 && this.anchors[d.selected]) || d.selected < 0) ? d.selected : 0;
          d.disabled = a.unique(d.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"), function (q, o) {
            return p.lis.index(q)
          }))).sort();
          if (a.inArray(d.selected, d.disabled) != -1) {
            d.disabled.splice(a.inArray(d.selected, d.disabled), 1)
          }
          this.panels.addClass("ui-tabs-hide");
          this.lis.removeClass("ui-tabs-selected ui-state-active");
          if (d.selected >= 0 && this.anchors.length) {
            this.panels.eq(d.selected).removeClass("ui-tabs-hide");
            this.lis.eq(d.selected).addClass("ui-tabs-selected ui-state-active");
            p.element.queue("tabs", function () {
              p._trigger("show", null, p._ui(p.anchors[d.selected], p.panels[d.selected]))
            });
            this.load(d.selected)
          }
          a(window).bind("unload", function () {
            p.lis.add(p.anchors).unbind(".tabs");
            p.lis = p.anchors = p.panels = null
          })
        } else {
          d.selected = this.lis.index(this.lis.filter(".ui-tabs-selected"))
        }
      this.element[d.collapsible ? "addClass" : "removeClass"]("ui-tabs-collapsible");
      if (d.cookie) {
          this._cookie(d.selected, d.cookie)
        }
      for (var g = 0, m;
        (m = this.lis[g]); g++) {
          a(m)[a.inArray(g, d.disabled) != -1 && !a(m).hasClass("ui-tabs-selected") ? "addClass" : "removeClass"]("ui-state-disabled")
        }
      if (d.cache === false) {
          this.anchors.removeData("cache.tabs")
        }
      this.lis.add(this.anchors).unbind(".tabs");
      if (d.event != "mouseover") {
          var f = function (o, i) {
            if (i.is(":not(.ui-state-disabled)")) {
              i.addClass("ui-state-" + o)
            }
          };
          var j = function (o, i) {
            i.removeClass("ui-state-" + o)
          };
          this.lis.bind("mouseover.tabs", function () {
            f("hover", a(this))
          });
          this.lis.bind("mouseout.tabs", function () {
            j("hover", a(this))
          });
          this.anchors.bind("focus.tabs", function () {
            f("focus", a(this).closest("li"))
          });
          this.anchors.bind("blur.tabs", function () {
            j("focus", a(this).closest("li"))
          })
        }
      var b, h;
      if (d.fx) {
          if (a.isArray(d.fx)) {
            b = d.fx[0];
            h = d.fx[1]
          } else {
            b = h = d.fx
          }
        }
      function e(i, o) {
          i.css({
            display: ""
          });
          if (a.browser.msie && o.opacity) {
            i[0].style.removeAttribute("filter")
          }
        }
      var k = h ?
      function (i, o) {
          a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");
          o.hide().removeClass("ui-tabs-hide").animate(h, h.duration || "normal", function () {
            e(o, h);
            p._trigger("show", null, p._ui(i, o[0]))
          })
        } : function (i, o) {
          a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");
          o.removeClass("ui-tabs-hide");
          p._trigger("show", null, p._ui(i, o[0]))
        };
      var l = b ?
      function (o, i) {
          i.animate(b, b.duration || "normal", function () {
            p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");
            i.addClass("ui-tabs-hide");
            e(i, b);
            p.element.dequeue("tabs")
          })
        } : function (o, i, q) {
          p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");
          i.addClass("ui-tabs-hide");
          p.element.dequeue("tabs")
        };
      this.anchors.bind(d.event + ".tabs", function () {
          var o = this,
            r = a(this).closest("li"),
            i = p.panels.filter(":not(.ui-tabs-hide)"),
            q = a(p._sanitizeSelector(this.hash));
          if ((r.hasClass("ui-tabs-selected") && !d.collapsible) || r.hasClass("ui-state-disabled") || r.hasClass("ui-state-processing") || p._trigger("select", null, p._ui(this, q[0])) === false) {
              this.blur();
              return false
            }
          d.selected = p.anchors.index(this);
          p.abort();
          if (d.collapsible) {
              if (r.hasClass("ui-tabs-selected")) {
                d.selected = -1;
                if (d.cookie) {
                  p._cookie(d.selected, d.cookie)
                }
                p.element.queue("tabs", function () {
                  l(o, i)
                }).dequeue("tabs");
                this.blur();
                return false
              } else {
                if (!i.length) {
                  if (d.cookie) {
                    p._cookie(d.selected, d.cookie)
                  }
                  p.element.queue("tabs", function () {
                    k(o, q)
                  });
                  p.load(p.anchors.index(this));
                  this.blur();
                  return false
                }
              }
            }
          if (d.cookie) {
              p._cookie(d.selected, d.cookie)
            }
          if (q.length) {
              if (i.length) {
                p.element.queue("tabs", function () {
                  l(o, i)
                })
              }
              p.element.queue("tabs", function () {
                k(o, q)
              });
              p.load(p.anchors.index(this))
            } else {
              throw "jQuery UI Tabs: Mismatching fragment identifier."
            }
          if (a.browser.msie) {
              this.blur()
            }
        });
      this.anchors.bind("click.tabs", function () {
          return false
        })
    },
    destroy: function () {
      var b = this.options;
      this.abort();
      this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");
      this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");
      this.anchors.each(function () {
        var c = a.data(this, "href.tabs");
        if (c) {
          this.href = c
        }
        var d = a(this).unbind(".tabs");
        a.each(["href", "load", "cache"], function (e, f) {
          d.removeData(f + ".tabs")
        })
      });
      this.lis.unbind(".tabs").add(this.panels).each(function () {
        if (a.data(this, "destroy.tabs")) {
          a(this).remove()
        } else {
          a(this).removeClass(["ui-state-default", "ui-corner-top", "ui-tabs-selected", "ui-state-active", "ui-state-hover", "ui-state-focus", "ui-state-disabled", "ui-tabs-panel", "ui-widget-content", "ui-corner-bottom", "ui-tabs-hide"].join(" "))
        }
      });
      if (b.cookie) {
        this._cookie(null, b.cookie)
      }
    },
    add: function (e, d, c) {
      if (c === undefined) {
        c = this.anchors.length
      }
      var b = this,
        g = this.options,
        i = a(g.tabTemplate.replace(/#\{href\}/g, e).replace(/#\{label\}/g, d)),
        h = !e.indexOf("#") ? e.replace("#", "") : this._tabId(a("a", i)[0]);
      i.addClass("ui-state-default ui-corner-top").data("destroy.tabs", true);
      var f = a("#" + h);
      if (!f.length) {
          f = a(g.panelTemplate).attr("id", h).data("destroy.tabs", true)
        }
      f.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");
      if (c >= this.lis.length) {
          i.appendTo(this.list);
          f.appendTo(this.list[0].parentNode)
        } else {
          i.insertBefore(this.lis[c]);
          f.insertBefore(this.panels[c])
        }
      g.disabled = a.map(g.disabled, function (k, j) {
          return k >= c ? ++k : k
        });
      this._tabify();
      if (this.anchors.length == 1) {
          i.addClass("ui-tabs-selected ui-state-active");
          f.removeClass("ui-tabs-hide");
          this.element.queue("tabs", function () {
            b._trigger("show", null, b._ui(b.anchors[0], b.panels[0]))
          });
          this.load(0)
        }
      this._trigger("add", null, this._ui(this.anchors[c], this.panels[c]))
    },
    remove: function (b) {
      var d = this.options,
        e = this.lis.eq(b).remove(),
        c = this.panels.eq(b).remove();
      if (e.hasClass("ui-tabs-selected") && this.anchors.length > 1) {
          this.select(b + (b + 1 < this.anchors.length ? 1 : -1))
        }
      d.disabled = a.map(a.grep(d.disabled, function (g, f) {
          return g != b
        }), function (g, f) {
          return g >= b ? --g : g
        });
      this._tabify();
      this._trigger("remove", null, this._ui(e.find("a")[0], c[0]))
    },
    enable: function (b) {
      var c = this.options;
      if (a.inArray(b, c.disabled) == -1) {
        return
      }
      this.lis.eq(b).removeClass("ui-state-disabled");
      c.disabled = a.grep(c.disabled, function (e, d) {
        return e != b
      });
      this._trigger("enable", null, this._ui(this.anchors[b], this.panels[b]))
    },
    disable: function (c) {
      var b = this,
        d = this.options;
      if (c != d.selected) {
          this.lis.eq(c).addClass("ui-state-disabled");
          d.disabled.push(c);
          d.disabled.sort();
          this._trigger("disable", null, this._ui(this.anchors[c], this.panels[c]))
        }
    },
    select: function (b) {
      if (typeof b == "string") {
        b = this.anchors.index(this.anchors.filter("[href$=" + b + "]"))
      } else {
        if (b === null) {
          b = -1
        }
      }
      if (b == -1 && this.options.collapsible) {
        b = this.options.selected
      }
      this.anchors.eq(b).trigger(this.options.event + ".tabs")
    },
    load: function (e) {
      var c = this,
        g = this.options,
        b = this.anchors.eq(e)[0],
        d = a.data(b, "load.tabs");
      this.abort();
      if (!d || this.element.queue("tabs").length !== 0 && a.data(b, "cache.tabs")) {
          this.element.dequeue("tabs");
          return
        }
      this.lis.eq(e).addClass("ui-state-processing");
      if (g.spinner) {
          var f = a("span", b);
          f.data("label.tabs", f.html()).html(g.spinner)
        }
      this.xhr = a.ajax(a.extend({}, g.ajaxOptions, {
          url: d,
          success: function (i, h) {
            a(c._sanitizeSelector(b.hash)).html(i);
            c._cleanup();
            if (g.cache) {
              a.data(b, "cache.tabs", true)
            }
            c._trigger("load", null, c._ui(c.anchors[e], c.panels[e]));
            try {
              g.ajaxOptions.success(i, h)
            } catch (j) {}
            c.element.dequeue("tabs")
          }
        }))
    },
    abort: function () {
      this.element.queue([]);
      this.panels.stop(false, true);
      if (this.xhr) {
        this.xhr.abort();
        delete this.xhr
      }
      this._cleanup()
    },
    url: function (c, b) {
      this.anchors.eq(c).removeData("cache.tabs").data("load.tabs", b)
    },
    length: function () {
      return this.anchors.length
    }
  });
  a.extend(a.ui.tabs, {
    version: "1.7.2",
    getter: "length",
    defaults: {
      ajaxOptions: null,
      cache: false,
      cookie: null,
      collapsible: false,
      disabled: [],
      event: "click",
      fx: null,
      idPrefix: "ui-tabs-",
      panelTemplate: "<div></div>",
      spinner: "<em>Loading&#8230;</em>",
      tabTemplate: '<li><a href="#{href}"><span>#{label}</span></a></li>'
    }
  });
  a.extend(a.ui.tabs.prototype, {
    rotation: null,
    rotate: function (d, f) {
      var b = this,
        g = this.options;
      var c = b._rotate || (b._rotate = function (h) {
          clearTimeout(b.rotation);
          b.rotation = setTimeout(function () {
            var i = g.selected;
            b.select(++i < b.anchors.length ? i : 0)
          }, d);
          if (h) {
            h.stopPropagation()
          }
        });
      var e = b._unrotate || (b._unrotate = !f ?
        function (h) {
          if (h.clientX) {
            b.rotate(null)
          }
        } : function (h) {
          t = g.selected;
          c()
        });
      if (d) {
          this.element.bind("tabsshow", c);
          this.anchors.bind(g.event + ".tabs", e);
          c()
        } else {
          clearTimeout(b.rotation);
          this.element.unbind("tabsshow", c);
          this.anchors.unbind(g.event + ".tabs", e);
          delete this._rotate;
          delete this._unrotate
        }
    }
  })
})(jQuery);;

