Commits

Gustavo Picon  committed 2adb4eb

pep8ified

  • Participants
  • Parent commits aa0abf3

Comments (0)

Files changed (22)

     py27-dj13-postgres,
     py27-dj14-sqlite,
     py27-dj14-mysql,
-    py27-dj14-postgres
+    py27-dj14-postgres,
+    py27-dj15-sqlite,
+    py33-dj15-sqlite
 
 [testenv]
 commands =
     pytest
 setenv =
     DATABASE_ENGINE=postgresql_psycopg2
+
+[testenv:py27-dj15-sqlite]
+basepython=python2.7
+deps =
+    https://www.djangoproject.com/download/1.5a1/tarball/#egg=django
+    coverage
+    pytest
+setenv =
+    DATABASE_ENGINE=sqlite3
+
+[testenv:py33-dj15-sqlite]
+basepython=python3.3
+deps =
+    https://www.djangoproject.com/download/1.5a1/tarball/#egg=django
+    coverage
+    pytest
+setenv =
+    DATABASE_ENGINE=sqlite3

File treebeard/admin.py

 from django.utils.translation import ugettext_lazy as _
 from treebeard.templatetags.admin_tree import check_empty_dict
 from treebeard.exceptions import (InvalidPosition, MissingNodeOrderBy,
-        InvalidMoveToDescendant, PathOverflow)
+                                  InvalidMoveToDescendant, PathOverflow)
 from treebeard.forms import MoveNodeForm
 
 
 class TreeChangeList(ChangeList):
-
     def get_ordering(self, *args):
         """
         Overriding ChangeList.get_ordering if using the Django version <= 1.3
 
     def queryset(self, request):
         from treebeard.al_tree import AL_Node
+
         if issubclass(self.model, AL_Node):
             # AL Trees return a list instead of a QuerySet for .get_tree()
             # So we're returning the regular .queryset cause we will use
 
     def changelist_view(self, request, extra_context=None):
         from treebeard.al_tree import AL_Node
+
         if issubclass(self.model, AL_Node):
             # For AL trees, use the old admin display
             self.change_list_template = 'admin/tree_list.html'
         Adds a url to move nodes to this admin
         """
         urls = super(TreeAdmin, self).get_urls()
-        new_urls = patterns('',
-            url('^move/$',
-                self.admin_site.admin_view(self.move_node),),
-            url(r'^jsi18n/$', 'django.views.i18n.javascript_catalog', {
-                'packages': ('treebeard',)}),
+        new_urls = patterns(
+            '',
+            url('^move/$', self.admin_site.admin_view(self.move_node), ),
+            url(r'^jsi18n/$',
+                'django.views.i18n.javascript_catalog',
+                {'packages': ('treebeard',)}),
         )
         return new_urls + urls
 
             node.save()
             # If we are here, means that we moved it in one of the tries
             if as_child:
-                messages.info(request,
+                messages.info(
+                    request,
                     _(u'Moved node "%(node)s" as child of "%(other)s"') % {
                         'node': node,
                         'other': sibling
-                    })
+                    }
+                )
             else:
-                messages.info(request,
+                messages.info(
+                    request,
                     _(u'Moved node "%(node)s" as sibling of "%(other)s"') % {
                         'node': node,
                         'other': sibling
-                    })
+                    }
+                )
 
         except (MissingNodeOrderBy, PathOverflow, InvalidMoveToDescendant,
-            InvalidPosition), e:
+                InvalidPosition), e:
             # An error was raised while trying to move the node, then set an
             # error message and return 400, this will cause a reload on the
             # client to show the message
             # error message and return 400, this will cause a reload on
             # the client to show the message
             messages.error(request,
-                _(u'Exception raised while moving node: %s') % _(
-                    force_unicode(e)))
+                           _(u'Exception raised while moving node: %s') % _(
+                               force_unicode(e)))
             return HttpResponseBadRequest(u'Exception raised during move')
 
         return HttpResponse('OK')

File treebeard/al_tree.py

         if not cls.node_order_by:
             try:
                 max = cls.objects.filter(parent__isnull=True).order_by(
-                        'sib_order').reverse()[0].sib_order
+                    'sib_order').reverse()[0].sib_order
             except IndexError:
                 max = 0
             newobj.sib_order = max + 1
         "Dumps a tree branch to a python data structure."
 
         serializable_cls = cls._get_serializable_model()
-        if parent and serializable_cls != cls and \
-                parent.__class__ != serializable_cls:
+        if (
+                parent and serializable_cls != cls and
+                parent.__class__ != serializable_cls
+        ):
             parent = serializable_cls.objects.get(pk=parent.pk)
 
         # a list of nodes: not really a queryset, but it works
             if keep_ids:
                 newobj['id'] = pyobj['pk']
 
-            if (not parent and depth == 1) or \
-                    (parent and depth == parent.get_depth()):
+            if (not parent and depth == 1) or\
+               (parent and depth == parent.get_depth()):
                 ret.append(newobj)
             else:
                 parentobj = lnk[node.parent_id]
         if not self.__class__.node_order_by:
             try:
                 max = self.__class__.objects.filter(parent=self).reverse(
-                    )[0].sib_order
+                )[0].sib_order
             except IndexError:
                 max = 0
             newobj.sib_order = max + 1
         newobj = self.__class__(**kwargs)
 
         if not self.node_order_by:
-            newobj.sib_order = self.__class__._move_add_sibling_aux(pos,
-                                   self, stmts)
+            newobj.sib_order = self.__class__._move_add_sibling_aux(
+                pos, self, stmts)
 
         if self.parent_id:
             newobj.parent_id = self.parent_id
         """
 
         sib_order = target.sib_order
-        if pos == 'last-sibling' \
-                or (pos == 'right' and target == target.get_last_sibling()):
+        if (
+                pos == 'last-sibling' or
+                (pos == 'right' and target == target.get_last_sibling())
+        ):
             sib_order = target.get_last_sibling().sib_order + 1
         else:
             siblings = target.get_siblings()
-            siblings = {'left': siblings.filter(
-                                     sib_order__gte=target.sib_order),
-                        'right': siblings.filter(
-                                     sib_order__gt=target.sib_order),
-                        'first-sibling': siblings}[pos]
-            sib_order = {'left': sib_order,
-                         'right': sib_order + 1,
-                         'first-sibling': 1}[pos]
+            siblings = {
+                'left': siblings.filter(sib_order__gte=target.sib_order),
+                'right': siblings.filter(sib_order__gt=target.sib_order),
+                'first-sibling': siblings
+            }[pos]
+            sib_order = {
+                'left': sib_order,
+                'right': sib_order + 1,
+                'first-sibling': 1
+            }[pos]
             try:
                 min = siblings.order_by('sib_order')[0].sib_order
             except IndexError:
                 min = 0
             if min:
-                sql = 'UPDATE %(table)s' \
-                      ' SET sib_order=sib_order+1' \
-                      ' WHERE sib_order >= %%s' \
-                      ' AND ' % {'table':
-                                connection.ops.quote_name(cls._meta.db_table)}
+                sql = (
+                    'UPDATE %(table)s'
+                    ' SET sib_order=sib_order+1'
+                    ' WHERE sib_order >= %%s'
+                    ' AND '
+                ) % {'table': connection.ops.quote_name(cls._meta.db_table)}
+
                 params = [min]
                 if target.is_root():
                     sql += 'parent_id IS NULL'
 
         if target.is_descendant_of(self):
             raise InvalidMoveToDescendant(
-                    _("Can't move node to a descendant."))
+                _("Can't move node to a descendant."))
 
         if self == target and (
-              (pos == 'left') or
-              (pos in ('right', 'last-sibling') and
-                target == target.get_last_sibling()) or
-              (pos == 'first-sibling' and
-                target == target.get_first_sibling())):
+            (pos == 'left') or
+            (pos in ('right', 'last-sibling') and
+             target == target.get_last_sibling()) or
+            (pos == 'first-sibling' and
+             target == target.get_first_sibling())):
             # special cases, not actually moving the node so no need to UPDATE
             return
 
                 self.sib_order = sib_order
             else:
                 self.sib_order = self.__class__._move_add_sibling_aux(pos,
-                                        target, stmts)
+                                                                      target,
+                                                                      stmts)
             if parent:
                 self.parent = parent
             else:

File treebeard/forms.py

     """
 
     __position_choices_sorted = (
-                        ('sorted-child', _(u'Child of')),
-                        ('sorted-sibling', _(u'Sibling of')),
-                    )
+        ('sorted-child', _(u'Child of')),
+        ('sorted-sibling', _(u'Sibling of')),
+    )
 
     __position_choices_unsorted = (
-                        ('first-child', _(u'First child of')),
-                        ('left', _(u'Before')),
-                        ('right', _(u'After')),
-                    )
+        ('first-child', _(u'First child of')),
+        ('left', _(u'Before')),
+        ('right', _(u'After')),
+    )
 
     _position = forms.ChoiceField(required=True, label=_(u"Position"))
 
     def __init__(self, data=None, files=None, auto_id='id_%s', prefix=None,
                  initial=None, error_class=ErrorList, label_suffix=':',
                  empty_permitted=False, instance=None):
-
         opts = self._meta
         if instance:
             opts.model = type(instance)
         #self.is_sorted = (len(opts.model.node_order_by) > 0)
 
         if self.is_sorted:
-            self.declared_fields['_position'].choices = \
-                self.__class__.__position_choices_sorted
+            choices_sort_mode = self.__class__.__position_choices_sorted
         else:
-            self.declared_fields['_position'].choices = \
-                self.__class__.__position_choices_unsorted
+            choices_sort_mode = self.__class__.__position_choices_unsorted
+        self.declared_fields['_position'].choices = choices_sort_mode
 
         def mk_dropdown_tree(for_node=None):
             """ Creates a tree-like list of choices """
 
-            is_loop_safe = lambda(possible_parent): True
-            # Do actual check only if for_node is provided
-            if for_node is not None:
-                is_loop_safe = lambda(possible_parent): not (
-                            possible_parent == for_node) or (
-                            possible_parent.is_descendant_of(for_node))
+            def is_loop_safe(possible_parent):
+                if for_node is not None:
+                    return not (
+                        possible_parent == for_node
+                    ) or (possible_parent.is_descendant_of(for_node))
+                return True
 
