diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..12e02c0 --- /dev/null +++ b/.babelrc @@ -0,0 +1,12 @@ +{ + "presets": [ + ["env", { + "targets": { + "chrome": 40, + "firefox": 35, + "edge": 14 + }, + "modules": false + }] + ] +} diff --git a/.gitignore b/.gitignore index 5019a4e..570ea49 100755 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ node_modules npm-debug.log -build/dev -build/test +build docs/* !docs/*.conf.json !docs/*.ico diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..2c6a3fc --- /dev/null +++ b/.travis.yml @@ -0,0 +1,32 @@ +language: node_js +node_js: + - node +install: npm install +before_script: + - npm install -g grunt +script: + - grunt lint + - grunt test + - grunt docs + - grunt node + - grunt prod +before_deploy: + - grunt copy:ghPages +deploy: + - provider: pages + skip_cleanup: true + github_token: $GITHUB_TOKEN + local_dir: build/prod/ + target_branch: gh-pages + on: + branch: master + - provider: releases + skip_cleaup: true + api_key: + secure: $GITHUB_API_KEY + file: + - build/prod/cyberchef.htm + - build/node/CyberChef.js + on: + repo: gchq/CyberChef + tags: true diff --git a/Gruntfile.js b/Gruntfile.js index af83ad9..82b4ca3 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,38 +1,40 @@ -/* eslint-env node */ +var webpack = require("webpack"), + ExtractTextPlugin = require("extract-text-webpack-plugin"), + HtmlWebpackPlugin = require("html-webpack-plugin"), + Inliner = require("web-resource-inliner"); -module.exports = function(grunt) { +module.exports = function (grunt) { grunt.file.defaultEncoding = "utf8"; grunt.file.preserveBOM = false; // Tasks grunt.registerTask("dev", "A persistent task which creates a development build whenever source files are modified.", - ["clean:dev", "concat:css", "concat:js", "copy:htmlDev", "copy:staticDev", "chmod:build", "watch"]); + ["clean:dev", "webpack:webDev"]); + + grunt.registerTask("node", + "Compiles CyberChef into a single NodeJS module.", + ["clean:node", "webpack:node", "chmod:build"]); grunt.registerTask("test", "A task which runs all the tests in test/tests.", - ["clean:test", "concat:jsTest", "copy:htmlTest", "chmod:build", "execute:test"]); - - grunt.registerTask("prod", - "Creates a production-ready build. Use the --msg flag to add a compile message.", - ["eslint", "exec:stats", "clean", "jsdoc", "concat", "copy:htmlDev", "copy:htmlProd", "copy:htmlInline", - "copy:staticDev", "copy:staticProd", "cssmin", "uglify:prod", "inline", "htmlmin", "chmod", "test"]); + ["clean:test", "webpack:tests", "execute:test"]); grunt.registerTask("docs", "Compiles documentation in the /docs directory.", ["clean:docs", "jsdoc", "chmod:docs"]); - grunt.registerTask("stats", - "Provides statistics about the code base such as how many lines there are as well as details of file sizes before and after compression.", - ["concat:js", "uglify:prod", "exec:stats", "exec:repoSize", "exec:displayStats"]); - - grunt.registerTask("release", - "Prepares and deploys a production version of CyberChef to the gh-pages branch.", - ["copy:ghPages", "exec:deployGhPages"]); + grunt.registerTask("prod", + "Creates a production-ready build. Use the --msg flag to add a compile message.", + ["eslint", "clean:prod", "webpack:webProd", "inline", "chmod"]); grunt.registerTask("default", - "Lints the code base and shows stats", - ["eslint", "exec:stats", "exec:displayStats"]); + "Lints the code base", + ["eslint", "exec:repoSize"]); + + grunt.registerTask("inline", + "Compiles a production build of CyberChef into a single, portable web page.", + runInliner); grunt.registerTask("doc", "docs"); grunt.registerTask("tests", "test"); @@ -41,179 +43,79 @@ module.exports = function(grunt) { // Load tasks provided by each plugin grunt.loadNpmTasks("grunt-eslint"); + grunt.loadNpmTasks("grunt-webpack"); grunt.loadNpmTasks("grunt-jsdoc"); grunt.loadNpmTasks("grunt-contrib-clean"); - grunt.loadNpmTasks("grunt-contrib-concat"); grunt.loadNpmTasks("grunt-contrib-copy"); - grunt.loadNpmTasks("grunt-contrib-uglify"); - grunt.loadNpmTasks("grunt-contrib-cssmin"); - grunt.loadNpmTasks("grunt-contrib-htmlmin"); - grunt.loadNpmTasks("grunt-inline-alt"); grunt.loadNpmTasks("grunt-chmod"); grunt.loadNpmTasks("grunt-exec"); grunt.loadNpmTasks("grunt-execute"); - grunt.loadNpmTasks("grunt-contrib-watch"); - // JS includes - var jsIncludes = [ - // Third party framework libraries - "src/js/lib/jquery-2.1.1.js", - "src/js/lib/bootstrap-3.3.6.js", - "src/js/lib/split.js", - "src/js/lib/bootstrap-switch.js", - "src/js/lib/yahoo.js", - "src/js/lib/snowfall.jquery.js", - - // Third party operation libraries - "src/js/lib/cryptojs/core.js", - "src/js/lib/cryptojs/x64-core.js", - "src/js/lib/cryptojs/enc-base64.js", - "src/js/lib/cryptojs/enc-utf16.js", - "src/js/lib/cryptojs/md5.js", - "src/js/lib/cryptojs/evpkdf.js", - "src/js/lib/cryptojs/cipher-core.js", - "src/js/lib/cryptojs/mode-cfb.js", - "src/js/lib/cryptojs/mode-ctr-gladman.js", - "src/js/lib/cryptojs/mode-ctr.js", - "src/js/lib/cryptojs/mode-ecb.js", - "src/js/lib/cryptojs/mode-ofb.js", - "src/js/lib/cryptojs/format-hex.js", - "src/js/lib/cryptojs/lib-typedarrays.js", - "src/js/lib/cryptojs/pad-ansix923.js", - "src/js/lib/cryptojs/pad-iso10126.js", - "src/js/lib/cryptojs/pad-iso97971.js", - "src/js/lib/cryptojs/pad-nopadding.js", - "src/js/lib/cryptojs/pad-zeropadding.js", - "src/js/lib/cryptojs/aes.js", - "src/js/lib/cryptojs/hmac.js", - "src/js/lib/cryptojs/rabbit-legacy.js", - "src/js/lib/cryptojs/rabbit.js", - "src/js/lib/cryptojs/ripemd160.js", - "src/js/lib/cryptojs/sha1.js", - "src/js/lib/cryptojs/sha256.js", - "src/js/lib/cryptojs/sha224.js", - "src/js/lib/cryptojs/sha512.js", - "src/js/lib/cryptojs/sha384.js", - "src/js/lib/cryptojs/sha3.js", - "src/js/lib/cryptojs/tripledes.js", - "src/js/lib/cryptojs/rc4.js", - "src/js/lib/cryptojs/pbkdf2.js", - "src/js/lib/cryptoapi/crypto-api.js", - "src/js/lib/cryptoapi/hasher.md2.js", - "src/js/lib/cryptoapi/hasher.md4.js", - "src/js/lib/cryptoapi/hasher.sha0.js", - "src/js/lib/jsbn/jsbn.js", - "src/js/lib/jsbn/jsbn2.js", - "src/js/lib/jsbn/base64.js", - "src/js/lib/jsbn/ec.js", - "src/js/lib/jsbn/prng4.js", - "src/js/lib/jsbn/rng.js", - "src/js/lib/jsbn/rsa.js", - "src/js/lib/jsbn/sec.js", - "src/js/lib/jsrasign/asn1-1.0.js", - "src/js/lib/jsrasign/asn1hex-1.1.js", - "src/js/lib/jsrasign/asn1x509-1.0.js", - "src/js/lib/jsrasign/base64x-1.1.js", - "src/js/lib/jsrasign/crypto-1.1.js", - "src/js/lib/jsrasign/dsa-modified-1.0.js", - "src/js/lib/jsrasign/ecdsa-modified-1.0.js", - "src/js/lib/jsrasign/ecparam-1.0.js", - "src/js/lib/jsrasign/keyutil-1.0.js", - "src/js/lib/jsrasign/x509-1.1.js", - "src/js/lib/blowfish.dojo.js", - "src/js/lib/rawdeflate.js", - "src/js/lib/rawinflate.js", - "src/js/lib/zip.js", - "src/js/lib/unzip.js", - "src/js/lib/zlib_and_gzip.js", - "src/js/lib/bzip2.js", - "src/js/lib/punycode.js", - "src/js/lib/uas_parser.js", - "src/js/lib/esprima.js", - "src/js/lib/escodegen.browser.js", - "src/js/lib/esmangle.min.js", - "src/js/lib/diff.js", - "src/js/lib/moment.js", - "src/js/lib/moment-timezone.js", - "src/js/lib/prettify.js", - "src/js/lib/vkbeautify.js", - "src/js/lib/Sortable.js", - "src/js/lib/bootstrap-colorpicker.js", - "src/js/lib/es6-promise.auto.js", - "src/js/lib/xpath.js", - - // Custom libraries - "src/js/lib/canvascomponents.js", - - // Utility functions - "src/js/core/Utils.js", - - // Operation objects - "src/js/operations/*.js", - - // Core framework objects - "src/js/core/*.js", - "src/js/config/Categories.js", - "src/js/config/OperationConfig.js", - - // HTML view objects - "src/js/views/html/*.js", - "!src/js/views/html/main.js", - - ]; - - var jsAppFiles = jsIncludes.concat([ - // Start the main app! - "src/js/views/html/main.js", - ]); - - var jsTestFiles = jsIncludes.concat([ - "test/TestRegister.js", - "test/tests/**/*.js", - "test/TestRunner.js", - ]); - - var banner = '/**\n\ - * CyberChef - The Cyber Swiss Army Knife\n\ - *\n\ - * @copyright Crown Copyright 2016\n\ - * @license Apache-2.0\n\ - *\n\ - * Copyright 2016 Crown Copyright\n\ - *\n\ - * Licensed under the Apache License, Version 2.0 (the "License");\n\ - * you may not use this file except in compliance with the License.\n\ - * You may obtain a copy of the License at\n\ - *\n\ - * http://www.apache.org/licenses/LICENSE-2.0\n\ - *\n\ - * Unless required by applicable law or agreed to in writing, software\n\ - * distributed under the License is distributed on an "AS IS" BASIS,\n\ - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\ - * See the License for the specific language governing permissions and\n\ - * limitations under the License.\n\ - */\n'; - - var templateOptions = { - data: { - compileTime: grunt.template.today("dd/mm/yyyy HH:MM:ss") + " UTC", - compileMsg: grunt.option("compile-msg") || grunt.option("msg") || "", - codebaseStats: grunt.file.read("src/static/stats.txt").split("\n").join("
") - } - }; - // Project configuration + var compileTime = grunt.template.today("dd/mm/yyyy HH:MM:ss") + " UTC", + banner = "/**\n" + + "* CyberChef - The Cyber Swiss Army Knife\n" + + "*\n" + + "* @copyright Crown Copyright 2016\n" + + "* @license Apache-2.0\n" + + "*\n" + + "* Copyright 2016 Crown Copyright\n" + + "*\n" + + '* Licensed under the Apache License, Version 2.0 (the "License");\n' + + "* you may not use this file except in compliance with the License.\n" + + "* You may obtain a copy of the License at\n" + + "*\n" + + "* http://www.apache.org/licenses/LICENSE-2.0\n" + + "*\n" + + "* Unless required by applicable law or agreed to in writing, software\n" + + '* distributed under the License is distributed on an "AS IS" BASIS,\n' + + "* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" + + "* See the License for the specific language governing permissions and\n" + + "* limitations under the License.\n" + + "*/\n"; + + /** + * Compiles a production build of CyberChef into a single, portable web page. + */ + function runInliner() { + var inlinerError = false; + Inliner.html({ + relativeTo: "build/prod/", + fileContent: grunt.file.read("build/prod/cyberchef.htm"), + images: true, + svgs: true, + scripts: true, + links: true, + strict: true + }, function(error, result) { + if (error) { + console.log(error); + inlinerError = true; + return false; + } + grunt.file.write("build/prod/cyberchef.htm", result); + }); + + return !inlinerError; + } + grunt.initConfig({ + clean: { + dev: ["build/dev/*"], + prod: ["build/prod/*"], + test: ["build/test/*"], + node: ["build/node/*"], + docs: ["docs/*", "!docs/*.conf.json", "!docs/*.ico"], + }, eslint: { options: { - configFile: "src/js/.eslintrc.json" + configFile: "src/.eslintrc.json" }, - gruntfile: ["Gruntfile.js"], - core: ["src/js/core/**/*.js"], - config: ["src/js/config/**/*.js"], - views: ["src/js/views/**/*.js"], - operations: ["src/js/operations/**/*.js"], + configs: ["Gruntfile.js"], + core: ["src/core/**/*.js", "!src/core/lib/**/*"], + web: ["src/web/**/*.js"], + node: ["src/node/**/*.js"], tests: ["test/**/*.js"], }, jsdoc: { @@ -226,209 +128,183 @@ module.exports = function(grunt) { }, all: { src: [ - "src/js/**/*.js", - "!src/js/lib/**/*", + "src/**/*.js", + "!src/core/lib/**/*", ], } }, - clean: { - dev: ["build/dev/*"], - prod: ["build/prod/*"], - test: ["build/test/*"], - docs: ["docs/*", "!docs/*.conf.json", "!docs/*.ico"], - }, - concat: { + webpack: { options: { - process: templateOptions - }, - css: { - options: { - banner: banner.replace(/\/\*\*/g, "/*!"), - process: function(content, srcpath) { - // Change special comments from /** to /*! to comply with cssmin - content = content.replace(/^\/\*\* /g, "/*! "); - return grunt.template.process(content); + plugins: [ + new webpack.ProvidePlugin({ + $: "jquery", + jQuery: "jquery", + moment: "moment-timezone" + }), + new webpack.BannerPlugin({ + banner: banner, + raw: true, + entryOnly: true + }), + new webpack.DefinePlugin({ + COMPILE_TIME: JSON.stringify(compileTime), + COMPILE_MSG: JSON.stringify(grunt.option("compile-msg") || grunt.option("msg") || "") + }), + new ExtractTextPlugin("styles.css"), + ], + resolve: { + alias: { + jquery: "jquery/src/jquery" } }, - src: [ - "src/css/lib/**/*.css", - "src/css/structure/**/*.css", - "src/css/themes/classic.css" + module: { + rules: [ + { + test: /\.js$/, + exclude: /node_modules/, + loader: "babel-loader?compact=false" + }, + { + test: /\.css$/, + use: ExtractTextPlugin.extract({ + use: "css-loader?minimize" + }) + }, + { + test: /\.less$/, + use: ExtractTextPlugin.extract({ + use: [ + { loader: "css-loader?minimize" }, + { loader: "less-loader" } + ] + }) + }, + { + test: /\.(ico|eot|ttf|woff|woff2)$/, + loader: "url-loader", + options: { + limit: 10000 + } + }, + { // First party images are saved as files to be cached + test: /\.(png|jpg|gif|svg)$/, + exclude: /node_modules/, + loader: "file-loader", + options: { + name: "images/[name].[ext]" + } + }, + { // Third party images are inlined + test: /\.(png|jpg|gif|svg)$/, + exclude: /web\/static/, + loader: "url-loader", + options: { + limit: 10000 + } + }, + ] + }, + stats: { + children: false + } + }, + webDev: { + target: "web", + entry: "./src/web/index.js", + output: { + filename: "scripts.js", + path: __dirname + "/build/dev" + }, + plugins: [ + new HtmlWebpackPlugin({ + filename: "index.html", + template: "./src/web/html/index.html", + compileTime: compileTime + }) ], - dest: "build/dev/styles.css" + watch: true }, - js: { - options: { - banner: '"use strict";\n' + webProd: { + target: "web", + entry: "./src/web/index.js", + output: { + filename: "scripts.js", + path: __dirname + "/build/prod" }, - src: jsAppFiles, - dest: "build/dev/scripts.js" + plugins: [ + new webpack.optimize.UglifyJsPlugin({ + compress: { + "screw_ie8": true, + "dead_code": true, + "unused": true, + "warnings": false + }, + comments: false, + }), + new HtmlWebpackPlugin({ // Main version + filename: "index.html", + template: "./src/web/html/index.html", + compileTime: compileTime, + minify: { + removeComments: true, + collapseWhitespace: true, + minifyJS: true, + minifyCSS: true + } + }), + new HtmlWebpackPlugin({ // Inline version + filename: "cyberchef.htm", + template: "./src/web/html/index.html", + compileTime: compileTime, + inline: true, + minify: { + removeComments: true, + collapseWhitespace: true, + minifyJS: true, + minifyCSS: true + } + }), + ] }, - jsTest: { - options: { - banner: '"use strict";\n' - }, - src: jsTestFiles, - dest: "build/test/tests.js" + tests: { + target: "node", + entry: "./test/index.js", + output: { + filename: "index.js", + path: __dirname + "/build/test" + } + }, + node: { + target: "node", + entry: "./src/node/index.js", + output: { + filename: "CyberChef.js", + path: __dirname + "/build/node", + library: "CyberChef", + libraryTarget: "commonjs2" + } } }, copy: { - htmlDev: { - options: { - process: function(content, srcpath) { - return grunt.template.process(content, templateOptions); - } - }, - src: "src/html/index.html", - dest: "build/dev/index.html" - }, - htmlTest: { - src: "test/test.html", - dest: "build/test/index.html" - }, - htmlProd: { - options: { - process: function(content, srcpath) { - return grunt.template.process(content, templateOptions); - } - }, - src: "src/html/index.html", - dest: "build/prod/index.html" - }, - htmlInline: { - options: { - process: function(content, srcpath) { - // TODO: Do all this in Jade - content = content.replace( - 'Download CyberChef', - 'Compile time: ' + grunt.template.today("dd/mm/yyyy HH:MM:ss") + " UTC"); - return grunt.template.process(content, templateOptions); - } - }, - src: "src/html/index.html", - dest: "build/prod/cyberchef.htm" - }, - staticDev: { - files: [ - { - expand: true, - cwd: "src/static/", - src: [ - "**/*", - "**/.*", - "!stats.txt", - "!ga.html" - ], - dest: "build/dev/" - } - ] - }, - staticProd: { - files: [ - { - expand: true, - cwd: "src/static/", - src: [ - "**/*", - "**/.*", - "!stats.txt", - "!ga.html" - ], - dest: "build/prod/" - } - ] - }, ghPages: { options: { - process: function(content, srcpath) { + process: function (content, srcpath) { // Add Google Analytics code to index.html content = content.replace("", - grunt.file.read("src/static/ga.html") + ""); - return grunt.template.process(content, templateOptions); + grunt.file.read("src/web/static/ga.html") + ""); + return grunt.template.process(content); } }, src: "build/prod/index.html", dest: "build/prod/index.html" } }, - uglify: { - options: { - preserveComments: function(node, comment) { - if (comment.value.indexOf("* @license") === 0) return true; - return false; - }, - screwIE8: true, - ASCIIOnly: true, - beautify: { - beautify: false, - inline_script: true, // eslint-disable-line camelcase - ascii_only: true, // eslint-disable-line camelcase - screw_ie8: true // eslint-disable-line camelcase - }, - compress: { - screw_ie8: true // eslint-disable-line camelcase - }, - banner: banner - }, - prod: { - src: "build/dev/scripts.js", - dest: "build/prod/scripts.js" - } - }, - cssmin: { - prod: { - src: "build/dev/styles.css", - dest: "build/prod/styles.css" - } - }, - htmlmin: { - prod: { - options: { - removeComments: true, - collapseWhitespace: true, - minifyJS: true, - minifyCSS: true - }, - src: "build/prod/index.html", - dest: "build/prod/index.html" - }, - inline: { - options: { - removeComments: true, - collapseWhitespace: true, - minifyJS: false, - minifyCSS: false - }, - src: "build/prod/cyberchef.htm", - dest: "build/prod/cyberchef.htm" - } - }, - inline: { - options: { - tag: "", - inlineTagAttributes: { - js: "type='application/javascript'", - css: "type='text/css'" - } - }, - compiled: { - src: "build/prod/cyberchef.htm", - dest: "build/prod/cyberchef.htm" - }, - prod: { - options: { - tag: "__inline" - }, - src: "build/prod/index.html", - dest: "build/prod/index.html" - } - }, chmod: { build: { options: { mode: "755", }, - src: ["build/**/*", "build/**/.htaccess", "build/"] + src: ["build/**/*", "build/"] }, docs: { options: { @@ -445,75 +321,12 @@ module.exports = function(grunt) { ].join(";"), stderr: false }, - stats: { - command: "rm src/static/stats.txt;" + - [ - "ls src/ -R1 | grep '^$' -v | grep ':$' -v | wc -l | xargs printf '%b\tsource files\n'", - "find src/ -regex '.*\..*' -print | xargs cat | wc -l | xargs printf '%b\tlines\n'", - "du -hs src/ | pcregrep -o '^[^\t]*' | xargs printf '%b\tsize\n'", - - "ls src/js/ -R1 | grep '\.js$' | wc -l | xargs printf '\n%b\tJavaScript source files\n'", - "find src/js/ -regex '.*\.js' -print | xargs cat | wc -l | xargs printf '%b\tlines\n'", - "find src/js/ -regex '.*\.js' -exec du -hcs {} \+ | tail -n1 | egrep -o '^[^\t]*' | xargs printf '%b\tsize\n'", - - "find src/js/ -regex '.*/lib/.*\.js' -print | wc -l | xargs printf '\n%b\tthird party JavaScript source files\n'", - "find src/js/ -regex '.*/lib/.*\.js' -print | xargs cat | wc -l | xargs printf '%b\tlines\n'", - "find src/js/ -regex '.*/lib/.*\.js' -exec du -hcs {} \+ | tail -n1 | egrep -o '^[^\t]*' | xargs printf '%b\tsize\n'", - - "find src/js/ -regex '.*\.js' -not -regex '.*/lib/.*' -print | wc -l | xargs printf '\n%b\tfirst party JavaScript source files\n'", - "find src/js/ -regex '.*\.js' -not -regex '.*/lib/.*' -print | xargs cat | wc -l | xargs printf '%b\tlines\n'", - "find src/js/ -regex '.*\.js' -not -regex '.*/lib/.*' -exec du -hcs {} \+ | tail -n1 | egrep -o '^[^\t]*' | xargs printf '%b\tsize\n'", - - "du build/dev/scripts.js -h | egrep -o '^[^\t]*' | xargs printf '\n%b\tuncompressed JavaScript size\n'", - "du build/prod/scripts.js -h | egrep -o '^[^\t]*' | xargs printf '%b\tcompressed JavaScript size\n'", - - "grep -E '^\\s+name: ' src/js/config/Categories.js | wc -l | xargs printf '\n%b\tcategories\n'", - "grep -E '^\\s+\"[A-Za-z0-9 \\-]+\": {' src/js/config/OperationConfig.js | wc -l | xargs printf '%b\toperations\n'", - - ].join(" >> src/static/stats.txt;") + " >> src/static/stats.txt;", - stderr: false - }, - displayStats: { - command: "cat src/static/stats.txt" - }, cleanGit: { command: "git gc --prune=now --aggressive" }, - deployGhPages: { - command: [ - "git add build/prod/index.html -v", - "COMMIT_HASH=$(git rev-parse HEAD)", - "git commit -m \"GitHub Pages release for ${COMMIT_HASH}\"", - "git push origin `git subtree split --prefix build/prod master`:gh-pages --force", - "git reset HEAD~", - "git checkout build/prod/index.html" - ].join(";") - } }, execute: { - test: "test/NodeRunner.js" - }, - watch: { - css: { - files: "src/css/**/*.css", - tasks: ["concat:css", "chmod:build"] - }, - js: { - files: "src/js/**/*.js", - tasks: ["concat:js", "chmod:build"] - }, - html: { - files: "src/html/**/*.html", - tasks: ["copy:htmlDev", "chmod:build"] - }, - static: { - files: ["src/static/**/*", "src/static/**/.*"], - tasks: ["copy:staticDev", "chmod:build"] - }, - grunt: { - files: "Gruntfile.js", - tasks: ["clean:dev", "concat:css", "concat:js", "copy:htmlDev", "copy:staticDev", "chmod:build"] - } + test: "build/test/index.js" }, }); diff --git a/README.md b/README.md index 83ae12b..53b25c5 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # CyberChef -####*The Cyber Swiss Army Knife* +#### *The Cyber Swiss Army Knife* CyberChef is a simple, intuitive web app for carrying out all manner of "cyber" operations within a web browser. These operations include creating hexdumps, simple encoding like XOR or Base64, more complex encryption like AES, DES and Blowfish, data compression and decompression, calculating hashes and checksums, IPv6 and X.509 parsing, and much more. @@ -13,7 +13,6 @@ CyberChef is still under active development. As a result, it shouldn't be consid Cryptographic operations in CyberChef should not be relied upon to provide security in any situation. No guarantee is offered for their correctness. [A live demo can be found here][1] - have fun! -Note: Use Chrome or Firefox, see the Browser Support section below for details. ## How it works @@ -63,11 +62,7 @@ You can use as many operations as you like in simple or complex ways. Some examp ## Browser support -CyberChef works well in modern versions of Google Chrome and Mozilla Firefox. - -To aid in the efficient development of new features and operations, there has been no attempt to maintain support for any version of Microsoft Internet Explorer. - -Microsoft Edge is currently unsupported, but if anyone would like to contribute compatibility fixes, they would be appreciated. +CyberChef is built to support Google Chrome 40+, Mozilla Firefox 35+ and Microsoft Edge 14+. ## Contributing @@ -91,4 +86,4 @@ CyberChef is released under the [Apache 2.0 Licence](https://www.apache.org/lice [5]: https://gchq.github.io/CyberChef/?recipe=%5B%7B%22op%22%3A%22From%20Hexdump%22%2C%22args%22%3A%5B%5D%7D%2C%7B%22op%22%3A%22Gunzip%22%2C%22args%22%3A%5B%5D%7D%5D&input=MDAwMDAwMDAgIDFmIDhiIDA4IDAwIDEyIGJjIGYzIDU3IDAwIGZmIDBkIGM3IGMxIDA5IDAwIDIwICB8Li4uLi6881cu%2Fy7HwS4uIHwKMDAwMDAwMTAgIDA4IDA1IGQwIDU1IGZlIDA0IDJkIGQzIDA0IDFmIGNhIDhjIDQ0IDIxIDViIGZmICB8Li7QVf4uLdMuLsouRCFb%2F3wKMDAwMDAwMjAgIDYwIGM3IGQ3IDAzIDE2IGJlIDQwIDFmIDc4IDRhIDNmIDA5IDg5IDBiIDlhIDdkICB8YMfXLi6%2BQC54Sj8uLi4ufXwKMDAwMDAwMzAgIDRlIGM4IDRlIDZkIDA1IDFlIDAxIDhiIDRjIDI0IDAwIDAwIDAwICAgICAgICAgICB8TshObS4uLi5MJC4uLnw [6]: https://gchq.github.io/CyberChef/?recipe=%5B%7B%22op%22%3A%22Fork%22%2C%22args%22%3A%5B%22%5C%5Cn%22%2C%22%5C%5Cn%22%5D%7D%2C%7B%22op%22%3A%22From%20UNIX%20Timestamp%22%2C%22args%22%3A%5B%22Seconds%20(s)%22%5D%7D%5D&input=OTc4MzQ2ODAwCjEwMTI2NTEyMDAKMTA0NjY5NjQwMAoxMDgxMDg3MjAwCjExMTUzMDUyMDAKMTE0OTYwOTYwMA [7]: https://gchq.github.io/CyberChef/?recipe=%5B%7B%22op%22%3A%22Fork%22%2C%22args%22%3A%5B%22%5C%5Cn%22%2C%22%5C%5Cn%22%5D%7D%2C%7B%22op%22%3A%22Conditional%20Jump%22%2C%22args%22%3A%5B%221%22%2C%222%22%2C%2210%22%5D%7D%2C%7B%22op%22%3A%22To%20Hex%22%2C%22args%22%3A%5B%22Space%22%5D%7D%2C%7B%22op%22%3A%22Return%22%2C%22args%22%3A%5B%5D%7D%2C%7B%22op%22%3A%22To%20Base64%22%2C%22args%22%3A%5B%22A-Za-z0-9%2B%2F%3D%22%5D%7D%5D&input=U29tZSBkYXRhIHdpdGggYSAxIGluIGl0ClNvbWUgZGF0YSB3aXRoIGEgMiBpbiBpdA - [8]: https://gchq.github.io/CyberChef/?recipe=%5B%7B%22op%22%3A%22XOR%22%2C%22args%22%3A%5B%7B%22option%22%3A%22Hex%22%2C%22string%22%3A%223a%22%7D%2Cfalse%2Cfalse%5D%7D%2C%7B%22op%22%3A%22To%20Hexdump%22%2C%22args%22%3A%5B%2216%22%2Cfalse%2Cfalse%5D%7D%5D&input=VGhlIGFuc3dlciB0byB0aGUgdWx0aW1hdGUgcXVlc3Rpb24gb2YgbGlmZSwgdGhlIFVuaXZlcnNlLCBhbmQgZXZlcnl0aGluZyBpcyA0Mi4 \ No newline at end of file + [8]: https://gchq.github.io/CyberChef/?recipe=%5B%7B%22op%22%3A%22XOR%22%2C%22args%22%3A%5B%7B%22option%22%3A%22Hex%22%2C%22string%22%3A%223a%22%7D%2Cfalse%2Cfalse%5D%7D%2C%7B%22op%22%3A%22To%20Hexdump%22%2C%22args%22%3A%5B%2216%22%2Cfalse%2Cfalse%5D%7D%5D&input=VGhlIGFuc3dlciB0byB0aGUgdWx0aW1hdGUgcXVlc3Rpb24gb2YgbGlmZSwgdGhlIFVuaXZlcnNlLCBhbmQgZXZlcnl0aGluZyBpcyA0Mi4 diff --git a/build/prod/.htaccess b/build/prod/.htaccess deleted file mode 100755 index 8062672..0000000 --- a/build/prod/.htaccess +++ /dev/null @@ -1,50 +0,0 @@ -# Serve up .htm files as binary files rather than text/html. -# This allows cyberchef.htm to be downloaded rather than opened in the browser. -AddType application/octet-stream .htm - -# Fix Apache bug #45023 where "-gzip" is appended to all ETags, preventing 304 responses - - RequestHeader edit "If-None-Match" "^\"(.*)-gzip\"$" "\"$1\"" - Header edit "ETag" "^\"(.*[^g][^z][^i][^p])\"$" "\"$1-gzip\"" - - -# Set gzip compression on all resources that support it - - SetOutputFilter DEFLATE - - -# Set Expires headers on various resources - - ExpiresActive On - - # 10 minutes - ExpiresDefault "access plus 600 seconds" - - # 30 days - ExpiresByType image/x-icon "access plus 2592000 seconds" - ExpiresByType image/jpeg "access plus 2592000 seconds" - ExpiresByType image/png "access plus 2592000 seconds" - ExpiresByType image/gif "access plus 2592000 seconds" - - # 7 days - ExpiresByType text/css "access plus 604800 seconds" - ExpiresByType text/javascript "access plus 604800 seconds" - ExpiresByType application/javascript "access plus 604800 seconds" - ExpiresByType text/html "access plus 604800 seconds" - - -# Set Cache-Control headers on various resources - - - Header set Cache-Control "max-age=2592000, public" - - - Header set Cache-Control "max-age=600, public" - - - Header set Cache-Control "max-age=600, private, must-revalidate" - - - Header set Cache-Control "max-age=600, private, must-revalidate" - - diff --git a/build/prod/cyberchef.htm b/build/prod/cyberchef.htm deleted file mode 100755 index 3e3a266..0000000 --- a/build/prod/cyberchef.htm +++ /dev/null @@ -1,383 +0,0 @@ - -CyberChef Edit
Operations
    Recipe
      Input
      Output
      \ No newline at end of file diff --git a/build/prod/index.html b/build/prod/index.html deleted file mode 100755 index d69e6c6..0000000 --- a/build/prod/index.html +++ /dev/null @@ -1,21 +0,0 @@ - -CyberChef Edit
      Operations
        Recipe
          Input
          Output
          \ No newline at end of file diff --git a/build/prod/scripts.js b/build/prod/scripts.js deleted file mode 100755 index 0bf65a3..0000000 --- a/build/prod/scripts.js +++ /dev/null @@ -1,292 +0,0 @@ -/** - * CyberChef - The Cyber Swiss Army Knife - * - * @copyright Crown Copyright 2016 - * @license Apache-2.0 - * - * Copyright 2016 Crown Copyright - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -"use strict";function BigInteger(a,b,c){null!=a&&("number"==typeof a?this.fromNumber(a,b,c):null==b&&"string"!=typeof a?this.fromString(a,256):this.fromString(a,b))}function nbi(){return new BigInteger(null)}function am1(a,b,c,d,e,f){for(;--f>=0;){var g=b*this[a++]+c[d]+e;e=Math.floor(g/67108864),c[d++]=67108863&g}return e}function am2(a,b,c,d,e,f){for(var g=32767&b,h=b>>15;--f>=0;){var i=32767&this[a],j=this[a++]>>15,k=h*i+j*g;i=g*i+((32767&k)<<15)+c[d]+(1073741823&e),e=(i>>>30)+(k>>>15)+h*j+(e>>>30),c[d++]=1073741823&i}return e}function am3(a,b,c,d,e,f){for(var g=16383&b,h=b>>14;--f>=0;){var i=16383&this[a],j=this[a++]>>14,k=h*i+j*g;i=g*i+((16383&k)<<14)+c[d]+e,e=(i>>28)+(k>>14)+h*j,c[d++]=268435455&i}return e}function int2char(a){return BI_RM.charAt(a)}function intAt(a,b){var c=BI_RC[a.charCodeAt(b)];return null==c?-1:c}function bnpCopyTo(a){for(var b=this.t-1;b>=0;--b)a[b]=this[b];a.t=this.t,a.s=this.s}function bnpFromInt(a){this.t=1,this.s=a<0?-1:0,a>0?this[0]=a:a<-1?this[0]=a+this.DV:this.t=0}function nbv(a){var b=nbi();return b.fromInt(a),b}function bnpFromString(a,b){var c;if(16==b)c=4;else if(8==b)c=3;else if(256==b)c=8;else if(2==b)c=1;else if(32==b)c=5;else{if(4!=b)return void this.fromRadix(a,b);c=2}this.t=0,this.s=0;for(var d=a.length,e=!1,f=0;--d>=0;){var g=8==c?255&a[d]:intAt(a,d);g<0?"-"==a.charAt(d)&&(e=!0):(e=!1,0==f?this[this.t++]=g:f+c>this.DB?(this[this.t-1]|=(g&(1<>this.DB-f):this[this.t-1]|=g<=this.DB&&(f-=this.DB))}8==c&&0!=(128&a[0])&&(this.s=-1,f>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==a;)--this.t}function bnToString(a){if(this.s<0)return"-"+this.negate().toString(a);var b;if(16==a)b=4;else if(8==a)b=3;else if(2==a)b=1;else if(32==a)b=5;else{if(4!=a)return this.toRadix(a);b=2}var c,d=(1<0)for(h>h)>0&&(e=!0,f=int2char(c));g>=0;)h>(h+=this.DB-b)):(c=this[g]>>(h-=b)&d,h<=0&&(h+=this.DB,--g)),c>0&&(e=!0),e&&(f+=int2char(c));return e?f:"0"}function bnNegate(){var a=nbi();return BigInteger.ZERO.subTo(this,a),a}function bnAbs(){return this.s<0?this.negate():this}function bnCompareTo(a){var b=this.s-a.s;if(0!=b)return b;var c=this.t;if(b=c-a.t,0!=b)return this.s<0?-b:b;for(;--c>=0;)if(0!=(b=this[c]-a[c]))return b;return 0}function nbits(a){var b,c=1;return 0!=(b=a>>>16)&&(a=b,c+=16),0!=(b=a>>8)&&(a=b,c+=8),0!=(b=a>>4)&&(a=b,c+=4),0!=(b=a>>2)&&(a=b,c+=2),0!=(b=a>>1)&&(a=b,c+=1),c}function bnBitLength(){return this.t<=0?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnpDLShiftTo(a,b){var c;for(c=this.t-1;c>=0;--c)b[c+a]=this[c];for(c=a-1;c>=0;--c)b[c]=0;b.t=this.t+a,b.s=this.s}function bnpDRShiftTo(a,b){for(var c=a;c=0;--c)b[c+g+1]=this[c]>>e|h,h=(this[c]&f)<=0;--c)b[c]=0;b[g]=h,b.t=this.t+g+1,b.s=this.s,b.clamp()}function bnpRShiftTo(a,b){b.s=this.s;var c=Math.floor(a/this.DB);if(c>=this.t)return void(b.t=0);var d=a%this.DB,e=this.DB-d,f=(1<>d;for(var g=c+1;g>d;d>0&&(b[this.t-c-1]|=(this.s&f)<>=this.DB;if(a.t>=this.DB;d+=this.s}else{for(d+=this.s;c>=this.DB;d-=a.s}b.s=d<0?-1:0,d<-1?b[c++]=this.DV+d:d>0&&(b[c++]=d),b.t=c,b.clamp()}function bnpMultiplyTo(a,b){var c=this.abs(),d=a.abs(),e=c.t;for(b.t=e+d.t;--e>=0;)b[e]=0;for(e=0;e=0;)a[c]=0;for(c=0;c=b.DV&&(a[c+b.t]-=b.DV,a[c+b.t+1]=1)}a.t>0&&(a[a.t-1]+=b.am(c,b[c],a,2*c,0,1)),a.s=0,a.clamp()}function bnpDivRemTo(a,b,c){var d=a.abs();if(!(d.t<=0)){var e=this.abs();if(e.t0?(d.lShiftTo(i,f),e.lShiftTo(i,c)):(d.copyTo(f),e.copyTo(c));var j=f.t,k=f[j-1];if(0!=k){var l=k*(1<1?f[j-2]>>this.F2:0),m=this.FV/l,n=(1<=0&&(c[c.t++]=1,c.subTo(r,c)),BigInteger.ONE.dlShiftTo(j,r),r.subTo(f,f);f.t=0;){var s=c[--p]==k?this.DM:Math.floor(c[p]*m+(c[p-1]+o)*n);if((c[p]+=f.am(0,s,c,q,0,j))0&&c.rShiftTo(i,c),g<0&&BigInteger.ZERO.subTo(c,c)}}}function bnMod(a){var b=nbi();return this.abs().divRemTo(a,null,b),this.s<0&&b.compareTo(BigInteger.ZERO)>0&&a.subTo(b,b),b}function Classic(a){this.m=a}function cConvert(a){return a.s<0||a.compareTo(this.m)>=0?a.mod(this.m):a}function cRevert(a){return a}function cReduce(a){a.divRemTo(this.m,null,a)}function cMulTo(a,b,c){a.multiplyTo(b,c),this.reduce(c)}function cSqrTo(a,b){a.squareTo(b),this.reduce(b)}function bnpInvDigit(){if(this.t<1)return 0;var a=this[0];if(0==(1&a))return 0;var b=3&a;return b=b*(2-(15&a)*b)&15,b=b*(2-(255&a)*b)&255,b=b*(2-((65535&a)*b&65535))&65535,b=b*(2-a*b%this.DV)%this.DV,b>0?this.DV-b:-b}function Montgomery(a){this.m=a,this.mp=a.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(b,b),b}function montRevert(a){var b=nbi();return a.copyTo(b),this.reduce(b),b}function montReduce(a){for(;a.t<=this.mt2;)a[a.t++]=0;for(var b=0;b>15)*this.mpl&this.um)<<15)&a.DM;for(c=b+this.m.t,a[c]+=this.m.am(0,d,a,b,0,this.m.t);a[c]>=a.DV;)a[c]-=a.DV,a[++c]++}a.clamp(),a.drShiftTo(this.m.t,a),a.compareTo(this.m)>=0&&a.subTo(this.m,a)}function montSqrTo(a,b){a.squareTo(b),this.reduce(b)}function montMulTo(a,b,c){a.multiplyTo(b,c),this.reduce(c)}function bnpIsEven(){return 0==(this.t>0?1&this[0]:this.s)}function bnpExp(a,b){if(a>4294967295||a<1)return BigInteger.ONE;var c=nbi(),d=nbi(),e=b.convert(this),f=nbits(a)-1;for(e.copyTo(c);--f>=0;)if(b.sqrTo(c,d),(a&1<0)b.mulTo(d,e,c);else{var g=c;c=d,d=g}return b.revert(c)}function bnModPowInt(a,b){var c;return c=a<256||b.isEven()?new Classic(b):new Montgomery(b),this.exp(a,c)}function bnClone(){var a=nbi();return this.copyTo(a),a}function bnIntValue(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<>24}function bnShortValue(){return 0==this.t?this.s:this[0]<<16>>16}function bnpChunkSize(a){return Math.floor(Math.LN2*this.DB/Math.log(a))}function bnSigNum(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function bnpToRadix(a){if(null==a&&(a=10),0==this.signum()||a<2||a>36)return"0";var b=this.chunkSize(a),c=Math.pow(a,b),d=nbv(c),e=nbi(),f=nbi(),g="";for(this.divRemTo(d,e,f);e.signum()>0;)g=(c+f.intValue()).toString(a).substr(1)+g,e.divRemTo(d,e,f);return f.intValue().toString(a)+g}function bnpFromRadix(a,b){this.fromInt(0),null==b&&(b=10);for(var c=this.chunkSize(b),d=Math.pow(b,c),e=!1,f=0,g=0,h=0;h=c&&(this.dMultiply(d),this.dAddOffset(g,0),f=0,g=0))}f>0&&(this.dMultiply(Math.pow(b,f)),this.dAddOffset(g,0)),e&&BigInteger.ZERO.subTo(this,this)}function bnpFromNumber(a,b,c){if("number"==typeof b)if(a<2)this.fromInt(1);else for(this.fromNumber(a,c),this.testBit(a-1)||this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(b);)this.dAddOffset(2,0),this.bitLength()>a&&this.subTo(BigInteger.ONE.shiftLeft(a-1),this);else{var d=new Array,e=7&a;d.length=(a>>3)+1,b.nextBytes(d),e>0?d[0]&=(1<0)for(d>d)!=(this.s&this.DM)>>d&&(b[e++]=c|this.s<=0;)d<8?(c=(this[a]&(1<>(d+=this.DB-8)):(c=this[a]>>(d-=8)&255,d<=0&&(d+=this.DB,--a)),0!=(128&c)&&(c|=-256),0==e&&(128&this.s)!=(128&c)&&++e,(e>0||c!=this.s)&&(b[e++]=c);return b}function bnEquals(a){return 0==this.compareTo(a)}function bnMin(a){return this.compareTo(a)<0?this:a}function bnMax(a){return this.compareTo(a)>0?this:a}function bnpBitwiseTo(a,b,c){var d,e,f=Math.min(a.t,this.t);for(d=0;d>=16,b+=16),0==(255&a)&&(a>>=8,b+=8),0==(15&a)&&(a>>=4,b+=4),0==(3&a)&&(a>>=2,b+=2),0==(1&a)&&++b,b}function bnGetLowestSetBit(){for(var a=0;a=this.t?0!=this.s:0!=(this[b]&1<>=this.DB;if(a.t>=this.DB;d+=this.s}else{for(d+=this.s;c>=this.DB;d+=a.s}b.s=d<0?-1:0,d>0?b[c++]=d:d<-1&&(b[c++]=this.DV+d),b.t=c,b.clamp()}function bnAdd(a){var b=nbi();return this.addTo(a,b),b}function bnSubtract(a){var b=nbi();return this.subTo(a,b),b}function bnMultiply(a){var b=nbi();return this.multiplyTo(a,b),b}function bnSquare(){var a=nbi();return this.squareTo(a),a}function bnDivide(a){var b=nbi();return this.divRemTo(a,b,null),b}function bnRemainder(a){var b=nbi();return this.divRemTo(a,null,b),b}function bnDivideAndRemainder(a){var b=nbi(),c=nbi();return this.divRemTo(a,b,c),new Array(b,c)}function bnpDMultiply(a){this[this.t]=this.am(0,a-1,this,0,0,this.t),++this.t,this.clamp()}function bnpDAddOffset(a,b){if(0!=a){for(;this.t<=b;)this[this.t++]=0;for(this[b]+=a;this[b]>=this.DV;)this[b]-=this.DV,++b>=this.t&&(this[this.t++]=0),++this[b]}}function NullExp(){}function nNop(a){return a}function nMulTo(a,b,c){a.multiplyTo(b,c)}function nSqrTo(a,b){a.squareTo(b)}function bnPow(a){return this.exp(a,new NullExp)}function bnpMultiplyLowerTo(a,b,c){var d=Math.min(this.t+a.t,b);for(c.s=0,c.t=d;d>0;)c[--d]=0;var e;for(e=c.t-this.t;d=0;)c[d]=0;for(d=Math.max(b-this.t,0);d2*this.m.t)return a.mod(this.m);if(a.compareTo(this.m)<0)return a;var b=nbi();return a.copyTo(b),this.reduce(b),b}function barrettRevert(a){return a}function barrettReduce(a){for(a.drShiftTo(this.m.t-1,this.r2),a.t>this.m.t+1&&(a.t=this.m.t+1,a.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);a.compareTo(this.r2)<0;)a.dAddOffset(1,this.m.t+1);for(a.subTo(this.r2,a);a.compareTo(this.m)>=0;)a.subTo(this.m,a)}function barrettSqrTo(a,b){a.squareTo(b),this.reduce(b)}function barrettMulTo(a,b,c){a.multiplyTo(b,c),this.reduce(c)}function bnModPow(a,b){var c,d,e=a.bitLength(),f=nbv(1);if(e<=0)return f;c=e<18?1:e<48?3:e<144?4:e<768?5:6,d=e<8?new Classic(b):b.isEven()?new Barrett(b):new Montgomery(b);var g=new Array,h=3,i=c-1,j=(1<1){var k=nbi();for(d.sqrTo(g[1],k);h<=j;)g[h]=nbi(),d.mulTo(k,g[h-2],g[h]),h+=2}var l,m,n=a.t-1,o=!0,p=nbi();for(e=nbits(a[n])-1;n>=0;){for(e>=i?l=a[n]>>e-i&j:(l=(a[n]&(1<0&&(l|=a[n-1]>>this.DB+e-i)),h=c;0==(1&l);)l>>=1,--h;if((e-=h)<0&&(e+=this.DB,--n),o)g[l].copyTo(f),o=!1;else{for(;h>1;)d.sqrTo(f,p),d.sqrTo(p,f),h-=2;h>0?d.sqrTo(f,p):(m=f,f=p,p=m),d.mulTo(p,g[l],f)}for(;n>=0&&0==(a[n]&1<0&&(b.rShiftTo(f,b),c.rShiftTo(f,c));b.signum()>0;)(e=b.getLowestSetBit())>0&&b.rShiftTo(e,b),(e=c.getLowestSetBit())>0&&c.rShiftTo(e,c),b.compareTo(c)>=0?(b.subTo(c,b),b.rShiftTo(1,b)):(c.subTo(b,c),c.rShiftTo(1,c));return f>0&&c.lShiftTo(f,c),c}function bnpModInt(a){if(a<=0)return 0;var b=this.DV%a,c=this.s<0?a-1:0;if(this.t>0)if(0==b)c=this[0]%a;else for(var d=this.t-1;d>=0;--d)c=(b*c+this[d])%a;return c}function bnModInverse(a){var b=a.isEven();if(this.isEven()&&b||0==a.signum())return BigInteger.ZERO;for(var c=a.clone(),d=this.clone(),e=nbv(1),f=nbv(0),g=nbv(0),h=nbv(1);0!=c.signum();){for(;c.isEven();)c.rShiftTo(1,c),b?(e.isEven()&&f.isEven()||(e.addTo(this,e),f.subTo(a,f)),e.rShiftTo(1,e)):f.isEven()||f.subTo(a,f),f.rShiftTo(1,f);for(;d.isEven();)d.rShiftTo(1,d),b?(g.isEven()&&h.isEven()||(g.addTo(this,g),h.subTo(a,h)),g.rShiftTo(1,g)):h.isEven()||h.subTo(a,h),h.rShiftTo(1,h);c.compareTo(d)>=0?(c.subTo(d,c),b&&e.subTo(g,e),f.subTo(h,f)):(d.subTo(c,d),b&&g.subTo(e,g),h.subTo(f,h))}return 0!=d.compareTo(BigInteger.ONE)?BigInteger.ZERO:h.compareTo(a)>=0?h.subtract(a):h.signum()<0?(h.addTo(a,h),h.signum()<0?h.add(a):h):h}function bnIsProbablePrime(a){var b,c=this.abs();if(1==c.t&&c[0]<=lowprimes[lowprimes.length-1]){for(b=0;b>1,a>lowprimes.length&&(a=lowprimes.length);for(var e=nbi(),f=0;f>6)+b64map.charAt(63&c);for(b+1==a.length?(c=parseInt(a.substring(b,b+1),16),d+=b64map.charAt(c<<2)):b+2==a.length&&(c=parseInt(a.substring(b,b+2),16),d+=b64map.charAt(c>>2)+b64map.charAt((3&c)<<4));(3&d.length)>0;)d+=b64padchar;return d}function b64tohex(a){var b,c,d="",e=0;for(b=0;b>2),c=3&f,e=1):1==e?(d+=int2char(c<<2|f>>4),c=15&f,e=2):2==e?(d+=int2char(c),d+=int2char(f>>2),c=3&f,e=3):(d+=int2char(c<<2|f>>4),d+=int2char(15&f),e=0))}return 1==e&&(d+=int2char(c<<2)),d}function b64toBA(a){var b,c=b64tohex(a),d=new Array;for(b=0;2*b0;--b){f=f.twice();var g=d.testBit(b),h=c.testBit(b);g!=h&&(f=f.add(g?this:e))}return f}function pointFpMultiplyTwo(a,b,c){var d;d=a.bitLength()>c.bitLength()?a.bitLength()-1:c.bitLength()-1;for(var e=this.curve.getInfinity(),f=this.add(b);d>=0;)e=e.twice(),a.testBit(d)?e=c.testBit(d)?e.add(f):e.add(this):c.testBit(d)&&(e=e.add(b)),--d;return e}function ECCurveFp(a,b,c){this.q=a,this.a=this.fromBigInteger(b),this.b=this.fromBigInteger(c),this.infinity=new ECPointFp(this,null,null),this.reducer=new Barrett(this.q)}function curveFpGetQ(){return this.q}function curveFpGetA(){return this.a}function curveFpGetB(){return this.b}function curveFpEquals(a){return a==this||this.q.equals(a.q)&&this.a.equals(a.a)&&this.b.equals(a.b)}function curveFpGetInfinity(){return this.infinity}function curveFpFromBigInteger(a){return new ECFieldElementFp(this.q,a)}function curveReduce(a){this.reducer.reduce(a)}function curveFpDecodePointHex(a){switch(parseInt(a.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:return null;case 4:case 6:case 7:var b=(a.length-2)/2,c=a.substr(2,b),d=a.substr(b+2,b);return new ECPointFp(this,this.fromBigInteger(new BigInteger(c,16)),this.fromBigInteger(new BigInteger(d,16)));default:return null}}function curveFpEncodePointHex(a){if(a.isInfinity())return"00";var b=a.getX().toBigInteger().toString(16),c=a.getY().toBigInteger().toString(16),d=this.getQ().toString(16).length;for(d%2!=0&&d++;b.length>8&255,rng_pptr>=rng_psize&&(rng_pptr-=rng_psize)}function rng_seed_time(){rng_seed_int((new Date).getTime())}function rng_get_byte(){if(null==rng_state){for(rng_seed_time(),rng_state=prng_newstate(),rng_state.init(rng_pool),rng_pptr=0;rng_pptr=0&&b>0;){var e=a.charCodeAt(d--);e<128?c[--b]=e:e>127&&e<2048?(c[--b]=63&e|128,c[--b]=e>>6|192):(c[--b]=63&e|128,c[--b]=e>>6&63|128,c[--b]=e>>12|224)}c[--b]=0;for(var f=new SecureRandom,g=new Array;b>2;){for(g[0]=0;0==g[0];)f.nextBytes(g);c[--b]=g[0]}return c[--b]=2,c[--b]=0,new BigInteger(c)}function RSAKey(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function RSASetPublic(a,b){null!=a&&null!=b&&a.length>0&&b.length>0&&(this.n=parseBigInt(a,16),this.e=parseInt(b,16))}function RSADoPublic(a){return a.modPowInt(this.e,this.n)}function RSAEncrypt(a){var b=pkcs1pad2(a,this.n.bitLength()+7>>3);if(null==b)return null;var c=this.doPublic(b);if(null==c)return null;var d=c.toString(16);return 0==(1&d.length)?d:"0"+d}function X9ECParameters(a,b,c,d){this.curve=a,this.g=b,this.n=c,this.h=d}function x9getCurve(){return this.curve}function x9getG(){return this.g}function x9getN(){return this.n}function x9getH(){return this.h}function fromHex(a){return new BigInteger(a,16)}function secp128r1(){var a=fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"),b=fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"),c=fromHex("E87579C11079F43DD824993C2CEE5ED3"),d=fromHex("FFFFFFFE0000000075A30D1B9038A115"),e=BigInteger.ONE,f=new ECCurveFp(a,b,c),g=f.decodePointHex("04161FF7528B899B2D0C28607CA52C5B86CF5AC8395BAFEB13C02DA292DDED7A83");return new X9ECParameters(f,g,d,e)}function secp160k1(){var a=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"),b=BigInteger.ZERO,c=fromHex("7"),d=fromHex("0100000000000000000001B8FA16DFAB9ACA16B6B3"),e=BigInteger.ONE,f=new ECCurveFp(a,b,c),g=f.decodePointHex("043B4C382CE37AA192A4019E763036F4F5DD4D7EBB938CF935318FDCED6BC28286531733C3F03C4FEE");return new X9ECParameters(f,g,d,e)}function secp160r1(){var a=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"),b=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"),c=fromHex("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"),d=fromHex("0100000000000000000001F4C8F927AED3CA752257"),e=BigInteger.ONE,f=new ECCurveFp(a,b,c),g=f.decodePointHex("044A96B5688EF573284664698968C38BB913CBFC8223A628553168947D59DCC912042351377AC5FB32");return new X9ECParameters(f,g,d,e)}function secp192k1(){var a=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37"),b=BigInteger.ZERO,c=fromHex("3"),d=fromHex("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D"),e=BigInteger.ONE,f=new ECCurveFp(a,b,c),g=f.decodePointHex("04DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D");return new X9ECParameters(f,g,d,e)}function secp192r1(){var a=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"),b=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"),c=fromHex("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"),d=fromHex("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"),e=BigInteger.ONE,f=new ECCurveFp(a,b,c),g=f.decodePointHex("04188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF101207192B95FFC8DA78631011ED6B24CDD573F977A11E794811");return new X9ECParameters(f,g,d,e)}function secp224r1(){var a=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"),b=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"),c=fromHex("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"),d=fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"),e=BigInteger.ONE,f=new ECCurveFp(a,b,c),g=f.decodePointHex("04B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34");return new X9ECParameters(f,g,d,e)}function secp256r1(){var a=fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),b=fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),c=fromHex("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),d=fromHex("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),e=BigInteger.ONE,f=new ECCurveFp(a,b,c),g=f.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5");return new X9ECParameters(f,g,d,e)}function getSECCurveByName(a){return"secp128r1"==a?secp128r1():"secp160k1"==a?secp160k1():"secp160r1"==a?secp160r1():"secp192k1"==a?secp192k1():"secp192r1"==a?secp192r1():"secp224r1"==a?secp224r1():"secp256r1"==a?secp256r1():null}function Base64x(){}function stoBA(a){for(var b=new Array,c=0;c0&&b-1 in a))}function d(a,b,c){if(_.isFunction(b))return _.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return _.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(ha.test(b))return _.filter(b,a,c);b=_.filter(b,a)}return _.grep(a,function(a){return U.call(b,a)>=0!==c})}function e(a,b){for(;(a=a[b])&&1!==a.nodeType;);return a}function f(a){var b=oa[a]={};return _.each(a.match(na)||[],function(a,c){b[c]=!0}),b}function g(){Z.removeEventListener("DOMContentLoaded",g,!1),a.removeEventListener("load",g,!1),_.ready()}function h(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=_.expando+Math.random()}function i(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(ua,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c||"false"!==c&&("null"===c?null:+c+""===c?+c:ta.test(c)?_.parseJSON(c):c)}catch(a){}sa.set(a,b,c)}else c=void 0;return c}function j(){return!0}function k(){return!1}function l(){try{return Z.activeElement}catch(a){}}function m(a,b){return _.nodeName(a,"table")&&_.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function n(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function o(a){var b=Ka.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function p(a,b){for(var c=0,d=a.length;c")).appendTo(b.documentElement),b=Na[0].contentDocument,b.write(),b.close(),c=t(a,b),Na.detach()),Oa[a]=c),c}function v(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||_.contains(a.ownerDocument,a)||(g=_.style(a,b)),Qa.test(g)&&Pa.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function w(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}function x(a,b){if(b in a)return b;for(var c=b[0].toUpperCase()+b.slice(1),d=b,e=Xa.length;e--;)if(b=Xa[e]+c,b in a)return b;return d}function y(a,b,c){var d=Ta.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function z(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;f<4;f+=2)"margin"===c&&(g+=_.css(a,c+wa[f],!0,e)),d?("content"===c&&(g-=_.css(a,"padding"+wa[f],!0,e)),"margin"!==c&&(g-=_.css(a,"border"+wa[f]+"Width",!0,e))):(g+=_.css(a,"padding"+wa[f],!0,e),"padding"!==c&&(g+=_.css(a,"border"+wa[f]+"Width",!0,e)));return g}function A(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ra(a),g="border-box"===_.css(a,"boxSizing",!1,f);if(e<=0||null==e){if(e=v(a,b,f),(e<0||null==e)&&(e=a.style[b]),Qa.test(e))return e;d=g&&(Y.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+z(a,b,c||(g?"border":"content"),d,f)+"px"}function B(a,b){for(var c,d,e,f=[],g=0,h=a.length;g=0&&c=0},isPlainObject:function(a){return"object"===_.type(a)&&!a.nodeType&&!_.isWindow(a)&&!(a.constructor&&!X.call(a.constructor.prototype,"isPrototypeOf"))},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?V[W.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=_.trim(a),a&&(1===a.indexOf("use strict")?(b=Z.createElement("script"),b.text=a,Z.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(ba,"ms-").replace(ca,da)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,d){var e,f=0,g=a.length,h=c(a);if(d){if(h)for(;fw.cacheLength&&delete a[b.shift()],a[c+" "]=d}var b=[];return a}function d(a){return a[N]=!0,a}function e(a){var b=G.createElement("div");try{return!!a(b)}catch(a){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function f(a,b){for(var c=a.split("|"),d=a.length;d--;)w.attrHandle[c[d]]=b}function g(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||W)-(~a.sourceIndex||W);if(d)return d;if(c)for(;c=c.nextSibling;)if(c===b)return-1;return a?1:-1}function h(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function i(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function j(a){return d(function(b){return b=+b,d(function(c,d){for(var e,f=a([],c.length,b),g=f.length;g--;)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function k(a){return a&&typeof a.getElementsByTagName!==V&&a}function l(){}function m(a){for(var b=0,c=a.length,d="";b1?function(b,c,d){for(var e=a.length;e--;)if(!a[e](b,c,d))return!1;return!0}:a[0]}function p(a,c,d){for(var e=0,f=c.length;e-1&&(d[j]=!(g[j]=l))}}else t=q(t===g?t.splice(o,t.length):t),f?f(null,g,t,i):_.apply(g,t)})}function s(a){for(var b,c,d,e=a.length,f=w.relative[a[0].type],g=f||w.relative[" "],h=f?1:0,i=n(function(a){return a===b},g,!0),j=n(function(a){return ba.call(b,a)>-1},g,!0),k=[function(a,c,d){return!f&&(d||c!==C)||((b=c).nodeType?i(a,c,d):j(a,c,d))}];h1&&o(k),h>1&&m(a.slice(0,h-1).concat({value:" "===a[h-2].type?"*":""})).replace(ia,"$1"),c,h0,f=a.length>0,g=function(d,g,h,i,j){var k,l,m,n=0,o="0",p=d&&[],r=[],s=C,t=d||f&&w.find.TAG("*",j),u=P+=null==s?1:Math.random()||.1,v=t.length;for(j&&(C=g!==G&&g);o!==v&&null!=(k=t[o]);o++){if(f&&k){for(l=0;m=a[l++];)if(m(k,g,h)){i.push(k);break}j&&(P=u)}e&&((k=!m&&k)&&n--,d&&p.push(k))}if(n+=o,e&&o!==n){for(l=0;m=c[l++];)m(p,r,g,h);if(d){if(n>0)for(;o--;)p[o]||r[o]||(r[o]=Z.call(i));r=q(r)}_.apply(i,r),j&&!d&&r.length>0&&n+c.length>1&&b.uniqueSort(i)}return j&&(P=u,C=s),p};return e?d(g):g}var u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N="sizzle"+-new Date,O=a.document,P=0,Q=0,R=c(),S=c(),T=c(),U=function(a,b){return a===b&&(E=!0),0},V="undefined",W=1<<31,X={}.hasOwnProperty,Y=[],Z=Y.pop,$=Y.push,_=Y.push,aa=Y.slice,ba=Y.indexOf||function(a){for(var b=0,c=this.length;b+~]|"+da+")"+da+"*"),la=new RegExp("="+da+"*([^\\]'\"]*?)"+da+"*\\]","g"),ma=new RegExp(ha),na=new RegExp("^"+fa+"$"),oa={ID:new RegExp("^#("+ea+")"),CLASS:new RegExp("^\\.("+ea+")"),TAG:new RegExp("^("+ea.replace("w","w*")+")"),ATTR:new RegExp("^"+ga),PSEUDO:new RegExp("^"+ha),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+da+"*(even|odd|(([+-]|)(\\d*)n|)"+da+"*(?:([+-]|)"+da+"*(\\d+)|))"+da+"*\\)|)","i"),bool:new RegExp("^(?:"+ca+")$","i"),needsContext:new RegExp("^"+da+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+da+"*((?:-\\d)?\\d*)"+da+"*\\)|)(?=[^-]|$)","i")},pa=/^(?:input|select|textarea|button)$/i,qa=/^h\d$/i,ra=/^[^{]+\{\s*\[native \w/,sa=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ta=/[+~]/,ua=/'|\\/g,va=new RegExp("\\\\([\\da-f]{1,6}"+da+"?|("+da+")|.)","ig"),wa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{_.apply(Y=aa.call(O.childNodes),O.childNodes),Y[O.childNodes.length].nodeType}catch(a){_={apply:Y.length?function(a,b){$.apply(a,aa.call(b))}:function(a,b){for(var c=a.length,d=0;a[c++]=b[d++];);a.length=c-1}}}v=b.support={},y=b.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},F=b.setDocument=function(a){var b,c=a?a.ownerDocument||a:O,d=c.defaultView;return c!==G&&9===c.nodeType&&c.documentElement?(G=c,H=c.documentElement,I=!y(c),d&&d!==d.top&&(d.addEventListener?d.addEventListener("unload",function(){F()},!1):d.attachEvent&&d.attachEvent("onunload",function(){F()})),v.attributes=e(function(a){return a.className="i",!a.getAttribute("className")}),v.getElementsByTagName=e(function(a){return a.appendChild(c.createComment("")),!a.getElementsByTagName("*").length}),v.getElementsByClassName=ra.test(c.getElementsByClassName)&&e(function(a){return a.innerHTML="
          ",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),v.getById=e(function(a){return H.appendChild(a).id=N,!c.getElementsByName||!c.getElementsByName(N).length}),v.getById?(w.find.ID=function(a,b){if(typeof b.getElementById!==V&&I){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},w.filter.ID=function(a){var b=a.replace(va,wa);return function(a){return a.getAttribute("id")===b}}):(delete w.find.ID,w.filter.ID=function(a){var b=a.replace(va,wa);return function(a){var c=typeof a.getAttributeNode!==V&&a.getAttributeNode("id");return c&&c.value===b}}),w.find.TAG=v.getElementsByTagName?function(a,b){if(typeof b.getElementsByTagName!==V)return b.getElementsByTagName(a)}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){for(;c=f[e++];)1===c.nodeType&&d.push(c);return d}return f},w.find.CLASS=v.getElementsByClassName&&function(a,b){if(typeof b.getElementsByClassName!==V&&I)return b.getElementsByClassName(a)},K=[],J=[],(v.qsa=ra.test(c.querySelectorAll))&&(e(function(a){a.innerHTML="",a.querySelectorAll("[msallowclip^='']").length&&J.push("[*^$]="+da+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||J.push("\\["+da+"*(?:value|"+ca+")"),a.querySelectorAll(":checked").length||J.push(":checked")}),e(function(a){var b=c.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&J.push("name"+da+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||J.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),J.push(",.*:")})),(v.matchesSelector=ra.test(L=H.matches||H.webkitMatchesSelector||H.mozMatchesSelector||H.oMatchesSelector||H.msMatchesSelector))&&e(function(a){v.disconnectedMatch=L.call(a,"div"),L.call(a,"[s!='']:x"),K.push("!=",ha)}),J=J.length&&new RegExp(J.join("|")),K=K.length&&new RegExp(K.join("|")),b=ra.test(H.compareDocumentPosition),M=b||ra.test(H.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)for(;b=b.parentNode;)if(b===a)return!0;return!1},U=b?function(a,b){if(a===b)return E=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!v.sortDetached&&b.compareDocumentPosition(a)===d?a===c||a.ownerDocument===O&&M(O,a)?-1:b===c||b.ownerDocument===O&&M(O,b)?1:D?ba.call(D,a)-ba.call(D,b):0:4&d?-1:1)}:function(a,b){if(a===b)return E=!0,0;var d,e=0,f=a.parentNode,h=b.parentNode,i=[a],j=[b];if(!f||!h)return a===c?-1:b===c?1:f?-1:h?1:D?ba.call(D,a)-ba.call(D,b):0;if(f===h)return g(a,b);for(d=a;d=d.parentNode;)i.unshift(d);for(d=b;d=d.parentNode;)j.unshift(d);for(;i[e]===j[e];)e++;return e?g(i[e],j[e]):i[e]===O?-1:j[e]===O?1:0},c):G},b.matches=function(a,c){return b(a,null,null,c)},b.matchesSelector=function(a,c){if((a.ownerDocument||a)!==G&&F(a),c=c.replace(la,"='$1']"),v.matchesSelector&&I&&(!K||!K.test(c))&&(!J||!J.test(c)))try{var d=L.call(a,c);if(d||v.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(a){}return b(c,G,null,[a]).length>0},b.contains=function(a,b){return(a.ownerDocument||a)!==G&&F(a),M(a,b)},b.attr=function(a,b){(a.ownerDocument||a)!==G&&F(a);var c=w.attrHandle[b.toLowerCase()],d=c&&X.call(w.attrHandle,b.toLowerCase())?c(a,b,!I):void 0;return void 0!==d?d:v.attributes||!I?a.getAttribute(b):(d=a.getAttributeNode(b))&&d.specified?d.value:null},b.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},b.uniqueSort=function(a){var b,c=[],d=0,e=0;if(E=!v.detectDuplicates,D=!v.sortStable&&a.slice(0),a.sort(U),E){for(;b=a[e++];)b===a[e]&&(d=c.push(e));for(;d--;)a.splice(c[d],1)}return D=null,a},x=b.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(1===e||9===e||11===e){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=x(a)}else if(3===e||4===e)return a.nodeValue}else for(;b=a[d++];)c+=x(b);return c},w=b.selectors={cacheLength:50,createPseudo:d,match:oa,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(va,wa),a[3]=(a[3]||a[4]||a[5]||"").replace(va,wa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||b.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&b.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return oa.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&ma.test(c)&&(b=z(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(va,wa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=R[a+" "];return b||(b=new RegExp("(^|"+da+")"+a+"("+da+"|$)"))&&R(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==V&&a.getAttribute("class")||"")})},ATTR:function(a,c,d){return function(e){var f=b.attr(e,a);return null==f?"!="===c:!c||(f+="","="===c?f===d:"!="===c?f!==d:"^="===c?d&&0===f.indexOf(d):"*="===c?d&&f.indexOf(d)>-1:"$="===c?d&&f.slice(-d.length)===d:"~="===c?(" "+f+" ").indexOf(d)>-1:"|="===c&&(f===d||f.slice(0,d.length+1)===d+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){for(;p;){for(l=b;l=l[p];)if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){for(k=q[N]||(q[N]={}),j=k[a]||[],n=j[0]===P&&j[1],m=j[0]===P&&j[2],l=n&&q.childNodes[n];l=++n&&l&&l[p]||(m=n=0)||o.pop();)if(1===l.nodeType&&++m&&l===b){k[a]=[P,n,m];break}}else if(s&&(j=(b[N]||(b[N]={}))[a])&&j[0]===P)m=j[1];else for(;(l=++n&&l&&l[p]||(m=n=0)||o.pop())&&((h?l.nodeName.toLowerCase()!==r:1!==l.nodeType)||!++m||(s&&((l[N]||(l[N]={}))[a]=[P,m]),l!==b)););return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,c){var e,f=w.pseudos[a]||w.setFilters[a.toLowerCase()]||b.error("unsupported pseudo: "+a);return f[N]?f(c):f.length>1?(e=[a,a,"",c],w.setFilters.hasOwnProperty(a.toLowerCase())?d(function(a,b){for(var d,e=f(a,c),g=e.length;g--;)d=ba.call(a,e[g]),a[d]=!(b[d]=e[g])}):function(a){return f(a,0,e)}):f}},pseudos:{not:d(function(a){var b=[],c=[],e=A(a.replace(ia,"$1"));return e[N]?d(function(a,b,c,d){for(var f,g=e(a,null,d,[]),h=a.length;h--;)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,d,f){return b[0]=a,e(b,null,f,c),!c.pop()}}),has:d(function(a){return function(c){return b(a,c).length>0}}),contains:d(function(a){return function(b){return(b.textContent||b.innerText||x(b)).indexOf(a)>-1}}),lang:d(function(a){return na.test(a||"")||b.error("unsupported lang: "+a),a=a.replace(va,wa).toLowerCase(),function(b){var c;do if(c=I?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===H},focus:function(a){return a===G.activeElement&&(!G.hasFocus||G.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!w.pseudos.empty(a)},header:function(a){return qa.test(a.nodeName)},input:function(a){return pa.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:j(function(){return[0]}),last:j(function(a,b){return[b-1]}),eq:j(function(a,b,c){return[c<0?c+b:c]}),even:j(function(a,b){for(var c=0;c=0;)a.push(d);return a}),gt:j(function(a,b,c){for(var d=c<0?c+b:c;++d2&&"ID"===(g=f[0]).type&&v.getById&&9===b.nodeType&&I&&w.relative[f[1].type]){if(b=(w.find.ID(g.matches[0].replace(va,wa),b)||[])[0],!b)return c;j&&(b=b.parentNode),a=a.slice(f.shift().value.length)}for(e=oa.needsContext.test(a)?0:f.length;e--&&(g=f[e],!w.relative[h=g.type]);)if((i=w.find[h])&&(d=i(g.matches[0].replace(va,wa),ta.test(f[0].type)&&k(b.parentNode)||b))){if(f.splice(e,1),a=d.length&&m(f),!a)return _.apply(c,d),c;break}}return(j||A(a,l))(d,b,!I,c,ta.test(a)&&k(b.parentNode)||b),c},v.sortStable=N.split("").sort(U).join("")===N,v.detectDuplicates=!!E,F(),v.sortDetached=e(function(a){return 1&a.compareDocumentPosition(G.createElement("div"))}),e(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||f("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),v.attributes&&e(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||f("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),e(function(a){return null==a.getAttribute("disabled")})||f(ca,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),b}(a);_.find=ea,_.expr=ea.selectors,_.expr[":"]=_.expr.pseudos,_.unique=ea.uniqueSort,_.text=ea.getText,_.isXMLDoc=ea.isXML,_.contains=ea.contains;var fa=_.expr.match.needsContext,ga=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,ha=/^.[^:#\[\.,]*$/;_.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?_.find.matchesSelector(d,a)?[d]:[]:_.find.matches(a,_.grep(b,function(a){return 1===a.nodeType}))},_.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(_(a).filter(function(){for(b=0;b1?_.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(d(this,a||[],!1))},not:function(a){return this.pushStack(d(this,a||[],!0))},is:function(a){return!!d(this,"string"==typeof a&&fa.test(a)?_(a):a||[],!1).length}});var ia,ja=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ka=_.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:ja.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||ia).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof _?b[0]:b,_.merge(this,_.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:Z,!0)),ga.test(c[1])&&_.isPlainObject(b))for(c in b)_.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=Z.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=Z,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):_.isFunction(a)?"undefined"!=typeof ia.ready?ia.ready(a):a(_):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),_.makeArray(a,this))};ka.prototype=_.fn,ia=_(Z);var la=/^(?:parents|prev(?:Until|All))/,ma={children:!0,contents:!0,next:!0,prev:!0};_.extend({dir:function(a,b,c){for(var d=[],e=void 0!==c;(a=a[b])&&9!==a.nodeType;)if(1===a.nodeType){if(e&&_(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),_.fn.extend({has:function(a){var b=_(a,this),c=b.length;return this.filter(function(){for(var a=0;a-1:1===c.nodeType&&_.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?_.unique(f):f)},index:function(a){return a?"string"==typeof a?U.call(_(a),this[0]):U.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(_.unique(_.merge(this.get(),_(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}}),_.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return _.dir(a,"parentNode")},parentsUntil:function(a,b,c){return _.dir(a,"parentNode",c)},next:function(a){return e(a,"nextSibling")},prev:function(a){return e(a,"previousSibling")},nextAll:function(a){return _.dir(a,"nextSibling")},prevAll:function(a){return _.dir(a,"previousSibling")},nextUntil:function(a,b,c){return _.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return _.dir(a,"previousSibling",c)},siblings:function(a){return _.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return _.sibling(a.firstChild)},contents:function(a){return a.contentDocument||_.merge([],a.childNodes)}},function(a,b){_.fn[a]=function(c,d){var e=_.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=_.filter(d,e)),this.length>1&&(ma[a]||_.unique(e),la.test(a)&&e.reverse()),this.pushStack(e)}});var na=/\S+/g,oa={};_.Callbacks=function(a){a="string"==typeof a?oa[a]||f(a):_.extend({},a);var b,c,d,e,g,h,i=[],j=!a.once&&[],k=function(f){for(b=a.memory&&f,c=!0,h=e||0,e=0,g=i.length,d=!0;i&&h-1;)i.splice(c,1),d&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return a?_.inArray(a,i)>-1:!(!i||!i.length)},empty:function(){return i=[],g=0,this},disable:function(){return i=j=b=void 0,this},disabled:function(){return!i},lock:function(){return j=void 0,b||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return!i||c&&!j||(b=b||[],b=[a,b.slice?b.slice():b],d?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!c}};return l},_.extend({Deferred:function(a){var b=[["resolve","done",_.Callbacks("once memory"),"resolved"],["reject","fail",_.Callbacks("once memory"),"rejected"],["notify","progress",_.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return _.Deferred(function(c){_.each(b,function(b,f){var g=_.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&_.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?_.extend(a,d):d}},e={};return d.pipe=d.then,_.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b,c,d,e=0,f=R.call(arguments),g=f.length,h=1!==g||a&&_.isFunction(a.promise)?g:0,i=1===h?a:_.Deferred(),j=function(a,c,d){return function(e){c[a]=this,d[a]=arguments.length>1?R.call(arguments):e,d===b?i.notifyWith(c,d):--h||i.resolveWith(c,d)}};if(g>1)for(b=new Array(g),c=new Array(g),d=new Array(g);e0||(pa.resolveWith(Z,[_]),_.fn.triggerHandler&&(_(Z).triggerHandler("ready"),_(Z).off("ready"))))}}),_.ready.promise=function(b){return pa||(pa=_.Deferred(),"complete"===Z.readyState?setTimeout(_.ready):(Z.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1))),pa.promise(b)},_.ready.promise();var qa=_.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===_.type(c)){e=!0;for(h in c)_.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,_.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(_(a),c)})),b))for(;h1,null,!0)},removeData:function(a){return this.each(function(){sa.remove(this,a)})}}),_.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=ra.get(a,b),c&&(!d||_.isArray(c)?d=ra.access(a,b,_.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=_.queue(a,b),d=c.length,e=c.shift(),f=_._queueHooks(a,b),g=function(){_.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return ra.get(a,c)||ra.access(a,c,{empty:_.Callbacks("once memory").add(function(){ra.remove(a,[b+"queue",c])})})}}),_.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthx",Y.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var za="undefined";Y.focusinBubbles="onfocusin"in a;var Aa=/^key/,Ba=/^(?:mouse|pointer|contextmenu)|click/,Ca=/^(?:focusinfocus|focusoutblur)$/,Da=/^([^.]*)(?:\.(.+)|)$/;_.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=ra.get(a);if(q)for(c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=_.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return typeof _!==za&&_.event.triggered!==b.type?_.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(na)||[""],j=b.length;j--;)h=Da.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=_.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=_.event.special[n]||{},k=_.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&_.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),_.event.global[n]=!0)},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=ra.hasData(a)&&ra.get(a);if(q&&(i=q.events)){for(b=(b||"").match(na)||[""],j=b.length;j--;)if(h=Da.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){for(l=_.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;f--;)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||_.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)_.event.remove(a,n+b[j],c,d,!0);_.isEmptyObject(i)&&(delete q.handle,ra.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,j,k,l,m=[d||Z],n=X.call(b,"type")?b.type:b,o=X.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||Z,3!==d.nodeType&&8!==d.nodeType&&!Ca.test(n+_.event.triggered)&&(n.indexOf(".")>=0&&(o=n.split("."),n=o.shift(),o.sort()),j=n.indexOf(":")<0&&"on"+n,b=b[_.expando]?b:new _.Event(n,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=o.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:_.makeArray(c,[b]),l=_.event.special[n]||{},e||!l.trigger||l.trigger.apply(d,c)!==!1)){if(!e&&!l.noBubble&&!_.isWindow(d)){for(i=l.delegateType||n,Ca.test(i+n)||(g=g.parentNode);g;g=g.parentNode)m.push(g),h=g;h===(d.ownerDocument||Z)&&m.push(h.defaultView||h.parentWindow||a)}for(f=0;(g=m[f++])&&!b.isPropagationStopped();)b.type=f>1?i:l.bindType||n,k=(ra.get(g,"events")||{})[b.type]&&ra.get(g,"handle"),k&&k.apply(g,c),k=j&&g[j],k&&k.apply&&_.acceptData(g)&&(b.result=k.apply(g,c),b.result===!1&&b.preventDefault());return b.type=n,e||b.isDefaultPrevented()||l._default&&l._default.apply(m.pop(),c)!==!1||!_.acceptData(d)||j&&_.isFunction(d[n])&&!_.isWindow(d)&&(h=d[j],h&&(d[j]=null),_.event.triggered=n,d[n](),_.event.triggered=void 0,h&&(d[j]=h)),b.result}},dispatch:function(a){a=_.event.fix(a);var b,c,d,e,f,g=[],h=R.call(arguments),i=(ra.get(this,"events")||{})[a.type]||[],j=_.event.special[a.type]||{};if(h[0]=a,a.delegateTarget=this,!j.preDispatch||j.preDispatch.call(this,a)!==!1){for(g=_.event.handlers.call(this,a,i),b=0;(e=g[b++])&&!a.isPropagationStopped();)for(a.currentTarget=e.elem,c=0;(f=e.handlers[c++])&&!a.isImmediatePropagationStopped();)a.namespace_re&&!a.namespace_re.test(f.namespace)||(a.handleObj=f,a.data=f.data,d=((_.event.special[f.origType]||{}).handle||f.handler).apply(e.elem,h),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()));return j.postDispatch&&j.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;c=0:_.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,Fa=/<([\w:]+)/,Ga=/<|&#?\w+;/,Ha=/<(?:script|style|link)/i,Ia=/checked\s*(?:[^=]|=\s*.checked.)/i,Ja=/^$|\/(?:java|ecma)script/i,Ka=/^true\/(.*)/,La=/^\s*\s*$/g,Ma={option:[1,""],thead:[1,"","
          "],col:[2,"","
          "],tr:[2,"","
          "],td:[3,"","
          "],_default:[0,"",""]};Ma.optgroup=Ma.option,Ma.tbody=Ma.tfoot=Ma.colgroup=Ma.caption=Ma.thead,Ma.th=Ma.td,_.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=_.contains(a.ownerDocument,a);if(!(Y.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||_.isXMLDoc(a)))for(g=r(h),f=r(a),d=0,e=f.length;d0&&p(g,!i&&r(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,n=a.length;m")+h[2],j=h[0];j--;)f=f.lastChild;_.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));for(k.textContent="",m=0;e=l[m++];)if((!d||_.inArray(e,d)===-1)&&(i=_.contains(e.ownerDocument,e),f=r(k.appendChild(e),"script"),i&&p(f),c))for(j=0;e=f[j++];)Ja.test(e.type||"")&&c.push(e);return k},cleanData:function(a){for(var b,c,d,e,f=_.event.special,g=0;void 0!==(c=a[g]);g++){if(_.acceptData(c)&&(e=c[ra.expando],e&&(b=ra.cache[e]))){if(b.events)for(d in b.events)f[d]?_.event.remove(c,d):_.removeEvent(c,d,b.handle);ra.cache[e]&&delete ra.cache[e]}delete sa.cache[c[sa.expando]]}}}),_.fn.extend({text:function(a){return qa(this,function(a){return void 0===a?_.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=m(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=m(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?_.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||_.cleanData(r(c)),c.parentNode&&(b&&_.contains(c.ownerDocument,c)&&p(r(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(_.cleanData(r(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return _.clone(this,a,b)})},html:function(a){return qa(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!Ha.test(a)&&!Ma[(Fa.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ea,"<$1>");try{for(;c1&&"string"==typeof m&&!Y.checkClone&&Ia.test(m))return this.each(function(c){var d=k.eq(c);p&&(a[0]=m.call(this,c,d.html())),d.domManip(a,b)});if(j&&(c=_.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(e=_.map(r(c,"script"),n),f=e.length;i1)},show:function(){return B(this,!0)},hide:function(){return B(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){xa(this)?_(this).show():_(this).hide()})}}),_.Tween=C,C.prototype={constructor:C,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(_.cssNumber[c]?"":"px")},cur:function(){var a=C.propHooks[this.prop];return a&&a.get?a.get(this):C.propHooks._default.get(this)},run:function(a){var b,c=C.propHooks[this.prop];return this.options.duration?this.pos=b=_.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):C.propHooks._default.set(this),this}},C.prototype.init.prototype=C.prototype,C.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=_.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){_.fx.step[a.prop]?_.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[_.cssProps[a.prop]]||_.cssHooks[a.prop])?_.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},C.propHooks.scrollTop=C.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},_.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},_.fx=C.prototype.init,_.fx.step={};var Ya,Za,$a=/^(?:toggle|show|hide)$/,_a=new RegExp("^(?:([+-])=|)("+va+")([a-z%]*)$","i"),ab=/queueHooks$/,bb=[G],cb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=_a.exec(b),f=e&&e[3]||(_.cssNumber[a]?"":"px"),g=(_.cssNumber[a]||"px"!==f&&+d)&&_a.exec(_.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,_.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};_.Animation=_.extend(I,{tweener:function(a,b){_.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;d1)},removeAttr:function(a){return this.each(function(){_.removeAttr(this,a)})}}),_.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===za?_.prop(a,b,c):(1===f&&_.isXMLDoc(a)||(b=b.toLowerCase(),d=_.attrHooks[b]||(_.expr.match.bool.test(b)?eb:db)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=_.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void _.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(na);if(f&&1===a.nodeType)for(;c=f[e++];)d=_.propFix[c]||c,_.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!Y.radioValue&&"radio"===b&&_.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),eb={set:function(a,b,c){return b===!1?_.removeAttr(a,c):a.setAttribute(c,c),c}},_.each(_.expr.match.bool.source.match(/\w+/g),function(a,b){var c=fb[b]||_.find.attr;fb[b]=function(a,b,d){var e,f;return d||(f=fb[b],fb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,fb[b]=f),e}});var gb=/^(?:input|select|textarea|button)$/i;_.fn.extend({prop:function(a,b){return qa(this,_.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[_.propFix[a]||a]})}}),_.extend({propFix:{for:"htmlFor",class:"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!_.isXMLDoc(a),f&&(b=_.propFix[b]||b,e=_.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||gb.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),Y.optSelected||(_.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),_.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){_.propFix[this.toLowerCase()]=this});var hb=/[\t\r\n\f]/g;_.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(_.isFunction(a))return this.each(function(b){_(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(na)||[];i=0;)d=d.replace(" "+e+" "," ");g=a?_.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):_.isFunction(a)?this.each(function(c){_(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if("string"===c)for(var b,d=0,e=_(this),f=a.match(na)||[];b=f[d++];)e.hasClass(b)?e.removeClass(b):e.addClass(b);else c!==za&&"boolean"!==c||(this.className&&ra.set(this,"__className__",this.className),this.className=this.className||a===!1?"":ra.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;c=0)return!0;return!1}});var ib=/\r/g;_.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=_.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,_(this).val()):a,null==e?e="":"number"==typeof e?e+="":_.isArray(e)&&(e=_.map(e,function(a){return null==a?"":a+""})),b=_.valHooks[this.type]||_.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=_.valHooks[e.type]||_.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(ib,""):null==c?"":c)}}}),_.extend({valHooks:{option:{get:function(a){var b=_.find.attr(a,"value");return null!=b?b:_.trim(_.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||e<0,g=f?null:[],h=f?e+1:d.length,i=e<0?h:f?e:0;i=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),_.each(["radio","checkbox"],function(){_.valHooks[this]={set:function(a,b){if(_.isArray(b))return a.checked=_.inArray(_(a).val(),b)>=0}},Y.checkOn||(_.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),_.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 contextmenu".split(" "),function(a,b){_.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),_.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var jb=_.now(),kb=/\?/;_.parseJSON=function(a){return JSON.parse(a+"")},_.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(a){b=void 0}return b&&!b.getElementsByTagName("parsererror").length||_.error("Invalid XML: "+a),b};var lb,mb,nb=/#.*$/,ob=/([?&])_=[^&]*/,pb=/^(.*?):[ \t]*([^\r\n]*)$/gm,qb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,rb=/^(?:GET|HEAD)$/,sb=/^\/\//,tb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,ub={},vb={},wb="*/".concat("*");try{mb=location.href}catch(a){mb=Z.createElement("a"),mb.href="",mb=mb.href}lb=tb.exec(mb.toLowerCase())||[],_.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:mb,type:"GET",isLocal:qb.test(lb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":wb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":_.parseJSON,"text xml":_.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?L(L(a,_.ajaxSettings),b):L(_.ajaxSettings,a)},ajaxPrefilter:J(ub),ajaxTransport:J(vb),ajax:function(a,b){function c(a,b,c,g){var i,k,r,s,u,w=b;2!==t&&(t=2,h&&clearTimeout(h),d=void 0,f=g||"",v.readyState=a>0?4:0,i=a>=200&&a<300||304===a,c&&(s=M(l,v,c)),s=N(l,s,v,i),i?(l.ifModified&&(u=v.getResponseHeader("Last-Modified"),u&&(_.lastModified[e]=u),u=v.getResponseHeader("etag"),u&&(_.etag[e]=u)),204===a||"HEAD"===l.type?w="nocontent":304===a?w="notmodified":(w=s.state,k=s.data,r=s.error,i=!r)):(r=w,!a&&w||(w="error",a<0&&(a=0))),v.status=a,v.statusText=(b||w)+"",i?o.resolveWith(m,[k,w,v]):o.rejectWith(m,[v,w,r]),v.statusCode(q),q=void 0,j&&n.trigger(i?"ajaxSuccess":"ajaxError",[v,l,i?k:r]),p.fireWith(m,[v,w]),j&&(n.trigger("ajaxComplete",[v,l]),--_.active||_.event.trigger("ajaxStop")))}"object"==typeof a&&(b=a,a=void 0),b=b||{};var d,e,f,g,h,i,j,k,l=_.ajaxSetup({},b),m=l.context||l,n=l.context&&(m.nodeType||m.jquery)?_(m):_.event,o=_.Deferred(),p=_.Callbacks("once memory"),q=l.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!g)for(g={};b=pb.exec(f);)g[b[1].toLowerCase()]=b[2];b=g[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(l.mimeType=a),this},statusCode:function(a){var b;if(a)if(t<2)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return d&&d.abort(b),c(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,l.url=((a||l.url||mb)+"").replace(nb,"").replace(sb,lb[1]+"//"),l.type=b.method||b.type||l.method||l.type,l.dataTypes=_.trim(l.dataType||"*").toLowerCase().match(na)||[""],null==l.crossDomain&&(i=tb.exec(l.url.toLowerCase()),l.crossDomain=!(!i||i[1]===lb[1]&&i[2]===lb[2]&&(i[3]||("http:"===i[1]?"80":"443"))===(lb[3]||("http:"===lb[1]?"80":"443")))),l.data&&l.processData&&"string"!=typeof l.data&&(l.data=_.param(l.data,l.traditional)),K(ub,l,b,v),2===t)return v;j=l.global,j&&0===_.active++&&_.event.trigger("ajaxStart"),l.type=l.type.toUpperCase(),l.hasContent=!rb.test(l.type),e=l.url,l.hasContent||(l.data&&(e=l.url+=(kb.test(e)?"&":"?")+l.data,delete l.data),l.cache===!1&&(l.url=ob.test(e)?e.replace(ob,"$1_="+jb++):e+(kb.test(e)?"&":"?")+"_="+jb++)),l.ifModified&&(_.lastModified[e]&&v.setRequestHeader("If-Modified-Since",_.lastModified[e]),_.etag[e]&&v.setRequestHeader("If-None-Match",_.etag[e])),(l.data&&l.hasContent&&l.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",l.contentType),v.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+("*"!==l.dataTypes[0]?", "+wb+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)v.setRequestHeader(k,l.headers[k]);if(l.beforeSend&&(l.beforeSend.call(m,v,l)===!1||2===t))return v.abort();u="abort";for(k in{success:1,error:1,complete:1})v[k](l[k]);if(d=K(vb,l,b,v)){v.readyState=1,j&&n.trigger("ajaxSend",[v,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){v.abort("timeout")},l.timeout));try{t=1,d.send(r,c)}catch(a){if(!(t<2))throw a;c(-1,a)}}else c(-1,"No Transport");return v},getJSON:function(a,b,c){return _.get(a,b,c,"json")},getScript:function(a,b){return _.get(a,void 0,b,"script")}}),_.each(["get","post"],function(a,b){_[b]=function(a,c,d,e){return _.isFunction(c)&&(e=e||d,d=c,c=void 0),_.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),_.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){_.fn[b]=function(a){return this.on(b,a)}}),_._evalUrl=function(a){return _.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})},_.fn.extend({wrapAll:function(a){var b;return _.isFunction(a)?this.each(function(b){_(this).wrapAll(a.call(this,b))}):(this[0]&&(b=_(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){for(var a=this;a.firstElementChild;)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return _.isFunction(a)?this.each(function(b){_(this).wrapInner(a.call(this,b))}):this.each(function(){var b=_(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=_.isFunction(a);return this.each(function(c){_(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){_.nodeName(this,"body")||_(this).replaceWith(this.childNodes)}).end()}}),_.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},_.expr.filters.visible=function(a){return!_.expr.filters.hidden(a)};var xb=/%20/g,yb=/\[\]$/,zb=/\r?\n/g,Ab=/^(?:submit|button|image|reset|file)$/i,Bb=/^(?:input|select|textarea|keygen)/i;_.param=function(a,b){var c,d=[],e=function(a,b){b=_.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=_.ajaxSettings&&_.ajaxSettings.traditional),_.isArray(a)||a.jquery&&!_.isPlainObject(a))_.each(a,function(){e(this.name,this.value)});else for(c in a)O(c,a[c],b,e);return d.join("&").replace(xb,"+")},_.fn.extend({serialize:function(){return _.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=_.prop(this,"elements");return a?_.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!_(this).is(":disabled")&&Bb.test(this.nodeName)&&!Ab.test(a)&&(this.checked||!ya.test(a))}).map(function(a,b){var c=_(this).val();return null==c?null:_.isArray(c)?_.map(c,function(a){return{name:b.name,value:a.replace(zb,"\r\n")}}):{name:b.name,value:c.replace(zb,"\r\n")}}).get()}}),_.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Cb=0,Db={},Eb={0:200,1223:204},Fb=_.ajaxSettings.xhr();a.ActiveXObject&&_(a).on("unload",function(){for(var a in Db)Db[a]()}),Y.cors=!!Fb&&"withCredentials"in Fb,Y.ajax=Fb=!!Fb,_.ajaxTransport(function(a){var b;if(Y.cors||Fb&&!a.crossDomain)return{send:function(c,d){var e,f=a.xhr(),g=++Cb;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Db[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Eb[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Db[g]=b("abort");try{f.send(a.hasContent&&a.data||null)}catch(a){if(b)throw a}},abort:function(){b&&b()}}}),_.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return _.globalEval(a),a}}}),_.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),_.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=_("} - *
        • define style rules. See the example page for examples. - *
        • mark the {@code
          } and {@code } tags in your source with
          - *    {@code class=prettyprint.}
          - *    You can also use the (html deprecated) {@code } tag, but the pretty
          - *    printer needs to do more substantial DOM manipulations to support that, so
          - *    some css styles may not be preserved.
          - * </ol>
          - * That's it.  I wanted to keep the API as simple as possible, so there's no
          - * need to specify which language the code is in, but if you wish, you can add
          - * another class to the {@code <pre>} or {@code <code>} element to specify the
          - * language, as in {@code <pre class="prettyprint lang-java">}.  Any class that
          - * starts with "lang-" followed by a file extension, specifies the file type.
          - * See the "lang-*.js" files in this directory for code that implements
          - * per-language file handlers.
          - * <p>
          - * Change log:<br>
          - * cbeust, 2006/08/22
          - * <blockquote>
          - *   Java annotations (start with "@") are now captured as literals ("lit")
          - * </blockquote>
          - * @requires console
          - */
          -
          -// JSLint declarations
          -/*global console, document, navigator, setTimeout, window, define */
          -
          -/** @define {boolean} */
          -var IN_GLOBAL_SCOPE = true;
          -
          -/**
          - * Split {@code prettyPrint} into multiple timeouts so as not to interfere with
          - * UI events.
          - * If set to {@code false}, {@code prettyPrint()} is synchronous.
          - */
          -window['PR_SHOULD_USE_CONTINUATION'] = true;
          -
          -/**
          - * Pretty print a chunk of code.
          - * @param {string} sourceCodeHtml The HTML to pretty print.
          - * @param {string} opt_langExtension The language name to use.
          - *     Typically, a filename extension like 'cpp' or 'java'.
          - * @param {number|boolean} opt_numberLines True to number lines,
          - *     or the 1-indexed number of the first line in sourceCodeHtml.
          - * @return {string} code as html, but prettier
          - */
          -var prettyPrintOne;
          -/**
          - * Find all the {@code <pre>} and {@code <code>} tags in the DOM with
          - * {@code class=prettyprint} and prettify them.
          - *
          - * @param {Function} opt_whenDone called when prettifying is done.
          - * @param {HTMLElement|HTMLDocument} opt_root an element or document
          - *   containing all the elements to pretty print.
          - *   Defaults to {@code document.body}.
          - */
          -var prettyPrint;
          -
          -
          -(function () {
          -  var win = window;
          -  // Keyword lists for various languages.
          -  // We use things that coerce to strings to make them compact when minified
          -  // and to defeat aggressive optimizers that fold large string constants.
          -  var FLOW_CONTROL_KEYWORDS = ["break,continue,do,else,for,if,return,while"];
          -  var C_KEYWORDS = [FLOW_CONTROL_KEYWORDS,"auto,case,char,const,default," + 
          -      "double,enum,extern,float,goto,inline,int,long,register,short,signed," +
          -      "sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];
          -  var COMMON_KEYWORDS = [C_KEYWORDS,"catch,class,delete,false,import," +
          -      "new,operator,private,protected,public,this,throw,true,try,typeof"];
          -  var CPP_KEYWORDS = [COMMON_KEYWORDS,"alignof,align_union,asm,axiom,bool," +
          -      "concept,concept_map,const_cast,constexpr,decltype,delegate," +
          -      "dynamic_cast,explicit,export,friend,generic,late_check," +
          -      "mutable,namespace,nullptr,property,reinterpret_cast,static_assert," +
          -      "static_cast,template,typeid,typename,using,virtual,where"];
          -  var JAVA_KEYWORDS = [COMMON_KEYWORDS,
          -      "abstract,assert,boolean,byte,extends,final,finally,implements,import," +
          -      "instanceof,interface,null,native,package,strictfp,super,synchronized," +
          -      "throws,transient"];
          -  var CSHARP_KEYWORDS = [JAVA_KEYWORDS,
          -      "as,base,by,checked,decimal,delegate,descending,dynamic,event," +
          -      "fixed,foreach,from,group,implicit,in,internal,into,is,let," +
          -      "lock,object,out,override,orderby,params,partial,readonly,ref,sbyte," +
          -      "sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort," +
          -      "var,virtual,where"];
          -  var COFFEE_KEYWORDS = "all,and,by,catch,class,else,extends,false,finally," +
          -      "for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then," +
          -      "throw,true,try,unless,until,when,while,yes";
          -  var JSCRIPT_KEYWORDS = [COMMON_KEYWORDS,
          -      "debugger,eval,export,function,get,null,set,undefined,var,with," +
          -      "Infinity,NaN"];
          -  var PERL_KEYWORDS = "caller,delete,die,do,dump,elsif,eval,exit,foreach,for," +
          -      "goto,if,import,last,local,my,next,no,our,print,package,redo,require," +
          -      "sub,undef,unless,until,use,wantarray,while,BEGIN,END";
          -  var PYTHON_KEYWORDS = [FLOW_CONTROL_KEYWORDS, "and,as,assert,class,def,del," +
          -      "elif,except,exec,finally,from,global,import,in,is,lambda," +
          -      "nonlocal,not,or,pass,print,raise,try,with,yield," +
          -      "False,True,None"];
          -  var RUBY_KEYWORDS = [FLOW_CONTROL_KEYWORDS, "alias,and,begin,case,class," +
          -      "def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo," +
          -      "rescue,retry,self,super,then,true,undef,unless,until,when,yield," +
          -      "BEGIN,END"];
          -   var RUST_KEYWORDS = [FLOW_CONTROL_KEYWORDS, "as,assert,const,copy,drop," +
          -      "enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv," +
          -      "pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"];
          -  var SH_KEYWORDS = [FLOW_CONTROL_KEYWORDS, "case,done,elif,esac,eval,fi," +
          -      "function,in,local,set,then,until"];
          -  var ALL_KEYWORDS = [
          -      CPP_KEYWORDS, CSHARP_KEYWORDS, JSCRIPT_KEYWORDS, PERL_KEYWORDS,
          -      PYTHON_KEYWORDS, RUBY_KEYWORDS, SH_KEYWORDS];
          -  var C_TYPES = /^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;
          -
          -  // token style names.  correspond to css classes
          -  /**
          -   * token style for a string literal
          -   * @const
          -   */
          -  var PR_STRING = 'str';
          -  /**
          -   * token style for a keyword
          -   * @const
          -   */
          -  var PR_KEYWORD = 'kwd';
          -  /**
          -   * token style for a comment
          -   * @const
          -   */
          -  var PR_COMMENT = 'com';
          -  /**
          -   * token style for a type
          -   * @const
          -   */
          -  var PR_TYPE = 'typ';
          -  /**
          -   * token style for a literal value.  e.g. 1, null, true.
          -   * @const
          -   */
          -  var PR_LITERAL = 'lit';
          -  /**
          -   * token style for a punctuation string.
          -   * @const
          -   */
          -  var PR_PUNCTUATION = 'pun';
          -  /**
          -   * token style for plain text.
          -   * @const
          -   */
          -  var PR_PLAIN = 'pln';
          -
          -  /**
          -   * token style for an sgml tag.
          -   * @const
          -   */
          -  var PR_TAG = 'tag';
          -  /**
          -   * token style for a markup declaration such as a DOCTYPE.
          -   * @const
          -   */
          -  var PR_DECLARATION = 'dec';
          -  /**
          -   * token style for embedded source.
          -   * @const
          -   */
          -  var PR_SOURCE = 'src';
          -  /**
          -   * token style for an sgml attribute name.
          -   * @const
          -   */
          -  var PR_ATTRIB_NAME = 'atn';
          -  /**
          -   * token style for an sgml attribute value.
          -   * @const
          -   */
          -  var PR_ATTRIB_VALUE = 'atv';
          -
          -  /**
          -   * A class that indicates a section of markup that is not code, e.g. to allow
          -   * embedding of line numbers within code listings.
          -   * @const
          -   */
          -  var PR_NOCODE = 'nocode';
          -
          -  
          -  
          -  /**
          -   * A set of tokens that can precede a regular expression literal in
          -   * javascript
          -   * http://web.archive.org/web/20070717142515/http://www.mozilla.org/js/language/js20/rationale/syntax.html
          -   * has the full list, but I've removed ones that might be problematic when
          -   * seen in languages that don't support regular expression literals.
          -   *
          -   * <p>Specifically, I've removed any keywords that can't precede a regexp
          -   * literal in a syntactically legal javascript program, and I've removed the
          -   * "in" keyword since it's not a keyword in many languages, and might be used
          -   * as a count of inches.
          -   *
          -   * <p>The link above does not accurately describe EcmaScript rules since
          -   * it fails to distinguish between (a=++/b/i) and (a++/b/i) but it works
          -   * very well in practice.
          -   *
          -   * @private
          -   * @const
          -   */
          -  var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*';
          -  
          -  // CAVEAT: this does not properly handle the case where a regular
          -  // expression immediately follows another since a regular expression may
          -  // have flags for case-sensitivity and the like.  Having regexp tokens
          -  // adjacent is not valid in any language I'm aware of, so I'm punting.
          -  // TODO: maybe style special characters inside a regexp as punctuation.
          -
          -  /**
          -   * Given a group of {@link RegExp}s, returns a {@code RegExp} that globally
          -   * matches the union of the sets of strings matched by the input RegExp.
          -   * Since it matches globally, if the input strings have a start-of-input
          -   * anchor (/^.../), it is ignored for the purposes of unioning.
          -   * @param {Array.<RegExp>} regexs non multiline, non-global regexs.
          -   * @return {RegExp} a global regex.
          -   */
          -  function combinePrefixPatterns(regexs) {
          -    var capturedGroupIndex = 0;
          -  
          -    var needToFoldCase = false;
          -    var ignoreCase = false;
          -    for (var i = 0, n = regexs.length; i < n; ++i) {
          -      var regex = regexs[i];
          -      if (regex.ignoreCase) {
          -        ignoreCase = true;
          -      } else if (/[a-z]/i.test(regex.source.replace(
          -                     /\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, ''))) {
          -        needToFoldCase = true;
          -        ignoreCase = false;
          -        break;
          -      }
          -    }
          -  
          -    var escapeCharToCodeUnit = {
          -      'b': 8,
          -      't': 9,
          -      'n': 0xa,
          -      'v': 0xb,
          -      'f': 0xc,
          -      'r': 0xd
          -    };
          -  
          -    function decodeEscape(charsetPart) {
          -      var cc0 = charsetPart.charCodeAt(0);
          -      if (cc0 !== 92 /* \\ */) {
          -        return cc0;
          -      }
          -      var c1 = charsetPart.charAt(1);
          -      cc0 = escapeCharToCodeUnit[c1];
          -      if (cc0) {
          -        return cc0;
          -      } else if ('0' <= c1 && c1 <= '7') {
          -        return parseInt(charsetPart.substring(1), 8);
          -      } else if (c1 === 'u' || c1 === 'x') {
          -        return parseInt(charsetPart.substring(2), 16);
          -      } else {
          -        return charsetPart.charCodeAt(1);
          -      }
          -    }
          -  
          -    function encodeEscape(charCode) {
          -      if (charCode < 0x20) {
          -        return (charCode < 0x10 ? '\\x0' : '\\x') + charCode.toString(16);
          -      }
          -      var ch = String.fromCharCode(charCode);
          -      return (ch === '\\' || ch === '-' || ch === ']' || ch === '^')
          -          ? "\\" + ch : ch;
          -    }
          -  
          -    function caseFoldCharset(charSet) {
          -      var charsetParts = charSet.substring(1, charSet.length - 1).match(
          -          new RegExp(
          -              '\\\\u[0-9A-Fa-f]{4}'
          -              + '|\\\\x[0-9A-Fa-f]{2}'
          -              + '|\\\\[0-3][0-7]{0,2}'
          -              + '|\\\\[0-7]{1,2}'
          -              + '|\\\\[\\s\\S]'
          -              + '|-'
          -              + '|[^-\\\\]',
          -              'g'));
          -      var ranges = [];
          -      var inverse = charsetParts[0] === '^';
          -  
          -      var out = ['['];
          -      if (inverse) { out.push('^'); }
          -  
          -      for (var i = inverse ? 1 : 0, n = charsetParts.length; i < n; ++i) {
          -        var p = charsetParts[i];
          -        if (/\\[bdsw]/i.test(p)) {  // Don't muck with named groups.
          -          out.push(p);
          -        } else {
          -          var start = decodeEscape(p);
          -          var end;
          -          if (i + 2 < n && '-' === charsetParts[i + 1]) {
          -            end = decodeEscape(charsetParts[i + 2]);
          -            i += 2;
          -          } else {
          -            end = start;
          -          }
          -          ranges.push([start, end]);
          -          // If the range might intersect letters, then expand it.
          -          // This case handling is too simplistic.
          -          // It does not deal with non-latin case folding.
          -          // It works for latin source code identifiers though.
          -          if (!(end < 65 || start > 122)) {
          -            if (!(end < 65 || start > 90)) {
          -              ranges.push([Math.max(65, start) | 32, Math.min(end, 90) | 32]);
          -            }
          -            if (!(end < 97 || start > 122)) {
          -              ranges.push([Math.max(97, start) & ~32, Math.min(end, 122) & ~32]);
          -            }
          -          }
          -        }
          -      }
          -  
          -      // [[1, 10], [3, 4], [8, 12], [14, 14], [16, 16], [17, 17]]
          -      // -> [[1, 12], [14, 14], [16, 17]]
          -      ranges.sort(function (a, b) { return (a[0] - b[0]) || (b[1]  - a[1]); });
          -      var consolidatedRanges = [];
          -      var lastRange = [];
          -      for (var i = 0; i < ranges.length; ++i) {
          -        var range = ranges[i];
          -        if (range[0] <= lastRange[1] + 1) {
          -          lastRange[1] = Math.max(lastRange[1], range[1]);
          -        } else {
          -          consolidatedRanges.push(lastRange = range);
          -        }
          -      }
          -  
          -      for (var i = 0; i < consolidatedRanges.length; ++i) {
          -        var range = consolidatedRanges[i];
          -        out.push(encodeEscape(range[0]));
          -        if (range[1] > range[0]) {
          -          if (range[1] + 1 > range[0]) { out.push('-'); }
          -          out.push(encodeEscape(range[1]));
          -        }
          -      }
          -      out.push(']');
          -      return out.join('');
          -    }
          -  
          -    function allowAnywhereFoldCaseAndRenumberGroups(regex) {
          -      // Split into character sets, escape sequences, punctuation strings
          -      // like ('(', '(?:', ')', '^'), and runs of characters that do not
          -      // include any of the above.
          -      var parts = regex.source.match(
          -          new RegExp(
          -              '(?:'
          -              + '\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]'  // a character set
          -              + '|\\\\u[A-Fa-f0-9]{4}'  // a unicode escape
          -              + '|\\\\x[A-Fa-f0-9]{2}'  // a hex escape
          -              + '|\\\\[0-9]+'  // a back-reference or octal escape
          -              + '|\\\\[^ux0-9]'  // other escape sequence
          -              + '|\\(\\?[:!=]'  // start of a non-capturing group
          -              + '|[\\(\\)\\^]'  // start/end of a group, or line start
          -              + '|[^\\x5B\\x5C\\(\\)\\^]+'  // run of other characters
          -              + ')',
          -              'g'));
          -      var n = parts.length;
          -  
          -      // Maps captured group numbers to the number they will occupy in
          -      // the output or to -1 if that has not been determined, or to
          -      // undefined if they need not be capturing in the output.
          -      var capturedGroups = [];
          -  
          -      // Walk over and identify back references to build the capturedGroups
          -      // mapping.
          -      for (var i = 0, groupIndex = 0; i < n; ++i) {
          -        var p = parts[i];
          -        if (p === '(') {
          -          // groups are 1-indexed, so max group index is count of '('
          -          ++groupIndex;
          -        } else if ('\\' === p.charAt(0)) {
          -          var decimalValue = +p.substring(1);
          -          if (decimalValue) {
          -            if (decimalValue <= groupIndex) {
          -              capturedGroups[decimalValue] = -1;
          -            } else {
          -              // Replace with an unambiguous escape sequence so that
          -              // an octal escape sequence does not turn into a backreference
          -              // to a capturing group from an earlier regex.
          -              parts[i] = encodeEscape(decimalValue);
          -            }
          -          }
          -        }
          -      }
          -  
          -      // Renumber groups and reduce capturing groups to non-capturing groups
          -      // where possible.
          -      for (var i = 1; i < capturedGroups.length; ++i) {
          -        if (-1 === capturedGroups[i]) {
          -          capturedGroups[i] = ++capturedGroupIndex;
          -        }
          -      }
          -      for (var i = 0, groupIndex = 0; i < n; ++i) {
          -        var p = parts[i];
          -        if (p === '(') {
          -          ++groupIndex;
          -          if (!capturedGroups[groupIndex]) {
          -            parts[i] = '(?:';
          -          }
          -        } else if ('\\' === p.charAt(0)) {
          -          var decimalValue = +p.substring(1);
          -          if (decimalValue && decimalValue <= groupIndex) {
          -            parts[i] = '\\' + capturedGroups[decimalValue];
          -          }
          -        }
          -      }
          -  
          -      // Remove any prefix anchors so that the output will match anywhere.
          -      // ^^ really does mean an anchored match though.
          -      for (var i = 0; i < n; ++i) {
          -        if ('^' === parts[i] && '^' !== parts[i + 1]) { parts[i] = ''; }
          -      }
          -  
          -      // Expand letters to groups to handle mixing of case-sensitive and
          -      // case-insensitive patterns if necessary.
          -      if (regex.ignoreCase && needToFoldCase) {
          -        for (var i = 0; i < n; ++i) {
          -          var p = parts[i];
          -          var ch0 = p.charAt(0);
          -          if (p.length >= 2 && ch0 === '[') {
          -            parts[i] = caseFoldCharset(p);
          -          } else if (ch0 !== '\\') {
          -            // TODO: handle letters in numeric escapes.
          -            parts[i] = p.replace(
          -                /[a-zA-Z]/g,
          -                function (ch) {
          -                  var cc = ch.charCodeAt(0);
          -                  return '[' + String.fromCharCode(cc & ~32, cc | 32) + ']';
          -                });
          -          }
          -        }
          -      }
          -  
          -      return parts.join('');
          -    }
          -  
          -    var rewritten = [];
          -    for (var i = 0, n = regexs.length; i < n; ++i) {
          -      var regex = regexs[i];
          -      if (regex.global || regex.multiline) { throw new Error('' + regex); }
          -      rewritten.push(
          -          '(?:' + allowAnywhereFoldCaseAndRenumberGroups(regex) + ')');
          -    }
          -  
          -    return new RegExp(rewritten.join('|'), ignoreCase ? 'gi' : 'g');
          -  }
          -
          -  /**
          -   * Split markup into a string of source code and an array mapping ranges in
          -   * that string to the text nodes in which they appear.
          -   *
          -   * <p>
          -   * The HTML DOM structure:</p>
          -   * <pre>
          -   * (Element   "p"
          -   *   (Element "b"
          -   *     (Text  "print "))       ; #1
          -   *   (Text    "'Hello '")      ; #2
          -   *   (Element "br")            ; #3
          -   *   (Text    "  + 'World';")) ; #4
          -   * </pre>
          -   * <p>
          -   * corresponds to the HTML
          -   * {@code <p><b>print </b>'Hello '<br>  + 'World';</p>}.</p>
          -   *
          -   * <p>
          -   * It will produce the output:</p>
          -   * <pre>
          -   * {
          -   *   sourceCode: "print 'Hello '\n  + 'World';",
          -   *   //                     1          2
          -   *   //           012345678901234 5678901234567
          -   *   spans: [0, #1, 6, #2, 14, #3, 15, #4]
          -   * }
          -   * </pre>
          -   * <p>
          -   * where #1 is a reference to the {@code "print "} text node above, and so
          -   * on for the other text nodes.
          -   * </p>
          -   *
          -   * <p>
          -   * The {@code} spans array is an array of pairs.  Even elements are the start
          -   * indices of substrings, and odd elements are the text nodes (or BR elements)
          -   * that contain the text for those substrings.
          -   * Substrings continue until the next index or the end of the source.
          -   * </p>
          -   *
          -   * @param {Node} node an HTML DOM subtree containing source-code.
          -   * @param {boolean} isPreformatted true if white-space in text nodes should
          -   *    be considered significant.
          -   * @return {Object} source code and the text nodes in which they occur.
          -   */
          -  function extractSourceSpans(node, isPreformatted) {
          -    var nocode = /(?:^|\s)nocode(?:\s|$)/;
          -  
          -    var chunks = [];
          -    var length = 0;
          -    var spans = [];
          -    var k = 0;
          -  
          -    function walk(node) {
          -      var type = node.nodeType;
          -      if (type == 1) {  // Element
          -        if (nocode.test(node.className)) { return; }
          -        for (var child = node.firstChild; child; child = child.nextSibling) {
          -          walk(child);
          -        }
          -        var nodeName = node.nodeName.toLowerCase();
          -        if ('br' === nodeName || 'li' === nodeName) {
          -          chunks[k] = '\n';
          -          spans[k << 1] = length++;
          -          spans[(k++ << 1) | 1] = node;
          -        }
          -      } else if (type == 3 || type == 4) {  // Text
          -        var text = node.nodeValue;
          -        if (text.length) {
          -          if (!isPreformatted) {
          -            text = text.replace(/[ \t\r\n]+/g, ' ');
          -          } else {
          -            text = text.replace(/\r\n?/g, '\n');  // Normalize newlines.
          -          }
          -          // TODO: handle tabs here?
          -          chunks[k] = text;
          -          spans[k << 1] = length;
          -          length += text.length;
          -          spans[(k++ << 1) | 1] = node;
          -        }
          -      }
          -    }
          -  
          -    walk(node);
          -  
          -    return {
          -      sourceCode: chunks.join('').replace(/\n$/, ''),
          -      spans: spans
          -    };
          -  }
          -
          -  /**
          -   * Apply the given language handler to sourceCode and add the resulting
          -   * decorations to out.
          -   * @param {number} basePos the index of sourceCode within the chunk of source
          -   *    whose decorations are already present on out.
          -   */
          -  function appendDecorations(basePos, sourceCode, langHandler, out) {
          -    if (!sourceCode) { return; }
          -    var job = {
          -      sourceCode: sourceCode,
          -      basePos: basePos
          -    };
          -    langHandler(job);
          -    out.push.apply(out, job.decorations);
          -  }
          -
          -  var notWs = /\S/;
          -
          -  /**
          -   * Given an element, if it contains only one child element and any text nodes
          -   * it contains contain only space characters, return the sole child element.
          -   * Otherwise returns undefined.
          -   * <p>
          -   * This is meant to return the CODE element in {@code <pre><code ...>} when
          -   * there is a single child element that contains all the non-space textual
          -   * content, but not to return anything where there are multiple child elements
          -   * as in {@code <pre><code>...</code><code>...</code></pre>} or when there
          -   * is textual content.
          -   */
          -  function childContentWrapper(element) {
          -    var wrapper = undefined;
          -    for (var c = element.firstChild; c; c = c.nextSibling) {
          -      var type = c.nodeType;
          -      wrapper = (type === 1)  // Element Node
          -          ? (wrapper ? element : c)
          -          : (type === 3)  // Text Node
          -          ? (notWs.test(c.nodeValue) ? element : wrapper)
          -          : wrapper;
          -    }
          -    return wrapper === element ? undefined : wrapper;
          -  }
          -
          -  /** Given triples of [style, pattern, context] returns a lexing function,
          -    * The lexing function interprets the patterns to find token boundaries and
          -    * returns a decoration list of the form
          -    * [index_0, style_0, index_1, style_1, ..., index_n, style_n]
          -    * where index_n is an index into the sourceCode, and style_n is a style
          -    * constant like PR_PLAIN.  index_n-1 <= index_n, and style_n-1 applies to
          -    * all characters in sourceCode[index_n-1:index_n].
          -    *
          -    * The stylePatterns is a list whose elements have the form
          -    * [style : string, pattern : RegExp, DEPRECATED, shortcut : string].
          -    *
          -    * Style is a style constant like PR_PLAIN, or can be a string of the
          -    * form 'lang-FOO', where FOO is a language extension describing the
          -    * language of the portion of the token in $1 after pattern executes.
          -    * E.g., if style is 'lang-lisp', and group 1 contains the text
          -    * '(hello (world))', then that portion of the token will be passed to the
          -    * registered lisp handler for formatting.
          -    * The text before and after group 1 will be restyled using this decorator
          -    * so decorators should take care that this doesn't result in infinite
          -    * recursion.  For example, the HTML lexer rule for SCRIPT elements looks
          -    * something like ['lang-js', /<[s]cript>(.+?)<\/script>/].  This may match
          -    * '<script>foo()<\/script>', which would cause the current decorator to
          -    * be called with '<script>' which would not match the same rule since
          -    * group 1 must not be empty, so it would be instead styled as PR_TAG by
          -    * the generic tag rule.  The handler registered for the 'js' extension would
          -    * then be called with 'foo()', and finally, the current decorator would
          -    * be called with '<\/script>' which would not match the original rule and
          -    * so the generic tag rule would identify it as a tag.
          -    *
          -    * Pattern must only match prefixes, and if it matches a prefix, then that
          -    * match is considered a token with the same style.
          -    *
          -    * Context is applied to the last non-whitespace, non-comment token
          -    * recognized.
          -    *
          -    * Shortcut is an optional string of characters, any of which, if the first
          -    * character, gurantee that this pattern and only this pattern matches.
          -    *
          -    * @param {Array} shortcutStylePatterns patterns that always start with
          -    *   a known character.  Must have a shortcut string.
          -    * @param {Array} fallthroughStylePatterns patterns that will be tried in
          -    *   order if the shortcut ones fail.  May have shortcuts.
          -    *
          -    * @return {function (Object)} a
          -    *   function that takes source code and returns a list of decorations.
          -    */
          -  function createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns) {
          -    var shortcuts = {};
          -    var tokenizer;
          -    (function () {
          -      var allPatterns = shortcutStylePatterns.concat(fallthroughStylePatterns);
          -      var allRegexs = [];
          -      var regexKeys = {};
          -      for (var i = 0, n = allPatterns.length; i < n; ++i) {
          -        var patternParts = allPatterns[i];
          -        var shortcutChars = patternParts[3];
          -        if (shortcutChars) {
          -          for (var c = shortcutChars.length; --c >= 0;) {
          -            shortcuts[shortcutChars.charAt(c)] = patternParts;
          -          }
          -        }
          -        var regex = patternParts[1];
          -        var k = '' + regex;
          -        if (!regexKeys.hasOwnProperty(k)) {
          -          allRegexs.push(regex);
          -          regexKeys[k] = null;
          -        }
          -      }
          -      allRegexs.push(/[\0-\uffff]/);
          -      tokenizer = combinePrefixPatterns(allRegexs);
          -    })();
          -
          -    var nPatterns = fallthroughStylePatterns.length;
          -
          -    /**
          -     * Lexes job.sourceCode and produces an output array job.decorations of
          -     * style classes preceded by the position at which they start in
          -     * job.sourceCode in order.
          -     *
          -     * @param {Object} job an object like <pre>{
          -     *    sourceCode: {string} sourceText plain text,
          -     *    basePos: {int} position of job.sourceCode in the larger chunk of
          -     *        sourceCode.
          -     * }</pre>
          -     */
          -    var decorate = function (job) {
          -      var sourceCode = job.sourceCode, basePos = job.basePos;
          -      /** Even entries are positions in source in ascending order.  Odd enties
          -        * are style markers (e.g., PR_COMMENT) that run from that position until
          -        * the end.
          -        * @type {Array.<number|string>}
          -        */
          -      var decorations = [basePos, PR_PLAIN];
          -      var pos = 0;  // index into sourceCode
          -      var tokens = sourceCode.match(tokenizer) || [];
          -      var styleCache = {};
          -
          -      for (var ti = 0, nTokens = tokens.length; ti < nTokens; ++ti) {
          -        var token = tokens[ti];
          -        var style = styleCache[token];
          -        var match = void 0;
          -
          -        var isEmbedded;
          -        if (typeof style === 'string') {
          -          isEmbedded = false;
          -        } else {
          -          var patternParts = shortcuts[token.charAt(0)];
          -          if (patternParts) {
          -            match = token.match(patternParts[1]);
          -            style = patternParts[0];
          -          } else {
          -            for (var i = 0; i < nPatterns; ++i) {
          -              patternParts = fallthroughStylePatterns[i];
          -              match = token.match(patternParts[1]);
          -              if (match) {
          -                style = patternParts[0];
          -                break;
          -              }
          -            }
          -
          -            if (!match) {  // make sure that we make progress
          -              style = PR_PLAIN;
          -            }
          -          }
          -
          -          isEmbedded = style.length >= 5 && 'lang-' === style.substring(0, 5);
          -          if (isEmbedded && !(match && typeof match[1] === 'string')) {
          -            isEmbedded = false;
          -            style = PR_SOURCE;
          -          }
          -
          -          if (!isEmbedded) { styleCache[token] = style; }
          -        }
          -
          -        var tokenStart = pos;
          -        pos += token.length;
          -
          -        if (!isEmbedded) {
          -          decorations.push(basePos + tokenStart, style);
          -        } else {  // Treat group 1 as an embedded block of source code.
          -          var embeddedSource = match[1];
          -          var embeddedSourceStart = token.indexOf(embeddedSource);
          -          var embeddedSourceEnd = embeddedSourceStart + embeddedSource.length;
          -          if (match[2]) {
          -            // If embeddedSource can be blank, then it would match at the
          -            // beginning which would cause us to infinitely recurse on the
          -            // entire token, so we catch the right context in match[2].
          -            embeddedSourceEnd = token.length - match[2].length;
          -            embeddedSourceStart = embeddedSourceEnd - embeddedSource.length;
          -          }
          -          var lang = style.substring(5);
          -          // Decorate the left of the embedded source
          -          appendDecorations(
          -              basePos + tokenStart,
          -              token.substring(0, embeddedSourceStart),
          -              decorate, decorations);
          -          // Decorate the embedded source
          -          appendDecorations(
          -              basePos + tokenStart + embeddedSourceStart,
          -              embeddedSource,
          -              langHandlerForExtension(lang, embeddedSource),
          -              decorations);
          -          // Decorate the right of the embedded section
          -          appendDecorations(
          -              basePos + tokenStart + embeddedSourceEnd,
          -              token.substring(embeddedSourceEnd),
          -              decorate, decorations);
          -        }
          -      }
          -      job.decorations = decorations;
          -    };
          -    return decorate;
          -  }
          -
          -  /** returns a function that produces a list of decorations from source text.
          -    *
          -    * This code treats ", ', and ` as string delimiters, and \ as a string
          -    * escape.  It does not recognize perl's qq() style strings.
          -    * It has no special handling for double delimiter escapes as in basic, or
          -    * the tripled delimiters used in python, but should work on those regardless
          -    * although in those cases a single string literal may be broken up into
          -    * multiple adjacent string literals.
          -    *
          -    * It recognizes C, C++, and shell style comments.
          -    *
          -    * @param {Object} options a set of optional parameters.
          -    * @return {function (Object)} a function that examines the source code
          -    *     in the input job and builds the decoration list.
          -    */
          -  function sourceDecorator(options) {
          -    var shortcutStylePatterns = [], fallthroughStylePatterns = [];
          -    if (options['tripleQuotedStrings']) {
          -      // '''multi-line-string''', 'single-line-string', and double-quoted
          -      shortcutStylePatterns.push(
          -          [PR_STRING,  /^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,
          -           null, '\'"']);
          -    } else if (options['multiLineStrings']) {
          -      // 'multi-line-string', "multi-line-string"
          -      shortcutStylePatterns.push(
          -          [PR_STRING,  /^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,
          -           null, '\'"`']);
          -    } else {
          -      // 'single-line-string', "single-line-string"
          -      shortcutStylePatterns.push(
          -          [PR_STRING,
          -           /^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,
          -           null, '"\'']);
          -    }
          -    if (options['verbatimStrings']) {
          -      // verbatim-string-literal production from the C# grammar.  See issue 93.
          -      fallthroughStylePatterns.push(
          -          [PR_STRING, /^@\"(?:[^\"]|\"\")*(?:\"|$)/, null]);
          -    }
          -    var hc = options['hashComments'];
          -    if (hc) {
          -      if (options['cStyleComments']) {
          -        if (hc > 1) {  // multiline hash comments
          -          shortcutStylePatterns.push(
          -              [PR_COMMENT, /^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/, null, '#']);
          -        } else {
          -          // Stop C preprocessor declarations at an unclosed open comment
          -          shortcutStylePatterns.push(
          -              [PR_COMMENT, /^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,
          -               null, '#']);
          -        }
          -        // #include <stdio.h>
          -        fallthroughStylePatterns.push(
          -            [PR_STRING,
          -             /^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,
          -             null]);
          -      } else {
          -        shortcutStylePatterns.push([PR_COMMENT, /^#[^\r\n]*/, null, '#']);
          -      }
          -    }
          -    if (options['cStyleComments']) {
          -      fallthroughStylePatterns.push([PR_COMMENT, /^\/\/[^\r\n]*/, null]);
          -      fallthroughStylePatterns.push(
          -          [PR_COMMENT, /^\/\*[\s\S]*?(?:\*\/|$)/, null]);
          -    }
          -    var regexLiterals = options['regexLiterals'];
          -    if (regexLiterals) {
          -      /**
          -       * @const
          -       */
          -      var regexExcls = regexLiterals > 1
          -        ? ''  // Multiline regex literals
          -        : '\n\r';
          -      /**
          -       * @const
          -       */
          -      var regexAny = regexExcls ? '.' : '[\\S\\s]';
          -      /**
          -       * @const
          -       */
          -      var REGEX_LITERAL = (
          -          // A regular expression literal starts with a slash that is
          -          // not followed by * or / so that it is not confused with
          -          // comments.
          -          '/(?=[^/*' + regexExcls + '])'
          -          // and then contains any number of raw characters,
          -          + '(?:[^/\\x5B\\x5C' + regexExcls + ']'
          -          // escape sequences (\x5C),
          -          +    '|\\x5C' + regexAny
          -          // or non-nesting character sets (\x5B\x5D);
          -          +    '|\\x5B(?:[^\\x5C\\x5D' + regexExcls + ']'
          -          +             '|\\x5C' + regexAny + ')*(?:\\x5D|$))+'
          -          // finally closed by a /.
          -          + '/');
          -      fallthroughStylePatterns.push(
          -          ['lang-regex',
          -           RegExp('^' + REGEXP_PRECEDER_PATTERN + '(' + REGEX_LITERAL + ')')
          -           ]);
          -    }
          -
          -    var types = options['types'];
          -    if (types) {
          -      fallthroughStylePatterns.push([PR_TYPE, types]);
          -    }
          -
          -    var keywords = ("" + options['keywords']).replace(/^ | $/g, '');
          -    if (keywords.length) {
          -      fallthroughStylePatterns.push(
          -          [PR_KEYWORD,
          -           new RegExp('^(?:' + keywords.replace(/[\s,]+/g, '|') + ')\\b'),
          -           null]);
          -    }
          -
          -    shortcutStylePatterns.push([PR_PLAIN,       /^\s+/, null, ' \r\n\t\xA0']);
          -
          -    var punctuation =
          -      // The Bash man page says
          -
          -      // A word is a sequence of characters considered as a single
          -      // unit by GRUB. Words are separated by metacharacters,
          -      // which are the following plus space, tab, and newline: { }
          -      // | & $ ; < >
          -      // ...
          -      
          -      // A word beginning with # causes that word and all remaining
          -      // characters on that line to be ignored.
          -
          -      // which means that only a '#' after /(?:^|[{}|&$;<>\s])/ starts a
          -      // comment but empirically
          -      // $ echo {#}
          -      // {#}
          -      // $ echo \$#
          -      // $#
          -      // $ echo }#
          -      // }#
          -
          -      // so /(?:^|[|&;<>\s])/ is more appropriate.
          -
          -      // http://gcc.gnu.org/onlinedocs/gcc-2.95.3/cpp_1.html#SEC3
          -      // suggests that this definition is compatible with a
          -      // default mode that tries to use a single token definition
          -      // to recognize both bash/python style comments and C
          -      // preprocessor directives.
          -
          -      // This definition of punctuation does not include # in the list of
          -      // follow-on exclusions, so # will not be broken before if preceeded
          -      // by a punctuation character.  We could try to exclude # after
          -      // [|&;<>] but that doesn't seem to cause many major problems.
          -      // If that does turn out to be a problem, we should change the below
          -      // when hc is truthy to include # in the run of punctuation characters
          -      // only when not followint [|&;<>].
          -      '^.[^\\s\\w.$@\'"`/\\\\]*';
          -    if (options['regexLiterals']) {
          -      punctuation += '(?!\s*\/)';
          -    }
          -
          -    fallthroughStylePatterns.push(
          -        // TODO(mikesamuel): recognize non-latin letters and numerals in idents
          -        [PR_LITERAL,     /^@[a-z_$][a-z_$@0-9]*/i, null],
          -        [PR_TYPE,        /^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/, null],
          -        [PR_PLAIN,       /^[a-z_$][a-z_$@0-9]*/i, null],
          -        [PR_LITERAL,
          -         new RegExp(
          -             '^(?:'
          -             // A hex number
          -             + '0x[a-f0-9]+'
          -             // or an octal or decimal number,
          -             + '|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)'
          -             // possibly in scientific notation
          -             + '(?:e[+\\-]?\\d+)?'
          -             + ')'
          -             // with an optional modifier like UL for unsigned long
          -             + '[a-z]*', 'i'),
          -         null, '0123456789'],
          -        // Don't treat escaped quotes in bash as starting strings.
          -        // See issue 144.
          -        [PR_PLAIN,       /^\\[\s\S]?/, null],
          -        [PR_PUNCTUATION, new RegExp(punctuation), null]);
          -
          -    return createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns);
          -  }
          -
          -  var decorateSource = sourceDecorator({
          -        'keywords': ALL_KEYWORDS,
          -        'hashComments': true,
          -        'cStyleComments': true,
          -        'multiLineStrings': true,
          -        'regexLiterals': true
          -      });
          -
          -  /**
          -   * Given a DOM subtree, wraps it in a list, and puts each line into its own
          -   * list item.
          -   *
          -   * @param {Node} node modified in place.  Its content is pulled into an
          -   *     HTMLOListElement, and each line is moved into a separate list item.
          -   *     This requires cloning elements, so the input might not have unique
          -   *     IDs after numbering.
          -   * @param {boolean} isPreformatted true iff white-space in text nodes should
          -   *     be treated as significant.
          -   */
          -  function numberLines(node, opt_startLineNum, isPreformatted) {
          -    var nocode = /(?:^|\s)nocode(?:\s|$)/;
          -    var lineBreak = /\r\n?|\n/;
          -  
          -    var document = node.ownerDocument;
          -  
          -    var li = document.createElement('li');
          -    while (node.firstChild) {
          -      li.appendChild(node.firstChild);
          -    }
          -    // An array of lines.  We split below, so this is initialized to one
          -    // un-split line.
          -    var listItems = [li];
          -  
          -    function walk(node) {
          -      var type = node.nodeType;
          -      if (type == 1 && !nocode.test(node.className)) {  // Element
          -        if ('br' === node.nodeName) {
          -          breakAfter(node);
          -          // Discard the <BR> since it is now flush against a </LI>.
          -          if (node.parentNode) {
          -            node.parentNode.removeChild(node);
          -          }
          -        } else {
          -          for (var child = node.firstChild; child; child = child.nextSibling) {
          -            walk(child);
          -          }
          -        }
          -      } else if ((type == 3 || type == 4) && isPreformatted) {  // Text
          -        var text = node.nodeValue;
          -        var match = text.match(lineBreak);
          -        if (match) {
          -          var firstLine = text.substring(0, match.index);
          -          node.nodeValue = firstLine;
          -          var tail = text.substring(match.index + match[0].length);
          -          if (tail) {
          -            var parent = node.parentNode;
          -            parent.insertBefore(
          -              document.createTextNode(tail), node.nextSibling);
          -          }
          -          breakAfter(node);
          -          if (!firstLine) {
          -            // Don't leave blank text nodes in the DOM.
          -            node.parentNode.removeChild(node);
          -          }
          -        }
          -      }
          -    }
          -  
          -    // Split a line after the given node.
          -    function breakAfter(lineEndNode) {
          -      // If there's nothing to the right, then we can skip ending the line
          -      // here, and move root-wards since splitting just before an end-tag
          -      // would require us to create a bunch of empty copies.
          -      while (!lineEndNode.nextSibling) {
          -        lineEndNode = lineEndNode.parentNode;
          -        if (!lineEndNode) { return; }
          -      }
          -  
          -      function breakLeftOf(limit, copy) {
          -        // Clone shallowly if this node needs to be on both sides of the break.
          -        var rightSide = copy ? limit.cloneNode(false) : limit;
          -        var parent = limit.parentNode;
          -        if (parent) {
          -          // We clone the parent chain.
          -          // This helps us resurrect important styling elements that cross lines.
          -          // E.g. in <i>Foo<br>Bar</i>
          -          // should be rewritten to <li><i>Foo</i></li><li><i>Bar</i></li>.
          -          var parentClone = breakLeftOf(parent, 1);
          -          // Move the clone and everything to the right of the original
          -          // onto the cloned parent.
          -          var next = limit.nextSibling;
          -          parentClone.appendChild(rightSide);
          -          for (var sibling = next; sibling; sibling = next) {
          -            next = sibling.nextSibling;
          -            parentClone.appendChild(sibling);
          -          }
          -        }
          -        return rightSide;
          -      }
          -  
          -      var copiedListItem = breakLeftOf(lineEndNode.nextSibling, 0);
          -  
          -      // Walk the parent chain until we reach an unattached LI.
          -      for (var parent;
          -           // Check nodeType since IE invents document fragments.
          -           (parent = copiedListItem.parentNode) && parent.nodeType === 1;) {
          -        copiedListItem = parent;
          -      }
          -      // Put it on the list of lines for later processing.
          -      listItems.push(copiedListItem);
          -    }
          -  
          -    // Split lines while there are lines left to split.
          -    for (var i = 0;  // Number of lines that have been split so far.
          -         i < listItems.length;  // length updated by breakAfter calls.
          -         ++i) {
          -      walk(listItems[i]);
          -    }
          -  
          -    // Make sure numeric indices show correctly.
          -    if (opt_startLineNum === (opt_startLineNum|0)) {
          -      listItems[0].setAttribute('value', opt_startLineNum);
          -    }
          -  
          -    var ol = document.createElement('ol');
          -    ol.className = 'linenums';
          -    var offset = Math.max(0, ((opt_startLineNum - 1 /* zero index */)) | 0) || 0;
          -    for (var i = 0, n = listItems.length; i < n; ++i) {
          -      li = listItems[i];
          -      // Stick a class on the LIs so that stylesheets can
          -      // color odd/even rows, or any other row pattern that
          -      // is co-prime with 10.
          -      li.className = 'L' + ((i + offset) % 10);
          -      if (!li.firstChild) {
          -        li.appendChild(document.createTextNode('\xA0'));
          -      }
          -      ol.appendChild(li);
          -    }
          -  
          -    node.appendChild(ol);
          -  }
          -  /**
          -   * Breaks {@code job.sourceCode} around style boundaries in
          -   * {@code job.decorations} and modifies {@code job.sourceNode} in place.
          -   * @param {Object} job like <pre>{
          -   *    sourceCode: {string} source as plain text,
          -   *    sourceNode: {HTMLElement} the element containing the source,
          -   *    spans: {Array.<number|Node>} alternating span start indices into source
          -   *       and the text node or element (e.g. {@code <BR>}) corresponding to that
          -   *       span.
          -   *    decorations: {Array.<number|string} an array of style classes preceded
          -   *       by the position at which they start in job.sourceCode in order
          -   * }</pre>
          -   * @private
          -   */
          -  function recombineTagsAndDecorations(job) {
          -    var isIE8OrEarlier = /\bMSIE\s(\d+)/.exec(navigator.userAgent);
          -    isIE8OrEarlier = isIE8OrEarlier && +isIE8OrEarlier[1] <= 8;
          -    var newlineRe = /\n/g;
          -  
          -    var source = job.sourceCode;
          -    var sourceLength = source.length;
          -    // Index into source after the last code-unit recombined.
          -    var sourceIndex = 0;
          -  
          -    var spans = job.spans;
          -    var nSpans = spans.length;
          -    // Index into spans after the last span which ends at or before sourceIndex.
          -    var spanIndex = 0;
          -  
          -    var decorations = job.decorations;
          -    var nDecorations = decorations.length;
          -    // Index into decorations after the last decoration which ends at or before
          -    // sourceIndex.
          -    var decorationIndex = 0;
          -  
          -    // Remove all zero-length decorations.
          -    decorations[nDecorations] = sourceLength;
          -    var decPos, i;
          -    for (i = decPos = 0; i < nDecorations;) {
          -      if (decorations[i] !== decorations[i + 2]) {
          -        decorations[decPos++] = decorations[i++];
          -        decorations[decPos++] = decorations[i++];
          -      } else {
          -        i += 2;
          -      }
          -    }
          -    nDecorations = decPos;
          -  
          -    // Simplify decorations.
          -    for (i = decPos = 0; i < nDecorations;) {
          -      var startPos = decorations[i];
          -      // Conflate all adjacent decorations that use the same style.
          -      var startDec = decorations[i + 1];
          -      var end = i + 2;
          -      while (end + 2 <= nDecorations && decorations[end + 1] === startDec) {
          -        end += 2;
          -      }
          -      decorations[decPos++] = startPos;
          -      decorations[decPos++] = startDec;
          -      i = end;
          -    }
          -  
          -    nDecorations = decorations.length = decPos;
          -  
          -    var sourceNode = job.sourceNode;
          -    var oldDisplay;
          -    if (sourceNode) {
          -      oldDisplay = sourceNode.style.display;
          -      sourceNode.style.display = 'none';
          -    }
          -    try {
          -      var decoration = null;
          -      while (spanIndex < nSpans) {
          -        var spanStart = spans[spanIndex];
          -        var spanEnd = spans[spanIndex + 2] || sourceLength;
          -  
          -        var decEnd = decorations[decorationIndex + 2] || sourceLength;
          -  
          -        var end = Math.min(spanEnd, decEnd);
          -  
          -        var textNode = spans[spanIndex + 1];
          -        var styledText;
          -        if (textNode.nodeType !== 1  // Don't muck with <BR>s or <LI>s
          -            // Don't introduce spans around empty text nodes.
          -            && (styledText = source.substring(sourceIndex, end))) {
          -          // This may seem bizarre, and it is.  Emitting LF on IE causes the
          -          // code to display with spaces instead of line breaks.
          -          // Emitting Windows standard issue linebreaks (CRLF) causes a blank
          -          // space to appear at the beginning of every line but the first.
          -          // Emitting an old Mac OS 9 line separator makes everything spiffy.
          -          if (isIE8OrEarlier) {
          -            styledText = styledText.replace(newlineRe, '\r');
          -          }
          -          textNode.nodeValue = styledText;
          -          var document = textNode.ownerDocument;
          -          var span = document.createElement('span');
          -          span.className = decorations[decorationIndex + 1];
          -          var parentNode = textNode.parentNode;
          -          parentNode.replaceChild(span, textNode);
          -          span.appendChild(textNode);
          -          if (sourceIndex < spanEnd) {  // Split off a text node.
          -            spans[spanIndex + 1] = textNode
          -                // TODO: Possibly optimize by using '' if there's no flicker.
          -                = document.createTextNode(source.substring(end, spanEnd));
          -            parentNode.insertBefore(textNode, span.nextSibling);
          -          }
          -        }
          -  
          -        sourceIndex = end;
          -  
          -        if (sourceIndex >= spanEnd) {
          -          spanIndex += 2;
          -        }
          -        if (sourceIndex >= decEnd) {
          -          decorationIndex += 2;
          -        }
          -      }
          -    } finally {
          -      if (sourceNode) {
          -        sourceNode.style.display = oldDisplay;
          -      }
          -    }
          -  }
          -
          -  /** Maps language-specific file extensions to handlers. */
          -  var langHandlerRegistry = {};
          -  /** Register a language handler for the given file extensions.
          -    * @param {function (Object)} handler a function from source code to a list
          -    *      of decorations.  Takes a single argument job which describes the
          -    *      state of the computation.   The single parameter has the form
          -    *      {@code {
          -    *        sourceCode: {string} as plain text.
          -    *        decorations: {Array.<number|string>} an array of style classes
          -    *                     preceded by the position at which they start in
          -    *                     job.sourceCode in order.
          -    *                     The language handler should assigned this field.
          -    *        basePos: {int} the position of source in the larger source chunk.
          -    *                 All positions in the output decorations array are relative
          -    *                 to the larger source chunk.
          -    *      } }
          -    * @param {Array.<string>} fileExtensions
          -    */
          -  function registerLangHandler(handler, fileExtensions) {
          -    for (var i = fileExtensions.length; --i >= 0;) {
          -      var ext = fileExtensions[i];
          -      if (!langHandlerRegistry.hasOwnProperty(ext)) {
          -        langHandlerRegistry[ext] = handler;
          -      } else if (win['console']) {
          -        console['warn']('cannot override language handler %s', ext);
          -      }
          -    }
          -  }
          -  function langHandlerForExtension(extension, source) {
          -    if (!(extension && langHandlerRegistry.hasOwnProperty(extension))) {
          -      // Treat it as markup if the first non whitespace character is a < and
          -      // the last non-whitespace character is a >.
          -      extension = /^\s*</.test(source)
          -          ? 'default-markup'
          -          : 'default-code';
          -    }
          -    return langHandlerRegistry[extension];
          -  }
          -  registerLangHandler(decorateSource, ['default-code']);
          -  registerLangHandler(
          -      createSimpleLexer(
          -          [],
          -          [
          -           [PR_PLAIN,       /^[^<?]+/],
          -           [PR_DECLARATION, /^<!\w[^>]*(?:>|$)/],
          -           [PR_COMMENT,     /^<\!--[\s\S]*?(?:-\->|$)/],
          -           // Unescaped content in an unknown language
          -           ['lang-',        /^<\?([\s\S]+?)(?:\?>|$)/],
          -           ['lang-',        /^<\%([\s\S]+?)(?:%>|$)/],
          -           [PR_PUNCTUATION, /^(?:<[%?]|[%?]>)/],
          -           ['lang-',        /^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],
          -           // Unescaped content in javascript.  (Or possibly vbscript).
          -           ['lang-js',      /^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],
          -           // Contains unescaped stylesheet content
          -           ['lang-css',     /^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],
          -           ['lang-in.tag',  /^(<\/?[a-z][^<>]*>)/i]
          -          ]),
          -      ['default-markup', 'htm', 'html', 'mxml', 'xhtml', 'xml', 'xsl']);
          -  registerLangHandler(
          -      createSimpleLexer(
          -          [
          -           [PR_PLAIN,        /^[\s]+/, null, ' \t\r\n'],
          -           [PR_ATTRIB_VALUE, /^(?:\"[^\"]*\"?|\'[^\']*\'?)/, null, '\"\'']
          -           ],
          -          [
          -           [PR_TAG,          /^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],
          -           [PR_ATTRIB_NAME,  /^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],
          -           ['lang-uq.val',   /^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],
          -           [PR_PUNCTUATION,  /^[=<>\/]+/],
          -           ['lang-js',       /^on\w+\s*=\s*\"([^\"]+)\"/i],
          -           ['lang-js',       /^on\w+\s*=\s*\'([^\']+)\'/i],
          -           ['lang-js',       /^on\w+\s*=\s*([^\"\'>\s]+)/i],
          -           ['lang-css',      /^style\s*=\s*\"([^\"]+)\"/i],
          -           ['lang-css',      /^style\s*=\s*\'([^\']+)\'/i],
          -           ['lang-css',      /^style\s*=\s*([^\"\'>\s]+)/i]
          -           ]),
          -      ['in.tag']);
          -  registerLangHandler(
          -      createSimpleLexer([], [[PR_ATTRIB_VALUE, /^[\s\S]+/]]), ['uq.val']);
          -  registerLangHandler(sourceDecorator({
          -          'keywords': CPP_KEYWORDS,
          -          'hashComments': true,
          -          'cStyleComments': true,
          -          'types': C_TYPES
          -        }), ['c', 'cc', 'cpp', 'cxx', 'cyc', 'm']);
          -  registerLangHandler(sourceDecorator({
          -          'keywords': 'null,true,false'
          -        }), ['json']);
          -  registerLangHandler(sourceDecorator({
          -          'keywords': CSHARP_KEYWORDS,
          -          'hashComments': true,
          -          'cStyleComments': true,
          -          'verbatimStrings': true,
          -          'types': C_TYPES
          -        }), ['cs']);
          -  registerLangHandler(sourceDecorator({
          -          'keywords': JAVA_KEYWORDS,
          -          'cStyleComments': true
          -        }), ['java']);
          -  registerLangHandler(sourceDecorator({
          -          'keywords': SH_KEYWORDS,
          -          'hashComments': true,
          -          'multiLineStrings': true
          -        }), ['bash', 'bsh', 'csh', 'sh']);
          -  registerLangHandler(sourceDecorator({
          -          'keywords': PYTHON_KEYWORDS,
          -          'hashComments': true,
          -          'multiLineStrings': true,
          -          'tripleQuotedStrings': true
          -        }), ['cv', 'py', 'python']);
          -  registerLangHandler(sourceDecorator({
          -          'keywords': PERL_KEYWORDS,
          -          'hashComments': true,
          -          'multiLineStrings': true,
          -          'regexLiterals': 2  // multiline regex literals
          -        }), ['perl', 'pl', 'pm']);
          -  registerLangHandler(sourceDecorator({
          -          'keywords': RUBY_KEYWORDS,
          -          'hashComments': true,
          -          'multiLineStrings': true,
          -          'regexLiterals': true
          -        }), ['rb', 'ruby']);
          -  registerLangHandler(sourceDecorator({
          -          'keywords': JSCRIPT_KEYWORDS,
          -          'cStyleComments': true,
          -          'regexLiterals': true
          -        }), ['javascript', 'js']);
          -  registerLangHandler(sourceDecorator({
          -          'keywords': COFFEE_KEYWORDS,
          -          'hashComments': 3,  // ### style block comments
          -          'cStyleComments': true,
          -          'multilineStrings': true,
          -          'tripleQuotedStrings': true,
          -          'regexLiterals': true
          -        }), ['coffee']);
          -  registerLangHandler(sourceDecorator({
          -          'keywords': RUST_KEYWORDS,
          -          'cStyleComments': true,
          -          'multilineStrings': true
          -        }), ['rc', 'rs', 'rust']);
          -  registerLangHandler(
          -      createSimpleLexer([], [[PR_STRING, /^[\s\S]+/]]), ['regex']);
          -
          -  function applyDecorator(job) {
          -    var opt_langExtension = job.langExtension;
          -
          -    try {
          -      // Extract tags, and convert the source code to plain text.
          -      var sourceAndSpans = extractSourceSpans(job.sourceNode, job.pre);
          -      /** Plain text. @type {string} */
          -      var source = sourceAndSpans.sourceCode;
          -      job.sourceCode = source;
          -      job.spans = sourceAndSpans.spans;
          -      job.basePos = 0;
          -
          -      // Apply the appropriate language handler
          -      langHandlerForExtension(opt_langExtension, source)(job);
          -
          -      // Integrate the decorations and tags back into the source code,
          -      // modifying the sourceNode in place.
          -      recombineTagsAndDecorations(job);
          -    } catch (e) {
          -      if (win['console']) {
          -        console['log'](e && e['stack'] || e);
          -      }
          -    }
          -  }
          -
          -  /**
          -   * Pretty print a chunk of code.
          -   * @param sourceCodeHtml {string} The HTML to pretty print.
          -   * @param opt_langExtension {string} The language name to use.
          -   *     Typically, a filename extension like 'cpp' or 'java'.
          -   * @param opt_numberLines {number|boolean} True to number lines,
          -   *     or the 1-indexed number of the first line in sourceCodeHtml.
          -   */
          -  function $prettyPrintOne(sourceCodeHtml, opt_langExtension, opt_numberLines) {
          -    var container = document.createElement('div');
          -    // This could cause images to load and onload listeners to fire.
          -    // E.g. <img onerror="alert(1337)" src="nosuchimage.png">.
          -    // We assume that the inner HTML is from a trusted source.
          -    // The pre-tag is required for IE8 which strips newlines from innerHTML
          -    // when it is injected into a <pre> tag.
          -    // http://stackoverflow.com/questions/451486/pre-tag-loses-line-breaks-when-setting-innerhtml-in-ie
          -    // http://stackoverflow.com/questions/195363/inserting-a-newline-into-a-pre-tag-ie-javascript
          -    container.innerHTML = '<pre>' + sourceCodeHtml + '</pre>';
          -    container = container.firstChild;
          -    if (opt_numberLines) {
          -      numberLines(container, opt_numberLines, true);
          -    }
          -
          -    var job = {
          -      langExtension: opt_langExtension,
          -      numberLines: opt_numberLines,
          -      sourceNode: container,
          -      pre: 1
          -    };
          -    applyDecorator(job);
          -    return container.innerHTML;
          -  }
          -
          -   /**
          -    * Find all the {@code <pre>} and {@code <code>} tags in the DOM with
          -    * {@code class=prettyprint} and prettify them.
          -    *
          -    * @param {Function} opt_whenDone called when prettifying is done.
          -    * @param {HTMLElement|HTMLDocument} opt_root an element or document
          -    *   containing all the elements to pretty print.
          -    *   Defaults to {@code document.body}.
          -    */
          -  function $prettyPrint(opt_whenDone, opt_root) {
          -    var root = opt_root || document.body;
          -    var doc = root.ownerDocument || document;
          -    function byTagName(tn) { return root.getElementsByTagName(tn); }
          -    // fetch a list of nodes to rewrite
          -    var codeSegments = [byTagName('pre'), byTagName('code'), byTagName('xmp')];
          -    var elements = [];
          -    for (var i = 0; i < codeSegments.length; ++i) {
          -      for (var j = 0, n = codeSegments[i].length; j < n; ++j) {
          -        elements.push(codeSegments[i][j]);
          -      }
          -    }
          -    codeSegments = null;
          -
          -    var clock = Date;
          -    if (!clock['now']) {
          -      clock = { 'now': function () { return +(new Date); } };
          -    }
          -
          -    // The loop is broken into a series of continuations to make sure that we
          -    // don't make the browser unresponsive when rewriting a large page.
          -    var k = 0;
          -    var prettyPrintingJob;
          -
          -    var langExtensionRe = /\blang(?:uage)?-([\w.]+)(?!\S)/;
          -    var prettyPrintRe = /\bprettyprint\b/;
          -    var prettyPrintedRe = /\bprettyprinted\b/;
          -    var preformattedTagNameRe = /pre|xmp/i;
          -    var codeRe = /^code$/i;
          -    var preCodeXmpRe = /^(?:pre|code|xmp)$/i;
          -    var EMPTY = {};
          -
          -    function doWork() {
          -      var endTime = (win['PR_SHOULD_USE_CONTINUATION'] ?
          -                     clock['now']() + 250 /* ms */ :
          -                     Infinity);
          -      for (; k < elements.length && clock['now']() < endTime; k++) {
          -        var cs = elements[k];
          -
          -        // Look for a preceding comment like
          -        // <?prettify lang="..." linenums="..."?>
          -        var attrs = EMPTY;
          -        {
          -          for (var preceder = cs; (preceder = preceder.previousSibling);) {
          -            var nt = preceder.nodeType;
          -            // <?foo?> is parsed by HTML 5 to a comment node (8)
          -            // like <!--?foo?-->, but in XML is a processing instruction
          -            var value = (nt === 7 || nt === 8) && preceder.nodeValue;
          -            if (value
          -                ? !/^\??prettify\b/.test(value)
          -                : (nt !== 3 || /\S/.test(preceder.nodeValue))) {
          -              // Skip over white-space text nodes but not others.
          -              break;
          -            }
          -            if (value) {
          -              attrs = {};
          -              value.replace(
          -                  /\b(\w+)=([\w:.%+-]+)/g,
          -                function (_, name, value) { attrs[name] = value; });
          -              break;
          -            }
          -          }
          -        }
          -
          -        var className = cs.className;
          -        if ((attrs !== EMPTY || prettyPrintRe.test(className))
          -            // Don't redo this if we've already done it.
          -            // This allows recalling pretty print to just prettyprint elements
          -            // that have been added to the page since last call.
          -            && !prettyPrintedRe.test(className)) {
          -
          -          // make sure this is not nested in an already prettified element
          -          var nested = false;
          -          for (var p = cs.parentNode; p; p = p.parentNode) {
          -            var tn = p.tagName;
          -            if (preCodeXmpRe.test(tn)
          -                && p.className && prettyPrintRe.test(p.className)) {
          -              nested = true;
          -              break;
          -            }
          -          }
          -          if (!nested) {
          -            // Mark done.  If we fail to prettyprint for whatever reason,
          -            // we shouldn't try again.
          -            cs.className += ' prettyprinted';
          -
          -            // If the classes includes a language extensions, use it.
          -            // Language extensions can be specified like
          -            //     <pre class="prettyprint lang-cpp">
          -            // the language extension "cpp" is used to find a language handler
          -            // as passed to PR.registerLangHandler.
          -            // HTML5 recommends that a language be specified using "language-"
          -            // as the prefix instead.  Google Code Prettify supports both.
          -            // http://dev.w3.org/html5/spec-author-view/the-code-element.html
          -            var langExtension = attrs['lang'];
          -            if (!langExtension) {
          -              langExtension = className.match(langExtensionRe);
          -              // Support <pre class="prettyprint"><code class="language-c">
          -              var wrapper;
          -              if (!langExtension && (wrapper = childContentWrapper(cs))
          -                  && codeRe.test(wrapper.tagName)) {
          -                langExtension = wrapper.className.match(langExtensionRe);
          -              }
          -
          -              if (langExtension) { langExtension = langExtension[1]; }
          -            }
          -
          -            var preformatted;
          -            if (preformattedTagNameRe.test(cs.tagName)) {
          -              preformatted = 1;
          -            } else {
          -              var currentStyle = cs['currentStyle'];
          -              var defaultView = doc.defaultView;
          -              var whitespace = (
          -                  currentStyle
          -                  ? currentStyle['whiteSpace']
          -                  : (defaultView
          -                     && defaultView.getComputedStyle)
          -                  ? defaultView.getComputedStyle(cs, null)
          -                  .getPropertyValue('white-space')
          -                  : 0);
          -              preformatted = whitespace
          -                  && 'pre' === whitespace.substring(0, 3);
          -            }
          -
          -            // Look for a class like linenums or linenums:<n> where <n> is the
          -            // 1-indexed number of the first line.
          -            var lineNums = attrs['linenums'];
          -            if (!(lineNums = lineNums === 'true' || +lineNums)) {
          -              lineNums = className.match(/\blinenums\b(?::(\d+))?/);
          -              lineNums =
          -                lineNums
          -                ? lineNums[1] && lineNums[1].length
          -                  ? +lineNums[1] : true
          -                : false;
          -            }
          -            if (lineNums) { numberLines(cs, lineNums, preformatted); }
          -
          -            // do the pretty printing
          -            prettyPrintingJob = {
          -              langExtension: langExtension,
          -              sourceNode: cs,
          -              numberLines: lineNums,
          -              pre: preformatted
          -            };
          -            applyDecorator(prettyPrintingJob);
          -          }
          -        }
          -      }
          -      if (k < elements.length) {
          -        // finish up in a continuation
          -        setTimeout(doWork, 250);
          -      } else if ('function' === typeof opt_whenDone) {
          -        opt_whenDone();
          -      }
          -    }
          -
          -    doWork();
          -  }
          -
          -  /**
          -   * Contains functions for creating and registering new language handlers.
          -   * @type {Object}
          -   */
          -  var PR = win['PR'] = {
          -        'createSimpleLexer': createSimpleLexer,
          -        'registerLangHandler': registerLangHandler,
          -        'sourceDecorator': sourceDecorator,
          -        'PR_ATTRIB_NAME': PR_ATTRIB_NAME,
          -        'PR_ATTRIB_VALUE': PR_ATTRIB_VALUE,
          -        'PR_COMMENT': PR_COMMENT,
          -        'PR_DECLARATION': PR_DECLARATION,
          -        'PR_KEYWORD': PR_KEYWORD,
          -        'PR_LITERAL': PR_LITERAL,
          -        'PR_NOCODE': PR_NOCODE,
          -        'PR_PLAIN': PR_PLAIN,
          -        'PR_PUNCTUATION': PR_PUNCTUATION,
          -        'PR_SOURCE': PR_SOURCE,
          -        'PR_STRING': PR_STRING,
          -        'PR_TAG': PR_TAG,
          -        'PR_TYPE': PR_TYPE,
          -        'prettyPrintOne':
          -           IN_GLOBAL_SCOPE
          -             ? (win['prettyPrintOne'] = $prettyPrintOne)
          -             : (prettyPrintOne = $prettyPrintOne),
          -        'prettyPrint': prettyPrint =
          -           IN_GLOBAL_SCOPE
          -             ? (win['prettyPrint'] = $prettyPrint)
          -             : (prettyPrint = $prettyPrint)
          -      };
          -
          -  // Make PR available via the Asynchronous Module Definition (AMD) API.
          -  // Per https://github.com/amdjs/amdjs-api/wiki/AMD:
          -  // The Asynchronous Module Definition (AMD) API specifies a
          -  // mechanism for defining modules such that the module and its
          -  // dependencies can be asynchronously loaded.
          -  // ...
          -  // To allow a clear indicator that a global define function (as
          -  // needed for script src browser loading) conforms to the AMD API,
          -  // any global define function SHOULD have a property called "amd"
          -  // whose value is an object. This helps avoid conflict with any
          -  // other existing JavaScript code that could have defined a define()
          -  // function that does not conform to the AMD API.
          -  if (typeof define === "function" && define['amd']) {
          -    define("google-code-prettify", [], function () {
          -      return PR; 
          -    });
          -  }
          -})();
          \ No newline at end of file
          diff --git a/src/js/lib/punycode.js b/src/js/lib/punycode.js
          deleted file mode 100755
          index d07b6ef..0000000
          --- a/src/js/lib/punycode.js
          +++ /dev/null
          @@ -1,336 +0,0 @@
          -/** @license
          -========================================================================
          -  Javascript Punycode converter derived from example in RFC3492.
          -  This implementation is created by some@domain.name and released into public domain
          -  
          -  From RFC3492:
          -  Disclaimer and license
          -  Regarding this entire document or any portion of it (including the
          -  pseudocode and C code), the author makes no guarantees and is not
          -  responsible for any damage resulting from its use. The author grants
          -  irrevocable permission to anyone to use, modify, and distribute it in
          -  any way that does not diminish the rights of anyone else to use,
          -  modify, and distribute it, provided that redistributed derivative works do not contain misleading author or version information. Derivative works need not be licensed under similar terms.
          -  
          -  I put my work in this punycode and utf16 in the public domain.
          -*/
          -"use strict";
          -
          -var punycode = new function Punycode() {
          -    // This object converts to and from puny-code used in IDN
          -    //
          -    // punycode.ToASCII(domain)
          -    // 
          -    // Returns a puny coded representation of "domain".
          -    // It only converts the part of the domain name that
          -    // has non ASCII characters. I.e. it dosent matter if
          -    // you call it with a domain that already is in ASCII.
          -    //
          -    // punycode.ToUnicode(domain)
          -    //
          -    // Converts a puny-coded domain name to unicode.
          -    // It only converts the puny-coded parts of the domain name.
          -    // I.e. it dosent matter if you call it on a string
          -    // that already has been converted to unicode.
          -    //
          -    //
          -    this.utf16 = {
          -        // The utf16-class is necessary to convert from javascripts internal character representation to unicode and back.
          -        decode:function(input){
          -            var output = [], i=0, len=input.length,value,extra;
          -            while (i < len) {
          -                value = input.charCodeAt(i++);
          -                if ((value & 0xF800) === 0xD800) {
          -                    extra = input.charCodeAt(i++);
          -                    if ( ((value & 0xFC00) !== 0xD800) || ((extra & 0xFC00) !== 0xDC00) ) {
          -                        throw new RangeError("UTF-16(decode): Illegal UTF-16 sequence");
          -                    }
          -                    value = ((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000;
          -                }
          -                output.push(value);
          -            }
          -            return output;
          -        },
          -        encode:function(input){
          -            var output = [], i=0, len=input.length,value;
          -            while (i < len) {
          -                value = input[i++];
          -                if ( (value & 0xF800) === 0xD800 ) {
          -                    throw new RangeError("UTF-16(encode): Illegal UTF-16 value");
          -                }
          -                if (value > 0xFFFF) {
          -                    value -= 0x10000;
          -                    output.push(String.fromCharCode(((value >>>10) & 0x3FF) | 0xD800));
          -                    value = 0xDC00 | (value & 0x3FF);
          -                }
          -                output.push(String.fromCharCode(value));
          -            }
          -            return output.join("");
          -        }
          -    }
          -
          -    //Default parameters
          -    var initial_n = 0x80;
          -    var initial_bias = 72;
          -    var delimiter = "\x2D";
          -    var base = 36;
          -    var damp = 700;
          -    var tmin=1;
          -    var tmax=26;
          -    var skew=38;
          -    var maxint = 0x7FFFFFFF;
          -
          -    // decode_digit(cp) returns the numeric value of a basic code 
          -    // point (for use in representing integers) in the range 0 to
          -    // base-1, or base if cp is does not represent a value.
          -
          -    function decode_digit(cp) {
          -        return cp - 48 < 10 ? cp - 22 : cp - 65 < 26 ? cp - 65 : cp - 97 < 26 ? cp - 97 : base;
          -    }
          -
          -    // encode_digit(d,flag) returns the basic code point whose value
          -    // (when used for representing integers) is d, which needs to be in
          -    // the range 0 to base-1. The lowercase form is used unless flag is
          -    // nonzero, in which case the uppercase form is used. The behavior
          -    // is undefined if flag is nonzero and digit d has no uppercase form. 
          -
          -    function encode_digit(d, flag) {
          -        return d + 22 + 75 * (d < 26) - ((flag != 0) << 5);
          -        //  0..25 map to ASCII a..z or A..Z 
          -        // 26..35 map to ASCII 0..9
          -    }
          -    //** Bias adaptation function **
          -    function adapt(delta, numpoints, firsttime ) {
          -        var k;
          -        delta = firsttime ? Math.floor(delta / damp) : (delta >> 1);
          -        delta += Math.floor(delta / numpoints);
          -
          -        for (k = 0; delta > (((base - tmin) * tmax) >> 1); k += base) {
          -                delta = Math.floor(delta / ( base - tmin ));
          -        }
          -        return Math.floor(k + (base - tmin + 1) * delta / (delta + skew));
          -    }
          -
          -    // encode_basic(bcp,flag) forces a basic code point to lowercase if flag is zero,
          -    // uppercase if flag is nonzero, and returns the resulting code point.
          -    // The code point is unchanged if it is caseless.
          -    // The behavior is undefined if bcp is not a basic code point.
          -
          -    function encode_basic(bcp, flag) {
          -        bcp -= (bcp - 97 < 26) << 5;
          -        return bcp + ((!flag && (bcp - 65 < 26)) << 5);
          -    }
          -
          -    // Main decode
          -    this.decode=function(input,preserveCase) {
          -        // Dont use utf16
          -        var output=[];
          -        var case_flags=[];
          -        var input_length = input.length;
          -
          -        var n, out, i, bias, basic, j, ic, oldi, w, k, digit, t, len;
          -
          -        // Initialize the state: 
          -
          -        n = initial_n;
          -        i = 0;
          -        bias = initial_bias;
          -
          -        // Handle the basic code points: Let basic be the number of input code 
          -        // points before the last delimiter, or 0 if there is none, then
          -        // copy the first basic code points to the output.
          -
          -        basic = input.lastIndexOf(delimiter);
          -        if (basic < 0) basic = 0;
          -
          -        for (j = 0; j < basic; ++j) {
          -            if(preserveCase) case_flags[output.length] = ( input.charCodeAt(j) -65 < 26);
          -            if ( input.charCodeAt(j) >= 0x80) {
          -                throw new RangeError("Illegal input >= 0x80");
          -            }
          -            output.push( input.charCodeAt(j) );
          -        }
          -
          -        // Main decoding loop: Start just after the last delimiter if any
          -        // basic code points were copied; start at the beginning otherwise. 
          -
          -        for (ic = basic > 0 ? basic + 1 : 0; ic < input_length; ) {
          -
          -            // ic is the index of the next character to be consumed,
          -
          -            // Decode a generalized variable-length integer into delta,
          -            // which gets added to i. The overflow checking is easier
          -            // if we increase i as we go, then subtract off its starting 
          -            // value at the end to obtain delta.
          -            for (oldi = i, w = 1, k = base; ; k += base) {
          -                    if (ic >= input_length) {
          -                        throw RangeError ("punycode_bad_input(1)");
          -                    }
          -                    digit = decode_digit(input.charCodeAt(ic++));
          -
          -                    if (digit >= base) {
          -                        throw RangeError("punycode_bad_input(2)");
          -                    }
          -                    if (digit > Math.floor((maxint - i) / w)) {
          -                        throw RangeError ("punycode_overflow(1)");
          -                    }
          -                    i += digit * w;
          -                    t = k <= bias ? tmin : k >= bias + tmax ? tmax : k - bias;
          -                    if (digit < t) { break; }
          -                    if (w > Math.floor(maxint / (base - t))) {
          -                        throw RangeError("punycode_overflow(2)");
          -                    }
          -                    w *= (base - t);
          -            }
          -
          -            out = output.length + 1;
          -            bias = adapt(i - oldi, out, oldi === 0);
          -
          -            // i was supposed to wrap around from out to 0,
          -            // incrementing n each time, so we'll fix that now: 
          -            if ( Math.floor(i / out) > maxint - n) {
          -                throw RangeError("punycode_overflow(3)");
          -            }
          -            n += Math.floor( i / out ) ;
          -            i %= out;
          -
          -            // Insert n at position i of the output: 
          -            // Case of last character determines uppercase flag: 
          -            if (preserveCase) { case_flags.splice(i, 0, input.charCodeAt(ic -1) -65 < 26);}
          -
          -            output.splice(i, 0, n);
          -            i++;
          -        }
          -        if (preserveCase) {
          -            for (i = 0, len = output.length; i < len; i++) {
          -                if (case_flags[i]) {
          -                    output[i] = (String.fromCharCode(output[i]).toUpperCase()).charCodeAt(0);
          -                }
          -            }
          -        }
          -        return this.utf16.encode(output);
          -    };
          -
          -    //** Main encode function **
          -
          -    this.encode = function (input,preserveCase) {
          -        //** Bias adaptation function **
          -
          -        var n, delta, h, b, bias, j, m, q, k, t, ijv, case_flags;
          -
          -        if (preserveCase) {
          -            // Preserve case, step1 of 2: Get a list of the unaltered string
          -            case_flags = this.utf16.decode(input);
          -        }
          -        // Converts the input in UTF-16 to Unicode
          -        input = this.utf16.decode(input.toLowerCase());
          -
          -        var input_length = input.length; // Cache the length
          -
          -        if (preserveCase) {
          -            // Preserve case, step2 of 2: Modify the list to true/false
          -            for (j=0; j < input_length; j++) {
          -                case_flags[j] = input[j] != case_flags[j];
          -            }
          -        }
          -
          -        var output=[];
          -
          -
          -        // Initialize the state: 
          -        n = initial_n;
          -        delta = 0;
          -        bias = initial_bias;
          -
          -        // Handle the basic code points: 
          -        for (j = 0; j < input_length; ++j) {
          -            if ( input[j] < 0x80) {
          -                output.push(
          -                    String.fromCharCode(
          -                        case_flags ? encode_basic(input[j], case_flags[j]) : input[j]
          -                    )
          -                );
          -            }
          -        }
          -
          -        h = b = output.length;
          -
          -        // h is the number of code points that have been handled, b is the
          -        // number of basic code points 
          -
          -        if (b > 0) output.push(delimiter);
          -
          -        // Main encoding loop: 
          -        //
          -        while (h < input_length) {
          -            // All non-basic code points < n have been
          -            // handled already. Find the next larger one: 
          -
          -            for (m = maxint, j = 0; j < input_length; ++j) {
          -                ijv = input[j];
          -                if (ijv >= n && ijv < m) m = ijv;
          -            }
          -
          -            // Increase delta enough to advance the decoder's
          -            // <n,i> state to <m,0>, but guard against overflow: 
          -
          -            if (m - n > Math.floor((maxint - delta) / (h + 1))) {
          -                throw RangeError("punycode_overflow (1)");
          -            }
          -            delta += (m - n) * (h + 1);
          -            n = m;
          -
          -            for (j = 0; j < input_length; ++j) {
          -                ijv = input[j];
          -
          -                if (ijv < n ) {
          -                    if (++delta > maxint) return Error("punycode_overflow(2)");
          -                }
          -
          -                if (ijv == n) {
          -                    // Represent delta as a generalized variable-length integer: 
          -                    for (q = delta, k = base; ; k += base) {
          -                        t = k <= bias ? tmin : k >= bias + tmax ? tmax : k - bias;
          -                        if (q < t) break;
          -                        output.push( String.fromCharCode(encode_digit(t + (q - t) % (base - t), 0)) );
          -                        q = Math.floor( (q - t) / (base - t) );
          -                    }
          -                    output.push( String.fromCharCode(encode_digit(q, preserveCase && case_flags[j] ? 1:0 )));
          -                    bias = adapt(delta, h + 1, h == b);
          -                    delta = 0;
          -                    ++h;
          -                }
          -            }
          -
          -            ++delta, ++n;
          -        }
          -        return output.join("");
          -    }
          -
          -    this.ToASCII = function ( domain ) {
          -        var domain_array = domain.split(".");
          -        var out = [];
          -        for (var i=0; i < domain_array.length; ++i) {
          -            var s = domain_array[i];
          -            out.push(
          -                s.match(/[^A-Za-z0-9-]/) ?
          -                "xn--" + punycode.encode(s) :
          -                s
          -            );
          -        }
          -        return out.join(".");
          -    }
          -    this.ToUnicode = function ( domain ) {
          -        var domain_array = domain.split(".");
          -        var out = [];
          -        for (var i=0; i < domain_array.length; ++i) {
          -            var s = domain_array[i];
          -            out.push(
          -                s.match(/^xn--/) ?
          -                punycode.decode(s.slice(4)) :
          -                s
          -            );
          -        }
          -        return out.join(".");
          -    }
          -}();
          \ No newline at end of file
          diff --git a/src/js/lib/rawdeflate.js b/src/js/lib/rawdeflate.js
          deleted file mode 100755
          index a5f04df..0000000
          --- a/src/js/lib/rawdeflate.js
          +++ /dev/null
          @@ -1,23 +0,0 @@
          -/* zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */(function() {'use strict';var n=void 0,u=!0,aa=this;function ba(e,d){var c=e.split("."),f=aa;!(c[0]in f)&&f.execScript&&f.execScript("var "+c[0]);for(var a;c.length&&(a=c.shift());)!c.length&&d!==n?f[a]=d:f=f[a]?f[a]:f[a]={}};var C="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Uint32Array&&"undefined"!==typeof DataView;function K(e,d){this.index="number"===typeof d?d:0;this.d=0;this.buffer=e instanceof(C?Uint8Array:Array)?e:new (C?Uint8Array:Array)(32768);if(2*this.buffer.length<=this.index)throw Error("invalid index");this.buffer.length<=this.index&&ca(this)}function ca(e){var d=e.buffer,c,f=d.length,a=new (C?Uint8Array:Array)(f<<1);if(C)a.set(d);else for(c=0;c<f;++c)a[c]=d[c];return e.buffer=a}
          -K.prototype.a=function(e,d,c){var f=this.buffer,a=this.index,b=this.d,k=f[a],m;c&&1<d&&(e=8<d?(L[e&255]<<24|L[e>>>8&255]<<16|L[e>>>16&255]<<8|L[e>>>24&255])>>32-d:L[e]>>8-d);if(8>d+b)k=k<<d|e,b+=d;else for(m=0;m<d;++m)k=k<<1|e>>d-m-1&1,8===++b&&(b=0,f[a++]=L[k],k=0,a===f.length&&(f=ca(this)));f[a]=k;this.buffer=f;this.d=b;this.index=a};K.prototype.finish=function(){var e=this.buffer,d=this.index,c;0<this.d&&(e[d]<<=8-this.d,e[d]=L[e[d]],d++);C?c=e.subarray(0,d):(e.length=d,c=e);return c};
          -var ga=new (C?Uint8Array:Array)(256),M;for(M=0;256>M;++M){for(var R=M,S=R,ha=7,R=R>>>1;R;R>>>=1)S<<=1,S|=R&1,--ha;ga[M]=(S<<ha&255)>>>0}var L=ga;function ja(e){this.buffer=new (C?Uint16Array:Array)(2*e);this.length=0}ja.prototype.getParent=function(e){return 2*((e-2)/4|0)};ja.prototype.push=function(e,d){var c,f,a=this.buffer,b;c=this.length;a[this.length++]=d;for(a[this.length++]=e;0<c;)if(f=this.getParent(c),a[c]>a[f])b=a[c],a[c]=a[f],a[f]=b,b=a[c+1],a[c+1]=a[f+1],a[f+1]=b,c=f;else break;return this.length};
          -ja.prototype.pop=function(){var e,d,c=this.buffer,f,a,b;d=c[0];e=c[1];this.length-=2;c[0]=c[this.length];c[1]=c[this.length+1];for(b=0;;){a=2*b+2;if(a>=this.length)break;a+2<this.length&&c[a+2]>c[a]&&(a+=2);if(c[a]>c[b])f=c[b],c[b]=c[a],c[a]=f,f=c[b+1],c[b+1]=c[a+1],c[a+1]=f;else break;b=a}return{index:e,value:d,length:this.length}};function ka(e,d){this.e=ma;this.f=0;this.input=C&&e instanceof Array?new Uint8Array(e):e;this.c=0;d&&(d.lazy&&(this.f=d.lazy),"number"===typeof d.compressionType&&(this.e=d.compressionType),d.outputBuffer&&(this.b=C&&d.outputBuffer instanceof Array?new Uint8Array(d.outputBuffer):d.outputBuffer),"number"===typeof d.outputIndex&&(this.c=d.outputIndex));this.b||(this.b=new (C?Uint8Array:Array)(32768))}var ma=2,T=[],U;
          -for(U=0;288>U;U++)switch(u){case 143>=U:T.push([U+48,8]);break;case 255>=U:T.push([U-144+400,9]);break;case 279>=U:T.push([U-256+0,7]);break;case 287>=U:T.push([U-280+192,8]);break;default:throw"invalid literal: "+U;}
          -ka.prototype.h=function(){var e,d,c,f,a=this.input;switch(this.e){case 0:c=0;for(f=a.length;c<f;){d=C?a.subarray(c,c+65535):a.slice(c,c+65535);c+=d.length;var b=d,k=c===f,m=n,g=n,p=n,v=n,x=n,l=this.b,h=this.c;if(C){for(l=new Uint8Array(this.b.buffer);l.length<=h+b.length+5;)l=new Uint8Array(l.length<<1);l.set(this.b)}m=k?1:0;l[h++]=m|0;g=b.length;p=~g+65536&65535;l[h++]=g&255;l[h++]=g>>>8&255;l[h++]=p&255;l[h++]=p>>>8&255;if(C)l.set(b,h),h+=b.length,l=l.subarray(0,h);else{v=0;for(x=b.length;v<x;++v)l[h++]=
          -b[v];l.length=h}this.c=h;this.b=l}break;case 1:var q=new K(C?new Uint8Array(this.b.buffer):this.b,this.c);q.a(1,1,u);q.a(1,2,u);var t=na(this,a),w,da,z;w=0;for(da=t.length;w<da;w++)if(z=t[w],K.prototype.a.apply(q,T[z]),256<z)q.a(t[++w],t[++w],u),q.a(t[++w],5),q.a(t[++w],t[++w],u);else if(256===z)break;this.b=q.finish();this.c=this.b.length;break;case ma:var B=new K(C?new Uint8Array(this.b.buffer):this.b,this.c),ra,J,N,O,P,Ia=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],W,sa,X,ta,ea,ia=Array(19),
          -ua,Q,fa,y,va;ra=ma;B.a(1,1,u);B.a(ra,2,u);J=na(this,a);W=oa(this.j,15);sa=pa(W);X=oa(this.i,7);ta=pa(X);for(N=286;257<N&&0===W[N-1];N--);for(O=30;1<O&&0===X[O-1];O--);var wa=N,xa=O,F=new (C?Uint32Array:Array)(wa+xa),r,G,s,Y,E=new (C?Uint32Array:Array)(316),D,A,H=new (C?Uint8Array:Array)(19);for(r=G=0;r<wa;r++)F[G++]=W[r];for(r=0;r<xa;r++)F[G++]=X[r];if(!C){r=0;for(Y=H.length;r<Y;++r)H[r]=0}r=D=0;for(Y=F.length;r<Y;r+=G){for(G=1;r+G<Y&&F[r+G]===F[r];++G);s=G;if(0===F[r])if(3>s)for(;0<s--;)E[D++]=0,
          -H[0]++;else for(;0<s;)A=138>s?s:138,A>s-3&&A<s&&(A=s-3),10>=A?(E[D++]=17,E[D++]=A-3,H[17]++):(E[D++]=18,E[D++]=A-11,H[18]++),s-=A;else if(E[D++]=F[r],H[F[r]]++,s--,3>s)for(;0<s--;)E[D++]=F[r],H[F[r]]++;else for(;0<s;)A=6>s?s:6,A>s-3&&A<s&&(A=s-3),E[D++]=16,E[D++]=A-3,H[16]++,s-=A}e=C?E.subarray(0,D):E.slice(0,D);ea=oa(H,7);for(y=0;19>y;y++)ia[y]=ea[Ia[y]];for(P=19;4<P&&0===ia[P-1];P--);ua=pa(ea);B.a(N-257,5,u);B.a(O-1,5,u);B.a(P-4,4,u);for(y=0;y<P;y++)B.a(ia[y],3,u);y=0;for(va=e.length;y<va;y++)if(Q=
          -e[y],B.a(ua[Q],ea[Q],u),16<=Q){y++;switch(Q){case 16:fa=2;break;case 17:fa=3;break;case 18:fa=7;break;default:throw"invalid code: "+Q;}B.a(e[y],fa,u)}var ya=[sa,W],za=[ta,X],I,Aa,Z,la,Ba,Ca,Da,Ea;Ba=ya[0];Ca=ya[1];Da=za[0];Ea=za[1];I=0;for(Aa=J.length;I<Aa;++I)if(Z=J[I],B.a(Ba[Z],Ca[Z],u),256<Z)B.a(J[++I],J[++I],u),la=J[++I],B.a(Da[la],Ea[la],u),B.a(J[++I],J[++I],u);else if(256===Z)break;this.b=B.finish();this.c=this.b.length;break;default:throw"invalid compression type";}return this.b};
          -function qa(e,d){this.length=e;this.g=d}
          -var Fa=function(){function e(a){switch(u){case 3===a:return[257,a-3,0];case 4===a:return[258,a-4,0];case 5===a:return[259,a-5,0];case 6===a:return[260,a-6,0];case 7===a:return[261,a-7,0];case 8===a:return[262,a-8,0];case 9===a:return[263,a-9,0];case 10===a:return[264,a-10,0];case 12>=a:return[265,a-11,1];case 14>=a:return[266,a-13,1];case 16>=a:return[267,a-15,1];case 18>=a:return[268,a-17,1];case 22>=a:return[269,a-19,2];case 26>=a:return[270,a-23,2];case 30>=a:return[271,a-27,2];case 34>=a:return[272,
          -a-31,2];case 42>=a:return[273,a-35,3];case 50>=a:return[274,a-43,3];case 58>=a:return[275,a-51,3];case 66>=a:return[276,a-59,3];case 82>=a:return[277,a-67,4];case 98>=a:return[278,a-83,4];case 114>=a:return[279,a-99,4];case 130>=a:return[280,a-115,4];case 162>=a:return[281,a-131,5];case 194>=a:return[282,a-163,5];case 226>=a:return[283,a-195,5];case 257>=a:return[284,a-227,5];case 258===a:return[285,a-258,0];default:throw"invalid length: "+a;}}var d=[],c,f;for(c=3;258>=c;c++)f=e(c),d[c]=f[2]<<24|
          -f[1]<<16|f[0];return d}(),Ga=C?new Uint32Array(Fa):Fa;
          -function na(e,d){function c(a,c){var b=a.g,d=[],f=0,e;e=Ga[a.length];d[f++]=e&65535;d[f++]=e>>16&255;d[f++]=e>>24;var g;switch(u){case 1===b:g=[0,b-1,0];break;case 2===b:g=[1,b-2,0];break;case 3===b:g=[2,b-3,0];break;case 4===b:g=[3,b-4,0];break;case 6>=b:g=[4,b-5,1];break;case 8>=b:g=[5,b-7,1];break;case 12>=b:g=[6,b-9,2];break;case 16>=b:g=[7,b-13,2];break;case 24>=b:g=[8,b-17,3];break;case 32>=b:g=[9,b-25,3];break;case 48>=b:g=[10,b-33,4];break;case 64>=b:g=[11,b-49,4];break;case 96>=b:g=[12,b-
          -65,5];break;case 128>=b:g=[13,b-97,5];break;case 192>=b:g=[14,b-129,6];break;case 256>=b:g=[15,b-193,6];break;case 384>=b:g=[16,b-257,7];break;case 512>=b:g=[17,b-385,7];break;case 768>=b:g=[18,b-513,8];break;case 1024>=b:g=[19,b-769,8];break;case 1536>=b:g=[20,b-1025,9];break;case 2048>=b:g=[21,b-1537,9];break;case 3072>=b:g=[22,b-2049,10];break;case 4096>=b:g=[23,b-3073,10];break;case 6144>=b:g=[24,b-4097,11];break;case 8192>=b:g=[25,b-6145,11];break;case 12288>=b:g=[26,b-8193,12];break;case 16384>=
          -b:g=[27,b-12289,12];break;case 24576>=b:g=[28,b-16385,13];break;case 32768>=b:g=[29,b-24577,13];break;default:throw"invalid distance";}e=g;d[f++]=e[0];d[f++]=e[1];d[f++]=e[2];var k,m;k=0;for(m=d.length;k<m;++k)l[h++]=d[k];t[d[0]]++;w[d[3]]++;q=a.length+c-1;x=null}var f,a,b,k,m,g={},p,v,x,l=C?new Uint16Array(2*d.length):[],h=0,q=0,t=new (C?Uint32Array:Array)(286),w=new (C?Uint32Array:Array)(30),da=e.f,z;if(!C){for(b=0;285>=b;)t[b++]=0;for(b=0;29>=b;)w[b++]=0}t[256]=1;f=0;for(a=d.length;f<a;++f){b=
          -m=0;for(k=3;b<k&&f+b!==a;++b)m=m<<8|d[f+b];g[m]===n&&(g[m]=[]);p=g[m];if(!(0<q--)){for(;0<p.length&&32768<f-p[0];)p.shift();if(f+3>=a){x&&c(x,-1);b=0;for(k=a-f;b<k;++b)z=d[f+b],l[h++]=z,++t[z];break}0<p.length?(v=Ha(d,f,p),x?x.length<v.length?(z=d[f-1],l[h++]=z,++t[z],c(v,0)):c(x,-1):v.length<da?x=v:c(v,0)):x?c(x,-1):(z=d[f],l[h++]=z,++t[z])}p.push(f)}l[h++]=256;t[256]++;e.j=t;e.i=w;return C?l.subarray(0,h):l}
          -function Ha(e,d,c){var f,a,b=0,k,m,g,p,v=e.length;m=0;p=c.length;a:for(;m<p;m++){f=c[p-m-1];k=3;if(3<b){for(g=b;3<g;g--)if(e[f+g-1]!==e[d+g-1])continue a;k=b}for(;258>k&&d+k<v&&e[f+k]===e[d+k];)++k;k>b&&(a=f,b=k);if(258===k)break}return new qa(b,d-a)}
          -function oa(e,d){var c=e.length,f=new ja(572),a=new (C?Uint8Array:Array)(c),b,k,m,g,p;if(!C)for(g=0;g<c;g++)a[g]=0;for(g=0;g<c;++g)0<e[g]&&f.push(g,e[g]);b=Array(f.length/2);k=new (C?Uint32Array:Array)(f.length/2);if(1===b.length)return a[f.pop().index]=1,a;g=0;for(p=f.length/2;g<p;++g)b[g]=f.pop(),k[g]=b[g].value;m=Ja(k,k.length,d);g=0;for(p=b.length;g<p;++g)a[b[g].index]=m[g];return a}
          -function Ja(e,d,c){function f(a){var b=g[a][p[a]];b===d?(f(a+1),f(a+1)):--k[b];++p[a]}var a=new (C?Uint16Array:Array)(c),b=new (C?Uint8Array:Array)(c),k=new (C?Uint8Array:Array)(d),m=Array(c),g=Array(c),p=Array(c),v=(1<<c)-d,x=1<<c-1,l,h,q,t,w;a[c-1]=d;for(h=0;h<c;++h)v<x?b[h]=0:(b[h]=1,v-=x),v<<=1,a[c-2-h]=(a[c-1-h]/2|0)+d;a[0]=b[0];m[0]=Array(a[0]);g[0]=Array(a[0]);for(h=1;h<c;++h)a[h]>2*a[h-1]+b[h]&&(a[h]=2*a[h-1]+b[h]),m[h]=Array(a[h]),g[h]=Array(a[h]);for(l=0;l<d;++l)k[l]=c;for(q=0;q<a[c-1];++q)m[c-
          -1][q]=e[q],g[c-1][q]=q;for(l=0;l<c;++l)p[l]=0;1===b[c-1]&&(--k[0],++p[c-1]);for(h=c-2;0<=h;--h){t=l=0;w=p[h+1];for(q=0;q<a[h];q++)t=m[h+1][w]+m[h+1][w+1],t>e[l]?(m[h][q]=t,g[h][q]=d,w+=2):(m[h][q]=e[l],g[h][q]=l,++l);p[h]=0;1===b[h]&&f(h)}return k}
          -function pa(e){var d=new (C?Uint16Array:Array)(e.length),c=[],f=[],a=0,b,k,m,g;b=0;for(k=e.length;b<k;b++)c[e[b]]=(c[e[b]]|0)+1;b=1;for(k=16;b<=k;b++)f[b]=a,a+=c[b]|0,a<<=1;b=0;for(k=e.length;b<k;b++){a=f[e[b]];f[e[b]]+=1;m=d[b]=0;for(g=e[b];m<g;m++)d[b]=d[b]<<1|a&1,a>>>=1}return d};ba("Zlib.RawDeflate",ka);ba("Zlib.RawDeflate.prototype.compress",ka.prototype.h);var Ka={NONE:0,FIXED:1,DYNAMIC:ma},V,La,$,Ma;if(Object.keys)V=Object.keys(Ka);else for(La in V=[],$=0,Ka)V[$++]=La;$=0;for(Ma=V.length;$<Ma;++$)La=V[$],ba("Zlib.RawDeflate.CompressionType."+La,Ka[La]);}).call(this);
          diff --git a/src/js/lib/rawinflate.js b/src/js/lib/rawinflate.js
          deleted file mode 100755
          index 75ea813..0000000
          --- a/src/js/lib/rawinflate.js
          +++ /dev/null
          @@ -1,14 +0,0 @@
          -/* zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */(function() {'use strict';var l=this;function p(b,e){var a=b.split("."),c=l;!(a[0]in c)&&c.execScript&&c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)!a.length&&void 0!==e?c[d]=e:c=c[d]?c[d]:c[d]={}};var q="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Uint32Array&&"undefined"!==typeof DataView;function t(b){var e=b.length,a=0,c=Number.POSITIVE_INFINITY,d,f,g,h,k,m,r,n,s,J;for(n=0;n<e;++n)b[n]>a&&(a=b[n]),b[n]<c&&(c=b[n]);d=1<<a;f=new (q?Uint32Array:Array)(d);g=1;h=0;for(k=2;g<=a;){for(n=0;n<e;++n)if(b[n]===g){m=0;r=h;for(s=0;s<g;++s)m=m<<1|r&1,r>>=1;J=g<<16|n;for(s=m;s<d;s+=k)f[s]=J;++h}++g;h<<=1;k<<=1}return[f,a,c]};function u(b,e){this.g=[];this.h=32768;this.c=this.f=this.d=this.k=0;this.input=q?new Uint8Array(b):b;this.l=!1;this.i=v;this.q=!1;if(e||!(e={}))e.index&&(this.d=e.index),e.bufferSize&&(this.h=e.bufferSize),e.bufferType&&(this.i=e.bufferType),e.resize&&(this.q=e.resize);switch(this.i){case w:this.a=32768;this.b=new (q?Uint8Array:Array)(32768+this.h+258);break;case v:this.a=0;this.b=new (q?Uint8Array:Array)(this.h);this.e=this.v;this.m=this.s;this.j=this.t;break;default:throw Error("invalid inflate mode");
          -}}var w=0,v=1;
          -u.prototype.u=function(){for(;!this.l;){var b=x(this,3);b&1&&(this.l=!0);b>>>=1;switch(b){case 0:var e=this.input,a=this.d,c=this.b,d=this.a,f=e.length,g=void 0,h=void 0,k=c.length,m=void 0;this.c=this.f=0;if(a+1>=f)throw Error("invalid uncompressed block header: LEN");g=e[a++]|e[a++]<<8;if(a+1>=f)throw Error("invalid uncompressed block header: NLEN");h=e[a++]|e[a++]<<8;if(g===~h)throw Error("invalid uncompressed block header: length verify");if(a+g>e.length)throw Error("input buffer is broken");switch(this.i){case w:for(;d+
          -g>c.length;){m=k-d;g-=m;if(q)c.set(e.subarray(a,a+m),d),d+=m,a+=m;else for(;m--;)c[d++]=e[a++];this.a=d;c=this.e();d=this.a}break;case v:for(;d+g>c.length;)c=this.e({o:2});break;default:throw Error("invalid inflate mode");}if(q)c.set(e.subarray(a,a+g),d),d+=g,a+=g;else for(;g--;)c[d++]=e[a++];this.d=a;this.a=d;this.b=c;break;case 1:this.j(y,z);break;case 2:A(this);break;default:throw Error("unknown BTYPE: "+b);}}return this.m()};
          -var B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],C=q?new Uint16Array(B):B,D=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],E=q?new Uint16Array(D):D,F=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],G=q?new Uint8Array(F):F,H=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],I=q?new Uint16Array(H):H,K=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,
          -13],L=q?new Uint8Array(K):K,M=new (q?Uint8Array:Array)(288),N,O;N=0;for(O=M.length;N<O;++N)M[N]=143>=N?8:255>=N?9:279>=N?7:8;var y=t(M),P=new (q?Uint8Array:Array)(30),Q,R;Q=0;for(R=P.length;Q<R;++Q)P[Q]=5;var z=t(P);function x(b,e){for(var a=b.f,c=b.c,d=b.input,f=b.d,g=d.length,h;c<e;){if(f>=g)throw Error("input buffer is broken");a|=d[f++]<<c;c+=8}h=a&(1<<e)-1;b.f=a>>>e;b.c=c-e;b.d=f;return h}
          -function S(b,e){for(var a=b.f,c=b.c,d=b.input,f=b.d,g=d.length,h=e[0],k=e[1],m,r;c<k&&!(f>=g);)a|=d[f++]<<c,c+=8;m=h[a&(1<<k)-1];r=m>>>16;b.f=a>>r;b.c=c-r;b.d=f;return m&65535}
          -function A(b){function e(a,b,c){var e,d=this.p,f,g;for(g=0;g<a;)switch(e=S(this,b),e){case 16:for(f=3+x(this,2);f--;)c[g++]=d;break;case 17:for(f=3+x(this,3);f--;)c[g++]=0;d=0;break;case 18:for(f=11+x(this,7);f--;)c[g++]=0;d=0;break;default:d=c[g++]=e}this.p=d;return c}var a=x(b,5)+257,c=x(b,5)+1,d=x(b,4)+4,f=new (q?Uint8Array:Array)(C.length),g,h,k,m;for(m=0;m<d;++m)f[C[m]]=x(b,3);if(!q){m=d;for(d=f.length;m<d;++m)f[C[m]]=0}g=t(f);h=new (q?Uint8Array:Array)(a);k=new (q?Uint8Array:Array)(c);b.p=0;
          -b.j(t(e.call(b,a,g,h)),t(e.call(b,c,g,k)))}u.prototype.j=function(b,e){var a=this.b,c=this.a;this.n=b;for(var d=a.length-258,f,g,h,k;256!==(f=S(this,b));)if(256>f)c>=d&&(this.a=c,a=this.e(),c=this.a),a[c++]=f;else{g=f-257;k=E[g];0<G[g]&&(k+=x(this,G[g]));f=S(this,e);h=I[f];0<L[f]&&(h+=x(this,L[f]));c>=d&&(this.a=c,a=this.e(),c=this.a);for(;k--;)a[c]=a[c++-h]}for(;8<=this.c;)this.c-=8,this.d--;this.a=c};
          -u.prototype.t=function(b,e){var a=this.b,c=this.a;this.n=b;for(var d=a.length,f,g,h,k;256!==(f=S(this,b));)if(256>f)c>=d&&(a=this.e(),d=a.length),a[c++]=f;else{g=f-257;k=E[g];0<G[g]&&(k+=x(this,G[g]));f=S(this,e);h=I[f];0<L[f]&&(h+=x(this,L[f]));c+k>d&&(a=this.e(),d=a.length);for(;k--;)a[c]=a[c++-h]}for(;8<=this.c;)this.c-=8,this.d--;this.a=c};
          -u.prototype.e=function(){var b=new (q?Uint8Array:Array)(this.a-32768),e=this.a-32768,a,c,d=this.b;if(q)b.set(d.subarray(32768,b.length));else{a=0;for(c=b.length;a<c;++a)b[a]=d[a+32768]}this.g.push(b);this.k+=b.length;if(q)d.set(d.subarray(e,e+32768));else for(a=0;32768>a;++a)d[a]=d[e+a];this.a=32768;return d};
          -u.prototype.v=function(b){var e,a=this.input.length/this.d+1|0,c,d,f,g=this.input,h=this.b;b&&("number"===typeof b.o&&(a=b.o),"number"===typeof b.r&&(a+=b.r));2>a?(c=(g.length-this.d)/this.n[2],f=258*(c/2)|0,d=f<h.length?h.length+f:h.length<<1):d=h.length*a;q?(e=new Uint8Array(d),e.set(h)):e=h;return this.b=e};
          -u.prototype.m=function(){var b=0,e=this.b,a=this.g,c,d=new (q?Uint8Array:Array)(this.k+(this.a-32768)),f,g,h,k;if(0===a.length)return q?this.b.subarray(32768,this.a):this.b.slice(32768,this.a);f=0;for(g=a.length;f<g;++f){c=a[f];h=0;for(k=c.length;h<k;++h)d[b++]=c[h]}f=32768;for(g=this.a;f<g;++f)d[b++]=e[f];this.g=[];return this.buffer=d};
          -u.prototype.s=function(){var b,e=this.a;q?this.q?(b=new Uint8Array(e),b.set(this.b.subarray(0,e))):b=this.b.subarray(0,e):(this.b.length>e&&(this.b.length=e),b=this.b);return this.buffer=b};p("Zlib.RawInflate",u);p("Zlib.RawInflate.prototype.decompress",u.prototype.u);var T={ADAPTIVE:v,BLOCK:w},U,V,W,X;if(Object.keys)U=Object.keys(T);else for(V in U=[],W=0,T)U[W++]=V;W=0;for(X=U.length;W<X;++W)V=U[W],p("Zlib.RawInflate.BufferType."+V,T[V]);}).call(this);
          diff --git a/src/js/lib/snowfall.jquery.js b/src/js/lib/snowfall.jquery.js
          deleted file mode 100755
          index c347a31..0000000
          --- a/src/js/lib/snowfall.jquery.js
          +++ /dev/null
          @@ -1,409 +0,0 @@
          -/** @license
          -========================================================================
          -  Snowfall jquery plugin version 1.51 Dec 2nd 2012
          -  
          -  Licensed under the Apache License, Version 2.0 (the "License");
          -  you may not use this file except in compliance with the License.
          -  You may obtain a copy of the License at
          -
          -     http://www.apache.org/licenses/LICENSE-2.0
          -
          -     Unless required by applicable law or agreed to in writing, software
          -     distributed under the License is distributed on an "AS IS" BASIS,
          -     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
          -     See the License for the specific language governing permissions and
          -     limitations under the License.
          -  
          -  Developed by Jason Brown for any bugs or questions email me at loktar69@hotmail
          -  info on the plugin is located on Somethinghitme.com
          -*/
          -
          -/*
          -  Version 1.51 Dec 2nd 2012
          -  // fixed bug where snow collection didn't happen if a valid doctype was declared.
          -
          -  Version 1.5 Oct 5th 2011
          -  Added collecting snow! Uses the canvas element to collect snow. In order to initialize snow collection use the following
          -
          -  $(document).snowfall({collection : 'element'});
          -
          -  element = any valid jquery selector.
          -
          -  The plugin then creates a canvas above every element that matches the selector, and collects the snow. If there are a varrying amount of elements the
          -  flakes get assigned a random one on start they will collide.
          -
          -  Version 1.4 Dec 8th 2010
          -  Fixed issues (I hope) with scroll bars flickering due to snow going over the edge of the screen.
          -  Added round snowflakes via css, will not work for any version of IE. - Thanks to Luke Barker of http://www.infinite-eye.com/
          -  Added shadows as an option via css again will not work with IE. The idea behind shadows, is to show flakes on lighter colored web sites - Thanks Yutt
          -
          -  Version 1.3.1 Nov 25th 2010
          -  Updated script that caused flakes not to show at all if plugin was initialized with no options, also added the fixes that Han Bongers suggested
          -
          -  Developed by Jason Brown for any bugs or questions email me at loktar69@hotmail
          -  info on the plugin is located on Somethinghitme.com
          -
          -  values for snow options are
          -
          -  flakeCount,
          -  flakeColor,
          -  flakeIndex,
          -  minSize,
          -  maxSize,
          -  minSpeed,
          -  maxSpeed,
          -  round,      true or false, makes the snowflakes rounded if the browser supports it.
          -  shadow      true or false, gives the snowflakes a shadow if the browser supports it.
          -
          -  Example Usage :
          -  $(document).snowfall({flakeCount : 100, maxSpeed : 10});
          -
          -  -or-
          -
          -  $('#element').snowfall({flakeCount : 800, maxSpeed : 5, maxSize : 5});
          -
          -  -or with defaults-
          -
          -  $(document).snowfall();
          -
          -  - To clear -
          -  $('#element').snowfall('clear');
          -*/
          -
          -// requestAnimationFrame polyfill from https://github.com/darius/requestAnimationFrame
          -if (!Date.now)
          -    Date.now = function() { return new Date().getTime(); };
          -
          -(function() {
          -    'use strict';
          -
          -    var vendors = ['webkit', 'moz'];
          -    for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) {
          -        var vp = vendors[i];
          -        window.requestAnimationFrame = window[vp+'RequestAnimationFrame'];
          -        window.cancelAnimationFrame = (window[vp+'CancelAnimationFrame']
          -                                   || window[vp+'CancelRequestAnimationFrame']);
          -    }
          -    if (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent) // iOS6 is buggy
          -        || !window.requestAnimationFrame || !window.cancelAnimationFrame) {
          -        var lastTime = 0;
          -        window.requestAnimationFrame = function(callback) {
          -            var now = Date.now();
          -            var nextTime = Math.max(lastTime + 16, now);
          -            return setTimeout(function() { callback(lastTime = nextTime); },
          -                              nextTime - now);
          -        };
          -        window.cancelAnimationFrame = clearTimeout;
          -    }
          -}());
          -
          -(function($){
          -    $.snowfall = function(element, options){
          -        var flakes = [],
          -            defaults = {
          -                flakeCount : 35,
          -                flakeColor : '#ffffff',
          -				flakePosition: 'absolute',
          -                flakeIndex: 999999,
          -                minSize : 1,
          -                maxSize : 2,
          -                minSpeed : 1,
          -                maxSpeed : 5,
          -                round : false,
          -                shadow : false,
          -                collection : false,
          -                collectionHeight : 40,
          -                deviceorientation : false
          -            },
          -            options = $.extend(defaults, options),
          -            random = function random(min, max){
          -                return Math.round(min + Math.random()*(max-min));
          -            };
          -
          -            $(element).data("snowfall", this);
          -
          -            // Snow flake object
          -            function Flake(_x, _y, _size, _speed){
          -                // Flake properties
          -                this.x  = _x;
          -                this.y  = _y;
          -                this.size = _size;
          -                this.speed = _speed;
          -                this.step = 0;
          -                this.stepSize = random(1,10) / 100;
          -
          -                if(options.collection){
          -                    this.target = canvasCollection[random(0,canvasCollection.length-1)];
          -                }
          -
          -                var flakeMarkup = null;
          -
          -                if(options.image){
          -                    flakeMarkup = document.createElement("img");
          -                    flakeMarkup.src = options.image;
          -                }else{
          -                    flakeMarkup = document.createElement("div");
          -                    $(flakeMarkup).css({'background' : options.flakeColor});
          -                }
          -
          -                $(flakeMarkup).attr({
          -                    'class': 'snowfall-flakes', 
          -                }).css({
          -                    'width' : this.size, 
          -                    'height' : this.size, 
          -                    'position' : options.flakePosition, 
          -                    'top' : this.y, 
          -                    'left' : this.x, 
          -                    'fontSize' : 0, 
          -                    'zIndex' : options.flakeIndex
          -                });
          -
          -                if($(element).get(0).tagName === $(document).get(0).tagName){
          -                    $('body').append($(flakeMarkup));
          -                    element = $('body');
          -                }else{
          -                    $(element).append($(flakeMarkup));
          -                }
          -
          -                this.element = flakeMarkup;
          -
          -                // Update function, used to update the snow flakes, and checks current snowflake against bounds
          -                this.update = function(){
          -                    this.y += this.speed;
          -
          -                    if(this.y > (elHeight) - (this.size  + 6)){
          -                        this.reset();
          -                    }
          -
          -                    this.element.style.top = this.y + 'px';
          -                    this.element.style.left = this.x + 'px';
          -
          -                    this.step += this.stepSize;
          -
          -                    if (doRatio === false) {
          -                        this.x += Math.cos(this.step);
          -                    } else {
          -                        this.x += (doRatio + Math.cos(this.step));
          -                    }
          -
          -                    // Pileup check
          -                    if(options.collection){
          -                        if(this.x > this.target.x && this.x < this.target.width + this.target.x && this.y > this.target.y && this.y < this.target.height + this.target.y){
          -                            var ctx = this.target.element.getContext("2d"),
          -                                curX = this.x - this.target.x,
          -                                curY = this.y - this.target.y,
          -                                colData = this.target.colData;
          -
          -                                if(colData[parseInt(curX)][parseInt(curY+this.speed+this.size)] !== undefined || curY+this.speed+this.size > this.target.height){
          -                                    if(curY+this.speed+this.size > this.target.height){
          -                                        while(curY+this.speed+this.size > this.target.height && this.speed > 0){
          -                                            this.speed *= .5;
          -                                        }
          -
          -                                        ctx.fillStyle = "#fff";
          -										ctx.shadowOffsetX = 1;
          -										ctx.shadowOffsetY = 1;
          -										ctx.shadowColor = "#000";
          -										ctx.shadowBlur = 1;
          -										
          -                                        if(colData[parseInt(curX)][parseInt(curY+this.speed+this.size)] == undefined){
          -											// console.log("1");
          -                                            colData[parseInt(curX)][parseInt(curY+this.speed+this.size)] = 1;
          -                                            //ctx.fillRect(curX, (curY)+this.speed+this.size, this.size, this.size);
          -											
          -											ctx.beginPath();
          -											ctx.arc(curX, curY+this.speed+this.size, this.size / 2, 0, Math.PI * 2, true);
          -											ctx.closePath();
          -											ctx.fill();
          -											
          -                                        }else{
          -											// console.log("2");
          -                                            colData[parseInt(curX)][parseInt(curY+this.speed)] = 1;
          -                                            //ctx.fillRect(curX, curY+this.speed, this.size, this.size);
          -											
          -											// ctx.fillStyle = "#f00";
          -											ctx.beginPath();
          -											ctx.arc(curX, curY+this.speed+this.size, this.size, 0, Math.PI * 2, true);
          -											ctx.closePath();
          -											ctx.fill();
          -                                        }
          -                                        this.reset();
          -                                    }else{
          -                                        // flow to the sides
          -                                        this.speed = 1;
          -                                        this.stepSize = 0;
          -										
          -										// console.log("3");
          -
          -                                        if(parseInt(curX)+1 < this.target.width && colData[parseInt(curX)+1][parseInt(curY)+1] == undefined ){
          -                                            // go left
          -                                            this.x++;
          -                                        }else if(parseInt(curX)-1 > 0 && colData[parseInt(curX)-1][parseInt(curY)+1] == undefined ){
          -                                            // go right
          -                                            this.x--;
          -                                        }else{
          -                                            //stop
          -                                            ctx.fillStyle = "#fff";
          -											ctx.shadowOffsetX = -4;
          -											ctx.shadowOffsetY = -4;
          -											ctx.shadowColor = "#000";
          -											ctx.shadowBlur = 4;
          -                                            //ctx.fillRect(curX, curY, this.size, this.size);
          -											
          -											ctx.beginPath();
          -											ctx.arc(curX, curY+this.speed+this.size, this.size, 0, Math.PI * 2, true);
          -											ctx.closePath();
          -											ctx.fill();
          -											
          -                                            colData[parseInt(curX)][parseInt(curY)] = 1;
          -                                            this.reset();
          -                                        }
          -                                    }
          -                                }
          -                        }
          -                    }
          -
          -                    if(this.x + this.size > (elWidth) - widthOffset || this.x < widthOffset){
          -                        this.reset();
          -                    }
          -                }
          -
          -                // Resets the snowflake once it reaches one of the bounds set
          -                this.reset = function(){
          -                    this.y = 0;
          -                    this.x = random(widthOffset, elWidth - widthOffset);
          -                    this.stepSize = random(1,10) / 100;
          -                    this.size = random((options.minSize * 100), (options.maxSize * 100)) / 100;
          -                    this.element.style.width = this.size + 'px';
          -                    this.element.style.height = this.size + 'px';
          -                    this.speed = random(options.minSpeed, options.maxSpeed);
          -                }
          -            }
          -
          -            // local vars
          -            var i = 0,
          -                elHeight = $(element).height(),
          -                elWidth = $(element).width(),
          -                widthOffset = 0,
          -                snowTimeout = 0;
          -
          -            // Collection Piece ******************************
          -            if(options.collection !== false){
          -                var testElem = document.createElement('canvas');
          -                if(!!(testElem.getContext && testElem.getContext('2d'))){
          -                    var canvasCollection = [],
          -                        elements = $(options.collection),
          -                        collectionHeight = options.collectionHeight;
          -
          -                    for(var i =0; i < elements.length; i++){
          -                            var bounds = elements[i].getBoundingClientRect(),
          -                                $canvas = $('<canvas/>',
          -                                    {
          -                                        'class' : 'snowfall-canvas'
          -                                    }),
          -                                collisionData = [];
          -
          -                            if(bounds.top-collectionHeight > 0){
          -                                $('body').append($canvas);
          -
          -                                $canvas.css({
          -                                    'position' : options.flakePosition,
          -                                    'left'     : bounds.left + 'px',
          -                                    'top'      : bounds.top-collectionHeight + 'px'
          -                                })
          -                                .prop({
          -                                    width: bounds.width,
          -                                    height: collectionHeight
          -                                });
          -
          -                                for(var w = 0; w < bounds.width; w++){
          -                                    collisionData[w] = [];
          -                                }
          -
          -                                canvasCollection.push({
          -                                    element : $canvas.get(0), 
          -                                    x : bounds.left, 
          -                                    y : bounds.top-collectionHeight, 
          -                                    width : bounds.width, 
          -                                    height: collectionHeight, 
          -                                    colData : collisionData
          -                                });
          -                            }
          -                    }
          -                }else{
          -                    // Canvas element isnt supported
          -                    options.collection = false;
          -                }
          -            }
          -            // ************************************************
          -
          -            // This will reduce the horizontal scroll bar from displaying, when the effect is applied to the whole page
          -            if($(element).get(0).tagName === $(document).get(0).tagName){
          -                widthOffset = 25;
          -            }
          -
          -            // Bind the window resize event so we can get the innerHeight again
          -            $(window).bind("resize", function(){
          -                elHeight = $(element)[0].clientHeight;
          -                elWidth = $(element)[0].offsetWidth;
          -            });
          -
          -
          -            // initialize the flakes
          -            for(i = 0; i < options.flakeCount; i+=1){
          -                flakes.push(new Flake(random(widthOffset,elWidth - widthOffset), random(0, elHeight), random((options.minSize * 100), (options.maxSize * 100)) / 100, random(options.minSpeed, options.maxSpeed)));
          -            }
          -
          -            // This adds the style to make the snowflakes round via border radius property
          -            if(options.round){
          -                $('.snowfall-flakes').css({'-moz-border-radius' : options.maxSize, '-webkit-border-radius' : options.maxSize, 'border-radius' : options.maxSize});
          -            }
          -
          -            // This adds shadows just below the snowflake so they pop a bit on lighter colored web pages
          -            if(options.shadow){
          -                $('.snowfall-flakes').css({'-moz-box-shadow' : '1px 1px 1px #555', '-webkit-box-shadow' : '1px 1px 1px #555', 'box-shadow' : '1px 1px 1px #555'});
          -            }
          -
          -            // On newer Macbooks Snowflakes will fall based on deviceorientation
          -            var doRatio = false;
          -            if (options.deviceorientation) {
          -                $(window).bind('deviceorientation', function(event) {
          -                    doRatio = event.originalEvent.gamma * 0.1;
          -                });
          -            }
          -
          -            // this controls flow of the updating snow
          -            function snow(){
          -                for( i = 0; i < flakes.length; i += 1){
          -                    flakes[i].update();
          -                }
          -
          -                snowTimeout = requestAnimationFrame(function(){snow()});
          -            }
          -
          -            snow();
          -
          -            // clears the snowflakes
          -            this.clear = function(){
          -                $('.snowfall-canvas').remove();
          -                $(element).children('.snowfall-flakes').remove();
          -                cancelAnimationFrame(snowTimeout);
          -            }
          -    };
          -
          -    // Initialize the options and the plugin
          -    $.fn.snowfall = function(options){
          -        if(typeof(options) == "object" || options == undefined){
          -                 return this.each(function(i){
          -                    (new $.snowfall(this, options));
          -                });
          -        }else if (typeof(options) == "string") {
          -            return this.each(function(i){
          -                var snow = $(this).data('snowfall');
          -                if(snow){
          -                    snow.clear();
          -                }
          -            });
          -        }
          -    };
          -})(jQuery);
          \ No newline at end of file
          diff --git a/src/js/lib/split.js b/src/js/lib/split.js
          deleted file mode 100755
          index 5f4e49d..0000000
          --- a/src/js/lib/split.js
          +++ /dev/null
          @@ -1,585 +0,0 @@
          -/** @license
          -========================================================================
          -  Split.js v1.1.1
          -  Copyright (c) 2015 Nathan Cahill
          -
          -  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 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.
          -*/
          -
          -
          -// The programming goals of Split.js are to deliver readable, understandable and
          -// maintainable code, while at the same time manually optimizing for tiny minified file size,
          -// browser compatibility without additional requirements, graceful fallback (IE8 is supported)
          -// and very few assumptions about the user's page layout.
          -//
          -// Make sure all browsers handle this JS library correctly with ES5.
          -// More information here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode
          -'use strict';
          -
          -// A wrapper function that does a couple things:
          -//
          -// 1. Doesn't pollute the global namespace. This is important for a library.
          -// 2. Allows us to mount the library in different module systems, as well as
          -//    directly in the browser.
          -(function() {
          -
          -// Save the global `this` for use later. In this case, since the library only
          -// runs in the browser, it will refer to `window`. Also, figure out if we're in IE8
          -// or not. IE8 will still render correctly, but will be static instead of draggable.
          -//
          -// Save a couple long function names that are used frequently.
          -// This optimization saves around 400 bytes.
          -var global = this
          -  , isIE8 = global.attachEvent && !global[addEventListener]
          -  , document = global.document
          -  , addEventListener = 'addEventListener'
          -  , removeEventListener = 'removeEventListener'
          -  , getBoundingClientRect = 'getBoundingClientRect'
          -
          -  // This library only needs two helper functions:
          -  //
          -  // The first determines which prefixes of CSS calc we need.
          -  // We only need to do this once on startup, when this anonymous function is called.
          -  // 
          -  // Tests -webkit, -moz and -o prefixes. Modified from StackOverflow:
          -  // http://stackoverflow.com/questions/16625140/js-feature-detection-to-detect-the-usage-of-webkit-calc-over-calc/16625167#16625167
          -  , calc = (function () {
          -        var el
          -          , prefixes = ["", "-webkit-", "-moz-", "-o-"]
          -
          -        for (var i = 0; i < prefixes.length; i++) {
          -            el = document.createElement('div')
          -            el.style.cssText = "width:" + prefixes[i] + "calc(9px)"
          -
          -            if (el.style.length) {
          -                return prefixes[i] + "calc"
          -            }
          -        }
          -    })()
          -
          -  // The second helper function allows elements and string selectors to be used
          -  // interchangeably. In either case an element is returned. This allows us to
          -  // do `Split(elem1, elem2)` as well as `Split('#id1', '#id2')`.
          -  , elementOrSelector = function (el) {
          -        if (typeof el === 'string' || el instanceof String) {
          -            return document.querySelector(el)
          -        } else {
          -            return el
          -        }
          -    }
          -
          -  // The main function to initialize a split. Split.js thinks about each pair
          -  // of elements as an independant pair. Dragging the gutter between two elements
          -  // only changes the dimensions of elements in that pair. This is key to understanding
          -  // how the following functions operate, since each function is bound to a pair.
          -  // 
          -  // A pair object is shaped like this:
          -  // 
          -  // {
          -  //     a: DOM element,
          -  //     b: DOM element,
          -  //     aMin: Number,
          -  //     bMin: Number,
          -  //     dragging: Boolean,
          -  //     parent: DOM element,
          -  //     isFirst: Boolean,
          -  //     isLast: Boolean,
          -  //     direction: 'horizontal' | 'vertical'
          -  // }
          -  //
          -  // The basic sequence:
          -  // 
          -  // 1. Set defaults to something sane. `options` doesn't have to be passed at all.
          -  // 2. Initialize a bunch of strings based on the direction we're splitting.
          -  //    A lot of the behavior in the rest of the library is paramatized down to
          -  //    rely on CSS strings and classes.
          -  // 3. Define the dragging helper functions, and a few helpers to go with them.
          -  // 4. Define a few more functions that "balance" the entire split instance.
          -  //    Split.js tries it's best to cope with min sizes that don't add up.
          -  // 5. Loop through the elements while pairing them off. Every pair gets an
          -  //    `pair` object, a gutter, and special isFirst/isLast properties.
          -  // 6. Actually size the pair elements, insert gutters and attach event listeners.
          -  // 7. Balance all of the pairs to accomodate min sizes as best as possible.
          -  , Split = function (ids, options) {
          -    var dimension
          -      , i
          -      , clientDimension
          -      , clientAxis
          -      , position
          -      , gutterClass
          -      , paddingA
          -      , paddingB
          -      , pairs = []
          -
          -    // 1. Set defaults to something sane. `options` doesn't have to be passed at all,
          -    // so create an options object if none exists. Pixel values 10, 100 and 30 are
          -    // arbitrary but feel natural.
          -    options = typeof options !== 'undefined' ?  options : {}
          -
          -    if (typeof options.gutterSize === 'undefined') options.gutterSize = 10
          -    if (typeof options.minSize === 'undefined') options.minSize = 100
          -    if (typeof options.snapOffset === 'undefined') options.snapOffset = 30
          -    if (typeof options.direction === 'undefined') options.direction = 'horizontal'
          -
          -    // 2. Initialize a bunch of strings based on the direction we're splitting.
          -    // A lot of the behavior in the rest of the library is paramatized down to
          -    // rely on CSS strings and classes.
          -    if (options.direction == 'horizontal') {
          -        dimension = 'width'
          -        clientDimension = 'clientWidth'
          -        clientAxis = 'clientX'
          -        position = 'left'
          -        gutterClass = 'gutter gutter-horizontal'
          -        paddingA = 'paddingLeft'
          -        paddingB = 'paddingRight'
          -        if (!options.cursor) options.cursor = 'ew-resize'
          -    } else if (options.direction == 'vertical') {
          -        dimension = 'height'
          -        clientDimension = 'clientHeight'
          -        clientAxis = 'clientY'
          -        position = 'top'
          -        gutterClass = 'gutter gutter-vertical'
          -        paddingA = 'paddingTop'
          -        paddingB = 'paddingBottom'
          -        if (!options.cursor) options.cursor = 'ns-resize'
          -    }
          -
          -    // 3. Define the dragging helper functions, and a few helpers to go with them.
          -    // Each helper is bound to a pair object that contains it's metadata. This
          -    // also makes it easy to store references to listeners that that will be
          -    // added and removed.
          -    // 
          -    // Even though there are no other functions contained in them, aliasing
          -    // this to self saves 50 bytes or so since it's used so frequently.
          -    //
          -    // The pair object saves metadata like dragging state, position and
          -    // event listener references.
          -    //
          -    // startDragging calls `calculateSizes` to store the inital size in the pair object.
          -    // It also adds event listeners for mouse/touch events,
          -    // and prevents selection while dragging so avoid the selecting text.
          -    var startDragging = function (e) {
          -            // Alias frequently used variables to save space. 200 bytes.
          -            var self = this
          -              , a = self.a
          -              , b = self.b
          -
          -            // Call the onDragStart callback.
          -            if (!self.dragging && options.onDragStart) {
          -                options.onDragStart()
          -            }
          -
          -            // Don't actually drag the element. We emulate that in the drag function.
          -            e.preventDefault()
          -
          -            // Set the dragging property of the pair object.
          -            self.dragging = true
          -
          -            // Create two event listeners bound to the same pair object and store
          -            // them in the pair object.
          -            self.move = drag.bind(self)
          -            self.stop = stopDragging.bind(self)
          -
          -            // All the binding. `window` gets the stop events in case we drag out of the elements.
          -            global[addEventListener]('mouseup', self.stop)
          -            global[addEventListener]('touchend', self.stop)
          -            global[addEventListener]('touchcancel', self.stop)
          -
          -            self.parent[addEventListener]('mousemove', self.move)
          -            self.parent[addEventListener]('touchmove', self.move)
          -
          -            // Disable selection. Disable!
          -            a[addEventListener]('selectstart', noop)
          -            a[addEventListener]('dragstart', noop)
          -            b[addEventListener]('selectstart', noop)
          -            b[addEventListener]('dragstart', noop)
          -
          -            a.style.userSelect = 'none'
          -            a.style.webkitUserSelect = 'none'
          -            a.style.MozUserSelect = 'none'
          -            a.style.pointerEvents = 'none'
          -
          -            b.style.userSelect = 'none'
          -            b.style.webkitUserSelect = 'none'
          -            b.style.MozUserSelect = 'none'
          -            b.style.pointerEvents = 'none'
          -
          -            // Set the cursor, both on the gutter and the parent element.
          -            // Doing only a, b and gutter causes flickering.
          -            self.gutter.style.cursor = options.cursor
          -            self.parent.style.cursor = options.cursor
          -
          -            // Cache the initial sizes of the pair.
          -            calculateSizes.call(self)
          -        }
          -
          -      // stopDragging is very similar to startDragging in reverse.
          -      , stopDragging = function () {
          -            var self = this
          -              , a = self.a
          -              , b = self.b
          -
          -            if (self.dragging && options.onDragEnd) {
          -                options.onDragEnd()
          -            }
          -
          -            self.dragging = false
          -
          -            // Remove the stored event listeners. This is why we store them.
          -            global[removeEventListener]('mouseup', self.stop)
          -            global[removeEventListener]('touchend', self.stop)
          -            global[removeEventListener]('touchcancel', self.stop)
          -
          -            self.parent[removeEventListener]('mousemove', self.move)
          -            self.parent[removeEventListener]('touchmove', self.move)
          -
          -            // Delete them once they are removed. I think this makes a difference
          -            // in memory usage with a lot of splits on one page. But I don't know for sure.
          -            delete self.stop
          -            delete self.move
          -
          -            a[removeEventListener]('selectstart', noop)
          -            a[removeEventListener]('dragstart', noop)
          -            b[removeEventListener]('selectstart', noop)
          -            b[removeEventListener]('dragstart', noop)
          -
          -            a.style.userSelect = ''
          -            a.style.webkitUserSelect = ''
          -            a.style.MozUserSelect = ''
          -            a.style.pointerEvents = ''
          -
          -            b.style.userSelect = ''
          -            b.style.webkitUserSelect = ''
          -            b.style.MozUserSelect = ''
          -            b.style.pointerEvents = ''
          -
          -            self.gutter.style.cursor = ''
          -            self.parent.style.cursor = ''
          -        }
          -
          -      // drag, where all the magic happens. The logic is really quite simple:
          -      // 
          -      // 1. Ignore if the pair is not dragging.
          -      // 2. Get the offset of the event.
          -      // 3. Snap offset to min if within snappable range (within min + snapOffset).
          -      // 4. Actually adjust each element in the pair to offset.
          -      // 
          -      // ---------------------------------------------------------------------
          -      // |    | <- this.aMin               ||              this.bMin -> |    |
          -      // |    |  | <- this.snapOffset      ||     this.snapOffset -> |  |    |
          -      // |    |  |                         ||                        |  |    |
          -      // |    |  |                         ||                        |  |    |
          -      // ---------------------------------------------------------------------
          -      // | <- this.start                                        this.size -> |
          -      , drag = function (e) {
          -            var offset
          -
          -            if (!this.dragging) return
          -
          -            // Get the offset of the event from the first side of the
          -            // pair `this.start`. Supports touch events, but not multitouch, so only the first
          -            // finger `touches[0]` is counted.
          -            if ('touches' in e) {
          -                offset = e.touches[0][clientAxis] - this.start
          -            } else {
          -                offset = e[clientAxis] - this.start
          -            }
          -
          -            // If within snapOffset of min or max, set offset to min or max.
          -            // snapOffset buffers aMin and bMin, so logic is opposite for both.
          -            // Include the appropriate gutter sizes to prevent overflows.
          -            if (offset <= this.aMin + options.snapOffset + this.aGutterSize) {
          -                offset = this.aMin + this.aGutterSize
          -            } else if (offset >= this.size - (this.bMin + options.snapOffset + this.bGutterSize)) {
          -                offset = this.size - (this.bMin + this.bGutterSize)
          -            }
          -
          -            // Actually adjust the size.
          -            adjust.call(this, offset)
          -
          -            // Call the drag callback continously. Don't do anything too intensive
          -            // in this callback.
          -            if (options.onDrag) {
          -                options.onDrag()
          -            }
          -        }
          -
          -      // Cache some important sizes when drag starts, so we don't have to do that
          -      // continously:
          -      // 
          -      // `size`: The total size of the pair. First element + second element + first gutter + second gutter.
          -      // `percentage`: The percentage between 0-100 that the pair occupies in the parent.
          -      // `start`: The leading side of the first element.
          -      //
          -      // ------------------------------------------------ - - - - - - - - - - -
          -      // |      aGutterSize -> |||                      |                     |
          -      // |                     |||                      |                     |
          -      // |                     |||                      |                     |
          -      // |                     ||| <- bGutterSize       |                     |
          -      // ------------------------------------------------ - - - - - - - - - - -
          -      // | <- start                             size -> |       parentSize -> |
          -      , calculateSizes = function () {
          -            // Figure out the parent size minus padding.
          -            var computedStyle = global.getComputedStyle(this.parent)
          -              , parentSize = this.parent[clientDimension] - parseFloat(computedStyle[paddingA]) - parseFloat(computedStyle[paddingB])
          -
          -            this.size = this.a[getBoundingClientRect]()[dimension] + this.b[getBoundingClientRect]()[dimension] + this.aGutterSize + this.bGutterSize
          -            this.percentage = Math.min(this.size / parentSize * 100, 100)
          -            this.start = this.a[getBoundingClientRect]()[position]
          -        }
          -
          -      // Actually adjust the size of elements `a` and `b` to `offset` while dragging.
          -      // calc is used to allow calc(percentage + gutterpx) on the whole split instance,
          -      // which allows the viewport to be resized without additional logic.
          -      // Element a's size is the same as offset. b's size is total size - a size.
          -      // Both sizes are calculated from the initial parent percentage, then the gutter size is subtracted.
          -      , adjust = function (offset) {
          -            this.a.style[dimension] = calc + '(' + (offset / this.size * this.percentage) + '% - ' + this.aGutterSize + 'px)'
          -            this.b.style[dimension] = calc + '(' + (this.percentage - (offset / this.size * this.percentage)) + '% - ' + this.bGutterSize + 'px)'
          -        }
          -
          -      // 4. Define a few more functions that "balance" the entire split instance.
          -      // Split.js tries it's best to cope with min sizes that don't add up.
          -      // At some point this should go away since it breaks out of the calc(% - px) model.
          -      // Maybe it's a user error if you pass uncomputable minSizes.
          -      , fitMin = function () {
          -            var self = this
          -              , a = self.a
          -              , b = self.b
          -
          -            if (a[getBoundingClientRect]()[dimension] < self.aMin) {
          -                a.style[dimension] = (self.aMin - self.aGutterSize) + 'px'
          -                b.style[dimension] = (self.size - self.aMin - self.aGutterSize) + 'px'
          -            } else if (b[getBoundingClientRect]()[dimension] < self.bMin) {
          -                a.style[dimension] = (self.size - self.bMin - self.bGutterSize) + 'px'
          -                b.style[dimension] = (self.bMin - self.bGutterSize) + 'px'
          -            }
          -        }
          -      , fitMinReverse = function () {
          -            var self = this
          -              , a = self.a
          -              , b = self.b
          -
          -            if (b[getBoundingClientRect]()[dimension] < self.bMin) {
          -                a.style[dimension] = (self.size - self.bMin - self.bGutterSize) + 'px'
          -                b.style[dimension] = (self.bMin - self.bGutterSize) + 'px'
          -            } else if (a[getBoundingClientRect]()[dimension] < self.aMin) {
          -                a.style[dimension] = (self.aMin - self.aGutterSize) + 'px'
          -                b.style[dimension] = (self.size - self.aMin - self.aGutterSize) + 'px'
          -            }
          -        }
          -      , balancePairs = function (pairs) {
          -            for (var i = 0; i < pairs.length; i++) {
          -                calculateSizes.call(pairs[i])
          -                fitMin.call(pairs[i])
          -            }
          -
          -            for (i = pairs.length - 1; i >= 0; i--) {
          -                calculateSizes.call(pairs[i])
          -                fitMinReverse.call(pairs[i])
          -            }
          -        }
          -      , setElementSize = function (el, size, gutterSize) {
          -            // Split.js allows setting sizes via numbers (ideally), or if you must,
          -            // by string, like '300px'. This is less than ideal, because it breaks
          -            // the fluid layout that `calc(% - px)` provides. You're on your own if you do that,
          -            // make sure you calculate the gutter size by hand.
          -            if (typeof size !== 'string' && !(size instanceof String)) {
          -                if (!isIE8) {
          -                    size = calc + '(' + size + '% - ' + gutterSize + 'px)'
          -                } else {
          -                    size = options.sizes[i] + '%'
          -                }
          -            }
          -
          -            el.style[dimension] = size
          -        }
          -
          -      // No-op function to prevent default. Used to prevent selection.
          -      , noop = function () { return false }
          -
          -      // All DOM elements in the split should have a common parent. We can grab
          -      // the first elements parent and hope users read the docs because the
          -      // behavior will be whacky otherwise.
          -      , parent = elementOrSelector(ids[0]).parentNode
          -
          -    // Set default options.sizes to equal percentages of the parent element.
          -    if (!options.sizes) {
          -        var percent = 100 / ids.length
          -
          -        options.sizes = []
          -
          -        for (i = 0; i < ids.length; i++) {
          -            options.sizes.push(percent)
          -        }
          -    }
          -
          -    // Standardize minSize to an array if it isn't already. This allows minSize
          -    // to be passed as a number.
          -    if (!Array.isArray(options.minSize)) {
          -        var minSizes = []
          -
          -        for (i = 0; i < ids.length; i++) {
          -            minSizes.push(options.minSize)
          -        }
          -
          -        options.minSize = minSizes
          -    }
          -
          -    // 5. Loop through the elements while pairing them off. Every pair gets a
          -    // `pair` object, a gutter, and isFirst/isLast properties.
          -    //
          -    // Basic logic:
          -    //
          -    // - Starting with the second element `i > 0`, create `pair` objects with
          -    //   `a = ids[i - 1]` and `b = ids[i]`
          -    // - Set gutter sizes based on the _pair_ being first/last. The first and last
          -    //   pair have gutterSize / 2, since they only have one half gutter, and not two.
          -    // - Create gutter elements and add event listeners.
          -    // - Set the size of the elements, minus the gutter sizes.
          -    //
          -    // -----------------------------------------------------------------------
          -    // |     i=0     |         i=1         |        i=2       |      i=3     |
          -    // |             |       isFirst       |                  |     isLast   |
          -    // |           pair 0                pair 1             pair 2           |
          -    // |             |                     |                  |              |
          -    // -----------------------------------------------------------------------
          -    for (i = 0; i < ids.length; i++) {
          -        var el = elementOrSelector(ids[i])
          -          , isFirstPair = (i == 1)
          -          , isLastPair = (i == ids.length - 1)
          -          , size = options.sizes[i]
          -          , gutterSize = options.gutterSize
          -          , pair
          -
          -        if (i > 0) {
          -            // Create the pair object with it's metadata.
          -            pair = {
          -                a: elementOrSelector(ids[i - 1]),
          -                b: el,
          -                aMin: options.minSize[i - 1],
          -                bMin: options.minSize[i],
          -                dragging: false,
          -                parent: parent,
          -                isFirst: isFirstPair,
          -                isLast: isLastPair,
          -                direction: options.direction
          -            }
          -
          -            // For first and last pairs, first and last gutter width is half.
          -            pair.aGutterSize = options.gutterSize
          -            pair.bGutterSize = options.gutterSize
          -
          -            if (isFirstPair) {
          -                pair.aGutterSize = options.gutterSize / 2
          -            }
          -
          -            if (isLastPair) {
          -                pair.bGutterSize = options.gutterSize / 2
          -            }
          -        }
          -
          -        // Determine the size of the current element. IE8 is supported by
          -        // staticly assigning sizes without draggable gutters. Assigns a string
          -        // to `size`.
          -        // 
          -        // IE9 and above
          -        if (!isIE8) {
          -            // Create gutter elements for each pair.
          -            if (i > 0) {
          -                var gutter = document.createElement('div')
          -
          -                gutter.className = gutterClass
          -                gutter.style[dimension] = options.gutterSize + 'px'
          -
          -                gutter[addEventListener]('mousedown', startDragging.bind(pair))
          -                gutter[addEventListener]('touchstart', startDragging.bind(pair))
          -
          -                parent.insertBefore(gutter, el)
          -
          -                pair.gutter = gutter
          -            }
          -
          -            // Half-size gutters for first and last elements.
          -            if (i === 0 || i == ids.length - 1) {
          -                gutterSize = options.gutterSize / 2
          -            }
          -        }
          -
          -        // Set the element size to our determined size.
          -        setElementSize(el, size, gutterSize)
          -
          -        // After the first iteration, and we have a pair object, append it to the
          -        // list of pairs.
          -        if (i > 0) {
          -            pairs.push(pair)
          -        }
          -    }
          -
          -    // Balance the pairs to try to accomodate min sizes.
          -    balancePairs(pairs)
          -
          -    return {
          -        setSizes: function (sizes) {
          -            for (var i = 0; i < sizes.length; i++) {
          -                if (i > 0) {
          -                    var pair = pairs[i - 1]
          -
          -                    setElementSize(pair.a, sizes[i - 1], pair.aGutterSize)
          -                    setElementSize(pair.b, sizes[i], pair.bGutterSize)
          -                }
          -            }
          -        },
          -        collapse: function (i) {
          -            var pair
          -
          -            if (i === pairs.length) {
          -                pair = pairs[i - 1]
          -
          -                calculateSizes.call(pair)
          -                adjust.call(pair, pair.size - pair.bGutterSize)
          -            } else {
          -                pair = pairs[i]
          -
          -                calculateSizes.call(pair)
          -                adjust.call(pair, pair.aGutterSize)
          -            }
          -        },
          -        destroy: function () {
          -            for (var i = 0; i < pairs.length; i++) {
          -                pairs[i].parent.removeChild(pairs[i].gutter)
          -                pairs[i].a.style[dimension] = ''
          -                pairs[i].b.style[dimension] = ''
          -            }
          -        }
          -    }
          -}
          -
          -// Play nicely with module systems, and the browser too if you include it raw.
          -if (typeof exports !== 'undefined') {
          -    if (typeof module !== 'undefined' && module.exports) {
          -        exports = module.exports = Split
          -    }
          -    exports.Split = Split
          -} else {
          -    global.Split = Split
          -}
          -
          -// Call our wrapper function with the current global. In this case, `window`.
          -}).call(window);
          \ No newline at end of file
          diff --git a/src/js/lib/unzip.js b/src/js/lib/unzip.js
          deleted file mode 100755
          index e046ca9..0000000
          --- a/src/js/lib/unzip.js
          +++ /dev/null
          @@ -1,31 +0,0 @@
          -/* zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */(function() {'use strict';function m(a){throw a;}var q=void 0,u,aa=this;function v(a,b){var c=a.split("."),d=aa;!(c[0]in d)&&d.execScript&&d.execScript("var "+c[0]);for(var f;c.length&&(f=c.shift());)!c.length&&b!==q?d[f]=b:d=d[f]?d[f]:d[f]={}};var w="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Uint32Array&&"undefined"!==typeof DataView;new (w?Uint8Array:Array)(256);var x;for(x=0;256>x;++x)for(var y=x,ba=7,y=y>>>1;y;y>>>=1)--ba;var z=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,
          -2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,
          -2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,
          -2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,
          -3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,
          -936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],B=w?new Uint32Array(z):z;function C(a){var b=a.length,c=0,d=Number.POSITIVE_INFINITY,f,h,k,e,g,l,p,s,r,A;for(s=0;s<b;++s)a[s]>c&&(c=a[s]),a[s]<d&&(d=a[s]);f=1<<c;h=new (w?Uint32Array:Array)(f);k=1;e=0;for(g=2;k<=c;){for(s=0;s<b;++s)if(a[s]===k){l=0;p=e;for(r=0;r<k;++r)l=l<<1|p&1,p>>=1;A=k<<16|s;for(r=l;r<f;r+=g)h[r]=A;++e}++k;e<<=1;g<<=1}return[h,c,d]};var D=[],E;for(E=0;288>E;E++)switch(!0){case 143>=E:D.push([E+48,8]);break;case 255>=E:D.push([E-144+400,9]);break;case 279>=E:D.push([E-256+0,7]);break;case 287>=E:D.push([E-280+192,8]);break;default:m("invalid literal: "+E)}
          -var ca=function(){function a(a){switch(!0){case 3===a:return[257,a-3,0];case 4===a:return[258,a-4,0];case 5===a:return[259,a-5,0];case 6===a:return[260,a-6,0];case 7===a:return[261,a-7,0];case 8===a:return[262,a-8,0];case 9===a:return[263,a-9,0];case 10===a:return[264,a-10,0];case 12>=a:return[265,a-11,1];case 14>=a:return[266,a-13,1];case 16>=a:return[267,a-15,1];case 18>=a:return[268,a-17,1];case 22>=a:return[269,a-19,2];case 26>=a:return[270,a-23,2];case 30>=a:return[271,a-27,2];case 34>=a:return[272,
          -a-31,2];case 42>=a:return[273,a-35,3];case 50>=a:return[274,a-43,3];case 58>=a:return[275,a-51,3];case 66>=a:return[276,a-59,3];case 82>=a:return[277,a-67,4];case 98>=a:return[278,a-83,4];case 114>=a:return[279,a-99,4];case 130>=a:return[280,a-115,4];case 162>=a:return[281,a-131,5];case 194>=a:return[282,a-163,5];case 226>=a:return[283,a-195,5];case 257>=a:return[284,a-227,5];case 258===a:return[285,a-258,0];default:m("invalid length: "+a)}}var b=[],c,d;for(c=3;258>=c;c++)d=a(c),b[c]=d[2]<<24|d[1]<<
          -16|d[0];return b}();w&&new Uint32Array(ca);function F(a,b){this.l=[];this.m=32768;this.d=this.f=this.c=this.t=0;this.input=w?new Uint8Array(a):a;this.u=!1;this.n=G;this.L=!1;if(b||!(b={}))b.index&&(this.c=b.index),b.bufferSize&&(this.m=b.bufferSize),b.bufferType&&(this.n=b.bufferType),b.resize&&(this.L=b.resize);switch(this.n){case H:this.a=32768;this.b=new (w?Uint8Array:Array)(32768+this.m+258);break;case G:this.a=0;this.b=new (w?Uint8Array:Array)(this.m);this.e=this.X;this.B=this.S;this.q=this.W;break;default:m(Error("invalid inflate mode"))}}
          -var H=0,G=1;
          -F.prototype.r=function(){for(;!this.u;){var a=I(this,3);a&1&&(this.u=!0);a>>>=1;switch(a){case 0:var b=this.input,c=this.c,d=this.b,f=this.a,h=b.length,k=q,e=q,g=d.length,l=q;this.d=this.f=0;c+1>=h&&m(Error("invalid uncompressed block header: LEN"));k=b[c++]|b[c++]<<8;c+1>=h&&m(Error("invalid uncompressed block header: NLEN"));e=b[c++]|b[c++]<<8;k===~e&&m(Error("invalid uncompressed block header: length verify"));c+k>b.length&&m(Error("input buffer is broken"));switch(this.n){case H:for(;f+k>d.length;){l=
          -g-f;k-=l;if(w)d.set(b.subarray(c,c+l),f),f+=l,c+=l;else for(;l--;)d[f++]=b[c++];this.a=f;d=this.e();f=this.a}break;case G:for(;f+k>d.length;)d=this.e({H:2});break;default:m(Error("invalid inflate mode"))}if(w)d.set(b.subarray(c,c+k),f),f+=k,c+=k;else for(;k--;)d[f++]=b[c++];this.c=c;this.a=f;this.b=d;break;case 1:this.q(da,ea);break;case 2:fa(this);break;default:m(Error("unknown BTYPE: "+a))}}return this.B()};
          -var J=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],K=w?new Uint16Array(J):J,L=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],M=w?new Uint16Array(L):L,ga=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],O=w?new Uint8Array(ga):ga,ha=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],ia=w?new Uint16Array(ha):ha,ja=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,
          -12,12,13,13],P=w?new Uint8Array(ja):ja,Q=new (w?Uint8Array:Array)(288),R,la;R=0;for(la=Q.length;R<la;++R)Q[R]=143>=R?8:255>=R?9:279>=R?7:8;var da=C(Q),S=new (w?Uint8Array:Array)(30),T,ma;T=0;for(ma=S.length;T<ma;++T)S[T]=5;var ea=C(S);function I(a,b){for(var c=a.f,d=a.d,f=a.input,h=a.c,k=f.length,e;d<b;)h>=k&&m(Error("input buffer is broken")),c|=f[h++]<<d,d+=8;e=c&(1<<b)-1;a.f=c>>>b;a.d=d-b;a.c=h;return e}
          -function U(a,b){for(var c=a.f,d=a.d,f=a.input,h=a.c,k=f.length,e=b[0],g=b[1],l,p;d<g&&!(h>=k);)c|=f[h++]<<d,d+=8;l=e[c&(1<<g)-1];p=l>>>16;a.f=c>>p;a.d=d-p;a.c=h;return l&65535}
          -function fa(a){function b(a,b,c){var d,e=this.K,f,g;for(g=0;g<a;)switch(d=U(this,b),d){case 16:for(f=3+I(this,2);f--;)c[g++]=e;break;case 17:for(f=3+I(this,3);f--;)c[g++]=0;e=0;break;case 18:for(f=11+I(this,7);f--;)c[g++]=0;e=0;break;default:e=c[g++]=d}this.K=e;return c}var c=I(a,5)+257,d=I(a,5)+1,f=I(a,4)+4,h=new (w?Uint8Array:Array)(K.length),k,e,g,l;for(l=0;l<f;++l)h[K[l]]=I(a,3);if(!w){l=f;for(f=h.length;l<f;++l)h[K[l]]=0}k=C(h);e=new (w?Uint8Array:Array)(c);g=new (w?Uint8Array:Array)(d);a.K=
          -0;a.q(C(b.call(a,c,k,e)),C(b.call(a,d,k,g)))}u=F.prototype;u.q=function(a,b){var c=this.b,d=this.a;this.C=a;for(var f=c.length-258,h,k,e,g;256!==(h=U(this,a));)if(256>h)d>=f&&(this.a=d,c=this.e(),d=this.a),c[d++]=h;else{k=h-257;g=M[k];0<O[k]&&(g+=I(this,O[k]));h=U(this,b);e=ia[h];0<P[h]&&(e+=I(this,P[h]));d>=f&&(this.a=d,c=this.e(),d=this.a);for(;g--;)c[d]=c[d++-e]}for(;8<=this.d;)this.d-=8,this.c--;this.a=d};
          -u.W=function(a,b){var c=this.b,d=this.a;this.C=a;for(var f=c.length,h,k,e,g;256!==(h=U(this,a));)if(256>h)d>=f&&(c=this.e(),f=c.length),c[d++]=h;else{k=h-257;g=M[k];0<O[k]&&(g+=I(this,O[k]));h=U(this,b);e=ia[h];0<P[h]&&(e+=I(this,P[h]));d+g>f&&(c=this.e(),f=c.length);for(;g--;)c[d]=c[d++-e]}for(;8<=this.d;)this.d-=8,this.c--;this.a=d};
          -u.e=function(){var a=new (w?Uint8Array:Array)(this.a-32768),b=this.a-32768,c,d,f=this.b;if(w)a.set(f.subarray(32768,a.length));else{c=0;for(d=a.length;c<d;++c)a[c]=f[c+32768]}this.l.push(a);this.t+=a.length;if(w)f.set(f.subarray(b,b+32768));else for(c=0;32768>c;++c)f[c]=f[b+c];this.a=32768;return f};
          -u.X=function(a){var b,c=this.input.length/this.c+1|0,d,f,h,k=this.input,e=this.b;a&&("number"===typeof a.H&&(c=a.H),"number"===typeof a.Q&&(c+=a.Q));2>c?(d=(k.length-this.c)/this.C[2],h=258*(d/2)|0,f=h<e.length?e.length+h:e.length<<1):f=e.length*c;w?(b=new Uint8Array(f),b.set(e)):b=e;return this.b=b};
          -u.B=function(){var a=0,b=this.b,c=this.l,d,f=new (w?Uint8Array:Array)(this.t+(this.a-32768)),h,k,e,g;if(0===c.length)return w?this.b.subarray(32768,this.a):this.b.slice(32768,this.a);h=0;for(k=c.length;h<k;++h){d=c[h];e=0;for(g=d.length;e<g;++e)f[a++]=d[e]}h=32768;for(k=this.a;h<k;++h)f[a++]=b[h];this.l=[];return this.buffer=f};
          -u.S=function(){var a,b=this.a;w?this.L?(a=new Uint8Array(b),a.set(this.b.subarray(0,b))):a=this.b.subarray(0,b):(this.b.length>b&&(this.b.length=b),a=this.b);return this.buffer=a};function V(a){a=a||{};this.files=[];this.v=a.comment}V.prototype.M=function(a){this.j=a};V.prototype.s=function(a){var b=a[2]&65535|2;return b*(b^1)>>8&255};V.prototype.k=function(a,b){a[0]=(B[(a[0]^b)&255]^a[0]>>>8)>>>0;a[1]=(6681*(20173*(a[1]+(a[0]&255))>>>0)>>>0)+1>>>0;a[2]=(B[(a[2]^a[1]>>>24)&255]^a[2]>>>8)>>>0};V.prototype.U=function(a){var b=[305419896,591751049,878082192],c,d;w&&(b=new Uint32Array(b));c=0;for(d=a.length;c<d;++c)this.k(b,a[c]&255);return b};function W(a,b){b=b||{};this.input=w&&a instanceof Array?new Uint8Array(a):a;this.c=0;this.ca=b.verify||!1;this.j=b.password}var na={P:0,N:8},X=[80,75,1,2],Y=[80,75,3,4],Z=[80,75,5,6];function oa(a,b){this.input=a;this.offset=b}
          -oa.prototype.parse=function(){var a=this.input,b=this.offset;(a[b++]!==X[0]||a[b++]!==X[1]||a[b++]!==X[2]||a[b++]!==X[3])&&m(Error("invalid file header signature"));this.version=a[b++];this.ja=a[b++];this.$=a[b++]|a[b++]<<8;this.I=a[b++]|a[b++]<<8;this.A=a[b++]|a[b++]<<8;this.time=a[b++]|a[b++]<<8;this.V=a[b++]|a[b++]<<8;this.p=(a[b++]|a[b++]<<8|a[b++]<<16|a[b++]<<24)>>>0;this.z=(a[b++]|a[b++]<<8|a[b++]<<16|a[b++]<<24)>>>0;this.J=(a[b++]|a[b++]<<8|a[b++]<<16|a[b++]<<24)>>>0;this.h=a[b++]|a[b++]<<
          -8;this.g=a[b++]|a[b++]<<8;this.F=a[b++]|a[b++]<<8;this.fa=a[b++]|a[b++]<<8;this.ha=a[b++]|a[b++]<<8;this.ga=a[b++]|a[b++]<<8|a[b++]<<16|a[b++]<<24;this.aa=(a[b++]|a[b++]<<8|a[b++]<<16|a[b++]<<24)>>>0;this.filename=String.fromCharCode.apply(null,w?a.subarray(b,b+=this.h):a.slice(b,b+=this.h));this.Y=w?a.subarray(b,b+=this.g):a.slice(b,b+=this.g);this.v=w?a.subarray(b,b+this.F):a.slice(b,b+this.F);this.length=b-this.offset};function pa(a,b){this.input=a;this.offset=b}var qa={O:1,da:8,ea:2048};
          -pa.prototype.parse=function(){var a=this.input,b=this.offset;(a[b++]!==Y[0]||a[b++]!==Y[1]||a[b++]!==Y[2]||a[b++]!==Y[3])&&m(Error("invalid local file header signature"));this.$=a[b++]|a[b++]<<8;this.I=a[b++]|a[b++]<<8;this.A=a[b++]|a[b++]<<8;this.time=a[b++]|a[b++]<<8;this.V=a[b++]|a[b++]<<8;this.p=(a[b++]|a[b++]<<8|a[b++]<<16|a[b++]<<24)>>>0;this.z=(a[b++]|a[b++]<<8|a[b++]<<16|a[b++]<<24)>>>0;this.J=(a[b++]|a[b++]<<8|a[b++]<<16|a[b++]<<24)>>>0;this.h=a[b++]|a[b++]<<8;this.g=a[b++]|a[b++]<<8;this.filename=
          -String.fromCharCode.apply(null,w?a.subarray(b,b+=this.h):a.slice(b,b+=this.h));this.Y=w?a.subarray(b,b+=this.g):a.slice(b,b+=this.g);this.length=b-this.offset};
          -function $(a){var b=[],c={},d,f,h,k;if(!a.i){if(a.o===q){var e=a.input,g;if(!a.D)a:{var l=a.input,p;for(p=l.length-12;0<p;--p)if(l[p]===Z[0]&&l[p+1]===Z[1]&&l[p+2]===Z[2]&&l[p+3]===Z[3]){a.D=p;break a}m(Error("End of Central Directory Record not found"))}g=a.D;(e[g++]!==Z[0]||e[g++]!==Z[1]||e[g++]!==Z[2]||e[g++]!==Z[3])&&m(Error("invalid signature"));a.ia=e[g++]|e[g++]<<8;a.ka=e[g++]|e[g++]<<8;a.la=e[g++]|e[g++]<<8;a.ba=e[g++]|e[g++]<<8;a.R=(e[g++]|e[g++]<<8|e[g++]<<16|e[g++]<<24)>>>0;a.o=(e[g++]|
          -e[g++]<<8|e[g++]<<16|e[g++]<<24)>>>0;a.w=e[g++]|e[g++]<<8;a.v=w?e.subarray(g,g+a.w):e.slice(g,g+a.w)}d=a.o;h=0;for(k=a.ba;h<k;++h)f=new oa(a.input,d),f.parse(),d+=f.length,b[h]=f,c[f.filename]=h;a.R<d-a.o&&m(Error("invalid file header size"));a.i=b;a.G=c}}u=W.prototype;u.Z=function(){var a=[],b,c,d;this.i||$(this);d=this.i;b=0;for(c=d.length;b<c;++b)a[b]=d[b].filename;return a};
          -u.r=function(a,b){var c;this.G||$(this);c=this.G[a];c===q&&m(Error(a+" not found"));var d;d=b||{};var f=this.input,h=this.i,k,e,g,l,p,s,r,A;h||$(this);h[c]===q&&m(Error("wrong index"));e=h[c].aa;k=new pa(this.input,e);k.parse();e+=k.length;g=k.z;if(0!==(k.I&qa.O)){!d.password&&!this.j&&m(Error("please set password"));s=this.T(d.password||this.j);r=e;for(A=e+12;r<A;++r)ra(this,s,f[r]);e+=12;g-=12;r=e;for(A=e+g;r<A;++r)f[r]=ra(this,s,f[r])}switch(k.A){case na.P:l=w?this.input.subarray(e,e+g):this.input.slice(e,
          -e+g);break;case na.N:l=(new F(this.input,{index:e,bufferSize:k.J})).r();break;default:m(Error("unknown compression type"))}if(this.ca){var t=q,n,N="number"===typeof t?t:t=0,ka=l.length;n=-1;for(N=ka&7;N--;++t)n=n>>>8^B[(n^l[t])&255];for(N=ka>>3;N--;t+=8)n=n>>>8^B[(n^l[t])&255],n=n>>>8^B[(n^l[t+1])&255],n=n>>>8^B[(n^l[t+2])&255],n=n>>>8^B[(n^l[t+3])&255],n=n>>>8^B[(n^l[t+4])&255],n=n>>>8^B[(n^l[t+5])&255],n=n>>>8^B[(n^l[t+6])&255],n=n>>>8^B[(n^l[t+7])&255];p=(n^4294967295)>>>0;k.p!==p&&m(Error("wrong crc: file=0x"+
          -k.p.toString(16)+", data=0x"+p.toString(16)))}return l};u.M=function(a){this.j=a};function ra(a,b,c){c^=a.s(b);a.k(b,c);return c}u.k=V.prototype.k;u.T=V.prototype.U;u.s=V.prototype.s;v("Zlib.Unzip",W);v("Zlib.Unzip.prototype.decompress",W.prototype.r);v("Zlib.Unzip.prototype.getFilenames",W.prototype.Z);v("Zlib.Unzip.prototype.setPassword",W.prototype.M);}).call(this);
          diff --git a/src/js/lib/vkbeautify.js b/src/js/lib/vkbeautify.js
          deleted file mode 100755
          index fc2cb13..0000000
          --- a/src/js/lib/vkbeautify.js
          +++ /dev/null
          @@ -1,360 +0,0 @@
          -/** @license
          -========================================================================
          -  vkBeautify - javascript plugin to pretty-print or minify text in XML, JSON, CSS and SQL formats.
          -   
          -  Version - 0.99.00.beta 
          -  Copyright (c) 2012 Vadim Kiryukhin
          -  vkiryukhin @ gmail.com
          -  http://www.eslinstructor.net/vkbeautify/
          -  
          -  Dual licensed under the MIT and GPL licenses:
          -    http://www.opensource.org/licenses/mit-license.php
          -    http://www.gnu.org/licenses/gpl.html
          -*/
          -
          -/*
          -*   Pretty print
          -*
          -*        vkbeautify.xml(text [,indent_pattern]);
          -*        vkbeautify.json(text [,indent_pattern]);
          -*        vkbeautify.css(text [,indent_pattern]);
          -*        vkbeautify.sql(text [,indent_pattern]);
          -*
          -*        @text - String; text to beatufy;
          -*        @indent_pattern - Integer | String;
          -*                Integer:  number of white spaces;
          -*                String:   character string to visualize indentation ( can also be a set of white spaces )
          -*   Minify
          -*
          -*        vkbeautify.xmlmin(text [,preserve_comments]);
          -*        vkbeautify.jsonmin(text);
          -*        vkbeautify.cssmin(text [,preserve_comments]);
          -*        vkbeautify.sqlmin(text);
          -*
          -*        @text - String; text to minify;
          -*        @preserve_comments - Bool; [optional];
          -*                Set this flag to true to prevent removing comments from @text ( minxml and mincss functions only. )
          -*
          -*   Examples:
          -*        vkbeautify.xml(text); // pretty print XML
          -*        vkbeautify.json(text, 4 ); // pretty print JSON
          -*        vkbeautify.css(text, '. . . .'); // pretty print CSS
          -*        vkbeautify.sql(text, '----'); // pretty print SQL
          -*
          -*        vkbeautify.xmlmin(text, true);// minify XML, preserve comments
          -*        vkbeautify.jsonmin(text);// minify JSON
          -*        vkbeautify.cssmin(text);// minify CSS, remove comments ( default )
          -*        vkbeautify.sqlmin(text);// minify SQL
          -*
          -*/
          -
          -(function() {
          -
          -function createShiftArr(step) {
          -
          -	var space = '    ';
          -	
          -	if ( isNaN(parseInt(step)) ) {  // argument is string
          -		space = step;
          -	} else { // argument is integer
          -		switch(step) {
          -			case 1: space = ' '; break;
          -			case 2: space = '  '; break;
          -			case 3: space = '   '; break;
          -			case 4: space = '    '; break;
          -			case 5: space = '     '; break;
          -			case 6: space = '      '; break;
          -			case 7: space = '       '; break;
          -			case 8: space = '        '; break;
          -			case 9: space = '         '; break;
          -			case 10: space = '          '; break;
          -			case 11: space = '           '; break;
          -			case 12: space = '            '; break;
          -		}
          -	}
          -
          -	var shift = ['\n']; // array of shifts
          -	for(var ix=0;ix<100;ix++){
          -		shift.push(shift[ix]+space); 
          -	}
          -	return shift;
          -}
          -
          -function vkbeautify(){
          -	this.step = '    '; // 4 spaces
          -	this.shift = createShiftArr(this.step);
          -};
          -
          -vkbeautify.prototype.xml = function(text,step) {
          -
          -	var ar = text.replace(/>\s{0,}</g,"><")
          -				 .replace(/</g,"~::~<")
          -				 .replace(/\s*xmlns\:/g,"~::~xmlns:")
          -				 .replace(/\s*xmlns\=/g,"~::~xmlns=")
          -				 .split('~::~'),
          -		len = ar.length,
          -		inComment = false,
          -		deep = 0,
          -		str = '',
          -		ix = 0,
          -		shift = step ? createShiftArr(step) : this.shift;
          -
          -		for(ix=0;ix<len;ix++) {
          -			// start comment or <![CDATA[...]]> or <!DOCTYPE //
          -			if(ar[ix].search(/<!/) > -1) { 
          -				str += shift[deep]+ar[ix];
          -				inComment = true; 
          -				// end comment  or <![CDATA[...]]> //
          -				if(ar[ix].search(/-->/) > -1 || ar[ix].search(/\]>/) > -1 || ar[ix].search(/!DOCTYPE/) > -1 ) { 
          -					inComment = false; 
          -				}
          -			} else 
          -			// end comment  or <![CDATA[...]]> //
          -			if(ar[ix].search(/-->/) > -1 || ar[ix].search(/\]>/) > -1) { 
          -				str += ar[ix];
          -				inComment = false; 
          -			} else 
          -			// <elm></elm> //
          -			if( /^<\w/.exec(ar[ix-1]) && /^<\/\w/.exec(ar[ix]) &&
          -				/^<[\w:\-\.\,]+/.exec(ar[ix-1]) == /^<\/[\w:\-\.\,]+/.exec(ar[ix])[0].replace('/','')) { 
          -				str += ar[ix];
          -				if(!inComment) deep--;
          -			} else
          -			 // <elm> //
          -			if(ar[ix].search(/<\w/) > -1 && ar[ix].search(/<\//) == -1 && ar[ix].search(/\/>/) == -1 ) {
          -				str = !inComment ? str += shift[deep++]+ar[ix] : str += ar[ix];
          -			} else 
          -			 // <elm>...</elm> //
          -			if(ar[ix].search(/<\w/) > -1 && ar[ix].search(/<\//) > -1) {
          -				str = !inComment ? str += shift[deep]+ar[ix] : str += ar[ix];
          -			} else 
          -			// </elm> //
          -			if(ar[ix].search(/<\//) > -1) { 
          -				str = !inComment ? str += shift[--deep]+ar[ix] : str += ar[ix];
          -			} else 
          -			// <elm/> //
          -			if(ar[ix].search(/\/>/) > -1 ) { 
          -				str = !inComment ? str += shift[deep]+ar[ix] : str += ar[ix];
          -			} else 
          -			// <? xml ... ?> //
          -			if(ar[ix].search(/<\?/) > -1) { 
          -				str += shift[deep]+ar[ix];
          -			} else 
          -			// xmlns //
          -			if( ar[ix].search(/xmlns\:/) > -1  || ar[ix].search(/xmlns\=/) > -1) { 
          -				str += shift[deep]+ar[ix];
          -			} 
          -			
          -			else {
          -				str += ar[ix];
          -			}
          -		}
          -		
          -	return  (str[0] == '\n') ? str.slice(1) : str;
          -}
          -
          -vkbeautify.prototype.json = function(text,step) {
          -
          -	var step = step ? step : this.step;
          -	
          -	if (typeof JSON === 'undefined' ) return text; 
          -	
          -	if ( typeof text === "string" ) return JSON.stringify(JSON.parse(text), null, step);
          -	if ( typeof text === "object" ) return JSON.stringify(text, null, step);
          -		
          -	return text; // text is not string nor object
          -}
          -
          -vkbeautify.prototype.css = function(text, step) {
          -
          -	var ar = text.replace(/\s{1,}/g,' ')
          -				.replace(/\{/g,"{~::~")
          -				.replace(/\}/g,"~::~}~::~")
          -				.replace(/\;/g,";~::~")
          -				.replace(/\/\*/g,"~::~/*")
          -				.replace(/\*\//g,"*/~::~")
          -				.replace(/~::~\s{0,}~::~/g,"~::~")
          -				.split('~::~'),
          -		len = ar.length,
          -		deep = 0,
          -		str = '',
          -		ix = 0,
          -		shift = step ? createShiftArr(step) : this.shift;
          -		
          -		for(ix=0;ix<len;ix++) {
          -
          -			if( /\{/.exec(ar[ix]))  { 
          -				str += shift[deep++]+ar[ix];
          -			} else 
          -			if( /\}/.exec(ar[ix]))  { 
          -				str += shift[--deep]+ar[ix];
          -			} else
          -			if( /\*\\/.exec(ar[ix]))  { 
          -				str += shift[deep]+ar[ix];
          -			}
          -			else {
          -				str += shift[deep]+ar[ix];
          -			}
          -		}
          -		return str.replace(/^\n{1,}/,'');
          -}
          -
          -//----------------------------------------------------------------------------
          -
          -function isSubquery(str, parenthesisLevel) {
          -	return  parenthesisLevel - (str.replace(/\(/g,'').length - str.replace(/\)/g,'').length )
          -}
          -
          -function split_sql(str, tab) {
          -
          -	return str.replace(/\s{1,}/g," ")
          -
          -				.replace(/ AND /ig,"~::~"+tab+tab+"AND ")
          -				.replace(/ BETWEEN /ig,"~::~"+tab+"BETWEEN ")
          -				.replace(/ CASE /ig,"~::~"+tab+"CASE ")
          -				.replace(/ ELSE /ig,"~::~"+tab+"ELSE ")
          -				.replace(/ END /ig,"~::~"+tab+"END ")
          -				.replace(/ FROM /ig,"~::~FROM ")
          -				.replace(/ GROUP\s{1,}BY/ig,"~::~GROUP BY ")
          -				.replace(/ HAVING /ig,"~::~HAVING ")
          -				//.replace(/ SET /ig," SET~::~")
          -				.replace(/ IN /ig," IN ")
          -				
          -				.replace(/ JOIN /ig,"~::~JOIN ")
          -				.replace(/ CROSS~::~{1,}JOIN /ig,"~::~CROSS JOIN ")
          -				.replace(/ INNER~::~{1,}JOIN /ig,"~::~INNER JOIN ")
          -				.replace(/ LEFT~::~{1,}JOIN /ig,"~::~LEFT JOIN ")
          -				.replace(/ RIGHT~::~{1,}JOIN /ig,"~::~RIGHT JOIN ")
          -				
          -				.replace(/ ON /ig,"~::~"+tab+"ON ")
          -				.replace(/ OR /ig,"~::~"+tab+tab+"OR ")
          -				.replace(/ ORDER\s{1,}BY/ig,"~::~ORDER BY ")
          -				.replace(/ OVER /ig,"~::~"+tab+"OVER ")
          -
          -				.replace(/\(\s{0,}SELECT /ig,"~::~(SELECT ")
          -				.replace(/\)\s{0,}SELECT /ig,")~::~SELECT ")
          -				
          -				.replace(/ THEN /ig," THEN~::~"+tab+"")
          -				.replace(/ UNION /ig,"~::~UNION~::~")
          -				.replace(/ USING /ig,"~::~USING ")
          -				.replace(/ WHEN /ig,"~::~"+tab+"WHEN ")
          -				.replace(/ WHERE /ig,"~::~WHERE ")
          -				.replace(/ WITH /ig,"~::~WITH ")
          -				
          -				//.replace(/\,\s{0,}\(/ig,",~::~( ")
          -				//.replace(/\,/ig,",~::~"+tab+tab+"")
          -
          -				.replace(/ ALL /ig," ALL ")
          -				.replace(/ AS /ig," AS ")
          -				.replace(/ ASC /ig," ASC ")	
          -				.replace(/ DESC /ig," DESC ")	
          -				.replace(/ DISTINCT /ig," DISTINCT ")
          -				.replace(/ EXISTS /ig," EXISTS ")
          -				.replace(/ NOT /ig," NOT ")
          -				.replace(/ NULL /ig," NULL ")
          -				.replace(/ LIKE /ig," LIKE ")
          -				.replace(/\s{0,}SELECT /ig,"SELECT ")
          -				.replace(/\s{0,}UPDATE /ig,"UPDATE ")
          -				.replace(/ SET /ig," SET ")
          -							
          -				.replace(/~::~{1,}/g,"~::~")
          -				.split('~::~');
          -}
          -
          -vkbeautify.prototype.sql = function(text,step) {
          -
          -	var ar_by_quote = text.replace(/\s{1,}/g," ")
          -							.replace(/\'/ig,"~::~\'")
          -							.split('~::~'),
          -		len = ar_by_quote.length,
          -		ar = [],
          -		deep = 0,
          -		tab = this.step,//+this.step,
          -		inComment = true,
          -		inQuote = false,
          -		parenthesisLevel = 0,
          -		str = '',
          -		ix = 0,
          -		shift = step ? createShiftArr(step) : this.shift;;
          -
          -		for(ix=0;ix<len;ix++) {
          -			if(ix%2) {
          -				ar = ar.concat(ar_by_quote[ix]);
          -			} else {
          -				ar = ar.concat(split_sql(ar_by_quote[ix], tab) );
          -			}
          -		}
          -		
          -		len = ar.length;
          -		for(ix=0;ix<len;ix++) {
          -			
          -			parenthesisLevel = isSubquery(ar[ix], parenthesisLevel);
          -			
          -			if( /\s{0,}\s{0,}SELECT\s{0,}/.exec(ar[ix]))  { 
          -				ar[ix] = ar[ix].replace(/\,/g,",\n"+tab+tab+"")
          -			} 
          -			
          -			if( /\s{0,}\s{0,}SET\s{0,}/.exec(ar[ix]))  { 
          -				ar[ix] = ar[ix].replace(/\,/g,",\n"+tab+tab+"")
          -			} 
          -			
          -			if( /\s{0,}\(\s{0,}SELECT\s{0,}/.exec(ar[ix]))  { 
          -				deep++;
          -				str += shift[deep]+ar[ix];
          -			} else 
          -			if( /\'/.exec(ar[ix]) )  { 
          -				if(parenthesisLevel<1 && deep) {
          -					deep--;
          -				}
          -				str += ar[ix];
          -			}
          -			else  { 
          -				str += shift[deep]+ar[ix];
          -				if(parenthesisLevel<1 && deep) {
          -					deep--;
          -				}
          -			} 
          -			var junk = 0;
          -		}
          -
          -		str = str.replace(/^\n{1,}/,'').replace(/\n{1,}/g,"\n");
          -		return str;
          -}
          -
          -
          -vkbeautify.prototype.xmlmin = function(text, preserveComments) {
          -
          -	var str = preserveComments ? text
          -							   : text.replace(/\<![ \r\n\t]*(--([^\-]|[\r\n]|-[^\-])*--[ \r\n\t]*)\>/g,"")
          -									 .replace(/[ \r\n\t]{1,}xmlns/g, ' xmlns');
          -	return  str.replace(/>\s{0,}</g,"><"); 
          -}
          -
          -vkbeautify.prototype.jsonmin = function(text) {
          -
          -	if (typeof JSON === 'undefined' ) return text; 
          -	
          -	return JSON.stringify(JSON.parse(text), null, 0); 
          -				
          -}
          -
          -vkbeautify.prototype.cssmin = function(text, preserveComments) {
          -	
          -	var str = preserveComments ? text
          -							   : text.replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\//g,"") ;
          -
          -	return str.replace(/\s{1,}/g,' ')
          -			  .replace(/\{\s{1,}/g,"{")
          -			  .replace(/\}\s{1,}/g,"}")
          -			  .replace(/\;\s{1,}/g,";")
          -			  .replace(/\/\*\s{1,}/g,"/*")
          -			  .replace(/\*\/\s{1,}/g,"*/");
          -}
          -
          -vkbeautify.prototype.sqlmin = function(text) {
          -	return text.replace(/\s{1,}/g," ").replace(/\s{1,}\(/,"(").replace(/\s{1,}\)/,")");
          -}
          -
          -window.vkbeautify = new vkbeautify();
          -
          -})();
          diff --git a/src/js/lib/xpath.js b/src/js/lib/xpath.js
          deleted file mode 100755
          index 8954267..0000000
          --- a/src/js/lib/xpath.js
          +++ /dev/null
          @@ -1,8466 +0,0 @@
          -/** @license
          -========================================================================
          -  XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - 
          -  Copyright (c) 2012 Sergey Ilinsky
          -  Dual licensed under the MIT and GPL licenses.
          -*/
          -(function(){
          -
          -//	Javascript objects
          -var cString		= window.String,
          -	cBoolean	= window.Boolean,
          -	cNumber		= window.Number,
          -	cObject		= window.Object,
          -	cArray		= window.Array,
          -	cRegExp		= window.RegExp,
          -	cDate		= window.Date,
          -	cFunction	= window.Function,
          -	cMath		= window.Math,
          -// Error Objects
          -	cError		= window.Error,
          -	cSyntaxError= window.SyntaxError,
          -	cTypeError	= window.TypeError,
          -//	misc
          -	fIsNaN		= window.isNaN,
          -	fIsFinite	= window.isFinite,
          -	nNaN		= window.NaN,
          -	nInfinity	= window.Infinity,
          -	// Functions
          -	fWindow_btoa	= window.btoa,
          -	fWindow_atob	= window.atob,
          -	fWindow_parseInt= window.parseInt,
          -	fString_trim	=(function() {
          -		return cString.prototype.trim ? function(sValue) {return cString(sValue).trim();} : function(sValue) {
          -			return cString(sValue).replace(/^\s+|\s+$/g, '');
          -		};
          -	})(),
          -	fArray_indexOf	=(function() {
          -		return cArray.prototype.indexOf ? function(aValue, vItem) {return aValue.indexOf(vItem);} : function(aValue, vItem) {
          -			for (var nIndex = 0, nLength = aValue.length; nIndex < nLength; nIndex++)
          -				if (aValue[nIndex] === vItem)
          -					return nIndex;
          -			return -1;
          -		};
          -	})();
          -
          -var sNS_XSD	= "http://www.w3.org/2001/XMLSchema",
          -	sNS_XPF	= "http://www.w3.org/2005/xpath-functions",
          -	sNS_XNS	= "http://www.w3.org/2000/xmlns/",
          -	sNS_XML	= "http://www.w3.org/XML/1998/namespace";
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cException(sCode
          -
          -	) {
          -
          -	this.code		= sCode;
          -	this.message	=
          -
          -					  oException_messages[sCode];
          -};
          -
          -cException.prototype	= new cError;
          -
          -// "http://www.w3.org/2005/xqt-errors"
          -
          -var oException_messages	= {};
          -oException_messages["XPDY0002"]	= "Evaluation of an expression relies on some part of the dynamic context that has not been assigned a value.";
          -oException_messages["XPST0003"]	= "Expression is not a valid instance of the grammar";
          -oException_messages["XPTY0004"]	= "Type is not appropriate for the context in which the expression occurs";
          -oException_messages["XPST0008"]	= "Expression refers to an element name, attribute name, schema type name, namespace prefix, or variable name that is not defined in the static context";
          -oException_messages["XPST0010"]	= "Axis not supported";
          -oException_messages["XPST0017"]	= "Expanded QName and number of arguments in a function call do not match the name and arity of a function signature";
          -oException_messages["XPTY0018"]	= "The result of the last step in a path expression contains both nodes and atomic values";
          -oException_messages["XPTY0019"]	= "The result of a step (other than the last step) in a path expression contains an atomic value.";
          -oException_messages["XPTY0020"]	= "In an axis step, the context item is not a node.";
          -oException_messages["XPST0051"]	= "It is a static error if a QName that is used as an AtomicType in a SequenceType is not defined in the in-scope schema types as an atomic type.";
          -oException_messages["XPST0081"]	= "A QName used in an expression contains a namespace prefix that cannot be expanded into a namespace URI by using the statically known namespaces.";
          -//
          -oException_messages["FORG0001"]	= "Invalid value for cast/constructor.";
          -oException_messages["FORG0003"]	= "fn:zero-or-one called with a sequence containing more than one item.";
          -oException_messages["FORG0004"]	= "fn:one-or-more called with a sequence containing no items.";
          -oException_messages["FORG0005"]	= "fn:exactly-one called with a sequence containing zero or more than one item.";
          -oException_messages["FORG0006"]	= "Invalid argument type.";
          -//
          -oException_messages["FODC0001"]	= "No context document.";
          -//
          -oException_messages["FORX0001"]	= "Invalid regular expression flags.";
          -//
          -oException_messages["FOCA0002"]	= "Invalid lexical value.";
          -//
          -oException_messages["FOCH0002"]	= "Unsupported collation.";
          -
          -oException_messages["FONS0004"]	= "No namespace found for prefix.";
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cLexer(sValue) {
          -	var aMatch	= sValue.match(/\$?(?:(?![0-9-])(?:\w[\w.-]*|\*):)?(?![0-9-])(?:\w[\w.-]*|\*)|\(:|:\)|\/\/|\.\.|::|\d+(?:\.\d*)?(?:[eE][+-]?\d+)?|\.\d+(?:[eE][+-]?\d+)?|"[^"]*(?:""[^"]*)*"|'[^']*(?:''[^']*)*'|<<|>>|[!<>]=|(?![0-9-])[\w-]+:\*|\s+|./g);
          -	if (aMatch) {
          -		var nStack	= 0;
          -		for (var nIndex = 0, nLength = aMatch.length; nIndex < nLength; nIndex++)
          -			if (aMatch[nIndex] == '(:')
          -				nStack++;
          -			else
          -			if (aMatch[nIndex] == ':)' && nStack)
          -				nStack--;
          -			else
          -			if (!nStack && !/^\s/.test(aMatch[nIndex]))
          -				this[this.length++]	= aMatch[nIndex];
          -		if (nStack)
          -			throw new cException("XPST0003"
          -
          -			);
          -	}
          -};
          -
          -cLexer.prototype.index		= 0;
          -cLexer.prototype.length	= 0;
          -
          -cLexer.prototype.reset	= function() {
          -	this.index	= 0;
          -};
          -
          -cLexer.prototype.peek	= function(nOffset) {
          -	return this[this.index +(nOffset || 0)] || '';
          -};
          -
          -cLexer.prototype.next	= function(nOffset) {
          -	return(this.index+= nOffset || 1) < this.length;
          -};
          -
          -cLexer.prototype.back	= function(nOffset) {
          -	return(this.index-= nOffset || 1) > 0;
          -};
          -
          -cLexer.prototype.eof	= function() {
          -	return this.index >= this.length;
          -};
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cDOMAdapter() {
          -
          -};
          -
          -// Custom members
          -cDOMAdapter.prototype.isNode		= function(oNode) {
          -	return oNode &&!!oNode.nodeType;
          -};
          -
          -cDOMAdapter.prototype.getProperty	= function(oNode, sName) {
          -	return oNode[sName];
          -};
          -
          -// Standard members
          -cDOMAdapter.prototype.isSameNode	= function(oNode, oNode2) {
          -	return oNode == oNode2;
          -};
          -
          -cDOMAdapter.prototype.compareDocumentPosition	= function(oNode, oNode2) {
          -	return oNode.compareDocumentPosition(oNode2);
          -};
          -
          -cDOMAdapter.prototype.lookupNamespaceURI	= function(oNode, sPrefix) {
          -	return oNode.lookupNamespaceURI(sPrefix);
          -};
          -
          -// Document object members
          -cDOMAdapter.prototype.getElementById	= function(oNode, sId) {
          -	return oNode.getElementById(sId);
          -};
          -
          -// Element/Document object members
          -cDOMAdapter.prototype.getElementsByTagNameNS	= function(oNode, sNameSpaceURI, sLocalName) {
          -	return oNode.getElementsByTagNameNS(sNameSpaceURI, sLocalName);
          -};
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cDynamicContext(oStaticContext, vItem, oScope, oDOMAdapter) {
          -	//
          -	this.staticContext	= oStaticContext;
          -	//
          -	this.item		= vItem;
          -	//
          -	this.scope		= oScope || {};
          -	this.stack		= {};
          -	//
          -	this.DOMAdapter	= oDOMAdapter || new cDOMAdapter;
          -	//
          -	var oDate	= new cDate,
          -		nOffset	= oDate.getTimezoneOffset();
          -	this.dateTime	= new cXSDateTime(oDate.getFullYear(), oDate.getMonth() + 1, oDate.getDate(), oDate.getHours(), oDate.getMinutes(), oDate.getSeconds() + oDate.getMilliseconds() / 1000, -nOffset);
          -	this.timezone	= new cXSDayTimeDuration(0, cMath.abs(~~(nOffset / 60)), cMath.abs(nOffset % 60), 0, nOffset > 0);
          -};
          -
          -cDynamicContext.prototype.item		= null;
          -cDynamicContext.prototype.position	= 0;
          -cDynamicContext.prototype.size		= 0;
          -//
          -cDynamicContext.prototype.scope		= null;
          -cDynamicContext.prototype.stack		= null;	// Variables stack
          -//
          -cDynamicContext.prototype.dateTime	= null;
          -cDynamicContext.prototype.timezone	= null;
          -//
          -cDynamicContext.prototype.staticContext	= null;
          -
          -// Stack management
          -cDynamicContext.prototype.pushVariable	= function(sName, vValue) {
          -	if (!this.stack.hasOwnProperty(sName))
          -		this.stack[sName]	= [];
          -	this.stack[sName].push(this.scope[sName]);
          -	this.scope[sName] = vValue;
          -};
          -
          -cDynamicContext.prototype.popVariable	= function(sName) {
          -	if (this.stack.hasOwnProperty(sName)) {
          -		this.scope[sName] = this.stack[sName].pop();
          -		if (!this.stack[sName].length) {
          -			delete this.stack[sName];
          -			if (typeof this.scope[sName] == "undefined")
          -				delete this.scope[sName];
          -		}
          -	}
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cStaticContext() {
          -	this.dataTypes	= {};
          -	this.documents	= {};
          -	this.functions	= {};
          -	this.collations	= {};
          -	this.collections= {};
          -};
          -
          -cStaticContext.prototype.baseURI	= null;
          -//
          -cStaticContext.prototype.dataTypes	= null;
          -cStaticContext.prototype.documents	= null;
          -//
          -cStaticContext.prototype.functions	= null;
          -cStaticContext.prototype.defaultFunctionNamespace	= null;
          -//
          -cStaticContext.prototype.collations	= null;
          -cStaticContext.prototype.defaultCollationName		= sNS_XPF + "/collation/codepoint";
          -//
          -cStaticContext.prototype.collections	= null;
          -//
          -cStaticContext.prototype.namespaceResolver	= null;
          -cStaticContext.prototype.defaultElementNamespace	= null;
          -
          -//
          -var rStaticContext_uri	= /^(?:\{([^\}]+)\})?(.+)$/;
          -//
          -cStaticContext.prototype.setDataType		= function(sUri, fFunction) {
          -	var aMatch	= sUri.match(rStaticContext_uri);
          -	if (aMatch)
          -		if (aMatch[1] != sNS_XSD)
          -			this.dataTypes[sUri]	= fFunction;
          -};
          -
          -cStaticContext.prototype.getDataType		= function(sUri) {
          -	var aMatch	= sUri.match(rStaticContext_uri);
          -	if (aMatch)
          -		return aMatch[1] == sNS_XSD ? hStaticContext_dataTypes[aMatch[2]] : this.dataTypes[sUri];
          -};
          -
          -cStaticContext.prototype.setDocument		= function(sUri, fFunction) {
          -	this.documents[sUri]	= fFunction;
          -};
          -
          -cStaticContext.prototype.getDocument		= function(sUri) {
          -	return this.documents[sUri];
          -};
          -
          -cStaticContext.prototype.setFunction		= function(sUri, fFunction) {
          -	var aMatch	= sUri.match(rStaticContext_uri);
          -	if (aMatch)
          -		if (aMatch[1] != sNS_XPF)
          -			this.functions[sUri]	= fFunction;
          -};
          -
          -cStaticContext.prototype.getFunction		= function(sUri) {
          -	var aMatch	= sUri.match(rStaticContext_uri);
          -	if (aMatch)
          -		return aMatch[1] == sNS_XPF ? hStaticContext_functions[aMatch[2]] : this.functions[sUri];
          -};
          -
          -cStaticContext.prototype.setCollation		= function(sUri, fFunction) {
          -	this.collations[sUri]	= fFunction;
          -};
          -
          -cStaticContext.prototype.getCollation		= function(sUri) {
          -	return this.collations[sUri];
          -};
          -
          -cStaticContext.prototype.setCollection	= function(sUri, fFunction) {
          -	this.collections[sUri]	= fFunction;
          -};
          -
          -cStaticContext.prototype.getCollection	= function(sUri) {
          -	return this.collections[sUri];
          -};
          -
          -cStaticContext.prototype.getURIForPrefix	= function(sPrefix) {
          -	var oResolver	= this.namespaceResolver,
          -		fResolver	= oResolver && oResolver.lookupNamespaceURI ? oResolver.lookupNamespaceURI : oResolver,
          -		sNameSpaceURI;
          -	if (fResolver instanceof cFunction && (sNameSpaceURI = fResolver.call(oResolver, sPrefix)))
          -		return sNameSpaceURI;
          -	if (sPrefix == 'fn')
          -		return sNS_XPF;
          -	if (sPrefix == 'xs')
          -		return sNS_XSD;
          -	if (sPrefix == "xml")
          -		return sNS_XML;
          -	if (sPrefix == "xmlns")
          -		return sNS_XNS;
          -	//
          -	throw new cException("XPST0081"
          -
          -	);
          -};
          -
          -// Static members
          -//Converts non-null JavaScript object to XML Schema object
          -cStaticContext.js2xs	= function(vItem) {
          -	// Convert types from JavaScript to XPath 2.0
          -	if (typeof vItem == "boolean")
          -		vItem	= new cXSBoolean(vItem);
          -	else
          -	if (typeof vItem == "number")
          -		vItem	=(fIsNaN(vItem) ||!fIsFinite(vItem)) ? new cXSDouble(vItem) : fNumericLiteral_parseValue(cString(vItem));
          -	else
          -		vItem	= new cXSString(cString(vItem));
          -	//
          -	return vItem;
          -};
          -
          -// Converts non-null XML Schema object to JavaScript object
          -cStaticContext.xs2js	= function(vItem) {
          -	if (vItem instanceof cXSBoolean)
          -		vItem	= vItem.valueOf();
          -	else
          -	if (fXSAnyAtomicType_isNumeric(vItem))
          -		vItem	= vItem.valueOf();
          -	else
          -		vItem	= vItem.toString();
          -	//
          -	return vItem;
          -};
          -
          -// System functions with signatures, operators and types
          -var hStaticContext_functions	= {},
          -	hStaticContext_signatures	= {},
          -	hStaticContext_dataTypes	= {},
          -	hStaticContext_operators	= {};
          -
          -function fStaticContext_defineSystemFunction(sName, aParameters, fFunction) {
          -	// Register function
          -	hStaticContext_functions[sName]	= fFunction;
          -	// Register signature
          -	hStaticContext_signatures[sName]	= aParameters;
          -};
          -
          -function fStaticContext_defineSystemDataType(sName, fFunction) {
          -	// Register dataType
          -	hStaticContext_dataTypes[sName]	= fFunction;
          -};
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cExpression(sExpression, oStaticContext) {
          -	var oLexer	= new cLexer(sExpression),
          -		oExpr	= fExpr_parse(oLexer, oStaticContext);
          -	//
          -	if (!oLexer.eof())
          -		throw new cException("XPST0003"
          -
          -		);
          -	//
          -	if (!oExpr)
          -		throw new cException("XPST0003"
          -
          -		);
          -	this.internalExpression	= oExpr;
          -};
          -
          -cExpression.prototype.internalExpression	= null;
          -
          -// Public methods
          -cExpression.prototype.evaluate	= function(oContext) {
          -	return this.internalExpression.evaluate(oContext);
          -};
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cStringCollator() {
          -
          -};
          -
          -cStringCollator.prototype.equals	= function(sValue1, sValue2) {
          -	throw "Not implemented";
          -};
          -
          -cStringCollator.prototype.compare	= function(sValue1, sValue2) {
          -	throw "Not implemented";
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSConstants(){};
          -
          -// XML Schema 1.0 Datatypes
          -cXSConstants.ANYSIMPLETYPE_DT		= 1;
          -cXSConstants.STRING_DT				= 2;
          -cXSConstants.BOOLEAN_DT				= 3;
          -cXSConstants.DECIMAL_DT				= 4;
          -cXSConstants.FLOAT_DT				= 5;
          -cXSConstants.DOUBLE_DT				= 6;
          -cXSConstants.DURATION_DT			= 7;
          -cXSConstants.DATETIME_DT			= 8;
          -cXSConstants.TIME_DT				= 9;
          -cXSConstants.DATE_DT				= 10;
          -cXSConstants.GYEARMONTH_DT			= 11;
          -cXSConstants.GYEAR_DT				= 12;
          -cXSConstants.GMONTHDAY_DT			= 13;
          -cXSConstants.GDAY_DT				= 14;
          -cXSConstants.GMONTH_DT				= 15;
          -cXSConstants.HEXBINARY_DT			= 16;
          -cXSConstants.BASE64BINARY_DT		= 17;
          -cXSConstants.ANYURI_DT				= 18;
          -cXSConstants.QNAME_DT				= 19;
          -cXSConstants.NOTATION_DT			= 20;
          -cXSConstants.NORMALIZEDSTRING_DT	= 21;
          -cXSConstants.TOKEN_DT				= 22;
          -cXSConstants.LANGUAGE_DT			= 23;
          -cXSConstants.NMTOKEN_DT				= 24;
          -cXSConstants.NAME_DT				= 25;
          -cXSConstants.NCNAME_DT				= 26;
          -cXSConstants.ID_DT					= 27;
          -cXSConstants.IDREF_DT				= 28;
          -cXSConstants.ENTITY_DT				= 29;
          -cXSConstants.INTEGER_DT				= 30;
          -cXSConstants.NONPOSITIVEINTEGER_DT	= 31;
          -cXSConstants.NEGATIVEINTEGER_DT		= 32;
          -cXSConstants.LONG_DT				= 33;
          -cXSConstants.INT_DT					= 34;
          -cXSConstants.SHORT_DT				= 35;
          -cXSConstants.BYTE_DT				= 36;
          -cXSConstants.NONNEGATIVEINTEGER_DT	= 37;
          -cXSConstants.UNSIGNEDLONG_DT		= 38;
          -cXSConstants.UNSIGNEDINT_DT			= 39;
          -cXSConstants.UNSIGNEDSHORT_DT		= 40;
          -cXSConstants.UNSIGNEDBYTE_DT		= 41;
          -cXSConstants.POSITIVEINTEGER_DT		= 42;
          -cXSConstants.LISTOFUNION_DT			= 43;
          -cXSConstants.LIST_DT				= 44;
          -cXSConstants.UNAVAILABLE_DT			= 45;
          -
          -// XML Schema 1.1 Datatypes
          -cXSConstants.DATETIMESTAMP_DT		= 46;
          -cXSConstants.DAYMONTHDURATION_DT	= 47;
          -cXSConstants.DAYTIMEDURATION_DT		= 48;
          -cXSConstants.PRECISIONDECIMAL_DT	= 49;
          -cXSConstants.ANYATOMICTYPE_DT		= 50;
          -cXSConstants.ANYTYPE_DT				= 51;
          -
          -//
          -cXSConstants.XT_YEARMONTHDURATION_DT=-1;
          -cXSConstants.XT_UNTYPEDATOMIC_DT	=-2;
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cExpr() {
          -	this.items	= [];
          -};
          -
          -cExpr.prototype.items	= null;
          -
          -// Static members
          -function fExpr_parse (oLexer, oStaticContext) {
          -	var oItem;
          -	if (oLexer.eof() ||!(oItem = fExprSingle_parse(oLexer, oStaticContext)))
          -		return;
          -
          -	// Create expression
          -	var oExpr	= new cExpr;
          -	oExpr.items.push(oItem);
          -	while (oLexer.peek() == ',') {
          -		oLexer.next();
          -		if (oLexer.eof() ||!(oItem = fExprSingle_parse(oLexer, oStaticContext)))
          -			throw new cException("XPST0003"
          -
          -			);
          -		oExpr.items.push(oItem);
          -	}
          -	return oExpr;
          -};
          -
          -// Public members
          -cExpr.prototype.evaluate	= function(oContext) {
          -	var oSequence	= [];
          -	for (var nIndex = 0, nLength = this.items.length; nIndex < nLength; nIndex++)
          -		oSequence	= hStaticContext_operators["concatenate"].call(oContext, oSequence, this.items[nIndex].evaluate(oContext));
          -	return oSequence;
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cExprSingle() {
          -
          -};
          -
          -// Static members
          -function fExprSingle_parse (oLexer, oStaticContext) {
          -	if (!oLexer.eof())
          -		return fIfExpr_parse(oLexer, oStaticContext)
          -			|| fForExpr_parse(oLexer, oStaticContext)
          -			|| fQuantifiedExpr_parse(oLexer, oStaticContext)
          -			|| fOrExpr_parse(oLexer, oStaticContext);
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cForExpr() {
          -	this.bindings	= [];
          -	this.returnExpr	= null;
          -};
          -
          -cForExpr.prototype.bindings		= null;
          -cForExpr.prototype.returnExpr	= null;
          -
          -// Static members
          -function fForExpr_parse (oLexer, oStaticContext) {
          -	if (oLexer.peek() == "for" && oLexer.peek(1).substr(0, 1) == '$') {
          -		oLexer.next();
          -
          -		var oForExpr	= new cForExpr,
          -			oExpr;
          -		do {
          -			oForExpr.bindings.push(fSimpleForBinding_parse(oLexer, oStaticContext));
          -		}
          -		while (oLexer.peek() == ',' && oLexer.next());
          -
          -		if (oLexer.peek() != "return")
          -			throw new cException("XPST0003"
          -
          -			);
          -
          -		oLexer.next();
          -		if (oLexer.eof() ||!(oExpr = fExprSingle_parse(oLexer, oStaticContext)))
          -			throw new cException("XPST0003"
          -
          -			);
          -
          -		oForExpr.returnExpr	= oExpr;
          -		return oForExpr;
          -	}
          -};
          -
          -// Public members
          -// for $x in X, $y in Y, $z in Z return $x + $y + $z
          -// for $x in X return for $y in Y return for $z in Z return $x + $y + $z
          -cForExpr.prototype.evaluate	= function (oContext) {
          -	var oSequence	= [];
          -	(function(oSelf, nBinding) {
          -		var oBinding	= oSelf.bindings[nBinding++],
          -			oSequence1	= oBinding.inExpr.evaluate(oContext),
          -			sUri	= (oBinding.namespaceURI ? '{' + oBinding.namespaceURI + '}' : '') + oBinding.localName;
          -		for (var nIndex = 0, nLength = oSequence1.length; nIndex < nLength; nIndex++) {
          -			oContext.pushVariable(sUri, oSequence1[nIndex]);
          -			if (nBinding < oSelf.bindings.length)
          -				arguments.callee(oSelf, nBinding);
          -			else
          -				oSequence	= oSequence.concat(oSelf.returnExpr.evaluate(oContext));
          -			oContext.popVariable(sUri);
          -		}
          -	})(this, 0);
          -
          -	return oSequence;
          -};
          -
          -//
          -function cSimpleForBinding(sPrefix, sLocalName, sNameSpaceURI, oInExpr) {
          -	this.prefix			= sPrefix;
          -	this.localName		= sLocalName;
          -	this.namespaceURI	= sNameSpaceURI;
          -	this.inExpr		= oInExpr;
          -};
          -
          -cSimpleForBinding.prototype.prefix			= null;
          -cSimpleForBinding.prototype.localName		= null;
          -cSimpleForBinding.prototype.namespaceURI	= null;
          -cSimpleForBinding.prototype.inExpr		= null;
          -
          -function fSimpleForBinding_parse (oLexer, oStaticContext) {
          -	var aMatch	= oLexer.peek().substr(1).match(rNameTest);
          -	if (!aMatch)
          -		throw new cException("XPST0003"
          -
          -		);
          -
          -	if (aMatch[1] == '*' || aMatch[2] == '*')
          -		throw new cException("XPST0003"
          -
          -		);
          -
          -	oLexer.next();
          -	if (oLexer.peek() != "in")
          -		throw new cException("XPST0003"
          -
          -		);
          -
          -	oLexer.next();
          -	var oExpr;
          -	if (oLexer.eof() ||!(oExpr = fExprSingle_parse(oLexer, oStaticContext)))
          -		throw new cException("XPST0003"
          -
          -		);
          -
          -	return new cSimpleForBinding(aMatch[1] || null, aMatch[2], aMatch[1] ? oStaticContext.getURIForPrefix(aMatch[1]) : null, oExpr);
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cIfExpr(oCondExpr, oThenExpr, oElseExpr) {
          -	this.condExpr	= oCondExpr;
          -	this.thenExpr		= oThenExpr;
          -	this.elseExpr		= oElseExpr;
          -};
          -
          -cIfExpr.prototype.condExpr	= null;
          -cIfExpr.prototype.thenExpr	= null;
          -cIfExpr.prototype.elseExpr	= null;
          -
          -// Static members
          -function fIfExpr_parse (oLexer, oStaticContext) {
          -	var oCondExpr,
          -		oThenExpr,
          -		oElseExpr;
          -	if (oLexer.peek() == "if" && oLexer.peek(1) == '(') {
          -		oLexer.next(2);
          -		//
          -		if (oLexer.eof() ||!(oCondExpr = fExpr_parse(oLexer, oStaticContext)))
          -			throw new cException("XPST0003"
          -
          -			);
          -		//
          -		if (oLexer.peek() != ')')
          -			throw new cException("XPST0003"
          -
          -			);
          -
          -		oLexer.next();
          -		if (oLexer.peek() != "then")
          -			throw new cException("XPST0003"
          -
          -			);
          -
          -		oLexer.next();
          -		if (oLexer.eof() ||!(oThenExpr = fExprSingle_parse(oLexer, oStaticContext)))
          -			throw new cException("XPST0003"
          -
          -			);
          -
          -		if (oLexer.peek() != "else")
          -			throw new cException("XPST0003"
          -
          -			);
          -
          -		oLexer.next();
          -		if (oLexer.eof() ||!(oElseExpr = fExprSingle_parse(oLexer, oStaticContext)))
          -			throw new cException("XPST0003"
          -
          -			);
          -		//
          -		return new cIfExpr(oCondExpr, oThenExpr, oElseExpr);
          -	}
          -};
          -
          -// Public members
          -cIfExpr.prototype.evaluate	= function (oContext) {
          -	return this[fFunction_sequence_toEBV(this.condExpr.evaluate(oContext), oContext) ? "thenExpr" : "elseExpr"].evaluate(oContext);
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cQuantifiedExpr(sQuantifier) {
          -	this.quantifier		= sQuantifier;
          -	this.bindings		= [];
          -	this.satisfiesExpr	= null;
          -};
          -
          -cQuantifiedExpr.prototype.bindings		= null;
          -cQuantifiedExpr.prototype.quantifier	= null;
          -cQuantifiedExpr.prototype.satisfiesExpr	= null;
          -
          -// Static members
          -function fQuantifiedExpr_parse (oLexer, oStaticContext) {
          -	var sQuantifier	= oLexer.peek();
          -	if ((sQuantifier == "some" || sQuantifier == "every") && oLexer.peek(1).substr(0, 1) == '$') {
          -		oLexer.next();
          -
          -		var oQuantifiedExpr	= new cQuantifiedExpr(sQuantifier),
          -			oExpr;
          -		do {
          -			oQuantifiedExpr.bindings.push(fSimpleQuantifiedBinding_parse(oLexer, oStaticContext));
          -		}
          -		while (oLexer.peek() == ',' && oLexer.next());
          -
          -		if (oLexer.peek() != "satisfies")
          -			throw new cException("XPST0003"
          -
          -			);
          -
          -		oLexer.next();
          -		if (oLexer.eof() ||!(oExpr = fExprSingle_parse(oLexer, oStaticContext)))
          -			throw new cException("XPST0003"
          -
          -			);
          -
          -		oQuantifiedExpr.satisfiesExpr	= oExpr;
          -		return oQuantifiedExpr;
          -	}
          -};
          -
          -// Public members
          -cQuantifiedExpr.prototype.evaluate	= function (oContext) {
          -	// TODO: re-factor
          -	var bEvery	= this.quantifier == "every",
          -		bResult	= bEvery ? true : false;
          -	(function(oSelf, nBinding) {
          -		var oBinding	= oSelf.bindings[nBinding++],
          -			oSequence1	= oBinding.inExpr.evaluate(oContext),
          -			sUri	= (oBinding.namespaceURI ? '{' + oBinding.namespaceURI + '}' : '') + oBinding.localName;
          -		for (var nIndex = 0, nLength = oSequence1.length; (nIndex < nLength) && (bEvery ? bResult :!bResult); nIndex++) {
          -			oContext.pushVariable(sUri, oSequence1[nIndex]);
          -			if (nBinding < oSelf.bindings.length)
          -				arguments.callee(oSelf, nBinding);
          -			else
          -				bResult	= fFunction_sequence_toEBV(oSelf.satisfiesExpr.evaluate(oContext), oContext);
          -			oContext.popVariable(sUri);
          -		}
          -	})(this, 0);
          -
          -	return [new cXSBoolean(bResult)];
          -};
          -
          -
          -
          -//
          -function cSimpleQuantifiedBinding(sPrefix, sLocalName, sNameSpaceURI, oInExpr) {
          -	this.prefix			= sPrefix;
          -	this.localName		= sLocalName;
          -	this.namespaceURI	= sNameSpaceURI;
          -	this.inExpr		= oInExpr;
          -};
          -
          -cSimpleQuantifiedBinding.prototype.prefix		= null;
          -cSimpleQuantifiedBinding.prototype.localName	= null;
          -cSimpleQuantifiedBinding.prototype.namespaceURI	= null;
          -cSimpleQuantifiedBinding.prototype.inExpr	= null;
          -
          -function fSimpleQuantifiedBinding_parse (oLexer, oStaticContext) {
          -	var aMatch	= oLexer.peek().substr(1).match(rNameTest);
          -	if (!aMatch)
          -		throw new cException("XPST0003"
          -
          -		);
          -
          -	if (aMatch[1] == '*' || aMatch[2] == '*')
          -		throw new cException("XPST0003"
          -
          -		);
          -
          -	oLexer.next();
          -	if (oLexer.peek() != "in")
          -		throw new cException("XPST0003"
          -
          -		);
          -
          -	oLexer.next();
          -	var oExpr;
          -	if (oLexer.eof() ||!(oExpr = fExprSingle_parse(oLexer, oStaticContext)))
          -		throw new cException("XPST0003"
          -
          -		);
          -
          -	return new cSimpleQuantifiedBinding(aMatch[1] || null, aMatch[2], aMatch[1] ? oStaticContext.getURIForPrefix(aMatch[1]) : null, oExpr);
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cComparisonExpr(oLeft, oRight, sOperator) {
          -	this.left	= oLeft;
          -	this.right	= oRight;
          -	this.operator	= sOperator;
          -};
          -
          -cComparisonExpr.prototype.left	= null;
          -cComparisonExpr.prototype.right	= null;
          -cComparisonExpr.prototype.operator	= null;
          -
          -// Static members
          -function fComparisonExpr_parse (oLexer, oStaticContext) {
          -	var oExpr,
          -		oRight;
          -	if (oLexer.eof() ||!(oExpr = fRangeExpr_parse(oLexer, oStaticContext)))
          -		return;
          -	if (!(oLexer.peek() in hComparisonExpr_operators))
          -		return oExpr;
          -
          -	// Comparison expression
          -	var sOperator	= oLexer.peek();
          -	oLexer.next();
          -	if (oLexer.eof() ||!(oRight = fRangeExpr_parse(oLexer, oStaticContext)))
          -		throw new cException("XPST0003"
          -
          -		);
          -	return new cComparisonExpr(oExpr, oRight, sOperator);
          -};
          -
          -// Public members
          -cComparisonExpr.prototype.evaluate	= function (oContext) {
          -	var oResult	= hComparisonExpr_operators[this.operator](this, oContext);
          -	return oResult == null ? [] : [oResult];
          -};
          -
          -// General comparison
          -function fComparisonExpr_GeneralComp(oExpr, oContext) {
          -	var oLeft	= fFunction_sequence_atomize(oExpr.left.evaluate(oContext), oContext);
          -	if (!oLeft.length)
          -		return new cXSBoolean(false);
          -
          -	var oRight	= fFunction_sequence_atomize(oExpr.right.evaluate(oContext), oContext);
          -	if (!oRight.length)
          -		return new cXSBoolean(false);
          -
          -	var bResult	= false;
          -	for (var nLeftIndex = 0, nLeftLength = oLeft.length, bLeft, vLeft; (nLeftIndex < nLeftLength) &&!bResult; nLeftIndex++) {
          -		for (var nRightIndex = 0, nRightLength = oRight.length, bRight, vRight; (nRightIndex < nRightLength) &&!bResult; nRightIndex++) {
          -
          -			vLeft	= oLeft[nLeftIndex];
          -			vRight	= oRight[nRightIndex];
          -
          -			bLeft	= vLeft instanceof cXSUntypedAtomic;
          -			bRight	= vRight instanceof cXSUntypedAtomic;
          -
          -			if (bLeft && bRight) {
          -				// cast xs:untypedAtomic to xs:string
          -				vLeft	= cXSString.cast(vLeft);
          -				vRight	= cXSString.cast(vRight);
          -			}
          -			else {
          -				//
          -				if (bLeft) {
          -					// Special: durations
          -					if (vRight instanceof cXSDayTimeDuration)
          -						vLeft	= cXSDayTimeDuration.cast(vLeft);
          -					else
          -					if (vRight instanceof cXSYearMonthDuration)
          -						vLeft	= cXSYearMonthDuration.cast(vLeft);
          -					else
          -					//
          -					if (vRight.primitiveKind)
          -						vLeft	= hStaticContext_dataTypes[vRight.primitiveKind].cast(vLeft);
          -				}
          -				else
          -				if (bRight) {
          -					// Special: durations
          -					if (vLeft instanceof cXSDayTimeDuration)
          -						vRight	= cXSDayTimeDuration.cast(vRight);
          -					else
          -					if (vLeft instanceof cXSYearMonthDuration)
          -						vRight	= cXSYearMonthDuration.cast(vRight);
          -					else
          -					//
          -					if (vLeft.primitiveKind)
          -						vRight	= hStaticContext_dataTypes[vLeft.primitiveKind].cast(vRight);
          -				}
          -
          -				// cast xs:anyURI to xs:string
          -				if (vLeft instanceof cXSAnyURI)
          -					vLeft	= cXSString.cast(vLeft);
          -				if (vRight instanceof cXSAnyURI)
          -					vRight	= cXSString.cast(vRight);
          -			}
          -
          -			bResult	= hComparisonExpr_ValueComp_operators[hComparisonExpr_GeneralComp_map[oExpr.operator]](vLeft, vRight, oContext).valueOf();
          -		}
          -	}
          -	return new cXSBoolean(bResult);
          -};
          -
          -var hComparisonExpr_GeneralComp_map	= {
          -	'=':	'eq',
          -	'!=':	'ne',
          -	'>':	'gt',
          -	'<':	'lt',
          -	'>=':	'ge',
          -	'<=':	'le'
          -};
          -
          -// Value comparison
          -function fComparisonExpr_ValueComp(oExpr, oContext) {
          -	var oLeft	= fFunction_sequence_atomize(oExpr.left.evaluate(oContext), oContext);
          -	if (!oLeft.length)
          -		return null;
          -	// Assert cardinality
          -	fFunctionCall_assertSequenceCardinality(oContext, oLeft, '?'
          -
          -	);
          -
          -	var oRight	= fFunction_sequence_atomize(oExpr.right.evaluate(oContext), oContext);
          -	if (!oRight.length)
          -		return null;
          -	// Assert cardinality
          -	fFunctionCall_assertSequenceCardinality(oContext, oRight, '?'
          -
          -	);
          -
          -	var vLeft	= oLeft[0],
          -		vRight	= oRight[0];
          -
          -	// cast xs:untypedAtomic to xs:string
          -	if (vLeft instanceof cXSUntypedAtomic)
          -		vLeft	= cXSString.cast(vLeft);
          -	if (vRight instanceof cXSUntypedAtomic)
          -		vRight	= cXSString.cast(vRight);
          -
          -	// cast xs:anyURI to xs:string
          -	if (vLeft instanceof cXSAnyURI)
          -		vLeft	= cXSString.cast(vLeft);
          -	if (vRight instanceof cXSAnyURI)
          -		vRight	= cXSString.cast(vRight);
          -
          -	//
          -	return hComparisonExpr_ValueComp_operators[oExpr.operator](vLeft, vRight, oContext);
          -};
          -
          -//
          -var hComparisonExpr_ValueComp_operators	= {};
          -hComparisonExpr_ValueComp_operators['eq']	= function(oLeft, oRight, oContext) {
          -	var sOperator	= '';
          -
          -	if (fXSAnyAtomicType_isNumeric(oLeft)) {
          -		if (fXSAnyAtomicType_isNumeric(oRight))
          -			sOperator	= "numeric-equal";
          -	}
          -	else
          -	if (oLeft instanceof cXSBoolean) {
          -		if (oRight instanceof cXSBoolean)
          -			sOperator	= "boolean-equal";
          -	}
          -	else
          -	if (oLeft instanceof cXSString) {
          -		if (oRight instanceof cXSString)
          -			return hStaticContext_operators["numeric-equal"].call(oContext, hStaticContext_functions["compare"].call(oContext, oLeft, oRight), new cXSInteger(0));
          -	}
          -	else
          -	if (oLeft instanceof cXSDate) {
          -		if (oRight instanceof cXSDate)
          -			sOperator	= "date-equal";
          -	}
          -	else
          -	if (oLeft instanceof cXSTime) {
          -		if (oRight instanceof cXSTime)
          -			sOperator	= "time-equal";
          -	}
          -	else
          -	if (oLeft instanceof cXSDateTime) {
          -		if (oRight instanceof cXSDateTime)
          -			sOperator	= "dateTime-equal";
          -	}
          -	else
          -	if (oLeft instanceof cXSDuration) {
          -		if (oRight instanceof cXSDuration)
          -			sOperator	= "duration-equal";
          -	}
          -	else
          -	if (oLeft instanceof cXSGYearMonth) {
          -		if (oRight instanceof cXSGYearMonth)
          -			sOperator	= "gYearMonth-equal";
          -	}
          -	else
          -	if (oLeft instanceof cXSGYear) {
          -		if (oRight instanceof cXSGYear)
          -			sOperator	= "gYear-equal";
          -	}
          -	else
          -	if (oLeft instanceof cXSGMonthDay) {
          -		if (oRight instanceof cXSGMonthDay)
          -			sOperator	= "gMonthDay-equal";
          -	}
          -	else
          -	if (oLeft instanceof cXSGMonth) {
          -		if (oRight instanceof cXSGMonth)
          -			sOperator	= "gMonth-equal";
          -	}
          -	else
          -	if (oLeft instanceof cXSGDay) {
          -		if (oRight instanceof cXSGDay)
          -			sOperator	= "gDay-equal";
          -	}
          -	// skipped: xs:anyURI (covered by xs:string)
          -	else
          -	if (oLeft instanceof cXSQName) {
          -		if (oRight instanceof cXSQName)
          -			sOperator	= "QName-equal";
          -	}
          -	else
          -	if (oLeft instanceof cXSHexBinary) {
          -		if (oRight instanceof cXSHexBinary)
          -			sOperator	= "hexBinary-equal";
          -	}
          -	else
          -	if (oLeft instanceof cXSBase64Binary) {
          -		if (oRight instanceof cXSBase64Binary)
          -			sOperator	= "base64Binary-equal";
          -	}
          -
          -	// Call operator function
          -	if (sOperator)
          -		return hStaticContext_operators[sOperator].call(oContext, oLeft, oRight);
          -
          -	// skipped: xs:NOTATION
          -	throw new cException("XPTY0004"
          -
          -	);	// Cannot compare {type1} to {type2}
          -};
          -hComparisonExpr_ValueComp_operators['ne']	= function(oLeft, oRight, oContext) {
          -	return new cXSBoolean(!hComparisonExpr_ValueComp_operators['eq'](oLeft, oRight, oContext).valueOf());
          -};
          -hComparisonExpr_ValueComp_operators['gt']	= function(oLeft, oRight, oContext) {
          -	var sOperator	= '';
          -
          -	if (fXSAnyAtomicType_isNumeric(oLeft)) {
          -		if (fXSAnyAtomicType_isNumeric(oRight))
          -			sOperator	= "numeric-greater-than";
          -	}
          -	else
          -	if (oLeft instanceof cXSBoolean) {
          -		if (oRight instanceof cXSBoolean)
          -			sOperator	= "boolean-greater-than";
          -	}
          -	else
          -	if (oLeft instanceof cXSString) {
          -		if (oRight instanceof cXSString)
          -			return hStaticContext_operators["numeric-greater-than"].call(oContext, hStaticContext_functions["compare"].call(oContext, oLeft, oRight), new cXSInteger(0));
          -	}
          -	else
          -	if (oLeft instanceof cXSDate) {
          -		if (oRight instanceof cXSDate)
          -			sOperator	= "date-greater-than";
          -	}
          -	else
          -	if (oLeft instanceof cXSTime) {
          -		if (oRight instanceof cXSTime)
          -			sOperator	= "time-greater-than";
          -	}
          -	else
          -	if (oLeft instanceof cXSDateTime) {
          -		if (oRight instanceof cXSDateTime)
          -			sOperator	= "dateTime-greater-than";
          -	}
          -	else
          -	if (oLeft instanceof cXSYearMonthDuration) {
          -		if (oRight instanceof cXSYearMonthDuration)
          -			sOperator	= "yearMonthDuration-greater-than";
          -	}
          -	else
          -	if (oLeft instanceof cXSDayTimeDuration) {
          -		if (oRight instanceof cXSDayTimeDuration)
          -			sOperator	= "dayTimeDuration-greater-than";
          -	}
          -
          -	// Call operator function
          -	if (sOperator)
          -		return hStaticContext_operators[sOperator].call(oContext, oLeft, oRight);
          -
          -	// skipped: xs:anyURI (covered by xs:string)
          -	throw new cException("XPTY0004"
          -
          -	);	// Cannot compare {type1} to {type2}
          -};
          -hComparisonExpr_ValueComp_operators['lt']	= function(oLeft, oRight, oContext) {
          -	var sOperator	= '';
          -
          -	if (fXSAnyAtomicType_isNumeric(oLeft)) {
          -		if (fXSAnyAtomicType_isNumeric(oRight))
          -			sOperator	= "numeric-less-than";
          -	}
          -	else
          -	if (oLeft instanceof cXSBoolean) {
          -		if (oRight instanceof cXSBoolean)
          -			sOperator	= "boolean-less-than";
          -	}
          -	else
          -	if (oLeft instanceof cXSString) {
          -		if (oRight instanceof cXSString)
          -			return hStaticContext_operators["numeric-less-than"].call(oContext, hStaticContext_functions["compare"].call(oContext, oLeft, oRight), new cXSInteger(0));
          -	}
          -	else
          -	if (oLeft instanceof cXSDate) {
          -		if (oRight instanceof cXSDate)
          -			sOperator	= "date-less-than";
          -	}
          -	else
          -	if (oLeft instanceof cXSTime) {
          -		if (oRight instanceof cXSTime)
          -			sOperator	= "time-less-than";
          -	}
          -	else
          -	if (oLeft instanceof cXSDateTime) {
          -		if (oRight instanceof cXSDateTime)
          -			sOperator	= "dateTime-less-than";
          -	}
          -	else
          -	if (oLeft instanceof cXSYearMonthDuration) {
          -		if (oRight instanceof cXSYearMonthDuration)
          -			sOperator	= "yearMonthDuration-less-than";
          -	}
          -	else
          -	if (oLeft instanceof cXSDayTimeDuration) {
          -		if (oRight instanceof cXSDayTimeDuration)
          -			sOperator	= "dayTimeDuration-less-than";
          -	}
          -
          -	// Call operator function
          -	if (sOperator)
          -		return hStaticContext_operators[sOperator].call(oContext, oLeft, oRight);
          -
          -	// skipped: xs:anyURI (covered by xs:string)
          -	throw new cException("XPTY0004"
          -
          -	);	// Cannot compare {type1} to {type2}
          -};
          -hComparisonExpr_ValueComp_operators['ge']	= function(oLeft, oRight, oContext) {
          -	var sOperator	= '';
          -
          -	if (fXSAnyAtomicType_isNumeric(oLeft)) {
          -		if (fXSAnyAtomicType_isNumeric(oRight))
          -			sOperator	= "numeric-less-than";
          -	}
          -	else
          -	if (oLeft instanceof cXSBoolean) {
          -		if (oRight instanceof cXSBoolean)
          -			sOperator	= "boolean-less-than";
          -	}
          -	else
          -	if (oLeft instanceof cXSString) {
          -		if (oRight instanceof cXSString)
          -			return hStaticContext_operators["numeric-greater-than"].call(oContext, hStaticContext_functions["compare"].call(oContext, oLeft, oRight), new cXSInteger(-1));
          -	}
          -	else
          -	if (oLeft instanceof cXSDate) {
          -		if (oRight instanceof cXSDate)
          -			sOperator	= "date-less-than";
          -	}
          -	else
          -	if (oLeft instanceof cXSTime) {
          -		if (oRight instanceof cXSTime)
          -			sOperator	= "time-less-than";
          -	}
          -	else
          -	if (oLeft instanceof cXSDateTime) {
          -		if (oRight instanceof cXSDateTime)
          -			sOperator	= "dateTime-less-than";
          -	}
          -	else
          -	if (oLeft instanceof cXSYearMonthDuration) {
          -		if (oRight instanceof cXSYearMonthDuration)
          -			sOperator	= "yearMonthDuration-less-than";
          -	}
          -	else
          -	if (oLeft instanceof cXSDayTimeDuration) {
          -		if (oRight instanceof cXSDayTimeDuration)
          -			sOperator	= "dayTimeDuration-less-than";
          -	}
          -
          -	// Call operator function
          -	if (sOperator)
          -		return new cXSBoolean(!hStaticContext_operators[sOperator].call(oContext, oLeft, oRight).valueOf());
          -
          -	// skipped: xs:anyURI (covered by xs:string)
          -	throw new cException("XPTY0004"
          -
          -	);	// Cannot compare {type1} to {type2}
          -};
          -hComparisonExpr_ValueComp_operators['le']	= function(oLeft, oRight, oContext) {
          -	var sOperator	= '';
          -
          -	if (fXSAnyAtomicType_isNumeric(oLeft)) {
          -		if (fXSAnyAtomicType_isNumeric(oRight))
          -			sOperator	= "numeric-greater-than";
          -	}
          -	else
          -	if (oLeft instanceof cXSBoolean) {
          -		if (oRight instanceof cXSBoolean)
          -			sOperator	= "boolean-greater-than";
          -	}
          -	else
          -	if (oLeft instanceof cXSString) {
          -		if (oRight instanceof cXSString)
          -			return hStaticContext_operators["numeric-less-than"].call(oContext, hStaticContext_functions["compare"].call(oContext, oLeft, oRight), new cXSInteger(1));
          -	}
          -	else
          -	if (oLeft instanceof cXSDate) {
          -		if (oRight instanceof cXSDate)
          -			sOperator	= "date-greater-than";
          -	}
          -	else
          -	if (oLeft instanceof cXSTime) {
          -		if (oRight instanceof cXSTime)
          -			sOperator	= "time-greater-than";
          -	}
          -	else
          -	if (oLeft instanceof cXSDateTime) {
          -		if (oRight instanceof cXSDateTime)
          -			sOperator	= "dateTime-greater-than";
          -	}
          -	else
          -	if (oLeft instanceof cXSYearMonthDuration) {
          -		if (oRight instanceof cXSYearMonthDuration)
          -			sOperator	= "yearMonthDuration-greater-than";
          -	}
          -	else
          -	if (oLeft instanceof cXSDayTimeDuration) {
          -		if (oRight instanceof cXSDayTimeDuration)
          -			sOperator	= "dayTimeDuration-greater-than";
          -	}
          -
          -	// Call operator function
          -	if (sOperator)
          -		return new cXSBoolean(!hStaticContext_operators[sOperator].call(oContext, oLeft, oRight).valueOf());
          -
          -	// skipped: xs:anyURI (covered by xs:string)
          -	throw new cException("XPTY0004"
          -
          -	);	// Cannot compare {type1} to {type2}
          -};
          -
          -// Node comparison
          -function fComparisonExpr_NodeComp(oExpr, oContext) {
          -	var oLeft	= oExpr.left.evaluate(oContext);
          -	if (!oLeft.length)
          -		return null;
          -	// Assert cardinality
          -	fFunctionCall_assertSequenceCardinality(oContext, oLeft, '?'
          -
          -	);
          -	// Assert item type
          -	fFunctionCall_assertSequenceItemType(oContext, oLeft, cXTNode
          -
          -	);
          -
          -	var oRight	= oExpr.right.evaluate(oContext);
          -	if (!oRight.length)
          -		return null;
          -	// Assert cardinality
          -	fFunctionCall_assertSequenceCardinality(oContext, oRight, '?'
          -
          -	);
          -	// Assert item type
          -	fFunctionCall_assertSequenceItemType(oContext, oRight, cXTNode
          -
          -	);
          -
          -	return hComparisonExpr_NodeComp_operators[oExpr.operator](oLeft[0], oRight[0], oContext);
          -};
          -
          -var hComparisonExpr_NodeComp_operators	= {};
          -hComparisonExpr_NodeComp_operators['is']	= function(oLeft, oRight, oContext) {
          -	return hStaticContext_operators["is-same-node"].call(oContext, oLeft, oRight);
          -};
          -hComparisonExpr_NodeComp_operators['>>']	= function(oLeft, oRight, oContext) {
          -	return hStaticContext_operators["node-after"].call(oContext, oLeft, oRight);
          -};
          -hComparisonExpr_NodeComp_operators['<<']	= function(oLeft, oRight, oContext) {
          -	return hStaticContext_operators["node-before"].call(oContext, oLeft, oRight);
          -};
          -
          -// Operators
          -var hComparisonExpr_operators	= {
          -	// GeneralComp
          -	'=':	fComparisonExpr_GeneralComp,
          -	'!=':	fComparisonExpr_GeneralComp,
          -	'<':	fComparisonExpr_GeneralComp,
          -	'<=':	fComparisonExpr_GeneralComp,
          -	'>':	fComparisonExpr_GeneralComp,
          -	'>=':	fComparisonExpr_GeneralComp,
          -	// ValueComp
          -	'eq':	fComparisonExpr_ValueComp,
          -	'ne':	fComparisonExpr_ValueComp,
          -	'lt':	fComparisonExpr_ValueComp,
          -	'le':	fComparisonExpr_ValueComp,
          -	'gt':	fComparisonExpr_ValueComp,
          -	'ge':	fComparisonExpr_ValueComp,
          -	// NodeComp
          -	'is':	fComparisonExpr_NodeComp,
          -	'>>':	fComparisonExpr_NodeComp,
          -	'<<':	fComparisonExpr_NodeComp
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cAdditiveExpr(oExpr) {
          -	this.left	= oExpr;
          -	this.items	= [];
          -};
          -
          -cAdditiveExpr.prototype.left	= null;
          -cAdditiveExpr.prototype.items	= null;
          -
          -//
          -var hAdditiveExpr_operators	= {};
          -hAdditiveExpr_operators['+']	= function(oLeft, oRight, oContext) {
          -	var sOperator	= '',
          -		bReverse	= false;
          -
          -	if (fXSAnyAtomicType_isNumeric(oLeft)) {
          -		if (fXSAnyAtomicType_isNumeric(oRight))
          -			sOperator	= "numeric-add";
          -	}
          -	else
          -	if (oLeft instanceof cXSDate) {
          -		if (oRight instanceof cXSYearMonthDuration)
          -			sOperator	= "add-yearMonthDuration-to-date";
          -		else
          -		if (oRight instanceof cXSDayTimeDuration)
          -			sOperator	= "add-dayTimeDuration-to-date";
          -	}
          -	else
          -	if (oLeft instanceof cXSYearMonthDuration) {
          -		if (oRight instanceof cXSDate) {
          -			sOperator	= "add-yearMonthDuration-to-date";
          -			bReverse	= true;
          -		}
          -		else
          -		if (oRight instanceof cXSDateTime) {
          -			sOperator	= "add-yearMonthDuration-to-dateTime";
          -			bReverse	= true;
          -		}
          -		else
          -		if (oRight instanceof cXSYearMonthDuration)
          -			sOperator	= "add-yearMonthDurations";
          -	}
          -	else
          -	if (oLeft instanceof cXSDayTimeDuration) {
          -		if (oRight instanceof cXSDate) {
          -			sOperator	= "add-dayTimeDuration-to-date";
          -			bReverse	= true;
          -		}
          -		else
          -		if (oRight instanceof cXSTime) {
          -			sOperator	= "add-dayTimeDuration-to-time";
          -			bReverse	= true;
          -		}
          -		else
          -		if (oRight instanceof cXSDateTime) {
          -			sOperator	= "add-dayTimeDuration-to-dateTime";
          -			bReverse	= true;
          -		}
          -		else
          -		if (oRight instanceof cXSDayTimeDuration)
          -			sOperator	= "add-dayTimeDurations";
          -	}
          -	else
          -	if (oLeft instanceof cXSTime) {
          -		if (oRight instanceof cXSDayTimeDuration)
          -			sOperator	= "add-dayTimeDuration-to-time";
          -	}
          -	else
          -	if (oLeft instanceof cXSDateTime) {
          -		if (oRight instanceof cXSYearMonthDuration)
          -			sOperator	= "add-yearMonthDuration-to-dateTime";
          -		else
          -		if (oRight instanceof cXSDayTimeDuration)
          -			sOperator	= "add-dayTimeDuration-to-dateTime";
          -	}
          -
          -	// Call operator function
          -	if (sOperator)
          -		return hStaticContext_operators[sOperator].call(oContext, bReverse ? oRight : oLeft, bReverse ? oLeft : oRight);
          -
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);	// Arithmetic operator is not defined for arguments of types ({type1}, {type2})
          -};
          -hAdditiveExpr_operators['-']	= function (oLeft, oRight, oContext) {
          -	var sOperator	= '';
          -
          -	if (fXSAnyAtomicType_isNumeric(oLeft)) {
          -		if (fXSAnyAtomicType_isNumeric(oRight))
          -			sOperator	= "numeric-subtract";
          -	}
          -	else
          -	if (oLeft instanceof cXSDate) {
          -		if (oRight instanceof cXSDate)
          -			sOperator	= "subtract-dates";
          -		else
          -		if (oRight instanceof cXSYearMonthDuration)
          -			sOperator	= "subtract-yearMonthDuration-from-date";
          -		else
          -		if (oRight instanceof cXSDayTimeDuration)
          -			sOperator	= "subtract-dayTimeDuration-from-date";
          -	}
          -	else
          -	if (oLeft instanceof cXSTime) {
          -		if (oRight instanceof cXSTime)
          -			sOperator	= "subtract-times";
          -		else
          -		if (oRight instanceof cXSDayTimeDuration)
          -			sOperator	= "subtract-dayTimeDuration-from-time";
          -	}
          -	else
          -	if (oLeft instanceof cXSDateTime) {
          -		if (oRight instanceof cXSDateTime)
          -			sOperator	= "subtract-dateTimes";
          -		else
          -		if (oRight instanceof cXSYearMonthDuration)
          -			sOperator	= "subtract-yearMonthDuration-from-dateTime";
          -		else
          -		if (oRight instanceof cXSDayTimeDuration)
          -			sOperator	= "subtract-dayTimeDuration-from-dateTime";
          -	}
          -	else
          -	if (oLeft instanceof cXSYearMonthDuration) {
          -		if (oRight instanceof cXSYearMonthDuration)
          -			sOperator	= "subtract-yearMonthDurations";
          -	}
          -	else
          -	if (oLeft instanceof cXSDayTimeDuration) {
          -		if (oRight instanceof cXSDayTimeDuration)
          -			sOperator	= "subtract-dayTimeDurations";
          -	}
          -
          -	// Call operator function
          -	if (sOperator)
          -		return hStaticContext_operators[sOperator].call(oContext, oLeft, oRight);
          -
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);	// Arithmetic operator is not defined for arguments of types ({type1}, {type2})
          -};
          -
          -// Static members
          -function fAdditiveExpr_parse (oLexer, oStaticContext) {
          -	var oExpr;
          -	if (oLexer.eof() ||!(oExpr = fMultiplicativeExpr_parse(oLexer, oStaticContext)))
          -		return;
          -	if (!(oLexer.peek() in hAdditiveExpr_operators))
          -		return oExpr;
          -
          -	// Additive expression
          -	var oAdditiveExpr	= new cAdditiveExpr(oExpr),
          -		sOperator;
          -	while ((sOperator = oLexer.peek()) in hAdditiveExpr_operators) {
          -		oLexer.next();
          -		if (oLexer.eof() ||!(oExpr = fMultiplicativeExpr_parse(oLexer, oStaticContext)))
          -			throw new cException("XPST0003"
          -
          -			);
          -		oAdditiveExpr.items.push([sOperator, oExpr]);
          -	}
          -	return oAdditiveExpr;
          -};
          -
          -// Public members
          -cAdditiveExpr.prototype.evaluate	= function (oContext) {
          -	var oLeft	= fFunction_sequence_atomize(this.left.evaluate(oContext), oContext);
          -
          -	if (!oLeft.length)
          -		return [];
          -	// Assert cardinality
          -	fFunctionCall_assertSequenceCardinality(oContext, oLeft, '?'
          -
          -	);
          -
          -	var vLeft	= oLeft[0];
          -	if (vLeft instanceof cXSUntypedAtomic)
          -		vLeft	= cXSDouble.cast(vLeft);	// cast to xs:double
          -
          -	for (var nIndex = 0, nLength = this.items.length, oRight, vRight; nIndex < nLength; nIndex++) {
          -		oRight	= fFunction_sequence_atomize(this.items[nIndex][1].evaluate(oContext), oContext);
          -
          -		if (!oRight.length)
          -			return [];
          -		// Assert cardinality
          -		fFunctionCall_assertSequenceCardinality(oContext, oRight, '?'
          -
          -		);
          -
          -		vRight	= oRight[0];
          -		if (vRight instanceof cXSUntypedAtomic)
          -			vRight	= cXSDouble.cast(vRight);	// cast to xs:double
          -
          -		vLeft	= hAdditiveExpr_operators[this.items[nIndex][0]](vLeft, vRight, oContext);
          -	}
          -	return [vLeft];
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cMultiplicativeExpr(oExpr) {
          -	this.left	= oExpr;
          -	this.items	= [];
          -};
          -
          -cMultiplicativeExpr.prototype.left	= null;
          -cMultiplicativeExpr.prototype.items	= null;
          -
          -//
          -var hMultiplicativeExpr_operators	= {};
          -hMultiplicativeExpr_operators['*']		= function (oLeft, oRight, oContext) {
          -	var sOperator	= '',
          -		bReverse	= false;
          -
          -	if (fXSAnyAtomicType_isNumeric(oLeft)) {
          -		if (fXSAnyAtomicType_isNumeric(oRight))
          -			sOperator	= "numeric-multiply";
          -		else
          -		if (oRight instanceof cXSYearMonthDuration) {
          -			sOperator	= "multiply-yearMonthDuration";
          -			bReverse	= true;
          -		}
          -		else
          -		if (oRight instanceof cXSDayTimeDuration) {
          -			sOperator	= "multiply-dayTimeDuration";
          -			bReverse	= true;
          -		}
          -	}
          -	else {
          -		if (oLeft instanceof cXSYearMonthDuration) {
          -			if (fXSAnyAtomicType_isNumeric(oRight))
          -				sOperator	= "multiply-yearMonthDuration";
          -		}
          -		else
          -		if (oLeft instanceof cXSDayTimeDuration) {
          -			if (fXSAnyAtomicType_isNumeric(oRight))
          -				sOperator	= "multiply-dayTimeDuration";
          -		}
          -	}
          -
          -	// Call operator function
          -	if (sOperator)
          -		return hStaticContext_operators[sOperator].call(oContext, bReverse ? oRight : oLeft, bReverse ? oLeft : oRight);
          -
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);	// Arithmetic operator is not defined for arguments of types ({type1}, {type2})
          -};
          -hMultiplicativeExpr_operators['div']	= function (oLeft, oRight, oContext) {
          -	var sOperator	= '';
          -
          -	if (fXSAnyAtomicType_isNumeric(oLeft)) {
          -		if (fXSAnyAtomicType_isNumeric(oRight))
          -			sOperator	= "numeric-divide";
          -	}
          -	else
          -	if (oLeft instanceof cXSYearMonthDuration) {
          -		if (fXSAnyAtomicType_isNumeric(oRight))
          -			sOperator	= "divide-yearMonthDuration";
          -		else
          -		if (oRight instanceof cXSYearMonthDuration)
          -			sOperator	= "divide-yearMonthDuration-by-yearMonthDuration";
          -	}
          -	else
          -	if (oLeft instanceof cXSDayTimeDuration) {
          -		if (fXSAnyAtomicType_isNumeric(oRight))
          -			sOperator	= "divide-dayTimeDuration";
          -		else
          -		if (oRight instanceof cXSDayTimeDuration)
          -			sOperator	= "divide-dayTimeDuration-by-dayTimeDuration";
          -	}
          -	// Call operator function
          -	if (sOperator)
          -		return hStaticContext_operators[sOperator].call(oContext, oLeft, oRight);
          -
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);	// Arithmetic operator is not defined for arguments of types ({type1}, {type2})
          -};
          -hMultiplicativeExpr_operators['idiv']	= function (oLeft, oRight, oContext) {
          -	if (fXSAnyAtomicType_isNumeric(oLeft) && fXSAnyAtomicType_isNumeric(oRight))
          -		return hStaticContext_operators["numeric-integer-divide"].call(oContext, oLeft, oRight);
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);	// Arithmetic operator is not defined for arguments of types ({type1}, {type2})
          -};
          -hMultiplicativeExpr_operators['mod']	= function (oLeft, oRight, oContext) {
          -	if (fXSAnyAtomicType_isNumeric(oLeft) && fXSAnyAtomicType_isNumeric(oRight))
          -		return hStaticContext_operators["numeric-mod"].call(oContext, oLeft, oRight);
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);	// Arithmetic operator is not defined for arguments of types ({type1}, {type2})
          -};
          -
          -// Static members
          -function fMultiplicativeExpr_parse (oLexer, oStaticContext) {
          -	var oExpr;
          -	if (oLexer.eof() ||!(oExpr = fUnionExpr_parse(oLexer, oStaticContext)))
          -		return;
          -	if (!(oLexer.peek() in hMultiplicativeExpr_operators))
          -		return oExpr;
          -
          -	// Additive expression
          -	var oMultiplicativeExpr	= new cMultiplicativeExpr(oExpr),
          -		sOperator;
          -	while ((sOperator = oLexer.peek()) in hMultiplicativeExpr_operators) {
          -		oLexer.next();
          -		if (oLexer.eof() ||!(oExpr = fUnionExpr_parse(oLexer, oStaticContext)))
          -			throw new cException("XPST0003"
          -
          -			);
          -		oMultiplicativeExpr.items.push([sOperator, oExpr]);
          -	}
          -	return oMultiplicativeExpr;
          -};
          -
          -// Public members
          -cMultiplicativeExpr.prototype.evaluate	= function (oContext) {
          -	var oLeft	= fFunction_sequence_atomize(this.left.evaluate(oContext), oContext);
          -
          -	//
          -	if (!oLeft.length)
          -		return [];
          -	// Assert cardinality
          -	fFunctionCall_assertSequenceCardinality(oContext, oLeft, '?'
          -
          -	);
          -
          -	var vLeft	= oLeft[0];
          -	if (vLeft instanceof cXSUntypedAtomic)
          -		vLeft	= cXSDouble.cast(vLeft);	// cast to xs:double
          -
          -	for (var nIndex = 0, nLength = this.items.length, oRight, vRight; nIndex < nLength; nIndex++) {
          -		oRight	= fFunction_sequence_atomize(this.items[nIndex][1].evaluate(oContext), oContext);
          -
          -		if (!oRight.length)
          -			return [];
          -		// Assert cardinality
          -		fFunctionCall_assertSequenceCardinality(oContext, oRight, '?'
          -
          -		);
          -
          -		vRight	= oRight[0];
          -		if (vRight instanceof cXSUntypedAtomic)
          -			vRight	= cXSDouble.cast(vRight);	// cast to xs:double
          -
          -		vLeft	= hMultiplicativeExpr_operators[this.items[nIndex][0]](vLeft, vRight, oContext);
          -	}
          -	return [vLeft];
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cUnaryExpr(sOperator, oExpr) {
          -	this.operator	= sOperator;
          -	this.expression	= oExpr;
          -};
          -
          -cUnaryExpr.prototype.operator	= null;
          -cUnaryExpr.prototype.expression	= null;
          -
          -//
          -var hUnaryExpr_operators	= {};
          -hUnaryExpr_operators['-']	= function(oRight, oContext) {
          -	if (fXSAnyAtomicType_isNumeric(oRight))
          -		return hStaticContext_operators["numeric-unary-minus"].call(oContext, oRight);
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);	// Arithmetic operator is not defined for arguments of types ({type1}, {type2})
          -};
          -hUnaryExpr_operators['+']	= function(oRight, oContext) {
          -	if (fXSAnyAtomicType_isNumeric(oRight))
          -		return hStaticContext_operators["numeric-unary-plus"].call(oContext, oRight);
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);	// Arithmetic operator is not defined for arguments of types ({type1}, {type2})
          -};
          -
          -// Static members
          -// UnaryExpr	:= ("-" | "+")* ValueExpr
          -function fUnaryExpr_parse (oLexer, oStaticContext) {
          -	if (oLexer.eof())
          -		return;
          -	if (!(oLexer.peek() in hUnaryExpr_operators))
          -		return fValueExpr_parse(oLexer, oStaticContext);
          -
          -	// Unary expression
          -	var sOperator	= '+',
          -		oExpr;
          -	while (oLexer.peek() in hUnaryExpr_operators) {
          -		if (oLexer.peek() == '-')
          -			sOperator	= sOperator == '-' ? '+' : '-';
          -		oLexer.next();
          -	}
          -	if (oLexer.eof() ||!(oExpr = fValueExpr_parse(oLexer, oStaticContext)))
          -		throw new cException("XPST0003"
          -
          -		);
          -	return new cUnaryExpr(sOperator, oExpr);
          -};
          -
          -cUnaryExpr.prototype.evaluate	= function (oContext) {
          -	var oRight	= fFunction_sequence_atomize(this.expression.evaluate(oContext), oContext);
          -
          -	//
          -	if (!oRight.length)
          -		return [];
          -	// Assert cardinality
          -	fFunctionCall_assertSequenceCardinality(oContext, oRight, '?'
          -
          -	);
          -
          -	var vRight	= oRight[0];
          -	if (vRight instanceof cXSUntypedAtomic)
          -		vRight	= cXSDouble.cast(vRight);	// cast to xs:double
          -
          -	return [hUnaryExpr_operators[this.operator](vRight, oContext)];
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cValueExpr() {
          -
          -};
          -
          -// Static members
          -function fValueExpr_parse (oLexer, oStaticContext) {
          -	return fPathExpr_parse(oLexer, oStaticContext);
          -};
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cOrExpr(oExpr) {
          -	this.left	= oExpr;
          -	this.items	= [];
          -};
          -
          -cOrExpr.prototype.left	= null;
          -cOrExpr.prototype.items	= null;
          -
          -// Static members
          -function fOrExpr_parse (oLexer, oStaticContext) {
          -	var oExpr;
          -	if (oLexer.eof() ||!(oExpr = fAndExpr_parse(oLexer, oStaticContext)))
          -		return;
          -	if (oLexer.peek() != "or")
          -		return oExpr;
          -
          -	// Or expression
          -	var oOrExpr	= new cOrExpr(oExpr);
          -	while (oLexer.peek() == "or") {
          -		oLexer.next();
          -		if (oLexer.eof() ||!(oExpr = fAndExpr_parse(oLexer, oStaticContext)))
          -			throw new cException("XPST0003"
          -
          -			);
          -		oOrExpr.items.push(oExpr);
          -	}
          -	return oOrExpr;
          -};
          -
          -// Public members
          -cOrExpr.prototype.evaluate	= function (oContext) {
          -	var bValue	= fFunction_sequence_toEBV(this.left.evaluate(oContext), oContext);
          -	for (var nIndex = 0, nLength = this.items.length; (nIndex < nLength) && !bValue; nIndex++)
          -		bValue	= fFunction_sequence_toEBV(this.items[nIndex].evaluate(oContext), oContext);
          -	return [new cXSBoolean(bValue)];
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cAndExpr(oExpr) {
          -	this.left	= oExpr;
          -	this.items	= [];
          -};
          -
          -cAndExpr.prototype.left		= null;
          -cAndExpr.prototype.items	= null;
          -
          -// Static members
          -function fAndExpr_parse (oLexer, oStaticContext) {
          -	var oExpr;
          -	if (oLexer.eof() ||!(oExpr = fComparisonExpr_parse(oLexer, oStaticContext)))
          -		return;
          -	if (oLexer.peek() != "and")
          -		return oExpr;
          -
          -	// And expression
          -	var oAndExpr	= new cAndExpr(oExpr);
          -	while (oLexer.peek() == "and") {
          -		oLexer.next();
          -		if (oLexer.eof() ||!(oExpr = fComparisonExpr_parse(oLexer, oStaticContext)))
          -			throw new cException("XPST0003"
          -
          -			);
          -		oAndExpr.items.push(oExpr);
          -	}
          -	return oAndExpr;
          -};
          -
          -// Public members
          -cAndExpr.prototype.evaluate	= function (oContext) {
          -	var bValue	= fFunction_sequence_toEBV(this.left.evaluate(oContext), oContext);
          -	for (var nIndex = 0, nLength = this.items.length; (nIndex < nLength) && bValue; nIndex++)
          -		bValue	= fFunction_sequence_toEBV(this.items[nIndex].evaluate(oContext), oContext);
          -	return [new cXSBoolean(bValue)];
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cStepExpr() {
          -
          -};
          -
          -cStepExpr.prototype.predicates	= null;
          -
          -// Static members
          -function fStepExpr_parse (oLexer, oStaticContext) {
          -	if (!oLexer.eof())
          -		return fFilterExpr_parse(oLexer, oStaticContext)
          -			|| fAxisStep_parse(oLexer, oStaticContext);
          -};
          -
          -function fStepExpr_parsePredicates (oLexer, oStaticContext, oStep) {
          -	var oExpr;
          -	// Parse predicates
          -	while (oLexer.peek() == '[') {
          -		oLexer.next();
          -
          -		if (oLexer.eof() ||!(oExpr = fExpr_parse(oLexer, oStaticContext)))
          -			throw new cException("XPST0003"
          -
          -			);
          -
          -		oStep.predicates.push(oExpr);
          -
          -		if (oLexer.peek() != ']')
          -			throw new cException("XPST0003"
          -
          -			);
          -
          -		oLexer.next();
          -	}
          -};
          -
          -// Public members
          -cStepExpr.prototype.applyPredicates	= function(oSequence, oContext) {
          -	var vContextItem	= oContext.item,
          -		nContextPosition= oContext.position,
          -		nContextSize	= oContext.size;
          -	//
          -	for (var nPredicateIndex = 0, oSequence1, nPredicateLength = this.predicates.length; nPredicateIndex < nPredicateLength; nPredicateIndex++) {
          -		oSequence1	= oSequence;
          -		oSequence	= [];
          -		for (var nIndex = 0, oSequence2, nLength = oSequence1.length; nIndex < nLength; nIndex++) {
          -			// Set new context
          -			oContext.item		= oSequence1[nIndex];
          -			oContext.position	= nIndex + 1;
          -			oContext.size		= nLength;
          -			//
          -			oSequence2	= this.predicates[nPredicateIndex].evaluate(oContext);
          -			//
          -			if (oSequence2.length == 1 && fXSAnyAtomicType_isNumeric(oSequence2[0])) {
          -				if (oSequence2[0].valueOf() == nIndex + 1)
          -					oSequence.push(oSequence1[nIndex]);
          -			}
          -			else
          -			if (fFunction_sequence_toEBV(oSequence2, oContext))
          -				oSequence.push(oSequence1[nIndex]);
          -		}
          -	}
          -	// Restore context
          -	oContext.item		= vContextItem;
          -	oContext.position	= nContextPosition;
          -	oContext.size		= nContextSize;
          -	//
          -	return oSequence;
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cAxisStep(sAxis, oTest) {
          -	this.axis	= sAxis;
          -	this.test	= oTest;
          -	this.predicates	= [];
          -};
          -
          -cAxisStep.prototype	= new cStepExpr;
          -
          -cAxisStep.prototype.axis		= null;
          -cAxisStep.prototype.test		= null;
          -
          -//
          -var hAxisStep_axises	= {};
          -// Forward axis
          -hAxisStep_axises["attribute"]			= {};
          -hAxisStep_axises["child"]				= {};
          -hAxisStep_axises["descendant"]			= {};
          -hAxisStep_axises["descendant-or-self"]	= {};
          -hAxisStep_axises["following"]			= {};
          -hAxisStep_axises["following-sibling"]	= {};
          -hAxisStep_axises["self"]				= {};
          -// hAxisStep_axises["namespace"]			= {};	// deprecated in 2.0
          -// Reverse axis
          -hAxisStep_axises["ancestor"]			= {};
          -hAxisStep_axises["ancestor-or-self"]	= {};
          -hAxisStep_axises["parent"]				= {};
          -hAxisStep_axises["preceding"]			= {};
          -hAxisStep_axises["preceding-sibling"]	= {};
          -
          -// Static members
          -function fAxisStep_parse (oLexer, oStaticContext) {
          -	var sAxis	= oLexer.peek(),
          -		oExpr,
          -		oStep;
          -	if (oLexer.peek(1) == '::') {
          -		if (!(sAxis in hAxisStep_axises))
          -			throw new cException("XPST0003"
          -
          -			);
          -
          -		oLexer.next(2);
          -		if (oLexer.eof() ||!(oExpr = fNodeTest_parse(oLexer, oStaticContext)))
          -			throw new cException("XPST0003"
          -
          -			);
          -		//
          -		oStep	= new cAxisStep(sAxis, oExpr);
          -	}
          -	else
          -	if (sAxis == '..') {
          -		oLexer.next();
          -		oStep	= new cAxisStep("parent", new cKindTest("node"));
          -	}
          -	else
          -	if (sAxis == '@') {
          -		oLexer.next();
          -		if (oLexer.eof() ||!(oExpr = fNodeTest_parse(oLexer, oStaticContext)))
          -			throw new cException("XPST0003"
          -
          -			);
          -		//
          -		oStep	= new cAxisStep("attribute", oExpr);
          -	}
          -	else {
          -		if (oLexer.eof() ||!(oExpr = fNodeTest_parse(oLexer, oStaticContext)))
          -			return;
          -		oStep	= new cAxisStep(oExpr instanceof cKindTest && oExpr.name == "attribute" ? "attribute" : "child", oExpr);
          -	}
          -	//
          -	fStepExpr_parsePredicates(oLexer, oStaticContext, oStep);
          -
          -	return oStep;
          -};
          -
          -// Public members
          -cAxisStep.prototype.evaluate	= function (oContext) {
          -	var oItem	= oContext.item;
          -
          -	if (!oContext.DOMAdapter.isNode(oItem))
          -		throw new cException("XPTY0020");
          -
          -	var oSequence	= [],
          -		fGetProperty= oContext.DOMAdapter.getProperty,
          -		nType		= fGetProperty(oItem, "nodeType");
          -
          -	switch (this.axis) {
          -		// Forward axis
          -		case "attribute":
          -			if (nType == 1)
          -				for (var aAttributes = fGetProperty(oItem, "attributes"), nIndex = 0, nLength = aAttributes.length; nIndex < nLength; nIndex++)
          -					oSequence.push(aAttributes[nIndex]);
          -			break;
          -
          -		case "child":
          -			for (var oNode = fGetProperty(oItem, "firstChild"); oNode; oNode = fGetProperty(oNode, "nextSibling"))
          -				oSequence.push(oNode);
          -			break;
          -
          -		case "descendant-or-self":
          -			oSequence.push(oItem);
          -			// No break left intentionally
          -		case "descendant":
          -			fAxisStep_getChildrenForward(fGetProperty(oItem, "firstChild"), oSequence, fGetProperty);
          -			break;
          -
          -		case "following":
          -			// TODO: Attribute node context
          -			for (var oParent = oItem, oSibling; oParent; oParent = fGetProperty(oParent, "parentNode"))
          -				if (oSibling = fGetProperty(oParent, "nextSibling"))
          -					fAxisStep_getChildrenForward(oSibling, oSequence, fGetProperty);
          -			break;
          -
          -		case "following-sibling":
          -			for (var oNode = oItem; oNode = fGetProperty(oNode, "nextSibling");)
          -				oSequence.push(oNode);
          -			break;
          -
          -		case "self":
          -			oSequence.push(oItem);
          -			break;
          -
          -		// Reverse axis
          -		case "ancestor-or-self":
          -			oSequence.push(oItem);
          -			// No break left intentionally
          -		case "ancestor":
          -			for (var oNode = nType == 2 ? fGetProperty(oItem, "ownerElement") : oItem; oNode = fGetProperty(oNode, "parentNode");)
          -				oSequence.push(oNode);
          -			break;
          -
          -		case "parent":
          -			var oParent	= nType == 2 ? fGetProperty(oItem, "ownerElement") : fGetProperty(oItem, "parentNode");
          -			if (oParent)
          -				oSequence.push(oParent);
          -			break;
          -
          -		case "preceding":
          -			// TODO: Attribute node context
          -			for (var oParent = oItem, oSibling; oParent; oParent = fGetProperty(oParent, "parentNode"))
          -				if (oSibling = fGetProperty(oParent, "previousSibling"))
          -					fAxisStep_getChildrenBackward(oSibling, oSequence, fGetProperty);
          -			break;
          -
          -		case "preceding-sibling":
          -			for (var oNode = oItem; oNode = fGetProperty(oNode, "previousSibling");)
          -				oSequence.push(oNode);
          -			break;
          -	}
          -
          -	// Apply test
          -	if (oSequence.length && !(this.test instanceof cKindTest && this.test.name == "node")) {
          -		var oSequence1	= oSequence;
          -		oSequence	= [];
          -		for (var nIndex = 0, nLength = oSequence1.length; nIndex < nLength; nIndex++) {
          -			if (this.test.test(oSequence1[nIndex], oContext))
          -				oSequence.push(oSequence1[nIndex]);
          -		}
          -	}
          -
          -	// Apply predicates
          -	if (oSequence.length && this.predicates.length)
          -		oSequence	= this.applyPredicates(oSequence, oContext);
          -
          -	// Reverse results if reverse axis
          -	switch (this.axis) {
          -		case "ancestor":
          -		case "ancestor-or-self":
          -		case "parent":
          -		case "preceding":
          -		case "preceding-sibling":
          -			oSequence.reverse();
          -	}
          -
          -	return oSequence;
          -};
          -
          -//
          -function fAxisStep_getChildrenForward(oNode, oSequence, fGetProperty) {
          -	for (var oChild; oNode; oNode = fGetProperty(oNode, "nextSibling")) {
          -		oSequence.push(oNode);
          -		if (oChild = fGetProperty(oNode, "firstChild"))
          -			fAxisStep_getChildrenForward(oChild, oSequence, fGetProperty);
          -	}
          -};
          -
          -function fAxisStep_getChildrenBackward(oNode, oSequence, fGetProperty) {
          -	for (var oChild; oNode; oNode = fGetProperty(oNode, "previousSibling")) {
          -		if (oChild = fGetProperty(oNode, "lastChild"))
          -			fAxisStep_getChildrenBackward(oChild, oSequence, fGetProperty);
          -		oSequence.push(oNode);
          -	}
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cPathExpr() {
          -	this.items	= [];
          -};
          -
          -cPathExpr.prototype.items	= null;
          -
          -// Static members
          -function fPathExpr_parse (oLexer, oStaticContext) {
          -	if (oLexer.eof())
          -		return;
          -	var sSingleSlash	= '/',
          -		sDoubleSlash	= '/' + '/';
          -
          -	var oPathExpr	= new cPathExpr(),
          -		sSlash	= oLexer.peek(),
          -		oExpr;
          -	// Parse first step
          -	if (sSlash == sDoubleSlash || sSlash == sSingleSlash) {
          -		oLexer.next();
          -		oPathExpr.items.push(new cFunctionCall(null, "root", sNS_XPF));
          -		//
          -		if (sSlash == sDoubleSlash)
          -			oPathExpr.items.push(new cAxisStep("descendant-or-self", new cKindTest("node")));
          -	}
          -
          -	//
          -	if (oLexer.eof() ||!(oExpr = fStepExpr_parse(oLexer, oStaticContext))) {
          -		if (sSlash == sSingleSlash)
          -			return oPathExpr.items[0];	// '/' expression
          -		if (sSlash == sDoubleSlash)
          -			throw new cException("XPST0003"
          -
          -			);
          -		return;
          -	}
          -	oPathExpr.items.push(oExpr);
          -
          -	// Parse other steps
          -	while ((sSlash = oLexer.peek()) == sSingleSlash || sSlash == sDoubleSlash) {
          -		if (sSlash == sDoubleSlash)
          -			oPathExpr.items.push(new cAxisStep("descendant-or-self", new cKindTest("node")));
          -		//
          -		oLexer.next();
          -		if (oLexer.eof() ||!(oExpr = fStepExpr_parse(oLexer, oStaticContext)))
          -			throw new cException("XPST0003"
          -
          -			);
          -		//
          -		oPathExpr.items.push(oExpr);
          -	}
          -
          -	if (oPathExpr.items.length == 1)
          -		return oPathExpr.items[0];
          -
          -	//
          -	return oPathExpr;
          -};
          -
          -// Public members
          -cPathExpr.prototype.evaluate	= function (oContext) {
          -	var vContextItem	= oContext.item;
          -	//
          -	var oSequence	= [vContextItem];
          -	for (var nItemIndex = 0, nItemLength = this.items.length, oSequence1; nItemIndex < nItemLength; nItemIndex++) {
          -		oSequence1	= [];
          -		for (var nIndex = 0, nLength = oSequence.length; nIndex < nLength; nIndex++) {
          -			// Set new context item
          -			oContext.item	= oSequence[nIndex];
          -			//
          -			for (var nRightIndex = 0, oSequence2 = this.items[nItemIndex].evaluate(oContext), nRightLength = oSequence2.length; nRightIndex < nRightLength; nRightIndex++)
          -				if ((nItemIndex < nItemLength - 1) && !oContext.DOMAdapter.isNode(oSequence2[nRightIndex]))
          -					throw new cException("XPTY0019");
          -				else
          -				if (fArray_indexOf(oSequence1, oSequence2[nRightIndex]) ==-1)
          -					oSequence1.push(oSequence2[nRightIndex]);
          -		}
          -		oSequence	= oSequence1;
          -	};
          -	// Restore context item
          -	oContext.item	= vContextItem;
          -	//
          -	return fFunction_sequence_order(oSequence, oContext);
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cNodeTest() {
          -
          -};
          -
          -// Static members
          -function fNodeTest_parse (oLexer, oStaticContext) {
          -	if (!oLexer.eof())
          -		return fKindTest_parse(oLexer, oStaticContext)
          -			|| fNameTest_parse(oLexer, oStaticContext);
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cKindTest(sName) {
          -	this.name	= sName;
          -	this.args	= [];
          -};
          -
          -cKindTest.prototype	= new cNodeTest;
          -
          -cKindTest.prototype.name	= null;
          -cKindTest.prototype.args	= null;
          -
          -var hKindTest_names	= {};
          -//
          -hKindTest_names["document-node"]	= {};
          -hKindTest_names["element"]			= {};
          -hKindTest_names["attribute"]		= {};
          -hKindTest_names["processing-instruction"]	= {};
          -hKindTest_names["comment"]			= {};
          -hKindTest_names["text"]				= {};
          -hKindTest_names["node"]				= {};
          -//
          -hKindTest_names["schema-element"]	= {};
          -hKindTest_names["schema-attribute"]	= {};
          -
          -// Static members
          -function fKindTest_parse (oLexer, oStaticContext) {
          -	var sName	= oLexer.peek(),
          -		oValue;
          -	if (oLexer.peek(1) == '(') {
          -		//
          -		if (!(sName in hKindTest_names))
          -			throw new cException("XPST0003"
          -
          -			);
          -
          -		//
          -		oLexer.next(2);
          -		//
          -		var oTest	= new cKindTest(sName);
          -		if (oLexer.peek() != ')') {
          -			if (sName == "document-node") {
          -				// TODO: parse test further
          -			}
          -			else
          -			if (sName == "element") {
          -				// TODO: parse test further
          -			}
          -			else
          -			if (sName == "attribute") {
          -				// TODO: parse test further
          -			}
          -			else
          -			if (sName == "processing-instruction") {
          -				oValue = fStringLiteral_parse(oLexer, oStaticContext);
          -				if (!oValue) {
          -					oValue = new cStringLiteral(new cXSString(oLexer.peek()));
          -					oLexer.next();
          -				}
          -				oTest.args.push(oValue);
          -			}
          -			else
          -			if (sName == "schema-attribute") {
          -				// TODO: parse test further
          -			}
          -			else
          -			if (sName == "schema-element") {
          -				// TODO: parse test further
          -			}
          -		}
          -		else {
          -			if (sName == "schema-attribute")
          -				throw new cException("XPST0003"
          -
          -				);
          -			else
          -			if (sName == "schema-element")
          -				throw new cException("XPST0003"
          -
          -				);
          -		}
          -
          -		if (oLexer.peek() != ')')
          -			throw new cException("XPST0003"
          -
          -			);
          -		oLexer.next();
          -
          -		return oTest;
          -	}
          -};
          -
          -// Public members
          -cKindTest.prototype.test	= function (oNode, oContext) {
          -	var fGetProperty	= oContext.DOMAdapter.getProperty,
          -		nType	= oContext.DOMAdapter.isNode(oNode) ? fGetProperty(oNode, "nodeType") : 0,
          -		sTarget;
          -	switch (this.name) {
          -		// Node type test
          -		case "node":			return !!nType;
          -		case "attribute":				if (nType != 2)	return false;	break;
          -		case "document-node":	return nType == 9;
          -		case "element":			return nType == 1;
          -		case "processing-instruction":	if (nType != 7)	return false;	break;
          -		case "comment":			return nType == 8;
          -		case "text":			return nType == 3 || nType == 4;
          -
          -		// Schema tests
          -		case "schema-attribute":
          -			throw "KindTest '" + "schema-attribute" + "' not implemented";
          -
          -		case "schema-element":
          -			throw "KindTest '" + "schema-element" + "' not implemented";
          -	}
          -
          -	// Additional tests
          -	if (nType == 2)
          -		return fGetProperty(oNode, "prefix") != "xmlns" && fGetProperty(oNode, "localName") != "xmlns";
          -	if (nType == 7) {
          -		sTarget = fGetProperty(oNode, "target");
          -		return this.args.length ? sTarget == this.args[0].value : sTarget != "xml";
          -	}
          -
          -	return true;
          -};
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cNameTest(sPrefix, sLocalName, sNameSpaceURI) {
          -	this.prefix			= sPrefix;
          -	this.localName		= sLocalName;
          -	this.namespaceURI	= sNameSpaceURI;
          -};
          -
          -cNameTest.prototype	= new cNodeTest;
          -
          -cNameTest.prototype.prefix			= null;
          -cNameTest.prototype.localName		= null;
          -cNameTest.prototype.namespaceURI	= null;
          -
          -// Static members
          -var rNameTest	= /^(?:(?![0-9-])(\w[\w.-]*|\*)\:)?(?![0-9-])(\w[\w.-]*|\*)$/;
          -function fNameTest_parse (oLexer, oStaticContext) {
          -	var aMatch	= oLexer.peek().match(rNameTest);
          -	if (aMatch) {
          -		if (aMatch[1] == '*' && aMatch[2] == '*')
          -			throw new cException("XPST0003"
          -
          -			);
          -		oLexer.next();
          -		return new cNameTest(aMatch[1] || null, aMatch[2], aMatch[1] ? aMatch[1] == '*' ? '*' : oStaticContext.getURIForPrefix(aMatch[1]) || null : oStaticContext.defaultElementNamespace);
          -	}
          -};
          -
          -// Public members
          -cNameTest.prototype.test	= function (oNode, oContext) {
          -	var fGetProperty	= oContext.DOMAdapter.getProperty,
          -		nType	= fGetProperty(oNode, "nodeType");
          -	if (nType == 1 || nType == 2) {
          -		if (this.localName == '*')
          -			return (nType == 1 || (fGetProperty(oNode, "prefix") != "xmlns" && fGetProperty(oNode, "localName") != "xmlns")) && (!this.prefix || fGetProperty(oNode, "namespaceURI") == this.namespaceURI);
          -		if (this.localName == fGetProperty(oNode, "localName"))
          -			return this.namespaceURI == '*' || (nType == 2 && !this.prefix && !fGetProperty(oNode, "prefix")) || fGetProperty(oNode, "namespaceURI") == this.namespaceURI;
          -	}
          -	//
          -	return false;
          -};
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cPrimaryExpr() {
          -
          -};
          -
          -// Static members
          -function fPrimaryExpr_parse (oLexer, oStaticContext) {
          -	if (!oLexer.eof())
          -		return fContextItemExpr_parse(oLexer, oStaticContext)
          -			|| fParenthesizedExpr_parse(oLexer, oStaticContext)
          -			|| fFunctionCall_parse(oLexer, oStaticContext)
          -			|| fVarRef_parse(oLexer, oStaticContext)
          -			|| fLiteral_parse(oLexer, oStaticContext);
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cParenthesizedExpr(oExpr) {
          -	this.expression	= oExpr;
          -};
          -
          -// Static members
          -function fParenthesizedExpr_parse (oLexer, oStaticContext) {
          -	if (oLexer.peek() == '(') {
          -		oLexer.next();
          -		// Check if not empty (allowed)
          -		var oExpr	= null;
          -		if (oLexer.peek() != ')')
          -			oExpr	= fExpr_parse(oLexer, oStaticContext);
          -
          -		//
          -		if (oLexer.peek() != ')')
          -			throw new cException("XPST0003"
          -
          -			);
          -
          -		oLexer.next();
          -
          -		//
          -		return new cParenthesizedExpr(oExpr);
          -	}
          -};
          -
          -// Public members
          -cParenthesizedExpr.prototype.evaluate	= function (oContext) {
          -	return this.expression ? this.expression.evaluate(oContext) : [];
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cContextItemExpr() {
          -
          -};
          -
          -// Static members
          -function fContextItemExpr_parse (oLexer, oStaticContext) {
          -	if (oLexer.peek() == '.') {
          -		oLexer.next();
          -		return new cContextItemExpr;
          -	}
          -};
          -
          -// Public members
          -cContextItemExpr.prototype.evaluate	= function (oContext) {
          -	if (oContext.item == null)
          -		throw new cException("XPDY0002"
          -
          -		);
          -	//
          -	return [oContext.item];
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cLiteral() {
          -
          -};
          -
          -cLiteral.prototype.value	= null;
          -
          -// Static members
          -function fLiteral_parse (oLexer, oStaticContext) {
          -	if (!oLexer.eof())
          -		return fNumericLiteral_parse(oLexer, oStaticContext)
          -			|| fStringLiteral_parse(oLexer, oStaticContext);
          -};
          -
          -// Public members
          -cLiteral.prototype.evaluate	= function (oContext) {
          -	return [this.value];
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cNumericLiteral(oValue) {
          -	this.value	= oValue;
          -};
          -
          -cNumericLiteral.prototype	= new cLiteral;
          -
          -// Integer | Decimal | Double
          -var rNumericLiteral	= /^[+\-]?(?:(?:(\d+)(?:\.(\d*))?)|(?:\.(\d+)))(?:[eE]([+-])?(\d+))?$/;
          -function fNumericLiteral_parse (oLexer, oStaticContext) {
          -	var sValue	= oLexer.peek(),
          -		vValue	= fNumericLiteral_parseValue(sValue);
          -	if (vValue) {
          -		oLexer.next();
          -		return new cNumericLiteral(vValue);
          -	}
          -};
          -
          -function fNumericLiteral_parseValue(sValue) {
          -	var aMatch	= sValue.match(rNumericLiteral);
          -	if (aMatch) {
          -		var cType	= cXSInteger;
          -		if (aMatch[5])
          -			cType	= cXSDouble;
          -		else
          -		if (aMatch[2] || aMatch[3])
          -			cType	= cXSDecimal;
          -		return new cType(+sValue);
          -	}
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cStringLiteral(oValue) {
          -	this.value	= oValue;
          -};
          -
          -cStringLiteral.prototype	= new cLiteral;
          -
          -var rStringLiteral	= /^'([^']*(?:''[^']*)*)'|"([^"]*(?:""[^"]*)*)"$/;
          -function fStringLiteral_parse (oLexer, oStaticContext) {
          -	var aMatch	= oLexer.peek().match(rStringLiteral);
          -	if (aMatch) {
          -		oLexer.next();
          -		return new cStringLiteral(new cXSString(aMatch[1] ? aMatch[1].replace("''", "'") : aMatch[2] ? aMatch[2].replace('""', '"') : ''));
          -	}
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cFilterExpr(oPrimary) {
          -	this.expression	= oPrimary;
          -	this.predicates	= [];
          -};
          -
          -cFilterExpr.prototype	= new cStepExpr;
          -
          -cFilterExpr.prototype.expression	= null;
          -
          -// Static members
          -function fFilterExpr_parse (oLexer, oStaticContext) {
          -	var oExpr;
          -	if (oLexer.eof() ||!(oExpr = fPrimaryExpr_parse(oLexer, oStaticContext)))
          -		return;
          -
          -	var oFilterExpr	= new cFilterExpr(oExpr);
          -	// Parse predicates
          -	fStepExpr_parsePredicates(oLexer, oStaticContext, oFilterExpr);
          -
          -	// If no predicates found
          -	if (oFilterExpr.predicates.length == 0)
          -		return oFilterExpr.expression;
          -
          -	return oFilterExpr;
          -};
          -
          -// Public members
          -cFilterExpr.prototype.evaluate	= function (oContext) {
          -	var oSequence	= this.expression.evaluate(oContext);
          -	if (this.predicates.length && oSequence.length)
          -		oSequence	= this.applyPredicates(oSequence, oContext);
          -	return oSequence;
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cVarRef(sPrefix, sLocalName, sNameSpaceURI) {
          -	this.prefix			= sPrefix;
          -	this.localName		= sLocalName;
          -	this.namespaceURI	= sNameSpaceURI;
          -};
          -
          -cVarRef.prototype.prefix		= null;
          -cVarRef.prototype.localName		= null;
          -cVarRef.prototype.namespaceURI	= null;
          -
          -// Static members
          -function fVarRef_parse (oLexer, oStaticContext) {
          -	if (oLexer.peek().substr(0, 1) == '$') {
          -		var aMatch	= oLexer.peek().substr(1).match(rNameTest);
          -		if (aMatch) {
          -			if (aMatch[1] == '*' || aMatch[2] == '*')
          -				throw new cException("XPST0003"
          -	
          -				);
          -
          -			var oVarRef	= new cVarRef(aMatch[1] || null, aMatch[2], aMatch[1] ? oStaticContext.getURIForPrefix(aMatch[1]) : null);
          -			oLexer.next();
          -			return oVarRef;
          -		}
          -	}
          -};
          -
          -// Public members
          -cVarRef.prototype.evaluate	= function (oContext) {
          -	var sUri	= (this.namespaceURI ? '{' + this.namespaceURI + '}' : '') + this.localName;
          -	if (oContext.scope.hasOwnProperty(sUri))
          -		return [oContext.scope[sUri]];
          -	//
          -	throw new cException("XPST0008"
          -
          -	);
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cFunctionCall(sPrefix, sLocalName, sNameSpaceURI) {
          -	this.prefix			= sPrefix;
          -	this.localName		= sLocalName;
          -	this.namespaceURI	= sNameSpaceURI;
          -	this.args	= [];
          -};
          -
          -cFunctionCall.prototype.prefix			= null;
          -cFunctionCall.prototype.localName		= null;
          -cFunctionCall.prototype.namespaceURI	= null;
          -cFunctionCall.prototype.args	= null;
          -
          -// Static members
          -function fFunctionCall_parse (oLexer, oStaticContext) {
          -	var aMatch	= oLexer.peek().match(rNameTest);
          -	if (aMatch && oLexer.peek(1) == '(') {
          -		// Reserved "functions"
          -		if (!aMatch[1] && (aMatch[2] in hKindTest_names))
          -			return fAxisStep_parse(oLexer, oStaticContext);
          -		// Other functions
          -		if (aMatch[1] == '*' || aMatch[2] == '*')
          -			throw new cException("XPST0003"
          -
          -			);
          -		var oFunctionCallExpr	= new cFunctionCall(aMatch[1] || null, aMatch[2], aMatch[1] ? oStaticContext.getURIForPrefix(aMatch[1]) || null : oStaticContext.defaultFunctionNamespace),
          -			oExpr;
          -		oLexer.next(2);
          -		//
          -		if (oLexer.peek() != ')') {
          -			do {
          -				if (oLexer.eof() ||!(oExpr = fExprSingle_parse(oLexer, oStaticContext)))
          -					throw new cException("XPST0003"
          -
          -					);
          -				//
          -				oFunctionCallExpr.args.push(oExpr);
          -			}
          -			while (oLexer.peek() == ',' && oLexer.next());
          -			//
          -			if (oLexer.peek() != ')')
          -				throw new cException("XPST0003"
          -
          -				);
          -		}
          -		oLexer.next();
          -		return oFunctionCallExpr;
          -	}
          -};
          -
          -// Public members
          -cFunctionCall.prototype.evaluate	= function (oContext) {
          -	var aArguments	= [],
          -		aParameters,
          -		fFunction;
          -
          -	// Evaluate arguments
          -	for (var nIndex = 0, nLength = this.args.length; nIndex < nLength; nIndex++)
          -		aArguments.push(this.args[nIndex].evaluate(oContext));
          -
          -	var sUri	= (this.namespaceURI ? '{' + this.namespaceURI + '}' : '') + this.localName;
          -	// Call function
          -	if (this.namespaceURI == sNS_XPF) {
          -		if (fFunction = hStaticContext_functions[this.localName]) {
          -			// Validate/Cast arguments
          -			if (aParameters = hStaticContext_signatures[this.localName])
          -				fFunctionCall_prepare(this.localName, aParameters, fFunction, aArguments, oContext);
          -			//
          -			var vResult	= fFunction.apply(oContext, aArguments);
          -			//
          -			return vResult == null ? [] : vResult instanceof cArray ? vResult : [vResult];
          -		}
          -		throw new cException("XPST0017"
          -
          -		);
          -	}
          -	else
          -	if (this.namespaceURI == sNS_XSD) {
          -		if ((fFunction = hStaticContext_dataTypes[this.localName]) && this.localName != "NOTATION" && this.localName != "anyAtomicType") {
          -			//
          -			fFunctionCall_prepare(this.localName, [[cXSAnyAtomicType, '?']], fFunction, aArguments, oContext);
          -			//
          -			return aArguments[0] === null ? [] : [fFunction.cast(aArguments[0])];
          -		}
          -		throw new cException("XPST0017"
          -
          -		);
          -	}
          -	else
          -	if (fFunction = oContext.staticContext.getFunction(sUri)) {
          -		//
          -		var vResult	= fFunction.apply(oContext, aArguments);
          -		//
          -		return vResult == null ? [] : vResult instanceof cArray ? vResult : [vResult];
          -	}
          -	//
          -	throw new cException("XPST0017"
          -
          -	);
          -};
          -
          -var aFunctionCall_numbers	= ["first", "second", "third", "fourth", "fifth"];
          -function fFunctionCall_prepare(sName, aParameters, fFunction, aArguments, oContext) {
          -	var oArgument,
          -		nArgumentsLength	= aArguments.length,
          -		oParameter,
          -		nParametersLength	= aParameters.length,
          -		nParametersRequired	= 0;
          -
          -	// Determine amount of parameters required
          -	while ((nParametersRequired < aParameters.length) && !aParameters[nParametersRequired][2])
          -		nParametersRequired++;
          -
          -	// Validate arguments length
          -	if (nArgumentsLength > nParametersLength)
          -		throw new cException("XPST0017"
          -
          -		);
          -	else
          -	if (nArgumentsLength < nParametersRequired)
          -		throw new cException("XPST0017"
          -
          -		);
          -
          -	for (var nIndex = 0; nIndex < nArgumentsLength; nIndex++) {
          -		oParameter	= aParameters[nIndex];
          -		oArgument	= aArguments[nIndex];
          -		// Check sequence cardinality
          -		fFunctionCall_assertSequenceCardinality(oContext, oArgument, oParameter[1]
          -
          -		);
          -		// Check sequence items data types consistency
          -		fFunctionCall_assertSequenceItemType(oContext, oArgument, oParameter[0]
          -
          -		);
          -		if (oParameter[1] != '+' && oParameter[1] != '*')
          -			aArguments[nIndex]	= oArgument.length ? oArgument[0] : null;
          -	}
          -};
          -
          -function fFunctionCall_assertSequenceItemType(oContext, oSequence, cItemType
          -
          -	) {
          -	//
          -	for (var nIndex = 0, nLength = oSequence.length, nNodeType, vItem; nIndex < nLength; nIndex++) {
          -		vItem	= oSequence[nIndex];
          -		// Node types
          -		if (cItemType == cXTNode || cItemType.prototype instanceof cXTNode) {
          -			// Check if is node
          -			if (!oContext.DOMAdapter.isNode(vItem))
          -				throw new cException("XPTY0004"
          -
          -				);
          -
          -			// Check node type
          -			if (cItemType != cXTNode) {
          -				nNodeType	= oContext.DOMAdapter.getProperty(vItem, "nodeType");
          -				if ([null, cXTElement, cXTAttribute, cXTText, cXTText, null, null, cXTProcessingInstruction, cXTComment, cXTDocument, null, null, null][nNodeType] != cItemType)
          -					throw new cException("XPTY0004"
          -
          -					);
          -			}
          -		}
          -		else
          -		// Atomic types
          -		if (cItemType == cXSAnyAtomicType || cItemType.prototype instanceof cXSAnyAtomicType) {
          -			// Atomize item
          -			vItem	= fFunction_sequence_atomize([vItem], oContext)[0];
          -			// Convert type if necessary
          -			if (cItemType != cXSAnyAtomicType) {
          -				// Cast item to expected type if it's type is xs:untypedAtomic
          -				if (vItem instanceof cXSUntypedAtomic)
          -					vItem	= cItemType.cast(vItem);
          -				// Cast item to xs:string if it's type is xs:anyURI
          -				else
          -				if (cItemType == cXSString/* || cItemType.prototype instanceof cXSString*/) {
          -					if (vItem instanceof cXSAnyURI)
          -						vItem	= cXSString.cast(vItem);
          -				}
          -				else
          -				if (cItemType == cXSDouble/* || cItemType.prototype instanceof cXSDouble*/) {
          -					if (fXSAnyAtomicType_isNumeric(vItem))
          -						vItem	= cItemType.cast(vItem);
          -				}
          -			}
          -			// Check type
          -			if (!(vItem instanceof cItemType))
          -				throw new cException("XPTY0004"
          -
          -				);
          -			// Write value back to sequence
          -			oSequence[nIndex]	= vItem;
          -		}
          -	}
          -};
          -
          -function fFunctionCall_assertSequenceCardinality(oContext, oSequence, sCardinality
          -
          -	) {
          -	var nLength	= oSequence.length;
          -	// Check cardinality
          -	if (sCardinality == '?') {	// =0 or 1
          -		if (nLength > 1)
          -			throw new cException("XPTY0004"
          -
          -			);
          -	}
          -	else
          -	if (sCardinality == '+') {	// =1+
          -		if (nLength < 1)
          -			throw new cException("XPTY0004"
          -
          -			);
          -	}
          -	else
          -	if (sCardinality != '*') {	// =1 ('*' =0+)
          -		if (nLength != 1)
          -			throw new cException("XPTY0004"
          -
          -			);
          -	}
          -};
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cIntersectExceptExpr(oExpr) {
          -	this.left	= oExpr;
          -	this.items	= [];
          -};
          -
          -cIntersectExceptExpr.prototype.left		= null;
          -cIntersectExceptExpr.prototype.items	= null;
          -
          -// Static members
          -function fIntersectExceptExpr_parse (oLexer, oStaticContext) {
          -	var oExpr,
          -		sOperator;
          -	if (oLexer.eof() ||!(oExpr = fInstanceofExpr_parse(oLexer, oStaticContext)))
          -		return;
          -	if (!((sOperator = oLexer.peek()) == "intersect" || sOperator == "except"))
          -		return oExpr;
          -
          -	// IntersectExcept expression
          -	var oIntersectExceptExpr	= new cIntersectExceptExpr(oExpr);
          -	while ((sOperator = oLexer.peek()) == "intersect" || sOperator == "except") {
          -		oLexer.next();
          -		if (oLexer.eof() ||!(oExpr = fInstanceofExpr_parse(oLexer, oStaticContext)))
          -			throw new cException("XPST0003"
          -
          -			);
          -		oIntersectExceptExpr.items.push([sOperator, oExpr]);
          -	}
          -	return oIntersectExceptExpr;
          -};
          -
          -// Public members
          -cIntersectExceptExpr.prototype.evaluate	= function (oContext) {
          -	var oSequence	= this.left.evaluate(oContext);
          -	for (var nIndex = 0, nLength = this.items.length, oItem; nIndex < nLength; nIndex++)
          -		oSequence	= hStaticContext_operators[(oItem = this.items[nIndex])[0]].call(oContext, oSequence, oItem[1].evaluate(oContext));
          -	return oSequence;
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cRangeExpr(oLeft, oRight) {
          -	this.left	= oLeft;
          -	this.right	= oRight;
          -};
          -
          -cRangeExpr.prototype.left	= null;
          -cRangeExpr.prototype.right	= null;
          -
          -// Static members
          -function fRangeExpr_parse (oLexer, oStaticContext) {
          -	var oExpr,
          -		oRight;
          -	if (oLexer.eof() ||!(oExpr = fAdditiveExpr_parse(oLexer, oStaticContext)))
          -		return;
          -	if (oLexer.peek() != "to")
          -		return oExpr;
          -
          -	// Range expression
          -	oLexer.next();
          -	if (oLexer.eof() ||!(oRight = fAdditiveExpr_parse(oLexer, oStaticContext)))
          -		throw new cException("XPST0003"
          -
          -		);
          -	return new cRangeExpr(oExpr, oRight);
          -};
          -
          -// Public members
          -cRangeExpr.prototype.evaluate	= function (oContext) {
          -	//
          -	var oLeft	= this.left.evaluate(oContext);
          -	if (!oLeft.length)
          -		return [];
          -	//
          -
          -
          -	fFunctionCall_assertSequenceCardinality(oContext, oLeft, '?'
          -
          -	);
          -	fFunctionCall_assertSequenceItemType(oContext, oLeft, cXSInteger
          -
          -	);
          -
          -	var oRight	= this.right.evaluate(oContext);
          -	if (!oRight.length)
          -		return [];
          -
          -
          -
          -	fFunctionCall_assertSequenceCardinality(oContext, oRight, '?'
          -
          -	);
          -	fFunctionCall_assertSequenceItemType(oContext, oRight, cXSInteger
          -
          -	);
          -
          -	return hStaticContext_operators["to"].call(oContext, oLeft[0], oRight[0]);
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cUnionExpr(oExpr) {
          -	this.left	= oExpr;
          -	this.items	= [];
          -};
          -
          -cUnionExpr.prototype.left	= null;
          -cUnionExpr.prototype.items	= null;
          -
          -// Static members
          -function fUnionExpr_parse (oLexer, oStaticContext) {
          -	var oExpr,
          -		sOperator;
          -	if (oLexer.eof() ||!(oExpr = fIntersectExceptExpr_parse(oLexer, oStaticContext)))
          -		return;
          -	if (!((sOperator = oLexer.peek()) == '|' || sOperator == "union"))
          -		return oExpr;
          -
          -	// Union expression
          -	var oUnionExpr	= new cUnionExpr(oExpr);
          -	while ((sOperator = oLexer.peek()) == '|' || sOperator == "union") {
          -		oLexer.next();
          -		if (oLexer.eof() ||!(oExpr = fIntersectExceptExpr_parse(oLexer, oStaticContext)))
          -			throw new cException("XPST0003"
          -
          -			);
          -		oUnionExpr.items.push(oExpr);
          -	}
          -	return oUnionExpr;
          -};
          -
          -// Public members
          -cUnionExpr.prototype.evaluate	= function (oContext) {
          -	var oSequence	= this.left.evaluate(oContext);
          -	for (var nIndex = 0, nLength = this.items.length; nIndex < nLength; nIndex++)
          -		oSequence	= hStaticContext_operators["union"].call(oContext, oSequence, this.items[nIndex].evaluate(oContext));
          -	return oSequence;
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cInstanceofExpr(oExpr, oType) {
          -	this.expression	= oExpr;
          -	this.type		= oType;
          -};
          -
          -cInstanceofExpr.prototype.expression	= null;
          -cInstanceofExpr.prototype.type			= null;
          -
          -function fInstanceofExpr_parse (oLexer, oStaticContext) {
          -	var oExpr,
          -		oType;
          -	if (oLexer.eof() ||!(oExpr = fTreatExpr_parse(oLexer, oStaticContext)))
          -		return;
          -
          -	if (!(oLexer.peek() == "instance" && oLexer.peek(1) == "of"))
          -		return oExpr;
          -
          -	oLexer.next(2);
          -	if (oLexer.eof() ||!(oType = fSequenceType_parse(oLexer, oStaticContext)))
          -		throw new cException("XPST0003"
          -
          -		);
          -
          -	return new cInstanceofExpr(oExpr, oType);
          -};
          -
          -cInstanceofExpr.prototype.evaluate	= function(oContext) {
          -	var oSequence1	= this.expression.evaluate(oContext),
          -		oItemType	= this.type.itemType,
          -		sOccurence	= this.type.occurence;
          -	// Validate empty-sequence()
          -	if (!oItemType)
          -		return [new cXSBoolean(!oSequence1.length)];
          -	// Validate cardinality
          -	if (!oSequence1.length)
          -		return [new cXSBoolean(sOccurence == '?' || sOccurence == '*')];
          -	if (oSequence1.length != 1)
          -		if (!(sOccurence == '+' || sOccurence == '*'))
          -			return [new cXSBoolean(false)];
          -
          -	// Validate type
          -	if (!oItemType.test)	// item()
          -		return [new cXSBoolean(true)];
          -
          -	var bValue	= true;
          -	for (var nIndex = 0, nLength = oSequence1.length; (nIndex < nLength) && bValue; nIndex++)
          -		bValue	= oItemType.test.test(oSequence1[nIndex], oContext);
          -	//
          -	return [new cXSBoolean(bValue)];
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cTreatExpr(oExpr, oType) {
          -	this.expression	= oExpr;
          -	this.type		= oType;
          -};
          -
          -cTreatExpr.prototype.expression	= null;
          -cTreatExpr.prototype.type		= null;
          -
          -function fTreatExpr_parse (oLexer, oStaticContext) {
          -	var oExpr,
          -		oType;
          -	if (oLexer.eof() ||!(oExpr = fCastableExpr_parse(oLexer, oStaticContext)))
          -		return;
          -
          -	if (!(oLexer.peek() == "treat" && oLexer.peek(1) == "as"))
          -		return oExpr;
          -
          -	oLexer.next(2);
          -	if (oLexer.eof() ||!(oType = fSequenceType_parse(oLexer, oStaticContext)))
          -		throw new cException("XPST0003"
          -
          -		);
          -
          -	return new cTreatExpr(oExpr, oType);
          -};
          -
          -cTreatExpr.prototype.evaluate	= function(oContext) {
          -	var oSequence1	= this.expression.evaluate(oContext),
          -		oItemType	= this.type.itemType,
          -		sOccurence	= this.type.occurence;
          -	// Validate empty-sequence()
          -	if (!oItemType) {
          -		if (oSequence1.length)
          -			throw new cException("XPDY0050"
          -
          -			);
          -		return oSequence1;
          -	}
          -
          -	// Validate cardinality
          -	if (!(sOccurence == '?' || sOccurence == '*'))
          -		if (!oSequence1.length)
          -			throw new cException("XPDY0050"
          -
          -			);
          -
          -	if (!(sOccurence == '+' || sOccurence == '*'))
          -		if (oSequence1.length != 1)
          -			throw new cException("XPDY0050"
          -
          -			);
          -
          -	// Validate type
          -	if (!oItemType.test)	// item()
          -		return oSequence1;
          -
          -	for (var nIndex = 0, nLength = oSequence1.length; nIndex < nLength; nIndex++)
          -		if (!oItemType.test.test(oSequence1[nIndex], oContext))
          -			throw new cException("XPDY0050"
          -
          -			);
          -
          -	//
          -	return oSequence1;
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cCastableExpr(oExpr, oType) {
          -	this.expression	= oExpr;
          -	this.type		= oType;
          -};
          -
          -cCastableExpr.prototype.expression	= null;
          -cCastableExpr.prototype.type		= null;
          -
          -function fCastableExpr_parse (oLexer, oStaticContext) {
          -	var oExpr,
          -		oType;
          -	if (oLexer.eof() ||!(oExpr = fCastExpr_parse(oLexer, oStaticContext)))
          -		return;
          -
          -	if (!(oLexer.peek() == "castable" && oLexer.peek(1) == "as"))
          -		return oExpr;
          -
          -	oLexer.next(2);
          -	if (oLexer.eof() ||!(oType = fSingleType_parse(oLexer, oStaticContext)))
          -		throw new cException("XPST0003"
          -
          -		);
          -
          -	return new cCastableExpr(oExpr, oType);
          -};
          -
          -cCastableExpr.prototype.evaluate	= function(oContext) {
          -	var oSequence1	= this.expression.evaluate(oContext),
          -		oItemType	= this.type.itemType,
          -		sOccurence	= this.type.occurence;
          -
          -	if (oSequence1.length > 1)
          -		return [new cXSBoolean(false)];
          -	else
          -	if (!oSequence1.length)
          -		return [new cXSBoolean(sOccurence == '?')];
          -
          -	// Try casting
          -	try {
          -		oItemType.cast(fFunction_sequence_atomize(oSequence1, oContext)[0]);
          -	}
          -	catch (e) {
          -		if (e.code == "XPST0051")
          -			throw e;
          -		if (e.code == "XPST0017")
          -			throw new cException("XPST0080"
          -
          -			);
          -		//
          -		return [new cXSBoolean(false)];
          -	}
          -
          -	return [new cXSBoolean(true)];
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cCastExpr(oExpr, oType) {
          -	this.expression	= oExpr;
          -	this.type		= oType;
          -};
          -
          -cCastExpr.prototype.expression	= null;
          -cCastExpr.prototype.type		= null;
          -
          -function fCastExpr_parse (oLexer, oStaticContext) {
          -	var oExpr,
          -		oType;
          -	if (oLexer.eof() ||!(oExpr = fUnaryExpr_parse(oLexer, oStaticContext)))
          -		return;
          -
          -	if (!(oLexer.peek() == "cast" && oLexer.peek(1) == "as"))
          -		return oExpr;
          -
          -	oLexer.next(2);
          -	if (oLexer.eof() ||!(oType = fSingleType_parse(oLexer, oStaticContext)))
          -		throw new cException("XPST0003"
          -
          -		);
          -
          -	return new cCastExpr(oExpr, oType);
          -};
          -
          -cCastExpr.prototype.evaluate	= function(oContext) {
          -	var oSequence1	= this.expression.evaluate(oContext);
          -	// Validate cardinality
          -	fFunctionCall_assertSequenceCardinality(oContext, oSequence1, this.type.occurence
          -
          -	);
          -	//
          -	if (!oSequence1.length)
          -		return [];
          -	//
          -	return [this.type.itemType.cast(fFunction_sequence_atomize(oSequence1, oContext)[0], oContext)];
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cAtomicType(sPrefix, sLocalName, sNameSpaceURI) {
          -	this.prefix			= sPrefix;
          -	this.localName		= sLocalName;
          -	this.namespaceURI	= sNameSpaceURI;
          -};
          -
          -cAtomicType.prototype.prefix		= null;
          -cAtomicType.prototype.localName		= null;
          -cAtomicType.prototype.namespaceURI	= null;
          -
          -function fAtomicType_parse (oLexer, oStaticContext) {
          -	var aMatch	= oLexer.peek().match(rNameTest);
          -	if (aMatch) {
          -		if (aMatch[1] == '*' || aMatch[2] == '*')
          -			throw new cException("XPST0003"
          -
          -			);
          -		oLexer.next();
          -		return new cAtomicType(aMatch[1] || null, aMatch[2], aMatch[1] ? oStaticContext.getURIForPrefix(aMatch[1]) : null);
          -	}
          -};
          -
          -cAtomicType.prototype.test	= function(vItem, oContext) {
          -	// Test
          -	var sUri	= (this.namespaceURI ? '{' + this.namespaceURI + '}' : '') + this.localName,
          -		cType	= this.namespaceURI == sNS_XSD ? hStaticContext_dataTypes[this.localName] : oContext.staticContext.getDataType(sUri);
          -	if (cType)
          -		return vItem instanceof cType;
          -	//
          -	throw new cException("XPST0051"
          -
          -	);
          -};
          -
          -cAtomicType.prototype.cast	= function(vItem, oContext) {
          -	// Cast
          -	var sUri	= (this.namespaceURI ? '{' + this.namespaceURI + '}' : '') + this.localName,
          -		cType	= this.namespaceURI == sNS_XSD ? hStaticContext_dataTypes[this.localName] : oContext.staticContext.getDataType(sUri);
          -	if (cType)
          -		return cType.cast(vItem);
          -	//
          -	throw new cException("XPST0051"
          -
          -	);
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cItemType(oTest) {
          -	this.test	= oTest;
          -};
          -
          -cItemType.prototype.test	= null;
          -
          -function fItemType_parse (oLexer, oStaticContext) {
          -	if (oLexer.eof())
          -		return;
          -
          -	var oExpr;
          -	if (oLexer.peek() == "item" && oLexer.peek(1) == '(') {
          -		oLexer.next(2);
          -		if (oLexer.peek() != ')')
          -			throw new cException("XPST0003"
          -
          -			);
          -		oLexer.next();
          -		return new cItemType;
          -	}
          -	// Note! Following step should have been before previous as per spec
          -	if (oExpr = fKindTest_parse(oLexer, oStaticContext))
          -		return new cItemType(oExpr);
          -	if (oExpr = fAtomicType_parse(oLexer, oStaticContext))
          -		return new cItemType(oExpr);
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cSequenceType(oItemType, sOccurence) {
          -	this.itemType	= oItemType	|| null;
          -	this.occurence	= sOccurence|| null;
          -};
          -
          -cSequenceType.prototype.itemType	= null;
          -cSequenceType.prototype.occurence	= null;
          -
          -function fSequenceType_parse (oLexer, oStaticContext) {
          -	if (oLexer.eof())
          -		return;
          -
          -	if (oLexer.peek() == "empty-sequence" && oLexer.peek(1) == '(') {
          -		oLexer.next(2);
          -		if (oLexer.peek() != ')')
          -			throw new cException("XPST0003"
          -
          -			);
          -		oLexer.next();
          -		return new cSequenceType;	// empty sequence
          -	}
          -
          -	var oExpr,
          -		sOccurence;
          -	if (!oLexer.eof() && (oExpr = fItemType_parse(oLexer, oStaticContext))) {
          -		sOccurence	= oLexer.peek();
          -		if (sOccurence == '?' || sOccurence == '*' || sOccurence == '+')
          -			oLexer.next();
          -		else
          -			sOccurence	= null;
          -
          -		return new cSequenceType(oExpr, sOccurence);
          -	}
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cSingleType(oItemType, sOccurence) {
          -	this.itemType	= oItemType	|| null;
          -	this.occurence	= sOccurence|| null;
          -};
          -
          -cSingleType.prototype.itemType	= null;
          -cSingleType.prototype.occurence	= null;
          -
          -function fSingleType_parse (oLexer, oStaticContext) {
          -	var oExpr,
          -		sOccurence;
          -	if (!oLexer.eof() && (oExpr = fAtomicType_parse(oLexer, oStaticContext))) {
          -		sOccurence	= oLexer.peek();
          -		if (sOccurence == '?')
          -			oLexer.next();
          -		else
          -			sOccurence	= null;
          -
          -		return new cSingleType(oExpr, sOccurence);
          -	}
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSAnyType() {
          -
          -};
          -
          -cXSAnyType.prototype.builtInKind	= cXSConstants.ANYTYPE_DT;
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSAnySimpleType() {
          -
          -};
          -
          -cXSAnySimpleType.prototype	= new cXSAnyType;
          -
          -cXSAnySimpleType.prototype.builtInKind	= cXSConstants.ANYSIMPLETYPE_DT;
          -cXSAnySimpleType.prototype.primitiveKind= null;
          -
          -cXSAnySimpleType.PRIMITIVE_ANYURI		= "anyURI";		//18;
          -cXSAnySimpleType.PRIMITIVE_BASE64BINARY	= "base64Binary";	// 17;
          -cXSAnySimpleType.PRIMITIVE_BOOLEAN		= "boolean";	// 3;
          -cXSAnySimpleType.PRIMITIVE_DATE			= "date";		// 10;
          -cXSAnySimpleType.PRIMITIVE_DATETIME		= "dateTime";	// 8;
          -cXSAnySimpleType.PRIMITIVE_DECIMAL		= "decimal";	// 4;
          -cXSAnySimpleType.PRIMITIVE_DOUBLE		= "double";		// 6;
          -cXSAnySimpleType.PRIMITIVE_DURATION		= "duration";	// 7;
          -cXSAnySimpleType.PRIMITIVE_FLOAT		= "float";		// 5;
          -cXSAnySimpleType.PRIMITIVE_GDAY			= "gDay";		// 14;
          -cXSAnySimpleType.PRIMITIVE_GMONTH		= "gMonth";		// 15;
          -cXSAnySimpleType.PRIMITIVE_GMONTHDAY	= "gMonthDay";	// 13;
          -cXSAnySimpleType.PRIMITIVE_GYEAR		= "gYear";		// 12;
          -cXSAnySimpleType.PRIMITIVE_GYEARMONTH	= "gYearMonth";	// 11;
          -cXSAnySimpleType.PRIMITIVE_HEXBINARY	= "hexBinary";	// 16;
          -cXSAnySimpleType.PRIMITIVE_NOTATION		= "NOTATION";	// 20;
          -cXSAnySimpleType.PRIMITIVE_QNAME		= "QName";		// 19;
          -cXSAnySimpleType.PRIMITIVE_STRING		= "string";		// 2;
          -cXSAnySimpleType.PRIMITIVE_TIME			= "time";		// 9;
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSAnyAtomicType() {
          -
          -};
          -
          -cXSAnyAtomicType.prototype	= new cXSAnySimpleType;
          -cXSAnyAtomicType.prototype.builtInKind	= cXSConstants.ANYATOMICTYPE_DT;
          -
          -cXSAnyAtomicType.cast	= function(vValue) {
          -	throw new cException("XPST0017"
          -
          -	);	//  {http://www.w3.org/2001/XMLSchema}anyAtomicType
          -};
          -
          -function fXSAnyAtomicType_isNumeric(vItem) {
          -	return vItem instanceof cXSFloat || vItem instanceof cXSDouble || vItem instanceof cXSDecimal;
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("anyAtomicType",	cXSAnyAtomicType);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSAnyURI(sScheme, sAuthority, sPath, sQuery, sFragment) {
          -	this.scheme		= sScheme;
          -	this.authority	= sAuthority;
          -	this.path		= sPath;
          -	this.query		= sQuery;
          -	this.fragment	= sFragment;
          -};
          -
          -cXSAnyURI.prototype	= new cXSAnyAtomicType;
          -cXSAnyURI.prototype.builtInKind		= cXSConstants.ANYURI_DT;
          -cXSAnyURI.prototype.primitiveKind	= cXSAnySimpleType.PRIMITIVE_ANYURI;
          -
          -cXSAnyURI.prototype.scheme		= null;
          -cXSAnyURI.prototype.authority	= null;
          -cXSAnyURI.prototype.path		= null;
          -cXSAnyURI.prototype.query		= null;
          -cXSAnyURI.prototype.fragment	= null;
          -
          -cXSAnyURI.prototype.toString	= function() {
          -	return (this.scheme ? this.scheme + ':' : '')
          -			+ (this.authority ? '/' + '/' + this.authority : '')
          -			+ (this.path ? this.path : '')
          -			+ (this.query ? '?' + this.query : '')
          -			+ (this.fragment ? '#' + this.fragment : '');
          -};
          -
          -var rXSAnyURI	= /^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;	// http://tools.ietf.org/html/rfc3986
          -cXSAnyURI.cast	= function(vValue) {
          -	if (vValue instanceof cXSAnyURI)
          -		return vValue;
          -	if (vValue instanceof cXSString || vValue instanceof cXSUntypedAtomic) {
          -		var aMatch;
          -		if (aMatch = fString_trim(vValue).match(rXSAnyURI))
          -			return new cXSAnyURI(aMatch[2], aMatch[4], aMatch[5], aMatch[7], aMatch[9]);
          -		throw new cException("FORG0001");
          -	}
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("anyURI",	cXSAnyURI);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSBase64Binary(sValue) {
          -	this.value	= sValue;
          -};
          -
          -cXSBase64Binary.prototype	= new cXSAnyAtomicType;
          -cXSBase64Binary.prototype.builtInKind	= cXSConstants.BASE64BINARY_DT;
          -cXSBase64Binary.prototype.primitiveKind	= cXSAnySimpleType.PRIMITIVE_BASE64BINARY;
          -
          -cXSBase64Binary.prototype.value	= null;
          -
          -cXSBase64Binary.prototype.valueOf	= function() {
          -	return this.value;
          -};
          -
          -cXSBase64Binary.prototype.toString	= function() {
          -	return this.value;
          -};
          -
          -var rXSBase64Binary		= /^((([A-Za-z0-9+\/]\s*){4})*(([A-Za-z0-9+\/]\s*){3}[A-Za-z0-9+\/]|([A-Za-z0-9+\/]\s*){2}[AEIMQUYcgkosw048]\s*=|[A-Za-z0-9+\/]\s*[AQgw]\s*=\s*=))?$/;
          -cXSBase64Binary.cast	= function(vValue) {
          -	if (vValue instanceof cXSBase64Binary)
          -		return vValue;
          -	if (vValue instanceof cXSString || vValue instanceof cXSUntypedAtomic) {
          -		var aMatch	= fString_trim(vValue).match(rXSBase64Binary);
          -		if (aMatch)
          -			return new cXSBase64Binary(aMatch[0]);
          -		throw new cException("FORG0001");
          -	}
          -	if (vValue instanceof cXSHexBinary) {
          -		var aMatch	= vValue.valueOf().match(/.{2}/g),
          -			aValue	= [];
          -		for (var nIndex = 0, nLength = aMatch.length; nIndex < nLength; nIndex++)
          -			aValue.push(cString.fromCharCode(fWindow_parseInt(aMatch[nIndex], 16)));
          -		return new cXSBase64Binary(fWindow_btoa(aValue.join('')));
          -	}
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("base64Binary",	cXSBase64Binary);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSBoolean(bValue) {
          -	this.value	= bValue;
          -};
          -
          -cXSBoolean.prototype	= new cXSAnyAtomicType;
          -cXSBoolean.prototype.builtInKind	= cXSConstants.BOOLEAN_DT;
          -cXSBoolean.prototype.primitiveKind	= cXSAnySimpleType.PRIMITIVE_BOOLEAN;
          -
          -cXSBoolean.prototype.value	= null;
          -
          -cXSBoolean.prototype.valueOf	= function() {
          -	return this.value;
          -};
          -
          -cXSBoolean.prototype.toString	= function() {
          -	return cString(this.value);
          -};
          -
          -var rXSBoolean	= /^(0|1|true|false)$/;
          -cXSBoolean.cast	= function(vValue) {
          -	if (vValue instanceof cXSBoolean)
          -		return vValue;
          -	if (vValue instanceof cXSString || vValue instanceof cXSUntypedAtomic) {
          -		var aMatch;
          -		if (aMatch = fString_trim(vValue).match(rXSBoolean))
          -			return new cXSBoolean(aMatch[1] == '1' || aMatch[1] == "true");
          -		throw new cException("FORG0001");
          -	}
          -	if (fXSAnyAtomicType_isNumeric(vValue))
          -		return new cXSBoolean(vValue != 0);
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("boolean",	cXSBoolean);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSDate(nYear, nMonth, nDay, nTimezone, bNegative) {
          -	this.year		= nYear;
          -	this.month		= nMonth;
          -	this.day		= nDay;
          -	this.timezone	= nTimezone;
          -	this.negative	= bNegative;
          -};
          -
          -cXSDate.prototype	= new cXSAnyAtomicType;
          -cXSDate.prototype.builtInKind	= cXSConstants.DATE_DT;
          -cXSDate.prototype.primitiveKind	= cXSAnySimpleType.PRIMITIVE_DATE;
          -
          -cXSDate.prototype.year		= null;
          -cXSDate.prototype.month		= null;
          -cXSDate.prototype.day		= null;
          -cXSDate.prototype.timezone	= null;
          -cXSDate.prototype.negative	= null;
          -
          -cXSDate.prototype.toString	= function() {
          -	return fXSDateTime_getDateComponent(this)
          -			+ fXSDateTime_getTZComponent(this);
          -};
          -
          -var rXSDate		= /^(-?)([1-9]\d\d\d+|0\d\d\d)-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])(Z|([+\-])(0\d|1[0-4]):([0-5]\d))?$/;
          -cXSDate.cast	= function(vValue) {
          -	if (vValue instanceof cXSDate)
          -		return vValue;
          -	if (vValue instanceof cXSString || vValue instanceof cXSUntypedAtomic) {
          -		var aMatch	= fString_trim(vValue).match(rXSDate);
          -		if (aMatch) {
          -			var nYear	= +aMatch[2],
          -				nMonth	= +aMatch[3],
          -				nDay	= +aMatch[4];
          -			if (nDay - 1 < fXSDate_getDaysForYearMonth(nYear, nMonth))
          -				return new cXSDate( nYear,
          -									nMonth,
          -									nDay,
          -									aMatch[5] ? aMatch[5] == 'Z' ? 0 : (aMatch[6] == '-' ? -1 : 1) * (aMatch[7] * 60 + aMatch[8] * 1) : null,
          -									aMatch[1] == '-'
          -				);
          -			//
          -			throw new cException("FORG0001"
          -
          -			);
          -		}
          -		throw new cException("FORG0001");
          -	}
          -	if (vValue instanceof cXSDateTime)
          -		return new cXSDate(vValue.year, vValue.month, vValue.day, vValue.timezone, vValue.negative);
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);
          -};
          -
          -// Utilities
          -var aXSDate_days	= [31,28,31,30,31,30,31,31,30,31,30,31];
          -function fXSDate_getDaysForYearMonth(nYear, nMonth) {
          -	return nMonth == 2 && (nYear % 400 == 0 || nYear % 100 != 0 && nYear % 4 == 0) ? 29 : aXSDate_days[nMonth - 1];
          -};
          -
          -function fXSDate_normalize(oValue, bDay) {
          -	// Adjust day for month/year
          -	if (!bDay) {
          -		var nDay	= fXSDate_getDaysForYearMonth(oValue.year, oValue.month);
          -		if (oValue.day > nDay) {
          -			while (oValue.day > nDay) {
          -				oValue.month	+= 1;
          -				if (oValue.month > 12) {
          -					oValue.year		+= 1;
          -					if (oValue.year == 0)
          -						oValue.year	= 1;
          -					oValue.month	= 1;
          -				}
          -				oValue.day	-= nDay;
          -				nDay = fXSDate_getDaysForYearMonth(oValue.year, oValue.month);
          -			}
          -		}
          -		else
          -		if (oValue.day < 1) {
          -			while (oValue.day < 1) {
          -				oValue.month	-= 1;
          -				if (oValue.month < 1) {
          -					oValue.year		-= 1;
          -					if (oValue.year == 0)
          -						oValue.year	=-1;
          -					oValue.month	= 12;
          -				}
          -				nDay = fXSDate_getDaysForYearMonth(oValue.year, oValue.month);
          -				oValue.day	+= nDay;
          -			}
          -		}
          -	}
          -//?	else
          -	// Adjust month
          -	if (oValue.month > 12) {
          -		oValue.year		+= ~~(oValue.month / 12);
          -		if (oValue.year == 0)
          -			oValue.year	= 1;
          -		oValue.month	= oValue.month % 12;
          -	}
          -	else
          -	if (oValue.month < 1) {
          -		oValue.year		+= ~~(oValue.month / 12) - 1;
          -		if (oValue.year == 0)
          -			oValue.year	=-1;
          -		oValue.month	= oValue.month % 12 + 12;
          -	}
          -
          -	return oValue;
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("date",	cXSDate);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSDateTime(nYear, nMonth, nDay, nHours, nMinutes, nSeconds, nTimezone, bNegative) {
          -	this.year	= nYear;
          -	this.month	= nMonth;
          -	this.day	= nDay;
          -	this.hours	= nHours;
          -	this.minutes	= nMinutes;
          -	this.seconds	= nSeconds;
          -	this.timezone	= nTimezone;
          -	this.negative	= bNegative;
          -};
          -
          -cXSDateTime.prototype	= new cXSAnyAtomicType;
          -cXSDateTime.prototype.builtInKind	= cXSConstants.DATETIME_DT;
          -cXSDateTime.prototype.primitiveKind	= cXSAnySimpleType.PRIMITIVE_DATETIME;
          -
          -cXSDateTime.prototype.year		= null;
          -cXSDateTime.prototype.month		= null;
          -cXSDateTime.prototype.day		= null;
          -cXSDateTime.prototype.hours		= null;
          -cXSDateTime.prototype.minutes	= null;
          -cXSDateTime.prototype.seconds	= null;
          -cXSDateTime.prototype.timezone	= null;
          -cXSDateTime.prototype.negative	= null;
          -
          -cXSDateTime.prototype.toString	= function() {
          -	return fXSDateTime_getDateComponent(this)
          -			+ 'T'
          -			+ fXSDateTime_getTimeComponent(this)
          -			+ fXSDateTime_getTZComponent(this);
          -};
          -
          -var rXSDateTime		= /^(-?)([1-9]\d\d\d+|0\d\d\d)-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])T(([01]\d|2[0-3]):([0-5]\d):([0-5]\d)(?:\.(\d+))?|(24:00:00)(?:\.(0+))?)(Z|([+\-])(0\d|1[0-4]):([0-5]\d))?$/;
          -cXSDateTime.cast	= function(vValue) {
          -	if (vValue instanceof cXSDateTime)
          -		return vValue;
          -	if (vValue instanceof cXSString || vValue instanceof cXSUntypedAtomic) {
          -		var aMatch	= fString_trim(vValue).match(rXSDateTime);
          -		if (aMatch) {
          -			var nYear	= +aMatch[2],
          -				nMonth	= +aMatch[3],
          -				nDay	= +aMatch[4],
          -				bValue	= !!aMatch[10];
          -			if (nDay - 1 < fXSDate_getDaysForYearMonth(nYear, nMonth))
          -				return fXSDateTime_normalize(new cXSDateTime( nYear,
          -										nMonth,
          -										nDay,
          -										bValue ? 24 : +aMatch[6],
          -										bValue ? 0 : +aMatch[7],
          -										cNumber((bValue ? 0 : aMatch[8]) + '.' + (bValue ? 0 : aMatch[9] || 0)),
          -										aMatch[12] ? aMatch[12] == 'Z' ? 0 : (aMatch[13] == '-' ? -1 : 1) * (aMatch[14] * 60 + aMatch[15] * 1) : null,
          -										aMatch[1] == '-'
          -				));
          -			//
          -			throw new cException("FORG0001"
          -
          -			);
          -		}
          -		throw new cException("FORG0001");
          -	}
          -	if (vValue instanceof cXSDate)
          -		return new cXSDateTime(vValue.year, vValue.month, vValue.day, 0, 0, 0, vValue.timezone, vValue.negative);
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);
          -};
          -
          -// Utilities
          -function fXSDateTime_pad(vValue, nLength) {
          -	var sValue	= cString(vValue);
          -	if (arguments.length < 2)
          -		nLength	= 2;
          -	return (sValue.length < nLength + 1 ? new cArray(nLength + 1 - sValue.length).join('0') : '') + sValue;
          -};
          -
          -function fXSDateTime_getTZComponent(oDateTime) {
          -	var nTimezone	= oDateTime.timezone;
          -	return nTimezone == null
          -			? ''
          -			: nTimezone
          -				? (nTimezone > 0 ? '+' : '-')
          -					+ fXSDateTime_pad(cMath.abs(~~(nTimezone / 60)))
          -					+ ':'
          -					+ fXSDateTime_pad(cMath.abs(nTimezone % 60))
          -				: 'Z';
          -};
          -
          -function fXSDateTime_getDateComponent(oDateTime) {
          -	return (oDateTime.negative ? '-' : '')
          -			+ fXSDateTime_pad(oDateTime.year, 4)
          -			+ '-' + fXSDateTime_pad(oDateTime.month)
          -			+ '-' + fXSDateTime_pad(oDateTime.day);
          -};
          -
          -function fXSDateTime_getTimeComponent(oDateTime) {
          -	var aValue	= cString(oDateTime.seconds).split('.');
          -	return fXSDateTime_pad(oDateTime.hours)
          -			+ ':' + fXSDateTime_pad(oDateTime.minutes)
          -			+ ':' + fXSDateTime_pad(aValue[0])
          -			+ (aValue.length > 1 ? '.' + aValue[1] : '');
          -};
          -
          -function fXSDateTime_normalize(oValue) {
          -	return fXSDate_normalize(fXSTime_normalize(oValue));
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("dateTime",	cXSDateTime);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSDecimal(nValue) {
          -	this.value	= nValue;
          -};
          -
          -cXSDecimal.prototype	= new cXSAnyAtomicType;
          -cXSDecimal.prototype.builtInKind	= cXSConstants.DECIMAL_DT;
          -cXSDecimal.prototype.primitiveKind	= cXSAnySimpleType.PRIMITIVE_DECIMAL;
          -
          -cXSDecimal.prototype.value	= null;
          -
          -cXSDecimal.prototype.valueOf	= function() {
          -	return this.value;
          -};
          -
          -cXSDecimal.prototype.toString	= function() {
          -	return cString(this.value);
          -};
          -
          -var rXSDecimal	= /^[+\-]?((\d+(\.\d*)?)|(\.\d+))$/;
          -cXSDecimal.cast	= function(vValue) {
          -	if (vValue instanceof cXSDecimal)
          -		return vValue;
          -	if (vValue instanceof cXSString || vValue instanceof cXSUntypedAtomic) {
          -		var aMatch	= fString_trim(vValue).match(rXSDecimal);
          -		if (aMatch)
          -			return new cXSDecimal(+vValue);
          -		throw new cException("FORG0001");
          -	}
          -	if (vValue instanceof cXSBoolean)
          -		return new cXSDecimal(vValue * 1);
          -	if (fXSAnyAtomicType_isNumeric(vValue)) {
          -		if (!fIsNaN(vValue) && fIsFinite(vValue))
          -			return new cXSDecimal(+vValue);
          -		throw new cException("FOCA0002"
          -
          -		);
          -	}
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("decimal",	cXSDecimal);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSDouble(nValue) {
          -	this.value	= nValue;
          -};
          -
          -cXSDouble.prototype	= new cXSAnyAtomicType;
          -cXSDouble.prototype.builtInKind		= cXSConstants.DOUBLE_DT;
          -cXSDouble.prototype.primitiveKind	= cXSAnySimpleType.PRIMITIVE_DOUBLE;
          -
          -cXSDouble.prototype.value	= null;
          -
          -cXSDouble.prototype.valueOf	= function() {
          -	return this.value;
          -};
          -
          -cXSDouble.prototype.toString	= function() {
          -	return cString(this.value);
          -};
          -
          -var rXSDouble	= /^([+\-]?((\d+(\.\d*)?)|(\.\d+))([eE][+\-]?\d+)?|(-?INF)|NaN)$/;
          -cXSDouble.cast	= function(vValue) {
          -	if (vValue instanceof cXSDouble)
          -		return vValue;
          -	if (vValue instanceof cXSString || vValue instanceof cXSUntypedAtomic) {
          -		var aMatch	= fString_trim(vValue).match(rXSDouble);
          -		if (aMatch)
          -			return new cXSDouble(aMatch[7] ? +aMatch[7].replace("INF", "Infinity") : +vValue);
          -		throw new cException("FORG0001");
          -	}
          -	if (vValue instanceof cXSBoolean)
          -		return new cXSDouble(vValue * 1);
          -	if (fXSAnyAtomicType_isNumeric(vValue))
          -		return new cXSDouble(vValue.value);
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("double",	cXSDouble);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSDuration(nYear, nMonth, nDay, nHours, nMinutes, nSeconds, bNegative) {
          -	this.year	= nYear;
          -	this.month	= nMonth;
          -	this.day	= nDay;
          -	this.hours	= nHours;
          -	this.minutes	= nMinutes;
          -	this.seconds	= nSeconds;
          -	this.negative	= bNegative;
          -};
          -
          -cXSDuration.prototype	= new cXSAnyAtomicType;
          -cXSDuration.prototype.builtInKind	= cXSConstants.DURATION_DT;
          -cXSDuration.prototype.primitiveKind	= cXSAnySimpleType.PRIMITIVE_DURATION;
          -
          -cXSDuration.prototype.year		= null;
          -cXSDuration.prototype.month		= null;
          -cXSDuration.prototype.day		= null;
          -cXSDuration.prototype.hours		= null;
          -cXSDuration.prototype.minutes	= null;
          -cXSDuration.prototype.seconds	= null;
          -cXSDuration.prototype.negative	= null;
          -
          -cXSDuration.prototype.toString	= function() {
          -	return (this.negative ? '-' : '') + 'P'
          -			+ ((fXSDuration_getYearMonthComponent(this) + fXSDuration_getDayTimeComponent(this)) || 'T0S');
          -};
          -
          -var rXSDuration		= /^(-)?P(?:([0-9]+)Y)?(?:([0-9]+)M)?(?:([0-9]+)D)?(?:T(?:([0-9]+)H)?(?:([0-9]+)M)?(?:((?:(?:[0-9]+(?:.[0-9]*)?)|(?:.[0-9]+)))S)?)?$/;
          -cXSDuration.cast	= function(vValue) {
          -	if (vValue instanceof cXSDuration)
          -		return vValue;
          -	if (vValue instanceof cXSYearMonthDuration)
          -		return new cXSDuration(vValue.year, vValue.month, 0, 0, 0, 0, vValue.negative);
          -	if (vValue instanceof cXSDayTimeDuration)
          -		return new cXSDuration(0, 0, vValue.day, vValue.hours, vValue.minutes, vValue.seconds, vValue.negative);
          -	if (vValue instanceof cXSString || vValue instanceof cXSUntypedAtomic) {
          -		var aMatch	= fString_trim(vValue).match(rXSDuration);
          -		if (aMatch)
          -			return fXSDuration_normalize(new cXSDuration(+aMatch[2] || 0, +aMatch[3] || 0, +aMatch[4] || 0, +aMatch[5] || 0, +aMatch[6] || 0, +aMatch[7] || 0, aMatch[1] == '-'));
          -		throw new cException("FORG0001");
          -	}
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);
          -};
          -
          -// Utilities
          -function fXSDuration_getYearMonthComponent(oDuration) {
          -	return (oDuration.year ? oDuration.year + 'Y' : '')
          -			+ (oDuration.month ? oDuration.month + 'M' : '');
          -};
          -
          -function fXSDuration_getDayTimeComponent(oDuration) {
          -	return (oDuration.day ? oDuration.day + 'D' : '')
          -			+ (oDuration.hours || oDuration.minutes || oDuration.seconds
          -				? 'T'
          -					+ (oDuration.hours ? oDuration.hours + 'H' : '')
          -					+ (oDuration.minutes ? oDuration.minutes + 'M' : '')
          -					+ (oDuration.seconds ? oDuration.seconds + 'S' : '')
          -				: '');
          -};
          -
          -function fXSDuration_normalize(oDuration) {
          -	return fXSYearMonthDuration_normalize(fXSDayTimeDuration_normalize(oDuration));
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("duration",	cXSDuration);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSFloat(nValue) {
          -	this.value	= nValue;
          -};
          -
          -cXSFloat.prototype	= new cXSAnyAtomicType;
          -cXSFloat.prototype.builtInKind		= cXSConstants.FLOAT_DT;
          -cXSFloat.prototype.primitiveKind	= cXSAnySimpleType.PRIMITIVE_FLOAT;
          -
          -cXSFloat.prototype.value	= null;
          -
          -cXSFloat.prototype.valueOf	= function() {
          -	return this.value;
          -};
          -
          -cXSFloat.prototype.toString	= function() {
          -	return cString(this.value);
          -};
          -
          -var rXSFloat	= /^([+\-]?((\d+(\.\d*)?)|(\.\d+))([eE][+\-]?\d+)?|(-?INF)|NaN)$/;
          -cXSFloat.cast	= function(vValue) {
          -	if (vValue instanceof cXSFloat)
          -		return vValue;
          -	if (vValue instanceof cXSString || vValue instanceof cXSUntypedAtomic) {
          -		var aMatch	= fString_trim(vValue).match(rXSFloat);
          -		if (aMatch)
          -			return new cXSFloat(aMatch[7] ? +aMatch[7].replace("INF", "Infinity") : +vValue);
          -		throw new cException("FORG0001");
          -	}
          -	if (vValue instanceof cXSBoolean)
          -		return new cXSFloat(vValue * 1);
          -	if (fXSAnyAtomicType_isNumeric(vValue))
          -		return new cXSFloat(vValue.value);
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("float",	cXSFloat);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSGDay(nDay, nTimezone) {
          -	this.day		= nDay;
          -	this.timezone	= nTimezone;
          -};
          -
          -cXSGDay.prototype	= new cXSAnyAtomicType;
          -cXSGDay.prototype.builtInKind	= cXSConstants.GDAY_DT;
          -cXSGDay.prototype.primitiveKind	= cXSAnySimpleType.PRIMITIVE_GDAY;
          -
          -cXSGDay.prototype.day		= null;
          -cXSGDay.prototype.timezone	= null;
          -
          -cXSGDay.prototype.toString	= function() {
          -	return '-'
          -			+ '-'
          -			+ '-' + fXSDateTime_pad(this.day)
          -			+ fXSDateTime_getTZComponent(this);
          -};
          -
          -var rXSGDay		= /^---(0[1-9]|[12]\d|3[01])(Z|([+\-])(0\d|1[0-4]):([0-5]\d))?$/;
          -cXSGDay.cast	= function(vValue) {
          -	if (vValue instanceof cXSGDay)
          -		return vValue;
          -	if (vValue instanceof cXSString || vValue instanceof cXSUntypedAtomic) {
          -		var aMatch	= fString_trim(vValue).match(rXSGDay);
          -		if (aMatch) {
          -			var nDay	= +aMatch[1];
          -			return new cXSGDay(	nDay,
          -								aMatch[2] ? aMatch[2] == 'Z' ? 0 : (aMatch[3] == '-' ? -1 : 1) * (aMatch[4] * 60 + aMatch[5] * 1) : null
          -			);
          -		}
          -		throw new cException("FORG0001");
          -	}
          -	if (vValue instanceof cXSDate || vValue instanceof cXSDateTime)
          -		return new cXSGDay(vValue.day, vValue.timezone);
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("gDay",	cXSGDay);
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSGMonth(nMonth, nTimezone) {
          -	this.month		= nMonth;
          -	this.timezone	= nTimezone;
          -};
          -
          -cXSGMonth.prototype	= new cXSAnyAtomicType;
          -cXSGMonth.prototype.builtInKind		= cXSConstants.GMONTH_DT;
          -cXSGMonth.prototype.primitiveKind	= cXSAnySimpleType.PRIMITIVE_GMONTH;
          -
          -cXSGMonth.prototype.month		= null;
          -cXSGMonth.prototype.timezone	= null;
          -
          -cXSGMonth.prototype.toString	= function() {
          -	return '-'
          -			+ '-' + fXSDateTime_pad(this.month)
          -			+ fXSDateTime_getTZComponent(this);
          -};
          -
          -var rXSGMonth	= /^--(0[1-9]|1[0-2])(Z|([+\-])(0\d|1[0-4]):([0-5]\d))?$/;
          -cXSGMonth.cast	= function(vValue) {
          -	if (vValue instanceof cXSGMonth)
          -		return vValue;
          -	if (vValue instanceof cXSString || vValue instanceof cXSUntypedAtomic) {
          -		var aMatch	= fString_trim(vValue).match(rXSGMonth);
          -		if (aMatch) {
          -			var nMonth	= +aMatch[1];
          -			return new cXSGMonth(	nMonth,
          -									aMatch[2] ? aMatch[2] == 'Z' ? 0 : (aMatch[3] == '-' ? -1 : 1) * (aMatch[4] * 60 + aMatch[5] * 1) : null
          -			);
          -		}
          -		throw new cException("FORG0001");
          -	}
          -	if (vValue instanceof cXSDate || vValue instanceof cXSDateTime)
          -		return new cXSGMonth(vValue.month, vValue.timezone);
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("gMonth",	cXSGMonth);
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSGMonthDay(nMonth, nDay, nTimezone) {
          -	this.month		= nMonth;
          -	this.day		= nDay;
          -	this.timezone	= nTimezone;
          -};
          -
          -cXSGMonthDay.prototype	= new cXSAnyAtomicType;
          -cXSGMonthDay.prototype.builtInKind		= cXSConstants.GMONTHDAY_DT;
          -cXSGMonthDay.prototype.primitiveKind	= cXSAnySimpleType.PRIMITIVE_GMONTHDAY;
          -
          -cXSGMonthDay.prototype.month	= null;
          -cXSGMonthDay.prototype.day		= null;
          -cXSGMonthDay.prototype.timezone	= null;
          -
          -cXSGMonthDay.prototype.toString	= function() {
          -	return '-'
          -			+ '-' + fXSDateTime_pad(this.month)
          -			+ '-' + fXSDateTime_pad(this.day)
          -			+ fXSDateTime_getTZComponent(this);
          -};
          -
          -var rXSGMonthDay	= /^--(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])(Z|([+\-])(0\d|1[0-4]):([0-5]\d))?$/;
          -cXSGMonthDay.cast	= function(vValue) {
          -	if (vValue instanceof cXSGMonthDay)
          -		return vValue;
          -	if (vValue instanceof cXSString || vValue instanceof cXSUntypedAtomic) {
          -		var aMatch	= fString_trim(vValue).match(rXSGMonthDay);
          -		if (aMatch) {
          -			var nMonth	= +aMatch[1],
          -				nDay	= +aMatch[2];
          -			if (nDay - 1 < fXSDate_getDaysForYearMonth(1976, nMonth))
          -				return new cXSGMonthDay(	nMonth,
          -											nDay,
          -											aMatch[3] ? aMatch[3] == 'Z' ? 0 : (aMatch[4] == '-' ? -1 : 1) * (aMatch[5] * 60 + aMatch[6] * 1) : null
          -				);
          -			//
          -			throw new cException("FORG0001"
          -
          -			);
          -		}
          -		throw new cException("FORG0001");
          -	}
          -	if (vValue instanceof cXSDate || vValue instanceof cXSDateTime)
          -		return new cXSGMonthDay(vValue.month, vValue.day, vValue.timezone);
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("gMonthDay",	cXSGMonthDay);
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSGYear(nYear, nTimezone) {
          -	this.year	= nYear;
          -	this.timezone	= nTimezone;
          -};
          -
          -cXSGYear.prototype	= new cXSAnyAtomicType;
          -cXSGYear.prototype.builtInKind		= cXSConstants.GYEAR_DT;
          -cXSGYear.prototype.primitiveKind	= cXSAnySimpleType.PRIMITIVE_GYEAR;
          -
          -cXSGYear.prototype.year		= null;
          -cXSGYear.prototype.timezone	= null;
          -
          -cXSGYear.prototype.toString	= function() {
          -	return fXSDateTime_pad(this.year)
          -			+ fXSDateTime_getTZComponent(this);
          -};
          -
          -var rXSGYear		= /^-?([1-9]\d\d\d+|0\d\d\d)(Z|([+\-])(0\d|1[0-4]):([0-5]\d))?$/;
          -cXSGYear.cast	= function(vValue) {
          -	if (vValue instanceof cXSGYear)
          -		return vValue;
          -	if (vValue instanceof cXSString || vValue instanceof cXSUntypedAtomic) {
          -		var aMatch	= fString_trim(vValue).match(rXSGYear);
          -		if (aMatch) {
          -			var nYear	= +aMatch[1];
          -			return new cXSGYear(	nYear,
          -									aMatch[2] ? aMatch[2] == 'Z' ? 0 : (aMatch[3] == '-' ? -1 : 1) * (aMatch[4] * 60 + aMatch[5] * 1) : null
          -			);
          -		}
          -		throw new cException("FORG0001");
          -	}
          -	if (vValue instanceof cXSDate || vValue instanceof cXSDateTime)
          -		return new cXSGYear(vValue.year, vValue.timezone);
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("gYear",	cXSGYear);
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSGYearMonth(nYear, nMonth, nTimezone) {
          -	this.year		= nYear;
          -	this.month		= nMonth;
          -	this.timezone	= nTimezone;
          -};
          -
          -cXSGYearMonth.prototype	= new cXSAnyAtomicType;
          -cXSGYearMonth.prototype.builtInKind		= cXSConstants.GYEARMONTH_DT;
          -cXSGYearMonth.prototype.primitiveKind	= cXSAnySimpleType.PRIMITIVE_GYEARMONTH;
          -
          -cXSGYearMonth.prototype.year	= null;
          -cXSGYearMonth.prototype.month	= null;
          -cXSGYearMonth.prototype.timezone= null;
          -
          -cXSGYearMonth.prototype.toString	= function() {
          -	return fXSDateTime_pad(this.year)
          -			+ '-' + fXSDateTime_pad(this.month)
          -			+ fXSDateTime_getTZComponent(this);
          -};
          -
          -var rXSGYearMonth	= /^-?([1-9]\d\d\d+|0\d\d\d)-(0[1-9]|1[0-2])(Z|([+\-])(0\d|1[0-4]):([0-5]\d))?$/;
          -cXSGYearMonth.cast	= function(vValue) {
          -	if (vValue instanceof cXSGYearMonth)
          -		return vValue;
          -	if (vValue instanceof cXSString || vValue instanceof cXSUntypedAtomic) {
          -		var aMatch	= fString_trim(vValue).match(rXSGYearMonth);
          -		if (aMatch) {
          -			var nYear	= +aMatch[1],
          -				nMonth	= +aMatch[2];
          -			return new cXSGYearMonth(	nYear,
          -										nMonth,
          -										aMatch[3] ? aMatch[3] == 'Z' ? 0 : (aMatch[4] == '-' ? -1 : 1) * (aMatch[5] * 60 + aMatch[6] * 1) : null
          -			);
          -		}
          -		throw new cException("FORG0001");
          -	}
          -	if (vValue instanceof cXSDate || vValue instanceof cXSDateTime)
          -		return new cXSGYearMonth(vValue.year, vValue.month, vValue.timezone);
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("gYearMonth",	cXSGYearMonth);
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSHexBinary(sValue) {
          -	this.value	= sValue;
          -};
          -
          -cXSHexBinary.prototype	= new cXSAnyAtomicType;
          -cXSHexBinary.prototype.builtInKind		= cXSConstants.HEXBINARY_DT;
          -cXSHexBinary.prototype.primitiveKind	= cXSAnySimpleType.PRIMITIVE_HEXBINARY;
          -
          -cXSHexBinary.prototype.value	= null;
          -
          -cXSHexBinary.prototype.valueOf	= function() {
          -	return this.value;
          -};
          -
          -cXSHexBinary.prototype.toString	= function() {
          -	return this.value;
          -};
          -
          -var rXSHexBinary	= /^([0-9a-fA-F]{2})*$/;
          -cXSHexBinary.cast	= function(vValue) {
          -	if (vValue instanceof cXSHexBinary)
          -		return vValue;
          -	if (vValue instanceof cXSString || vValue instanceof cXSUntypedAtomic) {
          -		var aMatch	= fString_trim(vValue).match(rXSHexBinary);
          -		if (aMatch)
          -			return new cXSHexBinary(aMatch[0].toUpperCase());
          -		throw new cException("FORG0001");
          -	}
          -	if (vValue instanceof cXSBase64Binary) {
          -		var sValue	= fWindow_atob(vValue.valueOf()),
          -			aValue	= [];
          -		for (var nIndex = 0, nLength = sValue.length, sLetter; nIndex < nLength; nIndex++) {
          -			sLetter = sValue.charCodeAt(nIndex).toString(16);
          -			aValue.push(new cArray(3 - sLetter.length).join('0') + sLetter);
          -		}
          -		return new cXSHexBinary(aValue.join(''));
          -	}
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("hexBinary",	cXSHexBinary);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSNOTATION() {
          -
          -};
          -
          -cXSNOTATION.prototype	= new cXSAnyAtomicType;
          -cXSNOTATION.prototype.builtInKind	= cXSConstants.NOTATION_DT;
          -cXSNOTATION.prototype.primitiveKind	= cXSAnySimpleType.PRIMITIVE_NOTATION;
          -
          -cXSNOTATION.cast	= function(vValue) {
          -	throw new cException("XPST0017"
          -
          -	);	//  {http://www.w3.org/2001/XMLSchema}NOTATION
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("NOTATION",	cXSNOTATION);
          -
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSQName(sPrefix, sLocalName, sNameSpaceURI) {
          -	this.prefix	= sPrefix;
          -	this.localName	= sLocalName;
          -	this.namespaceURI	= sNameSpaceURI;
          -};
          -
          -cXSQName.prototype	= new cXSAnyAtomicType;
          -cXSQName.prototype.builtInKind		= cXSConstants.QNAME_DT;
          -cXSQName.prototype.primitiveKind	= cXSAnySimpleType.PRIMITIVE_QNAME;
          -
          -cXSQName.prototype.prefix	= null;
          -cXSQName.prototype.localName	= null;
          -cXSQName.prototype.namespaceURI	= null;
          -
          -cXSQName.prototype.toString	= function() {
          -	return (this.prefix ? this.prefix + ':' : '') + this.localName;
          -};
          -
          -var rXSQName	= /^(?:(?![0-9-])(\w[\w.-]*)\:)?(?![0-9-])(\w[\w.-]*)$/;
          -cXSQName.cast	= function(vValue) {
          -	if (vValue instanceof cXSQName)
          -		return vValue;
          -	if (vValue instanceof cXSString || vValue instanceof cXSUntypedAtomic) {
          -		var aMatch	= fString_trim(vValue).match(rXSQName);
          -		if (aMatch)
          -			return new cXSQName(aMatch[1] || null, aMatch[2], null);
          -		throw new cException("FORG0001");
          -	}
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("QName",	cXSQName);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSString(sValue) {
          -	this.value	= sValue;
          -};
          -
          -cXSString.prototype	= new cXSAnyAtomicType;
          -
          -cXSString.prototype.value	= null;
          -cXSString.prototype.builtInKind		= cXSConstants.STRING_DT;
          -cXSString.prototype.primitiveKind	= cXSAnySimpleType.PRIMITIVE_STRING;
          -
          -cXSString.prototype.valueOf		= function() {
          -	return this.value;
          -};
          -
          -cXSString.prototype.toString	= function() {
          -	return this.value;
          -};
          -
          -cXSString.cast	= function(vValue) {
          -	return new cXSString(cString(vValue));
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("string",	cXSString);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSTime(nHours, nMinutes, nSeconds, nTimezone) {
          -	this.hours	= nHours;
          -	this.minutes	= nMinutes;
          -	this.seconds	= nSeconds;
          -	this.timezone	= nTimezone;
          -};
          -
          -cXSTime.prototype	= new cXSAnyAtomicType;
          -cXSTime.prototype.builtInKind	= cXSConstants.TIME_DT;
          -cXSTime.prototype.primitiveKind	= cXSAnySimpleType.PRIMITIVE_TIME;
          -
          -cXSTime.prototype.hours		= null;
          -cXSTime.prototype.minutes	= null;
          -cXSTime.prototype.seconds	= null;
          -cXSTime.prototype.timezone		= null;
          -
          -cXSTime.prototype.toString	= function() {
          -	return fXSDateTime_getTimeComponent(this)
          -			+ fXSDateTime_getTZComponent(this);
          -};
          -
          -var rXSTime		= /^(([01]\d|2[0-3]):([0-5]\d):([0-5]\d)(?:\.(\d+))?|(24:00:00)(?:\.(0+))?)(Z|([+\-])(0\d|1[0-4]):([0-5]\d))?$/;
          -cXSTime.cast	= function(vValue) {
          -	if (vValue instanceof cXSTime)
          -		return vValue;
          -	if (vValue instanceof cXSString || vValue instanceof cXSUntypedAtomic) {
          -		var aMatch	= fString_trim(vValue).match(rXSTime);
          -		if (aMatch) {
          -			var bValue	= !!aMatch[6];
          -			return new cXSTime(bValue ? 0 : +aMatch[2],
          -								bValue ? 0 : +aMatch[3],
          -								cNumber((bValue ? 0 : aMatch[4]) + '.' + (bValue ? 0 : aMatch[5] || 0)),
          -								aMatch[8] ? aMatch[8] == 'Z' ? 0 : (aMatch[9] == '-' ? -1 : 1) * (aMatch[10] * 60 + aMatch[11] * 1) : null
          -			);
          -		}
          -		throw new cException("FORG0001");
          -	}
          -	if (vValue instanceof cXSDateTime)
          -		return new cXSTime(vValue.hours, vValue.minutes, vValue.seconds, vValue.timezone);
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);
          -};
          -
          -//
          -function fXSTime_normalize(oValue) {
          -	//
          -	if (oValue.seconds >= 60 || oValue.seconds < 0) {
          -		oValue.minutes	+= ~~(oValue.seconds / 60) - (oValue.seconds < 0 && oValue.seconds % 60 ? 1 : 0);
          -		oValue.seconds	= oValue.seconds % 60 + (oValue.seconds < 0 && oValue.seconds % 60 ? 60 : 0);
          -	}
          -	//
          -	if (oValue.minutes >= 60 || oValue.minutes < 0) {
          -		oValue.hours	+= ~~(oValue.minutes / 60) - (oValue.minutes < 0 && oValue.minutes % 60 ? 1 : 0);
          -		oValue.minutes	= oValue.minutes % 60 + (oValue.minutes < 0 && oValue.minutes % 60 ? 60 : 0);
          -	}
          -	//
          -	if (oValue.hours >= 24 || oValue.hours < 0) {
          -		if (oValue instanceof cXSDateTime)
          -			oValue.day		+= ~~(oValue.hours / 24) - (oValue.hours < 0 && oValue.hours % 24 ? 1 : 0);
          -		oValue.hours	= oValue.hours % 24 + (oValue.hours < 0 && oValue.hours % 24 ? 24 : 0);
          -	}
          -	//
          -	return oValue;
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("time",	cXSTime);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSUntypedAtomic(sValue) {
          -	this.value	= sValue;
          -};
          -
          -cXSUntypedAtomic.prototype	= new cXSAnyAtomicType;
          -cXSUntypedAtomic.prototype.builtInKind	= cXSConstants.XT_UNTYPEDATOMIC_DT;
          -
          -cXSUntypedAtomic.prototype.toString	= function() {
          -	return cString(this.value);
          -};
          -
          -cXSUntypedAtomic.cast	= function(vValue) {
          -	if (vValue instanceof cXSUntypedAtomic)
          -		return vValue;
          -
          -	return new cXSUntypedAtomic(cString(vValue));
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("untypedAtomic",	cXSUntypedAtomic);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSYearMonthDuration(nYear, nMonth, bNegative) {
          -	cXSDuration.call(this, nYear, nMonth, 0, 0, 0, 0, bNegative);
          -};
          -
          -cXSYearMonthDuration.prototype	= new cXSDuration;
          -cXSYearMonthDuration.prototype.builtInKind	= cXSConstants.XT_YEARMONTHDURATION_DT;
          -
          -cXSYearMonthDuration.prototype.toString	= function() {
          -	return (this.negative ? '-' : '') + 'P'
          -			+ (fXSDuration_getYearMonthComponent(this) || '0M');
          -};
          -
          -var rXSYearMonthDuration	= /^(-)?P(?:([0-9]+)Y)?(?:([0-9]+)M)?$/;
          -cXSYearMonthDuration.cast	= function(vValue) {
          -	if (vValue instanceof cXSYearMonthDuration)
          -		return vValue;
          -	if (vValue instanceof cXSString || vValue instanceof cXSUntypedAtomic) {
          -		var aMatch	= fString_trim(vValue).match(rXSYearMonthDuration);
          -		if (aMatch)
          -			return fXSYearMonthDuration_normalize(new cXSYearMonthDuration(+aMatch[2] || 0, +aMatch[3] || 0, aMatch[1] == '-'));
          -		throw new cException("FORG0001");
          -	}
          -	if (vValue instanceof cXSDayTimeDuration)
          -		return new cXSYearMonthDuration(0, 0);
          -	if (vValue instanceof cXSDuration)
          -		return new cXSYearMonthDuration(vValue.year, vValue.month, vValue.negative);
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);
          -};
          -
          -//
          -function fXSYearMonthDuration_normalize(oDuration) {
          -	if (oDuration.month >= 12) {
          -		oDuration.year	+= ~~(oDuration.month / 12);
          -		oDuration.month	%= 12;
          -	}
          -	return oDuration;
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("yearMonthDuration",	cXSYearMonthDuration);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSDayTimeDuration(nDay, nHours, nMinutes, nSeconds, bNegative) {
          -	cXSDuration.call(this, 0, 0, nDay, nHours, nMinutes, nSeconds, bNegative);
          -};
          -
          -cXSDayTimeDuration.prototype	= new cXSDuration;
          -cXSDayTimeDuration.prototype.builtInKind	= cXSConstants.DAYTIMEDURATION_DT;
          -
          -cXSDayTimeDuration.prototype.toString	= function() {
          -	return (this.negative ? '-' : '') + 'P'
          -			+ (fXSDuration_getDayTimeComponent(this) || 'T0S');
          -};
          -
          -var rXSDayTimeDuration	= /^(-)?P(?:([0-9]+)D)?(?:T(?:([0-9]+)H)?(?:([0-9]+)M)?(?:((?:(?:[0-9]+(?:.[0-9]*)?)|(?:.[0-9]+)))S)?)?$/;
          -cXSDayTimeDuration.cast	= function(vValue) {
          -	if (vValue instanceof cXSDayTimeDuration)
          -		return vValue;
          -	if (vValue instanceof cXSString || vValue instanceof cXSUntypedAtomic) {
          -		var aMatch	= fString_trim(vValue).match(rXSDayTimeDuration);
          -		if (aMatch)
          -			return fXSDayTimeDuration_normalize(new cXSDayTimeDuration(+aMatch[2] || 0, +aMatch[3] || 0, +aMatch[4] || 0, +aMatch[5] || 0, aMatch[1] == '-'));
          -		throw new cException("FORG0001");
          -	}
          -	if (vValue instanceof cXSYearMonthDuration)
          -		return new cXSDayTimeDuration(0, 0, 0, 0);
          -	if (vValue instanceof cXSDuration)
          -		return new cXSDayTimeDuration(vValue.day, vValue.hours, vValue.minutes, vValue.seconds, vValue.negative);
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);
          -};
          -
          -// Utilities
          -function fXSDayTimeDuration_normalize(oDuration) {
          -	if (oDuration.seconds >= 60) {
          -		oDuration.minutes	+= ~~(oDuration.seconds / 60);
          -		oDuration.seconds	%= 60;
          -	}
          -	if (oDuration.minutes >= 60) {
          -		oDuration.hours		+= ~~(oDuration.minutes / 60);
          -		oDuration.minutes	%= 60;
          -	}
          -	if (oDuration.hours >= 24) {
          -		oDuration.day		+= ~~(oDuration.hours / 24);
          -		oDuration.hours		%= 24;
          -	}
          -	return oDuration;
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("dayTimeDuration",	cXSDayTimeDuration);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSInteger(nValue) {
          -	this.value	= nValue;
          -};
          -
          -cXSInteger.prototype	= new cXSDecimal;
          -cXSInteger.prototype.builtInKind	= cXSConstants.INTEGER_DT;
          -
          -var rXSInteger	= /^[-+]?[0-9]+$/;
          -cXSInteger.cast	= function(vValue) {
          -	if (vValue instanceof cXSInteger)
          -		return new cXSInteger(vValue.value);
          -	if (vValue instanceof cXSString || vValue instanceof cXSUntypedAtomic) {
          -		var aMatch	= fString_trim(vValue).match(rXSInteger);
          -		if (aMatch)
          -			return new cXSInteger(+vValue);
          -		throw new cException("FORG0001");
          -	}
          -	if (vValue instanceof cXSBoolean)
          -		return new cXSInteger(vValue * 1);
          -	if (fXSAnyAtomicType_isNumeric(vValue)) {
          -		if (!fIsNaN(vValue) && fIsFinite(vValue))
          -			return new cXSInteger(+vValue);
          -		throw new cException("FOCA0002"
          -
          -		);
          -	}
          -	//
          -	throw new cException("XPTY0004"
          -
          -	);
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("integer",	cXSInteger);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSNonPositiveInteger(nValue) {
          -	this.value	= nValue;
          -};
          -
          -cXSNonPositiveInteger.prototype	= new cXSInteger;
          -cXSNonPositiveInteger.prototype.builtInKind	= cXSConstants.NONPOSITIVEINTEGER_DT;
          -
          -cXSNonPositiveInteger.cast	= function(vValue) {
          -	var oValue;
          -	try {
          -		oValue	= cXSInteger.cast(vValue);
          -	}
          -	catch (oError) {
          -		throw oError;
          -	}
          -	// facet validation
          -	if (oValue.value <= 0)
          -		return new cXSNonPositiveInteger(oValue.value);
          -	//
          -	throw new cException("FORG0001");
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("nonPositiveInteger",	cXSNonPositiveInteger);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSNegativeInteger(nValue) {
          -	this.value	= nValue;
          -};
          -
          -cXSNegativeInteger.prototype	= new cXSNonPositiveInteger;
          -cXSNegativeInteger.prototype.builtInKind	= cXSConstants.NEGATIVEINTEGER_DT;
          -
          -cXSNegativeInteger.cast	= function(vValue) {
          -	var oValue;
          -	try {
          -		oValue	= cXSInteger.cast(vValue);
          -	}
          -	catch (oError) {
          -		throw oError;
          -	}
          -	// facet validation
          -	if (oValue.value <= -1)
          -		return new cXSNegativeInteger(oValue.value);
          -	//
          -	throw new cException("FORG0001");
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("negativeInteger",	cXSNegativeInteger);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSLong(nValue) {
          -	this.value	= nValue;
          -};
          -
          -cXSLong.prototype	= new cXSInteger;
          -cXSLong.prototype.builtInKind	= cXSConstants.LONG_DT;
          -
          -cXSLong.cast	= function(vValue) {
          -	var oValue;
          -	try {
          -		oValue	= cXSInteger.cast(vValue);
          -	}
          -	catch (oError) {
          -		throw oError;
          -	}
          -	// facet validation
          -	if (oValue.value <= 9223372036854775807 && oValue.value >= -9223372036854775808)
          -		return new cXSLong(oValue.value);
          -	//
          -	throw new cException("FORG0001");
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("long",	cXSLong);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSInt(nValue) {
          -	this.value	= nValue;
          -};
          -
          -cXSInt.prototype	= new cXSLong;
          -cXSInt.prototype.builtInKind	= cXSConstants.INT_DT;
          -
          -cXSInt.cast	= function(vValue) {
          -	var oValue;
          -	try {
          -		oValue	= cXSInteger.cast(vValue);
          -	}
          -	catch (oError) {
          -		throw oError;
          -	}
          -	// facet validation
          -	if (oValue.value <= 2147483647 && oValue.value >= -2147483648)
          -		return new cXSInt(oValue.value);
          -	//
          -	throw new cException("FORG0001");
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("int",	cXSInt);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSShort(nValue) {
          -	this.value	= nValue;
          -};
          -
          -cXSShort.prototype	= new cXSInt;
          -cXSShort.prototype.builtInKind	= cXSConstants.SHORT_DT;
          -
          -cXSShort.cast	= function(vValue) {
          -	var oValue;
          -	try {
          -		oValue	= cXSInteger.cast(vValue);
          -	}
          -	catch (oError) {
          -		throw oError;
          -	}
          -	// facet validation
          -	if (oValue.value <= 32767 && oValue.value >= -32768)
          -		return new cXSShort(oValue.value);
          -	//
          -	throw new cException("FORG0001");
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("short",	cXSShort);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSByte(nValue) {
          -	this.value	= nValue;
          -};
          -
          -cXSByte.prototype	= new cXSShort;
          -cXSByte.prototype.builtInKind	= cXSConstants.BYTE_DT;
          -
          -cXSByte.cast	= function(vValue) {
          -	var oValue;
          -	try {
          -		oValue	= cXSInteger.cast(vValue);
          -	}
          -	catch (oError) {
          -		throw oError;
          -	}
          -	// facet validation
          -	if (oValue.value <= 127 && oValue.value >= -128)
          -		return new cXSByte(oValue.value);
          -	//
          -	throw new cException("FORG0001");
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("byte",	cXSByte);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSNonNegativeInteger(nValue) {
          -	this.value	= nValue;
          -};
          -
          -cXSNonNegativeInteger.prototype	= new cXSInteger;
          -cXSNonNegativeInteger.prototype.builtInKind	= cXSConstants.NONNEGATIVEINTEGER_DT;
          -
          -cXSNonNegativeInteger.cast	= function(vValue) {
          -	var oValue;
          -	try {
          -		oValue	= cXSInteger.cast(vValue);
          -	}
          -	catch (oError) {
          -		throw oError;
          -	}
          -	// facet validation
          -	if (oValue.value >= 0)
          -		return new cXSNonNegativeInteger(oValue.value);
          -	//
          -	throw new cException("FORG0001");
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("nonNegativeInteger",	cXSNonNegativeInteger);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSPositiveInteger(nValue) {
          -	this.value	= nValue;
          -};
          -
          -cXSPositiveInteger.prototype	= new cXSNonNegativeInteger;
          -cXSPositiveInteger.prototype.builtInKind	= cXSConstants.POSITIVEINTEGER_DT;
          -
          -cXSPositiveInteger.cast	= function(vValue) {
          -	var oValue;
          -	try {
          -		oValue	= cXSInteger.cast(vValue);
          -	}
          -	catch (oError) {
          -		throw oError;
          -	}
          -	// facet validation
          -	if (oValue.value >= 1)
          -		return new cXSPositiveInteger(oValue.value);
          -	//
          -	throw new cException("FORG0001");
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("positiveInteger",	cXSPositiveInteger);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSUnsignedLong(nValue) {
          -	this.value	= nValue;
          -};
          -
          -cXSUnsignedLong.prototype	= new cXSNonNegativeInteger;
          -cXSUnsignedLong.prototype.builtInKind	= cXSConstants.UNSIGNEDLONG_DT;
          -
          -cXSUnsignedLong.cast	= function(vValue) {
          -	var oValue;
          -	try {
          -		oValue	= cXSInteger.cast(vValue);
          -	}
          -	catch (oError) {
          -		throw oError;
          -	}
          -	// facet validation
          -	if (oValue.value >= 1 && oValue.value <= 18446744073709551615)
          -		return new cXSUnsignedLong(oValue.value);
          -	//
          -	throw new cException("FORG0001");
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("unsignedLong",	cXSUnsignedLong);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSUnsignedInt(nValue) {
          -	this.value	= nValue;
          -};
          -
          -cXSUnsignedInt.prototype	= new cXSNonNegativeInteger;
          -cXSUnsignedInt.prototype.builtInKind	= cXSConstants.UNSIGNEDINT_DT;
          -
          -cXSUnsignedInt.cast	= function(vValue) {
          -	var oValue;
          -	try {
          -		oValue	= cXSInteger.cast(vValue);
          -	}
          -	catch (oError) {
          -		throw oError;
          -	}
          -	// facet validation
          -	if (oValue.value >= 1 && oValue.value <= 4294967295)
          -		return new cXSUnsignedInt(oValue.value);
          -	//
          -	throw new cException("FORG0001");
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("unsignedInt",	cXSUnsignedInt);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSUnsignedShort(nValue) {
          -	this.value	= nValue;
          -};
          -
          -cXSUnsignedShort.prototype	= new cXSUnsignedInt;
          -cXSUnsignedShort.prototype.builtInKind	= cXSConstants.UNSIGNEDSHORT_DT;
          -
          -cXSUnsignedShort.cast	= function(vValue) {
          -	var oValue;
          -	try {
          -		oValue	= cXSInteger.cast(vValue);
          -	}
          -	catch (oError) {
          -		throw oError;
          -	}
          -	// facet validation
          -	if (oValue.value >= 1 && oValue.value <= 65535)
          -		return new cXSUnsignedShort(oValue.value);
          -	//
          -	throw new cException("FORG0001");
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("unsignedShort",	cXSUnsignedShort);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSUnsignedByte(nValue) {
          -	this.value	= nValue;
          -};
          -
          -cXSUnsignedByte.prototype	= new cXSUnsignedShort;
          -cXSUnsignedByte.prototype.builtInKind	= cXSConstants.UNSIGNEDBYTE_DT;
          -
          -cXSUnsignedByte.cast	= function(vValue) {
          -	var oValue;
          -	try {
          -		oValue	= cXSInteger.cast(vValue);
          -	}
          -	catch (oError) {
          -		throw oError;
          -	}
          -	// facet validation
          -	if (oValue.value >= 1 && oValue.value <= 255)
          -		return new cXSUnsignedByte(oValue.value);
          -	//
          -	throw new cException("FORG0001");
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("unsignedByte",	cXSUnsignedByte);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSNormalizedString(sValue) {
          -	this.value	= sValue;
          -};
          -
          -cXSNormalizedString.prototype	= new cXSString;
          -cXSNormalizedString.prototype.builtInKind	= cXSConstants.NORMALIZEDSTRING_DT;
          -
          -cXSNormalizedString.cast	= function(vValue) {
          -	return new cXSNormalizedString(cString(vValue));
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("normalizedString",	cXSNormalizedString);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSToken(sValue) {
          -	this.value	= sValue;
          -};
          -
          -cXSToken.prototype	= new cXSNormalizedString;
          -cXSToken.prototype.builtInKind	= cXSConstants.TOKEN_DT;
          -
          -cXSToken.cast	= function(vValue) {
          -	return new cXSToken(cString(vValue));
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("token",	cXSToken);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSName(sValue) {
          -	this.value	= sValue;
          -};
          -
          -cXSName.prototype	= new cXSToken;
          -cXSName.prototype.builtInKind	= cXSConstants.NAME_DT;
          -
          -cXSName.cast	= function(vValue) {
          -	return new cXSName(cString(vValue));
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("Name",	cXSName);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSNCName(sValue) {
          -	this.value	= sValue;
          -};
          -
          -cXSNCName.prototype	= new cXSName;
          -cXSNCName.prototype.builtInKind	= cXSConstants.NCNAME_DT;
          -
          -cXSNCName.cast	= function(vValue) {
          -	return new cXSNCName(cString(vValue));
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("NCName",	cXSNCName);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSENTITY(sValue) {
          -	this.value	= sValue;
          -};
          -
          -cXSENTITY.prototype	= new cXSNCName;
          -cXSENTITY.prototype.builtInKind	= cXSConstants.ENTITY_DT;
          -
          -cXSENTITY.cast	= function(vValue) {
          -	return new cXSENTITY(cString(vValue));
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("ENTITY",	cXSENTITY);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSID(sValue) {
          -	this.value	= sValue;
          -};
          -
          -cXSID.prototype	= new cXSNCName;
          -cXSID.prototype.builtInKind	= cXSConstants.ID_DT;
          -
          -cXSID.cast	= function(vValue) {
          -	return new cXSID(cString(vValue));
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("ID",	cXSID);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSIDREF(sValue) {
          -	this.value	= sValue;
          -};
          -
          -cXSIDREF.prototype	= new cXSNCName;
          -cXSIDREF.prototype.builtInKind	= cXSConstants.IDREF_DT;
          -
          -cXSIDREF.cast	= function(vValue) {
          -	return new cXSIDREF(cString(vValue));
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("IDREF",	cXSIDREF);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSLanguage(sValue) {
          -	this.value	= sValue;
          -};
          -
          -cXSLanguage.prototype	= new cXSToken;
          -cXSLanguage.prototype.builtInKind	= cXSConstants.LANGUAGE_DT;
          -
          -cXSLanguage.cast	= function(vValue) {
          -	return new cXSLanguage(cString(vValue));
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("language",	cXSLanguage);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXSNMTOKEN(sValue) {
          -	this.value	= sValue;
          -};
          -
          -cXSNMTOKEN.prototype	= new cXSToken;
          -cXSNMTOKEN.prototype.builtInKind	= cXSConstants.NMTOKEN_DT;
          -
          -cXSNMTOKEN.cast	= function(vValue) {
          -	return new cXSNMTOKEN(cString(vValue));
          -};
          -
          -//
          -fStaticContext_defineSystemDataType("NMTOKEN",	cXSNMTOKEN);
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXTItem() {
          -
          -};
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXTNode() {
          -
          -};
          -
          -cXTNode.prototype	= new cXTItem;
          -
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXTAttribute() {
          -
          -};
          -
          -cXTAttribute.prototype	= new cXTNode;
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXTComment() {
          -
          -};
          -
          -cXTComment.prototype	= new cXTNode;
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXTDocument() {
          -
          -};
          -
          -cXTDocument.prototype	= new cXTNode;
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXTElement() {
          -
          -};
          -
          -cXTElement.prototype	= new cXTNode;
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXTProcessingInstruction() {
          -
          -};
          -
          -cXTProcessingInstruction.prototype	= new cXTNode;
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -function cXTText() {
          -
          -};
          -
          -cXTText.prototype	= new cXTNode;
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -/*
          -	12.1 Comparisons of base64Binary and hexBinary Values
          -		op:hexBinary-equal
          -		op:base64Binary-equal
          -*/
          -hStaticContext_operators["hexBinary-equal"]	= function(oLeft, oRight) {
          -	return new cXSBoolean(oLeft.valueOf() == oRight.valueOf());
          -};
          -
          -hStaticContext_operators["base64Binary-equal"]	= function(oLeft, oRight) {
          -	return new cXSBoolean(oLeft.valueOf() == oRight.valueOf());
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -/*
          -	9.2 Operators on Boolean Values
          -		op:boolean-equal
          -		op:boolean-less-than
          -		op:boolean-greater-than
          -*/
          -
          -// 9.2 Operators on Boolean Values
          -// op:boolean-equal($value1 as xs:boolean, $value2 as xs:boolean) as xs:boolean
          -hStaticContext_operators["boolean-equal"]	= function(oLeft, oRight) {
          -	return new cXSBoolean(oLeft.valueOf() == oRight.valueOf());
          -};
          -
          -// op:boolean-less-than($arg1 as xs:boolean, $arg2 as xs:boolean) as xs:boolean
          -hStaticContext_operators["boolean-less-than"]	= function(oLeft, oRight) {
          -	return new cXSBoolean(oLeft.valueOf() < oRight.valueOf());
          -};
          -
          -// op:boolean-greater-than($arg1 as xs:boolean, $arg2 as xs:boolean) as xs:boolean
          -hStaticContext_operators["boolean-greater-than"]	= function(oLeft, oRight) {
          -	return new cXSBoolean(oLeft.valueOf() > oRight.valueOf());
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -/*
          -	10.4 Comparison Operators on Duration, Date and Time Values
          -		op:yearMonthDuration-less-than
          -		op:yearMonthDuration-greater-than
          -		op:dayTimeDuration-less-than
          -		op:dayTimeDuration-greater-than
          -		op:duration-equal
          -		op:dateTime-equal
          -		op:dateTime-less-than
          -		op:dateTime-greater-than
          -		op:date-equal
          -		op:date-less-than
          -		op:date-greater-than
          -		op:time-equal
          -		op:time-less-than
          -		op:time-greater-than
          -		op:gYearMonth-equal
          -		op:gYear-equal
          -		op:gMonthDay-equal
          -		op:gMonth-equal
          -		op:gDay-equal
          -
          -	10.6 Arithmetic Operators on Durations
          -		op:add-yearMonthDurations
          -		op:subtract-yearMonthDurations
          -		op:multiply-yearMonthDuration
          -		op:divide-yearMonthDuration
          -		op:divide-yearMonthDuration-by-yearMonthDuration
          -		op:add-dayTimeDurations
          -		op:subtract-dayTimeDurations
          -		op:multiply-dayTimeDuration
          -		op:divide-dayTimeDuration
          -		op:divide-dayTimeDuration-by-dayTimeDuration
          -
          -
          -	10.8 Arithmetic Operators on Durations, Dates and Times
          -		op:subtract-dateTimes
          -		op:subtract-dates
          -		op:subtract-times
          -		op:add-yearMonthDuration-to-dateTime
          -		op:add-dayTimeDuration-to-dateTime
          -		op:subtract-yearMonthDuration-from-dateTime
          -		op:subtract-dayTimeDuration-from-dateTime
          -		op:add-yearMonthDuration-to-date
          -		op:add-dayTimeDuration-to-date
          -		op:subtract-yearMonthDuration-from-date
          -		op:subtract-dayTimeDuration-from-date
          -		op:add-dayTimeDuration-to-time
          -		op:subtract-dayTimeDuration-from-time
          -
          -*/
          -
          -// 10.4 Comparison Operators on Duration, Date and Time Values
          -// op:yearMonthDuration-less-than($arg1 as xs:yearMonthDuration, $arg2 as xs:yearMonthDuration) as xs:boolean
          -hStaticContext_operators["yearMonthDuration-less-than"]	= function(oLeft, oRight) {
          -	return new cXSBoolean(fOperator_yearMonthDuration_toMonths(oLeft) < fOperator_yearMonthDuration_toMonths(oRight));
          -};
          -
          -// op:yearMonthDuration-greater-than($arg1 as xs:yearMonthDuration, $arg2 as xs:yearMonthDuration) as xs:boolean
          -hStaticContext_operators["yearMonthDuration-greater-than"]	= function(oLeft, oRight) {
          -	return new cXSBoolean(fOperator_yearMonthDuration_toMonths(oLeft) > fOperator_yearMonthDuration_toMonths(oRight));
          -};
          -
          -// op:dayTimeDuration-less-than($arg1 as dayTimeDuration, $arg2 as dayTimeDuration) as xs:boolean
          -hStaticContext_operators["dayTimeDuration-less-than"]	= function(oLeft, oRight) {
          -	return new cXSBoolean(fOperator_dayTimeDuration_toSeconds(oLeft) < fOperator_dayTimeDuration_toSeconds(oRight));
          -};
          -
          -// op:dayTimeDuration-greater-than($arg1 as dayTimeDuration, $arg2 as dayTimeDuration) as xs:boolean
          -hStaticContext_operators["dayTimeDuration-greater-than"]	= function(oLeft, oRight) {
          -	return new cXSBoolean(fOperator_dayTimeDuration_toSeconds(oLeft) > fOperator_dayTimeDuration_toSeconds(oRight));
          -};
          -
          -// op:duration-equal($arg1 as xs:duration, $arg2 as xs:duration) as xs:boolean
          -hStaticContext_operators["duration-equal"]	= function(oLeft, oRight) {
          -	return new cXSBoolean(oLeft.negative == oRight.negative
          -			&& fOperator_yearMonthDuration_toMonths(oLeft) == fOperator_yearMonthDuration_toMonths(oRight)
          -			&& fOperator_dayTimeDuration_toSeconds(oLeft) == fOperator_dayTimeDuration_toSeconds(oRight));
          -};
          -
          -// op:dateTime-equal($arg1 as xs:dateTime, $arg2 as xs:dateTime) as xs:boolean
          -hStaticContext_operators["dateTime-equal"]	= function(oLeft, oRight) {
          -	return fOperator_compareDateTimes(oLeft, oRight, 'eq');
          -};
          -
          -// op:dateTime-less-than($arg1 as xs:dateTime, $arg2 as xs:dateTime) as xs:boolean
          -hStaticContext_operators["dateTime-less-than"]	= function(oLeft, oRight) {
          -	return fOperator_compareDateTimes(oLeft, oRight, 'lt');
          -};
          -
          -//op:dateTime-greater-than($arg1 as xs:dateTime, $arg2 as xs:dateTime) as xs:boolean
          -hStaticContext_operators["dateTime-greater-than"]	= function(oLeft, oRight) {
          -	return fOperator_compareDateTimes(oLeft, oRight, 'gt');
          -};
          -
          -// op:date-equal($arg1 as xs:date, $arg2 as xs:date) as xs:boolean
          -hStaticContext_operators["date-equal"]	= function(oLeft, oRight) {
          -	return fOperator_compareDates(oLeft, oRight, 'eq');
          -};
          -
          -// op:date-less-than($arg1 as xs:date, $arg2 as xs:date) as xs:boolean
          -hStaticContext_operators["date-less-than"]	= function(oLeft, oRight) {
          -	return fOperator_compareDates(oLeft, oRight, 'lt');
          -};
          -
          -// op:date-greater-than($arg1 as xs:date, $arg2 as xs:date) as xs:boolean
          -hStaticContext_operators["date-greater-than"]	= function(oLeft, oRight) {
          -	return fOperator_compareDates(oLeft, oRight, 'gt');
          -};
          -
          -// op:time-equal($arg1 as xs:time, $arg2 as xs:time) as xs:boolean
          -hStaticContext_operators["time-equal"]	= function(oLeft, oRight) {
          -	return fOperator_compareTimes(oLeft, oRight, 'eq');
          -};
          -
          -// op:time-less-than($arg1 as xs:time, $arg2 as xs:time) as xs:boolean
          -hStaticContext_operators["time-less-than"]	= function(oLeft, oRight) {
          -	return fOperator_compareTimes(oLeft, oRight, 'lt');
          -};
          -
          -// op:time-greater-than($arg1 as xs:time, $arg2 as xs:time) as xs:boolean
          -hStaticContext_operators["time-greater-than"]	= function(oLeft, oRight) {
          -	return fOperator_compareTimes(oLeft, oRight, 'gt');
          -};
          -
          -// op:gYearMonth-equal($arg1 as xs:gYearMonth, $arg2 as xs:gYearMonth) as xs:boolean
          -hStaticContext_operators["gYearMonth-equal"]	= function(oLeft, oRight) {
          -	return fOperator_compareDateTimes(
          -			new cXSDateTime(oLeft.year, oLeft.month, fXSDate_getDaysForYearMonth(oLeft.year, oLeft.month), 0, 0, 0, oLeft.timezone == null ? this.timezone : oLeft.timezone),
          -			new cXSDateTime(oRight.year, oRight.month, fXSDate_getDaysForYearMonth(oRight.year, oRight.month), 0, 0, 0, oRight.timezone == null ? this.timezone : oRight.timezone),
          -			'eq'
          -	);
          -};
          -
          -// op:gYear-equal($arg1 as xs:gYear, $arg2 as xs:gYear) as xs:boolean
          -hStaticContext_operators["gYear-equal"]	= function(oLeft, oRight) {
          -	return fOperator_compareDateTimes(
          -			new cXSDateTime(oLeft.year, 1, 1, 0, 0, 0, oLeft.timezone == null ? this.timezone : oLeft.timezone),
          -			new cXSDateTime(oRight.year, 1, 1, 0, 0, 0, oRight.timezone == null ? this.timezone : oRight.timezone),
          -			'eq'
          -	);
          -};
          -
          -// op:gMonthDay-equal($arg1 as xs:gMonthDay, $arg2 as xs:gMonthDay) as xs:boolean
          -hStaticContext_operators["gMonthDay-equal"]	= function(oLeft, oRight) {
          -	return fOperator_compareDateTimes(
          -			new cXSDateTime(1972, oLeft.month, oLeft.day, 0, 0, 0, oLeft.timezone == null ? this.timezone : oLeft.timezone),
          -			new cXSDateTime(1972, oRight.month, oRight.day, 0, 0, 0, oRight.timezone == null ? this.timezone : oRight.timezone),
          -			'eq'
          -	);
          -};
          -
          -// op:gMonth-equal($arg1 as xs:gMonth, $arg2 as xs:gMonth) as xs:boolean
          -hStaticContext_operators["gMonth-equal"]	= function(oLeft, oRight) {
          -	return fOperator_compareDateTimes(
          -			new cXSDateTime(1972, oLeft.month, fXSDate_getDaysForYearMonth(1972, oRight.month), 0, 0, 0, oLeft.timezone == null ? this.timezone : oLeft.timezone),
          -			new cXSDateTime(1972, oRight.month, fXSDate_getDaysForYearMonth(1972, oRight.month), 0, 0, 0, oRight.timezone == null ? this.timezone : oRight.timezone),
          -			'eq'
          -	);
          -};
          -
          -// op:gDay-equal($arg1 as xs:gDay, $arg2 as xs:gDay) as xs:boolean
          -hStaticContext_operators["gDay-equal"]	= function(oLeft, oRight) {
          -	return fOperator_compareDateTimes(
          -			new cXSDateTime(1972, 12, oLeft.day, 0, 0, 0, oLeft.timezone == null ? this.timezone : oLeft.timezone),
          -			new cXSDateTime(1972, 12, oRight.day, 0, 0, 0, oRight.timezone == null ? this.timezone : oRight.timezone),
          -			'eq'
          -	);
          -};
          -
          -// 10.6 Arithmetic Operators on Durations
          -// op:add-yearMonthDurations($arg1 as xs:yearMonthDuration, $arg2 as xs:yearMonthDuration) as xs:yearMonthDuration
          -hStaticContext_operators["add-yearMonthDurations"]	= function(oLeft, oRight) {
          -	return fOperator_yearMonthDuration_fromMonths(fOperator_yearMonthDuration_toMonths(oLeft) + fOperator_yearMonthDuration_toMonths(oRight));
          -};
          -
          -// op:subtract-yearMonthDurations($arg1 as xs:yearMonthDuration, $arg2 as xs:yearMonthDuration) as xs:yearMonthDuration
          -hStaticContext_operators["subtract-yearMonthDurations"]	= function(oLeft, oRight) {
          -	return fOperator_yearMonthDuration_fromMonths(fOperator_yearMonthDuration_toMonths(oLeft) - fOperator_yearMonthDuration_toMonths(oRight));
          -};
          -
          -// op:multiply-yearMonthDuration($arg1 as xs:yearMonthDuration, $arg2 as xs:double) as xs:yearMonthDuration
          -hStaticContext_operators["multiply-yearMonthDuration"]	= function(oLeft, oRight) {
          -	return fOperator_yearMonthDuration_fromMonths(fOperator_yearMonthDuration_toMonths(oLeft) * oRight);
          -};
          -
          -// op:divide-yearMonthDuration($arg1 as xs:yearMonthDuration, $arg2 as xs:double) as xs:yearMonthDuration
          -hStaticContext_operators["divide-yearMonthDuration"]	= function(oLeft, oRight) {
          -	return fOperator_yearMonthDuration_fromMonths(fOperator_yearMonthDuration_toMonths(oLeft) / oRight);
          -};
          -
          -// op:divide-yearMonthDuration-by-yearMonthDuration($arg1 as xs:yearMonthDuration, $arg2 as xs:yearMonthDuration) as xs:decimal
          -hStaticContext_operators["divide-yearMonthDuration-by-yearMonthDuration"]	= function(oLeft, oRight) {
          -	return new cXSDecimal(fOperator_yearMonthDuration_toMonths(oLeft) / fOperator_yearMonthDuration_toMonths(oRight));
          -};
          -
          -// op:add-dayTimeDurations($arg1 as xs:dayTimeDuration, $arg2 as xs:dayTimeDuration) as xs:dayTimeDuration
          -hStaticContext_operators["add-dayTimeDurations"]	= function(oLeft, oRight) {
          -	return fOperator_dayTimeDuration_fromSeconds(fOperator_dayTimeDuration_toSeconds(oLeft) + fOperator_dayTimeDuration_toSeconds(oRight));
          -};
          -
          -// op:subtract-dayTimeDurations($arg1 as xs:dayTimeDuration, $arg2 as xs:dayTimeDuration) as xs:dayTimeDuration
          -hStaticContext_operators["subtract-dayTimeDurations"]	= function(oLeft, oRight) {
          -	return fOperator_dayTimeDuration_fromSeconds(fOperator_dayTimeDuration_toSeconds(oLeft) - fOperator_dayTimeDuration_toSeconds(oRight));
          -};
          -
          -// op:multiply-dayTimeDurations($arg1 as xs:dayTimeDuration, $arg2 as xs:double) as xs:dayTimeDuration
          -hStaticContext_operators["multiply-dayTimeDuration"]	= function(oLeft, oRight) {
          -	return fOperator_dayTimeDuration_fromSeconds(fOperator_dayTimeDuration_toSeconds(oLeft) * oRight);
          -};
          -
          -// op:divide-dayTimeDurations($arg1 as xs:dayTimeDuration, $arg2 as xs:double) as xs:dayTimeDuration
          -hStaticContext_operators["divide-dayTimeDuration"]	= function(oLeft, oRight) {
          -	return fOperator_dayTimeDuration_fromSeconds(fOperator_dayTimeDuration_toSeconds(oLeft) / oRight);
          -};
          -
          -// op:divide-dayTimeDuration-by-dayTimeDuration($arg1 as xs:dayTimeDuration, $arg2 as xs:dayTimeDuration) as xs:decimal
          -hStaticContext_operators["divide-dayTimeDuration-by-dayTimeDuration"]	= function(oLeft, oRight) {
          -	return new cXSDecimal(fOperator_dayTimeDuration_toSeconds(oLeft) / fOperator_dayTimeDuration_toSeconds(oRight));
          -};
          -
          -// 10.8 Arithmetic Operators on Durations, Dates and Times
          -// op:subtract-dateTimes($arg1 as xs:dateTime, $arg2 as xs:dateTime) as xs:dayTimeDuration
          -hStaticContext_operators["subtract-dateTimes"]	= function(oLeft, oRight) {
          -	return fOperator_dayTimeDuration_fromSeconds(fOperator_dateTime_toSeconds(oLeft) - fOperator_dateTime_toSeconds(oRight));
          -};
          -
          -// op:subtract-dates($arg1 as xs:date, $arg2 as xs:date) as xs:dayTimeDuration
          -hStaticContext_operators["subtract-dates"]	= function(oLeft, oRight) {
          -	return fOperator_dayTimeDuration_fromSeconds(fOperator_dateTime_toSeconds(oLeft) - fOperator_dateTime_toSeconds(oRight));
          -};
          -
          -// op:subtract-times($arg1 as xs:time, $arg2 as xs:time) as xs:dayTimeDuration
          -hStaticContext_operators["subtract-times"]	= function(oLeft, oRight) {
          -	return fOperator_dayTimeDuration_fromSeconds(fOperator_time_toSeconds(oLeft) - fOperator_time_toSeconds(oRight));
          -};
          -
          -// op:add-yearMonthDuration-to-dateTime($arg1 as xs:dateTime, $arg2 as xs:yearMonthDuration) as xs:dateTime
          -hStaticContext_operators["add-yearMonthDuration-to-dateTime"]	= function(oLeft, oRight) {
          -	return fOperator_addYearMonthDuration2DateTime(oLeft, oRight, '+');
          -};
          -
          -// op:add-dayTimeDuration-to-dateTime($arg1 as xs:dateTime, $arg2 as xs:dayTimeDuration) as xs:dateTime
          -hStaticContext_operators["add-dayTimeDuration-to-dateTime"]	= function(oLeft, oRight) {
          -	return fOperator_addDayTimeDuration2DateTime(oLeft, oRight, '+');
          -};
          -
          -// op:subtract-yearMonthDuration-from-dateTime($arg1 as xs:dateTime, $arg2 as xs:yearMonthDuration) as xs:dateTime
          -hStaticContext_operators["subtract-yearMonthDuration-from-dateTime"]	= function(oLeft, oRight) {
          -	return fOperator_addYearMonthDuration2DateTime(oLeft, oRight, '-');
          -};
          -
          -// op:subtract-dayTimeDuration-from-dateTime($arg1 as xs:dateTime, $arg2 as xs:dayTimeDuration) as xs:dateTime
          -hStaticContext_operators["subtract-dayTimeDuration-from-dateTime"]	= function(oLeft, oRight) {
          -	return fOperator_addDayTimeDuration2DateTime(oLeft, oRight, '-');
          -};
          -
          -// op:add-yearMonthDuration-to-date($arg1 as xs:date, $arg2 as xs:yearMonthDuration) as xs:date
          -hStaticContext_operators["add-yearMonthDuration-to-date"]	= function(oLeft, oRight) {
          -	return fOperator_addYearMonthDuration2DateTime(oLeft, oRight, '+');
          -};
          -
          -// op:add-dayTimeDuration-to-date($arg1 as xs:date, $arg2 as xs:dayTimeDuration) as xs:date
          -hStaticContext_operators["add-dayTimeDuration-to-date"]	= function(oLeft, oRight) {
          -	return fOperator_addDayTimeDuration2DateTime(oLeft, oRight, '+');
          -};
          -
          -// op:subtract-yearMonthDuration-from-date($arg1 as xs:date, $arg2  as xs:yearMonthDuration) as xs:date
          -hStaticContext_operators["subtract-yearMonthDuration-from-date"]	= function(oLeft, oRight) {
          -	return fOperator_addYearMonthDuration2DateTime(oLeft, oRight, '-');
          -};
          -
          -// op:subtract-dayTimeDuration-from-date($arg1 as xs:date, $arg2  as xs:dayTimeDuration) as xs:date
          -hStaticContext_operators["subtract-dayTimeDuration-from-date"]	= function(oLeft, oRight) {
          -	return fOperator_addDayTimeDuration2DateTime(oLeft, oRight, '-');
          -};
          -
          -// op:add-dayTimeDuration-to-time($arg1 as xs:time, $arg2  as xs:dayTimeDuration) as xs:time
          -hStaticContext_operators["add-dayTimeDuration-to-time"]	= function(oLeft, oRight) {
          -	var oValue	= new cXSTime(oLeft.hours, oLeft.minutes, oLeft.seconds, oLeft.timezone);
          -	oValue.hours	+= oRight.hours;
          -	oValue.minutes	+= oRight.minutes;
          -	oValue.seconds	+= oRight.seconds;
          -	//
          -	return fXSTime_normalize(oValue);
          -};
          -
          -// op:subtract-dayTimeDuration-from-time($arg1 as xs:time, $arg2  as xs:dayTimeDuration) as xs:time
          -hStaticContext_operators["subtract-dayTimeDuration-from-time"]	= function(oLeft, oRight) {
          -	var oValue	= new cXSTime(oLeft.hours, oLeft.minutes, oLeft.seconds, oLeft.timezone);
          -	oValue.hours	-= oRight.hours;
          -	oValue.minutes	-= oRight.minutes;
          -	oValue.seconds	-= oRight.seconds;
          -	//
          -	return fXSTime_normalize(oValue);
          -};
          -
          -function fOperator_compareTimes(oLeft, oRight, sComparator) {
          -	var nLeft	= fOperator_time_toSeconds(oLeft),
          -		nRight	= fOperator_time_toSeconds(oRight);
          -	return new cXSBoolean(sComparator == 'lt' ? nLeft < nRight : sComparator == 'gt' ? nLeft > nRight : nLeft == nRight);
          -};
          -
          -function fOperator_compareDates(oLeft, oRight, sComparator) {
          -	return fOperator_compareDateTimes(cXSDateTime.cast(oLeft), cXSDateTime.cast(oRight), sComparator);
          -};
          -
          -function fOperator_compareDateTimes(oLeft, oRight, sComparator) {
          -	// Adjust object time zone to Z and compare as strings
          -	var oTimezone	= new cXSDayTimeDuration(0, 0, 0, 0),
          -		sLeft	= fFunction_dateTime_adjustTimezone(oLeft, oTimezone).toString(),
          -		sRight	= fFunction_dateTime_adjustTimezone(oRight, oTimezone).toString();
          -	return new cXSBoolean(sComparator == 'lt' ? sLeft < sRight : sComparator == 'gt' ? sLeft > sRight : sLeft == sRight);
          -};
          -
          -function fOperator_addYearMonthDuration2DateTime(oLeft, oRight, sOperator) {
          -	var oValue;
          -	if (oLeft instanceof cXSDate)
          -		oValue	= new cXSDate(oLeft.year, oLeft.month, oLeft.day, oLeft.timezone, oLeft.negative);
          -	else
          -	if (oLeft instanceof cXSDateTime)
          -		oValue	= new cXSDateTime(oLeft.year, oLeft.month, oLeft.day, oLeft.hours, oLeft.minutes, oLeft.seconds, oLeft.timezone, oLeft.negative);
          -	//
          -	oValue.year		= oValue.year + oRight.year * (sOperator == '-' ?-1 : 1);
          -	oValue.month	= oValue.month + oRight.month * (sOperator == '-' ?-1 : 1);
          -	//
          -	fXSDate_normalize(oValue, true);
          -	// Correct day if out of month range
          -	var nDay	= fXSDate_getDaysForYearMonth(oValue.year, oValue.month);
          -	if (oValue.day > nDay)
          -		oValue.day	= nDay;
          -	//
          -	return oValue;
          -};
          -
          -function fOperator_addDayTimeDuration2DateTime(oLeft, oRight, sOperator) {
          -	var oValue;
          -	if (oLeft instanceof cXSDate) {
          -		var nValue	= (oRight.hours * 60 + oRight.minutes) * 60 + oRight.seconds;
          -		oValue	= new cXSDate(oLeft.year, oLeft.month, oLeft.day, oLeft.timezone, oLeft.negative);
          -		oValue.day	= oValue.day + oRight.day * (sOperator == '-' ?-1 : 1) - 1 * (nValue && sOperator == '-');
          -		//
          -		fXSDate_normalize(oValue);
          -	}
          -	else
          -	if (oLeft instanceof cXSDateTime) {
          -		oValue	= new cXSDateTime(oLeft.year, oLeft.month, oLeft.day, oLeft.hours, oLeft.minutes, oLeft.seconds, oLeft.timezone, oLeft.negative);
          -		oValue.seconds	= oValue.seconds + oRight.seconds * (sOperator == '-' ?-1 : 1);
          -		oValue.minutes	= oValue.minutes + oRight.minutes * (sOperator == '-' ?-1 : 1);
          -		oValue.hours	= oValue.hours + oRight.hours * (sOperator == '-' ?-1 : 1);
          -		oValue.day		= oValue.day + oRight.day * (sOperator == '-' ?-1 : 1);
          -		//
          -		fXSDateTime_normalize(oValue);
          -	}
          -	return oValue;
          -};
          -
          -// xs:dayTimeDuration to/from seconds
          -function fOperator_dayTimeDuration_toSeconds(oDuration) {
          -	return (((oDuration.day * 24 + oDuration.hours) * 60 + oDuration.minutes) * 60 + oDuration.seconds) * (oDuration.negative ? -1 : 1);
          -};
          -
          -function fOperator_dayTimeDuration_fromSeconds(nValue) {
          -	var bNegative	=(nValue = cMath.round(nValue)) < 0,
          -		nDays	= ~~((nValue = cMath.abs(nValue)) / 86400),
          -		nHours	= ~~((nValue -= nDays * 3600 * 24) / 3600),
          -		nMinutes= ~~((nValue -= nHours * 3600) / 60),
          -		nSeconds	= nValue -= nMinutes * 60;
          -	return new cXSDayTimeDuration(nDays, nHours, nMinutes, nSeconds, bNegative);
          -};
          -
          -// xs:yearMonthDuration to/from months
          -function fOperator_yearMonthDuration_toMonths(oDuration) {
          -	return (oDuration.year * 12 + oDuration.month) * (oDuration.negative ? -1 : 1);
          -};
          -
          -function fOperator_yearMonthDuration_fromMonths(nValue) {
          -	var nNegative	=(nValue = cMath.round(nValue)) < 0,
          -		nYears	= ~~((nValue = cMath.abs(nValue)) / 12),
          -		nMonths		= nValue -= nYears * 12;
          -	return new cXSYearMonthDuration(nYears, nMonths, nNegative);
          -};
          -
          -// xs:time to seconds
          -function fOperator_time_toSeconds(oTime) {
          -	return oTime.seconds + (oTime.minutes - (oTime.timezone != null ? oTime.timezone % 60 : 0) + (oTime.hours - (oTime.timezone != null ? ~~(oTime.timezone / 60) : 0)) * 60) * 60;
          -};
          -
          -// This function unlike all other date-related functions rely on interpretor's dateTime handling
          -function fOperator_dateTime_toSeconds(oValue) {
          -	var oDate	= new cDate((oValue.negative ? -1 : 1) * oValue.year, oValue.month, oValue.day, 0, 0, 0, 0);
          -	if (oValue instanceof cXSDateTime) {
          -		oDate.setHours(oValue.hours);
          -		oDate.setMinutes(oValue.minutes);
          -		oDate.setSeconds(oValue.seconds);
          -	}
          -	if (oValue.timezone != null)
          -		oDate.setMinutes(oDate.getMinutes() - oValue.timezone);
          -	return oDate.getTime() / 1000;
          -};
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -/*
          -	14 Functions and Operators on Nodes
          -		op:is-same-node
          -		op:node-before
          -		op:node-after
          -*/
          -
          -// 14 Operators on Nodes
          -// op:is-same-node($parameter1 as node(), $parameter2 as node()) as xs:boolean
          -hStaticContext_operators["is-same-node"]	= function(oLeft, oRight) {
          -	return new cXSBoolean(this.DOMAdapter.isSameNode(oLeft, oRight));
          -};
          -
          -// op:node-before($parameter1 as node(), $parameter2 as node()) as xs:boolean
          -hStaticContext_operators["node-before"]	= function(oLeft, oRight) {
          -	return new cXSBoolean(!!(this.DOMAdapter.compareDocumentPosition(oLeft, oRight) & 4));
          -};
          -
          -// op:node-after($parameter1 as node(), $parameter2 as node()) as xs:boolean
          -hStaticContext_operators["node-after"]	= function(oLeft, oRight) {
          -	return new cXSBoolean(!!(this.DOMAdapter.compareDocumentPosition(oLeft, oRight) & 2));
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -/*
          -	13.1 Operators on NOTATION
          -		op:NOTATION-equal
          -*/
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -/*
          -	6.2 Operators on Numeric Values
          -		op:numeric-add
          -		op:numeric-subtract
          -		op:numeric-multiply
          -		op:numeric-divide
          -		op:numeric-integer-divide
          -		op:numeric-mod
          -		op:numeric-unary-plus
          -		op:numeric-unary-minus
          -
          -	6.3 Comparison Operators on Numeric Values
          -		op:numeric-equal
          -		op:numeric-less-than
          -		op:numeric-greater-than
          -*/
          -
          -// 6.2 Operators on Numeric Values
          -function fFunctionCall_numeric_getPower(oLeft, oRight) {
          -	if (fIsNaN(oLeft) || (cMath.abs(oLeft) == nInfinity) || fIsNaN(oRight) || (cMath.abs(oRight) == nInfinity))
          -		return 0;
          -	var aLeft	= cString(oLeft).match(rNumericLiteral),
          -		aRight	= cString(oRight).match(rNumericLiteral),
          -		nPower	= cMath.max(1, (aLeft[2] || aLeft[3] || '').length + (aLeft[5] || 0) * (aLeft[4] == '+' ?-1 : 1), (aRight[2] || aRight[3] || '').length + (aRight[5] || 0) * (aRight[4] == '+' ?-1 : 1));
          -	return nPower + (nPower % 2 ? 0 : 1);
          -};
          -
          -// op:numeric-add($arg1 as numeric, $arg2 as numeric) as numeric
          -hStaticContext_operators["numeric-add"]		= function(oLeft, oRight) {
          -	var nLeft	= oLeft.valueOf(),
          -		nRight	= oRight.valueOf(),
          -		nPower	= cMath.pow(10, fFunctionCall_numeric_getPower(nLeft, nRight));
          -	return fOperator_numeric_getResultOfType(oLeft, oRight, ((nLeft * nPower) + (nRight * nPower))/nPower);
          -};
          -
          -// op:numeric-subtract($arg1 as numeric, $arg2 as numeric) as numeric
          -hStaticContext_operators["numeric-subtract"]	= function(oLeft, oRight) {
          -	var nLeft	= oLeft.valueOf(),
          -		nRight	= oRight.valueOf(),
          -		nPower	= cMath.pow(10, fFunctionCall_numeric_getPower(nLeft, nRight));
          -	return fOperator_numeric_getResultOfType(oLeft, oRight, ((nLeft * nPower) - (nRight * nPower))/nPower);
          -};
          -
          -// op:numeric-multiply($arg1 as numeric, $arg2 as numeric) as numeric
          -hStaticContext_operators["numeric-multiply"]	= function(oLeft, oRight) {
          -	var nLeft	= oLeft.valueOf(),
          -		nRight	= oRight.valueOf(),
          -		nPower	= cMath.pow(10, fFunctionCall_numeric_getPower(nLeft, nRight));
          -	return fOperator_numeric_getResultOfType(oLeft, oRight, ((nLeft * nPower) * (nRight * nPower))/(nPower * nPower));
          -};
          -
          -// op:numeric-divide($arg1 as numeric, $arg2 as numeric) as numeric
          -hStaticContext_operators["numeric-divide"]	= function(oLeft, oRight) {
          -	var nLeft	= oLeft.valueOf(),
          -		nRight	= oRight.valueOf(),
          -		nPower	= cMath.pow(10, fFunctionCall_numeric_getPower(nLeft, nRight));
          -	return fOperator_numeric_getResultOfType(oLeft, oRight, (oLeft * nPower) / (oRight * nPower));
          -};
          -
          -// op:numeric-integer-divide($arg1 as numeric, $arg2 as numeric) as xs:integer
          -hStaticContext_operators["numeric-integer-divide"]	= function(oLeft, oRight) {
          -	var oValue = oLeft / oRight;
          -	return new cXSInteger(cMath.floor(oValue) + (oValue < 0));
          -};
          -
          -// op:numeric-mod($arg1 as numeric, $arg2 as numeric) as numeric
          -hStaticContext_operators["numeric-mod"]	= function(oLeft, oRight) {
          -	var nLeft	= oLeft.valueOf(),
          -		nRight	= oRight.valueOf(),
          -		nPower	= cMath.pow(10, fFunctionCall_numeric_getPower(nLeft, nRight));
          -	return fOperator_numeric_getResultOfType(oLeft, oRight, ((nLeft * nPower) % (nRight * nPower)) / nPower);
          -};
          -
          -// op:numeric-unary-plus($arg as numeric) as numeric
          -hStaticContext_operators["numeric-unary-plus"]	= function(oRight) {
          -	return oRight;
          -};
          -
          -// op:numeric-unary-minus($arg as numeric) as numeric
          -hStaticContext_operators["numeric-unary-minus"]	= function(oRight) {
          -	oRight.value	*=-1;
          -	return oRight;
          -};
          -
          -
          -// 6.3 Comparison Operators on Numeric Values
          -// op:numeric-equal($arg1 as numeric, $arg2 as numeric) as xs:boolean
          -hStaticContext_operators["numeric-equal"]	= function(oLeft, oRight) {
          -	return new cXSBoolean(oLeft.valueOf() == oRight.valueOf());
          -};
          -
          -// op:numeric-less-than($arg1 as numeric, $arg2 as numeric) as xs:boolean
          -hStaticContext_operators["numeric-less-than"]	= function(oLeft, oRight) {
          -	return new cXSBoolean(oLeft.valueOf() < oRight.valueOf());
          -};
          -
          -// op:numeric-greater-than($arg1 as numeric, $arg2 as numeric) as xs:boolean
          -hStaticContext_operators["numeric-greater-than"]	= function(oLeft, oRight) {
          -	return new cXSBoolean(oLeft.valueOf() > oRight.valueOf());
          -};
          -
          -function fOperator_numeric_getResultOfType(oLeft, oRight, nResult) {
          -	return new (oLeft instanceof cXSInteger && oRight instanceof cXSInteger && nResult == cMath.round(nResult) ? cXSInteger : cXSDecimal)(nResult);
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -/*
          -	11.2 Functions and Operators Related to QNames
          -		op:QName-equal
          -
          -*/
          -
          -// 11.2 Operators Related to QNames
          -// op:QName-equal($arg1 as xs:QName, $arg2 as xs:QName) as xs:boolean
          -hStaticContext_operators["QName-equal"]	= function(oLeft, oRight) {
          -	return new cXSBoolean(oLeft.localName == oRight.localName && oLeft.namespaceURI == oRight.namespaceURI);
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -/*
          -	15.1 General Functions and Operators on Sequences
          -		op:concatenate
          -
          -	15.3 Equals, Union, Intersection and Except
          -		op:union
          -		op:intersect
          -		op:except
          -
          -	15.5 Functions and Operators that Generate Sequences
          -		op:to
          -
          -*/
          -
          -// 15.1 General Functions and Operators on Sequences
          -// op:concatenate($seq1 as item()*, $seq2 as item()*) as item()*
          -hStaticContext_operators["concatenate"]	= function(oSequence1, oSequence2) {
          -	return oSequence1.concat(oSequence2);
          -};
          -
          -// 15.3 Equals, Union, Intersection and Except
          -// op:union($parameter1 as node()*, $parameter2 as node()*) as node()*
          -hStaticContext_operators["union"]	= function(oSequence1, oSequence2) {
          -	var oSequence	= [];
          -	// Process first collection
          -	for (var nIndex = 0, nLength = oSequence1.length, oItem; nIndex < nLength; nIndex++) {
          -		if (!this.DOMAdapter.isNode(oItem = oSequence1[nIndex]))
          -			throw new cException("XPTY0004"
          -
          -			);	// Required item type of second operand of 'intersect' is node(); supplied value has item type xs:integer
          -		//
          -		if (fArray_indexOf(oSequence, oItem) ==-1)
          -			oSequence.push(oItem);
          -	}
          -	// Process second collection
          -	for (var nIndex = 0, nLength = oSequence2.length, oItem; nIndex < nLength; nIndex++) {
          -		if (!this.DOMAdapter.isNode(oItem = oSequence2[nIndex]))
          -			throw new cException("XPTY0004"
          -
          -			);	// Required item type of second operand of 'intersect' is node(); supplied value has item type xs:integer
          -		//
          -		if (fArray_indexOf(oSequence, oItem) ==-1)
          -			oSequence.push(oItem);
          -	}
          -	return fFunction_sequence_order(oSequence, this);
          -};
          -
          -// op:intersect($parameter1 as node()*, $parameter2 as node()*) as node()*
          -hStaticContext_operators["intersect"]	= function(oSequence1, oSequence2) {
          -	var oSequence	= [];
          -	for (var nIndex = 0, nLength = oSequence1.length, oItem, bFound; nIndex < nLength; nIndex++) {
          -		if (!this.DOMAdapter.isNode(oItem = oSequence1[nIndex]))
          -			throw new cException("XPTY0004"
          -
          -			);	// Required item type of second operand of 'intersect' is node(); supplied value has item type xs:integer
          -		//
          -		bFound	= false;
          -		for (var nRightIndex = 0, nRightLength = oSequence2.length;(nRightIndex < nRightLength) && !bFound; nRightIndex++) {
          -			if (!this.DOMAdapter.isNode(oSequence2[nRightIndex]))
          -				throw new cException("XPTY0004"
          -
          -				);
          -			bFound = this.DOMAdapter.isSameNode(oSequence2[nRightIndex], oItem);
          -		}
          -		//
          -		if (bFound && fArray_indexOf(oSequence, oItem) ==-1)
          -			oSequence.push(oItem);
          -	}
          -	return fFunction_sequence_order(oSequence, this);
          -};
          -
          -// op:except($parameter1 as node()*, $parameter2 as node()*) as node()*
          -hStaticContext_operators["except"]	= function(oSequence1, oSequence2) {
          -	var oSequence	= [];
          -	for (var nIndex = 0, nLength = oSequence1.length, oItem, bFound; nIndex < nLength; nIndex++) {
          -		if (!this.DOMAdapter.isNode(oItem = oSequence1[nIndex]))
          -			throw new cException("XPTY0004"
          -
          -			);	// Required item type of second operand of 'intersect' is node(); supplied value has item type xs:integer
          -		//
          -		bFound	= false;
          -		for (var nRightIndex = 0, nRightLength = oSequence2.length;(nRightIndex < nRightLength) && !bFound; nRightIndex++) {
          -			if (!this.DOMAdapter.isNode(oSequence2[nRightIndex]))
          -				throw new cException("XPTY0004"
          -
          -				);
          -			bFound = this.DOMAdapter.isSameNode(oSequence2[nRightIndex], oItem);
          -		}
          -		//
          -		if (!bFound && fArray_indexOf(oSequence, oItem) ==-1)
          -			oSequence.push(oItem);
          -	}
          -	return fFunction_sequence_order(oSequence, this);
          -};
          -
          -// 15.5 Functions and Operators that Generate Sequences
          -// op:to($firstval as xs:integer, $lastval as xs:integer) as xs:integer*
          -hStaticContext_operators["to"]	= function(oLeft, oRight) {
          -	var oSequence	= [];
          -	for (var nIndex = oLeft.valueOf(), nLength = oRight.valueOf(); nIndex <= nLength; nIndex++)
          -		oSequence.push(new cXSInteger(nIndex));
          -	//
          -	return oSequence;
          -};
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -/*
          -	2 Accessors
          -		node-name
          -		nilled
          -		string
          -		data
          -		base-uri
          -		document-uri
          -
          -*/
          -
          -// fn:node-name($arg as node()?) as xs:QName?
          -fStaticContext_defineSystemFunction("node-name",		[[cXTNode, '?']],	function(oNode) {
          -	if (oNode != null) {
          -		var fGetProperty	= this.DOMAdapter.getProperty;
          -		switch (fGetProperty(oNode, "nodeType")) {
          -			case 1:		// ELEMENT_NAME
          -			case 2:		// ATTRIBUTE_NODE
          -				return new cXSQName(fGetProperty(oNode, "prefix"), fGetProperty(oNode, "localName"), fGetProperty(oNode, "namespaceURI"));
          -			case 5:		// ENTITY_REFERENCE_NODE
          -				throw "Not implemented";
          -			case 6:		// ENTITY_NODE
          -				throw "Not implemented";
          -			case 7:		// PROCESSING_INSTRUCTION_NODE
          -				return new cXSQName(null, fGetProperty(oNode, "target"), null);
          -			case 10:	// DOCUMENT_TYPE_NODE
          -				return new cXSQName(null, fGetProperty(oNode, "name"), null);
          -		}
          -	}
          -	//
          -	return null;
          -});
          -
          -// fn:nilled($arg as node()?) as xs:boolean?
          -fStaticContext_defineSystemFunction("nilled",	[[cXTNode, '?']],	function(oNode) {
          -	if (oNode != null) {
          -		if (this.DOMAdapter.getProperty(oNode, "nodeType") == 1)
          -			return new cXSBoolean(false);	// TODO: Determine if node is nilled
          -	}
          -	//
          -	return null;
          -});
          -
          -// fn:string() as xs:string
          -// fn:string($arg as item()?) as xs:string
          -fStaticContext_defineSystemFunction("string",	[[cXTItem, '?', true]],	function(/*[*/oItem/*]*/) {
          -	if (!arguments.length) {
          -		if (!this.item)
          -			throw new cException("XPDY0002");
          -		oItem	= this.item;
          -	}
          -	return oItem == null ? new cXSString('') : cXSString.cast(fFunction_sequence_atomize([oItem], this)[0]);
          -});
          -
          -// fn:data($arg as item()*) as xs:anyAtomicType*
          -fStaticContext_defineSystemFunction("data",	[[cXTItem, '*']],		function(oSequence1) {
          -	return fFunction_sequence_atomize(oSequence1, this);
          -});
          -
          -// fn:base-uri() as xs:anyURI?
          -// fn:base-uri($arg as node()?) as xs:anyURI?
          -fStaticContext_defineSystemFunction("base-uri",	[[cXTNode, '?', true]],	function(oNode) {
          -	if (!arguments.length) {
          -		if (!this.DOMAdapter.isNode(this.item))
          -			throw new cException("XPTY0004"
          -
          -			);
          -		oNode	= this.item;
          -	}
          -	//
          -	return cXSAnyURI.cast(new cXSString(this.DOMAdapter.getProperty(oNode, "baseURI") || ''));
          -});
          -
          -// fn:document-uri($arg as node()?) as xs:anyURI?
          -fStaticContext_defineSystemFunction("document-uri",	[[cXTNode, '?']],	function(oNode) {
          -	if (oNode != null) {
          -		var fGetProperty	= this.DOMAdapter.getProperty;
          -		if (fGetProperty(oNode, "nodeType") == 9)
          -			return cXSAnyURI.cast(new cXSString(fGetProperty(oNode, "documentURI") || ''));
          -	}
          -	//
          -	return null;
          -});
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -/*
          -	8 Functions on anyURI
          -		resolve-uri
          -*/
          -
          -// fn:resolve-uri($relative as xs:string?) as xs:anyURI?
          -// fn:resolve-uri($relative as xs:string?, $base as xs:string) as xs:anyURI?
          -fStaticContext_defineSystemFunction("resolve-uri",	[[cXSString, '?'], [cXSString, '', true]],	function(sUri, sBaseUri) {
          -	if (arguments.length < 2) {
          -		if (!this.DOMAdapter.isNode(this.item))
          -			throw new cException("XPTY0004"
          -
          -			);
          -		sBaseUri	= new cXSString(this.DOMAdapter.getProperty(this.item, "baseURI") || '');
          -	}
          -
          -	if (sUri == null)
          -		return null;
          -
          -	//
          -	if (sUri.valueOf() == '' || sUri.valueOf().charAt(0) == '#')
          -		return cXSAnyURI.cast(sBaseUri);
          -
          -	var oUri	= cXSAnyURI.cast(sUri);
          -	if (oUri.scheme)
          -		return oUri;
          -
          -	var oBaseUri	= cXSAnyURI.cast(sBaseUri);
          -	oUri.scheme	= oBaseUri.scheme;
          -
          -	if (!oUri.authority) {
          -		// authority
          -		oUri.authority	= oBaseUri.authority;
          -
          -		// path
          -		if (oUri.path.charAt(0) != '/') {
          -			var aUriSegments		= oUri.path.split('/'),
          -				aBaseUriSegments	= oBaseUri.path.split('/');
          -			aBaseUriSegments.pop();
          -
          -			var nBaseUriStart	= aBaseUriSegments[0] == '' ? 1 : 0;
          -			for (var nIndex = 0, nLength = aUriSegments.length; nIndex < nLength; nIndex++) {
          -				if (aUriSegments[nIndex] == '..') {
          -					if (aBaseUriSegments.length > nBaseUriStart)
          -						aBaseUriSegments.pop();
          -					else {
          -						aBaseUriSegments.push(aUriSegments[nIndex]);
          -						nBaseUriStart++;
          -					}
          -				}
          -				else
          -				if (aUriSegments[nIndex] != '.')
          -					aBaseUriSegments.push(aUriSegments[nIndex]);
          -			}
          -			if (aUriSegments[--nIndex] == '..' || aUriSegments[nIndex] == '.')
          -				aBaseUriSegments.push('');
          -			//
          -			oUri.path	= aBaseUriSegments.join('/');
          -		}
          -	}
          -
          -	return oUri;
          -});
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -/*
          -	9.1 Additional Boolean Constructor Functions
          -		true
          -		false
          -
          -	9.3 Functions on Boolean Values
          -		not
          -*/
          -
          -// 9.1 Additional Boolean Constructor Functions
          -// fn:true() as xs:boolean
          -fStaticContext_defineSystemFunction("true",	[],	function() {
          -	return new cXSBoolean(true);
          -});
          -
          -// fn:false() as xs:boolean
          -fStaticContext_defineSystemFunction("false",	[],	function() {
          -	return new cXSBoolean(false);
          -});
          -
          -// 9.3 Functions on Boolean Values
          -// fn:not($arg as item()*) as xs:boolean
          -fStaticContext_defineSystemFunction("not",	[[cXTItem, '*']],	function(oSequence1) {
          -	return new cXSBoolean(!fFunction_sequence_toEBV(oSequence1, this));
          -});
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -/*
          -	16 Context Functions
          -		position
          -		last
          -		current-dateTime
          -		current-date
          -		current-time
          -		implicit-timezone
          -		default-collation
          -		static-base-uri
          -
          -*/
          -// fn:position() as xs:integer
          -fStaticContext_defineSystemFunction("position",	[],	function() {
          -	return new cXSInteger(this.position);
          -});
          -
          -// fn:last() as xs:integer
          -fStaticContext_defineSystemFunction("last",	[],	function() {
          -	return new cXSInteger(this.size);
          -});
          -
          -// fn:current-dateTime() as xs:dateTime (2004-05-12T18:17:15.125Z)
          -fStaticContext_defineSystemFunction("current-dateTime",	[],	 function() {
          -	return this.dateTime;
          -});
          -
          -// fn:current-date() as xs:date (2004-05-12+01:00)
          -fStaticContext_defineSystemFunction("current-date",	[],	function() {
          -	return cXSDate.cast(this.dateTime);
          -});
          -
          -// fn:current-time() as xs:time (23:17:00.000-05:00)
          -fStaticContext_defineSystemFunction("current-time",	[],	function() {
          -	return cXSTime.cast(this.dateTime);
          -});
          -
          -// fn:implicit-timezone() as xs:dayTimeDuration
          -fStaticContext_defineSystemFunction("implicit-timezone",	[],	function() {
          -	return this.timezone;
          -});
          -
          -// fn:default-collation() as xs:string
          -fStaticContext_defineSystemFunction("default-collation",	[],	 function() {
          -	return new cXSString(this.staticContext.defaultCollationName);
          -});
          -
          -// fn:static-base-uri() as xs:anyURI?
          -fStaticContext_defineSystemFunction("static-base-uri",	[],	function() {
          -	return cXSAnyURI.cast(new cXSString(this.staticContext.baseURI || ''));
          -});
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -/*
          -	10.5 Component Extraction Functions on Durations, Dates and Times
          -		years-from-duration
          -		months-from-duration
          -		days-from-duration
          -		hours-from-duration
          -		minutes-from-duration
          -		seconds-from-duration
          -		year-from-dateTime
          -		month-from-dateTime
          -		day-from-dateTime
          -		hours-from-dateTime
          -		minutes-from-dateTime
          -		seconds-from-dateTime
          -		timezone-from-dateTime
          -		year-from-date
          -		month-from-date
          -		day-from-date
          -		timezone-from-date
          -		hours-from-time
          -		minutes-from-time
          -		seconds-from-time
          -		timezone-from-time
          -
          -	10.7 Timezone Adjustment Functions on Dates and Time Values
          -		adjust-dateTime-to-timezone
          -		adjust-date-to-timezone
          -		adjust-time-to-timezone
          -*/
          -
          -// 10.5 Component Extraction Functions on Durations, Dates and Times
          -// functions on duration
          -// fn:years-from-duration($arg as xs:duration?) as xs:integer?
          -fStaticContext_defineSystemFunction("years-from-duration",	[[cXSDuration, '?']],	function(oDuration) {
          -	return fFunction_duration_getComponent(oDuration, "year");
          -});
          -
          -// fn:months-from-duration($arg as xs:duration?) as xs:integer?
          -fStaticContext_defineSystemFunction("months-from-duration",	[[cXSDuration, '?']],	function(oDuration) {
          -	return fFunction_duration_getComponent(oDuration, "month");
          -});
          -
          -// fn:days-from-duration($arg as xs:duration?) as xs:integer?
          -fStaticContext_defineSystemFunction("days-from-duration",	[[cXSDuration, '?']],	function(oDuration) {
          -	return fFunction_duration_getComponent(oDuration, "day");
          -});
          -
          -// fn:hours-from-duration($arg as xs:duration?) as xs:integer?
          -fStaticContext_defineSystemFunction("hours-from-duration",	[[cXSDuration, '?']],	function(oDuration) {
          -	return fFunction_duration_getComponent(oDuration, "hours");
          -});
          -
          -// fn:minutes-from-duration($arg as xs:duration?) as xs:integer?
          -fStaticContext_defineSystemFunction("minutes-from-duration",	[[cXSDuration, '?']],	function(oDuration) {
          -	return fFunction_duration_getComponent(oDuration, "minutes");
          -});
          -
          -// fn:seconds-from-duration($arg as xs:duration?) as xs:decimal?
          -fStaticContext_defineSystemFunction("seconds-from-duration",	[[cXSDuration, '?']],	function(oDuration) {
          -	return fFunction_duration_getComponent(oDuration, "seconds");
          -});
          -
          -// functions on dateTime
          -// fn:year-from-dateTime($arg as xs:dateTime?) as xs:integer?
          -fStaticContext_defineSystemFunction("year-from-dateTime",		[[cXSDateTime, '?']],	function(oDateTime) {
          -	return fFunction_dateTime_getComponent(oDateTime,	"year");
          -});
          -
          -// fn:month-from-dateTime($arg as xs:dateTime?) as xs:integer?
          -fStaticContext_defineSystemFunction("month-from-dateTime",		[[cXSDateTime, '?']],	function(oDateTime) {
          -	return fFunction_dateTime_getComponent(oDateTime, "month");
          -});
          -
          -// fn:day-from-dateTime($arg as xs:dateTime?) as xs:integer?
          -fStaticContext_defineSystemFunction("day-from-dateTime",			[[cXSDateTime, '?']],	function(oDateTime) {
          -	return fFunction_dateTime_getComponent(oDateTime, "day");
          -});
          -
          -// fn:hours-from-dateTime($arg as xs:dateTime?) as xs:integer?
          -fStaticContext_defineSystemFunction("hours-from-dateTime",		[[cXSDateTime, '?']],	function(oDateTime) {
          -	return fFunction_dateTime_getComponent(oDateTime, "hours");
          -});
          -
          -// fn:minutes-from-dateTime($arg as xs:dateTime?) as xs:integer?
          -fStaticContext_defineSystemFunction("minutes-from-dateTime",		[[cXSDateTime, '?']],	function(oDateTime) {
          -	return fFunction_dateTime_getComponent(oDateTime, "minutes");
          -});
          -
          -// fn:seconds-from-dateTime($arg as xs:dateTime?) as xs:decimal?
          -fStaticContext_defineSystemFunction("seconds-from-dateTime",		[[cXSDateTime, '?']],	function(oDateTime) {
          -	return fFunction_dateTime_getComponent(oDateTime, "seconds");
          -});
          -
          -// fn:timezone-from-dateTime($arg as xs:dateTime?) as xs:dayTimeDuration?
          -fStaticContext_defineSystemFunction("timezone-from-dateTime",	[[cXSDateTime, '?']],	function(oDateTime) {
          -	return fFunction_dateTime_getComponent(oDateTime, "timezone");
          -});
          -
          -// functions on date
          -// fn:year-from-date($arg as xs:date?) as xs:integer?
          -fStaticContext_defineSystemFunction("year-from-date",	[[cXSDate, '?']],	function(oDate) {
          -	return fFunction_dateTime_getComponent(oDate, "year");
          -});
          -
          -// fn:month-from-date($arg as xs:date?) as xs:integer?
          -fStaticContext_defineSystemFunction("month-from-date",	[[cXSDate, '?']],	function(oDate) {
          -	return fFunction_dateTime_getComponent(oDate, "month");
          -});
          -
          -// fn:day-from-date($arg as xs:date?) as xs:integer?
          -fStaticContext_defineSystemFunction("day-from-date",		[[cXSDate, '?']],	function(oDate) {
          -	return fFunction_dateTime_getComponent(oDate, "day");
          -});
          -
          -// fn:timezone-from-date($arg as xs:date?) as xs:dayTimeDuration?
          -fStaticContext_defineSystemFunction("timezone-from-date",	[[cXSDate, '?']],	function(oDate) {
          -	return fFunction_dateTime_getComponent(oDate, "timezone");
          -});
          -
          -// functions on time
          -// fn:hours-from-time($arg as xs:time?) as xs:integer?
          -fStaticContext_defineSystemFunction("hours-from-time",		[[cXSTime, '?']],	function(oTime) {
          -	return fFunction_dateTime_getComponent(oTime, "hours");
          -});
          -
          -// fn:minutes-from-time($arg as xs:time?) as xs:integer?
          -fStaticContext_defineSystemFunction("minutes-from-time",		[[cXSTime, '?']],	function(oTime) {
          -	return fFunction_dateTime_getComponent(oTime, "minutes");
          -});
          -
          -// fn:seconds-from-time($arg as xs:time?) as xs:decimal?
          -fStaticContext_defineSystemFunction("seconds-from-time",		[[cXSTime, '?']],	function(oTime) {
          -	return fFunction_dateTime_getComponent(oTime, "seconds");
          -});
          -
          -// fn:timezone-from-time($arg as xs:time?) as xs:dayTimeDuration?
          -fStaticContext_defineSystemFunction("timezone-from-time",	[[cXSTime, '?']],	function(oTime) {
          -	return fFunction_dateTime_getComponent(oTime, "timezone");
          -});
          -
          -
          -// 10.7 Timezone Adjustment Functions on Dates and Time Values
          -// fn:adjust-dateTime-to-timezone($arg as xs:dateTime?) as xs:dateTime?
          -// fn:adjust-dateTime-to-timezone($arg as xs:dateTime?, $timezone as xs:dayTimeDuration?) as xs:dateTime?
          -fStaticContext_defineSystemFunction("adjust-dateTime-to-timezone",	[[cXSDateTime, '?'], [cXSDayTimeDuration, '?', true]],	function(oDateTime, oDayTimeDuration) {
          -	return fFunction_dateTime_adjustTimezone(oDateTime, arguments.length > 1 && oDayTimeDuration != null ? arguments.length > 1 ? oDayTimeDuration : this.timezone : null);
          -});
          -
          -// fn:adjust-date-to-timezone($arg as xs:date?) as xs:date?
          -// fn:adjust-date-to-timezone($arg as xs:date?, $timezone as xs:dayTimeDuration?) as xs:date?
          -fStaticContext_defineSystemFunction("adjust-date-to-timezone",		[[cXSDate, '?'], [cXSDayTimeDuration, '?', true]],	function(oDate, oDayTimeDuration) {
          -	return fFunction_dateTime_adjustTimezone(oDate, arguments.length > 1 && oDayTimeDuration != null ? arguments.length > 1 ? oDayTimeDuration : this.timezone : null);
          -});
          -
          -// fn:adjust-time-to-timezone($arg as xs:time?) as xs:time?
          -// fn:adjust-time-to-timezone($arg as xs:time?, $timezone as xs:dayTimeDuration?) as xs:time?
          -fStaticContext_defineSystemFunction("adjust-time-to-timezone",		[[cXSTime, '?'], [cXSDayTimeDuration, '?', true]],	function(oTime, oDayTimeDuration) {
          -	return fFunction_dateTime_adjustTimezone(oTime, arguments.length > 1 && oDayTimeDuration != null ? arguments.length > 1 ? oDayTimeDuration : this.timezone : null);
          -});
          -
          -//
          -function fFunction_duration_getComponent(oDuration, sName) {
          -	if (oDuration == null)
          -		return null;
          -
          -	var nValue	= oDuration[sName] * (oDuration.negative ?-1 : 1);
          -	return sName == "seconds" ? new cXSDecimal(nValue) : new cXSInteger(nValue);
          -};
          -
          -//
          -function fFunction_dateTime_getComponent(oDateTime, sName) {
          -	if (oDateTime == null)
          -		return null;
          -
          -	if (sName == "timezone") {
          -		var nTimezone	= oDateTime.timezone;
          -		if (nTimezone == null)
          -			return null;
          -		return new cXSDayTimeDuration(0, cMath.abs(~~(nTimezone / 60)), cMath.abs(nTimezone % 60), 0, nTimezone < 0);
          -	}
          -	else {
          -		var nValue	= oDateTime[sName];
          -		if (!(oDateTime instanceof cXSDate)) {
          -			if (sName == "hours")
          -				if (nValue == 24)
          -					nValue	= 0;
          -		}
          -		if (!(oDateTime instanceof cXSTime))
          -			nValue	*= oDateTime.negative ?-1 : 1;
          -		return sName == "seconds" ? new cXSDecimal(nValue) : new cXSInteger(nValue);
          -	}
          -};
          -
          -//
          -function fFunction_dateTime_adjustTimezone(oDateTime, oTimezone) {
          -	if (oDateTime == null)
          -		return null;
          -
          -	// Create a copy
          -	var oValue;
          -	if (oDateTime instanceof cXSDate)
          -		oValue	= new cXSDate(oDateTime.year, oDateTime.month, oDateTime.day, oDateTime.timezone, oDateTime.negative);
          -	else
          -	if (oDateTime instanceof cXSTime)
          -		oValue	= new cXSTime(oDateTime.hours, oDateTime.minutes, oDateTime.seconds, oDateTime.timezone, oDateTime.negative);
          -	else
          -		oValue	= new cXSDateTime(oDateTime.year, oDateTime.month, oDateTime.day, oDateTime.hours, oDateTime.minutes, oDateTime.seconds, oDateTime.timezone, oDateTime.negative);
          -
          -	//
          -	if (oTimezone == null)
          -		oValue.timezone	= null;
          -	else {
          -		var nTimezone	= fOperator_dayTimeDuration_toSeconds(oTimezone) / 60;
          -		if (oDateTime.timezone != null) {
          -			var nDiff	= nTimezone - oDateTime.timezone;
          -			if (oDateTime instanceof cXSDate) {
          -				if (nDiff < 0)
          -					oValue.day--;
          -			}
          -			else {
          -				oValue.minutes	+= nDiff % 60;
          -				oValue.hours	+= ~~(nDiff / 60);
          -			}
          -			//
          -			fXSDateTime_normalize(oValue);
          -		}
          -		oValue.timezone	= nTimezone;
          -	}
          -	return oValue;
          -};
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -/*
          -	14 Functions and Operators on Nodes
          -		name
          -		local-name
          -		namespace-uri
          -		number
          -		lang
          -		root
          -
          -*/
          -
          -// 14 Functions on Nodes
          -// fn:name() as xs:string
          -// fn:name($arg as node()?) as xs:string
          -fStaticContext_defineSystemFunction("name",	[[cXTNode, '?', true]],	function(oNode) {
          -	if (!arguments.length) {
          -		if (!this.DOMAdapter.isNode(this.item))
          -			throw new cException("XPTY0004"
          -
          -			);
          -		oNode	= this.item;
          -	}
          -	else
          -	if (oNode == null)
          -		return new cXSString('');
          -	//
          -	var vValue	= hStaticContext_functions["node-name"].call(this, oNode);
          -	return new cXSString(vValue == null ? '' : vValue.toString());
          -});
          -
          -// fn:local-name() as xs:string
          -// fn:local-name($arg as node()?) as xs:string
          -fStaticContext_defineSystemFunction("local-name",	[[cXTNode, '?', true]],	function(oNode) {
          -	if (!arguments.length) {
          -		if (!this.DOMAdapter.isNode(this.item))
          -			throw new cException("XPTY0004"
          -
          -			);
          -		oNode	= this.item;
          -	}
          -	else
          -	if (oNode == null)
          -		return new cXSString('');
          -	//
          -	return new cXSString(this.DOMAdapter.getProperty(oNode, "localName") || '');
          -});
          -
          -// fn:namespace-uri() as xs:anyURI
          -// fn:namespace-uri($arg as node()?) as xs:anyURI
          -fStaticContext_defineSystemFunction("namespace-uri",	[[cXTNode, '?', true]],	function(oNode) {
          -	if (!arguments.length) {
          -		if (!this.DOMAdapter.isNode(this.item))
          -			throw new cException("XPTY0004"
          -
          -			);
          -		oNode	= this.item;
          -	}
          -	else
          -	if (oNode == null)
          -		return cXSAnyURI.cast(new cXSString(''));
          -	//
          -	return cXSAnyURI.cast(new cXSString(this.DOMAdapter.getProperty(oNode, "namespaceURI") || ''));
          -});
          -
          -// fn:number() as xs:double
          -// fn:number($arg as xs:anyAtomicType?) as xs:double
          -fStaticContext_defineSystemFunction("number",	[[cXSAnyAtomicType, '?', true]],	function(/*[*/oItem/*]*/) {
          -	if (!arguments.length) {
          -		if (!this.item)
          -			throw new cException("XPDY0002");
          -		oItem	= fFunction_sequence_atomize([this.item], this)[0];
          -	}
          -
          -	// If input item cannot be cast to xs:decimal, a NaN should be returned
          -	var vValue	= new cXSDouble(nNaN);
          -	if (oItem != null) {
          -		try {
          -			vValue	= cXSDouble.cast(oItem);
          -		}
          -		catch (e) {
          -
          -		}
          -	}
          -	return vValue;
          -});
          -
          -// fn:lang($testlang as xs:string?) as xs:boolean
          -// fn:lang($testlang as xs:string?, $node as node()) as xs:boolean
          -fStaticContext_defineSystemFunction("lang",	[[cXSString, '?'], [cXTNode, '', true]],	function(sLang, oNode) {
          -	if (arguments.length < 2) {
          -		if (!this.DOMAdapter.isNode(this.item))
          -			throw new cException("XPTY0004"
          -
          -			);
          -		oNode	= this.item;
          -	}
          -
          -	var fGetProperty	= this.DOMAdapter.getProperty;
          -	if (fGetProperty(oNode, "nodeType") == 2)
          -		oNode	= fGetProperty(oNode, "ownerElement");
          -
          -	// walk up the tree looking for xml:lang attribute
          -	for (var aAttributes; oNode; oNode = fGetProperty(oNode, "parentNode"))
          -		if (aAttributes = fGetProperty(oNode, "attributes"))
          -			for (var nIndex = 0, nLength = aAttributes.length; nIndex < nLength; nIndex++)
          -				if (fGetProperty(aAttributes[nIndex], "nodeName") == "xml:lang")
          -					return new cXSBoolean(fGetProperty(aAttributes[nIndex], "value").replace(/-.+/, '').toLowerCase() == sLang.valueOf().replace(/-.+/, '').toLowerCase());
          -	//
          -	return new cXSBoolean(false);
          -});
          -
          -// fn:root() as node()
          -// fn:root($arg as node()?) as node()?
          -fStaticContext_defineSystemFunction("root",	[[cXTNode, '?', true]],	function(oNode) {
          -	if (!arguments.length) {
          -		if (!this.DOMAdapter.isNode(this.item))
          -			throw new cException("XPTY0004"
          -
          -			);
          -		oNode	= this.item;
          -	}
          -	else
          -	if (oNode == null)
          -		return null;
          -
          -	var fGetProperty	= this.DOMAdapter.getProperty;
          -
          -	// If context node is Attribute
          -	if (fGetProperty(oNode, "nodeType") == 2)
          -		oNode	= fGetProperty(oNode, "ownerElement");
          -
          -	for (var oParent = oNode; oParent; oParent = fGetProperty(oNode, "parentNode"))
          -		oNode	= oParent;
          -
          -	return oNode;
          -});
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -/*
          -	6.4 Functions on Numeric Values
          -		abs
          -		ceiling
          -		floor
          -		round
          -		round-half-to-even
          -*/
          -
          -// 6.4 Functions on Numeric Values
          -// fn:abs($arg as numeric?) as numeric?
          -fStaticContext_defineSystemFunction("abs",		[[cXSDouble, '?']],	function(oValue) {
          -	return new cXSDecimal(cMath.abs(oValue));
          -});
          -
          -// fn:ceiling($arg as numeric?) as numeric?
          -fStaticContext_defineSystemFunction("ceiling",	[[cXSDouble, '?']],	function(oValue) {
          -	return new cXSDecimal(cMath.ceil(oValue));
          -});
          -
          -// fn:floor($arg as numeric?) as numeric?
          -fStaticContext_defineSystemFunction("floor",		[[cXSDouble, '?']],	function(oValue) {
          -	return new cXSDecimal(cMath.floor(oValue));
          -});
          -
          -// fn:round($arg as numeric?) as numeric?
          -fStaticContext_defineSystemFunction("round",		[[cXSDouble, '?']],	function(oValue) {
          -	return new cXSDecimal(cMath.round(oValue));
          -});
          -
          -// fn:round-half-to-even($arg as numeric?) as numeric?
          -// fn:round-half-to-even($arg as numeric?, $precision as xs:integer) as numeric?
          -fStaticContext_defineSystemFunction("round-half-to-even",	[[cXSDouble, '?'], [cXSInteger, '', true]],	function(oValue, oPrecision) {
          -	var nPrecision	= arguments.length > 1 ? oPrecision.valueOf() : 0;
          -
          -	//
          -	if (nPrecision < 0) {
          -		var oPower	= new cXSInteger(cMath.pow(10,-nPrecision)),
          -			nRounded= cMath.round(hStaticContext_operators["numeric-divide"].call(this, oValue, oPower)),
          -			oRounded= new cXSInteger(nRounded);
          -			nDecimal= cMath.abs(hStaticContext_operators["numeric-subtract"].call(this, oRounded, hStaticContext_operators["numeric-divide"].call(this, oValue, oPower)));
          -		return hStaticContext_operators["numeric-multiply"].call(this, hStaticContext_operators["numeric-add"].call(this, oRounded, new cXSDecimal(nDecimal == 0.5 && nRounded % 2 ?-1 : 0)), oPower);
          -	}
          -	else {
          -		var oPower	= new cXSInteger(cMath.pow(10, nPrecision)),
          -			nRounded= cMath.round(hStaticContext_operators["numeric-multiply"].call(this, oValue, oPower)),
          -			oRounded= new cXSInteger(nRounded);
          -			nDecimal= cMath.abs(hStaticContext_operators["numeric-subtract"].call(this, oRounded, hStaticContext_operators["numeric-multiply"].call(this, oValue, oPower)));
          -		return hStaticContext_operators["numeric-divide"].call(this, hStaticContext_operators["numeric-add"].call(this, oRounded, new cXSDecimal(nDecimal == 0.5 && nRounded % 2 ?-1 : 0)), oPower);
          -	}
          -});
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -/*
          -	11.1 Additional Constructor Functions for QNames
          -		resolve-QName
          -		QName
          -
          -	11.2 Functions and Operators Related to QNames
          -		prefix-from-QName
          -		local-name-from-QName
          -		namespace-uri-from-QName
          -		namespace-uri-for-prefix
          -		in-scope-prefixes
          -
          -*/
          -
          -// 11.1 Additional Constructor Functions for QNames
          -// fn:resolve-QName($qname as xs:string?, $element as element()) as xs:QName?
          -fStaticContext_defineSystemFunction("resolve-QName",	[[cXSString, '?'], [cXTElement]],	function(oQName, oElement) {
          -	if (oQName == null)
          -		return null;
          -
          -	var sQName	= oQName.valueOf(),
          -		aMatch	= sQName.match(rXSQName);
          -	if (!aMatch)
          -		throw new cException("FOCA0002"
          -
          -		);
          -
          -	var sPrefix	= aMatch[1] || null,
          -		sLocalName	= aMatch[2],
          -		sNameSpaceURI = this.DOMAdapter.lookupNamespaceURI(oElement, sPrefix);
          -	//
          -	if (sPrefix != null &&!sNameSpaceURI)
          -		throw new cException("FONS0004"
          -
          -		);
          -
          -	return new cXSQName(sPrefix, sLocalName, sNameSpaceURI || null);
          -});
          -
          -// fn:QName($paramURI as xs:string?, $paramQName as xs:string) as xs:QName
          -fStaticContext_defineSystemFunction("QName",		[[cXSString, '?'], [cXSString]],	function(oUri, oQName) {
          -	var sQName	= oQName.valueOf(),
          -		aMatch	= sQName.match(rXSQName);
          -
          -	if (!aMatch)
          -		throw new cException("FOCA0002"
          -
          -		);
          -
          -	return new cXSQName(aMatch[1] || null, aMatch[2] || null, oUri == null ? '' : oUri.valueOf());
          -});
          -
          -// 11.2 Functions Related to QNames
          -// fn:prefix-from-QName($arg as xs:QName?) as xs:NCName?
          -fStaticContext_defineSystemFunction("prefix-from-QName",			[[cXSQName, '?']],	function(oQName) {
          -	if (oQName != null) {
          -		if (oQName.prefix)
          -			return new cXSNCName(oQName.prefix);
          -	}
          -	//
          -	return null;
          -});
          -
          -// fn:local-name-from-QName($arg as xs:QName?) as xs:NCName?
          -fStaticContext_defineSystemFunction("local-name-from-QName",		[[cXSQName, '?']],	function(oQName) {
          -	if (oQName == null)
          -		return null;
          -
          -	return new cXSNCName(oQName.localName);
          -});
          -
          -// fn:namespace-uri-from-QName($arg as xs:QName?) as xs:anyURI?
          -fStaticContext_defineSystemFunction("namespace-uri-from-QName",	[[cXSQName, '?']],	function(oQName) {
          -	if (oQName == null)
          -		return null;
          -
          -	return cXSAnyURI.cast(new cXSString(oQName.namespaceURI || ''));
          -});
          -
          -// fn:namespace-uri-for-prefix($prefix as xs:string?, $element as element()) as xs:anyURI?
          -fStaticContext_defineSystemFunction("namespace-uri-for-prefix",	[[cXSString, '?'], [cXTElement]],	function(oPrefix, oElement) {
          -	var sPrefix	= oPrefix == null ? '' : oPrefix.valueOf(),
          -		sNameSpaceURI	= this.DOMAdapter.lookupNamespaceURI(oElement, sPrefix || null);
          -
          -	return sNameSpaceURI == null ? null : cXSAnyURI.cast(new cXSString(sNameSpaceURI));
          -});
          -
          -// fn:in-scope-prefixes($element as element()) as xs:string*
          -fStaticContext_defineSystemFunction("in-scope-prefixes",	[[cXTElement]],	function(oElement) {
          -	throw "Function '" + "in-scope-prefixes" + "' not implemented";
          -});
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -/*
          -	15.1 General Functions and Operators on Sequences
          -		boolean
          -		index-of
          -		empty
          -		exists
          -		distinct-values
          -		insert-before
          -		remove
          -		reverse
          -		subsequence
          -		unordered
          -
          -	15.2 Functions That Test the Cardinality of Sequences
          -		zero-or-one
          -		one-or-more
          -		exactly-one
          -
          -	15.3 Equals, Union, Intersection and Except
          -		deep-equal
          -
          -	15.4 Aggregate Functions
          -		count
          -		avg
          -		max
          -		min
          -		sum
          -
          -	15.5 Functions and Operators that Generate Sequences
          -		id
          -		idref
          -		doc
          -		doc-available
          -		collection
          -		element-with-id
          -
          -*/
          -
          -// 15.1 General Functions and Operators on Sequences
          -// fn:boolean($arg as item()*) as xs:boolean
          -fStaticContext_defineSystemFunction("boolean",	[[cXTItem, '*']],	function(oSequence1) {
          -	return new cXSBoolean(fFunction_sequence_toEBV(oSequence1, this));
          -});
          -
          -// fn:index-of($seqParam as xs:anyAtomicType*, $srchParam as xs:anyAtomicType) as xs:integer*
          -// fn:index-of($seqParam as xs:anyAtomicType*, $srchParam as xs:anyAtomicType, $collation as xs:string) as xs:integer*
          -fStaticContext_defineSystemFunction("index-of",	[[cXSAnyAtomicType, '*'], [cXSAnyAtomicType], [cXSString, '', true]],	function(oSequence1, oSearch, oCollation) {
          -	if (!oSequence1.length || oSearch == null)
          -		return [];
          -
          -	// TODO: Implement collation
          -
          -	var vLeft	= oSearch;
          -	// Cast to XSString if Untyped
          -	if (vLeft instanceof cXSUntypedAtomic)
          -		vLeft	= cXSString.cast(vLeft);
          -
          -	var oSequence	= [];
          -	for (var nIndex = 0, nLength = oSequence1.length, vRight; nIndex < nLength; nIndex++) {
          -		vRight	= oSequence1[nIndex];
          -		// Cast to XSString if Untyped
          -		if (vRight instanceof cXSUntypedAtomic)
          -			vRight	= cXSString.cast(vRight);
          -		//
          -		if (vRight.valueOf() === vLeft.valueOf())
          -			oSequence.push(new cXSInteger(nIndex + 1));
          -	}
          -
          -	return oSequence;
          -});
          -
          -// fn:empty($arg as item()*) as xs:boolean
          -fStaticContext_defineSystemFunction("empty",	[[cXTItem, '*']],	function(oSequence1) {
          -	return new cXSBoolean(!oSequence1.length);
          -});
          -
          -// fn:exists($arg as item()*) as xs:boolean
          -fStaticContext_defineSystemFunction("exists",	[[cXTItem, '*']],	function(oSequence1) {
          -	return new cXSBoolean(!!oSequence1.length);
          -});
          -
          -// fn:distinct-values($arg as xs:anyAtomicType*) as xs:anyAtomicType*
          -// fn:distinct-values($arg as xs:anyAtomicType*, $collation as xs:string) as xs:anyAtomicType*
          -fStaticContext_defineSystemFunction("distinct-values",	[[cXSAnyAtomicType, '*'], [cXSString, '', true]],	function(oSequence1, oCollation) {
          -	if (arguments.length > 1)
          -		throw "Collation parameter in function '" + "distinct-values" + "' is not implemented";
          -
          -	if (!oSequence1.length)
          -		return null;
          -
          -	var oSequence	= [];
          -	for (var nIndex = 0, nLength = oSequence1.length, vLeft; nIndex < nLength; nIndex++) {
          -		vLeft	= oSequence1[nIndex];
          -		// Cast to XSString if Untyped
          -		if (vLeft instanceof cXSUntypedAtomic)
          -			vLeft	= cXSString.cast(vLeft);
          -		for (var nRightIndex = 0, nRightLength = oSequence.length, vRight, bFound = false; (nRightIndex < nRightLength) &&!bFound; nRightIndex++) {
          -			vRight	= oSequence[nRightIndex];
          -			// Cast to XSString if Untyped
          -			if (vRight instanceof cXSUntypedAtomic)
          -				vRight	= cXSString.cast(vRight);
          -			//
          -			if (vRight.valueOf() === vLeft.valueOf())
          -				bFound	= true;
          -		}
          -		if (!bFound)
          -			oSequence.push(oSequence1[nIndex]);
          -	}
          -
          -	return oSequence;
          -});
          -
          -// fn:insert-before($target as item()*, $position as xs:integer, $inserts as item()*) as item()*
          -fStaticContext_defineSystemFunction("insert-before",	[[cXTItem, '*'], [cXSInteger], [cXTItem, '*']],	function(oSequence1, oPosition, oSequence3) {
          -	if (!oSequence1.length)
          -		return oSequence3;
          -	if (!oSequence3.length)
          -		return oSequence1;
          -
          -	var nLength 	= oSequence1.length,
          -		nPosition	= oPosition.valueOf();
          -	if (nPosition < 1)
          -		nPosition	= 1;
          -	else
          -	if (nPosition > nLength)
          -		nPosition	= nLength + 1;
          -
          -	var oSequence	=  [];
          -	for (var nIndex = 0; nIndex < nLength; nIndex++) {
          -		if (nPosition == nIndex + 1)
          -			oSequence	= oSequence.concat(oSequence3);
          -		oSequence.push(oSequence1[nIndex]);
          -	}
          -	if (nPosition == nIndex + 1)
          -		oSequence	= oSequence.concat(oSequence3);
          -
          -	return oSequence;
          -});
          -
          -// fn:remove($target as item()*, $position as xs:integer) as item()*
          -fStaticContext_defineSystemFunction("remove",	[[cXTItem, '*'], [cXSInteger]],	function(oSequence1, oPosition) {
          -	if (!oSequence1.length)
          -		return [];
          -
          -	var nLength 	= oSequence1.length,
          -		nPosition	= oPosition.valueOf();
          -
          -	if (nPosition < 1 || nPosition > nLength)
          -		return oSequence1;
          -
          -	var oSequence	=  [];
          -	for (var nIndex = 0; nIndex < nLength; nIndex++)
          -		if (nPosition != nIndex + 1)
          -			oSequence.push(oSequence1[nIndex]);
          -
          -	return oSequence;
          -});
          -
          -// fn:reverse($arg as item()*) as item()*
          -fStaticContext_defineSystemFunction("reverse",	[[cXTItem, '*']],	function(oSequence1) {
          -	oSequence1.reverse();
          -
          -	return oSequence1;
          -});
          -
          -// fn:subsequence($sourceSeq as item()*, $startingLoc as xs:double) as item()*
          -// fn:subsequence($sourceSeq as item()*, $startingLoc as xs:double, $length as xs:double) as item()*
          -fStaticContext_defineSystemFunction("subsequence",	[[cXTItem, '*'], [cXSDouble, ''], [cXSDouble, '', true]],	function(oSequence1, oStart, oLength) {
          -	var nPosition	= cMath.round(oStart),
          -		nLength		= arguments.length > 2 ? cMath.round(oLength) : oSequence1.length - nPosition + 1;
          -
          -	// TODO: Handle out-of-range position and length values
          -	return oSequence1.slice(nPosition - 1, nPosition - 1 + nLength);
          -});
          -
          -// fn:unordered($sourceSeq as item()*) as item()*
          -fStaticContext_defineSystemFunction("unordered",	[[cXTItem, '*']],	function(oSequence1) {
          -	return oSequence1;
          -});
          -
          -
          -// 15.2 Functions That Test the Cardinality of Sequences
          -// fn:zero-or-one($arg as item()*) as item()?
          -fStaticContext_defineSystemFunction("zero-or-one",	[[cXTItem, '*']],	function(oSequence1) {
          -	if (oSequence1.length > 1)
          -		throw new cException("FORG0003");
          -
          -	return oSequence1;
          -});
          -
          -// fn:one-or-more($arg as item()*) as item()+
          -fStaticContext_defineSystemFunction("one-or-more",	[[cXTItem, '*']],	function(oSequence1) {
          -	if (!oSequence1.length)
          -		throw new cException("FORG0004");
          -
          -	return oSequence1;
          -});
          -
          -// fn:exactly-one($arg as item()*) as item()
          -fStaticContext_defineSystemFunction("exactly-one",	[[cXTItem, '*']],	function(oSequence1) {
          -	if (oSequence1.length != 1)
          -		throw new cException("FORG0005");
          -
          -	return oSequence1;
          -});
          -
          -
          -// 15.3 Equals, Union, Intersection and Except
          -// fn:deep-equal($parameter1 as item()*, $parameter2 as item()*) as xs:boolean
          -// fn:deep-equal($parameter1 as item()*, $parameter2 as item()*, $collation as string) as xs:boolean
          -fStaticContext_defineSystemFunction("deep-equal",	[[cXTItem, '*'], [cXTItem, '*'], [cXSString, '', true]],	function(oSequence1, oSequence2, oCollation) {
          -	throw "Function '" + "deep-equal" + "' not implemented";
          -});
          -
          -
          -// 15.4 Aggregate Functions
          -// fn:count($arg as item()*) as xs:integer
          -fStaticContext_defineSystemFunction("count",	[[cXTItem, '*']],	function(oSequence1) {
          -	return new cXSInteger(oSequence1.length);
          -});
          -
          -// fn:avg($arg as xs:anyAtomicType*) as xs:anyAtomicType?
          -fStaticContext_defineSystemFunction("avg",	[[cXSAnyAtomicType, '*']],	function(oSequence1) {
          -	if (!oSequence1.length)
          -		return null;
          -
          -	//
          -	try {
          -		var vValue	= oSequence1[0];
          -		if (vValue instanceof cXSUntypedAtomic)
          -			vValue	= cXSDouble.cast(vValue);
          -		for (var nIndex = 1, nLength = oSequence1.length, vRight; nIndex < nLength; nIndex++) {
          -			vRight	= oSequence1[nIndex];
          -			if (vRight instanceof cXSUntypedAtomic)
          -				vRight	= cXSDouble.cast(vRight);
          -			vValue	= hAdditiveExpr_operators['+'](vValue, vRight, this);
          -		}
          -		return hMultiplicativeExpr_operators['div'](vValue, new cXSInteger(nLength), this);
          -	}
          -	catch (e) {
          -		// XPTY0004: Arithmetic operator is not defined for provided arguments
          -		throw e.code != "XPTY0004" ? e : new cException("FORG0006"
          -
          -		);
          -	}
          -});
          -
          -// fn:max($arg as xs:anyAtomicType*) as xs:anyAtomicType?
          -// fn:max($arg as xs:anyAtomicType*, $collation as string) as xs:anyAtomicType?
          -fStaticContext_defineSystemFunction("max",	[[cXSAnyAtomicType, '*'], [cXSString, '', true]],	function(oSequence1, oCollation) {
          -	if (!oSequence1.length)
          -		return null;
          -
          -	// TODO: Implement collation
          -
          -	//
          -	try {
          -		var vValue	= oSequence1[0];
          -		if (vValue instanceof cXSUntypedAtomic)
          -			vValue	= cXSDouble.cast(vValue);
          -		for (var nIndex = 1, nLength = oSequence1.length, vRight; nIndex < nLength; nIndex++) {
          -			vRight	= oSequence1[nIndex];
          -			if (vRight instanceof cXSUntypedAtomic)
          -				vRight	= cXSDouble.cast(vRight);
          -			if (hComparisonExpr_ValueComp_operators['ge'](vRight, vValue, this).valueOf())
          -				vValue	= vRight;
          -		}
          -		return vValue;
          -	}
          -	catch (e) {
          -		// XPTY0004: Cannot compare {type1} with {type2}
          -		throw e.code != "XPTY0004" ? e : new cException("FORG0006"
          -
          -		);
          -	}
          -});
          -
          -// fn:min($arg as xs:anyAtomicType*) as xs:anyAtomicType?
          -// fn:min($arg as xs:anyAtomicType*, $collation as string) as xs:anyAtomicType?
          -fStaticContext_defineSystemFunction("min",	[[cXSAnyAtomicType, '*'], [cXSString, '', true]],	function(oSequence1, oCollation) {
          -	if (!oSequence1.length)
          -		return null;
          -
          -	// TODO: Implement collation
          -
          -	//
          -	try {
          -		var vValue	= oSequence1[0];
          -		if (vValue instanceof cXSUntypedAtomic)
          -			vValue	= cXSDouble.cast(vValue);
          -		for (var nIndex = 1, nLength = oSequence1.length, vRight; nIndex < nLength; nIndex++) {
          -			vRight	= oSequence1[nIndex];
          -			if (vRight instanceof cXSUntypedAtomic)
          -				vRight	= cXSDouble.cast(vRight);
          -			if (hComparisonExpr_ValueComp_operators['le'](vRight, vValue, this).valueOf())
          -				vValue	= vRight;
          -			}
          -		return vValue;
          -	}
          -	catch (e) {
          -		// Cannot compare {type1} with {type2}
          -		throw e.code != "XPTY0004" ? e : new cException("FORG0006"
          -
          -		);
          -	}
          -});
          -
          -// fn:sum($arg as xs:anyAtomicType*) as xs:anyAtomicType
          -// fn:sum($arg as xs:anyAtomicType*, $zero as xs:anyAtomicType?) as xs:anyAtomicType?
          -fStaticContext_defineSystemFunction("sum",	[[cXSAnyAtomicType, '*'], [cXSAnyAtomicType, '?', true]],	function(oSequence1, oZero) {
          -	if (!oSequence1.length) {
          -		if (arguments.length > 1)
          -			return oZero;
          -		else
          -			return new cXSDouble(0);
          -
          -		return null;
          -	}
          -
          -	// TODO: Implement collation
          -
          -	//
          -	try {
          -		var vValue	= oSequence1[0];
          -		if (vValue instanceof cXSUntypedAtomic)
          -			vValue	= cXSDouble.cast(vValue);
          -		for (var nIndex = 1, nLength = oSequence1.length, vRight; nIndex < nLength; nIndex++) {
          -			vRight	= oSequence1[nIndex];
          -			if (vRight instanceof cXSUntypedAtomic)
          -				vRight	= cXSDouble.cast(vRight);
          -			vValue	= hAdditiveExpr_operators['+'](vValue, vRight, this);
          -		}
          -		return vValue;
          -	}
          -	catch (e) {
          -		// XPTY0004: Arithmetic operator is not defined for provided arguments
          -		throw e.code != "XPTY0004" ? e : new cException("FORG0006"
          -
          -		);
          -	}
          -});
          -
          -
          -// 15.5 Functions and Operators that Generate Sequences
          -// fn:id($arg as xs:string*) as element()*
          -// fn:id($arg as xs:string*, $node as node()) as element()*
          -fStaticContext_defineSystemFunction("id",	[[cXSString, '*'], [cXTNode, '', true]],	function(oSequence1, oNode) {
          -	if (arguments.length < 2) {
          -		if (!this.DOMAdapter.isNode(this.item))
          -			throw new cException("XPTY0004"
          -
          -			);
          -		oNode	= this.item;
          -	}
          -
          -	// Get root node and check if it is Document
          -	var oDocument	= hStaticContext_functions["root"].call(this, oNode);
          -	if (this.DOMAdapter.getProperty(oDocument, "nodeType") != 9)
          -		throw new cException("FODC0001");
          -
          -	// Search for elements
          -	var oSequence	= [];
          -	for (var nIndex = 0; nIndex < oSequence1.length; nIndex++)
          -		for (var nRightIndex = 0, aValue = fString_trim(oSequence1[nIndex]).split(/\s+/), nRightLength = aValue.length; nRightIndex < nRightLength; nRightIndex++)
          -			if ((oNode = this.DOMAdapter.getElementById(oDocument, aValue[nRightIndex])) && fArray_indexOf(oSequence, oNode) ==-1)
          -				oSequence.push(oNode);
          -	//
          -	return fFunction_sequence_order(oSequence, this);
          -});
          -
          -// fn:idref($arg as xs:string*) as node()*
          -// fn:idref($arg as xs:string*, $node as node()) as node()*
          -fStaticContext_defineSystemFunction("idref",	[[cXSString, '*'], [cXTNode, '', true]],	function(oSequence1, oNode) {
          -	throw "Function '" + "idref" + "' not implemented";
          -});
          -
          -// fn:doc($uri as xs:string?) as document-node()?
          -fStaticContext_defineSystemFunction("doc",			[[cXSString, '?', true]],	function(oUri) {
          -	throw "Function '" + "doc" + "' not implemented";
          -});
          -
          -// fn:doc-available($uri as xs:string?) as xs:boolean
          -fStaticContext_defineSystemFunction("doc-available",	[[cXSString, '?', true]],	function(oUri) {
          -	throw "Function '" + "doc-available" + "' not implemented";
          -});
          -
          -// fn:collection() as node()*
          -// fn:collection($arg as xs:string?) as node()*
          -fStaticContext_defineSystemFunction("collection",	[[cXSString, '?', true]],	function(oUri) {
          -	throw "Function '" + "collection" + "' not implemented";
          -});
          -
          -// fn:element-with-id($arg as xs:string*) as element()*
          -// fn:element-with-id($arg as xs:string*, $node as node()) as element()*
          -fStaticContext_defineSystemFunction("element-with-id",	[[cXSString, '*'], [cXTNode, '', true]],	function(oSequence1, oNode) {
          -	throw "Function '" + "element-with-id" + "' not implemented";
          -});
          -
          -// EBV calculation
          -function fFunction_sequence_toEBV(oSequence1, oContext) {
          -	if (!oSequence1.length)
          -		return false;
          -
          -	var oItem	= oSequence1[0];
          -	if (oContext.DOMAdapter.isNode(oItem))
          -		return true;
          -
          -	if (oSequence1.length == 1) {
          -		if (oItem instanceof cXSBoolean)
          -			return oItem.value.valueOf();
          -		if (oItem instanceof cXSString)
          -			return !!oItem.valueOf().length;
          -		if (fXSAnyAtomicType_isNumeric(oItem))
          -			return !(fIsNaN(oItem.valueOf()) || oItem.valueOf() == 0);
          -
          -		throw new cException("FORG0006"
          -
          -		);
          -	}
          -
          -	throw new cException("FORG0006"
          -
          -	);
          -};
          -
          -function fFunction_sequence_atomize(oSequence1, oContext) {
          -	var oSequence	= [];
          -	for (var nIndex = 0, nLength = oSequence1.length, oItem, vItem; nIndex < nLength; nIndex++) {
          -		oItem	= oSequence1[nIndex];
          -		vItem	= null;
          -		// Untyped
          -		if (oItem == null)
          -			vItem	= null;
          -		// Node type
          -		else
          -		if (oContext.DOMAdapter.isNode(oItem)) {
          -			var fGetProperty	= oContext.DOMAdapter.getProperty;
          -			switch (fGetProperty(oItem, "nodeType")) {
          -				case 1:	// ELEMENT_NODE
          -					vItem	= new cXSUntypedAtomic(fGetProperty(oItem, "textContent"));
          -					break;
          -				case 2:	// ATTRIBUTE_NODE
          -					vItem	= new cXSUntypedAtomic(fGetProperty(oItem, "value"));
          -					break;
          -				case 3:	// TEXT_NODE
          -				case 4:	// CDATA_SECTION_NODE
          -				case 8:	// COMMENT_NODE
          -					vItem	= new cXSUntypedAtomic(fGetProperty(oItem, "data"));
          -					break;
          -				case 7:	// PROCESSING_INSTRUCTION_NODE
          -					vItem	= new cXSUntypedAtomic(fGetProperty(oItem, "data"));
          -					break;
          -				case 9:	// DOCUMENT_NODE
          -					var oNode	= fGetProperty(oItem, "documentElement");
          -					vItem	= new cXSUntypedAtomic(oNode ? fGetProperty(oNode, "textContent") : '');
          -					break;
          -			}
          -		}
          -		// Base types
          -		else
          -		if (oItem instanceof cXSAnyAtomicType)
          -			vItem	= oItem;
          -
          -		//
          -		if (vItem != null)
          -			oSequence.push(vItem);
          -	}
          -
          -	return oSequence;
          -};
          -
          -// Orders items in sequence in document order
          -function fFunction_sequence_order(oSequence1, oContext) {
          -	return oSequence1.sort(function(oNode, oNode2) {
          -		var nPosition	= oContext.DOMAdapter.compareDocumentPosition(oNode, oNode2);
          -		return nPosition & 2 ? 1 : nPosition & 4 ?-1 : 0;
          -	});
          -};
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -/*
          -	7.2 Functions to Assemble and Disassemble Strings
          -		codepoints-to-string
          -		string-to-codepoints
          -
          -	7.3 Equality and Comparison of Strings
          -		compare
          -		codepoint-equal
          -
          -	7.4 Functions on String Values
          -		concat
          -		string-join
          -		substring
          -		string-length
          -		normalize-space
          -		normalize-unicode
          -		upper-case
          -		lower-case
          -		translate
          -		encode-for-uri
          -		iri-to-uri
          -		escape-html-uri
          -
          -	7.5 Functions Based on Substring Matching
          -		contains
          -		starts-with
          -		ends-with
          -		substring-before
          -		substring-after
          -
          -	7.6 String Functions that Use Pattern Matching
          -		matches
          -		replace
          -		tokenize
          -*/
          -
          -// 7.2 Functions to Assemble and Disassemble Strings
          -// fn:codepoints-to-string($arg as xs:integer*) as xs:string
          -fStaticContext_defineSystemFunction("codepoints-to-string",	[[cXSInteger, '*']],	function(oSequence1) {
          -	var aValue	= [];
          -	for (var nIndex = 0, nLength = oSequence1.length; nIndex < nLength; nIndex++)
          -		aValue.push(cString.fromCharCode(oSequence1[nIndex]));
          -
          -	return new cXSString(aValue.join(''));
          -});
          -
          -// fn:string-to-codepoints($arg as xs:string?) as xs:integer*
          -fStaticContext_defineSystemFunction("string-to-codepoints",	[[cXSString, '?']],	function(oValue) {
          -	if (oValue == null)
          -		return null;
          -
          -	var sValue	= oValue.valueOf();
          -	if (sValue == '')
          -		return [];
          -
          -	var oSequence	= [];
          -	for (var nIndex = 0, nLength = sValue.length; nIndex < nLength; nIndex++)
          -		oSequence.push(new cXSInteger(sValue.charCodeAt(nIndex)));
          -
          -	return oSequence;
          -});
          -
          -// 7.3 Equality and Comparison of Strings
          -// fn:compare($comparand1 as xs:string?, $comparand2 as xs:string?) as xs:integer?
          -// fn:compare($comparand1 as xs:string?, $comparand2 as xs:string?, $collation as xs:string) as xs:integer?
          -fStaticContext_defineSystemFunction("compare",	[[cXSString, '?'], [cXSString, '?'], [cXSString, '', true]],	function(oValue1, oValue2, oCollation) {
          -	if (oValue1 == null || oValue2 == null)
          -		return null;
          -
          -	var sCollation	= this.staticContext.defaultCollationName,
          -		vCollation;
          -	if (arguments.length > 2)
          -		sCollation	= oCollation.valueOf();
          -
          -	vCollation	= sCollation == sNS_XPF + "/collation/codepoint" ? oCodepointStringCollator : this.staticContext.getCollation(sCollation);
          -	if (!vCollation)
          -		throw new cException("FOCH0002"
          -
          -		);
          -
          -	return new cXSInteger(vCollation.compare(oValue1.valueOf(), oValue2.valueOf()));
          -});
          -
          -// fn:codepoint-equal($comparand1 as xs:string?, $comparand2  as xs:string?) as xs:boolean?
          -fStaticContext_defineSystemFunction("codepoint-equal",	[[cXSString, '?'], [cXSString, '?']],	function(oValue1, oValue2) {
          -	if (oValue1 == null || oValue2 == null)
          -		return null;
          -
          -	// TODO: Check if JS uses 'Unicode code point collation' here
          -
          -	return new cXSBoolean(oValue1.valueOf() == oValue2.valueOf());
          -});
          -
          -
          -// 7.4 Functions on String Values
          -// fn:concat($arg1 as xs:anyAtomicType?, $arg2 as xs:anyAtomicType?, ...) as xs:string
          -fStaticContext_defineSystemFunction("concat",	null,	function() {
          -	// check arguments length
          -	if (arguments.length < 2)
          -		throw new cException("XPST0017"
          -
          -		);
          -
          -	var aValue	= [];
          -	for (var nIndex = 0, nLength = arguments.length, oSequence; nIndex < nLength; nIndex++) {
          -		oSequence	= arguments[nIndex];
          -		// Assert cardinality
          -		fFunctionCall_assertSequenceCardinality(this, oSequence, '?'
          -
          -		);
          -		//
          -		if (oSequence.length)
          -			aValue[aValue.length]	= cXSString.cast(fFunction_sequence_atomize(oSequence, this)[0]).valueOf();
          -	}
          -
          -	return new cXSString(aValue.join(''));
          -});
          -
          -// fn:string-join($arg1 as xs:string*, $arg2 as xs:string) as xs:string
          -fStaticContext_defineSystemFunction("string-join",	[[cXSString, '*'], [cXSString]],	function(oSequence1, oValue) {
          -	return new cXSString(oSequence1.join(oValue));
          -});
          -
          -// fn:substring($sourceString as xs:string?, $startingLoc as xs:double) as xs:string
          -// fn:substring($sourceString as xs:string?, $startingLoc as xs:double, $length as xs:double) as xs:string
          -fStaticContext_defineSystemFunction("substring",	[[cXSString, '?'], [cXSDouble], [cXSDouble, '', true]],	function(oValue, oStart, oLength) {
          -	var sValue	= oValue == null ? '' : oValue.valueOf(),
          -		nStart	= cMath.round(oStart) - 1,
          -		nEnd	= arguments.length > 2 ? nStart + cMath.round(oLength) : sValue.length;
          -
          -	// TODO: start can be negative
          -	return new cXSString(nEnd > nStart ? sValue.substring(nStart, nEnd) : '');
          -});
          -
          -// fn:string-length() as xs:integer
          -// fn:string-length($arg as xs:string?) as xs:integer
          -fStaticContext_defineSystemFunction("string-length",	[[cXSString, '?', true]],	function(oValue) {
          -	if (!arguments.length) {
          -		if (!this.item)
          -			throw new cException("XPDY0002");
          -		oValue	= cXSString.cast(fFunction_sequence_atomize([this.item], this)[0]);
          -	}
          -	return new cXSInteger(oValue == null ? 0 : oValue.valueOf().length);
          -});
          -
          -// fn:normalize-space() as xs:string
          -// fn:normalize-space($arg as xs:string?) as xs:string
          -fStaticContext_defineSystemFunction("normalize-space",	[[cXSString, '?', true]],	function(oValue) {
          -	if (!arguments.length) {
          -		if (!this.item)
          -			throw new cException("XPDY0002");
          -		oValue	= cXSString.cast(fFunction_sequence_atomize([this.item], this)[0]);
          -	}
          -	return new cXSString(oValue == null ? '' : fString_trim(oValue).replace(/\s\s+/g, ' '));
          -});
          -
          -// fn:normalize-unicode($arg as xs:string?) as xs:string
          -// fn:normalize-unicode($arg as xs:string?, $normalizationForm as xs:string) as xs:string
          -fStaticContext_defineSystemFunction("normalize-unicode",	[[cXSString, '?'], [cXSString, '', true]],	function(oValue, oNormalization) {
          -	throw "Function '" + "normalize-unicode" + "' not implemented";
          -});
          -
          -// fn:upper-case($arg as xs:string?) as xs:string
          -fStaticContext_defineSystemFunction("upper-case",	[[cXSString, '?']],	function(oValue) {
          -	return new cXSString(oValue == null ? '' : oValue.valueOf().toUpperCase());
          -});
          -
          -// fn:lower-case($arg as xs:string?) as xs:string
          -fStaticContext_defineSystemFunction("lower-case",	[[cXSString, '?']],	function(oValue) {
          -	return new cXSString(oValue == null ? '' : oValue.valueOf().toLowerCase());
          -});
          -
          -// fn:translate($arg as xs:string?, $mapString as xs:string, $transString as xs:string) as xs:string
          -fStaticContext_defineSystemFunction("translate",	[[cXSString, '?'], [cXSString], [cXSString]],	function(oValue, oMap, oTranslate) {
          -	if (oValue == null)
          -		return new cXSString('');
          -
          -	var aValue	= oValue.valueOf().split(''),
          -		aMap	= oMap.valueOf().split(''),
          -		aTranslate	= oTranslate.valueOf().split(''),
          -		nTranslateLength	= aTranslate.length,
          -		aReturn	= [];
          -	for (var nIndex = 0, nLength = aValue.length, nPosition; nIndex < nLength; nIndex++)
          -		if ((nPosition = aMap.indexOf(aValue[nIndex])) ==-1)
          -			aReturn[aReturn.length]	= aValue[nIndex];
          -		else
          -		if (nPosition < nTranslateLength)
          -			aReturn[aReturn.length]	= aTranslate[nPosition];
          -
          -	return new cXSString(aReturn.join(''));
          -});
          -
          -// fn:encode-for-uri($uri-part as xs:string?) as xs:string
          -fStaticContext_defineSystemFunction("encode-for-uri",	[[cXSString, '?']],	function(oValue) {
          -	return new cXSString(oValue == null ? '' : window.encodeURIComponent(oValue));
          -});
          -
          -// fn:iri-to-uri($iri as xs:string?) as xs:string
          -fStaticContext_defineSystemFunction("iri-to-uri",		[[cXSString, '?']],	function(oValue) {
          -	return new cXSString(oValue == null ? '' : window.encodeURI(window.decodeURI(oValue)));
          -});
          -
          -// fn:escape-html-uri($uri as xs:string?) as xs:string
          -fStaticContext_defineSystemFunction("escape-html-uri",	[[cXSString, '?']],	function(oValue) {
          -	if (oValue == null || oValue.valueOf() == '')
          -		return new cXSString('');
          -	// Encode
          -	var aValue	= oValue.valueOf().split('');
          -	for (var nIndex = 0, nLength = aValue.length, nCode; nIndex < nLength; nIndex++)
          -		if ((nCode = aValue[nIndex].charCodeAt(0)) < 32 || nCode > 126)
          -			aValue[nIndex]	= window.encodeURIComponent(aValue[nIndex]);
          -	return new cXSString(aValue.join(''));
          -});
          -
          -
          -// 7.5 Functions Based on Substring Matching
          -// fn:contains($arg1 as xs:string?, $arg2 as xs:string?) as xs:boolean
          -// fn:contains($arg1 as xs:string?, $arg2 as xs:string?, $collation as xs:string) as xs:boolean
          -fStaticContext_defineSystemFunction("contains",	[[cXSString, '?'], [cXSString, '?'], [cXSString, '', true]],	function(oValue, oSearch, oCollation) {
          -	if (arguments.length > 2)
          -		throw "Collation parameter in function '" + "contains" + "' is not implemented";
          -	return new cXSBoolean((oValue == null ? '' : oValue.valueOf()).indexOf(oSearch == null ? '' : oSearch.valueOf()) >= 0);
          -});
          -
          -// fn:starts-with($arg1 as xs:string?, $arg2 as xs:string?) as xs:boolean
          -// fn:starts-with($arg1 as xs:string?, $arg2 as xs:string?, $collation as xs:string) as xs:boolean
          -fStaticContext_defineSystemFunction("starts-with",	[[cXSString, '?'], [cXSString, '?'], [cXSString, '', true]],	function(oValue, oSearch, oCollation) {
          -	if (arguments.length > 2)
          -		throw "Collation parameter in function '" + "starts-with" + "' is not implemented";
          -	return new cXSBoolean((oValue == null ? '' : oValue.valueOf()).indexOf(oSearch == null ? '' : oSearch.valueOf()) == 0);
          -});
          -
          -// fn:ends-with($arg1 as xs:string?, $arg2 as xs:string?) as xs:boolean
          -// fn:ends-with($arg1 as xs:string?, $arg2 as xs:string?, $collation as xs:string) as xs:boolean
          -fStaticContext_defineSystemFunction("ends-with",	[[cXSString, '?'], [cXSString, '?'], [cXSString, '', true]],	function(oValue, oSearch, oCollation) {
          -	if (arguments.length > 2)
          -		throw "Collation parameter in function '" + "ends-with" + "' is not implemented";
          -	var sValue	= oValue == null ? '' : oValue.valueOf(),
          -		sSearch	= oSearch == null ? '' : oSearch.valueOf();
          -
          -	return new cXSBoolean(sValue.indexOf(sSearch) == sValue.length - sSearch.length);
          -});
          -
          -// fn:substring-before($arg1 as xs:string?, $arg2 as xs:string?) as xs:string
          -// fn:substring-before($arg1 as xs:string?, $arg2 as xs:string?, $collation as xs:string) as xs:string
          -fStaticContext_defineSystemFunction("substring-before",	[[cXSString, '?'], [cXSString, '?'], [cXSString, '', true]],	function(oValue, oSearch, oCollation) {
          -	if (arguments.length > 2)
          -		throw "Collation parameter in function '" + "substring-before" + "' is not implemented";
          -
          -	var sValue	= oValue == null ? '' : oValue.valueOf(),
          -		sSearch	= oSearch == null ? '' : oSearch.valueOf(),
          -		nPosition;
          -
          -	return new cXSString((nPosition = sValue.indexOf(sSearch)) >= 0 ? sValue.substring(0, nPosition) : '');
          -});
          -
          -// fn:substring-after($arg1 as xs:string?, $arg2 as xs:string?) as xs:string
          -// fn:substring-after($arg1 as xs:string?, $arg2 as xs:string?, $collation as xs:string) as xs:string
          -fStaticContext_defineSystemFunction("substring-after",	[[cXSString, '?'], [cXSString, '?'], [cXSString, '', true]],	function(oValue, oSearch, oCollation) {
          -	if (arguments.length > 2)
          -		throw "Collation parameter in function '" + "substring-after" + "' is not implemented";
          -
          -	var sValue	= oValue == null ? '' : oValue.valueOf(),
          -		sSearch	= oSearch == null ? '' : oSearch.valueOf(),
          -		nPosition;
          -
          -	return new cXSString((nPosition = sValue.indexOf(sSearch)) >= 0 ? sValue.substring(nPosition + sSearch.length) : '');
          -});
          -
          -
          -// 7.6 String Functions that Use Pattern Matching
          -function fFunction_string_createRegExp(sValue, sFlags) {
          -	var d1	= '\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF',
          -		d2	= '\u0370-\u037D\u037F-\u1FFF\u200C-\u200D',
          -		d3	= '\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD',
          -		c	= 'A-Z_a-z\\-.0-9\u00B7' + d1 + '\u0300-\u036F' + d2 + '\u203F-\u2040' + d3,
          -		i	= 'A-Z_a-z' + d1 + d2 + d3;
          -
          -	sValue	= sValue
          -				.replace(/\[\\i-\[:\]\]/g, '[' + i + ']')
          -				.replace(/\[\\c-\[:\]\]/g, '[' + c + ']')
          -				.replace(/\\i/g, '[:' + i + ']')
          -				.replace(/\\I/g, '[^:' + i + ']')
          -				.replace(/\\c/g, '[:' + c + ']')
          -				.replace(/\\C/g, '[^:' + c + ']');
          -
          -	// Check if all flags are legal
          -	if (sFlags && !sFlags.match(/^[smix]+$/))
          -		throw new cException("FORX0001");	// Invalid character '{%0}' in regular expression flags
          -
          -	var bFlagS	= sFlags.indexOf('s') >= 0,
          -		bFlagX	= sFlags.indexOf('x') >= 0;
          -	if (bFlagS || bFlagX) {
          -		// Strip 's' and 'x' from flags
          -		sFlags	= sFlags.replace(/[sx]/g, '');
          -		var aValue	= [],
          -			rValue	= /\s/;
          -		for (var nIndex = 0, nLength = sValue.length, bValue = false, sCharCurr, sCharPrev = ''; nIndex < nLength; nIndex++) {
          -			sCharCurr	= sValue.charAt(nIndex);
          -			if (sCharPrev != '\\') {
          -				if (sCharCurr == '[')
          -					bValue	= true;
          -				else
          -				if (sCharCurr == ']')
          -					bValue	= false;
          -			}
          -			// Replace '\s' for flag 'x' if not in []
          -			if (bValue || !(bFlagX && rValue.test(sCharCurr))) {
          -				// Replace '.' for flag 's' if not in []
          -				if (!bValue && (bFlagS && sCharCurr == '.' && sCharPrev != '\\'))
          -					aValue[aValue.length]	= '(?:.|\\s)';
          -				else
          -					aValue[aValue.length]	= sCharCurr;
          -			}
          -			sCharPrev	= sCharCurr;
          -		}
          -		sValue	= aValue.join('');
          -	}
          -
          -	return new cRegExp(sValue, sFlags + 'g');
          -};
          -
          -// fn:matches($input as xs:string?, $pattern as xs:string) as xs:boolean
          -// fn:matches($input as xs:string?, $pattern as xs:string, $flags as xs:string) as xs:boolean
          -fStaticContext_defineSystemFunction("matches",	[[cXSString, '?'], [cXSString], [cXSString, '', true]],	function(oValue, oPattern, oFlags) {
          -	var sValue	= oValue == null ? '' : oValue.valueOf(),
          -		rRegExp	= fFunction_string_createRegExp(oPattern.valueOf(), arguments.length > 2 ? oFlags.valueOf() : '');
          -
          -	return new cXSBoolean(rRegExp.test(sValue));
          -});
          -
          -// fn:replace($input as xs:string?, $pattern as xs:string, $replacement as xs:string) as xs:string
          -// fn:replace($input as xs:string?, $pattern as xs:string, $replacement as xs:string, $flags as xs:string) as xs:string
          -fStaticContext_defineSystemFunction("replace",	[[cXSString, '?'], [cXSString],  [cXSString], [cXSString, '', true]],	function(oValue, oPattern, oReplacement, oFlags) {
          -	var sValue	= oValue == null ? '' : oValue.valueOf(),
          -		rRegExp	= fFunction_string_createRegExp(oPattern.valueOf(), arguments.length > 3 ? oFlags.valueOf() : '');
          -
          -	return new cXSBoolean(sValue.replace(rRegExp, oReplacement.valueOf()));
          -});
          -
          -// fn:tokenize($input as xs:string?, $pattern as xs:string) as xs:string*
          -// fn:tokenize($input as xs:string?, $pattern as xs:string, $flags as xs:string) as xs:string*
          -fStaticContext_defineSystemFunction("tokenize",	[[cXSString, '?'], [cXSString], [cXSString, '', true]],	function(oValue, oPattern, oFlags) {
          -	var sValue	= oValue == null ? '' : oValue.valueOf(),
          -		rRegExp	= fFunction_string_createRegExp(oPattern.valueOf(), arguments.length > 2 ? oFlags.valueOf() : '');
          -
          -	var oSequence	= [];
          -	for (var nIndex = 0, aValue = sValue.split(rRegExp), nLength = aValue.length; nIndex < nLength; nIndex++)
          -		oSequence.push(new cXSString(aValue[nIndex]));
          -
          -	return oSequence;
          -});
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -/*
          -	4 The Trace Function
          -		trace
          -*/
          -
          -// fn:trace($value as item()*, $label as xs:string) as item()*
          -fStaticContext_defineSystemFunction("trace",		[[cXTItem, '*'], [cXSString]],	function(oSequence1, oLabel) {
          -	var oConsole	= window.console;
          -	if (oConsole && oConsole.log)
          -		oConsole.log(oLabel.valueOf(), oSequence1);
          -	return oSequence1;
          -});
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -var oCodepointStringCollator	= new cStringCollator;
          -
          -oCodepointStringCollator.equals	= function(sValue1, sValue2) {
          -	return sValue1 == sValue2;
          -};
          -
          -oCodepointStringCollator.compare	= function(sValue1, sValue2) {
          -	return sValue1 == sValue2 ? 0 : sValue1 > sValue2 ? 1 :-1;
          -};
          -function cLXDOMAdapter() {
          -
          -};
          -
          -cLXDOMAdapter.prototype	= new cDOMAdapter;
          -
          -var oLXDOMAdapter_staticContext	= new cStaticContext;
          -
          -cLXDOMAdapter.prototype.getProperty	= function(oNode, sName) {
          -		if (sName in oNode)
          -		return oNode[sName];
          -
          -		if (sName == "baseURI") {
          -		var sBaseURI	= '',
          -			fResolveUri	= oLXDOMAdapter_staticContext.getFunction('{' + "http://www.w3.org/2005/xpath-functions" + '}' + "resolve-uri"),
          -			cXSString	= oLXDOMAdapter_staticContext.getDataType('{' + "http://www.w3.org/2001/XMLSchema" + '}' + "string");
          -
          -		for (var oParent = oNode, sUri; oParent; oParent = oParent.parentNode)
          -			if (oParent.nodeType == 1  && (sUri = oParent.getAttribute("xml:base")))
          -				sBaseURI	= fResolveUri(new cXSString(sUri), new cXSString(sBaseURI)).toString();
          -				return sBaseURI;
          -	}
          -	else
          -	if (sName == "textContent") {
          -		var aText = [];
          -		(function(oNode) {
          -			for (var nIndex = 0, oChild; oChild = oNode.childNodes[nIndex]; nIndex++)
          -				if (oChild.nodeType == 3  || oChild.nodeType == 4 )
          -					aText.push(oChild.data);
          -				else
          -				if (oChild.nodeType == 1  && oChild.firstChild)
          -					arguments.callee(oChild);
          -		})(oNode);
          -		return aText.join('');
          -	}
          -};
          -
          -cLXDOMAdapter.prototype.compareDocumentPosition	= function(oNode, oChild) {
          -		if ("compareDocumentPosition" in oNode)
          -		return oNode.compareDocumentPosition(oChild);
          -
          -		if (oChild == oNode)
          -		return 0;
          -
          -		var oAttr1	= null,
          -		oAttr2	= null,
          -		aAttributes,
          -		oAttr, oElement, nIndex, nLength;
          -	if (oNode.nodeType == 2 ) {
          -		oAttr1	= oNode;
          -		oNode	= this.getProperty(oAttr1, "ownerElement");
          -	}
          -	if (oChild.nodeType == 2 ) {
          -		oAttr2	= oChild;
          -		oChild	= this.getProperty(oAttr2, "ownerElement");
          -	}
          -
          -		if (oAttr1 && oAttr2 && oNode && oNode == oChild) {
          -		for (nIndex = 0, aAttributes = this.getProperty(oNode, "attributes"), nLength = aAttributes.length; nIndex < nLength; nIndex++) {
          -			oAttr	= aAttributes[nIndex];
          -			if (oAttr == oAttr1)
          -				return 32  | 4 ;
          -			if (oAttr == oAttr2)
          -				return 32  | 2 ;
          -		}
          -	}
          -
          -		var aChain1	= [], nLength1, oNode1,
          -		aChain2	= [], nLength2, oNode2;
          -		if (oAttr1)
          -		aChain1.push(oAttr1);
          -	for (oElement = oNode; oElement; oElement = oElement.parentNode)
          -		aChain1.push(oElement);
          -	if (oAttr2)
          -		aChain2.push(oAttr2);
          -	for (oElement = oChild; oElement; oElement = oElement.parentNode)
          -		aChain2.push(oElement);
          -		if (((oNode.ownerDocument || oNode) != (oChild.ownerDocument || oChild)) || (aChain1[aChain1.length - 1] != aChain2[aChain2.length - 1]))
          -		return 32  | 1 ;
          -		for (nIndex = cMath.min(nLength1 = aChain1.length, nLength2 = aChain2.length); nIndex; --nIndex)
          -		if ((oNode1 = aChain1[--nLength1]) != (oNode2 = aChain2[--nLength2])) {
          -						if (oNode1.nodeType == 2 )
          -				return 4 ;
          -			if (oNode2.nodeType == 2 )
          -				return 2 ;
          -						if (!oNode2.nextSibling)
          -				return 4 ;
          -			if (!oNode1.nextSibling)
          -				return 2 ;
          -			for (oElement = oNode2.previousSibling; oElement; oElement = oElement.previousSibling)
          -				if (oElement == oNode1)
          -					return 4 ;
          -			return 2 ;
          -		}
          -		return nLength1 < nLength2 ? 4  | 16  : 2  | 8 ;
          -};
          -
          -cLXDOMAdapter.prototype.lookupNamespaceURI	= function(oNode, sPrefix) {
          -		if ("lookupNamespaceURI" in oNode)
          -		return oNode.lookupNamespaceURI(sPrefix);
          -
          -		for (; oNode && oNode.nodeType != 9  ; oNode = oNode.parentNode)
          -		if (sPrefix == this.getProperty(oChild, "prefix"))
          -			return this.getProperty(oNode, "namespaceURI");
          -		else
          -		if (oNode.nodeType == 1)				for (var oAttributes = this.getProperty(oNode, "attributes"), nIndex = 0, nLength = oAttributes.length, sName = "xmlns" + ':' + sPrefix; nIndex < nLength; nIndex++)
          -				if (this.getProperty(oAttributes[nIndex], "nodeName") == sName)
          -					return this.getProperty(oAttributes[nIndex], "value");
          -	return null;
          -};
          -
          -cLXDOMAdapter.prototype.getElementsByTagNameNS	= function(oNode, sNameSpaceURI, sLocalName) {
          -		if ("getElementsByTagNameNS" in oNode)
          -		return oNode.getElementsByTagNameNS(sNameSpaceURI, sLocalName);
          -
          -		var aElements	= [],
          -		bNameSpaceURI	= '*' == sNameSpaceURI,
          -		bLocalName		= '*' == sLocalName;
          -	(function(oNode) {
          -		for (var nIndex = 0, oChild; oChild = oNode.childNodes[nIndex]; nIndex++)
          -			if (oChild.nodeType == 1) {					if ((bLocalName || sLocalName == this.getProperty(oChild, "localName")) && (bNameSpaceURI || sNameSpaceURI == this.getProperty(oChild, "namespaceURI")))
          -					aElements[aElements.length]	= oChild;
          -				if (oChild.firstChild)
          -					arguments.callee(oChild);
          -			}
          -	})(oNode);
          -	return aElements;
          -};
          -
          -var oMSHTMLDOMAdapter	= new cLXDOMAdapter;
          -
          -oMSHTMLDOMAdapter.getProperty	= function(oNode, sName) {
          -	if (sName == "localName") {
          -		if (oNode.nodeType == 1)
          -			return oNode.nodeName.toLowerCase();
          -	}
          -	if (sName == "prefix")
          -		return null;
          -	if (sName == "namespaceURI")
          -		return oNode.nodeType == 1 ? "http://www.w3.org/1999/xhtml" : null;
          -	if (sName == "textContent")
          -		return oNode.innerText;
          -	if (sName == "attributes" && oNode.nodeType == 1) {
          -		var aAttributes	= [];
          -		for (var nIndex = 0, oAttributes = oNode.attributes, nLength = oAttributes.length, oNode2, oAttribute; nIndex < nLength; nIndex++) {
          -			oNode2	= oAttributes[nIndex];
          -			if (oNode2.specified) {
          -				oAttribute	= new cAttr;
          -				oAttribute.ownerElement	= oNode;
          -				oAttribute.ownerDocument= oNode.ownerDocument;
          -				oAttribute.specified	= true;
          -				oAttribute.value		=
          -				oAttribute.nodeValue	= oNode2.nodeValue;
          -				oAttribute.name			=
          -				oAttribute.nodeName		=
          -								oAttribute.localName	= oNode2.nodeName.toLowerCase();
          -								aAttributes[aAttributes.length]	= oAttribute;
          -			}
          -		}
          -		return aAttributes;
          -	}
          -		return cLXDOMAdapter.prototype.getProperty.call(this, oNode, sName);
          -};
          -
          -
          -var oMSXMLDOMAdapter	= new cLXDOMAdapter;
          -
          -oMSXMLDOMAdapter.getProperty	= function(oNode, sName) {
          -	if (sName == "localName") {
          -		if (oNode.nodeType == 7)
          -			return null;
          -		if (oNode.nodeType == 1)
          -			return oNode.baseName;
          -	}
          -	if (sName == "prefix" || sName == "namespaceURI")
          -		return oNode[sName] || null;
          -	if (sName == "textContent")
          -		return oNode.text;
          -	if (sName == "attributes" && oNode.nodeType == 1) {
          -		var aAttributes	= [];
          -		for (var nIndex = 0, oAttributes = oNode.attributes, nLength = oAttributes.length, oNode2, oAttribute; nIndex < nLength; nIndex++) {
          -			oNode2	= oAttributes[nIndex];
          -			if (oNode2.specified) {
          -				oAttribute	= new cAttr;
          -				oAttribute.nodeType		= 2;
          -				oAttribute.ownerElement	= oNode;
          -				oAttribute.ownerDocument= oNode.ownerDocument;
          -				oAttribute.specified	= true;
          -				oAttribute.value		=
          -				oAttribute.nodeValue	= oNode2.nodeValue;
          -				oAttribute.name			=
          -				oAttribute.nodeName		= oNode2.nodeName;
          -								oAttribute.localName	= oNode2.baseName;
          -				oAttribute.prefix		= oNode2.prefix || null;
          -				oAttribute.namespaceURI	= oNode2.namespaceURI || null;
          -								aAttributes[aAttributes.length]	= oAttribute;
          -			}
          -		}
          -		return aAttributes;
          -	}
          -		return cLXDOMAdapter.prototype.getProperty.call(this, oNode, sName);
          -};
          -
          -oMSXMLDOMAdapter.getElementById	= function(oDocument, sId) {
          -	return oDocument.nodeFromID(sId);
          -};
          -
          -function cEvaluator() {
          -
          -};
          -
          -cEvaluator.prototype.defaultOL2DOMAdapter		= new cLXDOMAdapter;
          -cEvaluator.prototype.defaultOL2HTMLDOMAdapter	= new cLXDOMAdapter;
          -
          -cEvaluator.prototype.defaultHTMLStaticContext	= new cStaticContext;
          -cEvaluator.prototype.defaultHTMLStaticContext.baseURI	= window.document.location.href;
          -cEvaluator.prototype.defaultHTMLStaticContext.defaultFunctionNamespace	= "http://www.w3.org/2005/xpath-functions";
          -cEvaluator.prototype.defaultHTMLStaticContext.defaultElementNamespace	= "http://www.w3.org/1999/xhtml";
          -
          -cEvaluator.prototype.defaultXMLStaticContext	= new cStaticContext;
          -cEvaluator.prototype.defaultXMLStaticContext.defaultFunctionNamespace	= "http://www.w3.org/2005/xpath-functions";
          -
          -cEvaluator.prototype.bOldMS		= !!window.document.namespaces && !window.document.createElementNS;
          -cEvaluator.prototype.bOldW3		= !cEvaluator.prototype.bOldMS && window.document.documentElement.namespaceURI != "http://www.w3.org/1999/xhtml";
          -
          -cEvaluator.prototype.defaultDOMAdapter		= new cDOMAdapter;
          -
          -cEvaluator.prototype.compile	= function(sExpression, oStaticContext) {
          -    return new cExpression(sExpression, oStaticContext);
          -};
          -
          -cEvaluator.prototype.evaluate	= function(oQuery, sExpression, fNSResolver) {
          -	if (! (oQuery instanceof window.jQuery))
          -        oQuery = new window.jQuery(oQuery)
          -
          -    if (typeof sExpression == "undefined" || sExpression === null)
          -        sExpression	= '';
          -
          -    var oNode	= oQuery[0];
          -    if (typeof oNode == "undefined")
          -        oNode	= null;
          -
          -    var oStaticContext	= oNode && (oNode.nodeType == 9 ? oNode : oNode.ownerDocument).createElement("div").tagName == "DIV" ? this.defaultHTMLStaticContext : this.defaultXMLStaticContext;
          -
          -    oStaticContext.namespaceResolver	= fNSResolver;
          -
          -    var oExpression	= new cExpression(cString(sExpression), oStaticContext);
          -
          -    oStaticContext.namespaceResolver	= null;
          -
          -    var aSequence,
          -        oSequence	= new window.jQuery,
          -        oAdapter	= this.defaultOL2DOMAdapter;
          -
          -    if (this.bOldMS)
          -        oAdapter	= oStaticContext == this.defaultHTMLStaticContext ? oMSHTMLDOMAdapter : oMSXMLDOMAdapter;
          -    else
          -    if (this.bOldW3 && oStaticContext == this.defaultHTMLStaticContext)
          -        oAdapter	= this.defaultOL2HTMLDOMAdapter;
          -
          -    aSequence	= oExpression.evaluate(new cDynamicContext(oStaticContext, oNode, null, oAdapter));
          -    for (var nIndex = 0, nLength = aSequence.length, oItem; nIndex < nLength; nIndex++)
          -        oSequence.push(oAdapter.isNode(oItem = aSequence[nIndex]) ? oItem : cStaticContext.xs2js(oItem));
          -
          -    return oSequence;
          -};
          -
          -/*
          - * XPath.js - Pure JavaScript implementation of XPath 2.0 parser and evaluator
          - *
          - * Copyright (c) 2012 Sergey Ilinsky
          - * Dual licensed under the MIT and GPL licenses.
          - *
          - *
          - */
          -
          -var oXPathEvaluator	= new cEvaluator,
          -    oXPathClasses	= oXPathEvaluator.classes = {};
          -
          -//
          -oXPathClasses.Exception		= cException;
          -oXPathClasses.Expression	= cExpression;
          -oXPathClasses.DOMAdapter	= cDOMAdapter;
          -oXPathClasses.StaticContext	= cStaticContext;
          -oXPathClasses.DynamicContext= cDynamicContext;
          -oXPathClasses.StringCollator= cStringCollator;
          -
          -// Publish object
          -window.xpath	= oXPathEvaluator;
          -
          -})()
          \ No newline at end of file
          diff --git a/src/js/lib/yahoo.js b/src/js/lib/yahoo.js
          deleted file mode 100755
          index 46b0c56..0000000
          --- a/src/js/lib/yahoo.js
          +++ /dev/null
          @@ -1,1231 +0,0 @@
          -/** @license
          -========================================================================
          -  Copyright (c) 2011, Yahoo! Inc. All rights reserved.
          -  Code licensed under the BSD License:
          -  http://developer.yahoo.com/yui/license.html
          -  version: 2.9.0
          -*/
          -/**
          - * The YAHOO object is the single global object used by YUI Library.  It
          - * contains utility function for setting up namespaces, inheritance, and
          - * logging.  YAHOO.util, YAHOO.widget, and YAHOO.example are namespaces
          - * created automatically for and used by the library.
          - * @module yahoo
          - * @title  YAHOO Global
          - */
          -
          -/**
          - * YAHOO_config is not included as part of the library.  Instead it is an
          - * object that can be defined by the implementer immediately before
          - * including the YUI library.  The properties included in this object
          - * will be used to configure global properties needed as soon as the
          - * library begins to load.
          - * @class YAHOO_config
          - * @static
          - */
          -
          -/**
          - * A reference to a function that will be executed every time a YAHOO module
          - * is loaded.  As parameter, this function will receive the version
          - * information for the module. See <a href="YAHOO.env.html#getVersion">
          - * YAHOO.env.getVersion</a> for the description of the version data structure.
          - * @property listener
          - * @type Function
          - * @static
          - * @default undefined
          - */
          -
          -/**
          - * Set to true if the library will be dynamically loaded after window.onload.
          - * Defaults to false
          - * @property injecting
          - * @type boolean
          - * @static
          - * @default undefined
          - */
          -
          -/**
          - * Instructs the yuiloader component to dynamically load yui components and
          - * their dependencies.  See the yuiloader documentation for more information
          - * about dynamic loading
          - * @property load
          - * @static
          - * @default undefined
          - * @see yuiloader
          - */
          -
          -/**
          - * Forces the use of the supplied locale where applicable in the library
          - * @property locale
          - * @type string
          - * @static
          - * @default undefined
          - */
          -
          -var typeof_yahoo = typeof YAHOO;
          -if (typeof_yahoo == "undefined" || !YAHOO) {
          -    /**
          -     * The YAHOO global namespace object.  If YAHOO is already defined, the
          -     * existing YAHOO object will not be overwritten so that defined
          -     * namespaces are preserved.
          -     * @class YAHOO
          -     * @static
          -     */
          -    var YAHOO = {};
          -}
          -
          -/**
          - * Returns the namespace specified and creates it if it doesn't exist
          - * <pre>
          - * YAHOO.namespace("property.package");
          - * YAHOO.namespace("YAHOO.property.package");
          - * </pre>
          - * Either of the above would create YAHOO.property, then
          - * YAHOO.property.package
          - *
          - * Be careful when naming packages. Reserved words may work in some browsers
          - * and not others. For instance, the following will fail in Safari:
          - * <pre>
          - * YAHOO.namespace("really.long.nested.namespace");
          - * </pre>
          - * This fails because "long" is a future reserved word in ECMAScript
          - *
          - * For implementation code that uses YUI, do not create your components
          - * in the namespaces defined by YUI (
          - * <code>YAHOO.util</code>,
          - * <code>YAHOO.widget</code>,
          - * <code>YAHOO.lang</code>,
          - * <code>YAHOO.tool</code>,
          - * <code>YAHOO.example</code>,
          - * <code>YAHOO.env</code>) -- create your own namespace (e.g., 'companyname').
          - *
          - * @method namespace
          - * @static
          - * @param  {String*} arguments 1-n namespaces to create
          - * @return {Object}  A reference to the last namespace object created
          - */
          -YAHOO.namespace = function() {
          -    var a=arguments, o=null, i, j, d;
          -    for (i=0; i<a.length; i=i+1) {
          -        d=(""+a[i]).split(".");
          -        o=YAHOO;
          -
          -        // YAHOO is implied, so it is ignored if it is included
          -        for (j=(d[0] == "YAHOO") ? 1 : 0; j<d.length; j=j+1) {
          -            o[d[j]]=o[d[j]] || {};
          -            o=o[d[j]];
          -        }
          -    }
          -
          -    return o;
          -};
          -
          -/**
          - * Uses YAHOO.widget.Logger to output a log message, if the widget is
          - * available.
          - * Note: LogReader adds the message, category, and source to the DOM as HTML.
          - *
          - * @method log
          - * @static
          - * @param  {HTML}  msg  The message to log.
          - * @param  {HTML}  cat  The log category for the message.  Default
          - *                        categories are "info", "warn", "error", time".
          - *                        Custom categories can be used as well. (opt)
          - * @param  {HTML}  src  The source of the the message (opt)
          - * @return {Boolean}      True if the log operation was successful.
          - */
          -YAHOO.log = function(msg, cat, src) {
          -    var l=YAHOO.widget.Logger;
          -    if(l && l.log) {
          -        return l.log(msg, cat, src);
          -    } else {
          -        return false;
          -    }
          -};
          -
          -/**
          - * Registers a module with the YAHOO object
          - * @method register
          - * @static
          - * @param {String}   name    the name of the module (event, slider, etc)
          - * @param {Function} mainClass a reference to class in the module.  This
          - *                             class will be tagged with the version info
          - *                             so that it will be possible to identify the
          - *                             version that is in use when multiple versions
          - *                             have loaded
          - * @param {Object}   data      metadata object for the module.  Currently it
          - *                             is expected to contain a "version" property
          - *                             and a "build" property at minimum.
          - */
          -YAHOO.register = function(name, mainClass, data) {
          -    var mods = YAHOO.env.modules, m, v, b, ls, i;
          -
          -    if (!mods[name]) {
          -        mods[name] = {
          -            versions:[],
          -            builds:[]
          -        };
          -    }
          -
          -    m  = mods[name];
          -    v  = data.version;
          -    b  = data.build;
          -    ls = YAHOO.env.listeners;
          -
          -    m.name = name;
          -    m.version = v;
          -    m.build = b;
          -    m.versions.push(v);
          -    m.builds.push(b);
          -    m.mainClass = mainClass;
          -
          -    // fire the module load listeners
          -    for (i=0;i<ls.length;i=i+1) {
          -        ls[i](m);
          -    }
          -    // label the main class
          -    if (mainClass) {
          -        mainClass.VERSION = v;
          -        mainClass.BUILD = b;
          -    } else {
          -        YAHOO.log("mainClass is undefined for module " + name, "warn");
          -    }
          -};
          -
          -/**
          - * YAHOO.env is used to keep track of what is known about the YUI library and
          - * the browsing environment
          - * @class YAHOO.env
          - * @static
          - */
          -YAHOO.env = YAHOO.env || {
          -
          -    /**
          -     * Keeps the version info for all YUI modules that have reported themselves
          -     * @property modules
          -     * @type Object[]
          -     */
          -    modules: [],
          -
          -    /**
          -     * List of functions that should be executed every time a YUI module
          -     * reports itself.
          -     * @property listeners
          -     * @type Function[]
          -     */
          -    listeners: []
          -};
          -
          -/**
          - * Returns the version data for the specified module:
          - *      <dl>
          - *      <dt>name:</dt>      <dd>The name of the module</dd>
          - *      <dt>version:</dt>   <dd>The version in use</dd>
          - *      <dt>build:</dt>     <dd>The build number in use</dd>
          - *      <dt>versions:</dt>  <dd>All versions that were registered</dd>
          - *      <dt>builds:</dt>    <dd>All builds that were registered.</dd>
          - *      <dt>mainClass:</dt> <dd>An object that was was stamped with the
          - *                 current version and build. If
          - *                 mainClass.VERSION != version or mainClass.BUILD != build,
          - *                 multiple versions of pieces of the library have been
          - *                 loaded, potentially causing issues.</dd>
          - *       </dl>
          - *
          - * @method getVersion
          - * @static
          - * @param {String}  name the name of the module (event, slider, etc)
          - * @return {Object} The version info
          - */
          -YAHOO.env.getVersion = function(name) {
          -    return YAHOO.env.modules[name] || null;
          -};
          -
          -/**
          - * Do not fork for a browser if it can be avoided.  Use feature detection when
          - * you can.  Use the user agent as a last resort.  YAHOO.env.ua stores a version
          - * number for the browser engine, 0 otherwise.  This value may or may not map
          - * to the version number of the browser using the engine.  The value is
          - * presented as a float so that it can easily be used for boolean evaluation
          - * as well as for looking for a particular range of versions.  Because of this,
          - * some of the granularity of the version info may be lost (e.g., Gecko 1.8.0.9
          - * reports 1.8).
          - * @class YAHOO.env.ua
          - * @static
          - */
          -
          -/**
          - * parses a user agent string (or looks for one in navigator to parse if
          - * not supplied).
          - * @method parseUA
          - * @since 2.9.0
          - * @static
          - */
          -YAHOO.env.parseUA = function(agent) {
          -
          -        var numberify = function(s) {
          -            var c = 0;
          -            return parseFloat(s.replace(/\./g, function() {
          -                return (c++ == 1) ? '' : '.';
          -            }));
          -        },
          -
          -        nav = navigator,
          -
          -        o = {
          -
          -        /**
          -         * Internet Explorer version number or 0.  Example: 6
          -         * @property ie
          -         * @type float
          -         * @static
          -         */
          -        ie: 0,
          -
          -        /**
          -         * Opera version number or 0.  Example: 9.2
          -         * @property opera
          -         * @type float
          -         * @static
          -         */
          -        opera: 0,
          -
          -        /**
          -         * Gecko engine revision number.  Will evaluate to 1 if Gecko
          -         * is detected but the revision could not be found. Other browsers
          -         * will be 0.  Example: 1.8
          -         * <pre>
          -         * Firefox 1.0.0.4: 1.7.8   <-- Reports 1.7
          -         * Firefox 1.5.0.9: 1.8.0.9 <-- 1.8
          -         * Firefox 2.0.0.3: 1.8.1.3 <-- 1.81
          -         * Firefox 3.0   <-- 1.9
          -         * Firefox 3.5   <-- 1.91
          -         * </pre>
          -         * @property gecko
          -         * @type float
          -         * @static
          -         */
          -        gecko: 0,
          -
          -        /**
          -         * AppleWebKit version.  KHTML browsers that are not WebKit browsers
          -         * will evaluate to 1, other browsers 0.  Example: 418.9
          -         * <pre>
          -         * Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the
          -         *                                   latest available for Mac OSX 10.3.
          -         * Safari 2.0.2:         416     <-- hasOwnProperty introduced
          -         * Safari 2.0.4:         418     <-- preventDefault fixed
          -         * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run
          -         *                                   different versions of webkit
          -         * Safari 2.0.4 (419.3): 419     <-- Tiger installations that have been
          -         *                                   updated, but not updated
          -         *                                   to the latest patch.
          -         * Webkit 212 nightly:   522+    <-- Safari 3.0 precursor (with native
          -         * SVG and many major issues fixed).
          -         * Safari 3.0.4 (523.12) 523.12  <-- First Tiger release - automatic
          -         * update from 2.x via the 10.4.11 OS patch.
          -         * Webkit nightly 1/2008:525+    <-- Supports DOMContentLoaded event.
          -         *                                   yahoo.com user agent hack removed.
          -         * </pre>
          -         * http://en.wikipedia.org/wiki/Safari_version_history
          -         * @property webkit
          -         * @type float
          -         * @static
          -         */
          -        webkit: 0,
          -
          -        /**
          -         * Chrome will be detected as webkit, but this property will also
          -         * be populated with the Chrome version number
          -         * @property chrome
          -         * @type float
          -         * @static
          -         */
          -        chrome: 0,
          -
          -        /**
          -         * The mobile property will be set to a string containing any relevant
          -         * user agent information when a modern mobile browser is detected.
          -         * Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series
          -         * devices with the WebKit-based browser, and Opera Mini.
          -         * @property mobile
          -         * @type string
          -         * @static
          -         */
          -        mobile: null,
          -
          -        /**
          -         * Adobe AIR version number or 0.  Only populated if webkit is detected.
          -         * Example: 1.0
          -         * @property air
          -         * @type float
          -         */
          -        air: 0,
          -        /**
          -         * Detects Apple iPad's OS version
          -         * @property ipad
          -         * @type float
          -         * @static
          -         */
          -        ipad: 0,
          -        /**
          -         * Detects Apple iPhone's OS version
          -         * @property iphone
          -         * @type float
          -         * @static
          -         */
          -        iphone: 0,
          -        /**
          -         * Detects Apples iPod's OS version
          -         * @property ipod
          -         * @type float
          -         * @static
          -         */
          -        ipod: 0,
          -        /**
          -         * General truthy check for iPad, iPhone or iPod
          -         * @property ios
          -         * @type float
          -         * @static
          -         */
          -        ios: null,
          -        /**
          -         * Detects Googles Android OS version
          -         * @property android
          -         * @type float
          -         * @static
          -         */
          -        android: 0,
          -        /**
          -         * Detects Palms WebOS version
          -         * @property webos
          -         * @type float
          -         * @static
          -         */
          -        webos: 0,
          -
          -        /**
          -         * Google Caja version number or 0.
          -         * @property caja
          -         * @type float
          -         */
          -        caja: nav && nav.cajaVersion,
          -
          -        /**
          -         * Set to true if the page appears to be in SSL
          -         * @property secure
          -         * @type boolean
          -         * @static
          -         */
          -        secure: false,
          -
          -        /**
          -         * The operating system.  Currently only detecting windows or macintosh
          -         * @property os
          -         * @type string
          -         * @static
          -         */
          -        os: null
          -
          -    },
          -
          -    ua = agent || (navigator && navigator.userAgent),
          -
          -    loc = window && window.location,
          -
          -    href = loc && loc.href,
          -
          -    m;
          -
          -    o.secure = href && (href.toLowerCase().indexOf("https") === 0);
          -
          -    if (ua) {
          -
          -        if ((/windows|win32/i).test(ua)) {
          -            o.os = 'windows';
          -        } else if ((/macintosh/i).test(ua)) {
          -            o.os = 'macintosh';
          -        } else if ((/rhino/i).test(ua)) {
          -            o.os = 'rhino';
          -        }
          -
          -        // Modern KHTML browsers should qualify as Safari X-Grade
          -        if ((/KHTML/).test(ua)) {
          -            o.webkit = 1;
          -        }
          -        // Modern WebKit browsers are at least X-Grade
          -        m = ua.match(/AppleWebKit\/([^\s]*)/);
          -        if (m && m[1]) {
          -            o.webkit = numberify(m[1]);
          -
          -            // Mobile browser check
          -            if (/ Mobile\//.test(ua)) {
          -                o.mobile = 'Apple'; // iPhone or iPod Touch
          -
          -                m = ua.match(/OS ([^\s]*)/);
          -                if (m && m[1]) {
          -                    m = numberify(m[1].replace('_', '.'));
          -                }
          -                o.ios = m;
          -                o.ipad = o.ipod = o.iphone = 0;
          -
          -                m = ua.match(/iPad|iPod|iPhone/);
          -                if (m && m[0]) {
          -                    o[m[0].toLowerCase()] = o.ios;
          -                }
          -            } else {
          -                m = ua.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/);
          -                if (m) {
          -                    // Nokia N-series, Android, webOS, ex: NokiaN95
          -                    o.mobile = m[0];
          -                }
          -                if (/webOS/.test(ua)) {
          -                    o.mobile = 'WebOS';
          -                    m = ua.match(/webOS\/([^\s]*);/);
          -                    if (m && m[1]) {
          -                        o.webos = numberify(m[1]);
          -                    }
          -                }
          -                if (/ Android/.test(ua)) {
          -                    o.mobile = 'Android';
          -                    m = ua.match(/Android ([^\s]*);/);
          -                    if (m && m[1]) {
          -                        o.android = numberify(m[1]);
          -                    }
          -
          -                }
          -            }
          -
          -            m = ua.match(/Chrome\/([^\s]*)/);
          -            if (m && m[1]) {
          -                o.chrome = numberify(m[1]); // Chrome
          -            } else {
          -                m = ua.match(/AdobeAIR\/([^\s]*)/);
          -                if (m) {
          -                    o.air = m[0]; // Adobe AIR 1.0 or better
          -                }
          -            }
          -        }
          -
          -        if (!o.webkit) { // not webkit
          -// @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)
          -            m = ua.match(/Opera[\s\/]([^\s]*)/);
          -            if (m && m[1]) {
          -                o.opera = numberify(m[1]);
          -                m = ua.match(/Version\/([^\s]*)/);
          -                if (m && m[1]) {
          -                    o.opera = numberify(m[1]); // opera 10+
          -                }
          -                m = ua.match(/Opera Mini[^;]*/);
          -                if (m) {
          -                    o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316
          -                }
          -            } else { // not opera or webkit
          -                m = ua.match(/MSIE\s([^;]*)/);
          -                if (m && m[1]) {
          -                    o.ie = numberify(m[1]);
          -                } else { // not opera, webkit, or ie
          -                    m = ua.match(/Gecko\/([^\s]*)/);
          -                    if (m) {
          -                        o.gecko = 1; // Gecko detected, look for revision
          -                        m = ua.match(/rv:([^\s\)]*)/);
          -                        if (m && m[1]) {
          -                            o.gecko = numberify(m[1]);
          -                        }
          -                    }
          -                }
          -            }
          -        }
          -    }
          -
          -    return o;
          -};
          -
          -YAHOO.env.ua = YAHOO.env.parseUA();
          -
          -/**
          - * Initializes the global by creating the default namespaces and applying
          - * any new configuration information that is detected.  This is the setup
          - * for env.
          - * @method init
          - * @static
          - * @private
          - */
          -(function() {
          -    YAHOO.namespace("util", "widget", "example");
          -    /*global YAHOO_config*/
          -    if ("undefined" !== typeof YAHOO_config) {
          -        var l=YAHOO_config.listener, ls=YAHOO.env.listeners,unique=true, i;
          -        if (l) {
          -            // if YAHOO is loaded multiple times we need to check to see if
          -            // this is a new config object.  If it is, add the new component
          -            // load listener to the stack
          -            for (i=0; i<ls.length; i++) {
          -                if (ls[i] == l) {
          -                    unique = false;
          -                    break;
          -                }
          -            }
          -
          -            if (unique) {
          -                ls.push(l);
          -            }
          -        }
          -    }
          -})();
          -/**
          - * Provides the language utilites and extensions used by the library
          - * @class YAHOO.lang
          - */
          -YAHOO.lang = YAHOO.lang || {};
          -
          -(function() {
          -
          -
          -var L = YAHOO.lang,
          -
          -    OP = Object.prototype,
          -    ARRAY_TOSTRING = '[object Array]',
          -    FUNCTION_TOSTRING = '[object Function]',
          -    OBJECT_TOSTRING = '[object Object]',
          -    NOTHING = [],
          -
          -    HTML_CHARS = {
          -        '&': '&amp;',
          -        '<': '&lt;',
          -        '>': '&gt;',
          -        '"': '&quot;',
          -        "'": '&#x27;',
          -        '/': '&#x2F;',
          -        '`': '&#x60;'
          -    },
          -
          -    // ADD = ["toString", "valueOf", "hasOwnProperty"],
          -    ADD = ["toString", "valueOf"],
          -
          -    OB = {
          -
          -    /**
          -     * Determines wheather or not the provided object is an array.
          -     * @method isArray
          -     * @param {any} o The object being testing
          -     * @return {boolean} the result
          -     */
          -    isArray: function(o) {
          -        return OP.toString.apply(o) === ARRAY_TOSTRING;
          -    },
          -
          -    /**
          -     * Determines whether or not the provided object is a boolean
          -     * @method isBoolean
          -     * @param {any} o The object being testing
          -     * @return {boolean} the result
          -     */
          -    isBoolean: function(o) {
          -        return typeof o === 'boolean';
          -    },
          -
          -    /**
          -     * Determines whether or not the provided object is a function.
          -     * Note: Internet Explorer thinks certain functions are objects:
          -     *
          -     * var obj = document.createElement("object");
          -     * YAHOO.lang.isFunction(obj.getAttribute) // reports false in IE
          -     *
          -     * var input = document.createElement("input"); // append to body
          -     * YAHOO.lang.isFunction(input.focus) // reports false in IE
          -     *
          -     * You will have to implement additional tests if these functions
          -     * matter to you.
          -     *
          -     * @method isFunction
          -     * @param {any} o The object being testing
          -     * @return {boolean} the result
          -     */
          -    isFunction: function(o) {
          -        return (typeof o === 'function') || OP.toString.apply(o) === FUNCTION_TOSTRING;
          -    },
          -
          -    /**
          -     * Determines whether or not the provided object is null
          -     * @method isNull
          -     * @param {any} o The object being testing
          -     * @return {boolean} the result
          -     */
          -    isNull: function(o) {
          -        return o === null;
          -    },
          -
          -    /**
          -     * Determines whether or not the provided object is a legal number
          -     * @method isNumber
          -     * @param {any} o The object being testing
          -     * @return {boolean} the result
          -     */
          -    isNumber: function(o) {
          -        return typeof o === 'number' && isFinite(o);
          -    },
          -
          -    /**
          -     * Determines whether or not the provided object is of type object
          -     * or function
          -     * @method isObject
          -     * @param {any} o The object being testing
          -     * @return {boolean} the result
          -     */
          -    isObject: function(o) {
          -return (o && (typeof o === 'object' || L.isFunction(o))) || false;
          -    },
          -
          -    /**
          -     * Determines whether or not the provided object is a string
          -     * @method isString
          -     * @param {any} o The object being testing
          -     * @return {boolean} the result
          -     */
          -    isString: function(o) {
          -        return typeof o === 'string';
          -    },
          -
          -    /**
          -     * Determines whether or not the provided object is undefined
          -     * @method isUndefined
          -     * @param {any} o The object being testing
          -     * @return {boolean} the result
          -     */
          -    isUndefined: function(o) {
          -        return typeof o === 'undefined';
          -    },
          -
          -
          -    /**
          -     * IE will not enumerate native functions in a derived object even if the
          -     * function was overridden.  This is a workaround for specific functions
          -     * we care about on the Object prototype.
          -     * @property _IEEnumFix
          -     * @param {Function} r  the object to receive the augmentation
          -     * @param {Function} s  the object that supplies the properties to augment
          -     * @static
          -     * @private
          -     */
          -    _IEEnumFix: (YAHOO.env.ua.ie) ? function(r, s) {
          -            var i, fname, f;
          -            for (i=0;i<ADD.length;i=i+1) {
          -
          -                fname = ADD[i];
          -                f = s[fname];
          -
          -                if (L.isFunction(f) && f!=OP[fname]) {
          -                    r[fname]=f;
          -                }
          -            }
          -    } : function(){},
          -
          -    /**
          -     * <p>
          -     * Returns a copy of the specified string with special HTML characters
          -     * escaped. The following characters will be converted to their
          -     * corresponding character entities:
          -     * <code>&amp; &lt; &gt; &quot; &#x27; &#x2F; &#x60;</code>
          -     * </p>
          -     *
          -     * <p>
          -     * This implementation is based on the
          -     * <a href="http://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet">OWASP
          -     * HTML escaping recommendations</a>. In addition to the characters
          -     * in the OWASP recommendation, we also escape the <code>&#x60;</code>
          -     * character, since IE interprets it as an attribute delimiter when used in
          -     * innerHTML.
          -     * </p>
          -     *
          -     * @method escapeHTML
          -     * @param {String} html String to escape.
          -     * @return {String} Escaped string.
          -     * @static
          -     * @since 2.9.0
          -     */
          -    escapeHTML: function (html) {
          -        return html.replace(/[&<>"'\/`]/g, function (match) {
          -            return HTML_CHARS[match];
          -        });
          -    },
          -
          -    /**
          -     * Utility to set up the prototype, constructor and superclass properties to
          -     * support an inheritance strategy that can chain constructors and methods.
          -     * Static members will not be inherited.
          -     *
          -     * @method extend
          -     * @static
          -     * @param {Function} subc   the object to modify
          -     * @param {Function} superc the object to inherit
          -     * @param {Object} overrides  additional properties/methods to add to the
          -     *                              subclass prototype.  These will override the
          -     *                              matching items obtained from the superclass
          -     *                              if present.
          -     */
          -    extend: function(subc, superc, overrides) {
          -        if (!superc||!subc) {
          -            throw new Error("extend failed, please check that " +
          -                            "all dependencies are included.");
          -        }
          -        var F = function() {}, i;
          -        F.prototype=superc.prototype;
          -        subc.prototype=new F();
          -        subc.prototype.constructor=subc;
          -        subc.superclass=superc.prototype;
          -        if (superc.prototype.constructor == OP.constructor) {
          -            superc.prototype.constructor=superc;
          -        }
          -
          -        if (overrides) {
          -            for (i in overrides) {
          -                if (L.hasOwnProperty(overrides, i)) {
          -                    subc.prototype[i]=overrides[i];
          -                }
          -            }
          -
          -            L._IEEnumFix(subc.prototype, overrides);
          -        }
          -    },
          -
          -    /**
          -     * Applies all properties in the supplier to the receiver if the
          -     * receiver does not have these properties yet.  Optionally, one or
          -     * more methods/properties can be specified (as additional
          -     * parameters).  This option will overwrite the property if receiver
          -     * has it already.  If true is passed as the third parameter, all
          -     * properties will be applied and _will_ overwrite properties in
          -     * the receiver.
          -     *
          -     * @method augmentObject
          -     * @static
          -     * @since 2.3.0
          -     * @param {Function} r  the object to receive the augmentation
          -     * @param {Function} s  the object that supplies the properties to augment
          -     * @param {String*|boolean}  arguments zero or more properties methods
          -     *        to augment the receiver with.  If none specified, everything
          -     *        in the supplier will be used unless it would
          -     *        overwrite an existing property in the receiver. If true
          -     *        is specified as the third parameter, all properties will
          -     *        be applied and will overwrite an existing property in
          -     *        the receiver
          -     */
          -    augmentObject: function(r, s) {
          -        if (!s||!r) {
          -            throw new Error("Absorb failed, verify dependencies.");
          -        }
          -        var a=arguments, i, p, overrideList=a[2];
          -        if (overrideList && overrideList!==true) { // only absorb the specified properties
          -            for (i=2; i<a.length; i=i+1) {
          -                r[a[i]] = s[a[i]];
          -            }
          -        } else { // take everything, overwriting only if the third parameter is true
          -            for (p in s) {
          -                if (overrideList || !(p in r)) {
          -                    r[p] = s[p];
          -                }
          -            }
          -
          -            L._IEEnumFix(r, s);
          -        }
          -
          -        return r;
          -    },
          -
          -    /**
          -     * Same as YAHOO.lang.augmentObject, except it only applies prototype properties
          -     * @see YAHOO.lang.augmentObject
          -     * @method augmentProto
          -     * @static
          -     * @param {Function} r  the object to receive the augmentation
          -     * @param {Function} s  the object that supplies the properties to augment
          -     * @param {String*|boolean}  arguments zero or more properties methods
          -     *        to augment the receiver with.  If none specified, everything
          -     *        in the supplier will be used unless it would overwrite an existing
          -     *        property in the receiver.  if true is specified as the third
          -     *        parameter, all properties will be applied and will overwrite an
          -     *        existing property in the receiver
          -     */
          -    augmentProto: function(r, s) {
          -        if (!s||!r) {
          -            throw new Error("Augment failed, verify dependencies.");
          -        }
          -        //var a=[].concat(arguments);
          -        var a=[r.prototype,s.prototype], i;
          -        for (i=2;i<arguments.length;i=i+1) {
          -            a.push(arguments[i]);
          -        }
          -        L.augmentObject.apply(this, a);
          -
          -        return r;
          -    },
          -
          -
          -    /**
          -     * Returns a simple string representation of the object or array.
          -     * Other types of objects will be returned unprocessed.  Arrays
          -     * are expected to be indexed.  Use object notation for
          -     * associative arrays.
          -     * @method dump
          -     * @since 2.3.0
          -     * @param o {Object} The object to dump
          -     * @param d {int} How deep to recurse child objects, default 3
          -     * @return {String} the dump result
          -     */
          -    dump: function(o, d) {
          -        var i,len,s=[],OBJ="{...}",FUN="f(){...}",
          -            COMMA=', ', ARROW=' => ';
          -
          -        // Cast non-objects to string
          -        // Skip dates because the std toString is what we want
          -        // Skip HTMLElement-like objects because trying to dump
          -        // an element will cause an unhandled exception in FF 2.x
          -        if (!L.isObject(o)) {
          -            return o + "";
          -        } else if (o instanceof Date || ("nodeType" in o && "tagName" in o)) {
          -            return o;
          -        } else if  (L.isFunction(o)) {
          -            return FUN;
          -        }
          -
          -        // dig into child objects the depth specifed. Default 3
          -        d = (L.isNumber(d)) ? d : 3;
          -
          -        // arrays [1, 2, 3]
          -        if (L.isArray(o)) {
          -            s.push("[");
          -            for (i=0,len=o.length;i<len;i=i+1) {
          -                if (L.isObject(o[i])) {
          -                    s.push((d > 0) ? L.dump(o[i], d-1) : OBJ);
          -                } else {
          -                    s.push(o[i]);
          -                }
          -                s.push(COMMA);
          -            }
          -            if (s.length > 1) {
          -                s.pop();
          -            }
          -            s.push("]");
          -        // objects {k1 => v1, k2 => v2}
          -        } else {
          -            s.push("{");
          -            for (i in o) {
          -                if (L.hasOwnProperty(o, i)) {
          -                    s.push(i + ARROW);
          -                    if (L.isObject(o[i])) {
          -                        s.push((d > 0) ? L.dump(o[i], d-1) : OBJ);
          -                    } else {
          -                        s.push(o[i]);
          -                    }
          -                    s.push(COMMA);
          -                }
          -            }
          -            if (s.length > 1) {
          -                s.pop();
          -            }
          -            s.push("}");
          -        }
          -
          -        return s.join("");
          -    },
          -
          -    /**
          -     * Does variable substitution on a string. It scans through the string
          -     * looking for expressions enclosed in { } braces. If an expression
          -     * is found, it is used a key on the object.  If there is a space in
          -     * the key, the first word is used for the key and the rest is provided
          -     * to an optional function to be used to programatically determine the
          -     * value (the extra information might be used for this decision). If
          -     * the value for the key in the object, or what is returned from the
          -     * function has a string value, number value, or object value, it is
          -     * substituted for the bracket expression and it repeats.  If this
          -     * value is an object, it uses the Object's toString() if this has
          -     * been overridden, otherwise it does a shallow dump of the key/value
          -     * pairs.
          -     *
          -     * By specifying the recurse option, the string is rescanned after
          -     * every replacement, allowing for nested template substitutions.
          -     * The side effect of this option is that curly braces in the
          -     * replacement content must be encoded.
          -     *
          -     * @method substitute
          -     * @since 2.3.0
          -     * @param s {String} The string that will be modified.
          -     * @param o {Object} An object containing the replacement values
          -     * @param f {Function} An optional function that can be used to
          -     *                     process each match.  It receives the key,
          -     *                     value, and any extra metadata included with
          -     *                     the key inside of the braces.
          -     * @param recurse {boolean} default true - if not false, the replaced
          -     * string will be rescanned so that nested substitutions are possible.
          -     * @return {String} the substituted string
          -     */
          -    substitute: function (s, o, f, recurse) {
          -        var i, j, k, key, v, meta, saved=[], token, lidx=s.length,
          -            DUMP='dump', SPACE=' ', LBRACE='{', RBRACE='}',
          -            dump, objstr;
          -
          -        for (;;) {
          -            i = s.lastIndexOf(LBRACE, lidx);
          -            if (i < 0) {
          -                break;
          -            }
          -            j = s.indexOf(RBRACE, i);
          -            if (i + 1 > j) {
          -                break;
          -            }
          -
          -            //Extract key and meta info
          -            token = s.substring(i + 1, j);
          -            key = token;
          -            meta = null;
          -            k = key.indexOf(SPACE);
          -            if (k > -1) {
          -                meta = key.substring(k + 1);
          -                key = key.substring(0, k);
          -            }
          -
          -            // lookup the value
          -            v = o[key];
          -
          -            // if a substitution function was provided, execute it
          -            if (f) {
          -                v = f(key, v, meta);
          -            }
          -
          -            if (L.isObject(v)) {
          -                if (L.isArray(v)) {
          -                    v = L.dump(v, parseInt(meta, 10));
          -                } else {
          -                    meta = meta || "";
          -
          -                    // look for the keyword 'dump', if found force obj dump
          -                    dump = meta.indexOf(DUMP);
          -                    if (dump > -1) {
          -                        meta = meta.substring(4);
          -                    }
          -
          -                    objstr = v.toString();
          -
          -                    // use the toString if it is not the Object toString
          -                    // and the 'dump' meta info was not found
          -                    if (objstr === OBJECT_TOSTRING || dump > -1) {
          -                        v = L.dump(v, parseInt(meta, 10));
          -                    } else {
          -                        v = objstr;
          -                    }
          -                }
          -            } else if (!L.isString(v) && !L.isNumber(v)) {
          -                // This {block} has no replace string. Save it for later.
          -                v = "~-" + saved.length + "-~";
          -                saved[saved.length] = token;
          -
          -                // break;
          -            }
          -
          -            s = s.substring(0, i) + v + s.substring(j + 1);
          -
          -            if (recurse === false) {
          -                lidx = i-1;
          -            }
          -
          -        }
          -
          -        // restore saved {block}s
          -        for (i=saved.length-1; i>=0; i=i-1) {
          -            s = s.replace(new RegExp("~-" + i + "-~"), "{"  + saved[i] + "}", "g");
          -        }
          -
          -        return s;
          -    },
          -
          -
          -    /**
          -     * Returns a string without any leading or trailing whitespace.  If
          -     * the input is not a string, the input will be returned untouched.
          -     * @method trim
          -     * @since 2.3.0
          -     * @param s {string} the string to trim
          -     * @return {string} the trimmed string
          -     */
          -    trim: function(s){
          -        try {
          -            return s.replace(/^\s+|\s+$/g, "");
          -        } catch(e) {
          -            return s;
          -        }
          -    },
          -
          -    /**
          -     * Returns a new object containing all of the properties of
          -     * all the supplied objects.  The properties from later objects
          -     * will overwrite those in earlier objects.
          -     * @method merge
          -     * @since 2.3.0
          -     * @param arguments {Object*} the objects to merge
          -     * @return the new merged object
          -     */
          -    merge: function() {
          -        var o={}, a=arguments, l=a.length, i;
          -        for (i=0; i<l; i=i+1) {
          -            L.augmentObject(o, a[i], true);
          -        }
          -        return o;
          -    },
          -
          -    /**
          -     * Executes the supplied function in the context of the supplied
          -     * object 'when' milliseconds later.  Executes the function a
          -     * single time unless periodic is set to true.
          -     * @method later
          -     * @since 2.4.0
          -     * @param when {int} the number of milliseconds to wait until the fn
          -     * is executed
          -     * @param o the context object
          -     * @param fn {Function|String} the function to execute or the name of
          -     * the method in the 'o' object to execute
          -     * @param data [Array] data that is provided to the function.  This accepts
          -     * either a single item or an array.  If an array is provided, the
          -     * function is executed with one parameter for each array item.  If
          -     * you need to pass a single array parameter, it needs to be wrapped in
          -     * an array [myarray]
          -     * @param periodic {boolean} if true, executes continuously at supplied
          -     * interval until canceled
          -     * @return a timer object. Call the cancel() method on this object to
          -     * stop the timer.
          -     */
          -    later: function(when, o, fn, data, periodic) {
          -        when = when || 0;
          -        o = o || {};
          -        var m=fn, d=data, f, r;
          -
          -        if (L.isString(fn)) {
          -            m = o[fn];
          -        }
          -
          -        if (!m) {
          -            throw new TypeError("method undefined");
          -        }
          -
          -        if (!L.isUndefined(data) && !L.isArray(d)) {
          -            d = [data];
          -        }
          -
          -        f = function() {
          -            m.apply(o, d || NOTHING);
          -        };
          -
          -        r = (periodic) ? setInterval(f, when) : setTimeout(f, when);
          -
          -        return {
          -            interval: periodic,
          -            cancel: function() {
          -                if (this.interval) {
          -                    clearInterval(r);
          -                } else {
          -                    clearTimeout(r);
          -                }
          -            }
          -        };
          -    },
          -
          -    /**
          -     * A convenience method for detecting a legitimate non-null value.
          -     * Returns false for null/undefined/NaN, true for other values,
          -     * including 0/false/''
          -     * @method isValue
          -     * @since 2.3.0
          -     * @param o {any} the item to test
          -     * @return {boolean} true if it is not null/undefined/NaN || false
          -     */
          -    isValue: function(o) {
          -        // return (o || o === false || o === 0 || o === ''); // Infinity fails
          -return (L.isObject(o) || L.isString(o) || L.isNumber(o) || L.isBoolean(o));
          -    }
          -
          -};
          -
          -/**
          - * Determines whether or not the property was added
          - * to the object instance.  Returns false if the property is not present
          - * in the object, or was inherited from the prototype.
          - * This abstraction is provided to enable hasOwnProperty for Safari 1.3.x.
          - * There is a discrepancy between YAHOO.lang.hasOwnProperty and
          - * Object.prototype.hasOwnProperty when the property is a primitive added to
          - * both the instance AND prototype with the same value:
          - * <pre>
          - * var A = function() {};
          - * A.prototype.foo = 'foo';
          - * var a = new A();
          - * a.foo = 'foo';
          - * alert(a.hasOwnProperty('foo')); // true
          - * alert(YAHOO.lang.hasOwnProperty(a, 'foo')); // false when using fallback
          - * </pre>
          - * @method hasOwnProperty
          - * @param {any} o The object being testing
          - * @param prop {string} the name of the property to test
          - * @return {boolean} the result
          - */
          -L.hasOwnProperty = (OP.hasOwnProperty) ?
          -    function(o, prop) {
          -        return o && o.hasOwnProperty && o.hasOwnProperty(prop);
          -    } : function(o, prop) {
          -        return !L.isUndefined(o[prop]) &&
          -                o.constructor.prototype[prop] !== o[prop];
          -    };
          -
          -// new lang wins
          -OB.augmentObject(L, OB, true);
          -
          -/**
          - * An alias for <a href="YAHOO.lang.html">YAHOO.lang</a>
          - * @class YAHOO.util.Lang
          - */
          -YAHOO.util.Lang = L;
          -
          -/**
          - * Same as YAHOO.lang.augmentObject, except it only applies prototype
          - * properties.  This is an alias for augmentProto.
          - * @see YAHOO.lang.augmentObject
          - * @method augment
          - * @static
          - * @param {Function} r  the object to receive the augmentation
          - * @param {Function} s  the object that supplies the properties to augment
          - * @param {String*|boolean}  arguments zero or more properties methods to
          - *        augment the receiver with.  If none specified, everything
          - *        in the supplier will be used unless it would
          - *        overwrite an existing property in the receiver.  if true
          - *        is specified as the third parameter, all properties will
          - *        be applied and will overwrite an existing property in
          - *        the receiver
          - */
          -L.augment = L.augmentProto;
          -
          -/**
          - * An alias for <a href="YAHOO.lang.html#augment">YAHOO.lang.augment</a>
          - * @for YAHOO
          - * @method augment
          - * @static
          - * @param {Function} r  the object to receive the augmentation
          - * @param {Function} s  the object that supplies the properties to augment
          - * @param {String*}  arguments zero or more properties methods to
          - *        augment the receiver with.  If none specified, everything
          - *        in the supplier will be used unless it would
          - *        overwrite an existing property in the receiver
          - */
          -YAHOO.augment = L.augmentProto;
          -
          -/**
          - * An alias for <a href="YAHOO.lang.html#extend">YAHOO.lang.extend</a>
          - * @method extend
          - * @static
          - * @param {Function} subc   the object to modify
          - * @param {Function} superc the object to inherit
          - * @param {Object} overrides  additional properties/methods to add to the
          - *        subclass prototype.  These will override the
          - *        matching items obtained from the superclass if present.
          - */
          -YAHOO.extend = L.extend;
          -
          -})();
          -YAHOO.register("yahoo", YAHOO, {version: "2.9.0", build: "2800"});
          diff --git a/src/js/lib/zip.js b/src/js/lib/zip.js
          deleted file mode 100755
          index 1f8ee76..0000000
          --- a/src/js/lib/zip.js
          +++ /dev/null
          @@ -1,37 +0,0 @@
          -/* zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */(function() {'use strict';var n=void 0,y=!0,aa=this;function G(e,b){var a=e.split("."),d=aa;!(a[0]in d)&&d.execScript&&d.execScript("var "+a[0]);for(var c;a.length&&(c=a.shift());)!a.length&&b!==n?d[c]=b:d=d[c]?d[c]:d[c]={}};var H="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Uint32Array&&"undefined"!==typeof DataView;function ba(e,b){this.index="number"===typeof b?b:0;this.f=0;this.buffer=e instanceof(H?Uint8Array:Array)?e:new (H?Uint8Array:Array)(32768);if(2*this.buffer.length<=this.index)throw Error("invalid index");this.buffer.length<=this.index&&ca(this)}function ca(e){var b=e.buffer,a,d=b.length,c=new (H?Uint8Array:Array)(d<<1);if(H)c.set(b);else for(a=0;a<d;++a)c[a]=b[a];return e.buffer=c}
          -ba.prototype.b=function(e,b,a){var d=this.buffer,c=this.index,f=this.f,l=d[c],p;a&&1<b&&(e=8<b?(L[e&255]<<24|L[e>>>8&255]<<16|L[e>>>16&255]<<8|L[e>>>24&255])>>32-b:L[e]>>8-b);if(8>b+f)l=l<<b|e,f+=b;else for(p=0;p<b;++p)l=l<<1|e>>b-p-1&1,8===++f&&(f=0,d[c++]=L[l],l=0,c===d.length&&(d=ca(this)));d[c]=l;this.buffer=d;this.f=f;this.index=c};ba.prototype.finish=function(){var e=this.buffer,b=this.index,a;0<this.f&&(e[b]<<=8-this.f,e[b]=L[e[b]],b++);H?a=e.subarray(0,b):(e.length=b,a=e);return a};
          -var da=new (H?Uint8Array:Array)(256),ha;for(ha=0;256>ha;++ha){for(var U=ha,ja=U,ka=7,U=U>>>1;U;U>>>=1)ja<<=1,ja|=U&1,--ka;da[ha]=(ja<<ka&255)>>>0}var L=da;function la(e){var b=n,a,d="number"===typeof b?b:b=0,c=e.length;a=-1;for(d=c&7;d--;++b)a=a>>>8^V[(a^e[b])&255];for(d=c>>3;d--;b+=8)a=a>>>8^V[(a^e[b])&255],a=a>>>8^V[(a^e[b+1])&255],a=a>>>8^V[(a^e[b+2])&255],a=a>>>8^V[(a^e[b+3])&255],a=a>>>8^V[(a^e[b+4])&255],a=a>>>8^V[(a^e[b+5])&255],a=a>>>8^V[(a^e[b+6])&255],a=a>>>8^V[(a^e[b+7])&255];return(a^4294967295)>>>0}
          -var ma=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,
          -2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,
          -2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,
          -2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,
          -3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,
          -936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],V=H?new Uint32Array(ma):ma;function na(e){this.buffer=new (H?Uint16Array:Array)(2*e);this.length=0}na.prototype.getParent=function(e){return 2*((e-2)/4|0)};na.prototype.push=function(e,b){var a,d,c=this.buffer,f;a=this.length;c[this.length++]=b;for(c[this.length++]=e;0<a;)if(d=this.getParent(a),c[a]>c[d])f=c[a],c[a]=c[d],c[d]=f,f=c[a+1],c[a+1]=c[d+1],c[d+1]=f,a=d;else break;return this.length};
          -na.prototype.pop=function(){var e,b,a=this.buffer,d,c,f;b=a[0];e=a[1];this.length-=2;a[0]=a[this.length];a[1]=a[this.length+1];for(f=0;;){c=2*f+2;if(c>=this.length)break;c+2<this.length&&a[c+2]>a[c]&&(c+=2);if(a[c]>a[f])d=a[f],a[f]=a[c],a[c]=d,d=a[f+1],a[f+1]=a[c+1],a[c+1]=d;else break;f=c}return{index:e,value:b,length:this.length}};function pa(e,b){this.k=qa;this.l=0;this.input=H&&e instanceof Array?new Uint8Array(e):e;this.e=0;b&&(b.lazy&&(this.l=b.lazy),"number"===typeof b.compressionType&&(this.k=b.compressionType),b.outputBuffer&&(this.c=H&&b.outputBuffer instanceof Array?new Uint8Array(b.outputBuffer):b.outputBuffer),"number"===typeof b.outputIndex&&(this.e=b.outputIndex));this.c||(this.c=new (H?Uint8Array:Array)(32768))}var qa=2,sa=[],Y;
          -for(Y=0;288>Y;Y++)switch(y){case 143>=Y:sa.push([Y+48,8]);break;case 255>=Y:sa.push([Y-144+400,9]);break;case 279>=Y:sa.push([Y-256+0,7]);break;case 287>=Y:sa.push([Y-280+192,8]);break;default:throw"invalid literal: "+Y;}
          -pa.prototype.g=function(){var e,b,a,d,c=this.input;switch(this.k){case 0:a=0;for(d=c.length;a<d;){b=H?c.subarray(a,a+65535):c.slice(a,a+65535);a+=b.length;var f=b,l=a===d,p=n,k=n,q=n,w=n,u=n,m=this.c,h=this.e;if(H){for(m=new Uint8Array(this.c.buffer);m.length<=h+f.length+5;)m=new Uint8Array(m.length<<1);m.set(this.c)}p=l?1:0;m[h++]=p|0;k=f.length;q=~k+65536&65535;m[h++]=k&255;m[h++]=k>>>8&255;m[h++]=q&255;m[h++]=q>>>8&255;if(H)m.set(f,h),h+=f.length,m=m.subarray(0,h);else{w=0;for(u=f.length;w<u;++w)m[h++]=
          -f[w];m.length=h}this.e=h;this.c=m}break;case 1:var s=new ba(H?new Uint8Array(this.c.buffer):this.c,this.e);s.b(1,1,y);s.b(1,2,y);var t=ta(this,c),r,Q,z;r=0;for(Q=t.length;r<Q;r++)if(z=t[r],ba.prototype.b.apply(s,sa[z]),256<z)s.b(t[++r],t[++r],y),s.b(t[++r],5),s.b(t[++r],t[++r],y);else if(256===z)break;this.c=s.finish();this.e=this.c.length;break;case qa:var A=new ba(H?new Uint8Array(this.c.buffer):this.c,this.e),F,I,N,B,C,g=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],J,ea,O,W,X,oa=Array(19),
          -ya,Z,ia,D,za;F=qa;A.b(1,1,y);A.b(F,2,y);I=ta(this,c);J=ua(this.p,15);ea=va(J);O=ua(this.o,7);W=va(O);for(N=286;257<N&&0===J[N-1];N--);for(B=30;1<B&&0===O[B-1];B--);var Aa=N,Ba=B,P=new (H?Uint32Array:Array)(Aa+Ba),v,R,x,fa,M=new (H?Uint32Array:Array)(316),K,E,S=new (H?Uint8Array:Array)(19);for(v=R=0;v<Aa;v++)P[R++]=J[v];for(v=0;v<Ba;v++)P[R++]=O[v];if(!H){v=0;for(fa=S.length;v<fa;++v)S[v]=0}v=K=0;for(fa=P.length;v<fa;v+=R){for(R=1;v+R<fa&&P[v+R]===P[v];++R);x=R;if(0===P[v])if(3>x)for(;0<x--;)M[K++]=
          -0,S[0]++;else for(;0<x;)E=138>x?x:138,E>x-3&&E<x&&(E=x-3),10>=E?(M[K++]=17,M[K++]=E-3,S[17]++):(M[K++]=18,M[K++]=E-11,S[18]++),x-=E;else if(M[K++]=P[v],S[P[v]]++,x--,3>x)for(;0<x--;)M[K++]=P[v],S[P[v]]++;else for(;0<x;)E=6>x?x:6,E>x-3&&E<x&&(E=x-3),M[K++]=16,M[K++]=E-3,S[16]++,x-=E}e=H?M.subarray(0,K):M.slice(0,K);X=ua(S,7);for(D=0;19>D;D++)oa[D]=X[g[D]];for(C=19;4<C&&0===oa[C-1];C--);ya=va(X);A.b(N-257,5,y);A.b(B-1,5,y);A.b(C-4,4,y);for(D=0;D<C;D++)A.b(oa[D],3,y);D=0;for(za=e.length;D<za;D++)if(Z=
          -e[D],A.b(ya[Z],X[Z],y),16<=Z){D++;switch(Z){case 16:ia=2;break;case 17:ia=3;break;case 18:ia=7;break;default:throw"invalid code: "+Z;}A.b(e[D],ia,y)}var Ca=[ea,J],Da=[W,O],T,Ea,ga,ra,Fa,Ga,Ha,Ia;Fa=Ca[0];Ga=Ca[1];Ha=Da[0];Ia=Da[1];T=0;for(Ea=I.length;T<Ea;++T)if(ga=I[T],A.b(Fa[ga],Ga[ga],y),256<ga)A.b(I[++T],I[++T],y),ra=I[++T],A.b(Ha[ra],Ia[ra],y),A.b(I[++T],I[++T],y);else if(256===ga)break;this.c=A.finish();this.e=this.c.length;break;default:throw"invalid compression type";}return this.c};
          -function wa(e,b){this.length=e;this.n=b}
          -var xa=function(){function e(a){switch(y){case 3===a:return[257,a-3,0];case 4===a:return[258,a-4,0];case 5===a:return[259,a-5,0];case 6===a:return[260,a-6,0];case 7===a:return[261,a-7,0];case 8===a:return[262,a-8,0];case 9===a:return[263,a-9,0];case 10===a:return[264,a-10,0];case 12>=a:return[265,a-11,1];case 14>=a:return[266,a-13,1];case 16>=a:return[267,a-15,1];case 18>=a:return[268,a-17,1];case 22>=a:return[269,a-19,2];case 26>=a:return[270,a-23,2];case 30>=a:return[271,a-27,2];case 34>=a:return[272,
          -a-31,2];case 42>=a:return[273,a-35,3];case 50>=a:return[274,a-43,3];case 58>=a:return[275,a-51,3];case 66>=a:return[276,a-59,3];case 82>=a:return[277,a-67,4];case 98>=a:return[278,a-83,4];case 114>=a:return[279,a-99,4];case 130>=a:return[280,a-115,4];case 162>=a:return[281,a-131,5];case 194>=a:return[282,a-163,5];case 226>=a:return[283,a-195,5];case 257>=a:return[284,a-227,5];case 258===a:return[285,a-258,0];default:throw"invalid length: "+a;}}var b=[],a,d;for(a=3;258>=a;a++)d=e(a),b[a]=d[2]<<24|
          -d[1]<<16|d[0];return b}(),Ja=H?new Uint32Array(xa):xa;
          -function ta(e,b){function a(a,c){var b=a.n,d=[],e=0,f;f=Ja[a.length];d[e++]=f&65535;d[e++]=f>>16&255;d[e++]=f>>24;var g;switch(y){case 1===b:g=[0,b-1,0];break;case 2===b:g=[1,b-2,0];break;case 3===b:g=[2,b-3,0];break;case 4===b:g=[3,b-4,0];break;case 6>=b:g=[4,b-5,1];break;case 8>=b:g=[5,b-7,1];break;case 12>=b:g=[6,b-9,2];break;case 16>=b:g=[7,b-13,2];break;case 24>=b:g=[8,b-17,3];break;case 32>=b:g=[9,b-25,3];break;case 48>=b:g=[10,b-33,4];break;case 64>=b:g=[11,b-49,4];break;case 96>=b:g=[12,b-
          -65,5];break;case 128>=b:g=[13,b-97,5];break;case 192>=b:g=[14,b-129,6];break;case 256>=b:g=[15,b-193,6];break;case 384>=b:g=[16,b-257,7];break;case 512>=b:g=[17,b-385,7];break;case 768>=b:g=[18,b-513,8];break;case 1024>=b:g=[19,b-769,8];break;case 1536>=b:g=[20,b-1025,9];break;case 2048>=b:g=[21,b-1537,9];break;case 3072>=b:g=[22,b-2049,10];break;case 4096>=b:g=[23,b-3073,10];break;case 6144>=b:g=[24,b-4097,11];break;case 8192>=b:g=[25,b-6145,11];break;case 12288>=b:g=[26,b-8193,12];break;case 16384>=
          -b:g=[27,b-12289,12];break;case 24576>=b:g=[28,b-16385,13];break;case 32768>=b:g=[29,b-24577,13];break;default:throw"invalid distance";}f=g;d[e++]=f[0];d[e++]=f[1];d[e++]=f[2];var k,l;k=0;for(l=d.length;k<l;++k)m[h++]=d[k];t[d[0]]++;r[d[3]]++;s=a.length+c-1;u=null}var d,c,f,l,p,k={},q,w,u,m=H?new Uint16Array(2*b.length):[],h=0,s=0,t=new (H?Uint32Array:Array)(286),r=new (H?Uint32Array:Array)(30),Q=e.l,z;if(!H){for(f=0;285>=f;)t[f++]=0;for(f=0;29>=f;)r[f++]=0}t[256]=1;d=0;for(c=b.length;d<c;++d){f=p=
          -0;for(l=3;f<l&&d+f!==c;++f)p=p<<8|b[d+f];k[p]===n&&(k[p]=[]);q=k[p];if(!(0<s--)){for(;0<q.length&&32768<d-q[0];)q.shift();if(d+3>=c){u&&a(u,-1);f=0;for(l=c-d;f<l;++f)z=b[d+f],m[h++]=z,++t[z];break}0<q.length?(w=Ka(b,d,q),u?u.length<w.length?(z=b[d-1],m[h++]=z,++t[z],a(w,0)):a(u,-1):w.length<Q?u=w:a(w,0)):u?a(u,-1):(z=b[d],m[h++]=z,++t[z])}q.push(d)}m[h++]=256;t[256]++;e.p=t;e.o=r;return H?m.subarray(0,h):m}
          -function Ka(e,b,a){var d,c,f=0,l,p,k,q,w=e.length;p=0;q=a.length;a:for(;p<q;p++){d=a[q-p-1];l=3;if(3<f){for(k=f;3<k;k--)if(e[d+k-1]!==e[b+k-1])continue a;l=f}for(;258>l&&b+l<w&&e[d+l]===e[b+l];)++l;l>f&&(c=d,f=l);if(258===l)break}return new wa(f,b-c)}
          -function ua(e,b){var a=e.length,d=new na(572),c=new (H?Uint8Array:Array)(a),f,l,p,k,q;if(!H)for(k=0;k<a;k++)c[k]=0;for(k=0;k<a;++k)0<e[k]&&d.push(k,e[k]);f=Array(d.length/2);l=new (H?Uint32Array:Array)(d.length/2);if(1===f.length)return c[d.pop().index]=1,c;k=0;for(q=d.length/2;k<q;++k)f[k]=d.pop(),l[k]=f[k].value;p=La(l,l.length,b);k=0;for(q=f.length;k<q;++k)c[f[k].index]=p[k];return c}
          -function La(e,b,a){function d(a){var c=k[a][q[a]];c===b?(d(a+1),d(a+1)):--l[c];++q[a]}var c=new (H?Uint16Array:Array)(a),f=new (H?Uint8Array:Array)(a),l=new (H?Uint8Array:Array)(b),p=Array(a),k=Array(a),q=Array(a),w=(1<<a)-b,u=1<<a-1,m,h,s,t,r;c[a-1]=b;for(h=0;h<a;++h)w<u?f[h]=0:(f[h]=1,w-=u),w<<=1,c[a-2-h]=(c[a-1-h]/2|0)+b;c[0]=f[0];p[0]=Array(c[0]);k[0]=Array(c[0]);for(h=1;h<a;++h)c[h]>2*c[h-1]+f[h]&&(c[h]=2*c[h-1]+f[h]),p[h]=Array(c[h]),k[h]=Array(c[h]);for(m=0;m<b;++m)l[m]=a;for(s=0;s<c[a-1];++s)p[a-
          -1][s]=e[s],k[a-1][s]=s;for(m=0;m<a;++m)q[m]=0;1===f[a-1]&&(--l[0],++q[a-1]);for(h=a-2;0<=h;--h){t=m=0;r=q[h+1];for(s=0;s<c[h];s++)t=p[h+1][r]+p[h+1][r+1],t>e[m]?(p[h][s]=t,k[h][s]=b,r+=2):(p[h][s]=e[m],k[h][s]=m,++m);q[h]=0;1===f[h]&&d(h)}return l}
          -function va(e){var b=new (H?Uint16Array:Array)(e.length),a=[],d=[],c=0,f,l,p,k;f=0;for(l=e.length;f<l;f++)a[e[f]]=(a[e[f]]|0)+1;f=1;for(l=16;f<=l;f++)d[f]=c,c+=a[f]|0,c<<=1;f=0;for(l=e.length;f<l;f++){c=d[e[f]];d[e[f]]+=1;p=b[f]=0;for(k=e[f];p<k;p++)b[f]=b[f]<<1|c&1,c>>>=1}return b};function $(e){e=e||{};this.files=[];this.d=e.comment}var Ma=[80,75,1,2],Na=[80,75,3,4],Oa=[80,75,5,6];$.prototype.m=function(e,b){b=b||{};var a,d=e.length,c=0;H&&e instanceof Array&&(e=new Uint8Array(e));"number"!==typeof b.compressionMethod&&(b.compressionMethod=8);if(b.compress)switch(b.compressionMethod){case 0:break;case 8:c=la(e);e=(new pa(e,b.deflateOption)).g();a=y;break;default:throw Error("unknown compression method:"+b.compressionMethod);}this.files.push({buffer:e,a:b,j:a,r:!1,size:d,h:c})};
          -$.prototype.q=function(e){this.i=e};
          -$.prototype.g=function(){var e=this.files,b,a,d,c,f,l=0,p=0,k,q,w,u,m,h,s,t,r,Q,z,A,F,I,N,B,C,g,J;B=0;for(C=e.length;B<C;++B){b=e[B];t=b.a.filename?b.a.filename.length:0;r=b.a.comment?b.a.comment.length:0;if(!b.j)switch(b.h=la(b.buffer),b.a.compressionMethod){case 0:break;case 8:b.buffer=(new pa(b.buffer,b.a.deflateOption)).g();b.j=y;break;default:throw Error("unknown compression method:"+b.a.compressionMethod);}if(b.a.password!==n||this.i!==n){var ea=b.a.password||this.i,O=[305419896,591751049,878082192],
          -W=n,X=n;H&&(O=new Uint32Array(O));W=0;for(X=ea.length;W<X;++W)Pa(O,ea[W]&255);N=O;F=b.buffer;H?(I=new Uint8Array(F.length+12),I.set(F,12),F=I):F.unshift(0,0,0,0,0,0,0,0,0,0,0,0);for(g=0;12>g;++g)F[g]=Qa(N,11===B?b.h&255:256*Math.random()|0);for(J=F.length;g<J;++g)F[g]=Qa(N,F[g]);b.buffer=F}l+=30+t+b.buffer.length;p+=46+t+r}a=new (H?Uint8Array:Array)(l+p+(46+(this.d?this.d.length:0)));d=0;c=l;f=c+p;B=0;for(C=e.length;B<C;++B){b=e[B];t=b.a.filename?b.a.filename.length:0;r=b.a.comment?b.a.comment.length:
          -0;k=d;a[d++]=Na[0];a[d++]=Na[1];a[d++]=Na[2];a[d++]=Na[3];a[c++]=Ma[0];a[c++]=Ma[1];a[c++]=Ma[2];a[c++]=Ma[3];a[c++]=20;a[c++]=b.a.os||0;a[d++]=a[c++]=20;q=a[d++]=a[c++]=0;if(b.a.password||this.i)q|=1;a[d++]=a[c++]=q&255;a[d++]=a[c++]=q>>8&255;w=b.a.compressionMethod;a[d++]=a[c++]=w&255;a[d++]=a[c++]=w>>8&255;u=b.a.date||new Date;a[d++]=a[c++]=(u.getMinutes()&7)<<5|u.getSeconds()/2|0;a[d++]=a[c++]=u.getHours()<<3|u.getMinutes()>>3;a[d++]=a[c++]=(u.getMonth()+1&7)<<5|u.getDate();a[d++]=a[c++]=(u.getFullYear()-
          -1980&127)<<1|u.getMonth()+1>>3;m=b.h;a[d++]=a[c++]=m&255;a[d++]=a[c++]=m>>8&255;a[d++]=a[c++]=m>>16&255;a[d++]=a[c++]=m>>24&255;h=b.buffer.length;a[d++]=a[c++]=h&255;a[d++]=a[c++]=h>>8&255;a[d++]=a[c++]=h>>16&255;a[d++]=a[c++]=h>>24&255;s=b.size;a[d++]=a[c++]=s&255;a[d++]=a[c++]=s>>8&255;a[d++]=a[c++]=s>>16&255;a[d++]=a[c++]=s>>24&255;a[d++]=a[c++]=t&255;a[d++]=a[c++]=t>>8&255;a[d++]=a[c++]=0;a[d++]=a[c++]=0;a[c++]=r&255;a[c++]=r>>8&255;a[c++]=0;a[c++]=0;a[c++]=0;a[c++]=0;a[c++]=0;a[c++]=0;a[c++]=
          -0;a[c++]=0;a[c++]=k&255;a[c++]=k>>8&255;a[c++]=k>>16&255;a[c++]=k>>24&255;if(Q=b.a.filename)if(H)a.set(Q,d),a.set(Q,c),d+=t,c+=t;else for(g=0;g<t;++g)a[d++]=a[c++]=Q[g];if(z=b.a.extraField)if(H)a.set(z,d),a.set(z,c),d+=0,c+=0;else for(g=0;g<r;++g)a[d++]=a[c++]=z[g];if(A=b.a.comment)if(H)a.set(A,c),c+=r;else for(g=0;g<r;++g)a[c++]=A[g];if(H)a.set(b.buffer,d),d+=b.buffer.length;else{g=0;for(J=b.buffer.length;g<J;++g)a[d++]=b.buffer[g]}}a[f++]=Oa[0];a[f++]=Oa[1];a[f++]=Oa[2];a[f++]=Oa[3];a[f++]=0;a[f++]=
          -0;a[f++]=0;a[f++]=0;a[f++]=C&255;a[f++]=C>>8&255;a[f++]=C&255;a[f++]=C>>8&255;a[f++]=p&255;a[f++]=p>>8&255;a[f++]=p>>16&255;a[f++]=p>>24&255;a[f++]=l&255;a[f++]=l>>8&255;a[f++]=l>>16&255;a[f++]=l>>24&255;r=this.d?this.d.length:0;a[f++]=r&255;a[f++]=r>>8&255;if(this.d)if(H)a.set(this.d,f);else{g=0;for(J=r;g<J;++g)a[f++]=this.d[g]}return a};function Qa(e,b){var a,d=e[2]&65535|2;a=d*(d^1)>>8&255;Pa(e,b);return a^b}
          -function Pa(e,b){e[0]=(V[(e[0]^b)&255]^e[0]>>>8)>>>0;e[1]=(6681*(20173*(e[1]+(e[0]&255))>>>0)>>>0)+1>>>0;e[2]=(V[(e[2]^e[1]>>>24)&255]^e[2]>>>8)>>>0};function Ra(e,b){var a,d,c,f;if(Object.keys)a=Object.keys(b);else for(d in a=[],c=0,b)a[c++]=d;c=0;for(f=a.length;c<f;++c)d=a[c],G(e+"."+d,b[d])};G("Zlib.Zip",$);G("Zlib.Zip.prototype.addFile",$.prototype.m);G("Zlib.Zip.prototype.compress",$.prototype.g);G("Zlib.Zip.prototype.setPassword",$.prototype.q);Ra("Zlib.Zip.CompressionMethod",{STORE:0,DEFLATE:8});Ra("Zlib.Zip.OperatingSystem",{MSDOS:0,UNIX:3,MACINTOSH:7});}).call(this);
          diff --git a/src/js/lib/zlib_and_gzip.js b/src/js/lib/zlib_and_gzip.js
          deleted file mode 100755
          index 70840ec..0000000
          --- a/src/js/lib/zlib_and_gzip.js
          +++ /dev/null
          @@ -1,55 +0,0 @@
          -/** @license
          -========================================================================
          -  zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License
          -*/
          -(function() {'use strict';function q(b){throw b;}var t=void 0,u=!0,aa=this;function A(b,a){var c=b.split("."),d=aa;!(c[0]in d)&&d.execScript&&d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)!c.length&&a!==t?d[e]=a:d=d[e]?d[e]:d[e]={}};var B="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Uint32Array&&"undefined"!==typeof DataView;function F(b,a){this.index="number"===typeof a?a:0;this.m=0;this.buffer=b instanceof(B?Uint8Array:Array)?b:new (B?Uint8Array:Array)(32768);2*this.buffer.length<=this.index&&q(Error("invalid index"));this.buffer.length<=this.index&&this.f()}F.prototype.f=function(){var b=this.buffer,a,c=b.length,d=new (B?Uint8Array:Array)(c<<1);if(B)d.set(b);else for(a=0;a<c;++a)d[a]=b[a];return this.buffer=d};
          -F.prototype.d=function(b,a,c){var d=this.buffer,e=this.index,f=this.m,g=d[e],k;c&&1<a&&(b=8<a?(H[b&255]<<24|H[b>>>8&255]<<16|H[b>>>16&255]<<8|H[b>>>24&255])>>32-a:H[b]>>8-a);if(8>a+f)g=g<<a|b,f+=a;else for(k=0;k<a;++k)g=g<<1|b>>a-k-1&1,8===++f&&(f=0,d[e++]=H[g],g=0,e===d.length&&(d=this.f()));d[e]=g;this.buffer=d;this.m=f;this.index=e};F.prototype.finish=function(){var b=this.buffer,a=this.index,c;0<this.m&&(b[a]<<=8-this.m,b[a]=H[b[a]],a++);B?c=b.subarray(0,a):(b.length=a,c=b);return c};
          -var ba=new (B?Uint8Array:Array)(256),ca;for(ca=0;256>ca;++ca){for(var K=ca,da=K,ea=7,K=K>>>1;K;K>>>=1)da<<=1,da|=K&1,--ea;ba[ca]=(da<<ea&255)>>>0}var H=ba;function ja(b,a,c){var d,e="number"===typeof a?a:a=0,f="number"===typeof c?c:b.length;d=-1;for(e=f&7;e--;++a)d=d>>>8^O[(d^b[a])&255];for(e=f>>3;e--;a+=8)d=d>>>8^O[(d^b[a])&255],d=d>>>8^O[(d^b[a+1])&255],d=d>>>8^O[(d^b[a+2])&255],d=d>>>8^O[(d^b[a+3])&255],d=d>>>8^O[(d^b[a+4])&255],d=d>>>8^O[(d^b[a+5])&255],d=d>>>8^O[(d^b[a+6])&255],d=d>>>8^O[(d^b[a+7])&255];return(d^4294967295)>>>0}
          -var ka=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,
          -2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,
          -2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,
          -2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,
          -3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,
          -936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],O=B?new Uint32Array(ka):ka;function P(){}P.prototype.getName=function(){return this.name};P.prototype.getData=function(){return this.data};P.prototype.Y=function(){return this.Z};A("Zlib.GunzipMember",P);A("Zlib.GunzipMember.prototype.getName",P.prototype.getName);A("Zlib.GunzipMember.prototype.getData",P.prototype.getData);A("Zlib.GunzipMember.prototype.getMtime",P.prototype.Y);function la(b){this.buffer=new (B?Uint16Array:Array)(2*b);this.length=0}la.prototype.getParent=function(b){return 2*((b-2)/4|0)};la.prototype.push=function(b,a){var c,d,e=this.buffer,f;c=this.length;e[this.length++]=a;for(e[this.length++]=b;0<c;)if(d=this.getParent(c),e[c]>e[d])f=e[c],e[c]=e[d],e[d]=f,f=e[c+1],e[c+1]=e[d+1],e[d+1]=f,c=d;else break;return this.length};
          -la.prototype.pop=function(){var b,a,c=this.buffer,d,e,f;a=c[0];b=c[1];this.length-=2;c[0]=c[this.length];c[1]=c[this.length+1];for(f=0;;){e=2*f+2;if(e>=this.length)break;e+2<this.length&&c[e+2]>c[e]&&(e+=2);if(c[e]>c[f])d=c[f],c[f]=c[e],c[e]=d,d=c[f+1],c[f+1]=c[e+1],c[e+1]=d;else break;f=e}return{index:b,value:a,length:this.length}};function ma(b){var a=b.length,c=0,d=Number.POSITIVE_INFINITY,e,f,g,k,h,l,s,p,m,n;for(p=0;p<a;++p)b[p]>c&&(c=b[p]),b[p]<d&&(d=b[p]);e=1<<c;f=new (B?Uint32Array:Array)(e);g=1;k=0;for(h=2;g<=c;){for(p=0;p<a;++p)if(b[p]===g){l=0;s=k;for(m=0;m<g;++m)l=l<<1|s&1,s>>=1;n=g<<16|p;for(m=l;m<e;m+=h)f[m]=n;++k}++g;k<<=1;h<<=1}return[f,c,d]};function na(b,a){this.k=qa;this.I=0;this.input=B&&b instanceof Array?new Uint8Array(b):b;this.b=0;a&&(a.lazy&&(this.I=a.lazy),"number"===typeof a.compressionType&&(this.k=a.compressionType),a.outputBuffer&&(this.a=B&&a.outputBuffer instanceof Array?new Uint8Array(a.outputBuffer):a.outputBuffer),"number"===typeof a.outputIndex&&(this.b=a.outputIndex));this.a||(this.a=new (B?Uint8Array:Array)(32768))}var qa=2,ra={NONE:0,v:1,o:qa,ba:3},sa=[],S;
          -for(S=0;288>S;S++)switch(u){case 143>=S:sa.push([S+48,8]);break;case 255>=S:sa.push([S-144+400,9]);break;case 279>=S:sa.push([S-256+0,7]);break;case 287>=S:sa.push([S-280+192,8]);break;default:q("invalid literal: "+S)}
          -na.prototype.g=function(){var b,a,c,d,e=this.input;switch(this.k){case 0:c=0;for(d=e.length;c<d;){a=B?e.subarray(c,c+65535):e.slice(c,c+65535);c+=a.length;var f=a,g=c===d,k=t,h=t,l=t,s=t,p=t,m=this.a,n=this.b;if(B){for(m=new Uint8Array(this.a.buffer);m.length<=n+f.length+5;)m=new Uint8Array(m.length<<1);m.set(this.a)}k=g?1:0;m[n++]=k|0;h=f.length;l=~h+65536&65535;m[n++]=h&255;m[n++]=h>>>8&255;m[n++]=l&255;m[n++]=l>>>8&255;if(B)m.set(f,n),n+=f.length,m=m.subarray(0,n);else{s=0;for(p=f.length;s<p;++s)m[n++]=
          -f[s];m.length=n}this.b=n;this.a=m}break;case 1:var r=new F(B?new Uint8Array(this.a.buffer):this.a,this.b);r.d(1,1,u);r.d(1,2,u);var v=ta(this,e),x,Q,y;x=0;for(Q=v.length;x<Q;x++)if(y=v[x],F.prototype.d.apply(r,sa[y]),256<y)r.d(v[++x],v[++x],u),r.d(v[++x],5),r.d(v[++x],v[++x],u);else if(256===y)break;this.a=r.finish();this.b=this.a.length;break;case qa:var E=new F(B?new Uint8Array(this.a.buffer):this.a,this.b),Ka,R,X,Y,Z,pb=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],fa,La,ga,Ma,oa,wa=Array(19),
          -Na,$,pa,C,Oa;Ka=qa;E.d(1,1,u);E.d(Ka,2,u);R=ta(this,e);fa=ua(this.W,15);La=va(fa);ga=ua(this.V,7);Ma=va(ga);for(X=286;257<X&&0===fa[X-1];X--);for(Y=30;1<Y&&0===ga[Y-1];Y--);var Pa=X,Qa=Y,J=new (B?Uint32Array:Array)(Pa+Qa),w,L,z,ha,I=new (B?Uint32Array:Array)(316),G,D,M=new (B?Uint8Array:Array)(19);for(w=L=0;w<Pa;w++)J[L++]=fa[w];for(w=0;w<Qa;w++)J[L++]=ga[w];if(!B){w=0;for(ha=M.length;w<ha;++w)M[w]=0}w=G=0;for(ha=J.length;w<ha;w+=L){for(L=1;w+L<ha&&J[w+L]===J[w];++L);z=L;if(0===J[w])if(3>z)for(;0<
          -z--;)I[G++]=0,M[0]++;else for(;0<z;)D=138>z?z:138,D>z-3&&D<z&&(D=z-3),10>=D?(I[G++]=17,I[G++]=D-3,M[17]++):(I[G++]=18,I[G++]=D-11,M[18]++),z-=D;else if(I[G++]=J[w],M[J[w]]++,z--,3>z)for(;0<z--;)I[G++]=J[w],M[J[w]]++;else for(;0<z;)D=6>z?z:6,D>z-3&&D<z&&(D=z-3),I[G++]=16,I[G++]=D-3,M[16]++,z-=D}b=B?I.subarray(0,G):I.slice(0,G);oa=ua(M,7);for(C=0;19>C;C++)wa[C]=oa[pb[C]];for(Z=19;4<Z&&0===wa[Z-1];Z--);Na=va(oa);E.d(X-257,5,u);E.d(Y-1,5,u);E.d(Z-4,4,u);for(C=0;C<Z;C++)E.d(wa[C],3,u);C=0;for(Oa=b.length;C<
          -Oa;C++)if($=b[C],E.d(Na[$],oa[$],u),16<=$){C++;switch($){case 16:pa=2;break;case 17:pa=3;break;case 18:pa=7;break;default:q("invalid code: "+$)}E.d(b[C],pa,u)}var Ra=[La,fa],Sa=[Ma,ga],N,Ta,ia,za,Ua,Va,Wa,Xa;Ua=Ra[0];Va=Ra[1];Wa=Sa[0];Xa=Sa[1];N=0;for(Ta=R.length;N<Ta;++N)if(ia=R[N],E.d(Ua[ia],Va[ia],u),256<ia)E.d(R[++N],R[++N],u),za=R[++N],E.d(Wa[za],Xa[za],u),E.d(R[++N],R[++N],u);else if(256===ia)break;this.a=E.finish();this.b=this.a.length;break;default:q("invalid compression type")}return this.a};
          -function xa(b,a){this.length=b;this.Q=a}
          -var ya=function(){function b(a){switch(u){case 3===a:return[257,a-3,0];case 4===a:return[258,a-4,0];case 5===a:return[259,a-5,0];case 6===a:return[260,a-6,0];case 7===a:return[261,a-7,0];case 8===a:return[262,a-8,0];case 9===a:return[263,a-9,0];case 10===a:return[264,a-10,0];case 12>=a:return[265,a-11,1];case 14>=a:return[266,a-13,1];case 16>=a:return[267,a-15,1];case 18>=a:return[268,a-17,1];case 22>=a:return[269,a-19,2];case 26>=a:return[270,a-23,2];case 30>=a:return[271,a-27,2];case 34>=a:return[272,
          -a-31,2];case 42>=a:return[273,a-35,3];case 50>=a:return[274,a-43,3];case 58>=a:return[275,a-51,3];case 66>=a:return[276,a-59,3];case 82>=a:return[277,a-67,4];case 98>=a:return[278,a-83,4];case 114>=a:return[279,a-99,4];case 130>=a:return[280,a-115,4];case 162>=a:return[281,a-131,5];case 194>=a:return[282,a-163,5];case 226>=a:return[283,a-195,5];case 257>=a:return[284,a-227,5];case 258===a:return[285,a-258,0];default:q("invalid length: "+a)}}var a=[],c,d;for(c=3;258>=c;c++)d=b(c),a[c]=d[2]<<24|d[1]<<
          -16|d[0];return a}(),Aa=B?new Uint32Array(ya):ya;
          -function ta(b,a){function c(a,c){var b=a.Q,d=[],e=0,f;f=Aa[a.length];d[e++]=f&65535;d[e++]=f>>16&255;d[e++]=f>>24;var g;switch(u){case 1===b:g=[0,b-1,0];break;case 2===b:g=[1,b-2,0];break;case 3===b:g=[2,b-3,0];break;case 4===b:g=[3,b-4,0];break;case 6>=b:g=[4,b-5,1];break;case 8>=b:g=[5,b-7,1];break;case 12>=b:g=[6,b-9,2];break;case 16>=b:g=[7,b-13,2];break;case 24>=b:g=[8,b-17,3];break;case 32>=b:g=[9,b-25,3];break;case 48>=b:g=[10,b-33,4];break;case 64>=b:g=[11,b-49,4];break;case 96>=b:g=[12,b-
          -65,5];break;case 128>=b:g=[13,b-97,5];break;case 192>=b:g=[14,b-129,6];break;case 256>=b:g=[15,b-193,6];break;case 384>=b:g=[16,b-257,7];break;case 512>=b:g=[17,b-385,7];break;case 768>=b:g=[18,b-513,8];break;case 1024>=b:g=[19,b-769,8];break;case 1536>=b:g=[20,b-1025,9];break;case 2048>=b:g=[21,b-1537,9];break;case 3072>=b:g=[22,b-2049,10];break;case 4096>=b:g=[23,b-3073,10];break;case 6144>=b:g=[24,b-4097,11];break;case 8192>=b:g=[25,b-6145,11];break;case 12288>=b:g=[26,b-8193,12];break;case 16384>=
          -b:g=[27,b-12289,12];break;case 24576>=b:g=[28,b-16385,13];break;case 32768>=b:g=[29,b-24577,13];break;default:q("invalid distance")}f=g;d[e++]=f[0];d[e++]=f[1];d[e++]=f[2];var h,k;h=0;for(k=d.length;h<k;++h)m[n++]=d[h];v[d[0]]++;x[d[3]]++;r=a.length+c-1;p=null}var d,e,f,g,k,h={},l,s,p,m=B?new Uint16Array(2*a.length):[],n=0,r=0,v=new (B?Uint32Array:Array)(286),x=new (B?Uint32Array:Array)(30),Q=b.I,y;if(!B){for(f=0;285>=f;)v[f++]=0;for(f=0;29>=f;)x[f++]=0}v[256]=1;d=0;for(e=a.length;d<e;++d){f=k=0;
          -for(g=3;f<g&&d+f!==e;++f)k=k<<8|a[d+f];h[k]===t&&(h[k]=[]);l=h[k];if(!(0<r--)){for(;0<l.length&&32768<d-l[0];)l.shift();if(d+3>=e){p&&c(p,-1);f=0;for(g=e-d;f<g;++f)y=a[d+f],m[n++]=y,++v[y];break}0<l.length?(s=Ba(a,d,l),p?p.length<s.length?(y=a[d-1],m[n++]=y,++v[y],c(s,0)):c(p,-1):s.length<Q?p=s:c(s,0)):p?c(p,-1):(y=a[d],m[n++]=y,++v[y])}l.push(d)}m[n++]=256;v[256]++;b.W=v;b.V=x;return B?m.subarray(0,n):m}
          -function Ba(b,a,c){var d,e,f=0,g,k,h,l,s=b.length;k=0;l=c.length;a:for(;k<l;k++){d=c[l-k-1];g=3;if(3<f){for(h=f;3<h;h--)if(b[d+h-1]!==b[a+h-1])continue a;g=f}for(;258>g&&a+g<s&&b[d+g]===b[a+g];)++g;g>f&&(e=d,f=g);if(258===g)break}return new xa(f,a-e)}
          -function ua(b,a){var c=b.length,d=new la(572),e=new (B?Uint8Array:Array)(c),f,g,k,h,l;if(!B)for(h=0;h<c;h++)e[h]=0;for(h=0;h<c;++h)0<b[h]&&d.push(h,b[h]);f=Array(d.length/2);g=new (B?Uint32Array:Array)(d.length/2);if(1===f.length)return e[d.pop().index]=1,e;h=0;for(l=d.length/2;h<l;++h)f[h]=d.pop(),g[h]=f[h].value;k=Ca(g,g.length,a);h=0;for(l=f.length;h<l;++h)e[f[h].index]=k[h];return e}
          -function Ca(b,a,c){function d(b){var c=h[b][l[b]];c===a?(d(b+1),d(b+1)):--g[c];++l[b]}var e=new (B?Uint16Array:Array)(c),f=new (B?Uint8Array:Array)(c),g=new (B?Uint8Array:Array)(a),k=Array(c),h=Array(c),l=Array(c),s=(1<<c)-a,p=1<<c-1,m,n,r,v,x;e[c-1]=a;for(n=0;n<c;++n)s<p?f[n]=0:(f[n]=1,s-=p),s<<=1,e[c-2-n]=(e[c-1-n]/2|0)+a;e[0]=f[0];k[0]=Array(e[0]);h[0]=Array(e[0]);for(n=1;n<c;++n)e[n]>2*e[n-1]+f[n]&&(e[n]=2*e[n-1]+f[n]),k[n]=Array(e[n]),h[n]=Array(e[n]);for(m=0;m<a;++m)g[m]=c;for(r=0;r<e[c-1];++r)k[c-
          -1][r]=b[r],h[c-1][r]=r;for(m=0;m<c;++m)l[m]=0;1===f[c-1]&&(--g[0],++l[c-1]);for(n=c-2;0<=n;--n){v=m=0;x=l[n+1];for(r=0;r<e[n];r++)v=k[n+1][x]+k[n+1][x+1],v>b[m]?(k[n][r]=v,h[n][r]=a,x+=2):(k[n][r]=b[m],h[n][r]=m,++m);l[n]=0;1===f[n]&&d(n)}return g}
          -function va(b){var a=new (B?Uint16Array:Array)(b.length),c=[],d=[],e=0,f,g,k,h;f=0;for(g=b.length;f<g;f++)c[b[f]]=(c[b[f]]|0)+1;f=1;for(g=16;f<=g;f++)d[f]=e,e+=c[f]|0,e<<=1;f=0;for(g=b.length;f<g;f++){e=d[b[f]];d[b[f]]+=1;k=a[f]=0;for(h=b[f];k<h;k++)a[f]=a[f]<<1|e&1,e>>>=1}return a};function Da(b,a){this.input=b;this.b=this.c=0;this.i={};a&&(a.flags&&(this.i=a.flags),"string"===typeof a.filename&&(this.filename=a.filename),"string"===typeof a.comment&&(this.A=a.comment),a.deflateOptions&&(this.l=a.deflateOptions));this.l||(this.l={})}
          -Da.prototype.g=function(){var b,a,c,d,e,f,g,k,h=new (B?Uint8Array:Array)(32768),l=0,s=this.input,p=this.c,m=this.filename,n=this.A;h[l++]=31;h[l++]=139;h[l++]=8;b=0;this.i.fname&&(b|=Ea);this.i.fcomment&&(b|=Fa);this.i.fhcrc&&(b|=Ga);h[l++]=b;a=(Date.now?Date.now():+new Date)/1E3|0;h[l++]=a&255;h[l++]=a>>>8&255;h[l++]=a>>>16&255;h[l++]=a>>>24&255;h[l++]=0;h[l++]=Ha;if(this.i.fname!==t){g=0;for(k=m.length;g<k;++g)f=m.charCodeAt(g),255<f&&(h[l++]=f>>>8&255),h[l++]=f&255;h[l++]=0}if(this.i.comment){g=
          -0;for(k=n.length;g<k;++g)f=n.charCodeAt(g),255<f&&(h[l++]=f>>>8&255),h[l++]=f&255;h[l++]=0}this.i.fhcrc&&(c=ja(h,0,l)&65535,h[l++]=c&255,h[l++]=c>>>8&255);this.l.outputBuffer=h;this.l.outputIndex=l;e=new na(s,this.l);h=e.g();l=e.b;B&&(l+8>h.buffer.byteLength?(this.a=new Uint8Array(l+8),this.a.set(new Uint8Array(h.buffer)),h=this.a):h=new Uint8Array(h.buffer));d=ja(s,t,t);h[l++]=d&255;h[l++]=d>>>8&255;h[l++]=d>>>16&255;h[l++]=d>>>24&255;k=s.length;h[l++]=k&255;h[l++]=k>>>8&255;h[l++]=k>>>16&255;h[l++]=
          -k>>>24&255;this.c=p;B&&l<h.length&&(this.a=h=h.subarray(0,l));return h};var Ha=255,Ga=2,Ea=8,Fa=16;A("Zlib.Gzip",Da);A("Zlib.Gzip.prototype.compress",Da.prototype.g);function T(b,a){this.p=[];this.q=32768;this.e=this.j=this.c=this.u=0;this.input=B?new Uint8Array(b):b;this.w=!1;this.r=Ia;this.M=!1;if(a||!(a={}))a.index&&(this.c=a.index),a.bufferSize&&(this.q=a.bufferSize),a.bufferType&&(this.r=a.bufferType),a.resize&&(this.M=a.resize);switch(this.r){case Ja:this.b=32768;this.a=new (B?Uint8Array:Array)(32768+this.q+258);break;case Ia:this.b=0;this.a=new (B?Uint8Array:Array)(this.q);this.f=this.U;this.B=this.R;this.s=this.T;break;default:q(Error("invalid inflate mode"))}}
          -var Ja=0,Ia=1,Ya={O:Ja,N:Ia};
          -T.prototype.h=function(){for(;!this.w;){var b=U(this,3);b&1&&(this.w=u);b>>>=1;switch(b){case 0:var a=this.input,c=this.c,d=this.a,e=this.b,f=a.length,g=t,k=t,h=d.length,l=t;this.e=this.j=0;c+1>=f&&q(Error("invalid uncompressed block header: LEN"));g=a[c++]|a[c++]<<8;c+1>=f&&q(Error("invalid uncompressed block header: NLEN"));k=a[c++]|a[c++]<<8;g===~k&&q(Error("invalid uncompressed block header: length verify"));c+g>a.length&&q(Error("input buffer is broken"));switch(this.r){case Ja:for(;e+g>d.length;){l=
          -h-e;g-=l;if(B)d.set(a.subarray(c,c+l),e),e+=l,c+=l;else for(;l--;)d[e++]=a[c++];this.b=e;d=this.f();e=this.b}break;case Ia:for(;e+g>d.length;)d=this.f({F:2});break;default:q(Error("invalid inflate mode"))}if(B)d.set(a.subarray(c,c+g),e),e+=g,c+=g;else for(;g--;)d[e++]=a[c++];this.c=c;this.b=e;this.a=d;break;case 1:this.s(Za,$a);break;case 2:ab(this);break;default:q(Error("unknown BTYPE: "+b))}}return this.B()};
          -var bb=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],cb=B?new Uint16Array(bb):bb,db=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],eb=B?new Uint16Array(db):db,fb=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],gb=B?new Uint8Array(fb):fb,hb=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],ib=B?new Uint16Array(hb):hb,jb=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,
          -10,11,11,12,12,13,13],kb=B?new Uint8Array(jb):jb,lb=new (B?Uint8Array:Array)(288),V,mb;V=0;for(mb=lb.length;V<mb;++V)lb[V]=143>=V?8:255>=V?9:279>=V?7:8;var Za=ma(lb),nb=new (B?Uint8Array:Array)(30),ob,qb;ob=0;for(qb=nb.length;ob<qb;++ob)nb[ob]=5;var $a=ma(nb);function U(b,a){for(var c=b.j,d=b.e,e=b.input,f=b.c,g=e.length,k;d<a;)f>=g&&q(Error("input buffer is broken")),c|=e[f++]<<d,d+=8;k=c&(1<<a)-1;b.j=c>>>a;b.e=d-a;b.c=f;return k}
          -function rb(b,a){for(var c=b.j,d=b.e,e=b.input,f=b.c,g=e.length,k=a[0],h=a[1],l,s;d<h&&!(f>=g);)c|=e[f++]<<d,d+=8;l=k[c&(1<<h)-1];s=l>>>16;b.j=c>>s;b.e=d-s;b.c=f;return l&65535}
          -function ab(b){function a(a,b,c){var d,e=this.J,f,g;for(g=0;g<a;)switch(d=rb(this,b),d){case 16:for(f=3+U(this,2);f--;)c[g++]=e;break;case 17:for(f=3+U(this,3);f--;)c[g++]=0;e=0;break;case 18:for(f=11+U(this,7);f--;)c[g++]=0;e=0;break;default:e=c[g++]=d}this.J=e;return c}var c=U(b,5)+257,d=U(b,5)+1,e=U(b,4)+4,f=new (B?Uint8Array:Array)(cb.length),g,k,h,l;for(l=0;l<e;++l)f[cb[l]]=U(b,3);if(!B){l=e;for(e=f.length;l<e;++l)f[cb[l]]=0}g=ma(f);k=new (B?Uint8Array:Array)(c);h=new (B?Uint8Array:Array)(d);
          -b.J=0;b.s(ma(a.call(b,c,g,k)),ma(a.call(b,d,g,h)))}T.prototype.s=function(b,a){var c=this.a,d=this.b;this.C=b;for(var e=c.length-258,f,g,k,h;256!==(f=rb(this,b));)if(256>f)d>=e&&(this.b=d,c=this.f(),d=this.b),c[d++]=f;else{g=f-257;h=eb[g];0<gb[g]&&(h+=U(this,gb[g]));f=rb(this,a);k=ib[f];0<kb[f]&&(k+=U(this,kb[f]));d>=e&&(this.b=d,c=this.f(),d=this.b);for(;h--;)c[d]=c[d++-k]}for(;8<=this.e;)this.e-=8,this.c--;this.b=d};
          -T.prototype.T=function(b,a){var c=this.a,d=this.b;this.C=b;for(var e=c.length,f,g,k,h;256!==(f=rb(this,b));)if(256>f)d>=e&&(c=this.f(),e=c.length),c[d++]=f;else{g=f-257;h=eb[g];0<gb[g]&&(h+=U(this,gb[g]));f=rb(this,a);k=ib[f];0<kb[f]&&(k+=U(this,kb[f]));d+h>e&&(c=this.f(),e=c.length);for(;h--;)c[d]=c[d++-k]}for(;8<=this.e;)this.e-=8,this.c--;this.b=d};
          -T.prototype.f=function(){var b=new (B?Uint8Array:Array)(this.b-32768),a=this.b-32768,c,d,e=this.a;if(B)b.set(e.subarray(32768,b.length));else{c=0;for(d=b.length;c<d;++c)b[c]=e[c+32768]}this.p.push(b);this.u+=b.length;if(B)e.set(e.subarray(a,a+32768));else for(c=0;32768>c;++c)e[c]=e[a+c];this.b=32768;return e};
          -T.prototype.U=function(b){var a,c=this.input.length/this.c+1|0,d,e,f,g=this.input,k=this.a;b&&("number"===typeof b.F&&(c=b.F),"number"===typeof b.P&&(c+=b.P));2>c?(d=(g.length-this.c)/this.C[2],f=258*(d/2)|0,e=f<k.length?k.length+f:k.length<<1):e=k.length*c;B?(a=new Uint8Array(e),a.set(k)):a=k;return this.a=a};
          -T.prototype.B=function(){var b=0,a=this.a,c=this.p,d,e=new (B?Uint8Array:Array)(this.u+(this.b-32768)),f,g,k,h;if(0===c.length)return B?this.a.subarray(32768,this.b):this.a.slice(32768,this.b);f=0;for(g=c.length;f<g;++f){d=c[f];k=0;for(h=d.length;k<h;++k)e[b++]=d[k]}f=32768;for(g=this.b;f<g;++f)e[b++]=a[f];this.p=[];return this.buffer=e};
          -T.prototype.R=function(){var b,a=this.b;B?this.M?(b=new Uint8Array(a),b.set(this.a.subarray(0,a))):b=this.a.subarray(0,a):(this.a.length>a&&(this.a.length=a),b=this.a);return this.buffer=b};function sb(b){this.input=b;this.c=0;this.t=[];this.D=!1}sb.prototype.X=function(){this.D||this.h();return this.t.slice()};
          -sb.prototype.h=function(){for(var b=this.input.length;this.c<b;){var a=new P,c=t,d=t,e=t,f=t,g=t,k=t,h=t,l=t,s=t,p=this.input,m=this.c;a.G=p[m++];a.H=p[m++];(31!==a.G||139!==a.H)&&q(Error("invalid file signature:"+a.G+","+a.H));a.z=p[m++];switch(a.z){case 8:break;default:q(Error("unknown compression method: "+a.z))}a.n=p[m++];l=p[m++]|p[m++]<<8|p[m++]<<16|p[m++]<<24;a.Z=new Date(1E3*l);a.fa=p[m++];a.ea=p[m++];0<(a.n&4)&&(a.aa=p[m++]|p[m++]<<8,m+=a.aa);if(0<(a.n&Ea)){h=[];for(k=0;0<(g=p[m++]);)h[k++]=
          -String.fromCharCode(g);a.name=h.join("")}if(0<(a.n&Fa)){h=[];for(k=0;0<(g=p[m++]);)h[k++]=String.fromCharCode(g);a.A=h.join("")}0<(a.n&Ga)&&(a.S=ja(p,0,m)&65535,a.S!==(p[m++]|p[m++]<<8)&&q(Error("invalid header crc16")));c=p[p.length-4]|p[p.length-3]<<8|p[p.length-2]<<16|p[p.length-1]<<24;p.length-m-4-4<512*c&&(f=c);d=new T(p,{index:m,bufferSize:f});a.data=e=d.h();m=d.c;a.ca=s=(p[m++]|p[m++]<<8|p[m++]<<16|p[m++]<<24)>>>0;ja(e,t,t)!==s&&q(Error("invalid CRC-32 checksum: 0x"+ja(e,t,t).toString(16)+
          -" / 0x"+s.toString(16)));a.da=c=(p[m++]|p[m++]<<8|p[m++]<<16|p[m++]<<24)>>>0;(e.length&4294967295)!==c&&q(Error("invalid input size: "+(e.length&4294967295)+" / "+c));this.t.push(a);this.c=m}this.D=u;var n=this.t,r,v,x=0,Q=0,y;r=0;for(v=n.length;r<v;++r)Q+=n[r].data.length;if(B){y=new Uint8Array(Q);for(r=0;r<v;++r)y.set(n[r].data,x),x+=n[r].data.length}else{y=[];for(r=0;r<v;++r)y[r]=n[r].data;y=Array.prototype.concat.apply([],y)}return y};A("Zlib.Gunzip",sb);A("Zlib.Gunzip.prototype.decompress",sb.prototype.h);A("Zlib.Gunzip.prototype.getMembers",sb.prototype.X);function tb(b){if("string"===typeof b){var a=b.split(""),c,d;c=0;for(d=a.length;c<d;c++)a[c]=(a[c].charCodeAt(0)&255)>>>0;b=a}for(var e=1,f=0,g=b.length,k,h=0;0<g;){k=1024<g?1024:g;g-=k;do e+=b[h++],f+=e;while(--k);e%=65521;f%=65521}return(f<<16|e)>>>0};function ub(b,a){var c,d;this.input=b;this.c=0;if(a||!(a={}))a.index&&(this.c=a.index),a.verify&&(this.$=a.verify);c=b[this.c++];d=b[this.c++];switch(c&15){case vb:this.method=vb;break;default:q(Error("unsupported compression method"))}0!==((c<<8)+d)%31&&q(Error("invalid fcheck flag:"+((c<<8)+d)%31));d&32&&q(Error("fdict flag is not supported"));this.L=new T(b,{index:this.c,bufferSize:a.bufferSize,bufferType:a.bufferType,resize:a.resize})}
          -ub.prototype.h=function(){var b=this.input,a,c;a=this.L.h();this.c=this.L.c;this.$&&(c=(b[this.c++]<<24|b[this.c++]<<16|b[this.c++]<<8|b[this.c++])>>>0,c!==tb(a)&&q(Error("invalid adler-32 checksum")));return a};var vb=8;function wb(b,a){this.input=b;this.a=new (B?Uint8Array:Array)(32768);this.k=W.o;var c={},d;if((a||!(a={}))&&"number"===typeof a.compressionType)this.k=a.compressionType;for(d in a)c[d]=a[d];c.outputBuffer=this.a;this.K=new na(this.input,c)}var W=ra;
          -wb.prototype.g=function(){var b,a,c,d,e,f,g,k=0;g=this.a;b=vb;switch(b){case vb:a=Math.LOG2E*Math.log(32768)-8;break;default:q(Error("invalid compression method"))}c=a<<4|b;g[k++]=c;switch(b){case vb:switch(this.k){case W.NONE:e=0;break;case W.v:e=1;break;case W.o:e=2;break;default:q(Error("unsupported compression type"))}break;default:q(Error("invalid compression method"))}d=e<<6|0;g[k++]=d|31-(256*c+d)%31;f=tb(this.input);this.K.b=k;g=this.K.g();k=g.length;B&&(g=new Uint8Array(g.buffer),g.length<=
          -k+4&&(this.a=new Uint8Array(g.length+4),this.a.set(g),g=this.a),g=g.subarray(0,k+4));g[k++]=f>>24&255;g[k++]=f>>16&255;g[k++]=f>>8&255;g[k++]=f&255;return g};function xb(b,a){var c,d,e,f;if(Object.keys)c=Object.keys(a);else for(d in c=[],e=0,a)c[e++]=d;e=0;for(f=c.length;e<f;++e)d=c[e],A(b+"."+d,a[d])};A("Zlib.Inflate",ub);A("Zlib.Inflate.prototype.decompress",ub.prototype.h);xb("Zlib.Inflate.BufferType",{ADAPTIVE:Ya.N,BLOCK:Ya.O});A("Zlib.Deflate",wb);A("Zlib.Deflate.compress",function(b,a){return(new wb(b,a)).g()});A("Zlib.Deflate.prototype.compress",wb.prototype.g);xb("Zlib.Deflate.CompressionType",{NONE:W.NONE,FIXED:W.v,DYNAMIC:W.o});}).call(this);
          \ No newline at end of file
          diff --git a/src/node/index.js b/src/node/index.js
          new file mode 100644
          index 0000000..16ec4b3
          --- /dev/null
          +++ b/src/node/index.js
          @@ -0,0 +1,25 @@
          +/**
          + * Node view for CyberChef.
          + *
          + * @author n1474335 [n1474335@gmail.com]
          + * @copyright Crown Copyright 2017
          + * @license Apache-2.0
          + */
          +require("babel-polyfill");
          +
          +var Chef = require("../core/Chef.js").default;
          +
          +const CyberChef = module.exports = {
          +
          +    bake: function(input, recipeConfig) {
          +        this.chef = new Chef();
          +        return this.chef.bake(
          +		input,
          +		recipeConfig,
          +		{},
          +		0,
          +		false
          +	);
          +    }
          +
          +};
          diff --git a/src/static/.htaccess b/src/static/.htaccess
          deleted file mode 100755
          index 8062672..0000000
          --- a/src/static/.htaccess
          +++ /dev/null
          @@ -1,50 +0,0 @@
          -# Serve up .htm files as binary files rather than text/html.
          -# This allows cyberchef.htm to be downloaded rather than opened in the browser.
          -AddType application/octet-stream .htm
          -
          -# Fix Apache bug #45023 where "-gzip" is appended to all ETags, preventing 304 responses
          -<IfModule mod_headers.c>
          -    RequestHeader edit "If-None-Match" "^\"(.*)-gzip\"$" "\"$1\""
          -    Header edit "ETag" "^\"(.*[^g][^z][^i][^p])\"$" "\"$1-gzip\""
          -</IfModule>
          -
          -# Set gzip compression on all resources that support it
          -<IfModule mod_deflate.c>
          -    SetOutputFilter DEFLATE
          -</IfModule>
          -
          -# Set Expires headers on various resources
          -<IfModule mod_expires.c>
          -    ExpiresActive On
          -    
          -    # 10 minutes
          -    ExpiresDefault "access plus 600 seconds"
          -    
          -    # 30 days
          -    ExpiresByType image/x-icon "access plus 2592000 seconds"
          -    ExpiresByType image/jpeg "access plus 2592000 seconds"
          -    ExpiresByType image/png "access plus 2592000 seconds"
          -    ExpiresByType image/gif "access plus 2592000 seconds"
          -    
          -    # 7 days
          -    ExpiresByType text/css "access plus 604800 seconds"
          -    ExpiresByType text/javascript "access plus 604800 seconds"
          -    ExpiresByType application/javascript "access plus 604800 seconds"
          -    ExpiresByType text/html "access plus 604800 seconds"
          -</IfModule>
          -
          -# Set Cache-Control headers on various resources
          -<IfModule mod_headers.c>
          -    <FilesMatch "\\.(ico|jpe?g|png|gif)$">
          -        Header set Cache-Control "max-age=2592000, public"
          -    </FilesMatch>
          -    <FilesMatch "\\.(css)$">
          -        Header set Cache-Control "max-age=600, public"
          -    </FilesMatch>
          -    <FilesMatch "\\.(js)$">
          -        Header set Cache-Control "max-age=600, private, must-revalidate"
          -    </FilesMatch>
          -    <FilesMatch "\\.(x?html?)$">
          -        Header set Cache-Control "max-age=600, private, must-revalidate"
          -    </FilesMatch>
          -</IfModule>
          diff --git a/src/static/images/breakpoint-16x16.png b/src/static/images/breakpoint-16x16.png
          deleted file mode 100755
          index 336df40..0000000
          Binary files a/src/static/images/breakpoint-16x16.png and /dev/null differ
          diff --git a/src/static/images/bug-16x16.png b/src/static/images/bug-16x16.png
          deleted file mode 100755
          index 8098d34..0000000
          Binary files a/src/static/images/bug-16x16.png and /dev/null differ
          diff --git a/src/static/images/clean-16x16.png b/src/static/images/clean-16x16.png
          deleted file mode 100755
          index b61e566..0000000
          Binary files a/src/static/images/clean-16x16.png and /dev/null differ
          diff --git a/src/static/images/code-16x16.png b/src/static/images/code-16x16.png
          deleted file mode 100755
          index a9b8870..0000000
          Binary files a/src/static/images/code-16x16.png and /dev/null differ
          diff --git a/src/static/images/cook_female-32x32.png b/src/static/images/cook_female-32x32.png
          deleted file mode 100755
          index 0b00aa3..0000000
          Binary files a/src/static/images/cook_female-32x32.png and /dev/null differ
          diff --git a/src/static/images/cook_male-32x32.png b/src/static/images/cook_male-32x32.png
          deleted file mode 100755
          index d881c9f..0000000
          Binary files a/src/static/images/cook_male-32x32.png and /dev/null differ
          diff --git a/src/static/images/cyberchef-128x128.png b/src/static/images/cyberchef-128x128.png
          deleted file mode 100755
          index 2b8c71a..0000000
          Binary files a/src/static/images/cyberchef-128x128.png and /dev/null differ
          diff --git a/src/static/images/cyberchef-16x16.png b/src/static/images/cyberchef-16x16.png
          deleted file mode 100755
          index b847c10..0000000
          Binary files a/src/static/images/cyberchef-16x16.png and /dev/null differ
          diff --git a/src/static/images/cyberchef-256x256.png b/src/static/images/cyberchef-256x256.png
          deleted file mode 100755
          index 61835a1..0000000
          Binary files a/src/static/images/cyberchef-256x256.png and /dev/null differ
          diff --git a/src/static/images/cyberchef-32x32.png b/src/static/images/cyberchef-32x32.png
          deleted file mode 100755
          index 640e475..0000000
          Binary files a/src/static/images/cyberchef-32x32.png and /dev/null differ
          diff --git a/src/static/images/cyberchef-512x512.png b/src/static/images/cyberchef-512x512.png
          deleted file mode 100755
          index f48cd49..0000000
          Binary files a/src/static/images/cyberchef-512x512.png and /dev/null differ
          diff --git a/src/static/images/cyberchef-64x64.png b/src/static/images/cyberchef-64x64.png
          deleted file mode 100755
          index 5e5a411..0000000
          Binary files a/src/static/images/cyberchef-64x64.png and /dev/null differ
          diff --git a/src/static/images/disable_deselected-16x16.png b/src/static/images/disable_deselected-16x16.png
          deleted file mode 100755
          index 0dcaf2b..0000000
          Binary files a/src/static/images/disable_deselected-16x16.png and /dev/null differ
          diff --git a/src/static/images/disable_selected-16x16.png b/src/static/images/disable_selected-16x16.png
          deleted file mode 100755
          index f47a0b9..0000000
          Binary files a/src/static/images/disable_selected-16x16.png and /dev/null differ
          diff --git a/src/static/images/download-24x24.png b/src/static/images/download-24x24.png
          deleted file mode 100755
          index 058e51b..0000000
          Binary files a/src/static/images/download-24x24.png and /dev/null differ
          diff --git a/src/static/images/erase-16x16.png b/src/static/images/erase-16x16.png
          deleted file mode 100755
          index bc6a3fa..0000000
          Binary files a/src/static/images/erase-16x16.png and /dev/null differ
          diff --git a/src/static/images/favicon.ico b/src/static/images/favicon.ico
          deleted file mode 100755
          index fa2deb0..0000000
          Binary files a/src/static/images/favicon.ico and /dev/null differ
          diff --git a/src/static/images/favourite-16x16.png b/src/static/images/favourite-16x16.png
          deleted file mode 100755
          index f6b9945..0000000
          Binary files a/src/static/images/favourite-16x16.png and /dev/null differ
          diff --git a/src/static/images/favourite-24x24.png b/src/static/images/favourite-24x24.png
          deleted file mode 100755
          index eb1b91b..0000000
          Binary files a/src/static/images/favourite-24x24.png and /dev/null differ
          diff --git a/src/static/images/fork_me.png b/src/static/images/fork_me.png
          deleted file mode 100644
          index 6e0c3a7..0000000
          Binary files a/src/static/images/fork_me.png and /dev/null differ
          diff --git a/src/static/images/help-16x16.png b/src/static/images/help-16x16.png
          deleted file mode 100755
          index 63a7069..0000000
          Binary files a/src/static/images/help-16x16.png and /dev/null differ
          diff --git a/src/static/images/help-22x22.png b/src/static/images/help-22x22.png
          deleted file mode 100755
          index ddea036..0000000
          Binary files a/src/static/images/help-22x22.png and /dev/null differ
          diff --git a/src/static/images/info-16x16.png b/src/static/images/info-16x16.png
          deleted file mode 100755
          index 05f1629..0000000
          Binary files a/src/static/images/info-16x16.png and /dev/null differ
          diff --git a/src/static/images/layout-16x16.png b/src/static/images/layout-16x16.png
          deleted file mode 100755
          index 3ae4db4..0000000
          Binary files a/src/static/images/layout-16x16.png and /dev/null differ
          diff --git a/src/static/images/mail-16x16.png b/src/static/images/mail-16x16.png
          deleted file mode 100755
          index 6afab8a..0000000
          Binary files a/src/static/images/mail-16x16.png and /dev/null differ
          diff --git a/src/static/images/maximise-16x16.png b/src/static/images/maximise-16x16.png
          deleted file mode 100755
          index be47e6e..0000000
          Binary files a/src/static/images/maximise-16x16.png and /dev/null differ
          diff --git a/src/static/images/open_yellow-16x16.png b/src/static/images/open_yellow-16x16.png
          deleted file mode 100755
          index c849a9e..0000000
          Binary files a/src/static/images/open_yellow-16x16.png and /dev/null differ
          diff --git a/src/static/images/open_yellow-24x24.png b/src/static/images/open_yellow-24x24.png
          deleted file mode 100755
          index 7ff5288..0000000
          Binary files a/src/static/images/open_yellow-24x24.png and /dev/null differ
          diff --git a/src/static/images/recycle-16x16.png b/src/static/images/recycle-16x16.png
          deleted file mode 100755
          index faff7bf..0000000
          Binary files a/src/static/images/recycle-16x16.png and /dev/null differ
          diff --git a/src/static/images/remove-16x16.png b/src/static/images/remove-16x16.png
          deleted file mode 100755
          index b0cbfb6..0000000
          Binary files a/src/static/images/remove-16x16.png and /dev/null differ
          diff --git a/src/static/images/restore-16x16.png b/src/static/images/restore-16x16.png
          deleted file mode 100755
          index 10ca13d..0000000
          Binary files a/src/static/images/restore-16x16.png and /dev/null differ
          diff --git a/src/static/images/save-16x16.png b/src/static/images/save-16x16.png
          deleted file mode 100755
          index c9df8df..0000000
          Binary files a/src/static/images/save-16x16.png and /dev/null differ
          diff --git a/src/static/images/save-22x22.png b/src/static/images/save-22x22.png
          deleted file mode 100755
          index 5118394..0000000
          Binary files a/src/static/images/save-22x22.png and /dev/null differ
          diff --git a/src/static/images/save_as-16x16.png b/src/static/images/save_as-16x16.png
          deleted file mode 100755
          index b5d4db8..0000000
          Binary files a/src/static/images/save_as-16x16.png and /dev/null differ
          diff --git a/src/static/images/settings-22x22.png b/src/static/images/settings-22x22.png
          deleted file mode 100755
          index 89c7bf6..0000000
          Binary files a/src/static/images/settings-22x22.png and /dev/null differ
          diff --git a/src/static/images/speech-16x16.png b/src/static/images/speech-16x16.png
          deleted file mode 100755
          index 5519c5d..0000000
          Binary files a/src/static/images/speech-16x16.png and /dev/null differ
          diff --git a/src/static/images/stats-16x16.png b/src/static/images/stats-16x16.png
          deleted file mode 100755
          index ebd41ef..0000000
          Binary files a/src/static/images/stats-16x16.png and /dev/null differ
          diff --git a/src/static/images/step-16x16.png b/src/static/images/step-16x16.png
          deleted file mode 100755
          index cea525a..0000000
          Binary files a/src/static/images/step-16x16.png and /dev/null differ
          diff --git a/src/static/images/switch-16x16.png b/src/static/images/switch-16x16.png
          deleted file mode 100755
          index 4af699e..0000000
          Binary files a/src/static/images/switch-16x16.png and /dev/null differ
          diff --git a/src/static/images/thumb_down-16x16.png b/src/static/images/thumb_down-16x16.png
          deleted file mode 100755
          index 69e6663..0000000
          Binary files a/src/static/images/thumb_down-16x16.png and /dev/null differ
          diff --git a/src/static/images/thumb_up-16x16.png b/src/static/images/thumb_up-16x16.png
          deleted file mode 100755
          index 0279ee2..0000000
          Binary files a/src/static/images/thumb_up-16x16.png and /dev/null differ
          diff --git a/src/static/images/undo-16x16.png b/src/static/images/undo-16x16.png
          deleted file mode 100755
          index a9ba0be..0000000
          Binary files a/src/static/images/undo-16x16.png and /dev/null differ
          diff --git a/src/static/stats.txt b/src/static/stats.txt
          deleted file mode 100644
          index 8aaf137..0000000
          --- a/src/static/stats.txt
          +++ /dev/null
          @@ -1,21 +0,0 @@
          -215	source files
          -117429	lines
          -4.4M	size
          -
          -145	JavaScript source files
          -108228	lines
          -3.8M	size
          -
          -84	third party JavaScript source files
          -87417	lines
          -3.1M	size
          -
          -61	first party JavaScript source files
          -20811	lines
          -776K	size
          -
          -3.5M	uncompressed JavaScript size
          -1.9M	compressed JavaScript size
          -
          -15	categories
          -177	operations
          diff --git a/src/js/views/html/HTMLApp.js b/src/web/App.js
          similarity index 92%
          rename from src/js/views/html/HTMLApp.js
          rename to src/web/App.js
          index 4e7aa78..59121bd 100755
          --- a/src/js/views/html/HTMLApp.js
          +++ b/src/web/App.js
          @@ -1,4 +1,10 @@
          -/* globals Split */
          +import Utils from "../core/Utils.js";
          +import Chef from "../core/Chef.js";
          +import Manager from "./Manager.js";
          +import HTMLCategory from "./HTMLCategory.js";
          +import HTMLOperation from "./HTMLOperation.js";
          +import Split from "split.js";
          +
           
           /**
            * HTML view for CyberChef responsible for building the web page and dealing with all user
          @@ -14,7 +20,7 @@
            * @param {String[]} defaultFavourites - A list of default favourite operations.
            * @param {Object} options - Default setting for app options.
            */
          -var HTMLApp = function(categories, operations, defaultFavourites, defaultOptions) {
          +var App = function(categories, operations, defaultFavourites, defaultOptions) {
               this.categories  = categories;
               this.operations  = operations;
               this.dfavourites = defaultFavourites;
          @@ -37,7 +43,7 @@ var HTMLApp = function(categories, operations, defaultFavourites, defaultOptions
            *
            * @fires Manager#appstart
            */
          -HTMLApp.prototype.setup = function() {
          +App.prototype.setup = function() {
               document.dispatchEvent(this.manager.appstart);
               this.initialiseSplitter();
               this.loadLocalStorage();
          @@ -54,7 +60,7 @@ HTMLApp.prototype.setup = function() {
            *
            * @param {Error} err
            */
          -HTMLApp.prototype.handleError = function(err) {
          +App.prototype.handleError = function(err) {
               console.error(err);
               var msg = err.displayStr || err.toString();
               this.alert(msg, "danger", this.options.errorTimeout, !this.options.showErrors);
          @@ -67,7 +73,7 @@ HTMLApp.prototype.handleError = function(err) {
            * @param {boolean} [step] - Set to true if we should only execute one operation instead of the
            *   whole recipe.
            */
          -HTMLApp.prototype.bake = function(step) {
          +App.prototype.bake = function(step) {
               var response;
           
               try {
          @@ -106,7 +112,7 @@ HTMLApp.prototype.bake = function(step) {
           /**
            * Runs Auto Bake if it is set.
            */
          -HTMLApp.prototype.autoBake = function() {
          +App.prototype.autoBake = function() {
               if (this.autoBake_) {
                   this.bake();
               }
          @@ -122,7 +128,7 @@ HTMLApp.prototype.autoBake = function() {
            *
            * @returns {number} - The number of miliseconds it took to run the silent bake.
            */
          -HTMLApp.prototype.silentBake = function() {
          +App.prototype.silentBake = function() {
               var startTime = new Date().getTime(),
                   recipeConfig = this.getRecipeConfig();
           
          @@ -139,7 +145,7 @@ HTMLApp.prototype.silentBake = function() {
            *
            * @returns {string}
            */
          -HTMLApp.prototype.getInput = function() {
          +App.prototype.getInput = function() {
               var input = this.manager.input.get();
           
               // Save to session storage in case we need to restore it later
          @@ -155,7 +161,7 @@ HTMLApp.prototype.getInput = function() {
            *
            * @param {string} input - The string to set the input to
            */
          -HTMLApp.prototype.setInput = function(input) {
          +App.prototype.setInput = function(input) {
               sessionStorage.setItem("inputLength", input.length);
               sessionStorage.setItem("input", input);
               this.manager.input.set(input);
          @@ -168,7 +174,7 @@ HTMLApp.prototype.setInput = function(input) {
            *
            * @fires Manager#oplistcreate
            */
          -HTMLApp.prototype.populateOperationsList = function() {
          +App.prototype.populateOperationsList = function() {
               // Move edit button away before we overwrite it
               document.body.appendChild(document.getElementById("edit-favourites"));
           
          @@ -204,7 +210,7 @@ HTMLApp.prototype.populateOperationsList = function() {
           /**
            * Sets up the adjustable splitter to allow the user to resize areas of the page.
            */
          -HTMLApp.prototype.initialiseSplitter = function() {
          +App.prototype.initialiseSplitter = function() {
               this.columnSplitter = Split(["#operations", "#recipe", "#IO"], {
                   sizes: [20, 30, 50],
                   minSize: [240, 325, 440],
          @@ -228,7 +234,7 @@ HTMLApp.prototype.initialiseSplitter = function() {
            * Loads the information previously saved to the HTML5 local storage object so that user options
            * and favourites can be restored.
            */
          -HTMLApp.prototype.loadLocalStorage = function() {
          +App.prototype.loadLocalStorage = function() {
               // Load options
               var lOptions;
               if (localStorage.options !== undefined) {
          @@ -246,7 +252,7 @@ HTMLApp.prototype.loadLocalStorage = function() {
            * Favourites category with them.
            * If the user currently has no saved favourites, the defaults from the view constructor are used.
            */
          -HTMLApp.prototype.loadFavourites = function() {
          +App.prototype.loadFavourites = function() {
               var favourites = localStorage.favourites &&
                   localStorage.favourites.length > 2 ?
                   JSON.parse(localStorage.favourites) :
          @@ -277,7 +283,7 @@ HTMLApp.prototype.loadFavourites = function() {
            * @param {string[]} favourites - A list of the user's favourite operations
            * @returns {string[]} A list of the valid favourites
            */
          -HTMLApp.prototype.validFavourites = function(favourites) {
          +App.prototype.validFavourites = function(favourites) {
               var validFavs = [];
               for (var i = 0; i < favourites.length; i++) {
                   if (this.operations.hasOwnProperty(favourites[i])) {
          @@ -296,7 +302,7 @@ HTMLApp.prototype.validFavourites = function(favourites) {
            *
            * @param {string[]} favourites - A list of the user's favourite operations
            */
          -HTMLApp.prototype.saveFavourites = function(favourites) {
          +App.prototype.saveFavourites = function(favourites) {
               localStorage.setItem("favourites", JSON.stringify(this.validFavourites(favourites)));
           };
           
          @@ -305,7 +311,7 @@ HTMLApp.prototype.saveFavourites = function(favourites) {
            * Resets favourite operations back to the default as specified in the view constructor and
            * refreshes the operation list.
            */
          -HTMLApp.prototype.resetFavourites = function() {
          +App.prototype.resetFavourites = function() {
               this.saveFavourites(this.dfavourites);
               this.loadFavourites();
               this.populateOperationsList();
          @@ -318,7 +324,7 @@ HTMLApp.prototype.resetFavourites = function() {
            *
            * @param {string} name - The name of the operation
            */
          -HTMLApp.prototype.addFavourite = function(name) {
          +App.prototype.addFavourite = function(name) {
               var favourites = JSON.parse(localStorage.favourites);
           
               if (favourites.indexOf(name) >= 0) {
          @@ -337,7 +343,7 @@ HTMLApp.prototype.addFavourite = function(name) {
           /**
            * Checks for input and recipe in the URI parameters and loads them if present.
            */
          -HTMLApp.prototype.loadURIParams = function() {
          +App.prototype.loadURIParams = function() {
               // Load query string from URI
               this.queryString = (function(a) {
                   if (a === "") return {};
          @@ -402,7 +408,7 @@ HTMLApp.prototype.loadURIParams = function() {
            *
            * @returns {number}
            */
          -HTMLApp.prototype.nextIngId = function() {
          +App.prototype.nextIngId = function() {
               return this.ingId++;
           };
           
          @@ -412,7 +418,7 @@ HTMLApp.prototype.nextIngId = function() {
            *
            * @returns {Object[]}
            */
          -HTMLApp.prototype.getRecipeConfig = function() {
          +App.prototype.getRecipeConfig = function() {
               var recipeConfig = this.manager.recipe.getConfig();
               sessionStorage.setItem("recipeConfig", JSON.stringify(recipeConfig));
               return recipeConfig;
          @@ -424,7 +430,7 @@ HTMLApp.prototype.getRecipeConfig = function() {
            *
            * @param {Object[]} recipeConfig - The recipe configuration
            */
          -HTMLApp.prototype.setRecipeConfig = function(recipeConfig) {
          +App.prototype.setRecipeConfig = function(recipeConfig) {
               sessionStorage.setItem("recipeConfig", JSON.stringify(recipeConfig));
               document.getElementById("rec-list").innerHTML = null;
           
          @@ -465,7 +471,7 @@ HTMLApp.prototype.setRecipeConfig = function(recipeConfig) {
           /**
            * Resets the splitter positions to default.
            */
          -HTMLApp.prototype.resetLayout = function() {
          +App.prototype.resetLayout = function() {
               this.columnSplitter.setSizes([20, 30, 50]);
               this.ioSplitter.setSizes([50, 50]);
           
          @@ -477,7 +483,7 @@ HTMLApp.prototype.resetLayout = function() {
           /**
            * Sets the compile message.
            */
          -HTMLApp.prototype.setCompileMessage = function() {
          +App.prototype.setCompileMessage = function() {
               // Display time since last build and compile message
               var now = new Date(),
                   timeSinceCompile = Utils.fuzzyTime(now.getTime() - window.compileTime),
          @@ -516,7 +522,7 @@ HTMLApp.prototype.setCompileMessage = function() {
            * // that will disappear after 5 seconds.
            * this.alert("Happy Christmas!", "info", 5000);
            */
          -HTMLApp.prototype.alert = function(str, style, timeout, silent) {
          +App.prototype.alert = function(str, style, timeout, silent) {
               var time = new Date();
           
               console.log("[" + time.toLocaleString() + "] " + str);
          @@ -570,7 +576,7 @@ HTMLApp.prototype.alert = function(str, style, timeout, silent) {
            * // Pops up a box asking if the user would like a cookie. Prints the answer to the console.
            * this.confirm("Question", "Would you like a cookie?", function(answer) {console.log(answer);});
            */
          -HTMLApp.prototype.confirm = function(title, body, callback, scope) {
          +App.prototype.confirm = function(title, body, callback, scope) {
               scope = scope || this;
               document.getElementById("confirm-title").innerHTML = title;
               document.getElementById("confirm-body").innerHTML = body;
          @@ -598,7 +604,7 @@ HTMLApp.prototype.confirm = function(title, body, callback, scope) {
            * Handler for the alert close button click event.
            * Closes the alert box.
            */
          -HTMLApp.prototype.alertCloseClick = function() {
          +App.prototype.alertCloseClick = function() {
               document.getElementById("alert").style.display = "none";
           };
           
          @@ -610,7 +616,7 @@ HTMLApp.prototype.alertCloseClick = function() {
            * @listens Manager#statechange
            * @param {event} e
            */
          -HTMLApp.prototype.stateChange = function(e) {
          +App.prototype.stateChange = function(e) {
               this.autoBake();
           
               // Update the current history state (not creating a new one)
          @@ -627,7 +633,7 @@ HTMLApp.prototype.stateChange = function(e) {
            *
            * @param {event} e
            */
          -HTMLApp.prototype.popState = function(e) {
          +App.prototype.popState = function(e) {
               if (window.location.href.split("#")[0] !== this.lastStateUrl) {
                   this.loadURIParams();
               }
          @@ -637,7 +643,7 @@ HTMLApp.prototype.popState = function(e) {
           /**
            * Function to call an external API from this view.
            */
          -HTMLApp.prototype.callApi = function(url, type, data, dataType, contentType) {
          +App.prototype.callApi = function(url, type, data, dataType, contentType) {
               type = type || "POST";
               data = data || {};
               dataType = dataType || undefined;
          @@ -668,3 +674,5 @@ HTMLApp.prototype.callApi = function(url, type, data, dataType, contentType) {
                   response: response
               };
           };
          +
          +export default App;
          diff --git a/src/js/views/html/ControlsWaiter.js b/src/web/ControlsWaiter.js
          similarity index 95%
          rename from src/js/views/html/ControlsWaiter.js
          rename to src/web/ControlsWaiter.js
          index a53a6e4..9896ed9 100755
          --- a/src/js/views/html/ControlsWaiter.js
          +++ b/src/web/ControlsWaiter.js
          @@ -1,4 +1,5 @@
          -/* globals moment */
          +import Utils from "../core/Utils.js";
          +
           
           /**
            * Waiter to handle events related to the CyberChef controls (i.e. Bake, Step, Save, Load etc.)
          @@ -8,7 +9,7 @@
            * @license Apache-2.0
            *
            * @constructor
          - * @param {HTMLApp} app - The main view object for CyberChef.
          + * @param {App} app - The main view object for CyberChef.
            * @param {Manager} manager - The CyberChef event manager.
            */
           var ControlsWaiter = function(app, manager) {
          @@ -78,7 +79,9 @@ ControlsWaiter.prototype.setAutoBake = function(value) {
            */
           ControlsWaiter.prototype.bakeClick = function() {
               this.app.bake();
          -    $("#output-text").selectRange(0);
          +    var outputText = document.getElementById("output-text");
          +    outputText.focus();
          +    outputText.setSelectionRange(0, 0);
           };
           
           
          @@ -87,7 +90,9 @@ ControlsWaiter.prototype.bakeClick = function() {
            */
           ControlsWaiter.prototype.stepClick = function() {
               this.app.bake(true);
          -    $("#output-text").selectRange(0);
          +    var outputText = document.getElementById("output-text");
          +    outputText.focus();
          +    outputText.setSelectionRange(0, 0);
           };
           
           
          @@ -349,7 +354,9 @@ ControlsWaiter.prototype.supportButtonClick = function() {
               var reportBugInfo = document.getElementById("report-bug-info"),
                   saveLink = this.generateStateUrl(true, true, null, "https://gchq.github.io/CyberChef/");
           
          -    reportBugInfo.innerHTML = "* CyberChef compile time: <%= compileTime %>\n" +
          +    reportBugInfo.innerHTML = "* CyberChef compile time: " + COMPILE_TIME + "\n" +
                   "* User-Agent: \n" + navigator.userAgent + "\n" +
                   "* [Link to reproduce](" + saveLink + ")\n\n";
           };
          +
          +export default ControlsWaiter;
          diff --git a/src/js/views/html/HTMLCategory.js b/src/web/HTMLCategory.js
          similarity index 97%
          rename from src/js/views/html/HTMLCategory.js
          rename to src/web/HTMLCategory.js
          index fff68c3..d1120c2 100755
          --- a/src/js/views/html/HTMLCategory.js
          +++ b/src/web/HTMLCategory.js
          @@ -48,3 +48,5 @@ HTMLCategory.prototype.toHtml = function() {
               html += "</ul></div></div>";
               return html;
           };
          +
          +export default HTMLCategory;
          diff --git a/src/js/views/html/HTMLIngredient.js b/src/web/HTMLIngredient.js
          similarity index 98%
          rename from src/js/views/html/HTMLIngredient.js
          rename to src/web/HTMLIngredient.js
          index 641da53..05e98b9 100755
          --- a/src/js/views/html/HTMLIngredient.js
          +++ b/src/web/HTMLIngredient.js
          @@ -7,7 +7,7 @@
            *
            * @constructor
            * @param {Object} config - The configuration object for this ingredient.
          - * @param {HTMLApp} app - The main view object for CyberChef.
          + * @param {App} app - The main view object for CyberChef.
            * @param {Manager} manager - The CyberChef event manager.
            */
           var HTMLIngredient = function(config, app, manager) {
          @@ -210,3 +210,5 @@ HTMLIngredient.prototype.editableOptionChange = function(e) {
           
               this.manager.recipe.ingChange();
           };
          +
          +export default HTMLIngredient;
          diff --git a/src/js/views/html/HTMLOperation.js b/src/web/HTMLOperation.js
          similarity index 97%
          rename from src/js/views/html/HTMLOperation.js
          rename to src/web/HTMLOperation.js
          index d58d81e..dd9a8ee 100755
          --- a/src/js/views/html/HTMLOperation.js
          +++ b/src/web/HTMLOperation.js
          @@ -1,3 +1,6 @@
          +import HTMLIngredient from "./HTMLIngredient.js";
          +
          +
           /**
            * Object to handle the creation of operations.
            *
          @@ -8,7 +11,7 @@
            * @constructor
            * @param {string} name - The name of the operation.
            * @param {Object} config - The configuration object for this operation.
          - * @param {HTMLApp} app - The main view object for CyberChef.
          + * @param {App} app - The main view object for CyberChef.
            * @param {Manager} manager - The CyberChef event manager.
            */
           var HTMLOperation = function(name, config, app, manager) {
          @@ -112,3 +115,5 @@ HTMLOperation.prototype.highlightSearchString = function(searchStr, namePos, des
                       this.description.slice(descPos + searchStr.length);
               }
           };
          +
          +export default HTMLOperation;
          diff --git a/src/js/views/html/HighlighterWaiter.js b/src/web/HighlighterWaiter.js
          similarity index 99%
          rename from src/js/views/html/HighlighterWaiter.js
          rename to src/web/HighlighterWaiter.js
          index 506b817..56e4ae8 100755
          --- a/src/js/views/html/HighlighterWaiter.js
          +++ b/src/web/HighlighterWaiter.js
          @@ -1,3 +1,6 @@
          +import Utils from "../core/Utils.js";
          +
          +
           /**
            * Waiter to handle events related to highlighting in CyberChef.
            *
          @@ -6,7 +9,7 @@
            * @license Apache-2.0
            *
            * @constructor
          - * @param {HTMLApp} app - The main view object for CyberChef.
          + * @param {App} app - The main view object for CyberChef.
            */
           var HighlighterWaiter = function(app) {
               this.app = app;
          @@ -504,3 +507,5 @@ HighlighterWaiter.prototype.highlight = function(textarea, highlighter, pos) {
               highlighter.scrollTop = textarea.scrollTop;
               highlighter.scrollLeft = textarea.scrollLeft;
           };
          +
          +export default HighlighterWaiter;
          diff --git a/src/js/views/html/InputWaiter.js b/src/web/InputWaiter.js
          similarity index 97%
          rename from src/js/views/html/InputWaiter.js
          rename to src/web/InputWaiter.js
          index e28669a..158d2b7 100755
          --- a/src/js/views/html/InputWaiter.js
          +++ b/src/web/InputWaiter.js
          @@ -1,3 +1,6 @@
          +import Utils from "../core/Utils.js";
          +
          +
           /**
            * Waiter to handle events related to the input.
            *
          @@ -6,7 +9,7 @@
            * @license Apache-2.0
            *
            * @constructor
          - * @param {HTMLApp} app - The main view object for CyberChef.
          + * @param {App} app - The main view object for CyberChef.
            * @param {Manager} manager - The CyberChef event manager.
            */
           var InputWaiter = function(app, manager) {
          @@ -215,3 +218,5 @@ InputWaiter.prototype.clearIoClick = function() {
               document.getElementById("output-selection-info").innerHTML = "";
               window.dispatchEvent(this.manager.statechange);
           };
          +
          +export default InputWaiter;
          diff --git a/src/js/views/html/Manager.js b/src/web/Manager.js
          similarity index 96%
          rename from src/js/views/html/Manager.js
          rename to src/web/Manager.js
          index 8bcb2d0..28b9f93 100755
          --- a/src/js/views/html/Manager.js
          +++ b/src/web/Manager.js
          @@ -1,3 +1,14 @@
          +import WindowWaiter from "./WindowWaiter.js";
          +import ControlsWaiter from "./ControlsWaiter.js";
          +import RecipeWaiter from "./RecipeWaiter.js";
          +import OperationsWaiter from "./OperationsWaiter.js";
          +import InputWaiter from "./InputWaiter.js";
          +import OutputWaiter from "./OutputWaiter.js";
          +import OptionsWaiter from "./OptionsWaiter.js";
          +import HighlighterWaiter from "./HighlighterWaiter.js";
          +import SeasonalWaiter from "./SeasonalWaiter.js";
          +
          +
           /**
            * This object controls the Waiters responsible for handling events from all areas of the app.
            *
          @@ -6,7 +17,7 @@
            * @license Apache-2.0
            *
            * @constructor
          - * @param {HTMLApp} app - The main view object for CyberChef.
          + * @param {App} app - The main view object for CyberChef.
            */
           var Manager = function(app) {
               this.app = app;
          @@ -263,3 +274,5 @@ Manager.prototype.dynamicListenerHandler = function(e) {
                   }
               }
           };
          +
          +export default Manager;
          diff --git a/src/js/views/html/OperationsWaiter.js b/src/web/OperationsWaiter.js
          similarity index 97%
          rename from src/js/views/html/OperationsWaiter.js
          rename to src/web/OperationsWaiter.js
          index ad788c0..997c4ff 100755
          --- a/src/js/views/html/OperationsWaiter.js
          +++ b/src/web/OperationsWaiter.js
          @@ -1,4 +1,6 @@
          -/* globals Sortable */
          +import HTMLOperation from "./HTMLOperation.js";
          +import Sortable from "sortablejs";
          +
           
           /**
            * Waiter to handle events related to the operations.
          @@ -8,7 +10,7 @@
            * @license Apache-2.0
            *
            * @constructor
          - * @param {HTMLApp} app - The main view object for CyberChef.
          + * @param {App} app - The main view object for CyberChef.
            * @param {Manager} manager - The CyberChef event manager.
            */
           var OperationsWaiter = function(app, manager) {
          @@ -281,3 +283,5 @@ OperationsWaiter.prototype.opIconMouseleave = function(e) {
                   $(opEl).popover("show");
               }
           };
          +
          +export default OperationsWaiter;
          diff --git a/src/js/views/html/OptionsWaiter.js b/src/web/OptionsWaiter.js
          similarity index 97%
          rename from src/js/views/html/OptionsWaiter.js
          rename to src/web/OptionsWaiter.js
          index e04a09c..d7c89eb 100755
          --- a/src/js/views/html/OptionsWaiter.js
          +++ b/src/web/OptionsWaiter.js
          @@ -6,7 +6,7 @@
            * @license Apache-2.0
            *
            * @constructor
          - * @param {HTMLApp} app - The main view object for CyberChef.
          + * @param {App} app - The main view object for CyberChef.
            */
           var OptionsWaiter = function(app) {
               this.app = app;
          @@ -130,3 +130,5 @@ OptionsWaiter.prototype.setWordWrap = function() {
                   document.getElementById("output-highlighter").classList.add("word-wrap");
               }
           };
          +
          +export default OptionsWaiter;
          diff --git a/src/js/views/html/OutputWaiter.js b/src/web/OutputWaiter.js
          similarity index 98%
          rename from src/js/views/html/OutputWaiter.js
          rename to src/web/OutputWaiter.js
          index d651047..90f297d 100755
          --- a/src/js/views/html/OutputWaiter.js
          +++ b/src/web/OutputWaiter.js
          @@ -1,3 +1,6 @@
          +import Utils from "../core/Utils.js";
          +
          +
           /**
            * Waiter to handle events related to the output.
            *
          @@ -6,7 +9,7 @@
            * @license Apache-2.0
            *
            * @constructor
          - * @param {HTMLApp} app - The main view object for CyberChef.
          + * @param {App} app - The main view object for CyberChef.
            * @param {Manager} manager - The CyberChef event manager.
            */
           var OutputWaiter = function(app, manager) {
          @@ -186,3 +189,5 @@ OutputWaiter.prototype.maximiseOutputClick = function(e) {
                   this.app.resetLayout();
               }
           };
          +
          +export default OutputWaiter;
          diff --git a/src/js/views/html/RecipeWaiter.js b/src/web/RecipeWaiter.js
          similarity index 98%
          rename from src/js/views/html/RecipeWaiter.js
          rename to src/web/RecipeWaiter.js
          index 5d57dd0..2829ccd 100755
          --- a/src/js/views/html/RecipeWaiter.js
          +++ b/src/web/RecipeWaiter.js
          @@ -1,4 +1,6 @@
          -/* globals Sortable */
          +import HTMLOperation from "./HTMLOperation.js";
          +import Sortable from "sortablejs";
          +
           
           /**
            * Waiter to handle events related to the recipe.
          @@ -8,7 +10,7 @@
            * @license Apache-2.0
            *
            * @constructor
          - * @param {HTMLApp} app - The main view object for CyberChef.
          + * @param {App} app - The main view object for CyberChef.
            * @param {Manager} manager - The CyberChef event manager.
            */
           var RecipeWaiter = function(app, manager) {
          @@ -31,7 +33,8 @@ RecipeWaiter.prototype.initialiseOperationDragNDrop = function() {
                   sort: true,
                   animation: 0,
                   delay: 0,
          -        filter: ".arg-input,.arg", // Relies on commenting out a line in Sortable.js which calls evt.preventDefault()
          +        filter: ".arg-input,.arg",
          +        preventOnFilter: false,
                   setData: function(dataTransfer, dragEl) {
                       dataTransfer.setData("Text", dragEl.querySelector(".arg-title").textContent);
                   },
          @@ -421,3 +424,5 @@ RecipeWaiter.prototype.opAdd = function(e) {
           RecipeWaiter.prototype.opRemove = function(e) {
               window.dispatchEvent(this.manager.statechange);
           };
          +
          +export default RecipeWaiter;
          diff --git a/src/js/views/html/SeasonalWaiter.js b/src/web/SeasonalWaiter.js
          similarity index 76%
          rename from src/js/views/html/SeasonalWaiter.js
          rename to src/web/SeasonalWaiter.js
          index d8685d0..ad897b6 100755
          --- a/src/js/views/html/SeasonalWaiter.js
          +++ b/src/web/SeasonalWaiter.js
          @@ -6,7 +6,7 @@
            * @license Apache-2.0
            *
            * @constructor
          - * @param {HTMLApp} app - The main view object for CyberChef.
          + * @param {App} app - The main view object for CyberChef.
            * @param {Manager} manager - The CyberChef event manager.
            */
           var SeasonalWaiter = function(app, manager) {
          @@ -19,17 +19,7 @@ var SeasonalWaiter = function(app, manager) {
            * Loads all relevant items depending on the current date.
            */
           SeasonalWaiter.prototype.load = function() {
          -    var now = new Date();
          -
          -    // Snowfall
          -    if (now.getMonth() === 11 && now.getDate() > 12) { // Dec 13 -> Dec 31
          -        this.app.options.snow = false;
          -        this.createSnowOption();
          -        $(document).on("switchChange.bootstrapSwitch", ".option-item input:checkbox[option='snow']", this.letItSnow.bind(this));
          -        window.addEventListener("resize", this.letItSnow.bind(this));
          -        this.manager.addListeners(".btn", "click", this.shakeOffSnow, this);
          -        if (now.getDate() === 25) this.letItSnow();
          -    }
          +    //var now = new Date();
           
               // SpiderChef
               // if (now.getMonth() === 3 && now.getDate() === 1) { // Apr 1
          @@ -92,99 +82,6 @@ SeasonalWaiter.prototype.insertSpiderText = function() {
           };
           
           
          -/**
          - * Adds an option to make it snow.
          - * #letitsnow
          - */
          -SeasonalWaiter.prototype.createSnowOption = function() {
          -    var optionsBody = document.getElementById("options-body"),
          -        optionItem = document.createElement("div");
          -
          -    optionItem.className = "option-item";
          -    optionItem.innerHTML =
          -        "<input type='checkbox' option='snow' checked />\
          -        Let it snow";
          -    optionsBody.appendChild(optionItem);
          -
          -    this.manager.options.load();
          -};
          -
          -
          -/**
          - * Initialises a snowstorm.
          - * #letitsnow
          - */
          -SeasonalWaiter.prototype.letItSnow = function() {
          -    $(document).snowfall("clear");
          -    if (!this.app.options.snow) return;
          -
          -    var options = {},
          -        firefoxVersion = navigator.userAgent.match(/Firefox\/(\d\d?)/);
          -
          -    if (firefoxVersion && parseInt(firefoxVersion[1], 10) < 30) {
          -        // Firefox < 30
          -        options = {
          -            flakeCount: 10,
          -            flakeColor: "#fff",
          -            flakePosition: "absolute",
          -            minSize: 1,
          -            maxSize: 2,
          -            minSpeed: 1,
          -            maxSpeed: 5,
          -            round: false,
          -            shadow: false,
          -            collection: false,
          -            collectionHeight: 20,
          -            deviceorientation: true
          -        };
          -    } else {
          -        // All other browsers
          -        options = {
          -            flakeCount: 35,
          -            flakeColor: "#fff",
          -            flakePosition: "absolute",
          -            minSize: 5,
          -            maxSize: 8,
          -            minSpeed: 1,
          -            maxSpeed: 5,
          -            round: true,
          -            shadow: true,
          -            collection: ".btn",
          -            collectionHeight: 20,
          -            deviceorientation: true
          -        };
          -    }
          -
          -    $(document).snowfall(options);
          -};
          -
          -
          -/**
          - * When a button is clicked, shake the snow off that button.
          - * #letitsnow
          - */
          -SeasonalWaiter.prototype.shakeOffSnow = function(e) {
          -    var el = e.target,
          -        rect = el.getBoundingClientRect(),
          -        canvases = document.querySelectorAll("canvas.snowfall-canvas"),
          -        canvas = null,
          -        removeFunc = function() {
          -            ctx.clearRect(0, 0, canvas.width, canvas.height);
          -            $(this).fadeIn();
          -        };
          -
          -    for (var i = 0; i < canvases.length; i++) {
          -        canvas = canvases[i];
          -        if (canvas.style.left === rect.left + "px" && canvas.style.top === (rect.top - 20) + "px") {
          -            var ctx = canvas.getContext("2d");
          -
          -            $(canvas).fadeOut("slow", removeFunc);
          -            break;
          -        }
          -    }
          -};
          -
          -
           /**
            * Listen for the Konami code sequence of keys. Turn the page upside down if they are all heard in
            * sequence.
          @@ -253,3 +150,5 @@ SeasonalWaiter.treeWalk = (function() {
                   }
               };
           })();
          +
          +export default SeasonalWaiter;
          diff --git a/src/js/views/html/WindowWaiter.js b/src/web/WindowWaiter.js
          similarity index 94%
          rename from src/js/views/html/WindowWaiter.js
          rename to src/web/WindowWaiter.js
          index 6c3b427..d85ee6b 100755
          --- a/src/js/views/html/WindowWaiter.js
          +++ b/src/web/WindowWaiter.js
          @@ -6,7 +6,7 @@
            * @license Apache-2.0
            *
            * @constructor
          - * @param {HTMLApp} app - The main view object for CyberChef.
          + * @param {App} app - The main view object for CyberChef.
            */
           var WindowWaiter = function(app) {
               this.app = app;
          @@ -50,3 +50,5 @@ WindowWaiter.prototype.windowFocus = function() {
                   this.app.silentBake();
               }
           };
          +
          +export default WindowWaiter;
          diff --git a/src/web/css/index.js b/src/web/css/index.js
          new file mode 100644
          index 0000000..6c76009
          --- /dev/null
          +++ b/src/web/css/index.js
          @@ -0,0 +1,18 @@
          +/**
          + * CSS index
          + *
          + * @author n1474335 [n1474335@gmail.com]
          + * @copyright Crown Copyright 2017
          + * @license Apache-2.0
          + */
          +
          +import "google-code-prettify/src/prettify.css";
          +
          +import "./lib/bootstrap.less";
          +import "bootstrap-switch/src/less/bootstrap3/build.less";
          +import "bootstrap-colorpicker/dist/css/bootstrap-colorpicker.css";
          +
          +import "./structure/overrides.css";
          +import "./structure/layout.css";
          +import "./structure/utils.css";
          +import "./themes/classic.css";
          diff --git a/src/web/css/lib/bootstrap.less b/src/web/css/lib/bootstrap.less
          new file mode 100644
          index 0000000..1263709
          --- /dev/null
          +++ b/src/web/css/lib/bootstrap.less
          @@ -0,0 +1,58 @@
          +/**
          + * Bootstrap imports
          + *
          + * @author n1474335 [n1474335@gmail.com]
          + * @copyright Crown Copyright 2017
          + * @license Apache-2.0
          + */
          +
          +// Core variables and mixins
          +@import "~bootstrap/less/variables.less";
          +@import "~bootstrap/less/mixins.less";
          +
          +// Reset and dependencies
          +@import "~bootstrap/less/normalize.less";
          +@import "~bootstrap/less/print.less";
          +// @import "~bootstrap/less/glyphicons.less";
          +
          +// Core CSS
          +@import "~bootstrap/less/scaffolding.less";
          +@import "~bootstrap/less/type.less";
          +@import "~bootstrap/less/code.less";
          +// @import "~bootstrap/less/grid.less";
          +@import "~bootstrap/less/tables.less";
          +@import "~bootstrap/less/forms.less";
          +@import "~bootstrap/less/buttons.less";
          +
          +// Components
          +@import "~bootstrap/less/component-animations.less";
          +@import "~bootstrap/less/dropdowns.less";
          +@import "~bootstrap/less/button-groups.less";
          +@import "~bootstrap/less/input-groups.less";
          +@import "~bootstrap/less/navs.less";
          +// @import "~bootstrap/less/navbar.less";
          +// @import "~bootstrap/less/breadcrumbs.less";
          +// @import "~bootstrap/less/pagination.less";
          +// @import "~bootstrap/less/pager.less";
          +@import "~bootstrap/less/labels.less";
          +// @import "~bootstrap/less/badges.less";
          +// @import "~bootstrap/less/jumbotron.less";
          +// @import "~bootstrap/less/thumbnails.less";
          +@import "~bootstrap/less/alerts.less";
          +@import "~bootstrap/less/progress-bars.less";
          +// @import "~bootstrap/less/media.less";
          +@import "~bootstrap/less/list-group.less";
          +@import "~bootstrap/less/panels.less";
          +// @import "~bootstrap/less/responsive-embed.less";
          +// @import "~bootstrap/less/wells.less";
          +@import "~bootstrap/less/close.less";
          +
          +// Components w/ JavaScript
          +@import "~bootstrap/less/modals.less";
          +@import "~bootstrap/less/tooltip.less";
          +@import "~bootstrap/less/popovers.less";
          +// @import "~bootstrap/less/carousel.less";
          +
          +// Utility classes
          +@import "~bootstrap/less/utilities.less";
          +// @import "~bootstrap/less/responsive-utilities.less";
          \ No newline at end of file
          diff --git a/src/css/structure/layout.css b/src/web/css/structure/layout.css
          similarity index 100%
          rename from src/css/structure/layout.css
          rename to src/web/css/structure/layout.css
          diff --git a/src/css/structure/overrides.css b/src/web/css/structure/overrides.css
          similarity index 100%
          rename from src/css/structure/overrides.css
          rename to src/web/css/structure/overrides.css
          diff --git a/src/css/structure/utils.css b/src/web/css/structure/utils.css
          similarity index 100%
          rename from src/css/structure/utils.css
          rename to src/web/css/structure/utils.css
          diff --git a/src/css/themes/classic.css b/src/web/css/themes/classic.css
          similarity index 100%
          rename from src/css/themes/classic.css
          rename to src/web/css/themes/classic.css
          diff --git a/src/html/index.html b/src/web/html/index.html
          similarity index 83%
          rename from src/html/index.html
          rename to src/web/html/index.html
          index 3576e8a..edf2a2d 100755
          --- a/src/html/index.html
          +++ b/src/web/html/index.html
          @@ -29,18 +29,21 @@
                   <meta name="description" content="The Cyber Swiss Army Knife" />
                   <meta name="keywords" content="base64, hex, decode, encode, encrypt, decrypt, compress, decompress, regex, regular expressions, hash, crypt, hexadecimal, user agent, url, certificate, x.509, parser, JSON, gzip,  md5, sha1, aes, des, blowfish, xor" />
           
          -        <link rel="icon" type="image/png" href="images/favicon.ico?__inline" />
          -        <link href="styles.css" rel="stylesheet" />
          +        <link rel="icon" type="image/ico" href="<%- require('../static/images/favicon.ico') %>" />
               </head>
               <body>
          -        <span id="edit-favourites" class="btn btn-default btn-sm"><img src="images/favourite-16x16.png" /> Edit</span>
          +        <span id="edit-favourites" class="btn btn-default btn-sm"><img src="<%- require('../static/images/favourite-16x16.png') %>" /> Edit</span>
                   <div id="alert" class="alert alert-danger">
                       <button type="button" class="close" id="alert-close">&times;</button>
                       <span id="alert-content"></span>
                   </div>
                   <div id="content-wrapper">
                       <div id="banner" class="green">
          -                <a href="cyberchef.htm" style="float: left; margin-left: 10px; margin-right: 80px;" download>Download CyberChef<img src="images/download-24x24.png" /></a>
          +                <% if (htmlWebpackPlugin.options.inline) { %>
          +                    <span style="float: left; margin-left: 10px;">Compile time: <%= htmlWebpackPlugin.options.compileTime %></span>
          +                <% } else { %>
          +                    <a href="cyberchef.htm" style="float: left; margin-left: 10px; margin-right: 80px;" download>Download CyberChef<img src="<%- require('../static/images/download-24x24.png') %>" /></a>
          +                <% } %>
                           <span id="notice">
                               <script type="text/javascript">
                                   // Must be text/javascript rather than application/javascript otherwise IE won't recognise it...
          @@ -51,8 +54,8 @@
                               </script>
                               <noscript>JavaScript is not enabled. Good luck.</noscript>
                           </span>
          -                <a href="#" id="support" class="banner-right" data-toggle="modal" data-target="#support-modal">About / Support<img src="images/help-22x22.png" /></a>
          -                <a href="#" id="options" class="banner-right">Options<img src="images/settings-22x22.png" /></a>
          +                <a href="#" id="support" class="banner-right" data-toggle="modal" data-target="#support-modal">About / Support<img src="<%- require('../static/images/help-22x22.png') %>" /></a>
          +                <a href="#" id="options" class="banner-right">Options<img src="<%- require('../static/images/settings-22x22.png') %>" /></a>
                       </div>
                       <div id="wrapper">
                           <div id="operations" class="split split-horizontal no-select">
          @@ -70,7 +73,7 @@
                                   <div id="operational-controls">
                                       <div id="bake-group">
                                           <button type="button" class="btn btn-success btn-lg" id="bake">
          -                                    <img src="images/cook_male-32x32.png" />
          +                                    <img src="<%- require('../static/images/cook_male-32x32.png') %>" />
                                               Bake!
                                           </button>
                                           <label class="btn btn-success btn-lg" id="auto-bake-label">
          @@ -80,15 +83,15 @@
                                       </div>
                                       
                                       <div class="btn-group" style="padding-top: 10px;">
          -                                <button type="button" class="btn btn-default" id="step"><img src="images/step-16x16.png" /> Step through</button>
          -                                <button type="button" class="btn btn-default" id="clr-breaks"><img src="images/erase-16x16.png" /> Clear breakpoints</button>
          +                                <button type="button" class="btn btn-default" id="step"><img src="<%- require('../static/images/step-16x16.png') %>" /> Step through</button>
          +                                <button type="button" class="btn btn-default" id="clr-breaks"><img src="<%- require('../static/images/erase-16x16.png') %>" /> Clear breakpoints</button>
                                       </div>
                                   </div>
                                   
                                   <div class="btn-group-vertical" id="extra-controls">
          -                            <button type="button" class="btn btn-default" id="save"><img src="images/save-16x16.png" /> Save recipe</button>
          -                            <button type="button" class="btn btn-default" id="load"><img src="images/open_yellow-16x16.png" /> Load recipe</button>
          -                            <button type="button" class="btn btn-default" id="clr-recipe"><img src="images/clean-16x16.png" /> Clear recipe</button>
          +                            <button type="button" class="btn btn-default" id="save"><img src="<%- require('../static/images/save-16x16.png') %>" /> Save recipe</button>
          +                            <button type="button" class="btn btn-default" id="load"><img src="<%- require('../static/images/open_yellow-16x16.png') %>" /> Load recipe</button>
          +                            <button type="button" class="btn btn-default" id="clr-recipe"><img src="<%- require('../static/images/clean-16x16.png') %>" /> Clear recipe</button>
                                   </div>
                               </div>
                           </div>
          @@ -98,8 +101,8 @@
                                   <div class="title no-select">
                                       Input
                                       <div class="btn-group io-btn-group">
          -                                <button type="button" class="btn btn-default btn-sm" id="clr-io"><img src="images/recycle-16x16.png" /> Clear I/O</button>
          -                                <button type="button" class="btn btn-default btn-sm" id="reset-layout"><img src="images/layout-16x16.png" /> Reset layout</button>
          +                                <button type="button" class="btn btn-default btn-sm" id="clr-io"><img src="<%- require('../static/images/recycle-16x16.png') %>" /> Clear I/O</button>
          +                                <button type="button" class="btn btn-default btn-sm" id="reset-layout"><img src="<%- require('../static/images/layout-16x16.png') %>" /> Reset layout</button>
                                       </div>
                                       <div class="io-info" id="input-info"></div>
                                       <div class="io-info" id="input-selection-info"></div>
          @@ -114,10 +117,10 @@
                                   <div class="title no-select">
                                       Output
                                       <div class="btn-group io-btn-group">
          -                                <button type="button" class="btn btn-default btn-sm" id="save-to-file" title="Save to file"><img src="images/save_as-16x16.png" /> Save to file</button>
          -                                <button type="button" class="btn btn-default btn-sm" id="switch" title="Move output to input"><img src="images/switch-16x16.png" /> Move output to input</button>
          -                                <button type="button" class="btn btn-default btn-sm" id="undo-switch" title="Undo move" disabled="disabled"><img src="images/undo-16x16.png" /> Undo</button>
          -                                <button type="button" class="btn btn-default btn-sm" id="maximise-output" title="Maximise"><img src="images/maximise-16x16.png" /> Max</button>
          +                                <button type="button" class="btn btn-default btn-sm" id="save-to-file" title="Save to file"><img src="<%- require('../static/images/save_as-16x16.png') %>" /> Save to file</button>
          +                                <button type="button" class="btn btn-default btn-sm" id="switch" title="Move output to input"><img src="<%- require('../static/images/switch-16x16.png') %>" /> Move output to input</button>
          +                                <button type="button" class="btn btn-default btn-sm" id="undo-switch" title="Undo move" disabled="disabled"><img src="<%- require('../static/images/undo-16x16.png') %>" /> Undo</button>
          +                                <button type="button" class="btn btn-default btn-sm" id="maximise-output" title="Maximise"><img src="<%- require('../static/images/maximise-16x16.png') %>" /> Max</button>
                                       </div>
                                       <div class="io-info" id="output-info"></div>
                                       <div class="io-info" id="output-selection-info"></div>
          @@ -136,7 +139,7 @@
                       <div class="modal-dialog modal-lg">
                           <div class="modal-content">
                               <div class="modal-header">
          -                        <img class="pull-right" src="images/save-22x22.png" />
          +                        <img class="pull-right" src="<%- require('../static/images/save-22x22.png') %>" />
                                   <h4 class="modal-title">Save recipe</h4>
                               </div>
                               <div class="modal-body">
          @@ -171,7 +174,7 @@
                       <div class="modal-dialog modal-lg">
                           <div class="modal-content">
                               <div class="modal-header">
          -                        <img class="pull-right" src="images/open_yellow-24x24.png" />
          +                        <img class="pull-right" src="<%- require('../static/images/open_yellow-24x24.png') %>" />
                                   <h4 class="modal-title">Load recipe</h4>
                               </div>
                               <div class="modal-body">
          @@ -196,7 +199,7 @@
                       <div class="modal-dialog modal-lg">
                           <div class="modal-content">
                               <div class="modal-header">
          -                        <img class="pull-right" src="images/settings-22x22.png" />
          +                        <img class="pull-right" src="<%- require('../static/images/settings-22x22.png') %>" />
                                   <h4 class="modal-title">Options</h4>
                               </div>
                               <div class="modal-body" id="options-body">
          @@ -242,7 +245,7 @@
                       <div class="modal-dialog modal-lg">
                           <div class="modal-content">
                               <div class="modal-header">
          -                        <img class="pull-right" src="images/favourite-24x24.png" />
          +                        <img class="pull-right" src="<%- require('../static/images/favourite-24x24.png') %>" />
                                   <h4 class="modal-title">Edit Favourites</h4>
                               </div>
                               <div class="modal-body" id="options-body">
          @@ -269,44 +272,40 @@
                       <div class="modal-dialog modal-lg">
                           <div class="modal-content">
                               <div class="modal-header">
          -                        <img class="pull-right" src="images/help-22x22.png" />
          +                        <img class="pull-right" src="<%- require('../static/images/help-22x22.png') %>" />
                                   <h4 class="modal-title">CyberChef - The Cyber Swiss Army Knife</h4>
                               </div>
                               <div class="modal-body">
          -                        <img class="about-img-left" src="images/cyberchef-128x128.png" />
          -                        <p class="subtext">Compile time: <%= compileTime %></p>
          +                        <img class="about-img-left" src="<%- require('../static/images/cyberchef-128x128.png') %>" />
          +                        <p class="subtext">Compile time: <%= htmlWebpackPlugin.options.compileTime %></p>
                                   <p>&copy Crown Copyright 2016.</p>
                                   <p>Licenced under the Apache Licence, Version 2.0.</p>
                                   <br>
                                   <br>
                                   <div>
          -                            <ul class='nav nav-tabs' role='tablist'>
          -                                <li role='presentation' class='active'><a href='#faqs' aria-controls='profile' role='tab' data-toggle='tab'>
          -                                    <img src='images/help-16x16.png' />
          +                            <ul class="nav nav-tabs" role="tablist">
          +                                <li role="presentation" class="active"><a href="#faqs" aria-controls="profile" role="tab" data-toggle="tab">
          +                                    <img src="<%- require('../static/images/help-16x16.png') %>" />
                                               FAQs
                                           </a></li>
          -                                <li role='presentation'><a href='#report-bug' aria-controls='messages' role='tab' data-toggle='tab'>
          -                                    <img src='images/bug-16x16.png' />
          +                                <li role="presentation"><a href="#report-bug" aria-controls="messages" role="tab" data-toggle="tab">
          +                                    <img src="<%- require('../static/images/bug-16x16.png') %>" />
                                               Report a bug
                                           </a></li>
          -                                <li role='presentation'><a href='#stats' aria-controls='messages' role='tab' data-toggle='tab'>
          -                                    <img src='images/stats-16x16.png' />
          -                                    Stats
          -                                </a></li>
          -                                <li role='presentation'><a href='#about' aria-controls='messages' role='tab' data-toggle='tab'>
          -                                    <img src='images/speech-16x16.png' />
          +                                <li role="presentation"><a href="#about" aria-controls="messages" role="tab" data-toggle="tab">
          +                                    <img src="<%- require('../static/images/speech-16x16.png') %>" />
                                               About
                                           </a></li>
                                       </ul>
          -                            <div class='tab-content'>
          -                                <div role='tabpanel' class='tab-pane active' id='faqs'>
          +                            <div class="tab-content">
          +                                <div role="tabpanel" class="tab-pane active" id="faqs">
                                               <br>
                                               <blockquote>
          -                                        <a data-toggle='collapse' data-target='#faq-examples'>
          +                                        <a data-toggle="collapse" data-target="#faq-examples">
                                                       What sort of things can I do with CyberChef?
                                                   </a>
                                               </blockquote>
          -                                    <div class='collapse' id='faq-examples'>
          +                                    <div class="collapse" id="faq-examples">
                                                   <p>There are well over 100 operations in CyberChef allowing you to carry simple and complex tasks easily. Here are some examples:</p>
                                                   <ul>
                                                       <li><a href="?recipe=%5B%7B%22op%22%3A%22From%20Base64%22%2C%22args%22%3A%5B%22A-Za-z0-9%2B%2F%3D%22%2Ctrue%5D%7D%5D&input=VTI4Z2JHOXVaeUJoYm1RZ2RHaGhibXR6SUdadmNpQmhiR3dnZEdobElHWnBjMmd1">Decode a Base64-encoded string</a></li>
          @@ -318,39 +317,34 @@
                                                   </ul>
                                               </div>
                                               <blockquote>
          -                                        <a data-toggle='collapse' data-target='#faq-load-files'>
          +                                        <a data-toggle="collapse" data-target="#faq-load-files">
                                                       Can I load input directly from files?
                                                   </a>
                                               </blockquote>
          -                                    <div class='collapse' id='faq-load-files'>
          +                                    <div class="collapse" id="faq-load-files">
                                                   <p>Yes! Just drag your file over the input box and drop it. The contents of the file will be converted into hexadecimal and the 'From Hex' operation will be added to the beginning of the recipe (if it's not already there). This is so that special characters like carriage returns aren't removed by your browser.</p>
                                                   <p>Please note that loading large files is likely to cause a crash. There's not a lot that can be done about this - browsers just aren't very good at handling and displaying large amounts of data.</p>
                                               </div>
                                               <blockquote>
          -                                        <a data-toggle='collapse' data-target='#faq-fork'>
          +                                        <a data-toggle="collapse" data-target="#faq-fork">
                                                       How do I run operation X over multiple inputs at once?
                                                   </a>
                                               </blockquote>
          -                                    <div class='collapse' id='faq-fork'>
          +                                    <div class="collapse" id="faq-fork">
                                                   <p>Maybe you have 10 timestamps that you want to parse or 16 encoded strings that all have the same key.</p>
                                                   <p>The 'Fork' operation (found in the 'Flow control' category) splits up the input line by line and runs all subsequent operations on each line separately. Each output is then displayed on a separate line. These delimiters can be changed, so if your inputs are separated by commas, you can change the split delimiter to a comma instead.</p>
                                                   <p><a href='?recipe=%5B%7B"op"%3A"Fork"%2C"args"%3A%5B"%5C%5Cn"%2C"%5C%5Cn"%5D%7D%2C%7B"op"%3A"From%20UNIX%20Timestamp"%2C"args"%3A%5B"Seconds%20(s)"%5D%7D%5D&input=OTc4MzQ2ODAwCjEwMTI2NTEyMDAKMTA0NjY5NjQwMAoxMDgxMDg3MjAwCjExMTUzMDUyMDAKMTE0OTYwOTYwMA%3D%3D'>Click here</a> for an example.</p>
                                               </div>
                                           </div>
          -                                <div role='tabpanel' class='tab-pane' id='report-bug'>
          +                                <div role="tabpanel" class="tab-pane" id="report-bug">
                                               <br>
                                               <p>If you find a bug in CyberChef, please raise an issue in our GitHub repository explaining it in as much detail as possible. Copy and include the following information if relevant.</p>
                                               <br>
          -                                    <pre id='report-bug-info'></pre>
          +                                    <pre id="report-bug-info"></pre>
                                               <br>
                                               <a class="btn btn-primary" href="https://github.com/gchq/CyberChef/issues/new" role="button">Raise issue on GitHub</a>
                                           </div>
          -                                <div role='tabpanel' class='tab-pane' id='stats'>
          -                                    <br>
          -                                    <p>If you're a nerd like me, you might find statistics really fun! Here's some about the CyberChef code base:</p>
          -                                    <br><pre><%= codebaseStats %></pre>
          -                                </div>
          -                                <div role='tabpanel' class='tab-pane' id='about' style="padding: 20px;">
          +                                <div role="tabpanel" class="tab-pane" id="about" style="padding: 20px;">
                                               <h4>What</h4>
                                               <p>A simple, intuitive web app for analysing and decoding data without having to deal with complex tools or programming languages. CyberChef encourages both technical and non-technical people to explore data formats, encryption and compression.</p>
                                               
          @@ -378,7 +372,7 @@
                                   <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                               </div>
                               <a href="https://github.com/gchq/CyberChef">
          -                        <img style="position: absolute; top: 0; right: 0; border: 0;" src="images/fork_me.png" alt="Fork me on GitHub">
          +                        <img style="position: absolute; top: 0; right: 0; border: 0;" src="<%- require('../static/images/fork_me.png') %>" alt="Fork me on GitHub">
                               </a>
                           </div>
                       </div>
          @@ -393,11 +387,11 @@
                               <div class="modal-body" id="confirm-body"></div>
                               <div class="modal-footer">
                                   <button type="button" class="btn btn-success" id="confirm-yes">
          -                            <img src="images/thumb_up-16x16.png" />
          +                            <img src="<%- require('../static/images/thumb_up-16x16.png') %>" />
                                       Yes
                                   </button>
                                   <button type="button" class="btn btn-danger" id="confirm-no" data-dismiss="modal">
          -                            <img src="images/thumb_down-16x16.png" />
          +                            <img src="<%- require('../static/images/thumb_down-16x16.png') %>" />
                                       No
                                   </button>
                               </div>
          @@ -405,6 +399,5 @@
                       </div>
                   </div>
                   
          -        <script type="application/javascript" src="scripts.js"></script>
               </body>
           </html>
          diff --git a/src/js/views/html/main.js b/src/web/index.js
          similarity index 60%
          rename from src/js/views/html/main.js
          rename to src/web/index.js
          index 72f891e..8976b4f 100755
          --- a/src/js/views/html/main.js
          +++ b/src/web/index.js
          @@ -1,11 +1,25 @@
          -/* globals moment */
          -
           /**
            * @author n1474335 [n1474335@gmail.com]
            * @copyright Crown Copyright 2016
            * @license Apache-2.0
            */
           
          +// CSS
          +import "./css/index.js";
          +
          +// Libs
          +import "babel-polyfill";
          +import "bootstrap";
          +import "bootstrap-switch";
          +import "bootstrap-colorpicker";
          +import CanvasComponents from "../core/lib/canvascomponents.js";
          +
          +// CyberChef
          +import App from "./App.js";
          +import Categories from "../core/config/Categories.js";
          +import OperationConfig from "../core/config/OperationConfig.js";
          +
          +
           /**
            * Main function used to build the CyberChef web app.
            */
          @@ -32,18 +46,20 @@ var main = function() {
                   errorTimeout      : 4000,
                   autoBakeThreshold : 200,
                   attemptHighlight  : true,
          -        snow              : false,
               };
           
               document.removeEventListener("DOMContentLoaded", main, false);
          -    window.app = new HTMLApp(Categories, OperationConfig, defaultFavourites, defaultOptions);
          +    window.app = new App(Categories, OperationConfig, defaultFavourites, defaultOptions);
               window.app.setup();
           };
           
           // Fix issues with browsers that don't support console.log()
           window.console = console || {log: function() {}, error: function() {}};
           
          -window.compileTime = moment.tz("<%= compileTime %>", "DD/MM/YYYY HH:mm:ss z", "UTC").valueOf();
          -window.compileMessage = "<%= compileMsg %>";
          +window.compileTime = moment.tz(COMPILE_TIME, "DD/MM/YYYY HH:mm:ss z", "UTC").valueOf();
          +window.compileMessage = COMPILE_MSG;
          +
          +// Make libs available to operation outputs
          +window.CanvasComponents = CanvasComponents;
           
           document.addEventListener("DOMContentLoaded", main, false);
          diff --git a/src/static/ga.html b/src/web/static/ga.html
          similarity index 100%
          rename from src/static/ga.html
          rename to src/web/static/ga.html
          diff --git a/build/prod/images/breakpoint-16x16.png b/src/web/static/images/breakpoint-16x16.png
          similarity index 100%
          rename from build/prod/images/breakpoint-16x16.png
          rename to src/web/static/images/breakpoint-16x16.png
          diff --git a/build/prod/images/bug-16x16.png b/src/web/static/images/bug-16x16.png
          similarity index 100%
          rename from build/prod/images/bug-16x16.png
          rename to src/web/static/images/bug-16x16.png
          diff --git a/build/prod/images/clean-16x16.png b/src/web/static/images/clean-16x16.png
          similarity index 100%
          rename from build/prod/images/clean-16x16.png
          rename to src/web/static/images/clean-16x16.png
          diff --git a/build/prod/images/code-16x16.png b/src/web/static/images/code-16x16.png
          similarity index 100%
          rename from build/prod/images/code-16x16.png
          rename to src/web/static/images/code-16x16.png
          diff --git a/build/prod/images/cook_female-32x32.png b/src/web/static/images/cook_female-32x32.png
          similarity index 100%
          rename from build/prod/images/cook_female-32x32.png
          rename to src/web/static/images/cook_female-32x32.png
          diff --git a/build/prod/images/cook_male-32x32.png b/src/web/static/images/cook_male-32x32.png
          similarity index 100%
          rename from build/prod/images/cook_male-32x32.png
          rename to src/web/static/images/cook_male-32x32.png
          diff --git a/build/prod/images/cyberchef-128x128.png b/src/web/static/images/cyberchef-128x128.png
          similarity index 100%
          rename from build/prod/images/cyberchef-128x128.png
          rename to src/web/static/images/cyberchef-128x128.png
          diff --git a/build/prod/images/cyberchef-16x16.png b/src/web/static/images/cyberchef-16x16.png
          similarity index 100%
          rename from build/prod/images/cyberchef-16x16.png
          rename to src/web/static/images/cyberchef-16x16.png
          diff --git a/build/prod/images/cyberchef-256x256.png b/src/web/static/images/cyberchef-256x256.png
          similarity index 100%
          rename from build/prod/images/cyberchef-256x256.png
          rename to src/web/static/images/cyberchef-256x256.png
          diff --git a/build/prod/images/cyberchef-32x32.png b/src/web/static/images/cyberchef-32x32.png
          similarity index 100%
          rename from build/prod/images/cyberchef-32x32.png
          rename to src/web/static/images/cyberchef-32x32.png
          diff --git a/build/prod/images/cyberchef-512x512.png b/src/web/static/images/cyberchef-512x512.png
          similarity index 100%
          rename from build/prod/images/cyberchef-512x512.png
          rename to src/web/static/images/cyberchef-512x512.png
          diff --git a/build/prod/images/cyberchef-64x64.png b/src/web/static/images/cyberchef-64x64.png
          similarity index 100%
          rename from build/prod/images/cyberchef-64x64.png
          rename to src/web/static/images/cyberchef-64x64.png
          diff --git a/build/prod/images/disable_deselected-16x16.png b/src/web/static/images/disable_deselected-16x16.png
          similarity index 100%
          rename from build/prod/images/disable_deselected-16x16.png
          rename to src/web/static/images/disable_deselected-16x16.png
          diff --git a/build/prod/images/disable_selected-16x16.png b/src/web/static/images/disable_selected-16x16.png
          similarity index 100%
          rename from build/prod/images/disable_selected-16x16.png
          rename to src/web/static/images/disable_selected-16x16.png
          diff --git a/build/prod/images/download-24x24.png b/src/web/static/images/download-24x24.png
          similarity index 100%
          rename from build/prod/images/download-24x24.png
          rename to src/web/static/images/download-24x24.png
          diff --git a/build/prod/images/erase-16x16.png b/src/web/static/images/erase-16x16.png
          similarity index 100%
          rename from build/prod/images/erase-16x16.png
          rename to src/web/static/images/erase-16x16.png
          diff --git a/build/prod/images/favicon.ico b/src/web/static/images/favicon.ico
          similarity index 100%
          rename from build/prod/images/favicon.ico
          rename to src/web/static/images/favicon.ico
          diff --git a/build/prod/images/favourite-16x16.png b/src/web/static/images/favourite-16x16.png
          similarity index 100%
          rename from build/prod/images/favourite-16x16.png
          rename to src/web/static/images/favourite-16x16.png
          diff --git a/build/prod/images/favourite-24x24.png b/src/web/static/images/favourite-24x24.png
          similarity index 100%
          rename from build/prod/images/favourite-24x24.png
          rename to src/web/static/images/favourite-24x24.png
          diff --git a/build/prod/images/fork_me.png b/src/web/static/images/fork_me.png
          old mode 100755
          new mode 100644
          similarity index 100%
          rename from build/prod/images/fork_me.png
          rename to src/web/static/images/fork_me.png
          diff --git a/build/prod/images/help-16x16.png b/src/web/static/images/help-16x16.png
          similarity index 100%
          rename from build/prod/images/help-16x16.png
          rename to src/web/static/images/help-16x16.png
          diff --git a/build/prod/images/help-22x22.png b/src/web/static/images/help-22x22.png
          similarity index 100%
          rename from build/prod/images/help-22x22.png
          rename to src/web/static/images/help-22x22.png
          diff --git a/build/prod/images/info-16x16.png b/src/web/static/images/info-16x16.png
          similarity index 100%
          rename from build/prod/images/info-16x16.png
          rename to src/web/static/images/info-16x16.png
          diff --git a/build/prod/images/layout-16x16.png b/src/web/static/images/layout-16x16.png
          similarity index 100%
          rename from build/prod/images/layout-16x16.png
          rename to src/web/static/images/layout-16x16.png
          diff --git a/build/prod/images/mail-16x16.png b/src/web/static/images/mail-16x16.png
          similarity index 100%
          rename from build/prod/images/mail-16x16.png
          rename to src/web/static/images/mail-16x16.png
          diff --git a/build/prod/images/maximise-16x16.png b/src/web/static/images/maximise-16x16.png
          similarity index 100%
          rename from build/prod/images/maximise-16x16.png
          rename to src/web/static/images/maximise-16x16.png
          diff --git a/build/prod/images/open_yellow-16x16.png b/src/web/static/images/open_yellow-16x16.png
          similarity index 100%
          rename from build/prod/images/open_yellow-16x16.png
          rename to src/web/static/images/open_yellow-16x16.png
          diff --git a/build/prod/images/open_yellow-24x24.png b/src/web/static/images/open_yellow-24x24.png
          similarity index 100%
          rename from build/prod/images/open_yellow-24x24.png
          rename to src/web/static/images/open_yellow-24x24.png
          diff --git a/build/prod/images/recycle-16x16.png b/src/web/static/images/recycle-16x16.png
          similarity index 100%
          rename from build/prod/images/recycle-16x16.png
          rename to src/web/static/images/recycle-16x16.png
          diff --git a/build/prod/images/remove-16x16.png b/src/web/static/images/remove-16x16.png
          similarity index 100%
          rename from build/prod/images/remove-16x16.png
          rename to src/web/static/images/remove-16x16.png
          diff --git a/build/prod/images/restore-16x16.png b/src/web/static/images/restore-16x16.png
          similarity index 100%
          rename from build/prod/images/restore-16x16.png
          rename to src/web/static/images/restore-16x16.png
          diff --git a/build/prod/images/save-16x16.png b/src/web/static/images/save-16x16.png
          similarity index 100%
          rename from build/prod/images/save-16x16.png
          rename to src/web/static/images/save-16x16.png
          diff --git a/build/prod/images/save-22x22.png b/src/web/static/images/save-22x22.png
          similarity index 100%
          rename from build/prod/images/save-22x22.png
          rename to src/web/static/images/save-22x22.png
          diff --git a/build/prod/images/save_as-16x16.png b/src/web/static/images/save_as-16x16.png
          similarity index 100%
          rename from build/prod/images/save_as-16x16.png
          rename to src/web/static/images/save_as-16x16.png
          diff --git a/build/prod/images/settings-22x22.png b/src/web/static/images/settings-22x22.png
          similarity index 100%
          rename from build/prod/images/settings-22x22.png
          rename to src/web/static/images/settings-22x22.png
          diff --git a/build/prod/images/speech-16x16.png b/src/web/static/images/speech-16x16.png
          similarity index 100%
          rename from build/prod/images/speech-16x16.png
          rename to src/web/static/images/speech-16x16.png
          diff --git a/build/prod/images/stats-16x16.png b/src/web/static/images/stats-16x16.png
          similarity index 100%
          rename from build/prod/images/stats-16x16.png
          rename to src/web/static/images/stats-16x16.png
          diff --git a/build/prod/images/step-16x16.png b/src/web/static/images/step-16x16.png
          similarity index 100%
          rename from build/prod/images/step-16x16.png
          rename to src/web/static/images/step-16x16.png
          diff --git a/build/prod/images/switch-16x16.png b/src/web/static/images/switch-16x16.png
          similarity index 100%
          rename from build/prod/images/switch-16x16.png
          rename to src/web/static/images/switch-16x16.png
          diff --git a/build/prod/images/thumb_down-16x16.png b/src/web/static/images/thumb_down-16x16.png
          similarity index 100%
          rename from build/prod/images/thumb_down-16x16.png
          rename to src/web/static/images/thumb_down-16x16.png
          diff --git a/build/prod/images/thumb_up-16x16.png b/src/web/static/images/thumb_up-16x16.png
          similarity index 100%
          rename from build/prod/images/thumb_up-16x16.png
          rename to src/web/static/images/thumb_up-16x16.png
          diff --git a/build/prod/images/undo-16x16.png b/src/web/static/images/undo-16x16.png
          similarity index 100%
          rename from build/prod/images/undo-16x16.png
          rename to src/web/static/images/undo-16x16.png
          diff --git a/test/NodeRunner.js b/test/NodeRunner.js
          deleted file mode 100644
          index 645f41f..0000000
          --- a/test/NodeRunner.js
          +++ /dev/null
          @@ -1,24 +0,0 @@
          -/* eslint-env node */
          -
          -/**
          - * NodeRunner.js
          - *
          - * The purpose of this file is to execute via PhantomJS the file
          - * PhantomRunner.js, because PhantomJS is managed by node.
          - *
          - * @author tlwr [toby@toby.codes]
          - * @copyright Crown Copyright 2017
          - * @license Apache-2.0
          - */
          -
          -var path = require("path"),
          -    phantomjs = require("phantomjs-prebuilt"),
          -    phantomEntryPoint = path.join(__dirname, "PhantomRunner.js"),
          -    program = phantomjs.exec(phantomEntryPoint);
          -
          -program.stdout.pipe(process.stdout);
          -program.stderr.pipe(process.stderr);
          -
          -program.on("exit", function(status) {
          -    process.exit(status);
          -});
          diff --git a/test/PhantomRunner.js b/test/PhantomRunner.js
          deleted file mode 100644
          index 536cc0d..0000000
          --- a/test/PhantomRunner.js
          +++ /dev/null
          @@ -1,99 +0,0 @@
          -/* eslint-env node */
          -/* globals phantom */
          -
          -/**
          - * PhantomRunner.js
          - *
          - * This file navigates to build/test/index.html and logs the test results.
          - *
          - * @author tlwr [toby@toby.codes]
          - * @copyright Crown Copyright 2017
          - * @license Apache-2.0
          - */
          -
          -var page = require("webpage").create(),
          -    allTestsPassing = true,
          -    testStatusCounts = {
          -        total: 0,
          -    };
          -
          -
          -/**
          - * Helper function to convert a status to an icon.
          - *
          - * @param {string} status
          - * @returns {string}
          - */
          -function statusToIcon(status) {
          -    var icons = {
          -        erroring: "🔥",
          -        failing: "❌",
          -        passing: "✔️️",
          -    };
          -    return icons[status] || "?";
          -}
          -
          -
          -/**
          - * Callback function to handle test results.
          - */
          -page.onCallback = function(messageType) {
          -    if (messageType === "testResult") {
          -        var testResult = arguments[1];
          -
          -        allTestsPassing = allTestsPassing && testResult.status === "passing";
          -        var newCount = (testStatusCounts[testResult.status] || 0) + 1;
          -        testStatusCounts[testResult.status] = newCount;
          -        testStatusCounts.total += 1;
          -
          -        console.log([
          -            statusToIcon(testResult.status),
          -            testResult.test.name
          -        ].join(" "));
          -
          -        if (testResult.output) {
          -            console.log(
          -                testResult.output
          -                    .trim()
          -                    .replace(/^/, "\t")
          -                    .replace(/\n/g, "\n\t")
          -            );
          -        }
          -    } else if (messageType === "exit") {
          -
          -        console.log("\n");
          -
          -        for (var testStatus in testStatusCounts) {
          -            var count = testStatusCounts[testStatus];
          -            if (count > 0) {
          -                console.log(testStatus.toUpperCase(), count);
          -            }
          -        }
          -
          -        if (!allTestsPassing) {
          -            console.log("\nNot all tests are passing");
          -        }
          -
          -        phantom.exit(allTestsPassing ? 0 : 1);
          -    }
          -};
          -
          -
          -/**
          - * Open the test webpage in PhantomJS.
          - */
          -page.open("build/test/index.html", function(status) {
          -    if (status !== "success") {
          -        console.log("STATUS: ", status);
          -        phantom.exit(1);
          -    }
          -});
          -
          -
          -/**
          - * Fail if the process takes longer than 10 seconds.
          - */
          -setTimeout(function() {
          -    console.log("Tests took longer than 10 seconds to run, returning.");
          -    phantom.exit(1);
          -}, 10 * 1000);
          diff --git a/test/TestRegister.js b/test/TestRegister.js
          index 2c4b620..fdd3431 100644
          --- a/test/TestRegister.js
          +++ b/test/TestRegister.js
          @@ -8,6 +8,7 @@
            * @copyright Crown Copyright 2017
            * @license Apache-2.0
            */
          +import Chef from "../src/core/Chef.js";
           
           (function() {
               /**
          @@ -85,5 +86,8 @@
           
           
               // Singleton TestRegister, keeping things simple and obvious.
          -    window.TestRegister = new TestRegister();
          +    global.TestRegister = global.TestRegister || new TestRegister();
           })();
          +
          +export default global.TestRegister;
          +
          diff --git a/test/TestRunner.js b/test/TestRunner.js
          deleted file mode 100644
          index 8b3e85e..0000000
          --- a/test/TestRunner.js
          +++ /dev/null
          @@ -1,38 +0,0 @@
          -/**
          - * TestRunner.js
          - *
          - * This is for actually running the tests in the test register.
          - *
          - * @author tlwr [toby@toby.codes]
          - * @copyright Crown Copyright 2017
          - * @license Apache-2.0
          - */
          -
          -document.addEventListener("DOMContentLoaded", function() {
          -    TestRegister.runTests()
          -    .then(function(results) {
          -        results.forEach(function(testResult) {
          -
          -            if (typeof window.callPhantom === "function") {
          -                // If we're running this in PhantomJS
          -                window.callPhantom(
          -                    "testResult",
          -                    testResult
          -                );
          -            } else {
          -                // If we're just viewing this in a normal browser
          -                var output = [
          -                    "----------",
          -                    testResult.test.name,
          -                    testResult.status,
          -                    testResult.output,
          -                ].join("<br>");
          -                document.querySelector("main").innerHTML += output;
          -            }
          -        });
          -
          -        if (typeof window.callPhantom === "function") {
          -            window.callPhantom("exit");
          -        }
          -    });
          -});
          diff --git a/test/index.js b/test/index.js
          new file mode 100644
          index 0000000..fba3e43
          --- /dev/null
          +++ b/test/index.js
          @@ -0,0 +1,96 @@
          +/**
          + * TestRunner.js
          + *
          + * For running the tests in the test register.
          + *
          + * @author tlwr [toby@toby.codes]
          + * @author n1474335 [n1474335@gmail.com]
          + * @copyright Crown Copyright 2017
          + * @license Apache-2.0
          + */
          +import "babel-polyfill";
          +
          +import TestRegister from "./TestRegister.js";
          +import "./tests/operations/Base58.js";
          +import "./tests/operations/Compress.js";
          +import "./tests/operations/FlowControl.js";
          +import "./tests/operations/MorseCode.js";
          +import "./tests/operations/StrUtils.js";
          +
          +var allTestsPassing = true,
          +    testStatusCounts = {
          +        total: 0,
          +    };
          +
          +
          +/**
          + * Helper function to convert a status to an icon.
          + *
          + * @param {string} status
          + * @returns {string}
          + */
          +function statusToIcon(status) {
          +    var icons = {
          +        erroring: "🔥",
          +        failing: "❌",
          +        passing: "✔️️",
          +    };
          +    return icons[status] || "?";
          +}
          +
          +
          +/**
          + * Displays a given test result in the console.
          + *
          + * @param {Object} testResult
          + */
          +function handleTestResult(testResult) {
          +    allTestsPassing = allTestsPassing && testResult.status === "passing";
          +    var newCount = (testStatusCounts[testResult.status] || 0) + 1;
          +    testStatusCounts[testResult.status] = newCount;
          +    testStatusCounts.total += 1;
          +
          +    console.log([
          +        statusToIcon(testResult.status),
          +        testResult.test.name
          +    ].join(" "));
          +
          +    if (testResult.output) {
          +        console.log(
          +            testResult.output
          +                .trim()
          +                .replace(/^/, "\t")
          +                .replace(/\n/g, "\n\t")
          +        );
          +    }
          +}
          +
          +
          +/**
          + * Fail if the process takes longer than 10 seconds.
          + */
          +setTimeout(function() {
          +    console.log("Tests took longer than 10 seconds to run, returning.");
          +    process.exit(1);
          +}, 1 * 1000);
          +
          +
          +TestRegister.runTests()
          +    .then(function(results) {
          +        results.forEach(handleTestResult);
          +
          +        console.log("\n");
          +
          +        for (var testStatus in testStatusCounts) {
          +            var count = testStatusCounts[testStatus];
          +            if (count > 0) {
          +                console.log(testStatus.toUpperCase(), count);
          +            }
          +        }
          +
          +        if (!allTestsPassing) {
          +            console.log("\nNot all tests are passing");
          +        }
          +
          +        process.exit(allTestsPassing ? 0 : 1);
          +    });
          diff --git a/test/test.html b/test/test.html
          deleted file mode 100755
          index f39cb7b..0000000
          --- a/test/test.html
          +++ /dev/null
          @@ -1,33 +0,0 @@
          -<!--
          -    CyberChef test suite
          -    
          -    @author tlwr [toby@toby.codes]
          -
          -    @copyright Crown Copyright 2017
          -    @license Apache-2.0
          -    
          -      Copyright 2017 Crown Copyright
          -    
          -    Licensed under the Apache License, Version 2.0 (the "License");
          -    you may not use this file except in compliance with the License.
          -    You may obtain a copy of the License at
          -    
          -        http://www.apache.org/licenses/LICENSE-2.0
          -    
          -    Unless required by applicable law or agreed to in writing, software
          -    distributed under the License is distributed on an "AS IS" BASIS,
          -    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
          -    See the License for the specific language governing permissions and
          -    limitations under the License.
          --->
          -<!DOCTYPE html>
          -<html>
          -    <head>
          -        <meta charset="UTF-8">
          -        <title>CyberChef test suite</title>
          -    </head>
          -    <body>
          -        <main style="white-space: pre"></main>
          -        <script type="application/javascript" src="tests.js"></script>
          -    </body>
          -</html>
          diff --git a/test/tests/operations/Base58.js b/test/tests/operations/Base58.js
          index 403cc30..d09a3fc 100644
          --- a/test/tests/operations/Base58.js
          +++ b/test/tests/operations/Base58.js
          @@ -6,6 +6,8 @@
            * @copyright Crown Copyright 2017
            * @license Apache-2.0
            */
          +import TestRegister from "../../TestRegister.js";
          +
           TestRegister.addTests([
               {
                   name: "To Base58 (Bitcoin): nothing",
          diff --git a/test/tests/operations/Compress.js b/test/tests/operations/Compress.js
          new file mode 100644
          index 0000000..41046b4
          --- /dev/null
          +++ b/test/tests/operations/Compress.js
          @@ -0,0 +1,26 @@
          +/**
          + * Compress tests.
          + *
          + * @author n1474335 [n1474335@gmail.com]
          + * @copyright Crown Copyright 2017
          + * @license Apache-2.0
          + */
          +import TestRegister from "../../TestRegister.js";
          +
          +TestRegister.addTests([
          +    {
          +        name: "Bzip2 decompress",
          +        input: "425a6839314159265359b218ed630000031380400104002a438c00200021a9ea601a10003202185d5ed68ca6442f1e177245385090b218ed63",
          +        expectedOutput: "The cat sat on the mat.",
          +        recipeConfig: [
          +            {
          +                "op" : "From Hex",
          +                "args" : ["Space"]
          +            },
          +            {
          +                "op" : "Bzip2 Decompress",
          +                "args" : []
          +            }
          +        ],
          +    },
          +]);
          diff --git a/test/tests/operations/FlowControl.js b/test/tests/operations/FlowControl.js
          index 59c7f96..96ae2e8 100644
          --- a/test/tests/operations/FlowControl.js
          +++ b/test/tests/operations/FlowControl.js
          @@ -6,6 +6,8 @@
            * @copyright Crown Copyright 2017
            * @license Apache-2.0
            */
          +import TestRegister from "../../TestRegister.js";
          +
           TestRegister.addTests([
               {
                   name: "Fork: nothing",
          diff --git a/test/tests/operations/MorseCode.js b/test/tests/operations/MorseCode.js
          index fc0bc25..4f4d59f 100644
          --- a/test/tests/operations/MorseCode.js
          +++ b/test/tests/operations/MorseCode.js
          @@ -6,6 +6,8 @@
            * @copyright Crown Copyright 2017
            * @license Apache-2.0
            */
          +import TestRegister from "../../TestRegister.js";
          +
           TestRegister.addTests([
               {
                   name: "To Morse Code: 'SOS'",
          diff --git a/test/tests/operations/StrUtils.js b/test/tests/operations/StrUtils.js
          index 0d91d18..ada8913 100644
          --- a/test/tests/operations/StrUtils.js
          +++ b/test/tests/operations/StrUtils.js
          @@ -5,6 +5,8 @@
            * @copyright Crown Copyright 2017
            * @license Apache-2.0
            */
          +import TestRegister from "../../TestRegister.js";
          +
           TestRegister.addTests([
               {
                   name: "Regex, non-HTML op",
          @@ -21,4 +23,15 @@ TestRegister.addTests([
                       }
                   ],
               },
          +    {
          +        name: "Diff, basic usage",
          +        input: "testing23\n\ntesting123",
          +        expectedOutput: "testing<span class='hlgreen'>1</span>23",
          +        recipeConfig: [
          +            {
          +                "op": "Diff",
          +                "args": ["\\n\\n", "Character", true, true, false]
          +            }
          +        ],
          +    },
           ]);