Added django-compress.
authorŁukasz Rekucki <lrekucki@gmail.com>
Fri, 12 Mar 2010 23:33:26 +0000 (00:33 +0100)
committerŁukasz Rekucki <lrekucki@gmail.com>
Fri, 12 Mar 2010 23:33:26 +0000 (00:33 +0100)
55 files changed:
apps/compress/__init__.py [new file with mode: 0644]
apps/compress/conf/__init__.py [new file with mode: 0644]
apps/compress/conf/settings.py [new file with mode: 0644]
apps/compress/filter_base.py [new file with mode: 0644]
apps/compress/filters/__init__.py [new file with mode: 0644]
apps/compress/filters/csstidy/__init__.py [new file with mode: 0644]
apps/compress/filters/csstidy_python/__init__.py [new file with mode: 0644]
apps/compress/filters/csstidy_python/csstidy.py [new file with mode: 0644]
apps/compress/filters/csstidy_python/data.py [new file with mode: 0644]
apps/compress/filters/csstidy_python/optimizer.py [new file with mode: 0644]
apps/compress/filters/csstidy_python/output.py [new file with mode: 0644]
apps/compress/filters/csstidy_python/tools.py [new file with mode: 0644]
apps/compress/filters/jsmin/__init__.py [new file with mode: 0644]
apps/compress/filters/jsmin/jsmin.py [new file with mode: 0644]
apps/compress/filters/yui/__init__.py [new file with mode: 0644]
apps/compress/management/__init__.py [new file with mode: 0644]
apps/compress/management/commands/__init__.py [new file with mode: 0644]
apps/compress/management/commands/synccompress.py [new file with mode: 0644]
apps/compress/models.py [new file with mode: 0644]
apps/compress/signals.py [new file with mode: 0644]
apps/compress/templates/compress/.tmp_css.html.32854~ [new file with mode: 0644]
apps/compress/templates/compress/.tmp_js.html.60841~ [new file with mode: 0644]
apps/compress/templates/compress/css.html [new file with mode: 0644]
apps/compress/templates/compress/css_ie.html [new file with mode: 0644]
apps/compress/templates/compress/js.html [new file with mode: 0644]
apps/compress/templates/compress/js_ie.html [new file with mode: 0644]
apps/compress/templatetags/__init__.py [new file with mode: 0644]
apps/compress/templatetags/compressed.py [new file with mode: 0644]
apps/compress/utils.py [new file with mode: 0644]
apps/compress/versioning/__init__.py [new file with mode: 0644]
apps/compress/versioning/base.py [new file with mode: 0644]
apps/compress/versioning/hash/__init__.py [new file with mode: 0644]
apps/compress/versioning/mtime/__init__.py [new file with mode: 0644]
apps/wiki/templates/wiki/document_details.html
apps/wiki/templates/wiki/document_list.html
fabfile.py
platforma/settings.py
platforma/static/css/autumn.css [deleted file]
platforma/static/css/awesome-overlay-sprite.png [deleted file]
platforma/static/css/buttons.css [deleted file]
platforma/static/css/jquery.modal.css [deleted file]
platforma/static/css/managment.css [deleted file]
platforma/static/css/pygments.css [deleted file]
platforma/static/css/toolbar.css [deleted file]
platforma/static/js/jquery-1.4.2.min.js [new file with mode: 0644]
platforma/static/js/lib/jquery.cookie.js [deleted file]
platforma/static/js/lib/jquery.hpanel.js [deleted file]
platforma/static/js/lib/jquery.js [deleted file]
platforma/static/js/lib/jquery.json.js [deleted file]
platforma/static/js/lib/jquery.lazyload.js [deleted file]
platforma/static/js/lib/jquery.logging.js [deleted file]
platforma/static/js/lib/jquery.modal.js [deleted file]
platforma/static/js/lib/jquery.splitter.js [deleted file]
platforma/static/js/lib/jquery.wtooltip.js [deleted file]
platforma/templates/base.html