-            mk_indent = lambda(level): '&nbsp;&nbsp;&nbsp;&nbsp;' * (level - 1)
+            def mk_indent(level):
+                return '&nbsp;&nbsp;&nbsp;&nbsp;' * (level - 1)
 
             def add_subtree(node, options):
                 """ Recursively build options tree. """
             if self.is_sorted:
                 node_parent = instance.get_parent()
                 if node_parent is None:
-                    object_data.update({'_ref_node_id': '',
-                                        '_position': 'sorted-child',
-                                        })
+                    object_data.update({
+                        '_ref_node_id': '',
+                        '_position': 'sorted-child',
+                    })
                 else:
-                    object_data.update({'_ref_node_id': node_parent.pk,
-                                        '_position': 'sorted-child',
-                                        })
+                    object_data.update({
+                        '_ref_node_id': node_parent.pk,
+                        '_position': 'sorted-child',
+                    })
             else:
                 prev_sibling = instance.get_prev_sibling()
                 if prev_sibling is None:
-                    if(instance.is_root()):
-                        object_data.update({'_ref_node_id': '',
-                                            '_position': 'first-child',
-                                            })
+                    if (instance.is_root()):
+                        object_data.update({
+                            '_ref_node_id': '',
+                            '_position': 'first-child',
+                        })
                     else:
-                        object_data.update(
-                            {'_ref_node_id': instance.get_parent().pk,
-                             '_position': 'first-child',
-                            })
+                        object_data.update({
+                            '_ref_node_id': instance.get_parent().pk,
+                            '_position': 'first-child',
+                        })
                 else:
-                    object_data.update({'_ref_node_id': prev_sibling.pk,
-                                        '_position': 'right',
-                                        })
+                    object_data.update({
+                        '_ref_node_id': prev_sibling.pk,
+                        '_position': 'right',
+                    })
             self.declared_fields['_ref_node_id'].choices = mk_dropdown_tree(
                 for_node=instance)
             self.instance = instance
             else:
                 if self.is_sorted:
                     self.instance.move(self.Meta.model.get_first_root_node(),
-                                                        pos='sorted-sibling')
+                                       pos='sorted-sibling')
                 else:
                     self.instance.move(self.Meta.model.get_first_root_node(),
                                        pos='first-sibling')
-            # Reload the instance
+                    # Reload the instance
         self.instance = self.Meta.model.objects.get(pk=self.instance.pk)
         super(MoveNodeForm, self).save(commit=commit)
         return self.instance

File treebeard/models.py

         if self.node_order_by and pos != 'sorted-sibling':
             raise InvalidPosition('Must use %s in add_sibling when'
                                   ' node_order_by is enabled' % (
-                                  'sorted-sibling', ))
+                                      'sorted-sibling', ))
         if pos == 'sorted-sibling' and not self.node_order_by:
             raise MissingNodeOrderBy('Missing node_order_by attribute.')
         return pos
                                               'sorted-sibling'):
             raise InvalidPosition('Must use %s or %s in add_sibling when'
                                   ' node_order_by is enabled' % (
-                                  'sorted-sibling', 'sorted-child'))
-        if pos in ('sorted-child', 'sorted-sibling') and \
-                not self.node_order_by:
+                                      'sorted-sibling', 'sorted-child'))
+        if (
+                pos in ('sorted-child', 'sorted-sibling') and
+                not self.node_order_by
+        ):
             raise MissingNodeOrderBy('Missing node_order_by attribute.')
         return pos
 
         fields, filters = [], []
         for field in self.node_order_by:
             value = getattr(newobj, field)
-            filters.append(Q(*
-                [Q(**{f: v}) for f, v in fields] +
-                [Q(**{'%s__gt' % field: value})]))
+            filters.append(
+                Q(
+                    *[Q(**{f: v}) for f, v in fields] +
+                     [Q(**{'%s__gt' % field: value})]
+                )
+            )
             fields.append((field, value))
         return siblings.filter(reduce(operator.or_, filters))
 
         start_depth, prev_depth = (None, None)
 
         for node in cls.get_tree(parent):
-
             depth = node.get_depth()
 
             if start_depth is None:
             engine = settings.DATABASES['default']['ENGINE']
         except (AttributeError, KeyError):
             engine = None
-        # the old style settings still work in Django 1.2+ if there is no
+            # the old style settings still work in Django 1.2+ if there is no
         # DATABASES setting
         if engine is None:
             engine = settings.DATABASE_ENGINE

File treebeard/mp_tree.py

 "Materialized Path Trees"
 
 import operator
-from numconv import NumConv
 
 from django.core import serializers
 from django.db import models, transaction, connection
 from django.db.models import Q
 from django.utils.translation import ugettext_noop as _
 
+from numconv import NumConv
 from treebeard.models import Node
 from treebeard.exceptions import InvalidMoveToDescendant, PathOverflow
 
         else:
             # adding the first root node
             newpath = cls._get_path(None, 1, 1)
-        # creating the new object
+            # creating the new object
         newobj = cls(**kwargs)
         newobj.depth = 1
         newobj.path = newpath
             if keep_ids:
                 newobj['id'] = pyobj['pk']
 
-            if (not parent and depth == 1) or \
-                    (parent and len(path) == len(parent.path)):
+            if (not parent and depth == 1) or\
+               (parent and len(path) == len(parent.path)):
                 ret.append(newobj)
             else:
                 parentpath = cls._get_basepath(path, depth - 1)
                 continue
 
             real_numchild = cls.objects.filter(
-                path__range=cls._get_children_path_interval(node.path)).extra(
-                    where=['LENGTH(path)/%d=%d' % (cls.steplen,
-                                                   node.depth + 1)]).count()
+                path__range=cls._get_children_path_interval(node.path)
+            ).extra(
+                where=['LENGTH(path)/%d=%d' % (cls.steplen, node.depth + 1)]
+            ).count()
             if real_numchild != node.numchild:
                 wrong_numchild.append(node.pk)
                 continue
             cls.objects.all().delete()
             cls.load_bulk(dump, None, True)
         else:
-
             cursor = connection.cursor()
 
             # fix the depth field
             # we need the WHERE to speed up postgres
-            sql = "UPDATE %s " \
-                    "SET depth=LENGTH(path)/%%s " \
+            sql = "UPDATE %s "\
+                  "SET depth=LENGTH(path)/%%s "\
                   "WHERE depth!=LENGTH(path)/%%s" % (
                       connection.ops.quote_name(cls._meta.db_table), )
             vals = [cls.steplen, cls.steplen]
             vals = ['_' * cls.steplen]
             # the cake and sql portability are a lie
             if cls.get_database_engine() == 'mysql':
-                sql = "SELECT tbn1.path, tbn1.numchild, (" \
-                              "SELECT COUNT(1) " \
-                              "FROM %(table)s AS tbn2 " \
-                              "WHERE tbn2.path LIKE " \
-                                "CONCAT(tbn1.path, %%s)) AS real_numchild " \
-                      "FROM %(table)s AS tbn1 " \
+                sql = "SELECT tbn1.path, tbn1.numchild, ("\
+                      "SELECT COUNT(1) "\
+                      "FROM %(table)s AS tbn2 "\
+                      "WHERE tbn2.path LIKE "\
+                      "CONCAT(tbn1.path, %%s)) AS real_numchild "\
+                      "FROM %(table)s AS tbn1 "\
                       "HAVING tbn1.numchild != real_numchild" % {
-                        'table': connection.ops.quote_name(cls._meta.db_table)}
+                          'table': connection.ops.quote_name(
+                              cls._meta.db_table)}
             else:
-                subquery = "(SELECT COUNT(1) FROM %(table)s AS tbn2" \
+                subquery = "(SELECT COUNT(1) FROM %(table)s AS tbn2"\
                            " WHERE tbn2.path LIKE tbn1.path||%%s)"
-                sql = "SELECT tbn1.path, tbn1.numchild, " + subquery + " " \
-                      "FROM %(table)s AS tbn1 " \
-                      "WHERE tbn1.numchild != " + subquery
+                sql = ("SELECT tbn1.path, tbn1.numchild, " + subquery +
+                       " FROM %(table)s AS tbn1 WHERE tbn1.numchild != " +
+                       subquery)
                 sql = sql % {
-                        'table': connection.ops.quote_name(cls._meta.db_table)}
+                    'table': connection.ops.quote_name(cls._meta.db_table)}
                 # we include the subquery twice
                 vals *= 2
             cursor.execute(sql, vals)
-            sql = "UPDATE %(table)s " \
-                     "SET numchild=%%s " \
-                   "WHERE path=%%s" % {
-                     'table': connection.ops.quote_name(cls._meta.db_table)}
+            sql = "UPDATE %(table)s "\
+                  "SET numchild=%%s "\
+                  "WHERE path=%%s" % {
+                      'table': connection.ops.quote_name(cls._meta.db_table)}
             for node_data in cursor.fetchall():
                 vals = [node_data[2], node_data[0]]
                 cursor.execute(sql, vals)
             params = []
             extrand = ''
 
-        sql = 'SELECT * FROM %(table)s AS t1 INNER JOIN ' \
-              ' (SELECT ' \
-              '   SUBSTR(path, 1, %(subpathlen)s) AS subpath, ' \
-              '   COUNT(1)-1 AS count ' \
-              '   FROM %(table)s ' \
-              '   WHERE depth >= %(depth)s %(extrand)s' \
-              '   GROUP BY subpath) AS t2 ' \
-              ' ON t1.path=t2.subpath ' \
+        sql = 'SELECT * FROM %(table)s AS t1 INNER JOIN '\
+              ' (SELECT '\
+              '   SUBSTR(path, 1, %(subpathlen)s) AS subpath, '\
+              '   COUNT(1)-1 AS count '\
+              '   FROM %(table)s '\
+              '   WHERE depth >= %(depth)s %(extrand)s'\
+              '   GROUP BY subpath) AS t2 '\
+              ' ON t1.path=t2.subpath '\
               ' ORDER BY t1.path' % {
-                    'table': connection.ops.quote_name(cls._meta.db_table),
-                    'subpathlen': depth * cls.steplen,
-                    'depth': depth,
-                    'extrand': extrand}
+                  'table': connection.ops.quote_name(cls._meta.db_table),
+                  'subpathlen': depth * cls.steplen,
+                  'depth': depth,
+                  'extrand': extrand}
         cursor = connection.cursor()
         cursor.execute(sql, params)
 
         ":returns: A queryset of all the node's children"
         if self.is_leaf():
             return self.__class__.objects.none()
-        return self.__class__.objects.filter(depth=self.depth + 1,
-            path__range=self._get_children_path_interval(self.path))
+        return self.__class__.objects.filter(
+            depth=self.depth + 1,
+            path__range=self._get_children_path_interval(self.path)
+        )
 
     def get_next_sibling(self):
         """
         else:
             # the node had no children, adding the first child
             newobj.path = self._get_path(self.path, newobj.depth, 1)
-            if len(newobj.path) > \
-                    newobj.__class__._meta.get_field('path').max_length:
+            max_length = newobj.__class__._meta.get_field('path').max_length
+            if len(newobj.path) > max_length:
                 raise PathOverflow(
-                        _('The new node is too deep in the tree, try'
-                          ' increasing the path.max_length property'
-                          ' and UPDATE your database'))
-        # saving the instance before returning it
+                    _('The new node is too deep in the tree, try'
+                      ' increasing the path.max_length property'
+                      ' and UPDATE your database'))
+            # saving the instance before returning it
         newobj.save()
         newobj._cached_parent_obj = self
 
         self.numchild += 1
 
         # we need to use a raw query
-        sql = "UPDATE %(table)s " \
-                 "SET numchild=numchild+1 " \
-               "WHERE path=%%s" % {
-                 'table': connection.ops.quote_name(
-                              self.__class__._meta.db_table)}
+        sql = "UPDATE %(table)s "\
+              "SET numchild=numchild+1 "\
+              "WHERE path=%%s" % {
+                  'table': connection.ops.quote_name(
+                      self.__class__._meta.db_table)}
         cursor = connection.cursor()
         cursor.execute(sql, [self.path])
         transaction.commit_unless_managed()
 
         stmts = []
         _, newpath = self._move_add_sibling_aux(pos, newpos,
-            self.depth, self, siblings, stmts, None, False)
+                                                self.depth, self, siblings,
+                                                stmts, None, False)
 
         parentpath = self._get_basepath(newpath, self.depth - 1)
         if parentpath:
             starting by the root node and descending to the parent.
         """
         paths = [self.path[0:pos]
-            for pos in range(0, len(self.path), self.steplen)[1:]]
+                 for pos in range(0, len(self.path), self.steplen)[1:]]
         return self.__class__.objects.filter(path__in=paths).order_by('depth')
 
     def get_parent(self, update=False):
         # initialize variables and if moving to a child, updates "move to
         # child" to become a "move to sibling" if possible (if it can't
         # be done, it means that we are  adding the first child)
-        pos, target, newdepth, siblings, newpos = self._fix_move_to_child(pos,
-            target, target.depth)
+        (pos, target, newdepth, siblings, newpos) = (
+            self._fix_move_to_child(pos, target, target.depth)
+        )
 
         if target.is_descendant_of(self):
             raise InvalidMoveToDescendant(
-                    _("Can't move node to a descendant."))
+                _("Can't move node to a descendant."))
 
         if oldpath == target.path and (
-              (pos == 'left') or
-              (pos in ('right', 'last-sibling') and
-                target.path == target.get_last_sibling().path) or
-              (pos == 'first-sibling' and
-                target.path == target.get_first_sibling().path)):
+            (pos == 'left') or
+            (pos in ('right', 'last-sibling') and
+             target.path == target.get_last_sibling().path) or
+            (pos == 'first-sibling' and
+             target.path == target.get_first_sibling().path)):
             # special cases, not actually moving the node so no need to UPDATE
             return
 
         stmts = []
         # generate the sql that will do the actual moving of nodes
         oldpath, newpath = self._move_add_sibling_aux(pos, newpos, newdepth,
-            target, siblings, stmts, oldpath, True)
+                                                      target, siblings, stmts,
+                                                      oldpath, True)
         # updates needed for mysql and children count in parents
         self._updates_after_move(oldpath, newpath, stmts)
 
 
         :returns: A tuple containing the old path and the new path.
         """
-        if pos == 'last-sibling' \
-                or (pos == 'right' and target == target.get_last_sibling()):
+        if (
+                (pos == 'last-sibling') or
+                (pos == 'right' and target == target.get_last_sibling())
+        ):
             # easy, the last node
             last = target.get_last_sibling()
             newpath = cls._inc_path(last.path)
             # the safe side we temporarily dump it on the end of the list
             tempnewpath = None
             if movebranch and len(oldpath) == len(newpath):
-                parentoldpath = cls._get_basepath(oldpath,
-                    (len(oldpath) / cls.steplen) - 1)
+                parentoldpath = cls._get_basepath(
+                    oldpath,
+                    (len(oldpath) / cls.steplen) - 1
+                )
                 parentnewpath = cls._get_basepath(newpath, newdepth - 1)
-                if (parentoldpath == parentnewpath and siblings and
-                        newpath < oldpath):
+                if (
+                    parentoldpath == parentnewpath and
+                    siblings and
+                    newpath < oldpath
+                ):
                     last = target.get_last_sibling()
                     basenum = cls._get_lastpos_in_path(last.path)
                     tempnewpath = cls._get_path(newpath, newdepth, basenum + 2)
                     stmts.append(cls._get_sql_newpath_in_branches(oldpath,
-                                                               tempnewpath))
+                                                                  tempnewpath))
 
             # Optimisation to only move siblings which need moving
             # (i.e. if we've got holes, allow them to compress)
                 # of the previous node it doesn't need shifting
                 if node.path > priorpath:
                     break
-                # It does need shifting, so add to the list
+                    # It does need shifting, so add to the list
                 movesiblings.append(node)
                 # Calculate the path that it would be moved to, as that's
                 # the next "priorpath"
                 # moving the siblings (and their branches) at the right of the
                 # related position one step to the right
                 sql, vals = cls._get_sql_newpath_in_branches(node.path,
-                    cls._inc_path(node.path))
+                                                             cls._inc_path(
+                                                                 node.path))
                 stmts.append((sql, vals))
 
                 if movebranch:
                 pos = {'first-child': 'first-sibling',
                        'last-child': 'last-sibling',
                        'sorted-child': 'sorted-sibling'}[pos]
+
             # this is not for save(), since if needed, will be handled with a
             # custom UPDATE, this is only here to update django's object,
             # should be useful in loops
         1. :attr:`depth` updates *ONLY* needed by mysql databases (*sigh*)
         2. update the number of children of parent nodes
         """
-        if (cls.get_database_engine() == 'mysql' and
-                len(oldpath) != len(newpath)):
+        if (
+                cls.get_database_engine() == 'mysql' and
+                len(oldpath) != len(newpath)
+        ):
             # no words can describe how dumb mysql is
             # we must update the depth of the branch in a different query
             stmts.append(cls._get_sql_update_depth_in_branch(newpath))
 
         oldparentpath = cls._get_parent_path_from_path(oldpath)
         newparentpath = cls._get_parent_path_from_path(newpath)
-        if (not oldparentpath and newparentpath) or \
-               (oldparentpath and not newparentpath) or \
-               (oldparentpath != newparentpath):
+        if (not oldparentpath and newparentpath) or\
+           (oldparentpath and not newparentpath) or\
+           (oldparentpath != newparentpath):
             # node changed parent, updating count
             if oldparentpath:
                 stmts.append(cls._get_sql_update_numchild(oldparentpath,
-                                                           'dec'))
+                                                          'dec'))
             if newparentpath:
                 stmts.append(cls._get_sql_update_numchild(newparentpath,
-                                                           'inc'))
+                                                          'inc'))
 
     @classmethod
     def _get_sql_newpath_in_branches(cls, oldpath, newpath):
 
         sql2 = ["path=%s" % (sqlpath, )]
         vals = [newpath, len(oldpath) + 1]