diff --git a/apps/compress/__init__.py b/apps/compress/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/apps/compress/conf/__init__.py b/apps/compress/conf/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/apps/compress/conf/settings.py b/apps/compress/conf/settings.py
new file mode 100644 (file)
index 0000000..4c71561
--- /dev/null
@@ -0,0 +1,20 @@
+from django.core.exceptions import ImproperlyConfigured
+from django.conf import settings
+
+COMPRESS = getattr(settings, 'COMPRESS', not settings.DEBUG)
+COMPRESS_AUTO = getattr(settings, 'COMPRESS_AUTO', True)
+COMPRESS_VERSION = getattr(settings, 'COMPRESS_VERSION', False)
+COMPRESS_VERSION_PLACEHOLDER = getattr(settings, 'COMPRESS_VERSION_PLACEHOLDER', '?')
+COMPRESS_VERSION_DEFAULT = getattr(settings, 'COMPRESS_VERSION_DEFAULT', '0')
+COMPRESS_VERSIONING = getattr(settings, 'COMPRESS_VERSIONING', 'compress.versioning.mtime.MTimeVersioning')
+
+COMPRESS_CSS_FILTERS = getattr(settings, 'COMPRESS_CSS_FILTERS', ['compress.filters.csstidy.CSSTidyFilter'])
+COMPRESS_JS_FILTERS = getattr(settings, 'COMPRESS_JS_FILTERS', ['compress.filters.jsmin.JSMinFilter'])
+COMPRESS_CSS = getattr(settings, 'COMPRESS_CSS', {})
+COMPRESS_JS = getattr(settings, 'COMPRESS_JS', {})
+
+if COMPRESS_CSS_FILTERS is None:
+    COMPRESS_CSS_FILTERS = []
+
+if COMPRESS_JS_FILTERS is None:
+    COMPRESS_JS_FILTERS = []
diff --git a/apps/compress/filter_base.py b/apps/compress/filter_base.py
new file mode 100644 (file)
index 0000000..9b98531
--- /dev/null
@@ -0,0 +1,14 @@
+class FilterBase:
+    def __init__(self, verbose):
+        self.verbose = verbose
+
+    def filter_css(self, css):
+        raise NotImplementedError
+    def filter_js(self, js):
+        raise NotImplementedError
+        
+class FilterError(Exception):
+    """
+    This exception is raised when a filter fails
+    """
+    pass
\ No newline at end of file
diff --git a/apps/compress/filters/__init__.py b/apps/compress/filters/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/apps/compress/filters/csstidy/__init__.py b/apps/compress/filters/csstidy/__init__.py
new file mode 100644 (file)
index 0000000..d40e8ee
--- /dev/null
@@ -0,0 +1,33 @@
+import os
+import warnings
+import tempfile
+
+from django.conf import settings
+
+from compress.filter_base import FilterBase
+
+BINARY = getattr(settings, 'CSSTIDY_BINARY', 'csstidy')
+ARGUMENTS = getattr(settings, 'CSSTIDY_ARGUMENTS', '--template=highest')
+
+warnings.simplefilter('ignore', RuntimeWarning)
+
+class CSSTidyFilter(FilterBase):
+    def filter_css(self, css):
+        tmp_file = tempfile.NamedTemporaryFile(mode='w+b')
+        tmp_file.write(css)
+        tmp_file.flush()
+
+        output_file = tempfile.NamedTemporaryFile(mode='w+b')
+        
+        command = '%s %s %s %s' % (BINARY, tmp_file.name, ARGUMENTS, output_file.name)
+        
+        command_output = os.popen(command).read()
+        
+        filtered_css = output_file.read()
+        output_file.close()
+        tmp_file.close()
+        
+        if self.verbose:
+            print command_output
+        
+        return filtered_css
diff --git a/apps/compress/filters/csstidy_python/__init__.py b/apps/compress/filters/csstidy_python/__init__.py
new file mode 100644 (file)
index 0000000..7d581ed
--- /dev/null
@@ -0,0 +1,19 @@
+from django.conf import settings
+
+from compress.filter_base import FilterBase
+from compress.filters.csstidy_python.csstidy import CSSTidy
+
+COMPRESS_CSSTIDY_SETTINGS = getattr(settings, 'COMPRESS_CSSTIDY_SETTINGS', {})
+
+class CSSTidyFilter(FilterBase):
+    def filter_css(self, css):
+        tidy = CSSTidy()
+        
+        for k, v in COMPRESS_CSSTIDY_SETTINGS.items():
+            tidy.setSetting(k, v)
+
+        tidy.parse(css)
+
+        r = tidy.Output('string')
+        
+        return r
diff --git a/apps/compress/filters/csstidy_python/csstidy.py b/apps/compress/filters/csstidy_python/csstidy.py
new file mode 100644 (file)
index 0000000..6ae8dc7
--- /dev/null
@@ -0,0 +1,636 @@
+# CSSTidy - CSS Parse
+#
+# CSS Parser class
+#
+# This file is part of CSSTidy.
+#
+# CSSTidy is free software you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation either version 2 of the License, or
+# (at your option) any later version.
+#
+# CSSTidy is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with CSSTidy if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+# @license http://opensource.org/licenses/gpl-license.php GNU Public License
+# @package csstidy
+# @author Dj Gilcrease (digitalxero at gmail dot com) 2005-2006
+
+import re
+
+from optimizer import CSSOptimizer
+from output import CSSPrinter
+import data
+from tools import SortedDict
+
+class CSSTidy(object):
+    #Saves the parsed CSS
+    _css = ""
+    _raw_css = SortedDict()
+    _optimized_css = SortedDict()
+
+    #List of Tokens
+    _tokens = []
+
+    #Printer class
+    _output = None
+
+    #Optimiser class
+    _optimizer = None
+
+    #Saves the CSS charset (@charset)
+    _charset = ''
+
+    #Saves all @import URLs
+    _import = []
+
+    #Saves the namespace
+    _namespace = ''
+
+    #Contains the version of csstidy
+    _version = '1.3'
+
+    #Stores the settings
+    _settings = {}
+
+    # Saves the parser-status.
+    #
+    # Possible values:
+    # - is = in selector
+    # - ip = in property
+    # - iv = in value
+    # - instr = in string (started at " or ' or ( )
+    # - ic = in comment (ignore everything)
+    # - at = in @-block
+    _status = 'is'
+
+    #Saves the current at rule (@media)
+    _at = ''
+
+    #Saves the current selector
+    _selector = ''
+
+    #Saves the current property
+    _property = ''
+
+    #Saves the position of , in selectors
+    _sel_separate = []
+
+    #Saves the current value
+    _value = ''
+
+    #Saves the current sub-value
+    _sub_value = ''
+
+    #Saves all subvalues for a property.
+    _sub_value_arr = []
+
+    #Saves the char which opened the last string
+    _str_char = ''
+    _cur_string = ''
+
+    #Status from which the parser switched to ic or instr
+    _from = ''
+
+    #Variable needed to manage string-in-strings, for example url("foo.png")
+    _str_in_str = False
+
+    #=True if in invalid at-rule
+    _invalid_at = False
+
+    #=True if something has been added to the current selector
+    _added = False
+
+    #Saves the message log
+    _log = SortedDict()
+
+    #Saves the line number
+    _line = 1
+
+    def __init__(self):
+        self._settings['remove_bslash'] = True
+        self._settings['compress_colors'] = True
+        self._settings['compress_font-weight'] = True
+        self._settings['lowercase_s'] = False
+        self._settings['optimise_shorthands'] = 2
+        self._settings['remove_last_'] = False
+        self._settings['case_properties'] = 1
+        self._settings['sort_properties'] = False
+        self._settings['sort_selectors'] = False
+        self._settings['merge_selectors'] = 2
+        self._settings['discard_invalid_properties'] = False
+        self._settings['css_level'] = 'CSS2.1'
+        self._settings['preserve_css'] = False
+        self._settings['timestamp'] = False
+        self._settings['template'] = 'highest_compression'
+
+        #Maps self._status to methods
+        self.__statusMethod = {'is':self.__parseStatus_is, 'ip': self.__parseStatus_ip, 'iv':self.__parseStatus_iv, 'instr':self.__parseStatus_instr, 'ic':self.__parseStatus_ic, 'at':self.__parseStatus_at}
+
+        self._output = CSSPrinter(self)
+        self._optimizer = CSSOptimizer(self)
+
+    #Public Methods
+    def getSetting(self, setting):
+        return self._settings.get(setting, False)
+
+    #Set the value of a setting.
+    def setSetting(self, setting, value):
+        self._settings[setting] = value
+        return True
+
+    def log(self, message, ttype, line = -1):
+        if line == -1:
+            line = self._line
+
+        line = int(line)
+
+        add = {'m': message, 't': ttype}
+
+        if not self._log.has_key(line):
+            self._log[line] = []
+            self._log[line].append(add)
+        elif add not in self._log[line]:
+            self._log[line].append(add)
+
+
+    #Checks if a character is escaped (and returns True if it is)
+    def escaped(self, string, pos):
+        return not (string[pos-1] != '\\' or self.escaped(string, pos-1))
+
+    #Adds CSS to an existing media/selector
+    def merge_css_blocks(self, media, selector, css_add):
+        for prop, value in css_add.iteritems():
+            self.__css_add_property(media, selector, prop, value, False)
+
+    #Checks if $value is !important.
+    def is_important(self, value):
+        return '!important' in value.lower()
+
+    #Returns a value without !important
+    def gvw_important(self, value):
+        if self.is_important(value):
+            ret = value.strip()
+            ret = ret[0:-9]
+            ret = ret.strip()
+            ret = ret[0:-1]
+            ret = ret.strip()
+            return ret
+
+        return value
+
+    def parse(self, cssString):
+        #Switch from \r\n to \n
+        self._css = cssString.replace("\r\n", "\n") + ' '
+        self._raw_css = {}
+        self._optimized_css = {}
+        self._curComment = ''
+
+        #Start Parsing
+        i = 0
+        while i < len(cssString):
+            if self._css[i] == "\n" or self._css[i] == "\r":
+                self._line += 1
+
+            i += self.__statusMethod[self._status](i)
+
+            i += 1;
+
+        self._optimized_css = self._optimizer.optimize(self._raw_css)
+
+    def parseFile(self, filename):
+        try:
+            f = open(filename, "r")
+            self.parse(f.read())
+        finally:
+            f.close()
+
+    #Private Methods
+    def __parseStatus_is(self, idx):
+        """
+            Parse in Selector
+        """
+        ret = 0
+
+        if self.__is_token(self._css, idx):
+            if self._css[idx] == '/' and self._css[idx+1] == '*' and self._selector.strip() == '':
+                self._status = 'ic'
+                self._from = 'is'
+                return 1
+
+            elif self._css[idx] == '@' and self._selector.strip() == '':
+                #Check for at-rule
+                self._invalid_at = True
+
+                for name, ttype in data.at_rules.iteritems():
+                    if self._css[idx+1:len(name)].lower() == name.lower():
+                        if ttype == 'at':
+                            self._at = '@' + name
+                        else:
+                            self._selector = '@' + name
+
+                        self._status = ttype
+                        self._invalid_at = False
+                        ret += len(name)
+
+                if self._invalid_at:
+                    self._selector = '@'
+                    invalid_at_name = ''
+                    for j in xrange(idx+1, len(self._css)):
+                        if not self._css[j].isalpha():
+                            break;
+
+                        invalid_at_name += self._css[j]
+
+                    self.log('Invalid @-rule: ' + invalid_at_name + ' (removed)', 'Warning')
+
+            elif self._css[idx] == '"' or self._css[idx] == "'":
+                self._cur_string = self._css[idx]
+                self._status = 'instr'
+                self._str_char = self._css[idx]
+                self._from = 'is'
+
+            elif self._invalid_at and self._css[idx] == ';':
+                self._invalid_at = False
+                self._status = 'is'
+
+            elif self._css[idx] == '{':
+                self._status = 'ip'
+                self.__add_token(data.SEL_START, self._selector)
+                self._added = False;
+
+            elif self._css[idx] == '}':
+                self.__add_token(data.AT_END, self._at)
+                self._at = ''
+                self._selector = ''
+                self._sel_separate = []
+
+            elif self._css[idx] == ',':
+                self._selector = self._selector.strip() + ','
+                self._sel_separate.append(len(self._selector))
+
+            elif self._css[idx] == '\\':
+                self._selector += self.__unicode(idx)
+
+            #remove unnecessary universal selector,  FS#147
+            elif not (self._css[idx] == '*' and self._css[idx+1] in ('.', '#', '[', ':')):
+                self._selector += self._css[idx]
+
+        else:
+            lastpos = len(self._selector)-1
+
+            if lastpos == -1 or not ((self._selector[lastpos].isspace() or self.__is_token(self._selector, lastpos) and self._selector[lastpos] == ',') and self._css[idx].isspace()):
+                self._selector += self._css[idx]
+
+        return ret
+
+    def __parseStatus_ip(self, idx):
+        """
+            Parse in property
+        """
+        if self.__is_token(self._css, idx):
+            if (self._css[idx] == ':' or self._css[idx] == '=') and self._property != '':
+                self._status = 'iv'
+
+                if not self.getSetting('discard_invalid_properties') or self.__property_is_valid(self._property):
+                    self.__add_token(data.PROPERTY, self._property)
+
+            elif self._css[idx] == '/' and self._css[idx+1] == '*' and self._property == '':
+                self._status = 'ic'
+                self._from = 'ip'
+                return 1
+
+            elif self._css[idx] == '}':
+                self.__explode_selectors()
+                self._status = 'is'
+                self._invalid_at = False
+                self.__add_token(data.SEL_END, self._selector)
+                self._selector = ''
+                self._property = ''
+
+            elif self._css[idx] == ';':
+                self._property = ''
+
+            elif self._css[idx] == '\\':
+                self._property += self.__unicode(idx)
+
+        elif not self._css[idx].isspace():
+            self._property += self._css[idx]
+
+        return 0
+
+    def __parseStatus_iv(self, idx):
+        """
+            Parse in value
+        """
+        pn = (( self._css[idx] == "\n" or self._css[idx] == "\r") and self.__property_is_next(idx+1) or idx == len(self._css)) #CHECK#
+        if self.__is_token(self._css, idx) or pn:
+            if self._css[idx] == '/' and self._css[idx+1] == '*':
+                self._status = 'ic'
+                self._from = 'iv'
+                return 1
+
+            elif self._css[idx] == '"' or self._css[idx] == "'" or self._css[idx] == '(':
+                self._cur_string = self._css[idx]
+                self._str_char = ')' if self._css[idx] == '(' else self._css[idx]
+                self._status = 'instr'
+                self._from = 'iv'
+
+            elif self._css[idx] == ',':
+                self._sub_value = self._sub_value.strip() + ','
+
+            elif self._css[idx] == '\\':
+                self._sub_value += self.__unicode(idx)
+
+            elif self._css[idx] == ';' or pn:
+                if len(self._selector) > 0 and self._selector[0] == '@' and data.at_rules.has_key(self._selector[1:]) and data.at_rules[self._selector[1:]] == 'iv':
+                    self._sub_value_arr.append(self._sub_value.strip())
+
+                    self._status = 'is'
+
+                    if '@charset' in self._selector:
+                        self._charset = self._sub_value_arr[0]
+
+                    elif '@namespace' in self._selector:
+                        self._namespace = ' '.join(self._sub_value_arr)
+
+                    elif '@import' in self._selector:
+                        self._import.append(' '.join(self._sub_value_arr))
+
+
+                    self._sub_value_arr = []
+                    self._sub_value = ''
+                    self._selector = ''
+                    self._sel_separate = []
+
+                else:
+                    self._status = 'ip'
+
+            elif self._css[idx] != '}':
+                self._sub_value += self._css[idx]
+
+            if (self._css[idx] == '}' or self._css[idx] == ';' or pn) and self._selector != '':
+                if self._at == '':
+                    self._at = data.DEFAULT_AT
+
+                #case settings
+                if self.getSetting('lowercase_s'):
+                    self._selector = self._selector.lower()
+
+                self._property = self._property.lower()
+
+                if self._sub_value != '':
+                    self._sub_value_arr.append(self._sub_value)
+                    self._sub_value = ''
+
+                self._value = ' '.join(self._sub_value_arr)
+
+
+                self._selector = self._selector.strip()
+
+                valid = self.__property_is_valid(self._property)
+
+                if (not self._invalid_at or self.getSetting('preserve_css')) and (not self.getSetting('discard_invalid_properties') or valid):
+                    self.__css_add_property(self._at, self._selector, self._property, self._value)
+                    self.__add_token(data.VALUE, self._value)
+
+                if not valid:
+                    if self.getSetting('discard_invalid_properties'):
+                        self.log('Removed invalid property: ' + self._property, 'Warning')
+
+                    else:
+                        self.log('Invalid property in ' + self.getSetting('css_level').upper() + ': ' + self._property, 'Warning')
+
+                self._property = '';
+                self._sub_value_arr = []
+                self._value = ''
+
+            if self._css[idx] == '}':
+                self.__explode_selectors()
+                self.__add_token(data.SEL_END, self._selector)
+                self._status = 'is'
+                self._invalid_at = False
+                self._selector = ''
+
+        elif not pn:
+            self._sub_value += self._css[idx]
+
+            if self._css[idx].isspace():
+                if self._sub_value != '':
+                    self._sub_value_arr.append(self._sub_value)
+                    self._sub_value = ''
+
+        return 0
+
+    def __parseStatus_instr(self, idx):
+        """
+            Parse in String
+        """
+        if self._str_char == ')' and (self._css[idx] == '"' or self._css[idx] == "'") and not self.escaped(self._css, idx):
+            self._str_in_str = not self._str_in_str
+
+        temp_add = self._css[idx] # ...and no not-escaped backslash at the previous position
+        if (self._css[idx] == "\n" or self._css[idx] == "\r") and not (self._css[idx-1] == '\\' and not self.escaped(self._css, idx-1)):
+            temp_add = "\\A "
+            self.log('Fixed incorrect newline in string', 'Warning')
+
+        if not (self._str_char == ')' and self._css[idx].isspace() and not self._str_in_str):
+            self._cur_string += temp_add
+
+        if self._css[idx] == self._str_char and not self.escaped(self._css, idx) and not self._str_in_str:
+            self._status = self._from
+            regex = re.compile(r'([\s]+)', re.I | re.U | re.S)
+            if regex.match(self._cur_string) is None and self._property != 'content':
+                if self._str_char == '"' or self._str_char == "'":
+                    self._cur_string = self._cur_string[1:-1]
+
+                elif len(self._cur_string) > 3 and (self._cur_string[1] == '"' or self._cur_string[1] == "'"):
+                    self._cur_string = self._cur_string[0] + self._cur_string[2:-2] + self._cur_string[-1]
+
+            if self._from == 'iv':
+                self._sub_value += self._cur_string
+
+            elif self._from == 'is':
+                self._selector += self._cur_string
+
+        return 0
+
+    def __parseStatus_ic(self, idx):
+        """
+            Parse css In Comment
+        """
+        if self._css[idx] == '*' and self._css[idx+1] == '/':
+            self._status = self._from
+            self.__add_token(data.COMMENT, self._curComment)
+            self._curComment = ''
+            return 1
+
+        else:
+            self._curComment += self._css[idx]
+
+        return 0
+
+    def __parseStatus_at(self, idx):
+        """
+            Parse in at-block
+        """
+        if self.__is_token(string, idx):
+            if self._css[idx] == '/' and self._css[idx+1] == '*':
+                self._status = 'ic'
+                self._from = 'at'
+                return 1
+
+            elif self._css[i] == '{':
+                self._status = 'is'
+                self.__add_token(data.AT_START, self._at)
+
+            elif self._css[i] == ',':
+                self._at = self._at.strip() + ','
+
+            elif self._css[i] == '\\':
+                self._at += self.__unicode(i)
+        else:
+            lastpos = len(self._at)-1
+            if not (self._at[lastpos].isspace() or self.__is_token(self._at, lastpos) and self._at[lastpos] == ',') and self._css[i].isspace():
+                self._at += self._css[i]
+
+        return 0
+
+    def __explode_selectors(self):
+        #Explode multiple selectors
+        if self.getSetting('merge_selectors') == 1:
+            new_sels = []
+            lastpos = 0;
+            self._sel_separate.append(len(self._selector))
+
+            for num in xrange(len(self._sel_separate)):
+                pos = self._sel_separate[num]
+                if num == (len(self._sel_separate)): #CHECK#
+                    pos += 1
+
+                new_sels.append(self._selector[lastpos:(pos-lastpos-1)])
+                lastpos = pos
+
+            if len(new_sels) > 1:
+                for selector in new_sels:
+                    self.merge_css_blocks(self._at, selector, self._raw_css[self._at][self._selector])
+
+                del self._raw_css[self._at][self._selector]
+
+        self._sel_separate = []
+
+    #Adds a property with value to the existing CSS code
+    def __css_add_property(self, media, selector, prop, new_val):
+        if self.getSetting('preserve_css') or new_val.strip() == '':
+            return
+
+        if not self._raw_css.has_key(media):
+            self._raw_css[media] = SortedDict()
+
+        if not self._raw_css[media].has_key(selector):
+            self._raw_css[media][selector] = SortedDict()
+
+        self._added = True
+        if self._raw_css[media][selector].has_key(prop):
+            if (self.is_important(self._raw_css[media][selector][prop]) and self.is_important(new_val)) or not self.is_important(self._raw_css[media][selector][prop]):
+                del self._raw_css[media][selector][prop]
+                self._raw_css[media][selector][prop] = new_val.strip()
+
+        else:
+            self._raw_css[media][selector][prop] = new_val.strip()
+
+    #Checks if the next word in a string from pos is a CSS property
+    def __property_is_next(self, pos):
+        istring = self._css[pos: len(self._css)]
+        pos = istring.find(':')
+        if pos == -1:
+            return False;
+
+        istring = istring[:pos].strip().lower()
+        if data.all_properties.has_key(istring):
+            self.log('Added semicolon to the end of declaration', 'Warning')
+            return True
+
+        return False;
+
+    #Checks if a property is valid
+    def __property_is_valid(self, prop):
+        return (data.all_properties.has_key(prop) and data.all_properties[prop].find(self.getSetting('css_level').upper()) != -1)
+
+    #Adds a token to self._tokens
+    def __add_token(self, ttype, cssdata, do=False):
+        if self.getSetting('preserve_css') or do:
+            if ttype == data.COMMENT:
+                token = [ttype, cssdata]
+            else:
+                token = [ttype, cssdata.strip()]
+
+            self._tokens.append(token)
+
+    #Parse unicode notations and find a replacement character
+    def __unicode(self, idx):
+       ##FIX##
+       return ''
+
+    #Starts parsing from URL
+    ##USED?
+    def __parse_from_url(self, url):
+        try:
+            if "http" in url.lower() or "https" in url.lower():
+                f = urllib.urlopen(url)
+            else:
+                f = open(url)
+
+            data = f.read()
+            return self.parse(data)
+        finally:
+            f.close()
+
+    #Checks if there is a token at the current position
+    def __is_token(self, string, idx):
+        return (string[idx] in data.tokens and not self.escaped(string, idx))
+
+
+    #Property Methods
+    def _getOutput(self):
+        self._output.prepare(self._optimized_css)
+        return self._output.render
+
+    def _getLog(self):
+        ret = ""
+        ks = self._log.keys()
+        ks.sort()
+        for line in ks:
+            for msg in self._log[line]:
+                ret += "Type: " + msg['t'] + "\n"
+                ret += "Message: " + msg['m'] + "\n"
+            ret += "\n"
+
+        return ret
+
+    def _getCSS(self):
+        return self._css
+
+
+    #Properties
+    Output = property(_getOutput, None)
+    Log = property(_getLog, None)
+    CSS = property(_getCSS, None)
+
+
+if __name__ == '__main__':
+    import sys
+    tidy = CSSTidy()
+    f = open(sys.argv[1], "r")
+    css = f.read()
+    f.close()
+    tidy.parse(css)
+    tidy.Output('file', filename="Stylesheet.min.css")
+    print tidy.Output()
+    #print tidy._import
\ No newline at end of file
diff --git a/apps/compress/filters/csstidy_python/data.py b/apps/compress/filters/csstidy_python/data.py
new file mode 100644 (file)
index 0000000..bd728cb
--- /dev/null
@@ -0,0 +1,421 @@
+# Various CSS Data for CSSTidy
+#
+# This file is part of CSSTidy.
+#
+# CSSTidy is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# CSSTidy is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with CSSTidy; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+# @license http://opensource.org/licenses/gpl-license.php GNU Public License
+# @package csstidy
+# @author Florian Schmitz (floele at gmail dot com) 2005
+
+AT_START    = 1
+AT_END      = 2
+SEL_START   = 3
+SEL_END     = 4
+PROPERTY    = 5
+VALUE       = 6
+COMMENT     = 7
+DEFAULT_AT  = 41
+
+# All whitespace allowed in CSS
+#
+# @global array whitespace
+# @version 1.0
+whitespace = frozenset([' ',"\n","\t","\r","\x0B"])
+
+# All CSS tokens used by csstidy
+#
+# @global string tokens
+# @version 1.0
+tokens = '/@}{;:=\'"(,\\!$%&)#+.<>?[]^`|~'
+
+# All CSS units (CSS 3 units included)
+#
+# @see compress_numbers()
+# @global array units
+# @version 1.0
+units = frozenset(['in','cm','mm','pt','pc','px','rem','em','%','ex','gd','vw','vh','vm','deg','grad','rad','ms','s','khz','hz'])
+
+# Available at-rules
+#
+# @global array at_rules
+# @version 1.0
+at_rules = {'page':'is', 'font-face':'is', 'charset':'iv', 'import':'iv', 'namespace':'iv', 'media':'at'}
+
+# Properties that need a value with unit
+#
+# @todo CSS3 properties
+# @see compress_numbers()
+# @global array unit_values
+# @version 1.2
+unit_values = frozenset(['background', 'background-position', 'border', 'border-top', 'border-right', 'border-bottom',
+                                    'border-left', 'border-width', 'border-top-width', 'border-right-width', 'border-left-width',
+                                    'border-bottom-width', 'bottom', 'border-spacing', 'font-size','height', 'left', 'margin', 'margin-top',
+                                    'margin-right', 'margin-bottom', 'margin-left', 'max-height', 'max-width', 'min-height', 'min-width',
+                                    'outline-width', 'padding', 'padding-top', 'padding-right', 'padding-bottom', 'padding-left','position',
+                                    'right', 'top', 'text-indent', 'letter-spacing', 'word-spacing', 'width'
+                                    ])
+
+
+# Properties that allow <color> as value
+#
+# @todo CSS3 properties
+# @see compress_numbers()
+# @global array color_values
+# @version 1.0
+color_values = frozenset(['background-color', 'border-color', 'border-top-color', 'border-right-color',
+                                        'border-bottom-color', 'border-left-color', 'color', 'outline-color'])
+
+
+# Default values for the background properties
+#
+# @todo Possibly property names will change during CSS3 development
+# @global array background_prop_default
+# @see dissolve_short_bg()
+# @see merge_bg()
+# @version 1.0
+background_prop_default = {}
+background_prop_default['background-image'] = 'none'
+background_prop_default['background-size'] = 'auto'
+background_prop_default['background-repeat'] = 'repeat'
+background_prop_default['background-position'] = '0 0'
+background_prop_default['background-attachment'] = 'scroll'
+background_prop_default['background-clip'] = 'border'
+background_prop_default['background-origin'] = 'padding'
+background_prop_default['background-color'] = 'transparent'
+
+# A list of non-W3C color names which get replaced by their hex-codes
+#
+# @global array replace_colors
+# @see cut_color()
+# @version 1.0
+replace_colors = {}
+replace_colors['aliceblue'] = '#F0F8FF'
+replace_colors['antiquewhite'] = '#FAEBD7'
+replace_colors['aquamarine'] = '#7FFFD4'
+replace_colors['azure'] = '#F0FFFF'
+replace_colors['beige'] = '#F5F5DC'
+replace_colors['bisque'] = '#FFE4C4'
+replace_colors['blanchedalmond'] = '#FFEBCD'
+replace_colors['blueviolet'] = '#8A2BE2'
+replace_colors['brown'] = '#A52A2A'
+replace_colors['burlywood'] = '#DEB887'
+replace_colors['cadetblue'] = '#5F9EA0'
+replace_colors['chartreuse'] = '#7FFF00'
+replace_colors['chocolate'] = '#D2691E'
+replace_colors['coral'] = '#FF7F50'
+replace_colors['cornflowerblue'] = '#6495ED'
+replace_colors['cornsilk'] = '#FFF8DC'
+replace_colors['crimson'] = '#DC143C'
+replace_colors['cyan'] = '#00FFFF'
+replace_colors['darkblue'] = '#00008B'
+replace_colors['darkcyan'] = '#008B8B'
+replace_colors['darkgoldenrod'] = '#B8860B'
+replace_colors['darkgray'] = '#A9A9A9'
+replace_colors['darkgreen'] = '#006400'
+replace_colors['darkkhaki'] = '#BDB76B'
+replace_colors['darkmagenta'] = '#8B008B'
+replace_colors['darkolivegreen'] = '#556B2F'
+replace_colors['darkorange'] = '#FF8C00'
+replace_colors['darkorchid'] = '#9932CC'
+replace_colors['darkred'] = '#8B0000'
+replace_colors['darksalmon'] = '#E9967A'
+replace_colors['darkseagreen'] = '#8FBC8F'
+replace_colors['darkslateblue'] = '#483D8B'
+replace_colors['darkslategray'] = '#2F4F4F'
+replace_colors['darkturquoise'] = '#00CED1'
+replace_colors['darkviolet'] = '#9400D3'
+replace_colors['deeppink'] = '#FF1493'
+replace_colors['deepskyblue'] = '#00BFFF'
+replace_colors['dimgray'] = '#696969'
+replace_colors['dodgerblue'] = '#1E90FF'
+replace_colors['feldspar'] = '#D19275'
+replace_colors['firebrick'] = '#B22222'
+replace_colors['floralwhite'] = '#FFFAF0'
+replace_colors['forestgreen'] = '#228B22'
+replace_colors['gainsboro'] = '#DCDCDC'
+replace_colors['ghostwhite'] = '#F8F8FF'
+replace_colors['gold'] = '#FFD700'
+replace_colors['goldenrod'] = '#DAA520'
+replace_colors['greenyellow'] = '#ADFF2F'
+replace_colors['honeydew'] = '#F0FFF0'
+replace_colors['hotpink'] = '#FF69B4'
+replace_colors['indianred'] = '#CD5C5C'
+replace_colors['indigo'] = '#4B0082'
+replace_colors['ivory'] = '#FFFFF0'
+replace_colors['khaki'] = '#F0E68C'
+replace_colors['lavender'] = '#E6E6FA'
+replace_colors['lavenderblush'] = '#FFF0F5'
+replace_colors['lawngreen'] = '#7CFC00'
+replace_colors['lemonchiffon'] = '#FFFACD'
+replace_colors['lightblue'] = '#ADD8E6'
+replace_colors['lightcoral'] = '#F08080'
+replace_colors['lightcyan'] = '#E0FFFF'
+replace_colors['lightgoldenrodyellow'] = '#FAFAD2'
+replace_colors['lightgrey'] = '#D3D3D3'
+replace_colors['lightgreen'] = '#90EE90'
+replace_colors['lightpink'] = '#FFB6C1'
+replace_colors['lightsalmon'] = '#FFA07A'
+replace_colors['lightseagreen'] = '#20B2AA'
+replace_colors['lightskyblue'] = '#87CEFA'
+replace_colors['lightslateblue'] = '#8470FF'
+replace_colors['lightslategray'] = '#778899'
+replace_colors['lightsteelblue'] = '#B0C4DE'
+replace_colors['lightyellow'] = '#FFFFE0'
+replace_colors['limegreen'] = '#32CD32'
+replace_colors['linen'] = '#FAF0E6'
+replace_colors['magenta'] = '#FF00FF'
+replace_colors['mediumaquamarine'] = '#66CDAA'
+replace_colors['mediumblue'] = '#0000CD'
+replace_colors['mediumorchid'] = '#BA55D3'
+replace_colors['mediumpurple'] = '#9370D8'
+replace_colors['mediumseagreen'] = '#3CB371'
+replace_colors['mediumslateblue'] = '#7B68EE'
+replace_colors['mediumspringgreen'] = '#00FA9A'
+replace_colors['mediumturquoise'] = '#48D1CC'
+replace_colors['mediumvioletred'] = '#C71585'
+replace_colors['midnightblue'] = '#191970'
+replace_colors['mintcream'] = '#F5FFFA'
+replace_colors['mistyrose'] = '#FFE4E1'
+replace_colors['moccasin'] = '#FFE4B5'
+replace_colors['navajowhite'] = '#FFDEAD'
+replace_colors['oldlace'] = '#FDF5E6'
+replace_colors['olivedrab'] = '#6B8E23'
+replace_colors['orangered'] = '#FF4500'
+replace_colors['orchid'] = '#DA70D6'
+replace_colors['palegoldenrod'] = '#EEE8AA'
+replace_colors['palegreen'] = '#98FB98'
+replace_colors['paleturquoise'] = '#AFEEEE'
+replace_colors['palevioletred'] = '#D87093'
+replace_colors['papayawhip'] = '#FFEFD5'
+replace_colors['peachpuff'] = '#FFDAB9'
+replace_colors['peru'] = '#CD853F'
+replace_colors['pink'] = '#FFC0CB'
+replace_colors['plum'] = '#DDA0DD'
+replace_colors['powderblue'] = '#B0E0E6'
+replace_colors['rosybrown'] = '#BC8F8F'
+replace_colors['royalblue'] = '#4169E1'
+replace_colors['saddlebrown'] = '#8B4513'
+replace_colors['salmon'] = '#FA8072'
+replace_colors['sandybrown'] = '#F4A460'
+replace_colors['seagreen'] = '#2E8B57'
+replace_colors['seashell'] = '#FFF5EE'
+replace_colors['sienna'] = '#A0522D'
+replace_colors['skyblue'] = '#87CEEB'
+replace_colors['slateblue'] = '#6A5ACD'
+replace_colors['slategray'] = '#708090'
+replace_colors['snow'] = '#FFFAFA'
+replace_colors['springgreen'] = '#00FF7F'
+replace_colors['steelblue'] = '#4682B4'
+replace_colors['tan'] = '#D2B48C'
+replace_colors['thistle'] = '#D8BFD8'
+replace_colors['tomato'] = '#FF6347'
+replace_colors['turquoise'] = '#40E0D0'
+replace_colors['violet'] = '#EE82EE'
+replace_colors['violetred'] = '#D02090'
+replace_colors['wheat'] = '#F5DEB3'
+replace_colors['whitesmoke'] = '#F5F5F5'
+replace_colors['yellowgreen'] = '#9ACD32'
+
+#A list of optimized colors
+optimize_colors = {}
+optimize_colors['black'] = '#000'
+optimize_colors['fuchsia'] = '#F0F'
+optimize_colors['white'] = '#FFF'
+optimize_colors['yellow'] = '#FF0'
+optimize_colors['cyan'] = '#0FF'
+optimize_colors['magenta'] = '#F0F'
+optimize_colors['lightslategray'] = '#789'
+
+optimize_colors['#800000'] = 'maroon'
+optimize_colors['#FFA500'] = 'orange'
+optimize_colors['#808000'] = 'olive'
+optimize_colors['#800080'] = 'purple'
+optimize_colors['#008000'] = 'green'
+optimize_colors['#000080'] = 'navy'
+optimize_colors['#008080'] = 'teal'
+optimize_colors['#C0C0C0'] = 'silver'
+optimize_colors['#808080'] = 'gray'
+optimize_colors['#4B0082'] = 'indigo'
+optimize_colors['#FFD700'] = 'gold'
+optimize_colors['#A52A2A'] = 'brown'
+optimize_colors['#00FFFF'] = 'cyan'
+optimize_colors['#EE82EE'] = 'violet'
+optimize_colors['#DA70D6'] = 'orchid'
+optimize_colors['#FFE4C4'] = 'bisque'
+optimize_colors['#F0E68C'] = 'khaki'
+optimize_colors['#F5DEB3'] = 'wheat'
+optimize_colors['#FF7F50'] = 'coral'
+optimize_colors['#F5F5DC'] = 'beige'
+optimize_colors['#F0FFFF'] = 'azure'
+optimize_colors['#A0522D'] = 'sienna'
+optimize_colors['#CD853F'] = 'peru'
+optimize_colors['#FFFFF0'] = 'ivory'
+optimize_colors['#DDA0DD'] = 'plum'
+optimize_colors['#D2B48C'] = 'tan'
+optimize_colors['#FFC0CB'] = 'pink'
+optimize_colors['#FFFAFA'] = 'snow'
+optimize_colors['#FA8072'] = 'salmon'
+optimize_colors['#FF6347'] = 'tomato'
+optimize_colors['#FAF0E6'] = 'linen'
+optimize_colors['#F00'] = 'red'
+
+
+# A list of all shorthand properties that are devided into four properties and/or have four subvalues
+#
+# @global array shorthands
+# @todo Are there new ones in CSS3?
+# @see dissolve_4value_shorthands()
+# @see merge_4value_shorthands()
+# @version 1.0
+shorthands = {}
+shorthands['border-color'] = ['border-top-color','border-right-color','border-bottom-color','border-left-color']
+shorthands['border-style'] = ['border-top-style','border-right-style','border-bottom-style','border-left-style']
+shorthands['border-width'] = ['border-top-width','border-right-width','border-bottom-width','border-left-width']
+shorthands['margin'] = ['margin-top','margin-right','margin-bottom','margin-left']
+shorthands['padding'] = ['padding-top','padding-right','padding-bottom','padding-left']
+shorthands['-moz-border-radius'] = 0
+
+# All CSS Properties. Needed for csstidy::property_is_next()
+#
+# @global array all_properties
+# @todo Add CSS3 properties
+# @version 1.0
+# @see csstidy::property_is_next()
+all_properties = {}
+all_properties['background'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['background-color'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['background-image'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['background-repeat'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['background-attachment'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['background-position'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['border'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['border-top'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['border-right'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['border-bottom'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['border-left'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['border-color'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['border-top-color'] = 'CSS2.0,CSS2.1'
+all_properties['border-bottom-color'] = 'CSS2.0,CSS2.1'
+all_properties['border-left-color'] = 'CSS2.0,CSS2.1'
+all_properties['border-right-color'] = 'CSS2.0,CSS2.1'
+all_properties['border-style'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['border-top-style'] = 'CSS2.0,CSS2.1'
+all_properties['border-right-style'] = 'CSS2.0,CSS2.1'
+all_properties['border-left-style'] = 'CSS2.0,CSS2.1'
+all_properties['border-bottom-style'] = 'CSS2.0,CSS2.1'
+all_properties['border-width'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['border-top-width'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['border-right-width'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['border-left-width'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['border-bottom-width'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['border-collapse'] = 'CSS2.0,CSS2.1'
+all_properties['border-spacing'] = 'CSS2.0,CSS2.1'
+all_properties['bottom'] = 'CSS2.0,CSS2.1'
+all_properties['caption-side'] = 'CSS2.0,CSS2.1'
+all_properties['content'] = 'CSS2.0,CSS2.1'
+all_properties['clear'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['clip'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['color'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['counter-reset'] = 'CSS2.0,CSS2.1'
+all_properties['counter-increment'] = 'CSS2.0,CSS2.1'
+all_properties['cursor'] = 'CSS2.0,CSS2.1'
+all_properties['empty-cells'] = 'CSS2.0,CSS2.1'
+all_properties['display'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['direction'] = 'CSS2.0,CSS2.1'
+all_properties['float'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['font'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['font-family'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['font-style'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['font-variant'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['font-weight'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['font-stretch'] = 'CSS2.0'
+all_properties['font-size-adjust'] = 'CSS2.0'
+all_properties['font-size'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['height'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['left'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['line-height'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['list-style'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['list-style-type'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['list-style-image'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['list-style-position'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['margin'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['margin-top'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['margin-right'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['margin-bottom'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['margin-left'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['marks'] = 'CSS1.0,CSS2.0'
+all_properties['marker-offset'] = 'CSS2.0'
+all_properties['max-height'] = 'CSS2.0,CSS2.1'
+all_properties['max-width'] = 'CSS2.0,CSS2.1'
+all_properties['min-height'] = 'CSS2.0,CSS2.1'
+all_properties['min-width'] = 'CSS2.0,CSS2.1'
+all_properties['overflow'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['orphans'] = 'CSS2.0,CSS2.1'
+all_properties['outline'] = 'CSS2.0,CSS2.1'
+all_properties['outline-width'] = 'CSS2.0,CSS2.1'
+all_properties['outline-style'] = 'CSS2.0,CSS2.1'
+all_properties['outline-color'] = 'CSS2.0,CSS2.1'
+all_properties['padding'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['padding-top'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['padding-right'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['padding-bottom'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['padding-left'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['page-break-before'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['page-break-after'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['page-break-inside'] = 'CSS2.0,CSS2.1'
+all_properties['page'] = 'CSS2.0'
+all_properties['position'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['quotes'] = 'CSS2.0,CSS2.1'
+all_properties['right'] = 'CSS2.0,CSS2.1'
+all_properties['size'] = 'CSS1.0,CSS2.0'
+all_properties['speak-header'] = 'CSS2.0,CSS2.1'
+all_properties['table-layout'] = 'CSS2.0,CSS2.1'
+all_properties['top'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['text-indent'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['text-align'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['text-decoration'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['text-shadow'] = 'CSS2.0'
+all_properties['letter-spacing'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['word-spacing'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['text-transform'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['white-space'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['unicode-bidi'] = 'CSS2.0,CSS2.1'
+all_properties['vertical-align'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['visibility'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['width'] = 'CSS1.0,CSS2.0,CSS2.1'
+all_properties['widows'] = 'CSS2.0,CSS2.1'
+all_properties['z-index'] = 'CSS1.0,CSS2.0,CSS2.1'
+
+# Speech #
+all_properties['volume'] = 'CSS2.0,CSS2.1'
+all_properties['speak'] = 'CSS2.0,CSS2.1'
+all_properties['pause'] = 'CSS2.0,CSS2.1'
+all_properties['pause-before'] = 'CSS2.0,CSS2.1'
+all_properties['pause-after'] = 'CSS2.0,CSS2.1'
+all_properties['cue'] = 'CSS2.0,CSS2.1'
+all_properties['cue-before'] = 'CSS2.0,CSS2.1'
+all_properties['cue-after'] = 'CSS2.0,CSS2.1'
+all_properties['play-during'] = 'CSS2.0,CSS2.1'
+all_properties['azimuth'] = 'CSS2.0,CSS2.1'
+all_properties['elevation'] = 'CSS2.0,CSS2.1'
+all_properties['speech-rate'] = 'CSS2.0,CSS2.1'
+all_properties['voice-family'] = 'CSS2.0,CSS2.1'
+all_properties['pitch'] = 'CSS2.0,CSS2.1'
+all_properties['pitch-range'] = 'CSS2.0,CSS2.1'
+all_properties['stress'] = 'CSS2.0,CSS2.1'
+all_properties['richness'] = 'CSS2.0,CSS2.1'
+all_properties['speak-punctuation'] = 'CSS2.0,CSS2.1'
+all_properties['speak-numeral'] = 'CSS2.0,CSS2.1'
\ No newline at end of file
diff --git a/apps/compress/filters/csstidy_python/optimizer.py b/apps/compress/filters/csstidy_python/optimizer.py
new file mode 100644 (file)
index 0000000..7cd284c
--- /dev/null
@@ -0,0 +1,383 @@
+# CSSTidy - CSS Optimizer
+#
+# CSS Optimizer class
+#
+# This file is part of CSSTidy.
+#
+# CSSTidy is free software you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation either version 2 of the License, or
+# (at your option) any later version.
+#
+# CSSTidy is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with CSSTidy if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+# @license http://opensource.org/licenses/gpl-license.php GNU Public License
+# @package csstidy
+# @author Dj Gilcrease (digitalxero at gmail dot com) 2005-2006
+
+import data
+from tools import SortedDict
+
+
+class CSSOptimizer(object):
+    def __init__(self, parser):
+        #raw_css is a dict
+        self.parser = parser
+        self._optimized_css = SortedDict
+
+
+#PUBLIC METHODS
+    def optimize(self, raw_css):
+        if self.parser.getSetting('preserve_css'):
+            return raw_css
+
+        self._optimized_css = raw_css
+
+        if self.parser.getSetting('merge_selectors') == 2:
+            self.__merge_selectors()
+
+        ##OPTIMIZE##
+        for media, css in self._optimized_css.iteritems():
+            for selector, cssdata in css.iteritems():
+                if self.parser.getSetting('optimise_shorthands') >= 1:
+                    cssdata = self.__merge_4value_shorthands(cssdata)
+
+                if self.parser.getSetting('optimise_shorthands') >= 2:
+                    cssdata = self.__merge_bg(cssdata)
+
+                for item, value in cssdata.iteritems():
+                    value = self.__compress_numbers(item, value)
+                    value = self.__compress_important(value)
+
+                    if item in data.color_values and self.parser.getSetting('compress_colors'):
+                        old = value[:]
+                        value = self.__compress_color(value)
+                        if old != value:
+                            self.parser.log('In "' + selector + '" Optimised ' + item + ': Changed ' + old + ' to ' + value, 'Information')
+
+                    if item == 'font-weight' and self.parser.getSetting('compress_font-weight'):
+                        if value  == 'bold':
+                            value = '700'
+                            self.parser.log('In "' + selector + '" Optimised font-weight: Changed "bold" to "700"', 'Information')
+
+                        elif value == 'normal':
+                            value = '400'
+                            self.parser.log('In "' + selector + '" Optimised font-weight: Changed "normal" to "400"', 'Information')
+
+                    self._optimized_css[media][selector][item] = value
+
+
+        return self._optimized_css
+
+
+#PRIVATE METHODS
+    def __merge_bg(self, cssdata):
+        """
+            Merges all background properties
+            @cssdata (dict) is a dictionary of the selector properties
+        """
+        #Max number of background images. CSS3 not yet fully implemented
+        img = 1
+        clr = 1
+        bg_img_list = []
+        if cssdata.has_key('background-image'):
+            img = len(cssdata['background-image'].split(','))
+            bg_img_list = self.parser.gvw_important(cssdata['background-image']).split(',')
+
+        elif cssdata.has_key('background-color'):
+            clr = len(cssdata['background-color'].split(','))
+
+
+        number_of_values = max(img, clr, 1)
+
+        new_bg_value = ''
+        important = ''
+
+        for i in xrange(number_of_values):
+            for bg_property, default_value in data.background_prop_default.iteritems():
+                #Skip if property does not exist
+                if not cssdata.has_key(bg_property):
+                    continue
+
+                cur_value = cssdata[bg_property]
+
+                #Skip some properties if there is no background image
+                if (len(bg_img_list) > i and bg_img_list[i] == 'none') and bg_property in frozenset(['background-size', 'background-position', 'background-attachment', 'background-repeat']):
+                    continue
+
+                #Remove !important
+                if self.parser.is_important(cur_value):
+                    important = ' !important'
+                    cur_value = self.parser.gvw_important(cur_value)
+
+                #Do not add default values
+                if cur_value == default_value:
+                    continue
+
+                temp = cur_value.split(',')
+
+                if len(temp) > i:
+                    if bg_property == 'background-size':
+                        new_bg_value += '(' + temp[i] + ') '
+
+                    else:
+                        new_bg_value += temp[i] + ' '
+
+            new_bg_value = new_bg_value.strip()
+            if i != (number_of_values-1):
+                new_bg_value += ','
+
+        #Delete all background-properties
+        for bg_property, default_value in data.background_prop_default.iteritems():
+            try:
+                del cssdata[bg_property]
+            except:
+                pass
+
+        #Add new background property
+        if new_bg_value != '':
+            cssdata['background'] = new_bg_value + important
+
+        return cssdata
+
+    def __merge_4value_shorthands(self, cssdata):
+        """
+            Merges Shorthand properties again, the opposite of dissolve_4value_shorthands()
+            @cssdata (dict) is a dictionary of the selector properties
+        """
+        for key, value in data.shorthands.iteritems():
+            important = ''
+            if value != 0 and cssdata.has_key(value[0]) and cssdata.has_key(value[1]) and cssdata.has_key(value[2]) and cssdata.has_key(value[3]):
+                cssdata[key] = ''
+
+                for i in xrange(4):
+                    val = cssdata[value[i]]
+                    if self.parser.is_important(val):
+                        important = '!important'
+                        cssdata[key] += self.parser.gvw_important(val) + ' '
+
+                    else:
+                        cssdata[key] += val + ' '
+
+                    del cssdata[value[i]]
+            if cssdata.has_key(key):
+                cssdata[key] = self.__shorthand(cssdata[key] + important.strip())
+
+        return cssdata
+
+
+    def __merge_selectors(self):
+        """
+            Merges selectors with same properties. Example: a{color:red} b{color:red} . a,b{color:red}
+            Very basic and has at least one bug. Hopefully there is a replacement soon.
+            @selector_one (string) is the current selector
+            @value_one (dict) is a dictionary of the selector properties
+            Note: Currently is the elements of a selector are identical, but in a different order, they are not merged
+        """
+
+        ##OPTIMIZE##
+        ##FIX##
+
+        raw_css = self._optimized_css.copy()
+        delete = []
+        add = SortedDict()
+        for media, css in raw_css.iteritems():
+            for selector_one, value_one in css.iteritems():
+                newsel = selector_one
+
+                for selector_two, value_two in css.iteritems():
+                    if selector_one == selector_two:
+                        #We need to skip self
+                        continue
+
+                    if value_one == value_two:
+                        #Ok, we need to merge these two selectors
+                        newsel += ', ' + selector_two
+                        delete.append((media, selector_two))
+
+
+        if not add.has_key(media):
+            add[media] = SortedDict()
+
+        add[media][newsel] = value_one
+        delete.append((media, selector_one))
+
+        for item in delete:
+            try:
+                del self._optimized_css[item[0]][item[1]]
+            except:
+                #Must have already been deleted
+                continue
+
+        for media, css in add.iteritems():
+            self._optimized_css[media].update(css)
+
+
+
+    def __shorthand(self, value):
+        """
+            Compresses shorthand values. Example: margin:1px 1px 1px 1px . margin:1px
+            @value (string)
+        """
+
+        ##FIX##
+
+        important = '';
+        if self.parser.is_important(value):
+            value_list = self.parser.gvw_important(value)
+            important = '!important'
+        else:
+            value_list = value
+
+        ret = value
+        value_list = value_list.split(' ')
+
+        if len(value_list) == 4:
+            if value_list[0] == value_list[1] and value_list[0] == value_list[2] and value_list[0] == value_list[3]:
+                ret = value_list[0] + important
+
+            elif value_list[1] == value_list[3] and value_list[0] == value_list[2]:
+                ret = value_list[0] + ' ' + value_list[1] + important
+
+            elif value_list[1] == value_list[3]:
+                ret = value_list[0] + ' ' + value_list[1] + ' ' + value_list[2] + important
+
+        elif len(value_list) == 3:
+            if value_list[0] == value_list[1] and value_list[0] == value_list[2]:
+                ret = value_list[0] + important
+
+            elif value_list[0] == value_list[2]:
+                return value_list[0] + ' ' + value_list[1] + important
+
+        elif len(value_list) == 2:
+            if value_list[0] == value_list[1]:
+                ret = value_list[0] + important
+
+        if ret != value:
+            self.parser.log('Optimised shorthand notation: Changed "' + value + '" to "' + ret + '"', 'Information')
+
+        return ret
+
+    def __compress_important(self, value):
+        """
+            Removes unnecessary whitespace in ! important
+            @value (string)
+        """
+        if self.parser.is_important(value):
+            value = self.parser.gvw_important(value) + '!important'
+
+        return value
+
+    def __compress_numbers(self, prop, value):
+        """
+            Compresses numbers (ie. 1.0 becomes 1 or 1.100 becomes 1.1 )
+            @value (string) is the posible number to be compressed
+        """
+
+        ##FIX##
+
+        value = value.split('/')
+
+        for l in xrange(len(value)):
+            #continue if no numeric value
+            if not (len(value[l]) > 0 and (value[l][0].isdigit() or value[l][0] in ('+', '-') )):
+                continue
+
+            #Fix bad colors
+            if prop in data.color_values:
+                value[l] = '#' + value[l]
+
+            is_floatable = False
+            try:
+                float(value[l])
+                is_floatable = True
+            except:
+                pass
+
+            if is_floatable and float(value[l]) == 0:
+                value[l] = '0'
+
+            elif value[l][0] != '#':
+                unit_found = False
+                for unit in data.units:
+                    pos = value[l].lower().find(unit)
+                    if pos != -1 and prop not in data.shorthands:
+                        value[l] = self.__remove_leading_zeros(float(value[l][:pos])) + unit
+                        unit_found = True
+                        break;
+
+                if not unit_found and prop in data.unit_values and prop not in data.shorthands:
+                    value[l] = self.__remove_leading_zeros(float(value[l])) + 'px'
+
+                elif not unit_found and prop not in data.shorthands:
+                    value[l] = self.__remove_leading_zeros(float(value[l]))
+
+
+        if len(value) > 1:
+            return '/'.join(value)
+
+        return value[0]
+
+    def __remove_leading_zeros(self, float_val):
+        """
+            Removes the leading zeros from a float value
+            @float_val (float)
+            @returns (string)
+        """
+        #Remove leading zero
+        if abs(float_val) < 1:
+            if float_val < 0:
+                float_val = '-' . str(float_val)[2:]
+            else:
+                float_val = str(float_val)[1:]
+
+        return str(float_val)
+
+    def __compress_color(self, color):
+        """
+            Color compression function. Converts all rgb() values to #-values and uses the short-form if possible. Also replaces 4 color names by #-values.
+            @color (string) the {posible} color to change
+        """
+
+        #rgb(0,0,0) . #000000 (or #000 in this case later)
+        if color[:4].lower() == 'rgb(':
+            color_tmp = color[4:(len(color)-5)]
+            color_tmp = color_tmp.split(',')
+
+            for c in color_tmp:
+                c = c.strip()
+                if c[:-1] == '%':
+                    c = round((255*color_tmp[i])/100)
+
+                if color_tmp[i] > 255:
+                    color_tmp[i] = 255
+
+            color = '#'
+
+            for i in xrange(3):
+                if color_tmp[i] < 16:
+                    color += '0' + str(hex(color_tmp[i])).replace('0x', '')
+                else:
+                    color += str(hex(color_tmp[i])).replace('0x', '')
+
+        #Fix bad color names
+        if data.replace_colors.has_key(color.lower()):
+            color = data.replace_colors[color.lower()]
+
+        #aabbcc . #abc
+        if len(color) == 7:
+            color_temp = color.lower()
+            if color_temp[0] == '#' and color_temp[1] == color_temp[2] and color_temp[3] == color_temp[4] and color_temp[5] == color_temp[6]:
+                color = '#' + color[1] + color[3] + color[5]
+
+        if data.optimize_colors.has_key(color.lower()):
+            color = data.optimize_colors[color.lower()]
+
+        return color
\ No newline at end of file
diff --git a/apps/compress/filters/csstidy_python/output.py b/apps/compress/filters/csstidy_python/output.py
new file mode 100644 (file)
index 0000000..795a0d0
--- /dev/null
@@ -0,0 +1,101 @@
+# CSSTidy - CSS Printer
+#
+# CSS Printer class
+#
+# This file is part of CSSTidy.
+#
+# CSSTidy is free software you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation either version 2 of the License, or
+# (at your option) any later version.
+#
+# CSSTidy is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with CSSTidy if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+# @license http://opensource.org/licenses/gpl-license.php GNU Public License
+# @package csstidy
+# @author Dj Gilcrease (digitalxero at gmail dot com) 2005-2006
+
+import data
+
+class CSSPrinter(object):
+    def __init__(self, parser):
+        self.parser = parser
+        self._css = {}
+        self.__renderMethods = {'string': self.__renderString, 'file': self.__renderFile}
+
+#PUBLIC METHODS
+    def prepare(self, css):
+        self._css = css
+
+    def render(self, output="string", *args, **kwargs):
+        return self.__renderMethods[output](*args, **kwargs)
+
+#PRIVATE METHODS
+    def __renderString(self, *args, **kwargs):
+        ##OPTIMIZE##
+        template = self.parser.getSetting('template')
+        ret = ""
+
+        if template == 'highest_compression':
+            top_line_end = ""
+            iner_line_end = ""
+            bottom_line_end = ""
+            indent = ""
+
+        elif template == 'high_compression':
+            top_line_end = "\n"
+            iner_line_end = ""
+            bottom_line_end = "\n"
+            indent = ""
+
+        elif template == 'default':
+            top_line_end = "\n"
+            iner_line_end = "\n"
+            bottom_line_end = "\n\n"
+            indent = ""
+
+        elif template == 'low_compression':
+            top_line_end = "\n"
+            iner_line_end = "\n"
+            bottom_line_end = "\n\n"
+            indent = "    "
+
+        if self.parser.getSetting('timestamp'):
+            ret += '/# CSSTidy ' + self.parser.version + ': ' + datetime.now().strftime("%a, %d %b %Y %H:%M:%S +0000") + ' #/' + top_line_end
+
+        for item in self.parser._import:
+            ret += '@import(' + item + ');' + top_line_end
+
+        for item in self.parser._charset:
+            ret += '@charset(' + item + ');' + top_line_end
+
+        for item in self.parser._namespace:
+            ret += '@namespace(' + item + ');' + top_line_end
+
+        for media, css in self._css.iteritems():
+            for selector, cssdata in css.iteritems():
+                ret += selector + '{' + top_line_end
+
+                for item, value in cssdata.iteritems():
+                    ret += indent +  item + ':' + value + ';' + iner_line_end
+
+                ret += '}' + bottom_line_end
+
+        return ret
+
+    def __renderFile(self, filename=None, *args, **kwargs):
+        if filename is None:
+            return self.__renderString()
+
+        try:
+            f = open(filename, "w")
+            f.write(self.__renderString())
+        finally:
+            f.close()
\ No newline at end of file
diff --git a/apps/compress/filters/csstidy_python/tools.py b/apps/compress/filters/csstidy_python/tools.py
new file mode 100644 (file)
index 0000000..e62faef
--- /dev/null
@@ -0,0 +1,109 @@
+
+class SortedDict(dict):
+    """
+    A dictionary that keeps its keys in the order in which they're inserted.
+    """
+    def __init__(self, data=None):
+        if data is None:
+            data = {}
+        super(SortedDict, self).__init__(data)
+        if isinstance(data, dict):
+            self.keyOrder = data.keys()
+        else:
+            self.keyOrder = []
+            for key, value in data:
+                if key not in self.keyOrder:
+                    self.keyOrder.append(key)
+
+    def __deepcopy__(self, memo):
+        from copy import deepcopy
+        return self.__class__([(key, deepcopy(value, memo))
+                               for key, value in self.iteritems()])
+
+    def __setitem__(self, key, value):
+        super(SortedDict, self).__setitem__(key, value)
+        if key not in self.keyOrder:
+            self.keyOrder.append(key)
+
+    def __delitem__(self, key):
+        super(SortedDict, self).__delitem__(key)
+        self.keyOrder.remove(key)
+
+    def __iter__(self):
+        for k in self.keyOrder:
+            yield k
+
+    def pop(self, k, *args):
+        result = super(SortedDict, self).pop(k, *args)
+        try:
+            self.keyOrder.remove(k)
+        except ValueError:
+            # Key wasn't in the dictionary in the first place. No problem.
+            pass
+        return result
+
+    def popitem(self):
+        result = super(SortedDict, self).popitem()
+        self.keyOrder.remove(result[0])
+        return result
+
+    def items(self):
+        return zip(self.keyOrder, self.values())
+
+    def iteritems(self):
+        for key in self.keyOrder:
+            yield key, super(SortedDict, self).__getitem__(key)
+
+    def keys(self):
+        return self.keyOrder[:]
+
+    def iterkeys(self):
+        return iter(self.keyOrder)
+
+    def values(self):
+        return [super(SortedDict, self).__getitem__(k) for k in self.keyOrder]
+
+    def itervalues(self):
+        for key in self.keyOrder:
+            yield super(SortedDict, self).__getitem__(key)
+
+    def update(self, dict_):
+        for k, v in dict_.items():
+            self.__setitem__(k, v)
+
+    def setdefault(self, key, default):
+        if key not in self.keyOrder:
+            self.keyOrder.append(key)
+        return super(SortedDict, self).setdefault(key, default)
+
+    def value_for_index(self, index):
+        """Returns the value of the item at the given zero-based index."""
+        return self[self.keyOrder[index]]
+
+    def insert(self, index, key, value):
+        """Inserts the key, value pair before the item with the given index."""
+        if key in self.keyOrder:
+            n = self.keyOrder.index(key)
+            del self.keyOrder[n]
+            if n < index:
+                index -= 1
+        self.keyOrder.insert(index, key)
+        super(SortedDict, self).__setitem__(key, value)
+
+    def copy(self):
+        """Returns a copy of this object."""
+        # This way of initializing the copy means it works for subclasses, too.
+        obj = self.__class__(self)
+        obj.keyOrder = self.keyOrder[:]
+        return obj
+
+    def __repr__(self):
+        """
+        Replaces the normal dict.__repr__ with a version that returns the keys
+        in their sorted order.
+        """
+        return '{%s}' % ', '.join(['%r: %r' % (k, v) for k, v in self.items()])
+
+    def clear(self):
+        super(SortedDict, self).clear()
+        self.keyOrder = []
\ No newline at end of file
diff --git a/apps/compress/filters/jsmin/__init__.py b/apps/compress/filters/jsmin/__init__.py
new file mode 100644 (file)
index 0000000..d226200
--- /dev/null
@@ -0,0 +1,6 @@
+from compress.filters.jsmin.jsmin import jsmin
+from compress.filter_base import FilterBase
+
+class JSMinFilter(FilterBase):
+    def filter_js(self, js):
+        return jsmin(js)
\ No newline at end of file
diff --git a/apps/compress/filters/jsmin/jsmin.py b/apps/compress/filters/jsmin/jsmin.py
new file mode 100644 (file)
index 0000000..4f9d384
--- /dev/null
@@ -0,0 +1,218 @@
+#!/usr/bin/python
+
+# This code is original from jsmin by Douglas Crockford, it was translated to
+# Python by Baruch Even. The original code had the following copyright and
+# license.
+#
+# /* jsmin.c
+#    2007-05-22
+#
+# Copyright (c) 2002 Douglas Crockford  (www.crockford.com)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy of
+# this software and associated documentation files (the "Software"), to deal in
+# the Software without restriction, including without limitation the rights to
+# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+# of the Software, and to permit persons to whom the Software is furnished to do
+# so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# The Software shall be used for Good, not Evil.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+# */
+
+from StringIO import StringIO
+
+def jsmin(js):
+    ins = StringIO(js)
+    outs = StringIO()
+    JavascriptMinify().minify(ins, outs)
+    str = outs.getvalue()
+    if len(str) > 0 and str[0] == '\n':
+        str = str[1:]
+    return str
+
+def isAlphanum(c):
+    """return true if the character is a letter, digit, underscore,
+           dollar sign, or non-ASCII character.
+    """
+    return ((c >= 'a' and c <= 'z') or (c >= '0' and c <= '9') or
+            (c >= 'A' and c <= 'Z') or c == '_' or c == '$' or c == '\\' or (c is not None and ord(c) > 126));
+
+class UnterminatedComment(Exception):
+    pass
+
+class UnterminatedStringLiteral(Exception):
+    pass
+
+class UnterminatedRegularExpression(Exception):
+    pass
+
+class JavascriptMinify(object):
+
+    def _outA(self):
+        self.outstream.write(self.theA)
+    def _outB(self):
+        self.outstream.write(self.theB)
+
+    def _get(self):
+        """return the next character from stdin. Watch out for lookahead. If
+           the character is a control character, translate it to a space or
+           linefeed.
+        """
+        c = self.theLookahead
+        self.theLookahead = None
+        if c == None:
+            c = self.instream.read(1)
+        if c >= ' ' or c == '\n':
+            return c
+        if c == '': # EOF
+            return '\000'
+        if c == '\r':
+            return '\n'
+        return ' '
+
+    def _peek(self):
+        self.theLookahead = self._get()
+        return self.theLookahead
+
+    def _next(self):
+        """get the next character, excluding comments. peek() is used to see
+           if a '/' is followed by a '/' or '*'.
+        """
+        c = self._get()
+        if c == '/':
+            p = self._peek()
+            if p == '/':
+                c = self._get()
+                while c > '\n':
+                    c = self._get()
+                return c
+            if p == '*':
+                c = self._get()
+                while 1:
+                    c = self._get()
+                    if c == '*':
+                        if self._peek() == '/':
+                            self._get()
+                            return ' '
+                    if c == '\000':
+                        raise UnterminatedComment()
+
+        return c
+
+    def _action(self, action):
+        """do something! What you do is determined by the argument:
+           1   Output A. Copy B to A. Get the next B.
+           2   Copy B to A. Get the next B. (Delete A).
+           3   Get the next B. (Delete B).
+           action treats a string as a single character. Wow!
+           action recognizes a regular expression if it is preceded by ( or , or =.
+        """
+        if action <= 1:
+            self._outA()
+
+        if action <= 2:
+            self.theA = self.theB
+            if self.theA == "'" or self.theA == '"':
+                while 1:
+                    self._outA()
+                    self.theA = self._get()
+                    if self.theA == self.theB:
+                        break
+                    if self.theA <= '\n':
+                        raise UnterminatedStringLiteral()
+                    if self.theA == '\\':
+                        self._outA()
+                        self.theA = self._get()
+
+
+        if action <= 3:
+            self.theB = self._next()
+            if self.theB == '/' and (self.theA == '(' or self.theA == ',' or
+                                     self.theA == '=' or self.theA == ':' or
+                                     self.theA == '[' or self.theA == '?' or
+                                     self.theA == '!' or self.theA == '&' or
+                                     self.theA == '|' or self.theA == ';' or
+                                     self.theA == '{' or self.theA == '}' or
+                                     self.theA == '\n'):
+                self._outA()
+                self._outB()
+                while 1:
+                    self.theA = self._get()
+                    if self.theA == '/':
+                        break
+                    elif self.theA == '\\':
+                        self._outA()
+                        self.theA = self._get()
+                    elif self.theA <= '\n':
+                        raise UnterminatedRegularExpression()
+                    self._outA()
+                self.theB = self._next()
+
+
+    def _jsmin(self):
+        """Copy the input to the output, deleting the characters which are
+           insignificant to JavaScript. Comments will be removed. Tabs will be
+           replaced with spaces. Carriage returns will be replaced with linefeeds.
+           Most spaces and linefeeds will be removed.
+        """
+        self.theA = '\n'
+        self._action(3)
+
+        while self.theA != '\000':
+            if self.theA == ' ':
+                if isAlphanum(self.theB):
+                    self._action(1)
+                else:
+                    self._action(2)
+            elif self.theA == '\n':
+                if self.theB in ['{', '[', '(', '+', '-']:
+                    self._action(1)
+                elif self.theB == ' ':
+                    self._action(3)
+                else:
+                    if isAlphanum(self.theB):
+                        self._action(1)
+                    else:
+                        self._action(2)
+            else:
+                if self.theB == ' ':
+                    if isAlphanum(self.theA):
+                        self._action(1)
+                    else:
+                        self._action(3)
+                elif self.theB == '\n':
+                    if self.theA in ['}', ']', ')', '+', '-', '"', '\'']:
+                        self._action(1)
+                    else:
+                        if isAlphanum(self.theA):
+                            self._action(1)
+                        else:
+                            self._action(3)
+                else:
+                    self._action(1)
+
+    def minify(self, instream, outstream):
+        self.instream = instream
+        self.outstream = outstream
+        self.theA = '\n'
+        self.theB = None
+        self.theLookahead = None
+
+        self._jsmin()
+        self.instream.close()
+
+if __name__ == '__main__':
+    import sys
+    jsm = JavascriptMinify()
+    jsm.minify(sys.stdin, sys.stdout)
\ No newline at end of file
diff --git a/apps/compress/filters/yui/__init__.py b/apps/compress/filters/yui/__init__.py
new file mode 100644 (file)
index 0000000..1e2e711
--- /dev/null
@@ -0,0 +1,44 @@
+import subprocess
+
+from django.conf import settings
+
+from compress.filter_base import FilterBase, FilterError
+
+BINARY = getattr(settings, 'COMPRESS_YUI_BINARY', 'java -jar yuicompressor.jar')
+CSS_ARGUMENTS = getattr(settings, 'COMPRESS_YUI_CSS_ARGUMENTS', '')
+JS_ARGUMENTS = getattr(settings, 'COMPRESS_YUI_JS_ARGUMENTS', '')
+
+class YUICompressorFilter(FilterBase):
+
+    def filter_common(self, content, type_, arguments):
+        command = '%s --type=%s %s' % (BINARY, type_, arguments)
+
+        if self.verbose:
+            command += ' --verbose'
+
+        p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
+        p.stdin.write(content)
+        p.stdin.close()
+
+        filtered_css = p.stdout.read()
+        p.stdout.close()
+
+        err = p.stderr.read()
+        p.stderr.close()
+
+        if p.wait() != 0:
+            if not err:
+                err = 'Unable to apply YUI Compressor filter'
+
+            raise FilterError(err)
+
+        if self.verbose:
+            print err
+
+        return filtered_css
+
+    def filter_js(self, js):
+        return self.filter_common(js, 'js', JS_ARGUMENTS)
+
+    def filter_css(self, css):
+        return self.filter_common(css, 'css', CSS_ARGUMENTS)
\ No newline at end of file
diff --git a/apps/compress/management/__init__.py b/apps/compress/management/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/apps/compress/management/commands/__init__.py b/apps/compress/management/commands/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/apps/compress/management/commands/synccompress.py b/apps/compress/management/commands/synccompress.py
new file mode 100644 (file)
index 0000000..8217979
--- /dev/null
@@ -0,0 +1,58 @@
+from django.core.management.base import NoArgsCommand
+from optparse import make_option
+
+from django.conf import settings
+
+class Command(NoArgsCommand):
+    option_list = NoArgsCommand.option_list + (
+        make_option('--force', action='store_true', default=False, help='Force update of all files, even if the source files are older than the current compressed file.'),
+    )
+    help = 'Updates and compresses CSS and JavsScript on-demand, without restarting Django'
+    args = ''
+
+    def handle_noargs(self, **options):
+        
+        force = options.get('force', False)
+        verbosity = int(options.get('verbosity', 1))
+
+        from compress.utils import needs_update, filter_css, filter_js
+
+        for name, css in settings.COMPRESS_CSS.items():
+            u, version = needs_update(css['output_filename'], 
+                css['source_filenames'])
+
+            if (force or u) or verbosity >= 2:
+                msg = 'CSS Group \'%s\'' % name
+                print msg
+                print len(msg) * '-'
+                print "Version: %s" % version
+
+            if force or u:
+                filter_css(css, verbosity)
+
+            if (force or u) or verbosity >= 2:
+                print
+
+        for name, js in settings.COMPRESS_JS.items():
+            u, version = needs_update(js['output_filename'], 
+                js['source_filenames'])
+
+            if (force or u) or verbosity >= 2:
+                msg = 'JavaScript Group \'%s\'' % name
+                print msg
+                print len(msg) * '-'
+                print "Version: %s" % version
+
+            if force or u:
+                filter_js(js, verbosity)
+
+            if (force or u) or verbosity >= 2:
+                print
+
+# Backwards compatibility for Django r9110
+if not [opt for opt in Command.option_list if opt.dest=='verbosity']:
+    Command.option_list += (
+    make_option('--verbosity', '-v', action="store", dest="verbosity",
+        default='1', type='choice', choices=['0', '1', '2'],
+        help="Verbosity level; 0=minimal output, 1=normal output, 2=all output"),
+    )
diff --git a/apps/compress/models.py b/apps/compress/models.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/apps/compress/signals.py b/apps/compress/signals.py
new file mode 100644 (file)
index 0000000..bd76a76
--- /dev/null
@@ -0,0 +1,4 @@
+from django.dispatch import Signal
+
+css_filtered = Signal()
+js_filtered = Signal()
diff --git a/apps/compress/templates/compress/.tmp_css.html.32854~ b/apps/compress/templates/compress/.tmp_css.html.32854~
new file mode 100644 (file)
index 0000000..3751a4a
--- /dev/null
@@ -0,0 +1 @@
+<link href="{{ url }}" rel="stylesheet" type="text/css"{% if media %} media="{{ media }}"{% endif %}{% if title %} title="{{ title|default:"all" }}"{% endif %}{% if charset %} charset="{{ charset }}"{% endif %} />
\ No newline at end of file
diff --git a/apps/compress/templates/compress/.tmp_js.html.60841~ b/apps/compress/templates/compress/.tmp_js.html.60841~
new file mode 100644 (file)
index 0000000..8419c20
--- /dev/null
@@ -0,0 +1 @@
+<script type="text/javascript" src="{{ url }}" charset="utf-8"></script>
\ No newline at end of file
diff --git a/apps/compress/templates/compress/css.html b/apps/compress/templates/compress/css.html
new file mode 100644 (file)
index 0000000..3751a4a
--- /dev/null
@@ -0,0 +1 @@
+<link href="{{ url }}" rel="stylesheet" type="text/css"{% if media %} media="{{ media }}"{% endif %}{% if title %} title="{{ title|default:"all" }}"{% endif %}{% if charset %} charset="{{ charset }}"{% endif %} />
\ No newline at end of file
diff --git a/apps/compress/templates/compress/css_ie.html b/apps/compress/templates/compress/css_ie.html
new file mode 100644 (file)
index 0000000..2e244ee
--- /dev/null
@@ -0,0 +1 @@
+<!--[if {{ condition|default:"IE" }}]><link href="{{ url }}" rel="stylesheet" type="text/css" media="{{ media|default:"all" }}" title="{{ title|default:"all" }}" charset="utf-8" /><![endif]-->
\ No newline at end of file
diff --git a/apps/compress/templates/compress/js.html b/apps/compress/templates/compress/js.html
new file mode 100644 (file)
index 0000000..8419c20
--- /dev/null
@@ -0,0 +1 @@
+<script type="text/javascript" src="{{ url }}" charset="utf-8"></script>
\ No newline at end of file
diff --git a/apps/compress/templates/compress/js_ie.html b/apps/compress/templates/compress/js_ie.html
new file mode 100644 (file)
index 0000000..ef1a37c
--- /dev/null
@@ -0,0 +1 @@
+<!--[if {{ condition|default:"IE" }}]><script type="text/javascript" src="{{ url }}" charset="utf-8"></script><![endif]-->
\ No newline at end of file
diff --git a/apps/compress/templatetags/__init__.py b/apps/compress/templatetags/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/apps/compress/templatetags/compressed.py b/apps/compress/templatetags/compressed.py
new file mode 100644 (file)
index 0000000..f9c55f9
--- /dev/null
@@ -0,0 +1,124 @@
+import os
+
+from django import template
+
+from django.conf import settings as django_settings
+
+from compress.conf import settings
+from compress.utils import media_root, media_url, needs_update, filter_css, filter_js, get_output_filename, get_version, get_version_from_file
+
+register = template.Library()
+
+def render_common(template_name, obj, filename, version):
+    if settings.COMPRESS:
+        filename = get_output_filename(filename, version)
+
+    context = obj.get('extra_context', {})
+    prefix = context.get('prefix', None)
+    if filename.startswith('http://'):
+        context['url'] = filename
+    else:
+        context['url'] = media_url(filename, prefix)
+        
+    return template.loader.render_to_string(template_name, context)
+
+def render_css(css, filename, version=None):
+    return render_common(css.get('template_name', 'compress/css.html'), css, filename, version)
+
+def render_js(js, filename, version=None):
+    return render_common(js.get('template_name', 'compress/js.html'), js, filename, version)
+
+class CompressedCSSNode(template.Node):
+    def __init__(self, name):
+        self.name = name
+
+    def render(self, context):
+        css_name = template.Variable(self.name).resolve(context)
+
+        try:
+            css = settings.COMPRESS_CSS[css_name]
+        except KeyError:
+            return '' # fail silently, do not return anything if an invalid group is specified
+
+        if settings.COMPRESS:
+
+            version = None
+
+            if settings.COMPRESS_AUTO:
+                u, version = needs_update(css['output_filename'], 
+                    css['source_filenames'])
+                if u:
+                    filter_css(css)
+            else:
+                filename_base, filename = os.path.split(css['output_filename'])
+                path_name = media_root(filename_base)
+                version = get_version_from_file(path_name, filename)
+                
+            return render_css(css, css['output_filename'], version)
+        else:
+            # output source files
+            r = ''
+            for source_file in css['source_filenames']:
+                r += render_css(css, source_file)
+
+            return r
+
+class CompressedJSNode(template.Node):
+    def __init__(self, name):
+        self.name = name
+
+    def render(self, context):
+        js_name = template.Variable(self.name).resolve(context)
+
+        try:
+            js = settings.COMPRESS_JS[js_name]
+        except KeyError:
+            return '' # fail silently, do not return anything if an invalid group is specified
+        
+        if 'external_urls' in js:
+            r = ''
+            for url in js['external_urls']:
+                r += render_js(js, url)
+            return r
+                    
+        if settings.COMPRESS:
+
+            version = None
+
+            if settings.COMPRESS_AUTO:
+                u, version = needs_update(js['output_filename'], 
+                    js['source_filenames'])
+                if u:
+                    filter_js(js)
+            else: 
+                filename_base, filename = os.path.split(js['output_filename'])
+                path_name = media_root(filename_base)
+                version = get_version_from_file(path_name, filename)
+
+            return render_js(js, js['output_filename'], version)
+        else:
+            # output source files
+            r = ''
+            for source_file in js['source_filenames']:
+                r += render_js(js, source_file)
+            return r
+
+#@register.tag
+def compressed_css(parser, token):
+    try:
+        tag_name, name = token.split_contents()
+    except ValueError:
+        raise template.TemplateSyntaxError, '%r requires exactly one argument: the name of a group in the COMPRESS_CSS setting' % token.split_contents()[0]
+
+    return CompressedCSSNode(name)
+compressed_css = register.tag(compressed_css)
+
+#@register.tag
+def compressed_js(parser, token):
+    try:
+        tag_name, name = token.split_contents()
+    except ValueError:
+        raise template.TemplateSyntaxError, '%r requires exactly one argument: the name of a group in the COMPRESS_JS setting' % token.split_contents()[0]
+
+    return CompressedJSNode(name)
+compressed_js = register.tag(compressed_js)
diff --git a/apps/compress/utils.py b/apps/compress/utils.py
new file mode 100644 (file)
index 0000000..5e13222
--- /dev/null
@@ -0,0 +1,139 @@
+import os
+import re
+import tempfile
+
+from django.conf import settings as django_settings
+from django.utils.http import urlquote
+from django.dispatch import dispatcher
+
+from compress.conf import settings
+from compress.signals import css_filtered, js_filtered
+
+def get_class(class_string):
+    """
+    Convert a string version of a function name to the callable object.
+    """
+
+    if not hasattr(class_string, '__bases__'):
+
+        try:
+            class_string = class_string.encode('ascii')
+            mod_name, class_name = get_mod_func(class_string)
+            if class_name != '':
+                class_string = getattr(__import__(mod_name, {}, {}, ['']), class_name)
+        except (ImportError, AttributeError):
+            raise Exception('Failed to import filter %s' % class_string)
+
+    return class_string
+
+def get_mod_func(callback):
+    """
+    Converts 'django.views.news.stories.story_detail' to
+    ('django.views.news.stories', 'story_detail')
+    """
+
+    try:
+        dot = callback.rindex('.')
+    except ValueError:
+        return callback, ''
+    return callback[:dot], callback[dot+1:]
+
+def needs_update(output_file, source_files, verbosity=0):
+    """
+    Scan the source files for changes and returns True if the output_file needs to be updated.
+    """
+
+    version = get_version(source_files)
+    
+    on = get_output_filename(output_file, version)
+    compressed_file_full = media_root(on)
+
+    if not os.path.exists(compressed_file_full):
+        return True, version
+        
+    update_needed = getattr(get_class(settings.COMPRESS_VERSIONING)(), 'needs_update')(output_file, source_files, version)
+    return update_needed
+
+def media_root(filename):
+    """
+    Return the full path to ``filename``. ``filename`` is a relative path name in MEDIA_ROOT
+    """
+    return os.path.join(django_settings.STATIC_ROOT, filename)
+
+def media_url(url, prefix=None):
+    if prefix:
+        return prefix + urlquote(url)
+    return django_settings.STATIC_URL + urlquote(url)
+
+def concat(filenames, separator=''):
+    """
+    Concatenate the files from the list of the ``filenames``, ouput separated with ``separator``.
+    """
+    r = ''
+    for filename in filenames:
+        fd = open(media_root(filename), 'rb')
+        r += fd.read()
+        r += separator
+        fd.close()
+    return r
+
+def max_mtime(files):
+    return int(max([os.stat(media_root(f)).st_mtime for f in files]))
+
+def save_file(filename, contents):
+    dirname = os.path.dirname(media_root(filename))
+    if not os.path.exists(dirname):
+        os.makedirs(dirname)
+    fd = open(media_root(filename), 'wb+')
+    fd.write(contents)
+    fd.close()
+
+def get_output_filename(filename, version):
+    if settings.COMPRESS_VERSION and version is not None:
+        return filename.replace(settings.COMPRESS_VERSION_PLACEHOLDER, version)
+    else:
+        return filename.replace(settings.COMPRESS_VERSION_PLACEHOLDER, settings.COMPRESS_VERSION_DEFAULT)
+
+def get_version(source_files, verbosity=0):
+    version = getattr(get_class(settings.COMPRESS_VERSIONING)(), 'get_version')(source_files)
+    return version
+    
+def get_version_from_file(path, filename):
+    regex = re.compile(r'^%s$' % (get_output_filename(settings.COMPRESS_VERSION_PLACEHOLDER.join([re.escape(part) for part in filename.split(settings.COMPRESS_VERSION_PLACEHOLDER)]), r'([A-Za-z0-9]+)')))
+    for f in os.listdir(path):
+        result = regex.match(f)
+        if result and result.groups():
+            return result.groups()[0]
+
+def remove_files(path, filename, verbosity=0):    
+    regex = re.compile(r'^%s$' % (os.path.basename(get_output_filename(settings.COMPRESS_VERSION_PLACEHOLDER.join([re.escape(part) for part in filename.split(settings.COMPRESS_VERSION_PLACEHOLDER)]), r'[A-Za-z0-9]+'))))
+    if os.path.exists(path):
+        for f in os.listdir(path):
+            if regex.match(f):
+                if verbosity >= 1:
+                    print "Removing outdated file %s" % f
+        
+                os.unlink(os.path.join(path, f))
+
+def filter_common(obj, verbosity, filters, attr, separator, signal):
+    output = concat(obj['source_filenames'], separator)
+    
+    filename = get_output_filename(obj['output_filename'], get_version(obj['source_filenames']))
+
+    if settings.COMPRESS_VERSION:
+        remove_files(os.path.dirname(media_root(filename)), obj['output_filename'], verbosity)
+
+    if verbosity >= 1:
+        print "Saving %s" % filename
+
+    for f in filters:
+        output = getattr(get_class(f)(verbose=(verbosity >= 2)), attr)(output)
+
+    save_file(filename, output)
+    signal.send(None)
+
+def filter_css(css, verbosity=0):
+    return filter_common(css, verbosity, filters=settings.COMPRESS_CSS_FILTERS, attr='filter_css', separator='', signal=css_filtered)
+
+def filter_js(js, verbosity=0):
+    return filter_common(js, verbosity, filters=settings.COMPRESS_JS_FILTERS, attr='filter_js', separator='', signal=js_filtered)
diff --git a/apps/compress/versioning/__init__.py b/apps/compress/versioning/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/apps/compress/versioning/base.py b/apps/compress/versioning/base.py
new file mode 100644 (file)
index 0000000..8b81519
--- /dev/null
@@ -0,0 +1,13 @@
+class VersioningBase(object):
+
+    def get_version(self, source_files):
+        raise NotImplementedError
+        
+    def needs_update(self, output_file, source_files, version):
+        raise NotImplementedError
+        
+class VersioningError(Exception):
+    """
+    This exception is raised when version creation fails
+    """
+    pass
\ No newline at end of file
diff --git a/apps/compress/versioning/hash/__init__.py b/apps/compress/versioning/hash/__init__.py
new file mode 100644 (file)
index 0000000..74721fe
--- /dev/null
@@ -0,0 +1,47 @@
+import cStringIO
+from hashlib import md5, sha1
+import os
+
+from compress.conf import settings
+from compress.utils import concat, get_output_filename
+from compress.versioning.base import VersioningBase
+
+class HashVersioningBase(VersioningBase):
+    def __init__(self, hash_method):
+        self.hash_method = hash_method
+    
+    def needs_update(self, output_file, source_files, version):
+        output_file_name = get_output_filename(output_file, version)
+        ph = settings.COMPRESS_VERSION_PLACEHOLDER
+        of = output_file
+        try:
+            phi = of.index(ph)
+            old_version = output_file_name[phi:phi+len(ph)-len(of)]
+            return (version != old_version), version
+        except ValueError:
+            # no placeholder found, do not update, manual update if needed
+            return False, version
+            
+    def get_version(self, source_files):
+        buf = concat(source_files)
+        s = cStringIO.StringIO(buf)
+        version = self.get_hash(s)
+        s.close()
+        return version            
+            
+    def get_hash(self, f, CHUNK=2**16):
+        m = self.hash_method()
+        while 1:
+            chunk = f.read(CHUNK)
+            if not chunk:
+                break
+            m.update(chunk)
+        return m.hexdigest()
+
+class MD5Versioning(HashVersioningBase):
+    def __init__(self):
+        super(MD5Versioning, self).__init__(md5)
+
+class SHA1Versioning(HashVersioningBase):
+    def __init__(self):
+        super(SHA1Versioning, self).__init__(sha1)
\ No newline at end of file
diff --git a/apps/compress/versioning/mtime/__init__.py b/apps/compress/versioning/mtime/__init__.py
new file mode 100644 (file)
index 0000000..31b9d0b
--- /dev/null
@@ -0,0 +1,19 @@
+import os
+
+from compress.utils import get_output_filename, media_root
+from compress.versioning.base import VersioningBase
+
+class MTimeVersioning(VersioningBase):
+
+    def get_version(self, source_files):
+
+        # Return the modification time for the newest source file
+        return str(max([int(os.stat(media_root(f)).st_mtime) for f in source_files]))
+
+    def needs_update(self, output_file, source_files, version):
+
+        output_file_name = get_output_filename(output_file, version)
+        compressed_file_full = media_root(output_file_name)
+
+        return (int(os.stat(compressed_file_full).st_mtime) < int(version)), version
+
index 5f8d791..ac95245 100644 (file)
@@ -2,21 +2,16 @@
 {% load toolbar_tags %}
 
 {% block extrahead %}
 {% load toolbar_tags %}
 
 {% block extrahead %}
-    <link rel="stylesheet" href="{{STATIC_URL}}css/master.css" type="text/css" media="screen" charset="utf-8" />
-    <link rel="stylesheet" href="{{STATIC_URL}}css/html.css" type="text/css" media="screen" charset="utf-8" />
-    <link rel="stylesheet" href="{{STATIC_URL}}css/jquery.autocomplete.css" type="text/css" media="screen" title="no title" charset="utf-8">
-
+       {% load compressed %}
+       {% compressed_css 'detail' %}
+{% endblock %}
+       
+{% block extrabody %}
     <script type="text/javascript" charset="utf-8">
         var STATIC_URL = '{{STATIC_URL}}';
     <script type="text/javascript" charset="utf-8">
         var STATIC_URL = '{{STATIC_URL}}';
-    </script>
-    
+    </script>    
     <script src="{{STATIC_URL}}js/lib/codemirror/codemirror.js" type="text/javascript" charset="utf-8"></script>
     <script src="{{STATIC_URL}}js/lib/codemirror/codemirror.js" type="text/javascript" charset="utf-8"></script>
-    <script src="{{STATIC_URL}}js/jquery.blockui.js" type="text/javascript" charset="utf-8"></script>
-    <script src="{{STATIC_URL}}js/jquery.autocomplete.js" type="text/javascript" charset="utf-8"></script>
-    <script src="{{STATIC_URL}}js/jquery.elastic.js" type="text/javascript" charset="utf-8"></script>
-    <script src="{{STATIC_URL}}js/button_scripts.js" type="text/javascript" charset="utf-8"></script>
-    <script src="{{STATIC_URL}}js/xslt.js" type="text/javascript" charset="utf-8"></script>
-    <script src="{{STATIC_URL}}js/main.js" type="text/javascript" charset="utf-8"></script>
+       {% compressed_js 'detail' %}
 {% endblock %}
 
 {% block maincontent %}
 {% endblock %}
 
 {% block maincontent %}
index 1f2c9b9..183d612 100644 (file)
@@ -1,8 +1,12 @@
 {% extends "base.html" %}
 {% extends "base.html" %}
+{% load compressed %}
 
 {% block extrahead %}
 
 {% block extrahead %}
-<link rel="stylesheet" href="{{ STATIC_URL }}css/filelist.css" type="text/css" />
-<script src="{{ STATIC_URL }}js/slugify.js" type="text/javascript" charset="utf-8"></script>
+{% compressed_css 'listing' %}
+{% endblock extrahead %}
+
+{% block extrabody %}
+{% compressed_js 'listing' %}
 <script type="text/javascript" charset="utf-8">
 $(function() {
        function search(event) {
 <script type="text/javascript" charset="utf-8">
 $(function() {
        function search(event) {
@@ -20,7 +24,7 @@ $(function() {
        $('#file-list-filter').bind('keyup change DOMAttrModified', search);
 });
 </script>
        $('#file-list-filter').bind('keyup change DOMAttrModified', search);
 });
 </script>
-{% endblock extrahead %}
+{% endblock %}
 
 {% block maincontent %}
 <h1><img src="{{STATIC_URL}}/img/logo.png">Platforma Redakcyjna</h1>
 
 {% block maincontent %}
 <h1><img src="{{STATIC_URL}}/img/logo.png">Platforma Redakcyjna</h1>
index a936eb2..eba8f1f 100644 (file)
@@ -70,6 +70,7 @@ def deploy():
     copy_localsettings()
     symlink_current_release()
     migrate()
     copy_localsettings()
     symlink_current_release()
     migrate()
+    django_compress()
     restart_webserver()
 
 def deploy_version(version):
     restart_webserver()
 
 def deploy_version(version):
@@ -152,6 +153,14 @@ def migrate():
         run('../../../bin/python manage.py syncdb --noinput' % env, pty = True)
         if env.use_south:
             run('../../../bin/python manage.py migrate' % env, pty = True)
         run('../../../bin/python manage.py syncdb --noinput' % env, pty = True)
         if env.use_south:
             run('../../../bin/python manage.py migrate' % env, pty = True)
+            
+def django_compress():
+    "Update static files"
+    print '>>> migrate'
+    require('project_name', provided_by = [staging, production])
+    with cd('%(path)s/releases/current/%(project_name)s' % env):
+        run('../../../bin/python manage.py synccompress --force' % env, pty = True)
+        
 
 def restart_webserver():
     "Restart the web server"
 
 def restart_webserver():
     "Restart the web server"
index 634d6cb..b458545 100644 (file)
@@ -109,22 +109,52 @@ CAS_ADMIN_PREFIX = "/admin/"
 CAS_LOGOUT_COMPLETELY = True
 
 # CSS and JS files to compress
 CAS_LOGOUT_COMPLETELY = True
 
 # CSS and JS files to compress
-# COMPRESS_CSS = {
-#     'all': {
-#         'source_filenames': ('css/master.css', 'css/jquery.date_input.css', 'css/jquery.countdown.css',),
-#         'output_filename': 'css/all.min.css',
-#     }
-# }
-# 
-# COMPRESS_JS = {
-#     'all': {
-#         'source_filenames': ('js/jquery.js', 'js/jquery.date_input.js', 'js/jquery.date_input-pl.js',
-#             'js/jquery.countdown.js', 'js/jquery.countdown-pl.js',),
-#         'output_filename': 'js/all.min.js',
-#     }
-# }
-# 
-# COMPRESS_CSS_FILTERS = None
+COMPRESS_CSS = {
+    'detail': {
+         'source_filenames': (
+            'css/master.css', 
+            'css/html.css',             
+            'css/jquery.autocomplete.css',
+        ),
+        'output_filename': 'compressed/detail_styles_?.css',
+    },
+    'listing': {
+        'source_filenames': (
+            'css/filelist.css', 
+        ),             
+        'output_filename': 'compressed/listing_styles_?.js',
+     }
+}
+COMPRESS_JS = {
+    # everything except codemirror
+    'detail': {
+        'source_filenames': (
+                'js/jquery-1.4.2.min.js', 
+                'js/jquery.autocomplete.js', 
+                'js/jquery.blockui.js',
+                'js/jquery.elastic.js',
+                'js/button_scripts.js',
+                'js/slugify.js',
+                'js/xslt.js',
+                'js/main.js',
+        ),             
+        'output_filename': 'compressed/detail_scripts_?.js',
+     },
+    'listing': {
+        'source_filenames': (
+                'js/jquery-1.4.2.min.js', 
+                'js/slugify.js',                
+        ),             
+        'output_filename': 'compressed/listing_scripts_?.js',
+     }
+}
+COMPRESS_CSS_FILTERS = None
+COMPRESS_JS_FILTERS = None
+COMPRESS_AUTO = False
+COMPRESS_VERSION = True
+COMPRESS_VERSIONING = 'compress.versioning.hash.MD5Versioning'
 
 
 INSTALLED_APPS = (
 
 
 INSTALLED_APPS = (
@@ -136,6 +166,7 @@ INSTALLED_APPS = (
     'django.contrib.admindocs',
 
     'django_nose',
     'django.contrib.admindocs',
 
     'django_nose',
+    'compress',
 
     'wiki',
     'sorl.thumbnail',
 
     'wiki',
     'sorl.thumbnail',
diff --git a/platforma/static/css/autumn.css b/platforma/static/css/autumn.css
deleted file mode 100644 (file)
index dddd899..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/* 
-    Document   : autumn
-    Created on : 2009-10-01, 00:23:51
-    Author     : lreqc
-    Description:
-        Autumn colors for PR.
-*/
-
-body {
-    background-color: #C28800;
-}
-
-#header {
-    background-color: #E2CF62;
-    border-bottom-color: #860000;
-}
-
-.panel-main-toolbar {
-    background-color: #412F1D;    
-}
-
-.splitview-splitbar {
-    /* border-color: #412F1D; */
-    border: none;
-    background-color: #860000;
-}
-
-.image-gallery-header {
-    background-color: #E2CF62;
-}
-
-a:link, a:visited, a:active {
-    color: #860000;
-    text-decoration: none;
-    font-weight: bold;
-}
-
-a:hover {
-    text-decoration: underline;
-}
-
-.toolbar-buttons-container {
-    background-color: #E2CF62;
-}
-
-.toolbar-tabs-container {
-    background-color: #860000;
-}
-
diff --git a/platforma/static/css/awesome-overlay-sprite.png b/platforma/static/css/awesome-overlay-sprite.png
deleted file mode 100644 (file)
index ef8dd2d..0000000
Binary files a/platforma/static/css/awesome-overlay-sprite.png and /dev/null differ
diff --git a/platforma/static/css/buttons.css b/platforma/static/css/buttons.css
deleted file mode 100644 (file)
index 034c3b7..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/* set an awesome color for the buttons */
-button.awesome, 
-input.awesome, 
-a.button.awesome {
-  background-color: #111;
-}
-/* Touch the rest at your onw risk. */
-button.awesome,
-input.awesome,
-a.button.awesome { 
-
-  font: inherit;
-  background-repeat: repeat-x; 
-  color: #fff;
-  text-decoration: none; 
-  position: relative; 
-  cursor: pointer; 
-  border: 0; 
-  font-style: normal; 
-  font-weight: bold; 
-  line-height: 1; 
-  
-  padding: 5px 10px 6px;
-  font-size: 13px;
-  
-  /* IE only stuff */
-  border-bottom: 1px solid transparent\9;
-  
-  /* not all browser support these, but who cares? */
-  text-shadow: 0 -1px 1px rgba(0,0,0,0.25), -2px 0 1px rgba(0,0,0,0.25); 
-  border-radius: 5px; 
-  -moz-border-radius: 5px; 
-  -webkit-border-radius: 5px; 
-  -moz-box-shadow: 0 1px 2px rgba(0,0,0,0.5); 
-  -webkit-box-shadow: 0 1px 2px rgba(0,0,0,0.5);
-  
-  /* one image for all states 
-     see http://www.alistapart.com/articles/sprites */
-  background-image: url(awesome-overlay-sprite.png);
-  background-position: 0 0;
-  
-  /* cross browser inline block hack 
-     see http://blog.mozilla.com/webdev/2009/02/20/cross-browser-inline-block/ */
-  display: -moz-inline-stack;
-  display: inline-block;
-  vertical-align: middle;
-  *display: inline !important;
-  position: relative;
-  
-  /* help IE to calm down a bit */
-  zoom: 1;
-  
-  /*disable text selection (Firefox only)*/
-  -moz-user-select: none;
-}
-/* hide selection background color */
-.awesome::selection {
-       background: transparent;
-}
-
-button.awesome:hover,
-input.awesome:hover,
-a.button.awesome:hover {
-  background-position: 0 -50px; 
-  color: #fff;
-}
-button.awesome:active,
-input.awesome:active,
-a.button.awesome:active        { 
-  background-position: 0 100%; 
-  -moz-box-shadow: inset 0 1px 2px rgba(0,0,0,0.7); 
-  /* unfortunately, Safari seems not to support inset yet */
-  -webkit-box-shadow: none;
-  
-  /* IE only stuff */
-  border-bottom: 0\9;
-  border-top: 1px solid #666\9;
-}
-
-/* Remove extra padding in Firefox */
-button::-moz-focus-inner { 
-    border: 0;
-    padding: 0;
-}
-
-button.awesome.small,         input.awesome.small,          a.button.awesome.small             { padding: 4px 7px 5px; font-size: 10px; }
-button.awesome.small:active,  input.awesome.small:active,   a.button.awesome.small:active        { padding: 5px 7px 4px; }
-button.awesome.medium,        input.awesome.medium,         a.button.awesome.medium         { /* default */ }
-button.awesome.medium:active, input.awesome.medium:active,  a.button.awesome.medium:active     { padding: 6px 10px 5px; }
-button.awesome.large,         input.awesome.large,          a.button.awesome.large             { padding: 8px 14px 9px; font-size: 14px; }
-button.awesome.large:active,  input.awesome.large:active,   a.button.awesome.large:active        { padding: 9px 14px 8px; }
-
-.awesome.green { background-color: #3ACC00 !important; }
diff --git a/platforma/static/css/jquery.modal.css b/platforma/static/css/jquery.modal.css
deleted file mode 100644 (file)
index 4dc8a25..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* jqModal base Styling courtesy of;\r
-       Brice Burgess <bhb@iceburg.net> */\r
-\r
-/* The Window's CSS z-index value is respected (takes priority). If none is supplied,\r
-       the Window's z-index value will be set to 3000 by default (via jqModal.js). */\r
-       \r
-.jqmWindow {\r
-    display: none;\r
-    \r
-    position: absolute;\r
-    top: 40px;\r
-    left: 25%;\r
-    bottom: auto;\r
-    height: auto;\r
-    width: auto;\r
-\r
-    max-width: 80%;\r
-    max-height: 80%;\r
-\r
-    overflow: auto;\r
-    \r
-    background-color: #EEE;\r
-    color: #333;\r
-    border: 1px solid black;\r
-    padding: 1em;\r
-    z-index: 10000;\r
-}\r
-\r
-.jqmOverlay { background-color: #000; }\r
diff --git a/platforma/static/css/managment.css b/platforma/static/css/managment.css
deleted file mode 100644 (file)
index d1e2fc2..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-table.request-report 
-{
-    border: 2px groove black;
-    font-size: 12pt;
-
-    margin-top: 3em;
-    margin-bottom: 2em;
-    margin-left: auto;
-    margin-right: auto;
-}
-
-.pull-request {
-    padding: 20px 20px 10px 20px;
-    border-bottom: 1px dotted #CCC;
-}
-
-.pull-request h2 {
-    padding: 0;
-    margin: 0;
-    font-size: 22px;
-}
-
-.pull-request .request-info {
-    color: #999;
-    list-style: none;
-    margin: 0;
-    padding: 0;
-}
-
-.pull-request .request-info li {
-    float: left;
-    padding-right: 20px;
-}
-
-.pull-request p.comment {
-    clear: left;
-    padding: 20px 0;
-}
-
-.pull-request p {
-    margin: 0;
-    padding: 0;
-}
-
-.awesome.button {
-    margin-right: 10px;
-}
-
-.pull-request.status-N {
-    background-color: #FFF;
-}
-
-.pull-request.status-R {
-    background-color: red;
-}
-
-.pull-request.status-A {
-    background-color: #DDD;
-}
-
-.pull-request .diff {
-    white-space: pre;
-    height: 360px;
-    width: 960px;
-    overflow: auto;
-    border: 1px solid #CCC;
-    margin-top: 10px;
-    background-color: #F9F9F9;
-    padding: 2px;
-}
diff --git a/platforma/static/css/pygments.css b/platforma/static/css/pygments.css
deleted file mode 100644 (file)
index 5cea4ab..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-.hll { background-color: #ffffcc }
-.c { color: #888888 } /* Comment */
-.err { color: #a61717; background-color: #e3d2d2 } /* Error */
-.k { color: #008800; font-weight: bold } /* Keyword */
-.cm { color: #888888 } /* Comment.Multiline */
-.cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
-.c1 { color: #888888 } /* Comment.Single */
-.cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
-.gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
-.ge { font-style: italic } /* Generic.Emph */
-.gr { color: #aa0000 } /* Generic.Error */
-.gh { color: #303030 } /* Generic.Heading */
-.gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
-.go { color: #888888 } /* Generic.Output */
-.gp { color: #555555 } /* Generic.Prompt */
-.gs { font-weight: bold } /* Generic.Strong */
-.gu { color: #606060 } /* Generic.Subheading */
-.gt { color: #aa0000 } /* Generic.Traceback */
-.kc { color: #008800; font-weight: bold } /* Keyword.Constant */
-.kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
-.kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
-.kp { color: #008800 } /* Keyword.Pseudo */
-.kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
-.kt { color: #888888; font-weight: bold } /* Keyword.Type */
-.m { color: #0000DD; font-weight: bold } /* Literal.Number */
-.s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
-.na { color: #336699 } /* Name.Attribute */
-.nb { color: #003388 } /* Name.Builtin */
-.nc { color: #bb0066; font-weight: bold } /* Name.Class */
-.no { color: #003366; font-weight: bold } /* Name.Constant */
-.nd { color: #555555 } /* Name.Decorator */
-.ne { color: #bb0066; font-weight: bold } /* Name.Exception */
-.nf { color: #0066bb; font-weight: bold } /* Name.Function */
-.nl { color: #336699; font-style: italic } /* Name.Label */
-.nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
-.py { color: #336699; font-weight: bold } /* Name.Property */
-.nt { color: #bb0066; font-weight: bold } /* Name.Tag */
-.nv { color: #336699 } /* Name.Variable */
-.ow { color: #008800 } /* Operator.Word */
-.w { color: #bbbbbb } /* Text.Whitespace */
-.mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
-.mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
-.mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
-.mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
-.sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
-.sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
-.sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
-.s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
-.se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
-.sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
-.si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
-.sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
-.sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
-.s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
-.ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
-.bp { color: #003388 } /* Name.Builtin.Pseudo */
-.vc { color: #336699 } /* Name.Variable.Class */
-.vg { color: #dd7700 } /* Name.Variable.Global */
-.vi { color: #3333bb } /* Name.Variable.Instance */
-.il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
diff --git a/platforma/static/css/toolbar.css b/platforma/static/css/toolbar.css
deleted file mode 100644 (file)
index b5df66f..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-.toolbar-buttons-container {    
-    padding-top: 2px;
-    padding-bottom: 2px;
-}
-
diff --git a/platforma/static/js/jquery-1.4.2.min.js b/platforma/static/js/jquery-1.4.2.min.js
new file mode 100644 (file)
index 0000000..7c24308
--- /dev/null
@@ -0,0 +1,154 @@
+/*!
+ * jQuery JavaScript Library v1.4.2
+ * http://jquery.com/
+ *
+ * Copyright 2010, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2010, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Sat Feb 13 22:33:48 2010 -0500
+ */
+(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i?
+e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r=
+j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,
+"&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e=
+true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,
+Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&&
+(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,
+a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
+"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,
+function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)||
+c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",
+L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,
+"isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+
+a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f],
+d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]===
+a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&&
+!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=
+true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
+var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,
+parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent=
+false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n=
+s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,
+applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando];
+else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,
+a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===
+w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,
+cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ",
+i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ",
+" ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=
+this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i=
+e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected=
+c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
+a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g,
+function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split(".");
+k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a),
+C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!=
+null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=
+e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&&
+f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;
+if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
+fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
+d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this,
+"events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=
+a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,
+isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit=
+{setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};
+if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",
+e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,
+"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,
+d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&
+!a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},
+toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector,
+u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),
+function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];
+if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift();
+t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D||
+g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[];
+for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-
+1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
+CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},
+relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]=
+l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[];
+h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},
+CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m,
+g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},
+text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},
+setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=
+h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m=
+m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
+"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,
+h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition||
+!h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m=
+h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&
+q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>";
+if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}();
+(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}:
+function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/,
+gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;
+c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j=
+{},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a===
+"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",
+d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?
+a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType===
+1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)?
+a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
+c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
+wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
+prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
+this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
+return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,
+""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&
+this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]||
+u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length===
+1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]);
+return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["",
+""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e=
+c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]?
+c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=
+function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=
+Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,
+"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=
+a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=
+a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!==
+"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this},
+serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
+function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,
+global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&
+e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)?
+"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===
+false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B=
+false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",
+c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E||
+d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x);
+g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===
+1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b===
+"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional;
+if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");
+this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],
+"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},
+animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing=
+j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);
+this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration===
+"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||
+c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;
+this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=
+this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,
+e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||
+c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?
+function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=
+this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle;
+k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&
+f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
+a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b);
+c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,
+d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-
+f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset":
+"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in
+e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);
diff --git a/platforma/static/js/lib/jquery.cookie.js b/platforma/static/js/lib/jquery.cookie.js
deleted file mode 100644 (file)
index 6df1fac..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/**
- * Cookie plugin
- *
- * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
- * Dual licensed under the MIT and GPL licenses:
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
- *
- */
-
-/**
- * Create a cookie with the given name and value and other optional parameters.
- *
- * @example $.cookie('the_cookie', 'the_value');
- * @desc Set the value of a cookie.
- * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
- * @desc Create a cookie with all available options.
- * @example $.cookie('the_cookie', 'the_value');
- * @desc Create a session cookie.
- * @example $.cookie('the_cookie', null);
- * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
- *       used when the cookie was set.
- *
- * @param String name The name of the cookie.
- * @param String value The value of the cookie.
- * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
- * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
- *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
- *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
- *                             when the the browser exits.
- * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
- * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
- * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
- *                        require a secure protocol (like HTTPS).
- * @type undefined
- *
- * @name $.cookie
- * @cat Plugins/Cookie
- * @author Klaus Hartl/klaus.hartl@stilbuero.de
- */
-
-/**
- * Get the value of a cookie with the given name.
- *
- * @example $.cookie('the_cookie');
- * @desc Get the value of a cookie.
- *
- * @param String name The name of the cookie.
- * @return The value of the cookie.
- * @type String
- *
- * @name $.cookie
- * @cat Plugins/Cookie
- * @author Klaus Hartl/klaus.hartl@stilbuero.de
- */
-jQuery.cookie = function(name, value, options) {
-    if (typeof value != 'undefined') { // name and value given, set cookie
-        options = options || {};
-        if (value === null) {
-            value = '';
-            options.expires = -1;
-        }
-        var expires = '';
-        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
-            var date;
-            if (typeof options.expires == 'number') {
-                date = new Date();
-                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
-            } else {
-                date = options.expires;
-            }
-            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
-        }
-        // CAUTION: Needed to parenthesize options.path and options.domain
-        // in the following expressions, otherwise they evaluate to undefined
-        // in the packed version for some reason...
-        var path = options.path ? '; path=' + (options.path) : '';
-        var domain = options.domain ? '; domain=' + (options.domain) : '';
-        var secure = options.secure ? '; secure' : '';
-        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
-    } else { // only name given, get cookie
-        var cookieValue = null;
-        if (document.cookie && document.cookie != '') {
-            var cookies = document.cookie.split(';');
-            for (var i = 0; i < cookies.length; i++) {
-                var cookie = jQuery.trim(cookies[i]);
-                // Does this cookie string begin with the name we want?
-                if (cookie.substring(0, name.length + 1) == (name + '=')) {
-                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
-                    break;
-                }
-            }
-        }
-        return cookieValue;
-    }
-};
\ No newline at end of file
diff --git a/platforma/static/js/lib/jquery.hpanel.js b/platforma/static/js/lib/jquery.hpanel.js
deleted file mode 100644 (file)
index 1ad0d17..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-(function($){
-    
-       /* behaviour */
-       $.hpanel = {
-        settings: {},
-               current_data: {},
-        resize_start: function(event, mydata) {
-                       $(document).bind('mousemove', mydata, $.hpanel.resize_changed).
-                               bind('mouseup', mydata, $.hpanel.resize_stop); 
-
-                       $('.panel-overlay', mydata.root).css('display', 'block');
-                       return false;
-               },
-       resize_changed: function(event) {
-                       var old_width = parseInt(event.data.overlay.css('width'));
-                       var delta = event.pageX + event.data.hotspot_x - old_width;
-                       event.data.overlay.css({'width': old_width + delta});
-
-                       if(event.data.overlay.next) {
-                               var left = parseInt(event.data.overlay.next.css('left'));
-                               event.data.overlay.next.css('left', left+delta);
-                       }
-
-            return false; 
-        },
-        resize_stop: function(event) {
-            $(document).unbind('mousemove', $.hpanel.resize_changed).unbind('mouseup', $.hpanel.resize_stop);
-                       // $('.panel-content', event.data.root).css('display', 'block');
-                       var overlays = $('.panel-content-overlay', event.data.root);
-                       $('.panel-content-overlay', event.data.root).each(function(i) {
-                               if( $(this).data('panel').hasClass('last-panel') )
-                                       $(this).data('panel').css({
-                                               'left': $(this).css('left'), 'right': $(this).css('right')}); 
-                               else
-                                       $(this).data('panel').css({
-                                               'left': $(this).css('left'), 'width': $(this).css('width')}); 
-                       });
-                       $('.panel-overlay', event.data.root).css('display', 'none');
-            $(event.data.root).trigger('stopResize');
-        }
-    };
-    
-    $.fn.makeHorizPanel = function(options) 
-       {
-               var root = $(this)
-
-               /* create an overlay */
-               var overlay_root = $("<div class='panel-overlay'></div>");
-               root.append(overlay_root);
-
-               var prev = null;
-
-               $('*.panel-wrap', root).each( function() 
-        {
-                       var panel = $(this);
-                       var handle = $('.panel-slider', panel);
-                       var overlay = $("<div class='panel-content-overlay panel-wrap'>&nbsp;</div>");
-                       overlay_root.append(overlay);
-                       overlay.data('panel', panel);
-                       overlay.data('next', null);
-
-                       if (prev) prev.next = overlay;
-
-                       if( panel.hasClass('last-panel') )                              
-            {
-                               overlay.css({'left': panel.css('left'), 'right': panel.css('right')});
-            }
-                       else {
-                               overlay.css({'left': panel.css('left'), 'width': panel.css('width')});
-                               $.log('Has handle: ' + panel.attr('id'));
-                               overlay.append(handle.clone());
-                               /* attach the trigger */
-                               handle.mousedown(function(event) {
-                                       var touch_data = {
-                                               root: root, overlay: overlay,
-                                               hotspot_x: event.pageX - handle.position().left
-                                       };
-
-                                       $(this).trigger('hpanel:panel-resize-start', touch_data);
-                                       return false;
-                               });
-                               $('.panel-content', panel).css('right', 
-                                       (handle.outerWidth() || 10) + 'px');
-                               $('.panel-content-overlay', panel).css('right',
-                                       (handle.outerWidth() || 10) + 'px');
-                       };                              
-
-                       prev = overlay;
-        });
-
-       root.bind('hpanel:panel-resize-start', $.hpanel.resize_start);
-    };
-})(jQuery);
-
diff --git a/platforma/static/js/lib/jquery.js b/platforma/static/js/lib/jquery.js
deleted file mode 100644 (file)
index 9263574..0000000
+++ /dev/null
@@ -1,4376 +0,0 @@
-/*!
- * jQuery JavaScript Library v1.3.2
- * http://jquery.com/
- *
- * Copyright (c) 2009 John Resig
- * Dual licensed under the MIT and GPL licenses.
- * http://docs.jquery.com/License
- *
- * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
- * Revision: 6246
- */
-(function(){
-
-var 
-       // Will speed up references to window, and allows munging its name.
-       window = this,
-       // Will speed up references to undefined, and allows munging its name.
-       undefined,
-       // Map over jQuery in case of overwrite
-       _jQuery = window.jQuery,
-       // Map over the $ in case of overwrite
-       _$ = window.$,
-
-       jQuery = window.jQuery = window.$ = function( selector, context ) {
-               // The jQuery object is actually just the init constructor 'enhanced'
-               return new jQuery.fn.init( selector, context );
-       },
-
-       // A simple way to check for HTML strings or ID strings
-       // (both of which we optimize for)
-       quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,
-       // Is it a simple selector
-       isSimple = /^.[^:#\[\.,]*$/;
-
-jQuery.fn = jQuery.prototype = {
-       init: function( selector, context ) {
-               // Make sure that a selection was provided
-               selector = selector || document;
-
-               // Handle $(DOMElement)
-               if ( selector.nodeType ) {
-                       this[0] = selector;
-                       this.length = 1;
-                       this.context = selector;
-                       return this;
-               }
-               // Handle HTML strings
-               if ( typeof selector === "string" ) {
-                       // Are we dealing with HTML string or an ID?
-                       var match = quickExpr.exec( selector );
-
-                       // Verify a match, and that no context was specified for #id
-                       if ( match && (match[1] || !context) ) {
-
-                               // HANDLE: $(html) -> $(array)
-                               if ( match[1] )
-                                       selector = jQuery.clean( [ match[1] ], context );
-
-                               // HANDLE: $("#id")
-                               else {
-                                       var elem = document.getElementById( match[3] );
-
-                                       // Handle the case where IE and Opera return items
-                                       // by name instead of ID
-                                       if ( elem && elem.id != match[3] )
-                                               return jQuery().find( selector );
-
-                                       // Otherwise, we inject the element directly into the jQuery object
-                                       var ret = jQuery( elem || [] );
-                                       ret.context = document;
-                                       ret.selector = selector;
-                                       return ret;
-                               }
-
-                       // HANDLE: $(expr, [context])
-                       // (which is just equivalent to: $(content).find(expr)
-                       } else
-                               return jQuery( context ).find( selector );
-
-               // HANDLE: $(function)
-               // Shortcut for document ready
-               } else if ( jQuery.isFunction( selector ) )
-                       return jQuery( document ).ready( selector );
-
-               // Make sure that old selector state is passed along
-               if ( selector.selector && selector.context ) {
-                       this.selector = selector.selector;
-                       this.context = selector.context;
-               }
-
-               return this.setArray(jQuery.isArray( selector ) ?
-                       selector :
-                       jQuery.makeArray(selector));
-       },
-
-       // Start with an empty selector
-       selector: "",
-
-       // The current version of jQuery being used
-       jquery: "1.3.2",
-
-       // The number of elements contained in the matched element set
-       size: function() {
-               return this.length;
-       },
-
-       // Get the Nth element in the matched element set OR
-       // Get the whole matched element set as a clean array
-       get: function( num ) {
-               return num === undefined ?
-
-                       // Return a 'clean' array
-                       Array.prototype.slice.call( this ) :
-
-                       // Return just the object
-                       this[ num ];
-       },
-
-       // Take an array of elements and push it onto the stack
-       // (returning the new matched element set)
-       pushStack: function( elems, name, selector ) {
-               // Build a new jQuery matched element set
-               var ret = jQuery( elems );
-
-               // Add the old object onto the stack (as a reference)
-               ret.prevObject = this;
-
-               ret.context = this.context;
-
-               if ( name === "find" )
-                       ret.selector = this.selector + (this.selector ? " " : "") + selector;
-               else if ( name )
-                       ret.selector = this.selector + "." + name + "(" + selector + ")";
-
-               // Return the newly-formed element set
-               return ret;
-       },
-
-       // Force the current matched set of elements to become
-       // the specified array of elements (destroying the stack in the process)
-       // You should use pushStack() in order to do this, but maintain the stack
-       setArray: function( elems ) {
-               // Resetting the length to 0, then using the native Array push
-               // is a super-fast way to populate an object with array-like properties
-               this.length = 0;
-               Array.prototype.push.apply( this, elems );
-
-               return this;
-       },
-
-       // Execute a callback for every element in the matched set.
-       // (You can seed the arguments with an array of args, but this is
-       // only used internally.)
-       each: function( callback, args ) {
-               return jQuery.each( this, callback, args );
-       },
-
-       // Determine the position of an element within
-       // the matched set of elements
-       index: function( elem ) {
-               // Locate the position of the desired element
-               return jQuery.inArray(
-                       // If it receives a jQuery object, the first element is used
-                       elem && elem.jquery ? elem[0] : elem
-               , this );
-       },
-
-       attr: function( name, value, type ) {
-               var options = name;
-
-               // Look for the case where we're accessing a style value
-               if ( typeof name === "string" )
-                       if ( value === undefined )
-                               return this[0] && jQuery[ type || "attr" ]( this[0], name );
-
-                       else {
-                               options = {};
-                               options[ name ] = value;
-                       }
-
-               // Check to see if we're setting style values
-               return this.each(function(i){
-                       // Set all the styles
-                       for ( name in options )
-                               jQuery.attr(
-                                       type ?
-                                               this.style :
-                                               this,
-                                       name, jQuery.prop( this, options[ name ], type, i, name )
-                               );
-               });
-       },
-
-       css: function( key, value ) {
-               // ignore negative width and height values
-               if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 )
-                       value = undefined;
-               return this.attr( key, value, "curCSS" );
-       },
-
-       text: function( text ) {
-               if ( typeof text !== "object" && text != null )
-                       return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
-
-               var ret = "";
-
-               jQuery.each( text || this, function(){
-                       jQuery.each( this.childNodes, function(){
-                               if ( this.nodeType != 8 )
-                                       ret += this.nodeType != 1 ?
-                                               this.nodeValue :
-                                               jQuery.fn.text( [ this ] );
-                       });
-               });
-
-               return ret;
-       },
-
-       wrapAll: function( html ) {
-               if ( this[0] ) {
-                       // The elements to wrap the target around
-                       var wrap = jQuery( html, this[0].ownerDocument ).clone();
-
-                       if ( this[0].parentNode )
-                               wrap.insertBefore( this[0] );
-
-                       wrap.map(function(){
-                               var elem = this;
-
-                               while ( elem.firstChild )
-                                       elem = elem.firstChild;
-
-                               return elem;
-                       }).append(this);
-               }
-
-               return this;
-       },
-
-       wrapInner: function( html ) {
-               return this.each(function(){
-                       jQuery( this ).contents().wrapAll( html );
-               });
-       },
-
-       wrap: function( html ) {
-               return this.each(function(){
-                       jQuery( this ).wrapAll( html );
-               });
-       },
-
-       append: function() {
-               return this.domManip(arguments, true, function(elem){
-                       if (this.nodeType == 1)
-                               this.appendChild( elem );
-               });
-       },
-
-       prepend: function() {
-               return this.domManip(arguments, true, function(elem){
-                       if (this.nodeType == 1)
-                               this.insertBefore( elem, this.firstChild );
-               });
-       },
-
-       before: function() {
-               return this.domManip(arguments, false, function(elem){
-                       this.parentNode.insertBefore( elem, this );
-               });
-       },
-
-       after: function() {
-               return this.domManip(arguments, false, function(elem){
-                       this.parentNode.insertBefore( elem, this.nextSibling );
-               });
-       },
-
-       end: function() {
-               return this.prevObject || jQuery( [] );
-       },
-
-       // For internal use only.
-       // Behaves like an Array's method, not like a jQuery method.
-       push: [].push,
-       sort: [].sort,
-       splice: [].splice,
-
-       find: function( selector ) {
-               if ( this.length === 1 ) {
-                       var ret = this.pushStack( [], "find", selector );
-                       ret.length = 0;
-                       jQuery.find( selector, this[0], ret );
-                       return ret;
-               } else {
-                       return this.pushStack( jQuery.unique(jQuery.map(this, function(elem){
-                               return jQuery.find( selector, elem );
-                       })), "find", selector );
-               }
-       },
-
-       clone: function( events ) {
-               // Do the clone
-               var ret = this.map(function(){
-                       if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
-                               // IE copies events bound via attachEvent when
-                               // using cloneNode. Calling detachEvent on the
-                               // clone will also remove the events from the orignal
-                               // In order to get around this, we use innerHTML.
-                               // Unfortunately, this means some modifications to
-                               // attributes in IE that are actually only stored
-                               // as properties will not be copied (such as the
-                               // the name attribute on an input).
-                               var html = this.outerHTML;
-                               if ( !html ) {
-                                       var div = this.ownerDocument.createElement("div");
-                                       div.appendChild( this.cloneNode(true) );
-                                       html = div.innerHTML;
-                               }
-
-                               return jQuery.clean([html.replace(/ jQuery\d+="(?:\d+|null)"/g, "").replace(/^\s*/, "")])[0];
-                       } else
-                               return this.cloneNode(true);
-               });
-
-               // Copy the events from the original to the clone
-               if ( events === true ) {
-                       var orig = this.find("*").andSelf(), i = 0;
-
-                       ret.find("*").andSelf().each(function(){
-                               if ( this.nodeName !== orig[i].nodeName )
-                                       return;
-
-                               var events = jQuery.data( orig[i], "events" );
-
-                               for ( var type in events ) {
-                                       for ( var handler in events[ type ] ) {
-                                               jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
-                                       }
-                               }
-
-                               i++;
-                       });
-               }
-
-               // Return the cloned set
-               return ret;
-       },
-
-       filter: function( selector ) {
-               return this.pushStack(
-                       jQuery.isFunction( selector ) &&
-                       jQuery.grep(this, function(elem, i){
-                               return selector.call( elem, i );
-                       }) ||
-
-                       jQuery.multiFilter( selector, jQuery.grep(this, function(elem){
-                               return elem.nodeType === 1;
-                       }) ), "filter", selector );
-       },
-
-       closest: function( selector ) {
-               var pos = jQuery.expr.match.POS.test( selector ) ? jQuery(selector) : null,
-                       closer = 0;
-
-               return this.map(function(){
-                       var cur = this;
-                       while ( cur && cur.ownerDocument ) {
-                               if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selector) ) {
-                                       jQuery.data(cur, "closest", closer);
-                                       return cur;
-                               }
-                               cur = cur.parentNode;
-                               closer++;
-                       }
-               });
-       },
-
-       not: function( selector ) {
-               if ( typeof selector === "string" )
-                       // test special case where just one selector is passed in
-                       if ( isSimple.test( selector ) )
-                               return this.pushStack( jQuery.multiFilter( selector, this, true ), "not", selector );
-                       else
-                               selector = jQuery.multiFilter( selector, this );
-
-               var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType;
-               return this.filter(function() {
-                       return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector;
-               });
-       },
-
-       add: function( selector ) {
-               return this.pushStack( jQuery.unique( jQuery.merge(
-                       this.get(),
-                       typeof selector === "string" ?
-                               jQuery( selector ) :
-                               jQuery.makeArray( selector )
-               )));
-       },
-
-       is: function( selector ) {
-               return !!selector && jQuery.multiFilter( selector, this ).length > 0;
-       },
-
-       hasClass: function( selector ) {
-               return !!selector && this.is( "." + selector );
-       },
-
-       val: function( value ) {
-               if ( value === undefined ) {                    
-                       var elem = this[0];
-
-                       if ( elem ) {
-                               if( jQuery.nodeName( elem, 'option' ) )
-                                       return (elem.attributes.value || {}).specified ? elem.value : elem.text;
-                               
-                               // We need to handle select boxes special
-                               if ( jQuery.nodeName( elem, "select" ) ) {
-                                       var index = elem.selectedIndex,
-                                               values = [],
-                                               options = elem.options,
-                                               one = elem.type == "select-one";
-
-                                       // Nothing was selected
-                                       if ( index < 0 )
-                                               return null;
-
-                                       // Loop through all the selected options
-                                       for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
-                                               var option = options[ i ];
-
-                                               if ( option.selected ) {
-                                                       // Get the specifc value for the option
-                                                       value = jQuery(option).val();
-
-                                                       // We don't need an array for one selects
-                                                       if ( one )
-                                                               return value;
-
-                                                       // Multi-Selects return an array
-                                                       values.push( value );
-                                               }
-                                       }
-
-                                       return values;                          
-                               }
-
-                               // Everything else, we just grab the value
-                               return (elem.value || "").replace(/\r/g, "");
-
-                       }
-
-                       return undefined;
-               }
-
-               if ( typeof value === "number" )
-                       value += '';
-
-               return this.each(function(){
-                       if ( this.nodeType != 1 )
-                               return;
-
-                       if ( jQuery.isArray(value) && /radio|checkbox/.test( this.type ) )
-                               this.checked = (jQuery.inArray(this.value, value) >= 0 ||
-                                       jQuery.inArray(this.name, value) >= 0);
-
-                       else if ( jQuery.nodeName( this, "select" ) ) {
-                               var values = jQuery.makeArray(value);
-
-                               jQuery( "option", this ).each(function(){
-                                       this.selected = (jQuery.inArray( this.value, values ) >= 0 ||
-                                               jQuery.inArray( this.text, values ) >= 0);
-                               });
-
-                               if ( !values.length )
-                                       this.selectedIndex = -1;
-
-                       } else
-                               this.value = value;
-               });
-       },
-
-       html: function( value ) {
-               return value === undefined ?
-                       (this[0] ?
-                               this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g, "") :
-                               null) :
-                       this.empty().append( value );
-       },
-
-       replaceWith: function( value ) {
-               return this.after( value ).remove();
-       },
-
-       eq: function( i ) {
-               return this.slice( i, +i + 1 );
-       },
-
-       slice: function() {
-               return this.pushStack( Array.prototype.slice.apply( this, arguments ),
-                       "slice", Array.prototype.slice.call(arguments).join(",") );
-       },
-
-       map: function( callback ) {
-               return this.pushStack( jQuery.map(this, function(elem, i){
-                       return callback.call( elem, i, elem );
-               }));
-       },
-
-       andSelf: function() {
-               return this.add( this.prevObject );
-       },
-
-       domManip: function( args, table, callback ) {
-               if ( this[0] ) {
-                       var fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(),
-                               scripts = jQuery.clean( args, (this[0].ownerDocument || this[0]), fragment ),
-                               first = fragment.firstChild;
-
-                       if ( first )
-                               for ( var i = 0, l = this.length; i < l; i++ )
-                                       callback.call( root(this[i], first), this.length > 1 || i > 0 ?
-                                                       fragment.cloneNode(true) : fragment );
-               
-                       if ( scripts )
-                               jQuery.each( scripts, evalScript );
-               }
-
-               return this;
-               
-               function root( elem, cur ) {
-                       return table && jQuery.nodeName(elem, "table") && jQuery.nodeName(cur, "tr") ?
-                               (elem.getElementsByTagName("tbody")[0] ||
-                               elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
-                               elem;
-               }
-       }
-};
-
-// Give the init function the jQuery prototype for later instantiation
-jQuery.fn.init.prototype = jQuery.fn;
-
-function evalScript( i, elem ) {
-       if ( elem.src )
-               jQuery.ajax({
-                       url: elem.src,
-                       async: false,
-                       dataType: "script"
-               });
-
-       else
-               jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
-
-       if ( elem.parentNode )
-               elem.parentNode.removeChild( elem );
-}
-
-function now(){
-       return +new Date;
-}
-
-jQuery.extend = jQuery.fn.extend = function() {
-       // copy reference to target object
-       var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options;
-
-       // Handle a deep copy situation
-       if ( typeof target === "boolean" ) {
-               deep = target;
-               target = arguments[1] || {};
-               // skip the boolean and the target
-               i = 2;
-       }
-
-       // Handle case when target is a string or something (possible in deep copy)
-       if ( typeof target !== "object" && !jQuery.isFunction(target) )
-               target = {};
-
-       // extend jQuery itself if only one argument is passed
-       if ( length == i ) {
-               target = this;
-               --i;
-       }
-
-       for ( ; i < length; i++ )
-               // Only deal with non-null/undefined values
-               if ( (options = arguments[ i ]) != null )
-                       // Extend the base object
-                       for ( var name in options ) {
-                               var src = target[ name ], copy = options[ name ];
-
-                               // Prevent never-ending loop
-                               if ( target === copy )
-                                       continue;
-
-                               // Recurse if we're merging object values
-                               if ( deep && copy && typeof copy === "object" && !copy.nodeType )
-                                       target[ name ] = jQuery.extend( deep, 
-                                               // Never move original objects, clone them
-                                               src || ( copy.length != null ? [ ] : { } )
-                                       , copy );
-
-                               // Don't bring in undefined values
-                               else if ( copy !== undefined )
-                                       target[ name ] = copy;
-
-                       }
-
-       // Return the modified object
-       return target;
-};
-
-// exclude the following css properties to add px
-var    exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
-       // cache defaultView
-       defaultView = document.defaultView || {},
-       toString = Object.prototype.toString;
-
-jQuery.extend({
-       noConflict: function( deep ) {
-               window.$ = _$;
-
-               if ( deep )
-                       window.jQuery = _jQuery;
-
-               return jQuery;
-       },
-
-       // See test/unit/core.js for details concerning isFunction.
-       // Since version 1.3, DOM methods and functions like alert
-       // aren't supported. They return false on IE (#2968).
-       isFunction: function( obj ) {
-               return toString.call(obj) === "[object Function]";
-       },
-
-       isArray: function( obj ) {
-               return toString.call(obj) === "[object Array]";
-       },
-
-       // check if an element is in a (or is an) XML document
-       isXMLDoc: function( elem ) {
-               return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
-                       !!elem.ownerDocument && jQuery.isXMLDoc( elem.ownerDocument );
-       },
-
-       // Evalulates a script in a global context
-       globalEval: function( data ) {
-               if ( data && /\S/.test(data) ) {
-                       // Inspired by code by Andrea Giammarchi
-                       // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
-                       var head = document.getElementsByTagName("head")[0] || document.documentElement,
-                               script = document.createElement("script");
-
-                       script.type = "text/javascript";
-                       if ( jQuery.support.scriptEval )
-                               script.appendChild( document.createTextNode( data ) );
-                       else
-                               script.text = data;
-
-                       // Use insertBefore instead of appendChild  to circumvent an IE6 bug.
-                       // This arises when a base node is used (#2709).
-                       head.insertBefore( script, head.firstChild );
-                       head.removeChild( script );
-               }
-       },
-
-       nodeName: function( elem, name ) {
-               return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
-       },
-
-       // args is for internal usage only
-       each: function( object, callback, args ) {
-               var name, i = 0, length = object.length;
-
-               if ( args ) {
-                       if ( length === undefined ) {
-                               for ( name in object )
-                                       if ( callback.apply( object[ name ], args ) === false )
-                                               break;
-                       } else
-                               for ( ; i < length; )
-                                       if ( callback.apply( object[ i++ ], args ) === false )
-                                               break;
-
-               // A special, fast, case for the most common use of each
-               } else {
-                       if ( length === undefined ) {
-                               for ( name in object )
-                                       if ( callback.call( object[ name ], name, object[ name ] ) === false )
-                                               break;
-                       } else
-                               for ( var value = object[0];
-                                       i < length && callback.call( value, i, value ) !== false; value = object[++i] ){}
-               }
-
-               return object;
-       },
-
-       prop: function( elem, value, type, i, name ) {
-               // Handle executable functions
-               if ( jQuery.isFunction( value ) )
-                       value = value.call( elem, i );
-
-               // Handle passing in a number to a CSS property
-               return typeof value === "number" && type == "curCSS" && !exclude.test( name ) ?
-                       value + "px" :
-                       value;
-       },
-
-       className: {
-               // internal only, use addClass("class")
-               add: function( elem, classNames ) {
-                       jQuery.each((classNames || "").split(/\s+/), function(i, className){
-                               if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) )
-                                       elem.className += (elem.className ? " " : "") + className;
-                       });
-               },
-
-               // internal only, use removeClass("class")
-               remove: function( elem, classNames ) {
-                       if (elem.nodeType == 1)
-                               elem.className = classNames !== undefined ?
-                                       jQuery.grep(elem.className.split(/\s+/), function(className){
-                                               return !jQuery.className.has( classNames, className );
-                                       }).join(" ") :
-                                       "";
-               },
-
-               // internal only, use hasClass("class")
-               has: function( elem, className ) {
-                       return elem && jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1;
-               }
-       },
-
-       // A method for quickly swapping in/out CSS properties to get correct calculations
-       swap: function( elem, options, callback ) {
-               var old = {};
-               // Remember the old values, and insert the new ones
-               for ( var name in options ) {
-                       old[ name ] = elem.style[ name ];
-                       elem.style[ name ] = options[ name ];
-               }
-
-               callback.call( elem );
-
-               // Revert the old values
-               for ( var name in options )
-                       elem.style[ name ] = old[ name ];
-       },
-
-       css: function( elem, name, force, extra ) {
-               if ( name == "width" || name == "height" ) {
-                       var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ];
-
-                       function getWH() {
-                               val = name == "width" ? elem.offsetWidth : elem.offsetHeight;
-
-                               if ( extra === "border" )
-                                       return;
-
-                               jQuery.each( which, function() {
-                                       if ( !extra )
-                                               val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
-                                       if ( extra === "margin" )
-                                               val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0;
-                                       else
-                                               val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
-                               });
-                       }
-
-                       if ( elem.offsetWidth !== 0 )
-                               getWH();
-                       else
-                               jQuery.swap( elem, props, getWH );
-
-                       return Math.max(0, Math.round(val));
-               }
-
-               return jQuery.curCSS( elem, name, force );
-       },
-
-       curCSS: function( elem, name, force ) {
-               var ret, style = elem.style;
-
-               // We need to handle opacity special in IE
-               if ( name == "opacity" && !jQuery.support.opacity ) {
-                       ret = jQuery.attr( style, "opacity" );
-
-                       return ret == "" ?
-                               "1" :
-                               ret;
-               }
-
-               // Make sure we're using the right name for getting the float value
-               if ( name.match( /float/i ) )
-                       name = styleFloat;
-
-               if ( !force && style && style[ name ] )
-                       ret = style[ name ];
-
-               else if ( defaultView.getComputedStyle ) {
-
-                       // Only "float" is needed here
-                       if ( name.match( /float/i ) )
-                               name = "float";
-
-                       name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase();
-
-                       var computedStyle = defaultView.getComputedStyle( elem, null );
-
-                       if ( computedStyle )
-                               ret = computedStyle.getPropertyValue( name );
-
-                       // We should always get a number back from opacity
-                       if ( name == "opacity" && ret == "" )
-                               ret = "1";
-
-               } else if ( elem.currentStyle ) {
-                       var camelCase = name.replace(/\-(\w)/g, function(all, letter){
-                               return letter.toUpperCase();
-                       });
-
-                       ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
-
-                       // From the awesome hack by Dean Edwards
-                       // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
-
-                       // If we're not dealing with a regular pixel number
-                       // but a number that has a weird ending, we need to convert it to pixels
-                       if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) {
-                               // Remember the original values
-                               var left = style.left, rsLeft = elem.runtimeStyle.left;
-
-                               // Put in the new values to get a computed value out
-                               elem.runtimeStyle.left = elem.currentStyle.left;
-                               style.left = ret || 0;
-                               ret = style.pixelLeft + "px";
-
-                               // Revert the changed values
-                               style.left = left;
-                               elem.runtimeStyle.left = rsLeft;
-                       }
-               }
-
-               return ret;
-       },
-
-       clean: function( elems, context, fragment ) {
-               context = context || document;
-
-               // !context.createElement fails in IE with an error but returns typeof 'object'
-               if ( typeof context.createElement === "undefined" )
-                       context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
-
-               // If a single string is passed in and it's a single tag
-               // just do a createElement and skip the rest
-               if ( !fragment && elems.length === 1 && typeof elems[0] === "string" ) {
-                       var match = /^<(\w+)\s*\/?>$/.exec(elems[0]);
-                       if ( match )
-                               return [ context.createElement( match[1] ) ];
-               }
-
-               var ret = [], scripts = [], div = context.createElement("div");
-
-               jQuery.each(elems, function(i, elem){
-                       if ( typeof elem === "number" )
-                               elem += '';
-
-                       if ( !elem )
-                               return;
-
-                       // Convert html string into DOM nodes
-                       if ( typeof elem === "string" ) {
-                               // Fix "XHTML"-style tags in all browsers
-                               elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){
-                                       return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
-                                               all :
-                                               front + "></" + tag + ">";
-                               });
-
-                               // Trim whitespace, otherwise indexOf won't work as expected
-                               var tags = elem.replace(/^\s+/, "").substring(0, 10).toLowerCase();
-
-                               var wrap =
-                                       // option or optgroup
-                                       !tags.indexOf("<opt") &&
-                                       [ 1, "<select multiple='multiple'>", "</select>" ] ||
-
-                                       !tags.indexOf("<leg") &&
-                                       [ 1, "<fieldset>", "</fieldset>" ] ||
-
-                                       tags.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
-                                       [ 1, "<table>", "</table>" ] ||
-
-                                       !tags.indexOf("<tr") &&
-                                       [ 2, "<table><tbody>", "</tbody></table>" ] ||
-
-                                       // <thead> matched above
-                                       (!tags.indexOf("<td") || !tags.indexOf("<th")) &&
-                                       [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ] ||
-
-                                       !tags.indexOf("<col") &&
-                                       [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ] ||
-
-                                       // IE can't serialize <link> and <script> tags normally
-                                       !jQuery.support.htmlSerialize &&
-                                       [ 1, "div<div>", "</div>" ] ||
-
-                                       [ 0, "", "" ];
-
-                               // Go to html and back, then peel off extra wrappers
-                               div.innerHTML = wrap[1] + elem + wrap[2];
-
-                               // Move to the right depth
-                               while ( wrap[0]-- )
-                                       div = div.lastChild;
-
-                               // Remove IE's autoinserted <tbody> from table fragments
-                               if ( !jQuery.support.tbody ) {
-
-                                       // String was a <table>, *may* have spurious <tbody>
-                                       var hasBody = /<tbody/i.test(elem),
-                                               tbody = !tags.indexOf("<table") && !hasBody ?
-                                                       div.firstChild && div.firstChild.childNodes :
-
-                                               // String was a bare <thead> or <tfoot>
-                                               wrap[1] == "<table>" && !hasBody ?
-                                                       div.childNodes :
-                                                       [];
-
-                                       for ( var j = tbody.length - 1; j >= 0 ; --j )
-                                               if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length )
-                                                       tbody[ j ].parentNode.removeChild( tbody[ j ] );
-
-                                       }
-
-                               // IE completely kills leading whitespace when innerHTML is used
-                               if ( !jQuery.support.leadingWhitespace && /^\s/.test( elem ) )
-                                       div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild );
-                               
-                               elem = jQuery.makeArray( div.childNodes );
-                       }
-
-                       if ( elem.nodeType )
-                               ret.push( elem );
-                       else
-                               ret = jQuery.merge( ret, elem );
-
-               });
-
-               if ( fragment ) {
-                       for ( var i = 0; ret[i]; i++ ) {
-                               if ( jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
-                                       scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
-                               } else {
-                                       if ( ret[i].nodeType === 1 )
-                                               ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
-                                       fragment.appendChild( ret[i] );
-                               }
-                       }
-                       
-                       return scripts;
-               }
-
-               return ret;
-       },
-
-       attr: function( elem, name, value ) {
-               // don't set attributes on text and comment nodes
-               if (!elem || elem.nodeType == 3 || elem.nodeType == 8)
-                       return undefined;
-
-               var notxml = !jQuery.isXMLDoc( elem ),
-                       // Whether we are setting (or getting)
-                       set = value !== undefined;
-
-               // Try to normalize/fix the name
-               name = notxml && jQuery.props[ name ] || name;
-
-               // Only do all the following if this is a node (faster for style)
-               // IE elem.getAttribute passes even for style
-               if ( elem.tagName ) {
-
-                       // These attributes require special treatment
-                       var special = /href|src|style/.test( name );
-
-                       // Safari mis-reports the default selected property of a hidden option
-                       // Accessing the parent's selectedIndex property fixes it
-                       if ( name == "selected" && elem.parentNode )
-                               elem.parentNode.selectedIndex;
-
-                       // If applicable, access the attribute via the DOM 0 way
-                       if ( name in elem && notxml && !special ) {
-                               if ( set ){
-                                       // We can't allow the type property to be changed (since it causes problems in IE)
-                                       if ( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode )
-                                               throw "type property can't be changed";
-
-                                       elem[ name ] = value;
-                               }
-
-                               // browsers index elements by id/name on forms, give priority to attributes.
-                               if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) )
-                                       return elem.getAttributeNode( name ).nodeValue;
-
-                               // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
-                               // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
-                               if ( name == "tabIndex" ) {
-                                       var attributeNode = elem.getAttributeNode( "tabIndex" );
-                                       return attributeNode && attributeNode.specified
-                                               ? attributeNode.value
-                                               : elem.nodeName.match(/(button|input|object|select|textarea)/i)
-                                                       ? 0
-                                                       : elem.nodeName.match(/^(a|area)$/i) && elem.href
-                                                               ? 0
-                                                               : undefined;
-                               }
-
-                               return elem[ name ];
-                       }
-
-                       if ( !jQuery.support.style && notxml &&  name == "style" )
-                               return jQuery.attr( elem.style, "cssText", value );
-
-                       if ( set )
-                               // convert the value to a string (all browsers do this but IE) see #1070
-                               elem.setAttribute( name, "" + value );
-
-                       var attr = !jQuery.support.hrefNormalized && notxml && special
-                                       // Some attributes require a special call on IE
-                                       ? elem.getAttribute( name, 2 )
-                                       : elem.getAttribute( name );
-
-                       // Non-existent attributes return null, we normalize to undefined
-                       return attr === null ? undefined : attr;
-               }
-
-               // elem is actually elem.style ... set the style
-
-               // IE uses filters for opacity
-               if ( !jQuery.support.opacity && name == "opacity" ) {
-                       if ( set ) {
-                               // IE has trouble with opacity if it does not have layout
-                               // Force it by setting the zoom level
-                               elem.zoom = 1;
-
-                               // Set the alpha filter to set the opacity
-                               elem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) +
-                                       (parseInt( value ) + '' == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
-                       }
-
-                       return elem.filter && elem.filter.indexOf("opacity=") >= 0 ?
-                               (parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '':
-                               "";
-               }
-
-               name = name.replace(/-([a-z])/ig, function(all, letter){
-                       return letter.toUpperCase();
-               });
-
-               if ( set )
-                       elem[ name ] = value;
-
-               return elem[ name ];
-       },
-
-       trim: function( text ) {
-               return (text || "").replace( /^\s+|\s+$/g, "" );
-       },
-
-       makeArray: function( array ) {
-               var ret = [];
-
-               if( array != null ){
-                       var i = array.length;
-                       // The window, strings (and functions) also have 'length'
-                       if( i == null || typeof array === "string" || jQuery.isFunction(array) || array.setInterval )
-                               ret[0] = array;
-                       else
-                               while( i )
-                                       ret[--i] = array[i];
-               }
-
-               return ret;
-       },
-
-       inArray: function( elem, array ) {
-               for ( var i = 0, length = array.length; i < length; i++ )
-               // Use === because on IE, window == document
-                       if ( array[ i ] === elem )
-                               return i;
-
-               return -1;
-       },
-
-       merge: function( first, second ) {
-               // We have to loop this way because IE & Opera overwrite the length
-               // expando of getElementsByTagName
-               var i = 0, elem, pos = first.length;
-               // Also, we need to make sure that the correct elements are being returned
-               // (IE returns comment nodes in a '*' query)
-               if ( !jQuery.support.getAll ) {
-                       while ( (elem = second[ i++ ]) != null )
-                               if ( elem.nodeType != 8 )
-                                       first[ pos++ ] = elem;
-
-               } else
-                       while ( (elem = second[ i++ ]) != null )
-                               first[ pos++ ] = elem;
-
-               return first;
-       },
-
-       unique: function( array ) {
-               var ret = [], done = {};
-
-               try {
-
-                       for ( var i = 0, length = array.length; i < length; i++ ) {
-                               var id = jQuery.data( array[ i ] );
-
-                               if ( !done[ id ] ) {
-                                       done[ id ] = true;
-                                       ret.push( array[ i ] );
-                               }
-                       }
-
-               } catch( e ) {
-                       ret = array;
-               }
-
-               return ret;
-       },
-
-       grep: function( elems, callback, inv ) {
-               var ret = [];
-
-               // Go through the array, only saving the items
-               // that pass the validator function
-               for ( var i = 0, length = elems.length; i < length; i++ )
-                       if ( !inv != !callback( elems[ i ], i ) )
-                               ret.push( elems[ i ] );
-
-               return ret;
-       },
-
-       map: function( elems, callback ) {
-               var ret = [];
-
-               // Go through the array, translating each of the items to their
-               // new value (or values).
-               for ( var i = 0, length = elems.length; i < length; i++ ) {
-                       var value = callback( elems[ i ], i );
-
-                       if ( value != null )
-                               ret[ ret.length ] = value;
-               }
-
-               return ret.concat.apply( [], ret );
-       }
-});
-
-// Use of jQuery.browser is deprecated.
-// It's included for backwards compatibility and plugins,
-// although they should work to migrate away.
-
-var userAgent = navigator.userAgent.toLowerCase();
-
-// Figure out what browser is being used
-jQuery.browser = {
-       version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
-       safari: /webkit/.test( userAgent ),
-       opera: /opera/.test( userAgent ),
-       msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
-       mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
-};
-
-jQuery.each({
-       parent: function(elem){return elem.parentNode;},
-       parents: function(elem){return jQuery.dir(elem,"parentNode");},
-       next: function(elem){return jQuery.nth(elem,2,"nextSibling");},
-       prev: function(elem){return jQuery.nth(elem,2,"previousSibling");},
-       nextAll: function(elem){return jQuery.dir(elem,"nextSibling");},
-       prevAll: function(elem){return jQuery.dir(elem,"previousSibling");},
-       siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},
-       children: function(elem){return jQuery.sibling(elem.firstChild);},
-       contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}
-}, function(name, fn){
-       jQuery.fn[ name ] = function( selector ) {
-               var ret = jQuery.map( this, fn );
-
-               if ( selector && typeof selector == "string" )
-                       ret = jQuery.multiFilter( selector, ret );
-
-               return this.pushStack( jQuery.unique( ret ), name, selector );
-       };
-});
-
-jQuery.each({
-       appendTo: "append",
-       prependTo: "prepend",
-       insertBefore: "before",
-       insertAfter: "after",
-       replaceAll: "replaceWith"
-}, function(name, original){
-       jQuery.fn[ name ] = function( selector ) {
-               var ret = [], insert = jQuery( selector );
-
-               for ( var i = 0, l = insert.length; i < l; i++ ) {
-                       var elems = (i > 0 ? this.clone(true) : this).get();
-                       jQuery.fn[ original ].apply( jQuery(insert[i]), elems );
-                       ret = ret.concat( elems );
-               }
-
-               return this.pushStack( ret, name, selector );
-       };
-});
-
-jQuery.each({
-       removeAttr: function( name ) {
-               jQuery.attr( this, name, "" );
-               if (this.nodeType == 1)
-                       this.removeAttribute( name );
-       },
-
-       addClass: function( classNames ) {
-               jQuery.className.add( this, classNames );
-       },
-
-       removeClass: function( classNames ) {
-               jQuery.className.remove( this, classNames );
-       },
-
-       toggleClass: function( classNames, state ) {
-               if( typeof state !== "boolean" )
-                       state = !jQuery.className.has( this, classNames );
-               jQuery.className[ state ? "add" : "remove" ]( this, classNames );
-       },
-
-       remove: function( selector ) {
-               if ( !selector || jQuery.filter( selector, [ this ] ).length ) {
-                       // Prevent memory leaks
-                       jQuery( "*", this ).add([this]).each(function(){
-                               jQuery.event.remove(this);
-                               jQuery.removeData(this);
-                       });
-                       if (this.parentNode)
-                               this.parentNode.removeChild( this );
-               }
-       },
-
-       empty: function() {
-               // Remove element nodes and prevent memory leaks
-               jQuery(this).children().remove();
-
-               // Remove any remaining nodes
-               while ( this.firstChild )
-                       this.removeChild( this.firstChild );
-       }
-}, function(name, fn){
-       jQuery.fn[ name ] = function(){
-               return this.each( fn, arguments );
-       };
-});
-
-// Helper function used by the dimensions and offset modules
-function num(elem, prop) {
-       return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
-}
-var expando = "jQuery" + now(), uuid = 0, windowData = {};\r
-\r
-jQuery.extend({\r
-       cache: {},\r
-\r
-       data: function( elem, name, data ) {\r
-               elem = elem == window ?\r
-                       windowData :\r
-                       elem;\r
-\r
-               var id = elem[ expando ];\r
-\r
-               // Compute a unique ID for the element\r
-               if ( !id )\r
-                       id = elem[ expando ] = ++uuid;\r
-\r
-               // Only generate the data cache if we're\r
-               // trying to access or manipulate it\r
-               if ( name && !jQuery.cache[ id ] )\r
-                       jQuery.cache[ id ] = {};\r
-\r
-               // Prevent overriding the named cache with undefined values\r
-               if ( data !== undefined )\r
-                       jQuery.cache[ id ][ name ] = data;\r
-\r
-               // Return the named cache data, or the ID for the element\r
-               return name ?\r
-                       jQuery.cache[ id ][ name ] :\r
-                       id;\r
-       },\r
-\r
-       removeData: function( elem, name ) {\r
-               elem = elem == window ?\r
-                       windowData :\r
-                       elem;\r
-\r
-               var id = elem[ expando ];\r
-\r
-               // If we want to remove a specific section of the element's data\r
-               if ( name ) {\r
-                       if ( jQuery.cache[ id ] ) {\r
-                               // Remove the section of cache data\r
-                               delete jQuery.cache[ id ][ name ];\r
-\r
-                               // If we've removed all the data, remove the element's cache\r
-                               name = "";\r
-\r
-                               for ( name in jQuery.cache[ id ] )\r
-                                       break;\r
-\r
-                               if ( !name )\r
-                                       jQuery.removeData( elem );\r
-                       }\r
-\r
-               // Otherwise, we want to remove all of the element's data\r
-               } else {\r
-                       // Clean up the element expando\r
-                       try {\r
-                               delete elem[ expando ];\r
-                       } catch(e){\r
-                               // IE has trouble directly removing the expando\r
-                               // but it's ok with using removeAttribute\r
-                               if ( elem.removeAttribute )\r
-                                       elem.removeAttribute( expando );\r
-                       }\r
-\r
-                       // Completely remove the data cache\r
-                       delete jQuery.cache[ id ];\r
-               }\r
-       },\r
-       queue: function( elem, type, data ) {\r
-               if ( elem ){\r
-       \r
-                       type = (type || "fx") + "queue";\r
-       \r
-                       var q = jQuery.data( elem, type );\r
-       \r
-                       if ( !q || jQuery.isArray(data) )\r
-                               q = jQuery.data( elem, type, jQuery.makeArray(data) );\r
-                       else if( data )\r
-                               q.push( data );\r
-       \r
-               }\r
-               return q;\r
-       },\r
-\r
-       dequeue: function( elem, type ){\r
-               var queue = jQuery.queue( elem, type ),\r
-                       fn = queue.shift();\r
-               \r
-               if( !type || type === "fx" )\r
-                       fn = queue[0];\r
-                       \r
-               if( fn !== undefined )\r
-                       fn.call(elem);\r
-       }\r
-});\r
-\r
-jQuery.fn.extend({\r
-       data: function( key, value ){\r
-               var parts = key.split(".");\r
-               parts[1] = parts[1] ? "." + parts[1] : "";\r
-\r
-               if ( value === undefined ) {\r
-                       var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);\r
-\r
-                       if ( data === undefined && this.length )\r
-                               data = jQuery.data( this[0], key );\r
-\r
-                       return data === undefined && parts[1] ?\r
-                               this.data( parts[0] ) :\r
-                               data;\r
-               } else\r
-                       return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){\r
-                               jQuery.data( this, key, value );\r
-                       });\r
-       },\r
-\r
-       removeData: function( key ){\r
-               return this.each(function(){\r
-                       jQuery.removeData( this, key );\r
-               });\r
-       },\r
-       queue: function(type, data){\r
-               if ( typeof type !== "string" ) {\r
-                       data = type;\r
-                       type = "fx";\r
-               }\r
-\r
-               if ( data === undefined )\r
-                       return jQuery.queue( this[0], type );\r
-\r
-               return this.each(function(){\r
-                       var queue = jQuery.queue( this, type, data );\r
-                       \r
-                        if( type == "fx" && queue.length == 1 )\r
-                               queue[0].call(this);\r
-               });\r
-       },\r
-       dequeue: function(type){\r
-               return this.each(function(){\r
-                       jQuery.dequeue( this, type );\r
-               });\r
-       }\r
-});/*!
- * Sizzle CSS Selector Engine - v0.9.3
- *  Copyright 2009, The Dojo Foundation
- *  Released under the MIT, BSD, and GPL Licenses.
- *  More information: http://sizzlejs.com/
- */
-(function(){
-
-var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,
-       done = 0,
-       toString = Object.prototype.toString;
-
-var Sizzle = function(selector, context, results, seed) {
-       results = results || [];
-       context = context || document;
-
-       if ( context.nodeType !== 1 && context.nodeType !== 9 )
-               return [];
-       
-       if ( !selector || typeof selector !== "string" ) {
-               return results;
-       }
-
-       var parts = [], m, set, checkSet, check, mode, extra, prune = true;
-       
-       // Reset the position of the chunker regexp (start from head)
-       chunker.lastIndex = 0;
-       
-       while ( (m = chunker.exec(selector)) !== null ) {
-               parts.push( m[1] );
-               
-               if ( m[2] ) {
-                       extra = RegExp.rightContext;
-                       break;
-               }
-       }
-
-       if ( parts.length > 1 && origPOS.exec( selector ) ) {
-               if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
-                       set = posProcess( parts[0] + parts[1], context );
-               } else {
-                       set = Expr.relative[ parts[0] ] ?
-                               [ context ] :
-                               Sizzle( parts.shift(), context );
-
-                       while ( parts.length ) {
-                               selector = parts.shift();
-
-                               if ( Expr.relative[ selector ] )
-                                       selector += parts.shift();
-
-                               set = posProcess( selector, set );
-                       }
-               }
-       } else {
-               var ret = seed ?
-                       { expr: parts.pop(), set: makeArray(seed) } :
-                       Sizzle.find( parts.pop(), parts.length === 1 && context.parentNode ? context.parentNode : context, isXML(context) );
-               set = Sizzle.filter( ret.expr, ret.set );
-
-               if ( parts.length > 0 ) {
-                       checkSet = makeArray(set);
-               } else {
-                       prune = false;
-               }
-
-               while ( parts.length ) {
-                       var cur = parts.pop(), pop = cur;
-
-                       if ( !Expr.relative[ cur ] ) {
-                               cur = "";
-                       } else {
-                               pop = parts.pop();
-                       }
-
-                       if ( pop == null ) {
-                               pop = context;
-                       }
-
-                       Expr.relative[ cur ]( checkSet, pop, isXML(context) );
-               }
-       }
-
-       if ( !checkSet ) {
-               checkSet = set;
-       }
-
-       if ( !checkSet ) {
-               throw "Syntax error, unrecognized expression: " + (cur || selector);
-       }
-
-       if ( toString.call(checkSet) === "[object Array]" ) {
-               if ( !prune ) {
-                       results.push.apply( results, checkSet );
-               } else if ( context.nodeType === 1 ) {
-                       for ( var i = 0; checkSet[i] != null; i++ ) {
-                               if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
-                                       results.push( set[i] );
-                               }
-                       }
-               } else {
-                       for ( var i = 0; checkSet[i] != null; i++ ) {
-                               if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
-                                       results.push( set[i] );
-                               }
-                       }
-               }
-       } else {
-               makeArray( checkSet, results );
-       }
-
-       if ( extra ) {
-               Sizzle( extra, context, results, seed );
-
-               if ( sortOrder ) {
-                       hasDuplicate = false;
-                       results.sort(sortOrder);
-
-                       if ( hasDuplicate ) {
-                               for ( var i = 1; i < results.length; i++ ) {
-                                       if ( results[i] === results[i-1] ) {
-                                               results.splice(i--, 1);
-                                       }
-                               }
-                       }
-               }
-       }
-
-       return results;
-};
-
-Sizzle.matches = function(expr, set){
-       return Sizzle(expr, null, null, set);
-};
-
-Sizzle.find = function(expr, context, isXML){
-       var set, match;
-
-       if ( !expr ) {
-               return [];
-       }
-
-       for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
-               var type = Expr.order[i], match;
-               
-               if ( (match = Expr.match[ type ].exec( expr )) ) {
-                       var left = RegExp.leftContext;
-
-                       if ( left.substr( left.length - 1 ) !== "\\" ) {
-                               match[1] = (match[1] || "").replace(/\\/g, "");
-                               set = Expr.find[ type ]( match, context, isXML );
-                               if ( set != null ) {
-                                       expr = expr.replace( Expr.match[ type ], "" );
-                                       break;
-                               }
-                       }
-               }
-       }
-
-       if ( !set ) {
-               set = context.getElementsByTagName("*");
-       }
-
-       return {set: set, expr: expr};
-};
-
-Sizzle.filter = function(expr, set, inplace, not){
-       var old = expr, result = [], curLoop = set, match, anyFound,
-               isXMLFilter = set && set[0] && isXML(set[0]);
-
-       while ( expr && set.length ) {
-               for ( var type in Expr.filter ) {
-                       if ( (match = Expr.match[ type ].exec( expr )) != null ) {
-                               var filter = Expr.filter[ type ], found, item;
-                               anyFound = false;
-
-                               if ( curLoop == result ) {
-                                       result = [];
-                               }
-
-                               if ( Expr.preFilter[ type ] ) {
-                                       match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
-
-                                       if ( !match ) {
-                                               anyFound = found = true;
-                                       } else if ( match === true ) {
-                                               continue;
-                                       }
-                               }
-
-                               if ( match ) {
-                                       for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
-                                               if ( item ) {
-                                                       found = filter( item, match, i, curLoop );
-                                                       var pass = not ^ !!found;
-
-                                                       if ( inplace && found != null ) {
-                                                               if ( pass ) {
-                                                                       anyFound = true;
-                                                               } else {
-                                                                       curLoop[i] = false;
-                                                               }
-                                                       } else if ( pass ) {
-                                                               result.push( item );
-                                                               anyFound = true;
-                                                       }
-                                               }
-                                       }
-                               }
-
-                               if ( found !== undefined ) {
-                                       if ( !inplace ) {
-                                               curLoop = result;
-                                       }
-
-                                       expr = expr.replace( Expr.match[ type ], "" );
-
-                                       if ( !anyFound ) {
-                                               return [];
-                                       }
-
-                                       break;
-                               }
-                       }
-               }
-
-               // Improper expression
-               if ( expr == old ) {
-                       if ( anyFound == null ) {
-                               throw "Syntax error, unrecognized expression: " + expr;
-                       } else {
-                               break;
-                       }
-               }
-
-               old = expr;
-       }
-
-       return curLoop;
-};
-
-var Expr = Sizzle.selectors = {
-       order: [ "ID", "NAME", "TAG" ],
-       match: {
-               ID: /#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
-               CLASS: /\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
-               NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,
-               ATTR: /\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
-               TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,
-               CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
-               POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
-               PSEUDO: /:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/
-       },
-       attrMap: {
-               "class": "className",
-               "for": "htmlFor"
-       },
-       attrHandle: {
-               href: function(elem){
-                       return elem.getAttribute("href");
-               }
-       },
-       relative: {
-               "+": function(checkSet, part, isXML){
-                       var isPartStr = typeof part === "string",
-                               isTag = isPartStr && !/\W/.test(part),
-                               isPartStrNotTag = isPartStr && !isTag;
-
-                       if ( isTag && !isXML ) {
-                               part = part.toUpperCase();
-                       }
-
-                       for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
-                               if ( (elem = checkSet[i]) ) {
-                                       while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
-
-                                       checkSet[i] = isPartStrNotTag || elem && elem.nodeName === part ?
-                                               elem || false :
-                                               elem === part;
-                               }
-                       }
-
-                       if ( isPartStrNotTag ) {
-                               Sizzle.filter( part, checkSet, true );
-                       }
-               },
-               ">": function(checkSet, part, isXML){
-                       var isPartStr = typeof part === "string";
-
-                       if ( isPartStr && !/\W/.test(part) ) {
-                               part = isXML ? part : part.toUpperCase();
-
-                               for ( var i = 0, l = checkSet.length; i < l; i++ ) {
-                                       var elem = checkSet[i];
-                                       if ( elem ) {
-                                               var parent = elem.parentNode;
-                                               checkSet[i] = parent.nodeName === part ? parent : false;
-                                       }
-                               }
-                       } else {
-                               for ( var i = 0, l = checkSet.length; i < l; i++ ) {
-                                       var elem = checkSet[i];
-                                       if ( elem ) {
-                                               checkSet[i] = isPartStr ?
-                                                       elem.parentNode :
-                                                       elem.parentNode === part;
-                                       }
-                               }
-
-                               if ( isPartStr ) {
-                                       Sizzle.filter( part, checkSet, true );
-                               }
-                       }
-               },
-               "": function(checkSet, part, isXML){
-                       var doneName = done++, checkFn = dirCheck;
-
-                       if ( !part.match(/\W/) ) {
-                               var nodeCheck = part = isXML ? part : part.toUpperCase();
-                               checkFn = dirNodeCheck;
-                       }
-
-                       checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
-               },
-               "~": function(checkSet, part, isXML){
-                       var doneName = done++, checkFn = dirCheck;
-
-                       if ( typeof part === "string" && !part.match(/\W/) ) {
-                               var nodeCheck = part = isXML ? part : part.toUpperCase();
-                               checkFn = dirNodeCheck;
-                       }
-
-                       checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
-               }
-       },
-       find: {
-               ID: function(match, context, isXML){
-                       if ( typeof context.getElementById !== "undefined" && !isXML ) {
-                               var m = context.getElementById(match[1]);
-                               return m ? [m] : [];
-                       }
-               },
-               NAME: function(match, context, isXML){
-                       if ( typeof context.getElementsByName !== "undefined" ) {
-                               var ret = [], results = context.getElementsByName(match[1]);
-
-                               for ( var i = 0, l = results.length; i < l; i++ ) {
-                                       if ( results[i].getAttribute("name") === match[1] ) {
-                                               ret.push( results[i] );
-                                       }
-                               }
-
-                               return ret.length === 0 ? null : ret;
-                       }
-               },
-               TAG: function(match, context){
-                       return context.getElementsByTagName(match[1]);
-               }
-       },
-       preFilter: {
-               CLASS: function(match, curLoop, inplace, result, not, isXML){
-                       match = " " + match[1].replace(/\\/g, "") + " ";
-
-                       if ( isXML ) {
-                               return match;
-                       }
-
-                       for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
-                               if ( elem ) {
-                                       if ( not ^ (elem.className && (" " + elem.className + " ").indexOf(match) >= 0) ) {
-                                               if ( !inplace )
-                                                       result.push( elem );
-                                       } else if ( inplace ) {
-                                               curLoop[i] = false;
-                                       }
-                               }
-                       }
-
-                       return false;
-               },
-               ID: function(match){
-                       return match[1].replace(/\\/g, "");
-               },
-               TAG: function(match, curLoop){
-                       for ( var i = 0; curLoop[i] === false; i++ ){}
-                       return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase();
-               },
-               CHILD: function(match){
-                       if ( match[1] == "nth" ) {
-                               // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
-                               var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
-                                       match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" ||
-                                       !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
-
-                               // calculate the numbers (first)n+(last) including if they are negative
-                               match[2] = (test[1] + (test[2] || 1)) - 0;
-                               match[3] = test[3] - 0;
-                       }
-
-                       // TODO: Move to normal caching system
-                       match[0] = done++;
-
-                       return match;
-               },
-               ATTR: function(match, curLoop, inplace, result, not, isXML){
-                       var name = match[1].replace(/\\/g, "");
-                       
-                       if ( !isXML && Expr.attrMap[name] ) {
-                               match[1] = Expr.attrMap[name];
-                       }
-
-                       if ( match[2] === "~=" ) {
-                               match[4] = " " + match[4] + " ";
-                       }
-
-                       return match;
-               },
-               PSEUDO: function(match, curLoop, inplace, result, not){
-                       if ( match[1] === "not" ) {
-                               // If we're dealing with a complex expression, or a simple one
-                               if ( match[3].match(chunker).length > 1 || /^\w/.test(match[3]) ) {
-                                       match[3] = Sizzle(match[3], null, null, curLoop);
-                               } else {
-                                       var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
-                                       if ( !inplace ) {
-                                               result.push.apply( result, ret );
-                                       }
-                                       return false;
-                               }
-                       } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
-                               return true;
-                       }
-                       
-                       return match;
-               },
-               POS: function(match){
-                       match.unshift( true );
-                       return match;
-               }
-       },
-       filters: {
-               enabled: function(elem){
-                       return elem.disabled === false && elem.type !== "hidden";
-               },
-               disabled: function(elem){
-                       return elem.disabled === true;
-               },
-               checked: function(elem){
-                       return elem.checked === true;
-               },
-               selected: function(elem){
-                       // Accessing this property makes selected-by-default
-                       // options in Safari work properly
-                       elem.parentNode.selectedIndex;
-                       return elem.selected === true;
-               },
-               parent: function(elem){
-                       return !!elem.firstChild;
-               },
-               empty: function(elem){
-                       return !elem.firstChild;
-               },
-               has: function(elem, i, match){
-                       return !!Sizzle( match[3], elem ).length;
-               },
-               header: function(elem){
-                       return /h\d/i.test( elem.nodeName );
-               },
-               text: function(elem){
-                       return "text" === elem.type;
-               },
-               radio: function(elem){
-                       return "radio" === elem.type;
-               },
-               checkbox: function(elem){
-                       return "checkbox" === elem.type;
-               },
-               file: function(elem){
-                       return "file" === elem.type;
-               },
-               password: function(elem){
-                       return "password" === elem.type;
-               },
-               submit: function(elem){
-                       return "submit" === elem.type;
-               },
-               image: function(elem){
-                       return "image" === elem.type;
-               },
-               reset: function(elem){
-                       return "reset" === elem.type;
-               },
-               button: function(elem){
-                       return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON";
-               },
-               input: function(elem){
-                       return /input|select|textarea|button/i.test(elem.nodeName);
-               }
-       },
-       setFilters: {
-               first: function(elem, i){
-                       return i === 0;
-               },
-               last: function(elem, i, match, array){
-                       return i === array.length - 1;
-               },
-               even: function(elem, i){
-                       return i % 2 === 0;
-               },
-               odd: function(elem, i){
-                       return i % 2 === 1;
-               },
-               lt: function(elem, i, match){
-                       return i < match[3] - 0;
-               },
-               gt: function(elem, i, match){
-                       return i > match[3] - 0;
-               },
-               nth: function(elem, i, match){
-                       return match[3] - 0 == i;
-               },
-               eq: function(elem, i, match){
-                       return match[3] - 0 == i;
-               }
-       },
-       filter: {
-               PSEUDO: function(elem, match, i, array){
-                       var name = match[1], filter = Expr.filters[ name ];
-
-                       if ( filter ) {
-                               return filter( elem, i, match, array );
-                       } else if ( name === "contains" ) {
-                               return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0;
-                       } else if ( name === "not" ) {
-                               var not = match[3];
-
-                               for ( var i = 0, l = not.length; i < l; i++ ) {
-                                       if ( not[i] === elem ) {
-                                               return false;
-                                       }
-                               }
-
-                               return true;
-                       }
-               },
-               CHILD: function(elem, match){
-                       var type = match[1], node = elem;
-                       switch (type) {
-                               case 'only':
-                               case 'first':
-                                       while (node = node.previousSibling)  {
-                                               if ( node.nodeType === 1 ) return false;
-                                       }
-                                       if ( type == 'first') return true;
-                                       node = elem;
-                               case 'last':
-                                       while (node = node.nextSibling)  {
-                                               if ( node.nodeType === 1 ) return false;
-                                       }
-                                       return true;
-                               case 'nth':
-                                       var first = match[2], last = match[3];
-
-                                       if ( first == 1 && last == 0 ) {
-                                               return true;
-                                       }
-                                       
-                                       var doneName = match[0],
-                                               parent = elem.parentNode;
-       
-                                       if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
-                                               var count = 0;
-                                               for ( node = parent.firstChild; node; node = node.nextSibling ) {
-                                                       if ( node.nodeType === 1 ) {
-                                                               node.nodeIndex = ++count;
-                                                       }
-                                               } 
-                                               parent.sizcache = doneName;
-                                       }
-                                       
-                                       var diff = elem.nodeIndex - last;
-                                       if ( first == 0 ) {
-                                               return diff == 0;
-                                       } else {
-                                               return ( diff % first == 0 && diff / first >= 0 );
-                                       }
-                       }
-               },
-               ID: function(elem, match){
-                       return elem.nodeType === 1 && elem.getAttribute("id") === match;
-               },
-               TAG: function(elem, match){
-                       return (match === "*" && elem.nodeType === 1) || elem.nodeName === match;
-               },
-               CLASS: function(elem, match){
-                       return (" " + (elem.className || elem.getAttribute("class")) + " ")
-                               .indexOf( match ) > -1;
-               },
-               ATTR: function(elem, match){
-                       var name = match[1],
-                               result = Expr.attrHandle[ name ] ?
-                                       Expr.attrHandle[ name ]( elem ) :
-                                       elem[ name ] != null ?
-                                               elem[ name ] :
-                                               elem.getAttribute( name ),
-                               value = result + "",
-                               type = match[2],
-                               check = match[4];
-
-                       return result == null ?
-                               type === "!=" :
-                               type === "=" ?
-                               value === check :
-                               type === "*=" ?
-                               value.indexOf(check) >= 0 :
-                               type === "~=" ?
-                               (" " + value + " ").indexOf(check) >= 0 :
-                               !check ?
-                               value && result !== false :
-                               type === "!=" ?
-                               value != check :
-                               type === "^=" ?
-                               value.indexOf(check) === 0 :
-                               type === "$=" ?
-                               value.substr(value.length - check.length) === check :
-                               type === "|=" ?
-                               value === check || value.substr(0, check.length + 1) === check + "-" :
-                               false;
-               },
-               POS: function(elem, match, i, array){
-                       var name = match[2], filter = Expr.setFilters[ name ];
-
-                       if ( filter ) {
-                               return filter( elem, i, match, array );
-                       }
-               }
-       }
-};
-
-var origPOS = Expr.match.POS;
-
-for ( var type in Expr.match ) {
-       Expr.match[ type ] = RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
-}
-
-var makeArray = function(array, results) {
-       array = Array.prototype.slice.call( array );
-
-       if ( results ) {
-               results.push.apply( results, array );
-               return results;
-       }
-       
-       return array;
-};
-
-// Perform a simple check to determine if the browser is capable of
-// converting a NodeList to an array using builtin methods.
-try {
-       Array.prototype.slice.call( document.documentElement.childNodes );
-
-// Provide a fallback method if it does not work
-} catch(e){
-       makeArray = function(array, results) {
-               var ret = results || [];
-
-               if ( toString.call(array) === "[object Array]" ) {
-                       Array.prototype.push.apply( ret, array );
-               } else {
-                       if ( typeof array.length === "number" ) {
-                               for ( var i = 0, l = array.length; i < l; i++ ) {
-                                       ret.push( array[i] );
-                               }
-                       } else {
-                               for ( var i = 0; array[i]; i++ ) {
-                                       ret.push( array[i] );
-                               }
-                       }
-               }
-
-               return ret;
-       };
-}
-
-var sortOrder;
-
-if ( document.documentElement.compareDocumentPosition ) {
-       sortOrder = function( a, b ) {
-               var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
-               if ( ret === 0 ) {
-                       hasDuplicate = true;
-               }
-               return ret;
-       };
-} else if ( "sourceIndex" in document.documentElement ) {
-       sortOrder = function( a, b ) {
-               var ret = a.sourceIndex - b.sourceIndex;
-               if ( ret === 0 ) {
-                       hasDuplicate = true;
-               }
-               return ret;
-       };
-} else if ( document.createRange ) {
-       sortOrder = function( a, b ) {
-               var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
-               aRange.selectNode(a);
-               aRange.collapse(true);
-               bRange.selectNode(b);
-               bRange.collapse(true);
-               var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
-               if ( ret === 0 ) {
-                       hasDuplicate = true;
-               }
-               return ret;
-       };
-}
-
-// Check to see if the browser returns elements by name when
-// querying by getElementById (and provide a workaround)
-(function(){
-       // We're going to inject a fake input element with a specified name
-       var form = document.createElement("form"),
-               id = "script" + (new Date).getTime();
-       form.innerHTML = "<input name='" + id + "'/>";
-
-       // Inject it into the root element, check its status, and remove it quickly
-       var root = document.documentElement;
-       root.insertBefore( form, root.firstChild );
-
-       // The workaround has to do additional checks after a getElementById
-       // Which slows things down for other browsers (hence the branching)
-       if ( !!document.getElementById( id ) ) {
-               Expr.find.ID = function(match, context, isXML){
-                       if ( typeof context.getElementById !== "undefined" && !isXML ) {
-                               var m = context.getElementById(match[1]);
-                               return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
-                       }
-               };
-
-               Expr.filter.ID = function(elem, match){
-                       var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
-                       return elem.nodeType === 1 && node && node.nodeValue === match;
-               };
-       }
-
-       root.removeChild( form );
-})();
-
-(function(){
-       // Check to see if the browser returns only elements
-       // when doing getElementsByTagName("*")
-
-       // Create a fake element
-       var div = document.createElement("div");
-       div.appendChild( document.createComment("") );
-
-       // Make sure no comments are found
-       if ( div.getElementsByTagName("*").length > 0 ) {
-               Expr.find.TAG = function(match, context){
-                       var results = context.getElementsByTagName(match[1]);
-
-                       // Filter out possible comments
-                       if ( match[1] === "*" ) {
-                               var tmp = [];
-
-                               for ( var i = 0; results[i]; i++ ) {
-                                       if ( results[i].nodeType === 1 ) {
-                                               tmp.push( results[i] );
-                                       }
-                               }
-
-                               results = tmp;
-                       }
-
-                       return results;
-               };
-       }
-
-       // Check to see if an attribute returns normalized href attributes
-       div.innerHTML = "<a href='#'></a>";
-       if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
-                       div.firstChild.getAttribute("href") !== "#" ) {
-               Expr.attrHandle.href = function(elem){
-                       return elem.getAttribute("href", 2);
-               };
-       }
-})();
-
-if ( document.querySelectorAll ) (function(){
-       var oldSizzle = Sizzle, div = document.createElement("div");
-       div.innerHTML = "<p class='TEST'></p>";
-
-       // Safari can't handle uppercase or unicode characters when
-       // in quirks mode.
-       if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
-               return;
-       }
-       
-       Sizzle = function(query, context, extra, seed){
-               context = context || document;
-
-               // Only use querySelectorAll on non-XML documents
-               // (ID selectors don't work in non-HTML documents)
-               if ( !seed && context.nodeType === 9 && !isXML(context) ) {
-                       try {
-                               return makeArray( context.querySelectorAll(query), extra );
-                       } catch(e){}
-               }
-               
-               return oldSizzle(query, context, extra, seed);
-       };
-
-       Sizzle.find = oldSizzle.find;
-       Sizzle.filter = oldSizzle.filter;
-       Sizzle.selectors = oldSizzle.selectors;
-       Sizzle.matches = oldSizzle.matches;
-})();
-
-if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){
-       var div = document.createElement("div");
-       div.innerHTML = "<div class='test e'></div><div class='test'></div>";
-
-       // Opera can't find a second classname (in 9.6)
-       if ( div.getElementsByClassName("e").length === 0 )
-               return;
-
-       // Safari caches class attributes, doesn't catch changes (in 3.2)
-       div.lastChild.className = "e";
-
-       if ( div.getElementsByClassName("e").length === 1 )
-               return;
-
-       Expr.order.splice(1, 0, "CLASS");
-       Expr.find.CLASS = function(match, context, isXML) {
-               if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
-                       return context.getElementsByClassName(match[1]);
-               }
-       };
-})();
-
-function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
-       var sibDir = dir == "previousSibling" && !isXML;
-       for ( var i = 0, l = checkSet.length; i < l; i++ ) {
-               var elem = checkSet[i];
-               if ( elem ) {
-                       if ( sibDir && elem.nodeType === 1 ){
-                               elem.sizcache = doneName;
-                               elem.sizset = i;
-                       }
-                       elem = elem[dir];
-                       var match = false;
-
-                       while ( elem ) {
-                               if ( elem.sizcache === doneName ) {
-                                       match = checkSet[elem.sizset];
-                                       break;
-                               }
-
-                               if ( elem.nodeType === 1 && !isXML ){
-                                       elem.sizcache = doneName;
-                                       elem.sizset = i;
-                               }
-
-                               if ( elem.nodeName === cur ) {
-                                       match = elem;
-                                       break;
-                               }
-
-                               elem = elem[dir];
-                       }
-
-                       checkSet[i] = match;
-               }
-       }
-}
-
-function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
-       var sibDir = dir == "previousSibling" && !isXML;
-       for ( var i = 0, l = checkSet.length; i < l; i++ ) {
-               var elem = checkSet[i];
-               if ( elem ) {
-                       if ( sibDir && elem.nodeType === 1 ) {
-                               elem.sizcache = doneName;
-                               elem.sizset = i;
-                       }
-                       elem = elem[dir];
-                       var match = false;
-
-                       while ( elem ) {
-                               if ( elem.sizcache === doneName ) {
-                                       match = checkSet[elem.sizset];
-                                       break;
-                               }
-
-                               if ( elem.nodeType === 1 ) {
-                                       if ( !isXML ) {
-                                               elem.sizcache = doneName;
-                                               elem.sizset = i;
-                                       }
-                                       if ( typeof cur !== "string" ) {
-                                               if ( elem === cur ) {
-                                                       match = true;
-                                                       break;
-                                               }
-
-                                       } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
-                                               match = elem;
-                                               break;
-                                       }
-                               }
-
-                               elem = elem[dir];
-                       }
-
-                       checkSet[i] = match;
-               }
-       }
-}
-
-var contains = document.compareDocumentPosition ?  function(a, b){
-       return a.compareDocumentPosition(b) & 16;
-} : function(a, b){
-       return a !== b && (a.contains ? a.contains(b) : true);
-};
-
-var isXML = function(elem){
-       return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
-               !!elem.ownerDocument && isXML( elem.ownerDocument );
-};
-
-var posProcess = function(selector, context){
-       var tmpSet = [], later = "", match,
-               root = context.nodeType ? [context] : context;
-
-       // Position selectors must be done after the filter
-       // And so must :not(positional) so we move all PSEUDOs to the end
-       while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
-               later += match[0];
-               selector = selector.replace( Expr.match.PSEUDO, "" );
-       }
-
-       selector = Expr.relative[selector] ? selector + "*" : selector;
-
-       for ( var i = 0, l = root.length; i < l; i++ ) {
-               Sizzle( selector, root[i], tmpSet );
-       }
-
-       return Sizzle.filter( later, tmpSet );
-};
-
-// EXPOSE
-jQuery.find = Sizzle;
-jQuery.filter = Sizzle.filter;
-jQuery.expr = Sizzle.selectors;
-jQuery.expr[":"] = jQuery.expr.filters;
-
-Sizzle.selectors.filters.hidden = function(elem){
-       return elem.offsetWidth === 0 || elem.offsetHeight === 0;
-};
-
-Sizzle.selectors.filters.visible = function(elem){
-       return elem.offsetWidth > 0 || elem.offsetHeight > 0;
-};
-
-Sizzle.selectors.filters.animated = function(elem){
-       return jQuery.grep(jQuery.timers, function(fn){
-               return elem === fn.elem;
-       }).length;
-};
-
-jQuery.multiFilter = function( expr, elems, not ) {
-       if ( not ) {
-               expr = ":not(" + expr + ")";
-       }
-
-       return Sizzle.matches(expr, elems);
-};
-
-jQuery.dir = function( elem, dir ){
-       var matched = [], cur = elem[dir];
-       while ( cur && cur != document ) {
-               if ( cur.nodeType == 1 )
-                       matched.push( cur );
-               cur = cur[dir];
-       }
-       return matched;
-};
-
-jQuery.nth = function(cur, result, dir, elem){
-       result = result || 1;
-       var num = 0;
-
-       for ( ; cur; cur = cur[dir] )
-               if ( cur.nodeType == 1 && ++num == result )
-                       break;
-
-       return cur;
-};
-
-jQuery.sibling = function(n, elem){
-       var r = [];
-
-       for ( ; n; n = n.nextSibling ) {
-               if ( n.nodeType == 1 && n != elem )
-                       r.push( n );
-       }
-
-       return r;
-};
-
-return;
-
-window.Sizzle = Sizzle;
-
-})();
-/*
- * A number of helper functions used for managing events.
- * Many of the ideas behind this code originated from
- * Dean Edwards' addEvent library.
- */
-jQuery.event = {
-
-       // Bind an event to an element
-       // Original by Dean Edwards
-       add: function(elem, types, handler, data) {
-               if ( elem.nodeType == 3 || elem.nodeType == 8 )
-                       return;
-
-               // For whatever reason, IE has trouble passing the window object
-               // around, causing it to be cloned in the process
-               if ( elem.setInterval && elem != window )
-                       elem = window;
-
-               // Make sure that the function being executed has a unique ID
-               if ( !handler.guid )
-                       handler.guid = this.guid++;
-
-               // if data is passed, bind to handler
-               if ( data !== undefined ) {
-                       // Create temporary function pointer to original handler
-                       var fn = handler;
-
-                       // Create unique handler function, wrapped around original handler
-                       handler = this.proxy( fn );
-
-                       // Store data in unique handler
-                       handler.data = data;
-               }
-
-               // Init the element's event structure
-               var events = jQuery.data(elem, "events") || jQuery.data(elem, "events", {}),
-                       handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle", function(){
-                               // Handle the second event of a trigger and when
-                               // an event is called after a page has unloaded
-                               return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
-                                       jQuery.event.handle.apply(arguments.callee.elem, arguments) :
-                                       undefined;
-                       });
-               // Add elem as a property of the handle function
-               // This is to prevent a memory leak with non-native
-               // event in IE.
-               handle.elem = elem;
-
-               // Handle multiple events separated by a space
-               // jQuery(...).bind("mouseover mouseout", fn);
-               jQuery.each(types.split(/\s+/), function(index, type) {
-                       // Namespaced event handlers
-                       var namespaces = type.split(".");
-                       type = namespaces.shift();
-                       handler.type = namespaces.slice().sort().join(".");
-
-                       // Get the current list of functions bound to this event
-                       var handlers = events[type];
-                       
-                       if ( jQuery.event.specialAll[type] )
-                               jQuery.event.specialAll[type].setup.call(elem, data, namespaces);
-
-                       // Init the event handler queue
-                       if (!handlers) {
-                               handlers = events[type] = {};
-
-                               // Check for a special event handler
-                               // Only use addEventListener/attachEvent if the special
-                               // events handler returns false
-                               if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem, data, namespaces) === false ) {
-                                       // Bind the global event handler to the element
-                                       if (elem.addEventListener)
-                                               elem.addEventListener(type, handle, false);
-                                       else if (elem.attachEvent)
-                                               elem.attachEvent("on" + type, handle);
-                               }
-                       }
-
-                       // Add the function to the element's handler list
-                       handlers[handler.guid] = handler;
-
-                       // Keep track of which events have been used, for global triggering
-                       jQuery.event.global[type] = true;
-               });
-
-               // Nullify elem to prevent memory leaks in IE
-               elem = null;
-       },
-
-       guid: 1,
-       global: {},
-
-       // Detach an event or set of events from an element
-       remove: function(elem, types, handler) {
-               // don't do events on text and comment nodes
-               if ( elem.nodeType == 3 || elem.nodeType == 8 )
-                       return;
-
-               var events = jQuery.data(elem, "events"), ret, index;
-
-               if ( events ) {
-                       // Unbind all events for the element
-                       if ( types === undefined || (typeof types === "string" && types.charAt(0) == ".") )
-                               for ( var type in events )
-                                       this.remove( elem, type + (types || "") );
-                       else {
-                               // types is actually an event object here
-                               if ( types.type ) {
-                                       handler = types.handler;
-                                       types = types.type;
-                               }
-
-                               // Handle multiple events seperated by a space
-                               // jQuery(...).unbind("mouseover mouseout", fn);
-                               jQuery.each(types.split(/\s+/), function(index, type){
-                                       // Namespaced event handlers
-                                       var namespaces = type.split(".");
-                                       type = namespaces.shift();
-                                       var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)");
-
-                                       if ( events[type] ) {
-                                               // remove the given handler for the given type
-                                               if ( handler )
-                                                       delete events[type][handler.guid];
-
-                                               // remove all handlers for the given type
-                                               else
-                                                       for ( var handle in events[type] )
-                                                               // Handle the removal of namespaced events
-                                                               if ( namespace.test(events[type][handle].type) )
-                                                                       delete events[type][handle];
-                                                                       
-                                               if ( jQuery.event.specialAll[type] )
-                                                       jQuery.event.specialAll[type].teardown.call(elem, namespaces);
-
-                                               // remove generic event handler if no more handlers exist
-                                               for ( ret in events[type] ) break;
-                                               if ( !ret ) {
-                                                       if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem, namespaces) === false ) {
-                                                               if (elem.removeEventListener)
-                                                                       elem.removeEventListener(type, jQuery.data(elem, "handle"), false);
-                                                               else if (elem.detachEvent)
-                                                                       elem.detachEvent("on" + type, jQuery.data(elem, "handle"));
-                                                       }
-                                                       ret = null;
-                                                       delete events[type];
-                                               }
-                                       }
-                               });
-                       }
-
-                       // Remove the expando if it's no longer used
-                       for ( ret in events ) break;
-                       if ( !ret ) {
-                               var handle = jQuery.data( elem, "handle" );
-                               if ( handle ) handle.elem = null;
-                               jQuery.removeData( elem, "events" );
-                               jQuery.removeData( elem, "handle" );
-                       }
-               }
-       },
-
-       // bubbling is internal
-       trigger: function( event, data, elem, bubbling ) {
-               // Event object or event type
-               var type = event.type || event;
-
-               if( !bubbling ){
-                       event = typeof event === "object" ?
-                               // jQuery.Event object
-                               event[expando] ? event :
-                               // Object literal
-                               jQuery.extend( jQuery.Event(type), event ) :
-                               // Just the event type (string)
-                               jQuery.Event(type);
-
-                       if ( type.indexOf("!") >= 0 ) {
-                               event.type = type = type.slice(0, -1);
-                               event.exclusive = true;
-                       }
-
-                       // Handle a global trigger
-                       if ( !elem ) {
-                               // Don't bubble custom events when global (to avoid too much overhead)
-                               event.stopPropagation();
-                               // Only trigger if we've ever bound an event for it
-                               if ( this.global[type] )
-                                       jQuery.each( jQuery.cache, function(){
-                                               if ( this.events && this.events[type] )
-                                                       jQuery.event.trigger( event, data, this.handle.elem );
-                                       });
-                       }
-
-                       // Handle triggering a single element
-
-                       // don't do events on text and comment nodes
-                       if ( !elem || elem.nodeType == 3 || elem.nodeType == 8 )
-                               return undefined;
-                       
-                       // Clean up in case it is reused
-                       event.result = undefined;
-                       event.target = elem;
-                       
-                       // Clone the incoming data, if any
-                       data = jQuery.makeArray(data);
-                       data.unshift( event );
-               }
-
-               event.currentTarget = elem;
-
-               // Trigger the event, it is assumed that "handle" is a function
-               var handle = jQuery.data(elem, "handle");
-               if ( handle )
-                       handle.apply( elem, data );
-
-               // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links)
-               if ( (!elem[type] || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false )
-                       event.result = false;
-
-               // Trigger the native events (except for clicks on links)
-               if ( !bubbling && elem[type] && !event.isDefaultPrevented() && !(jQuery.nodeName(elem, 'a') && type == "click") ) {
-                       this.triggered = true;
-                       try {
-                               elem[ type ]();
-                       // prevent IE from throwing an error for some hidden elements
-                       } catch (e) {}
-               }
-
-               this.triggered = false;
-
-               if ( !event.isPropagationStopped() ) {
-                       var parent = elem.parentNode || elem.ownerDocument;
-                       if ( parent )
-                               jQuery.event.trigger(event, data, parent, true);
-               }
-       },
-
-       handle: function(event) {
-               // returned undefined or false
-               var all, handlers;
-
-               event = arguments[0] = jQuery.event.fix( event || window.event );
-               event.currentTarget = this;
-               
-               // Namespaced event handlers
-               var namespaces = event.type.split(".");
-               event.type = namespaces.shift();
-
-               // Cache this now, all = true means, any handler
-               all = !namespaces.length && !event.exclusive;
-               
-               var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)");
-
-               handlers = ( jQuery.data(this, "events") || {} )[event.type];
-
-               for ( var j in handlers ) {
-                       var handler = handlers[j];
-
-                       // Filter the functions by class
-                       if ( all || namespace.test(handler.type) ) {
-                               // Pass in a reference to the handler function itself
-                               // So that we can later remove it
-                               event.handler = handler;
-                               event.data = handler.data;
-
-                               var ret = handler.apply(this, arguments);
-
-                               if( ret !== undefined ){
-                                       event.result = ret;
-                                       if ( ret === false ) {
-                                               event.preventDefault();
-                                               event.stopPropagation();
-                                       }
-                               }
-
-                               if( event.isImmediatePropagationStopped() )
-                                       break;
-
-                       }
-               }
-       },
-
-       props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
-
-       fix: function(event) {
-               if ( event[expando] )
-                       return event;
-
-               // store a copy of the original event object
-               // and "clone" to set read-only properties
-               var originalEvent = event;
-               event = jQuery.Event( originalEvent );
-
-               for ( var i = this.props.length, prop; i; ){
-                       prop = this.props[ --i ];
-                       event[ prop ] = originalEvent[ prop ];
-               }
-
-               // Fix target property, if necessary
-               if ( !event.target )
-                       event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
-
-               // check if target is a textnode (safari)
-               if ( event.target.nodeType == 3 )
-                       event.target = event.target.parentNode;
-
-               // Add relatedTarget, if necessary
-               if ( !event.relatedTarget && event.fromElement )
-                       event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement;
-
-               // Calculate pageX/Y if missing and clientX/Y available
-               if ( event.pageX == null && event.clientX != null ) {
-                       var doc = document.documentElement, body = document.body;
-                       event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0);
-                       event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0);
-               }
-
-               // Add which for key events
-               if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) )
-                       event.which = event.charCode || event.keyCode;
-
-               // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
-               if ( !event.metaKey && event.ctrlKey )
-                       event.metaKey = event.ctrlKey;
-
-               // Add which for click: 1 == left; 2 == middle; 3 == right
-               // Note: button is not normalized, so don't use it
-               if ( !event.which && event.button )
-                       event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
-
-               return event;
-       },
-
-       proxy: function( fn, proxy ){
-               proxy = proxy || function(){ return fn.apply(this, arguments); };
-               // Set the guid of unique handler to the same of original handler, so it can be removed
-               proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++;
-               // So proxy can be declared as an argument
-               return proxy;
-       },
-
-       special: {
-               ready: {
-                       // Make sure the ready event is setup
-                       setup: bindReady,
-                       teardown: function() {}
-               }
-       },
-       
-       specialAll: {
-               live: {
-                       setup: function( selector, namespaces ){
-                               jQuery.event.add( this, namespaces[0], liveHandler );
-                       },
-                       teardown:  function( namespaces ){
-                               if ( namespaces.length ) {
-                                       var remove = 0, name = RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)");
-                                       
-                                       jQuery.each( (jQuery.data(this, "events").live || {}), function(){
-                                               if ( name.test(this.type) )
-                                                       remove++;
-                                       });
-                                       
-                                       if ( remove < 1 )
-                                               jQuery.event.remove( this, namespaces[0], liveHandler );
-                               }
-                       }
-               }
-       }
-};
-
-jQuery.Event = function( src ){
-       // Allow instantiation without the 'new' keyword
-       if( !this.preventDefault )
-               return new jQuery.Event(src);
-       
-       // Event object
-       if( src && src.type ){
-               this.originalEvent = src;
-               this.type = src.type;
-       // Event type
-       }else
-               this.type = src;
-
-       // timeStamp is buggy for some events on Firefox(#3843)
-       // So we won't rely on the native value
-       this.timeStamp = now();
-       
-       // Mark it as fixed
-       this[expando] = true;
-};
-
-function returnFalse(){
-       return false;
-}
-function returnTrue(){
-       return true;
-}
-
-// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
-// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
-jQuery.Event.prototype = {
-       preventDefault: function() {
-               this.isDefaultPrevented = returnTrue;
-
-               var e = this.originalEvent;
-               if( !e )
-                       return;
-               // if preventDefault exists run it on the original event
-               if (e.preventDefault)
-                       e.preventDefault();
-               // otherwise set the returnValue property of the original event to false (IE)
-               e.returnValue = false;
-       },
-       stopPropagation: function() {
-               this.isPropagationStopped = returnTrue;
-
-               var e = this.originalEvent;
-               if( !e )
-                       return;
-               // if stopPropagation exists run it on the original event
-               if (e.stopPropagation)
-                       e.stopPropagation();
-               // otherwise set the cancelBubble property of the original event to true (IE)
-               e.cancelBubble = true;
-       },
-       stopImmediatePropagation:function(){
-               this.isImmediatePropagationStopped = returnTrue;
-               this.stopPropagation();
-       },
-       isDefaultPrevented: returnFalse,
-       isPropagationStopped: returnFalse,
-       isImmediatePropagationStopped: returnFalse
-};
-// Checks if an event happened on an element within another element
-// Used in jQuery.event.special.mouseenter and mouseleave handlers
-var withinElement = function(event) {
-       // Check if mouse(over|out) are still within the same parent element
-       var parent = event.relatedTarget;
-       // Traverse up the tree
-       while ( parent && parent != this )
-               try { parent = parent.parentNode; }
-               catch(e) { parent = this; }
-       
-       if( parent != this ){
-               // set the correct event type
-               event.type = event.data;
-               // handle event if we actually just moused on to a non sub-element
-               jQuery.event.handle.apply( this, arguments );
-       }
-};
-       
-jQuery.each({ 
-       mouseover: 'mouseenter', 
-       mouseout: 'mouseleave'
-}, function( orig, fix ){
-       jQuery.event.special[ fix ] = {
-               setup: function(){
-                       jQuery.event.add( this, orig, withinElement, fix );
-               },
-               teardown: function(){
-                       jQuery.event.remove( this, orig, withinElement );
-               }
-       };                         
-});
-
-jQuery.fn.extend({
-       bind: function( type, data, fn ) {
-               return type == "unload" ? this.one(type, data, fn) : this.each(function(){
-                       jQuery.event.add( this, type, fn || data, fn && data );
-               });
-       },
-
-       one: function( type, data, fn ) {
-               var one = jQuery.event.proxy( fn || data, function(event) {
-                       jQuery(this).unbind(event, one);
-                       return (fn || data).apply( this, arguments );
-               });
-               return this.each(function(){
-                       jQuery.event.add( this, type, one, fn && data);
-               });
-       },
-
-       unbind: function( type, fn ) {
-               return this.each(function(){
-                       jQuery.event.remove( this, type, fn );
-               });
-       },
-
-       trigger: function( type, data ) {
-               return this.each(function(){
-                       jQuery.event.trigger( type, data, this );
-               });
-       },
-
-       triggerHandler: function( type, data ) {
-               if( this[0] ){
-                       var event = jQuery.Event(type);
-                       event.preventDefault();
-                       event.stopPropagation();
-                       jQuery.event.trigger( event, data, this[0] );
-                       return event.result;
-               }               
-       },
-
-       toggle: function( fn ) {
-               // Save reference to arguments for access in closure
-               var args = arguments, i = 1;
-
-               // link all the functions, so any of them can unbind this click handler
-               while( i < args.length )
-                       jQuery.event.proxy( fn, args[i++] );
-
-               return this.click( jQuery.event.proxy( fn, function(event) {
-                       // Figure out which function to execute
-                       this.lastToggle = ( this.lastToggle || 0 ) % i;
-
-                       // Make sure that clicks stop
-                       event.preventDefault();
-
-                       // and execute the function
-                       return args[ this.lastToggle++ ].apply( this, arguments ) || false;
-               }));
-       },
-
-       hover: function(fnOver, fnOut) {
-               return this.mouseenter(fnOver).mouseleave(fnOut);
-       },
-
-       ready: function(fn) {
-               // Attach the listeners
-               bindReady();
-
-               // If the DOM is already ready
-               if ( jQuery.isReady )
-                       // Execute the function immediately
-                       fn.call( document, jQuery );
-
-               // Otherwise, remember the function for later
-               else
-                       // Add the function to the wait list
-                       jQuery.readyList.push( fn );
-
-               return this;
-       },
-       
-       live: function( type, fn ){
-               var proxy = jQuery.event.proxy( fn );
-               proxy.guid += this.selector + type;
-
-               jQuery(document).bind( liveConvert(type, this.selector), this.selector, proxy );
-
-               return this;
-       },
-       
-       die: function( type, fn ){
-               jQuery(document).unbind( liveConvert(type, this.selector), fn ? { guid: fn.guid + this.selector + type } : null );
-               return this;
-       }
-});
-
-function liveHandler( event ){
-       var check = RegExp("(^|\\.)" + event.type + "(\\.|$)"),
-               stop = true,
-               elems = [];
-
-       jQuery.each(jQuery.data(this, "events").live || [], function(i, fn){
-               if ( check.test(fn.type) ) {
-                       var elem = jQuery(event.target).closest(fn.data)[0];
-                       if ( elem )
-                               elems.push({ elem: elem, fn: fn });
-               }
-       });
-
-       elems.sort(function(a,b) {
-               return jQuery.data(a.elem, "closest") - jQuery.data(b.elem, "closest");
-       });
-       
-       jQuery.each(elems, function(){
-               if ( this.fn.call(this.elem, event, this.fn.data) === false )
-                       return (stop = false);
-       });
-
-       return stop;
-}
-
-function liveConvert(type, selector){
-       return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "|")].join(".");
-}
-
-jQuery.extend({
-       isReady: false,
-       readyList: [],
-       // Handle when the DOM is ready
-       ready: function() {
-               // Make sure that the DOM is not already loaded
-               if ( !jQuery.isReady ) {
-                       // Remember that the DOM is ready
-                       jQuery.isReady = true;
-
-                       // If there are functions bound, to execute
-                       if ( jQuery.readyList ) {
-                               // Execute all of them
-                               jQuery.each( jQuery.readyList, function(){
-                                       this.call( document, jQuery );
-                               });
-
-                               // Reset the list of functions
-                               jQuery.readyList = null;
-                       }
-
-                       // Trigger any bound ready events
-                       jQuery(document).triggerHandler("ready");
-               }
-       }
-});
-
-var readyBound = false;
-
-function bindReady(){
-       if ( readyBound ) return;
-       readyBound = true;
-
-       // Mozilla, Opera and webkit nightlies currently support this event
-       if ( document.addEventListener ) {
-               // Use the handy event callback
-               document.addEventListener( "DOMContentLoaded", function(){
-                       document.removeEventListener( "DOMContentLoaded", arguments.callee, false );
-                       jQuery.ready();
-               }, false );
-
-       // If IE event model is used
-       } else if ( document.attachEvent ) {
-               // ensure firing before onload,
-               // maybe late but safe also for iframes
-               document.attachEvent("onreadystatechange", function(){
-                       if ( document.readyState === "complete" ) {
-                               document.detachEvent( "onreadystatechange", arguments.callee );
-                               jQuery.ready();
-                       }
-               });
-
-               // If IE and not an iframe
-               // continually check to see if the document is ready
-               if ( document.documentElement.doScroll && window == window.top ) (function(){
-                       if ( jQuery.isReady ) return;
-
-                       try {
-                               // If IE is used, use the trick by Diego Perini
-                               // http://javascript.nwbox.com/IEContentLoaded/
-                               document.documentElement.doScroll("left");
-                       } catch( error ) {
-                               setTimeout( arguments.callee, 0 );
-                               return;
-                       }
-
-                       // and execute any waiting functions
-                       jQuery.ready();
-               })();
-       }
-
-       // A fallback to window.onload, that will always work
-       jQuery.event.add( window, "load", jQuery.ready );
-}
-
-jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
-       "mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave," +
-       "change,select,submit,keydown,keypress,keyup,error").split(","), function(i, name){
-
-       // Handle event binding
-       jQuery.fn[name] = function(fn){
-               return fn ? this.bind(name, fn) : this.trigger(name);
-       };
-});
-
-// Prevent memory leaks in IE
-// And prevent errors on refresh with events like mouseover in other browsers
-// Window isn't included so as not to unbind existing unload events
-jQuery( window ).bind( 'unload', function(){ 
-       for ( var id in jQuery.cache )
-               // Skip the window
-               if ( id != 1 && jQuery.cache[ id ].handle )
-                       jQuery.event.remove( jQuery.cache[ id ].handle.elem );
-}); 
-(function(){
-
-       jQuery.support = {};
-
-       var root = document.documentElement,
-               script = document.createElement("script"),
-               div = document.createElement("div"),
-               id = "script" + (new Date).getTime();
-
-       div.style.display = "none";
-       div.innerHTML = '   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';
-
-       var all = div.getElementsByTagName("*"),
-               a = div.getElementsByTagName("a")[0];
-
-       // Can't get basic test support
-       if ( !all || !all.length || !a ) {
-               return;
-       }
-
-       jQuery.support = {
-               // IE strips leading whitespace when .innerHTML is used
-               leadingWhitespace: div.firstChild.nodeType == 3,
-               
-               // Make sure that tbody elements aren't automatically inserted
-               // IE will insert them into empty tables
-               tbody: !div.getElementsByTagName("tbody").length,
-               
-               // Make sure that you can get all elements in an <object> element
-               // IE 7 always returns no results
-               objectAll: !!div.getElementsByTagName("object")[0]
-                       .getElementsByTagName("*").length,
-               
-               // Make sure that link elements get serialized correctly by innerHTML
-               // This requires a wrapper element in IE
-               htmlSerialize: !!div.getElementsByTagName("link").length,
-               
-               // Get the style information from getAttribute
-               // (IE uses .cssText insted)
-               style: /red/.test( a.getAttribute("style") ),
-               
-               // Make sure that URLs aren't manipulated
-               // (IE normalizes it by default)
-               hrefNormalized: a.getAttribute("href") === "/a",
-               
-               // Make sure that element opacity exists
-               // (IE uses filter instead)
-               opacity: a.style.opacity === "0.5",
-               
-               // Verify style float existence
-               // (IE uses styleFloat instead of cssFloat)
-               cssFloat: !!a.style.cssFloat,
-
-               // Will be defined later
-               scriptEval: false,
-               noCloneEvent: true,
-               boxModel: null
-       };
-       
-       script.type = "text/javascript";
-       try {
-               script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
-       } catch(e){}
-
-       root.insertBefore( script, root.firstChild );
-       
-       // Make sure that the execution of code works by injecting a script
-       // tag with appendChild/createTextNode
-       // (IE doesn't support this, fails, and uses .text instead)
-       if ( window[ id ] ) {
-               jQuery.support.scriptEval = true;
-               delete window[ id ];
-       }
-
-       root.removeChild( script );
-
-       if ( div.attachEvent && div.fireEvent ) {
-               div.attachEvent("onclick", function(){
-                       // Cloning a node shouldn't copy over any
-                       // bound event handlers (IE does this)
-                       jQuery.support.noCloneEvent = false;
-                       div.detachEvent("onclick", arguments.callee);
-               });
-               div.cloneNode(true).fireEvent("onclick");
-       }
-
-       // Figure out if the W3C box model works as expected
-       // document.body must exist before we can do this
-       jQuery(function(){
-               var div = document.createElement("div");
-               div.style.width = div.style.paddingLeft = "1px";
-
-               document.body.appendChild( div );
-               jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
-               document.body.removeChild( div ).style.display = 'none';
-       });
-})();
-
-var styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat";
-
-jQuery.props = {
-       "for": "htmlFor",
-       "class": "className",
-       "float": styleFloat,
-       cssFloat: styleFloat,
-       styleFloat: styleFloat,
-       readonly: "readOnly",
-       maxlength: "maxLength",
-       cellspacing: "cellSpacing",
-       rowspan: "rowSpan",
-       tabindex: "tabIndex"
-};
-jQuery.fn.extend({
-       // Keep a copy of the old load
-       _load: jQuery.fn.load,
-
-       load: function( url, params, callback ) {
-               if ( typeof url !== "string" )
-                       return this._load( url );
-
-               var off = url.indexOf(" ");
-               if ( off >= 0 ) {
-                       var selector = url.slice(off, url.length);
-                       url = url.slice(0, off);
-               }
-
-               // Default to a GET request
-               var type = "GET";
-
-               // If the second parameter was provided
-               if ( params )
-                       // If it's a function
-                       if ( jQuery.isFunction( params ) ) {
-                               // We assume that it's the callback
-                               callback = params;
-                               params = null;
-
-                       // Otherwise, build a param string
-                       } else if( typeof params === "object" ) {
-                               params = jQuery.param( params );
-                               type = "POST";
-                       }
-
-               var self = this;
-
-               // Request the remote document
-               jQuery.ajax({
-                       url: url,
-                       type: type,
-                       dataType: "html",
-                       data: params,
-                       complete: function(res, status){
-                               // If successful, inject the HTML into all the matched elements
-                               if ( status == "success" || status == "notmodified" )
-                                       // See if a selector was specified
-                                       self.html( selector ?
-                                               // Create a dummy div to hold the results
-                                               jQuery("<div/>")
-                                                       // inject the contents of the document in, removing the scripts
-                                                       // to avoid any 'Permission Denied' errors in IE
-                                                       .append(res.responseText.replace(/<script(.|\s)*?\/script>/g, ""))
-
-                                                       // Locate the specified elements
-                                                       .find(selector) :
-
-                                               // If not, just inject the full result
-                                               res.responseText );
-
-                               if( callback )
-                                       self.each( callback, [res.responseText, status, res] );
-                       }
-               });
-               return this;
-       },
-
-       serialize: function() {
-               return jQuery.param(this.serializeArray());
-       },
-       serializeArray: function() {
-               return this.map(function(){
-                       return this.elements ? jQuery.makeArray(this.elements) : this;
-               })
-               .filter(function(){
-                       return this.name && !this.disabled &&
-                               (this.checked || /select|textarea/i.test(this.nodeName) ||
-                                       /text|hidden|password|search/i.test(this.type));
-               })
-               .map(function(i, elem){
-                       var val = jQuery(this).val();
-                       return val == null ? null :
-                               jQuery.isArray(val) ?
-                                       jQuery.map( val, function(val, i){
-                                               return {name: elem.name, value: val};
-                                       }) :
-                                       {name: elem.name, value: val};
-               }).get();
-       }
-});
-
-// Attach a bunch of functions for handling common AJAX events
-jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){
-       jQuery.fn[o] = function(f){
-               return this.bind(o, f);
-       };
-});
-
-var jsc = now();
-
-jQuery.extend({
-  
-       get: function( url, data, callback, type ) {
-               // shift arguments if data argument was ommited
-               if ( jQuery.isFunction( data ) ) {
-                       callback = data;
-                       data = null;
-               }
-
-               return jQuery.ajax({
-                       type: "GET",
-                       url: url,
-                       data: data,
-                       success: callback,
-                       dataType: type
-               });
-       },
-
-       getScript: function( url, callback ) {
-               return jQuery.get(url, null, callback, "script");
-       },
-
-       getJSON: function( url, data, callback ) {
-               return jQuery.get(url, data, callback, "json");
-       },
-
-       post: function( url, data, callback, type ) {
-               if ( jQuery.isFunction( data ) ) {
-                       callback = data;
-                       data = {};
-               }
-
-               return jQuery.ajax({
-                       type: "POST",
-                       url: url,
-                       data: data,
-                       success: callback,
-                       dataType: type
-               });
-       },
-
-       ajaxSetup: function( settings ) {
-               jQuery.extend( jQuery.ajaxSettings, settings );
-       },
-
-       ajaxSettings: {
-               url: location.href,
-               global: true,
-               type: "GET",
-               contentType: "application/x-www-form-urlencoded",
-               processData: true,
-               async: true,
-               /*
-               timeout: 0,
-               data: null,
-               username: null,
-               password: null,
-               */
-               // Create the request object; Microsoft failed to properly
-               // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
-               // This function can be overriden by calling jQuery.ajaxSetup
-               xhr:function(){
-                       return window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
-               },
-               accepts: {
-                       xml: "application/xml, text/xml",
-                       html: "text/html",
-                       script: "text/javascript, application/javascript",
-                       json: "application/json, text/javascript",
-                       text: "text/plain",
-                       _default: "*/*"
-               }
-       },
-
-       // Last-Modified header cache for next request
-       lastModified: {},
-
-       ajax: function( s ) {
-               // Extend the settings, but re-extend 's' so that it can be
-               // checked again later (in the test suite, specifically)
-               s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));
-
-               var jsonp, jsre = /=\?(&|$)/g, status, data,
-                       type = s.type.toUpperCase();
-
-               // convert data if not already a string
-               if ( s.data && s.processData && typeof s.data !== "string" )
-                       s.data = jQuery.param(s.data);
-
-               // Handle JSONP Parameter Callbacks
-               if ( s.dataType == "jsonp" ) {
-                       if ( type == "GET" ) {
-                               if ( !s.url.match(jsre) )
-                                       s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?";
-                       } else if ( !s.data || !s.data.match(jsre) )
-                               s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
-                       s.dataType = "json";
-               }
-
-               // Build temporary JSONP function
-               if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) {
-                       jsonp = "jsonp" + jsc++;
-
-                       // Replace the =? sequence both in the query string and the data
-                       if ( s.data )
-                               s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
-                       s.url = s.url.replace(jsre, "=" + jsonp + "$1");
-
-                       // We need to make sure
-                       // that a JSONP style response is executed properly
-                       s.dataType = "script";
-
-                       // Handle JSONP-style loading
-                       window[ jsonp ] = function(tmp){
-                               data = tmp;
-                               success();
-                               complete();
-                               // Garbage collect
-                               window[ jsonp ] = undefined;
-                               try{ delete window[ jsonp ]; } catch(e){}
-                               if ( head )
-                                       head.removeChild( script );
-                       };
-               }
-
-               if ( s.dataType == "script" && s.cache == null )
-                       s.cache = false;
-
-               if ( s.cache === false && type == "GET" ) {
-                       var ts = now();
-                       // try replacing _= if it is there
-                       var ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2");
-                       // if nothing was replaced, add timestamp to the end
-                       s.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : "");
-               }
-
-               // If data is available, append data to url for get requests
-               if ( s.data && type == "GET" ) {
-                       s.url += (s.url.match(/\?/) ? "&" : "?") + s.data;
-
-                       // IE likes to send both get and post data, prevent this
-                       s.data = null;
-               }
-
-               // Watch for a new set of requests
-               if ( s.global && ! jQuery.active++ )
-                       jQuery.event.trigger( "ajaxStart" );
-
-               // Matches an absolute URL, and saves the domain
-               var parts = /^(\w+:)?\/\/([^\/?#]+)/.exec( s.url );
-
-               // If we're requesting a remote document
-               // and trying to load JSON or Script with a GET
-               if ( s.dataType == "script" && type == "GET" && parts
-                       && ( parts[1] && parts[1] != location.protocol || parts[2] != location.host )){
-
-                       var head = document.getElementsByTagName("head")[0];
-                       var script = document.createElement("script");
-                       script.src = s.url;
-                       if (s.scriptCharset)
-                               script.charset = s.scriptCharset;
-
-                       // Handle Script loading
-                       if ( !jsonp ) {
-                               var done = false;
-
-                               // Attach handlers for all browsers
-                               script.onload = script.onreadystatechange = function(){
-                                       if ( !done && (!this.readyState ||
-                                                       this.readyState == "loaded" || this.readyState == "complete") ) {
-                                               done = true;
-                                               success();
-                                               complete();
-
-                                               // Handle memory leak in IE
-                                               script.onload = script.onreadystatechange = null;
-                                               head.removeChild( script );
-                                       }
-                               };
-                       }
-
-                       head.appendChild(script);
-
-                       // We handle everything using the script element injection
-                       return undefined;
-               }
-
-               var requestDone = false;
-
-               // Create the request object
-               var xhr = s.xhr();
-
-               // Open the socket
-               // Passing null username, generates a login popup on Opera (#2865)
-               if( s.username )
-                       xhr.open(type, s.url, s.async, s.username, s.password);
-               else
-                       xhr.open(type, s.url, s.async);
-
-               // Need an extra try/catch for cross domain requests in Firefox 3
-               try {
-                       // Set the correct header, if data is being sent
-                       if ( s.data )
-                               xhr.setRequestHeader("Content-Type", s.contentType);
-
-                       // Set the If-Modified-Since header, if ifModified mode.
-                       if ( s.ifModified )
-                               xhr.setRequestHeader("If-Modified-Since",
-                                       jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" );
-
-                       // Set header so the called script knows that it's an XMLHttpRequest
-                       xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
-
-                       // Set the Accepts header for the server, depending on the dataType
-                       xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
-                               s.accepts[ s.dataType ] + ", */*" :
-                               s.accepts._default );
-               } catch(e){}
-
-               // Allow custom headers/mimetypes and early abort
-               if ( s.beforeSend && s.beforeSend(xhr, s) === false ) {
-                       // Handle the global AJAX counter
-                       if ( s.global && ! --jQuery.active )
-                               jQuery.event.trigger( "ajaxStop" );
-                       // close opended socket
-                       xhr.abort();
-                       return false;
-               }
-
-               if ( s.global )
-                       jQuery.event.trigger("ajaxSend", [xhr, s]);
-
-               // Wait for a response to come back
-               var onreadystatechange = function(isTimeout){
-                       // The request was aborted, clear the interval and decrement jQuery.active
-                       if (xhr.readyState == 0) {
-                               if (ival) {
-                                       // clear poll interval
-                                       clearInterval(ival);
-                                       ival = null;
-                                       // Handle the global AJAX counter
-                                       if ( s.global && ! --jQuery.active )
-                                               jQuery.event.trigger( "ajaxStop" );
-                               }
-                       // The transfer is complete and the data is available, or the request timed out
-                       } else if ( !requestDone && xhr && (xhr.readyState == 4 || isTimeout == "timeout") ) {
-                               requestDone = true;
-
-                               // clear poll interval
-                               if (ival) {
-                                       clearInterval(ival);
-                                       ival = null;
-                               }
-
-                               status = isTimeout == "timeout" ? "timeout" :
-                                       !jQuery.httpSuccess( xhr ) ? "error" :
-                                       s.ifModified && jQuery.httpNotModified( xhr, s.url ) ? "notmodified" :
-                                       "success";
-
-                               if ( status == "success" ) {
-                                       // Watch for, and catch, XML document parse errors
-                                       try {
-                                               // process the data (runs the xml through httpData regardless of callback)
-                                               data = jQuery.httpData( xhr, s.dataType, s );
-                                       } catch(e) {
-                                               status = "parsererror";
-                                       }
-                               }
-
-                               // Make sure that the request was successful or notmodified
-                               if ( status == "success" ) {
-                                       // Cache Last-Modified header, if ifModified mode.
-                                       var modRes;
-                                       try {
-                                               modRes = xhr.getResponseHeader("Last-Modified");
-                                       } catch(e) {} // swallow exception thrown by FF if header is not available
-
-                                       if ( s.ifModified && modRes )
-                                               jQuery.lastModified[s.url] = modRes;
-
-                                       // JSONP handles its own success callback
-                                       if ( !jsonp )
-                                               success();
-                               } else
-                                       jQuery.handleError(s, xhr, status);
-
-                               // Fire the complete handlers
-                               complete();
-
-                               if ( isTimeout )
-                                       xhr.abort();
-
-                               // Stop memory leaks
-                               if ( s.async )
-                                       xhr = null;
-                       }
-               };
-
-               if ( s.async ) {
-                       // don't attach the handler to the request, just poll it instead
-                       var ival = setInterval(onreadystatechange, 13);
-
-                       // Timeout checker
-                       if ( s.timeout > 0 )
-                               setTimeout(function(){
-                                       // Check to see if the request is still happening
-                                       if ( xhr && !requestDone )
-                                               onreadystatechange( "timeout" );
-                               }, s.timeout);
-               }
-
-               // Send the data
-               try {
-                       xhr.send(s.data);
-               } catch(e) {
-                       jQuery.handleError(s, xhr, null, e);
-               }
-
-               // firefox 1.5 doesn't fire statechange for sync requests
-               if ( !s.async )
-                       onreadystatechange();
-
-               function success(){
-                       // If a local callback was specified, fire it and pass it the data
-                       if ( s.success )
-                               s.success( data, status );
-
-                       // Fire the global callback
-                       if ( s.global )
-                               jQuery.event.trigger( "ajaxSuccess", [xhr, s] );
-               }
-
-               function complete(){
-                       // Process result
-                       if ( s.complete )
-                               s.complete(xhr, status);
-
-                       // The request was completed
-                       if ( s.global )
-                               jQuery.event.trigger( "ajaxComplete", [xhr, s] );
-
-                       // Handle the global AJAX counter
-                       if ( s.global && ! --jQuery.active )
-                               jQuery.event.trigger( "ajaxStop" );
-               }
-
-               // return XMLHttpRequest to allow aborting the request etc.
-               return xhr;
-       },
-
-       handleError: function( s, xhr, status, e ) {
-               // If a local callback was specified, fire it
-               if ( s.error ) s.error( xhr, status, e );
-
-               // Fire the global callback
-               if ( s.global )
-                       jQuery.event.trigger( "ajaxError", [xhr, s, e] );
-       },
-
-       // Counter for holding the number of active queries
-       active: 0,
-
-       // Determines if an XMLHttpRequest was successful or not
-       httpSuccess: function( xhr ) {
-               try {
-                       // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
-                       return !xhr.status && location.protocol == "file:" ||
-                               ( xhr.status >= 200 && xhr.status < 300 ) || xhr.status == 304 || xhr.status == 1223;
-               } catch(e){}
-               return false;
-       },
-
-       // Determines if an XMLHttpRequest returns NotModified
-       httpNotModified: function( xhr, url ) {
-               try {
-                       var xhrRes = xhr.getResponseHeader("Last-Modified");
-
-                       // Firefox always returns 200. check Last-Modified date
-                       return xhr.status == 304 || xhrRes == jQuery.lastModified[url];
-               } catch(e){}
-               return false;
-       },
-
-       httpData: function( xhr, type, s ) {
-               var ct = xhr.getResponseHeader("content-type"),
-                       xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0,
-                       data = xml ? xhr.responseXML : xhr.responseText;
-
-               if ( xml && data.documentElement.tagName == "parsererror" )
-                       throw "parsererror";
-                       
-               // Allow a pre-filtering function to sanitize the response
-               // s != null is checked to keep backwards compatibility
-               if( s && s.dataFilter )
-                       data = s.dataFilter( data, type );
-
-               // The filter can actually parse the response
-               if( typeof data === "string" ){
-
-                       // If the type is "script", eval it in global context
-                       if ( type == "script" )
-                               jQuery.globalEval( data );
-
-                       // Get the JavaScript object, if JSON is used.
-                       if ( type == "json" )
-                               data = window["eval"]("(" + data + ")");
-               }
-               
-               return data;
-       },
-
-       // Serialize an array of form elements or a set of
-       // key/values into a query string
-       param: function( a ) {
-               var s = [ ];
-
-               function add( key, value ){
-                       s[ s.length ] = encodeURIComponent(key) + '=' + encodeURIComponent(value);
-               };
-
-               // If an array was passed in, assume that it is an array
-               // of form elements
-               if ( jQuery.isArray(a) || a.jquery )
-                       // Serialize the form elements
-                       jQuery.each( a, function(){
-                               add( this.name, this.value );
-                       });
-
-               // Otherwise, assume that it's an object of key/value pairs
-               else
-                       // Serialize the key/values
-                       for ( var j in a )
-                               // If the value is an array then the key names need to be repeated
-                               if ( jQuery.isArray(a[j]) )
-                                       jQuery.each( a[j], function(){
-                                               add( j, this );
-                                       });
-                               else
-                                       add( j, jQuery.isFunction(a[j]) ? a[j]() : a[j] );
-
-               // Return the resulting serialization
-               return s.join("&").replace(/%20/g, "+");
-       }
-
-});
-var elemdisplay = {},
-       timerId,
-       fxAttrs = [
-               // height animations
-               [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
-               // width animations
-               [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
-               // opacity animations
-               [ "opacity" ]
-       ];
-
-function genFx( type, num ){
-       var obj = {};
-       jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function(){
-               obj[ this ] = type;
-       });
-       return obj;
-}
-
-jQuery.fn.extend({
-       show: function(speed,callback){
-               if ( speed ) {
-                       return this.animate( genFx("show", 3), speed, callback);
-               } else {
-                       for ( var i = 0, l = this.length; i < l; i++ ){
-                               var old = jQuery.data(this[i], "olddisplay");
-                               
-                               this[i].style.display = old || "";
-                               
-                               if ( jQuery.css(this[i], "display") === "none" ) {
-                                       var tagName = this[i].tagName, display;
-                                       
-                                       if ( elemdisplay[ tagName ] ) {
-                                               display = elemdisplay[ tagName ];
-                                       } else {
-                                               var elem = jQuery("<" + tagName + " />").appendTo("body");
-                                               
-                                               display = elem.css("display");
-                                               if ( display === "none" )
-                                                       display = "block";
-                                               
-                                               elem.remove();
-                                               
-                                               elemdisplay[ tagName ] = display;
-                                       }
-                                       
-                                       jQuery.data(this[i], "olddisplay", display);
-                               }
-                       }
-
-                       // Set the display of the elements in a second loop
-                       // to avoid the constant reflow
-                       for ( var i = 0, l = this.length; i < l; i++ ){
-                               this[i].style.display = jQuery.data(this[i], "olddisplay") || "";
-                       }
-                       
-                       return this;
-               }
-       },
-
-       hide: function(speed,callback){
-               if ( speed ) {
-                       return this.animate( genFx("hide", 3), speed, callback);
-               } else {
-                       for ( var i = 0, l = this.length; i < l; i++ ){
-                               var old = jQuery.data(this[i], "olddisplay");
-                               if ( !old && old !== "none" )
-                                       jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
-                       }
-
-                       // Set the display of the elements in a second loop
-                       // to avoid the constant reflow
-                       for ( var i = 0, l = this.length; i < l; i++ ){
-                               this[i].style.display = "none";
-                       }
-
-                       return this;
-               }
-       },
-
-       // Save the old toggle function
-       _toggle: jQuery.fn.toggle,
-
-       toggle: function( fn, fn2 ){
-               var bool = typeof fn === "boolean";
-
-               return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
-                       this._toggle.apply( this, arguments ) :
-                       fn == null || bool ?
-                               this.each(function(){
-                                       var state = bool ? fn : jQuery(this).is(":hidden");
-                                       jQuery(this)[ state ? "show" : "hide" ]();
-                               }) :
-                               this.animate(genFx("toggle", 3), fn, fn2);
-       },
-
-       fadeTo: function(speed,to,callback){
-               return this.animate({opacity: to}, speed, callback);
-       },
-
-       animate: function( prop, speed, easing, callback ) {
-               var optall = jQuery.speed(speed, easing, callback);
-
-               return this[ optall.queue === false ? "each" : "queue" ](function(){
-               
-                       var opt = jQuery.extend({}, optall), p,
-                               hidden = this.nodeType == 1 && jQuery(this).is(":hidden"),
-                               self = this;
-       
-                       for ( p in prop ) {
-                               if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
-                                       return opt.complete.call(this);
-
-                               if ( ( p == "height" || p == "width" ) && this.style ) {
-                                       // Store display property
-                                       opt.display = jQuery.css(this, "display");
-
-                                       // Make sure that nothing sneaks out
-                                       opt.overflow = this.style.overflow;
-                               }
-                       }
-
-                       if ( opt.overflow != null )
-                               this.style.overflow = "hidden";
-
-                       opt.curAnim = jQuery.extend({}, prop);
-
-                       jQuery.each( prop, function(name, val){
-                               var e = new jQuery.fx( self, opt, name );
-
-                               if ( /toggle|show|hide/.test(val) )
-                                       e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
-                               else {
-                                       var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),
-                                               start = e.cur(true) || 0;
-
-                                       if ( parts ) {
-                                               var end = parseFloat(parts[2]),
-                                                       unit = parts[3] || "px";
-
-                                               // We need to compute starting value
-                                               if ( unit != "px" ) {
-                                                       self.style[ name ] = (end || 1) + unit;
-                                                       start = ((end || 1) / e.cur(true)) * start;
-                                                       self.style[ name ] = start + unit;
-                                               }
-
-                                               // If a +=/-= token was provided, we're doing a relative animation
-                                               if ( parts[1] )
-                                                       end = ((parts[1] == "-=" ? -1 : 1) * end) + start;
-
-                                               e.custom( start, end, unit );
-                                       } else
-                                               e.custom( start, val, "" );
-                               }
-                       });
-
-                       // For JS strict compliance
-                       return true;
-               });
-       },
-
-       stop: function(clearQueue, gotoEnd){
-               var timers = jQuery.timers;
-
-               if (clearQueue)
-                       this.queue([]);
-
-               this.each(function(){
-                       // go in reverse order so anything added to the queue during the loop is ignored
-                       for ( var i = timers.length - 1; i >= 0; i-- )
-                               if ( timers[i].elem == this ) {
-                                       if (gotoEnd)
-                                               // force the next step to be the last
-                                               timers[i](true);
-                                       timers.splice(i, 1);
-                               }
-               });
-
-               // start the next in the queue if the last step wasn't forced
-               if (!gotoEnd)
-                       this.dequeue();
-
-               return this;
-       }
-
-});
-
-// Generate shortcuts for custom animations
-jQuery.each({
-       slideDown: genFx("show", 1),
-       slideUp: genFx("hide", 1),
-       slideToggle: genFx("toggle", 1),
-       fadeIn: { opacity: "show" },
-       fadeOut: { opacity: "hide" }
-}, function( name, props ){
-       jQuery.fn[ name ] = function( speed, callback ){
-               return this.animate( props, speed, callback );
-       };
-});
-
-jQuery.extend({
-
-       speed: function(speed, easing, fn) {
-               var opt = typeof speed === "object" ? speed : {
-                       complete: fn || !fn && easing ||
-                               jQuery.isFunction( speed ) && speed,
-                       duration: speed,
-                       easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
-               };
-
-               opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
-                       jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
-
-               // Queueing
-               opt.old = opt.complete;
-               opt.complete = function(){
-                       if ( opt.queue !== false )
-                               jQuery(this).dequeue();
-                       if ( jQuery.isFunction( opt.old ) )
-                               opt.old.call( this );
-               };
-
-               return opt;
-       },
-
-       easing: {
-               linear: function( p, n, firstNum, diff ) {
-                       return firstNum + diff * p;
-               },
-               swing: function( p, n, firstNum, diff ) {
-                       return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
-               }
-       },
-
-       timers: [],
-
-       fx: function( elem, options, prop ){
-               this.options = options;
-               this.elem = elem;
-               this.prop = prop;
-
-               if ( !options.orig )
-                       options.orig = {};
-       }
-
-});
-
-jQuery.fx.prototype = {
-
-       // Simple function for setting a style value
-       update: function(){
-               if ( this.options.step )
-                       this.options.step.call( this.elem, this.now, this );
-
-               (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
-
-               // Set display property to block for height/width animations
-               if ( ( this.prop == "height" || this.prop == "width" ) && this.elem.style )
-                       this.elem.style.display = "block";
-       },
-
-       // Get the current size
-       cur: function(force){
-               if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) )
-                       return this.elem[ this.prop ];
-
-               var r = parseFloat(jQuery.css(this.elem, this.prop, force));
-               return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
-       },
-
-       // Start an animation from one number to another
-       custom: function(from, to, unit){
-               this.startTime = now();
-               this.start = from;
-               this.end = to;
-               this.unit = unit || this.unit || "px";
-               this.now = this.start;
-               this.pos = this.state = 0;
-
-               var self = this;
-               function t(gotoEnd){
-                       return self.step(gotoEnd);
-               }
-
-               t.elem = this.elem;
-
-               if ( t() && jQuery.timers.push(t) && !timerId ) {
-                       timerId = setInterval(function(){
-                               var timers = jQuery.timers;
-
-                               for ( var i = 0; i < timers.length; i++ )
-                                       if ( !timers[i]() )
-                                               timers.splice(i--, 1);
-
-                               if ( !timers.length ) {
-                                       clearInterval( timerId );
-                                       timerId = undefined;
-                               }
-                       }, 13);
-               }
-       },
-
-       // Simple 'show' function
-       show: function(){
-               // Remember where we started, so that we can go back to it later
-               this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
-               this.options.show = true;
-
-               // Begin the animation
-               // Make sure that we start at a small width/height to avoid any
-               // flash of content
-               this.custom(this.prop == "width" || this.prop == "height" ? 1 : 0, this.cur());
-
-               // Start by showing the element
-               jQuery(this.elem).show();
-       },
-
-       // Simple 'hide' function
-       hide: function(){
-               // Remember where we started, so that we can go back to it later
-               this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
-               this.options.hide = true;
-
-               // Begin the animation
-               this.custom(this.cur(), 0);
-       },
-
-       // Each step of an animation
-       step: function(gotoEnd){
-               var t = now();
-
-               if ( gotoEnd || t >= this.options.duration + this.startTime ) {
-                       this.now = this.end;
-                       this.pos = this.state = 1;
-                       this.update();
-
-                       this.options.curAnim[ this.prop ] = true;
-
-                       var done = true;
-                       for ( var i in this.options.curAnim )
-                               if ( this.options.curAnim[i] !== true )
-                                       done = false;
-
-                       if ( done ) {
-                               if ( this.options.display != null ) {
-                                       // Reset the overflow
-                                       this.elem.style.overflow = this.options.overflow;
-
-                                       // Reset the display
-                                       this.elem.style.display = this.options.display;
-                                       if ( jQuery.css(this.elem, "display") == "none" )
-                                               this.elem.style.display = "block";
-                               }
-
-                               // Hide the element if the "hide" operation was done
-                               if ( this.options.hide )
-                                       jQuery(this.elem).hide();
-
-                               // Reset the properties, if the item has been hidden or shown
-                               if ( this.options.hide || this.options.show )
-                                       for ( var p in this.options.curAnim )
-                                               jQuery.attr(this.elem.style, p, this.options.orig[p]);
-                                       
-                               // Execute the complete function
-                               this.options.complete.call( this.elem );
-                       }
-
-                       return false;
-               } else {
-                       var n = t - this.startTime;
-                       this.state = n / this.options.duration;
-
-                       // Perform the easing function, defaults to swing
-                       this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
-                       this.now = this.start + ((this.end - this.start) * this.pos);
-
-                       // Perform the next step of the animation
-                       this.update();
-               }
-
-               return true;
-       }
-
-};
-
-jQuery.extend( jQuery.fx, {
-       speeds:{
-               slow: 600,
-               fast: 200,
-               // Default speed
-               _default: 400
-       },
-       step: {
-
-               opacity: function(fx){
-                       jQuery.attr(fx.elem.style, "opacity", fx.now);
-               },
-
-               _default: function(fx){
-                       if ( fx.elem.style && fx.elem.style[ fx.prop ] != null )
-                               fx.elem.style[ fx.prop ] = fx.now + fx.unit;
-                       else
-                               fx.elem[ fx.prop ] = fx.now;
-               }
-       }
-});
-if ( document.documentElement["getBoundingClientRect"] )
-       jQuery.fn.offset = function() {
-               if ( !this[0] ) return { top: 0, left: 0 };
-               if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] );
-               var box  = this[0].getBoundingClientRect(), doc = this[0].ownerDocument, body = doc.body, docElem = doc.documentElement,
-                       clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
-                       top  = box.top  + (self.pageYOffset || jQuery.boxModel && docElem.scrollTop  || body.scrollTop ) - clientTop,
-                       left = box.left + (self.pageXOffset || jQuery.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
-               return { top: top, left: left };
-       };
-else 
-       jQuery.fn.offset = function() {
-               if ( !this[0] ) return { top: 0, left: 0 };
-               if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] );
-               jQuery.offset.initialized || jQuery.offset.initialize();
-
-               var elem = this[0], offsetParent = elem.offsetParent, prevOffsetParent = elem,
-                       doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
-                       body = doc.body, defaultView = doc.defaultView,
-                       prevComputedStyle = defaultView.getComputedStyle(elem, null),
-                       top = elem.offsetTop, left = elem.offsetLeft;
-
-               while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
-                       computedStyle = defaultView.getComputedStyle(elem, null);
-                       top -= elem.scrollTop, left -= elem.scrollLeft;
-                       if ( elem === offsetParent ) {
-                               top += elem.offsetTop, left += elem.offsetLeft;
-                               if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.tagName)) )
-                                       top  += parseInt( computedStyle.borderTopWidth,  10) || 0,
-                                       left += parseInt( computedStyle.borderLeftWidth, 10) || 0;
-                               prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
-                       }
-                       if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" )
-                               top  += parseInt( computedStyle.borderTopWidth,  10) || 0,
-                               left += parseInt( computedStyle.borderLeftWidth, 10) || 0;
-                       prevComputedStyle = computedStyle;
-               }
-
-               if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" )
-                       top  += body.offsetTop,
-                       left += body.offsetLeft;
-
-               if ( prevComputedStyle.position === "fixed" )
-                       top  += Math.max(docElem.scrollTop, body.scrollTop),
-                       left += Math.max(docElem.scrollLeft, body.scrollLeft);
-
-               return { top: top, left: left };
-       };
-
-jQuery.offset = {
-       initialize: function() {
-               if ( this.initialized ) return;
-               var body = document.body, container = document.createElement('div'), innerDiv, checkDiv, table, td, rules, prop, bodyMarginTop = body.style.marginTop,
-                       html = '<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';
-
-               rules = { position: 'absolute', top: 0, left: 0, margin: 0, border: 0, width: '1px', height: '1px', visibility: 'hidden' };
-               for ( prop in rules ) container.style[prop] = rules[prop];
-
-               container.innerHTML = html;
-               body.insertBefore(container, body.firstChild);
-               innerDiv = container.firstChild, checkDiv = innerDiv.firstChild, td = innerDiv.nextSibling.firstChild.firstChild;
-
-               this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
-               this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
-
-               innerDiv.style.overflow = 'hidden', innerDiv.style.position = 'relative';
-               this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
-
-               body.style.marginTop = '1px';
-               this.doesNotIncludeMarginInBodyOffset = (body.offsetTop === 0);
-               body.style.marginTop = bodyMarginTop;
-
-               body.removeChild(container);
-               this.initialized = true;
-       },
-
-       bodyOffset: function(body) {
-               jQuery.offset.initialized || jQuery.offset.initialize();
-               var top = body.offsetTop, left = body.offsetLeft;
-               if ( jQuery.offset.doesNotIncludeMarginInBodyOffset )
-                       top  += parseInt( jQuery.curCSS(body, 'marginTop',  true), 10 ) || 0,
-                       left += parseInt( jQuery.curCSS(body, 'marginLeft', true), 10 ) || 0;
-               return { top: top, left: left };
-       }
-};
-
-
-jQuery.fn.extend({
-       position: function() {
-               var left = 0, top = 0, results;
-
-               if ( this[0] ) {
-                       // Get *real* offsetParent
-                       var offsetParent = this.offsetParent(),
-
-                       // Get correct offsets
-                       offset       = this.offset(),
-                       parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset();
-
-                       // Subtract element margins
-                       // note: when an element has margin: auto the offsetLeft and marginLeft 
-                       // are the same in Safari causing offset.left to incorrectly be 0
-                       offset.top  -= num( this, 'marginTop'  );
-                       offset.left -= num( this, 'marginLeft' );
-
-                       // Add offsetParent borders
-                       parentOffset.top  += num( offsetParent, 'borderTopWidth'  );
-                       parentOffset.left += num( offsetParent, 'borderLeftWidth' );
-
-                       // Subtract the two offsets
-                       results = {
-                               top:  offset.top  - parentOffset.top,
-                               left: offset.left - parentOffset.left
-                       };
-               }
-
-               return results;
-       },
-
-       offsetParent: function() {
-               var offsetParent = this[0].offsetParent || document.body;
-               while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static') )
-                       offsetParent = offsetParent.offsetParent;
-               return jQuery(offsetParent);
-       }
-});
-
-
-// Create scrollLeft and scrollTop methods
-jQuery.each( ['Left', 'Top'], function(i, name) {
-       var method = 'scroll' + name;
-       
-       jQuery.fn[ method ] = function(val) {
-               if (!this[0]) return null;
-
-               return val !== undefined ?
-
-                       // Set the scroll offset
-                       this.each(function() {
-                               this == window || this == document ?
-                                       window.scrollTo(
-                                               !i ? val : jQuery(window).scrollLeft(),
-                                                i ? val : jQuery(window).scrollTop()
-                                       ) :
-                                       this[ method ] = val;
-                       }) :
-
-                       // Return the scroll offset
-                       this[0] == window || this[0] == document ?
-                               self[ i ? 'pageYOffset' : 'pageXOffset' ] ||
-                                       jQuery.boxModel && document.documentElement[ method ] ||
-                                       document.body[ method ] :
-                               this[0][ method ];
-       };
-});
-// Create innerHeight, innerWidth, outerHeight and outerWidth methods
-jQuery.each([ "Height", "Width" ], function(i, name){
-
-       var tl = i ? "Left"  : "Top",  // top or left
-               br = i ? "Right" : "Bottom", // bottom or right
-               lower = name.toLowerCase();
-
-       // innerHeight and innerWidth
-       jQuery.fn["inner" + name] = function(){
-               return this[0] ?
-                       jQuery.css( this[0], lower, false, "padding" ) :
-                       null;
-       };
-
-       // outerHeight and outerWidth
-       jQuery.fn["outer" + name] = function(margin) {
-               return this[0] ?
-                       jQuery.css( this[0], lower, false, margin ? "margin" : "border" ) :
-                       null;
-       };
-       
-       var type = name.toLowerCase();
-
-       jQuery.fn[ type ] = function( size ) {
-               // Get window width or height
-               return this[0] == window ?
-                       // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
-                       document.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] ||
-                       document.body[ "client" + name ] :
-
-                       // Get document width or height
-                       this[0] == document ?
-                               // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
-                               Math.max(
-                                       document.documentElement["client" + name],
-                                       document.body["scroll" + name], document.documentElement["scroll" + name],
-                                       document.body["offset" + name], document.documentElement["offset" + name]
-                               ) :
-
-                               // Get or set width or height on the element
-                               size === undefined ?
-                                       // Get width or height on the element
-                                       (this.length ? jQuery.css( this[0], type ) : null) :
-
-                                       // Set the width or height on the element (default to pixels if value is unitless)
-                                       this.css( type, typeof size === "string" ? size : size + "px" );
-       };
-
-});
-})();
diff --git a/platforma/static/js/lib/jquery.json.js b/platforma/static/js/lib/jquery.json.js
deleted file mode 100644 (file)
index 87f5d01..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * jQuery JSON Plugin
- * version: 2.1 (2009-08-14)
- *
- * This document is licensed as free software under the terms of the
- * MIT License: http://www.opensource.org/licenses/mit-license.php
- *
- * Brantley Harris wrote this plugin. It is based somewhat on the JSON.org 
- * website's http://www.json.org/json2.js, which proclaims:
- * "NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.", a sentiment that
- * I uphold.
- *
- * It is also influenced heavily by MochiKit's serializeJSON, which is 
- * copyrighted 2005 by Bob Ippolito.
- */
-(function($) {
-    /** jQuery.toJSON( json-serializble )
-        Converts the given argument into a JSON respresentation.
-
-        If an object has a "toJSON" function, that will be used to get the representation.
-        Non-integer/string keys are skipped in the object, as are keys that point to a function.
-
-        json-serializble:
-            The *thing* to be converted.
-     **/
-    $.toJSON = function(o)
-    {
-        if (typeof(JSON) == 'object' && JSON.stringify)
-            return JSON.stringify(o);
-        
-        var type = typeof(o);
-    
-        if (o === null)
-            return "null";
-    
-        if (type == "undefined")
-            return undefined;
-        
-        if (type == "number" || type == "boolean")
-            return o + "";
-    
-        if (type == "string")
-            return $.quoteString(o);
-    
-        if (type == 'object')
-        {
-            if (typeof o.toJSON == "function") 
-                return $.toJSON( o.toJSON() );
-            
-            if (o.constructor === Date)
-            {
-                var month = o.getUTCMonth() + 1;
-                if (month < 10) month = '0' + month;
-
-                var day = o.getUTCDate();
-                if (day < 10) day = '0' + day;
-
-                var year = o.getUTCFullYear();
-                
-                var hours = o.getUTCHours();
-                if (hours < 10) hours = '0' + hours;
-                
-                var minutes = o.getUTCMinutes();
-                if (minutes < 10) minutes = '0' + minutes;
-                
-                var seconds = o.getUTCSeconds();
-                if (seconds < 10) seconds = '0' + seconds;
-                
-                var milli = o.getUTCMilliseconds();
-                if (milli < 100) milli = '0' + milli;
-                if (milli < 10) milli = '0' + milli;
-
-                return '"' + year + '-' + month + '-' + day + 'T' +
-                             hours + ':' + minutes + ':' + seconds + 
-                             '.' + milli + 'Z"'; 
-            }
-
-            if (o.constructor === Array) 
-            {
-                var ret = [];
-                for (var i = 0; i < o.length; i++)
-                    ret.push( $.toJSON(o[i]) || "null" );
-
-                return "[" + ret.join(",") + "]";
-            }
-        
-            var pairs = [];
-            for (var k in o) {
-                var name;
-                var type = typeof k;
-
-                if (type == "number")
-                    name = '"' + k + '"';
-                else if (type == "string")
-                    name = $.quoteString(k);
-                else
-                    continue;  //skip non-string or number keys
-            
-                if (typeof o[k] == "function") 
-                    continue;  //skip pairs where the value is a function.
-            
-                var val = $.toJSON(o[k]);
-            
-                pairs.push(name + ":" + val);
-            }
-
-            return "{" + pairs.join(", ") + "}";
-        }
-    };
-
-    /** jQuery.evalJSON(src)
-        Evaluates a given piece of json source.
-     **/
-    $.evalJSON = function(src)
-    {
-        if (typeof(JSON) == 'object' && JSON.parse)
-            return JSON.parse(src);
-        return eval("(" + src + ")");
-    };
-    
-    /** jQuery.secureEvalJSON(src)
-        Evals JSON in a way that is *more* secure.
-    **/
-    $.secureEvalJSON = function(src)
-    {
-        if (typeof(JSON) == 'object' && JSON.parse)
-            return JSON.parse(src);
-        
-        var filtered = src;
-        filtered = filtered.replace(/\\["\\\/bfnrtu]/g, '@');
-        filtered = filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']');
-        filtered = filtered.replace(/(?:^|:|,)(?:\s*\[)+/g, '');
-        
-        if (/^[\],:{}\s]*$/.test(filtered))
-            return eval("(" + src + ")");
-        else
-            throw new SyntaxError("Error parsing JSON, source is not valid.");
-    };
-
-    /** jQuery.quoteString(string)
-        Returns a string-repr of a string, escaping quotes intelligently.  
-        Mostly a support function for toJSON.
-    
-        Examples:
-            >>> jQuery.quoteString("apple")
-            "apple"
-        
-            >>> jQuery.quoteString('"Where are we going?", she asked.')
-            "\"Where are we going?\", she asked."
-     **/
-    $.quoteString = function(string)
-    {
-        if (string.match(_escapeable))
-        {
-            return '"' + string.replace(_escapeable, function (a) 
-            {
-                var c = _meta[a];
-                if (typeof c === 'string') return c;
-                c = a.charCodeAt();
-                return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
-            }) + '"';
-        }
-        return '"' + string + '"';
-    };
-    
-    var _escapeable = /["\\\x00-\x1f\x7f-\x9f]/g;
-    
-    var _meta = {
-        '\b': '\\b',
-        '\t': '\\t',
-        '\n': '\\n',
-        '\f': '\\f',
-        '\r': '\\r',
-        '"' : '\\"',
-        '\\': '\\\\'
-    };
-})(jQuery);
diff --git a/platforma/static/js/lib/jquery.lazyload.js b/platforma/static/js/lib/jquery.lazyload.js
deleted file mode 100644 (file)
index c15167b..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-(function($) {
-    jQuery.fn.lazyload = function(pattern, options) {
-        var settings = {
-            threshold: 0,
-            scrollThreshold: 300,
-            placeholder: 'loading...',
-            checkInterval: 2000
-        };
-        
-        if (options) {
-            $.extend(settings, options);
-        }
-        
-        var container = this;
-        container.data('lazyload:lastCheckedScrollTop', -10000);
-        
-        function aboveViewport(container, element, threshold) {
-            return $(container).offset().top >= $(element).offset().top + $(element).height() + threshold;
-        }
-        
-        function belowViewport(container, element, threshold) {
-            return $(container).offset().top + $(container).height() + threshold <= $(element).offset().top;
-        }
-        
-        function checkScroll() {
-            if (container.data('lazyload:lastCheckedScrollTop') == undefined) {
-                return;
-            }
-            if (Math.abs(container.scrollTop() - container.data('lazyload:lastCheckedScrollTop')) > settings.scrollThreshold) {
-                container.data('lazyload:lastCheckedScrollTop', container.scrollTop());
-                
-                $(pattern, container).each(function() {
-                    if (aboveViewport(container, this, settings.threshold)
-                        || belowViewport(container, this, settings.threshold)) {
-                        $(this).html(settings.placeholder);
-                    } else {
-                        $(this).html('');
-                        var self = this;
-                        $('<img src="' + $(this).attr('src') + '" width="' + $(this).width() + '" />').load(function() {
-                            if ($(this).height() > $(self).height()) {
-                                $(self).height($(this).height());
-                            }
-                        }).appendTo(this);
-                    }
-                })
-            }
-            setTimeout(checkScroll, settings.checkInterval);
-        }
-        
-        checkScroll();
-    };
-})(jQuery);
diff --git a/platforma/static/js/lib/jquery.logging.js b/platforma/static/js/lib/jquery.logging.js
deleted file mode 100644 (file)
index d6cee14..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-(function($) {
-       var LEVEL_DEBUG = 1;
-       var LEVEL_INFO = 2;
-       var LEVEL_WARN = 3;
-       var LOG_LEVEL = LEVEL_DEBUG;
-       
-        var standardLog = function() {
-            if (window.console)
-                console.log.apply(console, arguments);
-        };
-    
-       var operaLog = function() {
-               opera.postError(arguments.join(' '));
-       };
-
-        var msieLog = function() {
-            var args = $.makeArray(arguments);
-            var vals = $.map(args, function(n) {
-                try {
-                    return JSON.stringify(n);
-                } catch(e) {
-                    return ('' + n);
-                }
-            });
-
-            if (window.console)
-                console.log(vals.join(" "));
-        };
-
-       $.log = function() {
-               return $.log.browserLog.apply(this, arguments);
-       };
-
-        if($.browser.opera)
-            $.log.browserLog = operaLog;
-        else if($.browser.msie)
-            $.log.browserLog = msieLog;
-        else
-            $.log.browserLog = standardLog;
-
-})(jQuery);
diff --git a/platforma/static/js/lib/jquery.modal.js b/platforma/static/js/lib/jquery.modal.js
deleted file mode 100644 (file)
index 3aac816..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * jqModal - Minimalist Modaling with jQuery
- *   (http://dev.iceburg.net/jquery/jqModal/)
- *
- * Copyright (c) 2007,2008 Brice Burgess <bhb@iceburg.net>
- * Dual licensed under the MIT and GPL licenses:
- *   http://www.opensource.org/licenses/mit-license.php
- *   http://www.gnu.org/licenses/gpl.html
- * 
- * $Version: 03/01/2009 +r14
- */
-(function($) {
-$.fn.jqm=function(o){
-var p={
-overlay: 50,
-overlayClass: 'jqmOverlay',
-closeClass: 'jqmClose',
-trigger: '.jqModal',
-ajax: F,
-ajaxText: '',
-target: F,
-modal: F,
-toTop: F,
-onShow: F,
-onHide: F,
-onLoad: F
-};
-return this.each(function(){if(this._jqm)return H[this._jqm].c=$.extend({},H[this._jqm].c,o);s++;this._jqm=s;
-H[s]={c:$.extend(p,$.jqm.params,o),a:F,w:$(this).addClass('jqmID'+s),s:s};
-if(p.trigger)$(this).jqmAddTrigger(p.trigger);
-});};
-
-$.fn.jqmAddClose=function(e){return hs(this,e,'jqmHide');};
-$.fn.jqmAddTrigger=function(e){return hs(this,e,'jqmShow');};
-$.fn.jqmShow=function(t){return this.each(function(){t=t||window.event;$.jqm.open(this._jqm,t);});};
-$.fn.jqmHide=function(t){return this.each(function(){t=t||window.event;$.jqm.close(this._jqm,t)});};
-
-$.jqm = {
-hash:{},
-open:function(s,t){var h=H[s],c=h.c,cc='.'+c.closeClass,z=(parseInt(h.w.css('z-index'))),z=(z>0)?z:3000,o=$('<div></div>').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-1,opacity:c.overlay/100});if(h.a)return F;h.t=t;h.a=true;h.w.css('z-index',z);
- if(c.modal) {if(!A[0])L('bind');A.push(s);}
- else if(c.overlay > 0)h.w.jqmAddClose(o);
- else o=F;
-
- h.o=(o)?o.addClass(c.overlayClass).prependTo('body'):F;
- if(ie6){$('html,body').css({height:'100%',width:'100%'});if(o){o=o.css({position:'absolute'})[0];for(var y in {Top:1,Left:1})o.style.setExpression(y.toLowerCase(),"(_=(document.documentElement.scroll"+y+" || document.body.scroll"+y+"))+'px'");}}
-
- if(c.ajax) {var r=c.target||h.w,u=c.ajax,r=(typeof r == 'string')?$(r,h.w):$(r),u=(u.substr(0,1) == '@')?$(t).attr(u.substring(1)):u;
-  r.html(c.ajaxText).load(u,function(){if(c.onLoad)c.onLoad.call(this,h);if(cc)h.w.jqmAddClose($(cc,h.w));e(h);});}
- else if(cc)h.w.jqmAddClose($(cc,h.w));
-
- if(c.toTop&&h.o)h.w.before('<span id="jqmP'+h.w[0]._jqm+'"></span>').insertAfter(h.o);        
- (c.onShow)?c.onShow(h):h.w.show();e(h);return F;
-},
-close:function(s){var h=H[s];if(!h.a)return F;h.a=F;
- if(A[0]){A.pop();if(!A[0])L('unbind');}
- if(h.c.toTop&&h.o)$('#jqmP'+h.w[0]._jqm).after(h.w).remove();
- if(h.c.onHide)h.c.onHide(h);else{h.w.hide();if(h.o)h.o.remove();} return F;
-},
-params:{}};
-var s=0,H=$.jqm.hash,A=[],ie6=$.browser.msie&&($.browser.version == "6.0"),F=false,
-i=$('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0}),
-e=function(h){if(ie6)if(h.o)h.o.html('<p style="width:100%;height:100%"/>').prepend(i);else if(!$('iframe.jqm',h.w)[0])h.w.prepend(i); f(h);},
-f=function(h){try{$(':input:visible',h.w)[0].focus();}catch(_){}},
-L=function(t){$()[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m);},
-m=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);if(r)f(h);return !r;},
-hs=function(w,t,c){return w.each(function(){var s=this._jqm;$(t).each(function() {
- if(!this[c]){this[c]=[];$(this).click(function(){for(var i in {jqmShow:1,jqmHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return F;});}this[c].push(s);});});};
-})(jQuery);
\ No newline at end of file
diff --git a/platforma/static/js/lib/jquery.splitter.js b/platforma/static/js/lib/jquery.splitter.js
deleted file mode 100644 (file)
index d8888c3..0000000
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * jQuery.splitter.js - two-pane splitter window plugin
- *
- * version 1.51 (2009/01/09) 
- * 
- * Dual licensed under the MIT and GPL licenses: 
- *   http://www.opensource.org/licenses/mit-license.php 
- *   http://www.gnu.org/licenses/gpl.html 
- */
-
-/**
- * The splitter() plugin implements a two-pane resizable splitter window.
- * The selected elements in the jQuery object are converted to a splitter;
- * each selected element should have two child elements, used for the panes
- * of the splitter. The plugin adds a third child element for the splitbar.
- * 
- * For more details see: http://methvin.com/splitter/
- *
- *
- * @example $('#MySplitter').splitter();
- * @desc Create a vertical splitter with default settings 
- *
- * @example $('#MySplitter').splitter({type: 'h', accessKey: 'M'});
- * @desc Create a horizontal splitter resizable via Alt+Shift+M
- *
- * @name splitter
- * @type jQuery
- * @param Object options Options for the splitter (not required)
- * @cat Plugins/Splitter
- * @return jQuery
- * @author Dave Methvin (dave.methvin@gmail.com)
- */
- ;(function($){
- $.fn.splitter = function(args){
-       args = args || {};
-       return this.each(function() {
-               var zombie;             // left-behind splitbar for outline resizes
-               function startSplitMouse(evt) {
-                       if ( opts.outline )
-                               zombie = zombie || bar.clone(false).insertAfter(A);
-                       panes.css("-webkit-user-select", "none");       // Safari selects A/B text on a move
-                       bar.addClass(opts.activeClass);
-                       A._posSplit = A[0][opts.pxSplit] - evt[opts.eventPos];
-                       $(document)
-                               .bind("mousemove", doSplitMouse)
-                               .bind("mouseup", endSplitMouse);
-               }
-               function doSplitMouse(evt) {
-                       var newPos = A._posSplit+evt[opts.eventPos];
-                       if ( opts.outline ) {
-                               newPos = Math.max(0, Math.min(newPos, splitter._DA - bar._DA));
-                               bar.css(opts.origin, newPos);
-                       } else 
-                               resplit(newPos);
-               }
-               function endSplitMouse(evt) {
-                       bar.removeClass(opts.activeClass);
-                       var newPos = A._posSplit+evt[opts.eventPos];
-                       if ( opts.outline ) {
-                               zombie.remove(); zombie = null;
-                               resplit(newPos);
-                       }
-                       panes.css("-webkit-user-select", "text");       // let Safari select text again
-                       $(document)
-                               .unbind("mousemove", doSplitMouse)
-                               .unbind("mouseup", endSplitMouse);
-               }
-               function resplit(newPos) {
-                       // Constrain new splitbar position to fit pane size limits
-                       newPos = Math.max(A._min, splitter._DA - B._max, 
-                                       Math.min(newPos, A._max, splitter._DA - bar._DA - B._min));
-                       // Resize/position the two panes
-                       bar._DA = bar[0][opts.pxSplit];         // bar size may change during dock
-                       bar.css(opts.origin, newPos).css(opts.fixed, splitter._DF);
-                       A.css(opts.origin, 0).css(opts.split, newPos).css(opts.fixed,  splitter._DF);
-                       B.css(opts.origin, newPos+bar._DA)
-                               .css(opts.split, splitter._DA-bar._DA-newPos).css(opts.fixed,  splitter._DF);
-                       // IE fires resize for us; all others pay cash
-                       if ( !$.browser.msie )
-                               panes.trigger("resize");
-               }
-               function dimSum(jq, dims) {
-                       // Opera returns -1 for missing min/max width, turn into 0
-                       var sum = 0;
-                       for ( var i=1; i < arguments.length; i++ )
-                               sum += Math.max(parseInt(jq.css(arguments[i])) || 0, 0);
-                       return sum;
-               }
-               
-               // Determine settings based on incoming opts, element classes, and defaults
-               var vh = (args.splitHorizontal? 'h' : args.splitVertical? 'v' : args.type) || 'v';
-               var opts = $.extend({
-                       activeClass: 'active',  // class name for active splitter
-                       pxPerKey: 8,                    // splitter px moved per keypress
-                       tabIndex: 0,                    // tab order indicator
-                       accessKey: ''                   // accessKey for splitbar
-               },{
-                       v: {                                    // Vertical splitters:
-                               keyLeft: 39, keyRight: 37, cursor: "e-resize",
-                               splitbarClass: "vsplitbar", outlineClass: "voutline",
-                               type: 'v', eventPos: "pageX", origin: "left",
-                               split: "width",  pxSplit: "offsetWidth",  side1: "Left", side2: "Right",
-                               fixed: "height", pxFixed: "offsetHeight", side3: "Top",  side4: "Bottom"
-                       },
-                       h: {                                    // Horizontal splitters:
-                               keyTop: 40, keyBottom: 38,  cursor: "n-resize",
-                               splitbarClass: "hsplitbar", outlineClass: "houtline",
-                               type: 'h', eventPos: "pageY", origin: "top",
-                               split: "height", pxSplit: "offsetHeight", side1: "Top",  side2: "Bottom",
-                               fixed: "width",  pxFixed: "offsetWidth",  side3: "Left", side4: "Right"
-                       }
-               }[vh], args);
-
-               // Create jQuery object closures for splitter and both panes
-               var splitter = $(this).css({position: "relative"});
-               var panes = $(">*", splitter[0]).css({
-                       position: "absolute",                   // positioned inside splitter container
-                       "z-index": "1",                                 // splitbar is positioned above
-                       "-moz-outline-style": "none"    // don't show dotted outline
-               });
-               var A = $(panes[0]);            // left  or top
-               var B = $(panes[1]);            // right or bottom
-
-               // Focuser element, provides keyboard support; title is shown by Opera accessKeys
-               var focuser = $('<a href="javascript:void(0)"></a>')
-                       .attr({accessKey: opts.accessKey, tabIndex: opts.tabIndex, title: opts.splitbarClass})
-                       .bind($.browser.opera?"click":"focus", function(){ this.focus(); bar.addClass(opts.activeClass) })
-                       .bind("keydown", function(e){
-                               var key = e.which || e.keyCode;
-                               var dir = key==opts["key"+opts.side1]? 1 : key==opts["key"+opts.side2]? -1 : 0;
-                               if ( dir )
-                                       resplit(A[0][opts.pxSplit]+dir*opts.pxPerKey, false);
-                       })
-                       .bind("blur", function(){ bar.removeClass(opts.activeClass) });
-                       
-               // Splitbar element, can be already in the doc or we create one
-               var bar = $(panes[2] || '<div></div>')
-                       .insertAfter(A).css("z-index", "100").append(focuser)
-                       .attr({"class": opts.splitbarClass, unselectable: "on"})
-                       .css({position: "absolute",     "user-select": "none", "-webkit-user-select": "none",
-                               "-khtml-user-select": "none", "-moz-user-select": "none"})
-                       .bind("mousedown", startSplitMouse);
-               // Use our cursor unless the style specifies a non-default cursor
-               if ( /^(auto|default|)$/.test(bar.css("cursor")) )
-                       bar.css("cursor", opts.cursor);
-
-               // Cache several dimensions for speed, rather than re-querying constantly
-               bar._DA = bar[0][opts.pxSplit];
-               splitter._PBF = $.boxModel? dimSum(splitter, "border"+opts.side3+"Width", "border"+opts.side4+"Width") : 0;
-               splitter._PBA = $.boxModel? dimSum(splitter, "border"+opts.side1+"Width", "border"+opts.side2+"Width") : 0;
-               A._pane = opts.side1;
-               B._pane = opts.side2;
-               $.each([A,B], function(){
-                       this._min = opts["min"+this._pane] || dimSum(this, "min-"+opts.split);
-                       this._max = opts["max"+this._pane] || dimSum(this, "max-"+opts.split) || 9999;
-                       this._init = opts["size"+this._pane]===true ?
-                               parseInt($.curCSS(this[0],opts.split)) : opts["size"+this._pane];
-               });
-               
-               // Determine initial position, get from cookie if specified
-               var initPos = A._init;
-               if ( !isNaN(B._init) )  // recalc initial B size as an offset from the top or left side
-                       initPos = splitter[0][opts.pxSplit] - splitter._PBA - B._init - bar._DA;
-               if ( opts.cookie ) {
-                       if ( !$.cookie )
-                               alert('jQuery.splitter(): jQuery cookie plugin required');
-                       var ckpos = parseInt($.cookie(opts.cookie));
-                       if ( !isNaN(ckpos) )
-                               initPos = ckpos;
-                       $(window).bind("unload", function(){
-                               var state = String(bar.css(opts.origin));       // current location of splitbar
-                               $.cookie(opts.cookie, state, {expires: opts.cookieExpires || 365, 
-                                       path: opts.cookiePath || document.location.pathname});
-                       });
-               }
-               if ( isNaN(initPos) )   // King Solomon's algorithm
-                       initPos = Math.round((splitter[0][opts.pxSplit] - splitter._PBA - bar._DA)/2);
-
-               // Resize event propagation and splitter sizing
-               if ( opts.anchorToWindow ) {
-                       // Account for margin or border on the splitter container and enforce min height
-                       splitter._hadjust = dimSum(splitter, "borderTopWidth", "borderBottomWidth", "marginBottom");
-                       splitter._hmin = Math.max(dimSum(splitter, "minHeight"), 20);
-                       $(window).bind("resize", function(){
-                               var top = splitter.offset().top;
-                               var wh = $(window).height();
-                               splitter.css("height", Math.max(wh-top-splitter._hadjust, splitter._hmin)+"px");
-                               if ( !$.browser.msie ) splitter.trigger("resize");
-                       }).trigger("resize");
-               }
-               else if ( opts.resizeToWidth && !$.browser.msie )
-                       $(window).bind("resize", function(){
-                               splitter.trigger("resize"); 
-                       });
-
-               // Resize event handler; triggered immediately to set initial position
-               splitter.bind("resize", function(e, size){
-                       // Custom events bubble in jQuery 1.3; don't Yo Dawg
-                       if ( e.target != this ) return;
-                       // Determine new width/height of splitter container
-                       splitter._DF = splitter[0][opts.pxFixed] - splitter._PBF;
-                       splitter._DA = splitter[0][opts.pxSplit] - splitter._PBA;
-                       // Bail if splitter isn't visible or content isn't there yet
-                       if ( splitter._DF <= 0 || splitter._DA <= 0 ) return;
-                       // Re-divvy the adjustable dimension; maintain size of the preferred pane
-                       resplit(!isNaN(size)? size : (!(opts.sizeRight||opts.sizeBottom)? A[0][opts.pxSplit] :
-                               splitter._DA-B[0][opts.pxSplit]-bar._DA));
-               }).trigger("resize" , [initPos]);
-       });
-};
-
-})(jQuery);
\ No newline at end of file
diff --git a/platforma/static/js/lib/jquery.wtooltip.js b/platforma/static/js/lib/jquery.wtooltip.js
deleted file mode 100644 (file)
index 01233ba..0000000
+++ /dev/null
@@ -1,234 +0,0 @@
-/* Wayfarer Tooltip\r
- * Version 1.0.4\r
- * Author Abel Mohler\r
- * URI: http://www.wayfarerweb.com/wtooltip.php\r
- * Released with the MIT License: http://www.wayfarerweb.com/mit.php\r
- */\r
-(function($){ //jQuery.noConflict()compliant\r
-    $.fn.wTooltip = function(o, callback){\r
-        o = $.extend({ //defaults, can be overidden\r
-            content: null, //string content for tooltip.\r
-            ajax: null, //path to content for tooltip\r
-            follow: true, //does tooltip follow the cursor?\r
-            auto: true, //If false, tooltip won't automatically transition, it must be manually shown/hidden\r
-            fadeIn: 0, //fade in, in milliseconds ("fast, "slow", etc may also be used)\r
-            fadeOut: 0, //fade out, in milliseconds ("fast, "slow", etc may also be used)\r
-            appendTip: document.body, //should probably not need to be overridden\r
-            degrade: false, //if true, in IE6 tooltip will degrade to a title attribute message\r
-            offsetY: 10, //offsetY and offsetX properties designate position from the cursor\r
-            offsetX: 1,\r
-            style: {},\r
-            className: null, //to style the tooltip externally, pass a className or id\r
-            id: null,\r
-            callBefore: function(tooltip, node, settings){\r
-            }, //called when mouse enters the area\r
-            callAfter: function(tooltip, node, settings){\r
-            }, //called when mouse leaves the area (same as "callback" option)\r
-            clickAction: function(tooltip, node){\r
-                $(tooltip).hide();\r
-            }, //called when the element is clicked, with access to tooltip\r
-            delay: 0, //delay (in milliseconds)before tooltip appears and callBefore executes\r
-            timeout: 0, //delay (in milliseconds)before tooltip transitions away, and callAfter executes\r
-            cloneable: false //UNWORKING.  Requires $().wClone plugin. If true, tooltip may be dragged and placed anywhere on the screen.\r
-        }, o ||\r
-        {});\r
-        \r
-        if (!o.style && typeof o.style != "object") {\r
-            o.style = {};\r
-            o.style.zIndex = "1000";\r
-        }\r
-        else {\r
-            o.style = $.extend({ //the default style rules of the tooltip\r
-                border: "1px solid gray",\r
-                background: "#edeef0",\r
-                color: "#000",\r
-                padding: "10px",\r
-                zIndex: "1000",\r
-                textAlign: "left"\r
-            }, o.style ||\r
-            {});\r
-        }\r
-        \r
-        if (typeof callback == "function") \r
-            o.callAfter = callback || o.callAfter;\r
-        \r
-        o.style.display = "none", o.style.position = "absolute"; //permanent defaults\r
-        //private settings\r
-        var title, timeout, timeout2, iId, over = {}, firstMove = true, hovered = false, maxed = false, tooltip = document.createElement('div'), ie6 = (typeof document.body.style.maxWidth == "undefined") ? true : false, talk = (typeof $.talk == "function" && typeof $.listen == "function") ? true : false;\r
-        \r
-        if (o.id) \r
-            tooltip.id = o.id;\r
-        if (o.className) \r
-            tooltip.className = o.className;\r
-        \r
-        o.degrade = (o.degrade && ie6) ? true : false; //only degrades if also IE6\r
-        for (var p in o.style)//apply styles to tooltip\r
-             tooltip.style[p] = o.style[p];\r
-        \r
-        function fillTooltip(condition){\r
-            if (condition) {\r
-                if (o.degrade)//replace html characters for proper degradation to title attribute\r
-                    $(tooltip).html(o.content.replace(/<\/?[^>]+>/gi, ''));\r
-                else //otherwise just fill the tooltip with content\r
-                     $(tooltip).html(o.content);\r
-            }\r
-        }\r
-        \r
-        if (o.ajax) { //if o.ajax is selected, this will fill and thus override o.content\r
-            $.get(o.ajax, function(data){\r
-                if (data) \r
-                    o.content = data;\r
-                fillTooltip(o.content);\r
-            });\r
-        }\r
-        \r
-        function offConditions(that){\r
-            function _offActions(that){\r
-                if (title && !o.content) {\r
-                    that.title = title;\r
-                    title = null;\r
-                }\r
-            }\r
-            function _execute(){\r
-                if (!hovered && o.auto) {\r
-                    clearInterval(iId);\r
-                    if (o.fadeOut) {\r
-                        $(tooltip).fadeOut(o.fadeOut, function(){\r
-                            _offActions(that);\r
-                        });\r
-                    }\r
-                    else {\r
-                        _offActions(that);\r
-                        tooltip.style.display = "none";\r
-                    }\r
-                }\r
-                if (typeof o.callAfter == "function") \r
-                    o.callAfter(tooltip, that, o);\r
-                if (talk) \r
-                    o = $.listen(o);\r
-            }\r
-            if (o.timeout > 0) {\r
-                timeout2 = setTimeout(function(){\r
-                    _execute();\r
-                }, o.timeout);\r
-            }\r
-            else {\r
-                _execute();\r
-            }\r
-        }\r
-        \r
-        $(tooltip).hover(function(){\r
-            hovered = true;\r
-        }, function(){\r
-            hovered = false;\r
-            offConditions(over);\r
-        });\r
-        \r
-        //initialize\r
-        if (talk) { //A "channel" for plugins to "talk" to each other, and callbacks to manipulate settings\r
-            o.key = tooltip;\r
-            o.plugin = "wTooltip";\r
-            o.channel = "wayfarer";\r
-            $.talk(o);\r
-        }\r
-        \r
-        fillTooltip(o.content && !o.ajax);\r
-        $(tooltip).appendTo(o.appendTip);\r
-        \r
-        return this.each(function(){ //returns the element chain\r
-            this.onmouseover = function(ev){\r
-                var that = this;\r
-                clearTimeout(timeout2);\r
-                if (this.title && !o.degrade && !o.content) {\r
-                    title = this.title;\r
-                    this.title = "";\r
-                }\r
-                if (o.content && o.degrade) \r
-                    this.title = tooltip.innerHTML;\r
-                \r
-                function _execute(){\r
-                    if (typeof o.callBefore == "function") \r
-                        o.callBefore(tooltip, that, o);\r
-                    if (talk) \r
-                        o = $.listen(o); //ping for new settings\r
-                    if (o.auto) {\r
-                        var display;\r
-                        if (o.content) {\r
-                            if (!o.degrade) \r
-                                display = "block";\r
-                        }\r
-                        else \r
-                            if (title && !o.degrade) {\r
-                                $(tooltip).html(unescape(title));\r
-                                display = "block";\r
-                            }\r
-                            else {\r
-                                display = "none";\r
-                            }\r
-                        if (display == "block" && o.fadeIn) \r
-                            $(tooltip).fadeIn(o.fadeIn);\r
-                        else \r
-                            tooltip.style.display = display;\r
-                    }\r
-                }\r
-                \r
-                if (o.delay > 0) {\r
-                    timeout = setTimeout(function(){\r
-                        _execute();\r
-                    }, o.delay);\r
-                }\r
-                else {\r
-                    _execute();\r
-                }\r
-            }\r
-            \r
-            this.onmousemove = function(ev){\r
-                var e = (ev) ? ev : window.event, that = this;\r
-                over = this; //tracks the event trigger in the plugin-global "over"\r
-                if (o.follow || firstMove) {\r
-                    var scrollY = $(window).scrollTop(), scrollX = $(window).scrollLeft(), top = e.clientY + scrollY + o.offsetY, left = e.clientX + scrollX + o.offsetX, outerH = $(o.appendTip).outerHeight(), innerH = $(o.appendTip).innerHeight(), maxLeft = $(window).width() + scrollX - $(tooltip).outerWidth(), maxTop = $(window).height() + scrollY - $(tooltip).outerHeight();\r
-                    \r
-                    top = (outerH > innerH) ? top - (outerH - innerH) : top; //if appended area (usually BODY) has a border on top, adjust\r
-                    maxed = (top > maxTop || left > maxLeft) ? true : false;\r
-                    \r
-                    if (left - scrollX <= 0 && o.offsetX < 0) \r
-                        left = scrollX;\r
-                    else \r
-                        if (left > maxLeft) \r
-                            left = maxLeft;\r
-                    if (top - scrollY <= 0 && o.offsetY < 0) \r
-                        top = scrollY;\r
-                    else \r
-                        if (top > maxTop) \r
-                            top = maxTop;\r
-                    \r
-                    tooltip.style.top = top + "px";\r
-                    tooltip.style.left = left + "px";\r
-                    firstMove = false;\r
-                }\r
-            }\r
-            \r
-            this.onmouseout = function(){\r
-                clearTimeout(timeout);\r
-                var that = this;\r
-                firstMove = true;\r
-                if (!o.follow || maxed || (o.offsetX < 0 && o.offsetY < 0)) {\r
-                    setTimeout(function(){\r
-                        iId = setInterval(function(){\r
-                            offConditions(that)\r
-                        }, 1)\r
-                    }, 1);\r
-                }\r
-                else {\r
-                    offConditions(this);\r
-                }\r
-            }\r
-            \r
-            if (typeof o.clickAction == "function") {\r
-                this.onclick = function(){\r
-                    o.clickAction(tooltip, this);\r
-                }\r
-            }\r
-        });\r
-    }\r
-})(jQuery);
\ No newline at end of file
index c3e2e80..07c9f78 100644 (file)
@@ -4,7 +4,6 @@
     <head>
         <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
         <title>{% block title %}Platforma Redakcyjna{% block subtitle %}{% endblock subtitle %}{% endblock title%}</title>
     <head>
         <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
         <title>{% block title %}Platforma Redakcyjna{% block subtitle %}{% endblock subtitle %}{% endblock title%}</title>
-        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" type="text/javascript" charset="utf-8"></script>
         {% block extrahead %}
         {% endblock %}
     </head>
         {% block extrahead %}
         {% endblock %}
     </head>