-        if (len(oldpath) != len(newpath) and
-                cls.get_database_engine() != 'mysql'):
+        if (
+                len(oldpath) != len(newpath) and
+                cls.get_database_engine() != 'mysql'
+        ):
             # when using mysql, this won't update the depth and it has to be
             # done in another query
             # doesn't even work with sql_mode='ANSI,TRADITIONAL'
         """
 
         # Right now this is only used by *sigh* mysql.
-        sql = "UPDATE %s SET depth=LENGTH(path)/%%s" \
+        sql = "UPDATE %s SET depth=LENGTH(path)/%%s"\
               " WHERE path LIKE %%s" % (
                   connection.ops.quote_name(cls._meta.db_table), )
         vals = [cls.steplen, path + '%']
     @classmethod
     def _get_sql_update_numchild(cls, path, incdec='inc'):
         ":returns: The sql needed the numchild value of a node"
-        sql = "UPDATE %s SET numchild=numchild%s1" \
+        sql = "UPDATE %s SET numchild=numchild%s1"\
               " WHERE path=%%s" % (
-                connection.ops.quote_name(cls._meta.db_table),
-                {'inc': '+', 'dec': '-'}[incdec])
+                  connection.ops.quote_name(cls._meta.db_table),
+                  {'inc': '+', 'dec': '-'}[incdec])
         vals = [path]
         return sql, vals
 

File treebeard/ns_tree.py

 "Nested Sets"
 
+import operator
+
 from django.core import serializers
 from django.db import connection, models, transaction
 from django.db.models import Q
 from django.utils.translation import ugettext_noop as _
 
-import operator
 from treebeard.exceptions import InvalidMoveToDescendant
 from treebeard.models import Node
 
                 ranges.append((node.tree_id, node.lft, node.rgt))
             if toremove:
                 self.model.objects.filter(
-                    reduce(operator.or_, toremove)).delete(
-                    removed_ranges=ranges)
+                    reduce(operator.or_,
+                           toremove)
+                ).delete(removed_ranges=ranges)
         transaction.commit_unless_managed()
 
 
             lftop = '>='
         else:
             lftop = '>'
-        sql = 'UPDATE %(table)s ' \
-              ' SET lft = CASE WHEN lft %(lftop)s %(parent_rgt)d ' \
-              '                THEN lft %(incdec)+d ' \
-              '                ELSE lft END, ' \
-              '     rgt = CASE WHEN rgt >= %(parent_rgt)d ' \
-              '                THEN rgt %(incdec)+d ' \
-              '                ELSE rgt END ' \
-              ' WHERE rgt >= %(parent_rgt)d AND ' \
+        sql = 'UPDATE %(table)s '\
+              ' SET lft = CASE WHEN lft %(lftop)s %(parent_rgt)d '\
+              '                THEN lft %(incdec)+d '\
+              '                ELSE lft END, '\
+              '     rgt = CASE WHEN rgt >= %(parent_rgt)d '\
+              '                THEN rgt %(incdec)+d '\
+              '                ELSE rgt END '\
+              ' WHERE rgt >= %(parent_rgt)d AND '\
               '       tree_id = %(tree_id)s' % {
                   'table': connection.ops.quote_name(cls._meta.db_table),
                   'parent_rgt': rgt,
 
     @classmethod
     def _move_tree_right(cls, tree_id):
-        sql = 'UPDATE %(table)s ' \
-              ' SET tree_id = tree_id+1 ' \
+        sql = 'UPDATE %(table)s '\
+              ' SET tree_id = tree_id+1 '\
               ' WHERE tree_id >= %(tree_id)d' % {
                   'table': connection.ops.quote_name(cls._meta.db_table),
                   'tree_id': tree_id}
                     pos = 'last-sibling'
 
             last_root = target.__class__.get_last_root_node()
-            if pos == 'last-sibling' \
-                  or (pos == 'right' and target == last_root):
+            if (
+                    (pos == 'last-sibling') or
+                    (pos == 'right' and target == last_root)
+            ):
                 newobj.tree_id = last_root.tree_id + 1
             else:
                 newpos = {'first-sibling': 1,
 
         if target.is_descendant_of(self):
             raise InvalidMoveToDescendant(
-                    _("Can't move node to a descendant."))
+                _("Can't move node to a descendant."))
 
         if self == target and (
-              (pos == 'left') or
-              (pos in ('right', 'last-sibling') and
-                target == target.get_last_sibling()) or
-              (pos == 'first-sibling' and
-                target == target.get_first_sibling())):
+            (pos == 'left') or
+            (pos in ('right', 'last-sibling') and
+             target == target.get_last_sibling()) or
+            (pos == 'first-sibling' and
+             target == target.get_first_sibling())):
             # special cases, not actually moving the node so no need to UPDATE
             return
 
             depthdiff += 1
 
         # move the tree to the hole
-        sql = "UPDATE %(table)s " \
-              " SET tree_id = %(target_tree)d, " \
-              "     lft = lft + %(jump)d , " \
-              "     rgt = rgt + %(jump)d , " \
-              "     depth = depth + %(depthdiff)d " \
-              " WHERE tree_id = %(from_tree)d AND " \
+        sql = "UPDATE %(table)s "\
+              " SET tree_id = %(target_tree)d, "\
+              "     lft = lft + %(jump)d , "\
+              "     rgt = rgt + %(jump)d , "\
+              "     depth = depth + %(depthdiff)d "\
+              " WHERE tree_id = %(from_tree)d AND "\
               "     lft BETWEEN %(fromlft)d AND %(fromrgt)d" % {
                   'table': connection.ops.quote_name(cls._meta.db_table),
                   'from_tree': fromobj.tree_id,
 
         # close the gap
         sql, params = cls._get_close_gap_sql(fromobj.lft,
-            fromobj.rgt, fromobj.tree_id)
+                                             fromobj.rgt, fromobj.tree_id)
         cursor.execute(sql, params)
 
         transaction.commit_unless_managed()
 
     @classmethod
     def _get_close_gap_sql(cls, drop_lft, drop_rgt, tree_id):
-        sql = 'UPDATE %(table)s ' \
-              ' SET lft = CASE ' \
-              '           WHEN lft > %(drop_lft)d ' \
-              '           THEN lft - %(gapsize)d ' \
-              '           ELSE lft END, ' \
-              '     rgt = CASE ' \
-              '           WHEN rgt > %(drop_lft)d ' \
-              '           THEN rgt - %(gapsize)d ' \
-              '           ELSE rgt END ' \
-              ' WHERE (lft > %(drop_lft)d ' \
+        sql = 'UPDATE %(table)s '\
+              ' SET lft = CASE '\
+              '           WHEN lft > %(drop_lft)d '\
+              '           THEN lft - %(gapsize)d '\
+              '           ELSE lft END, '\
+              '     rgt = CASE '\
+              '           WHEN rgt > %(drop_lft)d '\
+              '           THEN rgt - %(gapsize)d '\
+              '           ELSE rgt END '\
+              ' WHERE (lft > %(drop_lft)d '\
               '     OR rgt > %(drop_lft)d) AND '\
               '     tree_id=%(tree_id)d' % {
                   'table': connection.ops.quote_name(cls._meta.db_table),
             parent_id = parent.pk
         else:
             parent_id = None
-        # stack of nodes to analize
+            # stack of nodes to analize
         stack = [(parent_id, node) for node in bulk_data[::-1]]
         while stack:
             parent_id, node_struct = stack.pop()
             if keep_ids:
                 newobj['id'] = serobj['pk']
 
-            if (not parent and depth == 1) or \
-                    (parent and depth == parent.depth):
+            if (not parent and depth == 1) or\
+               (parent and depth == parent.depth):
                 ret.append(newobj)
             else:
                 parentobj = pyobj.get_parent()
         :returns: ``True`` if the node if a descendant of another node given
             as an argument, else, returns ``False``
         """
-        return self.tree_id == node.tree_id and \
-               self.lft > node.lft and \
-               self.rgt < node.rgt
+        return (
+            self.tree_id == node.tree_id and
+            self.lft > node.lft and
+            self.rgt < node.rgt
+        )
 
     def get_parent(self, update=False):
         """
                 return self._cached_parent_obj
         except AttributeError:
             pass
-        # parent = our most direct ancestor
+            # parent = our most direct ancestor
         self._cached_parent_obj = self.get_ancestors().reverse()[0]
         return self._cached_parent_obj
 

File treebeard/static/treebeard/jquery-ui-1.8.5.custom.min.js

  *
  * http://docs.jquery.com/UI
  */
-(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.5",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,
-NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?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):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"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");
-if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"));if(!isNaN(b)&&b!=0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind("mousedown.ui-disableSelection selectstart.ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f,
-"border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c.style(this,h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c.style(this,
-h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}});
-c(function(){var a=document.createElement("div"),b=document.body;c.extend(a.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.appendChild(a).offsetHeight===100;b.removeChild(a).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,
-d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery);
-;/*!
+(function (c, j) {
+    function k(a) {
+        return!c(a).parents().andSelf().filter(function () {
+            return c.curCSS(this, "visibility") === "hidden" || c.expr.filters.hidden(this)
+        }).length
+    }
+
+    c.ui = c.ui || {};
+    if (!c.ui.version) {
+        c.extend(c.ui, {version: "1.8.5", keyCode: {ALT: 18, BACKSPACE: 8, CAPS_LOCK: 20, COMMA: 188, COMMAND: 91, COMMAND_LEFT: 91, COMMAND_RIGHT: 93, CONTROL: 17, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, INSERT: 45, LEFT: 37, MENU: 93, NUMPAD_ADD: 107, NUMPAD_DECIMAL: 110, NUMPAD_DIVIDE: 111, NUMPAD_ENTER: 108, NUMPAD_MULTIPLY: 106,
+            NUMPAD_SUBTRACT: 109, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SHIFT: 16, SPACE: 32, TAB: 9, UP: 38, WINDOWS: 91}});
+        c.fn.extend({_focus: c.fn.focus, focus: function (a, b) {
+            return typeof a === "number" ? this.each(function () {
+                var d = this;
+                setTimeout(function () {
+                    c(d).focus();
+                    b && b.call(d)
+                }, a)
+            }) : this._focus.apply(this, arguments)
+        }, scrollParent: function () {
+            var a;
+            a = c.browser.msie && /(static|relative)/.test(this.css("position")) || /absolute/.test(this.css("position")) ? 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) : 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")) || !a.length ? c(document) : a
+        }, zIndex: function (a) {
+            if (a !== j)return this.css("zIndex", a);
+            if (this.length) {
+                a = c(this[0]);
+                for (var b; a.length && a[0] !== document;) {
+                    b = a.css("position");
+                    if (b === "absolute" || b === "relative" || b === "fixed") {
+                        b = parseInt(a.css("zIndex"));
+                        if (!isNaN(b) && b != 0)return b
+                    }
+                    a = a.parent()
+                }
+            }
+            return 0
+        }, disableSelection: function () {
+            return this.bind("mousedown.ui-disableSelection selectstart.ui-disableSelection", function (a) {
+                a.preventDefault()
+            })
+        }, enableSelection: function () {
+            return this.unbind(".ui-disableSelection")
+        }});
+        c.each(["Width", "Height"], function (a, b) {
+            function d(f, g, l, m) {
+                c.each(e, function () {
+                    g -= parseFloat(c.curCSS(f, "padding" + this, true)) || 0;
+                    if (l)g -= parseFloat(c.curCSS(f,
+                        "border" + this + "Width", true)) || 0;
+                    if (m)g -= parseFloat(c.curCSS(f, "margin" + this, true)) || 0
+                });
+                return g
+            }
+
+            var e = b === "Width" ? ["Left", "Right"] : ["Top", "Bottom"], h = b.toLowerCase(), i = {innerWidth: c.fn.innerWidth, innerHeight: c.fn.innerHeight, outerWidth: c.fn.outerWidth, outerHeight: c.fn.outerHeight};
+            c.fn["inner" + b] = function (f) {
+                if (f === j)return i["inner" + b].call(this);
+                return this.each(function () {
+                    c.style(this, h, d(this, f) + "px")
+                })
+            };
+            c.fn["outer" + b] = function (f, g) {
+                if (typeof f !== "number")return i["outer" + b].call(this, f);
+                return this.each(function () {
+                    c.style(this,
+                        h, d(this, f, true, g) + "px")
+                })
+            }
+        });
+        c.extend(c.expr[":"], {data: function (a, b, d) {
+            return!!c.data(a, d[3])
+        }, focusable: function (a) {
+            var b = a.nodeName.toLowerCase(), d = c.attr(a, "tabindex");
+            if ("area" === b) {
+                b = a.parentNode;
+                d = b.name;
+                if (!a.href || !d || b.nodeName.toLowerCase() !== "map")return false;
+                a = c("img[usemap=#" + d + "]")[0];
+                return!!a && k(a)
+            }
+            return(/input|select|textarea|button|object/.test(b) ? !a.disabled : "a" == b ? a.href || !isNaN(d) : !isNaN(d)) && k(a)
+        }, tabbable: function (a) {
+            var b = c.attr(a, "tabindex");
+            return(isNaN(b) || b >= 0) && c(a).is(":focusable")
+        }});
+        c(function () {
+            var a = document.createElement("div"), b = document.body;
+            c.extend(a.style, {minHeight: "100px", height: "auto", padding: 0, borderWidth: 0});
+            c.support.minHeight = b.appendChild(a).offsetHeight === 100;
+            b.removeChild(a).style.display = "none"
+        });
+        c.extend(c.ui, {plugin: {add: function (a, b, d) {
+            a = c.ui[a].prototype;
+            for (var e in d) {
+                a.plugins[e] = a.plugins[e] || [];
+                a.plugins[e].push([b, d[e]])
+            }
+        }, call: function (a, b, d) {
+            if ((b = a.plugins[b]) && a.element[0].parentNode)for (var e = 0; e < b.length; e++)a.options[b[e][0]] && b[e][1].apply(a.element,
+                d)
+        }}, contains: function (a, b) {
+            return document.compareDocumentPosition ? a.compareDocumentPosition(b) & 16 : a !== b && a.contains(b)
+        }, hasScroll: function (a, b) {
+            if (c(a).css("overflow") === "hidden")return false;
+            b = b && b === "left" ? "scrollLeft" : "scrollTop";
+            var d = false;
+            if (a[b] > 0)return true;
+            a[b] = 1;
+            d = a[b] > 0;
+            a[b] = 0;
+            return d
+        }, isOverAxis: function (a, b, d) {
+            return a > b && a < b + d
+        }, isOver: function (a, b, d, e, h, i) {
+            return c.ui.isOverAxis(a, d, h) && c.ui.isOverAxis(b, e, i)
+        }})
+    }
+})(jQuery);
+;
+/*!
  * jQuery UI Widget 1.8.5
  *
  * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
  *
  * http://docs.jquery.com/UI/Widget
  */
-(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,
-a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.substring(0,1)===
-"_")return h;e?this.each(function(){var g=b.data(this,a);if(!g)throw"cannot call methods on "+a+" prior to initialization; attempted to call method '"+d+"'";if(!b.isFunction(g[d]))throw"no such method '"+d+"' for "+a+" widget instance";var i=g[d].apply(g,f);if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",
-widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options,b.metadata&&b.metadata.get(c)[this.widgetName],a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._init()},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+
-"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(a,c){var d=a,e=this;if(arguments.length===0)return b.extend({},e.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}b.each(d,function(f,h){e._setOption(f,h)});return e},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},enable:function(){return this._setOption("disabled",
-false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
-;/*!
+(function (b, j) {
+    if (b.cleanData) {
+        var k = b.cleanData;
+        b.cleanData = function (a) {
+            for (var c = 0, d; (d = a[c]) != null; c++)b(d).triggerHandler("remove");
+            k(a)
+        }
+    } else {
+        var l = b.fn.remove;
+        b.fn.remove = function (a, c) {
+            return this.each(function () {
+                if (!c)if (!a || b.filter(a, [this]).length)b("*", this).add([this]).each(function () {
+                    b(this).triggerHandler("remove")
+                });
+                return l.call(b(this), a, c)
+            })
+        }
+    }
+    b.widget = function (a, c, d) {
+        var e = a.split(".")[0], f;
+        a = a.split(".")[1];
+        f = e + "-" + a;
+        if (!d) {
+            d = c;
+            c = b.Widget
+        }
+        b.expr[":"][f] = function (h) {
+            return!!b.data(h,
+                a)
+        };
+        b[e] = b[e] || {};
+        b[e][a] = function (h, g) {
+            arguments.length && this._createWidget(h, g)
+        };
+        c = new c;
+        c.options = b.extend(true, {}, c.options);
+        b[e][a].prototype = b.extend(true, c, {namespace: e, widgetName: a, widgetEventPrefix: b[e][a].prototype.widgetEventPrefix || a, widgetBaseClass: f}, d);
+        b.widget.bridge(a, b[e][a])
+    };
+    b.widget.bridge = function (a, c) {
+        b.fn[a] = function (d) {
+            var e = typeof d === "string", f = Array.prototype.slice.call(arguments, 1), h = this;
+            d = !e && f.length ? b.extend.apply(null, [true, d].concat(f)) : d;
+            if (e && d.substring(0, 1) ===
+                "_")return h;
+            e ? this.each(function () {
+                var g = b.data(this, a);
+                if (!g)throw"cannot call methods on " + a + " prior to initialization; attempted to call method '" + d + "'";
+                if (!b.isFunction(g[d]))throw"no such method '" + d + "' for " + a + " widget instance";
+                var i = g[d].apply(g, f);
+                if (i !== g && i !== j) {
+                    h = i;
+                    return false
+                }
+            }) : this.each(function () {
+                var g = b.data(this, a);
+                g ? g.option(d || {})._init() : b.data(this, a, new c(d, this))
+            });
+            return h
+        }
+    };
+    b.Widget = function (a, c) {
+        arguments.length && this._createWidget(a, c)
+    };
+    b.Widget.prototype = {widgetName: "widget",
+        widgetEventPrefix: "", options: {disabled: false}, _createWidget: function (a, c) {
+            b.data(c, this.widgetName, this);
+            this.element = b(c);
+            this.options = b.extend(true, {}, this.options, b.metadata && b.metadata.get(c)[this.widgetName], a);
+            var d = this;
+            this.element.bind("remove." + this.widgetName, function () {
+                d.destroy()
+            });
+            this._create();
+            this._init()
+        }, _create: function () {
+        }, _init: function () {
+        }, destroy: function () {
+            this.element.unbind("." + this.widgetName).removeData(this.widgetName);
+            this.widget().unbind("." + this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass +
+                "-disabled ui-state-disabled")
+        }, widget: function () {
+            return this.element
+        }, option: function (a, c) {
+            var d = a, e = this;
+            if (arguments.length === 0)return b.extend({}, e.options);
+            if (typeof a === "string") {
+                if (c === j)return this.options[a];
+                d = {};
+                d[a] = c
+            }
+            b.each(d, function (f, h) {
+                e._setOption(f, h)
+            });
+            return e
+        }, _setOption: function (a, c) {
+            this.options[a] = c;
+            if (a === "disabled")this.widget()[c ? "addClass" : "removeClass"](this.widgetBaseClass + "-disabled ui-state-disabled").attr("aria-disabled", c);
+            return this
+        }, enable: function () {
+            return this._setOption("disabled",
+                false)
+        }, disable: function () {
+            return this._setOption("disabled", true)
+        }, _trigger: function (a, c, d) {
+            var e = this.options[a];
+            c = b.Event(c);
+            c.type = (a === this.widgetEventPrefix ? a : this.widgetEventPrefix + a).toLowerCase();
+            d = d || {};
+            if (c.originalEvent) {
+                a = b.event.props.length;
+                for (var f; a;) {
+                    f = b.event.props[--a];
+                    c[f] = c.originalEvent[f]
+                }
+            }
+            this.element.trigger(c, d);
+            return!(b.isFunction(e) && e.call(this.element[0], c, d) === false || c.isDefaultPrevented())
+        }}
+})(jQuery);
+;
+/*!
  * jQuery UI Mouse 1.8.5
  *
  * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
  * Depends:
  *	jquery.ui.widget.js
  */
-(function(c){c.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(b){return a._mouseDown(b)}).bind("click."+this.widgetName,function(b){if(a._preventClickEvent){a._preventClickEvent=false;b.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(a){a.originalEvent=a.originalEvent||{};if(!a.originalEvent.mouseHandled){this._mouseStarted&&
-this._mouseUp(a);this._mouseDownEvent=a;var b=this,e=a.which==1,f=typeof this.options.cancel=="string"?c(a.target).parents().add(a.target).filter(this.options.cancel).length:false;if(!e||f||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){b.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault();
-return true}}this._mouseMoveDelegate=function(d){return b._mouseMove(d)};this._mouseUpDelegate=function(d){return b._mouseUp(d)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);c.browser.safari||a.preventDefault();return a.originalEvent.mouseHandled=true}},_mouseMove:function(a){if(c.browser.msie&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&
-this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=a.target==this._mouseDownEvent.target;this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-
-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
-;/*
+(function (c) {
+    c.widget("ui.mouse", {options: {cancel: ":input,option", distance: 1, delay: 0}, _mouseInit: function () {
+        var a = this;
+        this.element.bind("mousedown." + this.widgetName,function (b) {
+            return a._mouseDown(b)
+        }).bind("click." + this.widgetName, function (b) {
+            if (a._preventClickEvent) {
+                a._preventClickEvent = false;
+                b.stopImmediatePropagation();
+                return false
+            }
+        });
+        this.started = false
+    }, _mouseDestroy: function () {
+        this.element.unbind("." + this.widgetName)
+    }, _mouseDown: function (a) {
+        a.originalEvent = a.originalEvent || {};
+        if (!a.originalEvent.mouseHandled) {
+            this._mouseStarted &&
+            this._mouseUp(a);
+            this._mouseDownEvent = a;
+            var b = this, e = a.which == 1, f = typeof this.options.cancel == "string" ? c(a.target).parents().add(a.target).filter(this.options.cancel).length : false;
+            if (!e || f || !this._mouseCapture(a))return true;
+            this.mouseDelayMet = !this.options.delay;
+            if (!this.mouseDelayMet)this._mouseDelayTimer = setTimeout(function () {
+                b.mouseDelayMet = true
+            }, this.options.delay);
+            if (this._mouseDistanceMet(a) && this._mouseDelayMet(a)) {
+                this._mouseStarted = this._mouseStart(a) !== false;
+                if (!this._mouseStarted) {
+                    a.preventDefault();
+                    return true
+                }
+            }
+            this._mouseMoveDelegate = function (d) {
+                return b._mouseMove(d)
+            };
+            this._mouseUpDelegate = function (d) {
+                return b._mouseUp(d)
+            };
+            c(document).bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate);
+            c.browser.safari || a.preventDefault();
+            return a.originalEvent.mouseHandled = true
+        }
+    }, _mouseMove: function (a) {
+        if (c.browser.msie && !a.button)return this._mouseUp(a);
+        if (this._mouseStarted) {
+            this._mouseDrag(a);
+            return a.preventDefault()
+        }
+        if (this._mouseDistanceMet(a) &&
+            this._mouseDelayMet(a))(this._mouseStarted = this._mouseStart(this._mouseDownEvent, a) !== false) ? this._mouseDrag(a) : this._mouseUp(a);
+        return!this._mouseStarted
+    }, _mouseUp: function (a) {
+        c(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate);
+        if (this._mouseStarted) {
+            this._mouseStarted = false;
+            this._preventClickEvent = a.target == this._mouseDownEvent.target;
+            this._mouseStop(a)
+        }
+        return false
+    }, _mouseDistanceMet: function (a) {
+        return Math.max(Math.abs(this._mouseDownEvent.pageX -
+            a.pageX), Math.abs(this._mouseDownEvent.pageY - a.pageY)) >= this.options.distance
+    }, _mouseDelayMet: function () {
+        return this.mouseDelayMet
+    }, _mouseStart: function () {
+    }, _mouseDrag: function () {
+    }, _mouseStop: function () {
+    }, _mouseCapture: function () {
+        return true
+    }})
+})(jQuery);
+;
+/*
  * jQuery UI Position 1.8.5
  *
  * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
  *
  * http://docs.jquery.com/UI/Position
  */
-(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.scrollTo&&d.document){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j=
-{top:b.of.pageY,left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/
-2;if(b.at[1]==="bottom")j.top+=k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+parseInt(c.curCSS(this,"marginRight",true))||0,w=m+q+parseInt(c.curCSS(this,"marginBottom",true))||0,i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]===
-"center")i.top-=m/2;i.left=parseInt(i.left);i.top=parseInt(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();
-b.left=d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];
-b.left+=a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=
-c(b),g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery);
-;/*
+(function (c) {
+    c.ui = c.ui || {};
+    var n = /left|center|right/, o = /top|center|bottom/, t = c.fn.position, u = c.fn.offset;
+    c.fn.position = function (b) {
+        if (!b || !b.of)return t.apply(this, arguments);
+        b = c.extend({}, b);
+        var a = c(b.of), d = a[0], g = (b.collision || "flip").split(" "), e = b.offset ? b.offset.split(" ") : [0, 0], h, k, j;
+        if (d.nodeType === 9) {
+            h = a.width();
+            k = a.height();
+            j = {top: 0, left: 0}
+        } else if (d.scrollTo && d.document) {
+            h = a.width();
+            k = a.height();
+            j = {top: a.scrollTop(), left: a.scrollLeft()}
+        } else if (d.preventDefault) {
+            b.at = "left top";
+            h = k = 0;
+            j =
+            {top: b.of.pageY, left: b.of.pageX}
+        } else {
+            h = a.outerWidth();
+            k = a.outerHeight();
+            j = a.offset()
+        }
+        c.each(["my", "at"], function () {
+            var f = (b[this] || "").split(" ");
+            if (f.length === 1)f = n.test(f[0]) ? f.concat(["center"]) : o.test(f[0]) ? ["center"].concat(f) : ["center", "center"];
+            f[0] = n.test(f[0]) ? f[0] : "center";
+            f[1] = o.test(f[1]) ? f[1] : "center";
+            b[this] = f
+        });
+        if (g.length === 1)g[1] = g[0];
+        e[0] = parseInt(e[0], 10) || 0;
+        if (e.length === 1)e[1] = e[0];
+        e[1] = parseInt(e[1], 10) || 0;
+        if (b.at[0] === "right")j.left += h; else if (b.at[0] === "center")j.left += h /
+            2;
+        if (b.at[1] === "bottom")j.top += k; else if (b.at[1] === "center")j.top += k / 2;
+        j.left += e[0];
+        j.top += e[1];
+        return this.each(function () {
+            var f = c(this), l = f.outerWidth(), m = f.outerHeight(), p = parseInt(c.curCSS(this, "marginLeft", true)) || 0, q = parseInt(c.curCSS(this, "marginTop", true)) || 0, v = l + p + parseInt(c.curCSS(this, "marginRight", true)) || 0, w = m + q + parseInt(c.curCSS(this, "marginBottom", true)) || 0, i = c.extend({}, j), r;
+            if (b.my[0] === "right")i.left -= l; else if (b.my[0] === "center")i.left -= l / 2;
+            if (b.my[1] === "bottom")i.top -= m; else if (b.my[1] ===
+                "center")i.top -= m / 2;
+            i.left = parseInt(i.left);
+            i.top = parseInt(i.top);
+            r = {left: i.left - p, top: i.top - q};
+            c.each(["left", "top"], function (s, x) {
+                c.ui.position[g[s]] && c.ui.position[g[s]][x](i, {targetWidth: h, targetHeight: k, elemWidth: l, elemHeight: m, collisionPosition: r, collisionWidth: v, collisionHeight: w, offset: e, my: b.my, at: b.at})
+            });
+            c.fn.bgiframe && f.bgiframe();
+            f.offset(c.extend(i, {using: b.using}))
+        })
+    };
+    c.ui.position = {fit: {left: function (b, a) {
+        var d = c(window);
+        d = a.collisionPosition.left + a.collisionWidth - d.width() - d.scrollLeft();
+        b.left = d > 0 ? b.left - d : Math.max(b.left - a.collisionPosition.left, b.left)
+    }, top: function (b, a) {
+        var d = c(window);
+        d = a.collisionPosition.top + a.collisionHeight - d.height() - d.scrollTop();
+        b.top = d > 0 ? b.top - d : Math.max(b.top - a.collisionPosition.top, b.top)
+    }}, flip: {left: function (b, a) {
+        if (a.at[0] !== "center") {
+            var d = c(window);
+            d = a.collisionPosition.left + a.collisionWidth - d.width() - d.scrollLeft();
+            var g = a.my[0] === "left" ? -a.elemWidth : a.my[0] === "right" ? a.elemWidth : 0, e = a.at[0] === "left" ? a.targetWidth : -a.targetWidth, h = -2 * a.offset[0];
+            b.left += a.collisionPosition.left < 0 ? g + e + h : d > 0 ? g + e + h : 0
+        }
+    }, top: function (b, a) {
+        if (a.at[1] !== "center") {
+            var d = c(window);
+            d = a.collisionPosition.top + a.collisionHeight - d.height() - d.scrollTop();
+            var g = a.my[1] === "top" ? -a.elemHeight : a.my[1] === "bottom" ? a.elemHeight : 0, e = a.at[1] === "top" ? a.targetHeight : -a.targetHeight, h = -2 * a.offset[1];
+            b.top += a.collisionPosition.top < 0 ? g + e + h : d > 0 ? g + e + h : 0
+        }
+    }}};
+    if (!c.offset.setOffset) {
+        c.offset.setOffset = function (b, a) {
+            if (/static/.test(c.curCSS(b, "position")))b.style.position = "relative";
+            var d =
+                c(b), g = d.offset(), e = parseInt(c.curCSS(b, "top", true), 10) || 0, h = parseInt(c.curCSS(b, "left", true), 10) || 0;
+            g = {top: a.top - g.top + e, left: a.left - g.left + h};
+            "using"in a ? a.using.call(b, g) : d.css(g)
+        };
+        c.fn.offset = function (b) {
+            var a = this[0];
+            if (!a || !a.ownerDocument)return null;
+            if (b)return this.each(function () {
+                c.offset.setOffset(this, b)
+            });
+            return u.call(this)
+        }
+    }
+})(jQuery);
+;
+/*
  * jQuery UI Slider 1.8.5
  *
  * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
  *	jquery.ui.mouse.js
  *	jquery.ui.widget.js
  */
-(function(d){d.widget("ui.slider",d.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var a=this,b=this.options;this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");b.disabled&&this.element.addClass("ui-slider-disabled ui-disabled");
-this.range=d([]);if(b.range){if(b.range===true){this.range=d("<div></div>");if(!b.values)b.values=[this._valueMin(),this._valueMin()];if(b.values.length&&b.values.length!==2)b.values=[b.values[0],b.values[0]]}else this.range=d("<div></div>");this.range.appendTo(this.element).addClass("ui-slider-range");if(b.range==="min"||b.range==="max")this.range.addClass("ui-slider-range-"+b.range);this.range.addClass("ui-widget-header")}d(".ui-slider-handle",this.element).length===0&&d("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");
-if(b.values&&b.values.length)for(;d(".ui-slider-handle",this.element).length<b.values.length;)d("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");this.handles=d(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(c){c.preventDefault()}).hover(function(){b.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(b.disabled)d(this).blur();
-else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(c){d(this).data("index.ui-slider-handle",c)});this.handles.keydown(function(c){var e=true,f=d(this).data("index.ui-slider-handle"),h,g,i;if(!a.options.disabled){switch(c.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:e=
-false;if(!a._keySliding){a._keySliding=true;d(this).addClass("ui-state-active");h=a._start(c,f);if(h===false)return}break}i=a.options.step;h=a.options.values&&a.options.values.length?(g=a.values(f)):(g=a.value());switch(c.keyCode){case d.ui.keyCode.HOME:g=a._valueMin();break;case d.ui.keyCode.END:g=a._valueMax();break;case d.ui.keyCode.PAGE_UP:g=a._trimAlignValue(h+(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:g=a._trimAlignValue(h-(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(h===
-a._valueMax())return;g=a._trimAlignValue(h+i);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(h===a._valueMin())return;g=a._trimAlignValue(h-i);break}a._slide(c,f,g);return e}}).keyup(function(c){var e=d(this).data("index.ui-slider-handle");if(a._keySliding){a._keySliding=false;a._stop(c,e);a._change(c,e);d(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(a){var b=this.options,c,e,f,h,g;if(b.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:a.pageX,y:a.pageY});e=this._valueMax()-this._valueMin()+1;h=this;this.handles.each(function(i){var j=Math.abs(c-h.values(i));if(e>j){e=j;f=d(this);g=i}});if(b.range===true&&this.values(1)===b.min){g+=1;f=d(this.handles[g])}if(this._start(a,
-g)===false)return false;this._mouseSliding=true;h._handleIndex=g;f.addClass("ui-state-active").focus();b=f.offset();this._clickOffset=!d(a.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:a.pageX-b.left-f.width()/2,top:a.pageY-b.top-f.height()/2-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};this._slide(a,g,c);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(a){var b=
-this._normValueFromMouse({x:a.pageX,y:a.pageY});this._slide(a,this._handleIndex,b);return false},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b;if(this.orientation==="horizontal"){b=
-this.elementSize.width;a=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{b=this.elementSize.height;a=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}b=a/b;if(b>1)b=1;if(b<0)b=0;if(this.orientation==="vertical")b=1-b;a=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+b*a)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);
-c.values=this.values()}return this._trigger("start",a,c)},_slide:function(a,b,c){var e;if(this.options.values&&this.options.values.length){e=this.values(b?0:1);if(this.options.values.length===2&&this.options.range===true&&(b===0&&c>e||b===1&&c<e))c=e;if(c!==this.values(b)){e=this.values();e[b]=c;a=this._trigger("slide",a,{handle:this.handles[b],value:c,values:e});this.values(b?0:1);a!==false&&this.values(b,c,true)}}else if(c!==this.value()){a=this._trigger("slide",a,{handle:this.handles[b],value:c});
-a!==false&&this.value(c)}},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("change",a,c)}},value:function(a){if(arguments.length){this.options.value=
-this._trimAlignValue(a);this._refreshValue();this._change(null,0)}return this._value()},values:function(a,b){var c,e,f;if(arguments.length>1){this.options.values[a]=this._trimAlignValue(b);this._refreshValue();this._change(null,a)}if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;e=arguments[0];for(f=0;f<c.length;f+=1){c[f]=this._trimAlignValue(e[f]);this._change(null,f)}this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(a):this.value();
-else return this._values()},_setOption:function(a,b){var c,e=0;if(d.isArray(this.options.values))e=this.options.values.length;d.Widget.prototype._setOption.apply(this,arguments);switch(a){case "disabled":if(b){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled");this.element.addClass("ui-disabled")}else{this.handles.removeAttr("disabled");this.element.removeClass("ui-disabled")}break;case "orientation":this._detectOrientation();
-this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case "value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case "values":this._animateOff=true;this._refreshValue();for(c=0;c<e;c+=1)this._change(null,c);this._animateOff=false;break}},_value:function(){var a=this.options.value;return a=this._trimAlignValue(a)},_values:function(a){var b,c;if(arguments.length){b=this.options.values[a];
-return b=this._trimAlignValue(b)}else{b=this.options.values.slice();for(c=0;c<b.length;c+=1)b[c]=this._trimAlignValue(b[c]);return b}},_trimAlignValue:function(a){if(a<this._valueMin())return this._valueMin();if(a>this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=a%b;a=a-c;if(Math.abs(c)*2>=b)a+=c>0?b:-b;return parseFloat(a.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var a=
-this.options.range,b=this.options,c=this,e=!this._animateOff?b.animate:false,f,h={},g,i,j,l;if(this.options.values&&this.options.values.length)this.handles.each(function(k){f=(c.values(k)-c._valueMin())/(c._valueMax()-c._valueMin())*100;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";d(this).stop(1,1)[e?"animate":"css"](h,b.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(k===0)c.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},b.animate);if(k===1)c.range[e?"animate":"css"]({width:f-
-g+"%"},{queue:false,duration:b.animate})}else{if(k===0)c.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},b.animate);if(k===1)c.range[e?"animate":"css"]({height:f-g+"%"},{queue:false,duration:b.animate})}g=f});else{i=this.value();j=this._valueMin();l=this._valueMax();f=l!==j?(i-j)/(l-j)*100:0;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";this.handle.stop(1,1)[e?"animate":"css"](h,b.animate);if(a==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},
-b.animate);if(a==="max"&&this.orientation==="horizontal")this.range[e?"animate":"css"]({width:100-f+"%"},{queue:false,duration:b.animate});if(a==="min"&&this.orientation==="vertical")this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},b.animate);if(a==="max"&&this.orientation==="vertical")this.range[e?"animate":"css"]({height:100-f+"%"},{queue:false,duration:b.animate})}}});d.extend(d.ui.slider,{version:"1.8.5"})})(jQuery);
-;/*
+(function (d) {
+    d.widget("ui.slider", d.ui.mouse, {widgetEventPrefix: "slide", options: {animate: false, distance: 0, max: 100, min: 0, orientation: "horizontal", range: false, step: 1, value: 0, values: null}, _create: function () {
+        var a = this, b = this.options;
+        this._mouseSliding = this._keySliding = false;
+        this._animateOff = true;
+        this._handleIndex = null;
+        this._detectOrientation();
+        this._mouseInit();
+        this.element.addClass("ui-slider ui-slider-" + this.orientation + " ui-widget ui-widget-content ui-corner-all");
+        b.disabled && this.element.addClass("ui-slider-disabled ui-disabled");
+        this.range = d([]);
+        if (b.range) {
+            if (b.range === true) {
+                this.range = d("<div></div>");
+                if (!b.values)b.values = [this._valueMin(), this._valueMin()];
+                if (b.values.length && b.values.length !== 2)b.values = [b.values[0], b.values[0]]
+            } else this.range = d("<div></div>");
+            this.range.appendTo(this.element).addClass("ui-slider-range");
+            if (b.range === "min" || b.range === "max")this.range.addClass("ui-slider-range-" + b.range);
+            this.range.addClass("ui-widget-header")
+        }
+        d(".ui-slider-handle", this.element).length === 0 && d("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");
+        if (b.values && b.values.length)for (; d(".ui-slider-handle", this.element).length < b.values.length;)d("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");
+        this.handles = d(".ui-slider-handle", this.element).addClass("ui-state-default ui-corner-all");
+        this.handle = this.handles.eq(0);
+        this.handles.add(this.range).filter("a").click(function (c) {
+            c.preventDefault()
+        }).hover(function () {
+            b.disabled || d(this).addClass("ui-state-hover")
+        },function () {
+            d(this).removeClass("ui-state-hover")
+        }).focus(function () {
+            if (b.disabled)d(this).blur();
+            else {
+                d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");
+                d(this).addClass("ui-state-focus")
+            }
+        }).blur(function () {
+                d(this).removeClass("ui-state-focus")
+            });
+        this.handles.each(function (c) {
+            d(this).data("index.ui-slider-handle", c)
+        });
+        this.handles.keydown(function (c) {
+            var e = true, f = d(this).data("index.ui-slider-handle"), h, g, i;
+            if (!a.options.disabled) {
+                switch (c.keyCode) {
+                    case d.ui.keyCode.HOME:
+                    case d.ui.keyCode.END:
+                    case d.ui.keyCode.PAGE_UP:
+                    case d.ui.keyCode.PAGE_DOWN:
+                    case d.ui.keyCode.UP:
+                    case d.ui.keyCode.RIGHT:
+                    case d.ui.keyCode.DOWN:
+                    case d.ui.keyCode.LEFT:
+                        e =
+                            false;
+                        if (!a._keySliding) {
+                            a._keySliding = true;
+                            d(this).addClass("ui-state-active");
+                            h = a._start(c, f);
+                            if (h === false)return
+                        }
+                        break
+                }
+                i = a.options.step;
+                h = a.options.values && a.options.values.length ? (g = a.values(f)) : (g = a.value());
+                switch (c.keyCode) {
+                    case d.ui.keyCode.HOME:
+                        g = a._valueMin();
+                        break;
+                    case d.ui.keyCode.END:
+                        g = a._valueMax();
+                        break;
+                    case d.ui.keyCode.PAGE_UP:
+                        g = a._trimAlignValue(h + (a._valueMax() - a._valueMin()) / 5);
+                        break;
+                    case d.ui.keyCode.PAGE_DOWN:
+                        g = a._trimAlignValue(h - (a._valueMax() - a._valueMin()) / 5);
+                        break;
+                    case d.ui.keyCode.UP:
+                    case d.ui.keyCode.RIGHT:
+                        if (h ===
+                            a._valueMax())return;
+                        g = a._trimAlignValue(h + i);
+                        break;
+                    case d.ui.keyCode.DOWN:
+                    case d.ui.keyCode.LEFT:
+                        if (h === a._valueMin())return;
+                        g = a._trimAlignValue(h - i);
+                        break
+                }
+                a._slide(c, f, g);
+                return e
+            }
+        }).keyup(function (c) {
+                var e = d(this).data("index.ui-slider-handle");
+                if (a._keySliding) {
+                    a._keySliding = false;
+                    a._stop(c, e);
+                    a._change(c, e);
+                    d(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 (a) {
+        var b = this.options, c, e, f, h, g;
+        if (b.disabled)return false;
+        this.elementSize = {width: this.element.outerWidth(), height: this.element.outerHeight()};
+        this.elementOffset = this.element.offset();
+        c = this._normValueFromMouse({x: a.pageX, y: a.pageY});
+        e = this._valueMax() - this._valueMin() + 1;
+        h = this;
+        this.handles.each(function (i) {
+            var j = Math.abs(c - h.values(i));
+            if (e > j) {
+                e = j;
+                f = d(this);
+                g = i
+            }
+        });
+        if (b.range === true && this.values(1) === b.min) {
+            g += 1;
+            f = d(this.handles[g])
+        }
+        if (this._start(a,
+            g) === false)return false;
+        this._mouseSliding = true;
+        h._handleIndex = g;
+        f.addClass("ui-state-active").focus();
+        b = f.offset();
+        this._clickOffset = !d(a.target).parents().andSelf().is(".ui-slider-handle") ? {left: 0, top: 0} : {left: a.pageX - b.left - f.width() / 2, top: a.pageY - b.top - f.height() / 2 - (parseInt(f.css("borderTopWidth"), 10) || 0) - (parseInt(f.css("borderBottomWidth"), 10) || 0) + (parseInt(f.css("marginTop"), 10) || 0)};
+        this._slide(a, g, c);
+        return this._animateOff = true
+    }, _mouseStart: function () {
+        return true
+    }, _mouseDrag: function (a) {
+        var b =
+            this._normValueFromMouse({x: a.pageX, y: a.pageY});
+        this._slide(a, this._handleIndex, b);
+        return false
+    }, _mouseStop: function (a) {
+        this.handles.removeClass("ui-state-active");
+        this._mouseSliding = false;
+        this._stop(a, this._handleIndex);
+        this._change(a, this._handleIndex);
+        this._clickOffset = this._handleIndex = null;
+        return this._animateOff = false
+    }, _detectOrientation: function () {
+        this.orientation = this.options.orientation === "vertical" ? "vertical" : "horizontal"
+    }, _normValueFromMouse: function (a) {
+        var b;
+        if (this.orientation === "horizontal") {
+            b =
+                this.elementSize.width;
+            a = a.x - this.elementOffset.left - (this._clickOffset ? this._clickOffset.left : 0)
+        } else {
+            b = this.elementSize.height;
+            a = a.y - this.elementOffset.top - (this._clickOffset ? this._clickOffset.top : 0)
+        }
+        b = a / b;
+        if (b > 1)b = 1;
+        if (b < 0)b = 0;
+        if (this.orientation === "vertical")b = 1 - b;
+        a = this._valueMax() - this._valueMin();
+        return this._trimAlignValue(this._valueMin() + b * a)
+    }, _start: function (a, b) {
+        var c = {handle: this.handles[b], value: this.value()};
+        if (this.options.values && this.options.values.length) {
+            c.value = this.values(b);
+            c.values = this.values()
+        }
+        return this._trigger("start", a, c)
+    }, _slide: function (a, b, c) {
+        var e;
+        if (this.options.values && this.options.values.length) {
+            e = this.values(b ? 0 : 1);
+            if (this.options.values.length === 2 && this.options.range === true && (b === 0 && c > e || b === 1 && c < e))c = e;
+            if (c !== this.values(b)) {
+                e = this.values();
+                e[b] = c;
+                a = this._trigger("slide", a, {handle: this.handles[b], value: c, values: e});
+                this.values(b ? 0 : 1);
+                a !== false && this.values(b, c, true)
+            }
+        } else if (c !== this.value()) {
+            a = this._trigger("slide", a, {handle: this.handles[b], value: c});
+            a !== false && this.value(c)
+        }
+    }, _stop: function (a, b) {
+        var c = {handle: this.handles[b], value: this.value()};
+        if (this.options.values && this.options.values.length) {
+            c.value = this.values(b);
+            c.values = this.values()
+        }
+        this._trigger("stop", a, c)
+    }, _change: function (a, b) {
+        if (!this._keySliding && !this._mouseSliding) {
+            var c = {handle: this.handles[b], value: this.value()};
+            if (this.options.values && this.options.values.length) {
+                c.value = this.values(b);
+                c.values = this.values()
+            }
+            this._trigger("change", a, c)
+        }
+    }, value: function (a) {
+        if (arguments.length) {
+            this.options.value =
+                this._trimAlignValue(a);
+            this._refreshValue();
+            this._change(null, 0)
+        }
+        return this._value()
+    }, values: function (a, b) {
+        var c, e, f;
+        if (arguments.length > 1) {
+            this.options.values[a] = this._trimAlignValue(b);
+            this._refreshValue();
+            this._change(null, a)
+        }
+        if (arguments.length)if (d.isArray(arguments[0])) {
+            c = this.options.values;
+            e = arguments[0];
+            for (f = 0; f < c.length; f += 1) {
+                c[f] = this._trimAlignValue(e[f]);
+                this._change(null, f)
+            }
+            this._refreshValue()
+        } else return this.options.values && this.options.values.length ? this._values(a) : this.value();
+        else return this._values()
+    }, _setOption: function (a, b) {
+        var c, e = 0;
+        if (d.isArray(this.options.values))e = this.options.values.length;
+        d.Widget.prototype._setOption.apply(this, arguments);
+        switch (a) {
+            case "disabled":
+                if (b) {
+                    this.handles.filter(".ui-state-focus").blur();
+                    this.handles.removeClass("ui-state-hover");
+                    this.handles.attr("disabled", "disabled");
+                    this.element.addClass("ui-disabled")
+                } else {
+                    this.handles.removeAttr("disabled");
+                    this.element.removeClass("ui-disabled")
+                }
+                break;
+            case "orientation":
+                this._detectOrientation();
+                this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-" + this.orientation);
+                this._refreshValue();
+                break;
+            case "value":
+                this._animateOff = true;
+                this._refreshValue();
+                this._change(null, 0);
+                this._animateOff = false;
+                break;
+            case "values":
+                this._animateOff = true;
+                this._refreshValue();
+                for (c = 0; c < e; c += 1)this._change(null, c);
+                this._animateOff = false;
+                break
+        }
+    }, _value: function () {
+        var a = this.options.value;
+        return a = this._trimAlignValue(a)
+    }, _values: function (a) {
+        var b, c;
+        if (arguments.length) {
+            b = this.options.values[a];
+            return b = this._trimAlignValue(b)
+        } else {
+            b = this.options.values.slice();
+            for (c = 0; c < b.length; c += 1)b[c] = this._trimAlignValue(b[c]);
+            return b
+        }
+    }, _trimAlignValue: function (a) {
+        if (a < this._valueMin())return this._valueMin();
+        if (a > this._valueMax())return this._valueMax();
+        var b = this.options.step > 0 ? this.options.step : 1, c = a % b;
+        a = a - c;
+        if (Math.abs(c) * 2 >= b)a += c > 0 ? b : -b;
+        return parseFloat(a.toFixed(5))
+    }, _valueMin: function () {
+        return this.options.min
+    }, _valueMax: function () {
+        return this.options.max
+    }, _refreshValue: function () {
+        var a =
+            this.options.range, b = this.options, c = this, e = !this._animateOff ? b.animate : false, f, h = {}, g, i, j, l;
+        if (this.options.values && this.options.values.length)this.handles.each(function (k) {
+            f = (c.values(k) - c._valueMin()) / (c._valueMax() - c._valueMin()) * 100;
+            h[c.orientation === "horizontal" ? "left" : "bottom"] = f + "%";
+            d(this).stop(1, 1)[e ? "animate" : "css"](h, b.animate);
+            if (c.options.range === true)if (c.orientation === "horizontal") {
+                if (k === 0)c.range.stop(1, 1)[e ? "animate" : "css"]({left: f + "%"}, b.animate);
+                if (k === 1)c.range[e ? "animate" : "css"]({width: f -
+                    g + "%"}, {queue: false, duration: b.animate})
+            } else {
+                if (k === 0)c.range.stop(1, 1)[e ? "animate" : "css"]({bottom: f + "%"}, b.animate);
+                if (k === 1)c.range[e ? "animate" : "css"]({height: f - g + "%"}, {queue: false, duration: b.animate})
+            }
+            g = f
+        }); else {
+            i = this.value();
+            j = this._valueMin();
+            l = this._valueMax();
+            f = l !== j ? (i - j) / (l - j) * 100 : 0;
+            h[c.orientation === "horizontal" ? "left" : "bottom"] = f + "%";
+            this.handle.stop(1, 1)[e ? "animate" : "css"](h, b.animate);
+            if (a === "min" && this.orientation === "horizontal")this.range.stop(1, 1)[e ? "animate" : "css"]({width: f + "%"},
+                b.animate);
+            if (a === "max" && this.orientation === "horizontal")this.range[e ? "animate" : "css"]({width: 100 - f + "%"}, {queue: false, duration: b.animate});
+            if (a === "min" && this.orientation === "vertical")this.range.stop(1, 1)[e ? "animate" : "css"]({height: f + "%"}, b.animate);
+            if (a === "max" && this.orientation === "vertical")this.range[e ? "animate" : "css"]({height: 100 - f + "%"}, {queue: false, duration: b.animate})
+        }
+    }});
+    d.extend(d.ui.slider, {version: "1.8.5"})
+})(jQuery);
+;
+/*
  * jQuery UI Datepicker 1.8.5
  *
  * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
  * Depends:
  *	jquery.ui.core.js
  */
-(function(d,G){function L(){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};d.extend(this._defaults,this.regional[""]);this.dpDiv=d('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>')}function E(a,b){d.extend(a,
-b);for(var c in b)if(b[c]==null||b[c]==G)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.5"}});var y=(new Date).getTime();d.extend(L.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){E(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=
-f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:d('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')}},
-_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&
-b.append.remove();if(c){b.append=d('<span class="'+this._appendClass+'">'+c+"</span>");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("<img/>").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('<button type="button"></button>').addClass(this._triggerClass).html(f==